@corva/ui 3.75.0-13 → 3.75.0-15

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 (228) hide show
  1. package/cjs-bundle/components/AddComment/Popover.js +1 -1
  2. package/cjs-bundle/components/AddComment/Popover.js.map +1 -1
  3. package/cjs-bundle/components/AddComment/components/Content.js +1 -1
  4. package/cjs-bundle/components/AddComment/components/Content.js.map +1 -1
  5. package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js +1 -1
  6. package/cjs-bundle/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
  7. package/cjs-bundle/components/BICOffsetPickerDialog/components/Map/Map.js +1 -1
  8. package/cjs-bundle/components/BICOffsetPickerDialog/components/Map/Map.js.map +1 -1
  9. package/cjs-bundle/components/BICOffsetPickerDialog/index.js +1 -1
  10. package/cjs-bundle/components/BICOffsetPickerDialog/index.js.map +1 -1
  11. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  12. package/cjs-bundle/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  13. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js +1 -1
  14. package/cjs-bundle/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  15. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  16. package/cjs-bundle/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  17. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js +1 -1
  18. package/cjs-bundle/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  19. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js +1 -1
  20. package/cjs-bundle/components/DocumentViewer/DocumentViewer.js.map +1 -1
  21. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  22. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  23. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  24. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  25. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  26. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  27. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  28. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  29. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  30. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  31. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  32. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  33. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  34. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  35. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  36. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  37. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  38. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  39. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  40. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  41. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  42. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  43. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  44. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  45. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  46. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  47. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  48. package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  49. package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js +1 -1
  50. package/cjs-bundle/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
  51. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  52. package/cjs-bundle/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  53. package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.js +1 -1
  54. package/cjs-bundle/components/OffsetWellPickerV2/components/Map/Map.js.map +1 -1
  55. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  56. package/cjs-bundle/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  57. package/cjs-bundle/components/OffsetWellPickerV2/effects/index.js +1 -1
  58. package/cjs-bundle/components/OffsetWellPickerV2/effects/index.js.map +1 -1
  59. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js +1 -1
  60. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js.map +1 -1
  61. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  62. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  63. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js +1 -1
  64. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js.map +1 -1
  65. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  66. package/cjs-bundle/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  67. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  68. package/cjs-bundle/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  69. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  70. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  71. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  72. package/cjs-bundle/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  73. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  74. package/cjs-bundle/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  75. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  76. package/cjs-bundle/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  77. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  78. package/cjs-bundle/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  79. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js +1 -1
  80. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js.map +1 -1
  81. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js +1 -1
  82. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js.map +1 -1
  83. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js +1 -1
  84. package/cjs-bundle/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js.map +1 -1
  85. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  86. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  87. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
  88. package/cjs-bundle/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js.map +1 -1
  89. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js +1 -1
  90. package/cjs-bundle/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js.map +1 -1
  91. package/cjs-bundle/components/OffsetWellPickerV5/utils/getCoordinatedWells.js +1 -1
  92. package/cjs-bundle/components/OffsetWellPickerV5/utils/getCoordinatedWells.js.map +1 -1
  93. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js +1 -1
  94. package/cjs-bundle/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  95. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  96. package/cjs-bundle/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  97. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js +1 -1
  98. package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js.map +1 -1
  99. package/cjs-bundle/effects/useSignedURL.js +1 -1
  100. package/cjs-bundle/effects/useSignedURL.js.map +1 -1
  101. package/cjs-bundle/utils/signedLinkCache.js +2 -0
  102. package/cjs-bundle/utils/signedLinkCache.js.map +1 -0
  103. package/components/AddComment/Popover.js +1 -1
  104. package/components/AddComment/Popover.js.map +1 -1
  105. package/components/AddComment/components/Content.js +1 -1
  106. package/components/AddComment/components/Content.js.map +1 -1
  107. package/components/AttachmentPreview/useStoredAttachments.d.ts.map +1 -1
  108. package/components/AttachmentPreview/useStoredAttachments.js +1 -1
  109. package/components/AttachmentPreview/useStoredAttachments.js.map +1 -1
  110. package/components/BICOffsetPickerDialog/components/Map/Map.d.ts.map +1 -1
  111. package/components/BICOffsetPickerDialog/components/Map/Map.js +1 -1
  112. package/components/BICOffsetPickerDialog/components/Map/Map.js.map +1 -1
  113. package/components/BICOffsetPickerDialog/index.js +1 -1
  114. package/components/BICOffsetPickerDialog/index.js.map +1 -1
  115. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js +1 -1
  116. package/components/Casing/CasingTableV2/components/CasingJoints/Editor.js.map +1 -1
  117. package/components/Casing/CasingTableV2/components/Component.js +1 -1
  118. package/components/Casing/CasingTableV2/components/Component.js.map +1 -1
  119. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js +1 -1
  120. package/components/Casing/CasingTableV2/components/DrillPipe/Editor.js.map +1 -1
  121. package/components/CommentComposer/useAttachmentUpload.d.ts.map +1 -1
  122. package/components/CommentComposer/useAttachmentUpload.js +1 -1
  123. package/components/CommentComposer/useAttachmentUpload.js.map +1 -1
  124. package/components/DocumentViewer/DocumentViewer.js +1 -1
  125. package/components/DocumentViewer/DocumentViewer.js.map +1 -1
  126. package/components/Drillstring/BHAComponentDetail/constants.d.ts +2 -2
  127. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js +1 -1
  128. package/components/Drillstring/BHAComponentsTable/components/Agitator/Editor.js.map +1 -1
  129. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js +1 -1
  130. package/components/Drillstring/BHAComponentsTable/components/Bit/Editor.js.map +1 -1
  131. package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
  132. package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
  133. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js +1 -1
  134. package/components/Drillstring/BHAComponentsTable/components/DrillCollar/Editor.js.map +1 -1
  135. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js +1 -1
  136. package/components/Drillstring/BHAComponentsTable/components/DrillPipe/Editor.js.map +1 -1
  137. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js +1 -1
  138. package/components/Drillstring/BHAComponentsTable/components/Jar/Editor.js.map +1 -1
  139. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js +1 -1
  140. package/components/Drillstring/BHAComponentsTable/components/Lwd/Editor.js.map +1 -1
  141. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js +1 -1
  142. package/components/Drillstring/BHAComponentsTable/components/Mwd/Editor.js.map +1 -1
  143. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js +1 -1
  144. package/components/Drillstring/BHAComponentsTable/components/Pdm/Editor.js.map +1 -1
  145. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js +1 -1
  146. package/components/Drillstring/BHAComponentsTable/components/Rss/Editor.js.map +1 -1
  147. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js +1 -1
  148. package/components/Drillstring/BHAComponentsTable/components/Stabilizer/Editor.js.map +1 -1
  149. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js +1 -1
  150. package/components/Drillstring/BHAComponentsTable/components/Sub/Editor.js.map +1 -1
  151. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js +1 -1
  152. package/components/Drillstring/BHAComponentsTable/components/Ur/Editor.js.map +1 -1
  153. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js +1 -1
  154. package/components/Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js.map +1 -1
  155. package/components/OffsetWellMap/OffsetWellMap.d.ts.map +1 -1
  156. package/components/OffsetWellMap/OffsetWellMap.js +1 -1
  157. package/components/OffsetWellMap/OffsetWellMap.js.map +1 -1
  158. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js +1 -1
  159. package/components/OffsetWellPickerV2/components/Filter/ToggleMapButton.js.map +1 -1
  160. package/components/OffsetWellPickerV2/components/Map/Map.d.ts.map +1 -1
  161. package/components/OffsetWellPickerV2/components/Map/Map.js +1 -1
  162. package/components/OffsetWellPickerV2/components/Map/Map.js.map +1 -1
  163. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js +1 -1
  164. package/components/OffsetWellPickerV2/components/Table/MetricsAddMenu.js.map +1 -1
  165. package/components/OffsetWellPickerV2/effects/index.d.ts.map +1 -1
  166. package/components/OffsetWellPickerV2/effects/index.js +1 -1
  167. package/components/OffsetWellPickerV2/effects/index.js.map +1 -1
  168. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.d.ts.map +1 -1
  169. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js +1 -1
  170. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Map/Map.js.map +1 -1
  171. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js +1 -1
  172. package/components/OffsetWellPickerV3/components/CustomSelectionView/components/Table/MetricsAddMenu.js.map +1 -1
  173. package/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.d.ts.map +1 -1
  174. package/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js +1 -1
  175. package/components/OffsetWellPickerV3/components/CustomSelectionView/effects/index.js.map +1 -1
  176. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js +1 -1
  177. package/components/OffsetWellPickerV3/components/CustomSelectionView/index.js.map +1 -1
  178. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js +1 -1
  179. package/components/OffsetWellPickerV3/components/OffsetWellSelectionView/index.js.map +1 -1
  180. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js +1 -1
  181. package/components/OffsetWellPickerV3/components/TabSelection/ToggleMapButton.js.map +1 -1
  182. package/components/OffsetWellPickerV3/components/TabSelection/index.js +1 -1
  183. package/components/OffsetWellPickerV3/components/TabSelection/index.js.map +1 -1
  184. package/components/OffsetWellPickerV3/components/WellHubView/index.js +1 -1
  185. package/components/OffsetWellPickerV3/components/WellHubView/index.js.map +1 -1
  186. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js +1 -1
  187. package/components/OffsetWellPickerV3/components/shared/OffsetWellTableHead.js.map +1 -1
  188. package/components/OffsetWellPickerV4/effects/useAdvancedWells.d.ts.map +1 -1
  189. package/components/OffsetWellPickerV4/utils/index.d.ts.map +1 -1
  190. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js +1 -1
  191. package/components/OffsetWellPickerV5/components/Filter/components/CustomDateFields/CustomDateFields.js.map +1 -1
  192. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js +1 -1
  193. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useMapTooltipState.js.map +1 -1
  194. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js +1 -1
  195. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/useSelectionToolOrchestration.js.map +1 -1
  196. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.d.ts.map +1 -1
  197. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js +1 -1
  198. package/components/OffsetWellPickerV5/components/Map/OffsetWellMap/hooks/utils/well-markers-utils.js.map +1 -1
  199. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js +1 -1
  200. package/components/OffsetWellPickerV5/components/OffsetWellPickerContent/OffsetWellPickerContent.js.map +1 -1
  201. package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js +1 -1
  202. package/components/OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/components/CompanySafeguardWrapper/CompanySafeguardWrapper.js.map +1 -1
  203. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.d.ts.map +1 -1
  204. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js +1 -1
  205. package/components/OffsetWellPickerV5/hooks/use-well-data-pipeline/wellTransformations.js.map +1 -1
  206. package/components/OffsetWellPickerV5/utils/getCoordinatedWells.d.ts.map +1 -1
  207. package/components/OffsetWellPickerV5/utils/getCoordinatedWells.js +1 -1
  208. package/components/OffsetWellPickerV5/utils/getCoordinatedWells.js.map +1 -1
  209. package/components/PadOffsetsPicker/StagesSelector.js +1 -1
  210. package/components/PadOffsetsPicker/StagesSelector.js.map +1 -1
  211. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js +1 -1
  212. package/components/PadOffsetsPickerV2/PadOffsetsPickerV2.js.map +1 -1
  213. package/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.d.ts.map +1 -1
  214. package/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js +1 -1
  215. package/componentsV2/CompletionsOffsetWellPicker/hooks/usePadsByRadius.js.map +1 -1
  216. package/effects/useSignedURL.d.ts +1 -1
  217. package/effects/useSignedURL.d.ts.map +1 -1
  218. package/effects/useSignedURL.js +1 -1
  219. package/effects/useSignedURL.js.map +1 -1
  220. package/mcp-server/server.mjs +4 -4
  221. package/package.json +1 -1
  222. package/tsconfig.tsbuildinfo +1 -1
  223. package/utils/__tests__/signedLinkCache.test.d.ts +2 -0
  224. package/utils/__tests__/signedLinkCache.test.d.ts.map +1 -0
  225. package/utils/signedLinkCache.d.ts +9 -0
  226. package/utils/signedLinkCache.d.ts.map +1 -0
  227. package/utils/signedLinkCache.js +2 -0
  228. package/utils/signedLinkCache.js.map +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Component.js","sources":["../../../../../src/components/Casing/CasingTableV2/components/Component.js"],"sourcesContent":["import { memo, useEffect, useState } from 'react';\nimport classNames from 'classnames';\nimport { omit } from 'lodash';\nimport PropTypes from 'prop-types';\nimport { Grid, Menu, MenuItem } from '@material-ui/core';\n\nimport { Browser as DrillPipeBrowser, Editor as DrillPipeEditor } from './DrillPipe';\nimport { Browser as ComponentBrowser, Editor as ComponentEditor } from './CasingJoints';\nimport EditComponentDialog from './EditComponentDialog';\n\nimport { validateComponent } from '~/utils/casing/validation';\nimport { COMPONENT_FAMILIES } from '~/constants/casing';\nimport { CasingComponentIcon as ComponentIcon } from '~/components';\nimport {\n FormatedNumber,\n ExpandCollapseButton,\n MoreButton,\n StaticField,\n ConfirmationPopup,\n} from '~/components/Drillstring/BHAComponentsTable/components/shared';\nimport { calculateComponent } from '~/components/Drillstring/BHAComponentsTable/components/utils/calculation';\nimport { useStyles } from '~/components/Drillstring/BHAComponentsTable/components/sharedStyles';\n\nfunction getComponentName(family) {\n return COMPONENT_FAMILIES.find(item => item.type === family)?.name || '—';\n}\n\nfunction Component({\n component,\n viewColumnsPerRow,\n editColumnsPerRow,\n isDraft = false,\n onCancel = null,\n onDelete = null,\n onSave,\n onChangeEditing,\n isMobile,\n isDragComponent,\n}) {\n const [actionAnchorEl, setActionAnchorEl] = useState(null);\n const [tempComponent, setTempComponent] = useState(component);\n const [isOpenSaveConfirm, setIsOpenSaveConfirm] = useState(false);\n const [isOpenDeleteDialog, setIsOpenDeleteDialog] = useState(false);\n const [isOpenEditorDialog, setIsOpenEditorDialog] = useState(false);\n const [error, setError] = useState(null);\n\n const classes = useStyles({ isMobile, isEditing: tempComponent.is_editing, isDragComponent });\n\n useEffect(() => {\n if (onChangeEditing) onChangeEditing(tempComponent.is_editing);\n }, [tempComponent.is_editing]);\n\n const handleExpandCollapse = () => {\n setTempComponent(prev => {\n return prev.is_expanded ? { ...prev, is_expanded: false } : { ...prev, is_expanded: true };\n });\n };\n\n const handleOpenActionMenu = e => {\n setActionAnchorEl(e.currentTarget);\n };\n\n const handleCloseActionMenu = () => {\n setActionAnchorEl(null);\n };\n\n const handleEdit = () => {\n setActionAnchorEl(null);\n setTempComponent(prev => ({ ...prev, is_editing: true }));\n };\n\n const handleConfirmDelete = () => {\n setActionAnchorEl(null);\n setIsOpenDeleteDialog(true);\n };\n\n const handleDelete = () => {\n onDelete(component);\n };\n\n const handleCancel = () => {\n setError(null);\n if (isDraft) {\n onCancel();\n return;\n }\n\n setTempComponent(component);\n };\n\n const handleChange = (key, value) => {\n const newComponent = calculateComponent(tempComponent, key, value);\n const result = validateComponent(newComponent);\n setTempComponent(newComponent);\n if (!result.isValid) {\n setError(result.errors);\n } else {\n setError(null);\n }\n };\n\n const handleUseSuggestion = suggestion => {\n setTempComponent(prev => {\n return {\n ...prev,\n ...suggestion,\n };\n });\n };\n\n const handleConfirmSave = () => {\n const result = validateComponent(tempComponent);\n if (!result.isValid) {\n setError(result.errors);\n return;\n }\n\n setError(null);\n setIsOpenSaveConfirm(true);\n };\n\n const handleSave = () => {\n setIsOpenSaveConfirm(false);\n setIsOpenEditorDialog(false);\n\n const { is_editing, ...saving } = tempComponent;\n\n setTempComponent(saving);\n\n onSave(omit(saving, ['is_expanded']), isDraft);\n };\n\n const contentCellName = classNames(classes.cell, classes.ratioWidth, {\n [classes.focusedFontsize]: tempComponent.is_editing || tempComponent.is_expanded,\n });\n\n if (tempComponent.is_editing && !isOpenEditorDialog) {\n const { family } = tempComponent;\n\n const componentProps = {\n component: tempComponent,\n isDraft,\n error,\n onChange: handleChange,\n onCancel: handleCancel,\n onSave: isMobile ? handleSave : handleConfirmSave,\n onUseSuggestion: handleUseSuggestion,\n columns: editColumnsPerRow,\n };\n\n if (isMobile) {\n setIsOpenEditorDialog(true);\n } else {\n return (\n <div className={classes.component}>\n {(family === 'dp' || family === 'hwdp') && <DrillPipeEditor {...componentProps} />}\n {family !== 'dp' && family !== 'hwdp' && <ComponentEditor {...componentProps} />}\n\n {isOpenSaveConfirm && (\n <ConfirmationPopup\n title=\"Save Changes?\"\n text=\"You will not be able to recover it.\"\n okText=\"Save\"\n handleClose={() => setIsOpenSaveConfirm(false)}\n handleOk={handleSave}\n />\n )}\n </div>\n );\n }\n }\n\n return (\n <div\n className={classNames(classes.component, {\n [classes.componentMobile]: isMobile,\n [classes.componentExpandedMobile]: isMobile && tempComponent.is_expanded,\n [classes.componentActive]: Boolean(actionAnchorEl),\n })}\n >\n <div\n className={classNames(classes.row, {\n [classes.rowExpanded]: isMobile && tempComponent.is_expanded,\n })}\n >\n <div className={classNames(classes.cell, { [classes.componentMobileCell]: isMobile })}>\n <ComponentIcon component={tempComponent} />\n </div>\n <div className={contentCellName}>{getComponentName(tempComponent.family)}</div>\n {!isMobile && (\n <>\n <div className={contentCellName}>\n <FormatedNumber\n value={\n tempComponent.family === 'bit' ? tempComponent.size : tempComponent.outer_diameter\n }\n />\n </div>\n <div className={contentCellName}>\n <FormatedNumber value={tempComponent.inner_diameter} />\n </div>\n <div className={contentCellName}>\n <FormatedNumber value={tempComponent.linear_weight} />\n </div>\n <div className={contentCellName}>\n <FormatedNumber value={tempComponent.length} format=\"0.0\" />\n </div>\n </>\n )}\n <div className={classNames(classes.cell, classes.actionCell)}>\n <ExpandCollapseButton\n isExpanded={tempComponent.is_expanded}\n classes={classes}\n handleExpandCollapse={handleExpandCollapse}\n />\n <MoreButton classes={classes} handleOpenActionMenu={handleOpenActionMenu} />\n </div>\n </div>\n\n {tempComponent.is_expanded && (\n <>\n {isMobile && (\n <Grid container spacing={2} style={{ padding: '8px 4px 16px' }}>\n <StaticField\n label={tempComponent.family === 'bit' ? 'Bit Size' : 'OD'}\n unit=\"shortLength\"\n value={\n tempComponent.family === 'bit' ? tempComponent.size : tempComponent.outer_diameter\n }\n />\n {tempComponent.family !== 'bit' && (\n <StaticField label=\"ID\" unit=\"shortLength\" value={component.inner_diameter} />\n )}\n {tempComponent.family !== 'bit' && (\n <StaticField\n label=\"Linear Weight\"\n unit=\"massPerLength\"\n value={component.linear_weight}\n format=\"0.0\"\n />\n )}\n <StaticField label=\"Length\" unit=\"length\" value={component.length} format=\"0.0\" />\n </Grid>\n )}\n\n {(tempComponent.family === 'dp' || tempComponent.family === 'hwdp') && (\n <DrillPipeBrowser component={tempComponent} columns={viewColumnsPerRow} />\n )}\n {tempComponent.family !== 'dp' && tempComponent.family !== 'hwdp' && (\n <ComponentBrowser component={tempComponent} columns={viewColumnsPerRow} />\n )}\n </>\n )}\n\n <Menu\n anchorEl={actionAnchorEl}\n keepMounted\n open={Boolean(actionAnchorEl)}\n getContentAnchorEl={null}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n transformOrigin={{ vertical: 'top', horizontal: 'right' }}\n onClose={handleCloseActionMenu}\n >\n <MenuItem onClick={handleEdit} className={classes.menuItem}>\n Edit\n </MenuItem>\n {tempComponent.family !== 'bit' && (\n <MenuItem onClick={handleConfirmDelete} className={classes.menuItem}>\n Delete\n </MenuItem>\n )}\n </Menu>\n\n {isOpenDeleteDialog && (\n <ConfirmationPopup\n title=\"Delete Component?\"\n text=\"You will not be able to recover it.\"\n okText=\"Delete\"\n handleClose={() => setIsOpenDeleteDialog(false)}\n handleOk={handleDelete}\n />\n )}\n\n {isOpenEditorDialog && (\n <EditComponentDialog\n component={tempComponent}\n isDraft={isDraft}\n error={error}\n onChange={handleChange}\n onCancel={handleCancel}\n onSave={handleConfirmSave}\n onUseSuggestion={handleUseSuggestion}\n onClose={() => {\n handleCancel();\n setIsOpenEditorDialog(false);\n }}\n />\n )}\n\n {isMobile && isOpenSaveConfirm && (\n <ConfirmationPopup\n title=\"Save Changes?\"\n text=\"You will not be able to recover it.\"\n okText=\"Save\"\n handleClose={() => setIsOpenSaveConfirm(false)}\n handleOk={handleSave}\n />\n )}\n </div>\n );\n}\n\nComponent.propTypes = {\n component: PropTypes.shape({\n family: PropTypes.string,\n size: PropTypes.number,\n outer_diameter: PropTypes.number,\n inner_diameter: PropTypes.number,\n linear_weight: PropTypes.number,\n length: PropTypes.number,\n }).isRequired,\n isMobile: PropTypes.bool.isRequired,\n isDraft: PropTypes.bool,\n onCancel: PropTypes.func,\n onDelete: PropTypes.func,\n onSave: PropTypes.func.isRequired,\n onChangeEditing: PropTypes.func,\n viewColumnsPerRow: PropTypes.number.isRequired,\n editColumnsPerRow: PropTypes.number.isRequired,\n isDragComponent: PropTypes.bool.isRequired,\n};\n\nexport default memo(Component);\n"],"names":["getComponentName","family","_COMPONENT_FAMILIES$f","COMPONENT_FAMILIES","find","item","type","name","Component","_ref","_classNames2","component","viewColumnsPerRow","editColumnsPerRow","_ref$isDraft","isDraft","_ref$onCancel","onCancel","_ref$onDelete","onDelete","onSave","onChangeEditing","isMobile","isDragComponent","useState","_useState2","_slicedToArray","_useState","actionAnchorEl","setActionAnchorEl","_useState4","_useState3","tempComponent","setTempComponent","_useState6","_useState5","isOpenSaveConfirm","setIsOpenSaveConfirm","_useState8","_useState7","isOpenDeleteDialog","setIsOpenDeleteDialog","_useState10","_useState9","isOpenEditorDialog","setIsOpenEditorDialog","_useState12","_useState11","error","setError","classes","useStyles","isEditing","is_editing","useEffect","handleCancel","handleChange","key","value","newComponent","calculateComponent","result","validateComponent","isValid","errors","handleUseSuggestion","suggestion","prev","handleConfirmSave","handleSave","saving","_excluded","omit","contentCellName","classNames","cell","ratioWidth","focusedFontsize","is_expanded","componentProps","onChange","onUseSuggestion","columns","_jsxs","className","children","_jsx","DrillPipeEditor","ComponentEditor","ConfirmationPopup","title","text","okText","handleClose","handleOk","componentMobile","componentExpandedMobile","componentActive","Boolean","row","rowExpanded","componentMobileCell","ComponentIcon","_Fragment","FormatedNumber","size","outer_diameter","inner_diameter","linear_weight","length","format","actionCell","ExpandCollapseButton","isExpanded","handleExpandCollapse","_objectSpread","MoreButton","handleOpenActionMenu","e","currentTarget","Grid","container","spacing","style","padding","StaticField","label","unit","DrillPipeBrowser","ComponentBrowser","Menu","anchorEl","keepMounted","open","getContentAnchorEl","anchorOrigin","vertical","horizontal","transformOrigin","onClose","MenuItem","onClick","menuItem","EditComponentDialog","propTypes","PropTypes","shape","string","number","isRequired","bool","func","memo"],"mappings":"2w/BAuB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0H,EAAUK,KAAKD,YAGlC,IAAeG,EAAAA,EAAKhJ"}
1
+ {"version":3,"file":"Component.js","sources":["../../../../../src/components/Casing/CasingTableV2/components/Component.js"],"sourcesContent":["import { memo, useEffect, useState } from 'react';\nimport classNames from 'classnames';\nimport { omit } from 'lodash';\nimport PropTypes from 'prop-types';\nimport { Grid, Menu, MenuItem } from '@material-ui/core';\n\nimport { Browser as DrillPipeBrowser, Editor as DrillPipeEditor } from './DrillPipe';\nimport { Browser as ComponentBrowser, Editor as ComponentEditor } from './CasingJoints';\nimport EditComponentDialog from './EditComponentDialog';\n\nimport { validateComponent } from '~/utils/casing/validation';\nimport { COMPONENT_FAMILIES } from '~/constants/casing';\nimport { CasingComponentIcon as ComponentIcon } from '~/components';\nimport {\n FormatedNumber,\n ExpandCollapseButton,\n MoreButton,\n StaticField,\n ConfirmationPopup,\n} from '~/components/Drillstring/BHAComponentsTable/components/shared';\nimport { calculateComponent } from '~/components/Drillstring/BHAComponentsTable/components/utils/calculation';\nimport { useStyles } from '~/components/Drillstring/BHAComponentsTable/components/sharedStyles';\n\nfunction getComponentName(family) {\n return COMPONENT_FAMILIES.find(item => item.type === family)?.name || '—';\n}\n\nfunction Component({\n component,\n viewColumnsPerRow,\n editColumnsPerRow,\n isDraft = false,\n onCancel = null,\n onDelete = null,\n onSave,\n onChangeEditing,\n isMobile,\n isDragComponent,\n}) {\n const [actionAnchorEl, setActionAnchorEl] = useState(null);\n const [tempComponent, setTempComponent] = useState(component);\n const [isOpenSaveConfirm, setIsOpenSaveConfirm] = useState(false);\n const [isOpenDeleteDialog, setIsOpenDeleteDialog] = useState(false);\n const [isOpenEditorDialog, setIsOpenEditorDialog] = useState(false);\n const [error, setError] = useState(null);\n\n const classes = useStyles({ isMobile, isEditing: tempComponent.is_editing, isDragComponent });\n\n useEffect(() => {\n if (onChangeEditing) onChangeEditing(tempComponent.is_editing);\n }, [tempComponent.is_editing]);\n\n const handleExpandCollapse = () => {\n setTempComponent(prev => {\n return prev.is_expanded ? { ...prev, is_expanded: false } : { ...prev, is_expanded: true };\n });\n };\n\n const handleOpenActionMenu = e => {\n setActionAnchorEl(e.currentTarget);\n };\n\n const handleCloseActionMenu = () => {\n setActionAnchorEl(null);\n };\n\n const handleEdit = () => {\n setActionAnchorEl(null);\n setTempComponent(prev => ({ ...prev, is_editing: true }));\n };\n\n const handleConfirmDelete = () => {\n setActionAnchorEl(null);\n setIsOpenDeleteDialog(true);\n };\n\n const handleDelete = () => {\n onDelete(component);\n };\n\n const handleCancel = () => {\n setError(null);\n if (isDraft) {\n onCancel();\n return;\n }\n\n setTempComponent(component);\n };\n\n const handleChange = (key, value) => {\n const newComponent = calculateComponent(tempComponent, key, value);\n const result = validateComponent(newComponent);\n setTempComponent(newComponent);\n if (!result.isValid) {\n setError(result.errors);\n } else {\n setError(null);\n }\n };\n\n const handleUseSuggestion = suggestion => {\n setTempComponent(prev => {\n return {\n ...prev,\n ...suggestion,\n };\n });\n };\n\n const handleConfirmSave = () => {\n const result = validateComponent(tempComponent);\n if (!result.isValid) {\n setError(result.errors);\n return;\n }\n\n setError(null);\n setIsOpenSaveConfirm(true);\n };\n\n const handleSave = () => {\n setIsOpenSaveConfirm(false);\n setIsOpenEditorDialog(false);\n\n const { is_editing, ...saving } = tempComponent;\n\n setTempComponent(saving);\n\n onSave(omit(saving, ['is_expanded']), isDraft);\n };\n\n const contentCellName = classNames(classes.cell, classes.ratioWidth, {\n [classes.focusedFontsize]: tempComponent.is_editing || tempComponent.is_expanded,\n });\n\n if (tempComponent.is_editing && !isOpenEditorDialog) {\n const { family } = tempComponent;\n\n const componentProps = {\n component: tempComponent,\n isDraft,\n error,\n onChange: handleChange,\n onCancel: handleCancel,\n onSave: isMobile ? handleSave : handleConfirmSave,\n onUseSuggestion: handleUseSuggestion,\n columns: editColumnsPerRow,\n };\n\n if (isMobile) {\n setIsOpenEditorDialog(true);\n } else {\n return (\n <div className={classes.component}>\n {(family === 'dp' || family === 'hwdp') && <DrillPipeEditor {...componentProps} />}\n {family !== 'dp' && family !== 'hwdp' && <ComponentEditor {...componentProps} />}\n\n {isOpenSaveConfirm && (\n <ConfirmationPopup\n title=\"Save Changes?\"\n text=\"You will not be able to recover it.\"\n okText=\"Save\"\n handleClose={() => setIsOpenSaveConfirm(false)}\n handleOk={handleSave}\n />\n )}\n </div>\n );\n }\n }\n\n return (\n <div\n className={classNames(classes.component, {\n [classes.componentMobile]: isMobile,\n [classes.componentExpandedMobile]: isMobile && tempComponent.is_expanded,\n [classes.componentActive]: Boolean(actionAnchorEl),\n })}\n >\n <div\n className={classNames(classes.row, {\n [classes.rowExpanded]: isMobile && tempComponent.is_expanded,\n })}\n >\n <div className={classNames(classes.cell, { [classes.componentMobileCell]: isMobile })}>\n <ComponentIcon component={tempComponent} />\n </div>\n <div className={contentCellName}>{getComponentName(tempComponent.family)}</div>\n {!isMobile && (\n <>\n <div className={contentCellName}>\n <FormatedNumber\n value={\n tempComponent.family === 'bit' ? tempComponent.size : tempComponent.outer_diameter\n }\n />\n </div>\n <div className={contentCellName}>\n <FormatedNumber value={tempComponent.inner_diameter} />\n </div>\n <div className={contentCellName}>\n <FormatedNumber value={tempComponent.linear_weight} />\n </div>\n <div className={contentCellName}>\n <FormatedNumber value={tempComponent.length} format=\"0.0\" />\n </div>\n </>\n )}\n <div className={classNames(classes.cell, classes.actionCell)}>\n <ExpandCollapseButton\n isExpanded={tempComponent.is_expanded}\n classes={classes}\n handleExpandCollapse={handleExpandCollapse}\n />\n <MoreButton classes={classes} handleOpenActionMenu={handleOpenActionMenu} />\n </div>\n </div>\n\n {tempComponent.is_expanded && (\n <>\n {isMobile && (\n <Grid container spacing={2} style={{ padding: '8px 4px 16px' }}>\n <StaticField\n label={tempComponent.family === 'bit' ? 'Bit Size' : 'OD'}\n unit=\"shortLength\"\n value={\n tempComponent.family === 'bit' ? tempComponent.size : tempComponent.outer_diameter\n }\n />\n {tempComponent.family !== 'bit' && (\n <StaticField label=\"ID\" unit=\"shortLength\" value={component.inner_diameter} />\n )}\n {tempComponent.family !== 'bit' && (\n <StaticField\n label=\"Linear Weight\"\n unit=\"massPerLength\"\n value={component.linear_weight}\n format=\"0.0\"\n />\n )}\n <StaticField label=\"Length\" unit=\"length\" value={component.length} format=\"0.0\" />\n </Grid>\n )}\n\n {(tempComponent.family === 'dp' || tempComponent.family === 'hwdp') && (\n <DrillPipeBrowser component={tempComponent} columns={viewColumnsPerRow} />\n )}\n {tempComponent.family !== 'dp' && tempComponent.family !== 'hwdp' && (\n <ComponentBrowser component={tempComponent} columns={viewColumnsPerRow} />\n )}\n </>\n )}\n\n <Menu\n anchorEl={actionAnchorEl}\n keepMounted\n open={Boolean(actionAnchorEl)}\n getContentAnchorEl={null}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n transformOrigin={{ vertical: 'top', horizontal: 'right' }}\n onClose={handleCloseActionMenu}\n >\n <MenuItem onClick={handleEdit} className={classes.menuItem}>\n Edit\n </MenuItem>\n {tempComponent.family !== 'bit' && (\n <MenuItem onClick={handleConfirmDelete} className={classes.menuItem}>\n Delete\n </MenuItem>\n )}\n </Menu>\n\n {isOpenDeleteDialog && (\n <ConfirmationPopup\n title=\"Delete Component?\"\n text=\"You will not be able to recover it.\"\n okText=\"Delete\"\n handleClose={() => setIsOpenDeleteDialog(false)}\n handleOk={handleDelete}\n />\n )}\n\n {isOpenEditorDialog && (\n <EditComponentDialog\n component={tempComponent}\n isDraft={isDraft}\n error={error}\n onChange={handleChange}\n onCancel={handleCancel}\n onSave={handleConfirmSave}\n onUseSuggestion={handleUseSuggestion}\n onClose={() => {\n handleCancel();\n setIsOpenEditorDialog(false);\n }}\n />\n )}\n\n {isMobile && isOpenSaveConfirm && (\n <ConfirmationPopup\n title=\"Save Changes?\"\n text=\"You will not be able to recover it.\"\n okText=\"Save\"\n handleClose={() => setIsOpenSaveConfirm(false)}\n handleOk={handleSave}\n />\n )}\n </div>\n );\n}\n\nComponent.propTypes = {\n component: PropTypes.shape({\n family: PropTypes.string,\n size: PropTypes.number,\n outer_diameter: PropTypes.number,\n inner_diameter: PropTypes.number,\n linear_weight: PropTypes.number,\n length: PropTypes.number,\n }).isRequired,\n isMobile: PropTypes.bool.isRequired,\n isDraft: PropTypes.bool,\n onCancel: PropTypes.func,\n onDelete: PropTypes.func,\n onSave: PropTypes.func.isRequired,\n onChangeEditing: PropTypes.func,\n viewColumnsPerRow: PropTypes.number.isRequired,\n editColumnsPerRow: PropTypes.number.isRequired,\n isDragComponent: PropTypes.bool.isRequired,\n};\n\nexport default memo(Component);\n"],"names":["getComponentName","family","_COMPONENT_FAMILIES$f","COMPONENT_FAMILIES","find","item","type","name","Component","_ref","_classNames2","component","viewColumnsPerRow","editColumnsPerRow","_ref$isDraft","isDraft","_ref$onCancel","onCancel","_ref$onDelete","onDelete","onSave","onChangeEditing","isMobile","isDragComponent","useState","_useState2","_slicedToArray","_useState","actionAnchorEl","setActionAnchorEl","_useState4","_useState3","tempComponent","setTempComponent","_useState6","_useState5","isOpenSaveConfirm","setIsOpenSaveConfirm","_useState8","_useState7","isOpenDeleteDialog","setIsOpenDeleteDialog","_useState10","_useState9","isOpenEditorDialog","setIsOpenEditorDialog","_useState12","_useState11","error","setError","classes","useStyles","isEditing","is_editing","useEffect","handleCancel","handleChange","key","value","newComponent","calculateComponent","result","validateComponent","isValid","errors","handleUseSuggestion","suggestion","prev","handleConfirmSave","handleSave","saving","_excluded","omit","contentCellName","classNames","cell","ratioWidth","focusedFontsize","is_expanded","componentProps","onChange","onUseSuggestion","columns","_jsxs","className","children","_jsx","DrillPipeEditor","ComponentEditor","ConfirmationPopup","title","text","okText","handleClose","handleOk","componentMobile","componentExpandedMobile","componentActive","Boolean","row","rowExpanded","componentMobileCell","ComponentIcon","_Fragment","FormatedNumber","size","outer_diameter","inner_diameter","linear_weight","length","format","actionCell","ExpandCollapseButton","isExpanded","handleExpandCollapse","_objectSpread","MoreButton","handleOpenActionMenu","e","currentTarget","Grid","container","spacing","style","padding","StaticField","label","unit","DrillPipeBrowser","ComponentBrowser","Menu","anchorEl","keepMounted","open","getContentAnchorEl","anchorOrigin","vertical","horizontal","transformOrigin","onClose","MenuItem","onClick","menuItem","EditComponentDialog","propTypes","PropTypes","shape","string","number","isRequired","bool","func","memo"],"mappings":"+hgCAuBA,SAASA,EAAiBC,GAAQ,IAAAC,EAChC,OAAO,UAAAC,EAAmBC,MAAK,SAAAC,GAAI,OAAIA,EAAKC,OAASL,CAAM,WAApD,IAAAC,OAAA,EAAAA,EAAuDK,OAAQ,GACxE,CAEA,SAASC,EAWNC,GAAA,IAAAC,EAVDC,IAAAA,UACAC,IAAAA,kBACAC,IAAAA,kBAAiBC,EAAAL,EACjBM,QAAAA,cAAeD,EAAAE,EAAAP,EACfQ,SAAAA,aAAW,KAAID,EAAAE,EAAAT,EACfU,SAAAA,aAAW,KAAID,EACfE,IAAAA,OACAC,IAAAA,gBACAC,IAAAA,SACAC,IAAAA,gBAE4CC,EAAAA,EAAS,MAAKC,EAAAC,EAAAC,EAAA,GAAnDC,EAAcH,EAAA,GAAEI,EAAiBJ,EAAA,GACED,EAAAA,EAASb,GAAUmB,EAAAJ,EAAAK,EAAA,GAAtDC,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GACYN,EAAAA,GAAS,GAAMU,GAAAR,EAAAS,EAAA,GAA1DC,GAAiBF,GAAA,GAAEG,GAAoBH,GAAA,GACMV,GAAAA,GAAS,GAAMc,GAAAZ,EAAAa,GAAA,GAA5DC,GAAkBF,GAAA,GAAEG,GAAqBH,GAAA,GACId,GAAAA,GAAS,GAAMkB,GAAAhB,EAAAiB,GAAA,GAA5DC,GAAkBF,GAAA,GAAEG,GAAqBH,GAAA,GACtBlB,GAAAA,EAAS,MAAKsB,GAAApB,EAAAqB,GAAA,GAAjCC,GAAKF,GAAA,GAAEG,GAAQH,GAAA,GAEhBI,GAAUC,EAAU,CAAE7B,SAAAA,EAAU8B,UAAWpB,EAAcqB,WAAY9B,gBAAAA,IAE3E+B,GAAU,WACJjC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AUM,KACpBpI,SAAU8H,EAAUM,KACpBnI,OAAQ6H,EAAUM,KAAKF,WACvBhI,gBAAiB4H,EAAUM,KAC3B3I,kBAAmBqI,EAAUG,OAAOC,WACpCxI,kBAAmBoI,EAAUG,OAAOC,WACpC9H,gBAAiB0H,EAAUK,KAAKD,YAGlC,IAAeG,EAAAA,EAAKhJ"}
@@ -1,2 +1,2 @@
1
- import{memo as e,useMemo as o}from"react";import{isEmpty as t}from"lodash";import s from"prop-types";import{Grid as n}from"@material-ui/core";import{OD_ID_DEP_COLUMNS as i,CONTAINER_XS as r}from"../constants.js";import{isMobileDetected as p}from"../../../../../utils/mobileDetect.js";import"@babel/runtime/helpers/defineProperty";import"../../../../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider.js";import"../../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"@babel/runtime/helpers/objectWithoutProperties";import"classnames";import"../../../../Modal/CorvaModal.scss.js";import"@icon-park/react/es/all";import{jsxs as m,jsx as c}from"react/jsx-runtime";import"../../../../../icons/IconParkProvider.js";import"../../../../../icons/customIcons/icons/AddMessage.js";import"../../../../../icons/customIcons/icons/DragOne.js";import"../../../../../icons/customIcons/icons/Attention.js";import"../../../../../icons/customIcons/icons/Collapse.js";import"../../../../../icons/customIcons/icons/Dashboard.js";import"../../../../../icons/customIcons/icons/Expand.js";import"../../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../../icons/customIcons/icons/Search.js";import"../../../../../icons/customIcons/icons/SearchOne.js";import"../../../../../icons/customIcons/icons/Wellhub.js";import"../../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../../icons/customIcons/icons/Checkbox.js";import"../../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../../icons/customIcons/icons/Radio.js";import"../../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../../icons/customIcons/icons/InfoRounded.js";import"../../../../../icons/customIcons/icons/FlameFilled.js";import"../../../../../icons/customIcons/icons/MoreApp.js";import"../../../../../icons/customIcons/icons/Pad.js";import"../../../../../icons/customIcons/icons/DrilloutUnit.js";import"../../../../../icons/customIcons/icons/FracFleet.js";import"../../../../../icons/customIcons/icons/Global.js";import"../../../../../icons/customIcons/icons/Program.js";import"../../../../../icons/customIcons/icons/Rig.js";import"../../../../../icons/customIcons/icons/Well.js";import"../../../../../icons/customIcons/icons/Gap.js";import"../../../../../icons/customIcons/icons/Pin.js";import"../../../../../icons/customIcons/icons/CloseOneFilled.js";import"../../../../../icons/customIcons/icons/AttentionFilled.js";import"../../../../../icons/customIcons/icons/CheckOneFilled.js";import"../../../../../icons/customIcons/icons/Archive.js";import"../../../../../icons/customIcons/icons/ArchiveCancel.js";import"../../../../../icons/customIcons/icons/Unarchive.js";import"../../../../../icons/customIcons/icons/Archived.js";import"../../../../../icons/customIcons/icons/InterventionUnit.js";import"../../../../../icons/customIcons/icons/CloudDelete.js";import"../../../../../icons/customIcons/icons/Lasso.js";import"../../../../../icons/customIcons/icons/Radius.js";import"../../../../../icons/customIcons/icons/ErrorOps.js";import"../../../../../icons/customIcons/icons/DataTypeOps.js";import"../../../../../icons/customIcons/icons/FalsePositiveOps.js";import"../../../../../icons/customIcons/icons/CalibrationOps.js";import"../../../../../icons/customIcons/icons/CriticalOps.js";import"../../../../../icons/customIcons/icons/Company.js";import"../../../../../icons/customIcons/icons/ArchiveOne.js";import"../../../../../icons/customIcons/icons/ParseBotFusion.js";import"../../../../../icons/customIcons/icons/Connect.js";import"../../../../../icons/customIcons/icons/PuzzleOne.js";import"../../../../../icons/customIcons/icons/Feed.js";import"../../../../../icons/customIcons/icons/Prompt.js";import"../../../../../icons/customIcons/icons/Companies.js";import"../../../../../icons/customIcons/icons/ClipboardAi.js";import"../../../../../icons/customIcons/icons/Key.js";import"../../../../../icons/customIcons/icons/AtSignCrossed.js";import"../../../../../icons/customIcons/icons/MappingManual.js";import"../../../../../icons/customIcons/icons/Mapping.js";import"../../../../../icons/customIcons/icons/Metrics.js";import"../../../../../icons/customIcons/icons/Drops.js";import"../../../../../icons/customIcons/icons/ClipboardSearch.js";import"../../../../../icons/customIcons/icons/Template.js";import"../../../../../icons/customIcons/icons/ClipboardMetrics.js";import"../../../../../icons/customIcons/icons/ClipboardBuilder.js";import"../../../../../icons/customIcons/icons/UnitConversion.js";import"../../../../../icons/customIcons/icons/NPT.js";import"../../../../../icons/customIcons/icons/GuidedFrac.js";import"../../../../IconButton/index.js";import"../../../../../constants/goals.js";import"../../../../../constants/segment.js";import"../../../../../constants/alerts.js";import"../../../../../constants/apps.js";import{OD_ID_DEP_LIST as a,COMPONENT_GRADES as l,COMPONENT_CLASSES as d,COMPONENT_MATERIALS as j}from"../../../../../constants/casing.js";import"../../../../../constants/drillstring.js";import"../../../../../constants/completion.js";import"../../../../../constants/appPackages.js";import"../../../../../constants/notifications.js";import"../../../../../constants/feed.js";import"../../../../../constants/bha.js";import"../../../../../constants/corvaCompanyId.js";import"../../../../GradientManager/configuration/constants.js";import"@babel/runtime/helpers/slicedToArray";import"uuid";import"../../../../IconMenu/index.js";import"../../../../StyledMenuItem/index.js";import"../../../../AppIcon/AppIcon.js";import"../../../../DevCenter/AppHeader/AppHeader.js";import"../../../../DevCenter/AppSideBar/AppSideBar.js";import"../../../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../../../../DevCenter/AppContext.js";import"../../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router-dom";import"query-string";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../../../utils/index.js";import"@material-ui/icons";import"../../../../EmptyState/EmptyState.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/styles.js";import"@material-ui/pickers";import"@date-io/moment";import"moment";import"../../../../../config/theme/index.js";import"../../../../../hocs/withAssetEditorLockHOC.js";import"../../../../ErrorBoundary/ErrorBoundary.js";import"../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../../../Button/components/Button/index.js";import"moment-timezone";import"../../../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../../../../Button/components/LiveButton/styles.js";import"../../../../AssetEditorV2/index.js";import"../../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../../../ConfirmationDialog.js";import"immutable";import"../../../../../permissions/PermissionsContext.js";import"../../../../../permissions/constants/index.js";import"../../../../../permissions/withPermissionsHOC.js";import"../../../../../clients/jsonApi/index.js";import"../../../../../permissions/ProvidePermissions.js";import"../../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.constants.js";import"../../../../Annotations/components/AnnotationsList/index.js";import"../../../../Annotations/components/LastAnnotation/index.js";import"../../../../Annotations/AnnotationsContext.js";import"../../../../../componentsV2/AppContainer/AppContainer.js";import"../../../../../componentsV2/AppContainer/AppContainer.constants.js";import"../../../../../componentsV2/Text/Text.js";import"../../../../../componentsV2/Header/Header.scss.js";import"../../../../../componentsV2/Tooltip/Tooltip.scss.js";import"../../../../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../../../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../../../../componentsV2/AppHeader/AppHeader.constants.js";import"../../../../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../../../../componentsV2/Chip/Chip.js";import"../../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../../../../componentsV2/AppHeader/AppAssets/utils.js";import"../../../../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../../../../PadModeSelect/PadModeSelect.js";import"../../../../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../../../../constants/streamSourceType.js";import"../../../../../componentsV2/PadModeSelect/PadModeSelect.js";import"../../../../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../../../../componentsV2/AppCommonsProvider/AppCommonsProvider.js";import"../../../../../componentsV2/utils.js";import"../../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../../../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../../../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../../../../componentsV2/Button/Button.js";import"../../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../../../../componentsV2/Popover/Popover.js";import"@babel/runtime/helpers/toConsumableArray";import"../../../../../componentsV2/Accordion/Accordion.scss.js";import"../../../../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../../../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../../../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../../../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../../../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../../../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../../../../componentsV2/Menu/Menu.js";import"../../../../../componentsV2/ModalWindow/ModalWindow.js";import"../../../../../componentsV2/Modal/Modal.scss.js";import"../../../../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../../../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../../../../utils/getSingleAsset.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../../../../componentsV2/TextInput/TextInput.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../../../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"../../../../../clients/subscriptions/constants.js";import"querystring";import"uuid/v1";import"../../../../../clients/subscriptions.v1.js";import"../../../../../clients/subscriptions/subscriptions-client.factory.js";import"jsona";import"../../../../../utils/env.js";import"../../../../StatusBadge/constants.js";import"lodash/set";import"lodash/get";import"lodash/unset";import"../../../../../clients/api/apiCore.js";import"../../../../../clients/constants.js";import"../../../../../clients/sso/auth0.js";import"../../../../../clients/sso/oauth2.js";import"../../../../../clients/api/rateLimiter.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../../../../componentsV2/AppSettings/AppSettingsPinningContext.js";import"../../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../../../../componentsV2/AppHeader/V3/constants.scss.js";import"@babel/runtime/helpers/typeof";import"../../../../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.js";import"../../../../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.constants.js";import"../../../../../componentsV2/AppSettings/AppSettings.js";import"../../../../../componentsV2/AppSettings/AppSettings.constants.js";import"../../../../../componentsV2/AppSizeProvider/AppSizeProvider.js";import"../../../../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../../../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../../../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../../../../componentsV2/AppHeader/AppHeader.scss.js";import"../../../../../componentsV2/EmptyState/EmptyState.scss.js";import"../../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton.js";import"../../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.scss.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../../../../../componentsV2/Grid/Grid.js";import"../../../../../componentsV2/Grid/Cell.js";import"../../../../../componentsV2/PopoverPanel/PopoverPanel.js";import"../../../../../componentsV2/Radio/Radio.js";import"../../../../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../../../../componentsV2/Checkbox/Checkbox.js";import"../../../../../componentsV2/TextInputNext/TextInputNext.js";import"../../../../../componentsV2/TextArea/TextArea.js";import"../../../../../componentsV2/Label/Label.js";import"../../../../../componentsV2/TextLink/TextLink.js";import"../../../../../componentsV2/ChipAlert/ChipAlert.js";import"../../../../../componentsV2/Avatar/Avatar.js";import"../../../../../componentsV2/AvatarGroup/AvatarGroup.js";import"@material-ui/lab";import"../../../../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../../../../componentsV2/Paper/Paper.js";import"../../../../../componentsV2/Hint/Hint.scss.js";import"../../../../../componentsV2/Counter/Counter.js";import"../../../../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../../../../componentsV2/TemplatesControl/TemplatesControl.js";import"zustand";import"../../../../../componentsV2/TemplatesControl/utils.js";import"../../../../../componentsV2/TemplatesControl/icons/folder/index.js";import"../../../../../componentsV2/TemplatesControl/Store/utils.js";import"../../../../../componentsV2/TemplatesControl/types.js";import"../../../../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../../../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../../../../componentsV2/Switch/Switch.js";import"../../../../../componentsV2/Tabs/Tabs.js";import"../../../../../componentsV2/FileIcon/FileIcon.js";import"../../../../../componentsV2/Tag/Tag.js";import"react-dropzone";import"../../../../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../../../../componentsV2/FilesLoader/FilesLoader.scss.js";import"file-extension";import"image-extensions";import"video-extensions";import"../../../../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../../../../componentsV2/Skeleton/Skeleton.scss.js";import"../../../../../utils/main.js";import"../../../../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../../../../componentsV2/Stepper/Step/Step.scss.js";import"../../../../../componentsV2/Stepper/Stepper.scss.js";import"../../../../../componentsV2/ButtonLive/ButtonLive.js";import"../../../../../componentsV2/ButtonText/ButtonText.js";import"../../../../../componentsV2/IndicatorLive/IndicatorLive.js";import"../../../../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../../../../componentsV2/BadgeComment/BadgeComment.js";import"../../../../../componentsV2/AppFooter/AppFooter.js";import"../../../../../componentsV2/OffsetWellsButton/OffsetWellsButton.js";import"../../../../../componentsV2/ChartAxisExtreme/ChartAxisExtreme.scss.js";import"highcharts";import"../../../../../componentsV2/ChartAxisExtreme/ChartAxisExtremeDragTracker.js";import"../../../../../componentsV2/Autocomplete/Autocomplete.js";import"../../../../../componentsV2/Select/Select.js";import"../../../../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../../../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../../../../componentsV2/DatePicker/DatePicker.js";import"../../../../../componentsV2/DragHandle/DragHandle.js";import"../../../../../componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js";import"../../../../../componentsV2/Slider/constants.js";import"../../../../../componentsV2/Slider/components/SliderThumb.js";import"../../../../../componentsV2/Slider/Slider.scss.js";import"../../../../../componentsV2/SliderAdvanced/SliderAdvanced.js";import"react-color";import"../../../../../componentsV2/ColorPicker/Swatches/Swatches.scss.js";import"../../../../../componentsV2/ColorPicker/OpacityDragtracker/OpacityDragTracker.scss.js";import"../../../../../componentsV2/ColorPicker/ColorPicker.scss.js";import"../../../../../componentsV2/ChartHelper/ChartHelper.scss.js";import"../../../../../componentsV2/Hotkey/Hotkey.js";import"@tanstack/react-query";import"../../../../../componentsV2/InterventionEventSelector/useInterventionUnitEvents.js";import"../../../../../componentsV2/InterventionEventSelector/InterventionEventSelector.scss.js";import"../../../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.css.js";import"../../../../Icons/AnnotationIcon.js";import"../../../../HelpCenter/HelpCenterIcon.js";import"../../../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/RestoreAppSizeButton.css.js";import"../../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.scss.js";import"../../../../Toaster/Toaster.js";import"../../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../../DevCenter/SideBar/SideBar.js";import"../../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../../AssetEditor/index.js";import"../../../../LoadingIndicator/LoadingIndicator.js";import"../../../../Typography.js";import"../../../../RealTimeValuesSidebar/RealTimeSidebar.js";import"../../../../CollapsableSidebar.js";import"../../../../DateTimePicker/index.js";import"../../../../DatePicker/index.js";import"../../../../SlateFormattedText/SlateFormattedText.js";import"../../../../SlateFormattedText/RenderElements.js";import"slate";import"../../../../ParameterCharts/ParameterCharts.js";import"../../../../ParameterCharts/AddEditTrack.js";import"../../../../ChartActionsList/ChartActionsList.js";import"../../../../CopyToClipboard/CopyToClipboard.js";import"../../../../AssetEditor/AssetEditorAutocomplete.js";import"../../../../AssetEditor/SingleAssetEditor.js";import"../../../../SettingEditors/ColorEditor/style.css.js";import"../../../../SettingEditors/DropdownEditor/index.js";import"../../../../SwitchControl/index.js";import"../../../../ColorPicker/ColorPicker.js";import"../../../../Chart/components/ChartButton.js";import"../../../../Chart/components/ChartButtons.js";import"../../../../Chart/components/ChartWrapper.js";import"../../../../Chart/components/AxisDropdown.js";import"../../../../Chart/components/ChartSelect.js";import"../../../../Chart/ChartWrapperContext.js";import"../../../../Chart/effects/useChartModifier.js";import"../../../../Chart/components/buttons/HideAxesButton.js";import"../../../../Chart/components/buttons/ChartTypeButton.js";import"../../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../../TruncatedText/index.js";import"../../../../MiddleTruncatedText/MiddleTruncatedText.js";import"../../../../RangeSlider/constants.js";import"../../../../RangeSlider/Input.css.js";import"../../../../RangeSlider/RangeSlider.css.js";import"../../../../AdvancedSlider/AdvancedSlider.js";import"../../../../Breadcrumbs/index.js";import"../../../../VirtualizedTable/index.js";import"../../../../EmptyView/EmptyView.js";import"../../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../../ContextMenuItem/index.js";import"../../../../FolderMenuItem/index.js";import"../../../../EditableItem/EditableItem/index.js";import"../../../../EditableItem/EditableItemWithBadge/index.js";import"../../../../Checkbox/index.js";import"../../../../FolderMenuItemWithLinks/index.js";import"../../../../TextField/index.js";import"../../../../Chip/index.js";import"../../../../Counter/index.js";import"../../../../AnchorsList/AnchorsList.js";import"../../../../Select/index.js";import"../../../../Select/SelectFilterBy.js";import"../../../../CustomSelect/index.js";import"../../../../Tabs/Tabs.js";import"../../../../Tabs/Tab.js";import"../../../../ResizableTable/ResizableTable.js";import"../../../../GradientPicker/GradientPicker.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"../../../../GradientManager/GradientPreview/GradientPreview.js";import"../../../../GradientManager/GradientSelect.scss.js";import"../../../../GradientManager/GradientManager.styles.js";import"../../../../Drillstring/BHASchematic.js";import"../../../../Drillstring/BHATable/index.js";import"../../../../Drillstring/BHAComponentIcon.js";import"../../../../Drillstring/BHAComponentDetail/index.js";import"../../../../Drillstring/BHATileIcon.js";import"../../../../Drillstring/BHATile/BHATile.js";import"../../../../Drillstring/BHAList/BHAList.js";import"../../../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../../CasingTable/index.js";import u from"../../../CasingComponentIcon.js";import"../../../CasingTileIcon.js";import"../../CasingTableV2.js";import"../../../CasingTile/CasingTile.js";import"../../../../WellSummary/WellSummaryItemLabel.js";import"../../../../WellSummary/WellSummaryItemTitle.js";import"../../../../WellSummary/WellSummaryItemValue.js";import"../../../../WellSummary/ActivitySummaryChart.js";import"../../../../WellSummary/FracWirelineTimeChart.js";import"../../../../BICOffsetPickerDialog/index.js";import"../../../../OffsetWellButton/OffsetWellButton.js";import"../../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../../OffsetWellPickerV3/index.js";import"../../../../OffsetWellChips/Chip.js";import"../../../../OffsetWellChips/ChipsContainer.js";import"../../../../OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js";import"../../../../OffsetWellMap/OffsetWellMap.js";import"@material-ui/core/Snackbar";import"../../../../Notifications/Toast.js";import"../../../../Notifications/Notifications.scss.js";import"../../../../TextLink/index.js";import"../../../../Avatar/index.js";import"../../../../Template/TemplatePopover/index.js";import"../../../../Template/TemplateSharingDialog/index.js";import"../../../../MenuItem/index.js";import"../../../../MiddleTruncate/MiddleTruncate.js";import"../../../../PinnableFilters/PinnableFilters.js";import"../../../../HeaderLayout/HeaderLayout.js";import"../../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../../PadOffsetsPicker/StagesSelector.js";import"../../../../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../../../../Table/TableToolbar/TableToolbar.js";import"../../../../Table/TableContainer/TableContainer.js";import"../../../../Table/TableCell/TableCell.js";import"../../../../Table/TablePagination/TablePagination.js";import"../../../../Table/TablePaginationActions/TablePaginationActions.js";import"../../../../Tooltip/ScrollableTooltip.js";import"../../../../PriceInput/PriceInput.js";import"../../../../LabelsCounter/LabelsCounter.js";import"../../../../Stepper/Stepper.js";import"../../../../Stepper/Step/Step.js";import"../../../../Stepper/StepsWrapper.js";import"../../../../Comment/CommentIcon/index.js";import"../../../../FilesLoader/FilesLoader.js";import"../../../../../componentsV2/FileIcon/icons/ArchiveFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/CSVFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/DocFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/EDMFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/ExcelFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/ImageFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/JsonFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/LasFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/OtherFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/PdfFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/PowerPointFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/TxtFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/UnknownFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/VideoFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/XmlFileIcon.js";import"../../../../SearchInput/index.js";import"../../../../FeedItem/FeedItem.js";import"../../../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../../../../PostInput/PostInput.js";import"../../../../KeyboardDateTimePicker.js";import"../../../../AddComment/Popover.js";import"../../../../AddComment/Popup.js";import"../../../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../../../StageDesignVActual/ComparisonHeader.js";import"../../../../StageDesignVActual/ComparisonRow.js";import"../../../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../../../EmbeddedApp/EmbeddedApp.js";import"../../../../Autocomplete/Autocomplete.js";import"../../../../DocumentViewer/DocumentViewer.js";import"../../../../ColorPickerPalette/ColorPickerPalette.js";import"../../../../Search/Search.js";import"../../../../Search/components/Listbox.js";import"../../../../Search/components/Paper.js";import"../../../../Search/components/RecentSearches.js";import"../../../../Search/components/Groups.js";import"../../../../Search/components/SelectAllListItem.js";import"../../../../StatusBadge/index.js";import"../../../../Attachment/index.js";import"../../../../EmojiIconButton.js";import"../../../../FileUploadIconButton.js";import"../../../../FilePreview/index.js";import"../../../../FailedFileUploading.js";import"../../../../UserMention/index.js";import"../../../../CommentsInfo/index.js";import"../../../../CommentInput/index.js";import"../../../../Comment/index.js";import"../../../../CommentLoader.js";import"../../../../AssetNameLabel/AssetStatusBadge.js";import"../../../../AssetEditorV2/components/PrimaryAssetSelect.js";import"../../../../AssetEditorV2/components/SecondaryAssetSelect.js";import"../../../../AssetEditorV2/components/SelectItem.js";import"../../../../AssetEditorV2/components/MultipleAssetsToggle.js";import"../../../../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../../../../EChartsWrapper/EChartsWrapper.js";import"../../../../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../../../../GoogleDocsViewer/index.js";import"../../../../NewDocumentViewer/effects/useFileContent.js";import"../../../../NewDocumentViewer/styles.js";import"../../../../FilesLoaderV2/styles.js";import"../../../../FilesDropzone/styles.js";import"../../../../FilesProcessor/styles.js";import"../../../../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../../../../Formula/useFormulaStyles.js";import"../../../../Formula/RootXIcon.js";import"../../../../Formula/FormulaTextEditor.js";import"../../../../Formula/CloseSuggestion.js";import"../../../../Formula/SuggestionsMenu.js";import"../../../../CommentCard/CommentCard.js";import"@material-ui/icons/AlternateEmail";import"../../../../AttachFileButton/AttachFileButton.scss.js";import"../../../../CommentInputNext/CommentInputNext.js";import"../../../../UserMention/utils/index.js";import"react-s3-uploader/s3upload";import"../../../../CommentComposer/CommentMetaLine.scss.js";import"../../../../CommentComposer/ChatChannelSelector.scss.js";import"../../../../CommentComposer/ShareToChatRow.scss.js";import"../../../../CommentComposer/CommentComposer.scss.js";import"../../../../AttachmentPreview/AttachmentPreview.js";import"../../../../AttachmentPreview/AttachmentImage.js";import"../../../../AttachmentPreview/AttachmentPreview.scss.js";import"../../../../CommentPin/CommentPin.js";import"../../../../FeedCard/FeedCard.js";import"../../../../FeedItemCard/FeedItemCard.js";import"../../../../NewCommentCursor/NewCommentCursor.js";import"../../../../LinkedText/LinkedText.js";import"../../../../FeedItem/feedItemTypes/AlertFeedItem.js";import"../../../../FeedItem/feedItemTypes/PostFeedItem.js";import"../../../../FeedItem/feedItemTypes/GeosteeringFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingOperationalNoteFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingOperationSummaryFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingDailyCostFeedItem.js";import"../../../../FeedItem/feedItemTypes/DocumentFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillerMemoFeedItem.js";import"../../../../FeedItem/feedItemTypes/NptFeedItem.js";import"../../../../FeedItem/feedItemTypes/SurveyStationFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/LessonsLearnedFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/TracesMemoFeedItem.js";import"../../../../FeedItem/feedItemTypes/DepthCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionOperationalNoteFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionOperationSummaryFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionDailyCostFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionDocumentFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionNptFeedItem.js";import"../../../../FeedItem/feedItemTypes/StageOverviewFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/AppAnnotationFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/WellPlanFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/FluidReportFeedItem.js";import"../../../../FeedItem/feedItemTypes/BhaFeedItem/BhaFeedItem.js";import"../../../../FeedItem/feedItemTypes/DvDCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/PCCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/HookloadCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/NptLessonsCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/GenericDataCommentFeedItem.js";import{CancelButton as C}from"../../../../Drillstring/BHAComponentsTable/components/shared/CancelButton.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/FormatedNumber.js";import{InputText as I}from"../../../../Drillstring/BHAComponentsTable/components/shared/InputText.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/MoreButton.js";import{SaveButton as A}from"../../../../Drillstring/BHAComponentsTable/components/shared/SaveButton.js";import{SelectField as g}from"../../../../Drillstring/BHAComponentsTable/components/shared/SelectField.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/StaticField.js";import{SharedEditorElements as h}from"../../../../Drillstring/BHAComponentsTable/components/shared/SharedEditorElements.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js";import V from"../../../../Drillstring/BHAComponentsTable/components/Suggestions/Suggestions.js";import{useStyles as S}from"../../../../Drillstring/BHAComponentsTable/components/sharedStyles.js";function F(e){var s=e.component,F=e.error,T=void 0===F?null:F,v=e.onChange,D=e.onCancel,b=e.onSave,P=e.onUseSuggestion,x=e.columns,f=S({isMobile:p}),y=p?r/2:r/x,B=function(e){return T&&T[e]},E=o((function(){var e=a;return s.outer_diameter?e.filter((function(e){return e.outer_diameter===parseFloat(s.outer_diameter)})):[]}),[s.outer_diameter]);return m(n,{container:!0,spacing:0,className:f.editorContainer,children:[!p&&c(n,{item:!0,className:f.editorComponentSize,children:c(u,{component:s})}),c(n,{item:!0,className:f.eidtorContentContainer,children:m(n,{container:!0,spacing:2,children:[c(h,{component:s,getError:B,onChange:v,isCasing:!0}),E.length>0&&c(V,{data:E,allData:a,columns:i,displayKeys:["outer_diameter","inner_diameter"],descriptionKeys:["outer_diameter","inner_diameter","linear_weight","number_of_joints","component_length"],onSelect:P,isCasing:!0}),c(I,{type:"name",label:"Name",value:s.name,error:B("name"),xs:y,onChangeField:v}),c(I,{type:"number_of_joints",label:"# of Joints",value:s.number_of_joints,error:B("number_of_joints"),xs:y,onChangeField:v}),c(I,{type:"component_length",label:"Component Length",unit:"length",value:s.component_length,error:B("component_length"),xs:y,onChangeField:v}),c(I,{type:"weight",label:"T.Weight",unit:"mass",value:s.weight,error:B("weight"),disabled:!0,xs:y,onChangeField:v}),c(g,{type:"grade",options:l,label:"Grade",value:s.grade,error:B("grade"),xs:y,onChangeField:v}),c(I,{type:"outer_diameter_tooljoint",label:"TJ OD",unit:"shortLength",value:s.outer_diameter_tooljoint,error:B("outer_diameter_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"inner_diameter_tooljoint",label:"TJ ID",unit:"shortLength",value:s.inner_diameter_tooljoint,error:B("inner_diameter_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"length_tooljoint",label:"TJ Length Per Joint",unit:"length",value:s.length_tooljoint,error:B("length_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"connection_type",label:"Connection Type",value:s.connection_type,error:B("connection_type"),xs:y,onChangeField:v}),c(g,{type:"class",options:d,label:"Class",value:s.class,error:B("class"),xs:y,onChangeField:v}),c(g,{type:"material",options:j,label:"Material",value:s.material,error:B("material"),xs:y,onChangeField:v})]})}),!p&&m(n,{item:!0,className:f.eidtorActionGroup,children:[c(C,{handleCancel:D}),c(A,{handleSave:b,disabled:!t(T)})]})]})}F.propTypes={component:s.shape({outer_diameter:s.number,component_length:s.number,name:s.string,number_of_joints:s.number,weight:s.number,connection_type:s.string,grade:s.string,class:s.string,material:s.string,outer_diameter_tooljoint:s.number,inner_diameter_tooljoint:s.number,length_tooljoint:s.number}).isRequired,error:s.shape({}),onChange:s.func.isRequired,onCancel:s.func.isRequired,onSave:s.func.isRequired,onUseSuggestion:s.func.isRequired,columns:s.number.isRequired};var T=e(F);export{T as default};
1
+ import{memo as e,useMemo as o}from"react";import{isEmpty as t}from"lodash";import s from"prop-types";import{Grid as n}from"@material-ui/core";import{OD_ID_DEP_COLUMNS as i,CONTAINER_XS as r}from"../constants.js";import{isMobileDetected as p}from"../../../../../utils/mobileDetect.js";import"@babel/runtime/helpers/defineProperty";import"../../../../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider.js";import"../../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../../../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"@babel/runtime/helpers/objectWithoutProperties";import"classnames";import"../../../../Modal/CorvaModal.scss.js";import"@icon-park/react/es/all";import{jsxs as m,jsx as c}from"react/jsx-runtime";import"../../../../../icons/IconParkProvider.js";import"../../../../../icons/customIcons/icons/AddMessage.js";import"../../../../../icons/customIcons/icons/DragOne.js";import"../../../../../icons/customIcons/icons/Attention.js";import"../../../../../icons/customIcons/icons/Collapse.js";import"../../../../../icons/customIcons/icons/Dashboard.js";import"../../../../../icons/customIcons/icons/Expand.js";import"../../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../../icons/customIcons/icons/Search.js";import"../../../../../icons/customIcons/icons/SearchOne.js";import"../../../../../icons/customIcons/icons/Wellhub.js";import"../../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../../icons/customIcons/icons/Checkbox.js";import"../../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../../icons/customIcons/icons/Radio.js";import"../../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../../icons/customIcons/icons/InfoRounded.js";import"../../../../../icons/customIcons/icons/FlameFilled.js";import"../../../../../icons/customIcons/icons/MoreApp.js";import"../../../../../icons/customIcons/icons/Pad.js";import"../../../../../icons/customIcons/icons/DrilloutUnit.js";import"../../../../../icons/customIcons/icons/FracFleet.js";import"../../../../../icons/customIcons/icons/Global.js";import"../../../../../icons/customIcons/icons/Program.js";import"../../../../../icons/customIcons/icons/Rig.js";import"../../../../../icons/customIcons/icons/Well.js";import"../../../../../icons/customIcons/icons/Gap.js";import"../../../../../icons/customIcons/icons/Pin.js";import"../../../../../icons/customIcons/icons/CloseOneFilled.js";import"../../../../../icons/customIcons/icons/AttentionFilled.js";import"../../../../../icons/customIcons/icons/CheckOneFilled.js";import"../../../../../icons/customIcons/icons/Archive.js";import"../../../../../icons/customIcons/icons/ArchiveCancel.js";import"../../../../../icons/customIcons/icons/Unarchive.js";import"../../../../../icons/customIcons/icons/Archived.js";import"../../../../../icons/customIcons/icons/InterventionUnit.js";import"../../../../../icons/customIcons/icons/CloudDelete.js";import"../../../../../icons/customIcons/icons/Lasso.js";import"../../../../../icons/customIcons/icons/Radius.js";import"../../../../../icons/customIcons/icons/ErrorOps.js";import"../../../../../icons/customIcons/icons/DataTypeOps.js";import"../../../../../icons/customIcons/icons/FalsePositiveOps.js";import"../../../../../icons/customIcons/icons/CalibrationOps.js";import"../../../../../icons/customIcons/icons/CriticalOps.js";import"../../../../../icons/customIcons/icons/Company.js";import"../../../../../icons/customIcons/icons/ArchiveOne.js";import"../../../../../icons/customIcons/icons/ParseBotFusion.js";import"../../../../../icons/customIcons/icons/Connect.js";import"../../../../../icons/customIcons/icons/PuzzleOne.js";import"../../../../../icons/customIcons/icons/Feed.js";import"../../../../../icons/customIcons/icons/Prompt.js";import"../../../../../icons/customIcons/icons/Companies.js";import"../../../../../icons/customIcons/icons/ClipboardAi.js";import"../../../../../icons/customIcons/icons/Key.js";import"../../../../../icons/customIcons/icons/AtSignCrossed.js";import"../../../../../icons/customIcons/icons/MappingManual.js";import"../../../../../icons/customIcons/icons/Mapping.js";import"../../../../../icons/customIcons/icons/Metrics.js";import"../../../../../icons/customIcons/icons/Drops.js";import"../../../../../icons/customIcons/icons/ClipboardSearch.js";import"../../../../../icons/customIcons/icons/Template.js";import"../../../../../icons/customIcons/icons/ClipboardMetrics.js";import"../../../../../icons/customIcons/icons/ClipboardBuilder.js";import"../../../../../icons/customIcons/icons/UnitConversion.js";import"../../../../../icons/customIcons/icons/NPT.js";import"../../../../../icons/customIcons/icons/GuidedFrac.js";import"../../../../IconButton/index.js";import"../../../../../constants/goals.js";import"../../../../../constants/segment.js";import"../../../../../constants/alerts.js";import"../../../../../constants/apps.js";import{OD_ID_DEP_LIST as a,COMPONENT_GRADES as l,COMPONENT_CLASSES as d,COMPONENT_MATERIALS as j}from"../../../../../constants/casing.js";import"../../../../../constants/drillstring.js";import"../../../../../constants/completion.js";import"../../../../../constants/appPackages.js";import"../../../../../constants/notifications.js";import"../../../../../constants/feed.js";import"../../../../../constants/bha.js";import"../../../../../constants/corvaCompanyId.js";import"../../../../GradientManager/configuration/constants.js";import"@babel/runtime/helpers/slicedToArray";import"uuid";import"../../../../IconMenu/index.js";import"../../../../StyledMenuItem/index.js";import"../../../../AppIcon/AppIcon.js";import"../../../../DevCenter/AppHeader/AppHeader.js";import"../../../../DevCenter/AppSideBar/AppSideBar.js";import"../../../../DevCenter/AppsDataProvider/AppsDataProvider.js";import"../../../../DevCenter/AppContext.js";import"../../../../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../../../../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"react-router-dom";import"query-string";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../../../utils/index.js";import"@material-ui/icons";import"../../../../EmptyState/EmptyState.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/styles.js";import"@material-ui/pickers";import"@date-io/moment";import"moment";import"../../../../../config/theme/index.js";import"../../../../../hocs/withAssetEditorLockHOC.js";import"../../../../ErrorBoundary/ErrorBoundary.js";import"../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../../../../Button/components/Button/index.js";import"moment-timezone";import"../../../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../../../../Button/components/LiveButton/styles.js";import"../../../../AssetEditorV2/index.js";import"../../../../AppVersionsSelect/AppVersionsSelect.js";import"../../../../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../../../../ConfirmationDialog.js";import"immutable";import"../../../../../permissions/PermissionsContext.js";import"../../../../../permissions/constants/index.js";import"../../../../../permissions/withPermissionsHOC.js";import"../../../../../clients/jsonApi/index.js";import"../../../../../permissions/ProvidePermissions.js";import"../../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.constants.js";import"../../../../Annotations/components/AnnotationsList/index.js";import"../../../../Annotations/components/LastAnnotation/index.js";import"../../../../Annotations/AnnotationsContext.js";import"../../../../../componentsV2/AppContainer/AppContainer.js";import"../../../../../componentsV2/AppContainer/AppContainer.constants.js";import"../../../../../componentsV2/Text/Text.js";import"../../../../../componentsV2/Header/Header.scss.js";import"../../../../../componentsV2/Tooltip/Tooltip.scss.js";import"../../../../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../../../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../../../../componentsV2/AppHeader/AppHeader.constants.js";import"../../../../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../../../../componentsV2/Chip/Chip.js";import"../../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../../../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../../../../componentsV2/AppHeader/AppAssets/utils.js";import"../../../../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../../../../PadModeSelect/PadModeSelect.js";import"../../../../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../../../../constants/streamSourceType.js";import"../../../../../componentsV2/PadModeSelect/PadModeSelect.js";import"../../../../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../../../../componentsV2/AppCommonsProvider/AppCommonsProvider.js";import"../../../../../componentsV2/utils.js";import"../../../../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../../../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../../../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../../../../componentsV2/Button/Button.js";import"../../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../../../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../../../../componentsV2/Popover/Popover.js";import"@babel/runtime/helpers/toConsumableArray";import"../../../../../componentsV2/Accordion/Accordion.scss.js";import"../../../../../componentsV2/ButtonIcon/ButtonIcon.js";import"../../../../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../../../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../../../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../../../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../../../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../../../../componentsV2/Menu/Menu.js";import"../../../../../componentsV2/ModalWindow/ModalWindow.js";import"../../../../../componentsV2/Modal/Modal.scss.js";import"../../../../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../../../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../../../../utils/getSingleAsset.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../../../../componentsV2/TextInput/TextInput.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../../../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../../../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"../../../../../clients/subscriptions/constants.js";import"querystring";import"uuid/v1";import"../../../../../clients/subscriptions.v1.js";import"../../../../../clients/subscriptions/subscriptions-client.factory.js";import"jsona";import"../../../../../utils/env.js";import"../../../../StatusBadge/constants.js";import"lodash/set";import"lodash/get";import"lodash/unset";import"../../../../../clients/api/apiCore.js";import"../../../../../clients/constants.js";import"../../../../../clients/sso/auth0.js";import"../../../../../clients/sso/oauth2.js";import"../../../../../clients/api/rateLimiter.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../../../../componentsV2/AppSettings/AppSettingsPinningContext.js";import"../../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../../../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../../../../componentsV2/AppHeader/V3/constants.scss.js";import"@babel/runtime/helpers/typeof";import"../../../../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.js";import"../../../../../componentsV2/AppHeader/V3/SettingsButton/SettingsButton.constants.js";import"../../../../../componentsV2/AppSettings/AppSettings.js";import"../../../../../componentsV2/AppSettings/AppSettings.constants.js";import"../../../../../componentsV2/AppSizeProvider/AppSizeProvider.js";import"../../../../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../../../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../../../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../../../../componentsV2/AppHeader/AppHeader.scss.js";import"../../../../../componentsV2/EmptyState/EmptyState.scss.js";import"../../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/components/ChooseAssetButton.js";import"../../../../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.scss.js";import"../../../../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../../../../../componentsV2/Grid/Grid.js";import"../../../../../componentsV2/Grid/Cell.js";import"../../../../../componentsV2/PopoverPanel/PopoverPanel.js";import"../../../../../componentsV2/Radio/Radio.js";import"../../../../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../../../../componentsV2/Checkbox/Checkbox.js";import"../../../../../componentsV2/TextInputNext/TextInputNext.js";import"../../../../../componentsV2/TextArea/TextArea.js";import"../../../../../componentsV2/Label/Label.js";import"../../../../../componentsV2/TextLink/TextLink.js";import"../../../../../componentsV2/ChipAlert/ChipAlert.js";import"../../../../../componentsV2/Avatar/Avatar.js";import"../../../../../componentsV2/AvatarGroup/AvatarGroup.js";import"@material-ui/lab";import"../../../../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../../../../componentsV2/Paper/Paper.js";import"../../../../../componentsV2/Hint/Hint.scss.js";import"../../../../../componentsV2/Counter/Counter.js";import"../../../../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../../../../componentsV2/TemplatesControl/TemplatesControl.js";import"zustand";import"../../../../../componentsV2/TemplatesControl/utils.js";import"../../../../../componentsV2/TemplatesControl/icons/folder/index.js";import"../../../../../componentsV2/TemplatesControl/Store/utils.js";import"../../../../../componentsV2/TemplatesControl/types.js";import"../../../../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../../../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../../../../componentsV2/Switch/Switch.js";import"../../../../../componentsV2/Tabs/Tabs.js";import"../../../../../componentsV2/FileIcon/FileIcon.js";import"../../../../../componentsV2/Tag/Tag.js";import"react-dropzone";import"../../../../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../../../../componentsV2/FilesLoader/FilesLoader.scss.js";import"file-extension";import"image-extensions";import"video-extensions";import"../../../../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../../../../componentsV2/Skeleton/Skeleton.scss.js";import"../../../../../utils/main.js";import"../../../../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../../../../componentsV2/Stepper/Step/Step.scss.js";import"../../../../../componentsV2/Stepper/Stepper.scss.js";import"../../../../../componentsV2/ButtonLive/ButtonLive.js";import"../../../../../componentsV2/ButtonText/ButtonText.js";import"../../../../../componentsV2/IndicatorLive/IndicatorLive.js";import"../../../../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../../../../componentsV2/BadgeComment/BadgeComment.js";import"../../../../../componentsV2/AppFooter/AppFooter.js";import"../../../../../componentsV2/OffsetWellsButton/OffsetWellsButton.js";import"../../../../../componentsV2/ChartAxisExtreme/ChartAxisExtreme.scss.js";import"highcharts";import"../../../../../componentsV2/ChartAxisExtreme/ChartAxisExtremeDragTracker.js";import"../../../../../componentsV2/Autocomplete/Autocomplete.js";import"../../../../../componentsV2/Select/Select.js";import"../../../../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../../../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../../../../componentsV2/DatePicker/DatePicker.js";import"../../../../../componentsV2/DragHandle/DragHandle.js";import"../../../../../componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js";import"../../../../../componentsV2/Slider/constants.js";import"../../../../../componentsV2/Slider/components/SliderThumb.js";import"../../../../../componentsV2/Slider/Slider.scss.js";import"../../../../../componentsV2/SliderAdvanced/SliderAdvanced.js";import"react-color";import"../../../../../componentsV2/ColorPicker/Swatches/Swatches.scss.js";import"../../../../../componentsV2/ColorPicker/OpacityDragtracker/OpacityDragTracker.scss.js";import"../../../../../componentsV2/ColorPicker/ColorPicker.scss.js";import"../../../../../componentsV2/ChartHelper/ChartHelper.scss.js";import"../../../../../componentsV2/Hotkey/Hotkey.js";import"@tanstack/react-query";import"../../../../../componentsV2/InterventionEventSelector/useInterventionUnitEvents.js";import"../../../../../componentsV2/InterventionEventSelector/InterventionEventSelector.scss.js";import"../../../../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.css.js";import"../../../../Icons/AnnotationIcon.js";import"../../../../HelpCenter/HelpCenterIcon.js";import"../../../../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/RestoreAppSizeButton.css.js";import"../../../../DevCenter/DevCenterAppContainer/DevCenterAppContainer.scss.js";import"../../../../Toaster/Toaster.js";import"../../../../DevCenter/NavigationBar/NavigationBar.js";import"../../../../DevCenter/SideBar/SideBar.js";import"../../../../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../../../../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../../../../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../../../../AssetEditor/index.js";import"../../../../LoadingIndicator/LoadingIndicator.js";import"../../../../Typography.js";import"../../../../RealTimeValuesSidebar/RealTimeSidebar.js";import"../../../../CollapsableSidebar.js";import"../../../../DateTimePicker/index.js";import"../../../../DatePicker/index.js";import"../../../../SlateFormattedText/SlateFormattedText.js";import"../../../../SlateFormattedText/RenderElements.js";import"slate";import"../../../../ParameterCharts/ParameterCharts.js";import"../../../../ParameterCharts/AddEditTrack.js";import"../../../../ChartActionsList/ChartActionsList.js";import"../../../../CopyToClipboard/CopyToClipboard.js";import"../../../../AssetEditor/AssetEditorAutocomplete.js";import"../../../../AssetEditor/SingleAssetEditor.js";import"../../../../SettingEditors/ColorEditor/style.css.js";import"../../../../SettingEditors/DropdownEditor/index.js";import"../../../../SwitchControl/index.js";import"../../../../ColorPicker/ColorPicker.js";import"../../../../Chart/components/ChartButton.js";import"../../../../Chart/components/ChartButtons.js";import"../../../../Chart/components/ChartWrapper.js";import"../../../../Chart/components/AxisDropdown.js";import"../../../../Chart/components/ChartSelect.js";import"../../../../Chart/ChartWrapperContext.js";import"../../../../Chart/effects/useChartModifier.js";import"../../../../Chart/components/buttons/HideAxesButton.js";import"../../../../Chart/components/buttons/ChartTypeButton.js";import"../../../../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../../../../TruncatedText/index.js";import"../../../../MiddleTruncatedText/MiddleTruncatedText.js";import"../../../../RangeSlider/constants.js";import"../../../../RangeSlider/Input.css.js";import"../../../../RangeSlider/RangeSlider.css.js";import"../../../../AdvancedSlider/AdvancedSlider.js";import"../../../../Breadcrumbs/index.js";import"../../../../VirtualizedTable/index.js";import"../../../../EmptyView/EmptyView.js";import"../../../../EmptyView/EmptyAppView/EmptyAppView.js";import"../../../../ContextMenuItem/index.js";import"../../../../FolderMenuItem/index.js";import"../../../../EditableItem/EditableItem/index.js";import"../../../../EditableItem/EditableItemWithBadge/index.js";import"../../../../Checkbox/index.js";import"../../../../FolderMenuItemWithLinks/index.js";import"../../../../TextField/index.js";import"../../../../Chip/index.js";import"../../../../Counter/index.js";import"../../../../AnchorsList/AnchorsList.js";import"../../../../Select/index.js";import"../../../../Select/SelectFilterBy.js";import"../../../../CustomSelect/index.js";import"../../../../Tabs/Tabs.js";import"../../../../Tabs/Tab.js";import"../../../../ResizableTable/ResizableTable.js";import"../../../../GradientPicker/GradientPicker.js";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"../../../../GradientManager/GradientPreview/GradientPreview.js";import"../../../../GradientManager/GradientSelect.scss.js";import"../../../../GradientManager/GradientManager.styles.js";import"../../../../Drillstring/BHASchematic.js";import"../../../../Drillstring/BHATable/index.js";import"../../../../Drillstring/BHAComponentIcon.js";import"../../../../Drillstring/BHAComponentDetail/index.js";import"../../../../Drillstring/BHATileIcon.js";import"../../../../Drillstring/BHATile/BHATile.js";import"../../../../Drillstring/BHAList/BHAList.js";import"../../../../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../../../CasingTable/index.js";import u from"../../../CasingComponentIcon.js";import"../../../CasingTileIcon.js";import"../../CasingTableV2.js";import"../../../CasingTile/CasingTile.js";import"../../../../WellSummary/WellSummaryItemLabel.js";import"../../../../WellSummary/WellSummaryItemTitle.js";import"../../../../WellSummary/WellSummaryItemValue.js";import"../../../../WellSummary/ActivitySummaryChart.js";import"../../../../WellSummary/FracWirelineTimeChart.js";import"../../../../BICOffsetPickerDialog/index.js";import"../../../../OffsetWellButton/OffsetWellButton.js";import"../../../../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../../../../OffsetWellPickerV3/index.js";import"../../../../OffsetWellChips/Chip.js";import"../../../../OffsetWellChips/ChipsContainer.js";import"../../../../OffsetWellPickerV5/components/OffsetWellPickerV5WithStore/OffsetWellPickerV5WithStore.js";import"mapbox-gl/dist/mapbox-gl.css";import"@material-ui/icons/Info";import"@material-ui/icons/Block";import"../../../../OffsetWellMap/WellTooltip.module.css.js";import"../../../../OffsetWellMap/OffsetWellMap.module.css.js";import"../../../../../config/mapboxGl/index.js";import"../../../../../config/mapbox/index.js";import"react-dom";import"@material-ui/core/Snackbar";import"../../../../Notifications/Toast.js";import"../../../../Notifications/Notifications.scss.js";import"../../../../TextLink/index.js";import"../../../../Avatar/index.js";import"../../../../Template/TemplatePopover/index.js";import"../../../../Template/TemplateSharingDialog/index.js";import"../../../../MenuItem/index.js";import"../../../../MiddleTruncate/MiddleTruncate.js";import"../../../../PinnableFilters/PinnableFilters.js";import"../../../../HeaderLayout/HeaderLayout.js";import"../../../../PadOffsetsPicker/PadOffsetsPicker.js";import"../../../../PadOffsetsPicker/OffsetAssetChip.js";import"../../../../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../../../../PadOffsetsPicker/StagesSelector.js";import"../../../../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../../../../Table/TableToolbar/TableToolbar.js";import"../../../../Table/TableContainer/TableContainer.js";import"../../../../Table/TableCell/TableCell.js";import"../../../../Table/TablePagination/TablePagination.js";import"../../../../Table/TablePaginationActions/TablePaginationActions.js";import"../../../../Tooltip/ScrollableTooltip.js";import"../../../../PriceInput/PriceInput.js";import"../../../../LabelsCounter/LabelsCounter.js";import"../../../../Stepper/Stepper.js";import"../../../../Stepper/Step/Step.js";import"../../../../Stepper/StepsWrapper.js";import"../../../../Comment/CommentIcon/index.js";import"../../../../FilesLoader/FilesLoader.js";import"../../../../../componentsV2/FileIcon/icons/ArchiveFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/CSVFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/DocFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/EDMFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/ExcelFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/ImageFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/JsonFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/LasFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/OtherFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/PdfFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/PowerPointFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/TxtFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/UnknownFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/VideoFileIcon.js";import"../../../../../componentsV2/FileIcon/icons/XmlFileIcon.js";import"../../../../SearchInput/index.js";import"../../../../FeedItem/FeedItem.js";import"../../../../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../../../../PostInput/PostInput.js";import"../../../../KeyboardDateTimePicker.js";import"../../../../AddComment/Popover.js";import"../../../../AddComment/Popup.js";import"../../../../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../../../../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../../../../StageDesignVActual/ComparisonHeader.js";import"../../../../StageDesignVActual/ComparisonRow.js";import"../../../../EmbeddedApp/DevCenterEmbeddedApp.js";import"../../../../EmbeddedApp/EmbeddedApp.js";import"../../../../Autocomplete/Autocomplete.js";import"../../../../DocumentViewer/DocumentViewer.js";import"../../../../ColorPickerPalette/ColorPickerPalette.js";import"../../../../Search/Search.js";import"../../../../Search/components/Listbox.js";import"../../../../Search/components/Paper.js";import"../../../../Search/components/RecentSearches.js";import"../../../../Search/components/Groups.js";import"../../../../Search/components/SelectAllListItem.js";import"../../../../StatusBadge/index.js";import"../../../../Attachment/index.js";import"../../../../EmojiIconButton.js";import"../../../../FileUploadIconButton.js";import"../../../../FilePreview/index.js";import"../../../../FailedFileUploading.js";import"../../../../UserMention/index.js";import"../../../../CommentsInfo/index.js";import"../../../../CommentInput/index.js";import"../../../../Comment/index.js";import"../../../../CommentLoader.js";import"../../../../AssetNameLabel/AssetStatusBadge.js";import"../../../../AssetEditorV2/components/PrimaryAssetSelect.js";import"../../../../AssetEditorV2/components/SecondaryAssetSelect.js";import"../../../../AssetEditorV2/components/SelectItem.js";import"../../../../AssetEditorV2/components/MultipleAssetsToggle.js";import"../../../../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../../../../EChartsWrapper/EChartsWrapper.js";import"../../../../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../../../../GoogleDocsViewer/index.js";import"../../../../NewDocumentViewer/effects/useFileContent.js";import"../../../../NewDocumentViewer/styles.js";import"../../../../FilesLoaderV2/styles.js";import"../../../../FilesDropzone/styles.js";import"../../../../FilesProcessor/styles.js";import"../../../../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../../../../Formula/useFormulaStyles.js";import"../../../../Formula/RootXIcon.js";import"../../../../Formula/FormulaTextEditor.js";import"../../../../Formula/CloseSuggestion.js";import"../../../../Formula/SuggestionsMenu.js";import"../../../../CommentCard/CommentCard.js";import"@material-ui/icons/AlternateEmail";import"../../../../AttachFileButton/AttachFileButton.scss.js";import"../../../../CommentInputNext/CommentInputNext.js";import"../../../../UserMention/utils/index.js";import"react-s3-uploader/s3upload";import"../../../../CommentComposer/CommentMetaLine.scss.js";import"../../../../CommentComposer/ChatChannelSelector.scss.js";import"../../../../CommentComposer/ShareToChatRow.scss.js";import"../../../../CommentComposer/CommentComposer.scss.js";import"../../../../AttachmentPreview/AttachmentPreview.js";import"../../../../AttachmentPreview/AttachmentImage.js";import"../../../../AttachmentPreview/AttachmentPreview.scss.js";import"../../../../CommentPin/CommentPin.js";import"../../../../FeedCard/FeedCard.js";import"../../../../FeedItemCard/FeedItemCard.js";import"../../../../NewCommentCursor/NewCommentCursor.js";import"../../../../LinkedText/LinkedText.js";import"../../../../FeedItem/feedItemTypes/AlertFeedItem.js";import"../../../../FeedItem/feedItemTypes/PostFeedItem.js";import"../../../../FeedItem/feedItemTypes/GeosteeringFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingOperationalNoteFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingOperationSummaryFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillingDailyCostFeedItem.js";import"../../../../FeedItem/feedItemTypes/DocumentFeedItem.js";import"../../../../FeedItem/feedItemTypes/DrillerMemoFeedItem.js";import"../../../../FeedItem/feedItemTypes/NptFeedItem.js";import"../../../../FeedItem/feedItemTypes/SurveyStationFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/LessonsLearnedFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/TracesMemoFeedItem.js";import"../../../../FeedItem/feedItemTypes/DepthCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionOperationalNoteFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionOperationSummaryFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionDailyCostFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionDocumentFeedItem.js";import"../../../../FeedItem/feedItemTypes/CompletionNptFeedItem.js";import"../../../../FeedItem/feedItemTypes/StageOverviewFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/AppAnnotationFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/WellPlanFeedItem/index.js";import"../../../../FeedItem/feedItemTypes/FluidReportFeedItem.js";import"../../../../FeedItem/feedItemTypes/BhaFeedItem/BhaFeedItem.js";import"../../../../FeedItem/feedItemTypes/DvDCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/PCCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/HookloadCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/NptLessonsCommentFeedItem.js";import"../../../../FeedItem/feedItemTypes/GenericDataCommentFeedItem.js";import{CancelButton as C}from"../../../../Drillstring/BHAComponentsTable/components/shared/CancelButton.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/ExpandCollapseButton.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/FormatedNumber.js";import{InputText as I}from"../../../../Drillstring/BHAComponentsTable/components/shared/InputText.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/MoreButton.js";import{SaveButton as A}from"../../../../Drillstring/BHAComponentsTable/components/shared/SaveButton.js";import{SelectField as g}from"../../../../Drillstring/BHAComponentsTable/components/shared/SelectField.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/StaticField.js";import{SharedEditorElements as h}from"../../../../Drillstring/BHAComponentsTable/components/shared/SharedEditorElements.js";import"../../../../Drillstring/BHAComponentsTable/components/shared/ConfirmationPopup.js";import V from"../../../../Drillstring/BHAComponentsTable/components/Suggestions/Suggestions.js";import{useStyles as S}from"../../../../Drillstring/BHAComponentsTable/components/sharedStyles.js";function T(e){var s=e.component,T=e.error,F=void 0===T?null:T,v=e.onChange,D=e.onCancel,b=e.onSave,x=e.onUseSuggestion,P=e.columns,f=S({isMobile:p}),y=p?r/2:r/P,B=function(e){return F&&F[e]},E=o((function(){var e=a;return s.outer_diameter?e.filter((function(e){return e.outer_diameter===parseFloat(s.outer_diameter)})):[]}),[s.outer_diameter]);return m(n,{container:!0,spacing:0,className:f.editorContainer,children:[!p&&c(n,{item:!0,className:f.editorComponentSize,children:c(u,{component:s})}),c(n,{item:!0,className:f.eidtorContentContainer,children:m(n,{container:!0,spacing:2,children:[c(h,{component:s,getError:B,onChange:v,isCasing:!0}),E.length>0&&c(V,{data:E,allData:a,columns:i,displayKeys:["outer_diameter","inner_diameter"],descriptionKeys:["outer_diameter","inner_diameter","linear_weight","number_of_joints","component_length"],onSelect:x,isCasing:!0}),c(I,{type:"name",label:"Name",value:s.name,error:B("name"),xs:y,onChangeField:v}),c(I,{type:"number_of_joints",label:"# of Joints",value:s.number_of_joints,error:B("number_of_joints"),xs:y,onChangeField:v}),c(I,{type:"component_length",label:"Component Length",unit:"length",value:s.component_length,error:B("component_length"),xs:y,onChangeField:v}),c(I,{type:"weight",label:"T.Weight",unit:"mass",value:s.weight,error:B("weight"),disabled:!0,xs:y,onChangeField:v}),c(g,{type:"grade",options:l,label:"Grade",value:s.grade,error:B("grade"),xs:y,onChangeField:v}),c(I,{type:"outer_diameter_tooljoint",label:"TJ OD",unit:"shortLength",value:s.outer_diameter_tooljoint,error:B("outer_diameter_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"inner_diameter_tooljoint",label:"TJ ID",unit:"shortLength",value:s.inner_diameter_tooljoint,error:B("inner_diameter_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"length_tooljoint",label:"TJ Length Per Joint",unit:"length",value:s.length_tooljoint,error:B("length_tooljoint"),xs:y,onChangeField:v}),c(I,{type:"connection_type",label:"Connection Type",value:s.connection_type,error:B("connection_type"),xs:y,onChangeField:v}),c(g,{type:"class",options:d,label:"Class",value:s.class,error:B("class"),xs:y,onChangeField:v}),c(g,{type:"material",options:j,label:"Material",value:s.material,error:B("material"),xs:y,onChangeField:v})]})}),!p&&m(n,{item:!0,className:f.eidtorActionGroup,children:[c(C,{handleCancel:D}),c(A,{handleSave:b,disabled:!t(F)})]})]})}T.propTypes={component:s.shape({outer_diameter:s.number,component_length:s.number,name:s.string,number_of_joints:s.number,weight:s.number,connection_type:s.string,grade:s.string,class:s.string,material:s.string,outer_diameter_tooljoint:s.number,inner_diameter_tooljoint:s.number,length_tooljoint:s.number}).isRequired,error:s.shape({}),onChange:s.func.isRequired,onCancel:s.func.isRequired,onSave:s.func.isRequired,onUseSuggestion:s.func.isRequired,columns:s.number.isRequired};var F=e(T);export{F as default};
2
2
  //# sourceMappingURL=Editor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.js","sources":["../../../../../../src/components/Casing/CasingTableV2/components/DrillPipe/Editor.js"],"sourcesContent":["import { memo, useMemo } from 'react';\nimport { isEmpty } from 'lodash';\nimport PropTypes from 'prop-types';\nimport { Grid } from '@material-ui/core';\n\nimport { CONTAINER_XS, OD_ID_DEP_COLUMNS } from '../constants';\n\nimport { isMobileDetected } from '~/utils/mobileDetect';\nimport { CasingComponentIcon as ComponentIcon } from '~/components';\nimport {\n COMPONENT_GRADES,\n COMPONENT_CLASSES,\n COMPONENT_MATERIALS,\n OD_ID_DEP_LIST,\n} from '~/constants/casing';\nimport {\n InputText,\n SelectField,\n CancelButton,\n SaveButton,\n SharedEditorElements,\n} from '~/components/Drillstring/BHAComponentsTable/components/shared';\nimport { Suggestions } from '~/components/Drillstring/BHAComponentsTable/components/Suggestions';\nimport { useStyles } from '~/components/Drillstring/BHAComponentsTable/components/sharedStyles';\n\nfunction DrillPipe({\n component,\n error = null,\n onChange,\n onCancel,\n onSave,\n onUseSuggestion,\n columns,\n}) {\n const classes = useStyles({ isMobile: isMobileDetected });\n const xs = isMobileDetected ? CONTAINER_XS / 2 : CONTAINER_XS / columns;\n\n const getError = key => error && error[key];\n\n const filteredSuggestions = useMemo(() => {\n const suggestionsToUse = OD_ID_DEP_LIST;\n return !component.outer_diameter\n ? []\n : suggestionsToUse.filter(\n item => item.outer_diameter === parseFloat(component.outer_diameter)\n );\n }, [component.outer_diameter]);\n\n return (\n <Grid container spacing={0} className={classes.editorContainer}>\n {!isMobileDetected && (\n <Grid item className={classes.editorComponentSize}>\n <ComponentIcon component={component} />\n </Grid>\n )}\n <Grid item className={classes.eidtorContentContainer}>\n <Grid container spacing={2}>\n <SharedEditorElements\n component={component}\n getError={getError}\n onChange={onChange}\n isCasing\n />\n\n {filteredSuggestions.length > 0 && (\n <Suggestions\n data={filteredSuggestions}\n allData={OD_ID_DEP_LIST}\n columns={OD_ID_DEP_COLUMNS}\n displayKeys={['outer_diameter', 'inner_diameter']}\n descriptionKeys={[\n 'outer_diameter',\n 'inner_diameter',\n 'linear_weight',\n 'number_of_joints',\n 'component_length',\n ]}\n onSelect={onUseSuggestion}\n isCasing\n />\n )}\n\n <InputText\n type=\"name\"\n label=\"Name\"\n value={component.name}\n error={getError('name')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"number_of_joints\"\n label=\"# of Joints\"\n value={component.number_of_joints}\n error={getError('number_of_joints')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"component_length\"\n label=\"Component Length\"\n unit=\"length\"\n value={component.component_length}\n error={getError('component_length')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"weight\"\n label=\"T.Weight\"\n unit=\"mass\"\n value={component.weight}\n error={getError('weight')}\n disabled\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"grade\"\n options={COMPONENT_GRADES}\n label=\"Grade\"\n value={component.grade}\n error={getError('grade')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"outer_diameter_tooljoint\"\n label=\"TJ OD\"\n unit=\"shortLength\"\n value={component.outer_diameter_tooljoint}\n error={getError('outer_diameter_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"inner_diameter_tooljoint\"\n label=\"TJ ID\"\n unit=\"shortLength\"\n value={component.inner_diameter_tooljoint}\n error={getError('inner_diameter_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"length_tooljoint\"\n label=\"TJ Length Per Joint\"\n unit=\"length\"\n value={component.length_tooljoint}\n error={getError('length_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"connection_type\"\n label=\"Connection Type\"\n value={component.connection_type}\n error={getError('connection_type')}\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"class\"\n options={COMPONENT_CLASSES}\n label=\"Class\"\n value={component.class}\n error={getError('class')}\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"material\"\n options={COMPONENT_MATERIALS}\n label=\"Material\"\n value={component.material}\n error={getError('material')}\n xs={xs}\n onChangeField={onChange}\n />\n </Grid>\n </Grid>\n {!isMobileDetected && (\n <Grid item className={classes.eidtorActionGroup}>\n <CancelButton handleCancel={onCancel} />\n <SaveButton handleSave={onSave} disabled={!isEmpty(error)} />\n </Grid>\n )}\n </Grid>\n );\n}\n\nDrillPipe.propTypes = {\n component: PropTypes.shape({\n outer_diameter: PropTypes.number,\n component_length: PropTypes.number,\n name: PropTypes.string,\n number_of_joints: PropTypes.number,\n weight: PropTypes.number,\n connection_type: PropTypes.string,\n grade: PropTypes.string,\n class: PropTypes.string,\n material: PropTypes.string,\n outer_diameter_tooljoint: PropTypes.number,\n inner_diameter_tooljoint: PropTypes.number,\n length_tooljoint: PropTypes.number,\n }).isRequired,\n error: PropTypes.shape({}),\n onChange: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n onUseSuggestion: PropTypes.func.isRequired,\n columns: PropTypes.number.isRequired,\n};\n\nexport default memo(DrillPipe);\n"],"names":["DrillPipe","_ref","component","_ref$error","error","onChange","onCancel","onSave","onUseSuggestion","columns","classes","useStyles","isMobile","isMobileDetected","xs","CONTAINER_XS","getError","key","filteredSuggestions","useMemo","suggestionsToUse","OD_ID_DEP_LIST","outer_diameter","filter","item","parseFloat","_jsxs","Grid","container","spacing","className","editorContainer","children","_jsx","editorComponentSize","ComponentIcon","eidtorContentContainer","SharedEditorElements","isCasing","length","Suggestions","data","allData","OD_ID_DEP_COLUMNS","displayKeys","descriptionKeys","onSelect","InputText","type","label","value","name","onChangeField","number_of_joints","unit","component_length","weight","disabled","SelectField","options","COMPONENT_GRADES","grade","outer_diameter_tooljoint","inner_diameter_tooljoint","length_tooljoint","connection_type","COMPONENT_CLASSES","class","COMPONENT_MATERIALS","material","eidtorActionGroup","CancelButton","handleCancel","SaveButton","handleSave","isEmpty","propTypes","PropTypes","shape","number","string","isRequired","func","memo"],"mappings":"i/gCAyBA,SAASA,EAQNC,GAAA,IAPDC,IAAAA,UAASC,EAAAF,EACTG,MAAAA,aAAQ,KAAID,EACZE,IAAAA,SACAC,IAAAA,SACAC,IAAAA,OACAC,IAAAA,gBACAC,IAAAA,QAEMC,EAAUC,EAAU,CAAEC,SAAUC,IAChCC,EAAKD,EAAmBE,EAAe,EAAIA,EAAeN,EAE1DO,EAAW,SAAAC,GAAG,OAAIb,GAASA,EAAMa,EAAI,EAErCC,EAAsBC,GAAQ,WAClC,IAAMC,EAAmBC,EACzB,OAAQnB,EAAUoB,eAEdF,EAAiBG,QACf,SAAAC,GAAI,OAAIA,EAAKF,iBAAmBG,WAAWvB,EAAUoB,mBAFvD,EAIN,GAAG,CAACpB,EAAUoB,iBAEd,OACEI,EAACC,EAAI,CAACC,WAAS,EAACC,QAAS,EAAGC,UAAWpB,EAAQqB,gBAAgBC,SAAA,EAC3DnB,GACAoB,EAACN,EAAI,CAACH,MAAI,EAACM,UAAWpB,EAAQwB,oBAAoBF,SAChDC,EAACE,EAAa,CAACjC,UAAWA,MAG9B+B,EAACN,EAAI,CAACH,MAAI,EAACM,UAAWpB,EAAQ0B,uBAAuBJ,SACnDN,EAACC,EAAI,CAACC,WAAS,EAACC,QAAS,EAAEG,SAAA,CACzBC,EAACI,EAAoB,CACnBnC,UAAWA,EACXc,SAAUA,EACVX,SAA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sources":["../../../../../../src/components/Casing/CasingTableV2/components/DrillPipe/Editor.js"],"sourcesContent":["import { memo, useMemo } from 'react';\nimport { isEmpty } from 'lodash';\nimport PropTypes from 'prop-types';\nimport { Grid } from '@material-ui/core';\n\nimport { CONTAINER_XS, OD_ID_DEP_COLUMNS } from '../constants';\n\nimport { isMobileDetected } from '~/utils/mobileDetect';\nimport { CasingComponentIcon as ComponentIcon } from '~/components';\nimport {\n COMPONENT_GRADES,\n COMPONENT_CLASSES,\n COMPONENT_MATERIALS,\n OD_ID_DEP_LIST,\n} from '~/constants/casing';\nimport {\n InputText,\n SelectField,\n CancelButton,\n SaveButton,\n SharedEditorElements,\n} from '~/components/Drillstring/BHAComponentsTable/components/shared';\nimport { Suggestions } from '~/components/Drillstring/BHAComponentsTable/components/Suggestions';\nimport { useStyles } from '~/components/Drillstring/BHAComponentsTable/components/sharedStyles';\n\nfunction DrillPipe({\n component,\n error = null,\n onChange,\n onCancel,\n onSave,\n onUseSuggestion,\n columns,\n}) {\n const classes = useStyles({ isMobile: isMobileDetected });\n const xs = isMobileDetected ? CONTAINER_XS / 2 : CONTAINER_XS / columns;\n\n const getError = key => error && error[key];\n\n const filteredSuggestions = useMemo(() => {\n const suggestionsToUse = OD_ID_DEP_LIST;\n return !component.outer_diameter\n ? []\n : suggestionsToUse.filter(\n item => item.outer_diameter === parseFloat(component.outer_diameter)\n );\n }, [component.outer_diameter]);\n\n return (\n <Grid container spacing={0} className={classes.editorContainer}>\n {!isMobileDetected && (\n <Grid item className={classes.editorComponentSize}>\n <ComponentIcon component={component} />\n </Grid>\n )}\n <Grid item className={classes.eidtorContentContainer}>\n <Grid container spacing={2}>\n <SharedEditorElements\n component={component}\n getError={getError}\n onChange={onChange}\n isCasing\n />\n\n {filteredSuggestions.length > 0 && (\n <Suggestions\n data={filteredSuggestions}\n allData={OD_ID_DEP_LIST}\n columns={OD_ID_DEP_COLUMNS}\n displayKeys={['outer_diameter', 'inner_diameter']}\n descriptionKeys={[\n 'outer_diameter',\n 'inner_diameter',\n 'linear_weight',\n 'number_of_joints',\n 'component_length',\n ]}\n onSelect={onUseSuggestion}\n isCasing\n />\n )}\n\n <InputText\n type=\"name\"\n label=\"Name\"\n value={component.name}\n error={getError('name')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"number_of_joints\"\n label=\"# of Joints\"\n value={component.number_of_joints}\n error={getError('number_of_joints')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"component_length\"\n label=\"Component Length\"\n unit=\"length\"\n value={component.component_length}\n error={getError('component_length')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"weight\"\n label=\"T.Weight\"\n unit=\"mass\"\n value={component.weight}\n error={getError('weight')}\n disabled\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"grade\"\n options={COMPONENT_GRADES}\n label=\"Grade\"\n value={component.grade}\n error={getError('grade')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"outer_diameter_tooljoint\"\n label=\"TJ OD\"\n unit=\"shortLength\"\n value={component.outer_diameter_tooljoint}\n error={getError('outer_diameter_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"inner_diameter_tooljoint\"\n label=\"TJ ID\"\n unit=\"shortLength\"\n value={component.inner_diameter_tooljoint}\n error={getError('inner_diameter_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"length_tooljoint\"\n label=\"TJ Length Per Joint\"\n unit=\"length\"\n value={component.length_tooljoint}\n error={getError('length_tooljoint')}\n xs={xs}\n onChangeField={onChange}\n />\n <InputText\n type=\"connection_type\"\n label=\"Connection Type\"\n value={component.connection_type}\n error={getError('connection_type')}\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"class\"\n options={COMPONENT_CLASSES}\n label=\"Class\"\n value={component.class}\n error={getError('class')}\n xs={xs}\n onChangeField={onChange}\n />\n <SelectField\n type=\"material\"\n options={COMPONENT_MATERIALS}\n label=\"Material\"\n value={component.material}\n error={getError('material')}\n xs={xs}\n onChangeField={onChange}\n />\n </Grid>\n </Grid>\n {!isMobileDetected && (\n <Grid item className={classes.eidtorActionGroup}>\n <CancelButton handleCancel={onCancel} />\n <SaveButton handleSave={onSave} disabled={!isEmpty(error)} />\n </Grid>\n )}\n </Grid>\n );\n}\n\nDrillPipe.propTypes = {\n component: PropTypes.shape({\n outer_diameter: PropTypes.number,\n component_length: PropTypes.number,\n name: PropTypes.string,\n number_of_joints: PropTypes.number,\n weight: PropTypes.number,\n connection_type: PropTypes.string,\n grade: PropTypes.string,\n class: PropTypes.string,\n material: PropTypes.string,\n outer_diameter_tooljoint: PropTypes.number,\n inner_diameter_tooljoint: PropTypes.number,\n length_tooljoint: PropTypes.number,\n }).isRequired,\n error: PropTypes.shape({}),\n onChange: PropTypes.func.isRequired,\n onCancel: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n onUseSuggestion: PropTypes.func.isRequired,\n columns: PropTypes.number.isRequired,\n};\n\nexport default memo(DrillPipe);\n"],"names":["DrillPipe","_ref","component","_ref$error","error","onChange","onCancel","onSave","onUseSuggestion","columns","classes","useStyles","isMobile","isMobileDetected","xs","CONTAINER_XS","getError","key","filteredSuggestions","useMemo","suggestionsToUse","OD_ID_DEP_LIST","outer_diameter","filter","item","parseFloat","_jsxs","Grid","container","spacing","className","editorContainer","children","_jsx","editorComponentSize","ComponentIcon","eidtorContentContainer","SharedEditorElements","isCasing","length","Suggestions","data","allData","OD_ID_DEP_COLUMNS","displayKeys","descriptionKeys","onSelect","InputText","type","label","value","name","onChangeField","number_of_joints","unit","component_length","weight","disabled","SelectField","options","COMPONENT_GRADES","grade","outer_diameter_tooljoint","inner_diameter_tooljoint","length_tooljoint","connection_type","COMPONENT_CLASSES","class","COMPONENT_MATERIALS","material","eidtorActionGroup","CancelButton","handleCancel","SaveButton","handleSave","isEmpty","propTypes","PropTypes","shape","number","string","isRequired","func","memo"],"mappings":"8whCAyBA,SAASA,EAQ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AAS,YAChBF,GAAIA,EACJsC,cAAe/C,UAInBQ,GACAa,EAACC,EAAI,CAACH,MAAI,EAACM,UAAWpB,EAAQ4D,kBAAkBtC,SAAA,CAC9CC,EAACsC,EAAY,CAACC,aAAclE,IAC5B2B,EAACwC,EAAU,CAACC,WAAYnE,EAAQkD,UAAWkB,EAAQvE,UAK7D,CAEAJ,EAAU4E,UAAY,CACpB1E,UAAW2E,EAAUC,MAAM,CACzBxD,eAAgBuD,EAAUE,OAC1BxB,iBAAkBsB,EAAUE,OAC5B5B,KAAM0B,EAAUG,OAChB3B,iBAAkBwB,EAAUE,OAC5BvB,OAAQqB,EAAUE,OAClBd,gBAAiBY,EAAUG,OAC3BnB,MAAOgB,EAAUG,OACjBb,MAAOU,EAAUG,OACjBX,SAAUQ,EAAUG,OACpBlB,yBAA0Be,EAAUE,OACpChB,yBAA0Bc,EAAUE,OACpCf,iBAAkBa,EAAUE,SAC3BE,WACH7E,MAAOyE,EAAUC,MAAM,IACvBzE,SAAUwE,EAAUK,KAAKD,WACzB3E,SAAUuE,EAAUK,KAAKD,WACzB1E,OAAQsE,EAAUK,KAAKD,WACvBzE,gBAAiBqE,EAAUK,KAAKD,WAChCxE,QAASoE,EAAUE,OAAOE,YAG5B,IAAeE,EAAAA,EAAKnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAttachmentUpload.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/useAttachmentUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA4C,MAAM,OAAO,CAAC;AAG9E,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,8CAA8C,CAAC;AAOtD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,Q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M,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAcF,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAkD1C,eAAO,MAAM,mBAAmB,kEAO7B,0BAA0B;;;;8BAwMjB,WAAW,CAAC,gBAAgB,CAAC;sBApD7B,IAAI,EAAE;0BA7BR,MAAM;2BA6FP,qBAAqB,CAAC,IAAI,CAAC;sBAW3B,qBAAqB,CAAC,IAAI,CAAC;qCAcnB,qBAAqB,CAAC,IAAI,CAAC,EAAE;;;;;;;CA0H7C,CAAC"}
@@ -1,2 +1,2 @@
1
- import r from"@babel/runtime/helpers/toConsumableArray";import e from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import i from"@babel/runtime/regenerator";import{useState as o,useRef as u,useCallback as l,useEffect as c}from"react";import a from"react-s3-uploader/s3upload";import{getAttachmentKind as f}from"../AttachmentPreview/getAttachmentKind.js";import{ACCEPTED_ATTACHMENT_TYPES as s}from"../AttachFileButton/AttachFileButton.js";import{getS3SignedUrl as d,getS3DownloadLink as p}from"../../clients/jsonApi/index.js";import{getUrlFileName as v}from"../../utils/links.js";function m(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function h(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?m(Object(t),!0).forEach((function(e){n(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}var g=10,b=function(r){return r.type.startsWith("image/")?"image":r.type.startsWith("video/")?"video":"file"},w=function(r){return(r/1048576).toFixed(1)},U=function(r){return{id:r.url,name:r.name,file:null,previewUrl:"",isUploading:!1,error:null,uploaded:r}},y=0,j=function(){return"attachment-".concat(y+=1)},O=function(n){var m,g,y=n.value,O=n.onChange,k=n.onError,F=n.maxSizeBytes,x=n.maxFiles,L=void 0===x?10:x,P=n.accept,A=void 0===P?s:P,S=o([]),z=t(S,2),E=z[0],R=z[1],B=u(null),D=u(new Map),C=u(new Map),M=u([]),W=u(O),T=u(k);W.current=O,T.current=k;var I=u([]),Y=l((function(r){var e=r(M.current);M.current=e,R(e),I.current=function(r){return r.map((function(r){return r.uploaded})).filter(Boolean)}(e),W.current(I.current)}),[]),_=l((function(r,e){return Y((function(n){return n.map((function(n){return n.id===r?h(h({},n),e):n}))}))}),[Y]),G=l((function(r){var e,n;null===(e=D.current.get(r))||void 0===e||e.abortUpload(),D.current.delete(r),C.current.set(r,(null!==(n=C.current.get(r))&&void 0!==n?n:0)+1)}),[]),K=l((function(r){null!=r&&r.previewUrl&&URL.revokeObjectURL(r.previewUrl)}),[]),q=l((function(){var r,e,n;null===(r=T.current)||void 0===r||r.call(T,null!==(e=null===(n=M.current.find((function(r){return r.error})))||void 0===n?void 0:n.error)&&void 0!==e?e:null)}),[]);c((function(){return function(){D.current.forEach((function(r){return r.abortUpload()})),D.current.clear(),M.current.forEach((function(r){r.previewUrl&&URL.revokeObjectURL(r.previewUrl)}))}}),[]);var H=l((function(r,n){var t,o=(null!==(t=C.current.get(r))&&void 0!==t?t:0)+1;C.current.set(r,o);var u,l,c=function(){return C.current.get(r)===o},f=function(e){var n;c()&&(_(r,{isUploading:!1,error:e}),null===(n=T.current)||void 0===n||n.call(T,e))},s="",v=new a({files:[n],preprocess:function(r,e){return e(r)},onProgress:function(){},getSignedUrl:(l=e(i.mark((function r(e,n){var t;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,d(e.name,e.type);case 3:t=r.sent,s=t.file_name,n(h(h({},t),{},{signedUrl:t.signed_url})),r.next=11;break;case 8:r.prev=8,r.t0=r.catch(0),f((null===r.t0||void 0===r.t0?void 0:r.t0.message)||"Failed to upload the file");case 11:case"end":return r.stop()}}),r,null,[[0,8]])}))),function(r,e){return l.apply(this,arguments)}),onFinishS3Put:(u=e(i.mark((function e(){var t,o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p(s);case 3:if(t=e.sent,o=t.url,c()){e.next=7;break}return e.abrupt("return");case 7:D.current.delete(r),_(r,{isUploading:!1,error:null,uploaded:{url:o,name:s,size:n.size}}),q(),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),f((null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Failed to upload the file");case 15:case"end":return e.stop()}}),e,null,[[0,12]])}))),function(){return u.apply(this,arguments)}),onError:function(r){return f(r||"Failed to upload the file")}});D.current.set(r,v)}),[_,q]),J=l((function(e){var n,t=v(e);t&&(M.current.length>=L?null===(n=T.current)||void 0===n||n.call(T,"You can attach up to ".concat(L," files.")):M.current.some((function(r){var n;return(null===(n=r.uploaded)||void 0===n?void 0:n.url)===e}))||Y((function(n){return[].concat(r(n),[{id:j(),name:t,file:null,previewUrl:e,isUploading:!1,error:null,uploaded:{url:e,name:t}}])})))}),[Y,L]),N=l((function(e){var n,t,i,o,u=e.filter((function(r){return function(r,e){return e.split(",").map((function(r){return r.trim().toLowerCase()})).filter(Boolean).some((function(e){if(e.startsWith("."))return r.name.toLowerCase().endsWith(e);if(e.endsWith("/*")){var n=r.type.toLowerCase();return n?n.startsWith(e.slice(0,-1)):f({name:r.name})===e.slice(0,-1)}return r.type.toLowerCase()===e}))}(r,A)})),l=u.length<e.length?1===e.length?"That file type is not supported.":"Some files were skipped — unsupported file type.":null,c="You can attach up to ".concat(L," files."),a=L-M.current.length;if(!u.length||a<=0){var s;null===(s=T.current)||void 0===s||s.call(T,u.length?c:l)}else{var d=u.slice(0,a),p=d.map((function(r){var e=b(r),n=!!F&&r.size>F;return{id:j(),name:r.name,file:r,previewUrl:"file"===e?"":URL.createObjectURL(r),isUploading:!n,error:n?"File is too large (".concat(w(r.size)," MB). Maximum size is ").concat(w(F)," MB."):null,uploaded:null}}));Y((function(e){return[].concat(r(e),r(p))}));var v=u.length>d.length?c:null;null===(n=T.current)||void 0===n||n.call(T,null!==(t=null!==(i=null===(o=M.current.find((function(r){return r.error})))||void 0===o?void 0:o.error)&&void 0!==i?i:l)&&void 0!==t?t:v),p.filter((function(r){return!r.error})).forEach((function(r){return H(r.id,r.file)}))}}),[Y,L,F,H,A]),Q=l((function(r){var e,n=Array.from(null!==(e=r.target.files)&&void 0!==e?e:[]);B.current&&(B.current.value=""),n.length&&N(n)}),[N]),V=l((function(){var r;return null===(r=B.current)||void 0===r?void 0:r.click()}),[]),X=l((function(r){var e=String(r);G(e),K(M.current.find((function(r){return r.id===e}))),Y((function(r){return r.filter((function(r){return r.id!==e}))})),q()}),[G,K,Y,q]),Z=l((function(r){var e=String(r),n=M.current.find((function(r){return r.id===e}));null!=n&&n.file&&(G(e),_(e,{isUploading:!0,error:null}),q(),H(e,n.file))}),[G,_,H,q]),$=l((function(e){return Y((function(n){var t=new Map(n.map((function(r){return[r.id,r]}))),i=e.map((function(r){return t.get(String(r))})).filter(Boolean),o=n.filter((function(r){return!e.some((function(e){return String(e)===r.id}))}));return[].concat(r(i),r(o))}))}),[Y]),rr=l((function(){var r;M.current.forEach((function(r){G(r.id),K(r)})),Y((function(){return[]})),null===(r=T.current)||void 0===r||r.call(T,null)}),[G,Y,K]);c((function(){var r,e,n;(e=I.current,n=y,e.length===n.length&&e.every((function(r,e){return r.url===n[e].url})))||(M.current.forEach((function(r){G(r.id),r.previewUrl&&URL.revokeObjectURL(r.previewUrl)})),M.current=y.map(U),I.current=y,R(M.current),null===(r=T.current)||void 0===r||r.call(T,null))}),[y,G]);var er=o({}),nr=t(er,2),tr=nr[0],ir=nr[1],or=u(tr);or.current=tr;var ur=E.filter((function(r){return!r.file&&!r.previewUrl&&r.uploaded})).map((function(r){return r.uploaded.name})).join("|");return c((function(){var r=ur.split("|").filter((function(r){return r&&!(r in or.current)}));if(r.length){var e=!0;return Promise.all(r.map((function(r){return p(r,"inline").then((function(e){var n=e.url;return[r,n]})).catch((function(e){return console.error('Failed to sign stored attachment "'.concat(r,'"'),e),[r,""]}))}))).then((function(r){e&&ir((function(e){return h(h({},e),Object.fromEntries(r))}))})),function(){e=!1}}}),[ur]),{items:E.reduce((function(r,e){var n;if(e.file)return r.push({id:e.id,name:e.name,src:e.previewUrl,kind:b(e.file),size:e.file.size,isUploading:e.isUploading,hideDownload:!0,error:null!==(n=e.error)&&void 0!==n?n:void 0}),r;var t=e.uploaded,i=f(t),o=e.previewUrl||tr[t.name];return"file"===i||o?(r.push({id:e.id,name:t.name,src:o,kind:i,size:t.size,hideDownload:!0}),r):r}),[]),fileInputRef:B,openFileDialog:V,handleFileSelect:Q,addFiles:N,addLinkedImage:J,removeAttachment:X,handleRetry:Z,reorderAttachments:$,clearAttachments:rr,isUploading:E.some((function(r){return r.isUploading})),error:null!==(m=null===(g=E.find((function(r){return r.error})))||void 0===g?void 0:g.error)&&void 0!==m?m:null,count:E.length,isFull:E.length>=L,maxFiles:L}};export{g as DEFAULT_MAX_ATTACHMENTS,O as useAttachmentUpload};
1
+ import r from"@babel/runtime/helpers/toConsumableArray";import e from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import i from"@babel/runtime/regenerator";import{useState as o,useRef as u,useCallback as l,useEffect as c}from"react";import a from"react-s3-uploader/s3upload";import{getAttachmentKind as f}from"../AttachmentPreview/getAttachmentKind.js";import{ACCEPTED_ATTACHMENT_TYPES as s}from"../AttachFileButton/AttachFileButton.js";import{getS3SignedUrl as d}from"../../clients/jsonApi/index.js";import{getUrlFileName as p}from"../../utils/links.js";import{getSignedLink as v,peekSignedLink as m}from"../../utils/signedLinkCache.js";function h(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function g(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?h(Object(t),!0).forEach((function(e){n(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}var b=10,w=function(r){return r.type.startsWith("image/")?"image":r.type.startsWith("video/")?"video":"file"},U=function(r){return(r/1048576).toFixed(1)},y=function(r){return{id:r.url,name:r.name,file:null,previewUrl:"",isUploading:!1,error:null,uploaded:r}},j=0,O=function(){return"attachment-".concat(j+=1)},k=function(n){var h,b,j=n.value,k=n.onChange,F=n.onError,x=n.maxSizeBytes,L=n.maxFiles,P=void 0===L?10:L,A=n.accept,S=void 0===A?s:A,z=o([]),E=t(z,2),R=E[0],B=E[1],C=u(null),D=u(new Map),M=u(new Map),W=u([]),T=u(k),I=u(F);T.current=k,I.current=F;var Y=u([]),_=l((function(r){var e=r(W.current);W.current=e,B(e),Y.current=function(r){return r.map((function(r){return r.uploaded})).filter(Boolean)}(e),T.current(Y.current)}),[]),G=l((function(r,e){return _((function(n){return n.map((function(n){return n.id===r?g(g({},n),e):n}))}))}),[_]),K=l((function(r){var e,n;null===(e=D.current.get(r))||void 0===e||e.abortUpload(),D.current.delete(r),M.current.set(r,(null!==(n=M.current.get(r))&&void 0!==n?n:0)+1)}),[]),q=l((function(r){null!=r&&r.previewUrl&&URL.revokeObjectURL(r.previewUrl)}),[]),H=l((function(){var r,e,n;null===(r=I.current)||void 0===r||r.call(I,null!==(e=null===(n=W.current.find((function(r){return r.error})))||void 0===n?void 0:n.error)&&void 0!==e?e:null)}),[]);c((function(){return function(){D.current.forEach((function(r){return r.abortUpload()})),D.current.clear(),W.current.forEach((function(r){r.previewUrl&&URL.revokeObjectURL(r.previewUrl)}))}}),[]);var J=l((function(r,n){var t,o=(null!==(t=M.current.get(r))&&void 0!==t?t:0)+1;M.current.set(r,o);var u,l,c=function(){return M.current.get(r)===o},f=function(e){var n;c()&&(G(r,{isUploading:!1,error:e}),null===(n=I.current)||void 0===n||n.call(I,e))},s="",p=new a({files:[n],preprocess:function(r,e){return e(r)},onProgress:function(){},getSignedUrl:(l=e(i.mark((function r(e,n){var t;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,d(e.name,e.type);case 3:t=r.sent,s=t.file_name,n(g(g({},t),{},{signedUrl:t.signed_url})),r.next=11;break;case 8:r.prev=8,r.t0=r.catch(0),f((null===r.t0||void 0===r.t0?void 0:r.t0.message)||"Failed to upload the file");case 11:case"end":return r.stop()}}),r,null,[[0,8]])}))),function(r,e){return l.apply(this,arguments)}),onFinishS3Put:(u=e(i.mark((function e(){var t;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v(s);case 3:if(t=e.sent,c()){e.next=6;break}return e.abrupt("return");case 6:D.current.delete(r),G(r,{isUploading:!1,error:null,uploaded:{url:t,name:s,size:n.size}}),H(),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),f((null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Failed to upload the file");case 14:case"end":return e.stop()}}),e,null,[[0,11]])}))),function(){return u.apply(this,arguments)}),onError:function(r){return f(r||"Failed to upload the file")}});D.current.set(r,p)}),[G,H]),N=l((function(e){var n,t=p(e);t&&(W.current.length>=P?null===(n=I.current)||void 0===n||n.call(I,"You can attach up to ".concat(P," files.")):W.current.some((function(r){var n;return(null===(n=r.uploaded)||void 0===n?void 0:n.url)===e}))||_((function(n){return[].concat(r(n),[{id:O(),name:t,file:null,previewUrl:e,isUploading:!1,error:null,uploaded:{url:e,name:t}}])})))}),[_,P]),Q=l((function(e){var n,t,i,o,u=e.filter((function(r){return function(r,e){return e.split(",").map((function(r){return r.trim().toLowerCase()})).filter(Boolean).some((function(e){if(e.startsWith("."))return r.name.toLowerCase().endsWith(e);if(e.endsWith("/*")){var n=r.type.toLowerCase();return n?n.startsWith(e.slice(0,-1)):f({name:r.name})===e.slice(0,-1)}return r.type.toLowerCase()===e}))}(r,S)})),l=u.length<e.length?1===e.length?"That file type is not supported.":"Some files were skipped — unsupported file type.":null,c="You can attach up to ".concat(P," files."),a=P-W.current.length;if(!u.length||a<=0){var s;null===(s=I.current)||void 0===s||s.call(I,u.length?c:l)}else{var d=u.slice(0,a),p=d.map((function(r){var e=w(r),n=!!x&&r.size>x;return{id:O(),name:r.name,file:r,previewUrl:"file"===e?"":URL.createObjectURL(r),isUploading:!n,error:n?"File is too large (".concat(U(r.size)," MB). Maximum size is ").concat(U(x)," MB."):null,uploaded:null}}));_((function(e){return[].concat(r(e),r(p))}));var v=u.length>d.length?c:null;null===(n=I.current)||void 0===n||n.call(I,null!==(t=null!==(i=null===(o=W.current.find((function(r){return r.error})))||void 0===o?void 0:o.error)&&void 0!==i?i:l)&&void 0!==t?t:v),p.filter((function(r){return!r.error})).forEach((function(r){return J(r.id,r.file)}))}}),[_,P,x,J,S]),V=l((function(r){var e,n=Array.from(null!==(e=r.target.files)&&void 0!==e?e:[]);C.current&&(C.current.value=""),n.length&&Q(n)}),[Q]),X=l((function(){var r;return null===(r=C.current)||void 0===r?void 0:r.click()}),[]),Z=l((function(r){var e=String(r);K(e),q(W.current.find((function(r){return r.id===e}))),_((function(r){return r.filter((function(r){return r.id!==e}))})),H()}),[K,q,_,H]),$=l((function(r){var e=String(r),n=W.current.find((function(r){return r.id===e}));null!=n&&n.file&&(K(e),G(e,{isUploading:!0,error:null}),H(),J(e,n.file))}),[K,G,J,H]),rr=l((function(e){return _((function(n){var t=new Map(n.map((function(r){return[r.id,r]}))),i=e.map((function(r){return t.get(String(r))})).filter(Boolean),o=n.filter((function(r){return!e.some((function(e){return String(e)===r.id}))}));return[].concat(r(i),r(o))}))}),[_]),er=l((function(){var r;W.current.forEach((function(r){K(r.id),q(r)})),_((function(){return[]})),null===(r=I.current)||void 0===r||r.call(I,null)}),[K,_,q]);c((function(){var r,e,n;(e=Y.current,n=j,e.length===n.length&&e.every((function(r,e){return r.url===n[e].url})))||(W.current.forEach((function(r){K(r.id),r.previewUrl&&URL.revokeObjectURL(r.previewUrl)})),W.current=j.map(y),Y.current=j,B(W.current),null===(r=I.current)||void 0===r||r.call(I,null))}),[j,K]);var nr=o((function(){return j.reduce((function(r,e){var n=m(e.name,"inline");return n&&(r[e.name]=n),r}),{})})),tr=t(nr,2),ir=tr[0],or=tr[1],ur=u(ir);ur.current=ir;var lr=R.filter((function(r){return!r.file&&!r.previewUrl&&r.uploaded})).map((function(r){return r.uploaded.name})).join("|");return c((function(){var r=lr.split("|").filter((function(r){return r&&!(r in ur.current)}));if(r.length){var e=!0;return Promise.all(r.map((function(r){return v(r,"inline").then((function(e){return[r,e]})).catch((function(e){return console.error('Failed to sign stored attachment "'.concat(r,'"'),e),[r,""]}))}))).then((function(r){e&&or((function(e){return g(g({},e),Object.fromEntries(r))}))})),function(){e=!1}}}),[lr]),{items:R.reduce((function(r,e){var n;if(e.file)return r.push({id:e.id,name:e.name,src:e.previewUrl,kind:w(e.file),size:e.file.size,isUploading:e.isUploading,hideDownload:!0,error:null!==(n=e.error)&&void 0!==n?n:void 0}),r;var t=e.uploaded,i=f(t),o=e.previewUrl||ir[t.name];return"file"===i||o?(r.push({id:e.id,name:t.name,src:o,kind:i,size:t.size,hideDownload:!0}),r):r}),[]),fileInputRef:C,openFileDialog:X,handleFileSelect:V,addFiles:Q,addLinkedImage:N,removeAttachment:Z,handleRetry:$,reorderAttachments:rr,clearAttachments:er,isUploading:R.some((function(r){return r.isUploading})),error:null!==(h=null===(b=R.find((function(r){return r.error})))||void 0===b?void 0:b.error)&&void 0!==h?h:null,count:R.length,isFull:R.length>=P,maxFiles:P}};export{b as DEFAULT_MAX_ATTACHMENTS,k as useAttachmentUpload};
2
2
  //# sourceMappingURL=useAttachmentUpload.js.map