csv-sort 7.0.29 → 7.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintcache ADDED
@@ -0,0 +1 @@
1
+ [{"/home/runner/work/codsen/codsen/packages/csv-sort/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/csv-sort/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/csv-sort/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/csv-sort/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/csv-sort/src/util/findType.ts":"5","/home/runner/work/codsen/codsen/packages/csv-sort/test/2d-trim.js":"6","/home/runner/work/codsen/codsen/packages/csv-sort/test/blank-row.js":"7","/home/runner/work/codsen/codsen/packages/csv-sort/test/simple.js":"8","/home/runner/work/codsen/codsen/packages/csv-sort/test/throws.js":"9","/home/runner/work/codsen/codsen/packages/csv-sort/test/util/find-type.js":"10","/home/runner/work/codsen/codsen/packages/csv-sort/test/util/is-numeric.js":"11","/home/runner/work/codsen/codsen/packages/csv-sort/test/util.js":"12"},{"size":963,"mtime":1760280945891,"results":"13","hashOfConfig":"14"},{"size":480,"mtime":1760280945891,"results":"15","hashOfConfig":"16"},{"size":373,"mtime":1760280945891,"results":"17","hashOfConfig":"14"},{"size":22848,"mtime":1760280945892,"results":"18","hashOfConfig":"16"},{"size":1945,"mtime":1760280945892,"results":"19","hashOfConfig":"16"},{"size":504,"mtime":1760280945892,"results":"20","hashOfConfig":"21"},{"size":1392,"mtime":1760280945892,"results":"22","hashOfConfig":"21"},{"size":674,"mtime":1760280945893,"results":"23","hashOfConfig":"21"},{"size":1350,"mtime":1760280945893,"results":"24","hashOfConfig":"21"},{"size":2316,"mtime":1760280945893,"results":"25","hashOfConfig":"21"},{"size":637,"mtime":1760280945893,"results":"26","hashOfConfig":"21"},{"size":2906,"mtime":1760280945893,"results":"27","hashOfConfig":"21"},{"filePath":"28","messages":"29","suppressedMessages":"30","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1f1u168",{"filePath":"31","messages":"32","suppressedMessages":"33","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"91l1rm",{"filePath":"34","messages":"35","suppressedMessages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","suppressedMessages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","suppressedMessages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","suppressedMessages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ns3qdb",{"filePath":"46","messages":"47","suppressedMessages":"48","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","suppressedMessages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","suppressedMessages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/codsen/codsen/packages/csv-sort/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/csv-sort/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/csv-sort/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/csv-sort/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/csv-sort/src/util/findType.ts",[],[],"/home/runner/work/codsen/codsen/packages/csv-sort/test/2d-trim.js",[],["64","65","66","67","68","69"],"/home/runner/work/codsen/codsen/packages/csv-sort/test/blank-row.js",[],["70","71","72","73","74","75"],"/home/runner/work/codsen/codsen/packages/csv-sort/test/simple.js",[],["76","77","78","79","80","81"],"/home/runner/work/codsen/codsen/packages/csv-sort/test/throws.js",[],["82","83","84","85","86"],"/home/runner/work/codsen/codsen/packages/csv-sort/test/util/find-type.js",[],["87","88","89","90","91","92"],"/home/runner/work/codsen/codsen/packages/csv-sort/test/util/is-numeric.js",[],["93","94","95","96","97"],"/home/runner/work/codsen/codsen/packages/csv-sort/test/util.js",[],[],{"ruleId":"98","severity":2,"message":"99","line":3,"column":17,"nodeType":null,"messageId":"100","endLine":3,"endColumn":19,"suppressions":"101"},{"ruleId":"98","severity":2,"message":"102","line":3,"column":21,"nodeType":null,"messageId":"100","endLine":3,"endColumn":23,"suppressions":"103"},{"ruleId":"98","severity":2,"message":"104","line":3,"column":25,"nodeType":null,"messageId":"100","endLine":3,"endColumn":31,"suppressions":"105"},{"ruleId":"98","severity":2,"message":"106","line":3,"column":33,"nodeType":null,"messageId":"100","endLine":3,"endColumn":37,"suppressions":"107"},{"ruleId":"98","severity":2,"message":"108","line":3,"column":39,"nodeType":null,"messageId":"100","endLine":3,"endColumn":42,"suppressions":"109"},{"ruleId":"98","severity":2,"message":"110","line":3,"column":44,"nodeType":null,"messageId":"100","endLine":3,"endColumn":49,"suppressions":"111"},{"ruleId":"98","severity":2,"message":"99","line":3,"column":17,"nodeType":null,"messageId":"100","endLine":3,"endColumn":19,"suppressions":"112"},{"ruleId":"98","severity":2,"message":"102","line":3,"column":21,"nodeType":null,"messageId":"100","endLine":3,"endColumn":23,"suppressions":"113"},{"ruleId":"98","severity":2,"message":"104","line":3,"column":25,"nodeType":null,"messageId":"100","endLine":3,"endColumn":31,"suppressions":"114"},{"ruleId":"98","severity":2,"message":"106","line":3,"column":33,"nodeType":null,"messageId":"100","endLine":3,"endColumn":37,"suppressions":"115"},{"ruleId":"98","severity":2,"message":"108","line":3,"column":39,"nodeType":null,"messageId":"100","endLine":3,"endColumn":42,"suppressions":"116"},{"ruleId":"98","severity":2,"message":"110","line":3,"column":44,"nodeType":null,"messageId":"100","endLine":3,"endColumn":49,"suppressions":"117"},{"ruleId":"98","severity":2,"message":"99","line":3,"column":17,"nodeType":null,"messageId":"100","endLine":3,"endColumn":19,"suppressions":"118"},{"ruleId":"98","severity":2,"message":"102","line":3,"column":21,"nodeType":null,"messageId":"100","endLine":3,"endColumn":23,"suppressions":"119"},{"ruleId":"98","severity":2,"message":"104","line":3,"column":25,"nodeType":null,"messageId":"100","endLine":3,"endColumn":31,"suppressions":"120"},{"ruleId":"98","severity":2,"message":"106","line":3,"column":33,"nodeType":null,"messageId":"100","endLine":3,"endColumn":37,"suppressions":"121"},{"ruleId":"98","severity":2,"message":"108","line":3,"column":39,"nodeType":null,"messageId":"100","endLine":3,"endColumn":42,"suppressions":"122"},{"ruleId":"98","severity":2,"message":"110","line":3,"column":44,"nodeType":null,"messageId":"100","endLine":3,"endColumn":49,"suppressions":"123"},{"ruleId":"98","severity":2,"message":"99","line":3,"column":17,"nodeType":null,"messageId":"100","endLine":3,"endColumn":19,"suppressions":"124"},{"ruleId":"98","severity":2,"message":"102","line":3,"column":21,"nodeType":null,"messageId":"100","endLine":3,"endColumn":23,"suppressions":"125"},{"ruleId":"98","severity":2,"message":"106","line":3,"column":33,"nodeType":null,"messageId":"100","endLine":3,"endColumn":37,"suppressions":"126"},{"ruleId":"98","severity":2,"message":"108","line":3,"column":39,"nodeType":null,"messageId":"100","endLine":3,"endColumn":42,"suppressions":"127"},{"ruleId":"98","severity":2,"message":"110","line":3,"column":44,"nodeType":null,"messageId":"100","endLine":3,"endColumn":49,"suppressions":"128"},{"ruleId":"98","severity":2,"message":"99","line":3,"column":17,"nodeType":null,"messageId":"100","endLine":3,"endColumn":19,"suppressions":"129"},{"ruleId":"98","severity":2,"message":"102","line":3,"column":21,"nodeType":null,"messageId":"100","endLine":3,"endColumn":23,"suppressions":"130"},{"ruleId":"98","severity":2,"message":"104","line":3,"column":25,"nodeType":null,"messageId":"100","endLine":3,"endColumn":31,"suppressions":"131"},{"ruleId":"98","severity":2,"message":"106","line":3,"column":33,"nodeType":null,"messageId":"100","endLine":3,"endColumn":37,"suppressions":"132"},{"ruleId":"98","severity":2,"message":"108","line":3,"column":39,"nodeType":null,"messageId":"100","endLine":3,"endColumn":42,"suppressions":"133"},{"ruleId":"98","severity":2,"message":"110","line":3,"column":44,"nodeType":null,"messageId":"100","endLine":3,"endColumn":49,"suppressions":"134"},{"ruleId":"98","severity":2,"message":"135","line":3,"column":10,"nodeType":null,"messageId":"100","endLine":3,"endColumn":15,"suppressions":"136"},{"ruleId":"98","severity":2,"message":"99","line":3,"column":17,"nodeType":null,"messageId":"100","endLine":3,"endColumn":19,"suppressions":"137"},{"ruleId":"98","severity":2,"message":"104","line":3,"column":25,"nodeType":null,"messageId":"100","endLine":3,"endColumn":31,"suppressions":"138"},{"ruleId":"98","severity":2,"message":"106","line":3,"column":33,"nodeType":null,"messageId":"100","endLine":3,"endColumn":37,"suppressions":"139"},{"ruleId":"98","severity":2,"message":"110","line":3,"column":44,"nodeType":null,"messageId":"100","endLine":3,"endColumn":49,"suppressions":"140"},"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["141"],"'ok' is defined but never used.",["142"],"'throws' is defined but never used.",["143"],"'type' is defined but never used.",["144"],"'not' is defined but never used.",["145"],"'match' is defined but never used.",["146"],["147"],["148"],["149"],["150"],["151"],["152"],["153"],["154"],["155"],["156"],["157"],["158"],["159"],["160"],["161"],["162"],["163"],["164"],["165"],["166"],["167"],["168"],["169"],"'equal' is defined but never used.",["170"],["171"],["172"],["173"],["174"],{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},{"kind":"175","justification":"176"},"directive",""]
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2025 Roy Revelt and other contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -73,9 +73,9 @@ To report bugs or request features or assistance, [raise an issue](https://githu
73
73
 
74
74
  ## Licence
75
75
 
76
- MIT License.
76
+ MIT License
77
77
 
78
- Copyright © 2010-2025 Roy Revelt and other contributors.
78
+ Copyright © 2010-2025 Roy Revelt and other contributors
79
79
 
80
80
  List of [currency signs](https://github.com/bengourley/currency-symbol-map) - Copyright © 2017 Ben Gourley - see its [BSD-2-Clause disclaimer](https://opensource.org/licenses/BSD-2-Clause)
81
81
 
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * @name csv-sort
3
3
  * @fileoverview Sort double-entry bookkeeping CSV from internet banking
4
- * @version 7.0.29
5
- * @author Roy Revelt, Codsen Ltd
4
+ * @version 7.0.31
5
+ * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/csv-sort/}
8
8
  */
9
9
 
10
- import{pull as B}from"lodash-es";import{splitEasy as O}from"csv-split-easy";import R from"currency.js";function E(i){return typeof i=="number"&&!isNaN(i)?!0:(i=(i||"").toString().trim(),i?!isNaN(+i):!1)}var N=["\u062F.\u0625","\u060B","L","\u058F","\u0192","Kz","$","\u0192","\u20BC","KM","\u09F3","\u043B\u0432",".\u062F.\u0628","FBu","$b","R$","\u0E3F","Nu.","P","p.","BZ$","FC","CHF","\xA5","\u20A1","\u20B1","K\u010D","Fdj","kr","RD$","\u062F\u062C","kr","Nfk","Br","\u039E","\u20AC","\u20BE","\u20B5","GH\u20B5","D","FG","Q","L","kn","G","Ft","Rp","\u20AA","\u20B9","\u0639.\u062F","\uFDFC","kr","J$","JD","\xA5","KSh","\u043B\u0432","\u17DB","CF","\u20A9","\u20A9","KD","\u043B\u0432","\u20AD","\u20A8","M","\u0141","Lt","Ls","LD","MAD","lei","Ar","\u0434\u0435\u043D","K","\u20AE","MOP$","UM","\u20A8","Rf","MK","RM","MT","\u20A6","C$","kr","\u20A8","\uFDFC","B/.","S/.","K","\u20B1","\u20A8","z\u0142","Gs","\uFDFC","\uFFE5","lei","\u0414\u0438\u043D.","\u20BD","R\u20A3","\uFDFC","\u20A8","\u062C.\u0633.","kr","\xA3","Le","S","Db","E","\u0E3F","SM","T","\u062F.\u062A","T$","\u20A4","\u20BA","TT$","NT$","TSh","\u20B4","USh","$U","\u043B\u0432","Bs","\u20AB","VT","WS$","FCFA","\u0243","CFA","\u20A3","\uFDFC","R","Z$"];function f(i){return E(i)||N.some(b=>E(i.replace(b,"").replace(/[,.]/g,"")))?"numeric":i.trim()?"text":"empty"}var T="7.0.29";var K=T;function _(i){let b=null,C=null;if(typeof i!="string")throw new TypeError(`csv-sort/csvSort(): [THROW_ID_01] The input is of a wrong type! We accept either string of array of arrays. We got instead: ${typeof i}, equal to:
10
+ import{pull as B}from"lodash-es";import{splitEasy as O}from"csv-split-easy";import R from"currency.js";function E(i){return typeof i=="number"&&!isNaN(i)?!0:(i=(i||"").toString().trim(),i?!isNaN(+i):!1)}var N=["\u062F.\u0625","\u060B","L","\u058F","\u0192","Kz","$","\u0192","\u20BC","KM","\u09F3","\u043B\u0432",".\u062F.\u0628","FBu","$b","R$","\u0E3F","Nu.","P","p.","BZ$","FC","CHF","\xA5","\u20A1","\u20B1","K\u010D","Fdj","kr","RD$","\u062F\u062C","kr","Nfk","Br","\u039E","\u20AC","\u20BE","\u20B5","GH\u20B5","D","FG","Q","L","kn","G","Ft","Rp","\u20AA","\u20B9","\u0639.\u062F","\uFDFC","kr","J$","JD","\xA5","KSh","\u043B\u0432","\u17DB","CF","\u20A9","\u20A9","KD","\u043B\u0432","\u20AD","\u20A8","M","\u0141","Lt","Ls","LD","MAD","lei","Ar","\u0434\u0435\u043D","K","\u20AE","MOP$","UM","\u20A8","Rf","MK","RM","MT","\u20A6","C$","kr","\u20A8","\uFDFC","B/.","S/.","K","\u20B1","\u20A8","z\u0142","Gs","\uFDFC","\uFFE5","lei","\u0414\u0438\u043D.","\u20BD","R\u20A3","\uFDFC","\u20A8","\u062C.\u0633.","kr","\xA3","Le","S","Db","E","\u0E3F","SM","T","\u062F.\u062A","T$","\u20A4","\u20BA","TT$","NT$","TSh","\u20B4","USh","$U","\u043B\u0432","Bs","\u20AB","VT","WS$","FCFA","\u0243","CFA","\u20A3","\uFDFC","R","Z$"];function f(i){return E(i)||N.some(b=>E(i.replace(b,"").replace(/[,.]/g,"")))?"numeric":i.trim()?"text":"empty"}var T="7.0.31";var K=T;function _(i){let b=null,C=null;if(typeof i!="string")throw new TypeError(`csv-sort/csvSort(): [THROW_ID_01] The input is of a wrong type! We accept either string of array of arrays. We got instead: ${typeof i}, equal to:
11
11
  ${JSON.stringify(i,null,4)}`);if(!i.trim())return{res:[[""]],msgContent:b,msgType:C};let n=O(i),s=[],g=!1,S=!0,v=[],o=null;for(let t=n.length-1;t>=0;t--)if(s.length){t===0&&(g=n[t].every(l=>f(l)==="text"||f(l)==="empty")),!g&&s.length!==n[t].length&&(S=!1);let e=null;for(let l=0,p=n[t].length;l<p;l++)if(e===null&&f(n[t][l].trim())==="empty"&&(e=l),e!==null&&f(n[t][l].trim())!=="empty"&&(e=null),f(n[t][l].trim())!==s[l]&&!g){let a=f(n[t][l].trim());if(Array.isArray(s[l]))s[l].includes(a)||s[l].push(f(n[t][l].trim()));else if(s[l]!==a){let u=s[l];s[l]=[],s[l].push(u),s[l].push(a)}}o!==null&&e!==null&&e>o&&(!g||g&&t!==0)&&(o=e)}else if(n[t].length!==1||n[t][0]!=="")for(let e=0,l=n[t].length;e<l;e++)s.push(f(n[t][e].trim())),o===null&&f(n[t][e].trim())==="empty"&&(o=e),o!==null&&f(n[t][e].trim())!=="empty"&&(o=null);o||(o=s.length);let w=0;for(let t=0,e=s.length;t<e&&s[t]==="empty";t++)w=t;w!==0&&(n=n.map(t=>t.slice(w+1,o)),s=s.slice(w+1,o));let V=[],m;s.forEach((t,e)=>{t==="numeric"&&V.push(e)});let k=g?1:0;if(V.length===1)m=V[0];else{if(V.length===0)throw new Error('csv-sort/csvSort(): [THROW_ID_03] Your CSV file does not contain numeric-only columns and computer was not able to detect the "Balance" column!');{let t=Array.from(V),e=[];for(let l=0,p=t.length;l<p;l++){let a=t[l],u,d=!0,$,h=!0;for(let c=k,I=n.length;c<I&&(d&&(u==null?u=n[c][a]:u===n[c][a]?(e.push(a),d=!1):u=n[c][a]),h&&($==null?$=n[c][a]:n[c][a]!==$&&(h=!1)),!!d);c++);h&&v.push(a)}if(t=B(t,...e),t.length===1)m=t[0];else if(t.length===0)throw new Error(`csv-sort/csvSort(): [THROW_ID_04] The computer can't find the "Balance" column! It saw some numeric-only columns, but they all seem to have certain rows with the same values as rows right below/above them!`)}}if(!m)throw new Error("csv-sort/csvSort(): [THROW_ID_05] Sadly computer couldn't find its way in this CSV and had to stop working on it.");let D=B(Array.from(s.reduce((t,e,l)=>((typeof e=="string"&&e==="numeric"||Array.isArray(e)&&e.includes("numeric"))&&t.push(l),t),[])),m,...v),r=[];r.push(n[n.length-1].slice(0,o));let y=[],x=g?1:0;for(let t=n.length-2;t>=x;t--)for(let e=n.length-2;e>=x;e--)if(!y.includes(e)){let l=!1;for(let p=0,a=D.length;p<a;p++){let u=null;n[e][D[p]]!==""&&(u=R(n[e][D[p]]));let d=null;n[e][m]!==""&&(d=R(n[e][m]));let $=null;r[0][m]!==""&&($=R(r[0][m]).format());let h=null;r[r.length-1][D[p]]!==""&&(h=R(r[r.length-1][D[p]]).format());let c=null;if(r[r.length-1][m]!==""&&(c=R(r[r.length-1][m])),u&&d.add(u).format()===$){r.unshift(n[e].slice(0,o)),y.push(e),l=!0;break}else if(u&&d.subtract(u).format()===$){r.unshift(n[e].slice(0,o)),y.push(e),l=!0;break}else if(h&&c.add(h).format()===d.format()){r.push(n[e].slice(0,o)),y.push(e),l=!0;break}else if(h&&c.subtract(h).format()===d.format()){r.push(n[e].slice(0,o)),y.push(e),l=!0;break}}if(l){l=!1;break}}return g&&(S&&n[0].length>s.length&&(n[0].length=s.length),r.unshift(n[0].slice(0,o))),n.length-(g?2:1)!==y.length&&(b="Not all rows were recognised!",C="alert"),{res:r,msgContent:b,msgType:C}}export{f as findType,E as isNumeric,_ as sort,K as version};
@@ -1,74 +1,74 @@
1
1
  /**
2
2
  * @name csv-sort
3
3
  * @fileoverview Sort double-entry bookkeeping CSV from internet banking
4
- * @version 7.0.29
5
- * @author Roy Revelt, Codsen Ltd
4
+ * @version 7.0.31
5
+ * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/csv-sort/}
8
8
  */
9
9
 
10
- "use strict";var csvSort=(()=>{var vr=Object.create;var V=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var Sr=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,$r=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable;var Q=(e,r,a)=>r in e?V(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,x=(e,r)=>{for(var a in r||(r={}))le.call(r,a)&&Q(e,a,r[a]);if(ne)for(var a of ne(r))Or.call(r,a)&&Q(e,a,r[a]);return e};var fe=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Ar=(e,r)=>{for(var a in r)V(e,a,{get:r[a],enumerable:!0})},ie=(e,r,a,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let f of Sr(r))!le.call(e,f)&&f!==a&&V(e,f,{get:()=>r[f],enumerable:!(o=Tr(r,f))||o.enumerable});return e};var ue=(e,r,a)=>(a=e!=null?vr($r(e)):{},ie(r||!e||!e.__esModule?V(a,"default",{value:e,enumerable:!0}):a,e)),Rr=e=>ie(V({},"__esModule",{value:!0}),e);var Z=(e,r,a)=>Q(e,typeof r!="symbol"?r+"":r,a);var dr=fe((qs,mr)=>{"use strict";mr.exports=wo;function C(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function wo(e){if(e=e||{},e.circles)return vo(e);let r=new Map;if(r.set(Date,n=>new Date(n)),r.set(Map,(n,u)=>new Map(o(Array.from(n),u))),r.set(Set,(n,u)=>new Set(o(Array.from(n),u))),e.constructorHandlers)for(let n of e.constructorHandlers)r.set(n[0],n[1]);let a=null;return e.proto?t:f;function o(n,u){let s=Object.keys(n),l=new Array(s.length);for(let i=0;i<s.length;i++){let p=s[i],m=n[p];typeof m!="object"||m===null?l[p]=m:m.constructor!==Object&&(a=r.get(m.constructor))?l[p]=a(m,u):ArrayBuffer.isView(m)?l[p]=C(m):l[p]=u(m)}return l}function f(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return o(n,f);if(n.constructor!==Object&&(a=r.get(n.constructor)))return a(n,f);let u={};for(let s in n){if(Object.hasOwnProperty.call(n,s)===!1)continue;let l=n[s];typeof l!="object"||l===null?u[s]=l:l.constructor!==Object&&(a=r.get(l.constructor))?u[s]=a(l,f):ArrayBuffer.isView(l)?u[s]=C(l):u[s]=f(l)}return u}function t(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return o(n,t);if(n.constructor!==Object&&(a=r.get(n.constructor)))return a(n,t);let u={};for(let s in n){let l=n[s];typeof l!="object"||l===null?u[s]=l:l.constructor!==Object&&(a=r.get(l.constructor))?u[s]=a(l,t):ArrayBuffer.isView(l)?u[s]=C(l):u[s]=t(l)}return u}}function vo(e){let r=[],a=[],o=new Map;if(o.set(Date,s=>new Date(s)),o.set(Map,(s,l)=>new Map(t(Array.from(s),l))),o.set(Set,(s,l)=>new Set(t(Array.from(s),l))),e.constructorHandlers)for(let s of e.constructorHandlers)o.set(s[0],s[1]);let f=null;return e.proto?u:n;function t(s,l){let i=Object.keys(s),p=new Array(i.length);for(let m=0;m<i.length;m++){let g=i[m],y=s[g];if(typeof y!="object"||y===null)p[g]=y;else if(y.constructor!==Object&&(f=o.get(y.constructor)))p[g]=f(y,l);else if(ArrayBuffer.isView(y))p[g]=C(y);else{let T=r.indexOf(y);T!==-1?p[g]=a[T]:p[g]=l(y)}}return p}function n(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return t(s,n);if(s.constructor!==Object&&(f=o.get(s.constructor)))return f(s,n);let l={};r.push(s),a.push(l);for(let i in s){if(Object.hasOwnProperty.call(s,i)===!1)continue;let p=s[i];if(typeof p!="object"||p===null)l[i]=p;else if(p.constructor!==Object&&(f=o.get(p.constructor)))l[i]=f(p,n);else if(ArrayBuffer.isView(p))l[i]=C(p);else{let m=r.indexOf(p);m!==-1?l[i]=a[m]:l[i]=n(p)}}return r.pop(),a.pop(),l}function u(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return t(s,u);if(s.constructor!==Object&&(f=o.get(s.constructor)))return f(s,u);let l={};r.push(s),a.push(l);for(let i in s){let p=s[i];if(typeof p!="object"||p===null)l[i]=p;else if(p.constructor!==Object&&(f=o.get(p.constructor)))l[i]=f(p,u);else if(ArrayBuffer.isView(p))l[i]=C(p);else{let m=r.indexOf(p);m!==-1?l[i]=a[m]:l[i]=u(p)}}return r.pop(),a.pop(),l}}});var xr=fe((ae,se)=>{(function(e,r){typeof ae=="object"&&typeof se<"u"?se.exports=r():typeof define=="function"&&define.amd?define(r):(e=e||self,e.currency=r())})(ae,function(){function e(t,n){if(!(this instanceof e))return new e(t,n);n=Object.assign({},a,n);var u=Math.pow(10,n.precision);this.intValue=t=r(t,n),this.value=t/u,n.increment=n.increment||1/u,n.groups=n.useVedic?f:o,this.s=n,this.p=u}function r(t,n){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0,s=n.decimal,l=n.errorOnInvalid,i=n.fromCents,p=Math.pow(10,n.precision),m=t instanceof e;if(m&&i)return t.intValue;if(typeof t=="number"||m)s=m?t.value:t;else if(typeof t=="string")l=new RegExp("[^-\\d"+s+"]","g"),s=new RegExp("\\"+s,"g"),s=(s=t.replace(/\((.*)\)/,"-$1").replace(l,"").replace(s,"."))||0;else{if(l)throw Error("Invalid Input");s=0}return i||(s=(s*p).toFixed(4)),u?Math.round(s):s}var a={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:function(t,n){var u=n.pattern,s=n.negativePattern,l=n.symbol,i=n.separator,p=n.decimal;n=n.groups;var m=(""+t).replace(/^-/,"").split("."),g=m[0];return m=m[1],(0<=t.value?u:s).replace("!",l).replace("#",g.replace(n,"$1"+i)+(m?p+m:""))},fromCents:!1},o=/(\d)(?=(\d{3})+\b)/g,f=/(\d)(?=(\d\d)+\d\b)/g;return e.prototype={add:function(t){var n=this.s,u=this.p;return e((this.intValue+r(t,n))/(n.fromCents?1:u),n)},subtract:function(t){var n=this.s,u=this.p;return e((this.intValue-r(t,n))/(n.fromCents?1:u),n)},multiply:function(t){var n=this.s;return e(this.intValue*t/(n.fromCents?1:Math.pow(10,n.precision)),n)},divide:function(t){var n=this.s;return e(this.intValue/r(t,n,!1),n)},distribute:function(t){var n=this.intValue,u=this.p,s=this.s,l=[],i=Math[0<=n?"floor":"ceil"](n/t),p=Math.abs(n-i*t);for(u=s.fromCents?1:u;t!==0;t--){var m=e(i/u,s);0<p--&&(m=m[0<=n?"add":"subtract"](1/u)),l.push(m)}return l},dollars:function(){return~~this.value},cents:function(){return~~(this.intValue%this.p)},format:function(t){var n=this.s;return typeof t=="function"?t(this,n):n.format(this,Object.assign({},n,t))},toString:function(){var t=this.s,n=t.increment;return(Math.round(this.intValue/this.p/n)*n).toFixed(t.precision)},toJSON:function(){return this.value}},e})});var No={};Ar(No,{findType:()=>v,isNumeric:()=>G,sort:()=>Eo,version:()=>Io});var Ir=typeof global=="object"&&global&&global.Object===Object&&global,pe=Ir;var Er=typeof self=="object"&&self&&self.Object===Object&&self,Nr=pe||Er||Function("return this")(),M=Nr;var Dr=M.Symbol,R=Dr;var me=Object.prototype,jr=me.hasOwnProperty,Cr=me.toString,W=R?R.toStringTag:void 0;function kr(e){var r=jr.call(e,W),a=e[W];try{e[W]=void 0;var o=!0}catch(t){}var f=Cr.call(e);return o&&(r?e[W]=a:delete e[W]),f}var de=kr;var Fr=Object.prototype,Vr=Fr.toString;function Wr(e){return Vr.call(e)}var ce=Wr;var Br="[object Null]",_r="[object Undefined]",ge=R?R.toStringTag:void 0;function Mr(e){return e==null?e===void 0?_r:Br:ge&&ge in Object(e)?de(e):ce(e)}var P=Mr;function Pr(e){return e!=null&&typeof e=="object"}var he=Pr;var Hr="[object Symbol]";function Jr(e){return typeof e=="symbol"||he(e)&&P(e)==Hr}var ye=Jr;function Lr(e,r){for(var a=-1,o=e==null?0:e.length,f=Array(o);++a<o;)f[a]=r(e[a],a,e);return f}var H=Lr;var qr=Array.isArray,xe=qr;var Ur=1/0,be=R?R.prototype:void 0,we=be?be.toString:void 0;function ve(e){if(typeof e=="string")return e;if(xe(e))return H(e,ve)+"";if(ye(e))return we?we.call(e):"";var r=e+"";return r=="0"&&1/e==-Ur?"-0":r}var J=ve;var Kr=/\s/;function zr(e){for(var r=e.length;r--&&Kr.test(e.charAt(r)););return r}var Te=zr;var Gr=/^\s+/;function Qr(e){return e&&e.slice(0,Te(e)+1).replace(Gr,"")}var Se=Qr;function Zr(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var L=Zr;function Yr(e){return e}var q=Yr;var Xr="[object AsyncFunction]",et="[object Function]",rt="[object GeneratorFunction]",tt="[object Proxy]";function ot(e){if(!L(e))return!1;var r=P(e);return r==et||r==rt||r==Xr||r==tt}var $e=ot;var at=M["__core-js_shared__"],U=at;var Oe=(function(){var e=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function st(e){return!!Oe&&Oe in e}var Ae=st;var nt=Function.prototype,lt=nt.toString;function ft(e){if(e!=null){try{return lt.call(e)}catch(r){}try{return e+""}catch(r){}}return""}var Re=ft;var it=/[\\^$.*+?()[\]{}|]/g,ut=/^\[object .+?Constructor\]$/,pt=Function.prototype,mt=Object.prototype,dt=pt.toString,ct=mt.hasOwnProperty,gt=RegExp("^"+dt.call(ct).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ht(e){if(!L(e)||Ae(e))return!1;var r=$e(e)?gt:ut;return r.test(Re(e))}var Ie=ht;function yt(e,r){return e==null?void 0:e[r]}var Ee=yt;function xt(e,r){var a=Ee(e,r);return Ie(a)?a:void 0}var Ne=xt;function bt(e,r,a){switch(a.length){case 0:return e.call(r);case 1:return e.call(r,a[0]);case 2:return e.call(r,a[0],a[1]);case 3:return e.call(r,a[0],a[1],a[2])}return e.apply(r,a)}var De=bt;function wt(e,r){var a=-1,o=e.length;for(r||(r=Array(o));++a<o;)r[a]=e[a];return r}var je=wt;var vt=800,Tt=16,St=Date.now;function $t(e){var r=0,a=0;return function(){var o=St(),f=Tt-(o-a);if(a=o,f>0){if(++r>=vt)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var Ce=$t;function Ot(e){return function(){return e}}var ke=Ot;var At=(function(){try{var e=Ne(Object,"defineProperty");return e({},"",{}),e}catch(r){}})(),Y=At;var Rt=Y?function(e,r){return Y(e,"toString",{configurable:!0,enumerable:!1,value:ke(r),writable:!0})}:q,Fe=Rt;var It=Ce(Fe),Ve=It;function Et(e,r,a,o){for(var f=e.length,t=a+(o?1:-1);o?t--:++t<f;)if(r(e[t],t,e))return t;return-1}var We=Et;function Nt(e){return e!==e}var Be=Nt;function Dt(e,r,a){for(var o=a-1,f=e.length;++o<f;)if(e[o]===r)return o;return-1}var _e=Dt;function jt(e,r,a){return r===r?_e(e,r,a):We(e,Be,a)}var D=jt;var Me=Math.max;function Ct(e,r,a){return r=Me(r===void 0?e.length-1:r,0),function(){for(var o=arguments,f=-1,t=Me(o.length-r,0),n=Array(t);++f<t;)n[f]=o[r+f];f=-1;for(var u=Array(r+1);++f<r;)u[f]=o[f];return u[r]=a(n),De(e,this,u)}}var Pe=Ct;function kt(e,r){return Ve(Pe(e,r,q),e+"")}var He=kt;function Ft(e){return function(r){return e(r)}}var Je=Ft;function Vt(e){return e==null?"":J(e)}var Le=Vt;function Wt(e,r,a){var o=-1,f=e.length;r<0&&(r=-r>f?0:f+r),a=a>f?f:a,a<0&&(a+=f),f=r>a?0:a-r>>>0,r>>>=0;for(var t=Array(f);++o<f;)t[o]=e[o+r];return t}var qe=Wt;function Bt(e,r,a){var o=e.length;return a=a===void 0?o:a,!r&&a>=o?e:qe(e,r,a)}var Ue=Bt;var _t="\\ud800-\\udfff",Mt="\\u0300-\\u036f",Pt="\\ufe20-\\ufe2f",Ht="\\u20d0-\\u20ff",Jt=Mt+Pt+Ht,Lt="\\ufe0e\\ufe0f",qt="\\u200d",Ut=RegExp("["+qt+_t+Jt+Lt+"]");function Kt(e){return Ut.test(e)}var Ke=Kt;function zt(e){return e.split("")}var ze=zt;var Ge="\\ud800-\\udfff",Gt="\\u0300-\\u036f",Qt="\\ufe20-\\ufe2f",Zt="\\u20d0-\\u20ff",Yt=Gt+Qt+Zt,Xt="\\ufe0e\\ufe0f",eo="["+Ge+"]",X="["+Yt+"]",ee="\\ud83c[\\udffb-\\udfff]",ro="(?:"+X+"|"+ee+")",Qe="[^"+Ge+"]",Ze="(?:\\ud83c[\\udde6-\\uddff]){2}",Ye="[\\ud800-\\udbff][\\udc00-\\udfff]",to="\\u200d",Xe=ro+"?",er="["+Xt+"]?",oo="(?:"+to+"(?:"+[Qe,Ze,Ye].join("|")+")"+er+Xe+")*",ao=er+Xe+oo,so="(?:"+[Qe+X+"?",X,Ze,Ye,eo].join("|")+")",no=RegExp(ee+"(?="+ee+")|"+so+ao,"g");function lo(e){return e.match(no)||[]}var rr=lo;function fo(e){return Ke(e)?rr(e):ze(e)}var re=fo;function io(e,r,a,o){for(var f=a-1,t=e.length;++f<t;)if(o(e[f],r))return f;return-1}var tr=io;var uo=Array.prototype,or=uo.splice;function po(e,r,a,o){var f=o?tr:D,t=-1,n=r.length,u=e;for(e===r&&(r=je(r)),a&&(u=H(e,Je(a)));++t<n;)for(var s=0,l=r[t],i=a?a(l):l;(s=f(u,i,s,o))>-1;)u!==e&&or.call(u,s,1),or.call(e,s,1);return e}var ar=po;function mo(e,r){return e&&e.length&&r&&r.length?ar(e,r):e}var sr=mo;var co=He(sr),K=co;function go(e,r){for(var a=e.length;a--&&D(r,e[a],0)>-1;);return a}var nr=go;function ho(e,r){for(var a=-1,o=e.length;++a<o&&D(r,e[a],0)>-1;);return a}var lr=ho;function yo(e,r,a){if(e=Le(e),e&&(a||r===void 0))return Se(e);if(!e||!(r=J(r)))return e;var o=re(e),f=re(r),t=lr(o,f),n=nr(o,f)+1;return Ue(o,t,n).join("")}var te=yo;var xo={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function j(e,r){if(!Array.isArray(e)||!e.length)return e;let a=x(x({},xo),r),o,f;if(a.strictlyTwoElementsInRangeArrays&&!e.every((u,s)=>!Array.isArray(u)||u.length!==2?(o=s,f=u.length,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(o,"th range (").concat(JSON.stringify(e[o],null,4),") has not two but ").concat(f," elements!"));if(!e.every((u,s)=>!Array.isArray(u)||!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0?(o=s,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(o,"th range (").concat(JSON.stringify(e[o],null,4),") does not consist of only natural numbers!"));let t=e.length**2,n=0;return Array.from(e).sort((u,s)=>(a.progressFn&&(n+=1,a.progressFn(Math.floor(n*100/t))),u[0]===s[0]?u[1]<s[1]?-1:u[1]>s[1]?1:0:u[0]<s[0]?-1:1))}var fr={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ir(e,r){function a(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}if(!Array.isArray(e)||!e.length)return null;let o;if(r)if(a(r)){if(o=x(x({},fr),r),o.progressFn&&a(o.progressFn)&&!Object.keys(o.progressFn).length)o.progressFn=null;else if(o.progressFn&&typeof o.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "'.concat(typeof o.progressFn,'", equal to ').concat(JSON.stringify(o.progressFn,null,4)));if(![1,2,"1","2"].includes(o.mergeType))throw new Error('ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof o.mergeType,'", equal to ').concat(JSON.stringify(o.mergeType,null,4)));if(typeof o.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof o.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(o.joinRangesThatTouchEdges,null,4)))}else throw new Error("emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(r,null,4)," (type ").concat(typeof r,")"));else o=x({},fr);let f=e.filter(l=>Array.isArray(l)).map(l=>[...l]).filter(l=>l[2]!==void 0||l[0]!==l[1]),t,n,u;o.progressFn?t=j(f,{progressFn:l=>{u=Math.floor(l/5),u!==n&&(n=u,o.progressFn(u))}}):t=j(f);let s=t.length-1;for(let l=s;l>0;l--)o.progressFn&&(u=Math.floor((1-l/s)*78)+21,u!==n&&u>n&&(n=u,o.progressFn(u))),(t[l][0]<=t[l-1][0]||!o.joinRangesThatTouchEdges&&t[l][0]<t[l-1][1]||o.joinRangesThatTouchEdges&&t[l][0]<=t[l-1][1])&&(t[l-1][0]=Math.min(t[l][0],t[l-1][0]),t[l-1][1]=Math.max(t[l][1],t[l-1][1]),t[l][2]!==void 0&&(t[l-1][0]>=t[l][0]||t[l-1][1]<=t[l][1])&&t[l-1][2]!==null&&(t[l][2]===null&&t[l-1][2]!==null?t[l-1][2]=null:t[l-1][2]!=null?+o.mergeType==2&&t[l-1][0]===t[l][0]?t[l-1][2]=t[l][2]:t[l-1][2]+=t[l][2]:t[l-1][2]=t[l][2]),t.splice(l,1),l=t.length);return t.length?t:null}var bo=!0,oe="Invariant failed";function ur(e,r){if(!e){if(bo)throw new Error(oe);var a=typeof r=="function"?r():r,o=a?"".concat(oe,": ").concat(a):oe;throw new Error(o)}}function pr(e,r,a){let o=0,f=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(JSON.stringify(e,null,4)));if(r&&!Array.isArray(r))throw new TypeError("ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof r,", equal to: ").concat(JSON.stringify(r,null,4)));if(a&&typeof a!="function")throw new TypeError("ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ".concat(typeof a,", equal to: ").concat(JSON.stringify(a,null,4)));if(!(r!=null&&r.filter(i=>i).length))return e;let t;Array.isArray(r)&&Number.isInteger(r[0])&&Number.isInteger(r[1])?t=[Array.from(r)]:t=Array.from(r);let n=t.length,u=0;t.filter(i=>i).forEach((i,p)=>{if(a&&(o=Math.floor(u/n*10),o!==f&&(f=o,a(o))),!Array.isArray(i))throw new TypeError("ranges-apply: [THROW_ID_05] ranges array, second input arg., has ".concat(p,"th element not an array: ").concat(JSON.stringify(i,null,4),", which is ").concat(typeof i));if(!Number.isInteger(i[0])){if(!Number.isInteger(+i[0])||+i[0]<0)throw new TypeError("ranges-apply: [THROW_ID_06] ranges array, second input arg. has ".concat(p,"th element, array ").concat(JSON.stringify(i,null,0),". Its first element is not an integer, string index, but ").concat(typeof i[0],", equal to: ").concat(JSON.stringify(i[0],null,4),"."));t[p][0]=+t[p][0]}if(!Number.isInteger(i[1])){if(!Number.isInteger(+i[1])||+i[1]<0)throw new TypeError("ranges-apply: [THROW_ID_07] ranges array, second input arg. has ".concat(p,"th element, array ").concat(JSON.stringify(i,null,0),". Its second element is not an integer, string index, but ").concat(typeof i[1],", equal to: ").concat(JSON.stringify(i[1],null,4),"."));t[p][1]=+t[p][1]}u+=1});let s=ir(t,{progressFn:i=>{a&&(o=10+Math.floor(i/10),o!==f&&(f=o,a(o)))}});ur(s);let l=s.length;if(l>0){let i=e.slice(s[l-1][1]);e=s.reduce((p,m,g,y)=>{a&&(o=20+Math.floor(g/l*80),o!==f&&(f=o,a(o)));let T=g===0?0:y[g-1][1],_=y[g][0];return"".concat(p).concat(e.slice(T,_)).concat(y[g][2]||"")},""),e+=i}return e}function z(e,r=1){let a="\xA0";function o(t){return Array.from(t).reverse().join("")}function f(t,n,u){let s=u?"\n":"\r",l=u?"\r":"\n";if(!t)return t;let i=0,p=0,m="";for(let g=0,y=t.length;g<y;g++)(t[g]===s||t[g]===l&&t[g-1]!==s)&&p++,"\r\n".includes(t[g])||t[g]===a?(i=0,t[g]===a?m+=t[g]:t[g]===s?p<=n&&(m+=t[g],t[g+1]===l&&(m+=t[g+1],g++)):t[g]===l&&(t==null?void 0:t[g-1])!==s&&p<=n&&(m+=t[g])):(i++,!t[g+1]&&!p&&(m+=" "));return m}if(typeof e=="string"&&e.length){let t=1;typeof+r=="number"&&Number.isInteger(+r)&&+r>=0&&(t=+r);let n="",u="";if(!e.trim())n=e;else if(!e[0].trim()){for(let s=0,l=e.length;s<l;s++)if(e[s].trim()){n=e.slice(0,s);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===a)){for(let s=e.length;s--;)if(e[s].trim()){u=e.slice(s+1);break}}return"".concat(f(n,t,!1)).concat(e.trim()).concat(o(f(o(u),t,!0)))}return e}var cr=ue(dr(),1);var Us=(0,cr.default)();function k(e){return typeof e=="string"}function I(e){return Number.isSafeInteger(e)&&e>=0}function E(e){return e!=null}var gr={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function To(e,r){var l;function a(i){return!!i&&typeof i=="object"&&!Array.isArray(i)}if(!Array.isArray(e)||!e.length)return null;let o;if(r)if(a(r)){if(o=x(x({},gr),r),o.progressFn&&a(o.progressFn)&&!Object.keys(o.progressFn).length)o.progressFn=null;else if(o.progressFn&&typeof o.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof o.progressFn,'", equal to ').concat(JSON.stringify(o.progressFn,null,4)));if(![1,2,"1","2"].includes(o.mergeType))throw new Error('ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof o.mergeType,'", equal to ').concat(JSON.stringify(o.mergeType,null,4)));if(typeof o.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof o.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(o.joinRangesThatTouchEdges,null,4)))}else throw new Error("ranges-merge: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(r,null,4)," (type ").concat(typeof r,")"));else o=x({},gr);let f=e.filter(i=>Array.isArray(i)).map(i=>[...i]).filter(i=>i[2]!==void 0||i[0]!==i[1]),t,n,u;o.progressFn?t=j(f,{progressFn:i=>{u=Math.floor(i/5),u!==n&&(n=u,o.progressFn!=null&&o.progressFn(u))}}):t=j(f);let s=t.length-1;for(let i=s;i>0;i--)o.progressFn&&(u=Math.floor((1-i/s)*78)+21,u!==n&&u>n&&(n=u,o.progressFn(u))),(t[i][0]<=t[i-1][0]||!o.joinRangesThatTouchEdges&&t[i][0]<t[i-1][1]||o.joinRangesThatTouchEdges&&t[i][0]<=t[i-1][1])&&(t[i-1][0]=Math.min(t[i][0],t[i-1][0]),t[i-1][1]=Math.max(t[i][1],t[i-1][1]),t[i][2]!==void 0&&(t[i-1][0]>=t[i][0]||t[i-1][1]<=t[i][1])&&t[i-1][2]!==null&&(t[i][2]===null&&t[i-1][2]!==null?t[i-1][2]=null:t[i-1][2]!=null?+((l=o||{})==null?void 0:l.mergeType)==2&&t[i-1][0]===t[i][0]?t[i-1][2]=t[i][2]:t[i-1][2]+=t[i][2]:t[i-1][2]=t[i][2]),t.splice(i,1),i=t.length);return t.length?t:null}var So={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},hr=class{constructor(e){Z(this,"ranges");Z(this,"opts");let r=x(x({},So),e);if(r.mergeType&&r.mergeType!==1&&r.mergeType!==2)if(k(r.mergeType)&&r.mergeType.trim()==="1")r.mergeType=1;else if(k(r.mergeType)&&r.mergeType.trim()==="2")r.mergeType=2;else throw new Error('ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(JSON.stringify(r.mergeType,null,4)));this.opts=r,this.ranges=[]}add(e,r,a){var t;if(e==null&&r==null)return;if(E(e)&&!E(r)){if(Array.isArray(e)){if(e.length){if(e.some(n=>Array.isArray(n))){e.forEach(n=>{Array.isArray(n)&&this.add(...n)});return}e.length&&I(+e[0])&&I(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set ('.concat(JSON.stringify(e,null,0),') but second-one, "to" is not (').concat(JSON.stringify(r,null,0),")"))}else if(!E(e)&&E(r))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set ('.concat(JSON.stringify(r,null,0),') but first-one, "from" is not (').concat(JSON.stringify(e,null,0),")"));let o=+e,f=+r;if(I(a)&&(a=String(a)),I(o)&&I(f)){if(E(a)&&!k(a)&&!I(a))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ".concat(typeof a,", equal to:\n").concat(JSON.stringify(a,null,4)));if(E(this.ranges)&&Array.isArray(this.last())&&o===this.last()[1]){if(this.last()[1]=f,this.last()[2],this.last()[2]!==null&&E(a)){let n=this.last()[2]&&this.last()[2].length&&(!((t=this.opts)!=null&&t.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(a):a;this.opts.limitToBeAddedWhitespace&&(n=z(n,this.opts.limitLinebreaksCount)),k(n)&&!n.length||(this.last()[2]=n)}}else{this.ranges||(this.ranges=[]);let n=a!==void 0&&!(k(a)&&!a.length)?[o,f,a&&this.opts.limitToBeAddedWhitespace?z(a,this.opts.limitLinebreaksCount):a]:[o,f];this.ranges.push(n)}}else throw I(o)&&o>=0?new TypeError('ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof f,'" equal to: ').concat(JSON.stringify(f,null,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof o,'" equal to: ').concat(JSON.stringify(o,null,4)))}push(e,r,a){this.add(e,r,a)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=To(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>E(e[2])?[e[0],e[1],z(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&I(e[0][0]))this.ranges=Array.from(e);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ".concat(JSON.stringify(e[0],null,4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var $o={removeThousandSeparatorsFromNumbers:!0,padSingleDecimalPlaceNumbers:!0,forceUKStyle:!1};function B(e,r){let a=!0,o=[".",",","'"," "],f;if(typeof e!="string")throw new TypeError("string-remove-thousand-separators/remSep(): [THROW_ID_01] Input must be string! Currently it's: ".concat(typeof e,", equal to:\n").concat(JSON.stringify(e,null,4)));if(r&&typeof r!="object")throw new TypeError("string-remove-thousand-separators/remSep(): [THROW_ID_02] Options object must be a plain object! Currently it's: ".concat(typeof r,", equal to:\n").concat(JSON.stringify(r,null,4)));let t=x(x({},$o),r),n=te(e.trim(),'"');if(n==="")return n;if(+e>0&&+e<1)return e;let u=new hr;for(let s=0,l=n.length;s<l;s++){if(t.removeThousandSeparatorsFromNumbers&&n[s].trim()===""&&u.add(s,s+1),t.removeThousandSeparatorsFromNumbers&&n[s]==="'"&&(u.add(s,s+1),n[s+1]==="'")){a=!1;break}if(o.includes(n[s])){if(n[s+1]!==void 0&&/^\d$/.test(n[s+1]))if(n[s+2]!==void 0)if(/^\d$/.test(n[s+2]))if(n[s+3]!==void 0)if(/^\d$/.test(n[s+3])){if(n[s+4]!==void 0&&/^\d$/.test(n[s+4])){a=!1;break}else if(t.removeThousandSeparatorsFromNumbers&&u.add(s,s+1),!f)f=n[s];else if(n[s]!==f){a=!1;break}}else{a=!1;break}else t.removeThousandSeparatorsFromNumbers&&t.forceUKStyle&&n[s]===","&&u.add(s,s+1,".");else{a=!1;break}else t.forceUKStyle&&n[s]===","&&u.add(s,s+1,"."),t.padSingleDecimalPlaceNumbers&&u.add(s+2,s+2,"0")}else if(!/^\d$/.test(n[s])){a=!1;break}}return a&&u.current()?pr(n,u.current()):n}var Oo={removeThousandSeparatorsFromNumbers:!0,padSingleDecimalPlaceNumbers:!0,forceUKStyle:!1};function yr(e,r){let a=0,o=0,f=[],t=[],n=!1,u=!0;if(r&&typeof r!="object")throw new Error("csv-split-easy/split(): [THROW_ID_02] Options object must be a plain object! Currently it's of a type ".concat(typeof r," equal to:\n").concat(JSON.stringify(r,null,4)));let s=x(x({},Oo),r);if(typeof e!="string")throw new TypeError("csv-split-easy/split(): [THROW_ID_04] input must be string! Currently it's: ".concat(typeof e,", equal to: ").concat(JSON.stringify(e,null,4)));if(e==="")return[[""]];e=e.trim();for(let l=0,i=e.length;l<i;l++){if(u&&e[l]!=='"'&&e[l]!==","&&e[l].trim()!==""&&(u=!1),e[l]==='"')if(n&&e[l+1]==='"')l+=1;else if(n){n=!1;let p=e.slice(a,l);p.trim()!==""&&(u=!1);let m=/""/.test(p)?p.replace(/""/g,'"'):B(p,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle});f.push(m)}else n=!0,a=l+1;else if(!n&&e[l]===","){if(e[l-1]!=='"'&&!n){let p=e.slice(a,l);p.trim()!==""&&(u=!1),f.push(B(p,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle}))}a=l+1,o&&(o=0)}else if(e[l]==="\n"||e[l]==="\r"){if(!o){if(o=l,!n&&e[l-1]!=='"'){let p=e.slice(a,l);p.trim()!==""&&(u=!1),f.push(B(p,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle}))}u?f.length=0:t.push(f),u=!0,f=[]}a=l+1}else o&&(o=0,a=l);if(l+1===i){if(e[l]!=='"'){let p=e.slice(a,l+1);p.trim()&&(u=!1),f.push(B(p,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle}))}u?f=[]:t.push(f),u=!0}}return t.length===0?[[""]]:t}var F=ue(xr(),1);function G(e){return typeof e=="number"&&!isNaN(e)?!0:(e=(e||"").toString().trim(),e?!isNaN(+e):!1)}var Ao=["\u062F.\u0625","\u060B","L","\u058F","\u0192","Kz","$","\u0192","\u20BC","KM","\u09F3","\u043B\u0432",".\u062F.\u0628","FBu","$b","R$","\u0E3F","Nu.","P","p.","BZ$","FC","CHF","\xA5","\u20A1","\u20B1","K\u010D","Fdj","kr","RD$","\u062F\u062C","kr","Nfk","Br","\u039E","\u20AC","\u20BE","\u20B5","GH\u20B5","D","FG","Q","L","kn","G","Ft","Rp","\u20AA","\u20B9","\u0639.\u062F","\uFDFC","kr","J$","JD","\xA5","KSh","\u043B\u0432","\u17DB","CF","\u20A9","\u20A9","KD","\u043B\u0432","\u20AD","\u20A8","M","\u0141","Lt","Ls","LD","MAD","lei","Ar","\u0434\u0435\u043D","K","\u20AE","MOP$","UM","\u20A8","Rf","MK","RM","MT","\u20A6","C$","kr","\u20A8","\uFDFC","B/.","S/.","K","\u20B1","\u20A8","z\u0142","Gs","\uFDFC","\uFFE5","lei","\u0414\u0438\u043D.","\u20BD","R\u20A3","\uFDFC","\u20A8","\u062C.\u0633.","kr","\xA3","Le","S","Db","E","\u0E3F","SM","T","\u062F.\u062A","T$","\u20A4","\u20BA","TT$","NT$","TSh","\u20B4","USh","$U","\u043B\u0432","Bs","\u20AB","VT","WS$","FCFA","\u0243","CFA","\u20A3","\uFDFC","R","Z$"];function v(e){return G(e)||Ao.some(r=>G(e.replace(r,"").replace(/[,.]/g,"")))?"numeric":e.trim()?"text":"empty"}var br="7.0.29";var Io=br;function Eo(e){let r=null,a=null;if(typeof e!="string")throw new TypeError("csv-sort/csvSort(): [THROW_ID_01] The input is of a wrong type! We accept either string of array of arrays. We got instead: ".concat(typeof e,", equal to:\n").concat(JSON.stringify(e,null,4)));if(!e.trim())return{res:[[""]],msgContent:r,msgType:a};let o=yr(e),f=[],t=!1,n=!0,u=[],s=null;for(let c=o.length-1;c>=0;c--)if(f.length){c===0&&(t=o[c].every(h=>v(h)==="text"||v(h)==="empty")),!t&&f.length!==o[c].length&&(n=!1);let d=null;for(let h=0,$=o[c].length;h<$;h++)if(d===null&&v(o[c][h].trim())==="empty"&&(d=h),d!==null&&v(o[c][h].trim())!=="empty"&&(d=null),v(o[c][h].trim())!==f[h]&&!t){let b=v(o[c][h].trim());if(Array.isArray(f[h]))f[h].includes(b)||f[h].push(v(o[c][h].trim()));else if(f[h]!==b){let w=f[h];f[h]=[],f[h].push(w),f[h].push(b)}}s!==null&&d!==null&&d>s&&(!t||t&&c!==0)&&(s=d)}else if(o[c].length!==1||o[c][0]!=="")for(let d=0,h=o[c].length;d<h;d++)f.push(v(o[c][d].trim())),s===null&&v(o[c][d].trim())==="empty"&&(s=d),s!==null&&v(o[c][d].trim())!=="empty"&&(s=null);s||(s=f.length);let l=0;for(let c=0,d=f.length;c<d&&f[c]==="empty";c++)l=c;l!==0&&(o=o.map(c=>c.slice(l+1,s)),f=f.slice(l+1,s));let i=[],p;f.forEach((c,d)=>{c==="numeric"&&i.push(d)});let m=t?1:0;if(i.length===1)p=i[0];else{if(i.length===0)throw new Error('csv-sort/csvSort(): [THROW_ID_03] Your CSV file does not contain numeric-only columns and computer was not able to detect the "Balance" column!');{let c=Array.from(i),d=[];for(let h=0,$=c.length;h<$;h++){let b=c[h],w,O=!0,N,A=!0;for(let S=m,wr=o.length;S<wr&&(O&&(w==null?w=o[S][b]:w===o[S][b]?(d.push(b),O=!1):w=o[S][b]),A&&(N==null?N=o[S][b]:o[S][b]!==N&&(A=!1)),!!O);S++);A&&u.push(b)}if(c=K(c,...d),c.length===1)p=c[0];else if(c.length===0)throw new Error('csv-sort/csvSort(): [THROW_ID_04] The computer can\'t find the "Balance" column! It saw some numeric-only columns, but they all seem to have certain rows with the same values as rows right below/above them!')}}if(!p)throw new Error("csv-sort/csvSort(): [THROW_ID_05] Sadly computer couldn't find its way in this CSV and had to stop working on it.");let g=K(Array.from(f.reduce((c,d,h)=>((typeof d=="string"&&d==="numeric"||Array.isArray(d)&&d.includes("numeric"))&&c.push(h),c),[])),p,...u),y=[];y.push(o[o.length-1].slice(0,s));let T=[],_=t?1:0;for(let c=o.length-2;c>=_;c--)for(let d=o.length-2;d>=_;d--)if(!T.includes(d)){let h=!1;for(let $=0,b=g.length;$<b;$++){let w=null;o[d][g[$]]!==""&&(w=(0,F.default)(o[d][g[$]]));let O=null;o[d][p]!==""&&(O=(0,F.default)(o[d][p]));let N=null;y[0][p]!==""&&(N=(0,F.default)(y[0][p]).format());let A=null;y[y.length-1][g[$]]!==""&&(A=(0,F.default)(y[y.length-1][g[$]]).format());let S=null;if(y[y.length-1][p]!==""&&(S=(0,F.default)(y[y.length-1][p])),w&&O.add(w).format()===N){y.unshift(o[d].slice(0,s)),T.push(d),h=!0;break}else if(w&&O.subtract(w).format()===N){y.unshift(o[d].slice(0,s)),T.push(d),h=!0;break}else if(A&&S.add(A).format()===O.format()){y.push(o[d].slice(0,s)),T.push(d),h=!0;break}else if(A&&S.subtract(A).format()===O.format()){y.push(o[d].slice(0,s)),T.push(d),h=!0;break}}if(h){h=!1;break}}return t&&(n&&o[0].length>f.length&&(o[0].length=f.length),y.unshift(o[0].slice(0,s))),o.length-(t?2:1)!==T.length&&(r="Not all rows were recognised!",a="alert"),{res:y,msgContent:r,msgType:a}}return Rr(No);})();
10
+ "use strict";var csvSort=(()=>{var vr=Object.create;var V=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var Sr=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,$r=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable;var Q=(e,r,a)=>r in e?V(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,x=(e,r)=>{for(var a in r||(r={}))le.call(r,a)&&Q(e,a,r[a]);if(ne)for(var a of ne(r))Or.call(r,a)&&Q(e,a,r[a]);return e};var fe=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Ar=(e,r)=>{for(var a in r)V(e,a,{get:r[a],enumerable:!0})},ie=(e,r,a,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let f of Sr(r))!le.call(e,f)&&f!==a&&V(e,f,{get:()=>r[f],enumerable:!(o=Tr(r,f))||o.enumerable});return e};var ue=(e,r,a)=>(a=e!=null?vr($r(e)):{},ie(r||!e||!e.__esModule?V(a,"default",{value:e,enumerable:!0}):a,e)),Rr=e=>ie(V({},"__esModule",{value:!0}),e);var Z=(e,r,a)=>Q(e,typeof r!="symbol"?r+"":r,a);var dr=fe((qs,mr)=>{"use strict";mr.exports=wo;function C(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function wo(e){if(e=e||{},e.circles)return vo(e);let r=new Map;if(r.set(Date,n=>new Date(n)),r.set(Map,(n,u)=>new Map(o(Array.from(n),u))),r.set(Set,(n,u)=>new Set(o(Array.from(n),u))),e.constructorHandlers)for(let n of e.constructorHandlers)r.set(n[0],n[1]);let a=null;return e.proto?t:f;function o(n,u){let s=Object.keys(n),l=new Array(s.length);for(let i=0;i<s.length;i++){let p=s[i],m=n[p];typeof m!="object"||m===null?l[p]=m:m.constructor!==Object&&(a=r.get(m.constructor))?l[p]=a(m,u):ArrayBuffer.isView(m)?l[p]=C(m):l[p]=u(m)}return l}function f(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return o(n,f);if(n.constructor!==Object&&(a=r.get(n.constructor)))return a(n,f);let u={};for(let s in n){if(Object.hasOwnProperty.call(n,s)===!1)continue;let l=n[s];typeof l!="object"||l===null?u[s]=l:l.constructor!==Object&&(a=r.get(l.constructor))?u[s]=a(l,f):ArrayBuffer.isView(l)?u[s]=C(l):u[s]=f(l)}return u}function t(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return o(n,t);if(n.constructor!==Object&&(a=r.get(n.constructor)))return a(n,t);let u={};for(let s in n){let l=n[s];typeof l!="object"||l===null?u[s]=l:l.constructor!==Object&&(a=r.get(l.constructor))?u[s]=a(l,t):ArrayBuffer.isView(l)?u[s]=C(l):u[s]=t(l)}return u}}function vo(e){let r=[],a=[],o=new Map;if(o.set(Date,s=>new Date(s)),o.set(Map,(s,l)=>new Map(t(Array.from(s),l))),o.set(Set,(s,l)=>new Set(t(Array.from(s),l))),e.constructorHandlers)for(let s of e.constructorHandlers)o.set(s[0],s[1]);let f=null;return e.proto?u:n;function t(s,l){let i=Object.keys(s),p=new Array(i.length);for(let m=0;m<i.length;m++){let g=i[m],y=s[g];if(typeof y!="object"||y===null)p[g]=y;else if(y.constructor!==Object&&(f=o.get(y.constructor)))p[g]=f(y,l);else if(ArrayBuffer.isView(y))p[g]=C(y);else{let T=r.indexOf(y);T!==-1?p[g]=a[T]:p[g]=l(y)}}return p}function n(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return t(s,n);if(s.constructor!==Object&&(f=o.get(s.constructor)))return f(s,n);let l={};r.push(s),a.push(l);for(let i in s){if(Object.hasOwnProperty.call(s,i)===!1)continue;let p=s[i];if(typeof p!="object"||p===null)l[i]=p;else if(p.constructor!==Object&&(f=o.get(p.constructor)))l[i]=f(p,n);else if(ArrayBuffer.isView(p))l[i]=C(p);else{let m=r.indexOf(p);m!==-1?l[i]=a[m]:l[i]=n(p)}}return r.pop(),a.pop(),l}function u(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return t(s,u);if(s.constructor!==Object&&(f=o.get(s.constructor)))return f(s,u);let l={};r.push(s),a.push(l);for(let i in s){let p=s[i];if(typeof p!="object"||p===null)l[i]=p;else if(p.constructor!==Object&&(f=o.get(p.constructor)))l[i]=f(p,u);else if(ArrayBuffer.isView(p))l[i]=C(p);else{let m=r.indexOf(p);m!==-1?l[i]=a[m]:l[i]=u(p)}}return r.pop(),a.pop(),l}}});var xr=fe((ae,se)=>{(function(e,r){typeof ae=="object"&&typeof se<"u"?se.exports=r():typeof define=="function"&&define.amd?define(r):(e=e||self,e.currency=r())})(ae,function(){function e(t,n){if(!(this instanceof e))return new e(t,n);n=Object.assign({},a,n);var u=Math.pow(10,n.precision);this.intValue=t=r(t,n),this.value=t/u,n.increment=n.increment||1/u,n.groups=n.useVedic?f:o,this.s=n,this.p=u}function r(t,n){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0,s=n.decimal,l=n.errorOnInvalid,i=n.fromCents,p=Math.pow(10,n.precision),m=t instanceof e;if(m&&i)return t.intValue;if(typeof t=="number"||m)s=m?t.value:t;else if(typeof t=="string")l=new RegExp("[^-\\d"+s+"]","g"),s=new RegExp("\\"+s,"g"),s=(s=t.replace(/\((.*)\)/,"-$1").replace(l,"").replace(s,"."))||0;else{if(l)throw Error("Invalid Input");s=0}return i||(s=(s*p).toFixed(4)),u?Math.round(s):s}var a={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:function(t,n){var u=n.pattern,s=n.negativePattern,l=n.symbol,i=n.separator,p=n.decimal;n=n.groups;var m=(""+t).replace(/^-/,"").split("."),g=m[0];return m=m[1],(0<=t.value?u:s).replace("!",l).replace("#",g.replace(n,"$1"+i)+(m?p+m:""))},fromCents:!1},o=/(\d)(?=(\d{3})+\b)/g,f=/(\d)(?=(\d\d)+\d\b)/g;return e.prototype={add:function(t){var n=this.s,u=this.p;return e((this.intValue+r(t,n))/(n.fromCents?1:u),n)},subtract:function(t){var n=this.s,u=this.p;return e((this.intValue-r(t,n))/(n.fromCents?1:u),n)},multiply:function(t){var n=this.s;return e(this.intValue*t/(n.fromCents?1:Math.pow(10,n.precision)),n)},divide:function(t){var n=this.s;return e(this.intValue/r(t,n,!1),n)},distribute:function(t){var n=this.intValue,u=this.p,s=this.s,l=[],i=Math[0<=n?"floor":"ceil"](n/t),p=Math.abs(n-i*t);for(u=s.fromCents?1:u;t!==0;t--){var m=e(i/u,s);0<p--&&(m=m[0<=n?"add":"subtract"](1/u)),l.push(m)}return l},dollars:function(){return~~this.value},cents:function(){return~~(this.intValue%this.p)},format:function(t){var n=this.s;return typeof t=="function"?t(this,n):n.format(this,Object.assign({},n,t))},toString:function(){var t=this.s,n=t.increment;return(Math.round(this.intValue/this.p/n)*n).toFixed(t.precision)},toJSON:function(){return this.value}},e})});var No={};Ar(No,{findType:()=>v,isNumeric:()=>G,sort:()=>Eo,version:()=>Io});var Ir=typeof global=="object"&&global&&global.Object===Object&&global,pe=Ir;var Er=typeof self=="object"&&self&&self.Object===Object&&self,Nr=pe||Er||Function("return this")(),M=Nr;var Dr=M.Symbol,R=Dr;var me=Object.prototype,jr=me.hasOwnProperty,Cr=me.toString,W=R?R.toStringTag:void 0;function kr(e){var r=jr.call(e,W),a=e[W];try{e[W]=void 0;var o=!0}catch(t){}var f=Cr.call(e);return o&&(r?e[W]=a:delete e[W]),f}var de=kr;var Fr=Object.prototype,Vr=Fr.toString;function Wr(e){return Vr.call(e)}var ce=Wr;var Br="[object Null]",_r="[object Undefined]",ge=R?R.toStringTag:void 0;function Mr(e){return e==null?e===void 0?_r:Br:ge&&ge in Object(e)?de(e):ce(e)}var P=Mr;function Pr(e){return e!=null&&typeof e=="object"}var he=Pr;var Hr="[object Symbol]";function Jr(e){return typeof e=="symbol"||he(e)&&P(e)==Hr}var ye=Jr;function Lr(e,r){for(var a=-1,o=e==null?0:e.length,f=Array(o);++a<o;)f[a]=r(e[a],a,e);return f}var H=Lr;var qr=Array.isArray,xe=qr;var Ur=1/0,be=R?R.prototype:void 0,we=be?be.toString:void 0;function ve(e){if(typeof e=="string")return e;if(xe(e))return H(e,ve)+"";if(ye(e))return we?we.call(e):"";var r=e+"";return r=="0"&&1/e==-Ur?"-0":r}var J=ve;var Kr=/\s/;function zr(e){for(var r=e.length;r--&&Kr.test(e.charAt(r)););return r}var Te=zr;var Gr=/^\s+/;function Qr(e){return e&&e.slice(0,Te(e)+1).replace(Gr,"")}var Se=Qr;function Zr(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var L=Zr;function Yr(e){return e}var q=Yr;var Xr="[object AsyncFunction]",et="[object Function]",rt="[object GeneratorFunction]",tt="[object Proxy]";function ot(e){if(!L(e))return!1;var r=P(e);return r==et||r==rt||r==Xr||r==tt}var $e=ot;var at=M["__core-js_shared__"],U=at;var Oe=(function(){var e=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function st(e){return!!Oe&&Oe in e}var Ae=st;var nt=Function.prototype,lt=nt.toString;function ft(e){if(e!=null){try{return lt.call(e)}catch(r){}try{return e+""}catch(r){}}return""}var Re=ft;var it=/[\\^$.*+?()[\]{}|]/g,ut=/^\[object .+?Constructor\]$/,pt=Function.prototype,mt=Object.prototype,dt=pt.toString,ct=mt.hasOwnProperty,gt=RegExp("^"+dt.call(ct).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ht(e){if(!L(e)||Ae(e))return!1;var r=$e(e)?gt:ut;return r.test(Re(e))}var Ie=ht;function yt(e,r){return e==null?void 0:e[r]}var Ee=yt;function xt(e,r){var a=Ee(e,r);return Ie(a)?a:void 0}var Ne=xt;function bt(e,r,a){switch(a.length){case 0:return e.call(r);case 1:return e.call(r,a[0]);case 2:return e.call(r,a[0],a[1]);case 3:return e.call(r,a[0],a[1],a[2])}return e.apply(r,a)}var De=bt;function wt(e,r){var a=-1,o=e.length;for(r||(r=Array(o));++a<o;)r[a]=e[a];return r}var je=wt;var vt=800,Tt=16,St=Date.now;function $t(e){var r=0,a=0;return function(){var o=St(),f=Tt-(o-a);if(a=o,f>0){if(++r>=vt)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var Ce=$t;function Ot(e){return function(){return e}}var ke=Ot;var At=(function(){try{var e=Ne(Object,"defineProperty");return e({},"",{}),e}catch(r){}})(),Y=At;var Rt=Y?function(e,r){return Y(e,"toString",{configurable:!0,enumerable:!1,value:ke(r),writable:!0})}:q,Fe=Rt;var It=Ce(Fe),Ve=It;function Et(e,r,a,o){for(var f=e.length,t=a+(o?1:-1);o?t--:++t<f;)if(r(e[t],t,e))return t;return-1}var We=Et;function Nt(e){return e!==e}var Be=Nt;function Dt(e,r,a){for(var o=a-1,f=e.length;++o<f;)if(e[o]===r)return o;return-1}var _e=Dt;function jt(e,r,a){return r===r?_e(e,r,a):We(e,Be,a)}var D=jt;var Me=Math.max;function Ct(e,r,a){return r=Me(r===void 0?e.length-1:r,0),function(){for(var o=arguments,f=-1,t=Me(o.length-r,0),n=Array(t);++f<t;)n[f]=o[r+f];f=-1;for(var u=Array(r+1);++f<r;)u[f]=o[f];return u[r]=a(n),De(e,this,u)}}var Pe=Ct;function kt(e,r){return Ve(Pe(e,r,q),e+"")}var He=kt;function Ft(e){return function(r){return e(r)}}var Je=Ft;function Vt(e){return e==null?"":J(e)}var Le=Vt;function Wt(e,r,a){var o=-1,f=e.length;r<0&&(r=-r>f?0:f+r),a=a>f?f:a,a<0&&(a+=f),f=r>a?0:a-r>>>0,r>>>=0;for(var t=Array(f);++o<f;)t[o]=e[o+r];return t}var qe=Wt;function Bt(e,r,a){var o=e.length;return a=a===void 0?o:a,!r&&a>=o?e:qe(e,r,a)}var Ue=Bt;var _t="\\ud800-\\udfff",Mt="\\u0300-\\u036f",Pt="\\ufe20-\\ufe2f",Ht="\\u20d0-\\u20ff",Jt=Mt+Pt+Ht,Lt="\\ufe0e\\ufe0f",qt="\\u200d",Ut=RegExp("["+qt+_t+Jt+Lt+"]");function Kt(e){return Ut.test(e)}var Ke=Kt;function zt(e){return e.split("")}var ze=zt;var Ge="\\ud800-\\udfff",Gt="\\u0300-\\u036f",Qt="\\ufe20-\\ufe2f",Zt="\\u20d0-\\u20ff",Yt=Gt+Qt+Zt,Xt="\\ufe0e\\ufe0f",eo="["+Ge+"]",X="["+Yt+"]",ee="\\ud83c[\\udffb-\\udfff]",ro="(?:"+X+"|"+ee+")",Qe="[^"+Ge+"]",Ze="(?:\\ud83c[\\udde6-\\uddff]){2}",Ye="[\\ud800-\\udbff][\\udc00-\\udfff]",to="\\u200d",Xe=ro+"?",er="["+Xt+"]?",oo="(?:"+to+"(?:"+[Qe,Ze,Ye].join("|")+")"+er+Xe+")*",ao=er+Xe+oo,so="(?:"+[Qe+X+"?",X,Ze,Ye,eo].join("|")+")",no=RegExp(ee+"(?="+ee+")|"+so+ao,"g");function lo(e){return e.match(no)||[]}var rr=lo;function fo(e){return Ke(e)?rr(e):ze(e)}var re=fo;function io(e,r,a,o){for(var f=a-1,t=e.length;++f<t;)if(o(e[f],r))return f;return-1}var tr=io;var uo=Array.prototype,or=uo.splice;function po(e,r,a,o){var f=o?tr:D,t=-1,n=r.length,u=e;for(e===r&&(r=je(r)),a&&(u=H(e,Je(a)));++t<n;)for(var s=0,l=r[t],i=a?a(l):l;(s=f(u,i,s,o))>-1;)u!==e&&or.call(u,s,1),or.call(e,s,1);return e}var ar=po;function mo(e,r){return e&&e.length&&r&&r.length?ar(e,r):e}var sr=mo;var co=He(sr),K=co;function go(e,r){for(var a=e.length;a--&&D(r,e[a],0)>-1;);return a}var nr=go;function ho(e,r){for(var a=-1,o=e.length;++a<o&&D(r,e[a],0)>-1;);return a}var lr=ho;function yo(e,r,a){if(e=Le(e),e&&(a||r===void 0))return Se(e);if(!e||!(r=J(r)))return e;var o=re(e),f=re(r),t=lr(o,f),n=nr(o,f)+1;return Ue(o,t,n).join("")}var te=yo;var xo={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function j(e,r){if(!Array.isArray(e)||!e.length)return e;let a=x(x({},xo),r),o,f;if(a.strictlyTwoElementsInRangeArrays&&!e.every((u,s)=>!Array.isArray(u)||u.length!==2?(o=s,f=u.length,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(o,"th range (").concat(JSON.stringify(e[o],null,4),") has not two but ").concat(f," elements!"));if(!e.every((u,s)=>!Array.isArray(u)||!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0?(o=s,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(o,"th range (").concat(JSON.stringify(e[o],null,4),") does not consist of only natural numbers!"));let t=e.length**2,n=0;return Array.from(e).sort((u,s)=>(a.progressFn&&(n+=1,a.progressFn(Math.floor(n*100/t))),u[0]===s[0]?u[1]<s[1]?-1:u[1]>s[1]?1:0:u[0]<s[0]?-1:1))}var fr={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ir(e,r){function a(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}if(!Array.isArray(e)||!e.length)return null;let o;if(r)if(a(r)){if(o=x(x({},fr),r),o.progressFn&&a(o.progressFn)&&!Object.keys(o.progressFn).length)o.progressFn=null;else if(o.progressFn&&typeof o.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "'.concat(typeof o.progressFn,'", equal to ').concat(JSON.stringify(o.progressFn,null,4)));if(![1,2,"1","2"].includes(o.mergeType))throw new Error('ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof o.mergeType,'", equal to ').concat(JSON.stringify(o.mergeType,null,4)));if(typeof o.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof o.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(o.joinRangesThatTouchEdges,null,4)))}else throw new Error("emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(r,null,4)," (type ").concat(typeof r,")"));else o=x({},fr);let f=e.filter(l=>Array.isArray(l)).map(l=>[...l]).filter(l=>l[2]!==void 0||l[0]!==l[1]),t,n,u;o.progressFn?t=j(f,{progressFn:l=>{u=Math.floor(l/5),u!==n&&(n=u,o.progressFn(u))}}):t=j(f);let s=t.length-1;for(let l=s;l>0;l--)o.progressFn&&(u=Math.floor((1-l/s)*78)+21,u!==n&&u>n&&(n=u,o.progressFn(u))),(t[l][0]<=t[l-1][0]||!o.joinRangesThatTouchEdges&&t[l][0]<t[l-1][1]||o.joinRangesThatTouchEdges&&t[l][0]<=t[l-1][1])&&(t[l-1][0]=Math.min(t[l][0],t[l-1][0]),t[l-1][1]=Math.max(t[l][1],t[l-1][1]),t[l][2]!==void 0&&(t[l-1][0]>=t[l][0]||t[l-1][1]<=t[l][1])&&t[l-1][2]!==null&&(t[l][2]===null&&t[l-1][2]!==null?t[l-1][2]=null:t[l-1][2]!=null?+o.mergeType==2&&t[l-1][0]===t[l][0]?t[l-1][2]=t[l][2]:t[l-1][2]+=t[l][2]:t[l-1][2]=t[l][2]),t.splice(l,1),l=t.length);return t.length?t:null}var bo=!0,oe="Invariant failed";function ur(e,r){if(!e){if(bo)throw new Error(oe);var a=typeof r=="function"?r():r,o=a?"".concat(oe,": ").concat(a):oe;throw new Error(o)}}function pr(e,r,a){let o=0,f=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(JSON.stringify(e,null,4)));if(r&&!Array.isArray(r))throw new TypeError("ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof r,", equal to: ").concat(JSON.stringify(r,null,4)));if(a&&typeof a!="function")throw new TypeError("ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ".concat(typeof a,", equal to: ").concat(JSON.stringify(a,null,4)));if(!(r!=null&&r.filter(i=>i).length))return e;let t;Array.isArray(r)&&Number.isInteger(r[0])&&Number.isInteger(r[1])?t=[Array.from(r)]:t=Array.from(r);let n=t.length,u=0;t.filter(i=>i).forEach((i,p)=>{if(a&&(o=Math.floor(u/n*10),o!==f&&(f=o,a(o))),!Array.isArray(i))throw new TypeError("ranges-apply: [THROW_ID_05] ranges array, second input arg., has ".concat(p,"th element not an array: ").concat(JSON.stringify(i,null,4),", which is ").concat(typeof i));if(!Number.isInteger(i[0])){if(!Number.isInteger(+i[0])||+i[0]<0)throw new TypeError("ranges-apply: [THROW_ID_06] ranges array, second input arg. has ".concat(p,"th element, array ").concat(JSON.stringify(i,null,0),". Its first element is not an integer, string index, but ").concat(typeof i[0],", equal to: ").concat(JSON.stringify(i[0],null,4),"."));t[p][0]=+t[p][0]}if(!Number.isInteger(i[1])){if(!Number.isInteger(+i[1])||+i[1]<0)throw new TypeError("ranges-apply: [THROW_ID_07] ranges array, second input arg. has ".concat(p,"th element, array ").concat(JSON.stringify(i,null,0),". Its second element is not an integer, string index, but ").concat(typeof i[1],", equal to: ").concat(JSON.stringify(i[1],null,4),"."));t[p][1]=+t[p][1]}u+=1});let s=ir(t,{progressFn:i=>{a&&(o=10+Math.floor(i/10),o!==f&&(f=o,a(o)))}});ur(s);let l=s.length;if(l>0){let i=e.slice(s[l-1][1]);e=s.reduce((p,m,g,y)=>{a&&(o=20+Math.floor(g/l*80),o!==f&&(f=o,a(o)));let T=g===0?0:y[g-1][1],_=y[g][0];return"".concat(p).concat(e.slice(T,_)).concat(y[g][2]||"")},""),e+=i}return e}function z(e,r=1){let a="\xA0";function o(t){return Array.from(t).reverse().join("")}function f(t,n,u){let s=u?"\n":"\r",l=u?"\r":"\n";if(!t)return t;let i=0,p=0,m="";for(let g=0,y=t.length;g<y;g++)(t[g]===s||t[g]===l&&t[g-1]!==s)&&p++,"\r\n".includes(t[g])||t[g]===a?(i=0,t[g]===a?m+=t[g]:t[g]===s?p<=n&&(m+=t[g],t[g+1]===l&&(m+=t[g+1],g++)):t[g]===l&&(t==null?void 0:t[g-1])!==s&&p<=n&&(m+=t[g])):(i++,!t[g+1]&&!p&&(m+=" "));return m}if(typeof e=="string"&&e.length){let t=1;typeof+r=="number"&&Number.isInteger(+r)&&+r>=0&&(t=+r);let n="",u="";if(!e.trim())n=e;else if(!e[0].trim()){for(let s=0,l=e.length;s<l;s++)if(e[s].trim()){n=e.slice(0,s);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===a)){for(let s=e.length;s--;)if(e[s].trim()){u=e.slice(s+1);break}}return"".concat(f(n,t,!1)).concat(e.trim()).concat(o(f(o(u),t,!0)))}return e}var cr=ue(dr(),1);var Us=(0,cr.default)();function k(e){return typeof e=="string"}function I(e){return Number.isSafeInteger(e)&&e>=0}function E(e){return e!=null}var gr={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function To(e,r){var l;function a(i){return!!i&&typeof i=="object"&&!Array.isArray(i)}if(!Array.isArray(e)||!e.length)return null;let o;if(r)if(a(r)){if(o=x(x({},gr),r),o.progressFn&&a(o.progressFn)&&!Object.keys(o.progressFn).length)o.progressFn=null;else if(o.progressFn&&typeof o.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof o.progressFn,'", equal to ').concat(JSON.stringify(o.progressFn,null,4)));if(![1,2,"1","2"].includes(o.mergeType))throw new Error('ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof o.mergeType,'", equal to ').concat(JSON.stringify(o.mergeType,null,4)));if(typeof o.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof o.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(o.joinRangesThatTouchEdges,null,4)))}else throw new Error("ranges-merge: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(r,null,4)," (type ").concat(typeof r,")"));else o=x({},gr);let f=e.filter(i=>Array.isArray(i)).map(i=>[...i]).filter(i=>i[2]!==void 0||i[0]!==i[1]),t,n,u;o.progressFn?t=j(f,{progressFn:i=>{u=Math.floor(i/5),u!==n&&(n=u,o.progressFn!=null&&o.progressFn(u))}}):t=j(f);let s=t.length-1;for(let i=s;i>0;i--)o.progressFn&&(u=Math.floor((1-i/s)*78)+21,u!==n&&u>n&&(n=u,o.progressFn(u))),(t[i][0]<=t[i-1][0]||!o.joinRangesThatTouchEdges&&t[i][0]<t[i-1][1]||o.joinRangesThatTouchEdges&&t[i][0]<=t[i-1][1])&&(t[i-1][0]=Math.min(t[i][0],t[i-1][0]),t[i-1][1]=Math.max(t[i][1],t[i-1][1]),t[i][2]!==void 0&&(t[i-1][0]>=t[i][0]||t[i-1][1]<=t[i][1])&&t[i-1][2]!==null&&(t[i][2]===null&&t[i-1][2]!==null?t[i-1][2]=null:t[i-1][2]!=null?+((l=o||{})==null?void 0:l.mergeType)==2&&t[i-1][0]===t[i][0]?t[i-1][2]=t[i][2]:t[i-1][2]+=t[i][2]:t[i-1][2]=t[i][2]),t.splice(i,1),i=t.length);return t.length?t:null}var So={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},hr=class{constructor(e){Z(this,"ranges");Z(this,"opts");let r=x(x({},So),e);if(r.mergeType&&r.mergeType!==1&&r.mergeType!==2)if(k(r.mergeType)&&r.mergeType.trim()==="1")r.mergeType=1;else if(k(r.mergeType)&&r.mergeType.trim()==="2")r.mergeType=2;else throw new Error('ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(JSON.stringify(r.mergeType,null,4)));this.opts=r,this.ranges=[]}add(e,r,a){var t;if(e==null&&r==null)return;if(E(e)&&!E(r)){if(Array.isArray(e)){if(e.length){if(e.some(n=>Array.isArray(n))){e.forEach(n=>{Array.isArray(n)&&this.add(...n)});return}e.length&&I(+e[0])&&I(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set ('.concat(JSON.stringify(e,null,0),') but second-one, "to" is not (').concat(JSON.stringify(r,null,0),")"))}else if(!E(e)&&E(r))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set ('.concat(JSON.stringify(r,null,0),') but first-one, "from" is not (').concat(JSON.stringify(e,null,0),")"));let o=+e,f=+r;if(I(a)&&(a=String(a)),I(o)&&I(f)){if(E(a)&&!k(a)&&!I(a))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ".concat(typeof a,", equal to:\n").concat(JSON.stringify(a,null,4)));if(E(this.ranges)&&Array.isArray(this.last())&&o===this.last()[1]){if(this.last()[1]=f,this.last()[2],this.last()[2]!==null&&E(a)){let n=this.last()[2]&&this.last()[2].length&&(!((t=this.opts)!=null&&t.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(a):a;this.opts.limitToBeAddedWhitespace&&(n=z(n,this.opts.limitLinebreaksCount)),k(n)&&!n.length||(this.last()[2]=n)}}else{this.ranges||(this.ranges=[]);let n=a!==void 0&&!(k(a)&&!a.length)?[o,f,a&&this.opts.limitToBeAddedWhitespace?z(a,this.opts.limitLinebreaksCount):a]:[o,f];this.ranges.push(n)}}else throw I(o)&&o>=0?new TypeError('ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof f,'" equal to: ').concat(JSON.stringify(f,null,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof o,'" equal to: ').concat(JSON.stringify(o,null,4)))}push(e,r,a){this.add(e,r,a)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=To(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>E(e[2])?[e[0],e[1],z(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&I(e[0][0]))this.ranges=Array.from(e);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ".concat(JSON.stringify(e[0],null,4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var $o={removeThousandSeparatorsFromNumbers:!0,padSingleDecimalPlaceNumbers:!0,forceUKStyle:!1};function B(e,r){let a=!0,o=[".",",","'"," "],f;if(typeof e!="string")throw new TypeError("string-remove-thousand-separators/remSep(): [THROW_ID_01] Input must be string! Currently it's: ".concat(typeof e,", equal to:\n").concat(JSON.stringify(e,null,4)));if(r&&typeof r!="object")throw new TypeError("string-remove-thousand-separators/remSep(): [THROW_ID_02] Options object must be a plain object! Currently it's: ".concat(typeof r,", equal to:\n").concat(JSON.stringify(r,null,4)));let t=x(x({},$o),r),n=te(e.trim(),'"');if(n==="")return n;if(+e>0&&+e<1)return e;let u=new hr;for(let s=0,l=n.length;s<l;s++){if(t.removeThousandSeparatorsFromNumbers&&n[s].trim()===""&&u.add(s,s+1),t.removeThousandSeparatorsFromNumbers&&n[s]==="'"&&(u.add(s,s+1),n[s+1]==="'")){a=!1;break}if(o.includes(n[s])){if(n[s+1]!==void 0&&/^\d$/.test(n[s+1]))if(n[s+2]!==void 0)if(/^\d$/.test(n[s+2]))if(n[s+3]!==void 0)if(/^\d$/.test(n[s+3])){if(n[s+4]!==void 0&&/^\d$/.test(n[s+4])){a=!1;break}else if(t.removeThousandSeparatorsFromNumbers&&u.add(s,s+1),!f)f=n[s];else if(n[s]!==f){a=!1;break}}else{a=!1;break}else t.removeThousandSeparatorsFromNumbers&&t.forceUKStyle&&n[s]===","&&u.add(s,s+1,".");else{a=!1;break}else t.forceUKStyle&&n[s]===","&&u.add(s,s+1,"."),t.padSingleDecimalPlaceNumbers&&u.add(s+2,s+2,"0")}else if(!/^\d$/.test(n[s])){a=!1;break}}return a&&u.current()?pr(n,u.current()):n}var Oo={removeThousandSeparatorsFromNumbers:!0,padSingleDecimalPlaceNumbers:!0,forceUKStyle:!1};function yr(e,r){let a=0,o=0,f=[],t=[],n=!1,u=!0;if(r&&typeof r!="object")throw new Error("csv-split-easy/split(): [THROW_ID_02] Options object must be a plain object! Currently it's of a type ".concat(typeof r," equal to:\n").concat(JSON.stringify(r,null,4)));let s=x(x({},Oo),r);if(typeof e!="string")throw new TypeError("csv-split-easy/split(): [THROW_ID_04] input must be string! Currently it's: ".concat(typeof e,", equal to: ").concat(JSON.stringify(e,null,4)));if(e==="")return[[""]];e=e.trim();for(let l=0,i=e.length;l<i;l++){if(u&&e[l]!=='"'&&e[l]!==","&&e[l].trim()!==""&&(u=!1),e[l]==='"')if(n&&e[l+1]==='"')l+=1;else if(n){n=!1;let p=e.slice(a,l);p.trim()!==""&&(u=!1);let m=/""/.test(p)?p.replace(/""/g,'"'):B(p,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle});f.push(m)}else n=!0,a=l+1;else if(!n&&e[l]===","){if(e[l-1]!=='"'&&!n){let p=e.slice(a,l);p.trim()!==""&&(u=!1),f.push(B(p,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle}))}a=l+1,o&&(o=0)}else if(e[l]==="\n"||e[l]==="\r"){if(!o){if(o=l,!n&&e[l-1]!=='"'){let p=e.slice(a,l);p.trim()!==""&&(u=!1),f.push(B(p,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle}))}u?f.length=0:t.push(f),u=!0,f=[]}a=l+1}else o&&(o=0,a=l);if(l+1===i){if(e[l]!=='"'){let p=e.slice(a,l+1);p.trim()&&(u=!1),f.push(B(p,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle}))}u?f=[]:t.push(f),u=!0}}return t.length===0?[[""]]:t}var F=ue(xr(),1);function G(e){return typeof e=="number"&&!isNaN(e)?!0:(e=(e||"").toString().trim(),e?!isNaN(+e):!1)}var Ao=["\u062F.\u0625","\u060B","L","\u058F","\u0192","Kz","$","\u0192","\u20BC","KM","\u09F3","\u043B\u0432",".\u062F.\u0628","FBu","$b","R$","\u0E3F","Nu.","P","p.","BZ$","FC","CHF","\xA5","\u20A1","\u20B1","K\u010D","Fdj","kr","RD$","\u062F\u062C","kr","Nfk","Br","\u039E","\u20AC","\u20BE","\u20B5","GH\u20B5","D","FG","Q","L","kn","G","Ft","Rp","\u20AA","\u20B9","\u0639.\u062F","\uFDFC","kr","J$","JD","\xA5","KSh","\u043B\u0432","\u17DB","CF","\u20A9","\u20A9","KD","\u043B\u0432","\u20AD","\u20A8","M","\u0141","Lt","Ls","LD","MAD","lei","Ar","\u0434\u0435\u043D","K","\u20AE","MOP$","UM","\u20A8","Rf","MK","RM","MT","\u20A6","C$","kr","\u20A8","\uFDFC","B/.","S/.","K","\u20B1","\u20A8","z\u0142","Gs","\uFDFC","\uFFE5","lei","\u0414\u0438\u043D.","\u20BD","R\u20A3","\uFDFC","\u20A8","\u062C.\u0633.","kr","\xA3","Le","S","Db","E","\u0E3F","SM","T","\u062F.\u062A","T$","\u20A4","\u20BA","TT$","NT$","TSh","\u20B4","USh","$U","\u043B\u0432","Bs","\u20AB","VT","WS$","FCFA","\u0243","CFA","\u20A3","\uFDFC","R","Z$"];function v(e){return G(e)||Ao.some(r=>G(e.replace(r,"").replace(/[,.]/g,"")))?"numeric":e.trim()?"text":"empty"}var br="7.0.31";var Io=br;function Eo(e){let r=null,a=null;if(typeof e!="string")throw new TypeError("csv-sort/csvSort(): [THROW_ID_01] The input is of a wrong type! We accept either string of array of arrays. We got instead: ".concat(typeof e,", equal to:\n").concat(JSON.stringify(e,null,4)));if(!e.trim())return{res:[[""]],msgContent:r,msgType:a};let o=yr(e),f=[],t=!1,n=!0,u=[],s=null;for(let c=o.length-1;c>=0;c--)if(f.length){c===0&&(t=o[c].every(h=>v(h)==="text"||v(h)==="empty")),!t&&f.length!==o[c].length&&(n=!1);let d=null;for(let h=0,$=o[c].length;h<$;h++)if(d===null&&v(o[c][h].trim())==="empty"&&(d=h),d!==null&&v(o[c][h].trim())!=="empty"&&(d=null),v(o[c][h].trim())!==f[h]&&!t){let b=v(o[c][h].trim());if(Array.isArray(f[h]))f[h].includes(b)||f[h].push(v(o[c][h].trim()));else if(f[h]!==b){let w=f[h];f[h]=[],f[h].push(w),f[h].push(b)}}s!==null&&d!==null&&d>s&&(!t||t&&c!==0)&&(s=d)}else if(o[c].length!==1||o[c][0]!=="")for(let d=0,h=o[c].length;d<h;d++)f.push(v(o[c][d].trim())),s===null&&v(o[c][d].trim())==="empty"&&(s=d),s!==null&&v(o[c][d].trim())!=="empty"&&(s=null);s||(s=f.length);let l=0;for(let c=0,d=f.length;c<d&&f[c]==="empty";c++)l=c;l!==0&&(o=o.map(c=>c.slice(l+1,s)),f=f.slice(l+1,s));let i=[],p;f.forEach((c,d)=>{c==="numeric"&&i.push(d)});let m=t?1:0;if(i.length===1)p=i[0];else{if(i.length===0)throw new Error('csv-sort/csvSort(): [THROW_ID_03] Your CSV file does not contain numeric-only columns and computer was not able to detect the "Balance" column!');{let c=Array.from(i),d=[];for(let h=0,$=c.length;h<$;h++){let b=c[h],w,O=!0,N,A=!0;for(let S=m,wr=o.length;S<wr&&(O&&(w==null?w=o[S][b]:w===o[S][b]?(d.push(b),O=!1):w=o[S][b]),A&&(N==null?N=o[S][b]:o[S][b]!==N&&(A=!1)),!!O);S++);A&&u.push(b)}if(c=K(c,...d),c.length===1)p=c[0];else if(c.length===0)throw new Error('csv-sort/csvSort(): [THROW_ID_04] The computer can\'t find the "Balance" column! It saw some numeric-only columns, but they all seem to have certain rows with the same values as rows right below/above them!')}}if(!p)throw new Error("csv-sort/csvSort(): [THROW_ID_05] Sadly computer couldn't find its way in this CSV and had to stop working on it.");let g=K(Array.from(f.reduce((c,d,h)=>((typeof d=="string"&&d==="numeric"||Array.isArray(d)&&d.includes("numeric"))&&c.push(h),c),[])),p,...u),y=[];y.push(o[o.length-1].slice(0,s));let T=[],_=t?1:0;for(let c=o.length-2;c>=_;c--)for(let d=o.length-2;d>=_;d--)if(!T.includes(d)){let h=!1;for(let $=0,b=g.length;$<b;$++){let w=null;o[d][g[$]]!==""&&(w=(0,F.default)(o[d][g[$]]));let O=null;o[d][p]!==""&&(O=(0,F.default)(o[d][p]));let N=null;y[0][p]!==""&&(N=(0,F.default)(y[0][p]).format());let A=null;y[y.length-1][g[$]]!==""&&(A=(0,F.default)(y[y.length-1][g[$]]).format());let S=null;if(y[y.length-1][p]!==""&&(S=(0,F.default)(y[y.length-1][p])),w&&O.add(w).format()===N){y.unshift(o[d].slice(0,s)),T.push(d),h=!0;break}else if(w&&O.subtract(w).format()===N){y.unshift(o[d].slice(0,s)),T.push(d),h=!0;break}else if(A&&S.add(A).format()===O.format()){y.push(o[d].slice(0,s)),T.push(d),h=!0;break}else if(A&&S.subtract(A).format()===O.format()){y.push(o[d].slice(0,s)),T.push(d),h=!0;break}}if(h){h=!1;break}}return t&&(n&&o[0].length>f.length&&(o[0].length=f.length),y.unshift(o[0].slice(0,s))),o.length-(t?2:1)!==T.length&&(r="Not all rows were recognised!",a="alert"),{res:y,msgContent:r,msgType:a}}return Rr(No);})();
11
11
  /**
12
12
  * @name ranges-sort
13
13
  * @fileoverview Sort string index ranges
14
- * @version 6.0.23
15
- * @author Roy Revelt, Codsen Ltd
14
+ * @version 6.0.25
15
+ * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/ranges-sort/}
18
18
  */
19
19
  /**
20
20
  * @name ranges-merge
21
21
  * @fileoverview Merge and sort string index ranges
22
- * @version 9.0.28
23
- * @author Roy Revelt, Codsen Ltd
22
+ * @version 9.0.30
23
+ * @author Roy Revelt
24
24
  * @license MIT
25
25
  * {@link https://codsen.com/os/ranges-merge/}
26
26
  */
27
27
  /**
28
28
  * @name ranges-apply
29
29
  * @fileoverview Take an array of string index ranges, delete/replace the string according to them
30
- * @version 7.0.29
31
- * @author Roy Revelt, Codsen Ltd
30
+ * @version 7.0.31
31
+ * @author Roy Revelt
32
32
  * @license MIT
33
33
  * {@link https://codsen.com/os/ranges-apply/}
34
34
  */
35
35
  /**
36
36
  * @name string-collapse-leading-whitespace
37
37
  * @fileoverview Collapse the leading and trailing whitespace of a string
38
- * @version 7.0.18
39
- * @author Roy Revelt, Codsen Ltd
38
+ * @version 7.0.20
39
+ * @author Roy Revelt
40
40
  * @license MIT
41
41
  * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
42
42
  */
43
43
  /**
44
44
  * @name codsen-utils
45
45
  * @fileoverview Various utility functions
46
- * @version 1.6.17
47
- * @author Roy Revelt, Codsen Ltd
46
+ * @version 1.6.19
47
+ * @author Roy Revelt
48
48
  * @license MIT
49
49
  * {@link https://codsen.com/os/codsen-utils/}
50
50
  */
51
51
  /**
52
52
  * @name ranges-push
53
53
  * @fileoverview Gather string index ranges
54
- * @version 7.0.28
55
- * @author Roy Revelt, Codsen Ltd
54
+ * @version 7.0.30
55
+ * @author Roy Revelt
56
56
  * @license MIT
57
57
  * {@link https://codsen.com/os/ranges-push/}
58
58
  */
59
59
  /**
60
60
  * @name string-remove-thousand-separators
61
61
  * @fileoverview Detects and removes thousand separators (dot/comma/quote/space) from string-type digits
62
- * @version 7.0.29
63
- * @author Roy Revelt, Codsen Ltd
62
+ * @version 7.0.31
63
+ * @author Roy Revelt
64
64
  * @license MIT
65
65
  * {@link https://codsen.com/os/string-remove-thousand-separators/}
66
66
  */
67
67
  /**
68
68
  * @name csv-split-easy
69
69
  * @fileoverview Splits the CSV string into array of arrays, each representing a row of columns
70
- * @version 7.0.29
71
- * @author Roy Revelt, Codsen Ltd
70
+ * @version 7.0.31
71
+ * @author Roy Revelt
72
72
  * @license MIT
73
73
  * {@link https://codsen.com/os/csv-split-easy/}
74
74
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "csv-sort",
3
- "version": "7.0.29",
3
+ "version": "7.0.31",
4
4
  "description": "Sort double-entry bookkeeping CSV from internet banking",
5
5
  "keywords": [
6
6
  "accountancy",
@@ -48,7 +48,7 @@
48
48
  "examples": "node '../../ops/scripts/run-examples.js'",
49
49
  "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
50
50
  "letspublish": "npm publish --provenance || :",
51
- "lint": "eslint . --fix",
51
+ "lint": "eslint . --fix --concurrency=auto --cache",
52
52
  "perf": "node perf/check.js",
53
53
  "prep": "echo 'ready'",
54
54
  "prettier": "prettier",
@@ -77,7 +77,7 @@
77
77
  },
78
78
  "dependencies": {
79
79
  "@types/lodash-es": "^4.17.12",
80
- "csv-split-easy": "^7.0.29",
80
+ "csv-split-easy": "^7.0.31",
81
81
  "currency.js": "^2.0.4",
82
82
  "lodash-es": "^4.17.21"
83
83
  },