@dotcms/react 0.0.1-alpha.7 → 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} +14 -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 -2912
  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 -55
  41. /package/src/lib/mocks/{index.d.ts → index.ts} +0 -0
package/index.esm.js DELETED
@@ -1,2912 +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$g =
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$i = function (exec) {
26
- try {
27
- return !!exec();
28
- } catch (error) {
29
- return true;
30
- }
31
- };
32
-
33
- var fails$h = fails$i;
34
-
35
- // Detect IE8's incomplete defineProperty implementation
36
- var descriptors = !fails$h(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$g = fails$i;
42
-
43
- var functionBindNative = !fails$g(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$a = Function.prototype.call;
53
-
54
- var functionCall = NATIVE_BIND$2 ? call$a.bind(call$a) : function () {
55
- return call$a.apply(call$a, 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$9 = FunctionPrototype$2.call;
87
- var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$2.bind.bind(call$9, call$9);
88
-
89
- var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
90
- return function () {
91
- return call$9.apply(fn, arguments);
92
- };
93
- };
94
-
95
- var uncurryThis$h = functionUncurryThis;
96
-
97
- var toString$6 = uncurryThis$h({}.toString);
98
- var stringSlice$5 = uncurryThis$h(''.slice);
99
-
100
- var classofRaw$2 = function (it) {
101
- return stringSlice$5(toString$6(it), 8, -1);
102
- };
103
-
104
- var uncurryThis$g = functionUncurryThis;
105
- var fails$f = fails$i;
106
- var classof$5 = classofRaw$2;
107
-
108
- var $Object$4 = Object;
109
- var split = uncurryThis$g(''.split);
110
-
111
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
112
- var indexedObject = fails$f(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$5(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$9 = 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$9("Can't call method on " + it);
134
- return it;
135
- };
136
-
137
- // toObject with fallback for non-array-like ES3 strings
138
- var IndexedObject$2 = indexedObject;
139
- var requireObjectCoercible$4 = requireObjectCoercible$5;
140
-
141
- var toIndexedObject$5 = function (it) {
142
- return IndexedObject$2(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$f = global$g;
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$f[namespace]) : global$f[namespace] && global$f[namespace][method];
172
- };
173
-
174
- var uncurryThis$f = functionUncurryThis;
175
-
176
- var objectIsPrototypeOf = uncurryThis$f({}.isPrototypeOf);
177
-
178
- var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
179
-
180
- var global$e = global$g;
181
- var userAgent = engineUserAgent;
182
-
183
- var process = global$e.process;
184
- var Deno = global$e.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$e = fails$i;
211
- var global$d = global$g;
212
-
213
- var $String$5 = global$d.String;
214
-
215
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
216
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$e(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$8 = TypeError;
262
-
263
- // `Assert: IsCallable(argument) is true`
264
- var aCallable$3 = function (argument) {
265
- if (isCallable$c(argument)) return argument;
266
- throw new $TypeError$8(tryToString(argument) + ' is not a function');
267
- };
268
-
269
- var aCallable$2 = aCallable$3;
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$2(func);
277
- };
278
-
279
- var call$8 = functionCall;
280
- var isCallable$b = isCallable$g;
281
- var isObject$7 = isObject$8;
282
-
283
- var $TypeError$7 = 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$8(fn, input))) return val;
290
- if (isCallable$b(fn = input.valueOf) && !isObject$7(val = call$8(fn, input))) return val;
291
- if (pref !== 'string' && isCallable$b(fn = input.toString) && !isObject$7(val = call$8(fn, input))) return val;
292
- throw new $TypeError$7("Can't convert object to primitive value");
293
- };
294
-
295
- var shared$4 = {exports: {}};
296
-
297
- var global$c = global$g;
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$c, key, { value: value, configurable: true, writable: true });
305
- } catch (error) {
306
- global$c[key] = value;
307
- } return value;
308
- };
309
-
310
- var global$b = global$g;
311
- var defineGlobalProperty$2 = defineGlobalProperty$3;
312
-
313
- var SHARED = '__core-js_shared__';
314
- var store$3 = global$b[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.0',
324
- mode: 'global',
325
- copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
326
- license: 'https://github.com/zloirock/core-js/blob/v3.35.0/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$5 = function (argument) {
337
- return $Object$2(requireObjectCoercible$3(argument));
338
- };
339
-
340
- var uncurryThis$e = functionUncurryThis;
341
- var toObject$4 = toObject$5;
342
-
343
- var hasOwnProperty = uncurryThis$e({}.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$4(it), key);
350
- };
351
-
352
- var uncurryThis$d = functionUncurryThis;
353
-
354
- var id = 0;
355
- var postfix = Math.random();
356
- var toString$5 = uncurryThis$d(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$a = global$g;
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$a.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$7 = 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$6 = 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$7(exoticToPrim, input, pref);
400
- if (!isObject$6(result) || isSymbol$1(result)) return result;
401
- throw new $TypeError$6("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$9 = global$g;
418
- var isObject$5 = isObject$8;
419
-
420
- var document$1 = global$9.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$d = fails$i;
430
- var createElement = documentCreateElement$2;
431
-
432
- // Thanks to IE8 for its funny defineProperty
433
- var ie8DomDefine = !DESCRIPTORS$9 && !fails$d(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$6 = 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$6(propertyIsEnumerableModule$1.f, O, P), O[P]);
461
- };
462
-
463
- var objectDefineProperty = {};
464
-
465
- var DESCRIPTORS$7 = descriptors;
466
- var fails$c = fails$i;
467
-
468
- // V8 ~ Chrome 36-
469
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
470
- var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$c(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$5 = 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$5($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$4 = 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$4('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$c = functionUncurryThis;
565
- var isCallable$a = isCallable$g;
566
- var store$1 = sharedStore;
567
-
568
- var functionToString = uncurryThis$c(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$8 = global$g;
580
- var isCallable$9 = isCallable$g;
581
-
582
- var WeakMap$1 = global$8.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$7 = global$g;
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$7.TypeError;
608
- var WeakMap = global$7.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$b = functionUncurryThis;
669
- var fails$b = fails$i;
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$b(''.slice);
683
- var replace$2 = uncurryThis$b(''.replace);
684
- var join = uncurryThis$b([].join);
685
-
686
- var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$b(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
- return argument > 0 ? min$1(toIntegerOrInfinity$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
795
- };
796
-
797
- var toLength$1 = toLength$2;
798
-
799
- // `LengthOfArrayLike` abstract operation
800
- // https://tc39.es/ecma262/#sec-lengthofarraylike
801
- var lengthOfArrayLike$2 = function (obj) {
802
- return toLength$1(obj.length);
803
- };
804
-
805
- var toIndexedObject$3 = toIndexedObject$5;
806
- var toAbsoluteIndex = toAbsoluteIndex$1;
807
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
808
-
809
- // `Array.prototype.{ indexOf, includes }` methods implementation
810
- var createMethod$2 = function (IS_INCLUDES) {
811
- return function ($this, el, fromIndex) {
812
- var O = toIndexedObject$3($this);
813
- var length = lengthOfArrayLike$1(O);
814
- var index = toAbsoluteIndex(fromIndex, length);
815
- var value;
816
- // Array#includes uses SameValueZero equality algorithm
817
- // eslint-disable-next-line no-self-compare -- NaN check
818
- if (IS_INCLUDES && el !== el) while (length > index) {
819
- value = O[index++];
820
- // eslint-disable-next-line no-self-compare -- NaN check
821
- if (value !== value) return true;
822
- // Array#indexOf ignores holes, Array#includes - not
823
- } else for (;length > index; index++) {
824
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
825
- } return !IS_INCLUDES && -1;
826
- };
827
- };
828
-
829
- var arrayIncludes = {
830
- // `Array.prototype.includes` method
831
- // https://tc39.es/ecma262/#sec-array.prototype.includes
832
- includes: createMethod$2(true),
833
- // `Array.prototype.indexOf` method
834
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
835
- indexOf: createMethod$2(false)
836
- };
837
-
838
- var uncurryThis$a = functionUncurryThis;
839
- var hasOwn$3 = hasOwnProperty_1;
840
- var toIndexedObject$2 = toIndexedObject$5;
841
- var indexOf$1 = arrayIncludes.indexOf;
842
- var hiddenKeys$2 = hiddenKeys$4;
843
-
844
- var push$1 = uncurryThis$a([].push);
845
-
846
- var objectKeysInternal = function (object, names) {
847
- var O = toIndexedObject$2(object);
848
- var i = 0;
849
- var result = [];
850
- var key;
851
- for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push$1(result, key);
852
- // Don't enum bug & hidden keys
853
- while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
854
- ~indexOf$1(result, key) || push$1(result, key);
855
- }
856
- return result;
857
- };
858
-
859
- // IE8- don't enum bug keys
860
- var enumBugKeys$3 = [
861
- 'constructor',
862
- 'hasOwnProperty',
863
- 'isPrototypeOf',
864
- 'propertyIsEnumerable',
865
- 'toLocaleString',
866
- 'toString',
867
- 'valueOf'
868
- ];
869
-
870
- var internalObjectKeys$1 = objectKeysInternal;
871
- var enumBugKeys$2 = enumBugKeys$3;
872
-
873
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
874
-
875
- // `Object.getOwnPropertyNames` method
876
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
877
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
878
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
879
- return internalObjectKeys$1(O, hiddenKeys$1);
880
- };
881
-
882
- var objectGetOwnPropertySymbols = {};
883
-
884
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
885
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
886
-
887
- var getBuiltIn$1 = getBuiltIn$3;
888
- var uncurryThis$9 = functionUncurryThis;
889
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
890
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
891
- var anObject$6 = anObject$8;
892
-
893
- var concat$2 = uncurryThis$9([].concat);
894
-
895
- // all object keys, includes non-enumerable and symbols
896
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
897
- var keys = getOwnPropertyNamesModule.f(anObject$6(it));
898
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
899
- return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
900
- };
901
-
902
- var hasOwn$2 = hasOwnProperty_1;
903
- var ownKeys = ownKeys$1;
904
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
905
- var definePropertyModule$1 = objectDefineProperty;
906
-
907
- var copyConstructorProperties$1 = function (target, source, exceptions) {
908
- var keys = ownKeys(source);
909
- var defineProperty = definePropertyModule$1.f;
910
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
911
- for (var i = 0; i < keys.length; i++) {
912
- var key = keys[i];
913
- if (!hasOwn$2(target, key) && !(exceptions && hasOwn$2(exceptions, key))) {
914
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
915
- }
916
- }
917
- };
918
-
919
- var fails$a = fails$i;
920
- var isCallable$6 = isCallable$g;
921
-
922
- var replacement = /#|\.prototype\./;
923
-
924
- var isForced$1 = function (feature, detection) {
925
- var value = data[normalize(feature)];
926
- return value === POLYFILL ? true
927
- : value === NATIVE ? false
928
- : isCallable$6(detection) ? fails$a(detection)
929
- : !!detection;
930
- };
931
-
932
- var normalize = isForced$1.normalize = function (string) {
933
- return String(string).replace(replacement, '.').toLowerCase();
934
- };
935
-
936
- var data = isForced$1.data = {};
937
- var NATIVE = isForced$1.NATIVE = 'N';
938
- var POLYFILL = isForced$1.POLYFILL = 'P';
939
-
940
- var isForced_1 = isForced$1;
941
-
942
- var global$6 = global$g;
943
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
944
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
945
- var defineBuiltIn$3 = defineBuiltIn$4;
946
- var defineGlobalProperty = defineGlobalProperty$3;
947
- var copyConstructorProperties = copyConstructorProperties$1;
948
- var isForced = isForced_1;
949
-
950
- /*
951
- options.target - name of the target object
952
- options.global - target is the global object
953
- options.stat - export as static methods of target
954
- options.proto - export as prototype methods of target
955
- options.real - real prototype method for the `pure` version
956
- options.forced - export even if the native feature is available
957
- options.bind - bind methods to the target, required for the `pure` version
958
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
959
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
960
- options.sham - add a flag to not completely full polyfills
961
- options.enumerable - export as enumerable property
962
- options.dontCallGetSet - prevent calling a getter on target
963
- options.name - the .name of the function if it does not match the key
964
- */
965
- var _export = function (options, source) {
966
- var TARGET = options.target;
967
- var GLOBAL = options.global;
968
- var STATIC = options.stat;
969
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
970
- if (GLOBAL) {
971
- target = global$6;
972
- } else if (STATIC) {
973
- target = global$6[TARGET] || defineGlobalProperty(TARGET, {});
974
- } else {
975
- target = (global$6[TARGET] || {}).prototype;
976
- }
977
- if (target) for (key in source) {
978
- sourceProperty = source[key];
979
- if (options.dontCallGetSet) {
980
- descriptor = getOwnPropertyDescriptor(target, key);
981
- targetProperty = descriptor && descriptor.value;
982
- } else targetProperty = target[key];
983
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
984
- // contained in target
985
- if (!FORCED && targetProperty !== undefined) {
986
- if (typeof sourceProperty == typeof targetProperty) continue;
987
- copyConstructorProperties(sourceProperty, targetProperty);
988
- }
989
- // add a flag to not completely full polyfills
990
- if (options.sham || (targetProperty && targetProperty.sham)) {
991
- createNonEnumerableProperty$3(sourceProperty, 'sham', true);
992
- }
993
- defineBuiltIn$3(target, key, sourceProperty, options);
994
- }
995
- };
996
-
997
- var objectDefineProperties = {};
998
-
999
- var internalObjectKeys = objectKeysInternal;
1000
- var enumBugKeys$1 = enumBugKeys$3;
1001
-
1002
- // `Object.keys` method
1003
- // https://tc39.es/ecma262/#sec-object.keys
1004
- // eslint-disable-next-line es/no-object-keys -- safe
1005
- var objectKeys$2 = Object.keys || function keys(O) {
1006
- return internalObjectKeys(O, enumBugKeys$1);
1007
- };
1008
-
1009
- var DESCRIPTORS$2 = descriptors;
1010
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1011
- var definePropertyModule = objectDefineProperty;
1012
- var anObject$5 = anObject$8;
1013
- var toIndexedObject$1 = toIndexedObject$5;
1014
- var objectKeys$1 = objectKeys$2;
1015
-
1016
- // `Object.defineProperties` method
1017
- // https://tc39.es/ecma262/#sec-object.defineproperties
1018
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1019
- objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1020
- anObject$5(O);
1021
- var props = toIndexedObject$1(Properties);
1022
- var keys = objectKeys$1(Properties);
1023
- var length = keys.length;
1024
- var index = 0;
1025
- var key;
1026
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1027
- return O;
1028
- };
1029
-
1030
- var getBuiltIn = getBuiltIn$3;
1031
-
1032
- var html$1 = getBuiltIn('document', 'documentElement');
1033
-
1034
- /* global ActiveXObject -- old IE, WSH */
1035
- var anObject$4 = anObject$8;
1036
- var definePropertiesModule = objectDefineProperties;
1037
- var enumBugKeys = enumBugKeys$3;
1038
- var hiddenKeys = hiddenKeys$4;
1039
- var html = html$1;
1040
- var documentCreateElement$1 = documentCreateElement$2;
1041
- var sharedKey$1 = sharedKey$3;
1042
-
1043
- var GT = '>';
1044
- var LT = '<';
1045
- var PROTOTYPE = 'prototype';
1046
- var SCRIPT = 'script';
1047
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1048
-
1049
- var EmptyConstructor = function () { /* empty */ };
1050
-
1051
- var scriptTag = function (content) {
1052
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1053
- };
1054
-
1055
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1056
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1057
- activeXDocument.write(scriptTag(''));
1058
- activeXDocument.close();
1059
- var temp = activeXDocument.parentWindow.Object;
1060
- activeXDocument = null; // avoid memory leak
1061
- return temp;
1062
- };
1063
-
1064
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1065
- var NullProtoObjectViaIFrame = function () {
1066
- // Thrash, waste and sodomy: IE GC bug
1067
- var iframe = documentCreateElement$1('iframe');
1068
- var JS = 'java' + SCRIPT + ':';
1069
- var iframeDocument;
1070
- iframe.style.display = 'none';
1071
- html.appendChild(iframe);
1072
- // https://github.com/zloirock/core-js/issues/475
1073
- iframe.src = String(JS);
1074
- iframeDocument = iframe.contentWindow.document;
1075
- iframeDocument.open();
1076
- iframeDocument.write(scriptTag('document.F=Object'));
1077
- iframeDocument.close();
1078
- return iframeDocument.F;
1079
- };
1080
-
1081
- // Check for document.domain and active x support
1082
- // No need to use active x approach when document.domain is not set
1083
- // see https://github.com/es-shims/es5-shim/issues/150
1084
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1085
- // avoid IE GC bug
1086
- var activeXDocument;
1087
- var NullProtoObject = function () {
1088
- try {
1089
- activeXDocument = new ActiveXObject('htmlfile');
1090
- } catch (error) { /* ignore */ }
1091
- NullProtoObject = typeof document != 'undefined'
1092
- ? document.domain && activeXDocument
1093
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1094
- : NullProtoObjectViaIFrame()
1095
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1096
- var length = enumBugKeys.length;
1097
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1098
- return NullProtoObject();
1099
- };
1100
-
1101
- hiddenKeys[IE_PROTO$1] = true;
1102
-
1103
- // `Object.create` method
1104
- // https://tc39.es/ecma262/#sec-object.create
1105
- // eslint-disable-next-line es/no-object-create -- safe
1106
- var objectCreate = Object.create || function create(O, Properties) {
1107
- var result;
1108
- if (O !== null) {
1109
- EmptyConstructor[PROTOTYPE] = anObject$4(O);
1110
- result = new EmptyConstructor();
1111
- EmptyConstructor[PROTOTYPE] = null;
1112
- // add "__proto__" for Object.getPrototypeOf polyfill
1113
- result[IE_PROTO$1] = O;
1114
- } else result = NullProtoObject();
1115
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1116
- };
1117
-
1118
- var wellKnownSymbol$a = wellKnownSymbol$c;
1119
- var create$2 = objectCreate;
1120
- var defineProperty$3 = objectDefineProperty.f;
1121
-
1122
- var UNSCOPABLES = wellKnownSymbol$a('unscopables');
1123
- var ArrayPrototype = Array.prototype;
1124
-
1125
- // Array.prototype[@@unscopables]
1126
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1127
- if (ArrayPrototype[UNSCOPABLES] === undefined) {
1128
- defineProperty$3(ArrayPrototype, UNSCOPABLES, {
1129
- configurable: true,
1130
- value: create$2(null)
1131
- });
1132
- }
1133
-
1134
- // add a key to Array.prototype[@@unscopables]
1135
- var addToUnscopables$2 = function (key) {
1136
- ArrayPrototype[UNSCOPABLES][key] = true;
1137
- };
1138
-
1139
- var $$5 = _export;
1140
- var $includes = arrayIncludes.includes;
1141
- var fails$9 = fails$i;
1142
- var addToUnscopables$1 = addToUnscopables$2;
1143
-
1144
- // FF99+ bug
1145
- var BROKEN_ON_SPARSE = fails$9(function () {
1146
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
1147
- return !Array(1).includes();
1148
- });
1149
-
1150
- // `Array.prototype.includes` method
1151
- // https://tc39.es/ecma262/#sec-array.prototype.includes
1152
- $$5({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
1153
- includes: function includes(el /* , fromIndex = 0 */) {
1154
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1155
- }
1156
- });
1157
-
1158
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1159
- addToUnscopables$1('includes');
1160
-
1161
- var isObject$2 = isObject$8;
1162
- var classof$4 = classofRaw$2;
1163
- var wellKnownSymbol$9 = wellKnownSymbol$c;
1164
-
1165
- var MATCH$1 = wellKnownSymbol$9('match');
1166
-
1167
- // `IsRegExp` abstract operation
1168
- // https://tc39.es/ecma262/#sec-isregexp
1169
- var isRegexp = function (it) {
1170
- var isRegExp;
1171
- return isObject$2(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$4(it) === 'RegExp');
1172
- };
1173
-
1174
- var isRegExp = isRegexp;
1175
-
1176
- var $TypeError$3 = TypeError;
1177
-
1178
- var notARegexp = function (it) {
1179
- if (isRegExp(it)) {
1180
- throw new $TypeError$3("The method doesn't accept regular expressions");
1181
- } return it;
1182
- };
1183
-
1184
- var wellKnownSymbol$8 = wellKnownSymbol$c;
1185
-
1186
- var TO_STRING_TAG$2 = wellKnownSymbol$8('toStringTag');
1187
- var test = {};
1188
-
1189
- test[TO_STRING_TAG$2] = 'z';
1190
-
1191
- var toStringTagSupport = String(test) === '[object z]';
1192
-
1193
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1194
- var isCallable$5 = isCallable$g;
1195
- var classofRaw$1 = classofRaw$2;
1196
- var wellKnownSymbol$7 = wellKnownSymbol$c;
1197
-
1198
- var TO_STRING_TAG$1 = wellKnownSymbol$7('toStringTag');
1199
- var $Object$1 = Object;
1200
-
1201
- // ES3 wrong here
1202
- var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
1203
-
1204
- // fallback for IE11 Script Access Denied error
1205
- var tryGet = function (it, key) {
1206
- try {
1207
- return it[key];
1208
- } catch (error) { /* empty */ }
1209
- };
1210
-
1211
- // getting tag from ES6+ `Object.prototype.toString`
1212
- var classof$3 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1213
- var O, tag, result;
1214
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1215
- // @@toStringTag case
1216
- : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
1217
- // builtinTag case
1218
- : CORRECT_ARGUMENTS ? classofRaw$1(O)
1219
- // ES3 arguments fallback
1220
- : (result = classofRaw$1(O)) === 'Object' && isCallable$5(O.callee) ? 'Arguments' : result;
1221
- };
1222
-
1223
- var classof$2 = classof$3;
1224
-
1225
- var $String$1 = String;
1226
-
1227
- var toString$4 = function (argument) {
1228
- if (classof$2(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1229
- return $String$1(argument);
1230
- };
1231
-
1232
- var wellKnownSymbol$6 = wellKnownSymbol$c;
1233
-
1234
- var MATCH = wellKnownSymbol$6('match');
1235
-
1236
- var correctIsRegexpLogic = function (METHOD_NAME) {
1237
- var regexp = /./;
1238
- try {
1239
- '/./'[METHOD_NAME](regexp);
1240
- } catch (error1) {
1241
- try {
1242
- regexp[MATCH] = false;
1243
- return '/./'[METHOD_NAME](regexp);
1244
- } catch (error2) { /* empty */ }
1245
- } return false;
1246
- };
1247
-
1248
- var $$4 = _export;
1249
- var uncurryThis$8 = functionUncurryThis;
1250
- var notARegExp = notARegexp;
1251
- var requireObjectCoercible$2 = requireObjectCoercible$5;
1252
- var toString$3 = toString$4;
1253
- var correctIsRegExpLogic = correctIsRegexpLogic;
1254
-
1255
- var stringIndexOf$1 = uncurryThis$8(''.indexOf);
1256
-
1257
- // `String.prototype.includes` method
1258
- // https://tc39.es/ecma262/#sec-string.prototype.includes
1259
- $$4({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
1260
- includes: function includes(searchString /* , position = 0 */) {
1261
- return !!~stringIndexOf$1(
1262
- toString$3(requireObjectCoercible$2(this)),
1263
- toString$3(notARegExp(searchString)),
1264
- arguments.length > 1 ? arguments[1] : undefined
1265
- );
1266
- }
1267
- });
1268
-
1269
- var iterators = {};
1270
-
1271
- var fails$8 = fails$i;
1272
-
1273
- var correctPrototypeGetter = !fails$8(function () {
1274
- function F() { /* empty */ }
1275
- F.prototype.constructor = null;
1276
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1277
- return Object.getPrototypeOf(new F()) !== F.prototype;
1278
- });
1279
-
1280
- var hasOwn$1 = hasOwnProperty_1;
1281
- var isCallable$4 = isCallable$g;
1282
- var toObject$3 = toObject$5;
1283
- var sharedKey = sharedKey$3;
1284
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1285
-
1286
- var IE_PROTO = sharedKey('IE_PROTO');
1287
- var $Object = Object;
1288
- var ObjectPrototype = $Object.prototype;
1289
-
1290
- // `Object.getPrototypeOf` method
1291
- // https://tc39.es/ecma262/#sec-object.getprototypeof
1292
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
1293
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
1294
- var object = toObject$3(O);
1295
- if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1296
- var constructor = object.constructor;
1297
- if (isCallable$4(constructor) && object instanceof constructor) {
1298
- return constructor.prototype;
1299
- } return object instanceof $Object ? ObjectPrototype : null;
1300
- };
1301
-
1302
- var fails$7 = fails$i;
1303
- var isCallable$3 = isCallable$g;
1304
- var isObject$1 = isObject$8;
1305
- var getPrototypeOf$1 = objectGetPrototypeOf;
1306
- var defineBuiltIn$2 = defineBuiltIn$4;
1307
- var wellKnownSymbol$5 = wellKnownSymbol$c;
1308
-
1309
- var ITERATOR$2 = wellKnownSymbol$5('iterator');
1310
- var BUGGY_SAFARI_ITERATORS$1 = false;
1311
-
1312
- // `%IteratorPrototype%` object
1313
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1314
- var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1315
-
1316
- /* eslint-disable es/no-array-prototype-keys -- safe */
1317
- if ([].keys) {
1318
- arrayIterator = [].keys();
1319
- // Safari 8 has buggy iterators w/o `next`
1320
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1321
- else {
1322
- PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1323
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1324
- }
1325
- }
1326
-
1327
- var NEW_ITERATOR_PROTOTYPE = !isObject$1(IteratorPrototype$2) || fails$7(function () {
1328
- var test = {};
1329
- // FF44- legacy iterators case
1330
- return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1331
- });
1332
-
1333
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1334
-
1335
- // `%IteratorPrototype%[@@iterator]()` method
1336
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1337
- if (!isCallable$3(IteratorPrototype$2[ITERATOR$2])) {
1338
- defineBuiltIn$2(IteratorPrototype$2, ITERATOR$2, function () {
1339
- return this;
1340
- });
1341
- }
1342
-
1343
- var iteratorsCore = {
1344
- IteratorPrototype: IteratorPrototype$2,
1345
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1346
- };
1347
-
1348
- var defineProperty$2 = objectDefineProperty.f;
1349
- var hasOwn = hasOwnProperty_1;
1350
- var wellKnownSymbol$4 = wellKnownSymbol$c;
1351
-
1352
- var TO_STRING_TAG = wellKnownSymbol$4('toStringTag');
1353
-
1354
- var setToStringTag$3 = function (target, TAG, STATIC) {
1355
- if (target && !STATIC) target = target.prototype;
1356
- if (target && !hasOwn(target, TO_STRING_TAG)) {
1357
- defineProperty$2(target, TO_STRING_TAG, { configurable: true, value: TAG });
1358
- }
1359
- };
1360
-
1361
- var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1362
- var create$1 = objectCreate;
1363
- var createPropertyDescriptor = createPropertyDescriptor$3;
1364
- var setToStringTag$2 = setToStringTag$3;
1365
- var Iterators$2 = iterators;
1366
-
1367
- var returnThis$1 = function () { return this; };
1368
-
1369
- var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1370
- var TO_STRING_TAG = NAME + ' Iterator';
1371
- IteratorConstructor.prototype = create$1(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1372
- setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
1373
- Iterators$2[TO_STRING_TAG] = returnThis$1;
1374
- return IteratorConstructor;
1375
- };
1376
-
1377
- var uncurryThis$7 = functionUncurryThis;
1378
- var aCallable$1 = aCallable$3;
1379
-
1380
- var functionUncurryThisAccessor = function (object, key, method) {
1381
- try {
1382
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1383
- return uncurryThis$7(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
1384
- } catch (error) { /* empty */ }
1385
- };
1386
-
1387
- var isObject = isObject$8;
1388
-
1389
- var isPossiblePrototype$1 = function (argument) {
1390
- return isObject(argument) || argument === null;
1391
- };
1392
-
1393
- var isPossiblePrototype = isPossiblePrototype$1;
1394
-
1395
- var $String = String;
1396
- var $TypeError$2 = TypeError;
1397
-
1398
- var aPossiblePrototype$1 = function (argument) {
1399
- if (isPossiblePrototype(argument)) return argument;
1400
- throw new $TypeError$2("Can't set " + $String(argument) + ' as a prototype');
1401
- };
1402
-
1403
- /* eslint-disable no-proto -- safe */
1404
- var uncurryThisAccessor = functionUncurryThisAccessor;
1405
- var anObject$3 = anObject$8;
1406
- var aPossiblePrototype = aPossiblePrototype$1;
1407
-
1408
- // `Object.setPrototypeOf` method
1409
- // https://tc39.es/ecma262/#sec-object.setprototypeof
1410
- // Works with __proto__ only. Old v8 can't work with null proto objects.
1411
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1412
- var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1413
- var CORRECT_SETTER = false;
1414
- var test = {};
1415
- var setter;
1416
- try {
1417
- setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
1418
- setter(test, []);
1419
- CORRECT_SETTER = test instanceof Array;
1420
- } catch (error) { /* empty */ }
1421
- return function setPrototypeOf(O, proto) {
1422
- anObject$3(O);
1423
- aPossiblePrototype(proto);
1424
- if (CORRECT_SETTER) setter(O, proto);
1425
- else O.__proto__ = proto;
1426
- return O;
1427
- };
1428
- }() : undefined);
1429
-
1430
- var $$3 = _export;
1431
- var call$5 = functionCall;
1432
- var FunctionName = functionName;
1433
- var isCallable$2 = isCallable$g;
1434
- var createIteratorConstructor = iteratorCreateConstructor;
1435
- var getPrototypeOf = objectGetPrototypeOf;
1436
- var setPrototypeOf = objectSetPrototypeOf;
1437
- var setToStringTag$1 = setToStringTag$3;
1438
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1439
- var defineBuiltIn$1 = defineBuiltIn$4;
1440
- var wellKnownSymbol$3 = wellKnownSymbol$c;
1441
- var Iterators$1 = iterators;
1442
- var IteratorsCore = iteratorsCore;
1443
-
1444
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1445
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1446
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
1447
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1448
- var ITERATOR$1 = wellKnownSymbol$3('iterator');
1449
- var KEYS = 'keys';
1450
- var VALUES = 'values';
1451
- var ENTRIES = 'entries';
1452
-
1453
- var returnThis = function () { return this; };
1454
-
1455
- var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1456
- createIteratorConstructor(IteratorConstructor, NAME, next);
1457
-
1458
- var getIterationMethod = function (KIND) {
1459
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1460
- if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
1461
-
1462
- switch (KIND) {
1463
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1464
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1465
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1466
- }
1467
-
1468
- return function () { return new IteratorConstructor(this); };
1469
- };
1470
-
1471
- var TO_STRING_TAG = NAME + ' Iterator';
1472
- var INCORRECT_VALUES_NAME = false;
1473
- var IterablePrototype = Iterable.prototype;
1474
- var nativeIterator = IterablePrototype[ITERATOR$1]
1475
- || IterablePrototype['@@iterator']
1476
- || DEFAULT && IterablePrototype[DEFAULT];
1477
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1478
- var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1479
- var CurrentIteratorPrototype, methods, KEY;
1480
-
1481
- // fix native
1482
- if (anyNativeIterator) {
1483
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1484
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1485
- if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1486
- if (setPrototypeOf) {
1487
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1488
- } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
1489
- defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1490
- }
1491
- }
1492
- // Set @@toStringTag to native iterators
1493
- setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
1494
- }
1495
- }
1496
-
1497
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1498
- if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1499
- if (CONFIGURABLE_FUNCTION_NAME) {
1500
- createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1501
- } else {
1502
- INCORRECT_VALUES_NAME = true;
1503
- defaultIterator = function values() { return call$5(nativeIterator, this); };
1504
- }
1505
- }
1506
-
1507
- // export additional methods
1508
- if (DEFAULT) {
1509
- methods = {
1510
- values: getIterationMethod(VALUES),
1511
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1512
- entries: getIterationMethod(ENTRIES)
1513
- };
1514
- if (FORCED) for (KEY in methods) {
1515
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1516
- defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
1517
- }
1518
- } else $$3({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1519
- }
1520
-
1521
- // define iterator
1522
- if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1523
- defineBuiltIn$1(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1524
- }
1525
- Iterators$1[NAME] = defaultIterator;
1526
-
1527
- return methods;
1528
- };
1529
-
1530
- // `CreateIterResultObject` abstract operation
1531
- // https://tc39.es/ecma262/#sec-createiterresultobject
1532
- var createIterResultObject$1 = function (value, done) {
1533
- return { value: value, done: done };
1534
- };
1535
-
1536
- var toIndexedObject = toIndexedObject$5;
1537
- var addToUnscopables = addToUnscopables$2;
1538
- var Iterators = iterators;
1539
- var InternalStateModule = internalState;
1540
- var defineProperty$1 = objectDefineProperty.f;
1541
- var defineIterator = iteratorDefine;
1542
- var createIterResultObject = createIterResultObject$1;
1543
- var DESCRIPTORS$1 = descriptors;
1544
-
1545
- var ARRAY_ITERATOR = 'Array Iterator';
1546
- var setInternalState = InternalStateModule.set;
1547
- var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
1548
-
1549
- // `Array.prototype.entries` method
1550
- // https://tc39.es/ecma262/#sec-array.prototype.entries
1551
- // `Array.prototype.keys` method
1552
- // https://tc39.es/ecma262/#sec-array.prototype.keys
1553
- // `Array.prototype.values` method
1554
- // https://tc39.es/ecma262/#sec-array.prototype.values
1555
- // `Array.prototype[@@iterator]` method
1556
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1557
- // `CreateArrayIterator` internal method
1558
- // https://tc39.es/ecma262/#sec-createarrayiterator
1559
- var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1560
- setInternalState(this, {
1561
- type: ARRAY_ITERATOR,
1562
- target: toIndexedObject(iterated), // target
1563
- index: 0, // next index
1564
- kind: kind // kind
1565
- });
1566
- // `%ArrayIteratorPrototype%.next` method
1567
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1568
- }, function () {
1569
- var state = getInternalState$1(this);
1570
- var target = state.target;
1571
- var index = state.index++;
1572
- if (!target || index >= target.length) {
1573
- state.target = undefined;
1574
- return createIterResultObject(undefined, true);
1575
- }
1576
- switch (state.kind) {
1577
- case 'keys': return createIterResultObject(index, false);
1578
- case 'values': return createIterResultObject(target[index], false);
1579
- } return createIterResultObject([index, target[index]], false);
1580
- }, 'values');
1581
-
1582
- // argumentsList[@@iterator] is %ArrayProto_values%
1583
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1584
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1585
- var values = Iterators.Arguments = Iterators.Array;
1586
-
1587
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1588
- addToUnscopables('keys');
1589
- addToUnscopables('values');
1590
- addToUnscopables('entries');
1591
-
1592
- // V8 ~ Chrome 45- bug
1593
- if (DESCRIPTORS$1 && values.name !== 'values') try {
1594
- defineProperty$1(values, 'name', { value: 'values' });
1595
- } catch (error) { /* empty */ }
1596
-
1597
- // iterable DOM collections
1598
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1599
- var domIterables = {
1600
- CSSRuleList: 0,
1601
- CSSStyleDeclaration: 0,
1602
- CSSValueList: 0,
1603
- ClientRectList: 0,
1604
- DOMRectList: 0,
1605
- DOMStringList: 0,
1606
- DOMTokenList: 1,
1607
- DataTransferItemList: 0,
1608
- FileList: 0,
1609
- HTMLAllCollection: 0,
1610
- HTMLCollection: 0,
1611
- HTMLFormElement: 0,
1612
- HTMLSelectElement: 0,
1613
- MediaList: 0,
1614
- MimeTypeArray: 0,
1615
- NamedNodeMap: 0,
1616
- NodeList: 1,
1617
- PaintRequestList: 0,
1618
- Plugin: 0,
1619
- PluginArray: 0,
1620
- SVGLengthList: 0,
1621
- SVGNumberList: 0,
1622
- SVGPathSegList: 0,
1623
- SVGPointList: 0,
1624
- SVGStringList: 0,
1625
- SVGTransformList: 0,
1626
- SourceBufferList: 0,
1627
- StyleSheetList: 0,
1628
- TextTrackCueList: 0,
1629
- TextTrackList: 0,
1630
- TouchList: 0
1631
- };
1632
-
1633
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
1634
- var documentCreateElement = documentCreateElement$2;
1635
-
1636
- var classList = documentCreateElement('span').classList;
1637
- var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
1638
-
1639
- var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1640
-
1641
- var global$5 = global$g;
1642
- var DOMIterables = domIterables;
1643
- var DOMTokenListPrototype = domTokenListPrototype;
1644
- var ArrayIteratorMethods = es_array_iterator;
1645
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
1646
- var setToStringTag = setToStringTag$3;
1647
- var wellKnownSymbol$2 = wellKnownSymbol$c;
1648
-
1649
- var ITERATOR = wellKnownSymbol$2('iterator');
1650
- var ArrayValues = ArrayIteratorMethods.values;
1651
-
1652
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1653
- if (CollectionPrototype) {
1654
- // some Chrome versions have non-configurable methods on DOMTokenList
1655
- if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1656
- createNonEnumerableProperty$1(CollectionPrototype, ITERATOR, ArrayValues);
1657
- } catch (error) {
1658
- CollectionPrototype[ITERATOR] = ArrayValues;
1659
- }
1660
- setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
1661
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
1662
- // some Chrome versions have non-configurable methods on DOMTokenList
1663
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
1664
- createNonEnumerableProperty$1(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
1665
- } catch (error) {
1666
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
1667
- }
1668
- }
1669
- }
1670
- };
1671
-
1672
- for (var COLLECTION_NAME in DOMIterables) {
1673
- handlePrototype(global$5[COLLECTION_NAME] && global$5[COLLECTION_NAME].prototype, COLLECTION_NAME);
1674
- }
1675
-
1676
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1677
-
1678
- var anObject$2 = anObject$8;
1679
-
1680
- // `RegExp.prototype.flags` getter implementation
1681
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1682
- var regexpFlags$1 = function () {
1683
- var that = anObject$2(this);
1684
- var result = '';
1685
- if (that.hasIndices) result += 'd';
1686
- if (that.global) result += 'g';
1687
- if (that.ignoreCase) result += 'i';
1688
- if (that.multiline) result += 'm';
1689
- if (that.dotAll) result += 's';
1690
- if (that.unicode) result += 'u';
1691
- if (that.unicodeSets) result += 'v';
1692
- if (that.sticky) result += 'y';
1693
- return result;
1694
- };
1695
-
1696
- var fails$6 = fails$i;
1697
- var global$4 = global$g;
1698
-
1699
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1700
- var $RegExp$2 = global$4.RegExp;
1701
-
1702
- var UNSUPPORTED_Y$1 = fails$6(function () {
1703
- var re = $RegExp$2('a', 'y');
1704
- re.lastIndex = 2;
1705
- return re.exec('abcd') !== null;
1706
- });
1707
-
1708
- // UC Browser bug
1709
- // https://github.com/zloirock/core-js/issues/1008
1710
- var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$6(function () {
1711
- return !$RegExp$2('a', 'y').sticky;
1712
- });
1713
-
1714
- var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$6(function () {
1715
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1716
- var re = $RegExp$2('^r', 'gy');
1717
- re.lastIndex = 2;
1718
- return re.exec('str') !== null;
1719
- });
1720
-
1721
- var regexpStickyHelpers = {
1722
- BROKEN_CARET: BROKEN_CARET,
1723
- MISSED_STICKY: MISSED_STICKY,
1724
- UNSUPPORTED_Y: UNSUPPORTED_Y$1
1725
- };
1726
-
1727
- var fails$5 = fails$i;
1728
- var global$3 = global$g;
1729
-
1730
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1731
- var $RegExp$1 = global$3.RegExp;
1732
-
1733
- var regexpUnsupportedDotAll = fails$5(function () {
1734
- var re = $RegExp$1('.', 's');
1735
- return !(re.dotAll && re.test('\n') && re.flags === 's');
1736
- });
1737
-
1738
- var fails$4 = fails$i;
1739
- var global$2 = global$g;
1740
-
1741
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1742
- var $RegExp = global$2.RegExp;
1743
-
1744
- var regexpUnsupportedNcg = fails$4(function () {
1745
- var re = $RegExp('(?<a>b)', 'g');
1746
- return re.exec('b').groups.a !== 'b' ||
1747
- 'b'.replace(re, '$<a>c') !== 'bc';
1748
- });
1749
-
1750
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1751
- /* eslint-disable regexp/no-useless-quantifier -- testing */
1752
- var call$4 = functionCall;
1753
- var uncurryThis$6 = functionUncurryThis;
1754
- var toString$2 = toString$4;
1755
- var regexpFlags = regexpFlags$1;
1756
- var stickyHelpers = regexpStickyHelpers;
1757
- var shared = shared$4.exports;
1758
- var create = objectCreate;
1759
- var getInternalState = internalState.get;
1760
- var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
1761
- var UNSUPPORTED_NCG = regexpUnsupportedNcg;
1762
-
1763
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
1764
- var nativeExec = RegExp.prototype.exec;
1765
- var patchedExec = nativeExec;
1766
- var charAt$3 = uncurryThis$6(''.charAt);
1767
- var indexOf = uncurryThis$6(''.indexOf);
1768
- var replace$1 = uncurryThis$6(''.replace);
1769
- var stringSlice$3 = uncurryThis$6(''.slice);
1770
-
1771
- var UPDATES_LAST_INDEX_WRONG = (function () {
1772
- var re1 = /a/;
1773
- var re2 = /b*/g;
1774
- call$4(nativeExec, re1, 'a');
1775
- call$4(nativeExec, re2, 'a');
1776
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1777
- })();
1778
-
1779
- var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
1780
-
1781
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
1782
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1783
-
1784
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
1785
-
1786
- if (PATCH) {
1787
- patchedExec = function exec(string) {
1788
- var re = this;
1789
- var state = getInternalState(re);
1790
- var str = toString$2(string);
1791
- var raw = state.raw;
1792
- var result, reCopy, lastIndex, match, i, object, group;
1793
-
1794
- if (raw) {
1795
- raw.lastIndex = re.lastIndex;
1796
- result = call$4(patchedExec, raw, str);
1797
- re.lastIndex = raw.lastIndex;
1798
- return result;
1799
- }
1800
-
1801
- var groups = state.groups;
1802
- var sticky = UNSUPPORTED_Y && re.sticky;
1803
- var flags = call$4(regexpFlags, re);
1804
- var source = re.source;
1805
- var charsAdded = 0;
1806
- var strCopy = str;
1807
-
1808
- if (sticky) {
1809
- flags = replace$1(flags, 'y', '');
1810
- if (indexOf(flags, 'g') === -1) {
1811
- flags += 'g';
1812
- }
1813
-
1814
- strCopy = stringSlice$3(str, re.lastIndex);
1815
- // Support anchored sticky behavior.
1816
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
1817
- source = '(?: ' + source + ')';
1818
- strCopy = ' ' + strCopy;
1819
- charsAdded++;
1820
- }
1821
- // ^(? + rx + ) is needed, in combination with some str slicing, to
1822
- // simulate the 'y' flag.
1823
- reCopy = new RegExp('^(?:' + source + ')', flags);
1824
- }
1825
-
1826
- if (NPCG_INCLUDED) {
1827
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1828
- }
1829
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1830
-
1831
- match = call$4(nativeExec, sticky ? reCopy : re, strCopy);
1832
-
1833
- if (sticky) {
1834
- if (match) {
1835
- match.input = stringSlice$3(match.input, charsAdded);
1836
- match[0] = stringSlice$3(match[0], charsAdded);
1837
- match.index = re.lastIndex;
1838
- re.lastIndex += match[0].length;
1839
- } else re.lastIndex = 0;
1840
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
1841
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1842
- }
1843
- if (NPCG_INCLUDED && match && match.length > 1) {
1844
- // Fix browsers whose `exec` methods don't consistently return `undefined`
1845
- // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
1846
- call$4(nativeReplace, match[0], reCopy, function () {
1847
- for (i = 1; i < arguments.length - 2; i++) {
1848
- if (arguments[i] === undefined) match[i] = undefined;
1849
- }
1850
- });
1851
- }
1852
-
1853
- if (match && groups) {
1854
- match.groups = object = create(null);
1855
- for (i = 0; i < groups.length; i++) {
1856
- group = groups[i];
1857
- object[group[0]] = match[group[1]];
1858
- }
1859
- }
1860
-
1861
- return match;
1862
- };
1863
- }
1864
-
1865
- var regexpExec$2 = patchedExec;
1866
-
1867
- var $$2 = _export;
1868
- var exec = regexpExec$2;
1869
-
1870
- // `RegExp.prototype.exec` method
1871
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1872
- $$2({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
1873
- exec: exec
1874
- });
1875
-
1876
- var NATIVE_BIND = functionBindNative;
1877
-
1878
- var FunctionPrototype = Function.prototype;
1879
- var apply$1 = FunctionPrototype.apply;
1880
- var call$3 = FunctionPrototype.call;
1881
-
1882
- // eslint-disable-next-line es/no-reflect -- safe
1883
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$3.bind(apply$1) : function () {
1884
- return call$3.apply(apply$1, arguments);
1885
- });
1886
-
1887
- var classofRaw = classofRaw$2;
1888
- var uncurryThis$5 = functionUncurryThis;
1889
-
1890
- var functionUncurryThisClause = function (fn) {
1891
- // Nashorn bug:
1892
- // https://github.com/zloirock/core-js/issues/1128
1893
- // https://github.com/zloirock/core-js/issues/1130
1894
- if (classofRaw(fn) === 'Function') return uncurryThis$5(fn);
1895
- };
1896
-
1897
- // TODO: Remove from `core-js@4` since it's moved to entry points
1898
-
1899
- var uncurryThis$4 = functionUncurryThisClause;
1900
- var defineBuiltIn = defineBuiltIn$4;
1901
- var regexpExec$1 = regexpExec$2;
1902
- var fails$3 = fails$i;
1903
- var wellKnownSymbol$1 = wellKnownSymbol$c;
1904
- var createNonEnumerableProperty = createNonEnumerableProperty$5;
1905
-
1906
- var SPECIES = wellKnownSymbol$1('species');
1907
- var RegExpPrototype = RegExp.prototype;
1908
-
1909
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1910
- var SYMBOL = wellKnownSymbol$1(KEY);
1911
-
1912
- var DELEGATES_TO_SYMBOL = !fails$3(function () {
1913
- // String methods call symbol-named RegEp methods
1914
- var O = {};
1915
- O[SYMBOL] = function () { return 7; };
1916
- return ''[KEY](O) !== 7;
1917
- });
1918
-
1919
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$3(function () {
1920
- // Symbol-named RegExp methods call .exec
1921
- var execCalled = false;
1922
- var re = /a/;
1923
-
1924
- if (KEY === 'split') {
1925
- // We can't use real regex here since it causes deoptimization
1926
- // and serious performance degradation in V8
1927
- // https://github.com/zloirock/core-js/issues/306
1928
- re = {};
1929
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
1930
- // a new one. We need to return the patched regex when creating the new one.
1931
- re.constructor = {};
1932
- re.constructor[SPECIES] = function () { return re; };
1933
- re.flags = '';
1934
- re[SYMBOL] = /./[SYMBOL];
1935
- }
1936
-
1937
- re.exec = function () {
1938
- execCalled = true;
1939
- return null;
1940
- };
1941
-
1942
- re[SYMBOL]('');
1943
- return !execCalled;
1944
- });
1945
-
1946
- if (
1947
- !DELEGATES_TO_SYMBOL ||
1948
- !DELEGATES_TO_EXEC ||
1949
- FORCED
1950
- ) {
1951
- var uncurriedNativeRegExpMethod = uncurryThis$4(/./[SYMBOL]);
1952
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1953
- var uncurriedNativeMethod = uncurryThis$4(nativeMethod);
1954
- var $exec = regexp.exec;
1955
- if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
1956
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1957
- // The native String method already delegates to @@method (this
1958
- // polyfilled function), leasing to infinite recursion.
1959
- // We avoid it by directly calling the native @@method method.
1960
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
1961
- }
1962
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
1963
- }
1964
- return { done: false };
1965
- });
1966
-
1967
- defineBuiltIn(String.prototype, KEY, methods[0]);
1968
- defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
1969
- }
1970
-
1971
- if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
1972
- };
1973
-
1974
- var uncurryThis$3 = functionUncurryThis;
1975
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
1976
- var toString$1 = toString$4;
1977
- var requireObjectCoercible$1 = requireObjectCoercible$5;
1978
-
1979
- var charAt$2 = uncurryThis$3(''.charAt);
1980
- var charCodeAt = uncurryThis$3(''.charCodeAt);
1981
- var stringSlice$2 = uncurryThis$3(''.slice);
1982
-
1983
- var createMethod$1 = function (CONVERT_TO_STRING) {
1984
- return function ($this, pos) {
1985
- var S = toString$1(requireObjectCoercible$1($this));
1986
- var position = toIntegerOrInfinity$1(pos);
1987
- var size = S.length;
1988
- var first, second;
1989
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1990
- first = charCodeAt(S, position);
1991
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
1992
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
1993
- ? CONVERT_TO_STRING
1994
- ? charAt$2(S, position)
1995
- : first
1996
- : CONVERT_TO_STRING
1997
- ? stringSlice$2(S, position, position + 2)
1998
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1999
- };
2000
- };
2001
-
2002
- var stringMultibyte = {
2003
- // `String.prototype.codePointAt` method
2004
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
2005
- codeAt: createMethod$1(false),
2006
- // `String.prototype.at` method
2007
- // https://github.com/mathiasbynens/String.prototype.at
2008
- charAt: createMethod$1(true)
2009
- };
2010
-
2011
- var charAt$1 = stringMultibyte.charAt;
2012
-
2013
- // `AdvanceStringIndex` abstract operation
2014
- // https://tc39.es/ecma262/#sec-advancestringindex
2015
- var advanceStringIndex$1 = function (S, index, unicode) {
2016
- return index + (unicode ? charAt$1(S, index).length : 1);
2017
- };
2018
-
2019
- var uncurryThis$2 = functionUncurryThis;
2020
- var toObject$2 = toObject$5;
2021
-
2022
- var floor = Math.floor;
2023
- var charAt = uncurryThis$2(''.charAt);
2024
- var replace = uncurryThis$2(''.replace);
2025
- var stringSlice$1 = uncurryThis$2(''.slice);
2026
- // eslint-disable-next-line redos/no-vulnerable -- safe
2027
- var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
2028
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
2029
-
2030
- // `GetSubstitution` abstract operation
2031
- // https://tc39.es/ecma262/#sec-getsubstitution
2032
- var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
2033
- var tailPos = position + matched.length;
2034
- var m = captures.length;
2035
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
2036
- if (namedCaptures !== undefined) {
2037
- namedCaptures = toObject$2(namedCaptures);
2038
- symbols = SUBSTITUTION_SYMBOLS;
2039
- }
2040
- return replace(replacement, symbols, function (match, ch) {
2041
- var capture;
2042
- switch (charAt(ch, 0)) {
2043
- case '$': return '$';
2044
- case '&': return matched;
2045
- case '`': return stringSlice$1(str, 0, position);
2046
- case "'": return stringSlice$1(str, tailPos);
2047
- case '<':
2048
- capture = namedCaptures[stringSlice$1(ch, 1, -1)];
2049
- break;
2050
- default: // \d\d?
2051
- var n = +ch;
2052
- if (n === 0) return match;
2053
- if (n > m) {
2054
- var f = floor(n / 10);
2055
- if (f === 0) return match;
2056
- if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
2057
- return match;
2058
- }
2059
- capture = captures[n - 1];
2060
- }
2061
- return capture === undefined ? '' : capture;
2062
- });
2063
- };
2064
-
2065
- var call$2 = functionCall;
2066
- var anObject$1 = anObject$8;
2067
- var isCallable$1 = isCallable$g;
2068
- var classof$1 = classofRaw$2;
2069
- var regexpExec = regexpExec$2;
2070
-
2071
- var $TypeError$1 = TypeError;
2072
-
2073
- // `RegExpExec` abstract operation
2074
- // https://tc39.es/ecma262/#sec-regexpexec
2075
- var regexpExecAbstract = function (R, S) {
2076
- var exec = R.exec;
2077
- if (isCallable$1(exec)) {
2078
- var result = call$2(exec, R, S);
2079
- if (result !== null) anObject$1(result);
2080
- return result;
2081
- }
2082
- if (classof$1(R) === 'RegExp') return call$2(regexpExec, R, S);
2083
- throw new $TypeError$1('RegExp#exec called on incompatible receiver');
2084
- };
2085
-
2086
- var apply = functionApply;
2087
- var call$1 = functionCall;
2088
- var uncurryThis$1 = functionUncurryThis;
2089
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
2090
- var fails$2 = fails$i;
2091
- var anObject = anObject$8;
2092
- var isCallable = isCallable$g;
2093
- var isNullOrUndefined = isNullOrUndefined$3;
2094
- var toIntegerOrInfinity = toIntegerOrInfinity$4;
2095
- var toLength = toLength$2;
2096
- var toString = toString$4;
2097
- var requireObjectCoercible = requireObjectCoercible$5;
2098
- var advanceStringIndex = advanceStringIndex$1;
2099
- var getMethod = getMethod$2;
2100
- var getSubstitution = getSubstitution$1;
2101
- var regExpExec = regexpExecAbstract;
2102
- var wellKnownSymbol = wellKnownSymbol$c;
2103
-
2104
- var REPLACE = wellKnownSymbol('replace');
2105
- var max = Math.max;
2106
- var min = Math.min;
2107
- var concat$1 = uncurryThis$1([].concat);
2108
- var push = uncurryThis$1([].push);
2109
- var stringIndexOf = uncurryThis$1(''.indexOf);
2110
- var stringSlice = uncurryThis$1(''.slice);
2111
-
2112
- var maybeToString = function (it) {
2113
- return it === undefined ? it : String(it);
2114
- };
2115
-
2116
- // IE <= 11 replaces $0 with the whole match, as if it was $&
2117
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
2118
- var REPLACE_KEEPS_$0 = (function () {
2119
- // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
2120
- return 'a'.replace(/./, '$0') === '$0';
2121
- })();
2122
-
2123
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2124
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2125
- if (/./[REPLACE]) {
2126
- return /./[REPLACE]('a', '$0') === '';
2127
- }
2128
- return false;
2129
- })();
2130
-
2131
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$2(function () {
2132
- var re = /./;
2133
- re.exec = function () {
2134
- var result = [];
2135
- result.groups = { a: '7' };
2136
- return result;
2137
- };
2138
- // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
2139
- return ''.replace(re, '$<a>') !== '7';
2140
- });
2141
-
2142
- // @@replace logic
2143
- fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
2144
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
2145
-
2146
- return [
2147
- // `String.prototype.replace` method
2148
- // https://tc39.es/ecma262/#sec-string.prototype.replace
2149
- function replace(searchValue, replaceValue) {
2150
- var O = requireObjectCoercible(this);
2151
- var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);
2152
- return replacer
2153
- ? call$1(replacer, searchValue, O, replaceValue)
2154
- : call$1(nativeReplace, toString(O), searchValue, replaceValue);
2155
- },
2156
- // `RegExp.prototype[@@replace]` method
2157
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2158
- function (string, replaceValue) {
2159
- var rx = anObject(this);
2160
- var S = toString(string);
2161
-
2162
- if (
2163
- typeof replaceValue == 'string' &&
2164
- stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2165
- stringIndexOf(replaceValue, '$<') === -1
2166
- ) {
2167
- var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
2168
- if (res.done) return res.value;
2169
- }
2170
-
2171
- var functionalReplace = isCallable(replaceValue);
2172
- if (!functionalReplace) replaceValue = toString(replaceValue);
2173
-
2174
- var global = rx.global;
2175
- var fullUnicode;
2176
- if (global) {
2177
- fullUnicode = rx.unicode;
2178
- rx.lastIndex = 0;
2179
- }
2180
-
2181
- var results = [];
2182
- var result;
2183
- while (true) {
2184
- result = regExpExec(rx, S);
2185
- if (result === null) break;
2186
-
2187
- push(results, result);
2188
- if (!global) break;
2189
-
2190
- var matchStr = toString(result[0]);
2191
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2192
- }
2193
-
2194
- var accumulatedResult = '';
2195
- var nextSourcePosition = 0;
2196
- for (var i = 0; i < results.length; i++) {
2197
- result = results[i];
2198
-
2199
- var matched = toString(result[0]);
2200
- var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
2201
- var captures = [];
2202
- var replacement;
2203
- // NOTE: This is equivalent to
2204
- // captures = result.slice(1).map(maybeToString)
2205
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
2206
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
2207
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
2208
- for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
2209
- var namedCaptures = result.groups;
2210
- if (functionalReplace) {
2211
- var replacerArgs = concat$1([matched], captures, position, S);
2212
- if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
2213
- replacement = toString(apply(replaceValue, undefined, replacerArgs));
2214
- } else {
2215
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2216
- }
2217
- if (position >= nextSourcePosition) {
2218
- accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
2219
- nextSourcePosition = position + matched.length;
2220
- }
2221
- }
2222
-
2223
- return accumulatedResult + stringSlice(S, nextSourcePosition);
2224
- }
2225
- ];
2226
- }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
2227
-
2228
- var aCallable = aCallable$3;
2229
- var toObject$1 = toObject$5;
2230
- var IndexedObject$1 = indexedObject;
2231
- var lengthOfArrayLike = lengthOfArrayLike$2;
2232
-
2233
- var $TypeError = TypeError;
2234
-
2235
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
2236
- var createMethod = function (IS_RIGHT) {
2237
- return function (that, callbackfn, argumentsLength, memo) {
2238
- var O = toObject$1(that);
2239
- var self = IndexedObject$1(O);
2240
- var length = lengthOfArrayLike(O);
2241
- aCallable(callbackfn);
2242
- var index = IS_RIGHT ? length - 1 : 0;
2243
- var i = IS_RIGHT ? -1 : 1;
2244
- if (argumentsLength < 2) while (true) {
2245
- if (index in self) {
2246
- memo = self[index];
2247
- index += i;
2248
- break;
2249
- }
2250
- index += i;
2251
- if (IS_RIGHT ? index < 0 : length <= index) {
2252
- throw new $TypeError('Reduce of empty array with no initial value');
2253
- }
2254
- }
2255
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
2256
- memo = callbackfn(memo, self[index], index, O);
2257
- }
2258
- return memo;
2259
- };
2260
- };
2261
-
2262
- var arrayReduce = {
2263
- // `Array.prototype.reduce` method
2264
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
2265
- left: createMethod(false),
2266
- // `Array.prototype.reduceRight` method
2267
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
2268
- right: createMethod(true)
2269
- };
2270
-
2271
- var fails$1 = fails$i;
2272
-
2273
- var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
2274
- var method = [][METHOD_NAME];
2275
- return !!method && fails$1(function () {
2276
- // eslint-disable-next-line no-useless-call -- required for testing
2277
- method.call(null, argument || function () { return 1; }, 1);
2278
- });
2279
- };
2280
-
2281
- var global$1 = global$g;
2282
- var classof = classofRaw$2;
2283
-
2284
- var engineIsNode = classof(global$1.process) === 'process';
2285
-
2286
- var $$1 = _export;
2287
- var $reduce = arrayReduce.left;
2288
- var arrayMethodIsStrict = arrayMethodIsStrict$1;
2289
- var CHROME_VERSION = engineV8Version;
2290
- var IS_NODE = engineIsNode;
2291
-
2292
- // Chrome 80-82 has a critical bug
2293
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
2294
- var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
2295
- var FORCED = CHROME_BUG || !arrayMethodIsStrict('reduce');
2296
-
2297
- // `Array.prototype.reduce` method
2298
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
2299
- $$1({ target: 'Array', proto: true, forced: FORCED }, {
2300
- reduce: function reduce(callbackfn /* , initialValue */) {
2301
- var length = arguments.length;
2302
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
2303
- }
2304
- });
2305
-
2306
- var DESCRIPTORS = descriptors;
2307
- var uncurryThis = functionUncurryThis;
2308
- var call = functionCall;
2309
- var fails = fails$i;
2310
- var objectKeys = objectKeys$2;
2311
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
2312
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
2313
- var toObject = toObject$5;
2314
- var IndexedObject = indexedObject;
2315
-
2316
- // eslint-disable-next-line es/no-object-assign -- safe
2317
- var $assign = Object.assign;
2318
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
2319
- var defineProperty = Object.defineProperty;
2320
- var concat = uncurryThis([].concat);
2321
-
2322
- // `Object.assign` method
2323
- // https://tc39.es/ecma262/#sec-object.assign
2324
- var objectAssign = !$assign || fails(function () {
2325
- // should have correct order of operations (Edge bug)
2326
- if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
2327
- enumerable: true,
2328
- get: function () {
2329
- defineProperty(this, 'b', {
2330
- value: 3,
2331
- enumerable: false
2332
- });
2333
- }
2334
- }), { b: 2 })).b !== 1) return true;
2335
- // should work with symbols and should have deterministic property order (V8 bug)
2336
- var A = {};
2337
- var B = {};
2338
- // eslint-disable-next-line es/no-symbol -- safe
2339
- var symbol = Symbol('assign detection');
2340
- var alphabet = 'abcdefghijklmnopqrst';
2341
- A[symbol] = 7;
2342
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
2343
- return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
2344
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
2345
- var T = toObject(target);
2346
- var argumentsLength = arguments.length;
2347
- var index = 1;
2348
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2349
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
2350
- while (argumentsLength > index) {
2351
- var S = IndexedObject(arguments[index++]);
2352
- var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
2353
- var length = keys.length;
2354
- var j = 0;
2355
- var key;
2356
- while (length > j) {
2357
- key = keys[j++];
2358
- if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
2359
- }
2360
- } return T;
2361
- } : $assign;
2362
-
2363
- var $ = _export;
2364
- var assign = objectAssign;
2365
-
2366
- // `Object.assign` method
2367
- // https://tc39.es/ecma262/#sec-object.assign
2368
- // eslint-disable-next-line es/no-object-assign -- required for testing
2369
- $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
2370
- assign: assign
2371
- });
2372
-
2373
- const endClassMap = {
2374
- 1: 'col-end-1',
2375
- 2: 'col-end-2',
2376
- 3: 'col-end-3',
2377
- 4: 'col-end-4',
2378
- 5: 'col-end-5',
2379
- 6: 'col-end-6',
2380
- 7: 'col-end-7',
2381
- 8: 'col-end-8',
2382
- 9: 'col-end-9',
2383
- 10: 'col-end-10',
2384
- 11: 'col-end-11',
2385
- 12: 'col-end-12',
2386
- 13: 'col-end-13'
2387
- };
2388
- const startClassMap = {
2389
- 1: 'col-start-1',
2390
- 2: 'col-start-2',
2391
- 3: 'col-start-3',
2392
- 4: 'col-start-4',
2393
- 5: 'col-start-5',
2394
- 6: 'col-start-6',
2395
- 7: 'col-start-7',
2396
- 8: 'col-start-8',
2397
- 9: 'col-start-9',
2398
- 10: 'col-start-10',
2399
- 11: 'col-start-11',
2400
- 12: 'col-start-12'
2401
- };
2402
- function getPageElementBound(rowsNodes) {
2403
- if (!rowsNodes) {
2404
- return [];
2405
- }
2406
- return rowsNodes.map(row => {
2407
- const rowRect = row.getBoundingClientRect();
2408
- const columns = row.children;
2409
- return {
2410
- x: rowRect.x,
2411
- y: rowRect.y,
2412
- width: rowRect.width,
2413
- height: rowRect.height,
2414
- columns: Array.from(columns).map(column => {
2415
- const columnRect = column.getBoundingClientRect();
2416
- const containers = Array.from(column.querySelectorAll('[data-dot="container"]'));
2417
- const columnX = columnRect.left - rowRect.left;
2418
- const columnY = columnRect.top - rowRect.top;
2419
- return {
2420
- x: columnX,
2421
- y: columnY,
2422
- width: columnRect.width,
2423
- height: columnRect.height,
2424
- containers: containers.map(container => {
2425
- const containerRect = container.getBoundingClientRect();
2426
- const contentlets = Array.from(container.querySelectorAll('[data-dot="contentlet"]'));
2427
- return {
2428
- x: 0,
2429
- y: containerRect.y - rowRect.top,
2430
- width: containerRect.width,
2431
- height: containerRect.height,
2432
- payload: container.dataset.content,
2433
- contentlets: contentlets.map(contentlet => {
2434
- const contentletRect = contentlet.getBoundingClientRect();
2435
- return {
2436
- x: 0,
2437
- y: contentletRect.y - containerRect.y,
2438
- width: contentletRect.width,
2439
- height: contentletRect.height,
2440
- payload: contentlet.dataset.content
2441
- };
2442
- })
2443
- };
2444
- })
2445
- };
2446
- })
2447
- };
2448
- });
2449
- }
2450
- const getPageContainers = containers => {
2451
- return Object.keys(containers).reduce((acc, container) => {
2452
- const contentlets = containers[container].contentlets;
2453
- const contentletsKeys = Object.keys(contentlets);
2454
- contentletsKeys.forEach(key => {
2455
- var _containers$container;
2456
- acc.push({
2457
- identifier: (_containers$container = containers[container].container.path) != null ? _containers$container : containers[container].container.identifier,
2458
- uuid: key.replace('uuid-', ''),
2459
- contentletsId: contentlets[key].map(contentlet => contentlet.identifier)
2460
- });
2461
- });
2462
- return acc;
2463
- }, []);
2464
- };
2465
- const getContainersData = (containers, containerRef) => {
2466
- const {
2467
- identifier,
2468
- uuid
2469
- } = containerRef;
2470
- const {
2471
- containerStructures
2472
- } = containers[identifier];
2473
- // Get accepts types of content types for this container
2474
- const acceptTypes = containerStructures.map(structure => structure.contentTypeVar).join(',');
2475
- // Get the contentlets for "this" container
2476
- const contentlets = containers[identifier].contentlets[`uuid-${uuid}`];
2477
- const pageContainers = getPageContainers(containers);
2478
- return Object.assign({}, containers[identifier].container, {
2479
- acceptTypes,
2480
- contentlets,
2481
- pageContainers
2482
- });
2483
- };
2484
- const combineClasses = classes => classes.filter(Boolean).join(' ');
2485
- const getPositionStyleClasses = (start, end) => {
2486
- const startClass = startClassMap[start];
2487
- const endClass = endClassMap[end];
2488
- return {
2489
- startClass,
2490
- endClass
2491
- };
2492
- };
2493
-
2494
- /**
2495
- * `usePageEditor` is a custom React hook that sets up the page editor for a DotCMS page.
2496
- * It takes a `PageEditorOptions` object as a parameter and returns a reference to the rows of the page.
2497
- *
2498
- * This hook is the main brigde between your webapp and the dotcms page editor.
2499
- *
2500
- *
2501
- * @category Hooks
2502
- * @param {PageEditorOptions} props - The options for the page editor. Includes a `reloadFunction` and a `pathname`.
2503
- * @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.
2504
- * @throws {Error} - Throws an error if the `pathname` is not provided.
2505
- */
2506
- const usePageEditor = props => {
2507
- const {
2508
- reloadFunction = window.location.reload,
2509
- pathname = null
2510
- } = props;
2511
- if (!pathname) {
2512
- throw new Error('Dotcms page editor required the pathname of your webapp');
2513
- }
2514
- const {
2515
- rowsRef,
2516
- isInsideEditor
2517
- } = useEventMessageHandler({
2518
- reload: reloadFunction
2519
- });
2520
- usePostUrlToEditor(pathname, isInsideEditor);
2521
- useScrollEvent(isInsideEditor);
2522
- return {
2523
- rowsRef,
2524
- isInsideEditor
2525
- };
2526
- };
2527
- function useEventMessageHandler({
2528
- reload = window.location.reload
2529
- }) {
2530
- const rows = useRef([]);
2531
- const observer = useRef(null);
2532
- const [isInsideEditor, setIsInsideEditor] = useState(false);
2533
- useEffect(() => {
2534
- var _observer$current;
2535
- observer.current = new MutationObserver(mutationsList => {
2536
- for (const {
2537
- addedNodes,
2538
- removedNodes,
2539
- type
2540
- } of mutationsList) {
2541
- if (type === 'childList') {
2542
- const didNodesChanged = [...Array.from(addedNodes), ...Array.from(removedNodes)].filter(node => {
2543
- var _node$dataset;
2544
- return ((_node$dataset = node.dataset) == null ? void 0 : _node$dataset.dot) === 'contentlet';
2545
- }).length;
2546
- if (didNodesChanged) {
2547
- postMessageToEditor({
2548
- action: CUSTOMER_ACTIONS.CONTENT_CHANGE
2549
- });
2550
- }
2551
- }
2552
- }
2553
- });
2554
- (_observer$current = observer.current) == null || _observer$current.observe(document, {
2555
- childList: true,
2556
- subtree: true
2557
- });
2558
- return () => {
2559
- if (observer.current) observer.current.disconnect();
2560
- };
2561
- }, []);
2562
- useEffect(() => {
2563
- // If the page is not inside an iframe we do nothing.
2564
- if (window.parent === window) return;
2565
- postMessageToEditor({
2566
- action: CUSTOMER_ACTIONS.PING_EDITOR // This is to let the editor know that the page is ready
2567
- });
2568
- }, []);
2569
- useEffect(() => {
2570
- function eventMessageHandler(event) {
2571
- if (!isInsideEditor) {
2572
- // Editor is telling us that we can set ourselves into edit mode
2573
- if (event.data === 'ema-editor-pong') {
2574
- setIsInsideEditor(true);
2575
- }
2576
- return;
2577
- }
2578
- switch (event.data) {
2579
- case 'ema-request-bounds':
2580
- {
2581
- const positionData = getPageElementBound(rows.current);
2582
- postMessageToEditor({
2583
- action: CUSTOMER_ACTIONS.SET_BOUNDS,
2584
- payload: positionData
2585
- });
2586
- break;
2587
- }
2588
- case 'ema-reload-page':
2589
- {
2590
- reload();
2591
- break;
2592
- }
2593
- }
2594
- }
2595
- window.addEventListener('message', eventMessageHandler);
2596
- return () => {
2597
- window.removeEventListener('message', eventMessageHandler);
2598
- };
2599
- }, [rows, reload, isInsideEditor]);
2600
- return {
2601
- rowsRef: rows,
2602
- isInsideEditor
2603
- };
2604
- }
2605
- function useScrollEvent(isInsideEditor) {
2606
- useEffect(() => {
2607
- if (!isInsideEditor) return;
2608
- function eventScrollHandler() {
2609
- postMessageToEditor({
2610
- action: CUSTOMER_ACTIONS.IFRAME_SCROLL
2611
- });
2612
- }
2613
- window.addEventListener('scroll', eventScrollHandler);
2614
- return () => {
2615
- window.removeEventListener('scroll', eventScrollHandler);
2616
- };
2617
- }, [isInsideEditor]);
2618
- }
2619
- function usePostUrlToEditor(pathname, isInsideEditor) {
2620
- useEffect(() => {
2621
- if (!isInsideEditor) return;
2622
- postMessageToEditor({
2623
- action: CUSTOMER_ACTIONS.SET_URL,
2624
- payload: {
2625
- url: pathname === '/' ? 'index' : pathname == null ? void 0 : pathname.replace('/', '')
2626
- }
2627
- });
2628
- }, [pathname, isInsideEditor]);
2629
- }
2630
-
2631
- const PageContext = /*#__PURE__*/createContext(null);
2632
-
2633
- /**
2634
- * `PageProvider` is a functional component that provides a context for a DotCMS page.
2635
- * It takes a `PageProviderProps` object as a parameter and returns a JSX element.
2636
- *
2637
- * @category Components
2638
- * @param {PageProviderProps} props - The properties for the PageProvider. Includes an `entity` and `children`.
2639
- * @returns {JSX.Element} - A JSX element that provides a context for a DotCMS page.
2640
- */
2641
- function PageProvider(props) {
2642
- const {
2643
- entity,
2644
- children
2645
- } = props;
2646
- return jsx(PageContext.Provider, {
2647
- value: entity,
2648
- children: children
2649
- });
2650
- }
2651
-
2652
- function styleInject(css, ref) {
2653
- if ( ref === void 0 ) ref = {};
2654
- var insertAt = ref.insertAt;
2655
-
2656
- if (!css || typeof document === 'undefined') { return; }
2657
-
2658
- var head = document.head || document.getElementsByTagName('head')[0];
2659
- var style = document.createElement('style');
2660
- style.type = 'text/css';
2661
-
2662
- if (insertAt === 'top') {
2663
- if (head.firstChild) {
2664
- head.insertBefore(style, head.firstChild);
2665
- } else {
2666
- head.appendChild(style);
2667
- }
2668
- } else {
2669
- head.appendChild(style);
2670
- }
2671
-
2672
- if (style.styleSheet) {
2673
- style.styleSheet.cssText = css;
2674
- } else {
2675
- style.appendChild(document.createTextNode(css));
2676
- }
2677
- }
2678
-
2679
- var css_248z$1 = ".row-module_row__8V7Eh {\n display: grid;\n grid-template-columns: repeat(12, 1fr);\n gap: 1rem;\n}\n";
2680
- var styles$1 = {"row":"row-module_row__8V7Eh"};
2681
- styleInject(css_248z$1);
2682
-
2683
- 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";
2684
- 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"};
2685
- styleInject(css_248z);
2686
-
2687
- const FAKE_CONTENLET = {
2688
- identifier: 'TEMP_EMPTY_CONTENTLET',
2689
- title: 'TEMP_EMPTY_CONTENTLET',
2690
- contentType: 'TEMP_EMPTY_CONTENTLET_TYPE',
2691
- inode: 'TEMPY_EMPTY_CONTENTLET_INODE',
2692
- widgetTitle: 'TEMP_EMPTY_CONTENTLET'
2693
- };
2694
- function EmptyContainer() {
2695
- return jsx("div", {
2696
- "data-testid": "empty-container",
2697
- style: {
2698
- width: '100%',
2699
- backgroundColor: '#ECF0FD',
2700
- display: 'flex',
2701
- justifyContent: 'center',
2702
- alignItems: 'center',
2703
- color: '#030E32',
2704
- height: '10rem'
2705
- },
2706
- children: "This container is empty."
2707
- });
2708
- }
2709
- function NoContent({
2710
- contentType
2711
- }) {
2712
- return jsxs("div", {
2713
- "data-testid": "no-component",
2714
- children: ["No Component for ", contentType]
2715
- });
2716
- }
2717
- function Container({
2718
- containerRef
2719
- }) {
2720
- var _viewAs$persona;
2721
- const {
2722
- identifier,
2723
- uuid
2724
- } = containerRef;
2725
- // Get the containers from the global context
2726
- const {
2727
- containers,
2728
- page,
2729
- viewAs,
2730
- components,
2731
- isInsideEditor
2732
- } = useContext(PageContext);
2733
- const {
2734
- acceptTypes,
2735
- contentlets,
2736
- maxContentlets,
2737
- pageContainers,
2738
- path
2739
- } = getContainersData(containers, containerRef);
2740
- const updatedContentlets = contentlets.length === 0 && isInsideEditor ? [FAKE_CONTENLET] : contentlets;
2741
- const contentletsId = updatedContentlets.map(contentlet => contentlet.identifier);
2742
- const container = {
2743
- acceptTypes,
2744
- contentletsId,
2745
- identifier: path != null ? path : identifier,
2746
- maxContentlets,
2747
- uuid
2748
- };
2749
- const containerPayload = {
2750
- container,
2751
- language_id: viewAs.language.id,
2752
- pageContainers,
2753
- pageId: page.identifier,
2754
- personaTag: (_viewAs$persona = viewAs.persona) == null ? void 0 : _viewAs$persona.keyTag
2755
- };
2756
- function onPointerEnterHandler(e) {
2757
- var _target$dataset$conte;
2758
- let target = e.target;
2759
- if (target.dataset.dot !== 'contentlet') {
2760
- target = target.closest('[data-dot="contentlet"]');
2761
- }
2762
- if (!target) {
2763
- return;
2764
- }
2765
- const {
2766
- x,
2767
- y,
2768
- width,
2769
- height
2770
- } = target.getBoundingClientRect();
2771
- const contentletPayload = JSON.parse((_target$dataset$conte = target.dataset.content) != null ? _target$dataset$conte : '{}');
2772
- postMessageToEditor({
2773
- action: CUSTOMER_ACTIONS.SET_CONTENTLET,
2774
- payload: {
2775
- x,
2776
- y,
2777
- width,
2778
- height,
2779
- payload: contentletPayload
2780
- }
2781
- });
2782
- }
2783
- const renderContentlets = updatedContentlets.map(contentlet => {
2784
- var _viewAs$persona2;
2785
- const ContentTypeComponent = components[contentlet.contentType] || NoContent;
2786
- const Component = contentlet.identifier === 'TEMP_EMPTY_CONTENTLET' ? EmptyContainer : ContentTypeComponent;
2787
- const contentletPayload = {
2788
- container,
2789
- contentlet: {
2790
- identifier: contentlet.identifier,
2791
- title: contentlet.widgetTitle || contentlet.title,
2792
- inode: contentlet.inode
2793
- },
2794
- language_id: viewAs.language.id,
2795
- pageContainers,
2796
- pageId: page.identifier,
2797
- personaTag: (_viewAs$persona2 = viewAs.persona) == null ? void 0 : _viewAs$persona2.keyTag
2798
- };
2799
- return isInsideEditor ? jsx("div", {
2800
- onPointerEnter: onPointerEnterHandler,
2801
- "data-dot": "contentlet",
2802
- "data-content": JSON.stringify(contentletPayload),
2803
- children: jsx(Component, Object.assign({}, contentlet))
2804
- }, contentlet.identifier) : ( /*#__PURE__*/createElement$1(Component, Object.assign({}, contentlet, {
2805
- key: contentlet.identifier
2806
- })));
2807
- });
2808
- return isInsideEditor ? jsx("div", {
2809
- "data-dot": "container",
2810
- "data-content": JSON.stringify(containerPayload),
2811
- children: renderContentlets
2812
- }) :
2813
- // eslint-disable-next-line react/jsx-no-useless-fragment
2814
- jsx(Fragment, {
2815
- children: renderContentlets
2816
- });
2817
- }
2818
-
2819
- function Column({
2820
- column
2821
- }) {
2822
- const {
2823
- isInsideEditor
2824
- } = useContext(PageContext);
2825
- const {
2826
- startClass,
2827
- endClass
2828
- } = getPositionStyleClasses(column.leftOffset, column.width + column.leftOffset);
2829
- const combinedClasses = combineClasses([styles[endClass], styles[startClass], column.styleClass]);
2830
- const columnProps = isInsideEditor ? {
2831
- 'data-dot': 'column',
2832
- 'data-testid': 'column'
2833
- } : {};
2834
- return jsx("div", Object.assign({}, columnProps, {
2835
- className: combinedClasses,
2836
- children: column.containers.map(container => jsx(Container, {
2837
- containerRef: container
2838
- }, `${container.identifier}-${container.uuid}`))
2839
- }));
2840
- }
2841
-
2842
- /**
2843
- * Renders a row
2844
- *
2845
- * @category Components
2846
- * @param {React.ForwardedRef<HTMLDivElement, RowProps>} ref
2847
- * @return {*}
2848
- */
2849
- const Row = /*#__PURE__*/forwardRef((props, ref) => {
2850
- const {
2851
- isInsideEditor
2852
- } = useContext(PageContext);
2853
- const {
2854
- row
2855
- } = props;
2856
- const combinedClasses = combineClasses([styles$1.row, row.styleClass]);
2857
- const rowProps = isInsideEditor ? {
2858
- 'data-dot': 'row',
2859
- 'data-testid': 'row',
2860
- ref
2861
- } : {};
2862
- return jsx("div", Object.assign({}, rowProps, {
2863
- className: combinedClasses,
2864
- children: row.columns.map((column, index) => jsx(Column, {
2865
- column: column
2866
- }, index))
2867
- }));
2868
- });
2869
-
2870
- /**
2871
- * `DotcmsLayout` is a functional component that renders a layout for a DotCMS page.
2872
- * It takes a `DotcmsPageProps` object as a parameter and returns a JSX element.
2873
- *
2874
- * @category Components
2875
- * @param {DotcmsPageProps} props - The properties for the DotCMS page.
2876
- * @returns {JSX.Element} - A JSX element that represents the layout for a DotCMS page.
2877
- */
2878
- function DotcmsLayout(props) {
2879
- const {
2880
- entity
2881
- } = props;
2882
- const {
2883
- rowsRef,
2884
- isInsideEditor
2885
- } = usePageEditor({});
2886
- const addRowRef = el => {
2887
- if (el && !rowsRef.current.includes(el)) {
2888
- rowsRef.current.push(el);
2889
- }
2890
- };
2891
- entity.isInsideEditor = isInsideEditor;
2892
- return jsx(PageProvider, {
2893
- entity: entity,
2894
- children: entity.layout.body.rows.map((row, index) => jsx(Row, {
2895
- ref: addRowRef,
2896
- row: row
2897
- }, index))
2898
- });
2899
- }
2900
-
2901
- /**
2902
- * `useDotcmsPageContext` is a custom React hook that provides access to the `PageProviderContext`.
2903
- * It takes no parameters and returns the context value or `null` if it's not available.
2904
- *
2905
- * @category Hooks
2906
- * @returns {PageProviderContext | null} - The context value or `null` if it's not available.
2907
- */
2908
- function useDotcmsPageContext() {
2909
- return useContext(PageContext);
2910
- }
2911
-
2912
- export { DotcmsLayout, PageProvider, Row, useDotcmsPageContext, usePageEditor };