@dra2020/baseclient 1.0.14 → 1.0.17

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.
Files changed (97) hide show
  1. package/README.md +5 -16
  2. package/dist/all/all.d.ts +2 -18
  3. package/dist/baseclient.js +1309 -173
  4. package/dist/baseclient.js.map +1 -1
  5. package/dist/filterexpr/filterexpr.d.ts +3 -0
  6. package/dist/fsm/fsm.d.ts +1 -0
  7. package/dist/geo/all.d.ts +2 -0
  8. package/dist/geo/geo.d.ts +67 -0
  9. package/dist/geo/vfeature.d.ts +4 -0
  10. package/dist/ot-js/otsession.d.ts +3 -0
  11. package/dist/poly/union.d.ts +1 -0
  12. package/docs/filterexpr.md +22 -0
  13. package/lib/all/all.ts +2 -22
  14. package/lib/filterexpr/filterexpr.ts +79 -5
  15. package/lib/fsm/fsm.ts +12 -2
  16. package/lib/geo/all.ts +2 -0
  17. package/lib/geo/geo.ts +452 -0
  18. package/lib/geo/vfeature.ts +34 -0
  19. package/lib/ot-js/otsession.ts +4 -1
  20. package/lib/poly/hash.ts +1 -1
  21. package/lib/poly/polybin.ts +5 -4
  22. package/lib/poly/polypack.ts +16 -4
  23. package/lib/poly/topo.ts +26 -41
  24. package/lib/poly/union.ts +17 -0
  25. package/package.json +9 -10
  26. package/dist/all/allclient.d.ts +0 -18
  27. package/dist/base.js +0 -33010
  28. package/dist/base.js.map +0 -1
  29. package/dist/dbabstract/all.d.ts +0 -1
  30. package/dist/dbabstract/db.d.ts +0 -83
  31. package/dist/dbdynamo/all.d.ts +0 -1
  32. package/dist/dbdynamo/dbdynamo.d.ts +0 -190
  33. package/dist/fsmfile/all.d.ts +0 -1
  34. package/dist/fsmfile/fsmfile.d.ts +0 -47
  35. package/dist/jsonstream/all.d.ts +0 -1
  36. package/dist/jsonstream/jsonstream.d.ts +0 -130
  37. package/dist/lambda/all.d.ts +0 -1
  38. package/dist/lambda/env.d.ts +0 -10
  39. package/dist/lambda/lambda.d.ts +0 -18
  40. package/dist/logserver/all.d.ts +0 -5
  41. package/dist/logserver/log.d.ts +0 -11
  42. package/dist/logserver/logaccum.d.ts +0 -154
  43. package/dist/logserver/logblob.d.ts +0 -24
  44. package/dist/logserver/logconcat.d.ts +0 -55
  45. package/dist/logserver/logkey.d.ts +0 -28
  46. package/dist/memsqs/all.d.ts +0 -4
  47. package/dist/memsqs/client.d.ts +0 -13
  48. package/dist/memsqs/loopback.d.ts +0 -11
  49. package/dist/memsqs/orderedlist.d.ts +0 -19
  50. package/dist/memsqs/queue.d.ts +0 -84
  51. package/dist/memsqs/server.d.ts +0 -37
  52. package/dist/storage/all.d.ts +0 -4
  53. package/dist/storage/datablob.d.ts +0 -9
  54. package/dist/storage/env.d.ts +0 -10
  55. package/dist/storage/splitsblob.d.ts +0 -13
  56. package/dist/storage/storage.d.ts +0 -166
  57. package/dist/storages3/all.d.ts +0 -1
  58. package/dist/storages3/s3.d.ts +0 -62
  59. package/docs/dbabstract.md +0 -2
  60. package/docs/dbdynamo.md +0 -2
  61. package/docs/fsmfile.md +0 -2
  62. package/docs/jsonstream.md +0 -44
  63. package/docs/lambda.md +0 -2
  64. package/docs/logserver.md +0 -2
  65. package/docs/storage.md +0 -2
  66. package/docs/storages3.md +0 -2
  67. package/lib/all/allclient.ts +0 -19
  68. package/lib/dbabstract/all.ts +0 -1
  69. package/lib/dbabstract/db.ts +0 -246
  70. package/lib/dbdynamo/all.ts +0 -1
  71. package/lib/dbdynamo/dbdynamo.ts +0 -1551
  72. package/lib/fsmfile/all.ts +0 -1
  73. package/lib/fsmfile/fsmfile.ts +0 -236
  74. package/lib/jsonstream/all.ts +0 -1
  75. package/lib/jsonstream/jsonstream.ts +0 -940
  76. package/lib/lambda/all.ts +0 -1
  77. package/lib/lambda/env.ts +0 -13
  78. package/lib/lambda/lambda.ts +0 -120
  79. package/lib/logserver/all.ts +0 -5
  80. package/lib/logserver/log.ts +0 -565
  81. package/lib/logserver/logaccum.ts +0 -1445
  82. package/lib/logserver/logblob.ts +0 -84
  83. package/lib/logserver/logconcat.ts +0 -313
  84. package/lib/logserver/logkey.ts +0 -125
  85. package/lib/memsqs/all.ts +0 -4
  86. package/lib/memsqs/client.ts +0 -268
  87. package/lib/memsqs/loopback.ts +0 -64
  88. package/lib/memsqs/orderedlist.ts +0 -74
  89. package/lib/memsqs/queue.ts +0 -395
  90. package/lib/memsqs/server.ts +0 -262
  91. package/lib/storage/all.ts +0 -4
  92. package/lib/storage/datablob.ts +0 -36
  93. package/lib/storage/env.ts +0 -14
  94. package/lib/storage/splitsblob.ts +0 -63
  95. package/lib/storage/storage.ts +0 -604
  96. package/lib/storages3/all.ts +0 -1
  97. package/lib/storages3/s3.ts +0 -576
@@ -4,42 +4,63 @@
4
4
  else if(typeof define === 'function' && define.amd)
5
5
  define([], factory);
6
6
  else if(typeof exports === 'object')
7
- exports["base"] = factory();
7
+ exports["baseclient"] = factory();
8
8
  else
9
- root["base"] = factory();
9
+ root["baseclient"] = factory();
10
10
  })(global, function() {
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ "use strict";
13
13
  /******/ var __webpack_modules__ = ({
14
14
 
15
- /***/ "./lib/all/allclient.ts":
16
- /*!******************************!*\
17
- !*** ./lib/all/allclient.ts ***!
18
- \******************************/
19
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15
+ /***/ "./lib/all/all.ts":
16
+ /*!************************!*\
17
+ !*** ./lib/all/all.ts ***!
18
+ \************************/
19
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
20
20
 
21
21
 
22
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
25
+ }) : (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ o[k2] = m[k];
28
+ }));
29
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
30
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
31
+ }) : function(o, v) {
32
+ o["default"] = v;
33
+ });
34
+ var __importStar = (this && this.__importStar) || function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
22
41
  Object.defineProperty(exports, "__esModule", ({ value: true }));
23
- exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
42
+ exports.G = exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
24
43
  // Client and Server
25
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
44
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
26
45
  exports.Util = Util;
27
- const Context = __webpack_require__(/*! ../context/all */ "./lib/context/all.ts");
46
+ const Context = __importStar(__webpack_require__(/*! ../context/all */ "./lib/context/all.ts"));
28
47
  exports.Context = Context;
29
- const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
48
+ const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
30
49
  exports.FSM = FSM;
31
- const Poly = __webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts");
50
+ const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
32
51
  exports.Poly = Poly;
33
- const LogAbstract = __webpack_require__(/*! ../logabstract/all */ "./lib/logabstract/all.ts");
52
+ const LogAbstract = __importStar(__webpack_require__(/*! ../logabstract/all */ "./lib/logabstract/all.ts"));
34
53
  exports.LogAbstract = LogAbstract;
35
- const LogClient = __webpack_require__(/*! ../logclient/all */ "./lib/logclient/all.ts");
54
+ const LogClient = __importStar(__webpack_require__(/*! ../logclient/all */ "./lib/logclient/all.ts"));
36
55
  exports.LogClient = LogClient;
37
- const OT = __webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts");
56
+ const OT = __importStar(__webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts"));
38
57
  exports.OT = OT;
39
- const OTE = __webpack_require__(/*! ../ot-editutil/all */ "./lib/ot-editutil/all.ts");
58
+ const OTE = __importStar(__webpack_require__(/*! ../ot-editutil/all */ "./lib/ot-editutil/all.ts"));
40
59
  exports.OTE = OTE;
41
60
  const all_1 = __webpack_require__(/*! ../filterexpr/all */ "./lib/filterexpr/all.ts");
42
61
  Object.defineProperty(exports, "FilterExpr", ({ enumerable: true, get: function () { return all_1.FilterExpr; } }));
62
+ const G = __importStar(__webpack_require__(/*! ../geo/all */ "./lib/geo/all.ts"));
63
+ exports.G = G;
43
64
 
44
65
 
45
66
  /***/ }),
@@ -71,12 +92,31 @@ __exportStar(__webpack_require__(/*! ./context */ "./lib/context/context.ts"), e
71
92
  /*!********************************!*\
72
93
  !*** ./lib/context/context.ts ***!
73
94
  \********************************/
74
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
95
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
75
96
 
76
97
 
98
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
99
+ if (k2 === undefined) k2 = k;
100
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
101
+ }) : (function(o, m, k, k2) {
102
+ if (k2 === undefined) k2 = k;
103
+ o[k2] = m[k];
104
+ }));
105
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
106
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
107
+ }) : function(o, v) {
108
+ o["default"] = v;
109
+ });
110
+ var __importStar = (this && this.__importStar) || function (mod) {
111
+ if (mod && mod.__esModule) return mod;
112
+ var result = {};
113
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
114
+ __setModuleDefault(result, mod);
115
+ return result;
116
+ };
77
117
  Object.defineProperty(exports, "__esModule", ({ value: true }));
78
118
  exports.create = void 0;
79
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
119
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
80
120
  class Context {
81
121
  constructor() {
82
122
  this.values = {};
@@ -156,12 +196,31 @@ __exportStar(__webpack_require__(/*! ./filterexpr */ "./lib/filterexpr/filterexp
156
196
  /*!**************************************!*\
157
197
  !*** ./lib/filterexpr/filterexpr.ts ***!
158
198
  \**************************************/
159
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
199
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
160
200
 
161
201
 
202
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
203
+ if (k2 === undefined) k2 = k;
204
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
205
+ }) : (function(o, m, k, k2) {
206
+ if (k2 === undefined) k2 = k;
207
+ o[k2] = m[k];
208
+ }));
209
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
210
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
211
+ }) : function(o, v) {
212
+ o["default"] = v;
213
+ });
214
+ var __importStar = (this && this.__importStar) || function (mod) {
215
+ if (mod && mod.__esModule) return mod;
216
+ var result = {};
217
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
218
+ __setModuleDefault(result, mod);
219
+ return result;
220
+ };
162
221
  Object.defineProperty(exports, "__esModule", ({ value: true }));
163
222
  exports.FilterExpr = void 0;
164
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
223
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
165
224
  const Space = 32;
166
225
  const Tab = 9;
167
226
  const Newline = 10;
@@ -538,6 +597,40 @@ function wordyDate(s) {
538
597
  // But this is close enough to match what gets displayed by "prettyDate" while also letting selection by month year
539
598
  return s;
540
599
  }
600
+ function clauseEqual(c1, c2) {
601
+ if (c1 == null && c2 == null)
602
+ return true;
603
+ if (c1 == null || c2 == null)
604
+ return false;
605
+ if (c1.op.tt === c2.op.tt) {
606
+ if (c1.op.tt === TokType.Text)
607
+ return c1.op.text === c2.op.text;
608
+ else
609
+ return clauseEqual(c1.operand1, c2.operand1) && clauseEqual(c1.operand2, c2.operand2);
610
+ }
611
+ else
612
+ return false;
613
+ }
614
+ function containsClause(c, s) {
615
+ if (clauseEqual(c, s))
616
+ return true;
617
+ if (c == null || s == null)
618
+ return false;
619
+ return containsClause(c.operand1, s) || containsClause(c.operand2, s);
620
+ }
621
+ function removeClause(c, s) {
622
+ if (c == null || (c.op.tt === TokType.Text && c.op.tt !== s.op.tt))
623
+ return c;
624
+ else if (clauseEqual(c, s))
625
+ return null;
626
+ else {
627
+ c.operand1 = removeClause(c.operand1, s);
628
+ c.operand2 = removeClause(c.operand2, s);
629
+ if ((c.op.tt === TokType.And || c.op.tt === TokType.Or) && (c.operand1 == null || c.operand2 == null))
630
+ return c.operand1 || c.operand2;
631
+ return c;
632
+ }
633
+ }
541
634
  class FilterExpr {
542
635
  constructor(coder, expr) {
543
636
  this.lexer = new Lexer(coder);
@@ -555,13 +648,38 @@ class FilterExpr {
555
648
  asString() {
556
649
  return this.asStringClause(this.parser.clause);
557
650
  }
651
+ containsClause(expr) {
652
+ let sub = new FilterExpr(this.lexer.coder, expr);
653
+ return containsClause(this.parser.clause, sub.parser.clause);
654
+ }
655
+ addClause(expr) {
656
+ let sub = new FilterExpr(this.lexer.coder, expr);
657
+ if (!containsClause(this.parser.clause, sub.parser.clause)) {
658
+ if (this.parser.clause)
659
+ this.parser.clauses = [{ op: { tt: TokType.And }, operand1: this.parser.clause, operand2: sub.parser.clause }];
660
+ else
661
+ this.parser.clauses = [sub.parser.clause];
662
+ }
663
+ }
664
+ removeClause(expr) {
665
+ if (this.containsClause(expr)) {
666
+ let sub = new FilterExpr(this.lexer.coder, expr);
667
+ this.parser.clauses = [removeClause(this.parser.clause, sub.parser.clause)];
668
+ }
669
+ }
558
670
  asStringClause(clause) {
559
671
  if (clause == null)
560
672
  return '';
561
- if (clause.op.tt == TokType.Text)
562
- return `'${clause.op.text}'`;
673
+ if (clause.op.tt == TokType.Text) {
674
+ this.lexer.set(clause.op.text);
675
+ if (this.lexer.tokens.length == 1 && this.lexer.tokens[0].tt === TokType.Text)
676
+ return clause.op.text;
677
+ else
678
+ return `'${clause.op.text}'`;
679
+ }
563
680
  let a = [];
564
- a.push('(');
681
+ if (clause !== this.parser.clause)
682
+ a.push('(');
565
683
  switch (clause.op.tt) {
566
684
  case TokType.And:
567
685
  a.push(this.asStringClause(clause.operand1));
@@ -578,8 +696,7 @@ class FilterExpr {
578
696
  a.push(this.asStringClause(clause.operand1));
579
697
  break;
580
698
  case TokType.Colon:
581
- a.push(this.asStringClause(clause.operand1));
582
- a.push(':');
699
+ a.push(`${this.asStringClause(clause.operand1)}:`);
583
700
  a.push(this.asStringClause(clause.operand2));
584
701
  break;
585
702
  case TokType.Equal:
@@ -594,7 +711,8 @@ class FilterExpr {
594
711
  default:
595
712
  throw 'Unexpected token in asString';
596
713
  }
597
- a.push(')');
714
+ if (clause !== this.parser.clause)
715
+ a.push(')');
598
716
  return a.join(' ');
599
717
  }
600
718
  testClause(o, types, clause, prop, relation) {
@@ -686,13 +804,32 @@ __exportStar(__webpack_require__(/*! ./fsm */ "./lib/fsm/fsm.ts"), exports);
686
804
  /*!************************!*\
687
805
  !*** ./lib/fsm/fsm.ts ***!
688
806
  \************************/
689
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
807
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
690
808
 
691
809
 
810
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
811
+ if (k2 === undefined) k2 = k;
812
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
813
+ }) : (function(o, m, k, k2) {
814
+ if (k2 === undefined) k2 = k;
815
+ o[k2] = m[k];
816
+ }));
817
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
818
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
819
+ }) : function(o, v) {
820
+ o["default"] = v;
821
+ });
822
+ var __importStar = (this && this.__importStar) || function (mod) {
823
+ if (mod && mod.__esModule) return mod;
824
+ var result = {};
825
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
826
+ __setModuleDefault(result, mod);
827
+ return result;
828
+ };
692
829
  Object.defineProperty(exports, "__esModule", ({ value: true }));
693
830
  exports.FsmArray = exports.FsmLoop = exports.DefaultLoopOptions = exports.FsmTracker = exports.FsmSerializer = exports.FsmSleep = exports.FsmOnDone = exports.Fsm = exports.FsmManager = exports.FSM_CUSTOM9 = exports.FSM_CUSTOM8 = exports.FSM_CUSTOM7 = exports.FSM_CUSTOM6 = exports.FSM_CUSTOM5 = exports.FSM_CUSTOM4 = exports.FSM_CUSTOM3 = exports.FSM_CUSTOM2 = exports.FSM_CUSTOM1 = exports.FSM_RELEASED = exports.FSM_ERROR = exports.FSM_DONE = exports.FSM_PENDING = exports.FSM_STARTING = void 0;
694
831
  // Shared libraries
695
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
832
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
696
833
  // States
697
834
  exports.FSM_STARTING = 0;
698
835
  exports.FSM_PENDING = 1 << 0;
@@ -916,9 +1053,17 @@ class FsmSleep extends Fsm {
916
1053
  this.delay = delay;
917
1054
  }
918
1055
  tick() {
919
- if (this.ready && this.state === exports.FSM_STARTING) {
1056
+ // This allows canceling by simply setting state to done
1057
+ if (this.done && this.timeoutHandle !== undefined) {
1058
+ clearTimeout(this.timeoutHandle);
1059
+ delete this.timeoutHandle;
1060
+ }
1061
+ else if (this.ready && this.state === exports.FSM_STARTING) {
920
1062
  this.setState(exports.FSM_PENDING);
921
- setTimeout(() => { this.setState(exports.FSM_DONE); }, this.delay);
1063
+ this.timeoutHandle = setTimeout(() => {
1064
+ delete this.timeoutHandle;
1065
+ this.setState(exports.FSM_DONE);
1066
+ }, this.delay);
922
1067
  }
923
1068
  }
924
1069
  }
@@ -1080,6 +1225,486 @@ class FsmArray extends Fsm {
1080
1225
  exports.FsmArray = FsmArray;
1081
1226
 
1082
1227
 
1228
+ /***/ }),
1229
+
1230
+ /***/ "./lib/geo/all.ts":
1231
+ /*!************************!*\
1232
+ !*** ./lib/geo/all.ts ***!
1233
+ \************************/
1234
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1235
+
1236
+
1237
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1238
+ if (k2 === undefined) k2 = k;
1239
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1240
+ }) : (function(o, m, k, k2) {
1241
+ if (k2 === undefined) k2 = k;
1242
+ o[k2] = m[k];
1243
+ }));
1244
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1245
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1246
+ };
1247
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1248
+ __exportStar(__webpack_require__(/*! ./geo */ "./lib/geo/geo.ts"), exports);
1249
+ __exportStar(__webpack_require__(/*! ./vfeature */ "./lib/geo/vfeature.ts"), exports);
1250
+
1251
+
1252
+ /***/ }),
1253
+
1254
+ /***/ "./lib/geo/geo.ts":
1255
+ /*!************************!*\
1256
+ !*** ./lib/geo/geo.ts ***!
1257
+ \************************/
1258
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1259
+
1260
+
1261
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1262
+ if (k2 === undefined) k2 = k;
1263
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1264
+ }) : (function(o, m, k, k2) {
1265
+ if (k2 === undefined) k2 = k;
1266
+ o[k2] = m[k];
1267
+ }));
1268
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1269
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1270
+ }) : function(o, v) {
1271
+ o["default"] = v;
1272
+ });
1273
+ var __importStar = (this && this.__importStar) || function (mod) {
1274
+ if (mod && mod.__esModule) return mod;
1275
+ var result = {};
1276
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1277
+ __setModuleDefault(result, mod);
1278
+ return result;
1279
+ };
1280
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1281
+ exports.geoIntersect = exports.geoIntersectOptions = exports.GeoMultiCollection = exports.geoMapEqual = exports.geoEqual = exports.geoTopoToCollection = exports.geoCollectionToTopo = exports.geoMapToCollection = exports.geoCollectionToMap = void 0;
1282
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
1283
+ const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
1284
+ function geoCollectionToMap(col) {
1285
+ if (col == null)
1286
+ return null;
1287
+ let map = {};
1288
+ col.features.forEach((f) => { map[String(f.properties.id)] = f; });
1289
+ return map;
1290
+ }
1291
+ exports.geoCollectionToMap = geoCollectionToMap;
1292
+ function geoMapToCollection(map) {
1293
+ if (map == null || Util.countKeys(map) == 0)
1294
+ return null;
1295
+ let col = { type: 'FeatureCollection', features: [] };
1296
+ Object.keys(map).forEach((geoid) => { col.features.push(map[geoid]); });
1297
+ return col;
1298
+ }
1299
+ exports.geoMapToCollection = geoMapToCollection;
1300
+ function geoCollectionToTopo(col) {
1301
+ let topo = Poly.topoFromCollection(col);
1302
+ Poly.topoPack(topo);
1303
+ return topo;
1304
+ }
1305
+ exports.geoCollectionToTopo = geoCollectionToTopo;
1306
+ function geoTopoToCollection(topo) {
1307
+ let col = Poly.topoToCollection(topo);
1308
+ Poly.featurePack(col);
1309
+ return col;
1310
+ }
1311
+ exports.geoTopoToCollection = geoTopoToCollection;
1312
+ function geoEqual(m1, m2) {
1313
+ let n1 = m1 ? m1.length : 0;
1314
+ let n2 = m2 ? m2.length : 0;
1315
+ if (n1 != n2)
1316
+ return false;
1317
+ if (n1 == 0)
1318
+ return true;
1319
+ let n = 0;
1320
+ let eq = true;
1321
+ m1.forEach(f => { if (eq && !m2.find(f.properties.id))
1322
+ eq = false; });
1323
+ return eq;
1324
+ }
1325
+ exports.geoEqual = geoEqual;
1326
+ function geoMapEqual(m1, m2) {
1327
+ if (m1 == null)
1328
+ return Util.isEmpty(m2);
1329
+ if (m2 == null)
1330
+ return Util.isEmpty(m1);
1331
+ let p;
1332
+ for (p in m1)
1333
+ if (m1.hasOwnProperty(p))
1334
+ if (m1[p] !== m2[p])
1335
+ return false;
1336
+ for (p in m2)
1337
+ if (m2.hasOwnProperty(p))
1338
+ if (m1[p] === undefined)
1339
+ return false;
1340
+ return true;
1341
+ }
1342
+ exports.geoMapEqual = geoMapEqual;
1343
+ class GeoMultiCollection {
1344
+ constructor(tag, topo, col, map) {
1345
+ this.stamp = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER / 2);
1346
+ this.empty();
1347
+ if (tag)
1348
+ this.add(tag, topo, col, map);
1349
+ }
1350
+ empty() {
1351
+ this.entries = {};
1352
+ this.hidden = {};
1353
+ this._onChange();
1354
+ }
1355
+ get nEntries() { return Util.countKeys(this.entries); }
1356
+ nthEntry(n) {
1357
+ return Util.nthProperty(this.entries, n);
1358
+ }
1359
+ add(tag, topo, col, map) {
1360
+ let entry = this.entries[tag];
1361
+ if (entry === undefined)
1362
+ entry = { tag: tag }, this.entries[tag] = entry;
1363
+ if ((topo && entry.topo !== topo) || (col && entry.col !== col) || (map && entry.map !== map)) {
1364
+ entry.topo = topo;
1365
+ entry.col = col;
1366
+ entry.map = map;
1367
+ this._onChange();
1368
+ }
1369
+ else if (topo == null && col == null && map == null)
1370
+ this.remove(tag);
1371
+ }
1372
+ addMulti(multi) {
1373
+ multi.forEachEntry(e => {
1374
+ this.add(e.tag, e.topo, e.col, e.map);
1375
+ });
1376
+ for (let p in multi.hidden)
1377
+ if (multi.hidden.hasOwnProperty(p)) {
1378
+ this.hidden[p] = true;
1379
+ this._onChange();
1380
+ }
1381
+ }
1382
+ remove(tag) {
1383
+ let entry = this.entries[tag];
1384
+ if (entry) {
1385
+ if (entry.topo || entry.col || entry.map)
1386
+ this._onChange();
1387
+ delete this.entries[tag];
1388
+ }
1389
+ }
1390
+ _onChange() {
1391
+ this.all = { tag: 'all' };
1392
+ this.stamp++;
1393
+ }
1394
+ _col(e) {
1395
+ if (e == null)
1396
+ return null;
1397
+ if (!e.col) {
1398
+ if (e.map)
1399
+ e.col = geoMapToCollection(e.map);
1400
+ else if (e.topo)
1401
+ e.col = geoTopoToCollection(e.topo);
1402
+ }
1403
+ return e.col;
1404
+ }
1405
+ _map(e) {
1406
+ if (e == null)
1407
+ return null;
1408
+ if (!e.map) {
1409
+ if (e.col)
1410
+ e.map = geoCollectionToMap(e.col);
1411
+ else if (e.topo) {
1412
+ e.col = geoTopoToCollection(e.topo);
1413
+ e.map = geoCollectionToMap(e.col);
1414
+ }
1415
+ }
1416
+ return e.map;
1417
+ }
1418
+ _topo(e) {
1419
+ if (e == null)
1420
+ return null;
1421
+ if (!e.topo) {
1422
+ if (e.col)
1423
+ e.topo = geoCollectionToTopo(e.col);
1424
+ else if (e.map) {
1425
+ e.col = geoMapToCollection(e.map);
1426
+ e.topo = geoCollectionToTopo(e.col);
1427
+ }
1428
+ }
1429
+ return e.topo;
1430
+ }
1431
+ colOf(tag) { return this._col(this.entries[tag]); }
1432
+ mapOf(tag) { return this._map(this.entries[tag]); }
1433
+ topoOf(tag) { return this._topo(this.entries[tag]); }
1434
+ forEachEntry(cb) {
1435
+ Object.values(this.entries).forEach(cb);
1436
+ }
1437
+ allCol() {
1438
+ if (this.nEntries == 0)
1439
+ return null;
1440
+ if (!this.all.col) {
1441
+ // optimise case where one entry
1442
+ let n = this.nEntries;
1443
+ if (n == 1)
1444
+ this.all.col = this._col(this.nthEntry(0));
1445
+ else
1446
+ // Going from map to collection guarantees that any duplicates are removed
1447
+ this.all.col = geoMapToCollection(this.allMap());
1448
+ }
1449
+ return this.all.col;
1450
+ }
1451
+ allMap() {
1452
+ if (this.nEntries == 0)
1453
+ return null;
1454
+ if (!this.all.map) {
1455
+ // optimise case where one entry
1456
+ let n = this.nEntries;
1457
+ if (n == 1)
1458
+ this.all.map = this._map(this.nthEntry(0));
1459
+ else {
1460
+ let map = {};
1461
+ this.all.map = map;
1462
+ this.forEach(f => { map[String(f.properties.id)] = f; });
1463
+ }
1464
+ }
1465
+ return this.all.map;
1466
+ }
1467
+ allTopo() {
1468
+ if (this.nEntries == 0)
1469
+ return null;
1470
+ if (!this.all.topo) {
1471
+ // optimise case where one entry
1472
+ let n = this.nEntries;
1473
+ if (n == 1)
1474
+ this.all.topo = this._topo(this.nthEntry(0));
1475
+ else
1476
+ this.all.topo = geoCollectionToTopo(this.allCol());
1477
+ }
1478
+ return this.all.topo;
1479
+ }
1480
+ hide(id) {
1481
+ if (id) {
1482
+ if (typeof id === 'string')
1483
+ this.hidden[id] = true;
1484
+ else if (Array.isArray(id))
1485
+ id.forEach((i) => { this.hidden[i] = true; });
1486
+ else if (typeof id === 'object')
1487
+ for (let p in id)
1488
+ if (id.hasOwnProperty(p))
1489
+ this.hidden[p] = true;
1490
+ this._onChange();
1491
+ }
1492
+ }
1493
+ show(id) {
1494
+ if (id) {
1495
+ if (typeof id === 'string')
1496
+ delete this.hidden[id];
1497
+ else if (Array.isArray(id))
1498
+ id.forEach((i) => { delete this.hidden[i]; });
1499
+ else if (typeof id === 'object')
1500
+ for (let p in id)
1501
+ if (id.hasOwnProperty(p))
1502
+ delete this.hidden[p];
1503
+ this._onChange();
1504
+ }
1505
+ }
1506
+ showAll() {
1507
+ if (!Util.isEmpty(this.hidden)) {
1508
+ this.hidden = {};
1509
+ this._onChange();
1510
+ }
1511
+ }
1512
+ get length() {
1513
+ let n = 0;
1514
+ this.forEachEntry(e => {
1515
+ if (e.col)
1516
+ n += e.col.features.length;
1517
+ else if (e.map)
1518
+ n += Util.countKeys(e.map);
1519
+ else if (e.topo)
1520
+ n += Util.countKeys(e.topo.objects);
1521
+ });
1522
+ return n;
1523
+ }
1524
+ // Use forEach in preference to iteration using this function
1525
+ nthFeature(n) {
1526
+ let found;
1527
+ if (n >= 0)
1528
+ this.forEachEntry(e => {
1529
+ if (found)
1530
+ return;
1531
+ let col = this._col(e);
1532
+ if (col)
1533
+ if (n > col.features.length)
1534
+ n -= col.features.length;
1535
+ else
1536
+ found = col.features[n];
1537
+ });
1538
+ return found;
1539
+ }
1540
+ nthFilteredFeature(n, cb) {
1541
+ let found;
1542
+ this.forEachEntry(e => {
1543
+ if (found)
1544
+ return;
1545
+ let col = this._col(e);
1546
+ if (col)
1547
+ for (let i = 0; !found && i < col.features.length; i++) {
1548
+ let f = col.features[i];
1549
+ if (this.hidden[f.properties.id] === undefined && cb(f)) {
1550
+ if (n === 0) {
1551
+ found = f;
1552
+ break;
1553
+ }
1554
+ n--;
1555
+ }
1556
+ }
1557
+ });
1558
+ return found;
1559
+ }
1560
+ forEach(cb) {
1561
+ this.forEachEntry(e => {
1562
+ let col = this._col(e);
1563
+ if (e.col)
1564
+ e.col.features.forEach(f => { if (this.hidden[f.properties.id] === undefined)
1565
+ cb(f); });
1566
+ });
1567
+ }
1568
+ map(cb) {
1569
+ let features = [];
1570
+ this.forEach((f) => { features.push(cb(f)); });
1571
+ return features;
1572
+ }
1573
+ isHidden(id) {
1574
+ return this.hidden[id] !== undefined;
1575
+ }
1576
+ find(id) {
1577
+ if (this.hidden[id] !== undefined)
1578
+ return undefined;
1579
+ let entries = Object.values(this.entries);
1580
+ for (let i = 0; i < entries.length; i++) {
1581
+ let map = this._map(entries[i]);
1582
+ if (map[id])
1583
+ return map[id];
1584
+ }
1585
+ return undefined;
1586
+ }
1587
+ filter(test) {
1588
+ let m = new GeoMultiCollection();
1589
+ this.forEachEntry(e => {
1590
+ let col = this._col(e);
1591
+ let features = col ? col.features.filter(test) : null;
1592
+ if (features && features.length)
1593
+ m.add(e.tag, null, { type: 'FeatureCollection', features: features }, null);
1594
+ });
1595
+ return m;
1596
+ }
1597
+ }
1598
+ exports.GeoMultiCollection = GeoMultiCollection;
1599
+ var geoIntersectOptions;
1600
+ (function (geoIntersectOptions) {
1601
+ geoIntersectOptions[geoIntersectOptions["Intersects"] = 0] = "Intersects";
1602
+ geoIntersectOptions[geoIntersectOptions["Bounds"] = 1] = "Bounds";
1603
+ geoIntersectOptions[geoIntersectOptions["BoundsCenter"] = 2] = "BoundsCenter";
1604
+ })(geoIntersectOptions = exports.geoIntersectOptions || (exports.geoIntersectOptions = {}));
1605
+ ;
1606
+ function geoBoxIntersect(x1, x2, opt) {
1607
+ if (x1.left === undefined || x2.left === undefined)
1608
+ return false;
1609
+ let l1 = x1.left;
1610
+ let l2 = x2.left;
1611
+ let r1 = x1.right;
1612
+ let r2 = x2.right;
1613
+ let b1 = x1.top; // flip
1614
+ let b2 = x2.top; // flip
1615
+ let t1 = x1.bottom; // flip
1616
+ let t2 = x2.bottom; // flip
1617
+ let cx2 = l2 + (r2 - l2) / 2;
1618
+ let cy2 = t2 + (b2 - t2) / 2;
1619
+ // Note I flipped top and bottom above when extracting,
1620
+ // in order to make below logic work for normal y axis alignment (0 at top).
1621
+ switch (opt) {
1622
+ case geoIntersectOptions.Intersects:
1623
+ return !(l2 > r1 || r2 < l1 || t2 > b1 || b2 < t1);
1624
+ case geoIntersectOptions.Bounds:
1625
+ return l1 <= l2 && t1 <= t2 && r1 >= r2 && b1 >= b2;
1626
+ case geoIntersectOptions.BoundsCenter:
1627
+ return l1 <= cx2 && t1 <= cy2 && r1 >= cx2 && b1 >= cy2;
1628
+ }
1629
+ }
1630
+ function geoIntersect(multi, bbox, opt) {
1631
+ let m = {};
1632
+ let bboxPoly = Poly.boundboxPoly(bbox);
1633
+ multi.forEach((f) => {
1634
+ let box = Poly.boundbox(f);
1635
+ if (geoBoxIntersect(bbox, box, opt)) {
1636
+ if (opt !== geoIntersectOptions.Intersects || Poly.polyIntersects(bboxPoly, f))
1637
+ m[f.properties.id] = f;
1638
+ }
1639
+ });
1640
+ let result = new GeoMultiCollection();
1641
+ result.add('result', null, null, m);
1642
+ return result;
1643
+ }
1644
+ exports.geoIntersect = geoIntersect;
1645
+
1646
+
1647
+ /***/ }),
1648
+
1649
+ /***/ "./lib/geo/vfeature.ts":
1650
+ /*!*****************************!*\
1651
+ !*** ./lib/geo/vfeature.ts ***!
1652
+ \*****************************/
1653
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1654
+
1655
+
1656
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1657
+ if (k2 === undefined) k2 = k;
1658
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1659
+ }) : (function(o, m, k, k2) {
1660
+ if (k2 === undefined) k2 = k;
1661
+ o[k2] = m[k];
1662
+ }));
1663
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1664
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1665
+ }) : function(o, v) {
1666
+ o["default"] = v;
1667
+ });
1668
+ var __importStar = (this && this.__importStar) || function (mod) {
1669
+ if (mod && mod.__esModule) return mod;
1670
+ var result = {};
1671
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1672
+ __setModuleDefault(result, mod);
1673
+ return result;
1674
+ };
1675
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1676
+ exports.computeVFeature = void 0;
1677
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
1678
+ const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
1679
+ // Given the topology for a precinct, the bintrie mapping and the list of blocks, construct the
1680
+ // feature data for the virtual feature.
1681
+ //
1682
+ function computeVFeature(topoPrecinct, bintrie, blocks) {
1683
+ let contiguity = new Util.IndexedArray();
1684
+ let block_contiguity = new Util.IndexedArray();
1685
+ let f = Poly.topoMerge(topoPrecinct, blocks);
1686
+ f.properties.datasets = {};
1687
+ blocks.forEach(blockid => {
1688
+ let b = topoPrecinct.objects[blockid];
1689
+ if (b.properties.datasets)
1690
+ Util.deepAccum(f.properties.datasets, b.properties.datasets);
1691
+ if (b.properties.contiguity) {
1692
+ b.properties.contiguity.forEach((id) => {
1693
+ contiguity.set(id === 'OUT_OF_STATE' ? id : bintrie.get(id));
1694
+ });
1695
+ b.properties.contiguity.forEach((id) => {
1696
+ block_contiguity.set(id);
1697
+ });
1698
+ }
1699
+ });
1700
+ f.properties.contiguity = contiguity.asArray();
1701
+ f.properties.block_contiguity = block_contiguity.asArray();
1702
+ f.properties.blocks = blocks;
1703
+ return f;
1704
+ }
1705
+ exports.computeVFeature = computeVFeature;
1706
+
1707
+
1083
1708
  /***/ }),
1084
1709
 
1085
1710
  /***/ "./lib/logabstract/all.ts":
@@ -1109,12 +1734,31 @@ __exportStar(__webpack_require__(/*! ./log */ "./lib/logabstract/log.ts"), expor
1109
1734
  /*!********************************!*\
1110
1735
  !*** ./lib/logabstract/log.ts ***!
1111
1736
  \********************************/
1112
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1737
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1113
1738
 
1114
1739
 
1740
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1741
+ if (k2 === undefined) k2 = k;
1742
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1743
+ }) : (function(o, m, k, k2) {
1744
+ if (k2 === undefined) k2 = k;
1745
+ o[k2] = m[k];
1746
+ }));
1747
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1748
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1749
+ }) : function(o, v) {
1750
+ o["default"] = v;
1751
+ });
1752
+ var __importStar = (this && this.__importStar) || function (mod) {
1753
+ if (mod && mod.__esModule) return mod;
1754
+ var result = {};
1755
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1756
+ __setModuleDefault(result, mod);
1757
+ return result;
1758
+ };
1115
1759
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1116
1760
  exports.SyncTimer = exports.AsyncTimer = exports.Timer = void 0;
1117
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
1761
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
1118
1762
  class Timer {
1119
1763
  constructor(ilog, kind, o, verbosity = 0) {
1120
1764
  this.ilog = ilog;
@@ -1175,12 +1819,31 @@ __exportStar(__webpack_require__(/*! ./log */ "./lib/logclient/log.ts"), exports
1175
1819
  /*!******************************!*\
1176
1820
  !*** ./lib/logclient/log.ts ***!
1177
1821
  \******************************/
1178
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1822
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1179
1823
 
1180
1824
 
1825
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1826
+ if (k2 === undefined) k2 = k;
1827
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1828
+ }) : (function(o, m, k, k2) {
1829
+ if (k2 === undefined) k2 = k;
1830
+ o[k2] = m[k];
1831
+ }));
1832
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1833
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1834
+ }) : function(o, v) {
1835
+ o["default"] = v;
1836
+ });
1837
+ var __importStar = (this && this.__importStar) || function (mod) {
1838
+ if (mod && mod.__esModule) return mod;
1839
+ var result = {};
1840
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1841
+ __setModuleDefault(result, mod);
1842
+ return result;
1843
+ };
1181
1844
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1182
1845
  exports.create = void 0;
1183
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
1846
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
1184
1847
  class LogManager {
1185
1848
  constructor(env) {
1186
1849
  this.env = env;
@@ -1281,13 +1944,32 @@ __exportStar(__webpack_require__(/*! ./otmaputil */ "./lib/ot-editutil/otmaputil
1281
1944
  /*!***************************************!*\
1282
1945
  !*** ./lib/ot-editutil/oteditutil.ts ***!
1283
1946
  \***************************************/
1284
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1947
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1285
1948
 
1286
1949
 
1950
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1951
+ if (k2 === undefined) k2 = k;
1952
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1953
+ }) : (function(o, m, k, k2) {
1954
+ if (k2 === undefined) k2 = k;
1955
+ o[k2] = m[k];
1956
+ }));
1957
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
1958
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
1959
+ }) : function(o, v) {
1960
+ o["default"] = v;
1961
+ });
1962
+ var __importStar = (this && this.__importStar) || function (mod) {
1963
+ if (mod && mod.__esModule) return mod;
1964
+ var result = {};
1965
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1966
+ __setModuleDefault(result, mod);
1967
+ return result;
1968
+ };
1287
1969
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1288
1970
  exports.OTEditUtil = void 0;
1289
- const OT = __webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts");
1290
- const DMP = __webpack_require__(/*! diff-match-patch */ "diff-match-patch");
1971
+ const OT = __importStar(__webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts"));
1972
+ const DMP = __importStar(__webpack_require__(/*! diff-match-patch */ "diff-match-patch"));
1291
1973
  let DiffMatchPatch = new DMP.diff_match_patch();
1292
1974
  let DIFF_DELETE = DMP.DIFF_DELETE;
1293
1975
  let DIFF_INSERT = DMP.DIFF_INSERT;
@@ -1447,13 +2129,32 @@ exports.OTEditUtil = OTEditUtil;
1447
2129
  /*!**************************************!*\
1448
2130
  !*** ./lib/ot-editutil/otmaputil.ts ***!
1449
2131
  \**************************************/
1450
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2132
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1451
2133
 
1452
2134
 
2135
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2136
+ if (k2 === undefined) k2 = k;
2137
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2138
+ }) : (function(o, m, k, k2) {
2139
+ if (k2 === undefined) k2 = k;
2140
+ o[k2] = m[k];
2141
+ }));
2142
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
2143
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
2144
+ }) : function(o, v) {
2145
+ o["default"] = v;
2146
+ });
2147
+ var __importStar = (this && this.__importStar) || function (mod) {
2148
+ if (mod && mod.__esModule) return mod;
2149
+ var result = {};
2150
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
2151
+ __setModuleDefault(result, mod);
2152
+ return result;
2153
+ };
1453
2154
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1454
2155
  exports.Editor = exports.REPLACE = exports.MERGE = void 0;
1455
- const OT = __webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts");
1456
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
2156
+ const OT = __importStar(__webpack_require__(/*! ../ot-js/all */ "./lib/ot-js/all.ts"));
2157
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
1457
2158
  exports.MERGE = 0;
1458
2159
  exports.REPLACE = 1;
1459
2160
  class Editor {
@@ -1646,12 +2347,31 @@ __exportStar(__webpack_require__(/*! ./otsession */ "./lib/ot-js/otsession.ts"),
1646
2347
  /*!******************************!*\
1647
2348
  !*** ./lib/ot-js/otarray.ts ***!
1648
2349
  \******************************/
1649
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2350
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1650
2351
 
1651
2352
 
2353
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2354
+ if (k2 === undefined) k2 = k;
2355
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2356
+ }) : (function(o, m, k, k2) {
2357
+ if (k2 === undefined) k2 = k;
2358
+ o[k2] = m[k];
2359
+ }));
2360
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
2361
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
2362
+ }) : function(o, v) {
2363
+ o["default"] = v;
2364
+ });
2365
+ var __importStar = (this && this.__importStar) || function (mod) {
2366
+ if (mod && mod.__esModule) return mod;
2367
+ var result = {};
2368
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
2369
+ __setModuleDefault(result, mod);
2370
+ return result;
2371
+ };
1652
2372
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1653
2373
  exports.OTArrayResource = exports.OTStringResource = exports.OTArrayLikeResource = exports.OTArrayOperations = exports.OTStringOperations = exports.OTSingleArrayEditor = exports.OpTmpRetain = exports.OpSet = exports.OpCursor = exports.OpRetain = exports.OpDelete = exports.OpInsert = void 0;
1654
- const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
2374
+ const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
1655
2375
  const TestUnitSize = 4;
1656
2376
  let TestCounter = 0;
1657
2377
  // Array Ops
@@ -2583,13 +3303,32 @@ function counterValue(ops, c) {
2583
3303
  /*!*************************************!*\
2584
3304
  !*** ./lib/ot-js/otclientengine.ts ***!
2585
3305
  \*************************************/
2586
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3306
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2587
3307
 
2588
3308
 
3309
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3310
+ if (k2 === undefined) k2 = k;
3311
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
3312
+ }) : (function(o, m, k, k2) {
3313
+ if (k2 === undefined) k2 = k;
3314
+ o[k2] = m[k];
3315
+ }));
3316
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
3317
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
3318
+ }) : function(o, v) {
3319
+ o["default"] = v;
3320
+ });
3321
+ var __importStar = (this && this.__importStar) || function (mod) {
3322
+ if (mod && mod.__esModule) return mod;
3323
+ var result = {};
3324
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
3325
+ __setModuleDefault(result, mod);
3326
+ return result;
3327
+ };
2589
3328
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2590
3329
  exports.OTClientEngine = void 0;
2591
- const OTC = __webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts");
2592
- const OTE = __webpack_require__(/*! ./otengine */ "./lib/ot-js/otengine.ts");
3330
+ const OTC = __importStar(__webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts"));
3331
+ const OTE = __importStar(__webpack_require__(/*! ./otengine */ "./lib/ot-js/otengine.ts"));
2593
3332
  class OTClientEngine extends OTE.OTEngine {
2594
3333
  // Constructor
2595
3334
  constructor(ilog, rid, cid) {
@@ -2833,15 +3572,34 @@ exports.OTClientEngine = OTClientEngine;
2833
3572
  /*!**********************************!*\
2834
3573
  !*** ./lib/ot-js/otcomposite.ts ***!
2835
3574
  \**********************************/
2836
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3575
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2837
3576
 
2838
3577
 
3578
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3579
+ if (k2 === undefined) k2 = k;
3580
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
3581
+ }) : (function(o, m, k, k2) {
3582
+ if (k2 === undefined) k2 = k;
3583
+ o[k2] = m[k];
3584
+ }));
3585
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
3586
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
3587
+ }) : function(o, v) {
3588
+ o["default"] = v;
3589
+ });
3590
+ var __importStar = (this && this.__importStar) || function (mod) {
3591
+ if (mod && mod.__esModule) return mod;
3592
+ var result = {};
3593
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
3594
+ __setModuleDefault(result, mod);
3595
+ return result;
3596
+ };
2839
3597
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2840
3598
  exports.OTCompositeResource = exports.clockSeenValue = exports.clockUndoValue = exports.clockInitializeValue = exports.clockFailureValue = exports.clockRandomizeValue = exports.clockTerminateValue = exports.clockInitialValue = void 0;
2841
- const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
2842
- const OTA = __webpack_require__(/*! ./otarray */ "./lib/ot-js/otarray.ts");
2843
- const OTM = __webpack_require__(/*! ./otmap */ "./lib/ot-js/otmap.ts");
2844
- const OTC = __webpack_require__(/*! ./otcounter */ "./lib/ot-js/otcounter.ts");
3599
+ const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
3600
+ const OTA = __importStar(__webpack_require__(/*! ./otarray */ "./lib/ot-js/otarray.ts"));
3601
+ const OTM = __importStar(__webpack_require__(/*! ./otmap */ "./lib/ot-js/otmap.ts"));
3602
+ const OTC = __importStar(__webpack_require__(/*! ./otcounter */ "./lib/ot-js/otcounter.ts"));
2845
3603
  exports.clockInitialValue = -1; // Initial value
2846
3604
  exports.clockTerminateValue = -2; // Terminal action from client.
2847
3605
  exports.clockRandomizeValue = -3; // Fill in with random data.
@@ -3032,12 +3790,31 @@ exports.OTCompositeResource = OTCompositeResource;
3032
3790
  /*!********************************!*\
3033
3791
  !*** ./lib/ot-js/otcounter.ts ***!
3034
3792
  \********************************/
3035
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3793
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3036
3794
 
3037
3795
 
3796
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3797
+ if (k2 === undefined) k2 = k;
3798
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
3799
+ }) : (function(o, m, k, k2) {
3800
+ if (k2 === undefined) k2 = k;
3801
+ o[k2] = m[k];
3802
+ }));
3803
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
3804
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
3805
+ }) : function(o, v) {
3806
+ o["default"] = v;
3807
+ });
3808
+ var __importStar = (this && this.__importStar) || function (mod) {
3809
+ if (mod && mod.__esModule) return mod;
3810
+ var result = {};
3811
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
3812
+ __setModuleDefault(result, mod);
3813
+ return result;
3814
+ };
3038
3815
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3039
3816
  exports.OTCounterResource = exports.OpCounterDel = exports.OpCounterAdd = void 0;
3040
- const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
3817
+ const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
3041
3818
  // This implements OT for a simple map of counters. Instead of a new value replacing the
3042
3819
  // keyed value, values are added together. This allows a simple accumulating counter.
3043
3820
  // Possible future additions:
@@ -3207,13 +3984,32 @@ exports.OTEngine = OTEngine;
3207
3984
  /*!****************************!*\
3208
3985
  !*** ./lib/ot-js/otmap.ts ***!
3209
3986
  \****************************/
3210
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3987
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3211
3988
 
3212
3989
 
3990
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3991
+ if (k2 === undefined) k2 = k;
3992
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
3993
+ }) : (function(o, m, k, k2) {
3994
+ if (k2 === undefined) k2 = k;
3995
+ o[k2] = m[k];
3996
+ }));
3997
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
3998
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
3999
+ }) : function(o, v) {
4000
+ o["default"] = v;
4001
+ });
4002
+ var __importStar = (this && this.__importStar) || function (mod) {
4003
+ if (mod && mod.__esModule) return mod;
4004
+ var result = {};
4005
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
4006
+ __setModuleDefault(result, mod);
4007
+ return result;
4008
+ };
3213
4009
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3214
4010
  exports.OTMapResource = exports.OpMapDel = exports.OpMapSet = void 0;
3215
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
3216
- const OT = __webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts");
4011
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
4012
+ const OT = __importStar(__webpack_require__(/*! ./ottypes */ "./lib/ot-js/ottypes.ts"));
3217
4013
  // This implements OT for a dictionary of objects. OT is pretty trivial for maps - last wins.
3218
4014
  exports.OpMapSet = 1;
3219
4015
  exports.OpMapDel = 2;
@@ -3327,14 +4123,33 @@ exports.OTMapResource = OTMapResource;
3327
4123
  /*!*************************************!*\
3328
4124
  !*** ./lib/ot-js/otserverengine.ts ***!
3329
4125
  \*************************************/
3330
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4126
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3331
4127
 
3332
4128
 
4129
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4130
+ if (k2 === undefined) k2 = k;
4131
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4132
+ }) : (function(o, m, k, k2) {
4133
+ if (k2 === undefined) k2 = k;
4134
+ o[k2] = m[k];
4135
+ }));
4136
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
4137
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
4138
+ }) : function(o, v) {
4139
+ o["default"] = v;
4140
+ });
4141
+ var __importStar = (this && this.__importStar) || function (mod) {
4142
+ if (mod && mod.__esModule) return mod;
4143
+ var result = {};
4144
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
4145
+ __setModuleDefault(result, mod);
4146
+ return result;
4147
+ };
3333
4148
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3334
4149
  exports.OTServerEngine = exports.ClientIDForServer = void 0;
3335
- const OTC = __webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts");
3336
- const OTS = __webpack_require__(/*! ./otsession */ "./lib/ot-js/otsession.ts");
3337
- const OTE = __webpack_require__(/*! ./otengine */ "./lib/ot-js/otengine.ts");
4150
+ const OTC = __importStar(__webpack_require__(/*! ./otcomposite */ "./lib/ot-js/otcomposite.ts"));
4151
+ const OTS = __importStar(__webpack_require__(/*! ./otsession */ "./lib/ot-js/otsession.ts"));
4152
+ const OTE = __importStar(__webpack_require__(/*! ./otengine */ "./lib/ot-js/otengine.ts"));
3338
4153
  exports.ClientIDForServer = '-Server-';
3339
4154
  class OTServerEngine extends OTE.OTEngine {
3340
4155
  // Constructor
@@ -3572,7 +4387,7 @@ exports.OTServerEngine = OTServerEngine;
3572
4387
 
3573
4388
 
3574
4389
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3575
- exports.SessionFilterFunction = exports.accessMapFindUser = exports.accessFindUser = exports.ServerStateMaintenance = exports.ServerStateRunning = exports.PermAll = exports.PermEdit = exports.PermAdmin = exports.PermOwner = exports.PermWrite = exports.PermRead = exports.PermNone = exports.FilterCount = exports.FilterOfficial = exports.FilterPublic = exports.FilterTrash = exports.FilterRecent = exports.FilterMyPublic = exports.FilterSharedWithMe = exports.FilterMyMaps = exports.EClockAnomaly = exports.EMaintenance = exports.ENoAccess = exports.ENoPerm = exports.ELoadFailed = exports.EBadRequest = exports.ENoUser = exports.EClockReset = exports.EClockFailure = exports.EClockSeen = exports.ENoSession = exports.ERetry = exports.EFull = exports.EFail = exports.ESuccess = void 0;
4390
+ exports.SessionFilterFunction = exports.accessMapFindUser = exports.accessFindUser = exports.ServerStateMaintenance = exports.ServerStateRunning = exports.PermAll = exports.PermEdit = exports.PermAdmin = exports.PermOwner = exports.PermWrite = exports.PermRead = exports.PermNone = exports.FilterCount = exports.FilterCOI = exports.FilterOfficial = exports.FilterPublic = exports.FilterTrash = exports.FilterRecent = exports.FilterMyPublic = exports.FilterSharedWithMe = exports.FilterMyMaps = exports.EClockAnomaly = exports.EMaintenance = exports.ENoAccess = exports.ENoPerm = exports.ELoadFailed = exports.EBadRequest = exports.ENoUser = exports.EClockReset = exports.EClockFailure = exports.EClockSeen = exports.ENoSession = exports.ERetry = exports.EFull = exports.EFail = exports.ESuccess = void 0;
3576
4391
  // Errors
3577
4392
  exports.ESuccess = 0; // Generic success
3578
4393
  exports.EFail = 1; // Generic failure
@@ -3597,7 +4412,8 @@ exports.FilterRecent = 3;
3597
4412
  exports.FilterTrash = 4;
3598
4413
  exports.FilterPublic = 5;
3599
4414
  exports.FilterOfficial = 6;
3600
- exports.FilterCount = 7;
4415
+ exports.FilterCOI = 7;
4416
+ exports.FilterCount = 8;
3601
4417
  // Permissions
3602
4418
  exports.PermNone = 0; // No permissions
3603
4419
  exports.PermRead = 1; // Can view
@@ -3765,13 +4581,32 @@ __exportStar(__webpack_require__(/*! ./shamos */ "./lib/poly/shamos.ts"), export
3765
4581
  /*!***************************!*\
3766
4582
  !*** ./lib/poly/blend.ts ***!
3767
4583
  \***************************/
3768
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4584
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3769
4585
 
3770
4586
 
4587
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4588
+ if (k2 === undefined) k2 = k;
4589
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4590
+ }) : (function(o, m, k, k2) {
4591
+ if (k2 === undefined) k2 = k;
4592
+ o[k2] = m[k];
4593
+ }));
4594
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
4595
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
4596
+ }) : function(o, v) {
4597
+ o["default"] = v;
4598
+ });
4599
+ var __importStar = (this && this.__importStar) || function (mod) {
4600
+ if (mod && mod.__esModule) return mod;
4601
+ var result = {};
4602
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
4603
+ __setModuleDefault(result, mod);
4604
+ return result;
4605
+ };
3771
4606
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3772
4607
  exports.blend = void 0;
3773
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
3774
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
4608
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
4609
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
3775
4610
  // Takes array of polygon or multi-polygon coordinate structures and returns a single multi-polygon
3776
4611
  // structure. The coordinates may be passed in using packed format.
3777
4612
  function blend(polys) {
@@ -3800,12 +4635,31 @@ exports.blend = blend;
3800
4635
  /*!******************************!*\
3801
4636
  !*** ./lib/poly/boundbox.ts ***!
3802
4637
  \******************************/
3803
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4638
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3804
4639
 
3805
4640
 
4641
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4642
+ if (k2 === undefined) k2 = k;
4643
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4644
+ }) : (function(o, m, k, k2) {
4645
+ if (k2 === undefined) k2 = k;
4646
+ o[k2] = m[k];
4647
+ }));
4648
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
4649
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
4650
+ }) : function(o, v) {
4651
+ o["default"] = v;
4652
+ });
4653
+ var __importStar = (this && this.__importStar) || function (mod) {
4654
+ if (mod && mod.__esModule) return mod;
4655
+ var result = {};
4656
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
4657
+ __setModuleDefault(result, mod);
4658
+ return result;
4659
+ };
3806
4660
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3807
4661
  exports.boundboxIntersects = exports.boundboxArea = exports.boundboxPoly = exports.boundbox = exports.boundboxExtend = exports.clipLon = exports.boundboxCY = exports.boundboxCX = exports.boundboxHeight = exports.boundboxWidth = void 0;
3808
- const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
4662
+ const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
3809
4663
  function boundboxWidth(bb) { return Math.abs(bb.right - bb.left); }
3810
4664
  exports.boundboxWidth = boundboxWidth;
3811
4665
  function boundboxHeight(bb) { return Math.abs(bb.bottom - bb.top); }
@@ -3887,16 +4741,35 @@ exports.boundboxIntersects = boundboxIntersects;
3887
4741
  /*!*******************************!*\
3888
4742
  !*** ./lib/poly/cartesian.ts ***!
3889
4743
  \*******************************/
3890
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4744
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3891
4745
 
3892
4746
 
3893
4747
  //
3894
4748
  // GEO-FEATURES UTILITIES
3895
4749
  //
4750
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4751
+ if (k2 === undefined) k2 = k;
4752
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4753
+ }) : (function(o, m, k, k2) {
4754
+ if (k2 === undefined) k2 = k;
4755
+ o[k2] = m[k];
4756
+ }));
4757
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
4758
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
4759
+ }) : function(o, v) {
4760
+ o["default"] = v;
4761
+ });
4762
+ var __importStar = (this && this.__importStar) || function (mod) {
4763
+ if (mod && mod.__esModule) return mod;
4764
+ var result = {};
4765
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
4766
+ __setModuleDefault(result, mod);
4767
+ return result;
4768
+ };
3896
4769
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3897
4770
  exports.polyDiameterFlat = exports.polyPerimeterFlat = exports.polyAreaFlat = exports.polyParts = void 0;
3898
- const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
3899
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
4771
+ const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
4772
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
3900
4773
  // HELPER
3901
4774
  function bufferToRing(b, s, nPoints) {
3902
4775
  let r = [];
@@ -4001,7 +4874,7 @@ exports.polyDiameterFlat = polyDiameterFlat;
4001
4874
  /*!*********************************!*\
4002
4875
  !*** ./lib/poly/graham-scan.ts ***!
4003
4876
  \*********************************/
4004
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4877
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
4005
4878
 
4006
4879
 
4007
4880
  //
@@ -4012,10 +4885,29 @@ exports.polyDiameterFlat = polyDiameterFlat;
4012
4885
  * https://www.tutorialspoint.com/Graham-Scan-Algorithm <<< pseudo code
4013
4886
  * http://brian3kb.github.io/graham_scan_js/ <<< basis for this implementation
4014
4887
  */
4888
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4889
+ if (k2 === undefined) k2 = k;
4890
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4891
+ }) : (function(o, m, k, k2) {
4892
+ if (k2 === undefined) k2 = k;
4893
+ o[k2] = m[k];
4894
+ }));
4895
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
4896
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
4897
+ }) : function(o, v) {
4898
+ o["default"] = v;
4899
+ });
4900
+ var __importStar = (this && this.__importStar) || function (mod) {
4901
+ if (mod && mod.__esModule) return mod;
4902
+ var result = {};
4903
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
4904
+ __setModuleDefault(result, mod);
4905
+ return result;
4906
+ };
4015
4907
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4016
4908
  exports.makeConvexHullGrahamScan = void 0;
4017
4909
  const poly_1 = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
4018
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
4910
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
4019
4911
  function makeConvexHullGrahamScan(poly, options) {
4020
4912
  let points = getExteriorPoints(poly);
4021
4913
  if (points == null)
@@ -4554,12 +5446,31 @@ function protect(condition, message) {
4554
5446
  /*!******************************!*\
4555
5447
  !*** ./lib/poly/minbound.ts ***!
4556
5448
  \******************************/
4557
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5449
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
4558
5450
 
4559
5451
 
4560
5452
  //
4561
5453
  // MINIMUM BOUNDING RECTANGLE - aka minimum area rectangle -or- smallest enclosing rectangle
4562
5454
  //
5455
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5456
+ if (k2 === undefined) k2 = k;
5457
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5458
+ }) : (function(o, m, k, k2) {
5459
+ if (k2 === undefined) k2 = k;
5460
+ o[k2] = m[k];
5461
+ }));
5462
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
5463
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
5464
+ }) : function(o, v) {
5465
+ o["default"] = v;
5466
+ });
5467
+ var __importStar = (this && this.__importStar) || function (mod) {
5468
+ if (mod && mod.__esModule) return mod;
5469
+ var result = {};
5470
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
5471
+ __setModuleDefault(result, mod);
5472
+ return result;
5473
+ };
4563
5474
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4564
5475
  exports.minimumBoundingRectangle = void 0;
4565
5476
  //
@@ -4594,7 +5505,7 @@ MBR <- function(p) {
4594
5505
  // THIS RE-IMPLEMENTS THE R IN TYPESCRIPT, USING CUSTOM MATRIX OPERATIONS
4595
5506
  //
4596
5507
  const poly_1 = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
4597
- const M = __webpack_require__(/*! ./matrix */ "./lib/poly/matrix.ts");
5508
+ const M = __importStar(__webpack_require__(/*! ./matrix */ "./lib/poly/matrix.ts"));
4598
5509
  // For point addressing
4599
5510
  const X = 0, Y = 1;
4600
5511
  function minimumBoundingRectangle(poly) {
@@ -4749,13 +5660,32 @@ export function minimumBoundingRectangle(poly: any): any
4749
5660
  /*!**************************!*\
4750
5661
  !*** ./lib/poly/poly.ts ***!
4751
5662
  \**************************/
4752
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5663
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
4753
5664
 
4754
5665
 
5666
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5667
+ if (k2 === undefined) k2 = k;
5668
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5669
+ }) : (function(o, m, k, k2) {
5670
+ if (k2 === undefined) k2 = k;
5671
+ o[k2] = m[k];
5672
+ }));
5673
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
5674
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
5675
+ }) : function(o, v) {
5676
+ o["default"] = v;
5677
+ });
5678
+ var __importStar = (this && this.__importStar) || function (mod) {
5679
+ if (mod && mod.__esModule) return mod;
5680
+ var result = {};
5681
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
5682
+ __setModuleDefault(result, mod);
5683
+ return result;
5684
+ };
4755
5685
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4756
5686
  exports.polyRewindRings = exports.featureRewind = exports.polyTransform = exports.npoints = exports.polyDescribe = exports.polyCompactness = exports.makeConvexHullMonotoneChain2D = exports.polyConvexHull = exports.polyToExteriorPoints = exports.polyFromCircle = exports.polyToPolsbyPopperCircle = exports.polyToCircle = exports.Circle = exports.polyPerimeter = exports.polyDiameter = exports.polyArea = exports.polyNull = exports.polyNormalize = exports.polySimpleArea = exports.DefaultOptions = exports.EARTH_RADIUS = exports.DefaultTickOptions = void 0;
4757
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
4758
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
5687
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
5688
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
4759
5689
  const graham_scan_1 = __webpack_require__(/*! ./graham-scan */ "./lib/poly/graham-scan.ts");
4760
5690
  exports.DefaultTickOptions = { maxLeafCount: 256, maxDepth: 20, tickStep: 1 };
4761
5691
  // Internal utilities
@@ -5365,14 +6295,33 @@ function twoTimesArea(x2, x1, y2, y1) {
5365
6295
  /*!*****************************!*\
5366
6296
  !*** ./lib/poly/polybin.ts ***!
5367
6297
  \*****************************/
5368
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6298
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5369
6299
 
5370
6300
 
6301
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6302
+ if (k2 === undefined) k2 = k;
6303
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6304
+ }) : (function(o, m, k, k2) {
6305
+ if (k2 === undefined) k2 = k;
6306
+ o[k2] = m[k];
6307
+ }));
6308
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
6309
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
6310
+ }) : function(o, v) {
6311
+ o["default"] = v;
6312
+ });
6313
+ var __importStar = (this && this.__importStar) || function (mod) {
6314
+ if (mod && mod.__esModule) return mod;
6315
+ var result = {};
6316
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
6317
+ __setModuleDefault(result, mod);
6318
+ return result;
6319
+ };
5371
6320
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5372
6321
  exports.topoFromBuffer = exports.topoToBuffer = exports.unpackCollection = exports.packCollection = void 0;
5373
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
5374
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
5375
- const T = __webpack_require__(/*! ./topo */ "./lib/poly/topo.ts");
6322
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
6323
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
6324
+ const T = __importStar(__webpack_require__(/*! ./topo */ "./lib/poly/topo.ts"));
5376
6325
  // Packed Buffer format:
5377
6326
  //
5378
6327
  // (strings are packed as UTF8 bytes, padded to 4 byte boundary)
@@ -5415,9 +6364,11 @@ function unpackString(coder, buf8, buf32, offset) {
5415
6364
  function packCollection(coder, col) {
5416
6365
  // Compute size
5417
6366
  let pp = PP.featurePack(col);
5418
- let buffer = col.features.length ? col.features[0].geometry.packed.buffer : null; // to restore, below
6367
+ let f = col.features.find((f) => { return f.geometry.packed ? f.geometry.packed.buffer : null; });
6368
+ let buffer = f ? f.geometry.packed.buffer : null;
5419
6369
  let size = 16; // int endiness, offset to coordinates, float endiness
5420
- col.features.forEach((f) => { delete f.geometry.packed.buffer; }); // reconstructed when unpacking
6370
+ col.features.forEach((f) => { if (f.geometry.packed)
6371
+ delete f.geometry.packed.buffer; }); // reconstructed when unpacking
5421
6372
  let j = JSON.stringify(col);
5422
6373
  size += sizeOfString(coder, j);
5423
6374
  size += pad(size, 8);
@@ -5443,7 +6394,8 @@ function packCollection(coder, col) {
5443
6394
  for (let i = 0; i < pp.length; i++)
5444
6395
  buf64[foff++] = buf[i];
5445
6396
  // Now restore
5446
- col.features.forEach((f) => { f.geometry.packed.buffer = buffer; });
6397
+ col.features.forEach((f) => { if (f.geometry.packed)
6398
+ f.geometry.packed.buffer = buffer; });
5447
6399
  PP.featureUnpack(col);
5448
6400
  return ab;
5449
6401
  }
@@ -5495,7 +6447,8 @@ function unpackCollection(coder, ab) {
5495
6447
  let offset = 16;
5496
6448
  let j = unpackString(coder, buf8, buf32, offset);
5497
6449
  col = JSON.parse(j);
5498
- col.features.forEach((f) => { f.geometry.packed.buffer = buf64; });
6450
+ col.features.forEach((f) => { if (f.geometry.packed)
6451
+ f.geometry.packed.buffer = buf64; });
5499
6452
  return col;
5500
6453
  }
5501
6454
  exports.unpackCollection = unpackCollection;
@@ -5570,14 +6523,36 @@ exports.topoFromBuffer = topoFromBuffer;
5570
6523
  /*!*******************************!*\
5571
6524
  !*** ./lib/poly/polylabel.ts ***!
5572
6525
  \*******************************/
5573
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6526
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5574
6527
 
5575
6528
 
6529
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6530
+ if (k2 === undefined) k2 = k;
6531
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6532
+ }) : (function(o, m, k, k2) {
6533
+ if (k2 === undefined) k2 = k;
6534
+ o[k2] = m[k];
6535
+ }));
6536
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
6537
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
6538
+ }) : function(o, v) {
6539
+ o["default"] = v;
6540
+ });
6541
+ var __importStar = (this && this.__importStar) || function (mod) {
6542
+ if (mod && mod.__esModule) return mod;
6543
+ var result = {};
6544
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
6545
+ __setModuleDefault(result, mod);
6546
+ return result;
6547
+ };
6548
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6549
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6550
+ };
5576
6551
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5577
6552
  exports.polyLabel = void 0;
5578
- const tinyqueue_1 = __webpack_require__(/*! tinyqueue */ "tinyqueue");
5579
- const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
5580
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
6553
+ const tinyqueue_1 = __importDefault(__webpack_require__(/*! tinyqueue */ "tinyqueue"));
6554
+ const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
6555
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
5581
6556
  //
5582
6557
  // polyLabel: given polygon, return contained point furthest from any edge, and that distance
5583
6558
  //
@@ -5743,13 +6718,32 @@ function getSegDistSq(px, py, ax, ay, bx, by) {
5743
6718
  /*!******************************!*\
5744
6719
  !*** ./lib/poly/polypack.ts ***!
5745
6720
  \******************************/
5746
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6721
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5747
6722
 
5748
6723
 
6724
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6725
+ if (k2 === undefined) k2 = k;
6726
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
6727
+ }) : (function(o, m, k, k2) {
6728
+ if (k2 === undefined) k2 = k;
6729
+ o[k2] = m[k];
6730
+ }));
6731
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
6732
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
6733
+ }) : function(o, v) {
6734
+ o["default"] = v;
6735
+ });
6736
+ var __importStar = (this && this.__importStar) || function (mod) {
6737
+ if (mod && mod.__esModule) return mod;
6738
+ var result = {};
6739
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
6740
+ __setModuleDefault(result, mod);
6741
+ return result;
6742
+ };
5749
6743
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5750
6744
  exports.featureUnpackString = exports.featurePackString = exports.featureRepack = exports.featureUnpackTemporarily = exports.featureUnpack = exports.featurePack = exports.featurePackSize = exports.polyUnpack = exports.polyPackCopy = exports.polyPack = exports.polyPackTopoArcs = exports.countArcPoints = exports.countOneArcPoints = exports.countArcRings = exports.countArcPolygons = exports.normalizeArcs = exports.polyPacked = exports.polyPackCountPoints = exports.polyPackEachPoint = exports.polyPackEachRing = exports.polyPackSize = void 0;
5751
6745
  // Shared libraries
5752
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
6746
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
5753
6747
  function polyPackSize(coords) {
5754
6748
  // Null feature?
5755
6749
  if (coords == null || (coords.length !== undefined && coords.length == 0))
@@ -5949,7 +6943,9 @@ function polyPack(coords, prepack) {
5949
6943
  coords = coords.geometry.coordinates;
5950
6944
  // Transparently handle polygon or multi-polygon
5951
6945
  let depth = Util.depthof(coords);
5952
- if (depth == 3)
6946
+ if (depth == 2)
6947
+ coords = [[[coords]]];
6948
+ else if (depth == 3)
5953
6949
  coords = [[coords]];
5954
6950
  else if (depth == 4)
5955
6951
  coords = [coords];
@@ -6036,14 +7032,16 @@ function polyUnpack(prepack) {
6036
7032
  }
6037
7033
  exports.polyUnpack = polyUnpack;
6038
7034
  function featurePackSize(f) {
6039
- if (f && f.geometry && f.geometry.coordinates)
7035
+ if (f && f.geometry && f.geometry.coordinates && f.geometry.type !== 'Point')
6040
7036
  return polyPackSize(f.geometry.coordinates);
6041
7037
  return 0;
6042
7038
  }
6043
7039
  exports.featurePackSize = featurePackSize;
6044
7040
  function featurePack(f, prepack) {
6045
7041
  if (f && f.type === 'Feature') {
6046
- if (f.geometry && f.geometry.coordinates) {
7042
+ if (f.geometry && f.geometry.type === 'Point')
7043
+ return prepack ? { offset: prepack.offset, length: 0, buffer: prepack.buffer } : { offset: 0, length: 0, buffer: null };
7044
+ else if (f.geometry && f.geometry.coordinates) {
6047
7045
  f.geometry.packed = polyPack(f.geometry.coordinates, prepack);
6048
7046
  delete f.geometry.coordinates;
6049
7047
  }
@@ -6076,9 +7074,16 @@ exports.featurePack = featurePack;
6076
7074
  function featureUnpack(f) {
6077
7075
  if (f && f.geometry && f.geometry.packed !== undefined) {
6078
7076
  f.geometry.coordinates = polyUnpack(f.geometry.packed);
7077
+ let depth = Util.depthof(f.geometry.coordinates);
6079
7078
  // Check for oops, optimized away the multipolygon in polyUnpack
6080
- if (f.geometry.type === 'MultiPolygon' && Util.depthof(f.geometry.coordinates) === 4)
7079
+ if (f.geometry.type === 'MultiPolygon' && depth === 4)
6081
7080
  f.geometry.coordinates = [f.geometry.coordinates];
7081
+ else if (f.geometry.type === 'Point' && depth != 2) {
7082
+ while (depth > 2) {
7083
+ f.geometry.coordinates = f.geometry.coordinates[0];
7084
+ depth = Util.depthof(f.geometry.coordinates);
7085
+ }
7086
+ }
6082
7087
  delete f.geometry.packed;
6083
7088
  }
6084
7089
  else if (f.type && f.type === 'FeatureCollection' && f.features) {
@@ -6153,13 +7158,32 @@ exports.featureUnpackString = featureUnpackString;
6153
7158
  /*!*******************************!*\
6154
7159
  !*** ./lib/poly/polyround.ts ***!
6155
7160
  \*******************************/
6156
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7161
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6157
7162
 
6158
7163
 
7164
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7165
+ if (k2 === undefined) k2 = k;
7166
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7167
+ }) : (function(o, m, k, k2) {
7168
+ if (k2 === undefined) k2 = k;
7169
+ o[k2] = m[k];
7170
+ }));
7171
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
7172
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
7173
+ }) : function(o, v) {
7174
+ o["default"] = v;
7175
+ });
7176
+ var __importStar = (this && this.__importStar) || function (mod) {
7177
+ if (mod && mod.__esModule) return mod;
7178
+ var result = {};
7179
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
7180
+ __setModuleDefault(result, mod);
7181
+ return result;
7182
+ };
6159
7183
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6160
7184
  exports.polyRound = void 0;
6161
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
6162
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
7185
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
7186
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
6163
7187
  // Round feature geometry to 6 decimal precision
6164
7188
  function polyRound(o) {
6165
7189
  if (o) {
@@ -6192,12 +7216,31 @@ exports.polyRound = polyRound;
6192
7216
  /*!**********************************!*\
6193
7217
  !*** ./lib/poly/polysimplify.ts ***!
6194
7218
  \**********************************/
6195
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7219
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6196
7220
 
6197
7221
 
7222
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7223
+ if (k2 === undefined) k2 = k;
7224
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7225
+ }) : (function(o, m, k, k2) {
7226
+ if (k2 === undefined) k2 = k;
7227
+ o[k2] = m[k];
7228
+ }));
7229
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
7230
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
7231
+ }) : function(o, v) {
7232
+ o["default"] = v;
7233
+ });
7234
+ var __importStar = (this && this.__importStar) || function (mod) {
7235
+ if (mod && mod.__esModule) return mod;
7236
+ var result = {};
7237
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
7238
+ __setModuleDefault(result, mod);
7239
+ return result;
7240
+ };
6198
7241
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6199
7242
  exports.polySimplify = void 0;
6200
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
7243
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
6201
7244
  const simplify_1 = __webpack_require__(/*! ./simplify */ "./lib/poly/simplify.ts");
6202
7245
  function polySimplify(poly, tolerance = 0.0001) {
6203
7246
  if (poly == null)
@@ -6226,21 +7269,40 @@ exports.polySimplify = polySimplify;
6226
7269
  /*!**************************!*\
6227
7270
  !*** ./lib/poly/quad.ts ***!
6228
7271
  \**************************/
6229
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7272
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6230
7273
 
6231
7274
 
7275
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7276
+ if (k2 === undefined) k2 = k;
7277
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7278
+ }) : (function(o, m, k, k2) {
7279
+ if (k2 === undefined) k2 = k;
7280
+ o[k2] = m[k];
7281
+ }));
7282
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
7283
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
7284
+ }) : function(o, v) {
7285
+ o["default"] = v;
7286
+ });
7287
+ var __importStar = (this && this.__importStar) || function (mod) {
7288
+ if (mod && mod.__esModule) return mod;
7289
+ var result = {};
7290
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
7291
+ __setModuleDefault(result, mod);
7292
+ return result;
7293
+ };
6232
7294
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6233
7295
  exports.FsmQuadTree = exports.DefaultQuadOptions = exports.unionPolys = void 0;
6234
7296
  // Public libraries
6235
- const PC = __webpack_require__(/*! polygon-clipping */ "polygon-clipping");
7297
+ const PC = __importStar(__webpack_require__(/*! polygon-clipping */ "polygon-clipping"));
6236
7298
  // Shared libraries
6237
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
6238
- const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
7299
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
7300
+ const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
6239
7301
  // Local libraries
6240
- const Poly = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
6241
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
6242
- const BB = __webpack_require__(/*! ./boundbox */ "./lib/poly/boundbox.ts");
6243
- const PR = __webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts");
7302
+ const Poly = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
7303
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
7304
+ const BB = __importStar(__webpack_require__(/*! ./boundbox */ "./lib/poly/boundbox.ts"));
7305
+ const PR = __importStar(__webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts"));
6244
7306
  let _union = undefined;
6245
7307
  let anyPC = PC;
6246
7308
  if (anyPC.union)
@@ -6435,13 +7497,32 @@ exports.FsmQuadTree = FsmQuadTree;
6435
7497
  /*!***********************************!*\
6436
7498
  !*** ./lib/poly/selfintersect.ts ***!
6437
7499
  \***********************************/
6438
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7500
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6439
7501
 
6440
7502
 
7503
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7504
+ if (k2 === undefined) k2 = k;
7505
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7506
+ }) : (function(o, m, k, k2) {
7507
+ if (k2 === undefined) k2 = k;
7508
+ o[k2] = m[k];
7509
+ }));
7510
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
7511
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
7512
+ }) : function(o, v) {
7513
+ o["default"] = v;
7514
+ });
7515
+ var __importStar = (this && this.__importStar) || function (mod) {
7516
+ if (mod && mod.__esModule) return mod;
7517
+ var result = {};
7518
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
7519
+ __setModuleDefault(result, mod);
7520
+ return result;
7521
+ };
6441
7522
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6442
7523
  exports.selfIntersect = void 0;
6443
- const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
6444
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
7524
+ const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
7525
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
6445
7526
  // Given three colinear points p, q, r, the function checks if
6446
7527
  // point q lies on line segment 'pr'
6447
7528
  function onSegment(px, py, qx, qy, rx, ry) {
@@ -6523,13 +7604,35 @@ exports.selfIntersect = selfIntersect;
6523
7604
  /*!****************************!*\
6524
7605
  !*** ./lib/poly/shamos.ts ***!
6525
7606
  \****************************/
6526
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7607
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6527
7608
 
6528
7609
 
7610
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7611
+ if (k2 === undefined) k2 = k;
7612
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7613
+ }) : (function(o, m, k, k2) {
7614
+ if (k2 === undefined) k2 = k;
7615
+ o[k2] = m[k];
7616
+ }));
7617
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
7618
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
7619
+ }) : function(o, v) {
7620
+ o["default"] = v;
7621
+ });
7622
+ var __importStar = (this && this.__importStar) || function (mod) {
7623
+ if (mod && mod.__esModule) return mod;
7624
+ var result = {};
7625
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
7626
+ __setModuleDefault(result, mod);
7627
+ return result;
7628
+ };
7629
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7630
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7631
+ };
6529
7632
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6530
7633
  exports.selfIntersectFast = void 0;
6531
- const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
6532
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
7634
+ const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
7635
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
6533
7636
  // Adapted from rowanwins/shamos-hoey
6534
7637
  /*
6535
7638
  MIT License
@@ -6555,8 +7658,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
6555
7658
  SOFTWARE.
6556
7659
  */
6557
7660
  // External libraries
6558
- const tinyqueue_1 = __webpack_require__(/*! tinyqueue */ "tinyqueue");
6559
- const splaytree_1 = __webpack_require__(/*! splaytree */ "splaytree");
7661
+ const tinyqueue_1 = __importDefault(__webpack_require__(/*! tinyqueue */ "tinyqueue"));
7662
+ const splaytree_1 = __importDefault(__webpack_require__(/*! splaytree */ "splaytree"));
6560
7663
  class Event {
6561
7664
  constructor(x, y) {
6562
7665
  this.x = x;
@@ -6853,22 +7956,41 @@ exports.simplify = simplify;
6853
7956
  /*!**************************!*\
6854
7957
  !*** ./lib/poly/topo.ts ***!
6855
7958
  \**************************/
6856
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7959
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6857
7960
 
6858
7961
 
7962
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7963
+ if (k2 === undefined) k2 = k;
7964
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7965
+ }) : (function(o, m, k, k2) {
7966
+ if (k2 === undefined) k2 = k;
7967
+ o[k2] = m[k];
7968
+ }));
7969
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
7970
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
7971
+ }) : function(o, v) {
7972
+ o["default"] = v;
7973
+ });
7974
+ var __importStar = (this && this.__importStar) || function (mod) {
7975
+ if (mod && mod.__esModule) return mod;
7976
+ var result = {};
7977
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
7978
+ __setModuleDefault(result, mod);
7979
+ return result;
7980
+ };
6859
7981
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6860
7982
  exports.topoUnpack = exports.topoPack = exports.topoPacked = exports.FsmTopoUnion = exports.topoMergeFeatures = exports.topoMerge = exports.topoSimplifyCollection = exports.topoToCollection = exports.topoToFeature = exports.topoContiguity = exports.topoFromCollection = void 0;
6861
7983
  // Forked version that supports packing
6862
- const TopoClient = __webpack_require__(/*! @dra2020/topojson-client */ "@dra2020/topojson-client");
7984
+ const TopoClient = __importStar(__webpack_require__(/*! @dra2020/topojson-client */ "@dra2020/topojson-client"));
6863
7985
  // Forked version that fixes self-looping hole problem
6864
- const TopoServer = __webpack_require__(/*! @dra2020/topojson-server */ "@dra2020/topojson-server");
7986
+ const TopoServer = __importStar(__webpack_require__(/*! @dra2020/topojson-server */ "@dra2020/topojson-server"));
6865
7987
  // Forked version that fixes performance problem
6866
- const TopoSimplify = __webpack_require__(/*! @dra2020/topojson-simplify */ "@dra2020/topojson-simplify");
6867
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
6868
- const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
6869
- const P = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
6870
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
6871
- const PL = __webpack_require__(/*! ./polylabel */ "./lib/poly/polylabel.ts");
7988
+ const TopoSimplify = __importStar(__webpack_require__(/*! @dra2020/topojson-simplify */ "@dra2020/topojson-simplify"));
7989
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
7990
+ const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
7991
+ const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
7992
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
7993
+ const PL = __importStar(__webpack_require__(/*! ./polylabel */ "./lib/poly/polylabel.ts"));
6872
7994
  const shamos_1 = __webpack_require__(/*! ./shamos */ "./lib/poly/shamos.ts");
6873
7995
  function getGEOID(f) {
6874
7996
  if (f.features && f.features.length)
@@ -6912,24 +8034,19 @@ function ringsCancel(outerPoly, innerRing) {
6912
8034
  function correctGeometry(f) {
6913
8035
  if (f && f.geometry && f.geometry.type === 'MultiPolygon' && f.geometry.coordinates) {
6914
8036
  let multiPoly = f.geometry.coordinates;
6915
- /* Comment this out right now - might have been do to not rewinding merge output
6916
- // topojson will under certain circumstances return a MultiPolygon with the first Polygon containing holes
6917
- // that are precisely filled by a subsequent polygon. We make a secondary union pass to try to correct for this.
6918
- // If we have a really degenerate multipolygon (test above some number of polygons) omit this expensive pass
6919
- // since cleanup is unlikely.
6920
- if (multiPoly.length > 1 && multiPoly.length < 50)
6921
- {
6922
- let result = Q.unionPolys(multiPoly);
6923
- if (Util.depthof(result) == 4) result = [ result ];
6924
- multiPoly = result;
6925
- }
6926
- */
6927
8037
  // Convert degenerate MultiPolygon to Polygon
6928
8038
  if (multiPoly.length == 1) {
6929
8039
  f.geometry.type = 'Polygon';
6930
8040
  f.geometry.coordinates = multiPoly[0];
6931
8041
  }
6932
8042
  }
8043
+ if (f && f.geometry && f.geometry.type === 'Point' && f.geometry.coordinates) {
8044
+ while (Array.isArray(f.geometry.coordinates[0]))
8045
+ f.geometry.coordinates = f.geometry.coordinates[0];
8046
+ }
8047
+ else
8048
+ // TopoJSON does not guarantee proper winding order which messes up later processing. Fix it.
8049
+ P.featureRewind(f);
6933
8050
  return f;
6934
8051
  }
6935
8052
  function topoContiguity(topo) {
@@ -7023,6 +8140,9 @@ function bigTimeString(ms) {
7023
8140
  return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
7024
8141
  }
7025
8142
  const DefaultSimplifyOptions = { minArea: 500 };
8143
+ function log(s) {
8144
+ //console.log(s);
8145
+ }
7026
8146
  //
7027
8147
  // topoSimplifyCollection:
7028
8148
  // This implements our simplification strategy for block/precinct level shapes. The basic idea is to
@@ -7045,10 +8165,10 @@ function topoSimplifyCollection(col, options) {
7045
8165
  let elapsedTotal = new Util.Elapsed();
7046
8166
  let elapsed = new Util.Elapsed();
7047
8167
  let topo = topoFromCollection(col);
7048
- console.log(`topoSimplifyCollection: fromCollection: ${Math.round(elapsed.ms())}ms`);
8168
+ log(`topoSimplifyCollection: fromCollection: ${Math.round(elapsed.ms())}ms`);
7049
8169
  elapsed.start();
7050
8170
  topo = TopoSimplify.presimplify(topo, TopoSimplify['sphericalTriangleArea']);
7051
- console.log(`topoSimplifyCollection: presimplify: ${Math.round(elapsed.ms())}ms`);
8171
+ log(`topoSimplifyCollection: presimplify: ${Math.round(elapsed.ms())}ms`);
7052
8172
  elapsed.start();
7053
8173
  // Keep iterating on removing simplification from degenerate shapes
7054
8174
  let nTries = 1;
@@ -7065,6 +8185,9 @@ function topoSimplifyCollection(col, options) {
7065
8185
  col.features.forEach((f) => {
7066
8186
  let oOld = topo.objects[f.properties.id];
7067
8187
  let oNew = testtopo.objects[f.properties.id];
8188
+ // Ignore points
8189
+ if (f.geometry && f.geometry.type === 'Point')
8190
+ keepTiny.set(f, f);
7068
8191
  if (!keepTiny.has(f)) {
7069
8192
  // Walk through each polygon of a multipolygon separately since I may have a large non-degenerate
7070
8193
  // shape combined with degenerate smaller shapes that I want to identify. I do not examine holes
@@ -7104,11 +8227,11 @@ function topoSimplifyCollection(col, options) {
7104
8227
  }
7105
8228
  }
7106
8229
  });
7107
- console.log(`topoSimplifyCollection: pass ${nTries}: ${nBad} (${nTiny} tiny) of ${col.features.length} features are degenerate`);
8230
+ log(`topoSimplifyCollection: pass ${nTries}: ${nBad} (${nTiny} tiny) of ${col.features.length} features are degenerate`);
7108
8231
  // If not making progress, keep more points
7109
8232
  if (nBad >= nBadLast) {
7110
8233
  keepweight /= 10;
7111
- console.log(`topoSimplifyCollection: pass ${nTries}: reducing weight limit to ${keepweight}`);
8234
+ log(`topoSimplifyCollection: pass ${nTries}: reducing weight limit to ${keepweight}`);
7112
8235
  }
7113
8236
  nBadLast = nBad;
7114
8237
  if (nBad && nTries > MAX_TRIES)
@@ -7120,7 +8243,7 @@ function topoSimplifyCollection(col, options) {
7120
8243
  }
7121
8244
  nTries++;
7122
8245
  }
7123
- console.log(`topoSimplifyCollection: total elapsed time: ${bigTimeString(elapsedTotal.ms())}`);
8246
+ log(`topoSimplifyCollection: total elapsed time: ${bigTimeString(elapsedTotal.ms())}`);
7124
8247
  return col;
7125
8248
  }
7126
8249
  exports.topoSimplifyCollection = topoSimplifyCollection;
@@ -7129,27 +8252,7 @@ function topoMerge(topo, geoids) {
7129
8252
  return null;
7130
8253
  let objects = [];
7131
8254
  geoids.forEach((geoid) => objects.push(topo.objects[geoid]));
7132
- let f = correctGeometry({ type: 'Feature', properties: {}, geometry: TopoClient.merge(topo, objects) });
7133
- P.featureRewind(f);
7134
- /* Comment out for now - may be due to merge output needing to be rewound
7135
- // If I get a bad output from topoMerge, just do more expensive poly union. This can happen if input polygons
7136
- // are a little funky (in particular, if they double back along the same edge.
7137
- if (selfIntersectFast(f))
7138
- {
7139
- //console.log('topoMerge: patching selfIntersect');
7140
- let polys: any[] = [];
7141
- geoids.forEach((geoid) => polys.push(topoToFeature(topo, geoid).geometry.coordinates));
7142
- let result = Q.unionPolys(polys);
7143
- let depth = Util.depthof(result);
7144
- if (depth === 5 && result.length === 1)
7145
- {
7146
- depth = 4;
7147
- result = result[0];
7148
- }
7149
- f = { type: 'feature', properties: {}, geometry: { type: depth == 4 ? 'Polygon' : 'MultiPolygon', coordinates: result } };
7150
- }
7151
- */
7152
- return f;
8255
+ return correctGeometry({ type: 'Feature', properties: {}, geometry: TopoClient.merge(topo, objects) });
7153
8256
  }
7154
8257
  exports.topoMerge = topoMerge;
7155
8258
  function topoMergeFeatures(topo, features) {
@@ -7187,7 +8290,7 @@ class FsmIncrementalUnion extends FSM.Fsm {
7187
8290
  let values = Object.values(map);
7188
8291
  this.work = { nUnion: values.length, nDifference: 0, ms: 0 };
7189
8292
  let elapsed = new Util.Elapsed();
7190
- this.result = topoMergeFeatures(this.key.topo, values);
8293
+ this.result = topoMergeFeatures(this.key.multi.allTopo(), values);
7191
8294
  this.work.ms = elapsed.ms();
7192
8295
  this.map = map;
7193
8296
  }
@@ -7290,18 +8393,37 @@ exports.topoUnpack = topoUnpack;
7290
8393
  /*!***************************!*\
7291
8394
  !*** ./lib/poly/union.ts ***!
7292
8395
  \***************************/
7293
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8396
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7294
8397
 
7295
8398
 
8399
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8400
+ if (k2 === undefined) k2 = k;
8401
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
8402
+ }) : (function(o, m, k, k2) {
8403
+ if (k2 === undefined) k2 = k;
8404
+ o[k2] = m[k];
8405
+ }));
8406
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
8407
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
8408
+ }) : function(o, v) {
8409
+ o["default"] = v;
8410
+ });
8411
+ var __importStar = (this && this.__importStar) || function (mod) {
8412
+ if (mod && mod.__esModule) return mod;
8413
+ var result = {};
8414
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
8415
+ __setModuleDefault(result, mod);
8416
+ return result;
8417
+ };
7296
8418
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7297
- exports.FsmUnion = exports.polyIntersects = void 0;
7298
- const PC = __webpack_require__(/*! polygon-clipping */ "polygon-clipping");
7299
- const Util = __webpack_require__(/*! ../util/all */ "./lib/util/all.ts");
7300
- const FSM = __webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts");
7301
- const Poly = __webpack_require__(/*! ./poly */ "./lib/poly/poly.ts");
7302
- const Q = __webpack_require__(/*! ./quad */ "./lib/poly/quad.ts");
7303
- const PP = __webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts");
7304
- const PR = __webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts");
8419
+ exports.FsmUnion = exports.polyDifference = exports.polyIntersects = void 0;
8420
+ const PC = __importStar(__webpack_require__(/*! polygon-clipping */ "polygon-clipping"));
8421
+ const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
8422
+ const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
8423
+ const Poly = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
8424
+ const Q = __importStar(__webpack_require__(/*! ./quad */ "./lib/poly/quad.ts"));
8425
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
8426
+ const PR = __importStar(__webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts"));
7305
8427
  // Confusion on how polygon-clipping exposes its interface - be flexible
7306
8428
  let _union = undefined;
7307
8429
  let _difference = undefined;
@@ -7353,6 +8475,20 @@ function polyIntersects(p1, p2) {
7353
8475
  return bIntersects;
7354
8476
  }
7355
8477
  exports.polyIntersects = polyIntersects;
8478
+ function polyDifference(main, parts) {
8479
+ main = PP.polyUnpack(coords(main));
8480
+ // need to explode multipolygon so that "exploded" is a valid multipolygon input to underlying difference routine
8481
+ let exploded = [];
8482
+ parts.forEach((p) => {
8483
+ p = PP.polyUnpack(coords(p));
8484
+ if (Util.depthof(p) == 5)
8485
+ p.forEach((poly) => { exploded.push(poly); });
8486
+ else
8487
+ exploded.push(p);
8488
+ });
8489
+ return PR.polyRound(_difference(main, exploded));
8490
+ }
8491
+ exports.polyDifference = polyDifference;
7356
8492
  class FsmDifference extends FSM.Fsm {
7357
8493
  constructor(env, accum, polys) {
7358
8494
  super(env);
@@ -8984,7 +10120,7 @@ module.exports = require("tinyqueue");;
8984
10120
  /******/ // module exports must be returned from runtime so entry inlining is disabled
8985
10121
  /******/ // startup
8986
10122
  /******/ // Load entry module and return exports
8987
- /******/ return __webpack_require__("./lib/all/allclient.ts");
10123
+ /******/ return __webpack_require__("./lib/all/all.ts");
8988
10124
  /******/ })()
8989
10125
  ;
8990
10126
  });