@archbee/app-widget 1.1.33 → 1.1.34

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.esm.js DELETED
@@ -1,1800 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import React, { forwardRef, useRef, useMemo, useImperativeHandle } from 'react';
3
- import ReactDOM from 'react-dom';
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$b =
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$d = function (exec) {
26
- try {
27
- return !!exec();
28
- } catch (error) {
29
- return true;
30
- }
31
- };
32
-
33
- var fails$c = fails$d;
34
-
35
- // Detect IE8's incomplete defineProperty implementation
36
- var descriptors = !fails$c(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$b = fails$d;
42
-
43
- var functionBindNative = !fails$b(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$1 = functionBindNative;
51
-
52
- var call$6 = Function.prototype.call;
53
-
54
- var functionCall = NATIVE_BIND$1 ? call$6.bind(call$6) : function () {
55
- return call$6.apply(call$6, arguments);
56
- };
57
-
58
- var objectPropertyIsEnumerable = {};
59
-
60
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
61
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
62
- var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
63
-
64
- // Nashorn ~ JDK8 bug
65
- var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$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$2(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 = functionBindNative;
84
-
85
- var FunctionPrototype$1 = Function.prototype;
86
- var call$5 = FunctionPrototype$1.call;
87
- var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype$1.bind.bind(call$5, call$5);
88
-
89
- var functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
90
- return function () {
91
- return call$5.apply(fn, arguments);
92
- };
93
- };
94
-
95
- var uncurryThis$a = functionUncurryThis;
96
-
97
- var toString$3 = uncurryThis$a({}.toString);
98
- var stringSlice$1 = uncurryThis$a(''.slice);
99
-
100
- var classofRaw$1 = function (it) {
101
- return stringSlice$1(toString$3(it), 8, -1);
102
- };
103
-
104
- var uncurryThis$9 = functionUncurryThis;
105
- var fails$a = fails$d;
106
- var classof$4 = classofRaw$1;
107
-
108
- var $Object$4 = Object;
109
- var split = uncurryThis$9(''.split);
110
-
111
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
112
- var indexedObject = fails$a(function () {
113
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
114
- // eslint-disable-next-line no-prototype-builtins -- safe
115
- return !$Object$4('z').propertyIsEnumerable(0);
116
- }) ? function (it) {
117
- return classof$4(it) === 'String' ? split(it, '') : $Object$4(it);
118
- } : $Object$4;
119
-
120
- // we can't use just `it == null` since of `document.all` special case
121
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
122
- var isNullOrUndefined$2 = function (it) {
123
- return it === null || it === undefined;
124
- };
125
-
126
- var isNullOrUndefined$1 = isNullOrUndefined$2;
127
-
128
- var $TypeError$8 = TypeError;
129
-
130
- // `RequireObjectCoercible` abstract operation
131
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
132
- var requireObjectCoercible$3 = function (it) {
133
- if (isNullOrUndefined$1(it)) throw new $TypeError$8("Can't call method on " + it);
134
- return it;
135
- };
136
-
137
- // toObject with fallback for non-array-like ES3 strings
138
- var IndexedObject$1 = indexedObject;
139
- var requireObjectCoercible$2 = requireObjectCoercible$3;
140
-
141
- var toIndexedObject$4 = function (it) {
142
- return IndexedObject$1(requireObjectCoercible$2(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$c = 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$b = isCallable$c;
158
-
159
- var isObject$7 = function (it) {
160
- return typeof it == 'object' ? it !== null : isCallable$b(it);
161
- };
162
-
163
- var global$a = global$b;
164
- var isCallable$a = isCallable$c;
165
-
166
- var aFunction = function (argument) {
167
- return isCallable$a(argument) ? argument : undefined;
168
- };
169
-
170
- var getBuiltIn$3 = function (namespace, method) {
171
- return arguments.length < 2 ? aFunction(global$a[namespace]) : global$a[namespace] && global$a[namespace][method];
172
- };
173
-
174
- var uncurryThis$8 = functionUncurryThis;
175
-
176
- var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
177
-
178
- var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
179
-
180
- var global$9 = global$b;
181
- var userAgent = engineUserAgent;
182
-
183
- var process = global$9.process;
184
- var Deno = global$9.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$9 = fails$d;
211
- var global$8 = global$b;
212
-
213
- var $String$4 = global$8.String;
214
-
215
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
216
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$9(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$4(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$9 = isCallable$c;
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$9($Symbol) && isPrototypeOf($Symbol.prototype, $Object$3(it));
246
- };
247
-
248
- var $String$3 = String;
249
-
250
- var tryToString$1 = function (argument) {
251
- try {
252
- return $String$3(argument);
253
- } catch (error) {
254
- return 'Object';
255
- }
256
- };
257
-
258
- var isCallable$8 = isCallable$c;
259
- var tryToString = tryToString$1;
260
-
261
- var $TypeError$7 = TypeError;
262
-
263
- // `Assert: IsCallable(argument) is true`
264
- var aCallable$1 = function (argument) {
265
- if (isCallable$8(argument)) return argument;
266
- throw new $TypeError$7(tryToString(argument) + ' is not a function');
267
- };
268
-
269
- var aCallable = aCallable$1;
270
- var isNullOrUndefined = isNullOrUndefined$2;
271
-
272
- // `GetMethod` abstract operation
273
- // https://tc39.es/ecma262/#sec-getmethod
274
- var getMethod$1 = function (V, P) {
275
- var func = V[P];
276
- return isNullOrUndefined(func) ? undefined : aCallable(func);
277
- };
278
-
279
- var call$4 = functionCall;
280
- var isCallable$7 = isCallable$c;
281
- var isObject$6 = isObject$7;
282
-
283
- var $TypeError$6 = TypeError;
284
-
285
- // `OrdinaryToPrimitive` abstract operation
286
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
287
- var ordinaryToPrimitive$1 = function (input, pref) {
288
- var fn, val;
289
- if (pref === 'string' && isCallable$7(fn = input.toString) && !isObject$6(val = call$4(fn, input))) return val;
290
- if (isCallable$7(fn = input.valueOf) && !isObject$6(val = call$4(fn, input))) return val;
291
- if (pref !== 'string' && isCallable$7(fn = input.toString) && !isObject$6(val = call$4(fn, input))) return val;
292
- throw new $TypeError$6("Can't convert object to primitive value");
293
- };
294
-
295
- var sharedStore = {exports: {}};
296
-
297
- var global$7 = global$b;
298
-
299
- // eslint-disable-next-line es/no-object-defineproperty -- safe
300
- var defineProperty$4 = Object.defineProperty;
301
-
302
- var defineGlobalProperty$3 = function (key, value) {
303
- try {
304
- defineProperty$4(global$7, key, { value: value, configurable: true, writable: true });
305
- } catch (error) {
306
- global$7[key] = value;
307
- } return value;
308
- };
309
-
310
- var globalThis$1 = global$b;
311
- var defineGlobalProperty$2 = defineGlobalProperty$3;
312
-
313
- var SHARED = '__core-js_shared__';
314
- var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
315
-
316
- (store$3.versions || (store$3.versions = [])).push({
317
- version: '3.36.1',
318
- mode: 'global',
319
- copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
320
- license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
321
- source: 'https://github.com/zloirock/core-js'
322
- });
323
-
324
- var sharedStoreExports = sharedStore.exports;
325
-
326
- var store$2 = sharedStoreExports;
327
-
328
- var shared$3 = function (key, value) {
329
- return store$2[key] || (store$2[key] = value || {});
330
- };
331
-
332
- var requireObjectCoercible$1 = requireObjectCoercible$3;
333
-
334
- var $Object$2 = Object;
335
-
336
- // `ToObject` abstract operation
337
- // https://tc39.es/ecma262/#sec-toobject
338
- var toObject$4 = function (argument) {
339
- return $Object$2(requireObjectCoercible$1(argument));
340
- };
341
-
342
- var uncurryThis$7 = functionUncurryThis;
343
- var toObject$3 = toObject$4;
344
-
345
- var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
346
-
347
- // `HasOwnProperty` abstract operation
348
- // https://tc39.es/ecma262/#sec-hasownproperty
349
- // eslint-disable-next-line es/no-object-hasown -- safe
350
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
351
- return hasOwnProperty(toObject$3(it), key);
352
- };
353
-
354
- var uncurryThis$6 = functionUncurryThis;
355
-
356
- var id = 0;
357
- var postfix = Math.random();
358
- var toString$2 = uncurryThis$6(1.0.toString);
359
-
360
- var uid$2 = function (key) {
361
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
362
- };
363
-
364
- var global$6 = global$b;
365
- var shared$2 = shared$3;
366
- var hasOwn$9 = hasOwnProperty_1;
367
- var uid$1 = uid$2;
368
- var NATIVE_SYMBOL = symbolConstructorDetection;
369
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
370
-
371
- var Symbol$1 = global$6.Symbol;
372
- var WellKnownSymbolsStore = shared$2('wks');
373
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
374
-
375
- var wellKnownSymbol$7 = function (name) {
376
- if (!hasOwn$9(WellKnownSymbolsStore, name)) {
377
- WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$9(Symbol$1, name)
378
- ? Symbol$1[name]
379
- : createWellKnownSymbol('Symbol.' + name);
380
- } return WellKnownSymbolsStore[name];
381
- };
382
-
383
- var call$3 = functionCall;
384
- var isObject$5 = isObject$7;
385
- var isSymbol$1 = isSymbol$2;
386
- var getMethod = getMethod$1;
387
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
388
- var wellKnownSymbol$6 = wellKnownSymbol$7;
389
-
390
- var $TypeError$5 = TypeError;
391
- var TO_PRIMITIVE = wellKnownSymbol$6('toPrimitive');
392
-
393
- // `ToPrimitive` abstract operation
394
- // https://tc39.es/ecma262/#sec-toprimitive
395
- var toPrimitive$1 = function (input, pref) {
396
- if (!isObject$5(input) || isSymbol$1(input)) return input;
397
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
398
- var result;
399
- if (exoticToPrim) {
400
- if (pref === undefined) pref = 'default';
401
- result = call$3(exoticToPrim, input, pref);
402
- if (!isObject$5(result) || isSymbol$1(result)) return result;
403
- throw new $TypeError$5("Can't convert object to primitive value");
404
- }
405
- if (pref === undefined) pref = 'number';
406
- return ordinaryToPrimitive(input, pref);
407
- };
408
-
409
- var toPrimitive = toPrimitive$1;
410
- var isSymbol = isSymbol$2;
411
-
412
- // `ToPropertyKey` abstract operation
413
- // https://tc39.es/ecma262/#sec-topropertykey
414
- var toPropertyKey$2 = function (argument) {
415
- var key = toPrimitive(argument, 'string');
416
- return isSymbol(key) ? key : key + '';
417
- };
418
-
419
- var global$5 = global$b;
420
- var isObject$4 = isObject$7;
421
-
422
- var document$1 = global$5.document;
423
- // typeof document.createElement is 'object' in old IE
424
- var EXISTS$1 = isObject$4(document$1) && isObject$4(document$1.createElement);
425
-
426
- var documentCreateElement$1 = function (it) {
427
- return EXISTS$1 ? document$1.createElement(it) : {};
428
- };
429
-
430
- var DESCRIPTORS$9 = descriptors;
431
- var fails$8 = fails$d;
432
- var createElement = documentCreateElement$1;
433
-
434
- // Thanks to IE8 for its funny defineProperty
435
- var ie8DomDefine = !DESCRIPTORS$9 && !fails$8(function () {
436
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
437
- return Object.defineProperty(createElement('div'), 'a', {
438
- get: function () { return 7; }
439
- }).a !== 7;
440
- });
441
-
442
- var DESCRIPTORS$8 = descriptors;
443
- var call$2 = functionCall;
444
- var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
445
- var createPropertyDescriptor$2 = createPropertyDescriptor$3;
446
- var toIndexedObject$3 = toIndexedObject$4;
447
- var toPropertyKey$1 = toPropertyKey$2;
448
- var hasOwn$8 = hasOwnProperty_1;
449
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
450
-
451
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
452
- var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
453
-
454
- // `Object.getOwnPropertyDescriptor` method
455
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
456
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
457
- O = toIndexedObject$3(O);
458
- P = toPropertyKey$1(P);
459
- if (IE8_DOM_DEFINE$1) try {
460
- return $getOwnPropertyDescriptor$1(O, P);
461
- } catch (error) { /* empty */ }
462
- if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
463
- };
464
-
465
- var objectDefineProperty = {};
466
-
467
- var DESCRIPTORS$7 = descriptors;
468
- var fails$7 = fails$d;
469
-
470
- // V8 ~ Chrome 36-
471
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
472
- var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$7(function () {
473
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
474
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
475
- value: 42,
476
- writable: false
477
- }).prototype !== 42;
478
- });
479
-
480
- var isObject$3 = isObject$7;
481
-
482
- var $String$2 = String;
483
- var $TypeError$4 = TypeError;
484
-
485
- // `Assert: Type(argument) is Object`
486
- var anObject$5 = function (argument) {
487
- if (isObject$3(argument)) return argument;
488
- throw new $TypeError$4($String$2(argument) + ' is not an object');
489
- };
490
-
491
- var DESCRIPTORS$6 = descriptors;
492
- var IE8_DOM_DEFINE = ie8DomDefine;
493
- var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
494
- var anObject$4 = anObject$5;
495
- var toPropertyKey = toPropertyKey$2;
496
-
497
- var $TypeError$3 = TypeError;
498
- // eslint-disable-next-line es/no-object-defineproperty -- safe
499
- var $defineProperty = Object.defineProperty;
500
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
501
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
502
- var ENUMERABLE = 'enumerable';
503
- var CONFIGURABLE$1 = 'configurable';
504
- var WRITABLE = 'writable';
505
-
506
- // `Object.defineProperty` method
507
- // https://tc39.es/ecma262/#sec-object.defineproperty
508
- objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
509
- anObject$4(O);
510
- P = toPropertyKey(P);
511
- anObject$4(Attributes);
512
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
513
- var current = $getOwnPropertyDescriptor(O, P);
514
- if (current && current[WRITABLE]) {
515
- O[P] = Attributes.value;
516
- Attributes = {
517
- configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
518
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
519
- writable: false
520
- };
521
- }
522
- } return $defineProperty(O, P, Attributes);
523
- } : $defineProperty : function defineProperty(O, P, Attributes) {
524
- anObject$4(O);
525
- P = toPropertyKey(P);
526
- anObject$4(Attributes);
527
- if (IE8_DOM_DEFINE) try {
528
- return $defineProperty(O, P, Attributes);
529
- } catch (error) { /* empty */ }
530
- if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$3('Accessors not supported');
531
- if ('value' in Attributes) O[P] = Attributes.value;
532
- return O;
533
- };
534
-
535
- var DESCRIPTORS$5 = descriptors;
536
- var definePropertyModule$4 = objectDefineProperty;
537
- var createPropertyDescriptor$1 = createPropertyDescriptor$3;
538
-
539
- var createNonEnumerableProperty$2 = DESCRIPTORS$5 ? function (object, key, value) {
540
- return definePropertyModule$4.f(object, key, createPropertyDescriptor$1(1, value));
541
- } : function (object, key, value) {
542
- object[key] = value;
543
- return object;
544
- };
545
-
546
- var makeBuiltIn$2 = {exports: {}};
547
-
548
- var DESCRIPTORS$4 = descriptors;
549
- var hasOwn$7 = hasOwnProperty_1;
550
-
551
- var FunctionPrototype = Function.prototype;
552
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
553
- var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
554
-
555
- var EXISTS = hasOwn$7(FunctionPrototype, 'name');
556
- // additional protection from minified / mangled / dropped function names
557
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
558
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
559
-
560
- var functionName = {
561
- EXISTS: EXISTS,
562
- PROPER: PROPER,
563
- CONFIGURABLE: CONFIGURABLE
564
- };
565
-
566
- var uncurryThis$5 = functionUncurryThis;
567
- var isCallable$6 = isCallable$c;
568
- var store$1 = sharedStoreExports;
569
-
570
- var functionToString = uncurryThis$5(Function.toString);
571
-
572
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
573
- if (!isCallable$6(store$1.inspectSource)) {
574
- store$1.inspectSource = function (it) {
575
- return functionToString(it);
576
- };
577
- }
578
-
579
- var inspectSource$1 = store$1.inspectSource;
580
-
581
- var global$4 = global$b;
582
- var isCallable$5 = isCallable$c;
583
-
584
- var WeakMap$1 = global$4.WeakMap;
585
-
586
- var weakMapBasicDetection = isCallable$5(WeakMap$1) && /native code/.test(String(WeakMap$1));
587
-
588
- var shared$1 = shared$3;
589
- var uid = uid$2;
590
-
591
- var keys = shared$1('keys');
592
-
593
- var sharedKey$3 = function (key) {
594
- return keys[key] || (keys[key] = uid(key));
595
- };
596
-
597
- var hiddenKeys$4 = {};
598
-
599
- var NATIVE_WEAK_MAP = weakMapBasicDetection;
600
- var global$3 = global$b;
601
- var isObject$2 = isObject$7;
602
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
603
- var hasOwn$6 = hasOwnProperty_1;
604
- var shared = sharedStoreExports;
605
- var sharedKey$2 = sharedKey$3;
606
- var hiddenKeys$3 = hiddenKeys$4;
607
-
608
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
609
- var TypeError$1 = global$3.TypeError;
610
- var WeakMap = global$3.WeakMap;
611
- var set$1, get, has;
612
-
613
- var enforce = function (it) {
614
- return has(it) ? get(it) : set$1(it, {});
615
- };
616
-
617
- var getterFor = function (TYPE) {
618
- return function (it) {
619
- var state;
620
- if (!isObject$2(it) || (state = get(it)).type !== TYPE) {
621
- throw new TypeError$1('Incompatible receiver, ' + TYPE + ' required');
622
- } return state;
623
- };
624
- };
625
-
626
- if (NATIVE_WEAK_MAP || shared.state) {
627
- var store = shared.state || (shared.state = new WeakMap());
628
- /* eslint-disable no-self-assign -- prototype methods protection */
629
- store.get = store.get;
630
- store.has = store.has;
631
- store.set = store.set;
632
- /* eslint-enable no-self-assign -- prototype methods protection */
633
- set$1 = function (it, metadata) {
634
- if (store.has(it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
635
- metadata.facade = it;
636
- store.set(it, metadata);
637
- return metadata;
638
- };
639
- get = function (it) {
640
- return store.get(it) || {};
641
- };
642
- has = function (it) {
643
- return store.has(it);
644
- };
645
- } else {
646
- var STATE = sharedKey$2('state');
647
- hiddenKeys$3[STATE] = true;
648
- set$1 = function (it, metadata) {
649
- if (hasOwn$6(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
650
- metadata.facade = it;
651
- createNonEnumerableProperty$1(it, STATE, metadata);
652
- return metadata;
653
- };
654
- get = function (it) {
655
- return hasOwn$6(it, STATE) ? it[STATE] : {};
656
- };
657
- has = function (it) {
658
- return hasOwn$6(it, STATE);
659
- };
660
- }
661
-
662
- var internalState = {
663
- set: set$1,
664
- get: get,
665
- has: has,
666
- enforce: enforce,
667
- getterFor: getterFor
668
- };
669
-
670
- var uncurryThis$4 = functionUncurryThis;
671
- var fails$6 = fails$d;
672
- var isCallable$4 = isCallable$c;
673
- var hasOwn$5 = hasOwnProperty_1;
674
- var DESCRIPTORS$3 = descriptors;
675
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
676
- var inspectSource = inspectSource$1;
677
- var InternalStateModule = internalState;
678
-
679
- var enforceInternalState = InternalStateModule.enforce;
680
- var getInternalState = InternalStateModule.get;
681
- var $String$1 = String;
682
- // eslint-disable-next-line es/no-object-defineproperty -- safe
683
- var defineProperty$3 = Object.defineProperty;
684
- var stringSlice = uncurryThis$4(''.slice);
685
- var replace = uncurryThis$4(''.replace);
686
- var join = uncurryThis$4([].join);
687
-
688
- var CONFIGURABLE_LENGTH = DESCRIPTORS$3 && !fails$6(function () {
689
- return defineProperty$3(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
690
- });
691
-
692
- var TEMPLATE = String(String).split('String');
693
-
694
- var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
695
- if (stringSlice($String$1(name), 0, 7) === 'Symbol(') {
696
- name = '[' + replace($String$1(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
697
- }
698
- if (options && options.getter) name = 'get ' + name;
699
- if (options && options.setter) name = 'set ' + name;
700
- if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
701
- if (DESCRIPTORS$3) defineProperty$3(value, 'name', { value: name, configurable: true });
702
- else value.name = name;
703
- }
704
- if (CONFIGURABLE_LENGTH && options && hasOwn$5(options, 'arity') && value.length !== options.arity) {
705
- defineProperty$3(value, 'length', { value: options.arity });
706
- }
707
- try {
708
- if (options && hasOwn$5(options, 'constructor') && options.constructor) {
709
- if (DESCRIPTORS$3) defineProperty$3(value, 'prototype', { writable: false });
710
- // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
711
- } else if (value.prototype) value.prototype = undefined;
712
- } catch (error) { /* empty */ }
713
- var state = enforceInternalState(value);
714
- if (!hasOwn$5(state, 'source')) {
715
- state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
716
- } return value;
717
- };
718
-
719
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
720
- // eslint-disable-next-line no-extend-native -- required
721
- Function.prototype.toString = makeBuiltIn$1(function toString() {
722
- return isCallable$4(this) && getInternalState(this).source || inspectSource(this);
723
- }, 'toString');
724
-
725
- var makeBuiltInExports = makeBuiltIn$2.exports;
726
-
727
- var isCallable$3 = isCallable$c;
728
- var definePropertyModule$3 = objectDefineProperty;
729
- var makeBuiltIn = makeBuiltInExports;
730
- var defineGlobalProperty$1 = defineGlobalProperty$3;
731
-
732
- var defineBuiltIn$1 = function (O, key, value, options) {
733
- if (!options) options = {};
734
- var simple = options.enumerable;
735
- var name = options.name !== undefined ? options.name : key;
736
- if (isCallable$3(value)) makeBuiltIn(value, name, options);
737
- if (options.global) {
738
- if (simple) O[key] = value;
739
- else defineGlobalProperty$1(key, value);
740
- } else {
741
- try {
742
- if (!options.unsafe) delete O[key];
743
- else if (O[key]) simple = true;
744
- } catch (error) { /* empty */ }
745
- if (simple) O[key] = value;
746
- else definePropertyModule$3.f(O, key, {
747
- value: value,
748
- enumerable: false,
749
- configurable: !options.nonConfigurable,
750
- writable: !options.nonWritable
751
- });
752
- } return O;
753
- };
754
-
755
- var objectGetOwnPropertyNames = {};
756
-
757
- var ceil = Math.ceil;
758
- var floor = Math.floor;
759
-
760
- // `Math.trunc` method
761
- // https://tc39.es/ecma262/#sec-math.trunc
762
- // eslint-disable-next-line es/no-math-trunc -- safe
763
- var mathTrunc = Math.trunc || function trunc(x) {
764
- var n = +x;
765
- return (n > 0 ? floor : ceil)(n);
766
- };
767
-
768
- var trunc = mathTrunc;
769
-
770
- // `ToIntegerOrInfinity` abstract operation
771
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
772
- var toIntegerOrInfinity$2 = function (argument) {
773
- var number = +argument;
774
- // eslint-disable-next-line no-self-compare -- NaN check
775
- return number !== number || number === 0 ? 0 : trunc(number);
776
- };
777
-
778
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
779
-
780
- var max = Math.max;
781
- var min$1 = Math.min;
782
-
783
- // Helper for a popular repeating case of the spec:
784
- // Let integer be ? ToInteger(index).
785
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
786
- var toAbsoluteIndex$1 = function (index, length) {
787
- var integer = toIntegerOrInfinity$1(index);
788
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
789
- };
790
-
791
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
792
-
793
- var min = Math.min;
794
-
795
- // `ToLength` abstract operation
796
- // https://tc39.es/ecma262/#sec-tolength
797
- var toLength$1 = function (argument) {
798
- var len = toIntegerOrInfinity(argument);
799
- return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
800
- };
801
-
802
- var toLength = toLength$1;
803
-
804
- // `LengthOfArrayLike` abstract operation
805
- // https://tc39.es/ecma262/#sec-lengthofarraylike
806
- var lengthOfArrayLike$2 = function (obj) {
807
- return toLength(obj.length);
808
- };
809
-
810
- var toIndexedObject$2 = toIndexedObject$4;
811
- var toAbsoluteIndex = toAbsoluteIndex$1;
812
- var lengthOfArrayLike$1 = lengthOfArrayLike$2;
813
-
814
- // `Array.prototype.{ indexOf, includes }` methods implementation
815
- var createMethod = function (IS_INCLUDES) {
816
- return function ($this, el, fromIndex) {
817
- var O = toIndexedObject$2($this);
818
- var length = lengthOfArrayLike$1(O);
819
- if (length === 0) return !IS_INCLUDES && -1;
820
- var index = toAbsoluteIndex(fromIndex, length);
821
- var value;
822
- // Array#includes uses SameValueZero equality algorithm
823
- // eslint-disable-next-line no-self-compare -- NaN check
824
- if (IS_INCLUDES && el !== el) while (length > index) {
825
- value = O[index++];
826
- // eslint-disable-next-line no-self-compare -- NaN check
827
- if (value !== value) return true;
828
- // Array#indexOf ignores holes, Array#includes - not
829
- } else for (;length > index; index++) {
830
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
831
- } return !IS_INCLUDES && -1;
832
- };
833
- };
834
-
835
- var arrayIncludes = {
836
- // `Array.prototype.includes` method
837
- // https://tc39.es/ecma262/#sec-array.prototype.includes
838
- includes: createMethod(true),
839
- // `Array.prototype.indexOf` method
840
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
841
- indexOf: createMethod(false)
842
- };
843
-
844
- var uncurryThis$3 = functionUncurryThis;
845
- var hasOwn$4 = hasOwnProperty_1;
846
- var toIndexedObject$1 = toIndexedObject$4;
847
- var indexOf = arrayIncludes.indexOf;
848
- var hiddenKeys$2 = hiddenKeys$4;
849
-
850
- var push = uncurryThis$3([].push);
851
-
852
- var objectKeysInternal = function (object, names) {
853
- var O = toIndexedObject$1(object);
854
- var i = 0;
855
- var result = [];
856
- var key;
857
- for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
858
- // Don't enum bug & hidden keys
859
- while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
860
- ~indexOf(result, key) || push(result, key);
861
- }
862
- return result;
863
- };
864
-
865
- // IE8- don't enum bug keys
866
- var enumBugKeys$3 = [
867
- 'constructor',
868
- 'hasOwnProperty',
869
- 'isPrototypeOf',
870
- 'propertyIsEnumerable',
871
- 'toLocaleString',
872
- 'toString',
873
- 'valueOf'
874
- ];
875
-
876
- var internalObjectKeys$1 = objectKeysInternal;
877
- var enumBugKeys$2 = enumBugKeys$3;
878
-
879
- var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
880
-
881
- // `Object.getOwnPropertyNames` method
882
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
883
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
884
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
885
- return internalObjectKeys$1(O, hiddenKeys$1);
886
- };
887
-
888
- var objectGetOwnPropertySymbols = {};
889
-
890
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
891
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
892
-
893
- var getBuiltIn$1 = getBuiltIn$3;
894
- var uncurryThis$2 = functionUncurryThis;
895
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
896
- var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
897
- var anObject$3 = anObject$5;
898
-
899
- var concat$1 = uncurryThis$2([].concat);
900
-
901
- // all object keys, includes non-enumerable and symbols
902
- var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
903
- var keys = getOwnPropertyNamesModule.f(anObject$3(it));
904
- var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
905
- return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
906
- };
907
-
908
- var hasOwn$3 = hasOwnProperty_1;
909
- var ownKeys = ownKeys$1;
910
- var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor;
911
- var definePropertyModule$2 = objectDefineProperty;
912
-
913
- var copyConstructorProperties$1 = function (target, source, exceptions) {
914
- var keys = ownKeys(source);
915
- var defineProperty = definePropertyModule$2.f;
916
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$1.f;
917
- for (var i = 0; i < keys.length; i++) {
918
- var key = keys[i];
919
- if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
920
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
921
- }
922
- }
923
- };
924
-
925
- var fails$5 = fails$d;
926
- var isCallable$2 = isCallable$c;
927
-
928
- var replacement = /#|\.prototype\./;
929
-
930
- var isForced$1 = function (feature, detection) {
931
- var value = data[normalize(feature)];
932
- return value === POLYFILL ? true
933
- : value === NATIVE ? false
934
- : isCallable$2(detection) ? fails$5(detection)
935
- : !!detection;
936
- };
937
-
938
- var normalize = isForced$1.normalize = function (string) {
939
- return String(string).replace(replacement, '.').toLowerCase();
940
- };
941
-
942
- var data = isForced$1.data = {};
943
- var NATIVE = isForced$1.NATIVE = 'N';
944
- var POLYFILL = isForced$1.POLYFILL = 'P';
945
-
946
- var isForced_1 = isForced$1;
947
-
948
- var global$2 = global$b;
949
- var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
950
- var createNonEnumerableProperty = createNonEnumerableProperty$2;
951
- var defineBuiltIn = defineBuiltIn$1;
952
- var defineGlobalProperty = defineGlobalProperty$3;
953
- var copyConstructorProperties = copyConstructorProperties$1;
954
- var isForced = isForced_1;
955
-
956
- /*
957
- options.target - name of the target object
958
- options.global - target is the global object
959
- options.stat - export as static methods of target
960
- options.proto - export as prototype methods of target
961
- options.real - real prototype method for the `pure` version
962
- options.forced - export even if the native feature is available
963
- options.bind - bind methods to the target, required for the `pure` version
964
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
965
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
966
- options.sham - add a flag to not completely full polyfills
967
- options.enumerable - export as enumerable property
968
- options.dontCallGetSet - prevent calling a getter on target
969
- options.name - the .name of the function if it does not match the key
970
- */
971
- var _export = function (options, source) {
972
- var TARGET = options.target;
973
- var GLOBAL = options.global;
974
- var STATIC = options.stat;
975
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
976
- if (GLOBAL) {
977
- target = global$2;
978
- } else if (STATIC) {
979
- target = global$2[TARGET] || defineGlobalProperty(TARGET, {});
980
- } else {
981
- target = global$2[TARGET] && global$2[TARGET].prototype;
982
- }
983
- if (target) for (key in source) {
984
- sourceProperty = source[key];
985
- if (options.dontCallGetSet) {
986
- descriptor = getOwnPropertyDescriptor$1(target, key);
987
- targetProperty = descriptor && descriptor.value;
988
- } else targetProperty = target[key];
989
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
990
- // contained in target
991
- if (!FORCED && targetProperty !== undefined) {
992
- if (typeof sourceProperty == typeof targetProperty) continue;
993
- copyConstructorProperties(sourceProperty, targetProperty);
994
- }
995
- // add a flag to not completely full polyfills
996
- if (options.sham || (targetProperty && targetProperty.sham)) {
997
- createNonEnumerableProperty(sourceProperty, 'sham', true);
998
- }
999
- defineBuiltIn(target, key, sourceProperty, options);
1000
- }
1001
- };
1002
-
1003
- var classof$3 = classofRaw$1;
1004
-
1005
- // `IsArray` abstract operation
1006
- // https://tc39.es/ecma262/#sec-isarray
1007
- // eslint-disable-next-line es/no-array-isarray -- safe
1008
- var isArray$1 = Array.isArray || function isArray(argument) {
1009
- return classof$3(argument) === 'Array';
1010
- };
1011
-
1012
- var DESCRIPTORS$2 = descriptors;
1013
- var isArray = isArray$1;
1014
-
1015
- var $TypeError$2 = TypeError;
1016
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1017
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1018
-
1019
- // Safari < 13 does not throw an error in this case
1020
- var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$2 && !function () {
1021
- // makes no sense without proper strict mode support
1022
- if (this !== undefined) return true;
1023
- try {
1024
- // eslint-disable-next-line es/no-object-defineproperty -- safe
1025
- Object.defineProperty([], 'length', { writable: false }).length = 1;
1026
- } catch (error) {
1027
- return error instanceof TypeError;
1028
- }
1029
- }();
1030
-
1031
- var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
1032
- if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
1033
- throw new $TypeError$2('Cannot set read only .length');
1034
- } return O.length = length;
1035
- } : function (O, length) {
1036
- return O.length = length;
1037
- };
1038
-
1039
- var $TypeError$1 = TypeError;
1040
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
1041
-
1042
- var doesNotExceedSafeInteger$1 = function (it) {
1043
- if (it > MAX_SAFE_INTEGER) throw $TypeError$1('Maximum allowed index exceeded');
1044
- return it;
1045
- };
1046
-
1047
- var $$5 = _export;
1048
- var toObject$2 = toObject$4;
1049
- var lengthOfArrayLike = lengthOfArrayLike$2;
1050
- var setArrayLength = arraySetLength;
1051
- var doesNotExceedSafeInteger = doesNotExceedSafeInteger$1;
1052
- var fails$4 = fails$d;
1053
-
1054
- var INCORRECT_TO_LENGTH = fails$4(function () {
1055
- return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
1056
- });
1057
-
1058
- // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
1059
- // https://bugs.chromium.org/p/v8/issues/detail?id=12681
1060
- var properErrorOnNonWritableLength = function () {
1061
- try {
1062
- // eslint-disable-next-line es/no-object-defineproperty -- safe
1063
- Object.defineProperty([], 'length', { writable: false }).push();
1064
- } catch (error) {
1065
- return error instanceof TypeError;
1066
- }
1067
- };
1068
-
1069
- var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
1070
-
1071
- // `Array.prototype.push` method
1072
- // https://tc39.es/ecma262/#sec-array.prototype.push
1073
- $$5({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
1074
- // eslint-disable-next-line no-unused-vars -- required for `.length`
1075
- push: function push(item) {
1076
- var O = toObject$2(this);
1077
- var len = lengthOfArrayLike(O);
1078
- var argCount = arguments.length;
1079
- doesNotExceedSafeInteger(len + argCount);
1080
- for (var i = 0; i < argCount; i++) {
1081
- O[len] = arguments[i];
1082
- len++;
1083
- }
1084
- setArrayLength(O, len);
1085
- return len;
1086
- }
1087
- });
1088
-
1089
- var internalObjectKeys = objectKeysInternal;
1090
- var enumBugKeys$1 = enumBugKeys$3;
1091
-
1092
- // `Object.keys` method
1093
- // https://tc39.es/ecma262/#sec-object.keys
1094
- // eslint-disable-next-line es/no-object-keys -- safe
1095
- var objectKeys$2 = Object.keys || function keys(O) {
1096
- return internalObjectKeys(O, enumBugKeys$1);
1097
- };
1098
-
1099
- var DESCRIPTORS$1 = descriptors;
1100
- var uncurryThis$1 = functionUncurryThis;
1101
- var call$1 = functionCall;
1102
- var fails$3 = fails$d;
1103
- var objectKeys$1 = objectKeys$2;
1104
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1105
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1106
- var toObject$1 = toObject$4;
1107
- var IndexedObject = indexedObject;
1108
-
1109
- // eslint-disable-next-line es/no-object-assign -- safe
1110
- var $assign = Object.assign;
1111
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1112
- var defineProperty$2 = Object.defineProperty;
1113
- var concat = uncurryThis$1([].concat);
1114
-
1115
- // `Object.assign` method
1116
- // https://tc39.es/ecma262/#sec-object.assign
1117
- var objectAssign = !$assign || fails$3(function () {
1118
- // should have correct order of operations (Edge bug)
1119
- if (DESCRIPTORS$1 && $assign({ b: 1 }, $assign(defineProperty$2({}, 'a', {
1120
- enumerable: true,
1121
- get: function () {
1122
- defineProperty$2(this, 'b', {
1123
- value: 3,
1124
- enumerable: false
1125
- });
1126
- }
1127
- }), { b: 2 })).b !== 1) return true;
1128
- // should work with symbols and should have deterministic property order (V8 bug)
1129
- var A = {};
1130
- var B = {};
1131
- // eslint-disable-next-line es/no-symbol -- safe
1132
- var symbol = Symbol('assign detection');
1133
- var alphabet = 'abcdefghijklmnopqrst';
1134
- A[symbol] = 7;
1135
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1136
- return $assign({}, A)[symbol] !== 7 || objectKeys$1($assign({}, B)).join('') !== alphabet;
1137
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1138
- var T = toObject$1(target);
1139
- var argumentsLength = arguments.length;
1140
- var index = 1;
1141
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1142
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1143
- while (argumentsLength > index) {
1144
- var S = IndexedObject(arguments[index++]);
1145
- var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1146
- var length = keys.length;
1147
- var j = 0;
1148
- var key;
1149
- while (length > j) {
1150
- key = keys[j++];
1151
- if (!DESCRIPTORS$1 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1152
- }
1153
- } return T;
1154
- } : $assign;
1155
-
1156
- var $$4 = _export;
1157
- var assign = objectAssign;
1158
-
1159
- // `Object.assign` method
1160
- // https://tc39.es/ecma262/#sec-object.assign
1161
- // eslint-disable-next-line es/no-object-assign -- required for testing
1162
- $$4({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1163
- assign: assign
1164
- });
1165
-
1166
- /******************************************************************************
1167
- Copyright (c) Microsoft Corporation.
1168
-
1169
- Permission to use, copy, modify, and/or distribute this software for any
1170
- purpose with or without fee is hereby granted.
1171
-
1172
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1173
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1174
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1175
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1176
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1177
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1178
- PERFORMANCE OF THIS SOFTWARE.
1179
- ***************************************************************************** */
1180
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
1181
-
1182
-
1183
- function __rest(s, e) {
1184
- var t = {};
1185
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1186
- t[p] = s[p];
1187
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1188
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1189
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1190
- t[p[i]] = s[p[i]];
1191
- }
1192
- return t;
1193
- }
1194
-
1195
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
1196
- var e = new Error(message);
1197
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1198
- };
1199
-
1200
- const initScripts = () => {
1201
- var _a;
1202
- const widgetcsslink = document.createElement('link');
1203
- const link = document.getElementsByTagName('link')[0];
1204
- const mainUrl = "https://widget.archbee.com/v1";
1205
- widgetcsslink['rel'] = 'stylesheet';
1206
- widgetcsslink['href'] = `${mainUrl}/main.css`;
1207
- if (!link) {
1208
- document.getElementsByTagName('head')[0].append(widgetcsslink);
1209
- }
1210
- (_a = link === null || link === void 0 ? void 0 : link.parentNode) === null || _a === void 0 ? void 0 : _a.appendChild(widgetcsslink);
1211
- };
1212
- const initJsScripts = loadingStrategy => {
1213
- var _a;
1214
- const mainUrl = "https://widget.archbee.com/v1";
1215
- let scripttag = document.createElement('script');
1216
- scripttag['async'] = loadingStrategy === 'lazy';
1217
- scripttag['src'] = `${mainUrl}/main.js`;
1218
- const script = document.getElementsByTagName('script')[0];
1219
- (_a = script === null || script === void 0 ? void 0 : script.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(scripttag, script);
1220
- };
1221
- const createArchbeeWidget = (spaceId, jwt, shareableToken, loadingStrategy = 'lazy', bubble = 'invisible', bubblePlaceholder, anchor, hideNavbar) => {
1222
- if (!window._archbee) {
1223
- window._archbee = window._archbee || {
1224
- queue: [],
1225
- push: function (event) {
1226
- window._archbee.queue.push(event);
1227
- }
1228
- };
1229
- window._archbee.push({
1230
- eventType: 'init',
1231
- spaceId,
1232
- jwt,
1233
- shareableToken,
1234
- bubble,
1235
- bubblePlaceholder,
1236
- anchor,
1237
- hideNavbar
1238
- });
1239
- initJsScripts(loadingStrategy);
1240
- }
1241
- return window._archbee;
1242
- };
1243
-
1244
- var defineProperty$1 = objectDefineProperty.f;
1245
- var hasOwn$2 = hasOwnProperty_1;
1246
- var wellKnownSymbol$5 = wellKnownSymbol$7;
1247
-
1248
- var TO_STRING_TAG$2 = wellKnownSymbol$5('toStringTag');
1249
-
1250
- var setToStringTag$1 = function (target, TAG, STATIC) {
1251
- if (target && !STATIC) target = target.prototype;
1252
- if (target && !hasOwn$2(target, TO_STRING_TAG$2)) {
1253
- defineProperty$1(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
1254
- }
1255
- };
1256
-
1257
- var $$3 = _export;
1258
- var global$1 = global$b;
1259
- var setToStringTag = setToStringTag$1;
1260
-
1261
- $$3({ global: true }, { Reflect: {} });
1262
-
1263
- // Reflect[@@toStringTag] property
1264
- // https://tc39.es/ecma262/#sec-reflect-@@tostringtag
1265
- setToStringTag(global$1.Reflect, 'Reflect', true);
1266
-
1267
- var hasOwn$1 = hasOwnProperty_1;
1268
-
1269
- var isDataDescriptor$1 = function (descriptor) {
1270
- return descriptor !== undefined && (hasOwn$1(descriptor, 'value') || hasOwn$1(descriptor, 'writable'));
1271
- };
1272
-
1273
- var fails$2 = fails$d;
1274
-
1275
- var correctPrototypeGetter = !fails$2(function () {
1276
- function F() { /* empty */ }
1277
- F.prototype.constructor = null;
1278
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1279
- return Object.getPrototypeOf(new F()) !== F.prototype;
1280
- });
1281
-
1282
- var hasOwn = hasOwnProperty_1;
1283
- var isCallable$1 = isCallable$c;
1284
- var toObject = toObject$4;
1285
- var sharedKey$1 = sharedKey$3;
1286
- var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1287
-
1288
- var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1289
- var $Object$1 = Object;
1290
- var ObjectPrototype = $Object$1.prototype;
1291
-
1292
- // `Object.getPrototypeOf` method
1293
- // https://tc39.es/ecma262/#sec-object.getprototypeof
1294
- // eslint-disable-next-line es/no-object-getprototypeof -- safe
1295
- var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
1296
- var object = toObject(O);
1297
- if (hasOwn(object, IE_PROTO$1)) return object[IE_PROTO$1];
1298
- var constructor = object.constructor;
1299
- if (isCallable$1(constructor) && object instanceof constructor) {
1300
- return constructor.prototype;
1301
- } return object instanceof $Object$1 ? ObjectPrototype : null;
1302
- };
1303
-
1304
- var $$2 = _export;
1305
- var call = functionCall;
1306
- var anObject$2 = anObject$5;
1307
- var isObject$1 = isObject$7;
1308
- var isDataDescriptor = isDataDescriptor$1;
1309
- var fails$1 = fails$d;
1310
- var definePropertyModule$1 = objectDefineProperty;
1311
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1312
- var getPrototypeOf = objectGetPrototypeOf;
1313
- var createPropertyDescriptor = createPropertyDescriptor$3;
1314
-
1315
- // `Reflect.set` method
1316
- // https://tc39.es/ecma262/#sec-reflect.set
1317
- function set(target, propertyKey, V /* , receiver */) {
1318
- var receiver = arguments.length < 4 ? target : arguments[3];
1319
- var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject$2(target), propertyKey);
1320
- var existingDescriptor, prototype, setter;
1321
- if (!ownDescriptor) {
1322
- if (isObject$1(prototype = getPrototypeOf(target))) {
1323
- return set(prototype, propertyKey, V, receiver);
1324
- }
1325
- ownDescriptor = createPropertyDescriptor(0);
1326
- }
1327
- if (isDataDescriptor(ownDescriptor)) {
1328
- if (ownDescriptor.writable === false || !isObject$1(receiver)) return false;
1329
- if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) {
1330
- if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
1331
- existingDescriptor.value = V;
1332
- definePropertyModule$1.f(receiver, propertyKey, existingDescriptor);
1333
- } else definePropertyModule$1.f(receiver, propertyKey, createPropertyDescriptor(0, V));
1334
- } else {
1335
- setter = ownDescriptor.set;
1336
- if (setter === undefined) return false;
1337
- call(setter, receiver, V);
1338
- } return true;
1339
- }
1340
-
1341
- // MS Edge 17-18 Reflect.set allows setting the property to object
1342
- // with non-writable property on the prototype
1343
- var MS_EDGE_BUG = fails$1(function () {
1344
- var Constructor = function () { /* empty */ };
1345
- var object = definePropertyModule$1.f(new Constructor(), 'a', { configurable: true });
1346
- // eslint-disable-next-line es/no-reflect -- required for testing
1347
- return Reflect.set(Constructor.prototype, 'a', 1, object) !== false;
1348
- });
1349
-
1350
- $$2({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, {
1351
- set: set
1352
- });
1353
-
1354
- var objectDefineProperties = {};
1355
-
1356
- var DESCRIPTORS = descriptors;
1357
- var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1358
- var definePropertyModule = objectDefineProperty;
1359
- var anObject$1 = anObject$5;
1360
- var toIndexedObject = toIndexedObject$4;
1361
- var objectKeys = objectKeys$2;
1362
-
1363
- // `Object.defineProperties` method
1364
- // https://tc39.es/ecma262/#sec-object.defineproperties
1365
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1366
- objectDefineProperties.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1367
- anObject$1(O);
1368
- var props = toIndexedObject(Properties);
1369
- var keys = objectKeys(Properties);
1370
- var length = keys.length;
1371
- var index = 0;
1372
- var key;
1373
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1374
- return O;
1375
- };
1376
-
1377
- var getBuiltIn = getBuiltIn$3;
1378
-
1379
- var html$1 = getBuiltIn('document', 'documentElement');
1380
-
1381
- /* global ActiveXObject -- old IE, WSH */
1382
- var anObject = anObject$5;
1383
- var definePropertiesModule = objectDefineProperties;
1384
- var enumBugKeys = enumBugKeys$3;
1385
- var hiddenKeys = hiddenKeys$4;
1386
- var html = html$1;
1387
- var documentCreateElement = documentCreateElement$1;
1388
- var sharedKey = sharedKey$3;
1389
-
1390
- var GT = '>';
1391
- var LT = '<';
1392
- var PROTOTYPE = 'prototype';
1393
- var SCRIPT = 'script';
1394
- var IE_PROTO = sharedKey('IE_PROTO');
1395
-
1396
- var EmptyConstructor = function () { /* empty */ };
1397
-
1398
- var scriptTag = function (content) {
1399
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1400
- };
1401
-
1402
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1403
- var NullProtoObjectViaActiveX = function (activeXDocument) {
1404
- activeXDocument.write(scriptTag(''));
1405
- activeXDocument.close();
1406
- var temp = activeXDocument.parentWindow.Object;
1407
- activeXDocument = null; // avoid memory leak
1408
- return temp;
1409
- };
1410
-
1411
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
1412
- var NullProtoObjectViaIFrame = function () {
1413
- // Thrash, waste and sodomy: IE GC bug
1414
- var iframe = documentCreateElement('iframe');
1415
- var JS = 'java' + SCRIPT + ':';
1416
- var iframeDocument;
1417
- iframe.style.display = 'none';
1418
- html.appendChild(iframe);
1419
- // https://github.com/zloirock/core-js/issues/475
1420
- iframe.src = String(JS);
1421
- iframeDocument = iframe.contentWindow.document;
1422
- iframeDocument.open();
1423
- iframeDocument.write(scriptTag('document.F=Object'));
1424
- iframeDocument.close();
1425
- return iframeDocument.F;
1426
- };
1427
-
1428
- // Check for document.domain and active x support
1429
- // No need to use active x approach when document.domain is not set
1430
- // see https://github.com/es-shims/es5-shim/issues/150
1431
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1432
- // avoid IE GC bug
1433
- var activeXDocument;
1434
- var NullProtoObject = function () {
1435
- try {
1436
- activeXDocument = new ActiveXObject('htmlfile');
1437
- } catch (error) { /* ignore */ }
1438
- NullProtoObject = typeof document != 'undefined'
1439
- ? document.domain && activeXDocument
1440
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1441
- : NullProtoObjectViaIFrame()
1442
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
1443
- var length = enumBugKeys.length;
1444
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1445
- return NullProtoObject();
1446
- };
1447
-
1448
- hiddenKeys[IE_PROTO] = true;
1449
-
1450
- // `Object.create` method
1451
- // https://tc39.es/ecma262/#sec-object.create
1452
- // eslint-disable-next-line es/no-object-create -- safe
1453
- var objectCreate = Object.create || function create(O, Properties) {
1454
- var result;
1455
- if (O !== null) {
1456
- EmptyConstructor[PROTOTYPE] = anObject(O);
1457
- result = new EmptyConstructor();
1458
- EmptyConstructor[PROTOTYPE] = null;
1459
- // add "__proto__" for Object.getPrototypeOf polyfill
1460
- result[IE_PROTO] = O;
1461
- } else result = NullProtoObject();
1462
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1463
- };
1464
-
1465
- var wellKnownSymbol$4 = wellKnownSymbol$7;
1466
- var create = objectCreate;
1467
- var defineProperty = objectDefineProperty.f;
1468
-
1469
- var UNSCOPABLES = wellKnownSymbol$4('unscopables');
1470
- var ArrayPrototype = Array.prototype;
1471
-
1472
- // Array.prototype[@@unscopables]
1473
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1474
- if (ArrayPrototype[UNSCOPABLES] === undefined) {
1475
- defineProperty(ArrayPrototype, UNSCOPABLES, {
1476
- configurable: true,
1477
- value: create(null)
1478
- });
1479
- }
1480
-
1481
- // add a key to Array.prototype[@@unscopables]
1482
- var addToUnscopables$1 = function (key) {
1483
- ArrayPrototype[UNSCOPABLES][key] = true;
1484
- };
1485
-
1486
- var $$1 = _export;
1487
- var $includes = arrayIncludes.includes;
1488
- var fails = fails$d;
1489
- var addToUnscopables = addToUnscopables$1;
1490
-
1491
- // FF99+ bug
1492
- var BROKEN_ON_SPARSE = fails(function () {
1493
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
1494
- return !Array(1).includes();
1495
- });
1496
-
1497
- // `Array.prototype.includes` method
1498
- // https://tc39.es/ecma262/#sec-array.prototype.includes
1499
- $$1({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
1500
- includes: function includes(el /* , fromIndex = 0 */) {
1501
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1502
- }
1503
- });
1504
-
1505
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1506
- addToUnscopables('includes');
1507
-
1508
- var isObject = isObject$7;
1509
- var classof$2 = classofRaw$1;
1510
- var wellKnownSymbol$3 = wellKnownSymbol$7;
1511
-
1512
- var MATCH$1 = wellKnownSymbol$3('match');
1513
-
1514
- // `IsRegExp` abstract operation
1515
- // https://tc39.es/ecma262/#sec-isregexp
1516
- var isRegexp = function (it) {
1517
- var isRegExp;
1518
- return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$2(it) === 'RegExp');
1519
- };
1520
-
1521
- var isRegExp = isRegexp;
1522
-
1523
- var $TypeError = TypeError;
1524
-
1525
- var notARegexp = function (it) {
1526
- if (isRegExp(it)) {
1527
- throw new $TypeError("The method doesn't accept regular expressions");
1528
- } return it;
1529
- };
1530
-
1531
- var wellKnownSymbol$2 = wellKnownSymbol$7;
1532
-
1533
- var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
1534
- var test = {};
1535
-
1536
- test[TO_STRING_TAG$1] = 'z';
1537
-
1538
- var toStringTagSupport = String(test) === '[object z]';
1539
-
1540
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1541
- var isCallable = isCallable$c;
1542
- var classofRaw = classofRaw$1;
1543
- var wellKnownSymbol$1 = wellKnownSymbol$7;
1544
-
1545
- var TO_STRING_TAG = wellKnownSymbol$1('toStringTag');
1546
- var $Object = Object;
1547
-
1548
- // ES3 wrong here
1549
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
1550
-
1551
- // fallback for IE11 Script Access Denied error
1552
- var tryGet = function (it, key) {
1553
- try {
1554
- return it[key];
1555
- } catch (error) { /* empty */ }
1556
- };
1557
-
1558
- // getting tag from ES6+ `Object.prototype.toString`
1559
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1560
- var O, tag, result;
1561
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1562
- // @@toStringTag case
1563
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
1564
- // builtinTag case
1565
- : CORRECT_ARGUMENTS ? classofRaw(O)
1566
- // ES3 arguments fallback
1567
- : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1568
- };
1569
-
1570
- var classof = classof$1;
1571
-
1572
- var $String = String;
1573
-
1574
- var toString$1 = function (argument) {
1575
- if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1576
- return $String(argument);
1577
- };
1578
-
1579
- var wellKnownSymbol = wellKnownSymbol$7;
1580
-
1581
- var MATCH = wellKnownSymbol('match');
1582
-
1583
- var correctIsRegexpLogic = function (METHOD_NAME) {
1584
- var regexp = /./;
1585
- try {
1586
- '/./'[METHOD_NAME](regexp);
1587
- } catch (error1) {
1588
- try {
1589
- regexp[MATCH] = false;
1590
- return '/./'[METHOD_NAME](regexp);
1591
- } catch (error2) { /* empty */ }
1592
- } return false;
1593
- };
1594
-
1595
- var $ = _export;
1596
- var uncurryThis = functionUncurryThis;
1597
- var notARegExp = notARegexp;
1598
- var requireObjectCoercible = requireObjectCoercible$3;
1599
- var toString = toString$1;
1600
- var correctIsRegExpLogic = correctIsRegexpLogic;
1601
-
1602
- var stringIndexOf = uncurryThis(''.indexOf);
1603
-
1604
- // `String.prototype.includes` method
1605
- // https://tc39.es/ecma262/#sec-string.prototype.includes
1606
- $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
1607
- includes: function includes(searchString /* , position = 0 */) {
1608
- return !!~stringIndexOf(
1609
- toString(requireObjectCoercible(this)),
1610
- toString(notARegExp(searchString)),
1611
- arguments.length > 1 ? arguments[1] : undefined
1612
- );
1613
- }
1614
- });
1615
-
1616
- var EVENT_TYPE_ENUM;
1617
- (function (EVENT_TYPE_ENUM) {
1618
- EVENT_TYPE_ENUM["init"] = "init";
1619
- EVENT_TYPE_ENUM["showWidget"] = "show-widget";
1620
- EVENT_TYPE_ENUM["hideWidget"] = "hide-widget";
1621
- })(EVENT_TYPE_ENUM || (EVENT_TYPE_ENUM = {}));
1622
- const EVENT_TYPE_LIST = [EVENT_TYPE_ENUM.init, EVENT_TYPE_ENUM.showWidget, EVENT_TYPE_ENUM.hideWidget];
1623
- const showWidgetEvent = () => {
1624
- if (typeof window === 'undefined') return;
1625
- return new CustomEvent(EVENT_TYPE_ENUM.showWidget);
1626
- };
1627
- const hideWidgetEvent = () => {
1628
- if (typeof window === 'undefined') return;
1629
- return new CustomEvent(EVENT_TYPE_ENUM.hideWidget);
1630
- };
1631
-
1632
- const render = (component, createContainer, cb) => {
1633
- createContainer();
1634
- const element = document.getElementsByClassName('ab-widget')[0];
1635
- ReactDOM.render(jsx(React.StrictMode, {
1636
- children: component
1637
- }), element, () => cb && cb(element));
1638
- };
1639
-
1640
- const setWidget = widget => {
1641
- window._archbee.widget = Object.assign({}, widget);
1642
- window._archbee.widget.isOpen = false;
1643
- };
1644
- const loadWidget = (widg, render) => {
1645
- var _a;
1646
- if (typeof document.addEventListener !== 'function') {
1647
- return;
1648
- }
1649
- window._archbee.widget = Object.assign(Object.assign({}, (_a = window._archbee) === null || _a === void 0 ? void 0 : _a.widget), widg);
1650
- try {
1651
- render(createContainer, widg.onRenderFinish);
1652
- } catch (err) {
1653
- console.log(err);
1654
- }
1655
- };
1656
- const createContainer = () => {
1657
- var _a;
1658
- if (document.getElementsByClassName('ab-widget').length) return;
1659
- const widget = (_a = window._archbee) === null || _a === void 0 ? void 0 : _a.widget;
1660
- const abDiv = document.createElement('div');
1661
- abDiv.style.cssText = `visibility:hidden;${widget.bubble === 'ask' ? '' : 'z-index:-2147483001;'}`;
1662
- abDiv.className = `ab-widget ab-id-${Date.now()}`;
1663
- if (!(widget === null || widget === void 0 ? void 0 : widget.anchor)) {
1664
- document.body.appendChild(abDiv);
1665
- return;
1666
- }
1667
- const anchor = document.querySelector(widget === null || widget === void 0 ? void 0 : widget.anchor);
1668
- if (!anchor) return;
1669
- abDiv.className = `${abDiv.className} ab-absolute`;
1670
- anchor.appendChild(abDiv);
1671
- };
1672
-
1673
- const registerProxy = component => {
1674
- if (!('Proxy' in window)) {
1675
- console.warn("Your browser doesn't support Proxies.");
1676
- return;
1677
- }
1678
- const proxy = new Proxy(window._archbee.queue, {
1679
- get(target, property, receiver) {
1680
- return Reflect.get(target, property, receiver);
1681
- },
1682
- apply(target, thisArg, argumentsList) {
1683
- return thisArg[target].apply(this, argumentsList);
1684
- },
1685
- set(target, property, value) {
1686
- iterateProxy(target, component);
1687
- return Reflect.set(target, property, value);
1688
- },
1689
- deleteProperty(target, property) {
1690
- return Reflect.deleteProperty(target, property);
1691
- }
1692
- });
1693
- return proxy;
1694
- };
1695
- const iterateProxy = (proxy, component) => {
1696
- if (!proxy.length) return;
1697
- proxy.forEach((event, index) => {
1698
- // keep this here for now
1699
- console.log('widget event received:', event.eventType, window._archbee.widget);
1700
- if (event.hasExecuted || !EVENT_TYPE_LIST.includes(event.eventType)) {
1701
- proxy.splice(index, 1);
1702
- return;
1703
- }
1704
- if (event.eventType === EVENT_TYPE_ENUM.init) {
1705
- setWidget(event);
1706
- loadWidget(event, render.bind(undefined, component));
1707
- }
1708
- if (event.eventType === EVENT_TYPE_ENUM.showWidget) {
1709
- window._archbee.widget.isOpen = true;
1710
- if (event.docId) {
1711
- window._archbee.widget.docId = event.docId;
1712
- }
1713
- if (event.blockId) {
1714
- window._archbee.widget.blockId = event.blockId;
1715
- }
1716
- if (event.widgetType) {
1717
- const widgetType = event.docId && event.widgetType === 'search' ? 'docs' : event.widgetType;
1718
- window._archbee.widget.widgetType = widgetType;
1719
- } else {
1720
- window._archbee.widget.widgetType = 'docs';
1721
- }
1722
- if (Object.keys(event).includes('hideNavbar')) {
1723
- window._archbee.widget.hideNavbar = event.hideNavbar;
1724
- }
1725
- window.dispatchEvent(showWidgetEvent());
1726
- }
1727
- if (event.eventType === EVENT_TYPE_ENUM.hideWidget) {
1728
- window._archbee.widget.isOpen = false;
1729
- window._archbee.widget.docId = undefined;
1730
- window._archbee.widget.blockId = undefined;
1731
- window._archbee.widget.widgetType = undefined;
1732
- window.dispatchEvent(hideWidgetEvent());
1733
- }
1734
- event.hasExecuted = true;
1735
- });
1736
- };
1737
-
1738
- const ArchbeeAppWidget = /*#__PURE__*/forwardRef((_a, ref) => {
1739
- var {
1740
- className,
1741
- spaceId,
1742
- jwt,
1743
- shareableToken,
1744
- docId,
1745
- blockId,
1746
- widgetType = 'docs',
1747
- loadingStrategy = 'lazy',
1748
- hideNavbar,
1749
- onWidgetOpen,
1750
- onWidgetClose,
1751
- bubble,
1752
- bubblePlaceholder,
1753
- anchor,
1754
- children
1755
- } = _a,
1756
- rest = __rest(_a, ["className", "spaceId", "jwt", "shareableToken", "docId", "blockId", "widgetType", "loadingStrategy", "hideNavbar", "onWidgetOpen", "onWidgetClose", "bubble", "bubblePlaceholder", "anchor", "children"]);
1757
- const elementRef = useRef(null);
1758
- const widgetInstance = useMemo(() => {
1759
- if (typeof window === 'undefined') return;
1760
- return createArchbeeWidget(spaceId, jwt, shareableToken, loadingStrategy, bubble, bubblePlaceholder, anchor, hideNavbar);
1761
- }, [spaceId, jwt, shareableToken, loadingStrategy, bubble, bubblePlaceholder, anchor, hideNavbar]);
1762
- useImperativeHandle(ref, () => {
1763
- return {
1764
- open: onOpenWidget,
1765
- close: onCloseWidget,
1766
- instance: () => widgetInstance
1767
- };
1768
- });
1769
- const onOpenWidget = () => {
1770
- widgetInstance === null || widgetInstance === void 0 ? void 0 : widgetInstance.push({
1771
- eventType: 'show-widget',
1772
- widgetType,
1773
- docId,
1774
- blockId
1775
- });
1776
- onWidgetOpen === null || onWidgetOpen === void 0 ? void 0 : onWidgetOpen();
1777
- };
1778
- const onCloseWidget = () => {
1779
- widgetInstance === null || widgetInstance === void 0 ? void 0 : widgetInstance.push({
1780
- eventType: 'hide-widget'
1781
- });
1782
- onWidgetClose === null || onWidgetClose === void 0 ? void 0 : onWidgetClose();
1783
- };
1784
- const onElementClicked = event => {
1785
- var _a;
1786
- if (typeof window !== 'undefined' && ((_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) && !ref) {
1787
- event.preventDefault();
1788
- onOpenWidget();
1789
- }
1790
- };
1791
- return jsx("div", Object.assign({
1792
- className: className !== null && className !== void 0 ? className : '',
1793
- ref: elementRef,
1794
- onClick: onElementClicked
1795
- }, rest, {
1796
- children: children
1797
- }));
1798
- });
1799
-
1800
- export { ArchbeeAppWidget, EVENT_TYPE_ENUM, EVENT_TYPE_LIST, createArchbeeWidget, createContainer, hideWidgetEvent, initJsScripts, initScripts, iterateProxy, loadWidget, registerProxy, render, setWidget, showWidgetEvent };