@bicharts/chart-host 0.6.32 → 0.6.34

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.
@@ -18,44 +18,44 @@ var require_papaparse_min = __commonJS({
18
18
  https://github.com/mholt/PapaParse
19
19
  License: MIT
20
20
  */
21
- ((e, t) => {
22
- "function" == typeof define && define.amd ? define([], t) : "object" == typeof module && "undefined" != typeof exports ? module.exports = t() : e.Papa = t();
21
+ ((e, t2) => {
22
+ "function" == typeof define && define.amd ? define([], t2) : "object" == typeof module && "undefined" != typeof exports ? module.exports = t2() : e.Papa = t2();
23
23
  })(exports, function r() {
24
24
  var n = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== n ? n : {};
25
- var d2, s = !n.document && !!n.postMessage, a4 = n.IS_PAPA_WORKER || false, o = {}, h3 = 0, v4 = {};
26
- function P4(e) {
25
+ var d2, s = !n.document && !!n.postMessage, a2 = n.IS_PAPA_WORKER || false, o2 = {}, h3 = 0, v3 = {};
26
+ function P5(e) {
27
27
  return 65279 === e.charCodeAt(0) ? e.slice(1) : e;
28
28
  }
29
29
  function u2(e) {
30
30
  this._handle = null, this._finished = false, this._completed = false, this._halted = false, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = true, this._completeResults = { data: [], errors: [], meta: {} }, function(e2) {
31
- var t = b4(e2);
32
- t.chunkSize = parseInt(t.chunkSize), e2.step || e2.chunk || (t.chunkSize = null);
33
- this._handle = new i(t), (this._handle.streamer = this)._config = t;
34
- }.call(this, e), this.parseChunk = function(t, e2) {
31
+ var t2 = b2(e2);
32
+ t2.chunkSize = parseInt(t2.chunkSize), e2.step || e2.chunk || (t2.chunkSize = null);
33
+ this._handle = new i(t2), (this._handle.streamer = this)._config = t2;
34
+ }.call(this, e), this.parseChunk = function(t2, e2) {
35
35
  var i2 = parseInt(this._config.skipFirstNLines) || 0;
36
36
  if (this.isFirstChunk && 0 < i2) {
37
37
  let e4 = this._config.newline;
38
- e4 || (r2 = this._config.quoteChar || '"', e4 = this._handle.guessLineEndings(t, r2)), t = [...t.split(e4).slice(i2)].join(e4);
38
+ e4 || (r2 = this._config.quoteChar || '"', e4 = this._handle.guessLineEndings(t2, r2)), t2 = [...t2.split(e4).slice(i2)].join(e4);
39
39
  }
40
- this.isFirstChunk && q3(this._config.beforeFirstChunk) && void 0 !== (r2 = this._config.beforeFirstChunk(t)) && (t = r2), this.isFirstChunk = false, this._halted = false;
41
- var i2 = this._partialLine + t, r2 = (this._partialLine = "", this._handle.parse(i2, this._baseIndex, !this._finished));
40
+ this.isFirstChunk && q2(this._config.beforeFirstChunk) && void 0 !== (r2 = this._config.beforeFirstChunk(t2)) && (t2 = r2), this.isFirstChunk = false, this._halted = false;
41
+ var i2 = this._partialLine + t2, r2 = (this._partialLine = "", this._handle.parse(i2, this._baseIndex, !this._finished));
42
42
  if (!this._handle.paused() && !this._handle.aborted()) {
43
- t = r2.meta.cursor, i2 = (this._finished || (this._partialLine = i2.substring(t - this._baseIndex), this._baseIndex = t), r2 && r2.data && (this._rowCount += r2.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview);
44
- if (a4) n.postMessage({ results: r2, workerId: v4.WORKER_ID, finished: i2 });
45
- else if (q3(this._config.chunk) && !e2) {
43
+ t2 = r2.meta.cursor, i2 = (this._finished || (this._partialLine = i2.substring(t2 - this._baseIndex), this._baseIndex = t2), r2 && r2.data && (this._rowCount += r2.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview);
44
+ if (a2) n.postMessage({ results: r2, workerId: v3.WORKER_ID, finished: i2 });
45
+ else if (q2(this._config.chunk) && !e2) {
46
46
  if (this._config.chunk(r2, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = true);
47
47
  this._completeResults = r2 = void 0;
48
48
  }
49
- return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r2.data), this._completeResults.errors = this._completeResults.errors.concat(r2.errors), this._completeResults.meta = r2.meta), this._completed || !i2 || !q3(this._config.complete) || r2 && r2.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), i2 || r2 && r2.meta.paused || this._nextChunk(), r2;
49
+ return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r2.data), this._completeResults.errors = this._completeResults.errors.concat(r2.errors), this._completeResults.meta = r2.meta), this._completed || !i2 || !q2(this._config.complete) || r2 && r2.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), i2 || r2 && r2.meta.paused || this._nextChunk(), r2;
50
50
  }
51
51
  this._halted = true;
52
52
  }, this._sendError = function(e2) {
53
- q3(this._config.error) ? this._config.error(e2) : a4 && this._config.error && n.postMessage({ workerId: v4.WORKER_ID, error: e2, finished: false });
53
+ q2(this._config.error) ? this._config.error(e2) : a2 && this._config.error && n.postMessage({ workerId: v3.WORKER_ID, error: e2, finished: false });
54
54
  };
55
55
  }
56
56
  function f4(e) {
57
57
  var r2;
58
- (e = e || {}).chunkSize || (e.chunkSize = v4.RemoteChunkSize), u2.call(this, e), this._nextChunk = s ? function() {
58
+ (e = e || {}).chunkSize || (e.chunkSize = v3.RemoteChunkSize), u2.call(this, e), this._nextChunk = s ? function() {
59
59
  this._readChunk(), this._chunkLoaded();
60
60
  } : function() {
61
61
  this._readChunk();
@@ -64,9 +64,9 @@ var require_papaparse_min = __commonJS({
64
64
  }, this._readChunk = function() {
65
65
  if (this._finished) this._chunkLoaded();
66
66
  else {
67
- if (r2 = new XMLHttpRequest(), this._config.withCredentials && (r2.withCredentials = this._config.withCredentials), s || (r2.onload = y5(this._chunkLoaded, this), r2.onerror = y5(this._chunkError, this)), r2.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !s), this._config.downloadRequestHeaders) {
68
- var e2, t = this._config.downloadRequestHeaders;
69
- for (e2 in t) r2.setRequestHeader(e2, t[e2]);
67
+ if (r2 = new XMLHttpRequest(), this._config.withCredentials && (r2.withCredentials = this._config.withCredentials), s || (r2.onload = y4(this._chunkLoaded, this), r2.onerror = y4(this._chunkError, this)), r2.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !s), this._config.downloadRequestHeaders) {
68
+ var e2, t2 = this._config.downloadRequestHeaders;
69
+ for (e2 in t2) r2.setRequestHeader(e2, t2[e2]);
70
70
  }
71
71
  var i2;
72
72
  this._config.chunkSize && (i2 = this._start + this._config.chunkSize - 1, r2.setRequestHeader("Range", "bytes=" + this._start + "-" + i2));
@@ -85,15 +85,15 @@ var require_papaparse_min = __commonJS({
85
85
  };
86
86
  }
87
87
  function l(e) {
88
- (e = e || {}).chunkSize || (e.chunkSize = v4.LocalChunkSize), u2.call(this, e);
88
+ (e = e || {}).chunkSize || (e.chunkSize = v3.LocalChunkSize), u2.call(this, e);
89
89
  var i2, r2, n2 = "undefined" != typeof FileReader;
90
90
  this.stream = function(e2) {
91
- this._input = e2, r2 = e2.slice || e2.webkitSlice || e2.mozSlice, n2 ? ((i2 = new FileReader()).onload = y5(this._chunkLoaded, this), i2.onerror = y5(this._chunkError, this)) : i2 = new FileReaderSync(), this._nextChunk();
91
+ this._input = e2, r2 = e2.slice || e2.webkitSlice || e2.mozSlice, n2 ? ((i2 = new FileReader()).onload = y4(this._chunkLoaded, this), i2.onerror = y4(this._chunkError, this)) : i2 = new FileReaderSync(), this._nextChunk();
92
92
  }, this._nextChunk = function() {
93
93
  this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
94
94
  }, this._readChunk = function() {
95
- var e2 = this._input, t = (this._config.chunkSize && (t = Math.min(this._start + this._config.chunkSize, this._input.size), e2 = r2.call(e2, this._start, t)), i2.readAsText(e2, this._config.encoding));
96
- n2 || this._chunkLoaded({ target: { result: t } });
95
+ var e2 = this._input, t2 = (this._config.chunkSize && (t2 = Math.min(this._start + this._config.chunkSize, this._input.size), e2 = r2.call(e2, this._start, t2)), i2.readAsText(e2, this._config.encoding));
96
+ n2 || this._chunkLoaded({ target: { result: t2 } });
97
97
  }, this._chunkLoaded = function(e2) {
98
98
  this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(e2.target.result);
99
99
  }, this._chunkError = function() {
@@ -105,13 +105,13 @@ var require_papaparse_min = __commonJS({
105
105
  u2.call(this, e = e || {}), this.stream = function(e2) {
106
106
  return i2 = e2, this._nextChunk();
107
107
  }, this._nextChunk = function() {
108
- var e2, t;
109
- if (!this._finished) return e2 = this._config.chunkSize, i2 = e2 ? (t = i2.substring(0, e2), i2.substring(e2)) : (t = i2, ""), this._finished = !i2, this.parseChunk(t);
108
+ var e2, t2;
109
+ if (!this._finished) return e2 = this._config.chunkSize, i2 = e2 ? (t2 = i2.substring(0, e2), i2.substring(e2)) : (t2 = i2, ""), this._finished = !i2, this.parseChunk(t2);
110
110
  };
111
111
  }
112
112
  function p2(e) {
113
113
  u2.call(this, e = e || {});
114
- var t = [], i2 = true, r2 = false;
114
+ var t2 = [], i2 = true, r2 = false;
115
115
  this.pause = function() {
116
116
  u2.prototype.pause.apply(this, arguments), this._input.pause();
117
117
  }, this.resume = function() {
@@ -119,89 +119,89 @@ var require_papaparse_min = __commonJS({
119
119
  }, this.stream = function(e2) {
120
120
  this._input = e2, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
121
121
  }, this._checkIsFinished = function() {
122
- r2 && 1 === t.length && (this._finished = true);
122
+ r2 && 1 === t2.length && (this._finished = true);
123
123
  }, this._nextChunk = function() {
124
- this._checkIsFinished(), t.length ? this.parseChunk(t.shift()) : i2 = true;
125
- }, this._streamData = y5(function(e2) {
124
+ this._checkIsFinished(), t2.length ? this.parseChunk(t2.shift()) : i2 = true;
125
+ }, this._streamData = y4(function(e2) {
126
126
  try {
127
- t.push("string" == typeof e2 ? e2 : e2.toString(this._config.encoding)), i2 && (i2 = false, this._checkIsFinished(), this.parseChunk(t.shift()));
127
+ t2.push("string" == typeof e2 ? e2 : e2.toString(this._config.encoding)), i2 && (i2 = false, this._checkIsFinished(), this.parseChunk(t2.shift()));
128
128
  } catch (e4) {
129
129
  this._streamError(e4);
130
130
  }
131
- }, this), this._streamError = y5(function(e2) {
131
+ }, this), this._streamError = y4(function(e2) {
132
132
  this._streamCleanUp(), this._sendError(e2);
133
- }, this), this._streamEnd = y5(function() {
133
+ }, this), this._streamEnd = y4(function() {
134
134
  this._streamCleanUp(), r2 = true, this._streamData("");
135
- }, this), this._streamCleanUp = y5(function() {
135
+ }, this), this._streamCleanUp = y4(function() {
136
136
  this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
137
137
  }, this);
138
138
  }
139
- function i(m2) {
140
- var n2, s2, a5, t, o2 = Math.pow(2, 53), h4 = -o2, u4 = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, d3 = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, i2 = this, r2 = 0, f5 = 0, l2 = false, e = false, c4 = [], p4 = { data: [], errors: [], meta: {} };
141
- function y6(e2) {
142
- return "greedy" === m2.skipEmptyLines ? "" === e2.join("").trim() : 1 === e2.length && 0 === e2[0].length;
139
+ function i(m4) {
140
+ var n2, s2, a4, t2, o4 = Math.pow(2, 53), h4 = -o4, u4 = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, d3 = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, i2 = this, r2 = 0, f5 = 0, l2 = false, e = false, c4 = [], p4 = { data: [], errors: [], meta: {} };
141
+ function y5(e2) {
142
+ return "greedy" === m4.skipEmptyLines ? "" === e2.join("").trim() : 1 === e2.length && 0 === e2[0].length;
143
143
  }
144
144
  function g4() {
145
- if (p4 && a5 && (k3("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + v4.DefaultDelimiter + "'"), a5 = false), m2.skipEmptyLines && (p4.data = p4.data.filter(function(e4) {
146
- return !y6(e4);
147
- })), _3()) {
148
- let t4 = function(e4, t5) {
149
- e4 = P4(e4), q3(m2.transformHeader) && (e4 = m2.transformHeader(e4, t5)), c4.push(e4);
145
+ if (p4 && a4 && (k3("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + v3.DefaultDelimiter + "'"), a4 = false), m4.skipEmptyLines && (p4.data = p4.data.filter(function(e4) {
146
+ return !y5(e4);
147
+ })), _4()) {
148
+ let t5 = function(e4, t6) {
149
+ e4 = P5(e4), q2(m4.transformHeader) && (e4 = m4.transformHeader(e4, t6)), c4.push(e4);
150
150
  };
151
- var t2 = t4;
151
+ var t4 = t5;
152
152
  if (p4) if (Array.isArray(p4.data[0])) {
153
- for (var e2 = 0; _3() && e2 < p4.data.length; e2++) p4.data[e2].forEach(t4);
153
+ for (var e2 = 0; _4() && e2 < p4.data.length; e2++) p4.data[e2].forEach(t5);
154
154
  p4.data.splice(0, 1);
155
- } else p4.data.forEach(t4);
155
+ } else p4.data.forEach(t5);
156
156
  }
157
- function i4(e4, t4) {
158
- for (var i5 = m2.header ? {} : [], r5 = 0; r5 < e4.length; r5++) {
159
- var n4 = r5, s4 = e4[r5], s4 = ((e5, t5) => ((e6) => (m2.dynamicTypingFunction && void 0 === m2.dynamicTyping[e6] && (m2.dynamicTyping[e6] = m2.dynamicTypingFunction(e6)), true === (m2.dynamicTyping[e6] || m2.dynamicTyping)))(e5) ? "true" === t5 || "TRUE" === t5 || "false" !== t5 && "FALSE" !== t5 && (((e6) => {
157
+ function i4(e4, t5) {
158
+ for (var i5 = m4.header ? {} : [], r5 = 0; r5 < e4.length; r5++) {
159
+ var n4 = r5, s4 = e4[r5], s4 = ((e5, t6) => ((e6) => (m4.dynamicTypingFunction && void 0 === m4.dynamicTyping[e6] && (m4.dynamicTyping[e6] = m4.dynamicTypingFunction(e6)), true === (m4.dynamicTyping[e6] || m4.dynamicTyping)))(e5) ? "true" === t6 || "TRUE" === t6 || "false" !== t6 && "FALSE" !== t6 && (((e6) => {
160
160
  if (u4.test(e6)) {
161
161
  e6 = parseFloat(e6);
162
- if (h4 < e6 && e6 < o2) return 1;
162
+ if (h4 < e6 && e6 < o4) return 1;
163
163
  }
164
- })(t5) ? parseFloat(t5) : d3.test(t5) ? new Date(t5) : "" === t5 ? null : t5) : t5)(n4 = m2.header ? r5 >= c4.length ? "__parsed_extra" : c4[r5] : n4, s4 = m2.transform ? m2.transform(s4, n4) : s4);
164
+ })(t6) ? parseFloat(t6) : d3.test(t6) ? new Date(t6) : "" === t6 ? null : t6) : t6)(n4 = m4.header ? r5 >= c4.length ? "__parsed_extra" : c4[r5] : n4, s4 = m4.transform ? m4.transform(s4, n4) : s4);
165
165
  "__parsed_extra" === n4 ? (i5[n4] = i5[n4] || [], i5[n4].push(s4)) : i5[n4] = s4;
166
166
  }
167
- return m2.header && (r5 > c4.length ? k3("FieldMismatch", "TooManyFields", "Too many fields: expected " + c4.length + " fields but parsed " + r5, f5 + t4) : r5 < c4.length && k3("FieldMismatch", "TooFewFields", "Too few fields: expected " + c4.length + " fields but parsed " + r5, f5 + t4)), i5;
167
+ return m4.header && (r5 > c4.length ? k3("FieldMismatch", "TooManyFields", "Too many fields: expected " + c4.length + " fields but parsed " + r5, f5 + t5) : r5 < c4.length && k3("FieldMismatch", "TooFewFields", "Too few fields: expected " + c4.length + " fields but parsed " + r5, f5 + t5)), i5;
168
168
  }
169
169
  var r4;
170
- p4 && (m2.header || m2.dynamicTyping || m2.transform) && (r4 = 1, !p4.data.length || Array.isArray(p4.data[0]) ? (p4.data = p4.data.map(i4), r4 = p4.data.length) : p4.data = i4(p4.data, 0), m2.header && p4.meta && (p4.meta.fields = c4), f5 += r4);
170
+ p4 && (m4.header || m4.dynamicTyping || m4.transform) && (r4 = 1, !p4.data.length || Array.isArray(p4.data[0]) ? (p4.data = p4.data.map(i4), r4 = p4.data.length) : p4.data = i4(p4.data, 0), m4.header && p4.meta && (p4.meta.fields = c4), f5 += r4);
171
171
  }
172
- function _3() {
173
- return m2.header && 0 === c4.length;
172
+ function _4() {
173
+ return m4.header && 0 === c4.length;
174
174
  }
175
- function k3(e2, t2, i4, r4) {
176
- e2 = { type: e2, code: t2, message: i4 };
175
+ function k3(e2, t4, i4, r4) {
176
+ e2 = { type: e2, code: t4, message: i4 };
177
177
  void 0 !== r4 && (e2.row = r4), p4.errors.push(e2);
178
178
  }
179
- q3(m2.step) && (t = m2.step, m2.step = function(e2) {
180
- p4 = e2, _3() ? g4() : (g4(), 0 !== p4.data.length && (r2 += e2.data.length, m2.preview && r2 > m2.preview ? s2.abort() : (p4.data = p4.data[0], t(p4, i2))));
181
- }), this.parse = function(e2, t2, i4) {
182
- var r4 = m2.quoteChar || '"', r4 = (m2.newline || (m2.newline = this.guessLineEndings(e2, r4)), a5 = false, m2.delimiter ? q3(m2.delimiter) && (m2.delimiter = m2.delimiter(e2), p4.meta.delimiter = m2.delimiter) : ((r4 = ((e4, t4, i5, r5, n4) => {
183
- var s4, a6, o4, h5;
184
- n4 = n4 || [",", " ", "|", ";", v4.RECORD_SEP, v4.UNIT_SEP];
179
+ q2(m4.step) && (t2 = m4.step, m4.step = function(e2) {
180
+ p4 = e2, _4() ? g4() : (g4(), 0 !== p4.data.length && (r2 += e2.data.length, m4.preview && r2 > m4.preview ? s2.abort() : (p4.data = p4.data[0], t2(p4, i2))));
181
+ }), this.parse = function(e2, t4, i4) {
182
+ var r4 = m4.quoteChar || '"', r4 = (m4.newline || (m4.newline = this.guessLineEndings(e2, r4)), a4 = false, m4.delimiter ? q2(m4.delimiter) && (m4.delimiter = m4.delimiter(e2), p4.meta.delimiter = m4.delimiter) : ((r4 = ((e4, t5, i5, r5, n4) => {
183
+ var s4, a5, o5, h5;
184
+ n4 = n4 || [",", " ", "|", ";", v3.RECORD_SEP, v3.UNIT_SEP];
185
185
  for (var u5 = 0; u5 < n4.length; u5++) {
186
- for (var d4, f6 = n4[u5], l3 = 0, c5 = 0, p5 = 0, g5 = (o4 = void 0, new E4({ comments: r5, delimiter: f6, newline: t4, preview: 10 }).parse(e4)), _4 = 0; _4 < g5.data.length; _4++) i5 && y6(g5.data[_4]) ? p5++ : (d4 = g5.data[_4].length, c5 += d4, void 0 === o4 ? o4 = d4 : 0 < d4 && (l3 += Math.abs(d4 - o4), o4 = d4));
187
- 0 < g5.data.length && (c5 /= g5.data.length - p5), (void 0 === a6 || l3 <= a6) && (void 0 === h5 || h5 < c5) && 1.99 < c5 && (a6 = l3, s4 = f6, h5 = c5);
186
+ for (var d4, f6 = n4[u5], l3 = 0, c5 = 0, p5 = 0, g5 = (o5 = void 0, new E4({ comments: r5, delimiter: f6, newline: t5, preview: 10 }).parse(e4)), _5 = 0; _5 < g5.data.length; _5++) i5 && y5(g5.data[_5]) ? p5++ : (d4 = g5.data[_5].length, c5 += d4, void 0 === o5 ? o5 = d4 : 0 < d4 && (l3 += Math.abs(d4 - o5), o5 = d4));
187
+ 0 < g5.data.length && (c5 /= g5.data.length - p5), (void 0 === a5 || l3 <= a5) && (void 0 === h5 || h5 < c5) && 1.99 < c5 && (a5 = l3, s4 = f6, h5 = c5);
188
188
  }
189
- return { successful: !!(m2.delimiter = s4), bestDelimiter: s4 };
190
- })(e2, m2.newline, m2.skipEmptyLines, m2.comments, m2.delimitersToGuess)).successful ? m2.delimiter = r4.bestDelimiter : (a5 = true, m2.delimiter = v4.DefaultDelimiter), p4.meta.delimiter = m2.delimiter), b4(m2));
191
- return m2.preview && m2.header && r4.preview++, n2 = e2, s2 = new E4(r4), p4 = s2.parse(n2, t2, i4), g4(), l2 ? { meta: { paused: true } } : p4 || { meta: { paused: false } };
189
+ return { successful: !!(m4.delimiter = s4), bestDelimiter: s4 };
190
+ })(e2, m4.newline, m4.skipEmptyLines, m4.comments, m4.delimitersToGuess)).successful ? m4.delimiter = r4.bestDelimiter : (a4 = true, m4.delimiter = v3.DefaultDelimiter), p4.meta.delimiter = m4.delimiter), b2(m4));
191
+ return m4.preview && m4.header && r4.preview++, n2 = e2, s2 = new E4(r4), p4 = s2.parse(n2, t4, i4), g4(), l2 ? { meta: { paused: true } } : p4 || { meta: { paused: false } };
192
192
  }, this.paused = function() {
193
193
  return l2;
194
194
  }, this.pause = function() {
195
- l2 = true, s2.abort(), n2 = q3(m2.chunk) ? "" : n2.substring(s2.getCharIndex());
195
+ l2 = true, s2.abort(), n2 = q2(m4.chunk) ? "" : n2.substring(s2.getCharIndex());
196
196
  }, this.resume = function() {
197
197
  i2.streamer._halted ? (l2 = false, i2.streamer.parseChunk(n2, true)) : setTimeout(i2.resume, 3);
198
198
  }, this.aborted = function() {
199
199
  return e;
200
200
  }, this.abort = function() {
201
- e = true, s2.abort(), p4.meta.aborted = true, q3(m2.complete) && m2.complete(p4), n2 = "";
202
- }, this.guessLineEndings = function(e2, t2) {
201
+ e = true, s2.abort(), p4.meta.aborted = true, q2(m4.complete) && m4.complete(p4), n2 = "";
202
+ }, this.guessLineEndings = function(e2, t4) {
203
203
  e2 = e2.substring(0, 1048576);
204
- var t2 = new RegExp(U4(t2) + "([^]*?)" + U4(t2), "gm"), i4 = (e2 = e2.replace(t2, "")).split("\r"), t2 = e2.split("\n"), e2 = 1 < t2.length && t2[0].length < i4[0].length;
204
+ var t4 = new RegExp(U4(t4) + "([^]*?)" + U4(t4), "gm"), i4 = (e2 = e2.replace(t4, "")).split("\r"), t4 = e2.split("\n"), e2 = 1 < t4.length && t4[0].length < i4[0].length;
205
205
  if (1 === i4.length || e2) return "\n";
206
206
  for (var r4 = 0, n4 = 0; n4 < i4.length; n4++) "\n" === i4[n4][0] && r4++;
207
207
  return r4 >= i4.length / 2 ? "\r\n" : "\r";
@@ -210,226 +210,226 @@ var require_papaparse_min = __commonJS({
210
210
  function U4(e) {
211
211
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
212
212
  }
213
- function E4(C2) {
214
- var S = (C2 = C2 || {}).delimiter, O3 = C2.newline, x2 = C2.comments, I4 = C2.step, A2 = C2.preview, T4 = C2.fastMode, D3 = null, L4 = false, F3 = null == C2.quoteChar ? '"' : C2.quoteChar, j3 = F3;
215
- if (void 0 !== C2.escapeChar && (j3 = C2.escapeChar), ("string" != typeof S || -1 < v4.BAD_DELIMITERS.indexOf(S)) && (S = ","), x2 === S) throw new Error("Comment character same as delimiter");
216
- true === x2 ? x2 = "#" : ("string" != typeof x2 || -1 < v4.BAD_DELIMITERS.indexOf(x2)) && (x2 = false), "\n" !== O3 && "\r" !== O3 && "\r\n" !== O3 && (O3 = "\n");
217
- var z4 = 0, M = false;
218
- this.parse = function(i2, t, r2) {
213
+ function E4(C) {
214
+ var S2 = (C = C || {}).delimiter, O3 = C.newline, x3 = C.comments, I2 = C.step, A2 = C.preview, T2 = C.fastMode, D3 = null, L5 = false, F3 = null == C.quoteChar ? '"' : C.quoteChar, j5 = F3;
215
+ if (void 0 !== C.escapeChar && (j5 = C.escapeChar), ("string" != typeof S2 || -1 < v3.BAD_DELIMITERS.indexOf(S2)) && (S2 = ","), x3 === S2) throw new Error("Comment character same as delimiter");
216
+ true === x3 ? x3 = "#" : ("string" != typeof x3 || -1 < v3.BAD_DELIMITERS.indexOf(x3)) && (x3 = false), "\n" !== O3 && "\r" !== O3 && "\r\n" !== O3 && (O3 = "\n");
217
+ var z3 = 0, M2 = false;
218
+ this.parse = function(i2, t2, r2) {
219
219
  if ("string" != typeof i2) throw new Error("Input must be a string");
220
- var n2 = i2.length, e = S.length, s2 = O3.length, a5 = x2.length, o2 = q3(I4), h4 = [], u4 = [], d3 = [], f5 = z4 = 0;
220
+ var n2 = i2.length, e = S2.length, s2 = O3.length, a4 = x3.length, o4 = q2(I2), h4 = [], u4 = [], d3 = [], f5 = z3 = 0;
221
221
  if (!i2) return w3();
222
- if (T4 || false !== T4 && -1 === i2.indexOf(F3)) {
222
+ if (T2 || false !== T2 && -1 === i2.indexOf(F3)) {
223
223
  for (var l2 = i2.split(O3), c4 = 0; c4 < l2.length; c4++) {
224
- if (d3 = l2[c4], z4 += d3.length, c4 !== l2.length - 1) z4 += O3.length;
224
+ if (d3 = l2[c4], z3 += d3.length, c4 !== l2.length - 1) z3 += O3.length;
225
225
  else if (r2) return w3();
226
- if (!x2 || d3.substring(0, a5) !== x2) {
227
- if (o2) {
228
- if (h4 = [], k3(d3.split(S)), R2(), M) return w3();
229
- } else k3(d3.split(S));
226
+ if (!x3 || d3.substring(0, a4) !== x3) {
227
+ if (o4) {
228
+ if (h4 = [], k3(d3.split(S2)), R2(), M2) return w3();
229
+ } else k3(d3.split(S2));
230
230
  if (A2 && A2 <= c4) return h4 = h4.slice(0, A2), w3(true);
231
231
  }
232
232
  }
233
233
  return w3();
234
234
  }
235
- for (var p4 = i2.indexOf(S, z4), g4 = i2.indexOf(O3, z4), _3 = new RegExp(U4(j3) + U4(F3), "g"), m2 = i2.indexOf(F3, z4); ; ) if (i2[z4] === F3) for (m2 = z4, z4++; ; ) {
236
- if (-1 === (m2 = i2.indexOf(F3, m2 + 1))) return r2 || u4.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h4.length, index: z4 }), E5();
237
- if (m2 === n2 - 1) return E5(i2.substring(z4, m2).replace(_3, F3));
238
- if (F3 === j3 && i2[m2 + 1] === j3) m2++;
239
- else if (F3 === j3 || 0 === m2 || i2[m2 - 1] !== j3) {
240
- -1 !== p4 && p4 < m2 + 1 && (p4 = i2.indexOf(S, m2 + 1));
241
- var y6 = v5(-1 === (g4 = -1 !== g4 && g4 < m2 + 1 ? i2.indexOf(O3, m2 + 1) : g4) ? p4 : Math.min(p4, g4));
242
- if (i2.substr(m2 + 1 + y6, e) === S) {
243
- d3.push(i2.substring(z4, m2).replace(_3, F3)), i2[z4 = m2 + 1 + y6 + e] !== F3 && (m2 = i2.indexOf(F3, z4)), p4 = i2.indexOf(S, z4), g4 = i2.indexOf(O3, z4);
235
+ for (var p4 = i2.indexOf(S2, z3), g4 = i2.indexOf(O3, z3), _4 = new RegExp(U4(j5) + U4(F3), "g"), m4 = i2.indexOf(F3, z3); ; ) if (i2[z3] === F3) for (m4 = z3, z3++; ; ) {
236
+ if (-1 === (m4 = i2.indexOf(F3, m4 + 1))) return r2 || u4.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h4.length, index: z3 }), E5();
237
+ if (m4 === n2 - 1) return E5(i2.substring(z3, m4).replace(_4, F3));
238
+ if (F3 === j5 && i2[m4 + 1] === j5) m4++;
239
+ else if (F3 === j5 || 0 === m4 || i2[m4 - 1] !== j5) {
240
+ -1 !== p4 && p4 < m4 + 1 && (p4 = i2.indexOf(S2, m4 + 1));
241
+ var y5 = v4(-1 === (g4 = -1 !== g4 && g4 < m4 + 1 ? i2.indexOf(O3, m4 + 1) : g4) ? p4 : Math.min(p4, g4));
242
+ if (i2.substr(m4 + 1 + y5, e) === S2) {
243
+ d3.push(i2.substring(z3, m4).replace(_4, F3)), i2[z3 = m4 + 1 + y5 + e] !== F3 && (m4 = i2.indexOf(F3, z3)), p4 = i2.indexOf(S2, z3), g4 = i2.indexOf(O3, z3);
244
244
  break;
245
245
  }
246
- y6 = v5(g4);
247
- if (i2.substring(m2 + 1 + y6, m2 + 1 + y6 + s2) === O3) {
248
- if (d3.push(i2.substring(z4, m2).replace(_3, F3)), b5(m2 + 1 + y6 + s2), p4 = i2.indexOf(S, z4), m2 = i2.indexOf(F3, z4), o2 && (R2(), M)) return w3();
246
+ y5 = v4(g4);
247
+ if (i2.substring(m4 + 1 + y5, m4 + 1 + y5 + s2) === O3) {
248
+ if (d3.push(i2.substring(z3, m4).replace(_4, F3)), b4(m4 + 1 + y5 + s2), p4 = i2.indexOf(S2, z3), m4 = i2.indexOf(F3, z3), o4 && (R2(), M2)) return w3();
249
249
  if (A2 && h4.length >= A2) return w3(true);
250
250
  break;
251
251
  }
252
- u4.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: h4.length, index: z4 }), m2++;
252
+ u4.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: h4.length, index: z3 }), m4++;
253
253
  }
254
254
  }
255
- else if (x2 && 0 === d3.length && i2.substring(z4, z4 + a5) === x2) {
255
+ else if (x3 && 0 === d3.length && i2.substring(z3, z3 + a4) === x3) {
256
256
  if (-1 === g4) return w3();
257
- z4 = g4 + s2, g4 = i2.indexOf(O3, z4), p4 = i2.indexOf(S, z4);
258
- } else if (-1 !== p4 && (p4 < g4 || -1 === g4)) d3.push(i2.substring(z4, p4)), z4 = p4 + e, p4 = i2.indexOf(S, z4);
257
+ z3 = g4 + s2, g4 = i2.indexOf(O3, z3), p4 = i2.indexOf(S2, z3);
258
+ } else if (-1 !== p4 && (p4 < g4 || -1 === g4)) d3.push(i2.substring(z3, p4)), z3 = p4 + e, p4 = i2.indexOf(S2, z3);
259
259
  else {
260
260
  if (-1 === g4) break;
261
- if (d3.push(i2.substring(z4, g4)), b5(g4 + s2), o2 && (R2(), M)) return w3();
261
+ if (d3.push(i2.substring(z3, g4)), b4(g4 + s2), o4 && (R2(), M2)) return w3();
262
262
  if (A2 && h4.length >= A2) return w3(true);
263
263
  }
264
264
  return E5();
265
265
  function k3(e2) {
266
- h4.push(e2), f5 = z4;
266
+ h4.push(e2), f5 = z3;
267
267
  }
268
- function v5(e2) {
269
- var t2 = 0;
270
- return t2 = -1 !== e2 && (e2 = i2.substring(m2 + 1, e2)) && "" === e2.trim() ? e2.length : t2;
268
+ function v4(e2) {
269
+ var t4 = 0;
270
+ return t4 = -1 !== e2 && (e2 = i2.substring(m4 + 1, e2)) && "" === e2.trim() ? e2.length : t4;
271
271
  }
272
272
  function E5(e2) {
273
- return r2 || (void 0 === e2 && (e2 = i2.substring(z4)), d3.push(e2), z4 = n2, k3(d3), o2 && R2()), w3();
273
+ return r2 || (void 0 === e2 && (e2 = i2.substring(z3)), d3.push(e2), z3 = n2, k3(d3), o4 && R2()), w3();
274
274
  }
275
- function b5(e2) {
276
- z4 = e2, k3(d3), d3 = [], g4 = i2.indexOf(O3, z4);
275
+ function b4(e2) {
276
+ z3 = e2, k3(d3), d3 = [], g4 = i2.indexOf(O3, z3);
277
277
  }
278
278
  function w3(e2) {
279
- if (C2.header && !t && h4.length && !L4) {
280
- var s4 = h4[0], a6 = /* @__PURE__ */ Object.create(null), o4 = new Set(s4);
279
+ if (C.header && !t2 && h4.length && !L5) {
280
+ var s4 = h4[0], a5 = /* @__PURE__ */ Object.create(null), o5 = new Set(s4);
281
281
  let n4 = false;
282
282
  for (let r4 = 0; r4 < s4.length; r4++) {
283
- let i4 = P4(s4[r4]);
284
- if (a6[i4 = q3(C2.transformHeader) ? C2.transformHeader(i4, r4) : i4]) {
285
- let e4, t2 = a6[i4];
286
- for (; e4 = i4 + "_" + t2, t2++, o4.has(e4); ) ;
287
- o4.add(e4), s4[r4] = e4, a6[i4]++, n4 = true, (D3 = null === D3 ? {} : D3)[e4] = i4;
288
- } else a6[i4] = 1, s4[r4] = i4;
289
- o4.add(i4);
283
+ let i4 = P5(s4[r4]);
284
+ if (a5[i4 = q2(C.transformHeader) ? C.transformHeader(i4, r4) : i4]) {
285
+ let e4, t4 = a5[i4];
286
+ for (; e4 = i4 + "_" + t4, t4++, o5.has(e4); ) ;
287
+ o5.add(e4), s4[r4] = e4, a5[i4]++, n4 = true, (D3 = null === D3 ? {} : D3)[e4] = i4;
288
+ } else a5[i4] = 1, s4[r4] = i4;
289
+ o5.add(i4);
290
290
  }
291
- n4 && console.warn("Duplicate headers found and renamed."), L4 = true;
291
+ n4 && console.warn("Duplicate headers found and renamed."), L5 = true;
292
292
  }
293
- return { data: h4, errors: u4, meta: { delimiter: S, linebreak: O3, aborted: M, truncated: !!e2, cursor: f5 + (t || 0), renamedHeaders: D3 } };
293
+ return { data: h4, errors: u4, meta: { delimiter: S2, linebreak: O3, aborted: M2, truncated: !!e2, cursor: f5 + (t2 || 0), renamedHeaders: D3 } };
294
294
  }
295
295
  function R2() {
296
- I4(w3()), h4 = [], u4 = [];
296
+ I2(w3()), h4 = [], u4 = [];
297
297
  }
298
298
  }, this.abort = function() {
299
- M = true;
299
+ M2 = true;
300
300
  }, this.getCharIndex = function() {
301
- return z4;
301
+ return z3;
302
302
  };
303
303
  }
304
304
  function g3(e) {
305
- var t = e.data, i2 = o[t.workerId], r2 = false;
306
- if (t.error) i2.userError(t.error, t.file);
307
- else if (t.results && t.results.data) {
305
+ var t2 = e.data, i2 = o2[t2.workerId], r2 = false;
306
+ if (t2.error) i2.userError(t2.error, t2.file);
307
+ else if (t2.results && t2.results.data) {
308
308
  var n2 = { abort: function() {
309
- r2 = true, _2(t.workerId, { data: [], errors: [], meta: { aborted: true } });
310
- }, pause: m, resume: m };
311
- if (q3(i2.userStep)) {
312
- for (var s2 = 0; s2 < t.results.data.length && (i2.userStep({ data: t.results.data[s2], errors: t.results.errors, meta: t.results.meta }, n2), !r2); s2++) ;
313
- delete t.results;
314
- } else q3(i2.userChunk) && (i2.userChunk(t.results, n2, t.file), delete t.results);
309
+ r2 = true, _3(t2.workerId, { data: [], errors: [], meta: { aborted: true } });
310
+ }, pause: m2, resume: m2 };
311
+ if (q2(i2.userStep)) {
312
+ for (var s2 = 0; s2 < t2.results.data.length && (i2.userStep({ data: t2.results.data[s2], errors: t2.results.errors, meta: t2.results.meta }, n2), !r2); s2++) ;
313
+ delete t2.results;
314
+ } else q2(i2.userChunk) && (i2.userChunk(t2.results, n2, t2.file), delete t2.results);
315
315
  }
316
- t.finished && !r2 && _2(t.workerId, t.results);
316
+ t2.finished && !r2 && _3(t2.workerId, t2.results);
317
317
  }
318
- function _2(e, t) {
319
- var i2 = o[e];
320
- q3(i2.userComplete) && i2.userComplete(t), i2.terminate(), delete o[e];
318
+ function _3(e, t2) {
319
+ var i2 = o2[e];
320
+ q2(i2.userComplete) && i2.userComplete(t2), i2.terminate(), delete o2[e];
321
321
  }
322
- function m() {
322
+ function m2() {
323
323
  throw new Error("Not implemented.");
324
324
  }
325
- function b4(e) {
325
+ function b2(e) {
326
326
  if ("object" != typeof e || null === e) return e;
327
- var t, i2 = Array.isArray(e) ? [] : {};
328
- for (t in e) i2[t] = b4(e[t]);
327
+ var t2, i2 = Array.isArray(e) ? [] : {};
328
+ for (t2 in e) i2[t2] = b2(e[t2]);
329
329
  return i2;
330
330
  }
331
- function y5(e, t) {
331
+ function y4(e, t2) {
332
332
  return function() {
333
- e.apply(t, arguments);
333
+ e.apply(t2, arguments);
334
334
  };
335
335
  }
336
- function q3(e) {
336
+ function q2(e) {
337
337
  return "function" == typeof e;
338
338
  }
339
- return v4.parse = function(e, t) {
340
- var i2 = (t = t || {}).dynamicTyping || false;
341
- q3(i2) && (t.dynamicTypingFunction = i2, i2 = {});
342
- if (t.dynamicTyping = i2, t.transform = !!q3(t.transform) && t.transform, !t.worker || !v4.WORKERS_SUPPORTED) return i2 = null, v4.NODE_STREAM_INPUT, "string" == typeof e ? (e = P4(e), i2 = new (t.download ? f4 : c2)(t)) : true === e.readable && q3(e.read) && q3(e.on) ? i2 = new p2(t) : (n.File && e instanceof File || e instanceof Object) && (i2 = new l(t)), i2.stream(e);
339
+ return v3.parse = function(e, t2) {
340
+ var i2 = (t2 = t2 || {}).dynamicTyping || false;
341
+ q2(i2) && (t2.dynamicTypingFunction = i2, i2 = {});
342
+ if (t2.dynamicTyping = i2, t2.transform = !!q2(t2.transform) && t2.transform, !t2.worker || !v3.WORKERS_SUPPORTED) return i2 = null, v3.NODE_STREAM_INPUT, "string" == typeof e ? (e = P5(e), i2 = new (t2.download ? f4 : c2)(t2)) : true === e.readable && q2(e.read) && q2(e.on) ? i2 = new p2(t2) : (n.File && e instanceof File || e instanceof Object) && (i2 = new l(t2)), i2.stream(e);
343
343
  (i2 = (() => {
344
344
  var e2;
345
- return !!v4.WORKERS_SUPPORTED && (e2 = (() => {
346
- var e4 = n.URL || n.webkitURL || null, t2 = r.toString();
347
- return v4.BLOB_URL || (v4.BLOB_URL = e4.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", t2, ")();"], { type: "text/javascript" })));
348
- })(), (e2 = new n.Worker(e2)).onmessage = g3, e2.id = h3++, o[e2.id] = e2);
349
- })()).userStep = t.step, i2.userChunk = t.chunk, i2.userComplete = t.complete, i2.userError = t.error, t.step = q3(t.step), t.chunk = q3(t.chunk), t.complete = q3(t.complete), t.error = q3(t.error), delete t.worker, i2.postMessage({ input: e, config: t, workerId: i2.id });
350
- }, v4.unparse = function(e, t) {
351
- var s2 = false, _3 = true, m2 = ",", y6 = "\r\n", a5 = '"', o2 = a5 + a5, i2 = false, r2 = null, h4 = false, u4 = ((() => {
352
- if ("object" == typeof t) {
353
- if ("string" != typeof t.delimiter || v4.BAD_DELIMITERS.filter(function(e2) {
354
- return -1 !== t.delimiter.indexOf(e2);
355
- }).length || (m2 = t.delimiter), "boolean" != typeof t.quotes && "function" != typeof t.quotes && !Array.isArray(t.quotes) || (s2 = t.quotes), "boolean" != typeof t.skipEmptyLines && "string" != typeof t.skipEmptyLines || (i2 = t.skipEmptyLines), "string" == typeof t.newline && (y6 = t.newline), "string" == typeof t.quoteChar && (a5 = t.quoteChar, o2 = a5 + a5), "boolean" == typeof t.header && (_3 = t.header), Array.isArray(t.columns)) {
356
- if (0 === t.columns.length) throw new Error("Option columns is empty");
357
- r2 = t.columns;
345
+ return !!v3.WORKERS_SUPPORTED && (e2 = (() => {
346
+ var e4 = n.URL || n.webkitURL || null, t4 = r.toString();
347
+ return v3.BLOB_URL || (v3.BLOB_URL = e4.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", t4, ")();"], { type: "text/javascript" })));
348
+ })(), (e2 = new n.Worker(e2)).onmessage = g3, e2.id = h3++, o2[e2.id] = e2);
349
+ })()).userStep = t2.step, i2.userChunk = t2.chunk, i2.userComplete = t2.complete, i2.userError = t2.error, t2.step = q2(t2.step), t2.chunk = q2(t2.chunk), t2.complete = q2(t2.complete), t2.error = q2(t2.error), delete t2.worker, i2.postMessage({ input: e, config: t2, workerId: i2.id });
350
+ }, v3.unparse = function(e, t2) {
351
+ var s2 = false, _4 = true, m4 = ",", y5 = "\r\n", a4 = '"', o4 = a4 + a4, i2 = false, r2 = null, h4 = false, u4 = ((() => {
352
+ if ("object" == typeof t2) {
353
+ if ("string" != typeof t2.delimiter || v3.BAD_DELIMITERS.filter(function(e2) {
354
+ return -1 !== t2.delimiter.indexOf(e2);
355
+ }).length || (m4 = t2.delimiter), "boolean" != typeof t2.quotes && "function" != typeof t2.quotes && !Array.isArray(t2.quotes) || (s2 = t2.quotes), "boolean" != typeof t2.skipEmptyLines && "string" != typeof t2.skipEmptyLines || (i2 = t2.skipEmptyLines), "string" == typeof t2.newline && (y5 = t2.newline), "string" == typeof t2.quoteChar && (a4 = t2.quoteChar, o4 = a4 + a4), "boolean" == typeof t2.header && (_4 = t2.header), Array.isArray(t2.columns)) {
356
+ if (0 === t2.columns.length) throw new Error("Option columns is empty");
357
+ r2 = t2.columns;
358
358
  }
359
- void 0 !== t.escapeChar && (o2 = t.escapeChar + a5), t.escapeFormulae instanceof RegExp ? h4 = t.escapeFormulae : "boolean" == typeof t.escapeFormulae && t.escapeFormulae && (h4 = /^[=+\-@\t\r].*$/);
359
+ void 0 !== t2.escapeChar && (o4 = t2.escapeChar + a4), t2.escapeFormulae instanceof RegExp ? h4 = t2.escapeFormulae : "boolean" == typeof t2.escapeFormulae && t2.escapeFormulae && (h4 = /^[=+\-@\t\r].*$/);
360
360
  }
361
- })(), new RegExp(U4(a5), "g"));
361
+ })(), new RegExp(U4(a4), "g"));
362
362
  "string" == typeof e && (e = JSON.parse(e));
363
363
  if (Array.isArray(e)) {
364
364
  if (!e.length || Array.isArray(e[0])) return n2(null, e, i2);
365
365
  if ("object" == typeof e[0]) return n2(r2 || Object.keys(e[0]), e, i2);
366
366
  } else if ("object" == typeof e) return "string" == typeof e.data && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || r2), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : "object" == typeof e.data[0] ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || "object" == typeof e.data[0] || (e.data = [e.data])), n2(e.fields || [], e.data || [], i2);
367
367
  throw new Error("Unable to serialize unrecognized input");
368
- function n2(e2, t2, i4) {
369
- var r4 = "", n4 = ("string" == typeof e2 && (e2 = JSON.parse(e2)), "string" == typeof t2 && (t2 = JSON.parse(t2)), Array.isArray(e2) && 0 < e2.length), s4 = !Array.isArray(t2[0]);
370
- if (n4 && _3) {
371
- for (var a6 = 0; a6 < e2.length; a6++) 0 < a6 && (r4 += m2), r4 += k3(e2[a6], a6);
372
- 0 < t2.length && (r4 += y6);
368
+ function n2(e2, t4, i4) {
369
+ var r4 = "", n4 = ("string" == typeof e2 && (e2 = JSON.parse(e2)), "string" == typeof t4 && (t4 = JSON.parse(t4)), Array.isArray(e2) && 0 < e2.length), s4 = !Array.isArray(t4[0]);
370
+ if (n4 && _4) {
371
+ for (var a5 = 0; a5 < e2.length; a5++) 0 < a5 && (r4 += m4), r4 += k3(e2[a5], a5);
372
+ 0 < t4.length && (r4 += y5);
373
373
  }
374
- for (var o4 = 0; o4 < t2.length; o4++) {
375
- var h5 = (n4 ? e2 : t2[o4]).length, u5 = false, d3 = n4 ? 0 === Object.keys(t2[o4]).length : 0 === t2[o4].length;
376
- if (i4 && !n4 && (u5 = "greedy" === i4 ? "" === t2[o4].join("").trim() : 1 === t2[o4].length && 0 === t2[o4][0].length), "greedy" === i4 && n4) {
374
+ for (var o5 = 0; o5 < t4.length; o5++) {
375
+ var h5 = (n4 ? e2 : t4[o5]).length, u5 = false, d3 = n4 ? 0 === Object.keys(t4[o5]).length : 0 === t4[o5].length;
376
+ if (i4 && !n4 && (u5 = "greedy" === i4 ? "" === t4[o5].join("").trim() : 1 === t4[o5].length && 0 === t4[o5][0].length), "greedy" === i4 && n4) {
377
377
  for (var f5 = [], l2 = 0; l2 < h5; l2++) {
378
378
  var c4 = s4 ? e2[l2] : l2;
379
- f5.push(t2[o4][c4]);
379
+ f5.push(t4[o5][c4]);
380
380
  }
381
381
  u5 = "" === f5.join("").trim();
382
382
  }
383
383
  if (!u5) {
384
384
  for (var p4 = 0; p4 < h5; p4++) {
385
- 0 < p4 && !d3 && (r4 += m2);
385
+ 0 < p4 && !d3 && (r4 += m4);
386
386
  var g4 = n4 && s4 ? e2[p4] : p4;
387
- r4 += k3(t2[o4][g4], p4);
387
+ r4 += k3(t4[o5][g4], p4);
388
388
  }
389
- o4 < t2.length - 1 && (!i4 || 0 < h5 && !d3) && (r4 += y6);
389
+ o5 < t4.length - 1 && (!i4 || 0 < h5 && !d3) && (r4 += y5);
390
390
  }
391
391
  }
392
392
  return r4;
393
393
  }
394
- function k3(e2, t2) {
394
+ function k3(e2, t4) {
395
395
  var i4, r4, n4;
396
- return null == e2 ? "" : e2.constructor === Date ? JSON.stringify(e2).slice(1, 25) : (n4 = false, h4 && "string" == typeof e2 && h4.test(e2) && (e2 = "'" + e2, n4 = true), r4 = (i4 = e2.toString()).replace(u4, o2), (n4 = n4 || true === s2 || "function" == typeof s2 && s2(e2, t2) || Array.isArray(s2) && s2[t2] || ((e4, t4) => {
397
- for (var i5 = 0; i5 < t4.length; i5++) if (-1 < e4.indexOf(t4[i5])) return true;
396
+ return null == e2 ? "" : e2.constructor === Date ? JSON.stringify(e2).slice(1, 25) : (n4 = false, h4 && "string" == typeof e2 && h4.test(e2) && (e2 = "'" + e2, n4 = true), r4 = (i4 = e2.toString()).replace(u4, o4), (n4 = n4 || true === s2 || "function" == typeof s2 && s2(e2, t4) || Array.isArray(s2) && s2[t4] || ((e4, t5) => {
397
+ for (var i5 = 0; i5 < t5.length; i5++) if (-1 < e4.indexOf(t5[i5])) return true;
398
398
  return false;
399
- })(r4, v4.BAD_DELIMITERS) || -1 < r4.indexOf(m2) || -1 < i4.indexOf(a5) || " " === r4.charAt(0) || " " === r4.charAt(r4.length - 1)) ? a5 + r4 + a5 : r4);
399
+ })(r4, v3.BAD_DELIMITERS) || -1 < r4.indexOf(m4) || -1 < i4.indexOf(a4) || " " === r4.charAt(0) || " " === r4.charAt(r4.length - 1)) ? a4 + r4 + a4 : r4);
400
400
  }
401
- }, v4.RECORD_SEP = String.fromCharCode(30), v4.UNIT_SEP = String.fromCharCode(31), v4.BYTE_ORDER_MARK = "\uFEFF", v4.BAD_DELIMITERS = ["\r", "\n", '"', v4.BYTE_ORDER_MARK], v4.WORKERS_SUPPORTED = !s && !!n.Worker, v4.NODE_STREAM_INPUT = 1, v4.LocalChunkSize = 10485760, v4.RemoteChunkSize = 5242880, v4.DefaultDelimiter = ",", v4.Parser = E4, v4.ParserHandle = i, v4.NetworkStreamer = f4, v4.FileStreamer = l, v4.StringStreamer = c2, v4.ReadableStreamStreamer = p2, n.jQuery && ((d2 = n.jQuery).fn.parse = function(o2) {
402
- var i2 = o2.config || {}, h4 = [];
401
+ }, v3.RECORD_SEP = String.fromCharCode(30), v3.UNIT_SEP = String.fromCharCode(31), v3.BYTE_ORDER_MARK = "\uFEFF", v3.BAD_DELIMITERS = ["\r", "\n", '"', v3.BYTE_ORDER_MARK], v3.WORKERS_SUPPORTED = !s && !!n.Worker, v3.NODE_STREAM_INPUT = 1, v3.LocalChunkSize = 10485760, v3.RemoteChunkSize = 5242880, v3.DefaultDelimiter = ",", v3.Parser = E4, v3.ParserHandle = i, v3.NetworkStreamer = f4, v3.FileStreamer = l, v3.StringStreamer = c2, v3.ReadableStreamStreamer = p2, n.jQuery && ((d2 = n.jQuery).fn.parse = function(o4) {
402
+ var i2 = o4.config || {}, h4 = [];
403
403
  return this.each(function(e2) {
404
404
  if (!("INPUT" === d2(this).prop("tagName").toUpperCase() && "file" === d2(this).attr("type").toLowerCase() && n.FileReader) || !this.files || 0 === this.files.length) return true;
405
- for (var t = 0; t < this.files.length; t++) h4.push({ file: this.files[t], inputElem: this, instanceConfig: d2.extend({}, i2) });
405
+ for (var t2 = 0; t2 < this.files.length; t2++) h4.push({ file: this.files[t2], inputElem: this, instanceConfig: d2.extend({}, i2) });
406
406
  }), e(), this;
407
407
  function e() {
408
- if (0 === h4.length) q3(o2.complete) && o2.complete();
408
+ if (0 === h4.length) q2(o4.complete) && o4.complete();
409
409
  else {
410
- var e2, t, i4, r2, n2 = h4[0];
411
- if (q3(o2.before)) {
412
- var s2 = o2.before(n2.file, n2.inputElem);
410
+ var e2, t2, i4, r2, n2 = h4[0];
411
+ if (q2(o4.before)) {
412
+ var s2 = o4.before(n2.file, n2.inputElem);
413
413
  if ("object" == typeof s2) {
414
- if ("abort" === s2.action) return e2 = "AbortError", t = n2.file, i4 = n2.inputElem, r2 = s2.reason, void (q3(o2.error) && o2.error({ name: e2 }, t, i4, r2));
414
+ if ("abort" === s2.action) return e2 = "AbortError", t2 = n2.file, i4 = n2.inputElem, r2 = s2.reason, void (q2(o4.error) && o4.error({ name: e2 }, t2, i4, r2));
415
415
  if ("skip" === s2.action) return void u4();
416
416
  "object" == typeof s2.config && (n2.instanceConfig = d2.extend(n2.instanceConfig, s2.config));
417
417
  } else if ("skip" === s2) return void u4();
418
418
  }
419
- var a5 = n2.instanceConfig.complete;
419
+ var a4 = n2.instanceConfig.complete;
420
420
  n2.instanceConfig.complete = function(e4) {
421
- q3(a5) && a5(e4, n2.file, n2.inputElem), u4();
422
- }, v4.parse(n2.file, n2.instanceConfig);
421
+ q2(a4) && a4(e4, n2.file, n2.inputElem), u4();
422
+ }, v3.parse(n2.file, n2.instanceConfig);
423
423
  }
424
424
  }
425
425
  function u4() {
426
426
  h4.splice(0, 1), e();
427
427
  }
428
- }), a4 && (n.onmessage = function(e) {
428
+ }), a2 && (n.onmessage = function(e) {
429
429
  e = e.data;
430
- void 0 === v4.WORKER_ID && e && (v4.WORKER_ID = e.workerId);
431
- "string" == typeof e.input ? n.postMessage({ workerId: v4.WORKER_ID, results: v4.parse(e.input, e.config), finished: true }) : (n.File && e.input instanceof File || e.input instanceof Object) && (e = v4.parse(e.input, e.config)) && n.postMessage({ workerId: v4.WORKER_ID, results: e, finished: true });
432
- }), (f4.prototype = Object.create(u2.prototype)).constructor = f4, (l.prototype = Object.create(u2.prototype)).constructor = l, (c2.prototype = Object.create(c2.prototype)).constructor = c2, (p2.prototype = Object.create(u2.prototype)).constructor = p2, v4;
430
+ void 0 === v3.WORKER_ID && e && (v3.WORKER_ID = e.workerId);
431
+ "string" == typeof e.input ? n.postMessage({ workerId: v3.WORKER_ID, results: v3.parse(e.input, e.config), finished: true }) : (n.File && e.input instanceof File || e.input instanceof Object) && (e = v3.parse(e.input, e.config)) && n.postMessage({ workerId: v3.WORKER_ID, results: e, finished: true });
432
+ }), (f4.prototype = Object.create(u2.prototype)).constructor = f4, (l.prototype = Object.create(u2.prototype)).constructor = l, (c2.prototype = Object.create(c2.prototype)).constructor = c2, (p2.prototype = Object.create(u2.prototype)).constructor = p2, v3;
433
433
  });
434
434
  }
435
435
  });
@@ -496,29 +496,29 @@ var MAX_MAP_POINTS_DEFAULT = 2e3;
496
496
 
497
497
  // src/deltaE.ts
498
498
  function linearise(c2) {
499
- const v4 = c2 / 255;
500
- return v4 <= 0.04045 ? v4 / 12.92 : Math.pow((v4 + 0.055) / 1.055, 2.4);
499
+ const v3 = c2 / 255;
500
+ return v3 <= 0.04045 ? v3 / 12.92 : Math.pow((v3 + 0.055) / 1.055, 2.4);
501
501
  }
502
502
  var Xn = 0.95047;
503
503
  var Yn = 1;
504
504
  var Zn = 1.08883;
505
505
  var EPS = 216 / 24389;
506
506
  var KAPPA = 24389 / 27;
507
- function f(t) {
508
- return t > EPS ? Math.cbrt(t) : (KAPPA * t + 16) / 116;
507
+ function f(t2) {
508
+ return t2 > EPS ? Math.cbrt(t2) : (KAPPA * t2 + 16) / 116;
509
509
  }
510
- function rgbToLab(r, g3, b4) {
511
- const R2 = linearise(r), G3 = linearise(g3), B4 = linearise(b4);
510
+ function rgbToLab(r, g3, b2) {
511
+ const R2 = linearise(r), G3 = linearise(g3), B4 = linearise(b2);
512
512
  const X3 = 0.4124564 * R2 + 0.3575761 * G3 + 0.1804375 * B4;
513
- const Y4 = 0.2126729 * R2 + 0.7151522 * G3 + 0.072175 * B4;
514
- const Z4 = 0.0193339 * R2 + 0.119192 * G3 + 0.9503041 * B4;
515
- const fx = f(X3 / Xn), fy = f(Y4 / Yn), fz = f(Z4 / Zn);
513
+ const Y3 = 0.2126729 * R2 + 0.7151522 * G3 + 0.072175 * B4;
514
+ const Z2 = 0.0193339 * R2 + 0.119192 * G3 + 0.9503041 * B4;
515
+ const fx = f(X3 / Xn), fy = f(Y3 / Yn), fz = f(Z2 / Zn);
516
516
  return { L: 116 * fy - 16, a: 500 * (fx - fy), b: 200 * (fy - fz) };
517
517
  }
518
518
  function hexToLab(hex2) {
519
- const m = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex2.trim());
520
- if (!m) return null;
521
- const h3 = m[1].length === 3 ? m[1][0] + m[1][0] + m[1][1] + m[1][1] + m[1][2] + m[1][2] : m[1];
519
+ const m2 = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex2.trim());
520
+ if (!m2) return null;
521
+ const h3 = m2[1].length === 3 ? m2[1][0] + m2[1][0] + m2[1][1] + m2[1][1] + m2[1][2] + m2[1][2] : m2[1];
522
522
  return rgbToLab(parseInt(h3.slice(0, 2), 16), parseInt(h3.slice(2, 4), 16), parseInt(h3.slice(4, 6), 16));
523
523
  }
524
524
  var RAD = Math.PI / 180;
@@ -549,7 +549,7 @@ function deltaE2000(c1, c2) {
549
549
  else if (Math.abs(h1p - h2p) <= 180) hbarp = (h1p + h2p) / 2;
550
550
  else if (h1p + h2p < 360) hbarp = (h1p + h2p + 360) / 2;
551
551
  else hbarp = (h1p + h2p - 360) / 2;
552
- const T4 = 1 - 0.17 * Math.cos((hbarp - 30) * RAD) + 0.24 * Math.cos(2 * hbarp * RAD) + 0.32 * Math.cos((3 * hbarp + 6) * RAD) - 0.2 * Math.cos((4 * hbarp - 63) * RAD);
552
+ const T2 = 1 - 0.17 * Math.cos((hbarp - 30) * RAD) + 0.24 * Math.cos(2 * hbarp * RAD) + 0.32 * Math.cos((3 * hbarp + 6) * RAD) - 0.2 * Math.cos((4 * hbarp - 63) * RAD);
553
553
  const dTheta = 30 * Math.exp(-Math.pow((hbarp - 275) / 25, 2));
554
554
  const Cbarp7 = Math.pow(Cbarp, 7);
555
555
  const RC = 2 * Math.sqrt(Cbarp7 / (Cbarp7 + Math.pow(25, 7)));
@@ -557,32 +557,32 @@ function deltaE2000(c1, c2) {
557
557
  const Lm50 = Math.pow(Lbarp - 50, 2);
558
558
  const SL = 1 + 0.015 * Lm50 / Math.sqrt(20 + Lm50);
559
559
  const SC = 1 + 0.045 * Cbarp;
560
- const SH = 1 + 0.015 * Cbarp * T4;
560
+ const SH = 1 + 0.015 * Cbarp * T2;
561
561
  const tL = dLp / SL, tC = dCp / SC, tH = dHp / SH;
562
562
  return Math.sqrt(tL * tL + tC * tC + tH * tH + RT * tC * tH);
563
563
  }
564
564
  function labToHex(lab) {
565
- const finv = (t) => {
566
- const t32 = t * t * t;
567
- return t32 > EPS ? t32 : (116 * t - 16) / KAPPA;
565
+ const finv = (t2) => {
566
+ const t32 = t2 * t2 * t2;
567
+ return t32 > EPS ? t32 : (116 * t2 - 16) / KAPPA;
568
568
  };
569
569
  const fy = (lab.L + 16) / 116, fx = fy + lab.a / 500, fz = fy - lab.b / 200;
570
570
  const X3 = Xn * finv(fx);
571
- const Y4 = Yn * (lab.L > KAPPA * EPS ? fy * fy * fy : lab.L / KAPPA);
572
- const Z4 = Zn * finv(fz);
571
+ const Y3 = Yn * (lab.L > KAPPA * EPS ? fy * fy * fy : lab.L / KAPPA);
572
+ const Z2 = Zn * finv(fz);
573
573
  const lin = [
574
- 3.2404542 * X3 - 1.5371385 * Y4 - 0.4985314 * Z4,
575
- -0.969266 * X3 + 1.8760108 * Y4 + 0.041556 * Z4,
576
- 0.0556434 * X3 - 0.2040259 * Y4 + 1.0572252 * Z4
574
+ 3.2404542 * X3 - 1.5371385 * Y3 - 0.4985314 * Z2,
575
+ -0.969266 * X3 + 1.8760108 * Y3 + 0.041556 * Z2,
576
+ 0.0556434 * X3 - 0.2040259 * Y3 + 1.0572252 * Z2
577
577
  ];
578
- return "#" + lin.map((v4) => {
579
- const c2 = Math.max(0, Math.min(1, v4));
578
+ return "#" + lin.map((v3) => {
579
+ const c2 = Math.max(0, Math.min(1, v3));
580
580
  const g3 = c2 <= 31308e-7 ? 12.92 * c2 : 1.055 * Math.pow(c2, 1 / 2.4) - 0.055;
581
581
  return Math.round(g3 * 255).toString(16).padStart(2, "0");
582
582
  }).join("");
583
583
  }
584
- function deltaEHex(a4, b4) {
585
- const la = hexToLab(a4), lb = hexToLab(b4);
584
+ function deltaEHex(a2, b2) {
585
+ const la = hexToLab(a2), lb = hexToLab(b2);
586
586
  return la && lb ? deltaE2000(la, lb) : NaN;
587
587
  }
588
588
 
@@ -604,8 +604,8 @@ function styleOf(el, doc) {
604
604
  }
605
605
  }
606
606
  function fillOf(el, cs) {
607
- const a4 = el.getAttribute?.("fill");
608
- if (a4 !== null && a4 !== void 0 && String(a4).trim() !== "") return String(a4).trim();
607
+ const a2 = el.getAttribute?.("fill");
608
+ if (a2 !== null && a2 !== void 0 && String(a2).trim() !== "") return String(a2).trim();
609
609
  const c2 = cs?.fill;
610
610
  return c2 === null || c2 === void 0 ? "" : String(c2).trim();
611
611
  }
@@ -622,10 +622,10 @@ function toRgb(raw) {
622
622
  parseInt(full.slice(4, 6), 16)
623
623
  ];
624
624
  }
625
- const m = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)\s*(?:[,/]\s*([\d.]+)\s*)?\)$/.exec(s);
626
- if (!m) return null;
627
- if (m[4] !== void 0 && parseFloat(m[4]) === 0) return null;
628
- return [Math.round(parseFloat(m[1])), Math.round(parseFloat(m[2])), Math.round(parseFloat(m[3]))];
625
+ const m2 = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)\s*(?:[,/]\s*([\d.]+)\s*)?\)$/.exec(s);
626
+ if (!m2) return null;
627
+ if (m2[4] !== void 0 && parseFloat(m2[4]) === 0) return null;
628
+ return [Math.round(parseFloat(m2[1])), Math.round(parseFloat(m2[2])), Math.round(parseFloat(m2[3]))];
629
629
  }
630
630
  function cellKey(rgb) {
631
631
  return [
@@ -635,7 +635,7 @@ function cellKey(rgb) {
635
635
  ].join(",");
636
636
  }
637
637
  function hex(rgb) {
638
- return "#" + rgb.map((v4) => Math.max(0, Math.min(255, v4)).toString(16).padStart(2, "0")).join("");
638
+ return "#" + rgb.map((v3) => Math.max(0, Math.min(255, v3)).toString(16).padStart(2, "0")).join("");
639
639
  }
640
640
  function censusColourSpread(container, doc) {
641
641
  if (!container || typeof container.querySelectorAll !== "function") return EMPTY;
@@ -657,8 +657,8 @@ function censusColourSpread(container, doc) {
657
657
  g3.n++;
658
658
  byTag.set(p2.tag, g3);
659
659
  }
660
- const overlays = new Set([...byTag].filter(([, g3]) => g3.fills.size === 1 && g3.n >= MIN_MARKS).map(([t]) => t));
661
- const restFills = new Set([...byTag].filter(([t]) => !overlays.has(t)).flatMap(([, g3]) => [...g3.fills]));
660
+ const overlays = new Set([...byTag].filter(([, g3]) => g3.fills.size === 1 && g3.n >= MIN_MARKS).map(([t2]) => t2));
661
+ const restFills = new Set([...byTag].filter(([t2]) => !overlays.has(t2)).flatMap(([, g3]) => [...g3.fills]));
662
662
  const counted = restFills.size > 1 ? painted.filter((p2) => !overlays.has(p2.tag)) : painted;
663
663
  const distinct = /* @__PURE__ */ new Set();
664
664
  const cells = /* @__PURE__ */ new Map();
@@ -672,20 +672,20 @@ function censusColourSpread(container, doc) {
672
672
  else cells.set(k3, { rgb, n: 1 });
673
673
  }
674
674
  if (marks < MIN_MARKS || distinct.size < MIN_RAMP_FILLS) return EMPTY;
675
- const top = [...cells.values()].sort((a4, b4) => b4.n - a4.n).slice(0, MAX_CELLS);
675
+ const top = [...cells.values()].sort((a2, b2) => b2.n - a2.n).slice(0, MAX_CELLS);
676
676
  const cs = top.map((c2) => hexToLab(hex(c2.rgb))).filter((l) => l !== null);
677
677
  if (cs.length < MIN_RAMP_FILLS) return EMPTY;
678
678
  const d2 = cs.map(() => new Array(cs.length).fill(0));
679
679
  let span = 0, lo = 0, hi = 1;
680
680
  for (let i = 0; i < cs.length; i++) {
681
- for (let j3 = i + 1; j3 < cs.length; j3++) {
682
- const v4 = deltaE2000(cs[i], cs[j3]);
683
- d2[i][j3] = v4;
684
- d2[j3][i] = v4;
685
- if (v4 > span) {
686
- span = v4;
681
+ for (let j5 = i + 1; j5 < cs.length; j5++) {
682
+ const v3 = deltaE2000(cs[i], cs[j5]);
683
+ d2[i][j5] = v3;
684
+ d2[j5][i] = v3;
685
+ if (v3 > span) {
686
+ span = v3;
687
687
  lo = i;
688
- hi = j3;
688
+ hi = j5;
689
689
  }
690
690
  }
691
691
  }
@@ -700,8 +700,8 @@ function censusColourSpread(container, doc) {
700
700
  let crowd = 0;
701
701
  for (let i = 0; i < cs.length; i++) {
702
702
  let n = 0;
703
- for (let j3 = 0; j3 < cs.length; j3++) {
704
- if (i === j3 || d2[i][j3] <= SAME_SHADE_DELTA_E) n += top[j3].n;
703
+ for (let j5 = 0; j5 < cs.length; j5++) {
704
+ if (i === j5 || d2[i][j5] <= SAME_SHADE_DELTA_E) n += top[j5].n;
705
705
  }
706
706
  if (n > crowd) crowd = n;
707
707
  }
@@ -729,18 +729,18 @@ var MIN_ACCENT_VS_CANVAS = 20;
729
729
  var HEX = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;
730
730
  function normHex(raw) {
731
731
  if (typeof raw !== "string") return null;
732
- const m = HEX.exec(raw.trim());
733
- if (!m) return null;
734
- const h3 = m[1].length === 3 ? m[1].split("").map((c2) => c2 + c2).join("") : m[1];
732
+ const m2 = HEX.exec(raw.trim());
733
+ if (!m2) return null;
734
+ const h3 = m2[1].length === 3 ? m2[1].split("").map((c2) => c2 + c2).join("") : m2[1];
735
735
  return "#" + h3.toLowerCase();
736
736
  }
737
- function mixLab(a4, b4, t) {
738
- return { L: a4.L + (b4.L - a4.L) * t, a: a4.a + (b4.a - a4.a) * t, b: a4.b + (b4.b - a4.b) * t };
737
+ function mixLab(a2, b2, t2) {
738
+ return { L: a2.L + (b2.L - a2.L) * t2, a: a2.a + (b2.a - a2.a) * t2, b: a2.b + (b2.b - a2.b) * t2 };
739
739
  }
740
740
  function paintedOver(fg, canvas, alpha) {
741
741
  const f4 = [1, 3, 5].map((i) => parseInt(fg.slice(i, i + 2), 16));
742
742
  const c2 = [1, 3, 5].map((i) => parseInt(canvas.slice(i, i + 2), 16));
743
- const mixed = f4.map((v4, i) => Math.round(v4 * alpha + c2[i] * (1 - alpha))).map((v4) => v4.toString(16).padStart(2, "0"));
743
+ const mixed = f4.map((v3, i) => Math.round(v3 * alpha + c2[i] * (1 - alpha))).map((v3) => v3.toString(16).padStart(2, "0"));
744
744
  return hexToLab("#" + mixed.join(""));
745
745
  }
746
746
  function autoRampMinStep(low, high, canvas, classes = AUTO_RAMP_CLASSES, opacity = AUTO_RAMP_DRAWN_OPACITY) {
@@ -774,19 +774,19 @@ function resolveAutoColorScale(p2) {
774
774
  const candidates = p2.isHighContrast ? [normHex(p2.themeAccent), normHex(p2.themeFg)] : [...palette.map(normHex), normHex(p2.themeAccent), normHex(p2.themeFg)];
775
775
  const accent = candidates.find(usable) ?? FALLBACK_ACCENT;
776
776
  const A2 = hexToLab(accent);
777
- let t = 0.1;
778
- let low = mixLab(bg, A2, t);
779
- while (t < 0.6 && deltaE2000(paintedOver(labToHex(low), canvas, AUTO_RAMP_DRAWN_OPACITY), bg) < SAME_SHADE_DELTA_E) {
780
- t += 0.02;
781
- low = mixLab(bg, A2, t);
777
+ let t2 = 0.1;
778
+ let low = mixLab(bg, A2, t2);
779
+ while (t2 < 0.6 && deltaE2000(paintedOver(labToHex(low), canvas, AUTO_RAMP_DRAWN_OPACITY), bg) < SAME_SHADE_DELTA_E) {
780
+ t2 += 0.02;
781
+ low = mixLab(bg, A2, t2);
782
782
  }
783
783
  const lowHex = labToHex(low);
784
784
  let high = { ...A2 };
785
785
  let highHex = labToHex(high);
786
786
  for (let step = 0; step < 80 && autoRampMinStep(lowHex, highHex, canvas) < AUTO_RAMP_MIN_STEP_DELTA_E; step++) {
787
- const L4 = Math.max(4, Math.min(98, high.L + (darkCanvas ? 1 : -1)));
788
- if (L4 === high.L) break;
789
- high = { ...high, L: L4 };
787
+ const L5 = Math.max(4, Math.min(98, high.L + (darkCanvas ? 1 : -1)));
788
+ if (L5 === high.L) break;
789
+ high = { ...high, L: L5 };
790
790
  highHex = labToHex(high);
791
791
  }
792
792
  memoKey = key;
@@ -872,20 +872,20 @@ function resolveOptions(p2) {
872
872
  // never reach a chart as a live mode. Both of these are read on EVERY render, so a
873
873
  // reader can change their mind about a cached chart without regenerating it.
874
874
  approximatePositions: (() => {
875
- const v4 = (p2.approximatePositions == null ? "" : String(p2.approximatePositions)).toLowerCase();
876
- return v4 === "mark" || v4 === "aggregate" || v4 === "skip" ? v4 : APPROXIMATE_POSITIONS_DEFAULT;
875
+ const v3 = (p2.approximatePositions == null ? "" : String(p2.approximatePositions)).toLowerCase();
876
+ return v3 === "mark" || v3 === "aggregate" || v3 === "skip" ? v3 : APPROXIMATE_POSITIONS_DEFAULT;
877
877
  })(),
878
878
  valueAxisBaseline: (() => {
879
- const v4 = (p2.valueAxisBaseline == null ? "" : String(p2.valueAxisBaseline)).toLowerCase();
880
- return v4 === "zero" || v4 === "fit" || v4 === "auto" ? v4 : VALUE_AXIS_BASELINE_DEFAULT;
879
+ const v3 = (p2.valueAxisBaseline == null ? "" : String(p2.valueAxisBaseline)).toLowerCase();
880
+ return v3 === "zero" || v3 === "fit" || v3 === "auto" ? v3 : VALUE_AXIS_BASELINE_DEFAULT;
881
881
  })(),
882
882
  // Same shape, and the same reason for it: an unrecognised string must never reach a chart
883
883
  // as a live mode. Failing open to "auto" is the conservative direction here — "auto" is
884
884
  // the setting that makes the chart PROVE the grid before it names a period, so a garbled
885
885
  // value withdraws the claim rather than asserting one.
886
886
  seasonalMarkers: (() => {
887
- const v4 = (p2.seasonalMarkers == null ? "" : String(p2.seasonalMarkers)).toLowerCase();
888
- return v4 === "auto" || v4 === "always" || v4 === "never" ? v4 : SEASONAL_MARKERS_DEFAULT;
887
+ const v3 = (p2.seasonalMarkers == null ? "" : String(p2.seasonalMarkers)).toLowerCase();
888
+ return v3 === "auto" || v3 === "always" || v3 === "never" ? v3 : SEASONAL_MARKERS_DEFAULT;
889
889
  })(),
890
890
  // ---- animation: booleans, default+clamp numerics, "" default enum ----
891
891
  animAutoPlay: !!p2.animAutoPlay,
@@ -928,8 +928,8 @@ function resolveOptions(p2) {
928
928
  // because a newer client shipped, and "both" would have done exactly that to every deck
929
929
  // already in a report.
930
930
  flipMode: (() => {
931
- const m = (p2.flipMode == null ? "" : String(p2.flipMode)).toLowerCase();
932
- if (m === "single" || m === "all" || m === "both") return m;
931
+ const m2 = (p2.flipMode == null ? "" : String(p2.flipMode)).toLowerCase();
932
+ if (m2 === "single" || m2 === "all" || m2 === "both") return m2;
933
933
  if (p2.flipSync === false) return "single";
934
934
  if (p2.flipSync === true) return "all";
935
935
  return FLIP_MODE_DEFAULT;
@@ -1045,8 +1045,8 @@ var _ = "AD AND,AE ARE,AF AFG,AG ATG,AI AIA,AL ALB,AM ARM,AO AGO,AQ ATA,AR ARG,A
1045
1045
  var N = (() => {
1046
1046
  let n = /* @__PURE__ */ new Map();
1047
1047
  for (let e of _.split(",")) {
1048
- let [t, o] = e.split(" ");
1049
- t && o && n.set(t, o);
1048
+ let [t2, o2] = e.split(" ");
1049
+ t2 && o2 && n.set(t2, o2);
1050
1050
  }
1051
1051
  return n;
1052
1052
  })();
@@ -1057,29 +1057,29 @@ var Q = { usa: "USA", "u.s.": "USA", "u.s.a.": "USA", us: "USA", america: "USA",
1057
1057
  var b = null;
1058
1058
  function j() {
1059
1059
  if (b) return b;
1060
- let n = /* @__PURE__ */ new Map(), e = ["en", ...v.filter((t) => t !== "en")];
1061
- for (let t of e) {
1062
- let o = null;
1060
+ let n = /* @__PURE__ */ new Map(), e = ["en", ...v.filter((t2) => t2 !== "en")];
1061
+ for (let t2 of e) {
1062
+ let o2 = null;
1063
1063
  try {
1064
- o = new Intl.DisplayNames([t], { type: "region" });
1064
+ o2 = new Intl.DisplayNames([t2], { type: "region" });
1065
1065
  } catch {
1066
1066
  continue;
1067
1067
  }
1068
1068
  for (let [i, r] of N) {
1069
- let a4;
1069
+ let a2;
1070
1070
  try {
1071
- a4 = o.of(i);
1071
+ a2 = o2.of(i);
1072
1072
  } catch {
1073
- a4 = void 0;
1073
+ a2 = void 0;
1074
1074
  }
1075
- if (!a4 || a4 === i) continue;
1076
- let s = u(a4);
1075
+ if (!a2 || a2 === i) continue;
1076
+ let s = u(a2);
1077
1077
  s && !n.has(s) && n.set(s, r);
1078
1078
  }
1079
1079
  }
1080
- for (let [t, o] of Object.entries(Q)) {
1081
- let i = u(t);
1082
- i && n.set(i, o);
1080
+ for (let [t2, o2] of Object.entries(Q)) {
1081
+ let i = u(t2);
1082
+ i && n.set(i, o2);
1083
1083
  }
1084
1084
  return b = n, n;
1085
1085
  }
@@ -1090,8 +1090,8 @@ function E(n) {
1090
1090
  if (n == null) return null;
1091
1091
  let e = String(n).trim();
1092
1092
  if (!e) return null;
1093
- let t = e.toUpperCase();
1094
- return t.length === 3 && J.has(t) ? t : t.length === 2 && z.has(t) ? N.get(t) ?? null : j().get(u(e)) ?? null;
1093
+ let t2 = e.toUpperCase();
1094
+ return t2.length === 3 && J.has(t2) ? t2 : t2.length === 2 && z.has(t2) ? N.get(t2) ?? null : j().get(u(e)) ?? null;
1095
1095
  }
1096
1096
  var $ = /* @__PURE__ */ new Set(["n a", "none", "null", "nil", "unknown", "not applicable", "not available", "not specified", "unspecified", "missing", "blank", "empty", "tbd", "to be determined"]);
1097
1097
  function V(n) {
@@ -1100,8 +1100,8 @@ function V(n) {
1100
1100
  var m3 = 80;
1101
1101
  var q = { "north-america": "N", world: "W" };
1102
1102
  function F(n, e) {
1103
- let t = n.filter((o) => o.row.kinds.includes(q[e || "north-america"]));
1104
- return t.length ? t : (e || "north-america") === "world" ? n : t;
1103
+ let t2 = n.filter((o2) => o2.row.kinds.includes(q[e || "north-america"]));
1104
+ return t2.length ? t2 : (e || "north-america") === "world" ? n : t2;
1105
1105
  }
1106
1106
  var P = a;
1107
1107
  function L3(n) {
@@ -1114,20 +1114,20 @@ var t3 = { US: "washington", CA: "ottawa", MX: "mexico city", GB: "london", FR:
1114
1114
  var U = null;
1115
1115
  function y() {
1116
1116
  if (U) return U;
1117
- let n = /* @__PURE__ */ new Map(), e = P, t = (o, i, r) => {
1118
- if (!o) return;
1119
- let a4 = n.get(o);
1120
- a4 ? a4.some((s) => s.row === i) || a4.push({ row: i, primary: r }) : n.set(o, [{ row: i, primary: r }]);
1117
+ let n = /* @__PURE__ */ new Map(), e = P, t2 = (o2, i, r) => {
1118
+ if (!o2) return;
1119
+ let a2 = n.get(o2);
1120
+ a2 ? a2.some((s) => s.row === i) || a2.push({ row: i, primary: r }) : n.set(o2, [{ row: i, primary: r }]);
1121
1121
  };
1122
- for (let o of e.split(",")) {
1123
- let i = o.split("|");
1122
+ for (let o2 of e.split(",")) {
1123
+ let i = o2.split("|");
1124
1124
  if (i.length < 7) continue;
1125
1125
  let r = { a1: i[1], cc: i[2], lon: +i[3], lat: +i[4], pop: +i[5], kinds: i[6] || "N" };
1126
1126
  i.length > 8 && i[8] && (r.tags = i[8].split(";").filter(Boolean));
1127
- let a4 = t3[r.cc];
1128
- if (a4 && u(i[0]) === a4 && (r.tags || (r.tags = []), r.tags.includes("capital") || r.tags.push("capital")), t(u(i[0]), r, true), i.length > 7 && i[7]) for (let s of i[7].split(";")) t(u(s), r, false);
1127
+ let a2 = t3[r.cc];
1128
+ if (a2 && u(i[0]) === a2 && (r.tags || (r.tags = []), r.tags.includes("capital") || r.tags.push("capital")), t2(u(i[0]), r, true), i.length > 7 && i[7]) for (let s of i[7].split(";")) t2(u(s), r, false);
1129
1129
  }
1130
- for (let o of n.values()) o.sort((i, r) => r.row.pop - i.row.pop);
1130
+ for (let o2 of n.values()) o2.sort((i, r) => r.row.pop - i.row.pop);
1131
1131
  return U = n, n;
1132
1132
  }
1133
1133
  var e3 = 200;
@@ -1135,10 +1135,10 @@ var L = null;
1135
1135
  function i3() {
1136
1136
  if (L) return L;
1137
1137
  let n = /* @__PURE__ */ new Map();
1138
- for (let [e, t] of y()) {
1138
+ for (let [e, t2] of y()) {
1139
1139
  if (!e.endsWith(" city")) continue;
1140
- let o = e.slice(0, -5);
1141
- !o || y().get(o)?.some((i) => i.primary) || t[0].row.pop < e3 || n.set(o, t);
1140
+ let o2 = e.slice(0, -5);
1141
+ !o2 || y().get(o2)?.some((i) => i.primary) || t2[0].row.pop < e3 || n.set(o2, t2);
1142
1142
  }
1143
1143
  return L = n, n;
1144
1144
  }
@@ -1146,25 +1146,25 @@ function O(n) {
1146
1146
  if (!n) return;
1147
1147
  let e = y().get(n);
1148
1148
  if (e?.some((i) => i.primary)) return e;
1149
- let t = i3().get(n);
1150
- if (!t) return e;
1151
- let o = t.map((i) => ({ row: i.row, primary: true }));
1152
- return e ? [...o, ...e] : o;
1149
+ let t2 = i3().get(n);
1150
+ if (!t2) return e;
1151
+ let o2 = t2.map((i) => ({ row: i.row, primary: true }));
1152
+ return e ? [...o2, ...e] : o2;
1153
1153
  }
1154
1154
  var I = null;
1155
1155
  function o3() {
1156
1156
  if (I) return I;
1157
1157
  let n = /* @__PURE__ */ new Map();
1158
- for (let t of k.split(",")) {
1159
- let o = t.split("|");
1160
- o.length < 3 || n.set(o[0], { lon: +o[1], lat: +o[2] });
1158
+ for (let t2 of k.split(",")) {
1159
+ let o2 = t2.split("|");
1160
+ o2.length < 3 || n.set(o2[0], { lon: +o2[1], lat: +o2[2] });
1161
1161
  }
1162
1162
  let e = /* @__PURE__ */ new Map();
1163
- for (let t of y().values()) for (let o of t) {
1164
- let i = T(o.row.cc);
1163
+ for (let t2 of y().values()) for (let o2 of t2) {
1164
+ let i = T(o2.row.cc);
1165
1165
  if (!i) continue;
1166
1166
  let r = e.get(i);
1167
- (r === void 0 || o.row.pop > r) && (e.set(i, o.row.pop), n.set(i, { lon: o.row.lon, lat: o.row.lat }));
1167
+ (r === void 0 || o2.row.pop > r) && (e.set(i, o2.row.pop), n.set(i, { lon: o2.row.lon, lat: o2.row.lat }));
1168
1168
  }
1169
1169
  return I = n, n;
1170
1170
  }
@@ -1173,12 +1173,12 @@ function D() {
1173
1173
  if (h) return h;
1174
1174
  let n = /* @__PURE__ */ new Map();
1175
1175
  for (let e of H.split(",")) {
1176
- let t = e.split("|");
1177
- if (t.length < 5) continue;
1178
- let o = { key: t[0], cc: t[1], name: t[2], lon: +t[3], lat: +t[4] };
1179
- n.set(u(o.key), o);
1180
- let i = u(o.name);
1181
- i === "mexico" && o.cc === "MX" ? (n.set("estado de mexico", o), n.set("edomex", o)) : n.set(i, o);
1176
+ let t2 = e.split("|");
1177
+ if (t2.length < 5) continue;
1178
+ let o2 = { key: t2[0], cc: t2[1], name: t2[2], lon: +t2[3], lat: +t2[4] };
1179
+ n.set(u(o2.key), o2);
1180
+ let i = u(o2.name);
1181
+ i === "mexico" && o2.cc === "MX" ? (n.set("estado de mexico", o2), n.set("edomex", o2)) : n.set(i, o2);
1182
1182
  }
1183
1183
  return h = n, n;
1184
1184
  }
@@ -1187,8 +1187,8 @@ function a3() {
1187
1187
  if (B) return B;
1188
1188
  let n = /* @__PURE__ */ new Map();
1189
1189
  for (let e of X.split(",")) {
1190
- let t = e.split("|");
1191
- t.length < 3 || n.set(t[0], { lon: +t[1], lat: +t[2] });
1190
+ let t2 = e.split("|");
1191
+ t2.length < 3 || n.set(t2[0], { lon: +t2[1], lat: +t2[2] });
1192
1192
  }
1193
1193
  return B = n, n;
1194
1194
  }
@@ -1210,153 +1210,156 @@ function M3(n) {
1210
1210
  if (n == null) return null;
1211
1211
  let e = String(n).trim().replace(/\.0+$/, "");
1212
1212
  if (!e) return null;
1213
- let t = /^(\d{5})(-\d{4})?$/.exec(e);
1214
- return t ? t[1] : /^\d{3,4}$/.test(e) ? e.padStart(5, "0") : null;
1213
+ let t2 = /^(\d{5})(-\d{4})?$/.exec(e);
1214
+ return t2 ? t2[1] : /^\d{3,4}$/.test(e) ? e.padStart(5, "0") : null;
1215
1215
  }
1216
1216
  function Z(n) {
1217
1217
  if (n == null) return [];
1218
1218
  let e = String(n).trim().replace(/\.0+$/, "");
1219
1219
  if (!e) return [];
1220
1220
  if (/^\d{3}$/.test(e)) {
1221
- let o = e.padStart(5, "0").slice(0, 3);
1222
- return o === e ? [e] : [e, o];
1221
+ let o2 = e.padStart(5, "0").slice(0, 3);
1222
+ return o2 === e ? [e] : [e, o2];
1223
1223
  }
1224
- let t = M3(e);
1225
- return t ? [t.slice(0, 3)] : [];
1224
+ let t2 = M3(e);
1225
+ return t2 ? [t2.slice(0, 3)] : [];
1226
1226
  }
1227
1227
  function S3(n) {
1228
1228
  return !!n && n.ambiguous === true && !("precision" in n);
1229
1229
  }
1230
1230
  function A3(n) {
1231
- let e = null, t = typeof n.lat == "string" ? n.lat.trim() : n.lat, o = typeof n.lon == "string" ? n.lon.trim() : n.lon;
1232
- if (t != null && t !== "" && o !== void 0 && o !== null && o !== "") {
1233
- let a4 = +t, s = +o;
1234
- if (isFinite(a4) && isFinite(s) && a4 >= -90 && a4 <= 90 && s >= -180 && s <= 180) if (a4 === 0 && s === 0) e = { lat: 0, lon: 0, precision: "latlon" };
1235
- else return { lat: a4, lon: s, precision: "latlon" };
1231
+ let e = null, t2 = typeof n.lat == "string" ? n.lat.trim() : n.lat, o2 = typeof n.lon == "string" ? n.lon.trim() : n.lon;
1232
+ if (t2 != null && t2 !== "" && o2 !== void 0 && o2 !== null && o2 !== "") {
1233
+ let a2 = +t2, s = +o2;
1234
+ if (isFinite(a2) && isFinite(s) && a2 >= -90 && a2 <= 90 && s >= -180 && s <= 180) if (a2 === 0 && s === 0) e = { lat: 0, lon: 0, precision: "latlon" };
1235
+ else return { lat: a2, lon: s, precision: "latlon" };
1236
1236
  }
1237
1237
  let i = E(n.country), r = Y(n.state);
1238
1238
  if (r && i && c3(r) !== i && (r = null), n.city !== void 0 && n.city !== null) {
1239
- let a4 = u(String(n.city)), s = O(a4), f4 = s ? F(s, n.mapKind) : null;
1239
+ let a2 = u(String(n.city)), s = O(a2), f4 = s ? F(s, n.mapKind) : null;
1240
1240
  if (f4 && f4.length) {
1241
- let d2 = n.state === void 0 || n.state === null ? "" : String(n.state).trim(), R2 = d2 ? u(d2) : "", g3 = d2 ? Y(d2) : null, S = [], m = -1;
1241
+ let d2 = n.state === void 0 || n.state === null ? "" : String(n.state).trim(), R2 = d2 ? u(d2) : "", g3 = d2 ? Y(d2) : null, S2 = [], m2 = -1;
1242
1242
  for (let c2 of f4) {
1243
1243
  let l = c2.row, A2 = 0;
1244
1244
  if (d2 && l.a1 !== "") if (g3 && l.a1 === g3 || u(l.a1) === R2) A2++;
1245
1245
  else continue;
1246
1246
  if (i) if (T(l.cc) === i) A2++;
1247
1247
  else continue;
1248
- A2 > m ? (m = A2, S = [c2]) : A2 === m && S.push(c2);
1248
+ A2 > m2 ? (m2 = A2, S2 = [c2]) : A2 === m2 && S2.push(c2);
1249
1249
  }
1250
- S.some((c2) => c2.primary) && (S = S.filter((c2) => c2.primary));
1250
+ S2.some((c2) => c2.primary) && (S2 = S2.filter((c2) => c2.primary));
1251
1251
  let p2 = /* @__PURE__ */ new Map();
1252
- for (let c2 of S) p2.set(c2.row.lon.toFixed(2) + "," + c2.row.lat.toFixed(2), c2.row);
1252
+ for (let c2 of S2) p2.set(c2.row.lon.toFixed(2) + "," + c2.row.lat.toFixed(2), c2.row);
1253
1253
  if (p2.size === 1) {
1254
- let c2 = S[0].row;
1254
+ let c2 = S2[0].row;
1255
1255
  return { lat: c2.lat, lon: c2.lon, precision: "city" };
1256
1256
  }
1257
1257
  if (p2.size > 1) return { ambiguous: true, matches: p2.size };
1258
1258
  }
1259
1259
  }
1260
- if (!i || r3.has(i)) for (let a4 of Z(n.zip)) {
1261
- let s = a3().get(a4);
1260
+ if (!i || r3.has(i)) for (let a2 of Z(n.zip)) {
1261
+ let s = a3().get(a2);
1262
1262
  if (s) return { lat: s.lat, lon: s.lon, precision: "zip3" };
1263
1263
  }
1264
1264
  if (r) {
1265
- let a4 = D().get(u(r));
1266
- if (a4) return { lat: a4.lat, lon: a4.lon, precision: "state" };
1265
+ let a2 = D().get(u(r));
1266
+ if (a2) return { lat: a2.lat, lon: a2.lon, precision: "state" };
1267
1267
  }
1268
1268
  if (i && (n.mapKind !== "north-america" || s3.has(i))) {
1269
- let a4 = o3().get(i);
1270
- if (a4) return { lat: a4.lat, lon: a4.lon, precision: "country" };
1269
+ let a2 = o3().get(i);
1270
+ if (a2) return { lat: a2.lat, lon: a2.lon, precision: "country" };
1271
1271
  }
1272
1272
  return e;
1273
1273
  }
1274
1274
  var G = { latlon: 0, city: 1, zip3: 2, state: 3, country: 4 };
1275
1275
  var x = 8;
1276
1276
  function y3(n, e) {
1277
- let t = new Array(n.length), o = new Array(n.length), i = new Array(n.length), r = /* @__PURE__ */ new Set(), a4 = [], s = /* @__PURE__ */ new Set(), f4 = [], d2 = /* @__PURE__ */ new Set(), R2 = [], g3 = { latlon: 0, city: 0, zip3: 0, state: 0, country: 0 }, S = 0, m = 0, p2 = null;
1277
+ let t2 = new Array(n.length), o2 = new Array(n.length), i = new Array(n.length), r = /* @__PURE__ */ new Set(), a2 = [], s = /* @__PURE__ */ new Set(), f4 = [], d2 = /* @__PURE__ */ new Set(), R2 = [], g3 = { latlon: 0, city: 0, zip3: 0, state: 0, country: 0 }, S2 = 0, m2 = 0, p2 = null;
1278
1278
  for (let l = 0; l < n.length; ++l) {
1279
- let A2 = n[l], C2 = A3({ ...A2, mapKind: e });
1280
- if (S3(C2)) {
1281
- t[l] = null, o[l] = null, i[l] = null, m++;
1282
- let M = K(A2);
1283
- M && !d2.has(M.toLowerCase()) && (d2.add(M.toLowerCase()), R2.length < x && R2.push(M));
1284
- } else if (C2) {
1285
- if (t[l] = C2.lat, o[l] = C2.lon, i[l] = C2.precision, S++, g3[C2.precision]++, (p2 === null || G[C2.precision] > G[p2]) && (p2 = C2.precision), G[C2.precision] > G.city) {
1286
- let M = K(A2);
1287
- M && !s.has(M.toLowerCase()) && (s.add(M.toLowerCase()), f4.length < x && f4.push(M));
1279
+ let A2 = n[l], C = A3({ ...A2, mapKind: e });
1280
+ if (S3(C)) {
1281
+ t2[l] = null, o2[l] = null, i[l] = null, m2++;
1282
+ let M2 = K(A2);
1283
+ M2 && !d2.has(M2.toLowerCase()) && (d2.add(M2.toLowerCase()), R2.length < x && R2.push(M2));
1284
+ } else if (C) {
1285
+ if (t2[l] = C.lat, o2[l] = C.lon, i[l] = C.precision, S2++, g3[C.precision]++, (p2 === null || G[C.precision] > G[p2]) && (p2 = C.precision), G[C.precision] > G.city) {
1286
+ let M2 = K(A2);
1287
+ M2 && !s.has(M2.toLowerCase()) && (s.add(M2.toLowerCase()), f4.length < x && f4.push(M2));
1288
1288
  }
1289
1289
  } else {
1290
- t[l] = null, o[l] = null, i[l] = null;
1291
- let M = K(A2);
1292
- M && !r.has(M.toLowerCase()) && (r.add(M.toLowerCase()), a4.push(M));
1290
+ t2[l] = null, o2[l] = null, i[l] = null;
1291
+ let M2 = K(A2);
1292
+ M2 && !r.has(M2.toLowerCase()) && (r.add(M2.toLowerCase()), a2.push(M2));
1293
1293
  }
1294
1294
  }
1295
1295
  let c2 = !n3() && n.some((l) => l.city !== null && l.city !== void 0 && String(l.city).trim() !== "");
1296
- return { lat: t, lon: o, precisions: i, precision: p2, precisionCounts: g3, coarseExamples: f4, unmatched: a4, ambiguousRows: m, ambiguousExamples: R2, matchedRows: S, totalRows: n.length, ...c2 ? { cityTableMissing: true } : {} };
1296
+ return { lat: t2, lon: o2, precisions: i, precision: p2, precisionCounts: g3, coarseExamples: f4, unmatched: a2, ambiguousRows: m2, ambiguousExamples: R2, matchedRows: S2, totalRows: n.length, ...c2 ? { cityTableMissing: true } : {} };
1297
1297
  }
1298
1298
  function K(n) {
1299
- let e = [n.city, n.state, n.zip, n.country].filter((t) => t != null && String(t).trim() !== "").map((t) => String(t).trim()).join(", ");
1299
+ let e = [n.city, n.state, n.zip, n.country].filter((t2) => t2 != null && String(t2).trim() !== "").map((t2) => String(t2).trim()).join(", ");
1300
1300
  return e || (n.label === null || n.label === void 0 ? "" : String(n.label).trim());
1301
1301
  }
1302
1302
  function p3(n, e) {
1303
1303
  if (!n) return false;
1304
- let t = O(n);
1305
- return t ? F(t, e).length > 0 : false;
1304
+ let t2 = O(n);
1305
+ return t2 ? F(t2, e).length > 0 : false;
1306
1306
  }
1307
1307
 
1308
- // ../shape-core/dist/chunk-ILHBRGIO.mjs
1308
+ // ../shape-core/dist/chunk-NFSQ4O5R.mjs
1309
1309
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
1310
- var a2 = (n, t, e, r = {}) => ({ code: n, name: t, script: e, dir: "ltr", intl: n, aliases: [], wordBreaks: true, compounds: false, gluedPrefixes: [], foldSensitive: false, ...r });
1311
- var g = Object.freeze([a2("en", "English", "Latn"), a2("nl", "Dutch", "Latn", { compounds: true }), a2("de", "German", "Latn", { compounds: true }), a2("fr", "French", "Latn"), a2("es", "Spanish", "Latn"), a2("pt", "Portuguese", "Latn"), a2("it", "Italian", "Latn"), a2("pl", "Polish", "Latn"), a2("cs", "Czech", "Latn"), a2("sk", "Slovak", "Latn"), a2("sv", "Swedish", "Latn", { compounds: true }), a2("da", "Danish", "Latn", { compounds: true }), a2("nb", "Norwegian Bokmal", "Latn", { compounds: true, aliases: ["no"] }), a2("fi", "Finnish", "Latn", { compounds: true }), a2("hu", "Hungarian", "Latn", { compounds: true }), a2("tr", "Turkish", "Latn"), a2("ro", "Romanian", "Latn"), a2("hr", "Croatian", "Latn"), a2("id", "Indonesian", "Latn", { aliases: ["in"] }), a2("vi", "Vietnamese", "Latn", { foldSensitive: true }), a2("ru", "Russian", "Cyrl"), a2("uk", "Ukrainian", "Cyrl"), a2("el", "Greek", "Grek"), a2("zh", "Chinese (Simplified)", "Hani", { intl: "zh-Hans", wordBreaks: false }), a2("ja", "Japanese", "Jpan", { wordBreaks: false }), a2("ko", "Korean", "Hang"), a2("ar", "Arabic", "Arab", { dir: "rtl", gluedPrefixes: ["\u0627\u0644", "\u0648\u0627\u0644", "\u0628\u0627\u0644", "\u0641\u0627\u0644", "\u0643\u0627\u0644", "\u0644\u0644", "\u0648", "\u0641", "\u0628", "\u0643", "\u0644"] }), a2("he", "Hebrew", "Hebr", { dir: "rtl", aliases: ["iw"], gluedPrefixes: ["\u05D4", "\u05D5", "\u05D1", "\u05DC", "\u05DE", "\u05E9", "\u05DB", "\u05D5\u05D4", "\u05E9\u05D4", "\u05DE\u05D4", "\u05D5\u05D1", "\u05D5\u05DC", "\u05D5\u05DE", "\u05D1\u05D4", "\u05DC\u05D4"] }), a2("hi", "Hindi", "Deva"), a2("th", "Thai", "Thai", { wordBreaks: false })]);
1312
- var Y2 = Object.freeze(g.map((n) => n.code));
1313
- var c = new Map(g.map((n) => [n.code, n]));
1314
- var h2 = new Map(g.flatMap((n) => n.aliases.map((t) => [t, n])));
1315
- var C = { \u0142: "l", \u0141: "L", \u0131: "i", \u00F8: "o", \u00D8: "O", \u0111: "d", \u0110: "D", \u00F0: "d", \u00D0: "D" };
1316
- var T2 = [1632, 1776, 2406, 3664, 65296];
1317
- var y2 = /[\u0300-\u036F]/g;
1318
- function N2(n) {
1319
- let t = C[n];
1320
- if (t) return t;
1321
- let e = n.codePointAt(0);
1322
- for (let o of T2) if (e >= o && e <= o + 9) return String.fromCharCode(48 + e - o);
1323
- if (e >= 65313 && e <= 65338 || e >= 65345 && e <= 65370) return String.fromCharCode(e - 65248);
1324
- let r = n.normalize("NFD").replace(y2, "");
1325
- return r.length === 1 ? r : n;
1326
- }
1327
- function f2(n) {
1328
- if (!n) return n ?? "";
1329
- let t = "";
1330
- for (let e of n) t += N2(e);
1331
- return t;
1332
- }
1333
- var D2 = /([\p{Ll}\p{Nd}])(\p{Lu})/gu;
1334
- var R = /[_\-./]+/g;
1335
- var E2 = /[^\p{L}\p{M}\p{N}\x00-\x7F]/gu;
1336
- function d(n) {
1337
- return n ? String(n).normalize("NFC").replace(D2, "$1 $2").replace(R, " ").replace(E2, " ").toLowerCase().split(/\s+/).filter((t) => t.length > 0) : [];
1338
- }
1339
- function en(n) {
1340
- let t = Date.parse(n);
1341
- if (isNaN(t)) return null;
1342
- let e = new Date(t);
1343
- if (z2.test(n) || v2.test(n.trim()) || B2.test(n)) return e;
1344
- let r = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), o = e.getFullYear();
1345
- return o >= 0 && o < 100 && r.setUTCFullYear(o), r;
1346
- }
1347
- function F2(n) {
1348
- return !(n instanceof Date) || isNaN(n.getTime()) ? null : n.getUTCHours() === 0 && n.getUTCMinutes() === 0 && n.getUTCSeconds() === 0 && n.getUTCMilliseconds() === 0 ? "utc" : n.getHours() === 0 && n.getMinutes() === 0 && n.getSeconds() === 0 && n.getMilliseconds() === 0 ? "local" : null;
1349
- }
1350
- function P2(n) {
1351
- let t = new Date(Date.UTC(n.getFullYear(), n.getMonth(), n.getDate())), e = n.getFullYear();
1352
- return e >= 0 && e < 100 && t.setUTCFullYear(e), t;
1353
- }
1354
- function G2(n, t) {
1355
- let e = [];
1356
- for (let r of n) {
1310
+ var o = (e, n, t2, r = {}) => ({ code: e, name: n, script: t2, dir: "ltr", intl: e, aliases: [], wordBreaks: true, compounds: false, gluedPrefixes: [], foldSensitive: false, ...r });
1311
+ var g = Object.freeze([o("en", "English", "Latn"), o("nl", "Dutch", "Latn", { compounds: true }), o("de", "German", "Latn", { compounds: true }), o("fr", "French", "Latn"), o("es", "Spanish", "Latn"), o("pt", "Portuguese", "Latn"), o("it", "Italian", "Latn"), o("pl", "Polish", "Latn"), o("cs", "Czech", "Latn"), o("sk", "Slovak", "Latn"), o("sv", "Swedish", "Latn", { compounds: true }), o("da", "Danish", "Latn", { compounds: true }), o("nb", "Norwegian Bokmal", "Latn", { compounds: true, aliases: ["no"] }), o("fi", "Finnish", "Latn", { compounds: true }), o("hu", "Hungarian", "Latn", { compounds: true }), o("tr", "Turkish", "Latn"), o("ro", "Romanian", "Latn"), o("hr", "Croatian", "Latn"), o("id", "Indonesian", "Latn", { aliases: ["in"] }), o("vi", "Vietnamese", "Latn", { foldSensitive: true }), o("ru", "Russian", "Cyrl"), o("uk", "Ukrainian", "Cyrl"), o("el", "Greek", "Grek"), o("zh", "Chinese (Simplified)", "Hani", { intl: "zh-Hans", wordBreaks: false }), o("ja", "Japanese", "Jpan", { wordBreaks: false }), o("ko", "Korean", "Hang"), o("ar", "Arabic", "Arab", { dir: "rtl", gluedPrefixes: ["\u0627\u0644", "\u0648\u0627\u0644", "\u0628\u0627\u0644", "\u0641\u0627\u0644", "\u0643\u0627\u0644", "\u0644\u0644", "\u0648", "\u0641", "\u0628", "\u0643", "\u0644"] }), o("he", "Hebrew", "Hebr", { dir: "rtl", aliases: ["iw"], gluedPrefixes: ["\u05D4", "\u05D5", "\u05D1", "\u05DC", "\u05DE", "\u05E9", "\u05DB", "\u05D5\u05D4", "\u05E9\u05D4", "\u05DE\u05D4", "\u05D5\u05D1", "\u05D5\u05DC", "\u05D5\u05DE", "\u05D1\u05D4", "\u05DC\u05D4"] }), o("hi", "Hindi", "Deva"), o("th", "Thai", "Thai", { wordBreaks: false })]);
1312
+ var m = Object.freeze(g.map((e) => e.code));
1313
+ var c = new Map(g.map((e) => [e.code, e]));
1314
+ var L2 = new Map(g.flatMap((e) => e.aliases.map((n) => [n, e])));
1315
+ var h2 = Object.freeze([o("fa", "Persian", "Arab", { dir: "rtl" })]);
1316
+ var j2 = Object.freeze([...m, ...h2.map((e) => e.code)]);
1317
+ var S = new Map(h2.map((e) => [e.code, e]));
1318
+ var N2 = { \u0142: "l", \u0141: "L", \u0131: "i", \u00F8: "o", \u00D8: "O", \u0111: "d", \u0110: "D", \u00F0: "d", \u00D0: "D" };
1319
+ var D2 = [1632, 1776, 2406, 3664, 65296];
1320
+ var R = /[\u0300-\u036F]/g;
1321
+ function E2(e) {
1322
+ let n = N2[e];
1323
+ if (n) return n;
1324
+ let t2 = e.codePointAt(0);
1325
+ for (let a2 of D2) if (t2 >= a2 && t2 <= a2 + 9) return String.fromCharCode(48 + t2 - a2);
1326
+ if (t2 >= 65313 && t2 <= 65338 || t2 >= 65345 && t2 <= 65370) return String.fromCharCode(t2 - 65248);
1327
+ let r = e.normalize("NFD").replace(R, "");
1328
+ return r.length === 1 ? r : e;
1329
+ }
1330
+ function f2(e) {
1331
+ if (!e) return e ?? "";
1332
+ let n = "";
1333
+ for (let t2 of e) n += E2(t2);
1334
+ return n;
1335
+ }
1336
+ var A = /([\p{Ll}\p{Nd}])(\p{Lu})/gu;
1337
+ var _2 = /[_\-./]+/g;
1338
+ var M = /[^\p{L}\p{M}\p{N}\x00-\x7F]/gu;
1339
+ function p(e) {
1340
+ return e ? String(e).normalize("NFC").replace(A, "$1 $2").replace(_2, " ").replace(M, " ").toLowerCase().split(/\s+/).filter((n) => n.length > 0) : [];
1341
+ }
1342
+ function oe(e) {
1343
+ let n = Date.parse(e);
1344
+ if (isNaN(n)) return null;
1345
+ let t2 = new Date(n);
1346
+ if (Y2.test(e) || W2.test(e.trim()) || $2.test(e)) return t2;
1347
+ let r = new Date(Date.UTC(t2.getFullYear(), t2.getMonth(), t2.getDate(), t2.getHours(), t2.getMinutes(), t2.getSeconds(), t2.getMilliseconds())), a2 = t2.getFullYear();
1348
+ return a2 >= 0 && a2 < 100 && r.setUTCFullYear(a2), r;
1349
+ }
1350
+ function F2(e) {
1351
+ return !(e instanceof Date) || isNaN(e.getTime()) ? null : e.getUTCHours() === 0 && e.getUTCMinutes() === 0 && e.getUTCSeconds() === 0 && e.getUTCMilliseconds() === 0 ? "utc" : e.getHours() === 0 && e.getMinutes() === 0 && e.getSeconds() === 0 && e.getMilliseconds() === 0 ? "local" : null;
1352
+ }
1353
+ function v2(e) {
1354
+ let n = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), t2 = e.getFullYear();
1355
+ return t2 >= 0 && t2 < 100 && n.setUTCFullYear(t2), n;
1356
+ }
1357
+ function B2(e, n) {
1358
+ let t2 = [];
1359
+ for (let r of e) {
1357
1360
  if (!r || !/date|time/i.test(String(r.dataType ?? ""))) continue;
1358
- let o = 0, i = true;
1359
- for (let u2 of t) {
1361
+ let a2 = 0, i = true;
1362
+ for (let u2 of n) {
1360
1363
  let s = u2 ? u2[r.name] : void 0;
1361
1364
  if (s == null || s === "") continue;
1362
1365
  if (!(s instanceof Date)) {
@@ -1368,29 +1371,29 @@ function G2(n, t) {
1368
1371
  i = false;
1369
1372
  break;
1370
1373
  }
1371
- l === "local" && o++;
1374
+ l === "local" && a2++;
1372
1375
  }
1373
- i && o > 0 && e.push(r.name);
1376
+ i && a2 > 0 && t2.push(r.name);
1374
1377
  }
1375
- return e;
1376
- }
1377
- function rn(n, t) {
1378
- let e = G2(n, t);
1379
- return e.length === 0 ? { rows: t, columns: e } : { rows: t.map((o) => {
1380
- if (!o) return o;
1381
- let i = { ...o };
1382
- for (let u2 of e) {
1378
+ return t2;
1379
+ }
1380
+ function se(e, n) {
1381
+ let t2 = B2(e, n);
1382
+ return t2.length === 0 ? { rows: n, columns: t2 } : { rows: n.map((a2) => {
1383
+ if (!a2) return a2;
1384
+ let i = { ...a2 };
1385
+ for (let u2 of t2) {
1383
1386
  let s = i[u2];
1384
- s instanceof Date && F2(s) === "local" && (i[u2] = P2(s));
1387
+ s instanceof Date && F2(s) === "local" && (i[u2] = v2(s));
1385
1388
  }
1386
1389
  return i;
1387
- }), columns: e };
1390
+ }), columns: t2 };
1388
1391
  }
1389
- var z2 = /^\s*\d{4}(-\d{2}(-\d{2})?)?\s*$/;
1390
- var v2 = /(?:Z|[+-]\d{2}:?\d{2})$/i;
1391
- var B2 = /\b(?:GMT|UTC)\b/i;
1392
+ var Y2 = /^\s*\d{4}(-\d{2}(-\d{2})?)?\s*$/;
1393
+ var W2 = /(?:Z|[+-]\d{2}:?\d{2})$/i;
1394
+ var $2 = /\b(?:GMT|UTC)\b/i;
1392
1395
 
1393
- // ../shape-core/dist/chunk-C5I73OM2.mjs
1396
+ // ../shape-core/dist/chunk-6TVBXT4G.mjs
1394
1397
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
1395
1398
  var St = "006007008009010011012013014015016017018019020021022023024025026027028029030031032033034035036037038039040041042043044045046047048049050051052053054056057058059060061062063064065066067068069070071072073074075076077078079080081082083084085086087088089100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191193194195196197198199200201202203204205206207208209210211212214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310312313314315316317318319320321322323324325326327328329330331333334335336337338339341342344346347349350351352354355356357358359360361362363364365366367368369370371372373374376377378379380381382383384385386387388389390391392393394395396397398400401402403404405406407408409410411412413414415416417418420421422423424425426427430431432433434435436437438439440441442443444445446447448449450451452453454455456457458460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508510511512513514515516520521522523524525526527528530531532534535537538539540541542543544545546547548549550551553554556557558559560561562563564565566567570571572573574575576577580581582583584585586587588590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620622623624625626627628629630631633634635636637638639640641644645646647648650651652653654655656657658660661662664665666667668669670671672673674675676677678679680681683684685686687688689690691692693700701703704705706707708710711712713714716717718719720721722723724725726727728729730731734735736737738739740741743744745746747748749750751752753754755756757758759760761762763764765766767768769770772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816820821822823824825826827828829830831832833834835836837838840841843844845846847850851852853855856857859860863864865870871873874875877878879880881882883884890891893894895897898900902903904905906907908910911912913914915916917918919920921922923924925926927928930931932933934935936937939940941943944945946947948949950951952953954955956957958959960961967968969970971972973974975976977978979980981982983984985986988989990991992993994995996997998999";
1396
1399
  var w = new Set(St.match(/.{3}/g) ?? []);
@@ -1415,9 +1418,9 @@ function g2(n) {
1415
1418
  return u(n);
1416
1419
  }
1417
1420
  var rt = /* @__PURE__ */ new Set(["zip", "zipcode", "postal", "postcode", "plz"]);
1418
- function y4(n, s) {
1421
+ function y2(n, s) {
1419
1422
  if (!n) return false;
1420
- for (let i of d(n)) if (s.has(i)) return true;
1423
+ for (let i of p(n)) if (s.has(i)) return true;
1421
1424
  return false;
1422
1425
  }
1423
1426
  function Mt(n, s) {
@@ -1460,37 +1463,37 @@ function It(n, s) {
1460
1463
  return s === "us-zip5" ? w.has(n.slice(0, 3)) : true;
1461
1464
  }
1462
1465
  function Wt(n, s) {
1463
- let i = new Array(n.length), r = /* @__PURE__ */ new Set(), M = [], h3 = 0;
1466
+ let i = new Array(n.length), r = /* @__PURE__ */ new Set(), M2 = [], h3 = 0;
1464
1467
  for (let N3 = 0; N3 < n.length; ++N3) {
1465
- let I4 = Mt(n[N3], s), O3 = I4 !== null && It(I4, s) ? I4 : null;
1468
+ let I2 = Mt(n[N3], s), O3 = I2 !== null && It(I2, s) ? I2 : null;
1466
1469
  if (i[N3] = O3, O3 !== null) h3++;
1467
1470
  else {
1468
1471
  let d2 = n[N3];
1469
1472
  if (d2 != null) {
1470
1473
  let p2 = String(d2).trim();
1471
1474
  if (p2.length > 0) {
1472
- let m = p2.toLowerCase();
1473
- r.has(m) || (r.add(m), M.push(p2));
1475
+ let m2 = p2.toLowerCase();
1476
+ r.has(m2) || (r.add(m2), M2.push(p2));
1474
1477
  }
1475
1478
  }
1476
1479
  }
1477
1480
  }
1478
- return { iso: i, unmatched: M, matchedRows: h3, totalRows: n.length };
1481
+ return { iso: i, unmatched: M2, matchedRows: h3, totalRows: n.length };
1479
1482
  }
1480
1483
 
1481
- // ../shape-core/dist/chunk-ZVHCLXKO.mjs
1484
+ // ../shape-core/dist/chunk-KKSQBV76.mjs
1482
1485
  var import_papaparse = __toESM(require_papaparse_min(), 1);
1483
1486
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
1484
1487
  var ve = { "north-america": "AG AI AW BB BL BM BQ BS BZ CA CR CU CW DM DO GD GL GP GT HN HT JM KN KY LC MF MQ MS MX NI PA PM PR SV SX TC TT US VC VG VI", "south-america": "AR BO BR CL CO EC FK GF GY PE PY SR UY VE", europe: "AD AL AT AX BA BE BG BY CH CY CZ DE DK EE ES FI FO FR GB GG GI GR HR HU IE IM IS IT JE LI LT LU LV MC MD ME MK MT NL NO PL PT RO RS RU SE SI SJ SK SM UA VA", africa: "AO BF BI BJ BW CD CF CG CI CM CV DJ DZ EG EH ER ET GA GH GM GN GQ GW KE KM LR LS LY MA MG ML MR MU MW MZ NA NE NG RE RW SC SD SH SL SN SO SS ST SZ TD TG TN TZ UG YT ZA ZM ZW", asia: "AE AF AM AZ BD BH BN BT CC CN CX GE HK ID IL IN IO IQ IR JO JP KG KH KP KR KW KZ LA LB LK MM MN MO MV MY NP OM PH PK PS QA SA SG SY TH TJ TL TM TR TW UZ VN YE", oceania: "AS AU CK FJ FM GU KI MH MP NC NF NR NU NZ PF PG PN PW SB TK TO TV UM VU WF WS", antarctica: "AQ BV GS HM TF" };
1485
- var J3 = (() => {
1486
- let t = /* @__PURE__ */ new Map();
1487
- for (let e of Object.keys(ve)) for (let n of ve[e].split(/\s+/)) n && t.set(n, e);
1488
- return t;
1488
+ var J2 = (() => {
1489
+ let t2 = /* @__PURE__ */ new Map();
1490
+ for (let e of Object.keys(ve)) for (let n of ve[e].split(/\s+/)) n && t2.set(n, e);
1491
+ return t2;
1489
1492
  })();
1490
- function at2(t) {
1491
- for (let [e, n] of t) {
1492
- let r = J3.get(e);
1493
- r && !J3.has(n) && J3.set(n, r);
1493
+ function at2(t2) {
1494
+ for (let [e, n] of t2) {
1495
+ let r = J2.get(e);
1496
+ r && !J2.has(n) && J2.set(n, r);
1494
1497
  }
1495
1498
  }
1496
1499
  at2(N);
@@ -1498,54 +1501,54 @@ var gt = ["rate", "ratio", "pct", "percent", "percentage", "rating", "share", "s
1498
1501
  var pt = ["pct", "percent", "percentage", "rate", "ratio", "rating", "share", "score", "index", "nps", "csat", "margin", "yield", "coverage", "utilization", "utilisation", "gpa", "percentile", "quantile", "bmi", "density", "pressure", "humidity", "velocity", "efficiency", "occupancy", "latency", "throughput", "bandwidth", "iops", "ppm", "ppb", "dpmo", "bps"];
1499
1502
  var ht = ["latitude", "longitude"];
1500
1503
  var bt = ["latitude", "longitude"];
1501
- function j2(t) {
1502
- return f2(t);
1504
+ function j3(t2) {
1505
+ return f2(t2);
1503
1506
  }
1504
1507
  var de = ["somme de", "suma de", "soma de", "summe von", "som van", "somma di", "summa av", "sum av", "sum af", "soucet z", "suma z", "totaal van", "total de", "toplam", "osszeg", "nombre de", "recuento de", "contagem de", "anzahl von", "aantal van", "conteggio di", "antal av", "lukumaara", "pocet z"];
1505
- function yt2(t) {
1506
- return [...t].sort((e, n) => n.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|");
1508
+ function yt2(t2) {
1509
+ return [...t2].sort((e, n) => n.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|");
1507
1510
  }
1508
1511
  var ke = new RegExp("^\\s*(?:(?:sum|count|count\\s+distinct|distinct\\s+count)\\s+of\\s+|(?:" + yt2(de) + ")\\s+)", "i");
1509
1512
  var St2 = /(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Za-z])(?=[0-9])|(?<=[0-9])(?=[A-Za-z])/g;
1510
1513
  var _t = new RegExp("\\b(" + gt.join("|") + ")\\b|(" + pt.join("|") + ")$", "i");
1511
1514
  var At = new RegExp("\\b(" + ht.join("|") + ")\\b|(" + bt.join("|") + ")$", "i");
1512
- function Fe(t) {
1513
- if (!t) return "";
1514
- let e = String(t), n = ke.exec(j2(e));
1515
+ function Fe(t2) {
1516
+ if (!t2) return "";
1517
+ let e = String(t2), n = ke.exec(j3(e));
1515
1518
  return (n ? e.slice(n[0].length) : e).trim();
1516
1519
  }
1517
- function Ct(t) {
1518
- return !!t && ke.test(j2(String(t)));
1520
+ function Ct(t2) {
1521
+ return !!t2 && ke.test(j3(String(t2)));
1519
1522
  }
1520
1523
  var Mt2 = ["count (distinct)", "count distinct", "distinct count", "standard deviation", "average", "variance", "median", "product", "stddev", "std dev", "count", "sum", "avg", "min", "minimum", "max", "maximum", "var"];
1521
- var Oe = new RegExp("^\\s*(" + [...Mt2].sort((t, e) => e.length - t.length).map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|") + ")\\s+of\\s+", "i");
1524
+ var Oe = new RegExp("^\\s*(" + [...Mt2].sort((t2, e) => e.length - t2.length).map((t2) => t2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\s+/g, "\\s+")).join("|") + ")\\s+of\\s+", "i");
1522
1525
  var We = { Sum: ["Sum of "], Avg: ["Average of "], Average: ["Average of "], Count: ["Count of "], CountNonNull: ["Count of "], Min: ["Min of ", "First ", "Earliest "], Max: ["Max of ", "Last ", "Latest "], Median: ["Median of "], StandardDeviation: ["Standard deviation of "], Variance: ["Variance of "] };
1523
1526
  var xt = new RegExp("^(" + Object.keys(We).join("|") + ")\\((.+)\\)$");
1524
- function Rt(t) {
1525
- let e = Fe(t);
1527
+ function Rt(t2) {
1528
+ let e = Fe(t2);
1526
1529
  return e.length === 0 ? "" : e.replace(St2, " ");
1527
1530
  }
1528
- function ze(t, e) {
1531
+ function ze(t2, e) {
1529
1532
  if (!e) return false;
1530
1533
  let n = Fe(e);
1531
- return t.test(j2(Rt(e))) || t.test(j2(n)) || t.test(j2(d(n).join(" ")));
1534
+ return t2.test(j3(Rt(e))) || t2.test(j3(n)) || t2.test(j3(p(n).join(" ")));
1532
1535
  }
1533
- function $e(t) {
1534
- return ze(At, t);
1536
+ function $e(t2) {
1537
+ return ze(At, t2);
1535
1538
  }
1536
- function Tt(t) {
1537
- return ze(_t, t) || $e(t);
1539
+ function Tt(t2) {
1540
+ return ze(_t, t2) || $e(t2);
1538
1541
  }
1539
1542
  var Ue = /int|double|decimal|single|float|number|currency|money/i;
1540
- function Nt(t) {
1541
- let e = String(t?.valueNature ?? "").trim().toLowerCase();
1542
- return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t?.isMeasure === true || Ue.test(String(t?.dataType ?? "")) ? "Continuous" : "Categorical";
1543
+ function Nt(t2) {
1544
+ let e = String(t2?.valueNature ?? "").trim().toLowerCase();
1545
+ return e === "categorical" ? "Categorical" : e === "ordinal" ? "Ordinal" : e === "continuous" || t2?.isMeasure === true || Ue.test(String(t2?.dataType ?? "")) ? "Continuous" : "Categorical";
1543
1546
  }
1544
- function Et(t) {
1545
- return t?.isMeasure === true || Ue.test(String(t?.dataType ?? ""));
1547
+ function Et(t2) {
1548
+ return t2?.isMeasure === true || Ue.test(String(t2?.dataType ?? ""));
1546
1549
  }
1547
- function Ve(t) {
1548
- let e = t ?? {}, n = Nt(e);
1550
+ function Ve(t2) {
1551
+ let e = t2 ?? {}, n = Nt(e);
1549
1552
  if (n !== "Continuous") return { nature: n, additivity: "unknown", basis: "role", suppressed: false };
1550
1553
  if ($e(e.name)) return { nature: n, additivity: "positional", basis: "name", suppressed: true };
1551
1554
  let r = String(e.additivity ?? "").trim().toLowerCase();
@@ -1556,8 +1559,8 @@ function Ve(t) {
1556
1559
  }
1557
1560
  return e.discourageAggregationAcrossGroups === true ? { nature: n, additivity: "intensive_rate", basis: "host-flag", suppressed: false } : Tt(e.name) ? { nature: n, additivity: "intensive_rate", basis: "name", suppressed: false } : { nature: n, additivity: "additive", basis: "default", suppressed: false };
1558
1561
  }
1559
- function Ke(t) {
1560
- let e = Ve(t), n = t ?? {};
1562
+ function Ke(t2) {
1563
+ let e = Ve(t2), n = t2 ?? {};
1561
1564
  if (e.nature === "Categorical") return ["first", "distinctcount", "count"];
1562
1565
  if (e.nature === "Ordinal") return Et(n) ? ["median", "average", "min", "max", "first", "distinctcount", "count"] : ["first", "distinctcount", "count"];
1563
1566
  switch (e.additivity) {
@@ -1569,13 +1572,13 @@ function Ke(t) {
1569
1572
  return ["sum", "average", "median", "min", "max", "count", "distinctcount", "first"];
1570
1573
  }
1571
1574
  }
1572
- function Ln(t) {
1573
- return Ke(t)[0];
1575
+ function Ln(t2) {
1576
+ return Ke(t2)[0];
1574
1577
  }
1575
- function On(t, e) {
1578
+ function On(t2, e) {
1576
1579
  if (e !== "sum" && e !== "count") return false;
1577
1580
  if (e === "count") return true;
1578
- let n = Ve(t);
1581
+ let n = Ve(t2);
1579
1582
  return n.additivity === "additive" || n.additivity === "part_of_whole" || n.additivity === "unknown";
1580
1583
  }
1581
1584
  var wt = new RegExp([String.raw`\bisMeasure\b`, String.raw`\bdataType\b`, String.raw`\bcolumns\s*\[\s*-?\d`, String.raw`\.iloc\s*\[[^\]]*,`, String.raw`\.iat\s*\[`, String.raw`\bselect_dtypes\b`, String.raw`\b_get_numeric_data\b`, String.raw`\bis_numeric_dtype\b`, String.raw`\bfor\s+\w+\s+in\s+(?:list\s*\(\s*)?df\.columns\b`, String.raw`\bdf\.columns\s*\.\s*(?:tolist|to_list|difference|drop)\b`, String.raw`\bdf\.dtypes\b`, String.raw`\bObject\s*\.\s*(?:keys|values|entries)\s*\(\s*(?:rows|data|df)?\s*\[\s*0\s*\]`, String.raw`\b(?:row|rw|r)\s*\[\s*\d+\s*\]`].join("|"));
@@ -1583,151 +1586,156 @@ var wt = new RegExp([String.raw`\bisMeasure\b`, String.raw`\bdataType\b`, String
1583
1586
  // ../shape-core/dist/index.mjs
1584
1587
  /*! @bicharts/shape-core — Apache-2.0. Bundled reference data: GeoNames (https://www.geonames.org/) CC BY 4.0; US Census/TIGER (public domain). Full text: NOTICE in this package. */
1585
1588
  var K3 = 2;
1586
- var J4 = 400;
1587
- function z3(e) {
1589
+ var te2 = 400;
1590
+ function B3(e) {
1588
1591
  return !!E(e);
1589
1592
  }
1590
- function T3(e) {
1593
+ function P4(e) {
1591
1594
  let n = /* @__PURE__ */ new Set();
1592
- for (let t of e) {
1593
- if (t == null) continue;
1594
- let o = u(String(t));
1595
- if (!V(o) && !n.has(o) && (n.add(o), n.size >= J4)) break;
1595
+ for (let r of e) {
1596
+ if (r == null) continue;
1597
+ let o2 = u(String(r));
1598
+ if (!V(o2) && !n.has(o2) && (n.add(o2), n.size >= te2)) break;
1596
1599
  }
1597
1600
  return Array.from(n);
1598
1601
  }
1599
- function v3(e) {
1600
- let n = T3(e);
1601
- if (n.length === 0 || B3(e) < 95) return false;
1602
- let t = n.filter((u2) => z3(u2) && !Y(u2)).length, o = n.filter((u2) => !z3(u2) && !!Y(u2)).length;
1603
- return t >= 1 && t >= o;
1602
+ function L4(e) {
1603
+ let n = P4(e);
1604
+ if (n.length === 0 || j4(e) < 95) return false;
1605
+ let r = n.filter((u2) => B3(u2) && !Y(u2)).length, o2 = n.filter((u2) => !B3(u2) && !!Y(u2)).length;
1606
+ return r >= 1 && r >= o2;
1604
1607
  }
1605
- function Y3(e, n) {
1608
+ function ee3(e, n) {
1606
1609
  if (!Y(e)) return false;
1607
- let t = E(e);
1608
- return t ? n === "world" ? true : s3.has(t) : false;
1610
+ let r = E(e);
1611
+ return r ? n === "world" ? true : s3.has(r) : false;
1609
1612
  }
1610
- function B3(e) {
1611
- let n = T3(e);
1613
+ function j4(e) {
1614
+ let n = P4(e);
1612
1615
  if (n.length === 0) return 0;
1613
- let t = 0;
1614
- for (let o of n) z3(o) && t++;
1615
- return Math.round(t / n.length * 1e3) / 10;
1616
+ let r = 0;
1617
+ for (let o2 of n) B3(o2) && r++;
1618
+ return Math.round(r / n.length * 1e3) / 10;
1616
1619
  }
1617
- function L2(e) {
1618
- let n = T3(e);
1620
+ function w2(e) {
1621
+ let n = P4(e);
1619
1622
  if (n.length === 0) return 0;
1620
- let t = 0;
1621
- for (let o of n) Y(o) && t++;
1622
- return Math.round(t / n.length * 1e3) / 10;
1623
+ let r = 0;
1624
+ for (let o2 of n) Y(o2) && r++;
1625
+ return Math.round(r / n.length * 1e3) / 10;
1623
1626
  }
1624
- function U3(e) {
1627
+ function $3(e) {
1625
1628
  let n = /* @__PURE__ */ new Set();
1626
- for (let t of e) {
1627
- if (t == null) continue;
1628
- let o = String(t).trim();
1629
- if (!V(u(o)) && !n.has(o) && (n.add(o), n.size >= J4)) break;
1629
+ for (let r of e) {
1630
+ if (r == null) continue;
1631
+ let o2 = String(r).trim();
1632
+ if (!V(u(o2)) && !n.has(o2) && (n.add(o2), n.size >= te2)) break;
1630
1633
  }
1631
1634
  return Array.from(n);
1632
1635
  }
1633
- function $2(e) {
1634
- let n = U3(e);
1636
+ function W3(e) {
1637
+ let n = $3(e);
1635
1638
  if (n.length === 0) return 0;
1636
- let t = 0;
1637
- for (let o of n) Z(o).length > 0 && t++;
1638
- return Math.round(t / n.length * 1e3) / 10;
1639
- }
1640
- function Z3(e, n) {
1641
- return y4(n, rt) ? true : U3(e).some((t) => /^\d{5}(-\d{4})?$/.test(t.replace(/\.0+$/, "")));
1642
- }
1643
- function ot(e, n) {
1644
- let t = T3(e);
1645
- if (t.length === 0) return 0;
1646
- let o = 0;
1647
- for (let u2 of t) p3(u2, n) && o++;
1648
- return Math.round(o / t.length * 1e3) / 10;
1649
- }
1650
- function W2(e, n) {
1651
- let t = 0;
1652
- for (let o of T3(e)) n(o) && t++;
1653
- return t;
1654
- }
1655
- function it2(e, n) {
1656
- let t = 0;
1657
- for (let o of U3(e)) n(o) && t++;
1658
- return t;
1659
- }
1660
- function st(e, n, t, o, u2) {
1661
- let a4 = [], s = [], i = {}, h3 = {}, x2 = new Set(e), f4 = (r) => n.map((l) => l[r]);
1662
- for (let r of ["city", "country"]) {
1663
- let l = t?.[r];
1664
- l && x2.has(l) && (i[r] = l);
1639
+ let r = 0;
1640
+ for (let o2 of n) Z(o2).length > 0 && r++;
1641
+ return Math.round(r / n.length * 1e3) / 10;
1642
+ }
1643
+ function ne2(e, n) {
1644
+ return y2(n, rt) ? true : $3(e).some((r) => /^\d{5}(-\d{4})?$/.test(r.replace(/\.0+$/, "")));
1645
+ }
1646
+ function mt(e, n) {
1647
+ let r = P4(e);
1648
+ if (r.length === 0) return 0;
1649
+ let o2 = 0;
1650
+ for (let u2 of r) p3(u2, n) && o2++;
1651
+ return Math.round(o2 / r.length * 1e3) / 10;
1652
+ }
1653
+ function U3(e, n) {
1654
+ let r = 0;
1655
+ for (let o2 of P4(e)) n(o2) && r++;
1656
+ return r;
1657
+ }
1658
+ function ft2(e, n) {
1659
+ let r = 0;
1660
+ for (let o2 of $3(e)) n(o2) && r++;
1661
+ return r;
1662
+ }
1663
+ function pt2(e, n, r, o2, u2) {
1664
+ let l = [], s = [], a2 = {}, C = {}, x3 = new Set(e), p2 = (i) => n.map((c2) => c2[i]);
1665
+ for (let i of ["city", "country"]) {
1666
+ let c2 = r?.[i];
1667
+ c2 && x3.has(c2) && (a2[i] = c2);
1665
1668
  }
1666
- let ue = new Set(u2 ?? e);
1667
- for (let r of ["lat", "lon"]) {
1668
- let l = t?.[r];
1669
- l && ue.has(l) && (i[r] = l);
1669
+ let ge2 = new Set(u2 ?? e);
1670
+ for (let i of ["lat", "lon"]) {
1671
+ let c2 = r?.[i];
1672
+ c2 && ge2.has(c2) && (a2[i] = c2);
1670
1673
  }
1671
- let C2 = t?.zip;
1672
- if (C2 && x2.has(C2)) {
1673
- let r = f4(C2), l = $2(r);
1674
- l < 95 ? s.push(`zip=${C2} (only ${l}% of values read as ZIPs)`) : Z3(r, C2) ? i.zip = C2 : s.push(`zip=${C2} (all values are 3-4 digits with nothing to say they are postal)`);
1674
+ let b2 = r?.zip;
1675
+ if (b2 && x3.has(b2)) {
1676
+ let i = p2(b2), c2 = W3(i);
1677
+ c2 < 95 ? s.push(`zip=${b2} (only ${c2}% of values read as ZIPs)`) : ne2(i, b2) ? a2.zip = b2 : s.push(`zip=${b2} (all values are 3-4 digits with nothing to say they are postal)`);
1675
1678
  }
1676
- let g3 = t?.state;
1677
- if (g3 && x2.has(g3)) {
1678
- let r = f4(g3), l = T3(r);
1679
- l.length > 0 && l.every((d2) => Y3(d2, o)) ? s.push(`state=${g3} (every value is "CA", which is both Canada and California)`) : v3(r) ? (s.push(`state=${g3} (every value is a country, not a state)`), i.country || (i.country = g3)) : L2(r) < 95 ? s.push(`state=${g3} (only ${L2(r)}% of values are states/provinces)`) : i.state = g3;
1679
+ let y4 = r?.state;
1680
+ if (y4 && x3.has(y4)) {
1681
+ let i = p2(y4), c2 = P4(i);
1682
+ c2.length > 0 && c2.every((m2) => ee3(m2, o2)) ? s.push(`state=${y4} (every value is "CA", which is both Canada and California)`) : L4(i) ? (s.push(`state=${y4} (every value is a country, not a state)`), a2.country || (a2.country = y4)) : w2(i) < 95 ? s.push(`state=${y4} (only ${w2(i)}% of values are states/provinces)`) : a2.state = y4;
1680
1683
  }
1681
- let b4 = new Set(Object.values(i).filter(Boolean)), F3 = e.filter((r) => !b4.has(r) && !r.startsWith("__"));
1682
- if (!i.state) {
1683
- let r = null;
1684
- for (let l of F3) {
1685
- let d2 = f4(l);
1686
- if (v3(d2)) continue;
1687
- let p2 = L2(d2);
1688
- if (p2 < 95) continue;
1689
- let k3 = W2(d2, (I4) => !!Y(I4)), de2 = W2(d2, (I4) => !!Y(I4) && !Y3(I4, o));
1690
- k3 < K3 && de2 < 1 || (!r || p2 > r.pct) && (r = { name: l, pct: p2 });
1684
+ let R2 = new Set(Object.values(a2).filter(Boolean)), A2 = e.filter((i) => !R2.has(i) && !i.startsWith("__"));
1685
+ if (!a2.state) {
1686
+ let i = null;
1687
+ for (let c2 of A2) {
1688
+ let m2 = p2(c2);
1689
+ if (L4(m2)) continue;
1690
+ let g3 = w2(m2);
1691
+ if (g3 < 95) continue;
1692
+ let O3 = U3(m2, (T2) => !!Y(T2)), he = U3(m2, (T2) => !!Y(T2) && !ee3(T2, o2));
1693
+ O3 < K3 && he < 1 || (!i || g3 > i.pct) && (i = { name: c2, pct: g3 });
1691
1694
  }
1692
- r && (i.state = r.name, b4.add(r.name), a4.push(`state=${r.name} (${r.pct}% states/provinces)`));
1695
+ i && (a2.state = i.name, R2.add(i.name), l.push(`state=${i.name} (${i.pct}% states/provinces)`));
1693
1696
  }
1694
- if (!i.zip) for (let r of F3) {
1695
- if (b4.has(r)) continue;
1696
- let l = f4(r), d2 = $2(l);
1697
- if (!(d2 < 95) && Z3(l, r) && !(it2(l, (p2) => Z(p2).length > 0) < K3)) {
1698
- i.zip = r, b4.add(r), a4.push(`zip=${r} (${d2}% ZIP codes)`);
1697
+ if (!a2.zip) for (let i of A2) {
1698
+ if (R2.has(i)) continue;
1699
+ let c2 = p2(i), m2 = W3(c2);
1700
+ if (!(m2 < 95) && ne2(c2, i) && !(ft2(c2, (g3) => Z(g3).length > 0) < K3)) {
1701
+ a2.zip = i, R2.add(i), l.push(`zip=${i} (${m2}% ZIP codes)`);
1699
1702
  break;
1700
1703
  }
1701
1704
  }
1702
- let P4 = i.country;
1703
- if (!P4 || !v3(f4(P4))) {
1704
- let r = null;
1705
- for (let l of F3) {
1706
- if (b4.has(l) || !v3(f4(l))) continue;
1707
- let d2 = B3(f4(l));
1708
- (!r || d2 > r.pct) && (r = { name: l, pct: d2 });
1705
+ let E4 = a2.country;
1706
+ if (!E4 || !L4(p2(E4))) {
1707
+ let i = null;
1708
+ for (let c2 of A2) {
1709
+ if (R2.has(c2) || !L4(p2(c2))) continue;
1710
+ let m2 = j4(p2(c2));
1711
+ (!i || m2 > i.pct) && (i = { name: c2, pct: m2 });
1709
1712
  }
1710
- r && (P4 && (s.push(`country=${P4} (only ${B3(f4(P4))}% of values are country identifiers; using ${r.name} instead)`), h3.country = P4), i.country = r.name, b4.add(r.name), a4.push(`country=${r.name}`));
1713
+ i && (E4 && (s.push(`country=${E4} (only ${j4(p2(E4))}% of values are country identifiers; using ${i.name} instead)`), C.country = E4), a2.country = i.name, R2.add(i.name), l.push(`country=${i.name}`));
1711
1714
  }
1712
- if (!i.city) {
1713
- let r = null;
1714
- for (let l of F3) {
1715
- if (b4.has(l)) continue;
1716
- let d2 = f4(l), p2 = ot(d2, o);
1717
- p2 < m3 || W2(d2, (k3) => p3(k3, o)) < K3 || (!r || p2 > r.pct) && (r = { name: l, pct: p2 });
1715
+ if (!a2.city) {
1716
+ let i = null;
1717
+ for (let c2 of A2) {
1718
+ if (R2.has(c2)) continue;
1719
+ let m2 = p2(c2), g3 = mt(m2, o2);
1720
+ g3 < m3 || U3(m2, (O3) => p3(O3, o2)) < K3 || (!i || g3 > i.pct) && (i = { name: c2, pct: g3 });
1718
1721
  }
1719
- r && (i.city = r.name, a4.push(`city=${r.name} (${r.pct}% known cities)`));
1722
+ i && (a2.city = i.name, l.push(`city=${i.name} (${i.pct}% known cities)`));
1720
1723
  }
1721
- let H3 = i.country ? f4(i.country) : [], _2 = !!i.country && v3(H3), ce = _2 ? new Set(H3.map((r) => E(r == null ? null : String(r))).filter(Boolean)).size : 0, j3 = _2 && ce >= 2, O3 = !!(i.lat && i.lon) && n.some((r) => {
1722
- let l = +String(r[i.lat] ?? "").trim(), d2 = +String(r[i.lon] ?? "").trim();
1723
- return isFinite(l) && isFinite(d2) && l >= -90 && l <= 90 && d2 >= -180 && d2 <= 180 && String(r[i.lat] ?? "").trim() !== "" && String(r[i.lon] ?? "").trim() !== "";
1724
+ let Q3 = a2.country ? p2(a2.country) : [], k3 = !!a2.country && L4(Q3), ye = k3 ? new Set(Q3.map((i) => E(i == null ? null : String(i))).filter(Boolean)).size : 0, Y3 = k3 && ye >= 2, V3 = !!(a2.lat && a2.lon) && n.some((i) => {
1725
+ let c2 = +String(i[a2.lat] ?? "").trim(), m2 = +String(i[a2.lon] ?? "").trim();
1726
+ return isFinite(c2) && isFinite(m2) && c2 >= -90 && c2 <= 90 && m2 >= -180 && m2 <= 180 && String(i[a2.lat] ?? "").trim() !== "" && String(i[a2.lon] ?? "").trim() !== "";
1724
1727
  });
1725
- return i.lat && i.lon && !O3 && s.push(`lat/lon=${i.lat}/${i.lon} (no row holds a usable coordinate pair)`), i.country && !j3 && !(i.city || i.state || i.zip || O3) && s.push(_2 ? `country=${i.country} (every row resolves to the same country - nothing to place apart)` : `country=${i.country} (values are not country identifiers)`), { bind: !!(i.city || i.state || i.zip || j3 || O3) ? i : null, backfilled: a4, refused: s, ...Object.keys(h3).length ? { labelFallback: h3 } : {} };
1726
- }
1727
- var St3 = Object.freeze({ integer: "number", decimal: "number", double: "number", datetime: "date", date: "date", boolean: "boolean", string: "text" });
1728
- var Nt2 = Object.freeze({ RENDER_START: "render-start", RENDER_OK: "render-ok", RENDER_ERROR: "render-error", VIEW: "view", VIEW_VERDICT: "view-verdict" });
1728
+ return a2.lat && a2.lon && !V3 && s.push(`lat/lon=${a2.lat}/${a2.lon} (no row holds a usable coordinate pair)`), a2.country && !Y3 && !(a2.city || a2.state || a2.zip || V3) && s.push(k3 ? `country=${a2.country} (every row resolves to the same country - nothing to place apart)` : `country=${a2.country} (values are not country identifiers)`), { bind: !!(a2.city || a2.state || a2.zip || Y3 || V3) ? a2 : null, backfilled: l, refused: s, ...Object.keys(C).length ? { labelFallback: C } : {} };
1729
+ }
1730
+ var t = (e, ...n) => ({ part: e, langs: Object.freeze(n) });
1731
+ var H3 = Object.freeze({ jaar: t("year", "nl"), kwartaal: t("quarter", "nl"), maand: t("month", "nl"), dag: t("day", "nl", "sv", "da", "nb"), jahr: t("year", "de"), quartal: t("quarter", "de"), monat: t("month", "de"), tag: t("day", "de"), ann\u00E9e: t("year", "fr"), mois: t("month", "fr"), jour: t("day", "fr"), trimestre: t("quarter", "fr", "es", "pt", "it"), a\u00F1o: t("year", "es"), mes: t("month", "es"), d\u00EDa: t("day", "es"), ano: t("year", "pt"), m\u00EAs: t("month", "pt"), dia: t("day", "pt"), anno: t("year", "it"), mese: t("month", "it"), giorno: t("day", "it"), \u0433\u043E\u0434: t("year", "ru"), \u043C\u0435\u0441\u044F\u0446: t("month", "ru"), \u0440\u0456\u043A: t("year", "uk"), \u043C\u0456\u0441\u044F\u0446\u044C: t("month", "uk"), \u043A\u0432\u0430\u0440\u0442\u0430\u043B: t("quarter", "ru", "uk"), \u0434\u0435\u043D\u044C: t("day", "ru", "uk"), rok: t("year", "pl", "cs", "sk"), kwarta\u0142: t("quarter", "pl"), miesi\u0105c: t("month", "pl"), dzie\u0144: t("day", "pl"), \u010Dtvrtlet\u00ED: t("quarter", "cs"), m\u011Bs\u00EDc: t("month", "cs"), den: t("day", "cs"), \u0161tvr\u0165rok: t("quarter", "sk"), mesiac: t("month", "sk"), de\u0148: t("day", "sk"), \u00E5r: t("year", "sv", "da", "nb"), kvartal: t("quarter", "sv", "da", "nb"), m\u00E5nad: t("month", "sv"), m\u00E5ned: t("month", "da", "nb"), vuosi: t("year", "fi"), vuosinelj\u00E4nnes: t("quarter", "fi"), kuukausi: t("month", "fi"), p\u00E4iv\u00E4: t("day", "fi"), \u00E9v: t("year", "hu"), negyed\u00E9v: t("quarter", "hu"), h\u00F3nap: t("month", "hu"), nap: t("day", "hu"), y\u0131l: t("year", "tr"), \u00E7eyrek: t("quarter", "tr"), ay: t("month", "tr"), g\u00FCn: t("day", "tr"), \u03AD\u03C4\u03BF\u03C2: t("year", "el"), \u03C4\u03C1\u03AF\u03BC\u03B7\u03BD\u03BF: t("quarter", "el"), \u03BC\u03AE\u03BD\u03B1\u03C2: t("month", "el"), \u03B7\u03BC\u03AD\u03C1\u03B1: t("day", "el"), an: t("year", "ro"), trimestru: t("quarter", "ro"), lun\u0103: t("month", "ro"), zi: t("day", "ro"), godina: t("year", "hr"), tromjese\u010Dje: t("quarter", "hr"), mjesec: t("month", "hr"), dan: t("day", "hr"), \u5E74: t("year", "ja", "zh"), \u56DB\u534A\u671F: t("quarter", "ja"), \u5B63\u5EA6: t("quarter", "zh"), \u6708: t("month", "ja", "zh"), \u65E5: t("day", "ja", "zh"), \uC5F0\uB3C4: t("year", "ko"), \uBD84\uAE30: t("quarter", "ko"), \uC6D4: t("month", "ko"), \uC77C: t("day", "ko"), tahun: t("year", "id"), kuartal: t("quarter", "id"), triwulan: t("quarter", "id"), bulan: t("month", "id"), hari: t("day", "id"), n\u0103m: t("year", "vi"), qu\u00FD: t("quarter", "vi"), th\u00E1ng: t("month", "vi"), ng\u00E0y: t("day", "vi"), \u0E1B\u0E35: t("year", "th"), \u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A: t("quarter", "th"), \u0E40\u0E14\u0E37\u0E2D\u0E19: t("month", "th"), \u0E27\u0E31\u0E19: t("day", "th"), \u0627\u0644\u0633\u0646\u0629: t("year", "ar"), \u0633\u0646\u0629: t("year", "ar"), \u0627\u0644\u0639\u0627\u0645: t("year", "ar"), \u0639\u0627\u0645: t("year", "ar"), \u0627\u0644\u0631\u0628\u0639: t("quarter", "ar"), \u0631\u0628\u0639: t("quarter", "ar"), "\u0631\u0628\u0639 \u0627\u0644\u0633\u0646\u0629": t("quarter", "ar"), \u0627\u0644\u0634\u0647\u0631: t("month", "ar"), \u0634\u0647\u0631: t("month", "ar"), \u0627\u0644\u064A\u0648\u0645: t("day", "ar"), \u064A\u0648\u0645: t("day", "ar"), \u05E9\u05E0\u05D4: t("year", "he"), \u05E8\u05D1\u05E2\u05D5\u05DF: t("quarter", "he"), \u05D7\u05D5\u05D3\u05E9: t("month", "he"), \u05D9\u05D5\u05DD: t("day", "he"), \u0935\u0930\u094D\u0937: t("year", "hi"), \u0938\u093E\u0932: t("year", "hi"), \u0924\u093F\u092E\u093E\u0939\u0940: t("quarter", "hi"), \u092E\u0939\u0940\u0928\u093E: t("month", "hi"), \u092E\u093E\u0939: t("month", "hi"), \u0926\u093F\u0928: t("day", "hi"), \u0633\u0627\u0644: t("year", "fa"), \u0645\u0627\u0647: t("month", "fa"), \u0631\u0648\u0632: t("day", "fa") });
1732
+ var gt2 = Object.freeze(Array.from(new Set(Object.values(H3).flatMap((e) => e.langs))));
1733
+ var re2 = Object.freeze(["fa", "ar", "he", "th"]);
1734
+ var Mt3 = Object.freeze({ integer: "number", decimal: "number", double: "number", datetime: "date", date: "date", boolean: "boolean", string: "text" });
1735
+ var Dt2 = Object.freeze({ RENDER_START: "render-start", RENDER_OK: "render-ok", RENDER_ERROR: "render-error", VIEW: "view", VIEW_VERDICT: "view-verdict" });
1729
1736
 
1730
1737
  // src/payload.ts
1738
+ var ROW_IDX_COLUMN = "__rowIdx__";
1731
1739
  function resolvePointChannel(cols, rowObjs, point) {
1732
1740
  let pLat = null;
1733
1741
  let pLon = null;
@@ -1739,7 +1747,7 @@ function resolvePointChannel(cols, rowObjs, point) {
1739
1747
  let labelCol;
1740
1748
  if (bind) {
1741
1749
  const dims = cols.filter((c2) => !c2.isMeasure).map((c2) => c2.name);
1742
- const res = st(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
1750
+ const res = pt2(dims, rowObjs, bind, point?.mapKind, cols.map((c2) => c2.name));
1743
1751
  bind = res.bind;
1744
1752
  rolesBackfilled = res.backfilled;
1745
1753
  rolesRefused = res.refused;
@@ -1784,20 +1792,20 @@ function resolvePointChannel(cols, rowObjs, point) {
1784
1792
  return { lat: pLat, lon: pLon, prec: pPrec, geoPoint, rolesRefused };
1785
1793
  }
1786
1794
  function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
1787
- const colNames = cols.map((c2) => c2.name);
1795
+ cols = cols.filter((c2) => c2.name !== ROW_IDX_COLUMN);
1788
1796
  let utcDayColumns = null;
1789
1797
  if (opts?.utcDays) {
1790
- const norm = rn(cols, rowObjs);
1798
+ const norm = se(cols, rowObjs);
1791
1799
  rowObjs = norm.rows;
1792
1800
  utcDayColumns = norm.columns;
1793
1801
  }
1794
- const o = resolvePointChannel(cols, rowObjs, point);
1802
+ const o2 = resolvePointChannel(cols, rowObjs, point);
1795
1803
  const d2 = resolvePointChannel(cols, rowObjs, destination);
1796
- const pLat = o.lat, pLon = o.lon, pPrec = o.prec;
1804
+ const pLat = o2.lat, pLon = o2.lon, pPrec = o2.prec;
1797
1805
  const dLat = d2.lat, dLon = d2.lon, dPrec = d2.prec;
1798
- const geoPoint = o.geoPoint;
1806
+ const geoPoint = o2.geoPoint;
1799
1807
  const geoPointDest = d2.geoPoint;
1800
- const rolesRefused = [...o.rolesRefused, ...d2.rolesRefused.map((s) => `destination: ${s}`)];
1808
+ const rolesRefused = [...o2.rolesRefused, ...d2.rolesRefused.map((s) => `destination: ${s}`)];
1801
1809
  let geoIso = null;
1802
1810
  let geoUnmatched;
1803
1811
  let geoUnmatchedDistinct;
@@ -1807,50 +1815,53 @@ function buildRenderPayload(cols, rowObjs, geo, point, destination, opts) {
1807
1815
  geoUnmatched = { count: built.totalRows - built.matchedRows, examples: built.unmatched.slice(0, 8) };
1808
1816
  geoUnmatchedDistinct = built.unmatched.length;
1809
1817
  }
1810
- const hostNames = ["__rowIdx__"];
1818
+ const hostNames = [ROW_IDX_COLUMN];
1811
1819
  if (geoIso) hostNames.push("__geoIso__");
1812
1820
  if (pLat) hostNames.push("__geoLat__", "__geoLon__", "__geoPrecision__");
1813
1821
  if (dLat) hostNames.push("__geoLatD__", "__geoLonD__", "__geoPrecisionD__");
1822
+ const owned = new Set(hostNames);
1823
+ if (cols.some((c2) => owned.has(c2.name))) cols = cols.filter((c2) => !owned.has(c2.name));
1824
+ const colNames = cols.map((c2) => c2.name);
1814
1825
  const aliasCols = [];
1815
1826
  if (opts?.aliases && opts.aliases.length > 0) {
1816
1827
  const claimed = /* @__PURE__ */ new Set([...colNames, ...hostNames]);
1817
- for (const a4 of opts.aliases) {
1818
- const from = a4 ? colNames.indexOf(a4.name) : -1;
1819
- if (from < 0 || !a4.alias || claimed.has(a4.alias)) continue;
1820
- claimed.add(a4.alias);
1821
- aliasCols.push({ from, name: a4.alias });
1828
+ for (const a2 of opts.aliases) {
1829
+ const from = a2 ? colNames.indexOf(a2.name) : -1;
1830
+ if (from < 0 || !a2.alias || claimed.has(a2.alias)) continue;
1831
+ claimed.add(a2.alias);
1832
+ aliasCols.push({ from, name: a2.alias });
1822
1833
  }
1823
1834
  }
1824
1835
  const extra = hostNames.length + aliasCols.length;
1825
1836
  const out = new Array(rowObjs.length);
1826
1837
  for (let r = 0; r < rowObjs.length; r++) {
1827
1838
  const row = rowObjs[r];
1828
- const a4 = new Array(cols.length + extra);
1839
+ const a2 = new Array(cols.length + extra);
1829
1840
  for (let c2 = 0; c2 < cols.length; c2++) {
1830
- const v4 = row[colNames[c2]];
1831
- if (v4 instanceof Date) {
1832
- a4[c2] = v4.toISOString();
1841
+ const v3 = row[colNames[c2]];
1842
+ if (v3 instanceof Date) {
1843
+ a2[c2] = v3.toISOString();
1833
1844
  } else {
1834
- a4[c2] = v4 ?? null;
1845
+ a2[c2] = v3 ?? null;
1835
1846
  }
1836
1847
  }
1837
1848
  let k3 = cols.length;
1838
- a4[k3++] = r;
1839
- if (geoIso) a4[k3++] = geoIso[r];
1849
+ a2[k3++] = r;
1850
+ if (geoIso) a2[k3++] = geoIso[r];
1840
1851
  if (pLat && pLon) {
1841
- a4[k3++] = pLat[r];
1842
- a4[k3++] = pLon[r];
1843
- a4[k3++] = pPrec ? pPrec[r] : null;
1852
+ a2[k3++] = pLat[r];
1853
+ a2[k3++] = pLon[r];
1854
+ a2[k3++] = pPrec ? pPrec[r] : null;
1844
1855
  }
1845
1856
  if (dLat && dLon) {
1846
- a4[k3++] = dLat[r];
1847
- a4[k3++] = dLon[r];
1848
- a4[k3++] = dPrec ? dPrec[r] : null;
1857
+ a2[k3++] = dLat[r];
1858
+ a2[k3++] = dLon[r];
1859
+ a2[k3++] = dPrec ? dPrec[r] : null;
1849
1860
  }
1850
- for (const ac of aliasCols) a4[k3++] = a4[ac.from];
1851
- out[r] = a4;
1861
+ for (const ac of aliasCols) a2[k3++] = a2[ac.from];
1862
+ out[r] = a2;
1852
1863
  }
1853
- const colsOut = [...cols, { name: "__rowIdx__", dataType: "Integer", isMeasure: false, modelDesc: "" }];
1864
+ const colsOut = [...cols, { name: ROW_IDX_COLUMN, dataType: "Integer", isMeasure: false, modelDesc: "" }];
1854
1865
  if (geoIso) colsOut.push({ name: "__geoIso__", dataType: "String", isMeasure: false, modelDesc: "" });
1855
1866
  if (pLat) colsOut.push(
1856
1867
  { name: "__geoLat__", dataType: "Double", isMeasure: false, modelDesc: "" },
@@ -1930,10 +1941,10 @@ function stripJsComments(code) {
1930
1941
  continue;
1931
1942
  }
1932
1943
  if (ch === "/" && next === "/") {
1933
- let j3 = i + 2;
1934
- while (j3 < n && src[j3] !== "\n" && src[j3] !== "\r") j3++;
1944
+ let j5 = i + 2;
1945
+ while (j5 < n && src[j5] !== "\n" && src[j5] !== "\r") j5++;
1935
1946
  out += " ";
1936
- i = j3;
1947
+ i = j5;
1937
1948
  wordOpen = false;
1938
1949
  continue;
1939
1950
  }
@@ -1947,10 +1958,10 @@ function stripJsComments(code) {
1947
1958
  continue;
1948
1959
  }
1949
1960
  if (ch === "'" || ch === '"') {
1950
- let j3 = i + 1;
1951
- while (j3 < n && src[j3] !== ch && src[j3] !== "\n") j3 += src[j3] === "\\" ? 2 : 1;
1952
- out += src.slice(i, Math.min(j3 + 1, n));
1953
- i = j3 + 1;
1961
+ let j5 = i + 1;
1962
+ while (j5 < n && src[j5] !== ch && src[j5] !== "\n") j5 += src[j5] === "\\" ? 2 : 1;
1963
+ out += src.slice(i, Math.min(j5 + 1, n));
1964
+ i = j5 + 1;
1954
1965
  prevSig = ch;
1955
1966
  prevWord = "";
1956
1967
  wordOpen = false;
@@ -1964,23 +1975,23 @@ function stripJsComments(code) {
1964
1975
  continue;
1965
1976
  }
1966
1977
  if (ch === "/" && regexMayFollow()) {
1967
- let j3 = i + 1, inClass = false;
1968
- while (j3 < n && src[j3] !== "\n") {
1969
- const c2 = src[j3];
1978
+ let j5 = i + 1, inClass = false;
1979
+ while (j5 < n && src[j5] !== "\n") {
1980
+ const c2 = src[j5];
1970
1981
  if (c2 === "\\") {
1971
- j3 += 2;
1982
+ j5 += 2;
1972
1983
  continue;
1973
1984
  }
1974
1985
  if (c2 === "[") inClass = true;
1975
1986
  else if (c2 === "]") inClass = false;
1976
1987
  else if (c2 === "/" && !inClass) break;
1977
- j3++;
1988
+ j5++;
1978
1989
  }
1979
- if (j3 < n && src[j3] === "/") {
1980
- j3++;
1981
- while (j3 < n && /[A-Za-z]/.test(src[j3])) j3++;
1982
- out += src.slice(i, j3);
1983
- i = j3;
1990
+ if (j5 < n && src[j5] === "/") {
1991
+ j5++;
1992
+ while (j5 < n && /[A-Za-z]/.test(src[j5])) j5++;
1993
+ out += src.slice(i, j5);
1994
+ i = j5;
1984
1995
  prevSig = "/";
1985
1996
  prevWord = "";
1986
1997
  wordOpen = false;
@@ -2029,10 +2040,10 @@ function isInsideControl(target, container) {
2029
2040
  }
2030
2041
  function createMarkResolver(env) {
2031
2042
  const { root, doc, log } = env;
2032
- const isElement = (t) => {
2043
+ const isElement = (t2) => {
2033
2044
  const E4 = doc?.defaultView?.Element ?? globalThis.Element;
2034
- if (E4 && t instanceof E4) return true;
2035
- return !!t && typeof t.closest === "function" && typeof t.getAttribute === "function";
2045
+ if (E4 && t2 instanceof E4) return true;
2046
+ return !!t2 && typeof t2.closest === "function" && typeof t2.getAttribute === "function";
2036
2047
  };
2037
2048
  const viewStyle = (n) => {
2038
2049
  try {
@@ -2050,26 +2061,26 @@ function createMarkResolver(env) {
2050
2061
  const so = parseFloat(el.getAttribute("stroke-opacity") || "1");
2051
2062
  return s === "transparent" || s === "none" || so <= 0.01;
2052
2063
  };
2053
- const distToPathCenterline = (el, x2, y5) => {
2054
- const L4 = el.getTotalLength();
2055
- if (!(L4 > 0)) return Number.MAX_VALUE;
2056
- const m = el.getScreenCTM();
2057
- if (!m) return Number.MAX_VALUE;
2064
+ const distToPathCenterline = (el, x3, y4) => {
2065
+ const L5 = el.getTotalLength();
2066
+ if (!(L5 > 0)) return Number.MAX_VALUE;
2067
+ const m2 = el.getScreenCTM();
2068
+ if (!m2) return Number.MAX_VALUE;
2058
2069
  let best = Number.MAX_VALUE;
2059
2070
  const N3 = 64;
2060
2071
  for (let i = 0; i <= N3; i++) {
2061
- const pt2 = el.getPointAtLength(L4 * i / N3);
2062
- const dx = m.a * pt2.x + m.c * pt2.y + m.e - x2;
2063
- const dy = m.b * pt2.x + m.d * pt2.y + m.f - y5;
2072
+ const pt3 = el.getPointAtLength(L5 * i / N3);
2073
+ const dx = m2.a * pt3.x + m2.c * pt3.y + m2.e - x3;
2074
+ const dy = m2.b * pt3.x + m2.d * pt3.y + m2.f - y4;
2064
2075
  const d2 = dx * dx + dy * dy;
2065
2076
  if (d2 < best) best = d2;
2066
2077
  }
2067
2078
  return Math.sqrt(best);
2068
2079
  };
2069
- const refineHitCorridor = (mark, x2, y5, sel) => {
2080
+ const refineHitCorridor = (mark, x3, y4, sel) => {
2070
2081
  try {
2071
2082
  if (!mark || !isInvisibleStrokePath(mark) || !mark.getAttribute("data-row-idx")) return mark;
2072
- const stack = doc.elementsFromPoint(x2, y5);
2083
+ const stack = doc.elementsFromPoint(x3, y4);
2073
2084
  const candidates = [];
2074
2085
  for (const el of stack) {
2075
2086
  if (!root.contains(el)) continue;
@@ -2083,7 +2094,7 @@ function createMarkResolver(env) {
2083
2094
  let best = mark;
2084
2095
  let bestD = Number.MAX_VALUE;
2085
2096
  for (const el of candidates) {
2086
- const d2 = distToPathCenterline(el, x2, y5);
2097
+ const d2 = distToPathCenterline(el, x3, y4);
2087
2098
  if (d2 < bestD) {
2088
2099
  bestD = d2;
2089
2100
  best = el;
@@ -2105,9 +2116,9 @@ function createMarkResolver(env) {
2105
2116
  const findMark = (target, sel = ".d3-mark", ev) => {
2106
2117
  if (!isElement(target)) return null;
2107
2118
  const el = target;
2108
- const m = el.closest(sel);
2109
- if (m && ev) return refineHitCorridor(m, ev.clientX, ev.clientY, sel);
2110
- return m;
2119
+ const m2 = el.closest(sel);
2120
+ if (m2 && ev) return refineHitCorridor(m2, ev.clientX, ev.clientY, sel);
2121
+ return m2;
2111
2122
  };
2112
2123
  const rowIdxsFromMark = (el) => {
2113
2124
  if (!el) return [];
@@ -2120,9 +2131,9 @@ function createMarkResolver(env) {
2120
2131
  }
2121
2132
  return out;
2122
2133
  };
2123
- const penetrateOverlayAt = (x2, y5, sel) => {
2134
+ const penetrateOverlayAt = (x3, y4, sel) => {
2124
2135
  try {
2125
- const stack = doc.elementsFromPoint(x2, y5);
2136
+ const stack = doc.elementsFromPoint(x3, y4);
2126
2137
  for (const el of stack) {
2127
2138
  if (!root.contains(el) || !isElement(el)) continue;
2128
2139
  const cand = el.matches(sel) ? el : el.closest(sel);
@@ -2134,7 +2145,7 @@ function createMarkResolver(env) {
2134
2145
  }
2135
2146
  return null;
2136
2147
  };
2137
- const resolveByGeometry = (x2, y5, sel) => {
2148
+ const resolveByGeometry = (x3, y4, sel) => {
2138
2149
  try {
2139
2150
  const cands = root.querySelectorAll(sel);
2140
2151
  let best = null, bestArea = Number.MAX_VALUE;
@@ -2143,7 +2154,7 @@ function createMarkResolver(env) {
2143
2154
  if (!el.getAttribute("data-row-idx")) continue;
2144
2155
  const r = el.getBoundingClientRect ? el.getBoundingClientRect() : null;
2145
2156
  if (!r || r.width <= 0 || r.height <= 0) continue;
2146
- if (x2 < r.left || x2 > r.right || y5 < r.top || y5 > r.bottom) continue;
2157
+ if (x3 < r.left || x3 > r.right || y4 < r.top || y4 > r.bottom) continue;
2147
2158
  const area = r.width * r.height;
2148
2159
  if (area < bestArea) {
2149
2160
  bestArea = area;
@@ -2310,8 +2321,8 @@ function styleOf2(el, doc) {
2310
2321
  }
2311
2322
  }
2312
2323
  function attrOrComputed(el, name, cs) {
2313
- const a4 = el.getAttribute?.(name);
2314
- if (a4 !== null && a4 !== void 0 && String(a4).trim() !== "") return String(a4).trim();
2324
+ const a2 = el.getAttribute?.(name);
2325
+ if (a2 !== null && a2 !== void 0 && String(a2).trim() !== "") return String(a2).trim();
2315
2326
  const c2 = cs?.[name === "stroke-width" ? "strokeWidth" : name];
2316
2327
  return c2 === null || c2 === void 0 ? "" : String(c2).trim();
2317
2328
  }
@@ -2320,9 +2331,9 @@ function isUnfilled(fill) {
2320
2331
  return f4 === "none" || f4 === "transparent" || f4 === "rgba(0, 0, 0, 0)" || f4 === "rgba(0,0,0,0)";
2321
2332
  }
2322
2333
  function widthPx(raw) {
2323
- const m = /^(-?\d+(?:\.\d+)?)\s*(px)?$/i.exec(raw);
2324
- if (!m) return NaN;
2325
- const n = parseFloat(m[1]);
2334
+ const m2 = /^(-?\d+(?:\.\d+)?)\s*(px)?$/i.exec(raw);
2335
+ if (!m2) return NaN;
2336
+ const n = parseFloat(m2[1]);
2326
2337
  return isFinite(n) ? n : NaN;
2327
2338
  }
2328
2339
  function censusHitBands(container, doc) {
@@ -2379,34 +2390,34 @@ var VALUE_AXIS_MIN_FIT = 0.8;
2379
2390
  var MIN_AXIS_SPAN_PX = 40;
2380
2391
  var EMPTY4 = { marks: 0, axis: "", column: "", fit: 0, offShare: 0, medianOffRadii: 0 };
2381
2392
  function num(el, name) {
2382
- const v4 = el.getAttribute?.(name);
2383
- if (v4 === null || v4 === void 0 || String(v4).trim() === "") return NaN;
2384
- return parseFloat(String(v4));
2393
+ const v3 = el.getAttribute?.(name);
2394
+ if (v3 === null || v3 === void 0 || String(v3).trim() === "") return NaN;
2395
+ return parseFloat(String(v3));
2385
2396
  }
2386
2397
  function median(xs) {
2387
2398
  if (!xs.length) return NaN;
2388
- const s = [...xs].sort((a4, b4) => a4 - b4);
2389
- const m = s.length >> 1;
2390
- return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2;
2399
+ const s = [...xs].sort((a2, b2) => a2 - b2);
2400
+ const m2 = s.length >> 1;
2401
+ return s.length % 2 ? s[m2] : (s[m2 - 1] + s[m2]) / 2;
2391
2402
  }
2392
- function robustLine(v4, pos) {
2393
- const n = v4.length;
2403
+ function robustLine(v3, pos) {
2404
+ const n = v3.length;
2394
2405
  const step = Math.max(1, Math.floor(n / FIT_SAMPLE));
2395
2406
  const idx = [];
2396
2407
  for (let i = 0; i < n; i += step) idx.push(i);
2397
2408
  const slopes = [];
2398
2409
  for (let p2 = 0; p2 < idx.length; p2++) {
2399
- for (let q3 = p2 + 1; q3 < idx.length; q3++) {
2400
- const dv = v4[idx[q3]] - v4[idx[p2]];
2410
+ for (let q2 = p2 + 1; q2 < idx.length; q2++) {
2411
+ const dv = v3[idx[q2]] - v3[idx[p2]];
2401
2412
  if (Math.abs(dv) < 1e-12) continue;
2402
- slopes.push((pos[idx[q3]] - pos[idx[p2]]) / dv);
2413
+ slopes.push((pos[idx[q2]] - pos[idx[p2]]) / dv);
2403
2414
  }
2404
2415
  }
2405
2416
  if (slopes.length < 3) return null;
2406
- const b4 = median(slopes);
2407
- if (!Number.isFinite(b4) || Math.abs(b4) < 1e-12) return null;
2408
- const a4 = median(pos.map((y5, i) => y5 - b4 * v4[i]));
2409
- return Number.isFinite(a4) ? { a: a4, b: b4 } : null;
2417
+ const b2 = median(slopes);
2418
+ if (!Number.isFinite(b2) || Math.abs(b2) < 1e-12) return null;
2419
+ const a2 = median(pos.map((y4, i) => y4 - b2 * v3[i]));
2420
+ return Number.isFinite(a2) ? { a: a2, b: b2 } : null;
2410
2421
  }
2411
2422
  function censusValuePlacement(container, data) {
2412
2423
  try {
@@ -2423,40 +2434,40 @@ function censusValuePlacement(container, data) {
2423
2434
  if (!/^\d+$/.test(raw)) continue;
2424
2435
  const i = +raw;
2425
2436
  const row = rows[i];
2426
- const x2 = num(el, "cx"), y5 = num(el, "cy"), r = num(el, "r");
2427
- if (!row || !Number.isFinite(x2) || !Number.isFinite(y5) || !(r > 0)) continue;
2437
+ const x3 = num(el, "cx"), y4 = num(el, "cy"), r = num(el, "r");
2438
+ if (!row || !Number.isFinite(x3) || !Number.isFinite(y4) || !(r > 0)) continue;
2428
2439
  seen.add(i);
2429
- dots.push({ row, x: x2, y: y5, r });
2440
+ dots.push({ row, x: x3, y: y4, r });
2430
2441
  }
2431
2442
  if (dots.length < MIN_MARKS2 || seen.size < dots.length * 0.9) return EMPTY4;
2432
2443
  let best = null;
2433
2444
  for (let c2 = 0; c2 < columns.length; c2++) {
2434
2445
  if (/^__.*__$/.test(String(columns[c2]?.name ?? ""))) continue;
2435
2446
  const vals = dots.map((d2) => {
2436
- const v4 = d2.row[c2];
2437
- return v4 === null || v4 === void 0 || v4 === "" ? NaN : typeof v4 === "number" ? v4 : Number(v4);
2447
+ const v3 = d2.row[c2];
2448
+ return v3 === null || v3 === void 0 || v3 === "" ? NaN : typeof v3 === "number" ? v3 : Number(v3);
2438
2449
  });
2439
2450
  const finite = vals.filter(Number.isFinite);
2440
2451
  if (finite.length < dots.length * 0.9 || new Set(finite).size < 8) continue;
2441
- const logs = finite.every((v4) => v4 > 0) ? [false, true] : [false];
2452
+ const logs = finite.every((v3) => v3 > 0) ? [false, true] : [false];
2442
2453
  for (const log of logs) {
2443
2454
  for (const axis of ["x", "y"]) {
2444
2455
  const keep = [];
2445
- const v4 = [], pos = [];
2456
+ const v3 = [], pos = [];
2446
2457
  dots.forEach((d2, k3) => {
2447
2458
  if (!Number.isFinite(vals[k3])) return;
2448
2459
  keep.push(k3);
2449
- v4.push(log ? Math.log10(vals[k3]) : vals[k3]);
2460
+ v3.push(log ? Math.log10(vals[k3]) : vals[k3]);
2450
2461
  pos.push(axis === "x" ? d2.x : d2.y);
2451
2462
  });
2452
- const line = robustLine(v4, pos);
2463
+ const line = robustLine(v3, pos);
2453
2464
  if (!line) continue;
2454
2465
  const lo = Math.min(...pos), hi = Math.max(...pos);
2455
2466
  if (hi - lo < MIN_AXIS_SPAN_PX) continue;
2456
2467
  const mean = pos.reduce((s, p2) => s + p2, 0) / pos.length;
2457
2468
  let ssRes = 0, ssTot = 0;
2458
2469
  const res = pos.map((p2, k3) => {
2459
- const e = p2 - (line.a + line.b * v4[k3]);
2470
+ const e = p2 - (line.a + line.b * v3[k3]);
2460
2471
  ssRes += e * e;
2461
2472
  ssTot += (p2 - mean) ** 2;
2462
2473
  return e;
@@ -2465,8 +2476,8 @@ function censusValuePlacement(container, data) {
2465
2476
  const fit = 1 - ssRes / ssTot;
2466
2477
  if (fit >= VALUE_AXIS_MIN_FIT && (!best || fit > best.fit)) {
2467
2478
  const full = new Array(dots.length).fill(NaN);
2468
- keep.forEach((k3, j3) => {
2469
- full[k3] = res[j3];
2479
+ keep.forEach((k3, j5) => {
2480
+ full[k3] = res[j5];
2470
2481
  });
2471
2482
  best = { col: c2, axis, fit, res: full, log };
2472
2483
  }
@@ -2513,14 +2524,14 @@ function needsScroll(contentPx, viewportPx, slackPx = SCROLL_SLACK_PX) {
2513
2524
  }
2514
2525
  function contentExtentOf(boxes) {
2515
2526
  if (!boxes || boxes.length === 0) return { w: 0, h: 0, source: "none" };
2516
- const usable = boxes.filter((b4) => b4 && isFinite(b4.right) && isFinite(b4.bottom) && (b4.right > 0 || b4.bottom > 0));
2527
+ const usable = boxes.filter((b2) => b2 && isFinite(b2.right) && isFinite(b2.bottom) && (b2.right > 0 || b2.bottom > 0));
2517
2528
  if (usable.length === 0) return { w: 0, h: 0, source: "none" };
2518
- const inFlow = usable.filter((b4) => !b4.floating);
2529
+ const inFlow = usable.filter((b2) => !b2.floating);
2519
2530
  const counted = inFlow.length > 0 ? inFlow : usable;
2520
2531
  let w3 = 0, h3 = 0;
2521
- for (const b4 of counted) {
2522
- if (b4.right > w3) w3 = b4.right;
2523
- if (b4.bottom > h3) h3 = b4.bottom;
2532
+ for (const b2 of counted) {
2533
+ if (b2.right > w3) w3 = b2.right;
2534
+ if (b2.bottom > h3) h3 = b2.bottom;
2524
2535
  }
2525
2536
  return { w: w3, h: h3, source: inFlow.length > 0 ? "in-flow" : "all-floating" };
2526
2537
  }
@@ -2554,8 +2565,8 @@ var AXIS_PIN_TRACK_REACH_PX = 12;
2554
2565
  function isHorizontalLabelRow(boxes) {
2555
2566
  if (!boxes || boxes.length < 2) return false;
2556
2567
  let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;
2557
- for (const b4 of boxes) {
2558
- const cx = (b4.left + b4.right) / 2, cy = (b4.top + b4.bottom) / 2;
2568
+ for (const b2 of boxes) {
2569
+ const cx = (b2.left + b2.right) / 2, cy = (b2.top + b2.bottom) / 2;
2559
2570
  if (!isFinite(cx) || !isFinite(cy)) return false;
2560
2571
  if (cx < minX) minX = cx;
2561
2572
  if (cx > maxX) maxX = cx;
@@ -2567,18 +2578,18 @@ function isHorizontalLabelRow(boxes) {
2567
2578
  function labelBand(boxes, tracks = [], pad = AXIS_PIN_BAND_PAD_PX, trackReach = AXIS_PIN_TRACK_REACH_PX) {
2568
2579
  if (!boxes || boxes.length === 0) return null;
2569
2580
  let top = Infinity, bottom = -Infinity;
2570
- for (const b4 of boxes) {
2571
- if (!isFinite(b4.top) || !isFinite(b4.bottom)) continue;
2572
- if (b4.top < top) top = b4.top;
2573
- if (b4.bottom > bottom) bottom = b4.bottom;
2581
+ for (const b2 of boxes) {
2582
+ if (!isFinite(b2.top) || !isFinite(b2.bottom)) continue;
2583
+ if (b2.top < top) top = b2.top;
2584
+ if (b2.bottom > bottom) bottom = b2.bottom;
2574
2585
  }
2575
2586
  if (!isFinite(top) || !isFinite(bottom) || bottom <= top) return null;
2576
- for (const t of tracks || []) {
2577
- if (!isFinite(t.top) || !isFinite(t.bottom)) continue;
2578
- const gap = t.bottom < top ? top - t.bottom : t.top > bottom ? t.top - bottom : 0;
2587
+ for (const t2 of tracks || []) {
2588
+ if (!isFinite(t2.top) || !isFinite(t2.bottom)) continue;
2589
+ const gap = t2.bottom < top ? top - t2.bottom : t2.top > bottom ? t2.top - bottom : 0;
2579
2590
  if (gap > trackReach) continue;
2580
- if (t.top < top) top = t.top;
2581
- if (t.bottom > bottom) bottom = t.bottom;
2591
+ if (t2.top < top) top = t2.top;
2592
+ if (t2.bottom > bottom) bottom = t2.bottom;
2582
2593
  }
2583
2594
  return { top: top - pad, bottom: bottom + pad };
2584
2595
  }
@@ -2608,9 +2619,9 @@ function axisPinPlacement(band, scrollTop, viewportH) {
2608
2619
 
2609
2620
  // src/fitDom.ts
2610
2621
  var FIT_WALK_CAP = 8e3;
2611
- function ctmScaleOf(m) {
2612
- if (!m) return 0;
2613
- const s = Math.hypot(m.a, m.b);
2622
+ function ctmScaleOf(m2) {
2623
+ if (!m2) return 0;
2624
+ const s = Math.hypot(m2.a, m2.b);
2614
2625
  return isFinite(s) && s > 0 ? s : 0;
2615
2626
  }
2616
2627
  function svgInkReach(svg) {
@@ -2685,7 +2696,7 @@ function fitReadingFor(lane, c2, slackPx = SCROLL_SLACK_PX, inkOf) {
2685
2696
  overflowsY: needsScroll(contentH, viewH, slackPx),
2686
2697
  extentSource: extent.source,
2687
2698
  boxes: boxes.length,
2688
- floating: boxes.filter((b4) => b4.floating).length,
2699
+ floating: boxes.filter((b2) => b2.floating).length,
2689
2700
  scrollW: c2.scrollWidth,
2690
2701
  scrollH: c2.scrollHeight
2691
2702
  };
@@ -2696,14 +2707,14 @@ var SVG_NS2 = "http://www.w3.org/2000/svg";
2696
2707
  var AXIS_PIN_MAX_CARRIED = 12;
2697
2708
  function unpinScrolledAxis(container) {
2698
2709
  if (!container) return;
2699
- const st2 = container[CONTAINER_SLOT_AXIS_PIN];
2700
- if (!st2) return;
2710
+ const st = container[CONTAINER_SLOT_AXIS_PIN];
2711
+ if (!st) return;
2701
2712
  try {
2702
- container.removeEventListener("scroll", st2.onScroll);
2713
+ container.removeEventListener("scroll", st.onScroll);
2703
2714
  } catch {
2704
2715
  }
2705
2716
  try {
2706
- if (st2.overlay.parentNode) st2.overlay.parentNode.removeChild(st2.overlay);
2717
+ if (st.overlay.parentNode) st.overlay.parentNode.removeChild(st.overlay);
2707
2718
  } catch {
2708
2719
  }
2709
2720
  try {
@@ -2711,10 +2722,10 @@ function unpinScrolledAxis(container) {
2711
2722
  } catch {
2712
2723
  }
2713
2724
  }
2714
- function textHidden(t, view) {
2715
- if (t.getAttribute("display") === "none" || t.getAttribute("visibility") === "hidden") return true;
2725
+ function textHidden(t2, view) {
2726
+ if (t2.getAttribute("display") === "none" || t2.getAttribute("visibility") === "hidden") return true;
2716
2727
  try {
2717
- const cs = view.getComputedStyle(t);
2728
+ const cs = view.getComputedStyle(t2);
2718
2729
  if (cs && (cs.display === "none" || cs.visibility === "hidden")) return true;
2719
2730
  } catch {
2720
2731
  }
@@ -2726,8 +2737,8 @@ function backdropFill(svg, container, view, svgBox) {
2726
2737
  for (let i = 0; i < rects.length && i < 6; i++) {
2727
2738
  const r = rects[i];
2728
2739
  if (r.closest(".d3-mark")) continue;
2729
- const b4 = r.getBoundingClientRect();
2730
- if (b4.width >= svgBox.width * 0.9 && b4.height >= svgBox.height * 0.9) {
2740
+ const b2 = r.getBoundingClientRect();
2741
+ if (b2.width >= svgBox.width * 0.9 && b2.height >= svgBox.height * 0.9) {
2731
2742
  let fill = "";
2732
2743
  try {
2733
2744
  fill = view.getComputedStyle(r).fill || "";
@@ -2776,21 +2787,21 @@ function pinScrolledAxis(container, svg) {
2776
2787
  const view = doc && doc.defaultView || globalThis;
2777
2788
  const svgBox = svg.getBoundingClientRect();
2778
2789
  if (!(svgBox.width > 0) || !(svgBox.height > 0)) return noPin("unmeasurable");
2779
- const m = typeof svg.getScreenCTM === "function" ? svg.getScreenCTM() : null;
2780
- if (!m || !(m.a > 0) || !(m.d > 0) || !isFinite(m.e) || !isFinite(m.f)) return noPin("no-ctm");
2790
+ const m2 = typeof svg.getScreenCTM === "function" ? svg.getScreenCTM() : null;
2791
+ if (!m2 || !(m2.a > 0) || !(m2.d > 0) || !isFinite(m2.e) || !isFinite(m2.f)) return noPin("no-ctm");
2781
2792
  const viewportH = container.clientHeight;
2782
2793
  if (!(viewportH > 0)) return noPin("unmeasurable");
2783
2794
  const rel = (r) => ({ left: r.left - svgBox.left, top: r.top - svgBox.top, right: r.right - svgBox.left, bottom: r.bottom - svgBox.top });
2784
2795
  const ticks = svg.querySelectorAll(".tick");
2785
2796
  const byAxis = /* @__PURE__ */ new Map();
2786
2797
  for (let i = 0; i < ticks.length; i++) {
2787
- const t = ticks[i];
2788
- if (t.closest("svg") !== svg) continue;
2789
- const p2 = t.parentElement;
2798
+ const t2 = ticks[i];
2799
+ if (t2.closest("svg") !== svg) continue;
2800
+ const p2 = t2.parentElement;
2790
2801
  if (!p2) continue;
2791
2802
  const list = byAxis.get(p2);
2792
- if (list) list.push(t);
2793
- else byAxis.set(p2, [t]);
2803
+ if (list) list.push(t2);
2804
+ else byAxis.set(p2, [t2]);
2794
2805
  }
2795
2806
  const axes = [];
2796
2807
  const cands = [];
@@ -2822,23 +2833,23 @@ function pinScrolledAxis(container, svg) {
2822
2833
  const carried = [];
2823
2834
  const texts = svg.querySelectorAll("text");
2824
2835
  for (let i = 0; i < texts.length && carried.length < AXIS_PIN_MAX_CARRIED; i++) {
2825
- const t = texts[i];
2826
- if (t.closest("svg") !== svg) continue;
2827
- if (t.closest(".tick") || t.closest(".d3-mark") || t.closest(".d3-legend-mark")) continue;
2828
- if (axis.contains(t) || textHidden(t, view)) continue;
2829
- const r = rel(t.getBoundingClientRect());
2836
+ const t2 = texts[i];
2837
+ if (t2.closest("svg") !== svg) continue;
2838
+ if (t2.closest(".tick") || t2.closest(".d3-mark") || t2.closest(".d3-legend-mark")) continue;
2839
+ if (axis.contains(t2) || textHidden(t2, view)) continue;
2840
+ const r = rel(t2.getBoundingClientRect());
2830
2841
  if (!(r.right > r.left) || !(r.bottom > r.top)) continue;
2831
- if (r.top >= band.top && r.bottom <= band.bottom) carried.push(t);
2842
+ if (r.top >= band.top && r.bottom <= band.bottom) carried.push(t2);
2832
2843
  }
2833
2844
  const pinSvg = doc.createElementNS(SVG_NS2, "svg");
2834
- for (const a4 of ["font-family", "font-size", "font-weight", "font", "fill", "color", "text-rendering"]) {
2835
- const v4 = svg.getAttribute(a4);
2836
- if (v4) pinSvg.setAttribute(a4, v4);
2845
+ for (const a2 of ["font-family", "font-size", "font-weight", "font", "fill", "color", "text-rendering"]) {
2846
+ const v3 = svg.getAttribute(a2);
2847
+ if (v3) pinSvg.setAttribute(a2, v3);
2837
2848
  }
2838
2849
  const styles = svg.querySelectorAll("style");
2839
2850
  for (let i = 0; i < styles.length; i++) pinSvg.appendChild(styles[i].cloneNode(true));
2840
- const vbX = (svgBox.left - m.e) / m.a, vbY = (svgBox.top + band.top - m.f) / m.d;
2841
- const vbW = svgBox.width / m.a, vbH = bandPx / m.d;
2851
+ const vbX = (svgBox.left - m2.e) / m2.a, vbY = (svgBox.top + band.top - m2.f) / m2.d;
2852
+ const vbW = svgBox.width / m2.a, vbH = bandPx / m2.d;
2842
2853
  pinSvg.setAttribute("viewBox", `${vbX} ${vbY} ${vbW} ${vbH}`);
2843
2854
  pinSvg.setAttribute("preserveAspectRatio", "none");
2844
2855
  pinSvg.setAttribute("width", String(svgBox.width));
@@ -2854,20 +2865,20 @@ function pinScrolledAxis(container, svg) {
2854
2865
  back.setAttribute("fill", backdropFill(svg, container, view, svgBox));
2855
2866
  pinSvg.appendChild(back);
2856
2867
  cloneWithChain(axis, svg, pinSvg);
2857
- for (const t of carried) cloneWithChain(t, svg, pinSvg);
2868
+ for (const t2 of carried) cloneWithChain(t2, svg, pinSvg);
2858
2869
  const overlay = doc.createElement("div");
2859
2870
  overlay.setAttribute("data-bic-axis-pin", "1");
2860
- const o = overlay.style;
2861
- o.position = "absolute";
2862
- o.margin = "0";
2863
- o.padding = "0";
2864
- o.border = "0";
2865
- o.width = `${svgBox.width}px`;
2866
- o.height = `${bandPx}px`;
2867
- o.overflow = "hidden";
2868
- o.pointerEvents = "none";
2869
- o.zIndex = "3";
2870
- o.display = "none";
2871
+ const o2 = overlay.style;
2872
+ o2.position = "absolute";
2873
+ o2.margin = "0";
2874
+ o2.padding = "0";
2875
+ o2.border = "0";
2876
+ o2.width = `${svgBox.width}px`;
2877
+ o2.height = `${bandPx}px`;
2878
+ o2.overflow = "hidden";
2879
+ o2.pointerEvents = "none";
2880
+ o2.zIndex = "3";
2881
+ o2.display = "none";
2871
2882
  overlay.appendChild(pinSvg);
2872
2883
  try {
2873
2884
  const cs = view.getComputedStyle(container);
@@ -2881,15 +2892,15 @@ function pinScrolledAxis(container, svg) {
2881
2892
  const svgTop = svgBox.top - cRect.top - container.clientTop + container.scrollTop;
2882
2893
  const contentBand = { top: svgTop + band.top, bottom: svgTop + band.bottom };
2883
2894
  const place = () => {
2884
- const st2 = container.scrollTop, vh = container.clientHeight;
2885
- const edge2 = axisPinPlacement(contentBand, st2, vh);
2895
+ const st = container.scrollTop, vh = container.clientHeight;
2896
+ const edge2 = axisPinPlacement(contentBand, st, vh);
2886
2897
  if (!edge2) {
2887
- o.display = "none";
2898
+ o2.display = "none";
2888
2899
  return null;
2889
2900
  }
2890
- o.display = "block";
2891
- o.left = `${svgLeft}px`;
2892
- o.top = `${edge2 === "top" ? st2 : st2 + vh - bandPx}px`;
2901
+ o2.display = "block";
2902
+ o2.left = `${svgLeft}px`;
2903
+ o2.top = `${edge2 === "top" ? st : st + vh - bandPx}px`;
2893
2904
  return edge2;
2894
2905
  };
2895
2906
  const onScroll = () => {
@@ -2966,8 +2977,8 @@ function fitRenderedChart(container, opts = {}) {
2966
2977
  if (plan.grow) {
2967
2978
  svg.setAttribute("height", String(plan.heightPx));
2968
2979
  if (vb > 0) {
2969
- const b4 = svg.viewBox.baseVal;
2970
- svg.setAttribute("viewBox", `${b4.x} ${b4.y} ${b4.width} ${plan.viewBoxH}`);
2980
+ const b2 = svg.viewBox.baseVal;
2981
+ svg.setAttribute("viewBox", `${b2.x} ${b2.y} ${b2.width} ${plan.viewBoxH}`);
2971
2982
  }
2972
2983
  result.grew = true;
2973
2984
  }
@@ -3012,8 +3023,8 @@ function fitRenderedChart(container, opts = {}) {
3012
3023
  function parseRGBA(c2) {
3013
3024
  if (typeof c2 !== "string") return null;
3014
3025
  const s = c2.trim();
3015
- const m = s.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/i);
3016
- if (m) return [parseFloat(m[1]), parseFloat(m[2]), parseFloat(m[3]), m[4] !== void 0 ? parseFloat(m[4]) : 1];
3026
+ const m2 = s.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/i);
3027
+ if (m2) return [parseFloat(m2[1]), parseFloat(m2[2]), parseFloat(m2[3]), m2[4] !== void 0 ? parseFloat(m2[4]) : 1];
3017
3028
  let h3 = s.replace(/^#/, "");
3018
3029
  if (h3.length === 3) h3 = h3.split("").map((ch) => ch + ch).join("");
3019
3030
  if (h3.length === 6 && /^[0-9a-fA-F]{6}$/.test(h3)) {
@@ -3028,8 +3039,8 @@ var WHITE_TEXT_BG_LUM = 0.5;
3028
3039
  var PILL_MIN_ALPHA = 0.05;
3029
3040
  var PILL_OPAQUE_ALPHA = 0.85;
3030
3041
  var PAGE_MATCH_TOLERANCE = 2;
3031
- function isPillBackdropAlpha(a4) {
3032
- return a4 >= PILL_MIN_ALPHA && a4 < PILL_OPAQUE_ALPHA;
3042
+ function isPillBackdropAlpha(a2) {
3043
+ return a2 >= PILL_MIN_ALPHA && a2 < PILL_OPAQUE_ALPHA;
3033
3044
  }
3034
3045
  var PILL_MIN_COVERAGE = 0.6;
3035
3046
  function pillBacksGlyph(overlapArea, glyphArea) {
@@ -3057,16 +3068,16 @@ function toRGBA(c2) {
3057
3068
  return parseRGBA(c2);
3058
3069
  }
3059
3070
  function compositeOver(fg, bg) {
3060
- const a4 = Math.max(0, Math.min(1, fg[3]));
3071
+ const a2 = Math.max(0, Math.min(1, fg[3]));
3061
3072
  return [
3062
- Math.round(fg[0] * a4 + bg[0] * (1 - a4)),
3063
- Math.round(fg[1] * a4 + bg[1] * (1 - a4)),
3064
- Math.round(fg[2] * a4 + bg[2] * (1 - a4))
3073
+ Math.round(fg[0] * a2 + bg[0] * (1 - a2)),
3074
+ Math.round(fg[1] * a2 + bg[1] * (1 - a2)),
3075
+ Math.round(fg[2] * a2 + bg[2] * (1 - a2))
3065
3076
  ];
3066
3077
  }
3067
3078
  function relativeLuminance(rgb) {
3068
- const lin = rgb.map((v4) => {
3069
- const s = v4 / 255;
3079
+ const lin = rgb.map((v3) => {
3080
+ const s = v3 / 255;
3070
3081
  return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
3071
3082
  });
3072
3083
  return 0.2126 * lin[0] + 0.7152 * lin[1] + 0.0722 * lin[2];
@@ -3105,18 +3116,18 @@ function glyphSampleGrid(box, n = GLYPH_SAMPLE_N) {
3105
3116
  if (!box || !(box.width > 0) || !(box.height > 0) || !(n >= 1)) return out;
3106
3117
  const k3 = Math.floor(n);
3107
3118
  for (let i = 0; i < k3; i++) {
3108
- for (let j3 = 0; j3 < k3; j3++) {
3119
+ for (let j5 = 0; j5 < k3; j5++) {
3109
3120
  out.push({
3110
3121
  x: box.left + box.width * (i + 0.5) / k3,
3111
- y: box.top + box.height * (j3 + 0.5) / k3
3122
+ y: box.top + box.height * (j5 + 0.5) / k3
3112
3123
  });
3113
3124
  }
3114
3125
  }
3115
3126
  return out;
3116
3127
  }
3117
- function clamp01(v4) {
3118
- if (typeof v4 !== "number" || !isFinite(v4)) return 1;
3119
- return Math.max(0, Math.min(1, v4));
3128
+ function clamp01(v3) {
3129
+ if (typeof v3 !== "number" || !isFinite(v3)) return 1;
3130
+ return Math.max(0, Math.min(1, v3));
3120
3131
  }
3121
3132
  function hexToRGB(hex2) {
3122
3133
  const p2 = toRGBA(hex2);
@@ -3131,11 +3142,11 @@ function backedSamples(el, pts) {
3131
3142
  try {
3132
3143
  const ge2 = el;
3133
3144
  if (typeof ge2.isPointInFill !== "function" || typeof ge2.getScreenCTM !== "function") return null;
3134
- const m = ge2.getScreenCTM();
3145
+ const m2 = ge2.getScreenCTM();
3135
3146
  const svg = ge2.ownerSVGElement;
3136
- if (!m || !svg || typeof svg.createSVGPoint !== "function") return null;
3147
+ if (!m2 || !svg || typeof svg.createSVGPoint !== "function") return null;
3137
3148
  if (pts.length === 0) return null;
3138
- const inv = m.inverse();
3149
+ const inv = m2.inverse();
3139
3150
  const hit = [];
3140
3151
  for (let i = 0; i < pts.length; i++) {
3141
3152
  const p2 = svg.createSVGPoint();
@@ -3223,8 +3234,8 @@ function applyLabelContrast(container, opts = {}) {
3223
3234
  return report;
3224
3235
  }
3225
3236
  const win = container.ownerDocument?.defaultView;
3226
- for (let t = 0; t < texts.length; t++) {
3227
- const tx = texts[t];
3237
+ for (let t2 = 0; t2 < texts.length; t2++) {
3238
+ const tx = texts[t2];
3228
3239
  if (tx.getAttribute(LABEL_CONTRAST_DONE_ATTR) === "1") continue;
3229
3240
  const tr = tx.getBoundingClientRect();
3230
3241
  if (tr.width <= 0 || tr.height <= 0) continue;
@@ -3232,31 +3243,31 @@ function applyLabelContrast(container, opts = {}) {
3232
3243
  const glyphArea = tr.width * tr.height;
3233
3244
  const txRoot = paintRoot(tx, container);
3234
3245
  let over = 0;
3235
- const boxed = rects.map((mk) => ({ mk, ov: ovArea(mk.r) })).filter((x2) => {
3236
- if (!(x2.ov > 0)) return false;
3237
- if (drawnBeneath(x2.mk, tx, txRoot)) return true;
3238
- if (effAlpha(x2.mk) >= PILL_MIN_ALPHA) over++;
3246
+ const boxed = rects.map((mk) => ({ mk, ov: ovArea(mk.r) })).filter((x3) => {
3247
+ if (!(x3.ov > 0)) return false;
3248
+ if (drawnBeneath(x3.mk, tx, txRoot)) return true;
3249
+ if (effAlpha(x3.mk) >= PILL_MIN_ALPHA) over++;
3239
3250
  return false;
3240
3251
  });
3241
3252
  if (over > 0) report.paintedOver++;
3242
3253
  const pts = glyphSampleGrid({ left: tr.left, top: tr.top, width: tr.width, height: tr.height });
3243
3254
  const painted = pts.map(() => false);
3244
3255
  let unmeasured = 0;
3245
- const under = boxed.map((x2) => {
3246
- const mask = backedSamples(x2.mk.el, pts);
3256
+ const under = boxed.map((x3) => {
3257
+ const mask = backedSamples(x3.mk.el, pts);
3247
3258
  if (mask === null) {
3248
3259
  unmeasured++;
3249
- return x2;
3260
+ return x3;
3250
3261
  }
3251
3262
  let inside = 0;
3252
- const paints = effAlpha(x2.mk) >= PILL_MIN_ALPHA;
3263
+ const paints = effAlpha(x3.mk) >= PILL_MIN_ALPHA;
3253
3264
  for (let i = 0; i < mask.length; i++) {
3254
3265
  if (!mask[i]) continue;
3255
3266
  inside++;
3256
3267
  if (paints) painted[i] = true;
3257
3268
  }
3258
- return { mk: x2.mk, ov: glyphArea * (inside / mask.length) };
3259
- }).filter((x2) => x2.ov > 0);
3269
+ return { mk: x3.mk, ov: glyphArea * (inside / mask.length) };
3270
+ }).filter((x3) => x3.ov > 0);
3260
3271
  if (under.length === 0 && boxed.length > 0) report.offFill++;
3261
3272
  if (under.length === 0) continue;
3262
3273
  if (unmeasured === 0 && pts.length > 0) {
@@ -3268,10 +3279,10 @@ function applyLabelContrast(container, opts = {}) {
3268
3279
  }
3269
3280
  }
3270
3281
  report.scanned++;
3271
- const opaqueUnder = under.filter((x2) => effAlpha(x2.mk) >= PILL_OPAQUE_ALPHA);
3272
- const cellEntry = (opaqueUnder.length ? opaqueUnder : under).reduce((a4, b4) => b4.ov > a4.ov || b4.ov === a4.ov && b4.mk.ord > a4.mk.ord ? b4 : a4);
3282
+ const opaqueUnder = under.filter((x3) => effAlpha(x3.mk) >= PILL_OPAQUE_ALPHA);
3283
+ const cellEntry = (opaqueUnder.length ? opaqueUnder : under).reduce((a2, b2) => b2.ov > a2.ov || b2.ov === a2.ov && b2.mk.ord > a2.mk.ord ? b2 : a2);
3273
3284
  const cell = cellEntry.mk;
3274
- const pill = under.find((x2) => x2.mk !== cell && isPillBackdropAlpha(effAlpha(x2.mk)) && x2.mk.ord > cell.ord && pillBacksGlyph(x2.ov, glyphArea))?.mk;
3285
+ const pill = under.find((x3) => x3.mk !== cell && isPillBackdropAlpha(effAlpha(x3.mk)) && x3.mk.ord > cell.ord && pillBacksGlyph(x3.ov, glyphArea))?.mk;
3275
3286
  const cellRGBA = toRGBA(cell.fill);
3276
3287
  let bgRGB = cellRGBA ? compositeOver([cellRGBA[0], cellRGBA[1], cellRGBA[2], cellRGBA[3] * cell.op], pageRGB) : pageRGB;
3277
3288
  if (pill) {
@@ -3306,9 +3317,9 @@ function isInvalidSentinelError(text) {
3306
3317
  }
3307
3318
  function invalidSentinelReason(text, max = 240) {
3308
3319
  if (!text) return "";
3309
- const m = /\bINVALID\s*:\s*([^\r\n]*)/.exec(text);
3310
- if (!m) return "";
3311
- const reason = m[1].trim();
3320
+ const m2 = /\bINVALID\s*:\s*([^\r\n]*)/.exec(text);
3321
+ if (!m2) return "";
3322
+ const reason = m2[1].trim();
3312
3323
  const cap = Math.max(0, Math.floor(max));
3313
3324
  if (reason.length <= cap) return reason;
3314
3325
  return cap <= 3 ? reason.slice(0, cap) : reason.slice(0, cap - 3).trimEnd() + "...";
@@ -3332,7 +3343,7 @@ function noopViewStateProvider() {
3332
3343
  return { load: () => ({}), save: () => {
3333
3344
  } };
3334
3345
  }
3335
- var parseRowIdxs = (s) => (s || "").split(",").map((x2) => parseInt(x2, 10)).filter((n) => Number.isFinite(n));
3346
+ var parseRowIdxs = (s) => (s || "").split(",").map((x3) => parseInt(x3, 10)).filter((n) => Number.isFinite(n));
3336
3347
  function assembleD3(base, ...plugins) {
3337
3348
  return Object.assign({}, base, ...plugins);
3338
3349
  }
@@ -3370,10 +3381,10 @@ function requiredD3Plugins(code) {
3370
3381
  const pkg = D3_PLUGIN_PACKAGES[name];
3371
3382
  if (pkg) out.add(pkg);
3372
3383
  };
3373
- for (const m of body.matchAll(/\bd3\s*\.\s*(\w+)/g)) add(m[1]);
3374
- for (const m of body.matchAll(/\bd3\s*\[\s*['"](\w+)['"]\s*\]/g)) add(m[1]);
3375
- for (const m of body.matchAll(/\{([^{}]*)\}\s*=\s*d3\b/g)) {
3376
- for (const part of m[1].split(",")) add(part.split(":")[0].trim());
3384
+ for (const m2 of body.matchAll(/\bd3\s*\.\s*(\w+)/g)) add(m2[1]);
3385
+ for (const m2 of body.matchAll(/\bd3\s*\[\s*['"](\w+)['"]\s*\]/g)) add(m2[1]);
3386
+ for (const m2 of body.matchAll(/\{([^{}]*)\}\s*=\s*d3\b/g)) {
3387
+ for (const part of m2[1].split(",")) add(part.split(":")[0].trim());
3377
3388
  }
3378
3389
  return [...out].sort();
3379
3390
  }
@@ -3389,8 +3400,8 @@ function explainRenderFailure(err, d3) {
3389
3400
  "[@bicharts/chart-host] this chart draws its diagram with Mermaid, which it reaches as d3.mermaid.render(...), and the d3 you passed has no mermaid on it \u2014 this host did not load the library. A host supplies it exactly the way the other plugins are supplied: hand createChartHost ONE d3 that carries it, the SAME d3 every chart gets \u2014 npm install mermaid then import * as d3base from 'd3'; import mermaid from 'mermaid'; import { assembleD3 } from '@bicharts/chart-host'; const d3 = assembleD3(d3base, { mermaid }); (an ES-module d3 namespace is frozen, so assigning onto it throws) Original error: " + msg
3390
3401
  );
3391
3402
  }
3392
- const m = /d3\.(\w+) is not a function|(\w+) is not a function/.exec(msg);
3393
- const name = m?.[1] ?? m?.[2] ?? "";
3403
+ const m2 = /d3\.(\w+) is not a function|(\w+) is not a function/.exec(msg);
3404
+ const name = m2?.[1] ?? m2?.[2] ?? "";
3394
3405
  const pkg = D3_PLUGIN_PACKAGES[name];
3395
3406
  if (pkg) {
3396
3407
  return new Error(
@@ -3426,7 +3437,7 @@ function compileRenderFn(code, win, doc, d3) {
3426
3437
  return fn;
3427
3438
  }
3428
3439
  var ASYNC_RENDER_TIMEOUT_MS = 15e3;
3429
- var isThenable = (v4) => !!v4 && (typeof v4 === "object" || typeof v4 === "function") && typeof v4.then === "function";
3440
+ var isThenable = (v3) => !!v3 && (typeof v3 === "object" || typeof v3 === "function") && typeof v3.then === "function";
3430
3441
  function createChartHost(container, config) {
3431
3442
  const doc = container.ownerDocument;
3432
3443
  const win = doc?.defaultView ?? globalThis;
@@ -3434,7 +3445,7 @@ function createChartHost(container, config) {
3434
3445
  let data = config.data;
3435
3446
  {
3436
3447
  const stamped = config.data?.meta?.hostContract;
3437
- const major = (v4) => (v4 || "").split(".")[0];
3448
+ const major = (v3) => (v3 || "").split(".")[0];
3438
3449
  if (stamped && major(stamped) !== major(HOST_CONTRACT_VERSION)) {
3439
3450
  try {
3440
3451
  (win?.console ?? console)?.warn(
@@ -3488,9 +3499,9 @@ function createChartHost(container, config) {
3488
3499
  const ensureAffordanceStyles = () => {
3489
3500
  try {
3490
3501
  if (!doc || doc.getElementById("bic-chart-host-affordances")) return;
3491
- const st2 = doc.createElement("style");
3492
- st2.id = "bic-chart-host-affordances";
3493
- st2.textContent = `
3502
+ const st = doc.createElement("style");
3503
+ st.id = "bic-chart-host-affordances";
3504
+ st.textContent = `
3494
3505
  /* TYPOGRAPHY FIREWALL. Generated charts set font-size but almost never line-height or
3495
3506
  letter-spacing, so they INHERIT whatever the host page cascades in. A page with
3496
3507
  \`:root { font: 18px/145% }\` (the stock Vite template does exactly this) hands every
@@ -3539,7 +3550,7 @@ function createChartHost(container, config) {
3539
3550
  font-weight: 700 !important;
3540
3551
  text-decoration: underline !important;
3541
3552
  }`;
3542
- (doc.head || doc.documentElement)?.appendChild(st2);
3553
+ (doc.head || doc.documentElement)?.appendChild(st);
3543
3554
  } catch {
3544
3555
  }
3545
3556
  };
@@ -3550,15 +3561,15 @@ function createChartHost(container, config) {
3550
3561
  const dim = active && !selectionIsPeriod;
3551
3562
  container.classList?.[dim ? "add" : "remove"](SELECTION_ACTIVE_CLASS);
3552
3563
  const lit = container.querySelectorAll(`.${ACTIVE_TICK_CLASS}`);
3553
- for (const t of Array.from(lit)) t.classList?.remove(ACTIVE_TICK_CLASS);
3564
+ for (const t2 of Array.from(lit)) t2.classList?.remove(ACTIVE_TICK_CLASS);
3554
3565
  const tickStillDrawn = !!activeTickEl && (typeof container.contains === "function" ? container.contains(activeTickEl) : activeTickEl.isConnected !== false);
3555
3566
  if (active && tickStillDrawn) activeTickEl.classList?.add(ACTIVE_TICK_CLASS);
3556
3567
  const wanted = new Set(sel ?? []);
3557
3568
  const marks = container.querySelectorAll(`.${MARK_CLASS}[${ROW_IDX_ATTR}], .${LEGEND_MARK_CLASS}[${ROW_IDX_ATTR}]`);
3558
- for (const m of Array.from(marks)) {
3559
- const rows = parseRowIdxs(m.getAttribute(ROW_IDX_ATTR));
3569
+ for (const m2 of Array.from(marks)) {
3570
+ const rows = parseRowIdxs(m2.getAttribute(ROW_IDX_ATTR));
3560
3571
  const on = active && rows.some((r) => wanted.has(r));
3561
- m.classList?.[on ? "add" : "remove"](MARK_SELECTED_CLASS);
3572
+ m2.classList?.[on ? "add" : "remove"](MARK_SELECTED_CLASS);
3562
3573
  }
3563
3574
  } catch {
3564
3575
  }
@@ -3857,10 +3868,10 @@ function toPayloadRows(rowMap, sourceRowIdxs) {
3857
3868
  });
3858
3869
  return sourceRowIdxs.map((s) => at3.get(s)).filter((k3) => k3 !== void 0);
3859
3870
  }
3860
- var sameRows = (a4, b4) => {
3861
- if (a4.length !== b4.length) return false;
3862
- const x2 = a4.slice().sort((p2, q3) => p2 - q3), y5 = b4.slice().sort((p2, q3) => p2 - q3);
3863
- return x2.every((v4, i) => v4 === y5[i]);
3871
+ var sameRows = (a2, b2) => {
3872
+ if (a2.length !== b2.length) return false;
3873
+ const x3 = a2.slice().sort((p2, q2) => p2 - q2), y4 = b2.slice().sort((p2, q2) => p2 - q2);
3874
+ return x3.every((v3, i) => v3 === y4[i]);
3864
3875
  };
3865
3876
  function syncMemberSelection(host, selection, id, highlight, incoming, rowMap) {
3866
3877
  const mine = selection.sourceId === id && selection.rows.length > 0;
@@ -3895,12 +3906,12 @@ function createChartGroup(columns, rows, opts = {}) {
3895
3906
  return forId;
3896
3907
  };
3897
3908
  const payloadFor = (sourceRowIdxs) => {
3898
- const idxs = sourceRowIdxs ? sourceRowIdxs.slice() : table.map((_2, i) => i);
3909
+ const idxs = sourceRowIdxs ? sourceRowIdxs.slice() : table.map((_3, i) => i);
3899
3910
  const subset = idxs.map((i) => table[i]);
3900
3911
  const payload = buildRenderPayload(cols, subset, geo ?? void 0, point ?? void 0);
3901
3912
  return { payload, rowMap: idxs };
3902
3913
  };
3903
- const memberPayload = (id, o = {}) => payloadFor(o.respondsWith === "highlight" ? null : incomingFor(id, o.filteredBy));
3914
+ const memberPayload = (id, o2 = {}) => payloadFor(o2.respondsWith === "highlight" ? null : incomingFor(id, o2.filteredBy));
3904
3915
  const group = {
3905
3916
  get selection() {
3906
3917
  return selection;
@@ -3922,11 +3933,11 @@ function createChartGroup(columns, rows, opts = {}) {
3922
3933
  selection = { sourceId: null, rows: [] };
3923
3934
  notify("clear");
3924
3935
  },
3925
- setSource(nextColumns, nextRows, o = {}) {
3936
+ setSource(nextColumns, nextRows, o2 = {}) {
3926
3937
  cols = nextColumns;
3927
3938
  table = nextRows;
3928
- geo = o.geo ?? null;
3929
- point = o.point ?? null;
3939
+ geo = o2.geo ?? null;
3940
+ point = o2.point ?? null;
3930
3941
  notify("source");
3931
3942
  },
3932
3943
  onChange(cb) {
@@ -3935,19 +3946,19 @@ function createChartGroup(columns, rows, opts = {}) {
3935
3946
  subs.delete(cb);
3936
3947
  };
3937
3948
  },
3938
- attach(id, host, o = {}) {
3939
- const highlight = o.respondsWith === "highlight";
3940
- let rowMap = memberPayload(id, o).rowMap;
3949
+ attach(id, host, o2 = {}) {
3950
+ const highlight = o2.respondsWith === "highlight";
3951
+ let rowMap = memberPayload(id, o2).rowMap;
3941
3952
  const filterKey = (incoming) => highlight || !incoming ? "*" : incoming.join(",");
3942
- let drawnUnder = filterKey(incomingFor(id, o.filteredBy));
3953
+ let drawnUnder = filterKey(incomingFor(id, o2.filteredBy));
3943
3954
  const offHost = host.selection.onChange((payloadIdxs, source) => {
3944
3955
  if (source === "host") return;
3945
3956
  const sourceIdxs = toSourceRows(rowMap, payloadIdxs);
3946
3957
  if (id) group.publish(id, sourceIdxs);
3947
- o.onSelect?.(sourceIdxs);
3958
+ o2.onSelect?.(sourceIdxs);
3948
3959
  });
3949
3960
  const offGroup = group.onChange((sel, change) => {
3950
- const incoming = incomingFor(id, o.filteredBy);
3961
+ const incoming = incomingFor(id, o2.filteredBy);
3951
3962
  const key = filterKey(incoming);
3952
3963
  if (change === "source" || key !== drawnUnder) {
3953
3964
  const next = payloadFor(highlight ? null : incoming);
@@ -3971,7 +3982,7 @@ function createChartGroup(columns, rows, opts = {}) {
3971
3982
  return member;
3972
3983
  },
3973
3984
  destroy() {
3974
- for (const m of Array.from(members)) m.detach();
3985
+ for (const m2 of Array.from(members)) m2.detach();
3975
3986
  subs.clear();
3976
3987
  }
3977
3988
  };
@@ -4037,7 +4048,7 @@ export {
4037
4048
  registerGeo,
4038
4049
  registerGeoAsset,
4039
4050
  clearGeoCache,
4040
- en,
4051
+ oe,
4041
4052
  F2 as F,
4042
4053
  L3,
4043
4054
  Ve,