mapshaper 0.5.69 → 0.5.73

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.
@@ -1,8 +1,8 @@
1
1
  (function () {
2
2
 
3
- var utils$1 = /*#__PURE__*/Object.freeze({
3
+ var utils = /*#__PURE__*/Object.freeze({
4
4
  __proto__: null,
5
- get default () { return utils$1; },
5
+ get default () { return utils; },
6
6
  get getUniqueName () { return getUniqueName; },
7
7
  get isFunction () { return isFunction; },
8
8
  get isObject () { return isObject; },
@@ -95,15 +95,15 @@
95
95
 
96
96
  var api = window.mapshaper; // assuming mapshaper is in global scope
97
97
  var mapshaper = api,
98
- utils = api.utils,
98
+ utils$1 = api.utils,
99
99
  cli = api.cli,
100
- geom = api.geom,
100
+ geom$1 = api.geom,
101
101
  internal = api.internal,
102
- Bounds = internal.Bounds,
103
- UserError = internal.UserError,
104
- message = internal.message, // stop, error and message are overridden in gui-proxy.js
105
- stop = internal.stop,
106
- error = internal.error;
102
+ Bounds$1 = internal.Bounds,
103
+ UserError$1 = internal.UserError,
104
+ message$1 = internal.message, // stop, error and message are overridden in gui-proxy.js
105
+ stop$1 = internal.stop,
106
+ error$1 = internal.error;
107
107
 
108
108
  api.enableLogging();
109
109
 
@@ -139,7 +139,7 @@
139
139
 
140
140
  html = '<table>';
141
141
  if (catalog.title) {
142
- html += utils.format('<tr><th colspan="%d"><h4>%s</h4></th></tr>', cols, catalog.title);
142
+ html += utils$1.format('<tr><th colspan="%d"><h4>%s</h4></th></tr>', cols, catalog.title);
143
143
  }
144
144
  while (row < rows) {
145
145
  html += renderRow(items.slice(row * cols, row * cols + cols));
@@ -204,7 +204,7 @@
204
204
 
205
205
  function renderCell(item, i) {
206
206
  var template = '<td data-id="%d"><h4 class="title">%s</h4><div class="subtitle">%s</div></td>';
207
- return utils.format(template, i, item.title, item.subtitle || '');
207
+ return utils$1.format(template, i, item.title, item.subtitle || '');
208
208
  }
209
209
 
210
210
  }
@@ -317,7 +317,7 @@
317
317
  }
318
318
  parsed = internal.parseCommands(str);
319
319
  if (!parsed.length || parsed[0].name != cmd) {
320
- stop("Unable to parse command line options");
320
+ stop$1("Unable to parse command line options");
321
321
  }
322
322
  return parsed[0].options;
323
323
  };
@@ -386,7 +386,7 @@
386
386
  evt = new EventData(this.type);
387
387
  evt.target = this.target;
388
388
  } else if (evt.target != this.target || evt.type != this.type) {
389
- error("[Handler] event target/type have changed.");
389
+ error$1("[Handler] event target/type have changed.");
390
390
  }
391
391
  this.callback.call(this.listener, evt);
392
392
  };
@@ -395,7 +395,7 @@
395
395
  this.type = type;
396
396
  this.target = target;
397
397
  if (data) {
398
- utils.defaults(this, data);
398
+ utils$1.defaults(this, data);
399
399
  this.data = data;
400
400
  }
401
401
  }
@@ -624,12 +624,12 @@
624
624
  try {
625
625
  els = root.querySelectorAll(selector);
626
626
  } catch (e) {
627
- error("Invalid selector:", selector);
627
+ error$1("Invalid selector:", selector);
628
628
  }
629
629
  } else {
630
- error("This browser doesn't support CSS query selectors");
630
+ error$1("This browser doesn't support CSS query selectors");
631
631
  }
632
- return utils.toArray(els);
632
+ return utils$1.toArray(els);
633
633
  };
634
634
 
635
635
  // Converts dash-separated names (e.g. background-color) to camelCase (e.g. backgroundColor)
@@ -666,7 +666,7 @@
666
666
  };
667
667
 
668
668
  function El(ref) {
669
- if (!ref) error("Element() needs a reference");
669
+ if (!ref) error$1("Element() needs a reference");
670
670
  if (ref instanceof El) {
671
671
  return ref;
672
672
  }
@@ -675,7 +675,7 @@
675
675
  }
676
676
 
677
677
  var node;
678
- if (utils.isString(ref)) {
678
+ if (utils$1.isString(ref)) {
679
679
  if (ref[0] == '<') {
680
680
  var parent = El('div').html(ref).node();
681
681
  node = parent.childNodes.length == 1 ? parent.childNodes[0] : parent;
@@ -687,13 +687,13 @@
687
687
  } else if (ref.tagName) {
688
688
  node = ref;
689
689
  }
690
- if (!node) error("Unmatched element selector:", ref);
690
+ if (!node) error$1("Unmatched element selector:", ref);
691
691
  this.el = node;
692
692
  }
693
693
 
694
- utils.inherit(El, EventDispatcher);
694
+ utils$1.inherit(El, EventDispatcher);
695
695
 
696
- utils.extend(El.prototype, {
696
+ utils$1.extend(El.prototype, {
697
697
 
698
698
  clone: function() {
699
699
  var el = this.el.cloneNode(true);
@@ -702,7 +702,7 @@
702
702
  // can ...
703
703
  el = El('div').addClass(el.className).html(el.innerHTML).node();
704
704
  }
705
- el.id = utils.getUniqueName();
705
+ el.id = utils$1.getUniqueName();
706
706
  this.el = el;
707
707
  return this;
708
708
  },
@@ -732,11 +732,11 @@
732
732
  if (val != null) {
733
733
  El.setStyle(this.el, css, val);
734
734
  }
735
- else if (utils.isString(css)) {
735
+ else if (utils$1.isString(css)) {
736
736
  addCSS(this.el, css);
737
737
  }
738
- else if (utils.isObject(css)) {
739
- utils.forEachProperty(css, function(val, key) {
738
+ else if (utils$1.isObject(css)) {
739
+ utils$1.forEachProperty(css, function(val, key) {
740
740
  El.setStyle(this.el, key, val);
741
741
  }, this);
742
742
  }
@@ -744,7 +744,7 @@
744
744
  },
745
745
 
746
746
  attr: function(obj, value) {
747
- if (utils.isString(obj)) {
747
+ if (utils$1.isString(obj)) {
748
748
  if (arguments.length == 1) {
749
749
  return this.el.getAttribute(obj);
750
750
  }
@@ -828,7 +828,7 @@
828
828
  },
829
829
 
830
830
  text: function(str) {
831
- this.html(utils.htmlEscape(str));
831
+ this.html(utils$1.htmlEscape(str));
832
832
  return this;
833
833
  },
834
834
 
@@ -918,7 +918,7 @@
918
918
  El.prototype.__on = El.prototype.on;
919
919
  El.prototype.on = function(type, func, ctx) {
920
920
  if (ctx) {
921
- error("[El#on()] Third argument no longer supported.");
921
+ error$1("[El#on()] Third argument no longer supported.");
922
922
  }
923
923
  if (this.constructor == El) {
924
924
  this.el.addEventListener(type, func);
@@ -974,7 +974,7 @@
974
974
  }
975
975
 
976
976
  this.value = function(str) {
977
- if (utils.isString(str)) {
977
+ if (utils$1.isString(str)) {
978
978
  el.node().textContent = str;
979
979
  } else {
980
980
  return el.node().textContent;
@@ -982,7 +982,7 @@
982
982
  };
983
983
  }
984
984
 
985
- utils.inherit(ClickText2, EventDispatcher);
985
+ utils$1.inherit(ClickText2, EventDispatcher);
986
986
 
987
987
  // @ref reference to a text input element
988
988
  function ClickText(ref) {
@@ -1053,9 +1053,9 @@
1053
1053
  // return _parser ? _parser(valStr) : parseFloat(valStr);
1054
1054
  return _value;
1055
1055
  }
1056
- var val = utils.clamp(arg, _min, _max);
1056
+ var val = utils$1.clamp(arg, _min, _max);
1057
1057
  if (!_validator(val)) {
1058
- error("ClickText#value() invalid value:", arg);
1058
+ error$1("ClickText#value() invalid value:", arg);
1059
1059
  } else {
1060
1060
  _value = val;
1061
1061
  }
@@ -1064,14 +1064,14 @@
1064
1064
  };
1065
1065
  }
1066
1066
 
1067
- utils.inherit(ClickText, EventDispatcher);
1067
+ utils$1.inherit(ClickText, EventDispatcher);
1068
1068
 
1069
1069
 
1070
1070
  function Checkbox(ref) {
1071
1071
  var _el = El(ref);
1072
1072
  }
1073
1073
 
1074
- utils.inherit(Checkbox, EventDispatcher);
1074
+ utils$1.inherit(Checkbox, EventDispatcher);
1075
1075
 
1076
1076
  function SimpleButton(ref) {
1077
1077
  var _el = El(ref),
@@ -1100,7 +1100,7 @@
1100
1100
  }
1101
1101
  }
1102
1102
 
1103
- utils.inherit(SimpleButton, EventDispatcher);
1103
+ utils$1.inherit(SimpleButton, EventDispatcher);
1104
1104
 
1105
1105
  // @cb function(<FileList>)
1106
1106
  function DropControl(el, cb) {
@@ -1307,7 +1307,7 @@
1307
1307
 
1308
1308
  function receiveFiles(files) {
1309
1309
  var prevSize = queuedFiles.length;
1310
- files = handleZipFiles(utils.toArray(files));
1310
+ files = handleZipFiles(utils$1.toArray(files));
1311
1311
  addFilesToQueue(files);
1312
1312
  if (queuedFiles.length === 0) return;
1313
1313
  gui.enterMode('import');
@@ -1322,7 +1322,7 @@
1322
1322
  }
1323
1323
 
1324
1324
  function filesMayContainPaths(files) {
1325
- return utils.some(files, function(f) {
1325
+ return utils$1.some(files, function(f) {
1326
1326
  var type = internal.guessInputFileType(f.name);
1327
1327
  return type == 'shp' || type == 'json' || internal.isZipFile(f.name);
1328
1328
  });
@@ -1426,7 +1426,7 @@
1426
1426
  lyr = dataset.layers[0];
1427
1427
  lyr.data = new internal.ShapefileTable(content, importOpts.encoding);
1428
1428
  if (lyr.shapes && lyr.data.size() != lyr.shapes.length) {
1429
- stop("Different number of records in .shp and .dbf files");
1429
+ stop$1("Different number of records in .shp and .dbf files");
1430
1430
  }
1431
1431
  if (!lyr.geometry_type) {
1432
1432
  // kludge: trigger display of table cells if .shp has null geometry
@@ -1491,7 +1491,7 @@
1491
1491
  }
1492
1492
 
1493
1493
  function handleImportError(e, fileName) {
1494
- var msg = utils.isString(e) ? e : e.message;
1494
+ var msg = utils$1.isString(e) ? e : e.message;
1495
1495
  if (fileName) {
1496
1496
  msg = "Error importing <i>" + fileName + "</i><br>" + msg;
1497
1497
  }
@@ -1549,7 +1549,7 @@
1549
1549
 
1550
1550
  function downloadFiles(paths) {
1551
1551
  var items = prepFilesForDownload(paths);
1552
- utils.reduceAsync(items, [], downloadNextFile, function(err, files) {
1552
+ utils$1.reduceAsync(items, [], downloadNextFile, function(err, files) {
1553
1553
  if (err) {
1554
1554
  gui.alert(err);
1555
1555
  } else if (!files.length) {
@@ -1645,7 +1645,7 @@
1645
1645
  var defaults = {
1646
1646
  space: 7
1647
1647
  };
1648
- opts = utils.extend(defaults, opts);
1648
+ opts = utils$1.extend(defaults, opts);
1649
1649
 
1650
1650
  var _pct = 0;
1651
1651
  var _track,
@@ -1698,7 +1698,7 @@
1698
1698
  };
1699
1699
 
1700
1700
  function setHandlePos(x, fire) {
1701
- x = utils.clamp(x, 0, size());
1701
+ x = utils$1.clamp(x, 0, size());
1702
1702
  var pct = x / size();
1703
1703
  if (pct != _pct) {
1704
1704
  _pct = pct;
@@ -1713,7 +1713,7 @@
1713
1713
  }
1714
1714
  }
1715
1715
 
1716
- utils.inherit(Slider, EventDispatcher);
1716
+ utils$1.inherit(Slider, EventDispatcher);
1717
1717
 
1718
1718
  /*
1719
1719
  How changes in the simplify control should affect other components
@@ -1781,7 +1781,7 @@
1781
1781
  slider.on('change', function(e) {
1782
1782
  var pct = fromSliderPct(e.pct);
1783
1783
  text.value(pct);
1784
- pct = utils.parsePercent(text.text()); // use rounded value (for consistency w/ cli)
1784
+ pct = utils$1.parsePercent(text.text()); // use rounded value (for consistency w/ cli)
1785
1785
  onChange(pct);
1786
1786
  });
1787
1787
  slider.on('start', function(e) {
@@ -1802,7 +1802,7 @@
1802
1802
  else if (pct < 0.01) decimals = 3;
1803
1803
  else if (pct < 1) decimals = 2;
1804
1804
  else if (pct < 100) decimals = 1;
1805
- return utils.formatNumber(pct, decimals) + "%";
1805
+ return utils$1.formatNumber(pct, decimals) + "%";
1806
1806
  });
1807
1807
 
1808
1808
  text.parser(function(s) {
@@ -2054,7 +2054,7 @@
2054
2054
 
2055
2055
  // Replace error function in mapshaper lib
2056
2056
  var error = function() {
2057
- stop.apply(null, utils.toArray(arguments));
2057
+ stop.apply(null, utils$1.toArray(arguments));
2058
2058
  };
2059
2059
 
2060
2060
  var message = function() {
@@ -2068,11 +2068,11 @@
2068
2068
  // replace CLI version of writeFiles()
2069
2069
  internal.replaceWriteFiles(function(files, opts, done) {
2070
2070
  var filename;
2071
- if (!utils.isArray(files) || files.length === 0) {
2071
+ if (!utils$1.isArray(files) || files.length === 0) {
2072
2072
  done("Nothing to export");
2073
2073
  } else if (GUI.canSaveToServer() && !opts.save_to_download_folder) {
2074
- var paths = internal.getOutputPaths(utils.pluck(files, 'filename'), opts);
2075
- var data = utils.pluck(files, 'content');
2074
+ var paths = internal.getOutputPaths(utils$1.pluck(files, 'filename'), opts);
2075
+ var data = utils$1.pluck(files, 'content');
2076
2076
  saveFilesToServer(paths, data, function(err) {
2077
2077
  var msg;
2078
2078
  if (err) {
@@ -2091,7 +2091,7 @@
2091
2091
  } else if (files.length == 1) {
2092
2092
  saveBlobToDownloadFolder(files[0].filename, new Blob([files[0].content]), done);
2093
2093
  } else {
2094
- filename = internal.getCommonFileBase(utils.pluck(files, 'filename')) || "output";
2094
+ filename = internal.getCommonFileBase(utils$1.pluck(files, 'filename')) || "output";
2095
2095
  saveZipFile(filename + ".zip", files, done);
2096
2096
  }
2097
2097
  });
@@ -2113,10 +2113,10 @@
2113
2113
  // try to match import filename of this dataset
2114
2114
  if (d.info.input_files[0] == src) return d;
2115
2115
  // try to match name of a layer in this dataset
2116
- lyr = utils.find(d.layers, function(lyr) {return lyr.name == src;});
2116
+ lyr = utils$1.find(d.layers, function(lyr) {return lyr.name == src;});
2117
2117
  return lyr ? internal.isolateLayer(lyr, d) : null;
2118
2118
  }, null);
2119
- if (!retn) stop("Missing data layer [" + src + "]");
2119
+ if (!retn) stop$1("Missing data layer [" + src + "]");
2120
2120
  return retn;
2121
2121
  }
2122
2122
 
@@ -2125,7 +2125,7 @@
2125
2125
  // Return a copy with layers duplicated, so changes won't affect original layers
2126
2126
  // This makes an (unsafe) assumption that the dataset arcs won't be changed...
2127
2127
  // need to rethink this.
2128
- return utils.defaults({
2128
+ return utils$1.defaults({
2129
2129
  layers: dataset.layers.map(internal.copyLayer)
2130
2130
  }, dataset);
2131
2131
  });
@@ -2197,7 +2197,7 @@
2197
2197
  }
2198
2198
 
2199
2199
  function projectPointsForDisplay(lyr, src, dest) {
2200
- var copy = utils.extend({}, lyr);
2200
+ var copy = utils$1.extend({}, lyr);
2201
2201
  var proj = internal.getProjTransform2(src, dest);
2202
2202
  copy.shapes = internal.cloneShapes(lyr.shapes);
2203
2203
  internal.projectPointLayer(copy, proj);
@@ -2594,7 +2594,7 @@
2594
2594
  } else if (cmd == 'history') {
2595
2595
  toLog(gui.session.toCommandLineString());
2596
2596
  } else if (cmd == 'layers') {
2597
- message("Available layers:",
2597
+ message$1("Available layers:",
2598
2598
  internal.getFormattedLayerList(model));
2599
2599
  } else if (cmd == 'close' || cmd == 'exit' || cmd == 'quit') {
2600
2600
  turnOff();
@@ -2683,7 +2683,7 @@
2683
2683
  }
2684
2684
 
2685
2685
  function onError(err) {
2686
- if (utils.isString(err)) {
2686
+ if (utils$1.isString(err)) {
2687
2687
  consoleStop(err);
2688
2688
  } else if (err.name == 'UserError') {
2689
2689
  // stop() has already been called, don't need to log
@@ -2698,7 +2698,7 @@
2698
2698
  function consoleStop() {
2699
2699
  var msg = GUI.formatMessageArgs(arguments);
2700
2700
  consoleWarning(msg);
2701
- throw new UserError(msg);
2701
+ throw new UserError$1(msg);
2702
2702
  }
2703
2703
 
2704
2704
  function consoleWarning() {
@@ -2862,7 +2862,7 @@
2862
2862
  // console.log("first intersection:", internal.getIntersectionDebugData(XX[0], arcs));
2863
2863
  pointLyr = {geometry_type: 'point', shapes: [internal.getIntersectionPoints(XX)]};
2864
2864
  map.setIntersectionLayer(pointLyr, {layers:[pointLyr]});
2865
- readout.html(utils.format('<span class="icon"></span>%s line intersection%s <img class="close-btn" src="images/close.png">', n, utils.pluralSuffix(n)));
2865
+ readout.html(utils$1.format('<span class="icon"></span>%s line intersection%s <img class="close-btn" src="images/close.png">', n, utils$1.pluralSuffix(n)));
2866
2866
  readout.findChild('.close-btn').on('click', dismiss);
2867
2867
  } else {
2868
2868
  map.setIntersectionLayer(null);
@@ -2871,7 +2871,7 @@
2871
2871
  }
2872
2872
  }
2873
2873
 
2874
- utils.inherit(RepairControl, EventDispatcher);
2874
+ utils$1.inherit(RepairControl, EventDispatcher);
2875
2875
 
2876
2876
  function filterLayerByIds(lyr, ids) {
2877
2877
  var shapes;
@@ -2879,7 +2879,7 @@
2879
2879
  shapes = ids.map(function(id) {
2880
2880
  return lyr.shapes[id];
2881
2881
  });
2882
- return utils.defaults({shapes: shapes, data: null}, lyr);
2882
+ return utils$1.defaults({shapes: shapes, data: null}, lyr);
2883
2883
  }
2884
2884
  return lyr;
2885
2885
  }
@@ -2985,7 +2985,7 @@
2985
2985
  // Convert an array-like object to an Array, or make a copy if @obj is an Array
2986
2986
  function toArray(obj) {
2987
2987
  var arr;
2988
- if (!isArrayLike(obj)) error$1("toArray() requires an array-like object");
2988
+ if (!isArrayLike(obj)) error("toArray() requires an array-like object");
2989
2989
  try {
2990
2990
  arr = Array.prototype.slice.call(obj, 0); // breaks in ie8
2991
2991
  } catch(e) {
@@ -3124,7 +3124,7 @@
3124
3124
  // Append elements of @src array to @dest array
3125
3125
  function merge(dest, src) {
3126
3126
  if (!isArray(dest) || !isArray(src)) {
3127
- error$1("Usage: merge(destArray, srcArray);");
3127
+ error("Usage: merge(destArray, srcArray);");
3128
3128
  }
3129
3129
  for (var i=0, n=src.length; i<n; i++) {
3130
3130
  dest.push(src[i]);
@@ -3165,7 +3165,7 @@
3165
3165
  else if (isArrayLike(container)) {
3166
3166
  return indexOf(container, item) != -1;
3167
3167
  }
3168
- error$1("Expected Array or String argument");
3168
+ error("Expected Array or String argument");
3169
3169
  }
3170
3170
 
3171
3171
  function some(arr, test) {
@@ -3212,7 +3212,7 @@
3212
3212
  // Assumes: no other non-numeric objects in array
3213
3213
  //
3214
3214
  function sum(arr, info) {
3215
- if (!isArrayLike(arr)) error$1 ("sum() expects an array, received:", arr);
3215
+ if (!isArrayLike(arr)) error ("sum() expects an array, received:", arr);
3216
3216
  var tot = 0,
3217
3217
  nan = 0,
3218
3218
  val;
@@ -3477,7 +3477,7 @@
3477
3477
  var arr2 = [];
3478
3478
  for (var i=0; i<len; i++) {
3479
3479
  var idx = idxs[i];
3480
- if (idx < 0 || idx >= len) error$1("Out-of-bounds array idx");
3480
+ if (idx < 0 || idx >= len) error("Out-of-bounds array idx");
3481
3481
  arr2[i] = arr[idx];
3482
3482
  }
3483
3483
  replaceArray(arr, arr2);
@@ -3562,7 +3562,7 @@
3562
3562
  // Elements of @arr are reordered
3563
3563
  //
3564
3564
  function findValueByRank(arr, rank) {
3565
- if (!arr.length || rank < 1 || rank > arr.length) error$1("[findValueByRank()] invalid input");
3565
+ if (!arr.length || rank < 1 || rank > arr.length) error("[findValueByRank()] invalid input");
3566
3566
 
3567
3567
  rank = clamp(rank | 0, 1, arr.length);
3568
3568
  var k = rank - 1, // conv. rank to array index
@@ -3746,7 +3746,7 @@
3746
3746
  var str = literals[0],
3747
3747
  n = arguments.length;
3748
3748
  if (n != formatCodes.length) {
3749
- error$1("[format()] Data does not match format string; format:", fmt, "data:", arguments);
3749
+ error("[format()] Data does not match format string; format:", fmt, "data:", arguments);
3750
3750
  }
3751
3751
  for (var i=0; i<n; i++) {
3752
3752
  str += formatValue(arguments[i], formatCodes[i]) + literals[i+1];
@@ -3785,7 +3785,7 @@
3785
3785
  }
3786
3786
 
3787
3787
  function copyElements(src, i, dest, j, n, rev) {
3788
- if (src === dest && j > i) error$1 ("copy error");
3788
+ if (src === dest && j > i) error ("copy error");
3789
3789
  var inc = 1,
3790
3790
  offs = 0;
3791
3791
  if (rev) {
@@ -3831,7 +3831,7 @@
3831
3831
  pct = Number(str);
3832
3832
  }
3833
3833
  if (!(pct >= 0 && pct <= 1)) {
3834
- stop$1(format("Invalid percentage: %s", str));
3834
+ stop(format("Invalid percentage: %s", str));
3835
3835
  }
3836
3836
  return pct;
3837
3837
  }
@@ -3946,7 +3946,7 @@
3946
3946
  function createAsyncContext(cb) {
3947
3947
  context = createContext();
3948
3948
  return function() {
3949
- cb.apply(null, utils$1.toArray(arguments));
3949
+ cb.apply(null, utils.toArray(arguments));
3950
3950
  // clear context after cb(), so output/errors can be handled in current context
3951
3951
  context = createContext();
3952
3952
  };
@@ -3959,7 +3959,7 @@
3959
3959
  var ctx = context;
3960
3960
  return function() {
3961
3961
  context = ctx;
3962
- cb.apply(null, utils$1.toArray(arguments));
3962
+ cb.apply(null, utils.toArray(arguments));
3963
3963
  };
3964
3964
  }
3965
3965
 
@@ -3968,12 +3968,12 @@
3968
3968
 
3969
3969
  // These three functions can be reset by GUI using setLoggingFunctions();
3970
3970
  var _error = function() {
3971
- var msg = utils$1.toArray(arguments).join(' ');
3971
+ var msg = utils.toArray(arguments).join(' ');
3972
3972
  throw new Error(msg);
3973
3973
  };
3974
3974
 
3975
3975
  var _stop = function() {
3976
- throw new UserError$1(formatLogArgs(arguments));
3976
+ throw new UserError(formatLogArgs(arguments));
3977
3977
  };
3978
3978
 
3979
3979
  var _interrupt = function() {
@@ -3993,21 +3993,21 @@
3993
3993
  }
3994
3994
 
3995
3995
  // Handle an unexpected condition (internal error)
3996
- function error$1() {
3997
- _error.apply(null, utils$1.toArray(arguments));
3996
+ function error() {
3997
+ _error.apply(null, utils.toArray(arguments));
3998
3998
  }
3999
3999
 
4000
4000
  // Handle an error caused by invalid input or misuse of API
4001
- function stop$1() {
4002
- _stop.apply(null, utils$1.toArray(arguments));
4001
+ function stop() {
4002
+ _stop.apply(null, utils.toArray(arguments));
4003
4003
  }
4004
4004
 
4005
4005
  function interrupt() {
4006
- _interrupt.apply(null, utils$1.toArray(arguments));
4006
+ _interrupt.apply(null, utils.toArray(arguments));
4007
4007
  }
4008
4008
 
4009
4009
  // Print a status message
4010
- function message$1() {
4010
+ function message() {
4011
4011
  _message.apply(null, messageArgs(arguments));
4012
4012
  }
4013
4013
 
@@ -4022,14 +4022,14 @@
4022
4022
  // print a message to stdout
4023
4023
  function print() {
4024
4024
  STDOUT = true; // tell logArgs() to print to stdout, not stderr
4025
- message$1.apply(null, arguments);
4025
+ message.apply(null, arguments);
4026
4026
  STDOUT = false;
4027
4027
  }
4028
4028
 
4029
4029
  function verbose() {
4030
4030
  // verbose can be set globally with the -verbose command or separately for each command
4031
4031
  if (getStateVar('VERBOSE') || getStateVar('verbose')) {
4032
- message$1.apply(null, arguments);
4032
+ message.apply(null, arguments);
4033
4033
  }
4034
4034
  }
4035
4035
 
@@ -4042,8 +4042,8 @@
4042
4042
  function printError(err) {
4043
4043
  var msg;
4044
4044
  if (!LOGGING) return;
4045
- if (utils$1.isString(err)) {
4046
- err = new UserError$1(err);
4045
+ if (utils.isString(err)) {
4046
+ err = new UserError(err);
4047
4047
  }
4048
4048
  if (err.name == 'NonFatalError') {
4049
4049
  console.error(messageArgs([err.message]).join(' '));
@@ -4061,7 +4061,7 @@
4061
4061
  }
4062
4062
  }
4063
4063
 
4064
- function UserError$1(msg) {
4064
+ function UserError(msg) {
4065
4065
  var err = new Error(msg);
4066
4066
  err.name = 'UserError';
4067
4067
  return err;
@@ -4101,7 +4101,7 @@
4101
4101
  var col = i % perLine;
4102
4102
  if (i > 0 && col === 0) memo += '\n';
4103
4103
  if (col < perLine - 1) { // right-pad all but rightmost column
4104
- name = utils$1.rpad(name, colWidth - 2, ' ');
4104
+ name = utils.rpad(name, colWidth - 2, ' ');
4105
4105
  }
4106
4106
  return memo + ' ' + name;
4107
4107
  }, '');
@@ -4109,11 +4109,11 @@
4109
4109
 
4110
4110
  // expose so GUI can use it
4111
4111
  function formatLogArgs(args) {
4112
- return utils$1.toArray(args).join(' ');
4112
+ return utils.toArray(args).join(' ');
4113
4113
  }
4114
4114
 
4115
4115
  function messageArgs(args) {
4116
- var arr = utils$1.toArray(args);
4116
+ var arr = utils.toArray(args);
4117
4117
  var cmd = getStateVar('current_command');
4118
4118
  if (cmd && cmd != 'help') {
4119
4119
  arr.unshift('[' + cmd + ']');
@@ -4122,7 +4122,7 @@
4122
4122
  }
4123
4123
 
4124
4124
  function logArgs(args) {
4125
- if (LOGGING && !getStateVar('QUIET') && utils$1.isArrayLike(args)) {
4125
+ if (LOGGING && !getStateVar('QUIET') && utils.isArrayLike(args)) {
4126
4126
  (!STDOUT && console.error || console.log).call(console, formatLogArgs(args));
4127
4127
  }
4128
4128
  }
@@ -4193,14 +4193,14 @@
4193
4193
  }
4194
4194
  });
4195
4195
  if (throws && unmatchedIds.length) {
4196
- stop$1(utils$1.format('Missing layer%s: %s', unmatchedIds.length == 1 ? '' : 's', unmatchedIds.join(',')));
4196
+ stop(utils.format('Missing layer%s: %s', unmatchedIds.length == 1 ? '' : 's', unmatchedIds.join(',')));
4197
4197
  }
4198
4198
  return matchedLayers;
4199
4199
  }
4200
4200
 
4201
4201
  function getLayerMatch(pattern) {
4202
- var isIndex = utils$1.isInteger(Number(pattern));
4203
- var nameRxp = isIndex ? null : utils$1.wildcardToRegExp(pattern);
4202
+ var isIndex = utils.isInteger(Number(pattern));
4203
+ var nameRxp = isIndex ? null : utils.wildcardToRegExp(pattern);
4204
4204
  return function(lyr, i) {
4205
4205
  return isIndex ? String(i) == pattern : nameRxp.test(lyr.name || '');
4206
4206
  };
@@ -4222,7 +4222,7 @@
4222
4222
  if (lyr.name && o.layer.name == lyr.name) nameCount++;
4223
4223
  if (lyr == o.layer) id = String(i + 1);
4224
4224
  });
4225
- if (!id) error$1('Layer not found');
4225
+ if (!id) error('Layer not found');
4226
4226
  return nameCount == 1 ? lyr.name : id;
4227
4227
  }
4228
4228
 
@@ -4242,7 +4242,7 @@
4242
4242
  });
4243
4243
 
4244
4244
  internal.writeFiles = function() {
4245
- error(unsupportedMsg);
4245
+ error$1(unsupportedMsg);
4246
4246
  };
4247
4247
  } else {
4248
4248
  new SimpleButton(menu.findChild('.save-btn').addClass('default-btn')).on('click', onExportClick);
@@ -4278,7 +4278,7 @@
4278
4278
  setTimeout(function() {
4279
4279
  exportMenuSelection(layers, function(err) {
4280
4280
  if (err) {
4281
- if (utils.isString(err)) {
4281
+ if (utils$1.isString(err)) {
4282
4282
  gui.alert(err);
4283
4283
  } else {
4284
4284
  // stack seems to change if Error is logged directly
@@ -4325,7 +4325,7 @@
4325
4325
  // without changing its name elsewhere
4326
4326
  layer: Object.assign({}, o.layer)
4327
4327
  };
4328
- var html = utils.format(template, i + 1, target.layer.name || '[unnamed layer]');
4328
+ var html = utils$1.format(template, i + 1, target.layer.name || '[unnamed layer]');
4329
4329
  // return {layer: o.layer, html: html};
4330
4330
  var el = El('div').html(html).addClass('layer-item');
4331
4331
  var box = el.findChild('input').node();
@@ -4435,9 +4435,9 @@
4435
4435
 
4436
4436
  function initFormatMenu() {
4437
4437
  var defaults = ['shapefile', 'geojson', 'topojson', 'json', 'dsv', 'svg'];
4438
- var formats = utils.uniq(defaults.concat(getInputFormats()));
4438
+ var formats = utils$1.uniq(defaults.concat(getInputFormats()));
4439
4439
  var items = formats.map(function(fmt) {
4440
- return utils.format('<div><label><input type="radio" name="format" value="%s"' +
4440
+ return utils$1.format('<div><label><input type="radio" name="format" value="%s"' +
4441
4441
  ' class="radio">%s</label></div>', fmt, internal.getFormatName(fmt));
4442
4442
  });
4443
4443
  menu.findChild('.export-formats').html(items.join('\n'));
@@ -4600,7 +4600,7 @@
4600
4600
  // can be used as unique identifiers for caching rendered HTML, and as
4601
4601
  // an id for layer menu event handlers
4602
4602
  if (!lyr.menu_id || uniqIds[lyr.menu_id]) {
4603
- lyr.menu_id = utils.getUniqueName();
4603
+ lyr.menu_id = utils$1.getUniqueName();
4604
4604
  }
4605
4605
  uniqIds[lyr.menu_id] = true;
4606
4606
  if (isPinnable(lyr)) pinnableCount++;
@@ -4773,7 +4773,7 @@
4773
4773
  type = lyr.geometry_type + ' feature';
4774
4774
  }
4775
4775
  if (type) {
4776
- str = utils.format('%,d %s%s', n, type, utils.pluralSuffix(n));
4776
+ str = utils$1.format('%,d %s%s', n, type, utils$1.pluralSuffix(n));
4777
4777
  } else {
4778
4778
  str = "[empty]";
4779
4779
  }
@@ -4784,7 +4784,7 @@
4784
4784
  var file = internal.getLayerSourceFile(lyr, dataset);
4785
4785
  var missing = [];
4786
4786
  var msg;
4787
- if (utils.endsWith(file, '.shp') && lyr == dataset.layers[0]) {
4787
+ if (utils$1.endsWith(file, '.shp') && lyr == dataset.layers[0]) {
4788
4788
  if (!lyr.data) {
4789
4789
  missing.push('.dbf');
4790
4790
  }
@@ -4810,7 +4810,7 @@
4810
4810
 
4811
4811
 
4812
4812
  function rowHTML(c1, c2, cname) {
4813
- return utils.format('<div class="row%s"><div class="col1">%s</div>' +
4813
+ return utils$1.format('<div class="row%s"><div class="col1">%s</div>' +
4814
4814
  '<div class="col2">%s</div></div>', cname ? ' ' + cname : '', c1, c2);
4815
4815
  }
4816
4816
  }
@@ -5031,7 +5031,7 @@
5031
5031
  };
5032
5032
  }
5033
5033
 
5034
- utils.inherit(ModeSwitcher, EventDispatcher);
5034
+ utils$1.inherit(ModeSwitcher, EventDispatcher);
5035
5035
 
5036
5036
  function KeyboardEvents(gui) {
5037
5037
  var self = this;
@@ -5059,7 +5059,7 @@
5059
5059
  };
5060
5060
  }
5061
5061
 
5062
- utils.inherit(KeyboardEvents, EventDispatcher);
5062
+ utils$1.inherit(KeyboardEvents, EventDispatcher);
5063
5063
 
5064
5064
  function InteractionMode(gui) {
5065
5065
 
@@ -5275,7 +5275,7 @@
5275
5275
  function Model(gui) {
5276
5276
  var self = new internal.Catalog();
5277
5277
  var deleteLayer = self.deleteLayer;
5278
- utils.extend(self, EventDispatcher.prototype);
5278
+ utils$1.extend(self, EventDispatcher.prototype);
5279
5279
 
5280
5280
  // override Catalog method (so -drop command will work in web console)
5281
5281
  self.deleteLayer = function(lyr, dataset) {
@@ -5309,7 +5309,7 @@
5309
5309
  if (flags.select) {
5310
5310
  self.dispatchEvent('select', active);
5311
5311
  }
5312
- self.dispatchEvent('update', utils.extend({flags: flags}, active));
5312
+ self.dispatchEvent('update', utils$1.extend({flags: flags}, active));
5313
5313
  };
5314
5314
 
5315
5315
  self.selectLayer = function(lyr, dataset) {
@@ -5344,7 +5344,7 @@
5344
5344
  } else if (geoType == 'polygon') {
5345
5345
  test = polygonTest;
5346
5346
  } else {
5347
- error("Unexpected geometry type:", geoType);
5347
+ error$1("Unexpected geometry type:", geoType);
5348
5348
  }
5349
5349
  return test;
5350
5350
 
@@ -5370,7 +5370,7 @@
5370
5370
  cand, hitId;
5371
5371
  for (var i=0; i<cands.length; i++) {
5372
5372
  cand = cands[i];
5373
- if (geom.testPointInPolygon(x, y, cand.shape, displayLayer.arcs)) {
5373
+ if (geom$1.testPointInPolygon(x, y, cand.shape, displayLayer.arcs)) {
5374
5374
  hits.push(cand.id);
5375
5375
  }
5376
5376
  }
@@ -5409,9 +5409,9 @@
5409
5409
 
5410
5410
  function sortByDistance(x, y, cands, arcs) {
5411
5411
  for (var i=0; i<cands.length; i++) {
5412
- cands[i].dist = geom.getPointToShapeDistance(x, y, cands[i].shape, arcs);
5412
+ cands[i].dist = geom$1.getPointToShapeDistance(x, y, cands[i].shape, arcs);
5413
5413
  }
5414
- utils.sortOn(cands, 'dist');
5414
+ utils$1.sortOn(cands, 'dist');
5415
5415
  }
5416
5416
 
5417
5417
  function pointTest(x, y) {
@@ -5423,7 +5423,7 @@
5423
5423
  newThreshold = Infinity;
5424
5424
 
5425
5425
  internal.forEachPoint(displayLayer.layer.shapes, function(p, id) {
5426
- var dist = geom.distance2D(x, y, p[0], p[1]) * toPx;
5426
+ var dist = geom$1.distance2D(x, y, p[0], p[1]) * toPx;
5427
5427
  if (dist > hitThreshold) return;
5428
5428
  // got a hit
5429
5429
  if (dist < newThreshold) {
@@ -5437,7 +5437,7 @@
5437
5437
  }
5438
5438
  });
5439
5439
  // console.log(hitThreshold, bullseye);
5440
- return utils.uniq(hits); // multipoint features can register multiple hits
5440
+ return utils$1.uniq(hits); // multipoint features can register multiple hits
5441
5441
  }
5442
5442
 
5443
5443
  function getRadiusFunction(style) {
@@ -5460,7 +5460,7 @@
5460
5460
  hitRadius = 0,
5461
5461
  hitDist;
5462
5462
  internal.forEachPoint(displayLayer.layer.shapes, function(p, id) {
5463
- var distSq = geom.distanceSq(x, y, p[0], p[1]);
5463
+ var distSq = geom$1.distanceSq(x, y, p[0], p[1]);
5464
5464
  var isHit = false;
5465
5465
  var isOver, isNear, r, d, rpix;
5466
5466
  if (distSq > limit * limit) return;
@@ -5644,9 +5644,9 @@
5644
5644
  };
5645
5645
  var svgData = svgTest(e); // null or a data object
5646
5646
  if (svgData) { // mouse is over an SVG symbol
5647
- utils.extend(data, svgData);
5647
+ utils$1.extend(data, svgData);
5648
5648
  // placing symbol id in front of any other hits
5649
- data.ids = utils.uniq([svgData.targetId].concat(data.ids));
5649
+ data.ids = utils$1.uniq([svgData.targetId].concat(data.ids));
5650
5650
  }
5651
5651
  data.id = data.ids.length > 0 ? data.ids[0] : -1;
5652
5652
  return data;
@@ -5747,8 +5747,8 @@
5747
5747
 
5748
5748
  self.addSelectionIds = function(ids) {
5749
5749
  turnOn('selection');
5750
- selectionIds = utils.uniq(selectionIds.concat(ids));
5751
- ids = utils.uniq(storedData.ids.concat(ids));
5750
+ selectionIds = utils$1.uniq(selectionIds.concat(ids));
5751
+ ids = utils$1.uniq(storedData.ids.concat(ids));
5752
5752
  updateSelectionState({ids: ids});
5753
5753
  };
5754
5754
 
@@ -5906,7 +5906,7 @@
5906
5906
 
5907
5907
  function toggleId(id, ids) {
5908
5908
  if (ids.indexOf(id) > -1) {
5909
- return utils.difference(ids, [id]);
5909
+ return utils$1.difference(ids, [id]);
5910
5910
  }
5911
5911
  return [id].concat(ids);
5912
5912
  }
@@ -5958,9 +5958,9 @@
5958
5958
  // d: event data (may be a pointer event object, an ordinary object or null)
5959
5959
  function triggerHitEvent(type, d) {
5960
5960
  // Merge stored hit data into the event data
5961
- var eventData = utils.extend({mode: interactionMode}, d || {}, storedData);
5961
+ var eventData = utils$1.extend({mode: interactionMode}, d || {}, storedData);
5962
5962
  if (transientIds.length) {
5963
- eventData.ids = utils.uniq(transientIds.concat(eventData.ids || []));
5963
+ eventData.ids = utils$1.uniq(transientIds.concat(eventData.ids || []));
5964
5964
  }
5965
5965
  self.dispatchEvent(type, eventData);
5966
5966
  }
@@ -6094,7 +6094,7 @@
6094
6094
  }
6095
6095
  }
6096
6096
 
6097
- utils.inherit(Timer, EventDispatcher);
6097
+ utils$1.inherit(Timer, EventDispatcher);
6098
6098
 
6099
6099
  function Tween(ease) {
6100
6100
  var self = this,
@@ -6116,7 +6116,7 @@
6116
6116
  }
6117
6117
  }
6118
6118
 
6119
- utils.inherit(Tween, EventDispatcher);
6119
+ utils$1.inherit(Tween, EventDispatcher);
6120
6120
 
6121
6121
  Tween.sineInOut = function(n) {
6122
6122
  return 0.5 - Math.cos(n * Math.PI) / 2;
@@ -6184,7 +6184,7 @@
6184
6184
  update();
6185
6185
  }
6186
6186
 
6187
- utils.inherit(ElementPosition, EventDispatcher);
6187
+ utils$1.inherit(ElementPosition, EventDispatcher);
6188
6188
 
6189
6189
  function MouseWheelDirection() {
6190
6190
  var prevTime = 0;
@@ -6282,13 +6282,13 @@
6282
6282
  // Decelerate towards the end of the sustain interval (for smoother zooming)
6283
6283
  multiplier *= Tween.quadraticOut(1 - fadeFactor);
6284
6284
  }
6285
- obj = utils.extend({direction: wheelDirection, multiplier: multiplier}, mouse.mouseData());
6285
+ obj = utils$1.extend({direction: wheelDirection, multiplier: multiplier}, mouse.mouseData());
6286
6286
  self.dispatchEvent('mousewheel', obj);
6287
6287
  }
6288
6288
  }
6289
6289
  }
6290
6290
 
6291
- utils.inherit(MouseWheel, EventDispatcher);
6291
+ utils$1.inherit(MouseWheel, EventDispatcher);
6292
6292
 
6293
6293
 
6294
6294
  function MouseArea(element, pos) {
@@ -6342,7 +6342,7 @@
6342
6342
  };
6343
6343
 
6344
6344
  this.mouseData = function() {
6345
- return utils.extend({}, _prevEvt);
6345
+ return utils$1.extend({}, _prevEvt);
6346
6346
  };
6347
6347
 
6348
6348
  function onAreaDown(e) {
@@ -6401,7 +6401,7 @@
6401
6401
  dragX: evt.pageX - _downEvt.pageX,
6402
6402
  dragY: evt.pageY - _downEvt.pageY
6403
6403
  };
6404
- _self.dispatchEvent('drag', utils.extend(obj, evt));
6404
+ _self.dispatchEvent('drag', utils$1.extend(obj, evt));
6405
6405
  } else {
6406
6406
  _self.dispatchEvent('hover', evt);
6407
6407
  }
@@ -6433,7 +6433,7 @@
6433
6433
  }
6434
6434
  }
6435
6435
 
6436
- utils.inherit(MouseArea, EventDispatcher);
6436
+ utils$1.inherit(MouseArea, EventDispatcher);
6437
6437
 
6438
6438
  function initVariableClick(node, cb) {
6439
6439
  var downEvent = null;
@@ -6580,7 +6580,7 @@
6580
6580
  maxScale = 4,
6581
6581
  minTime = 100,
6582
6582
  maxTime = 800,
6583
- time = utils.clamp(clickTime || 200, minTime, maxTime),
6583
+ time = utils$1.clamp(clickTime || 200, minTime, maxTime),
6584
6584
  k = (time - minTime) / (maxTime - minTime),
6585
6585
  scale = minScale + k * (maxScale - minScale);
6586
6586
  return 1 + scale * zoomScaleMultiplier;
@@ -6588,7 +6588,7 @@
6588
6588
 
6589
6589
  // @box Bounds with pixels from t,l corner of map area.
6590
6590
  function zoomToBbox(bbox) {
6591
- var bounds = new Bounds(bbox),
6591
+ var bounds = new Bounds$1(bbox),
6592
6592
  pct = Math.max(bounds.width() / ext.width(), bounds.height() / ext.height()),
6593
6593
  fx = bounds.centerX() / ext.width() * (1 + pct) - pct / 2,
6594
6594
  fy = bounds.centerY() / ext.height() * (1 + pct) - pct / 2;
@@ -6808,7 +6808,7 @@
6808
6808
  rows = 0;
6809
6809
  // self.hide(); // clean up if panel is already open
6810
6810
  el.empty(); // clean up if panel is already open
6811
- utils.forEachProperty(rec, function(v, k) {
6811
+ utils$1.forEachProperty(rec, function(v, k) {
6812
6812
  var type;
6813
6813
  // missing GeoJSON fields are set to undefined on import; skip these
6814
6814
  if (v !== undefined) {
@@ -6836,7 +6836,7 @@
6836
6836
  // Some individual features can have undefined values for some or all of
6837
6837
  // their data properties (properties are set to undefined when an input JSON file
6838
6838
  // has inconsistent fields, or after force-merging layers with inconsistent fields).
6839
- el.html(utils.format('<div class="note">This %s is missing attribute data.</div>',
6839
+ el.html(utils$1.format('<div class="note">This %s is missing attribute data.</div>',
6840
6840
  table && table.getFields().length > 0 ? 'feature': 'layer'));
6841
6841
  }
6842
6842
  }
@@ -6847,7 +6847,7 @@
6847
6847
  var str = formatInspectorValue(val, type);
6848
6848
  var cell = El('tr')
6849
6849
  .appendTo(table)
6850
- .html(utils.format(rowHtml, key, utils.htmlEscape(str)))
6850
+ .html(utils$1.format(rowHtml, key, utils$1.htmlEscape(str)))
6851
6851
  .findChild('.value');
6852
6852
  setFieldClass(cell, val, type);
6853
6853
  if (editable) {
@@ -6856,7 +6856,7 @@
6856
6856
  }
6857
6857
 
6858
6858
  function setFieldClass(el, val, type) {
6859
- var isNum = type ? type == 'number' : utils.isNumber(val);
6859
+ var isNum = type ? type == 'number' : utils$1.isNumber(val);
6860
6860
  var isNully = val === undefined || val === null || val !== val;
6861
6861
  var isEmpty = val === '';
6862
6862
  el.classed('num-field', isNum);
@@ -6894,7 +6894,7 @@
6894
6894
  function formatInspectorValue(val, type) {
6895
6895
  var str;
6896
6896
  if (type == 'date') {
6897
- str = utils.formatDateISO(val);
6897
+ str = utils$1.formatDateISO(val);
6898
6898
  } else if (type == 'object') {
6899
6899
  str = val ? JSON.stringify(val) : "";
6900
6900
  } else {
@@ -7015,7 +7015,7 @@
7015
7015
  }
7016
7016
 
7017
7017
  function getBoundsIntersection(a, b) {
7018
- var c = new Bounds();
7018
+ var c = new Bounds$1();
7019
7019
  if (a.intersects(b)) {
7020
7020
  c.setBounds(Math.max(a.xmin, b.xmin), Math.max(a.ymin, b.ymin),
7021
7021
  Math.min(a.xmax, b.xmax), Math.min(a.ymax, b.ymax));
@@ -7093,7 +7093,7 @@
7093
7093
  // handle either numeric strings or numbers in fields
7094
7094
  function applyDelta(rec, key, delta) {
7095
7095
  var currVal = rec[key];
7096
- var isString = utils.isString(currVal);
7096
+ var isString = utils$1.isString(currVal);
7097
7097
  var newVal = (+currVal + delta) || 0;
7098
7098
  rec[key] = isString ? String(newVal) : newVal;
7099
7099
  }
@@ -7508,18 +7508,18 @@
7508
7508
  return JSON.stringify(Object.assign({}, this));
7509
7509
  };
7510
7510
 
7511
- function Bounds$1() {
7511
+ function Bounds() {
7512
7512
  if (arguments.length > 0) {
7513
7513
  this.setBounds.apply(this, arguments);
7514
7514
  }
7515
7515
  }
7516
7516
 
7517
- Bounds$1.from = function() {
7518
- var b = new Bounds$1();
7517
+ Bounds.from = function() {
7518
+ var b = new Bounds();
7519
7519
  return b.setBounds.apply(b, arguments);
7520
7520
  };
7521
7521
 
7522
- Bounds$1.prototype.toString = function() {
7522
+ Bounds.prototype.toString = function() {
7523
7523
  return JSON.stringify({
7524
7524
  xmin: this.xmin,
7525
7525
  xmax: this.xmax,
@@ -7528,41 +7528,41 @@
7528
7528
  });
7529
7529
  };
7530
7530
 
7531
- Bounds$1.prototype.toArray = function() {
7531
+ Bounds.prototype.toArray = function() {
7532
7532
  return this.hasBounds() ? [this.xmin, this.ymin, this.xmax, this.ymax] : [];
7533
7533
  };
7534
7534
 
7535
- Bounds$1.prototype.hasBounds = function() {
7535
+ Bounds.prototype.hasBounds = function() {
7536
7536
  return this.xmin <= this.xmax && this.ymin <= this.ymax;
7537
7537
  };
7538
7538
 
7539
- Bounds$1.prototype.sameBounds =
7540
- Bounds$1.prototype.equals = function(bb) {
7539
+ Bounds.prototype.sameBounds =
7540
+ Bounds.prototype.equals = function(bb) {
7541
7541
  return bb && this.xmin === bb.xmin && this.xmax === bb.xmax &&
7542
7542
  this.ymin === bb.ymin && this.ymax === bb.ymax;
7543
7543
  };
7544
7544
 
7545
- Bounds$1.prototype.width = function() {
7545
+ Bounds.prototype.width = function() {
7546
7546
  return (this.xmax - this.xmin) || 0;
7547
7547
  };
7548
7548
 
7549
- Bounds$1.prototype.height = function() {
7549
+ Bounds.prototype.height = function() {
7550
7550
  return (this.ymax - this.ymin) || 0;
7551
7551
  };
7552
7552
 
7553
- Bounds$1.prototype.area = function() {
7553
+ Bounds.prototype.area = function() {
7554
7554
  return this.width() * this.height() || 0;
7555
7555
  };
7556
7556
 
7557
- Bounds$1.prototype.empty = function() {
7557
+ Bounds.prototype.empty = function() {
7558
7558
  this.xmin = this.ymin = this.xmax = this.ymax = void 0;
7559
7559
  return this;
7560
7560
  };
7561
7561
 
7562
- Bounds$1.prototype.setBounds = function(a, b, c, d) {
7562
+ Bounds.prototype.setBounds = function(a, b, c, d) {
7563
7563
  if (arguments.length == 1) {
7564
7564
  // assume first arg is a Bounds or array
7565
- if (utils$1.isArrayLike(a)) {
7565
+ if (utils.isArrayLike(a)) {
7566
7566
  b = a[1];
7567
7567
  c = a[2];
7568
7568
  d = a[3];
@@ -7585,17 +7585,17 @@
7585
7585
  };
7586
7586
 
7587
7587
 
7588
- Bounds$1.prototype.centerX = function() {
7588
+ Bounds.prototype.centerX = function() {
7589
7589
  var x = (this.xmin + this.xmax) * 0.5;
7590
7590
  return x;
7591
7591
  };
7592
7592
 
7593
- Bounds$1.prototype.centerY = function() {
7593
+ Bounds.prototype.centerY = function() {
7594
7594
  var y = (this.ymax + this.ymin) * 0.5;
7595
7595
  return y;
7596
7596
  };
7597
7597
 
7598
- Bounds$1.prototype.containsPoint = function(x, y) {
7598
+ Bounds.prototype.containsPoint = function(x, y) {
7599
7599
  if (x >= this.xmin && x <= this.xmax &&
7600
7600
  y <= this.ymax && y >= this.ymin) {
7601
7601
  return true;
@@ -7605,8 +7605,8 @@
7605
7605
 
7606
7606
  // intended to speed up slightly bubble symbol detection; could use intersects() instead
7607
7607
  // TODO: fix false positive where circle is just outside a corner of the box
7608
- Bounds$1.prototype.containsBufferedPoint =
7609
- Bounds$1.prototype.containsCircle = function(x, y, buf) {
7608
+ Bounds.prototype.containsBufferedPoint =
7609
+ Bounds.prototype.containsCircle = function(x, y, buf) {
7610
7610
  if ( x + buf > this.xmin && x - buf < this.xmax ) {
7611
7611
  if ( y - buf < this.ymax && y + buf > this.ymin ) {
7612
7612
  return true;
@@ -7615,7 +7615,7 @@
7615
7615
  return false;
7616
7616
  };
7617
7617
 
7618
- Bounds$1.prototype.intersects = function(bb) {
7618
+ Bounds.prototype.intersects = function(bb) {
7619
7619
  if (bb.xmin <= this.xmax && bb.xmax >= this.xmin &&
7620
7620
  bb.ymax >= this.ymin && bb.ymin <= this.ymax) {
7621
7621
  return true;
@@ -7623,7 +7623,7 @@
7623
7623
  return false;
7624
7624
  };
7625
7625
 
7626
- Bounds$1.prototype.contains = function(bb) {
7626
+ Bounds.prototype.contains = function(bb) {
7627
7627
  if (bb.xmin >= this.xmin && bb.ymax <= this.ymax &&
7628
7628
  bb.xmax <= this.xmax && bb.ymin >= this.ymin) {
7629
7629
  return true;
@@ -7631,12 +7631,12 @@
7631
7631
  return false;
7632
7632
  };
7633
7633
 
7634
- Bounds$1.prototype.shift = function(x, y) {
7634
+ Bounds.prototype.shift = function(x, y) {
7635
7635
  this.setBounds(this.xmin + x,
7636
7636
  this.ymin + y, this.xmax + x, this.ymax + y);
7637
7637
  };
7638
7638
 
7639
- Bounds$1.prototype.padBounds = function(a, b, c, d) {
7639
+ Bounds.prototype.padBounds = function(a, b, c, d) {
7640
7640
  this.xmin -= a;
7641
7641
  this.ymin -= b;
7642
7642
  this.xmax += c;
@@ -7647,7 +7647,7 @@
7647
7647
  // @param {number} pct Fraction of original extents
7648
7648
  // @param {number} pctY Optional amount to scale Y
7649
7649
  //
7650
- Bounds$1.prototype.scale = function(pct, pctY) { /*, focusX, focusY*/
7650
+ Bounds.prototype.scale = function(pct, pctY) { /*, focusX, focusY*/
7651
7651
  var halfWidth = (this.xmax - this.xmin) * 0.5;
7652
7652
  var halfHeight = (this.ymax - this.ymin) * 0.5;
7653
7653
  var kx = pct - 1;
@@ -7659,16 +7659,16 @@
7659
7659
  };
7660
7660
 
7661
7661
  // Return a bounding box with the same extent as this one.
7662
- Bounds$1.prototype.cloneBounds = // alias so child classes can override clone()
7663
- Bounds$1.prototype.clone = function() {
7664
- return new Bounds$1(this.xmin, this.ymin, this.xmax, this.ymax);
7662
+ Bounds.prototype.cloneBounds = // alias so child classes can override clone()
7663
+ Bounds.prototype.clone = function() {
7664
+ return new Bounds(this.xmin, this.ymin, this.xmax, this.ymax);
7665
7665
  };
7666
7666
 
7667
- Bounds$1.prototype.clearBounds = function() {
7668
- this.setBounds(new Bounds$1());
7667
+ Bounds.prototype.clearBounds = function() {
7668
+ this.setBounds(new Bounds());
7669
7669
  };
7670
7670
 
7671
- Bounds$1.prototype.mergePoint = function(x, y) {
7671
+ Bounds.prototype.mergePoint = function(x, y) {
7672
7672
  if (this.xmin === void 0) {
7673
7673
  this.setBounds(x, y, x, y);
7674
7674
  } else {
@@ -7683,7 +7683,7 @@
7683
7683
 
7684
7684
  // expands either x or y dimension to match @aspect (width/height ratio)
7685
7685
  // @focusX, @focusY (optional): expansion focus, as a fraction of width and height
7686
- Bounds$1.prototype.fillOut = function(aspect, focusX, focusY) {
7686
+ Bounds.prototype.fillOut = function(aspect, focusX, focusY) {
7687
7687
  if (arguments.length < 3) {
7688
7688
  focusX = 0.5;
7689
7689
  focusY = 0.5;
@@ -7706,7 +7706,7 @@
7706
7706
  return this;
7707
7707
  };
7708
7708
 
7709
- Bounds$1.prototype.update = function() {
7709
+ Bounds.prototype.update = function() {
7710
7710
  var tmp;
7711
7711
  if (this.xmin > this.xmax) {
7712
7712
  tmp = this.xmin;
@@ -7720,7 +7720,7 @@
7720
7720
  }
7721
7721
  };
7722
7722
 
7723
- Bounds$1.prototype.transform = function(t) {
7723
+ Bounds.prototype.transform = function(t) {
7724
7724
  this.xmin = this.xmin * t.mx + t.bx;
7725
7725
  this.xmax = this.xmax * t.mx + t.bx;
7726
7726
  this.ymin = this.ymin * t.my + t.by;
@@ -7732,7 +7732,7 @@
7732
7732
  // Returns a Transform object for mapping this onto Bounds @b2
7733
7733
  // @flipY (optional) Flip y-axis coords, for converting to/from pixel coords
7734
7734
  //
7735
- Bounds$1.prototype.getTransform = function(b2, flipY) {
7735
+ Bounds.prototype.getTransform = function(b2, flipY) {
7736
7736
  var t = new Transform();
7737
7737
  t.mx = b2.width() / this.width() || 1; // TODO: better handling of 0 w,h
7738
7738
  t.bx = b2.xmin - t.mx * this.xmin;
@@ -7746,14 +7746,14 @@
7746
7746
  return t;
7747
7747
  };
7748
7748
 
7749
- Bounds$1.prototype.mergeCircle = function(x, y, r) {
7749
+ Bounds.prototype.mergeCircle = function(x, y, r) {
7750
7750
  if (r < 0) r = -r;
7751
7751
  this.mergeBounds([x - r, y - r, x + r, y + r]);
7752
7752
  };
7753
7753
 
7754
- Bounds$1.prototype.mergeBounds = function(bb) {
7754
+ Bounds.prototype.mergeBounds = function(bb) {
7755
7755
  var a, b, c, d;
7756
- if (bb instanceof Bounds$1) {
7756
+ if (bb instanceof Bounds) {
7757
7757
  a = bb.xmin;
7758
7758
  b = bb.ymin;
7759
7759
  c = bb.xmax;
@@ -7770,7 +7770,7 @@
7770
7770
  c = bb[2];
7771
7771
  d = bb[3];
7772
7772
  } else {
7773
- error$1("Bounds#mergeBounds() invalid argument:", bb);
7773
+ error("Bounds#mergeBounds() invalid argument:", bb);
7774
7774
  }
7775
7775
 
7776
7776
  if (this.xmin === void 0) {
@@ -7885,8 +7885,8 @@
7885
7885
  return count;
7886
7886
  }
7887
7887
 
7888
- function getPathBounds(points) {
7889
- var bounds = new Bounds$1();
7888
+ function getPathBounds$1(points) {
7889
+ var bounds = new Bounds();
7890
7890
  for (var i=0, n=points.length; i<n; i++) {
7891
7891
  bounds.mergePoint(points[i][0], points[i][1]);
7892
7892
  }
@@ -7902,7 +7902,7 @@
7902
7902
  // @spherical (optional bool) calculate great circle length in meters
7903
7903
  return function(path, arcs, spherical) {
7904
7904
  if (spherical && arcs.isPlanar()) {
7905
- error$1("Expected lat-long coordinates");
7905
+ error("Expected lat-long coordinates");
7906
7906
  }
7907
7907
  calcLen = spherical ? greatCircleDistance : distance2D;
7908
7908
  len = 0;
@@ -7922,7 +7922,7 @@
7922
7922
  getAvgPathXY: getAvgPathXY,
7923
7923
  getMaxPath: getMaxPath,
7924
7924
  countVerticesInPath: countVerticesInPath,
7925
- getPathBounds: getPathBounds,
7925
+ getPathBounds: getPathBounds$1,
7926
7926
  get calcPathLen () { return calcPathLen; }
7927
7927
  });
7928
7928
 
@@ -8035,7 +8035,7 @@
8035
8035
  var flags = new Uint8Array(n);
8036
8036
  forEachArcId(shapes, function(id) {
8037
8037
  var absId = absArcId(id);
8038
- if (absId < n === false) error$1('index error');
8038
+ if (absId < n === false) error('index error');
8039
8039
  flags[absId] |= id < 0 ? 2 : 1;
8040
8040
  });
8041
8041
  return function(arcId) {
@@ -8067,8 +8067,8 @@
8067
8067
  });
8068
8068
  }
8069
8069
 
8070
- function getPathBounds$1(shapes, arcs) {
8071
- var bounds = new Bounds$1();
8070
+ function getPathBounds(shapes, arcs) {
8071
+ var bounds = new Bounds();
8072
8072
  forEachArcId(shapes, function(id) {
8073
8073
  arcs.mergeArcBounds(id, bounds);
8074
8074
  });
@@ -8136,13 +8136,13 @@
8136
8136
  item = arr[i];
8137
8137
  if (item instanceof Array) {
8138
8138
  forEachArcId(item, cb);
8139
- } else if (utils$1.isInteger(item)) {
8139
+ } else if (utils.isInteger(item)) {
8140
8140
  var val = cb(item);
8141
8141
  if (val !== void 0) {
8142
8142
  arr[i] = val;
8143
8143
  }
8144
8144
  } else if (item) {
8145
- error$1("Non-integer arc id in:", arr);
8145
+ error("Non-integer arc id in:", arr);
8146
8146
  }
8147
8147
  }
8148
8148
  }
@@ -8229,7 +8229,7 @@
8229
8229
  ids = shape[i];
8230
8230
  data.push({
8231
8231
  ids: ids,
8232
- area: type == 'polygon' ? geom$1.getPlanarPathArea(ids, arcs) : 0,
8232
+ area: type == 'polygon' ? geom.getPlanarPathArea(ids, arcs) : 0,
8233
8233
  bounds: arcs.getSimpleShapeBounds(ids)
8234
8234
  });
8235
8235
  }
@@ -8243,7 +8243,7 @@
8243
8243
  // removed on export.
8244
8244
  //
8245
8245
  var bb1 = arcs.getBounds(),
8246
- bb2 = new Bounds$1(0, 0, quanta-1, quanta-1),
8246
+ bb2 = new Bounds(0, 0, quanta-1, quanta-1),
8247
8247
  fw = bb1.getTransform(bb2),
8248
8248
  inv = fw.invert();
8249
8249
 
@@ -8287,7 +8287,7 @@
8287
8287
 
8288
8288
  function getSphericalShapeArea(shp, arcs) {
8289
8289
  if (arcs.isPlanar()) {
8290
- error$1("[getSphericalShapeArea()] Function requires decimal degree coordinates");
8290
+ error("[getSphericalShapeArea()] Function requires decimal degree coordinates");
8291
8291
  }
8292
8292
  return (shp || []).reduce(function(area, ids) {
8293
8293
  return area + getSphericalPathArea(ids, arcs);
@@ -8488,7 +8488,7 @@
8488
8488
 
8489
8489
  function getSphericalShapePerimeter(shp, arcs) {
8490
8490
  if (arcs.isPlanar()) {
8491
- error$1("[getSphericalShapePerimeter()] Function requires decimal degree coordinates");
8491
+ error("[getSphericalShapePerimeter()] Function requires decimal degree coordinates");
8492
8492
  }
8493
8493
  return (shp || []).reduce(function(len, ids) {
8494
8494
  return len + getSphericalPathPerimeter(ids, arcs);
@@ -8547,11 +8547,11 @@
8547
8547
 
8548
8548
  if (threshold > 0) {
8549
8549
  snapDist = threshold;
8550
- message$1(utils$1.format("Applying snapping threshold of %s -- %.6f times avg. segment length", threshold, threshold / avgDist));
8550
+ message(utils.format("Applying snapping threshold of %s -- %.6f times avg. segment length", threshold, threshold / avgDist));
8551
8551
  }
8552
8552
  var snapCount = snapCoordsByInterval(arcs, snapDist);
8553
8553
  if (snapCount > 0) arcs.dedupCoords();
8554
- message$1(utils$1.format("Snapped %s point%s", snapCount, utils$1.pluralSuffix(snapCount)));
8554
+ message(utils.format("Snapped %s point%s", snapCount, utils.pluralSuffix(snapCount)));
8555
8555
  }
8556
8556
 
8557
8557
  // Snap together points within a small threshold
@@ -8928,7 +8928,7 @@
8928
8928
  segmentHit: segmentHit
8929
8929
  });
8930
8930
 
8931
- var geom$1 = Object.assign({}, Geom, PolygonGeom, PathGeom, SegmentGeom, PolygonCentroid);
8931
+ var geom = Object.assign({}, Geom, PolygonGeom, PathGeom, SegmentGeom, PolygonCentroid);
8932
8932
 
8933
8933
  // Find ids of vertices with identical coordinates to x,y in an ArcCollection
8934
8934
  // Caveat: does not exclude vertices that are not visible at the
@@ -8975,7 +8975,7 @@
8975
8975
  }
8976
8976
 
8977
8977
  function findNearestVertex(x, y, shp, arcs, spherical) {
8978
- var calcLen = spherical ? geom$1.greatCircleDistance : geom$1.distance2D,
8978
+ var calcLen = spherical ? geom.greatCircleDistance : geom.distance2D,
8979
8979
  minLen = Infinity,
8980
8980
  minX, minY, dist, iter;
8981
8981
  for (var i=0; i<shp.length; i++) {
@@ -9240,7 +9240,7 @@
9240
9240
  var textNode;
9241
9241
  if (!dragging) return;
9242
9242
  if (e.id != activeId) {
9243
- error("Mismatched hit ids:", e.id, activeId);
9243
+ error$1("Mismatched hit ids:", e.id, activeId);
9244
9244
  }
9245
9245
  applyDelta(activeRecord, 'dx', e.dx / scale);
9246
9246
  applyDelta(activeRecord, 'dy', e.dy / scale);
@@ -9489,15 +9489,15 @@
9489
9489
  }
9490
9490
 
9491
9491
  function getDefaultStyle(lyr, baseStyle) {
9492
- var style = utils.extend({}, baseStyle);
9492
+ var style = utils$1.extend({}, baseStyle);
9493
9493
  // reduce the dot size of large point layers
9494
9494
  if (lyr.geometry_type == 'point' && style.dotSize > 0) {
9495
- style.dotSize *= getDotScale(lyr);
9495
+ style.dotSize *= getDotScale$1(lyr);
9496
9496
  }
9497
9497
  return style;
9498
9498
  }
9499
9499
 
9500
- function getDotScale(lyr) {
9500
+ function getDotScale$1(lyr) {
9501
9501
  var topTier = 50000;
9502
9502
  var n = countPoints(lyr.shapes, topTier + 2); // short-circuit point counting above top threshold
9503
9503
  var k = n < 200 && 4 || n < 2500 && 3 || n < 10000 && 2 || 1;
@@ -9555,7 +9555,7 @@
9555
9555
  var topId = o.id; // pinned id (if pinned) or hover id
9556
9556
  var topIdx = -1;
9557
9557
  var styler = function(o, i) {
9558
- utils.extend(o, i === topIdx ? topStyle: baseStyle);
9558
+ utils$1.extend(o, i === topIdx ? topStyle: baseStyle);
9559
9559
  };
9560
9560
  var baseStyle = getDefaultStyle(lyr, selectionStyles[geomType]);
9561
9561
  var topStyle;
@@ -9668,7 +9668,7 @@
9668
9668
  if (lyr.geometry_type == 'point') {
9669
9669
  return fields.indexOf('r') > -1; // require 'r' field for point symbols
9670
9670
  }
9671
- return utils.difference(fields, ['opacity', 'class']).length > 0;
9671
+ return utils$1.difference(fields, ['opacity', 'class']).length > 0;
9672
9672
  }
9673
9673
 
9674
9674
 
@@ -9748,7 +9748,7 @@
9748
9748
  // Get params for converting geographic coords to pixel coords
9749
9749
  this.getTransform = function(pixScale) {
9750
9750
  // get transform (y-flipped);
9751
- var viewBounds = new Bounds(0, 0, _position.width(), _position.height());
9751
+ var viewBounds = new Bounds$1(0, 0, _position.width(), _position.height());
9752
9752
  if (pixScale) {
9753
9753
  viewBounds.xmax *= pixScale;
9754
9754
  viewBounds.ymax *= pixScale;
@@ -9758,7 +9758,7 @@
9758
9758
 
9759
9759
  // k scales the size of the bbox (used by gui to control fp error when zoomed very far)
9760
9760
  this.getBounds = function(k) {
9761
- if (!_contentBounds) return new Bounds();
9761
+ if (!_contentBounds) return new Bounds$1();
9762
9762
  return calcBounds(_cx, _cy, _scale / (k || 1));
9763
9763
  };
9764
9764
 
@@ -9789,7 +9789,7 @@
9789
9789
 
9790
9790
  this.getSymbolScale = function() {
9791
9791
  if (!_frame) return 0;
9792
- var bounds = new Bounds(_frame.bbox);
9792
+ var bounds = new Bounds$1(_frame.bbox);
9793
9793
  var bounds2 = bounds.clone().transform(this.getTransform());
9794
9794
  return bounds2.width() / _frame.width;
9795
9795
  };
@@ -9824,7 +9824,7 @@
9824
9824
  }
9825
9825
 
9826
9826
  function maxAbs() {
9827
- return Math.max.apply(null, utils.toArray(arguments).map(Math.abs));
9827
+ return Math.max.apply(null, utils$1.toArray(arguments).map(Math.abs));
9828
9828
  }
9829
9829
 
9830
9830
  function limitScale(scale) {
@@ -9840,12 +9840,12 @@
9840
9840
  }
9841
9841
  w = bounds.width() / scale;
9842
9842
  h = bounds.height() / scale;
9843
- return new Bounds(cx - w/2, cy - h/2, cx + w/2, cy + h/2);
9843
+ return new Bounds$1(cx - w/2, cy - h/2, cx + w/2, cy + h/2);
9844
9844
  }
9845
9845
 
9846
9846
  // Calculate viewport bounds from frame data
9847
9847
  function fillOutFrameBounds(frame) {
9848
- var bounds = new Bounds(frame.bbox);
9848
+ var bounds = new Bounds$1(frame.bbox);
9849
9849
  var kx = _position.width() / frame.width;
9850
9850
  var ky = _position.height() / frame.height;
9851
9851
  bounds.scale(kx, ky);
@@ -9857,7 +9857,7 @@
9857
9857
  hpix = _position.height() - 2 * margin,
9858
9858
  xpad, ypad, b2;
9859
9859
  if (wpix <= 0 || hpix <= 0) {
9860
- return new Bounds(0, 0, 0, 0);
9860
+ return new Bounds$1(0, 0, 0, 0);
9861
9861
  }
9862
9862
  b = b.clone();
9863
9863
  b2 = b.clone();
@@ -9878,7 +9878,7 @@
9878
9878
  }
9879
9879
  }
9880
9880
 
9881
- utils.inherit(MapExtent, EventDispatcher);
9881
+ utils$1.inherit(MapExtent, EventDispatcher);
9882
9882
 
9883
9883
  var MIN_ARC_LEN = 0.1;
9884
9884
  var MIN_PATH_LEN = 0.1;
@@ -9965,7 +9965,7 @@
9965
9965
  // Return a function for testing if a shape should be drawn in the current view
9966
9966
  function getShapeFilter(arcs, ext) {
9967
9967
  var viewBounds = ext.getBounds();
9968
- var bounds = new Bounds();
9968
+ var bounds = new Bounds$1();
9969
9969
  if (ext.scale() < 1.1) return null; // full or almost-full zoom: no filter
9970
9970
  return function(shape) {
9971
9971
  bounds.empty();
@@ -10041,7 +10041,7 @@
10041
10041
  key = getStyleKey(style);
10042
10042
  if (key in styleIndex === false) {
10043
10043
  styleIndex[key] = {
10044
- style: utils.defaults({}, style),
10044
+ style: utils$1.defaults({}, style),
10045
10045
  shapes: []
10046
10046
  };
10047
10047
  }
@@ -10068,7 +10068,7 @@
10068
10068
 
10069
10069
  _self.drawSquareDots = function(shapes, style) {
10070
10070
  var t = getScaledTransform(_ext),
10071
- scaleRatio = getDotScale$1(_ext),
10071
+ scaleRatio = getDotScale(_ext),
10072
10072
  size = Math.round((style.dotSize || 1) * scaleRatio),
10073
10073
  styler = style.styler || null,
10074
10074
  xmax = _canvas.width + size,
@@ -10232,7 +10232,7 @@
10232
10232
  }
10233
10233
 
10234
10234
 
10235
- function getDotScale$1(ext) {
10235
+ function getDotScale(ext) {
10236
10236
  var smallSide = Math.min(ext.width(), ext.height());
10237
10237
  // reduce size on smaller screens
10238
10238
  var j = smallSide < 200 && 0.5 || smallSide < 400 && 0.75 || 1;
@@ -10289,7 +10289,7 @@
10289
10289
  by = t.by;
10290
10290
  var x, y, xp, yp;
10291
10291
  if (!vec.hasNext()) return;
10292
- minLen = utils.isNonNegNumber(minLen) ? minLen : 0.4;
10292
+ minLen = utils$1.isNonNegNumber(minLen) ? minLen : 0.4;
10293
10293
  x = xp = vec.x * mx + bx;
10294
10294
  y = yp = vec.y * my + by;
10295
10295
  ctx.moveTo(x, y);
@@ -10478,7 +10478,7 @@
10478
10478
  var frame = ext.getFrame(); // frame should be set if we're rendering a furniture layer
10479
10479
  var obj = internal.getEmptyLayerForSVG(lyr, {});
10480
10480
  if (!frame) {
10481
- stop('Missing map frame data');
10481
+ stop$1('Missing map frame data');
10482
10482
  }
10483
10483
  obj.properties.transform = getSvgFurnitureTransform(ext);
10484
10484
  obj.properties.class = 'mapshaper-svg-furniture';
@@ -10506,7 +10506,7 @@
10506
10506
  var html = '';
10507
10507
  // generate a unique id so layer can be identified when symbols are repositioned
10508
10508
  // use it as a class name to avoid id collisions
10509
- var id = utils.getUniqueName();
10509
+ var id = utils$1.getUniqueName();
10510
10510
  var classNames = [id, 'mapshaper-svg-layer', 'mapshaper-' + type + '-layer'];
10511
10511
  g.setAttribute('class', classNames.join(' '));
10512
10512
  target.svg_id = id;
@@ -10957,7 +10957,7 @@
10957
10957
  }
10958
10958
 
10959
10959
  if (obj.tabular) {
10960
- utils.extend(obj, getDisplayLayerForTable(layer.data));
10960
+ utils$1.extend(obj, getDisplayLayerForTable(layer.data));
10961
10961
  }
10962
10962
 
10963
10963
  // dynamic reprojection (arcs were already reprojected above)
@@ -10980,7 +10980,7 @@
10980
10980
 
10981
10981
 
10982
10982
  function getDisplayBounds(lyr, arcs) {
10983
- var arcBounds = arcs ? arcs.getBounds() : new Bounds(),
10983
+ var arcBounds = arcs ? arcs.getBounds() : new Bounds$1(),
10984
10984
  bounds = arcBounds, // default display extent: all arcs in the dataset
10985
10985
  lyrBounds;
10986
10986
 
@@ -10998,7 +10998,7 @@
10998
10998
  }
10999
10999
 
11000
11000
  if (!bounds || !bounds.hasBounds()) { // empty layer
11001
- bounds = new Bounds();
11001
+ bounds = new Bounds$1();
11002
11002
  }
11003
11003
  return bounds;
11004
11004
  }
@@ -11015,7 +11015,7 @@
11015
11015
  return ids;
11016
11016
  }
11017
11017
 
11018
- utils.inherit(MshpMap, EventDispatcher);
11018
+ utils$1.inherit(MshpMap, EventDispatcher);
11019
11019
 
11020
11020
  function MshpMap(gui) {
11021
11021
  var opts = gui.options,
@@ -11105,7 +11105,7 @@
11105
11105
  this.setDisplayCRS = function(crs) {
11106
11106
  // TODO: update bounds of frame layer, if there is a frame layer
11107
11107
  var oldCRS = this.getDisplayCRS();
11108
- var newCRS = utils.isString(crs) ? internal.getCRS(crs) : crs;
11108
+ var newCRS = utils$1.isString(crs) ? internal.getCRS(crs) : crs;
11109
11109
  // TODO: handle case that old and new CRS are the same
11110
11110
  _dynamicCRS = newCRS;
11111
11111
  if (!_activeLyr) return; // stop here if no layers have been selected
@@ -11237,7 +11237,7 @@
11237
11237
  function updateOverlayLayer(e) {
11238
11238
  var style = getOverlayStyle(_activeLyr.layer, e);
11239
11239
  if (style) {
11240
- _overlayLyr = utils.defaults({
11240
+ _overlayLyr = utils$1.defaults({
11241
11241
  layer: filterLayerByIds(_activeLyr.layer, style.ids),
11242
11242
  style: style
11243
11243
  }, _activeLyr);
@@ -11273,12 +11273,12 @@
11273
11273
  var cy = viewBounds.centerY();
11274
11274
  rec.bbox = [cx - w/2, cy - h/2, cx + w/2, cy + h/2];
11275
11275
  _ext.setFrame(getFrameData());
11276
- _ext.setBounds(new Bounds(rec.bbox));
11276
+ _ext.setBounds(new Bounds$1(rec.bbox));
11277
11277
  _ext.reset();
11278
11278
  }
11279
11279
 
11280
11280
  function getFullBounds() {
11281
- var b = new Bounds();
11281
+ var b = new Bounds$1();
11282
11282
  var marginPct = 0.025;
11283
11283
  var pad = 1e-4;
11284
11284
  if (isPreviewView()) {
@@ -11402,7 +11402,7 @@
11402
11402
  // kludge to hide ghosted layers when reference layers are present
11403
11403
  // TODO: consider never showing ghosted layers (which appear after
11404
11404
  // commands like dissolve and filter).
11405
- mapLayer.style = utils.defaults({
11405
+ mapLayer.style = utils$1.defaults({
11406
11406
  strokeColors: [null, mapLayer.style.strokeColors[1]]
11407
11407
  }, mapLayer.style);
11408
11408
  }
@@ -11458,7 +11458,7 @@
11458
11458
 
11459
11459
  function GuiInstance(container, opts) {
11460
11460
  var gui = new ModeSwitcher();
11461
- opts = utils.extend({
11461
+ opts = utils$1.extend({
11462
11462
  // defaults
11463
11463
  homeControl: true,
11464
11464
  zoomControl: true,
@@ -11606,4 +11606,4 @@
11606
11606
  });
11607
11607
  };
11608
11608
 
11609
- }());
11609
+ })();