@burdenoff/microfe-movethewheels 2026.930.4 → 2026.1010.1

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 (377) hide show
  1. package/dist/MoveTheWheelsRoot.js +177 -102
  2. package/dist/MoveTheWheelsRoutes.js +55 -11
  3. package/dist/_virtual/_rolldown/runtime.js +1 -1
  4. package/dist/components/ContainerEvidencePicker.js +143 -0
  5. package/dist/components/FreeTimeAgreementForm.js +496 -0
  6. package/dist/components/ReturnInstructionForm.js +108 -0
  7. package/dist/components/ReuseControls.js +91 -0
  8. package/dist/components/ReusePermissionForm.js +114 -0
  9. package/dist/components/ReuseProposalForm.js +455 -0
  10. package/dist/components/ReuseSourceFields.js +78 -0
  11. package/dist/components/consolidation/ConsolidationHistory.js +244 -0
  12. package/dist/components/consolidation/ConsolidationLotEditor.js +133 -0
  13. package/dist/components/consolidation/ConsolidationManifestWorkbench.js +143 -0
  14. package/dist/components/consolidation/ConsolidationPlanForm.js +172 -0
  15. package/dist/components/consolidation/ConsolidationPlanWorkbench.js +321 -0
  16. package/dist/components/consolidation/ConsolidationReportForm.js +94 -0
  17. package/dist/components/consolidation/ConsolidationReportsWorkbench.js +195 -0
  18. package/dist/components/consolidation/ConsolidationSummary.js +76 -0
  19. package/dist/components/consolidation/OriginalConsolidationHistory.js +112 -0
  20. package/dist/components/freight-cost/FreightDraftForm.js +213 -0
  21. package/dist/components/freight-cost/FreightFields.js +70 -0
  22. package/dist/components/freight-cost/FreightFxEditor.js +90 -0
  23. package/dist/components/freight-cost/FreightHistory.js +164 -0
  24. package/dist/components/freight-cost/FreightLineEditor.js +191 -0
  25. package/dist/components/freight-cost/FreightScopeEditor.js +72 -0
  26. package/dist/components/freight-cost/FreightTotals.js +66 -0
  27. package/dist/components/logistics-procedure/ProcedureDecisionForm.js +197 -0
  28. package/dist/components/logistics-procedure/ProcedureFields.js +31 -0
  29. package/dist/components/logistics-procedure/ProcedureHistory.js +177 -0
  30. package/dist/components/logistics-procedure/ProcedurePolicyForm.js +227 -0
  31. package/dist/components/logistics-procedure/ProcedurePolicyWorkbench.js +155 -0
  32. package/dist/components/logistics-procedure/ProcedureReviewWorkbench.js +221 -0
  33. package/dist/components/logistics-procedure/ProcedureRunWorkbench.js +190 -0
  34. package/dist/components/logistics-procedure/ProcedureSubjectPicker.js +130 -0
  35. package/dist/components/pending-pick/PendingPickDraft.js +84 -0
  36. package/dist/components/pending-pick/PendingPickHistory.js +113 -0
  37. package/dist/components/pending-pick/PickCapture.js +166 -0
  38. package/dist/components/pending-pick/PickLineSelection.js +111 -0
  39. package/dist/components/stock-binding/StockAssessmentDraft.js +48 -0
  40. package/dist/components/stock-binding/StockAssessmentHistory.js +61 -0
  41. package/dist/components/stock-binding/StockAssessmentSummary.js +199 -0
  42. package/dist/components/stock-binding/StockFactForm.js +232 -0
  43. package/dist/components/stock-observation/StockIssueForm.js +148 -0
  44. package/dist/components/stock-observation/StockIssueHistory.js +116 -0
  45. package/dist/components/stock-observation/StockIssueReadPanel.js +70 -0
  46. package/dist/components/trip-utilization/TripReportForm.js +118 -0
  47. package/dist/components/trip-utilization/TripReportHistory.js +54 -0
  48. package/dist/components/trip-utilization/TripReportSummary.js +216 -0
  49. package/dist/components/trip-utilization/TripSegmentFields.js +166 -0
  50. package/dist/generated/consolidation-operations.d.ts +1060 -0
  51. package/dist/generated/container-condition-operations.d.ts +868 -0
  52. package/dist/generated/container-operations.d.ts +356 -0
  53. package/dist/generated/empty-reuse-operations.d.ts +1578 -0
  54. package/dist/generated/free-time-operations.d.ts +938 -0
  55. package/dist/generated/freight-cost-operations.d.ts +716 -0
  56. package/dist/generated/logistics-procedure-operations.d.ts +938 -0
  57. package/dist/generated/pending-pick-operations.d.ts +1969 -0
  58. package/dist/generated/stock-binding-operations.d.ts +930 -0
  59. package/dist/generated/stock-observation-operations.d.ts +476 -0
  60. package/dist/generated/trip-utilization-operations.d.ts +651 -0
  61. package/dist/generated/wspace-operations.d.ts +143 -50
  62. package/dist/hooks/useConsolidationAction.js +119 -0
  63. package/dist/hooks/useContainerCondition.js +105 -0
  64. package/dist/hooks/useContainerLifecycle.js +192 -0
  65. package/dist/hooks/useEmptyReuseAction.js +45 -0
  66. package/dist/hooks/useFreightRecoveryAction.js +117 -0
  67. package/dist/hooks/useInventory.js +12 -1
  68. package/dist/hooks/useProcedureAction.js +119 -0
  69. package/dist/hooks/useProcedureSelection.js +53 -0
  70. package/dist/hooks/useReuseRecoveryAction.js +116 -0
  71. package/dist/movethewheels/components/ContainerEvidencePicker.d.ts +10 -0
  72. package/dist/movethewheels/components/FreeTimeAgreementForm.d.ts +14 -0
  73. package/dist/movethewheels/components/ReturnInstructionForm.d.ts +8 -0
  74. package/dist/movethewheels/components/ReuseControls.d.ts +42 -0
  75. package/dist/movethewheels/components/ReusePermissionForm.d.ts +9 -0
  76. package/dist/movethewheels/components/ReuseProposalForm.d.ts +11 -0
  77. package/dist/movethewheels/components/ReuseSourceFields.d.ts +9 -0
  78. package/dist/movethewheels/components/consolidation/ConsolidationHistory.d.ts +13 -0
  79. package/dist/movethewheels/components/consolidation/ConsolidationLotEditor.d.ts +6 -0
  80. package/dist/movethewheels/components/consolidation/ConsolidationManifestWorkbench.d.ts +8 -0
  81. package/dist/movethewheels/components/consolidation/ConsolidationPlanForm.d.ts +8 -0
  82. package/dist/movethewheels/components/consolidation/ConsolidationPlanWorkbench.d.ts +5 -0
  83. package/dist/movethewheels/components/consolidation/ConsolidationReportForm.d.ts +9 -0
  84. package/dist/movethewheels/components/consolidation/ConsolidationReportsWorkbench.d.ts +7 -0
  85. package/dist/movethewheels/components/consolidation/ConsolidationSummary.d.ts +6 -0
  86. package/dist/movethewheels/components/consolidation/OriginalConsolidationHistory.d.ts +8 -0
  87. package/dist/movethewheels/components/freight-cost/FreightDraftForm.d.ts +8 -0
  88. package/dist/movethewheels/components/freight-cost/FreightFields.d.ts +23 -0
  89. package/dist/movethewheels/components/freight-cost/FreightFxEditor.d.ts +6 -0
  90. package/dist/movethewheels/components/freight-cost/FreightHistory.d.ts +5 -0
  91. package/dist/movethewheels/components/freight-cost/FreightLineEditor.d.ts +8 -0
  92. package/dist/movethewheels/components/freight-cost/FreightScopeEditor.d.ts +6 -0
  93. package/dist/movethewheels/components/freight-cost/FreightTotals.d.ts +6 -0
  94. package/dist/movethewheels/components/logistics-procedure/ProcedureDecisionForm.d.ts +20 -0
  95. package/dist/movethewheels/components/logistics-procedure/ProcedureFields.d.ts +17 -0
  96. package/dist/movethewheels/components/logistics-procedure/ProcedureHistory.d.ts +7 -0
  97. package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyForm.d.ts +10 -0
  98. package/dist/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.d.ts +5 -0
  99. package/dist/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.d.ts +5 -0
  100. package/dist/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.d.ts +6 -0
  101. package/dist/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.d.ts +7 -0
  102. package/dist/movethewheels/components/pending-pick/PendingPickDraft.d.ts +16 -0
  103. package/dist/movethewheels/components/pending-pick/PendingPickHistory.d.ts +5 -0
  104. package/dist/movethewheels/components/pending-pick/PickCapture.d.ts +6 -0
  105. package/dist/movethewheels/components/pending-pick/PickLineSelection.d.ts +17 -0
  106. package/dist/movethewheels/components/stock-binding/StockAssessmentDraft.d.ts +13 -0
  107. package/dist/movethewheels/components/stock-binding/StockAssessmentHistory.d.ts +18 -0
  108. package/dist/movethewheels/components/stock-binding/StockAssessmentSummary.d.ts +9 -0
  109. package/dist/movethewheels/components/stock-binding/StockFactForm.d.ts +6 -0
  110. package/dist/movethewheels/components/stock-observation/StockIssueForm.d.ts +7 -0
  111. package/dist/movethewheels/components/stock-observation/StockIssueHistory.d.ts +7 -0
  112. package/dist/movethewheels/components/stock-observation/StockIssueReadPanel.d.ts +5 -0
  113. package/dist/movethewheels/components/trip-utilization/TripReportForm.d.ts +6 -0
  114. package/dist/movethewheels/components/trip-utilization/TripReportHistory.d.ts +14 -0
  115. package/dist/movethewheels/components/trip-utilization/TripReportSummary.d.ts +5 -0
  116. package/dist/movethewheels/components/trip-utilization/TripSegmentFields.d.ts +9 -0
  117. package/dist/movethewheels/hooks/useConsolidationAction.d.ts +19 -0
  118. package/dist/movethewheels/hooks/useContainerCondition.d.ts +21 -0
  119. package/dist/movethewheels/hooks/useContainerLifecycle.d.ts +40 -0
  120. package/dist/movethewheels/hooks/useEmptyReuseAction.d.ts +14 -0
  121. package/dist/movethewheels/hooks/useFreightRecoveryAction.d.ts +23 -0
  122. package/dist/movethewheels/hooks/useProcedureAction.d.ts +18 -0
  123. package/dist/movethewheels/hooks/useProcedureSelection.d.ts +51 -0
  124. package/dist/movethewheels/hooks/useReuseRecoveryAction.d.ts +18 -0
  125. package/dist/movethewheels/pages/ConsolidationPage.d.ts +1 -0
  126. package/dist/movethewheels/pages/ContainerConditionPage.d.ts +1 -0
  127. package/dist/movethewheels/pages/ContainersPage.d.ts +2 -0
  128. package/dist/movethewheels/pages/EmptyReusePage.d.ts +1 -0
  129. package/dist/movethewheels/pages/FreeTimePage.d.ts +1 -0
  130. package/dist/movethewheels/pages/FreightEstimatePage.d.ts +1 -0
  131. package/dist/movethewheels/pages/LogisticsProceduresPage.d.ts +1 -0
  132. package/dist/movethewheels/pages/PendingPickPage.d.ts +1 -0
  133. package/dist/movethewheels/pages/StockBindingPage.d.ts +1 -0
  134. package/dist/movethewheels/pages/StockObservationsPage.d.ts +1 -0
  135. package/dist/movethewheels/pages/TripUtilizationPage.d.ts +1 -0
  136. package/dist/movethewheels/utils/consolidationHistoryTarget.d.ts +12 -0
  137. package/dist/movethewheels/utils/consolidationInput.d.ts +15 -0
  138. package/dist/movethewheels/utils/consolidationLot.d.ts +3 -0
  139. package/dist/movethewheels/utils/consolidationPins.d.ts +20 -0
  140. package/dist/movethewheels/utils/consolidationRecovery.d.ts +5 -0
  141. package/dist/movethewheels/utils/consolidationReportHead.d.ts +5 -0
  142. package/dist/movethewheels/utils/freeTimeDate.d.ts +1 -0
  143. package/dist/movethewheels/utils/freightAcknowledgement.d.ts +2 -0
  144. package/dist/movethewheels/utils/freightDraft.d.ts +36 -0
  145. package/dist/movethewheels/utils/freightRecovery.d.ts +5 -0
  146. package/dist/movethewheels/utils/graphqlClient.d.ts +2 -1
  147. package/dist/movethewheels/utils/pendingPickDraft.d.ts +8 -0
  148. package/dist/movethewheels/utils/procedureInput.d.ts +18 -0
  149. package/dist/movethewheels/utils/procedureRecovery.d.ts +5 -0
  150. package/dist/movethewheels/utils/reuseAttempt.d.ts +7 -0
  151. package/dist/movethewheels/utils/reuseForm.d.ts +6 -0
  152. package/dist/movethewheels/utils/reuseRecovery.d.ts +26 -0
  153. package/dist/movethewheels/utils/stockBindingForm.d.ts +23 -0
  154. package/dist/movethewheels/utils/stockBindingLabels.d.ts +10 -0
  155. package/dist/movethewheels/utils/stockObservationForm.d.ts +5 -0
  156. package/dist/movethewheels/utils/tripDraftContext.d.ts +25 -0
  157. package/dist/movethewheels/utils/tripUtilizationForm.d.ts +6 -0
  158. package/dist/node_modules/@react-leaflet/core/lib/component.js +5 -5
  159. package/dist/node_modules/fast-equals/dist/es/index.js +87 -74
  160. package/dist/node_modules/leaflet/dist/leaflet-src.js +8 -5
  161. package/dist/node_modules/lodash/_Stack.js +2 -1
  162. package/dist/node_modules/lucide-react/dist/esm/icons/clipboard-list.js +35 -0
  163. package/dist/node_modules/lucide-react/dist/esm/icons/repeat-2.js +22 -0
  164. package/dist/node_modules/react-leaflet/lib/MapContainer.js +3 -3
  165. package/dist/node_modules/react-smooth/es6/Animate.js +2 -2
  166. package/dist/node_modules/recharts/es6/cartesian/Area.js +13 -13
  167. package/dist/node_modules/recharts/es6/cartesian/Bar.js +9 -9
  168. package/dist/node_modules/recharts/es6/cartesian/Brush.js +12 -12
  169. package/dist/node_modules/recharts/es6/cartesian/CartesianAxis.js +7 -7
  170. package/dist/node_modules/recharts/es6/cartesian/CartesianGrid.js +13 -13
  171. package/dist/node_modules/recharts/es6/cartesian/ErrorBar.js +4 -4
  172. package/dist/node_modules/recharts/es6/cartesian/Line.js +10 -10
  173. package/dist/node_modules/recharts/es6/cartesian/ReferenceArea.js +3 -3
  174. package/dist/node_modules/recharts/es6/cartesian/ReferenceDot.js +3 -3
  175. package/dist/node_modules/recharts/es6/cartesian/ReferenceLine.js +4 -4
  176. package/dist/node_modules/recharts/es6/cartesian/XAxis.js +3 -3
  177. package/dist/node_modules/recharts/es6/cartesian/YAxis.js +3 -3
  178. package/dist/node_modules/recharts/es6/chart/AccessibilityManager.js +1 -1
  179. package/dist/node_modules/recharts/es6/chart/generateCategoricalChart.js +22 -22
  180. package/dist/node_modules/recharts/es6/component/Cursor.js +1 -1
  181. package/dist/node_modules/recharts/es6/component/DefaultLegendContent.js +11 -11
  182. package/dist/node_modules/recharts/es6/component/DefaultTooltipContent.js +6 -6
  183. package/dist/node_modules/recharts/es6/component/Label.js +14 -14
  184. package/dist/node_modules/recharts/es6/component/LabelList.js +6 -6
  185. package/dist/node_modules/recharts/es6/component/Legend.js +5 -5
  186. package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js +3 -3
  187. package/dist/node_modules/recharts/es6/component/Text.js +2 -2
  188. package/dist/node_modules/recharts/es6/component/Tooltip.js +3 -3
  189. package/dist/node_modules/recharts/es6/component/TooltipBoundingBox.js +2 -2
  190. package/dist/node_modules/recharts/es6/container/Layer.js +2 -2
  191. package/dist/node_modules/recharts/es6/container/Surface.js +2 -2
  192. package/dist/node_modules/recharts/es6/context/chartLayoutContext.js +2 -2
  193. package/dist/node_modules/recharts/es6/polar/Pie.js +13 -13
  194. package/dist/node_modules/recharts/es6/polar/PolarAngleAxis.js +8 -8
  195. package/dist/node_modules/recharts/es6/polar/PolarRadiusAxis.js +6 -6
  196. package/dist/node_modules/recharts/es6/shape/Cross.js +1 -1
  197. package/dist/node_modules/recharts/es6/shape/Curve.js +1 -1
  198. package/dist/node_modules/recharts/es6/shape/Dot.js +1 -1
  199. package/dist/node_modules/recharts/es6/shape/Polygon.js +4 -4
  200. package/dist/node_modules/recharts/es6/shape/Rectangle.js +4 -4
  201. package/dist/node_modules/recharts/es6/shape/Sector.js +1 -1
  202. package/dist/node_modules/recharts/es6/shape/Symbols.js +1 -1
  203. package/dist/node_modules/recharts/es6/shape/Trapezoid.js +4 -4
  204. package/dist/node_modules/recharts/es6/util/ActiveShapeUtils.js +9 -9
  205. package/dist/node_modules/recharts/es6/util/BarUtils.js +1 -1
  206. package/dist/node_modules/recharts/es6/util/CartesianUtils.js +1 -1
  207. package/dist/node_modules/recharts/es6/util/PolarUtils.js +1 -1
  208. package/dist/node_modules/recharts/es6/util/ReactUtils.js +2 -2
  209. package/dist/node_modules/recharts/es6/util/ReduceCSSCalc.js +1 -1
  210. package/dist/node_modules/recharts/es6/util/types.js +1 -1
  211. package/dist/node_modules/{react-is → recharts/node_modules/react-is}/cjs/react-is.development.js +2 -2
  212. package/dist/node_modules/{react-is → recharts/node_modules/react-is}/cjs/react-is.production.min.js +2 -2
  213. package/dist/node_modules/{react-is → recharts/node_modules/react-is}/index.js +2 -2
  214. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +97 -18
  215. package/dist/node_modules/zustand/esm/middleware.js +2 -2
  216. package/dist/pages/ConsolidationPage.js +76 -0
  217. package/dist/pages/ContainerConditionPage.js +972 -0
  218. package/dist/pages/ContainersPage.js +522 -0
  219. package/dist/pages/EmptyReusePage.js +777 -0
  220. package/dist/pages/FreeTimePage.js +657 -0
  221. package/dist/pages/FreightEstimatePage.js +284 -0
  222. package/dist/pages/InventoryPage.js +77 -73
  223. package/dist/pages/LogisticsProceduresPage.js +100 -0
  224. package/dist/pages/PendingPickPage.js +155 -0
  225. package/dist/pages/StockBindingPage.js +236 -0
  226. package/dist/pages/StockObservationsPage.js +168 -0
  227. package/dist/pages/TripUtilizationPage.js +227 -0
  228. package/dist/src/generated/consolidation-operations.js +505 -0
  229. package/dist/src/generated/container-condition-operations.js +208 -0
  230. package/dist/src/generated/container-operations.js +101 -0
  231. package/dist/src/generated/empty-reuse-operations.js +749 -0
  232. package/dist/src/generated/free-time-operations.js +235 -0
  233. package/dist/src/generated/freight-cost-operations.js +325 -0
  234. package/dist/src/generated/logistics-procedure-operations.js +362 -0
  235. package/dist/src/generated/pending-pick-operations.js +1128 -0
  236. package/dist/src/generated/stock-binding-operations.js +175 -0
  237. package/dist/src/generated/stock-observation-operations.js +93 -0
  238. package/dist/src/generated/trip-utilization-operations.js +140 -0
  239. package/dist/src/generated/wspace-operations.js +708 -0
  240. package/dist/utils/consolidationHistoryTarget.js +27 -0
  241. package/dist/utils/consolidationInput.js +21 -0
  242. package/dist/utils/consolidationLot.js +29 -0
  243. package/dist/utils/consolidationPins.js +13 -0
  244. package/dist/utils/consolidationRecovery.js +40 -0
  245. package/dist/utils/consolidationReportHead.js +18 -0
  246. package/dist/utils/freeTimeDate.js +26 -0
  247. package/dist/utils/freightAcknowledgement.js +8 -0
  248. package/dist/utils/freightDraft.js +125 -0
  249. package/dist/utils/freightRecovery.js +36 -0
  250. package/dist/utils/graphqlClient.js +28 -28
  251. package/dist/utils/pendingPickDraft.js +46 -0
  252. package/dist/utils/procedureInput.js +43 -0
  253. package/dist/utils/procedureRecovery.js +42 -0
  254. package/dist/utils/reuseAttempt.js +20 -0
  255. package/dist/utils/reuseForm.js +25 -0
  256. package/dist/utils/reuseRecovery.js +71 -0
  257. package/dist/utils/stockBindingForm.js +142 -0
  258. package/dist/utils/stockBindingLabels.js +23 -0
  259. package/dist/utils/stockObservationForm.js +55 -0
  260. package/dist/utils/tripDraftContext.js +19 -0
  261. package/dist/utils/tripUtilizationForm.js +60 -0
  262. package/package.json +19 -5
  263. package/src/generated/consolidation-operations.ts +1138 -0
  264. package/src/generated/container-condition-operations.ts +771 -0
  265. package/src/generated/container-operations.ts +376 -0
  266. package/src/generated/empty-reuse-operations.ts +1648 -0
  267. package/src/generated/free-time-operations.ts +814 -0
  268. package/src/generated/freight-cost-operations.ts +753 -0
  269. package/src/generated/logistics-procedure-operations.ts +1047 -0
  270. package/src/generated/pending-pick-operations.ts +1508 -0
  271. package/src/generated/stock-binding-operations.ts +631 -0
  272. package/src/generated/stock-observation-operations.ts +373 -0
  273. package/src/generated/trip-utilization-operations.ts +500 -0
  274. package/src/generated/wspace-operations.ts +116 -0
  275. package/src/movethewheels/MoveTheWheelsRoot.tsx +79 -0
  276. package/src/movethewheels/MoveTheWheelsRoutes.tsx +22 -0
  277. package/src/movethewheels/components/ContainerEvidencePicker.tsx +146 -0
  278. package/src/movethewheels/components/FreeTimeAgreementForm.tsx +483 -0
  279. package/src/movethewheels/components/ReturnInstructionForm.tsx +102 -0
  280. package/src/movethewheels/components/ReuseControls.tsx +138 -0
  281. package/src/movethewheels/components/ReusePermissionForm.tsx +123 -0
  282. package/src/movethewheels/components/ReuseProposalForm.tsx +484 -0
  283. package/src/movethewheels/components/ReuseSourceFields.tsx +80 -0
  284. package/src/movethewheels/components/consolidation/ConsolidationHistory.tsx +159 -0
  285. package/src/movethewheels/components/consolidation/ConsolidationLotEditor.tsx +144 -0
  286. package/src/movethewheels/components/consolidation/ConsolidationManifestWorkbench.tsx +168 -0
  287. package/src/movethewheels/components/consolidation/ConsolidationPlanForm.tsx +185 -0
  288. package/src/movethewheels/components/consolidation/ConsolidationPlanWorkbench.tsx +395 -0
  289. package/src/movethewheels/components/consolidation/ConsolidationReportForm.tsx +124 -0
  290. package/src/movethewheels/components/consolidation/ConsolidationReportsWorkbench.tsx +233 -0
  291. package/src/movethewheels/components/consolidation/ConsolidationSummary.tsx +84 -0
  292. package/src/movethewheels/components/consolidation/OriginalConsolidationHistory.tsx +133 -0
  293. package/src/movethewheels/components/freight-cost/FreightDraftForm.tsx +224 -0
  294. package/src/movethewheels/components/freight-cost/FreightFields.tsx +91 -0
  295. package/src/movethewheels/components/freight-cost/FreightFxEditor.tsx +98 -0
  296. package/src/movethewheels/components/freight-cost/FreightHistory.tsx +91 -0
  297. package/src/movethewheels/components/freight-cost/FreightLineEditor.tsx +192 -0
  298. package/src/movethewheels/components/freight-cost/FreightScopeEditor.tsx +64 -0
  299. package/src/movethewheels/components/freight-cost/FreightTotals.tsx +68 -0
  300. package/src/movethewheels/components/logistics-procedure/ProcedureDecisionForm.tsx +204 -0
  301. package/src/movethewheels/components/logistics-procedure/ProcedureFields.tsx +43 -0
  302. package/src/movethewheels/components/logistics-procedure/ProcedureHistory.tsx +102 -0
  303. package/src/movethewheels/components/logistics-procedure/ProcedurePolicyForm.tsx +226 -0
  304. package/src/movethewheels/components/logistics-procedure/ProcedurePolicyWorkbench.tsx +174 -0
  305. package/src/movethewheels/components/logistics-procedure/ProcedureReviewWorkbench.tsx +278 -0
  306. package/src/movethewheels/components/logistics-procedure/ProcedureRunWorkbench.tsx +292 -0
  307. package/src/movethewheels/components/logistics-procedure/ProcedureSubjectPicker.tsx +111 -0
  308. package/src/movethewheels/components/pending-pick/PendingPickDraft.tsx +82 -0
  309. package/src/movethewheels/components/pending-pick/PendingPickHistory.tsx +93 -0
  310. package/src/movethewheels/components/pending-pick/PickCapture.tsx +70 -0
  311. package/src/movethewheels/components/pending-pick/PickLineSelection.tsx +130 -0
  312. package/src/movethewheels/components/stock-binding/StockAssessmentDraft.tsx +52 -0
  313. package/src/movethewheels/components/stock-binding/StockAssessmentHistory.tsx +56 -0
  314. package/src/movethewheels/components/stock-binding/StockAssessmentSummary.tsx +108 -0
  315. package/src/movethewheels/components/stock-binding/StockFactForm.tsx +186 -0
  316. package/src/movethewheels/components/stock-observation/StockIssueForm.tsx +103 -0
  317. package/src/movethewheels/components/stock-observation/StockIssueHistory.tsx +96 -0
  318. package/src/movethewheels/components/stock-observation/StockIssueReadPanel.tsx +72 -0
  319. package/src/movethewheels/components/trip-utilization/TripReportForm.tsx +116 -0
  320. package/src/movethewheels/components/trip-utilization/TripReportHistory.tsx +51 -0
  321. package/src/movethewheels/components/trip-utilization/TripReportSummary.tsx +127 -0
  322. package/src/movethewheels/components/trip-utilization/TripSegmentFields.tsx +118 -0
  323. package/src/movethewheels/hooks/useConsolidationAction.ts +196 -0
  324. package/src/movethewheels/hooks/useContainerCondition.ts +129 -0
  325. package/src/movethewheels/hooks/useContainerLifecycle.ts +291 -0
  326. package/src/movethewheels/hooks/useEmptyReuseAction.ts +72 -0
  327. package/src/movethewheels/hooks/useFreightRecoveryAction.ts +201 -0
  328. package/src/movethewheels/hooks/useInventory.ts +2 -20
  329. package/src/movethewheels/hooks/useProcedureAction.ts +196 -0
  330. package/src/movethewheels/hooks/useProcedureSelection.ts +75 -0
  331. package/src/movethewheels/hooks/useReuseRecoveryAction.ts +192 -0
  332. package/src/movethewheels/pages/ConsolidationPage.tsx +70 -0
  333. package/src/movethewheels/pages/ContainerConditionPage.tsx +959 -0
  334. package/src/movethewheels/pages/ContainersPage.tsx +490 -0
  335. package/src/movethewheels/pages/EmptyReusePage.tsx +823 -0
  336. package/src/movethewheels/pages/FreeTimePage.tsx +720 -0
  337. package/src/movethewheels/pages/FreightEstimatePage.tsx +353 -0
  338. package/src/movethewheels/pages/InventoryPage.tsx +16 -2
  339. package/src/movethewheels/pages/LogisticsProceduresPage.tsx +86 -0
  340. package/src/movethewheels/pages/PendingPickPage.tsx +226 -0
  341. package/src/movethewheels/pages/StockBindingPage.tsx +299 -0
  342. package/src/movethewheels/pages/StockObservationsPage.tsx +181 -0
  343. package/src/movethewheels/pages/TripUtilizationPage.tsx +315 -0
  344. package/src/movethewheels/utils/consolidationHistoryTarget.ts +39 -0
  345. package/src/movethewheels/utils/consolidationInput.ts +70 -0
  346. package/src/movethewheels/utils/consolidationLot.ts +24 -0
  347. package/src/movethewheels/utils/consolidationPins.ts +52 -0
  348. package/src/movethewheels/utils/consolidationRecovery.ts +88 -0
  349. package/src/movethewheels/utils/consolidationReportHead.ts +29 -0
  350. package/src/movethewheels/utils/freeTimeDate.ts +31 -0
  351. package/src/movethewheels/utils/freightAcknowledgement.ts +31 -0
  352. package/src/movethewheels/utils/freightDraft.ts +170 -0
  353. package/src/movethewheels/utils/freightRecovery.ts +79 -0
  354. package/src/movethewheels/utils/graphqlClient.ts +14 -5
  355. package/src/movethewheels/utils/pendingPickDraft.ts +61 -0
  356. package/src/movethewheels/utils/procedureInput.ts +98 -0
  357. package/src/movethewheels/utils/procedureRecovery.ts +92 -0
  358. package/src/movethewheels/utils/reuseAttempt.ts +29 -0
  359. package/src/movethewheels/utils/reuseForm.ts +30 -0
  360. package/src/movethewheels/utils/reuseRecovery.ts +151 -0
  361. package/src/movethewheels/utils/stockBindingForm.ts +209 -0
  362. package/src/movethewheels/utils/stockBindingLabels.ts +41 -0
  363. package/src/movethewheels/utils/stockObservationForm.ts +73 -0
  364. package/src/movethewheels/utils/tripDraftContext.ts +61 -0
  365. package/src/movethewheels/utils/tripUtilizationForm.ts +105 -0
  366. package/src/operations/condition/container-condition.graphql +41 -0
  367. package/src/operations/consolidation/consolidation.graphql +490 -0
  368. package/src/operations/container/container-lifecycle.graphql +80 -0
  369. package/src/operations/empty-reuse/empty-reuse.graphql +737 -0
  370. package/src/operations/free-time/free-time.graphql +47 -0
  371. package/src/operations/freight-cost/freight.graphql +6 -0
  372. package/src/operations/logistics-procedure/procedure.graphql +15 -0
  373. package/src/operations/pending-pick/pending-pick.graphql +1122 -0
  374. package/src/operations/stock-binding/stock-binding.graphql +160 -0
  375. package/src/operations/stock-observation/stock-observation.graphql +20 -0
  376. package/src/operations/trip-utilization/trip-utilization.graphql +126 -0
  377. package/src/operations/wspace/container-evidence.graphql +6 -0
@@ -0,0 +1,657 @@
1
+ import { Clock as e } from "../node_modules/lucide-react/dist/esm/icons/clock.js";
2
+ import { useMoveTheWheels as t } from "../providers/MoveTheWheelsProvider.js";
3
+ import { Button as n, Input as r } from "../components/ui.js";
4
+ import { PageLayout as i } from "../components/PageLayout.js";
5
+ import { useConditionAction as a, useConditionQuery as o } from "../hooks/useContainerCondition.js";
6
+ import { ContainerEvidencePicker as ee } from "../components/ContainerEvidencePicker.js";
7
+ import { freeTimeIso as s } from "../utils/freeTimeDate.js";
8
+ import { FreeTimeAgreementForm as te } from "../components/FreeTimeAgreementForm.js";
9
+ import { DecideFreeExtensionDocument as ne, FreeAgreementsDocument as c, FreeClocksDocument as re, FreeContainersDocument as ie, FreeCyclesDocument as ae, FreeEventsDocument as oe, FreeExposureDocument as se, FreeExtensionsDocument as ce, OpenFreeClockDocument as le, RecordFreeAgreementDocument as ue, RequestFreeExtensionDocument as de } from "../src/generated/free-time-operations.js";
10
+ import { useState as l } from "react";
11
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
12
+ //#region src/movethewheels/pages/FreeTimePage.tsx
13
+ var p = "space-y-4 rounded-xl border bg-bg-surface p-5", m = "mt-1 w-full rounded-md border bg-bg-surface p-2 text-sm", h = 25;
14
+ function g({ page: e, offset: t, setOffset: r, busy: i }) {
15
+ return /* @__PURE__ */ f("div", {
16
+ className: "flex flex-wrap items-center gap-2",
17
+ children: [
18
+ /* @__PURE__ */ d(n, {
19
+ type: "button",
20
+ variant: "outline",
21
+ disabled: i || t === 0,
22
+ onClick: () => r(Math.max(0, t - h)),
23
+ children: "Previous"
24
+ }),
25
+ /* @__PURE__ */ d("span", {
26
+ className: "text-sm",
27
+ children: e ? `${e.total} records; page ${Math.floor(t / h) + 1}` : "Waiting for records"
28
+ }),
29
+ /* @__PURE__ */ d(n, {
30
+ type: "button",
31
+ variant: "outline",
32
+ disabled: i || !e?.hasMore || e.nextOffset == null || e.nextOffset > 1e4,
33
+ onClick: () => {
34
+ e?.nextOffset != null && r(e.nextOffset);
35
+ },
36
+ children: "Next"
37
+ })
38
+ ]
39
+ });
40
+ }
41
+ function _({ error: e, loading: t, children: n }) {
42
+ return /* @__PURE__ */ f(u, { children: [
43
+ e && /* @__PURE__ */ d("p", {
44
+ role: "alert",
45
+ children: e
46
+ }),
47
+ t && /* @__PURE__ */ d("p", {
48
+ role: "status",
49
+ children: "Loading records…"
50
+ }),
51
+ n
52
+ ] });
53
+ }
54
+ function v() {
55
+ let { workspaceId: n, tenantId: r, currentUser: a, apiGatewayUrl: o } = t();
56
+ return /* @__PURE__ */ d(i, {
57
+ title: "Free time and extension decisions",
58
+ subtitle: "Separate sourced commercial obligations, actual events and recorded counterparty decisions.",
59
+ icon: /* @__PURE__ */ d(e, { "aria-hidden": "true" }),
60
+ children: /* @__PURE__ */ d(y, {}, `${n}:${r}:${a?.id}:${o}`)
61
+ });
62
+ }
63
+ function y() {
64
+ let [e, t] = l(""), [i, v] = l(""), [y, b] = l(""), [x, fe] = l(0), [pe, me] = l(0), [he, S] = l(0), [ge, C] = l(0), [_e, w] = l(0), [T, E] = l(0), [D, O] = l("open"), [k, ve] = l("DEMURRAGE"), [A, j] = l(""), [M, ye] = l((/* @__PURE__ */ new Date()).toISOString()), [be, xe] = l(M), [N, P] = l(null), [F, I] = l([]), [L, R] = l(""), [z, Se] = l("ACCEPTED"), B = a(), V = o(ie, { pagination: {
65
+ limit: h,
66
+ offset: x
67
+ } }), H = o(ae, e ? {
68
+ containerId: e,
69
+ pagination: {
70
+ limit: h,
71
+ offset: pe
72
+ }
73
+ } : null), U = o(oe, i ? {
74
+ cycleId: i,
75
+ pagination: {
76
+ limit: h,
77
+ offset: he
78
+ }
79
+ } : null, B.revision), W = o(re, i ? {
80
+ cycleId: i,
81
+ pagination: {
82
+ limit: h,
83
+ offset: ge
84
+ }
85
+ } : null, B.revision), G = o(c, y ? {
86
+ clockId: y,
87
+ pagination: {
88
+ limit: h,
89
+ offset: _e
90
+ }
91
+ } : null, B.revision), K = o(c, y ? {
92
+ clockId: y,
93
+ pagination: {
94
+ limit: 1,
95
+ offset: 0
96
+ }
97
+ } : null, B.revision), q = o(ce, y ? {
98
+ clockId: y,
99
+ pagination: {
100
+ limit: h,
101
+ offset: T
102
+ }
103
+ } : null, B.revision), J = o(se, y ? {
104
+ clockId: y,
105
+ asOf: be
106
+ } : null, B.revision), Y = W.data?.mtwFreeTimeClockPage.items.find((e) => e.id === y), X = K.data?.mtwFreeTimeAgreementPage.items[0], Ce = q.data?.mtwFreeTimeExtensionPage.items.filter((e) => !e.decision) ?? [], Z = () => {
107
+ b(""), w(0), E(0), R(""), I([]), O("open"), j(""), P(null), B.resetFeedback();
108
+ }, Q = J.data?.mtwFreeTimeExposure, $ = G.data?.mtwFreeTimeAgreementPage.items.find((e) => e.id === Q?.agreementId) ?? (X?.id === Q?.agreementId ? X : void 0), we = () => {
109
+ if (!F.length) throw Error("Select exact decision/request evidence versions.");
110
+ return F.map(({ fileId: e, versionId: t }) => ({
111
+ fileId: e,
112
+ versionId: t
113
+ }));
114
+ };
115
+ return /* @__PURE__ */ f("div", {
116
+ className: "space-y-6",
117
+ children: [
118
+ /* @__PURE__ */ d("p", {
119
+ className: "rounded-lg border p-4 text-sm",
120
+ children: "These are estimates under recorded source terms. Separate storage, demurrage and detention may overlap commercially; they are not automatically merged or summed across currencies. An extension changes the clock only after external acceptance is recorded. This service does not negotiate or certify acceptance."
121
+ }),
122
+ /* @__PURE__ */ f("section", {
123
+ className: p,
124
+ "aria-label": "Container and commercial obligation",
125
+ children: [
126
+ /* @__PURE__ */ f("label", {
127
+ className: "block",
128
+ children: ["Container", /* @__PURE__ */ f("select", {
129
+ className: m,
130
+ value: e,
131
+ disabled: B.busy,
132
+ onChange: (e) => {
133
+ t(e.target.value), v(""), me(0), S(0), C(0), Z();
134
+ },
135
+ children: [/* @__PURE__ */ d("option", {
136
+ value: "",
137
+ children: "Choose container"
138
+ }), V.data?.mtwContainerPage.items.map((e) => /* @__PURE__ */ d("option", {
139
+ value: e.id,
140
+ children: e.containerNumber
141
+ }, e.id))]
142
+ })]
143
+ }),
144
+ /* @__PURE__ */ d(_, {
145
+ error: V.error,
146
+ loading: V.loading,
147
+ children: /* @__PURE__ */ d(g, {
148
+ page: V.data?.mtwContainerPage,
149
+ offset: x,
150
+ busy: V.loading || B.busy,
151
+ setOffset: (e) => {
152
+ fe(e), t(""), v(""), Z();
153
+ }
154
+ })
155
+ }),
156
+ /* @__PURE__ */ f("label", {
157
+ className: "block",
158
+ children: ["Usage cycle", /* @__PURE__ */ f("select", {
159
+ className: m,
160
+ value: i,
161
+ disabled: !e || B.busy,
162
+ onChange: (e) => {
163
+ v(e.target.value), S(0), C(0), Z();
164
+ },
165
+ children: [/* @__PURE__ */ d("option", {
166
+ value: "",
167
+ children: "Choose cycle"
168
+ }), H.data?.mtwContainerCyclePage.items.map((e) => /* @__PURE__ */ f("option", {
169
+ value: e.id,
170
+ children: [
171
+ e.bookingReference ?? e.id,
172
+ " — ",
173
+ e.status,
174
+ " — ",
175
+ e.openedAt
176
+ ]
177
+ }, e.id))]
178
+ })]
179
+ }),
180
+ /* @__PURE__ */ d(_, {
181
+ error: H.error,
182
+ loading: H.loading,
183
+ children: /* @__PURE__ */ d(g, {
184
+ page: H.data?.mtwContainerCyclePage,
185
+ offset: pe,
186
+ busy: H.loading || B.busy,
187
+ setOffset: (e) => {
188
+ me(e), v(""), Z();
189
+ }
190
+ })
191
+ }),
192
+ /* @__PURE__ */ f("label", {
193
+ className: "block",
194
+ children: ["Commercial obligation", /* @__PURE__ */ f("select", {
195
+ className: m,
196
+ value: y,
197
+ disabled: !i || B.busy,
198
+ onChange: (e) => {
199
+ b(e.target.value), w(0), E(0), R(""), I([]), O("correct"), P(null), B.resetFeedback();
200
+ },
201
+ children: [/* @__PURE__ */ d("option", {
202
+ value: "",
203
+ children: "New obligation / choose existing"
204
+ }), W.data?.mtwFreeTimeClockPage.items.map((e) => /* @__PURE__ */ f("option", {
205
+ value: e.id,
206
+ children: [
207
+ e.chargeKind,
208
+ " — ",
209
+ e.obligationReference
210
+ ]
211
+ }, e.id))]
212
+ })]
213
+ }),
214
+ /* @__PURE__ */ d(_, {
215
+ error: W.error,
216
+ loading: W.loading,
217
+ children: /* @__PURE__ */ d(g, {
218
+ page: W.data?.mtwFreeTimeClockPage,
219
+ offset: ge,
220
+ busy: W.loading || B.busy,
221
+ setOffset: (e) => {
222
+ C(e), Z();
223
+ }
224
+ })
225
+ })
226
+ ]
227
+ }),
228
+ y && /* @__PURE__ */ f("section", {
229
+ className: p,
230
+ "aria-label": "Recorded exposure",
231
+ children: [
232
+ /* @__PURE__ */ d("h2", {
233
+ className: "text-lg font-semibold",
234
+ children: "Recorded exposure"
235
+ }),
236
+ /* @__PURE__ */ f("form", {
237
+ className: "flex flex-wrap items-end gap-3",
238
+ onSubmit: (e) => {
239
+ e.preventDefault();
240
+ try {
241
+ xe(s(M)), P(null);
242
+ } catch (e) {
243
+ P(e instanceof Error ? e.message : "Invalid evaluation time");
244
+ }
245
+ },
246
+ children: [/* @__PURE__ */ f("label", { children: ["Evaluate at time with timezone", /* @__PURE__ */ d(r, {
247
+ value: M,
248
+ onChange: (e) => ye(e.target.value),
249
+ required: !0
250
+ })] }), /* @__PURE__ */ d(n, {
251
+ type: "submit",
252
+ children: "Estimate exposure"
253
+ })]
254
+ }),
255
+ /* @__PURE__ */ d(_, {
256
+ error: J.error,
257
+ loading: J.loading,
258
+ children: Q && /* @__PURE__ */ f(u, { children: [
259
+ /* @__PURE__ */ f("p", { children: [
260
+ "Evaluation agreement: ",
261
+ Q.agreementId ?? "Unknown",
262
+ ".",
263
+ " ",
264
+ $ ? `${$.payer} → ${$.payee}. Source: ${$.sourceReference}. Timezone: ${$.terms?.timeZone ?? "Pricing terms unavailable"}.` : "See the matching history version for source and parties."
265
+ ] }),
266
+ /* @__PURE__ */ d("p", { children: Q.status === "ESTIMATED" ? "Estimated under recorded terms" : `Cannot estimate: ${Q.reason ?? "Incomplete data"}` }),
267
+ /* @__PURE__ */ f("p", { children: [
268
+ "Exact deadline: ",
269
+ Q.freeUntil ?? "Unknown",
270
+ Q.localLastFreeDate ? `; local last-free date ${Q.localLastFreeDate}` : ""
271
+ ] }),
272
+ Q.status === "ESTIMATED" && /* @__PURE__ */ f("p", { children: [
273
+ Q.chargedDays,
274
+ " charged dates;",
275
+ " ",
276
+ typeof Q.amountMinorUnits == "number" && typeof Q.minorUnitDigits == "number" ? `${(Q.amountMinorUnits / 10 ** Q.minorUnitDigits).toFixed(Q.minorUnitDigits)} ${Q.currency}` : "Price data unavailable",
277
+ ". Deadline source: ",
278
+ Q.deadlineSource,
279
+ "."
280
+ ] }),
281
+ /* @__PURE__ */ d("p", {
282
+ className: "text-sm",
283
+ children: "The exact timestamp takes precedence over a date label. Recalculated using versions effective at evaluation time; this does not reconstruct what was known then. Prospective segmented tariffs are unsupported."
284
+ })
285
+ ] })
286
+ })
287
+ ]
288
+ }),
289
+ i && /* @__PURE__ */ f("section", {
290
+ className: p,
291
+ "aria-label": "Record contractual change",
292
+ children: [
293
+ /* @__PURE__ */ d("h2", {
294
+ className: "text-lg font-semibold",
295
+ children: "Record contractual change"
296
+ }),
297
+ /* @__PURE__ */ f("label", {
298
+ className: "block",
299
+ children: ["Free-time action", /* @__PURE__ */ f("select", {
300
+ className: m,
301
+ value: D,
302
+ disabled: B.busy,
303
+ onChange: (e) => {
304
+ let t = [
305
+ "open",
306
+ "correct",
307
+ "request",
308
+ "decision"
309
+ ].find((t) => t === e.target.value);
310
+ t && (O(t), B.resetFeedback(), R(""), I([]), P(null));
311
+ },
312
+ children: [
313
+ /* @__PURE__ */ d("option", {
314
+ value: "open",
315
+ children: "Open a separate sourced obligation"
316
+ }),
317
+ /* @__PURE__ */ d("option", {
318
+ value: "correct",
319
+ disabled: !Y,
320
+ children: "Correct agreement / actual event binding"
321
+ }),
322
+ /* @__PURE__ */ d("option", {
323
+ value: "request",
324
+ disabled: !Y,
325
+ children: "Record extension request"
326
+ }),
327
+ /* @__PURE__ */ d("option", {
328
+ value: "decision",
329
+ disabled: !Y,
330
+ children: "Record external decision"
331
+ })
332
+ ]
333
+ })]
334
+ }),
335
+ (D === "open" || D === "correct") && /* @__PURE__ */ f(u, { children: [
336
+ D === "open" && /* @__PURE__ */ f("div", {
337
+ className: "grid gap-3 md:grid-cols-2",
338
+ children: [/* @__PURE__ */ f("label", { children: ["Charge kind", /* @__PURE__ */ f("select", {
339
+ className: m,
340
+ value: k,
341
+ onChange: (e) => {
342
+ let t = [
343
+ "DEMURRAGE",
344
+ "DETENTION",
345
+ "TERMINAL_STORAGE"
346
+ ].find((t) => t === e.target.value);
347
+ t && ve(t);
348
+ },
349
+ children: [
350
+ /* @__PURE__ */ d("option", { children: "DEMURRAGE" }),
351
+ /* @__PURE__ */ d("option", { children: "DETENTION" }),
352
+ /* @__PURE__ */ d("option", { children: "TERMINAL_STORAGE" })
353
+ ]
354
+ })] }), /* @__PURE__ */ f("label", { children: ["Commercial obligation reference", /* @__PURE__ */ d(r, {
355
+ required: !0,
356
+ maxLength: 255,
357
+ value: A,
358
+ onChange: (e) => j(e.target.value),
359
+ placeholder: "Payee / terminal / booking / segment"
360
+ })] })]
361
+ }),
362
+ /* @__PURE__ */ d(_, {
363
+ error: U.error,
364
+ loading: U.loading,
365
+ children: /* @__PURE__ */ d(g, {
366
+ page: U.data?.mtwContainerEventPage,
367
+ offset: he,
368
+ setOffset: S,
369
+ busy: U.loading || B.busy
370
+ })
371
+ }),
372
+ (D === "open" || X) && /* @__PURE__ */ d(te, {
373
+ events: U.data?.mtwContainerEventPage.items ?? [],
374
+ initial: D === "correct" ? X : void 0,
375
+ busy: B.busy || U.loading || D === "correct" && K.loading,
376
+ onSubmit: async (e) => {
377
+ if (D === "open") {
378
+ if (!A.trim()) throw Error("Enter a distinct commercial obligation reference.");
379
+ await B.run(le, {
380
+ cycleId: i,
381
+ chargeKind: k,
382
+ obligationReference: A,
383
+ agreement: e
384
+ }, "Sourced clock opened.");
385
+ } else {
386
+ if (!Y || !X) throw Error("Reload the current obligation before correcting it.");
387
+ await B.run(ue, {
388
+ clockId: y,
389
+ expectedVersion: Y.version,
390
+ agreement: e
391
+ }, "New immutable agreement version recorded.");
392
+ }
393
+ }
394
+ }, `${D}:${i}:${y}:${X?.id}`)
395
+ ] }),
396
+ (D === "request" || D === "decision") && /* @__PURE__ */ f("form", {
397
+ className: "space-y-4",
398
+ onSubmit: async (e) => {
399
+ e.preventDefault(), P(null);
400
+ try {
401
+ if (!Y || !X) throw Error("Reload the current obligation and agreement.");
402
+ let t = new FormData(e.currentTarget), n = (e) => String(t.get(e) ?? "").trim();
403
+ if (D === "request") await B.run(de, {
404
+ clockId: y,
405
+ expectedVersion: Y.version,
406
+ baseAgreementId: X.id,
407
+ requestedFreeUntil: s(n("requestedDeadline")),
408
+ requestedAt: s(n("requestedAt")),
409
+ expiresAt: s(n("expiresAt")),
410
+ reason: n("reason"),
411
+ evidence: we()
412
+ }, "Request recorded; current terms remain unchanged.");
413
+ else {
414
+ if (!Ce.some((e) => e.id === L)) throw Error("Choose an unanswered request.");
415
+ await B.run(ne, {
416
+ extensionId: L,
417
+ expectedVersion: Y.version,
418
+ decision: z,
419
+ decidedAt: s(n("decidedAt")),
420
+ effectiveAt: z === "ACCEPTED" ? s(n("effectiveAt")) : null,
421
+ acceptedFreeUntil: z === "ACCEPTED" ? s(n("acceptedDeadline")) : null,
422
+ counterparty: n("counterparty"),
423
+ sourceReference: n("confirmation"),
424
+ note: n("note"),
425
+ evidence: we()
426
+ }, "External decision recorded with immutable history.");
427
+ }
428
+ } catch (e) {
429
+ P(e instanceof Error ? e.message : "Unable to record change.");
430
+ }
431
+ },
432
+ children: [
433
+ D === "request" ? /* @__PURE__ */ f("div", {
434
+ className: "grid gap-3 md:grid-cols-2",
435
+ children: [[
436
+ ["requestedDeadline", "Requested deadline with timezone"],
437
+ ["requestedAt", "Actual request time with timezone"],
438
+ ["expiresAt", "Request expiry with timezone"]
439
+ ].map(([e, t]) => /* @__PURE__ */ f("label", { children: [t, /* @__PURE__ */ d(r, {
440
+ name: e,
441
+ required: !0,
442
+ placeholder: "2026-10-04T09:00:00+05:30"
443
+ })] }, e)), /* @__PURE__ */ f("label", { children: ["Request reason", /* @__PURE__ */ d(r, {
444
+ name: "reason",
445
+ required: !0,
446
+ maxLength: 2e3
447
+ })] })]
448
+ }) : /* @__PURE__ */ f(u, { children: [
449
+ /* @__PURE__ */ f("label", {
450
+ className: "block",
451
+ children: ["Unanswered extension request", /* @__PURE__ */ f("select", {
452
+ className: m,
453
+ required: !0,
454
+ value: L,
455
+ onChange: (e) => R(e.target.value),
456
+ children: [/* @__PURE__ */ d("option", {
457
+ value: "",
458
+ children: "Choose request from this page"
459
+ }), Ce.map((e) => /* @__PURE__ */ f("option", {
460
+ value: e.id,
461
+ children: [
462
+ e.requestedFreeUntil,
463
+ " — expires ",
464
+ e.expiresAt,
465
+ " — base",
466
+ " ",
467
+ e.baseAgreementId
468
+ ]
469
+ }, e.id))]
470
+ })]
471
+ }),
472
+ /* @__PURE__ */ f("label", {
473
+ className: "block",
474
+ children: ["Recorded decision", /* @__PURE__ */ f("select", {
475
+ className: m,
476
+ value: z,
477
+ onChange: (e) => {
478
+ let t = [
479
+ "ACCEPTED",
480
+ "REJECTED",
481
+ "EXPIRED"
482
+ ].find((t) => t === e.target.value);
483
+ t && Se(t);
484
+ },
485
+ children: [
486
+ /* @__PURE__ */ d("option", { children: "ACCEPTED" }),
487
+ /* @__PURE__ */ d("option", { children: "REJECTED" }),
488
+ /* @__PURE__ */ d("option", { children: "EXPIRED" })
489
+ ]
490
+ })]
491
+ }),
492
+ /* @__PURE__ */ f("div", {
493
+ className: "grid gap-3 md:grid-cols-2",
494
+ children: [
495
+ /* @__PURE__ */ f("label", { children: ["Actual decision time with timezone", /* @__PURE__ */ d(r, {
496
+ name: "decidedAt",
497
+ required: !0
498
+ })] }),
499
+ /* @__PURE__ */ f("label", { children: ["Counterparty / expiry authority", /* @__PURE__ */ d(r, {
500
+ name: "counterparty",
501
+ required: !0,
502
+ maxLength: 255
503
+ })] }),
504
+ /* @__PURE__ */ f("label", { children: ["External confirmation source reference", /* @__PURE__ */ d(r, {
505
+ name: "confirmation",
506
+ required: !0,
507
+ maxLength: 255
508
+ })] }),
509
+ z === "ACCEPTED" && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("label", { children: ["Externally accepted deadline with timezone", /* @__PURE__ */ d(r, {
510
+ name: "acceptedDeadline",
511
+ required: !0
512
+ })] }), /* @__PURE__ */ f("label", { children: ["Explicit effective time with timezone", /* @__PURE__ */ d(r, {
513
+ name: "effectiveAt",
514
+ required: !0
515
+ })] })] }),
516
+ /* @__PURE__ */ f("label", { children: ["Decision note and applicability", /* @__PURE__ */ d(r, {
517
+ name: "note",
518
+ required: !0,
519
+ maxLength: 2e3
520
+ })] })
521
+ ]
522
+ }),
523
+ /* @__PURE__ */ d("p", {
524
+ className: "text-sm",
525
+ children: "Requested and accepted deadlines can differ. Accepted extensions must move a known current cutoff later. Late decisions or a superseded base agreement require explicit reconciliation. Expiry never reverses an accepted agreement."
526
+ })
527
+ ] }),
528
+ /* @__PURE__ */ d(ee, {
529
+ description: "Choose exact source versions. Integrity does not independently establish contractual terms or counterparty acceptance.",
530
+ value: F,
531
+ onChange: I
532
+ }),
533
+ /* @__PURE__ */ d(n, {
534
+ type: "submit",
535
+ disabled: B.busy || K.loading || !Y || !X,
536
+ children: D === "request" ? "Record extension request" : "Record counterparty decision"
537
+ })
538
+ ]
539
+ }),
540
+ (N || B.error) && /* @__PURE__ */ d("p", {
541
+ role: "alert",
542
+ children: N ?? B.error
543
+ }),
544
+ B.notice && /* @__PURE__ */ d("p", {
545
+ role: "status",
546
+ children: B.notice
547
+ }),
548
+ B.hasPendingAttempt && /* @__PURE__ */ f("div", {
549
+ className: "space-y-2",
550
+ children: [/* @__PURE__ */ d("p", {
551
+ className: "text-sm",
552
+ children: "A failed response may still mean the record was saved. Check history before discarding or repeating the action, especially after reopening this page."
553
+ }), /* @__PURE__ */ d(n, {
554
+ type: "button",
555
+ variant: "outline",
556
+ disabled: B.busy,
557
+ onClick: B.discardAttempt,
558
+ children: "Discard failed attempt"
559
+ })]
560
+ })
561
+ ]
562
+ }),
563
+ y && /* @__PURE__ */ f("div", {
564
+ className: "grid gap-6 xl:grid-cols-2",
565
+ children: [/* @__PURE__ */ f("section", {
566
+ className: p,
567
+ children: [/* @__PURE__ */ d("h2", {
568
+ className: "text-lg font-semibold",
569
+ children: "Agreement history"
570
+ }), /* @__PURE__ */ f(_, {
571
+ error: G.error,
572
+ loading: G.loading,
573
+ children: [/* @__PURE__ */ d("ul", {
574
+ className: "space-y-3",
575
+ children: G.data?.mtwFreeTimeAgreementPage.items.map((e) => /* @__PURE__ */ f("li", {
576
+ className: "break-words rounded-lg border p-3 text-sm",
577
+ children: [
578
+ "Version ",
579
+ e.version,
580
+ " (agreement ",
581
+ e.id,
582
+ "): ",
583
+ e.payer,
584
+ " → ",
585
+ e.payee,
586
+ "; effective ",
587
+ e.effectiveAt,
588
+ "; ",
589
+ e.applicability,
590
+ "; deadline",
591
+ " ",
592
+ e.confirmedFreeUntil ?? "Calculated / unknown",
593
+ ". Source",
594
+ " ",
595
+ e.sourceReference,
596
+ ". Reason ",
597
+ e.changeReason,
598
+ ".",
599
+ /* @__PURE__ */ d("ul", { children: e.evidence.map((e) => /* @__PURE__ */ f("li", {
600
+ className: "break-all",
601
+ children: [
602
+ "Evidence version ",
603
+ e.versionId,
604
+ "; SHA256 ",
605
+ e.sha256Hash
606
+ ]
607
+ }, e.versionId)) })
608
+ ]
609
+ }, e.id))
610
+ }), /* @__PURE__ */ d(g, {
611
+ page: G.data?.mtwFreeTimeAgreementPage,
612
+ offset: _e,
613
+ setOffset: w,
614
+ busy: G.loading || B.busy
615
+ })]
616
+ })]
617
+ }), /* @__PURE__ */ f("section", {
618
+ className: p,
619
+ children: [/* @__PURE__ */ d("h2", {
620
+ className: "text-lg font-semibold",
621
+ children: "Extension decisions"
622
+ }), /* @__PURE__ */ f(_, {
623
+ error: q.error,
624
+ loading: q.loading,
625
+ children: [/* @__PURE__ */ d("ul", {
626
+ className: "space-y-3",
627
+ children: q.data?.mtwFreeTimeExtensionPage.items.map((e) => /* @__PURE__ */ f("li", {
628
+ className: "break-words rounded-lg border p-3 text-sm",
629
+ children: [
630
+ "Requested ",
631
+ e.requestedFreeUntil,
632
+ "; expires ",
633
+ e.expiresAt,
634
+ "; base",
635
+ " ",
636
+ e.baseAgreementId,
637
+ ".",
638
+ " ",
639
+ e.decision ? `${e.decision.decision}: ${e.decision.acceptedFreeUntil ?? "Terms unchanged"}; ${e.decision.counterparty}; ${e.decision.sourceReference}; ${e.decision.note}` : "REQUESTED — no terminal decision recorded."
640
+ ]
641
+ }, e.id))
642
+ }), /* @__PURE__ */ d(g, {
643
+ page: q.data?.mtwFreeTimeExtensionPage,
644
+ offset: T,
645
+ busy: q.loading || B.busy,
646
+ setOffset: (e) => {
647
+ E(e), R("");
648
+ }
649
+ })]
650
+ })]
651
+ })]
652
+ })
653
+ ]
654
+ });
655
+ }
656
+ //#endregion
657
+ export { v as default };