node-red-contrib-tak-registration 0.11.5 → 0.11.6

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 (202) hide show
  1. package/node_modules/@types/node/README.md +1 -1
  2. package/node_modules/@types/node/buffer.d.ts +8 -7
  3. package/node_modules/@types/node/crypto.d.ts +38 -7
  4. package/node_modules/@types/node/dgram.d.ts +10 -0
  5. package/node_modules/@types/node/diagnostics_channel.d.ts +355 -1
  6. package/node_modules/@types/node/fs.d.ts +28 -8
  7. package/node_modules/@types/node/globals.d.ts +26 -0
  8. package/node_modules/@types/node/http.d.ts +6 -7
  9. package/node_modules/@types/node/module.d.ts +14 -0
  10. package/node_modules/@types/node/net.d.ts +8 -3
  11. package/node_modules/@types/node/package.json +3 -4
  12. package/node_modules/@types/node/perf_hooks.d.ts +12 -6
  13. package/node_modules/@types/node/process.d.ts +25 -3
  14. package/node_modules/@types/node/querystring.d.ts +3 -3
  15. package/node_modules/@types/node/stream/web.d.ts +17 -1
  16. package/node_modules/@types/node/string_decoder.d.ts +2 -2
  17. package/node_modules/@types/node/test.d.ts +98 -15
  18. package/node_modules/@types/node/tls.d.ts +1 -1
  19. package/node_modules/@types/node/ts4.8/buffer.d.ts +8 -7
  20. package/node_modules/@types/node/ts4.8/crypto.d.ts +41 -9
  21. package/node_modules/@types/node/ts4.8/dgram.d.ts +10 -0
  22. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +355 -1
  23. package/node_modules/@types/node/ts4.8/fs.d.ts +28 -8
  24. package/node_modules/@types/node/ts4.8/globals.d.ts +26 -0
  25. package/node_modules/@types/node/ts4.8/http.d.ts +6 -7
  26. package/node_modules/@types/node/ts4.8/module.d.ts +14 -0
  27. package/node_modules/@types/node/ts4.8/net.d.ts +8 -3
  28. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +13 -7
  29. package/node_modules/@types/node/ts4.8/process.d.ts +25 -3
  30. package/node_modules/@types/node/ts4.8/querystring.d.ts +3 -3
  31. package/node_modules/@types/node/ts4.8/stream/web.d.ts +17 -1
  32. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +2 -2
  33. package/node_modules/@types/node/ts4.8/test.d.ts +98 -15
  34. package/node_modules/@types/node/ts4.8/tls.d.ts +1 -1
  35. package/node_modules/@types/node/ts4.8/url.d.ts +59 -42
  36. package/node_modules/@types/node/ts4.8/util.d.ts +1 -1
  37. package/node_modules/@types/node/ts4.8/v8.d.ts +134 -5
  38. package/node_modules/@types/node/ts4.8/wasi.d.ts +26 -5
  39. package/node_modules/@types/node/url.d.ts +59 -42
  40. package/node_modules/@types/node/v8.d.ts +134 -5
  41. package/node_modules/@types/node/wasi.d.ts +26 -5
  42. package/node_modules/axios/CHANGELOG.md +53 -0
  43. package/node_modules/axios/README.md +47 -5
  44. package/node_modules/axios/dist/axios.js +368 -4
  45. package/node_modules/axios/dist/axios.js.map +1 -1
  46. package/node_modules/axios/dist/axios.min.js +1 -1
  47. package/node_modules/axios/dist/axios.min.js.map +1 -1
  48. package/node_modules/axios/dist/browser/axios.cjs +28 -4
  49. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  50. package/node_modules/axios/dist/esm/axios.js +28 -4
  51. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  52. package/node_modules/axios/dist/esm/axios.min.js +1 -1
  53. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  54. package/node_modules/axios/dist/node/axios.cjs +34 -6
  55. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  56. package/node_modules/axios/index.d.cts +1 -1
  57. package/node_modules/axios/index.d.ts +1 -1
  58. package/node_modules/axios/lib/adapters/http.js +6 -2
  59. package/node_modules/axios/lib/core/Axios.js +22 -1
  60. package/node_modules/axios/lib/env/data.js +1 -1
  61. package/node_modules/axios/lib/helpers/combineURLs.js +1 -1
  62. package/node_modules/axios/lib/helpers/formDataToJSON.js +3 -0
  63. package/node_modules/axios/package.json +2 -2
  64. package/node_modules/call-bind/CHANGELOG.md +16 -0
  65. package/node_modules/call-bind/index.js +2 -11
  66. package/node_modules/call-bind/package.json +11 -6
  67. package/node_modules/define-data-property/CHANGELOG.md +29 -0
  68. package/node_modules/define-data-property/index.d.ts +12 -3
  69. package/node_modules/define-data-property/index.js +4 -16
  70. package/node_modules/define-data-property/package.json +26 -33
  71. package/node_modules/define-data-property/test/index.js +10 -10
  72. package/node_modules/es-define-property/.eslintrc +13 -0
  73. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  74. package/node_modules/es-define-property/.nycrc +9 -0
  75. package/node_modules/es-define-property/CHANGELOG.md +15 -0
  76. package/node_modules/es-define-property/LICENSE +21 -0
  77. package/node_modules/es-define-property/README.md +49 -0
  78. package/node_modules/es-define-property/index.d.ts +3 -0
  79. package/node_modules/es-define-property/index.js +16 -0
  80. package/node_modules/es-define-property/package.json +81 -0
  81. package/node_modules/es-define-property/test/index.js +55 -0
  82. package/node_modules/es-define-property/tsconfig.json +50 -0
  83. package/node_modules/es-errors/.eslintrc +5 -0
  84. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  85. package/node_modules/es-errors/CHANGELOG.md +40 -0
  86. package/node_modules/es-errors/LICENSE +21 -0
  87. package/node_modules/es-errors/README.md +55 -0
  88. package/node_modules/es-errors/eval.d.ts +3 -0
  89. package/node_modules/es-errors/eval.js +4 -0
  90. package/node_modules/es-errors/index.d.ts +3 -0
  91. package/node_modules/es-errors/index.js +4 -0
  92. package/node_modules/es-errors/package.json +80 -0
  93. package/node_modules/es-errors/range.d.ts +3 -0
  94. package/node_modules/es-errors/range.js +4 -0
  95. package/node_modules/es-errors/ref.d.ts +3 -0
  96. package/node_modules/es-errors/ref.js +4 -0
  97. package/node_modules/es-errors/syntax.d.ts +3 -0
  98. package/node_modules/es-errors/syntax.js +4 -0
  99. package/node_modules/es-errors/test/index.js +19 -0
  100. package/node_modules/es-errors/tsconfig.json +49 -0
  101. package/node_modules/es-errors/type.d.ts +3 -0
  102. package/node_modules/es-errors/type.js +4 -0
  103. package/node_modules/es-errors/uri.d.ts +3 -0
  104. package/node_modules/es-errors/uri.js +4 -0
  105. package/node_modules/fast-xml-parser/CHANGELOG.md +3 -0
  106. package/node_modules/fast-xml-parser/README.md +2 -1
  107. package/node_modules/fast-xml-parser/package.json +4 -1
  108. package/node_modules/fast-xml-parser/src/fxp.d.ts +363 -69
  109. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +5 -5
  110. package/node_modules/follow-redirects/index.js +114 -75
  111. package/node_modules/follow-redirects/package.json +1 -1
  112. package/node_modules/get-intrinsic/CHANGELOG.md +18 -0
  113. package/node_modules/get-intrinsic/index.js +15 -7
  114. package/node_modules/get-intrinsic/package.json +12 -12
  115. package/node_modules/has-property-descriptors/CHANGELOG.md +8 -0
  116. package/node_modules/has-property-descriptors/index.js +3 -14
  117. package/node_modules/has-property-descriptors/package.json +5 -5
  118. package/node_modules/has-proto/CHANGELOG.md +15 -0
  119. package/node_modules/has-proto/index.d.ts +3 -0
  120. package/node_modules/has-proto/index.js +5 -1
  121. package/node_modules/has-proto/package.json +9 -5
  122. package/node_modules/has-proto/tsconfig.json +49 -0
  123. package/node_modules/has-tostringtag/.eslintrc +0 -6
  124. package/node_modules/has-tostringtag/.nycrc +13 -0
  125. package/node_modules/has-tostringtag/CHANGELOG.md +22 -0
  126. package/node_modules/has-tostringtag/index.d.ts +3 -0
  127. package/node_modules/has-tostringtag/index.js +1 -0
  128. package/node_modules/has-tostringtag/package.json +37 -13
  129. package/node_modules/has-tostringtag/shams.d.ts +3 -0
  130. package/node_modules/has-tostringtag/shams.js +1 -0
  131. package/node_modules/has-tostringtag/test/shams/core-js.js +3 -0
  132. package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +2 -0
  133. package/node_modules/has-tostringtag/test/tests.js +2 -1
  134. package/node_modules/has-tostringtag/tsconfig.json +49 -0
  135. package/node_modules/hasown/CHANGELOG.md +8 -0
  136. package/node_modules/hasown/index.d.ts +3 -3
  137. package/node_modules/hasown/index.js +1 -1
  138. package/node_modules/hasown/package.json +13 -15
  139. package/node_modules/polygon-clipping/README.md +29 -26
  140. package/node_modules/polygon-clipping/dist/polygon-clipping.cjs.js +1398 -1421
  141. package/node_modules/polygon-clipping/dist/polygon-clipping.d.ts +13 -10
  142. package/node_modules/polygon-clipping/dist/polygon-clipping.esm.js +1139 -1427
  143. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.js +1770 -1831
  144. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js +22 -8
  145. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js.map +1 -1
  146. package/node_modules/polygon-clipping/node_modules/robust-predicates/LICENSE +24 -0
  147. package/node_modules/polygon-clipping/node_modules/robust-predicates/README.md +82 -0
  148. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/incircle.js +765 -0
  149. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/insphere.js +766 -0
  150. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/orient2d.js +184 -0
  151. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/orient3d.js +462 -0
  152. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/util.js +138 -0
  153. package/node_modules/polygon-clipping/node_modules/robust-predicates/index.d.ts +49 -0
  154. package/node_modules/polygon-clipping/node_modules/robust-predicates/index.js +5 -0
  155. package/node_modules/polygon-clipping/node_modules/robust-predicates/package.json +75 -0
  156. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/incircle.js +908 -0
  157. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/incircle.min.js +1 -0
  158. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/insphere.js +914 -0
  159. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/insphere.min.js +1 -0
  160. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient2d.js +280 -0
  161. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient2d.min.js +1 -0
  162. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient3d.js +601 -0
  163. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient3d.min.js +1 -0
  164. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/predicates.js +2328 -0
  165. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/predicates.min.js +1 -0
  166. package/node_modules/polygon-clipping/package.json +30 -25
  167. package/node_modules/protobufjs/dist/light/protobuf.js +4 -4
  168. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  169. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  170. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  171. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  172. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  173. package/node_modules/protobufjs/dist/protobuf.js +4 -4
  174. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  175. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  176. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  177. package/node_modules/protobufjs/package.json +1 -1
  178. package/node_modules/protobufjs/src/root.js +2 -2
  179. package/node_modules/regexp.prototype.flags/CHANGELOG.md +13 -0
  180. package/node_modules/regexp.prototype.flags/implementation.js +2 -2
  181. package/node_modules/regexp.prototype.flags/package.json +11 -10
  182. package/node_modules/regexp.prototype.flags/test/tests.js +13 -13
  183. package/node_modules/set-function-length/CHANGELOG.md +18 -0
  184. package/node_modules/set-function-length/env.d.ts +6 -0
  185. package/node_modules/set-function-length/env.d.ts.map +1 -0
  186. package/node_modules/set-function-length/env.js +9 -4
  187. package/node_modules/set-function-length/index.d.ts +7 -0
  188. package/node_modules/set-function-length/index.d.ts.map +1 -0
  189. package/node_modules/set-function-length/index.js +6 -3
  190. package/node_modules/set-function-length/package.json +33 -13
  191. package/node_modules/set-function-length/tsconfig.json +59 -0
  192. package/node_modules/set-function-name/.eslintrc +1 -0
  193. package/node_modules/set-function-name/CHANGELOG.md +9 -0
  194. package/node_modules/set-function-name/index.d.ts +5 -0
  195. package/node_modules/set-function-name/index.js +4 -3
  196. package/node_modules/set-function-name/package.json +28 -9
  197. package/node_modules/set-function-name/tsconfig.json +59 -0
  198. package/package.json +4 -4
  199. package/tak-ingest.js +4 -0
  200. package/node_modules/define-data-property/index.d.ts.map +0 -1
  201. package/node_modules/hasown/index.d.ts.map +0 -1
  202. package/node_modules/polygon-clipping/CHANGELOG.md +0 -129
@@ -0,0 +1,601 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.predicates = {}));
5
+ })(this, (function (exports) { 'use strict';
6
+
7
+ const epsilon = 1.1102230246251565e-16;
8
+ const splitter = 134217729;
9
+ const resulterrbound = (3 + 8 * epsilon) * epsilon;
10
+
11
+ // fast_expansion_sum_zeroelim routine from oritinal code
12
+ function sum(elen, e, flen, f, h) {
13
+ let Q, Qnew, hh, bvirt;
14
+ let enow = e[0];
15
+ let fnow = f[0];
16
+ let eindex = 0;
17
+ let findex = 0;
18
+ if ((fnow > enow) === (fnow > -enow)) {
19
+ Q = enow;
20
+ enow = e[++eindex];
21
+ } else {
22
+ Q = fnow;
23
+ fnow = f[++findex];
24
+ }
25
+ let hindex = 0;
26
+ if (eindex < elen && findex < flen) {
27
+ if ((fnow > enow) === (fnow > -enow)) {
28
+ Qnew = enow + Q;
29
+ hh = Q - (Qnew - enow);
30
+ enow = e[++eindex];
31
+ } else {
32
+ Qnew = fnow + Q;
33
+ hh = Q - (Qnew - fnow);
34
+ fnow = f[++findex];
35
+ }
36
+ Q = Qnew;
37
+ if (hh !== 0) {
38
+ h[hindex++] = hh;
39
+ }
40
+ while (eindex < elen && findex < flen) {
41
+ if ((fnow > enow) === (fnow > -enow)) {
42
+ Qnew = Q + enow;
43
+ bvirt = Qnew - Q;
44
+ hh = Q - (Qnew - bvirt) + (enow - bvirt);
45
+ enow = e[++eindex];
46
+ } else {
47
+ Qnew = Q + fnow;
48
+ bvirt = Qnew - Q;
49
+ hh = Q - (Qnew - bvirt) + (fnow - bvirt);
50
+ fnow = f[++findex];
51
+ }
52
+ Q = Qnew;
53
+ if (hh !== 0) {
54
+ h[hindex++] = hh;
55
+ }
56
+ }
57
+ }
58
+ while (eindex < elen) {
59
+ Qnew = Q + enow;
60
+ bvirt = Qnew - Q;
61
+ hh = Q - (Qnew - bvirt) + (enow - bvirt);
62
+ enow = e[++eindex];
63
+ Q = Qnew;
64
+ if (hh !== 0) {
65
+ h[hindex++] = hh;
66
+ }
67
+ }
68
+ while (findex < flen) {
69
+ Qnew = Q + fnow;
70
+ bvirt = Qnew - Q;
71
+ hh = Q - (Qnew - bvirt) + (fnow - bvirt);
72
+ fnow = f[++findex];
73
+ Q = Qnew;
74
+ if (hh !== 0) {
75
+ h[hindex++] = hh;
76
+ }
77
+ }
78
+ if (Q !== 0 || hindex === 0) {
79
+ h[hindex++] = Q;
80
+ }
81
+ return hindex;
82
+ }
83
+
84
+ // scale_expansion_zeroelim routine from oritinal code
85
+ function scale(elen, e, b, h) {
86
+ let Q, sum, hh, product1, product0;
87
+ let bvirt, c, ahi, alo, bhi, blo;
88
+
89
+ c = splitter * b;
90
+ bhi = c - (c - b);
91
+ blo = b - bhi;
92
+ let enow = e[0];
93
+ Q = enow * b;
94
+ c = splitter * enow;
95
+ ahi = c - (c - enow);
96
+ alo = enow - ahi;
97
+ hh = alo * blo - (Q - ahi * bhi - alo * bhi - ahi * blo);
98
+ let hindex = 0;
99
+ if (hh !== 0) {
100
+ h[hindex++] = hh;
101
+ }
102
+ for (let i = 1; i < elen; i++) {
103
+ enow = e[i];
104
+ product1 = enow * b;
105
+ c = splitter * enow;
106
+ ahi = c - (c - enow);
107
+ alo = enow - ahi;
108
+ product0 = alo * blo - (product1 - ahi * bhi - alo * bhi - ahi * blo);
109
+ sum = Q + product0;
110
+ bvirt = sum - Q;
111
+ hh = Q - (sum - bvirt) + (product0 - bvirt);
112
+ if (hh !== 0) {
113
+ h[hindex++] = hh;
114
+ }
115
+ Q = product1 + sum;
116
+ hh = sum - (Q - product1);
117
+ if (hh !== 0) {
118
+ h[hindex++] = hh;
119
+ }
120
+ }
121
+ if (Q !== 0 || hindex === 0) {
122
+ h[hindex++] = Q;
123
+ }
124
+ return hindex;
125
+ }
126
+
127
+ function estimate(elen, e) {
128
+ let Q = e[0];
129
+ for (let i = 1; i < elen; i++) Q += e[i];
130
+ return Q;
131
+ }
132
+
133
+ function vec(n) {
134
+ return new Float64Array(n);
135
+ }
136
+
137
+ const o3derrboundA = (7 + 56 * epsilon) * epsilon;
138
+ const o3derrboundB = (3 + 28 * epsilon) * epsilon;
139
+ const o3derrboundC = (26 + 288 * epsilon) * epsilon * epsilon;
140
+
141
+ const bc = vec(4);
142
+ const ca = vec(4);
143
+ const ab = vec(4);
144
+ const at_b = vec(4);
145
+ const at_c = vec(4);
146
+ const bt_c = vec(4);
147
+ const bt_a = vec(4);
148
+ const ct_a = vec(4);
149
+ const ct_b = vec(4);
150
+ const bct = vec(8);
151
+ const cat = vec(8);
152
+ const abt = vec(8);
153
+ const u = vec(4);
154
+
155
+ const _8 = vec(8);
156
+ const _8b = vec(8);
157
+ const _16 = vec(8);
158
+ const _12 = vec(12);
159
+
160
+ let fin = vec(192);
161
+ let fin2 = vec(192);
162
+
163
+ function finadd(finlen, alen, a) {
164
+ finlen = sum(finlen, fin, alen, a, fin2);
165
+ const tmp = fin; fin = fin2; fin2 = tmp;
166
+ return finlen;
167
+ }
168
+
169
+ function tailinit(xtail, ytail, ax, ay, bx, by, a, b) {
170
+ let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3, negate;
171
+ if (xtail === 0) {
172
+ if (ytail === 0) {
173
+ a[0] = 0;
174
+ b[0] = 0;
175
+ return 1;
176
+ } else {
177
+ negate = -ytail;
178
+ s1 = negate * ax;
179
+ c = splitter * negate;
180
+ ahi = c - (c - negate);
181
+ alo = negate - ahi;
182
+ c = splitter * ax;
183
+ bhi = c - (c - ax);
184
+ blo = ax - bhi;
185
+ a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
186
+ a[1] = s1;
187
+ s1 = ytail * bx;
188
+ c = splitter * ytail;
189
+ ahi = c - (c - ytail);
190
+ alo = ytail - ahi;
191
+ c = splitter * bx;
192
+ bhi = c - (c - bx);
193
+ blo = bx - bhi;
194
+ b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
195
+ b[1] = s1;
196
+ return 2;
197
+ }
198
+ } else {
199
+ if (ytail === 0) {
200
+ s1 = xtail * ay;
201
+ c = splitter * xtail;
202
+ ahi = c - (c - xtail);
203
+ alo = xtail - ahi;
204
+ c = splitter * ay;
205
+ bhi = c - (c - ay);
206
+ blo = ay - bhi;
207
+ a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
208
+ a[1] = s1;
209
+ negate = -xtail;
210
+ s1 = negate * by;
211
+ c = splitter * negate;
212
+ ahi = c - (c - negate);
213
+ alo = negate - ahi;
214
+ c = splitter * by;
215
+ bhi = c - (c - by);
216
+ blo = by - bhi;
217
+ b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
218
+ b[1] = s1;
219
+ return 2;
220
+ } else {
221
+ s1 = xtail * ay;
222
+ c = splitter * xtail;
223
+ ahi = c - (c - xtail);
224
+ alo = xtail - ahi;
225
+ c = splitter * ay;
226
+ bhi = c - (c - ay);
227
+ blo = ay - bhi;
228
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
229
+ t1 = ytail * ax;
230
+ c = splitter * ytail;
231
+ ahi = c - (c - ytail);
232
+ alo = ytail - ahi;
233
+ c = splitter * ax;
234
+ bhi = c - (c - ax);
235
+ blo = ax - bhi;
236
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
237
+ _i = s0 - t0;
238
+ bvirt = s0 - _i;
239
+ a[0] = s0 - (_i + bvirt) + (bvirt - t0);
240
+ _j = s1 + _i;
241
+ bvirt = _j - s1;
242
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
243
+ _i = _0 - t1;
244
+ bvirt = _0 - _i;
245
+ a[1] = _0 - (_i + bvirt) + (bvirt - t1);
246
+ u3 = _j + _i;
247
+ bvirt = u3 - _j;
248
+ a[2] = _j - (u3 - bvirt) + (_i - bvirt);
249
+ a[3] = u3;
250
+ s1 = ytail * bx;
251
+ c = splitter * ytail;
252
+ ahi = c - (c - ytail);
253
+ alo = ytail - ahi;
254
+ c = splitter * bx;
255
+ bhi = c - (c - bx);
256
+ blo = bx - bhi;
257
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
258
+ t1 = xtail * by;
259
+ c = splitter * xtail;
260
+ ahi = c - (c - xtail);
261
+ alo = xtail - ahi;
262
+ c = splitter * by;
263
+ bhi = c - (c - by);
264
+ blo = by - bhi;
265
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
266
+ _i = s0 - t0;
267
+ bvirt = s0 - _i;
268
+ b[0] = s0 - (_i + bvirt) + (bvirt - t0);
269
+ _j = s1 + _i;
270
+ bvirt = _j - s1;
271
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
272
+ _i = _0 - t1;
273
+ bvirt = _0 - _i;
274
+ b[1] = _0 - (_i + bvirt) + (bvirt - t1);
275
+ u3 = _j + _i;
276
+ bvirt = u3 - _j;
277
+ b[2] = _j - (u3 - bvirt) + (_i - bvirt);
278
+ b[3] = u3;
279
+ return 4;
280
+ }
281
+ }
282
+ }
283
+
284
+ function tailadd(finlen, a, b, k, z) {
285
+ let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, u3;
286
+ s1 = a * b;
287
+ c = splitter * a;
288
+ ahi = c - (c - a);
289
+ alo = a - ahi;
290
+ c = splitter * b;
291
+ bhi = c - (c - b);
292
+ blo = b - bhi;
293
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
294
+ c = splitter * k;
295
+ bhi = c - (c - k);
296
+ blo = k - bhi;
297
+ _i = s0 * k;
298
+ c = splitter * s0;
299
+ ahi = c - (c - s0);
300
+ alo = s0 - ahi;
301
+ u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);
302
+ _j = s1 * k;
303
+ c = splitter * s1;
304
+ ahi = c - (c - s1);
305
+ alo = s1 - ahi;
306
+ _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);
307
+ _k = _i + _0;
308
+ bvirt = _k - _i;
309
+ u[1] = _i - (_k - bvirt) + (_0 - bvirt);
310
+ u3 = _j + _k;
311
+ u[2] = _k - (u3 - _j);
312
+ u[3] = u3;
313
+ finlen = finadd(finlen, 4, u);
314
+ if (z !== 0) {
315
+ c = splitter * z;
316
+ bhi = c - (c - z);
317
+ blo = z - bhi;
318
+ _i = s0 * z;
319
+ c = splitter * s0;
320
+ ahi = c - (c - s0);
321
+ alo = s0 - ahi;
322
+ u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);
323
+ _j = s1 * z;
324
+ c = splitter * s1;
325
+ ahi = c - (c - s1);
326
+ alo = s1 - ahi;
327
+ _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);
328
+ _k = _i + _0;
329
+ bvirt = _k - _i;
330
+ u[1] = _i - (_k - bvirt) + (_0 - bvirt);
331
+ u3 = _j + _k;
332
+ u[2] = _k - (u3 - _j);
333
+ u[3] = u3;
334
+ finlen = finadd(finlen, 4, u);
335
+ }
336
+ return finlen;
337
+ }
338
+
339
+ function orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent) {
340
+ let finlen;
341
+ let adxtail, bdxtail, cdxtail;
342
+ let adytail, bdytail, cdytail;
343
+ let adztail, bdztail, cdztail;
344
+ let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;
345
+
346
+ const adx = ax - dx;
347
+ const bdx = bx - dx;
348
+ const cdx = cx - dx;
349
+ const ady = ay - dy;
350
+ const bdy = by - dy;
351
+ const cdy = cy - dy;
352
+ const adz = az - dz;
353
+ const bdz = bz - dz;
354
+ const cdz = cz - dz;
355
+
356
+ s1 = bdx * cdy;
357
+ c = splitter * bdx;
358
+ ahi = c - (c - bdx);
359
+ alo = bdx - ahi;
360
+ c = splitter * cdy;
361
+ bhi = c - (c - cdy);
362
+ blo = cdy - bhi;
363
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
364
+ t1 = cdx * bdy;
365
+ c = splitter * cdx;
366
+ ahi = c - (c - cdx);
367
+ alo = cdx - ahi;
368
+ c = splitter * bdy;
369
+ bhi = c - (c - bdy);
370
+ blo = bdy - bhi;
371
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
372
+ _i = s0 - t0;
373
+ bvirt = s0 - _i;
374
+ bc[0] = s0 - (_i + bvirt) + (bvirt - t0);
375
+ _j = s1 + _i;
376
+ bvirt = _j - s1;
377
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
378
+ _i = _0 - t1;
379
+ bvirt = _0 - _i;
380
+ bc[1] = _0 - (_i + bvirt) + (bvirt - t1);
381
+ u3 = _j + _i;
382
+ bvirt = u3 - _j;
383
+ bc[2] = _j - (u3 - bvirt) + (_i - bvirt);
384
+ bc[3] = u3;
385
+ s1 = cdx * ady;
386
+ c = splitter * cdx;
387
+ ahi = c - (c - cdx);
388
+ alo = cdx - ahi;
389
+ c = splitter * ady;
390
+ bhi = c - (c - ady);
391
+ blo = ady - bhi;
392
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
393
+ t1 = adx * cdy;
394
+ c = splitter * adx;
395
+ ahi = c - (c - adx);
396
+ alo = adx - ahi;
397
+ c = splitter * cdy;
398
+ bhi = c - (c - cdy);
399
+ blo = cdy - bhi;
400
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
401
+ _i = s0 - t0;
402
+ bvirt = s0 - _i;
403
+ ca[0] = s0 - (_i + bvirt) + (bvirt - t0);
404
+ _j = s1 + _i;
405
+ bvirt = _j - s1;
406
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
407
+ _i = _0 - t1;
408
+ bvirt = _0 - _i;
409
+ ca[1] = _0 - (_i + bvirt) + (bvirt - t1);
410
+ u3 = _j + _i;
411
+ bvirt = u3 - _j;
412
+ ca[2] = _j - (u3 - bvirt) + (_i - bvirt);
413
+ ca[3] = u3;
414
+ s1 = adx * bdy;
415
+ c = splitter * adx;
416
+ ahi = c - (c - adx);
417
+ alo = adx - ahi;
418
+ c = splitter * bdy;
419
+ bhi = c - (c - bdy);
420
+ blo = bdy - bhi;
421
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
422
+ t1 = bdx * ady;
423
+ c = splitter * bdx;
424
+ ahi = c - (c - bdx);
425
+ alo = bdx - ahi;
426
+ c = splitter * ady;
427
+ bhi = c - (c - ady);
428
+ blo = ady - bhi;
429
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
430
+ _i = s0 - t0;
431
+ bvirt = s0 - _i;
432
+ ab[0] = s0 - (_i + bvirt) + (bvirt - t0);
433
+ _j = s1 + _i;
434
+ bvirt = _j - s1;
435
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
436
+ _i = _0 - t1;
437
+ bvirt = _0 - _i;
438
+ ab[1] = _0 - (_i + bvirt) + (bvirt - t1);
439
+ u3 = _j + _i;
440
+ bvirt = u3 - _j;
441
+ ab[2] = _j - (u3 - bvirt) + (_i - bvirt);
442
+ ab[3] = u3;
443
+
444
+ finlen = sum(
445
+ sum(
446
+ scale(4, bc, adz, _8), _8,
447
+ scale(4, ca, bdz, _8b), _8b, _16), _16,
448
+ scale(4, ab, cdz, _8), _8, fin);
449
+
450
+ let det = estimate(finlen, fin);
451
+ let errbound = o3derrboundB * permanent;
452
+ if (det >= errbound || -det >= errbound) {
453
+ return det;
454
+ }
455
+
456
+ bvirt = ax - adx;
457
+ adxtail = ax - (adx + bvirt) + (bvirt - dx);
458
+ bvirt = bx - bdx;
459
+ bdxtail = bx - (bdx + bvirt) + (bvirt - dx);
460
+ bvirt = cx - cdx;
461
+ cdxtail = cx - (cdx + bvirt) + (bvirt - dx);
462
+ bvirt = ay - ady;
463
+ adytail = ay - (ady + bvirt) + (bvirt - dy);
464
+ bvirt = by - bdy;
465
+ bdytail = by - (bdy + bvirt) + (bvirt - dy);
466
+ bvirt = cy - cdy;
467
+ cdytail = cy - (cdy + bvirt) + (bvirt - dy);
468
+ bvirt = az - adz;
469
+ adztail = az - (adz + bvirt) + (bvirt - dz);
470
+ bvirt = bz - bdz;
471
+ bdztail = bz - (bdz + bvirt) + (bvirt - dz);
472
+ bvirt = cz - cdz;
473
+ cdztail = cz - (cdz + bvirt) + (bvirt - dz);
474
+
475
+ if (adxtail === 0 && bdxtail === 0 && cdxtail === 0 &&
476
+ adytail === 0 && bdytail === 0 && cdytail === 0 &&
477
+ adztail === 0 && bdztail === 0 && cdztail === 0) {
478
+ return det;
479
+ }
480
+
481
+ errbound = o3derrboundC * permanent + resulterrbound * Math.abs(det);
482
+ det +=
483
+ adz * (bdx * cdytail + cdy * bdxtail - (bdy * cdxtail + cdx * bdytail)) + adztail * (bdx * cdy - bdy * cdx) +
484
+ bdz * (cdx * adytail + ady * cdxtail - (cdy * adxtail + adx * cdytail)) + bdztail * (cdx * ady - cdy * adx) +
485
+ cdz * (adx * bdytail + bdy * adxtail - (ady * bdxtail + bdx * adytail)) + cdztail * (adx * bdy - ady * bdx);
486
+ if (det >= errbound || -det >= errbound) {
487
+ return det;
488
+ }
489
+
490
+ const at_len = tailinit(adxtail, adytail, bdx, bdy, cdx, cdy, at_b, at_c);
491
+ const bt_len = tailinit(bdxtail, bdytail, cdx, cdy, adx, ady, bt_c, bt_a);
492
+ const ct_len = tailinit(cdxtail, cdytail, adx, ady, bdx, bdy, ct_a, ct_b);
493
+
494
+ const bctlen = sum(bt_len, bt_c, ct_len, ct_b, bct);
495
+ finlen = finadd(finlen, scale(bctlen, bct, adz, _16), _16);
496
+
497
+ const catlen = sum(ct_len, ct_a, at_len, at_c, cat);
498
+ finlen = finadd(finlen, scale(catlen, cat, bdz, _16), _16);
499
+
500
+ const abtlen = sum(at_len, at_b, bt_len, bt_a, abt);
501
+ finlen = finadd(finlen, scale(abtlen, abt, cdz, _16), _16);
502
+
503
+ if (adztail !== 0) {
504
+ finlen = finadd(finlen, scale(4, bc, adztail, _12), _12);
505
+ finlen = finadd(finlen, scale(bctlen, bct, adztail, _16), _16);
506
+ }
507
+ if (bdztail !== 0) {
508
+ finlen = finadd(finlen, scale(4, ca, bdztail, _12), _12);
509
+ finlen = finadd(finlen, scale(catlen, cat, bdztail, _16), _16);
510
+ }
511
+ if (cdztail !== 0) {
512
+ finlen = finadd(finlen, scale(4, ab, cdztail, _12), _12);
513
+ finlen = finadd(finlen, scale(abtlen, abt, cdztail, _16), _16);
514
+ }
515
+
516
+ if (adxtail !== 0) {
517
+ if (bdytail !== 0) {
518
+ finlen = tailadd(finlen, adxtail, bdytail, cdz, cdztail);
519
+ }
520
+ if (cdytail !== 0) {
521
+ finlen = tailadd(finlen, -adxtail, cdytail, bdz, bdztail);
522
+ }
523
+ }
524
+ if (bdxtail !== 0) {
525
+ if (cdytail !== 0) {
526
+ finlen = tailadd(finlen, bdxtail, cdytail, adz, adztail);
527
+ }
528
+ if (adytail !== 0) {
529
+ finlen = tailadd(finlen, -bdxtail, adytail, cdz, cdztail);
530
+ }
531
+ }
532
+ if (cdxtail !== 0) {
533
+ if (adytail !== 0) {
534
+ finlen = tailadd(finlen, cdxtail, adytail, bdz, bdztail);
535
+ }
536
+ if (bdytail !== 0) {
537
+ finlen = tailadd(finlen, -cdxtail, bdytail, adz, adztail);
538
+ }
539
+ }
540
+
541
+ return fin[finlen - 1];
542
+ }
543
+
544
+ function orient3d(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {
545
+ const adx = ax - dx;
546
+ const bdx = bx - dx;
547
+ const cdx = cx - dx;
548
+ const ady = ay - dy;
549
+ const bdy = by - dy;
550
+ const cdy = cy - dy;
551
+ const adz = az - dz;
552
+ const bdz = bz - dz;
553
+ const cdz = cz - dz;
554
+
555
+ const bdxcdy = bdx * cdy;
556
+ const cdxbdy = cdx * bdy;
557
+
558
+ const cdxady = cdx * ady;
559
+ const adxcdy = adx * cdy;
560
+
561
+ const adxbdy = adx * bdy;
562
+ const bdxady = bdx * ady;
563
+
564
+ const det =
565
+ adz * (bdxcdy - cdxbdy) +
566
+ bdz * (cdxady - adxcdy) +
567
+ cdz * (adxbdy - bdxady);
568
+
569
+ const permanent =
570
+ (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * Math.abs(adz) +
571
+ (Math.abs(cdxady) + Math.abs(adxcdy)) * Math.abs(bdz) +
572
+ (Math.abs(adxbdy) + Math.abs(bdxady)) * Math.abs(cdz);
573
+
574
+ const errbound = o3derrboundA * permanent;
575
+ if (det > errbound || -det > errbound) {
576
+ return det;
577
+ }
578
+
579
+ return orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent);
580
+ }
581
+
582
+ function orient3dfast(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {
583
+ const adx = ax - dx;
584
+ const bdx = bx - dx;
585
+ const cdx = cx - dx;
586
+ const ady = ay - dy;
587
+ const bdy = by - dy;
588
+ const cdy = cy - dy;
589
+ const adz = az - dz;
590
+ const bdz = bz - dz;
591
+ const cdz = cz - dz;
592
+
593
+ return adx * (bdy * cdz - bdz * cdy) +
594
+ bdx * (cdy * adz - cdz * ady) +
595
+ cdx * (ady * bdz - adz * bdy);
596
+ }
597
+
598
+ exports.orient3d = orient3d;
599
+ exports.orient3dfast = orient3dfast;
600
+
601
+ }));
@@ -0,0 +1 @@
1
+ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).predicates={})}(this,(function(t){"use strict";const n=11102230246251565e-32,e=134217729,o=(3+8*n)*n;function r(t,n,e,o,r){let f,s,u,i,a=n[0],c=o[0],l=0,b=0;c>a==c>-a?(f=a,a=n[++l]):(f=c,c=o[++b]);let h=0;if(l<t&&b<e)for(c>a==c>-a?(s=a+f,u=f-(s-a),a=n[++l]):(s=c+f,u=f-(s-c),c=o[++b]),f=s,0!==u&&(r[h++]=u);l<t&&b<e;)c>a==c>-a?(s=f+a,i=s-f,u=f-(s-i)+(a-i),a=n[++l]):(s=f+c,i=s-f,u=f-(s-i)+(c-i),c=o[++b]),f=s,0!==u&&(r[h++]=u);for(;l<t;)s=f+a,i=s-f,u=f-(s-i)+(a-i),a=n[++l],f=s,0!==u&&(r[h++]=u);for(;b<e;)s=f+c,i=s-f,u=f-(s-i)+(c-i),c=o[++b],f=s,0!==u&&(r[h++]=u);return 0===f&&0!==h||(r[h++]=f),h}function f(t,n,o,r){let f,s,u,i,a,c,l,b,h,d,M;l=e*o,d=l-(l-o),M=o-d;let p=n[0];f=p*o,l=e*p,b=l-(l-p),h=p-b,u=h*M-(f-b*d-h*d-b*M);let y=0;0!==u&&(r[y++]=u);for(let x=1;x<t;x++)p=n[x],i=p*o,l=e*p,b=l-(l-p),h=p-b,a=h*M-(i-b*d-h*d-b*M),s=f+a,c=s-f,u=f-(s-c)+(a-c),0!==u&&(r[y++]=u),f=i+s,u=s-(f-i),0!==u&&(r[y++]=u);return 0===f&&0!==y||(r[y++]=f),y}function s(t){return new Float64Array(t)}const u=3330669073875473e-31,i=32047474274603644e-47,a=s(4),c=s(4),l=s(4),b=s(4),h=s(4),d=s(4),M=s(4),p=s(4),y=s(4),x=s(8),g=s(8),m=s(8),T=s(4),j=s(8),w=s(8),A=s(8),F=s(12);let k=s(192),q=s(192);function v(t,n,e){t=r(t,k,n,e,q);const o=k;return k=q,q=o,t}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+(X-I),X=E-dt,S=E-(dt+X)+(X-I),X=s-Mt,U=s-(Mt+X)+(X-J),X=C-pt,V=C-(pt+X)+(X-J),X=G-yt,W=G-(yt+X)+(X-J),0===N&&0===O&&0===P&&0===Q&&0===R&&0===S&&0===U&&0===V&&0===W)return xt;if(gt=i*K+o*Math.abs(xt),xt+=Mt*(ct*S+dt*O-(ht*P+lt*R))+U*(ct*dt-ht*lt)+pt*(lt*Q+bt*P-(dt*N+at*S))+V*(lt*bt-dt*at)+yt*(at*R+ht*N-(bt*O+ct*Q))+W*(at*ht-bt*ct),xt>=gt||-xt>=gt)return xt;const mt=z(N,Q,ct,ht,lt,dt,b,h),Tt=z(O,R,lt,dt,at,bt,d,M),jt=z(P,S,at,bt,ct,ht,p,y),wt=r(Tt,d,jt,y,x);L=v(L,f(wt,x,Mt,A),A);const At=r(jt,p,mt,h,g);L=v(L,f(At,g,pt,A),A);const Ft=r(mt,b,Tt,M,m);return L=v(L,f(Ft,m,yt,A),A),0!==U&&(L=v(L,f(4,a,U,F),F),L=v(L,f(wt,x,U,A),A)),0!==V&&(L=v(L,f(4,c,V,F),F),L=v(L,f(At,g,V,A),A)),0!==W&&(L=v(L,f(4,l,W,F),F),L=v(L,f(Ft,m,W,A),A)),0!==N&&(0!==R&&(L=B(L,N,R,yt,W)),0!==S&&(L=B(L,-N,S,pt,V))),0!==O&&(0!==S&&(L=B(L,O,S,Mt,U)),0!==Q&&(L=B(L,-O,Q,yt,W))),0!==P&&(0!==Q&&(L=B(L,P,Q,pt,V)),0!==R&&(L=B(L,-P,R,Mt,U))),k[L-1]}(t,n,s,T,q,C,D,E,G,H,I,J,tt)},t.orient3dfast=function(t,n,e,o,r,f,s,u,i,a,c,l){const b=n-c,h=r-c,d=u-c,M=e-l,p=f-l,y=i-l;return(t-a)*(h*y-p*d)+(o-a)*(d*M-y*b)+(s-a)*(b*p-M*h)}}));