@aguacerowx/react-native 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/README.md +51 -6
  2. package/android/build/.transforms/78b892a9dae44f36e51ff0649e9c6e36/transformed/classes/classes_dex/classes.dex +0 -0
  3. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.dex +0 -0
  4. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayer.dex +0 -0
  5. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayerView.dex +0 -0
  6. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderManager.dex +0 -0
  7. package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/WeatherFrameProcessorModule.dex +0 -0
  8. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  9. package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  10. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
  11. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  12. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  13. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  14. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  15. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  16. package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +16 -2
  17. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  18. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  19. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  20. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  21. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  22. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  23. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer$VertexInfo.class.uniqueId0 +0 -0
  24. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer.class.uniqueId1 +0 -0
  25. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  26. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  27. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +9 -51
  28. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +8 -2
  29. package/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +15 -14
  30. package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +15 -0
  31. package/android/src/main/res/raw/fragment_shader.glsl +13 -2
  32. package/ios/GridRenderLayer.swift +62 -0
  33. package/ios/GridRenderLayerManager.mm +140 -0
  34. package/ios/aguacerowx-react-native.podspec +29 -0
  35. package/lib/commonjs/README.md +61 -0
  36. package/lib/commonjs/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +10 -0
  37. package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +8 -0
  38. package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  39. package/lib/commonjs/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  40. package/lib/commonjs/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  41. package/lib/commonjs/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  42. package/lib/commonjs/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  43. package/lib/commonjs/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +4 -0
  44. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
  45. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
  46. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  47. package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
  48. package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +5 -0
  49. package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  50. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  51. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  52. package/lib/commonjs/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  53. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  54. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  55. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  56. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  57. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  58. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  59. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  60. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  61. package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  62. package/lib/commonjs/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +6 -0
  63. package/lib/commonjs/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +8 -0
  64. package/lib/commonjs/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +8 -0
  65. package/lib/commonjs/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  66. package/lib/commonjs/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  67. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +13 -0
  68. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +13 -0
  69. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +101 -0
  70. package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +20 -0
  71. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  72. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  73. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  74. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  75. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  76. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  77. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  78. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  79. package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  80. package/lib/commonjs/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  81. package/lib/commonjs/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +5 -0
  82. package/lib/commonjs/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
  83. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer$VertexInfo.class.uniqueId0 +0 -0
  84. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer.class.uniqueId1 +0 -0
  85. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  86. package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  87. package/lib/commonjs/android/build.gradle +85 -0
  88. package/lib/commonjs/android/src/main/AndroidManifest.xml +7 -0
  89. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +34 -0
  90. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +597 -0
  91. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +293 -0
  92. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +112 -0
  93. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +64 -0
  94. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +107 -0
  95. package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +166 -0
  96. package/lib/commonjs/android/src/main/res/raw/debug_fragment_shader.glsl +13 -0
  97. package/lib/commonjs/android/src/main/res/raw/debug_vertex_shader.glsl +13 -0
  98. package/lib/commonjs/android/src/main/res/raw/fragment_shader.glsl +98 -0
  99. package/lib/commonjs/android/src/main/res/raw/vertex_shader.glsl +20 -0
  100. package/lib/commonjs/babel.config.js +7 -0
  101. package/lib/commonjs/babel.config.js.map +1 -0
  102. package/lib/commonjs/index.js +20 -0
  103. package/lib/commonjs/index.js.map +1 -0
  104. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +1003 -0
  105. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -0
  106. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +381 -0
  107. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -0
  108. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +1229 -0
  109. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -0
  110. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +4023 -0
  111. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -0
  112. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js +38 -0
  113. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -0
  114. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +30 -0
  115. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -0
  116. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +27 -0
  117. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -0
  118. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js +47 -0
  119. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -0
  120. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +301 -0
  121. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -0
  122. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +126 -0
  123. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -0
  124. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/package.json +48 -0
  125. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +972 -0
  126. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -0
  127. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +381 -0
  128. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -0
  129. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +1229 -0
  130. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -0
  131. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +4023 -0
  132. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -0
  133. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js +38 -0
  134. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -0
  135. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +30 -0
  136. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -0
  137. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +27 -0
  138. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -0
  139. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js +41 -0
  140. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -0
  141. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +301 -0
  142. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -0
  143. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +126 -0
  144. package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -0
  145. package/lib/commonjs/package.json +73 -0
  146. package/lib/commonjs/react-native-builder-bob.config.js +13 -0
  147. package/lib/commonjs/react-native-builder-bob.config.js.map +1 -0
  148. package/lib/commonjs/src/AguaceroContext.js +11 -0
  149. package/lib/commonjs/src/AguaceroContext.js.map +1 -0
  150. package/lib/commonjs/src/GridRenderLayer.js +159 -0
  151. package/lib/commonjs/src/GridRenderLayer.js.map +1 -0
  152. package/lib/commonjs/src/GridRenderLayerNativeComponent.js +11 -0
  153. package/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -0
  154. package/lib/commonjs/src/MapManager.js +164 -0
  155. package/lib/commonjs/src/MapManager.js.map +1 -0
  156. package/lib/commonjs/src/MapRegistry.js +36 -0
  157. package/lib/commonjs/src/MapRegistry.js.map +1 -0
  158. package/lib/commonjs/src/StyleApplicator.js +262 -0
  159. package/lib/commonjs/src/StyleApplicator.js.map +1 -0
  160. package/lib/commonjs/src/WeatherLayerManager.js +731 -0
  161. package/lib/commonjs/src/WeatherLayerManager.js.map +1 -0
  162. package/lib/commonjs/tsconfig.json +24 -0
  163. package/lib/module/README.md +61 -0
  164. package/lib/module/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +10 -0
  165. package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +8 -0
  166. package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  167. package/lib/module/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  168. package/lib/module/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  169. package/lib/module/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  170. package/lib/module/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  171. package/lib/module/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +4 -0
  172. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
  173. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
  174. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
  175. package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
  176. package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +5 -0
  177. package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  178. package/lib/module/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  179. package/lib/module/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  180. package/lib/module/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  181. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  182. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  183. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  184. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  185. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  186. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  187. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  188. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  189. package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  190. package/lib/module/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +6 -0
  191. package/lib/module/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +8 -0
  192. package/lib/module/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +8 -0
  193. package/lib/module/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  194. package/lib/module/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  195. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +13 -0
  196. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +13 -0
  197. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +101 -0
  198. package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +20 -0
  199. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
  200. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
  201. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
  202. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
  203. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
  204. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
  205. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
  206. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
  207. package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
  208. package/lib/module/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  209. package/lib/module/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +5 -0
  210. package/lib/module/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
  211. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer$VertexInfo.class.uniqueId0 +0 -0
  212. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayer.class.uniqueId1 +0 -0
  213. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
  214. package/lib/module/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  215. package/lib/module/android/build.gradle +85 -0
  216. package/lib/module/android/src/main/AndroidManifest.xml +7 -0
  217. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +34 -0
  218. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +597 -0
  219. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +293 -0
  220. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +112 -0
  221. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +64 -0
  222. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +107 -0
  223. package/lib/module/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +166 -0
  224. package/lib/module/android/src/main/res/raw/debug_fragment_shader.glsl +13 -0
  225. package/lib/module/android/src/main/res/raw/debug_vertex_shader.glsl +13 -0
  226. package/lib/module/android/src/main/res/raw/fragment_shader.glsl +98 -0
  227. package/lib/module/android/src/main/res/raw/vertex_shader.glsl +20 -0
  228. package/lib/module/babel.config.js +5 -0
  229. package/lib/module/babel.config.js.map +1 -0
  230. package/lib/module/index.js +3 -0
  231. package/lib/module/index.js.map +1 -0
  232. package/lib/module/lib/commonjs/README.md +61 -0
  233. package/lib/module/lib/commonjs/android/build.gradle +85 -0
  234. package/lib/module/lib/commonjs/android/src/main/AndroidManifest.xml +7 -0
  235. package/lib/module/lib/commonjs/babel.config.js +7 -0
  236. package/lib/module/lib/commonjs/babel.config.js.map +1 -0
  237. package/lib/module/lib/commonjs/index.js +20 -0
  238. package/lib/module/lib/commonjs/index.js.map +1 -0
  239. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +1003 -0
  240. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -0
  241. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +381 -0
  242. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -0
  243. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +1229 -0
  244. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -0
  245. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +4023 -0
  246. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -0
  247. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js +38 -0
  248. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -0
  249. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +30 -0
  250. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -0
  251. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +27 -0
  252. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -0
  253. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js +47 -0
  254. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -0
  255. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +301 -0
  256. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -0
  257. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +126 -0
  258. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -0
  259. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/package.json +48 -0
  260. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +976 -0
  261. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -0
  262. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +381 -0
  263. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -0
  264. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +1229 -0
  265. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -0
  266. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +4023 -0
  267. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -0
  268. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js +38 -0
  269. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -0
  270. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +30 -0
  271. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -0
  272. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +27 -0
  273. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -0
  274. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js +41 -0
  275. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -0
  276. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +301 -0
  277. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -0
  278. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +126 -0
  279. package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -0
  280. package/lib/module/lib/commonjs/package.json +73 -0
  281. package/lib/module/lib/commonjs/react-native-builder-bob.config.js +13 -0
  282. package/lib/module/lib/commonjs/react-native-builder-bob.config.js.map +1 -0
  283. package/lib/module/lib/commonjs/src/AguaceroContext.js +15 -0
  284. package/lib/module/lib/commonjs/src/AguaceroContext.js.map +1 -0
  285. package/lib/module/lib/commonjs/src/GridRenderLayer.js +182 -0
  286. package/lib/module/lib/commonjs/src/GridRenderLayer.js.map +1 -0
  287. package/lib/module/lib/commonjs/src/GridRenderLayerNativeComponent.js +15 -0
  288. package/lib/module/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -0
  289. package/lib/module/lib/commonjs/src/MapManager.js +187 -0
  290. package/lib/module/lib/commonjs/src/MapManager.js.map +1 -0
  291. package/lib/module/lib/commonjs/src/MapRegistry.js +36 -0
  292. package/lib/module/lib/commonjs/src/MapRegistry.js.map +1 -0
  293. package/lib/module/lib/commonjs/src/StyleApplicator.js +286 -0
  294. package/lib/module/lib/commonjs/src/StyleApplicator.js.map +1 -0
  295. package/lib/module/lib/commonjs/src/WeatherLayerManager.js +750 -0
  296. package/lib/module/lib/commonjs/src/WeatherLayerManager.js.map +1 -0
  297. package/lib/module/lib/commonjs/tsconfig.json +24 -0
  298. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js +1003 -0
  299. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -0
  300. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js +381 -0
  301. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -0
  302. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js +1229 -0
  303. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -0
  304. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js +4023 -0
  305. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -0
  306. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/events.js +38 -0
  307. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -0
  308. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js +30 -0
  309. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -0
  310. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js +27 -0
  311. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -0
  312. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/index.js +47 -0
  313. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -0
  314. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js +301 -0
  315. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -0
  316. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js +126 -0
  317. package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -0
  318. package/lib/module/node_modules/@aguacerowx/javascript-sdk/package.json +48 -0
  319. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js +964 -0
  320. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -0
  321. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js +375 -0
  322. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -0
  323. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js +1223 -0
  324. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -0
  325. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js +4017 -0
  326. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -0
  327. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/events.js +31 -0
  328. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -0
  329. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js +29 -0
  330. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -0
  331. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js +21 -0
  332. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -0
  333. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/index.js +12 -0
  334. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -0
  335. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js +295 -0
  336. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -0
  337. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js +119 -0
  338. package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -0
  339. package/lib/module/package.json +73 -0
  340. package/lib/module/react-native-builder-bob.config.js +11 -0
  341. package/lib/module/react-native-builder-bob.config.js.map +1 -0
  342. package/lib/module/src/AguaceroContext.js +5 -0
  343. package/lib/module/src/AguaceroContext.js.map +1 -0
  344. package/lib/module/src/GridRenderLayer.js +152 -0
  345. package/lib/module/src/GridRenderLayer.js.map +1 -0
  346. package/lib/module/src/GridRenderLayerNativeComponent.js +5 -0
  347. package/lib/module/src/GridRenderLayerNativeComponent.js.map +1 -0
  348. package/lib/module/src/MapManager.js +155 -0
  349. package/lib/module/src/MapManager.js.map +1 -0
  350. package/lib/module/src/MapRegistry.js +30 -0
  351. package/lib/module/src/MapRegistry.js.map +1 -0
  352. package/lib/module/src/StyleApplicator.js +255 -0
  353. package/lib/module/src/StyleApplicator.js.map +1 -0
  354. package/lib/module/src/WeatherLayerManager.js +724 -0
  355. package/lib/module/src/WeatherLayerManager.js.map +1 -0
  356. package/lib/module/tsconfig.json +24 -0
  357. package/lib/typescript/babel.config.d.ts +3 -0
  358. package/lib/typescript/babel.config.d.ts.map +1 -0
  359. package/lib/typescript/index.d.ts +3 -0
  360. package/lib/typescript/index.d.ts.map +1 -0
  361. package/lib/typescript/react-native-builder-bob.config.d.ts +6 -0
  362. package/lib/typescript/react-native-builder-bob.config.d.ts.map +1 -0
  363. package/lib/typescript/src/AguaceroContext.d.ts +2 -0
  364. package/lib/typescript/src/AguaceroContext.d.ts.map +1 -0
  365. package/lib/typescript/src/GridRenderLayer.d.ts +2 -0
  366. package/lib/typescript/src/GridRenderLayer.d.ts.map +1 -0
  367. package/lib/typescript/src/GridRenderLayerNativeComponent.d.ts +12 -0
  368. package/lib/typescript/src/GridRenderLayerNativeComponent.d.ts.map +1 -0
  369. package/lib/typescript/src/MapManager.d.ts +8 -0
  370. package/lib/typescript/src/MapManager.d.ts.map +1 -0
  371. package/lib/typescript/src/MapRegistry.d.ts +12 -0
  372. package/lib/typescript/src/MapRegistry.d.ts.map +1 -0
  373. package/lib/typescript/src/StyleApplicator.d.ts +4 -0
  374. package/lib/typescript/src/StyleApplicator.d.ts.map +1 -0
  375. package/lib/typescript/src/WeatherLayerManager.d.ts +2 -0
  376. package/lib/typescript/src/WeatherLayerManager.d.ts.map +1 -0
  377. package/package.json +53 -15
  378. package/src/AguaceroContext.js +0 -4
  379. package/src/GridRenderLayer.js +0 -121
  380. package/src/MapManager.js +0 -158
  381. package/src/MapRegistry.js +0 -35
  382. package/src/StyleApplicator.js +0 -241
  383. package/src/WeatherLayerManager.js +0 -754
@@ -0,0 +1,976 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AguaceroCore = void 0;
7
+ var _events = require("./events.js");
8
+ var _coordinate_configs = require("./coordinate_configs.js");
9
+ var _unitConversions = require("./unitConversions.js");
10
+ var _dictionaries = require("./dictionaries.js");
11
+ var _defaultColormaps = require("./default-colormaps.js");
12
+ var _proj = _interopRequireDefault(require("proj4"));
13
+ var _fzstd = require("fzstd");
14
+ var _getBundleId = require("./getBundleId");
15
+ function _interopRequireDefault(e) {
16
+ return e && e.__esModule ? e : {
17
+ default: e
18
+ };
19
+ }
20
+ // AguaceroCore.js - The Headless "Engine"
21
+
22
+ // --- Non-UI Imports ---
23
+
24
+ // --- Non-UI Helper Functions ---
25
+ function hrdpsObliqueTransform(rotated_lon, rotated_lat) {
26
+ const o_lat_p = 53.91148;
27
+ const o_lon_p = 245.305142;
28
+ const DEG_TO_RAD = Math.PI / 180.0;
29
+ const RAD_TO_DEG = 180.0 / Math.PI;
30
+ const o_lat_p_rad = o_lat_p * DEG_TO_RAD;
31
+ const rot_lon_rad = rotated_lon * DEG_TO_RAD;
32
+ const rot_lat_rad = rotated_lat * DEG_TO_RAD;
33
+ const sin_rot_lat = Math.sin(rot_lat_rad);
34
+ const cos_rot_lat = Math.cos(rot_lat_rad);
35
+ const sin_rot_lon = Math.sin(rot_lon_rad);
36
+ const cos_rot_lon = Math.cos(rot_lon_rad);
37
+ const sin_o_lat_p = Math.sin(o_lat_p_rad);
38
+ const cos_o_lat_p = Math.cos(o_lat_p_rad);
39
+ const sin_lat = cos_o_lat_p * sin_rot_lat + sin_o_lat_p * cos_rot_lat * cos_rot_lon;
40
+ let lat = Math.asin(sin_lat) * RAD_TO_DEG;
41
+ const sin_lon_num = cos_rot_lat * sin_rot_lon;
42
+ const sin_lon_den = -sin_o_lat_p * sin_rot_lat + cos_o_lat_p * cos_rot_lat * cos_rot_lon;
43
+ let lon = Math.atan2(sin_lon_num, sin_lon_den) * RAD_TO_DEG + o_lon_p;
44
+ if (lon > 180) lon -= 360;else if (lon < -180) lon += 360;
45
+ return [lon, lat];
46
+ }
47
+ function findLatestModelRun(modelsData, modelName) {
48
+ const model = modelsData?.[modelName];
49
+ if (!model) return null;
50
+ const availableDates = Object.keys(model).sort((a, b) => b.localeCompare(a));
51
+ for (const date of availableDates) {
52
+ const runs = model[date];
53
+ if (!runs) continue;
54
+ const availableRuns = Object.keys(runs).sort((a, b) => b.localeCompare(a));
55
+ if (availableRuns.length > 0) return {
56
+ date: date,
57
+ run: availableRuns[0]
58
+ };
59
+ }
60
+ return null;
61
+ }
62
+ class AguaceroCore extends _events.EventEmitter {
63
+ constructor(options = {}) {
64
+ super();
65
+ this.isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
66
+ this.apiKey = options.apiKey;
67
+ this.bundleId = (0, _getBundleId.getBundleId)();
68
+ this.baseGridUrl = 'https://d3dc62msmxkrd7.cloudfront.net';
69
+ if (!this.isReactNative) {
70
+ this.worker = this.createWorker();
71
+ this.workerRequestId = 0;
72
+ this.workerResolvers = new Map();
73
+ this.worker.addEventListener('message', this._handleWorkerMessage.bind(this));
74
+ this.resultQueue = [];
75
+ this.isProcessingQueue = false;
76
+ } else {
77
+ this.worker = null;
78
+ }
79
+ this.statusUrl = 'https://d3dc62msmxkrd7.cloudfront.net/model-status';
80
+ this.modelStatus = null;
81
+ this.mrmsStatus = null;
82
+ this.dataCache = new Map();
83
+ this.abortControllers = new Map();
84
+ this.isPlaying = false;
85
+ this.playIntervalId = null;
86
+ this.playbackSpeed = options.playbackSpeed || 500;
87
+ this.customColormaps = options.customColormaps || {};
88
+ const userLayerOptions = options.layerOptions || {};
89
+ const initialVariable = userLayerOptions.variable || null;
90
+ this.state = {
91
+ model: userLayerOptions.model || 'gfs',
92
+ isMRMS: false,
93
+ mrmsTimestamp: null,
94
+ variable: initialVariable,
95
+ date: null,
96
+ run: null,
97
+ forecastHour: 0,
98
+ visible: true,
99
+ opacity: userLayerOptions.opacity ?? 1,
100
+ units: options.initialUnit || 'imperial',
101
+ shaderSmoothingEnabled: options.shaderSmoothingEnabled ?? true
102
+ };
103
+ this.autoRefreshEnabled = options.autoRefresh ?? false;
104
+ this.autoRefreshIntervalSeconds = options.autoRefreshInterval ?? 60;
105
+ this.autoRefreshIntervalId = null;
106
+ }
107
+ async setState(newState) {
108
+ Object.assign(this.state, newState);
109
+ this._emitStateChange();
110
+ }
111
+ _emitStateChange() {
112
+ const {
113
+ colormap,
114
+ baseUnit
115
+ } = this._getColormapForVariable(this.state.variable);
116
+ const toUnit = this._getTargetUnit(baseUnit, this.state.units);
117
+ const displayColormap = this._convertColormapUnits(colormap, baseUnit, toUnit);
118
+ let availableTimestamps = [];
119
+ if (this.state.isMRMS && this.state.variable && this.mrmsStatus) {
120
+ const timestamps = this.mrmsStatus[this.state.variable] || [];
121
+ availableTimestamps = [...timestamps].reverse();
122
+ }
123
+ const eventPayload = {
124
+ ...this.state,
125
+ availableModels: this.modelStatus ? Object.keys(this.modelStatus).sort() : [],
126
+ availableRuns: this.modelStatus?.[this.state.model] || {},
127
+ availableHours: this.state.isMRMS ? [] : this.modelStatus?.[this.state.model]?.[this.state.date]?.[this.state.run] || [],
128
+ availableVariables: this.getAvailableVariables(this.state.isMRMS ? 'mrms' : this.state.model),
129
+ // We need to confirm this line is working as expected.
130
+ availableMRMSVariables: this.getAvailableVariables('mrms'),
131
+ availableTimestamps: availableTimestamps,
132
+ isPlaying: this.isPlaying,
133
+ colormap: displayColormap,
134
+ colormapBaseUnit: toUnit
135
+ };
136
+ this.emit('state:change', eventPayload);
137
+ }
138
+ async initialize(options = {}) {
139
+ await this.fetchModelStatus(true);
140
+ await this.fetchMRMSStatus(true);
141
+ const latestRun = findLatestModelRun(this.modelStatus, this.state.model);
142
+ let initialState = this.state;
143
+ if (latestRun && !this.state.isMRMS) {
144
+ initialState = {
145
+ ...this.state,
146
+ ...latestRun,
147
+ forecastHour: 0
148
+ };
149
+ const availableVariables = this.getAvailableVariables(initialState.model);
150
+ if (availableVariables && availableVariables.length > 0) {
151
+ initialState.variable = availableVariables[0];
152
+ }
153
+ }
154
+ await this.setState(initialState);
155
+ if (options.autoRefresh ?? this.autoRefreshEnabled) {
156
+ this.startAutoRefresh(options.refreshInterval ?? this.autoRefreshIntervalSeconds);
157
+ }
158
+ }
159
+ destroy() {
160
+ this.pause();
161
+ this.stopAutoRefresh();
162
+ this.dataCache.clear();
163
+ if (this.worker) {
164
+ this.worker.terminate();
165
+ }
166
+ this.callbacks = {};
167
+ console.log(`AguaceroCore has been destroyed.`);
168
+ }
169
+
170
+ // --- Public API Methods ---
171
+
172
+ play() {
173
+ if (this.isPlaying) return;
174
+ this.isPlaying = true;
175
+ clearInterval(this.playIntervalId);
176
+ this.playIntervalId = setInterval(() => {
177
+ this.step(1);
178
+ }, this.playbackSpeed);
179
+ this.emit('playback:start', {
180
+ speed: this.playbackSpeed
181
+ });
182
+ this._emitStateChange(); // Notify UI that isPlaying is now true
183
+ }
184
+ pause() {
185
+ if (!this.isPlaying) return;
186
+ this.isPlaying = false;
187
+ clearInterval(this.playIntervalId);
188
+ this.playIntervalId = null;
189
+ this.emit('playback:stop');
190
+ this._emitStateChange(); // Notify UI that isPlaying is now false
191
+ }
192
+ togglePlay() {
193
+ this.isPlaying ? this.pause() : this.play();
194
+ }
195
+ step(direction = 1) {
196
+ const {
197
+ model,
198
+ date,
199
+ run,
200
+ forecastHour
201
+ } = this.state;
202
+ const forecastHours = this.modelStatus?.[model]?.[date]?.[run];
203
+ if (!forecastHours || forecastHours.length === 0) return;
204
+ const currentIndex = forecastHours.indexOf(forecastHour);
205
+ if (currentIndex === -1) return;
206
+ const maxIndex = forecastHours.length - 1;
207
+ let nextIndex = currentIndex + direction;
208
+ if (nextIndex > maxIndex) nextIndex = 0;
209
+ if (nextIndex < 0) nextIndex = maxIndex;
210
+ this.setState({
211
+ forecastHour: forecastHours[nextIndex]
212
+ });
213
+ }
214
+ setPlaybackSpeed(speed) {
215
+ if (speed > 0) {
216
+ this.playbackSpeed = speed;
217
+ if (this.isPlaying) this.play();
218
+ }
219
+ }
220
+ async setShaderSmoothing(enabled) {
221
+ if (typeof enabled !== 'boolean' || enabled === this.state.shaderSmoothingEnabled) return;
222
+ await this.setState({
223
+ shaderSmoothingEnabled: enabled
224
+ });
225
+ }
226
+ async setOpacity(newOpacity) {
227
+ const clampedOpacity = Math.max(0, Math.min(1, newOpacity));
228
+ if (clampedOpacity === this.state.opacity) return;
229
+ await this.setState({
230
+ opacity: clampedOpacity
231
+ });
232
+ }
233
+ async setVariable(variable) {
234
+ await this.setState({
235
+ variable
236
+ });
237
+ }
238
+ async setModel(modelName) {
239
+ if (modelName === this.state.model || !this.modelStatus?.[modelName]) return;
240
+ const latestRun = findLatestModelRun(this.modelStatus, modelName);
241
+ if (latestRun) {
242
+ await this.setState({
243
+ model: modelName,
244
+ date: latestRun.date,
245
+ run: latestRun.run,
246
+ forecastHour: 0
247
+ });
248
+ }
249
+ }
250
+ async setRun(runString) {
251
+ const [date, run] = runString.split(':');
252
+ if (date !== this.state.date || run !== this.state.run) {
253
+ await this.setState({
254
+ date,
255
+ run,
256
+ forecastHour: 0
257
+ });
258
+ }
259
+ }
260
+ async setUnits(newUnits) {
261
+ if (newUnits === this.state.units || !['metric', 'imperial'].includes(newUnits)) return;
262
+ await this.setState({
263
+ units: newUnits
264
+ });
265
+ }
266
+ async setMRMSVariable(variable) {
267
+ const sortedTimestamps = [...(this.mrmsStatus[variable] || [])].sort((a, b) => b - a);
268
+ const initialTimestamp = sortedTimestamps.length > 0 ? sortedTimestamps[0] : null;
269
+ await this.setState({
270
+ variable,
271
+ isMRMS: true,
272
+ mrmsTimestamp: initialTimestamp
273
+ });
274
+ }
275
+ async setMRMSTimestamp(timestamp) {
276
+ if (!this.state.isMRMS) return;
277
+ await this.setState({
278
+ mrmsTimestamp: timestamp
279
+ });
280
+ }
281
+ async switchMode(options) {
282
+ const {
283
+ mode,
284
+ variable,
285
+ model,
286
+ forecastHour,
287
+ mrmsTimestamp
288
+ } = options;
289
+ if (!mode || !variable) {
290
+ console.error("switchMode requires 'mode' ('mrms' | 'model') and 'variable' properties.");
291
+ return;
292
+ }
293
+ if (mode === 'model' && !model) {
294
+ console.error("switchMode with mode 'model' requires a 'model' property.");
295
+ return;
296
+ }
297
+ let targetState = {};
298
+ if (mode === 'mrms') {
299
+ let finalTimestamp = mrmsTimestamp;
300
+ if (finalTimestamp === undefined) {
301
+ const sortedTimestamps = [...(this.mrmsStatus[variable] || [])].sort((a, b) => b - a);
302
+ finalTimestamp = sortedTimestamps.length > 0 ? sortedTimestamps[0] : null;
303
+ }
304
+ targetState = {
305
+ isMRMS: true,
306
+ variable: variable,
307
+ mrmsTimestamp: finalTimestamp,
308
+ model: this.state.model,
309
+ date: null,
310
+ run: null,
311
+ forecastHour: 0
312
+ };
313
+ } else if (mode === 'model') {
314
+ const latestRun = findLatestModelRun(this.modelStatus, model);
315
+ if (!latestRun) {
316
+ console.error(`Could not find a valid run for model: ${model}`);
317
+ return;
318
+ }
319
+ targetState = {
320
+ isMRMS: false,
321
+ model: model,
322
+ variable: variable,
323
+ date: latestRun.date,
324
+ run: latestRun.run,
325
+ forecastHour: forecastHour !== undefined ? forecastHour : 0,
326
+ mrmsTimestamp: null
327
+ };
328
+ } else {
329
+ console.error(`Invalid mode specified in switchMode: '${mode}'`);
330
+ return;
331
+ }
332
+ await this.setState(targetState);
333
+ }
334
+
335
+ // --- Data and Calculation Methods ---
336
+
337
+ _reconstructData(decompressedDeltas, encoding) {
338
+ const expectedLength = encoding.length;
339
+ const reconstructedData = new Int8Array(expectedLength);
340
+ if (decompressedDeltas.length > 0 && expectedLength > 0) {
341
+ // First value is absolute
342
+ reconstructedData[0] = decompressedDeltas[0] > 127 ? decompressedDeltas[0] - 256 : decompressedDeltas[0];
343
+
344
+ // Subsequent values are deltas from the previous one
345
+ for (let i = 1; i < expectedLength; i++) {
346
+ const delta = decompressedDeltas[i] > 127 ? decompressedDeltas[i] - 256 : decompressedDeltas[i];
347
+ reconstructedData[i] = reconstructedData[i - 1] + delta;
348
+ }
349
+ }
350
+ // Return as a Uint8Array, which is what the rest of the code expects
351
+ return new Uint8Array(reconstructedData.buffer);
352
+ }
353
+ async _loadGridData(state) {
354
+ if (this.isReactNative) {
355
+ console.warn(`[AguaceroCore] _loadGridData was called in React Native. This is a bypass. Data loading is handled natively.`);
356
+ return null;
357
+ }
358
+ const {
359
+ model,
360
+ date,
361
+ run,
362
+ forecastHour,
363
+ variable,
364
+ isMRMS,
365
+ mrmsTimestamp
366
+ } = state;
367
+ let effectiveSmoothing = 0;
368
+ const customVariableSettings = this.customColormaps[variable];
369
+ if (customVariableSettings && typeof customVariableSettings.smoothing === 'number') {
370
+ effectiveSmoothing = customVariableSettings.smoothing;
371
+ }
372
+ let resourcePath;
373
+ let dataUrlIdentifier;
374
+ if (isMRMS) {
375
+ if (!mrmsTimestamp) return null;
376
+ const mrmsDate = new Date(mrmsTimestamp * 1000);
377
+ const y = mrmsDate.getUTCFullYear(),
378
+ m = (mrmsDate.getUTCMonth() + 1).toString().padStart(2, '0'),
379
+ d = mrmsDate.getUTCDate().toString().padStart(2, '0');
380
+ dataUrlIdentifier = `mrms-${mrmsTimestamp}-${variable}-${effectiveSmoothing}`;
381
+ resourcePath = `/grids/mrms/${y}${m}${d}/${mrmsTimestamp}/0/${variable}/${effectiveSmoothing}`;
382
+ } else {
383
+ dataUrlIdentifier = `${model}-${date}-${run}-${forecastHour}-${variable}-${effectiveSmoothing}`;
384
+ resourcePath = `/grids/${model}/${date}/${run}/${forecastHour}/${variable}/${effectiveSmoothing}`;
385
+ }
386
+ if (this.dataCache.has(dataUrlIdentifier)) {
387
+ return this.dataCache.get(dataUrlIdentifier);
388
+ }
389
+
390
+ // --- EDITED ---
391
+ // If we are in React Native, this function should NOT do any work.
392
+ // The native WeatherFrameProcessorModule is now responsible for all data loading.
393
+ // This function might still be called by a "cache miss" fallback, but it
394
+ // should not fetch data from JS anymore. We return null so the fallback knows
395
+ // that the native module is the only source of truth for new data.
396
+ if (this.isReactNative) {
397
+ console.warn(`_loadGridData was called in React Native for ${dataUrlIdentifier}. This should be handled by the native module. Returning null.`);
398
+ return null;
399
+ }
400
+ const abortController = new AbortController();
401
+ this.abortControllers.set(dataUrlIdentifier, abortController);
402
+ const loadPromise = (async () => {
403
+ if (!this.apiKey) {
404
+ throw new Error('API key is not configured.');
405
+ }
406
+ try {
407
+ const baseUrl = `${this.baseGridUrl}${resourcePath}`;
408
+ const urlWithApiKeyParam = `${baseUrl}?apiKey=${this.apiKey}`;
409
+ const headers = {
410
+ 'x-api-key': this.apiKey
411
+ };
412
+ if (this.bundleId) {
413
+ headers['x-app-identifier'] = this.bundleId;
414
+ }
415
+ const response = await fetch(urlWithApiKeyParam, {
416
+ headers: headers,
417
+ signal: abortController.signal
418
+ });
419
+ if (!response.ok) {
420
+ throw new Error(`Failed to fetch grid data: ${response.status} ${response.statusText}`);
421
+ }
422
+ const {
423
+ data: b64Data,
424
+ encoding
425
+ } = await response.json();
426
+ const compressedData = Uint8Array.from(atob(b64Data), c => c.charCodeAt(0));
427
+
428
+ // This path is now ONLY for the web worker
429
+ const requestId = this.workerRequestId++;
430
+ const workerPromise = new Promise((resolve, reject) => {
431
+ this.workerResolvers.set(requestId, {
432
+ resolve,
433
+ reject
434
+ });
435
+ });
436
+ this.worker.postMessage({
437
+ requestId,
438
+ compressedData,
439
+ encoding
440
+ }, [compressedData.buffer]);
441
+ const result = await workerPromise;
442
+ const finalData = result.data;
443
+ const transformedData = new Uint8Array(finalData.length);
444
+ for (let i = 0; i < finalData.length; i++) {
445
+ const signedValue = finalData[i] > 127 ? finalData[i] - 256 : finalData[i];
446
+ transformedData[i] = signedValue + 128;
447
+ }
448
+ this.abortControllers.delete(dataUrlIdentifier);
449
+ return {
450
+ data: transformedData,
451
+ encoding
452
+ };
453
+ } catch (error) {
454
+ if (error.name === 'AbortError') {
455
+ console.log(`Request cancelled for ${resourcePath}`);
456
+ } else {
457
+ console.error(`Failed to load data for path ${resourcePath}:`, error);
458
+ }
459
+ this.dataCache.delete(dataUrlIdentifier);
460
+ this.abortControllers.delete(dataUrlIdentifier);
461
+ return null;
462
+ }
463
+ })();
464
+ this.dataCache.set(dataUrlIdentifier, loadPromise);
465
+ return loadPromise;
466
+ }
467
+ cancelAllRequests() {
468
+ // Abort all in-flight requests
469
+ this.abortControllers.forEach((controller, key) => {
470
+ controller.abort();
471
+ });
472
+
473
+ // Clear both maps
474
+ this.abortControllers.clear();
475
+ this.dataCache.clear();
476
+ console.log('All pending requests cancelled');
477
+ }
478
+ async getValueAtLngLat(lng, lat) {
479
+ const {
480
+ variable,
481
+ isMRMS,
482
+ mrmsTimestamp,
483
+ model,
484
+ date,
485
+ run,
486
+ forecastHour,
487
+ units
488
+ } = this.state;
489
+ if (!variable) return null;
490
+ const gridIndices = this._getGridIndexFromLngLat(lng, lat);
491
+ if (!gridIndices) return null;
492
+ const {
493
+ i,
494
+ j
495
+ } = gridIndices;
496
+ const gridModel = isMRMS ? 'mrms' : model;
497
+ const normalizedGridModel = this._normalizeModelName(gridModel);
498
+ const {
499
+ nx
500
+ } = _coordinate_configs.COORDINATE_CONFIGS[normalizedGridModel].grid_params;
501
+ const customSettings = this.customColormaps[variable];
502
+ const effectiveSmoothing = customSettings && typeof customSettings.smoothing === 'number' ? customSettings.smoothing : 0;
503
+ const dataUrlIdentifier = isMRMS ? `mrms-${mrmsTimestamp}-${variable}-${effectiveSmoothing}` : `${model}-${date}-${run}-${forecastHour}-${variable}-${effectiveSmoothing}`;
504
+ const gridDataPromise = this.dataCache.get(dataUrlIdentifier);
505
+ if (!gridDataPromise) return null;
506
+ try {
507
+ const gridData = await gridDataPromise;
508
+ if (!gridData || !gridData.data) return null;
509
+ const index1D = j * nx + i;
510
+ const byteValue = gridData.data[index1D];
511
+ const signedQuantizedValue = byteValue - 128;
512
+ const {
513
+ scale,
514
+ offset,
515
+ missing_quantized
516
+ } = gridData.encoding;
517
+ if (signedQuantizedValue === missing_quantized) return null;
518
+ const nativeValue = signedQuantizedValue * scale + offset;
519
+ const {
520
+ baseUnit
521
+ } = this._getColormapForVariable(variable);
522
+ let dataNativeUnit = baseUnit || (_dictionaries.DICTIONARIES.fld[variable] || {}).defaultUnit || 'none';
523
+ const displayUnit = this._getTargetUnit(dataNativeUnit, units);
524
+ const conversionFunc = (0, _unitConversions.getUnitConversionFunction)(dataNativeUnit, displayUnit);
525
+ const displayValue = conversionFunc ? conversionFunc(nativeValue) : nativeValue;
526
+ return {
527
+ lngLat: {
528
+ lng,
529
+ lat
530
+ },
531
+ variable: {
532
+ code: variable,
533
+ name: this.getVariableDisplayName(variable)
534
+ },
535
+ value: displayValue,
536
+ unit: displayUnit
537
+ };
538
+ } catch (error) {
539
+ return null;
540
+ }
541
+ }
542
+ getAvailableVariables(modelName = null) {
543
+ const model = modelName || this.state.model;
544
+ return _dictionaries.MODEL_CONFIGS[model]?.vars || [];
545
+ }
546
+ getVariableDisplayName(variableCode) {
547
+ const varInfo = _dictionaries.DICTIONARIES.fld[variableCode];
548
+ return varInfo?.displayName || varInfo?.name || variableCode;
549
+ }
550
+ _getColormapForVariable(variable) {
551
+ if (!variable) return {
552
+ colormap: [],
553
+ baseUnit: ''
554
+ };
555
+ if (this.customColormaps[variable] && this.customColormaps[variable].colormap) {
556
+ return {
557
+ colormap: this.customColormaps[variable].colormap,
558
+ baseUnit: this.customColormaps[variable].baseUnit || ''
559
+ };
560
+ }
561
+ const colormapKey = _dictionaries.DICTIONARIES.variable_cmap[variable] || variable;
562
+ const customColormap = this.customColormaps[colormapKey];
563
+ if (customColormap && customColormap.colormap) {
564
+ return {
565
+ colormap: customColormap.colormap,
566
+ baseUnit: customColormap.baseUnit || ''
567
+ };
568
+ }
569
+ const defaultColormapData = _defaultColormaps.DEFAULT_COLORMAPS[colormapKey];
570
+ if (defaultColormapData && defaultColormapData.units) {
571
+ const availableUnits = Object.keys(defaultColormapData.units);
572
+ if (availableUnits.length > 0) {
573
+ const baseUnit = availableUnits[0];
574
+ const unitData = defaultColormapData.units[baseUnit];
575
+ if (unitData && unitData.colormap) {
576
+ return {
577
+ colormap: unitData.colormap,
578
+ baseUnit: baseUnit
579
+ };
580
+ }
581
+ }
582
+ }
583
+ return {
584
+ colormap: [],
585
+ baseUnit: ''
586
+ };
587
+ }
588
+ _convertColormapUnits(colormap, fromUnits, toUnits) {
589
+ if (fromUnits === toUnits) return colormap;
590
+ const conversionFunc = (0, _unitConversions.getUnitConversionFunction)(fromUnits, toUnits);
591
+ if (!conversionFunc) return colormap;
592
+ const newColormap = [];
593
+ for (let i = 0; i < colormap.length; i += 2) {
594
+ newColormap.push(conversionFunc(colormap[i]), colormap[i + 1]);
595
+ }
596
+ return newColormap;
597
+ }
598
+ _normalizeModelName(modelName) {
599
+ const mapping = {
600
+ 'hrrr': ['mpashn', 'mpasrt', 'mpasht', 'hrrrsub', 'rrfs', 'namnest', 'mpasrn', 'mpasrn3', 'mpasht2'],
601
+ 'arw': ['arw2', 'fv3', 'href'],
602
+ 'rtma': ['nbm'],
603
+ 'ecmwf': ['ecmwfaifs'],
604
+ 'gfs': ['arpege', 'graphcastgfs']
605
+ };
606
+ for (const [normalized, aliases] of Object.entries(mapping)) {
607
+ if (aliases.includes(modelName)) return normalized;
608
+ }
609
+ return modelName;
610
+ }
611
+ _getGridCornersAndDef(model) {
612
+ const normalizedModel = this._normalizeModelName(model);
613
+ const gridDef = {
614
+ ..._coordinate_configs.COORDINATE_CONFIGS[normalizedModel],
615
+ modelName: model
616
+ };
617
+ if (!gridDef) return null;
618
+ const {
619
+ nx,
620
+ ny
621
+ } = gridDef.grid_params;
622
+ const gridType = gridDef.type;
623
+ let corners;
624
+ if (gridType === 'latlon') {
625
+ let {
626
+ lon_first,
627
+ lat_first,
628
+ lat_last,
629
+ lon_last,
630
+ dx_degrees,
631
+ dy_degrees
632
+ } = gridDef.grid_params;
633
+ corners = {
634
+ lon_tl: lon_first,
635
+ lat_tl: lat_first,
636
+ lon_tr: lon_last !== undefined ? lon_last : lon_first + (nx - 1) * dx_degrees,
637
+ lat_tr: lat_first,
638
+ lon_bl: lon_first,
639
+ lat_bl: lat_last !== undefined ? lat_last : lat_first + (ny - 1) * dy_degrees,
640
+ lon_br: lon_last !== undefined ? lon_last : lon_first + (nx - 1) * dx_degrees,
641
+ lat_br: lat_last !== undefined ? lat_last : lat_first + (ny - 1) * dy_degrees
642
+ };
643
+ } else if (gridType === 'rotated_latlon') {
644
+ const [lon_tl, lat_tl] = hrdpsObliqueTransform(gridDef.grid_params.lon_first, gridDef.grid_params.lat_first);
645
+ const [lon_tr, lat_tr] = hrdpsObliqueTransform(gridDef.grid_params.lon_first + (nx - 1) * gridDef.grid_params.dx_degrees, gridDef.grid_params.lat_first);
646
+ const [lon_bl, lat_bl] = hrdpsObliqueTransform(gridDef.grid_params.lon_first, gridDef.grid_params.lat_first + (ny - 1) * gridDef.grid_params.dy_degrees);
647
+ const [lon_br, lat_br] = hrdpsObliqueTransform(gridDef.grid_params.lon_first + (nx - 1) * gridDef.grid_params.dx_degrees, gridDef.grid_params.lat_first + (ny - 1) * gridDef.grid_params.dy_degrees);
648
+ corners = {
649
+ lon_tl,
650
+ lat_tl,
651
+ lon_tr,
652
+ lat_tr,
653
+ lon_bl,
654
+ lat_bl,
655
+ lon_br,
656
+ lat_br
657
+ };
658
+ } else if (gridType === 'lambert_conformal_conic' || gridType === 'polar_ stereographic') {
659
+ let projString = Object.entries(gridDef.proj_params).map(([k, v]) => `+${k}=${v}`).join(' ');
660
+ if (gridType === 'polar_stereographic') projString += ' +lat_0=90';
661
+ const {
662
+ x_origin,
663
+ y_origin,
664
+ dx,
665
+ dy
666
+ } = gridDef.grid_params;
667
+ const [lon_tl, lat_tl] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin, y_origin]);
668
+ const [lon_tr, lat_tr] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin + (nx - 1) * dx, y_origin]);
669
+ const [lon_bl, lat_bl] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin, y_origin + (ny - 1) * dy]);
670
+ const [lon_br, lat_br] = (0, _proj.default)(projString, 'EPSG:4326', [x_origin + (nx - 1) * dx, y_origin + (ny - 1) * dy]);
671
+ corners = {
672
+ lon_tl,
673
+ lat_tl,
674
+ lon_tr,
675
+ lat_tr,
676
+ lon_bl,
677
+ lat_bl,
678
+ lon_br,
679
+ lat_br
680
+ };
681
+ } else {
682
+ return null;
683
+ }
684
+ return {
685
+ corners,
686
+ gridDef
687
+ };
688
+ }
689
+ _getTargetUnit(defaultUnit, system) {
690
+ if (system === 'metric') {
691
+ if (['°F', '°C', 'fahrenheit', 'celsius'].includes(defaultUnit)) return '°C';
692
+ if (['kts', 'mph', 'm/s'].includes(defaultUnit)) return 'km/h';
693
+ if (['in', 'mm', 'cm'].includes(defaultUnit)) return 'mm';
694
+ }
695
+ if (system === 'imperial') {
696
+ if (['°F', '°C', 'fahrenheit', 'celsius'].includes(defaultUnit)) return '°F';
697
+ if (['kts', 'mph', 'm/s'].includes(defaultUnit)) return 'mph';
698
+ if (['in', 'mm', 'cm'].includes(defaultUnit)) return 'in';
699
+ }
700
+ return defaultUnit;
701
+ }
702
+ _getGridIndexFromLngLat(lng, lat) {
703
+ const gridModel = this.state.isMRMS ? 'mrms' : this.state.model;
704
+ const normalizedGridModel = this._normalizeModelName(gridModel);
705
+ const gridDef = _coordinate_configs.COORDINATE_CONFIGS[normalizedGridModel];
706
+ if (!gridDef) return null;
707
+ const {
708
+ nx,
709
+ ny
710
+ } = gridDef.grid_params;
711
+ const pixelCoords = this.latLonToGridPixel(lat, lng, gridDef, gridModel);
712
+ if (!pixelCoords || !isFinite(pixelCoords.x) || !isFinite(pixelCoords.y) || pixelCoords.x < 0 || pixelCoords.y < 0) return null;
713
+ const i = Math.round(pixelCoords.x);
714
+ const j = Math.round(pixelCoords.y);
715
+ if (i >= 0 && i < nx && j >= 0 && j < ny) return {
716
+ i,
717
+ j
718
+ };
719
+ return null;
720
+ }
721
+ latLonToProjected(lat, lon, gridDef) {
722
+ if (!isFinite(lat) || !isFinite(lon)) throw new Error(`Invalid coordinates: lat=${lat}, lon=${lon}`);
723
+ const gridType = gridDef.type;
724
+ if (gridType === 'latlon') return {
725
+ x: lon,
726
+ y: lat
727
+ };
728
+ let projString = Object.entries(gridDef.proj_params).map(([k, v]) => `+${k}=${v}`).join(' ');
729
+ if (gridType === 'polar_stereographic') projString += ' +lat_0=90';
730
+ const projected = (0, _proj.default)('EPSG:4326', projString, [lon, lat]);
731
+ return {
732
+ x: projected[0],
733
+ y: projected[1]
734
+ };
735
+ }
736
+ latLonToGridPixel(lat, lon, gridDef, modelName) {
737
+ if (!gridDef) return null;
738
+ if (modelName === 'rgem' && gridDef.type === 'polar_stereographic') return this.latLonToGridPixelPolarStereographic(lat, lon, gridDef);
739
+ const projected = this.latLonToProjected(lat, lon, gridDef);
740
+ let x, y;
741
+ const gridOrigin = {
742
+ x: gridDef.grid_params.lon_first,
743
+ y: gridDef.grid_params.lat_first
744
+ };
745
+ const gridPixelSize = {
746
+ x: gridDef.grid_params.dx_degrees,
747
+ y: gridDef.grid_params.dy_degrees
748
+ };
749
+ if (gridDef.type === 'latlon' || gridDef.type === 'rotated_latlon') {
750
+ let adjustedLon = projected.x;
751
+ if (modelName === 'mrms') {
752
+ if (adjustedLon < 0) adjustedLon += 360;
753
+ x = (adjustedLon - gridOrigin.x) / gridPixelSize.x;
754
+ y = (gridOrigin.y - projected.y) / gridPixelSize.y;
755
+ } else {
756
+ const isGFSType = gridDef.grid_params && gridDef.grid_params.lon_first === 0.0 && Math.abs(gridDef.grid_params.lat_first) === 90.0;
757
+ const isECMWFType = gridDef.grid_params && gridDef.grid_params.lon_first === 180.0 && gridDef.grid_params.lat_first === 90.0;
758
+ const isGEMType = modelName === 'gem' || gridDef.grid_params.lon_first === 180.0 && gridDef.grid_params.lat_first === -90.0 && gridDef.grid_params.lon_last === 179.85;
759
+ if (isGEMType) {
760
+ while (adjustedLon < gridOrigin.x) adjustedLon += 360;
761
+ x = (adjustedLon - gridOrigin.x) / gridPixelSize.x;
762
+ y = (projected.y - gridOrigin.y) / gridPixelSize.y;
763
+ return {
764
+ x,
765
+ y
766
+ };
767
+ }
768
+ let isFlippedGrid = isECMWFType ? true : gridDef.grid_params.lat_first < (gridDef.grid_params.lat_last || (gridDef.grid_params.ny - 1) * gridDef.grid_params.dy_degrees);
769
+ if (isGFSType) adjustedLon = projected.x + 180;else if (isECMWFType) {
770
+ if (adjustedLon < gridOrigin.x) adjustedLon += 360;
771
+ } else if (['arome1', 'arome25', 'arpegeeu', 'iconeu', 'icond2'].includes(modelName)) {
772
+ while (adjustedLon < 0) adjustedLon += 360;
773
+ while (adjustedLon >= 360) adjustedLon -= 360;
774
+ x = adjustedLon >= gridOrigin.x ? (adjustedLon - gridOrigin.x) / gridPixelSize.x : (adjustedLon + 360 - gridOrigin.x) / gridPixelSize.x;
775
+ if (['arome1', 'arome25', 'arpegeeu'].includes(modelName)) y = (gridOrigin.y - projected.y) / Math.abs(gridPixelSize.y);else if (['iconeu', 'icond2'].includes(modelName)) y = (projected.y - gridOrigin.y) / gridPixelSize.y;
776
+ return {
777
+ x,
778
+ y
779
+ };
780
+ } else {
781
+ const lonFirst = gridOrigin.x;
782
+ if (lonFirst > 180 && adjustedLon < 0) adjustedLon += 360;else if (lonFirst < 0 && adjustedLon > 180) adjustedLon -= 360;
783
+ }
784
+ x = (adjustedLon - gridOrigin.x) / gridPixelSize.x;
785
+ if (isFlippedGrid) {
786
+ if (isECMWFType) y = (gridOrigin.y - projected.y) / Math.abs(gridPixelSize.y);else {
787
+ const maxLat = gridDef.grid_params.lat_last || (gridDef.grid_params.ny - 1) * gridDef.grid_params.dy_degrees;
788
+ y = (maxLat - projected.y) / Math.abs(gridPixelSize.y);
789
+ }
790
+ } else y = (projected.y - gridOrigin.y) / gridPixelSize.y;
791
+ }
792
+ } else {
793
+ const projOrigin = {
794
+ x: gridDef.grid_params.x_origin,
795
+ y: gridDef.grid_params.y_origin
796
+ };
797
+ const projPixelSize = {
798
+ x: gridDef.grid_params.dx,
799
+ y: gridDef.grid_params.dy
800
+ };
801
+ x = (projected.x - projOrigin.x) / projPixelSize.x;
802
+ y = (projOrigin.y - projected.y) / Math.abs(projPixelSize.y);
803
+ }
804
+ return {
805
+ x,
806
+ y
807
+ };
808
+ }
809
+ latLonToGridPixelPolarStereographic(lat, lon, gridDef) {
810
+ try {
811
+ const projParams = gridDef.proj_params;
812
+ let projectionString = `+proj=${projParams.proj}`;
813
+ Object.keys(projParams).forEach(key => {
814
+ if (key !== 'proj') projectionString += ` +${key}=${projParams[key]}`;
815
+ });
816
+ projectionString += ' +lat_0=90 +no_defs';
817
+ const {
818
+ nx,
819
+ ny,
820
+ dx,
821
+ dy,
822
+ x_origin,
823
+ y_origin
824
+ } = gridDef.grid_params;
825
+ const x_min = x_origin;
826
+ const x_max = x_origin + (nx - 1) * dx;
827
+ const y_max = y_origin;
828
+ const y_min = y_origin + (ny - 1) * dy;
829
+ const [proj_x, proj_y] = (0, _proj.default)('EPSG:4326', projectionString, [lon, lat]);
830
+ if (!isFinite(proj_x) || !isFinite(proj_y)) return {
831
+ x: -1,
832
+ y: -1
833
+ };
834
+ const t_x = (proj_x - x_min) / (x_max - x_min);
835
+ const t_y = (proj_y - y_max) / (y_min - y_max);
836
+ const x = t_x * (nx - 1);
837
+ const y = t_y * (ny - 1);
838
+ return {
839
+ x,
840
+ y
841
+ };
842
+ } catch (error) {
843
+ console.warn(`[GridAccessor] RGEM polar stereographic conversion failed for ${lat}, ${lon}:`, error);
844
+ return {
845
+ x: -1,
846
+ y: -1
847
+ };
848
+ }
849
+ }
850
+
851
+ // --- Worker and Status Methods ---
852
+
853
+ createWorker() {
854
+ if (this.isReactNative) return null;
855
+ const workerCode = `
856
+ import { decompress } from 'https://cdn.skypack.dev/fzstd@0.1.1';
857
+
858
+ function _reconstructData(decompressedDeltas, encoding) {
859
+ const expectedLength = encoding.length;
860
+ const reconstructedData = new Int8Array(expectedLength);
861
+ if (decompressedDeltas.length > 0 && expectedLength > 0) {
862
+ reconstructedData[0] = decompressedDeltas[0] > 127 ? decompressedDeltas[0] - 256 : decompressedDeltas[0];
863
+ for (let i = 1; i < expectedLength; i++) {
864
+ const delta = decompressedDeltas[i] > 127 ? decompressedDeltas[i] - 256 : decompressedDeltas[i];
865
+ reconstructedData[i] = reconstructedData[i - 1] + delta;
866
+ }
867
+ }
868
+ return new Uint8Array(reconstructedData.buffer);
869
+ }
870
+
871
+ self.onmessage = async (e) => {
872
+ const { requestId, compressedData, encoding } = e.data;
873
+ try {
874
+ const decompressedDeltas = await decompress(compressedData);
875
+ const finalData = _reconstructData(decompressedDeltas, encoding);
876
+ self.postMessage({ success: true, requestId: requestId, decompressedData: finalData, encoding: encoding }, [finalData.buffer]);
877
+ } catch (error) {
878
+ self.postMessage({ success: false, requestId: requestId, error: error.message });
879
+ }
880
+ };
881
+ `;
882
+ const blob = new Blob([workerCode], {
883
+ type: 'application/javascript'
884
+ });
885
+ return new Worker(URL.createObjectURL(blob), {
886
+ type: 'module'
887
+ });
888
+ }
889
+ _processResultQueue() {
890
+ while (this.resultQueue.length > 0) {
891
+ const {
892
+ success,
893
+ requestId,
894
+ decompressedData,
895
+ encoding,
896
+ error
897
+ } = this.resultQueue.shift();
898
+ if (this.workerResolvers.has(requestId)) {
899
+ const {
900
+ resolve,
901
+ reject
902
+ } = this.workerResolvers.get(requestId);
903
+ if (success) {
904
+ resolve({
905
+ data: decompressedData
906
+ }); // Return as { data: ... }
907
+ } else {
908
+ reject(new Error(error));
909
+ }
910
+ this.workerResolvers.delete(requestId);
911
+ }
912
+ }
913
+ this.isProcessingQueue = false;
914
+ }
915
+ _handleWorkerMessage(e) {
916
+ if (this.isReactNative) return;
917
+ const {
918
+ success,
919
+ requestId,
920
+ decompressedData,
921
+ encoding,
922
+ error
923
+ } = e.data;
924
+ this.resultQueue.push({
925
+ success,
926
+ requestId,
927
+ decompressedData,
928
+ encoding,
929
+ error
930
+ });
931
+ if (!this.isProcessingQueue) {
932
+ this.isProcessingQueue = true;
933
+ requestAnimationFrame(() => this._processResultQueue());
934
+ }
935
+ }
936
+ async fetchModelStatus(force = false) {
937
+ if (!this.modelStatus || force) {
938
+ try {
939
+ const response = await fetch(this.statusUrl);
940
+ if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
941
+ this.modelStatus = (await response.json()).models;
942
+ } catch (error) {
943
+ this.modelStatus = null;
944
+ }
945
+ }
946
+ return this.modelStatus;
947
+ }
948
+ async fetchMRMSStatus(force = false) {
949
+ const mrmsStatusUrl = 'https://h3dfvh5pq6euq36ymlpz4zqiha0obqju.lambda-url.us-east-2.on.aws';
950
+ if (!this.mrmsStatus || force) {
951
+ try {
952
+ const response = await fetch(mrmsStatusUrl);
953
+ if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
954
+ this.mrmsStatus = await response.json();
955
+ } catch (error) {
956
+ this.mrmsStatus = null;
957
+ }
958
+ }
959
+ return this.mrmsStatus;
960
+ }
961
+ startAutoRefresh(intervalSeconds) {
962
+ this.stopAutoRefresh();
963
+ this.autoRefreshIntervalId = setInterval(async () => {
964
+ await this.fetchModelStatus(true);
965
+ this._emitStateChange();
966
+ }, (intervalSeconds || 60) * 1000);
967
+ }
968
+ stopAutoRefresh() {
969
+ if (this.autoRefreshIntervalId) {
970
+ clearInterval(this.autoRefreshIntervalId);
971
+ this.autoRefreshIntervalId = null;
972
+ }
973
+ }
974
+ }
975
+ exports.AguaceroCore = AguaceroCore;
976
+ //# sourceMappingURL=AguaceroCore.js.map