csv-sort 7.2.1 → 7.2.2

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/CHANGELOG.md CHANGED
@@ -3,12 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.2.2 (2026-08-22)
7
+
8
+ ### Performance Improvements
9
+
10
+ - optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
11
+ - record lodash-es removal benchmarks ([0f69b6f](https://github.com/codsen/codsen/commit/0f69b6fdb8c3be04eaa02f82de107390b5263ce9))
12
+
6
13
  ## 7.2.0 (2026-08-19)
7
14
 
8
15
  ### Bug Fixes
9
16
 
10
17
  - make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
11
- - resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
18
+ - resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
12
19
  - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
13
20
  - trim production type dependencies ([426e081](https://github.com/codsen/codsen/commit/426e081f78e72bf3caecc138b339722309630dd8))
14
21
  - use strict numeric detection ([19e9489](https://github.com/codsen/codsen/commit/19e9489bacde65b986498113ab4107bf3caf9f3f))
@@ -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.2.1
4
+ * @version 7.2.2
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/csv-sort/}
8
8
  */
9
9
 
10
- import{formatDiagnosticValue as O}from"codsen-utils";import{splitEasy as j}from"csv-split-easy";import w from"currency.js";import{pull as x}from"lodash-es";var k="7.2.1";function E(a){return typeof a=="number"&&!Number.isNaN(a)?!0:(a=(a||"").toString().trim(),a?!Number.isNaN(+a):!1)}var A=["\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 R(a){return E(a)||A.some($=>E(a.replace($,"").replace(/[,.]/g,"")))?"numeric":a.trim()?"text":"empty"}var G=k;function U(a){let $=null,C=null;if(typeof a!="string")throw new TypeError(`csv-sort/sort(): [THROW_ID_01] The input is of a wrong type! We accept either string of array of arrays. We got instead: ${typeof a}, equal to:
11
- ${O(a,4)}`);if(!a.trim())return{res:[[""]],msgContent:$,msgType:C};let n=j(a),l=[],g=!1,S=!0,v=[],o=null;for(let t=n.length-1;t>=0;t--)if(l.length){t===0&&(g=n[t].every(s=>{let i=R(s);return i==="text"||i==="empty"})),!g&&l.length!==n[t].length&&(S=!1);let e=null;for(let s=0,i=n[t].length;s<i;s++){let u=R(n[t][s].trim());if(e===null&&u==="empty"&&(e=s),e!==null&&u!=="empty"&&(e=null),u!==l[s]&&!g){let c=u;if(Array.isArray(l[s]))l[s].includes(c)||l[s].push(c);else if(l[s]!==c){let f=l[s];l[s]=[],l[s].push(f),l[s].push(c)}}}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,s=n[t].length;e<s;e++){let i=R(n[t][e].trim());l.push(i),o===null&&i==="empty"&&(o=e),o!==null&&i!=="empty"&&(o=null)}o||(o=l.length);let D=0;for(let t=0,e=l.length;t<e&&l[t]==="empty";t++)D=t;D!==0&&(n=n.map(t=>t.slice(D+1,o)),l=l.slice(D+1,o));let b=[],p;l.forEach((t,e)=>{t==="numeric"&&b.push(e)});let B=g?1:0;if(b.length===1)p=b[0];else{if(b.length===0)throw new Error('csv-sort/sort(): [THROW_ID_02] Your CSV file does not contain numeric-only columns and computer was not able to detect the "Balance" column!');{let t=Array.from(b),e=[];for(let s=0,i=t.length;s<i;s++){let u=t[s],c,f=!0,h,d=!0;for(let m=B,N=n.length;m<N&&(f&&(c==null?c=n[m][u]:c===n[m][u]?(e.push(u),f=!1):c=n[m][u]),d&&(h==null?h=n[m][u]:n[m][u]!==h&&(d=!1)),!!f);m++);d&&v.push(u)}if(t=x(t,...e),t.length===1)p=t[0];else if(t.length===0)throw new Error(`csv-sort/sort(): [THROW_ID_03] 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/sort(): [THROW_ID_04] Sadly computer couldn't find its way in this CSV and had to stop working on it.");let V=x(Array.from(l.reduce((t,e,s)=>((typeof e=="string"&&e==="numeric"||Array.isArray(e)&&e.includes("numeric"))&&t.push(s),t),[])),p,...v),r=[];r.push(n[n.length-1].slice(0,o));let y=[],T=g?1:0;for(let t=n.length-2;t>=T;t--)for(let e=n.length-2;e>=T;e--)if(!y.includes(e)){let s=!1;for(let i=0,u=V.length;i<u;i++){let c=null;n[e][V[i]]!==""&&(c=w(n[e][V[i]]));let f=null;n[e][p]!==""&&(f=w(n[e][p]));let h=null;r[0][p]!==""&&(h=w(r[0][p]).format());let d=null;r[r.length-1][V[i]]!==""&&(d=w(r[r.length-1][V[i]]).format());let m=null;if(r[r.length-1][p]!==""&&(m=w(r[r.length-1][p])),c&&f.add(c).format()===h){r.unshift(n[e].slice(0,o)),y.push(e),s=!0;break}else if(c&&f.subtract(c).format()===h){r.unshift(n[e].slice(0,o)),y.push(e),s=!0;break}else if(d&&m.add(d).format()===f.format()){r.push(n[e].slice(0,o)),y.push(e),s=!0;break}else if(d&&m.subtract(d).format()===f.format()){r.push(n[e].slice(0,o)),y.push(e),s=!0;break}}if(s){s=!1;break}}return g&&(S&&n[0].length>l.length&&(n[0].length=l.length),r.unshift(n[0].slice(0,o))),n.length-(g?2:1)!==y.length&&($="Not all rows were recognised!",C="alert"),{res:r,msgContent:$,msgType:C}}export{R as findType,E as isNumeric,U as sort,G as version};
10
+ import{formatDiagnosticValue as O,pullAll as x}from"codsen-utils";import{splitEasy as j}from"csv-split-easy";import w from"currency.js";var k="7.2.2";function E(a){return typeof a=="number"&&!Number.isNaN(a)?!0:(a=(a||"").toString().trim(),a?!Number.isNaN(+a):!1)}var A=["\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 R(a){return E(a)||A.some(y=>E(a.replace(y,"").replace(/[,.]/g,"")))?"numeric":a.trim()?"text":"empty"}var _=k;function G(a){let y=null,C=null;if(typeof a!="string")throw new TypeError(`csv-sort/sort(): [THROW_ID_01] The input is of a wrong type! We accept either string of array of arrays. We got instead: ${typeof a}, equal to:
11
+ ${O(a,4)}`);if(!a.trim())return{res:[[""]],msgContent:y,msgType:C};let n=j(a),s=[],g=!1,S=!0,T=[],o=null;for(let t=n.length-1;t>=0;t--)if(s.length){t===0&&(g=n[t].every(l=>{let i=R(l);return i==="text"||i==="empty"})),!g&&s.length!==n[t].length&&(S=!1);let e=null;for(let l=0,i=n[t].length;l<i;l++){let u=R(n[t][l].trim());if(e===null&&u==="empty"&&(e=l),e!==null&&u!=="empty"&&(e=null),u!==s[l]&&!g){let c=u;if(Array.isArray(s[l]))s[l].includes(c)||s[l].push(c);else if(s[l]!==c){let f=s[l];s[l]=[],s[l].push(f),s[l].push(c)}}}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++){let i=R(n[t][e].trim());s.push(i),o===null&&i==="empty"&&(o=e),o!==null&&i!=="empty"&&(o=null)}o||(o=s.length);let D=0;for(let t=0,e=s.length;t<e&&s[t]==="empty";t++)D=t;D!==0&&(n=n.map(t=>t.slice(D+1,o)),s=s.slice(D+1,o));let b=[],p;s.forEach((t,e)=>{t==="numeric"&&b.push(e)});let B=g?1:0;if(b.length===1)p=b[0];else{if(b.length===0)throw new Error('csv-sort/sort(): [THROW_ID_02] Your CSV file does not contain numeric-only columns and computer was not able to detect the "Balance" column!');{let t=Array.from(b),e=[];for(let l=0,i=t.length;l<i;l++){let u=t[l],c,f=!0,h,d=!0;for(let m=B,N=n.length;m<N&&(f&&(c==null?c=n[m][u]:c===n[m][u]?(e.push(u),f=!1):c=n[m][u]),d&&(h==null?h=n[m][u]:n[m][u]!==h&&(d=!1)),!!f);m++);d&&T.push(u)}if(t=x(t,e),t.length===1)p=t[0];else if(t.length===0)throw new Error(`csv-sort/sort(): [THROW_ID_03] 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/sort(): [THROW_ID_04] Sadly computer couldn't find its way in this CSV and had to stop working on it.");let V=x(Array.from(s.reduce((t,e,l)=>((typeof e=="string"&&e==="numeric"||Array.isArray(e)&&e.includes("numeric"))&&t.push(l),t),[])),[p,...T]),r=[];r.push(n[n.length-1].slice(0,o));let $=[],v=g?1:0;for(let t=n.length-2;t>=v;t--)for(let e=n.length-2;e>=v;e--)if(!$.includes(e)){let l=!1;for(let i=0,u=V.length;i<u;i++){let c=null;n[e][V[i]]!==""&&(c=w(n[e][V[i]]));let f=null;n[e][p]!==""&&(f=w(n[e][p]));let h=null;r[0][p]!==""&&(h=w(r[0][p]).format());let d=null;r[r.length-1][V[i]]!==""&&(d=w(r[r.length-1][V[i]]).format());let m=null;if(r[r.length-1][p]!==""&&(m=w(r[r.length-1][p])),c&&f.add(c).format()===h){r.unshift(n[e].slice(0,o)),$.push(e),l=!0;break}else if(c&&f.subtract(c).format()===h){r.unshift(n[e].slice(0,o)),$.push(e),l=!0;break}else if(d&&m.add(d).format()===f.format()){r.push(n[e].slice(0,o)),$.push(e),l=!0;break}else if(d&&m.subtract(d).format()===f.format()){r.push(n[e].slice(0,o)),$.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)!==$.length&&(y="Not all rows were recognised!",C="alert"),{res:r,msgContent:y,msgType:C}}export{R as findType,E as isNumeric,G as sort,_ as version};
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name csv-sort
3
3
  * @fileoverview Sort double-entry bookkeeping CSV from internet banking
4
- * @version 7.2.1
4
+ * @version 7.2.2
5
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 bt=Object.create;var F=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames,ie=Object.getOwnPropertySymbols,Tt=Object.getPrototypeOf,fe=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var X=(e,t,r)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t)=>{for(var r in t||(t={}))fe.call(t,r)&&X(e,r,t[r]);if(ie)for(var r of ie(t))$t.call(t,r)&&X(e,r,t[r]);return e};var At=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},St=(e,t)=>{for(var r in t)F(e,r,{get:t[r],enumerable:!0})},ue=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of wt(t))!fe.call(e,i)&&i!==r&&F(e,i,{get:()=>t[i],enumerable:!(a=vt(t,i))||a.enumerable});return e};var Rt=(e,t,r)=>(r=e!=null?bt(Tt(e)):{},ue(t||!e||!e.__esModule?F(r,"default",{value:e,enumerable:!0}):r,e)),Ot=e=>ue(F({},"__esModule",{value:!0}),e);var V=(e,t,r)=>X(e,typeof t!="symbol"?t+"":t,r);var ht=At((se,le)=>{(function(e,t){typeof se=="object"&&typeof le<"u"?le.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.currency=t())})(se,function(){function e(o,l){if(!(this instanceof e))return new e(o,l);l=Object.assign({},r,l);var f=Math.pow(10,l.precision);this.intValue=o=t(o,l),this.value=o/f,l.increment=l.increment||1/f,l.groups=l.useVedic?i:a,this.s=l,this.p=f}function t(o,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0,s=l.decimal,n=l.errorOnInvalid,c=l.fromCents,m=Math.pow(10,l.precision),b=o instanceof e;if(b&&c)return o.intValue;if(typeof o=="number"||b)s=b?o.value:o;else if(typeof o=="string")n=new RegExp("[^-\\d"+s+"]","g"),s=new RegExp("\\"+s,"g"),s=(s=o.replace(/\((.*)\)/,"-$1").replace(n,"").replace(s,"."))||0;else{if(n)throw Error("Invalid Input");s=0}return c||(s=(s*m).toFixed(4)),f?Math.round(s):s}var r={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:function(o,l){var f=l.pattern,s=l.negativePattern,n=l.symbol,c=l.separator,m=l.decimal;l=l.groups;var b=(""+o).replace(/^-/,"").split("."),y=b[0];return b=b[1],(0<=o.value?f:s).replace("!",n).replace("#",y.replace(l,"$1"+c)+(b?m+b:""))},fromCents:!1},a=/(\d)(?=(\d{3})+\b)/g,i=/(\d)(?=(\d\d)+\d\b)/g;return e.prototype={add:function(o){var l=this.s,f=this.p;return e((this.intValue+t(o,l))/(l.fromCents?1:f),l)},subtract:function(o){var l=this.s,f=this.p;return e((this.intValue-t(o,l))/(l.fromCents?1:f),l)},multiply:function(o){var l=this.s;return e(this.intValue*o/(l.fromCents?1:Math.pow(10,l.precision)),l)},divide:function(o){var l=this.s;return e(this.intValue/t(o,l,!1),l)},distribute:function(o){var l=this.intValue,f=this.p,s=this.s,n=[],c=Math[0<=l?"floor":"ceil"](l/o),m=Math.abs(l-c*o);for(f=s.fromCents?1:f;o!==0;o--){var b=e(c/f,s);0<m--&&(b=b[0<=l?"add":"subtract"](1/f)),n.push(b)}return n},dollars:function(){return~~this.value},cents:function(){return~~(this.intValue%this.p)},format:function(o){var l=this.s;return typeof o=="function"?o(this,l):l.format(this,Object.assign({},l,o))},toString:function(){var o=this.s,l=o.increment;return(Math.round(this.intValue/this.p/l)*l).toFixed(o.precision)},toJSON:function(){return this.value}},e})});var No={};St(No,{findType:()=>B,isNumeric:()=>Y,sort:()=>Wo,version:()=>jo});function It(){let e=[],t=0,r=!1;return{append(a){return r?!1:t+a.length>1999?(e.push("\u2026"),t+=1,r=!0,!1):(e.push(a),t+=a.length,!0)},result(){return e.join("")},stopped(){return r}}}function Ct(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function P(e,t){if(e.append('"')){for(let r=0;r<t.length&&!e.stopped();r+=1){let a=t.charCodeAt(r);a===34?e.append('\\"'):a===92?e.append("\\\\"):a===8?e.append("\\b"):a===9?e.append("\\t"):a===10?e.append("\\n"):a===12?e.append("\\f"):a===13?e.append("\\r"):a<32||a===8232||a===8233||a>=55296&&a<=57343?e.append(Ct(a)):e.append(t[r])}e.append('"')}}function Dt(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function me(e,t){e.append("Symbol(");let r=String(t);r.length>8&&P(e,r.slice(7,-1)),e.append(")")}function pe(e,t){typeof t=="symbol"?me(e,t):P(e,String(t))}function g(e,t=0){let r=It(),a=t===4?4:0,i=new WeakSet,o=0;function l(u){a&&r.append(" ".repeat(u*a))}function f(u,x){u&&r.append(","),a&&(r.append("\n"),l(x+1))}function s(u,x,w){a&&x&&(r.append("\n"),l(w)),r.append(u)}function n(u,x){Object.prototype.hasOwnProperty.call(u,"value")?y(u.value,x):r.append(Dt(u))}function c(u,x){let w;try{w=Reflect.getOwnPropertyDescriptor(u,"length")}catch(h){r.append("[Uninspectable]");return}let d=w==null?void 0:w.value;if(!Number.isSafeInteger(d)||d<0){r.append("[Uninspectable]");return}r.append("[");let p=!1;for(let h=0;h<d&&!r.stopped();h+=1){if(f(p,x),p=!0,o>=50){r.append("[MaxEntries]");break}o+=1;let v;try{v=Reflect.getOwnPropertyDescriptor(u,String(h))}catch($){r.append("[Uninspectable]");continue}v!=null&&v.enumerable?n(v,x+1):r.append("[Empty]")}s("]",p,x)}function m(u,x){let w;try{w=Reflect.ownKeys(u)}catch(p){r.append("[Uninspectable]");return}r.append("{");let d=!1;for(let p of w){if(r.stopped())break;if(o>=50){f(d,x),d=!0,P(r,"\u2026"),r.append(a?": ":":"),r.append("[MaxEntries]");break}o+=1;let h;try{h=Reflect.getOwnPropertyDescriptor(u,p)}catch(v){f(d,x),d=!0,pe(r,p),r.append(a?": ":":"),r.append("[Uninspectable]");continue}h!=null&&h.enumerable&&(f(d,x),d=!0,pe(r,p),r.append(a?": ":":"),n(h,x+1))}s("}",d,x)}function b(u,x){if(i.has(u)){r.append("[Circular]");return}if(x>=5){r.append("[MaxDepth]");return}let w;try{w=Array.isArray(u)}catch(d){r.append("[Uninspectable]");return}i.add(u);try{w?c(u,x):m(u,x)}finally{i.delete(u)}}function y(u,x){u===null?r.append("null"):typeof u=="string"?P(r,u):typeof u=="number"?r.append(Object.is(u,-0)?"-0":String(u)):typeof u=="boolean"?r.append(u?"true":"false"):typeof u>"u"?r.append("undefined"):typeof u=="bigint"?r.append("".concat(u,"n")):typeof u=="symbol"?me(r,u):typeof u=="function"?r.append("[Function]"):b(u,x)}try{return y(e,0),r.result()}catch(u){return"[Uninspectable]"}}var Vo=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);function de(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function k(e){return typeof e=="string"}function ce(e){return Number.isFinite(e)}function D(e){return Number.isSafeInteger(e)&&e>=0}function I(e){return e!=null}var Et=typeof global=="object"&&global&&global.Object===Object&&global,ge=Et;var kt=typeof self=="object"&&self&&self.Object===Object&&self,jt=ge||kt||Function("return this")(),H=jt;var Wt=H.Symbol,C=Wt;var he=Object.prototype,Nt=he.hasOwnProperty,Ft=he.toString,M=C?C.toStringTag:void 0;function Vt(e){var t=Nt.call(e,M),r=e[M];try{e[M]=void 0;var a=!0}catch(o){}var i=Ft.call(e);return a&&(t?e[M]=r:delete e[M]),i}var ye=Vt;var Mt=Object.prototype,_t=Mt.toString;function Bt(e){return _t.call(e)}var xe=Bt;var Pt="[object Null]",Ht="[object Undefined]",be=C?C.toStringTag:void 0;function Lt(e){return e==null?e===void 0?Ht:Pt:be&&be in Object(e)?ye(e):xe(e)}var L=Lt;function Ut(e){return e!=null&&typeof e=="object"}var ve=Ut;var qt="[object Symbol]";function Kt(e){return typeof e=="symbol"||ve(e)&&L(e)==qt}var we=Kt;function zt(e,t){for(var r=-1,a=e==null?0:e.length,i=Array(a);++r<a;)i[r]=t(e[r],r,e);return i}var U=zt;var Jt=Array.isArray,Te=Jt;var Gt=1/0,$e=C?C.prototype:void 0,Ae=$e?$e.toString:void 0;function Se(e){if(typeof e=="string")return e;if(Te(e))return U(e,Se)+"";if(we(e))return Ae?Ae.call(e):"";var t=e+"";return t=="0"&&1/e==-Gt?"-0":t}var q=Se;var Qt=/\s/;function Zt(e){for(var t=e.length;t--&&Qt.test(e.charAt(t)););return t}var Re=Zt;var Yt=/^\s+/;function Xt(e){return e&&e.slice(0,Re(e)+1).replace(Yt,"")}var Oe=Xt;function er(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var K=er;function tr(e){return e}var z=tr;var rr="[object AsyncFunction]",or="[object Function]",ar="[object GeneratorFunction]",nr="[object Proxy]";function sr(e){if(!K(e))return!1;var t=L(e);return t==or||t==ar||t==rr||t==nr}var Ie=sr;var lr=H["__core-js_shared__"],J=lr;var Ce=(function(){var e=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function ir(e){return!!Ce&&Ce in e}var De=ir;var fr=Function.prototype,ur=fr.toString;function pr(e){if(e!=null){try{return ur.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var Ee=pr;var mr=/[\\^$.*+?()[\]{}|]/g,dr=/^\[object .+?Constructor\]$/,cr=Function.prototype,gr=Object.prototype,hr=cr.toString,yr=gr.hasOwnProperty,xr=RegExp("^"+hr.call(yr).replace(mr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function br(e){if(!K(e)||De(e))return!1;var t=Ie(e)?xr:dr;return t.test(Ee(e))}var ke=br;function vr(e,t){return e==null?void 0:e[t]}var je=vr;function wr(e,t){var r=je(e,t);return ke(r)?r:void 0}var We=wr;function Tr(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Ne=Tr;function $r(e,t){var r=-1,a=e.length;for(t||(t=Array(a));++r<a;)t[r]=e[r];return t}var Fe=$r;var Ar=800,Sr=16,Rr=Date.now;function Or(e){var t=0,r=0;return function(){var a=Rr(),i=Sr-(a-r);if(r=a,i>0){if(++t>=Ar)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Ve=Or;function Ir(e){return function(){return e}}var Me=Ir;var Cr=(function(){try{var e=We(Object,"defineProperty");return e({},"",{}),e}catch(t){}})(),ee=Cr;var Dr=ee?function(e,t){return ee(e,"toString",{configurable:!0,enumerable:!1,value:Me(t),writable:!0})}:z,_e=Dr;var Er=Ve(_e),Be=Er;function kr(e,t,r,a){for(var i=e.length,o=r+(a?1:-1);a?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var Pe=kr;function jr(e){return e!==e}var He=jr;function Wr(e,t,r){for(var a=r-1,i=e.length;++a<i;)if(e[a]===t)return a;return-1}var Le=Wr;function Nr(e,t,r){return t===t?Le(e,t,r):Pe(e,He,r)}var j=Nr;var Ue=Math.max;function Fr(e,t,r){return t=Ue(t===void 0?e.length-1:t,0),function(){for(var a=arguments,i=-1,o=Ue(a.length-t,0),l=Array(o);++i<o;)l[i]=a[t+i];i=-1;for(var f=Array(t+1);++i<t;)f[i]=a[i];return f[t]=r(l),Ne(e,this,f)}}var qe=Fr;function Vr(e,t){return Be(qe(e,t,z),e+"")}var Ke=Vr;function Mr(e){return function(t){return e(t)}}var ze=Mr;function _r(e){return e==null?"":q(e)}var Je=_r;function Br(e,t,r){var a=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++a<i;)o[a]=e[a+t];return o}var Ge=Br;function Pr(e,t,r){var a=e.length;return r=r===void 0?a:r,!t&&r>=a?e:Ge(e,t,r)}var Qe=Pr;var Hr="\\ud800-\\udfff",Lr="\\u0300-\\u036f",Ur="\\ufe20-\\ufe2f",qr="\\u20d0-\\u20ff",Kr=Lr+Ur+qr,zr="\\ufe0e\\ufe0f",Jr="\\u200d",Gr=RegExp("["+Jr+Hr+Kr+zr+"]");function Qr(e){return Gr.test(e)}var Ze=Qr;function Zr(e){return e.split("")}var Ye=Zr;var Xe="\\ud800-\\udfff",Yr="\\u0300-\\u036f",Xr="\\ufe20-\\ufe2f",eo="\\u20d0-\\u20ff",to=Yr+Xr+eo,ro="\\ufe0e\\ufe0f",oo="["+Xe+"]",te="["+to+"]",re="\\ud83c[\\udffb-\\udfff]",ao="(?:"+te+"|"+re+")",et="[^"+Xe+"]",tt="(?:\\ud83c[\\udde6-\\uddff]){2}",rt="[\\ud800-\\udbff][\\udc00-\\udfff]",no="\\u200d",ot=ao+"?",at="["+ro+"]?",so="(?:"+no+"(?:"+[et,tt,rt].join("|")+")"+at+ot+")*",lo=at+ot+so,io="(?:"+[et+te+"?",te,tt,rt,oo].join("|")+")",fo=RegExp(re+"(?="+re+")|"+io+lo,"g");function uo(e){return e.match(fo)||[]}var nt=uo;function po(e){return Ze(e)?nt(e):Ye(e)}var oe=po;function mo(e,t,r,a){for(var i=r-1,o=e.length;++i<o;)if(a(e[i],t))return i;return-1}var st=mo;var co=Array.prototype,lt=co.splice;function go(e,t,r,a){var i=a?st:j,o=-1,l=t.length,f=e;for(e===t&&(t=Fe(t)),r&&(f=U(e,ze(r)));++o<l;)for(var s=0,n=t[o],c=r?r(n):n;(s=i(f,c,s,a))>-1;)f!==e&&lt.call(f,s,1),lt.call(e,s,1);return e}var it=go;function ho(e,t){return e&&e.length&&t&&t.length?it(e,t):e}var ft=ho;var yo=Ke(ft),G=yo;function xo(e,t){for(var r=e.length;r--&&j(t,e[r],0)>-1;);return r}var ut=xo;function bo(e,t){for(var r=-1,a=e.length;++r<a&&j(t,e[r],0)>-1;);return r}var pt=bo;function vo(e,t,r){if(e=Je(e),e&&(r||t===void 0))return Oe(e);if(!e||!(t=q(t)))return e;var a=oe(e),i=oe(t),o=pt(a,i),l=ut(a,i)+1;return Qe(a,o,l).join("")}var ae=vo;var wo={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function W(e,t){if(!Array.isArray(e)||!e.length)return e;let r=T(T({},wo),t),a,i;if(r.strictlyTwoElementsInRangeArrays&&!e.every((f,s)=>!Array.isArray(f)||f.length!==2?(a=s,i=f.length,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_01] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(a,"th range (").concat(g(e[a],4),") has not two but ").concat(i," elements!"));if(!e.every((f,s)=>!Array.isArray(f)||!Number.isInteger(f[0])||f[0]<0||!Number.isInteger(f[1])||f[1]<0?(a=s,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(a,"th range (").concat(g(e[a],4),") does not consist of only natural numbers!"));let o=e.length**2,l=0;return Array.from(e).sort((f,s)=>(r.progressFn&&(l+=1,r.progressFn(Math.floor(l*100/o))),f[0]===s[0]?f[1]<s[1]?-1:f[1]>s[1]?1:0:f[0]<s[0]?-1:1))}var To={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ne(e,t){function r(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}if(!Array.isArray(e)||!e.length)return null;if(t&&!r(t))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(g(t,4)," (type ").concat(typeof t,")"));let a=T(T({},To),t);if(a.progressFn&&r(a.progressFn)&&!Object.keys(a.progressFn).length)a.progressFn=null;else if(a.progressFn&&typeof a.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof a.progressFn,'", equal to ').concat(g(a.progressFn,4)));if(![1,2,"1","2"].includes(a.mergeType))throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof a.mergeType,'", equal to ').concat(g(a.mergeType,4)));if(typeof a.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof a.joinRangesThatTouchEdges,'", equal to ').concat(g(a.joinRangesThatTouchEdges,4)));let i=e.filter(n=>Array.isArray(n)).map(n=>[...n]).filter(n=>n[2]!==void 0||n[0]!==n[1]),o,l,f;a.progressFn?o=W(i,{progressFn:n=>{f=Math.floor(n/5),f!==l&&(l=f,a.progressFn(f))}}):o=W(i);let s=o.length-1;for(let n=s;n>0;n--)a.progressFn&&(f=Math.floor((1-n/s)*78)+21,f!==l&&f>l&&(l=f,a.progressFn(f))),(o[n][0]<=o[n-1][0]||!a.joinRangesThatTouchEdges&&o[n][0]<o[n-1][1]||a.joinRangesThatTouchEdges&&o[n][0]<=o[n-1][1])&&(o[n-1][0]=Math.min(o[n][0],o[n-1][0]),o[n-1][1]=Math.max(o[n][1],o[n-1][1]),o[n][2]!==void 0&&(o[n-1][0]>=o[n][0]||o[n-1][1]<=o[n][1])&&o[n-1][2]!==null&&(o[n][2]===null&&o[n-1][2]!==null?o[n-1][2]=null:o[n-1][2]!=null?+a.mergeType==2&&o[n-1][0]===o[n][0]?o[n-1][2]=o[n][2]:o[n-1][2]+=o[n][2]:o[n-1][2]=o[n][2]),o.splice(n,1),n=o.length);return o.length?o:null}function Q(e){if(typeof e=="number")return Number.isInteger(e)&&e>=0;if(typeof e!="string"||!e.trim())return!1;let t=Number(e);return Number.isInteger(t)&&t>=0}function mt(e,t,r){let a=0,i=0;if(e===void 0&&t===void 0&&r===void 0)throw new Error("ranges-apply/rApply(): [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply/rApply(): [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(g(e,4)));if(t!=null&&!Array.isArray(t))throw new TypeError("ranges-apply/rApply(): [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof t,", equal to: ").concat(g(t,4)));if(r&&typeof r!="function")throw new TypeError("ranges-apply/rApply(): [THROW_ID_04] the third input argument must be a function (or falsy)! Currently it's: ".concat(typeof r,", equal to: ").concat(g(r,4)));if(!(t!=null&&t.some(Boolean)))return e;let o;Array.isArray(t)&&!Array.isArray(t[0])&&Q(t[0])&&Q(t[1])?o=[Array.from(t)]:o=Array.from(t);let l=o.length,f=0;o.forEach((c,m)=>{if(c){if(r&&(a=Math.floor(f/l*10),a!==i&&(i=a,r(a))),!Array.isArray(c))throw new TypeError("ranges-apply/rApply(): [THROW_ID_05] ranges array, second input arg., has ".concat(m,"th element not an array: ").concat(g(c,4),", which is ").concat(typeof c));if(!Q(c[0]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_06] ranges array, second input arg. has ".concat(m,"th element, array ").concat(g(c),". Its first element is not a non-negative integer or string index, but ").concat(typeof c[0],", equal to: ").concat(g(c[0],4),"."));if(typeof c[0]=="string"&&(o[m]=[...c],o[m][0]=Number(c[0])),!Q(c[1]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_07] ranges array, second input arg. has ".concat(m,"th element, array ").concat(g(c),". Its second element is not a non-negative integer or string index, but ").concat(typeof c[1],", equal to: ").concat(g(c[1],4),"."));typeof c[1]=="string"&&(o[m]===c&&(o[m]=[...c]),o[m][1]=Number(c[1])),f+=1}});let s=r?ne(o,{progressFn:c=>{a=10+Math.floor(c/10),a!==i&&(i=a,r(a))}}):ne(o),n=(s==null?void 0:s.length)||0;if(s&&n>0){let c=e.slice(s[n-1][1]);e=s.reduce((m,b,y,u)=>{r&&(a=20+Math.floor(y/n*80),a!==i&&(i=a,r(a)));let x=y===0?0:u[y-1][1],w=u[y][0];return"".concat(m).concat(e.slice(x,w)).concat(u[y][2]||"")},""),e+=c}return e}function Z(e,t=1){let r="\xA0";function a(o){return Array.from(o).reverse().join("")}function i(o,l,f){let s=f?"\n":"\r",n=f?"\r":"\n";if(!o)return o;let c=0,m=0,b="";for(let y=0,u=o.length;y<u;y++)(o[y]===s||o[y]===n&&o[y-1]!==s)&&m++,"\r\n".includes(o[y])||o[y]===r?(c=0,o[y]===r?b+=o[y]:o[y]===s?m<=l&&(b+=o[y],o[y+1]===n&&(b+=o[y+1],y++)):o[y]===n&&(o==null?void 0:o[y-1])!==s&&m<=l&&(b+=o[y])):(c++,!o[y+1]&&!m&&(b+=" "));return b}if(typeof e=="string"&&e.length){let o=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(o=+t);let l="",f="";if(!e.trim())l=e;else if(!e[0].trim()){for(let s=0,n=e.length;s<n;s++)if(e[s].trim()){l=e.slice(0,s);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===r)){for(let s=e.length;s--;)if(e[s].trim()){f=e.slice(s+1);break}}return"".concat(i(l,o,!1)).concat(e.trim()).concat(a(i(a(f),o,!0)))}return e}var $o={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Ao(e,t){function r(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}if(!Array.isArray(e)||!e.length)return null;if(t&&!r(t))throw new TypeError("ranges-push/rMerge(): [THROW_ID_10] the second input argument must be a plain object. It was given as:\n".concat(g(t,4)," (type ").concat(typeof t,")"));let a=T(T({},$o),t);if(a.progressFn&&r(a.progressFn)&&!Object.keys(a.progressFn).length)a.progressFn=null;else if(a.progressFn&&typeof a.progressFn!="function")throw new TypeError('ranges-push/rMerge(): [THROW_ID_11] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof a.progressFn,'", equal to ').concat(g(a.progressFn,4)));if(![1,2,"1","2"].includes(a.mergeType))throw new TypeError('ranges-push/rMerge(): [THROW_ID_12] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof a.mergeType,'", equal to ').concat(g(a.mergeType,4)));if(typeof a.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-push/rMerge(): [THROW_ID_13] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof a.joinRangesThatTouchEdges,'", equal to ').concat(g(a.joinRangesThatTouchEdges,4)));let i=e.filter(n=>Array.isArray(n)).map(n=>[...n]).filter(n=>n[2]!==void 0||n[0]!==n[1]),o,l,f;a.progressFn?o=W(i,{progressFn:n=>{f=Math.floor(n/5),f!==l&&(l=f,a.progressFn!=null&&a.progressFn(f))}}):o=W(i);let s=o.length-1;for(let n=s;n>0;n--)a.progressFn&&(f=Math.floor((1-n/s)*78)+21,f!==l&&f>l&&(l=f,a.progressFn(f))),(o[n][0]<=o[n-1][0]||!a.joinRangesThatTouchEdges&&o[n][0]<o[n-1][1]||a.joinRangesThatTouchEdges&&o[n][0]<=o[n-1][1])&&(o[n-1][0]=Math.min(o[n][0],o[n-1][0]),o[n-1][1]=Math.max(o[n][1],o[n-1][1]),o[n][2]!==void 0&&(o[n-1][0]>=o[n][0]||o[n-1][1]<=o[n][1])&&o[n-1][2]!==null&&(o[n][2]===null&&o[n-1][2]!==null?o[n-1][2]=null:o[n-1][2]!=null?+a.mergeType==2&&o[n-1][0]===o[n][0]?o[n-1][2]=o[n][2]:o[n-1][2]+=o[n][2]:o[n-1][2]=o[n][2]),o.splice(n,1),n=o.length);return o.length?o:null}var So={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1};function dt(e){return e[2]===void 0&&e[0]===e[1]}function Ro(e){let t=-1;for(let r=0,a=e.length;r<a;r++){let i=e[r];if(Array.isArray(i)){if(i[0]<t)return!1;t=i[0]}}return!0}var ct=class{constructor(e){V(this,"ranges");V(this,"opts");V(this,"sorted");if(e!=null&&!de(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(g(e,4)," (type ").concat(typeof e,")."));let t=T(T({},So),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(k(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(k(t.mergeType)&&t.mergeType.trim()==="2")t.mergeType=2;else throw new Error('ranges-push/Ranges/constructor(): [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof t.mergeType,'", equal to ').concat(g(t.mergeType,4)));this.opts=t,this.ranges=[],this.sorted=!0}add(e,t,r){var o;if(e==null&&t==null)return;if(I(e)&&!I(t)){if(Array.isArray(e)){if(e.length){if(e.some(l=>Array.isArray(l))){e.forEach(l=>{Array.isArray(l)&&this.add(...l)});return}e.length&&D(+e[0])&&D(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_03] the first input argument, "from" is set ('.concat(g(e),') but second-one, "to" is not (').concat(g(t),")"))}else if(!I(e)&&I(t))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_04] the second input argument, "to" is set ('.concat(g(t),') but first-one, "from" is not (').concat(g(e),")"));let a=+e,i=+t;if(D(a)&&D(i)){if(I(r)&&!k(r)&&!ce(r))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_05] The third argument, the value to add, was given not as string but ".concat(typeof r,", equal to:\n").concat(g(r,4)));if(I(this.ranges)&&Array.isArray(this.last())&&a===this.last()[1]){if(this.last()[1]=i,this.last()[2],this.last()[2]!==null&&I(r)){let l=this.last()[2]&&this.last()[2].length&&(!((o=this.opts)!=null&&o.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(r):r;this.opts.limitToBeAddedWhitespace&&(l=Z(l,this.opts.limitLinebreaksCount)),k(l)&&!l.length||(this.last()[2]=l)}}else{this.ranges||(this.ranges=[]);let l=this.last();l&&a<l[0]&&(this.sorted=!1);let f=r!==void 0&&!(k(r)&&!r.length)?[a,i,r&&this.opts.limitToBeAddedWhitespace?Z(r,this.opts.limitLinebreaksCount):r]:[a,i];this.ranges.push(f)}}else throw D(a)?new TypeError('ranges-push/Ranges/add(): [THROW_ID_07] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof t,'" equal to: ').concat(g(t,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_06] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof e,'" equal to: ').concat(g(e,4)))}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=Ao(this.ranges,{mergeType:this.opts.mergeType}),this.sorted=!0,this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>I(e[2])?[e[0],e[1],Z(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}firstCovers(e){if(!D(e))throw new TypeError("ranges-push/Ranges/firstCovers(): [THROW_ID_08] the input argument must be a natural number or zero! It was given as ".concat(g(e,4)," (type ").concat(typeof e,")"));if(!Array.isArray(this.ranges)||!this.ranges.length)return!1;let t=null;if(this.sorted){for(let a=0,i=this.ranges.length;a<i;a++){let o=this.ranges[a];if(!(!Array.isArray(o)||dt(o))){if(t===null){if(o[0]!==0)return!1;t=o[1]}else{if(o[0]>t)break;o[1]>t&&(t=o[1])}if(t>=e)return!0}}return t!==null&&t>=e}let r=!0;for(;r;){r=!1;for(let a=0,i=this.ranges.length;a<i;a++){let o=this.ranges[a];if(!(!Array.isArray(o)||dt(o))){if(o[0]<0)return!1;(t===null?o[0]===0:o[0]<=t&&o[1]>t)&&(t=o[1],r=!0)}}}return t!==null&&t>=e}wipe(){this.ranges=[],this.sorted=!0}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&D(e[0][0]))this.ranges=Array.from(e),this.sorted=Ro(this.ranges);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_09] Single range was given but we expected array of arrays! The first element, ".concat(g(e[0],4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[],this.sorted=!0}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var Oo={removeThousandSeparatorsFromNumbers:!0,padSingleDecimalPlaceNumbers:!0,forceUKStyle:!1};function _(e,t){let r=!0,a=[".",",","'"," "],i;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(g(e,4)));if(t&&typeof t!="object")throw new TypeError("string-remove-thousand-separators/remSep(): [THROW_ID_02] Options object must be a plain object! Currently it's: ".concat(typeof t,", equal to:\n").concat(g(t,4)));let o=T(T({},Oo),t),l=ae(e.trim(),'"');if(l==="")return l;if(+e>0&&+e<1)return e;let f=new ct;for(let s=0,n=l.length;s<n;s++){if(o.removeThousandSeparatorsFromNumbers&&l[s].trim()===""&&f.add(s,s+1),o.removeThousandSeparatorsFromNumbers&&l[s]==="'"&&(f.add(s,s+1),l[s+1]==="'")){r=!1;break}if(a.includes(l[s])){if(l[s+1]!==void 0&&/^\d$/.test(l[s+1]))if(l[s+2]!==void 0)if(/^\d$/.test(l[s+2]))if(l[s+3]!==void 0)if(/^\d$/.test(l[s+3])){if(l[s+4]!==void 0&&/^\d$/.test(l[s+4])){r=!1;break}else if(o.removeThousandSeparatorsFromNumbers&&f.add(s,s+1),!i)i=l[s];else if(l[s]!==i){r=!1;break}}else{r=!1;break}else o.removeThousandSeparatorsFromNumbers&&o.forceUKStyle&&l[s]===","&&f.add(s,s+1,".");else{r=!1;break}else o.forceUKStyle&&l[s]===","&&f.add(s,s+1,"."),o.padSingleDecimalPlaceNumbers&&f.add(s+2,s+2,"0")}else if(!/^\d$/.test(l[s])){r=!1;break}}return r&&f.current()?mt(l,f.current()):l}var Io={delimiter:",",removeThousandSeparatorsFromNumbers:!0,padSingleDecimalPlaceNumbers:!0,forceUKStyle:!1};function Co(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Do(e,t){let r=0,a=e.length;for(;r<a&&e[r]!==t&&e[r].trim()==="";)r+=1;for(;a>r&&e[a-1]!==t&&e[a-1].trim()==="";)a-=1;return e.slice(r,a)}function gt(e,t){let r=0,a=0,i=[],o=[],l=!1,f=!0;if(t&&!Co(t))throw new Error("csv-split-easy/splitEasy(): [THROW_ID_01] Options object must be a plain object! Currently it's of a type ".concat(typeof t," equal to:\n").concat(g(t,4)));let s=T(T({},Io),t);if(typeof e!="string")throw new TypeError("csv-split-easy/splitEasy(): [THROW_ID_02] input must be string! Currently it's: ".concat(typeof e,", equal to: ").concat(g(e,4)));if(typeof s.delimiter!="string"||s.delimiter.length!==1||s.delimiter==='"'||s.delimiter==="\n"||s.delimiter==="\r")throw new TypeError('csv-split-easy/splitEasy(): [THROW_ID_03] The "delimiter" option must be a single character other than a double quote or a line break! Currently it\'s: '.concat(typeof s.delimiter,", equal to: ").concat(g(s.delimiter)));if(e==="")return[[""]];e=Do(e,s.delimiter);for(let n=0,c=e.length;n<c;n++){if(f&&e[n]!=='"'&&e[n]!==s.delimiter&&e[n].trim()!==""&&(f=!1),e[n]==='"')if(l&&e[n+1]==='"')n+=1;else if(l){l=!1;let m=e.slice(r,n);m.trim()!==""&&(f=!1);let b=/""/.test(m)?m.replace(/""/g,'"'):_(m,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle});i.push(b)}else l=!0,r=n+1;else if(!l&&e[n]===s.delimiter){if(e[n-1]!=='"'&&!l){let m=e.slice(r,n);m.trim()!==""&&(f=!1),i.push(_(m,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle}))}r=n+1,a&&(a=0)}else if(e[n]==="\n"||e[n]==="\r"){if(!a){if(a=n,!l&&e[n-1]!=='"'){let m=e.slice(r,n);m.trim()!==""&&(f=!1),i.push(_(m,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle}))}f?i.length=0:o.push(i),f=!0,i=[]}r=n+1}else a&&(a=0,r=n);if(n+1===c){if(e[n]!=='"'){let m=e.slice(r,n+1);m.trim()&&(f=!1),i.push(_(m,{removeThousandSeparatorsFromNumbers:s.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:s.padSingleDecimalPlaceNumbers,forceUKStyle:s.forceUKStyle}))}f?i=[]:o.push(i),f=!0}}return o.length===0?[[""]]:o}var N=Rt(ht(),1);var yt="7.2.1";function Y(e){return typeof e=="number"&&!Number.isNaN(e)?!0:(e=(e||"").toString().trim(),e?!Number.isNaN(+e):!1)}var ko=["\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 B(e){return Y(e)||ko.some(t=>Y(e.replace(t,"").replace(/[,.]/g,"")))?"numeric":e.trim()?"text":"empty"}var jo=yt;function Wo(e){let t=null,r=null;if(typeof e!="string")throw new TypeError("csv-sort/sort(): [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(g(e,4)));if(!e.trim())return{res:[[""]],msgContent:t,msgType:r};let a=gt(e),i=[],o=!1,l=!0,f=[],s=null;for(let d=a.length-1;d>=0;d--)if(i.length){d===0&&(o=a[d].every(h=>{let v=B(h);return v==="text"||v==="empty"})),!o&&i.length!==a[d].length&&(l=!1);let p=null;for(let h=0,v=a[d].length;h<v;h++){let $=B(a[d][h].trim());if(p===null&&$==="empty"&&(p=h),p!==null&&$!=="empty"&&(p=null),$!==i[h]&&!o){let A=$;if(Array.isArray(i[h]))i[h].includes(A)||i[h].push(A);else if(i[h]!==A){let S=i[h];i[h]=[],i[h].push(S),i[h].push(A)}}}s!==null&&p!==null&&p>s&&(!o||o&&d!==0)&&(s=p)}else if(a[d].length!==1||a[d][0]!=="")for(let p=0,h=a[d].length;p<h;p++){let v=B(a[d][p].trim());i.push(v),s===null&&v==="empty"&&(s=p),s!==null&&v!=="empty"&&(s=null)}s||(s=i.length);let n=0;for(let d=0,p=i.length;d<p&&i[d]==="empty";d++)n=d;n!==0&&(a=a.map(d=>d.slice(n+1,s)),i=i.slice(n+1,s));let c=[],m;i.forEach((d,p)=>{d==="numeric"&&c.push(p)});let b=o?1:0;if(c.length===1)m=c[0];else{if(c.length===0)throw new Error('csv-sort/sort(): [THROW_ID_02] Your CSV file does not contain numeric-only columns and computer was not able to detect the "Balance" column!');{let d=Array.from(c),p=[];for(let h=0,v=d.length;h<v;h++){let $=d[h],A,S=!0,E,O=!0;for(let R=b,xt=a.length;R<xt&&(S&&(A==null?A=a[R][$]:A===a[R][$]?(p.push($),S=!1):A=a[R][$]),O&&(E==null?E=a[R][$]:a[R][$]!==E&&(O=!1)),!!S);R++);O&&f.push($)}if(d=G(d,...p),d.length===1)m=d[0];else if(d.length===0)throw new Error('csv-sort/sort(): [THROW_ID_03] 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/sort(): [THROW_ID_04] Sadly computer couldn't find its way in this CSV and had to stop working on it.");let y=G(Array.from(i.reduce((d,p,h)=>((typeof p=="string"&&p==="numeric"||Array.isArray(p)&&p.includes("numeric"))&&d.push(h),d),[])),m,...f),u=[];u.push(a[a.length-1].slice(0,s));let x=[],w=o?1:0;for(let d=a.length-2;d>=w;d--)for(let p=a.length-2;p>=w;p--)if(!x.includes(p)){let h=!1;for(let v=0,$=y.length;v<$;v++){let A=null;a[p][y[v]]!==""&&(A=(0,N.default)(a[p][y[v]]));let S=null;a[p][m]!==""&&(S=(0,N.default)(a[p][m]));let E=null;u[0][m]!==""&&(E=(0,N.default)(u[0][m]).format());let O=null;u[u.length-1][y[v]]!==""&&(O=(0,N.default)(u[u.length-1][y[v]]).format());let R=null;if(u[u.length-1][m]!==""&&(R=(0,N.default)(u[u.length-1][m])),A&&S.add(A).format()===E){u.unshift(a[p].slice(0,s)),x.push(p),h=!0;break}else if(A&&S.subtract(A).format()===E){u.unshift(a[p].slice(0,s)),x.push(p),h=!0;break}else if(O&&R.add(O).format()===S.format()){u.push(a[p].slice(0,s)),x.push(p),h=!0;break}else if(O&&R.subtract(O).format()===S.format()){u.push(a[p].slice(0,s)),x.push(p),h=!0;break}}if(h){h=!1;break}}return o&&(l&&a[0].length>i.length&&(a[0].length=i.length),u.unshift(a[0].slice(0,s))),a.length-(o?2:1)!==x.length&&(t="Not all rows were recognised!",r="alert"),{res:u,msgContent:t,msgType:r}}return Ot(No);})();
10
+ "use strict";var csvSort=(()=>{var ue=Object.create;var j=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames,J=Object.getOwnPropertySymbols,ce=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var P=(e,t,s)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,T=(e,t)=>{for(var s in t||(t={}))G.call(t,s)&&P(e,s,t[s]);if(J)for(var s of J(t))ge.call(t,s)&&P(e,s,t[s]);return e};var he=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(s){throw t=0,s}},me=(e,t)=>{for(var s in t)j(e,s,{get:t[s],enumerable:!0})},z=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of pe(t))!G.call(e,f)&&f!==s&&j(e,f,{get:()=>t[f],enumerable:!(r=fe(t,f))||r.enumerable});return e};var de=(e,t,s)=>(s=e!=null?ue(ce(e)):{},z(t||!e||!e.__esModule?j(s,"default",{value:e,enumerable:!0}):s,e)),ye=e=>z(j({},"__esModule",{value:!0}),e);var F=(e,t,s)=>P(e,typeof t!="symbol"?t+"":t,s);var ie=he((q,K)=>{(function(e,t){typeof q=="object"&&typeof K<"u"?K.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self,e.currency=t())})(q,function(){function e(n,i){if(!(this instanceof e))return new e(n,i);i=Object.assign({},s,i);var a=Math.pow(10,i.precision);this.intValue=n=t(n,i),this.value=n/a,i.increment=i.increment||1/a,i.groups=i.useVedic?f:r,this.s=i,this.p=a}function t(n,i){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0,o=i.decimal,l=i.errorOnInvalid,h=i.fromCents,g=Math.pow(10,i.precision),v=n instanceof e;if(v&&h)return n.intValue;if(typeof n=="number"||v)o=v?n.value:n;else if(typeof n=="string")l=new RegExp("[^-\\d"+o+"]","g"),o=new RegExp("\\"+o,"g"),o=(o=n.replace(/\((.*)\)/,"-$1").replace(l,"").replace(o,"."))||0;else{if(l)throw Error("Invalid Input");o=0}return h||(o=(o*g).toFixed(4)),a?Math.round(o):o}var s={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:function(n,i){var a=i.pattern,o=i.negativePattern,l=i.symbol,h=i.separator,g=i.decimal;i=i.groups;var v=(""+n).replace(/^-/,"").split("."),b=v[0];return v=v[1],(0<=n.value?a:o).replace("!",l).replace("#",b.replace(i,"$1"+h)+(v?g+v:""))},fromCents:!1},r=/(\d)(?=(\d{3})+\b)/g,f=/(\d)(?=(\d\d)+\d\b)/g;return e.prototype={add:function(n){var i=this.s,a=this.p;return e((this.intValue+t(n,i))/(i.fromCents?1:a),i)},subtract:function(n){var i=this.s,a=this.p;return e((this.intValue-t(n,i))/(i.fromCents?1:a),i)},multiply:function(n){var i=this.s;return e(this.intValue*n/(i.fromCents?1:Math.pow(10,i.precision)),i)},divide:function(n){var i=this.s;return e(this.intValue/t(n,i,!1),i)},distribute:function(n){var i=this.intValue,a=this.p,o=this.s,l=[],h=Math[0<=i?"floor":"ceil"](i/n),g=Math.abs(i-h*n);for(a=o.fromCents?1:a;n!==0;n--){var v=e(h/a,o);0<g--&&(v=v[0<=i?"add":"subtract"](1/a)),l.push(v)}return l},dollars:function(){return~~this.value},cents:function(){return~~(this.intValue%this.p)},format:function(n){var i=this.s;return typeof n=="function"?n(this,i):i.format(this,Object.assign({},i,n))},toString:function(){var n=this.s,i=n.increment;return(Math.round(this.intValue/this.p/i)*i).toFixed(n.precision)},toJSON:function(){return this.value}},e})});var Fe={};me(Fe,{findType:()=>_,isNumeric:()=>H,sort:()=>je,version:()=>Ve});function be(){let e=[],t=0,s=!1;return{append(r){return s?!1:t+r.length>1999?(e.push("\u2026"),t+=1,s=!0,!1):(e.push(r),t+=r.length,!0)},result(){return e.join("")},stopped(){return s}}}function ve(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function N(e,t){if(e.append('"')){for(let s=0;s<t.length&&!e.stopped();s+=1){let r=t.charCodeAt(s);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(ve(r)):e.append(t[s])}e.append('"')}}function we(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function Y(e,t){e.append("Symbol(");let s=String(t);s.length>8&&N(e,s.slice(7,-1)),e.append(")")}function Q(e,t){typeof t=="symbol"?Y(e,t):N(e,String(t))}function d(e,t=0){let s=be(),r=t===4?4:0,f=new WeakSet,n=0;function i(u){r&&s.append(" ".repeat(u*r))}function a(u,m){u&&s.append(","),r&&(s.append("\n"),i(m+1))}function o(u,m,w){r&&m&&(s.append("\n"),i(w)),s.append(u)}function l(u,m){Object.prototype.hasOwnProperty.call(u,"value")?b(u.value,m):s.append(we(u))}function h(u,m){let w;try{w=Reflect.getOwnPropertyDescriptor(u,"length")}catch(y){s.append("[Uninspectable]");return}let p=w==null?void 0:w.value;if(!Number.isSafeInteger(p)||p<0){s.append("[Uninspectable]");return}s.append("[");let c=!1;for(let y=0;y<p&&!s.stopped();y+=1){if(a(c,m),c=!0,n>=50){s.append("[MaxEntries]");break}n+=1;let $;try{$=Reflect.getOwnPropertyDescriptor(u,String(y))}catch(A){s.append("[Uninspectable]");continue}$!=null&&$.enumerable?l($,m+1):s.append("[Empty]")}o("]",c,m)}function g(u,m){let w;try{w=Reflect.ownKeys(u)}catch(c){s.append("[Uninspectable]");return}s.append("{");let p=!1;for(let c of w){if(s.stopped())break;if(n>=50){a(p,m),p=!0,N(s,"\u2026"),s.append(r?": ":":"),s.append("[MaxEntries]");break}n+=1;let y;try{y=Reflect.getOwnPropertyDescriptor(u,c)}catch($){a(p,m),p=!0,Q(s,c),s.append(r?": ":":"),s.append("[Uninspectable]");continue}y!=null&&y.enumerable&&(a(p,m),p=!0,Q(s,c),s.append(r?": ":":"),l(y,m+1))}o("}",p,m)}function v(u,m){if(f.has(u)){s.append("[Circular]");return}if(m>=5){s.append("[MaxDepth]");return}let w;try{w=Array.isArray(u)}catch(p){s.append("[Uninspectable]");return}f.add(u);try{w?h(u,m):g(u,m)}finally{f.delete(u)}}function b(u,m){u===null?s.append("null"):typeof u=="string"?N(s,u):typeof u=="number"?s.append(Object.is(u,-0)?"-0":String(u)):typeof u=="boolean"?s.append(u?"true":"false"):typeof u>"u"?s.append("undefined"):typeof u=="bigint"?s.append("".concat(u,"n")):typeof u=="symbol"?Y(s,u):typeof u=="function"?s.append("[Function]"):v(u,m)}try{return b(e,0),s.result()}catch(u){return"[Uninspectable]"}}var _e=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);function X(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function x(e){return typeof e=="string"}function ee(e){return Number.isFinite(e)}function O(e){return Number.isSafeInteger(e)&&e>=0}var Z,Ne=(Z=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:Z.get;var Me=Date.prototype.getTime;function te(e,t){if(!e||!t)return e;let s=!0;for(let a=t.length;a--;)if(t.charCodeAt(a)>127){s=!1;break}if(s){let a=0,o=e.length;if(t.length===1){let l=t.charCodeAt(0);for(;a<o&&e.charCodeAt(a)===l;)a++;for(;o>a&&e.charCodeAt(o-1)===l;)o--}else{for(;a<o&&t.includes(e[a]);)a++;for(;o>a&&t.includes(e[o-1]);)o--}return a===0&&o===e.length?e:e.slice(a,o)}let r=Array.from(e),f=new Set(t),n=0,i=r.length;for(;n<i&&f.has(r[n]);)n++;for(;i>n&&f.has(r[i-1]);)i--;return n===0&&i===r.length?e:r.slice(n,i).join("")}function L(e=[],t=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!t||!Array.isArray(t)||!t.length)return e;if(e.length*t.length<400)return e.filter(r=>!t.includes(r));let s=new Set(t);return e.filter(r=>!s.has(r))}function E(e){return e!=null}var $e={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function k(e,t){if(!Array.isArray(e)||!e.length)return e;let s=T(T({},$e),t),r,f;if(s.strictlyTwoElementsInRangeArrays&&!e.every((a,o)=>!Array.isArray(a)||a.length!==2?(r=o,f=a.length,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_01] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(r,"th range (").concat(d(e[r],4),") has not two but ").concat(f," elements!"));if(!e.every((a,o)=>!Array.isArray(a)||!Number.isInteger(a[0])||a[0]<0||!Number.isInteger(a[1])||a[1]<0?(r=o,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(r,"th range (").concat(d(e[r],4),") does not consist of only natural numbers!"));let n=e.length**2,i=0;return Array.from(e).sort((a,o)=>(s.progressFn&&(i+=1,s.progressFn(Math.floor(i*100/n))),a[0]===o[0]?a[1]<o[1]?-1:a[1]>o[1]?1:0:a[0]<o[0]?-1:1))}var Te={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function U(e,t){function s(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}if(!Array.isArray(e)||!e.length)return null;if(t&&!s(t))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(d(t,4)," (type ").concat(typeof t,")"));let r=T(T({},Te),t);if(r.progressFn&&s(r.progressFn)&&!Object.keys(r.progressFn).length)r.progressFn=null;else if(r.progressFn&&typeof r.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof r.progressFn,'", equal to ').concat(d(r.progressFn,4)));if(r.mergeType!==1&&r.mergeType!==2&&r.mergeType!=="1"&&r.mergeType!=="2")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(d(r.mergeType,4)));if(typeof r.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof r.joinRangesThatTouchEdges,'", equal to ').concat(d(r.joinRangesThatTouchEdges,4)));let f=r.progressFn,n=r.joinRangesThatTouchEdges,i=[];for(let u of e)Array.isArray(u)&&(u[2]!==void 0||u[0]!==u[1])&&i.push([...u]);let a,o,l;f?a=k(i,{progressFn:u=>{l=Math.floor(u/5),l!==o&&(o=l,f(l))}}):a=k(i);let h=a.length-1,g=r.mergeType===2||r.mergeType==="2",v=a.length;for(let u=h;u>=0;u--){let m=a[u];for(f&&u<h&&(l=Math.floor((1-(u+1)/h)*78)+21,l!==o&&l>o&&(o=l,f(l)));v<a.length;){let w=a[v],p=w[0]===m[0];if(!p&&(n?w[0]>m[1]:w[0]>=m[1]))break;let c=w[1]>=m[1];c&&(m[1]=w[1]),w[2]!==void 0&&(p||c)&&m[2]!==null&&(w[2]===null&&m[2]!==null?m[2]=null:m[2]!=null?g&&p?m[2]=w[2]:m[2]+=w[2]:m[2]=w[2]),v+=1}v-=1,a[v]=m}let b=a.length-v;for(let u=0;u<b;u++)a[u]=a[v+u];return a.length=b,a.length?a:null}function M(e){if(typeof e=="number")return Number.isInteger(e)&&e>=0;if(typeof e!="string"||!e.trim())return!1;let t=Number(e);return Number.isInteger(t)&&t>=0}function re(e,t,s){let r=0,f=0;if(e===void 0&&t===void 0&&s===void 0)throw new Error("ranges-apply/rApply(): [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply/rApply(): [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(d(e,4)));if(t!=null&&!Array.isArray(t))throw new TypeError("ranges-apply/rApply(): [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof t,", equal to: ").concat(d(t,4)));if(s&&typeof s!="function")throw new TypeError("ranges-apply/rApply(): [THROW_ID_04] the third input argument must be a function (or falsy)! Currently it's: ".concat(typeof s,", equal to: ").concat(d(s,4)));if(!(t!=null&&t.some(Boolean)))return e;let n;Array.isArray(t)&&!Array.isArray(t[0])&&M(t[0])&&M(t[1])?n=[Array.from(t)]:n=Array.from(t);let i=n.length,a=0;n.forEach((h,g)=>{if(h){if(s&&(r=Math.floor(a/i*10),r!==f&&(f=r,s(r))),!Array.isArray(h))throw new TypeError("ranges-apply/rApply(): [THROW_ID_05] ranges array, second input arg., has ".concat(g,"th element not an array: ").concat(d(h,4),", which is ").concat(typeof h));if(!M(h[0]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_06] ranges array, second input arg. has ".concat(g,"th element, array ").concat(d(h),". Its first element is not a non-negative integer or string index, but ").concat(typeof h[0],", equal to: ").concat(d(h[0],4),"."));if(typeof h[0]=="string"&&(n[g]=[...h],n[g][0]=Number(h[0])),!M(h[1]))throw new TypeError("ranges-apply/rApply(): [THROW_ID_07] ranges array, second input arg. has ".concat(g,"th element, array ").concat(d(h),". Its second element is not a non-negative integer or string index, but ").concat(typeof h[1],", equal to: ").concat(d(h[1],4),"."));typeof h[1]=="string"&&(n[g]===h&&(n[g]=[...h]),n[g][1]=Number(h[1])),a+=1}});let o=s?U(n,{progressFn:h=>{r=10+Math.floor(h/10),r!==f&&(f=r,s(r))}}):U(n),l=(o==null?void 0:o.length)||0;if(o&&l>0){let h=e.slice(o[l-1][1]);e=o.reduce((g,v,b,u)=>{s&&(r=20+Math.floor(b/l*80),r!==f&&(f=r,s(r)));let m=b===0?0:u[b-1][1],w=u[b][0];return"".concat(g).concat(e.slice(m,w)).concat(u[b][2]||"")},""),e+=h}return e}function B(e,t=1){let s="\xA0";function r(n){return Array.from(n).reverse().join("")}function f(n,i,a){let o=a?"\n":"\r",l=a?"\r":"\n";if(!n)return n;let h=0,g=0,v="";for(let b=0,u=n.length;b<u;b++)(n[b]===o||n[b]===l&&n[b-1]!==o)&&g++,"\r\n".includes(n[b])||n[b]===s?(h=0,n[b]===s?v+=n[b]:n[b]===o?g<=i&&(v+=n[b],n[b+1]===l&&(v+=n[b+1],b++)):n[b]===l&&(n==null?void 0:n[b-1])!==o&&g<=i&&(v+=n[b])):(h++,!n[b+1]&&!g&&(v+=" "));return v}if(typeof e=="string"&&e.length){let n=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(n=+t);let i="",a="";if(!e.trim())i=e;else if(!e[0].trim()){for(let o=0,l=e.length;o<l;o++)if(e[o].trim()){i=e.slice(0,o);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===s)){for(let o=e.length;o--;)if(e[o].trim()){a=e.slice(o+1);break}}return"".concat(f(i,n,!1)).concat(e.trim()).concat(r(f(r(a),n,!0)))}return e}var Ae={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Re(e,t){function s(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}if(!Array.isArray(e)||!e.length)return null;if(t&&!s(t))throw new TypeError("ranges-push/rMerge(): [THROW_ID_10] the second input argument must be a plain object. It was given as:\n".concat(d(t,4)," (type ").concat(typeof t,")"));let r=T(T({},Ae),t);if(r.progressFn&&s(r.progressFn)&&!Object.keys(r.progressFn).length)r.progressFn=null;else if(r.progressFn&&typeof r.progressFn!="function")throw new TypeError('ranges-push/rMerge(): [THROW_ID_11] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof r.progressFn,'", equal to ').concat(d(r.progressFn,4)));if(![1,2,"1","2"].includes(r.mergeType))throw new TypeError('ranges-push/rMerge(): [THROW_ID_12] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(d(r.mergeType,4)));if(typeof r.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-push/rMerge(): [THROW_ID_13] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof r.joinRangesThatTouchEdges,'", equal to ').concat(d(r.joinRangesThatTouchEdges,4)));let f=e.filter(l=>Array.isArray(l)).map(l=>[...l]).filter(l=>l[2]!==void 0||l[0]!==l[1]),n,i,a;r.progressFn?n=k(f,{progressFn:l=>{a=Math.floor(l/5),a!==i&&(i=a,r.progressFn!=null&&r.progressFn(a))}}):n=k(f);let o=n.length-1;for(let l=o;l>0;l--)r.progressFn&&(a=Math.floor((1-l/o)*78)+21,a!==i&&a>i&&(i=a,r.progressFn(a))),(n[l][0]<=n[l-1][0]||!r.joinRangesThatTouchEdges&&n[l][0]<n[l-1][1]||r.joinRangesThatTouchEdges&&n[l][0]<=n[l-1][1])&&(n[l-1][0]=Math.min(n[l][0],n[l-1][0]),n[l-1][1]=Math.max(n[l][1],n[l-1][1]),n[l][2]!==void 0&&(n[l-1][0]>=n[l][0]||n[l-1][1]<=n[l][1])&&n[l-1][2]!==null&&(n[l][2]===null&&n[l-1][2]!==null?n[l-1][2]=null:n[l-1][2]!=null?+r.mergeType==2&&n[l-1][0]===n[l][0]?n[l-1][2]=n[l][2]:n[l-1][2]+=n[l][2]:n[l-1][2]=n[l][2]),n.splice(l,1),l=n.length);return n.length?n:null}var Se={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1};function ne(e){return e[2]===void 0&&e[0]===e[1]}function De(e){let t=-1;for(let s=0,r=e.length;s<r;s++){let f=e[s];if(Array.isArray(f)){if(f[0]<t)return!1;t=f[0]}}return!0}var se=class{constructor(e){F(this,"ranges");F(this,"opts");F(this,"sorted");if(e!=null&&!X(e))throw new TypeError("ranges-push/Ranges/constructor(): [THROW_ID_01] The options argument must be a plain object. It was given as ".concat(d(e,4)," (type ").concat(typeof e,")."));let t=T(T({},Se),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(x(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(x(t.mergeType)&&t.mergeType.trim()==="2")t.mergeType=2;else throw new Error('ranges-push/Ranges/constructor(): [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof t.mergeType,'", equal to ').concat(d(t.mergeType,4)));this.opts=t,this.ranges=[],this.sorted=!0}add(e,t,s){var n;if(e==null&&t==null)return;if(E(e)&&!E(t)){if(Array.isArray(e)){if(e.length){if(e.some(i=>Array.isArray(i))){e.forEach(i=>{Array.isArray(i)&&this.add(...i)});return}e.length&&O(+e[0])&&O(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_03] the first input argument, "from" is set ('.concat(d(e),') but second-one, "to" is not (').concat(d(t),")"))}else if(!E(e)&&E(t))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_04] the second input argument, "to" is set ('.concat(d(t),') but first-one, "from" is not (').concat(d(e),")"));let r=+e,f=+t;if(O(r)&&O(f)){if(E(s)&&!x(s)&&!ee(s))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_05] The third argument, the value to add, was given not as string but ".concat(typeof s,", equal to:\n").concat(d(s,4)));if(E(this.ranges)&&Array.isArray(this.last())&&r===this.last()[1]){if(this.last()[1]=f,this.last()[2],this.last()[2]!==null&&E(s)){let i=this.last()[2]&&this.last()[2].length&&(!((n=this.opts)!=null&&n.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(s):s;this.opts.limitToBeAddedWhitespace&&(i=B(i,this.opts.limitLinebreaksCount)),x(i)&&!i.length||(this.last()[2]=i)}}else{this.ranges||(this.ranges=[]);let i=this.last();i&&r<i[0]&&(this.sorted=!1);let a=s!==void 0&&!(x(s)&&!s.length)?[r,f,s&&this.opts.limitToBeAddedWhitespace?B(s,this.opts.limitLinebreaksCount):s]:[r,f];this.ranges.push(a)}}else throw O(r)?new TypeError('ranges-push/Ranges/add(): [THROW_ID_07] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof t,'" equal to: ').concat(d(t,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_06] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof e,'" equal to: ').concat(d(e,4)))}push(e,t,s){this.add(e,t,s)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=Re(this.ranges,{mergeType:this.opts.mergeType}),this.sorted=!0,this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>E(e[2])?[e[0],e[1],B(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}firstCovers(e){if(!O(e))throw new TypeError("ranges-push/Ranges/firstCovers(): [THROW_ID_08] the input argument must be a natural number or zero! It was given as ".concat(d(e,4)," (type ").concat(typeof e,")"));if(!Array.isArray(this.ranges)||!this.ranges.length)return!1;let t=null;if(this.sorted){for(let r=0,f=this.ranges.length;r<f;r++){let n=this.ranges[r];if(!(!Array.isArray(n)||ne(n))){if(t===null){if(n[0]!==0)return!1;t=n[1]}else{if(n[0]>t)break;n[1]>t&&(t=n[1])}if(t>=e)return!0}}return t!==null&&t>=e}let s=!0;for(;s;){s=!1;for(let r=0,f=this.ranges.length;r<f;r++){let n=this.ranges[r];if(!(!Array.isArray(n)||ne(n))){if(n[0]<0)return!1;(t===null?n[0]===0:n[0]<=t&&n[1]>t)&&(t=n[1],s=!0)}}}return t!==null&&t>=e}wipe(){this.ranges=[],this.sorted=!0}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&O(e[0][0]))this.ranges=Array.from(e),this.sorted=De(this.ranges);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_09] Single range was given but we expected array of arrays! The first element, ".concat(d(e[0],4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[],this.sorted=!0}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var Ce={removeThousandSeparatorsFromNumbers:!0,padSingleDecimalPlaceNumbers:!0,forceUKStyle:!1};function W(e,t){let s=!0,r=[".",",","'"," "],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(d(e,4)));if(t&&typeof t!="object")throw new TypeError("string-remove-thousand-separators/remSep(): [THROW_ID_02] Options object must be a plain object! Currently it's: ".concat(typeof t,", equal to:\n").concat(d(t,4)));let n=T(T({},Ce),t),i=te(e.trim(),'"');if(i==="")return i;if(+e>0&&+e<1)return e;let a=new se;for(let o=0,l=i.length;o<l;o++){if(n.removeThousandSeparatorsFromNumbers&&i[o].trim()===""&&a.add(o,o+1),n.removeThousandSeparatorsFromNumbers&&i[o]==="'"&&(a.add(o,o+1),i[o+1]==="'")){s=!1;break}if(r.includes(i[o])){if(i[o+1]!==void 0&&/^\d$/.test(i[o+1]))if(i[o+2]!==void 0)if(/^\d$/.test(i[o+2]))if(i[o+3]!==void 0)if(/^\d$/.test(i[o+3])){if(i[o+4]!==void 0&&/^\d$/.test(i[o+4])){s=!1;break}else if(n.removeThousandSeparatorsFromNumbers&&a.add(o,o+1),!f)f=i[o];else if(i[o]!==f){s=!1;break}}else{s=!1;break}else n.removeThousandSeparatorsFromNumbers&&n.forceUKStyle&&i[o]===","&&a.add(o,o+1,".");else{s=!1;break}else n.forceUKStyle&&i[o]===","&&a.add(o,o+1,"."),n.padSingleDecimalPlaceNumbers&&a.add(o+2,o+2,"0")}else if(!/^\d$/.test(i[o])){s=!1;break}}return s&&a.current()?re(i,a.current()):i}var Ee={delimiter:",",removeThousandSeparatorsFromNumbers:!0,padSingleDecimalPlaceNumbers:!0,forceUKStyle:!1};function Oe(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ie(e,t){let s=0,r=e.length;for(;s<r&&e[s]!==t&&e[s].trim()==="";)s+=1;for(;r>s&&e[r-1]!==t&&e[r-1].trim()==="";)r-=1;return e.slice(s,r)}function oe(e,t){let s=0,r=0,f=[],n=[],i=!1,a=!0;if(t&&!Oe(t))throw new Error("csv-split-easy/splitEasy(): [THROW_ID_01] Options object must be a plain object! Currently it's of a type ".concat(typeof t," equal to:\n").concat(d(t,4)));let o=T(T({},Ee),t);if(typeof e!="string")throw new TypeError("csv-split-easy/splitEasy(): [THROW_ID_02] input must be string! Currently it's: ".concat(typeof e,", equal to: ").concat(d(e,4)));if(typeof o.delimiter!="string"||o.delimiter.length!==1||o.delimiter==='"'||o.delimiter==="\n"||o.delimiter==="\r")throw new TypeError('csv-split-easy/splitEasy(): [THROW_ID_03] The "delimiter" option must be a single character other than a double quote or a line break! Currently it\'s: '.concat(typeof o.delimiter,", equal to: ").concat(d(o.delimiter)));if(e==="")return[[""]];e=Ie(e,o.delimiter);for(let l=0,h=e.length;l<h;l++){if(a&&e[l]!=='"'&&e[l]!==o.delimiter&&e[l].trim()!==""&&(a=!1),e[l]==='"')if(i&&e[l+1]==='"')l+=1;else if(i){i=!1;let g=e.slice(s,l);g.trim()!==""&&(a=!1);let v=/""/.test(g)?g.replace(/""/g,'"'):W(g,{removeThousandSeparatorsFromNumbers:o.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:o.padSingleDecimalPlaceNumbers,forceUKStyle:o.forceUKStyle});f.push(v)}else i=!0,s=l+1;else if(!i&&e[l]===o.delimiter){if(e[l-1]!=='"'&&!i){let g=e.slice(s,l);g.trim()!==""&&(a=!1),f.push(W(g,{removeThousandSeparatorsFromNumbers:o.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:o.padSingleDecimalPlaceNumbers,forceUKStyle:o.forceUKStyle}))}s=l+1,r&&(r=0)}else if(e[l]==="\n"||e[l]==="\r"){if(!r){if(r=l,!i&&e[l-1]!=='"'){let g=e.slice(s,l);g.trim()!==""&&(a=!1),f.push(W(g,{removeThousandSeparatorsFromNumbers:o.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:o.padSingleDecimalPlaceNumbers,forceUKStyle:o.forceUKStyle}))}a?f.length=0:n.push(f),a=!0,f=[]}s=l+1}else r&&(r=0,s=l);if(l+1===h){if(e[l]!=='"'){let g=e.slice(s,l+1);g.trim()&&(a=!1),f.push(W(g,{removeThousandSeparatorsFromNumbers:o.removeThousandSeparatorsFromNumbers,padSingleDecimalPlaceNumbers:o.padSingleDecimalPlaceNumbers,forceUKStyle:o.forceUKStyle}))}a?f=[]:n.push(f),a=!0}}return n.length===0?[[""]]:n}var V=de(ie(),1);var le="7.2.2";function H(e){return typeof e=="number"&&!Number.isNaN(e)?!0:(e=(e||"").toString().trim(),e?!Number.isNaN(+e):!1)}var ke=["\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 _(e){return H(e)||ke.some(t=>H(e.replace(t,"").replace(/[,.]/g,"")))?"numeric":e.trim()?"text":"empty"}var Ve=le;function je(e){let t=null,s=null;if(typeof e!="string")throw new TypeError("csv-sort/sort(): [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(d(e,4)));if(!e.trim())return{res:[[""]],msgContent:t,msgType:s};let r=oe(e),f=[],n=!1,i=!0,a=[],o=null;for(let p=r.length-1;p>=0;p--)if(f.length){p===0&&(n=r[p].every(y=>{let $=_(y);return $==="text"||$==="empty"})),!n&&f.length!==r[p].length&&(i=!1);let c=null;for(let y=0,$=r[p].length;y<$;y++){let A=_(r[p][y].trim());if(c===null&&A==="empty"&&(c=y),c!==null&&A!=="empty"&&(c=null),A!==f[y]&&!n){let R=A;if(Array.isArray(f[y]))f[y].includes(R)||f[y].push(R);else if(f[y]!==R){let S=f[y];f[y]=[],f[y].push(S),f[y].push(R)}}}o!==null&&c!==null&&c>o&&(!n||n&&p!==0)&&(o=c)}else if(r[p].length!==1||r[p][0]!=="")for(let c=0,y=r[p].length;c<y;c++){let $=_(r[p][c].trim());f.push($),o===null&&$==="empty"&&(o=c),o!==null&&$!=="empty"&&(o=null)}o||(o=f.length);let l=0;for(let p=0,c=f.length;p<c&&f[p]==="empty";p++)l=p;l!==0&&(r=r.map(p=>p.slice(l+1,o)),f=f.slice(l+1,o));let h=[],g;f.forEach((p,c)=>{p==="numeric"&&h.push(c)});let v=n?1:0;if(h.length===1)g=h[0];else{if(h.length===0)throw new Error('csv-sort/sort(): [THROW_ID_02] Your CSV file does not contain numeric-only columns and computer was not able to detect the "Balance" column!');{let p=Array.from(h),c=[];for(let y=0,$=p.length;y<$;y++){let A=p[y],R,S=!0,I,C=!0;for(let D=v,ae=r.length;D<ae&&(S&&(R==null?R=r[D][A]:R===r[D][A]?(c.push(A),S=!1):R=r[D][A]),C&&(I==null?I=r[D][A]:r[D][A]!==I&&(C=!1)),!!S);D++);C&&a.push(A)}if(p=L(p,c),p.length===1)g=p[0];else if(p.length===0)throw new Error('csv-sort/sort(): [THROW_ID_03] 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(!g)throw new Error("csv-sort/sort(): [THROW_ID_04] Sadly computer couldn't find its way in this CSV and had to stop working on it.");let b=L(Array.from(f.reduce((p,c,y)=>((typeof c=="string"&&c==="numeric"||Array.isArray(c)&&c.includes("numeric"))&&p.push(y),p),[])),[g,...a]),u=[];u.push(r[r.length-1].slice(0,o));let m=[],w=n?1:0;for(let p=r.length-2;p>=w;p--)for(let c=r.length-2;c>=w;c--)if(!m.includes(c)){let y=!1;for(let $=0,A=b.length;$<A;$++){let R=null;r[c][b[$]]!==""&&(R=(0,V.default)(r[c][b[$]]));let S=null;r[c][g]!==""&&(S=(0,V.default)(r[c][g]));let I=null;u[0][g]!==""&&(I=(0,V.default)(u[0][g]).format());let C=null;u[u.length-1][b[$]]!==""&&(C=(0,V.default)(u[u.length-1][b[$]]).format());let D=null;if(u[u.length-1][g]!==""&&(D=(0,V.default)(u[u.length-1][g])),R&&S.add(R).format()===I){u.unshift(r[c].slice(0,o)),m.push(c),y=!0;break}else if(R&&S.subtract(R).format()===I){u.unshift(r[c].slice(0,o)),m.push(c),y=!0;break}else if(C&&D.add(C).format()===S.format()){u.push(r[c].slice(0,o)),m.push(c),y=!0;break}else if(C&&D.subtract(C).format()===S.format()){u.push(r[c].slice(0,o)),m.push(c),y=!0;break}}if(y){y=!1;break}}return n&&(i&&r[0].length>f.length&&(r[0].length=f.length),u.unshift(r[0].slice(0,o))),r.length-(n?2:1)!==m.length&&(t="Not all rows were recognised!",s="alert"),{res:u,msgContent:t,msgType:s}}return ye(Fe);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.8.0
14
+ * @version 1.9.0
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/codsen-utils/}
@@ -19,7 +19,7 @@
19
19
  /**
20
20
  * @name ranges-sort
21
21
  * @fileoverview Sort string index ranges
22
- * @version 6.2.0
22
+ * @version 6.2.1
23
23
  * @author Roy Revelt
24
24
  * @license MIT
25
25
  * {@link https://codsen.com/os/ranges-sort/}
@@ -27,7 +27,7 @@
27
27
  /**
28
28
  * @name ranges-merge
29
29
  * @fileoverview Merge and sort string index ranges
30
- * @version 9.2.1
30
+ * @version 9.2.2
31
31
  * @author Roy Revelt
32
32
  * @license MIT
33
33
  * {@link https://codsen.com/os/ranges-merge/}
@@ -35,7 +35,7 @@
35
35
  /**
36
36
  * @name ranges-apply
37
37
  * @fileoverview Take an array of string index ranges, delete/replace the string according to them
38
- * @version 7.2.1
38
+ * @version 7.2.2
39
39
  * @author Roy Revelt
40
40
  * @license MIT
41
41
  * {@link https://codsen.com/os/ranges-apply/}
@@ -51,7 +51,7 @@
51
51
  /**
52
52
  * @name ranges-push
53
53
  * @fileoverview Gather string index ranges
54
- * @version 7.2.0
54
+ * @version 7.2.1
55
55
  * @author Roy Revelt
56
56
  * @license MIT
57
57
  * {@link https://codsen.com/os/ranges-push/}
@@ -59,7 +59,7 @@
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.2.1
62
+ * @version 7.2.2
63
63
  * @author Roy Revelt
64
64
  * @license MIT
65
65
  * {@link https://codsen.com/os/string-remove-thousand-separators/}
@@ -67,21 +67,8 @@
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.2.1
70
+ * @version 7.2.2
71
71
  * @author Roy Revelt
72
72
  * @license MIT
73
73
  * {@link https://codsen.com/os/csv-split-easy/}
74
74
  */
75
- /*! Bundled license information:
76
-
77
- lodash-es/lodash.js:
78
- (**
79
- * @license
80
- * Lodash (Custom Build) <https://lodash.com/>
81
- * Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
82
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
83
- * Released under MIT license <https://lodash.com/license>
84
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
85
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
86
- *)
87
- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "csv-sort",
3
- "version": "7.2.1",
3
+ "version": "7.2.2",
4
4
  "description": "Sort double-entry bookkeeping CSV from internet banking",
5
5
  "keywords": [
6
6
  "accountancy",
@@ -74,13 +74,9 @@
74
74
  }
75
75
  },
76
76
  "dependencies": {
77
- "codsen-utils": "^1.8.0",
78
- "csv-split-easy": "^7.2.1",
79
- "currency.js": "^2.0.4",
80
- "lodash-es": "^4.18.1"
81
- },
82
- "devDependencies": {
83
- "@types/lodash-es": "^4.17.12"
77
+ "codsen-utils": "^1.9.0",
78
+ "csv-split-easy": "^7.2.2",
79
+ "currency.js": "^2.0.4"
84
80
  },
85
81
  "engines": {
86
82
  "node": ">=18.20.8"