cubevis 0.5.17__tar.gz → 1.0.47__tar.gz

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 (171) hide show
  1. {cubevis-0.5.17 → cubevis-1.0.47}/PKG-INFO +2 -2
  2. cubevis-1.0.47/cubevis/__icons__/trash.png +0 -0
  3. cubevis-1.0.47/cubevis/__icons__/trash.svg +20 -0
  4. cubevis-1.0.47/cubevis/__icons__/trash_full.png +0 -0
  5. cubevis-1.0.47/cubevis/__icons__/trash_full.svg +35 -0
  6. cubevis-1.0.47/cubevis/__icons__/trash_full_raw.png +0 -0
  7. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__init__.py +24 -13
  8. cubevis-1.0.47/cubevis/__js__/bokeh-3.6/cubevisjs.min.js +67 -0
  9. cubevis-1.0.47/cubevis/__js__/bokeh-3.7/cubevisjs.min.js +67 -0
  10. cubevis-1.0.47/cubevis/__js__/bokeh-3.8/cubevisjs.min.js +67 -0
  11. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__js__/casalib.min.js +1 -1
  12. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/__init__.py +17 -0
  13. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/annotations/_ev_poly_annotation.py +2 -1
  14. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/format/_wcs_ticks.py +6 -2
  15. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/models/__init__.py +3 -0
  16. cubevis-1.0.47/cubevis/bokeh/models/_bokeh_app_context.py +110 -0
  17. cubevis-1.0.47/cubevis/bokeh/models/_shared_dict.py +23 -0
  18. cubevis-1.0.47/cubevis/bokeh/models/_showable.py +443 -0
  19. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/models/_tip.py +2 -1
  20. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/models/_tip_button.py +2 -3
  21. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/sources/_data_pipe.py +168 -8
  22. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/sources/_image_data_source.py +6 -2
  23. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/sources/_image_pipe.py +4 -1
  24. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/sources/_spectra_data_source.py +6 -3
  25. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/sources/_updatable_data_source.py +8 -4
  26. cubevis-1.0.47/cubevis/bokeh/sources/transport/__init__.py +22 -0
  27. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/__init__.py +4 -3
  28. cubevis-1.0.47/cubevis/bokeh/state/_current.py +34 -0
  29. cubevis-1.0.47/cubevis/bokeh/state/_initialize.py +337 -0
  30. cubevis-1.0.47/cubevis/bokeh/state/_javascript.py +127 -0
  31. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/tools/_cbreset_tool.py +2 -1
  32. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/tools/_drag_tool.py +2 -1
  33. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/utils/__init__.py +0 -1
  34. cubevis-1.0.47/cubevis/exe/__init__.py +4 -0
  35. cubevis-1.0.47/cubevis/exe/_context.py +126 -0
  36. cubevis-1.0.47/cubevis/exe/_mode.py +7 -0
  37. cubevis-1.0.47/cubevis/exe/_setting.py +5 -0
  38. cubevis-1.0.47/cubevis/exe/_task.py +250 -0
  39. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/apps/__init__.py +4 -2
  40. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/apps/_createmask.py +45 -43
  41. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/apps/_createregion.py +33 -31
  42. cubevis-1.0.47/cubevis/private/apps/_interactiveclean.mustache +94 -0
  43. cubevis-1.0.47/cubevis/private/apps/_interactiveclean.py +1856 -0
  44. cubevis-1.0.47/cubevis/private/apps/_interactivecleannotebook.mustache +135 -0
  45. cubevis-0.5.17/cubevis/private/apps/_interactiveclean.py → cubevis-1.0.47/cubevis/private/apps/_interactivecleannotebook.py +67 -1430
  46. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/casashell/iclean.py +1 -1
  47. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/casatasks/iclean.py +5 -1
  48. cubevis-1.0.47/cubevis/private/casatasks/iclean_notebook.py +1831 -0
  49. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/toolbox/__init__.py +1 -1
  50. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/toolbox/_app_context.py +5 -9
  51. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/toolbox/_cube.py +200 -50
  52. cubevis-0.5.17/cubevis/private/apps/_interactiveclean.mustache → cubevis-1.0.47/cubevis/toolbox/_interactive_clean_ui.mustache +501 -330
  53. cubevis-1.0.47/cubevis/toolbox/_interactive_clean_ui.py +1668 -0
  54. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/__init__.py +186 -55
  55. cubevis-1.0.47/cubevis/utils/_browser.py +7 -0
  56. cubevis-1.0.47/cubevis/utils/_git.py +36 -0
  57. cubevis-1.0.47/cubevis/utils/_jupyter.py +127 -0
  58. cubevis-1.0.47/cubevis/utils/_mutual_exclusion.py +117 -0
  59. {cubevis-0.5.17 → cubevis-1.0.47}/pyproject.toml +11 -5
  60. cubevis-1.0.47/tests/manual/iclean-demo/iclean-demo.ipynb +251 -0
  61. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-demo/run-iclean.py +5 -0
  62. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-outlier/run-iclean.py +4 -1
  63. cubevis-0.5.17/cubevis/__js__/bokeh-3.6.1.min.js +0 -728
  64. cubevis-0.5.17/cubevis/__js__/bokeh-tables-3.6.1.min.js +0 -119
  65. cubevis-0.5.17/cubevis/__js__/bokeh-widgets-3.6.1.min.js +0 -141
  66. cubevis-0.5.17/cubevis/__js__/cubevisjs.min.js +0 -62
  67. cubevis-0.5.17/cubevis/bokeh/state/_initialize.py +0 -164
  68. cubevis-0.5.17/cubevis/bokeh/state/_javascript.py +0 -53
  69. {cubevis-0.5.17 → cubevis-1.0.47}/LICENSE +0 -0
  70. /cubevis-0.5.17/readme.rst → /cubevis-1.0.47/README.rst +0 -0
  71. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/LICENSE.rst +0 -0
  72. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/20px/fast-backward.svg +0 -0
  73. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/20px/fast-forward.svg +0 -0
  74. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/20px/step-backward.svg +0 -0
  75. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/20px/step-forward.svg +0 -0
  76. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/add-chan.png +0 -0
  77. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/add-chan.svg +0 -0
  78. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/add-cube.png +0 -0
  79. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/add-cube.svg +0 -0
  80. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/drag.png +0 -0
  81. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/drag.svg +0 -0
  82. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/mask-selected.png +0 -0
  83. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/mask.png +0 -0
  84. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/mask.svg +0 -0
  85. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/new-layer-sm-selected.png +0 -0
  86. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/new-layer-sm-selected.svg +0 -0
  87. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/new-layer-sm.png +0 -0
  88. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/new-layer-sm.svg +0 -0
  89. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/reset.png +0 -0
  90. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/reset.svg +0 -0
  91. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/sub-chan.png +0 -0
  92. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/sub-chan.svg +0 -0
  93. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/sub-cube.png +0 -0
  94. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/sub-cube.svg +0 -0
  95. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/zoom-to-fit.png +0 -0
  96. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/__icons__/zoom-to-fit.svg +0 -0
  97. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/annotations/__init__.py +0 -0
  98. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/components/__init__.py +0 -0
  99. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/format/__init__.py +0 -0
  100. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/format/_time_ticks.py +0 -0
  101. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/models/_edit_span.py +0 -0
  102. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/models/_ev_text_input.py +0 -0
  103. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/sources/__init__.py +0 -0
  104. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/_palette.py +0 -0
  105. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/_session.py +0 -0
  106. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/js/bokeh-2.4.1.min.js +0 -0
  107. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/js/bokeh-gl-2.4.1.min.js +0 -0
  108. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/js/bokeh-tables-2.4.1.min.js +0 -0
  109. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/js/bokeh-widgets-2.4.1.min.js +0 -0
  110. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/js/casaguijs-v0.0.4.0-b2.4.min.js +0 -0
  111. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/js/casaguijs-v0.0.5.0-b2.4.min.js +0 -0
  112. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/js/casaguijs-v0.0.6.0-b2.4.min.js +0 -0
  113. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/state/js/casalib-v0.0.1.min.js +0 -0
  114. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/tools/__init__.py +0 -0
  115. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/utils/_axes_labels.py +0 -0
  116. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/bokeh/utils/_svg_icon.py +0 -0
  117. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/data/__init__.py +0 -0
  118. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/data/casaimage/__init__.py +0 -0
  119. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/_gclean.py +0 -0
  120. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/apps/_plotants.py +0 -0
  121. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/apps/_plotbandpass.py +0 -0
  122. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/casashell/createmask.py +0 -0
  123. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/casatasks/__init__.py +0 -0
  124. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/casatasks/createmask.py +0 -0
  125. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/private/casatasks/createregion.py +0 -0
  126. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/readme.rst +0 -0
  127. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/remote/__init__.py +0 -0
  128. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/remote/_gclean.py +0 -0
  129. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/remote/_local.py +0 -0
  130. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/remote/_remote_kernel.py +0 -0
  131. {cubevis-0.5.17/cubevis/private/apps → cubevis-1.0.47/cubevis/toolbox}/_interactiveclean_wrappers.py +0 -0
  132. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/toolbox/_region_list.py +0 -0
  133. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_ResourceManager.py +0 -0
  134. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_contextmgrchain.py +0 -0
  135. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_conversion.py +0 -0
  136. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_copydoc.py +0 -0
  137. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_docenum.py +0 -0
  138. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_import_protected_module.py +0 -0
  139. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_logging.py +0 -0
  140. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_pkgs.py +0 -0
  141. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_regions.py +0 -0
  142. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_static.py +0 -0
  143. {cubevis-0.5.17 → cubevis-1.0.47}/cubevis/utils/_tiles.py +0 -0
  144. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/alma-many-chan/alma-many-chan.py +0 -0
  145. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/basic-websockets-demo/client.html +0 -0
  146. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/basic-websockets-demo/client.py +0 -0
  147. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/basic-websockets-demo/server.py +0 -0
  148. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/createmask-demo/run-createmask.py +0 -0
  149. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/createregion-demo/run-createregion.py +0 -0
  150. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/cubemask-demo/image-slider-spectra-done-stats.py +0 -0
  151. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/cubemask-demo/image-slider-spectra-done.py +0 -0
  152. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/cubemask-demo/image-slider-spectra.py +0 -0
  153. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/cubemask-demo/image-slider.py +0 -0
  154. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/cubemask-demo/image.py +0 -0
  155. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-demo/m100_interactive.py +0 -0
  156. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-demo/mask0-iclean.py +0 -0
  157. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-demo/run-gclean.py +0 -0
  158. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-demo/run-iclean-obj.py +0 -0
  159. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-demo/vla-sim-jet-iclean.py +0 -0
  160. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-first-look/run-fl-cont.py +0 -0
  161. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-first-look/run-fl-line.py +0 -0
  162. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-outlier/test_outlier.txt +0 -0
  163. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/iclean-remote/iclean_remote_webserver.py +0 -0
  164. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/large-cube/run-largecube.py +0 -0
  165. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/svg-test.py +0 -0
  166. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/updatable-data-source/direct-plot.py +0 -0
  167. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/updatable-data-source/simple-update.py +0 -0
  168. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/updatable-data-source/updated-plot.py +0 -0
  169. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/uranus-demo/uranus-iclean.py +0 -0
  170. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/websocket-reconnect/client.html +0 -0
  171. {cubevis-0.5.17 → cubevis-1.0.47}/tests/manual/websocket-reconnect/server.py +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cubevis
3
- Version: 0.5.17
3
+ Version: 1.0.47
4
4
  Summary: visualization toolkit and apps for casa
5
5
  License: LGPL
6
6
  Author-email: Darrell Schiebel <darrell@schiebel.us>,Pam Harris <pharris@nrao.edu>
7
- Requires-Python: >=3.10
7
+ Requires-Python: >=3.11
8
8
  Project-URL: Bug Tracker, https://github.com/casangi/cubevis/issues
9
9
  Project-URL: Homepage, https://github.com/casangi/cubevis?tab=readme-ov-file#cubevis---visualization-tools-for-casa-images
10
10
  Project-URL: Source, https://github.com/casangi/cubevis
@@ -0,0 +1,20 @@
1
+ <svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="512" height="512" fill="#f5f5f5"/>
3
+
4
+ <!-- Trash can body (tapered) -->
5
+ <path d="M 160 200 L 352 200 L 332 440 Q 332 460 312 460 L 200 460 Q 180 460 180 440 L 160 200 Z"
6
+ fill="none" stroke="black" stroke-width="24" stroke-linejoin="round"/>
7
+
8
+ <!-- Trash can lid -->
9
+ <rect x="120" y="160" width="272" height="40" rx="20" ry="20"
10
+ fill="none" stroke="black" stroke-width="24"/>
11
+
12
+ <!-- Handle -->
13
+ <rect x="200" y="120" width="112" height="40" rx="20" ry="20"
14
+ fill="none" stroke="black" stroke-width="24"/>
15
+
16
+ <!-- Vertical indents -->
17
+ <line x1="220" y1="220" x2="210" y2="420" stroke="black" stroke-width="16" stroke-linecap="round"/>
18
+ <line x1="256" y1="220" x2="256" y2="420" stroke="black" stroke-width="16" stroke-linecap="round"/>
19
+ <line x1="292" y1="220" x2="302" y2="420" stroke="black" stroke-width="16" stroke-linecap="round"/>
20
+ </svg>
@@ -0,0 +1,35 @@
1
+ <svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="512" height="512" fill="#f5f5f5"/>
3
+
4
+ <!-- Trash can body (tapered) -->
5
+ <path d="M 160 200 L 352 200 L 332 440 Q 332 460 312 460 L 200 460 Q 180 460 180 440 L 160 200 Z"
6
+ fill="none" stroke="black" stroke-width="24" stroke-linejoin="round"/>
7
+
8
+ <!-- Trash can lid (tilted open) -->
9
+ <ellipse cx="150" cy="140" rx="136" ry="20"
10
+ transform="rotate(-15 150 140)"
11
+ fill="none" stroke="black" stroke-width="24"/>
12
+
13
+ <!-- Handle (on tilted lid) -->
14
+ <rect x="105" y="100" width="112" height="40" rx="20" ry="20"
15
+ transform="rotate(-15 161 120)"
16
+ fill="black" stroke="none"/>
17
+
18
+ <!-- Vertical indents -->
19
+ <line x1="220" y1="220" x2="210" y2="420" stroke="black" stroke-width="16" stroke-linecap="round"/>
20
+ <line x1="256" y1="220" x2="256" y2="420" stroke="black" stroke-width="16" stroke-linecap="round"/>
21
+ <line x1="292" y1="220" x2="302" y2="420" stroke="black" stroke-width="16" stroke-linecap="round"/>
22
+
23
+ <!-- Overflow items -->
24
+ <circle cx="300" cy="120" r="16" fill="none" stroke="black" stroke-width="12"/>
25
+ <rect x="340" y="100" width="32" height="32" rx="8" fill="none" stroke="black" stroke-width="12"/>
26
+ <circle cx="380" cy="80" r="12" fill="none" stroke="black" stroke-width="10"/>
27
+ <rect x="320" y="60" width="24" height="24" rx="6" fill="none" stroke="black" stroke-width="10"/>
28
+
29
+ <!-- Additional overflow down the right side -->
30
+ <circle cx="390" cy="140" r="14" fill="none" stroke="black" stroke-width="10"/>
31
+ <rect x="400" y="170" width="28" height="28" rx="7" fill="none" stroke="black" stroke-width="10"/>
32
+ <circle cx="420" cy="210" r="10" fill="none" stroke="black" stroke-width="8"/>
33
+ <rect x="410" y="240" width="20" height="20" rx="5" fill="none" stroke="black" stroke-width="8"/>
34
+ <circle cx="430" cy="270" r="8" fill="none" stroke="black" stroke-width="6"/>
35
+ </svg>
@@ -1,6 +1,6 @@
1
1
  ########################################################################
2
2
  #
3
- # Copyright (C) 2021,2022
3
+ # Copyright (C) 2021,2022,2025
4
4
  # Associated Universities, Inc. Washington DC, USA.
5
5
  #
6
6
  # This script is free software; you can redistribute it and/or modify it
@@ -29,21 +29,32 @@
29
29
  used to build GUI applications for astronomy. It also contains some
30
30
  applications turn-key applications'''
31
31
 
32
- import os as __os
32
+ ###
33
+ ### Useful for debugging -- the default libraries can be set with
34
+ ### 'set_cubevis_lib(...)' which accepts only keyword parameters.
35
+ ### The parameters represent the JavaScript libraries used by
36
+ ### cubevis. The parameters are 'bokeh', 'bokeh_widgets',
37
+ ### 'bokeh_tables', 'casalib', 'cubevisjs'. "{JSLIB}" is substituted
38
+ ### with the actual path to "cubvis/__js__", so for example:
39
+ ###
40
+ #from cubevis.bokeh import set_cubevis_lib
41
+ #set_cubevis_lib( bokeh_tables="{JSLIB}/bokeh-tables-3.6.1.js", cubevisjs=... )
33
42
 
43
+ import os as _os
44
+ import logging as _logging
34
45
 
35
- from .private.apps import iclean
46
+ logger = _logging.getLogger('cubevis')
47
+ _handler = _logging.StreamHandler()
48
+ _formatter = _logging.Formatter('[%(name)s] %(levelname)s: %(message)s')
49
+ _handler.setFormatter(_formatter)
50
+ logger.addHandler(_handler)
36
51
 
37
- try:
38
- from .__version__ import __version__
39
- except ModuleNotFoundError:
40
- ###
41
- ### __version__.py is generated as part of the build, but if the source tree
42
- ### for cubevis is used directly for development, no __version__.py will be
43
- ### available so set it to a default value...
44
- ###
45
- __version__ = {}
52
+ if _os.getenv('CUBEVIS_DEBUG', '').lower() in ('1', 'true', 'yes', 'on'):
53
+ logger.setLevel(_logging.DEBUG)
54
+ else:
55
+ logger.setLevel(_logging.INFO)
46
56
 
57
+ from .private.apps import iclean
47
58
 
48
59
  def xml_interface_defs( ):
49
60
  '''This function may eventually return XML files for use in generating casashell bindings. An
@@ -52,7 +63,7 @@ def xml_interface_defs( ):
52
63
  '''
53
64
  return { }
54
65
 
55
- __mustache_interface_templates__ = { 'iclean': __os.path.join( __os.path.dirname(__file__), "private", "casashell", "iclean.mustache" ) }
66
+ __mustache_interface_templates__ = { 'iclean': _os.path.join( _os.path.dirname(__file__), "private", "casashell", "iclean.mustache" ) }
56
67
  def mustache_interface_templates( ):
57
68
  '''This provides a list of mustache files provided by cubevis. It may eventually allow
58
69
  casashell to generate all of its bindings at startup time. This would allow casashell
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+ /*!
3
+ * Copyright (c) Anaconda, Inc., and Bokeh Contributors
4
+ * All rights reserved.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without modification,
7
+ * are permitted provided that the following conditions are met:
8
+ *
9
+ * Redistributions of source code must retain the above copyright notice,
10
+ * this list of conditions and the following disclaimer.
11
+ *
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ * this list of conditions and the following disclaimer in the documentation
14
+ * and/or other materials provided with the distribution.
15
+ *
16
+ * Neither the name of Anaconda nor the names of any contributors
17
+ * may be used to endorse or promote products derived from this software
18
+ * without specific prior written permission.
19
+ *
20
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30
+ * THE POSSIBILITY OF SUCH DAMAGE.
31
+ */
32
+ (function(root, factory) {
33
+ factory(root["Bokeh"], undefined);
34
+ })(this, function(Bokeh, version) {
35
+ let define;
36
+ return (function(modules, entry, aliases, externals) {
37
+ const bokeh = typeof Bokeh !== "undefined" ? (version != null ? Bokeh[version] : Bokeh) : null;
38
+ if (bokeh != null) {
39
+ return bokeh.register_plugin(modules, entry, aliases);
40
+ } else {
41
+ throw new Error("Cannot find Bokeh" + (version != null ? " " + version : "") + ". You have to load it prior to loading plugins.");
42
+ }
43
+ })
44
+ ({
45
+ "07c9fde72b": function _(e,a,t,o,c){o();const i=e("tslib"),n=e("f8eca7a5dd");c("DataPipe",n.DataPipe);c("activeDataPipes",e("5179d11e71").activeDataPipes);const p=e("2889e0dd45");c("ImagePipe",p.ImagePipe);const s=e("de65005924");c("ImageDataSource",s.ImageDataSource);const r=e("02e3c3e46c");c("SpectraDataSource",r.SpectraDataSource);const d=e("64b16deff9");c("UpdatableDataSource",d.UpdatableDataSource);const S=e("b6ae454f0d");c("WcsTicks",S.WcsTicks);const l=e("cb7d28d6b3");c("DragTool",l.DragTool);const D=e("9d3c34ff8e");c("CBResetTool",D.CBResetTool);const T=e("e3901fa9f2");c("serialize",T.serialize),c("deserialize",T.deserialize);const b=e("9f961622ce");c("TipButton",b.TipButton);const u=e("ca4c845905");c("Tip",u.Tip);const f=e("a6e757a69a");c("Showable",f.Showable);const P=e("467d2716b0");c("BokehAppContext",P.BokehAppContext);const g=e("50a1e32f01");c("SharedDict",g.SharedDict);const h=e("b55081402e");c("EditSpan",h.EditSpan);const B=e("9144bfc7a5");c("EvTextInput",B.EvTextInput);const E=e("74e0abef8a");c("EvPolyAnnotation",E.EvPolyAnnotation);const I=i.__importStar(e("484bb85d20"));t.find=I;(0,e("@bokehjs/base").register_models)({DataPipe:n.DataPipe,ImagePipe:p.ImagePipe,ImageDataSource:s.ImageDataSource,SpectraDataSource:r.SpectraDataSource,UpdatableDataSource:d.UpdatableDataSource,WcsTicks:S.WcsTicks,DragTool:l.DragTool,CBResetTool:D.CBResetTool,Tip:u.Tip,TipButton:b.TipButton,SharedDict:g.SharedDict,Showable:f.Showable,BokehAppContext:P.BokehAppContext,EditSpan:h.EditSpan,EvTextInput:B.EvTextInput,EvPolyAnnotation:E.EvPolyAnnotation})},
46
+ "f8eca7a5dd": function _(e,s,t,i,n){var o;i();const a=e("@bokehjs/models/sources/data_source"),c=e("e3901fa9f2"),r=e("@bokehjs/core/util/callbacks"),l=e("5179d11e71");class d extends a.DataSource{constructor(e){super(e),this.send_queue={},this.connection_queue=[],this.pending={},this.incoming_callbacks={},this.session_id=casalib.object_id(this)}checkSessionConflict(){try{if("undefined"==typeof Storage)return console.warn("localStorage not available, skipping session conflict detection"),!0;const e=localStorage.getItem(this.session_storage_key);if(e){const s=JSON.parse(e);if(s.sessionId!==this.session_id&&Date.now()-s.timestamp<12e4){if(this.conflict_check){const e=`CubeVis DataPipe (${this.instance_key}) is already running in another browser window or tab.\n\nPlease close other instances and refresh this page, or\nclose this window to continue using the other instance.`;return alert(e),window.opener||1===window.history.length?window.close():window.location.href="about:blank",!1}console.group(`DataPipe ${this.instance_key} conflict detected in Jupyter context`),console.log("Current session ID:",this.session_id),console.log("Existing session ID:",s.sessionId),console.log("Existing timestamp:",new Date(s.timestamp).toISOString()),console.log("Age of existing session (ms):",Date.now()-s.timestamp),console.log("Address:",this.address),console.log("Instance key:",this.instance_key),console.log("Storage key:",this.session_storage_key),console.log("Existing data:",s),console.log("All localStorage keys:",Object.keys(localStorage).filter((e=>e.startsWith("cubevis_datapipe_")))),console.groupEnd()}}return this.updateSessionHeartbeat(),!0}catch(e){return console.warn("Session conflict detection failed:",e),!0}}updateSessionHeartbeat(){try{"undefined"!=typeof Storage&&localStorage.setItem(this.session_storage_key,JSON.stringify({sessionId:this.session_id,timestamp:Date.now(),instanceKey:this.instance_key}))}catch(e){console.warn("Session heartbeat update failed:",e)}}startHeartbeat(){this.heartbeat_interval=window.setInterval((()=>{this.updateSessionHeartbeat()}),3e4)}stopHeartbeat(){this.heartbeat_interval&&(clearInterval(this.heartbeat_interval),this.heartbeat_interval=void 0)}cleanupSession(){try{if("undefined"!=typeof Storage){const e=localStorage.getItem(this.session_storage_key);if(e){JSON.parse(e).sessionId===this.session_id&&localStorage.removeItem(this.session_storage_key)}}}catch(e){console.warn("Session cleanup failed:",e)}this.stopHeartbeat()}handleSessionConflictMessage(e){console.error("Session conflict detected by server:",e);let s="Session conflict detected by server.";"session_conflict"===e.type?s=e.error||s:"session_corruption"===e.type&&(s=`Session corruption detected.\nExpected: ${e.expected}\nReceived: ${e.received}`),alert(s+"\n\nThis window will be closed to prevent data corruption."),this.cleanupSession();const t=new CustomEvent("cubevis_session_conflict",{detail:{message:e,sessionId:this.session_id}});window.dispatchEvent(t),setTimeout((()=>{window.opener||1===window.history.length?window.close():window.location.href="about:blank"}),2e3)}generateInstanceKey(){const e=`${this.address[0]}_${this.address[1]}`;return`${this.instance_id}_${e}`}initialize(){if(super.initialize(),l.activeDataPipes.register(this),this.instance_key=this.generateInstanceKey(),this.session_storage_key=`cubevis_datapipe_${this.instance_key}`,!this.checkSessionConflict())return;let e=`ws://${this.address[0]}:${this.address[1]}`;console.log("datapipe url:",e);var s=void 0;document.shutdown_in_progress_=!1;var t=()=>{void 0!==this.websocket&&this.websocket.close(),this.websocket=new WebSocket(e),this.websocket.binaryType="arraybuffer",this.websocket.addEventListener("error",(e=>{console.log("error encountered:",e)})),this.websocket.onmessage=e=>{if("string"==typeof e.data||e.data instanceof String){let s=(0,c.deserialize)(e.data);if("id"in s&&"direction"in s&&"message"in s){let{id:e,message:t,direction:i}=s;if("error"===i&&("session_conflict"===e||e===this.session_id)&&t&&("session_conflict"===t.type||"session_corruption"===t.type||"close_duplicate"===t.action))return void this.handleSessionConflictMessage(t);if(void 0===t&&console.log("Error, event failure",s),"j2p"==i)if(e in this.pending){let{cb:i}=this.pending[e];if(delete this.pending[e],e in this.send_queue&&this.send_queue[e].length>0){let{cb:s,msg:t}=this.send_queue[e].shift();this.pending[e]={cb:s},this.websocket.send((0,c.serialize)(t))}void 0===t?console.log("DROPPING ERROR FOR NOW (maybe need error callbacks)",s):i(t)}else console.log("message received but could not find id");else if(e in this.incoming_callbacks){let s=this.incoming_callbacks[e](t);this.websocket.send((0,c.serialize)({id:e,direction:i,message:s,session:this.session_id}))}}else console.log(`datapipe received message without one of 'id', 'message' or 'direction': ${s}`)}else console.log("datapipe received binary data",e.data.byteLength,"bytes")},this.websocket.onopen=()=>{for(s?0==s.connected&&console.log(`connection reestablished at ${new Date}`):(this.websocket.send((0,c.serialize)({id:"initialize",direction:"j2p",session:this.session_id})),this.startHeartbeat()),s=new casalib.ReconnectState;this.connection_queue.length>0;){let e=this.connection_queue.shift();this.send.apply(e[0],e[1])}},this.websocket.onclose=()=>{if(s&&1==s.connected&&(console.log(`connection lost at ${new Date}`),s.connected=!1,!document.shutdown_in_progress_)){console.log(`connection lost at ${new Date}`);var e=s;function i(n){0==s.connected&&(console.log(`${n+1}\treconnection attempt ${new Date}`),t(),e.backoff(),e.retries>0?setTimeout(i,e.timeout,n+1):0==s.connected&&console.log(`aborting reconnection after ${n} attempts ${new Date}`))}i(0)}}};window.addEventListener("beforeunload",(()=>{this.cleanupSession()})),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState?this.stopHeartbeat():"visible"===document.visibilityState&&(this.updateSessionHeartbeat(),this.startHeartbeat())})),t();(()=>{null!=this.init_script&&(0,r.execute)(this.init_script,this)})()}destroy(){l.activeDataPipes.unregister(this),super.destroy()}register(e,s){this.incoming_callbacks[e]=s}send(e,s,t,i=!1){let n={id:e,message:s,direction:"j2p",session:this.session_id};if(!this.websocket||e in this.pending)if(e in this.send_queue)if("boolean"==typeof i&&i&&this.send_queue[e].length>0)this.send_queue[e][0].msg=n,this.send_queue[e][0].cb=t;else if("function"==typeof i&&this.send_queue[e].length>0){let o=!1;for(const a of this.send_queue[e])i(a.msg.message)&&(a.msg=n,a.cb=t,o=!0);o||this.send_queue[e].push({cb:t,msg:n})}else this.send_queue[e].push({cb:t,msg:n});else this.send_queue[e]=[{cb:t,msg:n}];else if(this.websocket.readyState===WebSocket.CONNECTING)this.connection_queue.push([this,[e,s,t]]);else if(e in this.send_queue&&this.send_queue[e].length>0){this.send_queue[e].push({cb:t,msg:n});{let{cb:r,msg:l}=this.send_queue[e].shift();if(this.pending[e]={cb:r},this.websocket.readyState===WebSocket.OPEN)this.websocket.send((0,c.serialize)(l));else{let d=20,h=this;function u(){h.websocket.readyState===WebSocket.OPEN?h.websocket.send((0,c.serialize)(l)):(d-=1,d>0&&setTimeout(u,3e3))}setTimeout(u,3e3)}}}else if(this.websocket.readyState===WebSocket.OPEN)this.pending[e]={cb:t},this.websocket.send((0,c.serialize)(n));else{let g=20,b=this;function _(){b.websocket.readyState===WebSocket.OPEN?(b.pending[e]={cb:t},b.websocket.send((0,c.serialize)(n))):(g-=1,g>0&&setTimeout(_,3e3))}setTimeout(_,3e3)}}}t.DataPipe=d,o=d,d.__name__="DataPipe",d.__module__="cubevis.bokeh.sources._data_pipe",o.define((({Any:e,Tuple:s,String:t,Number:i,Bool:n})=>({init_script:[e,null],address:[s(t,i)],instance_id:[t],conflict_check:[n,!0]})))},
47
+ "e3901fa9f2": function _(e,r,s,i,o){i();const l=e("@bokehjs/base"),a=e("@bokehjs/core/resolvers"),t=e("@bokehjs/core/serialization/deserializer"),n=e("@bokehjs/core/serialization/serializer"),{deserialize:c}=new class{constructor(){this.resolver=new a.ModelResolver(l.default_resolver),this.deserializer=new t.Deserializer(this.resolver),this.deserialize=e=>{try{return this.deserializer.decode(JSON.parse(e))}catch(r){return console.group("deserialize error"),console.log(e),console.log(r),console.groupEnd(),{}}}}};s.deserialize=c;const{serialize:z}=new class{constructor(){this.serializer=new n.Serializer,this.serialize=e=>JSON.stringify(this.serializer.encode(e))}};s.serialize=z},
48
+ "5179d11e71": function _(a,e,n,c,t){c();const i=a("30b45c52a1");n.activeDataPipes=new i.ModelManager},
49
+ "30b45c52a1": function _(e,n,s,t,i){t();class r{constructor(){this.instances=new Map}register(e){this.instances.set(e.id,e),console.log(`registered instance ${e.id}`)}unregister(e){this.instances.delete(e.id),console.log(`unregistered instance ${e.id}`)}getInstances(){return Array.from(this.instances.values())}getInstance(e){return this.instances.get(e)}}s.ModelManager=r,r.__name__="ModelManager"},
50
+ "2889e0dd45": function _(i,e,s,t,n){var a;t();const o=i("@bokehjs/models/sources/column_data_source"),d=i("f8eca7a5dd");class r extends d.DataPipe{constructor(i){super(i),this.position={},this._wcs=null}initialize(){super.initialize(),this.fits_header_json&&(this._wcs=new casalib.coordtxl.WCSTransform(new casalib.coordtxl.MapKeywordProvider(JSON.parse(this.fits_header_json))))}channel(i,e,s){this.position[s]={index:i};let t={action:"channel",index:i,id:s};super.send(this.dataid,t,(i=>{null!=this._histogram_source&&"hist"in i&&"top"in i.hist&&"bottom"in i.hist&&"left"in i.hist&&"right"in i.hist&&(this._histogram_source.data=i.hist),e(i)}))}spectrum(i,e,s,t=!1){let n={action:"spectrum",index:i,id:s};super.send(this.dataid,n,e,t)}adjust_colormap(i,e,s,t,n=!1){const a={action:"adjust-colormap",bounds:i,transfer:e,id:t};super.send(this.dataid,a,s,n)}refresh(i,e,s=[0,0]){let{index:t}=e in this.position?this.position[e]:{index:s};if(2===t.length){let s={action:"channel",index:t,id:e};super.send(this.dataid,s,i)}else if(3===t.length){let s={action:"spectrum",index:t,id:e};super.send(this.dataid,s,i)}}wcs(){return this._wcs}}s.ImagePipe=r,a=r,r.__name__="ImagePipe",r.__module__="cubevis.bokeh.sources._image_pipe",a.define((({Number:i,Nullable:e,String:s,Tuple:t,Ref:n})=>({dataid:[s],shape:[t(i,i,i,i)],fits_header_json:[e(s),null],_histogram_source:[e(n(o.ColumnDataSource)),null]})))},
51
+ "de65005924": function _(s,a,t,c,i){var o;c();const e=s("@bokehjs/models/sources/column_data_source"),n=s("@bokehjs/core/util/string"),u=s("2889e0dd45"),h=s("@bokehjs/core/util/callbacks");class r extends e.ColumnDataSource{constructor(s){super(s),this.imid=(0,n.uuid4)()}_mask_contour(s){const a=casalib.d3.contours().size(this.image_source.shape.slice(0,2)).thresholds([1])(s[0])[0].coordinates.map((s=>s.map((s=>s.reduce(((s,a)=>(s[0].push(a[0]),s[1].push(a[1]),s)),[[],[]])))));return{xs:[a.map((s=>s.map((s=>s[0]))))],ys:[a.map((s=>s.map((s=>s[1]))))]}}initialize(){if(super.initialize(),null!=this._mask_contour_source&&"msk"in this.data&&this.data.msk.length>0&&this.data.msk[0].length>0){const s=this.data.msk;this._mask_contour_source.data=this._mask_contour(s)}void 0===this.last_chan&&(this.last_chan=[this.cur_chan[0].valueOf(),this.cur_chan[1].valueOf()]);(()=>{null!=this.init_script&&(0,h.execute)(this.init_script,this)})()}channel(s,a=0,t){this.image_source.channel([a,s],(c=>{void 0!==c&&void 0!==c.chan||console.log("ImageDataSource ERROR ENCOUNTERED <1>",c),this.last_chan=[this.cur_chan[0].valueOf(),this.cur_chan[1].valueOf()],this.cur_chan=[a,s],null!=this._mask_contour_source&&"chan"in c&&"msk"in c.chan&&(c.msk_contour=this._mask_contour(c.chan.msk),this._mask_contour_source.data=c.msk_contour),t&&t(c),this.data=c.chan}),this.imid)}adjust_colormap(s,a,t){this.image_source.adjust_colormap(s,a,t,this.imid,!0)}signal_change(){this.change.emit()}refresh(s){this.image_source.refresh((a=>{void 0!==a&&void 0!==a.chan||console.log("ImageDataSource ERROR ENCOUNTERED <2>",a),null!=this._mask_contour_source&&"chan"in a&&"msk"in a.chan&&(a.msk_contour=this._mask_contour(a.chan.msk),this._mask_contour_source.data=a.msk_contour),s&&s(a),this.data=a.chan}),this.imid,[0,0])}wcs(){return this.image_source.wcs()}}t.ImageDataSource=r,o=r,r.__name__="ImageDataSource",r.__module__="cubevis.bokeh.sources._image_data_source",o.define((({Tuple:s,Number:a,Ref:t,Nullable:c,Any:i})=>({init_script:[i,null],image_source:[t(u.ImagePipe)],_mask_contour_source:[c(t(e.ColumnDataSource)),null],num_chans:[s(a,a)],cur_chan:[s(a,a)]})))},
52
+ "02e3c3e46c": function _(e,s,i,t,r){var a;t();const c=e("@bokehjs/models/sources/column_data_source"),u=e("@bokehjs/core/util/string"),o=e("2889e0dd45");class _ extends c.ColumnDataSource{constructor(e){super(e),this.imid=(0,u.uuid4)()}initialize(){super.initialize()}spectra(e,s,i=0,t=!1){this.image_source.spectrum([e,s,i],(e=>this.data=e.spectrum),this.imid,t)}refresh(){this.image_source.refresh((e=>this.data=e.spectrum),this.imid,[0,0,0])}}i.SpectraDataSource=_,a=_,_.__name__="SpectraDataSource",_.__module__="cubevis.bokeh.sources._spectra_data_source",a.define((({Ref:e})=>({image_source:[e(o.ImagePipe)]})))},
53
+ "64b16deff9": function _(e,s,i,a,t){var n;a();const u=e("@bokehjs/models/sources/column_data_source"),l=e("f8eca7a5dd"),o=e("@bokehjs/core/util/callbacks");class c extends u.ColumnDataSource{constructor(e){super(e)}send(e,s){this.pipe.send(this.session_id.valueOf(),{action:"callback",message:e},(e=>{s("result"in e?e.result:{error:`expected to find a "result" in "${e}"`,msg:e})}))}initialize(){super.initialize();(()=>{null!=this.js_init&&(0,o.execute)(this.js_init,this)})()}}i.UpdatableDataSource=c,n=c,c.__name__="UpdatableDataSource",c.__module__="cubevis.bokeh.sources._updatable_data_source",n.define((({Ref:e,Any:s,String:i})=>({js_init:[s,null],js_update:[s,null],pipe:[e(l.DataPipe)],session_id:[i]})))},
54
+ "b6ae454f0d": function _(s,i,o,t,e){var r;t();const a=s("@bokehjs/models/formatters/tick_formatter"),c=s("de65005924");class l extends a.TickFormatter{constructor(s){super(s),this._axis=null,this._coord="world"}initialize(){super.initialize(),"x"==this.axis||"X"==this.axis||"y"==this.axis||"Y"==this.axis?this._axis="x"==this.axis||"X"==this.axis?"x":"y":console.log("ERROR: WcsTicks formatter created with invalid axis:",this.axis)}doFormat(s){const i=[];if(this._axis&&this.image_source.wcs()&&"world"==this._coord)for(let o=0,t=s.length;o<t;o++)if("x"==this._axis){const t=new casalib.coordtxl.Point2D(Number(s[o]),0);this.image_source.wcs().imageToWorldCoords(t,!1),i.push(new casalib.coordtxl.WorldCoords(t.getX(),t.getY()).format(2e3)[0])}else{const t=new casalib.coordtxl.Point2D(0,Number(s[o]));this.image_source.wcs().imageToWorldCoords(t,!1),i.push(new casalib.coordtxl.WorldCoords(t.getX(),t.getY()).format(2e3)[1])}else for(let o=0,t=s.length;o<t;o++)i.push(""+s[o]);return i}coordinates(s){return s!=this._coord&&("world"!=s&&"pixel"!=s||(this._coord=s)),this._coord}}o.WcsTicks=l,r=l,l.__name__="WcsTicks",l.__module__="cubevis.bokeh.format._wcs_ticks",r.define((({Ref:s,String:i})=>({axis:[i],image_source:[s(c.ImageDataSource)]})))},
55
+ "cb7d28d6b3": function _(i,e,t,o,s){var d;o();const l=i("@bokehjs/models/tools/gestures/gesture_tool"),r=i("8fc7a9e935"),_=i("484bb85d20"),m=i("@bokehjs/core/util/callbacks");class a extends l.GestureToolView{_pan_start(i){var e;null===(e=this.model.document)||void 0===e||e.interactive_start(this.plot_view.model);const t=(0,_.px_from_sx)(this.plot_view,i.sx),o=(0,_.py_from_sy)(this.plot_view,i.sy),s=(0,_.dx_from_px)(this.plot_view,t),d=(0,_.dy_from_py)(this.plot_view,o),{start:l}=this.model;l?(0,m.execute)(l,this.model,{sx:t,sy:o,x:s,y:d,delta_x:i.dx,delta_y:-i.dy,shift:"modifiers"in i?i.modifiers.shift:void 0,ctrl:"modifiers"in i?i.modifiers.ctrl:void 0,alt:"modifiers"in i?i.modifiers.alt:void 0}):this.model.trigger_event(new r.DragStart(t,o,s,d,i.dx,-i.dy,i.modifiers))}_pan(i){var e;null===(e=this.model.document)||void 0===e||e.interactive_start(this.plot_view.model);const t=(0,_.px_from_sx)(this.plot_view,i.sx),o=(0,_.py_from_sy)(this.plot_view,i.sy),s=(0,_.dx_from_px)(this.plot_view,t),d=(0,_.dy_from_py)(this.plot_view,o),{move:l}=this.model;l?(0,m.execute)(l,this.model,{sx:t,sy:o,x:s,y:d,delta_x:i.dx,delta_y:-i.dy,shift:"modifiers"in i?i.modifiers.shift:void 0,ctrl:"modifiers"in i?i.modifiers.ctrl:void 0,alt:"modifiers"in i?i.modifiers.alt:void 0}):this.model.trigger_event(new r.Drag(t,o,s,d,i.dx,-i.dy,i.modifiers))}_pan_end(i){const e=(0,_.px_from_sx)(this.plot_view,i.sx),t=(0,_.py_from_sy)(this.plot_view,i.sy),o=(0,_.dx_from_px)(this.plot_view,e),s=(0,_.dy_from_py)(this.plot_view,t),{end:d}=this.model;d?(0,m.execute)(d,this.model,{sx:e,sy:t,x:o,y:s,delta_x:i.dx,delta_y:-i.dy,shift:"modifiers"in i?i.modifiers.shift:void 0,ctrl:"modifiers"in i?i.modifiers.ctrl:void 0,alt:"modifiers"in i?i.modifiers.alt:void 0}):this.model.trigger_event(new r.DragEnd(e,t,o,s,i.dx,-i.dy,i.modifiers))}}t.DragToolView=a,a.__name__="DragToolView";class n extends l.GestureTool{constructor(i){super(i),this.tool_name="Drag",this.event_type="pan",this.default_order=10}}t.DragTool=n,d=n,n.__name__="DragTool",n.__module__="cubevis.bokeh.tools._drag_tool",d.prototype.default_view=a,d.define((({Any:i,Nullable:e})=>({start:[e(i),null],move:[e(i),null],end:[e(i),null]})))},
56
+ "8fc7a9e935": function _(e,t,a,s,_){s();const n=e("@bokehjs/core/bokeh_events");class r extends n.Pan{}a.Drag=r,r.__name__="Drag";class l extends n.PanStart{constructor(e,t,a,s,_,n,r){super(e,t,a,s,r),this.delta_x=_,this.delta_y=n}get event_values(){const{delta_x:e,delta_y:t}=this;return{...super.event_values,delta_x:e,delta_y:t}}}a.DragStart=l,l.__name__="DragStart";class d extends n.PanEnd{constructor(e,t,a,s,_,n,r){super(e,t,a,s,r),this.delta_x=_,this.delta_y=n}get event_values(){const{delta_x:e,delta_y:t}=this;return{...super.event_values,delta_x:e,delta_y:t}}}a.DragEnd=d,d.__name__="DragEnd"},
57
+ "484bb85d20": function _(n,e,o,t,r){t(),o.view=function(n){function e(o){if(o.model===n)return o;for(const n of o.children()){const o=e(n);if(o)return o}return null}const o=n.document;if(!o)return null;const t=o.views_manager;if(!t)return null;const r=t.roots;for(const n of r){const o=e(n);if(o)return o}return null},o.span_coords=function(n){function e(n,e,o,t,r){if(null!=n)switch(e){case"canvas":return r.compute(n);case"screen":return t.compute(n);case"data":return o.compute(n)}return NaN}const{frame:o,canvas:t}=n.plot_view,{x_scale:r,y_scale:i}=n.coordinates;let c,s,u,a,f=n.model.dimension;"width"==n.model.dimension?(u=e(n.model.location,n.model.location_units,i,o.bbox.yview,t.bbox.y_screen),s=o.bbox.left,a=o.bbox.width,c=n.model.line_width):(u=o.bbox.top,s=e(n.model.location,n.model.location_units,r,o.bbox.xview,t.bbox.y_screen),a=n.model.line_width,c=o.bbox.height);return{stop:u,sleft:s,width:a,height:c,orientation:f}},o.px_from_sx=function(n,e){return n.frame.bbox.x_view.invert(e)},o.py_from_sy=function(n,e){return n.frame.bbox.y_view.invert(e)},o.dx_from_px=function(n,e){const o=n.frame.bbox.x_view.compute(e);return n.frame.x_scale.invert(o)},o.dy_from_py=function(n,e){const o=n.frame.bbox.y_view.compute(e);return n.frame.y_scale.invert(o)},o.sx_from_dx=function(n,e){return n.frame.x_scale.compute(e)},o.sy_from_dy=function(n,e){return n.frame.y_scale.compute(e)},o.v_px_from_sx=function(n,e){return n.frame.bbox.x_view.v_invert(e)},o.v_py_from_sy=function(n,e){return n.frame.bbox.y_view.v_invert(e)},o.v_dx_from_px=function(n,e){const o=n.frame.bbox.x_view.v_compute(e);return n.frame.x_scale.v_invert(o)},o.v_dy_from_py=function(n,e){const o=n.frame.bbox.y_view.v_compute(e);return n.frame.y_scale.v_invert(o)},o.v_sx_from_dx=function(n,e){return n.frame.x_scale.v_compute(e)},o.v_sy_from_dy=function(n,e){return n.frame.y_scale.v_compute(e)},o.children=function(n,e=["children","items","panes","tabs","child","ui"]){return o=>{if(!o)return[];const t=o=>{const r=o,i=(e=>"string"==typeof n?(console.log(`<S:${e.type}>`,e),e.type===n):(console.log(`<C:${e.type}>`,e),e instanceof n))(r)?[r]:[];return[...i,...e.flatMap((n=>{const e=o[n];if(!e)return[];return(Array.isArray(e)?e:[e]).flatMap(t)}))]};return t(o)}},o.appState=function(n){var e,t;const r=(0,o.context)(n);if(r){return null===(t=(null===(e=null===window||void 0===window?void 0:window.cubevisAppSession)||void 0===e?void 0:e.applications)[r.app_id])||void 0===t?void 0:t.state}return};const i=n("@bokehjs/model");function c(n,e,o=new Set){if(o.has(n))return;if(o.add(n),e(n))return n;const t=["children","items","panes","tabs","child","ui"];for(const r of t){const t=n[r];if(t){const n=Array.isArray(t)?t:[t];for(const t of n)if(t instanceof i.Model&&!o.has(t)){const n=c(t,e,o);if(n)return n}}}}function s(n){return e=>{var o,t,r;const i=null!==(t=null===(o=null==e?void 0:e.document)||void 0===o?void 0:o.all_roots)&&void 0!==t?t:null===(r=null==e?void 0:e.document)||void 0===r?void 0:r.roots();if(!i)return;const s=["children","items","panes","tabs","child","ui"],u=e=>{const o=e;return(null==o?void 0:o.type)===n?[o]:s.flatMap((n=>{const o=e[n];if(!o)return[];return(Array.isArray(o)?o:[o]).flatMap(u)}))};return i.flatMap(u).find((n=>Boolean(c(n,(n=>n.id===e.id)))))}}o.context=s("cubevis.bokeh.models._bokeh_app_context.BokehAppContext"),o.showable=s("cubevis.bokeh.models._showable.Showable")},
58
+ "9d3c34ff8e": function _(e,o,l,s,t){var c;s();const _=e("@bokehjs/models/tools/actions/reset_tool"),i=e("@bokehjs/styles/icons.css"),a=e("@bokehjs/core/util/callbacks");class n extends _.ResetToolView{doit(){const{precallback:e,postcallback:o}=this.model;null!=e&&(0,a.execute)(e,this.model),this.plot_view.reset(),null!=o&&(0,a.execute)(o,this.model)}}l.CBResetToolView=n,n.__name__="CBResetToolView";class r extends _.ResetTool{constructor(e){super(e),this.tool_name="CBReset",this.tool_icon=i.tool_icon_reset}}l.CBResetTool=r,c=r,r.__name__="CBResetTool",r.__module__="cubevis.bokeh.tools._cbreset_tool",c.prototype.default_view=n,c.define((({Any:e,Nullable:o})=>({precallback:[o(e),null],postcallback:[o(e),null]}))),c.register_alias("cbreset",(()=>new c))},
59
+ "9f961622ce": function _(e,t,i,o,s){var n;o();const l=e("@bokehjs/models/widgets/abstract_button"),c=e("@bokehjs/models/ui/tooltip"),d=e("@bokehjs/models/ui/icons/builtin_icon"),u=e("@bokehjs/core/build_views"),h=e("@bokehjs/core/bokeh_events"),r=e("@bokehjs/core/util/object");class a extends l.AbstractButtonView{constructor(){super(...arguments),this.isMouseInside=!1}click(){this.model.trigger_event(new h.ButtonClick),super.click()}*children(){yield*super.children(),yield this.tooltip}Show(){this.tooltip.model.setv({visible:!0,closable:!1})}unShow(){this.tooltip.model.setv({visible:!1,closable:!1})}async lazy_initialize(){const{hover_wait:e}=this.model;this.debouncedShow=casalib.debounce((()=>{this.isMouseInside&&this.Show()}),1e3*e),await super.lazy_initialize();const{tooltip:t}=this.model;this.tooltip=await(0,u.build_view)(t,{parent:this})}remove(){this.tooltip.remove(),super.remove()}render(){super.render(),this.el.addEventListener("mouseenter",(()=>{this.isMouseInside=!0,this.debouncedShow()})),this.el.addEventListener("mouseleave",(()=>{this.isMouseInside=!1,this.debouncedShow.cancel(),this.unShow()})),document.addEventListener("mousedown",(e=>{if(void 0===(0,r.dict)(this.model.js_event_callbacks).get(h.ButtonClick.prototype.event_name)){if(e.composedPath().includes(this.tooltip.el))return;this.debouncedShow.cancel(),this.unShow()}else this.isMouseInside=!1,this.debouncedShow.cancel(),this.unShow()})),window.addEventListener("blur",(()=>{this.debouncedShow.cancel(),this.unShow()}))}}i.TipButtonView=a,a.__name__="TipButtonView";class b extends l.AbstractButton{constructor(e){super(e)}on_click(e){this.on_event(h.ButtonClick,e)}}i.TipButton=b,n=b,b.__name__="TipButton",b.__module__="cubevis.bokeh.models._tip_button",n.prototype.default_view=a,n.define((({Ref:e,Number:t})=>({tooltip:[e(c.Tooltip)],hover_wait:[t,1.5]}))),n.override({label:"",icon:new d.BuiltinIcon({icon_name:"help",size:18}),button_type:"default"})},
60
+ "ca4c845905": function _(e,i,s,t,o){var l;t();const d=e("@bokehjs/models/layouts/layout_dom"),n=e("@bokehjs/models/ui/ui_element"),h=e("@bokehjs/models/ui/tooltip"),r=e("@bokehjs/core/dom"),a=e("@bokehjs/core/build_views");class c extends d.LayoutDOMView{constructor(){super(...arguments),this.isMouseInside=!1}stylesheets(){return[...super.stylesheets(),"*, *:before, *:after { box-sizing: border-box; } fieldset { border: 0px; margin: 0px; padding: 0px; }"]}Show(){this.tooltip.model.setv({visible:!0,closable:!1})}unShow(){this.tooltip.model.setv({visible:!1,closable:!1})}async lazy_initialize(){const{hover_wait:e}=this.model;this.debouncedShow=casalib.debounce((()=>{this.isMouseInside&&this.Show()}),1e3*e),await super.lazy_initialize(),await this.build_child_views();const{tooltip:i}=this.model;this.tooltip=await(0,a.build_view)(i,{parent:this})}remove(){this.tooltip.remove(),super.remove()}connect_signals(){super.connect_signals();const{child:e}=this.model.properties;this.on_change(e,(()=>this.update_children())),this.el.addEventListener("mouseenter",(e=>{this.mouseenter.emit(e)})),this.el.addEventListener("mouseleave",(e=>{this.mouseleave.emit(e)}))}*children(){yield*super.children(),yield this.tooltip}get child_models(){return[this.model.child]}render(){super.render(),this.el.addEventListener("mouseenter",(()=>{this.isMouseInside=!0,this.debouncedShow()})),this.el.addEventListener("mouseleave",(()=>{this.isMouseInside=!1,this.debouncedShow.cancel(),this.unShow()})),window.addEventListener("blur",(()=>{this.debouncedShow.cancel(),this.unShow()})),this.el.addEventListener("click",(()=>{this.debouncedShow.cancel(),this.unShow()}));const e=this.child_views.map((e=>e.el));this.fieldset_el=(0,r.fieldset)({},...e),this.shadow_el.appendChild(this.fieldset_el)}_update_children(){const e=this.child_views.map((e=>e.el));this.fieldset_el.append(...e)}}s.TipView=c,c.__name__="TipView";class u extends d.LayoutDOM{constructor(e){super(e)}}s.Tip=u,l=u,u.__name__="Tip",u.__module__="cubevis.bokeh.models._tip",l.prototype.default_view=c,l.define((({Ref:e,Number:i})=>({child:[e(n.UIElement)],tooltip:[e(h.Tooltip)],hover_wait:[i,1.5]})))},
61
+ "a6e757a69a": function _(e,t,l,o,s){var i;o();const a=e("@bokehjs/models/layouts/layout_dom"),r=e("@bokehjs/models/ui/ui_element");class n extends a.LayoutDOMView{constructor(){super(...arguments),this._overlay_el=null}get child_models(){return null!=this.model.ui?[this.model.ui]:[]}initialize(){super.initialize(),this.el.setAttribute("data-lm-suppress-shortcuts","true")}async lazy_initialize(){await super.lazy_initialize()}connect_signals(){super.connect_signals(),this.connect(this.model.properties.disabled.change,(()=>{this._update_disabled_state()})),this.connect(this.model.properties.disabled_message.change,(()=>{this.model.disabled&&null!=this._overlay_el&&this._update_overlay_message()}))}_update_layout(){super._update_layout()}render(){super.render(),console.log("Showable render() - disabled:",this.model.disabled,"shadow_el:",null!=this.shadow_el),0===this.child_views.length&&null==this.model.ui&&(this.el.innerHTML='<div style="color: gray; padding: 10px; border: 1px dashed gray;">\n Showable: No UI element set\n </div>'),this._update_disabled_state()}after_layout(){super.after_layout(),console.log("Showable after_layout() - disabled:",this.model.disabled,"shadow_el:",null!=this.shadow_el),this.model.disabled&&this._update_disabled_state()}_intrinsic_display(){return super._intrinsic_display()}_update_disabled_state(){console.log("_update_disabled_state called, disabled:",this.model.disabled),this.model.disabled?(this._show_disabled_overlay(),this.el.style.filter="grayscale(50%)"):(this._hide_disabled_overlay(),this.el.style.filter="")}_disable_interactive_elements(){this.el.querySelectorAll(".bk-toolbar, .bk-toolbar-button").forEach((e=>{e.style.pointerEvents="none",e.style.opacity="0.5"}));this.el.querySelectorAll("canvas").forEach((e=>{e.style.pointerEvents="none"}));this.el.querySelectorAll("button, .bk-btn").forEach((e=>{e.disabled=!0}))}_enable_interactive_elements(){const e=this.shadow_el;if(!e)return;e.querySelectorAll(".bk-toolbar, .bk-toolbar-button").forEach((e=>{e.style.pointerEvents="",e.style.opacity=""}));e.querySelectorAll("canvas").forEach((e=>{e.style.pointerEvents=""}));e.querySelectorAll("button, .bk-btn").forEach((e=>{e.disabled=!1})),console.log("Interactive elements re-enabled")}_show_disabled_overlay(){if(console.log("_show_disabled_overlay called, _overlay_el exists:",null!=this._overlay_el),console.log("disabled_message:",this.model.disabled_message),null==this._overlay_el){console.log("Creating new overlay element");const e=this.shadow_el;if(console.log("Shadow root:",e),!e)return void console.error("No shadow root found!");const t=document.createElement("div");t.className="showable-disabled-message",t.style.cssText="\n background: white;\n padding: 30px 40px;\n border-radius: 10px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n text-align: center;\n border: 2px solid #4CAF50;\n max-width: 90%;\n word-wrap: break-word;\n pointer-events: auto;\n cursor: default;\n ",t.innerHTML=`\n <div style="font-size: 24px; font-weight: bold; color: #4CAF50; margin-bottom: 10px;">\n ${this.model.disabled_message}\n </div>\n `,console.log("Message box created"),this._overlay_el=document.createElement("div"),this._overlay_el.appendChild(t),this._overlay_el.style.setProperty("position","absolute","important"),this._overlay_el.style.setProperty("top","0","important"),this._overlay_el.style.setProperty("left","0","important"),this._overlay_el.style.setProperty("right","0","important"),this._overlay_el.style.setProperty("bottom","0","important"),this._overlay_el.style.setProperty("width","100%","important"),this._overlay_el.style.setProperty("height","100%","important"),this._overlay_el.style.setProperty("background-color","rgba(220, 220, 220, 0.85)","important"),this._overlay_el.style.setProperty("display","flex","important"),this._overlay_el.style.setProperty("justify-content","center","important"),this._overlay_el.style.setProperty("align-items","center","important"),this._overlay_el.style.setProperty("z-index","2147483647","important"),this._overlay_el.style.setProperty("pointer-events","auto","important"),this._overlay_el.style.setProperty("cursor","not-allowed","important"),console.log("Overlay element styles set");const l=e.firstElementChild;l&&(l.style.position="relative",console.log("Set content container to relative positioning")),e.appendChild(this._overlay_el),console.log("Overlay appended to shadow root"),setTimeout((()=>{const e=this._overlay_el.getBoundingClientRect(),l=t.getBoundingClientRect();console.log("Overlay bounding rect:",{width:e.width,height:e.height,top:e.top,left:e.left}),console.log("Message box bounding rect:",{width:l.width,height:l.height})}),100),this._disable_interactive_elements();["mousedown","mouseup","click","dblclick","contextmenu","touchstart","touchmove","touchend","keydown","keyup","keypress","pointerdown","pointerup","pointermove","dragstart","drag","dragend"].forEach((e=>{this._overlay_el.addEventListener(e,(e=>{if(e.target!==t&&!t.contains(e.target))return e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation(),!1}),{capture:!0,passive:!1})})),this._overlay_el.addEventListener("wheel",(t=>{let l=e.host.parentElement;for(;l;){const e=window.getComputedStyle(l).overflow,t=window.getComputedStyle(l).overflowY;if("auto"===e||"scroll"===e||"auto"===t||"scroll"===t)break;l=l.parentElement}l&&(l.scrollTop+=t.deltaY,l.scrollLeft+=t.deltaX),t.stopPropagation(),t.preventDefault()}),{capture:!0,passive:!1})}else console.log("Overlay already exists, showing it"),this._overlay_el.style.display="flex";console.log("_show_disabled_overlay complete")}_update_overlay_message(){if(null!=this._overlay_el){const e=this._overlay_el.querySelector(".showable-disabled-message");e&&(e.innerHTML=`\n <div style="font-size: 24px; font-weight: bold; color: #4CAF50; margin-bottom: 10px;">\n ${this.model.disabled_message}\n </div>\n <div style="font-size: 14px; color: #666;">\n You can now close this GUI or continue working in your notebook\n </div>\n `)}}_hide_disabled_overlay(){null!=this._overlay_el&&(this._overlay_el.style.display="none",this._enable_interactive_elements())}remove(){null!=this._overlay_el&&(this._overlay_el.remove(),this._overlay_el=null),super.remove()}}l.ShowableView=n,n.__name__="ShowableView";class d extends a.LayoutDOM{constructor(e){super(e)}}l.Showable=d,i=d,d.__name__="Showable",d.__module__="cubevis.bokeh.models._showable",i.prototype.default_view=n,i.define((({Ref:e,String:t})=>({ui:[e(r.UIElement)],disabled_message:[t,"Interaction Complete \u2713"]})))},
62
+ "467d2716b0": function _(e,i,s,t,o){var n;t();const p=e("@bokehjs/models/layouts/layout_dom"),a=e("@bokehjs/models/ui/ui_element");class l extends p.LayoutDOMView{get child_models(){return null!=this.model.ui?[this.model.ui]:[]}initialize(){super.initialize(),this.el&&(this.el.style.padding="0",this.el.style.margin="0",this.el.style.border="none",this.el.style.background="transparent",this.el.style.display="contents"),this.connect(this.model.properties.app_state.change,(()=>{const e=window.cubevisAppSession;(null==e?void 0:e.applications[this.model.app_id])&&(e.applications[this.model.app_id].state=this.model.app_state)}))}}s.BokehAppContextView=l,l.__name__="BokehAppContextView";class d extends p.LayoutDOM{constructor(e){super(e)}initialize(){super.initialize(),window.cubevisAppSession||(window.cubevisAppSession={sessionId:this.session_id,applications:{}},console.log(`Initialized Bokeh session: ${this.session_id}`));const e=window.cubevisAppSession;e.applications[this.app_id]||(e.applications[this.app_id]={appId:this.app_id,state:this.app_state,createdAt:(new Date).toISOString()},console.log(`Registered application: ${this.app_id}`))}}s.BokehAppContext=d,n=d,d.__name__="BokehAppContext",d.__module__="cubevis.bokeh.models._bokeh_app_context",n.prototype.default_view=l,n.define((({Ref:e,Nullable:i,Dict:s,String:t,Unknown:o})=>({ui:[i(e(a.UIElement)),null],app_id:[t,""],session_id:[t,""],app_state:[s(o),{}]})))},
63
+ "50a1e32f01": function _(e,s,i,n,t){var a;n();const c=e("@bokehjs/core/view"),o=e("@bokehjs/model");class _ extends c.View{initialize(){super.initialize()}connect_signals(){super.connect_signals();const{values:e}=this.model.properties;this.on_change(e,(()=>this.values_changed()))}values_changed(){}}i.SharedDictView=_,_.__name__="SharedDictView";class d extends o.Model{constructor(e){super(e)}}i.SharedDict=d,a=d,d.__name__="SharedDict",d.__module__="cubevis.bokeh.models._shared_dict",a.prototype.default_view=_,a.define((({Dict:e,Unknown:s})=>({values:[e(s),{}]})))},
64
+ "b55081402e": function _(e,n,t,_,s){var a;_();const o=e("@bokehjs/models/annotations/span"),p=e("@bokehjs/core/bokeh_events");class r extends o.SpanView{on_pan_start(e){const n=super.on_pan_start(e);return this.model.trigger_event(new p.LODStart),n}on_pan(e){super.on_pan(e)}on_pan_end(e){super.on_pan_end(e),this.model.trigger_event(new p.LODEnd)}}t.EditSpanView=r,r.__name__="EditSpanView";class d extends o.Span{constructor(e){super(e)}}t.EditSpan=d,a=d,d.__name__="EditSpan",d.__module__="cubevis.bokeh.models._edit_span",a.prototype.default_view=r},
65
+ "9144bfc7a5": function _(e,t,s,n,r){var i;n();const l=e("@bokehjs/models/widgets/text_input"),o=e("@bokehjs/core/dom"),u=e("@bokehjs/core/bokeh_events");class _ extends l.TextInputView{stylesheets(){return[...super.stylesheets(),new o.InlineStyleSheet(".bk-input-prefix { padding: 0 var(--padding-vertical); }")]}connect_signals(){super.connect_signals(),this.el.addEventListener("mouseenter",(e=>{this.model.trigger_event(new u.MouseEnter(e.screenX,e.screenY,e.x,e.y,{shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey}))})),this.el.addEventListener("mouseleave",(e=>{this.model.trigger_event(new u.MouseLeave(e.screenX,e.screenY,e.x,e.y,{shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey}))}))}render(){super.render()}}s.EvTextInputView=_,_.__name__="EvTextInputView";class c extends l.TextInput{constructor(e){super(e)}}s.EvTextInput=c,i=c,c.__name__="EvTextInput",c.__module__="cubevis.bokeh.models._ev_text_input",i.prototype.default_view=_},
66
+ "74e0abef8a": function _(e,t,n,s,o){var i;s();const r=e("@bokehjs/models/annotations/poly_annotation"),a=e("@bokehjs/core/bokeh_events");class _ extends r.PolyAnnotationView{on_enter(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.MouseEnter(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt}),o=super.on_enter(e);return this.model.trigger_event(s),o}on_leave(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.MouseLeave(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt});super.on_leave(e),this.model.trigger_event(s)}on_pan_start(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.PanStart(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt}),o=super.on_pan_start(e);return this.model.trigger_event(s),o}on_pan_end(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.PanEnd(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt});super.on_pan_end(e),this.model.trigger_event(s)}on_pan(e){super.on_pan(e);const t=new a.RangesUpdate(e.sx,e.sx+e.dx,e.sy,e.sy+e.dy);this.model.trigger_event(t)}}n.EvPolyAnnotationView=_,_.__name__="EvPolyAnnotationView";class l extends r.PolyAnnotation{constructor(e){super(e)}}n.EvPolyAnnotation=l,i=l,l.__name__="EvPolyAnnotation",l.__module__="cubevis.bokeh.annotations._ev_poly_annotation",i.prototype.default_view=_},
67
+ }, "07c9fde72b", {"index":"07c9fde72b","src/bokeh/sources/data_pipe":"f8eca7a5dd","src/bokeh/util/conversions":"e3901fa9f2","src/bokeh/sources/active_data_pipes":"5179d11e71","src/bokeh/util/model_manager":"30b45c52a1","src/bokeh/sources/image_pipe":"2889e0dd45","src/bokeh/sources/image_data_source":"de65005924","src/bokeh/sources/spectra_data_source":"02e3c3e46c","src/bokeh/sources/updatable_data_source":"64b16deff9","src/bokeh/format/wcs_ticks":"b6ae454f0d","src/bokeh/tools/drag_tool":"cb7d28d6b3","src/bokeh/events":"8fc7a9e935","src/bokeh/util/find":"484bb85d20","src/bokeh/tools/cbreset_tool":"9d3c34ff8e","src/bokeh/models/tip_button":"9f961622ce","src/bokeh/models/tip":"ca4c845905","src/bokeh/models/showable":"a6e757a69a","src/bokeh/models/bokeh_app_context":"467d2716b0","src/bokeh/models/shared_dict":"50a1e32f01","src/bokeh/models/edit_span":"b55081402e","src/bokeh/models/ev_text_input":"9144bfc7a5","src/bokeh/annotations/ev_poly_annotation":"74e0abef8a"}, {});});
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+ /*!
3
+ * Copyright (c) Anaconda, Inc., and Bokeh Contributors
4
+ * All rights reserved.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without modification,
7
+ * are permitted provided that the following conditions are met:
8
+ *
9
+ * Redistributions of source code must retain the above copyright notice,
10
+ * this list of conditions and the following disclaimer.
11
+ *
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ * this list of conditions and the following disclaimer in the documentation
14
+ * and/or other materials provided with the distribution.
15
+ *
16
+ * Neither the name of Anaconda nor the names of any contributors
17
+ * may be used to endorse or promote products derived from this software
18
+ * without specific prior written permission.
19
+ *
20
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30
+ * THE POSSIBILITY OF SUCH DAMAGE.
31
+ */
32
+ (function(root, factory) {
33
+ factory(root["Bokeh"], undefined);
34
+ })(this, function(Bokeh, version) {
35
+ let define;
36
+ return (function(modules, entry, aliases, externals) {
37
+ const bokeh = typeof Bokeh !== "undefined" ? (version != null ? Bokeh[version] : Bokeh) : null;
38
+ if (bokeh != null) {
39
+ return bokeh.register_plugin(modules, entry, aliases);
40
+ } else {
41
+ throw new Error("Cannot find Bokeh" + (version != null ? " " + version : "") + ". You have to load it prior to loading plugins.");
42
+ }
43
+ })
44
+ ({
45
+ "07c9fde72b": function _(e,a,t,o,c){o();const i=e("tslib"),n=e("f8eca7a5dd");c("DataPipe",n.DataPipe);c("activeDataPipes",e("5179d11e71").activeDataPipes);const p=e("2889e0dd45");c("ImagePipe",p.ImagePipe);const s=e("de65005924");c("ImageDataSource",s.ImageDataSource);const r=e("02e3c3e46c");c("SpectraDataSource",r.SpectraDataSource);const d=e("64b16deff9");c("UpdatableDataSource",d.UpdatableDataSource);const S=e("b6ae454f0d");c("WcsTicks",S.WcsTicks);const l=e("cb7d28d6b3");c("DragTool",l.DragTool);const D=e("9d3c34ff8e");c("CBResetTool",D.CBResetTool);const T=e("e3901fa9f2");c("serialize",T.serialize),c("deserialize",T.deserialize);const b=e("9f961622ce");c("TipButton",b.TipButton);const u=e("ca4c845905");c("Tip",u.Tip);const f=e("a6e757a69a");c("Showable",f.Showable);const P=e("467d2716b0");c("BokehAppContext",P.BokehAppContext);const g=e("50a1e32f01");c("SharedDict",g.SharedDict);const h=e("b55081402e");c("EditSpan",h.EditSpan);const B=e("9144bfc7a5");c("EvTextInput",B.EvTextInput);const E=e("74e0abef8a");c("EvPolyAnnotation",E.EvPolyAnnotation);const I=i.__importStar(e("484bb85d20"));t.find=I;(0,e("@bokehjs/base").register_models)({DataPipe:n.DataPipe,ImagePipe:p.ImagePipe,ImageDataSource:s.ImageDataSource,SpectraDataSource:r.SpectraDataSource,UpdatableDataSource:d.UpdatableDataSource,WcsTicks:S.WcsTicks,DragTool:l.DragTool,CBResetTool:D.CBResetTool,Tip:u.Tip,TipButton:b.TipButton,SharedDict:g.SharedDict,Showable:f.Showable,BokehAppContext:P.BokehAppContext,EditSpan:h.EditSpan,EvTextInput:B.EvTextInput,EvPolyAnnotation:E.EvPolyAnnotation})},
46
+ "f8eca7a5dd": function _(e,s,t,i,n){var o;i();const a=e("@bokehjs/models/sources/data_source"),c=e("e3901fa9f2"),r=e("@bokehjs/core/util/callbacks"),l=e("5179d11e71");class d extends a.DataSource{constructor(e){super(e),this.send_queue={},this.connection_queue=[],this.pending={},this.incoming_callbacks={},this.session_id=casalib.object_id(this)}checkSessionConflict(){try{if("undefined"==typeof Storage)return console.warn("localStorage not available, skipping session conflict detection"),!0;const e=localStorage.getItem(this.session_storage_key);if(e){const s=JSON.parse(e);if(s.sessionId!==this.session_id&&Date.now()-s.timestamp<12e4){if(this.conflict_check){const e=`CubeVis DataPipe (${this.instance_key}) is already running in another browser window or tab.\n\nPlease close other instances and refresh this page, or\nclose this window to continue using the other instance.`;return alert(e),window.opener||1===window.history.length?window.close():window.location.href="about:blank",!1}console.group(`DataPipe ${this.instance_key} conflict detected in Jupyter context`),console.log("Current session ID:",this.session_id),console.log("Existing session ID:",s.sessionId),console.log("Existing timestamp:",new Date(s.timestamp).toISOString()),console.log("Age of existing session (ms):",Date.now()-s.timestamp),console.log("Address:",this.address),console.log("Instance key:",this.instance_key),console.log("Storage key:",this.session_storage_key),console.log("Existing data:",s),console.log("All localStorage keys:",Object.keys(localStorage).filter((e=>e.startsWith("cubevis_datapipe_")))),console.groupEnd()}}return this.updateSessionHeartbeat(),!0}catch(e){return console.warn("Session conflict detection failed:",e),!0}}updateSessionHeartbeat(){try{"undefined"!=typeof Storage&&localStorage.setItem(this.session_storage_key,JSON.stringify({sessionId:this.session_id,timestamp:Date.now(),instanceKey:this.instance_key}))}catch(e){console.warn("Session heartbeat update failed:",e)}}startHeartbeat(){this.heartbeat_interval=window.setInterval((()=>{this.updateSessionHeartbeat()}),3e4)}stopHeartbeat(){this.heartbeat_interval&&(clearInterval(this.heartbeat_interval),this.heartbeat_interval=void 0)}cleanupSession(){try{if("undefined"!=typeof Storage){const e=localStorage.getItem(this.session_storage_key);if(e){JSON.parse(e).sessionId===this.session_id&&localStorage.removeItem(this.session_storage_key)}}}catch(e){console.warn("Session cleanup failed:",e)}this.stopHeartbeat()}handleSessionConflictMessage(e){console.error("Session conflict detected by server:",e);let s="Session conflict detected by server.";"session_conflict"===e.type?s=e.error||s:"session_corruption"===e.type&&(s=`Session corruption detected.\nExpected: ${e.expected}\nReceived: ${e.received}`),alert(s+"\n\nThis window will be closed to prevent data corruption."),this.cleanupSession();const t=new CustomEvent("cubevis_session_conflict",{detail:{message:e,sessionId:this.session_id}});window.dispatchEvent(t),setTimeout((()=>{window.opener||1===window.history.length?window.close():window.location.href="about:blank"}),2e3)}generateInstanceKey(){const e=`${this.address[0]}_${this.address[1]}`;return`${this.instance_id}_${e}`}initialize(){if(super.initialize(),l.activeDataPipes.register(this),this.instance_key=this.generateInstanceKey(),this.session_storage_key=`cubevis_datapipe_${this.instance_key}`,!this.checkSessionConflict())return;let e=`ws://${this.address[0]}:${this.address[1]}`;console.log("datapipe url:",e);var s=void 0;document.shutdown_in_progress_=!1;var t=()=>{void 0!==this.websocket&&this.websocket.close(),this.websocket=new WebSocket(e),this.websocket.binaryType="arraybuffer",this.websocket.addEventListener("error",(e=>{console.log("error encountered:",e)})),this.websocket.onmessage=e=>{if("string"==typeof e.data||e.data instanceof String){let s=(0,c.deserialize)(e.data);if("id"in s&&"direction"in s&&"message"in s){let{id:e,message:t,direction:i}=s;if("error"===i&&("session_conflict"===e||e===this.session_id)&&t&&("session_conflict"===t.type||"session_corruption"===t.type||"close_duplicate"===t.action))return void this.handleSessionConflictMessage(t);if(void 0===t&&console.log("Error, event failure",s),"j2p"==i)if(e in this.pending){let{cb:i}=this.pending[e];if(delete this.pending[e],e in this.send_queue&&this.send_queue[e].length>0){let{cb:s,msg:t}=this.send_queue[e].shift();this.pending[e]={cb:s},this.websocket.send((0,c.serialize)(t))}void 0===t?console.log("DROPPING ERROR FOR NOW (maybe need error callbacks)",s):i(t)}else console.log("message received but could not find id");else if(e in this.incoming_callbacks){let s=this.incoming_callbacks[e](t);this.websocket.send((0,c.serialize)({id:e,direction:i,message:s,session:this.session_id}))}}else console.log(`datapipe received message without one of 'id', 'message' or 'direction': ${s}`)}else console.log("datapipe received binary data",e.data.byteLength,"bytes")},this.websocket.onopen=()=>{for(s?0==s.connected&&console.log(`connection reestablished at ${new Date}`):(this.websocket.send((0,c.serialize)({id:"initialize",direction:"j2p",session:this.session_id})),this.startHeartbeat()),s=new casalib.ReconnectState;this.connection_queue.length>0;){let e=this.connection_queue.shift();this.send.apply(e[0],e[1])}},this.websocket.onclose=()=>{if(s&&1==s.connected&&(console.log(`connection lost at ${new Date}`),s.connected=!1,!document.shutdown_in_progress_)){console.log(`connection lost at ${new Date}`);var e=s;function i(n){0==s.connected&&(console.log(`${n+1}\treconnection attempt ${new Date}`),t(),e.backoff(),e.retries>0?setTimeout(i,e.timeout,n+1):0==s.connected&&console.log(`aborting reconnection after ${n} attempts ${new Date}`))}i(0)}}};window.addEventListener("beforeunload",(()=>{this.cleanupSession()})),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState?this.stopHeartbeat():"visible"===document.visibilityState&&(this.updateSessionHeartbeat(),this.startHeartbeat())})),t();(()=>{null!=this.init_script&&(0,r.execute)(this.init_script,this)})()}destroy(){l.activeDataPipes.unregister(this),super.destroy()}register(e,s){this.incoming_callbacks[e]=s}send(e,s,t,i=!1){let n={id:e,message:s,direction:"j2p",session:this.session_id};if(!this.websocket||e in this.pending)if(e in this.send_queue)if("boolean"==typeof i&&i&&this.send_queue[e].length>0)this.send_queue[e][0].msg=n,this.send_queue[e][0].cb=t;else if("function"==typeof i&&this.send_queue[e].length>0){let o=!1;for(const a of this.send_queue[e])i(a.msg.message)&&(a.msg=n,a.cb=t,o=!0);o||this.send_queue[e].push({cb:t,msg:n})}else this.send_queue[e].push({cb:t,msg:n});else this.send_queue[e]=[{cb:t,msg:n}];else if(this.websocket.readyState===WebSocket.CONNECTING)this.connection_queue.push([this,[e,s,t]]);else if(e in this.send_queue&&this.send_queue[e].length>0){this.send_queue[e].push({cb:t,msg:n});{let{cb:r,msg:l}=this.send_queue[e].shift();if(this.pending[e]={cb:r},this.websocket.readyState===WebSocket.OPEN)this.websocket.send((0,c.serialize)(l));else{let d=20,h=this;function u(){h.websocket.readyState===WebSocket.OPEN?h.websocket.send((0,c.serialize)(l)):(d-=1,d>0&&setTimeout(u,3e3))}setTimeout(u,3e3)}}}else if(this.websocket.readyState===WebSocket.OPEN)this.pending[e]={cb:t},this.websocket.send((0,c.serialize)(n));else{let g=20,b=this;function _(){b.websocket.readyState===WebSocket.OPEN?(b.pending[e]={cb:t},b.websocket.send((0,c.serialize)(n))):(g-=1,g>0&&setTimeout(_,3e3))}setTimeout(_,3e3)}}}t.DataPipe=d,o=d,d.__name__="DataPipe",d.__module__="cubevis.bokeh.sources._data_pipe",o.define((({Any:e,Tuple:s,String:t,Number:i,Bool:n})=>({init_script:[e,null],address:[s(t,i)],instance_id:[t],conflict_check:[n,!0]})))},
47
+ "e3901fa9f2": function _(e,r,s,i,o){i();const l=e("@bokehjs/base"),a=e("@bokehjs/core/resolvers"),t=e("@bokehjs/core/serialization/deserializer"),n=e("@bokehjs/core/serialization/serializer"),{deserialize:c}=new class{constructor(){this.resolver=new a.ModelResolver(l.default_resolver),this.deserializer=new t.Deserializer(this.resolver),this.deserialize=e=>{try{return this.deserializer.decode(JSON.parse(e))}catch(r){return console.group("deserialize error"),console.log(e),console.log(r),console.groupEnd(),{}}}}};s.deserialize=c;const{serialize:z}=new class{constructor(){this.serializer=new n.Serializer,this.serialize=e=>JSON.stringify(this.serializer.encode(e))}};s.serialize=z},
48
+ "5179d11e71": function _(a,e,n,c,t){c();const i=a("30b45c52a1");n.activeDataPipes=new i.ModelManager},
49
+ "30b45c52a1": function _(e,n,s,t,i){t();class r{constructor(){this.instances=new Map}register(e){this.instances.set(e.id,e),console.log(`registered instance ${e.id}`)}unregister(e){this.instances.delete(e.id),console.log(`unregistered instance ${e.id}`)}getInstances(){return Array.from(this.instances.values())}getInstance(e){return this.instances.get(e)}}s.ModelManager=r,r.__name__="ModelManager"},
50
+ "2889e0dd45": function _(i,e,s,t,n){var a;t();const o=i("@bokehjs/models/sources/column_data_source"),d=i("f8eca7a5dd");class r extends d.DataPipe{constructor(i){super(i),this.position={},this._wcs=null}initialize(){super.initialize(),this.fits_header_json&&(this._wcs=new casalib.coordtxl.WCSTransform(new casalib.coordtxl.MapKeywordProvider(JSON.parse(this.fits_header_json))))}channel(i,e,s){this.position[s]={index:i};let t={action:"channel",index:i,id:s};super.send(this.dataid,t,(i=>{null!=this._histogram_source&&"hist"in i&&"top"in i.hist&&"bottom"in i.hist&&"left"in i.hist&&"right"in i.hist&&(this._histogram_source.data=i.hist),e(i)}))}spectrum(i,e,s,t=!1){let n={action:"spectrum",index:i,id:s};super.send(this.dataid,n,e,t)}adjust_colormap(i,e,s,t,n=!1){const a={action:"adjust-colormap",bounds:i,transfer:e,id:t};super.send(this.dataid,a,s,n)}refresh(i,e,s=[0,0]){let{index:t}=e in this.position?this.position[e]:{index:s};if(2===t.length){let s={action:"channel",index:t,id:e};super.send(this.dataid,s,i)}else if(3===t.length){let s={action:"spectrum",index:t,id:e};super.send(this.dataid,s,i)}}wcs(){return this._wcs}}s.ImagePipe=r,a=r,r.__name__="ImagePipe",r.__module__="cubevis.bokeh.sources._image_pipe",a.define((({Number:i,Nullable:e,String:s,Tuple:t,Ref:n})=>({dataid:[s],shape:[t(i,i,i,i)],fits_header_json:[e(s),null],_histogram_source:[e(n(o.ColumnDataSource)),null]})))},
51
+ "de65005924": function _(s,a,t,c,i){var o;c();const e=s("@bokehjs/models/sources/column_data_source"),n=s("@bokehjs/core/util/string"),u=s("2889e0dd45"),h=s("@bokehjs/core/util/callbacks");class r extends e.ColumnDataSource{constructor(s){super(s),this.imid=(0,n.uuid4)()}_mask_contour(s){const a=casalib.d3.contours().size(this.image_source.shape.slice(0,2)).thresholds([1])(s[0])[0].coordinates.map((s=>s.map((s=>s.reduce(((s,a)=>(s[0].push(a[0]),s[1].push(a[1]),s)),[[],[]])))));return{xs:[a.map((s=>s.map((s=>s[0]))))],ys:[a.map((s=>s.map((s=>s[1]))))]}}initialize(){if(super.initialize(),null!=this._mask_contour_source&&"msk"in this.data&&this.data.msk.length>0&&this.data.msk[0].length>0){const s=this.data.msk;this._mask_contour_source.data=this._mask_contour(s)}void 0===this.last_chan&&(this.last_chan=[this.cur_chan[0].valueOf(),this.cur_chan[1].valueOf()]);(()=>{null!=this.init_script&&(0,h.execute)(this.init_script,this)})()}channel(s,a=0,t){this.image_source.channel([a,s],(c=>{void 0!==c&&void 0!==c.chan||console.log("ImageDataSource ERROR ENCOUNTERED <1>",c),this.last_chan=[this.cur_chan[0].valueOf(),this.cur_chan[1].valueOf()],this.cur_chan=[a,s],null!=this._mask_contour_source&&"chan"in c&&"msk"in c.chan&&(c.msk_contour=this._mask_contour(c.chan.msk),this._mask_contour_source.data=c.msk_contour),t&&t(c),this.data=c.chan}),this.imid)}adjust_colormap(s,a,t){this.image_source.adjust_colormap(s,a,t,this.imid,!0)}signal_change(){this.change.emit()}refresh(s){this.image_source.refresh((a=>{void 0!==a&&void 0!==a.chan||console.log("ImageDataSource ERROR ENCOUNTERED <2>",a),null!=this._mask_contour_source&&"chan"in a&&"msk"in a.chan&&(a.msk_contour=this._mask_contour(a.chan.msk),this._mask_contour_source.data=a.msk_contour),s&&s(a),this.data=a.chan}),this.imid,[0,0])}wcs(){return this.image_source.wcs()}}t.ImageDataSource=r,o=r,r.__name__="ImageDataSource",r.__module__="cubevis.bokeh.sources._image_data_source",o.define((({Tuple:s,Number:a,Ref:t,Nullable:c,Any:i})=>({init_script:[i,null],image_source:[t(u.ImagePipe)],_mask_contour_source:[c(t(e.ColumnDataSource)),null],num_chans:[s(a,a)],cur_chan:[s(a,a)]})))},
52
+ "02e3c3e46c": function _(e,s,i,t,r){var a;t();const c=e("@bokehjs/models/sources/column_data_source"),u=e("@bokehjs/core/util/string"),o=e("2889e0dd45");class _ extends c.ColumnDataSource{constructor(e){super(e),this.imid=(0,u.uuid4)()}initialize(){super.initialize()}spectra(e,s,i=0,t=!1){this.image_source.spectrum([e,s,i],(e=>this.data=e.spectrum),this.imid,t)}refresh(){this.image_source.refresh((e=>this.data=e.spectrum),this.imid,[0,0,0])}}i.SpectraDataSource=_,a=_,_.__name__="SpectraDataSource",_.__module__="cubevis.bokeh.sources._spectra_data_source",a.define((({Ref:e})=>({image_source:[e(o.ImagePipe)]})))},
53
+ "64b16deff9": function _(e,s,i,a,t){var n;a();const u=e("@bokehjs/models/sources/column_data_source"),l=e("f8eca7a5dd"),o=e("@bokehjs/core/util/callbacks");class c extends u.ColumnDataSource{constructor(e){super(e)}send(e,s){this.pipe.send(this.session_id.valueOf(),{action:"callback",message:e},(e=>{s("result"in e?e.result:{error:`expected to find a "result" in "${e}"`,msg:e})}))}initialize(){super.initialize();(()=>{null!=this.js_init&&(0,o.execute)(this.js_init,this)})()}}i.UpdatableDataSource=c,n=c,c.__name__="UpdatableDataSource",c.__module__="cubevis.bokeh.sources._updatable_data_source",n.define((({Ref:e,Any:s,String:i})=>({js_init:[s,null],js_update:[s,null],pipe:[e(l.DataPipe)],session_id:[i]})))},
54
+ "b6ae454f0d": function _(s,i,o,t,e){var r;t();const a=s("@bokehjs/models/formatters/tick_formatter"),c=s("de65005924");class l extends a.TickFormatter{constructor(s){super(s),this._axis=null,this._coord="world"}initialize(){super.initialize(),"x"==this.axis||"X"==this.axis||"y"==this.axis||"Y"==this.axis?this._axis="x"==this.axis||"X"==this.axis?"x":"y":console.log("ERROR: WcsTicks formatter created with invalid axis:",this.axis)}doFormat(s){const i=[];if(this._axis&&this.image_source.wcs()&&"world"==this._coord)for(let o=0,t=s.length;o<t;o++)if("x"==this._axis){const t=new casalib.coordtxl.Point2D(Number(s[o]),0);this.image_source.wcs().imageToWorldCoords(t,!1),i.push(new casalib.coordtxl.WorldCoords(t.getX(),t.getY()).format(2e3)[0])}else{const t=new casalib.coordtxl.Point2D(0,Number(s[o]));this.image_source.wcs().imageToWorldCoords(t,!1),i.push(new casalib.coordtxl.WorldCoords(t.getX(),t.getY()).format(2e3)[1])}else for(let o=0,t=s.length;o<t;o++)i.push(""+s[o]);return i}coordinates(s){return s!=this._coord&&("world"!=s&&"pixel"!=s||(this._coord=s)),this._coord}}o.WcsTicks=l,r=l,l.__name__="WcsTicks",l.__module__="cubevis.bokeh.format._wcs_ticks",r.define((({Ref:s,String:i})=>({axis:[i],image_source:[s(c.ImageDataSource)]})))},
55
+ "cb7d28d6b3": function _(i,e,t,o,s){var d;o();const l=i("@bokehjs/models/tools/gestures/gesture_tool"),r=i("8fc7a9e935"),_=i("484bb85d20"),m=i("@bokehjs/core/util/callbacks");class a extends l.GestureToolView{_pan_start(i){var e;null===(e=this.model.document)||void 0===e||e.interactive_start(this.plot_view.model);const t=(0,_.px_from_sx)(this.plot_view,i.sx),o=(0,_.py_from_sy)(this.plot_view,i.sy),s=(0,_.dx_from_px)(this.plot_view,t),d=(0,_.dy_from_py)(this.plot_view,o),{start:l}=this.model;l?(0,m.execute)(l,this.model,{sx:t,sy:o,x:s,y:d,delta_x:i.dx,delta_y:-i.dy,shift:"modifiers"in i?i.modifiers.shift:void 0,ctrl:"modifiers"in i?i.modifiers.ctrl:void 0,alt:"modifiers"in i?i.modifiers.alt:void 0}):this.model.trigger_event(new r.DragStart(t,o,s,d,i.dx,-i.dy,i.modifiers))}_pan(i){var e;null===(e=this.model.document)||void 0===e||e.interactive_start(this.plot_view.model);const t=(0,_.px_from_sx)(this.plot_view,i.sx),o=(0,_.py_from_sy)(this.plot_view,i.sy),s=(0,_.dx_from_px)(this.plot_view,t),d=(0,_.dy_from_py)(this.plot_view,o),{move:l}=this.model;l?(0,m.execute)(l,this.model,{sx:t,sy:o,x:s,y:d,delta_x:i.dx,delta_y:-i.dy,shift:"modifiers"in i?i.modifiers.shift:void 0,ctrl:"modifiers"in i?i.modifiers.ctrl:void 0,alt:"modifiers"in i?i.modifiers.alt:void 0}):this.model.trigger_event(new r.Drag(t,o,s,d,i.dx,-i.dy,i.modifiers))}_pan_end(i){const e=(0,_.px_from_sx)(this.plot_view,i.sx),t=(0,_.py_from_sy)(this.plot_view,i.sy),o=(0,_.dx_from_px)(this.plot_view,e),s=(0,_.dy_from_py)(this.plot_view,t),{end:d}=this.model;d?(0,m.execute)(d,this.model,{sx:e,sy:t,x:o,y:s,delta_x:i.dx,delta_y:-i.dy,shift:"modifiers"in i?i.modifiers.shift:void 0,ctrl:"modifiers"in i?i.modifiers.ctrl:void 0,alt:"modifiers"in i?i.modifiers.alt:void 0}):this.model.trigger_event(new r.DragEnd(e,t,o,s,i.dx,-i.dy,i.modifiers))}}t.DragToolView=a,a.__name__="DragToolView";class n extends l.GestureTool{constructor(i){super(i),this.tool_name="Drag",this.event_type="pan",this.default_order=10}}t.DragTool=n,d=n,n.__name__="DragTool",n.__module__="cubevis.bokeh.tools._drag_tool",d.prototype.default_view=a,d.define((({Any:i,Nullable:e})=>({start:[e(i),null],move:[e(i),null],end:[e(i),null]})))},
56
+ "8fc7a9e935": function _(e,t,a,s,_){s();const n=e("@bokehjs/core/bokeh_events");class r extends n.Pan{}a.Drag=r,r.__name__="Drag";class l extends n.PanStart{constructor(e,t,a,s,_,n,r){super(e,t,a,s,r),this.delta_x=_,this.delta_y=n}get event_values(){const{delta_x:e,delta_y:t}=this;return{...super.event_values,delta_x:e,delta_y:t}}}a.DragStart=l,l.__name__="DragStart";class d extends n.PanEnd{constructor(e,t,a,s,_,n,r){super(e,t,a,s,r),this.delta_x=_,this.delta_y=n}get event_values(){const{delta_x:e,delta_y:t}=this;return{...super.event_values,delta_x:e,delta_y:t}}}a.DragEnd=d,d.__name__="DragEnd"},
57
+ "484bb85d20": function _(n,e,o,t,r){t(),o.view=function(n){function e(o){if(o.model===n)return o;for(const n of o.children()){const o=e(n);if(o)return o}return null}const o=n.document;if(!o)return null;const t=o.views_manager;if(!t)return null;const r=t.roots;for(const n of r){const o=e(n);if(o)return o}return null},o.span_coords=function(n){function e(n,e,o,t,r){if(null!=n)switch(e){case"canvas":return r.compute(n);case"screen":return t.compute(n);case"data":return o.compute(n)}return NaN}const{frame:o,canvas:t}=n.plot_view,{x_scale:r,y_scale:i}=n.coordinates;let c,s,u,a,f=n.model.dimension;"width"==n.model.dimension?(u=e(n.model.location,n.model.location_units,i,o.bbox.yview,t.bbox.y_screen),s=o.bbox.left,a=o.bbox.width,c=n.model.line_width):(u=o.bbox.top,s=e(n.model.location,n.model.location_units,r,o.bbox.xview,t.bbox.y_screen),a=n.model.line_width,c=o.bbox.height);return{stop:u,sleft:s,width:a,height:c,orientation:f}},o.px_from_sx=function(n,e){return n.frame.bbox.x_view.invert(e)},o.py_from_sy=function(n,e){return n.frame.bbox.y_view.invert(e)},o.dx_from_px=function(n,e){const o=n.frame.bbox.x_view.compute(e);return n.frame.x_scale.invert(o)},o.dy_from_py=function(n,e){const o=n.frame.bbox.y_view.compute(e);return n.frame.y_scale.invert(o)},o.sx_from_dx=function(n,e){return n.frame.x_scale.compute(e)},o.sy_from_dy=function(n,e){return n.frame.y_scale.compute(e)},o.v_px_from_sx=function(n,e){return n.frame.bbox.x_view.v_invert(e)},o.v_py_from_sy=function(n,e){return n.frame.bbox.y_view.v_invert(e)},o.v_dx_from_px=function(n,e){const o=n.frame.bbox.x_view.v_compute(e);return n.frame.x_scale.v_invert(o)},o.v_dy_from_py=function(n,e){const o=n.frame.bbox.y_view.v_compute(e);return n.frame.y_scale.v_invert(o)},o.v_sx_from_dx=function(n,e){return n.frame.x_scale.v_compute(e)},o.v_sy_from_dy=function(n,e){return n.frame.y_scale.v_compute(e)},o.children=function(n,e=["children","items","panes","tabs","child","ui"]){return o=>{if(!o)return[];const t=o=>{const r=o,i=(e=>"string"==typeof n?(console.log(`<S:${e.type}>`,e),e.type===n):(console.log(`<C:${e.type}>`,e),e instanceof n))(r)?[r]:[];return[...i,...e.flatMap((n=>{const e=o[n];if(!e)return[];return(Array.isArray(e)?e:[e]).flatMap(t)}))]};return t(o)}},o.appState=function(n){var e,t;const r=(0,o.context)(n);if(r){return null===(t=(null===(e=null===window||void 0===window?void 0:window.cubevisAppSession)||void 0===e?void 0:e.applications)[r.app_id])||void 0===t?void 0:t.state}return};const i=n("@bokehjs/model");function c(n,e,o=new Set){if(o.has(n))return;if(o.add(n),e(n))return n;const t=["children","items","panes","tabs","child","ui"];for(const r of t){const t=n[r];if(t){const n=Array.isArray(t)?t:[t];for(const t of n)if(t instanceof i.Model&&!o.has(t)){const n=c(t,e,o);if(n)return n}}}}function s(n){return e=>{var o,t,r;const i=null!==(t=null===(o=null==e?void 0:e.document)||void 0===o?void 0:o.all_roots)&&void 0!==t?t:null===(r=null==e?void 0:e.document)||void 0===r?void 0:r.roots();if(!i)return;const s=["children","items","panes","tabs","child","ui"],u=e=>{const o=e;return(null==o?void 0:o.type)===n?[o]:s.flatMap((n=>{const o=e[n];if(!o)return[];return(Array.isArray(o)?o:[o]).flatMap(u)}))};return i.flatMap(u).find((n=>Boolean(c(n,(n=>n.id===e.id)))))}}o.context=s("cubevis.bokeh.models._bokeh_app_context.BokehAppContext"),o.showable=s("cubevis.bokeh.models._showable.Showable")},
58
+ "9d3c34ff8e": function _(e,o,l,s,t){var c;s();const _=e("@bokehjs/models/tools/actions/reset_tool"),i=e("@bokehjs/styles/icons.css"),a=e("@bokehjs/core/util/callbacks");class n extends _.ResetToolView{doit(){const{precallback:e,postcallback:o}=this.model;null!=e&&(0,a.execute)(e,this.model),this.plot_view.reset(),null!=o&&(0,a.execute)(o,this.model)}}l.CBResetToolView=n,n.__name__="CBResetToolView";class r extends _.ResetTool{constructor(e){super(e),this.tool_name="CBReset",this.tool_icon=i.tool_icon_reset}}l.CBResetTool=r,c=r,r.__name__="CBResetTool",r.__module__="cubevis.bokeh.tools._cbreset_tool",c.prototype.default_view=n,c.define((({Any:e,Nullable:o})=>({precallback:[o(e),null],postcallback:[o(e),null]}))),c.register_alias("cbreset",(()=>new c))},
59
+ "9f961622ce": function _(e,t,i,o,s){var n;o();const l=e("@bokehjs/models/widgets/abstract_button"),c=e("@bokehjs/models/ui/tooltip"),d=e("@bokehjs/models/ui/icons/builtin_icon"),u=e("@bokehjs/core/build_views"),h=e("@bokehjs/core/bokeh_events"),r=e("@bokehjs/core/util/object");class a extends l.AbstractButtonView{constructor(){super(...arguments),this.isMouseInside=!1}click(){this.model.trigger_event(new h.ButtonClick),super.click()}*children(){yield*super.children(),yield this.tooltip}Show(){this.tooltip.model.setv({visible:!0,closable:!1})}unShow(){this.tooltip.model.setv({visible:!1,closable:!1})}async lazy_initialize(){const{hover_wait:e}=this.model;this.debouncedShow=casalib.debounce((()=>{this.isMouseInside&&this.Show()}),1e3*e),await super.lazy_initialize();const{tooltip:t}=this.model;this.tooltip=await(0,u.build_view)(t,{parent:this})}remove(){this.tooltip.remove(),super.remove()}render(){super.render(),this.el.addEventListener("mouseenter",(()=>{this.isMouseInside=!0,this.debouncedShow()})),this.el.addEventListener("mouseleave",(()=>{this.isMouseInside=!1,this.debouncedShow.cancel(),this.unShow()})),document.addEventListener("mousedown",(e=>{if(void 0===(0,r.dict)(this.model.js_event_callbacks).get(h.ButtonClick.prototype.event_name)){if(e.composedPath().includes(this.tooltip.el))return;this.debouncedShow.cancel(),this.unShow()}else this.isMouseInside=!1,this.debouncedShow.cancel(),this.unShow()})),window.addEventListener("blur",(()=>{this.debouncedShow.cancel(),this.unShow()}))}}i.TipButtonView=a,a.__name__="TipButtonView";class b extends l.AbstractButton{constructor(e){super(e)}on_click(e){this.on_event(h.ButtonClick,e)}}i.TipButton=b,n=b,b.__name__="TipButton",b.__module__="cubevis.bokeh.models._tip_button",n.prototype.default_view=a,n.define((({Ref:e,Number:t})=>({tooltip:[e(c.Tooltip)],hover_wait:[t,1.5]}))),n.override({label:"",icon:new d.BuiltinIcon({icon_name:"help",size:18}),button_type:"default"})},
60
+ "ca4c845905": function _(e,i,s,t,o){var l;t();const d=e("@bokehjs/models/layouts/layout_dom"),n=e("@bokehjs/models/ui/ui_element"),h=e("@bokehjs/models/ui/tooltip"),r=e("@bokehjs/core/dom"),a=e("@bokehjs/core/build_views");class c extends d.LayoutDOMView{constructor(){super(...arguments),this.isMouseInside=!1}stylesheets(){return[...super.stylesheets(),"*, *:before, *:after { box-sizing: border-box; } fieldset { border: 0px; margin: 0px; padding: 0px; }"]}Show(){this.tooltip.model.setv({visible:!0,closable:!1})}unShow(){this.tooltip.model.setv({visible:!1,closable:!1})}async lazy_initialize(){const{hover_wait:e}=this.model;this.debouncedShow=casalib.debounce((()=>{this.isMouseInside&&this.Show()}),1e3*e),await super.lazy_initialize(),await this.build_child_views();const{tooltip:i}=this.model;this.tooltip=await(0,a.build_view)(i,{parent:this})}remove(){this.tooltip.remove(),super.remove()}connect_signals(){super.connect_signals();const{child:e}=this.model.properties;this.on_change(e,(()=>this.update_children())),this.el.addEventListener("mouseenter",(e=>{this.mouseenter.emit(e)})),this.el.addEventListener("mouseleave",(e=>{this.mouseleave.emit(e)}))}*children(){yield*super.children(),yield this.tooltip}get child_models(){return[this.model.child]}render(){super.render(),this.el.addEventListener("mouseenter",(()=>{this.isMouseInside=!0,this.debouncedShow()})),this.el.addEventListener("mouseleave",(()=>{this.isMouseInside=!1,this.debouncedShow.cancel(),this.unShow()})),window.addEventListener("blur",(()=>{this.debouncedShow.cancel(),this.unShow()})),this.el.addEventListener("click",(()=>{this.debouncedShow.cancel(),this.unShow()}));const e=this.child_views.map((e=>e.el));this.fieldset_el=(0,r.fieldset)({},...e),this.shadow_el.appendChild(this.fieldset_el)}_update_children(){const e=this.child_views.map((e=>e.el));this.fieldset_el.append(...e)}}s.TipView=c,c.__name__="TipView";class u extends d.LayoutDOM{constructor(e){super(e)}}s.Tip=u,l=u,u.__name__="Tip",u.__module__="cubevis.bokeh.models._tip",l.prototype.default_view=c,l.define((({Ref:e,Number:i})=>({child:[e(n.UIElement)],tooltip:[e(h.Tooltip)],hover_wait:[i,1.5]})))},
61
+ "a6e757a69a": function _(e,t,l,o,s){var i;o();const a=e("@bokehjs/models/layouts/layout_dom"),r=e("@bokehjs/models/ui/ui_element");class n extends a.LayoutDOMView{constructor(){super(...arguments),this._overlay_el=null}get child_models(){return null!=this.model.ui?[this.model.ui]:[]}initialize(){super.initialize(),this.el.setAttribute("data-lm-suppress-shortcuts","true")}async lazy_initialize(){await super.lazy_initialize()}connect_signals(){super.connect_signals(),this.connect(this.model.properties.disabled.change,(()=>{this._update_disabled_state()})),this.connect(this.model.properties.disabled_message.change,(()=>{this.model.disabled&&null!=this._overlay_el&&this._update_overlay_message()}))}_update_layout(){super._update_layout()}render(){super.render(),console.log("Showable render() - disabled:",this.model.disabled,"shadow_el:",null!=this.shadow_el),0===this.child_views.length&&null==this.model.ui&&(this.el.innerHTML='<div style="color: gray; padding: 10px; border: 1px dashed gray;">\n Showable: No UI element set\n </div>'),this._update_disabled_state()}after_layout(){super.after_layout(),console.log("Showable after_layout() - disabled:",this.model.disabled,"shadow_el:",null!=this.shadow_el),this.model.disabled&&this._update_disabled_state()}_intrinsic_display(){return super._intrinsic_display()}_update_disabled_state(){console.log("_update_disabled_state called, disabled:",this.model.disabled),this.model.disabled?(this._show_disabled_overlay(),this.el.style.filter="grayscale(50%)"):(this._hide_disabled_overlay(),this.el.style.filter="")}_disable_interactive_elements(){this.el.querySelectorAll(".bk-toolbar, .bk-toolbar-button").forEach((e=>{e.style.pointerEvents="none",e.style.opacity="0.5"}));this.el.querySelectorAll("canvas").forEach((e=>{e.style.pointerEvents="none"}));this.el.querySelectorAll("button, .bk-btn").forEach((e=>{e.disabled=!0}))}_enable_interactive_elements(){const e=this.shadow_el;if(!e)return;e.querySelectorAll(".bk-toolbar, .bk-toolbar-button").forEach((e=>{e.style.pointerEvents="",e.style.opacity=""}));e.querySelectorAll("canvas").forEach((e=>{e.style.pointerEvents=""}));e.querySelectorAll("button, .bk-btn").forEach((e=>{e.disabled=!1})),console.log("Interactive elements re-enabled")}_show_disabled_overlay(){if(console.log("_show_disabled_overlay called, _overlay_el exists:",null!=this._overlay_el),console.log("disabled_message:",this.model.disabled_message),null==this._overlay_el){console.log("Creating new overlay element");const e=this.shadow_el;if(console.log("Shadow root:",e),!e)return void console.error("No shadow root found!");const t=document.createElement("div");t.className="showable-disabled-message",t.style.cssText="\n background: white;\n padding: 30px 40px;\n border-radius: 10px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n text-align: center;\n border: 2px solid #4CAF50;\n max-width: 90%;\n word-wrap: break-word;\n pointer-events: auto;\n cursor: default;\n ",t.innerHTML=`\n <div style="font-size: 24px; font-weight: bold; color: #4CAF50; margin-bottom: 10px;">\n ${this.model.disabled_message}\n </div>\n `,console.log("Message box created"),this._overlay_el=document.createElement("div"),this._overlay_el.appendChild(t),this._overlay_el.style.setProperty("position","absolute","important"),this._overlay_el.style.setProperty("top","0","important"),this._overlay_el.style.setProperty("left","0","important"),this._overlay_el.style.setProperty("right","0","important"),this._overlay_el.style.setProperty("bottom","0","important"),this._overlay_el.style.setProperty("width","100%","important"),this._overlay_el.style.setProperty("height","100%","important"),this._overlay_el.style.setProperty("background-color","rgba(220, 220, 220, 0.85)","important"),this._overlay_el.style.setProperty("display","flex","important"),this._overlay_el.style.setProperty("justify-content","center","important"),this._overlay_el.style.setProperty("align-items","center","important"),this._overlay_el.style.setProperty("z-index","2147483647","important"),this._overlay_el.style.setProperty("pointer-events","auto","important"),this._overlay_el.style.setProperty("cursor","not-allowed","important"),console.log("Overlay element styles set");const l=e.firstElementChild;l&&(l.style.position="relative",console.log("Set content container to relative positioning")),e.appendChild(this._overlay_el),console.log("Overlay appended to shadow root"),setTimeout((()=>{const e=this._overlay_el.getBoundingClientRect(),l=t.getBoundingClientRect();console.log("Overlay bounding rect:",{width:e.width,height:e.height,top:e.top,left:e.left}),console.log("Message box bounding rect:",{width:l.width,height:l.height})}),100),this._disable_interactive_elements();["mousedown","mouseup","click","dblclick","contextmenu","touchstart","touchmove","touchend","keydown","keyup","keypress","pointerdown","pointerup","pointermove","dragstart","drag","dragend"].forEach((e=>{this._overlay_el.addEventListener(e,(e=>{if(e.target!==t&&!t.contains(e.target))return e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation(),!1}),{capture:!0,passive:!1})})),this._overlay_el.addEventListener("wheel",(t=>{let l=e.host.parentElement;for(;l;){const e=window.getComputedStyle(l).overflow,t=window.getComputedStyle(l).overflowY;if("auto"===e||"scroll"===e||"auto"===t||"scroll"===t)break;l=l.parentElement}l&&(l.scrollTop+=t.deltaY,l.scrollLeft+=t.deltaX),t.stopPropagation(),t.preventDefault()}),{capture:!0,passive:!1})}else console.log("Overlay already exists, showing it"),this._overlay_el.style.display="flex";console.log("_show_disabled_overlay complete")}_update_overlay_message(){if(null!=this._overlay_el){const e=this._overlay_el.querySelector(".showable-disabled-message");e&&(e.innerHTML=`\n <div style="font-size: 24px; font-weight: bold; color: #4CAF50; margin-bottom: 10px;">\n ${this.model.disabled_message}\n </div>\n <div style="font-size: 14px; color: #666;">\n You can now close this GUI or continue working in your notebook\n </div>\n `)}}_hide_disabled_overlay(){null!=this._overlay_el&&(this._overlay_el.style.display="none",this._enable_interactive_elements())}remove(){null!=this._overlay_el&&(this._overlay_el.remove(),this._overlay_el=null),super.remove()}}l.ShowableView=n,n.__name__="ShowableView";class d extends a.LayoutDOM{constructor(e){super(e)}}l.Showable=d,i=d,d.__name__="Showable",d.__module__="cubevis.bokeh.models._showable",i.prototype.default_view=n,i.define((({Ref:e,String:t})=>({ui:[e(r.UIElement)],disabled_message:[t,"Interaction Complete \u2713"]})))},
62
+ "467d2716b0": function _(e,i,s,t,o){var n;t();const p=e("@bokehjs/models/layouts/layout_dom"),a=e("@bokehjs/models/ui/ui_element");class l extends p.LayoutDOMView{get child_models(){return null!=this.model.ui?[this.model.ui]:[]}initialize(){super.initialize(),this.el&&(this.el.style.padding="0",this.el.style.margin="0",this.el.style.border="none",this.el.style.background="transparent",this.el.style.display="contents"),this.connect(this.model.properties.app_state.change,(()=>{const e=window.cubevisAppSession;(null==e?void 0:e.applications[this.model.app_id])&&(e.applications[this.model.app_id].state=this.model.app_state)}))}}s.BokehAppContextView=l,l.__name__="BokehAppContextView";class d extends p.LayoutDOM{constructor(e){super(e)}initialize(){super.initialize(),window.cubevisAppSession||(window.cubevisAppSession={sessionId:this.session_id,applications:{}},console.log(`Initialized Bokeh session: ${this.session_id}`));const e=window.cubevisAppSession;e.applications[this.app_id]||(e.applications[this.app_id]={appId:this.app_id,state:this.app_state,createdAt:(new Date).toISOString()},console.log(`Registered application: ${this.app_id}`))}}s.BokehAppContext=d,n=d,d.__name__="BokehAppContext",d.__module__="cubevis.bokeh.models._bokeh_app_context",n.prototype.default_view=l,n.define((({Ref:e,Nullable:i,Dict:s,String:t,Unknown:o})=>({ui:[i(e(a.UIElement)),null],app_id:[t,""],session_id:[t,""],app_state:[s(o),{}]})))},
63
+ "50a1e32f01": function _(e,s,i,n,t){var a;n();const c=e("@bokehjs/core/view"),o=e("@bokehjs/model");class _ extends c.View{initialize(){super.initialize()}connect_signals(){super.connect_signals();const{values:e}=this.model.properties;this.on_change(e,(()=>this.values_changed()))}values_changed(){}}i.SharedDictView=_,_.__name__="SharedDictView";class d extends o.Model{constructor(e){super(e)}}i.SharedDict=d,a=d,d.__name__="SharedDict",d.__module__="cubevis.bokeh.models._shared_dict",a.prototype.default_view=_,a.define((({Dict:e,Unknown:s})=>({values:[e(s),{}]})))},
64
+ "b55081402e": function _(e,n,t,_,s){var a;_();const o=e("@bokehjs/models/annotations/span"),p=e("@bokehjs/core/bokeh_events");class r extends o.SpanView{on_pan_start(e){const n=super.on_pan_start(e);return this.model.trigger_event(new p.LODStart),n}on_pan(e){super.on_pan(e)}on_pan_end(e){super.on_pan_end(e),this.model.trigger_event(new p.LODEnd)}}t.EditSpanView=r,r.__name__="EditSpanView";class d extends o.Span{constructor(e){super(e)}}t.EditSpan=d,a=d,d.__name__="EditSpan",d.__module__="cubevis.bokeh.models._edit_span",a.prototype.default_view=r},
65
+ "9144bfc7a5": function _(e,t,s,n,r){var i;n();const l=e("@bokehjs/models/widgets/text_input"),o=e("@bokehjs/core/dom"),u=e("@bokehjs/core/bokeh_events");class _ extends l.TextInputView{stylesheets(){return[...super.stylesheets(),new o.InlineStyleSheet(".bk-input-prefix { padding: 0 var(--padding-vertical); }")]}connect_signals(){super.connect_signals(),this.el.addEventListener("mouseenter",(e=>{this.model.trigger_event(new u.MouseEnter(e.screenX,e.screenY,e.x,e.y,{shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey}))})),this.el.addEventListener("mouseleave",(e=>{this.model.trigger_event(new u.MouseLeave(e.screenX,e.screenY,e.x,e.y,{shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey}))}))}render(){super.render()}}s.EvTextInputView=_,_.__name__="EvTextInputView";class c extends l.TextInput{constructor(e){super(e)}}s.EvTextInput=c,i=c,c.__name__="EvTextInput",c.__module__="cubevis.bokeh.models._ev_text_input",i.prototype.default_view=_},
66
+ "74e0abef8a": function _(e,t,n,s,o){var i;s();const r=e("@bokehjs/models/annotations/poly_annotation"),a=e("@bokehjs/core/bokeh_events");class _ extends r.PolyAnnotationView{on_enter(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.MouseEnter(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt}),o=super.on_enter(e);return this.model.trigger_event(s),o}on_leave(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.MouseLeave(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt});super.on_leave(e),this.model.trigger_event(s)}on_pan_start(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.PanStart(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt}),o=super.on_pan_start(e);return this.model.trigger_event(s),o}on_pan_end(e){const{x_scale:t,y_scale:n}=this.plot_view.frame,s=new a.PanEnd(e.sx,e.sy,t.invert(e.sx),n.invert(e.sy),{shift:e.modifiers.shift,ctrl:e.modifiers.ctrl,alt:e.modifiers.alt});super.on_pan_end(e),this.model.trigger_event(s)}on_pan(e){super.on_pan(e);const t=new a.RangesUpdate(e.sx,e.sx+e.dx,e.sy,e.sy+e.dy);this.model.trigger_event(t)}}n.EvPolyAnnotationView=_,_.__name__="EvPolyAnnotationView";class l extends r.PolyAnnotation{constructor(e){super(e)}}n.EvPolyAnnotation=l,i=l,l.__name__="EvPolyAnnotation",l.__module__="cubevis.bokeh.annotations._ev_poly_annotation",i.prototype.default_view=_},
67
+ }, "07c9fde72b", {"index":"07c9fde72b","src/bokeh/sources/data_pipe":"f8eca7a5dd","src/bokeh/util/conversions":"e3901fa9f2","src/bokeh/sources/active_data_pipes":"5179d11e71","src/bokeh/util/model_manager":"30b45c52a1","src/bokeh/sources/image_pipe":"2889e0dd45","src/bokeh/sources/image_data_source":"de65005924","src/bokeh/sources/spectra_data_source":"02e3c3e46c","src/bokeh/sources/updatable_data_source":"64b16deff9","src/bokeh/format/wcs_ticks":"b6ae454f0d","src/bokeh/tools/drag_tool":"cb7d28d6b3","src/bokeh/events":"8fc7a9e935","src/bokeh/util/find":"484bb85d20","src/bokeh/tools/cbreset_tool":"9d3c34ff8e","src/bokeh/models/tip_button":"9f961622ce","src/bokeh/models/tip":"ca4c845905","src/bokeh/models/showable":"a6e757a69a","src/bokeh/models/bokeh_app_context":"467d2716b0","src/bokeh/models/shared_dict":"50a1e32f01","src/bokeh/models/edit_span":"b55081402e","src/bokeh/models/ev_text_input":"9144bfc7a5","src/bokeh/annotations/ev_poly_annotation":"74e0abef8a"}, {});});