@hybridcore/ui 1.0.2 → 1.1.0

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