@archbee/app-widget 1.1.24 → 1.1.25

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