@maplibre/maplibre-react-native 10.0.0-beta.1 → 10.0.0-beta.11

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 (259) hide show
  1. package/README.md +36 -35
  2. package/android/build.gradle +98 -51
  3. package/android/gradle.properties +7 -0
  4. package/android/src/main/AndroidManifest.xml +4 -2
  5. package/android/src/main/AndroidManifestNew.xml +5 -0
  6. package/android/src/main/java/org/maplibre/reactnative/MLRNPackage.java +0 -5
  7. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapView.java +11 -13
  8. package/android/src/main/java/org/maplibre/reactnative/components/mapview/MLRNMapViewManager.java +4 -11
  9. package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyle.java +1 -4
  10. package/android/src/main/java/org/maplibre/reactnative/components/styles/MLRNStyleFactory.java +10 -11
  11. package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSource.java +0 -66
  12. package/android/src/main/java/org/maplibre/reactnative/components/styles/sources/MLRNShapeSourceManager.java +0 -28
  13. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNModule.java +3 -146
  14. package/android/src/main/java/org/maplibre/reactnative/modules/MLRNOfflineModule.java +1 -3
  15. package/android/src/main/java/org/maplibre/reactnative/utils/GeoJSONUtils.java +80 -0
  16. package/ios/MLRN/MLRNBackgroundLayer.h +0 -1
  17. package/ios/MLRN/MLRNFillExtrusionLayer.h +0 -1
  18. package/ios/MLRN/MLRNFillLayer.h +0 -1
  19. package/ios/MLRN/MLRNFillLayer.m +1 -0
  20. package/ios/MLRN/MLRNLineLayer.h +0 -1
  21. package/ios/MLRN/MLRNMapView.h +1 -1
  22. package/ios/MLRN/MLRNMapView.m +7 -7
  23. package/ios/MLRN/MLRNMapViewManager.m +1 -1
  24. package/ios/MLRN/MLRNModule.m +0 -139
  25. package/ios/MLRN/MLRNRasterLayer.h +0 -1
  26. package/ios/MLRN/MLRNShapeSource.h +0 -11
  27. package/ios/MLRN/MLRNShapeSource.m +0 -38
  28. package/ios/MLRN/MLRNShapeSourceManager.m +0 -68
  29. package/ios/MLRN/MLRNSymbolLayer.h +1 -7
  30. package/ios/MLRN/MLRNSymbolLayer.m +1 -89
  31. package/ios/MLRN/MLRNSymbolLayerManager.m +0 -1
  32. package/lib/commonjs/MLRNModule.js +7 -5
  33. package/lib/commonjs/MLRNModule.js.map +1 -1
  34. package/lib/commonjs/MapLibreRN.js +3 -15
  35. package/lib/commonjs/MapLibreRN.js.map +1 -1
  36. package/lib/commonjs/components/Annotation.js.map +1 -1
  37. package/lib/commonjs/components/Images.js +1 -5
  38. package/lib/commonjs/components/Images.js.map +1 -1
  39. package/lib/commonjs/components/MapView.js +15 -28
  40. package/lib/commonjs/components/MapView.js.map +1 -1
  41. package/lib/commonjs/components/ShapeSource.js +6 -38
  42. package/lib/commonjs/components/ShapeSource.js.map +1 -1
  43. package/lib/commonjs/components/SymbolLayer.js +2 -17
  44. package/lib/commonjs/components/SymbolLayer.js.map +1 -1
  45. package/lib/commonjs/components/UserLocation.js.map +1 -1
  46. package/lib/commonjs/components/VectorSource.js +1 -11
  47. package/lib/commonjs/components/VectorSource.js.map +1 -1
  48. package/lib/commonjs/modules/offline/offlineManager.js +1 -1
  49. package/lib/commonjs/modules/offline/offlineManager.js.map +1 -1
  50. package/lib/commonjs/types/MapLibreRNStyles.js +6 -0
  51. package/lib/commonjs/types/MapLibreRNStyles.js.map +1 -0
  52. package/lib/commonjs/utils/StyleValue.js +2 -2
  53. package/lib/commonjs/utils/StyleValue.js.map +1 -1
  54. package/lib/commonjs/utils/getStylePropertyType.js +252 -0
  55. package/lib/commonjs/utils/getStylePropertyType.js.map +1 -0
  56. package/lib/module/MLRNModule.js +3 -2
  57. package/lib/module/MLRNModule.js.map +1 -1
  58. package/lib/module/MapLibreRN.js +1 -5
  59. package/lib/module/MapLibreRN.js.map +1 -1
  60. package/lib/module/components/Annotation.js.map +1 -1
  61. package/lib/module/components/Images.js +1 -5
  62. package/lib/module/components/Images.js.map +1 -1
  63. package/lib/module/components/MapView.js +15 -28
  64. package/lib/module/components/MapView.js.map +1 -1
  65. package/lib/module/components/ShapeSource.js +5 -37
  66. package/lib/module/components/ShapeSource.js.map +1 -1
  67. package/lib/module/components/SymbolLayer.js +3 -18
  68. package/lib/module/components/SymbolLayer.js.map +1 -1
  69. package/lib/module/components/UserLocation.js.map +1 -1
  70. package/lib/module/components/VectorSource.js +1 -11
  71. package/lib/module/components/VectorSource.js.map +1 -1
  72. package/lib/module/modules/offline/offlineManager.js +1 -1
  73. package/lib/module/modules/offline/offlineManager.js.map +1 -1
  74. package/lib/module/types/MapLibreRNStyles.js +4 -0
  75. package/lib/module/types/MapLibreRNStyles.js.map +1 -0
  76. package/lib/module/utils/StyleValue.js +2 -2
  77. package/lib/module/utils/StyleValue.js.map +1 -1
  78. package/lib/module/utils/getStylePropertyType.js +248 -0
  79. package/lib/module/utils/getStylePropertyType.js.map +1 -0
  80. package/lib/typescript/commonjs/jest.config.d.ts +2 -0
  81. package/lib/typescript/commonjs/jest.config.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/src/MLRNModule.d.ts +3 -7
  83. package/lib/typescript/commonjs/src/MLRNModule.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/MapLibreRN.d.ts +5 -8
  85. package/lib/typescript/commonjs/src/MapLibreRN.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/src/components/Annotation.d.ts +2 -2
  87. package/lib/typescript/commonjs/src/components/Annotation.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts +2 -2
  89. package/lib/typescript/commonjs/src/components/BackgroundLayer.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/components/Camera.d.ts +1 -1
  91. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts +2 -2
  92. package/lib/typescript/commonjs/src/components/CircleLayer.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts +2 -2
  94. package/lib/typescript/commonjs/src/components/FillExtrusionLayer.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/src/components/FillLayer.d.ts +2 -2
  96. package/lib/typescript/commonjs/src/components/FillLayer.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts +2 -2
  98. package/lib/typescript/commonjs/src/components/HeatmapLayer.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/src/components/Images.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/src/components/Light.d.ts +2 -2
  101. package/lib/typescript/commonjs/src/components/Light.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/src/components/LineLayer.d.ts +2 -2
  103. package/lib/typescript/commonjs/src/components/LineLayer.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/src/components/MapView.d.ts +7 -11
  105. package/lib/typescript/commonjs/src/components/MapView.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts +2 -2
  107. package/lib/typescript/commonjs/src/components/RasterLayer.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts +1 -2
  109. package/lib/typescript/commonjs/src/components/ShapeSource.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts +2 -8
  111. package/lib/typescript/commonjs/src/components/SymbolLayer.d.ts.map +1 -1
  112. package/lib/typescript/commonjs/src/components/VectorSource.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts +2 -2
  114. package/lib/typescript/commonjs/src/hooks/useAbstractLayer.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts +1 -1
  116. package/lib/typescript/commonjs/src/modules/offline/OfflinePack.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts +4 -14
  118. package/lib/typescript/commonjs/src/modules/offline/offlineManager.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts +960 -0
  120. package/lib/typescript/commonjs/src/types/MapLibreRNStyles.d.ts.map +1 -0
  121. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts +2 -2
  122. package/lib/typescript/commonjs/src/utils/StyleValue.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts +1 -0
  124. package/lib/typescript/commonjs/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -0
  126. package/lib/typescript/commonjs/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts +1 -0
  128. package/lib/typescript/commonjs/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts +1 -0
  130. package/lib/typescript/commonjs/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/src/utils/filterUtils.d.ts +1 -1
  132. package/lib/typescript/commonjs/src/utils/filterUtils.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts +35 -0
  134. package/lib/typescript/commonjs/src/utils/getStylePropertyType.d.ts.map +1 -0
  135. package/lib/typescript/module/jest.config.d.ts +2 -0
  136. package/lib/typescript/module/jest.config.d.ts.map +1 -0
  137. package/lib/typescript/module/src/MLRNModule.d.ts +3 -7
  138. package/lib/typescript/module/src/MLRNModule.d.ts.map +1 -1
  139. package/lib/typescript/module/src/MapLibreRN.d.ts +5 -8
  140. package/lib/typescript/module/src/MapLibreRN.d.ts.map +1 -1
  141. package/lib/typescript/module/src/components/Annotation.d.ts +2 -2
  142. package/lib/typescript/module/src/components/Annotation.d.ts.map +1 -1
  143. package/lib/typescript/module/src/components/BackgroundLayer.d.ts +2 -2
  144. package/lib/typescript/module/src/components/BackgroundLayer.d.ts.map +1 -1
  145. package/lib/typescript/module/src/components/Camera.d.ts +1 -1
  146. package/lib/typescript/module/src/components/CircleLayer.d.ts +2 -2
  147. package/lib/typescript/module/src/components/CircleLayer.d.ts.map +1 -1
  148. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts +2 -2
  149. package/lib/typescript/module/src/components/FillExtrusionLayer.d.ts.map +1 -1
  150. package/lib/typescript/module/src/components/FillLayer.d.ts +2 -2
  151. package/lib/typescript/module/src/components/FillLayer.d.ts.map +1 -1
  152. package/lib/typescript/module/src/components/HeatmapLayer.d.ts +2 -2
  153. package/lib/typescript/module/src/components/HeatmapLayer.d.ts.map +1 -1
  154. package/lib/typescript/module/src/components/Images.d.ts.map +1 -1
  155. package/lib/typescript/module/src/components/Light.d.ts +2 -2
  156. package/lib/typescript/module/src/components/Light.d.ts.map +1 -1
  157. package/lib/typescript/module/src/components/LineLayer.d.ts +2 -2
  158. package/lib/typescript/module/src/components/LineLayer.d.ts.map +1 -1
  159. package/lib/typescript/module/src/components/MapView.d.ts +7 -11
  160. package/lib/typescript/module/src/components/MapView.d.ts.map +1 -1
  161. package/lib/typescript/module/src/components/RasterLayer.d.ts +2 -2
  162. package/lib/typescript/module/src/components/RasterLayer.d.ts.map +1 -1
  163. package/lib/typescript/module/src/components/ShapeSource.d.ts +1 -2
  164. package/lib/typescript/module/src/components/ShapeSource.d.ts.map +1 -1
  165. package/lib/typescript/module/src/components/SymbolLayer.d.ts +2 -8
  166. package/lib/typescript/module/src/components/SymbolLayer.d.ts.map +1 -1
  167. package/lib/typescript/module/src/components/VectorSource.d.ts.map +1 -1
  168. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts +2 -2
  169. package/lib/typescript/module/src/hooks/useAbstractLayer.d.ts.map +1 -1
  170. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts +1 -1
  171. package/lib/typescript/module/src/modules/offline/OfflinePack.d.ts.map +1 -1
  172. package/lib/typescript/module/src/modules/offline/offlineManager.d.ts +4 -14
  173. package/lib/typescript/module/src/modules/offline/offlineManager.d.ts.map +1 -1
  174. package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts +960 -0
  175. package/lib/typescript/module/src/types/MapLibreRNStyles.d.ts.map +1 -0
  176. package/lib/typescript/module/src/utils/StyleValue.d.ts +2 -2
  177. package/lib/typescript/module/src/utils/StyleValue.d.ts.map +1 -1
  178. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts +1 -0
  179. package/lib/typescript/module/src/utils/animated/AbstractAnimatedCoordinates.d.ts.map +1 -1
  180. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts +1 -0
  181. package/lib/typescript/module/src/utils/animated/AnimatedExtractCoordinateFromArray.d.ts.map +1 -1
  182. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts +1 -0
  183. package/lib/typescript/module/src/utils/animated/AnimatedPoint.d.ts.map +1 -1
  184. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts +1 -0
  185. package/lib/typescript/module/src/utils/animated/AnimatedShape.d.ts.map +1 -1
  186. package/lib/typescript/module/src/utils/filterUtils.d.ts +1 -1
  187. package/lib/typescript/module/src/utils/filterUtils.d.ts.map +1 -1
  188. package/lib/typescript/module/src/utils/getStylePropertyType.d.ts +35 -0
  189. package/lib/typescript/module/src/utils/getStylePropertyType.d.ts.map +1 -0
  190. package/package.json +31 -38
  191. package/plugin/build/withMapLibre.js +6 -6
  192. package/src/MLRNModule.ts +16 -10
  193. package/src/MapLibreRN.ts +22 -23
  194. package/src/components/Annotation.tsx +3 -3
  195. package/src/components/BackgroundLayer.tsx +2 -2
  196. package/src/components/Camera.tsx +1 -1
  197. package/src/components/CircleLayer.tsx +2 -2
  198. package/src/components/FillExtrusionLayer.tsx +2 -2
  199. package/src/components/FillLayer.tsx +2 -2
  200. package/src/components/HeatmapLayer.tsx +2 -2
  201. package/src/components/Images.tsx +1 -10
  202. package/src/components/Light.tsx +2 -2
  203. package/src/components/LineLayer.tsx +2 -2
  204. package/src/components/MapView.tsx +20 -44
  205. package/src/components/RasterLayer.tsx +2 -2
  206. package/src/components/ShapeSource.tsx +9 -77
  207. package/src/components/SymbolLayer.tsx +7 -35
  208. package/src/components/UserLocation.tsx +2 -2
  209. package/src/components/VectorSource.tsx +5 -21
  210. package/src/hooks/useAbstractLayer.ts +3 -3
  211. package/src/modules/offline/OfflinePack.ts +1 -1
  212. package/src/modules/offline/offlineManager.ts +4 -18
  213. package/src/{utils/MapLibreRNStyles.d.ts → types/MapLibreRNStyles.ts} +85 -405
  214. package/src/utils/StyleValue.ts +4 -4
  215. package/src/utils/filterUtils.ts +1 -1
  216. package/src/utils/getStylePropertyType.ts +265 -0
  217. package/android/install.md +0 -32
  218. package/android/src/main/res/values/strings.xml +0 -3
  219. package/ios/install.md +0 -49
  220. package/lib/commonjs/components/Style.js +0 -266
  221. package/lib/commonjs/components/Style.js.map +0 -1
  222. package/lib/commonjs/types/StyleURL.js +0 -11
  223. package/lib/commonjs/types/StyleURL.js.map +0 -1
  224. package/lib/commonjs/utils/MapLibreRNStyles.d.js +0 -181
  225. package/lib/commonjs/utils/MapLibreRNStyles.d.js.map +0 -1
  226. package/lib/commonjs/utils/deprecation.js +0 -31
  227. package/lib/commonjs/utils/deprecation.js.map +0 -1
  228. package/lib/commonjs/utils/styleMap.js +0 -255
  229. package/lib/commonjs/utils/styleMap.js.map +0 -1
  230. package/lib/module/components/Style.js +0 -261
  231. package/lib/module/components/Style.js.map +0 -1
  232. package/lib/module/types/StyleURL.js +0 -7
  233. package/lib/module/types/StyleURL.js.map +0 -1
  234. package/lib/module/utils/MapLibreRNStyles.d.js +0 -180
  235. package/lib/module/utils/MapLibreRNStyles.d.js.map +0 -1
  236. package/lib/module/utils/deprecation.js +0 -27
  237. package/lib/module/utils/deprecation.js.map +0 -1
  238. package/lib/module/utils/styleMap.js +0 -249
  239. package/lib/module/utils/styleMap.js.map +0 -1
  240. package/lib/typescript/commonjs/src/components/Style.d.ts +0 -81
  241. package/lib/typescript/commonjs/src/components/Style.d.ts.map +0 -1
  242. package/lib/typescript/commonjs/src/types/StyleURL.d.ts +0 -4
  243. package/lib/typescript/commonjs/src/types/StyleURL.d.ts.map +0 -1
  244. package/lib/typescript/commonjs/src/utils/deprecation.d.ts +0 -6
  245. package/lib/typescript/commonjs/src/utils/deprecation.d.ts.map +0 -1
  246. package/lib/typescript/commonjs/src/utils/styleMap.d.ts +0 -231
  247. package/lib/typescript/commonjs/src/utils/styleMap.d.ts.map +0 -1
  248. package/lib/typescript/module/src/components/Style.d.ts +0 -81
  249. package/lib/typescript/module/src/components/Style.d.ts.map +0 -1
  250. package/lib/typescript/module/src/types/StyleURL.d.ts +0 -4
  251. package/lib/typescript/module/src/types/StyleURL.d.ts.map +0 -1
  252. package/lib/typescript/module/src/utils/deprecation.d.ts +0 -6
  253. package/lib/typescript/module/src/utils/deprecation.d.ts.map +0 -1
  254. package/lib/typescript/module/src/utils/styleMap.d.ts +0 -231
  255. package/lib/typescript/module/src/utils/styleMap.d.ts.map +0 -1
  256. package/src/components/Style.tsx +0 -371
  257. package/src/types/StyleURL.ts +0 -3
  258. package/src/utils/deprecation.ts +0 -31
  259. package/src/utils/styleMap.ts +0 -265
@@ -1,261 +0,0 @@
1
- "use strict";
2
-
3
- import { useMemo, useState, useEffect } from "react";
4
- import BackgroundLayer from "./BackgroundLayer.js";
5
- import CircleLayer from "./CircleLayer.js";
6
- import FillExtrusionLayer from "./FillExtrusionLayer.js";
7
- import FillLayer from "./FillLayer.js";
8
- import HeatmapLayer from "./HeatmapLayer.js";
9
- import ImageSource from "./ImageSource.js";
10
- import LineLayer from "./LineLayer.js";
11
- import RasterLayer from "./RasterLayer.js";
12
- import RasterSource from "./RasterSource.js";
13
- import ShapeSource from "./ShapeSource.js";
14
- import SymbolLayer from "./SymbolLayer.js";
15
- import VectorSource from "./VectorSource.js";
16
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
17
- function toCamelCase(s) {
18
- return s.replace(/([-_][a-z])/gi, $1 => {
19
- return $1.toUpperCase().replace("-", "").replace("_", "");
20
- });
21
- }
22
-
23
- // Patches the Mapbox Style Specification keys into the style props attributes:
24
- // icon-allow-overlap -> iconAllowOverlap
25
- function toCamelCaseKeys(oldObj) {
26
- if (!oldObj) {
27
- return {};
28
- }
29
- const newObj = {};
30
- Object.keys(oldObj).forEach(key => {
31
- const value = oldObj[key];
32
- if (key.includes("-")) {
33
- newObj[toCamelCase(key)] = value;
34
- } else {
35
- newObj[key] = value;
36
- }
37
- });
38
- return newObj;
39
- }
40
- function getLayerComponentType(layer) {
41
- const {
42
- type
43
- } = layer;
44
- switch (type) {
45
- case "circle":
46
- return CircleLayer;
47
- case "symbol":
48
- return SymbolLayer;
49
- case "raster":
50
- return RasterLayer;
51
- case "line":
52
- return LineLayer;
53
- case "fill":
54
- return FillLayer;
55
- case "fill-extrusion":
56
- return FillExtrusionLayer;
57
- case "background":
58
- return BackgroundLayer;
59
- case "heatmap":
60
- return HeatmapLayer;
61
- }
62
- console.warn(`Mapbox layer type '${type}' is not supported/`);
63
- return null;
64
- }
65
- function asLayerComponent(layer) {
66
- const LayerComponent = getLayerComponentType(layer);
67
- if (!LayerComponent) {
68
- return null;
69
- }
70
- const style = {
71
- ...toCamelCaseKeys(layer.paint),
72
- ...toCamelCaseKeys(layer.layout)
73
- };
74
- const layerProps = {};
75
- if (layer.source) {
76
- layerProps.sourceID = layer.source;
77
- }
78
- if (layer["source-layer"]) {
79
- layerProps.sourceLayerID = layer["source-layer"];
80
- }
81
- if (layer.minzoom) {
82
- layerProps.minZoomLevel = layer.minzoom;
83
- }
84
- if (layer.maxzoom) {
85
- layerProps.maxZoomLevel = layer.maxzoom;
86
- }
87
- if (layer.filter) {
88
- layerProps.filter = layer.filter;
89
- }
90
- if (Object.keys(style).length) {
91
- layerProps.style = style;
92
- }
93
- return /*#__PURE__*/_jsx(LayerComponent, {
94
- id: layer.id,
95
- ...layerProps
96
- }, layer.id);
97
- }
98
- function getTileSourceProps(source) {
99
- const sourceProps = {};
100
- if (source.url) {
101
- sourceProps.url = source.url;
102
- }
103
- if (source.tiles) {
104
- sourceProps.tileUrlTemplates = source.tiles;
105
- }
106
- if (source.minzoom !== undefined) {
107
- sourceProps.minZoomLevel = source.minzoom;
108
- }
109
- if (source.maxzoom !== undefined) {
110
- sourceProps.maxZoomLevel = source.maxzoom;
111
- }
112
- if (source.attribution) {
113
- sourceProps.attribution = source.attribution;
114
- }
115
- if (source.scheme && source.scheme === "tms") {
116
- sourceProps.tms = true;
117
- }
118
- return sourceProps;
119
- }
120
- function getVectorSource(id, source) {
121
- const sourceProps = {
122
- ...getTileSourceProps(source)
123
- };
124
- return /*#__PURE__*/_jsx(VectorSource, {
125
- id: id,
126
- ...sourceProps
127
- }, id);
128
- }
129
- function getRasterSource(id, source) {
130
- const sourceProps = {
131
- ...getTileSourceProps(source)
132
- };
133
- if (source.tileSize) {
134
- sourceProps.tileSize = source.tileSize;
135
- }
136
- return /*#__PURE__*/_jsx(RasterSource, {
137
- id: id,
138
- ...sourceProps
139
- }, id);
140
- }
141
- function getImageSource(id, source) {
142
- const sourceProps = {
143
- url: source.url,
144
- coordinates: source.coordinates
145
- };
146
- return /*#__PURE__*/_jsx(ImageSource, {
147
- id: id,
148
- ...sourceProps
149
- }, id);
150
- }
151
- function getShapeSource(id, source) {
152
- const sourceProps = {};
153
- if (source.data && typeof source.data === "string") {
154
- sourceProps.url = source.data;
155
- } else if (source.data && typeof source.data === "object") {
156
- sourceProps.shape = source.data;
157
- }
158
- if (source.cluster !== undefined) {
159
- sourceProps.cluster = source.cluster;
160
- }
161
- if (source.clusterRadius !== undefined) {
162
- sourceProps.clusterRadius = source.clusterRadius;
163
- }
164
- if (source.maxzoom !== undefined) {
165
- sourceProps.maxZoomLevel = source.maxzoom;
166
- }
167
- if (source.clusterMaxZoom !== undefined) {
168
- sourceProps.clusterMaxZoomLevel = source.clusterMaxZoom;
169
- }
170
- if (source.clusterProperties !== undefined) {
171
- sourceProps.clusterProperties = source.clusterProperties;
172
- }
173
- if (source.buffer !== undefined) {
174
- sourceProps.buffer = source.buffer;
175
- }
176
- if (source.tolerance !== undefined) {
177
- sourceProps.tolerance = source.tolerance;
178
- }
179
- if (source.lineMetrics !== undefined) {
180
- sourceProps.lineMetrics = source.lineMetrics;
181
- }
182
- return /*#__PURE__*/_jsx(ShapeSource, {
183
- id: id,
184
- ...sourceProps
185
- }, id);
186
- }
187
- function asSourceComponent(id, source) {
188
- switch (source.type) {
189
- case "vector":
190
- return getVectorSource(id, source);
191
- case "raster":
192
- return getRasterSource(id, source);
193
- case "image":
194
- return getImageSource(id, source);
195
- case "geojson":
196
- return getShapeSource(id, source);
197
- }
198
- console.warn(`MapLibre source type '${source.type}' is not supported`);
199
- return null;
200
- }
201
- /**
202
- * Style is a component that automatically adds sources / layers to the map using MapLibre Style Spec.
203
- * Only [`sources`](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/) & [`layers`](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/) are supported.
204
- * Other fields such as `sprites`, `glyphs` etc. will be ignored. Not all layer / source attributes from the style spec are supported, in general the supported attributes will be mentioned under https://github.com/maplibre/maplibre-react-native/tree/main/docs.
205
- *
206
- * TODO: Maintainer forking this project does not understand the above comment regarding what is supported.
207
- */
208
- const Style = props => {
209
- const [fetchedJson, setFetchedJson] = useState({});
210
- const json = typeof props.json === "object" ? props.json : fetchedJson;
211
-
212
- // Fetch style when props.json is a URL
213
- useEffect(() => {
214
- const abortController = new AbortController();
215
- const fetchStyleJson = async url => {
216
- try {
217
- const response = await fetch(url, {
218
- signal: abortController.signal
219
- });
220
- const responseJson = await response.json();
221
- setFetchedJson(responseJson);
222
- } catch (error) {
223
- const e = error;
224
- if (e.name === "AbortError") {
225
- return;
226
- }
227
- throw e;
228
- }
229
- };
230
- if (typeof props.json === "string") {
231
- fetchStyleJson(props.json);
232
- }
233
- return function cleanup() {
234
- abortController.abort();
235
- };
236
- }, [props.json]);
237
-
238
- // Extract layer components from json
239
- const layerComponents = useMemo(() => {
240
- if (!json.layers) {
241
- return [];
242
- }
243
- return json.layers.map(asLayerComponent).filter(x => !!x);
244
- }, [json.layers]);
245
-
246
- // Extract source components from json
247
- const sourceComponents = useMemo(() => {
248
- const {
249
- sources
250
- } = json;
251
- if (!sources || !Object.keys(sources)) {
252
- return [];
253
- }
254
- return Object.entries(sources).map(([id, source]) => asSourceComponent(id, source)).filter(x => !!x);
255
- }, [json]);
256
- return /*#__PURE__*/_jsxs(_Fragment, {
257
- children: [sourceComponents, layerComponents]
258
- });
259
- };
260
- export default Style;
261
- //# sourceMappingURL=Style.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useMemo","useState","useEffect","BackgroundLayer","CircleLayer","FillExtrusionLayer","FillLayer","HeatmapLayer","ImageSource","LineLayer","RasterLayer","RasterSource","ShapeSource","SymbolLayer","VectorSource","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","toCamelCase","s","replace","$1","toUpperCase","toCamelCaseKeys","oldObj","newObj","Object","keys","forEach","key","value","includes","getLayerComponentType","layer","type","console","warn","asLayerComponent","LayerComponent","style","paint","layout","layerProps","source","sourceID","sourceLayerID","minzoom","minZoomLevel","maxzoom","maxZoomLevel","filter","length","id","getTileSourceProps","sourceProps","url","tiles","tileUrlTemplates","undefined","attribution","scheme","tms","getVectorSource","getRasterSource","tileSize","getImageSource","coordinates","getShapeSource","data","shape","cluster","clusterRadius","clusterMaxZoom","clusterMaxZoomLevel","clusterProperties","buffer","tolerance","lineMetrics","asSourceComponent","Style","props","fetchedJson","setFetchedJson","json","abortController","AbortController","fetchStyleJson","response","fetch","signal","responseJson","error","e","name","cleanup","abort","layerComponents","layers","map","x","sourceComponents","sources","entries","children"],"sourceRoot":"../../../src","sources":["components/Style.tsx"],"mappings":";;AAAA,SACEA,OAAO,EACPC,QAAQ,EACRC,SAAS,QAGJ,OAAO;AAEd,OAAOC,eAAe,MAAqC,sBAAmB;AAC9E,OAAOC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IAAI,CAACc,MAAM,CACfC,GAAG,CAAC7D,gBAAgB,CAAC,CACrBa,MAAM,CAAEiD,CAAsB,IAAK,CAAC,CAACA,CAAC,CAAC;EAC5C,CAAC,EAAE,CAAChB,IAAI,CAACc,MAAM,CAAC,CAAC;;EAEjB;EACA,MAAMG,gBAAgB,GAAGvG,OAAO,CAAC,MAAM;IACrC,MAAM;MAAEwG;IAAQ,CAAC,GAAGlB,IAAI;IACxB,IAAI,CAACkB,OAAO,IAAI,CAAC3E,MAAM,CAACC,IAAI,CAAC0E,OAAO,CAAC,EAAE;MACrC,OAAO,EAAE;IACX;IACA,OAAO3E,MAAM,CAAC4E,OAAO,CAACD,OAAO,CAAC,CAC3BH,GAAG,CAAC,CAAC,CAAC9C,EAAE,EAAET,MAAM,CAAC,KAAKmC,iBAAiB,CAAC1B,EAAE,EAAET,MAAM,CAAC,CAAC,CACpDO,MAAM,CAAEiD,CAAC,IAAK,CAAC,CAACA,CAAC,CAAC;EACvB,CAAC,EAAE,CAAChB,IAAI,CAAC,CAAC;EAEV,oBACElE,KAAA,CAAAF,SAAA;IAAAwF,QAAA,GACGH,gBAAgB,EAChBJ,eAAe;EAAA,CAChB,CAAC;AAEP,CAAC;AAED,eAAejB,KAAK","ignoreList":[]}
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- export let StyleURL = /*#__PURE__*/function (StyleURL) {
4
- StyleURL["Default"] = "https://demotiles.maplibre.org/style.json";
5
- return StyleURL;
6
- }({});
7
- //# sourceMappingURL=StyleURL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["StyleURL"],"sourceRoot":"../../../src","sources":["types/StyleURL.ts"],"mappings":";;AAAA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
@@ -1,180 +0,0 @@
1
- "use strict";
2
-
3
- // DO NOT MODIFY
4
- // This file is auto-generated from scripts/templates/MapLibreRNStyles.ts.ejs
5
-
6
- /* TODO */
7
-
8
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
-
10
- export let VisibilityEnum = /*#__PURE__*/function (VisibilityEnum) {
11
- VisibilityEnum["Visible"] = "visible";
12
- VisibilityEnum["None"] = "none";
13
- return VisibilityEnum;
14
- }({});
15
- export let FillTranslateAnchorEnum = /*#__PURE__*/function (FillTranslateAnchorEnum) {
16
- FillTranslateAnchorEnum["Map"] = "map";
17
- FillTranslateAnchorEnum["Viewport"] = "viewport";
18
- return FillTranslateAnchorEnum;
19
- }({});
20
- export let LineCapEnum = /*#__PURE__*/function (LineCapEnum) {
21
- LineCapEnum["Butt"] = "butt";
22
- LineCapEnum["Round"] = "round";
23
- LineCapEnum["Square"] = "square";
24
- return LineCapEnum;
25
- }({});
26
- export let LineJoinEnum = /*#__PURE__*/function (LineJoinEnum) {
27
- LineJoinEnum["Bevel"] = "bevel";
28
- LineJoinEnum["Round"] = "round";
29
- LineJoinEnum["Miter"] = "miter";
30
- return LineJoinEnum;
31
- }({});
32
- export let LineTranslateAnchorEnum = /*#__PURE__*/function (LineTranslateAnchorEnum) {
33
- LineTranslateAnchorEnum["Map"] = "map";
34
- LineTranslateAnchorEnum["Viewport"] = "viewport";
35
- return LineTranslateAnchorEnum;
36
- }({});
37
- export let SymbolPlacementEnum = /*#__PURE__*/function (SymbolPlacementEnum) {
38
- SymbolPlacementEnum["Point"] = "point";
39
- SymbolPlacementEnum["Line"] = "line";
40
- SymbolPlacementEnum["LineCenter"] = "line-center";
41
- return SymbolPlacementEnum;
42
- }({});
43
- export let SymbolZOrderEnum = /*#__PURE__*/function (SymbolZOrderEnum) {
44
- SymbolZOrderEnum["Auto"] = "auto";
45
- SymbolZOrderEnum["ViewportY"] = "viewport-y";
46
- SymbolZOrderEnum["Source"] = "source";
47
- return SymbolZOrderEnum;
48
- }({});
49
- export let IconRotationAlignmentEnum = /*#__PURE__*/function (IconRotationAlignmentEnum) {
50
- IconRotationAlignmentEnum["Map"] = "map";
51
- IconRotationAlignmentEnum["Viewport"] = "viewport";
52
- IconRotationAlignmentEnum["Auto"] = "auto";
53
- return IconRotationAlignmentEnum;
54
- }({});
55
- export let IconTextFitEnum = /*#__PURE__*/function (IconTextFitEnum) {
56
- IconTextFitEnum["None"] = "none";
57
- IconTextFitEnum["Width"] = "width";
58
- IconTextFitEnum["Height"] = "height";
59
- IconTextFitEnum["Both"] = "both";
60
- return IconTextFitEnum;
61
- }({});
62
- export let IconAnchorEnum = /*#__PURE__*/function (IconAnchorEnum) {
63
- IconAnchorEnum["Center"] = "center";
64
- IconAnchorEnum["Left"] = "left";
65
- IconAnchorEnum["Right"] = "right";
66
- IconAnchorEnum["Top"] = "top";
67
- IconAnchorEnum["Bottom"] = "bottom";
68
- IconAnchorEnum["TopLeft"] = "top-left";
69
- IconAnchorEnum["TopRight"] = "top-right";
70
- IconAnchorEnum["BottomLeft"] = "bottom-left";
71
- IconAnchorEnum["BottomRight"] = "bottom-right";
72
- return IconAnchorEnum;
73
- }({});
74
- export let IconPitchAlignmentEnum = /*#__PURE__*/function (IconPitchAlignmentEnum) {
75
- IconPitchAlignmentEnum["Map"] = "map";
76
- IconPitchAlignmentEnum["Viewport"] = "viewport";
77
- IconPitchAlignmentEnum["Auto"] = "auto";
78
- return IconPitchAlignmentEnum;
79
- }({});
80
- export let TextPitchAlignmentEnum = /*#__PURE__*/function (TextPitchAlignmentEnum) {
81
- TextPitchAlignmentEnum["Map"] = "map";
82
- TextPitchAlignmentEnum["Viewport"] = "viewport";
83
- TextPitchAlignmentEnum["Auto"] = "auto";
84
- return TextPitchAlignmentEnum;
85
- }({});
86
- export let TextRotationAlignmentEnum = /*#__PURE__*/function (TextRotationAlignmentEnum) {
87
- TextRotationAlignmentEnum["Map"] = "map";
88
- TextRotationAlignmentEnum["Viewport"] = "viewport";
89
- TextRotationAlignmentEnum["ViewportGlyph"] = "viewport-glyph";
90
- TextRotationAlignmentEnum["Auto"] = "auto";
91
- return TextRotationAlignmentEnum;
92
- }({});
93
- export let TextJustifyEnum = /*#__PURE__*/function (TextJustifyEnum) {
94
- TextJustifyEnum["Auto"] = "auto";
95
- TextJustifyEnum["Left"] = "left";
96
- TextJustifyEnum["Center"] = "center";
97
- TextJustifyEnum["Right"] = "right";
98
- return TextJustifyEnum;
99
- }({});
100
- export let TextVariableAnchorEnum = /*#__PURE__*/function (TextVariableAnchorEnum) {
101
- TextVariableAnchorEnum["Center"] = "center";
102
- TextVariableAnchorEnum["Left"] = "left";
103
- TextVariableAnchorEnum["Right"] = "right";
104
- TextVariableAnchorEnum["Top"] = "top";
105
- TextVariableAnchorEnum["Bottom"] = "bottom";
106
- TextVariableAnchorEnum["TopLeft"] = "top-left";
107
- TextVariableAnchorEnum["TopRight"] = "top-right";
108
- TextVariableAnchorEnum["BottomLeft"] = "bottom-left";
109
- TextVariableAnchorEnum["BottomRight"] = "bottom-right";
110
- return TextVariableAnchorEnum;
111
- }({});
112
- export let TextAnchorEnum = /*#__PURE__*/function (TextAnchorEnum) {
113
- TextAnchorEnum["Center"] = "center";
114
- TextAnchorEnum["Left"] = "left";
115
- TextAnchorEnum["Right"] = "right";
116
- TextAnchorEnum["Top"] = "top";
117
- TextAnchorEnum["Bottom"] = "bottom";
118
- TextAnchorEnum["TopLeft"] = "top-left";
119
- TextAnchorEnum["TopRight"] = "top-right";
120
- TextAnchorEnum["BottomLeft"] = "bottom-left";
121
- TextAnchorEnum["BottomRight"] = "bottom-right";
122
- return TextAnchorEnum;
123
- }({});
124
- export let TextWritingModeEnum = /*#__PURE__*/function (TextWritingModeEnum) {
125
- TextWritingModeEnum["Horizontal"] = "horizontal";
126
- TextWritingModeEnum["Vertical"] = "vertical";
127
- return TextWritingModeEnum;
128
- }({});
129
- export let TextTransformEnum = /*#__PURE__*/function (TextTransformEnum) {
130
- TextTransformEnum["None"] = "none";
131
- TextTransformEnum["Uppercase"] = "uppercase";
132
- TextTransformEnum["Lowercase"] = "lowercase";
133
- return TextTransformEnum;
134
- }({});
135
- export let IconTranslateAnchorEnum = /*#__PURE__*/function (IconTranslateAnchorEnum) {
136
- IconTranslateAnchorEnum["Map"] = "map";
137
- IconTranslateAnchorEnum["Viewport"] = "viewport";
138
- return IconTranslateAnchorEnum;
139
- }({});
140
- export let TextTranslateAnchorEnum = /*#__PURE__*/function (TextTranslateAnchorEnum) {
141
- TextTranslateAnchorEnum["Map"] = "map";
142
- TextTranslateAnchorEnum["Viewport"] = "viewport";
143
- return TextTranslateAnchorEnum;
144
- }({});
145
- export let CircleTranslateAnchorEnum = /*#__PURE__*/function (CircleTranslateAnchorEnum) {
146
- CircleTranslateAnchorEnum["Map"] = "map";
147
- CircleTranslateAnchorEnum["Viewport"] = "viewport";
148
- return CircleTranslateAnchorEnum;
149
- }({});
150
- export let CirclePitchScaleEnum = /*#__PURE__*/function (CirclePitchScaleEnum) {
151
- CirclePitchScaleEnum["Map"] = "map";
152
- CirclePitchScaleEnum["Viewport"] = "viewport";
153
- return CirclePitchScaleEnum;
154
- }({});
155
- export let CirclePitchAlignmentEnum = /*#__PURE__*/function (CirclePitchAlignmentEnum) {
156
- CirclePitchAlignmentEnum["Map"] = "map";
157
- CirclePitchAlignmentEnum["Viewport"] = "viewport";
158
- return CirclePitchAlignmentEnum;
159
- }({});
160
- export let FillExtrusionTranslateAnchorEnum = /*#__PURE__*/function (FillExtrusionTranslateAnchorEnum) {
161
- FillExtrusionTranslateAnchorEnum["Map"] = "map";
162
- FillExtrusionTranslateAnchorEnum["Viewport"] = "viewport";
163
- return FillExtrusionTranslateAnchorEnum;
164
- }({});
165
- export let RasterResamplingEnum = /*#__PURE__*/function (RasterResamplingEnum) {
166
- RasterResamplingEnum["Linear"] = "linear";
167
- RasterResamplingEnum["Nearest"] = "nearest";
168
- return RasterResamplingEnum;
169
- }({});
170
- export let HillshadeIlluminationAnchorEnum = /*#__PURE__*/function (HillshadeIlluminationAnchorEnum) {
171
- HillshadeIlluminationAnchorEnum["Map"] = "map";
172
- HillshadeIlluminationAnchorEnum["Viewport"] = "viewport";
173
- return HillshadeIlluminationAnchorEnum;
174
- }({});
175
- export let AnchorEnum = /*#__PURE__*/function (AnchorEnum) {
176
- AnchorEnum["Map"] = "map";
177
- AnchorEnum["Viewport"] = "viewport";
178
- return AnchorEnum;
179
- }({});
180
- //# sourceMappingURL=MapLibreRNStyles.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["VisibilityEnum","FillTranslateAnchorEnum","LineCapEnum","LineJoinEnum","LineTranslateAnchorEnum","SymbolPlacementEnum","SymbolZOrderEnum","IconRotationAlignmentEnum","IconTextFitEnum","IconAnchorEnum","IconPitchAlignmentEnum","TextPitchAlignmentEnum","TextRotationAlignmentEnum","TextJustifyEnum","TextVariableAnchorEnum","TextAnchorEnum","TextWritingModeEnum","TextTransformEnum","IconTranslateAnchorEnum","TextTranslateAnchorEnum","CircleTranslateAnchorEnum","CirclePitchScaleEnum","CirclePitchAlignmentEnum","FillExtrusionTranslateAnchorEnum","RasterResamplingEnum","HillshadeIlluminationAnchorEnum","AnchorEnum"],"sourceRoot":"../../../src","sources":["utils/MapLibreRNStyles.d.ts"],"mappings":";;AAAA;AACA;;AAWsC;;AAuHtC;;AAKA,WAAYA,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAO1B,WAAYC,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;AAOnC,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AASvB,WAAYC,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AASxB,WAAYC,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;AAOnC,WAAYC,mBAAmB,0BAAnBA,mBAAmB;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0BAA/BA,+BAA+B;EAA/BA,+BAA+B;EAA/BA,+BAA+B;EAAA,OAA/BA,+BAA+B;AAAA;AAO3C,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA","ignoreList":[]}
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Copy properties from origObject to newObject, which not exists in newObject,
5
- * calls onDeprecatedCalled callback in case a copied property is invoked.
6
- */
7
-
8
- export function copyPropertiesAsDeprecated(origObject, newObject, onDeprecatedCalled, accessors = {}) {
9
- const result = {
10
- ...newObject
11
- };
12
- for (const [key, value] of Object.entries(origObject)) {
13
- if (!(key in newObject)) {
14
- Object.defineProperty(result, key, {
15
- get() {
16
- onDeprecatedCalled(key);
17
- return accessors[key] ? accessors[key](value) : value;
18
- },
19
- enumerable: true,
20
- // Ensure the property is enumerable
21
- configurable: true // Ensure the property can be reconfigured
22
- });
23
- }
24
- }
25
- return result;
26
- }
27
- //# sourceMappingURL=deprecation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["copyPropertiesAsDeprecated","origObject","newObject","onDeprecatedCalled","accessors","result","key","value","Object","entries","defineProperty","get","enumerable","configurable"],"sourceRoot":"../../../src","sources":["utils/deprecation.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,0BAA0BA,CAIxCC,UAA0B,EAC1BC,SAA6B,EAC7BC,kBAAyC,EACzCC,SAAkD,GAAG,CAAC,CAAC,EACnC;EACpB,MAAMC,MAAM,GAAG;IAAE,GAAGH;EAAU,CAAC;EAE/B,KAAK,MAAM,CAACI,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACR,UAAU,CAAC,EAAE;IACrD,IAAI,EAAEK,GAAG,IAAIJ,SAAS,CAAC,EAAE;MACvBM,MAAM,CAACE,cAAc,CAACL,MAAM,EAAEC,GAAG,EAAE;QACjCK,GAAGA,CAAA,EAAG;UACJR,kBAAkB,CAACG,GAAG,CAAC;UACvB,OAAOF,SAAS,CAACE,GAAG,CAAC,GAAGF,SAAS,CAACE,GAAG,CAAC,CAACC,KAAK,CAAC,GAAGA,KAAK;QACvD,CAAC;QACDK,UAAU,EAAE,IAAI;QAAE;QAClBC,YAAY,EAAE,IAAI,CAAE;MACtB,CAAC,CAAC;IACJ;EACF;EAEA,OAAOR,MAAM;AACf","ignoreList":[]}