@hybridcore/ui 1.0.2 → 1.1.2

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 (105) hide show
  1. package/dist/ButtonBase-BYmh3G5j.js +967 -0
  2. package/dist/CardContent-C8PxkJz4.js +73 -0
  3. package/dist/Checkbox-DostZSwR.js +673 -0
  4. package/dist/DialogContent-2aPOjKE7.js +2025 -0
  5. package/dist/FormControl-BiAFm76F.js +1491 -0
  6. package/dist/IconButton-CQJ8wZE8.js +183 -0
  7. package/dist/Input-Bf5G3tFN.js +324 -0
  8. package/dist/OutlinedInput-BEVE8VZQ.js +452 -0
  9. package/dist/Paper-CaiWdndQ.js +162 -0
  10. package/dist/Select-DxpxZbJp.js +2526 -0
  11. package/dist/Source-CnCcu5UP.js +4374 -0
  12. package/dist/Text-BT5kPHOo.js +2192 -0
  13. package/dist/Typography-XIiVCSto.js +178 -0
  14. package/dist/assertThisInitialized-BUtkG-md.js +13 -0
  15. package/dist/assets/index.css +1 -0
  16. package/dist/assets/index2.css +1 -0
  17. package/dist/chainPropTypes-DtBfUj5o.js +96 -0
  18. package/dist/components/access/helpers.js +32 -0
  19. package/dist/components/access/index.js +15 -0
  20. package/dist/components/card/index.js +159 -469
  21. package/dist/components/card/styled.js +75 -7
  22. package/dist/components/conditional-wrapper/index.js +9 -0
  23. package/dist/components/confirm/dialog.js +151 -0
  24. package/dist/components/confirm/index.js +23 -0
  25. package/dist/components/container/index.js +270 -0
  26. package/dist/components/context-menu/index.js +973 -0
  27. package/dist/components/data-management/instance-form/components/composite-list/index.js +12 -0
  28. package/dist/components/data-management/instance-form/components/composite-list/styled.js +64 -0
  29. package/dist/components/data-management/instance-form/components/policy-list/index.js +86 -0
  30. package/dist/components/data-management/instance-form/components/variable/index.js +15 -0
  31. package/dist/components/data-management/instance-form/components/variables/index.js +39 -0
  32. package/dist/components/data-management/instance-form/index.js +437 -0
  33. package/dist/components/data-security-selectors/dissemination-list/index.js +3201 -0
  34. package/dist/components/data-security-selectors/security-level/index.js +81 -0
  35. package/dist/components/date-time-picker/index.js +103 -0
  36. package/dist/components/geometry-picker/coordinate/index.js +93 -0
  37. package/dist/components/geometry-picker/edit/index.js +71 -0
  38. package/dist/components/geometry-picker/geometry/index.js +160 -0
  39. package/dist/components/geometry-picker/geometry/map-overlay.js +22 -0
  40. package/dist/components/geometry-picker/index.js +140 -0
  41. package/dist/components/geometry-picker/kml/index.js +62 -0
  42. package/dist/components/geometry-picker/kml/select-input-method.js +75 -0
  43. package/dist/components/geometry-picker/logic.js +69 -0
  44. package/dist/components/geometry-picker/map/index.js +42 -0
  45. package/dist/components/geometry-picker/map/logic.js +2360 -0
  46. package/dist/components/geometry-picker/map/style.js +88 -0
  47. package/dist/components/geometry-picker/parser/coordinate-input/index.js +78 -0
  48. package/dist/components/geometry-picker/parser/coordinate-input/logic.js +1305 -0
  49. package/dist/components/geometry-picker/parser/index.js +179 -0
  50. package/dist/components/geometry-picker/parser/logic.js +84 -0
  51. package/dist/components/geometry-picker/parser/styled.js +25 -0
  52. package/dist/components/geometry-picker/styled.js +48 -0
  53. package/dist/components/geometry-picker/wkt/index.js +59 -0
  54. package/dist/components/geometry-picker/wkt/select-input-method.js +75 -0
  55. package/dist/components/icon-button/index.js +18 -0
  56. package/dist/components/icon-button/styled.js +51 -0
  57. package/dist/components/key-protection/index.js +4 -0
  58. package/dist/components/key-protection/menu.js +85 -0
  59. package/dist/components/key-protection/utils.js +10 -0
  60. package/dist/components/loading/index.js +7 -0
  61. package/dist/components/loading/styled.js +16 -0
  62. package/dist/components/map/helpers/kml.js +45 -0
  63. package/dist/components/map/helpers/mapbox.js +48 -0
  64. package/dist/components/map/helpers/ol.js +25 -0
  65. package/dist/components/map/helpers/wkt.js +29 -0
  66. package/dist/components/map/index.js +8 -0
  67. package/dist/components/map/logic.js +140 -0
  68. package/dist/components/map/styled.js +8 -0
  69. package/dist/components/phone-input/index.js +25 -0
  70. package/dist/components/phone-input/styled.js +26 -0
  71. package/dist/components/search-input/index.js +76 -0
  72. package/dist/components/tree-select/index.js +70 -0
  73. package/dist/components/tree-select/styled.js +64 -0
  74. package/dist/components/treeview-filter/index.js +621 -0
  75. package/dist/components/treeview-filter/item/index.js +7 -0
  76. package/dist/components/treeview-filter/item-label/index.js +44 -0
  77. package/dist/createTheme-agWfFD64.js +2392 -0
  78. package/dist/exactProp-CI8dagM-.js +36 -0
  79. package/dist/extends-C3382pL0.js +22 -0
  80. package/dist/has-9_asnBxn.js +688 -0
  81. package/dist/hooks/useMenuLogic.js +21 -0
  82. package/dist/hooks/useToggle.js +23 -0
  83. package/dist/index-Bw_m9ult.js +1105 -0
  84. package/dist/index-IvOfmM1F.js +34 -0
  85. package/dist/index-wW2D1aTG.js +957 -0
  86. package/dist/isHostComponent-kiaBvYVo.js +6 -0
  87. package/dist/isMuiElement-CxT3_ACP.js +13 -0
  88. package/dist/listItemTextClasses-BvXFz-Oc.js +132 -0
  89. package/dist/main.d.ts +1317 -0
  90. package/dist/main.js +41 -2
  91. package/dist/ol-DXmSLlWv.js +15041 -0
  92. package/dist/ownerDocument-CUrv0DIK.js +6 -0
  93. package/dist/ownerWindow-niciwP7I.js +7 -0
  94. package/dist/styled-C43K9x7T.js +229 -0
  95. package/dist/styled-Iq9jsO4F.js +1033 -0
  96. package/dist/useFormControl-CatNKXAi.js +10 -0
  97. package/dist/useId-BHG98T5I.js +26 -0
  98. package/dist/useTheme-C0Dky5rV.js +17 -0
  99. package/dist/useTheme-CeyGVuQP.js +10 -0
  100. package/dist/useThemeProps-CzAjOL6F.js +26 -0
  101. package/dist/utils/ontology.js +37 -0
  102. package/dist/utils-Bq0ye5vf.js +115 -0
  103. package/dist/utils-DLpkeyhZ.js +365 -0
  104. package/package.json +26 -5
  105. package/dist/styled-BG5UIpPU.js +0 -3459
@@ -0,0 +1,2192 @@
1
+ import { d as w, b as v, W as j, f as ae, c as le, h as N, I as he, u as ce, E as O, i as m, j as oe, g as ue } from "./has-9_asnBxn.js";
2
+ const ge = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i, fe = /^([a-z]*)$|^hsla?\(.*\)$/i;
3
+ function $(i) {
4
+ return typeof i == "string" ? i : ee(i);
5
+ }
6
+ function de(i) {
7
+ const e = document.createElement("div");
8
+ if (e.style.color = i, e.style.color !== "") {
9
+ document.body.appendChild(e);
10
+ const t = getComputedStyle(e).color;
11
+ return document.body.removeChild(e), t;
12
+ }
13
+ return "";
14
+ }
15
+ const _e = /* @__PURE__ */ function() {
16
+ const e = {};
17
+ let t = 0;
18
+ return (
19
+ /**
20
+ * @param {string} s String.
21
+ * @return {Color} Color.
22
+ */
23
+ function(n) {
24
+ let s;
25
+ if (e.hasOwnProperty(n))
26
+ s = e[n];
27
+ else {
28
+ if (t >= 1024) {
29
+ let r = 0;
30
+ for (const a in e)
31
+ r++ & 3 || (delete e[a], --t);
32
+ }
33
+ s = me(n), e[n] = s, ++t;
34
+ }
35
+ return s;
36
+ }
37
+ );
38
+ }();
39
+ function Q(i) {
40
+ return Array.isArray(i) ? i : _e(i);
41
+ }
42
+ function me(i) {
43
+ let e, t, n, s, r;
44
+ if (fe.exec(i) && (i = de(i)), ge.exec(i)) {
45
+ const a = i.length - 1;
46
+ let l;
47
+ a <= 4 ? l = 1 : l = 2;
48
+ const o = a === 4 || a === 8;
49
+ e = parseInt(i.substr(1 + 0 * l, l), 16), t = parseInt(i.substr(1 + 1 * l, l), 16), n = parseInt(i.substr(1 + 2 * l, l), 16), o ? s = parseInt(i.substr(1 + 3 * l, l), 16) : s = 255, l == 1 && (e = (e << 4) + e, t = (t << 4) + t, n = (n << 4) + n, o && (s = (s << 4) + s)), r = [e, t, n, s / 255];
50
+ } else i.startsWith("rgba(") ? (r = i.slice(5, -1).split(",").map(Number), J(r)) : i.startsWith("rgb(") ? (r = i.slice(4, -1).split(",").map(Number), r.push(1), J(r)) : w(!1, 14);
51
+ return r;
52
+ }
53
+ function J(i) {
54
+ return i[0] = v(i[0] + 0.5 | 0, 0, 255), i[1] = v(i[1] + 0.5 | 0, 0, 255), i[2] = v(i[2] + 0.5 | 0, 0, 255), i[3] = v(i[3], 0, 1), i;
55
+ }
56
+ function ee(i) {
57
+ let e = i[0];
58
+ e != (e | 0) && (e = e + 0.5 | 0);
59
+ let t = i[1];
60
+ t != (t | 0) && (t = t + 0.5 | 0);
61
+ let n = i[2];
62
+ n != (n | 0) && (n = n + 0.5 | 0);
63
+ const s = i[3] === void 0 ? 1 : Math.round(i[3] * 100) / 100;
64
+ return "rgba(" + e + "," + t + "," + n + "," + s + ")";
65
+ }
66
+ class ye {
67
+ constructor() {
68
+ this.cache_ = {}, this.cacheSize_ = 0, this.maxCacheSize_ = 32;
69
+ }
70
+ /**
71
+ * FIXME empty description for jsdoc
72
+ */
73
+ clear() {
74
+ this.cache_ = {}, this.cacheSize_ = 0;
75
+ }
76
+ /**
77
+ * @return {boolean} Can expire cache.
78
+ */
79
+ canExpireCache() {
80
+ return this.cacheSize_ > this.maxCacheSize_;
81
+ }
82
+ /**
83
+ * FIXME empty description for jsdoc
84
+ */
85
+ expire() {
86
+ if (this.canExpireCache()) {
87
+ let e = 0;
88
+ for (const t in this.cache_) {
89
+ const n = this.cache_[t];
90
+ !(e++ & 3) && !n.hasListener() && (delete this.cache_[t], --this.cacheSize_);
91
+ }
92
+ }
93
+ }
94
+ /**
95
+ * @param {string} src Src.
96
+ * @param {?string} crossOrigin Cross origin.
97
+ * @param {import("../color.js").Color} color Color.
98
+ * @return {import("./IconImage.js").default} Icon image.
99
+ */
100
+ get(e, t, n) {
101
+ const s = X(e, t, n);
102
+ return s in this.cache_ ? this.cache_[s] : null;
103
+ }
104
+ /**
105
+ * @param {string} src Src.
106
+ * @param {?string} crossOrigin Cross origin.
107
+ * @param {import("../color.js").Color} color Color.
108
+ * @param {import("./IconImage.js").default} iconImage Icon image.
109
+ */
110
+ set(e, t, n, s) {
111
+ const r = X(e, t, n);
112
+ this.cache_[r] = s, ++this.cacheSize_;
113
+ }
114
+ /**
115
+ * Set the cache size of the icon cache. Default is `32`. Change this value when
116
+ * your map uses more than 32 different icon images and you are not caching icon
117
+ * styles on the application level.
118
+ * @param {number} maxCacheSize Cache max size.
119
+ * @api
120
+ */
121
+ setSize(e) {
122
+ this.maxCacheSize_ = e, this.expire();
123
+ }
124
+ }
125
+ function X(i, e, t) {
126
+ const n = t ? $(t) : "null";
127
+ return e + ":" + i + ":" + n;
128
+ }
129
+ const U = new ye(), Me = "ol-hidden", Ee = "ol-unselectable", Re = "ol-control", be = "ol-collapsed", Se = new RegExp(
130
+ [
131
+ "^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)",
132
+ "(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)",
133
+ "(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)",
134
+ "(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?",
135
+ "(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))",
136
+ "(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",
137
+ `?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`
138
+ ].join(""),
139
+ "i"
140
+ ), Y = [
141
+ "style",
142
+ "variant",
143
+ "weight",
144
+ "size",
145
+ "lineHeight",
146
+ "family"
147
+ ], te = function(i) {
148
+ const e = i.match(Se);
149
+ if (!e)
150
+ return null;
151
+ const t = (
152
+ /** @type {FontParameters} */
153
+ {
154
+ lineHeight: "normal",
155
+ size: "1.2em",
156
+ style: "normal",
157
+ weight: "normal",
158
+ variant: "normal"
159
+ }
160
+ );
161
+ for (let n = 0, s = Y.length; n < s; ++n) {
162
+ const r = e[n + 1];
163
+ r !== void 0 && (t[Y[n]] = r);
164
+ }
165
+ return t.families = t.family.split(/,\s?/), t;
166
+ };
167
+ function L(i, e, t, n) {
168
+ let s;
169
+ return t && t.length ? s = t.shift() : j ? s = new OffscreenCanvas(i || 300, e || 300) : s = document.createElement("canvas"), i && (s.width = i), e && (s.height = e), /** @type {CanvasRenderingContext2D} */
170
+ s.getContext("2d", n);
171
+ }
172
+ function Fe(i) {
173
+ const e = i.canvas;
174
+ e.width = 1, e.height = 1, i.clearRect(0, 0, 1, 1);
175
+ }
176
+ function We(i, e) {
177
+ const t = e.parentNode;
178
+ t && t.replaceChild(i, e);
179
+ }
180
+ function Te(i) {
181
+ return i && i.parentNode ? i.parentNode.removeChild(i) : null;
182
+ }
183
+ function Pe(i) {
184
+ for (; i.lastChild; )
185
+ i.removeChild(i.lastChild);
186
+ }
187
+ function Ve(i, e) {
188
+ const t = i.childNodes;
189
+ for (let n = 0; ; ++n) {
190
+ const s = t[n], r = e[n];
191
+ if (!s && !r)
192
+ break;
193
+ if (s !== r) {
194
+ if (!s) {
195
+ i.appendChild(r);
196
+ continue;
197
+ }
198
+ if (!r) {
199
+ i.removeChild(s), --n;
200
+ continue;
201
+ }
202
+ i.insertBefore(r, s);
203
+ }
204
+ }
205
+ }
206
+ const He = "10px sans-serif", G = "#000", Be = "round", Ne = [], Je = 0, p = "round", Ie = 10, De = "#000", Xe = "center", Ue = "middle", Ye = [0, 0, 0, 0], we = 1, y = new ae();
207
+ let D = null, T;
208
+ const P = {}, Ge = function() {
209
+ const e = "32px ", t = ["monospace", "serif"], n = t.length, s = "wmytzilWMYTZIL@#/&?$%10";
210
+ let r, a;
211
+ function l(c, h, u) {
212
+ let f = !0;
213
+ for (let g = 0; g < n; ++g) {
214
+ const d = t[g];
215
+ if (a = x(
216
+ c + " " + h + " " + e + d,
217
+ s
218
+ ), u != d) {
219
+ const I = x(
220
+ c + " " + h + " " + e + u + "," + d,
221
+ s
222
+ );
223
+ f = f && I != a;
224
+ }
225
+ }
226
+ return !!f;
227
+ }
228
+ function o() {
229
+ let c = !0;
230
+ const h = y.getKeys();
231
+ for (let u = 0, f = h.length; u < f; ++u) {
232
+ const g = h[u];
233
+ y.get(g) < 100 && (l.apply(this, g.split(`
234
+ `)) ? (le(P), D = null, T = void 0, y.set(g, 100)) : (y.set(g, y.get(g) + 1, !0), c = !1));
235
+ }
236
+ c && (clearInterval(r), r = void 0);
237
+ }
238
+ return function(c) {
239
+ const h = te(c);
240
+ if (!h)
241
+ return;
242
+ const u = h.families;
243
+ for (let f = 0, g = u.length; f < g; ++f) {
244
+ const d = u[f], I = h.style + `
245
+ ` + h.weight + `
246
+ ` + d;
247
+ y.get(I) === void 0 && (y.set(I, 100, !0), l(h.style, h.weight, d) || (y.set(I, 0, !0), r === void 0 && (r = setInterval(o, 32))));
248
+ }
249
+ };
250
+ }(), Ae = /* @__PURE__ */ function() {
251
+ let i;
252
+ return function(e) {
253
+ let t = P[e];
254
+ if (t == null) {
255
+ if (j) {
256
+ const n = te(e), s = ie(e, "Žg");
257
+ t = (isNaN(Number(n.lineHeight)) ? 1.2 : Number(n.lineHeight)) * (s.actualBoundingBoxAscent + s.actualBoundingBoxDescent);
258
+ } else
259
+ i || (i = document.createElement("div"), i.innerHTML = "M", i.style.minHeight = "0", i.style.maxHeight = "none", i.style.height = "auto", i.style.padding = "0", i.style.border = "none", i.style.position = "absolute", i.style.display = "block", i.style.left = "-99999px"), i.style.font = e, document.body.appendChild(i), t = i.offsetHeight, document.body.removeChild(i);
260
+ P[e] = t;
261
+ }
262
+ return t;
263
+ };
264
+ }();
265
+ function ie(i, e) {
266
+ return D || (D = L(1, 1)), i != T && (D.font = i, T = D.font), D.measureText(e);
267
+ }
268
+ function x(i, e) {
269
+ return ie(i, e).width;
270
+ }
271
+ function pe(i, e, t) {
272
+ if (e in t)
273
+ return t[e];
274
+ const n = e.split(`
275
+ `).reduce((s, r) => Math.max(s, x(i, r)), 0);
276
+ return t[e] = n, n;
277
+ }
278
+ function qe(i, e) {
279
+ const t = [], n = [], s = [];
280
+ let r = 0, a = 0, l = 0, o = 0;
281
+ for (let c = 0, h = e.length; c <= h; c += 2) {
282
+ const u = e[c];
283
+ if (u === `
284
+ ` || c === h) {
285
+ r = Math.max(r, a), s.push(a), a = 0, l += o;
286
+ continue;
287
+ }
288
+ const f = e[c + 1] || i.font, g = x(f, u);
289
+ t.push(g), a += g;
290
+ const d = Ae(f);
291
+ n.push(d), o = Math.max(o, d);
292
+ }
293
+ return { width: r, height: l, widths: t, heights: n, lineWidths: s };
294
+ }
295
+ function Ze(i, e, t, n, s, r, a, l, o, c, h) {
296
+ i.save(), t !== 1 && (i.globalAlpha *= t), e && i.setTransform.apply(i, e), /** @type {*} */
297
+ n.contextInstructions ? (i.translate(o, c), i.scale(h[0], h[1]), Ce(
298
+ /** @type {Label} */
299
+ n,
300
+ i
301
+ )) : h[0] < 0 || h[1] < 0 ? (i.translate(o, c), i.scale(h[0], h[1]), i.drawImage(
302
+ /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */
303
+ n,
304
+ s,
305
+ r,
306
+ a,
307
+ l,
308
+ 0,
309
+ 0,
310
+ a,
311
+ l
312
+ )) : i.drawImage(
313
+ /** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */
314
+ n,
315
+ s,
316
+ r,
317
+ a,
318
+ l,
319
+ o,
320
+ c,
321
+ a * h[0],
322
+ l * h[1]
323
+ ), i.restore();
324
+ }
325
+ function Ce(i, e) {
326
+ const t = i.contextInstructions;
327
+ for (let n = 0, s = t.length; n < s; n += 2)
328
+ Array.isArray(t[n + 1]) ? e[t[n]].apply(
329
+ e,
330
+ t[n + 1]
331
+ ) : e[t[n]] = t[n + 1];
332
+ }
333
+ function Ke(i) {
334
+ return i[0] > 0 && i[1] > 0;
335
+ }
336
+ function M(i, e) {
337
+ return Array.isArray(i) ? i : (e === void 0 ? e = [i, i] : (e[0] = i, e[1] = i), e);
338
+ }
339
+ const _ = {
340
+ IDLE: 0,
341
+ LOADING: 1,
342
+ LOADED: 2,
343
+ ERROR: 3,
344
+ EMPTY: 4
345
+ };
346
+ function ke(i, e, t) {
347
+ const n = (
348
+ /** @type {HTMLImageElement} */
349
+ i
350
+ );
351
+ let s = !0, r = !1, a = !1;
352
+ const l = [
353
+ N(n, O.LOAD, function() {
354
+ a = !0, r || e();
355
+ })
356
+ ];
357
+ return n.src && he ? (r = !0, n.decode().then(function() {
358
+ s && e();
359
+ }).catch(function(o) {
360
+ s && (a ? e() : t());
361
+ })) : l.push(N(n, O.ERROR, t)), function() {
362
+ s = !1, l.forEach(ce);
363
+ };
364
+ }
365
+ class C {
366
+ /**
367
+ * @param {Options} [options] Options.
368
+ */
369
+ constructor(e) {
370
+ e = e || {}, this.color_ = e.color !== void 0 ? e.color : null;
371
+ }
372
+ /**
373
+ * Clones the style. The color is not cloned if it is an {@link module:ol/colorlike~ColorLike}.
374
+ * @return {Fill} The cloned style.
375
+ * @api
376
+ */
377
+ clone() {
378
+ const e = this.getColor();
379
+ return new C({
380
+ color: Array.isArray(e) ? e.slice() : e || void 0
381
+ });
382
+ }
383
+ /**
384
+ * Get the fill color.
385
+ * @return {import("../color.js").Color|import("../colorlike.js").ColorLike|null} Color.
386
+ * @api
387
+ */
388
+ getColor() {
389
+ return this.color_;
390
+ }
391
+ /**
392
+ * Set the color.
393
+ *
394
+ * @param {import("../color.js").Color|import("../colorlike.js").ColorLike|null} color Color.
395
+ * @api
396
+ */
397
+ setColor(e) {
398
+ this.color_ = e;
399
+ }
400
+ }
401
+ class E {
402
+ /**
403
+ * @param {Options} options Options.
404
+ */
405
+ constructor(e) {
406
+ this.opacity_ = e.opacity, this.rotateWithView_ = e.rotateWithView, this.rotation_ = e.rotation, this.scale_ = e.scale, this.scaleArray_ = M(e.scale), this.displacement_ = e.displacement, this.declutterMode_ = e.declutterMode;
407
+ }
408
+ /**
409
+ * Clones the style.
410
+ * @return {ImageStyle} The cloned style.
411
+ * @api
412
+ */
413
+ clone() {
414
+ const e = this.getScale();
415
+ return new E({
416
+ opacity: this.getOpacity(),
417
+ scale: Array.isArray(e) ? e.slice() : e,
418
+ rotation: this.getRotation(),
419
+ rotateWithView: this.getRotateWithView(),
420
+ displacement: this.getDisplacement().slice(),
421
+ declutterMode: this.getDeclutterMode()
422
+ });
423
+ }
424
+ /**
425
+ * Get the symbolizer opacity.
426
+ * @return {number} Opacity.
427
+ * @api
428
+ */
429
+ getOpacity() {
430
+ return this.opacity_;
431
+ }
432
+ /**
433
+ * Determine whether the symbolizer rotates with the map.
434
+ * @return {boolean} Rotate with map.
435
+ * @api
436
+ */
437
+ getRotateWithView() {
438
+ return this.rotateWithView_;
439
+ }
440
+ /**
441
+ * Get the symoblizer rotation.
442
+ * @return {number} Rotation.
443
+ * @api
444
+ */
445
+ getRotation() {
446
+ return this.rotation_;
447
+ }
448
+ /**
449
+ * Get the symbolizer scale.
450
+ * @return {number|import("../size.js").Size} Scale.
451
+ * @api
452
+ */
453
+ getScale() {
454
+ return this.scale_;
455
+ }
456
+ /**
457
+ * Get the symbolizer scale array.
458
+ * @return {import("../size.js").Size} Scale array.
459
+ */
460
+ getScaleArray() {
461
+ return this.scaleArray_;
462
+ }
463
+ /**
464
+ * Get the displacement of the shape
465
+ * @return {Array<number>} Shape's center displacement
466
+ * @api
467
+ */
468
+ getDisplacement() {
469
+ return this.displacement_;
470
+ }
471
+ /**
472
+ * Get the declutter mode of the shape
473
+ * @return {"declutter"|"obstacle"|"none"|undefined} Shape's declutter mode
474
+ * @api
475
+ */
476
+ getDeclutterMode() {
477
+ return this.declutterMode_;
478
+ }
479
+ /**
480
+ * Get the anchor point in pixels. The anchor determines the center point for the
481
+ * symbolizer.
482
+ * @abstract
483
+ * @return {Array<number>} Anchor.
484
+ */
485
+ getAnchor() {
486
+ return m();
487
+ }
488
+ /**
489
+ * Get the image element for the symbolizer.
490
+ * @abstract
491
+ * @param {number} pixelRatio Pixel ratio.
492
+ * @return {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} Image element.
493
+ */
494
+ getImage(e) {
495
+ return m();
496
+ }
497
+ /**
498
+ * @abstract
499
+ * @return {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} Image element.
500
+ */
501
+ getHitDetectionImage() {
502
+ return m();
503
+ }
504
+ /**
505
+ * Get the image pixel ratio.
506
+ * @param {number} pixelRatio Pixel ratio.
507
+ * @return {number} Pixel ratio.
508
+ */
509
+ getPixelRatio(e) {
510
+ return 1;
511
+ }
512
+ /**
513
+ * @abstract
514
+ * @return {import("../ImageState.js").default} Image state.
515
+ */
516
+ getImageState() {
517
+ return m();
518
+ }
519
+ /**
520
+ * @abstract
521
+ * @return {import("../size.js").Size} Image size.
522
+ */
523
+ getImageSize() {
524
+ return m();
525
+ }
526
+ /**
527
+ * Get the origin of the symbolizer.
528
+ * @abstract
529
+ * @return {Array<number>} Origin.
530
+ */
531
+ getOrigin() {
532
+ return m();
533
+ }
534
+ /**
535
+ * Get the size of the symbolizer (in pixels).
536
+ * @abstract
537
+ * @return {import("../size.js").Size} Size.
538
+ */
539
+ getSize() {
540
+ return m();
541
+ }
542
+ /**
543
+ * Set the displacement.
544
+ *
545
+ * @param {Array<number>} displacement Displacement.
546
+ * @api
547
+ */
548
+ setDisplacement(e) {
549
+ this.displacement_ = e;
550
+ }
551
+ /**
552
+ * Set the opacity.
553
+ *
554
+ * @param {number} opacity Opacity.
555
+ * @api
556
+ */
557
+ setOpacity(e) {
558
+ this.opacity_ = e;
559
+ }
560
+ /**
561
+ * Set whether to rotate the style with the view.
562
+ *
563
+ * @param {boolean} rotateWithView Rotate with map.
564
+ * @api
565
+ */
566
+ setRotateWithView(e) {
567
+ this.rotateWithView_ = e;
568
+ }
569
+ /**
570
+ * Set the rotation.
571
+ *
572
+ * @param {number} rotation Rotation.
573
+ * @api
574
+ */
575
+ setRotation(e) {
576
+ this.rotation_ = e;
577
+ }
578
+ /**
579
+ * Set the scale.
580
+ *
581
+ * @param {number|import("../size.js").Size} scale Scale.
582
+ * @api
583
+ */
584
+ setScale(e) {
585
+ this.scale_ = e, this.scaleArray_ = M(e);
586
+ }
587
+ /**
588
+ * @abstract
589
+ * @param {function(import("../events/Event.js").default): void} listener Listener function.
590
+ */
591
+ listenImageChange(e) {
592
+ m();
593
+ }
594
+ /**
595
+ * Load not yet loaded URI.
596
+ * @abstract
597
+ */
598
+ load() {
599
+ m();
600
+ }
601
+ /**
602
+ * @abstract
603
+ * @param {function(import("../events/Event.js").default): void} listener Listener function.
604
+ */
605
+ unlistenImageChange(e) {
606
+ m();
607
+ }
608
+ }
609
+ let z = null;
610
+ class ze extends oe {
611
+ /**
612
+ * @param {HTMLImageElement|HTMLCanvasElement} image Image.
613
+ * @param {string|undefined} src Src.
614
+ * @param {import("../size.js").Size} size Size.
615
+ * @param {?string} crossOrigin Cross origin.
616
+ * @param {import("../ImageState.js").default} imageState Image state.
617
+ * @param {import("../color.js").Color} color Color.
618
+ */
619
+ constructor(e, t, n, s, r, a) {
620
+ super(), this.hitDetectionImage_ = null, this.image_ = e, this.crossOrigin_ = s, this.canvas_ = {}, this.color_ = a, this.unlisten_ = null, this.imageState_ = r, this.size_ = n, this.src_ = t, this.tainted_;
621
+ }
622
+ /**
623
+ * @private
624
+ */
625
+ initializeImage_() {
626
+ this.image_ = new Image(), this.crossOrigin_ !== null && (this.image_.crossOrigin = this.crossOrigin_);
627
+ }
628
+ /**
629
+ * @private
630
+ * @return {boolean} The image canvas is tainted.
631
+ */
632
+ isTainted_() {
633
+ if (this.tainted_ === void 0 && this.imageState_ === _.LOADED) {
634
+ z || (z = L(1, 1, void 0, {
635
+ willReadFrequently: !0
636
+ })), z.drawImage(this.image_, 0, 0);
637
+ try {
638
+ z.getImageData(0, 0, 1, 1), this.tainted_ = !1;
639
+ } catch {
640
+ z = null, this.tainted_ = !0;
641
+ }
642
+ }
643
+ return this.tainted_ === !0;
644
+ }
645
+ /**
646
+ * @private
647
+ */
648
+ dispatchChangeEvent_() {
649
+ this.dispatchEvent(O.CHANGE);
650
+ }
651
+ /**
652
+ * @private
653
+ */
654
+ handleImageError_() {
655
+ this.imageState_ = _.ERROR, this.unlistenImage_(), this.dispatchChangeEvent_();
656
+ }
657
+ /**
658
+ * @private
659
+ */
660
+ handleImageLoad_() {
661
+ this.imageState_ = _.LOADED, this.size_ ? (this.image_.width = this.size_[0], this.image_.height = this.size_[1]) : this.size_ = [this.image_.width, this.image_.height], this.unlistenImage_(), this.dispatchChangeEvent_();
662
+ }
663
+ /**
664
+ * @param {number} pixelRatio Pixel ratio.
665
+ * @return {HTMLImageElement|HTMLCanvasElement} Image or Canvas element.
666
+ */
667
+ getImage(e) {
668
+ return this.image_ || this.initializeImage_(), this.replaceColor_(e), this.canvas_[e] ? this.canvas_[e] : this.image_;
669
+ }
670
+ /**
671
+ * @param {number} pixelRatio Pixel ratio.
672
+ * @return {number} Image or Canvas element.
673
+ */
674
+ getPixelRatio(e) {
675
+ return this.replaceColor_(e), this.canvas_[e] ? e : 1;
676
+ }
677
+ /**
678
+ * @return {import("../ImageState.js").default} Image state.
679
+ */
680
+ getImageState() {
681
+ return this.imageState_;
682
+ }
683
+ /**
684
+ * @return {HTMLImageElement|HTMLCanvasElement} Image element.
685
+ */
686
+ getHitDetectionImage() {
687
+ if (this.image_ || this.initializeImage_(), !this.hitDetectionImage_)
688
+ if (this.isTainted_()) {
689
+ const e = this.size_[0], t = this.size_[1], n = L(e, t);
690
+ n.fillRect(0, 0, e, t), this.hitDetectionImage_ = n.canvas;
691
+ } else
692
+ this.hitDetectionImage_ = this.image_;
693
+ return this.hitDetectionImage_;
694
+ }
695
+ /**
696
+ * Get the size of the icon (in pixels).
697
+ * @return {import("../size.js").Size} Image size.
698
+ */
699
+ getSize() {
700
+ return this.size_;
701
+ }
702
+ /**
703
+ * @return {string|undefined} Image src.
704
+ */
705
+ getSrc() {
706
+ return this.src_;
707
+ }
708
+ /**
709
+ * Load not yet loaded URI.
710
+ */
711
+ load() {
712
+ if (this.imageState_ === _.IDLE) {
713
+ this.image_ || this.initializeImage_(), this.imageState_ = _.LOADING;
714
+ try {
715
+ this.image_.src = this.src_;
716
+ } catch {
717
+ this.handleImageError_();
718
+ }
719
+ this.unlisten_ = ke(
720
+ this.image_,
721
+ this.handleImageLoad_.bind(this),
722
+ this.handleImageError_.bind(this)
723
+ );
724
+ }
725
+ }
726
+ /**
727
+ * @param {number} pixelRatio Pixel ratio.
728
+ * @private
729
+ */
730
+ replaceColor_(e) {
731
+ if (!this.color_ || this.canvas_[e] || this.imageState_ !== _.LOADED)
732
+ return;
733
+ const t = this.image_, n = document.createElement("canvas");
734
+ n.width = Math.ceil(t.width * e), n.height = Math.ceil(t.height * e);
735
+ const s = n.getContext("2d");
736
+ s.scale(e, e), s.drawImage(t, 0, 0), s.globalCompositeOperation = "multiply", s.fillStyle = $(this.color_), s.fillRect(0, 0, n.width / e, n.height / e), s.globalCompositeOperation = "destination-in", s.drawImage(t, 0, 0), this.canvas_[e] = n;
737
+ }
738
+ /**
739
+ * Discards event handlers which listen for load completion or errors.
740
+ *
741
+ * @private
742
+ */
743
+ unlistenImage_() {
744
+ this.unlisten_ && (this.unlisten_(), this.unlisten_ = null);
745
+ }
746
+ }
747
+ function Oe(i, e, t, n, s, r) {
748
+ let a = U.get(e, n, r);
749
+ return a || (a = new ze(i, e, t, n, s, r), U.set(e, n, r, a)), a;
750
+ }
751
+ function q(i, e, t, n) {
752
+ return t !== void 0 && n !== void 0 ? [t / i, n / e] : t !== void 0 ? t / i : n !== void 0 ? n / e : 1;
753
+ }
754
+ class ne extends E {
755
+ /**
756
+ * @param {Options} [options] Options.
757
+ */
758
+ constructor(e) {
759
+ e = e || {};
760
+ const t = e.opacity !== void 0 ? e.opacity : 1, n = e.rotation !== void 0 ? e.rotation : 0, s = e.scale !== void 0 ? e.scale : 1, r = e.rotateWithView !== void 0 ? e.rotateWithView : !1;
761
+ super({
762
+ opacity: t,
763
+ rotation: n,
764
+ scale: s,
765
+ displacement: e.displacement !== void 0 ? e.displacement : [0, 0],
766
+ rotateWithView: r,
767
+ declutterMode: e.declutterMode
768
+ }), this.anchor_ = e.anchor !== void 0 ? e.anchor : [0.5, 0.5], this.normalizedAnchor_ = null, this.anchorOrigin_ = e.anchorOrigin !== void 0 ? e.anchorOrigin : "top-left", this.anchorXUnits_ = e.anchorXUnits !== void 0 ? e.anchorXUnits : "fraction", this.anchorYUnits_ = e.anchorYUnits !== void 0 ? e.anchorYUnits : "fraction", this.crossOrigin_ = e.crossOrigin !== void 0 ? e.crossOrigin : null;
769
+ const a = e.img !== void 0 ? e.img : null;
770
+ this.imgSize_ = e.imgSize;
771
+ let l = e.src;
772
+ w(!(l !== void 0 && a), 4), w(!a || a && this.imgSize_, 5), (l === void 0 || l.length === 0) && a && (l = /** @type {HTMLImageElement} */
773
+ a.src || ue(a)), w(l !== void 0 && l.length > 0, 6), w(
774
+ !((e.width !== void 0 || e.height !== void 0) && e.scale !== void 0),
775
+ 69
776
+ );
777
+ const o = e.src !== void 0 ? _.IDLE : _.LOADED;
778
+ if (this.color_ = e.color !== void 0 ? Q(e.color) : null, this.iconImage_ = Oe(
779
+ a,
780
+ /** @type {string} */
781
+ l,
782
+ this.imgSize_ !== void 0 ? this.imgSize_ : null,
783
+ this.crossOrigin_,
784
+ o,
785
+ this.color_
786
+ ), this.offset_ = e.offset !== void 0 ? e.offset : [0, 0], this.offsetOrigin_ = e.offsetOrigin !== void 0 ? e.offsetOrigin : "top-left", this.origin_ = null, this.size_ = e.size !== void 0 ? e.size : null, e.width !== void 0 || e.height !== void 0) {
787
+ let c, h;
788
+ if (e.size)
789
+ [c, h] = e.size;
790
+ else {
791
+ const u = this.getImage(1);
792
+ if (u instanceof HTMLCanvasElement || u.src && u.complete)
793
+ c = u.width, h = u.height;
794
+ else {
795
+ this.initialOptions_ = e;
796
+ const f = () => {
797
+ if (this.unlistenImageChange(f), !this.initialOptions_)
798
+ return;
799
+ const g = this.iconImage_.getSize();
800
+ this.setScale(
801
+ q(
802
+ g[0],
803
+ g[1],
804
+ e.width,
805
+ e.height
806
+ )
807
+ );
808
+ };
809
+ this.listenImageChange(f);
810
+ return;
811
+ }
812
+ }
813
+ c !== void 0 && this.setScale(
814
+ q(c, h, e.width, e.height)
815
+ );
816
+ }
817
+ }
818
+ /**
819
+ * Clones the style. The underlying Image/HTMLCanvasElement is not cloned.
820
+ * @return {Icon} The cloned style.
821
+ * @api
822
+ */
823
+ clone() {
824
+ let e, t, n;
825
+ return this.initialOptions_ ? (t = this.initialOptions_.width, n = this.initialOptions_.height) : (e = this.getScale(), e = Array.isArray(e) ? e.slice() : e), new ne({
826
+ anchor: this.anchor_.slice(),
827
+ anchorOrigin: this.anchorOrigin_,
828
+ anchorXUnits: this.anchorXUnits_,
829
+ anchorYUnits: this.anchorYUnits_,
830
+ color: this.color_ && this.color_.slice ? this.color_.slice() : this.color_ || void 0,
831
+ crossOrigin: this.crossOrigin_,
832
+ imgSize: this.imgSize_,
833
+ offset: this.offset_.slice(),
834
+ offsetOrigin: this.offsetOrigin_,
835
+ opacity: this.getOpacity(),
836
+ rotateWithView: this.getRotateWithView(),
837
+ rotation: this.getRotation(),
838
+ scale: e,
839
+ width: t,
840
+ height: n,
841
+ size: this.size_ !== null ? this.size_.slice() : void 0,
842
+ src: this.getSrc(),
843
+ displacement: this.getDisplacement().slice(),
844
+ declutterMode: this.getDeclutterMode()
845
+ });
846
+ }
847
+ /**
848
+ * Get the anchor point in pixels. The anchor determines the center point for the
849
+ * symbolizer.
850
+ * @return {Array<number>} Anchor.
851
+ * @api
852
+ */
853
+ getAnchor() {
854
+ let e = this.normalizedAnchor_;
855
+ if (!e) {
856
+ e = this.anchor_;
857
+ const s = this.getSize();
858
+ if (this.anchorXUnits_ == "fraction" || this.anchorYUnits_ == "fraction") {
859
+ if (!s)
860
+ return null;
861
+ e = this.anchor_.slice(), this.anchorXUnits_ == "fraction" && (e[0] *= s[0]), this.anchorYUnits_ == "fraction" && (e[1] *= s[1]);
862
+ }
863
+ if (this.anchorOrigin_ != "top-left") {
864
+ if (!s)
865
+ return null;
866
+ e === this.anchor_ && (e = this.anchor_.slice()), (this.anchorOrigin_ == "top-right" || this.anchorOrigin_ == "bottom-right") && (e[0] = -e[0] + s[0]), (this.anchorOrigin_ == "bottom-left" || this.anchorOrigin_ == "bottom-right") && (e[1] = -e[1] + s[1]);
867
+ }
868
+ this.normalizedAnchor_ = e;
869
+ }
870
+ const t = this.getDisplacement(), n = this.getScaleArray();
871
+ return [
872
+ e[0] - t[0] / n[0],
873
+ e[1] + t[1] / n[1]
874
+ ];
875
+ }
876
+ /**
877
+ * Set the anchor point. The anchor determines the center point for the
878
+ * symbolizer.
879
+ *
880
+ * @param {Array<number>} anchor Anchor.
881
+ * @api
882
+ */
883
+ setAnchor(e) {
884
+ this.anchor_ = e, this.normalizedAnchor_ = null;
885
+ }
886
+ /**
887
+ * Get the icon color.
888
+ * @return {import("../color.js").Color} Color.
889
+ * @api
890
+ */
891
+ getColor() {
892
+ return this.color_;
893
+ }
894
+ /**
895
+ * Get the image icon.
896
+ * @param {number} pixelRatio Pixel ratio.
897
+ * @return {HTMLImageElement|HTMLCanvasElement} Image or Canvas element.
898
+ * @api
899
+ */
900
+ getImage(e) {
901
+ return this.iconImage_.getImage(e);
902
+ }
903
+ /**
904
+ * Get the pixel ratio.
905
+ * @param {number} pixelRatio Pixel ratio.
906
+ * @return {number} The pixel ratio of the image.
907
+ * @api
908
+ */
909
+ getPixelRatio(e) {
910
+ return this.iconImage_.getPixelRatio(e);
911
+ }
912
+ /**
913
+ * @return {import("../size.js").Size} Image size.
914
+ */
915
+ getImageSize() {
916
+ return this.iconImage_.getSize();
917
+ }
918
+ /**
919
+ * @return {import("../ImageState.js").default} Image state.
920
+ */
921
+ getImageState() {
922
+ return this.iconImage_.getImageState();
923
+ }
924
+ /**
925
+ * @return {HTMLImageElement|HTMLCanvasElement} Image element.
926
+ */
927
+ getHitDetectionImage() {
928
+ return this.iconImage_.getHitDetectionImage();
929
+ }
930
+ /**
931
+ * Get the origin of the symbolizer.
932
+ * @return {Array<number>} Origin.
933
+ * @api
934
+ */
935
+ getOrigin() {
936
+ if (this.origin_)
937
+ return this.origin_;
938
+ let e = this.offset_;
939
+ if (this.offsetOrigin_ != "top-left") {
940
+ const t = this.getSize(), n = this.iconImage_.getSize();
941
+ if (!t || !n)
942
+ return null;
943
+ e = e.slice(), (this.offsetOrigin_ == "top-right" || this.offsetOrigin_ == "bottom-right") && (e[0] = n[0] - t[0] - e[0]), (this.offsetOrigin_ == "bottom-left" || this.offsetOrigin_ == "bottom-right") && (e[1] = n[1] - t[1] - e[1]);
944
+ }
945
+ return this.origin_ = e, this.origin_;
946
+ }
947
+ /**
948
+ * Get the image URL.
949
+ * @return {string|undefined} Image src.
950
+ * @api
951
+ */
952
+ getSrc() {
953
+ return this.iconImage_.getSrc();
954
+ }
955
+ /**
956
+ * Get the size of the icon (in pixels).
957
+ * @return {import("../size.js").Size} Image size.
958
+ * @api
959
+ */
960
+ getSize() {
961
+ return this.size_ ? this.size_ : this.iconImage_.getSize();
962
+ }
963
+ /**
964
+ * Get the width of the icon (in pixels). Will return undefined when the icon image is not yet loaded.
965
+ * @return {number} Icon width (in pixels).
966
+ * @api
967
+ */
968
+ getWidth() {
969
+ const e = this.getScaleArray();
970
+ if (this.size_)
971
+ return this.size_[0] * e[0];
972
+ if (this.iconImage_.getImageState() == _.LOADED)
973
+ return this.iconImage_.getSize()[0] * e[0];
974
+ }
975
+ /**
976
+ * Get the height of the icon (in pixels). Will return undefined when the icon image is not yet loaded.
977
+ * @return {number} Icon height (in pixels).
978
+ * @api
979
+ */
980
+ getHeight() {
981
+ const e = this.getScaleArray();
982
+ if (this.size_)
983
+ return this.size_[1] * e[1];
984
+ if (this.iconImage_.getImageState() == _.LOADED)
985
+ return this.iconImage_.getSize()[1] * e[1];
986
+ }
987
+ /**
988
+ * Set the scale.
989
+ *
990
+ * @param {number|import("../size.js").Size} scale Scale.
991
+ * @api
992
+ */
993
+ setScale(e) {
994
+ delete this.initialOptions_, super.setScale(e);
995
+ }
996
+ /**
997
+ * @param {function(import("../events/Event.js").default): void} listener Listener function.
998
+ */
999
+ listenImageChange(e) {
1000
+ this.iconImage_.addEventListener(O.CHANGE, e);
1001
+ }
1002
+ /**
1003
+ * Load not yet loaded URI.
1004
+ * When rendering a feature with an icon style, the vector renderer will
1005
+ * automatically call this method. However, you might want to call this
1006
+ * method yourself for preloading or other purposes.
1007
+ * @api
1008
+ */
1009
+ load() {
1010
+ this.iconImage_.load();
1011
+ }
1012
+ /**
1013
+ * @param {function(import("../events/Event.js").default): void} listener Listener function.
1014
+ */
1015
+ unlistenImageChange(e) {
1016
+ this.iconImage_.removeEventListener(O.CHANGE, e);
1017
+ }
1018
+ }
1019
+ class A {
1020
+ /**
1021
+ * @param {Options} [options] Options.
1022
+ */
1023
+ constructor(e) {
1024
+ e = e || {}, this.color_ = e.color !== void 0 ? e.color : null, this.lineCap_ = e.lineCap, this.lineDash_ = e.lineDash !== void 0 ? e.lineDash : null, this.lineDashOffset_ = e.lineDashOffset, this.lineJoin_ = e.lineJoin, this.miterLimit_ = e.miterLimit, this.width_ = e.width;
1025
+ }
1026
+ /**
1027
+ * Clones the style.
1028
+ * @return {Stroke} The cloned style.
1029
+ * @api
1030
+ */
1031
+ clone() {
1032
+ const e = this.getColor();
1033
+ return new A({
1034
+ color: Array.isArray(e) ? e.slice() : e || void 0,
1035
+ lineCap: this.getLineCap(),
1036
+ lineDash: this.getLineDash() ? this.getLineDash().slice() : void 0,
1037
+ lineDashOffset: this.getLineDashOffset(),
1038
+ lineJoin: this.getLineJoin(),
1039
+ miterLimit: this.getMiterLimit(),
1040
+ width: this.getWidth()
1041
+ });
1042
+ }
1043
+ /**
1044
+ * Get the stroke color.
1045
+ * @return {import("../color.js").Color|import("../colorlike.js").ColorLike} Color.
1046
+ * @api
1047
+ */
1048
+ getColor() {
1049
+ return this.color_;
1050
+ }
1051
+ /**
1052
+ * Get the line cap type for the stroke.
1053
+ * @return {CanvasLineCap|undefined} Line cap.
1054
+ * @api
1055
+ */
1056
+ getLineCap() {
1057
+ return this.lineCap_;
1058
+ }
1059
+ /**
1060
+ * Get the line dash style for the stroke.
1061
+ * @return {Array<number>|null} Line dash.
1062
+ * @api
1063
+ */
1064
+ getLineDash() {
1065
+ return this.lineDash_;
1066
+ }
1067
+ /**
1068
+ * Get the line dash offset for the stroke.
1069
+ * @return {number|undefined} Line dash offset.
1070
+ * @api
1071
+ */
1072
+ getLineDashOffset() {
1073
+ return this.lineDashOffset_;
1074
+ }
1075
+ /**
1076
+ * Get the line join type for the stroke.
1077
+ * @return {CanvasLineJoin|undefined} Line join.
1078
+ * @api
1079
+ */
1080
+ getLineJoin() {
1081
+ return this.lineJoin_;
1082
+ }
1083
+ /**
1084
+ * Get the miter limit for the stroke.
1085
+ * @return {number|undefined} Miter limit.
1086
+ * @api
1087
+ */
1088
+ getMiterLimit() {
1089
+ return this.miterLimit_;
1090
+ }
1091
+ /**
1092
+ * Get the stroke width.
1093
+ * @return {number|undefined} Width.
1094
+ * @api
1095
+ */
1096
+ getWidth() {
1097
+ return this.width_;
1098
+ }
1099
+ /**
1100
+ * Set the color.
1101
+ *
1102
+ * @param {import("../color.js").Color|import("../colorlike.js").ColorLike} color Color.
1103
+ * @api
1104
+ */
1105
+ setColor(e) {
1106
+ this.color_ = e;
1107
+ }
1108
+ /**
1109
+ * Set the line cap.
1110
+ *
1111
+ * @param {CanvasLineCap|undefined} lineCap Line cap.
1112
+ * @api
1113
+ */
1114
+ setLineCap(e) {
1115
+ this.lineCap_ = e;
1116
+ }
1117
+ /**
1118
+ * Set the line dash.
1119
+ *
1120
+ * @param {Array<number>|null} lineDash Line dash.
1121
+ * @api
1122
+ */
1123
+ setLineDash(e) {
1124
+ this.lineDash_ = e;
1125
+ }
1126
+ /**
1127
+ * Set the line dash offset.
1128
+ *
1129
+ * @param {number|undefined} lineDashOffset Line dash offset.
1130
+ * @api
1131
+ */
1132
+ setLineDashOffset(e) {
1133
+ this.lineDashOffset_ = e;
1134
+ }
1135
+ /**
1136
+ * Set the line join.
1137
+ *
1138
+ * @param {CanvasLineJoin|undefined} lineJoin Line join.
1139
+ * @api
1140
+ */
1141
+ setLineJoin(e) {
1142
+ this.lineJoin_ = e;
1143
+ }
1144
+ /**
1145
+ * Set the miter limit.
1146
+ *
1147
+ * @param {number|undefined} miterLimit Miter limit.
1148
+ * @api
1149
+ */
1150
+ setMiterLimit(e) {
1151
+ this.miterLimit_ = e;
1152
+ }
1153
+ /**
1154
+ * Set the width.
1155
+ *
1156
+ * @param {number|undefined} width Width.
1157
+ * @api
1158
+ */
1159
+ setWidth(e) {
1160
+ this.width_ = e;
1161
+ }
1162
+ }
1163
+ function Z(i) {
1164
+ return Array.isArray(i) ? ee(i) : i;
1165
+ }
1166
+ class V extends E {
1167
+ /**
1168
+ * @param {Options} options Options.
1169
+ */
1170
+ constructor(e) {
1171
+ const t = e.rotateWithView !== void 0 ? e.rotateWithView : !1;
1172
+ super({
1173
+ opacity: 1,
1174
+ rotateWithView: t,
1175
+ rotation: e.rotation !== void 0 ? e.rotation : 0,
1176
+ scale: e.scale !== void 0 ? e.scale : 1,
1177
+ displacement: e.displacement !== void 0 ? e.displacement : [0, 0],
1178
+ declutterMode: e.declutterMode
1179
+ }), this.canvas_ = void 0, this.hitDetectionCanvas_ = null, this.fill_ = e.fill !== void 0 ? e.fill : null, this.origin_ = [0, 0], this.points_ = e.points, this.radius_ = e.radius !== void 0 ? e.radius : e.radius1, this.radius2_ = e.radius2, this.angle_ = e.angle !== void 0 ? e.angle : 0, this.stroke_ = e.stroke !== void 0 ? e.stroke : null, this.size_ = null, this.renderOptions_ = null, this.render();
1180
+ }
1181
+ /**
1182
+ * Clones the style.
1183
+ * @return {RegularShape} The cloned style.
1184
+ * @api
1185
+ */
1186
+ clone() {
1187
+ const e = this.getScale(), t = new V({
1188
+ fill: this.getFill() ? this.getFill().clone() : void 0,
1189
+ points: this.getPoints(),
1190
+ radius: this.getRadius(),
1191
+ radius2: this.getRadius2(),
1192
+ angle: this.getAngle(),
1193
+ stroke: this.getStroke() ? this.getStroke().clone() : void 0,
1194
+ rotation: this.getRotation(),
1195
+ rotateWithView: this.getRotateWithView(),
1196
+ scale: Array.isArray(e) ? e.slice() : e,
1197
+ displacement: this.getDisplacement().slice(),
1198
+ declutterMode: this.getDeclutterMode()
1199
+ });
1200
+ return t.setOpacity(this.getOpacity()), t;
1201
+ }
1202
+ /**
1203
+ * Get the anchor point in pixels. The anchor determines the center point for the
1204
+ * symbolizer.
1205
+ * @return {Array<number>} Anchor.
1206
+ * @api
1207
+ */
1208
+ getAnchor() {
1209
+ const e = this.size_;
1210
+ if (!e)
1211
+ return null;
1212
+ const t = this.getDisplacement(), n = this.getScaleArray();
1213
+ return [
1214
+ e[0] / 2 - t[0] / n[0],
1215
+ e[1] / 2 + t[1] / n[1]
1216
+ ];
1217
+ }
1218
+ /**
1219
+ * Get the angle used in generating the shape.
1220
+ * @return {number} Shape's rotation in radians.
1221
+ * @api
1222
+ */
1223
+ getAngle() {
1224
+ return this.angle_;
1225
+ }
1226
+ /**
1227
+ * Get the fill style for the shape.
1228
+ * @return {import("./Fill.js").default} Fill style.
1229
+ * @api
1230
+ */
1231
+ getFill() {
1232
+ return this.fill_;
1233
+ }
1234
+ /**
1235
+ * Set the fill style.
1236
+ * @param {import("./Fill.js").default} fill Fill style.
1237
+ * @api
1238
+ */
1239
+ setFill(e) {
1240
+ this.fill_ = e, this.render();
1241
+ }
1242
+ /**
1243
+ * @return {HTMLCanvasElement} Image element.
1244
+ */
1245
+ getHitDetectionImage() {
1246
+ return this.hitDetectionCanvas_ || this.createHitDetectionCanvas_(this.renderOptions_), this.hitDetectionCanvas_;
1247
+ }
1248
+ /**
1249
+ * Get the image icon.
1250
+ * @param {number} pixelRatio Pixel ratio.
1251
+ * @return {HTMLCanvasElement} Image or Canvas element.
1252
+ * @api
1253
+ */
1254
+ getImage(e) {
1255
+ let t = this.canvas_[e];
1256
+ if (!t) {
1257
+ const n = this.renderOptions_, s = L(
1258
+ n.size * e,
1259
+ n.size * e
1260
+ );
1261
+ this.draw_(n, s, e), t = s.canvas, this.canvas_[e] = t;
1262
+ }
1263
+ return t;
1264
+ }
1265
+ /**
1266
+ * Get the image pixel ratio.
1267
+ * @param {number} pixelRatio Pixel ratio.
1268
+ * @return {number} Pixel ratio.
1269
+ */
1270
+ getPixelRatio(e) {
1271
+ return e;
1272
+ }
1273
+ /**
1274
+ * @return {import("../size.js").Size} Image size.
1275
+ */
1276
+ getImageSize() {
1277
+ return this.size_;
1278
+ }
1279
+ /**
1280
+ * @return {import("../ImageState.js").default} Image state.
1281
+ */
1282
+ getImageState() {
1283
+ return _.LOADED;
1284
+ }
1285
+ /**
1286
+ * Get the origin of the symbolizer.
1287
+ * @return {Array<number>} Origin.
1288
+ * @api
1289
+ */
1290
+ getOrigin() {
1291
+ return this.origin_;
1292
+ }
1293
+ /**
1294
+ * Get the number of points for generating the shape.
1295
+ * @return {number} Number of points for stars and regular polygons.
1296
+ * @api
1297
+ */
1298
+ getPoints() {
1299
+ return this.points_;
1300
+ }
1301
+ /**
1302
+ * Get the (primary) radius for the shape.
1303
+ * @return {number} Radius.
1304
+ * @api
1305
+ */
1306
+ getRadius() {
1307
+ return this.radius_;
1308
+ }
1309
+ /**
1310
+ * Get the secondary radius for the shape.
1311
+ * @return {number|undefined} Radius2.
1312
+ * @api
1313
+ */
1314
+ getRadius2() {
1315
+ return this.radius2_;
1316
+ }
1317
+ /**
1318
+ * Get the size of the symbolizer (in pixels).
1319
+ * @return {import("../size.js").Size} Size.
1320
+ * @api
1321
+ */
1322
+ getSize() {
1323
+ return this.size_;
1324
+ }
1325
+ /**
1326
+ * Get the stroke style for the shape.
1327
+ * @return {import("./Stroke.js").default} Stroke style.
1328
+ * @api
1329
+ */
1330
+ getStroke() {
1331
+ return this.stroke_;
1332
+ }
1333
+ /**
1334
+ * Set the stroke style.
1335
+ * @param {import("./Stroke.js").default} stroke Stroke style.
1336
+ * @api
1337
+ */
1338
+ setStroke(e) {
1339
+ this.stroke_ = e, this.render();
1340
+ }
1341
+ /**
1342
+ * @param {function(import("../events/Event.js").default): void} listener Listener function.
1343
+ */
1344
+ listenImageChange(e) {
1345
+ }
1346
+ /**
1347
+ * Load not yet loaded URI.
1348
+ */
1349
+ load() {
1350
+ }
1351
+ /**
1352
+ * @param {function(import("../events/Event.js").default): void} listener Listener function.
1353
+ */
1354
+ unlistenImageChange(e) {
1355
+ }
1356
+ /**
1357
+ * Calculate additional canvas size needed for the miter.
1358
+ * @param {string} lineJoin Line join
1359
+ * @param {number} strokeWidth Stroke width
1360
+ * @param {number} miterLimit Miter limit
1361
+ * @return {number} Additional canvas size needed
1362
+ * @private
1363
+ */
1364
+ calculateLineJoinSize_(e, t, n) {
1365
+ if (t === 0 || this.points_ === 1 / 0 || e !== "bevel" && e !== "miter")
1366
+ return t;
1367
+ let s = this.radius_, r = this.radius2_ === void 0 ? s : this.radius2_;
1368
+ if (s < r) {
1369
+ const F = s;
1370
+ s = r, r = F;
1371
+ }
1372
+ const a = this.radius2_ === void 0 ? this.points_ : this.points_ * 2, l = 2 * Math.PI / a, o = r * Math.sin(l), c = Math.sqrt(r * r - o * o), h = s - c, u = Math.sqrt(o * o + h * h), f = u / o;
1373
+ if (e === "miter" && f <= n)
1374
+ return f * t;
1375
+ const g = t / 2 / f, d = t / 2 * (h / u), b = Math.sqrt((s + g) * (s + g) + d * d) - s;
1376
+ if (this.radius2_ === void 0 || e === "bevel")
1377
+ return b * 2;
1378
+ const k = s * Math.sin(l), re = Math.sqrt(s * s - k * k), H = r - re, B = Math.sqrt(k * k + H * H) / k;
1379
+ if (B <= n) {
1380
+ const F = B * t / 2 - r - s;
1381
+ return 2 * Math.max(b, F);
1382
+ }
1383
+ return b * 2;
1384
+ }
1385
+ /**
1386
+ * @return {RenderOptions} The render options
1387
+ * @protected
1388
+ */
1389
+ createRenderOptions() {
1390
+ let e = p, t = 0, n = null, s = 0, r, a = 0;
1391
+ this.stroke_ && (r = this.stroke_.getColor(), r === null && (r = De), r = Z(r), a = this.stroke_.getWidth(), a === void 0 && (a = we), n = this.stroke_.getLineDash(), s = this.stroke_.getLineDashOffset(), e = this.stroke_.getLineJoin(), e === void 0 && (e = p), t = this.stroke_.getMiterLimit(), t === void 0 && (t = Ie));
1392
+ const l = this.calculateLineJoinSize_(e, a, t), o = Math.max(this.radius_, this.radius2_ || 0), c = Math.ceil(2 * o + l);
1393
+ return {
1394
+ strokeStyle: r,
1395
+ strokeWidth: a,
1396
+ size: c,
1397
+ lineDash: n,
1398
+ lineDashOffset: s,
1399
+ lineJoin: e,
1400
+ miterLimit: t
1401
+ };
1402
+ }
1403
+ /**
1404
+ * @protected
1405
+ */
1406
+ render() {
1407
+ this.renderOptions_ = this.createRenderOptions();
1408
+ const e = this.renderOptions_.size;
1409
+ this.canvas_ = {}, this.size_ = [e, e];
1410
+ }
1411
+ /**
1412
+ * @private
1413
+ * @param {RenderOptions} renderOptions Render options.
1414
+ * @param {CanvasRenderingContext2D} context The rendering context.
1415
+ * @param {number} pixelRatio The pixel ratio.
1416
+ */
1417
+ draw_(e, t, n) {
1418
+ if (t.scale(n, n), t.translate(e.size / 2, e.size / 2), this.createPath_(t), this.fill_) {
1419
+ let s = this.fill_.getColor();
1420
+ s === null && (s = G), t.fillStyle = Z(s), t.fill();
1421
+ }
1422
+ this.stroke_ && (t.strokeStyle = e.strokeStyle, t.lineWidth = e.strokeWidth, e.lineDash && (t.setLineDash(e.lineDash), t.lineDashOffset = e.lineDashOffset), t.lineJoin = e.lineJoin, t.miterLimit = e.miterLimit, t.stroke());
1423
+ }
1424
+ /**
1425
+ * @private
1426
+ * @param {RenderOptions} renderOptions Render options.
1427
+ */
1428
+ createHitDetectionCanvas_(e) {
1429
+ if (this.fill_) {
1430
+ let t = this.fill_.getColor(), n = 0;
1431
+ if (typeof t == "string" && (t = Q(t)), t === null ? n = 1 : Array.isArray(t) && (n = t.length === 4 ? t[3] : 1), n === 0) {
1432
+ const s = L(
1433
+ e.size,
1434
+ e.size
1435
+ );
1436
+ this.hitDetectionCanvas_ = s.canvas, this.drawHitDetectionCanvas_(e, s);
1437
+ }
1438
+ }
1439
+ this.hitDetectionCanvas_ || (this.hitDetectionCanvas_ = this.getImage(1));
1440
+ }
1441
+ /**
1442
+ * @private
1443
+ * @param {CanvasRenderingContext2D} context The context to draw in.
1444
+ */
1445
+ createPath_(e) {
1446
+ let t = this.points_;
1447
+ const n = this.radius_;
1448
+ if (t === 1 / 0)
1449
+ e.arc(0, 0, n, 0, 2 * Math.PI);
1450
+ else {
1451
+ const s = this.radius2_ === void 0 ? n : this.radius2_;
1452
+ this.radius2_ !== void 0 && (t *= 2);
1453
+ const r = this.angle_ - Math.PI / 2, a = 2 * Math.PI / t;
1454
+ for (let l = 0; l < t; l++) {
1455
+ const o = r + l * a, c = l % 2 === 0 ? n : s;
1456
+ e.lineTo(c * Math.cos(o), c * Math.sin(o));
1457
+ }
1458
+ e.closePath();
1459
+ }
1460
+ }
1461
+ /**
1462
+ * @private
1463
+ * @param {RenderOptions} renderOptions Render options.
1464
+ * @param {CanvasRenderingContext2D} context The context.
1465
+ */
1466
+ drawHitDetectionCanvas_(e, t) {
1467
+ t.translate(e.size / 2, e.size / 2), this.createPath_(t), t.fillStyle = G, t.fill(), this.stroke_ && (t.strokeStyle = e.strokeStyle, t.lineWidth = e.strokeWidth, e.lineDash && (t.setLineDash(e.lineDash), t.lineDashOffset = e.lineDashOffset), t.lineJoin = e.lineJoin, t.miterLimit = e.miterLimit, t.stroke());
1468
+ }
1469
+ }
1470
+ class R extends V {
1471
+ /**
1472
+ * @param {Options} [options] Options.
1473
+ */
1474
+ constructor(e) {
1475
+ e = e || { radius: 5 }, super({
1476
+ points: 1 / 0,
1477
+ fill: e.fill,
1478
+ radius: e.radius,
1479
+ stroke: e.stroke,
1480
+ scale: e.scale !== void 0 ? e.scale : 1,
1481
+ rotation: e.rotation !== void 0 ? e.rotation : 0,
1482
+ rotateWithView: e.rotateWithView !== void 0 ? e.rotateWithView : !1,
1483
+ displacement: e.displacement !== void 0 ? e.displacement : [0, 0],
1484
+ declutterMode: e.declutterMode
1485
+ });
1486
+ }
1487
+ /**
1488
+ * Clones the style.
1489
+ * @return {CircleStyle} The cloned style.
1490
+ * @api
1491
+ */
1492
+ clone() {
1493
+ const e = this.getScale(), t = new R({
1494
+ fill: this.getFill() ? this.getFill().clone() : void 0,
1495
+ stroke: this.getStroke() ? this.getStroke().clone() : void 0,
1496
+ radius: this.getRadius(),
1497
+ scale: Array.isArray(e) ? e.slice() : e,
1498
+ rotation: this.getRotation(),
1499
+ rotateWithView: this.getRotateWithView(),
1500
+ displacement: this.getDisplacement().slice(),
1501
+ declutterMode: this.getDeclutterMode()
1502
+ });
1503
+ return t.setOpacity(this.getOpacity()), t;
1504
+ }
1505
+ /**
1506
+ * Set the circle radius.
1507
+ *
1508
+ * @param {number} radius Circle radius.
1509
+ * @api
1510
+ */
1511
+ setRadius(e) {
1512
+ this.radius_ = e, this.render();
1513
+ }
1514
+ }
1515
+ class S {
1516
+ /**
1517
+ * @param {Options} [options] Style options.
1518
+ */
1519
+ constructor(e) {
1520
+ e = e || {}, this.geometry_ = null, this.geometryFunction_ = K, e.geometry !== void 0 && this.setGeometry(e.geometry), this.fill_ = e.fill !== void 0 ? e.fill : null, this.image_ = e.image !== void 0 ? e.image : null, this.renderer_ = e.renderer !== void 0 ? e.renderer : null, this.hitDetectionRenderer_ = e.hitDetectionRenderer !== void 0 ? e.hitDetectionRenderer : null, this.stroke_ = e.stroke !== void 0 ? e.stroke : null, this.text_ = e.text !== void 0 ? e.text : null, this.zIndex_ = e.zIndex;
1521
+ }
1522
+ /**
1523
+ * Clones the style.
1524
+ * @return {Style} The cloned style.
1525
+ * @api
1526
+ */
1527
+ clone() {
1528
+ let e = this.getGeometry();
1529
+ return e && typeof e == "object" && (e = /** @type {import("../geom/Geometry.js").default} */
1530
+ e.clone()), new S({
1531
+ geometry: e,
1532
+ fill: this.getFill() ? this.getFill().clone() : void 0,
1533
+ image: this.getImage() ? this.getImage().clone() : void 0,
1534
+ renderer: this.getRenderer(),
1535
+ stroke: this.getStroke() ? this.getStroke().clone() : void 0,
1536
+ text: this.getText() ? this.getText().clone() : void 0,
1537
+ zIndex: this.getZIndex()
1538
+ });
1539
+ }
1540
+ /**
1541
+ * Get the custom renderer function that was configured with
1542
+ * {@link #setRenderer} or the `renderer` constructor option.
1543
+ * @return {RenderFunction|null} Custom renderer function.
1544
+ * @api
1545
+ */
1546
+ getRenderer() {
1547
+ return this.renderer_;
1548
+ }
1549
+ /**
1550
+ * Sets a custom renderer function for this style. When set, `fill`, `stroke`
1551
+ * and `image` options of the style will be ignored.
1552
+ * @param {RenderFunction|null} renderer Custom renderer function.
1553
+ * @api
1554
+ */
1555
+ setRenderer(e) {
1556
+ this.renderer_ = e;
1557
+ }
1558
+ /**
1559
+ * Sets a custom renderer function for this style used
1560
+ * in hit detection.
1561
+ * @param {RenderFunction|null} renderer Custom renderer function.
1562
+ * @api
1563
+ */
1564
+ setHitDetectionRenderer(e) {
1565
+ this.hitDetectionRenderer_ = e;
1566
+ }
1567
+ /**
1568
+ * Get the custom renderer function that was configured with
1569
+ * {@link #setHitDetectionRenderer} or the `hitDetectionRenderer` constructor option.
1570
+ * @return {RenderFunction|null} Custom renderer function.
1571
+ * @api
1572
+ */
1573
+ getHitDetectionRenderer() {
1574
+ return this.hitDetectionRenderer_;
1575
+ }
1576
+ /**
1577
+ * Get the geometry to be rendered.
1578
+ * @return {string|import("../geom/Geometry.js").default|GeometryFunction}
1579
+ * Feature property or geometry or function that returns the geometry that will
1580
+ * be rendered with this style.
1581
+ * @api
1582
+ */
1583
+ getGeometry() {
1584
+ return this.geometry_;
1585
+ }
1586
+ /**
1587
+ * Get the function used to generate a geometry for rendering.
1588
+ * @return {!GeometryFunction} Function that is called with a feature
1589
+ * and returns the geometry to render instead of the feature's geometry.
1590
+ * @api
1591
+ */
1592
+ getGeometryFunction() {
1593
+ return this.geometryFunction_;
1594
+ }
1595
+ /**
1596
+ * Get the fill style.
1597
+ * @return {import("./Fill.js").default} Fill style.
1598
+ * @api
1599
+ */
1600
+ getFill() {
1601
+ return this.fill_;
1602
+ }
1603
+ /**
1604
+ * Set the fill style.
1605
+ * @param {import("./Fill.js").default} fill Fill style.
1606
+ * @api
1607
+ */
1608
+ setFill(e) {
1609
+ this.fill_ = e;
1610
+ }
1611
+ /**
1612
+ * Get the image style.
1613
+ * @return {import("./Image.js").default} Image style.
1614
+ * @api
1615
+ */
1616
+ getImage() {
1617
+ return this.image_;
1618
+ }
1619
+ /**
1620
+ * Set the image style.
1621
+ * @param {import("./Image.js").default} image Image style.
1622
+ * @api
1623
+ */
1624
+ setImage(e) {
1625
+ this.image_ = e;
1626
+ }
1627
+ /**
1628
+ * Get the stroke style.
1629
+ * @return {import("./Stroke.js").default} Stroke style.
1630
+ * @api
1631
+ */
1632
+ getStroke() {
1633
+ return this.stroke_;
1634
+ }
1635
+ /**
1636
+ * Set the stroke style.
1637
+ * @param {import("./Stroke.js").default} stroke Stroke style.
1638
+ * @api
1639
+ */
1640
+ setStroke(e) {
1641
+ this.stroke_ = e;
1642
+ }
1643
+ /**
1644
+ * Get the text style.
1645
+ * @return {import("./Text.js").default} Text style.
1646
+ * @api
1647
+ */
1648
+ getText() {
1649
+ return this.text_;
1650
+ }
1651
+ /**
1652
+ * Set the text style.
1653
+ * @param {import("./Text.js").default} text Text style.
1654
+ * @api
1655
+ */
1656
+ setText(e) {
1657
+ this.text_ = e;
1658
+ }
1659
+ /**
1660
+ * Get the z-index for the style.
1661
+ * @return {number|undefined} ZIndex.
1662
+ * @api
1663
+ */
1664
+ getZIndex() {
1665
+ return this.zIndex_;
1666
+ }
1667
+ /**
1668
+ * Set a geometry that is rendered instead of the feature's geometry.
1669
+ *
1670
+ * @param {string|import("../geom/Geometry.js").default|GeometryFunction} geometry
1671
+ * Feature property or geometry or function returning a geometry to render
1672
+ * for this style.
1673
+ * @api
1674
+ */
1675
+ setGeometry(e) {
1676
+ typeof e == "function" ? this.geometryFunction_ = e : typeof e == "string" ? this.geometryFunction_ = function(t) {
1677
+ return (
1678
+ /** @type {import("../geom/Geometry.js").default} */
1679
+ t.get(e)
1680
+ );
1681
+ } : e ? e !== void 0 && (this.geometryFunction_ = function() {
1682
+ return (
1683
+ /** @type {import("../geom/Geometry.js").default} */
1684
+ e
1685
+ );
1686
+ }) : this.geometryFunction_ = K, this.geometry_ = e;
1687
+ }
1688
+ /**
1689
+ * Set the z-index.
1690
+ *
1691
+ * @param {number|undefined} zIndex ZIndex.
1692
+ * @api
1693
+ */
1694
+ setZIndex(e) {
1695
+ this.zIndex_ = e;
1696
+ }
1697
+ }
1698
+ function je(i) {
1699
+ let e;
1700
+ if (typeof i == "function")
1701
+ e = i;
1702
+ else {
1703
+ let t;
1704
+ Array.isArray(i) ? t = i : (w(typeof /** @type {?} */
1705
+ i.getZIndex == "function", 41), t = [
1706
+ /** @type {Style} */
1707
+ i
1708
+ ]), e = function() {
1709
+ return t;
1710
+ };
1711
+ }
1712
+ return e;
1713
+ }
1714
+ let W = null;
1715
+ function $e(i, e) {
1716
+ if (!W) {
1717
+ const t = new C({
1718
+ color: "rgba(255,255,255,0.4)"
1719
+ }), n = new A({
1720
+ color: "#3399CC",
1721
+ width: 1.25
1722
+ });
1723
+ W = [
1724
+ new S({
1725
+ image: new R({
1726
+ fill: t,
1727
+ stroke: n,
1728
+ radius: 5
1729
+ }),
1730
+ fill: t,
1731
+ stroke: n
1732
+ })
1733
+ ];
1734
+ }
1735
+ return W;
1736
+ }
1737
+ function Qe() {
1738
+ const i = {}, e = [255, 255, 255, 1], t = [0, 153, 255, 1], n = 3;
1739
+ return i.Polygon = [
1740
+ new S({
1741
+ fill: new C({
1742
+ color: [255, 255, 255, 0.5]
1743
+ })
1744
+ })
1745
+ ], i.MultiPolygon = i.Polygon, i.LineString = [
1746
+ new S({
1747
+ stroke: new A({
1748
+ color: e,
1749
+ width: n + 2
1750
+ })
1751
+ }),
1752
+ new S({
1753
+ stroke: new A({
1754
+ color: t,
1755
+ width: n
1756
+ })
1757
+ })
1758
+ ], i.MultiLineString = i.LineString, i.Circle = i.Polygon.concat(i.LineString), i.Point = [
1759
+ new S({
1760
+ image: new R({
1761
+ radius: n * 2,
1762
+ fill: new C({
1763
+ color: t
1764
+ }),
1765
+ stroke: new A({
1766
+ color: e,
1767
+ width: n / 2
1768
+ })
1769
+ }),
1770
+ zIndex: 1 / 0
1771
+ })
1772
+ ], i.MultiPoint = i.Point, i.GeometryCollection = i.Polygon.concat(
1773
+ i.LineString,
1774
+ i.Point
1775
+ ), i;
1776
+ }
1777
+ function K(i) {
1778
+ return i.getGeometry();
1779
+ }
1780
+ const Le = "#333";
1781
+ class se {
1782
+ /**
1783
+ * @param {Options} [options] Options.
1784
+ */
1785
+ constructor(e) {
1786
+ e = e || {}, this.font_ = e.font, this.rotation_ = e.rotation, this.rotateWithView_ = e.rotateWithView, this.scale_ = e.scale, this.scaleArray_ = M(e.scale !== void 0 ? e.scale : 1), this.text_ = e.text, this.textAlign_ = e.textAlign, this.justify_ = e.justify, this.repeat_ = e.repeat, this.textBaseline_ = e.textBaseline, this.fill_ = e.fill !== void 0 ? e.fill : new C({ color: Le }), this.maxAngle_ = e.maxAngle !== void 0 ? e.maxAngle : Math.PI / 4, this.placement_ = e.placement !== void 0 ? e.placement : "point", this.overflow_ = !!e.overflow, this.stroke_ = e.stroke !== void 0 ? e.stroke : null, this.offsetX_ = e.offsetX !== void 0 ? e.offsetX : 0, this.offsetY_ = e.offsetY !== void 0 ? e.offsetY : 0, this.backgroundFill_ = e.backgroundFill ? e.backgroundFill : null, this.backgroundStroke_ = e.backgroundStroke ? e.backgroundStroke : null, this.padding_ = e.padding === void 0 ? null : e.padding;
1787
+ }
1788
+ /**
1789
+ * Clones the style.
1790
+ * @return {Text} The cloned style.
1791
+ * @api
1792
+ */
1793
+ clone() {
1794
+ const e = this.getScale();
1795
+ return new se({
1796
+ font: this.getFont(),
1797
+ placement: this.getPlacement(),
1798
+ repeat: this.getRepeat(),
1799
+ maxAngle: this.getMaxAngle(),
1800
+ overflow: this.getOverflow(),
1801
+ rotation: this.getRotation(),
1802
+ rotateWithView: this.getRotateWithView(),
1803
+ scale: Array.isArray(e) ? e.slice() : e,
1804
+ text: this.getText(),
1805
+ textAlign: this.getTextAlign(),
1806
+ justify: this.getJustify(),
1807
+ textBaseline: this.getTextBaseline(),
1808
+ fill: this.getFill() ? this.getFill().clone() : void 0,
1809
+ stroke: this.getStroke() ? this.getStroke().clone() : void 0,
1810
+ offsetX: this.getOffsetX(),
1811
+ offsetY: this.getOffsetY(),
1812
+ backgroundFill: this.getBackgroundFill() ? this.getBackgroundFill().clone() : void 0,
1813
+ backgroundStroke: this.getBackgroundStroke() ? this.getBackgroundStroke().clone() : void 0,
1814
+ padding: this.getPadding() || void 0
1815
+ });
1816
+ }
1817
+ /**
1818
+ * Get the `overflow` configuration.
1819
+ * @return {boolean} Let text overflow the length of the path they follow.
1820
+ * @api
1821
+ */
1822
+ getOverflow() {
1823
+ return this.overflow_;
1824
+ }
1825
+ /**
1826
+ * Get the font name.
1827
+ * @return {string|undefined} Font.
1828
+ * @api
1829
+ */
1830
+ getFont() {
1831
+ return this.font_;
1832
+ }
1833
+ /**
1834
+ * Get the maximum angle between adjacent characters.
1835
+ * @return {number} Angle in radians.
1836
+ * @api
1837
+ */
1838
+ getMaxAngle() {
1839
+ return this.maxAngle_;
1840
+ }
1841
+ /**
1842
+ * Get the label placement.
1843
+ * @return {TextPlacement} Text placement.
1844
+ * @api
1845
+ */
1846
+ getPlacement() {
1847
+ return this.placement_;
1848
+ }
1849
+ /**
1850
+ * Get the repeat interval of the text.
1851
+ * @return {number|undefined} Repeat interval in pixels.
1852
+ * @api
1853
+ */
1854
+ getRepeat() {
1855
+ return this.repeat_;
1856
+ }
1857
+ /**
1858
+ * Get the x-offset for the text.
1859
+ * @return {number} Horizontal text offset.
1860
+ * @api
1861
+ */
1862
+ getOffsetX() {
1863
+ return this.offsetX_;
1864
+ }
1865
+ /**
1866
+ * Get the y-offset for the text.
1867
+ * @return {number} Vertical text offset.
1868
+ * @api
1869
+ */
1870
+ getOffsetY() {
1871
+ return this.offsetY_;
1872
+ }
1873
+ /**
1874
+ * Get the fill style for the text.
1875
+ * @return {import("./Fill.js").default} Fill style.
1876
+ * @api
1877
+ */
1878
+ getFill() {
1879
+ return this.fill_;
1880
+ }
1881
+ /**
1882
+ * Determine whether the text rotates with the map.
1883
+ * @return {boolean|undefined} Rotate with map.
1884
+ * @api
1885
+ */
1886
+ getRotateWithView() {
1887
+ return this.rotateWithView_;
1888
+ }
1889
+ /**
1890
+ * Get the text rotation.
1891
+ * @return {number|undefined} Rotation.
1892
+ * @api
1893
+ */
1894
+ getRotation() {
1895
+ return this.rotation_;
1896
+ }
1897
+ /**
1898
+ * Get the text scale.
1899
+ * @return {number|import("../size.js").Size|undefined} Scale.
1900
+ * @api
1901
+ */
1902
+ getScale() {
1903
+ return this.scale_;
1904
+ }
1905
+ /**
1906
+ * Get the symbolizer scale array.
1907
+ * @return {import("../size.js").Size} Scale array.
1908
+ */
1909
+ getScaleArray() {
1910
+ return this.scaleArray_;
1911
+ }
1912
+ /**
1913
+ * Get the stroke style for the text.
1914
+ * @return {import("./Stroke.js").default} Stroke style.
1915
+ * @api
1916
+ */
1917
+ getStroke() {
1918
+ return this.stroke_;
1919
+ }
1920
+ /**
1921
+ * Get the text to be rendered.
1922
+ * @return {string|Array<string>|undefined} Text.
1923
+ * @api
1924
+ */
1925
+ getText() {
1926
+ return this.text_;
1927
+ }
1928
+ /**
1929
+ * Get the text alignment.
1930
+ * @return {CanvasTextAlign|undefined} Text align.
1931
+ * @api
1932
+ */
1933
+ getTextAlign() {
1934
+ return this.textAlign_;
1935
+ }
1936
+ /**
1937
+ * Get the justification.
1938
+ * @return {TextJustify|undefined} Justification.
1939
+ * @api
1940
+ */
1941
+ getJustify() {
1942
+ return this.justify_;
1943
+ }
1944
+ /**
1945
+ * Get the text baseline.
1946
+ * @return {CanvasTextBaseline|undefined} Text baseline.
1947
+ * @api
1948
+ */
1949
+ getTextBaseline() {
1950
+ return this.textBaseline_;
1951
+ }
1952
+ /**
1953
+ * Get the background fill style for the text.
1954
+ * @return {import("./Fill.js").default} Fill style.
1955
+ * @api
1956
+ */
1957
+ getBackgroundFill() {
1958
+ return this.backgroundFill_;
1959
+ }
1960
+ /**
1961
+ * Get the background stroke style for the text.
1962
+ * @return {import("./Stroke.js").default} Stroke style.
1963
+ * @api
1964
+ */
1965
+ getBackgroundStroke() {
1966
+ return this.backgroundStroke_;
1967
+ }
1968
+ /**
1969
+ * Get the padding for the text.
1970
+ * @return {Array<number>|null} Padding.
1971
+ * @api
1972
+ */
1973
+ getPadding() {
1974
+ return this.padding_;
1975
+ }
1976
+ /**
1977
+ * Set the `overflow` property.
1978
+ *
1979
+ * @param {boolean} overflow Let text overflow the path that it follows.
1980
+ * @api
1981
+ */
1982
+ setOverflow(e) {
1983
+ this.overflow_ = e;
1984
+ }
1985
+ /**
1986
+ * Set the font.
1987
+ *
1988
+ * @param {string|undefined} font Font.
1989
+ * @api
1990
+ */
1991
+ setFont(e) {
1992
+ this.font_ = e;
1993
+ }
1994
+ /**
1995
+ * Set the maximum angle between adjacent characters.
1996
+ *
1997
+ * @param {number} maxAngle Angle in radians.
1998
+ * @api
1999
+ */
2000
+ setMaxAngle(e) {
2001
+ this.maxAngle_ = e;
2002
+ }
2003
+ /**
2004
+ * Set the x offset.
2005
+ *
2006
+ * @param {number} offsetX Horizontal text offset.
2007
+ * @api
2008
+ */
2009
+ setOffsetX(e) {
2010
+ this.offsetX_ = e;
2011
+ }
2012
+ /**
2013
+ * Set the y offset.
2014
+ *
2015
+ * @param {number} offsetY Vertical text offset.
2016
+ * @api
2017
+ */
2018
+ setOffsetY(e) {
2019
+ this.offsetY_ = e;
2020
+ }
2021
+ /**
2022
+ * Set the text placement.
2023
+ *
2024
+ * @param {TextPlacement} placement Placement.
2025
+ * @api
2026
+ */
2027
+ setPlacement(e) {
2028
+ this.placement_ = e;
2029
+ }
2030
+ /**
2031
+ * Set the repeat interval of the text.
2032
+ * @param {number|undefined} [repeat] Repeat interval in pixels.
2033
+ * @api
2034
+ */
2035
+ setRepeat(e) {
2036
+ this.repeat_ = e;
2037
+ }
2038
+ /**
2039
+ * Set whether to rotate the text with the view.
2040
+ *
2041
+ * @param {boolean} rotateWithView Rotate with map.
2042
+ * @api
2043
+ */
2044
+ setRotateWithView(e) {
2045
+ this.rotateWithView_ = e;
2046
+ }
2047
+ /**
2048
+ * Set the fill.
2049
+ *
2050
+ * @param {import("./Fill.js").default} fill Fill style.
2051
+ * @api
2052
+ */
2053
+ setFill(e) {
2054
+ this.fill_ = e;
2055
+ }
2056
+ /**
2057
+ * Set the rotation.
2058
+ *
2059
+ * @param {number|undefined} rotation Rotation.
2060
+ * @api
2061
+ */
2062
+ setRotation(e) {
2063
+ this.rotation_ = e;
2064
+ }
2065
+ /**
2066
+ * Set the scale.
2067
+ *
2068
+ * @param {number|import("../size.js").Size|undefined} scale Scale.
2069
+ * @api
2070
+ */
2071
+ setScale(e) {
2072
+ this.scale_ = e, this.scaleArray_ = M(e !== void 0 ? e : 1);
2073
+ }
2074
+ /**
2075
+ * Set the stroke.
2076
+ *
2077
+ * @param {import("./Stroke.js").default} stroke Stroke style.
2078
+ * @api
2079
+ */
2080
+ setStroke(e) {
2081
+ this.stroke_ = e;
2082
+ }
2083
+ /**
2084
+ * Set the text.
2085
+ *
2086
+ * @param {string|Array<string>|undefined} text Text.
2087
+ * @api
2088
+ */
2089
+ setText(e) {
2090
+ this.text_ = e;
2091
+ }
2092
+ /**
2093
+ * Set the text alignment.
2094
+ *
2095
+ * @param {CanvasTextAlign|undefined} textAlign Text align.
2096
+ * @api
2097
+ */
2098
+ setTextAlign(e) {
2099
+ this.textAlign_ = e;
2100
+ }
2101
+ /**
2102
+ * Set the justification.
2103
+ *
2104
+ * @param {TextJustify|undefined} justify Justification.
2105
+ * @api
2106
+ */
2107
+ setJustify(e) {
2108
+ this.justify_ = e;
2109
+ }
2110
+ /**
2111
+ * Set the text baseline.
2112
+ *
2113
+ * @param {CanvasTextBaseline|undefined} textBaseline Text baseline.
2114
+ * @api
2115
+ */
2116
+ setTextBaseline(e) {
2117
+ this.textBaseline_ = e;
2118
+ }
2119
+ /**
2120
+ * Set the background fill.
2121
+ *
2122
+ * @param {import("./Fill.js").default} fill Fill style.
2123
+ * @api
2124
+ */
2125
+ setBackgroundFill(e) {
2126
+ this.backgroundFill_ = e;
2127
+ }
2128
+ /**
2129
+ * Set the background stroke.
2130
+ *
2131
+ * @param {import("./Stroke.js").default} stroke Stroke style.
2132
+ * @api
2133
+ */
2134
+ setBackgroundStroke(e) {
2135
+ this.backgroundStroke_ = e;
2136
+ }
2137
+ /**
2138
+ * Set the padding (`[top, right, bottom, left]`).
2139
+ *
2140
+ * @param {Array<number>|null} padding Padding.
2141
+ * @api
2142
+ */
2143
+ setPadding(e) {
2144
+ this.padding_ = e;
2145
+ }
2146
+ }
2147
+ export {
2148
+ Je as A,
2149
+ p as B,
2150
+ R as C,
2151
+ we as D,
2152
+ Ie as E,
2153
+ C as F,
2154
+ Ye as G,
2155
+ Xe as H,
2156
+ ne as I,
2157
+ Ue as J,
2158
+ He as K,
2159
+ Ge as L,
2160
+ qe as M,
2161
+ Ze as N,
2162
+ pe as O,
2163
+ V as R,
2164
+ S,
2165
+ se as T,
2166
+ A as a,
2167
+ y as b,
2168
+ Qe as c,
2169
+ Ee as d,
2170
+ Te as e,
2171
+ Re as f,
2172
+ be as g,
2173
+ Pe as h,
2174
+ We as i,
2175
+ Me as j,
2176
+ Ke as k,
2177
+ _ as l,
2178
+ Q as m,
2179
+ L as n,
2180
+ ke as o,
2181
+ Fe as p,
2182
+ je as q,
2183
+ Ve as r,
2184
+ U as s,
2185
+ M as t,
2186
+ $e as u,
2187
+ Z as v,
2188
+ G as w,
2189
+ De as x,
2190
+ Be as y,
2191
+ Ne as z
2192
+ };