chunk-WOXHUQGM.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. import {
  2. f,
  3. o,
  4. r as r2
  5. } from "./chunk-FMPQIGFA.js";
  6. import {
  7. c,
  8. v as v2,
  9. y
  10. } from "./chunk-RMDDCMKS.js";
  11. import {
  12. m2 as m,
  13. v2 as v
  14. } from "./chunk-VCH45Q2I.js";
  15. import {
  16. U
  17. } from "./chunk-DVUG3KID.js";
  18. import {
  19. j
  20. } from "./chunk-VEGAOVMY.js";
  21. import {
  22. R as R2,
  23. j as j2
  24. } from "./chunk-6T6G6LCQ.js";
  25. import {
  26. R,
  27. k2 as k
  28. } from "./chunk-PQFTYGF5.js";
  29. import {
  30. s,
  31. s2,
  32. s3
  33. } from "./chunk-E5O6P5I2.js";
  34. import {
  35. r,
  36. t
  37. } from "./chunk-YXWMMD76.js";
  38. // node_modules/@arcgis/core/geometry/support/normalizeUtilsCommon.js
  39. var r3 = { 102100: { maxX: 20037508342788905e-9, minX: -20037508342788905e-9, plus180Line: new m({ paths: [[[20037508342788905e-9, -20037508342788905e-9], [20037508342788905e-9, 20037508342788905e-9]]], spatialReference: k.WebMercator }), minus180Line: new m({ paths: [[[-20037508342788905e-9, -20037508342788905e-9], [-20037508342788905e-9, 20037508342788905e-9]]], spatialReference: k.WebMercator }) }, 4326: { maxX: 180, minX: -180, plus180Line: new m({ paths: [[[180, -180], [180, 180]]], spatialReference: k.WGS84 }), minus180Line: new m({ paths: [[[-180, -180], [-180, 180]]], spatialReference: k.WGS84 }) } };
  40. function i(e, n) {
  41. return Math.ceil((e - n) / (2 * n));
  42. }
  43. function s4(e, n) {
  44. const t2 = o2(e);
  45. for (const r4 of t2)
  46. for (const e2 of r4)
  47. e2[0] += n;
  48. return e;
  49. }
  50. function o2(e) {
  51. return y(e) ? e.rings : e.paths;
  52. }
  53. // node_modules/@arcgis/core/rest/geometryService/cut.js
  54. async function o3(o5, i2, n, m2) {
  55. const a = f(o5), p = i2[0].spatialReference, u = { ...m2, query: { ...a.query, f: "json", sr: JSON.stringify(p), target: JSON.stringify({ geometryType: c(i2[0]), geometries: i2 }), cutter: JSON.stringify(n) } }, c2 = await U(a.path + "/cut", u), { cutIndexes: f2, geometries: g = [] } = c2.data;
  56. return { cutIndexes: f2, geometries: g.map((e) => {
  57. const t2 = v2(e);
  58. return t2.spatialReference = p, t2;
  59. }) };
  60. }
  61. // node_modules/@arcgis/core/rest/geometryService/simplify.js
  62. async function o4(o5, m2, f2) {
  63. const n = "string" == typeof o5 ? j(o5) : o5, p = m2[0].spatialReference, a = c(m2[0]), u = { ...f2, query: { ...n.query, f: "json", sr: p.wkid ? p.wkid : JSON.stringify(p), geometries: JSON.stringify(r2(m2)) } }, { data: y3 } = await U(n.path + "/simplify", u);
  64. return o(y3.geometries, a, p);
  65. }
  66. // node_modules/@arcgis/core/geometry/support/normalizeUtils.js
  67. var y2 = s2.getLogger("esri.geometry.support.normalizeUtils");
  68. function x(e) {
  69. return "polygon" === e.type;
  70. }
  71. function d(e) {
  72. return "polygon" === e[0].type;
  73. }
  74. function w(e) {
  75. return "polyline" === e[0].type;
  76. }
  77. function M(e, n) {
  78. if (!(e instanceof m || e instanceof v)) {
  79. const e2 = "straightLineDensify: the input geometry is neither polyline nor polygon";
  80. throw y2.error(e2), new s3(e2);
  81. }
  82. const o5 = o2(e), s5 = [];
  83. for (const t2 of o5) {
  84. const e2 = [];
  85. s5.push(e2), e2.push([t2[0][0], t2[0][1]]);
  86. for (let o6 = 0; o6 < t2.length - 1; o6++) {
  87. const s6 = t2[o6][0], r4 = t2[o6][1], i2 = t2[o6 + 1][0], l = t2[o6 + 1][1], f2 = Math.sqrt((i2 - s6) * (i2 - s6) + (l - r4) * (l - r4)), c2 = (l - r4) / f2, p = (i2 - s6) / f2, u = f2 / n;
  88. if (u > 1) {
  89. for (let l2 = 1; l2 <= u - 1; l2++) {
  90. const t4 = l2 * n, o8 = p * t4 + s6, i4 = c2 * t4 + r4;
  91. e2.push([o8, i4]);
  92. }
  93. const t3 = (f2 + Math.floor(u - 1) * n) / 2, o7 = p * t3 + s6, i3 = c2 * t3 + r4;
  94. e2.push([o7, i3]);
  95. }
  96. e2.push([i2, l]);
  97. }
  98. }
  99. return x(e) ? new v({ rings: s5, spatialReference: e.spatialReference }) : new m({ paths: s5, spatialReference: e.spatialReference });
  100. }
  101. function R3(e, t2, n) {
  102. if (t2) {
  103. const t3 = M(e, 1e6);
  104. e = j2(t3, true);
  105. }
  106. return n && (e = s4(e, n)), e;
  107. }
  108. function b(e, t2, n) {
  109. if (Array.isArray(e)) {
  110. const o5 = e[0];
  111. if (o5 > t2) {
  112. const n2 = i(o5, t2);
  113. e[0] = o5 + n2 * (-2 * t2);
  114. } else if (o5 < n) {
  115. const t3 = i(o5, n);
  116. e[0] = o5 + t3 * (-2 * n);
  117. }
  118. } else {
  119. const o5 = e.x;
  120. if (o5 > t2) {
  121. const n2 = i(o5, t2);
  122. e = e.clone().offset(n2 * (-2 * t2), 0);
  123. } else if (o5 < n) {
  124. const t3 = i(o5, n);
  125. e = e.clone().offset(t3 * (-2 * n), 0);
  126. }
  127. }
  128. return e;
  129. }
  130. function P(e, t2) {
  131. let n = -1;
  132. for (let o5 = 0; o5 < t2.cutIndexes.length; o5++) {
  133. const s5 = t2.cutIndexes[o5], r4 = t2.geometries[o5], i2 = o2(r4);
  134. for (let e2 = 0; e2 < i2.length; e2++) {
  135. const t3 = i2[e2];
  136. t3.some((n2) => {
  137. if (n2[0] < 180)
  138. return true;
  139. {
  140. let n3 = 0;
  141. for (let e3 = 0; e3 < t3.length; e3++) {
  142. const o7 = t3[e3][0];
  143. n3 = o7 > n3 ? o7 : n3;
  144. }
  145. n3 = Number(n3.toFixed(9));
  146. const o6 = -360 * i(n3, 180);
  147. for (let s6 = 0; s6 < t3.length; s6++) {
  148. const t4 = r4.getPoint(e2, s6);
  149. r4.setPoint(e2, s6, t4.clone().offset(o6, 0));
  150. }
  151. return true;
  152. }
  153. });
  154. }
  155. if (s5 === n) {
  156. if (d(e))
  157. for (const t3 of o2(r4))
  158. e[s5] = e[s5].addRing(t3);
  159. else if (w(e))
  160. for (const t3 of o2(r4))
  161. e[s5] = e[s5].addPath(t3);
  162. } else
  163. n = s5, e[s5] = r4;
  164. }
  165. return e;
  166. }
  167. async function v3(t2, n, l) {
  168. var _a;
  169. if (!Array.isArray(t2))
  170. return v3([t2], n);
  171. n && "string" != typeof n && y2.warn("normalizeCentralMeridian()", "The url object is deprecated, use the url string instead");
  172. const h = "string" == typeof n ? n : (_a = n == null ? void 0 : n.url) != null ? _a : s.geometryServiceUrl;
  173. let x2, d2, w2, j3, M2, L, U3, z, A = 0;
  174. const S = [], k2 = [];
  175. for (const e of t2)
  176. if (t(e))
  177. k2.push(e);
  178. else if (x2 || (x2 = e.spatialReference, d2 = R(x2), w2 = x2.isWebMercator, L = w2 ? 102100 : 4326, j3 = r3[L].maxX, M2 = r3[L].minX, U3 = r3[L].plus180Line, z = r3[L].minus180Line), d2)
  179. if ("mesh" === e.type)
  180. k2.push(e);
  181. else if ("point" === e.type)
  182. k2.push(b(e.clone(), j3, M2));
  183. else if ("multipoint" === e.type) {
  184. const t3 = e.clone();
  185. t3.points = t3.points.map((e2) => b(e2, j3, M2)), k2.push(t3);
  186. } else if ("extent" === e.type) {
  187. const t3 = e.clone()._normalize(false, false, d2);
  188. k2.push(t3.rings ? new v(t3) : t3);
  189. } else if (e.extent) {
  190. const t3 = e.extent, n2 = i(t3.xmin, M2) * (2 * j3);
  191. let o5 = 0 === n2 ? e.clone() : s4(e.clone(), n2);
  192. t3.offset(n2, 0), t3.intersects(U3) && t3.xmax !== j3 ? (A = t3.xmax > A ? t3.xmax : A, o5 = R3(o5, w2), S.push(o5), k2.push("cut")) : t3.intersects(z) && t3.xmin !== M2 ? (A = t3.xmax * (2 * j3) > A ? t3.xmax * (2 * j3) : A, o5 = R3(o5, w2, 360), S.push(o5), k2.push("cut")) : k2.push(o5);
  193. } else
  194. k2.push(e.clone());
  195. else
  196. k2.push(e);
  197. let C = i(A, j3), I = -90;
  198. const X = C, q = new m();
  199. for (; C > 0; ) {
  200. const e = 360 * C - 180;
  201. q.addPath([[e, I], [e, -1 * I]]), I *= -1, C--;
  202. }
  203. if (S.length > 0 && X > 0) {
  204. const e = P(S, await o3(h, S, q, l)), n2 = [], o5 = [];
  205. for (let l2 = 0; l2 < k2.length; l2++) {
  206. const r5 = k2[l2];
  207. if ("cut" !== r5)
  208. o5.push(r5);
  209. else {
  210. const r6 = e.shift(), i3 = t2[l2];
  211. r(i3) && "polygon" === i3.type && i3.rings && i3.rings.length > 1 && r6.rings.length >= i3.rings.length ? (n2.push(r6), o5.push("simplify")) : o5.push(w2 ? R2(r6) : r6);
  212. }
  213. }
  214. if (!n2.length)
  215. return o5;
  216. const r4 = await o4(h, n2, l), i2 = [];
  217. for (let t3 = 0; t3 < o5.length; t3++) {
  218. const e2 = o5[t3];
  219. "simplify" !== e2 ? i2.push(e2) : i2.push(w2 ? R2(r4.shift()) : r4.shift());
  220. }
  221. return i2;
  222. }
  223. const D = [];
  224. for (let e = 0; e < k2.length; e++) {
  225. const t3 = k2[e];
  226. if ("cut" !== t3)
  227. D.push(t3);
  228. else {
  229. const e2 = S.shift();
  230. D.push(true === w2 ? R2(e2) : e2);
  231. }
  232. }
  233. return D;
  234. }
  235. function U2(e, t2) {
  236. const n = R(t2);
  237. if (n) {
  238. const [t3, o5] = n.valid, s5 = o5 - t3;
  239. if (e < t3)
  240. for (; e < t3; )
  241. e += s5;
  242. if (e > o5)
  243. for (; e > o5; )
  244. e -= s5;
  245. }
  246. return e;
  247. }
  248. export {
  249. r3 as r,
  250. i,
  251. s4 as s,
  252. v3 as v,
  253. U2 as U
  254. };
  255. //# sourceMappingURL=chunk-WOXHUQGM.js.map