@nocobase/plugin-notification-manager 2.2.0-beta.8 → 2.3.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/dist/client/manager/channel/types.d.ts +11 -0
  2. package/dist/client-v2/components/MessageConfigForm.d.ts +1 -1
  3. package/dist/client-v2/components/User/UserAddition.d.ts +6 -2
  4. package/dist/client-v2/components/User/UserSelect.d.ts +9 -3
  5. package/dist/client-v2/index.js +1 -1
  6. package/dist/client-v2/notification-manager.d.ts +7 -2
  7. package/dist/externalVersion.js +10 -10
  8. package/dist/node_modules/uuid/dist/bin/uuid +2 -0
  9. package/dist/node_modules/uuid/dist/commonjs-browser/index.js +104 -0
  10. package/dist/node_modules/uuid/dist/commonjs-browser/max.js +7 -0
  11. package/dist/node_modules/uuid/dist/commonjs-browser/md5.js +200 -0
  12. package/dist/node_modules/uuid/dist/commonjs-browser/native.js +10 -0
  13. package/dist/node_modules/uuid/dist/commonjs-browser/nil.js +7 -0
  14. package/dist/node_modules/uuid/dist/commonjs-browser/parse.js +44 -0
  15. package/dist/node_modules/uuid/dist/commonjs-browser/regex.js +7 -0
  16. package/dist/node_modules/uuid/dist/commonjs-browser/rng.js +23 -0
  17. package/dist/node_modules/uuid/dist/commonjs-browser/sha1.js +82 -0
  18. package/dist/node_modules/uuid/dist/commonjs-browser/stringify.js +38 -0
  19. package/dist/node_modules/uuid/dist/commonjs-browser/v1.js +131 -0
  20. package/dist/node_modules/uuid/dist/commonjs-browser/v1ToV6.js +26 -0
  21. package/dist/node_modules/uuid/dist/commonjs-browser/v3.js +11 -0
  22. package/dist/node_modules/uuid/dist/commonjs-browser/v35.js +63 -0
  23. package/dist/node_modules/uuid/dist/commonjs-browser/v4.js +32 -0
  24. package/dist/node_modules/uuid/dist/commonjs-browser/v5.js +11 -0
  25. package/dist/node_modules/uuid/dist/commonjs-browser/v6.js +42 -0
  26. package/dist/node_modules/uuid/dist/commonjs-browser/v6ToV1.js +26 -0
  27. package/dist/node_modules/uuid/dist/commonjs-browser/v7.js +152 -0
  28. package/dist/node_modules/uuid/dist/commonjs-browser/validate.js +12 -0
  29. package/dist/node_modules/uuid/dist/commonjs-browser/version.js +15 -0
  30. package/dist/node_modules/uuid/dist/esm-browser/index.js +1 -1
  31. package/dist/node_modules/uuid/dist/esm-browser/max.js +1 -1
  32. package/dist/node_modules/uuid/dist/esm-browser/md5.js +172 -113
  33. package/dist/node_modules/uuid/dist/esm-browser/native.js +4 -2
  34. package/dist/node_modules/uuid/dist/esm-browser/nil.js +1 -1
  35. package/dist/node_modules/uuid/dist/esm-browser/parse.js +34 -6
  36. package/dist/node_modules/uuid/dist/esm-browser/regex.js +1 -1
  37. package/dist/node_modules/uuid/dist/esm-browser/rng.js +14 -8
  38. package/dist/node_modules/uuid/dist/esm-browser/sha1.js +68 -62
  39. package/dist/node_modules/uuid/dist/esm-browser/stringify.js +25 -29
  40. package/dist/node_modules/uuid/dist/esm-browser/v1.js +117 -75
  41. package/dist/node_modules/uuid/dist/esm-browser/v1ToV6.js +16 -6
  42. package/dist/node_modules/uuid/dist/esm-browser/v3.js +3 -8
  43. package/dist/node_modules/uuid/dist/esm-browser/v35.js +47 -31
  44. package/dist/node_modules/uuid/dist/esm-browser/v4.js +19 -21
  45. package/dist/node_modules/uuid/dist/esm-browser/v5.js +3 -8
  46. package/dist/node_modules/uuid/dist/esm-browser/v6.js +32 -16
  47. package/dist/node_modules/uuid/dist/esm-browser/v6ToV1.js +15 -5
  48. package/dist/node_modules/uuid/dist/esm-browser/v7.js +139 -58
  49. package/dist/node_modules/uuid/dist/esm-browser/validate.js +2 -2
  50. package/dist/node_modules/uuid/dist/esm-browser/version.js +5 -5
  51. package/dist/node_modules/uuid/dist/{esm → esm-node}/index.js +1 -1
  52. package/dist/node_modules/uuid/dist/esm-node/max.js +1 -0
  53. package/dist/node_modules/uuid/dist/esm-node/md5.js +10 -0
  54. package/dist/node_modules/uuid/dist/esm-node/native.js +4 -0
  55. package/dist/node_modules/uuid/dist/esm-node/nil.js +1 -0
  56. package/dist/node_modules/uuid/dist/esm-node/parse.js +37 -0
  57. package/dist/node_modules/uuid/dist/{esm → esm-node}/regex.js +1 -1
  58. package/dist/node_modules/uuid/dist/esm-node/rng.js +10 -0
  59. package/dist/node_modules/uuid/dist/esm-node/sha1.js +10 -0
  60. package/dist/node_modules/uuid/dist/esm-node/stringify.js +31 -0
  61. package/dist/node_modules/uuid/dist/esm-node/v1.js +125 -0
  62. package/dist/node_modules/uuid/dist/esm-node/v1ToV6.js +20 -0
  63. package/dist/node_modules/uuid/dist/esm-node/v3.js +4 -0
  64. package/dist/node_modules/uuid/dist/esm-node/v35.js +55 -0
  65. package/dist/node_modules/uuid/dist/esm-node/v4.js +25 -0
  66. package/dist/node_modules/uuid/dist/esm-node/v5.js +4 -0
  67. package/dist/node_modules/uuid/dist/esm-node/v6.js +32 -0
  68. package/dist/node_modules/uuid/dist/esm-node/v6ToV1.js +20 -0
  69. package/dist/node_modules/uuid/dist/esm-node/v7.js +146 -0
  70. package/dist/node_modules/uuid/dist/esm-node/validate.js +5 -0
  71. package/dist/node_modules/uuid/dist/esm-node/version.js +8 -0
  72. package/dist/node_modules/uuid/dist/index.js +1 -0
  73. package/dist/node_modules/uuid/dist/max.js +7 -0
  74. package/dist/node_modules/uuid/dist/md5-browser.js +200 -0
  75. package/dist/node_modules/uuid/dist/md5.js +17 -0
  76. package/dist/node_modules/uuid/dist/native-browser.js +10 -0
  77. package/dist/node_modules/uuid/dist/native.js +11 -0
  78. package/dist/node_modules/uuid/dist/nil.js +7 -0
  79. package/dist/node_modules/uuid/dist/parse.js +44 -0
  80. package/dist/node_modules/uuid/dist/regex.js +7 -0
  81. package/dist/node_modules/uuid/dist/rng-browser.js +23 -0
  82. package/dist/node_modules/uuid/dist/rng.js +17 -0
  83. package/dist/node_modules/uuid/dist/sha1-browser.js +82 -0
  84. package/dist/node_modules/uuid/dist/sha1.js +17 -0
  85. package/dist/node_modules/uuid/dist/stringify.js +38 -0
  86. package/dist/node_modules/uuid/dist/uuid-bin.js +75 -0
  87. package/dist/node_modules/uuid/dist/v1.js +131 -0
  88. package/dist/node_modules/uuid/dist/v1ToV6.js +26 -0
  89. package/dist/node_modules/uuid/dist/v3.js +11 -0
  90. package/dist/node_modules/uuid/dist/v35.js +63 -0
  91. package/dist/node_modules/uuid/dist/v4.js +32 -0
  92. package/dist/node_modules/uuid/dist/v5.js +11 -0
  93. package/dist/node_modules/uuid/dist/v6.js +38 -0
  94. package/dist/node_modules/uuid/dist/v6ToV1.js +26 -0
  95. package/dist/node_modules/uuid/dist/v7.js +152 -0
  96. package/dist/node_modules/uuid/dist/validate.js +12 -0
  97. package/dist/node_modules/uuid/dist/version.js +15 -0
  98. package/dist/node_modules/uuid/package.json +1 -1
  99. package/dist/server/utils/parseUserSelectionConfig.d.ts +1 -1
  100. package/dist/server/utils/parseUserSelectionConfig.js +2 -2
  101. package/package.json +2 -2
  102. package/dist/node_modules/uuid/dist/cjs/index.d.ts +0 -15
  103. package/dist/node_modules/uuid/dist/cjs/index.js +0 -1
  104. package/dist/node_modules/uuid/dist/cjs/max.d.ts +0 -2
  105. package/dist/node_modules/uuid/dist/cjs/max.js +0 -3
  106. package/dist/node_modules/uuid/dist/cjs/md5.d.ts +0 -4
  107. package/dist/node_modules/uuid/dist/cjs/md5.js +0 -13
  108. package/dist/node_modules/uuid/dist/cjs/native.d.ts +0 -6
  109. package/dist/node_modules/uuid/dist/cjs/native.js +0 -4
  110. package/dist/node_modules/uuid/dist/cjs/nil.d.ts +0 -2
  111. package/dist/node_modules/uuid/dist/cjs/nil.js +0 -3
  112. package/dist/node_modules/uuid/dist/cjs/package.json +0 -1
  113. package/dist/node_modules/uuid/dist/cjs/parse.d.ts +0 -2
  114. package/dist/node_modules/uuid/dist/cjs/parse.js +0 -11
  115. package/dist/node_modules/uuid/dist/cjs/regex.d.ts +0 -2
  116. package/dist/node_modules/uuid/dist/cjs/regex.js +0 -3
  117. package/dist/node_modules/uuid/dist/cjs/rng.d.ts +0 -1
  118. package/dist/node_modules/uuid/dist/cjs/rng.js +0 -13
  119. package/dist/node_modules/uuid/dist/cjs/sha1.d.ts +0 -4
  120. package/dist/node_modules/uuid/dist/cjs/sha1.js +0 -13
  121. package/dist/node_modules/uuid/dist/cjs/stringify.d.ts +0 -3
  122. package/dist/node_modules/uuid/dist/cjs/stringify.js +0 -39
  123. package/dist/node_modules/uuid/dist/cjs/types.d.ts +0 -21
  124. package/dist/node_modules/uuid/dist/cjs/types.js +0 -2
  125. package/dist/node_modules/uuid/dist/cjs/uuid-bin.d.ts +0 -1
  126. package/dist/node_modules/uuid/dist/cjs/uuid-bin.js +0 -72
  127. package/dist/node_modules/uuid/dist/cjs/v1.d.ts +0 -11
  128. package/dist/node_modules/uuid/dist/cjs/v1.js +0 -87
  129. package/dist/node_modules/uuid/dist/cjs/v1ToV6.d.ts +0 -2
  130. package/dist/node_modules/uuid/dist/cjs/v1ToV6.js +0 -13
  131. package/dist/node_modules/uuid/dist/cjs/v3.d.ts +0 -9
  132. package/dist/node_modules/uuid/dist/cjs/v3.js +0 -14
  133. package/dist/node_modules/uuid/dist/cjs/v35.d.ts +0 -7
  134. package/dist/node_modules/uuid/dist/cjs/v35.js +0 -44
  135. package/dist/node_modules/uuid/dist/cjs/v4.d.ts +0 -4
  136. package/dist/node_modules/uuid/dist/cjs/v4.js +0 -29
  137. package/dist/node_modules/uuid/dist/cjs/v5.d.ts +0 -9
  138. package/dist/node_modules/uuid/dist/cjs/v5.js +0 -14
  139. package/dist/node_modules/uuid/dist/cjs/v6.d.ts +0 -4
  140. package/dist/node_modules/uuid/dist/cjs/v6.js +0 -22
  141. package/dist/node_modules/uuid/dist/cjs/v6ToV1.d.ts +0 -2
  142. package/dist/node_modules/uuid/dist/cjs/v6ToV1.js +0 -13
  143. package/dist/node_modules/uuid/dist/cjs/v7.d.ts +0 -9
  144. package/dist/node_modules/uuid/dist/cjs/v7.js +0 -69
  145. package/dist/node_modules/uuid/dist/cjs/validate.d.ts +0 -2
  146. package/dist/node_modules/uuid/dist/cjs/validate.js +0 -7
  147. package/dist/node_modules/uuid/dist/cjs/version.d.ts +0 -2
  148. package/dist/node_modules/uuid/dist/cjs/version.js +0 -10
  149. package/dist/node_modules/uuid/dist/cjs-browser/index.d.ts +0 -15
  150. package/dist/node_modules/uuid/dist/cjs-browser/index.js +0 -31
  151. package/dist/node_modules/uuid/dist/cjs-browser/max.d.ts +0 -2
  152. package/dist/node_modules/uuid/dist/cjs-browser/max.js +0 -3
  153. package/dist/node_modules/uuid/dist/cjs-browser/md5.d.ts +0 -2
  154. package/dist/node_modules/uuid/dist/cjs-browser/md5.js +0 -137
  155. package/dist/node_modules/uuid/dist/cjs-browser/native.d.ts +0 -4
  156. package/dist/node_modules/uuid/dist/cjs-browser/native.js +0 -4
  157. package/dist/node_modules/uuid/dist/cjs-browser/nil.d.ts +0 -2
  158. package/dist/node_modules/uuid/dist/cjs-browser/nil.js +0 -3
  159. package/dist/node_modules/uuid/dist/cjs-browser/package.json +0 -1
  160. package/dist/node_modules/uuid/dist/cjs-browser/parse.d.ts +0 -2
  161. package/dist/node_modules/uuid/dist/cjs-browser/parse.js +0 -11
  162. package/dist/node_modules/uuid/dist/cjs-browser/regex.d.ts +0 -2
  163. package/dist/node_modules/uuid/dist/cjs-browser/regex.js +0 -3
  164. package/dist/node_modules/uuid/dist/cjs-browser/rng.d.ts +0 -1
  165. package/dist/node_modules/uuid/dist/cjs-browser/rng.js +0 -14
  166. package/dist/node_modules/uuid/dist/cjs-browser/sha1.d.ts +0 -2
  167. package/dist/node_modules/uuid/dist/cjs-browser/sha1.js +0 -72
  168. package/dist/node_modules/uuid/dist/cjs-browser/stringify.d.ts +0 -3
  169. package/dist/node_modules/uuid/dist/cjs-browser/stringify.js +0 -39
  170. package/dist/node_modules/uuid/dist/cjs-browser/types.d.ts +0 -21
  171. package/dist/node_modules/uuid/dist/cjs-browser/types.js +0 -2
  172. package/dist/node_modules/uuid/dist/cjs-browser/uuid-bin.d.ts +0 -1
  173. package/dist/node_modules/uuid/dist/cjs-browser/uuid-bin.js +0 -72
  174. package/dist/node_modules/uuid/dist/cjs-browser/v1.d.ts +0 -11
  175. package/dist/node_modules/uuid/dist/cjs-browser/v1.js +0 -87
  176. package/dist/node_modules/uuid/dist/cjs-browser/v1ToV6.d.ts +0 -2
  177. package/dist/node_modules/uuid/dist/cjs-browser/v1ToV6.js +0 -13
  178. package/dist/node_modules/uuid/dist/cjs-browser/v3.d.ts +0 -9
  179. package/dist/node_modules/uuid/dist/cjs-browser/v3.js +0 -14
  180. package/dist/node_modules/uuid/dist/cjs-browser/v35.d.ts +0 -7
  181. package/dist/node_modules/uuid/dist/cjs-browser/v35.js +0 -44
  182. package/dist/node_modules/uuid/dist/cjs-browser/v4.d.ts +0 -4
  183. package/dist/node_modules/uuid/dist/cjs-browser/v4.js +0 -29
  184. package/dist/node_modules/uuid/dist/cjs-browser/v5.d.ts +0 -9
  185. package/dist/node_modules/uuid/dist/cjs-browser/v5.js +0 -14
  186. package/dist/node_modules/uuid/dist/cjs-browser/v6.d.ts +0 -4
  187. package/dist/node_modules/uuid/dist/cjs-browser/v6.js +0 -22
  188. package/dist/node_modules/uuid/dist/cjs-browser/v6ToV1.d.ts +0 -2
  189. package/dist/node_modules/uuid/dist/cjs-browser/v6ToV1.js +0 -13
  190. package/dist/node_modules/uuid/dist/cjs-browser/v7.d.ts +0 -9
  191. package/dist/node_modules/uuid/dist/cjs-browser/v7.js +0 -69
  192. package/dist/node_modules/uuid/dist/cjs-browser/validate.d.ts +0 -2
  193. package/dist/node_modules/uuid/dist/cjs-browser/validate.js +0 -7
  194. package/dist/node_modules/uuid/dist/cjs-browser/version.d.ts +0 -2
  195. package/dist/node_modules/uuid/dist/cjs-browser/version.js +0 -10
  196. package/dist/node_modules/uuid/dist/esm/bin/uuid +0 -2
  197. package/dist/node_modules/uuid/dist/esm/index.d.ts +0 -15
  198. package/dist/node_modules/uuid/dist/esm/max.d.ts +0 -2
  199. package/dist/node_modules/uuid/dist/esm/max.js +0 -1
  200. package/dist/node_modules/uuid/dist/esm/md5.d.ts +0 -4
  201. package/dist/node_modules/uuid/dist/esm/md5.js +0 -11
  202. package/dist/node_modules/uuid/dist/esm/native.d.ts +0 -6
  203. package/dist/node_modules/uuid/dist/esm/native.js +0 -2
  204. package/dist/node_modules/uuid/dist/esm/nil.d.ts +0 -2
  205. package/dist/node_modules/uuid/dist/esm/nil.js +0 -1
  206. package/dist/node_modules/uuid/dist/esm/parse.d.ts +0 -2
  207. package/dist/node_modules/uuid/dist/esm/parse.js +0 -9
  208. package/dist/node_modules/uuid/dist/esm/regex.d.ts +0 -2
  209. package/dist/node_modules/uuid/dist/esm/rng.d.ts +0 -1
  210. package/dist/node_modules/uuid/dist/esm/rng.js +0 -10
  211. package/dist/node_modules/uuid/dist/esm/sha1.d.ts +0 -4
  212. package/dist/node_modules/uuid/dist/esm/sha1.js +0 -11
  213. package/dist/node_modules/uuid/dist/esm/stringify.d.ts +0 -3
  214. package/dist/node_modules/uuid/dist/esm/stringify.js +0 -35
  215. package/dist/node_modules/uuid/dist/esm/types.d.ts +0 -21
  216. package/dist/node_modules/uuid/dist/esm/types.js +0 -1
  217. package/dist/node_modules/uuid/dist/esm/uuid-bin.d.ts +0 -1
  218. package/dist/node_modules/uuid/dist/esm/uuid-bin.js +0 -70
  219. package/dist/node_modules/uuid/dist/esm/v1.d.ts +0 -11
  220. package/dist/node_modules/uuid/dist/esm/v1.js +0 -83
  221. package/dist/node_modules/uuid/dist/esm/v1ToV6.d.ts +0 -2
  222. package/dist/node_modules/uuid/dist/esm/v1ToV6.js +0 -10
  223. package/dist/node_modules/uuid/dist/esm/v3.d.ts +0 -9
  224. package/dist/node_modules/uuid/dist/esm/v3.js +0 -9
  225. package/dist/node_modules/uuid/dist/esm/v35.d.ts +0 -7
  226. package/dist/node_modules/uuid/dist/esm/v35.js +0 -39
  227. package/dist/node_modules/uuid/dist/esm/v4.d.ts +0 -4
  228. package/dist/node_modules/uuid/dist/esm/v4.js +0 -27
  229. package/dist/node_modules/uuid/dist/esm/v5.d.ts +0 -9
  230. package/dist/node_modules/uuid/dist/esm/v5.js +0 -9
  231. package/dist/node_modules/uuid/dist/esm/v6.d.ts +0 -4
  232. package/dist/node_modules/uuid/dist/esm/v6.js +0 -20
  233. package/dist/node_modules/uuid/dist/esm/v6ToV1.d.ts +0 -2
  234. package/dist/node_modules/uuid/dist/esm/v6ToV1.js +0 -10
  235. package/dist/node_modules/uuid/dist/esm/v7.d.ts +0 -9
  236. package/dist/node_modules/uuid/dist/esm/v7.js +0 -65
  237. package/dist/node_modules/uuid/dist/esm/validate.d.ts +0 -2
  238. package/dist/node_modules/uuid/dist/esm/validate.js +0 -5
  239. package/dist/node_modules/uuid/dist/esm/version.d.ts +0 -2
  240. package/dist/node_modules/uuid/dist/esm/version.js +0 -8
  241. package/dist/node_modules/uuid/dist/esm-browser/index.d.ts +0 -15
  242. package/dist/node_modules/uuid/dist/esm-browser/max.d.ts +0 -2
  243. package/dist/node_modules/uuid/dist/esm-browser/md5.d.ts +0 -2
  244. package/dist/node_modules/uuid/dist/esm-browser/native.d.ts +0 -4
  245. package/dist/node_modules/uuid/dist/esm-browser/nil.d.ts +0 -2
  246. package/dist/node_modules/uuid/dist/esm-browser/parse.d.ts +0 -2
  247. package/dist/node_modules/uuid/dist/esm-browser/regex.d.ts +0 -2
  248. package/dist/node_modules/uuid/dist/esm-browser/rng.d.ts +0 -1
  249. package/dist/node_modules/uuid/dist/esm-browser/sha1.d.ts +0 -2
  250. package/dist/node_modules/uuid/dist/esm-browser/stringify.d.ts +0 -3
  251. package/dist/node_modules/uuid/dist/esm-browser/types.d.ts +0 -21
  252. package/dist/node_modules/uuid/dist/esm-browser/types.js +0 -1
  253. package/dist/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts +0 -1
  254. package/dist/node_modules/uuid/dist/esm-browser/uuid-bin.js +0 -70
  255. package/dist/node_modules/uuid/dist/esm-browser/v1.d.ts +0 -11
  256. package/dist/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts +0 -2
  257. package/dist/node_modules/uuid/dist/esm-browser/v3.d.ts +0 -9
  258. package/dist/node_modules/uuid/dist/esm-browser/v35.d.ts +0 -7
  259. package/dist/node_modules/uuid/dist/esm-browser/v4.d.ts +0 -4
  260. package/dist/node_modules/uuid/dist/esm-browser/v5.d.ts +0 -9
  261. package/dist/node_modules/uuid/dist/esm-browser/v6.d.ts +0 -4
  262. package/dist/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts +0 -2
  263. package/dist/node_modules/uuid/dist/esm-browser/v7.d.ts +0 -9
  264. package/dist/node_modules/uuid/dist/esm-browser/validate.d.ts +0 -2
  265. package/dist/node_modules/uuid/dist/esm-browser/version.d.ts +0 -2
@@ -8,6 +8,9 @@
8
8
  */
9
9
  import { Registry } from '@nocobase/utils/client';
10
10
  import { ComponentType } from 'react';
11
+ type LoaderOf<P = Record<string, never>> = () => Promise<{
12
+ default: ComponentType<P>;
13
+ }>;
11
14
  export type RegisterChannelOptions = {
12
15
  title: string;
13
16
  type: string;
@@ -19,6 +22,13 @@ export type RegisterChannelOptions = {
19
22
  ContentConfigForm?: ComponentType<{
20
23
  variableOptions?: any;
21
24
  }>;
25
+ ChannelConfigFormLoader?: LoaderOf;
26
+ MessageConfigFormLoader?: LoaderOf<{
27
+ variableOptions: any;
28
+ }>;
29
+ ContentConfigFormLoader?: LoaderOf<{
30
+ variableOptions?: any;
31
+ }>;
22
32
  };
23
33
  meta?: {
24
34
  creatable?: boolean;
@@ -28,3 +38,4 @@ export type RegisterChannelOptions = {
28
38
  };
29
39
  export type ChannelTypes = Registry<RegisterChannelOptions>;
30
40
  export type NotificationType = 'mail' | 'SMS' | 'in-app';
41
+ export {};
@@ -8,5 +8,5 @@
8
8
  */
9
9
  import React from 'react';
10
10
  import type { MessageConfigFormProps } from '../notification-manager';
11
- export declare function MessageConfigForm({ variableOptions }: MessageConfigFormProps): React.JSX.Element;
11
+ export declare function MessageConfigForm({ variableOptions, namePrefix }: MessageConfigFormProps): React.JSX.Element;
12
12
  export default MessageConfigForm;
@@ -8,8 +8,12 @@
8
8
  */
9
9
  import React from 'react';
10
10
  export type UserAdditionProps = {
11
- value?: any[];
12
- onChange?: (next: any[]) => void;
11
+ value?: Array<number | string | {
12
+ filter?: Record<string, unknown>;
13
+ }>;
14
+ onChange?: (next: Array<number | string | {
15
+ filter?: Record<string, unknown>;
16
+ }>) => void;
13
17
  disabled?: boolean;
14
18
  };
15
19
  export declare function UserAddition(props: UserAdditionProps): React.JSX.Element;
@@ -6,11 +6,17 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import { type MetaTreeNode } from '@nocobase/flow-engine';
9
10
  import React from 'react';
11
+ type ReceiverScalarValue = number | string;
12
+ type ReceiverQueryValue = {
13
+ filter?: Record<string, unknown>;
14
+ };
15
+ type ReceiverValue = ReceiverScalarValue | ReceiverQueryValue;
10
16
  export type UserSelectProps = {
11
- value?: any;
12
- onChange?: (next: any) => void;
13
- variableOptions?: any;
17
+ value?: ReceiverValue | null;
18
+ onChange?: (next: ReceiverValue) => void;
19
+ variableOptions?: MetaTreeNode[];
14
20
  };
15
21
  export declare function UserSelect(props: UserSelectProps): React.JSX.Element;
16
22
  export default UserSelect;
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("ahooks"),require("react-i18next"),require("@nocobase/client-v2"),require("dayjs"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-notification-manager/client-v2",["ahooks","react-i18next","@nocobase/client-v2","dayjs","react","antd","@ant-design/icons","@nocobase/flow-engine","@nocobase/utils/client","lodash"],n):"object"==typeof exports?exports["@nocobase/plugin-notification-manager/client-v2"]=n(require("ahooks"),require("react-i18next"),require("@nocobase/client-v2"),require("dayjs"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-notification-manager/client-v2"]=n(e.ahooks,e["react-i18next"],e["@nocobase/client-v2"],e.dayjs,e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,n,t,r,o,i,a,u,c,l){return function(){"use strict";var s,f,p,b={667:function(e,n,t){t.d(n,{$:function(){return d}});var r=t(485),o=t(807);function i(e,n,t,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){t(e);return}u.done?n(c):Promise.resolve(c).then(r,o)}function a(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var a=e.apply(n,t);function u(e){i(a,r,o,u,c,"next",e)}function c(e){i(a,r,o,u,c,"throw",e)}u(void 0)})}}function u(e,n,t){return(u=f()?Reflect.construct:function(e,n,t){var r=[null];r.push.apply(r,n);var o=new(Function.bind.apply(e,r));return t&&l(o,t.prototype),o}).apply(null,arguments)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,n){return(l=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function s(e){var n="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return u(e,arguments,c(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),l(t,e)})(e)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function p(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(t)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var b="notification-manager",d=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,n,t,o,i;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return n=r,t=arguments,n=c(n),e=function(e,n){var t;if(n&&("object"==((t=n)&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)||"function"==typeof n))return n;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(n,t||[],c(this).constructor):n.apply(this,t)),i=void 0,(o="manager")in e?Object.defineProperty(e,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[o]=i,e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&l(r,e),n=[{key:"channelTypes",get:function(){return this.manager.channelTypes}},{key:"registerChannelType",value:function(e){this.manager.registerChannelType(e)}},{key:"beforeLoad",value:function(){return a(function(){return p(this,function(e){return this.manager=new o.A,[2]})}).call(this)}},{key:"load",value:function(){return a(function(){return p(this,function(e){return this.pluginSettingsManager.addMenuItem({key:b,title:this.t("Notification manager"),icon:"NotificationOutlined",aclSnippet:"pm.notification"}),this.pluginSettingsManager.addPageTabItem({menuKey:b,key:"channels",title:this.t("Channels"),aclSnippet:"pm.notification.channels",sort:1,componentLoader:function(){return t.e("49").then(t.bind(t,624))}}),this.pluginSettingsManager.addPageTabItem({menuKey:b,key:"logs",title:this.t("Logs"),aclSnippet:"pm.notification.logs",sort:3,componentLoader:function(){return t.e("852").then(t.bind(t,487))}}),[2]})}).call(this)}}],function(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,n),r}(s(r.Plugin));n.A=d},488:function(e,n,t){t.d(n,{kj:function(){return c},yr:function(){return u}});var r=t(694),o=t(953),i="notification-manager",a="@nocobase/plugin-notification-manager";function u(){return(0,o.useTranslation)([i,a,"client","data-source-manager"],{nsMode:"fallback"})}function c(){var e=(0,r.useFlowEngine)();return function(n,t){return e.context.t(n,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({ns:[i,a,"client"],nsMode:"fallback"},t))}}},807:function(e,n,t){t.d(n,{A:function(){return o}});var r=t(768),o=function(){var e;function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");e="channelTypes",t=new r.Registry,e in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t}return e=[{key:"registerChannelType",value:function(e){this.channelTypes.register(e.type,e)}}],function(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,e),n}()},553:function(e,n,t){t.d(n,{L:function(){return o}});var r,o=((r={}).templates="templates",r.channels="notificationChannels",r.messages="messages",r.logs="notificationSendLogs",r)},375:function(e){e.exports=a},485:function(e){e.exports=t},694:function(e){e.exports=u},768:function(e){e.exports=c},625:function(n){n.exports=e},59:function(e){e.exports=i},185:function(e){e.exports=r},773:function(e){e.exports=l},155:function(e){e.exports=o},953:function(e){e.exports=n}},d={};function y(e){var n=d[e];if(void 0!==n)return n.exports;var t=d[e]={exports:{}};return b[e](t,t.exports,y),t.exports}y.m=b,y.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(n,{a:n}),n},y.d=function(e,n){for(var t in n)y.o(n,t)&&!y.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},y.f={},y.e=function(e){return Promise.all(Object.keys(y.f).reduce(function(n,t){return y.f[t](e,n),n},[]))},y.u=function(e){return""+e+"."+({49:"3feca41b2843a6b2",852:"543c355801fd322f"})[e]+".js"},y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},h={},y.l=function(e,n,t,r){if(h[e])return void h[e].push(n);if(void 0!==t)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-notification-manager/client-v2:"+t){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,y.nc&&o.setAttribute("nonce",y.nc),o.setAttribute("data-rspack","@nocobase/plugin-notification-manager/client-v2:"+t),o.src=e),h[e]=[n];var l=function(n,t){o.onerror=o.onload=null,clearTimeout(s);var r=h[e];if(delete h[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(t)}),n)return n(t)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},y.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.g.importScripts&&(v=y.g.location+"");var h,v,m=y.g.document;if(!v&&m&&(m.currentScript&&"SCRIPT"===m.currentScript.tagName.toUpperCase()&&(v=m.currentScript.src),!v)){var g=m.getElementsByTagName("script");if(g.length)for(var w=g.length-1;w>-1&&(!v||!/^http(s?):/.test(v));)v=g[w--].src}if(!v)throw Error("Automatic publicPath is not supported in this browser");y.p=v.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s={889:0},y.f.j=function(e,n){var t=y.o(s,e)?s[e]:void 0;if(0!==t)if(t)n.push(t[2]);else{var r=new Promise(function(n,r){t=s[e]=[n,r]});n.push(t[2]=r);var o=y.p+y.u(e),i=Error();y.l(o,function(n){if(y.o(s,e)&&(0!==(t=s[e])&&(s[e]=void 0),t)){var r=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,t[1](i)}},"chunk-"+e,e)}},f=function(e,n){var t,r,o=n[0],i=n[1],a=n[2],u=0;if(o.some(function(e){return 0!==s[e]})){for(t in i)y.o(i,t)&&(y.m[t]=i[t]);a&&a(y)}for(e&&e(n);u<o.length;u++)r=o[u],y.o(s,r)&&s[r]&&s[r][0](),s[r]=0},(p=self.webpackChunk_nocobase_plugin_notification_manager_client_v2=self.webpackChunk_nocobase_plugin_notification_manager_client_v2||[]).forEach(f.bind(null,0)),p.push=f.bind(null,p.push.bind(p));var O={};return!function(){var e="",n="u">typeof document?document.currentScript:null;if(n&&n.src){var t=n.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");t.indexOf("/static/plugins/@nocobase/plugin-notification-manager/dist/client-v2/")>=0&&(e=t.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-notification-manager/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-notification-manager/dist/client-v2/"}y.p=e}(),!function(){y.r(O),y.d(O,{UserAddition:function(){return S},PluginNotificationManagerClientV2:function(){return e.$},UserSelect:function(){return v},ContentConfigForm:function(){return d},MessageConfigForm:function(){return b},NotificationManager:function(){return n.A},default:function(){return e.A}});var e=y(667),n=y(807),t=y(485),r=y(694),o=y(625),i=y(59),a=y(155),u=y.n(a),c=y(553),l=y(488);function s(e,n,t,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){t(e);return}u.done?n(c):Promise.resolve(c).then(r,o)}function f(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){s(i,r,o,a,u,"next",e)}function u(e){s(i,r,o,a,u,"throw",e)}a(void 0)})}}function p(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(t)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function b(n){var s=n.variableOptions,b=(0,l.yr)().t,d=(0,l.kj)(),y=(0,r.useFlowContext)(),h=y.app.pm.get(e.A),v=i.Form.useWatch("channelName"),m=(0,o.useRequest)(function(){return f(function(){var e,n,t;return p(this,function(r){switch(r.label){case 0:if(!v)return[2,null];return[4,y.api.request({url:"/".concat(c.L.channels,":get"),method:"get",params:{filterByTk:v}})];case 1:return[2,null!=(e=null==(t=r.sent())||null==(n=t.data)?void 0:n.data)?e:null]}})})()},{refreshDeps:[v],ready:!!v}).data,g=null==m?void 0:m.notificationType,w=(0,a.useMemo)(function(){var e,n;return g?null==h||null==(n=h.channelTypes.get(g))||null==(e=n.components)?void 0:e.MessageConfigFormLoader:void 0},[h,g]),O=(0,a.useMemo)(function(){return w?(0,a.lazy)(w):null},[w]);return u().createElement(u().Fragment,null,u().createElement(i.Form.Item,{name:"channelName",label:b("Channel"),rules:[{required:!0,message:b("The field value is required")}]},u().createElement(t.RemoteSelect,{request:function(){return f(function(){var e,n,t;return p(this,function(r){switch(r.label){case 0:return[4,y.api.resource(c.L.channels).list()];case 1:return[2,Array.isArray(t=null==(n=r.sent())||null==(e=n.data)?void 0:e.data)?t:[]]}})})()},cacheKey:"@nocobase/plugin-notification-manager:".concat(c.L.channels,":list"),mapOptions:function(e){return{label:d(e.title||e.name),value:e.name}}})),O?u().createElement(a.Suspense,{fallback:u().createElement(i.Spin,null)},u().createElement(O,{variableOptions:s})):null)}function d(n){var t=n.variableOptions,o=n.channelType,c=(0,r.useFlowContext)().app.pm.get(e.A),l=(0,a.useMemo)(function(){var e,n;return o?null==c||null==(n=c.channelTypes.get(o))||null==(e=n.components)?void 0:e.ContentConfigFormLoader:void 0},[c,o]),s=(0,a.useMemo)(function(){return l?(0,a.lazy)(l):null},[l]);return s?u().createElement(a.Suspense,{fallback:u().createElement(i.Spin,null)},u().createElement(s,{variableOptions:t})):null}function h(e,n,t,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){t(e);return}u.done?n(c):Promise.resolve(c).then(r,o)}function v(e){var n=e.value,o=e.onChange,i=(0,r.useFlowContext)();return u().createElement(t.RemoteSelect,{value:n,onChange:o,request:function(){var e;return(e=function(){var e,t,r;return function(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(t)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:return[4,i.api.resource("users").list(function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r;r=t[n],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r})}return e}({},null!=n&&(void 0===n?"undefined":n&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)!="object"?{filter:{id:n}}:{}))];case 1:return[2,Array.isArray(r=null==(t=o.sent())||null==(e=t.data)?void 0:e.data)?r:[]]}})},function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){h(i,r,o,a,u,"next",e)}function u(e){h(i,r,o,a,u,"throw",e)}a(void 0)})})()},mapOptions:function(e){return{label:e.nickname||String(e.id),value:e.id}}})}var m=y(375);function g(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function w(e,n){if(e){if("string"==typeof e)return g(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,n)}}function S(e){var n,t=e.value,r=void 0===t?[]:t,o=e.onChange,c=e.disabled,s=(0,l.yr)().t,f=function(e){if(Array.isArray(e))return e}(n=(0,a.useState)(!1))||function(e){var n,t,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(e){a=!0,t=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw t}}return o}}(n)||w(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=f[0],b=f[1],d=(0,a.useCallback)(function(e){null==o||o(((function(e){if(Array.isArray(e))return g(e)})(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||w(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e])),b(!1)},[o,r]),y=u().createElement(i.Button,{icon:u().createElement(m.PlusOutlined,null),type:"dashed",block:!0,disabled:c},s("Add user"));return c?y:u().createElement(i.Popover,{open:p,onOpenChange:b,content:u().createElement(i.Space,{direction:"vertical",size:"small"},u().createElement(i.Button,{type:"text",onClick:function(){return d("")}},s("Select users")),u().createElement(i.Button,{type:"text",onClick:function(){return d({filter:{}})}},s("Query users")))},y)}}(),O}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("react-i18next"),require("@nocobase/client-v2"),require("dayjs"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-notification-manager/client-v2",["ahooks","react-i18next","@nocobase/client-v2","dayjs","react","antd","@nocobase/plugin-workflow/client-v2","@ant-design/icons","@nocobase/flow-engine","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-notification-manager/client-v2"]=t(require("ahooks"),require("react-i18next"),require("@nocobase/client-v2"),require("dayjs"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-notification-manager/client-v2"]=t(e.ahooks,e["react-i18next"],e["@nocobase/client-v2"],e.dayjs,e.react,e.antd,e["@nocobase/plugin-workflow/client-v2"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,n,r,o,a,i,l,u,c,s){return function(){"use strict";var f,p,y,b={667:function(e,t,n){n.d(t,{$:function(){return b}});var r=n(485),o=n(807);function a(e,t,n,r,o,a,i){try{var l=e[a](i),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){a(i,r,o,l,u,"next",e)}function u(e){a(i,r,o,l,u,"throw",e)}l(void 0)})}}function l(e,t,n){return(l=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&c(o,n.prototype),o}).apply(null,arguments)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return l(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)})(e)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function p(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:u(0)}),l(i,"throw",{value:u(1)}),l(i,"return",{value:u(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var y="notification-manager",b=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n,o,a;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=u(t),e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(t,n||[],u(this).constructor):t.apply(this,n)),a=void 0,(o="manager")in e?Object.defineProperty(e,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[o]=a,e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&c(r,e),t=[{key:"channelTypes",get:function(){return this.manager.channelTypes}},{key:"registerChannelType",value:function(e){this.manager.registerChannelType(e)}},{key:"beforeLoad",value:function(){return i(function(){return p(this,function(e){return this.manager=new o.A,[2]})}).call(this)}},{key:"load",value:function(){return i(function(){return p(this,function(e){return this.pluginSettingsManager.addMenuItem({key:y,title:this.t("Notification manager"),icon:"NotificationOutlined",aclSnippet:"pm.notification"}),this.pluginSettingsManager.addPageTabItem({menuKey:y,key:"channels",title:this.t("Channels"),aclSnippet:"pm.notification.channels",sort:1,componentLoader:function(){return n.e("49").then(n.bind(n,624))}}),this.pluginSettingsManager.addPageTabItem({menuKey:y,key:"logs",title:this.t("Logs"),aclSnippet:"pm.notification.logs",sort:3,componentLoader:function(){return n.e("852").then(n.bind(n,487))}}),[2]})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}(s(r.Plugin));t.A=b},488:function(e,t,n){n.d(t,{kj:function(){return u},yr:function(){return l}});var r=n(694),o=n(953),a="notification-manager",i="@nocobase/plugin-notification-manager";function l(){return(0,o.useTranslation)([a,i,"client","data-source-manager"],{nsMode:"fallback"})}function u(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ns:[a,i,"client"],nsMode:"fallback"},n))}}},807:function(e,t,n){n.d(t,{A:function(){return o}});var r=n(768),o=function(){var e;function t(){var e,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");e="channelTypes",n=new r.Registry,e in this?Object.defineProperty(this,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[e]=n}return e=[{key:"registerChannelType",value:function(e){this.channelTypes.register(e.type,e)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}()},553:function(e,t,n){n.d(t,{L:function(){return o}});var r,o=((r={}).templates="templates",r.channels="notificationChannels",r.messages="messages",r.logs="notificationSendLogs",r)},375:function(e){e.exports=l},485:function(e){e.exports=n},694:function(e){e.exports=u},197:function(e){e.exports=i},768:function(e){e.exports=c},625:function(t){t.exports=e},59:function(e){e.exports=a},185:function(e){e.exports=r},773:function(e){e.exports=s},155:function(e){e.exports=o},953:function(e){e.exports=t}},d={};function m(e){var t=d[e];if(void 0!==t)return t.exports;var n=d[e]={exports:{}};return b[e](n,n.exports,m),n.exports}m.m=b,m.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return m.d(t,{a:t}),t},m.d=function(e,t){for(var n in t)m.o(t,n)&&!m.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},m.f={},m.e=function(e){return Promise.all(Object.keys(m.f).reduce(function(t,n){return m.f[n](e,t),t},[]))},m.u=function(e){return""+e+"."+({49:"3feca41b2843a6b2",852:"543c355801fd322f"})[e]+".js"},m.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),m.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},v={},m.l=function(e,t,n,r){if(v[e])return void v[e].push(t);if(void 0!==n)for(var o,a,i=document.getElementsByTagName("script"),l=0;l<i.length;l++){var u=i[l];if(u.getAttribute("src")==e||u.getAttribute("data-rspack")=="@nocobase/plugin-notification-manager/client-v2:"+n){o=u;break}}o||(a=!0,(o=document.createElement("script")).timeout=120,m.nc&&o.setAttribute("nonce",m.nc),o.setAttribute("data-rspack","@nocobase/plugin-notification-manager/client-v2:"+n),o.src=e),v[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=v[e];if(delete v[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),a&&document.head.appendChild(o)},m.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},m.g.importScripts&&(h=m.g.location+"");var v,h,g=m.g.document;if(!h&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(h=g.currentScript.src),!h)){var w=g.getElementsByTagName("script");if(w.length)for(var O=w.length-1;O>-1&&(!h||!/^http(s?):/.test(h));)h=w[O--].src}if(!h)throw Error("Automatic publicPath is not supported in this browser");m.p=h.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},m.f.j=function(e,t){var n=m.o(f,e)?f[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=m.p+m.u(e),a=Error();m.l(o,function(t){if(m.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+e,e)}},p=function(e,t){var n,r,o=t[0],a=t[1],i=t[2],l=0;if(o.some(function(e){return 0!==f[e]})){for(n in a)m.o(a,n)&&(m.m[n]=a[n]);i&&i(m)}for(e&&e(t);l<o.length;l++)r=o[l],m.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(y=self.webpackChunk_nocobase_plugin_notification_manager_client_v2=self.webpackChunk_nocobase_plugin_notification_manager_client_v2||[]).forEach(p.bind(null,0)),y.push=p.bind(null,y.push.bind(y));var S={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-notification-manager/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-notification-manager/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",a="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",l=i.indexOf(a);e=l>=0?i.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-notification-manager/dist/client-v2/"}m.p=e}(),!function(){m.r(S),m.d(S,{UserAddition:function(){return B},PluginNotificationManagerClientV2:function(){return e.$},UserSelect:function(){return N},ContentConfigForm:function(){return w},MessageConfigForm:function(){return g},NotificationManager:function(){return t.A},default:function(){return e.A}});var e=m(667),t=m(807),n=m(485),r=m(694),o=m(625),a=m(59),i=m(155),l=m.n(i),u=m(553),c=m(488);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t,n,r,o,a,i){try{var l=e[a](i),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){f(a,r,o,i,l,"next",e)}function l(e){f(a,r,o,i,l,"throw",e)}i(void 0)})}}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){y(e,t,n[t])})}return e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}}(e,t)||v(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}function h(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:u(0)}),l(i,"throw",{value:u(1)}),l(i,"return",{value:u(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function g(t){var f,m,g=t.variableOptions,w=t.namePrefix,O=(0,c.yr)().t,S=(0,c.kj)(),j=(0,r.useFlowContext)(),k=null!=(f=j.app.pm.get(e.A))?f:j.app.pm.get("notification-manager"),x=a.Form.useFormInstance(),P=d((0,i.useState)({}),2),E=P[0],T=P[1],C=d((0,i.useState)(!1),2),A=C[0],_=C[1],M=(0,i.useMemo)(function(){var e;return((function(e){if(Array.isArray(e))return s(e)})(e=null!=w?w:[])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(["channelName"])},[w]),q=function(e){return"string"==typeof e?e:e&&(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"&&"string"==typeof e.value?e.value:void 0}(a.Form.useWatch(M,x)),I=q?E[q]:void 0;(0,o.useRequest)(function(){return p(function(){var e,t,n;return h(this,function(r){switch(r.label){case 0:if(!q||I)return[2,null];return[4,j.api.request({url:"/".concat(u.L.channels,":get"),method:"get",params:{filterByTk:q}})];case 1:return[2,null!=(e=null==(n=r.sent())||null==(t=n.data)?void 0:t.data)?e:null]}})})()},{refreshDeps:[q,I],ready:!!(q&&A&&!I),onSuccess:function(e){q&&(null==e?void 0:e.notificationType)&&T(function(t){var n,r;return t[q]===e.notificationType?t:(n=b({},t),r=null!=(r=y({},q,e.notificationType))?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n)})}});var F=(0,i.useMemo)(function(){return I?null==k?void 0:k.channelTypes.get(I):void 0},[I,k]),$=null==F||null==(m=F.components)?void 0:m.MessageConfigFormLoader,L=(0,i.useMemo)(function(){return $?(0,i.lazy)($):null},[$]);return l().createElement(l().Fragment,null,l().createElement(a.Form.Item,{name:M,label:O("Channel"),rules:[{required:!0,message:O("The field value is required")}]},l().createElement(n.RemoteSelect,{request:function(){return p(function(){var e,t,n;return h(this,function(r){switch(r.label){case 0:return[4,j.api.resource(u.L.channels).list()];case 1:return[2,Array.isArray(n=null==(t=r.sent())||null==(e=t.data)?void 0:e.data)?n:[]]}})})()},cacheKey:"@nocobase/plugin-notification-manager:".concat(u.L.channels,":list"),onLoaded:function(e){_(!0),T(function(t){return function(e,t){var n=e,r=!0,o=!1,a=void 0;try{for(var i,l=t[Symbol.iterator]();!(r=(i=l.next()).done);r=!0){var u=i.value;(null==u?void 0:u.name)&&(null==u?void 0:u.notificationType)&&e[u.name]!==u.notificationType&&(n===e&&(n=b({},e)),n[u.name]=u.notificationType)}}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}(t,e)})},mapOptions:function(e){return{label:S(e.title||e.name),value:e.name}}})),L?l().createElement(i.Suspense,{fallback:l().createElement(a.Spin,null)},l().createElement(L,{variableOptions:g,namePrefix:w})):null)}function w(t){var n,o,u=t.variableOptions,c=t.channelType,s=t.namePrefix,f=(0,r.useFlowContext)(),p=null!=(n=f.app.pm.get(e.A))?n:f.app.pm.get("notification-manager"),y=(0,i.useMemo)(function(){return c?null==p?void 0:p.channelTypes.get(c):void 0},[c,p]),b=null==y||null==(o=y.components)?void 0:o.ContentConfigFormLoader,d=(0,i.useMemo)(function(){return b?(0,i.lazy)(b):null},[b]);return d?l().createElement(i.Suspense,{fallback:l().createElement(a.Spin,null)},l().createElement(d,{variableOptions:u,namePrefix:s})):null}var O=m(375),j=m(197);function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(e,t,n,r,o,a,i){try{var l=e[a](i),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(r,o)}function P(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){x(a,r,o,i,l,"next",e)}function l(e){x(a,r,o,i,l,"throw",e)}i(void 0)})}}function E(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k(e,t)}}function T(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:u(0)}),l(i,"throw",{value:u(1)}),l(i,"return",{value:u(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function u(l){return function(u){var c=[l,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var C="null",A="$scopes",_="$jobsMapByNodeKey";function M(e){return e.isForeignKey?"users"===e.target:"users"===e.collectionName&&"id"===e.name}function q(e,t){return{name:e,title:t,type:"",paths:[e],disabled:!0}}function I(e){var t=e.value,o=e.onChange,a=(0,r.useFlowContext)(),i="string"==typeof t&&/^\d+$/.test(t)?Number(t):t;return l().createElement(n.RemoteSelect,{value:i,onChange:function(e){return null==o?void 0:o(null==e?"":e)},request:function(){return P(function(){var e,t,n;return T(this,function(r){switch(r.label){case 0:return[4,a.api.resource("users").list()];case 1:return[2,Array.isArray(n=null==(t=r.sent())||null==(e=t.data)?void 0:e.data)?n:[]]}})})()},mapOptions:function(e){return{label:e.nickname||String(e.id),value:e.id}},style:{width:"100%"}})}function F(e){var t,n=e.metaTree,u=e.onChange,c=e.translate,s=e.value,f=a.theme.useToken().token,p=(0,r.useResolvedMetaTree)(n).resolvedMetaTree,y=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(0))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t)||E(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),b=y[0],d=y[1],m="string"==typeof s?s:"",v=(0,i.useMemo)(function(){var e;return null!=(e=function(e){if("string"==typeof e){var t=e.trim().match(/^\{\{\s*(.+?)\s*\}\}$/);if(t)return t[1].split(".")}}(s))?e:["constant"]},[s]),h="constant"!==v[0],g=(0,o.useMemoizedFn)(function(e,t){return l().createElement(a.Tooltip,{title:"string"==typeof e?c(e):e,placement:"top",destroyTooltipOnHide:!0},l().createElement(O.QuestionCircleOutlined,{"aria-label":"".concat("string"==typeof t?t:"variable"," tooltip"),style:{marginLeft:f.marginXXS,color:f.colorTextDescription}}))}),w=(0,o.useMemoizedFn)(function(e){var t=function(e){return e.map(function(e){var n,r,o=e.meta,a=!!o&&!!("function"==typeof o.disabled?o.disabled():o.disabled),i=o?"function"==typeof o.disabledReason?o.disabledReason():o.disabledReason:void 0,u="string"==typeof e.label?c(e.label):e.label,s=function(e){if(e){var t,n=e.options;return null!=(t=e.tooltip)?t:null==n?void 0:n.tooltip}}(o),f=s||a?l().createElement("span",null,u,g(s||i||c("This variable is not available"),u)):u;return n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),r=r={disabled:a,label:f,children:Array.isArray(e.children)?t(e.children):e.children},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n})};return t((0,r.buildContextSelectorItems)(e))}),S=(0,i.useMemo)(function(){return b>=0?w(null!=p?p:[]):[]},[w,p,b]),k=(0,o.useMemoizedFn)(function(e){return P(function(){var t,n,o,a;return T(this,function(i){switch(i.label){case 0:if(n=null==(t=e[e.length-1])?void 0:t.meta,!t||t.children||t.isLeaf||!(null==n?void 0:n.children))return[2];t.loading=!0,d(function(e){return e+1}),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,(0,r.loadMetaTreeChildren)(n)];case 2:return o=i.sent(),n.children=o,a=w(o),t.children=a,t.isLeaf=!a.length,[3,4];case 3:return t.loading=!1,d(function(e){return e+1}),[7];case 4:return[2]}})})()}),x=(0,o.useMemoizedFn)(function(e,t){var n,r,o=null==t||null==(n=t[t.length-1])?void 0:n.meta;if(o){var a,i,l=null==(r=o.paths)?void 0:r[0];null==u||u(l===C||"constant"===l?"":(i=null!=(a=null==o?void 0:o.paths)?a:[]).length?"{{".concat(i.join("."),"}}"):"")}}),A=h?l().createElement(j.WorkflowVariableTag,{value:m,onClear:function(){return null==u?void 0:u("")},metaTree:null!=p?p:n,style:{width:"100%",minWidth:0}}):l().createElement(I,{value:null!=s?s:"",onChange:u});return l().createElement(a.Space.Compact,{style:{display:"flex",alignItems:"flex-start",width:"100%"}},l().createElement("div",{style:{flex:1,minWidth:0}},A),l().createElement(a.Cascader,{value:v,options:S,loadData:k,onChange:x},l().createElement(a.Button,{type:v.length?"primary":"default"},"x")))}function $(e){var t=e.value,n=e.onChange,a=(0,c.yr)().t,u=(0,r.useFlowContext)(),s=(0,j.useWorkflowVariableOptions)({types:[M]}),f=(0,o.useMemoizedFn)(function(e){var t,n;return null!=(t=null==u||null==(n=u.t)?void 0:n.call(u,e,{ns:"workflow",nsMode:"fallback"}))?t:a(e)}),p=(0,i.useMemo)(function(){var e,t,n,r;return[{name:C,title:f("Null"),type:"string",paths:[C]},{name:"constant",title:f("Constant"),type:"string",paths:["constant"]}].concat(function(e){if(Array.isArray(e))return k(e)}(r=[null!=(e=(n=new Map(s.map(function(e){return[e.name,e]}))).get(A))?e:q(A,f("Scope variables")),null!=(t=n.get(_))?t:q(_,f("Node result")),n.get("$context"),n.get("$system"),n.get("$env")].filter(Boolean))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||E(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},[f,s]);return l().createElement(F,{value:null!=t?t:"",onChange:n,metaTree:p,translate:f})}function L(e){var t,n=a.theme.useToken().token;return l().createElement("div",{style:{border:"".concat(n.lineWidth,"px dashed ").concat(n.colorBorder),padding:n.paddingSM}},l().createElement(j.FilterDynamicComponent,{collection:"users",value:null!=(t=e.value.filter)?t:{},onChange:function(t){var n;return null==(n=e.onChange)?void 0:n.call(e,{filter:null!=t?t:{}})}}))}function N(e){var t;return e.value&&"object"==((t=e.value)&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)?l().createElement(L,{value:e.value,onChange:e.onChange}):l().createElement($,{value:"string"==typeof e.value||"number"==typeof e.value?e.value:"",onChange:e.onChange})}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function D(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R(e,t)}}function B(e){var t,n=e.value,r=void 0===n?[]:n,o=e.onChange,u=e.disabled,s=(0,c.yr)().t,f=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(t)||D(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=f[0],y=f[1],b=(0,i.useCallback)(function(e){null==o||o(((function(e){if(Array.isArray(e))return R(e)})(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||D(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e])),y(!1)},[o,r]),d=l().createElement(a.Button,{icon:l().createElement(O.PlusOutlined,null),type:"dashed",block:!0,disabled:u},s("Add user"));return u?d:l().createElement(a.Popover,{open:p,onOpenChange:y,content:l().createElement(a.Space,{direction:"vertical",size:"small"},l().createElement(a.Button,{type:"text",onClick:function(){return b("")}},s("Select users")),l().createElement(a.Button,{type:"text",onClick:function(){return b({filter:{}})}},s("Query users")))},d)}}(),S}()});
@@ -6,15 +6,20 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import type { MetaTreeNode } from '@nocobase/flow-engine';
9
10
  import type { ComponentType } from 'react';
10
11
  export type LoaderOf<P = Record<string, never>> = () => Promise<{
11
12
  default: ComponentType<P>;
12
13
  }>;
14
+ export type FormNamePrefix = Array<string | number>;
13
15
  export type MessageConfigFormProps = {
14
- variableOptions?: any;
16
+ variableOptions?: MetaTreeNode[];
17
+ namePrefix?: FormNamePrefix;
15
18
  };
16
19
  export type ContentConfigFormProps = {
17
- variableOptions?: any;
20
+ variableOptions?: MetaTreeNode[];
21
+ channelType?: string;
22
+ namePrefix?: FormNamePrefix;
18
23
  };
19
24
  export type RegisterChannelOptions = {
20
25
  title: string;
@@ -10,15 +10,15 @@
10
10
  module.exports = {
11
11
  "react": "18.2.0",
12
12
  "antd": "5.24.2",
13
- "@nocobase/client": "2.2.0-beta.8",
14
- "@nocobase/utils": "2.2.0-beta.8",
15
- "@nocobase/flow-engine": "2.2.0-beta.8",
13
+ "@nocobase/client": "2.3.0-alpha.1",
14
+ "@nocobase/utils": "2.3.0-alpha.1",
15
+ "@nocobase/flow-engine": "2.3.0-alpha.1",
16
16
  "react-i18next": "11.18.6",
17
- "@nocobase/client-v2": "2.2.0-beta.8",
18
- "@nocobase/database": "2.2.0-beta.8",
19
- "@nocobase/server": "2.2.0-beta.8",
20
- "@nocobase/cache": "2.2.0-beta.8",
21
- "@nocobase/logger": "2.2.0-beta.8",
17
+ "@nocobase/client-v2": "2.3.0-alpha.1",
18
+ "@nocobase/database": "2.3.0-alpha.1",
19
+ "@nocobase/server": "2.3.0-alpha.1",
20
+ "@nocobase/cache": "2.3.0-alpha.1",
21
+ "@nocobase/logger": "2.3.0-alpha.1",
22
22
  "@formily/react": "2.3.7",
23
23
  "@formily/core": "2.3.7",
24
24
  "ahooks": "3.7.8",
@@ -26,6 +26,6 @@ module.exports = {
26
26
  "lodash": "4.18.1",
27
27
  "dayjs": "1.11.13",
28
28
  "@formily/shared": "2.3.7",
29
- "@formily/antd-v5": "1.2.3",
30
- "@nocobase/plugin-workflow": "2.2.0-beta.8"
29
+ "@nocobase/plugin-workflow": "2.3.0-alpha.1",
30
+ "@formily/antd-v5": "1.2.3"
31
31
  };
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ require('../uuid-bin');
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "MAX", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _max.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "NIL", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _nil.default;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "parse", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _parse.default;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "stringify", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _stringify.default;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "v1", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _v.default;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "v1ToV6", {
37
+ enumerable: true,
38
+ get: function get() {
39
+ return _v1ToV.default;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "v3", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _v2.default;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "v4", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _v3.default;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "v5", {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _v4.default;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "v6", {
61
+ enumerable: true,
62
+ get: function get() {
63
+ return _v5.default;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "v6ToV1", {
67
+ enumerable: true,
68
+ get: function get() {
69
+ return _v6ToV.default;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "v7", {
73
+ enumerable: true,
74
+ get: function get() {
75
+ return _v6.default;
76
+ }
77
+ });
78
+ Object.defineProperty(exports, "validate", {
79
+ enumerable: true,
80
+ get: function get() {
81
+ return _validate.default;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "version", {
85
+ enumerable: true,
86
+ get: function get() {
87
+ return _version.default;
88
+ }
89
+ });
90
+ var _max = _interopRequireDefault(require("./max.js"));
91
+ var _nil = _interopRequireDefault(require("./nil.js"));
92
+ var _parse = _interopRequireDefault(require("./parse.js"));
93
+ var _stringify = _interopRequireDefault(require("./stringify.js"));
94
+ var _v = _interopRequireDefault(require("./v1.js"));
95
+ var _v1ToV = _interopRequireDefault(require("./v1ToV6.js"));
96
+ var _v2 = _interopRequireDefault(require("./v3.js"));
97
+ var _v3 = _interopRequireDefault(require("./v4.js"));
98
+ var _v4 = _interopRequireDefault(require("./v5.js"));
99
+ var _v5 = _interopRequireDefault(require("./v6.js"));
100
+ var _v6ToV = _interopRequireDefault(require("./v6ToV1.js"));
101
+ var _v6 = _interopRequireDefault(require("./v7.js"));
102
+ var _validate = _interopRequireDefault(require("./validate.js"));
103
+ var _version = _interopRequireDefault(require("./version.js"));
104
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = exports.default = 'ffffffff-ffff-ffff-ffff-ffffffffffff';
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /*
8
+ * Browser-compatible JavaScript MD5
9
+ *
10
+ * Modification of JavaScript MD5
11
+ * https://github.com/blueimp/JavaScript-MD5
12
+ *
13
+ * Copyright 2011, Sebastian Tschan
14
+ * https://blueimp.net
15
+ *
16
+ * Licensed under the MIT license:
17
+ * https://opensource.org/licenses/MIT
18
+ *
19
+ * Based on
20
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
21
+ * Digest Algorithm, as defined in RFC 1321.
22
+ * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
23
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
24
+ * Distributed under the BSD License
25
+ * See http://pajhome.org.uk/crypt/md5 for more info.
26
+ */
27
+ function md5(bytes) {
28
+ if (typeof bytes === 'string') {
29
+ var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
30
+
31
+ bytes = new Uint8Array(msg.length);
32
+ for (var i = 0; i < msg.length; ++i) {
33
+ bytes[i] = msg.charCodeAt(i);
34
+ }
35
+ }
36
+ return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
37
+ }
38
+
39
+ /*
40
+ * Convert an array of little-endian words to an array of bytes
41
+ */
42
+ function md5ToHexEncodedArray(input) {
43
+ var output = [];
44
+ var length32 = input.length * 32;
45
+ var hexTab = '0123456789abcdef';
46
+ for (var i = 0; i < length32; i += 8) {
47
+ var x = input[i >> 5] >>> i % 32 & 0xff;
48
+ var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
49
+ output.push(hex);
50
+ }
51
+ return output;
52
+ }
53
+
54
+ /**
55
+ * Calculate output length with padding and bit length
56
+ */
57
+ function getOutputLength(inputLength8) {
58
+ return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
59
+ }
60
+
61
+ /*
62
+ * Calculate the MD5 of an array of little-endian words, and a bit length.
63
+ */
64
+ function wordsToMd5(x, len) {
65
+ /* append padding */
66
+ x[len >> 5] |= 0x80 << len % 32;
67
+ x[getOutputLength(len) - 1] = len;
68
+ var a = 1732584193;
69
+ var b = -271733879;
70
+ var c = -1732584194;
71
+ var d = 271733878;
72
+ for (var i = 0; i < x.length; i += 16) {
73
+ var olda = a;
74
+ var oldb = b;
75
+ var oldc = c;
76
+ var oldd = d;
77
+ a = md5ff(a, b, c, d, x[i], 7, -680876936);
78
+ d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
79
+ c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
80
+ b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
81
+ a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
82
+ d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
83
+ c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
84
+ b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
85
+ a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
86
+ d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
87
+ c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
88
+ b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
89
+ a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
90
+ d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
91
+ c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
92
+ b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
93
+ a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
94
+ d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
95
+ c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
96
+ b = md5gg(b, c, d, a, x[i], 20, -373897302);
97
+ a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
98
+ d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
99
+ c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
100
+ b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
101
+ a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
102
+ d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
103
+ c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
104
+ b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
105
+ a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
106
+ d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
107
+ c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
108
+ b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
109
+ a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
110
+ d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
111
+ c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
112
+ b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
113
+ a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
114
+ d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
115
+ c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
116
+ b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
117
+ a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
118
+ d = md5hh(d, a, b, c, x[i], 11, -358537222);
119
+ c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
120
+ b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
121
+ a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
122
+ d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
123
+ c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
124
+ b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
125
+ a = md5ii(a, b, c, d, x[i], 6, -198630844);
126
+ d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
127
+ c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
128
+ b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
129
+ a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
130
+ d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
131
+ c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
132
+ b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
133
+ a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
134
+ d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
135
+ c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
136
+ b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
137
+ a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
138
+ d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
139
+ c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
140
+ b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
141
+ a = safeAdd(a, olda);
142
+ b = safeAdd(b, oldb);
143
+ c = safeAdd(c, oldc);
144
+ d = safeAdd(d, oldd);
145
+ }
146
+ return [a, b, c, d];
147
+ }
148
+
149
+ /*
150
+ * Convert an array bytes to an array of little-endian words
151
+ * Characters >255 have their high-byte silently ignored.
152
+ */
153
+ function bytesToWords(input) {
154
+ if (input.length === 0) {
155
+ return [];
156
+ }
157
+ var length8 = input.length * 8;
158
+ var output = new Uint32Array(getOutputLength(length8));
159
+ for (var i = 0; i < length8; i += 8) {
160
+ output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
161
+ }
162
+ return output;
163
+ }
164
+
165
+ /*
166
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
167
+ * to work around bugs in some JS interpreters.
168
+ */
169
+ function safeAdd(x, y) {
170
+ var lsw = (x & 0xffff) + (y & 0xffff);
171
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
172
+ return msw << 16 | lsw & 0xffff;
173
+ }
174
+
175
+ /*
176
+ * Bitwise rotate a 32-bit number to the left.
177
+ */
178
+ function bitRotateLeft(num, cnt) {
179
+ return num << cnt | num >>> 32 - cnt;
180
+ }
181
+
182
+ /*
183
+ * These functions implement the four basic operations the algorithm uses.
184
+ */
185
+ function md5cmn(q, a, b, x, s, t) {
186
+ return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
187
+ }
188
+ function md5ff(a, b, c, d, x, s, t) {
189
+ return md5cmn(b & c | ~b & d, a, b, x, s, t);
190
+ }
191
+ function md5gg(a, b, c, d, x, s, t) {
192
+ return md5cmn(b & d | c & ~d, a, b, x, s, t);
193
+ }
194
+ function md5hh(a, b, c, d, x, s, t) {
195
+ return md5cmn(b ^ c ^ d, a, b, x, s, t);
196
+ }
197
+ function md5ii(a, b, c, d, x, s, t) {
198
+ return md5cmn(c ^ (b | ~d), a, b, x, s, t);
199
+ }
200
+ var _default = exports.default = md5;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
8
+ var _default = exports.default = {
9
+ randomUUID
10
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = exports.default = '00000000-0000-0000-0000-000000000000';
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _validate = _interopRequireDefault(require("./validate.js"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ function parse(uuid) {
10
+ if (!(0, _validate.default)(uuid)) {
11
+ throw TypeError('Invalid UUID');
12
+ }
13
+ var v;
14
+ var arr = new Uint8Array(16);
15
+
16
+ // Parse ########-....-....-....-............
17
+ arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
18
+ arr[1] = v >>> 16 & 0xff;
19
+ arr[2] = v >>> 8 & 0xff;
20
+ arr[3] = v & 0xff;
21
+
22
+ // Parse ........-####-....-....-............
23
+ arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
24
+ arr[5] = v & 0xff;
25
+
26
+ // Parse ........-....-####-....-............
27
+ arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
28
+ arr[7] = v & 0xff;
29
+
30
+ // Parse ........-....-....-####-............
31
+ arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
32
+ arr[9] = v & 0xff;
33
+
34
+ // Parse ........-....-....-....-############
35
+ // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
36
+ arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
37
+ arr[11] = v / 0x100000000 & 0xff;
38
+ arr[12] = v >>> 24 & 0xff;
39
+ arr[13] = v >>> 16 & 0xff;
40
+ arr[14] = v >>> 8 & 0xff;
41
+ arr[15] = v & 0xff;
42
+ return arr;
43
+ }
44
+ var _default = exports.default = parse;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = exports.default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;