@corva/ui 3.47.0-0 → 3.47.0-2

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 (213) hide show
  1. package/cjs-bundle/components/OffsetWellPickerV2/effects/index.js +1 -1
  2. package/cjs-bundle/components/OffsetWellPickerV2/effects/index.js.map +1 -1
  3. package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5.js +1 -1
  4. package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5.js.map +1 -1
  5. package/cjs-bundle/components/OffsetWellPickerV5/OffsetWellPickerV5WithStore.js +1 -1
  6. package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/AppHeader.js +1 -1
  7. package/cjs-bundle/components/OffsetWellPickerV5/components/AppHeader/AppHeader.module.css.js +1 -1
  8. package/cjs-bundle/components/OffsetWellPickerV5/components/CustomInfoIcon/CustomInfoIcon.js +1 -1
  9. package/cjs-bundle/components/OffsetWellPickerV5/components/CustomInfoIcon/CustomInfoIcon.js.map +1 -1
  10. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
  11. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/OffsetWellMap.js +1 -1
  12. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js +2 -0
  13. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js.map +1 -0
  14. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.module.css.js +2 -0
  15. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/GhostSelectionZone/GhostSelectionZone.js +1 -1
  16. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/GhostSelectionZone/constants.js +1 -1
  17. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHints.js +1 -1
  18. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/constants.js +1 -1
  19. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/constants.js.map +1 -1
  20. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useLassoSelection.js +1 -1
  21. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useRadiusKeyboardHandlers.js +1 -1
  22. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useTooltip.js +1 -1
  23. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useWellMarkers.js +1 -1
  24. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js +1 -1
  25. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js.map +1 -1
  26. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/OffsetWellsTableRow.js +1 -1
  27. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellsTable/OffsetWellsTableRow.js.map +1 -1
  28. package/cjs-bundle/components/OffsetWellPickerV5/constants.js +1 -1
  29. package/cjs-bundle/components/OffsetWellPickerV5/constants.js.map +1 -1
  30. package/cjs-bundle/components/OffsetWellPickerV5/effects/cache-utils/formatBytes.js +2 -0
  31. package/cjs-bundle/components/OffsetWellPickerV5/effects/cache-utils/formatBytes.js.map +1 -0
  32. package/cjs-bundle/components/OffsetWellPickerV5/effects/useAllWells/useAllWells.js +1 -1
  33. package/cjs-bundle/components/OffsetWellPickerV5/effects/useAllWellsCache/constants.js +1 -1
  34. package/cjs-bundle/components/OffsetWellPickerV5/effects/useAllWellsCache/useAllWellsCache.js +1 -1
  35. package/cjs-bundle/components/OffsetWellPickerV5/effects/useBicWells.js +1 -1
  36. package/cjs-bundle/components/OffsetWellPickerV5/effects/useBicWells.js.map +1 -1
  37. package/cjs-bundle/components/OffsetWellPickerV5/effects/useTileCache/constants.js +1 -1
  38. package/cjs-bundle/components/OffsetWellPickerV5/effects/useTileCache/idle-callback.js +1 -1
  39. package/cjs-bundle/components/OffsetWellPickerV5/effects/useTileCache/useTileCache.js +1 -1
  40. package/cjs-bundle/components/OffsetWellPickerV5/effects/useTileCache/useTileCache.js.map +1 -1
  41. package/cjs-bundle/components/OffsetWellPickerV5/effects/useViewportWells/useViewportWells.js +1 -1
  42. package/cjs-bundle/components/OffsetWellPickerV5/stores/company-safeguard/CompanySafeguardContext.js +2 -0
  43. package/cjs-bundle/components/OffsetWellPickerV5/stores/company-safeguard/CompanySafeguardContext.js.map +1 -0
  44. package/cjs-bundle/components/OffsetWellPickerV5/stores/company-safeguard/useCompanySafeguard.js +2 -0
  45. package/cjs-bundle/components/OffsetWellPickerV5/stores/company-safeguard/useCompanySafeguard.js.map +1 -0
  46. package/cjs-bundle/components/OffsetWellPickerV5/stores/picker-props-store/PickerPropsStoreProvider.js +1 -1
  47. package/cjs-bundle/components/OffsetWellPickerV5/stores/view-store/ViewStoreProvider.js +1 -1
  48. package/cjs-bundle/components/OffsetWellPickerV5/stores/viewport-store/createViewportStore.js +1 -1
  49. package/cjs-bundle/components/OffsetWellPickerV5/stores/viewport-store/utils/areWellMapsEqual.js +2 -0
  50. package/cjs-bundle/components/OffsetWellPickerV5/stores/viewport-store/utils/areWellMapsEqual.js.map +1 -0
  51. package/cjs-bundle/components/OffsetWellPickerV5/viewport/ViewType.js +2 -0
  52. package/cjs-bundle/components/OffsetWellPickerV5/viewport/ViewType.js.map +1 -0
  53. package/cjs-bundle/components/OffsetWellPickerV5/viewport/ViewportContext.js +2 -0
  54. package/cjs-bundle/components/OffsetWellPickerV5/viewport/ViewportContext.js.map +1 -0
  55. package/cjs-bundle/components/OffsetWellPickerV5/viewport/ViewportProvider.js +2 -0
  56. package/cjs-bundle/components/OffsetWellPickerV5/viewport/ViewportProvider.js.map +1 -0
  57. package/cjs-bundle/components/OffsetWellPickerV5/viewport/computeViewType.js +2 -0
  58. package/cjs-bundle/components/OffsetWellPickerV5/viewport/computeViewType.js.map +1 -0
  59. package/cjs-bundle/components/OffsetWellPickerV5/viewport/useViewType.js +2 -0
  60. package/cjs-bundle/components/OffsetWellPickerV5/viewport/useViewType.js.map +1 -0
  61. package/cjs-bundle/componentsV2/Button/Button.scss.js +1 -1
  62. package/components/OffsetWellPickerV2/effects/index.d.ts.map +1 -1
  63. package/components/OffsetWellPickerV2/effects/index.js +1 -1
  64. package/components/OffsetWellPickerV2/effects/index.js.map +1 -1
  65. package/components/OffsetWellPickerV5/OffsetWellPickerV5.d.ts.map +1 -1
  66. package/components/OffsetWellPickerV5/OffsetWellPickerV5.js +1 -1
  67. package/components/OffsetWellPickerV5/OffsetWellPickerV5.js.map +1 -1
  68. package/components/OffsetWellPickerV5/OffsetWellPickerV5WithStore.d.ts.map +1 -1
  69. package/components/OffsetWellPickerV5/OffsetWellPickerV5WithStore.js +1 -1
  70. package/components/OffsetWellPickerV5/components/AppHeader/AppHeader.d.ts.map +1 -1
  71. package/components/OffsetWellPickerV5/components/AppHeader/AppHeader.js +1 -1
  72. package/components/OffsetWellPickerV5/components/AppHeader/AppHeader.module.css.js +1 -1
  73. package/components/OffsetWellPickerV5/components/CustomInfoIcon/CustomInfoIcon.d.ts.map +1 -1
  74. package/components/OffsetWellPickerV5/components/CustomInfoIcon/CustomInfoIcon.js +1 -1
  75. package/components/OffsetWellPickerV5/components/CustomInfoIcon/CustomInfoIcon.js.map +1 -1
  76. package/components/OffsetWellPickerV5/components/Filter/Filter.d.ts +1 -2
  77. package/components/OffsetWellPickerV5/components/Filter/Filter.d.ts.map +1 -1
  78. package/components/OffsetWellPickerV5/components/Filter/Filter.js +1 -1
  79. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/OffsetWellMap.d.ts.map +1 -1
  80. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/OffsetWellMap.js +1 -1
  81. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.d.ts +8 -0
  82. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.d.ts.map +1 -0
  83. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js +2 -0
  84. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.js.map +1 -0
  85. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/ClusterTooltip.module.css.js +2 -0
  86. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/index.d.ts +2 -0
  87. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ClusterTooltip/index.d.ts.map +1 -0
  88. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/GhostSelectionZone/GhostSelectionZone.d.ts.map +1 -1
  89. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/GhostSelectionZone/GhostSelectionZone.js +1 -1
  90. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/GhostSelectionZone/constants.d.ts +1 -7
  91. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/GhostSelectionZone/constants.d.ts.map +1 -1
  92. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/GhostSelectionZone/constants.js +1 -1
  93. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHints.d.ts.map +1 -1
  94. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/MapHints/MapHints.js +1 -1
  95. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/constants.d.ts +6 -2
  96. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/constants.d.ts.map +1 -1
  97. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/constants.js +1 -1
  98. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/constants.js.map +1 -1
  99. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useLassoSelection.d.ts.map +1 -1
  100. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useLassoSelection.js +1 -1
  101. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useRadiusKeyboardHandlers.d.ts +1 -2
  102. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useRadiusKeyboardHandlers.d.ts.map +1 -1
  103. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useRadiusKeyboardHandlers.js +1 -1
  104. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useTooltip.d.ts +8 -0
  105. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useTooltip.d.ts.map +1 -1
  106. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useTooltip.js +1 -1
  107. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useWellMarkers.d.ts +1 -5
  108. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useWellMarkers.d.ts.map +1 -1
  109. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useWellMarkers.js +1 -1
  110. package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js +1 -1
  111. package/components/OffsetWellPickerV5/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js.map +1 -1
  112. package/components/OffsetWellPickerV5/components/OffsetWellsTable/OffsetWellsTableRow.d.ts.map +1 -1
  113. package/components/OffsetWellPickerV5/components/OffsetWellsTable/OffsetWellsTableRow.js +1 -1
  114. package/components/OffsetWellPickerV5/components/OffsetWellsTable/OffsetWellsTableRow.js.map +1 -1
  115. package/components/OffsetWellPickerV5/constants.d.ts +0 -1
  116. package/components/OffsetWellPickerV5/constants.d.ts.map +1 -1
  117. package/components/OffsetWellPickerV5/constants.js +1 -1
  118. package/components/OffsetWellPickerV5/constants.js.map +1 -1
  119. package/components/OffsetWellPickerV5/effects/cache-utils/formatBytes.d.ts +2 -0
  120. package/components/OffsetWellPickerV5/effects/cache-utils/formatBytes.d.ts.map +1 -0
  121. package/components/OffsetWellPickerV5/effects/cache-utils/formatBytes.js +2 -0
  122. package/components/OffsetWellPickerV5/effects/cache-utils/formatBytes.js.map +1 -0
  123. package/components/OffsetWellPickerV5/effects/cache-utils/index.d.ts +3 -0
  124. package/components/OffsetWellPickerV5/effects/cache-utils/index.d.ts.map +1 -0
  125. package/components/OffsetWellPickerV5/effects/cache-utils/types.d.ts +21 -0
  126. package/components/OffsetWellPickerV5/effects/cache-utils/types.d.ts.map +1 -0
  127. package/components/OffsetWellPickerV5/effects/useAllWells/useAllWells.d.ts +9 -1
  128. package/components/OffsetWellPickerV5/effects/useAllWells/useAllWells.d.ts.map +1 -1
  129. package/components/OffsetWellPickerV5/effects/useAllWells/useAllWells.js +1 -1
  130. package/components/OffsetWellPickerV5/effects/useAllWellsCache/constants.d.ts +5 -1
  131. package/components/OffsetWellPickerV5/effects/useAllWellsCache/constants.d.ts.map +1 -1
  132. package/components/OffsetWellPickerV5/effects/useAllWellsCache/constants.js +1 -1
  133. package/components/OffsetWellPickerV5/effects/useAllWellsCache/types.d.ts +3 -8
  134. package/components/OffsetWellPickerV5/effects/useAllWellsCache/types.d.ts.map +1 -1
  135. package/components/OffsetWellPickerV5/effects/useAllWellsCache/useAllWellsCache.d.ts +5 -26
  136. package/components/OffsetWellPickerV5/effects/useAllWellsCache/useAllWellsCache.d.ts.map +1 -1
  137. package/components/OffsetWellPickerV5/effects/useAllWellsCache/useAllWellsCache.js +1 -1
  138. package/components/OffsetWellPickerV5/effects/useBicWells.d.ts.map +1 -1
  139. package/components/OffsetWellPickerV5/effects/useBicWells.js +1 -1
  140. package/components/OffsetWellPickerV5/effects/useBicWells.js.map +1 -1
  141. package/components/OffsetWellPickerV5/effects/useTileCache/constants.d.ts +5 -1
  142. package/components/OffsetWellPickerV5/effects/useTileCache/constants.d.ts.map +1 -1
  143. package/components/OffsetWellPickerV5/effects/useTileCache/constants.js +1 -1
  144. package/components/OffsetWellPickerV5/effects/useTileCache/idle-callback.d.ts +3 -17
  145. package/components/OffsetWellPickerV5/effects/useTileCache/idle-callback.d.ts.map +1 -1
  146. package/components/OffsetWellPickerV5/effects/useTileCache/idle-callback.js +1 -1
  147. package/components/OffsetWellPickerV5/effects/useTileCache/index.d.ts +1 -1
  148. package/components/OffsetWellPickerV5/effects/useTileCache/index.d.ts.map +1 -1
  149. package/components/OffsetWellPickerV5/effects/useTileCache/types.d.ts +4 -11
  150. package/components/OffsetWellPickerV5/effects/useTileCache/types.d.ts.map +1 -1
  151. package/components/OffsetWellPickerV5/effects/useTileCache/useTileCache.d.ts +6 -76
  152. package/components/OffsetWellPickerV5/effects/useTileCache/useTileCache.d.ts.map +1 -1
  153. package/components/OffsetWellPickerV5/effects/useTileCache/useTileCache.js +1 -1
  154. package/components/OffsetWellPickerV5/effects/useTileCache/useTileCache.js.map +1 -1
  155. package/components/OffsetWellPickerV5/effects/useViewportWells/useViewportWells.d.ts.map +1 -1
  156. package/components/OffsetWellPickerV5/effects/useViewportWells/useViewportWells.js +1 -1
  157. package/components/OffsetWellPickerV5/stores/company-safeguard/CompanySafeguardContext.d.ts +13 -0
  158. package/components/OffsetWellPickerV5/stores/company-safeguard/CompanySafeguardContext.d.ts.map +1 -0
  159. package/components/OffsetWellPickerV5/stores/company-safeguard/CompanySafeguardContext.js +2 -0
  160. package/components/OffsetWellPickerV5/stores/company-safeguard/CompanySafeguardContext.js.map +1 -0
  161. package/components/OffsetWellPickerV5/stores/company-safeguard/index.d.ts +4 -0
  162. package/components/OffsetWellPickerV5/stores/company-safeguard/index.d.ts.map +1 -0
  163. package/components/OffsetWellPickerV5/stores/company-safeguard/useCompanySafeguard.d.ts +3 -0
  164. package/components/OffsetWellPickerV5/stores/company-safeguard/useCompanySafeguard.d.ts.map +1 -0
  165. package/components/OffsetWellPickerV5/stores/company-safeguard/useCompanySafeguard.js +2 -0
  166. package/components/OffsetWellPickerV5/stores/company-safeguard/useCompanySafeguard.js.map +1 -0
  167. package/components/OffsetWellPickerV5/stores/picker-props-store/PickerPropsStoreProvider.d.ts.map +1 -1
  168. package/components/OffsetWellPickerV5/stores/picker-props-store/PickerPropsStoreProvider.js +1 -1
  169. package/components/OffsetWellPickerV5/stores/view-store/ViewStoreProvider.d.ts.map +1 -1
  170. package/components/OffsetWellPickerV5/stores/view-store/ViewStoreProvider.js +1 -1
  171. package/components/OffsetWellPickerV5/stores/viewport-store/createViewportStore.d.ts.map +1 -1
  172. package/components/OffsetWellPickerV5/stores/viewport-store/createViewportStore.js +1 -1
  173. package/components/OffsetWellPickerV5/stores/viewport-store/utils/areWellMapsEqual.d.ts +2 -0
  174. package/components/OffsetWellPickerV5/stores/viewport-store/utils/areWellMapsEqual.d.ts.map +1 -0
  175. package/components/OffsetWellPickerV5/stores/viewport-store/utils/areWellMapsEqual.js +2 -0
  176. package/components/OffsetWellPickerV5/stores/viewport-store/utils/areWellMapsEqual.js.map +1 -0
  177. package/components/OffsetWellPickerV5/viewport/ViewType.d.ts +7 -0
  178. package/components/OffsetWellPickerV5/viewport/ViewType.d.ts.map +1 -0
  179. package/components/OffsetWellPickerV5/viewport/ViewType.js +2 -0
  180. package/components/OffsetWellPickerV5/viewport/ViewType.js.map +1 -0
  181. package/components/OffsetWellPickerV5/viewport/ViewportContext.d.ts +3 -0
  182. package/components/OffsetWellPickerV5/viewport/ViewportContext.d.ts.map +1 -0
  183. package/components/OffsetWellPickerV5/viewport/ViewportContext.js +2 -0
  184. package/components/OffsetWellPickerV5/viewport/ViewportContext.js.map +1 -0
  185. package/components/OffsetWellPickerV5/viewport/ViewportProvider.d.ts +7 -0
  186. package/components/OffsetWellPickerV5/viewport/ViewportProvider.d.ts.map +1 -0
  187. package/components/OffsetWellPickerV5/viewport/ViewportProvider.js +2 -0
  188. package/components/OffsetWellPickerV5/viewport/ViewportProvider.js.map +1 -0
  189. package/components/OffsetWellPickerV5/viewport/computeViewType.d.ts +3 -0
  190. package/components/OffsetWellPickerV5/viewport/computeViewType.d.ts.map +1 -0
  191. package/components/OffsetWellPickerV5/viewport/computeViewType.js +2 -0
  192. package/components/OffsetWellPickerV5/viewport/computeViewType.js.map +1 -0
  193. package/components/OffsetWellPickerV5/viewport/index.d.ts +5 -0
  194. package/components/OffsetWellPickerV5/viewport/index.d.ts.map +1 -0
  195. package/components/OffsetWellPickerV5/viewport/useViewType.d.ts +7 -0
  196. package/components/OffsetWellPickerV5/viewport/useViewType.d.ts.map +1 -0
  197. package/components/OffsetWellPickerV5/viewport/useViewType.js +2 -0
  198. package/components/OffsetWellPickerV5/viewport/useViewType.js.map +1 -0
  199. package/componentsV2/Button/Button.scss.js +1 -1
  200. package/mcp-server/setup.mjs +1108 -16
  201. package/package.json +3 -2
  202. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ConfirmationPopup/ConfirmationPopup.js +0 -2
  203. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ConfirmationPopup/ConfirmationPopup.js.map +0 -1
  204. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ConfirmationPopup/ConfirmationPopup.module.css.js +0 -2
  205. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useConfirmationPopupPosition.js +0 -2
  206. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useConfirmationPopupPosition.js.map +0 -1
  207. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ConfirmationPopup/ConfirmationPopup.js +0 -2
  208. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ConfirmationPopup/ConfirmationPopup.js.map +0 -1
  209. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/ConfirmationPopup/ConfirmationPopup.module.css.js +0 -2
  210. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useConfirmationPopupPosition.js +0 -2
  211. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useConfirmationPopupPosition.js.map +0 -1
  212. /package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/{ConfirmationPopup/ConfirmationPopup.module.css.js.map → ClusterTooltip/ClusterTooltip.module.css.js.map} +0 -0
  213. /package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/components/{ConfirmationPopup/ConfirmationPopup.module.css.js.map → ClusterTooltip/ClusterTooltip.module.css.js.map} +0 -0
@@ -2,6 +2,1072 @@
2
2
  import { mkdirSync, existsSync, readFileSync, writeFileSync } from 'fs';
3
3
  import { resolve, dirname } from 'path';
4
4
 
5
+ /*!
6
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
7
+ * SPDX-License-Identifier: BSD-3-Clause
8
+ *
9
+ * Redistribution and use in source and binary forms, with or without
10
+ * modification, are permitted provided that the following conditions are met:
11
+ *
12
+ * 1. Redistributions of source code must retain the above copyright notice, this
13
+ * list of conditions and the following disclaimer.
14
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
15
+ * this list of conditions and the following disclaimer in the
16
+ * documentation and/or other materials provided with the distribution.
17
+ * 3. Neither the name of the copyright holder nor the names of its contributors
18
+ * may be used to endorse or promote products derived from this software without
19
+ * specific prior written permission.
20
+ *
21
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ */
32
+ function getLineColFromPtr(string, ptr) {
33
+ let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
34
+ return [lines.length, lines.pop().length + 1];
35
+ }
36
+ function makeCodeBlock(string, line, column) {
37
+ let lines = string.split(/\r\n|\n|\r/g);
38
+ let codeblock = '';
39
+ let numberLen = (Math.log10(line + 1) | 0) + 1;
40
+ for (let i = line - 1; i <= line + 1; i++) {
41
+ let l = lines[i - 1];
42
+ if (!l)
43
+ continue;
44
+ codeblock += i.toString().padEnd(numberLen, ' ');
45
+ codeblock += ': ';
46
+ codeblock += l;
47
+ codeblock += '\n';
48
+ if (i === line) {
49
+ codeblock += ' '.repeat(numberLen + column + 2);
50
+ codeblock += '^\n';
51
+ }
52
+ }
53
+ return codeblock;
54
+ }
55
+ class TomlError extends Error {
56
+ line;
57
+ column;
58
+ codeblock;
59
+ constructor(message, options) {
60
+ const [line, column] = getLineColFromPtr(options.toml, options.ptr);
61
+ const codeblock = makeCodeBlock(options.toml, line, column);
62
+ super(`Invalid TOML document: ${message}\n\n${codeblock}`, options);
63
+ this.line = line;
64
+ this.column = column;
65
+ this.codeblock = codeblock;
66
+ }
67
+ }
68
+
69
+ /*!
70
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
71
+ * SPDX-License-Identifier: BSD-3-Clause
72
+ *
73
+ * Redistribution and use in source and binary forms, with or without
74
+ * modification, are permitted provided that the following conditions are met:
75
+ *
76
+ * 1. Redistributions of source code must retain the above copyright notice, this
77
+ * list of conditions and the following disclaimer.
78
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
79
+ * this list of conditions and the following disclaimer in the
80
+ * documentation and/or other materials provided with the distribution.
81
+ * 3. Neither the name of the copyright holder nor the names of its contributors
82
+ * may be used to endorse or promote products derived from this software without
83
+ * specific prior written permission.
84
+ *
85
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
86
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
87
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
88
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
89
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
90
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
91
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
92
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
93
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
94
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
95
+ */
96
+ function isEscaped(str, ptr) {
97
+ let i = 0;
98
+ while (str[ptr - ++i] === '\\')
99
+ ;
100
+ return --i && (i % 2);
101
+ }
102
+ function indexOfNewline(str, start = 0, end = str.length) {
103
+ let idx = str.indexOf('\n', start);
104
+ if (str[idx - 1] === '\r')
105
+ idx--;
106
+ return idx <= end ? idx : -1;
107
+ }
108
+ function skipComment(str, ptr) {
109
+ for (let i = ptr; i < str.length; i++) {
110
+ let c = str[i];
111
+ if (c === '\n')
112
+ return i;
113
+ if (c === '\r' && str[i + 1] === '\n')
114
+ return i + 1;
115
+ if ((c < '\x20' && c !== '\t') || c === '\x7f') {
116
+ throw new TomlError('control characters are not allowed in comments', {
117
+ toml: str,
118
+ ptr: ptr,
119
+ });
120
+ }
121
+ }
122
+ return str.length;
123
+ }
124
+ function skipVoid(str, ptr, banNewLines, banComments) {
125
+ let c;
126
+ while ((c = str[ptr]) === ' ' || c === '\t' || (!banNewLines && (c === '\n' || c === '\r' && str[ptr + 1] === '\n')))
127
+ ptr++;
128
+ return banComments || c !== '#'
129
+ ? ptr
130
+ : skipVoid(str, skipComment(str, ptr), banNewLines);
131
+ }
132
+ function skipUntil(str, ptr, sep, end, banNewLines = false) {
133
+ if (!end) {
134
+ ptr = indexOfNewline(str, ptr);
135
+ return ptr < 0 ? str.length : ptr;
136
+ }
137
+ for (let i = ptr; i < str.length; i++) {
138
+ let c = str[i];
139
+ if (c === '#') {
140
+ i = indexOfNewline(str, i);
141
+ }
142
+ else if (c === sep) {
143
+ return i + 1;
144
+ }
145
+ else if (c === end || (banNewLines && (c === '\n' || (c === '\r' && str[i + 1] === '\n')))) {
146
+ return i;
147
+ }
148
+ }
149
+ throw new TomlError('cannot find end of structure', {
150
+ toml: str,
151
+ ptr: ptr
152
+ });
153
+ }
154
+ function getStringEnd(str, seek) {
155
+ let first = str[seek];
156
+ let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2]
157
+ ? str.slice(seek, seek + 3)
158
+ : first;
159
+ seek += target.length - 1;
160
+ do
161
+ seek = str.indexOf(target, ++seek);
162
+ while (seek > -1 && first !== "'" && isEscaped(str, seek));
163
+ if (seek > -1) {
164
+ seek += target.length;
165
+ if (target.length > 1) {
166
+ if (str[seek] === first)
167
+ seek++;
168
+ if (str[seek] === first)
169
+ seek++;
170
+ }
171
+ }
172
+ return seek;
173
+ }
174
+
175
+ /*!
176
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
177
+ * SPDX-License-Identifier: BSD-3-Clause
178
+ *
179
+ * Redistribution and use in source and binary forms, with or without
180
+ * modification, are permitted provided that the following conditions are met:
181
+ *
182
+ * 1. Redistributions of source code must retain the above copyright notice, this
183
+ * list of conditions and the following disclaimer.
184
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
185
+ * this list of conditions and the following disclaimer in the
186
+ * documentation and/or other materials provided with the distribution.
187
+ * 3. Neither the name of the copyright holder nor the names of its contributors
188
+ * may be used to endorse or promote products derived from this software without
189
+ * specific prior written permission.
190
+ *
191
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
192
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
193
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
194
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
195
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
196
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
197
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
198
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
199
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
200
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
201
+ */
202
+ let DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
203
+ class TomlDate extends Date {
204
+ #hasDate = false;
205
+ #hasTime = false;
206
+ #offset = null;
207
+ constructor(date) {
208
+ let hasDate = true;
209
+ let hasTime = true;
210
+ let offset = 'Z';
211
+ if (typeof date === 'string') {
212
+ let match = date.match(DATE_TIME_RE);
213
+ if (match) {
214
+ if (!match[1]) {
215
+ hasDate = false;
216
+ date = `0000-01-01T${date}`;
217
+ }
218
+ hasTime = !!match[2];
219
+ // Make sure to use T instead of a space. Breaks in case of extreme values otherwise.
220
+ hasTime && date[10] === ' ' && (date = date.replace(' ', 'T'));
221
+ // Do not allow rollover hours.
222
+ if (match[2] && +match[2] > 23) {
223
+ date = '';
224
+ }
225
+ else {
226
+ offset = match[3] || null;
227
+ date = date.toUpperCase();
228
+ if (!offset && hasTime)
229
+ date += 'Z';
230
+ }
231
+ }
232
+ else {
233
+ date = '';
234
+ }
235
+ }
236
+ super(date);
237
+ if (!isNaN(this.getTime())) {
238
+ this.#hasDate = hasDate;
239
+ this.#hasTime = hasTime;
240
+ this.#offset = offset;
241
+ }
242
+ }
243
+ isDateTime() {
244
+ return this.#hasDate && this.#hasTime;
245
+ }
246
+ isLocal() {
247
+ return !this.#hasDate || !this.#hasTime || !this.#offset;
248
+ }
249
+ isDate() {
250
+ return this.#hasDate && !this.#hasTime;
251
+ }
252
+ isTime() {
253
+ return this.#hasTime && !this.#hasDate;
254
+ }
255
+ isValid() {
256
+ return this.#hasDate || this.#hasTime;
257
+ }
258
+ toISOString() {
259
+ let iso = super.toISOString();
260
+ // Local Date
261
+ if (this.isDate())
262
+ return iso.slice(0, 10);
263
+ // Local Time
264
+ if (this.isTime())
265
+ return iso.slice(11, 23);
266
+ // Local DateTime
267
+ if (this.#offset === null)
268
+ return iso.slice(0, -1);
269
+ // Offset DateTime
270
+ if (this.#offset === 'Z')
271
+ return iso;
272
+ // This part is quite annoying: JS strips the original timezone from the ISO string representation
273
+ // Instead of using a "modified" date and "Z", we restore the representation "as authored"
274
+ let offset = (+(this.#offset.slice(1, 3)) * 60) + +(this.#offset.slice(4, 6));
275
+ offset = this.#offset[0] === '-' ? offset : -offset;
276
+ let offsetDate = new Date(this.getTime() - (offset * 60e3));
277
+ return offsetDate.toISOString().slice(0, -1) + this.#offset;
278
+ }
279
+ static wrapAsOffsetDateTime(jsDate, offset = 'Z') {
280
+ let date = new TomlDate(jsDate);
281
+ date.#offset = offset;
282
+ return date;
283
+ }
284
+ static wrapAsLocalDateTime(jsDate) {
285
+ let date = new TomlDate(jsDate);
286
+ date.#offset = null;
287
+ return date;
288
+ }
289
+ static wrapAsLocalDate(jsDate) {
290
+ let date = new TomlDate(jsDate);
291
+ date.#hasTime = false;
292
+ date.#offset = null;
293
+ return date;
294
+ }
295
+ static wrapAsLocalTime(jsDate) {
296
+ let date = new TomlDate(jsDate);
297
+ date.#hasDate = false;
298
+ date.#offset = null;
299
+ return date;
300
+ }
301
+ }
302
+
303
+ /*!
304
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
305
+ * SPDX-License-Identifier: BSD-3-Clause
306
+ *
307
+ * Redistribution and use in source and binary forms, with or without
308
+ * modification, are permitted provided that the following conditions are met:
309
+ *
310
+ * 1. Redistributions of source code must retain the above copyright notice, this
311
+ * list of conditions and the following disclaimer.
312
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
313
+ * this list of conditions and the following disclaimer in the
314
+ * documentation and/or other materials provided with the distribution.
315
+ * 3. Neither the name of the copyright holder nor the names of its contributors
316
+ * may be used to endorse or promote products derived from this software without
317
+ * specific prior written permission.
318
+ *
319
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
320
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
321
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
322
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
323
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
324
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
325
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
326
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
327
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
328
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
329
+ */
330
+ let INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
331
+ let FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
332
+ let LEADING_ZERO = /^[+-]?0[0-9_]/;
333
+ let ESCAPE_REGEX = /^[0-9a-f]{2,8}$/i;
334
+ let ESC_MAP = {
335
+ b: '\b',
336
+ t: '\t',
337
+ n: '\n',
338
+ f: '\f',
339
+ r: '\r',
340
+ e: '\x1b',
341
+ '"': '"',
342
+ '\\': '\\',
343
+ };
344
+ function parseString(str, ptr = 0, endPtr = str.length) {
345
+ let isLiteral = str[ptr] === '\'';
346
+ let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
347
+ if (isMultiline) {
348
+ endPtr -= 2;
349
+ if (str[ptr += 2] === '\r')
350
+ ptr++;
351
+ if (str[ptr] === '\n')
352
+ ptr++;
353
+ }
354
+ let tmp = 0;
355
+ let isEscape;
356
+ let parsed = '';
357
+ let sliceStart = ptr;
358
+ while (ptr < endPtr - 1) {
359
+ let c = str[ptr++];
360
+ if (c === '\n' || (c === '\r' && str[ptr] === '\n')) {
361
+ if (!isMultiline) {
362
+ throw new TomlError('newlines are not allowed in strings', {
363
+ toml: str,
364
+ ptr: ptr - 1,
365
+ });
366
+ }
367
+ }
368
+ else if ((c < '\x20' && c !== '\t') || c === '\x7f') {
369
+ throw new TomlError('control characters are not allowed in strings', {
370
+ toml: str,
371
+ ptr: ptr - 1,
372
+ });
373
+ }
374
+ if (isEscape) {
375
+ isEscape = false;
376
+ if (c === 'x' || c === 'u' || c === 'U') {
377
+ // Unicode escape
378
+ let code = str.slice(ptr, (ptr += (c === 'x' ? 2 : c === 'u' ? 4 : 8)));
379
+ if (!ESCAPE_REGEX.test(code)) {
380
+ throw new TomlError('invalid unicode escape', {
381
+ toml: str,
382
+ ptr: tmp,
383
+ });
384
+ }
385
+ try {
386
+ parsed += String.fromCodePoint(parseInt(code, 16));
387
+ }
388
+ catch {
389
+ throw new TomlError('invalid unicode escape', {
390
+ toml: str,
391
+ ptr: tmp,
392
+ });
393
+ }
394
+ }
395
+ else if (isMultiline && (c === '\n' || c === ' ' || c === '\t' || c === '\r')) {
396
+ // Multiline escape
397
+ ptr = skipVoid(str, ptr - 1, true);
398
+ if (str[ptr] !== '\n' && str[ptr] !== '\r') {
399
+ throw new TomlError('invalid escape: only line-ending whitespace may be escaped', {
400
+ toml: str,
401
+ ptr: tmp,
402
+ });
403
+ }
404
+ ptr = skipVoid(str, ptr);
405
+ }
406
+ else if (c in ESC_MAP) {
407
+ // Classic escape
408
+ parsed += ESC_MAP[c];
409
+ }
410
+ else {
411
+ throw new TomlError('unrecognized escape sequence', {
412
+ toml: str,
413
+ ptr: tmp,
414
+ });
415
+ }
416
+ sliceStart = ptr;
417
+ }
418
+ else if (!isLiteral && c === '\\') {
419
+ tmp = ptr - 1;
420
+ isEscape = true;
421
+ parsed += str.slice(sliceStart, tmp);
422
+ }
423
+ }
424
+ return parsed + str.slice(sliceStart, endPtr - 1);
425
+ }
426
+ function parseValue(value, toml, ptr, integersAsBigInt) {
427
+ // Constant values
428
+ if (value === 'true')
429
+ return true;
430
+ if (value === 'false')
431
+ return false;
432
+ if (value === '-inf')
433
+ return -Infinity;
434
+ if (value === 'inf' || value === '+inf')
435
+ return Infinity;
436
+ if (value === 'nan' || value === '+nan' || value === '-nan')
437
+ return NaN;
438
+ // Avoid FP representation of -0
439
+ if (value === '-0')
440
+ return integersAsBigInt ? 0n : 0;
441
+ // Numbers
442
+ let isInt = INT_REGEX.test(value);
443
+ if (isInt || FLOAT_REGEX.test(value)) {
444
+ if (LEADING_ZERO.test(value)) {
445
+ throw new TomlError('leading zeroes are not allowed', {
446
+ toml: toml,
447
+ ptr: ptr,
448
+ });
449
+ }
450
+ value = value.replace(/_/g, '');
451
+ let numeric = +value;
452
+ if (isNaN(numeric)) {
453
+ throw new TomlError('invalid number', {
454
+ toml: toml,
455
+ ptr: ptr,
456
+ });
457
+ }
458
+ if (isInt) {
459
+ if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {
460
+ throw new TomlError('integer value cannot be represented losslessly', {
461
+ toml: toml,
462
+ ptr: ptr,
463
+ });
464
+ }
465
+ if (isInt || integersAsBigInt === true)
466
+ numeric = BigInt(value);
467
+ }
468
+ return numeric;
469
+ }
470
+ const date = new TomlDate(value);
471
+ if (!date.isValid()) {
472
+ throw new TomlError('invalid value', {
473
+ toml: toml,
474
+ ptr: ptr,
475
+ });
476
+ }
477
+ return date;
478
+ }
479
+
480
+ /*!
481
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
482
+ * SPDX-License-Identifier: BSD-3-Clause
483
+ *
484
+ * Redistribution and use in source and binary forms, with or without
485
+ * modification, are permitted provided that the following conditions are met:
486
+ *
487
+ * 1. Redistributions of source code must retain the above copyright notice, this
488
+ * list of conditions and the following disclaimer.
489
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
490
+ * this list of conditions and the following disclaimer in the
491
+ * documentation and/or other materials provided with the distribution.
492
+ * 3. Neither the name of the copyright holder nor the names of its contributors
493
+ * may be used to endorse or promote products derived from this software without
494
+ * specific prior written permission.
495
+ *
496
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
497
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
498
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
499
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
500
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
501
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
502
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
503
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
504
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
505
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
506
+ */
507
+ function sliceAndTrimEndOf(str, startPtr, endPtr) {
508
+ let value = str.slice(startPtr, endPtr);
509
+ let commentIdx = value.indexOf('#');
510
+ if (commentIdx > -1) {
511
+ // The call to skipComment allows to "validate" the comment
512
+ // (absence of control characters)
513
+ skipComment(str, commentIdx);
514
+ value = value.slice(0, commentIdx);
515
+ }
516
+ return [value.trimEnd(), commentIdx];
517
+ }
518
+ function extractValue(str, ptr, end, depth, integersAsBigInt) {
519
+ if (depth === 0) {
520
+ throw new TomlError('document contains excessively nested structures. aborting.', {
521
+ toml: str,
522
+ ptr: ptr
523
+ });
524
+ }
525
+ let c = str[ptr];
526
+ if (c === '[' || c === '{') {
527
+ let [value, endPtr] = c === '['
528
+ ? parseArray(str, ptr, depth, integersAsBigInt)
529
+ : parseInlineTable(str, ptr, depth, integersAsBigInt);
530
+ if (end) {
531
+ endPtr = skipVoid(str, endPtr);
532
+ if (str[endPtr] === ',')
533
+ endPtr++;
534
+ else if (str[endPtr] !== end) {
535
+ throw new TomlError('expected comma or end of structure', {
536
+ toml: str,
537
+ ptr: endPtr,
538
+ });
539
+ }
540
+ }
541
+ return [value, endPtr];
542
+ }
543
+ let endPtr;
544
+ if (c === '"' || c === "'") {
545
+ endPtr = getStringEnd(str, ptr);
546
+ let parsed = parseString(str, ptr, endPtr);
547
+ if (end) {
548
+ endPtr = skipVoid(str, endPtr);
549
+ if (str[endPtr] && str[endPtr] !== ',' && str[endPtr] !== end && str[endPtr] !== '\n' && str[endPtr] !== '\r') {
550
+ throw new TomlError('unexpected character encountered', {
551
+ toml: str,
552
+ ptr: endPtr,
553
+ });
554
+ }
555
+ endPtr += (+(str[endPtr] === ','));
556
+ }
557
+ return [parsed, endPtr];
558
+ }
559
+ endPtr = skipUntil(str, ptr, ',', end);
560
+ let slice = sliceAndTrimEndOf(str, ptr, endPtr - (+(str[endPtr - 1] === ',')));
561
+ if (!slice[0]) {
562
+ throw new TomlError('incomplete key-value declaration: no value specified', {
563
+ toml: str,
564
+ ptr: ptr
565
+ });
566
+ }
567
+ if (end && slice[1] > -1) {
568
+ endPtr = skipVoid(str, ptr + slice[1]);
569
+ endPtr += +(str[endPtr] === ',');
570
+ }
571
+ return [
572
+ parseValue(slice[0], str, ptr, integersAsBigInt),
573
+ endPtr,
574
+ ];
575
+ }
576
+
577
+ /*!
578
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
579
+ * SPDX-License-Identifier: BSD-3-Clause
580
+ *
581
+ * Redistribution and use in source and binary forms, with or without
582
+ * modification, are permitted provided that the following conditions are met:
583
+ *
584
+ * 1. Redistributions of source code must retain the above copyright notice, this
585
+ * list of conditions and the following disclaimer.
586
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
587
+ * this list of conditions and the following disclaimer in the
588
+ * documentation and/or other materials provided with the distribution.
589
+ * 3. Neither the name of the copyright holder nor the names of its contributors
590
+ * may be used to endorse or promote products derived from this software without
591
+ * specific prior written permission.
592
+ *
593
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
594
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
595
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
596
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
597
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
598
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
599
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
600
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
601
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
602
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
603
+ */
604
+ let KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
605
+ function parseKey(str, ptr, end = '=') {
606
+ let dot = ptr - 1;
607
+ let parsed = [];
608
+ let endPtr = str.indexOf(end, ptr);
609
+ if (endPtr < 0) {
610
+ throw new TomlError('incomplete key-value: cannot find end of key', {
611
+ toml: str,
612
+ ptr: ptr,
613
+ });
614
+ }
615
+ do {
616
+ let c = str[ptr = ++dot];
617
+ // If it's whitespace, ignore
618
+ if (c !== ' ' && c !== '\t') {
619
+ // If it's a string
620
+ if (c === '"' || c === '\'') {
621
+ if (c === str[ptr + 1] && c === str[ptr + 2]) {
622
+ throw new TomlError('multiline strings are not allowed in keys', {
623
+ toml: str,
624
+ ptr: ptr,
625
+ });
626
+ }
627
+ let eos = getStringEnd(str, ptr);
628
+ if (eos < 0) {
629
+ throw new TomlError('unfinished string encountered', {
630
+ toml: str,
631
+ ptr: ptr,
632
+ });
633
+ }
634
+ dot = str.indexOf('.', eos);
635
+ let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
636
+ let newLine = indexOfNewline(strEnd);
637
+ if (newLine > -1) {
638
+ throw new TomlError('newlines are not allowed in keys', {
639
+ toml: str,
640
+ ptr: ptr + dot + newLine,
641
+ });
642
+ }
643
+ if (strEnd.trimStart()) {
644
+ throw new TomlError('found extra tokens after the string part', {
645
+ toml: str,
646
+ ptr: eos,
647
+ });
648
+ }
649
+ if (endPtr < eos) {
650
+ endPtr = str.indexOf(end, eos);
651
+ if (endPtr < 0) {
652
+ throw new TomlError('incomplete key-value: cannot find end of key', {
653
+ toml: str,
654
+ ptr: ptr,
655
+ });
656
+ }
657
+ }
658
+ parsed.push(parseString(str, ptr, eos));
659
+ }
660
+ else {
661
+ // Normal raw key part consumption and validation
662
+ dot = str.indexOf('.', ptr);
663
+ let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
664
+ if (!KEY_PART_RE.test(part)) {
665
+ throw new TomlError('only letter, numbers, dashes and underscores are allowed in keys', {
666
+ toml: str,
667
+ ptr: ptr,
668
+ });
669
+ }
670
+ parsed.push(part.trimEnd());
671
+ }
672
+ }
673
+ // Until there's no more dot
674
+ } while (dot + 1 && dot < endPtr);
675
+ return [parsed, skipVoid(str, endPtr + 1, true, true)];
676
+ }
677
+ function parseInlineTable(str, ptr, depth, integersAsBigInt) {
678
+ let res = {};
679
+ let seen = new Set();
680
+ let c;
681
+ ptr++;
682
+ while ((c = str[ptr++]) !== '}' && c) {
683
+ if (c === ',') {
684
+ throw new TomlError('expected value, found comma', {
685
+ toml: str,
686
+ ptr: ptr - 1,
687
+ });
688
+ }
689
+ else if (c === '#')
690
+ ptr = skipComment(str, ptr);
691
+ else if (c !== ' ' && c !== '\t' && c !== '\n' && c !== '\r') {
692
+ let k;
693
+ let t = res;
694
+ let hasOwn = false;
695
+ let [key, keyEndPtr] = parseKey(str, ptr - 1);
696
+ for (let i = 0; i < key.length; i++) {
697
+ if (i)
698
+ t = hasOwn ? t[k] : (t[k] = {});
699
+ k = key[i];
700
+ if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {
701
+ throw new TomlError('trying to redefine an already defined value', {
702
+ toml: str,
703
+ ptr: ptr,
704
+ });
705
+ }
706
+ if (!hasOwn && k === '__proto__') {
707
+ Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
708
+ }
709
+ }
710
+ if (hasOwn) {
711
+ throw new TomlError('trying to redefine an already defined value', {
712
+ toml: str,
713
+ ptr: ptr,
714
+ });
715
+ }
716
+ let [value, valueEndPtr] = extractValue(str, keyEndPtr, '}', depth - 1, integersAsBigInt);
717
+ seen.add(value);
718
+ t[k] = value;
719
+ ptr = valueEndPtr;
720
+ }
721
+ }
722
+ if (!c) {
723
+ throw new TomlError('unfinished table encountered', {
724
+ toml: str,
725
+ ptr: ptr,
726
+ });
727
+ }
728
+ return [res, ptr];
729
+ }
730
+ function parseArray(str, ptr, depth, integersAsBigInt) {
731
+ let res = [];
732
+ let c;
733
+ ptr++;
734
+ while ((c = str[ptr++]) !== ']' && c) {
735
+ if (c === ',') {
736
+ throw new TomlError('expected value, found comma', {
737
+ toml: str,
738
+ ptr: ptr - 1,
739
+ });
740
+ }
741
+ else if (c === '#')
742
+ ptr = skipComment(str, ptr);
743
+ else if (c !== ' ' && c !== '\t' && c !== '\n' && c !== '\r') {
744
+ let e = extractValue(str, ptr - 1, ']', depth - 1, integersAsBigInt);
745
+ res.push(e[0]);
746
+ ptr = e[1];
747
+ }
748
+ }
749
+ if (!c) {
750
+ throw new TomlError('unfinished array encountered', {
751
+ toml: str,
752
+ ptr: ptr,
753
+ });
754
+ }
755
+ return [res, ptr];
756
+ }
757
+
758
+ /*!
759
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
760
+ * SPDX-License-Identifier: BSD-3-Clause
761
+ *
762
+ * Redistribution and use in source and binary forms, with or without
763
+ * modification, are permitted provided that the following conditions are met:
764
+ *
765
+ * 1. Redistributions of source code must retain the above copyright notice, this
766
+ * list of conditions and the following disclaimer.
767
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
768
+ * this list of conditions and the following disclaimer in the
769
+ * documentation and/or other materials provided with the distribution.
770
+ * 3. Neither the name of the copyright holder nor the names of its contributors
771
+ * may be used to endorse or promote products derived from this software without
772
+ * specific prior written permission.
773
+ *
774
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
775
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
776
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
777
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
778
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
779
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
780
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
781
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
782
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
783
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
784
+ */
785
+ function peekTable(key, table, meta, type) {
786
+ let t = table;
787
+ let m = meta;
788
+ let k;
789
+ let hasOwn = false;
790
+ let state;
791
+ for (let i = 0; i < key.length; i++) {
792
+ if (i) {
793
+ t = hasOwn ? t[k] : (t[k] = {});
794
+ m = (state = m[k]).c;
795
+ if (type === 0 /* Type.DOTTED */ && (state.t === 1 /* Type.EXPLICIT */ || state.t === 2 /* Type.ARRAY */)) {
796
+ return null;
797
+ }
798
+ if (state.t === 2 /* Type.ARRAY */) {
799
+ let l = t.length - 1;
800
+ t = t[l];
801
+ m = m[l].c;
802
+ }
803
+ }
804
+ k = key[i];
805
+ if ((hasOwn = Object.hasOwn(t, k)) && m[k]?.t === 0 /* Type.DOTTED */ && m[k]?.d) {
806
+ return null;
807
+ }
808
+ if (!hasOwn) {
809
+ if (k === '__proto__') {
810
+ Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
811
+ Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true });
812
+ }
813
+ m[k] = {
814
+ t: i < key.length - 1 && type === 2 /* Type.ARRAY */
815
+ ? 3 /* Type.ARRAY_DOTTED */
816
+ : type,
817
+ d: false,
818
+ i: 0,
819
+ c: {},
820
+ };
821
+ }
822
+ }
823
+ state = m[k];
824
+ if (state.t !== type && !(type === 1 /* Type.EXPLICIT */ && state.t === 3 /* Type.ARRAY_DOTTED */)) {
825
+ // Bad key type!
826
+ return null;
827
+ }
828
+ if (type === 2 /* Type.ARRAY */) {
829
+ if (!state.d) {
830
+ state.d = true;
831
+ t[k] = [];
832
+ }
833
+ t[k].push(t = {});
834
+ state.c[state.i++] = (state = { t: 1 /* Type.EXPLICIT */, d: false, i: 0, c: {} });
835
+ }
836
+ if (state.d) {
837
+ // Redefining a table!
838
+ return null;
839
+ }
840
+ state.d = true;
841
+ if (type === 1 /* Type.EXPLICIT */) {
842
+ t = hasOwn ? t[k] : (t[k] = {});
843
+ }
844
+ else if (type === 0 /* Type.DOTTED */ && hasOwn) {
845
+ return null;
846
+ }
847
+ return [k, t, state.c];
848
+ }
849
+ function parse(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
850
+ let res = {};
851
+ let meta = {};
852
+ let tbl = res;
853
+ let m = meta;
854
+ for (let ptr = skipVoid(toml, 0); ptr < toml.length;) {
855
+ if (toml[ptr] === '[') {
856
+ let isTableArray = toml[++ptr] === '[';
857
+ let k = parseKey(toml, ptr += +isTableArray, ']');
858
+ if (isTableArray) {
859
+ if (toml[k[1] - 1] !== ']') {
860
+ throw new TomlError('expected end of table declaration', {
861
+ toml: toml,
862
+ ptr: k[1] - 1,
863
+ });
864
+ }
865
+ k[1]++;
866
+ }
867
+ let p = peekTable(k[0], res, meta, isTableArray ? 2 /* Type.ARRAY */ : 1 /* Type.EXPLICIT */);
868
+ if (!p) {
869
+ throw new TomlError('trying to redefine an already defined table or value', {
870
+ toml: toml,
871
+ ptr: ptr,
872
+ });
873
+ }
874
+ m = p[2];
875
+ tbl = p[1];
876
+ ptr = k[1];
877
+ }
878
+ else {
879
+ let k = parseKey(toml, ptr);
880
+ let p = peekTable(k[0], tbl, m, 0 /* Type.DOTTED */);
881
+ if (!p) {
882
+ throw new TomlError('trying to redefine an already defined table or value', {
883
+ toml: toml,
884
+ ptr: ptr,
885
+ });
886
+ }
887
+ let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt);
888
+ p[1][p[0]] = v[0];
889
+ ptr = v[1];
890
+ }
891
+ ptr = skipVoid(toml, ptr, true);
892
+ if (toml[ptr] && toml[ptr] !== '\n' && toml[ptr] !== '\r') {
893
+ throw new TomlError('each key-value declaration must be followed by an end-of-line', {
894
+ toml: toml,
895
+ ptr: ptr
896
+ });
897
+ }
898
+ ptr = skipVoid(toml, ptr);
899
+ }
900
+ return res;
901
+ }
902
+
903
+ /*!
904
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
905
+ * SPDX-License-Identifier: BSD-3-Clause
906
+ *
907
+ * Redistribution and use in source and binary forms, with or without
908
+ * modification, are permitted provided that the following conditions are met:
909
+ *
910
+ * 1. Redistributions of source code must retain the above copyright notice, this
911
+ * list of conditions and the following disclaimer.
912
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
913
+ * this list of conditions and the following disclaimer in the
914
+ * documentation and/or other materials provided with the distribution.
915
+ * 3. Neither the name of the copyright holder nor the names of its contributors
916
+ * may be used to endorse or promote products derived from this software without
917
+ * specific prior written permission.
918
+ *
919
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
920
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
921
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
922
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
923
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
924
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
925
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
926
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
927
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
928
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
929
+ */
930
+ let BARE_KEY = /^[a-z0-9-_]+$/i;
931
+ function extendedTypeOf(obj) {
932
+ let type = typeof obj;
933
+ if (type === 'object') {
934
+ if (Array.isArray(obj))
935
+ return 'array';
936
+ if (obj instanceof Date)
937
+ return 'date';
938
+ }
939
+ return type;
940
+ }
941
+ function isArrayOfTables(obj) {
942
+ for (let i = 0; i < obj.length; i++) {
943
+ if (extendedTypeOf(obj[i]) !== 'object')
944
+ return false;
945
+ }
946
+ return obj.length != 0;
947
+ }
948
+ function formatString(s) {
949
+ return JSON.stringify(s).replace(/\x7f/g, '\\u007f');
950
+ }
951
+ function stringifyValue(val, type, depth, numberAsFloat) {
952
+ if (depth === 0) {
953
+ throw new Error('Could not stringify the object: maximum object depth exceeded');
954
+ }
955
+ if (type === 'number') {
956
+ if (isNaN(val))
957
+ return 'nan';
958
+ if (val === Infinity)
959
+ return 'inf';
960
+ if (val === -Infinity)
961
+ return '-inf';
962
+ if (numberAsFloat && Number.isInteger(val))
963
+ return val.toFixed(1);
964
+ return val.toString();
965
+ }
966
+ if (type === 'bigint' || type === 'boolean') {
967
+ return val.toString();
968
+ }
969
+ if (type === 'string') {
970
+ return formatString(val);
971
+ }
972
+ if (type === 'date') {
973
+ if (isNaN(val.getTime())) {
974
+ throw new TypeError('cannot serialize invalid date');
975
+ }
976
+ return val.toISOString();
977
+ }
978
+ if (type === 'object') {
979
+ return stringifyInlineTable(val, depth, numberAsFloat);
980
+ }
981
+ if (type === 'array') {
982
+ return stringifyArray(val, depth, numberAsFloat);
983
+ }
984
+ }
985
+ function stringifyInlineTable(obj, depth, numberAsFloat) {
986
+ let keys = Object.keys(obj);
987
+ if (keys.length === 0)
988
+ return '{}';
989
+ let res = '{ ';
990
+ for (let i = 0; i < keys.length; i++) {
991
+ let k = keys[i];
992
+ if (i)
993
+ res += ', ';
994
+ res += BARE_KEY.test(k) ? k : formatString(k);
995
+ res += ' = ';
996
+ res += stringifyValue(obj[k], extendedTypeOf(obj[k]), depth - 1, numberAsFloat);
997
+ }
998
+ return res + ' }';
999
+ }
1000
+ function stringifyArray(array, depth, numberAsFloat) {
1001
+ if (array.length === 0)
1002
+ return '[]';
1003
+ let res = '[ ';
1004
+ for (let i = 0; i < array.length; i++) {
1005
+ if (i)
1006
+ res += ', ';
1007
+ if (array[i] === null || array[i] === void 0) {
1008
+ throw new TypeError('arrays cannot contain null or undefined values');
1009
+ }
1010
+ res += stringifyValue(array[i], extendedTypeOf(array[i]), depth - 1, numberAsFloat);
1011
+ }
1012
+ return res + ' ]';
1013
+ }
1014
+ function stringifyArrayTable(array, key, depth, numberAsFloat) {
1015
+ if (depth === 0) {
1016
+ throw new Error('Could not stringify the object: maximum object depth exceeded');
1017
+ }
1018
+ let res = '';
1019
+ for (let i = 0; i < array.length; i++) {
1020
+ res += `${res && '\n'}[[${key}]]\n`;
1021
+ res += stringifyTable(0, array[i], key, depth, numberAsFloat);
1022
+ }
1023
+ return res;
1024
+ }
1025
+ function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat) {
1026
+ if (depth === 0) {
1027
+ throw new Error('Could not stringify the object: maximum object depth exceeded');
1028
+ }
1029
+ let preamble = '';
1030
+ let tables = '';
1031
+ let keys = Object.keys(obj);
1032
+ for (let i = 0; i < keys.length; i++) {
1033
+ let k = keys[i];
1034
+ if (obj[k] !== null && obj[k] !== void 0) {
1035
+ let type = extendedTypeOf(obj[k]);
1036
+ if (type === 'symbol' || type === 'function') {
1037
+ throw new TypeError(`cannot serialize values of type '${type}'`);
1038
+ }
1039
+ let key = BARE_KEY.test(k) ? k : formatString(k);
1040
+ if (type === 'array' && isArrayOfTables(obj[k])) {
1041
+ tables += (tables && '\n') + stringifyArrayTable(obj[k], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);
1042
+ }
1043
+ else if (type === 'object') {
1044
+ let tblKey = prefix ? `${prefix}.${key}` : key;
1045
+ tables += (tables && '\n') + stringifyTable(tblKey, obj[k], tblKey, depth - 1, numberAsFloat);
1046
+ }
1047
+ else {
1048
+ preamble += key;
1049
+ preamble += ' = ';
1050
+ preamble += stringifyValue(obj[k], type, depth, numberAsFloat);
1051
+ preamble += '\n';
1052
+ }
1053
+ }
1054
+ }
1055
+ if (tableKey && (preamble || !tables)) // Create table only if necessary
1056
+ preamble = preamble ? `[${tableKey}]\n${preamble}` : `[${tableKey}]`;
1057
+ return preamble && tables
1058
+ ? `${preamble}\n${tables}`
1059
+ : preamble || tables;
1060
+ }
1061
+ function stringify(obj, { maxDepth = 1000, numbersAsFloat = false } = {}) {
1062
+ if (extendedTypeOf(obj) !== 'object') {
1063
+ throw new TypeError('stringify can only be called with an object');
1064
+ }
1065
+ let str = stringifyTable(0, obj, '', maxDepth, numbersAsFloat);
1066
+ if (str[str.length - 1] !== '\n')
1067
+ return str + '\n';
1068
+ return str;
1069
+ }
1070
+
5
1071
  /**
6
1072
  * corva-ui-mcp-setup CLI
7
1073
  *
@@ -12,53 +1078,79 @@ const SERVER_CONFIG = {
12
1078
  command: 'npx',
13
1079
  args: ['-p', '@corva/ui', 'corva-ui-mcp'],
14
1080
  };
15
- const TARGET_FILES = ['.cursor/mcp.json', '.mcp.json'];
16
- const writeConfig = (filePath) => {
1081
+ const JSON_FORMAT = {
1082
+ formatName: 'JSON',
1083
+ serversKey: 'mcpServers',
1084
+ serverName: 'corva-ui',
1085
+ parse: raw => JSON.parse(raw),
1086
+ serialize: data => JSON.stringify(data, null, 2),
1087
+ };
1088
+ const TOML_FORMAT = {
1089
+ formatName: 'TOML',
1090
+ serversKey: 'mcp_servers',
1091
+ serverName: 'corva_ui',
1092
+ parse: raw => parse(raw),
1093
+ serialize: data => stringify(data),
1094
+ };
1095
+ const TARGETS = [
1096
+ { path: '.cursor/mcp.json', format: JSON_FORMAT },
1097
+ { path: '.mcp.json', format: JSON_FORMAT },
1098
+ { path: '.codex/config.toml', format: TOML_FORMAT },
1099
+ ];
1100
+ const ACTION_SYMBOLS = {
1101
+ created: '+',
1102
+ updated: '~',
1103
+ skipped: '=',
1104
+ };
1105
+ const isRecord = (value) => typeof value === 'object' && value !== null;
1106
+ const writeConfig = ({ path: filePath, format }) => {
17
1107
  const absolutePath = resolve(filePath);
18
- const dir = dirname(absolutePath);
19
- mkdirSync(dir, { recursive: true });
1108
+ mkdirSync(dirname(absolutePath), { recursive: true });
20
1109
  let existing = {};
21
1110
  let action = 'created';
22
1111
  if (existsSync(absolutePath)) {
23
1112
  action = 'updated';
24
1113
  const raw = readFileSync(absolutePath, 'utf-8');
25
1114
  try {
26
- existing = JSON.parse(raw);
1115
+ existing = format.parse(raw);
27
1116
  }
28
1117
  catch {
29
- console.warn(` Warning: ${filePath} contained invalid JSON and will be overwritten.`);
1118
+ console.warn(` Warning: ${filePath} contained invalid ${format.formatName} and will be overwritten.`);
30
1119
  existing = {};
31
1120
  action = 'created';
32
1121
  }
33
1122
  }
34
- const mcpServers = existing.mcpServers && typeof existing.mcpServers === 'object'
35
- ? existing.mcpServers
1123
+ const servers = isRecord(existing[format.serversKey])
1124
+ ? existing[format.serversKey]
36
1125
  : {};
1126
+ if (JSON.stringify(servers[format.serverName]) === JSON.stringify(SERVER_CONFIG)) {
1127
+ return { file: filePath, action: 'skipped' };
1128
+ }
37
1129
  const merged = {
38
1130
  ...existing,
39
- mcpServers: {
40
- ...mcpServers,
41
- 'corva-ui': SERVER_CONFIG,
1131
+ [format.serversKey]: {
1132
+ ...servers,
1133
+ [format.serverName]: SERVER_CONFIG,
42
1134
  },
43
1135
  };
44
- writeFileSync(absolutePath, JSON.stringify(merged, null, 2) + '\n');
1136
+ writeFileSync(absolutePath, `${format.serialize(merged)}\n`);
45
1137
  return { file: filePath, action };
46
1138
  };
47
1139
  const main = () => {
48
1140
  console.log('Setting up @corva/ui MCP server configs...\n');
49
1141
  const results = [];
50
- for (const file of TARGET_FILES) {
1142
+ for (const target of TARGETS) {
51
1143
  try {
52
- results.push(writeConfig(file));
1144
+ results.push(writeConfig(target));
53
1145
  }
54
1146
  catch (error) {
55
1147
  const message = error instanceof Error ? error.message : String(error);
56
- console.error(` Error writing ${file}: ${message}`);
1148
+ console.error(` Error writing ${target.path}: ${message}`);
57
1149
  }
58
1150
  }
59
1151
  console.log('');
60
1152
  for (const { file, action } of results) {
61
- console.log(` ${action === 'created' ? '+' : '~'} ${file} (${action})`);
1153
+ console.log(` ${ACTION_SYMBOLS[action]} ${file} (${action})`);
62
1154
  }
63
1155
  console.log('\nDone! The corva-ui MCP server is now configured for this project.');
64
1156
  };