@ninetailed/experience.js-plugin-preview 3.0.0-beta.14 → 3.0.0-beta.19

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.
package/index.umd.js DELETED
@@ -1,1289 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash/union')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'lodash/union'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PreviewPlugin = {}, global.union));
5
- })(this, (function (exports, union) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var union__default = /*#__PURE__*/_interopDefaultLegacy(union);
10
-
11
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
12
-
13
- var check = function (it) {
14
- return it && it.Math == Math && it;
15
- };
16
-
17
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
18
- var global$l =
19
- // eslint-disable-next-line es/no-global-this -- safe
20
- check(typeof globalThis == 'object' && globalThis) ||
21
- check(typeof window == 'object' && window) ||
22
- // eslint-disable-next-line no-restricted-globals -- safe
23
- check(typeof self == 'object' && self) ||
24
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
25
- // eslint-disable-next-line no-new-func -- fallback
26
- (function () { return this; })() || Function('return this')();
27
-
28
- var objectGetOwnPropertyDescriptor = {};
29
-
30
- var fails$8 = function (exec) {
31
- try {
32
- return !!exec();
33
- } catch (error) {
34
- return true;
35
- }
36
- };
37
-
38
- var fails$7 = fails$8;
39
-
40
- // Detect IE8's incomplete defineProperty implementation
41
- var descriptors = !fails$7(function () {
42
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
43
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
44
- });
45
-
46
- var fails$6 = fails$8;
47
-
48
- var functionBindNative = !fails$6(function () {
49
- var test = (function () { /* empty */ }).bind();
50
- // eslint-disable-next-line no-prototype-builtins -- safe
51
- return typeof test != 'function' || test.hasOwnProperty('prototype');
52
- });
53
-
54
- var NATIVE_BIND$1 = functionBindNative;
55
-
56
- var call$5 = Function.prototype.call;
57
-
58
- var functionCall = NATIVE_BIND$1 ? call$5.bind(call$5) : function () {
59
- return call$5.apply(call$5, arguments);
60
- };
61
-
62
- var objectPropertyIsEnumerable = {};
63
-
64
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
65
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
66
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
67
-
68
- // Nashorn ~ JDK8 bug
69
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
70
-
71
- // `Object.prototype.propertyIsEnumerable` method implementation
72
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
73
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
74
- var descriptor = getOwnPropertyDescriptor$1(this, V);
75
- return !!descriptor && descriptor.enumerable;
76
- } : $propertyIsEnumerable;
77
-
78
- var createPropertyDescriptor$2 = function (bitmap, value) {
79
- return {
80
- enumerable: !(bitmap & 1),
81
- configurable: !(bitmap & 2),
82
- writable: !(bitmap & 4),
83
- value: value
84
- };
85
- };
86
-
87
- var NATIVE_BIND = functionBindNative;
88
-
89
- var FunctionPrototype$1 = Function.prototype;
90
- var bind = FunctionPrototype$1.bind;
91
- var call$4 = FunctionPrototype$1.call;
92
- var uncurryThis$a = NATIVE_BIND && bind.bind(call$4, call$4);
93
-
94
- var functionUncurryThis = NATIVE_BIND ? function (fn) {
95
- return fn && uncurryThis$a(fn);
96
- } : function (fn) {
97
- return fn && function () {
98
- return call$4.apply(fn, arguments);
99
- };
100
- };
101
-
102
- var uncurryThis$9 = functionUncurryThis;
103
-
104
- var toString$1 = uncurryThis$9({}.toString);
105
- var stringSlice = uncurryThis$9(''.slice);
106
-
107
- var classofRaw = function (it) {
108
- return stringSlice(toString$1(it), 8, -1);
109
- };
110
-
111
- var global$k = global$l;
112
- var uncurryThis$8 = functionUncurryThis;
113
- var fails$5 = fails$8;
114
- var classof = classofRaw;
115
-
116
- var Object$3 = global$k.Object;
117
- var split = uncurryThis$8(''.split);
118
-
119
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
120
- var indexedObject = fails$5(function () {
121
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
122
- // eslint-disable-next-line no-prototype-builtins -- safe
123
- return !Object$3('z').propertyIsEnumerable(0);
124
- }) ? function (it) {
125
- return classof(it) == 'String' ? split(it, '') : Object$3(it);
126
- } : Object$3;
127
-
128
- var global$j = global$l;
129
-
130
- var TypeError$6 = global$j.TypeError;
131
-
132
- // `RequireObjectCoercible` abstract operation
133
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
134
- var requireObjectCoercible$2 = function (it) {
135
- if (it == undefined) throw TypeError$6("Can't call method on " + it);
136
- return it;
137
- };
138
-
139
- // toObject with fallback for non-array-like ES3 strings
140
- var IndexedObject$1 = indexedObject;
141
- var requireObjectCoercible$1 = requireObjectCoercible$2;
142
-
143
- var toIndexedObject$3 = function (it) {
144
- return IndexedObject$1(requireObjectCoercible$1(it));
145
- };
146
-
147
- // `IsCallable` abstract operation
148
- // https://tc39.es/ecma262/#sec-iscallable
149
- var isCallable$9 = function (argument) {
150
- return typeof argument == 'function';
151
- };
152
-
153
- var isCallable$8 = isCallable$9;
154
-
155
- var isObject$5 = function (it) {
156
- return typeof it == 'object' ? it !== null : isCallable$8(it);
157
- };
158
-
159
- var global$i = global$l;
160
- var isCallable$7 = isCallable$9;
161
-
162
- var aFunction = function (argument) {
163
- return isCallable$7(argument) ? argument : undefined;
164
- };
165
-
166
- var getBuiltIn$3 = function (namespace, method) {
167
- return arguments.length < 2 ? aFunction(global$i[namespace]) : global$i[namespace] && global$i[namespace][method];
168
- };
169
-
170
- var uncurryThis$7 = functionUncurryThis;
171
-
172
- var objectIsPrototypeOf = uncurryThis$7({}.isPrototypeOf);
173
-
174
- var getBuiltIn$2 = getBuiltIn$3;
175
-
176
- var engineUserAgent = getBuiltIn$2('navigator', 'userAgent') || '';
177
-
178
- var global$h = global$l;
179
- var userAgent = engineUserAgent;
180
-
181
- var process = global$h.process;
182
- var Deno = global$h.Deno;
183
- var versions = process && process.versions || Deno && Deno.version;
184
- var v8 = versions && versions.v8;
185
- var match, version;
186
-
187
- if (v8) {
188
- match = v8.split('.');
189
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
190
- // but their correct versions are not interesting for us
191
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
192
- }
193
-
194
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
195
- // so check `userAgent` even if `.v8` exists, but 0
196
- if (!version && userAgent) {
197
- match = userAgent.match(/Edge\/(\d+)/);
198
- if (!match || match[1] >= 74) {
199
- match = userAgent.match(/Chrome\/(\d+)/);
200
- if (match) version = +match[1];
201
- }
202
- }
203
-
204
- var engineV8Version = version;
205
-
206
- /* eslint-disable es/no-symbol -- required for testing */
207
-
208
- var V8_VERSION = engineV8Version;
209
- var fails$4 = fails$8;
210
-
211
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
212
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$4(function () {
213
- var symbol = Symbol();
214
- // Chrome 38 Symbol has incorrect toString conversion
215
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
216
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
217
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
218
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
219
- });
220
-
221
- /* eslint-disable es/no-symbol -- required for testing */
222
-
223
- var NATIVE_SYMBOL$1 = nativeSymbol;
224
-
225
- var useSymbolAsUid = NATIVE_SYMBOL$1
226
- && !Symbol.sham
227
- && typeof Symbol.iterator == 'symbol';
228
-
229
- var global$g = global$l;
230
- var getBuiltIn$1 = getBuiltIn$3;
231
- var isCallable$6 = isCallable$9;
232
- var isPrototypeOf = objectIsPrototypeOf;
233
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
234
-
235
- var Object$2 = global$g.Object;
236
-
237
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
238
- return typeof it == 'symbol';
239
- } : function (it) {
240
- var $Symbol = getBuiltIn$1('Symbol');
241
- return isCallable$6($Symbol) && isPrototypeOf($Symbol.prototype, Object$2(it));
242
- };
243
-
244
- var global$f = global$l;
245
-
246
- var String$2 = global$f.String;
247
-
248
- var tryToString$1 = function (argument) {
249
- try {
250
- return String$2(argument);
251
- } catch (error) {
252
- return 'Object';
253
- }
254
- };
255
-
256
- var global$e = global$l;
257
- var isCallable$5 = isCallable$9;
258
- var tryToString = tryToString$1;
259
-
260
- var TypeError$5 = global$e.TypeError;
261
-
262
- // `Assert: IsCallable(argument) is true`
263
- var aCallable$1 = function (argument) {
264
- if (isCallable$5(argument)) return argument;
265
- throw TypeError$5(tryToString(argument) + ' is not a function');
266
- };
267
-
268
- var aCallable = aCallable$1;
269
-
270
- // `GetMethod` abstract operation
271
- // https://tc39.es/ecma262/#sec-getmethod
272
- var getMethod$1 = function (V, P) {
273
- var func = V[P];
274
- return func == null ? undefined : aCallable(func);
275
- };
276
-
277
- var global$d = global$l;
278
- var call$3 = functionCall;
279
- var isCallable$4 = isCallable$9;
280
- var isObject$4 = isObject$5;
281
-
282
- var TypeError$4 = global$d.TypeError;
283
-
284
- // `OrdinaryToPrimitive` abstract operation
285
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
286
- var ordinaryToPrimitive$1 = function (input, pref) {
287
- var fn, val;
288
- if (pref === 'string' && isCallable$4(fn = input.toString) && !isObject$4(val = call$3(fn, input))) return val;
289
- if (isCallable$4(fn = input.valueOf) && !isObject$4(val = call$3(fn, input))) return val;
290
- if (pref !== 'string' && isCallable$4(fn = input.toString) && !isObject$4(val = call$3(fn, input))) return val;
291
- throw TypeError$4("Can't convert object to primitive value");
292
- };
293
-
294
- var shared$3 = {exports: {}};
295
-
296
- var global$c = global$l;
297
-
298
- // eslint-disable-next-line es/no-object-defineproperty -- safe
299
- var defineProperty$1 = Object.defineProperty;
300
-
301
- var setGlobal$3 = function (key, value) {
302
- try {
303
- defineProperty$1(global$c, key, { value: value, configurable: true, writable: true });
304
- } catch (error) {
305
- global$c[key] = value;
306
- } return value;
307
- };
308
-
309
- var global$b = global$l;
310
- var setGlobal$2 = setGlobal$3;
311
-
312
- var SHARED = '__core-js_shared__';
313
- var store$3 = global$b[SHARED] || setGlobal$2(SHARED, {});
314
-
315
- var sharedStore = store$3;
316
-
317
- var store$2 = sharedStore;
318
-
319
- (shared$3.exports = function (key, value) {
320
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
321
- })('versions', []).push({
322
- version: '3.21.1',
323
- mode: 'global',
324
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
325
- license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
326
- source: 'https://github.com/zloirock/core-js'
327
- });
328
-
329
- var global$a = global$l;
330
- var requireObjectCoercible = requireObjectCoercible$2;
331
-
332
- var Object$1 = global$a.Object;
333
-
334
- // `ToObject` abstract operation
335
- // https://tc39.es/ecma262/#sec-toobject
336
- var toObject$2 = function (argument) {
337
- return Object$1(requireObjectCoercible(argument));
338
- };
339
-
340
- var uncurryThis$6 = functionUncurryThis;
341
- var toObject$1 = toObject$2;
342
-
343
- var hasOwnProperty = uncurryThis$6({}.hasOwnProperty);
344
-
345
- // `HasOwnProperty` abstract operation
346
- // https://tc39.es/ecma262/#sec-hasownproperty
347
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
348
- return hasOwnProperty(toObject$1(it), key);
349
- };
350
-
351
- var uncurryThis$5 = functionUncurryThis;
352
-
353
- var id = 0;
354
- var postfix = Math.random();
355
- var toString = uncurryThis$5(1.0.toString);
356
-
357
- var uid$2 = function (key) {
358
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
359
- };
360
-
361
- var global$9 = global$l;
362
- var shared$2 = shared$3.exports;
363
- var hasOwn$6 = hasOwnProperty_1;
364
- var uid$1 = uid$2;
365
- var NATIVE_SYMBOL = nativeSymbol;
366
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
367
-
368
- var WellKnownSymbolsStore = shared$2('wks');
369
- var Symbol$1 = global$9.Symbol;
370
- var symbolFor = Symbol$1 && Symbol$1['for'];
371
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
372
-
373
- var wellKnownSymbol$1 = function (name) {
374
- if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
375
- var description = 'Symbol.' + name;
376
- if (NATIVE_SYMBOL && hasOwn$6(Symbol$1, name)) {
377
- WellKnownSymbolsStore[name] = Symbol$1[name];
378
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
379
- WellKnownSymbolsStore[name] = symbolFor(description);
380
- } else {
381
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
382
- }
383
- } return WellKnownSymbolsStore[name];
384
- };
385
-
386
- var global$8 = global$l;
387
- var call$2 = functionCall;
388
- var isObject$3 = isObject$5;
389
- var isSymbol$1 = isSymbol$2;
390
- var getMethod = getMethod$1;
391
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
392
- var wellKnownSymbol = wellKnownSymbol$1;
393
-
394
- var TypeError$3 = global$8.TypeError;
395
- var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
396
-
397
- // `ToPrimitive` abstract operation
398
- // https://tc39.es/ecma262/#sec-toprimitive
399
- var toPrimitive$1 = function (input, pref) {
400
- if (!isObject$3(input) || isSymbol$1(input)) return input;
401
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
402
- var result;
403
- if (exoticToPrim) {
404
- if (pref === undefined) pref = 'default';
405
- result = call$2(exoticToPrim, input, pref);
406
- if (!isObject$3(result) || isSymbol$1(result)) return result;
407
- throw TypeError$3("Can't convert object to primitive value");
408
- }
409
- if (pref === undefined) pref = 'number';
410
- return ordinaryToPrimitive(input, pref);
411
- };
412
-
413
- var toPrimitive = toPrimitive$1;
414
- var isSymbol = isSymbol$2;
415
-
416
- // `ToPropertyKey` abstract operation
417
- // https://tc39.es/ecma262/#sec-topropertykey
418
- var toPropertyKey$2 = function (argument) {
419
- var key = toPrimitive(argument, 'string');
420
- return isSymbol(key) ? key : key + '';
421
- };
422
-
423
- var global$7 = global$l;
424
- var isObject$2 = isObject$5;
425
-
426
- var document$1 = global$7.document;
427
- // typeof document.createElement is 'object' in old IE
428
- var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
429
-
430
- var documentCreateElement = function (it) {
431
- return EXISTS$1 ? document$1.createElement(it) : {};
432
- };
433
-
434
- var DESCRIPTORS$6 = descriptors;
435
- var fails$3 = fails$8;
436
- var createElement = documentCreateElement;
437
-
438
- // Thanks to IE8 for its funny defineProperty
439
- var ie8DomDefine = !DESCRIPTORS$6 && !fails$3(function () {
440
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
441
- return Object.defineProperty(createElement('div'), 'a', {
442
- get: function () { return 7; }
443
- }).a != 7;
444
- });
445
-
446
- var DESCRIPTORS$5 = descriptors;
447
- var call$1 = functionCall;
448
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
449
- var createPropertyDescriptor$1 = createPropertyDescriptor$2;
450
- var toIndexedObject$2 = toIndexedObject$3;
451
- var toPropertyKey$1 = toPropertyKey$2;
452
- var hasOwn$5 = hasOwnProperty_1;
453
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
454
-
455
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
456
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
457
-
458
- // `Object.getOwnPropertyDescriptor` method
459
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
460
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
461
- O = toIndexedObject$2(O);
462
- P = toPropertyKey$1(P);
463
- if (IE8_DOM_DEFINE$1) try {
464
- return $getOwnPropertyDescriptor$1(O, P);
465
- } catch (error) { /* empty */ }
466
- if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call$1(propertyIsEnumerableModule$1.f, O, P), O[P]);
467
- };
468
-
469
- var objectDefineProperty = {};
470
-
471
- var DESCRIPTORS$4 = descriptors;
472
- var fails$2 = fails$8;
473
-
474
- // V8 ~ Chrome 36-
475
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
476
- var v8PrototypeDefineBug = DESCRIPTORS$4 && fails$2(function () {
477
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
478
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
479
- value: 42,
480
- writable: false
481
- }).prototype != 42;
482
- });
483
-
484
- var global$6 = global$l;
485
- var isObject$1 = isObject$5;
486
-
487
- var String$1 = global$6.String;
488
- var TypeError$2 = global$6.TypeError;
489
-
490
- // `Assert: Type(argument) is Object`
491
- var anObject$2 = function (argument) {
492
- if (isObject$1(argument)) return argument;
493
- throw TypeError$2(String$1(argument) + ' is not an object');
494
- };
495
-
496
- var global$5 = global$l;
497
- var DESCRIPTORS$3 = descriptors;
498
- var IE8_DOM_DEFINE = ie8DomDefine;
499
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
500
- var anObject$1 = anObject$2;
501
- var toPropertyKey = toPropertyKey$2;
502
-
503
- var TypeError$1 = global$5.TypeError;
504
- // eslint-disable-next-line es/no-object-defineproperty -- safe
505
- var $defineProperty = Object.defineProperty;
506
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
507
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
508
- var ENUMERABLE = 'enumerable';
509
- var CONFIGURABLE$1 = 'configurable';
510
- var WRITABLE = 'writable';
511
-
512
- // `Object.defineProperty` method
513
- // https://tc39.es/ecma262/#sec-object.defineproperty
514
- objectDefineProperty.f = DESCRIPTORS$3 ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
515
- anObject$1(O);
516
- P = toPropertyKey(P);
517
- anObject$1(Attributes);
518
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
519
- var current = $getOwnPropertyDescriptor(O, P);
520
- if (current && current[WRITABLE]) {
521
- O[P] = Attributes.value;
522
- Attributes = {
523
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
524
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
525
- writable: false
526
- };
527
- }
528
- } return $defineProperty(O, P, Attributes);
529
- } : $defineProperty : function defineProperty(O, P, Attributes) {
530
- anObject$1(O);
531
- P = toPropertyKey(P);
532
- anObject$1(Attributes);
533
- if (IE8_DOM_DEFINE) try {
534
- return $defineProperty(O, P, Attributes);
535
- } catch (error) { /* empty */ }
536
- if ('get' in Attributes || 'set' in Attributes) throw TypeError$1('Accessors not supported');
537
- if ('value' in Attributes) O[P] = Attributes.value;
538
- return O;
539
- };
540
-
541
- var DESCRIPTORS$2 = descriptors;
542
- var definePropertyModule$1 = objectDefineProperty;
543
- var createPropertyDescriptor = createPropertyDescriptor$2;
544
-
545
- var createNonEnumerableProperty$3 = DESCRIPTORS$2 ? function (object, key, value) {
546
- return definePropertyModule$1.f(object, key, createPropertyDescriptor(1, value));
547
- } : function (object, key, value) {
548
- object[key] = value;
549
- return object;
550
- };
551
-
552
- var redefine$1 = {exports: {}};
553
-
554
- var uncurryThis$4 = functionUncurryThis;
555
- var isCallable$3 = isCallable$9;
556
- var store$1 = sharedStore;
557
-
558
- var functionToString = uncurryThis$4(Function.toString);
559
-
560
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
561
- if (!isCallable$3(store$1.inspectSource)) {
562
- store$1.inspectSource = function (it) {
563
- return functionToString(it);
564
- };
565
- }
566
-
567
- var inspectSource$2 = store$1.inspectSource;
568
-
569
- var global$4 = global$l;
570
- var isCallable$2 = isCallable$9;
571
- var inspectSource$1 = inspectSource$2;
572
-
573
- var WeakMap$1 = global$4.WeakMap;
574
-
575
- var nativeWeakMap = isCallable$2(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
576
-
577
- var shared$1 = shared$3.exports;
578
- var uid = uid$2;
579
-
580
- var keys = shared$1('keys');
581
-
582
- var sharedKey$1 = function (key) {
583
- return keys[key] || (keys[key] = uid(key));
584
- };
585
-
586
- var hiddenKeys$3 = {};
587
-
588
- var NATIVE_WEAK_MAP = nativeWeakMap;
589
- var global$3 = global$l;
590
- var uncurryThis$3 = functionUncurryThis;
591
- var isObject = isObject$5;
592
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$3;
593
- var hasOwn$4 = hasOwnProperty_1;
594
- var shared = sharedStore;
595
- var sharedKey = sharedKey$1;
596
- var hiddenKeys$2 = hiddenKeys$3;
597
-
598
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
599
- var TypeError = global$3.TypeError;
600
- var WeakMap = global$3.WeakMap;
601
- var set, get, has;
602
-
603
- var enforce = function (it) {
604
- return has(it) ? get(it) : set(it, {});
605
- };
606
-
607
- var getterFor = function (TYPE) {
608
- return function (it) {
609
- var state;
610
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
611
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
612
- } return state;
613
- };
614
- };
615
-
616
- if (NATIVE_WEAK_MAP || shared.state) {
617
- var store = shared.state || (shared.state = new WeakMap());
618
- var wmget = uncurryThis$3(store.get);
619
- var wmhas = uncurryThis$3(store.has);
620
- var wmset = uncurryThis$3(store.set);
621
- set = function (it, metadata) {
622
- if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
623
- metadata.facade = it;
624
- wmset(store, it, metadata);
625
- return metadata;
626
- };
627
- get = function (it) {
628
- return wmget(store, it) || {};
629
- };
630
- has = function (it) {
631
- return wmhas(store, it);
632
- };
633
- } else {
634
- var STATE = sharedKey('state');
635
- hiddenKeys$2[STATE] = true;
636
- set = function (it, metadata) {
637
- if (hasOwn$4(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
638
- metadata.facade = it;
639
- createNonEnumerableProperty$2(it, STATE, metadata);
640
- return metadata;
641
- };
642
- get = function (it) {
643
- return hasOwn$4(it, STATE) ? it[STATE] : {};
644
- };
645
- has = function (it) {
646
- return hasOwn$4(it, STATE);
647
- };
648
- }
649
-
650
- var internalState = {
651
- set: set,
652
- get: get,
653
- has: has,
654
- enforce: enforce,
655
- getterFor: getterFor
656
- };
657
-
658
- var DESCRIPTORS$1 = descriptors;
659
- var hasOwn$3 = hasOwnProperty_1;
660
-
661
- var FunctionPrototype = Function.prototype;
662
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
663
- var getDescriptor = DESCRIPTORS$1 && Object.getOwnPropertyDescriptor;
664
-
665
- var EXISTS = hasOwn$3(FunctionPrototype, 'name');
666
- // additional protection from minified / mangled / dropped function names
667
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
668
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$1 || (DESCRIPTORS$1 && getDescriptor(FunctionPrototype, 'name').configurable));
669
-
670
- var functionName = {
671
- EXISTS: EXISTS,
672
- PROPER: PROPER,
673
- CONFIGURABLE: CONFIGURABLE
674
- };
675
-
676
- var global$2 = global$l;
677
- var isCallable$1 = isCallable$9;
678
- var hasOwn$2 = hasOwnProperty_1;
679
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$3;
680
- var setGlobal$1 = setGlobal$3;
681
- var inspectSource = inspectSource$2;
682
- var InternalStateModule = internalState;
683
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
684
-
685
- var getInternalState = InternalStateModule.get;
686
- var enforceInternalState = InternalStateModule.enforce;
687
- var TEMPLATE = String(String).split('String');
688
-
689
- (redefine$1.exports = function (O, key, value, options) {
690
- var unsafe = options ? !!options.unsafe : false;
691
- var simple = options ? !!options.enumerable : false;
692
- var noTargetGet = options ? !!options.noTargetGet : false;
693
- var name = options && options.name !== undefined ? options.name : key;
694
- var state;
695
- if (isCallable$1(value)) {
696
- if (String(name).slice(0, 7) === 'Symbol(') {
697
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
698
- }
699
- if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
700
- createNonEnumerableProperty$1(value, 'name', name);
701
- }
702
- state = enforceInternalState(value);
703
- if (!state.source) {
704
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
705
- }
706
- }
707
- if (O === global$2) {
708
- if (simple) O[key] = value;
709
- else setGlobal$1(key, value);
710
- return;
711
- } else if (!unsafe) {
712
- delete O[key];
713
- } else if (!noTargetGet && O[key]) {
714
- simple = true;
715
- }
716
- if (simple) O[key] = value;
717
- else createNonEnumerableProperty$1(O, key, value);
718
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
719
- })(Function.prototype, 'toString', function toString() {
720
- return isCallable$1(this) && getInternalState(this).source || inspectSource(this);
721
- });
722
-
723
- var objectGetOwnPropertyNames = {};
724
-
725
- var ceil = Math.ceil;
726
- var floor = Math.floor;
727
-
728
- // `ToIntegerOrInfinity` abstract operation
729
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
730
- var toIntegerOrInfinity$2 = function (argument) {
731
- var number = +argument;
732
- // eslint-disable-next-line no-self-compare -- safe
733
- return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
734
- };
735
-
736
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
737
-
738
- var max = Math.max;
739
- var min$1 = Math.min;
740
-
741
- // Helper for a popular repeating case of the spec:
742
- // Let integer be ? ToInteger(index).
743
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
744
- var toAbsoluteIndex$1 = function (index, length) {
745
- var integer = toIntegerOrInfinity$1(index);
746
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
747
- };
748
-
749
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
750
-
751
- var min = Math.min;
752
-
753
- // `ToLength` abstract operation
754
- // https://tc39.es/ecma262/#sec-tolength
755
- var toLength$1 = function (argument) {
756
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
757
- };
758
-
759
- var toLength = toLength$1;
760
-
761
- // `LengthOfArrayLike` abstract operation
762
- // https://tc39.es/ecma262/#sec-lengthofarraylike
763
- var lengthOfArrayLike$1 = function (obj) {
764
- return toLength(obj.length);
765
- };
766
-
767
- var toIndexedObject$1 = toIndexedObject$3;
768
- var toAbsoluteIndex = toAbsoluteIndex$1;
769
- var lengthOfArrayLike = lengthOfArrayLike$1;
770
-
771
- // `Array.prototype.{ indexOf, includes }` methods implementation
772
- var createMethod = function (IS_INCLUDES) {
773
- return function ($this, el, fromIndex) {
774
- var O = toIndexedObject$1($this);
775
- var length = lengthOfArrayLike(O);
776
- var index = toAbsoluteIndex(fromIndex, length);
777
- var value;
778
- // Array#includes uses SameValueZero equality algorithm
779
- // eslint-disable-next-line no-self-compare -- NaN check
780
- if (IS_INCLUDES && el != el) while (length > index) {
781
- value = O[index++];
782
- // eslint-disable-next-line no-self-compare -- NaN check
783
- if (value != value) return true;
784
- // Array#indexOf ignores holes, Array#includes - not
785
- } else for (;length > index; index++) {
786
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
787
- } return !IS_INCLUDES && -1;
788
- };
789
- };
790
-
791
- var arrayIncludes = {
792
- // `Array.prototype.includes` method
793
- // https://tc39.es/ecma262/#sec-array.prototype.includes
794
- includes: createMethod(true),
795
- // `Array.prototype.indexOf` method
796
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
797
- indexOf: createMethod(false)
798
- };
799
-
800
- var uncurryThis$2 = functionUncurryThis;
801
- var hasOwn$1 = hasOwnProperty_1;
802
- var toIndexedObject = toIndexedObject$3;
803
- var indexOf = arrayIncludes.indexOf;
804
- var hiddenKeys$1 = hiddenKeys$3;
805
-
806
- var push = uncurryThis$2([].push);
807
-
808
- var objectKeysInternal = function (object, names) {
809
- var O = toIndexedObject(object);
810
- var i = 0;
811
- var result = [];
812
- var key;
813
- for (key in O) !hasOwn$1(hiddenKeys$1, key) && hasOwn$1(O, key) && push(result, key);
814
- // Don't enum bug & hidden keys
815
- while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
816
- ~indexOf(result, key) || push(result, key);
817
- }
818
- return result;
819
- };
820
-
821
- // IE8- don't enum bug keys
822
- var enumBugKeys$2 = [
823
- 'constructor',
824
- 'hasOwnProperty',
825
- 'isPrototypeOf',
826
- 'propertyIsEnumerable',
827
- 'toLocaleString',
828
- 'toString',
829
- 'valueOf'
830
- ];
831
-
832
- var internalObjectKeys$1 = objectKeysInternal;
833
- var enumBugKeys$1 = enumBugKeys$2;
834
-
835
- var hiddenKeys = enumBugKeys$1.concat('length', 'prototype');
836
-
837
- // `Object.getOwnPropertyNames` method
838
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
839
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
840
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
841
- return internalObjectKeys$1(O, hiddenKeys);
842
- };
843
-
844
- var objectGetOwnPropertySymbols = {};
845
-
846
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
847
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
848
-
849
- var getBuiltIn = getBuiltIn$3;
850
- var uncurryThis$1 = functionUncurryThis;
851
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
852
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
853
- var anObject = anObject$2;
854
-
855
- var concat$1 = uncurryThis$1([].concat);
856
-
857
- // all object keys, includes non-enumerable and symbols
858
- var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
859
- var keys = getOwnPropertyNamesModule.f(anObject(it));
860
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
861
- return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
862
- };
863
-
864
- var hasOwn = hasOwnProperty_1;
865
- var ownKeys = ownKeys$1;
866
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
867
- var definePropertyModule = objectDefineProperty;
868
-
869
- var copyConstructorProperties$1 = function (target, source, exceptions) {
870
- var keys = ownKeys(source);
871
- var defineProperty = definePropertyModule.f;
872
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
873
- for (var i = 0; i < keys.length; i++) {
874
- var key = keys[i];
875
- if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
876
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
877
- }
878
- }
879
- };
880
-
881
- var fails$1 = fails$8;
882
- var isCallable = isCallable$9;
883
-
884
- var replacement = /#|\.prototype\./;
885
-
886
- var isForced$1 = function (feature, detection) {
887
- var value = data[normalize(feature)];
888
- return value == POLYFILL ? true
889
- : value == NATIVE ? false
890
- : isCallable(detection) ? fails$1(detection)
891
- : !!detection;
892
- };
893
-
894
- var normalize = isForced$1.normalize = function (string) {
895
- return String(string).replace(replacement, '.').toLowerCase();
896
- };
897
-
898
- var data = isForced$1.data = {};
899
- var NATIVE = isForced$1.NATIVE = 'N';
900
- var POLYFILL = isForced$1.POLYFILL = 'P';
901
-
902
- var isForced_1 = isForced$1;
903
-
904
- var global$1 = global$l;
905
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
906
- var createNonEnumerableProperty = createNonEnumerableProperty$3;
907
- var redefine = redefine$1.exports;
908
- var setGlobal = setGlobal$3;
909
- var copyConstructorProperties = copyConstructorProperties$1;
910
- var isForced = isForced_1;
911
-
912
- /*
913
- options.target - name of the target object
914
- options.global - target is the global object
915
- options.stat - export as static methods of target
916
- options.proto - export as prototype methods of target
917
- options.real - real prototype method for the `pure` version
918
- options.forced - export even if the native feature is available
919
- options.bind - bind methods to the target, required for the `pure` version
920
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
921
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
922
- options.sham - add a flag to not completely full polyfills
923
- options.enumerable - export as enumerable property
924
- options.noTargetGet - prevent calling a getter on target
925
- options.name - the .name of the function if it does not match the key
926
- */
927
- var _export = function (options, source) {
928
- var TARGET = options.target;
929
- var GLOBAL = options.global;
930
- var STATIC = options.stat;
931
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
932
- if (GLOBAL) {
933
- target = global$1;
934
- } else if (STATIC) {
935
- target = global$1[TARGET] || setGlobal(TARGET, {});
936
- } else {
937
- target = (global$1[TARGET] || {}).prototype;
938
- }
939
- if (target) for (key in source) {
940
- sourceProperty = source[key];
941
- if (options.noTargetGet) {
942
- descriptor = getOwnPropertyDescriptor(target, key);
943
- targetProperty = descriptor && descriptor.value;
944
- } else targetProperty = target[key];
945
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
946
- // contained in target
947
- if (!FORCED && targetProperty !== undefined) {
948
- if (typeof sourceProperty == typeof targetProperty) continue;
949
- copyConstructorProperties(sourceProperty, targetProperty);
950
- }
951
- // add a flag to not completely full polyfills
952
- if (options.sham || (targetProperty && targetProperty.sham)) {
953
- createNonEnumerableProperty(sourceProperty, 'sham', true);
954
- }
955
- // extend global
956
- redefine(target, key, sourceProperty, options);
957
- }
958
- };
959
-
960
- var internalObjectKeys = objectKeysInternal;
961
- var enumBugKeys = enumBugKeys$2;
962
-
963
- // `Object.keys` method
964
- // https://tc39.es/ecma262/#sec-object.keys
965
- // eslint-disable-next-line es/no-object-keys -- safe
966
- var objectKeys$1 = Object.keys || function keys(O) {
967
- return internalObjectKeys(O, enumBugKeys);
968
- };
969
-
970
- var DESCRIPTORS = descriptors;
971
- var uncurryThis = functionUncurryThis;
972
- var call = functionCall;
973
- var fails = fails$8;
974
- var objectKeys = objectKeys$1;
975
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
976
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
977
- var toObject = toObject$2;
978
- var IndexedObject = indexedObject;
979
-
980
- // eslint-disable-next-line es/no-object-assign -- safe
981
- var $assign = Object.assign;
982
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
983
- var defineProperty = Object.defineProperty;
984
- var concat = uncurryThis([].concat);
985
-
986
- // `Object.assign` method
987
- // https://tc39.es/ecma262/#sec-object.assign
988
- var objectAssign = !$assign || fails(function () {
989
- // should have correct order of operations (Edge bug)
990
- if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
991
- enumerable: true,
992
- get: function () {
993
- defineProperty(this, 'b', {
994
- value: 3,
995
- enumerable: false
996
- });
997
- }
998
- }), { b: 2 })).b !== 1) return true;
999
- // should work with symbols and should have deterministic property order (V8 bug)
1000
- var A = {};
1001
- var B = {};
1002
- // eslint-disable-next-line es/no-symbol -- safe
1003
- var symbol = Symbol();
1004
- var alphabet = 'abcdefghijklmnopqrst';
1005
- A[symbol] = 7;
1006
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1007
- return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
1008
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1009
- var T = toObject(target);
1010
- var argumentsLength = arguments.length;
1011
- var index = 1;
1012
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1013
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1014
- while (argumentsLength > index) {
1015
- var S = IndexedObject(arguments[index++]);
1016
- var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1017
- var length = keys.length;
1018
- var j = 0;
1019
- var key;
1020
- while (length > j) {
1021
- key = keys[j++];
1022
- if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
1023
- }
1024
- } return T;
1025
- } : $assign;
1026
-
1027
- var $ = _export;
1028
- var assign = objectAssign;
1029
-
1030
- // `Object.assign` method
1031
- // https://tc39.es/ecma262/#sec-object.assign
1032
- // eslint-disable-next-line es/no-object-assign -- required for testing
1033
- $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
1034
- assign: assign
1035
- });
1036
-
1037
- /*! *****************************************************************************
1038
- Copyright (c) Microsoft Corporation.
1039
-
1040
- Permission to use, copy, modify, and/or distribute this software for any
1041
- purpose with or without fee is hereby granted.
1042
-
1043
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1044
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1045
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1046
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1047
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1048
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1049
- PERFORMANCE OF THIS SOFTWARE.
1050
- ***************************************************************************** */
1051
-
1052
- var __assign = function() {
1053
- __assign = Object.assign || function __assign(t) {
1054
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1055
- s = arguments[i];
1056
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
1057
- }
1058
- return t;
1059
- };
1060
- return __assign.apply(this, arguments);
1061
- };
1062
-
1063
- var CONTAINER_WIDTH = 432;
1064
- var BUTTON_WIDTH = 48;
1065
- var BUTTON_HEIGHT = 192;
1066
- var BUTTON_BOTTOM_POSITION = 128;
1067
- var TRANSFORM_CLOSED = "translate(".concat(CONTAINER_WIDTH - BUTTON_WIDTH, "px, 0px)");
1068
- var TRANSFORM_CLOSED_HIDE = "translate(".concat(CONTAINER_WIDTH, "px, 0px)");
1069
- var TRANSFORM_OPEN = "translate(0px, 0px)";
1070
-
1071
- var WidgetContainer =
1072
- /** @class */
1073
- function () {
1074
- function WidgetContainer(options) {
1075
- var _a, _b;
1076
-
1077
- this.options = options;
1078
- this.container = document.createElement('div');
1079
- this.container.style.position = 'fixed';
1080
- this.container.style.zIndex = '999999';
1081
- this.container.style.right = '0px';
1082
- this.container.style.bottom = "".concat(BUTTON_BOTTOM_POSITION, "px");
1083
- this.container.style.width = "".concat(CONTAINER_WIDTH, "px");
1084
- this.container.style.height = "".concat(BUTTON_HEIGHT, "px");
1085
-
1086
- if ((_b = (_a = options.ui) === null || _a === void 0 ? void 0 : _a.opener) === null || _b === void 0 ? void 0 : _b.hide) {
1087
- this.container.style.transform = TRANSFORM_CLOSED_HIDE;
1088
- } else {
1089
- this.container.style.transform = TRANSFORM_CLOSED;
1090
- }
1091
-
1092
- this.container.style.transitionTimingFunction = 'cubic-bezier(0.4, 0, 0.2, 1)';
1093
- this.container.style.transitionDuration = '700ms';
1094
- this.container.style.transitionProperty = 'transform';
1095
- document.body.appendChild(this.container);
1096
- }
1097
-
1098
- WidgetContainer.prototype.open = function () {
1099
- this.container.style.transform = TRANSFORM_OPEN;
1100
- this.container.style.height = '100vh';
1101
- this.container.style.bottom = "0px";
1102
- };
1103
-
1104
- WidgetContainer.prototype.close = function () {
1105
- var _this = this;
1106
-
1107
- var _a, _b;
1108
-
1109
- if ((_b = (_a = this.options.ui) === null || _a === void 0 ? void 0 : _a.opener) === null || _b === void 0 ? void 0 : _b.hide) {
1110
- this.container.style.transform = TRANSFORM_CLOSED_HIDE;
1111
- } else {
1112
- this.container.style.transform = TRANSFORM_CLOSED;
1113
- }
1114
-
1115
- setTimeout(function () {
1116
- _this.container.style.height = "".concat(BUTTON_HEIGHT, "px");
1117
- _this.container.style.bottom = "".concat(BUTTON_BOTTOM_POSITION, "px");
1118
- }, 700);
1119
- };
1120
-
1121
- Object.defineProperty(WidgetContainer.prototype, "element", {
1122
- get: function () {
1123
- return this.container;
1124
- },
1125
- enumerable: false,
1126
- configurable: true
1127
- });
1128
- return WidgetContainer;
1129
- }();
1130
-
1131
- var NinetailedPreviewPlugin = function NinetailedPreviewPlugin(_a) {
1132
- var clientId = _a.clientId,
1133
- secret = _a.secret,
1134
- url = _a.url,
1135
- environment = _a.environment,
1136
- ui = _a.ui;
1137
- var isOpen = false;
1138
- var activatedAudiences = [];
1139
- var audiences = [];
1140
- var lastProfile;
1141
- return {
1142
- name: 'ninetailed:preview' + Math.random(),
1143
- config: {},
1144
- initialize: function (_a) {
1145
- var _b;
1146
-
1147
- var instance = _a.instance;
1148
-
1149
- if (typeof window !== 'undefined') {
1150
- var PreviewBridge = require('./PreviewBridge').PreviewBridge;
1151
-
1152
- var container_1 = new WidgetContainer({
1153
- ui: ui
1154
- });
1155
- var preview_1 = PreviewBridge({
1156
- url: url
1157
- });
1158
- preview_1.render(container_1.element);
1159
-
1160
- var open_1 = function open_1() {
1161
- container_1.open();
1162
- isOpen = true;
1163
- instance.dispatch({
1164
- type: 'preview:change'
1165
- });
1166
- };
1167
-
1168
- var close_1 = function close_1() {
1169
- container_1.close();
1170
- setTimeout(function () {
1171
- isOpen = false;
1172
- instance.dispatch({
1173
- type: 'preview:change'
1174
- });
1175
- }, 700);
1176
- };
1177
-
1178
- var toggle_1 = function toggle_1() {
1179
- if (isOpen) {
1180
- close_1();
1181
- } else {
1182
- open_1();
1183
- }
1184
- };
1185
-
1186
- var activateAudience_1 = function activateAudience_1(id) {
1187
- activatedAudiences = union__default["default"](activatedAudiences, [id]);
1188
- instance.dispatch({
1189
- type: 'profile',
1190
- profile: lastProfile
1191
- });
1192
- };
1193
-
1194
- var deactivateAudience_1 = function deactivateAudience_1(id) {
1195
- activatedAudiences = activatedAudiences.filter(function (activatedAudience) {
1196
- return activatedAudience !== id;
1197
- });
1198
- instance.dispatch({
1199
- type: 'profile',
1200
- profile: lastProfile
1201
- });
1202
- };
1203
-
1204
- var buildPreviewPlugin_1 = function buildPreviewPlugin_1() {
1205
- return {
1206
- open: function () {
1207
- return open_1();
1208
- },
1209
- close: function () {
1210
- return close_1();
1211
- },
1212
- toggle: function () {
1213
- return toggle_1();
1214
- },
1215
- isOpen: isOpen,
1216
- activateAudience: function (id) {
1217
- return activateAudience_1(id);
1218
- },
1219
- deactivateAudience: function (id) {
1220
- return deactivateAudience_1(id);
1221
- },
1222
- activatedAudiences: activatedAudiences,
1223
- audiences: audiences
1224
- };
1225
- };
1226
-
1227
- window.ninetailed = Object.assign({}, window.ninetailed, {
1228
- plugins: __assign(__assign({}, (_b = window.ninetailed) === null || _b === void 0 ? void 0 : _b.plugins), {
1229
- preview: buildPreviewPlugin_1()
1230
- })
1231
- });
1232
-
1233
- var buildNinetailed_1 = function buildNinetailed_1() {
1234
- var _a;
1235
-
1236
- return Object.assign({}, window.ninetailed, {
1237
- version: '1.5.1',
1238
- plugins: __assign(__assign({}, (_a = window.ninetailed) === null || _a === void 0 ? void 0 : _a.plugins), {
1239
- preview: buildPreviewPlugin_1()
1240
- }),
1241
- credentials: {
1242
- clientId: clientId,
1243
- secret: secret,
1244
- environment: environment
1245
- }
1246
- });
1247
- };
1248
-
1249
- instance.on('profile', function () {
1250
- preview_1.updateProps({
1251
- props: buildNinetailed_1()
1252
- });
1253
- });
1254
- instance.on('preview:change', function () {
1255
- preview_1.updateProps({
1256
- props: buildNinetailed_1()
1257
- });
1258
- });
1259
- }
1260
- },
1261
- profile: function (_a) {
1262
- var _b;
1263
-
1264
- var payload = _a.payload;
1265
- audiences = ((_b = payload === null || payload === void 0 ? void 0 : payload.profile) === null || _b === void 0 ? void 0 : _b.audiences) || [];
1266
- lastProfile = payload.profile;
1267
- return __assign(__assign({}, payload), {
1268
- profile: __assign(__assign({}, payload.profile), {
1269
- audiences: union__default["default"](audiences, activatedAudiences)
1270
- })
1271
- });
1272
- },
1273
- loaded: function () {
1274
- return true;
1275
- }
1276
- };
1277
- };
1278
-
1279
- if (typeof window === 'object' && !('process' in window)) {
1280
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1281
- window.process = {};
1282
- }
1283
-
1284
- exports.NinetailedPreviewPlugin = NinetailedPreviewPlugin;
1285
- exports["default"] = NinetailedPreviewPlugin;
1286
-
1287
- Object.defineProperty(exports, '__esModule', { value: true });
1288
-
1289
- }));