@mountaya/studio-react 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (992) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/LICENCE.fr.txt +280 -0
  3. package/LICENSE.txt +262 -0
  4. package/README.md +1087 -2
  5. package/THIRD-PARTY-NOTICES.txt +149 -0
  6. package/dist/AgentMarkdown-RNLATZYN.cjs +213 -0
  7. package/dist/AgentMarkdown-RNLATZYN.cjs.map +1 -0
  8. package/dist/AgentMarkdown-TMN6E2XC.js +206 -0
  9. package/dist/AgentMarkdown-TMN6E2XC.js.map +1 -0
  10. package/dist/ContextMenuPopup-EOYN42YZ.js +468 -0
  11. package/dist/ContextMenuPopup-EOYN42YZ.js.map +1 -0
  12. package/dist/ContextMenuPopup-VQLAYYYZ.cjs +470 -0
  13. package/dist/ContextMenuPopup-VQLAYYYZ.cjs.map +1 -0
  14. package/dist/CopilotPanel-CCLEYZUN.js +29 -0
  15. package/dist/CopilotPanel-CCLEYZUN.js.map +1 -0
  16. package/dist/CopilotPanel-LYPMTDKX.cjs +38 -0
  17. package/dist/CopilotPanel-LYPMTDKX.cjs.map +1 -0
  18. package/dist/DateTimePickerField-FZRKJ2SU.js +53 -0
  19. package/dist/DateTimePickerField-FZRKJ2SU.js.map +1 -0
  20. package/dist/DateTimePickerField-NB456C6F.cjs +55 -0
  21. package/dist/DateTimePickerField-NB456C6F.cjs.map +1 -0
  22. package/dist/DirectionsModal-4Y346QFU.cjs +291 -0
  23. package/dist/DirectionsModal-4Y346QFU.cjs.map +1 -0
  24. package/dist/DirectionsModal-DRPO2654.js +289 -0
  25. package/dist/DirectionsModal-DRPO2654.js.map +1 -0
  26. package/dist/DuplicateItineraryModal-2QGWI7E7.js +321 -0
  27. package/dist/DuplicateItineraryModal-2QGWI7E7.js.map +1 -0
  28. package/dist/DuplicateItineraryModal-WFGMU6JL.cjs +323 -0
  29. package/dist/DuplicateItineraryModal-WFGMU6JL.cjs.map +1 -0
  30. package/dist/EditCollectionModal-4QYP53SX.js +90 -0
  31. package/dist/EditCollectionModal-4QYP53SX.js.map +1 -0
  32. package/dist/EditCollectionModal-T2TMAO53.cjs +92 -0
  33. package/dist/EditCollectionModal-T2TMAO53.cjs.map +1 -0
  34. package/dist/EmbedSnippetCode-NMFCQ7TF.cjs +62 -0
  35. package/dist/EmbedSnippetCode-NMFCQ7TF.cjs.map +1 -0
  36. package/dist/EmbedSnippetCode-TGBSWDMD.js +60 -0
  37. package/dist/EmbedSnippetCode-TGBSWDMD.js.map +1 -0
  38. package/dist/EmbedTablePreview-3RRHM63Q.js +72 -0
  39. package/dist/EmbedTablePreview-3RRHM63Q.js.map +1 -0
  40. package/dist/EmbedTablePreview-Z3W62MRV.cjs +74 -0
  41. package/dist/EmbedTablePreview-Z3W62MRV.cjs.map +1 -0
  42. package/dist/ExportModal-5NUZZPXN.cjs +267 -0
  43. package/dist/ExportModal-5NUZZPXN.cjs.map +1 -0
  44. package/dist/ExportModal-H7OYP6CK.js +265 -0
  45. package/dist/ExportModal-H7OYP6CK.js.map +1 -0
  46. package/dist/FileDropzone-GKPMAZF5.cjs +41 -0
  47. package/dist/FileDropzone-GKPMAZF5.cjs.map +1 -0
  48. package/dist/FileDropzone-GRXY4FXR.js +39 -0
  49. package/dist/FileDropzone-GRXY4FXR.js.map +1 -0
  50. package/dist/LocationPermissionModal-AFHI5J4S.cjs +92 -0
  51. package/dist/LocationPermissionModal-AFHI5J4S.cjs.map +1 -0
  52. package/dist/LocationPermissionModal-MURJ5DDB.js +90 -0
  53. package/dist/LocationPermissionModal-MURJ5DDB.js.map +1 -0
  54. package/dist/ManageCollectionsModal-E3IUHUTO.cjs +402 -0
  55. package/dist/ManageCollectionsModal-E3IUHUTO.cjs.map +1 -0
  56. package/dist/ManageCollectionsModal-FIHSZXSR.js +400 -0
  57. package/dist/ManageCollectionsModal-FIHSZXSR.js.map +1 -0
  58. package/dist/NewCollectionModal-7TBWVA3G.js +75 -0
  59. package/dist/NewCollectionModal-7TBWVA3G.js.map +1 -0
  60. package/dist/NewCollectionModal-QFQYCKCG.cjs +77 -0
  61. package/dist/NewCollectionModal-QFQYCKCG.cjs.map +1 -0
  62. package/dist/RoadAccessModal-DNUJV5PC.js +57 -0
  63. package/dist/RoadAccessModal-DNUJV5PC.js.map +1 -0
  64. package/dist/RoadAccessModal-WLLL2ASZ.cjs +59 -0
  65. package/dist/RoadAccessModal-WLLL2ASZ.cjs.map +1 -0
  66. package/dist/SegmentColorPicker-7Y4JEPFC.cjs +81 -0
  67. package/dist/SegmentColorPicker-7Y4JEPFC.cjs.map +1 -0
  68. package/dist/SegmentColorPicker-UNLPITUA.js +79 -0
  69. package/dist/SegmentColorPicker-UNLPITUA.js.map +1 -0
  70. package/dist/SegmentGroupModal-F54FZUR2.cjs +32 -0
  71. package/dist/SegmentGroupModal-F54FZUR2.cjs.map +1 -0
  72. package/dist/SegmentGroupModal-KBU7OPNJ.js +23 -0
  73. package/dist/SegmentGroupModal-KBU7OPNJ.js.map +1 -0
  74. package/dist/ShareCollectionModal-TWYE6JJ4.cjs +82 -0
  75. package/dist/ShareCollectionModal-TWYE6JJ4.cjs.map +1 -0
  76. package/dist/ShareCollectionModal-VXSRHX4S.js +80 -0
  77. package/dist/ShareCollectionModal-VXSRHX4S.js.map +1 -0
  78. package/dist/ShareModal-HLYNE7OL.js +115 -0
  79. package/dist/ShareModal-HLYNE7OL.js.map +1 -0
  80. package/dist/ShareModal-WISND27S.cjs +117 -0
  81. package/dist/ShareModal-WISND27S.cjs.map +1 -0
  82. package/dist/VideoExportWizard-BSDWA3B5.js +44 -0
  83. package/dist/VideoExportWizard-BSDWA3B5.js.map +1 -0
  84. package/dist/VideoExportWizard-UOHR4MNS.cjs +53 -0
  85. package/dist/VideoExportWizard-UOHR4MNS.cjs.map +1 -0
  86. package/dist/WaypointDetailsModal-LK5LBK6S.js +270 -0
  87. package/dist/WaypointDetailsModal-LK5LBK6S.js.map +1 -0
  88. package/dist/WaypointDetailsModal-MEMOLLUY.cjs +272 -0
  89. package/dist/WaypointDetailsModal-MEMOLLUY.cjs.map +1 -0
  90. package/dist/WaypointWorkbench-DCCLBURG.cjs +1204 -0
  91. package/dist/WaypointWorkbench-DCCLBURG.cjs.map +1 -0
  92. package/dist/WaypointWorkbench-NRCLGU23.js +1202 -0
  93. package/dist/WaypointWorkbench-NRCLGU23.js.map +1 -0
  94. package/dist/chunk-22BNE3YV.js +13 -0
  95. package/dist/chunk-22BNE3YV.js.map +1 -0
  96. package/dist/chunk-24RNBTO2.cjs +154 -0
  97. package/dist/chunk-24RNBTO2.cjs.map +1 -0
  98. package/dist/chunk-2DDL2LIJ.cjs +65 -0
  99. package/dist/chunk-2DDL2LIJ.cjs.map +1 -0
  100. package/dist/chunk-2GAMKPS2.cjs +16 -0
  101. package/dist/chunk-2GAMKPS2.cjs.map +1 -0
  102. package/dist/chunk-2K4HCCZJ.cjs +51 -0
  103. package/dist/chunk-2K4HCCZJ.cjs.map +1 -0
  104. package/dist/chunk-2MHWH3TS.cjs +119 -0
  105. package/dist/chunk-2MHWH3TS.cjs.map +1 -0
  106. package/dist/chunk-2MQBPZNR.cjs +12 -0
  107. package/dist/chunk-2MQBPZNR.cjs.map +1 -0
  108. package/dist/chunk-2QSPCXLM.js +84 -0
  109. package/dist/chunk-2QSPCXLM.js.map +1 -0
  110. package/dist/chunk-32WRG44G.js +66 -0
  111. package/dist/chunk-32WRG44G.js.map +1 -0
  112. package/dist/chunk-32XMYLEB.js +9 -0
  113. package/dist/chunk-32XMYLEB.js.map +1 -0
  114. package/dist/chunk-3BEHHSVE.cjs +790 -0
  115. package/dist/chunk-3BEHHSVE.cjs.map +1 -0
  116. package/dist/chunk-3HF2XZKQ.js +8 -0
  117. package/dist/chunk-3HF2XZKQ.js.map +1 -0
  118. package/dist/chunk-3K2NX5FH.js +51 -0
  119. package/dist/chunk-3K2NX5FH.js.map +1 -0
  120. package/dist/chunk-3Q23QKNI.cjs +26 -0
  121. package/dist/chunk-3Q23QKNI.cjs.map +1 -0
  122. package/dist/chunk-3TQV2M4C.cjs +16 -0
  123. package/dist/chunk-3TQV2M4C.cjs.map +1 -0
  124. package/dist/chunk-3XDKDTE6.js +16 -0
  125. package/dist/chunk-3XDKDTE6.js.map +1 -0
  126. package/dist/chunk-46EARJWC.js +288 -0
  127. package/dist/chunk-46EARJWC.js.map +1 -0
  128. package/dist/chunk-4DQOJIUV.js +96 -0
  129. package/dist/chunk-4DQOJIUV.js.map +1 -0
  130. package/dist/chunk-4T52NAVT.js +10 -0
  131. package/dist/chunk-4T52NAVT.js.map +1 -0
  132. package/dist/chunk-4TPRVQGY.js +12 -0
  133. package/dist/chunk-4TPRVQGY.js.map +1 -0
  134. package/dist/chunk-4TX5E63A.cjs +12 -0
  135. package/dist/chunk-4TX5E63A.cjs.map +1 -0
  136. package/dist/chunk-4VKJF24B.js +22 -0
  137. package/dist/chunk-4VKJF24B.js.map +1 -0
  138. package/dist/chunk-4Z734K3L.js +15 -0
  139. package/dist/chunk-4Z734K3L.js.map +1 -0
  140. package/dist/chunk-4ZRSEOZM.js +629 -0
  141. package/dist/chunk-4ZRSEOZM.js.map +1 -0
  142. package/dist/chunk-52T3VZR5.js +55 -0
  143. package/dist/chunk-52T3VZR5.js.map +1 -0
  144. package/dist/chunk-56DP2X7U.js +15 -0
  145. package/dist/chunk-56DP2X7U.js.map +1 -0
  146. package/dist/chunk-5AHT62LO.js +24 -0
  147. package/dist/chunk-5AHT62LO.js.map +1 -0
  148. package/dist/chunk-5BR4CTVV.cjs +17 -0
  149. package/dist/chunk-5BR4CTVV.cjs.map +1 -0
  150. package/dist/chunk-5CTZOFDV.cjs +17 -0
  151. package/dist/chunk-5CTZOFDV.cjs.map +1 -0
  152. package/dist/chunk-5F55MFIX.cjs +45 -0
  153. package/dist/chunk-5F55MFIX.cjs.map +1 -0
  154. package/dist/chunk-5FMQJ4A4.cjs +362 -0
  155. package/dist/chunk-5FMQJ4A4.cjs.map +1 -0
  156. package/dist/chunk-5PMEAMHS.js +82 -0
  157. package/dist/chunk-5PMEAMHS.js.map +1 -0
  158. package/dist/chunk-676DNRSN.js +85 -0
  159. package/dist/chunk-676DNRSN.js.map +1 -0
  160. package/dist/chunk-6H2F7JKL.js +179 -0
  161. package/dist/chunk-6H2F7JKL.js.map +1 -0
  162. package/dist/chunk-6HMRMON7.js +10 -0
  163. package/dist/chunk-6HMRMON7.js.map +1 -0
  164. package/dist/chunk-6NKPZ3LT.cjs +14 -0
  165. package/dist/chunk-6NKPZ3LT.cjs.map +1 -0
  166. package/dist/chunk-6TG2HZDG.js +75 -0
  167. package/dist/chunk-6TG2HZDG.js.map +1 -0
  168. package/dist/chunk-6WU7XEQA.cjs +103 -0
  169. package/dist/chunk-6WU7XEQA.cjs.map +1 -0
  170. package/dist/chunk-6YD325QI.cjs +90 -0
  171. package/dist/chunk-6YD325QI.cjs.map +1 -0
  172. package/dist/chunk-7B6TUEL5.js +20 -0
  173. package/dist/chunk-7B6TUEL5.js.map +1 -0
  174. package/dist/chunk-7KS5F27H.js +33 -0
  175. package/dist/chunk-7KS5F27H.js.map +1 -0
  176. package/dist/chunk-A2N6553V.cjs +295 -0
  177. package/dist/chunk-A2N6553V.cjs.map +1 -0
  178. package/dist/chunk-A66FJAVG.js +44 -0
  179. package/dist/chunk-A66FJAVG.js.map +1 -0
  180. package/dist/chunk-AF43JU4W.js +27 -0
  181. package/dist/chunk-AF43JU4W.js.map +1 -0
  182. package/dist/chunk-AHGHAWYR.js +99 -0
  183. package/dist/chunk-AHGHAWYR.js.map +1 -0
  184. package/dist/chunk-AKN5KIZT.js +1969 -0
  185. package/dist/chunk-AKN5KIZT.js.map +1 -0
  186. package/dist/chunk-ANTDR5MJ.cjs +12 -0
  187. package/dist/chunk-ANTDR5MJ.cjs.map +1 -0
  188. package/dist/chunk-AQ5JIIAE.js +26 -0
  189. package/dist/chunk-AQ5JIIAE.js.map +1 -0
  190. package/dist/chunk-ARHO5MLJ.js +10 -0
  191. package/dist/chunk-ARHO5MLJ.js.map +1 -0
  192. package/dist/chunk-BAYGKSWY.cjs +26 -0
  193. package/dist/chunk-BAYGKSWY.cjs.map +1 -0
  194. package/dist/chunk-BEJ5I724.js +8 -0
  195. package/dist/chunk-BEJ5I724.js.map +1 -0
  196. package/dist/chunk-BFNXXLVV.cjs +34 -0
  197. package/dist/chunk-BFNXXLVV.cjs.map +1 -0
  198. package/dist/chunk-BFQJDFGB.js +57 -0
  199. package/dist/chunk-BFQJDFGB.js.map +1 -0
  200. package/dist/chunk-CHEQJ6N7.cjs +2214 -0
  201. package/dist/chunk-CHEQJ6N7.cjs.map +1 -0
  202. package/dist/chunk-CJOJWZM7.js +92 -0
  203. package/dist/chunk-CJOJWZM7.js.map +1 -0
  204. package/dist/chunk-CJRSFC45.cjs +578 -0
  205. package/dist/chunk-CJRSFC45.cjs.map +1 -0
  206. package/dist/chunk-CWQ4WHPI.cjs +46 -0
  207. package/dist/chunk-CWQ4WHPI.cjs.map +1 -0
  208. package/dist/chunk-D3INXUFT.js +360 -0
  209. package/dist/chunk-D3INXUFT.js.map +1 -0
  210. package/dist/chunk-D6CDAYZ6.cjs +18 -0
  211. package/dist/chunk-D6CDAYZ6.cjs.map +1 -0
  212. package/dist/chunk-DDPXRXRD.cjs +23 -0
  213. package/dist/chunk-DDPXRXRD.cjs.map +1 -0
  214. package/dist/chunk-DUUPWSOZ.cjs +14 -0
  215. package/dist/chunk-DUUPWSOZ.cjs.map +1 -0
  216. package/dist/chunk-DVWYOHOB.cjs +43 -0
  217. package/dist/chunk-DVWYOHOB.cjs.map +1 -0
  218. package/dist/chunk-DZPHWBMC.cjs +11 -0
  219. package/dist/chunk-DZPHWBMC.cjs.map +1 -0
  220. package/dist/chunk-E26FROI3.js +68 -0
  221. package/dist/chunk-E26FROI3.js.map +1 -0
  222. package/dist/chunk-E7ZTDAQW.cjs +37 -0
  223. package/dist/chunk-E7ZTDAQW.cjs.map +1 -0
  224. package/dist/chunk-ECI4EKIV.cjs +94 -0
  225. package/dist/chunk-ECI4EKIV.cjs.map +1 -0
  226. package/dist/chunk-EN5RWYHP.cjs +28 -0
  227. package/dist/chunk-EN5RWYHP.cjs.map +1 -0
  228. package/dist/chunk-ET3UASEF.cjs +91 -0
  229. package/dist/chunk-ET3UASEF.cjs.map +1 -0
  230. package/dist/chunk-EW5SY246.cjs +97 -0
  231. package/dist/chunk-EW5SY246.cjs.map +1 -0
  232. package/dist/chunk-EWWHVV7R.cjs +18 -0
  233. package/dist/chunk-EWWHVV7R.cjs.map +1 -0
  234. package/dist/chunk-F2LZZC6X.js +90 -0
  235. package/dist/chunk-F2LZZC6X.js.map +1 -0
  236. package/dist/chunk-F6VFOI4U.cjs +12 -0
  237. package/dist/chunk-F6VFOI4U.cjs.map +1 -0
  238. package/dist/chunk-FGX3TEU4.cjs +12 -0
  239. package/dist/chunk-FGX3TEU4.cjs.map +1 -0
  240. package/dist/chunk-FK4F24KE.js +10 -0
  241. package/dist/chunk-FK4F24KE.js.map +1 -0
  242. package/dist/chunk-FLIGKB6K.js +313 -0
  243. package/dist/chunk-FLIGKB6K.js.map +1 -0
  244. package/dist/chunk-G2NDWNFB.cjs +185 -0
  245. package/dist/chunk-G2NDWNFB.cjs.map +1 -0
  246. package/dist/chunk-G2XORRLH.js +15 -0
  247. package/dist/chunk-G2XORRLH.js.map +1 -0
  248. package/dist/chunk-GIZN7NX5.cjs +25 -0
  249. package/dist/chunk-GIZN7NX5.cjs.map +1 -0
  250. package/dist/chunk-GM2BQ24D.js +47 -0
  251. package/dist/chunk-GM2BQ24D.js.map +1 -0
  252. package/dist/chunk-GMQJZ5N7.cjs +50 -0
  253. package/dist/chunk-GMQJZ5N7.cjs.map +1 -0
  254. package/dist/chunk-GT7RJOAA.cjs +315 -0
  255. package/dist/chunk-GT7RJOAA.cjs.map +1 -0
  256. package/dist/chunk-GWGUMPOL.js +9 -0
  257. package/dist/chunk-GWGUMPOL.js.map +1 -0
  258. package/dist/chunk-GWVKSSE3.cjs +154 -0
  259. package/dist/chunk-GWVKSSE3.cjs.map +1 -0
  260. package/dist/chunk-GY7UMPHT.cjs +99 -0
  261. package/dist/chunk-GY7UMPHT.cjs.map +1 -0
  262. package/dist/chunk-HMVBS5DU.js +150 -0
  263. package/dist/chunk-HMVBS5DU.js.map +1 -0
  264. package/dist/chunk-HXHA2C7C.js +169 -0
  265. package/dist/chunk-HXHA2C7C.js.map +1 -0
  266. package/dist/chunk-IHMOFX2A.js +208 -0
  267. package/dist/chunk-IHMOFX2A.js.map +1 -0
  268. package/dist/chunk-II6C3LU2.cjs +49 -0
  269. package/dist/chunk-II6C3LU2.cjs.map +1 -0
  270. package/dist/chunk-IOOAFCSR.cjs +58 -0
  271. package/dist/chunk-IOOAFCSR.cjs.map +1 -0
  272. package/dist/chunk-IQZSIOMM.js +10 -0
  273. package/dist/chunk-IQZSIOMM.js.map +1 -0
  274. package/dist/chunk-J2H3WIUM.cjs +12 -0
  275. package/dist/chunk-J2H3WIUM.cjs.map +1 -0
  276. package/dist/chunk-J62OBSUE.cjs +54 -0
  277. package/dist/chunk-J62OBSUE.cjs.map +1 -0
  278. package/dist/chunk-JFJVSJUX.cjs +16 -0
  279. package/dist/chunk-JFJVSJUX.cjs.map +1 -0
  280. package/dist/chunk-JI2M77Y7.cjs +68 -0
  281. package/dist/chunk-JI2M77Y7.cjs.map +1 -0
  282. package/dist/chunk-JLSOLL3C.js +31 -0
  283. package/dist/chunk-JLSOLL3C.js.map +1 -0
  284. package/dist/chunk-JRME3LCP.cjs +41 -0
  285. package/dist/chunk-JRME3LCP.cjs.map +1 -0
  286. package/dist/chunk-JUD3CWTI.cjs +2005 -0
  287. package/dist/chunk-JUD3CWTI.cjs.map +1 -0
  288. package/dist/chunk-JVFHF3LE.cjs +11 -0
  289. package/dist/chunk-JVFHF3LE.cjs.map +1 -0
  290. package/dist/chunk-JVS2WNKQ.js +26 -0
  291. package/dist/chunk-JVS2WNKQ.js.map +1 -0
  292. package/dist/chunk-JXAFIYLV.js +94 -0
  293. package/dist/chunk-JXAFIYLV.js.map +1 -0
  294. package/dist/chunk-K2E744ST.cjs +18 -0
  295. package/dist/chunk-K2E744ST.cjs.map +1 -0
  296. package/dist/chunk-K2ZEMBJ7.js +56 -0
  297. package/dist/chunk-K2ZEMBJ7.js.map +1 -0
  298. package/dist/chunk-KCXNMLKB.js +22 -0
  299. package/dist/chunk-KCXNMLKB.js.map +1 -0
  300. package/dist/chunk-KMMDPXY4.js +35 -0
  301. package/dist/chunk-KMMDPXY4.js.map +1 -0
  302. package/dist/chunk-KMSGFBAJ.cjs +78 -0
  303. package/dist/chunk-KMSGFBAJ.cjs.map +1 -0
  304. package/dist/chunk-KPD7K4XQ.cjs +11 -0
  305. package/dist/chunk-KPD7K4XQ.cjs.map +1 -0
  306. package/dist/chunk-KUD3B3BA.js +12 -0
  307. package/dist/chunk-KUD3B3BA.js.map +1 -0
  308. package/dist/chunk-L62LSMJ5.js +9 -0
  309. package/dist/chunk-L62LSMJ5.js.map +1 -0
  310. package/dist/chunk-LB57H6LF.cjs +261 -0
  311. package/dist/chunk-LB57H6LF.cjs.map +1 -0
  312. package/dist/chunk-LCPKNSC4.cjs +48 -0
  313. package/dist/chunk-LCPKNSC4.cjs.map +1 -0
  314. package/dist/chunk-LE3W2CSF.cjs +84 -0
  315. package/dist/chunk-LE3W2CSF.cjs.map +1 -0
  316. package/dist/chunk-LG736CNC.js +13 -0
  317. package/dist/chunk-LG736CNC.js.map +1 -0
  318. package/dist/chunk-LGNTAZ3L.cjs +33 -0
  319. package/dist/chunk-LGNTAZ3L.cjs.map +1 -0
  320. package/dist/chunk-LHXINV6N.cjs +47 -0
  321. package/dist/chunk-LHXINV6N.cjs.map +1 -0
  322. package/dist/chunk-LLZUTIQB.cjs +24 -0
  323. package/dist/chunk-LLZUTIQB.cjs.map +1 -0
  324. package/dist/chunk-LPGXRU7R.cjs +12 -0
  325. package/dist/chunk-LPGXRU7R.cjs.map +1 -0
  326. package/dist/chunk-MA2BBWF5.cjs +96 -0
  327. package/dist/chunk-MA2BBWF5.cjs.map +1 -0
  328. package/dist/chunk-MLGORMWF.js +23 -0
  329. package/dist/chunk-MLGORMWF.js.map +1 -0
  330. package/dist/chunk-MO7XCKLA.js +62 -0
  331. package/dist/chunk-MO7XCKLA.js.map +1 -0
  332. package/dist/chunk-N37UE6RQ.cjs +1797 -0
  333. package/dist/chunk-N37UE6RQ.cjs.map +1 -0
  334. package/dist/chunk-N6NWKUOR.cjs +60 -0
  335. package/dist/chunk-N6NWKUOR.cjs.map +1 -0
  336. package/dist/chunk-NI5CAMFC.js +568 -0
  337. package/dist/chunk-NI5CAMFC.js.map +1 -0
  338. package/dist/chunk-NNLCZGZK.js +21 -0
  339. package/dist/chunk-NNLCZGZK.js.map +1 -0
  340. package/dist/chunk-NWHFUVYX.js +97 -0
  341. package/dist/chunk-NWHFUVYX.js.map +1 -0
  342. package/dist/chunk-OMDB6ZB2.cjs +176 -0
  343. package/dist/chunk-OMDB6ZB2.cjs.map +1 -0
  344. package/dist/chunk-P5W4TRJO.cjs +33 -0
  345. package/dist/chunk-P5W4TRJO.cjs.map +1 -0
  346. package/dist/chunk-PADS6TDO.js +89 -0
  347. package/dist/chunk-PADS6TDO.js.map +1 -0
  348. package/dist/chunk-PFLNOHBT.js +92 -0
  349. package/dist/chunk-PFLNOHBT.js.map +1 -0
  350. package/dist/chunk-PTLYNDZS.cjs +13 -0
  351. package/dist/chunk-PTLYNDZS.cjs.map +1 -0
  352. package/dist/chunk-QC3X4DAW.cjs +71 -0
  353. package/dist/chunk-QC3X4DAW.cjs.map +1 -0
  354. package/dist/chunk-QPTICYGD.cjs +272 -0
  355. package/dist/chunk-QPTICYGD.cjs.map +1 -0
  356. package/dist/chunk-QZ7W2E4U.cjs +319 -0
  357. package/dist/chunk-QZ7W2E4U.cjs.map +1 -0
  358. package/dist/chunk-RJJPUPOY.cjs +97 -0
  359. package/dist/chunk-RJJPUPOY.cjs.map +1 -0
  360. package/dist/chunk-RRSMCCFS.js +43 -0
  361. package/dist/chunk-RRSMCCFS.js.map +1 -0
  362. package/dist/chunk-S6VCR6F5.js +91 -0
  363. package/dist/chunk-S6VCR6F5.js.map +1 -0
  364. package/dist/chunk-S7Y2GMYJ.cjs +89 -0
  365. package/dist/chunk-S7Y2GMYJ.cjs.map +1 -0
  366. package/dist/chunk-SIMEDLX3.cjs +645 -0
  367. package/dist/chunk-SIMEDLX3.cjs.map +1 -0
  368. package/dist/chunk-SQYF7HKF.cjs +59 -0
  369. package/dist/chunk-SQYF7HKF.cjs.map +1 -0
  370. package/dist/chunk-ST7BNVC2.cjs +13 -0
  371. package/dist/chunk-ST7BNVC2.cjs.map +1 -0
  372. package/dist/chunk-SZVRMMLS.js +16 -0
  373. package/dist/chunk-SZVRMMLS.js.map +1 -0
  374. package/dist/chunk-T27LICRD.js +2212 -0
  375. package/dist/chunk-T27LICRD.js.map +1 -0
  376. package/dist/chunk-TAU5HGJ3.cjs +11 -0
  377. package/dist/chunk-TAU5HGJ3.cjs.map +1 -0
  378. package/dist/chunk-TOM7TV5E.js +25 -0
  379. package/dist/chunk-TOM7TV5E.js.map +1 -0
  380. package/dist/chunk-TSRUDRT3.js +59 -0
  381. package/dist/chunk-TSRUDRT3.js.map +1 -0
  382. package/dist/chunk-U4FX33MW.js +257 -0
  383. package/dist/chunk-U4FX33MW.js.map +1 -0
  384. package/dist/chunk-UBOPWQWC.cjs +28 -0
  385. package/dist/chunk-UBOPWQWC.cjs.map +1 -0
  386. package/dist/chunk-UFE26GNF.js +42 -0
  387. package/dist/chunk-UFE26GNF.js.map +1 -0
  388. package/dist/chunk-UMQQVTEO.js +257 -0
  389. package/dist/chunk-UMQQVTEO.js.map +1 -0
  390. package/dist/chunk-UWY3SFAS.js +10 -0
  391. package/dist/chunk-UWY3SFAS.js.map +1 -0
  392. package/dist/chunk-V6EIIZPJ.js +57 -0
  393. package/dist/chunk-V6EIIZPJ.js.map +1 -0
  394. package/dist/chunk-V6G6W5CF.cjs +61 -0
  395. package/dist/chunk-V6G6W5CF.cjs.map +1 -0
  396. package/dist/chunk-VC4ZBWOK.js +152 -0
  397. package/dist/chunk-VC4ZBWOK.js.map +1 -0
  398. package/dist/chunk-VJRF6ILX.js +35 -0
  399. package/dist/chunk-VJRF6ILX.js.map +1 -0
  400. package/dist/chunk-VNSLCFO4.js +787 -0
  401. package/dist/chunk-VNSLCFO4.js.map +1 -0
  402. package/dist/chunk-W7GAP7ST.js +21 -0
  403. package/dist/chunk-W7GAP7ST.js.map +1 -0
  404. package/dist/chunk-WFUASJHS.js +64 -0
  405. package/dist/chunk-WFUASJHS.js.map +1 -0
  406. package/dist/chunk-WIKSIT3M.js +46 -0
  407. package/dist/chunk-WIKSIT3M.js.map +1 -0
  408. package/dist/chunk-WKLZLFLY.cjs +32 -0
  409. package/dist/chunk-WKLZLFLY.cjs.map +1 -0
  410. package/dist/chunk-WNB5HYON.cjs +10 -0
  411. package/dist/chunk-WNB5HYON.cjs.map +1 -0
  412. package/dist/chunk-WO5P2XBP.js +86 -0
  413. package/dist/chunk-WO5P2XBP.js.map +1 -0
  414. package/dist/chunk-WPYC4NGZ.cjs +46 -0
  415. package/dist/chunk-WPYC4NGZ.cjs.map +1 -0
  416. package/dist/chunk-WQRYZY67.cjs +89 -0
  417. package/dist/chunk-WQRYZY67.cjs.map +1 -0
  418. package/dist/chunk-WVCYVMJU.js +11 -0
  419. package/dist/chunk-WVCYVMJU.js.map +1 -0
  420. package/dist/chunk-WX25G2S3.js +116 -0
  421. package/dist/chunk-WX25G2S3.js.map +1 -0
  422. package/dist/chunk-X4FE7RRQ.js +23 -0
  423. package/dist/chunk-X4FE7RRQ.js.map +1 -0
  424. package/dist/chunk-X6EIJNOQ.cjs +67 -0
  425. package/dist/chunk-X6EIJNOQ.cjs.map +1 -0
  426. package/dist/chunk-XUBATJH6.js +1769 -0
  427. package/dist/chunk-XUBATJH6.js.map +1 -0
  428. package/dist/chunk-XUMREYMG.js +293 -0
  429. package/dist/chunk-XUMREYMG.js.map +1 -0
  430. package/dist/chunk-XYAJ2FS2.js +31 -0
  431. package/dist/chunk-XYAJ2FS2.js.map +1 -0
  432. package/dist/chunk-YKES5P4H.cjs +58 -0
  433. package/dist/chunk-YKES5P4H.cjs.map +1 -0
  434. package/dist/chunk-YYAQ75AV.cjs +216 -0
  435. package/dist/chunk-YYAQ75AV.cjs.map +1 -0
  436. package/dist/chunk-YZ3NJKVV.js +42 -0
  437. package/dist/chunk-YZ3NJKVV.js.map +1 -0
  438. package/dist/chunk-Z5ECTUMN.cjs +104 -0
  439. package/dist/chunk-Z5ECTUMN.cjs.map +1 -0
  440. package/dist/chunk-ZAKVHYDL.cjs +28 -0
  441. package/dist/chunk-ZAKVHYDL.cjs.map +1 -0
  442. package/dist/chunk-ZF34JXGU.js +39 -0
  443. package/dist/chunk-ZF34JXGU.js.map +1 -0
  444. package/dist/chunk-ZHGWDP2M.cjs +101 -0
  445. package/dist/chunk-ZHGWDP2M.cjs.map +1 -0
  446. package/dist/chunk-ZLHTQQLT.js +13 -0
  447. package/dist/chunk-ZLHTQQLT.js.map +1 -0
  448. package/dist/chunk-ZPAMY3IZ.cjs +25 -0
  449. package/dist/chunk-ZPAMY3IZ.cjs.map +1 -0
  450. package/dist/chunk-ZR63UB4V.js +42 -0
  451. package/dist/chunk-ZR63UB4V.js.map +1 -0
  452. package/dist/chunk-ZRCEB3KL.js +11 -0
  453. package/dist/chunk-ZRCEB3KL.js.map +1 -0
  454. package/dist/chunk-ZRGQNRQI.cjs +36 -0
  455. package/dist/chunk-ZRGQNRQI.cjs.map +1 -0
  456. package/dist/chunk-ZVY4IL7O.cjs +22 -0
  457. package/dist/chunk-ZVY4IL7O.cjs.map +1 -0
  458. package/dist/chunk-ZWIVKODQ.js +49 -0
  459. package/dist/chunk-ZWIVKODQ.js.map +1 -0
  460. package/dist/chunk-ZYF2HNMZ.js +10 -0
  461. package/dist/chunk-ZYF2HNMZ.js.map +1 -0
  462. package/dist/copilot/index.cjs +43 -0
  463. package/dist/copilot/index.cjs.map +1 -0
  464. package/dist/copilot/index.d.cts +66 -0
  465. package/dist/copilot/index.d.ts +66 -0
  466. package/dist/copilot/index.js +30 -0
  467. package/dist/copilot/index.js.map +1 -0
  468. package/dist/directionsPdf-GITP3SCP.cjs +274 -0
  469. package/dist/directionsPdf-GITP3SCP.cjs.map +1 -0
  470. package/dist/directionsPdf-TDKVUBCU.js +272 -0
  471. package/dist/directionsPdf-TDKVUBCU.js.map +1 -0
  472. package/dist/embed/index.cjs +1816 -0
  473. package/dist/embed/index.cjs.map +1 -0
  474. package/dist/embed/index.d.cts +300 -0
  475. package/dist/embed/index.d.ts +300 -0
  476. package/dist/embed/index.js +1809 -0
  477. package/dist/embed/index.js.map +1 -0
  478. package/dist/headless/index.cjs +408 -0
  479. package/dist/headless/index.cjs.map +1 -0
  480. package/dist/headless/index.d.cts +23 -0
  481. package/dist/headless/index.d.ts +23 -0
  482. package/dist/headless/index.js +31 -0
  483. package/dist/headless/index.js.map +1 -0
  484. package/dist/hostRegistry-BTG-KkRY.d.cts +115 -0
  485. package/dist/hostRegistry-BTG-KkRY.d.ts +115 -0
  486. package/dist/import/index.cjs +433 -0
  487. package/dist/import/index.cjs.map +1 -0
  488. package/dist/import/index.d.cts +169 -0
  489. package/dist/import/index.d.ts +169 -0
  490. package/dist/import/index.js +421 -0
  491. package/dist/import/index.js.map +1 -0
  492. package/dist/index-CELBpE13.d.cts +4198 -0
  493. package/dist/index-nqc3A-ty.d.ts +4198 -0
  494. package/dist/index.cjs +10597 -0
  495. package/dist/index.cjs.map +1 -0
  496. package/dist/index.d.cts +4949 -0
  497. package/dist/index.d.ts +4949 -0
  498. package/dist/index.js +9907 -0
  499. package/dist/index.js.map +1 -0
  500. package/dist/map/index.cjs +122 -0
  501. package/dist/map/index.cjs.map +1 -0
  502. package/dist/map/index.d.cts +988 -0
  503. package/dist/map/index.d.ts +988 -0
  504. package/dist/map/index.js +25 -0
  505. package/dist/map/index.js.map +1 -0
  506. package/dist/routingGuidePictures-CxgXiuNd.d.cts +22 -0
  507. package/dist/routingGuidePictures-CxgXiuNd.d.ts +22 -0
  508. package/dist/studioStrings-lNvOeC1g.d.cts +72 -0
  509. package/dist/studioStrings-lNvOeC1g.d.ts +72 -0
  510. package/dist/styles.css +14677 -0
  511. package/dist/testing/index.cjs +357 -0
  512. package/dist/testing/index.cjs.map +1 -0
  513. package/dist/testing/index.d.cts +319 -0
  514. package/dist/testing/index.d.ts +319 -0
  515. package/dist/testing/index.js +344 -0
  516. package/dist/testing/index.js.map +1 -0
  517. package/dist/video/index.cjs +53 -0
  518. package/dist/video/index.cjs.map +1 -0
  519. package/dist/video/index.d.cts +127 -0
  520. package/dist/video/index.d.ts +127 -0
  521. package/dist/video/index.js +44 -0
  522. package/dist/video/index.js.map +1 -0
  523. package/package.json +227 -4
  524. package/src/agent/components/ActivityRow.tsx +226 -0
  525. package/src/agent/components/AgentEntityIndicator.tsx +67 -0
  526. package/src/agent/components/AgentMarkdown.tsx +530 -0
  527. package/src/agent/components/ChatComposer.tsx +161 -0
  528. package/src/agent/components/ChatTranscript.tsx +1358 -0
  529. package/src/agent/components/CopilotPanel.tsx +415 -0
  530. package/src/agent/components/CopilotStates.tsx +238 -0
  531. package/src/agent/components/CopilotTranscript.tsx +191 -0
  532. package/src/agent/components/MessageFeedback.tsx +100 -0
  533. package/src/agent/hooks/useAgentChatTransport.ts +61 -0
  534. package/src/agent/hooks/useAgentErrorCopy.ts +27 -0
  535. package/src/agent/hooks/useCopilotOpen.ts +68 -0
  536. package/src/agent/providers/AgentThreadsProvider.tsx +360 -0
  537. package/src/agent/providers/PromptPanelConversation.tsx +135 -0
  538. package/src/agent/rules/drawnNode.ts +24 -0
  539. package/src/alerts/components/MapAlerts.tsx +127 -0
  540. package/src/cache/hooks/useStudioCache.ts +40 -0
  541. package/src/cache/rules/studioCache.ts +145 -0
  542. package/src/collab/components/PeerEntityIndicator.tsx +150 -0
  543. package/src/collab/components/PresenceRoster.tsx +113 -0
  544. package/src/collab/components/peerLock.tsx +59 -0
  545. package/src/collab/hooks/useCollabOrganizationId.ts +24 -0
  546. package/src/collab/hooks/usePeerLockLabel.ts +41 -0
  547. package/src/collections/components/CollectionFormModal.tsx +280 -0
  548. package/src/collections/components/CollectionMultiSelect.tsx +640 -0
  549. package/src/collections/components/EditCollectionModal.tsx +114 -0
  550. package/src/collections/components/ManageCollectionsModal.tsx +692 -0
  551. package/src/collections/components/NewCollectionModal.tsx +87 -0
  552. package/src/collections/components/ShareCollectionModal.tsx +150 -0
  553. package/src/collections/hooks/useEntityCollections.ts +126 -0
  554. package/src/collections/hooks/useEveryPage.ts +33 -0
  555. package/src/controls/components/MapControlTooltip.tsx +84 -0
  556. package/src/controls/components/PoiOverlayMenu.tsx +342 -0
  557. package/src/controls/components/StudioControls.tsx +278 -0
  558. package/src/controls/rules/constants.ts +34 -0
  559. package/src/copilot/hooks/useStudioCopilotInset.ts +39 -0
  560. package/src/copilot/index.ts +29 -0
  561. package/src/directions/components/DirectionsModal.tsx +447 -0
  562. package/src/directions/components/directionsPdf.tsx +557 -0
  563. package/src/embed/components/DefaultViewControl.tsx +159 -0
  564. package/src/embed/components/EmbedBaseMapPicker.tsx +107 -0
  565. package/src/embed/components/EmbedCodeSection.tsx +329 -0
  566. package/src/embed/components/EmbedColumnsSection.tsx +167 -0
  567. package/src/embed/components/EmbedConfigForm.tsx +239 -0
  568. package/src/embed/components/EmbedElementSwitcher.tsx +87 -0
  569. package/src/embed/components/EmbedFieldControl.tsx +488 -0
  570. package/src/embed/components/EmbedGeneralSection.tsx +279 -0
  571. package/src/embed/components/EmbedKeyPanel.tsx +138 -0
  572. package/src/embed/components/EmbedSnippetCode.tsx +154 -0
  573. package/src/embed/components/EmbedStage.tsx +505 -0
  574. package/src/embed/components/EmbedTablePreview.tsx +134 -0
  575. package/src/embed/components/EmbedThemePicker.tsx +74 -0
  576. package/src/embed/components/EmbedTintPicker.tsx +76 -0
  577. package/src/embed/components/EmbedWizard.tsx +1031 -0
  578. package/src/embed/hooks/useEmbedCode.ts +170 -0
  579. package/src/embed/hooks/useEmbedCollectionItineraries.ts +42 -0
  580. package/src/embed/hooks/useEmbedLayerOptions.ts +75 -0
  581. package/src/embed/hooks/useEmbedPreviewCamera.ts +169 -0
  582. package/src/embed/index.ts +48 -0
  583. package/src/fullscreen/components/FullscreenHeader.tsx +77 -0
  584. package/src/fullscreen/components/FullscreenModal.tsx +80 -0
  585. package/src/fullscreen/components/WizardLayout.tsx +129 -0
  586. package/src/guards/components/AgentDrivingGuard.tsx +59 -0
  587. package/src/guards/components/UnsavedEditsGuard.tsx +210 -0
  588. package/src/guards/hooks/useReportUnsavedForm.ts +34 -0
  589. package/src/guards/hooks/useUnsavedEditsGuard.ts +44 -0
  590. package/src/headless/hooks/useAgentDriving.ts +21 -0
  591. package/src/headless/hooks/useBeginSegmentEdit.ts +89 -0
  592. package/src/headless/hooks/useBeginWaypointEdit.ts +74 -0
  593. package/src/headless/hooks/useCapabilitySet.ts +65 -0
  594. package/src/headless/hooks/useCollabResources.ts +148 -0
  595. package/src/headless/hooks/useCollectionScope.ts +37 -0
  596. package/src/headless/hooks/useEditActions.ts +250 -0
  597. package/src/headless/hooks/useEscapeKey.ts +43 -0
  598. package/src/headless/hooks/useInlineRename.ts +276 -0
  599. package/src/headless/hooks/useLiveAwareSegments.ts +88 -0
  600. package/src/headless/hooks/useLiveAwareWaypoints.ts +39 -0
  601. package/src/headless/hooks/useMapHoveredRow.ts +76 -0
  602. package/src/headless/hooks/usePlatformViewer.ts +452 -0
  603. package/src/headless/hooks/usePluginSlot.ts +235 -0
  604. package/src/headless/hooks/useRowEmphasis.ts +66 -0
  605. package/src/headless/hooks/useSegmentList.ts +428 -0
  606. package/src/headless/hooks/useSegmentRow.ts +366 -0
  607. package/src/headless/hooks/useSegmentRowActions.ts +267 -0
  608. package/src/headless/hooks/useShallowSelector.ts +145 -0
  609. package/src/headless/hooks/useStableMembers.ts +74 -0
  610. package/src/headless/hooks/useStoreSlice.ts +52 -0
  611. package/src/headless/hooks/useStreetViewCorridor.ts +120 -0
  612. package/src/headless/hooks/useStudioApi.ts +18 -0
  613. package/src/headless/hooks/useStudioDispatch.ts +181 -0
  614. package/src/headless/hooks/useStudioDispatchCount.ts +147 -0
  615. package/src/headless/hooks/useStudioDispatchUnsafe.ts +111 -0
  616. package/src/headless/hooks/useStudioEntitlement.ts +29 -0
  617. package/src/headless/hooks/useStudioFailureAlert.ts +67 -0
  618. package/src/headless/hooks/useStudioObserve.ts +38 -0
  619. package/src/headless/hooks/useStudioPreferences.ts +8 -0
  620. package/src/headless/hooks/useStudioSignedIn.ts +12 -0
  621. package/src/headless/hooks/useStudioStore.ts +72 -0
  622. package/src/headless/hooks/useStudioUnits.ts +23 -0
  623. package/src/headless/hooks/useStudioUrl.ts +24 -0
  624. package/src/headless/hooks/useStudioUserId.ts +5 -0
  625. package/src/headless/hooks/useStudioVerbHeld.ts +43 -0
  626. package/src/headless/hooks/useStudioViewer.ts +19 -0
  627. package/src/headless/hooks/useStudioViewerEntitlement.ts +40 -0
  628. package/src/headless/hooks/useStudioViewerItineraryLimit.ts +34 -0
  629. package/src/headless/hooks/useStudioViewerPreferences.ts +44 -0
  630. package/src/headless/hooks/useStudioViewerUnits.ts +50 -0
  631. package/src/headless/hooks/useStudioViewerUserId.ts +23 -0
  632. package/src/headless/hooks/useUiStore.ts +91 -0
  633. package/src/headless/hooks/useUiStoreShallow.ts +43 -0
  634. package/src/headless/hooks/useWaypointDetailsDialog.ts +52 -0
  635. package/src/headless/hooks/useWaypointList.ts +89 -0
  636. package/src/headless/hooks/useWaypointRow.ts +227 -0
  637. package/src/headless/hooks/useWaypointRowActions.ts +166 -0
  638. package/src/headless/index.ts +287 -0
  639. package/src/headless/providers/billingGate.tsx +129 -0
  640. package/src/headless/providers/copilot.tsx +155 -0
  641. package/src/headless/providers/mountayaStudio.tsx +126 -0
  642. package/src/headless/providers/navigationBlocker.tsx +91 -0
  643. package/src/headless/providers/notify.tsx +36 -0
  644. package/src/headless/providers/organizations.tsx +267 -0
  645. package/src/headless/providers/plugins.tsx +173 -0
  646. package/src/headless/providers/studio.tsx +1295 -0
  647. package/src/headless/providers/studioStrings.tsx +243 -0
  648. package/src/headless/rules/inputMethod.ts +19 -0
  649. package/src/hooks/useAgreementLimits.ts +165 -0
  650. package/src/hooks/useLayerCatalogOptions.ts +106 -0
  651. package/src/host/components/MountayaStudioHost.tsx +1018 -0
  652. package/src/host/hooks/useEmbeddedStudio.ts +24 -0
  653. package/src/host/hooks/useItineraryActivation.ts +126 -0
  654. package/src/host/hooks/useMemberGrants.ts +51 -0
  655. package/src/host/hooks/useStudioHostSurfaces.ts +100 -0
  656. package/src/host/hooks/useStudioPluginBinding.ts +133 -0
  657. package/src/host/hooks/useStudioSessionHeld.ts +111 -0
  658. package/src/host/hooks/useStudioToolBus.ts +127 -0
  659. package/src/host/hooks/useStudioToolContext.ts +175 -0
  660. package/src/host/providers/hostRegistry.tsx +144 -0
  661. package/src/host/providers/hostSurface.tsx +47 -0
  662. package/src/host/providers/hostVideo.tsx +73 -0
  663. package/src/import/components/DraftEntityList.tsx +298 -0
  664. package/src/import/components/FileDropInput.tsx +261 -0
  665. package/src/import/components/FileDropzone.tsx +97 -0
  666. package/src/import/components/ImportItineraryContent.tsx +133 -0
  667. package/src/import/components/ImportPreviewLegend.tsx +50 -0
  668. package/src/import/components/ImportPrimer.tsx +113 -0
  669. package/src/import/index.ts +32 -0
  670. package/src/import/providers/ImportRoutingGuideProvider.tsx +319 -0
  671. package/src/import/rules/routingGuidePictures.ts +20 -0
  672. package/src/index.ts +633 -0
  673. package/src/internal/components/Glyph.tsx +34 -0
  674. package/src/internal/components/MarkerGlyph.tsx +23 -0
  675. package/src/internal/components/MountayaMark.tsx +142 -0
  676. package/src/internal/hooks/useTextOverflow.ts +90 -0
  677. package/src/internal/providers/studioEditorRoot.tsx +42 -0
  678. package/src/internal/rules/editorRoot.ts +9 -0
  679. package/src/internal/rules/missingSeam.ts +32 -0
  680. package/src/itinerary/components/ActivityGuideModal.tsx +345 -0
  681. package/src/itinerary/components/ActivitySelect.tsx +204 -0
  682. package/src/itinerary/components/AddWaypointButton.tsx +151 -0
  683. package/src/itinerary/components/AscentInput.tsx +65 -0
  684. package/src/itinerary/components/Characteristics.tsx +129 -0
  685. package/src/itinerary/components/CursorReadout.tsx +66 -0
  686. package/src/itinerary/components/DistanceInput.tsx +67 -0
  687. package/src/itinerary/components/DraftProvenanceBanner.tsx +79 -0
  688. package/src/itinerary/components/DuplicateItineraryModal.tsx +341 -0
  689. package/src/itinerary/components/EditorSaveFooter.tsx +424 -0
  690. package/src/itinerary/components/ItineraryActionsMenu.tsx +655 -0
  691. package/src/itinerary/components/ItineraryForm.tsx +887 -0
  692. package/src/itinerary/components/ItineraryHeaderIdentity.tsx +121 -0
  693. package/src/itinerary/components/ItineraryHeaderMeta.tsx +68 -0
  694. package/src/itinerary/components/ItineraryHeaderTitle.tsx +88 -0
  695. package/src/itinerary/components/ItineraryIdentityFields.tsx +153 -0
  696. package/src/itinerary/components/ItineraryProfilePanel.tsx +619 -0
  697. package/src/itinerary/components/ItineraryProfileSheet.tsx +219 -0
  698. package/src/itinerary/components/ItinerarySubHeader.tsx +236 -0
  699. package/src/itinerary/components/PendingProfile.tsx +142 -0
  700. package/src/itinerary/components/PlaceCard.tsx +35 -0
  701. package/src/itinerary/components/PlaceMark.tsx +76 -0
  702. package/src/itinerary/components/ProfileAnalysisBars.tsx +84 -0
  703. package/src/itinerary/components/ProfileBar.tsx +215 -0
  704. package/src/itinerary/components/ProfileHeaderControls.tsx +116 -0
  705. package/src/itinerary/components/ProfileHeaderFigures.tsx +119 -0
  706. package/src/itinerary/components/ProfilePaceControl.tsx +97 -0
  707. package/src/itinerary/components/ProfileStat.tsx +76 -0
  708. package/src/itinerary/components/ProfileStatStrip.tsx +38 -0
  709. package/src/itinerary/components/RoadAccessModal.tsx +76 -0
  710. package/src/itinerary/components/RouteTypeControl.tsx +73 -0
  711. package/src/itinerary/components/SegmentGroupModal.tsx +311 -0
  712. package/src/itinerary/components/SegmentGroupRangePicker.tsx +228 -0
  713. package/src/itinerary/components/StagingCreateFooter.tsx +185 -0
  714. package/src/itinerary/components/StudioItineraryProfile.tsx +620 -0
  715. package/src/itinerary/components/SuggestForm.tsx +256 -0
  716. package/src/itinerary/components/SuggestFormActions.tsx +124 -0
  717. package/src/itinerary/components/SuggestionResultRow.tsx +98 -0
  718. package/src/itinerary/components/SuggestionResultsList.tsx +85 -0
  719. package/src/itinerary/components/WaypointAmenityPicker.tsx +105 -0
  720. package/src/itinerary/components/WaypointDetailFields.tsx +604 -0
  721. package/src/itinerary/components/WaypointDetailsModal.tsx +134 -0
  722. package/src/itinerary/components/WaypointDetailsRows.tsx +707 -0
  723. package/src/itinerary/components/WaypointDetailsView.tsx +389 -0
  724. package/src/itinerary/components/WaypointIconCircle.tsx +211 -0
  725. package/src/itinerary/components/WaypointIconPicker.tsx +82 -0
  726. package/src/itinerary/components/WaypointMarkers.tsx +293 -0
  727. package/src/itinerary/components/WaypointPreviewCard.tsx +56 -0
  728. package/src/itinerary/components/WaypointSectionNav.tsx +151 -0
  729. package/src/itinerary/components/WaypointSwitcher.tsx +143 -0
  730. package/src/itinerary/components/WaypointWorkbench.tsx +263 -0
  731. package/src/itinerary/hooks/useDuplicateDraft.ts +205 -0
  732. package/src/itinerary/hooks/useDuplicateSource.ts +69 -0
  733. package/src/itinerary/hooks/useFriendlyNameBanks.ts +26 -0
  734. package/src/itinerary/hooks/useItineraryEditable.ts +89 -0
  735. package/src/itinerary/hooks/useItineraryPace.ts +103 -0
  736. package/src/itinerary/hooks/useItinerarySubject.ts +117 -0
  737. package/src/itinerary/hooks/useOpenItineraryEditable.ts +39 -0
  738. package/src/itinerary/hooks/useProfileOverlay.tsx +61 -0
  739. package/src/itinerary/hooks/useProfileSeries.ts +95 -0
  740. package/src/itinerary/hooks/useProfileVisibility.ts +149 -0
  741. package/src/itinerary/hooks/useSeedDraftOrganization.ts +85 -0
  742. package/src/itinerary/hooks/useSegmentGroupSave.ts +143 -0
  743. package/src/itinerary/hooks/useStartFromSuggestion.ts +63 -0
  744. package/src/itinerary/hooks/useStudioItinerary.ts +35 -0
  745. package/src/itinerary/hooks/useSuggestionPin.ts +36 -0
  746. package/src/itinerary/hooks/useWaypointCardWords.ts +51 -0
  747. package/src/itinerary/hooks/useWaypointCreateFollowUp.ts +158 -0
  748. package/src/itinerary/hooks/useWaypointDetailsEditor.ts +280 -0
  749. package/src/itinerary/hooks/useWaypointSectionEntries.ts +114 -0
  750. package/src/itinerary/providers/ActivityGuideProvider.tsx +113 -0
  751. package/src/itinerary/providers/ItineraryViewProvider.tsx +146 -0
  752. package/src/itinerary/rules/amenityGlyphs.ts +25 -0
  753. package/src/itinerary/rules/cursorReadoutData.ts +34 -0
  754. package/src/itinerary/rules/profileCursor.ts +11 -0
  755. package/src/itinerary/rules/profileModel.ts +98 -0
  756. package/src/itinerary/rules/shownFocus.ts +11 -0
  757. package/src/itinerary/rules/waypointGlyphs.ts +42 -0
  758. package/src/itinerary/stores/profileHover.ts +54 -0
  759. package/src/lists/components/AddSegmentButton.tsx +240 -0
  760. package/src/lists/components/EditActions.tsx +153 -0
  761. package/src/lists/components/EditorListSection.tsx +117 -0
  762. package/src/lists/components/EditorSegmentRow.tsx +458 -0
  763. package/src/lists/components/ItineraryAddSegmentButton.tsx +66 -0
  764. package/src/lists/components/ItinerarySegmentList.tsx +301 -0
  765. package/src/lists/components/ItineraryWaypointList.tsx +257 -0
  766. package/src/lists/components/SegmentList.tsx +549 -0
  767. package/src/lists/components/SegmentSeam.tsx +292 -0
  768. package/src/lists/components/WaypointList.tsx +232 -0
  769. package/src/map/components/ContextMenuPopup.tsx +913 -0
  770. package/src/map/components/MapAnchoredPopup.tsx +284 -0
  771. package/src/map/components/SegmentViaPopup.tsx +133 -0
  772. package/src/map/hooks/useAccessRestrictions.ts +25 -0
  773. package/src/map/hooks/useEmbedConstraints.ts +359 -0
  774. package/src/map/hooks/useEmbedDisplaySeed.ts +61 -0
  775. package/src/map/hooks/useEmbedReady.ts +137 -0
  776. package/src/map/hooks/useHeldTileSources.ts +65 -0
  777. package/src/map/hooks/useSegmentColor.ts +24 -0
  778. package/src/map/hooks/useSpecificationLayers.ts +25 -0
  779. package/src/map/hooks/useStudioConstraints.ts +135 -0
  780. package/src/map/hooks/useStudioContextMenu.ts +34 -0
  781. package/src/map/hooks/useStudioContextMenuWaypoint.ts +119 -0
  782. package/src/map/hooks/useStudioEditCommitReporter.ts +56 -0
  783. package/src/map/hooks/useStudioEditEngine.ts +270 -0
  784. package/src/map/hooks/useStudioEnrichment.ts +117 -0
  785. package/src/map/hooks/useStudioItinerarySelection.ts +484 -0
  786. package/src/map/hooks/useStudioLayersScope.ts +34 -0
  787. package/src/map/hooks/useStudioMapBindings.ts +178 -0
  788. package/src/map/hooks/useStudioMapEditSeams.ts +161 -0
  789. package/src/map/hooks/useStudioMapSync.ts +127 -0
  790. package/src/map/hooks/useStudioOverlay.ts +75 -0
  791. package/src/map/hooks/useStudioOverlayWithdrawal.ts +52 -0
  792. package/src/map/hooks/useStudioOverlaysEntitled.ts +12 -0
  793. package/src/map/hooks/useStudioPeerDrafts.ts +126 -0
  794. package/src/map/hooks/useStudioPoiLayers.ts +110 -0
  795. package/src/map/hooks/useStudioPreviewSync.ts +205 -0
  796. package/src/map/hooks/useStudioSegmentEditing.ts +239 -0
  797. package/src/map/hooks/useStudioSegmentViaPrompt.ts +38 -0
  798. package/src/map/hooks/useStudioSplitPicking.ts +411 -0
  799. package/src/map/hooks/useStudioSuggestionPicking.ts +178 -0
  800. package/src/map/hooks/useStudioTimestamp.ts +226 -0
  801. package/src/map/hooks/useStudioUrlState.ts +340 -0
  802. package/src/map/hooks/useStudioWaypointEditing.ts +251 -0
  803. package/src/map/hooks/useStudioZoneEditing.ts +260 -0
  804. package/src/map/hooks/useStudioZoneOriginPicking.ts +129 -0
  805. package/src/map/hooks/useStudioZoneSelection.ts +240 -0
  806. package/src/map/hooks/useTileLayers.ts +33 -0
  807. package/src/map/index.ts +67 -0
  808. package/src/map/rules/editKeyboard.ts +216 -0
  809. package/src/map/rules/editTooltip.ts +222 -0
  810. package/src/map/rules/nearerEscape.ts +107 -0
  811. package/src/map/rules/poiGlyphs.ts +40 -0
  812. package/src/modals/components/AppModal.tsx +280 -0
  813. package/src/modals/components/ConfirmModal.tsx +223 -0
  814. package/src/modals/components/ExportModal.tsx +538 -0
  815. package/src/modals/components/LocationPermissionModal.tsx +129 -0
  816. package/src/modals/components/ModalFooter.tsx +187 -0
  817. package/src/modals/hooks/useConfirmGate.tsx +209 -0
  818. package/src/modals/hooks/useDiscardGuard.tsx +168 -0
  819. package/src/panels/components/EditShortcutHint.tsx +115 -0
  820. package/src/panels/components/FloatingOverlay.tsx +243 -0
  821. package/src/panels/components/GlyphPickerGrid.tsx +84 -0
  822. package/src/panels/components/PanelRouter.tsx +133 -0
  823. package/src/panels/components/PickerCard.tsx +108 -0
  824. package/src/panels/components/RadioOptionCard.tsx +116 -0
  825. package/src/panels/components/SidenavContentBody.tsx +56 -0
  826. package/src/panels/components/SidenavContentFooter.tsx +27 -0
  827. package/src/panels/components/SidenavContentHeader.tsx +172 -0
  828. package/src/panels/components/SidenavFormActions.tsx +96 -0
  829. package/src/panels/components/StudioFormStack.tsx +44 -0
  830. package/src/panels/components/StudioHeader.tsx +117 -0
  831. package/src/panels/components/StudioLayersPanel.tsx +909 -0
  832. package/src/panels/components/StudioPreferencesPanel.tsx +199 -0
  833. package/src/panels/rules/studioHeader.ts +68 -0
  834. package/src/plugins/components/PluginBoundary.tsx +62 -0
  835. package/src/plugins/components/PluginContextMenuActions.tsx +73 -0
  836. package/src/plugins/components/PluginControls.tsx +101 -0
  837. package/src/plugins/components/PluginHeldView.tsx +77 -0
  838. package/src/plugins/components/PluginMenuItems.tsx +63 -0
  839. package/src/plugins/components/PluginProfileHeader.tsx +71 -0
  840. package/src/plugins/components/PluginProfilePlot.tsx +134 -0
  841. package/src/plugins/components/PluginSlotItems.tsx +55 -0
  842. package/src/primitives/components/ActivityIcon.tsx +106 -0
  843. package/src/primitives/components/AllowlistField.tsx +508 -0
  844. package/src/primitives/components/CopyIconButton.tsx +80 -0
  845. package/src/primitives/components/DateTimeInput.tsx +133 -0
  846. package/src/primitives/components/DateTimePickerField.tsx +101 -0
  847. package/src/primitives/components/DescriptiveMenuItem.tsx +80 -0
  848. package/src/primitives/components/DialogSubject.tsx +102 -0
  849. package/src/primitives/components/DisabledMenuItem.tsx +45 -0
  850. package/src/primitives/components/DisabledReason.tsx +34 -0
  851. package/src/primitives/components/EmptyState.tsx +186 -0
  852. package/src/primitives/components/ErrorAlert.tsx +35 -0
  853. package/src/primitives/components/ErrorBoundary.tsx +55 -0
  854. package/src/primitives/components/FieldLabel.tsx +34 -0
  855. package/src/primitives/components/FormErrorAlert.tsx +33 -0
  856. package/src/primitives/components/GroupLabelledBy.tsx +31 -0
  857. package/src/primitives/components/LanguageSelect.tsx +139 -0
  858. package/src/primitives/components/ListSkeleton.tsx +64 -0
  859. package/src/primitives/components/MarqueeText.tsx +61 -0
  860. package/src/primitives/components/OrganizationScopeItem.tsx +146 -0
  861. package/src/primitives/components/OrganizationSelect.tsx +149 -0
  862. package/src/primitives/components/PointField.tsx +75 -0
  863. package/src/primitives/components/PrivacyControl.tsx +127 -0
  864. package/src/primitives/components/RenameInput.tsx +159 -0
  865. package/src/primitives/components/RequiredLabelWithHelp.tsx +76 -0
  866. package/src/primitives/components/SegmentIcon.tsx +43 -0
  867. package/src/primitives/components/SegmentIconLabel.tsx +37 -0
  868. package/src/primitives/components/SpeedInput.tsx +222 -0
  869. package/src/primitives/components/StudioSectionBoundary.tsx +56 -0
  870. package/src/primitives/components/StudioSegmentedControl.tsx +23 -0
  871. package/src/primitives/components/UnitPickerField.tsx +62 -0
  872. package/src/primitives/components/UnitPickerGrid.tsx +71 -0
  873. package/src/primitives/components/WarningAlert.tsx +34 -0
  874. package/src/primitives/hooks/useCompactLayout.ts +30 -0
  875. package/src/primitives/hooks/useSpeedControlLabel.ts +28 -0
  876. package/src/primitives/rules/activityBadge.ts +87 -0
  877. package/src/publication/components/PublicationBadge.tsx +42 -0
  878. package/src/publication/components/PublicationDot.tsx +31 -0
  879. package/src/publication/components/PublicationNotice.tsx +115 -0
  880. package/src/publication/components/PublicationSettledPill.tsx +43 -0
  881. package/src/publication/components/PublicationStatus.tsx +52 -0
  882. package/src/publication/components/UnpublishedPanel.tsx +133 -0
  883. package/src/publication/hooks/usePublicationHint.ts +235 -0
  884. package/src/publication/hooks/usePublishAct.ts +101 -0
  885. package/src/publication/hooks/usePublishItinerary.ts +27 -0
  886. package/src/publication/hooks/usePublishZone.ts +27 -0
  887. package/src/publication/hooks/usePublishableScope.ts +23 -0
  888. package/src/publication/hooks/usePublishedItinerary.ts +83 -0
  889. package/src/rows/components/ReadOnlySegmentRow.tsx +155 -0
  890. package/src/rows/components/RouteMetricLine.tsx +90 -0
  891. package/src/rows/components/RowMetadata.tsx +92 -0
  892. package/src/rows/components/SegmentRow.tsx +381 -0
  893. package/src/rows/components/SegmentRowActions.tsx +187 -0
  894. package/src/rows/components/SegmentRowBody.tsx +197 -0
  895. package/src/rows/components/StudioToggleRow.tsx +71 -0
  896. package/src/rows/components/SuggestionList.tsx +100 -0
  897. package/src/rows/components/SuggestionRowLayout.tsx +164 -0
  898. package/src/rows/components/WaypointRow.tsx +175 -0
  899. package/src/rows/components/WaypointRowLayout.tsx +278 -0
  900. package/src/rows/components/lockChrome.tsx +106 -0
  901. package/src/rules/menuActions.ts +149 -0
  902. package/src/rules/sizing.ts +127 -0
  903. package/src/rules/studioConfig.ts +719 -0
  904. package/src/search/components/CategoryTabs.tsx +136 -0
  905. package/src/search/components/ResultRow.tsx +242 -0
  906. package/src/search/components/ResultsList.tsx +182 -0
  907. package/src/search/components/SearchInput.tsx +100 -0
  908. package/src/search/components/SearchTab.tsx +614 -0
  909. package/src/sections/components/RailSwitcher.tsx +179 -0
  910. package/src/sections/components/SectionCard.tsx +48 -0
  911. package/src/sections/components/SectionHead.tsx +42 -0
  912. package/src/sections/components/SectionTabs.tsx +231 -0
  913. package/src/segments/components/SegmentColorCircle.tsx +118 -0
  914. package/src/segments/components/SegmentColorPicker.tsx +134 -0
  915. package/src/segments/components/SegmentModeControl.tsx +118 -0
  916. package/src/segments/components/SegmentRowMenu.tsx +449 -0
  917. package/src/segments/components/SegmentRowPopover.tsx +163 -0
  918. package/src/segments/components/SegmentSelect.tsx +116 -0
  919. package/src/segments/components/SegmentSpeedControl.tsx +299 -0
  920. package/src/share/components/ShareLinkManage.tsx +699 -0
  921. package/src/share/components/ShareModal.tsx +182 -0
  922. package/src/share/components/ShareSheet.tsx +178 -0
  923. package/src/share/components/ShareViewModal.tsx +131 -0
  924. package/src/share/hooks/useCanManageShareLink.ts +51 -0
  925. package/src/studio/components/MountayaStudio.tsx +1170 -0
  926. package/src/studio/components/MountayaStudioViewer.tsx +775 -0
  927. package/src/studio/hooks/useEmbeddedStudioConfig.ts +60 -0
  928. package/src/studio/hooks/useViewerActivation.ts +47 -0
  929. package/src/studio/hooks/useViewerCollectionSpecification.ts +58 -0
  930. package/src/studio/hooks/useViewerEmbedConfig.ts +74 -0
  931. package/src/studio/hooks/useViewerFraming.ts +211 -0
  932. package/src/studio/hooks/useViewerMapBindings.ts +109 -0
  933. package/src/styles.css +3993 -0
  934. package/src/testing/collections.ts +40 -0
  935. package/src/testing/hostRegistry.tsx +109 -0
  936. package/src/testing/index.ts +65 -0
  937. package/src/testing/itinerary.ts +297 -0
  938. package/src/testing/mountayaClient.tsx +218 -0
  939. package/src/testing/viewer.tsx +171 -0
  940. package/src/theme/components/StudioPortalScope.tsx +130 -0
  941. package/src/theme/hooks/useResolvedStudioTheme.ts +37 -0
  942. package/src/theme/rules/density.ts +157 -0
  943. package/src/theme/rules/mountayaStudioTheme.ts +114 -0
  944. package/src/theme/rules/passwordManager.ts +20 -0
  945. package/src/theme/rules/tokenStyle.ts +18 -0
  946. package/src/theme/rules/tokens.ts +71 -0
  947. package/src/theme/rules/tone.ts +34 -0
  948. package/src/theme/rules/zIndex.ts +40 -0
  949. package/src/video/components/CameraStep.tsx +82 -0
  950. package/src/video/components/DirectingScrim.tsx +28 -0
  951. package/src/video/components/DirectorChat.tsx +79 -0
  952. package/src/video/components/FormatStep.tsx +487 -0
  953. package/src/video/components/ModeCards.tsx +141 -0
  954. package/src/video/components/PlanNumberField.tsx +54 -0
  955. package/src/video/components/PreviewControls.tsx +212 -0
  956. package/src/video/components/PreviewStage.tsx +319 -0
  957. package/src/video/components/PreviewSurface.tsx +247 -0
  958. package/src/video/components/PreviewWatermark.tsx +77 -0
  959. package/src/video/components/ProfileOverlayCanvas.tsx +195 -0
  960. package/src/video/components/ProfileStep.tsx +254 -0
  961. package/src/video/components/RecordProgress.tsx +117 -0
  962. package/src/video/components/ReviewStep.tsx +244 -0
  963. package/src/video/components/ShotList.tsx +452 -0
  964. package/src/video/components/VideoExportWizard.tsx +829 -0
  965. package/src/video/components/WizardDirectingIndicator.tsx +57 -0
  966. package/src/video/components/WizardFooter.tsx +112 -0
  967. package/src/video/hooks/usePreviewPlanRefresh.ts +91 -0
  968. package/src/video/hooks/useVideoItinerarySubject.ts +18 -0
  969. package/src/video/hooks/useVideoOrganizationId.ts +30 -0
  970. package/src/video/hooks/useVideoPreviewSeed.ts +203 -0
  971. package/src/video/hooks/useVideoProfileSeed.ts +53 -0
  972. package/src/video/hooks/useVideoPublication.ts +29 -0
  973. package/src/video/hooks/useVideoRouteReady.ts +52 -0
  974. package/src/video/hooks/useVideoRouteSync.ts +100 -0
  975. package/src/video/hooks/useVideoTileTransform.ts +88 -0
  976. package/src/video/index.ts +24 -0
  977. package/src/video/providers/DirectorChatProvider.tsx +293 -0
  978. package/src/video/rules/changeTo.ts +20 -0
  979. package/src/zone/components/ZoneActionsMenu.tsx +305 -0
  980. package/src/zone/components/ZoneAvailabilityFields.tsx +98 -0
  981. package/src/zone/components/ZoneForm.tsx +622 -0
  982. package/src/zone/components/ZoneInheritedContext.tsx +70 -0
  983. package/src/zone/components/ZoneLevelSelect.tsx +86 -0
  984. package/src/zone/components/ZoneMetadataFields.tsx +89 -0
  985. package/src/zone/components/ZoneMethodSelect.tsx +90 -0
  986. package/src/zone/components/ZoneModeSelect.tsx +98 -0
  987. package/src/zone/components/ZoneRangeInput.tsx +129 -0
  988. package/src/zone/components/ZoneReachabilityFields.tsx +120 -0
  989. package/src/zone/components/ZoneSubHeader.tsx +188 -0
  990. package/src/zone/components/ZoneVisibility.tsx +94 -0
  991. package/src/zone/hooks/useStudioReachabilityStart.ts +79 -0
  992. package/src/zone/hooks/useStudioZonesBrowsed.ts +32 -0
@@ -0,0 +1,4198 @@
1
+ import { QueryClient, QueryKey } from '@tanstack/react-query';
2
+ import { ResourceRef, MountayaError, Mountaya } from '@mountaya/client';
3
+ import { StudioCache, ToolResult, OrganizationRole, StudioScopeSeam, StudioWriteResource, StudioWriteRefusal, ToolBusContext, ToolBusDispatch, ToolBusObserveOverrides, ToolDispatchRegistry, ToolOutputRegistry, CategoryActivities, ToolCapability, UiStoreApi, StudioToolContext, StudioHandlers, ToolDispatchObserver, ThrownRecognizer, StudioUrlSeam, StudioPersistence, StudioViewer, ItineraryViewSource, CollabResource, CollabLockKind, ToolResultOf, StudioToolOutputs, ItinerarySelection, PlatformScopeAnswer, SegmentChainEnds, SegmentGroupRun, SegmentChainMerges, SegmentChainMerge, StudioApi, StudioToolInputs, StudioEntitlement, ViewerPreferences, ViewerSeam, UiStore } from '@mountaya/studio';
4
+ import { I as ImportRoutingGuidePictures } from './routingGuidePictures-CxgXiuNd.cjs';
5
+ import * as react from 'react';
6
+ import { ReactNode, ErrorInfo, KeyboardEvent as KeyboardEvent$1, RefObject, FocusEvent } from 'react';
7
+ import { MantineThemeOverride } from '@mantine/core';
8
+ import { MountayaI18n, Translations } from '@mountaya/elements/i18n';
9
+ import { TileRequestTransform } from '@mountaya/elements/map-client';
10
+ import { MapLanguage, MapPaintOverrides } from '@mountaya/elements/style';
11
+ import { ElementStyle, MountayaElementsProviderProps, StreetViewBounds } from '@mountaya/elements-react';
12
+ import { RecoveryAddendum, AgentThreadsUrlSeam } from '@mountaya/studio/agent';
13
+ import { StudioPlugin, StudioPluginSubject, StudioPluginEngine, StudioPluginContribution, StudioPluginEntry, StudioPluginSlot, StudioSlotEntry, StudioPluginTarget } from '@mountaya/studio/plugins';
14
+ import { StudioSeams, Clock, StudioFormatters, StudioLinks, StudioStorage, StudioNavigationBlocker, StudioNotify, StudioNavigationAttempt, StudioNavigationHold } from '@mountaya/studio/seams';
15
+ import { StudioStrings, StudioStringsOverrides } from '@mountaya/studio/strings';
16
+ import { PeerNameResolver } from '@mountaya/elements/collab';
17
+ import { GeolocationSeam } from '@mountaya/elements/seams';
18
+ import { Position } from 'geojson';
19
+ import { SegmentEditMode } from '@mountaya/elements/data';
20
+ import { UnitFormatOptions } from '@mountaya/elements/profile';
21
+ import { UserWaypointIcon } from '@mountaya/elements/icons';
22
+ import { MountayaElementsProviderProps as MountayaElementsProviderProps$1 } from '@mountaya/elements-react/headless';
23
+ import './studioStrings-lNvOeC1g.cjs';
24
+
25
+ /**
26
+ * useStudioCache is {@link createStudioCache} with the provider's credential already bound.
27
+ *
28
+ * Memoized on the client and the scope, because the value is threaded into a tool context that
29
+ * a host builds once: a fresh object each render would rebuild it on every pass.
30
+ */
31
+ declare const useStudioCache: (queryClient: QueryClient) => StudioCache;
32
+ /**
33
+ * useStudioResourceKey resolves a resource to its cache key under the provider's credential.
34
+ *
35
+ * The read-side twin of {@link useStudioCache}: a hook writes under it, a tool invalidates
36
+ * through the cache, and both land on the same entry. A caller reaching past the hooks for an
37
+ * entry (reading one a surface already holds, watching or removing it) wants this rather than a
38
+ * key spelled at the call site, because `getQueryData` answers `undefined` to a near miss instead
39
+ * of failing.
40
+ *
41
+ * Not for SEEDING a record. An entry holds the operation's body, with the record under `data`,
42
+ * so a bare record written under this key is an entry the cache reads as empty, and
43
+ * `studio.itinerary.activate` answers that it is not loaded. A host that holds a record already
44
+ * seeds it through {@link useStudioCache}'s `set`, which writes that shape.
45
+ */
46
+ declare const useStudioResourceKey: () => ((key: ResourceRef) => QueryKey);
47
+
48
+ /**
49
+ * createStudioCache binds a resource-named cache to a QueryClient under one credential.
50
+ *
51
+ * The `scope` is the credential's, and it is not optional for the same reason `mountayaKeys` of
52
+ * `@mountaya/client-react` makes it the second segment: one cache serves the whole application, so
53
+ * a write made under a session token must not drop, or worse seed, the entry a share link read
54
+ * under its own. `useStudioCache` binds it from the provider and is what a React caller should
55
+ * reach for.
56
+ *
57
+ * `get` and `set` read and write this credential's entry. `invalidate` and `evict` reach every
58
+ * credential's: `invalidate` marks each entry stale and leaves it answering until a read replaces
59
+ * it, and `evict` removes each, so a later `get` of a deleted resource answers `undefined`.
60
+ *
61
+ * @param queryClient - The application's query cache, the one its hooks read through.
62
+ * @param scope - The client's `credentialScope`, which `get` and `set` key every entry under.
63
+ * @returns The cache seam a tool context's `api.cache` takes, with `evict` stated.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * import type { ItineraryWithDetails } from "@mountaya/client";
68
+ * import type { QueryClient } from "@tanstack/react-query";
69
+ *
70
+ * declare const queryClient: QueryClient;
71
+ * declare const mountaya: Mountaya;
72
+ * declare const itinerary: ItineraryWithDetails;
73
+ *
74
+ * const cache = createStudioCache(queryClient, mountaya.transport.credentialScope);
75
+ *
76
+ * cache.set({ id: "itin_1", kind: "itinerary" }, itinerary);
77
+ * await cache.invalidate({ id: "itin_1", kind: "itinerary" }, { kind: "itineraries" });
78
+ * cache.evict?.({ id: "itin_1", kind: "itinerary" });
79
+ * ```
80
+ */
81
+ declare const createStudioCache: (queryClient: QueryClient, scope: string) => StudioCache;
82
+
83
+ /**
84
+ * What a host may put where the studio draws its own brand.
85
+ *
86
+ * `StudioHeader` renders the Mountaya lockup by default (a mark, the word "Mountaya", and
87
+ * "Map Studio" under it), and this is the shape that replaces it. Two forms rather than one,
88
+ * because the two consumers asking are asking different questions: a product with a lockup of
89
+ * its own already has the markup and wants it rendered, and a product that has a name and a
90
+ * logo and no opinion about type wants the studio's treatment with its own words in it.
91
+ *
92
+ * Which is why the union is a `ReactNode` OR an object rather than a node alone. A node-only
93
+ * seam would make every consumer of the second kind reproduce the package's own stack (a mark
94
+ * beside a two-line column, at the weights and the rhythm this package picked), and the first
95
+ * time the studio's chrome moves, every one of those copies stays where it was.
96
+ */
97
+
98
+ /**
99
+ * A brand stated as its parts, for a host that wants the studio's own treatment of them.
100
+ *
101
+ * `title` is required and the other two are not, which is the shape of the thing: a product has
102
+ * a name, and the mark and the second line are both things a product may or may not have. The
103
+ * default lockup is exactly one of these (the Mountaya mark, "Mountaya", "Map Studio"), so the
104
+ * override and the default are the same component rendering the same stack, and there is no
105
+ * second layout for a consumer to fall out of step with.
106
+ */
107
+ interface StudioHeaderBrand {
108
+ /** The dimmed second line under the title. Omitted, the title stands alone. */
109
+ readonly baseline?: string | undefined;
110
+ /** The mark beside the title: a logo, a monogram, a glyph. Omitted, the title stands alone. */
111
+ readonly icon?: ReactNode;
112
+ /** The name this studio is published under, in the package's own wordmark treatment. */
113
+ readonly title: string;
114
+ }
115
+ /**
116
+ * What a host sets on `appearance.header`, and what {@link useStudioHeader} answers.
117
+ *
118
+ * `null` is a MEANING here rather than an absence: it hides the header entirely, for a host
119
+ * whose own chrome already says whose studio this is. "Not configured" is `undefined`, which is
120
+ * what keeps the two apart: a seam that spelled both `null` would make "no header" and "the
121
+ * Mountaya header" the same value.
122
+ */
123
+ type StudioHeaderOverride = ReactNode | StudioHeaderBrand;
124
+ /**
125
+ * isStudioHeaderBrand narrows an override to the composed form.
126
+ *
127
+ * The one thing this union costs, and it has to be a RUNTIME check: `ReactNode` admits objects
128
+ * (an element, a portal, an array, a promise), so there is no discriminant to switch on and no
129
+ * way for the type system to tell a brand from a node a host built.
130
+ *
131
+ * So it asks what each of those is not. Not a valid element and not a portal (`isValidElement`
132
+ * answers for both), not an array or any other iterable, not a promise: every one of them
133
+ * would otherwise satisfy "an object carrying a `title`" if a host happened to hang one on it.
134
+ * What is left is an object with a string `title`, which is this interface and nothing else
135
+ * React can render.
136
+ *
137
+ * @returns True when `header` is a {@link StudioHeaderBrand}.
138
+ */
139
+ declare const isStudioHeaderBrand: (header: StudioHeaderOverride) => header is StudioHeaderBrand;
140
+
141
+ /**
142
+ * StudioBillingSubject names WHAT a refused dispatch was trying to make.
143
+ *
144
+ * A closed studio vocabulary rather than a sentence, and the direction is why. The prompts travel
145
+ * the other way, host to studio, so they arrive as nodes in the host's own billing words. This
146
+ * travels studio to host, and the studio has no billing bundle to resolve anything in: a sentence
147
+ * here would be a string only the host reads, resolved through a bundle a licensee does not have.
148
+ *
149
+ * Its one member is what every surface that hands a refusal on is making: an itinerary.
150
+ */
151
+ type StudioBillingSubject = "itinerary";
152
+ /**
153
+ * StudioBillingGate is what one surface needs to know about paying for what it is about to do.
154
+ *
155
+ * Its members answer different moments. The prompts are BEFORE: nodes the host words and the
156
+ * studio places beside the act they concern, while the studio's own reading of the viewer says
157
+ * they apply. `handleRefusal` is AFTER: a dispatch that came back refused for a reason the host
158
+ * can fix, replayed verbatim once it is fixed.
159
+ *
160
+ * Whether an act is held before it is attempted is the studio's own reading of what the viewer
161
+ * seam answers for the resource's scope. The gate words what is said where an act is held, and
162
+ * holds nothing back itself.
163
+ */
164
+ interface StudioBillingGate {
165
+ /**
166
+ * What the host wants to say where a create would exceed the itinerary ceiling of its scope, or
167
+ * undefined. On Mountaya's platform that ceiling is the personal space's, which no agreement
168
+ * changes.
169
+ *
170
+ * The studio decides WHERE and WHEN: a surface places it beside the create it belongs to, and
171
+ * only while `useItineraryUsage` reports the ceiling reached, which is a viewer-seam fact the
172
+ * studio already gates several other affordances on. What it says, and any action beside it,
173
+ * is entirely the host's: the studio places the node and links nowhere.
174
+ *
175
+ * Undefined is the answer for every consumer whose scopes carry no ceiling, and their readers
176
+ * meet nothing.
177
+ */
178
+ readonly limitPrompt?: ReactNode;
179
+ /**
180
+ * What the host wants to say where a resource has NO ORGANIZATION to bill at all, or
181
+ * undefined.
182
+ *
183
+ * Separate from {@link limitPrompt} because it answers another question, and a permanent one.
184
+ * That one is about a reader at a scope's itinerary ceiling; this is about a personal resource,
185
+ * which produces no billed output under any agreement. The studio decides WHERE and WHEN: a
186
+ * surface places it where it withheld the act, and only for a resource `usePublishableScope`
187
+ * refuses. What it says, and any action beside it, is entirely the host's: the studio places
188
+ * the node and links nowhere.
189
+ *
190
+ * It is deliberately NOT a {@link StudioBillingSubject} on `handleRefusal`: that is the AFTER
191
+ * path for a refusal the reader can recover from, and this is BEFORE and permanent.
192
+ *
193
+ * Undefined is the answer for every consumer with no organizations, and their readers meet
194
+ * nothing.
195
+ */
196
+ readonly publicationPrompt?: ReactNode;
197
+ /**
198
+ * handleRefusal takes a finished dispatch the host may be able to recover.
199
+ *
200
+ * It answers whether it took it: true means the host has opened its own resolution and will
201
+ * replay `retry`, so the surface shows no inline error; false means the surface reports the
202
+ * failure the way it reports every other one. Returning true and doing nothing would leave a
203
+ * form that swallowed a refusal, which is why the contract is an answer rather than a void.
204
+ *
205
+ * `subject` names what was being made, so the host can say so in its own words.
206
+ */
207
+ handleRefusal(result: ToolResult, retry: () => void, subject: StudioBillingSubject): boolean;
208
+ }
209
+ /**
210
+ * StudioBillingGateSeam answers the gate for ONE organization.
211
+ *
212
+ * A function rather than a value, because the organization is chosen at render time: a create
213
+ * form's target organization is whatever its picker currently holds, and a gate resolved once
214
+ * at the host would answer for a different one.
215
+ *
216
+ * The host's implementation may call hooks (an agreement read, a store of its own), so the seam is
217
+ * called unconditionally in a component body, exactly like a hook. Its identity is the host's to
218
+ * keep: {@link StudioBillingGateProvider} hands on the function it is given, and every surface that
219
+ * reads the gate renders again for a new one. That is how a seam written over the host's own state
220
+ * answers anew, and what a seam written inline costs at each render of the host.
221
+ */
222
+ type StudioBillingGateSeam = (organizationId: string | null) => StudioBillingGate;
223
+ /** The props of {@link StudioBillingGateProvider}. */
224
+ interface StudioBillingGateProviderProps {
225
+ /** The surfaces that read the gate. */
226
+ readonly children: ReactNode;
227
+ /** The host's answer per organization, handed on as it is given. */
228
+ readonly seam: StudioBillingGateSeam;
229
+ }
230
+ /**
231
+ * StudioBillingGateProvider supplies the host's billing binding to every surface beneath it.
232
+ *
233
+ * `seam` is handed on as it is given, and held by nothing here: a surface reads the gate again
234
+ * whenever the function is a new one. A seam declared once, at module scope or under
235
+ * `useCallback`, renders no surface of its own accord.
236
+ */
237
+ declare const StudioBillingGateProvider: ({ children, seam }: StudioBillingGateProviderProps) => react.JSX.Element;
238
+ /**
239
+ * useStudioBillingGate resolves the gate for the organization a surface is acting on.
240
+ *
241
+ * @param organizationId - The organization the surface acts on, or null for a personal resource.
242
+ * @returns The host's gate for it, or a gate that places no prompt and takes no refusal where no
243
+ * host binding is mounted.
244
+ */
245
+ declare const useStudioBillingGate: (organizationId: string | null) => StudioBillingGate;
246
+
247
+ /**
248
+ * CopilotAvailability is what a surface needs to know before offering the co-pilot.
249
+ *
250
+ * Several flags rather than one, because "unavailable" says different things: the viewer may
251
+ * not write here, nobody has configured a provider, they could configure one themselves, or the
252
+ * answer has not arrived yet. A single boolean would collapse the setup card, the no-access card
253
+ * and the cold reload into one blank.
254
+ */
255
+ interface CopilotAvailability {
256
+ /** Whether the viewer may configure a provider themselves: an owner or an admin. */
257
+ readonly canConfigure: boolean;
258
+ /** A provider is configured for this organization. */
259
+ readonly configured: boolean;
260
+ /** Neither answer has arrived; every flag above defaults false while this is true. */
261
+ readonly loading: boolean;
262
+ /** A provider is definitively NOT configured, which is not the same as not yet knowing. */
263
+ readonly notConfigured: boolean;
264
+ /** The viewer may write to this organization. */
265
+ readonly writable: boolean;
266
+ }
267
+ /**
268
+ * StudioCopilotSeam answers availability, and the model line to show, for ONE organization.
269
+ *
270
+ * The whole rule is the host's, and every part of it is something a licensee spells differently:
271
+ * which roles may configure a provider, whether a credential is on file, and what the resulting
272
+ * model is called. None of it is in the public contract, so the studio receives the answer
273
+ * rather than the fields it was derived from.
274
+ *
275
+ * A function per organization, like the billing gate, because the resource an operator is
276
+ * looking at decides which organization pays for the run. Its identity must be stable: it is
277
+ * called unconditionally in a surface's body and the host's implementation calls hooks.
278
+ */
279
+ type StudioCopilotSeam = (organizationId: string | undefined) => {
280
+ /** Whether the co-pilot may run for the organization, and why not. */
281
+ readonly availability: CopilotAvailability;
282
+ /** The provider and model a configured co-pilot runs on, for the panel's footer. */
283
+ readonly modelLine: string | null;
284
+ /**
285
+ * What the panel shows INSTEAD of the conversation when the host withholds the co-pilot from
286
+ * this organization, or null when nothing is withheld: for example "The co-pilot is not part
287
+ * of this organization's agreement."
288
+ *
289
+ * A ReactNode rather than a flag, because the words and any action beside them are the
290
+ * host's: the studio places the node and links nowhere, and the host attaches what its own
291
+ * product offers. And a node rather than a boolean beside it, because the two questions
292
+ * collapse: a host that withholds nothing has nothing to show, and null says both at once.
293
+ */
294
+ readonly withheldNotice: ReactNode | null;
295
+ /**
296
+ * The control that sends a reader who may configure a provider to wherever that is done, or
297
+ * null when this reader may not, or when the host has nowhere to send them.
298
+ *
299
+ * A ReactNode for the same reason the withheld notice is one, and one step further: not only the
300
+ * destination but the ROUTER that reaches it is the host's (an in-app link, a new tab, a modal
301
+ * over the studio are all reasonable and none is a studio's call). The setup card places
302
+ * whatever arrives and falls back to "ask an admin" when nothing does, which is also the
303
+ * right sentence for a reader whose role cannot configure anything.
304
+ */
305
+ readonly setupAction: ReactNode | null;
306
+ };
307
+ /** The props of {@link StudioCopilotProvider}. */
308
+ interface StudioCopilotProviderProps {
309
+ /** The surfaces that read the co-pilot's availability. */
310
+ readonly children: ReactNode;
311
+ /** The host's answer per organization. Its identity must be stable across renders. */
312
+ readonly seam: StudioCopilotSeam;
313
+ }
314
+ /** StudioCopilotProvider supplies the host's co-pilot binding to every surface beneath it. */
315
+ declare const StudioCopilotProvider: ({ children, seam }: StudioCopilotProviderProps) => react.JSX.Element;
316
+ /**
317
+ * useCopilotAvailability reports whether the co-pilot may run for a resource's organization.
318
+ *
319
+ * Like the zone edit gate and the share-link gate, an organization's resource is answered by a
320
+ * write role there, whoever created it. Unlike them, it has NO personal arm: the other two let
321
+ * the creator of a personal resource edit it, and this one is unavailable on personal content
322
+ * for everyone, its creator included. That is on purpose: the co-pilot spends an organization's
323
+ * own provider credential, and a personal resource has no organization to bill or to hold one.
324
+ * The asymmetry is the point: do not "fix" it by adding the personal arm the other two use.
325
+ *
326
+ * @param organizationId - The resource's organization, or undefined for a personal resource.
327
+ * @returns The host's {@link CopilotAvailability} for it, or one unavailable and settled where
328
+ * no host binding is mounted.
329
+ */
330
+ declare const useCopilotAvailability: (organizationId: string | undefined) => CopilotAvailability;
331
+ /** useCopilotModelLine names the provider and model a configured co-pilot runs on. */
332
+ declare const useCopilotModelLine: (organizationId: string | undefined) => string | null;
333
+ /**
334
+ * useCopilotWithheldNotice reads what the host shows in place of the conversation where it
335
+ * withholds the co-pilot from this organization, or null where it withholds nothing.
336
+ *
337
+ * The panel branches on the NODE rather than on an entitlement, because what an organization's
338
+ * agreement covers is the host's to know and to word: an entitlement read as "show a notice"
339
+ * would put the studio's words where the host's belong.
340
+ */
341
+ declare const useCopilotWithheldNotice: (organizationId: string | undefined) => ReactNode;
342
+ /**
343
+ * useCopilotSetupAction reads the control that opens the host's provider configuration.
344
+ *
345
+ * Null covers every way of having nothing to offer (this reader may not configure, the host
346
+ * has no configuration surface, or there is no organization in scope), and the setup card
347
+ * treats them identically, because the sentence a reader needs is the same in each: someone
348
+ * else has to set this up.
349
+ */
350
+ declare const useCopilotSetupAction: (organizationId: string | undefined) => ReactNode;
351
+
352
+ /**
353
+ * OrganizationScopeOption is one selectable scope in the sidenav's collections switcher: the
354
+ * organization id the listing is read for (null for the caller's personal scope), the human
355
+ * label the option renders, and the role the user holds there (also null for the personal
356
+ * scope, which is nobody's organization and so has no role). Derived rather than a wire type
357
+ * (the personal option carries a localized label rather than an organization name), so it is
358
+ * a plain hand-written interface.
359
+ */
360
+ interface OrganizationScopeOption {
361
+ /** The organization the listing is read for, or null for the personal scope. */
362
+ id: string | null;
363
+ /** What the option says. */
364
+ label: string;
365
+ /** The viewer's role in the organization, or null for the personal scope. */
366
+ role: OrganizationRole | null;
367
+ /**
368
+ * Why the scope offers its folders and nothing more, in the reader's words, such as an
369
+ * organization whose agreement does not include Map Studio. A switcher still offers the scope,
370
+ * so a reader can look at what is kept there, and shows the reason beside it. Absent for a
371
+ * scope that takes the studio's writes.
372
+ */
373
+ unavailableReason?: string | undefined;
374
+ }
375
+ /**
376
+ * WritableOrganizationOption is one selectable organization in the OrganizationSelect: its id
377
+ * (the wire `organization_id` a create forwards), the human label the option renders, and the
378
+ * role the user holds there, null for the personal space, which is nobody's organization and
379
+ * so has no role. That null is the single spelling of "this is the personal space": it drives
380
+ * both the option's glyph and its caption. Derived rather than a wire type (the personal
381
+ * option carries a localized label in place of the root organization's own name), so it is a
382
+ * plain hand-written interface.
383
+ */
384
+ interface WritableOrganizationOption {
385
+ /** The organization a create forwards as `organization_id`. */
386
+ id: string;
387
+ /** What the option says. */
388
+ label: string;
389
+ /** The viewer's role in the organization, or null for the personal space. */
390
+ role: OrganizationRole | null;
391
+ }
392
+ /**
393
+ * StudioOrganizations is the roster a studio's pickers and permission gates read.
394
+ *
395
+ * DATA rather than a hook, and already filtered rather than raw, for the reason
396
+ * `PublishableKeySeam` is: which organizations a viewer may write to is the host's rule, read off
397
+ * the role each membership `getMyOrganizations` answers carries. So the host applies the rule and
398
+ * hands back what survives, exactly as it hands back the keys an embed may use.
399
+ *
400
+ * Two halves because they answer different questions. `readable` is "whose folders may I look
401
+ * at" (the sidenav's scope switcher), and a viewer-role member belongs in it. `writable` is
402
+ * "where may I create things", and the same member does not.
403
+ */
404
+ interface StudioOrganizations extends StudioScopeSeam {
405
+ /**
406
+ * isPersonalScope answers whether an organization id means "the viewer's own", rather than a
407
+ * real organization.
408
+ *
409
+ * Restated here rather than only inherited from {@link StudioScopeSeam}: this is where the
410
+ * roster's readers meet it, and the extends clause is what lets the SAME object satisfy the
411
+ * handlers' scope seam so a host wires one thing and both layers ask one question.
412
+ *
413
+ * A PREDICATE rather than the root organization's id, because that is the only question its
414
+ * callers ask, and because personal scope has more than one spelling. The API says `null`,
415
+ * since a personal resource belongs to no organization; a form that has not picked one holds
416
+ * `undefined`; and a host whose own data names a shared root organization spells it with that
417
+ * UUID. Each is what some layer sends for the same thing, all three compile wherever one is
418
+ * expected, and picking the wrong one produces a listing scoped to nothing rather than an
419
+ * error. One predicate collapses them.
420
+ *
421
+ * A host with no notion of a shared root (every consumer's case) answers false for a real id
422
+ * and true for an absent one, which is the reading a personal-content model already has.
423
+ */
424
+ isPersonalScope(organizationId: string | null | undefined): boolean;
425
+ /**
426
+ * writeRefusal answers why the scope `organizationId` names refuses a write of `resource`, or
427
+ * null where it takes it: `personal` where the viewer's own space holds no such resource, and
428
+ * `agreement` where the organization's agreement does not include what the write needs.
429
+ *
430
+ * Restated from {@link StudioScopeSeam} for the reason {@link isPersonalScope} is: the handlers
431
+ * refuse the write by it, and every picker that offers a scope for a write reads it through
432
+ * {@link useStudioWritableOrganizations}, so a reader is never offered a scope the write is
433
+ * refused in. Left out, every scope takes every write.
434
+ */
435
+ writeRefusal?: ((resource: StudioWriteResource, organizationId: string | null | undefined) => StudioWriteRefusal | null) | undefined;
436
+ /** The scopes whose folders the viewer may look at, viewer-role memberships included. */
437
+ readonly readable: {
438
+ /** Whether the roster is still loading, which is not the same as holding no option. */
439
+ readonly isPending: boolean;
440
+ /** The scopes, as the switcher offers them. */
441
+ readonly options: readonly OrganizationScopeOption[];
442
+ };
443
+ /**
444
+ * The organizations the viewer may create in, and the write roles that decide who edits an
445
+ * itinerary or a zone: `writableOrgIds` is the set the editor's edits and the editing verbs
446
+ * read (`StudioScopeSeam.writable` of `@mountaya/studio`).
447
+ */
448
+ readonly writable: {
449
+ /** The organization a create preselects, or null for the personal space. */
450
+ readonly defaultOrganizationId: string | null;
451
+ /** The organizations a create may target, as the picker offers them. */
452
+ readonly options: readonly WritableOrganizationOption[];
453
+ /**
454
+ * Every organization id the viewer may write to: those in which they hold a write role (an
455
+ * owner, an admin or a contributor). A member whose role there reads only is not offered
456
+ * the edits of that organization's itineraries and zones.
457
+ *
458
+ * Never a shared root organization, where a host has one: it is shared by every user, so
459
+ * including it would grant an edit affordance to anyone rather than to a real membership. A
460
+ * consumer with no such organization has nothing to exclude.
461
+ */
462
+ readonly writableOrgIds: ReadonlySet<string>;
463
+ };
464
+ }
465
+ /** The props of {@link StudioOrganizationsProvider}. */
466
+ interface StudioOrganizationsProviderProps {
467
+ /** The surfaces that read the roster. */
468
+ readonly children: ReactNode;
469
+ /** The host's roster: the organizations the viewer reads and writes. */
470
+ readonly organizations: StudioOrganizations;
471
+ }
472
+ /** StudioOrganizationsProvider supplies the host's roster to every surface beneath it. */
473
+ declare const StudioOrganizationsProvider: ({ children, organizations, }: StudioOrganizationsProviderProps) => react.JSX.Element;
474
+ /** useStudioOrganizations reads the roster the host supplied, or the inert one where it states none. */
475
+ declare const useStudioOrganizations: () => StudioOrganizations;
476
+ /**
477
+ * StudioWritableOrganizations is what {@link useStudioWritableOrganizations} resolves for one
478
+ * resource: the organizations a write of it may target, the one a form preselects, and whether
479
+ * it has any target at all.
480
+ */
481
+ interface StudioWritableOrganizations {
482
+ /**
483
+ * Whether a write of the resource has anywhere to go: an organization to target, or the
484
+ * viewer's own space where it takes the resource. False where every scope refuses it, which is
485
+ * the reader's cue to say why rather than offer a form.
486
+ */
487
+ readonly available: boolean;
488
+ /**
489
+ * The organization a create preselects, or null for the viewer's own space: the scope the
490
+ * reader is browsing where the resource can be created there, then the roster's own default
491
+ * where it takes the resource, and otherwise the first option that does.
492
+ */
493
+ readonly defaultOrganizationId: string | null;
494
+ /** The organizations a write of the resource may target, as a picker offers them. */
495
+ readonly options: readonly WritableOrganizationOption[];
496
+ }
497
+ /**
498
+ * useStudioWritableOrganizations resolves the writable roster for one resource: the options a
499
+ * write of `resource` may target, each one the host's {@link StudioOrganizations.writeRefusal}
500
+ * takes it in, and the default a form preselects among them.
501
+ *
502
+ * The default is the scope the reader is browsing, as the studio's URL names it
503
+ * (`organization_id`, the personal space where it names none), wherever the picker offers it:
504
+ * a reader who switched to an organization creates there unless they pick another, as a
505
+ * collection created from the sidenav lands in the scope it lists. A scope the picker does not
506
+ * offer (one the reader only reads in, or the personal space for a resource it does not keep),
507
+ * and a studio whose host mirrors no URL, preselect the roster's own default.
508
+ *
509
+ * A roster whose host states no `writeRefusal` answers its writable half as it stands, and the
510
+ * viewer's own space as a target, which is the reading for a consumer whose every scope writes.
511
+ *
512
+ * @param resource - The resource the write creates.
513
+ * @returns The targets, the default and whether there is any.
514
+ */
515
+ declare const useStudioWritableOrganizations: (resource: StudioWriteResource) => StudioWritableOrganizations;
516
+
517
+ /**
518
+ * The React delivery of the plugin engine.
519
+ *
520
+ * The contract and the machine are `@mountaya/studio/plugins`', framework-free, so a Dart or
521
+ * Swift studio reimplements one vocabulary rather than inventing three. What is here is the
522
+ * binding: the view type bound to `ReactNode`, and the context that carries the engine down to
523
+ * the menus and rails that render out of it.
524
+ */
525
+ /**
526
+ * StudioReactPlugin is a plugin whose views are React nodes.
527
+ *
528
+ * One alias rather than a generic argument at every call site, which is the same treatment
529
+ * `StudioTool` gets one package down. `StudioPlugin` (with its `never` default) is exactly the
530
+ * tools-only plugin and stays assignable to this, because `TView` appears only in output
531
+ * position, so a render-free plugin written against the base type installs here unchanged.
532
+ */
533
+ type StudioReactPlugin = StudioPlugin<ReactNode>;
534
+ /** StudioReactPluginContribution is one contribution to one slot, with React as the view type. */
535
+ type StudioReactPluginContribution = StudioPluginContribution<ReactNode>;
536
+ /** StudioReactPluginEntry is a contribution as the registry holds it: plus its plugin and rank. */
537
+ type StudioReactPluginEntry = StudioPluginEntry<ReactNode>;
538
+ /**
539
+ * StudioReactPluginSubject is WHICH contribution a report is about: everything that identifies
540
+ * one, with the verb left off. See {@link StudioPluginSubject} for why the verb is not here.
541
+ */
542
+ type StudioReactPluginSubject = StudioPluginSubject<ReactNode>;
543
+ /**
544
+ * StudioPluginFailure is one way a plugin failed, with everything that failure has to say about
545
+ * itself and nothing it does not.
546
+ *
547
+ * A DISCRIMINATED UNION on `kind`, and one object rather than a list of positional arguments:
548
+ * the shape `StudioPluginRunEvent` already uses one package down, for the same reason. The
549
+ * kinds carry genuinely different things, and the alternative spellings both leak: a union in
550
+ * an argument position makes a host write `"qualifiedId" in subject`, and a flat object with
551
+ * optional members makes them check for a value that is always there for the kind they are
552
+ * handling.
553
+ *
554
+ * - `install`: the registry REFUSED a declaration. There is no resolved contribution to name,
555
+ * because producing one is exactly what the refusal prevented, so the declaration comes instead.
556
+ * `isStudioPluginError(failure.error)` narrows it and gives you every `defect`.
557
+ * - `run`: a contribution's verb threw or rejected. The registry caught it; the outcome was
558
+ * reported to any observer as `threw`.
559
+ * - `view`: a contribution's `view` threw during render, and its boundary drew nothing in its
560
+ * place. `info` is React's own, and its component stack says where INSIDE the plugin's view it
561
+ * broke, the one question `contribution` cannot answer.
562
+ *
563
+ * `error` is always the value the plugin actually threw. Nothing here wraps it, so whatever a host
564
+ * narrows on still works.
565
+ */
566
+ type StudioPluginFailure = {
567
+ readonly error: unknown;
568
+ readonly kind: "install";
569
+ readonly plugin: StudioReactPlugin;
570
+ } | {
571
+ /** The contribution whose verb failed. */
572
+ readonly contribution: StudioReactPluginSubject;
573
+ /** What the verb threw or rejected with. */
574
+ readonly error: unknown;
575
+ readonly kind: "run";
576
+ } | {
577
+ /** The contribution whose view failed. */
578
+ readonly contribution: StudioReactPluginSubject;
579
+ /** What the view threw. */
580
+ readonly error: unknown;
581
+ /** React's own report, whose component stack says where inside the view it broke. */
582
+ readonly info: ErrorInfo;
583
+ readonly kind: "view";
584
+ };
585
+ /**
586
+ * StudioPluginErrorReporter is how a host hears that a plugin failed.
587
+ *
588
+ * One parameter, so the simplest useful handler is `({ error }) => log(error)` and the complete
589
+ * one is a `switch` on `kind` that the compiler checks for exhaustiveness. See
590
+ * {@link StudioPluginFailure} for what each kind carries.
591
+ */
592
+ type StudioPluginErrorReporter = (failure: StudioPluginFailure) => void;
593
+ /**
594
+ * StudioPluginsBinding is what the context carries: the plugin engine, and where a failure goes.
595
+ *
596
+ * One object rather than two contexts, because the two are always supplied together and always
597
+ * read together: a renderer that resolves a slot is the same renderer that reports a throw out
598
+ * of it.
599
+ *
600
+ * Both members are REQUIRED and both are stable for the life of the mount, which is what lets
601
+ * every renderer beneath take `onError` out of its dependency arrays. "The host supplied none" is
602
+ * a no-op inside the dispatcher rather than an absent member: the difference between the two is
603
+ * a context value whose identity changes on every host render and one that never changes at all.
604
+ */
605
+ interface StudioPluginsBinding {
606
+ /** Where a failed plugin is reported. A host that supplied none gets a dispatcher that does nothing. */
607
+ readonly onError: StudioPluginErrorReporter;
608
+ /** The registry the host installs plugins into. */
609
+ readonly engine: StudioPluginEngine<ReactNode>;
610
+ }
611
+ /** The props of {@link StudioPluginsProvider}. */
612
+ interface StudioPluginsProviderProps {
613
+ /** The surfaces that read the registry. */
614
+ readonly children: ReactNode;
615
+ /** The registry the host installs plugins into, and how it reports a refused one. */
616
+ readonly plugins: StudioPluginsBinding;
617
+ }
618
+ /**
619
+ * StudioPluginsProvider supplies the registry to everything beneath it.
620
+ *
621
+ * `MountayaStudioHost` mounts this UNCONDITIONALLY, which is the deliberate difference from the
622
+ * seam providers beside it. Those mount only when given a value so a nested host inherits an
623
+ * enclosing ANSWER (a notifier, a router), and that is right for an answer and wrong for a
624
+ * REGISTER TARGET: inheriting one would make `plugins={{ install: [] }}` indistinguishable from
625
+ * omitting it, and would let an install under a nested host escape into the enclosing one. It is
626
+ * the same argument `StudioHostContext` already makes for the bus.
627
+ */
628
+ declare const StudioPluginsProvider: ({ children, plugins }: StudioPluginsProviderProps) => react.JSX.Element;
629
+ /**
630
+ * useStudioPlugins reads the host's plugin engine, for installing and uninstalling at runtime.
631
+ *
632
+ * It THROWS outside a host, which is the rule the other host-shaped hooks here follow and the
633
+ * opposite of {@link usePluginSlot}'s, and names both remedies: `MountayaStudioHost`, which mounts
634
+ * the registry, and a {@link StudioPluginsProvider} handed one. A register call that goes nowhere
635
+ * has NO SYMPTOM: it succeeds, nothing is installed, and the menu item the consumer was adding is
636
+ * simply missing, which reads as the studio being broken rather than as a provider being absent. A
637
+ * menu, by contrast, still has to render inside a story or a test, so the read is inert and this
638
+ * one is not.
639
+ *
640
+ * @returns The engine the host installs plugins into.
641
+ * @throws {MountayaElementsError} When no host or {@link StudioPluginsProvider} is mounted above
642
+ * the caller.
643
+ */
644
+ declare const useStudioPlugins: () => StudioPluginEngine<ReactNode>;
645
+
646
+ /**
647
+ * StudioDensity is how tightly the studio draws its own regions.
648
+ *
649
+ * `compact` is the default: a map studio is chrome over a map, and its panels, forms and
650
+ * conversation are read at a glance beside the thing they act on rather than filled in like a
651
+ * page. `comfortable` steps every region up to Mantine's own baseline, which is the right answer
652
+ * for a consumer embedding the studio in an application whose forms are all full-page.
653
+ */
654
+ type StudioDensity = "comfortable" | "compact";
655
+
656
+ /**
657
+ * studioTokens is every `--mtya-*` custom property the studio and the elements beneath it read,
658
+ * with the value each one falls back to.
659
+ *
660
+ * The elements' half is SPREAD rather than restated. `elementsTokens` in
661
+ * `@mountaya/elements-react` is the declaration of the names the element roots assign; this file
662
+ * adds the studio's own on top, and the result is the complete list a consumer of an assembled
663
+ * studio overrides against. `theme/rules/tokens.test.ts` holds this list against the studio's
664
+ * sheet in both directions: every token declared here is assigned, and every token read is
665
+ * declared.
666
+ *
667
+ * **They are a second seam beside the Mantine theme, not a duplicate of it.** A theme is how a
668
+ * consumer states a brand to Mantine's own components; these are how the studio's hand-written
669
+ * surfaces and every element it mounts are drawn, and those surfaces render no Mantine component
670
+ * at all: a map control is a `<button>` on a canvas, and a theme has nothing to say about it.
671
+ *
672
+ * The values are the studio's LIGHT scheme. The dark scheme is a small override the sheet
673
+ * applies under `[data-mtya-color-scheme="dark"]` rather than a second map here, because the
674
+ * tokens that differ are a handful and a second full copy is two lists to keep in step.
675
+ */
676
+ declare const studioTokens: {
677
+ readonly "--mtya-activity-badge-bg": "rgba(0, 0, 0, 0.04)";
678
+ readonly "--mtya-activity-badge-size": "1.75rem";
679
+ readonly "--mtya-activity-glyph-color": "rgb(100, 116, 139)";
680
+ readonly "--mtya-activity-glyph-size": "1rem";
681
+ readonly "--mtya-brand-font": "inherit";
682
+ readonly "--mtya-focus-ring-color": "#339af0";
683
+ readonly "--mtya-focus-ring-offset": "2px";
684
+ readonly "--mtya-focus-ring-width": "2px";
685
+ readonly "--mtya-layer-thumb-height": "52px";
686
+ readonly "--mtya-layer-thumb-height-sm": "40px";
687
+ readonly "--mtya-place-mark-color": "#3b82f6";
688
+ readonly "--mtya-place-mark-size": "28px";
689
+ readonly "--mtya-search-input-color": "#404040";
690
+ readonly "--mtya-search-input-color-dark": "var(--mantine-color-dark-0)";
691
+ readonly "--mtya-search-input-held-bg": "var(--mantine-color-gray-1)";
692
+ readonly "--mtya-search-input-held-bg-dark": "var(--mantine-color-dark-5)";
693
+ readonly "--mtya-search-row-hover-bg": "var(--mantine-color-gray-1)";
694
+ readonly "--mtya-search-row-selected-bg": "var(--mantine-color-blue-light)";
695
+ readonly "--mtya-segment-swatch-radius": "50%";
696
+ readonly "--mtya-accent": "#1c7ed6";
697
+ readonly "--mtya-control-bg": "#ffffff";
698
+ readonly "--mtya-control-bg-hover": "#f1f3f5";
699
+ readonly "--mtya-control-fg": "#212529";
700
+ readonly "--mtya-control-fg-disabled": "#adb5bd";
701
+ readonly "--mtya-control-gap": "4px";
702
+ readonly "--mtya-control-radius": "8px";
703
+ readonly "--mtya-control-shadow": "0 1px 3px rgb(0 0 0 / 5%), 0 1px 2px rgb(0 0 0 / 10%)";
704
+ readonly "--mtya-control-size": "36px";
705
+ readonly "--mtya-dimmed": "#868e96";
706
+ readonly "--mtya-edge-inset": "16px";
707
+ readonly "--mtya-focus-ring": "#1c7ed6";
708
+ readonly "--mtya-font": "system-ui, -apple-system, \"Segoe UI\", roboto, sans-serif";
709
+ readonly "--mtya-panel-bg": "#ffffff";
710
+ readonly "--mtya-panel-border": "#dee2e6";
711
+ readonly "--mtya-panel-fg": "#212529";
712
+ readonly "--mtya-panel-radius": "12px";
713
+ readonly "--mtya-panel-width": "340px";
714
+ readonly "--mtya-profile-axis-font-size": "11px";
715
+ readonly "--mtya-profile-axis-size": "68px";
716
+ readonly "--mtya-profile-band-size": "8px";
717
+ readonly "--mtya-profile-chart-size": "120px";
718
+ readonly "--mtya-profile-cursor": "#212529";
719
+ readonly "--mtya-profile-cursor-dash": "3 3";
720
+ readonly "--mtya-profile-grid-color": "#dee2e6";
721
+ readonly "--mtya-profile-lit-fill": "rgb(233 80 30 / 12%)";
722
+ readonly "--mtya-profile-navigator-handle": "#212529";
723
+ readonly "--mtya-profile-navigator-size": "36px";
724
+ readonly "--mtya-profile-navigator-veil": "rgb(255 255 255 / 62%)";
725
+ readonly "--mtya-profile-padding": "12px 16px";
726
+ readonly "--mtya-profile-section-gap": "4px";
727
+ readonly "--mtya-profile-tooltip-bg": "#ffffff";
728
+ readonly "--mtya-profile-tooltip-fg": "#212529";
729
+ readonly "--mtya-profile-tooltip-shadow": "0 2px 8px rgb(0 0 0 / 12%)";
730
+ readonly "--mtya-profile-waypoint-color": "#868e96";
731
+ readonly "--mtya-profile-waypoint-line": "1px dashed #adb5bd";
732
+ readonly "--mtya-profile-waypoint-open-size": "24px";
733
+ readonly "--mtya-profile-waypoint-size": "8px";
734
+ readonly "--mtya-profile-xaxis-size": "34px";
735
+ readonly "--mtya-table-border": "#dee2e6";
736
+ readonly "--mtya-table-card-gap": "8px";
737
+ readonly "--mtya-table-cell-padding": "8px 12px";
738
+ readonly "--mtya-table-font-size": "13px";
739
+ readonly "--mtya-table-header-font-size": "11px";
740
+ readonly "--mtya-table-padding": "12px 16px";
741
+ readonly "--mtya-table-row-hover": "#f1f3f5";
742
+ readonly "--mtya-table-spark-base": "#dee2e6";
743
+ readonly "--mtya-table-spark-inline-size": "140px";
744
+ readonly "--mtya-table-spark-size": "28px";
745
+ readonly "--mtya-tooltip-bg": "#212529";
746
+ readonly "--mtya-tooltip-fg": "#ffffff";
747
+ readonly "--mtya-waypoint-card-gap": "16px";
748
+ readonly "--mtya-waypoint-card-mark-color": "#3b82f6";
749
+ readonly "--mtya-waypoint-card-mark-fg": "#ffffff";
750
+ readonly "--mtya-waypoint-card-mark-size": "36px";
751
+ };
752
+ /**
753
+ * One token name, derived from {@link studioTokens} so the two cannot drift, which means it
754
+ * covers the elements' names too, because the map spreads them.
755
+ *
756
+ * A closed union rather than `string`, which is what makes a typo a compile error: a `tokens`
757
+ * prop carrying `--mtya-panel-raduis` is otherwise a declaration that lands, inherits, and
758
+ * paints nothing, with no failure anywhere.
759
+ */
760
+ type StudioTokenName = keyof typeof studioTokens;
761
+ /**
762
+ * StudioTokens is a consumer's overrides, at whatever subset they care to state.
763
+ *
764
+ * Values stay STRINGS even where the default is a length: they land in a `style` object as CSS
765
+ * custom properties, and a number there is written with no unit (`--mtya-control-size: 36`
766
+ * paints nothing and reports nothing).
767
+ */
768
+ type StudioTokens = Partial<Record<StudioTokenName, string>>;
769
+
770
+ /**
771
+ * What a studio surface reads: the tool bus it dispatches through, and the seams a studio
772
+ * needs that a control does not.
773
+ *
774
+ * `@mountaya/elements-react`'s root provider carries what an ELEMENT needs: a map, a glyph set,
775
+ * copy. A studio needs more, and each is something an element never has an opinion about:
776
+ *
777
+ * - **the bus**, because a studio's job is to change things, and every change goes through
778
+ * one dispatch surface. It is `@mountaya/studio`'s `ToolBus`, generic over the
779
+ * context a host supplies, so what a consumer registers is theirs and the validation, the
780
+ * capability gate and the confirmation protocol are ours.
781
+ * - **the capabilities** the surface holds, which is how one component tree serves an editor,
782
+ * a viewer and an embed. A read-only surface is not a different tree with the buttons
783
+ * deleted; it is this tree with a smaller set.
784
+ * - **navigation**, because a studio moves between resources and every router disagrees about
785
+ * how. Two functions is the whole seam.
786
+ * - **the activity catalog**, because half the studio's surfaces name an activity and none of
787
+ * them should fetch one. It is data rather than a seam (the host reads it once and hands it
788
+ * down, exactly as it hands down the capabilities), and it is here rather than on the tool
789
+ * context because only React surfaces read it: a handler that needs the catalog reads it
790
+ * through `ctx.api.cache`, where it is already keyed.
791
+ * - **the store**, the studio's own state instance. `@mountaya/studio` composes it
792
+ * and `createUiStore()` builds one; what a host chooses is WHICH instance, because the same
793
+ * object is what the tool bus mutates through its context. A surface reading one store while
794
+ * the bus writes another is a studio that ignores its own edits.
795
+ *
796
+ * NOT here, on purpose: a query client. Data binding is `@mountaya/client-react`'s, and a
797
+ * second provider that also knew how to fetch would be the third data layer in one tree.
798
+ */
799
+
800
+ /**
801
+ * StudioLayerKind names which catalogue a slug belongs to.
802
+ *
803
+ * Two kinds, because they are two lists a reader chooses from separately (a base map is
804
+ * exclusive and an overlay is not), and their slugs share a namespace with nothing keeping them
805
+ * apart. A host serving both from one directory would silently answer a terrain's picture for
806
+ * an overlay of the same name.
807
+ */
808
+ type StudioLayerKind = "overlay" | "terrain";
809
+ /**
810
+ * NavigationSeam is how a studio surface moves, without naming a router.
811
+ *
812
+ * `navigate` takes a path the surface built and a `replace` flag, because a studio
813
+ * distinguishes a step the user should be able to go back through (opening an itinerary) from
814
+ * one they should not (normalising a URL after a rename). `location` reads the current path,
815
+ * which is what a surface highlighting its own row needs.
816
+ *
817
+ * A path rather than a route object: a route object is a router's vocabulary, and adopting one
818
+ * would make this seam a re-export of somebody's types rather than a seam.
819
+ */
820
+ interface NavigationSeam {
821
+ /** Reads the current path. */
822
+ readonly location: () => string;
823
+ /** Moves to `path`, replacing the current entry where `replace` is true. */
824
+ readonly navigate: (path: string, options?: {
825
+ readonly replace?: boolean | undefined;
826
+ }) => void;
827
+ }
828
+ /**
829
+ * StudioControlKind names a control the studio's panels have to point back at.
830
+ *
831
+ * Closed rather than a string, because the register and the read are written in two different
832
+ * files and a typo in either is silent: the panel exempts nothing, the toggle closes it, and the
833
+ * button's own handler reopens it a frame later, which reads as a panel that flickers rather
834
+ * than as a name that did not match.
835
+ */
836
+ type StudioControlKind = "layers" | "preferences";
837
+ /**
838
+ * StudioControlAnchors is where a floating panel finds the toggle that opened it.
839
+ *
840
+ * A panel positioned somewhere ELSE on the page has to exempt its own toggle from its
841
+ * outside-click handler, or a press closes the panel and the button's handler immediately
842
+ * reopens it. Not a `document.querySelector` on the toggle's `data-mtya-control`, which looks
843
+ * equivalent and is not: it finds the FIRST match in the document, so two studios on one page
844
+ * would exempt each other's button, and it finds nothing at all across a shadow root.
845
+ *
846
+ * Backed by a ref rather than by state, because registering is not a render: a control mounting
847
+ * must not render every surface under the provider again, and the panel reads the anchor during
848
+ * its own render, which always happens after the toggle that opened it mounted.
849
+ */
850
+ interface StudioControlAnchors {
851
+ /** The element a panel's outside-click must not treat as outside, or null. */
852
+ readonly anchorFor: (kind: StudioControlKind) => HTMLElement | null;
853
+ /** Records the element a control occupies, or clears it with null on teardown. */
854
+ readonly register: (kind: StudioControlKind, element: HTMLElement | null) => void;
855
+ }
856
+ /**
857
+ * StudioContextValue is what {@link useStudioContext} resolves: the bus, the tool context, the
858
+ * store and every seam a studio surface reads.
859
+ *
860
+ * `TCtx` is the host's own tool context, the object its handlers receive and the one part of a
861
+ * bus this package cannot know.
862
+ *
863
+ * `TInputs` is the name-to-input map `bus.dispatch` is checked against. It defaults to
864
+ * `ToolDispatchRegistry`, the empty interface a host augments, which fits a host that registered
865
+ * its own tools. A caller that knows the tools it dispatches names that map instead
866
+ * (`StudioToolInputs` for the studio's own) and gets a checked `dispatch` with no global
867
+ * augmented on anyone's behalf.
868
+ *
869
+ * `TOutputs` is the name-to-data map `bus.dispatch` answers by. It defaults to
870
+ * `ToolOutputRegistry`, the second interface a host augments, under which every answer's `data`
871
+ * reads `unknown` until the host merges its outputs. A caller that names a map
872
+ * (`StudioToolOutputs` for the studio's own) takes a member of `result.data` after `result.ok`
873
+ * with no narrowing of its own. The map is a way of reading the bus and no part of its identity:
874
+ * the provider holds one dispatch slice, and each reader types the answers it reads.
875
+ */
876
+ interface StudioContextValue<TCtx extends ToolBusContext = ToolBusContext, TInputs extends object = ToolDispatchRegistry, TOutputs extends object = ToolOutputRegistry> {
877
+ /** The activity catalog, empty where the host supplied none. */
878
+ readonly activities: readonly CategoryActivities[];
879
+ /** Where an activity's silhouette is fetched as an image, or null where the host said none. */
880
+ readonly activityIconUrl: ((slug: string) => string | undefined) | null;
881
+ /** The picture of a map layer, or null where the host said none. */
882
+ readonly layerThumbnail: ((kind: StudioLayerKind, slug: string) => string | undefined) | null;
883
+ /** The origin a link that leaves the tab is built from, or null for the page's own. */
884
+ readonly appOrigin: string | null;
885
+ /** The bus every dispatch runs through, or null where none is mounted. */
886
+ readonly bus: (ToolBusDispatch<TCtx, TInputs, TOutputs> & ToolBusObserveOverrides) | null;
887
+ /** What this studio grants. */
888
+ readonly capabilities: ReadonlySet<ToolCapability>;
889
+ /** The tool context each verb is handed, or null where none is mounted. */
890
+ readonly context: TCtx | null;
891
+ /** The elevation raster the maps bake their relief from, or undefined for flat relief. */
892
+ readonly demUrl: string | undefined;
893
+ /**
894
+ * What the host put in place of the studio's lockup: `undefined` where nothing is configured,
895
+ * unlike every other member here, because `null` is a VALUE on this seam (it hides the
896
+ * header), and folding the two together would make "no header" and "the Mountaya header" the
897
+ * same read.
898
+ */
899
+ readonly header: StudioHeaderOverride | undefined;
900
+ /** The mark a language picker draws beside each language, or null for none. */
901
+ readonly languageMark: ((language: MapLanguage) => ReactNode) | null;
902
+ /** The languages the studio's pickers offer, each labelled by its endonym. */
903
+ readonly languages: readonly {
904
+ label: string;
905
+ value: MapLanguage;
906
+ }[];
907
+ /** How a surface moves, or null where the host supplied no router. */
908
+ readonly navigation: NavigationSeam | null;
909
+ /** How a collaborator's id becomes a name, or null where the host supplied no directory. */
910
+ readonly resolvePeerName: StudioPeerNameSeam | null;
911
+ /** Where a floating panel finds the toggle that opened it. */
912
+ readonly controlAnchors: StudioControlAnchors;
913
+ /** How tightly the studio draws its own regions. */
914
+ readonly density: StudioDensity;
915
+ /** The `--mtya-*` overrides the host declared, or null for none. */
916
+ readonly tokens: StudioTokens | null;
917
+ /** The capabilities the studio takes from the world around it, folded onto the defaults. */
918
+ readonly seams: StudioSeams;
919
+ /** The studio's state, or null where no store is mounted. */
920
+ readonly store: UiStoreApi | null;
921
+ /** The studio's own words, in the selected language with every override merged. */
922
+ readonly strings: StudioStrings;
923
+ }
924
+ /**
925
+ * StudioSeamOverrides is the `seams` a host states: any of {@link StudioSeams}' members, each
926
+ * present, left out, or written as `undefined`.
927
+ *
928
+ * A member left out or written as `undefined` keeps the default seam of
929
+ * `createDefaultStudioSeams`, so a host forwards a seam it may not hold
930
+ * (`storage: remember ? accountStorage : undefined`) and the studio still has one. Each member
931
+ * states `undefined`, so that line compiles under `exactOptionalPropertyTypes`, which
932
+ * `Partial<StudioSeams>` refuses.
933
+ *
934
+ * The whole set is assignable to it: `createInertStudioSeams()` switches every capability off
935
+ * at once.
936
+ *
937
+ * A provider holds the object for as long as its own members are the ones the render before
938
+ * stated, compared one level deep by `Object.is`. So the object may be written inline, and a
939
+ * member is declared once: a seam built inline is a new one at every render, and the set is
940
+ * folded again for it.
941
+ */
942
+ interface StudioSeamOverrides {
943
+ /**
944
+ * Where a Camera Plan is resolved into per-frame poses, and therefore on which thread.
945
+ *
946
+ * @default `synchronousCameraPlanner()`
947
+ */
948
+ readonly cameraPlanner?: StudioSeams["cameraPlanner"] | undefined;
949
+ /**
950
+ * Where a product-meaningful moment or delay comes from.
951
+ *
952
+ * @default `systemClock()`
953
+ */
954
+ readonly clock?: StudioSeams["clock"] | undefined;
955
+ /**
956
+ * How a number, a date and a relative moment reach a screen.
957
+ *
958
+ * @default `createIntlFormatters(locale)`, in the provider's locale
959
+ */
960
+ readonly formatters?: StudioSeams["formatters"] | undefined;
961
+ /**
962
+ * Where a device fix comes from, and whether asking would prompt.
963
+ *
964
+ * @default `browserGeolocation()`
965
+ */
966
+ readonly geolocation?: StudioSeams["geolocation"] | undefined;
967
+ /**
968
+ * Where a client-side id comes from, for a draft that has no resource to name yet.
969
+ *
970
+ * @default `systemStudioIds`
971
+ */
972
+ readonly ids?: StudioSeams["ids"] | undefined;
973
+ /**
974
+ * Where a link to somewhere outside the product goes, or that there is none.
975
+ *
976
+ * @default `googleMapsLinks`
977
+ */
978
+ readonly links?: StudioSeams["links"] | undefined;
979
+ /**
980
+ * Where a file the studio produced goes: a disk, a share sheet, or nowhere.
981
+ *
982
+ * @default `browserSaveFile`
983
+ */
984
+ readonly saveFile?: StudioSeams["saveFile"] | undefined;
985
+ /**
986
+ * Where a preference that outlives a session is kept.
987
+ *
988
+ * @default `localStudioStorage()`
989
+ */
990
+ readonly storage?: StudioSeams["storage"] | undefined;
991
+ }
992
+ /**
993
+ * StudioProviderProps is what a consumer configures the headless studio through.
994
+ *
995
+ * The SAME groups `MountayaStudioHost` takes, out of the same types, which is the point rather
996
+ * than a tidiness: `@mountaya/studio-react/headless` is offered as "our verbs, your design
997
+ * system", and a second spelling here would have a consumer moving over from the assembled
998
+ * studio learn again every decision they have already made. A Dart or Swift port declares one
999
+ * set of structs and both of its surfaces take them.
1000
+ *
1001
+ * The groups are the SHARED halves rather than the host's. `appearance` carries no Mantine
1002
+ * theme, because this path brings no design system; `behavior` carries no handlers or
1003
+ * recognizers, because this path brings its own bus. Those are the two things that genuinely
1004
+ * differ between the surfaces, and the type difference says so rather than a paragraph.
1005
+ *
1006
+ * `bus`, `context` and `store` stay on `data` beside the catalog and the grants: they are what
1007
+ * this provider is HANDED rather than what it builds, which is the whole of what "headless"
1008
+ * means here.
1009
+ */
1010
+ interface StudioProviderProps<TCtx extends ToolBusContext = ToolBusContext> {
1011
+ /** What it looks like: the scheme, the density, the tokens, the canvas paint. */
1012
+ readonly appearance?: StudioAppearanceConfig | undefined;
1013
+ /** Where the pictures come from: the glyph tables, the relief raster, the activity artwork. */
1014
+ readonly assets?: StudioAssetsConfig | undefined;
1015
+ /** What the studio does, and what you do instead: `seams`, the router, the peer names. */
1016
+ readonly behavior?: StudioBehaviorConfig | undefined;
1017
+ /** The surfaces that read the studio. */
1018
+ readonly children: ReactNode;
1019
+ /** What the studio is showing and to whom, plus the bus, the context and the store. */
1020
+ readonly data?: StudioProviderDataConfig<TCtx> | undefined;
1021
+ /** Which words, and which regional conventions: the language, the locale, both bundles. */
1022
+ readonly i18n?: StudioI18nConfig | undefined;
1023
+ }
1024
+ /**
1025
+ * What the headless provider is SHOWN, plus what it is handed rather than builds.
1026
+ *
1027
+ * `bus` and `context` have no counterpart on the host's `data`, and that asymmetry is the
1028
+ * difference between the two surfaces stated in a type: the host builds a bus out of the
1029
+ * handlers and recognizers it was given, and this provider takes one.
1030
+ *
1031
+ * `capabilities` is read as the host hands it. An array or a set is read at every render of the
1032
+ * provider, so one a host mutates in place is followed from the next render. An iterator (what
1033
+ * `grants.values()` hands over) yields its members once: the provider reads it once and holds
1034
+ * its members for as long as the host hands the same object.
1035
+ */
1036
+ interface StudioProviderDataConfig<TCtx extends ToolBusContext = ToolBusContext> extends StudioDataConfig {
1037
+ /** The tool bus every dispatch beneath this provider runs through. */
1038
+ readonly bus?: (ToolBusDispatch<TCtx> & ToolBusObserveOverrides) | null | undefined;
1039
+ /** The tool context handlers receive. Omit it and every action becomes a no-op. */
1040
+ readonly context?: TCtx | null | undefined;
1041
+ }
1042
+ /**
1043
+ * StudioProvider supplies the studio's bus, store, tool context and settings to everything under
1044
+ * it.
1045
+ *
1046
+ * It composes WITH `MountayaElementsProvider` rather than replacing it: a studio needs a map,
1047
+ * glyphs and copy too, and duplicating those here would give a consumer two places to set an
1048
+ * icon table. Mount both; order does not matter.
1049
+ */
1050
+ declare const StudioProvider: <TCtx extends ToolBusContext = ToolBusContext>(grouped: StudioProviderProps<TCtx>) => ReactNode;
1051
+ /**
1052
+ * useStudioToolContext reads the host's own tool context: the seam bag a handler receives.
1053
+ *
1054
+ * It THROWS outside a provider carrying one, as `useStudioHostRegistry` does and for the same
1055
+ * reason: this is host-shaped WIRING rather than an affordance. A surface reaching for the raw
1056
+ * context is passing it somewhere (an agent session, a bridge, a chained dispatch), and a null
1057
+ * threaded into one of those has no symptom: the call succeeds, does nothing, and the studio
1058
+ * quietly stops responding. A read whose absence degrades into something visible answers inertly
1059
+ * instead.
1060
+ *
1061
+ * Reach for it only when nothing narrower will do. `useStudioDispatch` runs a verb,
1062
+ * `useUiStoreApi` reads the store at call time, `useCapability` answers a grant: each of those
1063
+ * is the same question asked in a way that cannot be threaded somewhere wrong.
1064
+ *
1065
+ * @returns The tool context, typed as the caller names it.
1066
+ * @throws {MountayaElementsError} When no provider above the caller carries a tool context.
1067
+ */
1068
+ declare const useStudioToolContext: <TCtx extends ToolBusContext = ToolBusContext>() => TCtx;
1069
+ /**
1070
+ * useStudioContext reads everything the nearest {@link StudioProvider} holds: the bus, the tool
1071
+ * context, the store and the seams. Outside a provider it answers the inert default and never
1072
+ * throws.
1073
+ *
1074
+ * It renders its caller whenever any of those moves. A reader of one part takes the hook that
1075
+ * reads it ({@link useCapability}, {@link useStudioStrings}, `useUiStore`, `useStudioDispatch`),
1076
+ * which renders it for that part alone.
1077
+ *
1078
+ * The three type arguments are the reader's, as {@link StudioContextValue} describes them: the
1079
+ * host's tool context, the inputs `bus.dispatch` is checked against and the outputs it answers
1080
+ * by. A reader of the studio's own verbs names `StudioToolInputs` and `StudioToolOutputs`, and
1081
+ * `useStudioDispatch` is that reader already written.
1082
+ *
1083
+ * @example
1084
+ * ```tsx
1085
+ * declare const itineraryId: string;
1086
+ *
1087
+ * const { bus, context } = useStudioContext<
1088
+ * StudioToolContext,
1089
+ * StudioToolInputs,
1090
+ * StudioToolOutputs
1091
+ * >();
1092
+ *
1093
+ * const rename = async (name: string) => {
1094
+ * if (bus === null || context === null) {
1095
+ * return;
1096
+ * }
1097
+ *
1098
+ * const result = await bus.dispatch(context, "studio.itinerary.rename", { itineraryId, name });
1099
+ * console.log(result.ok ? result.summary : result.error);
1100
+ * };
1101
+ * ```
1102
+ */
1103
+ declare const useStudioContext: <TCtx extends ToolBusContext = ToolBusContext, TInputs extends object = ToolDispatchRegistry, TOutputs extends object = ToolOutputRegistry>() => StudioContextValue<TCtx, TInputs, TOutputs>;
1104
+ /**
1105
+ * useStudioActivities reads the activity catalog the host resolved.
1106
+ *
1107
+ * Every surface that names an activity (the picker, the segment list's engine hint, the
1108
+ * elevation panel's speed default, the suggest form's seed) reads it here rather than fetching
1109
+ * one. The catalog is the same for the whole tree and changes about as often as a deploy, so a
1110
+ * component reaching for it independently would be the same request repeated behind a cache
1111
+ * whose absence nothing would notice.
1112
+ *
1113
+ * Always an array, never undefined: a surface outside a provider gets an empty catalog, which
1114
+ * is what an activity picker with no options and a row naming its activity by id already do.
1115
+ * The distinction between "loading" and "loaded empty" belongs to whoever holds the query, and
1116
+ * no surface here branches on it.
1117
+ */
1118
+ declare const useStudioActivities: () => readonly CategoryActivities[];
1119
+ /**
1120
+ * useStudioDemUrl reads the elevation raster the host supplied, for a surface that seeds its own
1121
+ * map rather than going through {@link useStudioMapSync}.
1122
+ *
1123
+ * `undefined` outside a provider and inside one that supplied none: the same answer, because
1124
+ * they mean the same thing: render the relief flat.
1125
+ */
1126
+ declare const useStudioDemUrl: () => string | undefined;
1127
+ /**
1128
+ * useStudioHeader reads what the host put in place of the studio's own brand lockup.
1129
+ *
1130
+ * Three answers rather than two, and keeping them apart is the whole reason this hook does not
1131
+ * collapse to `?? null` the way its neighbours do:
1132
+ *
1133
+ * - `undefined`, "not configured": the Mountaya lockup stands. Outside a provider too,
1134
+ * which is the same answer for the same reason: a header rendered in a story or a print view
1135
+ * is still this package's header.
1136
+ * - `null`: the host asked for NO header.
1137
+ * - anything else: the host's own node, or a `{ icon, title, baseline }` to draw.
1138
+ *
1139
+ * It answers what was SET, not what will be drawn. `StudioHeader` is where the `white-label`
1140
+ * entitlement is read, because that answer moves after the studio mounts and this one does not.
1141
+ */
1142
+ declare const useStudioHeader: () => StudioHeaderOverride | undefined;
1143
+ /**
1144
+ * useStudioLanguageMark reads the mark a language picker draws beside each language.
1145
+ *
1146
+ * `undefined` outside a provider, and `undefined` inside one that supplied none: the same
1147
+ * answer, because they mean the same thing: draw the names alone. `LanguageSelect` takes this
1148
+ * shape directly as its `renderMark`, so a picker inside a studio needs no prop at all.
1149
+ */
1150
+ declare const useStudioLanguageMark: () => ((language: MapLanguage) => ReactNode) | undefined;
1151
+ /**
1152
+ * useStudioLanguages reads which languages this studio's pickers offer, already labelled.
1153
+ *
1154
+ * Every picker in the studio reads it rather than building its own list, which is the property
1155
+ * worth having: "which languages is this product available in" is one answer, and a surface that
1156
+ * derives it separately is a surface that can offer a different set. Outside a provider it is
1157
+ * English alone, the one language built in.
1158
+ */
1159
+ declare const useStudioLanguages: () => readonly {
1160
+ label: string;
1161
+ value: MapLanguage;
1162
+ }[];
1163
+ /**
1164
+ * useStudioDensity reads which tier the studio's own regions draw at.
1165
+ *
1166
+ * Every surface that mounts a scoped theme reads it rather than importing a constant, so a
1167
+ * host's `density` reaches them all at once, and a surface added later inherits the tier
1168
+ * instead of shipping at whichever one its author happened to copy.
1169
+ */
1170
+ declare const useStudioDensity: () => StudioDensity;
1171
+ /**
1172
+ * useStudioTokens reads the `--mtya-*` overrides the host declared, as a `style` object.
1173
+ *
1174
+ * The studio mounts elements from `@mountaya/elements-react`, and each of those ASSIGNS its own
1175
+ * token block on its root rather than inheriting one, so a token set on the studio root is
1176
+ * shadowed by the element and never reaches it. Handing the same object down as an inline
1177
+ * `style` is what closes that: an inline declaration outranks a class rule, so the element
1178
+ * reads the host's value and falls back to its own block for everything unstated.
1179
+ *
1180
+ * @returns One object per token set the provider holds.
1181
+ */
1182
+ declare const useStudioTokens: () => Record<string, string>;
1183
+ /**
1184
+ * StudioPeerNameSeam answers who a collaborator IS, for one organization.
1185
+ *
1186
+ * A factory rather than a resolver, because the organization is chosen at render time (the
1187
+ * active zone's, else the active itinerary's), and that lives in the studio's own store, which
1188
+ * the host creates. A seam bound above the host therefore cannot read it.
1189
+ */
1190
+ type StudioPeerNameSeam = (organizationId: string | null) => PeerNameResolver;
1191
+ /**
1192
+ * useStudioPeerName reads how a collaborator's id becomes a name, for ONE organization.
1193
+ *
1194
+ * The seam is the host's because a directory of people is: who may be named, and by what, is an
1195
+ * account question with no public read behind it. Every surface that names a peer (a lock
1196
+ * badge, a ghost label, a roster row) reads THIS one, so the studio never shows an id beside
1197
+ * one row and a name beside another.
1198
+ *
1199
+ * It takes the organization rather than resolving one, for the same reason the billing gate
1200
+ * does: the answer is per-organization and the host cannot know which one in advance. It also
1201
+ * cannot find out: the active resource lives in the studio's STORE, which the host CREATES, so
1202
+ * a binding that read it would be reading a context that does not exist yet where it is bound.
1203
+ *
1204
+ * The host's implementation calls hooks, so this is called unconditionally in a component body
1205
+ * exactly like one, and the seam's identity must be stable across renders.
1206
+ *
1207
+ * @param organizationId - The organization of the resource the surface shows, or null.
1208
+ * @returns The resolver, or one that resolves no name where the host supplied no seam.
1209
+ */
1210
+ declare const useStudioPeerName: (organizationId: string | null) => PeerNameResolver;
1211
+ /**
1212
+ * useStudioActivityIconUrl resolves an activity's silhouette to an image URL.
1213
+ *
1214
+ * For the surfaces that composite rather than render: the video recorder's focus marker and
1215
+ * the elevation profile's follow-marker. Everything that draws a badge in a DOM goes through
1216
+ * `<ActivityIcon>` and the marker seam instead.
1217
+ *
1218
+ * Outside a provider, and inside one that supplied no resolver, it answers undefined for every
1219
+ * slug, which both callers already read as "no silhouette", so neither grows a branch.
1220
+ */
1221
+ declare const useStudioActivityIconUrl: () => ((slug: string) => string | undefined);
1222
+ /**
1223
+ * useStudioLayerThumbnail resolves a map layer's slug to a picture of it.
1224
+ *
1225
+ * Every card grid that offers a layer reads it, so one layer cannot show two different
1226
+ * pictures in two places.
1227
+ *
1228
+ * Outside a provider, and inside one that supplied no resolver, it answers undefined for every
1229
+ * slug, and the grids render their cards with no media.
1230
+ */
1231
+ declare const useStudioLayerThumbnail: () => ((kind: StudioLayerKind, slug: string) => string | undefined);
1232
+ /**
1233
+ * useCapability answers whether the surface may perform a class of action.
1234
+ *
1235
+ * The question a component asks to decide whether to render a control at all. It is not a
1236
+ * substitute for the bus's own gate (dispatch checks again, because a surface that hid a
1237
+ * button has not stopped an agent from asking for the same verb), but rendering a control that
1238
+ * would be refused is its own bug.
1239
+ *
1240
+ * @param capability - The class of action asked about.
1241
+ * @returns Whether the studio above grants it; false outside a provider.
1242
+ */
1243
+ declare const useCapability: (capability: ToolCapability) => boolean;
1244
+ /**
1245
+ * useStudioAppOrigin answers the origin a link that leaves this tab is built from.
1246
+ *
1247
+ * The provider's own value when it carries one, else `window.location.origin`: right wherever
1248
+ * the studio and the viewer are served together, which is every deployment that has not split
1249
+ * them. Empty outside a browser, so a snippet built server-side yields a relative URL rather
1250
+ * than one naming a host that does not exist.
1251
+ *
1252
+ * NOT `window.location.origin` at the call site, which is the mistake this hook exists to make
1253
+ * unnecessary: a development server answers on a port the published viewer never uses, so a
1254
+ * snippet built from it carries `localhost` into a publisher's page and fails there, silently,
1255
+ * after the paste.
1256
+ */
1257
+ declare const useStudioAppOrigin: () => string;
1258
+ /**
1259
+ * The studio's own sentences, in the language the provider selected and with any overrides
1260
+ * merged.
1261
+ *
1262
+ * Beside `useMountayaStrings` rather than folded into it: a control reads the elements' words
1263
+ * and a studio surface reads these, and a consumer who mounts controls and no studio never has
1264
+ * to learn this one exists.
1265
+ *
1266
+ * The whole bundle, formatters included, so it follows each formatter a host restates: a
1267
+ * formatter written inline in `i18n.studioStrings` renders the caller at every render of the
1268
+ * host. A surface that reads some sections takes `useStudioScopedStrings`, which renders it for
1269
+ * no restated formatter where those sections hold none.
1270
+ */
1271
+ declare const useStudioStrings: () => StudioStrings;
1272
+ /**
1273
+ * The capabilities the studio takes from the world around it, as this tree was wired with them.
1274
+ *
1275
+ * Published as one object AND as one hook per seam, and neither is redundant. A surface reads
1276
+ * the one it needs (a panel reaching for `useStudioLinks()` names what it uses and reads
1277
+ * nothing else again), and a host wiring their own composition takes the whole set through
1278
+ * `useStudioMapSeams()` to hand on.
1279
+ *
1280
+ * There is no throwing variant. Every seam has a working default, so the default context
1281
+ * carries a working set and a surface outside a provider degrades to the browser's own
1282
+ * behaviour rather than to a blank screen.
1283
+ */
1284
+ declare const useStudioMapSeams: () => StudioSeams;
1285
+ /** Where a product-meaningful moment or delay comes from. */
1286
+ declare const useStudioClock: () => Clock;
1287
+ /** How a number, a date and a relative moment reach a screen, in this studio's locale. */
1288
+ declare const useStudioFormatters: () => StudioFormatters;
1289
+ /** Where a device fix comes from, and whether asking would prompt. */
1290
+ declare const useStudioGeolocation: () => GeolocationSeam;
1291
+ /** Where a link to somewhere outside the product goes, or that there is none. */
1292
+ declare const useStudioLinks: () => StudioLinks;
1293
+ /** Where a preference that outlives a session is kept. */
1294
+ declare const useStudioStorage: () => StudioStorage;
1295
+ /**
1296
+ * Where a floating panel finds the toggle that opened it.
1297
+ *
1298
+ * Published because a consumer composing their own control stack and their own panel needs the
1299
+ * same pairing, and because the alternative, reading the button out of the document, finds the
1300
+ * first match on the page, so two studios would exempt each other's button, and it finds
1301
+ * nothing across a shadow root.
1302
+ */
1303
+ declare const useStudioControlAnchors: () => StudioControlAnchors;
1304
+
1305
+ /**
1306
+ * The configuration a studio surface takes, as a handful of objects rather than a flat list of
1307
+ * props.
1308
+ *
1309
+ * A flat list is not a length problem, it is a NAVIGATION problem. A consumer looking for
1310
+ * "how do I change the colours" would read past the query client, the capability set and the
1311
+ * tool handlers to find `tokens`, and a consumer looking for "how do I replace a verb" past the
1312
+ * glyph tables to find `handlers`; the generated props table would be a wall with no structure
1313
+ * in it.
1314
+ *
1315
+ * The groups are one per question:
1316
+ *
1317
+ * - **`i18n`**: which words, and which regional conventions.
1318
+ * - **`appearance`**: what it looks like.
1319
+ * - **`behavior`**: what it does, and what a host does instead.
1320
+ * - **`assets`**: where the pictures come from.
1321
+ * - **`data`**: what it is showing, and to whom.
1322
+ * - **`plugins`**: what a third party ADDS to it, which is the one `behavior` cannot express.
1323
+ *
1324
+ * The short head stays flat: `client`, `itineraryId` and `children`. The shortest useful call is
1325
+ * `<MountayaStudioHost client={…}>`, and burying a credential one level down would make the
1326
+ * first line a consumer writes longer than the thing it configures.
1327
+ *
1328
+ * **Shared between the host and `StudioProvider`**, which is the second reason and the larger
1329
+ * one for a port. A Dart or Swift SDK copying this family declares ONE set of these structs and
1330
+ * both of its surfaces take them; two surfaces with two spellings of one decision is what a port
1331
+ * has to reconcile before it can start. The host-only halves below `extend` the shared ones
1332
+ * rather than restating them, so the difference between the two surfaces is exactly the list of
1333
+ * extra members and nothing else.
1334
+ */
1335
+
1336
+ /**
1337
+ * Which words a studio says, and which regional conventions it writes them under.
1338
+ *
1339
+ * Extends `MountayaI18n` (the elements' own fields, declared in `@mountaya/elements/i18n` so a
1340
+ * renderer-free consumer and a port both reach them) with the ones a STUDIO adds. That
1341
+ * inheritance is the point rather than a convenience: a host that has set `language` on an
1342
+ * element and on a studio has set one field twice with one meaning.
1343
+ *
1344
+ * `strings` is the ELEMENTS' bundle and `studioStrings` is the studio's. Two bundles because
1345
+ * they are published from two packages on two translation schedules, and a consumer renaming one
1346
+ * panel's verb should not inherit responsibility for the map chrome's labels.
1347
+ */
1348
+ interface StudioI18nConfig extends MountayaI18n {
1349
+ /**
1350
+ * The mark every language picker in the studio draws beside a language name.
1351
+ *
1352
+ * Omitted, the pickers are plain lists of endonyms, a complete language picker, since a flag
1353
+ * is a country and a language is not. Pass a stable function: the studio's context is keyed on
1354
+ * it, so a function written inline renders every surface again at each render of the host.
1355
+ */
1356
+ readonly languageMark?: ((language: MapLanguage) => ReactNode) | undefined;
1357
+ /**
1358
+ * Which languages the studio's own pickers offer. Defaults to English and the languages handed
1359
+ * over in {@link studioTranslations}.
1360
+ *
1361
+ * Any `MapLanguage`, not only the translated ones: `resolveBundle` supports a consumer
1362
+ * supplying German through `studioStrings: { de: … }`, so the studio offers what a consumer
1363
+ * supplies.
1364
+ */
1365
+ readonly languages?: readonly MapLanguage[] | undefined;
1366
+ /**
1367
+ * The studio's own sentences, merged onto the selected language, key by key: an override that
1368
+ * names one sentence leaves the rest of its section as shipped. The map chrome's sentences are
1369
+ * {@link strings}.
1370
+ */
1371
+ readonly studioStrings?: StudioStringsOverrides | undefined;
1372
+ /**
1373
+ * The STUDIO's words in each language beyond English the page imported, keyed by language:
1374
+ * `{ fr: frStudioStrings }` from `@mountaya/studio/strings/fr`, beside the elements' French in
1375
+ * `translations`. A language asked for and not handed over reads in English and says so once
1376
+ * in development.
1377
+ *
1378
+ * Held by its members, so a set written inline resolves once.
1379
+ */
1380
+ readonly studioTranslations?: Translations<StudioStrings> | undefined;
1381
+ }
1382
+ /**
1383
+ * What a studio looks like: the part a design system does not answer.
1384
+ *
1385
+ * No Mantine type reaches this interface, which is what lets the headless provider take it: a
1386
+ * consumer of `@mountaya/studio-react/headless` brings their own components and still wants the
1387
+ * tokens, the scheme and the canvas paint.
1388
+ */
1389
+ interface StudioAppearanceConfig {
1390
+ /**
1391
+ * A class of your own on the surface's root element, merged with `.mtya-studio`, which the
1392
+ * stylesheet's container queries measure and its token block is declared on. Plain CSS on your
1393
+ * class beats every rule this package ships, which are unlayered and come earlier.
1394
+ */
1395
+ readonly className?: string | undefined;
1396
+ /**
1397
+ * Which colour scheme to paint in. Omitted, the studio follows Mantine's computed scheme.
1398
+ *
1399
+ * Stated on the studio's root as `data-mtya-color-scheme`, the attribute every sheet in the
1400
+ * family reads, the elements' and the studio's alike.
1401
+ */
1402
+ readonly colorScheme?: "dark" | "light" | undefined;
1403
+ /**
1404
+ * How tightly the studio draws its panels, forms and conversation.
1405
+ *
1406
+ * @default "compact"
1407
+ */
1408
+ readonly density?: StudioDensity | undefined;
1409
+ /**
1410
+ * What `<StudioHeader />` draws in place of the Mountaya lockup: a node of your own, or a
1411
+ * `{ icon, title, baseline }` rendered in the studio's own treatment.
1412
+ *
1413
+ * Requires the `white-label` entitlement, the same one that takes the Mountaya mark off a video
1414
+ * preview and the frames a recorder composites. Set by a viewer who does not hold it, the
1415
+ * override is REFUSED rather than partially honoured, and the header keeps saying Mountaya.
1416
+ *
1417
+ * `null` hides the header entirely, for a host whose own chrome already says whose studio this
1418
+ * is. That is a meaning rather than an absence, which is why omitting the field is `undefined`
1419
+ * and not `null`.
1420
+ */
1421
+ readonly header?: StudioHeaderOverride;
1422
+ /**
1423
+ * Overrides for what the MAP draws: the itinerary stroke, its casing, the layer ranks, the
1424
+ * palette a new segment is assigned from.
1425
+ *
1426
+ * A second seam beside {@link tokens} rather than more custom properties, and it has to be:
1427
+ * MapLibre evaluates paint expressions inside its own renderer against no DOM element, so a
1428
+ * `var(--mtya-accent)` reaches it as an unreadable string. The tokens theme the chrome AROUND
1429
+ * the canvas; this themes what is drawn IN it.
1430
+ *
1431
+ * Folded per key, so `{ itinerary: { casingColor } }` changes the halo and leaves every width,
1432
+ * dash and rank as shipped.
1433
+ */
1434
+ readonly paint?: MapPaintOverrides | undefined;
1435
+ /**
1436
+ * Inline style on the surface's root, merged over the layout it needs for itself and over the
1437
+ * tokens, so `style={{ "--mtya-accent": "#7048e8" }}` overrides the one property it names.
1438
+ */
1439
+ readonly style?: ElementStyle | undefined;
1440
+ /**
1441
+ * Overrides for the `--mtya-*` properties the studio and its elements are drawn with.
1442
+ *
1443
+ * The object is held for as long as its own members are the ones the render before stated,
1444
+ * compared one level deep by `Object.is`, so it may be written inline.
1445
+ */
1446
+ readonly tokens?: StudioTokens | undefined;
1447
+ }
1448
+ /**
1449
+ * Where the pictures come from.
1450
+ *
1451
+ * A glyph table per paint mode rather than one, and the reason is on `MountayaElementsProvider`:
1452
+ * a set has one paint mode, and a map control, a menu item and a waypoint mark are not drawn the
1453
+ * same way.
1454
+ */
1455
+ interface StudioAssetsConfig {
1456
+ /**
1457
+ * Where an activity's silhouette can be fetched as an image, for the surfaces that composite
1458
+ * rather than render: the recorder's focus marker and the elevation profile's follow-marker.
1459
+ * Omitted, both draw a plain disc.
1460
+ *
1461
+ * Pass a stable function: the studio's context is keyed on it, so a function written inline
1462
+ * renders every surface again at each render of the host.
1463
+ */
1464
+ readonly activityIconUrl?: ((slug: string) => string | undefined) | undefined;
1465
+ /**
1466
+ * The elevation raster every map in the studio bakes its always-on relief from, as a TileJSON
1467
+ * URL. Omitted, a map reads the elevation the layers manifest names, and renders flat where it
1468
+ * names none.
1469
+ */
1470
+ readonly demUrl?: string | undefined;
1471
+ /**
1472
+ * Glyphs for the map controls.
1473
+ *
1474
+ * @default the bundled Lucide set
1475
+ */
1476
+ readonly controlIcons?: MountayaElementsProviderProps["controlIcons"];
1477
+ /**
1478
+ * The pictures the import routing guide argues with, each as a URL you serve.
1479
+ *
1480
+ * The package ships no picture: what a studio's map looks like is the host's own. A comparison
1481
+ * is shown when both of its pictures are stated, and the guide makes that argument in words
1482
+ * otherwise. `MountayaStudioHost` hands them to the guide it mounts; a headless consumer states
1483
+ * them on its own `ImportRoutingGuideProvider`.
1484
+ *
1485
+ * @default undefined, and the guide requests no image
1486
+ */
1487
+ readonly importRoutingGuidePictures?: ImportRoutingGuidePictures | undefined;
1488
+ /**
1489
+ * The picture of a map layer, for the card grids that offer one. Omitted, a card shows the
1490
+ * layer's name with no picture.
1491
+ *
1492
+ * Pass a stable function: the studio's context is keyed on it, so a function written inline
1493
+ * renders every surface again at each render of the host.
1494
+ */
1495
+ readonly layerThumbnail?: ((kind: StudioLayerKind, slug: string) => string | undefined) | undefined;
1496
+ /**
1497
+ * Glyphs for the places an element draws, the waypoint marks on an elevation curve.
1498
+ *
1499
+ * @default the bundled marker set, never {@link controlIcons}
1500
+ */
1501
+ readonly markerIcons?: MountayaElementsProviderProps["markerIcons"];
1502
+ /**
1503
+ * Glyphs for the studio's own surfaces, as distinct from the map controls.
1504
+ *
1505
+ * @default {@link controlIcons} where it is stated, and the bundled outline set otherwise
1506
+ */
1507
+ readonly uiIcons?: MountayaElementsProviderProps["uiIcons"];
1508
+ }
1509
+ /**
1510
+ * What the studio does, and what a host does instead.
1511
+ *
1512
+ * The members here are the ones BOTH surfaces take. A host mounting the assembled studio has
1513
+ * more to override, because it has more that is mounted for it: see `StudioHostBehaviorConfig`.
1514
+ */
1515
+ interface StudioBehaviorConfig {
1516
+ /**
1517
+ * The origin every link that has to work outside this tab is built from: the embed snippet a
1518
+ * publisher pastes into their own page, and the share link they send.
1519
+ *
1520
+ * Omitted, it is `window.location.origin`, which is right wherever the studio and the viewer
1521
+ * are served together. State it where they are not, a development server on another port
1522
+ * among them, or a snippet carries that origin into a publisher's page.
1523
+ */
1524
+ readonly appOrigin?: string | null | undefined;
1525
+ /**
1526
+ * The router the studio sends a reader through when a surface links somewhere. Omitted, the
1527
+ * surfaces offer no link.
1528
+ *
1529
+ * Held by its members, so it may be written inline over a router's own two functions.
1530
+ */
1531
+ readonly navigation?: NavigationSeam | null | undefined;
1532
+ /**
1533
+ * How a collaborator's user id becomes a name, for every surface that names a peer. Omitted, a
1534
+ * peer is drawn with their initials.
1535
+ *
1536
+ * Pass a stable function: the studio's context is keyed on it, so a function written inline
1537
+ * renders every surface again at each render of the host.
1538
+ */
1539
+ readonly resolvePeerName?: StudioPeerNameSeam | undefined;
1540
+ /**
1541
+ * The capabilities the studio takes from the world around it, wholly or in part.
1542
+ *
1543
+ * Folded onto the browser defaults, so a host overriding one keeps the rest. Every seam has a
1544
+ * shipped implementation that does nothing, and doing nothing is a state every surface already
1545
+ * renders: `createInertStudioSeams()` turns them all off at once.
1546
+ *
1547
+ * A member left out or written as `undefined` keeps its default, so a host forwards a seam it
1548
+ * may not hold.
1549
+ *
1550
+ * The object is held for as long as its own members are the ones the render before stated,
1551
+ * compared one level deep by `Object.is`: written inline over seams declared once, it folds
1552
+ * no new set, and a seam built inline is a new member at every render.
1553
+ */
1554
+ readonly seams?: StudioSeamOverrides | undefined;
1555
+ }
1556
+ /**
1557
+ * What the studio is showing, and to whom.
1558
+ *
1559
+ * The members here are the ones BOTH surfaces take; a host resolves the rest for itself out of
1560
+ * the client it was given.
1561
+ */
1562
+ interface StudioDataConfig {
1563
+ /**
1564
+ * The activity catalog every surface that names an activity reads.
1565
+ *
1566
+ * Omitted, `MountayaStudioHost` reads it once through `useActivities()` and hands it down. Pass
1567
+ * a query's `data` straight through, `undefined` included: an absent catalog reads as one shared
1568
+ * empty catalog, where a `?? []` at the call site is a new array at each render. The studio's
1569
+ * context is keyed on the list, so a list written inline renders every surface again at each
1570
+ * render of the host.
1571
+ */
1572
+ readonly activities?: readonly CategoryActivities[] | null | undefined;
1573
+ /**
1574
+ * What this studio grants. `MountayaStudioHost` grants the whole editor where none is stated;
1575
+ * a read-only surface states `["embedding", "share"]`.
1576
+ *
1577
+ * The bus gates a verb on this set and a component gates its own affordance on it, so the two
1578
+ * read one set.
1579
+ *
1580
+ * `ToolCapability` rather than `StudioCapability`, and the difference is deliberate: the open one
1581
+ * admits a host's OWN capability string beside the studio's own, which is what a consumer
1582
+ * gating their own surfaces off the same set needs. The host and the headless provider take it
1583
+ * under one type, since it is one prop with one meaning.
1584
+ *
1585
+ * An array or a set is read at every render, so one a host mutates in place is followed from
1586
+ * the next render. An iterator (what `grants.values()` hands over) yields its members once: it
1587
+ * is read once, and its members are held for as long as the host hands the same object.
1588
+ */
1589
+ readonly capabilities?: Iterable<ToolCapability> | undefined;
1590
+ /**
1591
+ * The studio's state, from `createUiStore()`. `MountayaStudioHost` creates one per mount where
1592
+ * none is stated.
1593
+ *
1594
+ * Pass one to seed it: `createUiStore(embedUiBaseline)` starts a read-only viewer with no
1595
+ * enrichment overlay and no point-of-interest group. Every write after the mount crosses the
1596
+ * bus.
1597
+ *
1598
+ * Build it once per mount (`useState(createUiStore)`): one built in the render body is a new
1599
+ * store, and a studio that forgets its state, at each render of the host.
1600
+ */
1601
+ readonly store?: UiStoreApi | undefined;
1602
+ }
1603
+ /**
1604
+ * What an ASSEMBLED studio does, and what a host does instead.
1605
+ *
1606
+ * Everything the headless provider takes, plus the members that only make sense where the host
1607
+ * builds the bus and mounts the surfaces: a handler to replace, a confirmation to raise, a
1608
+ * departure to hold. A headless consumer wires each of those into the bus and the tool context
1609
+ * themselves, which is what "headless" means here rather than an omission.
1610
+ */
1611
+ interface StudioHostBehaviorConfig extends StudioBehaviorConfig {
1612
+ /**
1613
+ * The seam a verb outside the viewer's agreement hands its subject to, so the host attaches its
1614
+ * own action. Omitted, a surface at a limit states the limit and offers nothing.
1615
+ *
1616
+ * Pass a stable object: the studio's context is keyed on it, so one written inline renders
1617
+ * every surface again at each render of the host.
1618
+ */
1619
+ readonly billing?: StudioBillingGateSeam | undefined;
1620
+ /**
1621
+ * The gate the bus awaits before a destructive verb runs. Omitted, the host renders its own
1622
+ * dialog. A promise that resolves `false` is a refusal the verb reports as a structured
1623
+ * failure.
1624
+ *
1625
+ * Read when a verb asks, so one written inline costs nothing beneath.
1626
+ */
1627
+ readonly confirm?: StudioToolContext["confirm"];
1628
+ /**
1629
+ * The host's binding of the co-pilot: whether it may run for an organization, which model line
1630
+ * to name, and what to show in place of the conversation when the host withholds it. Omitted,
1631
+ * the studio has no co-pilot.
1632
+ *
1633
+ * Pass a stable object: the studio's context is keyed on it, so one written inline renders
1634
+ * every surface again at each render of the host.
1635
+ */
1636
+ readonly copilot?: StudioCopilotSeam | undefined;
1637
+ /**
1638
+ * Handlers to add or replace, spread over the published defaults: a key that names a published
1639
+ * verb replaces its handler and leaves the rest of the studio as shipped.
1640
+ *
1641
+ * Each entry is read when its verb is dispatched, so a map written inline builds no bus. A verb
1642
+ * stated as `undefined` is taken out of the studio: it is off the bus, the co-pilot is not
1643
+ * offered it, and every menu leaves out the item that would dispatch it
1644
+ * (`{ "studio.collection.manage.open": undefined }` for a host that manages collections itself).
1645
+ */
1646
+ readonly handlers?: StudioHandlers<StudioToolContext> | undefined;
1647
+ /**
1648
+ * Marks an organization's AI configuration stale after a co-pilot run is refused for a fault
1649
+ * that turns on it: the configuration is missing, or the reader has no access to it. Omitted,
1650
+ * the refusal still shows its message and the configuration is read again at its next refetch.
1651
+ */
1652
+ readonly invalidateAiConfig?: ((organizationId: string) => void) | undefined;
1653
+ /**
1654
+ * Marks the reader's memberships stale after a co-pilot run is refused or ended for want of
1655
+ * access: its start or its stream is answered 402, 403 or 404, a message finds its run gone, or
1656
+ * the run ends because its member may not run it there any more (no write role in its
1657
+ * organization, or an agreement that does not include Map Studio). The
1658
+ * co-pilot's availability is the host's answer from the memberships, so the notice the panel
1659
+ * shows next follows the role the reader holds now. Omitted, the refusal still shows its message
1660
+ * and the memberships are read again at their next refetch.
1661
+ */
1662
+ readonly invalidateMemberships?: (() => void) | undefined;
1663
+ /**
1664
+ * The gate that holds a departure while there is unsaved work. Omitted, a departure is never
1665
+ * held.
1666
+ *
1667
+ * Pass a stable object: the studio's context is keyed on it, so one written inline renders
1668
+ * every surface again at each render of the host.
1669
+ */
1670
+ readonly navigationBlocker?: StudioNavigationBlocker | undefined;
1671
+ /**
1672
+ * How the studio tells a reader something happened. Omitted, the studio works silently.
1673
+ *
1674
+ * Pass a stable object: the studio's context is keyed on it, so one written inline renders
1675
+ * every surface again at each render of the host.
1676
+ */
1677
+ readonly notify?: StudioNotify | undefined;
1678
+ /**
1679
+ * A telemetry observer, called once per dispatch with its outcome and latency, for every verb a
1680
+ * reader runs and every verb the co-pilot runs. An observer that throws changes no dispatch:
1681
+ * the fault is raised on a microtask, where the page's own error handling sees it.
1682
+ *
1683
+ * Read when a dispatch reports, so one written inline is attached once.
1684
+ */
1685
+ readonly onDispatch?: ToolDispatchObserver | undefined;
1686
+ /**
1687
+ * Asks the host whether the reader is still signed in after the API refused the browser's own
1688
+ * session under a co-pilot run: its start, its stream or a message into it is answered 401, as
1689
+ * it is once the reader signs out or their session is revoked. The host sends a reader nobody
1690
+ * is signed in as to sign in. Called once per refusal, once the conversation has settled. A 401
1691
+ * says nothing of the reader's access, so `invalidateMemberships` is not asked for it.
1692
+ *
1693
+ * Called only where the client rides the browser's own session. Under a publishable key a 401
1694
+ * refuses the key or the session token beside it, which is no sign-in a host can ask about, so
1695
+ * the studio calls nothing. Omitted, the refusal still shows its message.
1696
+ *
1697
+ * Read when a run is refused, so one written inline is attached once.
1698
+ */
1699
+ readonly onSignInRefused?: (() => void) | undefined;
1700
+ /**
1701
+ * Recognizers for a host's own thrown errors, asked before the status table and before the
1702
+ * published ones, which stay. This is where a host classifies what only it can tell apart,
1703
+ * such as a billing code that means "attach a card" rather than "outside the agreement".
1704
+ *
1705
+ * Read when a throw is classified, so a list written inline builds no bus.
1706
+ */
1707
+ readonly recognizers?: readonly ThrownRecognizer[] | undefined;
1708
+ /**
1709
+ * The host's own remedy for a co-pilot call that failed, which the model reads after the
1710
+ * playbook's recovery for that tool and code: where in this product a reader finds what the
1711
+ * failure says is missing. Omitted, the model reads the playbook's recovery alone. The video
1712
+ * wizard's director takes its own, as `video.recoveryAddendum`.
1713
+ *
1714
+ * Read when a call fails, so one written inline builds no conversation.
1715
+ */
1716
+ readonly recoveryAddendum?: RecoveryAddendum | undefined;
1717
+ /**
1718
+ * Whether a co-pilot run names the server tools its model sees, from the tools the
1719
+ * conversation's surfaces route to. Omitted, a run names none and keeps every server tool its
1720
+ * credential reaches.
1721
+ *
1722
+ * Leave it off under a publishable key: a run under a key calls no server tool, and the API
1723
+ * refuses a start or an update that names any. A host on the browser's own session turns it on
1724
+ * to narrow the server tools a run offers its model.
1725
+ *
1726
+ * @default false
1727
+ */
1728
+ readonly routesServerTools?: boolean | undefined;
1729
+ /**
1730
+ * How the open co-pilot thread is mirrored into the address bar, and read back out of it.
1731
+ * Omitted, a thread opens and closes and does not survive a reload or a shared link.
1732
+ */
1733
+ readonly threadsUrl?: AgentThreadsUrlSeam | undefined;
1734
+ /**
1735
+ * The studio's own slice of the address bar, which a content-open verb patches so a reload
1736
+ * reopens what was open. A `MountayaStudio` given no `url` of its own mirrors its map state
1737
+ * into it (the terrain, the overlay, the enrichments and the time offset) and restores it from
1738
+ * there on mount. Omitted, those verbs mirror nothing.
1739
+ */
1740
+ readonly url?: StudioUrlSeam | undefined;
1741
+ /**
1742
+ * What the export-as-video wizard `MountayaStudio` opens is bound to: its director's remedy for
1743
+ * a failed call, and the transform its preview map's tile requests ride. Omitted, the wizard
1744
+ * runs on the studio's own answers: the director reads the playbook's recovery alone, and the
1745
+ * preview draws each itinerary's published tiles under the studio map's credential.
1746
+ *
1747
+ * The wizard also takes {@link invalidateAiConfig}, which its director shares with the
1748
+ * co-pilot, so a host states that once.
1749
+ *
1750
+ * Held by its members, so it may be written inline over values declared once.
1751
+ */
1752
+ readonly video?: StudioVideoConfig | undefined;
1753
+ }
1754
+ /**
1755
+ * What the export-as-video wizard is bound to, where a studio mounts it for its host.
1756
+ *
1757
+ * `MountayaStudio` opens the wizard itself when a reader exports an itinerary as a video, and
1758
+ * draws its preview through the studio's own map client, so the preview and the editor read
1759
+ * under one credential. What is left are the two answers only a host has, each with a stated
1760
+ * absence.
1761
+ */
1762
+ interface StudioVideoConfig {
1763
+ /**
1764
+ * The host's own remedy for a call of the wizard's director that failed, which the model reads
1765
+ * after the playbook's recovery for that tool and code. Distinct from the co-pilot's
1766
+ * `behavior.recoveryAddendum`, since the director runs the camera verbs alone.
1767
+ *
1768
+ * Omitted, the model reads the playbook's recovery alone. Read when a call fails, so one written
1769
+ * inline builds no conversation.
1770
+ */
1771
+ readonly recoveryAddendum?: RecoveryAddendum | undefined;
1772
+ /**
1773
+ * The transform each request of the wizard's preview map rides, in place of the one the wizard
1774
+ * derives.
1775
+ *
1776
+ * Omitted, the wizard derives one from the studio's map client: its browser-safe credential,
1777
+ * its Tile API origin as the only host that receives it, and its language, as the studio's map
1778
+ * derives its own. To each request it claims, it adds `surface=published`, so the preview, and
1779
+ * the video recorded from it, draw the itinerary's published snapshot rather than the draft the
1780
+ * editor holds.
1781
+ *
1782
+ * Supply one for what that derivation cannot know: a header of your own, an origin the client
1783
+ * does not speak to. A transform of your own replaces the derived one whole, so it carries the
1784
+ * credential and asks for `surface=published` itself.
1785
+ */
1786
+ readonly transformRequest?: TileRequestTransform | undefined;
1787
+ }
1788
+ /**
1789
+ * What a host ADDS to the studio, as distinct from what it replaces.
1790
+ *
1791
+ * A group of its own rather than a member of `behavior`, and the line between them is the
1792
+ * question each answers. `behavior` is "what does it do, and what do you do instead": a handler
1793
+ * to replace, a confirm gate to raise, a router to send a reader through. A plugin adds
1794
+ * something the package has never heard of, in a place the package chose to open. Those are
1795
+ * different enough that folding them together would make `behavior` mean
1796
+ * "everything about behaviour", which is the flat-props problem the grouping exists to solve.
1797
+ *
1798
+ * Host-only, and it has to be: a headless consumer mounts their own surfaces, so the render
1799
+ * sites a contribution lands in do not exist for them. What they can still use is the registry
1800
+ * itself, from `@mountaya/studio/plugins`, driving their own components off `at(slot)`.
1801
+ */
1802
+ interface StudioPluginsConfig {
1803
+ /**
1804
+ * The plugins this studio installs, reconciled by id whenever the array changes.
1805
+ *
1806
+ * Hoist the declarations to module scope. The registry replaces a stored declaration when its
1807
+ * object reference changed, which is what makes a host that re-localizes its labels work, so
1808
+ * an array rebuilt inline on every host render re-renders the menus beneath it.
1809
+ */
1810
+ readonly install?: readonly StudioReactPlugin[] | undefined;
1811
+ /**
1812
+ * Where a failed plugin is reported, as ONE object discriminated on `kind`: a `run` that threw,
1813
+ * a `view` that threw during render, or an `install` the registry refused.
1814
+ *
1815
+ * ```ts
1816
+ * onError: (failure) => {
1817
+ * if (failure.kind === "install") {
1818
+ * report(failure.plugin.id, failure.error);
1819
+ * } else {
1820
+ * report(failure.contribution.qualifiedId, failure.error);
1821
+ * }
1822
+ * };
1823
+ * ```
1824
+ *
1825
+ * Omitted, a failure renders nothing and is silent, which is the right default for a menu
1826
+ * row (one broken plugin must not take the dropdown with it) and the wrong one for a host who
1827
+ * would like to know. A refusal names the DECLARATION rather than a contribution, because
1828
+ * producing one is exactly what the refusal prevented; narrow the error with
1829
+ * `isStudioPluginError` to read the defect list.
1830
+ *
1831
+ * A refusal is reported once for as long as `install` goes on stating its declaration, a list
1832
+ * written inline included: the declaration is found again by the id it states. It is reported
1833
+ * again once the list stops stating the declaration and states it again, and when the
1834
+ * declaration is refused in other words.
1835
+ *
1836
+ * A member of `install` that is no object states no declaration to name: it is refused, this
1837
+ * reporter is not called for it, and its refusal is raised on a microtask once the host has
1838
+ * committed, where the page's own error handling sees it. A server render commits nothing and
1839
+ * raises none. Such a member is raised once by the same rule, however often the list is
1840
+ * restated.
1841
+ *
1842
+ * Write it inline if that is what reads best. The host holds it through a ref and dispatches
1843
+ * through one stable function, so an arrow rebuilt on every render costs nothing beneath.
1844
+ */
1845
+ readonly onError?: StudioPluginErrorReporter | undefined;
1846
+ /**
1847
+ * A plugin engine of your own, instead of the one the host builds.
1848
+ *
1849
+ * For a host that installs and uninstalls from OUTSIDE the studio: a settings screen that
1850
+ * enables a plugin, a marketplace that loads one on demand. Supplied, `install` is still
1851
+ * reconciled into it, so the two compose rather than competing: a reconciliation takes back
1852
+ * only what a declared list installed, never what you installed through the engine yourself.
1853
+ *
1854
+ * The host attaches its BUS to whichever engine it ends up with, for as long as it is
1855
+ * mounted, so a plugin you installed before the studio mounted has its tools on the same bus
1856
+ * the co-pilot dispatches through, and gets them back when the studio unmounts.
1857
+ *
1858
+ * Build it once, outside the render: an engine built in the render body is a new registry at
1859
+ * each render of the host, which the bus is attached to again and every plugin menu reads anew.
1860
+ */
1861
+ readonly engine?: StudioPluginEngine<ReactNode> | undefined;
1862
+ }
1863
+ /**
1864
+ * What an ASSEMBLED studio looks like, including the two answers only a design system has.
1865
+ *
1866
+ * `theme` and `mantine` are here rather than on the shared interface because
1867
+ * `@mountaya/studio-react/headless` brings no design system: it has nothing to theme and
1868
+ * nothing to decide about mounting a provider for one. The split keeps the headless entry's
1869
+ * graph free of `@mantine/*` in the TYPES as well as at runtime.
1870
+ */
1871
+ interface StudioHostAppearanceConfig extends StudioAppearanceConfig {
1872
+ /**
1873
+ * Whether this host mounts a `MantineProvider` or inherits the one above it.
1874
+ *
1875
+ * `provide`, the default, mounts one scoped to the studio's root: its colour scheme and its
1876
+ * variables are written there, never on the page's `<html>` or `:root`, so a second studio
1877
+ * beside it keeps its own and the page keeps its scheme. A page that runs a `MantineProvider` of
1878
+ * its own writes its scheme on `<html>` as well, and where the two schemes differ Mantine's
1879
+ * per-scheme rules match both and are settled by their order in the sheet: such a page mounts
1880
+ * the studio with `inherit`, or in the page's scheme.
1881
+ *
1882
+ * `inherit` merges the studio's theme into the provider above through a nested
1883
+ * `MantineThemeProvider`, so the application's palette, radii and fonts stay; the studio's
1884
+ * {@link colorScheme} then reaches its own sheet and the elements, while Mantine's components
1885
+ * follow the enclosing provider's scheme. Either way the studio's dialogs, menus and tooltips
1886
+ * are portalled inside its root.
1887
+ *
1888
+ * @default "provide"
1889
+ */
1890
+ readonly mantine?: "inherit" | "provide" | undefined;
1891
+ /**
1892
+ * The Mantine theme this host merges over the studio's published base: the base first, then
1893
+ * the density, then this.
1894
+ *
1895
+ * Held by its content, compared member by member at every depth with functions by identity,
1896
+ * so it may be written inline.
1897
+ */
1898
+ readonly theme?: MantineThemeOverride | undefined;
1899
+ }
1900
+ /**
1901
+ * What an ASSEMBLED studio is showing, and to whom.
1902
+ *
1903
+ * The host resolves reads for itself out of the client it was given, so it takes the query
1904
+ * client and the viewer that a headless consumer supplies through their own providers and their
1905
+ * own tool context. Who a write acts as is the session token's to say: the client's.
1906
+ */
1907
+ interface StudioHostDataConfig extends StudioDataConfig {
1908
+ /**
1909
+ * The organizations this reader may write to, for every scope picker in the studio. Omitted,
1910
+ * the studio writes to the reader's personal scope alone.
1911
+ *
1912
+ * It is also who may edit an itinerary. Stated, the editor offers an itinerary's edits only to
1913
+ * a reader whose `writable.writableOrgIds` holds the organization that owns it (or to the
1914
+ * author of a personal one), and the editing verbs refuse anyone else with `forbidden` before
1915
+ * a request. Omitted, no role is asked and the API decides.
1916
+ *
1917
+ * Pass a stable object: the studio's context is keyed on it, so one written inline renders
1918
+ * every surface again at each render of the host.
1919
+ */
1920
+ readonly organizations?: StudioOrganizations | undefined;
1921
+ /**
1922
+ * The query client every read beneath this host runs on.
1923
+ *
1924
+ * State it and the host mounts a `QueryClientProvider` for it; omit it and the host inherits
1925
+ * the one above; with neither, the host creates one per mount.
1926
+ *
1927
+ * Build it once per mount: one built in the render body is a new cache at each render of the
1928
+ * host, and every read starts over.
1929
+ */
1930
+ readonly queryClient?: QueryClient | undefined;
1931
+ /**
1932
+ * Where a committed write GOES. Unset, it is the Mountaya API through the client above.
1933
+ *
1934
+ * The counterpart to {@link viewer} and it sits beside it on purpose: one names who is reading
1935
+ * and the other where what they write lands. Set {@link localStudioPersistence} or
1936
+ * {@link memoryStudioPersistence} and the editor's verbs all work against a local session
1937
+ * instead of an organization's catalogue, while the reads (search, geocoding, points of
1938
+ * interest, directions and tiles) keep going to the real APIs through the same client. That is
1939
+ * what a demo, a docs example and a sandbox inside your own Embedded Studio each need.
1940
+ */
1941
+ readonly persistence?: StudioPersistence | undefined;
1942
+ /**
1943
+ * The product this host renders: `"studio-embedded"`, the Embedded Studio, where none is
1944
+ * stated, or `"embedding"`, Map Publishing's hosted embed served from Mountaya's own origin.
1945
+ *
1946
+ * An Embedded Studio runs on a session token minted for `studio-embedded`, and the host refuses
1947
+ * a token minted for any other surface, and a publishable key given none, with a
1948
+ * `MountayaConfigurationError` before the studio sends anything. A client carrying a share token,
1949
+ * or the browser's own session and no key, is taken whatever this states. The hosted embed is
1950
+ * read-only, and the API records it by the origin it is served from rather than by a session, so
1951
+ * the host does not read the token its client carries: a key with a session minted for any
1952
+ * surface is taken, and so is a key alone. It grants `embedding` and `share`
1953
+ * alone, the pair it grants where `capabilities` states nothing, and refuses `editor` or
1954
+ * `authenticated` beside it with a `MountayaConfigurationError`.
1955
+ *
1956
+ * Stated on a page of your own, it lifts the host's check and nothing else: the API records a
1957
+ * request by the session it carries and the origin it comes from, so what the studio asks there
1958
+ * under an `api` session is counted as your own clients' requests are, and a `studio-embedded`
1959
+ * operation still refuses that session.
1960
+ */
1961
+ readonly surface?: "embedding" | "studio-embedded" | undefined;
1962
+ /**
1963
+ * The person reading this studio: their id, their entitlements, and the units they read in.
1964
+ * Omitted, the studio runs for an anonymous reader on metric units who holds no entitlement,
1965
+ * which suits a public embed; an application binds its signed-in reader here, built with
1966
+ * `usePlatformViewer` from what Mountaya answers for each of their scopes.
1967
+ */
1968
+ readonly viewer?: StudioViewer | undefined;
1969
+ }
1970
+
1971
+ /**
1972
+ * useAgentDriving reports whether an agent run drives the studio, so a control can render inert
1973
+ * for the duration.
1974
+ *
1975
+ * It is the one reading surface for that flag: every gated control calls this rather than
1976
+ * selecting the chrome slot itself, so its import list IS the inventory of what the lock covers.
1977
+ *
1978
+ * The flag is the shared-UI mirror of a run's state, written by whatever owns the run. That
1979
+ * indirection is the point: a surface outside the agent's own tree (a sidenav, a routed region,
1980
+ * a consumer's own chrome) reads the same lock the panel does without knowing where the run
1981
+ * lives.
1982
+ *
1983
+ * These stay live while it is true, because the lock is unusable otherwise: the run's own stop
1984
+ * control, the composer, and the entity the run handed back for the user to adjust and save.
1985
+ * Gate everything else.
1986
+ *
1987
+ * @returns `true` while an agent run drives the studio, `false` otherwise.
1988
+ */
1989
+ declare const useAgentDriving: () => boolean;
1990
+
1991
+ /**
1992
+ * BeginSegmentEdit arms the geometry editor for one persisted segment of the open itinerary,
1993
+ * resolving everything the edit needs from the segment's id alone.
1994
+ *
1995
+ * It resolves to the dispatch's `ToolResult`, or to null when there is nothing to begin: no
1996
+ * itinerary is open, or the chain does not carry the id. A null answer means no dispatch
1997
+ * happened, so a caller that reports a refusal has nothing to report.
1998
+ */
1999
+ type BeginSegmentEdit = (segmentId: string) => Promise<ToolResult | null>;
2000
+ /**
2001
+ * useBeginSegmentEdit is the ONE assembler of the segment geometry edit's begin payload, so
2002
+ * every surface that opens an edit (a list row, a click on the segment's line on the map) arms
2003
+ * the engine with byte-identical arguments.
2004
+ *
2005
+ * Every part of the payload is a place two copies would drift: the engine follows the
2006
+ * segment's OWN stored mode rather than the activity's default, so a freehand segment inside a
2007
+ * directions-capable activity reshapes as freehand; the seed comes from the right geometry leaf
2008
+ * for that mode; and the start is pinned only off the head of the chain, because the first
2009
+ * segment has no predecessor to stay continuous with.
2010
+ *
2011
+ * Everything is read AT DISPATCH TIME rather than subscribed: the chain comes off the store
2012
+ * handle, not off a selector. Nothing here renders its caller again: a row that rendered on
2013
+ * every chain write would pay for state it only reads inside a callback, and a map handler
2014
+ * sharing this hook must not bind its listeners again when an unrelated peer frame lands.
2015
+ *
2016
+ * The bus stays the authority on whether the edit may open at all: this resolves the arguments
2017
+ * and dispatches, and the handler owns the one-edit-at-a-time and collaboration-lock refusals.
2018
+ * A caller surfaces the refusal it cares about by branching on the returned result.
2019
+ *
2020
+ * @param activitySlug - The router's profile for the itinerary's activity, the one thing this
2021
+ * hook cannot resolve. A directions edit routes under it, and without it the edit draws no
2022
+ * line. Which activity an itinerary belongs to, and what the router calls it, is the host's
2023
+ * catalog to answer: `activityForId` in `@mountaya/studio` is the lookup.
2024
+ * @returns The {@link BeginSegmentEdit} callback, stable while the store and the slug are.
2025
+ */
2026
+ declare const useBeginSegmentEdit: (activitySlug?: string) => BeginSegmentEdit;
2027
+
2028
+ /**
2029
+ * One saved waypoint, named through the published view source rather than through the wire
2030
+ * alias: the contract for a waypoint lives in `@mountaya/client`, and this entry deliberately
2031
+ * does not publish a second spelling of it.
2032
+ */
2033
+ type SavedWaypoint = ItineraryViewSource["waypoints"][number];
2034
+ /**
2035
+ * BeginWaypointEdit arms the placement session that REPOSITIONS one saved waypoint: the next
2036
+ * click on the map moves the existing marker rather than dropping a fresh one.
2037
+ *
2038
+ * Resolves to the dispatch's `ToolResult`, so a caller that words a refusal has one to word.
2039
+ */
2040
+ type BeginWaypointEdit = (waypoint: SavedWaypoint) => Promise<ToolResult>;
2041
+ /**
2042
+ * useBeginWaypointEdit is the ONE assembler of the waypoint move session's begin payload, so
2043
+ * every surface that opens one (a row's body click, its "Move on map" item, a click on the
2044
+ * marker itself) arms the engine with byte-identical arguments.
2045
+ *
2046
+ * The session is seeded with the waypoint's CURRENT colour, icon, name and coordinate, so the
2047
+ * marker the user drags is the one they already have rather than a default that silently
2048
+ * recolours it on save. The payload carries no copy of the saved waypoint: the open itinerary
2049
+ * holds it while the edit is open, so a cancel has nothing to put back.
2050
+ *
2051
+ * The coordinate is read off the waypoint's own geometry rather than passed in, because a
2052
+ * caller holding the waypoint already holds it and a second parameter is a second thing to get
2053
+ * wrong. It is the geometry's first point, read by `extractPoint`: a waypoint arrives as a
2054
+ * collection of one point, and a bare point is read the same way. A waypoint whose geometry
2055
+ * carries no point, or one whose longitude and latitude are not two finite numbers, opens
2056
+ * unplaced, which is the honest state: the next click places it.
2057
+ *
2058
+ * The payload is assembled inside the promise, so a throw on the way to the dispatch is a
2059
+ * rejection the caller handles and never an error out of a click handler.
2060
+ *
2061
+ * @returns The {@link BeginWaypointEdit} callback, one function for the caller's life.
2062
+ */
2063
+ declare const useBeginWaypointEdit: () => BeginWaypointEdit;
2064
+
2065
+ /**
2066
+ * useActiveItineraryResource resolves the open itinerary as the {@link CollabResource} handle
2067
+ * its collaboration surfaces scope by: the presence roster, the segment and waypoint awareness
2068
+ * badges, the peer-draft ghosts and the live-aware segment fold each read ONLY this resource's
2069
+ * peers, locks and drafts, so a concurrent zone session never bleeds into an itinerary surface.
2070
+ *
2071
+ * The handle is memoised on the itinerary id, so it is one stable object per open itinerary: a
2072
+ * selector or effect keyed on it never churns while the same itinerary stays open.
2073
+ *
2074
+ * @returns The open itinerary's handle, or null when no itinerary is open.
2075
+ */
2076
+ declare const useActiveItineraryResource: () => CollabResource | null;
2077
+ /**
2078
+ * useActiveZoneResource resolves the open zone as the {@link CollabResource} handle its
2079
+ * collaboration surfaces scope by: the zone panel's roster and lock badge and the zone
2080
+ * peer-draft ghost each read ONLY this resource's live picture, so a concurrent itinerary
2081
+ * session never bleeds into the zone panel. The handle is memoised on the zone id, the
2082
+ * zone-family twin of {@link useActiveItineraryResource}.
2083
+ *
2084
+ * @returns The open zone's handle, or null when no zone is open.
2085
+ */
2086
+ declare const useActiveZoneResource: () => CollabResource | null;
2087
+ /**
2088
+ * useActiveCollabResources is the single source of truth for the studio's OPEN editor set: the
2089
+ * {@link CollabResource} handles a collaboration surface folds across.
2090
+ *
2091
+ * It composes the two singular resource hooks into one array, the itinerary before the zone,
2092
+ * and is the seam a multi-editor UI extends: a surface that reconciles every open resource at
2093
+ * once iterates THIS list rather than naming the itinerary and the zone by hand. A studio opens
2094
+ * at most one itinerary and one zone, so the set holds neither, either or both. The array is
2095
+ * memoised on the two handles, each already stable, so a selector or effect keyed on it never
2096
+ * churns.
2097
+ */
2098
+ declare const useActiveCollabResources: () => readonly CollabResource[];
2099
+ /**
2100
+ * usePeerLockHolderId reports the id of the PEER holding one entity's soft-lock in the given
2101
+ * editor resource, or null when it is unheld.
2102
+ *
2103
+ * It is scoped by `resource` so an itinerary row reads only its itinerary session's locks and
2104
+ * a zone panel only its zone session's: a lock in a concurrently-open document never makes an
2105
+ * unrelated row inert. The collaboration session filters the local user's own locks out of
2106
+ * the store, so a present holder is always a PEER, which is why a row reads this to decide
2107
+ * whether to render itself inert without comparing against the local user.
2108
+ *
2109
+ * The narrow selector keys on THIS resource and entity's holder, so a lock elsewhere never
2110
+ * renders the row again; a null resource (no document open) or a null id (a draft or create
2111
+ * row with no server identity a peer could lock) is never locked.
2112
+ *
2113
+ * The holder is an ID rather than a name on purpose. Who that id belongs to is a directory
2114
+ * question (a member list, an organization, a display-name policy), and answering it here
2115
+ * would make this hook the second place a consumer's identity model has to be taught.
2116
+ */
2117
+ declare const usePeerLockHolderId: (resource: CollabResource | null, kind: CollabLockKind, id: string | null) => string | null;
2118
+
2119
+ /**
2120
+ * useCollectionScope reads the active collection scope from the URL: the organization whose
2121
+ * folders the sidenav tree is showing, or undefined for the personal scope. The personal view
2122
+ * is the ABSENCE of the key, matching how the listing endpoints spell it. The scope lives in
2123
+ * the URL rather than in component state so it survives a reload and a link carries it.
2124
+ *
2125
+ * The tree that reads it and the surfaces that write into that tree share this one read, so a
2126
+ * collection created from the sidenav is created in the scope the reader is looking at rather
2127
+ * than silently in a different one.
2128
+ *
2129
+ * @returns The organization id of the scope, or undefined for the personal scope.
2130
+ */
2131
+ declare const useCollectionScope: () => string | undefined;
2132
+
2133
+ /**
2134
+ * SegmentDraftSource is the one thing an open segment edit needs from whatever is drawing it:
2135
+ * the handles as they stand right now.
2136
+ *
2137
+ * A structural interface with a single method, the same technique the segment tools use for
2138
+ * their map surface. The draft lives on the canvas rather than in the store, because it changes
2139
+ * on every pointer move and a store write per frame is a render per frame; a Save reads it
2140
+ * once, at the moment it is pressed. The `MapClient` of `@mountaya/elements/map-client`
2141
+ * satisfies it by having the method.
2142
+ */
2143
+ interface SegmentDraftSource {
2144
+ /** The segment's handles as the drawing surface holds them now, or null where none is drawn. */
2145
+ readonly getSegmentDraft: () => Position[] | null;
2146
+ }
2147
+ /**
2148
+ * UseEditActionsOptions scope the save. `itineraryId` names the itinerary a commit saves to,
2149
+ * and the commit reads its own scope without it. `draftSource` is where a segment save reads
2150
+ * its handles; a waypoint save reads its draft from the store, so a surface that only authors
2151
+ * waypoints may omit it.
2152
+ */
2153
+ interface UseEditActionsOptions {
2154
+ /**
2155
+ * Runs before the commit is dispatched, and is awaited.
2156
+ *
2157
+ * The seam for anything a surface wants written ONTO the draft first (an auto-generated name,
2158
+ * a provenance tag), because it has to land before the commit reads it. The commit reads the
2159
+ * draft once this has resolved, for a segment as for a waypoint. It is a hook rather than
2160
+ * something this package does, since every such value is copy: a waypoint left unnamed wants
2161
+ * "Water #2", and both the word for the icon and how the number joins it are decisions a
2162
+ * translation runtime makes.
2163
+ */
2164
+ readonly beforeSave?: (() => Promise<void> | void) | undefined;
2165
+ /**
2166
+ * Where a segment save reads its handles. A surface that only authors waypoints omits it.
2167
+ *
2168
+ * @default null
2169
+ */
2170
+ readonly draftSource?: SegmentDraftSource | null | undefined;
2171
+ /**
2172
+ * The itinerary a commit saves to. Omitted or null, a commit saves to the itinerary open in
2173
+ * the editor, or to the staged draft that shows.
2174
+ *
2175
+ * @default null
2176
+ */
2177
+ readonly itineraryId?: string | null | undefined;
2178
+ }
2179
+ /**
2180
+ * EditActionsModel is the save surface for whichever authoring session is open.
2181
+ *
2182
+ * `family` is null when none is, which is what a footer branches on to render nothing. A
2183
+ * surface that renders a frame (a sticky bar, a divider) has to know BEFORE it draws one, which
2184
+ * is why this is a hook rather than only a component: an empty frame is chrome with nothing in
2185
+ * it.
2186
+ */
2187
+ interface EditActionsModel {
2188
+ /** Whether the open session may be committed: enough handles, or a placed coordinate. */
2189
+ readonly canSave: boolean;
2190
+ /** Which authoring session is open, or null when none is. */
2191
+ readonly family: "segment" | "waypoint" | null;
2192
+ /**
2193
+ * Commits the open session, and resolves to the answer of its family's commit verb, typed by
2194
+ * that verb.
2195
+ *
2196
+ * A commit that lands answers `data.closed`. It is false where the draft changed while the
2197
+ * save was out: the save landed and the session stays open on the change, to be saved again,
2198
+ * so a surface that reads it tells the reader the edit is still open. Resolves to null when no
2199
+ * session is open at the press, and when the session was left while `beforeSave` was awaited:
2200
+ * nothing is dispatched for a session that has gone, nor for one opened once it had, of
2201
+ * either family. A session is left by a store write in which its family's session reads null.
2202
+ * One swapped for another of its family in a single write, which no tool of the studio does,
2203
+ * is read as the adoption of its own and committed. A save commits the family it was pressed
2204
+ * for.
2205
+ */
2206
+ readonly save: () => Promise<ToolResultOf<StudioToolOutputs, "studio.itinerary.segment.editCommit" | "studio.itinerary.waypoint.editCommit"> | null>;
2207
+ }
2208
+ /**
2209
+ * useEditActions drives the Save for a segment geometry edit or a waypoint authoring session.
2210
+ *
2211
+ * Mutual exclusion is enforced at the tool layer, so at most one family is open at a time and
2212
+ * the surface reads as ONE control regardless of which. The two differ in three places, and
2213
+ * each is a place two copies would drift:
2214
+ *
2215
+ * - **the tool dispatched**: `studio.itinerary.<family>.editCommit`;
2216
+ * - **where the draft comes from**: a segment reads its handles off the drawing surface at
2217
+ * press time; a waypoint's draft is already in the store, so the bus reads it there;
2218
+ * - **the save-enabled predicate**: a waypoint Save waits for a coordinate to land, a segment
2219
+ * Save for the draft to hold at least {@link SEGMENT_MIN_VIAS} handles.
2220
+ *
2221
+ * That last one is read as a BOOLEAN rather than a count, on purpose: the draft is written on
2222
+ * every interactive change, so subscribing to the number renders the footer on every pointer
2223
+ * move, while subscribing to whether it crosses the floor renders it on the single crossing.
2224
+ * Before the first change the draft is null, so an edit opened with its handles seeded reads
2225
+ * the seed count instead, already valid at two.
2226
+ *
2227
+ * The bus enforces the same floor on commit, so the render-time disable and the commit-side
2228
+ * guard agree rather than one of them being decorative.
2229
+ *
2230
+ * **This hook names nothing it saves.** A from-scratch waypoint left unnamed wants an
2231
+ * occurrence-aware label ("Water #2"), and both the word for the icon and the way the number
2232
+ * is joined to it are copy. A surface that wants one writes the name in `beforeSave`.
2233
+ *
2234
+ * @param options - The scope of the save and the source of a segment's draft; see
2235
+ * {@link UseEditActionsOptions}.
2236
+ * @returns The {@link EditActionsModel} of the open session.
2237
+ */
2238
+ declare const useEditActions: ({ beforeSave, draftSource, itineraryId, }?: UseEditActionsOptions) => EditActionsModel;
2239
+
2240
+ /**
2241
+ * useEscapeKey runs `handler` whenever the Escape key is pressed, for as long as `enabled` is
2242
+ * true.
2243
+ *
2244
+ * The listener sits on `window`, not a focused element, so the key reaches the handler even when
2245
+ * focus is captured by the map canvas, a panorama, or a text input: Escape is treated as a global
2246
+ * dismiss, never swallowed by a typing context (the reason this hook does not use Mantine's
2247
+ * `useHotkeys`, which ignores input and textarea focus). An Escape pressed inside an input
2248
+ * method's composition is the one exception: it cancels the composition and runs no handler.
2249
+ *
2250
+ * The latest `handler` is read through a ref, so a caller need not memoize it, while the listener
2251
+ * attaches once and detaches on unmount or when `enabled` flips false.
2252
+ *
2253
+ * @param handler - Runs with the keydown event, so it can `preventDefault`.
2254
+ * @param enabled - Whether the listener is attached.
2255
+ */
2256
+ declare const useEscapeKey: (handler: (event: KeyboardEvent) => void, enabled?: boolean) => void;
2257
+
2258
+ /**
2259
+ * UseInlineRenameOptions describe the one thing being renamed and what to do when the user
2260
+ * commits: `name` is the current value (the field opens on it and cancel returns to it), and
2261
+ * `onCommit` is called ONLY with a name that is non-empty and actually different.
2262
+ *
2263
+ * `locked` discards an open rename the moment it becomes true, and opens none while it holds. A
2264
+ * collaborator's lock can land while a field is open, and whoever holds the lock owns the
2265
+ * entity now, so the local edit must not persist. Without it the open field commits against
2266
+ * something the user no longer owns, which reads as their own edit being lost rather than as a
2267
+ * lock arriving. A reader who may not rename the entity at all is the same case held for good.
2268
+ */
2269
+ interface UseInlineRenameOptions {
2270
+ /**
2271
+ * Whether the rename is withheld, as a collaborator's lock or a reader who may not edit the
2272
+ * entity withholds it: true discards an open rename at once and opens none.
2273
+ */
2274
+ readonly locked?: boolean | undefined;
2275
+ /** The current name: the field opens on it and a cancel returns to it. */
2276
+ readonly name: string;
2277
+ /** Called with the trimmed name, only when it is non-empty and differs from `name`. */
2278
+ readonly onCommit: (name: string) => void;
2279
+ /**
2280
+ * Decides whether a trimmed name may be committed. A `false` HOLDS THE FIELD OPEN rather
2281
+ * than closing it, which is the difference that makes this worth a seam.
2282
+ *
2283
+ * Without it a caller has two moves, and both are wrong. Validating inside `onCommit` happens
2284
+ * after the field has already closed, so the user watches their name vanish and the old one
2285
+ * come back with nothing said. Validating before calling `commit` means reproducing the
2286
+ * Enter/blur/Escape wiring at the call site to intercept one of them, which is the whole hook,
2287
+ * written again.
2288
+ *
2289
+ * A rejected name leaves `value` and `editing` untouched, so the field keeps what the user
2290
+ * typed and a caller can show the reason beside it.
2291
+ *
2292
+ * @default Accepts anything non-empty and different from `name`.
2293
+ */
2294
+ readonly validate?: ((name: string) => boolean) | undefined;
2295
+ }
2296
+ /**
2297
+ * InlineRename is the whole state machine, in the shape a text input and its row need it.
2298
+ *
2299
+ * `inputProps` spreads onto the field; `editing` and `value` drive what the row renders. A
2300
+ * consumer whose input is not a DOM `<input>` reads `commit`, `cancel` and `setValue`
2301
+ * directly: the handlers are the convenience, not the contract.
2302
+ */
2303
+ interface InlineRename {
2304
+ /** Closes the field and puts the current name back. */
2305
+ readonly cancel: () => void;
2306
+ /** Commits the typed name, by the rules {@link UseInlineRenameOptions} states. */
2307
+ readonly commit: () => void;
2308
+ /** Whether the field is open. */
2309
+ readonly editing: boolean;
2310
+ /** The handlers and the value to spread onto a DOM `<input>`. */
2311
+ readonly inputProps: {
2312
+ /** Cancels, unless the blur follows the commit that closed the field. */
2313
+ readonly onBlur: () => void;
2314
+ /** Takes what the reader typed. */
2315
+ readonly onChange: (event: {
2316
+ readonly currentTarget: {
2317
+ readonly value: string;
2318
+ };
2319
+ }) => void;
2320
+ /** Commits on Enter and cancels on Escape, outside an input method's composition. */
2321
+ readonly onKeyDown: (event: KeyboardEvent$1<HTMLInputElement>) => void;
2322
+ /** What the field shows. */
2323
+ readonly value: string;
2324
+ };
2325
+ /** Replaces what the field holds, for an input that is not a DOM `<input>`. */
2326
+ readonly setValue: (value: string) => void;
2327
+ /**
2328
+ * start opens the field on the current name, and does nothing while the rename is `locked`. A
2329
+ * row whose single click does something else cancels that action itself, as
2330
+ * `useSegmentRow`'s `startRename` does.
2331
+ */
2332
+ readonly start: () => void;
2333
+ /** What the field holds: the text as typed while it is open. */
2334
+ readonly value: string;
2335
+ }
2336
+ /**
2337
+ * useInlineRename is rename-in-place: open on a name, commit on Enter, cancel on Escape or blur.
2338
+ * An Enter or an Escape pressed inside an input method's composition confirms or cancels the
2339
+ * composition and does neither.
2340
+ *
2341
+ * Three details are the whole reason this is a hook rather than four `useState` calls at a call
2342
+ * site, and each of them is a bug the obvious version has:
2343
+ *
2344
+ * - **Enter commits, and the blur it causes must not then cancel.** Committing exits edit mode,
2345
+ * which blurs the input, which fires the cancel path, undoing the commit that just ran. A
2346
+ * latch set by commit and cleared by the next blur is what keeps the two from fighting. The
2347
+ * next `start` clears it too, since a commit is not always followed by a blur.
2348
+ * - **Blur cancels rather than commits.** Clicking away from a half-typed name is an abandon,
2349
+ * not a submit; a field that saved on blur turns every stray click into a rename.
2350
+ * - **An empty or unchanged name commits nothing.** Trimming to empty is how a user clears the
2351
+ * field before pressing Escape, and persisting "" would leave an unnamed entity behind.
2352
+ *
2353
+ * A row that begins an edit on single click and renames on double click also has to cancel the
2354
+ * first action when the second arrives; that half is {@link useDeferredClick}, below, because it
2355
+ * is a gesture rather than a rename and a consumer may want one without the other.
2356
+ *
2357
+ * @param options - The name, the commit and the guards; see {@link UseInlineRenameOptions}.
2358
+ * @returns The {@link InlineRename} state machine, a new object only when `editing` or `value`
2359
+ * changes.
2360
+ */
2361
+ declare const useInlineRename: ({ locked, name, onCommit, validate, }: UseInlineRenameOptions) => InlineRename;
2362
+ /**
2363
+ * DeferredClick is a single-click action a double-click cancels.
2364
+ *
2365
+ * A row that opens an editor on one click and renames on two has to hold the first action back
2366
+ * long enough for the second to arrive. `schedule` arms it, `cancel` drops it, and the timer is
2367
+ * cleared on unmount so a row removed mid-gesture cannot fire into a component that is gone.
2368
+ */
2369
+ interface DeferredClick {
2370
+ /** Drops the action a single click scheduled, if it has not run. */
2371
+ readonly cancel: () => void;
2372
+ /**
2373
+ * Arms `action` to run once the double-click window has passed, replacing any action still
2374
+ * pending. `delayMs` defaults to the studio's double-click window.
2375
+ */
2376
+ readonly schedule: (action: () => void, delayMs?: number) => void;
2377
+ }
2378
+ /**
2379
+ * useDeferredClick defers a single-click action so a double-click can cancel it.
2380
+ *
2381
+ * Kept beside `useInlineRename` because the two are one gesture: without the defer, the first
2382
+ * click of a rename also opens whatever the single click does, and the user gets both.
2383
+ */
2384
+ declare const useDeferredClick: () => DeferredClick;
2385
+
2386
+ /**
2387
+ * useLiveAwareSegments overlays the in-flight segment edit onto a persisted segment chain so
2388
+ * the header totals, the segment rows and the elevation chart all read the same live-edit
2389
+ * metrics.
2390
+ *
2391
+ * While a segment edit is open the session's liveSegment carries the latest routed distance
2392
+ * and ascent (and the rest of the elevation summary); this hook swaps it in for the persisted
2393
+ * entry with the same id, or places it among them when no persisted entry exists yet: at the
2394
+ * tail for a from-scratch create, and in the gap it is bound for when the session carries an
2395
+ * insert anchor, so a segment being inserted is drawn where it will land rather than jumping
2396
+ * into position once the server renumbers the chain.
2397
+ *
2398
+ * When NO local edit is open it also folds in collaborators' live segment drafts: a peer
2399
+ * reshaping a segment of the open itinerary morphs the profile the same way a local edit does,
2400
+ * keyed by id onto the matching persisted segment. The LOCAL live segment always wins: while a
2401
+ * local edit session is active the peer drafts step aside entirely (the local preview owns the
2402
+ * elevation sink, the same contention rule the map ghost obeys), so a local edit is never
2403
+ * fought by a peer's substitution. Outside any edit AND with no peer draft, the passed chain
2404
+ * flows back by reference, so a memoised consumer sees no change.
2405
+ *
2406
+ * Each read is its own narrow subscription rather than one object selector. Each returns a
2407
+ * slot (a primitive or a stored reference), so none of them can allocate, which is the one way
2408
+ * a store selector goes wrong: React refuses a snapshot that never settles.
2409
+ *
2410
+ * @param segments - The persisted chain, as the open itinerary holds it.
2411
+ * @returns The chain with the live edit or the peers' drafts folded in, or `segments` itself
2412
+ * when there is nothing to fold.
2413
+ */
2414
+ declare const useLiveAwareSegments: (segments: ItineraryViewSource["segments"]) => ItineraryViewSource["segments"];
2415
+
2416
+ /**
2417
+ * MapHoveredRow is what a list row needs to answer the map's pointer: whether the feature this
2418
+ * row stands for is the one under the cursor, and the ref to hang on the row element so it can
2419
+ * be brought into view when it is.
2420
+ */
2421
+ interface MapHoveredRow<TElement extends HTMLElement = HTMLDivElement> {
2422
+ /** Whether the pointer is over this row's feature on the map. */
2423
+ readonly hovered: boolean;
2424
+ /** The ref to hang on the row element, which is scrolled into view as its feature lights. */
2425
+ readonly rowRef: RefObject<TElement | null>;
2426
+ }
2427
+ /**
2428
+ * useMapHoveredRow tells one editor row whether the pointer is over ITS feature on the map, and
2429
+ * scrolls it into view when it becomes so. It is the receiving half of the map→list hover: the
2430
+ * map records which segment or waypoint the pointer entered, and each row reads only whether
2431
+ * that record names it.
2432
+ *
2433
+ * The selector is a BOOLEAN rather than the hovered entity. A long itinerary renders one row
2434
+ * per segment and per waypoint, and every one of them subscribes: reading the object would
2435
+ * render the whole list again on every pointer enter and leave, while reading "is it me"
2436
+ * renders the two rows whose answer changed, the one lighting up and the one going dark.
2437
+ *
2438
+ * Scrolling is scoped to the false→true edge and uses `block: "nearest"`, so a row already on
2439
+ * screen is never moved. Without it the feature is only followed for the rows that happen to be
2440
+ * visible, which on a long itinerary is most of them missing. `scrollIntoView` is called
2441
+ * optionally because it is a layout API a headless test environment does not implement, and a
2442
+ * hover echo is not worth a thrown render.
2443
+ *
2444
+ * The smooth scroll is an ANIMATION the pointer triggers, and it fires repeatedly as the cursor
2445
+ * crosses an itinerary, so it honours the viewer's reduced-motion setting: with motion off the row
2446
+ * is still brought into view, it simply arrives at once.
2447
+ *
2448
+ * A ref and a scroll are not rendering: this hook decides nothing about markup, and the element
2449
+ * it scrolls is whichever one the consumer chose to hang the ref on. It is generic over that
2450
+ * element (`HTMLDivElement` unless stated), so a consumer wiring their own markup off the
2451
+ * headless entry hangs it on a `<div>`, an `<li>`, an `<article>` or anything else: the ref is
2452
+ * read once per hover edge, for `scrollIntoView`, which every element has.
2453
+ *
2454
+ * @param kind - Whether the row stands for a segment or a waypoint.
2455
+ * @param id - The id of the entity the row stands for.
2456
+ * @returns Whether the row's feature is hovered, and the ref to hang on the row.
2457
+ */
2458
+ declare const useMapHoveredRow: <TElement extends HTMLElement = HTMLDivElement>(kind: ItinerarySelection["kind"], id: string) => MapHoveredRow<TElement>;
2459
+
2460
+ /** UsePlatformViewerOptions is what {@link usePlatformViewer} reads. */
2461
+ interface UsePlatformViewerOptions {
2462
+ /**
2463
+ * The client the memberships are read with. It reads the memberships of the user its session
2464
+ * token was minted for, who is the person `viewer` names: a publishable key beside a session
2465
+ * token your server minted with that person's `user_id`. A session minted without `user_id`
2466
+ * reads none, and the viewer holds nothing.
2467
+ *
2468
+ * Omitted, the client of the `MountayaProvider` above.
2469
+ */
2470
+ readonly client?: Mountaya | undefined;
2471
+ /**
2472
+ * Whether an id names the reader's own space rather than an organization, for a host that
2473
+ * spells its personal space with an organization id: the `isPersonalScope` of the roster it
2474
+ * hands `MountayaStudioHost`. Read when the viewer is asked, so a predicate written inline is
2475
+ * the same viewer at every render. Its answer for an id holds for the mount, or moves only in a
2476
+ * render that also changes `organizationId`, `personalSpace` or the memberships: nothing
2477
+ * subscribes to the predicate, so a change of its answer alone reaches a surface only when
2478
+ * something else renders it.
2479
+ *
2480
+ * @default Only an absent id, as `defaultStudioScope` of `@mountaya/studio` reads one.
2481
+ */
2482
+ readonly isPersonalScope?: ((organizationId: string | null | undefined) => boolean) | undefined;
2483
+ /**
2484
+ * The scope in view: the organization the studio is showing, or `null` for the reader's own
2485
+ * space. A change tells the studio's surfaces once the render that states it commits.
2486
+ *
2487
+ * It is the `organization_id` the studio's URL names, kept equal to it by the host: the viewer
2488
+ * answers what the person holds in this scope, and the studio's surfaces read the URL's scope
2489
+ * for everything else, so a studio showing one organization under a viewer answering for
2490
+ * another offers what neither scope holds.
2491
+ */
2492
+ readonly organizationId: string | null;
2493
+ /**
2494
+ * The answer for the reader's own space, which no operation of the public contract returns, or
2495
+ * `undefined` while the host has none. Left out, the personal space holds no feature and states
2496
+ * no ceiling, which is the reading for a publishable key: it never reaches the personal space.
2497
+ *
2498
+ * A value, as the host's read holds it: an answer written inline, or rebuilt at every render,
2499
+ * is the same answer while it states the same ceiling and the same features, and the studio's
2500
+ * surfaces are told once the render that changes it commits.
2501
+ */
2502
+ readonly personalSpace?: PlatformScopeAnswer | undefined;
2503
+ /**
2504
+ * The query cache the memberships are read on: the one handed to `MountayaStudioHost` as
2505
+ * `data.queryClient`, so the studio and its viewer read one cache.
2506
+ *
2507
+ * Omitted, the cache of the `QueryClientProvider` above.
2508
+ */
2509
+ readonly queryClient?: QueryClient | undefined;
2510
+ /**
2511
+ * The rest of the viewer, which the host answers itself: who the person is (the user the
2512
+ * session token was minted for, whose memberships are read), the units they read in, where a preference is kept, and the
2513
+ * subscription that tells their changes. `createMemoryViewer` of `@mountaya/studio` answers it
2514
+ * for a host that keeps preferences nowhere.
2515
+ *
2516
+ * Held by its members, like `data.viewer` on `MountayaStudioHost`.
2517
+ */
2518
+ readonly viewer: Pick<StudioViewer, "getPreferences" | "getUserId" | "setPreferences" | "subscribe">;
2519
+ }
2520
+ /**
2521
+ * PlatformViewerState is what {@link usePlatformViewer} answers: the viewer, and where the read it
2522
+ * is built from stands.
2523
+ *
2524
+ * The viewer alone cannot say why it holds nothing. A read still in flight, a key whose
2525
+ * organization or scope does not reach the studio, and a server that failed all leave it holding
2526
+ * nothing, as an agreement that covers nothing does, so a host that tells its reader why reads
2527
+ * `status` and `error` rather than the viewer.
2528
+ */
2529
+ interface PlatformViewerState {
2530
+ /**
2531
+ * The read's last failure, as the client raised it: a 402 for an organization that does not hold
2532
+ * Embedded Studio, a 403 for a key without the `studio-embedded` scope, a 5xx where the API
2533
+ * failed. Null while nothing has failed.
2534
+ */
2535
+ readonly error: MountayaError | null;
2536
+ /**
2537
+ * Where the memberships read stands:
2538
+ *
2539
+ * - `"pending"`: no answer has landed yet, or nobody is signed in; the viewer holds nothing.
2540
+ * - `"error"`: the read failed, and `error` says how; the viewer holds the last answer that
2541
+ * landed for this person, or nothing.
2542
+ * - `"success"`: the answer landed, and the viewer holds exactly what it lists.
2543
+ */
2544
+ readonly status: "error" | "pending" | "success";
2545
+ /**
2546
+ * The viewer to hand `MountayaStudioHost` as `data.viewer`. It keeps its identity while
2547
+ * `UsePlatformViewerOptions.viewer` states the same members, so the studio's context is built
2548
+ * once and its surfaces are told of each change through `subscribe`.
2549
+ */
2550
+ readonly viewer: StudioViewer;
2551
+ }
2552
+ /**
2553
+ * usePlatformViewer is the viewer of a person whose memberships the client reads, ready for
2554
+ * `data.viewer` on `MountayaStudioHost`: what they may use of the studio, and how many
2555
+ * itineraries they may keep, as Mountaya answers it for each scope, with where the read stands.
2556
+ *
2557
+ * It reads `users.getMyOrganizations` of `MountayaAdmin`, the memberships of the user the session
2558
+ * token was minted for, while `viewer.getUserId()` names a person, and builds the viewer with
2559
+ * `createPlatformViewer` of `@mountaya/studio`, which decides none of it: a feature is held
2560
+ * exactly where the membership of the scope in view lists it in `studio_entitlements`. A
2561
+ * membership states no itinerary ceiling: the personal space's answer states one. A publishable
2562
+ * key carrying the `studio-embedded` scope reads the one membership the session's user holds in
2563
+ * the key's organization, so a licensee's studio shows what its agreement covers, narrowed by the
2564
+ * organization's safety rules as what the key is served is: `profile-insights` only where
2565
+ * `with_profile_analysis` is set, `map-pois` only where the overlay allowlist (`with_overlays`)
2566
+ * admits the points of interest, and `map-overlays` only where it admits another overlay. A
2567
+ * licensee whose studio draws no overlays checks those rules, not its agreement.
2568
+ *
2569
+ * Until the read lands, while nobody is signed in or the session is minted without `user_id`, and
2570
+ * where it is refused, the viewer holds no entitlement and states no ceiling, and its surfaces are
2571
+ * told when the answer arrives. Those states read alike on the viewer and apart on `status` and
2572
+ * `error`: a key refused with a 402 or a 403 is a configuration to fix, not an agreement that
2573
+ * covers nothing. The answer shows or withholds what the studio offers and authorizes nothing:
2574
+ * every request is still refused by its own rule.
2575
+ *
2576
+ * Every page of the memberships is read, so a person holding more than one page of them holds
2577
+ * them all. The read's entry is under the operation's key of `mountayaKeys` of
2578
+ * `@mountaya/client-react` (`mountayaKeys.operation(scope, "rest", "getMyOrganizations")`), so a
2579
+ * host that changes what a person holds, by accepting an invitation, invalidates that key and the
2580
+ * viewer follows. The client repeats a read refused for the quota or by a failing gateway itself,
2581
+ * and the hook repeats nothing on top of it: a 500 is reported as the read's `error`.
2582
+ *
2583
+ * @param options - The client, the query cache, the scope in view, the personal space's answer
2584
+ * and the rest of the viewer.
2585
+ * @returns The viewer to hand `MountayaStudioHost` as `data.viewer`, and the read's status and
2586
+ * error.
2587
+ * @throws {MountayaElementsError} While rendering, with no `client` and no `MountayaProvider`
2588
+ * above, or with no `queryClient` and no `QueryClientProvider` above.
2589
+ * @example
2590
+ * ```tsx
2591
+ * import { QueryClient } from "@tanstack/react-query";
2592
+ * import { useState } from "react";
2593
+ *
2594
+ * import { Mountaya } from "@mountaya/client/browser";
2595
+ * import { createMemoryViewer } from "@mountaya/studio";
2596
+ * import { MountayaStudio, MountayaStudioHost, usePlatformViewer } from "@mountaya/studio-react";
2597
+ *
2598
+ * const ORGANIZATION_ID = "org_…";
2599
+ * const USER_ID = "user_…";
2600
+ *
2601
+ * // A token your server minted with postSession, its user_id set to USER_ID.
2602
+ * declare const sessionToken: string;
2603
+ *
2604
+ * const mountaya = new Mountaya({ credential: { publishableKey: "pk_…", sessionToken } });
2605
+ *
2606
+ * export const Studio = () => {
2607
+ * const [queryClient] = useState(() => new QueryClient());
2608
+ * const [person] = useState(() => createMemoryViewer({}, { getUserId: () => USER_ID }));
2609
+ * const { error, viewer } = usePlatformViewer({
2610
+ * client: mountaya,
2611
+ * organizationId: ORGANIZATION_ID,
2612
+ * queryClient,
2613
+ * viewer: person,
2614
+ * });
2615
+ *
2616
+ * return (
2617
+ * <>
2618
+ * {error === null ? null : (
2619
+ * <p role="alert">The studio cannot read what you may use: {error.message}</p>
2620
+ * )}
2621
+ * <MountayaStudioHost client={mountaya} data={{ queryClient, viewer }}>
2622
+ * <MountayaStudio />
2623
+ * </MountayaStudioHost>
2624
+ * </>
2625
+ * );
2626
+ * };
2627
+ * ```
2628
+ */
2629
+ declare const usePlatformViewer: ({ client, isPersonalScope, organizationId, personalSpace, queryClient, viewer, }: UsePlatformViewerOptions) => PlatformViewerState;
2630
+
2631
+ /**
2632
+ * StudioPluginItem is one contribution, ready to draw: what it is, whether it is dimmed, and how
2633
+ * to run it.
2634
+ *
2635
+ * `run` is bound to the live tool context and reads the target at CLICK time rather than at
2636
+ * render time, which is both more correct and what keeps the returned array stable across a
2637
+ * target rebuilt as a fresh literal every render.
2638
+ */
2639
+ interface StudioPluginItem<TSlot extends StudioPluginSlot> {
2640
+ /**
2641
+ * True while an agent run drives the studio.
2642
+ *
2643
+ * The lock DIMS rather than hides, which is the two-state posture this package already keeps:
2644
+ * a capability, entitlement or predicate refusal hides (as the video-export item does, because
2645
+ * a viewer who cannot have it should not be told about it), and a run in progress dims with a
2646
+ * reason (as every row-level control does, because it is coming back in a moment).
2647
+ */
2648
+ readonly disabled: boolean;
2649
+ /** The contribution as the registry holds it: what it draws, its plugin and its rank. */
2650
+ readonly entry: StudioSlotEntry<TSlot, ReactNode>;
2651
+ /**
2652
+ * What the action says, resolved: never empty.
2653
+ *
2654
+ * `entry.label` is optional in the CONTRACT, because the component form owes no label, while
2655
+ * validation refuses the action form at install without a non-empty label. Resolved once here
2656
+ * rather than at each render site, so no renderer keeps a fallback of its own (a fallback of
2657
+ * `""` gives a control-rail chip an empty accessible name). The qualified id is the
2658
+ * unreachable case's answer, because a name that identifies the plugin beats a name that is
2659
+ * not there.
2660
+ */
2661
+ readonly label: string;
2662
+ /** Runs the contribution's verb. Never throws; a failure reaches the host's `onError`. */
2663
+ readonly run: () => void;
2664
+ }
2665
+ /**
2666
+ * usePluginSlot reads what is installed in one slot, gated and ordered, ready to render.
2667
+ *
2668
+ * **It is INERT outside a host and never throws**: the opposite of `useStudioPlugins`, and for
2669
+ * the opposite reason. A menu still has to render inside a story, a snapshot test or a surface a
2670
+ * consumer mounted on its own, and a dropdown that throws because nobody installed a plugin
2671
+ * would make this feature a cost every consumer pays.
2672
+ *
2673
+ * Its snapshot is read off the SLOT'S ARRAY and not off the registry's version, and that is the
2674
+ * line that decides what an install costs. The registry rebuilds only the slots a plugin
2675
+ * touched, so `at('map.controls')` is referentially identical across the install of a
2676
+ * `segment.menu` plugin, and a snapshot that reads it lets React skip the render entirely for
2677
+ * every untouched slot. Reading the scalar instead would render again and rebuild the item
2678
+ * array in EVERY `usePluginSlot` in the tree on any change: one per segment row, one per
2679
+ * waypoint row, plus the fixed sites.
2680
+ *
2681
+ * **The gates are asked live.** A contribution's gate reads the tool context, whose identity
2682
+ * holds while what it answers moves: a viewer's entitlement arrives after the mount, and a
2683
+ * plugin's `when` reads the store. So the gates are asked on every render of the surface, and
2684
+ * again whenever the registry, the store or the viewer says it changed. The surface renders for
2685
+ * it only when the set of contributions that pass is another set: the answer is compared entry
2686
+ * by entry, and the array a caller memoizes on is the one it held while the entries stand. A
2687
+ * gate is therefore cheap by contract, as the plugin's own documentation of `when` states.
2688
+ *
2689
+ * Everything else the memo depends on is stable by construction: the registry, the tool context
2690
+ * and the slot do not move, the reporter is one function for the life of the host, and the
2691
+ * target is absent from the list on purpose.
2692
+ *
2693
+ * `target` is read through a latest-ref for that last reason. It is the one thing that cannot
2694
+ * come from context (which segment, which coordinate is a per-instance fact), and it is also
2695
+ * the thing a call site most naturally rebuilds inline. Depending on its identity would re-run
2696
+ * this memo on every render of every row.
2697
+ *
2698
+ * **A NULL target draws nothing**, which is the same answer a null context gets and for the same
2699
+ * reason: a contribution acts ON something, and a surface that cannot say what has nothing it can
2700
+ * honestly render. It is what a component takes when the seam is optional (a menu published for
2701
+ * a consumer to mount directly, where the studio's own row supplies a target and a bare mount
2702
+ * does not), and it is cheaper than a sentinel, which would run every gate and bind every
2703
+ * closure against a target nobody was going to act on.
2704
+ *
2705
+ * @param slot - The slot to read, as a plugin names it.
2706
+ * @param target - What the contributions act on, or null to draw nothing.
2707
+ * @returns The contributions that pass their gates, in order, one array while they stand.
2708
+ */
2709
+ declare const usePluginSlot: <TSlot extends StudioPluginSlot>(slot: TSlot, target: StudioPluginTarget<TSlot> | null) => readonly StudioPluginItem<TSlot>[];
2710
+
2711
+ /**
2712
+ * Every mutation one segment row can dispatch, as a bundle.
2713
+ *
2714
+ * Grouped here rather than left inline in a row component so a row's render path reads as
2715
+ * layout and its mutations read as a list of verbs, and so that every one of them provably goes
2716
+ * through the bus in one place. That second reason is the load-bearing one: a row that reached
2717
+ * into a store for "just this one" would bypass the schema, the capability gate and the
2718
+ * confirmation protocol, and it would bypass them invisibly.
2719
+ *
2720
+ * The verb NAMES are the studio's vocabulary, not a parameter. A consumer registering their
2721
+ * own handlers under these names gets these hooks; a consumer inventing their own vocabulary
2722
+ * dispatches through `useStudioDispatchUnsafe` directly. Making the names configurable would
2723
+ * turn a contract into a mapping table that every call site would have to agree about.
2724
+ */
2725
+
2726
+ /** UseSegmentRowActionsOptions name the itinerary and the segment a row's verbs act on. */
2727
+ interface UseSegmentRowActionsOptions {
2728
+ /**
2729
+ * The itinerary the mutation is scoped to.
2730
+ *
2731
+ * Empty for a row backed by an unsaved draft: a draft sink keys on the segment's own client
2732
+ * id and has no itinerary to scope to yet.
2733
+ */
2734
+ readonly itineraryId: string;
2735
+ /** The segment the verbs act on. */
2736
+ readonly segmentId: string;
2737
+ }
2738
+ /**
2739
+ * SegmentRowActions are one segment row's verbs, each bound to the row's itinerary and segment,
2740
+ * and the last refusal they answered.
2741
+ *
2742
+ * `merge` takes the id of the segment folded into its successor, so a row merges with the
2743
+ * next segment under its own id and with the previous one under that segment's. `splitPick`
2744
+ * arms the pick on the map, and the split itself is reported where the pick resolves.
2745
+ * `exportSegment` and `toggleImportMode` open a surface and report nothing.
2746
+ */
2747
+ interface SegmentRowActions {
2748
+ /** Opens the export dialog scoped to this segment. */
2749
+ readonly exportSegment: () => void;
2750
+ /** Folds `segmentId` into its successor: this row's id merges with the next segment. */
2751
+ readonly merge: (segmentId: string) => Promise<void>;
2752
+ /**
2753
+ * The last refusal, naming the verb it came from, or null.
2754
+ *
2755
+ * Returned rather than raised, because where a refusal belongs on screen is a rendering
2756
+ * decision: an inline row error, a toast, an alert bar over the map. Every verb that reaches
2757
+ * the bus sets it: a server refuses a reshape for a reason the user has to see (a line the
2758
+ * router cannot follow, a merge across two engines, a cut too close to an end), and a rename,
2759
+ * a recolour or a speed for one they have to see as well (a write the API refused, a
2760
+ * collaborator's lock, a staged draft's save in flight), and a row menu closes on click with no
2761
+ * slot left to hold it.
2762
+ *
2763
+ * It carries the VERB and not only the result, because a caller cannot say anything useful
2764
+ * about a refusal without knowing what was refused: "Couldn't delete this segment" and
2765
+ * "Couldn't merge these segments" are different sentences, and a result alone leaves a
2766
+ * consumer matching on the server's message to tell them apart.
2767
+ *
2768
+ * A success clears it. A withheld confirmation ({@link isConfirmationWithheld}) is never kept:
2769
+ * it clears the field as a success does, since the verb never ran. A prompt the user declined
2770
+ * or let expire is their decision, not a refusal, and a context with no `confirm` seam, which
2771
+ * asks nobody, answers `confirmation-denied` and is read the same way.
2772
+ */
2773
+ readonly lastFailure: SegmentRowFailure | null;
2774
+ /** Recolours the segment. */
2775
+ readonly recolor: (color: string) => Promise<void>;
2776
+ /** Deletes the segment, once the reader confirms. */
2777
+ readonly remove: () => Promise<void>;
2778
+ /** Renames the segment. */
2779
+ readonly rename: (name: string) => Promise<void>;
2780
+ /** Changes the engine the segment is drawn with. */
2781
+ readonly setMode: (mode: SegmentEditMode) => Promise<void>;
2782
+ /** Sets the segment's speed in km/h, or null for the activity's default. */
2783
+ readonly setSpeed: (speed: number | null) => Promise<void>;
2784
+ /** Arms the pick on the map where the segment is split. */
2785
+ readonly splitPick: () => Promise<void>;
2786
+ /** Toggles a proposed segment between its routed and its freehand candidate. */
2787
+ readonly toggleImportMode: () => void;
2788
+ }
2789
+ /**
2790
+ * SegmentRowVerb names the verbs whose refusal a segment row hands its caller.
2791
+ *
2792
+ * A closed union rather than a string, so a consumer's switch over it is exhaustive: adding a
2793
+ * refusable verb here fails every caller that maps one to a sentence, which is exactly the
2794
+ * place a new verb needs to be noticed.
2795
+ *
2796
+ * `insert` and `editBegin` are not dispatched by {@link useSegmentRowActions}: the first is
2797
+ * raised by the row's chain menu and the second by the row opening its geometry editor, and the
2798
+ * one-edit-at-a-time gate refuses either while another session is armed, since an insert opens
2799
+ * its draw as an edit. Both belong in the same union because a caller maps
2800
+ * every refusal to a sentence in ONE place, and splitting the vocabulary by which hook happened
2801
+ * to raise it would make that caller ask a question it does not care about.
2802
+ *
2803
+ * `groupOpen`, `groupDelete` and `groupSetRange` are the list's group verbs, which
2804
+ * `useSegmentList` hands its `onFailure`: the group form opened on a group or seeded for a
2805
+ * segment (`studio.itinerary.group.modal.open`), a group dissolved
2806
+ * (`studio.itinerary.group.delete`) and a group's membership replaced
2807
+ * (`studio.itinerary.group.setRange`). Each is refused over a staged draft, and the last two
2808
+ * while a collaborator holds the group.
2809
+ */
2810
+ type SegmentRowVerb = "editBegin" | "groupDelete" | "groupOpen" | "groupSetRange" | "insert" | "merge" | "recolor" | "remove" | "rename" | "setMode" | "setSpeed" | "splitPick";
2811
+ /** A refusal, and the verb it came from. */
2812
+ interface SegmentRowFailure {
2813
+ /** The refusal the bus answered. */
2814
+ readonly result: ToolResult;
2815
+ /** The verb that was refused. */
2816
+ readonly verb: SegmentRowVerb;
2817
+ }
2818
+ /**
2819
+ * useSegmentRowActions binds one segment row's verbs to the studio's bus, each dispatched with
2820
+ * the itinerary and segment the row is scoped to.
2821
+ *
2822
+ * Every verb but the export and the import toggle, which open a surface, keeps its last refusal
2823
+ * as `lastFailure`, and a success or a withheld confirmation clears it;
2824
+ * {@link SegmentRowActions.lastFailure} says which refusals are kept.
2825
+ */
2826
+ declare const useSegmentRowActions: ({ itineraryId, segmentId, }: UseSegmentRowActionsOptions) => SegmentRowActions;
2827
+
2828
+ /**
2829
+ * SegmentSeamModel is one gutter's resolved shape: the segment a new one is inserted AFTER
2830
+ * (null at the head, where there is nothing before it) and the merge it offers.
2831
+ *
2832
+ * The merge is null at the head of the chain, and wherever the two rows the gutter sits between
2833
+ * are not the committed pair it would fuse. An uncommitted row rendered between them (an insert
2834
+ * being drawn into that very gap) would leave the gutter above it pointing at a fusion of two
2835
+ * rows the pointer is nowhere near, and the control's own hover preview would light them up as
2836
+ * if it were.
2837
+ */
2838
+ interface SegmentSeamModel {
2839
+ /** The segment a new one is inserted after, or null at the head of the chain. */
2840
+ readonly afterSegmentId: string | null;
2841
+ /** The merge the gutter offers, or null where its two rows are not the pair it would fuse. */
2842
+ readonly merge: SegmentChainMerge | null;
2843
+ }
2844
+ /**
2845
+ * SegmentListActions are the verbs a list dispatches that a row does not: the insert and the
2846
+ * merge that reshape the chain from a gutter, the preview that lights what a merge would fuse,
2847
+ * and the group verbs that move a segment in and out of a group.
2848
+ *
2849
+ * `groupSegment` and `removeFromGroup` read the chain AT DISPATCH TIME off the store handle
2850
+ * rather than closing over it, and every verb reads `onFailure` when it answers, which is what
2851
+ * keeps their identity stable across a live edit and an inline callback: a list bundles them
2852
+ * into objects every memoised row compares by reference, so a callback churning on the
2853
+ * throttled live-segment tick would render the whole list again many times a second.
2854
+ */
2855
+ interface SegmentListActions {
2856
+ /** Opens the group form for an existing group. A refusal reaches `onFailure` as `groupOpen`. */
2857
+ readonly editGroup: (groupId: string) => Promise<void>;
2858
+ /**
2859
+ * Opens the group form seeded with this segment and one free neighbour. It opens nothing for
2860
+ * an id the stored chain does not hold (a draft's row, a proposal). A refusal reaches
2861
+ * `onFailure` as `groupOpen`.
2862
+ */
2863
+ readonly groupSegment: (segmentId: string) => Promise<void>;
2864
+ /**
2865
+ * Begins drawing a segment after `afterSegmentId` (null for the head of the chain) in `mode`.
2866
+ * A refusal reaches `onFailure` as `insert`.
2867
+ */
2868
+ readonly insert: (afterSegmentId: string | null, mode: SegmentEditMode) => Promise<void>;
2869
+ /**
2870
+ * Folds `segmentId` into its successor. A refusal reaches `onFailure` as `merge`.
2871
+ */
2872
+ readonly merge: (segmentId: string) => Promise<void>;
2873
+ /** Emphasises the pair a merge would fuse, or restores the itinerary's emphasis with null. */
2874
+ readonly previewMerge: (segmentIds: readonly string[] | null) => void;
2875
+ /**
2876
+ * Leaves the group, dissolving it when one member would be left behind. A refusal reaches
2877
+ * `onFailure` as `groupDelete` for a dissolve and as `groupSetRange` for a shrink.
2878
+ */
2879
+ readonly removeFromGroup: (segmentId: string) => Promise<void>;
2880
+ }
2881
+ /**
2882
+ * SegmentListModel is what {@link useSegmentList} hands a segment list: the chain folded into
2883
+ * the models its rows and gutters read, the verbs neither of them owns, and the flags that
2884
+ * decide whether a new edit may begin.
2885
+ *
2886
+ * `actions` keeps one identity while the itinerary, the slug and the store do, and so does
2887
+ * every other member while what it is derived from stands, so a memoised row handed one of them
2888
+ * renders only when it moves.
2889
+ */
2890
+ interface SegmentListModel {
2891
+ /** The verbs the list dispatches that a row does not. */
2892
+ readonly actions: SegmentListActions;
2893
+ /** True while a run drives the workspace: every entry point into a new edit stands down. */
2894
+ readonly agentDriving: boolean;
2895
+ /** The ends of the committed chain, which decide what a row at either end offers. */
2896
+ readonly chainEnds: SegmentChainEnds;
2897
+ /** The grouping fold, keyed by segment id. */
2898
+ readonly groupRuns: ReadonlyMap<string, SegmentGroupRun>;
2899
+ /** True while ANY authoring engine owns the map: segment, waypoint or zone. */
2900
+ readonly isEditing: boolean;
2901
+ /** The committed chain with the in-flight edit overlaid: what the list RENDERS. */
2902
+ readonly liveSegments: ItineraryViewSource["segments"];
2903
+ /**
2904
+ * Who holds each locked segment, keyed by segment id. Absent means free.
2905
+ *
2906
+ * Resolved for the whole chain in one subscription rather than per row: `usePeerLockHolderId`
2907
+ * is a hook, so a row asking it is a subscription per row, and turning an id into a NAME is a
2908
+ * directory read the host would then issue once per row to answer a question that matters for
2909
+ * the one contested row.
2910
+ */
2911
+ readonly lockHolderIds: ReadonlyMap<string, string>;
2912
+ /** The merges the committed chain allows, read by the gutters and the row menus alike. */
2913
+ readonly merges: SegmentChainMerges;
2914
+ /** One model per rendered row, positional over {@link SegmentListModel.liveSegments}. */
2915
+ readonly seams: readonly SegmentSeamModel[];
2916
+ /** True when a gutter may offer its accelerators at all. */
2917
+ readonly seamsEnabled: boolean;
2918
+ }
2919
+ /**
2920
+ * UseSegmentListOptions name the itinerary a segment list renders, its committed chain, and
2921
+ * what a list needs that it cannot derive: the activity an insert routes for and who hears its
2922
+ * refusals.
2923
+ */
2924
+ interface UseSegmentListOptions {
2925
+ /** The activity an inserted routed segment routes for. */
2926
+ readonly activitySlug?: string | undefined;
2927
+ /** The itinerary whose chain the list renders and whose verbs it dispatches. */
2928
+ readonly itineraryId: string;
2929
+ /**
2930
+ * A refusal from one of the list's chain verbs or group verbs, in the row's own vocabulary.
2931
+ *
2932
+ * `SegmentRowFailure` rather than a union of the list's own, because a host maps every
2933
+ * refusal to a sentence in ONE place: a gutter's insert and a row menu's insert are the same
2934
+ * refusal reaching the user from two controls, and giving them two vocabularies would make
2935
+ * the host answer the same question twice and eventually differently.
2936
+ *
2937
+ * For the same reason it hears the refusals a row keeps as its `lastFailure` and no others: a
2938
+ * withheld confirmation ({@link isConfirmationWithheld}) never reaches it, since the verb never
2939
+ * ran.
2940
+ */
2941
+ readonly onFailure?: ((failure: SegmentRowFailure) => void) | undefined;
2942
+ /** The COMMITTED chain, in chain order. */
2943
+ readonly segments: ItineraryViewSource["segments"];
2944
+ }
2945
+ /**
2946
+ * useSegmentList is everything a segment list is except its markup: the chain folded into the
2947
+ * models its rows and gutters read, the verbs neither of them owns, and the flags that decide
2948
+ * whether a new edit may begin at all.
2949
+ *
2950
+ * **Every model is derived from the COMMITTED chain, and the rendered list is not the committed
2951
+ * chain.** A from-scratch draft appended at the tail, and an insert being drawn into a gap, both
2952
+ * occupy a visual position without occupying a chain position, so answering "which row is the
2953
+ * tail" positionally over what is rendered would let the real tail offer a merge it has no
2954
+ * successor for and lose its own Delete. The one thing that IS positional over the rendered list
2955
+ * is `seams`, because a gutter is a divider between two rendered rows.
2956
+ *
2957
+ * **The store reads are narrow.** The lock holders are read for the whole chain in one
2958
+ * subscription, whose map keeps its identity until a lock on a listed segment moves, so the
2959
+ * merge model derives again on a lock landing and on nothing else. Reading a holder per gutter
2960
+ * instead would cost two subscriptions per row on a chain that can run to dozens.
2961
+ *
2962
+ * @param options - The itinerary, its committed chain and the list's callbacks; see
2963
+ * {@link UseSegmentListOptions}.
2964
+ * @returns The {@link SegmentListModel} a list renders from.
2965
+ */
2966
+ declare const useSegmentList: ({ activitySlug, itineraryId, onFailure, segments, }: UseSegmentListOptions) => SegmentListModel;
2967
+
2968
+ /**
2969
+ * SegmentRowPostureState is what a row is allowed to BE, as one closed choice.
2970
+ *
2971
+ * A renderer branches on this rather than on a set of booleans, because the answers are
2972
+ * ordered and the order is load-bearing. Unsaved wins outright, ahead even of an open rename:
2973
+ * nothing about a row the server has never seen can be renamed, locked or driven, so the other
2974
+ * questions do not arise. After that, renaming wins over a lock that lands mid-rename (the
2975
+ * rename is already being discarded), and a peer's hold outranks a run's, because it can name
2976
+ * a person.
2977
+ */
2978
+ type SegmentRowPostureState = {
2979
+ readonly kind: "agentDriving";
2980
+ readonly reason: string;
2981
+ } | {
2982
+ readonly kind: "interactive";
2983
+ } | {
2984
+ readonly kind: "peerLocked";
2985
+ readonly reason: string;
2986
+ } | {
2987
+ readonly kind: "renaming";
2988
+ } | {
2989
+ readonly kind: "unsaved";
2990
+ readonly reason: string;
2991
+ };
2992
+ /**
2993
+ * UseSegmentRowOptions are what a row cannot derive for itself.
2994
+ *
2995
+ * The three hints are RESOLVED SENTENCES, and each is what its posture says on screen. A peer
2996
+ * lock names a person, which means a directory read the host owns; an unsaved row and a driven
2997
+ * one are static copy. Passing null for any of them means that state cannot arise on this
2998
+ * surface: a read-only list has no unsaved rows, a single-player one no peers.
2999
+ *
3000
+ * `onEditGeometry` overrides how the row opens an edit. Absent, it opens the persisted chain's
3001
+ * edit for `segmentId` through the published assembler, so a row dropped into a studio works
3002
+ * without wiring; a surface whose chain lives somewhere else (an import draft, a proposal)
3003
+ * supplies its own.
3004
+ *
3005
+ * `activitySlug` is what a directions edit routes under, and the one thing neither the row nor
3006
+ * the assembler beneath it can resolve: which activity an itinerary belongs to, and what the
3007
+ * router calls it, is the host's catalog to answer. Without it a directions edit opens and
3008
+ * draws no line, so a surface that grants the edit at all supplies it.
3009
+ */
3010
+ interface UseSegmentRowOptions {
3011
+ /** The router profile a directions edit routes under. */
3012
+ readonly activitySlug?: string | undefined;
3013
+ /** The sentence a row shows while a run drives the studio, or null where none can. */
3014
+ readonly agentLockHint?: string | null | undefined;
3015
+ /** The itinerary the row belongs to. Undefined for a draft's row, whose id is on no tile. */
3016
+ readonly itineraryId?: string | undefined;
3017
+ /** Opens the row's edit in place of the persisted chain's. */
3018
+ readonly onEditGeometry?: (() => void) | undefined;
3019
+ /**
3020
+ * A refusal of one of the row's verbs, with the verb it came from. Read through a ref, so a
3021
+ * handler written inline is safe.
3022
+ */
3023
+ readonly onFailure?: ((failure: SegmentRowFailure) => void) | undefined;
3024
+ /** The sentence a row shows while a peer holds the segment, or null where none can. */
3025
+ readonly peerLockHint?: string | null | undefined;
3026
+ /** The segment the row stands for. */
3027
+ readonly segmentId: string;
3028
+ /** The segment's current name, which the rename opens on. */
3029
+ readonly segmentName: string;
3030
+ /** The sentence a row shows while its segment is not saved yet, or null where none can be. */
3031
+ readonly unsavedHint?: string | null | undefined;
3032
+ }
3033
+ /**
3034
+ * SegmentRow is everything a segment row is, minus the markup.
3035
+ *
3036
+ * `active` and `menuOpen` are the row's transient chrome: the `…` trigger reveals on hover or
3037
+ * keyboard focus and pins visible while its menu is open. Neither belongs in a shared store: a
3038
+ * pointer crossing a long list would otherwise write once per row it crosses.
3039
+ */
3040
+ interface SegmentRow<TElement extends HTMLElement = HTMLDivElement> {
3041
+ /** True while the pointer or the keyboard is on the row, or its menu is open. */
3042
+ readonly active: boolean;
3043
+ /** The row's verbs, each bound to its itinerary and segment. */
3044
+ readonly actions: SegmentRowActions;
3045
+ /** Opens the geometry editor, deferred so a double-click can cancel it. */
3046
+ readonly editGeometry: () => void;
3047
+ /** True while the pointer is over THIS segment's line on the map. */
3048
+ readonly mapHovered: boolean;
3049
+ /** Whether the row's menu is open, which pins its trigger visible. */
3050
+ readonly menuOpen: boolean;
3051
+ /**
3052
+ * What a `segment.menu` plugin contribution acts on, held stable.
3053
+ *
3054
+ * Memoized HERE rather than built at the call site, because every consumer of it is a
3055
+ * memoized row: an object literal inside the list's `.map` would compare unequal on every
3056
+ * render of the list and defeat the memo on the row, the action cluster and the menu at once,
3057
+ * which is the shape `memoPolicy.test.ts` refuses.
3058
+ *
3059
+ * `itineraryId` is nullable because the same row renders for an import DRAFT, whose chain has
3060
+ * no server-side itinerary behind it yet.
3061
+ */
3062
+ readonly pluginTarget: StudioPluginTarget<"segment.menu">;
3063
+ /** What the row is allowed to be, as one closed choice. */
3064
+ readonly posture: SegmentRowPostureState;
3065
+ /**
3066
+ * The inline rename of the segment's name. Its commit is gated by the display name's rule
3067
+ * (`displayNameSchema` of `@mountaya/studio`): a name the rule refuses leaves `editing` true
3068
+ * and `value` as typed, and nothing is dispatched.
3069
+ */
3070
+ readonly rename: InlineRename;
3071
+ /** Spread onto the row element: hover, focus and the ref the map hover scrolls. */
3072
+ readonly rowProps: {
3073
+ /** Hides the trigger once focus leaves the row's subtree. */
3074
+ readonly onBlur: (event: FocusEvent<HTMLElement>) => void;
3075
+ /** Reveals the trigger for a keyboard user. */
3076
+ readonly onFocus: () => void;
3077
+ /** Reveals the trigger and emphasises the segment on the map. */
3078
+ readonly onMouseEnter: () => void;
3079
+ /** Hides the trigger and gives the itinerary its emphasis back. */
3080
+ readonly onMouseLeave: () => void;
3081
+ /** The ref the map hover scrolls into view. */
3082
+ readonly ref: RefObject<TElement | null>;
3083
+ };
3084
+ /** Opens or closes the row's menu. */
3085
+ readonly setMenuOpen: (open: boolean) => void;
3086
+ /** Opens the inline rename, cancelling the geometry edit the first click scheduled. */
3087
+ readonly startRename: () => void;
3088
+ }
3089
+ /**
3090
+ * useSegmentRow is the whole of a segment row that is not markup: its verbs, the rename state
3091
+ * machine, the hover surfaces of the row and of the map, and the posture the renderer branches
3092
+ * on.
3093
+ *
3094
+ * **Hovering the row emphasises its segment on the map, and leaving restores the itinerary's.**
3095
+ * That pairing is the reason it lives here rather than at a call site: a row that emphasised on
3096
+ * enter and forgot to restore on leave leaves the map dimmed around one segment forever, and
3097
+ * the bug is invisible until a user moves the pointer away. A row unmounted under the pointer
3098
+ * restores it too. A row with no `itineraryId` is a draft's, whose id is on no tile: it sends
3099
+ * the map no emphasis, since one that lights nothing dims every line.
3100
+ *
3101
+ * Everything is derived from the store and the provider except the three sentences and the
3102
+ * optional edit override: see {@link UseSegmentRowOptions}.
3103
+ *
3104
+ * @returns The {@link SegmentRow} a renderer draws from.
3105
+ */
3106
+ declare const useSegmentRow: <TElement extends HTMLElement = HTMLDivElement>({ activitySlug, agentLockHint, itineraryId, onEditGeometry, onFailure, peerLockHint, segmentId, segmentName, unsavedHint, }: UseSegmentRowOptions) => SegmentRow<TElement>;
3107
+
3108
+ /**
3109
+ * Reading SEVERAL slots of a store in one subscription.
3110
+ *
3111
+ * Every store hook here compares with `Object.is`, which makes a selector that builds an object
3112
+ * render its component again on every write anywhere in the store: the object is a fresh
3113
+ * allocation each time, so it never equals the last one. That is `Object.is` doing what it
3114
+ * says, and the studio's own `select*` helpers avoid it by reading a single slot.
3115
+ *
3116
+ * A surface that needs several slots has two honest options: one call per slot, or one call
3117
+ * whose result is compared by members instead of by identity. This is the second, and it is a
3118
+ * SELECTOR wrapper rather than a hook over a particular store so that one implementation serves
3119
+ * `useUiStore`, `useStoreSlice` and `useStudioStore` alike.
3120
+ *
3121
+ * It lives here rather than in `@mountaya/elements` because comparing the LAST result against
3122
+ * the next one is a React-render-cycle idea; the store underneath has no notion of a previous
3123
+ * render. And it exists at all rather than `zustand/react/shallow`'s `useShallow` because
3124
+ * reaching for that entry puts a second copy of zustand's React half in a consumer's bundle for
3125
+ * a memo this short.
3126
+ */
3127
+ /**
3128
+ * useShallowSelector wraps a selector so its result is compared by members rather than by
3129
+ * identity.
3130
+ *
3131
+ * The wrapped selector may build a fresh object per call (that is the point), and the memo
3132
+ * below hands back the previous one whenever the members match, so the `Object.is` inside
3133
+ * `useSyncExternalStore` sees no change and the component sits still. An array, a plain object,
3134
+ * a `Map` and a `Set` are compared by their members, and a `Date` by its instant. Any other
3135
+ * object is compared by identity, so a selector that builds one per call (a class instance)
3136
+ * never settles, and React refuses it as it refuses an allocating selector with no wrapper.
3137
+ *
3138
+ * The selector still runs on every notification, so it must stay cheap: read slots, do not
3139
+ * compute. Sorting a list or deriving a total inside one turns every write in the store into
3140
+ * that work, and the result will not be shallow-equal anyway.
3141
+ *
3142
+ * @param selector - The selector to wrap, which may be written inline.
3143
+ * @returns The wrapped selector, to hand to `useUiStore`, `useStoreSlice` or `useStudioStore`.
3144
+ *
3145
+ * @example
3146
+ * ```tsx
3147
+ * const { agentDriving, locating } = useUiStore(
3148
+ * useShallowSelector((state) => ({ agentDriving: state.agentDriving, locating: state.locating })),
3149
+ * );
3150
+ * ```
3151
+ */
3152
+ declare const useShallowSelector: <TState, TSlice>(selector: (state: TState) => TSlice) => ((state: TState) => TSlice);
3153
+
3154
+ /**
3155
+ * Subscribing to the studio's store from React, without taking React's store library.
3156
+ *
3157
+ * `@mountaya/studio` builds its store on `zustand/vanilla`: a subscribable object and nothing
3158
+ * more, which is what lets the rules run in a worker or a React Native runtime. Turning one
3159
+ * into a hook is this package's job, and `useSyncExternalStore` is the whole of it: React
3160
+ * ships the correct implementation, including the tearing guarantees a hand-written
3161
+ * subscribe/setState pair gets wrong under concurrent rendering.
3162
+ *
3163
+ * Not `zustand/react`'s `useStore`, on purpose. It would work, and it would put a second copy
3164
+ * of zustand's React entry in a consumer's bundle beside whatever their own state library
3165
+ * already is, for a hook this short.
3166
+ */
3167
+ /**
3168
+ * ReadableStore is the shape this hook needs and nothing more: subscribe, and read.
3169
+ *
3170
+ * Structural rather than zustand's `StoreApi`, so a consumer driving these hooks from their
3171
+ * own store (a Redux slice, a signal, a hand-rolled emitter) satisfies it by having the two
3172
+ * methods rather than by adopting a dependency.
3173
+ */
3174
+ interface ReadableStore<TState> {
3175
+ /** Reads the store's state as it stands. */
3176
+ readonly getState: () => TState;
3177
+ /** Tells `listener` of every change, until the function it returns is called. */
3178
+ readonly subscribe: (listener: () => void) => () => void;
3179
+ }
3180
+ /**
3181
+ * useStudioStore subscribes to a slice of a studio store.
3182
+ *
3183
+ * The selector is applied on every notification, so it must be CHEAP and it must return a
3184
+ * stable reference for unchanged state: the studio's own selectors are written that way (they
3185
+ * read a slot off the state rather than building a fresh object) precisely so a subscriber
3186
+ * renders on the change it cares about and not on every write.
3187
+ *
3188
+ * A selector that derives a new object per call renders its component again on every store
3189
+ * write anywhere in the tree. That is not a limitation of this hook; it is `Object.is` doing
3190
+ * what it says, and no amount of memoisation inside here can fix a selector that is a fresh
3191
+ * allocation. Wrap one in {@link useShallowSelector} when the slice spans several slots.
3192
+ *
3193
+ * @param store - The store to read, or null where none is mounted.
3194
+ * @param selector - Reads the slice off the state.
3195
+ * @param fallback - What the hook answers while `store` is null.
3196
+ * @returns The slice, or `fallback` with no store.
3197
+ */
3198
+ declare const useStudioStore: <TState, TSlice>(store: ReadableStore<TState> | null, selector: (state: TState) => TSlice, fallback: TSlice) => TSlice;
3199
+
3200
+ /**
3201
+ * Subscribing to a store that is always there.
3202
+ *
3203
+ * The twin of `useStudioStore` next door, minus its one accommodation. That hook takes a
3204
+ * NULLABLE store, because the seams it reads are provider-shaped: a surface rendered outside a
3205
+ * `StudioProvider` has no store and needs an answer rather than an exception. A store held on a
3206
+ * value a component already has (one handed down by a provider that threw if it was missing,
3207
+ * one created by the component itself) is never null, and passing a fallback for a branch that
3208
+ * cannot be taken is a value invented to satisfy the type checker.
3209
+ *
3210
+ * Not `zustand/react`'s `useStore`, for the reason `useStudioStore` gives and one more: this
3211
+ * package declares no dependency on zustand, so reaching for that entry would inline its React
3212
+ * half into this package's bundle beside whatever copy the consumer's own tree has. Two copies
3213
+ * of a store library is not a size problem: it is two subscriber lists, and a component
3214
+ * subscribed through the second one never renders for a write made through the first.
3215
+ *
3216
+ * `useSyncExternalStore` is nearly all of it: React ships the correct implementation,
3217
+ * including the tearing guarantees a hand-written subscribe and setState pair gets wrong under
3218
+ * concurrent rendering.
3219
+ */
3220
+
3221
+ /**
3222
+ * useStoreSlice subscribes to a slice of a store.
3223
+ *
3224
+ * The selector runs on every notification, so it must be CHEAP and it must return a stable
3225
+ * reference for unchanged state: a selector that derives a new object per call renders its
3226
+ * component again on every write anywhere in the store. That is `Object.is` doing what it
3227
+ * says, and no memoisation inside here can fix a selector that is a fresh allocation. Wrap one
3228
+ * in {@link useShallowSelector} when the slice spans several slots.
3229
+ *
3230
+ * @returns The slice the selector reads, read again at each notification of the store.
3231
+ */
3232
+ declare const useStoreSlice: <TState, TSlice>(store: ReadableStore<TState>, selector: (state: TState) => TSlice) => TSlice;
3233
+
3234
+ /**
3235
+ * STREETVIEW_CORRIDOR_METERS is how far from the itinerary a bounded Street View drop (and a
3236
+ * walking step inside the panorama) may stray before it is refused.
3237
+ *
3238
+ * Itineraries follow the roads and trails where Street View lives, so a tight corridor accepts a
3239
+ * near-itinerary drop while bounding the panorama to the itinerary. It is a number rather than a
3240
+ * hit test against a drawn shape because the gate runs before a coverage call is billed.
3241
+ */
3242
+ declare const STREETVIEW_CORRIDOR_METERS = 100;
3243
+ /**
3244
+ * StreetViewCorridor is a surface's half of `<StreetViewControl>`: the itinerary it bounds a drop
3245
+ * to (`bounds`, undefined for no bound), and the drag and open handlers that take the control's
3246
+ * defaults away from it.
3247
+ */
3248
+ interface StreetViewCorridor {
3249
+ /** The itinerary a drop is bounded to, or undefined where nothing bounds it. */
3250
+ readonly bounds: StreetViewBounds | undefined;
3251
+ /** Takes the coverage raster and the corridor band down, on every path that ends a drag. */
3252
+ readonly onDragEnd: () => void;
3253
+ /** Shows the coverage raster, and the corridor band where a drop is bounded. */
3254
+ readonly onDragStart: () => void;
3255
+ /** Opens the panorama at an accepted drop, longitude first. */
3256
+ readonly onOpen: (lngLat: [number, number]) => void;
3257
+ }
3258
+ /**
3259
+ * useStreetViewCorridor wires the Street View handle onto the tool bus, bounded to the active
3260
+ * itinerary when a surface asks for it.
3261
+ *
3262
+ * The control ships a complete interaction (grab, coverage raster, corridor band, drop,
3263
+ * corridor gate, coverage check, open), and every part that touches the MAP is behind an `on*`
3264
+ * that suppresses the default. Those are taken here, because a studio's mutations go through
3265
+ * one bus: an agent's `studio.streetview.open` and a user's drop become one path rather than
3266
+ * two that have to be kept agreeing.
3267
+ *
3268
+ * What is NOT taken is the pipeline between the drop and the open: the unproject, the corridor
3269
+ * gate, the billed coverage check, the refusal notice beside the handle. Those stay the
3270
+ * control's, so a drop accepted on one integration is accepted on every other. `bounds` is data
3271
+ * that gate runs on, not a handler replacing it.
3272
+ *
3273
+ * @param bounded - Whether a drop is bounded to the open itinerary. A read-only surface passes
3274
+ * true: an embed bounds Street View to the itinerary it is showing, so a visitor cannot walk a
3275
+ * shared Maps key across the globe. An editor passes false, accepts any covered drop, and
3276
+ * reads no itinerary at all for it.
3277
+ * @returns The {@link StreetViewCorridor} to spread onto `<StreetViewControl>`.
3278
+ */
3279
+ declare const useStreetViewCorridor: (bounded: boolean) => StreetViewCorridor;
3280
+
3281
+ /**
3282
+ * useStudioApi is the data seam the mounted studio was given.
3283
+ *
3284
+ * A surface reaches it rarely and should: the verbs write through the handlers, which already
3285
+ * hold it, so a component calling the client directly is usually a verb that has not been
3286
+ * written yet. What it is for is the read a handler has no business owning: a rating posted
3287
+ * beside a transcript, a probe a panel makes on its own behalf.
3288
+ *
3289
+ * @returns The studio's {@link StudioApi}, or `undefined` outside a provider rather than a
3290
+ * throw, so a surface rendered in a consumer's own list does not crash their page; the caller
3291
+ * decides what an absent client means, which for every present caller is "do nothing".
3292
+ */
3293
+ declare const useStudioApi: () => StudioApi | undefined;
3294
+
3295
+ /**
3296
+ * StudioDispatchOverrides carry the one thing a caller can vary per dispatch.
3297
+ *
3298
+ * Named for what it does rather than as `…Options`, which in this package is reserved for a
3299
+ * HOOK's own argument type: this is an argument to the dispatch function the hook returns.
3300
+ *
3301
+ * `context` replaces the studio's own for THIS call, which is what a surface layering a seam
3302
+ * over it needs: a dialog that wants its own confirmation prompt in front of the studio's, a
3303
+ * tab strip dispatching against a context carrying the surface it just mounted. Everything else
3304
+ * (the bus, the handlers, the store) is the studio's, so the layered context is a spread of
3305
+ * the one this hook already reads rather than a second one built from nothing.
3306
+ *
3307
+ * Omitted, the studio's own context is used, which is the case every ordinary surface is in.
3308
+ */
3309
+ interface StudioDispatchOverrides {
3310
+ /** The tool context this dispatch runs on, in place of the studio's own. */
3311
+ readonly context?: StudioToolContext | undefined;
3312
+ }
3313
+ /**
3314
+ * StudioDispatchFn runs one of the studio's own verbs, checked against its contract.
3315
+ *
3316
+ * `TName` is a key of {@link StudioToolInputs}, so a misspelled verb is a compile error naming
3317
+ * the tools that do exist, and the payload is the tool's own INPUT shape: the pre-parse one,
3318
+ * so a field carrying a Zod default stays optional to the caller.
3319
+ *
3320
+ * It answers the `ToolResult` of that verb's data, read from {@link StudioToolOutputs}. Where the
3321
+ * verb's contract states an `output`, a caller takes a member of `result.data` after `result.ok`
3322
+ * with no narrowing of its own. A verb that answers no data reads `undefined`, and a verb whose
3323
+ * contract states no output reads `unknown`. A refusal is the `ok: false` arm under every verb.
3324
+ *
3325
+ * A stand-in written by hand, a spy in a suite or a stub of the hook, is held to the same
3326
+ * answers. One that only refuses is a `StudioDispatchFn` as written, and so are a function that
3327
+ * forwards to a bus naming {@link StudioToolOutputs} and a spy typed by the dispatch,
3328
+ * `vi.fn<StudioDispatchFn>()`, resolved with a plain `ok` or a refusal. A function whose own type
3329
+ * answers one `ok` under every verb, an arrow function or a spy built over one, is refused with
3330
+ * TS2322, since a verb that states data would read an answer with none: it is asserted where it
3331
+ * is handed over, `spy as StudioDispatchFn`. A suite that reads what a verb answered mounts
3332
+ * `StudioProvider` over `studioToolBus()` from `@mountaya/studio/testing` and takes the hook as
3333
+ * it is.
3334
+ */
3335
+ type StudioDispatchFn = <TName extends keyof StudioToolInputs & string>(name: TName, input: StudioToolInputs[TName], options?: StudioDispatchOverrides) => Promise<ToolResultOf<StudioToolOutputs, TName>>;
3336
+ /**
3337
+ * UseStudioDispatch is what {@link useStudioDispatch} answers: the function that runs a verb, and
3338
+ * whether one this caller started is still running.
3339
+ */
3340
+ interface UseStudioDispatch {
3341
+ /**
3342
+ * dispatch runs a studio tool and resolves its result. It never rejects: with no studio above
3343
+ * it the answer is a refusal, and so is a rejection of a host's own bus.
3344
+ *
3345
+ * One function for the caller's life. It reads the bus and the tool context as it runs, so a
3346
+ * dispatch sent after the host rebuilt its context runs on the context that stands.
3347
+ */
3348
+ readonly dispatch: StudioDispatchFn;
3349
+ /**
3350
+ * pending is true from the moment a dispatch starts until it settles.
3351
+ *
3352
+ * Counted rather than flagged, so two overlapping dispatches do not clear each other's
3353
+ * spinner: the second's completion would otherwise unset a flag the first still needs.
3354
+ *
3355
+ * Reading it is what subscribes, and the subscriber is the hook's caller: once it has been
3356
+ * read, the caller re-renders each time it flips, and a caller that never reads it (a row whose
3357
+ * handler is `void dispatch(…)`) re-renders for no dispatch at all. A child handed the object
3358
+ * may read it in its own render: that read subscribes the caller, and the caller's re-render
3359
+ * hands the child a new object. It reads the count live, so a handler reading it outside a
3360
+ * render gets the value of that moment.
3361
+ */
3362
+ readonly pending: boolean;
3363
+ }
3364
+ /**
3365
+ * useStudioDispatch is how a studio surface changes anything.
3366
+ *
3367
+ * The typed sibling of `useStudioDispatchUnsafe`, and the one a studio surface should reach for.
3368
+ * That one takes a `string` and an `unknown` because it serves a host whose tool set this package
3369
+ * cannot know; this one is bound to {@link StudioToolInputs}, which is DERIVED from the published
3370
+ * contracts, so the verb and its payload are checked, and a schema change is a compile error at
3371
+ * every call site rather than a parse failure at one of them.
3372
+ *
3373
+ * **Bound rather than augmented, deliberately.** The alternative is
3374
+ * `declare module "@mountaya/studio" { interface ToolDispatchRegistry extends
3375
+ * StudioToolInputs {} }`, which is global: a package shipping it would type-check every
3376
+ * importer's dispatch against the studio's tools whether or not they mount a studio, with no
3377
+ * way to decline. Binding the map to a hook keeps the checking exactly where the studio is, and
3378
+ * keeps it expressible in a language with no declaration merging, which matters because the
3379
+ * same contract table is what the Dart and Flutter SDKs generate from.
3380
+ *
3381
+ * The answer is bound the same way. `dispatch` reads each verb's data from
3382
+ * {@link StudioToolOutputs}, which is derived from the same contracts, whether or not the host
3383
+ * merged them into `ToolOutputRegistry`. Nothing is parsed on the way back: what the verb's
3384
+ * handler returned is what the caller reads.
3385
+ *
3386
+ * The bus and the tool context, each nullable, collapse into one function that is always
3387
+ * there: an absent provider is a structured refusal with the shape every other failure has,
3388
+ * so a component renders in a story, a unit test or a print view with no studio around it,
3389
+ * and no call site proves the bus present.
3390
+ *
3391
+ * A dispatch costs its caller no render unless `pending` is read. The count of dispatches in
3392
+ * flight lives outside React state, and reading `pending` is what asks for a render of the
3393
+ * hook's caller when the answer flips. Most callers never read it, and a list of rows each
3394
+ * holding this hook would otherwise render twice per click on any of them. Each render returns
3395
+ * a fresh object, so a memoized child handed it renders with its caller, and an effect that
3396
+ * depends on the hook names `dispatch`, which is one function for the caller's life, rather
3397
+ * than the object.
3398
+ *
3399
+ * @returns The {@link UseStudioDispatch} of this render.
3400
+ *
3401
+ * @example
3402
+ * ```tsx
3403
+ * declare const itineraryId: string;
3404
+ * declare const setError: (message: string) => void;
3405
+ *
3406
+ * const { dispatch, pending } = useStudioDispatch();
3407
+ *
3408
+ * const rename = async (name: string) => {
3409
+ * const result = await dispatch("studio.itinerary.rename", { itineraryId, name });
3410
+ * if (!result.ok) {
3411
+ * setError(result.error);
3412
+ * }
3413
+ * };
3414
+ * ```
3415
+ */
3416
+ declare const useStudioDispatch: () => UseStudioDispatch;
3417
+
3418
+ /**
3419
+ * The one place a studio surface changes anything.
3420
+ *
3421
+ * Every action hook in this entry point dispatches through the bus: a studio verb by
3422
+ * `useStudioDispatch`, typed by its contract, and a host's verb by `useStudioDispatchUnsafe`. One
3423
+ * studio verb takes the unsafe dispatch on purpose: `useBeginWaypointEdit` hands the begin a
3424
+ * waypoint's saved icon, which is the wire's vocabulary rather than a user's, so the begin's own
3425
+ * schema answers an endpoint glyph with `invalid-input` instead of the type refusing the call.
3426
+ *
3427
+ * The bus is not layering for its own sake: a dispatch validates the input against the tool's
3428
+ * schema, checks the capability, runs the confirmation protocol for a destructive verb, and turns a
3429
+ * throw into a structured result. A hook that reached past it to mutate a store directly would skip
3430
+ * all four, and it would skip them silently.
3431
+ */
3432
+
3433
+ /**
3434
+ * StudioDispatchUnsafeFn runs one tool by name. The input is `unknown` because a component knows
3435
+ * its own verb and the bus knows the schema; narrowing here would mean re-declaring every tool's
3436
+ * input in this package, which is the duplication the registry exists to prevent.
3437
+ */
3438
+ type StudioDispatchUnsafeFn = (name: string, input?: unknown) => Promise<ToolResult>;
3439
+ /**
3440
+ * UseStudioDispatchUnsafe is what {@link useStudioDispatchUnsafe} answers: the function that runs
3441
+ * a tool by name, and whether one this caller started is still running.
3442
+ */
3443
+ interface UseStudioDispatchUnsafe {
3444
+ /**
3445
+ * dispatch runs a tool and resolves its result. It never rejects: with no studio above it the
3446
+ * answer is a refusal, said once on the console, and so is a rejection of a host's own bus.
3447
+ *
3448
+ * One function for the caller's life. It reads the bus and the tool context as it runs, so a
3449
+ * dispatch sent after the host rebuilt its context runs on the context that stands.
3450
+ */
3451
+ readonly dispatch: StudioDispatchUnsafeFn;
3452
+ /**
3453
+ * pending is true from the moment a dispatch starts until it settles.
3454
+ *
3455
+ * Counted rather than flagged, so two overlapping dispatches do not clear each other's
3456
+ * spinner: the second's completion would otherwise unset a flag the first still needs.
3457
+ *
3458
+ * Reading it is what subscribes, and the subscriber is the hook's caller: once it has been
3459
+ * read, the caller re-renders each time it flips, and a caller that never reads it (a row whose
3460
+ * handler is `void dispatch(…)`) re-renders for no dispatch at all. A child handed the object
3461
+ * may read it in its own render: that read subscribes the caller, and the caller's re-render
3462
+ * hands the child a new object. It reads the count live, so a handler reading it outside a
3463
+ * render gets the value of that moment.
3464
+ */
3465
+ readonly pending: boolean;
3466
+ }
3467
+ /**
3468
+ * useStudioDispatchUnsafe returns the surface's dispatch function and whether one is in flight.
3469
+ *
3470
+ * The result is RETURNED rather than thrown or swallowed, on purpose: a studio surface usually
3471
+ * wants to show the failure where the action was taken, and a hook that swallowed it would
3472
+ * leave a button that did nothing with no way to say why.
3473
+ *
3474
+ * A dispatch costs its caller no re-render unless `pending` is read, exactly as with
3475
+ * `useStudioDispatch`. The count of dispatches in flight lives outside React state, and reading
3476
+ * `pending` is what asks for a re-render of the hook's caller when the answer flips. Every row,
3477
+ * list and action hook in this entry point dispatches through one of the two and reads `dispatch`
3478
+ * alone, so a count in state would re-render each of them twice per dispatch. Each render returns a
3479
+ * fresh object, so a memoized child handed it re-renders with its caller, and an effect that
3480
+ * depends on the hook names `dispatch` rather than the object.
3481
+ *
3482
+ * @returns The {@link UseStudioDispatchUnsafe} of this render.
3483
+ */
3484
+ declare const useStudioDispatchUnsafe: <TCtx extends ToolBusContext = ToolBusContext>() => UseStudioDispatchUnsafe;
3485
+
3486
+ /**
3487
+ * useStudioEntitlement reports whether the viewer holds an entitlement, live.
3488
+ *
3489
+ * The seam is the one the tool handlers already gate on, so a surface reveals exactly what the
3490
+ * bus would accept, by construction rather than by coincidence: with the handlers asking
3491
+ * `viewer.hasEntitlement` and the components deriving a feature again from whatever store the
3492
+ * host happens to keep, two derivations of one rule agree until one of them is fixed.
3493
+ *
3494
+ * Unlike its unit sibling, an absent provider is refused rather than defaulted: "in what units"
3495
+ * has a safe answer and "may this viewer do X" does not. Answering `false` outside a provider
3496
+ * would gate a surface on a guess, and answering `true` would open one.
3497
+ *
3498
+ * @param entitlement - The entitlement asked about.
3499
+ * @returns Whether the viewer holds it, read again when the viewer says it changed.
3500
+ * @throws {MountayaElementsError} When no studio is mounted above the caller.
3501
+ */
3502
+ declare const useStudioEntitlement: (entitlement: StudioEntitlement) => boolean;
3503
+
3504
+ /**
3505
+ * StudioFailureReporter raises the studio's shared alert for a refused dispatch, naming the
3506
+ * action that failed and appending the reason. A successful result is a no-op, so a call site
3507
+ * can hand it every result rather than branching first.
3508
+ */
3509
+ type StudioFailureReporter = (result: ToolResult, action: string) => void;
3510
+ /**
3511
+ * useStudioFailureAlert is how a studio surface reports a dispatch that came back refused.
3512
+ *
3513
+ * Menus close on click, gutters have no error slot, and the sidenav footer commits and moves
3514
+ * on; none of them can hold a message, so the map alert is where an async refusal has to land,
3515
+ * and this is the single place that decides what it says. {@link failureAlertFor} holds that
3516
+ * decision; this binds it to the studio's own dispatch.
3517
+ *
3518
+ * It takes no argument: the bus and the context are read through the provider, so a row three
3519
+ * levels down, or a map hook, reports a failure without anything being threaded to it.
3520
+ *
3521
+ * The alert goes out through `studio.alert.show` like every other mutation, so the reporter
3522
+ * never writes the ui store itself.
3523
+ *
3524
+ * It reads its dispatcher through this package's own module graph rather than through the
3525
+ * barrel, which matters to a test harness: a stand-in hung on `@mountaya/studio-react/headless`
3526
+ * replaces `useStudioDispatch` for the SURFACE and not for this hook, so a suite that stubs the
3527
+ * barrel and asserts on the alert should drive a real bus through `StudioProvider` instead.
3528
+ *
3529
+ * @returns The {@link StudioFailureReporter}, one function for the caller's life.
3530
+ *
3531
+ * @example
3532
+ * ```tsx
3533
+ * declare const itineraryId: string;
3534
+ * declare const segmentId: string;
3535
+ *
3536
+ * const { dispatch } = useStudioDispatch();
3537
+ * const reportFailure = useStudioFailureAlert();
3538
+ *
3539
+ * const remove = async () => {
3540
+ * const result = await dispatch("studio.itinerary.segment.remove", { itineraryId, segmentId });
3541
+ * reportFailure(result, "Couldn't delete this segment");
3542
+ * };
3543
+ * ```
3544
+ */
3545
+ declare const useStudioFailureAlert: () => StudioFailureReporter;
3546
+
3547
+ /**
3548
+ * useStudioObserve reports every dispatch the studio makes to `observer`, for as long as the
3549
+ * calling component is mounted.
3550
+ *
3551
+ * One observer sees the whole product surface (a person clicking a control, an agent running a
3552
+ * verb, a bridge relaying a message from a parent frame), because the bus is the one place all
3553
+ * three meet. That is what makes it the right seam for analytics, and for the two collaboration
3554
+ * reports a studio has to make: a lost-revision conflict, and an edit refused because a peer
3555
+ * holds the lock. Neither of those belongs in a handler, because a handler cannot know which
3556
+ * surface should say so.
3557
+ *
3558
+ * `observer` is read through a ref, so an inline closure over fresh props is safe and does NOT
3559
+ * re-subscribe on every render. That matters more here than it looks: an observer usually needs
3560
+ * the latest copy, the latest peer names, the latest open resource, and a caller who had to
3561
+ * memoize all of it would end up keeping the refs by hand.
3562
+ *
3563
+ * Nothing observed is a defined absence rather than a gap. A provider with no bus, or one
3564
+ * carrying a hand-written dispatch slice, has nothing to subscribe to, and an observer reports
3565
+ * on actions rather than performing them, so its absence loses a report and never an action.
3566
+ * An observer that throws changes no dispatch and stops no observer after it, so a failing sink
3567
+ * never surfaces as a tool failure. Its fault is not dropped: the bus raises the first of a
3568
+ * round as an uncaught error on a microtask, where the page's error reporting sees it.
3569
+ *
3570
+ * @param observer - Told of each dispatch once it completes; it may be written inline.
3571
+ */
3572
+ declare const useStudioObserve: (observer: ToolDispatchObserver) => void;
3573
+
3574
+ /** useStudioPreferences is `useStudioViewerPreferences` over the viewer already in context. */
3575
+ declare const useStudioPreferences: () => ViewerPreferences | null;
3576
+
3577
+ /**
3578
+ * useStudioSignedIn reports that somebody is reading rather than nobody.
3579
+ *
3580
+ * Its own hook rather than `useStudioUserId() !== null` at each call site, because the surfaces
3581
+ * that ask are the ones deciding what an ANONYMOUS reader sees (a share view's "open in
3582
+ * Mountaya" link, its sign-in prompt), and a comparison against null at each call site is a
3583
+ * chance to write `!== undefined` instead. The seam answers `null` for nobody and a
3584
+ * mistyped check would read every anonymous viewer as signed in, which fails open.
3585
+ */
3586
+ declare const useStudioSignedIn: () => boolean;
3587
+
3588
+ /**
3589
+ * useStudioUnits is `useStudioViewerUnits` over the viewer already in context.
3590
+ *
3591
+ * The zero-argument form exists for the same reason `useCapability` has one: every surface that
3592
+ * renders a measurement needs this, and threading the viewer through each of them is the
3593
+ * boilerplate the context was put there to remove. The explicit form stays for a caller holding
3594
+ * a viewer that is not the mounted studio's: a preview of someone else's session, a test.
3595
+ *
3596
+ * Outside a provider it answers the DEFAULTS rather than throwing, unlike its entitlement
3597
+ * sibling, and the difference is what each question means when nobody has answered it. "May
3598
+ * this viewer do X" has no safe default (refusing silently would gate a surface on a guess),
3599
+ * while "in what units" does, and metric-and-degrees is the same answer an anonymous embed
3600
+ * gets. A row a consumer renders in their own list, outside the studio subtree, should show a
3601
+ * distance rather than crash their page.
3602
+ */
3603
+ declare const useStudioUnits: () => UnitFormatOptions;
3604
+
3605
+ /**
3606
+ * useStudioUrl reads the studio's own slice of the address bar, or `inertStudioUrlSeam`
3607
+ * where the host supplied none.
3608
+ *
3609
+ * The inert seam is the published one rather than a local twin: a studio with no router still
3610
+ * mutates its store and simply does not land back on what was open after a reload, and that is
3611
+ * one answer with one implementation, which the assembled studio hands to `useStudioUrlState`
3612
+ * from the other side of the same absence.
3613
+ *
3614
+ * Reach for it where a surface needs a value that has to SURVIVE A RELOAD and travel in a link
3615
+ * (the collection scope a sidenav is browsing, the itinerary a detail panel is open on). State
3616
+ * that does not need either belongs in the store, which is cheaper and does not touch history.
3617
+ *
3618
+ * **A reader binds the seam's `subscribe` and `read` with `useSyncExternalStore`.** `read`
3619
+ * answers one object until a mirrored value changes, so the binding renders again on a change
3620
+ * and on nothing else. The seam arrives on the tool context, which is built once, so a host
3621
+ * builds its seam once and memoizes it.
3622
+ */
3623
+ declare const useStudioUrl: () => StudioUrlSeam;
3624
+
3625
+ /** useStudioUserId is `useStudioViewerUserId` over the viewer already in context. */
3626
+ declare const useStudioUserId: () => string | null;
3627
+
3628
+ /**
3629
+ * useStudioViewer is the viewer the mounted studio is showing this map to.
3630
+ *
3631
+ * The escape hatch under the zero-argument viewer hooks (`useStudioUnits`, `useStudioUserId`,
3632
+ * `useStudioPreferences`), for a surface asking something none of them names: the itinerary
3633
+ * ceiling of a scope, a preference write. Outside a provider it answers `inertViewer` from
3634
+ * `@mountaya/studio` rather than throwing, which is the same defined absence
3635
+ * `createStaticViewer` gives a host with no session: no user, no entitlement, no ceiling, no
3636
+ * preferences.
3637
+ *
3638
+ * Held live rather than read once, because every member is a getter and the session that fills
3639
+ * them resolves after the studio mounts.
3640
+ */
3641
+ declare const useStudioViewer: () => StudioViewer;
3642
+
3643
+ /**
3644
+ * useStudioViewerEntitlement reports whether the host extends a named entitlement to the viewer,
3645
+ * and renders again when that answer changes.
3646
+ *
3647
+ * It exists because reading the seam directly is correct and stale. `hasEntitlement` is a
3648
+ * function so a handler can ask late (the context is built once per mount and a membership
3649
+ * resolves after it), but a component that calls it during render captures one answer and
3650
+ * keeps it. The surfaces gated on an entitlement are exactly the ones a session changes
3651
+ * underneath, because accepting an invitation, a change to an organization's agreement and
3652
+ * resolving a membership all happen without the studio remounting. The component renders
3653
+ * refused, the entitlement arrives, and nothing tells React to look again.
3654
+ *
3655
+ * `useSyncExternalStore` rather than an effect and a piece of state: it is the same subscription
3656
+ * either way, and this one is torn during a concurrent render instead of showing the previous
3657
+ * answer for a frame. `viewer.subscribe` matches its contract exactly, which is why the seam
3658
+ * declares it in that shape.
3659
+ *
3660
+ * The getter is memoized on the pair it reads, so a host whose viewer identity is stable (every
3661
+ * one built from a store is) subscribes again only when the entitlement asked for changes.
3662
+ *
3663
+ * The same getter is the server snapshot. The seam is the host's on the server as in the browser,
3664
+ * so a host whose server knows the viewer renders the entitled surface there; hydration then reads
3665
+ * the browser's viewer and expects the same answer, as React requires of every server snapshot.
3666
+ *
3667
+ * @param viewer - The viewer seam to ask.
3668
+ * @param entitlement - The entitlement asked about.
3669
+ * @returns Whether the viewer holds it.
3670
+ */
3671
+ declare const useStudioViewerEntitlement: <TEntitlement extends string>(viewer: ViewerSeam<TEntitlement>, entitlement: TEntitlement) => boolean;
3672
+
3673
+ /**
3674
+ * useStudioViewerItineraryLimit reads how many itineraries the viewer may own in the scope
3675
+ * `organizationId` names, and renders again when that answer changes.
3676
+ *
3677
+ * The ceiling's counterpart of `useStudioViewerEntitlement`, for the reason given there:
3678
+ * `getItineraryLimit` is a function so a handler can ask late, and a component that calls it
3679
+ * during render keeps the answer of the render it called it in. A ceiling lands after the studio
3680
+ * mounts (the reader's own space is answered by a read of its own), so a create surface that
3681
+ * asked once would offer a create at the ceiling and leave the reader to meet the refusal.
3682
+ *
3683
+ * The same getter is the server snapshot, for the reason `useStudioViewerEntitlement` gives: the
3684
+ * seam is the host's on the server too, and hydration expects the browser's viewer to agree.
3685
+ *
3686
+ * @param viewer - The viewer seam to ask.
3687
+ * @param organizationId - The scope the itineraries are kept in: an organization, or the reader's
3688
+ * own space in any spelling the host's scope predicate reads, an omitted id among them.
3689
+ * @returns The ceiling the viewer states for the scope, or null where none is in force: none
3690
+ * applies, or none is known yet.
3691
+ */
3692
+ declare const useStudioViewerItineraryLimit: (viewer: Pick<StudioViewer, "getItineraryLimit" | "subscribe">, organizationId?: string | null | undefined) => number | null;
3693
+
3694
+ /**
3695
+ * useStudioViewerPreferences reads the viewer's stated preferences and renders again when they
3696
+ * change.
3697
+ *
3698
+ * Generic over the entitlement vocabulary although it reads none: `hasEntitlement` takes the
3699
+ * vocabulary as an ARGUMENT, so a seam closed over a narrower one is not assignable to the open
3700
+ * `ViewerSeam<string>`, and a `StudioViewer` handed to a hook spelled that way would fail to
3701
+ * compile for a member the hook never touches.
3702
+ *
3703
+ * The sibling of `useStudioViewerEntitlement`, and it exists for the same reason spelled out there:
3704
+ * every member of the seam is a GETTER, because a tool handler asks once at dispatch time. A
3705
+ * component that calls `viewer.getPreferences()` during render captures one answer and keeps
3706
+ * it, so a viewer who switches to imperial goes on reading kilometers until something
3707
+ * unrelated renders the surface again. Nothing throws and nothing is red; the numbers are just
3708
+ * wrong.
3709
+ *
3710
+ * The same cached getter is the server snapshot, for the reason `useStudioViewerEntitlement`
3711
+ * gives: the seam is the host's on the server too, and hydration expects the browser's viewer to
3712
+ * agree. Sharing the cache is what keeps both reads the same object.
3713
+ */
3714
+ declare const useStudioViewerPreferences: <TEntitlement extends string>(viewer: ViewerSeam<TEntitlement>) => ViewerPreferences | null;
3715
+
3716
+ /**
3717
+ * useStudioViewerUnits resolves the viewer's preferences into the options every formatter takes.
3718
+ *
3719
+ * The snapshot is CACHED on the values it resolves to, and that is a requirement rather than
3720
+ * an optimisation. `useSyncExternalStore` compares snapshots with `Object.is` and renders again
3721
+ * when they differ, so a getter returning a fresh object literal every call differs from
3722
+ * itself on every check: React renders, reads again, differs again, and the component loops
3723
+ * until the browser gives up. Returning the SAME object while the values are unchanged is what
3724
+ * makes an object-valued snapshot legal at all.
3725
+ *
3726
+ * It also preserves the property the call sites depend on: the identity changes only when the
3727
+ * units do, so a memoized row formatting several metrics per candidate is not invalidated by an
3728
+ * unrelated render.
3729
+ *
3730
+ * The comparison walks the resolved object's own keys rather than naming them.
3731
+ * `UnitFormatOptions` is fully populated by `resolveViewerUnits` (every member has a value), so
3732
+ * the walk is exact, and it is the one form that cannot fall behind the shape. A named subset
3733
+ * would answer the STALE object for a change to a member it leaves out (a `pace` or a
3734
+ * `temperature`): every formatter in the studio would go on rendering the previous unit while
3735
+ * the store already held the new one, which reads as a preference control that does nothing.
3736
+ *
3737
+ * The same cached getter is the server snapshot, for the reason `useStudioViewerEntitlement`
3738
+ * gives: the seam is the host's on the server too, and hydration expects the browser's viewer to
3739
+ * agree. Sharing the cache is what keeps both reads the same object.
3740
+ */
3741
+ declare const useStudioViewerUnits: <TEntitlement extends string>(viewer: ViewerSeam<TEntitlement>) => UnitFormatOptions;
3742
+
3743
+ /**
3744
+ * useStudioViewerUserId reads who is reading, and renders again when that changes.
3745
+ *
3746
+ * A session resolves after the studio mounts (the same reason the entitlement hook exists),
3747
+ * so a surface that captured `null` at mount would treat a signed-in viewer as anonymous for
3748
+ * as long as it stayed mounted.
3749
+ *
3750
+ * The same getter is the server snapshot, for the reason `useStudioViewerEntitlement` gives: the
3751
+ * seam is the host's on the server too, and hydration expects the browser's viewer to agree.
3752
+ *
3753
+ * @returns The viewer's user id, or null for an anonymous reader.
3754
+ */
3755
+ declare const useStudioViewerUserId: <TEntitlement extends string>(viewer: ViewerSeam<TEntitlement>) => string | null;
3756
+
3757
+ /**
3758
+ * Reading the studio's own state from React.
3759
+ *
3760
+ * `@mountaya/studio` composes the studio's state into one `zustand/vanilla` store and
3761
+ * `createUiStore()` builds an instance. `useStudioStore` turns ANY subscribable object into a
3762
+ * hook; these two bind the specific instance a `StudioProvider` carries, so a surface writes
3763
+ * `useUiStore(selector)` and has nothing threaded down to it.
3764
+ *
3765
+ * **Both require their seam.** Most of this entry is inert without a provider (no capabilities,
3766
+ * a dispatch that returns a structured refusal), because for PERMISSION there is a meaningful
3767
+ * empty answer. For STATE there is not: a segment list rendered against no store is not a
3768
+ * read-only segment list, it is a confident claim that the itinerary is empty. Falling back to
3769
+ * a pristine store would also put the whole slice composition in the bundle of a consumer who
3770
+ * imported nothing but `useStudioDispatchUnsafe`.
3771
+ *
3772
+ * A consumer who wants the inert case has `useStudioStore(store, selector, fallback)`: it
3773
+ * takes a nullable store and the slice to answer with when there is none. That is the
3774
+ * primitive; these are the bound convenience over the seam.
3775
+ */
3776
+
3777
+ /**
3778
+ * useUiStore selects a slice of the studio's state and re-renders when that slice changes.
3779
+ *
3780
+ * Change is `Object.is`, which makes the selector the whole performance contract: reading a slot
3781
+ * off the state re-renders on the write that touched it, and building a fresh object re-renders
3782
+ * on every write anywhere in the studio. The published `select*` helpers are written the first
3783
+ * way; a multi-field read wants {@link useUiStoreShallow}, which memoises the last result and
3784
+ * returns it unchanged when the members match.
3785
+ *
3786
+ * @param selector - Reads the slice off the studio's state.
3787
+ * @returns The slice.
3788
+ * @throws {MountayaElementsError} When no provider above the caller carries a store.
3789
+ */
3790
+ declare const useUiStore: <T>(selector: (state: UiStore) => T) => T;
3791
+ /**
3792
+ * useUiStoreApi returns the store handle itself: the same instance the tool bus mutates.
3793
+ *
3794
+ * The read-side seam for a surface that must follow a high-frequency slice without re-rendering:
3795
+ * subscribe imperatively, write to a canvas or a ref, and let React sit still. A video preview
3796
+ * advancing frame by frame repaints its overlay this way, where `useUiStore` would re-render the
3797
+ * tree once per frame to move one line.
3798
+ *
3799
+ * It is a READ seam. Writes go through the bus, which is what makes one dispatch surface serve
3800
+ * the user and the agent alike; a component calling `setState` on this handle has stepped
3801
+ * outside that and the bus will not know it happened.
3802
+ *
3803
+ * @throws {MountayaElementsError} When no provider above the caller carries a store.
3804
+ */
3805
+ declare const useUiStoreApi: () => UiStoreApi;
3806
+
3807
+ /**
3808
+ * Reading SEVERAL slots of the studio's state in one subscription.
3809
+ *
3810
+ * `useUiStore` compares with `Object.is`, which makes a selector that builds an object
3811
+ * re-render its component on every write anywhere in the studio. {@link useShallowSelector} is
3812
+ * the answer to that in general; this is its binding to the studio's own store, kept because
3813
+ * `useUiStoreShallow(selector)` is what a studio surface reads and neither half of
3814
+ * `useUiStore(useShallowSelector(selector))` is the part a caller cares about.
3815
+ *
3816
+ * The compare itself lives next door rather than here, because the same memo serves stores this
3817
+ * package does not own (the agent transcript and the video director each keep one), and a
3818
+ * second copy of a shallow comparison is a second place for a nested-value rule to drift.
3819
+ *
3820
+ * It needs the store, like `useUiStore` does, and throws without a `StudioProvider` for the
3821
+ * same reason: there is no meaningful empty answer for state.
3822
+ */
3823
+
3824
+ /**
3825
+ * useUiStoreShallow selects several slots of the studio's state at once and re-renders only
3826
+ * when one of their VALUES changes.
3827
+ *
3828
+ * The selector may build a fresh object per call: that is the point. It still runs on every
3829
+ * notification, so it must stay cheap: read slots, do not compute.
3830
+ *
3831
+ * @param selector - Reads the slots off the studio's state; it may be written inline.
3832
+ * @returns The selector's answer, the previous object while its members match.
3833
+ * @throws {MountayaElementsError} When no provider above the caller carries a store.
3834
+ *
3835
+ * @example
3836
+ * ```tsx
3837
+ * const { agentDriving, locating } = useUiStoreShallow((state) => ({
3838
+ * agentDriving: state.agentDriving,
3839
+ * locating: state.locating,
3840
+ * }));
3841
+ * ```
3842
+ */
3843
+ declare const useUiStoreShallow: <T>(selector: (state: UiStore) => T) => T;
3844
+
3845
+ /**
3846
+ * WaypointListModel is what {@link useWaypointList} hands a waypoint list: the rows to render,
3847
+ * the draft among them, who holds which row, and whether a run holds them all.
3848
+ */
3849
+ interface WaypointListModel {
3850
+ /** True while a run drives the workspace: every entry point into a new edit stands down. */
3851
+ readonly agentDriving: boolean;
3852
+ /**
3853
+ * Who holds each locked waypoint, keyed by waypoint id. Absent means free.
3854
+ *
3855
+ * Resolved for the whole list in one subscription rather than per row: asking per row is a
3856
+ * subscription per row, and turning an id into a NAME is a directory read the host would then
3857
+ * issue once for every row to answer a question that matters for one.
3858
+ */
3859
+ readonly lockHolderIds: ReadonlyMap<string, string>;
3860
+ /**
3861
+ * The saved waypoints, plus the in-flight create draft when one is open.
3862
+ *
3863
+ * The draft appears at the TAIL, which is where a newly-created waypoint lands, so the row a
3864
+ * user is naming does not jump position the moment it commits.
3865
+ */
3866
+ readonly rows: ItineraryViewSource["waypoints"];
3867
+ /** The id of the row standing for the open create session, or null. */
3868
+ readonly draftWaypointId: string | null;
3869
+ }
3870
+ /**
3871
+ * UseWaypointListOptions name the itinerary a waypoint list renders, and its saved waypoints.
3872
+ */
3873
+ interface UseWaypointListOptions {
3874
+ /** The itinerary whose waypoints the list renders. */
3875
+ readonly itineraryId: string;
3876
+ /** The SAVED waypoints, in position order. */
3877
+ readonly waypoints: ItineraryViewSource["waypoints"];
3878
+ }
3879
+ /**
3880
+ * useWaypointList is the list's own derivations: what to render, and who holds what.
3881
+ *
3882
+ * **The draft row is synthesised, and only for a create session the chain does not already
3883
+ * carry.** A user authoring a waypoint from scratch picks its icon, colour and name before the
3884
+ * first map click lands, and without a row to show that on they would be editing something
3885
+ * invisible. An `update` session always targets a saved row, so synthesising for one would
3886
+ * render the same waypoint twice.
3887
+ *
3888
+ * The session reads are narrow and separate rather than one object selector. Each returns a
3889
+ * slot (a primitive or a stored reference), so none of them can allocate, which is the one way
3890
+ * a store selector goes wrong: React refuses a snapshot that never settles.
3891
+ *
3892
+ * @param options - The itinerary and its saved waypoints; see {@link UseWaypointListOptions}.
3893
+ * @returns The {@link WaypointListModel}, whose `rows` is `waypoints` itself while no create
3894
+ * draft is open.
3895
+ */
3896
+ declare const useWaypointList: ({ itineraryId, waypoints, }: UseWaypointListOptions) => WaypointListModel;
3897
+
3898
+ /**
3899
+ * UseWaypointRowActionsOptions say which BACKEND a row's verbs reach.
3900
+ *
3901
+ * `session: true` sends them to the in-flight create session's own draft, which lives in the
3902
+ * store and has no server identity yet. Everything else reaches the persisted tools: with an
3903
+ * itinerary id they write through, and with an empty one they reach a host's draft sink, which
3904
+ * keys on the waypoint's client id. The three destinations differ only in the tool NAME and the
3905
+ * scope, which is exactly why they belong in one place: a surface choosing between them at
3906
+ * several call sites is a surface that will eventually choose differently in one of them.
3907
+ */
3908
+ interface UseWaypointRowActionsOptions {
3909
+ /** The itinerary a persisted mutation is scoped to. Empty for a host-side draft. */
3910
+ readonly itineraryId: string;
3911
+ /** Whether the row stands for the in-flight create session's draft. */
3912
+ readonly session?: boolean | undefined;
3913
+ /** The waypoint the verbs act on. */
3914
+ readonly waypointId: string;
3915
+ }
3916
+ /**
3917
+ * WaypointRowVerb names the verbs whose refusal a waypoint row hands its caller.
3918
+ *
3919
+ * A closed union, so a consumer's switch over it is exhaustive. `move` is raised by the row
3920
+ * opening its move session, which the one-edit-at-a-time gate refuses while another engine is
3921
+ * armed; the others by {@link useWaypointRowActions}.
3922
+ */
3923
+ type WaypointRowVerb = "move" | "recolor" | "remove" | "rename" | "setIcon";
3924
+ /** A refusal of a waypoint row's verb, and the verb it came from. */
3925
+ interface WaypointRowFailure {
3926
+ /** The refusal the bus answered. */
3927
+ readonly result: ToolResult;
3928
+ /** The verb that was refused. */
3929
+ readonly verb: WaypointRowVerb;
3930
+ }
3931
+ /** WaypointRowActions are the verbs of one waypoint row, and the last refusal among them. */
3932
+ interface WaypointRowActions {
3933
+ /**
3934
+ * The last refusal, naming the verb it came from, or null.
3935
+ *
3936
+ * Returned rather than raised, because where a refusal belongs on screen is a rendering
3937
+ * decision. A write the API refused, a collaborator's lock or a staged draft's save in flight
3938
+ * refuses a verb, and a delete refused so brings the marker back with nothing said unless the
3939
+ * row says it. A success clears it, and so does a withheld confirmation
3940
+ * ({@link isConfirmationWithheld}), since the verb never ran.
3941
+ */
3942
+ readonly lastFailure: WaypointRowFailure | null;
3943
+ /** Recolours the waypoint. */
3944
+ readonly recolor: (color: string) => Promise<void>;
3945
+ /** Deletes the waypoint, or cancels the create session on a draft's row. */
3946
+ readonly remove: () => Promise<void>;
3947
+ /** Renames the waypoint. A name of spaces alone dispatches nothing: the field was abandoned. */
3948
+ readonly rename: (name: string) => Promise<void>;
3949
+ /** Changes the waypoint's icon. */
3950
+ readonly setIcon: (icon: UserWaypointIcon) => Promise<void>;
3951
+ }
3952
+ /**
3953
+ * useWaypointRowActions is every mutation one waypoint row can dispatch, as a bundle.
3954
+ *
3955
+ * Grouped here rather than left inline in a row so a row's render path reads as layout and its
3956
+ * mutations read as a list of verbs, and so that every one of them provably goes through the
3957
+ * bus in one place. That second reason is the load-bearing one: a row reaching into a store
3958
+ * for "just this one" would bypass the schema, the capability gate and the confirmation
3959
+ * protocol, and it would bypass them invisibly.
3960
+ *
3961
+ * Each verb keeps its last refusal as `lastFailure`, as the segment row's do.
3962
+ *
3963
+ * On a create session's row, `remove` is the session's cancel: it dispatches
3964
+ * `studio.itinerary.waypoint.editCancel`, asks no confirmation and reaches no persistence.
3965
+ *
3966
+ * @returns The {@link WaypointRowActions} of the row.
3967
+ */
3968
+ declare const useWaypointRowActions: ({ itineraryId, session, waypointId, }: UseWaypointRowActionsOptions) => WaypointRowActions;
3969
+
3970
+ /**
3971
+ * UseWaypointRowOptions are what a waypoint row cannot derive for itself.
3972
+ *
3973
+ * The two hints are RESOLVED SENTENCES: a peer's hold can name a person, which means a directory
3974
+ * read the host owns, and a run's is static copy. Passing null for either says that state cannot
3975
+ * arise on this surface: a read-only list has no run lock, a single-player one no peers.
3976
+ *
3977
+ * `waypoint` is the saved record a move session seeds from, and its absence is what says this row
3978
+ * has no persisted geometry to move: an in-flight create and an import proposal both pass null,
3979
+ * and neither offers the verb.
3980
+ */
3981
+ interface UseWaypointRowOptions {
3982
+ /** The sentence a row shows while a run drives the studio, or null where none can. */
3983
+ readonly agentLockHint?: string | null | undefined;
3984
+ /** The itinerary the row belongs to. Undefined for a draft's row, whose id is on no tile. */
3985
+ readonly itineraryId?: string | undefined;
3986
+ /**
3987
+ * A refusal of one of the row's verbs, handed back rather than raised, with the verb it came
3988
+ * from.
3989
+ *
3990
+ * The one-edit-at-a-time gate declines a move while another engine is armed, and a write the
3991
+ * API refused, a collaborator's lock or a staged draft's save in flight declines a rename, a
3992
+ * recolour, an icon or a delete. A click that silently does nothing reads as the studio having
3993
+ * missed it. Where a refusal belongs on screen is a rendering decision, and phrasing one needs
3994
+ * the translation runtime this package does not carry, so it crosses as the result, and the
3995
+ * host words it by its verb.
3996
+ *
3997
+ * A withheld confirmation is never handed on: the verb never ran. Read when a refusal lands,
3998
+ * so a handler written inline moves none of the row's callbacks.
3999
+ */
4000
+ readonly onFailure?: ((failure: WaypointRowFailure) => void) | undefined;
4001
+ /** The sentence a row shows while a peer holds the waypoint, or null where none can. */
4002
+ readonly peerLockHint?: string | null | undefined;
4003
+ /** Routes the metadata verbs at the create session's own draft rather than at the server. */
4004
+ readonly session?: boolean | undefined;
4005
+ /** The saved record a move seeds from, or null for a row with no persisted geometry. */
4006
+ readonly waypoint?: Parameters<ReturnType<typeof useBeginWaypointEdit>>[0] | null | undefined;
4007
+ /** The waypoint the row stands for. */
4008
+ readonly waypointId: string;
4009
+ }
4010
+ /**
4011
+ * WaypointRowModel is everything a waypoint row is, minus the markup: its verbs, the move and
4012
+ * its cancel, the hover state and the sentence a held row speaks with.
4013
+ */
4014
+ interface WaypointRowModel<TElement extends HTMLElement = HTMLDivElement> {
4015
+ /** The row's verbs, each bound to its itinerary and waypoint. */
4016
+ readonly actions: WaypointRowActions;
4017
+ /**
4018
+ * Opens the move session, deferred so a double-click can cancel it, or undefined when this
4019
+ * row has no persisted geometry to move.
4020
+ *
4021
+ * Undefined rather than a no-op, because a caller wires it to a body click and to a menu item,
4022
+ * and both should be ABSENT rather than inert on a row where the verb does not exist.
4023
+ */
4024
+ readonly moveOnMap: (() => void) | undefined;
4025
+ /** The resolved sentence holding this row, or null when it is free. */
4026
+ readonly lockHint: string | null;
4027
+ /**
4028
+ * Cancels a move the single click scheduled, for a rename that arrived instead.
4029
+ *
4030
+ * The layout owns the double-click, so the row learns the rename opened through its
4031
+ * `onStartRename` report and cancels here: the two halves of one gesture.
4032
+ */
4033
+ readonly cancelMove: () => void;
4034
+ /**
4035
+ * Runs a body action on the same delay {@link moveOnMap} takes, so a caller that replaces what
4036
+ * a single click does inherits the rename carve-out rather than deriving it again.
4037
+ *
4038
+ * Without it, a surface wiring its own body action gets that action AND a rename on every
4039
+ * double-click, which is the exact bug the deferred move exists to prevent, brought back by
4040
+ * whoever wired the replacement.
4041
+ */
4042
+ readonly deferBodyClick: (action: () => void) => void;
4043
+ /** True while the pointer is over THIS waypoint's marker on the map. */
4044
+ readonly mapHovered: boolean;
4045
+ /**
4046
+ * What a `waypoint.menu` plugin contribution acts on, held stable.
4047
+ *
4048
+ * Memoized here rather than at the call site because the row is memoized and a list maps over
4049
+ * it: a fresh literal per render would compare unequal every time and defeat the memo on every
4050
+ * row at once.
4051
+ */
4052
+ readonly pluginTarget: StudioPluginTarget<"waypoint.menu">;
4053
+ /** The ref to hang on the row element, which the map hover scrolls into view. */
4054
+ readonly rowRef: RefObject<TElement | null>;
4055
+ /** Emphasises the waypoint's marker on the map. */
4056
+ readonly onMouseEnter: () => void;
4057
+ /** Gives the itinerary its emphasis back. */
4058
+ readonly onMouseLeave: () => void;
4059
+ }
4060
+ /**
4061
+ * useWaypointRow is the whole of a waypoint row that is not markup: its verbs, the move
4062
+ * session's deferred open, the hover surfaces of the row and of the map, and the sentence a
4063
+ * held row speaks with.
4064
+ *
4065
+ * **Hovering the row emphasises its marker on the map, and leaving restores the itinerary's.**
4066
+ * That pairing is the reason it lives here rather than at a call site: a row that emphasised on
4067
+ * enter and forgot to restore on leave leaves the map dimmed around one marker forever, and the
4068
+ * bug is invisible until a user moves the pointer away. A row unmounted under the pointer
4069
+ * restores it too. A row with no `itineraryId` is a draft's, whose id is on no tile: it sends
4070
+ * the map no emphasis, since one that lights nothing dims every marker.
4071
+ *
4072
+ * A peer's hold outranks a run's, because it can name a person; with neither, the row is free.
4073
+ *
4074
+ * @returns The {@link WaypointRowModel} a renderer draws from.
4075
+ */
4076
+ declare const useWaypointRow: <TElement extends HTMLElement = HTMLDivElement>({ agentLockHint, itineraryId, onFailure, peerLockHint, session, waypoint, waypointId, }: UseWaypointRowOptions) => WaypointRowModel<TElement>;
4077
+
4078
+ /**
4079
+ * MountayaStudioProviderProps is what {@link MountayaStudioProvider} takes: the groups
4080
+ * `StudioProvider` takes, and the map and the client the elements read.
4081
+ */
4082
+ interface MountayaStudioProviderProps<TCtx extends ToolBusContext = ToolBusContext> extends StudioProviderProps<TCtx> {
4083
+ /**
4084
+ * The client an element resolves an id through, when it is handed one instead of geometry.
4085
+ *
4086
+ * Top-level rather than in `data`, matching `MountayaStudioHost`: it is the one thing a
4087
+ * surface reading Mountaya data cannot be mounted without.
4088
+ */
4089
+ readonly client?: MountayaElementsProviderProps$1["client"];
4090
+ /**
4091
+ * The map the controls drive, when there is one.
4092
+ *
4093
+ * Top-level because it is the seam this component exists to add: the studio half has no map
4094
+ * and the elements half is nothing without one, so burying it in a group would hide the
4095
+ * difference between the two providers this composes.
4096
+ */
4097
+ readonly map?: MountayaElementsProviderProps$1["map"];
4098
+ }
4099
+ /**
4100
+ * MountayaStudioProvider is both providers, mounted once.
4101
+ *
4102
+ * A studio needs seams from two places: those an ELEMENT needs (a map, a glyph set, copy) and
4103
+ * those a studio adds on top (a bus, the capabilities the surface holds, and the store the bus
4104
+ * writes). Those are genuinely two concerns, which is why they are two contexts and stay two
4105
+ * contexts: a page that renders a zoom control and no studio mounts one of them. Composing a
4106
+ * studio always means both, so this is one component, the union of both prop sets, and no
4107
+ * chance of mounting the outer one and forgetting the inner.
4108
+ *
4109
+ * Both halves stay exported. A surface that wants the elements without the studio (a report, a
4110
+ * print view, a dashboard card with an elevation profile) mounts {@link MountayaElementsProvider}
4111
+ * alone, and a surface embedding a studio inside a tree that already has the elements mounts
4112
+ * {@link StudioProvider} alone.
4113
+ *
4114
+ * The studio nests INSIDE the elements, and the nesting is not arbitrary even though the two
4115
+ * contexts never read each other: a studio surface is always drawn with elements around it,
4116
+ * never the reverse, and a consumer stays free to mount a second `StudioProvider` deeper down (a
4117
+ * modal editing a different resource with narrower capabilities) over the same element seams.
4118
+ *
4119
+ * @example
4120
+ * ```tsx
4121
+ * import type { Mountaya } from "@mountaya/client";
4122
+ * import type { MountayaMap } from "@mountaya/elements";
4123
+ * import type { StudioToolContext, ToolBus, UiStoreApi } from "@mountaya/studio";
4124
+ * import type { ReactNode } from "react";
4125
+ *
4126
+ * declare const bus: ToolBus<StudioToolContext>;
4127
+ * declare const client: Mountaya;
4128
+ * declare const map: MountayaMap;
4129
+ * declare const store: UiStoreApi;
4130
+ * declare const surface: ReactNode;
4131
+ * declare const toolContext: StudioToolContext;
4132
+ *
4133
+ * <MountayaStudioProvider
4134
+ * client={client}
4135
+ * data={{ bus, capabilities: ["authenticated", "editor"], context: toolContext, store }}
4136
+ * map={map}
4137
+ * >
4138
+ * {surface}
4139
+ * </MountayaStudioProvider>;
4140
+ * ```
4141
+ */
4142
+ declare const MountayaStudioProvider: <TCtx extends ToolBusContext = ToolBusContext>({ appearance, assets, behavior, children, client, i18n, map, ...studio }: MountayaStudioProviderProps<TCtx>) => ReactNode;
4143
+
4144
+ /** The props of {@link StudioNavigationBlockerProvider}. */
4145
+ interface StudioNavigationBlockerProviderProps {
4146
+ /** The host's router binding, handed on as it is given. */
4147
+ readonly blocker: StudioNavigationBlocker;
4148
+ /** The guards that read the binding. */
4149
+ readonly children: ReactNode;
4150
+ }
4151
+ /**
4152
+ * StudioNavigationBlockerProvider supplies the host's router binding to every guard beneath it.
4153
+ *
4154
+ * `blocker` is handed on as it is given, and held by nothing here: a guard reads the binding
4155
+ * again whenever the function is a new one. A binding declared once, at module scope or under
4156
+ * `useCallback`, renders no guard of its own accord.
4157
+ */
4158
+ declare const StudioNavigationBlockerProvider: ({ blocker, children, }: StudioNavigationBlockerProviderProps) => react.JSX.Element;
4159
+ /**
4160
+ * useStudioNavigationBlock holds a departure the studio is not ready to allow.
4161
+ *
4162
+ * Two gates, and only one of them needs a host. `blockUnload` is the browser's own close-tab
4163
+ * prompt, which is a DOM API and is wired here, so a studio with no host binding still catches
4164
+ * the reader who closes the tab mid-edit, which is the half that actually loses work.
4165
+ * `shouldBlock` is IN-APP navigation, which only the host's router can intercept; with no
4166
+ * binding nothing is held and the reader leaves.
4167
+ *
4168
+ * Both predicates are read at fire time through a ref rather than captured, so a guard may read
4169
+ * live store state (an engine armed a moment ago, a run that has just ended) without attaching
4170
+ * the browser listener again on every render.
4171
+ *
4172
+ * @returns The hold the host's router binding answers, or one that holds nothing where no
4173
+ * binding is mounted.
4174
+ */
4175
+ declare const useStudioNavigationBlock: ({ blockUnload, shouldBlock, }: {
4176
+ readonly blockUnload: () => boolean;
4177
+ readonly shouldBlock: (attempt: StudioNavigationAttempt) => boolean;
4178
+ }) => StudioNavigationHold;
4179
+
4180
+ /** The props of {@link StudioNotifyProvider}. */
4181
+ interface StudioNotifyProviderProps {
4182
+ /** The surfaces that raise a notification. */
4183
+ readonly children: ReactNode;
4184
+ /** The host's notification surface, handed on as it is given. */
4185
+ readonly notify: StudioNotify;
4186
+ }
4187
+ /**
4188
+ * StudioNotifyProvider supplies the host's notification surface to everything beneath it.
4189
+ *
4190
+ * `notify` is handed on as it is given, and held by nothing here: a surface that reads it
4191
+ * renders again whenever the object is a new one, so a host declares it once.
4192
+ */
4193
+ declare const StudioNotifyProvider: ({ children, notify }: StudioNotifyProviderProps) => react.JSX.Element;
4194
+ /** useStudioNotify reads the host's notification surface. */
4195
+ declare const useStudioNotify: () => StudioNotify;
4196
+
4197
+ export { StudioCopilotProvider as L, usePluginSlot as a$, StudioNavigationBlockerProvider as a3, StudioNotifyProvider as a5, StudioOrganizationsProvider as a8, createStudioCache as aF, isStudioHeaderBrand as aG, useActiveCollabResources as aH, useActiveItineraryResource as aI, useActiveZoneResource as aJ, useAgentDriving as aK, useBeginSegmentEdit as aL, useBeginWaypointEdit as aM, useCapability as aN, useCollectionScope as aO, useCopilotAvailability as aP, useCopilotModelLine as aQ, useCopilotSetupAction as aR, useCopilotWithheldNotice as aS, useDeferredClick as aT, useEditActions as aU, useEscapeKey as aV, useInlineRename as aW, useLiveAwareSegments as aX, useMapHoveredRow as aY, usePeerLockHolderId as aZ, usePlatformViewer as a_, StudioPluginsProvider as af, StudioProvider as ah, useSegmentList as b0, useSegmentRow as b1, useSegmentRowActions as b2, useShallowSelector as b3, useStoreSlice as b4, useStreetViewCorridor as b5, useStudioActivities as b6, useStudioActivityIconUrl as b7, useStudioApi as b8, useStudioAppOrigin as b9, useStudioResourceKey as bA, useStudioSignedIn as bB, useStudioStorage as bC, useStudioStore as bD, useStudioStrings as bE, useStudioTokens as bF, useStudioToolContext as bG, useStudioUnits as bH, useStudioUrl as bI, useStudioUserId as bJ, useStudioViewer as bK, useStudioViewerEntitlement as bL, useStudioViewerItineraryLimit as bM, useStudioViewerPreferences as bN, useStudioViewerUnits as bO, useStudioViewerUserId as bP, useStudioWritableOrganizations as bQ, useUiStore as bR, useUiStoreApi as bS, useUiStoreShallow as bT, useWaypointList as bU, useWaypointRow as bV, useWaypointRowActions as bW, useStudioBillingGate as ba, useStudioCache as bb, useStudioClock as bc, useStudioContext as bd, useStudioControlAnchors as be, useStudioDemUrl as bf, useStudioDensity as bg, useStudioDispatch as bh, useStudioDispatchUnsafe as bi, useStudioEntitlement as bj, useStudioFailureAlert as bk, useStudioFormatters as bl, useStudioGeolocation as bm, useStudioHeader as bn, useStudioLanguageMark as bo, useStudioLanguages as bp, useStudioLayerThumbnail as bq, useStudioLinks as br, useStudioMapSeams as bs, useStudioNavigationBlock as bt, useStudioNotify as bu, useStudioObserve as bv, useStudioOrganizations as bw, useStudioPeerName as bx, useStudioPlugins as by, useStudioPreferences as bz, MountayaStudioProvider as j, STREETVIEW_CORRIDOR_METERS as l, StudioBillingGateProvider as z };
4198
+ export type { StudioFailureReporter as $, StudioBillingGateProviderProps as A, BeginSegmentEdit as B, CopilotAvailability as C, DeferredClick as D, EditActionsModel as E, StudioBillingGateSeam as F, StudioBillingSubject as G, StudioContextValue as H, InlineRename as I, StudioControlAnchors as J, StudioControlKind as K, MapHoveredRow as M, NavigationSeam as N, OrganizationScopeOption as O, PlatformViewerState as P, StudioCopilotProviderProps as Q, ReadableStore as R, StudioAssetsConfig as S, StudioCopilotSeam as T, UseSegmentRowOptions as U, StudioDataConfig as V, WaypointRowFailure as W, StudioDensity as X, StudioDispatchFn as Y, StudioDispatchOverrides as Z, StudioDispatchUnsafeFn as _, StudioHostAppearanceConfig as a, StudioHeaderBrand as a0, StudioHeaderOverride as a1, StudioLayerKind as a2, StudioNavigationBlockerProviderProps as a4, StudioNotifyProviderProps as a6, StudioOrganizations as a7, StudioOrganizationsProviderProps as a9, WaypointListModel as aA, WaypointRowActions as aB, WaypointRowModel as aC, WaypointRowVerb as aD, WritableOrganizationOption as aE, StudioPeerNameSeam as aa, StudioPluginErrorReporter as ab, StudioPluginFailure as ac, StudioPluginItem as ad, StudioPluginsBinding as ae, StudioPluginsProviderProps as ag, StudioProviderDataConfig as ai, StudioProviderProps as aj, StudioReactPlugin as ak, StudioReactPluginContribution as al, StudioReactPluginEntry as am, StudioReactPluginSubject as an, StudioSeamOverrides as ao, StudioTokenName as ap, StudioTokens as aq, StudioVideoConfig as ar, StudioWritableOrganizations as as, UseEditActionsOptions as at, UseInlineRenameOptions as au, UsePlatformViewerOptions as av, UseSegmentRowActionsOptions as aw, UseStudioDispatch as ax, UseStudioDispatchUnsafe as ay, UseWaypointRowActionsOptions as az, StudioHostBehaviorConfig as b, StudioHostDataConfig as c, StudioI18nConfig as d, StudioPluginsConfig as e, UseSegmentListOptions as f, UseWaypointListOptions as g, UseWaypointRowOptions as h, BeginWaypointEdit as i, MountayaStudioProviderProps as k, SegmentDraftSource as m, SegmentListActions as n, SegmentListModel as o, SegmentRow as p, SegmentRowActions as q, SegmentRowFailure as r, SegmentRowPostureState as s, SegmentRowVerb as t, SegmentSeamModel as u, StreetViewCorridor as v, StudioAppearanceConfig as w, StudioBehaviorConfig as x, StudioBillingGate as y };