9 lines
54 KiB
JavaScript
9 lines
54 KiB
JavaScript
!/**
|
|
* Highcharts JS v11.4.1 (2024-04-04)
|
|
*
|
|
* Highcharts
|
|
*
|
|
* (c) 2010-2024 Highsoft AS
|
|
*
|
|
* License: www.highcharts.com/license
|
|
*/function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/modules/data-tools",["highcharts"],function(t){return e(t),e.Highcharts=t,e}):e("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(e){"use strict";var t=e?e._modules:{};function r(e,t,r,s){e.hasOwnProperty(t)||(e[t]=s.apply(null,r),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:e[t]}})))}r(t,"Data/Modifiers/DataModifier.js",[t["Core/Utilities.js"]],function(e){var t;let{addEvent:r,fireEvent:s,merge:o}=e;class n{benchmark(e,t){let r=[],s=this,n=()=>{s.modifyTable(e),s.emit({type:"afterBenchmarkIteration"})},{iterations:i}=o({iterations:1},t);s.on("afterBenchmarkIteration",()=>{if(r.length===i){s.emit({type:"afterBenchmark",results:r});return}n()});let l={startTime:0,endTime:0};return s.on("modify",()=>{l.startTime=window.performance.now()}),s.on("afterModify",()=>{l.endTime=window.performance.now(),r.push(l.endTime-l.startTime)}),n(),r}emit(e){s(this,e.type,e)}modify(e,t){let r=this;return new Promise((s,o)=>{e.modified===e&&(e.modified=e.clone(!1,t));try{s(r.modifyTable(e,t))}catch(s){r.emit({type:"error",detail:t,table:e}),o(s)}})}modifyCell(e,t,r,s,o){return this.modifyTable(e)}modifyColumns(e,t,r,s){return this.modifyTable(e)}modifyRows(e,t,r,s){return this.modifyTable(e)}on(e,t){return r(this,e,t)}}return(t=n||(n={})).types={},t.registerType=function(e,r){return!!e&&!t.types[e]&&!!(t.types[e]=r)},n}),r(t,"Data/DataTable.js",[t["Core/Utilities.js"]],function(e){let{addEvent:t,fireEvent:r,uniqueKey:s}=e;class o{static isNull(e){if(e===o.NULL)return!0;if(e instanceof Array){if(!e.length)return!1;for(let t=0,r=e.length;t<r;++t)if(null!==e[t])return!1}else{let t=Object.keys(e);if(!t.length)return!1;for(let r=0,s=t.length;r<s;++r)if(null!==e[t[r]])return!1}return!0}constructor(e={}){this.aliases=e.aliases?JSON.parse(JSON.stringify(e.aliases)):{},this.autoId=!e.id,this.columns={},this.id=e.id||s(),this.modified=this,this.rowCount=0,this.versionTag=s();let t=e.columns||{},r=Object.keys(t),o=this.columns,n=0;for(let e=0,s=r.length,i,l;e<s;++e)i=t[l=r[e]].slice(),o[l]=i,n=Math.max(n,i.length);for(let e=0,t=r.length;e<t;++e)o[r[e]].length=n;this.rowCount=n;let i=e.aliases||{},l=Object.keys(i),a=this.aliases;for(let e=0,t=l.length,r;e<t;++e)a[r=l[e]]=i[r]}clone(e,t){let r={};this.emit({type:"cloneTable",detail:t}),e||(r.aliases=this.aliases,r.columns=this.columns),this.autoId||(r.id=this.id);let s=new o(r);return e||(s.versionTag=this.versionTag),this.emit({type:"afterCloneTable",detail:t,tableClone:s}),s}deleteColumnAlias(e){let t=this.aliases[e],r=this.modifier;return t&&(delete this.aliases[e],r&&r.modifyColumns(this,{[t]:Array(this.rowCount)},0)),t}deleteColumns(e,t){let r=this.columns,s={},o={},n=this.modifier,i=this.rowCount;if((e=e||Object.keys(r)).length){this.emit({type:"deleteColumns",columnNames:e,detail:t});for(let t=0,n=e.length,l,a;t<n;++t)(l=r[a=e[t]])&&(s[a]=l,o[a]=Array(i)),delete r[a];return Object.keys(r).length||(this.rowCount=0),n&&n.modifyColumns(this,o,0,t),this.emit({type:"afterDeleteColumns",columns:s,columnNames:e,detail:t}),s}}deleteRows(e,t=1,r){let s=[],o=[],n=this.modifier;if(this.emit({type:"deleteRows",detail:r,rowCount:t,rowIndex:e||0}),void 0===e&&(e=0,t=this.rowCount),t>0&&e<this.rowCount){let r=this.columns,n=Object.keys(r);for(let i=0,l=n.length,a,u;i<l;++i){u=(a=r[n[i]]).splice(e,t),i||(this.rowCount=a.length);for(let e=0,t=u.length;e<t;++e)s[e]=s[e]||[],s[e][i]=u[e];o.push(Array(l))}}return n&&n.modifyRows(this,o,e||0,r),this.emit({type:"afterDeleteRows",detail:r,rowCount:t,rowIndex:e||0,rows:s}),s}emit(e){switch(e.type){case"afterDeleteColumns":case"afterDeleteRows":case"afterSetCell":case"afterSetColumns":case"afterSetRows":this.versionTag=s()}r(this,e.type,e)}getCell(e,t){e=this.aliases[e]||e;let r=this.columns[e];if(r)return r[t]}getCellAsBoolean(e,t){e=this.aliases[e]||e;let r=this.columns[e];return!!(r&&r[t])}getCellAsNumber(e,t,r){e=this.aliases[e]||e;let s=this.columns[e],o=s&&s[t];switch(typeof o){case"boolean":return o?1:0;case"number":return isNaN(o)&&!r?null:o}return isNaN(o=parseFloat(`${o}`))&&!r?null:o}getCellAsString(e,t){e=this.aliases[e]||e;let r=this.columns[e];return`${r&&r[t]}`}getColumn(e,t){return this.getColumns([e],t)[e]}getColumnAsNumbers(e,t){let r=this.columns[e=this.aliases[e]||e],s=[];if(r){let o=r.length;if(t)for(let t=0;t<o;++t)s.push(this.getCellAsNumber(e,t,!0));else{for(let e=0,t;e<o;++e){if("number"==typeof(t=r[e]))return r.slice();if(null!=t)break}for(let t=0;t<o;++t)s.push(this.getCellAsNumber(e,t))}}return s}getColumnNames(){return Object.keys(this.columns)}getColumns(e,t){let r=this.aliases,s=this.columns,o={};e=e||Object.keys(s);for(let n=0,i=e.length,l,a;n<i;++n)(l=s[r[a=e[n]]||a])&&(o[a]=t?l:l.slice());return o}getModifier(){return this.modifier}getRow(e,t){return this.getRows(e,1,t)[0]}getRowCount(){return this.rowCount}getRowIndexBy(e,t,r){e=this.aliases[e]||e;let s=this.columns[e];if(s){let e=s.indexOf(t,r);if(-1!==e)return e}}getRowObject(e,t){return this.getRowObjects(e,1,t)[0]}getRowObjects(e=0,t=this.rowCount-e,r){let s=this.aliases,o=this.columns,n=Array(t);r=r||Object.keys(o);for(let i=e,l=0,a=Math.min(this.rowCount,e+t),u,h;i<a;++i,++l)for(let e of(h=n[l]={},r))u=o[s[e]||e],h[e]=u?u[i]:void 0;return n}getRows(e=0,t=this.rowCount-e,r){let s=this.aliases,o=this.columns,n=Array(t);r=r||Object.keys(o);for(let i=e,l=0,a=Math.min(this.rowCount,e+t),u,h;i<a;++i,++l)for(let e of(h=n[l]=[],r))u=o[s[e]||e],h.push(u?u[i]:void 0);return n}getVersionTag(){return this.versionTag}hasColumns(e){let t=this.aliases,r=this.columns;for(let s=0,o=e.length,n;s<o;++s)if(!r[n=e[s]]&&!t[n])return!1;return!0}hasRowWith(e,t){e=this.aliases[e]||e;let r=this.columns[e];return!!r&&-1!==r.indexOf(t)}on(e,r){return t(this,e,r)}renameColumn(e,t){let r=this.columns;if(r[e]){if(e!==t){let s=this.aliases;s[t]&&delete s[t],r[t]=r[e],delete r[e]}return!0}return!1}setCell(e,t,r,s){let o=this.columns,n=this.modifier,i=o[e=this.aliases[e]||e];i&&i[t]===r||(this.emit({type:"setCell",cellValue:r,columnName:e,detail:s,rowIndex:t}),i||(i=o[e]=Array(this.rowCount)),t>=this.rowCount&&(this.rowCount=t+1),i[t]=r,n&&n.modifyCell(this,e,t,r),this.emit({type:"afterSetCell",cellValue:r,columnName:e,detail:s,rowIndex:t}))}setColumn(e,t=[],r=0,s){this.setColumns({[e]:t},r,s)}setColumns(e,t,r){let s=this.columns,o=this.modifier,n=void 0===t,i=Object.keys(e);this.emit({type:"setColumns",columns:e,columnNames:i,detail:r,rowIndex:t});for(let r=0,o=i.length,l,a;r<o;++r)if(l=e[a=i[r]],a=this.aliases[a]||a,n)s[a]=l.slice(),this.rowCount=l.length;else{let e=s[a]?s[a]:s[a]=Array(this.rowCount);for(let r=t||0,s=l.length;r<s;++r)e[r]=l[r];this.rowCount=Math.max(this.rowCount,e.length)}let l=Object.keys(s);for(let e=0,t=l.length;e<t;++e)s[l[e]].length=this.rowCount;o&&o.modifyColumns(this,e,t||0),this.emit({type:"afterSetColumns",columns:e,columnNames:i,detail:r,rowIndex:t})}setModifier(e,t){let r=this;return r.emit({type:"setModifier",detail:t,modifier:e,modified:r.modified}),r.modified=r,r.modifier=e,(e?e.modify(r):Promise.resolve(r)).then(r=>(r.emit({type:"afterSetModifier",detail:t,modifier:e,modified:r.modified}),r)).catch(t=>{throw r.emit({type:"setModifierError",error:t,modifier:e,modified:r.modified}),t})}setRow(e,t,r){this.setRows([e],t,r)}setRows(e,t=this.rowCount,r){let s=this.aliases,n=this.columns,i=Object.keys(n),l=this.modifier,a=e.length;this.emit({type:"setRows",detail:r,rowCount:a,rowIndex:t,rows:e});for(let r=0,l=t,u;r<a;++r,++l)if((u=e[r])===o.NULL)for(let e=0,t=i.length;e<t;++e)n[i[e]][l]=null;else if(u instanceof Array)for(let e=0,t=i.length;e<t;++e)n[i[e]][l]=u[e];else{let e=Object.keys(u);for(let t=0,r=e.length,o;t<r;++t)n[o=s[o=e[t]]||o]||(n[o]=Array(l+1)),n[o][l]=u[o]}let u=t+a;if(u>this.rowCount){this.rowCount=u;for(let e=0,t=i.length;e<t;++e)n[i[e]].length=u}l&&l.modifyRows(this,e,t),this.emit({type:"afterSetRows",detail:r,rowCount:a,rowIndex:t,rows:e})}}return o.NULL={},o.version="1.0.0",o}),r(t,"Data/Connectors/DataConnector.js",[t["Data/Modifiers/DataModifier.js"],t["Data/DataTable.js"],t["Core/Utilities.js"]],function(e,t,r){var s;let{addEvent:o,fireEvent:n,merge:i,pick:l}=r;class a{constructor(e={}){this.table=new t(e.dataTable),this.metadata=e.metadata||{columns:{}}}get polling(){return!!this.polling}describeColumn(e,t){let r=this.metadata.columns;r[e]=i(r[e]||{},t)}describeColumns(e){let t;let r=Object.keys(e);for(;"string"==typeof(t=r.pop());)this.describeColumn(t,e[t])}emit(e){n(this,e.type,e)}getColumnOrder(e){let t=this.metadata.columns,r=Object.keys(t||{});if(r.length)return r.sort((e,r)=>l(t[e].index,0)-l(t[r].index,0))}getSortedColumns(e){return this.table.getColumns(this.getColumnOrder(e))}load(){return n(this,"afterLoad",{table:this.table}),Promise.resolve(this)}on(e,t){return o(this,e,t)}save(){return n(this,"saveError",{table:this.table}),Promise.reject(Error("Not implemented"))}setColumnOrder(e){for(let t=0,r=e.length;t<r;++t)this.describeColumn(e[t],{index:t})}setModifierOptions(t){let r=t&&e.types[t.type];return this.table.setModifier(r?new r(t):void 0).then(()=>this)}startPolling(e=1e3){let t=this;window.clearTimeout(t._polling),t._polling=window.setTimeout(()=>t.load().catch(e=>t.emit({type:"loadError",error:e,table:t.table})).then(()=>{t._polling&&t.startPolling(e)}),e)}stopPolling(){window.clearTimeout(this._polling),delete this._polling}whatIs(e){return this.metadata.columns[e]}}return(s=a||(a={})).types={},s.registerType=function(e,t){return!!e&&!s.types[e]&&!!(s.types[e]=t)},a}),r(t,"Data/Converters/DataConverter.js",[t["Data/DataTable.js"],t["Core/Utilities.js"]],function(e,t){let{addEvent:r,fireEvent:s,isNumber:o,merge:n}=t;class i{constructor(e){this.dateFormats={"YYYY/mm/dd":{regex:/^([0-9]{4})([\-\.\/])([0-9]{1,2})\2([0-9]{1,2})$/,parser:function(e){return e?Date.UTC(+e[1],e[3]-1,+e[4]):NaN}},"dd/mm/YYYY":{regex:/^([0-9]{1,2})([\-\.\/])([0-9]{1,2})\2([0-9]{4})$/,parser:function(e){return e?Date.UTC(+e[4],e[3]-1,+e[1]):NaN},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^([0-9]{1,2})([\-\.\/])([0-9]{1,2})\2([0-9]{4})$/,parser:function(e){return e?Date.UTC(+e[4],e[1]-1,+e[3]):NaN}},"dd/mm/YY":{regex:/^([0-9]{1,2})([\-\.\/])([0-9]{1,2})\2([0-9]{2})$/,parser:function(e){let t=new Date;if(!e)return NaN;let r=+e[4];return r>t.getFullYear()-2e3?r+=1900:r+=2e3,Date.UTC(r,e[3]-1,+e[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^([0-9]{1,2})([\-\.\/])([0-9]{1,2})\2([0-9]{2})$/,parser:function(e){return e?Date.UTC(+e[4]+2e3,e[1]-1,+e[3]):NaN}}};let t=n(i.defaultOptions,e),r=t.decimalPoint;("."===r||","===r)&&(r="."===r?"\\.":",",this.decimalRegExp=RegExp("^(-?[0-9]+)"+r+"([0-9]+)$")),this.options=t}asBoolean(e){return"boolean"==typeof e?e:"string"==typeof e?""!==e&&"0"!==e&&"false"!==e:!!this.asNumber(e)}asDate(e){let t;if("string"==typeof e)t=this.parseDate(e);else if("number"==typeof e)t=e;else{if(e instanceof Date)return e;t=this.parseDate(this.asString(e))}return new Date(t)}asGuessedType(e){return({number:this.asNumber,Date:this.asDate,string:this.asString})[this.guessType(e)].call(this,e)}asNumber(e){if("number"==typeof e)return e;if("boolean"==typeof e)return e?1:0;if("string"==typeof e){let t=this.decimalRegExp;if(e.indexOf(" ")>-1&&(e=e.replace(/\s+/g,"")),t){if(!t.test(e))return NaN;e=e.replace(t,"$1.$2")}return parseFloat(e)}return e instanceof Date?e.getDate():e?e.getRowCount():NaN}asString(e){return""+e}deduceDateFormat(e,t,r){let s=[],o=[],n="YYYY/mm/dd",i,l=[],a=0,u=!1,h,m;for((!t||t>e.length)&&(t=e.length);a<t;a++)if(void 0!==e[a]&&e[a]&&e[a].length)for(m=0,i=e[a].trim().replace(/[-\.\/]/g," ").split(" "),l=["","",""];m<i.length;m++)m<l.length&&(h=parseInt(i[m],10))&&(o[m]=!o[m]||o[m]<h?h:o[m],void 0!==s[m]?s[m]!==h&&(s[m]=!1):s[m]=h,h>31?h<100?l[m]="YY":l[m]="YYYY":h>12&&h<=31?(l[m]="dd",u=!0):l[m].length||(l[m]="mm"));if(u){for(m=0;m<s.length;m++)!1!==s[m]?o[m]>12&&"YY"!==l[m]&&"YYYY"!==l[m]&&(l[m]="YY"):o[m]>12&&"mm"===l[m]&&(l[m]="dd");3===l.length&&"dd"===l[1]&&"dd"===l[2]&&(l[2]="YY"),n=l.join("/")}return r&&(this.options.dateFormat=n),n}emit(e){s(this,e.type,e)}export(e,t){throw this.emit({type:"exportError",columns:[],headers:[]}),Error("Not implemented")}getTable(){throw Error("Not implemented")}guessType(e){let t="string";if("string"==typeof e){let r=this.trim(`${e}`),s=this.decimalRegExp,n=this.trim(r,!0);s&&(n=s.test(n)?n.replace(s,"$1.$2"):"");let i=parseFloat(n);+n===i?e=i:t=o(this.parseDate(e))?"Date":"string"}return"number"==typeof e&&(t=e>31536e6?"Date":"number"),t}on(e,t){return r(this,e,t)}parse(e){throw this.emit({type:"parseError",columns:[],headers:[]}),Error("Not implemented")}parseDate(e,t){let r=this.options,s=t||r.dateFormat,n=NaN,i,l,a;if(r.parseDate)n=r.parseDate(e);else{if(s)(l=this.dateFormats[s])||(l=this.dateFormats["YYYY/mm/dd"]),(a=e.match(l.regex))&&(n=l.parser(a));else for(i in this.dateFormats)if(l=this.dateFormats[i],a=e.match(l.regex)){s=i,n=l.parser(a);break}!a&&("object"==typeof(a=Date.parse(e))&&null!==a&&a.getTime?n=a.getTime()-6e4*a.getTimezoneOffset():o(a)&&(n=a-6e4*new Date(a).getTimezoneOffset(),-1===e.indexOf("2001")&&2001===new Date(n).getFullYear()&&(n=NaN)))}return n}trim(e,t){return"string"==typeof e&&(e=e.replace(/^\s+|\s+$/g,""),t&&/^[0-9\s]+$/.test(e)&&(e=e.replace(/\s/g,""))),e}}return i.defaultOptions={dateFormat:"",alternativeFormat:"",startColumn:0,endColumn:Number.MAX_VALUE,startRow:0,endRow:Number.MAX_VALUE,firstRowAsNames:!0,switchRowsAndColumns:!1},(i||(i={})).getTableFromColumns=function(t=[],r=[]){let s=new e;for(let e=0,o=Math.max(r.length,t.length);e<o;++e)s.setColumn(r[e]||`${e}`,t[e]);return s},i}),r(t,"Data/DataCursor.js",[],function(){class e{constructor(e={}){this.emittingRegister=[],this.listenerMap={},this.stateMap=e}addListener(e,t,r){let s=this.listenerMap[e]=this.listenerMap[e]||{};return(s[t]=s[t]||[]).push(r),this}buildEmittingTag(e){return("position"===e.cursor.type?[e.table.id,e.cursor.column,e.cursor.row,e.cursor.state,e.cursor.type]:[e.table.id,e.cursor.columns,e.cursor.firstRow,e.cursor.lastRow,e.cursor.state,e.cursor.type]).join("\0")}emitCursor(t,r,s,o,n){let i="object"==typeof r?r:s,l="object"==typeof o?o:s,a="string"==typeof r?r:void 0,u=t.id,h=i.state,m=this.listenerMap[u]&&this.listenerMap[u][h];if(n=n||!0===o,m){let r=this.stateMap[u]=this.stateMap[u]||{},s=r[i.state]||[];n&&(s.length||(r[i.state]=s),-1===e.getIndex(i,s)&&s.push(i));let o={cursor:i,cursors:s,table:t};l&&(o.event=l),a&&(o.group=a);let h=this.emittingRegister,c=this.buildEmittingTag(o);if(h.indexOf(c)>=0)return this;try{this.emittingRegister.push(c);for(let e=0,t=m.length;e<t;++e)m[e].call(this,o)}finally{let e=this.emittingRegister.indexOf(c);e>=0&&this.emittingRegister.splice(e,1)}}return this}remitCursor(t,r){let s=this.stateMap[t]&&this.stateMap[t][r.state];if(s){let t=e.getIndex(r,s);t>=0&&s.splice(t,1)}return this}removeListener(e,t,r){let s=this.listenerMap[e]&&this.listenerMap[e][t];if(s){let e=s.indexOf(r);e&&s.splice(e,1)}return this}}return e.version="1.0.0",function(e){function t(e,t){if("range"===e.type)return e;let r={type:"range",firstRow:e.row??(t&&t.firstRow)??0,lastRow:e.row??(t&&t.lastRow)??Number.MAX_VALUE,state:e.state};return void 0!==e.column&&(r.columns=[e.column]),r}e.getIndex=function(e,t){if("position"===e.type){for(let r,s=0,o=t.length;s<o;++s)if("position"===(r=t[s]).type&&r.state===e.state&&r.column===e.column&&r.row===e.row)return s}else{let r=JSON.stringify(e.columns);for(let s,o=0,n=t.length;o<n;++o)if("range"===(s=t[o]).type&&s.state===e.state&&s.firstRow===e.firstRow&&s.lastRow===e.lastRow&&JSON.stringify(s.columns)===r)return o}return -1},e.isEqual=function(e,t){return"position"===e.type&&"position"===t.type?e.column===t.column&&e.row===t.row&&e.state===t.state:"range"===e.type&&"range"===t.type&&e.firstRow===t.firstRow&&e.lastRow===t.lastRow&&JSON.stringify(e.columns)===JSON.stringify(t.columns)},e.isInRange=function(e,r){"position"===r.type&&(r=t(r)),"position"===e.type&&(e=t(e,r));let s=e.columns,o=r.columns;return e.firstRow>=r.firstRow&&e.lastRow<=r.lastRow&&(!s||!o||s.every(e=>o.indexOf(e)>=0))},e.toPositions=function(e){if("position"===e.type)return[e];let t=e.columns||[],r=[],s=e.state;for(let o=e.firstRow,n=e.lastRow;o<n;++o){if(!t.length){r.push({type:"position",row:o,state:s});continue}for(let e=0,n=t.length;e<n;++e)r.push({type:"position",column:t[e],row:o,state:s})}return r},e.toRange=t}(e||(e={})),e}),r(t,"Data/DataPoolDefaults.js",[],function(){return{connectors:[]}}),r(t,"Data/DataPool.js",[t["Data/Connectors/DataConnector.js"],t["Data/DataPoolDefaults.js"],t["Core/Utilities.js"]],function(e,t,r){class s{constructor(e=t){e.connectors=e.connectors||[],this.connectors={},this.options=e,this.waiting={}}emit(e){r.fireEvent(this,e.type,e)}getConnector(e){let t=this.connectors[e];if(t)return Promise.resolve(t);let r=this.waiting[e];if(!r){r=this.waiting[e]=[];let t=this.getConnectorOptions(e);if(!t)throw Error(`Connector not found. (${e})`);this.loadConnector(t).then(t=>{delete this.waiting[e];for(let e=0,s=r.length;e<s;++e)r[e][0](t)}).catch(t=>{delete this.waiting[e];for(let e=0,s=r.length;e<s;++e)r[e][1](t)})}return new Promise((e,t)=>{r.push([e,t])})}getConnectorIds(){let e=this.options.connectors,t=[];for(let r=0,s=e.length;r<s;++r)t.push(e[r].id);return t}getConnectorOptions(e){let t=this.options.connectors;for(let r=0,s=t.length;r<s;++r)if(t[r].id===e)return t[r]}getConnectorTable(e){return this.getConnector(e).then(e=>e.table)}isNewConnector(e){return!this.connectors[e]}loadConnector(t){return new Promise((r,s)=>{this.emit({type:"load",options:t});let o=e.types[t.type];if(!o)throw Error(`Connector type not found. (${t.type})`);new o(t.options).load().then(e=>{this.connectors[t.id]=e,this.emit({type:"afterLoad",options:t}),r(e)}).catch(s)})}on(e,t){return r.addEvent(this,e,t)}setConnectorOptions(e){let t=this.options.connectors,r=this.connectors;this.emit({type:"setConnectorOptions",options:e});for(let r=0,s=t.length;r<s;++r)if(t[r].id===e.id){t.splice(r,1);break}r[e.id]&&(r[e.id].stopPolling(),delete r[e.id]),t.push(e),this.emit({type:"afterSetConnectorOptions",options:e})}}return s.version="1.0.0",s}),r(t,"Data/Formula/FormulaParser.js",[],function(){let e=/^(?:FALSE|TRUE)/,t=/^[+-]?\d+(?:\.\d+)?(?:e[+-]\d+)?/,r=/^[+-]?\d+(?:,\d+)?(?:e[+-]\d+)?/,s=/^([A-Z][A-Z\d\.]*)\(/,o=/^(?:[+\-*\/^<=>]|<=|=>)/,n=/^(\$?[A-Z]+)(\$?\d+)\:(\$?[A-Z]+)(\$?\d+)/,i=/^R(\d*|\[\d+\])C(\d*|\[\d+\])\:R(\d*|\[\d+\])C(\d*|\[\d+\])/,l=/^(\$?[A-Z]+)(\$?\d+)(?![\:C])/,a=/^R(\d*|\[\d+\])C(\d*|\[\d+\])(?!\:)/;function u(e){let t=0;for(let r=0,s=e.length,o,n=1;r<s;++r){if("("===(o=e[r])){t||(n=r+1),++t;continue}if(")"===o&&!--t)return e.substring(n,r)}if(t>0){let e=Error("Incomplete parantheses.");throw e.name="FormulaParseError",e}return""}function h(e){let t=-1;for(let r=0,s=e.length,o,n=!1;r<s;++r){if("\\"===(o=e[r])){n=!n;continue}if(n){n=!1;continue}if('"'===o){if(!(t<0))return e.substring(t+1,r);t=r}}let r=Error("Incomplete string.");throw r.name="FormulaParseError",r}function m(e,t){let r;if(r=e.match(i)){let e=""===r[2]||"["===r[2][0],t=""===r[1]||"["===r[1][0],s=""===r[4]||"["===r[4][0],o=""===r[3]||"["===r[3][0],n={type:"range",beginColumn:e?parseInt(r[2].substring(1,-1)||"0",10):parseInt(r[2],10)-1,beginRow:t?parseInt(r[1].substring(1,-1)||"0",10):parseInt(r[1],10)-1,endColumn:s?parseInt(r[4].substring(1,-1)||"0",10):parseInt(r[4],10)-1,endRow:o?parseInt(r[3].substring(1,-1)||"0",10):parseInt(r[3],10)-1};return e&&(n.beginColumnRelative=!0),t&&(n.beginRowRelative=!0),s&&(n.endColumnRelative=!0),o&&(n.endRowRelative=!0),n}if(r=e.match(n)){let e="$"!==r[1][0],t="$"!==r[2][0],s="$"!==r[3][0],o="$"!==r[4][0],n={type:"range",beginColumn:f(e?r[1]:r[1].substring(1))-1,beginRow:parseInt(t?r[2]:r[2].substring(1),10)-1,endColumn:f(s?r[3]:r[3].substring(1))-1,endRow:parseInt(o?r[4]:r[4].substring(1),10)-1};return e&&(n.beginColumnRelative=!0),t&&(n.beginRowRelative=!0),s&&(n.endColumnRelative=!0),o&&(n.endRowRelative=!0),n}let s=c(e,t);return 1===s.length&&"string"!=typeof s[0]?s[0]:s}function c(n,i){let d=i?r:t,p=[],g,y=("="===n[0]?n.substring(1):n).trim();for(;y;){if(g=y.match(a)){let e=""===g[2]||"["===g[2][0],t=""===g[1]||"["===g[1][0],r={type:"reference",column:e?parseInt(g[2].substring(1,-1)||"0",10):parseInt(g[2],10)-1,row:t?parseInt(g[1].substring(1,-1)||"0",10):parseInt(g[1],10)-1};e&&(r.columnRelative=!0),t&&(r.rowRelative=!0),p.push(r),y=y.substring(g[0].length).trim();continue}if(g=y.match(l)){let e="$"!==g[1][0],t="$"!==g[2][0],r={type:"reference",column:f(e?g[1]:g[1].substring(1))-1,row:parseInt(t?g[2]:g[2].substring(1),10)-1};e&&(r.columnRelative=!0),t&&(r.rowRelative=!0),p.push(r),y=y.substring(g[0].length).trim();continue}if(g=y.match(o)){p.push(g[0]),y=y.substring(g[0].length).trim();continue}if(g=y.match(e)){p.push("TRUE"===g[0]),y=y.substring(g[0].length).trim();continue}if(g=y.match(d)){p.push(parseFloat(g[0])),y=y.substring(g[0].length).trim();continue}if('"'===y[0]){let e=h(y);p.push(e.substring(1,-1)),y=y.substring(e.length+2).trim();continue}if(g=y.match(s)){let e=u(y=y.substring(g[1].length).trim());p.push({type:"function",name:g[1],args:function(e,t){let r=[],s=t?";":",",o=0,n="";for(let i=0,l=e.length,a;i<l;++i)if((a=e[i])===s&&!o&&n)r.push(m(n,t)),n="";else if('"'!==a||o||n)" "!==a&&(n+=a,"("===a?++o:")"===a&&--o);else{let t=h(e.substring(i));r.push(t),i+=t.length+1}return!o&&n&&r.push(m(n,t)),r}(e,i)}),y=y.substring(e.length+2).trim();continue}if("("===y[0]){let e=u(y);if(e){p.push(c(e,i)),y=y.substring(e.length+2).trim();continue}}let t=n.length-y.length,r=Error("Unexpected character `"+n.substring(t,t+1)+"` at position "+(t+1)+". (`..."+n.substring(t-5,t+6)+"...`)");throw r.name="FormulaParseError",r}return p}function f(e){let t=0;for(let r=0,s=e.length,o,n=e.length-1;r<s;++r)(o=e.charCodeAt(r))>=65&&o<=90&&(t+=(o-64)*Math.pow(26,n)),--n;return t}return{parseFormula:c}}),r(t,"Data/Formula/FormulaTypes.js",[],function(){let e=["+","-","*","/","^","=","<","<=",">",">="];return{isFormula:function(e){return e instanceof Array},isFunction:function(e){return"object"==typeof e&&!(e instanceof Array)&&"function"===e.type},isOperator:function(t){return"string"==typeof t&&e.indexOf(t)>=0},isRange:function(e){return"object"==typeof e&&!(e instanceof Array)&&"range"===e.type},isReference:function(e){return"object"==typeof e&&!(e instanceof Array)&&"reference"===e.type},isValue:function(e){return"boolean"==typeof e||"number"==typeof e||"string"==typeof e}}}),r(t,"Data/Formula/FormulaProcessor.js",[t["Data/Formula/FormulaTypes.js"]],function(e){let{isFormula:t,isFunction:r,isOperator:s,isRange:o,isReference:n,isValue:i}=e,l=/ */,a=Number.MAX_VALUE/1.000000000001,u=Number.MAX_VALUE/1.000000000002,h=Number.MAX_VALUE,m={"^":3,"*":2,"/":2,"+":1,"-":1,"=":0,"<":0,"<=":0,">":0,">=":0},c={},f=/^[A-Z][A-Z\.]*$/;function d(e){switch(typeof e){case"boolean":return e?h:a;case"string":return u;case"number":return e;default:return NaN}}function p(e){return"string"==typeof e?e.toLowerCase().replace(l,"\0"):e}function g(e){switch(typeof e){case"boolean":return e?1:0;case"string":return parseFloat(e.replace(",","."));case"number":return e;default:return NaN}}function y(e,t,r){let s;switch(e){case"=":return p(t)===p(r);case"<":if(typeof t==typeof r)return p(t)<p(r);return d(t)<d(r);case"<=":if(typeof t==typeof r)return p(t)<=p(r);return d(t)<=d(r);case">":if(typeof t==typeof r)return p(t)>p(r);return d(t)>d(r);case">=":if(typeof t==typeof r)return p(t)>=p(r);return d(t)>=d(r)}switch(t=g(t),r=g(r),e){case"+":s=t+r;break;case"-":s=t-r;break;case"*":s=t*r;break;case"/":s=t/r;break;case"^":s=Math.pow(t,r);break;default:return NaN}return s%1?Math.round(1e9*s)/1e9:s}function C(e,s){return i(e)?e:o(e)?s&&b(e,s)||[]:r(e)?N(e,s):D(t(e)?e:[e],s)}function b(e,t){let r=t.getColumnNames().slice(e.beginColumn,e.endColumn+1),s=[];for(let o=0,n=r.length,l;o<n;++o){let n=t.getColumn(r[o],!0)||[];for(let a=e.beginRow,u=e.endRow+1;a<u;++a)"string"==typeof(l=n[a])&&"="===l[0]&&t!==t.modified&&(l=t.modified.getCell(r[o],a)),s.push(i(l)?l:NaN)}return s}function w(e,t){let r=t.getColumnNames()[e.column];if(r){let s=t.getCell(r,e.row);if("string"==typeof s&&"="===s[0]&&t!==t.modified){let s=t.modified.getCell(r,e.row);return i(s)?s:NaN}return i(s)?s:NaN}return NaN}function D(e,o){let l;for(let a=0,u=e.length,h,c,f,d;a<u;++a){if(s(h=e[a])){c=h;continue}if(i(h)?d=h:t(h)?d=D(e,o):r(h)?d=i(f=N(h,o))?f:NaN:n(h)&&(d=o&&w(h,o)),void 0!==d){if(void 0===l)l=c?y(c,0,d):d;else{if(!c)return NaN;let t=e[a+1];s(t)&&m[t]>m[c]&&(d=y(t,d,D(e.slice(a+2))),a=u),l=y(c,l,d)}c=void 0,d=void 0}}return i(l)?l:NaN}function N(e,t,r){let s=c[e.name];if(s)try{return s(e.args,t)}catch{return NaN}let o=Error(`Function "${e.name}" not found.`);throw o.name="FormulaProcessError",o}return{asNumber:g,getArgumentValue:C,getArgumentsValues:function(e,t){let r=[];for(let s=0,o=e.length;s<o;++s)r.push(C(e[s],t));return r},getRangeValues:b,getReferenceValue:w,processFormula:D,processorFunctions:c,registerProcessorFunction:function(e,t){return f.test(e)&&!c[e]&&!!(c[e]=t)},translateReferences:function e(t,s=0,i=0){for(let l=0,a=t.length,u;l<a;++l)(u=t[l])instanceof Array?e(u,s,i):r(u)?e(u.args,s,i):o(u)?(u.beginColumnRelative&&(u.beginColumn+=s),u.beginRowRelative&&(u.beginRow+=i),u.endColumnRelative&&(u.endColumn+=s),u.endRowRelative&&(u.endRow+=i)):n(u)&&(u.columnRelative&&(u.column+=s),u.rowRelative&&(u.row+=i));return t}}}),r(t,"Data/Formula/Functions/ABS.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentValue:t}=e;function r(e,r){let s=t(e[0],r);switch(typeof s){case"number":return Math.abs(s);case"object":{let e=[];for(let t=0,r=s.length,o;t<r;++t){if("number"!=typeof(o=s[t]))return NaN;e.push(Math.abs(o))}return e}default:return NaN}}return e.registerProcessorFunction("ABS",r),r}),r(t,"Data/Formula/Functions/AND.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentValue:t}=e;function r(e,s){for(let o=0,n=e.length,i;o<n;++o)if(!(i=t(e[o],s))||"object"==typeof i&&!r(i,s))return!1;return!0}return e.registerProcessorFunction("AND",r),r}),r(t,"Data/Formula/Functions/AVERAGE.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentsValues:t}=e;function r(e,r){let s=t(e,r),o=0,n=0;for(let e=0,t=s.length,r;e<t;++e)switch(typeof(r=s[e])){case"number":isNaN(r)||(++o,n+=r);break;case"object":for(let e=0,t=r.length,s;e<t;++e)"number"!=typeof(s=r[e])||isNaN(s)||(++o,n+=s)}return o?n/o:0}return e.registerProcessorFunction("AVERAGE",r),r}),r(t,"Data/Formula/Functions/AVERAGEA.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentValue:t}=e;function r(e,r){let s=0,o=0;for(let n=0,i=e.length,l;n<i;++n)switch(typeof(l=t(e[n],r))){case"boolean":++s,o+=l?1:0;continue;case"number":isNaN(l)||(++s,o+=l);continue;case"string":++s;continue;default:for(let e=0,t=l.length,r;e<t;++e)switch(typeof(r=l[e])){case"boolean":++s,o+=r?1:0;continue;case"number":isNaN(r)||(++s,o+=r);continue;case"string":++s;continue}continue}return s?o/s:0}return e.registerProcessorFunction("AVERAGEA",r),r}),r(t,"Data/Formula/Functions/COUNT.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){function t(r,s){let o=e.getArgumentsValues(r,s),n=0;for(let e=0,r=o.length,i;e<r;++e)switch(typeof(i=o[e])){case"number":!isNaN(i)&&++n;break;case"object":n+=t(i,s)}return n}return e.registerProcessorFunction("COUNT",t),t}),r(t,"Data/Formula/Functions/COUNTA.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){function t(r,s){let o=e.getArgumentsValues(r,s),n=0;for(let e=0,r=o.length,i;e<r;++e){switch(typeof(i=o[e])){case"number":if(isNaN(i))continue;break;case"object":n+=t(i,s);continue;case"string":if(!i)continue}++n}return n}return e.registerProcessorFunction("COUNTA",t),t}),r(t,"Data/Formula/Functions/IF.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentValue:t}=e;function r(e,r){return t(e[0],r)?t(e[1],r):t(e[2],r)}return e.registerProcessorFunction("IF",r),r}),r(t,"Data/Formula/Functions/ISNA.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentValue:t}=e;function r(e,r){let s=t(e[0],r);return"number"!=typeof s||isNaN(s)}return e.registerProcessorFunction("ISNA",r),r}),r(t,"Data/Formula/Functions/MAX.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentsValues:t}=e;function r(e,s){let o=t(e,s),n=Number.NEGATIVE_INFINITY;for(let e=0,t=o.length,s;e<t;++e)switch(typeof(s=o[e])){case"number":s>n&&(n=s);break;case"object":(s=r(s))>n&&(n=s)}return isFinite(n)?n:0}return e.registerProcessorFunction("MAX",r),r}),r(t,"Data/Formula/Functions/MEDIAN.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){function t(t,r){let s=[],o=e.getArgumentsValues(t,r);for(let e=0,t=o.length,r;e<t;++e)switch(typeof(r=o[e])){case"number":isNaN(r)||s.push(r);break;case"object":for(let e=0,t=r.length,o;e<t;++e)"number"!=typeof(o=r[e])||isNaN(o)||s.push(o)}let n=s.length;if(!n)return NaN;let i=Math.floor(n/2);return n%2?s[i]:(s[i-1]+s[i])/2}return e.registerProcessorFunction("MEDIAN",t),t}),r(t,"Data/Formula/Functions/MIN.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentsValues:t}=e;function r(e,s){let o=t(e,s),n=Number.POSITIVE_INFINITY;for(let e=0,t=o.length,s;e<t;++e)switch(typeof(s=o[e])){case"number":s<n&&(n=s);break;case"object":(s=r(s))<n&&(n=s)}return isFinite(n)?n:0}return e.registerProcessorFunction("MIN",r),r}),r(t,"Data/Formula/Functions/MOD.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentValue:t}=e;function r(e,r){let s=t(e[0],r),o=t(e[1],r);return("object"==typeof s&&(s=s[0]),"object"==typeof o&&(o=o[0]),"number"!=typeof s||"number"!=typeof o||0===o)?NaN:s%o}return e.registerProcessorFunction("MOD",r),r}),r(t,"Data/Formula/Functions/MODE.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){function t(t,r){let s={},o=e.getArgumentsValues(t,r);for(let e=0,t=o.length,r;e<t;++e)switch(typeof(r=o[e])){case"number":isNaN(r)||(s[r]=(s[r]||0)+1);break;case"object":for(let e=0,t=r.length,o;e<t;++e)"number"!=typeof(o=r[e])||isNaN(o)||(s[o]=(s[o]||0)+1)}return s}function r(e,r){let s=t(e,r),o=Object.keys(s);if(!o.length)return NaN;let n=[parseFloat(o[0])],i=s[o[0]];for(let e=1,t=o.length,r,l;e<t;++e)i<(l=s[r=o[e]])?(n=[parseFloat(r)],i=l):i===l&&n.push(parseFloat(r));return i>1?n:NaN}function s(e,r){let s=t(e,r),o=Object.keys(s);if(!o.length)return NaN;let n=parseFloat(o[0]),i=s[o[0]];for(let e=1,t=o.length,r,l,a;e<t;++e)i<(a=s[r=o[e]])?(n=parseFloat(r),i=a):i===a&&n>(l=parseFloat(r))&&(n=l,i=a);return i>1?n:NaN}return e.registerProcessorFunction("MODE",s),e.registerProcessorFunction("MODE.MULT",r),e.registerProcessorFunction("MODE.SNGL",s),{MULT:r,SNGL:s}}),r(t,"Data/Formula/Functions/NOT.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentValue:t}=e;function r(e,r){let s=t(e[0],r);switch("object"==typeof s&&(s=s[0]),typeof s){case"boolean":case"number":return!s}return NaN}return e.registerProcessorFunction("NOT",r),r}),r(t,"Data/Formula/Functions/OR.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentValue:t}=e;function r(e,s){for(let o=0,n=e.length,i;o<n;++o)if("object"==typeof(i=t(e[o],s))){if(r(i,s))return!0}else if(i)return!0;return!1}return e.registerProcessorFunction("OR",r),r}),r(t,"Data/Formula/Functions/PRODUCT.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentsValues:t}=e;function r(e,s){let o=t(e,s),n=1,i=!1;for(let e=0,t=o.length,l;e<t;++e)switch(typeof(l=o[e])){case"number":isNaN(l)||(i=!0,n*=l);break;case"object":i=!0,n*=r(l,s)}return i?n:0}return e.registerProcessorFunction("PRODUCT",r),r}),r(t,"Data/Formula/Functions/SUM.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){function t(r,s){let o=e.getArgumentsValues(r,s),n=0;for(let e=0,r=o.length,i;e<r;++e)switch(typeof(i=o[e])){case"number":isNaN(i)||(n+=i);break;case"object":n+=t(i,s)}return n}return e.registerProcessorFunction("SUM",t),t}),r(t,"Data/Formula/Functions/XOR.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentValue:t}=e;function r(e,r){for(let s=0,o=e.length,n,i;s<o;++s)switch(typeof(i=t(e[s],r))){case"boolean":case"number":if(void 0===n)n=!!i;else if(!!i!==n)return!0;break;case"object":for(let e=0,t=i.length,r;e<t;++e)switch(typeof(r=i[e])){case"boolean":case"number":if(void 0===n)n=!!r;else if(!!r!==n)return!0}}return!1}return e.registerProcessorFunction("XOR",r),r}),r(t,"Data/Formula/Formula.js",[t["Data/Formula/FormulaParser.js"],t["Data/Formula/FormulaProcessor.js"],t["Data/Formula/FormulaTypes.js"]],function(e,t,r){return{...e,...t,...r}}),r(t,"Data/Converters/CSVConverter.js",[t["Data/Converters/DataConverter.js"],t["Core/Utilities.js"]],function(e,t){let{merge:r}=t;class s extends e{constructor(e){let t=r(s.defaultOptions,e);super(t),this.columns=[],this.headers=[],this.dataTypes=[],this.options=t}export(e,t=this.options){let{useLocalDecimalPoint:r,lineDelimiter:s}=t,o=!1!==this.options.firstRowAsNames,{decimalPoint:n,itemDelimiter:i}=t;n||(n=","!==i&&r?1.1.toLocaleString()[1]:"."),i||(i=","===n?";":",");let l=e.getSortedColumns(t.usePresentationOrder),a=Object.keys(l),u=[],h=a.length,m=[];o&&u.push(a.map(e=>`"${e}"`).join(i));for(let t=0;t<h;t++){let r;let s=a[t],o=l[s],c=o.length,f=e.whatIs(s);f&&(r=f.dataType);for(let e=0;e<c;e++){let s=o[e];if(m[e]||(m[e]=[]),"string"===r?s='"'+s+'"':"number"==typeof s?s=String(s).replace(".",n):"string"==typeof s&&(s=`"${s}"`),m[e][t]=s,t===h-1){let r=t;for(;m[e].length>2&&void 0===m[e][r];)m[e].pop(),r--;u.push(m[e].join(i))}}}return u.join(s)}parse(e,t){let s=this.dataTypes,o=r(this.options,e),{beforeParse:n,lineDelimiter:i,firstRowAsNames:l,itemDelimiter:a}=o,u,h=0,{csv:m,startRow:c,endRow:f}=o,d;if(this.columns=[],this.emit({type:"parse",columns:this.columns,detail:t,headers:this.headers}),m&&n&&(m=n(m)),m){if(u=m.replace(/\r\n|\r/g,"\n").split(i||"\n"),(!c||c<0)&&(c=0),(!f||f>=u.length)&&(f=u.length-1),a||(this.guessedItemDelimiter=this.guessDelimiter(u)),l){let e=u[0].split(a||this.guessedItemDelimiter||",");for(let t=0;t<e.length;t++)e[t]=e[t].trim().replace(/^["']|["']$/g,"");this.headers=e,c++}let e=0;for(h=c;h<=f;h++)"#"===u[h][0]?e++:this.parseCSVRow(u[h],h-c-e);s.length&&s[0].length&&"date"===s[0][1]&&!this.options.dateFormat&&this.deduceDateFormat(this.columns[0],null,!0);for(let e=0,t=this.columns.length;e<t;++e){d=this.columns[e];for(let t=0,r=d.length;t<r;++t)if(d[t]&&"string"==typeof d[t]){let r=this.asGuessedType(d[t]);r instanceof Date&&(r=r.getTime()),this.columns[e][t]=r}}}this.emit({type:"afterParse",columns:this.columns,detail:t,headers:this.headers})}parseCSVRow(e,t){let r=this,s=r.columns||[],o=r.dataTypes,{startColumn:n,endColumn:i}=r.options,l=r.options.itemDelimiter||r.guessedItemDelimiter,{decimalPoint:a}=r.options;a&&a!==l||(a=r.guessedDecimalPoint||".");let u=0,h="",m="",c=0,f=0,d=t=>{h=e[t]},p=e=>{o.length<f+1&&o.push([e]),o[f][o[f].length-1]!==e&&o[f].push(e)},g=()=>{if(n>c||c>i){++c,m="";return}if("string"==typeof m?!isNaN(parseFloat(m))&&isFinite(m)?(m=parseFloat(m),p("number")):isNaN(Date.parse(m))?p("string"):(m=m.replace(/\//g,"-"),p("date")):p("number"),s.length<f+1&&s.push([]),"number"!=typeof m&&"number"!==r.guessType(m)&&a){let e=m;m=m.replace(a,"."),"number"!==r.guessType(m)&&(m=e)}s[f][t]=m,m="",++f,++c};if(e.trim().length&&"#"!==e.trim()[0]){for(;u<e.length;u++){if(d(u),"#"===h&&!/^#[0-F]{3,3}|[0-F]{6,6}/i.test(e.substring(u))){g();return}if('"'===h)for(d(++u);u<e.length&&'"'!==h;)m+=h,d(++u);else h===l?g():m+=h}g()}}guessDelimiter(e){let t=0,r=0,s,o={",":0,";":0," ":0},n=e.length;for(let s=0;s<n;s++){let n=!1,i,l,a,u="";if(s>13)break;let h=e[s];for(let e=0;e<h.length&&(i=h[e],l=h[e+1],a=h[e-1],"#"!==i);e++){if('"'===i){if(n){if('"'!==a&&'"'!==l){for(;" "===l&&e<h.length;)l=h[++e];void 0!==o[l]&&o[l]++,n=!1}}else n=!0}else void 0!==o[i]?(isNaN(Date.parse(u=u.trim()))?(isNaN(Number(u))||!isFinite(Number(u)))&&o[i]++:o[i]++,u=""):u+=i;","===i&&r++,"."===i&&t++}}return o[";"]>o[","]?s=";":(o[","],o[";"],s=","),t>r?this.guessedDecimalPoint=".":this.guessedDecimalPoint=",",s}getTable(){return e.getTableFromColumns(this.columns,this.headers)}}return s.defaultOptions={...e.defaultOptions,lineDelimiter:"\n"},s}),r(t,"Data/Connectors/CSVConnector.js",[t["Data/Converters/CSVConverter.js"],t["Data/Connectors/DataConnector.js"],t["Core/Utilities.js"]],function(e,t,r){let{merge:s}=r;class o extends t{constructor(t){let r=s(o.defaultOptions,t);super(r),this.converter=new e(r),this.options=r,r.enablePolling&&this.startPolling(1e3*Math.max(r.dataRefreshRate||0,1))}load(e){let t=this,r=t.converter,s=t.table,{csv:o,csvURL:n,dataModifier:i}=t.options;return t.emit({type:"load",csv:o,detail:e,table:s}),Promise.resolve(n?fetch(n).then(e=>e.text()):o||"").then(e=>(e&&(s.deleteColumns(),r.parse({csv:e}),s.setColumns(r.getTable().getColumns())),t.setModifierOptions(i).then(()=>e))).then(r=>(t.emit({type:"afterLoad",csv:r,detail:e,table:s}),t)).catch(r=>{throw t.emit({type:"loadError",detail:e,error:r,table:s}),r})}}return o.defaultOptions={csv:"",csvURL:"",enablePolling:!1,dataRefreshRate:1,firstRowAsNames:!0},t.registerType("CSV",o),o}),r(t,"Data/Converters/JSONConverter.js",[t["Data/Converters/DataConverter.js"],t["Data/DataTable.js"],t["Core/Utilities.js"]],function(e,t,r){let{error:s,isArray:o,merge:n,objectEach:i}=r;class l extends e{constructor(e){let r=n(l.defaultOptions,e);super(r),this.columns=[],this.headers=[],this.options=r,this.table=new t}parse(e,t){let{beforeParse:r,orientation:l,firstRowAsNames:a,columnNames:u}=e=n(this.options,e),h=e.data;if(h){if(this.columns=[],this.emit({type:"parse",columns:this.columns,detail:t,headers:this.headers}),r&&(h=r(h)),h=h.slice(),"columns"===l)for(let e=0,t=h.length;e<t;e++){let t=h[e];if(!(t instanceof Array))return;this.headers instanceof Array?(a?this.headers.push(`${t.shift()}`):u&&u instanceof Array&&this.headers.push(u[e]),this.table.setColumn(this.headers[e]||e.toString(),t)):s("JSONConverter: Invalid `columnNames` option.",!1)}else if("rows"===l){a?this.headers=h.shift():u&&(this.headers=u);for(let e=0,t=h.length;e<t;e++){let t=h[e];if(o(t))for(let e=0,r=t.length;e<r;e++)this.columns.length<e+1&&this.columns.push([]),this.columns[e].push(t[e]),this.headers instanceof Array?this.table.setColumn(this.headers[e]||e.toString(),this.columns[e]):s("JSONConverter: Invalid `columnNames` option.",!1);else{let r=this.headers;if(r&&!(r instanceof Array)){let e={};i(r,(r,s)=>{e[s]=r.reduce((e,t)=>e[t],t)}),t=e}this.table.setRows([t],e)}}}this.emit({type:"afterParse",columns:this.columns,detail:t,headers:this.headers})}}getTable(){return this.table}}return l.defaultOptions={...e.defaultOptions,data:[],orientation:"rows"},l}),r(t,"Data/Connectors/JSONConnector.js",[t["Data/Connectors/DataConnector.js"],t["Core/Utilities.js"],t["Data/Converters/JSONConverter.js"]],function(e,t,r){let{merge:s}=t;class o extends e{constructor(e){let t=s(o.defaultOptions,e);super(t),this.converter=new r(t),this.options=t,t.enablePolling&&this.startPolling(1e3*Math.max(t.dataRefreshRate||0,1))}load(e){let t=this,r=t.converter,s=t.table,{data:o,dataUrl:n,dataModifier:i}=t.options;return t.emit({type:"load",data:o,detail:e,table:s}),Promise.resolve(n?fetch(n).then(e=>e.json()):o||[]).then(e=>(e&&(s.deleteColumns(),r.parse({data:e}),s.setColumns(r.getTable().getColumns())),t.setModifierOptions(i).then(()=>e))).then(r=>(t.emit({type:"afterLoad",data:r,detail:e,table:s}),t)).catch(r=>{throw t.emit({type:"loadError",detail:e,error:r,table:s}),r})}}return o.defaultOptions={data:[],enablePolling:!1,dataRefreshRate:0,firstRowAsNames:!0,orientation:"rows"},e.registerType("JSON",o),o}),r(t,"Data/Converters/GoogleSheetsConverter.js",[t["Data/Converters/DataConverter.js"],t["Core/Utilities.js"]],function(e,t){let{merge:r,uniqueKey:s}=t;class o extends e{constructor(e){let t=r(o.defaultOptions,e);super(t),this.columns=[],this.header=[],this.options=t}parse(e,t){let o;let n=r(this.options,e),i=(n.json&&n.json.values||[]).map(e=>e.slice());if(0===i.length)return!1;this.header=[],this.columns=[],this.emit({type:"parse",columns:this.columns,detail:t,headers:this.header}),this.columns=i;for(let e=0,t=i.length;e<t;e++){o=i[e],this.header[e]=n.firstRowAsNames?`${o.shift()}`:s();for(let t=0,r=o.length;t<r;++t)if(o[t]&&"string"==typeof o[t]){let r=this.asGuessedType(o[t]);r instanceof Date&&(r=r.getTime()),this.columns[e][t]=r}}this.emit({type:"afterParse",columns:this.columns,detail:t,headers:this.header})}getTable(){return e.getTableFromColumns(this.columns,this.header)}}return o.defaultOptions={...e.defaultOptions},o}),r(t,"Data/Connectors/GoogleSheetsConnector.js",[t["Data/Connectors/DataConnector.js"],t["Data/Converters/GoogleSheetsConverter.js"],t["Core/Utilities.js"]],function(e,t,r){let{merge:s,pick:o}=r;class n extends e{constructor(e){let r=s(n.defaultOptions,e);super(r),this.converter=new t(r),this.options=r}load(e){let t=this,r=t.converter,s=t.table,{dataModifier:o,dataRefreshRate:i,enablePolling:l,firstRowAsNames:a,googleAPIKey:u,googleSpreadsheetKey:h}=t.options,m=n.buildFetchURL(u,h,t.options);return t.emit({type:"load",detail:e,table:s,url:m}),fetch(m).then(e=>e.json()).then(e=>{if("object"==typeof e&&e&&"object"==typeof e.error&&e.error&&"number"==typeof e.error.code&&"string"==typeof e.error.message&&"string"==typeof e.error.status)throw Error(e.error.message);return r.parse({firstRowAsNames:a,json:e}),s.deleteColumns(),s.setColumns(r.getTable().getColumns()),t.setModifierOptions(o)}).then(()=>(t.emit({type:"afterLoad",detail:e,table:s,url:m}),l&&setTimeout(()=>t.load(),1e3*Math.max(i||0,1)),t)).catch(r=>{throw t.emit({type:"loadError",detail:e,error:r,table:s}),r})}}return n.defaultOptions={googleAPIKey:"",googleSpreadsheetKey:"",worksheet:1,enablePolling:!1,dataRefreshRate:2,firstRowAsNames:!0},function(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZ";function r(e={}){let{endColumn:r,endRow:s,googleSpreadsheetRange:n,startColumn:i,startRow:l}=e;return n||(t[i||0]||"A")+(Math.max(l||0,0)+1)+":"+(t[o(r,25)]||"Z")+(s?Math.max(s,0):"Z")}e.buildFetchURL=function(e,t,s={}){return`https://sheets.googleapis.com/v4/spreadsheets/${t}/values/`+(s.onlyColumnNames?"A1:Z1":r(s))+"?alt=json"+(s.onlyColumnNames?"":"&dateTimeRenderOption=FORMATTED_STRING&majorDimension=COLUMNS&valueRenderOption=UNFORMATTED_VALUE")+"&prettyPrint=false"+`&key=${e}`},e.buildQueryRange=r}(n||(n={})),e.registerType("GoogleSheets",n),n}),r(t,"Data/Converters/HTMLTableConverter.js",[t["Data/Converters/DataConverter.js"],t["Core/Utilities.js"]],function(e,t){let{merge:r}=t;class s extends e{constructor(e){let t=r(s.defaultOptions,e);super(t),this.columns=[],this.headers=[],this.options=t,t.tableElement&&(this.tableElement=t.tableElement,this.tableElementID=t.tableElement.id)}export(e,t=this.options){let r=!1!==t.firstRowAsNames,s=t.useMultiLevelHeaders,o=e.getSortedColumns(t.usePresentationOrder),n=Object.keys(o),i=[],l=n.length,a=[],u="";if(r){let e=[];if(s){for(let t of n){let r=(o[t].shift()||"").toString();e.push(r)}u=this.getTableHeaderHTML(n,e,t)}else u=this.getTableHeaderHTML(void 0,n,t)}for(let e=0;e<l;e++){let t=o[n[e]],r=t.length;for(let s=0;s<r;s++){let r=t[s];a[s]||(a[s]=[]),"string"==typeof r||"number"==typeof r||void 0===r||(r=(r||"").toString()),a[s][e]=this.getCellHTMLFromValue(e?"td":"th",null,e?"":'scope="row"',r),e===l-1&&i.push("<tr>"+a[s].join("")+"</tr>")}}let h="";return t.tableCaption&&(h='<caption class="highcharts-table-caption">'+t.tableCaption+"</caption>"),"<table>"+h+u+"<tbody>"+i.join("")+"</tbody></table>"}getCellHTMLFromValue(e,t,r,s,o){let n=s,i="text"+(t?" "+t:"");return"number"==typeof n?(n=n.toString(),","===o&&(n=n.replace(".",o)),i="number"):s||(n="",i="empty"),"<"+e+(r?" "+r:"")+' class="'+i+'">'+n+"</"+e+">"}getTableHeaderHTML(e=[],t=[],r=this.options){let{useMultiLevelHeaders:s,useRowspanHeaders:o}=r,n="<thead>",i=0,l=t&&t.length,a,u=0,h;if(s&&e&&t&&!function(e,t){let r=e.length;if(t.length!==r)return!1;for(;--r;)if(e[r]!==t[r])return!1;return!0}(e,t)){for(n+="<tr>";i<l;++i)(a=e[i])===e[i+1]?++u:u?(n+=this.getCellHTMLFromValue("th","highcharts-table-topheading",'scope="col" colspan="'+(u+1)+'"',a),u=0):(a===t[i]?o?(h=2,delete t[i]):(h=1,t[i]=""):h=1,n+=this.getCellHTMLFromValue("th","highcharts-table-topheading",'scope="col"'+(h>1?' valign="top" rowspan="'+h+'"':""),a));n+="</tr>"}if(t){for(n+="<tr>",i=0,l=t.length;i<l;++i)void 0!==t[i]&&(n+=this.getCellHTMLFromValue("th",null,'scope="col"',t[i]));n+="</tr>"}return n+"</thead>"}parse(e,t){let s=[],o=[],n=r(this.options,e),{endRow:i,startColumn:l,endColumn:a,firstRowAsNames:u}=n,h=n.tableElement||this.tableElement;if(!(h instanceof HTMLElement)){this.emit({type:"parseError",columns:s,detail:t,headers:o,error:"Not a valid HTML Table"});return}this.tableElement=h,this.tableElementID=h.id,this.emit({type:"parse",columns:this.columns,detail:t,headers:this.headers});let m=h.getElementsByTagName("tr"),c=m.length,f=0,d,{startRow:p}=n;if(u&&c){let e=m[0].children,t=e.length;for(let r=l;r<t&&!(r>a);r++)("TD"===(d=e[r]).tagName||"TH"===d.tagName)&&o.push(d.innerHTML);p++}for(;f<c;){if(f>=p&&f<=i){let e=m[f].children,t=e.length,r=0;for(;r<t;){let t=r-l,o=s[t];if(("TD"===(d=e[r]).tagName||"TH"===d.tagName)&&r>=l&&r<=a){s[t]||(s[t]=[]);let e=this.asGuessedType(d.innerHTML);e instanceof Date&&(e=e.getTime()),s[t][f-p]=e;let r=1;for(;f-p>=r&&void 0===o[f-p-r];)o[f-p-r]=null,r++}r++}}f++}this.columns=s,this.headers=o,this.emit({type:"afterParse",columns:s,detail:t,headers:o})}getTable(){return e.getTableFromColumns(this.columns,this.headers)}}return s.defaultOptions={...e.defaultOptions,useRowspanHeaders:!0,useMultiLevelHeaders:!0},s}),r(t,"Data/Connectors/HTMLTableConnector.js",[t["Data/Connectors/DataConnector.js"],t["Core/Globals.js"],t["Data/Converters/HTMLTableConverter.js"],t["Core/Utilities.js"]],function(e,t,r,s){let{win:o}=t,{merge:n}=s;class i extends e{constructor(e){let t=n(i.defaultOptions,e);super(t),this.converter=new r(t),this.options=t}load(e){let t;let r=this,s=r.converter,i=r.table,{dataModifier:l,table:a}=r.options;if(r.emit({type:"load",detail:e,table:i,tableElement:r.tableElement}),"string"==typeof a?(r.tableID=a,t=o.document.getElementById(a)):(t=a,r.tableID=t.id),r.tableElement=t||void 0,!r.tableElement){let t="HTML table not provided, or element with ID not found";return r.emit({type:"loadError",detail:e,error:t,table:i}),Promise.reject(Error(t))}return s.parse(n({tableElement:r.tableElement},r.options),e),i.deleteColumns(),i.setColumns(s.getTable().getColumns()),r.setModifierOptions(l).then(()=>(r.emit({type:"afterLoad",detail:e,table:i,tableElement:r.tableElement}),r))}}return i.defaultOptions={table:""},e.registerType("HTMLTable",i),i}),r(t,"Data/Modifiers/ChainModifier.js",[t["Data/Modifiers/DataModifier.js"],t["Core/Utilities.js"]],function(e,t){let{merge:r}=t;class s extends e{constructor(t,...o){super(),this.chain=o,this.options=r(s.defaultOptions,t);let n=this.options.chain||[];for(let t=0,r=n.length,s,i;t<r;++t)(s=n[t]).type&&(i=e.types[s.type])&&o.push(new i(s))}add(e,t){this.emit({type:"addModifier",detail:t,modifier:e}),this.chain.push(e),this.emit({type:"addModifier",detail:t,modifier:e})}clear(e){this.emit({type:"clearChain",detail:e}),this.chain.length=0,this.emit({type:"afterClearChain",detail:e})}modify(e,t){let r=this.options.reverse?this.chain.slice().reverse():this.chain.slice();e.modified===e&&(e.modified=e.clone(!1,t));let s=Promise.resolve(e);for(let e=0,o=r.length;e<o;++e){let o=r[e];s=s.then(e=>o.modify(e.modified,t))}return(s=s.then(t=>(e.modified.deleteColumns(),e.modified.setColumns(t.modified.getColumns()),e))).catch(r=>{throw this.emit({type:"error",detail:t,table:e}),r})}modifyCell(e,t,r,s,o){let n=this.options.reverse?this.chain.reverse():this.chain;if(n.length){let i=e.clone();for(let e=0,l=n.length;e<l;++e)n[e].modifyCell(i,t,r,s,o),i=i.modified;e.modified=i}return e}modifyColumns(e,t,r,s){let o=this.options.reverse?this.chain.reverse():this.chain.slice();if(o.length){let n=e.clone();for(let e=0,i=o.length;e<i;++e)o[e].modifyColumns(n,t,r,s),n=n.modified;e.modified=n}return e}modifyRows(e,t,r,s){let o=this.options.reverse?this.chain.reverse():this.chain.slice();if(o.length){let n=e.clone();for(let e=0,i=o.length;e<i;++e)o[e].modifyRows(n,t,r,s),n=n.modified;e.modified=n}return e}modifyTable(e,t){this.emit({type:"modify",detail:t,table:e});let r=this.options.reverse?this.chain.reverse():this.chain.slice(),s=e.modified;for(let e=0,o=r.length;e<o;++e)s=r[e].modifyTable(s,t).modified;return e.modified=s,this.emit({type:"afterModify",detail:t,table:e}),e}remove(e,t){let r=this.chain;this.emit({type:"removeModifier",detail:t,modifier:e}),r.splice(r.indexOf(e),1),this.emit({type:"afterRemoveModifier",detail:t,modifier:e})}}return s.defaultOptions={type:"Chain"},e.registerType("Chain",s),s}),r(t,"Data/Modifiers/InvertModifier.js",[t["Data/Modifiers/DataModifier.js"],t["Core/Utilities.js"]],function(e,t){let{merge:r}=t;class s extends e{constructor(e){super(),this.options=r(s.defaultOptions,e)}modifyCell(e,t,r,s,o){let n=e.modified,i=n.getRowIndexBy("columnNames",t);return void 0===i?n.setColumns(this.modifyTable(e.clone()).getColumns(),void 0,o):n.setCell(`${r}`,i,s,o),e}modifyColumns(e,t,r,s){let o=e.modified,n=o.getColumn("columnNames")||[],i=e.getColumnNames(),l=e.getRowCount()!==n.length;if(!l){for(let e=0,t=i.length;e<t;++e)if(i[e]!==n[e]){l=!0;break}}if(l)return this.modifyTable(e,s);i=Object.keys(t);for(let e=0,n=i.length,l,a,u;e<n;++e){l=t[a=i[e]],u=o.getRowIndexBy("columnNames",a)||o.getRowCount();for(let e=0,t=r,n=l.length;e<n;++e,++t)o.setCell(`${t}`,u,l[e],s)}return e}modifyRows(e,t,r,s){let o=e.getColumnNames(),n=e.modified,i=n.getColumn("columnNames")||[],l=e.getRowCount()!==i.length;if(!l){for(let e=0,t=o.length;e<t;++e)if(o[e]!==i[e]){l=!0;break}}if(l)return this.modifyTable(e,s);for(let e=0,i=r,l=t.length,a;e<l;++e,++i)if((a=t[e])instanceof Array)n.setColumn(`${i}`,a);else for(let e=0,t=o.length;e<t;++e)n.setCell(`${i}`,e,a[o[e]],s);return e}modifyTable(e,t){this.emit({type:"modify",detail:t,table:e});let r=e.modified;if(e.hasColumns(["columnNames"])){let t=((e.deleteColumns(["columnNames"])||{}).columnNames||[]).map(e=>`${e}`),s={};for(let r=0,o=e.getRowCount(),n;r<o;++r)(n=e.getRow(r))&&(s[t[r]]=n);r.deleteColumns(),r.setColumns(s)}else{let t={};for(let r=0,s=e.getRowCount(),o;r<s;++r)(o=e.getRow(r))&&(t[`${r}`]=o);t.columnNames=e.getColumnNames(),r.deleteColumns(),r.setColumns(t)}return this.emit({type:"afterModify",detail:t,table:e}),e}}return s.defaultOptions={type:"Invert"},e.registerType("Invert",s),s}),r(t,"Data/Modifiers/MathModifier.js",[t["Data/Modifiers/DataModifier.js"],t["Data/Formula/FormulaParser.js"],t["Data/Formula/FormulaProcessor.js"]],function(e,t,r){class s extends e{constructor(e){super(),this.options={...s.defaultOptions,...e}}modifyTable(e,r){this.emit({type:"modify",detail:r,table:e});let s=this.options.alternativeSeparators,o=this.options.formulaColumns||e.getColumnNames(),n=e.modified;for(let t=0,r=o.length,s;t<r;++t)s=o[t],o.indexOf(s)>=0&&n.setColumn(s,this.processColumn(e,s));let i=this.options.columnFormulas||[];for(let r=0,o=i.length,l,a;r<o;++r)l=i[r],a=t.parseFormula(l.formula,s),n.setColumn(l.column,this.processColumnFormula(a,e,l.rowStart,l.rowEnd));return this.emit({type:"afterModify",detail:r,table:e}),e}processColumn(e,s,o=0){let n=this.options.alternativeSeparators,i=(e.getColumn(s,!0)||[]).slice(o>0?o:0);for(let s=0,o=i.length,l=[],a;s<o;++s)if("string"==typeof(a=i[s])&&"="===a[0])try{l=""===a?l:t.parseFormula(a.substring(1),n),i[s]=r.processFormula(l,e)}catch{i[s]=NaN}return i}processColumnFormula(e,t,s=0,o=t.getRowCount()){s=s>=0?s:0,o=o>=0?o:t.getRowCount()+o;let n=[],i=t.modified;for(let t=0,l=o-s;t<l;++t)try{n[t]=r.processFormula(e,i)}catch{n[t]=NaN}finally{e=r.translateReferences(e,0,1)}return n}}return s.defaultOptions={type:"Math",alternativeSeparators:!1},e.registerType("Math",s),s}),r(t,"Data/Modifiers/RangeModifier.js",[t["Data/Modifiers/DataModifier.js"],t["Core/Utilities.js"]],function(e,t){let{merge:r}=t;class s extends e{constructor(e){super(),this.options=r(s.defaultOptions,e)}modifyTable(e,t){this.emit({type:"modify",detail:t,table:e});let{additive:r,ranges:s,strict:o}=this.options;if(s.length){let t=e.modified,n=e.getColumns(),i=[];for(let l=0,a=s.length,u,h;l<a;++l)if(u=s[l],!o||typeof u.minValue==typeof u.maxValue){l>0&&!r&&(t.deleteRows(),t.setRows(i),n=t.getColumns(),i=[]),h=n[u.column]||[];for(let s=0,n=h.length,l,a;s<n;++s){switch(typeof(l=h[s])){default:continue;case"boolean":case"number":case"string":}(!o||typeof l==typeof u.minValue)&&l>=u.minValue&&l<=u.maxValue&&(a=r?e.getRow(s):t.getRow(s))&&i.push(a)}}t.deleteRows(),t.setRows(i)}return this.emit({type:"afterModify",detail:t,table:e}),e}}return s.defaultOptions={type:"Range",ranges:[]},e.registerType("Range",s),s}),r(t,"Data/Modifiers/SortModifier.js",[t["Data/Modifiers/DataModifier.js"],t["Data/DataTable.js"],t["Core/Utilities.js"]],function(e,t,r){let{merge:s}=r;class o extends e{static ascending(e,t){return(e||0)<(t||0)?-1:(e||0)>(t||0)?1:0}static descending(e,t){return(t||0)<(e||0)?-1:(t||0)>(e||0)?1:0}constructor(e){super(),this.options=s(o.defaultOptions,e)}getRowReferences(e){let t=e.getRows(),r=[];for(let e=0,s=t.length;e<s;++e)r.push({index:e,row:t[e]});return r}modifyCell(e,r,s,o,n){let{orderByColumn:i,orderInColumn:l}=this.options;return r===i&&(l?(e.modified.setCell(r,s,o),e.modified.setColumn(l,this.modifyTable(new t({columns:e.getColumns([i,l])})).modified.getColumn(l))):this.modifyTable(e,n)),e}modifyColumns(e,r,s,o){let{orderByColumn:n,orderInColumn:i}=this.options,l=Object.keys(r);return l.indexOf(n)>-1&&(i&&r[l[0]].length?(e.modified.setColumns(r,s),e.modified.setColumn(i,this.modifyTable(new t({columns:e.getColumns([n,i])})).modified.getColumn(i))):this.modifyTable(e,o)),e}modifyRows(e,r,s,o){let{orderByColumn:n,orderInColumn:i}=this.options;return i&&r.length?(e.modified.setRows(r,s),e.modified.setColumn(i,this.modifyTable(new t({columns:e.getColumns([n,i])})).modified.getColumn(i))):this.modifyTable(e,o),e}modifyTable(e,t){this.emit({type:"modify",detail:t,table:e});let r=e.getColumnNames(),s=e.getRowCount(),n=this.getRowReferences(e),{direction:i,orderByColumn:l,orderInColumn:a}=this.options,u="asc"===i?o.ascending:o.descending,h=r.indexOf(l),m=e.modified;if(-1!==h&&n.sort((e,t)=>u(e.row[h],t.row[h])),a){let e=[];for(let t=0;t<s;++t)e[n[t].index]=t;m.setColumns({[a]:e})}else{let e=[];for(let t=0;t<s;++t)e.push(n[t].row);m.setRows(e,0)}return this.emit({type:"afterModify",detail:t,table:e}),e}}return o.defaultOptions={type:"Sort",direction:"desc",orderByColumn:"y"},e.registerType("Sort",o),o}),r(t,"masters/modules/data-tools.src.js",[t["Core/Globals.js"],t["Data/Connectors/DataConnector.js"],t["Data/Converters/DataConverter.js"],t["Data/DataCursor.js"],t["Data/Modifiers/DataModifier.js"],t["Data/DataPool.js"],t["Data/DataTable.js"],t["Data/Formula/Formula.js"]],function(e,t,r,s,o,n,i,l){return e.DataConnector=e.DataConnector||t,e.DataConverter=e.DataConverter||r,e.DataCursor=e.DataCursor||s,e.DataModifier=e.DataModifier||o,e.DataPool=e.DataPool||n,e.DataTable=e.DataTable||i,e.Formula=e.Formula||l,e})}); |