@dso-toolkit/core 58.3.1 → 59.0.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 (121) hide show
  1. package/dist/cjs/_commonjsHelpers-68cdf74f.js +7 -0
  2. package/dist/cjs/_commonjsHelpers-68cdf74f.js.map +1 -0
  3. package/dist/cjs/dso-alert_5.cjs.entry.js +497 -46
  4. package/dist/cjs/dso-alert_5.cjs.entry.js.map +1 -1
  5. package/dist/cjs/dso-annotation-output_3.cjs.entry.js +6 -2
  6. package/dist/cjs/dso-annotation-output_3.cjs.entry.js.map +1 -1
  7. package/dist/cjs/dso-modal.cjs.entry.js +1 -1
  8. package/dist/cjs/dso-modal.cjs.entry.js.map +1 -1
  9. package/dist/cjs/dso-table.cjs.entry.js +1 -1
  10. package/dist/cjs/dso-table.cjs.entry.js.map +1 -1
  11. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  12. package/dist/cjs/dso-tooltip.cjs.entry.js +1 -1
  13. package/dist/cjs/dso-tooltip.cjs.entry.js.map +1 -1
  14. package/dist/cjs/dsot-document-component-demo.cjs.entry.js +1688 -41
  15. package/dist/cjs/dsot-document-component-demo.cjs.entry.js.map +1 -1
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/collection/collection-manifest.json +1 -1
  18. package/dist/collection/components/document-component/document-component.css +687 -13
  19. package/dist/collection/components/document-component/document-component.js +31 -7
  20. package/dist/collection/components/document-component/document-component.js.map +1 -1
  21. package/dist/collection/components/document-component/document-component.models.js +2 -0
  22. package/dist/collection/components/document-component/document-component.models.js.map +1 -0
  23. package/dist/collection/components/document-component-demo/document-component.demo.css +11 -0
  24. package/dist/collection/components/document-component-demo/document-component.demo.js +235 -0
  25. package/dist/collection/components/document-component-demo/document-component.demo.js.map +1 -0
  26. package/dist/collection/components/modal/modal.css +3 -3
  27. package/dist/collection/components/ozon-content/nodes/al.node.js +24 -7
  28. package/dist/collection/components/ozon-content/nodes/al.node.js.map +1 -1
  29. package/dist/collection/components/ozon-content/nodes/ext-ref.node.js +3 -1
  30. package/dist/collection/components/ozon-content/nodes/ext-ref.node.js.map +1 -1
  31. package/dist/collection/components/ozon-content/nodes/nieuwe-tekst.node.js +1 -1
  32. package/dist/collection/components/ozon-content/nodes/nieuwe-tekst.node.js.map +1 -1
  33. package/dist/collection/components/ozon-content/nodes/opschrift.node.js +9 -1
  34. package/dist/collection/components/ozon-content/nodes/opschrift.node.js.map +1 -1
  35. package/dist/collection/components/ozon-content/nodes/table.node/table.node.js +1 -2
  36. package/dist/collection/components/ozon-content/nodes/table.node/table.node.js.map +1 -1
  37. package/dist/collection/components/ozon-content/nodes/verwijderde-tekst.node.js +1 -1
  38. package/dist/collection/components/ozon-content/nodes/verwijderde-tekst.node.js.map +1 -1
  39. package/dist/collection/components/ozon-content/ozon-content-context.interface.js.map +1 -1
  40. package/dist/collection/components/ozon-content/ozon-content-mapper.js +11 -9
  41. package/dist/collection/components/ozon-content/ozon-content-mapper.js.map +1 -1
  42. package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js.map +1 -1
  43. package/dist/collection/components/ozon-content/ozon-content.css +1100 -35
  44. package/dist/collection/components/ozon-content/ozon-content.interfaces.js.map +1 -1
  45. package/dist/collection/components/ozon-content/ozon-content.js +17 -83
  46. package/dist/collection/components/ozon-content/ozon-content.js.map +1 -1
  47. package/dist/collection/components/table/table.css +669 -97
  48. package/dist/collection/components/tooltip/tooltip.css +0 -8
  49. package/dist/components/document-component.js +6 -2
  50. package/dist/components/document-component.js.map +1 -1
  51. package/dist/components/dso-modal.js +1 -1
  52. package/dist/components/dso-modal.js.map +1 -1
  53. package/dist/components/dso-table.js +1 -1
  54. package/dist/components/dso-table.js.map +1 -1
  55. package/dist/components/dsot-document-component-demo.js +1694 -45
  56. package/dist/components/dsot-document-component-demo.js.map +1 -1
  57. package/dist/components/index.d.ts +1 -1
  58. package/dist/components/ozon-content.js +500 -50
  59. package/dist/components/ozon-content.js.map +1 -1
  60. package/dist/components/tooltip.js +1 -1
  61. package/dist/components/tooltip.js.map +1 -1
  62. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  63. package/dist/dso-toolkit/dso-toolkit.esm.js.map +1 -1
  64. package/dist/dso-toolkit/p-2401e7f9.entry.js +2 -0
  65. package/dist/dso-toolkit/p-2401e7f9.entry.js.map +1 -0
  66. package/dist/dso-toolkit/p-2ab99812.entry.js +2 -0
  67. package/dist/dso-toolkit/{p-a63c82a4.entry.js.map → p-2ab99812.entry.js.map} +1 -1
  68. package/dist/dso-toolkit/p-432df09a.entry.js +2 -0
  69. package/dist/dso-toolkit/p-432df09a.entry.js.map +1 -0
  70. package/dist/dso-toolkit/p-4573c419.js +2 -0
  71. package/dist/dso-toolkit/p-4573c419.js.map +1 -0
  72. package/dist/dso-toolkit/p-47e77e24.entry.js +2 -0
  73. package/dist/dso-toolkit/p-47e77e24.entry.js.map +1 -0
  74. package/dist/dso-toolkit/p-ab1f0511.entry.js +2 -0
  75. package/dist/dso-toolkit/p-ab1f0511.entry.js.map +1 -0
  76. package/dist/dso-toolkit/p-ad44136d.entry.js +2 -0
  77. package/dist/dso-toolkit/p-ad44136d.entry.js.map +1 -0
  78. package/dist/esm/_commonjsHelpers-1c8beb5f.js +5 -0
  79. package/dist/esm/_commonjsHelpers-1c8beb5f.js.map +1 -0
  80. package/dist/esm/dso-alert_5.entry.js +498 -47
  81. package/dist/esm/dso-alert_5.entry.js.map +1 -1
  82. package/dist/esm/dso-annotation-output_3.entry.js +6 -2
  83. package/dist/esm/dso-annotation-output_3.entry.js.map +1 -1
  84. package/dist/esm/dso-modal.entry.js +1 -1
  85. package/dist/esm/dso-modal.entry.js.map +1 -1
  86. package/dist/esm/dso-table.entry.js +1 -1
  87. package/dist/esm/dso-table.entry.js.map +1 -1
  88. package/dist/esm/dso-toolkit.js +1 -1
  89. package/dist/esm/dso-tooltip.entry.js +1 -1
  90. package/dist/esm/dso-tooltip.entry.js.map +1 -1
  91. package/dist/esm/dsot-document-component-demo.entry.js +1689 -42
  92. package/dist/esm/dsot-document-component-demo.entry.js.map +1 -1
  93. package/dist/esm/loader.js +1 -1
  94. package/dist/types/components/document-component/document-component.d.ts +6 -1
  95. package/dist/types/components/document-component/document-component.models.d.ts +14 -0
  96. package/dist/types/components/document-component-demo/document-component.demo.d.ts +64 -0
  97. package/dist/types/components/ozon-content/nodes/al.node.d.ts +1 -1
  98. package/dist/types/components/ozon-content/ozon-content-context.interface.d.ts +3 -2
  99. package/dist/types/components/ozon-content/ozon-content-mapper.d.ts +0 -1
  100. package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +3 -2
  101. package/dist/types/components/ozon-content/ozon-content.d.ts +4 -25
  102. package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +1 -4
  103. package/dist/types/components.d.ts +41 -25
  104. package/package.json +8 -2
  105. package/dist/collection/components/document-component/document-component.demo.js +0 -112
  106. package/dist/collection/components/document-component/document-component.demo.js.map +0 -1
  107. package/dist/collection/components/document-component/document-component.types.js +0 -2
  108. package/dist/collection/components/document-component/document-component.types.js.map +0 -1
  109. package/dist/dso-toolkit/p-42ba2c81.entry.js +0 -2
  110. package/dist/dso-toolkit/p-42ba2c81.entry.js.map +0 -1
  111. package/dist/dso-toolkit/p-48d76094.entry.js +0 -2
  112. package/dist/dso-toolkit/p-48d76094.entry.js.map +0 -1
  113. package/dist/dso-toolkit/p-5c5e43d3.entry.js +0 -2
  114. package/dist/dso-toolkit/p-5c5e43d3.entry.js.map +0 -1
  115. package/dist/dso-toolkit/p-8af61320.entry.js +0 -2
  116. package/dist/dso-toolkit/p-8af61320.entry.js.map +0 -1
  117. package/dist/dso-toolkit/p-9a3f154b.entry.js +0 -2
  118. package/dist/dso-toolkit/p-9a3f154b.entry.js.map +0 -1
  119. package/dist/dso-toolkit/p-a63c82a4.entry.js +0 -2
  120. package/dist/types/components/document-component/document-component.demo.d.ts +0 -40
  121. package/dist/types/components/document-component/document-component.types.d.ts +0 -8
@@ -1,4 +1,5 @@
1
- import { proxyCustomElement, HTMLElement, h, Fragment } from '@stencil/core/internal/client';
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { c as commonjsGlobal, d as defineCustomElement$5 } from './ozon-content.js';
2
3
  import { d as defineCustomElement$d } from './alert.js';
3
4
  import { d as defineCustomElement$c } from './annotation-button.js';
4
5
  import { d as defineCustomElement$b } from './annotation-output.js';
@@ -7,70 +8,1706 @@ import { d as defineCustomElement$9 } from './document-component.js';
7
8
  import { d as defineCustomElement$8 } from './expandable.js';
8
9
  import { d as defineCustomElement$7 } from './icon.js';
9
10
  import { d as defineCustomElement$6 } from './label.js';
10
- import { d as defineCustomElement$5 } from './ozon-content.js';
11
11
  import { d as defineCustomElement$4 } from './responsive-element.js';
12
12
  import { d as defineCustomElement$3 } from './slide-toggle.js';
13
13
  import { d as defineCustomElement$2 } from './tooltip.js';
14
14
 
15
+ /**
16
+ * lodash (Custom Build) <https://lodash.com/>
17
+ * Build: `lodash modularize exports="npm" -o ./`
18
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
19
+ * Released under MIT license <https://lodash.com/license>
20
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
21
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
22
+ */
23
+
24
+ /** Used as references for various `Number` constants. */
25
+ var INFINITY$1 = 1 / 0,
26
+ MAX_SAFE_INTEGER$1 = 9007199254740991,
27
+ MAX_INTEGER$1 = 1.7976931348623157e+308,
28
+ NAN$1 = 0 / 0;
29
+
30
+ /** `Object#toString` result references. */
31
+ var argsTag = '[object Arguments]',
32
+ funcTag$1 = '[object Function]',
33
+ genTag$1 = '[object GeneratorFunction]',
34
+ mapTag = '[object Map]',
35
+ objectTag = '[object Object]',
36
+ promiseTag = '[object Promise]',
37
+ setTag = '[object Set]',
38
+ stringTag = '[object String]',
39
+ symbolTag$1 = '[object Symbol]',
40
+ weakMapTag = '[object WeakMap]';
41
+
42
+ var dataViewTag = '[object DataView]';
43
+
44
+ /**
45
+ * Used to match `RegExp`
46
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
47
+ */
48
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
49
+
50
+ /** Used to match leading and trailing whitespace. */
51
+ var reTrim$1 = /^\s+|\s+$/g;
52
+
53
+ /** Used to detect bad signed hexadecimal string values. */
54
+ var reIsBadHex$1 = /^[-+]0x[0-9a-f]+$/i;
55
+
56
+ /** Used to detect binary string values. */
57
+ var reIsBinary$1 = /^0b[01]+$/i;
58
+
59
+ /** Used to detect host constructors (Safari). */
60
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
61
+
62
+ /** Used to detect octal string values. */
63
+ var reIsOctal$1 = /^0o[0-7]+$/i;
64
+
65
+ /** Used to detect unsigned integer values. */
66
+ var reIsUint$1 = /^(?:0|[1-9]\d*)$/;
67
+
68
+ /** Used to compose unicode character classes. */
69
+ var rsAstralRange = '\\ud800-\\udfff',
70
+ rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
71
+ rsComboSymbolsRange = '\\u20d0-\\u20f0',
72
+ rsVarRange = '\\ufe0e\\ufe0f';
73
+
74
+ /** Used to compose unicode capture groups. */
75
+ var rsAstral = '[' + rsAstralRange + ']',
76
+ rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
77
+ rsFitz = '\\ud83c[\\udffb-\\udfff]',
78
+ rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
79
+ rsNonAstral = '[^' + rsAstralRange + ']',
80
+ rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
81
+ rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
82
+ rsZWJ = '\\u200d';
83
+
84
+ /** Used to compose unicode regexes. */
85
+ var reOptMod = rsModifier + '?',
86
+ rsOptVar = '[' + rsVarRange + ']?',
87
+ rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
88
+ rsSeq = rsOptVar + reOptMod + rsOptJoin,
89
+ rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
90
+
91
+ /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
92
+ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
93
+
94
+ /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
95
+ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
96
+
97
+ /** Built-in method references without a dependency on `root`. */
98
+ var freeParseInt$1 = parseInt;
99
+
100
+ /** Detect free variable `global` from Node.js. */
101
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
102
+
103
+ /** Detect free variable `self`. */
104
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
105
+
106
+ /** Used as a reference to the global object. */
107
+ var root = freeGlobal || freeSelf || Function('return this')();
108
+
109
+ /**
110
+ * A specialized version of `_.map` for arrays without support for iteratee
111
+ * shorthands.
112
+ *
113
+ * @private
114
+ * @param {Array} [array] The array to iterate over.
115
+ * @param {Function} iteratee The function invoked per iteration.
116
+ * @returns {Array} Returns the new mapped array.
117
+ */
118
+ function arrayMap(array, iteratee) {
119
+ var index = -1,
120
+ length = array ? array.length : 0,
121
+ result = Array(length);
122
+
123
+ while (++index < length) {
124
+ result[index] = iteratee(array[index], index, array);
125
+ }
126
+ return result;
127
+ }
128
+
129
+ /**
130
+ * Converts an ASCII `string` to an array.
131
+ *
132
+ * @private
133
+ * @param {string} string The string to convert.
134
+ * @returns {Array} Returns the converted array.
135
+ */
136
+ function asciiToArray(string) {
137
+ return string.split('');
138
+ }
139
+
140
+ /**
141
+ * The base implementation of `_.times` without support for iteratee shorthands
142
+ * or max array length checks.
143
+ *
144
+ * @private
145
+ * @param {number} n The number of times to invoke `iteratee`.
146
+ * @param {Function} iteratee The function invoked per iteration.
147
+ * @returns {Array} Returns the array of results.
148
+ */
149
+ function baseTimes(n, iteratee) {
150
+ var index = -1,
151
+ result = Array(n);
152
+
153
+ while (++index < n) {
154
+ result[index] = iteratee(index);
155
+ }
156
+ return result;
157
+ }
158
+
159
+ /**
160
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
161
+ * array of `object` property values corresponding to the property names
162
+ * of `props`.
163
+ *
164
+ * @private
165
+ * @param {Object} object The object to query.
166
+ * @param {Array} props The property names to get values for.
167
+ * @returns {Object} Returns the array of property values.
168
+ */
169
+ function baseValues(object, props) {
170
+ return arrayMap(props, function(key) {
171
+ return object[key];
172
+ });
173
+ }
174
+
175
+ /**
176
+ * Gets the value at `key` of `object`.
177
+ *
178
+ * @private
179
+ * @param {Object} [object] The object to query.
180
+ * @param {string} key The key of the property to get.
181
+ * @returns {*} Returns the property value.
182
+ */
183
+ function getValue(object, key) {
184
+ return object == null ? undefined : object[key];
185
+ }
186
+
187
+ /**
188
+ * Checks if `string` contains Unicode symbols.
189
+ *
190
+ * @private
191
+ * @param {string} string The string to inspect.
192
+ * @returns {boolean} Returns `true` if a symbol is found, else `false`.
193
+ */
194
+ function hasUnicode(string) {
195
+ return reHasUnicode.test(string);
196
+ }
197
+
198
+ /**
199
+ * Checks if `value` is a host object in IE < 9.
200
+ *
201
+ * @private
202
+ * @param {*} value The value to check.
203
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
204
+ */
205
+ function isHostObject(value) {
206
+ // Many host objects are `Object` objects that can coerce to strings
207
+ // despite having improperly defined `toString` methods.
208
+ var result = false;
209
+ if (value != null && typeof value.toString != 'function') {
210
+ try {
211
+ result = !!(value + '');
212
+ } catch (e) {}
213
+ }
214
+ return result;
215
+ }
216
+
217
+ /**
218
+ * Converts `iterator` to an array.
219
+ *
220
+ * @private
221
+ * @param {Object} iterator The iterator to convert.
222
+ * @returns {Array} Returns the converted array.
223
+ */
224
+ function iteratorToArray(iterator) {
225
+ var data,
226
+ result = [];
227
+
228
+ while (!(data = iterator.next()).done) {
229
+ result.push(data.value);
230
+ }
231
+ return result;
232
+ }
233
+
234
+ /**
235
+ * Converts `map` to its key-value pairs.
236
+ *
237
+ * @private
238
+ * @param {Object} map The map to convert.
239
+ * @returns {Array} Returns the key-value pairs.
240
+ */
241
+ function mapToArray(map) {
242
+ var index = -1,
243
+ result = Array(map.size);
244
+
245
+ map.forEach(function(value, key) {
246
+ result[++index] = [key, value];
247
+ });
248
+ return result;
249
+ }
250
+
251
+ /**
252
+ * Creates a unary function that invokes `func` with its argument transformed.
253
+ *
254
+ * @private
255
+ * @param {Function} func The function to wrap.
256
+ * @param {Function} transform The argument transform.
257
+ * @returns {Function} Returns the new function.
258
+ */
259
+ function overArg(func, transform) {
260
+ return function(arg) {
261
+ return func(transform(arg));
262
+ };
263
+ }
264
+
265
+ /**
266
+ * Converts `set` to an array of its values.
267
+ *
268
+ * @private
269
+ * @param {Object} set The set to convert.
270
+ * @returns {Array} Returns the values.
271
+ */
272
+ function setToArray(set) {
273
+ var index = -1,
274
+ result = Array(set.size);
275
+
276
+ set.forEach(function(value) {
277
+ result[++index] = value;
278
+ });
279
+ return result;
280
+ }
281
+
282
+ /**
283
+ * Converts `string` to an array.
284
+ *
285
+ * @private
286
+ * @param {string} string The string to convert.
287
+ * @returns {Array} Returns the converted array.
288
+ */
289
+ function stringToArray(string) {
290
+ return hasUnicode(string)
291
+ ? unicodeToArray(string)
292
+ : asciiToArray(string);
293
+ }
294
+
295
+ /**
296
+ * Converts a Unicode `string` to an array.
297
+ *
298
+ * @private
299
+ * @param {string} string The string to convert.
300
+ * @returns {Array} Returns the converted array.
301
+ */
302
+ function unicodeToArray(string) {
303
+ return string.match(reUnicode) || [];
304
+ }
305
+
306
+ /** Used for built-in method references. */
307
+ var funcProto = Function.prototype,
308
+ objectProto$1 = Object.prototype;
309
+
310
+ /** Used to detect overreaching core-js shims. */
311
+ var coreJsData = root['__core-js_shared__'];
312
+
313
+ /** Used to detect methods masquerading as native. */
314
+ var maskSrcKey = (function() {
315
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
316
+ return uid ? ('Symbol(src)_1.' + uid) : '';
317
+ }());
318
+
319
+ /** Used to resolve the decompiled source of functions. */
320
+ var funcToString = funcProto.toString;
321
+
322
+ /** Used to check objects for own properties. */
323
+ var hasOwnProperty = objectProto$1.hasOwnProperty;
324
+
325
+ /**
326
+ * Used to resolve the
327
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
328
+ * of values.
329
+ */
330
+ var objectToString$1 = objectProto$1.toString;
331
+
332
+ /** Used to detect if a method is native. */
333
+ var reIsNative = RegExp('^' +
334
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
335
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
336
+ );
337
+
338
+ /** Built-in value references. */
339
+ var Symbol = root.Symbol,
340
+ iteratorSymbol = Symbol ? Symbol.iterator : undefined,
341
+ propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
342
+
343
+ /* Built-in method references for those with the same name as other `lodash` methods. */
344
+ var nativeFloor$1 = Math.floor,
345
+ nativeKeys = overArg(Object.keys, Object),
346
+ nativeRandom$1 = Math.random;
347
+
348
+ /* Built-in method references that are verified to be native. */
349
+ var DataView = getNative(root, 'DataView'),
350
+ Map = getNative(root, 'Map'),
351
+ Promise$1 = getNative(root, 'Promise'),
352
+ Set = getNative(root, 'Set'),
353
+ WeakMap = getNative(root, 'WeakMap');
354
+
355
+ /** Used to detect maps, sets, and weakmaps. */
356
+ var dataViewCtorString = toSource(DataView),
357
+ mapCtorString = toSource(Map),
358
+ promiseCtorString = toSource(Promise$1),
359
+ setCtorString = toSource(Set),
360
+ weakMapCtorString = toSource(WeakMap);
361
+
362
+ /**
363
+ * Creates an array of the enumerable property names of the array-like `value`.
364
+ *
365
+ * @private
366
+ * @param {*} value The value to query.
367
+ * @param {boolean} inherited Specify returning inherited property names.
368
+ * @returns {Array} Returns the array of property names.
369
+ */
370
+ function arrayLikeKeys(value, inherited) {
371
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
372
+ // Safari 9 makes `arguments.length` enumerable in strict mode.
373
+ var result = (isArray(value) || isArguments(value))
374
+ ? baseTimes(value.length, String)
375
+ : [];
376
+
377
+ var length = result.length,
378
+ skipIndexes = !!length;
379
+
380
+ for (var key in value) {
381
+ if ((inherited || hasOwnProperty.call(value, key)) &&
382
+ !(skipIndexes && (key == 'length' || isIndex$1(key, length)))) {
383
+ result.push(key);
384
+ }
385
+ }
386
+ return result;
387
+ }
388
+
389
+ /**
390
+ * The base implementation of `_.clamp` which doesn't coerce arguments.
391
+ *
392
+ * @private
393
+ * @param {number} number The number to clamp.
394
+ * @param {number} [lower] The lower bound.
395
+ * @param {number} upper The upper bound.
396
+ * @returns {number} Returns the clamped number.
397
+ */
398
+ function baseClamp(number, lower, upper) {
399
+ if (number === number) {
400
+ if (upper !== undefined) {
401
+ number = number <= upper ? number : upper;
402
+ }
403
+ if (lower !== undefined) {
404
+ number = number >= lower ? number : lower;
405
+ }
406
+ }
407
+ return number;
408
+ }
409
+
410
+ /**
411
+ * The base implementation of `getTag`.
412
+ *
413
+ * @private
414
+ * @param {*} value The value to query.
415
+ * @returns {string} Returns the `toStringTag`.
416
+ */
417
+ function baseGetTag(value) {
418
+ return objectToString$1.call(value);
419
+ }
420
+
421
+ /**
422
+ * The base implementation of `_.isNative` without bad shim checks.
423
+ *
424
+ * @private
425
+ * @param {*} value The value to check.
426
+ * @returns {boolean} Returns `true` if `value` is a native function,
427
+ * else `false`.
428
+ */
429
+ function baseIsNative(value) {
430
+ if (!isObject$1(value) || isMasked(value)) {
431
+ return false;
432
+ }
433
+ var pattern = (isFunction$1(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
434
+ return pattern.test(toSource(value));
435
+ }
436
+
437
+ /**
438
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
439
+ *
440
+ * @private
441
+ * @param {Object} object The object to query.
442
+ * @returns {Array} Returns the array of property names.
443
+ */
444
+ function baseKeys(object) {
445
+ if (!isPrototype(object)) {
446
+ return nativeKeys(object);
447
+ }
448
+ var result = [];
449
+ for (var key in Object(object)) {
450
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
451
+ result.push(key);
452
+ }
453
+ }
454
+ return result;
455
+ }
456
+
457
+ /**
458
+ * The base implementation of `_.random` without support for returning
459
+ * floating-point numbers.
460
+ *
461
+ * @private
462
+ * @param {number} lower The lower bound.
463
+ * @param {number} upper The upper bound.
464
+ * @returns {number} Returns the random number.
465
+ */
466
+ function baseRandom$1(lower, upper) {
467
+ return lower + nativeFloor$1(nativeRandom$1() * (upper - lower + 1));
468
+ }
469
+
470
+ /**
471
+ * Copies the values of `source` to `array`.
472
+ *
473
+ * @private
474
+ * @param {Array} source The array to copy values from.
475
+ * @param {Array} [array=[]] The array to copy values to.
476
+ * @returns {Array} Returns `array`.
477
+ */
478
+ function copyArray(source, array) {
479
+ var index = -1,
480
+ length = source.length;
481
+
482
+ array || (array = Array(length));
483
+ while (++index < length) {
484
+ array[index] = source[index];
485
+ }
486
+ return array;
487
+ }
488
+
489
+ /**
490
+ * Gets the native function at `key` of `object`.
491
+ *
492
+ * @private
493
+ * @param {Object} object The object to query.
494
+ * @param {string} key The key of the method to get.
495
+ * @returns {*} Returns the function if it's native, else `undefined`.
496
+ */
497
+ function getNative(object, key) {
498
+ var value = getValue(object, key);
499
+ return baseIsNative(value) ? value : undefined;
500
+ }
501
+
502
+ /**
503
+ * Gets the `toStringTag` of `value`.
504
+ *
505
+ * @private
506
+ * @param {*} value The value to query.
507
+ * @returns {string} Returns the `toStringTag`.
508
+ */
509
+ var getTag = baseGetTag;
510
+
511
+ // Fallback for data views, maps, sets, and weak maps in IE 11,
512
+ // for data views in Edge < 14, and promises in Node.js.
513
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
514
+ (Map && getTag(new Map) != mapTag) ||
515
+ (Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
516
+ (Set && getTag(new Set) != setTag) ||
517
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
518
+ getTag = function(value) {
519
+ var result = objectToString$1.call(value),
520
+ Ctor = result == objectTag ? value.constructor : undefined,
521
+ ctorString = Ctor ? toSource(Ctor) : undefined;
522
+
523
+ if (ctorString) {
524
+ switch (ctorString) {
525
+ case dataViewCtorString: return dataViewTag;
526
+ case mapCtorString: return mapTag;
527
+ case promiseCtorString: return promiseTag;
528
+ case setCtorString: return setTag;
529
+ case weakMapCtorString: return weakMapTag;
530
+ }
531
+ }
532
+ return result;
533
+ };
534
+ }
535
+
536
+ /**
537
+ * Checks if `value` is a valid array-like index.
538
+ *
539
+ * @private
540
+ * @param {*} value The value to check.
541
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
542
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
543
+ */
544
+ function isIndex$1(value, length) {
545
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
546
+ return !!length &&
547
+ (typeof value == 'number' || reIsUint$1.test(value)) &&
548
+ (value > -1 && value % 1 == 0 && value < length);
549
+ }
550
+
551
+ /**
552
+ * Checks if the given arguments are from an iteratee call.
553
+ *
554
+ * @private
555
+ * @param {*} value The potential iteratee value argument.
556
+ * @param {*} index The potential iteratee index or key argument.
557
+ * @param {*} object The potential iteratee object argument.
558
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
559
+ * else `false`.
560
+ */
561
+ function isIterateeCall$1(value, index, object) {
562
+ if (!isObject$1(object)) {
563
+ return false;
564
+ }
565
+ var type = typeof index;
566
+ if (type == 'number'
567
+ ? (isArrayLike$1(object) && isIndex$1(index, object.length))
568
+ : (type == 'string' && index in object)
569
+ ) {
570
+ return eq$1(object[index], value);
571
+ }
572
+ return false;
573
+ }
574
+
575
+ /**
576
+ * Checks if `func` has its source masked.
577
+ *
578
+ * @private
579
+ * @param {Function} func The function to check.
580
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
581
+ */
582
+ function isMasked(func) {
583
+ return !!maskSrcKey && (maskSrcKey in func);
584
+ }
585
+
586
+ /**
587
+ * Checks if `value` is likely a prototype object.
588
+ *
589
+ * @private
590
+ * @param {*} value The value to check.
591
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
592
+ */
593
+ function isPrototype(value) {
594
+ var Ctor = value && value.constructor,
595
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$1;
596
+
597
+ return value === proto;
598
+ }
599
+
600
+ /**
601
+ * Converts `func` to its source code.
602
+ *
603
+ * @private
604
+ * @param {Function} func The function to process.
605
+ * @returns {string} Returns the source code.
606
+ */
607
+ function toSource(func) {
608
+ if (func != null) {
609
+ try {
610
+ return funcToString.call(func);
611
+ } catch (e) {}
612
+ try {
613
+ return (func + '');
614
+ } catch (e) {}
615
+ }
616
+ return '';
617
+ }
618
+
619
+ /**
620
+ * Gets `n` random elements at unique keys from `collection` up to the
621
+ * size of `collection`.
622
+ *
623
+ * @static
624
+ * @memberOf _
625
+ * @since 4.0.0
626
+ * @category Collection
627
+ * @param {Array|Object} collection The collection to sample.
628
+ * @param {number} [n=1] The number of elements to sample.
629
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
630
+ * @returns {Array} Returns the random elements.
631
+ * @example
632
+ *
633
+ * _.sampleSize([1, 2, 3], 2);
634
+ * // => [3, 1]
635
+ *
636
+ * _.sampleSize([1, 2, 3], 4);
637
+ * // => [2, 3, 1]
638
+ */
639
+ function sampleSize(collection, n, guard) {
640
+ var index = -1,
641
+ result = toArray(collection),
642
+ length = result.length,
643
+ lastIndex = length - 1;
644
+
645
+ if ((guard ? isIterateeCall$1(collection, n, guard) : n === undefined)) {
646
+ n = 1;
647
+ } else {
648
+ n = baseClamp(toInteger(n), 0, length);
649
+ }
650
+ while (++index < n) {
651
+ var rand = baseRandom$1(index, lastIndex),
652
+ value = result[rand];
653
+
654
+ result[rand] = result[index];
655
+ result[index] = value;
656
+ }
657
+ result.length = n;
658
+ return result;
659
+ }
660
+
661
+ /**
662
+ * Performs a
663
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
664
+ * comparison between two values to determine if they are equivalent.
665
+ *
666
+ * @static
667
+ * @memberOf _
668
+ * @since 4.0.0
669
+ * @category Lang
670
+ * @param {*} value The value to compare.
671
+ * @param {*} other The other value to compare.
672
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
673
+ * @example
674
+ *
675
+ * var object = { 'a': 1 };
676
+ * var other = { 'a': 1 };
677
+ *
678
+ * _.eq(object, object);
679
+ * // => true
680
+ *
681
+ * _.eq(object, other);
682
+ * // => false
683
+ *
684
+ * _.eq('a', 'a');
685
+ * // => true
686
+ *
687
+ * _.eq('a', Object('a'));
688
+ * // => false
689
+ *
690
+ * _.eq(NaN, NaN);
691
+ * // => true
692
+ */
693
+ function eq$1(value, other) {
694
+ return value === other || (value !== value && other !== other);
695
+ }
696
+
697
+ /**
698
+ * Checks if `value` is likely an `arguments` object.
699
+ *
700
+ * @static
701
+ * @memberOf _
702
+ * @since 0.1.0
703
+ * @category Lang
704
+ * @param {*} value The value to check.
705
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
706
+ * else `false`.
707
+ * @example
708
+ *
709
+ * _.isArguments(function() { return arguments; }());
710
+ * // => true
711
+ *
712
+ * _.isArguments([1, 2, 3]);
713
+ * // => false
714
+ */
715
+ function isArguments(value) {
716
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
717
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
718
+ (!propertyIsEnumerable.call(value, 'callee') || objectToString$1.call(value) == argsTag);
719
+ }
720
+
721
+ /**
722
+ * Checks if `value` is classified as an `Array` object.
723
+ *
724
+ * @static
725
+ * @memberOf _
726
+ * @since 0.1.0
727
+ * @category Lang
728
+ * @param {*} value The value to check.
729
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
730
+ * @example
731
+ *
732
+ * _.isArray([1, 2, 3]);
733
+ * // => true
734
+ *
735
+ * _.isArray(document.body.children);
736
+ * // => false
737
+ *
738
+ * _.isArray('abc');
739
+ * // => false
740
+ *
741
+ * _.isArray(_.noop);
742
+ * // => false
743
+ */
744
+ var isArray = Array.isArray;
745
+
746
+ /**
747
+ * Checks if `value` is array-like. A value is considered array-like if it's
748
+ * not a function and has a `value.length` that's an integer greater than or
749
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
750
+ *
751
+ * @static
752
+ * @memberOf _
753
+ * @since 4.0.0
754
+ * @category Lang
755
+ * @param {*} value The value to check.
756
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
757
+ * @example
758
+ *
759
+ * _.isArrayLike([1, 2, 3]);
760
+ * // => true
761
+ *
762
+ * _.isArrayLike(document.body.children);
763
+ * // => true
764
+ *
765
+ * _.isArrayLike('abc');
766
+ * // => true
767
+ *
768
+ * _.isArrayLike(_.noop);
769
+ * // => false
770
+ */
771
+ function isArrayLike$1(value) {
772
+ return value != null && isLength$1(value.length) && !isFunction$1(value);
773
+ }
774
+
775
+ /**
776
+ * This method is like `_.isArrayLike` except that it also checks if `value`
777
+ * is an object.
778
+ *
779
+ * @static
780
+ * @memberOf _
781
+ * @since 4.0.0
782
+ * @category Lang
783
+ * @param {*} value The value to check.
784
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
785
+ * else `false`.
786
+ * @example
787
+ *
788
+ * _.isArrayLikeObject([1, 2, 3]);
789
+ * // => true
790
+ *
791
+ * _.isArrayLikeObject(document.body.children);
792
+ * // => true
793
+ *
794
+ * _.isArrayLikeObject('abc');
795
+ * // => false
796
+ *
797
+ * _.isArrayLikeObject(_.noop);
798
+ * // => false
799
+ */
800
+ function isArrayLikeObject(value) {
801
+ return isObjectLike$1(value) && isArrayLike$1(value);
802
+ }
803
+
804
+ /**
805
+ * Checks if `value` is classified as a `Function` object.
806
+ *
807
+ * @static
808
+ * @memberOf _
809
+ * @since 0.1.0
810
+ * @category Lang
811
+ * @param {*} value The value to check.
812
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
813
+ * @example
814
+ *
815
+ * _.isFunction(_);
816
+ * // => true
817
+ *
818
+ * _.isFunction(/abc/);
819
+ * // => false
820
+ */
821
+ function isFunction$1(value) {
822
+ // The use of `Object#toString` avoids issues with the `typeof` operator
823
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
824
+ var tag = isObject$1(value) ? objectToString$1.call(value) : '';
825
+ return tag == funcTag$1 || tag == genTag$1;
826
+ }
827
+
828
+ /**
829
+ * Checks if `value` is a valid array-like length.
830
+ *
831
+ * **Note:** This method is loosely based on
832
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
833
+ *
834
+ * @static
835
+ * @memberOf _
836
+ * @since 4.0.0
837
+ * @category Lang
838
+ * @param {*} value The value to check.
839
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
840
+ * @example
841
+ *
842
+ * _.isLength(3);
843
+ * // => true
844
+ *
845
+ * _.isLength(Number.MIN_VALUE);
846
+ * // => false
847
+ *
848
+ * _.isLength(Infinity);
849
+ * // => false
850
+ *
851
+ * _.isLength('3');
852
+ * // => false
853
+ */
854
+ function isLength$1(value) {
855
+ return typeof value == 'number' &&
856
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
857
+ }
858
+
859
+ /**
860
+ * Checks if `value` is the
861
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
862
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
863
+ *
864
+ * @static
865
+ * @memberOf _
866
+ * @since 0.1.0
867
+ * @category Lang
868
+ * @param {*} value The value to check.
869
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
870
+ * @example
871
+ *
872
+ * _.isObject({});
873
+ * // => true
874
+ *
875
+ * _.isObject([1, 2, 3]);
876
+ * // => true
877
+ *
878
+ * _.isObject(_.noop);
879
+ * // => true
880
+ *
881
+ * _.isObject(null);
882
+ * // => false
883
+ */
884
+ function isObject$1(value) {
885
+ var type = typeof value;
886
+ return !!value && (type == 'object' || type == 'function');
887
+ }
888
+
889
+ /**
890
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
891
+ * and has a `typeof` result of "object".
892
+ *
893
+ * @static
894
+ * @memberOf _
895
+ * @since 4.0.0
896
+ * @category Lang
897
+ * @param {*} value The value to check.
898
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
899
+ * @example
900
+ *
901
+ * _.isObjectLike({});
902
+ * // => true
903
+ *
904
+ * _.isObjectLike([1, 2, 3]);
905
+ * // => true
906
+ *
907
+ * _.isObjectLike(_.noop);
908
+ * // => false
909
+ *
910
+ * _.isObjectLike(null);
911
+ * // => false
912
+ */
913
+ function isObjectLike$1(value) {
914
+ return !!value && typeof value == 'object';
915
+ }
916
+
917
+ /**
918
+ * Checks if `value` is classified as a `String` primitive or object.
919
+ *
920
+ * @static
921
+ * @since 0.1.0
922
+ * @memberOf _
923
+ * @category Lang
924
+ * @param {*} value The value to check.
925
+ * @returns {boolean} Returns `true` if `value` is a string, else `false`.
926
+ * @example
927
+ *
928
+ * _.isString('abc');
929
+ * // => true
930
+ *
931
+ * _.isString(1);
932
+ * // => false
933
+ */
934
+ function isString(value) {
935
+ return typeof value == 'string' ||
936
+ (!isArray(value) && isObjectLike$1(value) && objectToString$1.call(value) == stringTag);
937
+ }
938
+
939
+ /**
940
+ * Checks if `value` is classified as a `Symbol` primitive or object.
941
+ *
942
+ * @static
943
+ * @memberOf _
944
+ * @since 4.0.0
945
+ * @category Lang
946
+ * @param {*} value The value to check.
947
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
948
+ * @example
949
+ *
950
+ * _.isSymbol(Symbol.iterator);
951
+ * // => true
952
+ *
953
+ * _.isSymbol('abc');
954
+ * // => false
955
+ */
956
+ function isSymbol$1(value) {
957
+ return typeof value == 'symbol' ||
958
+ (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1);
959
+ }
960
+
961
+ /**
962
+ * Converts `value` to an array.
963
+ *
964
+ * @static
965
+ * @since 0.1.0
966
+ * @memberOf _
967
+ * @category Lang
968
+ * @param {*} value The value to convert.
969
+ * @returns {Array} Returns the converted array.
970
+ * @example
971
+ *
972
+ * _.toArray({ 'a': 1, 'b': 2 });
973
+ * // => [1, 2]
974
+ *
975
+ * _.toArray('abc');
976
+ * // => ['a', 'b', 'c']
977
+ *
978
+ * _.toArray(1);
979
+ * // => []
980
+ *
981
+ * _.toArray(null);
982
+ * // => []
983
+ */
984
+ function toArray(value) {
985
+ if (!value) {
986
+ return [];
987
+ }
988
+ if (isArrayLike$1(value)) {
989
+ return isString(value) ? stringToArray(value) : copyArray(value);
990
+ }
991
+ if (iteratorSymbol && value[iteratorSymbol]) {
992
+ return iteratorToArray(value[iteratorSymbol]());
993
+ }
994
+ var tag = getTag(value),
995
+ func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
996
+
997
+ return func(value);
998
+ }
999
+
1000
+ /**
1001
+ * Converts `value` to a finite number.
1002
+ *
1003
+ * @static
1004
+ * @memberOf _
1005
+ * @since 4.12.0
1006
+ * @category Lang
1007
+ * @param {*} value The value to convert.
1008
+ * @returns {number} Returns the converted number.
1009
+ * @example
1010
+ *
1011
+ * _.toFinite(3.2);
1012
+ * // => 3.2
1013
+ *
1014
+ * _.toFinite(Number.MIN_VALUE);
1015
+ * // => 5e-324
1016
+ *
1017
+ * _.toFinite(Infinity);
1018
+ * // => 1.7976931348623157e+308
1019
+ *
1020
+ * _.toFinite('3.2');
1021
+ * // => 3.2
1022
+ */
1023
+ function toFinite$1(value) {
1024
+ if (!value) {
1025
+ return value === 0 ? value : 0;
1026
+ }
1027
+ value = toNumber$1(value);
1028
+ if (value === INFINITY$1 || value === -INFINITY$1) {
1029
+ var sign = (value < 0 ? -1 : 1);
1030
+ return sign * MAX_INTEGER$1;
1031
+ }
1032
+ return value === value ? value : 0;
1033
+ }
1034
+
1035
+ /**
1036
+ * Converts `value` to an integer.
1037
+ *
1038
+ * **Note:** This method is loosely based on
1039
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
1040
+ *
1041
+ * @static
1042
+ * @memberOf _
1043
+ * @since 4.0.0
1044
+ * @category Lang
1045
+ * @param {*} value The value to convert.
1046
+ * @returns {number} Returns the converted integer.
1047
+ * @example
1048
+ *
1049
+ * _.toInteger(3.2);
1050
+ * // => 3
1051
+ *
1052
+ * _.toInteger(Number.MIN_VALUE);
1053
+ * // => 0
1054
+ *
1055
+ * _.toInteger(Infinity);
1056
+ * // => 1.7976931348623157e+308
1057
+ *
1058
+ * _.toInteger('3.2');
1059
+ * // => 3
1060
+ */
1061
+ function toInteger(value) {
1062
+ var result = toFinite$1(value),
1063
+ remainder = result % 1;
1064
+
1065
+ return result === result ? (remainder ? result - remainder : result) : 0;
1066
+ }
1067
+
1068
+ /**
1069
+ * Converts `value` to a number.
1070
+ *
1071
+ * @static
1072
+ * @memberOf _
1073
+ * @since 4.0.0
1074
+ * @category Lang
1075
+ * @param {*} value The value to process.
1076
+ * @returns {number} Returns the number.
1077
+ * @example
1078
+ *
1079
+ * _.toNumber(3.2);
1080
+ * // => 3.2
1081
+ *
1082
+ * _.toNumber(Number.MIN_VALUE);
1083
+ * // => 5e-324
1084
+ *
1085
+ * _.toNumber(Infinity);
1086
+ * // => Infinity
1087
+ *
1088
+ * _.toNumber('3.2');
1089
+ * // => 3.2
1090
+ */
1091
+ function toNumber$1(value) {
1092
+ if (typeof value == 'number') {
1093
+ return value;
1094
+ }
1095
+ if (isSymbol$1(value)) {
1096
+ return NAN$1;
1097
+ }
1098
+ if (isObject$1(value)) {
1099
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
1100
+ value = isObject$1(other) ? (other + '') : other;
1101
+ }
1102
+ if (typeof value != 'string') {
1103
+ return value === 0 ? value : +value;
1104
+ }
1105
+ value = value.replace(reTrim$1, '');
1106
+ var isBinary = reIsBinary$1.test(value);
1107
+ return (isBinary || reIsOctal$1.test(value))
1108
+ ? freeParseInt$1(value.slice(2), isBinary ? 2 : 8)
1109
+ : (reIsBadHex$1.test(value) ? NAN$1 : +value);
1110
+ }
1111
+
1112
+ /**
1113
+ * Creates an array of the own enumerable property names of `object`.
1114
+ *
1115
+ * **Note:** Non-object values are coerced to objects. See the
1116
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1117
+ * for more details.
1118
+ *
1119
+ * @static
1120
+ * @since 0.1.0
1121
+ * @memberOf _
1122
+ * @category Object
1123
+ * @param {Object} object The object to query.
1124
+ * @returns {Array} Returns the array of property names.
1125
+ * @example
1126
+ *
1127
+ * function Foo() {
1128
+ * this.a = 1;
1129
+ * this.b = 2;
1130
+ * }
1131
+ *
1132
+ * Foo.prototype.c = 3;
1133
+ *
1134
+ * _.keys(new Foo);
1135
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1136
+ *
1137
+ * _.keys('hi');
1138
+ * // => ['0', '1']
1139
+ */
1140
+ function keys(object) {
1141
+ return isArrayLike$1(object) ? arrayLikeKeys(object) : baseKeys(object);
1142
+ }
1143
+
1144
+ /**
1145
+ * Creates an array of the own enumerable string keyed property values of `object`.
1146
+ *
1147
+ * **Note:** Non-object values are coerced to objects.
1148
+ *
1149
+ * @static
1150
+ * @since 0.1.0
1151
+ * @memberOf _
1152
+ * @category Object
1153
+ * @param {Object} object The object to query.
1154
+ * @returns {Array} Returns the array of property values.
1155
+ * @example
1156
+ *
1157
+ * function Foo() {
1158
+ * this.a = 1;
1159
+ * this.b = 2;
1160
+ * }
1161
+ *
1162
+ * Foo.prototype.c = 3;
1163
+ *
1164
+ * _.values(new Foo);
1165
+ * // => [1, 2] (iteration order is not guaranteed)
1166
+ *
1167
+ * _.values('hi');
1168
+ * // => ['h', 'i']
1169
+ */
1170
+ function values(object) {
1171
+ return object ? baseValues(object, keys(object)) : [];
1172
+ }
1173
+
1174
+ var lodash_samplesize = sampleSize;
1175
+
1176
+ /**
1177
+ * lodash (Custom Build) <https://lodash.com/>
1178
+ * Build: `lodash modularize exports="npm" -o ./`
1179
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
1180
+ * Released under MIT license <https://lodash.com/license>
1181
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1182
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1183
+ */
1184
+
1185
+ /** Used as references for various `Number` constants. */
1186
+ var INFINITY = 1 / 0,
1187
+ MAX_SAFE_INTEGER = 9007199254740991,
1188
+ MAX_INTEGER = 1.7976931348623157e+308,
1189
+ NAN = 0 / 0;
1190
+
1191
+ /** `Object#toString` result references. */
1192
+ var funcTag = '[object Function]',
1193
+ genTag = '[object GeneratorFunction]',
1194
+ symbolTag = '[object Symbol]';
1195
+
1196
+ /** Used to match leading and trailing whitespace. */
1197
+ var reTrim = /^\s+|\s+$/g;
1198
+
1199
+ /** Used to detect bad signed hexadecimal string values. */
1200
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
1201
+
1202
+ /** Used to detect binary string values. */
1203
+ var reIsBinary = /^0b[01]+$/i;
1204
+
1205
+ /** Used to detect octal string values. */
1206
+ var reIsOctal = /^0o[0-7]+$/i;
1207
+
1208
+ /** Used to detect unsigned integer values. */
1209
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1210
+
1211
+ /** Built-in method references without a dependency on `root`. */
1212
+ var freeParseFloat = parseFloat,
1213
+ freeParseInt = parseInt;
1214
+
1215
+ /** Used for built-in method references. */
1216
+ var objectProto = Object.prototype;
1217
+
1218
+ /**
1219
+ * Used to resolve the
1220
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1221
+ * of values.
1222
+ */
1223
+ var objectToString = objectProto.toString;
1224
+
1225
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1226
+ var nativeFloor = Math.floor,
1227
+ nativeMin = Math.min,
1228
+ nativeRandom = Math.random;
1229
+
1230
+ /**
1231
+ * The base implementation of `_.random` without support for returning
1232
+ * floating-point numbers.
1233
+ *
1234
+ * @private
1235
+ * @param {number} lower The lower bound.
1236
+ * @param {number} upper The upper bound.
1237
+ * @returns {number} Returns the random number.
1238
+ */
1239
+ function baseRandom(lower, upper) {
1240
+ return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
1241
+ }
1242
+
1243
+ /**
1244
+ * Checks if `value` is a valid array-like index.
1245
+ *
1246
+ * @private
1247
+ * @param {*} value The value to check.
1248
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1249
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1250
+ */
1251
+ function isIndex(value, length) {
1252
+ length = length == null ? MAX_SAFE_INTEGER : length;
1253
+ return !!length &&
1254
+ (typeof value == 'number' || reIsUint.test(value)) &&
1255
+ (value > -1 && value % 1 == 0 && value < length);
1256
+ }
1257
+
1258
+ /**
1259
+ * Checks if the given arguments are from an iteratee call.
1260
+ *
1261
+ * @private
1262
+ * @param {*} value The potential iteratee value argument.
1263
+ * @param {*} index The potential iteratee index or key argument.
1264
+ * @param {*} object The potential iteratee object argument.
1265
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
1266
+ * else `false`.
1267
+ */
1268
+ function isIterateeCall(value, index, object) {
1269
+ if (!isObject(object)) {
1270
+ return false;
1271
+ }
1272
+ var type = typeof index;
1273
+ if (type == 'number'
1274
+ ? (isArrayLike(object) && isIndex(index, object.length))
1275
+ : (type == 'string' && index in object)
1276
+ ) {
1277
+ return eq(object[index], value);
1278
+ }
1279
+ return false;
1280
+ }
1281
+
1282
+ /**
1283
+ * Performs a
1284
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1285
+ * comparison between two values to determine if they are equivalent.
1286
+ *
1287
+ * @static
1288
+ * @memberOf _
1289
+ * @since 4.0.0
1290
+ * @category Lang
1291
+ * @param {*} value The value to compare.
1292
+ * @param {*} other The other value to compare.
1293
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1294
+ * @example
1295
+ *
1296
+ * var object = { 'a': 1 };
1297
+ * var other = { 'a': 1 };
1298
+ *
1299
+ * _.eq(object, object);
1300
+ * // => true
1301
+ *
1302
+ * _.eq(object, other);
1303
+ * // => false
1304
+ *
1305
+ * _.eq('a', 'a');
1306
+ * // => true
1307
+ *
1308
+ * _.eq('a', Object('a'));
1309
+ * // => false
1310
+ *
1311
+ * _.eq(NaN, NaN);
1312
+ * // => true
1313
+ */
1314
+ function eq(value, other) {
1315
+ return value === other || (value !== value && other !== other);
1316
+ }
1317
+
1318
+ /**
1319
+ * Checks if `value` is array-like. A value is considered array-like if it's
1320
+ * not a function and has a `value.length` that's an integer greater than or
1321
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1322
+ *
1323
+ * @static
1324
+ * @memberOf _
1325
+ * @since 4.0.0
1326
+ * @category Lang
1327
+ * @param {*} value The value to check.
1328
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1329
+ * @example
1330
+ *
1331
+ * _.isArrayLike([1, 2, 3]);
1332
+ * // => true
1333
+ *
1334
+ * _.isArrayLike(document.body.children);
1335
+ * // => true
1336
+ *
1337
+ * _.isArrayLike('abc');
1338
+ * // => true
1339
+ *
1340
+ * _.isArrayLike(_.noop);
1341
+ * // => false
1342
+ */
1343
+ function isArrayLike(value) {
1344
+ return value != null && isLength(value.length) && !isFunction(value);
1345
+ }
1346
+
1347
+ /**
1348
+ * Checks if `value` is classified as a `Function` object.
1349
+ *
1350
+ * @static
1351
+ * @memberOf _
1352
+ * @since 0.1.0
1353
+ * @category Lang
1354
+ * @param {*} value The value to check.
1355
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1356
+ * @example
1357
+ *
1358
+ * _.isFunction(_);
1359
+ * // => true
1360
+ *
1361
+ * _.isFunction(/abc/);
1362
+ * // => false
1363
+ */
1364
+ function isFunction(value) {
1365
+ // The use of `Object#toString` avoids issues with the `typeof` operator
1366
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
1367
+ var tag = isObject(value) ? objectToString.call(value) : '';
1368
+ return tag == funcTag || tag == genTag;
1369
+ }
1370
+
1371
+ /**
1372
+ * Checks if `value` is a valid array-like length.
1373
+ *
1374
+ * **Note:** This method is loosely based on
1375
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1376
+ *
1377
+ * @static
1378
+ * @memberOf _
1379
+ * @since 4.0.0
1380
+ * @category Lang
1381
+ * @param {*} value The value to check.
1382
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1383
+ * @example
1384
+ *
1385
+ * _.isLength(3);
1386
+ * // => true
1387
+ *
1388
+ * _.isLength(Number.MIN_VALUE);
1389
+ * // => false
1390
+ *
1391
+ * _.isLength(Infinity);
1392
+ * // => false
1393
+ *
1394
+ * _.isLength('3');
1395
+ * // => false
1396
+ */
1397
+ function isLength(value) {
1398
+ return typeof value == 'number' &&
1399
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1400
+ }
1401
+
1402
+ /**
1403
+ * Checks if `value` is the
1404
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1405
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1406
+ *
1407
+ * @static
1408
+ * @memberOf _
1409
+ * @since 0.1.0
1410
+ * @category Lang
1411
+ * @param {*} value The value to check.
1412
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1413
+ * @example
1414
+ *
1415
+ * _.isObject({});
1416
+ * // => true
1417
+ *
1418
+ * _.isObject([1, 2, 3]);
1419
+ * // => true
1420
+ *
1421
+ * _.isObject(_.noop);
1422
+ * // => true
1423
+ *
1424
+ * _.isObject(null);
1425
+ * // => false
1426
+ */
1427
+ function isObject(value) {
1428
+ var type = typeof value;
1429
+ return !!value && (type == 'object' || type == 'function');
1430
+ }
1431
+
1432
+ /**
1433
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1434
+ * and has a `typeof` result of "object".
1435
+ *
1436
+ * @static
1437
+ * @memberOf _
1438
+ * @since 4.0.0
1439
+ * @category Lang
1440
+ * @param {*} value The value to check.
1441
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1442
+ * @example
1443
+ *
1444
+ * _.isObjectLike({});
1445
+ * // => true
1446
+ *
1447
+ * _.isObjectLike([1, 2, 3]);
1448
+ * // => true
1449
+ *
1450
+ * _.isObjectLike(_.noop);
1451
+ * // => false
1452
+ *
1453
+ * _.isObjectLike(null);
1454
+ * // => false
1455
+ */
1456
+ function isObjectLike(value) {
1457
+ return !!value && typeof value == 'object';
1458
+ }
1459
+
1460
+ /**
1461
+ * Checks if `value` is classified as a `Symbol` primitive or object.
1462
+ *
1463
+ * @static
1464
+ * @memberOf _
1465
+ * @since 4.0.0
1466
+ * @category Lang
1467
+ * @param {*} value The value to check.
1468
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
1469
+ * @example
1470
+ *
1471
+ * _.isSymbol(Symbol.iterator);
1472
+ * // => true
1473
+ *
1474
+ * _.isSymbol('abc');
1475
+ * // => false
1476
+ */
1477
+ function isSymbol(value) {
1478
+ return typeof value == 'symbol' ||
1479
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
1480
+ }
1481
+
1482
+ /**
1483
+ * Converts `value` to a finite number.
1484
+ *
1485
+ * @static
1486
+ * @memberOf _
1487
+ * @since 4.12.0
1488
+ * @category Lang
1489
+ * @param {*} value The value to convert.
1490
+ * @returns {number} Returns the converted number.
1491
+ * @example
1492
+ *
1493
+ * _.toFinite(3.2);
1494
+ * // => 3.2
1495
+ *
1496
+ * _.toFinite(Number.MIN_VALUE);
1497
+ * // => 5e-324
1498
+ *
1499
+ * _.toFinite(Infinity);
1500
+ * // => 1.7976931348623157e+308
1501
+ *
1502
+ * _.toFinite('3.2');
1503
+ * // => 3.2
1504
+ */
1505
+ function toFinite(value) {
1506
+ if (!value) {
1507
+ return value === 0 ? value : 0;
1508
+ }
1509
+ value = toNumber(value);
1510
+ if (value === INFINITY || value === -INFINITY) {
1511
+ var sign = (value < 0 ? -1 : 1);
1512
+ return sign * MAX_INTEGER;
1513
+ }
1514
+ return value === value ? value : 0;
1515
+ }
1516
+
1517
+ /**
1518
+ * Converts `value` to a number.
1519
+ *
1520
+ * @static
1521
+ * @memberOf _
1522
+ * @since 4.0.0
1523
+ * @category Lang
1524
+ * @param {*} value The value to process.
1525
+ * @returns {number} Returns the number.
1526
+ * @example
1527
+ *
1528
+ * _.toNumber(3.2);
1529
+ * // => 3.2
1530
+ *
1531
+ * _.toNumber(Number.MIN_VALUE);
1532
+ * // => 5e-324
1533
+ *
1534
+ * _.toNumber(Infinity);
1535
+ * // => Infinity
1536
+ *
1537
+ * _.toNumber('3.2');
1538
+ * // => 3.2
1539
+ */
1540
+ function toNumber(value) {
1541
+ if (typeof value == 'number') {
1542
+ return value;
1543
+ }
1544
+ if (isSymbol(value)) {
1545
+ return NAN;
1546
+ }
1547
+ if (isObject(value)) {
1548
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
1549
+ value = isObject(other) ? (other + '') : other;
1550
+ }
1551
+ if (typeof value != 'string') {
1552
+ return value === 0 ? value : +value;
1553
+ }
1554
+ value = value.replace(reTrim, '');
1555
+ var isBinary = reIsBinary.test(value);
1556
+ return (isBinary || reIsOctal.test(value))
1557
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
1558
+ : (reIsBadHex.test(value) ? NAN : +value);
1559
+ }
1560
+
1561
+ /**
1562
+ * Produces a random number between the inclusive `lower` and `upper` bounds.
1563
+ * If only one argument is provided a number between `0` and the given number
1564
+ * is returned. If `floating` is `true`, or either `lower` or `upper` are
1565
+ * floats, a floating-point number is returned instead of an integer.
1566
+ *
1567
+ * **Note:** JavaScript follows the IEEE-754 standard for resolving
1568
+ * floating-point values which can produce unexpected results.
1569
+ *
1570
+ * @static
1571
+ * @memberOf _
1572
+ * @since 0.7.0
1573
+ * @category Number
1574
+ * @param {number} [lower=0] The lower bound.
1575
+ * @param {number} [upper=1] The upper bound.
1576
+ * @param {boolean} [floating] Specify returning a floating-point number.
1577
+ * @returns {number} Returns the random number.
1578
+ * @example
1579
+ *
1580
+ * _.random(0, 5);
1581
+ * // => an integer between 0 and 5
1582
+ *
1583
+ * _.random(5);
1584
+ * // => also an integer between 0 and 5
1585
+ *
1586
+ * _.random(5, true);
1587
+ * // => a floating-point number between 0 and 5
1588
+ *
1589
+ * _.random(1.2, 5.2);
1590
+ * // => a floating-point number between 1.2 and 5.2
1591
+ */
1592
+ function random(lower, upper, floating) {
1593
+ if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
1594
+ upper = floating = undefined;
1595
+ }
1596
+ if (floating === undefined) {
1597
+ if (typeof upper == 'boolean') {
1598
+ floating = upper;
1599
+ upper = undefined;
1600
+ }
1601
+ else if (typeof lower == 'boolean') {
1602
+ floating = lower;
1603
+ lower = undefined;
1604
+ }
1605
+ }
1606
+ if (lower === undefined && upper === undefined) {
1607
+ lower = 0;
1608
+ upper = 1;
1609
+ }
1610
+ else {
1611
+ lower = toFinite(lower);
1612
+ if (upper === undefined) {
1613
+ upper = lower;
1614
+ lower = 0;
1615
+ } else {
1616
+ upper = toFinite(upper);
1617
+ }
1618
+ }
1619
+ if (lower > upper) {
1620
+ var temp = lower;
1621
+ lower = upper;
1622
+ upper = temp;
1623
+ }
1624
+ if (floating || lower % 1 || upper % 1) {
1625
+ var rand = nativeRandom();
1626
+ return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
1627
+ }
1628
+ return baseRandom(lower, upper);
1629
+ }
1630
+
1631
+ var lodash_random = random;
1632
+
1633
+ const documentComponentDemoCss = ".sc-dsot-document-component-demo-h{display:block;margin:0 8px;border-left:1px dashed transparent;border-right:1px dashed transparent}[show-canvas].sc-dsot-document-component-demo-h{border-left:1px dashed pink;border-right:1px dashed pink}";
1634
+
15
1635
  const DocumentComponentDemo = /*@__PURE__*/ proxyCustomElement(class DocumentComponentDemo extends HTMLElement {
16
1636
  constructor() {
17
1637
  super();
18
1638
  this.__registerHost();
1639
+ this.dsotOzonContentAnchorClick = createEvent(this, "dsotOzonContentAnchorClick", 7);
19
1640
  this.DocumentComponent = ({ path }) => {
20
1641
  var _a;
21
1642
  const documentComponent = path.at(-1);
22
1643
  const { DocumentComponent } = this;
23
- return (h("ul", null, (_a = documentComponent === null || documentComponent === void 0 ? void 0 : documentComponent._embedded) === null || _a === void 0 ? void 0 : _a.ontwerpTekststructuurDocumentComponenten.map((d, i) => (h("li", { key: d.documentTechnischId }, h("dso-document-component", { annotated: i % 3 === 2, bevatOntwerpInformatie: !!d.bevatOntwerpInformatie, filtered: this.isOpen(d) ? this.isFiltered(d) : this.hasFilteredChildren(d), genesteOntwerpInformatie: this.hasNestedDraft(d), gereserveerd: d.gereserveerd, heading: "h2", inhoud: d.inhoud, label: d.labelXml, openAnnotation: this.isOpenedAnnotation(d), notApplicable: this.isNotApplicable(d) || path.some((p) => this.isNotApplicable(p)), nummer: d.nummerXml, onDsoAnnotationToggle: () => this.handleAnnotationToggle(d), onDsoOpenToggle: (e) => this.handleOpenToggle(e, d), open: this.isOpen(d), opschrift: d.opschrift, type: d.type, vervallen: d.vervallen, wijzigactie: d.wijzigactie }, this.isOpenedAnnotation(d) && (h("dso-annotation-output", { slot: "annotation", open: true, identifier: "test", onDsoClose: () => this.handleAnnotationToggle(d) }, h("span", { slot: "title" }, "Annotaties"), h("dso-slide-toggle", { checked: this.isCheckedSlideToggle(d), onDsoActiveChange: () => this.handleSelectableChange(d) }, "Delfzijl"))), this.showContent(d) && h(DocumentComponent, { path: [...path, d] })))))));
1644
+ return (h("ul", null, documentComponent &&
1645
+ ((_a = this.getEmbeddedDocumentComponents(documentComponent)) === null || _a === void 0 ? void 0 : _a.map((d, i) => (h("li", { key: d.documentTechnischId }, h("dso-document-component", { annotated: i % 3 === 2, bevatOntwerpInformatie: !!d.bevatOntwerpInformatie, filtered: this.isOpen(d) ? this.isFiltered(d) : this.hasFilteredChildren(d), genesteOntwerpInformatie: this.hasNestedDraft(d), gereserveerd: d.gereserveerd, heading: "h2", inhoud: d.inhoud, label: d.labelXml, openAnnotation: this.isOpenedAnnotation(d), notApplicable: this.isNotApplicable(d) || path.some((p) => this.isNotApplicable(p)), nummer: d.nummerXml, onDsoAnnotationToggle: () => this.handleAnnotationToggle(d), onDsoOpenToggle: (e) => this.handleOpenToggle(e, d), onDsoOzonContentAnchorClick: (e) => this.handleOzonContentAnchorClick(e), open: this.isOpen(d), opschrift: d.opschrift, type: d.type, vervallen: d.vervallen, wijzigactie: d.wijzigactie }, this.isOpenedAnnotation(d) && (h("dso-annotation-output", { slot: "annotation", open: true, identifier: "test", onDsoClose: () => this.handleAnnotationToggle(d) }, h("span", { slot: "title" }, "Annotaties"), h("dso-slide-toggle", { checked: this.isCheckedSlideToggle(d), onDsoActiveChange: () => this.handleSelectableChange(d) }, "Delfzijl"))), this.showContent(d) && h(DocumentComponent, { path: [...path, d] }))))))));
24
1646
  };
1647
+ this.showCanvas = false;
1648
+ this.jsonFile = undefined;
1649
+ this.openDefault = false;
25
1650
  this.response = undefined;
26
- this.open = [];
1651
+ this.openOrClosed = [];
27
1652
  this.openedAnnotation = [];
28
1653
  this.filtered = [];
29
1654
  this.notApplicable = [];
30
1655
  this.activeAnnotationSelectables = [];
31
1656
  }
32
- fixData(documentComponent) {
1657
+ async jsonFileWatcher() {
1658
+ this.openOrClosed = [];
1659
+ await this.loadData();
1660
+ }
1661
+ async openDefaultWatcher() {
1662
+ this.openOrClosed = [];
1663
+ await this.loadData();
1664
+ }
1665
+ async componentDidLoad() {
1666
+ await this.loadData();
1667
+ }
1668
+ getEmbeddedDocumentComponents(documentComponent) {
1669
+ var _a, _b, _c;
1670
+ return ((_b = (_a = documentComponent === null || documentComponent === void 0 ? void 0 : documentComponent._embedded) === null || _a === void 0 ? void 0 : _a.ontwerpTekststructuurDocumentComponenten) !== null && _b !== void 0 ? _b : (_c = documentComponent === null || documentComponent === void 0 ? void 0 : documentComponent._embedded) === null || _c === void 0 ? void 0 : _c.tekststructuurDocumentComponenten);
1671
+ }
1672
+ concatEmbeddedDocumentComponents(documentComponent) {
33
1673
  var _a;
34
- return Object.assign(Object.assign({}, documentComponent), { nummerXml: documentComponent.type === "LID" && !((_a = documentComponent.nummerXml) === null || _a === void 0 ? void 0 : _a.startsWith("<?"))
35
- ? `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Nummer xmlns="https://standaarden.overheid.nl/stop/imop/tekst/">${documentComponent.nummerXml}</Nummer>`
36
- : documentComponent.nummerXml, _embedded: documentComponent._embedded && {
37
- ontwerpTekststructuurDocumentComponenten: documentComponent._embedded.ontwerpTekststructuurDocumentComponenten.map((d) => this.fixData(d)),
38
- } });
39
- }
40
- componentDidLoad() {
41
- fetch("ozon-response.json")
42
- .then((response) => response.json())
43
- .then((result) => {
44
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
45
- this.response = this.fixData(result);
46
- /* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
47
- this.filtered = [
48
- (_e = (_d = (_c = (_b = (_a = this.response) === null || _a === void 0 ? void 0 : _a._embedded) === null || _b === void 0 ? void 0 : _b.ontwerpTekststructuurDocumentComponenten[0]._embedded) === null || _c === void 0 ? void 0 : _c.ontwerpTekststructuurDocumentComponenten[10]._embedded) === null || _d === void 0 ? void 0 : _d.ontwerpTekststructuurDocumentComponenten[2]._embedded) === null || _e === void 0 ? void 0 : _e.ontwerpTekststructuurDocumentComponenten[0],
49
- (_j = (_h = (_g = (_f = this.response) === null || _f === void 0 ? void 0 : _f._embedded) === null || _g === void 0 ? void 0 : _g.ontwerpTekststructuurDocumentComponenten[0]._embedded) === null || _h === void 0 ? void 0 : _h.ontwerpTekststructuurDocumentComponenten[10]._embedded) === null || _j === void 0 ? void 0 : _j.ontwerpTekststructuurDocumentComponenten[0],
50
- ];
51
- this.notApplicable = [
52
- (_m = (_l = (_k = this.response) === null || _k === void 0 ? void 0 : _k._embedded) === null || _l === void 0 ? void 0 : _l.ontwerpTekststructuurDocumentComponenten[0]._embedded) === null || _m === void 0 ? void 0 : _m.ontwerpTekststructuurDocumentComponenten[4],
53
- (_r = (_q = (_p = (_o = this.response) === null || _o === void 0 ? void 0 : _o._embedded) === null || _p === void 0 ? void 0 : _p.ontwerpTekststructuurDocumentComponenten[0]._embedded) === null || _q === void 0 ? void 0 : _q.ontwerpTekststructuurDocumentComponenten[4]._embedded) === null || _r === void 0 ? void 0 : _r.ontwerpTekststructuurDocumentComponenten[0],
54
- (_v = (_u = (_t = (_s = this.response) === null || _s === void 0 ? void 0 : _s._embedded) === null || _t === void 0 ? void 0 : _t.ontwerpTekststructuurDocumentComponenten[0]._embedded) === null || _u === void 0 ? void 0 : _u.ontwerpTekststructuurDocumentComponenten[9]._embedded) === null || _v === void 0 ? void 0 : _v.ontwerpTekststructuurDocumentComponenten[1],
55
- ];
56
- /* eslint-enable @typescript-eslint/no-non-null-asserted-optional-chain */
57
- });
58
- }
59
- handleOpenToggle(e, documentComponent) {
60
- const isOpen = this.isOpen(documentComponent);
61
- if (e.detail.open && !isOpen) {
62
- this.open = [...this.open, documentComponent];
1674
+ const embeddedDocuments = [...((_a = this.getEmbeddedDocumentComponents(documentComponent)) !== null && _a !== void 0 ? _a : [])];
1675
+ for (const d of embeddedDocuments) {
1676
+ embeddedDocuments.push(...this.concatEmbeddedDocumentComponents(d));
63
1677
  }
64
- else if (!e.detail.open && isOpen) {
65
- this.open = this.open.filter((d) => d !== documentComponent);
1678
+ return embeddedDocuments;
1679
+ }
1680
+ selectRandomDocumentComponents(documentComponent, exclude = []) {
1681
+ const documentComponents = this.concatEmbeddedDocumentComponents(documentComponent).filter((d) => !exclude.includes(d));
1682
+ const size = lodash_random(0, Math.floor(documentComponents.length / 10));
1683
+ return lodash_samplesize(documentComponents, size);
1684
+ }
1685
+ async loadData() {
1686
+ var _a;
1687
+ if (!this.jsonFile) {
1688
+ this.response = undefined;
1689
+ return;
1690
+ }
1691
+ const data = await fetch(this.jsonFile).then((r) => r.json());
1692
+ const lichaam = (_a = this.getEmbeddedDocumentComponents(data)) === null || _a === void 0 ? void 0 : _a.find((documentComponent) => documentComponent.type === "LICHAAM");
1693
+ if (lichaam) {
1694
+ this.response = lichaam;
1695
+ this.notApplicable = this.selectRandomDocumentComponents(lichaam);
1696
+ this.filtered = this.selectRandomDocumentComponents(lichaam, this.notApplicable);
66
1697
  }
67
1698
  }
1699
+ handleOpenToggle(_e, documentComponent) {
1700
+ const isOpenOrClosed = this.openOrClosed.includes(documentComponent);
1701
+ this.openOrClosed = !isOpenOrClosed
1702
+ ? [...this.openOrClosed, documentComponent]
1703
+ : this.openOrClosed.filter((d) => d !== documentComponent);
1704
+ }
68
1705
  handleAnnotationToggle(documentComponent) {
69
1706
  this.openedAnnotation = this.isOpenedAnnotation(documentComponent)
70
1707
  ? this.openedAnnotation.filter((d) => d !== documentComponent)
71
1708
  : [...this.openedAnnotation, documentComponent];
72
1709
  if (!this.isOpen(documentComponent)) {
73
- this.open = [...this.open, documentComponent];
1710
+ this.openOrClosed = [...this.openOrClosed, documentComponent];
74
1711
  }
75
1712
  }
76
1713
  handleSelectableChange(documentComponent) {
@@ -78,16 +1715,21 @@ const DocumentComponentDemo = /*@__PURE__*/ proxyCustomElement(class DocumentCom
78
1715
  ? this.activeAnnotationSelectables.filter((d) => d !== documentComponent)
79
1716
  : [...this.activeAnnotationSelectables, documentComponent];
80
1717
  }
1718
+ handleOzonContentAnchorClick(e) {
1719
+ this.dsotOzonContentAnchorClick.emit(e.detail);
1720
+ }
81
1721
  isCheckedSlideToggle(documentComponent) {
82
1722
  return this.activeAnnotationSelectables.includes(documentComponent);
83
1723
  }
84
1724
  hasFilteredChildren(documentComponent) {
85
1725
  var _a, _b;
86
1726
  return (this.filtered.includes(documentComponent) ||
87
- ((_b = (_a = documentComponent._embedded) === null || _a === void 0 ? void 0 : _a.ontwerpTekststructuurDocumentComponenten.some((d) => this.hasFilteredChildren(d))) !== null && _b !== void 0 ? _b : false));
1727
+ ((_b = (_a = this.getEmbeddedDocumentComponents(documentComponent)) === null || _a === void 0 ? void 0 : _a.some((d) => this.hasFilteredChildren(d))) !== null && _b !== void 0 ? _b : false));
88
1728
  }
89
1729
  isOpen(documentComponent) {
90
- return documentComponent.type === "LID" || this.open.includes(documentComponent);
1730
+ return documentComponent.type === "LID" || this.openDefault
1731
+ ? !this.openOrClosed.includes(documentComponent)
1732
+ : this.openOrClosed.includes(documentComponent);
91
1733
  }
92
1734
  isOpenedAnnotation(documentComponent) {
93
1735
  return this.openedAnnotation.includes(documentComponent);
@@ -100,21 +1742,28 @@ const DocumentComponentDemo = /*@__PURE__*/ proxyCustomElement(class DocumentCom
100
1742
  }
101
1743
  hasNestedDraft(documentComponent) {
102
1744
  var _a, _b;
103
- return ((_b = (_a = documentComponent._embedded) === null || _a === void 0 ? void 0 : _a.ontwerpTekststructuurDocumentComponenten.some((d) => !!d.bevatOntwerpInformatie || this.hasNestedDraft(d))) !== null && _b !== void 0 ? _b : false);
1745
+ return ((_b = (_a = this.getEmbeddedDocumentComponents(documentComponent)) === null || _a === void 0 ? void 0 : _a.some((d) => !!d.bevatOntwerpInformatie || this.hasNestedDraft(d))) !== null && _b !== void 0 ? _b : false);
104
1746
  }
105
1747
  showContent(documentComponent) {
106
1748
  var _a;
107
1749
  return (this.isOpen(documentComponent) &&
108
- !!(((_a = documentComponent._embedded) === null || _a === void 0 ? void 0 : _a.ontwerpTekststructuurDocumentComponenten.length) || documentComponent.inhoud));
1750
+ !!(((_a = this.getEmbeddedDocumentComponents(documentComponent)) === null || _a === void 0 ? void 0 : _a.length) || documentComponent.inhoud));
109
1751
  }
110
1752
  render() {
111
- var _a, _b;
112
1753
  const { DocumentComponent } = this;
113
- return (h("div", { style: { margin: "0 8px", borderLeft: "1px dashed pink", borderRight: "1px dashed pink" } }, h("dso-responsive-element", { class: "dso-document-components" }, (_b = (_a = this.response) === null || _a === void 0 ? void 0 : _a._embedded) === null || _b === void 0 ? void 0 : _b.ontwerpTekststructuurDocumentComponenten.map((d) => (h(Fragment, null, h(DocumentComponent, { path: [d] }), h("hr", null)))))));
1754
+ return (h("dso-responsive-element", { class: "dso-document-components" }, this.response && h(DocumentComponent, { path: [this.response] })));
114
1755
  }
115
- }, [0, "dsot-document-component-demo", {
1756
+ static get watchers() { return {
1757
+ "jsonFile": ["jsonFileWatcher"],
1758
+ "openDefault": ["openDefaultWatcher"]
1759
+ }; }
1760
+ static get style() { return documentComponentDemoCss; }
1761
+ }, [2, "dsot-document-component-demo", {
1762
+ "showCanvas": [516, "show-canvas"],
1763
+ "jsonFile": [1, "json-file"],
1764
+ "openDefault": [4, "open-default"],
116
1765
  "response": [32],
117
- "open": [32],
1766
+ "openOrClosed": [32],
118
1767
  "openedAnnotation": [32],
119
1768
  "filtered": [32],
120
1769
  "notApplicable": [32],