@dotcms/react 0.0.1-alpha.8 → 0.0.1-alpha.9

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 (41) hide show
  1. package/.babelrc +12 -0
  2. package/.eslintrc.json +18 -0
  3. package/jest.config.ts +11 -0
  4. package/package.json +27 -30
  5. package/project.json +51 -0
  6. package/src/{index.d.ts → index.ts} +0 -1
  7. package/src/lib/components/Column/Column.module.css +99 -0
  8. package/src/lib/components/Column/Column.spec.tsx +78 -0
  9. package/src/lib/components/Column/Column.tsx +45 -0
  10. package/src/lib/components/Container/Container.module.css +7 -0
  11. package/src/lib/components/Container/Container.spec.tsx +82 -0
  12. package/src/lib/components/Container/Container.tsx +105 -0
  13. package/src/lib/components/DotcmsLayout/DotcmsLayout.module.css +7 -0
  14. package/src/lib/components/DotcmsLayout/DotcmsLayout.spec.tsx +41 -0
  15. package/src/lib/components/DotcmsLayout/{DotcmsLayout.d.ts → DotcmsLayout.tsx} +19 -3
  16. package/src/lib/components/PageProvider/PageProvider.module.css +7 -0
  17. package/src/lib/components/PageProvider/PageProvider.spec.tsx +54 -0
  18. package/src/lib/components/PageProvider/{PageProvider.d.ts → PageProvider.tsx} +12 -1
  19. package/src/lib/components/Row/Row.module.css +5 -0
  20. package/src/lib/components/Row/Row.spec.tsx +92 -0
  21. package/src/lib/components/Row/Row.tsx +51 -0
  22. package/src/lib/contexts/PageContext.tsx +5 -0
  23. package/src/lib/hooks/useDotcmsEditor.spec.ts +56 -0
  24. package/src/lib/hooks/useDotcmsEditor.ts +29 -0
  25. package/src/lib/hooks/useDotcmsPageContext.spec.tsx +43 -0
  26. package/src/lib/hooks/{useDotcmsPageContext.d.ts → useDotcmsPageContext.tsx} +7 -1
  27. package/src/lib/mocks/mockPageContext.tsx +84 -0
  28. package/src/lib/utils/utils.ts +69 -0
  29. package/tsconfig.json +20 -0
  30. package/tsconfig.lib.json +23 -0
  31. package/tsconfig.spec.json +20 -0
  32. package/index.esm.d.ts +0 -1
  33. package/index.esm.js +0 -2803
  34. package/src/lib/components/Column/Column.d.ts +0 -5
  35. package/src/lib/components/Container/Container.d.ts +0 -5
  36. package/src/lib/components/Row/Row.d.ts +0 -25
  37. package/src/lib/contexts/PageContext.d.ts +0 -3
  38. package/src/lib/hooks/usePageEditor.d.ts +0 -50
  39. package/src/lib/mocks/mockPageContext.d.ts +0 -7
  40. package/src/lib/utils/utils.d.ts +0 -48
  41. /package/src/lib/mocks/{index.d.ts → index.ts} +0 -0
package/index.esm.js DELETED
@@ -1,2803 +0,0 @@
1
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { useRef, useState, useEffect, createContext, useContext, createElement as createElement$1, forwardRef } from 'react';
3
- import { postMessageToEditor, CUSTOMER_ACTIONS } from '@dotcms/client';
4
-
5
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
-
7
- var check = function (it) {
8
- return it && it.Math === Math && it;
9
- };
10
-
11
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
12
- var global$f =
13
- // eslint-disable-next-line es/no-global-this -- safe
14
- check(typeof globalThis == 'object' && globalThis) ||
15
- check(typeof window == 'object' && window) ||
16
- // eslint-disable-next-line no-restricted-globals -- safe
17
- check(typeof self == 'object' && self) ||
18
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
19
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
20
- // eslint-disable-next-line no-new-func -- fallback
21
- (function () { return this; })() || Function('return this')();
22
-
23
- var objectGetOwnPropertyDescriptor = {};
24
-
25
- var fails$h = function (exec) {
26
- try {
27
- return !!exec();
28
- } catch (error) {
29
- return true;
30
- }
31
- };
32
-
33
- var fails$g = fails$h;
34
-
35
- // Detect IE8's incomplete defineProperty implementation
36
- var descriptors = !fails$g(function () {
37
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
38
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
39
- });
40
-
41
- var fails$f = fails$h;
42
-
43
- var functionBindNative = !fails$f(function () {
44
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
45
- var test = (function () { /* empty */ }).bind();
46
- // eslint-disable-next-line no-prototype-builtins -- safe
47
- return typeof test != 'function' || test.hasOwnProperty('prototype');
48
- });
49
-
50
- var NATIVE_BIND$2 = functionBindNative;
51
-
52
- var call$b = Function.prototype.call;
53
-
54
- var functionCall = NATIVE_BIND$2 ? call$b.bind(call$b) : function () {
55
- return call$b.apply(call$b, arguments);
56
- };
57
-
58
- var objectPropertyIsEnumerable = {};
59
-
60
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
61
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
62
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
63
-
64
- // Nashorn ~ JDK8 bug
65
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
66
-
67
- // `Object.prototype.propertyIsEnumerable` method implementation
68
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
69
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
70
- var descriptor = getOwnPropertyDescriptor$1(this, V);
71
- return !!descriptor && descriptor.enumerable;
72
- } : $propertyIsEnumerable;
73
-
74
- var createPropertyDescriptor$3 = function (bitmap, value) {
75
- return {
76
- enumerable: !(bitmap & 1),
77
- configurable: !(bitmap & 2),
78
- writable: !(bitmap & 4),
79
- value: value
80
- };
81
- };
82
-
83
- var NATIVE_BIND$1 = functionBindNative;
84
-
85
- var FunctionPrototype$2 = Function.prototype;
86
- var call$a = FunctionPrototype$2.call;
87
- var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$2.bind.bind(call$a, call$a);
88
-
89
- var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
90
- return function () {
91
- return call$a.apply(fn, arguments);
92
- };
93
- };
94
-
95
- var uncurryThis$f = functionUncurryThis;
96
-
97
- var toString$6 = uncurryThis$f({}.toString);
98
- var stringSlice$5 = uncurryThis$f(''.slice);
99
-
100
- var classofRaw$1 = function (it) {
101
- return stringSlice$5(toString$6(it), 8, -1);
102
- };
103
-
104
- var uncurryThis$e = functionUncurryThis;
105
- var fails$e = fails$h;
106
- var classof$4 = classofRaw$1;
107
-
108
- var $Object$4 = Object;
109
- var split = uncurryThis$e(''.split);
110
-
111
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
112
- var indexedObject = fails$e(function () {
113
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
114
- // eslint-disable-next-line no-prototype-builtins -- safe
115
- return !$Object$4('z').propertyIsEnumerable(0);
116
- }) ? function (it) {
117
- return classof$4(it) === 'String' ? split(it, '') : $Object$4(it);
118
- } : $Object$4;
119
-
120
- // we can't use just `it == null` since of `document.all` special case
121
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
122
- var isNullOrUndefined$3 = function (it) {
123
- return it === null || it === undefined;
124
- };
125
-
126
- var isNullOrUndefined$2 = isNullOrUndefined$3;
127
-
128
- var $TypeError$8 = TypeError;
129
-
130
- // `RequireObjectCoercible` abstract operation
131
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
132
- var requireObjectCoercible$5 = function (it) {
133
- if (isNullOrUndefined$2(it)) throw new $TypeError$8("Can't call method on " + it);
134
- return it;
135
- };
136
-
137
- // toObject with fallback for non-array-like ES3 strings
138
- var IndexedObject$1 = indexedObject;
139
- var requireObjectCoercible$4 = requireObjectCoercible$5;
140
-
141
- var toIndexedObject$5 = function (it) {
142
- return IndexedObject$1(requireObjectCoercible$4(it));
143
- };
144
-
145
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
146
- var documentAll = typeof document == 'object' && document.all;
147
-
148
- // `IsCallable` abstract operation
149
- // https://tc39.es/ecma262/#sec-iscallable
150
- // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
151
- var isCallable$g = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
152
- return typeof argument == 'function' || argument === documentAll;
153
- } : function (argument) {
154
- return typeof argument == 'function';
155
- };
156
-
157
- var isCallable$f = isCallable$g;
158
-
159
- var isObject$8 = function (it) {
160
- return typeof it == 'object' ? it !== null : isCallable$f(it);
161
- };
162
-
163
- var global$e = global$f;
164
- var isCallable$e = isCallable$g;
165
-
166
- var aFunction = function (argument) {
167
- return isCallable$e(argument) ? argument : undefined;
168
- };
169
-
170
- var getBuiltIn$3 = function (namespace, method) {
171
- return arguments.length < 2 ? aFunction(global$e[namespace]) : global$e[namespace] && global$e[namespace][method];
172
- };
173
-
174
- var uncurryThis$d = functionUncurryThis;
175
-
176
- var objectIsPrototypeOf = uncurryThis$d({}.isPrototypeOf);
177
-
178
- var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
179
-
180
- var global$d = global$f;
181
- var userAgent = engineUserAgent;
182
-
183
- var process = global$d.process;
184
- var Deno = global$d.Deno;
185
- var versions = process && process.versions || Deno && Deno.version;
186
- var v8 = versions && versions.v8;
187
- var match, version;
188
-
189
- if (v8) {
190
- match = v8.split('.');
191
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
192
- // but their correct versions are not interesting for us
193
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
194
- }
195
-
196
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
197
- // so check `userAgent` even if `.v8` exists, but 0
198
- if (!version && userAgent) {
199
- match = userAgent.match(/Edge\/(\d+)/);
200
- if (!match || match[1] >= 74) {
201
- match = userAgent.match(/Chrome\/(\d+)/);
202
- if (match) version = +match[1];
203
- }
204
- }
205
-
206
- var engineV8Version = version;
207
-
208
- /* eslint-disable es/no-symbol -- required for testing */
209
- var V8_VERSION = engineV8Version;
210
- var fails$d = fails$h;
211
- var global$c = global$f;
212
-
213
- var $String$5 = global$c.String;
214
-
215
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
216
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$d(function () {
217
- var symbol = Symbol('symbol detection');
218
- // Chrome 38 Symbol has incorrect toString conversion
219
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
220
- // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
221
- // of course, fail.
222
- return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
223
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
224
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
225
- });
226
-
227
- /* eslint-disable es/no-symbol -- required for testing */
228
- var NATIVE_SYMBOL$1 = symbolConstructorDetection;
229
-
230
- var useSymbolAsUid = NATIVE_SYMBOL$1
231
- && !Symbol.sham
232
- && typeof Symbol.iterator == 'symbol';
233
-
234
- var getBuiltIn$2 = getBuiltIn$3;
235
- var isCallable$d = isCallable$g;
236
- var isPrototypeOf = objectIsPrototypeOf;
237
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
238
-
239
- var $Object$3 = Object;
240
-
241
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
242
- return typeof it == 'symbol';
243
- } : function (it) {
244
- var $Symbol = getBuiltIn$2('Symbol');
245
- return isCallable$d($Symbol) && isPrototypeOf($Symbol.prototype, $Object$3(it));
246
- };
247
-
248
- var $String$4 = String;
249
-
250
- var tryToString$1 = function (argument) {
251
- try {
252
- return $String$4(argument);
253
- } catch (error) {
254
- return 'Object';
255
- }
256
- };
257
-
258
- var isCallable$c = isCallable$g;
259
- var tryToString = tryToString$1;
260
-
261
- var $TypeError$7 = TypeError;
262
-
263
- // `Assert: IsCallable(argument) is true`
264
- var aCallable$2 = function (argument) {
265
- if (isCallable$c(argument)) return argument;
266
- throw new $TypeError$7(tryToString(argument) + ' is not a function');
267
- };
268
-
269
- var aCallable$1 = aCallable$2;
270
- var isNullOrUndefined$1 = isNullOrUndefined$3;
271
-
272
- // `GetMethod` abstract operation
273
- // https://tc39.es/ecma262/#sec-getmethod
274
- var getMethod$2 = function (V, P) {
275
- var func = V[P];
276
- return isNullOrUndefined$1(func) ? undefined : aCallable$1(func);
277
- };
278
-
279
- var call$9 = functionCall;
280
- var isCallable$b = isCallable$g;
281
- var isObject$7 = isObject$8;
282
-
283
- var $TypeError$6 = TypeError;
284
-
285
- // `OrdinaryToPrimitive` abstract operation
286
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
287
- var ordinaryToPrimitive$1 = function (input, pref) {
288
- var fn, val;
289
- if (pref === 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$9(fn, input))) return val;
290
- if (isCallable$b(fn = input.valueOf) && !isObject$7(val = call$9(fn, input))) return val;
291
- if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$9(fn, input))) return val;
292
- throw new $TypeError$6("Can't convert object to primitive value");
293
- };
294
-
295
- var shared$4 = {exports: {}};
296
-
297
- var global$b = global$f;
298
-
299
- // eslint-disable-next-line es/no-object-defineproperty -- safe
300
- var defineProperty$5 = Object.defineProperty;
301
-
302
- var defineGlobalProperty$3 = function (key, value) {
303
- try {
304
- defineProperty$5(global$b, key, { value: value, configurable: true, writable: true });
305
- } catch (error) {
306
- global$b[key] = value;
307
- } return value;
308
- };
309
-
310
- var global$a = global$f;
311
- var defineGlobalProperty$2 = defineGlobalProperty$3;
312
-
313
- var SHARED = '__core-js_shared__';
314
- var store$3 = global$a[SHARED] || defineGlobalProperty$2(SHARED, {});
315
-
316
- var sharedStore = store$3;
317
-
318
- var store$2 = sharedStore;
319
-
320
- (shared$4.exports = function (key, value) {
321
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
322
- })('versions', []).push({
323
- version: '3.35.1',
324
- mode: 'global',
325
- copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
326
- license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',
327
- source: 'https://github.com/zloirock/core-js'
328
- });
329
-
330
- var requireObjectCoercible$3 = requireObjectCoercible$5;
331
-
332
- var $Object$2 = Object;
333
-
334
- // `ToObject` abstract operation
335
- // https://tc39.es/ecma262/#sec-toobject
336
- var toObject$4 = function (argument) {
337
- return $Object$2(requireObjectCoercible$3(argument));
338
- };
339
-
340
- var uncurryThis$c = functionUncurryThis;
341
- var toObject$3 = toObject$4;
342
-
343
- var hasOwnProperty = uncurryThis$c({}.hasOwnProperty);
344
-
345
- // `HasOwnProperty` abstract operation
346
- // https://tc39.es/ecma262/#sec-hasownproperty
347
- // eslint-disable-next-line es/no-object-hasown -- safe
348
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
349
- return hasOwnProperty(toObject$3(it), key);
350
- };
351
-
352
- var uncurryThis$b = functionUncurryThis;
353
-
354
- var id = 0;
355
- var postfix = Math.random();
356
- var toString$5 = uncurryThis$b(1.0.toString);
357
-
358
- var uid$2 = function (key) {
359
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$5(++id + postfix, 36);
360
- };
361
-
362
- var global$9 = global$f;
363
- var shared$3 = shared$4.exports;
364
- var hasOwn$8 = hasOwnProperty_1;
365
- var uid$1 = uid$2;
366
- var NATIVE_SYMBOL = symbolConstructorDetection;
367
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
368
-
369
- var Symbol$1 = global$9.Symbol;
370
- var WellKnownSymbolsStore = shared$3('wks');
371
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
372
-
373
- var wellKnownSymbol$c = function (name) {
374
- if (!hasOwn$8(WellKnownSymbolsStore, name)) {
375
- WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$8(Symbol$1, name)
376
- ? Symbol$1[name]
377
- : createWellKnownSymbol('Symbol.' + name);
378
- } return WellKnownSymbolsStore[name];
379
- };
380
-
381
- var call$8 = functionCall;
382
- var isObject$6 = isObject$8;
383
- var isSymbol$1 = isSymbol$2;
384
- var getMethod$1 = getMethod$2;
385
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
386
- var wellKnownSymbol$b = wellKnownSymbol$c;
387
-
388
- var $TypeError$5 = TypeError;
389
- var TO_PRIMITIVE = wellKnownSymbol$b('toPrimitive');
390
-
391
- // `ToPrimitive` abstract operation
392
- // https://tc39.es/ecma262/#sec-toprimitive
393
- var toPrimitive$1 = function (input, pref) {
394
- if (!isObject$6(input) || isSymbol$1(input)) return input;
395
- var exoticToPrim = getMethod$1(input, TO_PRIMITIVE);
396
- var result;
397
- if (exoticToPrim) {
398
- if (pref === undefined) pref = 'default';
399
- result = call$8(exoticToPrim, input, pref);
400
- if (!isObject$6(result) || isSymbol$1(result)) return result;
401
- throw new $TypeError$5("Can't convert object to primitive value");
402
- }
403
- if (pref === undefined) pref = 'number';
404
- return ordinaryToPrimitive(input, pref);
405
- };
406
-
407
- var toPrimitive = toPrimitive$1;
408
- var isSymbol = isSymbol$2;
409
-
410
- // `ToPropertyKey` abstract operation
411
- // https://tc39.es/ecma262/#sec-topropertykey
412
- var toPropertyKey$2 = function (argument) {
413
- var key = toPrimitive(argument, 'string');
414
- return isSymbol(key) ? key : key + '';
415
- };
416
-
417
- var global$8 = global$f;
418
- var isObject$5 = isObject$8;
419
-
420
- var document$1 = global$8.document;
421
- // typeof document.createElement is 'object' in old IE
422
- var EXISTS$1 = isObject$5(document$1) && isObject$5(document$1.createElement);
423
-
424
- var documentCreateElement$2 = function (it) {
425
- return EXISTS$1 ? document$1.createElement(it) : {};
426
- };
427
-
428
- var DESCRIPTORS$9 = descriptors;
429
- var fails$c = fails$h;
430
- var createElement = documentCreateElement$2;
431
-
432
- // Thanks to IE8 for its funny defineProperty
433
- var ie8DomDefine = !DESCRIPTORS$9 && !fails$c(function () {
434
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
435
- return Object.defineProperty(createElement('div'), 'a', {
436
- get: function () { return 7; }
437
- }).a !== 7;
438
- });
439
-
440
- var DESCRIPTORS$8 = descriptors;
441
- var call$7 = functionCall;
442
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
443
- var createPropertyDescriptor$2 = createPropertyDescriptor$3;
444
- var toIndexedObject$4 = toIndexedObject$5;
445
- var toPropertyKey$1 = toPropertyKey$2;
446
- var hasOwn$7 = hasOwnProperty_1;
447
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
448
-
449
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
450
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
451
-
452
- // `Object.getOwnPropertyDescriptor` method
453
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
454
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
455
- O = toIndexedObject$4(O);
456
- P = toPropertyKey$1(P);
457
- if (IE8_DOM_DEFINE$1) try {
458
- return $getOwnPropertyDescriptor$1(O, P);
459
- } catch (error) { /* empty */ }
460
- if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$7(propertyIsEnumerableModule$1.f, O, P), O[P]);
461
- };
462
-
463
- var objectDefineProperty = {};
464
-
465
- var DESCRIPTORS$7 = descriptors;
466
- var fails$b = fails$h;
467
-
468
- // V8 ~ Chrome 36-
469
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
470
- var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$b(function () {
471
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
472
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
473
- value: 42,
474
- writable: false
475
- }).prototype !== 42;
476
- });
477
-
478
- var isObject$4 = isObject$8;
479
-
480
- var $String$3 = String;
481
- var $TypeError$4 = TypeError;
482
-
483
- // `Assert: Type(argument) is Object`
484
- var anObject$8 = function (argument) {
485
- if (isObject$4(argument)) return argument;
486
- throw new $TypeError$4($String$3(argument) + ' is not an object');
487
- };
488
-
489
- var DESCRIPTORS$6 = descriptors;
490
- var IE8_DOM_DEFINE = ie8DomDefine;
491
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
492
- var anObject$7 = anObject$8;
493
- var toPropertyKey = toPropertyKey$2;
494
-
495
- var $TypeError$3 = TypeError;
496
- // eslint-disable-next-line es/no-object-defineproperty -- safe
497
- var $defineProperty = Object.defineProperty;
498
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
499
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
500
- var ENUMERABLE = 'enumerable';
501
- var CONFIGURABLE$1 = 'configurable';
502
- var WRITABLE = 'writable';
503
-
504
- // `Object.defineProperty` method
505
- // https://tc39.es/ecma262/#sec-object.defineproperty
506
- objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
507
- anObject$7(O);
508
- P = toPropertyKey(P);
509
- anObject$7(Attributes);
510
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
511
- var current = $getOwnPropertyDescriptor(O, P);
512
- if (current && current[WRITABLE]) {
513
- O[P] = Attributes.value;
514
- Attributes = {
515
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
516
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
517
- writable: false
518
- };
519
- }
520
- } return $defineProperty(O, P, Attributes);
521
- } : $defineProperty : function defineProperty(O, P, Attributes) {
522
- anObject$7(O);
523
- P = toPropertyKey(P);
524
- anObject$7(Attributes);
525
- if (IE8_DOM_DEFINE) try {
526
- return $defineProperty(O, P, Attributes);
527
- } catch (error) { /* empty */ }
528
- if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$3('Accessors not supported');
529
- if ('value' in Attributes) O[P] = Attributes.value;
530
- return O;
531
- };
532
-
533
- var DESCRIPTORS$5 = descriptors;
534
- var definePropertyModule$3 = objectDefineProperty;
535
- var createPropertyDescriptor$1 = createPropertyDescriptor$3;
536
-
537
- var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
538
- return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
539
- } : function (object, key, value) {
540
- object[key] = value;
541
- return object;
542
- };
543
-
544
- var makeBuiltIn$2 = {exports: {}};
545
-
546
- var DESCRIPTORS$4 = descriptors;
547
- var hasOwn$6 = hasOwnProperty_1;
548
-
549
- var FunctionPrototype$1 = Function.prototype;
550
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
551
- var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
552
-
553
- var EXISTS = hasOwn$6(FunctionPrototype$1, 'name');
554
- // additional protection from minified / mangled / dropped function names
555
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
556
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype$1, 'name').configurable));
557
-
558
- var functionName = {
559
- EXISTS: EXISTS,
560
- PROPER: PROPER,
561
- CONFIGURABLE: CONFIGURABLE
562
- };
563
-
564
- var uncurryThis$a = functionUncurryThis;
565
- var isCallable$a = isCallable$g;
566
- var store$1 = sharedStore;
567
-
568
- var functionToString = uncurryThis$a(Function.toString);
569
-
570
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
571
- if (!isCallable$a(store$1.inspectSource)) {
572
- store$1.inspectSource = function (it) {
573
- return functionToString(it);
574
- };
575
- }
576
-
577
- var inspectSource$1 = store$1.inspectSource;
578
-
579
- var global$7 = global$f;
580
- var isCallable$9 = isCallable$g;
581
-
582
- var WeakMap$1 = global$7.WeakMap;
583
-
584
- var weakMapBasicDetection = isCallable$9(WeakMap$1) && /native code/.test(String(WeakMap$1));
585
-
586
- var shared$2 = shared$4.exports;
587
- var uid = uid$2;
588
-
589
- var keys = shared$2('keys');
590
-
591
- var sharedKey$3 = function (key) {
592
- return keys[key] || (keys[key] = uid(key));
593
- };
594
-
595
- var hiddenKeys$4 = {};
596
-
597
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
598
- var global$6 = global$f;
599
- var isObject$3 = isObject$8;
600
- var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
601
- var hasOwn$5 = hasOwnProperty_1;
602
- var shared$1 = sharedStore;
603
- var sharedKey$2 = sharedKey$3;
604
- var hiddenKeys$3 = hiddenKeys$4;
605
-
606
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
607
- var TypeError$1 = global$6.TypeError;
608
- var WeakMap = global$6.WeakMap;
609
- var set, get, has;
610
-
611
- var enforce = function (it) {
612
- return has(it) ? get(it) : set(it, {});
613
- };
614
-
615
- var getterFor = function (TYPE) {
616
- return function (it) {
617
- var state;
618
- if (!isObject$3(it) || (state = get(it)).type !== TYPE) {
619
- throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
620
- } return state;
621
- };
622
- };
623
-
624
- if (NATIVE_WEAK_MAP || shared$1.state) {
625
- var store = shared$1.state || (shared$1.state = new WeakMap());
626
- /* eslint-disable no-self-assign -- prototype methods protection */
627
- store.get = store.get;
628
- store.has = store.has;
629
- store.set = store.set;
630
- /* eslint-enable no-self-assign -- prototype methods protection */
631
- set = function (it, metadata) {
632
- if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
633
- metadata.facade = it;
634
- store.set(it, metadata);
635
- return metadata;
636
- };
637
- get = function (it) {
638
- return store.get(it) || {};
639
- };
640
- has = function (it) {
641
- return store.has(it);
642
- };
643
- } else {
644
- var STATE = sharedKey$2('state');
645
- hiddenKeys$3[STATE] = true;
646
- set = function (it, metadata) {
647
- if (hasOwn$5(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
648
- metadata.facade = it;
649
- createNonEnumerableProperty$4(it, STATE, metadata);
650
- return metadata;
651
- };
652
- get = function (it) {
653
- return hasOwn$5(it, STATE) ? it[STATE] : {};
654
- };
655
- has = function (it) {
656
- return hasOwn$5(it, STATE);
657
- };
658
- }
659
-
660
- var internalState = {
661
- set: set,
662
- get: get,
663
- has: has,
664
- enforce: enforce,
665
- getterFor: getterFor
666
- };
667
-
668
- var uncurryThis$9 = functionUncurryThis;
669
- var fails$a = fails$h;
670
- var isCallable$8 = isCallable$g;
671
- var hasOwn$4 = hasOwnProperty_1;
672
- var DESCRIPTORS$3 = descriptors;
673
- var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
674
- var inspectSource = inspectSource$1;
675
- var InternalStateModule$1 = internalState;
676
-
677
- var enforceInternalState = InternalStateModule$1.enforce;
678
- var getInternalState$2 = InternalStateModule$1.get;
679
- var $String$2 = String;
680
- // eslint-disable-next-line es/no-object-defineproperty -- safe
681
- var defineProperty$4 = Object.defineProperty;
682
- var stringSlice$4 = uncurryThis$9(''.slice);
683
- var replace$2 = uncurryThis$9(''.replace);
684
- var join = uncurryThis$9([].join);
685
-
686
- var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$a(function () {
687
- return defineProperty$4(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
688
- });
689
-
690
- var TEMPLATE = String(String).split('String');
691
-
692
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
693
- if (stringSlice$4($String$2(name), 0, 7) === 'Symbol(') {
694
- name = '[' + replace$2($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
695
- }
696
- if (options && options.getter) name = 'get ' + name;
697
- if (options && options.setter) name = 'set ' + name;
698
- if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
699
- if (DESCRIPTORS$3) defineProperty$4(value, 'name', { value: name, configurable: true });
700
- else value.name = name;
701
- }
702
- if (CONFIGURABLE_LENGTH && options && hasOwn$4(options, 'arity') && value.length !== options.arity) {
703
- defineProperty$4(value, 'length', { value: options.arity });
704
- }
705
- try {
706
- if (options && hasOwn$4(options, 'constructor') && options.constructor) {
707
- if (DESCRIPTORS$3) defineProperty$4(value, 'prototype', { writable: false });
708
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
709
- } else if (value.prototype) value.prototype = undefined;
710
- } catch (error) { /* empty */ }
711
- var state = enforceInternalState(value);
712
- if (!hasOwn$4(state, 'source')) {
713
- state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
714
- } return value;
715
- };
716
-
717
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
718
- // eslint-disable-next-line no-extend-native -- required
719
- Function.prototype.toString = makeBuiltIn$1(function toString() {
720
- return isCallable$8(this) && getInternalState$2(this).source || inspectSource(this);
721
- }, 'toString');
722
-
723
- var isCallable$7 = isCallable$g;
724
- var definePropertyModule$2 = objectDefineProperty;
725
- var makeBuiltIn = makeBuiltIn$2.exports;
726
- var defineGlobalProperty$1 = defineGlobalProperty$3;
727
-
728
- var defineBuiltIn$4 = function (O, key, value, options) {
729
- if (!options) options = {};
730
- var simple = options.enumerable;
731
- var name = options.name !== undefined ? options.name : key;
732
- if (isCallable$7(value)) makeBuiltIn(value, name, options);
733
- if (options.global) {
734
- if (simple) O[key] = value;
735
- else defineGlobalProperty$1(key, value);
736
- } else {
737
- try {
738
- if (!options.unsafe) delete O[key];
739
- else if (O[key]) simple = true;
740
- } catch (error) { /* empty */ }
741
- if (simple) O[key] = value;
742
- else definePropertyModule$2.f(O, key, {
743
- value: value,
744
- enumerable: false,
745
- configurable: !options.nonConfigurable,
746
- writable: !options.nonWritable
747
- });
748
- } return O;
749
- };
750
-
751
- var objectGetOwnPropertyNames = {};
752
-
753
- var ceil = Math.ceil;
754
- var floor$1 = Math.floor;
755
-
756
- // `Math.trunc` method
757
- // https://tc39.es/ecma262/#sec-math.trunc
758
- // eslint-disable-next-line es/no-math-trunc -- safe
759
- var mathTrunc = Math.trunc || function trunc(x) {
760
- var n = +x;
761
- return (n > 0 ? floor$1 : ceil)(n);
762
- };
763
-
764
- var trunc = mathTrunc;
765
-
766
- // `ToIntegerOrInfinity` abstract operation
767
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
768
- var toIntegerOrInfinity$4 = function (argument) {
769
- var number = +argument;
770
- // eslint-disable-next-line no-self-compare -- NaN check
771
- return number !== number || number === 0 ? 0 : trunc(number);
772
- };
773
-
774
- var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
775
-
776
- var max$1 = Math.max;
777
- var min$2 = Math.min;
778
-
779
- // Helper for a popular repeating case of the spec:
780
- // Let integer be ? ToInteger(index).
781
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
782
- var toAbsoluteIndex$1 = function (index, length) {
783
- var integer = toIntegerOrInfinity$3(index);
784
- return integer < 0 ? max$1(integer + length, 0) : min$2(integer, length);
785
- };
786
-
787
- var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
788
-
789
- var min$1 = Math.min;
790
-
791
- // `ToLength` abstract operation
792
- // https://tc39.es/ecma262/#sec-tolength
793
- var toLength$2 = function (argument) {
794
- var len = toIntegerOrInfinity$2(argument);
795
- return len > 0 ? min$1(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
796
- };
797
-
798
- var toLength$1 = toLength$2;
799
-
800
- // `LengthOfArrayLike` abstract operation
801
- // https://tc39.es/ecma262/#sec-lengthofarraylike
802
- var lengthOfArrayLike$1 = function (obj) {
803
- return toLength$1(obj.length);
804
- };
805
-
806
- var toIndexedObject$3 = toIndexedObject$5;
807
- var toAbsoluteIndex = toAbsoluteIndex$1;
808
- var lengthOfArrayLike = lengthOfArrayLike$1;
809
-
810
- // `Array.prototype.{ indexOf, includes }` methods implementation
811
- var createMethod$1 = function (IS_INCLUDES) {
812
- return function ($this, el, fromIndex) {
813
- var O = toIndexedObject$3($this);
814
- var length = lengthOfArrayLike(O);
815
- var index = toAbsoluteIndex(fromIndex, length);
816
- var value;
817
- // Array#includes uses SameValueZero equality algorithm
818
- // eslint-disable-next-line no-self-compare -- NaN check
819
- if (IS_INCLUDES && el !== el) while (length > index) {
820
- value = O[index++];
821
- // eslint-disable-next-line no-self-compare -- NaN check
822
- if (value !== value) return true;
823
- // Array#indexOf ignores holes, Array#includes - not
824
- } else for (;length > index; index++) {
825
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
826
- } return !IS_INCLUDES && -1;
827
- };
828
- };
829
-
830
- var arrayIncludes = {
831
- // `Array.prototype.includes` method
832
- // https://tc39.es/ecma262/#sec-array.prototype.includes
833
- includes: createMethod$1(true),
834
- // `Array.prototype.indexOf` method
835
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
836
- indexOf: createMethod$1(false)
837
- };
838
-
839
- var uncurryThis$8 = functionUncurryThis;
840
- var hasOwn$3 = hasOwnProperty_1;
841
- var toIndexedObject$2 = toIndexedObject$5;
842
- var indexOf$1 = arrayIncludes.indexOf;
843
- var hiddenKeys$2 = hiddenKeys$4;
844
-
845
- var push$1 = uncurryThis$8([].push);
846
-
847
- var objectKeysInternal = function (object, names) {
848
- var O = toIndexedObject$2(object);
849
- var i = 0;
850
- var result = [];
851
- var key;
852
- for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push$1(result, key);
853
- // Don't enum bug & hidden keys
854
- while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
855
- ~indexOf$1(result, key) || push$1(result, key);
856
- }
857
- return result;
858
- };
859
-
860
- // IE8- don't enum bug keys
861
- var enumBugKeys$3 = [
862
- 'constructor',
863
- 'hasOwnProperty',
864
- 'isPrototypeOf',
865
- 'propertyIsEnumerable',
866
- 'toLocaleString',
867
- 'toString',
868
- 'valueOf'
869
- ];
870
-
871
- var internalObjectKeys$1 = objectKeysInternal;
872
- var enumBugKeys$2 = enumBugKeys$3;
873
-
874
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
875
-
876
- // `Object.getOwnPropertyNames` method
877
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
878
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
879
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
880
- return internalObjectKeys$1(O, hiddenKeys$1);
881
- };
882
-
883
- var objectGetOwnPropertySymbols = {};
884
-
885
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
886
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
887
-
888
- var getBuiltIn$1 = getBuiltIn$3;
889
- var uncurryThis$7 = functionUncurryThis;
890
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
891
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
892
- var anObject$6 = anObject$8;
893
-
894
- var concat$2 = uncurryThis$7([].concat);
895
-
896
- // all object keys, includes non-enumerable and symbols
897
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
898
- var keys = getOwnPropertyNamesModule.f(anObject$6(it));
899
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
900
- return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
901
- };
902
-
903
- var hasOwn$2 = hasOwnProperty_1;
904
- var ownKeys = ownKeys$1;
905
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
906
- var definePropertyModule$1 = objectDefineProperty;
907
-
908
- var copyConstructorProperties$1 = function (target, source, exceptions) {
909
- var keys = ownKeys(source);
910
- var defineProperty = definePropertyModule$1.f;
911
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
912
- for (var i = 0; i < keys.length; i++) {
913
- var key = keys[i];
914
- if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
915
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
916
- }
917
- }
918
- };
919
-
920
- var fails$9 = fails$h;
921
- var isCallable$6 = isCallable$g;
922
-
923
- var replacement = /#|\.prototype\./;
924
-
925
- var isForced$1 = function (feature, detection) {
926
- var value = data[normalize(feature)];
927
- return value === POLYFILL ? true
928
- : value === NATIVE ? false
929
- : isCallable$6(detection) ? fails$9(detection)
930
- : !!detection;
931
- };
932
-
933
- var normalize = isForced$1.normalize = function (string) {
934
- return String(string).replace(replacement, '.').toLowerCase();
935
- };
936
-
937
- var data = isForced$1.data = {};
938
- var NATIVE = isForced$1.NATIVE = 'N';
939
- var POLYFILL = isForced$1.POLYFILL = 'P';
940
-
941
- var isForced_1 = isForced$1;
942
-
943
- var global$5 = global$f;
944
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
945
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
946
- var defineBuiltIn$3 = defineBuiltIn$4;
947
- var defineGlobalProperty = defineGlobalProperty$3;
948
- var copyConstructorProperties = copyConstructorProperties$1;
949
- var isForced = isForced_1;
950
-
951
- /*
952
- options.target - name of the target object
953
- options.global - target is the global object
954
- options.stat - export as static methods of target
955
- options.proto - export as prototype methods of target
956
- options.real - real prototype method for the `pure` version
957
- options.forced - export even if the native feature is available
958
- options.bind - bind methods to the target, required for the `pure` version
959
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
960
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
961
- options.sham - add a flag to not completely full polyfills
962
- options.enumerable - export as enumerable property
963
- options.dontCallGetSet - prevent calling a getter on target
964
- options.name - the .name of the function if it does not match the key
965
- */
966
- var _export = function (options, source) {
967
- var TARGET = options.target;
968
- var GLOBAL = options.global;
969
- var STATIC = options.stat;
970
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
971
- if (GLOBAL) {
972
- target = global$5;
973
- } else if (STATIC) {
974
- target = global$5[TARGET] || defineGlobalProperty(TARGET, {});
975
- } else {
976
- target = global$5[TARGET] && global$5[TARGET].prototype;
977
- }
978
- if (target) for (key in source) {
979
- sourceProperty = source[key];
980
- if (options.dontCallGetSet) {
981
- descriptor = getOwnPropertyDescriptor(target, key);
982
- targetProperty = descriptor && descriptor.value;
983
- } else targetProperty = target[key];
984
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
985
- // contained in target
986
- if (!FORCED && targetProperty !== undefined) {
987
- if (typeof sourceProperty == typeof targetProperty) continue;
988
- copyConstructorProperties(sourceProperty, targetProperty);
989
- }
990
- // add a flag to not completely full polyfills
991
- if (options.sham || (targetProperty && targetProperty.sham)) {
992
- createNonEnumerableProperty$3(sourceProperty, 'sham', true);
993
- }
994
- defineBuiltIn$3(target, key, sourceProperty, options);
995
- }
996
- };
997
-
998
- var objectDefineProperties = {};
999
-
1000
- var internalObjectKeys = objectKeysInternal;
1001
- var enumBugKeys$1 = enumBugKeys$3;
1002
-
1003
- // `Object.keys` method
1004
- // https://tc39.es/ecma262/#sec-object.keys
1005
- // eslint-disable-next-line es/no-object-keys -- safe
1006
- var objectKeys$2 = Object.keys || function keys(O) {
1007
- return internalObjectKeys(O, enumBugKeys$1);
1008
- };
1009
-
1010
- var DESCRIPTORS$2 = descriptors;
1011
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1012
- var definePropertyModule = objectDefineProperty;
1013
- var anObject$5 = anObject$8;
1014
- var toIndexedObject$1 = toIndexedObject$5;
1015
- var objectKeys$1 = objectKeys$2;
1016
-
1017
- // `Object.defineProperties` method
1018
- // https://tc39.es/ecma262/#sec-object.defineproperties
1019
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1020
- objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1021
- anObject$5(O);
1022
- var props = toIndexedObject$1(Properties);
1023
- var keys = objectKeys$1(Properties);
1024
- var length = keys.length;
1025
- var index = 0;
1026
- var key;
1027
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1028
- return O;
1029
- };
1030
-
1031
- var getBuiltIn = getBuiltIn$3;
1032
-
1033
- var html$1 = getBuiltIn('document', 'documentElement');
1034
-
1035
- /* global ActiveXObject -- old IE, WSH */
1036
- var anObject$4 = anObject$8;
1037
- var definePropertiesModule = objectDefineProperties;
1038
- var enumBugKeys = enumBugKeys$3;
1039
- var hiddenKeys = hiddenKeys$4;
1040
- var html = html$1;
1041
- var documentCreateElement$1 = documentCreateElement$2;
1042
- var sharedKey$1 = sharedKey$3;
1043
-
1044
- var GT = '>';
1045
- var LT = '<';
1046
- var PROTOTYPE = 'prototype';
1047
- var SCRIPT = 'script';
1048
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1049
-
1050
- var EmptyConstructor = function () { /* empty */ };
1051
-
1052
- var scriptTag = function (content) {
1053
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1054
- };
1055
-
1056
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1057
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1058
- activeXDocument.write(scriptTag(''));
1059
- activeXDocument.close();
1060
- var temp = activeXDocument.parentWindow.Object;
1061
- activeXDocument = null; // avoid memory leak
1062
- return temp;
1063
- };
1064
-
1065
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1066
- var NullProtoObjectViaIFrame = function () {
1067
- // Thrash, waste and sodomy: IE GC bug
1068
- var iframe = documentCreateElement$1('iframe');
1069
- var JS = 'java' + SCRIPT + ':';
1070
- var iframeDocument;
1071
- iframe.style.display = 'none';
1072
- html.appendChild(iframe);
1073
- // https://github.com/zloirock/core-js/issues/475
1074
- iframe.src = String(JS);
1075
- iframeDocument = iframe.contentWindow.document;
1076
- iframeDocument.open();
1077
- iframeDocument.write(scriptTag('document.F=Object'));
1078
- iframeDocument.close();
1079
- return iframeDocument.F;
1080
- };
1081
-
1082
- // Check for document.domain and active x support
1083
- // No need to use active x approach when document.domain is not set
1084
- // see https://github.com/es-shims/es5-shim/issues/150
1085
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1086
- // avoid IE GC bug
1087
- var activeXDocument;
1088
- var NullProtoObject = function () {
1089
- try {
1090
- activeXDocument = new ActiveXObject('htmlfile');
1091
- } catch (error) { /* ignore */ }
1092
- NullProtoObject = typeof document != 'undefined'
1093
- ? document.domain && activeXDocument
1094
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1095
- : NullProtoObjectViaIFrame()
1096
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1097
- var length = enumBugKeys.length;
1098
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1099
- return NullProtoObject();
1100
- };
1101
-
1102
- hiddenKeys[IE_PROTO$1] = true;
1103
-
1104
- // `Object.create` method
1105
- // https://tc39.es/ecma262/#sec-object.create
1106
- // eslint-disable-next-line es/no-object-create -- safe
1107
- var objectCreate = Object.create || function create(O, Properties) {
1108
- var result;
1109
- if (O !== null) {
1110
- EmptyConstructor[PROTOTYPE] = anObject$4(O);
1111
- result = new EmptyConstructor();
1112
- EmptyConstructor[PROTOTYPE] = null;
1113
- // add "__proto__" for Object.getPrototypeOf polyfill
1114
- result[IE_PROTO$1] = O;
1115
- } else result = NullProtoObject();
1116
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1117
- };
1118
-
1119
- var wellKnownSymbol$a = wellKnownSymbol$c;
1120
- var create$2 = objectCreate;
1121
- var defineProperty$3 = objectDefineProperty.f;
1122
-
1123
- var UNSCOPABLES = wellKnownSymbol$a('unscopables');
1124
- var ArrayPrototype = Array.prototype;
1125
-
1126
- // Array.prototype[@@unscopables]
1127
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1128
- if (ArrayPrototype[UNSCOPABLES] === undefined) {
1129
- defineProperty$3(ArrayPrototype, UNSCOPABLES, {
1130
- configurable: true,
1131
- value: create$2(null)
1132
- });
1133
- }
1134
-
1135
- // add a key to Array.prototype[@@unscopables]
1136
- var addToUnscopables$2 = function (key) {
1137
- ArrayPrototype[UNSCOPABLES][key] = true;
1138
- };
1139
-
1140
- var $$4 = _export;
1141
- var $includes = arrayIncludes.includes;
1142
- var fails$8 = fails$h;
1143
- var addToUnscopables$1 = addToUnscopables$2;
1144
-
1145
- // FF99+ bug
1146
- var BROKEN_ON_SPARSE = fails$8(function () {
1147
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
1148
- return !Array(1).includes();
1149
- });
1150
-
1151
- // `Array.prototype.includes` method
1152
- // https://tc39.es/ecma262/#sec-array.prototype.includes
1153
- $$4({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
1154
- includes: function includes(el /* , fromIndex = 0 */) {
1155
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1156
- }
1157
- });
1158
-
1159
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1160
- addToUnscopables$1('includes');
1161
-
1162
- var isObject$2 = isObject$8;
1163
- var classof$3 = classofRaw$1;
1164
- var wellKnownSymbol$9 = wellKnownSymbol$c;
1165
-
1166
- var MATCH$1 = wellKnownSymbol$9('match');
1167
-
1168
- // `IsRegExp` abstract operation
1169
- // https://tc39.es/ecma262/#sec-isregexp
1170
- var isRegexp = function (it) {
1171
- var isRegExp;
1172
- return isObject$2(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$3(it) === 'RegExp');
1173
- };
1174
-
1175
- var isRegExp = isRegexp;
1176
-
1177
- var $TypeError$2 = TypeError;
1178
-
1179
- var notARegexp = function (it) {
1180
- if (isRegExp(it)) {
1181
- throw new $TypeError$2("The method doesn't accept regular expressions");
1182
- } return it;
1183
- };
1184
-
1185
- var wellKnownSymbol$8 = wellKnownSymbol$c;
1186
-
1187
- var TO_STRING_TAG$2 = wellKnownSymbol$8('toStringTag');
1188
- var test = {};
1189
-
1190
- test[TO_STRING_TAG$2] = 'z';
1191
-
1192
- var toStringTagSupport = String(test) === '[object z]';
1193
-
1194
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1195
- var isCallable$5 = isCallable$g;
1196
- var classofRaw = classofRaw$1;
1197
- var wellKnownSymbol$7 = wellKnownSymbol$c;
1198
-
1199
- var TO_STRING_TAG$1 = wellKnownSymbol$7('toStringTag');
1200
- var $Object$1 = Object;
1201
-
1202
- // ES3 wrong here
1203
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
1204
-
1205
- // fallback for IE11 Script Access Denied error
1206
- var tryGet = function (it, key) {
1207
- try {
1208
- return it[key];
1209
- } catch (error) { /* empty */ }
1210
- };
1211
-
1212
- // getting tag from ES6+ `Object.prototype.toString`
1213
- var classof$2 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1214
- var O, tag, result;
1215
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1216
- // @@toStringTag case
1217
- : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
1218
- // builtinTag case
1219
- : CORRECT_ARGUMENTS ? classofRaw(O)
1220
- // ES3 arguments fallback
1221
- : (result = classofRaw(O)) === 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1222
- };
1223
-
1224
- var classof$1 = classof$2;
1225
-
1226
- var $String$1 = String;
1227
-
1228
- var toString$4 = function (argument) {
1229
- if (classof$1(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1230
- return $String$1(argument);
1231
- };
1232
-
1233
- var wellKnownSymbol$6 = wellKnownSymbol$c;
1234
-
1235
- var MATCH = wellKnownSymbol$6('match');
1236
-
1237
- var correctIsRegexpLogic = function (METHOD_NAME) {
1238
- var regexp = /./;
1239
- try {
1240
- '/./'[METHOD_NAME](regexp);
1241
- } catch (error1) {
1242
- try {
1243
- regexp[MATCH] = false;
1244
- return '/./'[METHOD_NAME](regexp);
1245
- } catch (error2) { /* empty */ }
1246
- } return false;
1247
- };
1248
-
1249
- var $$3 = _export;
1250
- var uncurryThis$6 = functionUncurryThis;
1251
- var notARegExp = notARegexp;
1252
- var requireObjectCoercible$2 = requireObjectCoercible$5;
1253
- var toString$3 = toString$4;
1254
- var correctIsRegExpLogic = correctIsRegexpLogic;
1255
-
1256
- var stringIndexOf$1 = uncurryThis$6(''.indexOf);
1257
-
1258
- // `String.prototype.includes` method
1259
- // https://tc39.es/ecma262/#sec-string.prototype.includes
1260
- $$3({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
1261
- includes: function includes(searchString /* , position = 0 */) {
1262
- return !!~stringIndexOf$1(
1263
- toString$3(requireObjectCoercible$2(this)),
1264
- toString$3(notARegExp(searchString)),
1265
- arguments.length > 1 ? arguments[1] : undefined
1266
- );
1267
- }
1268
- });
1269
-
1270
- var iterators = {};
1271
-
1272
- var fails$7 = fails$h;
1273
-
1274
- var correctPrototypeGetter = !fails$7(function () {
1275
- function F() { /* empty */ }
1276
- F.prototype.constructor = null;
1277
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1278
- return Object.getPrototypeOf(new F()) !== F.prototype;
1279
- });
1280
-
1281
- var hasOwn$1 = hasOwnProperty_1;
1282
- var isCallable$4 = isCallable$g;
1283
- var toObject$2 = toObject$4;
1284
- var sharedKey = sharedKey$3;
1285
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1286
-
1287
- var IE_PROTO = sharedKey('IE_PROTO');
1288
- var $Object = Object;
1289
- var ObjectPrototype = $Object.prototype;
1290
-
1291
- // `Object.getPrototypeOf` method
1292
- // https://tc39.es/ecma262/#sec-object.getprototypeof
1293
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
1294
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
1295
- var object = toObject$2(O);
1296
- if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1297
- var constructor = object.constructor;
1298
- if (isCallable$4(constructor) && object instanceof constructor) {
1299
- return constructor.prototype;
1300
- } return object instanceof $Object ? ObjectPrototype : null;
1301
- };
1302
-
1303
- var fails$6 = fails$h;
1304
- var isCallable$3 = isCallable$g;
1305
- var isObject$1 = isObject$8;
1306
- var getPrototypeOf$1 = objectGetPrototypeOf;
1307
- var defineBuiltIn$2 = defineBuiltIn$4;
1308
- var wellKnownSymbol$5 = wellKnownSymbol$c;
1309
-
1310
- var ITERATOR$2 = wellKnownSymbol$5('iterator');
1311
- var BUGGY_SAFARI_ITERATORS$1 = false;
1312
-
1313
- // `%IteratorPrototype%` object
1314
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1315
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1316
-
1317
- /* eslint-disable es/no-array-prototype-keys -- safe */
1318
- if ([].keys) {
1319
- arrayIterator = [].keys();
1320
- // Safari 8 has buggy iterators w/o `next`
1321
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1322
- else {
1323
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1324
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1325
- }
1326
- }
1327
-
1328
- var NEW_ITERATOR_PROTOTYPE = !isObject$1(IteratorPrototype$2) || fails$6(function () {
1329
- var test = {};
1330
- // FF44- legacy iterators case
1331
- return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1332
- });
1333
-
1334
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1335
-
1336
- // `%IteratorPrototype%[@@iterator]()` method
1337
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1338
- if (!isCallable$3(IteratorPrototype$2[ITERATOR$2])) {
1339
- defineBuiltIn$2(IteratorPrototype$2, ITERATOR$2, function () {
1340
- return this;
1341
- });
1342
- }
1343
-
1344
- var iteratorsCore = {
1345
- IteratorPrototype: IteratorPrototype$2,
1346
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1347
- };
1348
-
1349
- var defineProperty$2 = objectDefineProperty.f;
1350
- var hasOwn = hasOwnProperty_1;
1351
- var wellKnownSymbol$4 = wellKnownSymbol$c;
1352
-
1353
- var TO_STRING_TAG = wellKnownSymbol$4('toStringTag');
1354
-
1355
- var setToStringTag$3 = function (target, TAG, STATIC) {
1356
- if (target && !STATIC) target = target.prototype;
1357
- if (target && !hasOwn(target, TO_STRING_TAG)) {
1358
- defineProperty$2(target, TO_STRING_TAG, { configurable: true, value: TAG });
1359
- }
1360
- };
1361
-
1362
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1363
- var create$1 = objectCreate;
1364
- var createPropertyDescriptor = createPropertyDescriptor$3;
1365
- var setToStringTag$2 = setToStringTag$3;
1366
- var Iterators$2 = iterators;
1367
-
1368
- var returnThis$1 = function () { return this; };
1369
-
1370
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1371
- var TO_STRING_TAG = NAME + ' Iterator';
1372
- IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1373
- setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
1374
- Iterators$2[TO_STRING_TAG] = returnThis$1;
1375
- return IteratorConstructor;
1376
- };
1377
-
1378
- var uncurryThis$5 = functionUncurryThis;
1379
- var aCallable = aCallable$2;
1380
-
1381
- var functionUncurryThisAccessor = function (object, key, method) {
1382
- try {
1383
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1384
- return uncurryThis$5(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
1385
- } catch (error) { /* empty */ }
1386
- };
1387
-
1388
- var isObject = isObject$8;
1389
-
1390
- var isPossiblePrototype$1 = function (argument) {
1391
- return isObject(argument) || argument === null;
1392
- };
1393
-
1394
- var isPossiblePrototype = isPossiblePrototype$1;
1395
-
1396
- var $String = String;
1397
- var $TypeError$1 = TypeError;
1398
-
1399
- var aPossiblePrototype$1 = function (argument) {
1400
- if (isPossiblePrototype(argument)) return argument;
1401
- throw new $TypeError$1("Can't set " + $String(argument) + ' as a prototype');
1402
- };
1403
-
1404
- /* eslint-disable no-proto -- safe */
1405
- var uncurryThisAccessor = functionUncurryThisAccessor;
1406
- var anObject$3 = anObject$8;
1407
- var aPossiblePrototype = aPossiblePrototype$1;
1408
-
1409
- // `Object.setPrototypeOf` method
1410
- // https://tc39.es/ecma262/#sec-object.setprototypeof
1411
- // Works with __proto__ only. Old v8 can't work with null proto objects.
1412
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1413
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1414
- var CORRECT_SETTER = false;
1415
- var test = {};
1416
- var setter;
1417
- try {
1418
- setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
1419
- setter(test, []);
1420
- CORRECT_SETTER = test instanceof Array;
1421
- } catch (error) { /* empty */ }
1422
- return function setPrototypeOf(O, proto) {
1423
- anObject$3(O);
1424
- aPossiblePrototype(proto);
1425
- if (CORRECT_SETTER) setter(O, proto);
1426
- else O.__proto__ = proto;
1427
- return O;
1428
- };
1429
- }() : undefined);
1430
-
1431
- var $$2 = _export;
1432
- var call$6 = functionCall;
1433
- var FunctionName = functionName;
1434
- var isCallable$2 = isCallable$g;
1435
- var createIteratorConstructor = iteratorCreateConstructor;
1436
- var getPrototypeOf = objectGetPrototypeOf;
1437
- var setPrototypeOf = objectSetPrototypeOf;
1438
- var setToStringTag$1 = setToStringTag$3;
1439
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1440
- var defineBuiltIn$1 = defineBuiltIn$4;
1441
- var wellKnownSymbol$3 = wellKnownSymbol$c;
1442
- var Iterators$1 = iterators;
1443
- var IteratorsCore = iteratorsCore;
1444
-
1445
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1446
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1447
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
1448
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1449
- var ITERATOR$1 = wellKnownSymbol$3('iterator');
1450
- var KEYS = 'keys';
1451
- var VALUES = 'values';
1452
- var ENTRIES = 'entries';
1453
-
1454
- var returnThis = function () { return this; };
1455
-
1456
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1457
- createIteratorConstructor(IteratorConstructor, NAME, next);
1458
-
1459
- var getIterationMethod = function (KIND) {
1460
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1461
- if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
1462
-
1463
- switch (KIND) {
1464
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1465
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1466
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1467
- }
1468
-
1469
- return function () { return new IteratorConstructor(this); };
1470
- };
1471
-
1472
- var TO_STRING_TAG = NAME + ' Iterator';
1473
- var INCORRECT_VALUES_NAME = false;
1474
- var IterablePrototype = Iterable.prototype;
1475
- var nativeIterator = IterablePrototype[ITERATOR$1]
1476
- || IterablePrototype['@@iterator']
1477
- || DEFAULT && IterablePrototype[DEFAULT];
1478
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1479
- var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1480
- var CurrentIteratorPrototype, methods, KEY;
1481
-
1482
- // fix native
1483
- if (anyNativeIterator) {
1484
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1485
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1486
- if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1487
- if (setPrototypeOf) {
1488
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1489
- } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
1490
- defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1491
- }
1492
- }
1493
- // Set @@toStringTag to native iterators
1494
- setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
1495
- }
1496
- }
1497
-
1498
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1499
- if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1500
- if (CONFIGURABLE_FUNCTION_NAME) {
1501
- createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1502
- } else {
1503
- INCORRECT_VALUES_NAME = true;
1504
- defaultIterator = function values() { return call$6(nativeIterator, this); };
1505
- }
1506
- }
1507
-
1508
- // export additional methods
1509
- if (DEFAULT) {
1510
- methods = {
1511
- values: getIterationMethod(VALUES),
1512
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1513
- entries: getIterationMethod(ENTRIES)
1514
- };
1515
- if (FORCED) for (KEY in methods) {
1516
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1517
- defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
1518
- }
1519
- } else $$2({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1520
- }
1521
-
1522
- // define iterator
1523
- if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1524
- defineBuiltIn$1(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1525
- }
1526
- Iterators$1[NAME] = defaultIterator;
1527
-
1528
- return methods;
1529
- };
1530
-
1531
- // `CreateIterResultObject` abstract operation
1532
- // https://tc39.es/ecma262/#sec-createiterresultobject
1533
- var createIterResultObject$1 = function (value, done) {
1534
- return { value: value, done: done };
1535
- };
1536
-
1537
- var toIndexedObject = toIndexedObject$5;
1538
- var addToUnscopables = addToUnscopables$2;
1539
- var Iterators = iterators;
1540
- var InternalStateModule = internalState;
1541
- var defineProperty$1 = objectDefineProperty.f;
1542
- var defineIterator = iteratorDefine;
1543
- var createIterResultObject = createIterResultObject$1;
1544
- var DESCRIPTORS$1 = descriptors;
1545
-
1546
- var ARRAY_ITERATOR = 'Array Iterator';
1547
- var setInternalState = InternalStateModule.set;
1548
- var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
1549
-
1550
- // `Array.prototype.entries` method
1551
- // https://tc39.es/ecma262/#sec-array.prototype.entries
1552
- // `Array.prototype.keys` method
1553
- // https://tc39.es/ecma262/#sec-array.prototype.keys
1554
- // `Array.prototype.values` method
1555
- // https://tc39.es/ecma262/#sec-array.prototype.values
1556
- // `Array.prototype[@@iterator]` method
1557
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1558
- // `CreateArrayIterator` internal method
1559
- // https://tc39.es/ecma262/#sec-createarrayiterator
1560
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1561
- setInternalState(this, {
1562
- type: ARRAY_ITERATOR,
1563
- target: toIndexedObject(iterated), // target
1564
- index: 0, // next index
1565
- kind: kind // kind
1566
- });
1567
- // `%ArrayIteratorPrototype%.next` method
1568
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1569
- }, function () {
1570
- var state = getInternalState$1(this);
1571
- var target = state.target;
1572
- var index = state.index++;
1573
- if (!target || index >= target.length) {
1574
- state.target = undefined;
1575
- return createIterResultObject(undefined, true);
1576
- }
1577
- switch (state.kind) {
1578
- case 'keys': return createIterResultObject(index, false);
1579
- case 'values': return createIterResultObject(target[index], false);
1580
- } return createIterResultObject([index, target[index]], false);
1581
- }, 'values');
1582
-
1583
- // argumentsList[@@iterator] is %ArrayProto_values%
1584
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1585
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1586
- var values = Iterators.Arguments = Iterators.Array;
1587
-
1588
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1589
- addToUnscopables('keys');
1590
- addToUnscopables('values');
1591
- addToUnscopables('entries');
1592
-
1593
- // V8 ~ Chrome 45- bug
1594
- if (DESCRIPTORS$1 && values.name !== 'values') try {
1595
- defineProperty$1(values, 'name', { value: 'values' });
1596
- } catch (error) { /* empty */ }
1597
-
1598
- var anObject$2 = anObject$8;
1599
-
1600
- // `RegExp.prototype.flags` getter implementation
1601
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1602
- var regexpFlags$1 = function () {
1603
- var that = anObject$2(this);
1604
- var result = '';
1605
- if (that.hasIndices) result += 'd';
1606
- if (that.global) result += 'g';
1607
- if (that.ignoreCase) result += 'i';
1608
- if (that.multiline) result += 'm';
1609
- if (that.dotAll) result += 's';
1610
- if (that.unicode) result += 'u';
1611
- if (that.unicodeSets) result += 'v';
1612
- if (that.sticky) result += 'y';
1613
- return result;
1614
- };
1615
-
1616
- var fails$5 = fails$h;
1617
- var global$4 = global$f;
1618
-
1619
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1620
- var $RegExp$2 = global$4.RegExp;
1621
-
1622
- var UNSUPPORTED_Y$1 = fails$5(function () {
1623
- var re = $RegExp$2('a', 'y');
1624
- re.lastIndex = 2;
1625
- return re.exec('abcd') !== null;
1626
- });
1627
-
1628
- // UC Browser bug
1629
- // https://github.com/zloirock/core-js/issues/1008
1630
- var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$5(function () {
1631
- return !$RegExp$2('a', 'y').sticky;
1632
- });
1633
-
1634
- var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$5(function () {
1635
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1636
- var re = $RegExp$2('^r', 'gy');
1637
- re.lastIndex = 2;
1638
- return re.exec('str') !== null;
1639
- });
1640
-
1641
- var regexpStickyHelpers = {
1642
- BROKEN_CARET: BROKEN_CARET,
1643
- MISSED_STICKY: MISSED_STICKY,
1644
- UNSUPPORTED_Y: UNSUPPORTED_Y$1
1645
- };
1646
-
1647
- var fails$4 = fails$h;
1648
- var global$3 = global$f;
1649
-
1650
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1651
- var $RegExp$1 = global$3.RegExp;
1652
-
1653
- var regexpUnsupportedDotAll = fails$4(function () {
1654
- var re = $RegExp$1('.', 's');
1655
- return !(re.dotAll && re.test('\n') && re.flags === 's');
1656
- });
1657
-
1658
- var fails$3 = fails$h;
1659
- var global$2 = global$f;
1660
-
1661
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1662
- var $RegExp = global$2.RegExp;
1663
-
1664
- var regexpUnsupportedNcg = fails$3(function () {
1665
- var re = $RegExp('(?<a>b)', 'g');
1666
- return re.exec('b').groups.a !== 'b' ||
1667
- 'b'.replace(re, '$<a>c') !== 'bc';
1668
- });
1669
-
1670
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1671
- /* eslint-disable regexp/no-useless-quantifier -- testing */
1672
- var call$5 = functionCall;
1673
- var uncurryThis$4 = functionUncurryThis;
1674
- var toString$2 = toString$4;
1675
- var regexpFlags = regexpFlags$1;
1676
- var stickyHelpers = regexpStickyHelpers;
1677
- var shared = shared$4.exports;
1678
- var create = objectCreate;
1679
- var getInternalState = internalState.get;
1680
- var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
1681
- var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1682
-
1683
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
1684
- var nativeExec = RegExp.prototype.exec;
1685
- var patchedExec = nativeExec;
1686
- var charAt$3 = uncurryThis$4(''.charAt);
1687
- var indexOf = uncurryThis$4(''.indexOf);
1688
- var replace$1 = uncurryThis$4(''.replace);
1689
- var stringSlice$3 = uncurryThis$4(''.slice);
1690
-
1691
- var UPDATES_LAST_INDEX_WRONG = (function () {
1692
- var re1 = /a/;
1693
- var re2 = /b*/g;
1694
- call$5(nativeExec, re1, 'a');
1695
- call$5(nativeExec, re2, 'a');
1696
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1697
- })();
1698
-
1699
- var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
1700
-
1701
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
1702
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1703
-
1704
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
1705
-
1706
- if (PATCH) {
1707
- patchedExec = function exec(string) {
1708
- var re = this;
1709
- var state = getInternalState(re);
1710
- var str = toString$2(string);
1711
- var raw = state.raw;
1712
- var result, reCopy, lastIndex, match, i, object, group;
1713
-
1714
- if (raw) {
1715
- raw.lastIndex = re.lastIndex;
1716
- result = call$5(patchedExec, raw, str);
1717
- re.lastIndex = raw.lastIndex;
1718
- return result;
1719
- }
1720
-
1721
- var groups = state.groups;
1722
- var sticky = UNSUPPORTED_Y && re.sticky;
1723
- var flags = call$5(regexpFlags, re);
1724
- var source = re.source;
1725
- var charsAdded = 0;
1726
- var strCopy = str;
1727
-
1728
- if (sticky) {
1729
- flags = replace$1(flags, 'y', '');
1730
- if (indexOf(flags, 'g') === -1) {
1731
- flags += 'g';
1732
- }
1733
-
1734
- strCopy = stringSlice$3(str, re.lastIndex);
1735
- // Support anchored sticky behavior.
1736
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
1737
- source = '(?: ' + source + ')';
1738
- strCopy = ' ' + strCopy;
1739
- charsAdded++;
1740
- }
1741
- // ^(? + rx + ) is needed, in combination with some str slicing, to
1742
- // simulate the 'y' flag.
1743
- reCopy = new RegExp('^(?:' + source + ')', flags);
1744
- }
1745
-
1746
- if (NPCG_INCLUDED) {
1747
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1748
- }
1749
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1750
-
1751
- match = call$5(nativeExec, sticky ? reCopy : re, strCopy);
1752
-
1753
- if (sticky) {
1754
- if (match) {
1755
- match.input = stringSlice$3(match.input, charsAdded);
1756
- match[0] = stringSlice$3(match[0], charsAdded);
1757
- match.index = re.lastIndex;
1758
- re.lastIndex += match[0].length;
1759
- } else re.lastIndex = 0;
1760
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
1761
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1762
- }
1763
- if (NPCG_INCLUDED && match && match.length > 1) {
1764
- // Fix browsers whose `exec` methods don't consistently return `undefined`
1765
- // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
1766
- call$5(nativeReplace, match[0], reCopy, function () {
1767
- for (i = 1; i < arguments.length - 2; i++) {
1768
- if (arguments[i] === undefined) match[i] = undefined;
1769
- }
1770
- });
1771
- }
1772
-
1773
- if (match && groups) {
1774
- match.groups = object = create(null);
1775
- for (i = 0; i < groups.length; i++) {
1776
- group = groups[i];
1777
- object[group[0]] = match[group[1]];
1778
- }
1779
- }
1780
-
1781
- return match;
1782
- };
1783
- }
1784
-
1785
- var regexpExec$2 = patchedExec;
1786
-
1787
- var $$1 = _export;
1788
- var exec = regexpExec$2;
1789
-
1790
- // `RegExp.prototype.exec` method
1791
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1792
- $$1({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
1793
- exec: exec
1794
- });
1795
-
1796
- var NATIVE_BIND = functionBindNative;
1797
-
1798
- var FunctionPrototype = Function.prototype;
1799
- var apply$1 = FunctionPrototype.apply;
1800
- var call$4 = FunctionPrototype.call;
1801
-
1802
- // eslint-disable-next-line es/no-reflect -- safe
1803
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$4.bind(apply$1) : function () {
1804
- return call$4.apply(apply$1, arguments);
1805
- });
1806
-
1807
- // TODO: Remove from `core-js@4` since it's moved to entry points
1808
-
1809
- var call$3 = functionCall;
1810
- var defineBuiltIn = defineBuiltIn$4;
1811
- var regexpExec$1 = regexpExec$2;
1812
- var fails$2 = fails$h;
1813
- var wellKnownSymbol$2 = wellKnownSymbol$c;
1814
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
1815
-
1816
- var SPECIES = wellKnownSymbol$2('species');
1817
- var RegExpPrototype = RegExp.prototype;
1818
-
1819
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1820
- var SYMBOL = wellKnownSymbol$2(KEY);
1821
-
1822
- var DELEGATES_TO_SYMBOL = !fails$2(function () {
1823
- // String methods call symbol-named RegExp methods
1824
- var O = {};
1825
- O[SYMBOL] = function () { return 7; };
1826
- return ''[KEY](O) !== 7;
1827
- });
1828
-
1829
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$2(function () {
1830
- // Symbol-named RegExp methods call .exec
1831
- var execCalled = false;
1832
- var re = /a/;
1833
-
1834
- if (KEY === 'split') {
1835
- // We can't use real regex here since it causes deoptimization
1836
- // and serious performance degradation in V8
1837
- // https://github.com/zloirock/core-js/issues/306
1838
- re = {};
1839
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
1840
- // a new one. We need to return the patched regex when creating the new one.
1841
- re.constructor = {};
1842
- re.constructor[SPECIES] = function () { return re; };
1843
- re.flags = '';
1844
- re[SYMBOL] = /./[SYMBOL];
1845
- }
1846
-
1847
- re.exec = function () {
1848
- execCalled = true;
1849
- return null;
1850
- };
1851
-
1852
- re[SYMBOL]('');
1853
- return !execCalled;
1854
- });
1855
-
1856
- if (
1857
- !DELEGATES_TO_SYMBOL ||
1858
- !DELEGATES_TO_EXEC ||
1859
- FORCED
1860
- ) {
1861
- var nativeRegExpMethod = /./[SYMBOL];
1862
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1863
- var $exec = regexp.exec;
1864
- if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
1865
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1866
- // The native String method already delegates to @@method (this
1867
- // polyfilled function), leasing to infinite recursion.
1868
- // We avoid it by directly calling the native @@method method.
1869
- return { done: true, value: call$3(nativeRegExpMethod, regexp, str, arg2) };
1870
- }
1871
- return { done: true, value: call$3(nativeMethod, str, regexp, arg2) };
1872
- }
1873
- return { done: false };
1874
- });
1875
-
1876
- defineBuiltIn(String.prototype, KEY, methods[0]);
1877
- defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
1878
- }
1879
-
1880
- if (SHAM) createNonEnumerableProperty$1(RegExpPrototype[SYMBOL], 'sham', true);
1881
- };
1882
-
1883
- var uncurryThis$3 = functionUncurryThis;
1884
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
1885
- var toString$1 = toString$4;
1886
- var requireObjectCoercible$1 = requireObjectCoercible$5;
1887
-
1888
- var charAt$2 = uncurryThis$3(''.charAt);
1889
- var charCodeAt = uncurryThis$3(''.charCodeAt);
1890
- var stringSlice$2 = uncurryThis$3(''.slice);
1891
-
1892
- var createMethod = function (CONVERT_TO_STRING) {
1893
- return function ($this, pos) {
1894
- var S = toString$1(requireObjectCoercible$1($this));
1895
- var position = toIntegerOrInfinity$1(pos);
1896
- var size = S.length;
1897
- var first, second;
1898
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1899
- first = charCodeAt(S, position);
1900
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
1901
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
1902
- ? CONVERT_TO_STRING
1903
- ? charAt$2(S, position)
1904
- : first
1905
- : CONVERT_TO_STRING
1906
- ? stringSlice$2(S, position, position + 2)
1907
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1908
- };
1909
- };
1910
-
1911
- var stringMultibyte = {
1912
- // `String.prototype.codePointAt` method
1913
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1914
- codeAt: createMethod(false),
1915
- // `String.prototype.at` method
1916
- // https://github.com/mathiasbynens/String.prototype.at
1917
- charAt: createMethod(true)
1918
- };
1919
-
1920
- var charAt$1 = stringMultibyte.charAt;
1921
-
1922
- // `AdvanceStringIndex` abstract operation
1923
- // https://tc39.es/ecma262/#sec-advancestringindex
1924
- var advanceStringIndex$1 = function (S, index, unicode) {
1925
- return index + (unicode ? charAt$1(S, index).length : 1);
1926
- };
1927
-
1928
- var uncurryThis$2 = functionUncurryThis;
1929
- var toObject$1 = toObject$4;
1930
-
1931
- var floor = Math.floor;
1932
- var charAt = uncurryThis$2(''.charAt);
1933
- var replace = uncurryThis$2(''.replace);
1934
- var stringSlice$1 = uncurryThis$2(''.slice);
1935
- // eslint-disable-next-line redos/no-vulnerable -- safe
1936
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
1937
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
1938
-
1939
- // `GetSubstitution` abstract operation
1940
- // https://tc39.es/ecma262/#sec-getsubstitution
1941
- var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
1942
- var tailPos = position + matched.length;
1943
- var m = captures.length;
1944
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
1945
- if (namedCaptures !== undefined) {
1946
- namedCaptures = toObject$1(namedCaptures);
1947
- symbols = SUBSTITUTION_SYMBOLS;
1948
- }
1949
- return replace(replacement, symbols, function (match, ch) {
1950
- var capture;
1951
- switch (charAt(ch, 0)) {
1952
- case '$': return '$';
1953
- case '&': return matched;
1954
- case '`': return stringSlice$1(str, 0, position);
1955
- case "'": return stringSlice$1(str, tailPos);
1956
- case '<':
1957
- capture = namedCaptures[stringSlice$1(ch, 1, -1)];
1958
- break;
1959
- default: // \d\d?
1960
- var n = +ch;
1961
- if (n === 0) return match;
1962
- if (n > m) {
1963
- var f = floor(n / 10);
1964
- if (f === 0) return match;
1965
- if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
1966
- return match;
1967
- }
1968
- capture = captures[n - 1];
1969
- }
1970
- return capture === undefined ? '' : capture;
1971
- });
1972
- };
1973
-
1974
- var call$2 = functionCall;
1975
- var anObject$1 = anObject$8;
1976
- var isCallable$1 = isCallable$g;
1977
- var classof = classofRaw$1;
1978
- var regexpExec = regexpExec$2;
1979
-
1980
- var $TypeError = TypeError;
1981
-
1982
- // `RegExpExec` abstract operation
1983
- // https://tc39.es/ecma262/#sec-regexpexec
1984
- var regexpExecAbstract = function (R, S) {
1985
- var exec = R.exec;
1986
- if (isCallable$1(exec)) {
1987
- var result = call$2(exec, R, S);
1988
- if (result !== null) anObject$1(result);
1989
- return result;
1990
- }
1991
- if (classof(R) === 'RegExp') return call$2(regexpExec, R, S);
1992
- throw new $TypeError('RegExp#exec called on incompatible receiver');
1993
- };
1994
-
1995
- var apply = functionApply;
1996
- var call$1 = functionCall;
1997
- var uncurryThis$1 = functionUncurryThis;
1998
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
1999
- var fails$1 = fails$h;
2000
- var anObject = anObject$8;
2001
- var isCallable = isCallable$g;
2002
- var isNullOrUndefined = isNullOrUndefined$3;
2003
- var toIntegerOrInfinity = toIntegerOrInfinity$4;
2004
- var toLength = toLength$2;
2005
- var toString = toString$4;
2006
- var requireObjectCoercible = requireObjectCoercible$5;
2007
- var advanceStringIndex = advanceStringIndex$1;
2008
- var getMethod = getMethod$2;
2009
- var getSubstitution = getSubstitution$1;
2010
- var regExpExec = regexpExecAbstract;
2011
- var wellKnownSymbol$1 = wellKnownSymbol$c;
2012
-
2013
- var REPLACE = wellKnownSymbol$1('replace');
2014
- var max = Math.max;
2015
- var min = Math.min;
2016
- var concat$1 = uncurryThis$1([].concat);
2017
- var push = uncurryThis$1([].push);
2018
- var stringIndexOf = uncurryThis$1(''.indexOf);
2019
- var stringSlice = uncurryThis$1(''.slice);
2020
-
2021
- var maybeToString = function (it) {
2022
- return it === undefined ? it : String(it);
2023
- };
2024
-
2025
- // IE <= 11 replaces $0 with the whole match, as if it was $&
2026
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
2027
- var REPLACE_KEEPS_$0 = (function () {
2028
- // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
2029
- return 'a'.replace(/./, '$0') === '$0';
2030
- })();
2031
-
2032
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2033
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2034
- if (/./[REPLACE]) {
2035
- return /./[REPLACE]('a', '$0') === '';
2036
- }
2037
- return false;
2038
- })();
2039
-
2040
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$1(function () {
2041
- var re = /./;
2042
- re.exec = function () {
2043
- var result = [];
2044
- result.groups = { a: '7' };
2045
- return result;
2046
- };
2047
- // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
2048
- return ''.replace(re, '$<a>') !== '7';
2049
- });
2050
-
2051
- // @@replace logic
2052
- fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
2053
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
2054
-
2055
- return [
2056
- // `String.prototype.replace` method
2057
- // https://tc39.es/ecma262/#sec-string.prototype.replace
2058
- function replace(searchValue, replaceValue) {
2059
- var O = requireObjectCoercible(this);
2060
- var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);
2061
- return replacer
2062
- ? call$1(replacer, searchValue, O, replaceValue)
2063
- : call$1(nativeReplace, toString(O), searchValue, replaceValue);
2064
- },
2065
- // `RegExp.prototype[@@replace]` method
2066
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2067
- function (string, replaceValue) {
2068
- var rx = anObject(this);
2069
- var S = toString(string);
2070
-
2071
- if (
2072
- typeof replaceValue == 'string' &&
2073
- stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2074
- stringIndexOf(replaceValue, '$<') === -1
2075
- ) {
2076
- var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
2077
- if (res.done) return res.value;
2078
- }
2079
-
2080
- var functionalReplace = isCallable(replaceValue);
2081
- if (!functionalReplace) replaceValue = toString(replaceValue);
2082
-
2083
- var global = rx.global;
2084
- var fullUnicode;
2085
- if (global) {
2086
- fullUnicode = rx.unicode;
2087
- rx.lastIndex = 0;
2088
- }
2089
-
2090
- var results = [];
2091
- var result;
2092
- while (true) {
2093
- result = regExpExec(rx, S);
2094
- if (result === null) break;
2095
-
2096
- push(results, result);
2097
- if (!global) break;
2098
-
2099
- var matchStr = toString(result[0]);
2100
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2101
- }
2102
-
2103
- var accumulatedResult = '';
2104
- var nextSourcePosition = 0;
2105
- for (var i = 0; i < results.length; i++) {
2106
- result = results[i];
2107
-
2108
- var matched = toString(result[0]);
2109
- var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
2110
- var captures = [];
2111
- var replacement;
2112
- // NOTE: This is equivalent to
2113
- // captures = result.slice(1).map(maybeToString)
2114
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
2115
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
2116
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
2117
- for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
2118
- var namedCaptures = result.groups;
2119
- if (functionalReplace) {
2120
- var replacerArgs = concat$1([matched], captures, position, S);
2121
- if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
2122
- replacement = toString(apply(replaceValue, undefined, replacerArgs));
2123
- } else {
2124
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2125
- }
2126
- if (position >= nextSourcePosition) {
2127
- accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
2128
- nextSourcePosition = position + matched.length;
2129
- }
2130
- }
2131
-
2132
- return accumulatedResult + stringSlice(S, nextSourcePosition);
2133
- }
2134
- ];
2135
- }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
2136
-
2137
- // iterable DOM collections
2138
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2139
- var domIterables = {
2140
- CSSRuleList: 0,
2141
- CSSStyleDeclaration: 0,
2142
- CSSValueList: 0,
2143
- ClientRectList: 0,
2144
- DOMRectList: 0,
2145
- DOMStringList: 0,
2146
- DOMTokenList: 1,
2147
- DataTransferItemList: 0,
2148
- FileList: 0,
2149
- HTMLAllCollection: 0,
2150
- HTMLCollection: 0,
2151
- HTMLFormElement: 0,
2152
- HTMLSelectElement: 0,
2153
- MediaList: 0,
2154
- MimeTypeArray: 0,
2155
- NamedNodeMap: 0,
2156
- NodeList: 1,
2157
- PaintRequestList: 0,
2158
- Plugin: 0,
2159
- PluginArray: 0,
2160
- SVGLengthList: 0,
2161
- SVGNumberList: 0,
2162
- SVGPathSegList: 0,
2163
- SVGPointList: 0,
2164
- SVGStringList: 0,
2165
- SVGTransformList: 0,
2166
- SourceBufferList: 0,
2167
- StyleSheetList: 0,
2168
- TextTrackCueList: 0,
2169
- TextTrackList: 0,
2170
- TouchList: 0
2171
- };
2172
-
2173
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
2174
- var documentCreateElement = documentCreateElement$2;
2175
-
2176
- var classList = documentCreateElement('span').classList;
2177
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
2178
-
2179
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
2180
-
2181
- var global$1 = global$f;
2182
- var DOMIterables = domIterables;
2183
- var DOMTokenListPrototype = domTokenListPrototype;
2184
- var ArrayIteratorMethods = es_array_iterator;
2185
- var createNonEnumerableProperty = createNonEnumerableProperty$5;
2186
- var setToStringTag = setToStringTag$3;
2187
- var wellKnownSymbol = wellKnownSymbol$c;
2188
-
2189
- var ITERATOR = wellKnownSymbol('iterator');
2190
- var ArrayValues = ArrayIteratorMethods.values;
2191
-
2192
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
2193
- if (CollectionPrototype) {
2194
- // some Chrome versions have non-configurable methods on DOMTokenList
2195
- if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
2196
- createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
2197
- } catch (error) {
2198
- CollectionPrototype[ITERATOR] = ArrayValues;
2199
- }
2200
- setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
2201
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
2202
- // some Chrome versions have non-configurable methods on DOMTokenList
2203
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
2204
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
2205
- } catch (error) {
2206
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
2207
- }
2208
- }
2209
- }
2210
- };
2211
-
2212
- for (var COLLECTION_NAME in DOMIterables) {
2213
- handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
2214
- }
2215
-
2216
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
2217
-
2218
- var DESCRIPTORS = descriptors;
2219
- var uncurryThis = functionUncurryThis;
2220
- var call = functionCall;
2221
- var fails = fails$h;
2222
- var objectKeys = objectKeys$2;
2223
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2224
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2225
- var toObject = toObject$4;
2226
- var IndexedObject = indexedObject;
2227
-
2228
- // eslint-disable-next-line es/no-object-assign -- safe
2229
- var $assign = Object.assign;
2230
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2231
- var defineProperty = Object.defineProperty;
2232
- var concat = uncurryThis([].concat);
2233
-
2234
- // `Object.assign` method
2235
- // https://tc39.es/ecma262/#sec-object.assign
2236
- var objectAssign = !$assign || fails(function () {
2237
- // should have correct order of operations (Edge bug)
2238
- if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
2239
- enumerable: true,
2240
- get: function () {
2241
- defineProperty(this, 'b', {
2242
- value: 3,
2243
- enumerable: false
2244
- });
2245
- }
2246
- }), { b: 2 })).b !== 1) return true;
2247
- // should work with symbols and should have deterministic property order (V8 bug)
2248
- var A = {};
2249
- var B = {};
2250
- // eslint-disable-next-line es/no-symbol -- safe
2251
- var symbol = Symbol('assign detection');
2252
- var alphabet = 'abcdefghijklmnopqrst';
2253
- A[symbol] = 7;
2254
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
2255
- return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
2256
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
2257
- var T = toObject(target);
2258
- var argumentsLength = arguments.length;
2259
- var index = 1;
2260
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2261
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
2262
- while (argumentsLength > index) {
2263
- var S = IndexedObject(arguments[index++]);
2264
- var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
2265
- var length = keys.length;
2266
- var j = 0;
2267
- var key;
2268
- while (length > j) {
2269
- key = keys[j++];
2270
- if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
2271
- }
2272
- } return T;
2273
- } : $assign;
2274
-
2275
- var $ = _export;
2276
- var assign = objectAssign;
2277
-
2278
- // `Object.assign` method
2279
- // https://tc39.es/ecma262/#sec-object.assign
2280
- // eslint-disable-next-line es/no-object-assign -- required for testing
2281
- $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
2282
- assign: assign
2283
- });
2284
-
2285
- const endClassMap = {
2286
- 1: 'col-end-1',
2287
- 2: 'col-end-2',
2288
- 3: 'col-end-3',
2289
- 4: 'col-end-4',
2290
- 5: 'col-end-5',
2291
- 6: 'col-end-6',
2292
- 7: 'col-end-7',
2293
- 8: 'col-end-8',
2294
- 9: 'col-end-9',
2295
- 10: 'col-end-10',
2296
- 11: 'col-end-11',
2297
- 12: 'col-end-12',
2298
- 13: 'col-end-13'
2299
- };
2300
- const startClassMap = {
2301
- 1: 'col-start-1',
2302
- 2: 'col-start-2',
2303
- 3: 'col-start-3',
2304
- 4: 'col-start-4',
2305
- 5: 'col-start-5',
2306
- 6: 'col-start-6',
2307
- 7: 'col-start-7',
2308
- 8: 'col-start-8',
2309
- 9: 'col-start-9',
2310
- 10: 'col-start-10',
2311
- 11: 'col-start-11',
2312
- 12: 'col-start-12'
2313
- };
2314
- function getPageElementBound(rowsNodes) {
2315
- if (!rowsNodes) {
2316
- return [];
2317
- }
2318
- return rowsNodes.map(row => {
2319
- const rowRect = row.getBoundingClientRect();
2320
- const columns = row.children;
2321
- return {
2322
- x: rowRect.x,
2323
- y: rowRect.y,
2324
- width: rowRect.width,
2325
- height: rowRect.height,
2326
- columns: Array.from(columns).map(column => {
2327
- const columnRect = column.getBoundingClientRect();
2328
- const containers = Array.from(column.querySelectorAll('[data-dot="container"]'));
2329
- const columnX = columnRect.left - rowRect.left;
2330
- const columnY = columnRect.top - rowRect.top;
2331
- return {
2332
- x: columnX,
2333
- y: columnY,
2334
- width: columnRect.width,
2335
- height: columnRect.height,
2336
- containers: containers.map(container => {
2337
- const containerRect = container.getBoundingClientRect();
2338
- const contentlets = Array.from(container.querySelectorAll('[data-dot="contentlet"]'));
2339
- return {
2340
- x: 0,
2341
- y: containerRect.y - rowRect.top,
2342
- width: containerRect.width,
2343
- height: containerRect.height,
2344
- payload: container.dataset.content,
2345
- contentlets: contentlets.map(contentlet => {
2346
- const contentletRect = contentlet.getBoundingClientRect();
2347
- return {
2348
- x: 0,
2349
- y: contentletRect.y - containerRect.y,
2350
- width: contentletRect.width,
2351
- height: contentletRect.height,
2352
- payload: contentlet.dataset.content
2353
- };
2354
- })
2355
- };
2356
- })
2357
- };
2358
- })
2359
- };
2360
- });
2361
- }
2362
- const getContainersData = (containers, containerRef) => {
2363
- const {
2364
- identifier,
2365
- uuid
2366
- } = containerRef;
2367
- const {
2368
- containerStructures,
2369
- container
2370
- } = containers[identifier];
2371
- // Get the variant id
2372
- const {
2373
- variantId
2374
- } = (container == null ? void 0 : container.parentPermissionable) || {};
2375
- // Get accepts types of content types for this container
2376
- const acceptTypes = containerStructures.map(structure => structure.contentTypeVar).join(',');
2377
- // Get the contentlets for "this" container
2378
- const contentlets = containers[identifier].contentlets[`uuid-${uuid}`];
2379
- return Object.assign({}, containers[identifier].container, {
2380
- acceptTypes,
2381
- contentlets,
2382
- variantId
2383
- });
2384
- };
2385
- const combineClasses = classes => classes.filter(Boolean).join(' ');
2386
- const getPositionStyleClasses = (start, end) => {
2387
- const startClass = startClassMap[start];
2388
- const endClass = endClassMap[end];
2389
- return {
2390
- startClass,
2391
- endClass
2392
- };
2393
- };
2394
-
2395
- /**
2396
- * `usePageEditor` is a custom React hook that sets up the page editor for a DotCMS page.
2397
- * It takes a `PageEditorOptions` object as a parameter and returns a reference to the rows of the page.
2398
- *
2399
- * This hook is the main brigde between your webapp and the dotcms page editor.
2400
- *
2401
- *
2402
- * @category Hooks
2403
- * @param {PageEditorOptions} props - The options for the page editor. Includes a `reloadFunction` and a `pathname`.
2404
- * @returns {{rowsRef: React.RefObject<HTMLDivElement>[], isInsideEditor: boolean}} - Returns a reference to the rows of the page and a boolean that indicates if the page is inside the editor.
2405
- * @throws {Error} - Throws an error if the `pathname` is not provided.
2406
- */
2407
- const usePageEditor = props => {
2408
- const {
2409
- reloadFunction = window.location.reload,
2410
- pathname = null
2411
- } = props;
2412
- if (!pathname) {
2413
- throw new Error('Dotcms page editor required the pathname of your webapp');
2414
- }
2415
- const {
2416
- rowsRef,
2417
- isInsideEditor
2418
- } = useEventMessageHandler({
2419
- reload: reloadFunction
2420
- });
2421
- usePostUrlToEditor(pathname, isInsideEditor);
2422
- useScrollEvent(isInsideEditor);
2423
- return {
2424
- rowsRef,
2425
- isInsideEditor
2426
- };
2427
- };
2428
- function useEventMessageHandler({
2429
- reload = window.location.reload
2430
- }) {
2431
- const rows = useRef([]);
2432
- const observer = useRef(null);
2433
- const [isInsideEditor, setIsInsideEditor] = useState(false);
2434
- useEffect(() => {
2435
- var _observer$current;
2436
- observer.current = new MutationObserver(mutationsList => {
2437
- for (const {
2438
- addedNodes,
2439
- removedNodes,
2440
- type
2441
- } of mutationsList) {
2442
- if (type === 'childList') {
2443
- const didNodesChanged = [...Array.from(addedNodes), ...Array.from(removedNodes)].filter(node => {
2444
- var _node$dataset;
2445
- return ((_node$dataset = node.dataset) == null ? void 0 : _node$dataset.dot) === 'contentlet';
2446
- }).length;
2447
- if (didNodesChanged) {
2448
- postMessageToEditor({
2449
- action: CUSTOMER_ACTIONS.CONTENT_CHANGE
2450
- });
2451
- }
2452
- }
2453
- }
2454
- });
2455
- (_observer$current = observer.current) == null || _observer$current.observe(document, {
2456
- childList: true,
2457
- subtree: true
2458
- });
2459
- return () => {
2460
- if (observer.current) observer.current.disconnect();
2461
- };
2462
- }, []);
2463
- useEffect(() => {
2464
- // If the page is not inside an iframe we do nothing.
2465
- if (window.parent === window) return;
2466
- postMessageToEditor({
2467
- action: CUSTOMER_ACTIONS.PING_EDITOR // This is to let the editor know that the page is ready
2468
- });
2469
- }, []);
2470
- useEffect(() => {
2471
- function eventMessageHandler(event) {
2472
- if (!isInsideEditor) {
2473
- // Editor is telling us that we can set ourselves into edit mode
2474
- if (event.data === 'ema-editor-pong') {
2475
- setIsInsideEditor(true);
2476
- }
2477
- return;
2478
- }
2479
- switch (event.data) {
2480
- case 'ema-request-bounds':
2481
- {
2482
- const positionData = getPageElementBound(rows.current);
2483
- postMessageToEditor({
2484
- action: CUSTOMER_ACTIONS.SET_BOUNDS,
2485
- payload: positionData
2486
- });
2487
- break;
2488
- }
2489
- case 'ema-reload-page':
2490
- {
2491
- reload();
2492
- break;
2493
- }
2494
- }
2495
- }
2496
- window.addEventListener('message', eventMessageHandler);
2497
- return () => {
2498
- window.removeEventListener('message', eventMessageHandler);
2499
- };
2500
- }, [rows, reload, isInsideEditor]);
2501
- return {
2502
- rowsRef: rows,
2503
- isInsideEditor
2504
- };
2505
- }
2506
- function useScrollEvent(isInsideEditor) {
2507
- useEffect(() => {
2508
- if (!isInsideEditor) return;
2509
- function eventScrollHandler() {
2510
- postMessageToEditor({
2511
- action: CUSTOMER_ACTIONS.IFRAME_SCROLL
2512
- });
2513
- }
2514
- window.addEventListener('scroll', eventScrollHandler);
2515
- return () => {
2516
- window.removeEventListener('scroll', eventScrollHandler);
2517
- };
2518
- }, [isInsideEditor]);
2519
- }
2520
- function usePostUrlToEditor(pathname, isInsideEditor) {
2521
- useEffect(() => {
2522
- if (!isInsideEditor) return;
2523
- postMessageToEditor({
2524
- action: CUSTOMER_ACTIONS.SET_URL,
2525
- payload: {
2526
- url: pathname === '/' ? 'index' : pathname == null ? void 0 : pathname.replace('/', '')
2527
- }
2528
- });
2529
- }, [pathname, isInsideEditor]);
2530
- }
2531
-
2532
- const PageContext = /*#__PURE__*/createContext(null);
2533
-
2534
- /**
2535
- * `PageProvider` is a functional component that provides a context for a DotCMS page.
2536
- * It takes a `PageProviderProps` object as a parameter and returns a JSX element.
2537
- *
2538
- * @category Components
2539
- * @param {PageProviderProps} props - The properties for the PageProvider. Includes an `entity` and `children`.
2540
- * @returns {JSX.Element} - A JSX element that provides a context for a DotCMS page.
2541
- */
2542
- function PageProvider(props) {
2543
- const {
2544
- entity,
2545
- children
2546
- } = props;
2547
- return jsx(PageContext.Provider, {
2548
- value: entity,
2549
- children: children
2550
- });
2551
- }
2552
-
2553
- function styleInject(css, ref) {
2554
- if ( ref === void 0 ) ref = {};
2555
- var insertAt = ref.insertAt;
2556
-
2557
- if (!css || typeof document === 'undefined') { return; }
2558
-
2559
- var head = document.head || document.getElementsByTagName('head')[0];
2560
- var style = document.createElement('style');
2561
- style.type = 'text/css';
2562
-
2563
- if (insertAt === 'top') {
2564
- if (head.firstChild) {
2565
- head.insertBefore(style, head.firstChild);
2566
- } else {
2567
- head.appendChild(style);
2568
- }
2569
- } else {
2570
- head.appendChild(style);
2571
- }
2572
-
2573
- if (style.styleSheet) {
2574
- style.styleSheet.cssText = css;
2575
- } else {
2576
- style.appendChild(document.createTextNode(css));
2577
- }
2578
- }
2579
-
2580
- var css_248z$1 = ".row-module_row__8V7Eh {\n display: grid;\n grid-template-columns: repeat(12, 1fr);\n gap: 1rem;\n}\n";
2581
- var styles$1 = {"row":"row-module_row__8V7Eh"};
2582
- styleInject(css_248z$1);
2583
-
2584
- var css_248z = ".column-module_col-start-1__GK-q- {\n grid-column-start: 1;\n}\n\n.column-module_col-start-2__1DmkY {\n grid-column-start: 2;\n}\n\n.column-module_col-start-3__HNEPh {\n grid-column-start: 3;\n}\n\n.column-module_col-start-4__oCAwh {\n grid-column-start: 4;\n}\n\n.column-module_col-start-5__re1rB {\n grid-column-start: 5;\n}\n\n.column-module_col-start-6__dkB4w {\n grid-column-start: 6;\n}\n\n.column-module_col-start-7__kEfJb {\n grid-column-start: 7;\n}\n\n.column-module_col-start-8__Yx31z {\n grid-column-start: 8;\n}\n\n.column-module_col-start-9__9YiVY {\n grid-column-start: 9;\n}\n\n.column-module_col-start-10__6AFbk {\n grid-column-start: 10;\n}\n\n.column-module_col-start-11__LP24D {\n grid-column-start: 11;\n}\n\n.column-module_col-start-12__8p0QS {\n grid-column-start: 12;\n}\n\n.column-module_col-end-1__G9axv {\n grid-column-end: 1;\n}\n\n.column-module_col-end-2__pYjHG {\n grid-column-end: 2;\n}\n\n.column-module_col-end-3__4woe6 {\n grid-column-end: 3;\n}\n\n.column-module_col-end-4__zlBaT {\n grid-column-end: 4;\n}\n\n.column-module_col-end-5__aC-y8 {\n grid-column-end: 5;\n}\n\n.column-module_col-end-6__YljAP {\n grid-column-end: 6;\n}\n\n.column-module_col-end-7__lpQrW {\n grid-column-end: 7;\n}\n\n.column-module_col-end-8__F6UVd {\n grid-column-end: 8;\n}\n\n.column-module_col-end-9__kvQ3T {\n grid-column-end: 9;\n}\n\n.column-module_col-end-10__XJhrd {\n grid-column-end: 10;\n}\n\n.column-module_col-end-11__nx-lF {\n grid-column-end: 11;\n}\n\n.column-module_col-end-12__LIRnk {\n grid-column-end: 12;\n}\n\n.column-module_col-end-13__0p7YI {\n grid-column-end: 13;\n}\n";
2585
- var styles = {"col-start-1":"column-module_col-start-1__GK-q-","col-start-2":"column-module_col-start-2__1DmkY","col-start-3":"column-module_col-start-3__HNEPh","col-start-4":"column-module_col-start-4__oCAwh","col-start-5":"column-module_col-start-5__re1rB","col-start-6":"column-module_col-start-6__dkB4w","col-start-7":"column-module_col-start-7__kEfJb","col-start-8":"column-module_col-start-8__Yx31z","col-start-9":"column-module_col-start-9__9YiVY","col-start-10":"column-module_col-start-10__6AFbk","col-start-11":"column-module_col-start-11__LP24D","col-start-12":"column-module_col-start-12__8p0QS","col-end-1":"column-module_col-end-1__G9axv","col-end-2":"column-module_col-end-2__pYjHG","col-end-3":"column-module_col-end-3__4woe6","col-end-4":"column-module_col-end-4__zlBaT","col-end-5":"column-module_col-end-5__aC-y8","col-end-6":"column-module_col-end-6__YljAP","col-end-7":"column-module_col-end-7__lpQrW","col-end-8":"column-module_col-end-8__F6UVd","col-end-9":"column-module_col-end-9__kvQ3T","col-end-10":"column-module_col-end-10__XJhrd","col-end-11":"column-module_col-end-11__nx-lF","col-end-12":"column-module_col-end-12__LIRnk","col-end-13":"column-module_col-end-13__0p7YI"};
2586
- styleInject(css_248z);
2587
-
2588
- const FAKE_CONTENLET = {
2589
- identifier: 'TEMP_EMPTY_CONTENTLET',
2590
- title: 'TEMP_EMPTY_CONTENTLET',
2591
- contentType: 'TEMP_EMPTY_CONTENTLET_TYPE',
2592
- inode: 'TEMPY_EMPTY_CONTENTLET_INODE',
2593
- widgetTitle: 'TEMP_EMPTY_CONTENTLET',
2594
- onNumberOfPages: 1
2595
- };
2596
- function EmptyContainer() {
2597
- return jsx("div", {
2598
- "data-testid": "empty-container",
2599
- style: {
2600
- width: '100%',
2601
- backgroundColor: '#ECF0FD',
2602
- display: 'flex',
2603
- justifyContent: 'center',
2604
- alignItems: 'center',
2605
- color: '#030E32',
2606
- height: '10rem'
2607
- },
2608
- children: "This container is empty."
2609
- });
2610
- }
2611
- function NoContent({
2612
- contentType
2613
- }) {
2614
- return jsxs("div", {
2615
- "data-testid": "no-component",
2616
- children: ["No Component for ", contentType]
2617
- });
2618
- }
2619
- function Container({
2620
- containerRef
2621
- }) {
2622
- const {
2623
- identifier,
2624
- uuid
2625
- } = containerRef;
2626
- // Get the containers from the global context
2627
- const {
2628
- containers,
2629
- components,
2630
- isInsideEditor
2631
- } = useContext(PageContext);
2632
- const {
2633
- acceptTypes,
2634
- contentlets,
2635
- maxContentlets,
2636
- variantId,
2637
- path
2638
- } = getContainersData(containers, containerRef);
2639
- const updatedContentlets = contentlets.length === 0 && isInsideEditor ? [FAKE_CONTENLET] : contentlets;
2640
- const container = {
2641
- acceptTypes,
2642
- identifier: path != null ? path : identifier,
2643
- maxContentlets,
2644
- variantId,
2645
- uuid
2646
- };
2647
- const containerPayload = {
2648
- container
2649
- };
2650
- function onPointerEnterHandler(e) {
2651
- var _target$dataset$conte;
2652
- let target = e.target;
2653
- if (target.dataset.dot !== 'contentlet') {
2654
- target = target.closest('[data-dot="contentlet"]');
2655
- }
2656
- if (!target) {
2657
- return;
2658
- }
2659
- const {
2660
- x,
2661
- y,
2662
- width,
2663
- height
2664
- } = target.getBoundingClientRect();
2665
- const contentletPayload = JSON.parse((_target$dataset$conte = target.dataset.content) != null ? _target$dataset$conte : '{}');
2666
- postMessageToEditor({
2667
- action: CUSTOMER_ACTIONS.SET_CONTENTLET,
2668
- payload: {
2669
- x,
2670
- y,
2671
- width,
2672
- height,
2673
- payload: contentletPayload
2674
- }
2675
- });
2676
- }
2677
- const renderContentlets = updatedContentlets.map(contentlet => {
2678
- const ContentTypeComponent = components[contentlet.contentType] || NoContent;
2679
- const Component = contentlet.identifier === 'TEMP_EMPTY_CONTENTLET' ? EmptyContainer : ContentTypeComponent;
2680
- const contentletPayload = {
2681
- container,
2682
- contentlet: {
2683
- identifier: contentlet.identifier,
2684
- title: contentlet.widgetTitle || contentlet.title,
2685
- inode: contentlet.inode,
2686
- onNumberOfPages: contentlet.onNumberOfPages,
2687
- contentType: contentlet.contentType
2688
- }
2689
- };
2690
- return isInsideEditor ? jsx("div", {
2691
- onPointerEnter: onPointerEnterHandler,
2692
- "data-dot": "contentlet",
2693
- "data-content": JSON.stringify(contentletPayload),
2694
- children: jsx(Component, Object.assign({}, contentlet))
2695
- }, contentlet.identifier) : ( /*#__PURE__*/createElement$1(Component, Object.assign({}, contentlet, {
2696
- key: contentlet.identifier
2697
- })));
2698
- });
2699
- return isInsideEditor ? jsx("div", {
2700
- "data-dot": "container",
2701
- "data-content": JSON.stringify(containerPayload),
2702
- children: renderContentlets
2703
- }) :
2704
- // eslint-disable-next-line react/jsx-no-useless-fragment
2705
- jsx(Fragment, {
2706
- children: renderContentlets
2707
- });
2708
- }
2709
-
2710
- function Column({
2711
- column
2712
- }) {
2713
- const {
2714
- isInsideEditor
2715
- } = useContext(PageContext);
2716
- const {
2717
- startClass,
2718
- endClass
2719
- } = getPositionStyleClasses(column.leftOffset, column.width + column.leftOffset);
2720
- const combinedClasses = combineClasses([styles[endClass], styles[startClass], column.styleClass]);
2721
- const columnProps = isInsideEditor ? {
2722
- 'data-dot': 'column',
2723
- 'data-testid': 'column'
2724
- } : {};
2725
- return jsx("div", Object.assign({}, columnProps, {
2726
- className: combinedClasses,
2727
- children: column.containers.map(container => jsx(Container, {
2728
- containerRef: container
2729
- }, `${container.identifier}-${container.uuid}`))
2730
- }));
2731
- }
2732
-
2733
- /**
2734
- * Renders a row
2735
- *
2736
- * @category Components
2737
- * @param {React.ForwardedRef<HTMLDivElement, RowProps>} ref
2738
- * @return {*}
2739
- */
2740
- const Row = /*#__PURE__*/forwardRef((props, ref) => {
2741
- const {
2742
- isInsideEditor
2743
- } = useContext(PageContext);
2744
- const {
2745
- row
2746
- } = props;
2747
- const combinedClasses = combineClasses([styles$1.row, row.styleClass]);
2748
- const rowProps = isInsideEditor ? {
2749
- 'data-dot': 'row',
2750
- 'data-testid': 'row',
2751
- ref
2752
- } : {};
2753
- return jsx("div", Object.assign({}, rowProps, {
2754
- className: combinedClasses,
2755
- children: row.columns.map((column, index) => jsx(Column, {
2756
- column: column
2757
- }, index))
2758
- }));
2759
- });
2760
-
2761
- /**
2762
- * `DotcmsLayout` is a functional component that renders a layout for a DotCMS page.
2763
- * It takes a `DotcmsPageProps` object as a parameter and returns a JSX element.
2764
- *
2765
- * @category Components
2766
- * @param {DotcmsPageProps} props - The properties for the DotCMS page.
2767
- * @returns {JSX.Element} - A JSX element that represents the layout for a DotCMS page.
2768
- */
2769
- function DotcmsLayout(props) {
2770
- const {
2771
- entity
2772
- } = props;
2773
- const {
2774
- rowsRef,
2775
- isInsideEditor
2776
- } = usePageEditor({});
2777
- const addRowRef = el => {
2778
- if (el && !rowsRef.current.includes(el)) {
2779
- rowsRef.current.push(el);
2780
- }
2781
- };
2782
- entity.isInsideEditor = isInsideEditor;
2783
- return jsx(PageProvider, {
2784
- entity: entity,
2785
- children: entity.layout.body.rows.map((row, index) => jsx(Row, {
2786
- ref: addRowRef,
2787
- row: row
2788
- }, index))
2789
- });
2790
- }
2791
-
2792
- /**
2793
- * `useDotcmsPageContext` is a custom React hook that provides access to the `PageProviderContext`.
2794
- * It takes no parameters and returns the context value or `null` if it's not available.
2795
- *
2796
- * @category Hooks
2797
- * @returns {PageProviderContext | null} - The context value or `null` if it's not available.
2798
- */
2799
- function useDotcmsPageContext() {
2800
- return useContext(PageContext);
2801
- }
2802
-
2803
- export { DotcmsLayout, PageProvider, Row, useDotcmsPageContext, usePageEditor };