udp-react-enterprise-component-library 27.0.0-next.11 → 27.0.0-next.13

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 (670) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/UI/feedback/PageLoading.d.ts +11 -1
  3. package/dist/UI/feedback/PageLoading.d.ts.map +1 -1
  4. package/dist/UI/feedback/PageLoading.js +12 -12
  5. package/dist/UI/feedback/PageLoading.js.map +1 -1
  6. package/dist/UI/feedback/PageLoading.mjs +35 -21
  7. package/dist/UI/feedback/PageLoading.mjs.map +1 -1
  8. package/dist/UI/feedback/PageLoading.module.css +9 -0
  9. package/dist/UI/fluent-web-components/UdpIconPicker.d.ts +4 -1
  10. package/dist/UI/fluent-web-components/UdpIconPicker.d.ts.map +1 -1
  11. package/dist/UI/fluent-web-components/UdpIconPicker.js +2 -2
  12. package/dist/UI/fluent-web-components/UdpIconPicker.js.map +1 -1
  13. package/dist/UI/fluent-web-components/UdpIconPicker.mjs +32 -28
  14. package/dist/UI/fluent-web-components/UdpIconPicker.mjs.map +1 -1
  15. package/dist/UI/fluent-web-components/UdpLink.d.ts +6 -0
  16. package/dist/UI/fluent-web-components/UdpLink.d.ts.map +1 -1
  17. package/dist/UI/fluent-web-components/UdpLink.js.map +1 -1
  18. package/dist/UI/fluent-web-components/UdpLink.mjs.map +1 -1
  19. package/dist/UI/fluent-web-components/index.d.ts +10 -0
  20. package/dist/UI/fluent-web-components/index.d.ts.map +1 -1
  21. package/dist/UI/fluent-web-components/index.js +10 -0
  22. package/dist/UI/fluent-web-components/index.js.map +1 -1
  23. package/dist/UI/fluent-web-components/shell/UdpShell.d.ts +10 -0
  24. package/dist/UI/fluent-web-components/shell/UdpShell.d.ts.map +1 -0
  25. package/dist/UI/fluent-web-components/shell/UdpShell.js +7 -0
  26. package/dist/UI/fluent-web-components/shell/UdpShell.js.map +1 -0
  27. package/dist/UI/fluent-web-components/shell/UdpShell.mjs +19 -0
  28. package/dist/UI/fluent-web-components/shell/UdpShell.mjs.map +1 -0
  29. package/dist/UI/fluent-web-components/shell/UdpShellAppBar.d.ts +11 -0
  30. package/dist/UI/fluent-web-components/shell/UdpShellAppBar.d.ts.map +1 -0
  31. package/dist/UI/fluent-web-components/shell/UdpShellAppBar.js +7 -0
  32. package/dist/UI/fluent-web-components/shell/UdpShellAppBar.js.map +1 -0
  33. package/dist/UI/fluent-web-components/shell/UdpShellAppBar.mjs +19 -0
  34. package/dist/UI/fluent-web-components/shell/UdpShellAppBar.mjs.map +1 -0
  35. package/dist/UI/fluent-web-components/shell/UdpShellAppBarAction.d.ts +16 -0
  36. package/dist/UI/fluent-web-components/shell/UdpShellAppBarAction.d.ts.map +1 -0
  37. package/dist/UI/fluent-web-components/shell/UdpShellAppBarAction.js +7 -0
  38. package/dist/UI/fluent-web-components/shell/UdpShellAppBarAction.js.map +1 -0
  39. package/dist/UI/fluent-web-components/shell/UdpShellAppBarAction.mjs +19 -0
  40. package/dist/UI/fluent-web-components/shell/UdpShellAppBarAction.mjs.map +1 -0
  41. package/dist/UI/fluent-web-components/shell/UdpShellNav.d.ts +21 -0
  42. package/dist/UI/fluent-web-components/shell/UdpShellNav.d.ts.map +1 -0
  43. package/dist/UI/fluent-web-components/shell/UdpShellNav.js +7 -0
  44. package/dist/UI/fluent-web-components/shell/UdpShellNav.js.map +1 -0
  45. package/dist/UI/fluent-web-components/shell/UdpShellNav.mjs +19 -0
  46. package/dist/UI/fluent-web-components/shell/UdpShellNav.mjs.map +1 -0
  47. package/dist/UI/fluent-web-components/shell/UdpShellRibbon.d.ts +10 -0
  48. package/dist/UI/fluent-web-components/shell/UdpShellRibbon.d.ts.map +1 -0
  49. package/dist/UI/fluent-web-components/shell/UdpShellRibbon.js +7 -0
  50. package/dist/UI/fluent-web-components/shell/UdpShellRibbon.js.map +1 -0
  51. package/dist/UI/fluent-web-components/shell/UdpShellRibbon.mjs +19 -0
  52. package/dist/UI/fluent-web-components/shell/UdpShellRibbon.mjs.map +1 -0
  53. package/dist/UI/fluent-web-components/shell/UdpShellSidebar.d.ts +13 -0
  54. package/dist/UI/fluent-web-components/shell/UdpShellSidebar.d.ts.map +1 -0
  55. package/dist/UI/fluent-web-components/shell/UdpShellSidebar.js +7 -0
  56. package/dist/UI/fluent-web-components/shell/UdpShellSidebar.js.map +1 -0
  57. package/dist/UI/fluent-web-components/shell/UdpShellSidebar.mjs +19 -0
  58. package/dist/UI/fluent-web-components/shell/UdpShellSidebar.mjs.map +1 -0
  59. package/dist/UI/fluent-web-components/types.d.ts +2 -0
  60. package/dist/UI/fluent-web-components/types.d.ts.map +1 -1
  61. package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.d.ts +16 -3
  62. package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.d.ts.map +1 -1
  63. package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.js +36 -13
  64. package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.js.map +1 -1
  65. package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.mjs +119 -62
  66. package/dist/UI/widgets/library/InquiryFindRecordsWidget/InquiryFindRecordsWidget.mjs.map +1 -1
  67. package/dist/UI/widgets/library/InquiryFindRecordsWidget/index.mjs +3 -2
  68. package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.d.ts +9 -2
  69. package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.d.ts.map +1 -1
  70. package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.js +18 -18
  71. package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.js.map +1 -1
  72. package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.mjs +79 -67
  73. package/dist/UI/widgets/library/InquiryRecentRecordsWidget/InquiryRecentRecordsWidget.mjs.map +1 -1
  74. package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.d.ts +8 -2
  75. package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.d.ts.map +1 -1
  76. package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.js +32 -16
  77. package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.js.map +1 -1
  78. package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.mjs +129 -102
  79. package/dist/UI/widgets/library/InquiryRemindersWidget/InquiryRemindersWidget.mjs.map +1 -1
  80. package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.d.ts +3 -2
  81. package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.d.ts.map +1 -1
  82. package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.js +11 -12
  83. package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.js.map +1 -1
  84. package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.mjs +6 -4
  85. package/dist/UI/widgets/library/InquiryRemindersWidget/reminderRowModel.mjs.map +1 -1
  86. package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.d.ts +2 -19
  87. package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.d.ts.map +1 -1
  88. package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.js +4 -5
  89. package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.js.map +1 -1
  90. package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.mjs +5 -4
  91. package/dist/UI/widgets/library/InquiryRemindersWidget/useInquiryReminders.mjs.map +1 -1
  92. package/dist/actionPanels/index.d.ts +0 -2
  93. package/dist/actionPanels/index.d.ts.map +1 -1
  94. package/dist/actionPanels/index.js +0 -2
  95. package/dist/actionPanels/index.js.map +1 -1
  96. package/dist/actionPanels/panelActionFields.d.ts +9 -26
  97. package/dist/actionPanels/panelActionFields.d.ts.map +1 -1
  98. package/dist/actionPanels/panelActionFields.js +32 -55
  99. package/dist/actionPanels/panelActionFields.js.map +1 -1
  100. package/dist/actionPanels/panelActionFields.mjs +159 -375
  101. package/dist/actionPanels/panelActionFields.mjs.map +1 -1
  102. package/dist/actionPanels/panelOperations.d.ts +15 -41
  103. package/dist/actionPanels/panelOperations.d.ts.map +1 -1
  104. package/dist/actionPanels/panelOperations.js +51 -89
  105. package/dist/actionPanels/panelOperations.js.map +1 -1
  106. package/dist/actionPanels/panelOperations.mjs +37 -92
  107. package/dist/actionPanels/panelOperations.mjs.map +1 -1
  108. package/dist/aiAssistant/aiFeatures.d.ts +1 -1
  109. package/dist/aiAssistant/aiFeatures.d.ts.map +1 -1
  110. package/dist/aiAssistant/aiFeatures.js +5 -0
  111. package/dist/aiAssistant/aiFeatures.js.map +1 -1
  112. package/dist/aiAssistant/aiFeatures.mjs +5 -1
  113. package/dist/aiAssistant/aiFeatures.mjs.map +1 -1
  114. package/dist/dashboard/DashboardWidget.d.ts.map +1 -1
  115. package/dist/dashboard/DashboardWidget.js +1 -1
  116. package/dist/dashboard/DashboardWidget.js.map +1 -1
  117. package/dist/dashboard/DashboardWidget.mjs +24 -21
  118. package/dist/dashboard/DashboardWidget.mjs.map +1 -1
  119. package/dist/domain/actionPanel/actionTypeMeta.d.ts +15 -2
  120. package/dist/domain/actionPanel/actionTypeMeta.d.ts.map +1 -1
  121. package/dist/domain/actionPanel/actionTypeMeta.js +21 -2
  122. package/dist/domain/actionPanel/actionTypeMeta.js.map +1 -1
  123. package/dist/domain/actionPanel/actionTypeMeta.mjs +18 -3
  124. package/dist/domain/actionPanel/actionTypeMeta.mjs.map +1 -1
  125. package/dist/domain/actionPanel/buttonOrder.d.ts +67 -0
  126. package/dist/domain/actionPanel/buttonOrder.d.ts.map +1 -0
  127. package/dist/domain/actionPanel/buttonOrder.js +105 -0
  128. package/dist/domain/actionPanel/buttonOrder.js.map +1 -0
  129. package/dist/domain/actionPanel/buttonOrder.mjs +90 -0
  130. package/dist/domain/actionPanel/buttonOrder.mjs.map +1 -0
  131. package/dist/domain/actionPanel/index.d.ts +1 -0
  132. package/dist/domain/actionPanel/index.d.ts.map +1 -1
  133. package/dist/domain/actionPanel/index.js +1 -0
  134. package/dist/domain/actionPanel/index.js.map +1 -1
  135. package/dist/domain/actionPanel/index.mjs +4 -3
  136. package/dist/domain/actionPanel/serialize.d.ts +6 -2
  137. package/dist/domain/actionPanel/serialize.d.ts.map +1 -1
  138. package/dist/domain/actionPanel/serialize.js +10 -3
  139. package/dist/domain/actionPanel/serialize.js.map +1 -1
  140. package/dist/domain/actionPanel/serialize.mjs +7 -3
  141. package/dist/domain/actionPanel/serialize.mjs.map +1 -1
  142. package/dist/domain/actionPanel/types.d.ts +24 -8
  143. package/dist/domain/actionPanel/types.d.ts.map +1 -1
  144. package/dist/domain/actionPanel/types.js.map +1 -1
  145. package/dist/domain/actionPanel/types.mjs.map +1 -1
  146. package/dist/domain/inquiryTree/describe.d.ts +15 -3
  147. package/dist/domain/inquiryTree/describe.d.ts.map +1 -1
  148. package/dist/domain/inquiryTree/describe.js +32 -28
  149. package/dist/domain/inquiryTree/describe.js.map +1 -1
  150. package/dist/domain/inquiryTree/describe.mjs +34 -16
  151. package/dist/domain/inquiryTree/describe.mjs.map +1 -1
  152. package/dist/domain/inquiryTree/displayTree.d.ts +75 -97
  153. package/dist/domain/inquiryTree/displayTree.d.ts.map +1 -1
  154. package/dist/domain/inquiryTree/displayTree.js +418 -551
  155. package/dist/domain/inquiryTree/displayTree.js.map +1 -1
  156. package/dist/domain/inquiryTree/displayTree.mjs +345 -414
  157. package/dist/domain/inquiryTree/displayTree.mjs.map +1 -1
  158. package/dist/domain/inquiryTree/groups.d.ts +2 -0
  159. package/dist/domain/inquiryTree/groups.d.ts.map +1 -1
  160. package/dist/domain/inquiryTree/groups.js.map +1 -1
  161. package/dist/domain/inquiryTree/groups.mjs.map +1 -1
  162. package/dist/domain/inquiryTree/index.d.ts +1 -1
  163. package/dist/domain/inquiryTree/index.d.ts.map +1 -1
  164. package/dist/domain/inquiryTree/index.js +1 -1
  165. package/dist/domain/inquiryTree/index.js.map +1 -1
  166. package/dist/domain/inquiryTree/index.mjs +12 -12
  167. package/dist/domain/inquiryTree/lazyLoad.d.ts +20 -129
  168. package/dist/domain/inquiryTree/lazyLoad.d.ts.map +1 -1
  169. package/dist/domain/inquiryTree/lazyLoad.js +48 -233
  170. package/dist/domain/inquiryTree/lazyLoad.js.map +1 -1
  171. package/dist/domain/inquiryTree/lazyLoad.mjs +32 -187
  172. package/dist/domain/inquiryTree/lazyLoad.mjs.map +1 -1
  173. package/dist/domain/inquiryTree/legalChildren.d.ts +13 -14
  174. package/dist/domain/inquiryTree/legalChildren.d.ts.map +1 -1
  175. package/dist/domain/inquiryTree/legalChildren.js +21 -42
  176. package/dist/domain/inquiryTree/legalChildren.js.map +1 -1
  177. package/dist/domain/inquiryTree/legalChildren.mjs +19 -37
  178. package/dist/domain/inquiryTree/legalChildren.mjs.map +1 -1
  179. package/dist/domain/inquiryTree/names.d.ts +38 -0
  180. package/dist/domain/inquiryTree/names.d.ts.map +1 -0
  181. package/dist/domain/inquiryTree/names.js +64 -0
  182. package/dist/domain/inquiryTree/names.js.map +1 -0
  183. package/dist/domain/inquiryTree/names.mjs +56 -0
  184. package/dist/domain/inquiryTree/names.mjs.map +1 -0
  185. package/dist/domain/inquiryTree/operations.d.ts +6 -2
  186. package/dist/domain/inquiryTree/operations.d.ts.map +1 -1
  187. package/dist/domain/inquiryTree/operations.js +17 -16
  188. package/dist/domain/inquiryTree/operations.js.map +1 -1
  189. package/dist/domain/inquiryTree/operations.mjs +14 -11
  190. package/dist/domain/inquiryTree/operations.mjs.map +1 -1
  191. package/dist/domain/inquiryTree/rules.d.ts +3 -4
  192. package/dist/domain/inquiryTree/rules.d.ts.map +1 -1
  193. package/dist/domain/inquiryTree/rules.js +3 -13
  194. package/dist/domain/inquiryTree/rules.js.map +1 -1
  195. package/dist/domain/inquiryTree/rules.mjs +3 -9
  196. package/dist/domain/inquiryTree/rules.mjs.map +1 -1
  197. package/dist/domain/inquiryTree/runtime.d.ts +23 -16
  198. package/dist/domain/inquiryTree/runtime.d.ts.map +1 -1
  199. package/dist/domain/inquiryTree/runtime.js +46 -54
  200. package/dist/domain/inquiryTree/runtime.js.map +1 -1
  201. package/dist/domain/inquiryTree/runtime.mjs +31 -26
  202. package/dist/domain/inquiryTree/runtime.mjs.map +1 -1
  203. package/dist/domain/inquiryTree/serialize.d.ts +20 -29
  204. package/dist/domain/inquiryTree/serialize.d.ts.map +1 -1
  205. package/dist/domain/inquiryTree/serialize.js +93 -205
  206. package/dist/domain/inquiryTree/serialize.js.map +1 -1
  207. package/dist/domain/inquiryTree/serialize.mjs +89 -180
  208. package/dist/domain/inquiryTree/serialize.mjs.map +1 -1
  209. package/dist/domain/inquiryTree/types.d.ts +146 -65
  210. package/dist/domain/inquiryTree/types.d.ts.map +1 -1
  211. package/dist/domain/inquiryTree/types.js +5 -0
  212. package/dist/domain/inquiryTree/types.js.map +1 -1
  213. package/dist/domain/inquiryTree/types.mjs +3 -1
  214. package/dist/domain/inquiryTree/types.mjs.map +1 -1
  215. package/dist/domain/inquiryTree/validate.d.ts +9 -2
  216. package/dist/domain/inquiryTree/validate.d.ts.map +1 -1
  217. package/dist/domain/inquiryTree/validate.js +30 -58
  218. package/dist/domain/inquiryTree/validate.js.map +1 -1
  219. package/dist/domain/inquiryTree/validate.mjs +29 -44
  220. package/dist/domain/inquiryTree/validate.mjs.map +1 -1
  221. package/dist/domain/inquiryTree/view.d.ts +8 -12
  222. package/dist/domain/inquiryTree/view.d.ts.map +1 -1
  223. package/dist/domain/inquiryTree/view.js +40 -66
  224. package/dist/domain/inquiryTree/view.js.map +1 -1
  225. package/dist/domain/inquiryTree/view.mjs +30 -60
  226. package/dist/domain/inquiryTree/view.mjs.map +1 -1
  227. package/dist/domain/inquiryTree/waveLoad.d.ts +32 -48
  228. package/dist/domain/inquiryTree/waveLoad.d.ts.map +1 -1
  229. package/dist/domain/inquiryTree/waveLoad.js +75 -90
  230. package/dist/domain/inquiryTree/waveLoad.js.map +1 -1
  231. package/dist/domain/inquiryTree/waveLoad.mjs +54 -60
  232. package/dist/domain/inquiryTree/waveLoad.mjs.map +1 -1
  233. package/dist/domain/inquiryTree/wireString.d.ts +5 -0
  234. package/dist/domain/inquiryTree/wireString.d.ts.map +1 -1
  235. package/dist/domain/inquiryTree/wireString.js +11 -0
  236. package/dist/domain/inquiryTree/wireString.js.map +1 -1
  237. package/dist/domain/inquiryTree/wireString.mjs +10 -1
  238. package/dist/domain/inquiryTree/wireString.mjs.map +1 -1
  239. package/dist/domain/nodeView/index.mjs +2 -2
  240. package/dist/domain/nodeView/model.d.ts +35 -30
  241. package/dist/domain/nodeView/model.d.ts.map +1 -1
  242. package/dist/domain/nodeView/model.js +108 -69
  243. package/dist/domain/nodeView/model.js.map +1 -1
  244. package/dist/domain/nodeView/model.mjs +86 -36
  245. package/dist/domain/nodeView/model.mjs.map +1 -1
  246. package/dist/errorBoundary/ErrorBoundary.d.ts +17 -1
  247. package/dist/errorBoundary/ErrorBoundary.d.ts.map +1 -1
  248. package/dist/errorBoundary/ErrorBoundary.js +25 -21
  249. package/dist/errorBoundary/ErrorBoundary.js.map +1 -1
  250. package/dist/errorBoundary/ErrorBoundary.mjs +22 -34
  251. package/dist/errorBoundary/ErrorBoundary.mjs.map +1 -1
  252. package/dist/errorBoundary/ErrorBoundaryFallback.d.ts +10 -0
  253. package/dist/errorBoundary/ErrorBoundaryFallback.d.ts.map +1 -0
  254. package/dist/errorBoundary/ErrorBoundaryFallback.js +8 -0
  255. package/dist/errorBoundary/ErrorBoundaryFallback.js.map +1 -0
  256. package/dist/errorBoundary/ErrorBoundaryFallback.mjs +91 -0
  257. package/dist/errorBoundary/ErrorBoundaryFallback.mjs.map +1 -0
  258. package/dist/icons/legacyIconNames.d.ts.map +1 -1
  259. package/dist/icons/legacyIconNames.js +46 -1
  260. package/dist/icons/legacyIconNames.js.map +1 -1
  261. package/dist/icons/legacyIconNames.mjs +46 -1
  262. package/dist/icons/legacyIconNames.mjs.map +1 -1
  263. package/dist/index.mjs +19 -14
  264. package/dist/inquiry/Inquiry.d.ts +3 -0
  265. package/dist/inquiry/Inquiry.d.ts.map +1 -1
  266. package/dist/inquiry/Inquiry.js +3 -0
  267. package/dist/inquiry/Inquiry.js.map +1 -1
  268. package/dist/inquiry/Inquiry.mjs +3 -0
  269. package/dist/inquiry/Inquiry.mjs.map +1 -1
  270. package/dist/inquiry/InquiryContainer.d.ts.map +1 -1
  271. package/dist/inquiry/InquiryContainer.js +22 -21
  272. package/dist/inquiry/InquiryContainer.js.map +1 -1
  273. package/dist/inquiry/InquiryContainer.mjs +14 -10
  274. package/dist/inquiry/InquiryContainer.mjs.map +1 -1
  275. package/dist/inquiry/InquiryTreeMenu.d.ts.map +1 -1
  276. package/dist/inquiry/InquiryTreeMenu.js +14 -23
  277. package/dist/inquiry/InquiryTreeMenu.js.map +1 -1
  278. package/dist/inquiry/InquiryTreeMenu.mjs +20 -20
  279. package/dist/inquiry/InquiryTreeMenu.mjs.map +1 -1
  280. package/dist/inquiry/v2/InquiryV2.d.ts +8 -6
  281. package/dist/inquiry/v2/InquiryV2.d.ts.map +1 -1
  282. package/dist/inquiry/v2/InquiryV2.js +45 -24
  283. package/dist/inquiry/v2/InquiryV2.js.map +1 -1
  284. package/dist/inquiry/v2/InquiryV2.mjs +108 -61
  285. package/dist/inquiry/v2/InquiryV2.mjs.map +1 -1
  286. package/dist/inquiry/v2/InquiryV2.module.css +60 -15
  287. package/dist/inquiry/v2/InquiryWorkspace.d.ts +9 -9
  288. package/dist/inquiry/v2/InquiryWorkspace.d.ts.map +1 -1
  289. package/dist/inquiry/v2/InquiryWorkspace.js +531 -408
  290. package/dist/inquiry/v2/InquiryWorkspace.js.map +1 -1
  291. package/dist/inquiry/v2/InquiryWorkspace.mjs +524 -408
  292. package/dist/inquiry/v2/InquiryWorkspace.mjs.map +1 -1
  293. package/dist/inquiry/v2/ai/InquiryV2Copilot.d.ts +3 -2
  294. package/dist/inquiry/v2/ai/InquiryV2Copilot.d.ts.map +1 -1
  295. package/dist/inquiry/v2/ai/InquiryV2Copilot.js +20 -37
  296. package/dist/inquiry/v2/ai/InquiryV2Copilot.js.map +1 -1
  297. package/dist/inquiry/v2/ai/InquiryV2Copilot.mjs +19 -31
  298. package/dist/inquiry/v2/ai/InquiryV2Copilot.mjs.map +1 -1
  299. package/dist/inquiry/v2/ai/copilotModel.d.ts +6 -14
  300. package/dist/inquiry/v2/ai/copilotModel.d.ts.map +1 -1
  301. package/dist/inquiry/v2/ai/copilotModel.js +35 -87
  302. package/dist/inquiry/v2/ai/copilotModel.js.map +1 -1
  303. package/dist/inquiry/v2/ai/copilotModel.mjs +23 -47
  304. package/dist/inquiry/v2/ai/copilotModel.mjs.map +1 -1
  305. package/dist/inquiry/v2/api/queries.d.ts +46 -73
  306. package/dist/inquiry/v2/api/queries.d.ts.map +1 -1
  307. package/dist/inquiry/v2/api/queries.js +151 -210
  308. package/dist/inquiry/v2/api/queries.js.map +1 -1
  309. package/dist/inquiry/v2/api/queries.mjs +227 -183
  310. package/dist/inquiry/v2/api/queries.mjs.map +1 -1
  311. package/dist/inquiry/v2/capabilities/actions/ActionsCapability.d.ts.map +1 -1
  312. package/dist/inquiry/v2/capabilities/actions/ActionsCapability.js +103 -32
  313. package/dist/inquiry/v2/capabilities/actions/ActionsCapability.js.map +1 -1
  314. package/dist/inquiry/v2/capabilities/actions/ActionsCapability.mjs +92 -32
  315. package/dist/inquiry/v2/capabilities/actions/ActionsCapability.mjs.map +1 -1
  316. package/dist/inquiry/v2/capabilities/actions/ActionsCapability.module.css +8 -1
  317. package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.d.ts +20 -16
  318. package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.d.ts.map +1 -1
  319. package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.js +111 -68
  320. package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.js.map +1 -1
  321. package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.mjs +108 -142
  322. package/dist/inquiry/v2/capabilities/actions/EntityFormSurface.mjs.map +1 -1
  323. package/dist/inquiry/v2/capabilities/actions/RetrieveSurface.mjs +1 -1
  324. package/dist/inquiry/v2/capabilities/actions/actionModel.d.ts +66 -50
  325. package/dist/inquiry/v2/capabilities/actions/actionModel.d.ts.map +1 -1
  326. package/dist/inquiry/v2/capabilities/actions/actionModel.js +141 -66
  327. package/dist/inquiry/v2/capabilities/actions/actionModel.js.map +1 -1
  328. package/dist/inquiry/v2/capabilities/actions/actionModel.mjs +115 -53
  329. package/dist/inquiry/v2/capabilities/actions/actionModel.mjs.map +1 -1
  330. package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.d.ts +26 -0
  331. package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.d.ts.map +1 -0
  332. package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.js +36 -0
  333. package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.js.map +1 -0
  334. package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.mjs +41 -0
  335. package/dist/inquiry/v2/capabilities/actions/parentKeyDefaults.mjs.map +1 -0
  336. package/dist/inquiry/v2/capabilities/actions/runAction.d.ts +3 -2
  337. package/dist/inquiry/v2/capabilities/actions/runAction.d.ts.map +1 -1
  338. package/dist/inquiry/v2/capabilities/actions/runAction.js +27 -23
  339. package/dist/inquiry/v2/capabilities/actions/runAction.js.map +1 -1
  340. package/dist/inquiry/v2/capabilities/actions/runAction.mjs +26 -20
  341. package/dist/inquiry/v2/capabilities/actions/runAction.mjs.map +1 -1
  342. package/dist/inquiry/v2/capabilities/actions/useHeaderFold.d.ts +20 -0
  343. package/dist/inquiry/v2/capabilities/actions/useHeaderFold.d.ts.map +1 -0
  344. package/dist/inquiry/v2/capabilities/actions/useHeaderFold.js +112 -0
  345. package/dist/inquiry/v2/capabilities/actions/useHeaderFold.js.map +1 -0
  346. package/dist/inquiry/v2/capabilities/actions/useHeaderFold.mjs +118 -0
  347. package/dist/inquiry/v2/capabilities/actions/useHeaderFold.mjs.map +1 -0
  348. package/dist/inquiry/v2/capabilities/actions/useSheetPanel.d.ts +25 -1
  349. package/dist/inquiry/v2/capabilities/actions/useSheetPanel.d.ts.map +1 -1
  350. package/dist/inquiry/v2/capabilities/actions/useSheetPanel.js +7 -4
  351. package/dist/inquiry/v2/capabilities/actions/useSheetPanel.js.map +1 -1
  352. package/dist/inquiry/v2/capabilities/actions/useSheetPanel.mjs +9 -4
  353. package/dist/inquiry/v2/capabilities/actions/useSheetPanel.mjs.map +1 -1
  354. package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.d.ts +5 -3
  355. package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.d.ts.map +1 -1
  356. package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.js +11 -8
  357. package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.js.map +1 -1
  358. package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.mjs +13 -7
  359. package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.mjs.map +1 -1
  360. package/dist/inquiry/v2/capabilities/alerts/AlertsCapability.module.css +4 -4
  361. package/dist/inquiry/v2/capabilities/header/HeaderCapability.d.ts +1 -1
  362. package/dist/inquiry/v2/capabilities/header/HeaderCapability.d.ts.map +1 -1
  363. package/dist/inquiry/v2/capabilities/header/HeaderCapability.js +20 -17
  364. package/dist/inquiry/v2/capabilities/header/HeaderCapability.js.map +1 -1
  365. package/dist/inquiry/v2/capabilities/header/HeaderCapability.mjs +101 -111
  366. package/dist/inquiry/v2/capabilities/header/HeaderCapability.mjs.map +1 -1
  367. package/dist/inquiry/v2/capabilities/header/HeaderCapability.module.css +9 -6
  368. package/dist/inquiry/v2/capabilities/tabs/TabsCapability.d.ts +2 -1
  369. package/dist/inquiry/v2/capabilities/tabs/TabsCapability.d.ts.map +1 -1
  370. package/dist/inquiry/v2/capabilities/tabs/TabsCapability.js +9 -2
  371. package/dist/inquiry/v2/capabilities/tabs/TabsCapability.js.map +1 -1
  372. package/dist/inquiry/v2/capabilities/tabs/TabsCapability.mjs +18 -15
  373. package/dist/inquiry/v2/capabilities/tabs/TabsCapability.mjs.map +1 -1
  374. package/dist/inquiry/v2/index.d.ts +0 -1
  375. package/dist/inquiry/v2/index.d.ts.map +1 -1
  376. package/dist/inquiry/v2/index.js.map +1 -1
  377. package/dist/inquiry/v2/kernel/ActionRunnerContext.d.ts +3 -3
  378. package/dist/inquiry/v2/kernel/ActionRunnerContext.d.ts.map +1 -1
  379. package/dist/inquiry/v2/kernel/ActionRunnerContext.js +11 -5
  380. package/dist/inquiry/v2/kernel/ActionRunnerContext.js.map +1 -1
  381. package/dist/inquiry/v2/kernel/ActionRunnerContext.mjs +15 -12
  382. package/dist/inquiry/v2/kernel/ActionRunnerContext.mjs.map +1 -1
  383. package/dist/inquiry/v2/kernel/ReadOnlyContext.d.ts +3 -0
  384. package/dist/inquiry/v2/kernel/ReadOnlyContext.d.ts.map +1 -0
  385. package/dist/inquiry/v2/kernel/ReadOnlyContext.js +14 -0
  386. package/dist/inquiry/v2/kernel/ReadOnlyContext.js.map +1 -0
  387. package/dist/inquiry/v2/kernel/ReadOnlyContext.mjs +20 -0
  388. package/dist/inquiry/v2/kernel/ReadOnlyContext.mjs.map +1 -0
  389. package/dist/inquiry/v2/kernel/RecordContext.d.ts +2 -0
  390. package/dist/inquiry/v2/kernel/RecordContext.d.ts.map +1 -1
  391. package/dist/inquiry/v2/kernel/RecordContext.js.map +1 -1
  392. package/dist/inquiry/v2/kernel/RecordContext.mjs.map +1 -1
  393. package/dist/inquiry/v2/kernel/UdpNodeView.d.ts.map +1 -1
  394. package/dist/inquiry/v2/kernel/UdpNodeView.js +18 -13
  395. package/dist/inquiry/v2/kernel/UdpNodeView.js.map +1 -1
  396. package/dist/inquiry/v2/kernel/UdpNodeView.mjs +177 -140
  397. package/dist/inquiry/v2/kernel/UdpNodeView.mjs.map +1 -1
  398. package/dist/inquiry/v2/kernel/UdpNodeView.module.css +56 -5
  399. package/dist/inquiry/v2/kernel/capabilities.d.ts +0 -2
  400. package/dist/inquiry/v2/kernel/capabilities.d.ts.map +1 -1
  401. package/dist/inquiry/v2/kernel/capabilities.js.map +1 -1
  402. package/dist/inquiry/v2/kernel/capabilities.mjs.map +1 -1
  403. package/dist/inquiry/v2/landing/InquiryExplorePage.d.ts +26 -37
  404. package/dist/inquiry/v2/landing/InquiryExplorePage.d.ts.map +1 -1
  405. package/dist/inquiry/v2/landing/InquiryExplorePage.js +48 -57
  406. package/dist/inquiry/v2/landing/InquiryExplorePage.js.map +1 -1
  407. package/dist/inquiry/v2/landing/InquiryExplorePage.mjs +102 -106
  408. package/dist/inquiry/v2/landing/InquiryExplorePage.mjs.map +1 -1
  409. package/dist/inquiry/v2/landing/InquiryExplorePage.module.css +58 -6
  410. package/dist/inquiry/v2/landing/InquiryLanding.d.ts +3 -3
  411. package/dist/inquiry/v2/landing/InquiryLanding.d.ts.map +1 -1
  412. package/dist/inquiry/v2/landing/InquiryLanding.js +8 -3
  413. package/dist/inquiry/v2/landing/InquiryLanding.js.map +1 -1
  414. package/dist/inquiry/v2/landing/InquiryLanding.mjs +51 -35
  415. package/dist/inquiry/v2/landing/InquiryLanding.mjs.map +1 -1
  416. package/dist/inquiry/v2/landing/InquiryLanding.module.css +8 -0
  417. package/dist/inquiry/v2/page/UdpPageRenderer.d.ts +5 -1
  418. package/dist/inquiry/v2/page/UdpPageRenderer.d.ts.map +1 -1
  419. package/dist/inquiry/v2/page/UdpPageRenderer.js +13 -1
  420. package/dist/inquiry/v2/page/UdpPageRenderer.js.map +1 -1
  421. package/dist/inquiry/v2/page/UdpPageRenderer.mjs +36 -7
  422. package/dist/inquiry/v2/page/UdpPageRenderer.mjs.map +1 -1
  423. package/dist/inquiry/v2/search/InquirySearchPanel.d.ts +1 -7
  424. package/dist/inquiry/v2/search/InquirySearchPanel.d.ts.map +1 -1
  425. package/dist/inquiry/v2/search/InquirySearchPanel.js +6 -13
  426. package/dist/inquiry/v2/search/InquirySearchPanel.js.map +1 -1
  427. package/dist/inquiry/v2/search/InquirySearchPanel.mjs +4 -8
  428. package/dist/inquiry/v2/search/InquirySearchPanel.mjs.map +1 -1
  429. package/dist/inquiry/v2/search/RecordFinder.d.ts +30 -1
  430. package/dist/inquiry/v2/search/RecordFinder.d.ts.map +1 -1
  431. package/dist/inquiry/v2/search/RecordFinder.js +43 -20
  432. package/dist/inquiry/v2/search/RecordFinder.js.map +1 -1
  433. package/dist/inquiry/v2/search/RecordFinder.mjs +68 -42
  434. package/dist/inquiry/v2/search/RecordFinder.mjs.map +1 -1
  435. package/dist/inquiry/v2/search/index.d.ts +3 -3
  436. package/dist/inquiry/v2/search/index.d.ts.map +1 -1
  437. package/dist/inquiry/v2/search/index.js +1 -1
  438. package/dist/inquiry/v2/search/index.js.map +1 -1
  439. package/dist/inquiry/v2/search/searchModel.d.ts +130 -23
  440. package/dist/inquiry/v2/search/searchModel.d.ts.map +1 -1
  441. package/dist/inquiry/v2/search/searchModel.js +237 -36
  442. package/dist/inquiry/v2/search/searchModel.js.map +1 -1
  443. package/dist/inquiry/v2/search/searchModel.mjs +207 -34
  444. package/dist/inquiry/v2/search/searchModel.mjs.map +1 -1
  445. package/dist/inquiry/v2/search/useInquirySearch.d.ts.map +1 -1
  446. package/dist/inquiry/v2/search/useInquirySearch.js +46 -19
  447. package/dist/inquiry/v2/search/useInquirySearch.js.map +1 -1
  448. package/dist/inquiry/v2/search/useInquirySearch.mjs +83 -84
  449. package/dist/inquiry/v2/search/useInquirySearch.mjs.map +1 -1
  450. package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.d.ts +4 -1
  451. package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.d.ts.map +1 -1
  452. package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.js +174 -166
  453. package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.js.map +1 -1
  454. package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.mjs +343 -325
  455. package/dist/inquiry/v2/tree/InquiryFluentTreeMenu.mjs.map +1 -1
  456. package/dist/inquiry/v2/tree/InquiryMenuToolbar.d.ts +3 -1
  457. package/dist/inquiry/v2/tree/InquiryMenuToolbar.d.ts.map +1 -1
  458. package/dist/inquiry/v2/tree/InquiryMenuToolbar.js +8 -7
  459. package/dist/inquiry/v2/tree/InquiryMenuToolbar.js.map +1 -1
  460. package/dist/inquiry/v2/tree/InquiryMenuToolbar.mjs +68 -72
  461. package/dist/inquiry/v2/tree/InquiryMenuToolbar.mjs.map +1 -1
  462. package/dist/inquiry/v2/tree/LoadRecordDialog.d.ts +3 -3
  463. package/dist/inquiry/v2/tree/LoadRecordDialog.d.ts.map +1 -1
  464. package/dist/inquiry/v2/tree/LoadRecordDialog.js +12 -7
  465. package/dist/inquiry/v2/tree/LoadRecordDialog.js.map +1 -1
  466. package/dist/inquiry/v2/tree/LoadRecordDialog.mjs +48 -33
  467. package/dist/inquiry/v2/tree/LoadRecordDialog.mjs.map +1 -1
  468. package/dist/inquiry/v2/tree/NodeList.d.ts.map +1 -1
  469. package/dist/inquiry/v2/tree/NodeList.js +17 -6
  470. package/dist/inquiry/v2/tree/NodeList.js.map +1 -1
  471. package/dist/inquiry/v2/tree/NodeList.mjs +49 -36
  472. package/dist/inquiry/v2/tree/NodeList.mjs.map +1 -1
  473. package/dist/inquiry/v2/tree/arrivalModel.d.ts +15 -0
  474. package/dist/inquiry/v2/tree/arrivalModel.d.ts.map +1 -1
  475. package/dist/inquiry/v2/tree/arrivalModel.js +14 -1
  476. package/dist/inquiry/v2/tree/arrivalModel.js.map +1 -1
  477. package/dist/inquiry/v2/tree/arrivalModel.mjs +12 -1
  478. package/dist/inquiry/v2/tree/arrivalModel.mjs.map +1 -1
  479. package/dist/inquiry/v2/tree/branchRefreshModel.d.ts +32 -0
  480. package/dist/inquiry/v2/tree/branchRefreshModel.d.ts.map +1 -0
  481. package/dist/inquiry/v2/tree/branchRefreshModel.js +62 -0
  482. package/dist/inquiry/v2/tree/branchRefreshModel.js.map +1 -0
  483. package/dist/inquiry/v2/tree/branchRefreshModel.mjs +60 -0
  484. package/dist/inquiry/v2/tree/branchRefreshModel.mjs.map +1 -0
  485. package/dist/inquiry/v2/tree/droppedPageModel.d.ts +23 -1
  486. package/dist/inquiry/v2/tree/droppedPageModel.d.ts.map +1 -1
  487. package/dist/inquiry/v2/tree/droppedPageModel.js +53 -26
  488. package/dist/inquiry/v2/tree/droppedPageModel.js.map +1 -1
  489. package/dist/inquiry/v2/tree/droppedPageModel.mjs +48 -20
  490. package/dist/inquiry/v2/tree/droppedPageModel.mjs.map +1 -1
  491. package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.d.ts +7 -12
  492. package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.d.ts.map +1 -1
  493. package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.js +44 -15
  494. package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.js.map +1 -1
  495. package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.mjs +34 -15
  496. package/dist/inquiry/v2/tree/fluentTreeMenu/treeMenuVisuals.mjs.map +1 -1
  497. package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.d.ts.map +1 -1
  498. package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.js +7 -18
  499. package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.js.map +1 -1
  500. package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.mjs +6 -14
  501. package/dist/inquiry/v2/tree/fluentTreeMenu/useAggregateBadges.mjs.map +1 -1
  502. package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.d.ts +20 -16
  503. package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.d.ts.map +1 -1
  504. package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.js +77 -55
  505. package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.js.map +1 -1
  506. package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.mjs +85 -106
  507. package/dist/inquiry/v2/tree/fluentTreeMenu/useChildCountBadges.mjs.map +1 -1
  508. package/dist/inquiry/v2/tree/lineageModel.d.ts +18 -1
  509. package/dist/inquiry/v2/tree/lineageModel.d.ts.map +1 -1
  510. package/dist/inquiry/v2/tree/lineageModel.js +71 -2
  511. package/dist/inquiry/v2/tree/lineageModel.js.map +1 -1
  512. package/dist/inquiry/v2/tree/lineageModel.mjs +53 -3
  513. package/dist/inquiry/v2/tree/lineageModel.mjs.map +1 -1
  514. package/dist/inquiry/v2/tree/menuRebuildModel.d.ts +10 -27
  515. package/dist/inquiry/v2/tree/menuRebuildModel.d.ts.map +1 -1
  516. package/dist/inquiry/v2/tree/menuRebuildModel.js +8 -58
  517. package/dist/inquiry/v2/tree/menuRebuildModel.js.map +1 -1
  518. package/dist/inquiry/v2/tree/menuRebuildModel.mjs +8 -51
  519. package/dist/inquiry/v2/tree/menuRebuildModel.mjs.map +1 -1
  520. package/dist/inquiry/v2/tree/pagedChildrenModel.d.ts +26 -0
  521. package/dist/inquiry/v2/tree/pagedChildrenModel.d.ts.map +1 -0
  522. package/dist/inquiry/v2/tree/pagedChildrenModel.js +56 -0
  523. package/dist/inquiry/v2/tree/pagedChildrenModel.js.map +1 -0
  524. package/dist/inquiry/v2/tree/pagedChildrenModel.mjs +43 -0
  525. package/dist/inquiry/v2/tree/pagedChildrenModel.mjs.map +1 -0
  526. package/dist/inquiry/v2/tree/rootRemovalModel.d.ts +7 -0
  527. package/dist/inquiry/v2/tree/rootRemovalModel.d.ts.map +1 -1
  528. package/dist/inquiry/v2/tree/rootRemovalModel.js +31 -5
  529. package/dist/inquiry/v2/tree/rootRemovalModel.js.map +1 -1
  530. package/dist/inquiry/v2/tree/rootRemovalModel.mjs +21 -4
  531. package/dist/inquiry/v2/tree/rootRemovalModel.mjs.map +1 -1
  532. package/dist/inquiry/v2/tree/treeFilterModel.d.ts +0 -2
  533. package/dist/inquiry/v2/tree/treeFilterModel.d.ts.map +1 -1
  534. package/dist/inquiry/v2/tree/treeFilterModel.js +0 -7
  535. package/dist/inquiry/v2/tree/treeFilterModel.js.map +1 -1
  536. package/dist/inquiry/v2/tree/treeFilterModel.mjs.map +1 -1
  537. package/dist/inquiry/v2/tree/useInquiryMenu.d.ts +16 -7
  538. package/dist/inquiry/v2/tree/useInquiryMenu.d.ts.map +1 -1
  539. package/dist/inquiry/v2/tree/useInquiryMenu.js +401 -163
  540. package/dist/inquiry/v2/tree/useInquiryMenu.js.map +1 -1
  541. package/dist/inquiry/v2/tree/useInquiryMenu.mjs +511 -310
  542. package/dist/inquiry/v2/tree/useInquiryMenu.mjs.map +1 -1
  543. package/dist/inquiry/v2/tree/waveLoader.d.ts +10 -11
  544. package/dist/inquiry/v2/tree/waveLoader.d.ts.map +1 -1
  545. package/dist/inquiry/v2/tree/waveLoader.js +78 -72
  546. package/dist/inquiry/v2/tree/waveLoader.js.map +1 -1
  547. package/dist/inquiry/v2/tree/waveLoader.mjs +79 -68
  548. package/dist/inquiry/v2/tree/waveLoader.mjs.map +1 -1
  549. package/dist/inquiry/v2/widgets/listRow.module.css +27 -0
  550. package/dist/inquiry/v2/widgets/widgetRowModel.d.ts +6 -2
  551. package/dist/inquiry/v2/widgets/widgetRowModel.d.ts.map +1 -1
  552. package/dist/inquiry/v2/widgets/widgetRowModel.js +49 -14
  553. package/dist/inquiry/v2/widgets/widgetRowModel.js.map +1 -1
  554. package/dist/inquiry/v2/widgets/widgetRowModel.mjs +36 -12
  555. package/dist/inquiry/v2/widgets/widgetRowModel.mjs.map +1 -1
  556. package/dist/maintenance/UdpTaggedRecordsPage.mjs +1 -1
  557. package/dist/maintenance/api/lookupApi.mjs +1 -1
  558. package/dist/maintenance/api/tagsApi.mjs +1 -1
  559. package/dist/maintenance/config/nodeDefaults.d.ts.map +1 -1
  560. package/dist/maintenance/config/nodeDefaults.js +16 -5
  561. package/dist/maintenance/config/nodeDefaults.js.map +1 -1
  562. package/dist/maintenance/config/nodeDefaults.mjs +14 -5
  563. package/dist/maintenance/config/nodeDefaults.mjs.map +1 -1
  564. package/dist/maintenance/config/useEntityConfig.mjs +1 -1
  565. package/dist/maintenance/config/useLinkedLabels.mjs +1 -1
  566. package/dist/maintenance/grid/MaintenanceGrid.mjs +1 -1
  567. package/dist/maintenance/metadata/useEntityMetadata.mjs +1 -1
  568. package/dist/maintenance/record/ChildTab.mjs +1 -1
  569. package/dist/maintenance/record/DeleteRecordDialog.mjs +1 -1
  570. package/dist/maintenance/record/LinkRecordsSheet.mjs +1 -1
  571. package/dist/maintenance/record/RecordFacts.mjs +1 -1
  572. package/dist/maintenance/record/RecordSheet.mjs +2 -2
  573. package/dist/maintenance/record/displayValue.mjs +1 -1
  574. package/dist/maintenance/record/stampDisplayText.mjs +1 -1
  575. package/dist/maintenance/settings/UdpEntitySettingsPage.d.ts.map +1 -1
  576. package/dist/maintenance/settings/UdpEntitySettingsPage.js +3 -0
  577. package/dist/maintenance/settings/UdpEntitySettingsPage.js.map +1 -1
  578. package/dist/maintenance/settings/UdpEntitySettingsPage.mjs +2 -0
  579. package/dist/maintenance/settings/UdpEntitySettingsPage.mjs.map +1 -1
  580. package/dist/maintenance/settings/useEntityCatalog.mjs +1 -1
  581. package/dist/maintenanceEngine/tableBrowser/TableColumnDefs.d.ts +4 -5
  582. package/dist/maintenanceEngine/tableBrowser/TableColumnDefs.d.ts.map +1 -1
  583. package/dist/page/PageContainer/PageContainer.d.ts.map +1 -1
  584. package/dist/page/PageContainer/PageContainer.js +4 -11
  585. package/dist/page/PageContainer/PageContainer.js.map +1 -1
  586. package/dist/page/PageContainer/PageContainer.mjs +39 -50
  587. package/dist/page/PageContainer/PageContainer.mjs.map +1 -1
  588. package/dist/stores/inquiryStore.d.ts +2 -1
  589. package/dist/stores/inquiryStore.d.ts.map +1 -1
  590. package/dist/stores/inquiryStore.js +4 -3
  591. package/dist/stores/inquiryStore.js.map +1 -1
  592. package/dist/stores/inquiryStore.mjs +18 -11
  593. package/dist/stores/inquiryStore.mjs.map +1 -1
  594. package/dist/udp/extraFields/useExtraFieldsGridConfig.d.ts +3 -2
  595. package/dist/udp/extraFields/useExtraFieldsGridConfig.d.ts.map +1 -1
  596. package/dist/udp/extraFields/useExtraFieldsGridConfig.js +7 -6
  597. package/dist/udp/extraFields/useExtraFieldsGridConfig.js.map +1 -1
  598. package/dist/udp/extraFields/useExtraFieldsGridConfig.mjs +27 -22
  599. package/dist/udp/extraFields/useExtraFieldsGridConfig.mjs.map +1 -1
  600. package/dist/udp/fileImportMapping/FileImportMappingWizard.d.ts.map +1 -1
  601. package/dist/udp/fileImportMapping/FileImportMappingWizard.js +4 -4
  602. package/dist/udp/fileImportMapping/FileImportMappingWizard.js.map +1 -1
  603. package/dist/udp/fileImportMapping/FileImportMappingWizard.mjs +10 -9
  604. package/dist/udp/fileImportMapping/FileImportMappingWizard.mjs.map +1 -1
  605. package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.d.ts.map +1 -1
  606. package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.js +1 -1
  607. package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.js.map +1 -1
  608. package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.mjs +2 -1
  609. package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.mjs.map +1 -1
  610. package/dist/udp/pages/UdpMaintenanceEnginePage/components/EntitiyTimeLine.mjs +1 -1
  611. package/dist/udp/pages/UdpTransactionsPage/components/DynamicTransactionDomainForm.d.ts.map +1 -1
  612. package/dist/udp/pages/UdpTransactionsPage/components/DynamicTransactionDomainForm.js +84 -27
  613. package/dist/udp/pages/UdpTransactionsPage/components/DynamicTransactionDomainForm.js.map +1 -1
  614. package/dist/udp/pages/UdpTransactionsPage/components/DynamicTransactionDomainForm.mjs +53 -23
  615. package/dist/udp/pages/UdpTransactionsPage/components/DynamicTransactionDomainForm.mjs.map +1 -1
  616. package/dist/udp/pages/UdpTransactionsPage/components/DynamicTransactionDomainFormFields.d.ts.map +1 -1
  617. package/dist/udp/pages/UdpTransactionsPage/components/DynamicTransactionDomainFormFields.js +45 -32
  618. package/dist/udp/pages/UdpTransactionsPage/components/DynamicTransactionDomainFormFields.js.map +1 -1
  619. package/dist/udp/pages/UdpTransactionsPage/components/DynamicTransactionDomainFormFields.mjs +27 -33
  620. package/dist/udp/pages/UdpTransactionsPage/components/DynamicTransactionDomainFormFields.mjs.map +1 -1
  621. package/dist/udp/pages/UdpTranslationsPage/UdpTranslationsPage.d.ts.map +1 -1
  622. package/dist/udp/pages/UdpTranslationsPage/UdpTranslationsPage.js +14 -16
  623. package/dist/udp/pages/UdpTranslationsPage/UdpTranslationsPage.js.map +1 -1
  624. package/dist/udp/pages/UdpTranslationsPage/UdpTranslationsPage.mjs +2 -4
  625. package/dist/udp/pages/UdpTranslationsPage/UdpTranslationsPage.mjs.map +1 -1
  626. package/dist/udp/utilities/useDateStringColumnDef.d.ts +1 -1
  627. package/dist/utilities/i18n/locales/es-US.json +24 -9
  628. package/dist/utilities/i18n/locales/es-US.mjs +25 -8
  629. package/dist/utilities/i18n/locales/fr-CA.json +24 -9
  630. package/dist/utilities/i18n/locales/fr-CA.mjs +25 -8
  631. package/dist/utilities/tree/TreeUtilities.d.ts +10 -10
  632. package/dist/utilities/tree/TreeUtilities.d.ts.map +1 -1
  633. package/dist/utilities/tree/TreeUtilities.js +41 -58
  634. package/dist/utilities/tree/TreeUtilities.js.map +1 -1
  635. package/dist/utilities/tree/TreeUtilities.mjs +32 -41
  636. package/dist/utilities/tree/TreeUtilities.mjs.map +1 -1
  637. package/dist/utilities/tree/lazyLevels.d.ts +32 -0
  638. package/dist/utilities/tree/lazyLevels.d.ts.map +1 -0
  639. package/dist/utilities/tree/lazyLevels.js +25 -0
  640. package/dist/utilities/tree/lazyLevels.js.map +1 -0
  641. package/dist/utilities/tree/lazyLevels.mjs +16 -0
  642. package/dist/utilities/tree/lazyLevels.mjs.map +1 -0
  643. package/dist/utilities/types.d.ts +4 -4
  644. package/dist/utilities/types.d.ts.map +1 -1
  645. package/package.json +62 -18
  646. package/dist/actionPanels/PanelActionForm.d.ts +0 -56
  647. package/dist/actionPanels/PanelActionForm.d.ts.map +0 -1
  648. package/dist/actionPanels/PanelActionForm.js +0 -30
  649. package/dist/actionPanels/PanelActionForm.js.map +0 -1
  650. package/dist/actionPanels/PanelActionForm.mjs +0 -168
  651. package/dist/actionPanels/PanelActionForm.mjs.map +0 -1
  652. package/dist/actionPanels/PanelEditor.d.ts +0 -44
  653. package/dist/actionPanels/PanelEditor.d.ts.map +0 -1
  654. package/dist/actionPanels/PanelEditor.js +0 -78
  655. package/dist/actionPanels/PanelEditor.js.map +0 -1
  656. package/dist/actionPanels/PanelEditor.mjs +0 -345
  657. package/dist/actionPanels/PanelEditor.mjs.map +0 -1
  658. package/dist/actionPanels/panelActionFields.module.css +0 -18
  659. package/dist/domain/inquiryTree/ruleBindings.d.ts +0 -10
  660. package/dist/domain/inquiryTree/ruleBindings.d.ts.map +0 -1
  661. package/dist/domain/inquiryTree/ruleBindings.js +0 -20
  662. package/dist/domain/inquiryTree/ruleBindings.js.map +0 -1
  663. package/dist/domain/inquiryTree/ruleBindings.mjs +0 -21
  664. package/dist/domain/inquiryTree/ruleBindings.mjs.map +0 -1
  665. package/dist/inquiry/v2/kernel/readOnlyModel.d.ts +0 -17
  666. package/dist/inquiry/v2/kernel/readOnlyModel.d.ts.map +0 -1
  667. package/dist/inquiry/v2/kernel/readOnlyModel.js +0 -19
  668. package/dist/inquiry/v2/kernel/readOnlyModel.js.map +0 -1
  669. package/dist/inquiry/v2/kernel/readOnlyModel.mjs +0 -21
  670. package/dist/inquiry/v2/kernel/readOnlyModel.mjs.map +0 -1
@@ -30,6 +30,12 @@ const buildSearchRequestData = (searchFilterElements, page, pageSize) => {
30
30
  });
31
31
  return searchObject;
32
32
  };
33
+ /**
34
+ * A parent link value that is present but empty (null or ''). Such a parent
35
+ * has no children by definition, and `FK = null` is a server error, not an
36
+ * empty answer — so it is never searched, counted or put in an IN list.
37
+ */
38
+ const isBlankKeyValue = (value) => value === null || value === "";
33
39
  /** `keyField IN (values)` — the bulk child fetch/count filter. */
34
40
  const inFilter = (keyField, keyValues) => ({
35
41
  searchField: keyField,
@@ -66,8 +72,9 @@ const getEntityAssoc = (nodeEntity, node, propertyName) => {
66
72
  *
67
73
  * Quirks kept verbatim:
68
74
  * - pageSize = parseInt(noOfNodesDisplayed) || 50 (:753);
69
- * - `childEntityAssoc.Cardinality` is read unguarded, so a parent entity with
70
- * no catalog reference to the child THROWS exactly like legacy (:784);
75
+ * - a parent entity with no catalog reference to the child produces NO
76
+ * descriptor, only an 'Error: no catalog association …' message (legacy
77
+ * threw here, :784);
71
78
  * - all-caps key names lowercase whole, others lower first char (:817-828);
72
79
  * - a joining-table base search flips baseSearch and nulls the
73
80
  * joiningEntityKeyName decorations (:794-801, :883-886);
@@ -108,6 +115,10 @@ const buildLazyLoadDescriptors = (node, parentRow, childNodes, catalogObjects, p
108
115
  let usingJoiningTableForSearch = false;
109
116
  if (nodeEntity) {
110
117
  const childEntityAssoc = getEntityAssoc(nodeEntity, childNode, childNode.properties?.catalogObjectKey);
118
+ if (!childEntityAssoc) {
119
+ errorRetrievingChildren = `Error: no catalog association from ${node.properties?.catalogReturnObject} to ${entityName}`;
120
+ return;
121
+ }
111
122
  let promotedEntityForJoiningTable;
112
123
  if (childEntityAssoc.Cardinality === 2) {
113
124
  isManyToManySearch = true;
@@ -132,7 +143,7 @@ const buildLazyLoadDescriptors = (node, parentRow, childNodes, catalogObjects, p
132
143
  });
133
144
  });
134
145
  }
135
- if (childEntityAssoc && Object.keys(childEntityAssoc).length) childEntityAssoc.Keys?.forEach((keyVal) => {
146
+ if (Object.keys(childEntityAssoc).length) childEntityAssoc.Keys?.forEach((keyVal) => {
136
147
  const keyValArr = keyVal.split(",");
137
148
  let searchJoiningEntity = "";
138
149
  if (!isManyToManySearch && Object.prototype.hasOwnProperty.call(nodeObj, node.properties.joiningEntityCatalogObjectKey)) searchJoiningEntity = node.properties.joiningEntityCatalogObjectKey;
@@ -197,81 +208,6 @@ const buildLazyLoadDescriptors = (node, parentRow, childNodes, catalogObjects, p
197
208
  errorRetrievingChildren
198
209
  };
199
210
  };
200
- /**
201
- * Port of getVaryingChildKey (TreeUtilities.js:964-981): for one descriptor,
202
- * find the child-entity PK column that VARIES across siblings under the same
203
- * parent — the first identifier not already fixed by the descriptor's filters
204
- * (compared case-insensitively). Feeds IN / NOT IN filters that target only
205
- * the varying component of a composite key.
206
- */
207
- const getVaryingChildKey = (searchMethod, catalogObjects) => {
208
- const childPkFields = getSearchIdentifiers(catalogObjects, searchMethod?.catalogReturnObject);
209
- if (!childPkFields?.length) return null;
210
- const fixedFieldNames = new Set((searchMethod?.data?.filterElements || []).map((fe) => fe.searchField).filter(Boolean).map((n) => n.toLowerCase()));
211
- return childPkFields.find((pk) => !fixedFieldNames.has(pk.toLowerCase())) || null;
212
- };
213
- /**
214
- * Port of collectChildVaryingKeysByType (TreeUtilities.js:986-1016): walk a
215
- * parent's loaded children and group their varying-PK values by entity type.
216
- * Output shape `{ [entityType]: values[] }` feeds keysByTypeToFilterArray.
217
- * Read-only over the same structural shape as legacy, so Phase B call sites
218
- * (InquiryContainer.jsx:1324, :1410) pass their node unchanged.
219
- */
220
- const collectChildVaryingKeysByType = (parentNode, catalogObjects, childrenOverride = null) => {
221
- const children = childrenOverride || parentNode?.children || [];
222
- const result = {};
223
- for (const child of children) {
224
- if (child?.isGroupNode) continue;
225
- const type = child?.properties?.catalogReturnObject;
226
- if (!type) continue;
227
- const sm = parentNode?.lazyLoadChildrenArr?.find((m) => m.catalogReturnObject === type);
228
- if (!sm) continue;
229
- const varyingField = getVaryingChildKey(sm, catalogObjects);
230
- if (!varyingField) continue;
231
- const value = child.nodeObj?.[varyingField];
232
- if (value == null) continue;
233
- if (!result[type]) result[type] = [];
234
- result[type].push(value);
235
- }
236
- return result;
237
- };
238
- /**
239
- * Port of keysByTypeToFilterArray (TreeUtilities.js:1020-1024): keys-by-type
240
- * map → the inclusionFilter / exclusionFilter array shape consumed by the
241
- * lazy-child request builder.
242
- */
243
- const keysByTypeToFilterArray = (keysByType) => Object.entries(keysByType || {}).map(([entityType, keys]) => ({
244
- entityType,
245
- keys
246
- }));
247
- /**
248
- * Pure request-shaping half of fetchCountsByType (TreeUtilities.js:1029-1040):
249
- * one count-only query per descriptor using parent-context filters only
250
- * (no IN/NOT IN) — `{ ...sm.data, pageNumber: 1, pageSize: 1 }`.
251
- */
252
- const buildCountRequests = (descriptors) => (descriptors ?? []).map((sm) => ({
253
- catalogReturnObject: sm.catalogReturnObject,
254
- apiMethodId: sm.apiMethodId,
255
- data: {
256
- ...sm.data,
257
- pageNumber: 1,
258
- pageSize: 1
259
- }
260
- }));
261
- /**
262
- * Pure response-mapping half of fetchCountsByType (TreeUtilities.js:1042-1048):
263
- * totals keyed by catalogReturnObject, keeping only numeric
264
- * `response.data.total` values (failed fetches pass null). Drives
265
- * `hasMoreChildren` detection after a refresh.
266
- */
267
- const collectCountsByType = (descriptors, responses) => {
268
- const out = {};
269
- (descriptors ?? []).forEach((sm, i) => {
270
- const total = responses[i]?.data?.total;
271
- if (typeof total === "number") out[sm.catalogReturnObject] = total;
272
- });
273
- return out;
274
- };
275
211
  const bulkRequestKey = (apiMethodId, keyField, filterKey) => filterKey ? `${apiMethodId}::${keyField}::${filterKey}` : `${apiMethodId}::${keyField}`;
276
212
  /**
277
213
  * The aggregate body every bulk count uses: `keyField IN (values) GROUP BY
@@ -305,7 +241,7 @@ const bulkCountableFilter = (sm) => {
305
241
  const filters = sm.data.filterElements ?? [];
306
242
  if (filters.length !== 1 || filters[0].searchOperator !== "=") return null;
307
243
  const value = filters[0].searchValue;
308
- if (typeof value !== "string" && typeof value !== "number") return null;
244
+ if (isBlankKeyValue(value) || typeof value !== "string" && typeof value !== "number") return null;
309
245
  return filters[0];
310
246
  };
311
247
  /**
@@ -313,7 +249,9 @@ const bulkCountableFilter = (sm) => {
313
249
  * aggregate request per (apiMethodId × parent-ref field), and report each
314
250
  * node's claims so responses can be summed back per node. A node whose
315
251
  * descriptors are not ALL bulk-countable gets NO claims (its total would be
316
- * partial — worse than unknown).
252
+ * partial — worse than unknown). A descriptor with a blank parent key value
253
+ * has no children (isBlankKeyValue) and claims nothing, so a node whose keys
254
+ * are all blank gets an empty claim list — a known zero.
317
255
  */
318
256
  const buildBulkChildCountRequests = (nodes) => {
319
257
  const buckets = /* @__PURE__ */ new Map();
@@ -323,6 +261,7 @@ const buildBulkChildCountRequests = (nodes) => {
323
261
  if (!descriptors.length) return;
324
262
  const claims = [];
325
263
  for (const sm of descriptors) {
264
+ if ((sm.data?.filterElements ?? []).some((filter) => isBlankKeyValue(filter.searchValue))) continue;
326
265
  const filter = bulkCountableFilter(sm);
327
266
  const methodId = sm.apiMethodId;
328
267
  if (!filter || methodId === null || methodId === void 0) return;
@@ -385,10 +324,11 @@ const collectBulkChildCounts = (request, response) => {
385
324
  * Sum a node's claims against fetched counts. Returns a number only when
386
325
  * EVERY claim's request resolved (countsByRequest holds a non-null map for
387
326
  * it) — an unknown anywhere means the total is unknown (null), never a lying
388
- * partial. Claimed keys missing from a resolved map count 0.
327
+ * partial. Claimed keys missing from a resolved map count 0, and an empty
328
+ * claim list is 0; no claims at all is unknown.
389
329
  */
390
330
  const sumBulkCountsForClaims = (claims, countsByRequest) => {
391
- if (!claims?.length) return null;
331
+ if (!claims) return null;
392
332
  let total = 0;
393
333
  for (const claim of claims) {
394
334
  const counts = countsByRequest.get(bulkRequestKey(claim.apiMethodId, claim.keyField, claim.filterKey));
@@ -446,22 +386,6 @@ const compileCountChipConditions = (conditions) => (conditions ?? []).filter((c)
446
386
  */
447
387
  const countChipFilterKey = (filterElements) => (filterElements ?? []).map((fe) => `${fe.searchField}${fe.searchOperator}${JSON.stringify(fe.searchValue)}`).sort().join("&");
448
388
  /**
449
- * Locate the CONFIG node for the child level a count chip names, in the flat
450
- * wire tree structure. A display row can't be asked for it: by the time rows
451
- * render, `children` holds materialized records (and none at all when the
452
- * count is zero), and display ids are re-minted. The config level is the one
453
- * whose catalogObjectKey is the chip's childKey and whose parent level returns
454
- * the same entity as the row — which is exactly how the chip's childKey is
455
- * defined.
456
- */
457
- const findCountChipChildConfig = (treeStructure, parentCatalogReturnObject, childKey) => {
458
- if (!treeStructure?.length || !childKey) return null;
459
- const byId = new Map(treeStructure.filter((n) => n?.id != null).map((n) => [String(n.id), n]));
460
- const candidates = treeStructure.filter((entry) => entry && !entry.isDeleted && entry.properties?.["catalogObjectKey"] === childKey);
461
- if (!candidates.length) return null;
462
- return candidates.find((entry) => byId.get(String(entry.parentId ?? ""))?.properties?.["catalogReturnObject"] === parentCatalogReturnObject) ?? (candidates.length === 1 ? candidates[0] : void 0) ?? null;
463
- };
464
- /**
465
389
  * The count-chip descriptor for a row whose level has no lazy descriptor for
466
390
  * the chip's binding — eager levels, and any row produced by a path that
467
391
  * doesn't build descriptors at all. The chip still needs the child binding's
@@ -470,19 +394,11 @@ const findCountChipChildConfig = (treeStructure, parentCatalogReturnObject, chil
470
394
  * child level the chip names — no second copy of the catalog-association walk,
471
395
  * and no client-side counting of the eager child arrays (page-size truncated,
472
396
  * and blind to the chip's filters).
473
- *
474
- * Returns null instead of throwing: buildLazyLoadDescriptors reproduces the
475
- * legacy unguarded assoc read (it throws when the parent entity has no catalog
476
- * reference to the child), and a chip must never take a row down with it.
477
397
  */
478
398
  const buildCountChipDescriptor = (node, parentRow, childNode, catalogObjects, promotedEntities) => {
479
399
  if (!node || !childNode) return null;
480
- try {
481
- const { descriptors } = buildLazyLoadDescriptors(node, parentRow, [childNode], catalogObjects, promotedEntities);
482
- return descriptors[0] ?? null;
483
- } catch {
484
- return null;
485
- }
400
+ const { descriptors } = buildLazyLoadDescriptors(node, parentRow, [childNode], catalogObjects, promotedEntities);
401
+ return descriptors[0] ?? null;
486
402
  };
487
403
  /**
488
404
  * Plan the count-chip counts for a page of rows: one claim per configured row,
@@ -491,7 +407,9 @@ const buildCountChipDescriptor = (node, parentRow, childNode, catalogObjects, pr
491
407
  * plus the compiled filters. A chip whose childKey names a binding that is not
492
408
  * bulk-countable (composite key, many-to-many) or that this row has no
493
409
  * descriptor for produces NO claim and therefore no chip, matching the
494
- * chevron path's exclusions.
410
+ * chevron path's exclusions. A row whose parent key is blank has no children
411
+ * (isBlankKeyValue): its claim is `null`, a known zero with nothing to fetch —
412
+ * as the chevron count reads it.
495
413
  */
496
414
  const buildCountChipClaims = (nodes) => {
497
415
  const buckets = /* @__PURE__ */ new Map();
@@ -501,6 +419,10 @@ const buildCountChipClaims = (nodes) => {
501
419
  if (!childKey) return;
502
420
  const descriptor = [...node.lazyLoadChildrenArr ?? [], ...node.countChipChildrenArr ?? []].find((sm) => sm.parentNodeRefKey === childKey);
503
421
  if (!descriptor) return;
422
+ if ((descriptor.data?.filterElements ?? []).some((filter) => isBlankKeyValue(filter.searchValue))) {
423
+ claimByNodeId[node.id] = null;
424
+ return;
425
+ }
504
426
  const filter = bulkCountableFilter(descriptor);
505
427
  const methodId = descriptor.apiMethodId;
506
428
  if (!filter || methodId === null || methodId === void 0) return;
@@ -541,83 +463,6 @@ const buildCountChipClaims = (nodes) => {
541
463
  };
542
464
  };
543
465
  /**
544
- * Port of getFilters (TreeUtilities.js:1062-1092): the descriptor's
545
- * parent-context filters plus optional inclusion (IN) and/or exclusion
546
- * (NOT IN) clauses on the varying child key. Used by:
547
- * - refresh path: includeKeys = preTree children's varying-key values
548
- * - Show More: excludeKeys = already-seen children's varying-key values
549
- * With neither provided, or when the varying key cannot be derived, the BASE
550
- * filterElements array is returned by reference — exactly like legacy.
551
- */
552
- const getFilters = (searchMethod, catalogObjects, { includeKeys = null, excludeKeys = null } = {}) => {
553
- const base = searchMethod?.data?.filterElements || [];
554
- const hasInclude = Array.isArray(includeKeys) && includeKeys.length > 0;
555
- const hasExclude = Array.isArray(excludeKeys) && excludeKeys.length > 0;
556
- if (!hasInclude && !hasExclude) return base;
557
- const varyingField = getVaryingChildKey(searchMethod, catalogObjects);
558
- if (!varyingField) return base;
559
- const fieldName = toUpperFirstChar(varyingField);
560
- const out = [...base];
561
- if (hasInclude) out.push({
562
- searchField: fieldName,
563
- searchValue: toWireString(includeKeys),
564
- searchOperator: "IN"
565
- });
566
- if (hasExclude) out.push({
567
- searchField: fieldName,
568
- searchValue: toWireString(excludeKeys),
569
- searchOperator: "NOTIN"
570
- });
571
- return out;
572
- };
573
- /**
574
- * Pure request-shaping of fetchLazyChildren (TreeUtilities.js:1238-1317) for
575
- * ONE descriptor: page overrides, targeted BusinessObjectKey fetch, and
576
- * IN/NOT IN varying-key filters via getFilters. Returns null when a targeted
577
- * fetch skips this descriptor (entity type mismatch — legacy `return` inside
578
- * the forEach :1262-1267). Quirks kept: an inclusion filter forces pageSize to
579
- * the include-key count (:1314-1316) and include/exclude are IGNORED during a
580
- * targeted fetch (:1305).
581
- */
582
- const buildLazyChildRequestData = (searchMethod, catalogObjects, options = {}) => {
583
- const { pageNumber = 1, pageSizeOverride = null, filterByBusinessObjectKey = null, targetEntityType = null, inclusionFilter = null, exclusionFilter = null } = options;
584
- const toArr = (f) => f ? Array.isArray(f) ? f : [f] : [];
585
- const inclusionList = toArr(inclusionFilter);
586
- const exclusionList = toArr(exclusionFilter);
587
- const isTargetedFetch = !!filterByBusinessObjectKey && !!targetEntityType;
588
- if (isTargetedFetch && searchMethod.catalogReturnObject !== targetEntityType) return null;
589
- let requestData = pageSizeOverride ? {
590
- ...searchMethod.data,
591
- pageNumber,
592
- pageSize: pageSizeOverride
593
- } : {
594
- ...searchMethod.data,
595
- pageNumber
596
- };
597
- if (isTargetedFetch) requestData = {
598
- ...requestData,
599
- pageSize: 1,
600
- filterElements: [...requestData.filterElements || [], {
601
- searchField: "BusinessObjectKey",
602
- searchValue: filterByBusinessObjectKey,
603
- searchOperator: "="
604
- }]
605
- };
606
- const includeForThis = inclusionList.find((f) => f.entityType === searchMethod.catalogReturnObject)?.keys;
607
- const excludeForThis = exclusionList.find((f) => f.entityType === searchMethod.catalogReturnObject)?.keys;
608
- if (!isTargetedFetch && (includeForThis?.length || excludeForThis?.length)) {
609
- requestData = {
610
- ...requestData,
611
- filterElements: getFilters(searchMethod, catalogObjects, {
612
- includeKeys: includeForThis,
613
- excludeKeys: excludeForThis
614
- })
615
- };
616
- if (includeForThis?.length) requestData.pageSize = includeForThis.length;
617
- }
618
- return requestData;
619
- };
620
- /**
621
466
  * Pure filter-building step of fetchManyToManyChildren
622
467
  * (TreeUtilities.js:1153-1172): one 'IN' filter per manyToManyKey collecting
623
468
  * the truthy searchValueKey values across the joining-table rows. Quirk kept:
@@ -642,6 +487,6 @@ const buildManyToManyChildFilterElements = (manyToManyKeys, items) => {
642
487
  return childFilterElements;
643
488
  };
644
489
  //#endregion
645
- export { buildBulkChildCountRequests, buildBulkCountAggregateData, buildCountChipClaims, buildCountChipDescriptor, buildCountRequests, buildLazyChildRequestData, buildLazyLoadDescriptors, buildManyToManyChildFilterElements, buildSearchRequestData, bulkChildCountRequestKey, collectBulkChildCounts, collectChildVaryingKeysByType, collectCountsByType, compileCountChipConditions, countChipFilterKey, findCountChipChildConfig, getFilters, getVaryingChildKey, inFilter, keysByTypeToFilterArray, sumBulkCountsForClaims };
490
+ export { buildBulkChildCountRequests, buildBulkCountAggregateData, buildCountChipClaims, buildCountChipDescriptor, buildLazyLoadDescriptors, buildManyToManyChildFilterElements, buildSearchRequestData, bulkChildCountRequestKey, collectBulkChildCounts, compileCountChipConditions, countChipFilterKey, inFilter, isBlankKeyValue, sumBulkCountsForClaims };
646
491
 
647
492
  //# sourceMappingURL=lazyLoad.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"lazyLoad.mjs","names":["CountChipCondition","CountChipConfig","CountChipOperator","EntityNode","CatalogObject","MANY_TO_MANY","getSearchIdentifiers","toWireString","StringUtilities","UnityBaseSearchMethod","apiMethodId","key","PromotedEntity","entityName","unityBaseSearchMethod","LazyFilterElement","searchField","searchValue","searchOperator","SearchRequestData","pageNumber","pageSize","filterElements","filterGroups","orderElements","groupingType","groupProperty","groupOperationList","eagerLoad","logicalSearchOperator","ManyToManyKey","searchItemIdentifier","searchNameKey","searchValueKey","LazyChildSearchDescriptor","data","parentNodeRefKey","catalogReturnObject","manyToManyKeys","manyToManyJointEntityApiMethodId","LazyLoadDescriptorsResult","descriptors","errorRetrievingChildren","EntityKeysFilter","entityType","keys","FirstCharCase","field","toLowerFirstChar","toUpperFirstChar","buildSearchRequestData","searchFilterElements","page","searchObject","forEach","property","push","inFilter","keyField","keyValues","join","ChildEntityAssoc","Cardinality","Keys","getEntityAssoc","nodeEntity","node","propertyName","entityAssoc","references","reference","properties","joiningEntityName","referenceProperty","find","name","undefined","extendedProperties","childEntityAssoc","SearchIdentifierEntry","searchJoiningEntity","joiningEntityKeyName","joiningEntityCatalogObjectLeftKeyName","buildLazyLoadDescriptors","parentRow","Record","childNodes","catalogObjects","promotedEntities","defaultSearchIdentifiers","parseInt","noOfNodesDisplayed","nodeObj","childNode","lazyNodeSearchObj","catalogObjectKey","promotedEntity","pe","searchIdentifiers","baseSearch","childBaseSearch","co","catalogObjectName","isManyToManySearch","usingJoiningTableForSearch","promotedEntityForJoiningTable","childNodeEntity","Object","length","keyVal","keyValArr","split","foreignKeyName","trim","parentIdentifierName","test","toLowerCase","prototype","hasOwnProperty","call","joiningEntityCatalogObjectKey","siObj","joiningEntityCatalogObjectLeftKey","joiningEntityChildKey","searchIdentifier","si","value","formattedPropertyName","getVaryingChildKey","searchMethod","childPkFields","fixedFieldNames","Set","map","fe","filter","Boolean","n","pk","has","LazyChildNodeRef","isGroupNode","LazyParentNodeRef","children","lazyLoadChildrenArr","collectChildVaryingKeysByType","parentNode","childrenOverride","result","child","type","sm","m","varyingField","keysByTypeToFilterArray","keysByType","entries","CountRequest","buildCountRequests","collectCountsByType","responses","Array","total","out","i","BulkChildCountRequest","filterKey","BulkCountClaim","keyValue","bulkRequestKey","buildBulkCountAggregateData","extraFilterElements","sortColumn","sortDirection","operation","bulkCountableFilter","filters","buildBulkChildCountRequests","nodes","id","requests","claimsByNodeId","buckets","Map","values","claims","methodId","String","claim","bucket","get","set","add","from","collectBulkChildCounts","request","response","aggregateResults","rows","isArray","wanted","row","keyEntry","k","countEntry","v","sumBulkCountsForClaims","countsByRequest","counts","bulkChildCountRequestKey","Pick","COUNT_CHIP_OPERATORS","coerceCountChipValue","token","compileCountChipConditions","conditions","c","operator","countChipFilterKey","JSON","stringify","sort","TreeStructureEntry","parentId","isDeleted","findCountChipChildConfig","treeStructure","parentCatalogReturnObject","childKey","byId","candidates","entry","underThisParent","match","buildCountChipDescriptor","CountChipClaim","CountChipNodeInput","countChip","countChipChildrenArr","buildCountChipClaims","claimByNodeId","descriptor","getFilters","includeKeys","excludeKeys","base","hasInclude","hasExclude","fieldName","LazyChildRequestOptions","pageSizeOverride","filterByBusinessObjectKey","targetEntityType","inclusionFilter","exclusionFilter","buildLazyChildRequestData","options","toArr","f","inclusionList","exclusionList","isTargetedFetch","requestData","includeForThis","excludeForThis","buildManyToManyChildFilterElements","items","childFilterElements","mtmKey","item"],"sources":["../../../src/domain/inquiryTree/lazyLoad.ts"],"sourcesContent":["/**\n * Lazy-child search descriptors and count/paging filters — pure ports of the\n * legacy lazy-loading cluster (TreeUtilities.js:735-1092 plus the pure\n * request/filter shaping inside fetchLazyChildren :1225-1317 and\n * fetchManyToManyChildren :1127-1172). The async fetchers themselves are NOT\n * ported — Phase B drives the HTTP through TanStack Query using the\n * descriptors and request payloads built here. Filter and request shapes are\n * byte-identical with legacy on purpose.\n */\nimport {\n CountChipCondition,\n CountChipConfig,\n CountChipOperator,\n EntityNode\n} from './types';\nimport { CatalogObject, MANY_TO_MANY } from './legalChildren';\nimport { getSearchIdentifiers } from './runtime';\nimport { toWireString } from './wireString';\nimport * as StringUtilities from '../../utilities/input/StringUtilities';\n\n/* ------------------------------------------------------------------- types */\n\n/** unityBaseSearchMethod subset the descriptor builder reads. */\nexport interface UnityBaseSearchMethod {\n apiMethodId?: string | number | null;\n [key: string]: unknown;\n}\n\n/** Promoted-entity subset the descriptor builder reads. */\nexport interface PromotedEntity {\n entityName?: string;\n unityBaseSearchMethod?: UnityBaseSearchMethod | null;\n [key: string]: unknown;\n}\n\n/**\n * One `searchField/searchValue/searchOperator` filter — legacy wire shape. Open\n * like SearchRequestData: it IS a wire bag, and the search executors take it\n * alongside the untyped filter objects the rest of the app builds.\n */\nexport interface LazyFilterElement {\n searchField: string;\n searchValue: unknown;\n searchOperator: string;\n [key: string]: unknown;\n}\n\n/**\n * The query payload shape produced by SearchUtilities.getSearchObject\n * (SearchUtilities.ts:24-75) for plain filter elements — key set and order\n * preserved byte-identically (the backend contract).\n */\nexport interface SearchRequestData {\n pageNumber: number;\n pageSize: number;\n filterElements: LazyFilterElement[];\n filterGroups: unknown[];\n orderElements: unknown[];\n groupingType: string;\n groupProperty: string[];\n groupOperationList: unknown[];\n eagerLoad: boolean;\n logicalSearchOperator: number;\n [key: string]: unknown;\n}\n\n/** Composite-key mapping for a many-to-many bridge fetch (getLazyLoadChildrenArr :820-829). */\nexport interface ManyToManyKey {\n searchItemIdentifier: string;\n searchNameKey: string;\n searchValueKey: string;\n}\n\n/**\n * One entry of a parent's lazy-child search plan — the legacy\n * `lazyLoadChildrenArr` element shape (getLazyLoadChildrenArr :756-949),\n * preserved verbatim so InquiryTreeMenu/InquiryContainer migrate mechanically.\n */\nexport interface LazyChildSearchDescriptor {\n apiMethodId: string | number | null;\n data: SearchRequestData | null;\n parentNodeRefKey: string | undefined;\n catalogReturnObject: string | undefined;\n pageSize?: number;\n manyToManyKeys?: ManyToManyKey[];\n /** Set when a joining-table search method exists — signals the two-step m2m fetch (:798-799). */\n manyToManyJointEntityApiMethodId?: string | number | null;\n}\n\nexport interface LazyLoadDescriptorsResult {\n descriptors: LazyChildSearchDescriptor[];\n /**\n * Legacy set node.errorRetrievingChildren = 'Error: Promote X child entity'\n * per un-promoted child (last one wins — :951-953); null when all children\n * resolved.\n */\n errorRetrievingChildren: string | null;\n}\n\n/** inclusionFilter / exclusionFilter entry shape (keysByTypeToFilterArray :1020-1024). */\nexport interface EntityKeysFilter {\n entityType: string;\n keys: unknown[];\n}\n\n/* -------------------------------------------------- string utilities */\n\n/**\n * Typed views of the untyped legacy helpers. Quirk kept: a nullish field yields\n * `undefined + undefined` (NaN) — callers rely on the resulting falsy/truthy\n * behavior, exactly like legacy.\n */\ntype FirstCharCase = (field: string | null | undefined) => string;\nconst toLowerFirstChar = StringUtilities.toLowerFirstChar as FirstCharCase;\nconst toUpperFirstChar = StringUtilities.toUpperFirstChar as FirstCharCase;\n\n/* --------------------------------------------------------- request payload */\n\n/**\n * Port of SearchUtilities.getSearchObject (SearchUtilities.ts:24-75) for the\n * inputs the lazy-load cluster feeds it: plain filter elements (no\n * sortDirection/distinct, which descriptor filters never carry). Key order and\n * defaults byte-identical: pageNumber||1, pageSize||20, eagerLoad false,\n * logicalSearchOperator And(=1) (unitySystemEnums.ts:128-131).\n */\nexport const buildSearchRequestData = (\n searchFilterElements: LazyFilterElement[] | null | undefined,\n page: number,\n pageSize: number\n): SearchRequestData => {\n const searchObject: SearchRequestData = {\n pageNumber: page || 1,\n pageSize: pageSize || 20,\n filterElements: [],\n filterGroups: [],\n orderElements: [],\n groupingType: '',\n groupProperty: [],\n groupOperationList: [],\n eagerLoad: false,\n logicalSearchOperator: 1\n };\n if (searchFilterElements) {\n searchFilterElements.forEach((property) => {\n searchObject.filterElements.push(property);\n });\n }\n return searchObject;\n};\n\n/** `keyField IN (values)` — the bulk child fetch/count filter. */\nexport const inFilter = (\n keyField: string,\n keyValues: string[]\n): LazyFilterElement => ({\n searchField: keyField,\n searchValue: keyValues.join(','),\n searchOperator: 'IN'\n});\n\n/* ------------------------------------------------------- descriptor builder */\n\n/** childEntityAssoc payload subset (extendedProperties.childEntityAssoc). */\ninterface ChildEntityAssoc {\n Cardinality?: number;\n /** 'ForeignKeyName, ParentIdentifierName' pairs. */\n Keys?: string[];\n [key: string]: unknown;\n}\n\n/**\n * Port of getEntityAssoc (TreeUtilities.js:718-733): the childEntityAssoc of\n * the catalog property on `nodeEntity` referencing the child's joining entity\n * (when set) or its catalogReturnObject. Quirk kept: a matching property with\n * no extendedProperties yields undefined, an absent property yields null.\n *\n * An entity can reference the same child through several properties. When\n * `propertyName` is given (the child's catalogObjectKey — the parent property\n * the author bound the level through) the referencing property with that name\n * wins; with no name, or no referencing property by that name, the first\n * referencing property does, as before.\n */\nconst getEntityAssoc = (\n nodeEntity: CatalogObject | undefined,\n node: EntityNode,\n propertyName?: string | null\n): ChildEntityAssoc | null | undefined => {\n let entityAssoc: ChildEntityAssoc | null | undefined = null;\n if (nodeEntity) {\n const references = (property: { reference?: unknown }) =>\n node.properties?.joiningEntityName\n ? property.reference === node.properties?.joiningEntityName\n : property.reference === node.properties?.catalogReturnObject;\n const referenceProperty =\n (propertyName\n ? nodeEntity.properties?.find(\n (property) => property.name === propertyName && references(property)\n )\n : undefined) ?? nodeEntity.properties?.find(references);\n entityAssoc = referenceProperty\n ? (referenceProperty.extendedProperties\n ?.childEntityAssoc as ChildEntityAssoc | null | undefined)\n : null;\n }\n return entityAssoc;\n};\n\n/** Internal search-identifier entry built per assoc key (getLazyLoadChildrenArr :851-888). */\ninterface SearchIdentifierEntry {\n searchNameKey: string;\n searchValueKey: string;\n searchJoiningEntity?: string;\n joiningEntityKeyName?: string | null;\n joiningEntityCatalogObjectLeftKeyName?: string | null;\n}\n\n/**\n * Port of getLazyLoadChildrenArr (TreeUtilities.js:735-957): build one search\n * descriptor per lazy child node from the parent's loaded row + catalog\n * metadata. Pure signature — the legacy function read node.children and\n * node.nodeObj off the mutated display node; here the caller passes the\n * canonical parent node, its data row, and its child nodes.\n *\n * Quirks kept verbatim:\n * - pageSize = parseInt(noOfNodesDisplayed) || 50 (:753);\n * - `childEntityAssoc.Cardinality` is read unguarded, so a parent entity with\n * no catalog reference to the child THROWS exactly like legacy (:784);\n * - all-caps key names lowercase whole, others lower first char (:817-828);\n * - a joining-table base search flips baseSearch and nulls the\n * joiningEntityKeyName decorations (:794-801, :883-886);\n * - empty assoc keys fall back to the parent's catalog identifier fields\n * (:894-913);\n * - search values come from the PARENT row, optionally through the joining\n * entity object (:915-932);\n * - a child whose entity is not promoted produces NO descriptor, only the\n * 'Error: Promote …' message (:950-954, last error wins).\n */\nexport const buildLazyLoadDescriptors = (\n node: EntityNode | null | undefined,\n parentRow: Record<string, unknown> | null | undefined,\n childNodes: EntityNode[] | null | undefined,\n catalogObjects: CatalogObject[] | null | undefined,\n promotedEntities: PromotedEntity[] | null | undefined\n): LazyLoadDescriptorsResult => {\n const descriptors: LazyChildSearchDescriptor[] = [];\n let errorRetrievingChildren: string | null = null;\n let defaultSearchIdentifiers: string[] = [];\n if (node?.properties?.catalogReturnObject) {\n defaultSearchIdentifiers = getSearchIdentifiers(\n catalogObjects,\n node.properties.catalogReturnObject\n );\n }\n\n if (!node || !childNodes) {\n return { descriptors, errorRetrievingChildren };\n }\n\n const pageSize =\n parseInt(node.properties?.noOfNodesDisplayed as string, 10) || 50;\n const nodeObj = (parentRow ?? {});\n\n childNodes.forEach((childNode) => {\n const lazyNodeSearchObj: LazyChildSearchDescriptor = {\n apiMethodId: null,\n data: null,\n parentNodeRefKey: childNode.properties?.catalogObjectKey,\n catalogReturnObject: childNode.properties?.catalogReturnObject\n };\n const entityName = childNode.properties?.catalogReturnObject;\n const promotedEntity = promotedEntities?.find(\n (pe) => pe.entityName === entityName\n );\n const searchIdentifiers: SearchIdentifierEntry[] = [];\n const filterElements: LazyFilterElement[] = [];\n if (promotedEntity) {\n // Use base search method to be the method for lazy loading node\n let baseSearch = promotedEntity.unityBaseSearchMethod;\n // Used for many-to-many subsequent entity search\n const childBaseSearch = promotedEntity.unityBaseSearchMethod;\n const nodeEntity = catalogObjects?.find(\n (co) => co.catalogObjectName === node.properties?.catalogReturnObject\n );\n let isManyToManySearch = false;\n let usingJoiningTableForSearch = false;\n if (nodeEntity) {\n // The parent side: the property the author bound this level through.\n const childEntityAssoc = getEntityAssoc(\n nodeEntity,\n childNode,\n childNode.properties?.catalogObjectKey\n );\n let promotedEntityForJoiningTable: PromotedEntity | undefined;\n // process many-to-many association to get the joined table information\n // ⚠ unguarded access — legacy throws here when the parent entity has no\n // catalog reference to the child (TreeUtilities.js:784)\n if (\n (childEntityAssoc as ChildEntityAssoc).Cardinality === MANY_TO_MANY\n ) {\n isManyToManySearch = true;\n lazyNodeSearchObj.manyToManyKeys = [];\n const joiningEntityName = childNode.properties?.joiningEntityName;\n promotedEntityForJoiningTable = promotedEntities?.find(\n (pe) => pe.entityName === joiningEntityName\n );\n\n // if there is a many-to-many joining table search method, use it for searching\n if (promotedEntityForJoiningTable?.unityBaseSearchMethod) {\n baseSearch = promotedEntityForJoiningTable.unityBaseSearchMethod;\n // identifies whether to make an additional network call for the entity data\n lazyNodeSearchObj.manyToManyJointEntityApiMethodId =\n childBaseSearch?.apiMethodId;\n usingJoiningTableForSearch = true;\n }\n\n const childNodeEntity = (catalogObjects as CatalogObject[]).find(\n (co) =>\n co.catalogObjectName === childNode.properties?.catalogReturnObject\n );\n\n const entityAssoc = getEntityAssoc(childNodeEntity, childNode);\n if (entityAssoc && Object.keys(entityAssoc).length) {\n entityAssoc.Keys?.forEach((keyVal) => {\n const keyValArr = keyVal.split(',');\n const foreignKeyName = keyValArr[0] ? keyValArr[0].trim() : '';\n const parentIdentifierName = keyValArr[1]\n ? keyValArr[1].trim()\n : '';\n const searchValueKey = /^[A-Z]*$/.test(parentIdentifierName)\n ? parentIdentifierName.toLowerCase()\n : toLowerFirstChar(parentIdentifierName);\n (lazyNodeSearchObj.manyToManyKeys as ManyToManyKey[]).push({\n searchItemIdentifier: usingJoiningTableForSearch\n ? /^[A-Z]*$/.test(foreignKeyName)\n ? foreignKeyName.toLowerCase()\n : toLowerFirstChar(foreignKeyName)\n : searchValueKey,\n searchNameKey: foreignKeyName,\n // check name string: if 1 word, lowercase. if 2 words, lower first char\n searchValueKey: searchValueKey\n });\n });\n }\n }\n\n if (childEntityAssoc && Object.keys(childEntityAssoc).length) {\n childEntityAssoc.Keys?.forEach((keyVal) => {\n const keyValArr = keyVal.split(',');\n let searchJoiningEntity = '';\n if (\n !isManyToManySearch &&\n Object.prototype.hasOwnProperty.call(\n nodeObj,\n node.properties.joiningEntityCatalogObjectKey as string\n )\n ) {\n searchJoiningEntity = node.properties\n .joiningEntityCatalogObjectKey as string;\n }\n const foreignKeyName = keyValArr[0] ? keyValArr[0].trim() : '';\n const parentIdentifierName = keyValArr[1]\n ? keyValArr[1].trim()\n : '';\n let siObj: SearchIdentifierEntry = {\n searchNameKey: parentIdentifierName,\n // check name string: if 1 word, lowercase. if 2 words, lower first char\n searchValueKey: /^[A-Z]*$/.test(foreignKeyName)\n ? foreignKeyName.toLowerCase()\n : toLowerFirstChar(foreignKeyName),\n searchJoiningEntity: searchJoiningEntity\n };\n if (isManyToManySearch && !usingJoiningTableForSearch) {\n siObj = {\n searchNameKey: foreignKeyName,\n searchValueKey: /^[A-Z]*$/.test(foreignKeyName)\n ? foreignKeyName.toLowerCase()\n : toLowerFirstChar(foreignKeyName)\n };\n }\n if (isManyToManySearch) {\n if (\n childNode.properties?.catalogObjectKey &&\n childNode.properties?.joiningEntityCatalogObjectLeftKey\n ) {\n siObj.joiningEntityKeyName = toUpperFirstChar(\n !usingJoiningTableForSearch\n ? childNode.properties?.joiningEntityChildKey\n : childNode.properties?.catalogObjectKey\n );\n siObj.joiningEntityCatalogObjectLeftKeyName = toUpperFirstChar(\n childNode.properties?.joiningEntityCatalogObjectLeftKey\n );\n }\n if (promotedEntityForJoiningTable?.unityBaseSearchMethod) {\n siObj.joiningEntityKeyName = null;\n siObj.joiningEntityCatalogObjectLeftKeyName = null;\n }\n }\n searchIdentifiers.push(siObj);\n });\n }\n }\n\n // If there are no search identifiers, use the default ones from catalog entities\n if (!searchIdentifiers.length) {\n defaultSearchIdentifiers.forEach((searchIdentifier) => {\n const siObj: SearchIdentifierEntry = {\n searchNameKey: searchIdentifier,\n searchValueKey: searchIdentifier\n };\n if (\n childNode.properties?.catalogObjectKey &&\n childNode.properties?.joiningEntityCatalogObjectLeftKey\n ) {\n siObj.joiningEntityKeyName = toUpperFirstChar(\n childNode.properties?.catalogObjectKey\n );\n siObj.joiningEntityCatalogObjectLeftKeyName = toUpperFirstChar(\n childNode.properties?.joiningEntityCatalogObjectLeftKey\n );\n }\n searchIdentifiers.push(siObj);\n });\n }\n\n searchIdentifiers.forEach((si) => {\n // value comes from parent node object\n let searchValue: unknown = '';\n if (si?.searchJoiningEntity) {\n searchValue = (\n nodeObj[si.searchJoiningEntity] as Record<string, unknown>\n )[si.searchValueKey];\n } else {\n if (usingJoiningTableForSearch) {\n const joiningEntityCatalogObjectKey =\n node?.properties?.joiningEntityCatalogObjectKey;\n const value = nodeObj?.[joiningEntityCatalogObjectKey as string];\n searchValue = value\n ? (value as Record<string, unknown>)[si.searchValueKey]\n : nodeObj[si.searchValueKey];\n } else {\n searchValue = nodeObj[si.searchValueKey];\n }\n }\n let formattedPropertyName = toUpperFirstChar(si.searchNameKey);\n if (\n si.joiningEntityKeyName &&\n si.joiningEntityCatalogObjectLeftKeyName\n ) {\n formattedPropertyName = `${si.joiningEntityKeyName}.${si.joiningEntityCatalogObjectLeftKeyName}.${formattedPropertyName}`;\n }\n filterElements.push({\n searchField: formattedPropertyName,\n searchValue: searchValue,\n searchOperator: '='\n });\n });\n lazyNodeSearchObj.data = buildSearchRequestData(\n filterElements,\n 1,\n pageSize\n );\n lazyNodeSearchObj.pageSize = pageSize;\n lazyNodeSearchObj.apiMethodId = baseSearch?.apiMethodId || null;\n descriptors.push(lazyNodeSearchObj);\n } else {\n errorRetrievingChildren = 'Error: Promote ' + entityName + ' child entity';\n }\n });\n return { descriptors, errorRetrievingChildren };\n};\n\n/* -------------------------------------------------- varying-key IN filters */\n\n/**\n * Port of getVaryingChildKey (TreeUtilities.js:964-981): for one descriptor,\n * find the child-entity PK column that VARIES across siblings under the same\n * parent — the first identifier not already fixed by the descriptor's filters\n * (compared case-insensitively). Feeds IN / NOT IN filters that target only\n * the varying component of a composite key.\n */\nexport const getVaryingChildKey = (\n searchMethod: LazyChildSearchDescriptor | null | undefined,\n catalogObjects: CatalogObject[] | null | undefined\n): string | null => {\n const childPkFields = getSearchIdentifiers(\n catalogObjects,\n searchMethod?.catalogReturnObject\n );\n if (!childPkFields?.length) return null;\n\n const fixedFieldNames = new Set(\n (searchMethod?.data?.filterElements || [])\n .map((fe) => fe.searchField)\n .filter(Boolean)\n .map((n) => n.toLowerCase())\n );\n\n return (\n childPkFields.find((pk) => !fixedFieldNames.has(pk.toLowerCase())) || null\n );\n};\n\n/** Loaded-child shape collectChildVaryingKeysByType walks (legacy display node subset). */\nexport interface LazyChildNodeRef {\n isGroupNode?: boolean;\n properties?: { catalogReturnObject?: string | null } | null;\n nodeObj?: Record<string, unknown> | null;\n}\n\n/** Parent shape collectChildVaryingKeysByType reads (legacy display node subset). */\nexport interface LazyParentNodeRef {\n children?: LazyChildNodeRef[] | null;\n lazyLoadChildrenArr?: LazyChildSearchDescriptor[] | null;\n}\n\n/**\n * Port of collectChildVaryingKeysByType (TreeUtilities.js:986-1016): walk a\n * parent's loaded children and group their varying-PK values by entity type.\n * Output shape `{ [entityType]: values[] }` feeds keysByTypeToFilterArray.\n * Read-only over the same structural shape as legacy, so Phase B call sites\n * (InquiryContainer.jsx:1324, :1410) pass their node unchanged.\n */\nexport const collectChildVaryingKeysByType = (\n parentNode: LazyParentNodeRef | null | undefined,\n catalogObjects: CatalogObject[] | null | undefined,\n childrenOverride: LazyChildNodeRef[] | null = null\n): Record<string, unknown[]> => {\n const children = childrenOverride || parentNode?.children || [];\n const result: Record<string, unknown[]> = {};\n\n for (const child of children) {\n if (child?.isGroupNode) continue;\n\n const type = child?.properties?.catalogReturnObject;\n if (!type) continue;\n\n const sm = parentNode?.lazyLoadChildrenArr?.find(\n (m) => m.catalogReturnObject === type\n );\n if (!sm) continue;\n\n const varyingField = getVaryingChildKey(sm, catalogObjects);\n if (!varyingField) continue;\n\n const value = child.nodeObj?.[varyingField];\n if (value == null) continue;\n\n if (!result[type]) result[type] = [];\n result[type].push(value);\n }\n\n return result;\n};\n\n/**\n * Port of keysByTypeToFilterArray (TreeUtilities.js:1020-1024): keys-by-type\n * map → the inclusionFilter / exclusionFilter array shape consumed by the\n * lazy-child request builder.\n */\nexport const keysByTypeToFilterArray = (\n keysByType: Record<string, unknown[]> | null | undefined\n): EntityKeysFilter[] =>\n Object.entries(keysByType || {}).map(([entityType, keys]) => ({\n entityType,\n keys\n }));\n\n/* ------------------------------------------------------------ count fetches */\n\n/** One count-only query request (the pure request shape of fetchCountsByType :1033-1039). */\nexport interface CountRequest {\n catalogReturnObject: string | undefined;\n apiMethodId: string | number | null;\n data: Record<string, unknown>;\n}\n\n/**\n * Pure request-shaping half of fetchCountsByType (TreeUtilities.js:1029-1040):\n * one count-only query per descriptor using parent-context filters only\n * (no IN/NOT IN) — `{ ...sm.data, pageNumber: 1, pageSize: 1 }`.\n */\nexport const buildCountRequests = (\n descriptors: LazyChildSearchDescriptor[] | null | undefined\n): CountRequest[] =>\n (descriptors ?? []).map((sm) => ({\n catalogReturnObject: sm.catalogReturnObject,\n apiMethodId: sm.apiMethodId,\n data: { ...sm.data, pageNumber: 1, pageSize: 1 }\n }));\n\n/**\n * Pure response-mapping half of fetchCountsByType (TreeUtilities.js:1042-1048):\n * totals keyed by catalogReturnObject, keeping only numeric\n * `response.data.total` values (failed fetches pass null). Drives\n * `hasMoreChildren` detection after a refresh.\n */\nexport const collectCountsByType = (\n descriptors: LazyChildSearchDescriptor[] | null | undefined,\n responses: Array<{ data?: { total?: unknown } | null } | null | undefined>\n): Record<string, number> => {\n const out: Record<string, number> = {};\n (descriptors ?? []).forEach((sm, i) => {\n const total = responses[i]?.data?.total;\n if (typeof total === 'number') {\n out[sm.catalogReturnObject as string] = total;\n }\n });\n return out;\n};\n\n/* -------------------------------------------------- bulk child counts (new) */\n\n/**\n * One bulk child-count query — a single AGGREGATE search per (apiMethodId ×\n * parent-ref field) that counts children for a whole PAGE of parents at once\n * (`keyField IN (values) GROUP BY keyField COUNT`), replacing N per-parent\n * count calls. New capability (no legacy counterpart); the aggregate body\n * follows the backend's grouped-search invariants: order on the grouped\n * column, eagerLoad true when operations are present.\n */\nexport interface BulkChildCountRequest {\n apiMethodId: string | number;\n /** The child entity's parent-ref field the counts group by. */\n keyField: string;\n /** Distinct parent key values covered by this request (stringified). */\n keyValues: string[];\n /**\n * Canonical hash of the extra (count-chip) filters folded into this request —\n * '' for the plain child count, so a chip with no conditions shares the\n * chevron count's bucket instead of asking again.\n */\n filterKey?: string;\n data: Record<string, unknown>;\n}\n\n/** A node's claim on bulk-count results: which (request, key value) pairs sum\n * into its child-count total. */\nexport interface BulkCountClaim {\n apiMethodId: string | number;\n keyField: string;\n keyValue: string;\n /** Same canonical filter hash as the request that answers this claim. */\n filterKey?: string;\n}\n\nconst bulkRequestKey = (\n apiMethodId: string | number,\n keyField: string,\n filterKey?: string\n) =>\n filterKey\n ? `${apiMethodId}::${keyField}::${filterKey}`\n : `${apiMethodId}::${keyField}`;\n\n/**\n * The aggregate body every bulk count uses: `keyField IN (values) GROUP BY\n * keyField COUNT`, plus any extra count-chip filters ANDed on top. Kept in one\n * place so the chevron path, the chip path and the runtime batcher can never\n * drift apart.\n */\nexport const buildBulkCountAggregateData = (\n keyField: string,\n keyValues: string[],\n extraFilterElements: LazyFilterElement[] = []\n): Record<string, unknown> => ({\n ...buildSearchRequestData(\n [inFilter(keyField, keyValues), ...extraFilterElements],\n 1,\n keyValues.length\n ),\n orderElements: [{ sortColumn: keyField, sortDirection: 'ASC' }],\n groupingType: 'AGGREGATE',\n groupProperty: [keyField],\n // Backend SearchHelper.GROUP_OPERATIONS is case-sensitive uppercase.\n groupOperationList: [{ operation: 'COUNT', property: keyField }],\n eagerLoad: true\n});\n\n/**\n * A descriptor is bulk-countable when it is a plain single-key '=' search —\n * one filter element on the parent-ref field. Composite-key and many-to-many\n * descriptors are excluded (their nodes keep the optimistic chevron with no\n * badge).\n */\nconst bulkCountableFilter = (\n sm: LazyChildSearchDescriptor\n): LazyFilterElement | null => {\n if (!sm.apiMethodId || !sm.data) return null;\n if (sm.manyToManyJointEntityApiMethodId || sm.manyToManyKeys?.length) {\n return null;\n }\n const filters = sm.data.filterElements ?? [];\n if (filters.length !== 1 || filters[0].searchOperator !== '=') return null;\n // Only scalar key values stringify meaningfully into IN lists.\n const value = filters[0].searchValue;\n if (typeof value !== 'string' && typeof value !== 'number') return null;\n return filters[0];\n};\n\n/**\n * Group the bulk-countable descriptors of many sibling nodes into one\n * aggregate request per (apiMethodId × parent-ref field), and report each\n * node's claims so responses can be summed back per node. A node whose\n * descriptors are not ALL bulk-countable gets NO claims (its total would be\n * partial — worse than unknown).\n */\nexport const buildBulkChildCountRequests = (\n nodes: Array<{\n id: string;\n lazyLoadChildrenArr?: LazyChildSearchDescriptor[] | null;\n }>\n): {\n requests: BulkChildCountRequest[];\n claimsByNodeId: Record<string, BulkCountClaim[]>;\n} => {\n const buckets = new Map<\n string,\n { apiMethodId: string | number; keyField: string; values: Set<string> }\n >();\n const claimsByNodeId: Record<string, BulkCountClaim[]> = {};\n\n nodes.forEach((node) => {\n const descriptors = node.lazyLoadChildrenArr ?? [];\n if (!descriptors.length) return;\n const claims: BulkCountClaim[] = [];\n for (const sm of descriptors) {\n const filter = bulkCountableFilter(sm);\n const methodId = sm.apiMethodId;\n if (!filter || methodId === null || methodId === undefined) {\n return; // partial totals lie — skip the whole node\n }\n claims.push({\n apiMethodId: methodId,\n keyField: filter.searchField,\n keyValue: String(filter.searchValue as string | number)\n });\n }\n claimsByNodeId[node.id] = claims;\n claims.forEach((claim) => {\n const key = bulkRequestKey(claim.apiMethodId, claim.keyField);\n const bucket =\n buckets.get(key) ??\n (buckets\n .set(key, {\n apiMethodId: claim.apiMethodId,\n keyField: claim.keyField,\n values: new Set<string>()\n })\n .get(key) as {\n apiMethodId: string | number;\n keyField: string;\n values: Set<string>;\n });\n bucket.values.add(claim.keyValue);\n });\n });\n\n const requests: BulkChildCountRequest[] = [];\n buckets.forEach((bucket) => {\n const keyValues = Array.from(bucket.values);\n requests.push({\n apiMethodId: bucket.apiMethodId,\n keyField: bucket.keyField,\n keyValues,\n data: buildBulkCountAggregateData(bucket.keyField, keyValues)\n });\n });\n\n return { requests, claimsByNodeId };\n};\n\n/**\n * Map one bulk-count response back to `keyValue → count`. Aggregate rows are\n * dictionaries with the grouped field plus the count column (alias varies by\n * backend template), so the count is the first OTHER numeric value in the\n * row; grouped values absent from the result set counted zero — the caller\n * treats missing keys as 0. Returns null when the response has no aggregate\n * rows (failed/unsupported → caller keeps the optimistic chevron).\n */\nexport const collectBulkChildCounts = (\n request: BulkChildCountRequest,\n response:\n | { data?: { aggregateResults?: unknown } | null }\n | null\n | undefined\n): Record<string, number> | null => {\n const rows = response?.data?.aggregateResults;\n if (!Array.isArray(rows)) return null;\n const wanted = request.keyField.toLowerCase();\n const out: Record<string, number> = {};\n rows.forEach((row) => {\n if (!row || typeof row !== 'object') return;\n const entries = Object.entries(row as Record<string, unknown>);\n const keyEntry = entries.find(([k]) => k.toLowerCase() === wanted);\n const keyValue = keyEntry?.[1];\n if (typeof keyValue !== 'string' && typeof keyValue !== 'number') return;\n const countEntry = entries.find(\n ([k, v]) => k.toLowerCase() !== wanted && typeof v === 'number'\n );\n if (!countEntry) return;\n out[String(keyValue)] = countEntry[1] as number;\n });\n return out;\n};\n\n/**\n * Sum a node's claims against fetched counts. Returns a number only when\n * EVERY claim's request resolved (countsByRequest holds a non-null map for\n * it) — an unknown anywhere means the total is unknown (null), never a lying\n * partial. Claimed keys missing from a resolved map count 0.\n */\nexport const sumBulkCountsForClaims = (\n claims: BulkCountClaim[] | null | undefined,\n countsByRequest: Map<string, Record<string, number> | null>\n): number | null => {\n if (!claims?.length) return null;\n let total = 0;\n for (const claim of claims) {\n const counts = countsByRequest.get(\n bulkRequestKey(claim.apiMethodId, claim.keyField, claim.filterKey)\n );\n if (!counts) return null;\n total += counts[claim.keyValue] ?? 0;\n }\n return total;\n};\n\n/** The bucket key used by sumBulkCountsForClaims' countsByRequest map. */\nexport const bulkChildCountRequestKey = (\n request: Pick<BulkChildCountRequest, 'apiMethodId' | 'keyField' | 'filterKey'>\n): string =>\n bulkRequestKey(request.apiMethodId, request.keyField, request.filterKey);\n\n/* ------------------------------------------------------------- count chips */\n\n/**\n * Wire comparator → backend SearchHelper operator (SearchOperators in the\n * stencil search utilities). Only '!=' differs — SQL spells it '<>'.\n */\nconst COUNT_CHIP_OPERATORS: Record<CountChipOperator, string> = {\n '=': '=',\n '!=': '<>',\n '>': '>',\n '<': '<',\n '>=': '>=',\n '<=': '<='\n};\n\n/**\n * Condition values reach the backend as typed JSON. Numbers and booleans are\n * already right; the one trap is a boolean written as the STRING 'true' (the\n * same mismatch the rule compiler hit — a bit column never equals \"true\"), so\n * those two tokens become real booleans. Other strings stay verbatim: without\n * the field's catalog type, coercing '007' to 7 would break string keys.\n */\nconst coerceCountChipValue = (value: string | number | boolean): unknown => {\n if (typeof value !== 'string') return value;\n const token = value.trim().toLowerCase();\n if (token === 'true') return true;\n if (token === 'false') return false;\n return value;\n};\n\n/**\n * Compile a count chip's flat conditions into filter elements (implicitly\n * ANDed — the aggregate body's logicalSearchOperator is And). Field names are\n * upper-first like every other search this module builds: the config picks\n * fields off catalog properties, which are camelCase, while the backend\n * matches on the PascalCase column. Conditions with no field or an unknown\n * comparator are dropped rather than guessed at.\n */\nexport const compileCountChipConditions = (\n conditions: CountChipCondition[] | null | undefined\n): LazyFilterElement[] =>\n (conditions ?? [])\n .filter((c) => c?.field && COUNT_CHIP_OPERATORS[c.operator])\n .map((c) => ({\n searchField: toUpperFirstChar(c.field),\n searchValue: coerceCountChipValue(c.value),\n searchOperator: COUNT_CHIP_OPERATORS[c.operator]\n }));\n\n/**\n * Canonical, order-independent hash of compiled chip filters. Two chips whose\n * conditions differ only in order share one request; NO conditions hashes to\n * '' so the chip reuses the plain child-count bucket the chevron already\n * fetched (zero extra requests for the unfiltered case).\n */\nexport const countChipFilterKey = (\n filterElements: LazyFilterElement[] | null | undefined\n): string =>\n (filterElements ?? [])\n .map(\n (fe) =>\n `${fe.searchField}${fe.searchOperator}${JSON.stringify(fe.searchValue)}`\n )\n .sort()\n .join('&');\n\n/** Flat wire tree-structure entry the child-config lookup reads. */\nexport interface TreeStructureEntry {\n id?: string;\n parentId?: string | null;\n isDeleted?: boolean;\n properties?: Record<string, unknown> | null;\n [key: string]: unknown;\n}\n\n/**\n * Locate the CONFIG node for the child level a count chip names, in the flat\n * wire tree structure. A display row can't be asked for it: by the time rows\n * render, `children` holds materialized records (and none at all when the\n * count is zero), and display ids are re-minted. The config level is the one\n * whose catalogObjectKey is the chip's childKey and whose parent level returns\n * the same entity as the row — which is exactly how the chip's childKey is\n * defined.\n */\nexport const findCountChipChildConfig = (\n treeStructure: TreeStructureEntry[] | null | undefined,\n parentCatalogReturnObject: string | null | undefined,\n childKey: string | null | undefined\n): EntityNode | null => {\n if (!treeStructure?.length || !childKey) return null;\n const byId = new Map(\n treeStructure.filter((n) => n?.id != null).map((n) => [String(n.id), n])\n );\n const candidates = treeStructure.filter(\n (entry) =>\n entry &&\n !entry.isDeleted &&\n entry.properties?.['catalogObjectKey'] === childKey\n );\n if (!candidates.length) return null;\n const underThisParent = candidates.find(\n (entry) =>\n byId.get(String(entry.parentId ?? ''))?.properties?.[\n 'catalogReturnObject'\n ] === parentCatalogReturnObject\n );\n // One level owns the key tree-wide → no ambiguity to resolve.\n const match =\n underThisParent ?? (candidates.length === 1 ? candidates[0] : undefined);\n return (match as unknown as EntityNode) ?? null;\n};\n\n/**\n * The count-chip descriptor for a row whose level has no lazy descriptor for\n * the chip's binding — eager levels, and any row produced by a path that\n * doesn't build descriptors at all. The chip still needs the child binding's\n * apiMethodId, parent-ref field and this row's key value: exactly what\n * buildLazyLoadDescriptors derives, so it is reused against the ONE configured\n * child level the chip names — no second copy of the catalog-association walk,\n * and no client-side counting of the eager child arrays (page-size truncated,\n * and blind to the chip's filters).\n *\n * Returns null instead of throwing: buildLazyLoadDescriptors reproduces the\n * legacy unguarded assoc read (it throws when the parent entity has no catalog\n * reference to the child), and a chip must never take a row down with it.\n */\nexport const buildCountChipDescriptor = (\n node: EntityNode | null | undefined,\n parentRow: Record<string, unknown> | null | undefined,\n childNode: EntityNode | null | undefined,\n catalogObjects: CatalogObject[] | null | undefined,\n promotedEntities: PromotedEntity[] | null | undefined\n): LazyChildSearchDescriptor | null => {\n if (!node || !childNode) return null;\n try {\n const { descriptors } = buildLazyLoadDescriptors(\n node,\n parentRow,\n [childNode],\n catalogObjects,\n promotedEntities\n );\n return descriptors[0] ?? null;\n } catch {\n return null;\n }\n};\n\n/** A count chip's claim, carrying the filters its request must fold in. */\nexport interface CountChipClaim extends BulkCountClaim {\n filterElements: LazyFilterElement[];\n}\n\n/** Per-node input for buildCountChipClaims (display-node subset). */\nexport interface CountChipNodeInput {\n id: string;\n countChip?: CountChipConfig | null;\n lazyLoadChildrenArr?: LazyChildSearchDescriptor[] | null;\n /** Eager levels' stand-in descriptor (buildCountChipDescriptor). */\n countChipChildrenArr?: LazyChildSearchDescriptor[] | null;\n}\n\n/**\n * Plan the count-chip counts for a page of rows: one claim per configured row,\n * batched into one aggregate request per (apiMethodId × parent-ref field ×\n * canonical filter hash) — the same IN/GROUP BY shape as the chevron counts,\n * plus the compiled filters. A chip whose childKey names a binding that is not\n * bulk-countable (composite key, many-to-many) or that this row has no\n * descriptor for produces NO claim and therefore no chip, matching the\n * chevron path's exclusions.\n */\nexport const buildCountChipClaims = (\n nodes: CountChipNodeInput[]\n): {\n requests: BulkChildCountRequest[];\n claimByNodeId: Record<string, CountChipClaim>;\n} => {\n const buckets = new Map<\n string,\n {\n apiMethodId: string | number;\n keyField: string;\n filterKey: string;\n filterElements: LazyFilterElement[];\n values: Set<string>;\n }\n >();\n const claimByNodeId: Record<string, CountChipClaim> = {};\n\n nodes.forEach((node) => {\n const childKey = node.countChip?.childKey;\n if (!childKey) return;\n // Lazy levels already carry the descriptor; eager ones get the stand-in\n // built at display-tree time — either way the count goes through the same\n // batched aggregate.\n const descriptor = [\n ...(node.lazyLoadChildrenArr ?? []),\n ...(node.countChipChildrenArr ?? [])\n ].find((sm) => sm.parentNodeRefKey === childKey);\n if (!descriptor) return;\n const filter = bulkCountableFilter(descriptor);\n const methodId = descriptor.apiMethodId;\n if (!filter || methodId === null || methodId === undefined) return;\n\n const filterElements = compileCountChipConditions(\n node.countChip?.conditions\n );\n const filterKey = countChipFilterKey(filterElements);\n const claim: CountChipClaim = {\n apiMethodId: methodId,\n keyField: filter.searchField,\n keyValue: String(filter.searchValue as string | number),\n filterElements\n };\n if (filterKey) claim.filterKey = filterKey;\n claimByNodeId[node.id] = claim;\n\n const key = bulkRequestKey(methodId, filter.searchField, filterKey);\n const bucket =\n buckets.get(key) ??\n (buckets\n .set(key, {\n apiMethodId: methodId,\n keyField: filter.searchField,\n filterKey,\n filterElements,\n values: new Set<string>()\n })\n .get(key) as {\n apiMethodId: string | number;\n keyField: string;\n filterKey: string;\n filterElements: LazyFilterElement[];\n values: Set<string>;\n });\n bucket.values.add(claim.keyValue);\n });\n\n const requests: BulkChildCountRequest[] = [];\n buckets.forEach((bucket) => {\n const keyValues = Array.from(bucket.values);\n const request: BulkChildCountRequest = {\n apiMethodId: bucket.apiMethodId,\n keyField: bucket.keyField,\n keyValues,\n data: buildBulkCountAggregateData(\n bucket.keyField,\n keyValues,\n bucket.filterElements\n )\n };\n if (bucket.filterKey) request.filterKey = bucket.filterKey;\n requests.push(request);\n });\n\n return { requests, claimByNodeId };\n};\n\n/* --------------------------------------------------------- request filters */\n\n/**\n * Port of getFilters (TreeUtilities.js:1062-1092): the descriptor's\n * parent-context filters plus optional inclusion (IN) and/or exclusion\n * (NOT IN) clauses on the varying child key. Used by:\n * - refresh path: includeKeys = preTree children's varying-key values\n * - Show More: excludeKeys = already-seen children's varying-key values\n * With neither provided, or when the varying key cannot be derived, the BASE\n * filterElements array is returned by reference — exactly like legacy.\n */\nexport const getFilters = (\n searchMethod: LazyChildSearchDescriptor | null | undefined,\n catalogObjects: CatalogObject[] | null | undefined,\n {\n includeKeys = null,\n excludeKeys = null\n }: { includeKeys?: unknown[] | null; excludeKeys?: unknown[] | null } = {}\n): LazyFilterElement[] => {\n const base = searchMethod?.data?.filterElements || [];\n const hasInclude = Array.isArray(includeKeys) && includeKeys.length > 0;\n const hasExclude = Array.isArray(excludeKeys) && excludeKeys.length > 0;\n if (!hasInclude && !hasExclude) return base;\n\n const varyingField = getVaryingChildKey(searchMethod, catalogObjects);\n if (!varyingField) return base;\n const fieldName = toUpperFirstChar(varyingField);\n\n const out = [...base];\n if (hasInclude) {\n out.push({\n searchField: fieldName,\n searchValue: toWireString(includeKeys),\n searchOperator: 'IN'\n });\n }\n if (hasExclude) {\n out.push({\n searchField: fieldName,\n searchValue: toWireString(excludeKeys),\n searchOperator: 'NOTIN'\n });\n }\n return out;\n};\n\n/* -------------------------------------------- per-descriptor fetch payloads */\n\nexport interface LazyChildRequestOptions {\n pageNumber?: number;\n pageSizeOverride?: number | null;\n /** Targeted single-record fetch: BusinessObjectKey '=' filter, pageSize 1 (:1283-1296). */\n filterByBusinessObjectKey?: string | null;\n targetEntityType?: string | null;\n inclusionFilter?: EntityKeysFilter | EntityKeysFilter[] | null;\n exclusionFilter?: EntityKeysFilter | EntityKeysFilter[] | null;\n}\n\n/**\n * Pure request-shaping of fetchLazyChildren (TreeUtilities.js:1238-1317) for\n * ONE descriptor: page overrides, targeted BusinessObjectKey fetch, and\n * IN/NOT IN varying-key filters via getFilters. Returns null when a targeted\n * fetch skips this descriptor (entity type mismatch — legacy `return` inside\n * the forEach :1262-1267). Quirks kept: an inclusion filter forces pageSize to\n * the include-key count (:1314-1316) and include/exclude are IGNORED during a\n * targeted fetch (:1305).\n */\nexport const buildLazyChildRequestData = (\n searchMethod: LazyChildSearchDescriptor,\n catalogObjects: CatalogObject[] | null | undefined,\n options: LazyChildRequestOptions = {}\n): Record<string, unknown> | null => {\n const {\n pageNumber = 1,\n pageSizeOverride = null,\n filterByBusinessObjectKey = null,\n targetEntityType = null,\n inclusionFilter = null,\n exclusionFilter = null\n } = options;\n const toArr = (f: EntityKeysFilter | EntityKeysFilter[] | null) =>\n f ? (Array.isArray(f) ? f : [f]) : [];\n const inclusionList = toArr(inclusionFilter);\n const exclusionList = toArr(exclusionFilter);\n\n const isTargetedFetch = !!filterByBusinessObjectKey && !!targetEntityType;\n if (isTargetedFetch && searchMethod.catalogReturnObject !== targetEntityType) {\n return null;\n }\n\n let requestData: Record<string, unknown> = pageSizeOverride\n ? { ...searchMethod.data, pageNumber, pageSize: pageSizeOverride }\n : { ...searchMethod.data, pageNumber };\n\n if (isTargetedFetch) {\n requestData = {\n ...requestData,\n pageSize: 1,\n filterElements: [\n ...((requestData.filterElements as LazyFilterElement[]) || []),\n {\n searchField: 'BusinessObjectKey',\n searchValue: filterByBusinessObjectKey,\n searchOperator: '='\n }\n ]\n };\n }\n\n const includeForThis = inclusionList.find(\n (f) => f.entityType === searchMethod.catalogReturnObject\n )?.keys;\n const excludeForThis = exclusionList.find(\n (f) => f.entityType === searchMethod.catalogReturnObject\n )?.keys;\n\n if (!isTargetedFetch && (includeForThis?.length || excludeForThis?.length)) {\n requestData = {\n ...requestData,\n filterElements: getFilters(searchMethod, catalogObjects, {\n includeKeys: includeForThis,\n excludeKeys: excludeForThis\n })\n };\n\n if (includeForThis?.length) {\n requestData.pageSize = includeForThis.length;\n }\n }\n\n return requestData;\n};\n\n/**\n * Pure filter-building step of fetchManyToManyChildren\n * (TreeUtilities.js:1153-1172): one 'IN' filter per manyToManyKey collecting\n * the truthy searchValueKey values across the joining-table rows. Quirk kept:\n * searchValue is Array.prototype.toString() (comma-joined, no spaces). Feed\n * the result to buildSearchRequestData(filters, 1, 50) for the second-step\n * entity fetch (:1174-1177).\n */\nexport const buildManyToManyChildFilterElements = (\n manyToManyKeys: ManyToManyKey[] | null | undefined,\n items: Array<Record<string, unknown>> | null | undefined\n): LazyFilterElement[] => {\n const childFilterElements: LazyFilterElement[] = [];\n (manyToManyKeys ?? []).forEach((mtmKey) => {\n const searchValue: unknown[] = [];\n const formattedPropertyName = toUpperFirstChar(mtmKey.searchNameKey);\n (items ?? []).forEach((item) => {\n if (item[mtmKey.searchValueKey]) {\n searchValue.push(item[mtmKey.searchValueKey]);\n }\n });\n childFilterElements.push({\n searchField: formattedPropertyName,\n searchValue: toWireString(searchValue),\n searchOperator: 'IN'\n });\n });\n return childFilterElements;\n};\n"],"mappings":";;;;;AAiHA,MAAMgD,mBAAmBxC;AACzB,MAAMyC,mBAAmBzC;;;;;;;;AAWzB,MAAa0C,0BACXC,sBACAC,MACA/B,aACsB;CACtB,MAAMgC,eAAkC;EACtCjC,YAAYgC,QAAQ;EACpB/B,UAAUA,YAAY;EACtBC,gBAAgB,EAAE;EAClBC,cAAc,EAAE;EAChBC,eAAe,EAAE;EACjBC,cAAc;EACdC,eAAe,EAAE;EACjBC,oBAAoB,EAAE;EACtBC,WAAW;EACXC,uBAAuB;EACxB;AACD,KAAIsB,qBACFA,sBAAqBG,SAASC,aAAa;AACzCF,eAAa/B,eAAekC,KAAKD,SAAS;GAC1C;AAEJ,QAAOF;;;AAIT,MAAaI,YACXC,UACAC,eACuB;CACvB3C,aAAa0C;CACbzC,aAAa0C,UAAUC,KAAK,IAAI;CAChC1C,gBAAgB;CACjB;;;;;;;;;;;;;AAwBD,MAAM8C,kBACJC,YACAC,MACAC,iBACwC;CACxC,IAAIC,cAAmD;AACvD,KAAIH,YAAY;EACd,MAAMI,cAAcd,aAClBW,KAAKK,YAAYC,oBACbjB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AYC,UAAUqO;EAAkB,GAChE;EAAE,GAAGzH,aAAa9F;EAAMf;EAAY;AAExC,KAAIiP,gBACFC,eAAc;EACZ,GAAGA;EACHjP,UAAU;EACVC,gBAAgB,CACd,GAAKgP,YAAYhP,kBAA0C,EAAE,EAC7D;GACEN,aAAa;GACbC,aAAa0O;GACbzO,gBAAgB;GACjB,CAAA;EAEJ;CAGH,MAAMqP,iBAAiBJ,cAAczL,MAClCwL,MAAMA,EAAEtN,eAAeqF,aAAa5F,oBACtC,EAAEQ;CACH,MAAM2N,iBAAiBJ,cAAc1L,MAClCwL,MAAMA,EAAEtN,eAAeqF,aAAa5F,oBACtC,EAAEQ;AAEH,KAAI,CAACwN,oBAAoBE,gBAAgB3J,UAAU4J,gBAAgB5J,SAAS;AAC1E0J,gBAAc;GACZ,GAAGA;GACHhP,gBAAgB4N,WAAWjH,cAAc1C,gBAAgB;IACvD4J,aAAaoB;IACbnB,aAAaoB;IACd,CAAA;GACF;AAED,MAAID,gBAAgB3J,OAClB0J,aAAYjP,WAAWkP,eAAe3J;;AAI1C,QAAO0J;;;;;;;;;;AAWT,MAAaG,sCACXnO,gBACAoO,UACwB;CACxB,MAAMC,sBAA2C,EAAE;AACnD,EAACrO,kBAAkB,EAAE,EAAEgB,SAASsN,WAAW;EACzC,MAAM3P,cAAyB,EAAE;EACjC,MAAM8G,wBAAwB9E,iBAAiB2N,OAAO5O,cAAc;AACpE,GAAC0O,SAAS,EAAE,EAAEpN,SAASuN,SAAS;AAC9B,OAAIA,KAAKD,OAAO3O,gBACdhB,aAAYuC,KAAKqN,KAAKD,OAAO3O,gBAAgB;IAE/C;AACF0O,sBAAoBnN,KAAK;GACvBxC,aAAa+G;GACb9G,aAAaV,aAAaU,YAAY;GACtCC,gBAAgB;GACjB,CAAC;GACF;AACF,QAAOyP"}
1
+ {"version":3,"file":"lazyLoad.mjs","names":["CountChipCondition","CountChipConfig","CountChipOperator","LevelConfig","CatalogObject","MANY_TO_MANY","getSearchIdentifiers","toWireString","StringUtilities","UnityBaseSearchMethod","apiMethodId","key","PromotedEntity","entityName","unityBaseSearchMethod","LazyFilterElement","searchField","searchValue","searchOperator","SearchRequestData","pageNumber","pageSize","filterElements","filterGroups","orderElements","groupingType","groupProperty","groupOperationList","eagerLoad","logicalSearchOperator","ManyToManyKey","searchItemIdentifier","searchNameKey","searchValueKey","LazyChildSearchDescriptor","data","parentNodeRefKey","catalogReturnObject","manyToManyKeys","manyToManyJointEntityApiMethodId","LazyLoadDescriptorsResult","descriptors","errorRetrievingChildren","FirstCharCase","field","toLowerFirstChar","toUpperFirstChar","buildSearchRequestData","searchFilterElements","page","searchObject","forEach","property","push","isBlankKeyValue","value","inFilter","keyField","keyValues","join","ChildEntityAssoc","Cardinality","Keys","getEntityAssoc","nodeEntity","node","propertyName","entityAssoc","references","reference","properties","joiningEntityName","referenceProperty","find","name","undefined","extendedProperties","childEntityAssoc","SearchIdentifierEntry","searchJoiningEntity","joiningEntityKeyName","joiningEntityCatalogObjectLeftKeyName","buildLazyLoadDescriptors","parentRow","Record","childNodes","catalogObjects","promotedEntities","defaultSearchIdentifiers","parseInt","noOfNodesDisplayed","nodeObj","childNode","lazyNodeSearchObj","catalogObjectKey","promotedEntity","pe","searchIdentifiers","baseSearch","childBaseSearch","co","catalogObjectName","isManyToManySearch","usingJoiningTableForSearch","promotedEntityForJoiningTable","childNodeEntity","Object","keys","length","keyVal","keyValArr","split","foreignKeyName","trim","parentIdentifierName","test","toLowerCase","prototype","hasOwnProperty","call","joiningEntityCatalogObjectKey","siObj","joiningEntityCatalogObjectLeftKey","joiningEntityChildKey","searchIdentifier","si","formattedPropertyName","BulkChildCountRequest","filterKey","BulkCountClaim","keyValue","bulkRequestKey","buildBulkCountAggregateData","extraFilterElements","sortColumn","sortDirection","operation","bulkCountableFilter","sm","filters","buildBulkChildCountRequests","nodes","Array","id","lazyLoadChildrenArr","requests","claimsByNodeId","buckets","Map","values","Set","claims","some","filter","methodId","String","claim","bucket","get","set","add","from","collectBulkChildCounts","request","response","aggregateResults","rows","isArray","wanted","out","row","entries","keyEntry","k","countEntry","v","sumBulkCountsForClaims","countsByRequest","total","counts","bulkChildCountRequestKey","Pick","COUNT_CHIP_OPERATORS","coerceCountChipValue","token","compileCountChipConditions","conditions","c","operator","map","countChipFilterKey","fe","JSON","stringify","sort","buildCountChipDescriptor","CountChipClaim","CountChipNodeInput","countChip","countChipChildrenArr","buildCountChipClaims","claimByNodeId","childKey","descriptor","buildManyToManyChildFilterElements","items","childFilterElements","mtmKey","item"],"sources":["../../../src/domain/inquiryTree/lazyLoad.ts"],"sourcesContent":["/**\n * Lazy-child search descriptors and count/paging filters — pure ports of the\n * legacy lazy-loading cluster (TreeUtilities.js:735-1092 plus the pure\n * request/filter shaping inside fetchLazyChildren :1225-1317 and\n * fetchManyToManyChildren :1127-1172). The async fetchers themselves are NOT\n * ported — Phase B drives the HTTP through TanStack Query using the\n * descriptors and request payloads built here. Filter and request shapes are\n * byte-identical with legacy on purpose.\n */\nimport {\n CountChipCondition,\n CountChipConfig,\n CountChipOperator,\n LevelConfig\n} from './types';\nimport { CatalogObject, MANY_TO_MANY } from './legalChildren';\nimport { getSearchIdentifiers } from './runtime';\nimport { toWireString } from './wireString';\nimport * as StringUtilities from '../../utilities/input/StringUtilities';\n\n/* ------------------------------------------------------------------- types */\n\n/** unityBaseSearchMethod subset the descriptor builder reads. */\nexport interface UnityBaseSearchMethod {\n apiMethodId?: string | number | null;\n [key: string]: unknown;\n}\n\n/** Promoted-entity subset the descriptor builder reads. */\nexport interface PromotedEntity {\n entityName?: string;\n unityBaseSearchMethod?: UnityBaseSearchMethod | null;\n [key: string]: unknown;\n}\n\n/**\n * One `searchField/searchValue/searchOperator` filter — legacy wire shape. Open\n * like SearchRequestData: it IS a wire bag, and the search executors take it\n * alongside the untyped filter objects the rest of the app builds.\n */\nexport interface LazyFilterElement {\n searchField: string;\n searchValue: unknown;\n searchOperator: string;\n [key: string]: unknown;\n}\n\n/**\n * The query payload shape produced by SearchUtilities.getSearchObject\n * (SearchUtilities.ts:24-75) for plain filter elements — key set and order\n * preserved byte-identically (the backend contract).\n */\nexport interface SearchRequestData {\n pageNumber: number;\n pageSize: number;\n filterElements: LazyFilterElement[];\n filterGroups: unknown[];\n orderElements: unknown[];\n groupingType: string;\n groupProperty: string[];\n groupOperationList: unknown[];\n eagerLoad: boolean;\n logicalSearchOperator: number;\n [key: string]: unknown;\n}\n\n/** Composite-key mapping for a many-to-many bridge fetch (getLazyLoadChildrenArr :820-829). */\nexport interface ManyToManyKey {\n searchItemIdentifier: string;\n searchNameKey: string;\n searchValueKey: string;\n}\n\n/**\n * One entry of a parent's lazy-child search plan — the legacy\n * `lazyLoadChildrenArr` element shape (getLazyLoadChildrenArr :756-949),\n * preserved verbatim so InquiryTreeMenu/InquiryContainer migrate mechanically.\n */\nexport interface LazyChildSearchDescriptor {\n apiMethodId: string | number | null;\n data: SearchRequestData | null;\n parentNodeRefKey: string | undefined;\n catalogReturnObject: string | undefined;\n pageSize?: number;\n manyToManyKeys?: ManyToManyKey[];\n /** Set when a joining-table search method exists — signals the two-step m2m fetch (:798-799). */\n manyToManyJointEntityApiMethodId?: string | number | null;\n}\n\nexport interface LazyLoadDescriptorsResult {\n descriptors: LazyChildSearchDescriptor[];\n /**\n * Legacy set node.errorRetrievingChildren = 'Error: Promote X child entity'\n * per un-promoted child (last one wins — :951-953); null when all children\n * resolved.\n */\n errorRetrievingChildren: string | null;\n}\n\n/* -------------------------------------------------- string utilities */\n\n/**\n * Typed views of the untyped legacy helpers. Quirk kept: a nullish field yields\n * `undefined + undefined` (NaN) — callers rely on the resulting falsy/truthy\n * behavior, exactly like legacy.\n */\ntype FirstCharCase = (field: string | null | undefined) => string;\nconst toLowerFirstChar = StringUtilities.toLowerFirstChar as FirstCharCase;\nconst toUpperFirstChar = StringUtilities.toUpperFirstChar as FirstCharCase;\n\n/* --------------------------------------------------------- request payload */\n\n/**\n * Port of SearchUtilities.getSearchObject (SearchUtilities.ts:24-75) for the\n * inputs the lazy-load cluster feeds it: plain filter elements (no\n * sortDirection/distinct, which descriptor filters never carry). Key order and\n * defaults byte-identical: pageNumber||1, pageSize||20, eagerLoad false,\n * logicalSearchOperator And(=1) (unitySystemEnums.ts:128-131).\n */\nexport const buildSearchRequestData = (\n searchFilterElements: LazyFilterElement[] | null | undefined,\n page: number,\n pageSize: number\n): SearchRequestData => {\n const searchObject: SearchRequestData = {\n pageNumber: page || 1,\n pageSize: pageSize || 20,\n filterElements: [],\n filterGroups: [],\n orderElements: [],\n groupingType: '',\n groupProperty: [],\n groupOperationList: [],\n eagerLoad: false,\n logicalSearchOperator: 1\n };\n if (searchFilterElements) {\n searchFilterElements.forEach((property) => {\n searchObject.filterElements.push(property);\n });\n }\n return searchObject;\n};\n\n/**\n * A parent link value that is present but empty (null or ''). Such a parent\n * has no children by definition, and `FK = null` is a server error, not an\n * empty answer — so it is never searched, counted or put in an IN list.\n */\nexport const isBlankKeyValue = (value: unknown): boolean =>\n value === null || value === '';\n\n/** `keyField IN (values)` — the bulk child fetch/count filter. */\nexport const inFilter = (\n keyField: string,\n keyValues: string[]\n): LazyFilterElement => ({\n searchField: keyField,\n searchValue: keyValues.join(','),\n searchOperator: 'IN'\n});\n\n/* ------------------------------------------------------- descriptor builder */\n\n/** childEntityAssoc payload subset (extendedProperties.childEntityAssoc). */\ninterface ChildEntityAssoc {\n Cardinality?: number;\n /** 'ForeignKeyName, ParentIdentifierName' pairs. */\n Keys?: string[];\n [key: string]: unknown;\n}\n\n/**\n * Port of getEntityAssoc (TreeUtilities.js:718-733): the childEntityAssoc of\n * the catalog property on `nodeEntity` referencing the child's joining entity\n * (when set) or its catalogReturnObject. Quirk kept: a matching property with\n * no extendedProperties yields undefined, an absent property yields null.\n *\n * An entity can reference the same child through several properties. When\n * `propertyName` is given (the child's catalogObjectKey — the parent property\n * the author bound the level through) the referencing property with that name\n * wins; with no name, or no referencing property by that name, the first\n * referencing property does, as before.\n */\nconst getEntityAssoc = (\n nodeEntity: CatalogObject | undefined,\n node: LevelConfig,\n propertyName?: string | null\n): ChildEntityAssoc | null | undefined => {\n let entityAssoc: ChildEntityAssoc | null | undefined = null;\n if (nodeEntity) {\n const references = (property: { reference?: unknown }) =>\n node.properties?.joiningEntityName\n ? property.reference === node.properties?.joiningEntityName\n : property.reference === node.properties?.catalogReturnObject;\n const referenceProperty =\n (propertyName\n ? nodeEntity.properties?.find(\n (property) => property.name === propertyName && references(property)\n )\n : undefined) ?? nodeEntity.properties?.find(references);\n entityAssoc = referenceProperty\n ? (referenceProperty.extendedProperties\n ?.childEntityAssoc as ChildEntityAssoc | null | undefined)\n : null;\n }\n return entityAssoc;\n};\n\n/** Internal search-identifier entry built per assoc key (getLazyLoadChildrenArr :851-888). */\ninterface SearchIdentifierEntry {\n searchNameKey: string;\n searchValueKey: string;\n searchJoiningEntity?: string;\n joiningEntityKeyName?: string | null;\n joiningEntityCatalogObjectLeftKeyName?: string | null;\n}\n\n/**\n * Port of getLazyLoadChildrenArr (TreeUtilities.js:735-957): build one search\n * descriptor per lazy child node from the parent's loaded row + catalog\n * metadata. Pure signature — the legacy function read node.children and\n * node.nodeObj off the mutated display node; here the caller passes the\n * canonical parent node, its data row, and its child nodes.\n *\n * Quirks kept verbatim:\n * - pageSize = parseInt(noOfNodesDisplayed) || 50 (:753);\n * - a parent entity with no catalog reference to the child produces NO\n * descriptor, only an 'Error: no catalog association …' message (legacy\n * threw here, :784);\n * - all-caps key names lowercase whole, others lower first char (:817-828);\n * - a joining-table base search flips baseSearch and nulls the\n * joiningEntityKeyName decorations (:794-801, :883-886);\n * - empty assoc keys fall back to the parent's catalog identifier fields\n * (:894-913);\n * - search values come from the PARENT row, optionally through the joining\n * entity object (:915-932);\n * - a child whose entity is not promoted produces NO descriptor, only the\n * 'Error: Promote …' message (:950-954, last error wins).\n */\nexport const buildLazyLoadDescriptors = (\n node: LevelConfig | null | undefined,\n parentRow: Record<string, unknown> | null | undefined,\n childNodes: LevelConfig[] | null | undefined,\n catalogObjects: CatalogObject[] | null | undefined,\n promotedEntities: PromotedEntity[] | null | undefined\n): LazyLoadDescriptorsResult => {\n const descriptors: LazyChildSearchDescriptor[] = [];\n let errorRetrievingChildren: string | null = null;\n let defaultSearchIdentifiers: string[] = [];\n if (node?.properties?.catalogReturnObject) {\n defaultSearchIdentifiers = getSearchIdentifiers(\n catalogObjects,\n node.properties.catalogReturnObject\n );\n }\n\n if (!node || !childNodes) {\n return { descriptors, errorRetrievingChildren };\n }\n\n const pageSize =\n parseInt(node.properties?.noOfNodesDisplayed as string, 10) || 50;\n const nodeObj = (parentRow ?? {});\n\n childNodes.forEach((childNode) => {\n const lazyNodeSearchObj: LazyChildSearchDescriptor = {\n apiMethodId: null,\n data: null,\n parentNodeRefKey: childNode.properties?.catalogObjectKey,\n catalogReturnObject: childNode.properties?.catalogReturnObject\n };\n const entityName = childNode.properties?.catalogReturnObject;\n const promotedEntity = promotedEntities?.find(\n (pe) => pe.entityName === entityName\n );\n const searchIdentifiers: SearchIdentifierEntry[] = [];\n const filterElements: LazyFilterElement[] = [];\n if (promotedEntity) {\n // Use base search method to be the method for lazy loading node\n let baseSearch = promotedEntity.unityBaseSearchMethod;\n // Used for many-to-many subsequent entity search\n const childBaseSearch = promotedEntity.unityBaseSearchMethod;\n const nodeEntity = catalogObjects?.find(\n (co) => co.catalogObjectName === node.properties?.catalogReturnObject\n );\n let isManyToManySearch = false;\n let usingJoiningTableForSearch = false;\n if (nodeEntity) {\n // The parent side: the property the author bound this level through.\n const childEntityAssoc = getEntityAssoc(\n nodeEntity,\n childNode,\n childNode.properties?.catalogObjectKey\n );\n if (!childEntityAssoc) {\n errorRetrievingChildren = `Error: no catalog association from ${\n node.properties?.catalogReturnObject\n } to ${entityName}`;\n return;\n }\n let promotedEntityForJoiningTable: PromotedEntity | undefined;\n // process many-to-many association to get the joined table information\n if (childEntityAssoc.Cardinality === MANY_TO_MANY) {\n isManyToManySearch = true;\n lazyNodeSearchObj.manyToManyKeys = [];\n const joiningEntityName = childNode.properties?.joiningEntityName;\n promotedEntityForJoiningTable = promotedEntities?.find(\n (pe) => pe.entityName === joiningEntityName\n );\n\n // if there is a many-to-many joining table search method, use it for searching\n if (promotedEntityForJoiningTable?.unityBaseSearchMethod) {\n baseSearch = promotedEntityForJoiningTable.unityBaseSearchMethod;\n // identifies whether to make an additional network call for the entity data\n lazyNodeSearchObj.manyToManyJointEntityApiMethodId =\n childBaseSearch?.apiMethodId;\n usingJoiningTableForSearch = true;\n }\n\n const childNodeEntity = (catalogObjects as CatalogObject[]).find(\n (co) =>\n co.catalogObjectName === childNode.properties?.catalogReturnObject\n );\n\n const entityAssoc = getEntityAssoc(childNodeEntity, childNode);\n if (entityAssoc && Object.keys(entityAssoc).length) {\n entityAssoc.Keys?.forEach((keyVal) => {\n const keyValArr = keyVal.split(',');\n const foreignKeyName = keyValArr[0] ? keyValArr[0].trim() : '';\n const parentIdentifierName = keyValArr[1]\n ? keyValArr[1].trim()\n : '';\n const searchValueKey = /^[A-Z]*$/.test(parentIdentifierName)\n ? parentIdentifierName.toLowerCase()\n : toLowerFirstChar(parentIdentifierName);\n (lazyNodeSearchObj.manyToManyKeys as ManyToManyKey[]).push({\n searchItemIdentifier: usingJoiningTableForSearch\n ? /^[A-Z]*$/.test(foreignKeyName)\n ? foreignKeyName.toLowerCase()\n : toLowerFirstChar(foreignKeyName)\n : searchValueKey,\n searchNameKey: foreignKeyName,\n // check name string: if 1 word, lowercase. if 2 words, lower first char\n searchValueKey: searchValueKey\n });\n });\n }\n }\n\n if (Object.keys(childEntityAssoc).length) {\n childEntityAssoc.Keys?.forEach((keyVal) => {\n const keyValArr = keyVal.split(',');\n let searchJoiningEntity = '';\n if (\n !isManyToManySearch &&\n Object.prototype.hasOwnProperty.call(\n nodeObj,\n node.properties.joiningEntityCatalogObjectKey as string\n )\n ) {\n searchJoiningEntity = node.properties\n .joiningEntityCatalogObjectKey as string;\n }\n const foreignKeyName = keyValArr[0] ? keyValArr[0].trim() : '';\n const parentIdentifierName = keyValArr[1]\n ? keyValArr[1].trim()\n : '';\n let siObj: SearchIdentifierEntry = {\n searchNameKey: parentIdentifierName,\n // check name string: if 1 word, lowercase. if 2 words, lower first char\n searchValueKey: /^[A-Z]*$/.test(foreignKeyName)\n ? foreignKeyName.toLowerCase()\n : toLowerFirstChar(foreignKeyName),\n searchJoiningEntity: searchJoiningEntity\n };\n if (isManyToManySearch && !usingJoiningTableForSearch) {\n siObj = {\n searchNameKey: foreignKeyName,\n searchValueKey: /^[A-Z]*$/.test(foreignKeyName)\n ? foreignKeyName.toLowerCase()\n : toLowerFirstChar(foreignKeyName)\n };\n }\n if (isManyToManySearch) {\n if (\n childNode.properties?.catalogObjectKey &&\n childNode.properties?.joiningEntityCatalogObjectLeftKey\n ) {\n siObj.joiningEntityKeyName = toUpperFirstChar(\n !usingJoiningTableForSearch\n ? childNode.properties?.joiningEntityChildKey\n : childNode.properties?.catalogObjectKey\n );\n siObj.joiningEntityCatalogObjectLeftKeyName = toUpperFirstChar(\n childNode.properties?.joiningEntityCatalogObjectLeftKey\n );\n }\n if (promotedEntityForJoiningTable?.unityBaseSearchMethod) {\n siObj.joiningEntityKeyName = null;\n siObj.joiningEntityCatalogObjectLeftKeyName = null;\n }\n }\n searchIdentifiers.push(siObj);\n });\n }\n }\n\n // If there are no search identifiers, use the default ones from catalog entities\n if (!searchIdentifiers.length) {\n defaultSearchIdentifiers.forEach((searchIdentifier) => {\n const siObj: SearchIdentifierEntry = {\n searchNameKey: searchIdentifier,\n searchValueKey: searchIdentifier\n };\n if (\n childNode.properties?.catalogObjectKey &&\n childNode.properties?.joiningEntityCatalogObjectLeftKey\n ) {\n siObj.joiningEntityKeyName = toUpperFirstChar(\n childNode.properties?.catalogObjectKey\n );\n siObj.joiningEntityCatalogObjectLeftKeyName = toUpperFirstChar(\n childNode.properties?.joiningEntityCatalogObjectLeftKey\n );\n }\n searchIdentifiers.push(siObj);\n });\n }\n\n searchIdentifiers.forEach((si) => {\n // value comes from parent node object\n let searchValue: unknown = '';\n if (si?.searchJoiningEntity) {\n searchValue = (\n nodeObj[si.searchJoiningEntity] as Record<string, unknown>\n )[si.searchValueKey];\n } else {\n if (usingJoiningTableForSearch) {\n const joiningEntityCatalogObjectKey =\n node?.properties?.joiningEntityCatalogObjectKey;\n const value = nodeObj?.[joiningEntityCatalogObjectKey as string];\n searchValue = value\n ? (value as Record<string, unknown>)[si.searchValueKey]\n : nodeObj[si.searchValueKey];\n } else {\n searchValue = nodeObj[si.searchValueKey];\n }\n }\n let formattedPropertyName = toUpperFirstChar(si.searchNameKey);\n if (\n si.joiningEntityKeyName &&\n si.joiningEntityCatalogObjectLeftKeyName\n ) {\n formattedPropertyName = `${si.joiningEntityKeyName}.${si.joiningEntityCatalogObjectLeftKeyName}.${formattedPropertyName}`;\n }\n filterElements.push({\n searchField: formattedPropertyName,\n searchValue: searchValue,\n searchOperator: '='\n });\n });\n lazyNodeSearchObj.data = buildSearchRequestData(\n filterElements,\n 1,\n pageSize\n );\n lazyNodeSearchObj.pageSize = pageSize;\n lazyNodeSearchObj.apiMethodId = baseSearch?.apiMethodId || null;\n descriptors.push(lazyNodeSearchObj);\n } else {\n errorRetrievingChildren = 'Error: Promote ' + entityName + ' child entity';\n }\n });\n return { descriptors, errorRetrievingChildren };\n};\n\n/* -------------------------------------------------- bulk child counts (new) */\n\n/**\n * One bulk child-count query — a single AGGREGATE search per (apiMethodId ×\n * parent-ref field) that counts children for a whole PAGE of parents at once\n * (`keyField IN (values) GROUP BY keyField COUNT`), replacing N per-parent\n * count calls. New capability (no legacy counterpart); the aggregate body\n * follows the backend's grouped-search invariants: order on the grouped\n * column, eagerLoad true when operations are present.\n */\nexport interface BulkChildCountRequest {\n apiMethodId: string | number;\n /** The child entity's parent-ref field the counts group by. */\n keyField: string;\n /** Distinct parent key values covered by this request (stringified). */\n keyValues: string[];\n /**\n * Canonical hash of the extra (count-chip) filters folded into this request —\n * '' for the plain child count, so a chip with no conditions shares the\n * chevron count's bucket instead of asking again.\n */\n filterKey?: string;\n data: Record<string, unknown>;\n}\n\n/** A node's claim on bulk-count results: which (request, key value) pairs sum\n * into its child-count total. */\nexport interface BulkCountClaim {\n apiMethodId: string | number;\n keyField: string;\n keyValue: string;\n /** Same canonical filter hash as the request that answers this claim. */\n filterKey?: string;\n}\n\nconst bulkRequestKey = (\n apiMethodId: string | number,\n keyField: string,\n filterKey?: string\n) =>\n filterKey\n ? `${apiMethodId}::${keyField}::${filterKey}`\n : `${apiMethodId}::${keyField}`;\n\n/**\n * The aggregate body every bulk count uses: `keyField IN (values) GROUP BY\n * keyField COUNT`, plus any extra count-chip filters ANDed on top. Kept in one\n * place so the chevron path, the chip path and the runtime batcher can never\n * drift apart.\n */\nexport const buildBulkCountAggregateData = (\n keyField: string,\n keyValues: string[],\n extraFilterElements: LazyFilterElement[] = []\n): Record<string, unknown> => ({\n ...buildSearchRequestData(\n [inFilter(keyField, keyValues), ...extraFilterElements],\n 1,\n keyValues.length\n ),\n orderElements: [{ sortColumn: keyField, sortDirection: 'ASC' }],\n groupingType: 'AGGREGATE',\n groupProperty: [keyField],\n // Backend SearchHelper.GROUP_OPERATIONS is case-sensitive uppercase.\n groupOperationList: [{ operation: 'COUNT', property: keyField }],\n eagerLoad: true\n});\n\n/**\n * A descriptor is bulk-countable when it is a plain single-key '=' search —\n * one filter element on the parent-ref field. Composite-key and many-to-many\n * descriptors are excluded (their nodes keep the optimistic chevron with no\n * badge).\n */\nconst bulkCountableFilter = (\n sm: LazyChildSearchDescriptor\n): LazyFilterElement | null => {\n if (!sm.apiMethodId || !sm.data) return null;\n if (sm.manyToManyJointEntityApiMethodId || sm.manyToManyKeys?.length) {\n return null;\n }\n const filters = sm.data.filterElements ?? [];\n if (filters.length !== 1 || filters[0].searchOperator !== '=') return null;\n // Only non-blank scalar key values stringify meaningfully into IN lists.\n const value = filters[0].searchValue;\n if (isBlankKeyValue(value) || (typeof value !== 'string' && typeof value !== 'number')) {\n return null;\n }\n return filters[0];\n};\n\n/**\n * Group the bulk-countable descriptors of many sibling nodes into one\n * aggregate request per (apiMethodId × parent-ref field), and report each\n * node's claims so responses can be summed back per node. A node whose\n * descriptors are not ALL bulk-countable gets NO claims (its total would be\n * partial — worse than unknown). A descriptor with a blank parent key value\n * has no children (isBlankKeyValue) and claims nothing, so a node whose keys\n * are all blank gets an empty claim list — a known zero.\n */\nexport const buildBulkChildCountRequests = (\n nodes: Array<{\n id: string;\n lazyLoadChildrenArr?: LazyChildSearchDescriptor[] | null;\n }>\n): {\n requests: BulkChildCountRequest[];\n claimsByNodeId: Record<string, BulkCountClaim[]>;\n} => {\n const buckets = new Map<\n string,\n { apiMethodId: string | number; keyField: string; values: Set<string> }\n >();\n const claimsByNodeId: Record<string, BulkCountClaim[]> = {};\n\n nodes.forEach((node) => {\n const descriptors = node.lazyLoadChildrenArr ?? [];\n if (!descriptors.length) return;\n const claims: BulkCountClaim[] = [];\n for (const sm of descriptors) {\n const filters = sm.data?.filterElements ?? [];\n if (filters.some((filter) => isBlankKeyValue(filter.searchValue))) continue;\n const filter = bulkCountableFilter(sm);\n const methodId = sm.apiMethodId;\n if (!filter || methodId === null || methodId === undefined) {\n return; // partial totals lie — skip the whole node\n }\n claims.push({\n apiMethodId: methodId,\n keyField: filter.searchField,\n keyValue: String(filter.searchValue as string | number)\n });\n }\n claimsByNodeId[node.id] = claims;\n claims.forEach((claim) => {\n const key = bulkRequestKey(claim.apiMethodId, claim.keyField);\n const bucket =\n buckets.get(key) ??\n (buckets\n .set(key, {\n apiMethodId: claim.apiMethodId,\n keyField: claim.keyField,\n values: new Set<string>()\n })\n .get(key) as {\n apiMethodId: string | number;\n keyField: string;\n values: Set<string>;\n });\n bucket.values.add(claim.keyValue);\n });\n });\n\n const requests: BulkChildCountRequest[] = [];\n buckets.forEach((bucket) => {\n const keyValues = Array.from(bucket.values);\n requests.push({\n apiMethodId: bucket.apiMethodId,\n keyField: bucket.keyField,\n keyValues,\n data: buildBulkCountAggregateData(bucket.keyField, keyValues)\n });\n });\n\n return { requests, claimsByNodeId };\n};\n\n/**\n * Map one bulk-count response back to `keyValue → count`. Aggregate rows are\n * dictionaries with the grouped field plus the count column (alias varies by\n * backend template), so the count is the first OTHER numeric value in the\n * row; grouped values absent from the result set counted zero — the caller\n * treats missing keys as 0. Returns null when the response has no aggregate\n * rows (failed/unsupported → caller keeps the optimistic chevron).\n */\nexport const collectBulkChildCounts = (\n request: BulkChildCountRequest,\n response:\n | { data?: { aggregateResults?: unknown } | null }\n | null\n | undefined\n): Record<string, number> | null => {\n const rows = response?.data?.aggregateResults;\n if (!Array.isArray(rows)) return null;\n const wanted = request.keyField.toLowerCase();\n const out: Record<string, number> = {};\n rows.forEach((row) => {\n if (!row || typeof row !== 'object') return;\n const entries = Object.entries(row as Record<string, unknown>);\n const keyEntry = entries.find(([k]) => k.toLowerCase() === wanted);\n const keyValue = keyEntry?.[1];\n if (typeof keyValue !== 'string' && typeof keyValue !== 'number') return;\n const countEntry = entries.find(\n ([k, v]) => k.toLowerCase() !== wanted && typeof v === 'number'\n );\n if (!countEntry) return;\n out[String(keyValue)] = countEntry[1] as number;\n });\n return out;\n};\n\n/**\n * Sum a node's claims against fetched counts. Returns a number only when\n * EVERY claim's request resolved (countsByRequest holds a non-null map for\n * it) — an unknown anywhere means the total is unknown (null), never a lying\n * partial. Claimed keys missing from a resolved map count 0, and an empty\n * claim list is 0; no claims at all is unknown.\n */\nexport const sumBulkCountsForClaims = (\n claims: BulkCountClaim[] | null | undefined,\n countsByRequest: Map<string, Record<string, number> | null>\n): number | null => {\n if (!claims) return null;\n let total = 0;\n for (const claim of claims) {\n const counts = countsByRequest.get(\n bulkRequestKey(claim.apiMethodId, claim.keyField, claim.filterKey)\n );\n if (!counts) return null;\n total += counts[claim.keyValue] ?? 0;\n }\n return total;\n};\n\n/** The bucket key used by sumBulkCountsForClaims' countsByRequest map. */\nexport const bulkChildCountRequestKey = (\n request: Pick<BulkChildCountRequest, 'apiMethodId' | 'keyField' | 'filterKey'>\n): string =>\n bulkRequestKey(request.apiMethodId, request.keyField, request.filterKey);\n\n/* ------------------------------------------------------------- count chips */\n\n/**\n * Wire comparator → backend SearchHelper operator (SearchOperators in the\n * stencil search utilities). Only '!=' differs — SQL spells it '<>'.\n */\nconst COUNT_CHIP_OPERATORS: Record<CountChipOperator, string> = {\n '=': '=',\n '!=': '<>',\n '>': '>',\n '<': '<',\n '>=': '>=',\n '<=': '<='\n};\n\n/**\n * Condition values reach the backend as typed JSON. Numbers and booleans are\n * already right; the one trap is a boolean written as the STRING 'true' (the\n * same mismatch the rule compiler hit — a bit column never equals \"true\"), so\n * those two tokens become real booleans. Other strings stay verbatim: without\n * the field's catalog type, coercing '007' to 7 would break string keys.\n */\nconst coerceCountChipValue = (value: string | number | boolean): unknown => {\n if (typeof value !== 'string') return value;\n const token = value.trim().toLowerCase();\n if (token === 'true') return true;\n if (token === 'false') return false;\n return value;\n};\n\n/**\n * Compile a count chip's flat conditions into filter elements (implicitly\n * ANDed — the aggregate body's logicalSearchOperator is And). Field names are\n * upper-first like every other search this module builds: the config picks\n * fields off catalog properties, which are camelCase, while the backend\n * matches on the PascalCase column. Conditions with no field or an unknown\n * comparator are dropped rather than guessed at.\n */\nexport const compileCountChipConditions = (\n conditions: CountChipCondition[] | null | undefined\n): LazyFilterElement[] =>\n (conditions ?? [])\n .filter((c) => c?.field && COUNT_CHIP_OPERATORS[c.operator])\n .map((c) => ({\n searchField: toUpperFirstChar(c.field),\n searchValue: coerceCountChipValue(c.value),\n searchOperator: COUNT_CHIP_OPERATORS[c.operator]\n }));\n\n/**\n * Canonical, order-independent hash of compiled chip filters. Two chips whose\n * conditions differ only in order share one request; NO conditions hashes to\n * '' so the chip reuses the plain child-count bucket the chevron already\n * fetched (zero extra requests for the unfiltered case).\n */\nexport const countChipFilterKey = (\n filterElements: LazyFilterElement[] | null | undefined\n): string =>\n (filterElements ?? [])\n .map(\n (fe) =>\n `${fe.searchField}${fe.searchOperator}${JSON.stringify(fe.searchValue)}`\n )\n .sort()\n .join('&');\n\n/**\n * The count-chip descriptor for a row whose level has no lazy descriptor for\n * the chip's binding — eager levels, and any row produced by a path that\n * doesn't build descriptors at all. The chip still needs the child binding's\n * apiMethodId, parent-ref field and this row's key value: exactly what\n * buildLazyLoadDescriptors derives, so it is reused against the ONE configured\n * child level the chip names — no second copy of the catalog-association walk,\n * and no client-side counting of the eager child arrays (page-size truncated,\n * and blind to the chip's filters).\n */\nexport const buildCountChipDescriptor = (\n node: LevelConfig | null | undefined,\n parentRow: Record<string, unknown> | null | undefined,\n childNode: LevelConfig | null | undefined,\n catalogObjects: CatalogObject[] | null | undefined,\n promotedEntities: PromotedEntity[] | null | undefined\n): LazyChildSearchDescriptor | null => {\n if (!node || !childNode) return null;\n const { descriptors } = buildLazyLoadDescriptors(\n node,\n parentRow,\n [childNode],\n catalogObjects,\n promotedEntities\n );\n return descriptors[0] ?? null;\n};\n\n/** A count chip's claim, carrying the filters its request must fold in. */\nexport interface CountChipClaim extends BulkCountClaim {\n filterElements: LazyFilterElement[];\n}\n\n/** Per-node input for buildCountChipClaims (display-node subset). */\nexport interface CountChipNodeInput {\n id: string;\n countChip?: CountChipConfig | null;\n lazyLoadChildrenArr?: LazyChildSearchDescriptor[] | null;\n /** Eager levels' stand-in descriptor (buildCountChipDescriptor). */\n countChipChildrenArr?: LazyChildSearchDescriptor[] | null;\n}\n\n/**\n * Plan the count-chip counts for a page of rows: one claim per configured row,\n * batched into one aggregate request per (apiMethodId × parent-ref field ×\n * canonical filter hash) — the same IN/GROUP BY shape as the chevron counts,\n * plus the compiled filters. A chip whose childKey names a binding that is not\n * bulk-countable (composite key, many-to-many) or that this row has no\n * descriptor for produces NO claim and therefore no chip, matching the\n * chevron path's exclusions. A row whose parent key is blank has no children\n * (isBlankKeyValue): its claim is `null`, a known zero with nothing to fetch —\n * as the chevron count reads it.\n */\nexport const buildCountChipClaims = (\n nodes: CountChipNodeInput[]\n): {\n requests: BulkChildCountRequest[];\n claimByNodeId: Record<string, CountChipClaim | null>;\n} => {\n const buckets = new Map<\n string,\n {\n apiMethodId: string | number;\n keyField: string;\n filterKey: string;\n filterElements: LazyFilterElement[];\n values: Set<string>;\n }\n >();\n const claimByNodeId: Record<string, CountChipClaim | null> = {};\n\n nodes.forEach((node) => {\n const childKey = node.countChip?.childKey;\n if (!childKey) return;\n // Lazy levels already carry the descriptor; eager ones get the stand-in\n // built at display-tree time — either way the count goes through the same\n // batched aggregate.\n const descriptor = [\n ...(node.lazyLoadChildrenArr ?? []),\n ...(node.countChipChildrenArr ?? [])\n ].find((sm) => sm.parentNodeRefKey === childKey);\n if (!descriptor) return;\n const filters = descriptor.data?.filterElements ?? [];\n if (filters.some((filter) => isBlankKeyValue(filter.searchValue))) {\n claimByNodeId[node.id] = null;\n return;\n }\n const filter = bulkCountableFilter(descriptor);\n const methodId = descriptor.apiMethodId;\n if (!filter || methodId === null || methodId === undefined) return;\n\n const filterElements = compileCountChipConditions(\n node.countChip?.conditions\n );\n const filterKey = countChipFilterKey(filterElements);\n const claim: CountChipClaim = {\n apiMethodId: methodId,\n keyField: filter.searchField,\n keyValue: String(filter.searchValue as string | number),\n filterElements\n };\n if (filterKey) claim.filterKey = filterKey;\n claimByNodeId[node.id] = claim;\n\n const key = bulkRequestKey(methodId, filter.searchField, filterKey);\n const bucket =\n buckets.get(key) ??\n (buckets\n .set(key, {\n apiMethodId: methodId,\n keyField: filter.searchField,\n filterKey,\n filterElements,\n values: new Set<string>()\n })\n .get(key) as {\n apiMethodId: string | number;\n keyField: string;\n filterKey: string;\n filterElements: LazyFilterElement[];\n values: Set<string>;\n });\n bucket.values.add(claim.keyValue);\n });\n\n const requests: BulkChildCountRequest[] = [];\n buckets.forEach((bucket) => {\n const keyValues = Array.from(bucket.values);\n const request: BulkChildCountRequest = {\n apiMethodId: bucket.apiMethodId,\n keyField: bucket.keyField,\n keyValues,\n data: buildBulkCountAggregateData(\n bucket.keyField,\n keyValues,\n bucket.filterElements\n )\n };\n if (bucket.filterKey) request.filterKey = bucket.filterKey;\n requests.push(request);\n });\n\n return { requests, claimByNodeId };\n};\n\n/**\n * Pure filter-building step of fetchManyToManyChildren\n * (TreeUtilities.js:1153-1172): one 'IN' filter per manyToManyKey collecting\n * the truthy searchValueKey values across the joining-table rows. Quirk kept:\n * searchValue is Array.prototype.toString() (comma-joined, no spaces). Feed\n * the result to buildSearchRequestData(filters, 1, 50) for the second-step\n * entity fetch (:1174-1177).\n */\nexport const buildManyToManyChildFilterElements = (\n manyToManyKeys: ManyToManyKey[] | null | undefined,\n items: Array<Record<string, unknown>> | null | undefined\n): LazyFilterElement[] => {\n const childFilterElements: LazyFilterElement[] = [];\n (manyToManyKeys ?? []).forEach((mtmKey) => {\n const searchValue: unknown[] = [];\n const formattedPropertyName = toUpperFirstChar(mtmKey.searchNameKey);\n (items ?? []).forEach((item) => {\n if (item[mtmKey.searchValueKey]) {\n searchValue.push(item[mtmKey.searchValueKey]);\n }\n });\n childFilterElements.push({\n searchField: formattedPropertyName,\n searchValue: toWireString(searchValue),\n searchOperator: 'IN'\n });\n });\n return childFilterElements;\n};\n"],"mappings":";;;;;AA2GA,MAAM6C,mBAAmBrC;AACzB,MAAMsC,mBAAmBtC;;;;;;;;AAWzB,MAAauC,0BACXC,sBACAC,MACA5B,aACsB;CACtB,MAAM6B,eAAkC;EACtC9B,YAAY6B,QAAQ;EACpB5B,UAAUA,YAAY;EACtBC,gBAAgB,EAAE;EAClBC,cAAc,EAAE;EAChBC,eAAe,EAAE;EACjBC,cAAc;EACdC,eAAe,EAAE;EACjBC,oBAAoB,EAAE;EACtBC,WAAW;EACXC,uBAAuB;EACxB;AACD,KAAImB,qBACFA,sBAAqBG,SAASC,aAAa;AACzCF,eAAa5B,eAAe+B,KAAKD,SAAS;GAC1C;AAEJ,QAAOF;;;;;;;AAQT,MAAaI,mBAAmBC,UAC9BA,UAAU,QAAQA,UAAU;;AAG9B,MAAaC,YACXC,UACAC,eACuB;CACvB1C,aAAayC;CACbxC,aAAayC,UAAU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