@ynput/ayon-frontend-shared 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/dist/_virtual/index.cjs4.js +1 -1
  2. package/dist/_virtual/index.cjs5.js +1 -1
  3. package/dist/_virtual/index.es4.js +2 -5
  4. package/dist/_virtual/index.es4.js.map +1 -1
  5. package/dist/_virtual/index.es5.js +5 -2
  6. package/dist/_virtual/index.es5.js.map +1 -1
  7. package/dist/node_modules/remove-accents/index.cjs.js +1 -1
  8. package/dist/node_modules/remove-accents/index.es.js +1 -1
  9. package/dist/node_modules/web-namespaces/index.cjs.js +1 -1
  10. package/dist/node_modules/web-namespaces/index.cjs.js.map +1 -1
  11. package/dist/node_modules/web-namespaces/index.es.js +3 -8
  12. package/dist/node_modules/web-namespaces/index.es.js.map +1 -1
  13. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js +1 -1
  14. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.es.js +1 -1
  15. package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
  16. package/dist/shared/node_modules/react-transition-group/esm/Transition.es.js +1 -1
  17. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js +1 -1
  18. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.es.js +1 -1
  19. package/dist/shared/src/api/generated/graphql.cjs.js +12 -8
  20. package/dist/shared/src/api/generated/graphql.cjs.js.map +1 -1
  21. package/dist/shared/src/api/generated/graphql.es.js +11 -7
  22. package/dist/shared/src/api/generated/graphql.es.js.map +1 -1
  23. package/dist/shared/src/api/generated/graphqlLinks.cjs.js.map +1 -1
  24. package/dist/shared/src/api/generated/graphqlLinks.es.js.map +1 -1
  25. package/dist/shared/src/api/queries/overview/getOverview.cjs.js +1 -1
  26. package/dist/shared/src/api/queries/overview/getOverview.cjs.js.map +1 -1
  27. package/dist/shared/src/api/queries/overview/getOverview.es.js +95 -95
  28. package/dist/shared/src/api/queries/overview/getOverview.es.js.map +1 -1
  29. package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.cjs.js +2 -2
  30. package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.cjs.js.map +1 -1
  31. package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.es.js +66 -61
  32. package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.es.js.map +1 -1
  33. package/dist/shared/src/components/RemotePage/RemotePageWrapper.cjs.js +1 -1
  34. package/dist/shared/src/components/RemotePage/RemotePageWrapper.cjs.js.map +1 -1
  35. package/dist/shared/src/components/RemotePage/RemotePageWrapper.es.js +14 -11
  36. package/dist/shared/src/components/RemotePage/RemotePageWrapper.es.js.map +1 -1
  37. package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.cjs.js +1 -1
  38. package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.cjs.js.map +1 -1
  39. package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.es.js +42 -41
  40. package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.es.js.map +1 -1
  41. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.cjs.js +1 -1
  42. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.cjs.js.map +1 -1
  43. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.es.js +23 -23
  44. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.es.js.map +1 -1
  45. package/dist/shared/src/containers/Feed/hooks/useTransformActivities.cjs.js +1 -1
  46. package/dist/shared/src/containers/Feed/hooks/useTransformActivities.cjs.js.map +1 -1
  47. package/dist/shared/src/containers/Feed/hooks/useTransformActivities.es.js +6 -6
  48. package/dist/shared/src/containers/Feed/hooks/useTransformActivities.es.js.map +1 -1
  49. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.cjs.js +1 -1
  50. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.cjs.js.map +1 -1
  51. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.es.js +65 -64
  52. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.es.js.map +1 -1
  53. package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.cjs.js +1 -1
  54. package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.cjs.js.map +1 -1
  55. package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.es.js +16 -16
  56. package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.es.js.map +1 -1
  57. package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.cjs.js +3 -3
  58. package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.cjs.js.map +1 -1
  59. package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.es.js +142 -146
  60. package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.es.js.map +1 -1
  61. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js +1 -1
  62. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js.map +1 -1
  63. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js +24 -24
  64. package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js.map +1 -1
  65. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.cjs.js +1 -1
  66. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.cjs.js.map +1 -1
  67. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.es.js +141 -132
  68. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.es.js.map +1 -1
  69. package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.cjs.js +1 -1
  70. package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.cjs.js.map +1 -1
  71. package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.es.js +35 -28
  72. package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.es.js.map +1 -1
  73. package/dist/shared/src/containers/ProjectTreeTable/widgets/TextWidget.cjs.js +2 -2
  74. package/dist/shared/src/containers/ProjectTreeTable/widgets/TextWidget.cjs.js.map +1 -1
  75. package/dist/shared/src/containers/ProjectTreeTable/widgets/TextWidget.es.js +10 -10
  76. package/dist/shared/src/containers/Views/hooks/pages/useOverviewViewSettings.cjs.js.map +1 -1
  77. package/dist/shared/src/containers/Views/hooks/pages/useOverviewViewSettings.es.js.map +1 -1
  78. package/dist/shared/src/context/AddonContext.cjs.js.map +1 -1
  79. package/dist/shared/src/context/AddonContext.es.js.map +1 -1
  80. package/dist/shared/src/context/ProjectFoldersContext.cjs.js +1 -1
  81. package/dist/shared/src/context/ProjectFoldersContext.cjs.js.map +1 -1
  82. package/dist/shared/src/context/ProjectFoldersContext.es.js +62 -49
  83. package/dist/shared/src/context/ProjectFoldersContext.es.js.map +1 -1
  84. package/dist/shared/src/hooks/useLoadModules.cjs.js +1 -1
  85. package/dist/shared/src/hooks/useLoadModules.cjs.js.map +1 -1
  86. package/dist/shared/src/hooks/useLoadModules.es.js +86 -80
  87. package/dist/shared/src/hooks/useLoadModules.es.js.map +1 -1
  88. package/dist/types/api/generated/graphql.d.ts +2 -1
  89. package/dist/types/api/generated/graphqlLinks.d.ts +1 -0
  90. package/dist/types/api/queries/overview/getOverview.d.ts +1 -0
  91. package/dist/types/components/RemotePage/RemotePageWrapper.d.ts +1 -0
  92. package/dist/types/components/SearchFilter/useBuildFilterOptions.d.ts +1 -0
  93. package/dist/types/containers/ProjectTreeTable/hooks/useFetchOverviewData.d.ts +2 -1
  94. package/dist/types/containers/ProjectTreeTable/hooks/useQueryFilters.d.ts +4 -1
  95. package/dist/types/context/AddonContext.d.ts +1 -0
  96. package/dist/types/context/ProjectFoldersContext.d.ts +1 -0
  97. package/package.json +2 -1
  98. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.cjs.js +0 -2
  99. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.cjs.js.map +0 -1
  100. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.es.js +0 -63
  101. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.es.js.map +0 -1
  102. package/dist/node_modules/@ungap/structured-clone/esm/index.cjs.js +0 -2
  103. package/dist/node_modules/@ungap/structured-clone/esm/index.cjs.js.map +0 -1
  104. package/dist/node_modules/@ungap/structured-clone/esm/index.es.js +0 -12
  105. package/dist/node_modules/@ungap/structured-clone/esm/index.es.js.map +0 -1
  106. package/dist/node_modules/@ungap/structured-clone/esm/serialize.cjs.js +0 -2
  107. package/dist/node_modules/@ungap/structured-clone/esm/serialize.cjs.js.map +0 -1
  108. package/dist/node_modules/@ungap/structured-clone/esm/serialize.es.js +0 -107
  109. package/dist/node_modules/@ungap/structured-clone/esm/serialize.es.js.map +0 -1
  110. package/dist/node_modules/@ungap/structured-clone/esm/types.cjs.js +0 -2
  111. package/dist/node_modules/@ungap/structured-clone/esm/types.cjs.js.map +0 -1
  112. package/dist/node_modules/@ungap/structured-clone/esm/types.es.js +0 -14
  113. package/dist/node_modules/@ungap/structured-clone/esm/types.es.js.map +0 -1
  114. package/dist/node_modules/devlop/lib/default.cjs.js +0 -2
  115. package/dist/node_modules/devlop/lib/default.cjs.js.map +0 -1
  116. package/dist/node_modules/devlop/lib/default.es.js +0 -6
  117. package/dist/node_modules/devlop/lib/default.es.js.map +0 -1
  118. package/dist/node_modules/entities/dist/esm/decode-codepoint.cjs.js +0 -2
  119. package/dist/node_modules/entities/dist/esm/decode-codepoint.cjs.js.map +0 -1
  120. package/dist/node_modules/entities/dist/esm/decode-codepoint.es.js +0 -39
  121. package/dist/node_modules/entities/dist/esm/decode-codepoint.es.js.map +0 -1
  122. package/dist/node_modules/entities/dist/esm/decode.cjs.js +0 -2
  123. package/dist/node_modules/entities/dist/esm/decode.cjs.js.map +0 -1
  124. package/dist/node_modules/entities/dist/esm/decode.es.js +0 -246
  125. package/dist/node_modules/entities/dist/esm/decode.es.js.map +0 -1
  126. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.cjs.js +0 -2
  127. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.cjs.js.map +0 -1
  128. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.es.js +0 -8
  129. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.es.js.map +0 -1
  130. package/dist/node_modules/hast-util-raw/lib/index.cjs.js +0 -2
  131. package/dist/node_modules/hast-util-raw/lib/index.cjs.js.map +0 -1
  132. package/dist/node_modules/hast-util-raw/lib/index.es.js +0 -218
  133. package/dist/node_modules/hast-util-raw/lib/index.es.js.map +0 -1
  134. package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.cjs.js +0 -2
  135. package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.cjs.js.map +0 -1
  136. package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.es.js +0 -146
  137. package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.es.js.map +0 -1
  138. package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.cjs.js +0 -2
  139. package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.cjs.js.map +0 -1
  140. package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.es.js +0 -21
  141. package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.es.js.map +0 -1
  142. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.cjs.js +0 -2
  143. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.cjs.js.map +0 -1
  144. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.es.js +0 -113
  145. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.es.js.map +0 -1
  146. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.cjs.js +0 -2
  147. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.cjs.js.map +0 -1
  148. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.es.js +0 -9
  149. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.es.js.map +0 -1
  150. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs.js +0 -2
  151. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs.js.map +0 -1
  152. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.es.js +0 -45
  153. package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.es.js.map +0 -1
  154. package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.cjs.js +0 -2
  155. package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.cjs.js.map +0 -1
  156. package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.es.js +0 -26
  157. package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.es.js.map +0 -1
  158. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.cjs.js +0 -2
  159. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.cjs.js.map +0 -1
  160. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.es.js +0 -99
  161. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.es.js.map +0 -1
  162. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.cjs.js +0 -2
  163. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.cjs.js.map +0 -1
  164. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.es.js +0 -8
  165. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.es.js.map +0 -1
  166. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.cjs.js +0 -2
  167. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.cjs.js.map +0 -1
  168. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.es.js +0 -211
  169. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.es.js.map +0 -1
  170. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.cjs.js +0 -2
  171. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.cjs.js.map +0 -1
  172. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.es.js +0 -251
  173. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.es.js.map +0 -1
  174. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.cjs.js +0 -2
  175. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.cjs.js.map +0 -1
  176. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.es.js +0 -15
  177. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.es.js.map +0 -1
  178. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.cjs.js +0 -2
  179. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.cjs.js.map +0 -1
  180. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.es.js +0 -74
  181. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.es.js.map +0 -1
  182. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.cjs.js +0 -2
  183. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.cjs.js.map +0 -1
  184. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.es.js +0 -85
  185. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.es.js.map +0 -1
  186. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.cjs.js +0 -2
  187. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.cjs.js.map +0 -1
  188. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.es.js +0 -2272
  189. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.es.js.map +0 -1
  190. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.cjs.js +0 -2
  191. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.cjs.js.map +0 -1
  192. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.es.js +0 -241
  193. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.es.js.map +0 -1
  194. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.cjs.js +0 -2
  195. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.cjs.js.map +0 -1
  196. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.es.js +0 -3
  197. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.es.js.map +0 -1
  198. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.cjs.js +0 -2
  199. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.cjs.js.map +0 -1
  200. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.es.js +0 -1941
  201. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.es.js.map +0 -1
  202. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.cjs.js +0 -2
  203. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.cjs.js.map +0 -1
  204. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.es.js +0 -89
  205. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.es.js.map +0 -1
  206. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.cjs.js +0 -2
  207. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.cjs.js.map +0 -1
  208. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.es.js +0 -163
  209. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.es.js.map +0 -1
  210. package/dist/node_modules/hast-util-raw/node_modules/property-information/index.cjs.js +0 -2
  211. package/dist/node_modules/hast-util-raw/node_modules/property-information/index.cjs.js.map +0 -1
  212. package/dist/node_modules/hast-util-raw/node_modules/property-information/index.es.js +0 -13
  213. package/dist/node_modules/hast-util-raw/node_modules/property-information/index.es.js.map +0 -1
  214. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.cjs.js +0 -2
  215. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.cjs.js.map +0 -1
  216. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.es.js +0 -62
  217. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.es.js.map +0 -1
  218. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.cjs.js +0 -2
  219. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.cjs.js.map +0 -1
  220. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.es.js +0 -34
  221. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.es.js.map +0 -1
  222. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.cjs.js +0 -2
  223. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.cjs.js.map +0 -1
  224. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.es.js +0 -369
  225. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.es.js.map +0 -1
  226. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.cjs.js +0 -2
  227. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.cjs.js.map +0 -1
  228. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.es.js +0 -7
  229. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.es.js.map +0 -1
  230. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.cjs.js +0 -2
  231. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.cjs.js.map +0 -1
  232. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.es.js +0 -567
  233. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.es.js.map +0 -1
  234. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js +0 -2
  235. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js.map +0 -1
  236. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.es.js +0 -8
  237. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.es.js.map +0 -1
  238. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js +0 -2
  239. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js.map +0 -1
  240. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.es.js +0 -7
  241. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.es.js.map +0 -1
  242. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.cjs.js +0 -2
  243. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.cjs.js.map +0 -1
  244. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.es.js +0 -20
  245. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.es.js.map +0 -1
  246. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.cjs.js +0 -2
  247. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.cjs.js.map +0 -1
  248. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.es.js +0 -37
  249. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.es.js.map +0 -1
  250. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.cjs.js +0 -2
  251. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.cjs.js.map +0 -1
  252. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.es.js +0 -29
  253. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.es.js.map +0 -1
  254. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.cjs.js +0 -2
  255. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.cjs.js.map +0 -1
  256. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.es.js +0 -11
  257. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.es.js.map +0 -1
  258. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.cjs.js +0 -2
  259. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.cjs.js.map +0 -1
  260. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.es.js +0 -22
  261. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.es.js.map +0 -1
  262. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.cjs.js +0 -2
  263. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.cjs.js.map +0 -1
  264. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.es.js +0 -15
  265. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.es.js.map +0 -1
  266. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.cjs.js +0 -2
  267. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.cjs.js.map +0 -1
  268. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.es.js +0 -20
  269. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.es.js.map +0 -1
  270. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.cjs.js +0 -2
  271. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.cjs.js.map +0 -1
  272. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.es.js +0 -12
  273. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.es.js.map +0 -1
  274. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.cjs.js +0 -2
  275. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.cjs.js.map +0 -1
  276. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.es.js +0 -12
  277. package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.es.js.map +0 -1
  278. package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.cjs.js +0 -3
  279. package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.cjs.js.map +0 -1
  280. package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.es.js +0 -43
  281. package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.es.js.map +0 -1
  282. package/dist/node_modules/hast-util-to-parse5/lib/index.cjs.js +0 -2
  283. package/dist/node_modules/hast-util-to-parse5/lib/index.cjs.js.map +0 -1
  284. package/dist/node_modules/hast-util-to-parse5/lib/index.es.js +0 -119
  285. package/dist/node_modules/hast-util-to-parse5/lib/index.es.js.map +0 -1
  286. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.cjs.js +0 -2
  287. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.cjs.js.map +0 -1
  288. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.es.js +0 -13
  289. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.es.js.map +0 -1
  290. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.cjs.js +0 -2
  291. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.cjs.js.map +0 -1
  292. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.es.js +0 -62
  293. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.es.js.map +0 -1
  294. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.cjs.js +0 -2
  295. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.cjs.js.map +0 -1
  296. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.es.js +0 -34
  297. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.es.js.map +0 -1
  298. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.cjs.js +0 -2
  299. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.cjs.js.map +0 -1
  300. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.es.js +0 -369
  301. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.es.js.map +0 -1
  302. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.cjs.js +0 -2
  303. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.cjs.js.map +0 -1
  304. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.es.js +0 -7
  305. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.es.js.map +0 -1
  306. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.cjs.js +0 -2
  307. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.cjs.js.map +0 -1
  308. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.es.js +0 -567
  309. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.es.js.map +0 -1
  310. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js +0 -2
  311. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js.map +0 -1
  312. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.es.js +0 -8
  313. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.es.js.map +0 -1
  314. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js +0 -2
  315. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js.map +0 -1
  316. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.es.js +0 -7
  317. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.es.js.map +0 -1
  318. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.cjs.js +0 -2
  319. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.cjs.js.map +0 -1
  320. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.es.js +0 -20
  321. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.es.js.map +0 -1
  322. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.cjs.js +0 -2
  323. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.cjs.js.map +0 -1
  324. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.es.js +0 -37
  325. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.es.js.map +0 -1
  326. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.cjs.js +0 -2
  327. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.cjs.js.map +0 -1
  328. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.es.js +0 -29
  329. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.es.js.map +0 -1
  330. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.cjs.js +0 -2
  331. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.cjs.js.map +0 -1
  332. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.es.js +0 -11
  333. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.es.js.map +0 -1
  334. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.cjs.js +0 -2
  335. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.cjs.js.map +0 -1
  336. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.es.js +0 -22
  337. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.es.js.map +0 -1
  338. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.cjs.js +0 -2
  339. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.cjs.js.map +0 -1
  340. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.es.js +0 -15
  341. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.es.js.map +0 -1
  342. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.cjs.js +0 -2
  343. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.cjs.js.map +0 -1
  344. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.es.js +0 -20
  345. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.es.js.map +0 -1
  346. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.cjs.js +0 -2
  347. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.cjs.js.map +0 -1
  348. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.es.js +0 -12
  349. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.es.js.map +0 -1
  350. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.cjs.js +0 -2
  351. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.cjs.js.map +0 -1
  352. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.es.js +0 -12
  353. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.es.js.map +0 -1
  354. package/dist/node_modules/rehype-raw/lib/index.cjs.js +0 -2
  355. package/dist/node_modules/rehype-raw/lib/index.cjs.js.map +0 -1
  356. package/dist/node_modules/rehype-raw/lib/index.es.js +0 -13
  357. package/dist/node_modules/rehype-raw/lib/index.es.js.map +0 -1
  358. package/dist/node_modules/unist-util-is/lib/index.cjs.js +0 -2
  359. package/dist/node_modules/unist-util-is/lib/index.cjs.js.map +0 -1
  360. package/dist/node_modules/unist-util-is/lib/index.es.js +0 -92
  361. package/dist/node_modules/unist-util-is/lib/index.es.js.map +0 -1
  362. package/dist/node_modules/unist-util-position/lib/index.cjs.js +0 -2
  363. package/dist/node_modules/unist-util-position/lib/index.cjs.js.map +0 -1
  364. package/dist/node_modules/unist-util-position/lib/index.es.js +0 -18
  365. package/dist/node_modules/unist-util-position/lib/index.es.js.map +0 -1
  366. package/dist/node_modules/unist-util-visit/lib/index.cjs.js +0 -2
  367. package/dist/node_modules/unist-util-visit/lib/index.cjs.js.map +0 -1
  368. package/dist/node_modules/unist-util-visit/lib/index.es.js +0 -17
  369. package/dist/node_modules/unist-util-visit/lib/index.es.js.map +0 -1
  370. package/dist/node_modules/unist-util-visit-parents/lib/color.cjs.js +0 -2
  371. package/dist/node_modules/unist-util-visit-parents/lib/color.cjs.js.map +0 -1
  372. package/dist/node_modules/unist-util-visit-parents/lib/color.es.js +0 -7
  373. package/dist/node_modules/unist-util-visit-parents/lib/color.es.js.map +0 -1
  374. package/dist/node_modules/unist-util-visit-parents/lib/index.cjs.js +0 -2
  375. package/dist/node_modules/unist-util-visit-parents/lib/index.cjs.js.map +0 -1
  376. package/dist/node_modules/unist-util-visit-parents/lib/index.es.js +0 -57
  377. package/dist/node_modules/unist-util-visit-parents/lib/index.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useBuildFilterOptions.cjs.js","sources":["../../../../../src/components/SearchFilter/useBuildFilterOptions.tsx"],"sourcesContent":["import { getAttributeIcon, getEntityTypeIcon } from '@shared/util'\nimport {\n ProductType,\n useGetEntityGroupsQuery,\n useGetKanbanProjectUsersQuery,\n useGetProjectsInfoQuery,\n} from '@shared/api'\nimport type {\n GetProjectsInfoResponse,\n FolderType,\n Status,\n Tag,\n TaskType,\n AttributeModel,\n AttributeEnumItem,\n AttributeData,\n EntityGroup,\n} from '@shared/api'\nimport { ColumnOrderState } from '@tanstack/react-table'\nimport { Icon, Option, Filter, SEARCH_FILTER_ID } from '@ynput/ayon-react-components'\nimport { dateOptions } from './filterDates'\nimport { isEmpty } from 'lodash'\nimport { SliceFilter } from '@shared/containers'\nimport { FEATURED_VERSION_TYPES } from '../FeaturedVersionOrder'\nimport { useGlobalContext } from '@shared/context'\n\ntype ScopeType = 'folder' | 'product' | 'task' | 'user' | 'version'\ntype Scope = ScopeType | ScopeType[]\n\nexport type ScopeWithFilterTypes = {\n scope: ScopeType\n filterTypes: FilterFieldType[]\n}\n\nexport type FilterFieldType =\n | 'folderType'\n | 'taskType'\n | 'productType'\n | ('users' | 'assignees' | 'author')\n | 'attributes'\n | 'status'\n | 'tags'\n | 'version'\n | 'hasReviewables'\n | 'productName'\n | 'name'\ntype AttributeType =\n | string\n | number\n | boolean\n | Date\n | string[]\n | number[]\n | any[]\n | { [key: string]: any }\n\ntype AttributeDataValue = AttributeType | null | undefined\n\ntype FilterConfig = {\n enableExcludes?: boolean\n enableOperatorChange?: boolean\n enableRelativeValues?: boolean\n prefixes?: Partial<Record<FilterFieldType, string>> // strings that will be prepended to the id of the option\n keys?: Partial<Record<FilterFieldType, string>> // replaces the default keys for the filter\n}\n\nexport type BuildFilterOptions = {\n filterTypes?: FilterFieldType[]\n projectNames: string[]\n scope?: Scope\n scopes?: ScopeWithFilterTypes[]\n data: {\n tags?: string[]\n attributes?: Record<string, AttributeDataValue[]>\n assignees?: string[]\n productTypes?: ProductType[]\n productNames?: string[]\n }\n columnOrder?: ColumnOrderState\n config?: FilterConfig\n power?: boolean\n}\n\nexport const useBuildFilterOptions = ({\n filterTypes: globalFilterTypes = [],\n projectNames,\n scope,\n scopes: customScopes,\n data,\n config,\n columnOrder = [],\n power,\n}: BuildFilterOptions): Option[] => {\n let options: Option[] = []\n\n // Determine which scopes to use\n // If customScopes is provided, use it; otherwise, fall back to the old method\n const scopesWithTypes: Array<{ scope: ScopeType; filterTypes: FilterFieldType[] }> = customScopes\n ? customScopes\n : (() => {\n // Fallback to old method: normalize scope to array and use globalFilterTypes for all\n const normalizedScopes = scope ? (Array.isArray(scope) ? scope : [scope]) : []\n return normalizedScopes.map((s) => ({\n scope: s,\n filterTypes: globalFilterTypes,\n }))\n })()\n\n const isMultiScope = scopesWithTypes.length > 1\n\n // QUERIES\n //\n //\n // Check if any scope needs these filter types\n const anyNeedsEntitySubType = scopesWithTypes.some((s) =>\n ['entitySubType', 'status'].some((type) => s.filterTypes.includes(type as FilterFieldType)),\n )\n const anyNeedsUsers = scopesWithTypes.some((s) =>\n ['assignees', 'users', 'author'].some((type) =>\n s.filterTypes.includes(type as FilterFieldType),\n ),\n )\n // find if any search field is in any of the scopesWithTypes\n const fieldInScopes = (field: FilterFieldType): boolean => {\n return scopesWithTypes.some((s) => s.filterTypes.includes(field))\n }\n\n // get grouping options for productTypes\n // NOTE: We should revisit this to be used for all attribs and fields\n const { data: { groups: productTypes = [] } = {} } = useGetEntityGroupsQuery(\n {\n entityType: 'product',\n groupingKey: 'productType',\n projectName: projectNames[0],\n empty: true,\n },\n { skip: !projectNames?.length || !fieldInScopes('productType') },\n )\n\n const { data: projectsInfo = {} } = useGetProjectsInfoQuery(\n {\n projects: projectNames,\n },\n {\n skip: !projectNames?.length || !anyNeedsEntitySubType,\n },\n )\n\n const { data: projectUsers = [] } = useGetKanbanProjectUsersQuery(\n { projects: projectNames },\n {\n skip: !projectNames?.length || !anyNeedsUsers,\n },\n )\n\n const { attributes } = useGlobalContext()\n //\n //\n // QUERIES\n\n // ADD OPTIONS\n\n // Helper to get scope label (capitalize first letter)\n const getScopeLabel = (scope: ScopeType) => scope.charAt(0).toUpperCase() + scope.slice(1)\n\n // Loop through each scope to build options\n scopesWithTypes.forEach(({ scope: currentScope, filterTypes: scopeFilterTypes }) => {\n const scopePrefix = isMultiScope ? currentScope : undefined\n const scopeLabel = isMultiScope ? getScopeLabel(currentScope) : undefined\n\n // TASK TYPE\n // add taskType option\n if (scopeFilterTypes.includes('taskType') && currentScope !== 'user') {\n const entitySubTypeOption = getOptionRoot(\n 'taskType',\n {\n ...config,\n enableOperatorChange: false,\n },\n scopePrefix,\n scopeLabel,\n )\n if (entitySubTypeOption) {\n // get all subTypes for the current scope (entityType)\n let subTypes = getSubTypes({ projectsInfo, productTypes }, 'task')\n\n entitySubTypeOption.values?.push(...subTypes)\n\n options.push(entitySubTypeOption)\n }\n }\n\n // FOLDER TYPE\n // add folderType option\n if (scopeFilterTypes.includes('folderType') && currentScope !== 'user') {\n const entitySubTypeOption = getOptionRoot(\n 'folderType',\n {\n ...config,\n enableOperatorChange: false,\n },\n scopePrefix,\n scopeLabel,\n )\n if (entitySubTypeOption) {\n // get all subTypes for the current scope (entityType)\n let subTypes = getSubTypes({ projectsInfo, productTypes }, 'folder')\n\n entitySubTypeOption.values?.push(...subTypes)\n\n options.push(entitySubTypeOption)\n }\n }\n\n // PRODUCT TYPE\n // add productType option\n if (scopeFilterTypes.includes('productType') && currentScope !== 'user') {\n const entitySubTypeOption = getOptionRoot(\n 'productType',\n {\n ...config,\n enableOperatorChange: false,\n },\n scopePrefix,\n scopeLabel,\n )\n if (entitySubTypeOption) {\n // get all subTypes for the current scope (entityType)\n let subTypes = getSubTypes({ projectsInfo, productTypes }, 'product')\n entitySubTypeOption.values?.push(...subTypes)\n options.push(entitySubTypeOption)\n }\n }\n // PRODUCT NAME\n // add product name option\n if (scopeFilterTypes.includes('productName') && currentScope === 'product') {\n const productNameOption = getOptionRoot('productName', config, scopePrefix, scopeLabel)\n\n if (productNameOption) {\n // Populate with product names from data as suggestions (optional since allowsCustomValues: true)\n data.productNames?.forEach((name) => {\n if (!productNameOption.values?.some((value) => value.id === name)) {\n productNameOption.values?.push({\n id: name,\n label: name,\n })\n }\n })\n\n options.push(productNameOption)\n }\n }\n\n // STATUS\n // add status option\n if (scopeFilterTypes.includes('status')) {\n const statusOption = getOptionRoot(\n 'status',\n { ...config, enableOperatorChange: false },\n scopePrefix,\n scopeLabel,\n )\n\n if (statusOption) {\n Object.values(projectsInfo).forEach((project) => {\n const statuses = project?.statuses || []\n statuses\n .filter((status) => status.scope?.includes(currentScope))\n .forEach((status: Status) => {\n if (!statusOption.values?.some((value) => value.id === status.name)) {\n statusOption.values?.push({\n id: status.name,\n label: status.name,\n icon: status.icon,\n color: status.color,\n })\n }\n })\n })\n\n options.push(statusOption)\n }\n }\n\n // ASSIGNEES\n // add users/assignees option\n if (scopeFilterTypes.includes('assignees')) {\n const assigneesOption = getOptionRoot('assignees', config, scopePrefix, scopeLabel)\n\n if (assigneesOption) {\n // add every user for the projects (skip duplicates)\n projectUsers.forEach((user) => {\n if (!assigneesOption.values?.some((value) => value.id === user.name)) {\n assigneesOption.values?.push({\n id: user.name,\n label: user.attrib.fullName || user.name,\n img: `/api/users/${user.name}/avatar`,\n icon: null,\n })\n }\n })\n\n // sort the assignees based on the number of times they appear in data.assignees\n assigneesOption.values?.sort((a, b) => {\n const aCount = data.assignees?.filter((assignee) => assignee === a.id).length || 0\n const bCount = data.assignees?.filter((assignee) => assignee === b.id).length || 0\n return bCount - aCount\n })\n\n options.push(assigneesOption)\n }\n }\n\n if (scopeFilterTypes.includes('author')) {\n const authorOption = getOptionRoot('author', config, scopePrefix, scopeLabel)\n if (authorOption) {\n // add every user for the projects (skip duplicates)\n projectUsers.forEach((user) => {\n if (!authorOption.values?.some((value) => value.id === user.name)) {\n authorOption.values?.push({\n id: user.name,\n label: user.attrib.fullName || user.name,\n img: `/api/users/${user.name}/avatar`,\n icon: null,\n })\n }\n })\n options.push(authorOption)\n }\n }\n\n // TAGS\n // add tags options\n if (scopeFilterTypes.includes('tags')) {\n const tagsOption = getOptionRoot('tags', config, scopePrefix, scopeLabel)\n\n if (tagsOption) {\n // reduce projectsInfo to get all tags\n const tagsAnatomy = new Map<string, Tag>()\n Object.values(projectsInfo).forEach((project) => {\n if (project?.tags) {\n project.tags.forEach((tag) => {\n if (!tagsAnatomy.has(tag.name)) {\n tagsAnatomy.set(tag.name, tag)\n }\n })\n }\n })\n\n // create options for each tag, finding color if in tagsAnatomy\n const tagOptionValuesMap = new Map<string, Option & { count: number }>()\n data.tags?.forEach((tag) => {\n const existingTag = tagOptionValuesMap.get(tag)\n if (existingTag) {\n // increment count\n existingTag.count++\n return\n } else {\n // create new tag\n const tagData = tagsAnatomy.get(tag)\n\n tagOptionValuesMap.set(tag, {\n id: tag,\n type: 'string',\n label: tag,\n values: [],\n color: tagData?.color || null,\n count: 1,\n })\n }\n })\n\n // convert values map to array and sort based on count\n const tagOptionValues = Array.from(tagOptionValuesMap.values()).sort(\n (a, b) => b.count - a.count,\n )\n\n // add tag options to the tagsOption\n tagsOption.values?.push(...tagOptionValues)\n\n options.push(tagsOption)\n }\n }\n\n // VERSION\n // add version options\n if (scopeFilterTypes.includes('version')) {\n const versionOption = getOptionRoot('version', config, scopePrefix, scopeLabel)\n\n if (versionOption) {\n // add featured version types as options\n FEATURED_VERSION_TYPES.forEach((versionType) => {\n versionOption.values?.push({\n id: versionType.value,\n label: versionType.label,\n icon: versionType.icon,\n })\n })\n\n options.push(versionOption)\n }\n }\n\n // NAME\n // add name filter for custom string input\n if (scopeFilterTypes.includes('name')) {\n const nameOption = getOptionRoot('name', config, scopePrefix, scopeLabel)\n\n if (nameOption) {\n options.push(nameOption)\n }\n }\n\n // HAS REVIEWABLES\n // add hasReviewables option\n if (scopeFilterTypes.includes('hasReviewables')) {\n const hasReviewablesOption = getOptionRoot('hasReviewables', config, scopePrefix, scopeLabel)\n\n if (hasReviewablesOption) {\n const options_list = [\n {\n id: 'true',\n label: 'Yes',\n values: [],\n icon: 'radio_button_checked',\n },\n {\n id: 'false',\n label: 'No',\n values: [],\n icon: 'radio_button_unchecked',\n },\n ]\n hasReviewablesOption.values?.push(...options_list)\n options.push(hasReviewablesOption)\n }\n }\n\n // ATTRIBUTES\n // dynamically add attributes options\n if (scopeFilterTypes.includes('attributes')) {\n const attributesByScope = attributes.filter((attribute) =>\n attribute.scope?.includes(currentScope),\n )\n // if attributesData is provided, filter out attributes that are not in the attributesData\n const attributesByValues = !isEmpty(data.attributes)\n ? attributesByScope.filter(\n (attribute) => data.attributes && data.attributes[attribute.name],\n )\n : attributesByScope\n\n const attributesWithoutDates = config?.enableRelativeValues\n ? attributesByValues\n : attributesByValues.filter((attribute) => attribute.data.type !== 'datetime')\n\n attributesWithoutDates.forEach((attribute) => {\n const realData = data.attributes && data.attributes[attribute.name]\n const enums = attribute.data.enum\n const type = attribute.data.type\n\n const isListOf = [\n 'list_of_strings',\n 'list_of_integers',\n 'list_of_any',\n 'list_of_submodels',\n ].includes(type || '')\n const isDate = type === 'datetime'\n const enableOperatorChange = isListOf ? config?.enableOperatorChange : false\n const enableRelativeValues = isListOf || isDate ? config?.enableRelativeValues : false\n // for the attribute, get the option root\n const option = getAttributeFieldOptionRoot(\n attribute,\n {\n ...config,\n allowsCustomValues: true,\n enableOperatorChange: enableOperatorChange,\n enableRelativeValues: enableRelativeValues,\n },\n scopePrefix,\n scopeLabel,\n )\n\n const suggestValuesForTypes: AttributeData['type'][] = [\n 'string',\n 'integer',\n 'float',\n 'list_of_strings',\n 'list_of_integers',\n ]\n\n const optionValues: Option[] = []\n\n // if the attribute type is in the suggestValuesForTypes, get the options based on real values\n if (suggestValuesForTypes.includes(type)) {\n const options = getAttributeOptions(realData, enums, type)\n optionValues.push(...options)\n }\n\n // if the attribute type is boolean, add yes/no options\n if (type === 'boolean') {\n const options = [\n {\n id: 'true',\n label: 'Yes',\n values: [],\n icon: 'radio_button_checked',\n },\n {\n id: 'false',\n label: 'No',\n values: [],\n icon: 'radio_button_unchecked',\n },\n ]\n optionValues.push(...options)\n }\n\n // if the attribute type is datetime, add datetime options\n\n if (isDate) {\n optionValues.push(\n ...dateOptions.map((o) => ({\n ...o,\n contentAfter: power ? undefined : <Icon icon=\"bolt\" />,\n })),\n )\n }\n\n // add option to the list of options\n option.values?.push(...optionValues)\n\n // add option to the list of options\n options.push(option)\n })\n }\n }) // End of scopes.forEach loop\n\n // order options by columnOrder\n if (columnOrder) {\n return sortOptionsBasedOnColumns(options, columnOrder)\n } else return options\n}\n\n// HELPER FUNCTIONS\n//\n//\n//\n//\nconst getSubTypes = (\n {\n projectsInfo,\n productTypes,\n }: { projectsInfo: GetProjectsInfoResponse; productTypes: EntityGroup[] },\n type: ScopeType,\n): Option[] => {\n const options: Option[] = []\n if (type === 'product') {\n productTypes.forEach(({ icon, label, value }) => {\n options.push({\n id: value,\n type: 'string',\n label: label || value,\n icon: icon || getEntityTypeIcon('product'),\n inverted: false,\n values: [],\n allowsCustomValues: false,\n })\n })\n } else if (type === 'task') {\n Object.values(projectsInfo).forEach((project) => {\n // for each project, get all task types and add them to the options (if they don't already exist)\n const taskTypes = project?.taskTypes || []\n taskTypes.forEach((taskType: TaskType) => {\n if (!options.some((option) => option.id === taskType.name)) {\n options.push({\n id: taskType.name,\n type: 'string',\n label: taskType.name,\n icon: taskType.icon,\n inverted: false,\n values: [],\n allowsCustomValues: false,\n })\n }\n })\n })\n } else if (type === 'folder') {\n Object.values(projectsInfo).forEach((project) => {\n // for each project, get all folder types and add them to the options (if they don't already exist)\n const folderTypes = project?.folderTypes || []\n folderTypes.forEach((folderType: FolderType) => {\n if (!options.some((option) => option.id === folderType.name)) {\n options.push({\n id: folderType.name,\n type: 'string',\n label: folderType.name,\n icon: folderType.icon,\n inverted: false,\n values: [],\n allowsCustomValues: false,\n })\n }\n })\n })\n }\n\n return options\n}\n\nconst getFormattedId = (\n base: string,\n fieldType: FilterFieldType,\n config?: FilterConfig,\n scopePrefix?: string,\n) => {\n const { prefixes, keys } = config || {}\n let result = base\n\n if (keys && fieldType in keys) {\n result = `${keys[fieldType]}`\n } else if (prefixes && fieldType in prefixes) {\n result = `${prefixes[fieldType]}${base}`\n }\n\n // Add scope prefix if provided\n if (scopePrefix) {\n result = `${scopePrefix}_${result}`\n }\n\n return result\n}\n\nconst formatLabel = (baseLabel: string, scopeLabel?: string) =>\n scopeLabel ? `${baseLabel} - ${scopeLabel}` : baseLabel\n\nconst getOptionRoot = (\n fieldType: FilterFieldType,\n config?: FilterConfig,\n scopePrefix?: string,\n scopeLabel?: string,\n) => {\n const getRootIdWithPrefix = (base: string) => getFormattedId(base, fieldType, config, scopePrefix)\n const formatLabelWithScope = (baseLabel: string) => formatLabel(baseLabel, scopeLabel)\n\n let rootOption: Option | null = null\n switch (fieldType) {\n case 'taskType':\n rootOption = {\n id: getRootIdWithPrefix(`taskType`),\n type: 'string',\n label: formatLabelWithScope(`Task Type`),\n icon: getAttributeIcon('task'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: false,\n }\n break\n case 'folderType':\n rootOption = {\n id: getRootIdWithPrefix(`folderType`),\n type: 'string',\n label: formatLabelWithScope(`Folder Type`),\n icon: getAttributeIcon('folder'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: false,\n }\n break\n case 'productType':\n rootOption = {\n id: getRootIdWithPrefix(`productType`),\n type: 'string',\n label: formatLabelWithScope(`Product Type`),\n icon: getAttributeIcon('product'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: false,\n }\n break\n case 'productName':\n rootOption = {\n id: getRootIdWithPrefix(`productNames`),\n type: 'string',\n label: formatLabelWithScope(`Product Name`),\n icon: getAttributeIcon('productName', 'string'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: true,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: false,\n operatorChangeable: true,\n }\n break\n case 'status':\n rootOption = {\n id: getRootIdWithPrefix('status'),\n type: 'string',\n label: formatLabelWithScope('Status'),\n icon: getAttributeIcon('status'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: false,\n }\n break\n case 'assignees':\n rootOption = {\n id: getRootIdWithPrefix('assignees'),\n type: 'list_of_strings',\n label: formatLabelWithScope('Assignee'),\n icon: getAttributeIcon('assignees'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: config?.enableRelativeValues,\n allowNoValue: config?.enableRelativeValues,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: config?.enableOperatorChange,\n }\n break\n case 'author':\n rootOption = {\n id: getRootIdWithPrefix('author'),\n type: 'string',\n label: formatLabelWithScope('Author'),\n icon: getAttributeIcon('author'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: config?.enableRelativeValues,\n allowNoValue: config?.enableRelativeValues,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: config?.enableOperatorChange,\n }\n break\n case 'tags':\n rootOption = {\n id: getRootIdWithPrefix('tags'),\n type: 'list_of_strings',\n label: formatLabelWithScope('Tags'),\n icon: getAttributeIcon('tags'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: true,\n allowHasValue: config?.enableRelativeValues,\n allowNoValue: config?.enableRelativeValues,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: config?.enableOperatorChange,\n }\n break\n case 'version':\n rootOption = {\n id: getRootIdWithPrefix('version'),\n type: 'string',\n label: formatLabelWithScope('Version'),\n icon: getAttributeIcon('version'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: true,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: false,\n operatorChangeable: false,\n }\n break\n case 'name':\n rootOption = {\n id: getRootIdWithPrefix('name'),\n type: 'string',\n label: formatLabelWithScope('Name'),\n icon: 'text_fields',\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: true,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: false,\n operatorChangeable: false,\n }\n break\n case 'hasReviewables':\n rootOption = {\n id: getRootIdWithPrefix('hasReviewables'),\n type: 'boolean',\n label: formatLabelWithScope('Has Reviewables'),\n icon: 'play_circle',\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: false,\n singleSelect: true,\n }\n break\n default:\n break\n\n // Note: attributes are handled separately\n }\n\n return rootOption\n}\n\nconst getAttributeFieldOptionRoot = (\n attribute: AttributeModel,\n config: FilterConfig & { allowsCustomValues: boolean },\n scopePrefix?: string,\n scopeLabel?: string,\n): Option => ({\n id: getFormattedId(attribute.name, 'attributes', config, scopePrefix),\n type: attribute.data.type,\n label: scopeLabel\n ? formatLabel(attribute.data.title || attribute.name, scopeLabel)\n : attribute.data.title || attribute.name,\n operator: 'OR',\n inverted: false,\n values: [],\n allowsCustomValues: config?.allowsCustomValues,\n allowHasValue: config.enableRelativeValues,\n allowNoValue: config.enableRelativeValues,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: config?.enableOperatorChange,\n icon: getAttributeIcon(attribute.name, attribute.data.type, !!attribute.data.enum?.length),\n singleSelect: ['boolean', 'datetime'].includes(attribute.data.type || ''),\n})\n\nconst getAttributeOptions = (\n values?: AttributeDataValue[],\n enums?: AttributeEnumItem[],\n type?: AttributeData['type'],\n): Option[] => {\n const enumOptions: Option[] = []\n const options: (Option & { count: number })[] = []\n\n // add the enum values first\n if (enums) {\n enums.forEach((enumItem) => {\n enumOptions.push({\n id: enumItem.value.toString(),\n type: type,\n label: enumItem.label,\n values: [],\n icon: enumItem.icon,\n color: enumItem.color,\n })\n })\n }\n\n values?.forEach((value) => {\n // no value? do nothing\n if (!value) return\n\n let text = ''\n\n // convert value to text\n switch (typeof value) {\n case 'string':\n case 'number':\n case 'boolean':\n text = value.toString()\n break\n case 'object':\n if (Array.isArray(value)) {\n text = value.join(', ')\n } else {\n text = JSON.stringify(value)\n }\n break\n default:\n break\n }\n\n // create id for text value\n const id = text\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9\\s]/g, '')\n .replace(/\\s+/g, '-')\n\n // check if the option already exists in enums\n const existingOption = enumOptions?.find((enumItem) => enumItem.id === id)\n if (existingOption) return\n\n // check if options already has the value, if so, increment the count\n const existingValue = options.find((option) => option.id === id)\n if (existingValue) {\n existingValue.count++\n return\n } else {\n // add option\n options.push({\n id,\n type: type,\n label: text,\n values: [],\n count: 1,\n })\n }\n })\n\n // sort options based on count\n options.sort((a, b) => b.count - a.count)\n\n // enum options first, then the rest\n return [...enumOptions, ...options]\n}\n\nconst sortOptionsBasedOnColumns = (options: Option[], columnOrder: ColumnOrderState) => {\n const columnOrderWithSubTypes = columnOrder.flatMap((col) => {\n if (col === 'subType') {\n return ['taskType', 'folderType']\n }\n return col\n })\n return [...options].sort((a, b) => {\n const aIndex = columnOrderWithSubTypes.indexOf(a.id.replace('.', '_'))\n const bIndex = columnOrderWithSubTypes.indexOf(b.id.replace('.', '_'))\n\n // If both options are in columnOrder, sort them based on their index in columnOrder\n if (aIndex !== -1 && bIndex !== -1) {\n return aIndex - bIndex\n }\n\n // If only one of the options is in columnOrder, sort the one in columnOrder first\n if (aIndex !== -1) {\n return -1\n }\n if (bIndex !== -1) {\n return 1\n }\n\n // If neither option is in columnOrder, keep their original order\n return 0\n })\n}\n\n/**\n * Splits combined filters by their scope and removes the scope prefix from filter IDs.\n * Used to separate multi-scope filters back into individual scope filters.\n *\n * @param combinedFilter - The filter with potentially scope-prefixed IDs\n * @param scopes - Array of scopes to split by\n * @param config - Filter config containing prefixes for field types\n * @param filterIdToScopeMap - Optional mapping of filter IDs (without scope prefix) to their scopes (e.g., { taskType: 'task', folderType: 'folder' })\n * @returns Object with scope-keyed filters (including 'unscoped' for filters that don't match any scope), with prefixes removed from IDs\n *\n * @example\n * // Input: combinedFilter with IDs like \"version_status\", \"folder_status\", \"taskType\"\n * // With filterIdToScopeMap: { taskType: 'task' }\n * // Output: { version: { conditions: [...] }, folder: { conditions: [...] }, task: { conditions: [...] }, unscoped: { conditions: [] } }\n */\nexport const splitFiltersByScope = (\n combinedFilter: Record<string, any> | null,\n scopes: ScopeType[],\n config?: FilterConfig,\n filterIdToScopeMap?: Record<string, ScopeType>,\n): Record<ScopeType | 'unscoped', Record<string, any>> => {\n // Initialize with all scopes having empty conditions, plus unscoped\n const result: Record<ScopeType | 'unscoped', Record<string, any>> = {\n folder: { conditions: [] },\n product: { conditions: [] },\n task: { conditions: [] },\n user: { conditions: [] },\n version: { conditions: [] },\n unscoped: { conditions: [] },\n }\n\n if (!combinedFilter?.conditions || combinedFilter?.conditions.length === 0) {\n return result\n }\n\n // Helper to extract scope prefix from an ID\n const extractScopeAndRemovePrefix = (\n id: string,\n currentConfig?: FilterConfig,\n ): { scope: ScopeType | null; cleanId: string } => {\n // Check if ID starts with any scope prefix\n const scopeMatch = scopes.find((scope) => id.startsWith(`${scope}_`))\n\n if (scopeMatch) {\n // Remove scope prefix\n const cleanId = id.substring(`${scopeMatch}_`.length)\n return { scope: scopeMatch, cleanId }\n }\n\n // If no scope prefix, return null scope (shouldn't happen in multi-scope scenario)\n return { scope: null, cleanId: id }\n }\n\n // Helper to process a filter recursively\n const processConditions = (\n conditions: any[] | undefined,\n targetFilters: Record<ScopeType | 'unscoped', Record<string, any>>,\n ) => {\n if (!conditions || conditions.length === 0) return\n\n conditions.forEach((condition) => {\n // If this is a nested filter\n if ('conditions' in condition && !('key' in condition)) {\n processConditions(condition.conditions, targetFilters)\n } else if ('key' in condition) {\n // This is a QueryCondition\n const { scope, cleanId } = extractScopeAndRemovePrefix(condition.key, config)\n\n if (scope && targetFilters[scope]) {\n // Add the condition with cleaned ID to the appropriate scope\n targetFilters[scope].conditions?.push({\n ...condition,\n key: cleanId,\n })\n } else if (!scope) {\n // No explicit scope prefix found, check filterIdToScopeMap\n const mappedScope = filterIdToScopeMap?.[condition.key]\n\n if (mappedScope && targetFilters[mappedScope]) {\n // Found in the map, add to mapped scope\n targetFilters[mappedScope].conditions?.push(condition)\n } else if (\n condition.key === SEARCH_FILTER_ID ||\n condition.key === 'name' ||\n condition.key?.endsWith('_name')\n ) {\n // Global search and name filters should be added to all scopes\n scopes.forEach((scopeName) => {\n if (targetFilters[scopeName]) {\n targetFilters[scopeName].conditions?.push(condition)\n }\n })\n } else {\n // Not in map, add to unscoped\n targetFilters['unscoped']?.conditions?.push(condition)\n }\n }\n }\n })\n }\n\n // Process the combined filter\n processConditions(combinedFilter.conditions, result)\n\n return result\n}\n\n/**\n * Splits combined Filter objects by their scope and removes the scope prefix from filter IDs.\n * Used to separate multi-scope Filter arrays back into individual scope Filter arrays.\n * This function works with Filter objects from @ynput/ayon-react-components, not QueryFilter objects.\n *\n * @param filters - Array of Filter objects with potentially scope-prefixed IDs\n * @param scopes - Array of scopes to split by\n * @param filterIdToScopeMap - Optional mapping of filter IDs (without scope prefix) to their scopes (e.g., { taskType: 'task', folderType: 'folder' })\n * @returns Object with scope-keyed Filter arrays (including 'unscoped' for filters that don't match any scope)\n *\n * @example\n * // Input: filters with IDs like \"version_status\", \"folder_status\", \"taskType\"\n * // With filterIdToScopeMap: { taskType: 'task' }\n * // Output: { version: [...], folder: [...], task: [...], product: [...], user: [...], unscoped: [...] }\n */\nexport const splitClientFiltersByScope = (\n filters: (Filter | SliceFilter)[] | null | undefined,\n scopes: ScopeType[],\n filterIdToScopeMap?: Record<string, ScopeType>,\n): Record<ScopeType | 'unscoped', Filter[]> => {\n // Initialize with all scopes having empty arrays, plus unscoped\n const result: Record<ScopeType | 'unscoped', Filter[]> = {\n folder: [],\n product: [],\n task: [],\n user: [],\n version: [],\n unscoped: [],\n }\n\n if (!filters || filters.length === 0) {\n return result\n }\n\n // Helper to extract scope prefix from a filter ID\n const extractScopeFromId = (id: string): ScopeType | null => {\n // Check if ID starts with any scope prefix\n const scopeMatch = scopes.find((scope) => id.startsWith(`${scope}_`))\n return scopeMatch || null\n }\n\n // Helper to remove scope prefix from ID\n const removeScopePrefix = (id: string, scope: ScopeType): string => {\n const prefix = `${scope}_`\n return id.startsWith(prefix) ? id.substring(prefix.length) : id\n }\n\n // Process each filter\n filters.forEach((filter) => {\n if (!filter.id) return\n\n const scope = extractScopeFromId(filter.id)\n\n // If a scope was found, create a new filter without the scope prefix\n if (scope) {\n const cleanedFilter: Filter = {\n ...filter,\n id: removeScopePrefix(filter.id, scope),\n }\n result[scope].push(cleanedFilter)\n } else {\n // No explicit scope prefix found, check filterIdToScopeMap\n const mappedScope = filterIdToScopeMap?.[filter.id]\n\n if (mappedScope) {\n // Found in the map, add to mapped scope\n result[mappedScope].push(filter)\n } else {\n // Not in map, add to unscoped\n result['unscoped'].push(filter)\n }\n }\n })\n\n return result\n}\n"],"names":["useBuildFilterOptions","globalFilterTypes","projectNames","scope","customScopes","data","config","columnOrder","power","options","scopesWithTypes","s","isMultiScope","anyNeedsEntitySubType","type","anyNeedsUsers","fieldInScopes","field","productTypes","useGetEntityGroupsQuery","projectsInfo","useGetProjectsInfoQuery","projectUsers","useGetKanbanProjectUsersQuery","attributes","useGlobalContext","getScopeLabel","currentScope","scopeFilterTypes","scopePrefix","scopeLabel","entitySubTypeOption","getOptionRoot","subTypes","getSubTypes","productNameOption","name","value","statusOption","project","status","assigneesOption","user","a","b","aCount","assignee","authorOption","tagsOption","tagsAnatomy","tag","tagOptionValuesMap","existingTag","tagData","tagOptionValues","versionOption","FEATURED_VERSION_TYPES","versionType","nameOption","hasReviewablesOption","options_list","attributesByScope","attribute","attributesByValues","isEmpty","realData","enums","isListOf","isDate","enableOperatorChange","enableRelativeValues","option","getAttributeFieldOptionRoot","suggestValuesForTypes","optionValues","getAttributeOptions","dateOptions","o","jsx","Icon","sortOptionsBasedOnColumns","icon","label","getEntityTypeIcon","taskType","folderType","getFormattedId","base","fieldType","prefixes","keys","result","formatLabel","baseLabel","getRootIdWithPrefix","formatLabelWithScope","rootOption","getAttributeIcon","values","enumOptions","enumItem","text","id","existingValue","columnOrderWithSubTypes","col","aIndex","bIndex","splitFiltersByScope","combinedFilter","scopes","filterIdToScopeMap","extractScopeAndRemovePrefix","currentConfig","scopeMatch","cleanId","processConditions","conditions","targetFilters","condition","mappedScope","SEARCH_FILTER_ID","scopeName","splitClientFiltersByScope","filters","extractScopeFromId","removeScopePrefix","prefix","filter","cleanedFilter"],"mappings":"6qLAmFO,MAAMA,EAAwB,CAAC,CACpC,YAAaC,EAAoB,CAAA,EACjC,aAAAC,EACA,MAAAC,EACA,OAAQC,EACR,KAAAC,EACA,OAAAC,EACA,YAAAC,EAAc,CAAA,EACd,MAAAC,CACF,IAAoC,CAClC,IAAIC,EAAoB,CAAA,EAIxB,MAAMC,EAA+EN,IAItDD,EAAS,MAAM,QAAQA,CAAK,EAAIA,EAAQ,CAACA,CAAK,EAAK,CAAA,GACpD,IAAKQ,IAAO,CAClC,MAAOA,EACP,YAAaV,CAAA,EACb,EAGFW,EAAeF,EAAgB,OAAS,EAMxCG,EAAwBH,EAAgB,KAAMC,GAClD,CAAC,gBAAiB,QAAQ,EAAE,KAAMG,GAASH,EAAE,YAAY,SAASG,CAAuB,CAAC,CAAA,EAEtFC,EAAgBL,EAAgB,KAAMC,GAC1C,CAAC,YAAa,QAAS,QAAQ,EAAE,KAAMG,GACrCH,EAAE,YAAY,SAASG,CAAuB,CAAA,CAChD,EAGIE,EAAiBC,GACdP,EAAgB,KAAMC,GAAMA,EAAE,YAAY,SA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M,CAAA,EACN,KAAM,CAAA,EACN,QAAS,CAAA,EACT,SAAU,CAAA,CAAC,EAGb,GAAI,CAACiC,GAAWA,EAAQ,SAAW,EACjC,OAAOjC,EAIT,MAAMkC,EAAsBvB,GAEPQ,EAAO,KAAM3G,GAAUmG,EAAG,WAAW,GAAGnG,CAAK,GAAG,CAAC,GAC/C,KAIjB2H,EAAoB,CAACxB,EAAYnG,IAA6B,CAClE,MAAM4H,EAAS,GAAG5H,CAAK,IACvB,OAAOmG,EAAG,WAAWyB,CAAM,EAAIzB,EAAG,UAAUyB,EAAO,MAAM,EAAIzB,CAC/D,EAGA,OAAAsB,EAAQ,QAASI,GAAW,CAC1B,GAAI,CAACA,EAAO,GAAI,OAEhB,MAAM7H,EAAQ0H,EAAmBG,EAAO,EAAE,EAG1C,GAAI7H,EAAO,CACT,MAAM8H,EAAwB,CAC5B,GAAGD,EACH,GAAIF,EAAkBE,EAAO,GAAI7H,CAAK,CAAA,EAExCwF,EAAOxF,CAAK,EAAE,KAAK8H,CAAa,CAClC,KAAO,CAEL,MAAMT,EAAcT,IAAqBiB,EAAO,EAAE,EAE9CR,EAEF7B,EAAO6B,CAAW,EAAE,KAAKQ,CAAM,EAG/BrC,EAAO,SAAY,KAAKqC,CAAM,CAElC,CACF,CAAC,EAEMrC,CACT"}
1
+ {"version":3,"file":"useBuildFilterOptions.cjs.js","sources":["../../../../../src/components/SearchFilter/useBuildFilterOptions.tsx"],"sourcesContent":["import { getAttributeIcon, getEntityTypeIcon } from '@shared/util'\nimport {\n ProductType,\n useGetEntityGroupsQuery,\n useGetKanbanProjectUsersQuery,\n useGetProjectsInfoQuery,\n} from '@shared/api'\nimport type {\n GetProjectsInfoResponse,\n FolderType,\n Status,\n Tag,\n TaskType,\n AttributeModel,\n AttributeEnumItem,\n AttributeData,\n EntityGroup,\n} from '@shared/api'\nimport { ColumnOrderState } from '@tanstack/react-table'\nimport { Icon, Option, Filter, SEARCH_FILTER_ID } from '@ynput/ayon-react-components'\nimport { dateOptions } from './filterDates'\nimport { isEmpty } from 'lodash'\nimport { SliceFilter } from '@shared/containers'\nimport { FEATURED_VERSION_TYPES } from '../FeaturedVersionOrder'\nimport { useGlobalContext } from '@shared/context'\n\ntype ScopeType = 'folder' | 'product' | 'task' | 'user' | 'version'\ntype Scope = ScopeType | ScopeType[]\n\nexport type ScopeWithFilterTypes = {\n scope: ScopeType\n filterTypes: FilterFieldType[]\n}\n\nexport type FilterFieldType =\n | 'folderType'\n | 'taskType'\n | 'productType'\n | ('users' | 'assignees' | 'author')\n | 'attributes'\n | 'status'\n | 'tags'\n | 'version'\n | 'hasReviewables'\n | 'productName'\n | 'name'\ntype AttributeType =\n | string\n | number\n | boolean\n | Date\n | string[]\n | number[]\n | any[]\n | { [key: string]: any }\n\ntype AttributeDataValue = AttributeType | null | undefined\n\ntype FilterConfig = {\n enableExcludes?: boolean\n enableOperatorChange?: boolean\n enableRelativeValues?: boolean\n prefixes?: Partial<Record<FilterFieldType, string>> // strings that will be prepended to the id of the option\n keys?: Partial<Record<FilterFieldType, string>> // replaces the default keys for the filter\n fallbackScope?: ScopeType // used when no scope is provided\n}\n\nexport type BuildFilterOptions = {\n filterTypes?: FilterFieldType[]\n projectNames: string[]\n scope?: Scope\n scopes?: ScopeWithFilterTypes[]\n data: {\n tags?: string[]\n attributes?: Record<string, AttributeDataValue[]>\n assignees?: string[]\n productTypes?: ProductType[]\n productNames?: string[]\n }\n columnOrder?: ColumnOrderState\n config?: FilterConfig\n power?: boolean\n}\n\nexport const useBuildFilterOptions = ({\n filterTypes: globalFilterTypes = [],\n projectNames,\n scope,\n scopes: customScopes,\n data,\n config,\n columnOrder = [],\n power,\n}: BuildFilterOptions): Option[] => {\n let options: Option[] = []\n\n // Determine which scopes to use\n // If customScopes is provided, use it; otherwise, fall back to the old method\n const scopesWithTypes: Array<{ scope: ScopeType; filterTypes: FilterFieldType[] }> = customScopes\n ? customScopes\n : (() => {\n // Fallback to old method: normalize scope to array and use globalFilterTypes for all\n const normalizedScopes = scope ? (Array.isArray(scope) ? scope : [scope]) : []\n return normalizedScopes.map((s) => ({\n scope: s,\n filterTypes: globalFilterTypes,\n }))\n })()\n\n const isMultiScope = scopesWithTypes.length > 1\n\n // QUERIES\n //\n //\n // Check if any scope needs these filter types\n const anyNeedsEntitySubType = scopesWithTypes.some((s) =>\n ['entitySubType', 'status'].some((type) => s.filterTypes.includes(type as FilterFieldType)),\n )\n const anyNeedsUsers = scopesWithTypes.some((s) =>\n ['assignees', 'users', 'author'].some((type) =>\n s.filterTypes.includes(type as FilterFieldType),\n ),\n )\n // find if any search field is in any of the scopesWithTypes\n const fieldInScopes = (field: FilterFieldType): boolean => {\n return scopesWithTypes.some((s) => s.filterTypes.includes(field))\n }\n\n // get grouping options for productTypes\n // NOTE: We should revisit this to be used for all attribs and fields\n const { data: { groups: productTypes = [] } = {} } = useGetEntityGroupsQuery(\n {\n entityType: 'product',\n groupingKey: 'productType',\n projectName: projectNames[0],\n empty: true,\n },\n { skip: !projectNames?.length || !fieldInScopes('productType') },\n )\n\n const { data: projectsInfo = {} } = useGetProjectsInfoQuery(\n {\n projects: projectNames,\n },\n {\n skip: !projectNames?.length || !anyNeedsEntitySubType,\n },\n )\n\n const { data: projectUsers = [] } = useGetKanbanProjectUsersQuery(\n { projects: projectNames },\n {\n skip: !projectNames?.length || !anyNeedsUsers,\n },\n )\n\n const { attributes } = useGlobalContext()\n //\n //\n // QUERIES\n\n // ADD OPTIONS\n\n // Helper to get scope label (capitalize first letter)\n const getScopeLabel = (scope: ScopeType) => scope.charAt(0).toUpperCase() + scope.slice(1)\n\n // Loop through each scope to build options\n scopesWithTypes.forEach(({ scope: currentScope, filterTypes: scopeFilterTypes }) => {\n const scopePrefix = isMultiScope ? currentScope : undefined\n const scopeLabel = isMultiScope ? getScopeLabel(currentScope) : undefined\n\n // TASK TYPE\n // add taskType option\n if (scopeFilterTypes.includes('taskType') && currentScope !== 'user') {\n const entitySubTypeOption = getOptionRoot(\n 'taskType',\n {\n ...config,\n enableOperatorChange: false,\n },\n scopePrefix,\n scopeLabel,\n )\n if (entitySubTypeOption) {\n // get all subTypes for the current scope (entityType)\n let subTypes = getSubTypes({ projectsInfo, productTypes }, 'task')\n\n entitySubTypeOption.values?.push(...subTypes)\n\n options.push(entitySubTypeOption)\n }\n }\n\n // FOLDER TYPE\n // add folderType option\n if (scopeFilterTypes.includes('folderType') && currentScope !== 'user') {\n const entitySubTypeOption = getOptionRoot(\n 'folderType',\n {\n ...config,\n enableOperatorChange: false,\n },\n scopePrefix,\n scopeLabel,\n )\n if (entitySubTypeOption) {\n // get all subTypes for the current scope (entityType)\n let subTypes = getSubTypes({ projectsInfo, productTypes }, 'folder')\n\n entitySubTypeOption.values?.push(...subTypes)\n\n options.push(entitySubTypeOption)\n }\n }\n\n // PRODUCT TYPE\n // add productType option\n if (scopeFilterTypes.includes('productType') && currentScope !== 'user') {\n const entitySubTypeOption = getOptionRoot(\n 'productType',\n {\n ...config,\n enableOperatorChange: false,\n },\n scopePrefix,\n scopeLabel,\n )\n if (entitySubTypeOption) {\n // get all subTypes for the current scope (entityType)\n let subTypes = getSubTypes({ projectsInfo, productTypes }, 'product')\n entitySubTypeOption.values?.push(...subTypes)\n options.push(entitySubTypeOption)\n }\n }\n // PRODUCT NAME\n // add product name option\n if (scopeFilterTypes.includes('productName') && currentScope === 'product') {\n const productNameOption = getOptionRoot('productName', config, scopePrefix, scopeLabel)\n\n if (productNameOption) {\n // Populate with product names from data as suggestions (optional since allowsCustomValues: true)\n data.productNames?.forEach((name) => {\n if (!productNameOption.values?.some((value) => value.id === name)) {\n productNameOption.values?.push({\n id: name,\n label: name,\n })\n }\n })\n\n options.push(productNameOption)\n }\n }\n\n // STATUS\n // add status option\n if (scopeFilterTypes.includes('status')) {\n const statusOption = getOptionRoot(\n 'status',\n { ...config, enableOperatorChange: false },\n scopePrefix,\n scopeLabel,\n )\n\n if (statusOption) {\n Object.values(projectsInfo).forEach((project) => {\n const statuses = project?.statuses || []\n statuses\n .filter((status) => status.scope?.includes(currentScope))\n .forEach((status: Status) => {\n if (!statusOption.values?.some((value) => value.id === status.name)) {\n statusOption.values?.push({\n id: status.name,\n label: status.name,\n icon: status.icon,\n color: status.color,\n })\n }\n })\n })\n\n options.push(statusOption)\n }\n }\n\n // ASSIGNEES\n // add users/assignees option\n if (scopeFilterTypes.includes('assignees')) {\n const assigneesOption = getOptionRoot('assignees', config, scopePrefix, scopeLabel)\n\n if (assigneesOption) {\n // add every user for the projects (skip duplicates)\n projectUsers.forEach((user) => {\n if (!assigneesOption.values?.some((value) => value.id === user.name)) {\n assigneesOption.values?.push({\n id: user.name,\n label: user.attrib.fullName || user.name,\n img: `/api/users/${user.name}/avatar`,\n icon: null,\n })\n }\n })\n\n // sort the assignees based on the number of times they appear in data.assignees\n assigneesOption.values?.sort((a, b) => {\n const aCount = data.assignees?.filter((assignee) => assignee === a.id).length || 0\n const bCount = data.assignees?.filter((assignee) => assignee === b.id).length || 0\n return bCount - aCount\n })\n\n options.push(assigneesOption)\n }\n }\n\n if (scopeFilterTypes.includes('author')) {\n const authorOption = getOptionRoot('author', config, scopePrefix, scopeLabel)\n if (authorOption) {\n // add every user for the projects (skip duplicates)\n projectUsers.forEach((user) => {\n if (!authorOption.values?.some((value) => value.id === user.name)) {\n authorOption.values?.push({\n id: user.name,\n label: user.attrib.fullName || user.name,\n img: `/api/users/${user.name}/avatar`,\n icon: null,\n })\n }\n })\n options.push(authorOption)\n }\n }\n\n // TAGS\n // add tags options\n if (scopeFilterTypes.includes('tags')) {\n const tagsOption = getOptionRoot('tags', config, scopePrefix, scopeLabel)\n\n if (tagsOption) {\n // reduce projectsInfo to get all tags\n const tagsAnatomy = new Map<string, Tag>()\n Object.values(projectsInfo).forEach((project) => {\n if (project?.tags) {\n project.tags.forEach((tag) => {\n if (!tagsAnatomy.has(tag.name)) {\n tagsAnatomy.set(tag.name, tag)\n }\n })\n }\n })\n\n // create options for each tag, finding color if in tagsAnatomy\n const tagOptionValuesMap = new Map<string, Option & { count: number }>()\n data.tags?.forEach((tag) => {\n const existingTag = tagOptionValuesMap.get(tag)\n if (existingTag) {\n // increment count\n existingTag.count++\n return\n } else {\n // create new tag\n const tagData = tagsAnatomy.get(tag)\n\n tagOptionValuesMap.set(tag, {\n id: tag,\n type: 'string',\n label: tag,\n values: [],\n color: tagData?.color || null,\n count: 1,\n })\n }\n })\n\n // convert values map to array and sort based on count\n const tagOptionValues = Array.from(tagOptionValuesMap.values()).sort(\n (a, b) => b.count - a.count,\n )\n\n // add tag options to the tagsOption\n tagsOption.values?.push(...tagOptionValues)\n\n options.push(tagsOption)\n }\n }\n\n // VERSION\n // add version options\n if (scopeFilterTypes.includes('version')) {\n const versionOption = getOptionRoot('version', config, scopePrefix, scopeLabel)\n\n if (versionOption) {\n // add featured version types as options\n FEATURED_VERSION_TYPES.forEach((versionType) => {\n versionOption.values?.push({\n id: versionType.value,\n label: versionType.label,\n icon: versionType.icon,\n })\n })\n\n options.push(versionOption)\n }\n }\n\n // NAME\n // add name filter for custom string input\n if (scopeFilterTypes.includes('name')) {\n const nameOption = getOptionRoot('name', config, scopePrefix, scopeLabel)\n\n if (nameOption) {\n options.push(nameOption)\n }\n }\n\n // HAS REVIEWABLES\n // add hasReviewables option\n if (scopeFilterTypes.includes('hasReviewables')) {\n const hasReviewablesOption = getOptionRoot('hasReviewables', config, scopePrefix, scopeLabel)\n\n if (hasReviewablesOption) {\n const options_list = [\n {\n id: 'true',\n label: 'Yes',\n values: [],\n icon: 'radio_button_checked',\n },\n {\n id: 'false',\n label: 'No',\n values: [],\n icon: 'radio_button_unchecked',\n },\n ]\n hasReviewablesOption.values?.push(...options_list)\n options.push(hasReviewablesOption)\n }\n }\n\n // ATTRIBUTES\n // dynamically add attributes options\n if (scopeFilterTypes.includes('attributes')) {\n const attributesByScope = attributes.filter((attribute) =>\n attribute.scope?.includes(currentScope),\n )\n // if attributesData is provided, filter out attributes that are not in the attributesData\n const attributesByValues = !isEmpty(data.attributes)\n ? attributesByScope.filter(\n (attribute) => data.attributes && data.attributes[attribute.name],\n )\n : attributesByScope\n\n const attributesWithoutDates = config?.enableRelativeValues\n ? attributesByValues\n : attributesByValues.filter((attribute) => attribute.data.type !== 'datetime')\n\n attributesWithoutDates.forEach((attribute) => {\n const realData = data.attributes && data.attributes[attribute.name]\n const enums = attribute.data.enum\n const type = attribute.data.type\n\n const isListOf = [\n 'list_of_strings',\n 'list_of_integers',\n 'list_of_any',\n 'list_of_submodels',\n ].includes(type || '')\n const isDate = type === 'datetime'\n const enableOperatorChange = isListOf ? config?.enableOperatorChange : false\n const enableRelativeValues = isListOf || isDate ? config?.enableRelativeValues : false\n // for the attribute, get the option root\n const option = getAttributeFieldOptionRoot(\n attribute,\n {\n ...config,\n allowsCustomValues: true,\n enableOperatorChange: enableOperatorChange,\n enableRelativeValues: enableRelativeValues,\n },\n scopePrefix,\n scopeLabel,\n )\n\n const suggestValuesForTypes: AttributeData['type'][] = [\n 'string',\n 'integer',\n 'float',\n 'list_of_strings',\n 'list_of_integers',\n ]\n\n const optionValues: Option[] = []\n\n // if the attribute type is in the suggestValuesForTypes, get the options based on real values\n if (suggestValuesForTypes.includes(type)) {\n const options = getAttributeOptions(realData, enums, type)\n optionValues.push(...options)\n }\n\n // if the attribute type is boolean, add yes/no options\n if (type === 'boolean') {\n const options = [\n {\n id: 'true',\n label: 'Yes',\n values: [],\n icon: 'radio_button_checked',\n },\n {\n id: 'false',\n label: 'No',\n values: [],\n icon: 'radio_button_unchecked',\n },\n ]\n optionValues.push(...options)\n }\n\n // if the attribute type is datetime, add datetime options\n\n if (isDate) {\n optionValues.push(\n ...dateOptions.map((o) => ({\n ...o,\n contentAfter: power ? undefined : <Icon icon=\"bolt\" />,\n })),\n )\n }\n\n // add option to the list of options\n option.values?.push(...optionValues)\n\n // add option to the list of options\n options.push(option)\n })\n }\n }) // End of scopes.forEach loop\n\n // order options by columnOrder\n if (columnOrder) {\n return sortOptionsBasedOnColumns(options, columnOrder)\n } else return options\n}\n\n// HELPER FUNCTIONS\n//\n//\n//\n//\nconst getSubTypes = (\n {\n projectsInfo,\n productTypes,\n }: { projectsInfo: GetProjectsInfoResponse; productTypes: EntityGroup[] },\n type: ScopeType,\n): Option[] => {\n const options: Option[] = []\n if (type === 'product') {\n productTypes.forEach(({ icon, label, value }) => {\n options.push({\n id: value,\n type: 'string',\n label: label || value,\n icon: icon || getEntityTypeIcon('product'),\n inverted: false,\n values: [],\n allowsCustomValues: false,\n })\n })\n } else if (type === 'task') {\n Object.values(projectsInfo).forEach((project) => {\n // for each project, get all task types and add them to the options (if they don't already exist)\n const taskTypes = project?.taskTypes || []\n taskTypes.forEach((taskType: TaskType) => {\n if (!options.some((option) => option.id === taskType.name)) {\n options.push({\n id: taskType.name,\n type: 'string',\n label: taskType.name,\n icon: taskType.icon,\n inverted: false,\n values: [],\n allowsCustomValues: false,\n })\n }\n })\n })\n } else if (type === 'folder') {\n Object.values(projectsInfo).forEach((project) => {\n // for each project, get all folder types and add them to the options (if they don't already exist)\n const folderTypes = project?.folderTypes || []\n folderTypes.forEach((folderType: FolderType) => {\n if (!options.some((option) => option.id === folderType.name)) {\n options.push({\n id: folderType.name,\n type: 'string',\n label: folderType.name,\n icon: folderType.icon,\n inverted: false,\n values: [],\n allowsCustomValues: false,\n })\n }\n })\n })\n }\n\n return options\n}\n\nconst getFormattedId = (\n base: string,\n fieldType: FilterFieldType,\n config?: FilterConfig,\n scopePrefix?: string,\n) => {\n const { prefixes, keys } = config || {}\n let result = base\n\n if (keys && fieldType in keys) {\n result = `${keys[fieldType]}`\n } else if (prefixes && fieldType in prefixes) {\n result = `${prefixes[fieldType]}${base}`\n }\n\n // Add scope prefix if provided\n if (scopePrefix) {\n result = `${scopePrefix}_${result}`\n }\n\n return result\n}\n\nconst formatLabel = (baseLabel: string, scopeLabel?: string) =>\n scopeLabel ? `${baseLabel} - ${scopeLabel}` : baseLabel\n\nconst getOptionRoot = (\n fieldType: FilterFieldType,\n config?: FilterConfig,\n scopePrefix?: string,\n scopeLabel?: string,\n) => {\n const getRootIdWithPrefix = (base: string) => getFormattedId(base, fieldType, config, scopePrefix)\n const formatLabelWithScope = (baseLabel: string) => formatLabel(baseLabel, scopeLabel)\n\n let rootOption: Option | null = null\n switch (fieldType) {\n case 'taskType':\n rootOption = {\n id: getRootIdWithPrefix(`taskType`),\n type: 'string',\n label: formatLabelWithScope(`Task Type`),\n icon: getAttributeIcon('task'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: false,\n }\n break\n case 'folderType':\n rootOption = {\n id: getRootIdWithPrefix(`folderType`),\n type: 'string',\n label: formatLabelWithScope(`Folder Type`),\n icon: getAttributeIcon('folder'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: false,\n }\n break\n case 'productType':\n rootOption = {\n id: getRootIdWithPrefix(`productType`),\n type: 'string',\n label: formatLabelWithScope(`Product Type`),\n icon: getAttributeIcon('product'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: false,\n }\n break\n case 'productName':\n rootOption = {\n id: getRootIdWithPrefix(`productNames`),\n type: 'string',\n label: formatLabelWithScope(`Product Name`),\n icon: getAttributeIcon('productName', 'string'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: true,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: false,\n operatorChangeable: true,\n }\n break\n case 'status':\n rootOption = {\n id: getRootIdWithPrefix('status'),\n type: 'string',\n label: formatLabelWithScope('Status'),\n icon: getAttributeIcon('status'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: false,\n }\n break\n case 'assignees':\n rootOption = {\n id: getRootIdWithPrefix('assignees'),\n type: 'list_of_strings',\n label: formatLabelWithScope('Assignee'),\n icon: getAttributeIcon('assignees'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: config?.enableRelativeValues,\n allowNoValue: config?.enableRelativeValues,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: config?.enableOperatorChange,\n }\n break\n case 'author':\n rootOption = {\n id: getRootIdWithPrefix('author'),\n type: 'string',\n label: formatLabelWithScope('Author'),\n icon: getAttributeIcon('author'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: config?.enableRelativeValues,\n allowNoValue: config?.enableRelativeValues,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: config?.enableOperatorChange,\n }\n break\n case 'tags':\n rootOption = {\n id: getRootIdWithPrefix('tags'),\n type: 'list_of_strings',\n label: formatLabelWithScope('Tags'),\n icon: getAttributeIcon('tags'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: true,\n allowHasValue: config?.enableRelativeValues,\n allowNoValue: config?.enableRelativeValues,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: config?.enableOperatorChange,\n }\n break\n case 'version':\n rootOption = {\n id: getRootIdWithPrefix('version'),\n type: 'string',\n label: formatLabelWithScope('Version'),\n icon: getAttributeIcon('version'),\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: true,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: false,\n operatorChangeable: false,\n }\n break\n case 'name':\n rootOption = {\n id: getRootIdWithPrefix('name'),\n type: 'string',\n label: formatLabelWithScope('Name'),\n icon: 'text_fields',\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: true,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: false,\n operatorChangeable: false,\n }\n break\n case 'hasReviewables':\n rootOption = {\n id: getRootIdWithPrefix('hasReviewables'),\n type: 'boolean',\n label: formatLabelWithScope('Has Reviewables'),\n icon: 'play_circle',\n inverted: false,\n operator: 'OR',\n values: [],\n allowsCustomValues: false,\n allowHasValue: false,\n allowNoValue: false,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: false,\n singleSelect: true,\n }\n break\n default:\n break\n\n // Note: attributes are handled separately\n }\n\n return rootOption\n}\n\nconst getAttributeFieldOptionRoot = (\n attribute: AttributeModel,\n config: FilterConfig & { allowsCustomValues: boolean },\n scopePrefix?: string,\n scopeLabel?: string,\n): Option => ({\n id: getFormattedId(attribute.name, 'attributes', config, scopePrefix),\n type: attribute.data.type,\n label: scopeLabel\n ? formatLabel(attribute.data.title || attribute.name, scopeLabel)\n : attribute.data.title || attribute.name,\n operator: 'OR',\n inverted: false,\n values: [],\n allowsCustomValues: config?.allowsCustomValues,\n allowHasValue: config.enableRelativeValues,\n allowNoValue: config.enableRelativeValues,\n allowExcludes: config?.enableExcludes,\n operatorChangeable: config?.enableOperatorChange,\n icon: getAttributeIcon(attribute.name, attribute.data.type, !!attribute.data.enum?.length),\n singleSelect: ['boolean', 'datetime'].includes(attribute.data.type || ''),\n})\n\nconst getAttributeOptions = (\n values?: AttributeDataValue[],\n enums?: AttributeEnumItem[],\n type?: AttributeData['type'],\n): Option[] => {\n const enumOptions: Option[] = []\n const options: (Option & { count: number })[] = []\n\n // add the enum values first\n if (enums) {\n enums.forEach((enumItem) => {\n enumOptions.push({\n id: enumItem.value.toString(),\n type: type,\n label: enumItem.label,\n values: [],\n icon: enumItem.icon,\n color: enumItem.color,\n })\n })\n }\n\n values?.forEach((value) => {\n // no value? do nothing\n if (!value) return\n\n let text = ''\n\n // convert value to text\n switch (typeof value) {\n case 'string':\n case 'number':\n case 'boolean':\n text = value.toString()\n break\n case 'object':\n if (Array.isArray(value)) {\n text = value.join(', ')\n } else {\n text = JSON.stringify(value)\n }\n break\n default:\n break\n }\n\n // create id for text value\n const id = text\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9\\s]/g, '')\n .replace(/\\s+/g, '-')\n\n // check if the option already exists in enums\n const existingOption = enumOptions?.find((enumItem) => enumItem.id === id)\n if (existingOption) return\n\n // check if options already has the value, if so, increment the count\n const existingValue = options.find((option) => option.id === id)\n if (existingValue) {\n existingValue.count++\n return\n } else {\n // add option\n options.push({\n id,\n type: type,\n label: text,\n values: [],\n count: 1,\n })\n }\n })\n\n // sort options based on count\n options.sort((a, b) => b.count - a.count)\n\n // enum options first, then the rest\n return [...enumOptions, ...options]\n}\n\nconst sortOptionsBasedOnColumns = (options: Option[], columnOrder: ColumnOrderState) => {\n const columnOrderWithSubTypes = columnOrder.flatMap((col) => {\n if (col === 'subType') {\n return ['taskType', 'folderType']\n }\n return col\n })\n return [...options].sort((a, b) => {\n const aIndex = columnOrderWithSubTypes.indexOf(a.id.replace('.', '_'))\n const bIndex = columnOrderWithSubTypes.indexOf(b.id.replace('.', '_'))\n\n // If both options are in columnOrder, sort them based on their index in columnOrder\n if (aIndex !== -1 && bIndex !== -1) {\n return aIndex - bIndex\n }\n\n // If only one of the options is in columnOrder, sort the one in columnOrder first\n if (aIndex !== -1) {\n return -1\n }\n if (bIndex !== -1) {\n return 1\n }\n\n // If neither option is in columnOrder, keep their original order\n return 0\n })\n}\n\n/**\n * Splits combined filters by their scope and removes the scope prefix from filter IDs.\n * Used to separate multi-scope filters back into individual scope filters.\n *\n * @param combinedFilter - The filter with potentially scope-prefixed IDs\n * @param scopes - Array of scopes to split by\n * @param config - Filter config containing prefixes for field types\n * @param filterIdToScopeMap - Optional mapping of filter IDs (without scope prefix) to their scopes (e.g., { taskType: 'task', folderType: 'folder' })\n * @returns Object with scope-keyed filters (including 'unscoped' for filters that don't match any scope), with prefixes removed from IDs\n *\n * @example\n * // Input: combinedFilter with IDs like \"version_status\", \"folder_status\", \"taskType\"\n * // With filterIdToScopeMap: { taskType: 'task' }\n * // Output: { version: { conditions: [...] }, folder: { conditions: [...] }, task: { conditions: [...] }, unscoped: { conditions: [] } }\n */\nexport const splitFiltersByScope = (\n combinedFilter: Record<string, any> | null,\n scopes: ScopeType[],\n config?: FilterConfig,\n filterIdToScopeMap?: Record<string, ScopeType>,\n): Record<ScopeType | 'unscoped', Record<string, any>> => {\n // Initialize with all scopes having empty conditions, plus unscoped\n const result: Record<ScopeType | 'unscoped', Record<string, any>> = {\n folder: { conditions: [] },\n product: { conditions: [] },\n task: { conditions: [] },\n user: { conditions: [] },\n version: { conditions: [] },\n unscoped: { conditions: [] },\n }\n\n if (!combinedFilter?.conditions || combinedFilter?.conditions.length === 0) {\n return result\n }\n\n // Helper to extract scope prefix from an ID\n const extractScopeAndRemovePrefix = (\n id: string,\n currentConfig?: FilterConfig,\n ): { scope: ScopeType | null; cleanId: string } => {\n // Check if ID starts with any scope prefix\n const scopeMatch = scopes.find((scope) => id.startsWith(`${scope}_`))\n\n if (scopeMatch) {\n // Remove scope prefix\n const cleanId = id.substring(`${scopeMatch}_`.length)\n return { scope: scopeMatch, cleanId }\n } else if (config?.fallbackScope) {\n // fallback to a default scope if provided in config\n return { scope: config.fallbackScope, cleanId: id }\n }\n\n // If no scope prefix, return null scope (shouldn't happen in multi-scope scenario)\n return { scope: null, cleanId: id }\n }\n\n // Helper to process a filter recursively\n const processConditions = (\n conditions: any[] | undefined,\n targetFilters: Record<ScopeType | 'unscoped', Record<string, any>>,\n ) => {\n if (!conditions || conditions.length === 0) return\n\n conditions.forEach((condition) => {\n // If this is a nested filter\n if ('conditions' in condition && !('key' in condition)) {\n processConditions(condition.conditions, targetFilters)\n } else if ('key' in condition) {\n // This is a QueryCondition\n const { scope, cleanId } = extractScopeAndRemovePrefix(condition.key, config)\n\n if (scope && targetFilters[scope]) {\n // Add the condition with cleaned ID to the appropriate scope\n targetFilters[scope].conditions?.push({\n ...condition,\n key: cleanId,\n })\n } else if (!scope) {\n // No explicit scope prefix found, check filterIdToScopeMap\n const mappedScope = filterIdToScopeMap?.[condition.key]\n\n if (mappedScope && targetFilters[mappedScope]) {\n // Found in the map, add to mapped scope\n targetFilters[mappedScope].conditions?.push(condition)\n } else if (\n condition.key === SEARCH_FILTER_ID ||\n condition.key === 'name' ||\n condition.key?.endsWith('_name')\n ) {\n // Global search and name filters should be added to all scopes\n scopes.forEach((scopeName) => {\n if (targetFilters[scopeName]) {\n targetFilters[scopeName].conditions?.push(condition)\n }\n })\n } else {\n // Not in map, add to unscoped\n targetFilters['unscoped']?.conditions?.push(condition)\n }\n }\n }\n })\n }\n\n // Process the combined filter\n processConditions(combinedFilter.conditions, result)\n\n return result\n}\n\n/**\n * Splits combined Filter objects by their scope and removes the scope prefix from filter IDs.\n * Used to separate multi-scope Filter arrays back into individual scope Filter arrays.\n * This function works with Filter objects from @ynput/ayon-react-components, not QueryFilter objects.\n *\n * @param filters - Array of Filter objects with potentially scope-prefixed IDs\n * @param scopes - Array of scopes to split by\n * @param filterIdToScopeMap - Optional mapping of filter IDs (without scope prefix) to their scopes (e.g., { taskType: 'task', folderType: 'folder' })\n * @returns Object with scope-keyed Filter arrays (including 'unscoped' for filters that don't match any scope)\n *\n * @example\n * // Input: filters with IDs like \"version_status\", \"folder_status\", \"taskType\"\n * // With filterIdToScopeMap: { taskType: 'task' }\n * // Output: { version: [...], folder: [...], task: [...], product: [...], user: [...], unscoped: [...] }\n */\nexport const splitClientFiltersByScope = (\n filters: (Filter | SliceFilter)[] | null | undefined,\n scopes: ScopeType[],\n filterIdToScopeMap?: Record<string, ScopeType>,\n): Record<ScopeType | 'unscoped', Filter[]> => {\n // Initialize with all scopes having empty arrays, plus unscoped\n const result: Record<ScopeType | 'unscoped', Filter[]> = {\n folder: [],\n product: [],\n task: [],\n user: [],\n version: [],\n unscoped: [],\n }\n\n if (!filters || filters.length === 0) {\n return result\n }\n\n // Helper to extract scope prefix from a filter ID\n const extractScopeFromId = (id: string): ScopeType | null => {\n // Check if ID starts with any scope prefix\n const scopeMatch = scopes.find((scope) => id.startsWith(`${scope}_`))\n return scopeMatch || null\n }\n\n // Helper to remove scope prefix from ID\n const removeScopePrefix = (id: string, scope: ScopeType): string => {\n const prefix = `${scope}_`\n return id.startsWith(prefix) ? id.substring(prefix.length) : id\n }\n\n // Process each filter\n filters.forEach((filter) => {\n if (!filter.id) return\n\n const scope = extractScopeFromId(filter.id)\n\n // If a scope was found, create a new filter without the scope prefix\n if (scope) {\n const cleanedFilter: Filter = {\n ...filter,\n id: removeScopePrefix(filter.id, scope),\n }\n result[scope].push(cleanedFilter)\n } else {\n // No explicit scope prefix found, check filterIdToScopeMap\n const mappedScope = filterIdToScopeMap?.[filter.id]\n\n if (mappedScope) {\n // Found in the map, add to mapped scope\n result[mappedScope].push(filter)\n } else {\n // Not in map, add to unscoped\n result['unscoped'].push(filter)\n }\n }\n })\n\n return result\n}\n"],"names":["useBuildFilterOptions","globalFilterTypes","projectNames","scope","customScopes","data","config","columnOrder","power","options","scopesWithTypes","s","isMultiScope","anyNeedsEntitySubType","type","anyNeedsUsers","fieldInScopes","field","productTypes","useGetEntityGroupsQuery","projectsInfo","useGetProjectsInfoQuery","projectUsers","useGetKanbanProjectUsersQuery","attributes","useGlobalContext","getScopeLabel","currentScope","scopeFilterTypes","scopePrefix","scopeLabel","entitySubTypeOption","getOptionRoot","subTypes","getSubTypes","productNameOption","name","value","statusOption","project","status","assigneesOption","user","a","b","aCount","assignee","authorOption","tagsOption","tagsAnatomy","tag","tagOptionValuesMap","existingTag","tagData","tagOptionValues","versionOption","FEATURED_VERSION_TYPES","versionType","nameOption","hasReviewablesOption","options_list","attributesByScope","attribute","attributesByValues","isEmpty","realData","enums","isListOf","isDate","enableOperatorChange","enableRelativeValues","option","getAttributeFieldOptionRoot","suggestValuesForTypes","optionValues","getAttributeOptions","dateOptions","o","jsx","Icon","sortOptionsBasedOnColumns","icon","label","getEntityTypeIcon","taskType","folderType","getFormattedId","base","fieldType","prefixes","keys","result","formatLabel","baseLabel","getRootIdWithPrefix","formatLabelWithScope","rootOption","getAttributeIcon","values","enumOptions","enumItem","text","id","existingValue","columnOrderWithSubTypes","col","aIndex","bIndex","splitFiltersByScope","combinedFilter","scopes","filterIdToScopeMap","extractScopeAndRemovePrefix","currentConfig","scopeMatch","cleanId","processConditions","conditions","targetFilters","condition","mappedScope","SEARCH_FILTER_ID","scopeName","splitClientFiltersByScope","filters","extractScopeFromId","removeScopePrefix","prefix","filter","cleanedFilter"],"mappings":"6qLAoFO,MAAMA,EAAwB,CAAC,CACpC,YAAaC,EAAoB,CAAA,EACjC,aAAAC,EACA,MAAAC,EACA,OAAQC,EACR,KAAAC,EACA,OAAAC,EACA,YAAAC,EAAc,CAAA,EACd,MAAAC,CACF,IAAoC,CAClC,IAAIC,EAAoB,CAAA,EAIxB,MAAMC,EAA+EN,IAItDD,EAAS,MAAM,QAAQA,CAAK,EAAIA,EAAQ,CAACA,CAAK,EAAK,CAAA,GACpD,IAAKQ,IAAO,CAClC,MAAOA,EACP,YAAaV,CAAA,EACb,EAGFW,EAAeF,EAAgB,OAAS,EAMxCG,EAAwBH,EAAgB,KAAMC,GAClD,CAAC,gBAAiB,QAAQ,EAAE,KAAMG,GAASH,EAAE,YAAY,SAASG,CAAuB,CAAC,CAAA,EAEtFC,EAAgBL,EAAgB,KAAMC,GAC1C,CAAC,YAAa,QAAS,QAAQ,EAAE,KAAMG,GACrCH,EAAE,YAAY,SAASG,CAAuB,CAAA,CAChD,EAGIE,EAAiBC,GACdP,EAAgB,KAAMC,GAAMA,EAAE,YAAY,SAASM,CAAK,CAAC,EAK5D,CAAE,KAAM,CAAE,OAAQC,EAAe,EAAC,EAAM,CAAA,CAAC,EAAMC,EAAAA,wBACnD,CACE,WAAY,UACZ,YAAa,cACb,YAAajB,EAAa,CAAC,EAC3B,MAAO,EAAA,EAET,CAAE,KAAM,CAACA,GAAc,QAAU,CAACc,EAAc,aAAa,CAAA,CAAE,EAG3D,CAAE,KAAMI,EAAe,CAAA,GAAOC,EAAAA,wBAClC,CACE,SAAUnB,CAAA,EAEZ,CACE,KAAM,CAACA,GAAc,QAAU,CAACW,CAAA,CAClC,EAGI,CAAE,KAAMS,EAA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G,WAAWyB,CAAM,EAAIzB,EAAG,UAAUyB,EAAO,MAAM,EAAIzB,CAC/D,EAGA,OAAAsB,EAAQ,QAASI,GAAW,CAC1B,GAAI,CAACA,EAAO,GAAI,OAEhB,MAAM7H,EAAQ0H,EAAmBG,EAAO,EAAE,EAG1C,GAAI7H,EAAO,CACT,MAAM8H,EAAwB,CAC5B,GAAGD,EACH,GAAIF,EAAkBE,EAAO,GAAI7H,CAAK,CAAA,EAExCwF,EAAOxF,CAAK,EAAE,KAAK8H,CAAa,CAClC,KAAO,CAEL,MAAMT,EAAcT,IAAqBiB,EAAO,EAAE,EAE9CR,EAEF7B,EAAO6B,CAAW,EAAE,KAAKQ,CAAM,EAG/BrC,EAAO,SAAY,KAAKqC,CAAM,CAElC,CACF,CAAC,EAEMrC,CACT"}
@@ -124,7 +124,7 @@ const it = ({
124
124
  const p = n || (c ? Array.isArray(c) ? c : [c] : []).map((d) => ({
125
125
  scope: d,
126
126
  filterTypes: r
127
- })), h = p.length > 1, T = p.some(
127
+ })), b = p.length > 1, T = p.some(
128
128
  (f) => ["entitySubType", "status"].some((d) => f.filterTypes.includes(d))
129
129
  ), C = p.some(
130
130
  (f) => ["assignees", "users", "author"].some(
@@ -152,7 +152,7 @@ const it = ({
152
152
  }
153
153
  ), { attributes: M } = F(), P = (f) => f.charAt(0).toUpperCase() + f.slice(1);
154
154
  return p.forEach(({ scope: f, filterTypes: d }) => {
155
- const g = h ? f : void 0, w = h ? P(f) : void 0;
155
+ const w = b ? f : void 0, g = b ? P(f) : void 0;
156
156
  if (d.includes("taskType") && f !== "user") {
157
157
  const a = V(
158
158
  "taskType",
@@ -160,8 +160,8 @@ const it = ({
160
160
  ...s,
161
161
  enableOperatorChange: !1
162
162
  },
163
- g,
164
- w
163
+ w,
164
+ g
165
165
  );
166
166
  if (a) {
167
167
  let l = S({ projectsInfo: x, productTypes: N }, "task");
@@ -175,8 +175,8 @@ const it = ({
175
175
  ...s,
176
176
  enableOperatorChange: !1
177
177
  },
178
- g,
179
- w
178
+ w,
179
+ g
180
180
  );
181
181
  if (a) {
182
182
  let l = S({ projectsInfo: x, productTypes: N }, "folder");
@@ -190,8 +190,8 @@ const it = ({
190
190
  ...s,
191
191
  enableOperatorChange: !1
192
192
  },
193
- g,
194
- w
193
+ w,
194
+ g
195
195
  );
196
196
  if (a) {
197
197
  let l = S({ projectsInfo: x, productTypes: N }, "product");
@@ -199,7 +199,7 @@ const it = ({
199
199
  }
200
200
  }
201
201
  if (d.includes("productName") && f === "product") {
202
- const a = V("productName", s, g, w);
202
+ const a = V("productName", s, w, g);
203
203
  a && (o.productNames?.forEach((l) => {
204
204
  a.values?.some((y) => y.id === l) || a.values?.push({
205
205
  id: l,
@@ -211,12 +211,12 @@ const it = ({
211
211
  const a = V(
212
212
  "status",
213
213
  { ...s, enableOperatorChange: !1 },
214
- g,
215
- w
214
+ w,
215
+ g
216
216
  );
217
217
  a && (Object.values(x).forEach((l) => {
218
218
  (l?.statuses || []).filter((m) => m.scope?.includes(f)).forEach((m) => {
219
- a.values?.some((b) => b.id === m.name) || a.values?.push({
219
+ a.values?.some((h) => h.id === m.name) || a.values?.push({
220
220
  id: m.name,
221
221
  label: m.name,
222
222
  icon: m.icon,
@@ -226,7 +226,7 @@ const it = ({
226
226
  }), i.push(a));
227
227
  }
228
228
  if (d.includes("assignees")) {
229
- const a = V("assignees", s, g, w);
229
+ const a = V("assignees", s, w, g);
230
230
  a && (A.forEach((l) => {
231
231
  a.values?.some((y) => y.id === l.name) || a.values?.push({
232
232
  id: l.name,
@@ -240,7 +240,7 @@ const it = ({
240
240
  }), i.push(a));
241
241
  }
242
242
  if (d.includes("author")) {
243
- const a = V("author", s, g, w);
243
+ const a = V("author", s, w, g);
244
244
  a && (A.forEach((l) => {
245
245
  a.values?.some((y) => y.id === l.name) || a.values?.push({
246
246
  id: l.name,
@@ -251,26 +251,26 @@ const it = ({
251
251
  }), i.push(a));
252
252
  }
253
253
  if (d.includes("tags")) {
254
- const a = V("tags", s, g, w);
254
+ const a = V("tags", s, w, g);
255
255
  if (a) {
256
256
  const l = /* @__PURE__ */ new Map();
257
- Object.values(x).forEach((b) => {
258
- b?.tags && b.tags.forEach((v) => {
257
+ Object.values(x).forEach((h) => {
258
+ h?.tags && h.tags.forEach((v) => {
259
259
  l.has(v.name) || l.set(v.name, v);
260
260
  });
261
261
  });
262
262
  const y = /* @__PURE__ */ new Map();
263
- o.tags?.forEach((b) => {
264
- const v = y.get(b);
263
+ o.tags?.forEach((h) => {
264
+ const v = y.get(h);
265
265
  if (v) {
266
266
  v.count++;
267
267
  return;
268
268
  } else {
269
- const E = l.get(b);
270
- y.set(b, {
271
- id: b,
269
+ const E = l.get(h);
270
+ y.set(h, {
271
+ id: h,
272
272
  type: "string",
273
- label: b,
273
+ label: h,
274
274
  values: [],
275
275
  color: E?.color || null,
276
276
  count: 1
@@ -278,13 +278,13 @@ const it = ({
278
278
  }
279
279
  });
280
280
  const m = Array.from(y.values()).sort(
281
- (b, v) => v.count - b.count
281
+ (h, v) => v.count - h.count
282
282
  );
283
283
  a.values?.push(...m), i.push(a);
284
284
  }
285
285
  }
286
286
  if (d.includes("version")) {
287
- const a = V("version", s, g, w);
287
+ const a = V("version", s, w, g);
288
288
  a && (Z.forEach((l) => {
289
289
  a.values?.push({
290
290
  id: l.value,
@@ -294,11 +294,11 @@ const it = ({
294
294
  }), i.push(a));
295
295
  }
296
296
  if (d.includes("name")) {
297
- const a = V("name", s, g, w);
297
+ const a = V("name", s, w, g);
298
298
  a && i.push(a);
299
299
  }
300
300
  if (d.includes("hasReviewables")) {
301
- const a = V("hasReviewables", s, g, w);
301
+ const a = V("hasReviewables", s, w, g);
302
302
  if (a) {
303
303
  const l = [
304
304
  {
@@ -324,7 +324,7 @@ const it = ({
324
324
  (m) => o.attributes && o.attributes[m.name]
325
325
  );
326
326
  (s?.enableRelativeValues ? l : l.filter((m) => m.data.type !== "datetime")).forEach((m) => {
327
- const b = o.attributes && o.attributes[m.name], v = m.data.enum, E = m.data.type, H = [
327
+ const h = o.attributes && o.attributes[m.name], v = m.data.enum, E = m.data.type, H = [
328
328
  "list_of_strings",
329
329
  "list_of_integers",
330
330
  "list_of_any",
@@ -337,8 +337,8 @@ const it = ({
337
337
  enableOperatorChange: D,
338
338
  enableRelativeValues: B
339
339
  },
340
- g,
341
- w
340
+ w,
341
+ g
342
342
  ), G = [
343
343
  "string",
344
344
  "integer",
@@ -347,7 +347,7 @@ const it = ({
347
347
  "list_of_integers"
348
348
  ], R = [];
349
349
  if (G.includes(E)) {
350
- const k = se(b, v, E);
350
+ const k = se(h, v, E);
351
351
  R.push(...k);
352
352
  }
353
353
  if (E === "boolean") {
@@ -642,8 +642,8 @@ const it = ({
642
642
  break;
643
643
  }
644
644
  const u = e.trim().toLowerCase().replace(/[^a-z0-9\s]/g, "").replace(/\s+/g, "-");
645
- if (n?.find((h) => h.id === u)) return;
646
- const p = o.find((h) => h.id === u);
645
+ if (n?.find((b) => b.id === u)) return;
646
+ const p = o.find((b) => b.id === u);
647
647
  if (p) {
648
648
  p.count++;
649
649
  return;
@@ -674,24 +674,25 @@ const it = ({
674
674
  if (!r?.conditions || r?.conditions.length === 0)
675
675
  return o;
676
676
  const s = (u, i) => {
677
- const p = t.find((h) => u.startsWith(`${h}_`));
677
+ const p = t.find((b) => u.startsWith(`${b}_`));
678
678
  if (p) {
679
- const h = u.substring(`${p}_`.length);
680
- return { scope: p, cleanId: h };
681
- }
679
+ const b = u.substring(`${p}_`.length);
680
+ return { scope: p, cleanId: b };
681
+ } else if (c?.fallbackScope)
682
+ return { scope: c.fallbackScope, cleanId: u };
682
683
  return { scope: null, cleanId: u };
683
684
  }, e = (u, i) => {
684
685
  !u || u.length === 0 || u.forEach((p) => {
685
686
  if ("conditions" in p && !("key" in p))
686
687
  e(p.conditions, i);
687
688
  else if ("key" in p) {
688
- const { scope: h, cleanId: T } = s(p.key);
689
- if (h && i[h])
690
- i[h].conditions?.push({
689
+ const { scope: b, cleanId: T } = s(p.key);
690
+ if (b && i[b])
691
+ i[b].conditions?.push({
691
692
  ...p,
692
693
  key: T
693
694
  });
694
- else if (!h) {
695
+ else if (!b) {
695
696
  const C = n?.[p.key];
696
697
  C && i[C] ? i[C].conditions?.push(p) : p.key === q || p.key === "name" || p.key?.endsWith("_name") ? t.forEach((_) => {
697
698
  i[_] && i[_].conditions?.push(p);