vue-devui 1.0.0-beta.9 → 1.0.0-pre.0

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 (269) hide show
  1. package/README.md +81 -66
  2. package/accordion/index.es.js +522 -39
  3. package/accordion/index.umd.js +1 -1
  4. package/accordion/style.css +1 -1
  5. package/alert/index.es.js +6 -7
  6. package/alert/index.umd.js +1 -1
  7. package/alert/style.css +1 -1
  8. package/{toast → auto-complete}/index.d.ts +0 -0
  9. package/auto-complete/index.es.js +976 -0
  10. package/auto-complete/index.umd.js +1 -0
  11. package/auto-complete/package.json +7 -0
  12. package/auto-complete/style.css +1 -0
  13. package/back-top/index.es.js +1 -1
  14. package/back-top/index.umd.js +1 -1
  15. package/badge/index.es.js +12 -18
  16. package/badge/index.umd.js +1 -1
  17. package/button/index.es.js +262 -82
  18. package/button/index.umd.js +1 -1
  19. package/button/style.css +1 -1
  20. package/carousel/index.es.js +7 -6
  21. package/carousel/index.umd.js +1 -1
  22. package/cascader/index.es.js +5392 -772
  23. package/cascader/index.umd.js +27 -1
  24. package/checkbox/style.css +1 -1
  25. package/color-picker/index.d.ts +7 -0
  26. package/color-picker/index.es.js +8187 -0
  27. package/color-picker/index.umd.js +27 -0
  28. package/color-picker/package.json +7 -0
  29. package/color-picker/style.css +1 -0
  30. package/comment/index.es.js +42 -13
  31. package/comment/index.umd.js +1 -1
  32. package/comment/style.css +1 -1
  33. package/countdown/index.es.js +27 -18
  34. package/countdown/index.umd.js +1 -1
  35. package/countdown/style.css +1 -1
  36. package/date-picker/index.es.js +10 -11
  37. package/date-picker/index.umd.js +1 -1
  38. package/date-picker/style.css +1 -1
  39. package/dragdrop/index.es.js +135 -10
  40. package/dragdrop/index.umd.js +1 -1
  41. package/drawer/index.es.js +169 -223
  42. package/drawer/index.umd.js +1 -1
  43. package/drawer/style.css +1 -1
  44. package/dropdown/index.es.js +408 -300
  45. package/dropdown/index.umd.js +1 -1
  46. package/dropdown/style.css +1 -1
  47. package/editable-select/index.es.js +293 -5663
  48. package/editable-select/index.umd.js +1 -27
  49. package/editable-select/style.css +1 -1
  50. package/form/index.es.js +6129 -461
  51. package/form/index.umd.js +27 -1
  52. package/form/style.css +1 -1
  53. package/fullscreen/index.es.js +110 -128
  54. package/fullscreen/index.umd.js +1 -1
  55. package/fullscreen/style.css +1 -1
  56. package/gantt/index.es.js +6 -18
  57. package/gantt/index.umd.js +1 -1
  58. package/gantt/style.css +1 -1
  59. package/grid/index.es.js +1 -1
  60. package/grid/style.css +1 -1
  61. package/icon/index.es.js +2 -1
  62. package/icon/index.umd.js +1 -1
  63. package/image-preview/index.es.js +33 -15
  64. package/image-preview/index.umd.js +1 -1
  65. package/input/index.es.js +4 -5
  66. package/input/index.umd.js +1 -1
  67. package/input/style.css +1 -1
  68. package/input-icon/index.es.js +6 -6
  69. package/input-icon/index.umd.js +1 -1
  70. package/input-icon/style.css +1 -1
  71. package/input-number/index.es.js +2 -1
  72. package/input-number/index.umd.js +1 -1
  73. package/list/index.d.ts +7 -0
  74. package/list/index.es.js +39 -0
  75. package/list/index.umd.js +1 -0
  76. package/{toast → list}/package.json +1 -1
  77. package/list/style.css +1 -0
  78. package/loading/index.es.js +2 -2
  79. package/modal/index.es.js +293 -759
  80. package/modal/index.umd.js +1 -1
  81. package/modal/style.css +1 -1
  82. package/nav-sprite/index.es.js +1 -675
  83. package/nav-sprite/index.umd.js +1 -1
  84. package/notification/index.d.ts +7 -0
  85. package/notification/index.es.js +286 -0
  86. package/notification/index.umd.js +1 -0
  87. package/notification/package.json +7 -0
  88. package/notification/style.css +1 -0
  89. package/nuxt/components/Accordion.js +3 -0
  90. package/nuxt/components/Alert.js +3 -0
  91. package/nuxt/components/Anchor.js +3 -0
  92. package/nuxt/components/Aside.js +3 -0
  93. package/nuxt/components/AutoComplete.js +3 -0
  94. package/nuxt/components/Avatar.js +3 -0
  95. package/nuxt/components/BackTop.js +3 -0
  96. package/nuxt/components/Badge.js +3 -0
  97. package/nuxt/components/Breadcrumb.js +3 -0
  98. package/nuxt/components/Button.js +3 -0
  99. package/nuxt/components/Card.js +3 -0
  100. package/nuxt/components/Carousel.js +3 -0
  101. package/nuxt/components/CarouselItem.js +3 -0
  102. package/nuxt/components/Cascader.js +3 -0
  103. package/nuxt/components/Checkbox.js +3 -0
  104. package/nuxt/components/Col.js +3 -0
  105. package/nuxt/components/ColorPicker.js +3 -0
  106. package/nuxt/components/Column.js +3 -0
  107. package/nuxt/components/Comment.js +3 -0
  108. package/nuxt/components/Content.js +3 -0
  109. package/nuxt/components/Countdown.js +3 -0
  110. package/nuxt/components/DatePicker.js +3 -0
  111. package/nuxt/components/Drawer.js +3 -0
  112. package/nuxt/components/DrawerService.js +3 -0
  113. package/nuxt/components/Dropdown.js +3 -0
  114. package/nuxt/components/DropdownMenu.js +3 -0
  115. package/nuxt/components/EditableSelect.js +3 -0
  116. package/nuxt/components/FixedOverlay.js +3 -0
  117. package/nuxt/components/FlexibleOverlay.js +3 -0
  118. package/nuxt/components/Footer.js +3 -0
  119. package/nuxt/components/Form.js +3 -0
  120. package/nuxt/components/FormControl.js +3 -0
  121. package/nuxt/components/FormItem.js +3 -0
  122. package/nuxt/components/FormLabel.js +3 -0
  123. package/nuxt/components/FormOperation.js +3 -0
  124. package/nuxt/components/Fullscreen.js +3 -0
  125. package/nuxt/components/Gantt.js +3 -0
  126. package/nuxt/components/Header.js +3 -0
  127. package/nuxt/components/IFileOptions.js +3 -0
  128. package/nuxt/components/IUploadOptions.js +3 -0
  129. package/nuxt/components/Icon.js +2 -0
  130. package/nuxt/components/ImagePreviewService.js +3 -0
  131. package/nuxt/components/Input.js +3 -0
  132. package/nuxt/components/InputIcon.js +3 -0
  133. package/nuxt/components/InputNumber.js +3 -0
  134. package/nuxt/components/Layout.js +3 -0
  135. package/nuxt/components/List.js +3 -0
  136. package/nuxt/components/ListItem.js +3 -0
  137. package/nuxt/components/Loading.js +3 -0
  138. package/nuxt/components/LoadingService.js +3 -0
  139. package/nuxt/components/Modal.js +3 -0
  140. package/nuxt/components/NavSprite.js +2 -0
  141. package/nuxt/components/Notification.js +3 -0
  142. package/nuxt/components/NotificationService.js +3 -0
  143. package/nuxt/components/Pagination.js +3 -0
  144. package/nuxt/components/Panel.js +3 -0
  145. package/nuxt/components/Popover.js +3 -0
  146. package/nuxt/components/Progress.js +3 -0
  147. package/nuxt/components/QuadrantDiagram.js +3 -0
  148. package/nuxt/components/Radio.js +3 -0
  149. package/nuxt/components/RadioGroup.js +3 -0
  150. package/nuxt/components/Rate.js +3 -0
  151. package/nuxt/components/ReadTip.js +3 -0
  152. package/nuxt/components/Result.js +3 -0
  153. package/nuxt/components/Row.js +3 -0
  154. package/nuxt/components/Search.js +3 -0
  155. package/nuxt/components/Select.js +3 -0
  156. package/nuxt/components/Skeleton.js +3 -0
  157. package/nuxt/components/SkeletonItem.js +3 -0
  158. package/nuxt/components/Slider.js +3 -0
  159. package/nuxt/components/Splitter.js +3 -0
  160. package/nuxt/components/Statistic.js +3 -0
  161. package/nuxt/components/Status.js +3 -0
  162. package/nuxt/components/StepsGuide.js +3 -0
  163. package/nuxt/components/StickSlider.js +3 -0
  164. package/nuxt/components/Sticky.js +2 -0
  165. package/nuxt/components/Switch.js +3 -0
  166. package/nuxt/components/Table.js +3 -0
  167. package/nuxt/components/Tabs.js +3 -0
  168. package/nuxt/components/Tag.js +3 -0
  169. package/nuxt/components/TagInput.js +3 -0
  170. package/nuxt/components/Textarea.js +3 -0
  171. package/nuxt/components/TimeAxis.js +3 -0
  172. package/nuxt/components/TimeAxisItem.js +3 -0
  173. package/nuxt/components/TimePicker.js +3 -0
  174. package/nuxt/components/Tooltip.js +3 -0
  175. package/nuxt/components/Transfer.js +3 -0
  176. package/nuxt/components/Tree.js +3 -0
  177. package/nuxt/components/TreeSelect.js +3 -0
  178. package/nuxt/components/Upload.js +3 -0
  179. package/nuxt/components/UploadStatus.js +3 -0
  180. package/nuxt/components/badgeProps.js +3 -0
  181. package/nuxt/components/buttonProps.js +3 -0
  182. package/nuxt/components/dropdownMenuProps.js +3 -0
  183. package/nuxt/components/fixedOverlayProps.js +3 -0
  184. package/nuxt/components/flexibleOverlayProps.js +3 -0
  185. package/nuxt/components/notificationProps.js +3 -0
  186. package/nuxt/components/overlayEmits.js +3 -0
  187. package/nuxt/components/overlayProps.js +3 -0
  188. package/nuxt/components/popoverProps.js +3 -0
  189. package/nuxt/components/tooltipProps.js +3 -0
  190. package/nuxt/components/uploadProps.js +3 -0
  191. package/nuxt/index.js +13 -0
  192. package/overlay/index.es.js +142 -198
  193. package/overlay/index.umd.js +1 -1
  194. package/overlay/style.css +1 -1
  195. package/package.json +10 -18
  196. package/pagination/index.es.js +1 -1
  197. package/pagination/style.css +1 -1
  198. package/panel/index.es.js +3 -3
  199. package/panel/index.umd.js +1 -1
  200. package/popover/index.es.js +5947 -189
  201. package/popover/index.umd.js +27 -1
  202. package/popover/style.css +1 -1
  203. package/progress/index.es.js +8 -8
  204. package/progress/index.umd.js +3 -3
  205. package/quadrant-diagram/index.es.js +5405 -166
  206. package/quadrant-diagram/index.umd.js +27 -1
  207. package/radio/index.es.js +5 -5
  208. package/radio/index.umd.js +1 -1
  209. package/radio/style.css +1 -1
  210. package/read-tip/style.css +1 -1
  211. package/result/index.es.js +2 -1
  212. package/result/index.umd.js +1 -1
  213. package/ripple/index.es.js +1 -1
  214. package/search/index.es.js +5426 -195
  215. package/search/index.umd.js +27 -1
  216. package/search/style.css +1 -1
  217. package/select/index.es.js +3 -2
  218. package/select/index.umd.js +1 -1
  219. package/select/style.css +1 -1
  220. package/slider/index.es.js +2 -5
  221. package/slider/index.umd.js +1 -1
  222. package/slider/style.css +1 -1
  223. package/splitter/index.es.js +5881 -36
  224. package/splitter/index.umd.js +27 -1
  225. package/splitter/style.css +1 -1
  226. package/statistic/index.es.js +19 -32
  227. package/statistic/index.umd.js +1 -1
  228. package/statistic/style.css +1 -1
  229. package/status/style.css +1 -1
  230. package/sticky/index.umd.js +1 -1
  231. package/style.css +1 -1
  232. package/table/index.es.js +698 -358
  233. package/table/index.umd.js +1 -1
  234. package/table/style.css +1 -1
  235. package/tabs/index.es.js +3 -4
  236. package/tabs/index.umd.js +1 -1
  237. package/tabs/style.css +1 -1
  238. package/tag/index.es.js +2 -2
  239. package/tag/index.umd.js +1 -1
  240. package/tag/style.css +1 -1
  241. package/tag-input/index.es.js +0 -12
  242. package/tag-input/index.umd.js +1 -1
  243. package/textarea/style.css +1 -1
  244. package/{theme → theme/theme.scss} +0 -0
  245. package/time-axis/index.es.js +2 -1
  246. package/time-axis/index.umd.js +1 -1
  247. package/time-picker/index.es.js +269 -84
  248. package/time-picker/index.umd.js +1 -1
  249. package/time-picker/style.css +1 -1
  250. package/tooltip/index.es.js +5798 -141
  251. package/tooltip/index.umd.js +27 -1
  252. package/tooltip/style.css +1 -1
  253. package/transfer/index.es.js +6522 -638
  254. package/transfer/index.umd.js +27 -1
  255. package/transfer/style.css +1 -1
  256. package/tree/index.es.js +5775 -192
  257. package/tree/index.umd.js +27 -1
  258. package/tree/style.css +1 -1
  259. package/tree-select/index.es.js +130 -35
  260. package/tree-select/index.umd.js +1 -1
  261. package/tree-select/style.css +1 -1
  262. package/upload/index.es.js +463 -2680
  263. package/upload/index.umd.js +1 -1
  264. package/upload/style.css +1 -1
  265. package/vue-devui.es.js +14261 -14065
  266. package/vue-devui.umd.js +19 -19
  267. package/toast/index.es.js +0 -2059
  268. package/toast/index.umd.js +0 -1
  269. package/toast/style.css +0 -1
package/toast/index.es.js DELETED
@@ -1,2059 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, createVNode, getCurrentInstance, ref, computed, watch, nextTick, onUnmounted, mergeProps, createApp } from "vue";
21
- var toast = "";
22
- const toastProps = {
23
- value: {
24
- type: Array,
25
- required: true,
26
- default: () => []
27
- },
28
- life: {
29
- type: Number,
30
- default: null
31
- },
32
- lifeMode: {
33
- type: String,
34
- default: "global"
35
- },
36
- sticky: {
37
- type: Boolean,
38
- default: false
39
- },
40
- style: {
41
- type: Object,
42
- default: () => ({})
43
- },
44
- styleClass: {
45
- type: String
46
- },
47
- onCloseEvent: {
48
- type: Function
49
- },
50
- onValueChange: {
51
- type: Function
52
- }
53
- };
54
- var Icon = defineComponent({
55
- name: "DIcon",
56
- props: {
57
- name: {
58
- type: String,
59
- required: true
60
- },
61
- size: {
62
- type: String,
63
- default: "inherit"
64
- },
65
- color: {
66
- type: String,
67
- default: "inherit"
68
- },
69
- classPrefix: {
70
- type: String,
71
- default: "icon"
72
- }
73
- },
74
- setup(props) {
75
- return __spreadValues({}, props);
76
- },
77
- render() {
78
- const {
79
- name,
80
- size,
81
- color,
82
- classPrefix
83
- } = this;
84
- return /^((https?):)?\/\//.test(name) ? createVNode("img", {
85
- "src": name,
86
- "alt": name.split("/")[name.split("/").length - 1],
87
- "style": {
88
- width: size
89
- }
90
- }, null) : createVNode("i", {
91
- "class": `${classPrefix} ${classPrefix}-${name}`,
92
- "style": {
93
- fontSize: size,
94
- color
95
- }
96
- }, null);
97
- }
98
- });
99
- Icon.install = function(app) {
100
- app.component(Icon.name, Icon);
101
- };
102
- var ToastIconClose = defineComponent({
103
- name: "DToastIconClose",
104
- props: {
105
- prefixCls: String,
106
- onClick: Function
107
- },
108
- emits: ["click"],
109
- render() {
110
- const {
111
- prefixCls,
112
- $emit
113
- } = this;
114
- const wrapperCls = `${prefixCls}-icon-close`;
115
- return createVNode("div", {
116
- "class": wrapperCls,
117
- "onClick": (e) => $emit("click", e)
118
- }, [createVNode(Icon, {
119
- "name": "close",
120
- "size": "14px"
121
- }, null)]);
122
- }
123
- });
124
- var ToastImage = defineComponent({
125
- name: "DToastImage",
126
- props: {
127
- prefixCls: String,
128
- severity: String
129
- },
130
- render() {
131
- const {
132
- prefixCls,
133
- severity
134
- } = this;
135
- const wrapperCls = [`${prefixCls}-image`, `${prefixCls}-image-${severity || "common"}`];
136
- const severityIconMap = {
137
- info: "info-o",
138
- success: "right-o",
139
- warn: "warning-o",
140
- error: "error-o"
141
- };
142
- const showIcon = () => severity !== "common";
143
- return createVNode("span", {
144
- "class": wrapperCls
145
- }, [showIcon() ? createVNode(Icon, {
146
- "name": severityIconMap[severity],
147
- "size": "14px"
148
- }, null) : null]);
149
- }
150
- });
151
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
152
- var freeGlobal$1 = freeGlobal;
153
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
154
- var root = freeGlobal$1 || freeSelf || Function("return this")();
155
- var root$1 = root;
156
- var Symbol$1 = root$1.Symbol;
157
- var Symbol$2 = Symbol$1;
158
- var objectProto$f = Object.prototype;
159
- var hasOwnProperty$c = objectProto$f.hasOwnProperty;
160
- var nativeObjectToString$1 = objectProto$f.toString;
161
- var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
162
- function getRawTag(value) {
163
- var isOwn = hasOwnProperty$c.call(value, symToStringTag$1), tag = value[symToStringTag$1];
164
- try {
165
- value[symToStringTag$1] = void 0;
166
- var unmasked = true;
167
- } catch (e) {
168
- }
169
- var result = nativeObjectToString$1.call(value);
170
- if (unmasked) {
171
- if (isOwn) {
172
- value[symToStringTag$1] = tag;
173
- } else {
174
- delete value[symToStringTag$1];
175
- }
176
- }
177
- return result;
178
- }
179
- var objectProto$e = Object.prototype;
180
- var nativeObjectToString = objectProto$e.toString;
181
- function objectToString(value) {
182
- return nativeObjectToString.call(value);
183
- }
184
- var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
185
- var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
186
- function baseGetTag(value) {
187
- if (value == null) {
188
- return value === void 0 ? undefinedTag : nullTag;
189
- }
190
- return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
191
- }
192
- function isObjectLike(value) {
193
- return value != null && typeof value == "object";
194
- }
195
- var symbolTag$3 = "[object Symbol]";
196
- function isSymbol(value) {
197
- return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
198
- }
199
- function arrayMap(array, iteratee) {
200
- var index2 = -1, length = array == null ? 0 : array.length, result = Array(length);
201
- while (++index2 < length) {
202
- result[index2] = iteratee(array[index2], index2, array);
203
- }
204
- return result;
205
- }
206
- var isArray = Array.isArray;
207
- var isArray$1 = isArray;
208
- var INFINITY$1 = 1 / 0;
209
- var symbolProto$2 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0;
210
- function baseToString(value) {
211
- if (typeof value == "string") {
212
- return value;
213
- }
214
- if (isArray$1(value)) {
215
- return arrayMap(value, baseToString) + "";
216
- }
217
- if (isSymbol(value)) {
218
- return symbolToString ? symbolToString.call(value) : "";
219
- }
220
- var result = value + "";
221
- return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
222
- }
223
- var reWhitespace = /\s/;
224
- function trimmedEndIndex(string) {
225
- var index2 = string.length;
226
- while (index2-- && reWhitespace.test(string.charAt(index2))) {
227
- }
228
- return index2;
229
- }
230
- var reTrimStart = /^\s+/;
231
- function baseTrim(string) {
232
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
233
- }
234
- function isObject(value) {
235
- var type = typeof value;
236
- return value != null && (type == "object" || type == "function");
237
- }
238
- var NAN = 0 / 0;
239
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
240
- var reIsBinary = /^0b[01]+$/i;
241
- var reIsOctal = /^0o[0-7]+$/i;
242
- var freeParseInt = parseInt;
243
- function toNumber(value) {
244
- if (typeof value == "number") {
245
- return value;
246
- }
247
- if (isSymbol(value)) {
248
- return NAN;
249
- }
250
- if (isObject(value)) {
251
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
252
- value = isObject(other) ? other + "" : other;
253
- }
254
- if (typeof value != "string") {
255
- return value === 0 ? value : +value;
256
- }
257
- value = baseTrim(value);
258
- var isBinary = reIsBinary.test(value);
259
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
260
- }
261
- function identity(value) {
262
- return value;
263
- }
264
- var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
265
- function isFunction(value) {
266
- if (!isObject(value)) {
267
- return false;
268
- }
269
- var tag = baseGetTag(value);
270
- return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
271
- }
272
- var coreJsData = root$1["__core-js_shared__"];
273
- var coreJsData$1 = coreJsData;
274
- var maskSrcKey = function() {
275
- var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
276
- return uid ? "Symbol(src)_1." + uid : "";
277
- }();
278
- function isMasked(func) {
279
- return !!maskSrcKey && maskSrcKey in func;
280
- }
281
- var funcProto$2 = Function.prototype;
282
- var funcToString$2 = funcProto$2.toString;
283
- function toSource(func) {
284
- if (func != null) {
285
- try {
286
- return funcToString$2.call(func);
287
- } catch (e) {
288
- }
289
- try {
290
- return func + "";
291
- } catch (e) {
292
- }
293
- }
294
- return "";
295
- }
296
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
297
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
298
- var funcProto$1 = Function.prototype, objectProto$d = Object.prototype;
299
- var funcToString$1 = funcProto$1.toString;
300
- var hasOwnProperty$b = objectProto$d.hasOwnProperty;
301
- var reIsNative = RegExp("^" + funcToString$1.call(hasOwnProperty$b).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
302
- function baseIsNative(value) {
303
- if (!isObject(value) || isMasked(value)) {
304
- return false;
305
- }
306
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
307
- return pattern.test(toSource(value));
308
- }
309
- function getValue(object, key) {
310
- return object == null ? void 0 : object[key];
311
- }
312
- function getNative(object, key) {
313
- var value = getValue(object, key);
314
- return baseIsNative(value) ? value : void 0;
315
- }
316
- var WeakMap = getNative(root$1, "WeakMap");
317
- var WeakMap$1 = WeakMap;
318
- var objectCreate = Object.create;
319
- var baseCreate = function() {
320
- function object() {
321
- }
322
- return function(proto) {
323
- if (!isObject(proto)) {
324
- return {};
325
- }
326
- if (objectCreate) {
327
- return objectCreate(proto);
328
- }
329
- object.prototype = proto;
330
- var result = new object();
331
- object.prototype = void 0;
332
- return result;
333
- };
334
- }();
335
- var baseCreate$1 = baseCreate;
336
- function apply(func, thisArg, args) {
337
- switch (args.length) {
338
- case 0:
339
- return func.call(thisArg);
340
- case 1:
341
- return func.call(thisArg, args[0]);
342
- case 2:
343
- return func.call(thisArg, args[0], args[1]);
344
- case 3:
345
- return func.call(thisArg, args[0], args[1], args[2]);
346
- }
347
- return func.apply(thisArg, args);
348
- }
349
- function copyArray(source, array) {
350
- var index2 = -1, length = source.length;
351
- array || (array = Array(length));
352
- while (++index2 < length) {
353
- array[index2] = source[index2];
354
- }
355
- return array;
356
- }
357
- var HOT_COUNT = 800, HOT_SPAN = 16;
358
- var nativeNow = Date.now;
359
- function shortOut(func) {
360
- var count = 0, lastCalled = 0;
361
- return function() {
362
- var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
363
- lastCalled = stamp;
364
- if (remaining > 0) {
365
- if (++count >= HOT_COUNT) {
366
- return arguments[0];
367
- }
368
- } else {
369
- count = 0;
370
- }
371
- return func.apply(void 0, arguments);
372
- };
373
- }
374
- function constant(value) {
375
- return function() {
376
- return value;
377
- };
378
- }
379
- var defineProperty = function() {
380
- try {
381
- var func = getNative(Object, "defineProperty");
382
- func({}, "", {});
383
- return func;
384
- } catch (e) {
385
- }
386
- }();
387
- var defineProperty$1 = defineProperty;
388
- var baseSetToString = !defineProperty$1 ? identity : function(func, string) {
389
- return defineProperty$1(func, "toString", {
390
- "configurable": true,
391
- "enumerable": false,
392
- "value": constant(string),
393
- "writable": true
394
- });
395
- };
396
- var baseSetToString$1 = baseSetToString;
397
- var setToString = shortOut(baseSetToString$1);
398
- var setToString$1 = setToString;
399
- function arrayEach(array, iteratee) {
400
- var index2 = -1, length = array == null ? 0 : array.length;
401
- while (++index2 < length) {
402
- if (iteratee(array[index2], index2, array) === false) {
403
- break;
404
- }
405
- }
406
- return array;
407
- }
408
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
409
- var reIsUint = /^(?:0|[1-9]\d*)$/;
410
- function isIndex(value, length) {
411
- var type = typeof value;
412
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
413
- return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
414
- }
415
- function baseAssignValue(object, key, value) {
416
- if (key == "__proto__" && defineProperty$1) {
417
- defineProperty$1(object, key, {
418
- "configurable": true,
419
- "enumerable": true,
420
- "value": value,
421
- "writable": true
422
- });
423
- } else {
424
- object[key] = value;
425
- }
426
- }
427
- function eq(value, other) {
428
- return value === other || value !== value && other !== other;
429
- }
430
- var objectProto$c = Object.prototype;
431
- var hasOwnProperty$a = objectProto$c.hasOwnProperty;
432
- function assignValue(object, key, value) {
433
- var objValue = object[key];
434
- if (!(hasOwnProperty$a.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
435
- baseAssignValue(object, key, value);
436
- }
437
- }
438
- function copyObject(source, props, object, customizer) {
439
- var isNew = !object;
440
- object || (object = {});
441
- var index2 = -1, length = props.length;
442
- while (++index2 < length) {
443
- var key = props[index2];
444
- var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
445
- if (newValue === void 0) {
446
- newValue = source[key];
447
- }
448
- if (isNew) {
449
- baseAssignValue(object, key, newValue);
450
- } else {
451
- assignValue(object, key, newValue);
452
- }
453
- }
454
- return object;
455
- }
456
- var nativeMax$1 = Math.max;
457
- function overRest(func, start, transform) {
458
- start = nativeMax$1(start === void 0 ? func.length - 1 : start, 0);
459
- return function() {
460
- var args = arguments, index2 = -1, length = nativeMax$1(args.length - start, 0), array = Array(length);
461
- while (++index2 < length) {
462
- array[index2] = args[start + index2];
463
- }
464
- index2 = -1;
465
- var otherArgs = Array(start + 1);
466
- while (++index2 < start) {
467
- otherArgs[index2] = args[index2];
468
- }
469
- otherArgs[start] = transform(array);
470
- return apply(func, this, otherArgs);
471
- };
472
- }
473
- function baseRest(func, start) {
474
- return setToString$1(overRest(func, start, identity), func + "");
475
- }
476
- var MAX_SAFE_INTEGER = 9007199254740991;
477
- function isLength(value) {
478
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
479
- }
480
- function isArrayLike(value) {
481
- return value != null && isLength(value.length) && !isFunction(value);
482
- }
483
- function isIterateeCall(value, index2, object) {
484
- if (!isObject(object)) {
485
- return false;
486
- }
487
- var type = typeof index2;
488
- if (type == "number" ? isArrayLike(object) && isIndex(index2, object.length) : type == "string" && index2 in object) {
489
- return eq(object[index2], value);
490
- }
491
- return false;
492
- }
493
- function createAssigner(assigner) {
494
- return baseRest(function(object, sources) {
495
- var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
496
- customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
497
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
498
- customizer = length < 3 ? void 0 : customizer;
499
- length = 1;
500
- }
501
- object = Object(object);
502
- while (++index2 < length) {
503
- var source = sources[index2];
504
- if (source) {
505
- assigner(object, source, index2, customizer);
506
- }
507
- }
508
- return object;
509
- });
510
- }
511
- var objectProto$b = Object.prototype;
512
- function isPrototype(value) {
513
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$b;
514
- return value === proto;
515
- }
516
- function baseTimes(n, iteratee) {
517
- var index2 = -1, result = Array(n);
518
- while (++index2 < n) {
519
- result[index2] = iteratee(index2);
520
- }
521
- return result;
522
- }
523
- var argsTag$3 = "[object Arguments]";
524
- function baseIsArguments(value) {
525
- return isObjectLike(value) && baseGetTag(value) == argsTag$3;
526
- }
527
- var objectProto$a = Object.prototype;
528
- var hasOwnProperty$9 = objectProto$a.hasOwnProperty;
529
- var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
530
- var isArguments = baseIsArguments(function() {
531
- return arguments;
532
- }()) ? baseIsArguments : function(value) {
533
- return isObjectLike(value) && hasOwnProperty$9.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
534
- };
535
- var isArguments$1 = isArguments;
536
- function stubFalse() {
537
- return false;
538
- }
539
- var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
540
- var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
541
- var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
542
- var Buffer$1 = moduleExports$2 ? root$1.Buffer : void 0;
543
- var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
544
- var isBuffer = nativeIsBuffer || stubFalse;
545
- var isBuffer$1 = isBuffer;
546
- var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$5 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]";
547
- var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
548
- var typedArrayTags = {};
549
- typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
550
- typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false;
551
- function baseIsTypedArray(value) {
552
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
553
- }
554
- function baseUnary(func) {
555
- return function(value) {
556
- return func(value);
557
- };
558
- }
559
- var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
560
- var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
561
- var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
562
- var freeProcess = moduleExports$1 && freeGlobal$1.process;
563
- var nodeUtil = function() {
564
- try {
565
- var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
566
- if (types) {
567
- return types;
568
- }
569
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
570
- } catch (e) {
571
- }
572
- }();
573
- var nodeUtil$1 = nodeUtil;
574
- var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
575
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
576
- var isTypedArray$1 = isTypedArray;
577
- var objectProto$9 = Object.prototype;
578
- var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
579
- function arrayLikeKeys(value, inherited) {
580
- var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
581
- for (var key in value) {
582
- if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
583
- result.push(key);
584
- }
585
- }
586
- return result;
587
- }
588
- function overArg(func, transform) {
589
- return function(arg) {
590
- return func(transform(arg));
591
- };
592
- }
593
- var nativeKeys = overArg(Object.keys, Object);
594
- var nativeKeys$1 = nativeKeys;
595
- var objectProto$8 = Object.prototype;
596
- var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
597
- function baseKeys(object) {
598
- if (!isPrototype(object)) {
599
- return nativeKeys$1(object);
600
- }
601
- var result = [];
602
- for (var key in Object(object)) {
603
- if (hasOwnProperty$7.call(object, key) && key != "constructor") {
604
- result.push(key);
605
- }
606
- }
607
- return result;
608
- }
609
- function keys(object) {
610
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
611
- }
612
- function nativeKeysIn(object) {
613
- var result = [];
614
- if (object != null) {
615
- for (var key in Object(object)) {
616
- result.push(key);
617
- }
618
- }
619
- return result;
620
- }
621
- var objectProto$7 = Object.prototype;
622
- var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
623
- function baseKeysIn(object) {
624
- if (!isObject(object)) {
625
- return nativeKeysIn(object);
626
- }
627
- var isProto = isPrototype(object), result = [];
628
- for (var key in object) {
629
- if (!(key == "constructor" && (isProto || !hasOwnProperty$6.call(object, key)))) {
630
- result.push(key);
631
- }
632
- }
633
- return result;
634
- }
635
- function keysIn(object) {
636
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
637
- }
638
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
639
- function isKey(value, object) {
640
- if (isArray$1(value)) {
641
- return false;
642
- }
643
- var type = typeof value;
644
- if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
645
- return true;
646
- }
647
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
648
- }
649
- var nativeCreate = getNative(Object, "create");
650
- var nativeCreate$1 = nativeCreate;
651
- function hashClear() {
652
- this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
653
- this.size = 0;
654
- }
655
- function hashDelete(key) {
656
- var result = this.has(key) && delete this.__data__[key];
657
- this.size -= result ? 1 : 0;
658
- return result;
659
- }
660
- var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
661
- var objectProto$6 = Object.prototype;
662
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
663
- function hashGet(key) {
664
- var data = this.__data__;
665
- if (nativeCreate$1) {
666
- var result = data[key];
667
- return result === HASH_UNDEFINED$2 ? void 0 : result;
668
- }
669
- return hasOwnProperty$5.call(data, key) ? data[key] : void 0;
670
- }
671
- var objectProto$5 = Object.prototype;
672
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
673
- function hashHas(key) {
674
- var data = this.__data__;
675
- return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$4.call(data, key);
676
- }
677
- var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
678
- function hashSet(key, value) {
679
- var data = this.__data__;
680
- this.size += this.has(key) ? 0 : 1;
681
- data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED$1 : value;
682
- return this;
683
- }
684
- function Hash(entries) {
685
- var index2 = -1, length = entries == null ? 0 : entries.length;
686
- this.clear();
687
- while (++index2 < length) {
688
- var entry = entries[index2];
689
- this.set(entry[0], entry[1]);
690
- }
691
- }
692
- Hash.prototype.clear = hashClear;
693
- Hash.prototype["delete"] = hashDelete;
694
- Hash.prototype.get = hashGet;
695
- Hash.prototype.has = hashHas;
696
- Hash.prototype.set = hashSet;
697
- function listCacheClear() {
698
- this.__data__ = [];
699
- this.size = 0;
700
- }
701
- function assocIndexOf(array, key) {
702
- var length = array.length;
703
- while (length--) {
704
- if (eq(array[length][0], key)) {
705
- return length;
706
- }
707
- }
708
- return -1;
709
- }
710
- var arrayProto = Array.prototype;
711
- var splice = arrayProto.splice;
712
- function listCacheDelete(key) {
713
- var data = this.__data__, index2 = assocIndexOf(data, key);
714
- if (index2 < 0) {
715
- return false;
716
- }
717
- var lastIndex = data.length - 1;
718
- if (index2 == lastIndex) {
719
- data.pop();
720
- } else {
721
- splice.call(data, index2, 1);
722
- }
723
- --this.size;
724
- return true;
725
- }
726
- function listCacheGet(key) {
727
- var data = this.__data__, index2 = assocIndexOf(data, key);
728
- return index2 < 0 ? void 0 : data[index2][1];
729
- }
730
- function listCacheHas(key) {
731
- return assocIndexOf(this.__data__, key) > -1;
732
- }
733
- function listCacheSet(key, value) {
734
- var data = this.__data__, index2 = assocIndexOf(data, key);
735
- if (index2 < 0) {
736
- ++this.size;
737
- data.push([key, value]);
738
- } else {
739
- data[index2][1] = value;
740
- }
741
- return this;
742
- }
743
- function ListCache(entries) {
744
- var index2 = -1, length = entries == null ? 0 : entries.length;
745
- this.clear();
746
- while (++index2 < length) {
747
- var entry = entries[index2];
748
- this.set(entry[0], entry[1]);
749
- }
750
- }
751
- ListCache.prototype.clear = listCacheClear;
752
- ListCache.prototype["delete"] = listCacheDelete;
753
- ListCache.prototype.get = listCacheGet;
754
- ListCache.prototype.has = listCacheHas;
755
- ListCache.prototype.set = listCacheSet;
756
- var Map = getNative(root$1, "Map");
757
- var Map$1 = Map;
758
- function mapCacheClear() {
759
- this.size = 0;
760
- this.__data__ = {
761
- "hash": new Hash(),
762
- "map": new (Map$1 || ListCache)(),
763
- "string": new Hash()
764
- };
765
- }
766
- function isKeyable(value) {
767
- var type = typeof value;
768
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
769
- }
770
- function getMapData(map, key) {
771
- var data = map.__data__;
772
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
773
- }
774
- function mapCacheDelete(key) {
775
- var result = getMapData(this, key)["delete"](key);
776
- this.size -= result ? 1 : 0;
777
- return result;
778
- }
779
- function mapCacheGet(key) {
780
- return getMapData(this, key).get(key);
781
- }
782
- function mapCacheHas(key) {
783
- return getMapData(this, key).has(key);
784
- }
785
- function mapCacheSet(key, value) {
786
- var data = getMapData(this, key), size = data.size;
787
- data.set(key, value);
788
- this.size += data.size == size ? 0 : 1;
789
- return this;
790
- }
791
- function MapCache(entries) {
792
- var index2 = -1, length = entries == null ? 0 : entries.length;
793
- this.clear();
794
- while (++index2 < length) {
795
- var entry = entries[index2];
796
- this.set(entry[0], entry[1]);
797
- }
798
- }
799
- MapCache.prototype.clear = mapCacheClear;
800
- MapCache.prototype["delete"] = mapCacheDelete;
801
- MapCache.prototype.get = mapCacheGet;
802
- MapCache.prototype.has = mapCacheHas;
803
- MapCache.prototype.set = mapCacheSet;
804
- var FUNC_ERROR_TEXT$2 = "Expected a function";
805
- function memoize(func, resolver) {
806
- if (typeof func != "function" || resolver != null && typeof resolver != "function") {
807
- throw new TypeError(FUNC_ERROR_TEXT$2);
808
- }
809
- var memoized = function() {
810
- var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
811
- if (cache.has(key)) {
812
- return cache.get(key);
813
- }
814
- var result = func.apply(this, args);
815
- memoized.cache = cache.set(key, result) || cache;
816
- return result;
817
- };
818
- memoized.cache = new (memoize.Cache || MapCache)();
819
- return memoized;
820
- }
821
- memoize.Cache = MapCache;
822
- var MAX_MEMOIZE_SIZE = 500;
823
- function memoizeCapped(func) {
824
- var result = memoize(func, function(key) {
825
- if (cache.size === MAX_MEMOIZE_SIZE) {
826
- cache.clear();
827
- }
828
- return key;
829
- });
830
- var cache = result.cache;
831
- return result;
832
- }
833
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
834
- var reEscapeChar = /\\(\\)?/g;
835
- var stringToPath = memoizeCapped(function(string) {
836
- var result = [];
837
- if (string.charCodeAt(0) === 46) {
838
- result.push("");
839
- }
840
- string.replace(rePropName, function(match, number, quote, subString) {
841
- result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
842
- });
843
- return result;
844
- });
845
- var stringToPath$1 = stringToPath;
846
- function toString(value) {
847
- return value == null ? "" : baseToString(value);
848
- }
849
- function castPath(value, object) {
850
- if (isArray$1(value)) {
851
- return value;
852
- }
853
- return isKey(value, object) ? [value] : stringToPath$1(toString(value));
854
- }
855
- var INFINITY = 1 / 0;
856
- function toKey(value) {
857
- if (typeof value == "string" || isSymbol(value)) {
858
- return value;
859
- }
860
- var result = value + "";
861
- return result == "0" && 1 / value == -INFINITY ? "-0" : result;
862
- }
863
- function baseGet(object, path) {
864
- path = castPath(path, object);
865
- var index2 = 0, length = path.length;
866
- while (object != null && index2 < length) {
867
- object = object[toKey(path[index2++])];
868
- }
869
- return index2 && index2 == length ? object : void 0;
870
- }
871
- function arrayPush(array, values) {
872
- var index2 = -1, length = values.length, offset = array.length;
873
- while (++index2 < length) {
874
- array[offset + index2] = values[index2];
875
- }
876
- return array;
877
- }
878
- var spreadableSymbol = Symbol$2 ? Symbol$2.isConcatSpreadable : void 0;
879
- function isFlattenable(value) {
880
- return isArray$1(value) || isArguments$1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
881
- }
882
- function baseFlatten(array, depth, predicate, isStrict, result) {
883
- var index2 = -1, length = array.length;
884
- predicate || (predicate = isFlattenable);
885
- result || (result = []);
886
- while (++index2 < length) {
887
- var value = array[index2];
888
- if (depth > 0 && predicate(value)) {
889
- if (depth > 1) {
890
- baseFlatten(value, depth - 1, predicate, isStrict, result);
891
- } else {
892
- arrayPush(result, value);
893
- }
894
- } else if (!isStrict) {
895
- result[result.length] = value;
896
- }
897
- }
898
- return result;
899
- }
900
- function flatten(array) {
901
- var length = array == null ? 0 : array.length;
902
- return length ? baseFlatten(array, 1) : [];
903
- }
904
- function flatRest(func) {
905
- return setToString$1(overRest(func, void 0, flatten), func + "");
906
- }
907
- var getPrototype = overArg(Object.getPrototypeOf, Object);
908
- var getPrototype$1 = getPrototype;
909
- var objectTag$3 = "[object Object]";
910
- var funcProto = Function.prototype, objectProto$4 = Object.prototype;
911
- var funcToString = funcProto.toString;
912
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
913
- var objectCtorString = funcToString.call(Object);
914
- function isPlainObject(value) {
915
- if (!isObjectLike(value) || baseGetTag(value) != objectTag$3) {
916
- return false;
917
- }
918
- var proto = getPrototype$1(value);
919
- if (proto === null) {
920
- return true;
921
- }
922
- var Ctor = hasOwnProperty$3.call(proto, "constructor") && proto.constructor;
923
- return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
924
- }
925
- function baseSlice(array, start, end) {
926
- var index2 = -1, length = array.length;
927
- if (start < 0) {
928
- start = -start > length ? 0 : length + start;
929
- }
930
- end = end > length ? length : end;
931
- if (end < 0) {
932
- end += length;
933
- }
934
- length = start > end ? 0 : end - start >>> 0;
935
- start >>>= 0;
936
- var result = Array(length);
937
- while (++index2 < length) {
938
- result[index2] = array[index2 + start];
939
- }
940
- return result;
941
- }
942
- function stackClear() {
943
- this.__data__ = new ListCache();
944
- this.size = 0;
945
- }
946
- function stackDelete(key) {
947
- var data = this.__data__, result = data["delete"](key);
948
- this.size = data.size;
949
- return result;
950
- }
951
- function stackGet(key) {
952
- return this.__data__.get(key);
953
- }
954
- function stackHas(key) {
955
- return this.__data__.has(key);
956
- }
957
- var LARGE_ARRAY_SIZE = 200;
958
- function stackSet(key, value) {
959
- var data = this.__data__;
960
- if (data instanceof ListCache) {
961
- var pairs = data.__data__;
962
- if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
963
- pairs.push([key, value]);
964
- this.size = ++data.size;
965
- return this;
966
- }
967
- data = this.__data__ = new MapCache(pairs);
968
- }
969
- data.set(key, value);
970
- this.size = data.size;
971
- return this;
972
- }
973
- function Stack(entries) {
974
- var data = this.__data__ = new ListCache(entries);
975
- this.size = data.size;
976
- }
977
- Stack.prototype.clear = stackClear;
978
- Stack.prototype["delete"] = stackDelete;
979
- Stack.prototype.get = stackGet;
980
- Stack.prototype.has = stackHas;
981
- Stack.prototype.set = stackSet;
982
- function baseAssign(object, source) {
983
- return object && copyObject(source, keys(source), object);
984
- }
985
- function baseAssignIn(object, source) {
986
- return object && copyObject(source, keysIn(source), object);
987
- }
988
- var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
989
- var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
990
- var moduleExports = freeModule && freeModule.exports === freeExports;
991
- var Buffer2 = moduleExports ? root$1.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
992
- function cloneBuffer(buffer, isDeep) {
993
- if (isDeep) {
994
- return buffer.slice();
995
- }
996
- var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
997
- buffer.copy(result);
998
- return result;
999
- }
1000
- function arrayFilter(array, predicate) {
1001
- var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
1002
- while (++index2 < length) {
1003
- var value = array[index2];
1004
- if (predicate(value, index2, array)) {
1005
- result[resIndex++] = value;
1006
- }
1007
- }
1008
- return result;
1009
- }
1010
- function stubArray() {
1011
- return [];
1012
- }
1013
- var objectProto$3 = Object.prototype;
1014
- var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
1015
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1016
- var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
1017
- if (object == null) {
1018
- return [];
1019
- }
1020
- object = Object(object);
1021
- return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
1022
- return propertyIsEnumerable.call(object, symbol);
1023
- });
1024
- };
1025
- var getSymbols$1 = getSymbols;
1026
- function copySymbols(source, object) {
1027
- return copyObject(source, getSymbols$1(source), object);
1028
- }
1029
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1030
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
1031
- var result = [];
1032
- while (object) {
1033
- arrayPush(result, getSymbols$1(object));
1034
- object = getPrototype$1(object);
1035
- }
1036
- return result;
1037
- };
1038
- var getSymbolsIn$1 = getSymbolsIn;
1039
- function copySymbolsIn(source, object) {
1040
- return copyObject(source, getSymbolsIn$1(source), object);
1041
- }
1042
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1043
- var result = keysFunc(object);
1044
- return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
1045
- }
1046
- function getAllKeys(object) {
1047
- return baseGetAllKeys(object, keys, getSymbols$1);
1048
- }
1049
- function getAllKeysIn(object) {
1050
- return baseGetAllKeys(object, keysIn, getSymbolsIn$1);
1051
- }
1052
- var DataView = getNative(root$1, "DataView");
1053
- var DataView$1 = DataView;
1054
- var Promise$1 = getNative(root$1, "Promise");
1055
- var Promise$2 = Promise$1;
1056
- var Set = getNative(root$1, "Set");
1057
- var Set$1 = Set;
1058
- var mapTag$4 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
1059
- var dataViewTag$3 = "[object DataView]";
1060
- var dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
1061
- var getTag = baseGetTag;
1062
- if (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3 || Map$1 && getTag(new Map$1()) != mapTag$4 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$4 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) {
1063
- getTag = function(value) {
1064
- var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
1065
- if (ctorString) {
1066
- switch (ctorString) {
1067
- case dataViewCtorString:
1068
- return dataViewTag$3;
1069
- case mapCtorString:
1070
- return mapTag$4;
1071
- case promiseCtorString:
1072
- return promiseTag;
1073
- case setCtorString:
1074
- return setTag$4;
1075
- case weakMapCtorString:
1076
- return weakMapTag$1;
1077
- }
1078
- }
1079
- return result;
1080
- };
1081
- }
1082
- var getTag$1 = getTag;
1083
- var objectProto$2 = Object.prototype;
1084
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
1085
- function initCloneArray(array) {
1086
- var length = array.length, result = new array.constructor(length);
1087
- if (length && typeof array[0] == "string" && hasOwnProperty$2.call(array, "index")) {
1088
- result.index = array.index;
1089
- result.input = array.input;
1090
- }
1091
- return result;
1092
- }
1093
- var Uint8Array2 = root$1.Uint8Array;
1094
- var Uint8Array$1 = Uint8Array2;
1095
- function cloneArrayBuffer(arrayBuffer) {
1096
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1097
- new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
1098
- return result;
1099
- }
1100
- function cloneDataView(dataView, isDeep) {
1101
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
1102
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
1103
- }
1104
- var reFlags = /\w*$/;
1105
- function cloneRegExp(regexp) {
1106
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
1107
- result.lastIndex = regexp.lastIndex;
1108
- return result;
1109
- }
1110
- var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
1111
- function cloneSymbol(symbol) {
1112
- return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
1113
- }
1114
- function cloneTypedArray(typedArray, isDeep) {
1115
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1116
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1117
- }
1118
- var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]";
1119
- var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
1120
- function initCloneByTag(object, tag, isDeep) {
1121
- var Ctor = object.constructor;
1122
- switch (tag) {
1123
- case arrayBufferTag$2:
1124
- return cloneArrayBuffer(object);
1125
- case boolTag$2:
1126
- case dateTag$2:
1127
- return new Ctor(+object);
1128
- case dataViewTag$2:
1129
- return cloneDataView(object, isDeep);
1130
- case float32Tag$1:
1131
- case float64Tag$1:
1132
- case int8Tag$1:
1133
- case int16Tag$1:
1134
- case int32Tag$1:
1135
- case uint8Tag$1:
1136
- case uint8ClampedTag$1:
1137
- case uint16Tag$1:
1138
- case uint32Tag$1:
1139
- return cloneTypedArray(object, isDeep);
1140
- case mapTag$3:
1141
- return new Ctor();
1142
- case numberTag$2:
1143
- case stringTag$2:
1144
- return new Ctor(object);
1145
- case regexpTag$2:
1146
- return cloneRegExp(object);
1147
- case setTag$3:
1148
- return new Ctor();
1149
- case symbolTag$2:
1150
- return cloneSymbol(object);
1151
- }
1152
- }
1153
- function initCloneObject(object) {
1154
- return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate$1(getPrototype$1(object)) : {};
1155
- }
1156
- var mapTag$2 = "[object Map]";
1157
- function baseIsMap(value) {
1158
- return isObjectLike(value) && getTag$1(value) == mapTag$2;
1159
- }
1160
- var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
1161
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
1162
- var isMap$1 = isMap;
1163
- var setTag$2 = "[object Set]";
1164
- function baseIsSet(value) {
1165
- return isObjectLike(value) && getTag$1(value) == setTag$2;
1166
- }
1167
- var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet;
1168
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
1169
- var isSet$1 = isSet;
1170
- var CLONE_DEEP_FLAG$2 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$2 = 4;
1171
- var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag$1 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$1 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag = "[object WeakMap]";
1172
- var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
1173
- var cloneableTags = {};
1174
- cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
1175
- cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
1176
- function baseClone(value, bitmask, customizer, key, object, stack) {
1177
- var result, isDeep = bitmask & CLONE_DEEP_FLAG$2, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$2;
1178
- if (customizer) {
1179
- result = object ? customizer(value, key, object, stack) : customizer(value);
1180
- }
1181
- if (result !== void 0) {
1182
- return result;
1183
- }
1184
- if (!isObject(value)) {
1185
- return value;
1186
- }
1187
- var isArr = isArray$1(value);
1188
- if (isArr) {
1189
- result = initCloneArray(value);
1190
- if (!isDeep) {
1191
- return copyArray(value, result);
1192
- }
1193
- } else {
1194
- var tag = getTag$1(value), isFunc = tag == funcTag || tag == genTag;
1195
- if (isBuffer$1(value)) {
1196
- return cloneBuffer(value, isDeep);
1197
- }
1198
- if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object) {
1199
- result = isFlat || isFunc ? {} : initCloneObject(value);
1200
- if (!isDeep) {
1201
- return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
1202
- }
1203
- } else {
1204
- if (!cloneableTags[tag]) {
1205
- return object ? value : {};
1206
- }
1207
- result = initCloneByTag(value, tag, isDeep);
1208
- }
1209
- }
1210
- stack || (stack = new Stack());
1211
- var stacked = stack.get(value);
1212
- if (stacked) {
1213
- return stacked;
1214
- }
1215
- stack.set(value, result);
1216
- if (isSet$1(value)) {
1217
- value.forEach(function(subValue) {
1218
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
1219
- });
1220
- } else if (isMap$1(value)) {
1221
- value.forEach(function(subValue, key2) {
1222
- result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
1223
- });
1224
- }
1225
- var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
1226
- var props = isArr ? void 0 : keysFunc(value);
1227
- arrayEach(props || value, function(subValue, key2) {
1228
- if (props) {
1229
- key2 = subValue;
1230
- subValue = value[key2];
1231
- }
1232
- assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
1233
- });
1234
- return result;
1235
- }
1236
- var CLONE_DEEP_FLAG$1 = 1, CLONE_SYMBOLS_FLAG$1 = 4;
1237
- function cloneDeep(value) {
1238
- return baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1);
1239
- }
1240
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
1241
- function setCacheAdd(value) {
1242
- this.__data__.set(value, HASH_UNDEFINED);
1243
- return this;
1244
- }
1245
- function setCacheHas(value) {
1246
- return this.__data__.has(value);
1247
- }
1248
- function SetCache(values) {
1249
- var index2 = -1, length = values == null ? 0 : values.length;
1250
- this.__data__ = new MapCache();
1251
- while (++index2 < length) {
1252
- this.add(values[index2]);
1253
- }
1254
- }
1255
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
1256
- SetCache.prototype.has = setCacheHas;
1257
- function arraySome(array, predicate) {
1258
- var index2 = -1, length = array == null ? 0 : array.length;
1259
- while (++index2 < length) {
1260
- if (predicate(array[index2], index2, array)) {
1261
- return true;
1262
- }
1263
- }
1264
- return false;
1265
- }
1266
- function cacheHas(cache, key) {
1267
- return cache.has(key);
1268
- }
1269
- var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
1270
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1271
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array.length, othLength = other.length;
1272
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1273
- return false;
1274
- }
1275
- var arrStacked = stack.get(array);
1276
- var othStacked = stack.get(other);
1277
- if (arrStacked && othStacked) {
1278
- return arrStacked == other && othStacked == array;
1279
- }
1280
- var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
1281
- stack.set(array, other);
1282
- stack.set(other, array);
1283
- while (++index2 < arrLength) {
1284
- var arrValue = array[index2], othValue = other[index2];
1285
- if (customizer) {
1286
- var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack) : customizer(arrValue, othValue, index2, array, other, stack);
1287
- }
1288
- if (compared !== void 0) {
1289
- if (compared) {
1290
- continue;
1291
- }
1292
- result = false;
1293
- break;
1294
- }
1295
- if (seen) {
1296
- if (!arraySome(other, function(othValue2, othIndex) {
1297
- if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
1298
- return seen.push(othIndex);
1299
- }
1300
- })) {
1301
- result = false;
1302
- break;
1303
- }
1304
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1305
- result = false;
1306
- break;
1307
- }
1308
- }
1309
- stack["delete"](array);
1310
- stack["delete"](other);
1311
- return result;
1312
- }
1313
- function mapToArray(map) {
1314
- var index2 = -1, result = Array(map.size);
1315
- map.forEach(function(value, key) {
1316
- result[++index2] = [key, value];
1317
- });
1318
- return result;
1319
- }
1320
- function setToArray(set) {
1321
- var index2 = -1, result = Array(set.size);
1322
- set.forEach(function(value) {
1323
- result[++index2] = value;
1324
- });
1325
- return result;
1326
- }
1327
- var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
1328
- var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
1329
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
1330
- var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
1331
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1332
- switch (tag) {
1333
- case dataViewTag:
1334
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
1335
- return false;
1336
- }
1337
- object = object.buffer;
1338
- other = other.buffer;
1339
- case arrayBufferTag:
1340
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
1341
- return false;
1342
- }
1343
- return true;
1344
- case boolTag:
1345
- case dateTag:
1346
- case numberTag:
1347
- return eq(+object, +other);
1348
- case errorTag:
1349
- return object.name == other.name && object.message == other.message;
1350
- case regexpTag:
1351
- case stringTag:
1352
- return object == other + "";
1353
- case mapTag:
1354
- var convert = mapToArray;
1355
- case setTag:
1356
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
1357
- convert || (convert = setToArray);
1358
- if (object.size != other.size && !isPartial) {
1359
- return false;
1360
- }
1361
- var stacked = stack.get(object);
1362
- if (stacked) {
1363
- return stacked == other;
1364
- }
1365
- bitmask |= COMPARE_UNORDERED_FLAG;
1366
- stack.set(object, other);
1367
- var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1368
- stack["delete"](object);
1369
- return result;
1370
- case symbolTag:
1371
- if (symbolValueOf) {
1372
- return symbolValueOf.call(object) == symbolValueOf.call(other);
1373
- }
1374
- }
1375
- return false;
1376
- }
1377
- var COMPARE_PARTIAL_FLAG$1 = 1;
1378
- var objectProto$1 = Object.prototype;
1379
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
1380
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1381
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
1382
- if (objLength != othLength && !isPartial) {
1383
- return false;
1384
- }
1385
- var index2 = objLength;
1386
- while (index2--) {
1387
- var key = objProps[index2];
1388
- if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
1389
- return false;
1390
- }
1391
- }
1392
- var objStacked = stack.get(object);
1393
- var othStacked = stack.get(other);
1394
- if (objStacked && othStacked) {
1395
- return objStacked == other && othStacked == object;
1396
- }
1397
- var result = true;
1398
- stack.set(object, other);
1399
- stack.set(other, object);
1400
- var skipCtor = isPartial;
1401
- while (++index2 < objLength) {
1402
- key = objProps[index2];
1403
- var objValue = object[key], othValue = other[key];
1404
- if (customizer) {
1405
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
1406
- }
1407
- if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
1408
- result = false;
1409
- break;
1410
- }
1411
- skipCtor || (skipCtor = key == "constructor");
1412
- }
1413
- if (result && !skipCtor) {
1414
- var objCtor = object.constructor, othCtor = other.constructor;
1415
- if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
1416
- result = false;
1417
- }
1418
- }
1419
- stack["delete"](object);
1420
- stack["delete"](other);
1421
- return result;
1422
- }
1423
- var COMPARE_PARTIAL_FLAG = 1;
1424
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
1425
- var objectProto = Object.prototype;
1426
- var hasOwnProperty = objectProto.hasOwnProperty;
1427
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
1428
- var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag$1(object), othTag = othIsArr ? arrayTag : getTag$1(other);
1429
- objTag = objTag == argsTag ? objectTag : objTag;
1430
- othTag = othTag == argsTag ? objectTag : othTag;
1431
- var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
1432
- if (isSameTag && isBuffer$1(object)) {
1433
- if (!isBuffer$1(other)) {
1434
- return false;
1435
- }
1436
- objIsArr = true;
1437
- objIsObj = false;
1438
- }
1439
- if (isSameTag && !objIsObj) {
1440
- stack || (stack = new Stack());
1441
- return objIsArr || isTypedArray$1(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
1442
- }
1443
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
1444
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
1445
- if (objIsWrapped || othIsWrapped) {
1446
- var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
1447
- stack || (stack = new Stack());
1448
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
1449
- }
1450
- }
1451
- if (!isSameTag) {
1452
- return false;
1453
- }
1454
- stack || (stack = new Stack());
1455
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
1456
- }
1457
- function baseIsEqual(value, other, bitmask, customizer, stack) {
1458
- if (value === other) {
1459
- return true;
1460
- }
1461
- if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
1462
- return value !== value && other !== other;
1463
- }
1464
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
1465
- }
1466
- function createBaseFor(fromRight) {
1467
- return function(object, iteratee, keysFunc) {
1468
- var index2 = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
1469
- while (length--) {
1470
- var key = props[fromRight ? length : ++index2];
1471
- if (iteratee(iterable[key], key, iterable) === false) {
1472
- break;
1473
- }
1474
- }
1475
- return object;
1476
- };
1477
- }
1478
- var baseFor = createBaseFor();
1479
- var baseFor$1 = baseFor;
1480
- var now = function() {
1481
- return root$1.Date.now();
1482
- };
1483
- var now$1 = now;
1484
- var FUNC_ERROR_TEXT$1 = "Expected a function";
1485
- var nativeMax = Math.max, nativeMin = Math.min;
1486
- function debounce(func, wait, options) {
1487
- var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
1488
- if (typeof func != "function") {
1489
- throw new TypeError(FUNC_ERROR_TEXT$1);
1490
- }
1491
- wait = toNumber(wait) || 0;
1492
- if (isObject(options)) {
1493
- leading = !!options.leading;
1494
- maxing = "maxWait" in options;
1495
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
1496
- trailing = "trailing" in options ? !!options.trailing : trailing;
1497
- }
1498
- function invokeFunc(time) {
1499
- var args = lastArgs, thisArg = lastThis;
1500
- lastArgs = lastThis = void 0;
1501
- lastInvokeTime = time;
1502
- result = func.apply(thisArg, args);
1503
- return result;
1504
- }
1505
- function leadingEdge(time) {
1506
- lastInvokeTime = time;
1507
- timerId = setTimeout(timerExpired, wait);
1508
- return leading ? invokeFunc(time) : result;
1509
- }
1510
- function remainingWait(time) {
1511
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
1512
- return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
1513
- }
1514
- function shouldInvoke(time) {
1515
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
1516
- return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
1517
- }
1518
- function timerExpired() {
1519
- var time = now$1();
1520
- if (shouldInvoke(time)) {
1521
- return trailingEdge(time);
1522
- }
1523
- timerId = setTimeout(timerExpired, remainingWait(time));
1524
- }
1525
- function trailingEdge(time) {
1526
- timerId = void 0;
1527
- if (trailing && lastArgs) {
1528
- return invokeFunc(time);
1529
- }
1530
- lastArgs = lastThis = void 0;
1531
- return result;
1532
- }
1533
- function cancel() {
1534
- if (timerId !== void 0) {
1535
- clearTimeout(timerId);
1536
- }
1537
- lastInvokeTime = 0;
1538
- lastArgs = lastCallTime = lastThis = timerId = void 0;
1539
- }
1540
- function flush() {
1541
- return timerId === void 0 ? result : trailingEdge(now$1());
1542
- }
1543
- function debounced() {
1544
- var time = now$1(), isInvoking = shouldInvoke(time);
1545
- lastArgs = arguments;
1546
- lastThis = this;
1547
- lastCallTime = time;
1548
- if (isInvoking) {
1549
- if (timerId === void 0) {
1550
- return leadingEdge(lastCallTime);
1551
- }
1552
- if (maxing) {
1553
- clearTimeout(timerId);
1554
- timerId = setTimeout(timerExpired, wait);
1555
- return invokeFunc(lastCallTime);
1556
- }
1557
- }
1558
- if (timerId === void 0) {
1559
- timerId = setTimeout(timerExpired, wait);
1560
- }
1561
- return result;
1562
- }
1563
- debounced.cancel = cancel;
1564
- debounced.flush = flush;
1565
- return debounced;
1566
- }
1567
- function assignMergeValue(object, key, value) {
1568
- if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
1569
- baseAssignValue(object, key, value);
1570
- }
1571
- }
1572
- function isArrayLikeObject(value) {
1573
- return isObjectLike(value) && isArrayLike(value);
1574
- }
1575
- function safeGet(object, key) {
1576
- if (key === "constructor" && typeof object[key] === "function") {
1577
- return;
1578
- }
1579
- if (key == "__proto__") {
1580
- return;
1581
- }
1582
- return object[key];
1583
- }
1584
- function toPlainObject(value) {
1585
- return copyObject(value, keysIn(value));
1586
- }
1587
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
1588
- var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
1589
- if (stacked) {
1590
- assignMergeValue(object, key, stacked);
1591
- return;
1592
- }
1593
- var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
1594
- var isCommon = newValue === void 0;
1595
- if (isCommon) {
1596
- var isArr = isArray$1(srcValue), isBuff = !isArr && isBuffer$1(srcValue), isTyped = !isArr && !isBuff && isTypedArray$1(srcValue);
1597
- newValue = srcValue;
1598
- if (isArr || isBuff || isTyped) {
1599
- if (isArray$1(objValue)) {
1600
- newValue = objValue;
1601
- } else if (isArrayLikeObject(objValue)) {
1602
- newValue = copyArray(objValue);
1603
- } else if (isBuff) {
1604
- isCommon = false;
1605
- newValue = cloneBuffer(srcValue, true);
1606
- } else if (isTyped) {
1607
- isCommon = false;
1608
- newValue = cloneTypedArray(srcValue, true);
1609
- } else {
1610
- newValue = [];
1611
- }
1612
- } else if (isPlainObject(srcValue) || isArguments$1(srcValue)) {
1613
- newValue = objValue;
1614
- if (isArguments$1(objValue)) {
1615
- newValue = toPlainObject(objValue);
1616
- } else if (!isObject(objValue) || isFunction(objValue)) {
1617
- newValue = initCloneObject(srcValue);
1618
- }
1619
- } else {
1620
- isCommon = false;
1621
- }
1622
- }
1623
- if (isCommon) {
1624
- stack.set(srcValue, newValue);
1625
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
1626
- stack["delete"](srcValue);
1627
- }
1628
- assignMergeValue(object, key, newValue);
1629
- }
1630
- function baseMerge(object, source, srcIndex, customizer, stack) {
1631
- if (object === source) {
1632
- return;
1633
- }
1634
- baseFor$1(source, function(srcValue, key) {
1635
- stack || (stack = new Stack());
1636
- if (isObject(srcValue)) {
1637
- baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
1638
- } else {
1639
- var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
1640
- if (newValue === void 0) {
1641
- newValue = srcValue;
1642
- }
1643
- assignMergeValue(object, key, newValue);
1644
- }
1645
- }, keysIn);
1646
- }
1647
- function last(array) {
1648
- var length = array == null ? 0 : array.length;
1649
- return length ? array[length - 1] : void 0;
1650
- }
1651
- function parent(object, path) {
1652
- return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
1653
- }
1654
- function isEqual(value, other) {
1655
- return baseIsEqual(value, other);
1656
- }
1657
- var merge = createAssigner(function(object, source, srcIndex) {
1658
- baseMerge(object, source, srcIndex);
1659
- });
1660
- var merge$1 = merge;
1661
- function baseUnset(object, path) {
1662
- path = castPath(path, object);
1663
- object = parent(object, path);
1664
- return object == null || delete object[toKey(last(path))];
1665
- }
1666
- function customOmitClone(value) {
1667
- return isPlainObject(value) ? void 0 : value;
1668
- }
1669
- var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
1670
- var omit = flatRest(function(object, paths) {
1671
- var result = {};
1672
- if (object == null) {
1673
- return result;
1674
- }
1675
- var isDeep = false;
1676
- paths = arrayMap(paths, function(path) {
1677
- path = castPath(path, object);
1678
- isDeep || (isDeep = path.length > 1);
1679
- return path;
1680
- });
1681
- copyObject(object, getAllKeysIn(object), result);
1682
- if (isDeep) {
1683
- result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
1684
- }
1685
- var length = paths.length;
1686
- while (length--) {
1687
- baseUnset(result, paths[length]);
1688
- }
1689
- return result;
1690
- });
1691
- var omit$1 = omit;
1692
- var FUNC_ERROR_TEXT = "Expected a function";
1693
- function throttle(func, wait, options) {
1694
- var leading = true, trailing = true;
1695
- if (typeof func != "function") {
1696
- throw new TypeError(FUNC_ERROR_TEXT);
1697
- }
1698
- if (isObject(options)) {
1699
- leading = "leading" in options ? !!options.leading : leading;
1700
- trailing = "trailing" in options ? !!options.trailing : trailing;
1701
- }
1702
- return debounce(func, wait, {
1703
- "leading": leading,
1704
- "maxWait": wait,
1705
- "trailing": trailing
1706
- });
1707
- }
1708
- function useToastConstant() {
1709
- const ANIMATION_NAME2 = "slide-in";
1710
- const ANIMATION_TIME2 = 300;
1711
- const ID_PREFIX2 = "toast-message";
1712
- return {
1713
- ANIMATION_TIME: ANIMATION_TIME2,
1714
- ANIMATION_NAME: ANIMATION_NAME2,
1715
- ID_PREFIX: ID_PREFIX2
1716
- };
1717
- }
1718
- const { ANIMATION_TIME: ANIMATION_TIME$1 } = useToastConstant();
1719
- function useToastEvent() {
1720
- const ctx = getCurrentInstance();
1721
- function onCloseEvent(msg) {
1722
- ctx.emit("closeEvent", msg);
1723
- }
1724
- function onValueChange(msgs) {
1725
- ctx.emit("valueChange", msgs);
1726
- }
1727
- function onHidden() {
1728
- setTimeout(() => {
1729
- var _a, _b;
1730
- return (_b = (_a = ctx.attrs).onHidden) == null ? void 0 : _b.call(_a);
1731
- }, ANIMATION_TIME$1);
1732
- }
1733
- return { onCloseEvent, onValueChange, onHidden };
1734
- }
1735
- function useToastHelper() {
1736
- function severityDelay(msg) {
1737
- switch (msg.severity) {
1738
- case "warn":
1739
- case "error":
1740
- return 1e4;
1741
- default:
1742
- return 5e3;
1743
- }
1744
- }
1745
- return { severityDelay };
1746
- }
1747
- let toastZIndex = 1060;
1748
- function toastIncrease() {
1749
- toastZIndex++;
1750
- }
1751
- const {
1752
- ANIMATION_NAME,
1753
- ANIMATION_TIME,
1754
- ID_PREFIX
1755
- } = useToastConstant();
1756
- var Toast = defineComponent({
1757
- name: "DToast",
1758
- inheritAttrs: false,
1759
- props: toastProps,
1760
- emits: ["closeEvent", "valueChange"],
1761
- setup(props, ctx) {
1762
- const {
1763
- onCloseEvent,
1764
- onHidden,
1765
- onValueChange
1766
- } = useToastEvent();
1767
- const {
1768
- severityDelay
1769
- } = useToastHelper();
1770
- const removeThrottle = throttle(remove, ANIMATION_TIME);
1771
- const messages = ref([]);
1772
- const msgAnimations = ref([]);
1773
- const containerRef = ref();
1774
- const msgItemRefs = ref([]);
1775
- let timestamp = Date.now();
1776
- let timeout;
1777
- const timeoutArr = [];
1778
- const defaultLife = computed(() => {
1779
- if (props.life !== null)
1780
- return props.life;
1781
- if (messages.value.length > 0)
1782
- return severityDelay(messages.value[0]);
1783
- return 5e3;
1784
- });
1785
- watch(() => props.value, (value) => {
1786
- if (value.length === 0)
1787
- return;
1788
- if (hasMsgAnimation()) {
1789
- initValue();
1790
- }
1791
- nextTick(() => {
1792
- initValue(value);
1793
- handleValueChange();
1794
- });
1795
- }, {
1796
- deep: true,
1797
- immediate: true
1798
- });
1799
- watch(messages, (value) => {
1800
- value.length === 0 && msgAnimations.value.length > 0 && (msgAnimations.value = []);
1801
- });
1802
- watch(msgAnimations, (value, oldValue) => {
1803
- oldValue.length > 0 && value.length === 0 && onHidden();
1804
- });
1805
- onUnmounted(() => {
1806
- if (props.sticky) {
1807
- return;
1808
- }
1809
- if (props.lifeMode === "single") {
1810
- timeoutArr.forEach((t) => t && clearTimeout(t));
1811
- } else {
1812
- clearTimeout(timeout);
1813
- }
1814
- });
1815
- function initValue(value = []) {
1816
- const cloneValue = cloneDeep(value);
1817
- messages.value = cloneValue.map((v, i) => merge$1(v, {
1818
- id: `${ID_PREFIX}-${i}`
1819
- }));
1820
- msgAnimations.value = [];
1821
- }
1822
- function handleValueChange() {
1823
- toastIncrease();
1824
- setTimeout(() => {
1825
- messages.value.forEach((msg) => msgAnimations.value.push(msg));
1826
- }, 0);
1827
- if (props.sticky)
1828
- return;
1829
- if (timeout) {
1830
- timeout = clearTimeout(timeout);
1831
- }
1832
- if (timeoutArr.length > 0) {
1833
- timeoutArr.splice(0).forEach((t) => clearTimeout(t));
1834
- }
1835
- timestamp = Date.now();
1836
- if (props.lifeMode === "single") {
1837
- setTimeout(() => {
1838
- messages.value.forEach((msg, i) => {
1839
- timeoutArr[i] = setTimeout(() => singleModeRemove(msg, i), msg.life || severityDelay(msg));
1840
- });
1841
- });
1842
- } else {
1843
- timeout = setTimeout(() => removeAll(), defaultLife.value);
1844
- }
1845
- }
1846
- function singleModeRemove(msg, i) {
1847
- removeMsgAnimation(msg);
1848
- setTimeout(() => {
1849
- onCloseEvent(msg);
1850
- if (hasMsgAnimation()) {
1851
- messages.value.splice(i, 1);
1852
- } else {
1853
- messages.value = [];
1854
- }
1855
- onValueChange(messages.value);
1856
- }, ANIMATION_TIME);
1857
- }
1858
- function interrupt(i) {
1859
- if (!msgAnimations.value.includes(messages.value[i]))
1860
- return;
1861
- if (props.lifeMode === "single") {
1862
- if (timeoutArr[i]) {
1863
- timeoutArr[i] = clearTimeout(timeoutArr[i]);
1864
- }
1865
- } else {
1866
- resetDelay(() => {
1867
- messages.value.forEach((msg, _i) => i !== _i && removeMsgAnimation(msg));
1868
- });
1869
- }
1870
- }
1871
- function resetDelay(fn) {
1872
- if (!props.sticky && timeout) {
1873
- timeout = clearTimeout(timeout);
1874
- const remainTime = defaultLife.value - (Date.now() - timestamp);
1875
- timeout = setTimeout(() => fn(), remainTime);
1876
- }
1877
- }
1878
- function remove(i) {
1879
- if (props.lifeMode === "single" && timeoutArr[i]) {
1880
- timeoutArr[i] = clearTimeout(timeoutArr[i]);
1881
- timeoutArr.splice(i, 1);
1882
- }
1883
- removeMsgAnimation(messages.value[i]);
1884
- setTimeout(() => {
1885
- onCloseEvent(messages.value[i]);
1886
- messages.value.splice(i, 1);
1887
- onValueChange(messages.value);
1888
- if (props.lifeMode === "global") {
1889
- removeReset();
1890
- }
1891
- }, ANIMATION_TIME);
1892
- }
1893
- function removeAll() {
1894
- if (messages.value.length > 0) {
1895
- msgAnimations.value = [];
1896
- setTimeout(() => {
1897
- messages.value.forEach((msg) => onCloseEvent(msg));
1898
- messages.value = [];
1899
- onValueChange(messages.value);
1900
- }, ANIMATION_TIME);
1901
- }
1902
- }
1903
- function removeReset(i, msg) {
1904
- const removed = messages.value.findIndex((_msg) => _msg === msg) === -1;
1905
- if (removed || msg !== void 0 && !msgAnimations.value.includes(msg)) {
1906
- return;
1907
- }
1908
- if (props.lifeMode === "single") {
1909
- const msgLife = msg.life || severityDelay(msg);
1910
- const remainTime = msgLife - (Date.now() - timestamp);
1911
- timeoutArr[i] = setTimeout(() => singleModeRemove(msg, i), remainTime);
1912
- } else {
1913
- resetDelay(() => removeAll());
1914
- }
1915
- }
1916
- function removeIndexThrottle(i) {
1917
- if (i < msgItemRefs.value.length && i > -1) {
1918
- removeThrottle(i);
1919
- }
1920
- }
1921
- function removeMsgThrottle(msg) {
1922
- const ignoreDiffKeys = ["id"];
1923
- const index2 = messages.value.findIndex((_msg) => isEqual(omit$1(_msg, ignoreDiffKeys), omit$1(msg, ignoreDiffKeys)));
1924
- removeIndexThrottle(index2);
1925
- }
1926
- function removeMsgAnimation(msg) {
1927
- msgAnimations.value = msgAnimations.value.filter((_msg) => _msg !== msg);
1928
- }
1929
- function close(params) {
1930
- if (params === void 0) {
1931
- return removeAll();
1932
- }
1933
- if (typeof params === "number") {
1934
- removeIndexThrottle(params);
1935
- } else {
1936
- removeMsgThrottle(params);
1937
- }
1938
- }
1939
- function msgItemRef(i) {
1940
- return msgItemRefs.value[i];
1941
- }
1942
- function hasMsgAnimation() {
1943
- return msgAnimations.value.length > 0;
1944
- }
1945
- return {
1946
- messages,
1947
- msgAnimations,
1948
- containerRef,
1949
- msgItemRefs,
1950
- interrupt,
1951
- removeReset,
1952
- removeThrottle,
1953
- close,
1954
- msgItemRef
1955
- };
1956
- },
1957
- render() {
1958
- const {
1959
- style: extraStyle,
1960
- styleClass: extraClass,
1961
- messages,
1962
- msgAnimations,
1963
- msgItemRefs,
1964
- life,
1965
- interrupt,
1966
- removeReset,
1967
- removeThrottle,
1968
- $attrs,
1969
- $slots
1970
- } = this;
1971
- const prefixCls = "devui-toast";
1972
- const wrapperStyles = [`z-index: ${toastZIndex}`, extraStyle];
1973
- const wrapperCls = [prefixCls, extraClass];
1974
- const msgCls = (msg) => [`${prefixCls}-item-container`, `${prefixCls}-message-${msg.severity}`, {
1975
- [ANIMATION_NAME]: msgAnimations.includes(msg)
1976
- }];
1977
- const showClose = (msg) => !(!msg.summary && life !== null);
1978
- const showImage = (msg) => msg.severity !== "common";
1979
- const showSummary = (msg) => !!msg.summary;
1980
- const showContent = (msg) => !!msg.content;
1981
- const showDetail = (msg) => !showContent(msg) && !!msg.detail;
1982
- const msgContent = (msg) => {
1983
- var _a;
1984
- if (typeof msg.content === "function") {
1985
- return msg.content(msg);
1986
- }
1987
- if ([null, void 0].includes(msg.content)) {
1988
- return null;
1989
- }
1990
- const slotPrefix = "slot:";
1991
- const isSlot = String(msg.content).startsWith(slotPrefix);
1992
- if (isSlot) {
1993
- return (_a = $slots[msg.content.slice(slotPrefix.length)]) == null ? void 0 : _a.call($slots, msg);
1994
- }
1995
- return msg.content;
1996
- };
1997
- return createVNode("div", mergeProps({
1998
- "ref": "containerRef",
1999
- "style": wrapperStyles,
2000
- "class": wrapperCls
2001
- }, $attrs), [messages.map((msg, i) => createVNode("div", {
2002
- "ref": (el) => msgItemRefs[i] = el,
2003
- "key": msg.id,
2004
- "class": msgCls(msg),
2005
- "aria-live": "polite",
2006
- "onMouseenter": () => interrupt(i),
2007
- "onMouseleave": () => removeReset(i, msg)
2008
- }, [createVNode("div", {
2009
- "class": `${prefixCls}-item`
2010
- }, [showClose(msg) ? createVNode(ToastIconClose, {
2011
- "prefixCls": prefixCls,
2012
- "onClick": () => removeThrottle(i)
2013
- }, null) : null, showImage(msg) ? createVNode(ToastImage, {
2014
- "prefixCls": prefixCls,
2015
- "severity": msg.severity
2016
- }, null) : null, createVNode("div", {
2017
- "class": "devui-toast-message"
2018
- }, [showSummary(msg) ? createVNode("span", {
2019
- "class": "devui-toast-title"
2020
- }, [msg.summary]) : null, showContent(msg) ? msgContent(msg) : null, showDetail(msg) ? createVNode("p", {
2021
- "innerHTML": msg.detail
2022
- }, null) : null])])]))]);
2023
- }
2024
- });
2025
- function createToastApp(props) {
2026
- return createApp(Toast, props);
2027
- }
2028
- class ToastService {
2029
- static open(props) {
2030
- let $body = document.body;
2031
- let $div = document.createElement("div");
2032
- $body.appendChild($div);
2033
- let app = createToastApp(__spreadProps(__spreadValues({}, props != null ? props : {}), { onHidden: () => app == null ? void 0 : app.unmount() }));
2034
- let toastInstance = app.mount($div);
2035
- onUnmounted(() => {
2036
- $body.removeChild($div);
2037
- $body = null;
2038
- $div = null;
2039
- app = null;
2040
- toastInstance = null;
2041
- }, toastInstance.$);
2042
- return {
2043
- toastInstance
2044
- };
2045
- }
2046
- }
2047
- Toast.install = function(app) {
2048
- app.component(Toast.name, Toast);
2049
- };
2050
- var index = {
2051
- title: "Toast \u5168\u5C40\u63D0\u793A",
2052
- category: "\u53CD\u9988",
2053
- status: "100%",
2054
- install(app) {
2055
- app.use(Toast);
2056
- app.config.globalProperties.$toastService = ToastService;
2057
- }
2058
- };
2059
- export { Toast, ToastService, index as default };