@digipair/skill-web-editor 0.4.2

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.esm2.js ADDED
@@ -0,0 +1,3237 @@
1
+ function _extends() {
2
+ _extends = Object.assign || function assign(target) {
3
+ for(var i = 1; i < arguments.length; i++){
4
+ var source = arguments[i];
5
+ for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
6
+ }
7
+ return target;
8
+ };
9
+ return _extends.apply(this, arguments);
10
+ }
11
+
12
+ function __decorate(decorators, target, key, desc) {
13
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15
+ else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
16
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
17
+ }
18
+ function __metadata(metadataKey, metadataValue) {
19
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
20
+ }
21
+ typeof SuppressedError === "function" ? SuppressedError : function _SuppressedError(error, suppressed, message) {
22
+ var e = new Error(message);
23
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
24
+ };
25
+
26
+ /**
27
+ * @license
28
+ * Copyright 2019 Google LLC
29
+ * SPDX-License-Identifier: BSD-3-Clause
30
+ */ function _class_call_check$3(instance, Constructor) {
31
+ if (!(instance instanceof Constructor)) {
32
+ throw new TypeError("Cannot call a class as a function");
33
+ }
34
+ }
35
+ function _defineProperties$3(target, props) {
36
+ for(var i = 0; i < props.length; i++){
37
+ var descriptor = props[i];
38
+ descriptor.enumerable = descriptor.enumerable || false;
39
+ descriptor.configurable = true;
40
+ if ("value" in descriptor) descriptor.writable = true;
41
+ Object.defineProperty(target, descriptor.key, descriptor);
42
+ }
43
+ }
44
+ function _create_class$3(Constructor, protoProps, staticProps) {
45
+ if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
46
+ if (staticProps) _defineProperties$3(Constructor, staticProps);
47
+ return Constructor;
48
+ }
49
+ function _instanceof(left, right) {
50
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
51
+ return !!right[Symbol.hasInstance](left);
52
+ } else {
53
+ return left instanceof right;
54
+ }
55
+ }
56
+ var t$2 = globalThis, e$2 = t$2.ShadowRoot && (void 0 === t$2.ShadyCSS || t$2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$3 = new WeakMap;
57
+ var n$3 = /*#__PURE__*/ function() {
58
+ function n(t, e, o) {
59
+ _class_call_check$3(this, n);
60
+ if (this._$cssResult$ = !0, o !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
61
+ this.cssText = t, this.t = e;
62
+ }
63
+ _create_class$3(n, [
64
+ {
65
+ key: "styleSheet",
66
+ get: function get() {
67
+ var t = this.o;
68
+ var s = this.t;
69
+ if (e$2 && void 0 === t) {
70
+ var e1 = void 0 !== s && 1 === s.length;
71
+ e1 && (t = o$3.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet).replaceSync(this.cssText), e1 && o$3.set(s, t));
72
+ }
73
+ return t;
74
+ }
75
+ },
76
+ {
77
+ key: "toString",
78
+ value: function toString() {
79
+ return this.cssText;
80
+ }
81
+ }
82
+ ]);
83
+ return n;
84
+ }();
85
+ var r$5 = function(t) {
86
+ return new n$3("string" == typeof t ? t : t + "", void 0, s$2);
87
+ }, S$1 = function(s, o) {
88
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
89
+ if (e$2) s.adoptedStyleSheets = o.map(function(t) {
90
+ return _instanceof(t, CSSStyleSheet) ? t : t.styleSheet;
91
+ });
92
+ else try {
93
+ for(var _iterator = o[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
94
+ var e1 = _step.value;
95
+ var _$o = document.createElement("style"), n = t$2.litNonce;
96
+ void 0 !== n && _$o.setAttribute("nonce", n), _$o.textContent = e1.cssText, s.appendChild(_$o);
97
+ }
98
+ } catch (err) {
99
+ _didIteratorError = true;
100
+ _iteratorError = err;
101
+ } finally{
102
+ try {
103
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
104
+ _iterator.return();
105
+ }
106
+ } finally{
107
+ if (_didIteratorError) {
108
+ throw _iteratorError;
109
+ }
110
+ }
111
+ }
112
+ }, c$2 = e$2 ? function(t) {
113
+ return t;
114
+ } : function(t) {
115
+ return _instanceof(t, CSSStyleSheet) ? function(t) {
116
+ var e = "";
117
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
118
+ try {
119
+ for(var _iterator = t.cssRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
120
+ var s = _step.value;
121
+ e += s.cssText;
122
+ }
123
+ } catch (err) {
124
+ _didIteratorError = true;
125
+ _iteratorError = err;
126
+ } finally{
127
+ try {
128
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
129
+ _iterator.return();
130
+ }
131
+ } finally{
132
+ if (_didIteratorError) {
133
+ throw _iteratorError;
134
+ }
135
+ }
136
+ }
137
+ return r$5(e);
138
+ }(t) : t;
139
+ };
140
+
141
+ function _array_like_to_array$1(arr, len) {
142
+ if (len == null || len > arr.length) len = arr.length;
143
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
144
+ return arr2;
145
+ }
146
+ function _array_with_holes$1(arr) {
147
+ if (Array.isArray(arr)) return arr;
148
+ }
149
+ function _array_without_holes$1(arr) {
150
+ if (Array.isArray(arr)) return _array_like_to_array$1(arr);
151
+ }
152
+ function _assert_this_initialized$2(self) {
153
+ if (self === void 0) {
154
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
155
+ }
156
+ return self;
157
+ }
158
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
159
+ try {
160
+ var info = gen[key](arg);
161
+ var value = info.value;
162
+ } catch (error) {
163
+ reject(error);
164
+ return;
165
+ }
166
+ if (info.done) {
167
+ resolve(value);
168
+ } else {
169
+ Promise.resolve(value).then(_next, _throw);
170
+ }
171
+ }
172
+ function _async_to_generator(fn) {
173
+ return function() {
174
+ var self = this, args = arguments;
175
+ return new Promise(function(resolve, reject) {
176
+ var gen = fn.apply(self, args);
177
+ function _next(value) {
178
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
179
+ }
180
+ function _throw(err) {
181
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
182
+ }
183
+ _next(undefined);
184
+ });
185
+ };
186
+ }
187
+ function _class_call_check$2(instance, Constructor) {
188
+ if (!(instance instanceof Constructor)) {
189
+ throw new TypeError("Cannot call a class as a function");
190
+ }
191
+ }
192
+ function _construct(Parent, args, Class) {
193
+ if (_is_native_reflect_construct$2()) {
194
+ _construct = Reflect.construct;
195
+ } else {
196
+ _construct = function construct(Parent, args, Class) {
197
+ var a = [
198
+ null
199
+ ];
200
+ a.push.apply(a, args);
201
+ var Constructor = Function.bind.apply(Parent, a);
202
+ var instance = new Constructor();
203
+ if (Class) _set_prototype_of$2(instance, Class.prototype);
204
+ return instance;
205
+ };
206
+ }
207
+ return _construct.apply(null, arguments);
208
+ }
209
+ function _defineProperties$2(target, props) {
210
+ for(var i = 0; i < props.length; i++){
211
+ var descriptor = props[i];
212
+ descriptor.enumerable = descriptor.enumerable || false;
213
+ descriptor.configurable = true;
214
+ if ("value" in descriptor) descriptor.writable = true;
215
+ Object.defineProperty(target, descriptor.key, descriptor);
216
+ }
217
+ }
218
+ function _create_class$2(Constructor, protoProps, staticProps) {
219
+ if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
220
+ if (staticProps) _defineProperties$2(Constructor, staticProps);
221
+ return Constructor;
222
+ }
223
+ function _get_prototype_of$2(o) {
224
+ _get_prototype_of$2 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
225
+ return o.__proto__ || Object.getPrototypeOf(o);
226
+ };
227
+ return _get_prototype_of$2(o);
228
+ }
229
+ function _inherits$2(subClass, superClass) {
230
+ if (typeof superClass !== "function" && superClass !== null) {
231
+ throw new TypeError("Super expression must either be null or a function");
232
+ }
233
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
234
+ constructor: {
235
+ value: subClass,
236
+ writable: true,
237
+ configurable: true
238
+ }
239
+ });
240
+ if (superClass) _set_prototype_of$2(subClass, superClass);
241
+ }
242
+ function _is_native_function(fn) {
243
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
244
+ }
245
+ function _iterable_to_array$1(iter) {
246
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
247
+ }
248
+ function _iterable_to_array_limit$1(arr, i) {
249
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
250
+ if (_i == null) return;
251
+ var _arr = [];
252
+ var _n = true;
253
+ var _d = false;
254
+ var _s, _e;
255
+ try {
256
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
257
+ _arr.push(_s.value);
258
+ if (i && _arr.length === i) break;
259
+ }
260
+ } catch (err) {
261
+ _d = true;
262
+ _e = err;
263
+ } finally{
264
+ try {
265
+ if (!_n && _i["return"] != null) _i["return"]();
266
+ } finally{
267
+ if (_d) throw _e;
268
+ }
269
+ }
270
+ return _arr;
271
+ }
272
+ function _non_iterable_rest$1() {
273
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
274
+ }
275
+ function _non_iterable_spread$1() {
276
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
277
+ }
278
+ function _possible_constructor_return$2(self, call) {
279
+ if (call && (_type_of$2(call) === "object" || typeof call === "function")) {
280
+ return call;
281
+ }
282
+ return _assert_this_initialized$2(self);
283
+ }
284
+ function _set_prototype_of$2(o, p) {
285
+ _set_prototype_of$2 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
286
+ o.__proto__ = p;
287
+ return o;
288
+ };
289
+ return _set_prototype_of$2(o, p);
290
+ }
291
+ function _sliced_to_array$1(arr, i) {
292
+ return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
293
+ }
294
+ function _to_consumable_array$1(arr) {
295
+ return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
296
+ }
297
+ function _type_of$2(obj) {
298
+ "@swc/helpers - typeof";
299
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
300
+ }
301
+ function _unsupported_iterable_to_array$1(o, minLen) {
302
+ if (!o) return;
303
+ if (typeof o === "string") return _array_like_to_array$1(o, minLen);
304
+ var n = Object.prototype.toString.call(o).slice(8, -1);
305
+ if (n === "Object" && o.constructor) n = o.constructor.name;
306
+ if (n === "Map" || n === "Set") return Array.from(n);
307
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
308
+ }
309
+ function _wrap_native_super(Class) {
310
+ var _cache = typeof Map === "function" ? new Map() : undefined;
311
+ _wrap_native_super = function wrapNativeSuper(Class) {
312
+ if (Class === null || !_is_native_function(Class)) return Class;
313
+ if (typeof Class !== "function") {
314
+ throw new TypeError("Super expression must either be null or a function");
315
+ }
316
+ if (typeof _cache !== "undefined") {
317
+ if (_cache.has(Class)) return _cache.get(Class);
318
+ _cache.set(Class, Wrapper);
319
+ }
320
+ function Wrapper() {
321
+ return _construct(Class, arguments, _get_prototype_of$2(this).constructor);
322
+ }
323
+ Wrapper.prototype = Object.create(Class.prototype, {
324
+ constructor: {
325
+ value: Wrapper,
326
+ enumerable: false,
327
+ writable: true,
328
+ configurable: true
329
+ }
330
+ });
331
+ return _set_prototype_of$2(Wrapper, Class);
332
+ };
333
+ return _wrap_native_super(Class);
334
+ }
335
+ function _is_native_reflect_construct$2() {
336
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
337
+ if (Reflect.construct.sham) return false;
338
+ if (typeof Proxy === "function") return true;
339
+ try {
340
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
341
+ return true;
342
+ } catch (e) {
343
+ return false;
344
+ }
345
+ }
346
+ function _create_super$2(Derived) {
347
+ var hasNativeReflectConstruct = _is_native_reflect_construct$2();
348
+ return function _createSuperInternal() {
349
+ var Super = _get_prototype_of$2(Derived), result;
350
+ if (hasNativeReflectConstruct) {
351
+ var NewTarget = _get_prototype_of$2(this).constructor;
352
+ result = Reflect.construct(Super, arguments, NewTarget);
353
+ } else {
354
+ result = Super.apply(this, arguments);
355
+ }
356
+ return _possible_constructor_return$2(this, result);
357
+ };
358
+ }
359
+ function _ts_generator(thisArg, body) {
360
+ var f, y, t, g, _ = {
361
+ label: 0,
362
+ sent: function() {
363
+ if (t[0] & 1) throw t[1];
364
+ return t[1];
365
+ },
366
+ trys: [],
367
+ ops: []
368
+ };
369
+ return g = {
370
+ next: verb(0),
371
+ "throw": verb(1),
372
+ "return": verb(2)
373
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
374
+ return this;
375
+ }), g;
376
+ function verb(n) {
377
+ return function(v) {
378
+ return step([
379
+ n,
380
+ v
381
+ ]);
382
+ };
383
+ }
384
+ function step(op) {
385
+ if (f) throw new TypeError("Generator is already executing.");
386
+ while(_)try {
387
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
388
+ if (y = 0, t) op = [
389
+ op[0] & 2,
390
+ t.value
391
+ ];
392
+ switch(op[0]){
393
+ case 0:
394
+ case 1:
395
+ t = op;
396
+ break;
397
+ case 4:
398
+ _.label++;
399
+ return {
400
+ value: op[1],
401
+ done: false
402
+ };
403
+ case 5:
404
+ _.label++;
405
+ y = op[1];
406
+ op = [
407
+ 0
408
+ ];
409
+ continue;
410
+ case 7:
411
+ op = _.ops.pop();
412
+ _.trys.pop();
413
+ continue;
414
+ default:
415
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
416
+ _ = 0;
417
+ continue;
418
+ }
419
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
420
+ _.label = op[1];
421
+ break;
422
+ }
423
+ if (op[0] === 6 && _.label < t[1]) {
424
+ _.label = t[1];
425
+ t = op;
426
+ break;
427
+ }
428
+ if (t && _.label < t[2]) {
429
+ _.label = t[2];
430
+ _.ops.push(op);
431
+ break;
432
+ }
433
+ if (t[2]) _.ops.pop();
434
+ _.trys.pop();
435
+ continue;
436
+ }
437
+ op = body.call(thisArg, _);
438
+ } catch (e) {
439
+ op = [
440
+ 6,
441
+ e
442
+ ];
443
+ y = 0;
444
+ } finally{
445
+ f = t = 0;
446
+ }
447
+ if (op[0] & 5) throw op[1];
448
+ return {
449
+ value: op[0] ? op[1] : void 0,
450
+ done: true
451
+ };
452
+ }
453
+ }
454
+ var _Symbol, _a, _a1;
455
+ /**
456
+ * @license
457
+ * Copyright 2017 Google LLC
458
+ * SPDX-License-Identifier: BSD-3-Clause
459
+ */ var i$1 = Object.is, e$1 = Object.defineProperty, r$4 = Object.getOwnPropertyDescriptor, h$1 = Object.getOwnPropertyNames, o$2 = Object.getOwnPropertySymbols, n$2 = Object.getPrototypeOf, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = function(t, s) {
460
+ return t;
461
+ }, u$1 = {
462
+ toAttribute: function toAttribute(t, s) {
463
+ switch(s){
464
+ case Boolean:
465
+ t = t ? l$1 : null;
466
+ break;
467
+ case Object:
468
+ case Array:
469
+ t = null == t ? t : JSON.stringify(t);
470
+ }
471
+ return t;
472
+ },
473
+ fromAttribute: function fromAttribute(t, s) {
474
+ var i = t;
475
+ switch(s){
476
+ case Boolean:
477
+ i = null !== t;
478
+ break;
479
+ case Number:
480
+ i = null === t ? null : Number(t);
481
+ break;
482
+ case Object:
483
+ case Array:
484
+ try {
485
+ i = JSON.parse(t);
486
+ } catch (t) {
487
+ i = null;
488
+ }
489
+ }
490
+ return i;
491
+ }
492
+ }, f$1 = function(t, s) {
493
+ return !i$1(t, s);
494
+ }, y$1 = {
495
+ attribute: !0,
496
+ type: String,
497
+ converter: u$1,
498
+ reflect: !1,
499
+ hasChanged: f$1
500
+ };
501
+ var _metadata, _litPropertyMetadata;
502
+ (_metadata = (_Symbol = Symbol).metadata) !== null && _metadata !== void 0 ? _metadata : _Symbol.metadata = Symbol("metadata"), (_litPropertyMetadata = (_a = a$1).litPropertyMetadata) !== null && _litPropertyMetadata !== void 0 ? _litPropertyMetadata : _a.litPropertyMetadata = new WeakMap;
503
+ var b = /*#__PURE__*/ function(HTMLElement1) {
504
+ _inherits$2(b, HTMLElement1);
505
+ var _super = _create_super$2(b);
506
+ function b() {
507
+ _class_call_check$2(this, b);
508
+ var _this;
509
+ _this = _super.call(this), _this._$Ep = void 0, _this.isUpdatePending = !1, _this.hasUpdated = !1, _this._$Em = null, _this._$Ev();
510
+ return _possible_constructor_return$2(_this);
511
+ }
512
+ _create_class$2(b, [
513
+ {
514
+ key: "_$Ev",
515
+ value: function _$Ev() {
516
+ var _this = this;
517
+ var _this_constructor_l;
518
+ this._$ES = new Promise(function(t) {
519
+ return _this.enableUpdating = t;
520
+ }), this._$AL = new Map, this._$E_(), this.requestUpdate(), (_this_constructor_l = this.constructor.l) === null || _this_constructor_l === void 0 ? void 0 : _this_constructor_l.forEach(function(t) {
521
+ return t(_this);
522
+ });
523
+ }
524
+ },
525
+ {
526
+ key: "addController",
527
+ value: function addController(t) {
528
+ var _t_hostConnected;
529
+ var _this__$EO;
530
+ ((_this__$EO = this._$EO) !== null && _this__$EO !== void 0 ? _this__$EO : this._$EO = new Set).add(t), void 0 !== this.renderRoot && this.isConnected && ((_t_hostConnected = t.hostConnected) === null || _t_hostConnected === void 0 ? void 0 : _t_hostConnected.call(t));
531
+ }
532
+ },
533
+ {
534
+ key: "removeController",
535
+ value: function removeController(t) {
536
+ var _this__$EO;
537
+ (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.delete(t);
538
+ }
539
+ },
540
+ {
541
+ key: "_$E_",
542
+ value: function _$E_() {
543
+ var t = new Map, s = this.constructor.elementProperties;
544
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
545
+ try {
546
+ for(var _iterator = s.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
547
+ var i = _step.value;
548
+ this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
549
+ }
550
+ } catch (err) {
551
+ _didIteratorError = true;
552
+ _iteratorError = err;
553
+ } finally{
554
+ try {
555
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
556
+ _iterator.return();
557
+ }
558
+ } finally{
559
+ if (_didIteratorError) {
560
+ throw _iteratorError;
561
+ }
562
+ }
563
+ }
564
+ t.size > 0 && (this._$Ep = t);
565
+ }
566
+ },
567
+ {
568
+ key: "createRenderRoot",
569
+ value: function createRenderRoot() {
570
+ var _this_shadowRoot;
571
+ var t = (_this_shadowRoot = this.shadowRoot) !== null && _this_shadowRoot !== void 0 ? _this_shadowRoot : this.attachShadow(this.constructor.shadowRootOptions);
572
+ return S$1(t, this.constructor.elementStyles), t;
573
+ }
574
+ },
575
+ {
576
+ key: "connectedCallback",
577
+ value: function connectedCallback() {
578
+ var _this__$EO;
579
+ var _this_renderRoot;
580
+ (_this_renderRoot = this.renderRoot) !== null && _this_renderRoot !== void 0 ? _this_renderRoot : this.renderRoot = this.createRenderRoot(), this.enableUpdating(!0), (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
581
+ var _t_hostConnected;
582
+ return (_t_hostConnected = t.hostConnected) === null || _t_hostConnected === void 0 ? void 0 : _t_hostConnected.call(t);
583
+ });
584
+ }
585
+ },
586
+ {
587
+ key: "enableUpdating",
588
+ value: function enableUpdating(t) {}
589
+ },
590
+ {
591
+ key: "disconnectedCallback",
592
+ value: function disconnectedCallback() {
593
+ var _this__$EO;
594
+ (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
595
+ var _t_hostDisconnected;
596
+ return (_t_hostDisconnected = t.hostDisconnected) === null || _t_hostDisconnected === void 0 ? void 0 : _t_hostDisconnected.call(t);
597
+ });
598
+ }
599
+ },
600
+ {
601
+ key: "attributeChangedCallback",
602
+ value: function attributeChangedCallback(t, s, i) {
603
+ this._$AK(t, i);
604
+ }
605
+ },
606
+ {
607
+ key: "_$EC",
608
+ value: function _$EC(t, s) {
609
+ var i = this.constructor.elementProperties.get(t), e = this.constructor._$Eu(t, i);
610
+ if (void 0 !== e && !0 === i.reflect) {
611
+ var _i_converter;
612
+ var r = (void 0 !== ((_i_converter = i.converter) === null || _i_converter === void 0 ? void 0 : _i_converter.toAttribute) ? i.converter : u$1).toAttribute(s, i.type);
613
+ this._$Em = t, null == r ? this.removeAttribute(e) : this.setAttribute(e, r), this._$Em = null;
614
+ }
615
+ }
616
+ },
617
+ {
618
+ key: "_$AK",
619
+ value: function _$AK(t, s) {
620
+ var i = this.constructor, e = i._$Eh.get(t);
621
+ if (void 0 !== e && this._$Em !== e) {
622
+ var _t_converter;
623
+ var _$t = i.getPropertyOptions(e), r = "function" == typeof _$t.converter ? {
624
+ fromAttribute: _$t.converter
625
+ } : void 0 !== ((_t_converter = _$t.converter) === null || _t_converter === void 0 ? void 0 : _t_converter.fromAttribute) ? _$t.converter : u$1;
626
+ this._$Em = e, this[e] = r.fromAttribute(s, _$t.type), this._$Em = null;
627
+ }
628
+ }
629
+ },
630
+ {
631
+ key: "requestUpdate",
632
+ value: function requestUpdate(t, s, i) {
633
+ if (void 0 !== t) {
634
+ var _i_hasChanged;
635
+ if (i !== null && i !== void 0 ? i : i = this.constructor.getPropertyOptions(t), !((_i_hasChanged = i.hasChanged) !== null && _i_hasChanged !== void 0 ? _i_hasChanged : f$1)(this[t], s)) return;
636
+ this.P(t, s, i);
637
+ }
638
+ !1 === this.isUpdatePending && (this._$ES = this._$ET());
639
+ }
640
+ },
641
+ {
642
+ key: "P",
643
+ value: function P(t, s, i) {
644
+ var _this__$Ej;
645
+ this._$AL.has(t) || this._$AL.set(t, s), !0 === i.reflect && this._$Em !== t && ((_this__$Ej = this._$Ej) !== null && _this__$Ej !== void 0 ? _this__$Ej : this._$Ej = new Set).add(t);
646
+ }
647
+ },
648
+ {
649
+ key: "_$ET",
650
+ value: function _$ET() {
651
+ var _this = this;
652
+ return _async_to_generator(function() {
653
+ var t, _$t, _tmp;
654
+ return _ts_generator(this, function(_state) {
655
+ switch(_state.label){
656
+ case 0:
657
+ _this.isUpdatePending = !0;
658
+ _state.label = 1;
659
+ case 1:
660
+ _state.trys.push([
661
+ 1,
662
+ 3,
663
+ ,
664
+ 4
665
+ ]);
666
+ return [
667
+ 4,
668
+ _this._$ES
669
+ ];
670
+ case 2:
671
+ _state.sent();
672
+ return [
673
+ 3,
674
+ 4
675
+ ];
676
+ case 3:
677
+ t = _state.sent();
678
+ Promise.reject(t);
679
+ return [
680
+ 3,
681
+ 4
682
+ ];
683
+ case 4:
684
+ _$t = _this.scheduleUpdate();
685
+ _tmp = null != _$t;
686
+ if (!_tmp) return [
687
+ 3,
688
+ 6
689
+ ];
690
+ return [
691
+ 4,
692
+ _$t
693
+ ];
694
+ case 5:
695
+ _tmp = _state.sent();
696
+ _state.label = 6;
697
+ case 6:
698
+ return [
699
+ 2,
700
+ (!_this.isUpdatePending)
701
+ ];
702
+ }
703
+ });
704
+ })();
705
+ }
706
+ },
707
+ {
708
+ key: "scheduleUpdate",
709
+ value: function scheduleUpdate() {
710
+ return this.performUpdate();
711
+ }
712
+ },
713
+ {
714
+ key: "performUpdate",
715
+ value: function performUpdate() {
716
+ if (!this.isUpdatePending) return;
717
+ if (!this.hasUpdated) {
718
+ var _this_renderRoot;
719
+ if ((_this_renderRoot = this.renderRoot) !== null && _this_renderRoot !== void 0 ? _this_renderRoot : this.renderRoot = this.createRenderRoot(), this._$Ep) {
720
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
721
+ try {
722
+ for(var _iterator = this._$Ep[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
723
+ var _step_value = _sliced_to_array$1(_step.value, 2), t = _step_value[0], _$s = _step_value[1];
724
+ this[t] = _$s;
725
+ }
726
+ } catch (err) {
727
+ _didIteratorError = true;
728
+ _iteratorError = err;
729
+ } finally{
730
+ try {
731
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
732
+ _iterator.return();
733
+ }
734
+ } finally{
735
+ if (_didIteratorError) {
736
+ throw _iteratorError;
737
+ }
738
+ }
739
+ }
740
+ this._$Ep = void 0;
741
+ }
742
+ var t1 = this.constructor.elementProperties;
743
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
744
+ if (t1.size > 0) try {
745
+ for(var _iterator1 = t1[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
746
+ var _step_value1 = _sliced_to_array$1(_step1.value, 2), _$s1 = _step_value1[0], i = _step_value1[1];
747
+ !0 !== i.wrapped || this._$AL.has(_$s1) || void 0 === this[_$s1] || this.P(_$s1, this[_$s1], i);
748
+ }
749
+ } catch (err) {
750
+ _didIteratorError1 = true;
751
+ _iteratorError1 = err;
752
+ } finally{
753
+ try {
754
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
755
+ _iterator1.return();
756
+ }
757
+ } finally{
758
+ if (_didIteratorError1) {
759
+ throw _iteratorError1;
760
+ }
761
+ }
762
+ }
763
+ }
764
+ var t2 = !1;
765
+ var _$s2 = this._$AL;
766
+ try {
767
+ var _this__$EO;
768
+ t2 = this.shouldUpdate(_$s2), t2 ? (this.willUpdate(_$s2), (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
769
+ var _t_hostUpdate;
770
+ return (_t_hostUpdate = t.hostUpdate) === null || _t_hostUpdate === void 0 ? void 0 : _t_hostUpdate.call(t);
771
+ }), this.update(_$s2)) : this._$EU();
772
+ } catch (s) {
773
+ throw t2 = !1, this._$EU(), s;
774
+ }
775
+ t2 && this._$AE(_$s2);
776
+ }
777
+ },
778
+ {
779
+ key: "willUpdate",
780
+ value: function willUpdate(t) {}
781
+ },
782
+ {
783
+ key: "_$AE",
784
+ value: function _$AE(t) {
785
+ var _this__$EO;
786
+ (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
787
+ var _t_hostUpdated;
788
+ return (_t_hostUpdated = t.hostUpdated) === null || _t_hostUpdated === void 0 ? void 0 : _t_hostUpdated.call(t);
789
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
790
+ }
791
+ },
792
+ {
793
+ key: "_$EU",
794
+ value: function _$EU() {
795
+ this._$AL = new Map, this.isUpdatePending = !1;
796
+ }
797
+ },
798
+ {
799
+ key: "updateComplete",
800
+ get: function get() {
801
+ return this.getUpdateComplete();
802
+ }
803
+ },
804
+ {
805
+ key: "getUpdateComplete",
806
+ value: function getUpdateComplete() {
807
+ return this._$ES;
808
+ }
809
+ },
810
+ {
811
+ key: "shouldUpdate",
812
+ value: function shouldUpdate(t) {
813
+ return !0;
814
+ }
815
+ },
816
+ {
817
+ key: "update",
818
+ value: function update(t) {
819
+ var _this = this;
820
+ this._$Ej && (this._$Ej = this._$Ej.forEach(function(t) {
821
+ return _this._$EC(t, _this[t]);
822
+ })), this._$EU();
823
+ }
824
+ },
825
+ {
826
+ key: "updated",
827
+ value: function updated(t) {}
828
+ },
829
+ {
830
+ key: "firstUpdated",
831
+ value: function firstUpdated(t) {}
832
+ }
833
+ ], [
834
+ {
835
+ key: "addInitializer",
836
+ value: function addInitializer(t) {
837
+ var _this_l;
838
+ this._$Ei(), ((_this_l = this.l) !== null && _this_l !== void 0 ? _this_l : this.l = []).push(t);
839
+ }
840
+ },
841
+ {
842
+ key: "observedAttributes",
843
+ get: function get() {
844
+ return this.finalize(), this._$Eh && _to_consumable_array$1(this._$Eh.keys());
845
+ }
846
+ },
847
+ {
848
+ key: "createProperty",
849
+ value: function createProperty(t) {
850
+ var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : y$1;
851
+ if (s.state && (s.attribute = !1), this._$Ei(), this.elementProperties.set(t, s), !s.noAccessor) {
852
+ var i = Symbol(), r = this.getPropertyDescriptor(t, i, s);
853
+ void 0 !== r && e$1(this.prototype, t, r);
854
+ }
855
+ }
856
+ },
857
+ {
858
+ key: "getPropertyDescriptor",
859
+ value: function getPropertyDescriptor(t, s, i) {
860
+ var _r;
861
+ var _ref = (_r = r$4(this.prototype, t)) !== null && _r !== void 0 ? _r : {
862
+ get: function get() {
863
+ return this[s];
864
+ },
865
+ set: function set(t) {
866
+ this[s] = t;
867
+ }
868
+ }, e = _ref.get, h = _ref.set;
869
+ return {
870
+ get: function get() {
871
+ return e === null || e === void 0 ? void 0 : e.call(this);
872
+ },
873
+ set: function set(s) {
874
+ var r = e === null || e === void 0 ? void 0 : e.call(this);
875
+ h.call(this, s), this.requestUpdate(t, r, i);
876
+ },
877
+ configurable: !0,
878
+ enumerable: !0
879
+ };
880
+ }
881
+ },
882
+ {
883
+ key: "getPropertyOptions",
884
+ value: function getPropertyOptions(t) {
885
+ var _this_elementProperties_get;
886
+ return (_this_elementProperties_get = this.elementProperties.get(t)) !== null && _this_elementProperties_get !== void 0 ? _this_elementProperties_get : y$1;
887
+ }
888
+ },
889
+ {
890
+ key: "_$Ei",
891
+ value: function _$Ei() {
892
+ if (this.hasOwnProperty(d$1("elementProperties"))) return;
893
+ var t = n$2(this);
894
+ t.finalize(), void 0 !== t.l && (this.l = _to_consumable_array$1(t.l)), this.elementProperties = new Map(t.elementProperties);
895
+ }
896
+ },
897
+ {
898
+ key: "finalize",
899
+ value: function finalize() {
900
+ if (this.hasOwnProperty(d$1("finalized"))) return;
901
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
902
+ var t = this.properties, s = _to_consumable_array$1(h$1(t)).concat(_to_consumable_array$1(o$2(t)));
903
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
904
+ try {
905
+ for(var _iterator = s[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
906
+ var i = _step.value;
907
+ this.createProperty(i, t[i]);
908
+ }
909
+ } catch (err) {
910
+ _didIteratorError = true;
911
+ _iteratorError = err;
912
+ } finally{
913
+ try {
914
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
915
+ _iterator.return();
916
+ }
917
+ } finally{
918
+ if (_didIteratorError) {
919
+ throw _iteratorError;
920
+ }
921
+ }
922
+ }
923
+ }
924
+ var t1 = this[Symbol.metadata];
925
+ if (null !== t1) {
926
+ var s1 = litPropertyMetadata.get(t1);
927
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
928
+ if (void 0 !== s1) try {
929
+ for(var _iterator1 = s1[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
930
+ var _step_value = _sliced_to_array$1(_step1.value, 2), t2 = _step_value[0], i1 = _step_value[1];
931
+ this.elementProperties.set(t2, i1);
932
+ }
933
+ } catch (err) {
934
+ _didIteratorError1 = true;
935
+ _iteratorError1 = err;
936
+ } finally{
937
+ try {
938
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
939
+ _iterator1.return();
940
+ }
941
+ } finally{
942
+ if (_didIteratorError1) {
943
+ throw _iteratorError1;
944
+ }
945
+ }
946
+ }
947
+ }
948
+ this._$Eh = new Map;
949
+ var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
950
+ try {
951
+ for(var _iterator2 = this.elementProperties[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
952
+ var _step_value1 = _sliced_to_array$1(_step2.value, 2), t3 = _step_value1[0], s2 = _step_value1[1];
953
+ var i2 = this._$Eu(t3, s2);
954
+ void 0 !== i2 && this._$Eh.set(i2, t3);
955
+ }
956
+ } catch (err) {
957
+ _didIteratorError2 = true;
958
+ _iteratorError2 = err;
959
+ } finally{
960
+ try {
961
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
962
+ _iterator2.return();
963
+ }
964
+ } finally{
965
+ if (_didIteratorError2) {
966
+ throw _iteratorError2;
967
+ }
968
+ }
969
+ }
970
+ this.elementStyles = this.finalizeStyles(this.styles);
971
+ }
972
+ },
973
+ {
974
+ key: "finalizeStyles",
975
+ value: function finalizeStyles(s) {
976
+ var i = [];
977
+ if (Array.isArray(s)) {
978
+ var e = new Set(s.flat(1 / 0).reverse());
979
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
980
+ try {
981
+ for(var _iterator = e[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
982
+ var _$s = _step.value;
983
+ i.unshift(c$2(_$s));
984
+ }
985
+ } catch (err) {
986
+ _didIteratorError = true;
987
+ _iteratorError = err;
988
+ } finally{
989
+ try {
990
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
991
+ _iterator.return();
992
+ }
993
+ } finally{
994
+ if (_didIteratorError) {
995
+ throw _iteratorError;
996
+ }
997
+ }
998
+ }
999
+ } else void 0 !== s && i.push(c$2(s));
1000
+ return i;
1001
+ }
1002
+ },
1003
+ {
1004
+ key: "_$Eu",
1005
+ value: function _$Eu(t, s) {
1006
+ var i = s.attribute;
1007
+ return !1 === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
1008
+ }
1009
+ }
1010
+ ]);
1011
+ return b;
1012
+ }(_wrap_native_super(HTMLElement));
1013
+ var _reactiveElementVersions;
1014
+ b.elementStyles = [], b.shadowRootOptions = {
1015
+ mode: "open"
1016
+ }, b[d$1("elementProperties")] = new Map, b[d$1("finalized")] = new Map, p$1 === null || p$1 === void 0 ? void 0 : p$1({
1017
+ ReactiveElement: b
1018
+ }), ((_reactiveElementVersions = (_a1 = a$1).reactiveElementVersions) !== null && _reactiveElementVersions !== void 0 ? _reactiveElementVersions : _a1.reactiveElementVersions = []).push("2.0.4");
1019
+
1020
+ /**
1021
+ * @license
1022
+ * Copyright 2017 Google LLC
1023
+ * SPDX-License-Identifier: BSD-3-Clause
1024
+ */ function _array_like_to_array(arr, len) {
1025
+ if (len == null || len > arr.length) len = arr.length;
1026
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1027
+ return arr2;
1028
+ }
1029
+ function _array_with_holes(arr) {
1030
+ if (Array.isArray(arr)) return arr;
1031
+ }
1032
+ function _array_without_holes(arr) {
1033
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
1034
+ }
1035
+ function _assert_this_initialized$1(self) {
1036
+ if (self === void 0) {
1037
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1038
+ }
1039
+ return self;
1040
+ }
1041
+ function _class_call_check$1(instance, Constructor) {
1042
+ if (!(instance instanceof Constructor)) {
1043
+ throw new TypeError("Cannot call a class as a function");
1044
+ }
1045
+ }
1046
+ function _defineProperties$1(target, props) {
1047
+ for(var i = 0; i < props.length; i++){
1048
+ var descriptor = props[i];
1049
+ descriptor.enumerable = descriptor.enumerable || false;
1050
+ descriptor.configurable = true;
1051
+ if ("value" in descriptor) descriptor.writable = true;
1052
+ Object.defineProperty(target, descriptor.key, descriptor);
1053
+ }
1054
+ }
1055
+ function _create_class$1(Constructor, protoProps, staticProps) {
1056
+ if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
1057
+ if (staticProps) _defineProperties$1(Constructor, staticProps);
1058
+ return Constructor;
1059
+ }
1060
+ function _get_prototype_of$1(o) {
1061
+ _get_prototype_of$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
1062
+ return o.__proto__ || Object.getPrototypeOf(o);
1063
+ };
1064
+ return _get_prototype_of$1(o);
1065
+ }
1066
+ function _inherits$1(subClass, superClass) {
1067
+ if (typeof superClass !== "function" && superClass !== null) {
1068
+ throw new TypeError("Super expression must either be null or a function");
1069
+ }
1070
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
1071
+ constructor: {
1072
+ value: subClass,
1073
+ writable: true,
1074
+ configurable: true
1075
+ }
1076
+ });
1077
+ if (superClass) _set_prototype_of$1(subClass, superClass);
1078
+ }
1079
+ function _iterable_to_array(iter) {
1080
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1081
+ }
1082
+ function _iterable_to_array_limit(arr, i) {
1083
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
1084
+ if (_i == null) return;
1085
+ var _arr = [];
1086
+ var _n = true;
1087
+ var _d = false;
1088
+ var _s, _e;
1089
+ try {
1090
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
1091
+ _arr.push(_s.value);
1092
+ if (i && _arr.length === i) break;
1093
+ }
1094
+ } catch (err) {
1095
+ _d = true;
1096
+ _e = err;
1097
+ } finally{
1098
+ try {
1099
+ if (!_n && _i["return"] != null) _i["return"]();
1100
+ } finally{
1101
+ if (_d) throw _e;
1102
+ }
1103
+ }
1104
+ return _arr;
1105
+ }
1106
+ function _non_iterable_rest() {
1107
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1108
+ }
1109
+ function _non_iterable_spread() {
1110
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1111
+ }
1112
+ function _possible_constructor_return$1(self, call) {
1113
+ if (call && (_type_of$1(call) === "object" || typeof call === "function")) {
1114
+ return call;
1115
+ }
1116
+ return _assert_this_initialized$1(self);
1117
+ }
1118
+ function _set_prototype_of$1(o, p) {
1119
+ _set_prototype_of$1 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
1120
+ o.__proto__ = p;
1121
+ return o;
1122
+ };
1123
+ return _set_prototype_of$1(o, p);
1124
+ }
1125
+ function _sliced_to_array(arr, i) {
1126
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
1127
+ }
1128
+ function _to_consumable_array(arr) {
1129
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
1130
+ }
1131
+ function _type_of$1(obj) {
1132
+ "@swc/helpers - typeof";
1133
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1134
+ }
1135
+ function _unsupported_iterable_to_array(o, minLen) {
1136
+ if (!o) return;
1137
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
1138
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1139
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1140
+ if (n === "Map" || n === "Set") return Array.from(n);
1141
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
1142
+ }
1143
+ function _is_native_reflect_construct$1() {
1144
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
1145
+ if (Reflect.construct.sham) return false;
1146
+ if (typeof Proxy === "function") return true;
1147
+ try {
1148
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1149
+ return true;
1150
+ } catch (e) {
1151
+ return false;
1152
+ }
1153
+ }
1154
+ function _create_super$1(Derived) {
1155
+ var hasNativeReflectConstruct = _is_native_reflect_construct$1();
1156
+ return function _createSuperInternal() {
1157
+ var Super = _get_prototype_of$1(Derived), result;
1158
+ if (hasNativeReflectConstruct) {
1159
+ var NewTarget = _get_prototype_of$1(this).constructor;
1160
+ result = Reflect.construct(Super, arguments, NewTarget);
1161
+ } else {
1162
+ result = Super.apply(this, arguments);
1163
+ }
1164
+ return _possible_constructor_return$1(this, result);
1165
+ };
1166
+ }
1167
+ var _t;
1168
+ var t$1 = globalThis, i = t$1.trustedTypes, s$1 = i ? i.createPolicy("lit-html", {
1169
+ createHTML: function(t) {
1170
+ return t;
1171
+ }
1172
+ }) : void 0, e = "$lit$", h = "lit$".concat((Math.random() + "").slice(9), "$"), o$1 = "?" + h, n$1 = "<".concat(o$1, ">"), r$3 = document, l = function() {
1173
+ return r$3.createComment("");
1174
+ }, c = function(t) {
1175
+ return null === t || "object" != typeof t && "function" != typeof t;
1176
+ }, a = Array.isArray, u = function(t) {
1177
+ return a(t) || "function" == typeof (t === null || t === void 0 ? void 0 : t[Symbol.iterator]);
1178
+ }, d = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(">|".concat(d, "(?:([^\\s\"'>=/]+)(").concat(d, "*=").concat(d, "*(?:[^ \n\f\r\"'`<>=]|(\"|')|))|$)"), "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y = function(t) {
1179
+ return function(i) {
1180
+ for(var _len = arguments.length, s = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
1181
+ s[_key - 1] = arguments[_key];
1182
+ }
1183
+ return {
1184
+ _$litType$: t,
1185
+ strings: i,
1186
+ values: s
1187
+ };
1188
+ };
1189
+ }, x = y(1), w = Symbol.for("lit-noChange"), T = Symbol.for("lit-nothing"), A = new WeakMap, E = r$3.createTreeWalker(r$3, 129);
1190
+ function C(t, i) {
1191
+ if (!Array.isArray(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
1192
+ return void 0 !== s$1 ? s$1.createHTML(i) : i;
1193
+ }
1194
+ var P = function(t, i) {
1195
+ var s = t.length - 1, o = [];
1196
+ var r, l = 2 === i ? "<svg>" : "", c = f;
1197
+ for(var _$i = 0; _$i < s; _$i++){
1198
+ var s1 = t[_$i];
1199
+ var a = void 0, u = void 0, d = -1, y = 0;
1200
+ for(; y < s1.length && (c.lastIndex = y, u = c.exec(s1), null !== u);)y = c.lastIndex, c === f ? "!--" === u[1] ? c = v : void 0 !== u[1] ? c = _ : void 0 !== u[2] ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m) : void 0 !== u[3] && (c = m) : c === m ? ">" === u[0] ? (c = r !== null && r !== void 0 ? r : f, d = -1) : void 0 === u[1] ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = void 0 === u[3] ? m : '"' === u[3] ? g : p) : c === g || c === p ? c = m : c === v || c === _ ? c = f : (c = m, r = void 0);
1201
+ var x = c === m && t[_$i + 1].startsWith("/>") ? " " : "";
1202
+ l += c === f ? s1 + n$1 : d >= 0 ? (o.push(a), s1.slice(0, d) + e + s1.slice(d) + h + x) : s1 + h + (-2 === d ? _$i : x);
1203
+ }
1204
+ return [
1205
+ C(t, l + (t[s] || "<?>") + (2 === i ? "</svg>" : "")),
1206
+ o
1207
+ ];
1208
+ };
1209
+ var V = /*#__PURE__*/ function() {
1210
+ function V(param, n) {
1211
+ var t = param.strings, s = param._$litType$;
1212
+ _class_call_check$1(this, V);
1213
+ var r;
1214
+ this.parts = [];
1215
+ var c = 0, a = 0;
1216
+ var u = t.length - 1, d = this.parts, _P = _sliced_to_array(P(t, s), 2), f = _P[0], v = _P[1];
1217
+ if (this.el = V.createElement(f, n), E.currentNode = this.el.content, 2 === s) {
1218
+ var _t;
1219
+ var t1 = this.el.content.firstChild;
1220
+ (_t = t1).replaceWith.apply(_t, _to_consumable_array(t1.childNodes));
1221
+ }
1222
+ for(; null !== (r = E.nextNode()) && d.length < u;){
1223
+ if (1 === r.nodeType) {
1224
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1225
+ if (r.hasAttributes()) try {
1226
+ for(var _iterator = r.getAttributeNames()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1227
+ var t2 = _step.value;
1228
+ if (t2.endsWith(e)) {
1229
+ var i1 = v[a++], s1 = r.getAttribute(t2).split(h), e1 = /([.?@])?(.*)/.exec(i1);
1230
+ d.push({
1231
+ type: 1,
1232
+ index: c,
1233
+ name: e1[2],
1234
+ strings: s1,
1235
+ ctor: "." === e1[1] ? k : "?" === e1[1] ? H : "@" === e1[1] ? I : R
1236
+ }), r.removeAttribute(t2);
1237
+ } else t2.startsWith(h) && (d.push({
1238
+ type: 6,
1239
+ index: c
1240
+ }), r.removeAttribute(t2));
1241
+ }
1242
+ } catch (err) {
1243
+ _didIteratorError = true;
1244
+ _iteratorError = err;
1245
+ } finally{
1246
+ try {
1247
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1248
+ _iterator.return();
1249
+ }
1250
+ } finally{
1251
+ if (_didIteratorError) {
1252
+ throw _iteratorError;
1253
+ }
1254
+ }
1255
+ }
1256
+ if ($.test(r.tagName)) {
1257
+ var t3 = r.textContent.split(h), s2 = t3.length - 1;
1258
+ if (s2 > 0) {
1259
+ r.textContent = i ? i.emptyScript : "";
1260
+ for(var i2 = 0; i2 < s2; i2++)r.append(t3[i2], l()), E.nextNode(), d.push({
1261
+ type: 2,
1262
+ index: ++c
1263
+ });
1264
+ r.append(t3[s2], l());
1265
+ }
1266
+ }
1267
+ } else if (8 === r.nodeType) if (r.data === o$1) d.push({
1268
+ type: 2,
1269
+ index: c
1270
+ });
1271
+ else {
1272
+ var t4 = -1;
1273
+ for(; -1 !== (t4 = r.data.indexOf(h, t4 + 1));)d.push({
1274
+ type: 7,
1275
+ index: c
1276
+ }), t4 += h.length - 1;
1277
+ }
1278
+ c++;
1279
+ }
1280
+ }
1281
+ _create_class$1(V, null, [
1282
+ {
1283
+ key: "createElement",
1284
+ value: function createElement(t, i) {
1285
+ var s = r$3.createElement("template");
1286
+ return s.innerHTML = t, s;
1287
+ }
1288
+ }
1289
+ ]);
1290
+ return V;
1291
+ }();
1292
+ function N(t, i) {
1293
+ var s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t, e = arguments.length > 3 ? arguments[3] : void 0;
1294
+ var _s__$Co, _h__$AO;
1295
+ var _s;
1296
+ if (i === w) return i;
1297
+ var h = void 0 !== e ? (_s__$Co = s._$Co) === null || _s__$Co === void 0 ? void 0 : _s__$Co[e] : s._$Cl;
1298
+ var o = c(i) ? void 0 : i._$litDirective$;
1299
+ var __$Co;
1300
+ return (h === null || h === void 0 ? void 0 : h.constructor) !== o && (h === null || h === void 0 ? void 0 : (_h__$AO = h._$AO) === null || _h__$AO === void 0 ? void 0 : _h__$AO.call(h, !1), void 0 === o ? h = void 0 : (h = new o(t), h._$AT(t, s, e)), void 0 !== e ? ((__$Co = (_s = s)._$Co) !== null && __$Co !== void 0 ? __$Co : _s._$Co = [])[e] = h : s._$Cl = h), void 0 !== h && (i = N(t, h._$AS(t, i.values), h, e)), i;
1301
+ }
1302
+ var S = /*#__PURE__*/ function() {
1303
+ function S(t, i) {
1304
+ _class_call_check$1(this, S);
1305
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = i;
1306
+ }
1307
+ _create_class$1(S, [
1308
+ {
1309
+ key: "parentNode",
1310
+ get: function get() {
1311
+ return this._$AM.parentNode;
1312
+ }
1313
+ },
1314
+ {
1315
+ key: "_$AU",
1316
+ get: function get() {
1317
+ return this._$AM._$AU;
1318
+ }
1319
+ },
1320
+ {
1321
+ key: "u",
1322
+ value: function u(t) {
1323
+ var _t_creationScope;
1324
+ var _this__$AD = this._$AD, _this__$AD_el = _this__$AD.el, i = _this__$AD_el.content, s = _this__$AD.parts, e = ((_t_creationScope = t === null || t === void 0 ? void 0 : t.creationScope) !== null && _t_creationScope !== void 0 ? _t_creationScope : r$3).importNode(i, !0);
1325
+ E.currentNode = e;
1326
+ var h = E.nextNode(), o = 0, n = 0, l = s[0];
1327
+ for(; void 0 !== l;){
1328
+ if (o === l.index) {
1329
+ var i1 = void 0;
1330
+ 2 === l.type ? i1 = new M(h, h.nextSibling, this, t) : 1 === l.type ? i1 = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i1 = new L(h, this, t)), this._$AV.push(i1), l = s[++n];
1331
+ }
1332
+ o !== (l === null || l === void 0 ? void 0 : l.index) && (h = E.nextNode(), o++);
1333
+ }
1334
+ return E.currentNode = r$3, e;
1335
+ }
1336
+ },
1337
+ {
1338
+ key: "p",
1339
+ value: function p(t) {
1340
+ var i = 0;
1341
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1342
+ try {
1343
+ for(var _iterator = this._$AV[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1344
+ var s = _step.value;
1345
+ void 0 !== s && (void 0 !== s.strings ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
1346
+ }
1347
+ } catch (err) {
1348
+ _didIteratorError = true;
1349
+ _iteratorError = err;
1350
+ } finally{
1351
+ try {
1352
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1353
+ _iterator.return();
1354
+ }
1355
+ } finally{
1356
+ if (_didIteratorError) {
1357
+ throw _iteratorError;
1358
+ }
1359
+ }
1360
+ }
1361
+ }
1362
+ }
1363
+ ]);
1364
+ return S;
1365
+ }();
1366
+ var M = /*#__PURE__*/ function() {
1367
+ function M(t, i, s, e) {
1368
+ _class_call_check$1(this, M);
1369
+ var _e_isConnected;
1370
+ this.type = 2, this._$AH = T, this._$AN = void 0, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = (_e_isConnected = e === null || e === void 0 ? void 0 : e.isConnected) !== null && _e_isConnected !== void 0 ? _e_isConnected : !0;
1371
+ }
1372
+ _create_class$1(M, [
1373
+ {
1374
+ key: "_$AU",
1375
+ get: function get() {
1376
+ var _this__$AM;
1377
+ var _this__$AM__$AU;
1378
+ return (_this__$AM__$AU = (_this__$AM = this._$AM) === null || _this__$AM === void 0 ? void 0 : _this__$AM._$AU) !== null && _this__$AM__$AU !== void 0 ? _this__$AM__$AU : this._$Cv;
1379
+ }
1380
+ },
1381
+ {
1382
+ key: "parentNode",
1383
+ get: function get() {
1384
+ var t = this._$AA.parentNode;
1385
+ var i = this._$AM;
1386
+ return void 0 !== i && 11 === (t === null || t === void 0 ? void 0 : t.nodeType) && (t = i.parentNode), t;
1387
+ }
1388
+ },
1389
+ {
1390
+ key: "startNode",
1391
+ get: function get() {
1392
+ return this._$AA;
1393
+ }
1394
+ },
1395
+ {
1396
+ key: "endNode",
1397
+ get: function get() {
1398
+ return this._$AB;
1399
+ }
1400
+ },
1401
+ {
1402
+ key: "_$AI",
1403
+ value: function _$AI(t) {
1404
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this;
1405
+ t = N(this, t, i), c(t) ? t === T || null == t || "" === t ? (this._$AH !== T && this._$AR(), this._$AH = T) : t !== this._$AH && t !== w && this._(t) : void 0 !== t._$litType$ ? this.$(t) : void 0 !== t.nodeType ? this.T(t) : u(t) ? this.k(t) : this._(t);
1406
+ }
1407
+ },
1408
+ {
1409
+ key: "S",
1410
+ value: function S(t) {
1411
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
1412
+ }
1413
+ },
1414
+ {
1415
+ key: "T",
1416
+ value: function T(t) {
1417
+ this._$AH !== t && (this._$AR(), this._$AH = this.S(t));
1418
+ }
1419
+ },
1420
+ {
1421
+ key: "_",
1422
+ value: function _(t) {
1423
+ this._$AH !== T && c(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r$3.createTextNode(t)), this._$AH = t;
1424
+ }
1425
+ },
1426
+ {
1427
+ key: "$",
1428
+ value: function $(t) {
1429
+ var _this__$AH;
1430
+ var i = t.values, s = t._$litType$, e = "number" == typeof s ? this._$AC(t) : (void 0 === s.el && (s.el = V.createElement(C(s.h, s.h[0]), this.options)), s);
1431
+ if (((_this__$AH = this._$AH) === null || _this__$AH === void 0 ? void 0 : _this__$AH._$AD) === e) this._$AH.p(i);
1432
+ else {
1433
+ var _$t = new S(e, this), s1 = _$t.u(this.options);
1434
+ _$t.p(i), this.T(s1), this._$AH = _$t;
1435
+ }
1436
+ }
1437
+ },
1438
+ {
1439
+ key: "_$AC",
1440
+ value: function _$AC(t) {
1441
+ var i = A.get(t.strings);
1442
+ return void 0 === i && A.set(t.strings, i = new V(t)), i;
1443
+ }
1444
+ },
1445
+ {
1446
+ key: "k",
1447
+ value: function k(t) {
1448
+ a(this._$AH) || (this._$AH = [], this._$AR());
1449
+ var i = this._$AH;
1450
+ var s, e = 0;
1451
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1452
+ try {
1453
+ for(var _iterator = t[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1454
+ var h = _step.value;
1455
+ e === i.length ? i.push(s = new M(this.S(l()), this.S(l()), this, this.options)) : s = i[e], s._$AI(h), e++;
1456
+ }
1457
+ } catch (err) {
1458
+ _didIteratorError = true;
1459
+ _iteratorError = err;
1460
+ } finally{
1461
+ try {
1462
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1463
+ _iterator.return();
1464
+ }
1465
+ } finally{
1466
+ if (_didIteratorError) {
1467
+ throw _iteratorError;
1468
+ }
1469
+ }
1470
+ }
1471
+ e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
1472
+ }
1473
+ },
1474
+ {
1475
+ key: "_$AR",
1476
+ value: function _$AR() {
1477
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this._$AA.nextSibling, i = arguments.length > 1 ? arguments[1] : void 0;
1478
+ var _this__$AP, _this;
1479
+ for((_this__$AP = (_this = this)._$AP) === null || _this__$AP === void 0 ? void 0 : _this__$AP.call(_this, !1, !0, i); t && t !== this._$AB;){
1480
+ var i1 = t.nextSibling;
1481
+ t.remove(), t = i1;
1482
+ }
1483
+ }
1484
+ },
1485
+ {
1486
+ key: "setConnected",
1487
+ value: function setConnected(t) {
1488
+ var _this__$AP, _this;
1489
+ void 0 === this._$AM && (this._$Cv = t, (_this__$AP = (_this = this)._$AP) === null || _this__$AP === void 0 ? void 0 : _this__$AP.call(_this, t));
1490
+ }
1491
+ }
1492
+ ]);
1493
+ return M;
1494
+ }();
1495
+ var R = /*#__PURE__*/ function() {
1496
+ function R(t, i, s, e, h) {
1497
+ _class_call_check$1(this, R);
1498
+ this.type = 1, this._$AH = T, this._$AN = void 0, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || "" !== s[0] || "" !== s[1] ? (this._$AH = Array(s.length - 1).fill(new String), this.strings = s) : this._$AH = T;
1499
+ }
1500
+ _create_class$1(R, [
1501
+ {
1502
+ key: "tagName",
1503
+ get: function get() {
1504
+ return this.element.tagName;
1505
+ }
1506
+ },
1507
+ {
1508
+ key: "_$AU",
1509
+ get: function get() {
1510
+ return this._$AM._$AU;
1511
+ }
1512
+ },
1513
+ {
1514
+ key: "_$AI",
1515
+ value: function _$AI(t) {
1516
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this, s = arguments.length > 2 ? arguments[2] : void 0, e = arguments.length > 3 ? arguments[3] : void 0;
1517
+ var h = this.strings;
1518
+ var o = !1;
1519
+ if (void 0 === h) t = N(this, t, i, 0), o = !c(t) || t !== this._$AH && t !== w, o && (this._$AH = t);
1520
+ else {
1521
+ var e1 = t;
1522
+ var n, r;
1523
+ for(t = h[0], n = 0; n < h.length - 1; n++)r = N(this, e1[s + n], i, n), r === w && (r = this._$AH[n]), o || (o = !c(r) || r !== this._$AH[n]), r === T ? t = T : t !== T && (t += (r !== null && r !== void 0 ? r : "") + h[n + 1]), this._$AH[n] = r;
1524
+ }
1525
+ o && !e && this.j(t);
1526
+ }
1527
+ },
1528
+ {
1529
+ key: "j",
1530
+ value: function j(t) {
1531
+ t === T ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t !== null && t !== void 0 ? t : "");
1532
+ }
1533
+ }
1534
+ ]);
1535
+ return R;
1536
+ }();
1537
+ var k = /*#__PURE__*/ function(R) {
1538
+ _inherits$1(k, R);
1539
+ var _super = _create_super$1(k);
1540
+ function k() {
1541
+ _class_call_check$1(this, k);
1542
+ var _this;
1543
+ _this = _super.call.apply(_super, [
1544
+ this
1545
+ ].concat(Array.prototype.slice.call(arguments))), _this.type = 3;
1546
+ return _possible_constructor_return$1(_this);
1547
+ }
1548
+ _create_class$1(k, [
1549
+ {
1550
+ key: "j",
1551
+ value: function j(t) {
1552
+ this.element[this.name] = t === T ? void 0 : t;
1553
+ }
1554
+ }
1555
+ ]);
1556
+ return k;
1557
+ }(R);
1558
+ var H = /*#__PURE__*/ function(R) {
1559
+ _inherits$1(H, R);
1560
+ var _super = _create_super$1(H);
1561
+ function H() {
1562
+ _class_call_check$1(this, H);
1563
+ var _this;
1564
+ _this = _super.call.apply(_super, [
1565
+ this
1566
+ ].concat(Array.prototype.slice.call(arguments))), _this.type = 4;
1567
+ return _possible_constructor_return$1(_this);
1568
+ }
1569
+ _create_class$1(H, [
1570
+ {
1571
+ key: "j",
1572
+ value: function j(t) {
1573
+ this.element.toggleAttribute(this.name, !!t && t !== T);
1574
+ }
1575
+ }
1576
+ ]);
1577
+ return H;
1578
+ }(R);
1579
+ var I = /*#__PURE__*/ function(R) {
1580
+ _inherits$1(I, R);
1581
+ var _super = _create_super$1(I);
1582
+ function I(t, i, s, e, h) {
1583
+ _class_call_check$1(this, I);
1584
+ var _this;
1585
+ _this = _super.call(this, t, i, s, e, h), _this.type = 5;
1586
+ return _possible_constructor_return$1(_this);
1587
+ }
1588
+ _create_class$1(I, [
1589
+ {
1590
+ key: "_$AI",
1591
+ value: function _$AI(t) {
1592
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this;
1593
+ var _N;
1594
+ if ((t = (_N = N(this, t, i, 0)) !== null && _N !== void 0 ? _N : T) === w) return;
1595
+ var s = this._$AH, e = t === T && s !== T || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, h = t !== T && (s === T || e);
1596
+ e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
1597
+ }
1598
+ },
1599
+ {
1600
+ key: "handleEvent",
1601
+ value: function handleEvent(t) {
1602
+ var _this_options;
1603
+ var _this_options_host;
1604
+ "function" == typeof this._$AH ? this._$AH.call((_this_options_host = (_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.host) !== null && _this_options_host !== void 0 ? _this_options_host : this.element, t) : this._$AH.handleEvent(t);
1605
+ }
1606
+ }
1607
+ ]);
1608
+ return I;
1609
+ }(R);
1610
+ var L = /*#__PURE__*/ function() {
1611
+ function L(t, i, s) {
1612
+ _class_call_check$1(this, L);
1613
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = s;
1614
+ }
1615
+ _create_class$1(L, [
1616
+ {
1617
+ key: "_$AU",
1618
+ get: function get() {
1619
+ return this._$AM._$AU;
1620
+ }
1621
+ },
1622
+ {
1623
+ key: "_$AI",
1624
+ value: function _$AI(t) {
1625
+ N(this, t);
1626
+ }
1627
+ }
1628
+ ]);
1629
+ return L;
1630
+ }();
1631
+ var Z = t$1.litHtmlPolyfillSupport;
1632
+ var _litHtmlVersions;
1633
+ Z === null || Z === void 0 ? void 0 : Z(V, M), ((_litHtmlVersions = (_t = t$1).litHtmlVersions) !== null && _litHtmlVersions !== void 0 ? _litHtmlVersions : _t.litHtmlVersions = []).push("3.1.2");
1634
+ var j = function(t, i, s) {
1635
+ var _s_renderBefore;
1636
+ var e = (_s_renderBefore = s === null || s === void 0 ? void 0 : s.renderBefore) !== null && _s_renderBefore !== void 0 ? _s_renderBefore : i;
1637
+ var h = e._$litPart$;
1638
+ if (void 0 === h) {
1639
+ var _s_renderBefore1;
1640
+ var _$t = (_s_renderBefore1 = s === null || s === void 0 ? void 0 : s.renderBefore) !== null && _s_renderBefore1 !== void 0 ? _s_renderBefore1 : null;
1641
+ e._$litPart$ = h = new M(i.insertBefore(l(), _$t), _$t, void 0, s !== null && s !== void 0 ? s : {});
1642
+ }
1643
+ return h._$AI(t), h;
1644
+ };
1645
+
1646
+ function _assert_this_initialized(self) {
1647
+ if (self === void 0) {
1648
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1649
+ }
1650
+ return self;
1651
+ }
1652
+ function _class_call_check(instance, Constructor) {
1653
+ if (!(instance instanceof Constructor)) {
1654
+ throw new TypeError("Cannot call a class as a function");
1655
+ }
1656
+ }
1657
+ function _defineProperties(target, props) {
1658
+ for(var i = 0; i < props.length; i++){
1659
+ var descriptor = props[i];
1660
+ descriptor.enumerable = descriptor.enumerable || false;
1661
+ descriptor.configurable = true;
1662
+ if ("value" in descriptor) descriptor.writable = true;
1663
+ Object.defineProperty(target, descriptor.key, descriptor);
1664
+ }
1665
+ }
1666
+ function _create_class(Constructor, protoProps, staticProps) {
1667
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
1668
+ if (staticProps) _defineProperties(Constructor, staticProps);
1669
+ return Constructor;
1670
+ }
1671
+ function _get(target, property, receiver) {
1672
+ if (typeof Reflect !== "undefined" && Reflect.get) {
1673
+ _get = Reflect.get;
1674
+ } else {
1675
+ _get = function get(target, property, receiver) {
1676
+ var base = _super_prop_base(target, property);
1677
+ if (!base) return;
1678
+ var desc = Object.getOwnPropertyDescriptor(base, property);
1679
+ if (desc.get) {
1680
+ return desc.get.call(receiver || target);
1681
+ }
1682
+ return desc.value;
1683
+ };
1684
+ }
1685
+ return _get(target, property, receiver || target);
1686
+ }
1687
+ function _get_prototype_of(o) {
1688
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
1689
+ return o.__proto__ || Object.getPrototypeOf(o);
1690
+ };
1691
+ return _get_prototype_of(o);
1692
+ }
1693
+ function _inherits(subClass, superClass) {
1694
+ if (typeof superClass !== "function" && superClass !== null) {
1695
+ throw new TypeError("Super expression must either be null or a function");
1696
+ }
1697
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
1698
+ constructor: {
1699
+ value: subClass,
1700
+ writable: true,
1701
+ configurable: true
1702
+ }
1703
+ });
1704
+ if (superClass) _set_prototype_of(subClass, superClass);
1705
+ }
1706
+ function _possible_constructor_return(self, call) {
1707
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
1708
+ return call;
1709
+ }
1710
+ return _assert_this_initialized(self);
1711
+ }
1712
+ function _set_prototype_of(o, p) {
1713
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
1714
+ o.__proto__ = p;
1715
+ return o;
1716
+ };
1717
+ return _set_prototype_of(o, p);
1718
+ }
1719
+ function _super_prop_base(object, property) {
1720
+ while(!Object.prototype.hasOwnProperty.call(object, property)){
1721
+ object = _get_prototype_of(object);
1722
+ if (object === null) break;
1723
+ }
1724
+ return object;
1725
+ }
1726
+ function _type_of(obj) {
1727
+ "@swc/helpers - typeof";
1728
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1729
+ }
1730
+ function _is_native_reflect_construct() {
1731
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
1732
+ if (Reflect.construct.sham) return false;
1733
+ if (typeof Proxy === "function") return true;
1734
+ try {
1735
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1736
+ return true;
1737
+ } catch (e) {
1738
+ return false;
1739
+ }
1740
+ }
1741
+ function _create_super(Derived) {
1742
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
1743
+ return function _createSuperInternal() {
1744
+ var Super = _get_prototype_of(Derived), result;
1745
+ if (hasNativeReflectConstruct) {
1746
+ var NewTarget = _get_prototype_of(this).constructor;
1747
+ result = Reflect.construct(Super, arguments, NewTarget);
1748
+ } else {
1749
+ result = Super.apply(this, arguments);
1750
+ }
1751
+ return _possible_constructor_return(this, result);
1752
+ };
1753
+ }
1754
+ var _globalThis_litElementHydrateSupport, _globalThis;
1755
+ var _globalThis1;
1756
+ /**
1757
+ * @license
1758
+ * Copyright 2017 Google LLC
1759
+ * SPDX-License-Identifier: BSD-3-Clause
1760
+ */ var s = /*#__PURE__*/ function(t) {
1761
+ _inherits(s, t);
1762
+ var _super = _create_super(s);
1763
+ function s() {
1764
+ _class_call_check(this, s);
1765
+ var _this;
1766
+ _this = _super.call.apply(_super, [
1767
+ this
1768
+ ].concat(Array.prototype.slice.call(arguments))), _this.renderOptions = {
1769
+ host: _assert_this_initialized(_this)
1770
+ }, _this._$Do = void 0;
1771
+ return _possible_constructor_return(_this);
1772
+ }
1773
+ _create_class(s, [
1774
+ {
1775
+ key: "createRenderRoot",
1776
+ value: function createRenderRoot() {
1777
+ var _this_renderOptions;
1778
+ var _$t = _get(_get_prototype_of(s.prototype), "createRenderRoot", this).call(this);
1779
+ var _renderBefore;
1780
+ return (_renderBefore = (_this_renderOptions = this.renderOptions).renderBefore) !== null && _renderBefore !== void 0 ? _renderBefore : _this_renderOptions.renderBefore = _$t.firstChild, _$t;
1781
+ }
1782
+ },
1783
+ {
1784
+ key: "update",
1785
+ value: function update(t) {
1786
+ var i = this.render();
1787
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), _get(_get_prototype_of(s.prototype), "update", this).call(this, t), this._$Do = j(i, this.renderRoot, this.renderOptions);
1788
+ }
1789
+ },
1790
+ {
1791
+ key: "connectedCallback",
1792
+ value: function connectedCallback() {
1793
+ var _this__$Do;
1794
+ _get(_get_prototype_of(s.prototype), "connectedCallback", this).call(this), (_this__$Do = this._$Do) === null || _this__$Do === void 0 ? void 0 : _this__$Do.setConnected(!0);
1795
+ }
1796
+ },
1797
+ {
1798
+ key: "disconnectedCallback",
1799
+ value: function disconnectedCallback() {
1800
+ var _this__$Do;
1801
+ _get(_get_prototype_of(s.prototype), "disconnectedCallback", this).call(this), (_this__$Do = this._$Do) === null || _this__$Do === void 0 ? void 0 : _this__$Do.setConnected(!1);
1802
+ }
1803
+ },
1804
+ {
1805
+ key: "render",
1806
+ value: function render() {
1807
+ return w;
1808
+ }
1809
+ }
1810
+ ]);
1811
+ return s;
1812
+ }(b);
1813
+ s._$litElement$ = !0, s["finalized"] = !0, (_globalThis_litElementHydrateSupport = (_globalThis = globalThis).litElementHydrateSupport) === null || _globalThis_litElementHydrateSupport === void 0 ? void 0 : _globalThis_litElementHydrateSupport.call(_globalThis, {
1814
+ LitElement: s
1815
+ });
1816
+ var r$2 = globalThis.litElementPolyfillSupport;
1817
+ r$2 === null || r$2 === void 0 ? void 0 : r$2({
1818
+ LitElement: s
1819
+ });
1820
+ var _litElementVersions;
1821
+ ((_litElementVersions = (_globalThis1 = globalThis).litElementVersions) !== null && _litElementVersions !== void 0 ? _litElementVersions : _globalThis1.litElementVersions = []).push("4.0.4");
1822
+
1823
+ /**
1824
+ * @license
1825
+ * Copyright 2017 Google LLC
1826
+ * SPDX-License-Identifier: BSD-3-Clause
1827
+ */ var t = function(t) {
1828
+ return function(e, o) {
1829
+ void 0 !== o ? o.addInitializer(function() {
1830
+ customElements.define(t, e);
1831
+ }) : customElements.define(t, e);
1832
+ };
1833
+ };
1834
+
1835
+ function _define_property$1(obj, key, value) {
1836
+ if (key in obj) {
1837
+ Object.defineProperty(obj, key, {
1838
+ value: value,
1839
+ enumerable: true,
1840
+ configurable: true,
1841
+ writable: true
1842
+ });
1843
+ } else {
1844
+ obj[key] = value;
1845
+ }
1846
+ return obj;
1847
+ }
1848
+ function _object_spread$1(target) {
1849
+ for(var i = 1; i < arguments.length; i++){
1850
+ var source = arguments[i] != null ? arguments[i] : {};
1851
+ var ownKeys = Object.keys(source);
1852
+ if (typeof Object.getOwnPropertySymbols === "function") {
1853
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1854
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1855
+ }));
1856
+ }
1857
+ ownKeys.forEach(function(key) {
1858
+ _define_property$1(target, key, source[key]);
1859
+ });
1860
+ }
1861
+ return target;
1862
+ }
1863
+ function ownKeys$1(object, enumerableOnly) {
1864
+ var keys = Object.keys(object);
1865
+ if (Object.getOwnPropertySymbols) {
1866
+ var symbols = Object.getOwnPropertySymbols(object);
1867
+ if (enumerableOnly) {
1868
+ symbols = symbols.filter(function(sym) {
1869
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1870
+ });
1871
+ }
1872
+ keys.push.apply(keys, symbols);
1873
+ }
1874
+ return keys;
1875
+ }
1876
+ function _object_spread_props$1(target, source) {
1877
+ source = source != null ? source : {};
1878
+ if (Object.getOwnPropertyDescriptors) {
1879
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1880
+ } else {
1881
+ ownKeys$1(Object(source)).forEach(function(key) {
1882
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1883
+ });
1884
+ }
1885
+ return target;
1886
+ }
1887
+ /**
1888
+ * @license
1889
+ * Copyright 2017 Google LLC
1890
+ * SPDX-License-Identifier: BSD-3-Clause
1891
+ */ var o = {
1892
+ attribute: !0,
1893
+ type: String,
1894
+ converter: u$1,
1895
+ reflect: !1,
1896
+ hasChanged: f$1
1897
+ }, r$1 = function() {
1898
+ var _$t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : o, _$e = arguments.length > 1 ? arguments[1] : void 0, r = arguments.length > 2 ? arguments[2] : void 0;
1899
+ var n = r.kind, i = r.metadata;
1900
+ var s = globalThis.litPropertyMetadata.get(i);
1901
+ if (void 0 === s && globalThis.litPropertyMetadata.set(i, s = new Map), s.set(r.name, _$t), "accessor" === n) {
1902
+ var o1 = r.name;
1903
+ return {
1904
+ set: function set(r) {
1905
+ var n = _$e.get.call(this);
1906
+ _$e.set.call(this, r), this.requestUpdate(o1, n, _$t);
1907
+ },
1908
+ init: function init(e) {
1909
+ return void 0 !== e && this.P(o1, void 0, _$t), e;
1910
+ }
1911
+ };
1912
+ }
1913
+ if ("setter" === n) {
1914
+ var o2 = r.name;
1915
+ return function r(r) {
1916
+ var n = this[o2];
1917
+ _$e.call(this, r), this.requestUpdate(o2, n, _$t);
1918
+ };
1919
+ }
1920
+ throw Error("Unsupported decorator location: " + n);
1921
+ };
1922
+ function n(t) {
1923
+ return function(e, o) {
1924
+ return "object" == typeof o ? r$1(t, e, o) : function(t, e, o) {
1925
+ var r = e.hasOwnProperty(o);
1926
+ return e.constructor.createProperty(o, r ? _object_spread_props$1(_object_spread$1({}, t), {
1927
+ wrapped: !0
1928
+ }) : t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
1929
+ }(t, e, o);
1930
+ };
1931
+ }
1932
+
1933
+ function _define_property(obj, key, value) {
1934
+ if (key in obj) {
1935
+ Object.defineProperty(obj, key, {
1936
+ value: value,
1937
+ enumerable: true,
1938
+ configurable: true,
1939
+ writable: true
1940
+ });
1941
+ } else {
1942
+ obj[key] = value;
1943
+ }
1944
+ return obj;
1945
+ }
1946
+ function _object_spread(target) {
1947
+ for(var i = 1; i < arguments.length; i++){
1948
+ var source = arguments[i] != null ? arguments[i] : {};
1949
+ var ownKeys = Object.keys(source);
1950
+ if (typeof Object.getOwnPropertySymbols === "function") {
1951
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1952
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1953
+ }));
1954
+ }
1955
+ ownKeys.forEach(function(key) {
1956
+ _define_property(target, key, source[key]);
1957
+ });
1958
+ }
1959
+ return target;
1960
+ }
1961
+ function ownKeys(object, enumerableOnly) {
1962
+ var keys = Object.keys(object);
1963
+ if (Object.getOwnPropertySymbols) {
1964
+ var symbols = Object.getOwnPropertySymbols(object);
1965
+ if (enumerableOnly) {
1966
+ symbols = symbols.filter(function(sym) {
1967
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
1968
+ });
1969
+ }
1970
+ keys.push.apply(keys, symbols);
1971
+ }
1972
+ return keys;
1973
+ }
1974
+ function _object_spread_props(target, source) {
1975
+ source = source != null ? source : {};
1976
+ if (Object.getOwnPropertyDescriptors) {
1977
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1978
+ } else {
1979
+ ownKeys(Object(source)).forEach(function(key) {
1980
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1981
+ });
1982
+ }
1983
+ return target;
1984
+ }
1985
+ /**
1986
+ * @license
1987
+ * Copyright 2017 Google LLC
1988
+ * SPDX-License-Identifier: BSD-3-Clause
1989
+ */ function r(r) {
1990
+ return n(_object_spread_props(_object_spread({}, r), {
1991
+ state: !0,
1992
+ attribute: !1
1993
+ }));
1994
+ }
1995
+
1996
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1997
+
1998
+ var toastify$1 = {
1999
+ exports: {}
2000
+ };
2001
+
2002
+ (function (module) {
2003
+ function _instanceof(left, right) {
2004
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
2005
+ return !!right[Symbol.hasInstance](left);
2006
+ } else {
2007
+ return left instanceof right;
2008
+ }
2009
+ }
2010
+ /*!
2011
+ * Toastify js 1.12.0
2012
+ * https://github.com/apvarun/toastify-js
2013
+ * @license MIT licensed
2014
+ *
2015
+ * Copyright (C) 2018 Varun A P
2016
+ */ (function(root, factory) {
2017
+ if (module.exports) {
2018
+ module.exports = factory();
2019
+ } else {
2020
+ root.Toastify = factory();
2021
+ }
2022
+ })(commonjsGlobal, function(global) {
2023
+ // Object initialization
2024
+ var Toastify = function Toastify1(options) {
2025
+ // Returning a new init object
2026
+ return new Toastify.lib.init(options);
2027
+ }, // Library version
2028
+ version = "1.12.0";
2029
+ // Set the default global options
2030
+ Toastify.defaults = {
2031
+ oldestFirst: true,
2032
+ text: "Toastify is awesome!",
2033
+ node: undefined,
2034
+ duration: 3000,
2035
+ selector: undefined,
2036
+ callback: function callback() {},
2037
+ destination: undefined,
2038
+ newWindow: false,
2039
+ close: false,
2040
+ gravity: "toastify-top",
2041
+ positionLeft: false,
2042
+ position: "",
2043
+ backgroundColor: "",
2044
+ avatar: "",
2045
+ className: "",
2046
+ stopOnFocus: true,
2047
+ onClick: function onClick() {},
2048
+ offset: {
2049
+ x: 0,
2050
+ y: 0
2051
+ },
2052
+ escapeMarkup: true,
2053
+ ariaLive: "polite",
2054
+ style: {
2055
+ background: ""
2056
+ }
2057
+ };
2058
+ // Defining the prototype of the object
2059
+ Toastify.lib = Toastify.prototype = {
2060
+ toastify: version,
2061
+ constructor: Toastify,
2062
+ // Initializing the object with required parameters
2063
+ init: function init(options) {
2064
+ // Verifying and validating the input object
2065
+ if (!options) {
2066
+ options = {};
2067
+ }
2068
+ // Creating the options object
2069
+ this.options = {};
2070
+ this.toastElement = null;
2071
+ // Validating the options
2072
+ this.options.text = options.text || Toastify.defaults.text; // Display message
2073
+ this.options.node = options.node || Toastify.defaults.node; // Display content as node
2074
+ this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration
2075
+ this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector
2076
+ this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display
2077
+ this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination
2078
+ this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window
2079
+ this.options.close = options.close || Toastify.defaults.close; // Show toast close icon
2080
+ this.options.gravity = options.gravity === "bottom" ? "toastify-bottom" : Toastify.defaults.gravity; // toast position - top or bottom
2081
+ this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right
2082
+ this.options.position = options.position || Toastify.defaults.position; // toast position - left or right
2083
+ this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color
2084
+ this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path
2085
+ this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast
2086
+ this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus
2087
+ this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click
2088
+ this.options.offset = options.offset || Toastify.defaults.offset; // toast offset
2089
+ this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;
2090
+ this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;
2091
+ this.options.style = options.style || Toastify.defaults.style;
2092
+ if (options.backgroundColor) {
2093
+ this.options.style.background = options.backgroundColor;
2094
+ }
2095
+ // Returning the current object for chaining functions
2096
+ return this;
2097
+ },
2098
+ // Building the DOM element
2099
+ buildToast: function buildToast() {
2100
+ // Validating if the options are defined
2101
+ if (!this.options) {
2102
+ throw "Toastify is not initialized";
2103
+ }
2104
+ // Creating the DOM object
2105
+ var divElement = document.createElement("div");
2106
+ divElement.className = "toastify on " + this.options.className;
2107
+ // Positioning toast to left or right or center
2108
+ if (!!this.options.position) {
2109
+ divElement.className += " toastify-" + this.options.position;
2110
+ } else {
2111
+ // To be depreciated in further versions
2112
+ if (this.options.positionLeft === true) {
2113
+ divElement.className += " toastify-left";
2114
+ console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.");
2115
+ } else {
2116
+ // Default position
2117
+ divElement.className += " toastify-right";
2118
+ }
2119
+ }
2120
+ // Assigning gravity of element
2121
+ divElement.className += " " + this.options.gravity;
2122
+ if (this.options.backgroundColor) {
2123
+ // This is being deprecated in favor of using the style HTML DOM property
2124
+ console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');
2125
+ }
2126
+ // Loop through our style object and apply styles to divElement
2127
+ for(var property in this.options.style){
2128
+ divElement.style[property] = this.options.style[property];
2129
+ }
2130
+ // Announce the toast to screen readers
2131
+ if (this.options.ariaLive) {
2132
+ divElement.setAttribute("aria-live", this.options.ariaLive);
2133
+ }
2134
+ // Adding the toast message/node
2135
+ if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {
2136
+ // If we have a valid node, we insert it
2137
+ divElement.appendChild(this.options.node);
2138
+ } else {
2139
+ if (this.options.escapeMarkup) {
2140
+ divElement.innerText = this.options.text;
2141
+ } else {
2142
+ divElement.innerHTML = this.options.text;
2143
+ }
2144
+ if (this.options.avatar !== "") {
2145
+ var avatarElement = document.createElement("img");
2146
+ avatarElement.src = this.options.avatar;
2147
+ avatarElement.className = "toastify-avatar";
2148
+ if (this.options.position == "left" || this.options.positionLeft === true) {
2149
+ // Adding close icon on the left of content
2150
+ divElement.appendChild(avatarElement);
2151
+ } else {
2152
+ // Adding close icon on the right of content
2153
+ divElement.insertAdjacentElement("afterbegin", avatarElement);
2154
+ }
2155
+ }
2156
+ }
2157
+ // Adding a close icon to the toast
2158
+ if (this.options.close === true) {
2159
+ // Create a span for close element
2160
+ var closeElement = document.createElement("button");
2161
+ closeElement.type = "button";
2162
+ closeElement.setAttribute("aria-label", "Close");
2163
+ closeElement.className = "toast-close";
2164
+ closeElement.innerHTML = "&#10006;";
2165
+ // Triggering the removal of toast from DOM on close click
2166
+ closeElement.addEventListener("click", (function(event) {
2167
+ event.stopPropagation();
2168
+ this.removeElement(this.toastElement);
2169
+ window.clearTimeout(this.toastElement.timeOutValue);
2170
+ }).bind(this));
2171
+ //Calculating screen width
2172
+ var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
2173
+ // Adding the close icon to the toast element
2174
+ // Display on the right if screen width is less than or equal to 360px
2175
+ if ((this.options.position == "left" || this.options.positionLeft === true) && width > 360) {
2176
+ // Adding close icon on the left of content
2177
+ divElement.insertAdjacentElement("afterbegin", closeElement);
2178
+ } else {
2179
+ // Adding close icon on the right of content
2180
+ divElement.appendChild(closeElement);
2181
+ }
2182
+ }
2183
+ // Clear timeout while toast is focused
2184
+ if (this.options.stopOnFocus && this.options.duration > 0) {
2185
+ var self = this;
2186
+ // stop countdown
2187
+ divElement.addEventListener("mouseover", function(event) {
2188
+ window.clearTimeout(divElement.timeOutValue);
2189
+ });
2190
+ // add back the timeout
2191
+ divElement.addEventListener("mouseleave", function() {
2192
+ divElement.timeOutValue = window.setTimeout(function() {
2193
+ // Remove the toast from DOM
2194
+ self.removeElement(divElement);
2195
+ }, self.options.duration);
2196
+ });
2197
+ }
2198
+ // Adding an on-click destination path
2199
+ if (typeof this.options.destination !== "undefined") {
2200
+ divElement.addEventListener("click", (function(event) {
2201
+ event.stopPropagation();
2202
+ if (this.options.newWindow === true) {
2203
+ window.open(this.options.destination, "_blank");
2204
+ } else {
2205
+ window.location = this.options.destination;
2206
+ }
2207
+ }).bind(this));
2208
+ }
2209
+ if (typeof this.options.onClick === "function" && typeof this.options.destination === "undefined") {
2210
+ divElement.addEventListener("click", (function(event) {
2211
+ event.stopPropagation();
2212
+ this.options.onClick();
2213
+ }).bind(this));
2214
+ }
2215
+ // Adding offset
2216
+ if (typeof this.options.offset === "object") {
2217
+ var x = getAxisOffsetAValue("x", this.options);
2218
+ var y = getAxisOffsetAValue("y", this.options);
2219
+ var xOffset = this.options.position == "left" ? x : "-" + x;
2220
+ var yOffset = this.options.gravity == "toastify-top" ? y : "-" + y;
2221
+ divElement.style.transform = "translate(" + xOffset + "," + yOffset + ")";
2222
+ }
2223
+ // Returning the generated element
2224
+ return divElement;
2225
+ },
2226
+ // Displaying the toast
2227
+ showToast: function showToast() {
2228
+ // Creating the DOM object for the toast
2229
+ this.toastElement = this.buildToast();
2230
+ // Getting the root element to with the toast needs to be added
2231
+ var rootElement;
2232
+ if (typeof this.options.selector === "string") {
2233
+ rootElement = document.getElementById(this.options.selector);
2234
+ } else if (_instanceof(this.options.selector, HTMLElement) || typeof ShadowRoot !== "undefined" && _instanceof(this.options.selector, ShadowRoot)) {
2235
+ rootElement = this.options.selector;
2236
+ } else {
2237
+ rootElement = document.body;
2238
+ }
2239
+ // Validating if root element is present in DOM
2240
+ if (!rootElement) {
2241
+ throw "Root element is not defined";
2242
+ }
2243
+ // Adding the DOM element
2244
+ var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;
2245
+ rootElement.insertBefore(this.toastElement, elementToInsert);
2246
+ // Repositioning the toasts in case multiple toasts are present
2247
+ Toastify.reposition();
2248
+ if (this.options.duration > 0) {
2249
+ this.toastElement.timeOutValue = window.setTimeout((function() {
2250
+ // Remove the toast from DOM
2251
+ this.removeElement(this.toastElement);
2252
+ }).bind(this), this.options.duration); // Binding `this` for function invocation
2253
+ }
2254
+ // Supporting function chaining
2255
+ return this;
2256
+ },
2257
+ hideToast: function hideToast() {
2258
+ if (this.toastElement.timeOutValue) {
2259
+ clearTimeout(this.toastElement.timeOutValue);
2260
+ }
2261
+ this.removeElement(this.toastElement);
2262
+ },
2263
+ // Removing the element from the DOM
2264
+ removeElement: function removeElement(toastElement) {
2265
+ // Hiding the element
2266
+ // toastElement.classList.remove("on");
2267
+ toastElement.className = toastElement.className.replace(" on", "");
2268
+ // Removing the element from DOM after transition end
2269
+ window.setTimeout((function() {
2270
+ // remove options node if any
2271
+ if (this.options.node && this.options.node.parentNode) {
2272
+ this.options.node.parentNode.removeChild(this.options.node);
2273
+ }
2274
+ // Remove the element from the DOM, only when the parent node was not removed before.
2275
+ if (toastElement.parentNode) {
2276
+ toastElement.parentNode.removeChild(toastElement);
2277
+ }
2278
+ // Calling the callback function
2279
+ this.options.callback.call(toastElement);
2280
+ // Repositioning the toasts again
2281
+ Toastify.reposition();
2282
+ }).bind(this), 400); // Binding `this` for function invocation
2283
+ }
2284
+ };
2285
+ // Positioning the toasts on the DOM
2286
+ Toastify.reposition = function() {
2287
+ // Top margins with gravity
2288
+ var topLeftOffsetSize = {
2289
+ top: 15,
2290
+ bottom: 15
2291
+ };
2292
+ var topRightOffsetSize = {
2293
+ top: 15,
2294
+ bottom: 15
2295
+ };
2296
+ var offsetSize = {
2297
+ top: 15,
2298
+ bottom: 15
2299
+ };
2300
+ // Get all toast messages on the DOM
2301
+ var allToasts = document.getElementsByClassName("toastify");
2302
+ var classUsed;
2303
+ // Modifying the position of each toast element
2304
+ for(var i = 0; i < allToasts.length; i++){
2305
+ // Getting the applied gravity
2306
+ if (containsClass(allToasts[i], "toastify-top") === true) {
2307
+ classUsed = "toastify-top";
2308
+ } else {
2309
+ classUsed = "toastify-bottom";
2310
+ }
2311
+ var height = allToasts[i].offsetHeight;
2312
+ classUsed = classUsed.substr(9, classUsed.length - 1);
2313
+ // Spacing between toasts
2314
+ var offset = 15;
2315
+ var width = window.innerWidth > 0 ? window.innerWidth : screen.width;
2316
+ // Show toast in center if screen with less than or equal to 360px
2317
+ if (width <= 360) {
2318
+ // Setting the position
2319
+ allToasts[i].style[classUsed] = offsetSize[classUsed] + "px";
2320
+ offsetSize[classUsed] += height + offset;
2321
+ } else {
2322
+ if (containsClass(allToasts[i], "toastify-left") === true) {
2323
+ // Setting the position
2324
+ allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + "px";
2325
+ topLeftOffsetSize[classUsed] += height + offset;
2326
+ } else {
2327
+ // Setting the position
2328
+ allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + "px";
2329
+ topRightOffsetSize[classUsed] += height + offset;
2330
+ }
2331
+ }
2332
+ }
2333
+ // Supporting function chaining
2334
+ return this;
2335
+ };
2336
+ // Helper function to get offset.
2337
+ function getAxisOffsetAValue(axis, options) {
2338
+ if (options.offset[axis]) {
2339
+ if (isNaN(options.offset[axis])) {
2340
+ return options.offset[axis];
2341
+ } else {
2342
+ return options.offset[axis] + "px";
2343
+ }
2344
+ }
2345
+ return "0px";
2346
+ }
2347
+ function containsClass(elem, yourClass) {
2348
+ if (!elem || typeof yourClass !== "string") {
2349
+ return false;
2350
+ } else if (elem.className && elem.className.trim().split(/\s+/gi).indexOf(yourClass) > -1) {
2351
+ return true;
2352
+ } else {
2353
+ return false;
2354
+ }
2355
+ }
2356
+ // Setting up the prototype for the init object
2357
+ Toastify.lib.init.prototype = Toastify.lib;
2358
+ // Returning the Toastify function to be assigned to the window object/module
2359
+ return Toastify;
2360
+ });
2361
+ }(toastify$1));
2362
+
2363
+ var toastify = toastify$1.exports;
2364
+
2365
+ const blocksLegacy = [
2366
+ {
2367
+ type: 'object',
2368
+ message0: '{ %1 %2 }',
2369
+ args0: [
2370
+ {
2371
+ type: 'input_dummy'
2372
+ },
2373
+ {
2374
+ type: 'input_statement',
2375
+ name: 'MEMBERS',
2376
+ check: 'MEMBER'
2377
+ }
2378
+ ],
2379
+ output: null,
2380
+ colour: '#48c6be'
2381
+ },
2382
+ {
2383
+ type: 'array',
2384
+ message0: '[ %1 %2 ]',
2385
+ args0: [
2386
+ {
2387
+ type: 'input_dummy'
2388
+ },
2389
+ {
2390
+ type: 'input_statement',
2391
+ name: 'MEMBERS',
2392
+ check: 'ARRAY_INPUT'
2393
+ }
2394
+ ],
2395
+ output: null,
2396
+ colour: '#48c6be'
2397
+ },
2398
+ {
2399
+ type: 'member',
2400
+ message0: '%1 %2 %3',
2401
+ args0: [
2402
+ {
2403
+ type: 'field_input',
2404
+ name: 'MEMBER_NAME',
2405
+ text: ''
2406
+ },
2407
+ {
2408
+ type: 'field_label',
2409
+ name: 'COLON',
2410
+ text: ':'
2411
+ },
2412
+ {
2413
+ type: 'input_value',
2414
+ name: 'MEMBER_VALUE'
2415
+ }
2416
+ ],
2417
+ previousStatement: 'MEMBER',
2418
+ nextStatement: 'MEMBER',
2419
+ colour: '#35b3ab'
2420
+ },
2421
+ {
2422
+ type: 'array-input',
2423
+ message0: '%1',
2424
+ args0: [
2425
+ {
2426
+ type: 'input_value',
2427
+ name: 'MEMBER_VALUE'
2428
+ }
2429
+ ],
2430
+ previousStatement: 'ARRAY_INPUT',
2431
+ nextStatement: 'ARRAY_INPUT',
2432
+ colour: '#35b3ab'
2433
+ },
2434
+ {
2435
+ type: 'unknown-pins',
2436
+ message0: 'unknown-pins',
2437
+ args0: [],
2438
+ colour: 0,
2439
+ inputsInline: false,
2440
+ previousStatement: null,
2441
+ nextStatement: null
2442
+ },
2443
+ {
2444
+ type: 'unknown-format',
2445
+ message0: 'unknown-format',
2446
+ args0: [],
2447
+ output: null,
2448
+ colour: 0
2449
+ },
2450
+ {
2451
+ type: 'unknown-component',
2452
+ message0: 'unknown-component',
2453
+ args0: [],
2454
+ output: null,
2455
+ colour: 0
2456
+ },
2457
+ {
2458
+ type: 'generic-scene-block',
2459
+ message0: 'Error - Generic Scene Block',
2460
+ arg0: [],
2461
+ message1: 'type = %1',
2462
+ args1: [
2463
+ {
2464
+ type: 'field_input',
2465
+ name: 'SCENE_TYPE',
2466
+ text: 'default-type'
2467
+ }
2468
+ ],
2469
+ message2: '%1 %2',
2470
+ args2: [
2471
+ {
2472
+ type: 'field_label_serializable',
2473
+ name: 'NAME_EXECUTE',
2474
+ text: 'Execute*'
2475
+ },
2476
+ {
2477
+ type: 'input_statement',
2478
+ name: 'EXECUTE_PINS'
2479
+ }
2480
+ ],
2481
+ message3: '%1 %2',
2482
+ args3: [
2483
+ {
2484
+ type: 'field_label_serializable',
2485
+ name: 'NAME_METADATA',
2486
+ text: 'Metadata'
2487
+ },
2488
+ {
2489
+ type: 'input_value',
2490
+ name: 'METADATA_INPUT'
2491
+ }
2492
+ ],
2493
+ message4: '%1 %2',
2494
+ args4: [
2495
+ {
2496
+ type: 'field_label_serializable',
2497
+ name: 'NAME_EVENTS',
2498
+ text: 'Events'
2499
+ },
2500
+ {
2501
+ type: 'input_value',
2502
+ name: 'EVENTS_INPUT'
2503
+ }
2504
+ ],
2505
+ colour: 0,
2506
+ tooltip: '',
2507
+ helpUrl: ''
2508
+ }
2509
+ ];
2510
+
2511
+ let libraries;
2512
+ function initializeWorkspaceFromPinsAndLibraries(pinsSettings, workspace, librariesToLoad) {
2513
+ workspace.clear();
2514
+ libraries = librariesToLoad;
2515
+ generateSceneBlock(pinsSettings, workspace);
2516
+ }
2517
+ function generateSceneBlock(pinsSettings, workspace) {
2518
+ var _sceneBlock_getInput;
2519
+ let sceneBlockName = '';
2520
+ let sceneBlockLibrary = '';
2521
+ let hasSceneBlock = false;
2522
+ sceneBlockName = '/' + pinsSettings.element;
2523
+ sceneBlockLibrary = pinsSettings.library;
2524
+ const foundLibrary = libraries.find((library)=>library.info.title === sceneBlockLibrary);
2525
+ hasSceneBlock = foundLibrary && foundLibrary['x-scene-blocks'] && Object.hasOwnProperty.call(foundLibrary['x-scene-blocks'], sceneBlockName);
2526
+ let sceneBlock;
2527
+ if (hasSceneBlock) {
2528
+ //generating scene block
2529
+ const sceneBlockId = sceneBlockLibrary + '/__SCENEBLOCK__' + sceneBlockName;
2530
+ sceneBlock = workspace.newBlock(sceneBlockId);
2531
+ if (sceneBlock.mutator) {
2532
+ sceneBlock.itemList_ = itemListFromSceneSettings(pinsSettings, foundLibrary['x-scene-blocks'][sceneBlockName]);
2533
+ sceneBlock.updateShape_();
2534
+ }
2535
+ sceneBlock.moveBy(20, 20);
2536
+ sceneBlock.initSvg();
2537
+ sceneBlock.render();
2538
+ if (pinsSettings.metadata) {
2539
+ for (const [metadataKey, metadataValue] of Object.entries(pinsSettings.metadata)){
2540
+ const inputName = 'metadata--' + metadataKey;
2541
+ if (sceneBlock.getInput(inputName)) {
2542
+ var _foundLibrary_xsceneblocks_sceneBlockName_metadata;
2543
+ const parameter = (_foundLibrary_xsceneblocks_sceneBlockName_metadata = foundLibrary['x-scene-blocks'][sceneBlockName].metadata) == null ? void 0 : _foundLibrary_xsceneblocks_sceneBlockName_metadata.find((p)=>p.name === metadataKey);
2544
+ if (parameter) {
2545
+ if (parameter.schema.type === 'array' && parameter.schema.items.$ref) {
2546
+ const parameterType = getParameterType(parameter.schema.items);
2547
+ for (const componentSettings of metadataValue.reverse()){
2548
+ const componentBlock = parameterType === 'component' ? generateBlockFromComponent(componentSettings, workspace, foundLibrary, parameter.schema.items.$ref) : generateBlockFromPins(componentSettings, workspace);
2549
+ const sceneInputConnection = sceneBlock.getInput(inputName).connection;
2550
+ connectBlock(componentBlock, sceneInputConnection);
2551
+ }
2552
+ } else {
2553
+ const metadataBlock = generateParameterBlock(parameter.schema, metadataValue, workspace, foundLibrary);
2554
+ const sceneInputConnection = sceneBlock.getInput(inputName).connection;
2555
+ connectBlock(metadataBlock, sceneInputConnection);
2556
+ }
2557
+ } else {
2558
+ console.log(`[generateSceneBlock] - Aucun metadata nommé "${inputName}" trouvé dans les métadonnées de "${sceneBlockName}".`);
2559
+ }
2560
+ } else {
2561
+ console.log(`[generateSceneBlock] - Le bloc "${sceneBlockId}" n'a pas d'entrée metadata nommée "${inputName}" mais son format JSON semble en avoir une, une perte de donnée est possible si vous sauvegardez sans mettre à jour la librarie "${sceneBlockLibrary}"`);
2562
+ }
2563
+ }
2564
+ }
2565
+ if (pinsSettings.properties) {
2566
+ for (const [key, value] of Object.entries(pinsSettings.properties)){
2567
+ const inputName = key;
2568
+ if (sceneBlock.getInput(inputName)) {
2569
+ var _foundLibrary_xsceneblocks_sceneBlockName_parameters;
2570
+ const parameter = (_foundLibrary_xsceneblocks_sceneBlockName_parameters = foundLibrary['x-scene-blocks'][sceneBlockName].parameters) == null ? void 0 : _foundLibrary_xsceneblocks_sceneBlockName_parameters.find((p)=>p.name === inputName);
2571
+ if (parameter) {
2572
+ if (parameter.schema.type === 'array' && parameter.schema.items.$ref) {
2573
+ const parameterType = getParameterType(parameter.schema.items);
2574
+ for (const componentSettings of value.reverse()){
2575
+ const componentBlock = parameterType === 'component' ? generateBlockFromComponent(componentSettings, workspace, foundLibrary, parameter.schema.items.$ref) : generateBlockFromPins(componentSettings, workspace);
2576
+ const sceneInputConnection = sceneBlock.getInput(inputName).connection;
2577
+ connectBlock(componentBlock, sceneInputConnection);
2578
+ }
2579
+ } else {
2580
+ const metadataBlock = generateParameterBlock(parameter.schema, value, workspace, foundLibrary);
2581
+ const sceneInputConnection = sceneBlock.getInput(inputName).connection;
2582
+ connectBlock(metadataBlock, sceneInputConnection);
2583
+ }
2584
+ } else {
2585
+ console.log(`[generateSceneBlock] - Aucun paramètre nommé "${inputName}" trouvé dans les métadonnées de "${sceneBlockName}".`);
2586
+ }
2587
+ } else {
2588
+ console.log(`[generateSceneBlock] - Le bloc "${sceneBlockId}" n'a pas d'entrée parameters nommée "${inputName}" mais son format JSON semble en avoir une, une perte de donnée est possible si vous sauvegardez sans mettre à jour la librarie "${sceneBlockLibrary}"`);
2589
+ }
2590
+ }
2591
+ }
2592
+ } else {
2593
+ //generating generic debug scene block
2594
+ console.log('[generateSceneBlock] - Scene missing type or not existing in library ', sceneBlockLibrary);
2595
+ sceneBlock = workspace.newBlock('generic-scene-block');
2596
+ sceneBlock.initSvg();
2597
+ const typeValue = pinsSettings && pinsSettings.type ? pinsSettings.type : 'null';
2598
+ sceneBlock.setFieldValue(typeValue, 'SCENE_TYPE');
2599
+ const metadataValue = pinsSettings && pinsSettings.metadata ? pinsSettings.metadata : null;
2600
+ const metadataBlock = generateBlockFromJson(metadataValue, workspace);
2601
+ const sceneInputConnection = sceneBlock.getInput('METADATA_INPUT').connection;
2602
+ connectBlock(metadataBlock, sceneInputConnection);
2603
+ }
2604
+ const pinsConnection = (_sceneBlock_getInput = sceneBlock.getInput('EXECUTE_PINS')) == null ? void 0 : _sceneBlock_getInput.connection;
2605
+ if (pinsConnection) {
2606
+ const reversedPins = [
2607
+ ...pinsSettings.pins || []
2608
+ ].reverse();
2609
+ for (const pinsSetting of reversedPins){
2610
+ const pinsBlock = generateBlockFromPins(pinsSetting, workspace);
2611
+ connectBlock(pinsBlock, pinsConnection);
2612
+ }
2613
+ }
2614
+ sceneBlock.render();
2615
+ return sceneBlock;
2616
+ }
2617
+ function generateBlockFromPins(pinsSettings, workspace) {
2618
+ var _library_paths_;
2619
+ const blockPath = pinsSettings.library + '/__PINS__/' + pinsSettings.element;
2620
+ const library = getLibraryFromName(pinsSettings.library);
2621
+ if (!library) {
2622
+ const pinsBlock = workspace.newBlock('unknown-pins');
2623
+ console.log('[generateBlockFromPins] - Library not loaded', pinsSettings.library);
2624
+ pinsBlock.initSvg();
2625
+ pinsBlock.render();
2626
+ return pinsBlock;
2627
+ }
2628
+ const pinsDefinition = (_library_paths_ = library.paths['/' + pinsSettings.element]) == null ? void 0 : _library_paths_.post;
2629
+ if (!pinsDefinition) {
2630
+ const pinsBlock = workspace.newBlock('unknown-pins');
2631
+ console.log('[generateBlockFromPins] - Pins not existing in library', pinsSettings.element, pinsSettings.library);
2632
+ pinsBlock.initSvg();
2633
+ pinsBlock.render();
2634
+ return pinsBlock;
2635
+ }
2636
+ const pinsBlock = workspace.newBlock(blockPath);
2637
+ if (pinsBlock.mutator) {
2638
+ pinsBlock.itemList_ = itemListFromPinsSettings(pinsSettings, pinsDefinition);
2639
+ pinsBlock.updateShape_();
2640
+ }
2641
+ pinsBlock.initSvg();
2642
+ pinsBlock.render();
2643
+ if (library.paths['/' + pinsSettings.element].post.tags && library.paths['/' + pinsSettings.element].post.tags.includes('needPins')) {
2644
+ const pinsConnection = pinsBlock.getInput('pins').connection;
2645
+ const reversedPins = [
2646
+ ...pinsSettings.pins || []
2647
+ ].reverse();
2648
+ for (const pinsSetting of reversedPins){
2649
+ const pinsBlock = generateBlockFromPins(pinsSetting, workspace);
2650
+ connectBlock(pinsBlock, pinsConnection);
2651
+ }
2652
+ }
2653
+ if (!pinsSettings || !pinsSettings.properties) {
2654
+ return pinsBlock;
2655
+ }
2656
+ for (const parameter of pinsDefinition.parameters){
2657
+ if (!Object.prototype.hasOwnProperty.call(pinsSettings.properties, parameter.name)) {
2658
+ continue;
2659
+ }
2660
+ const valueToLoad = pinsSettings.properties[parameter.name];
2661
+ if (parameter.schema.type === 'array' && parameter.schema.items.$ref) {
2662
+ const parameterType = getParameterType(parameter.schema.items);
2663
+ for (const propertyValue of valueToLoad.reverse()){
2664
+ const parameterBlock = parameterType === 'component' ? generateBlockFromComponent(propertyValue, workspace, library, parameter.schema.items.$ref) : generateBlockFromPins(propertyValue, workspace);
2665
+ const sceneInputConnection = pinsBlock.getInput(parameter.name).connection;
2666
+ connectBlock(parameterBlock, sceneInputConnection);
2667
+ }
2668
+ } else {
2669
+ const parameterBlock = generateParameterBlock(parameter.schema, valueToLoad, workspace, library);
2670
+ const sceneInputConnection = pinsBlock.getInput(parameter.name).connection;
2671
+ connectBlock(parameterBlock, sceneInputConnection);
2672
+ }
2673
+ }
2674
+ for (const event of pinsDefinition['x-events']){
2675
+ if (!pinsSettings.events || !Object.prototype.hasOwnProperty.call(pinsSettings.events, event.name)) {
2676
+ continue;
2677
+ }
2678
+ const valueToLoad = pinsSettings.events[event.name];
2679
+ for (const propertyValue of valueToLoad.reverse()){
2680
+ const parameterBlock = generateBlockFromPins(propertyValue, workspace);
2681
+ const inputConnection = pinsBlock.getInput('__EVENT__/' + event.name).connection;
2682
+ connectBlock(parameterBlock, inputConnection);
2683
+ }
2684
+ }
2685
+ return pinsBlock;
2686
+ }
2687
+ function generateBlockFromComponent(componentSettings, workspace, library, component$ref) {
2688
+ const componentName = component$ref.split('/').pop();
2689
+ const blockPath = library.info.title + '/__COMPONENTS__/' + componentName;
2690
+ const componentDefinition = library.components.schemas[componentName];
2691
+ if (!componentDefinition) {
2692
+ const componentBlock = workspace.newBlock('unknown-component');
2693
+ componentBlock.initSvg();
2694
+ componentBlock.render();
2695
+ return componentBlock;
2696
+ }
2697
+ const componentBlock = workspace.newBlock(blockPath);
2698
+ if (componentBlock.mutator) {
2699
+ componentBlock.itemList_ = itemListFromComponentSettings(componentSettings, componentDefinition);
2700
+ componentBlock.updateShape_();
2701
+ }
2702
+ componentBlock.initSvg();
2703
+ componentBlock.render();
2704
+ for (const [propertyKey, schema] of Object.entries(componentDefinition.properties)){
2705
+ if (!Object.prototype.hasOwnProperty.call(componentSettings, propertyKey)) {
2706
+ continue;
2707
+ }
2708
+ const valueToLoad = componentSettings[propertyKey];
2709
+ if (schema.type === 'array' && schema.items.$ref) {
2710
+ const parameterType = getParameterType(schema.items);
2711
+ for (const propertyValue of valueToLoad.reverse()){
2712
+ const parameterBlock = parameterType === 'component' ? generateBlockFromComponent(propertyValue, workspace, library, schema.items.$ref) : generateBlockFromPins(propertyValue, workspace);
2713
+ const sceneInputConnection = componentBlock.getInput(propertyKey).connection;
2714
+ connectBlock(parameterBlock, sceneInputConnection);
2715
+ }
2716
+ } else {
2717
+ const parameterBlock = generateParameterBlock(schema, valueToLoad, workspace, library);
2718
+ const sceneInputConnection = componentBlock.getInput(propertyKey).connection;
2719
+ connectBlock(parameterBlock, sceneInputConnection);
2720
+ }
2721
+ }
2722
+ componentBlock.render();
2723
+ return componentBlock;
2724
+ }
2725
+ function generateParameterBlock(schema, valueToLoad, workspace, library) {
2726
+ if (valueToLoad === undefined) {
2727
+ return;
2728
+ }
2729
+ const parameterType = typeof valueToLoad === 'string' ? 'string' : getParameterType(schema);
2730
+ let arrayInputConnection;
2731
+ let paramBlock;
2732
+ switch(parameterType){
2733
+ case 'string':
2734
+ paramBlock = workspace.newBlock('text_multiline');
2735
+ if (valueToLoad === undefined) {
2736
+ console.log(`[getParameterType] - valueToLoad is undefined in case string`);
2737
+ break;
2738
+ }
2739
+ paramBlock.setFieldValue(valueToLoad, 'TEXT');
2740
+ break;
2741
+ case 'number':
2742
+ paramBlock = workspace.newBlock('math_number');
2743
+ if (valueToLoad === undefined) {
2744
+ console.log(`[getParameterType] - valueToLoad is undefined in case number`);
2745
+ break;
2746
+ }
2747
+ paramBlock.getField('NUM').setValue(valueToLoad);
2748
+ break;
2749
+ case 'boolean':
2750
+ paramBlock = workspace.newBlock('logic_boolean');
2751
+ if (valueToLoad === true) {
2752
+ paramBlock.getField('BOOL').setValue('TRUE');
2753
+ } else if (valueToLoad === false) {
2754
+ paramBlock.getField('BOOL').setValue('FALSE');
2755
+ } else {
2756
+ console.log(`[getParameterType] - valueToLoad is undefined in case boolean`);
2757
+ break;
2758
+ }
2759
+ break;
2760
+ case 'array':
2761
+ paramBlock = workspace.newBlock('array');
2762
+ paramBlock.initSvg();
2763
+ paramBlock.render();
2764
+ arrayInputConnection = paramBlock.getInput('MEMBERS').connection;
2765
+ for(let key = valueToLoad.length - 1; key >= 0; key--){
2766
+ const memberBlock = workspace.newBlock('array-input');
2767
+ memberBlock.initSvg();
2768
+ memberBlock.render();
2769
+ const parentConnection = memberBlock.getInput('MEMBER_VALUE').connection;
2770
+ const newBlock = generateParameterBlock(schema.items, valueToLoad[key], workspace, library);
2771
+ connectBlock(newBlock, parentConnection);
2772
+ memberBlock.initSvg();
2773
+ memberBlock.render();
2774
+ connectBlock(memberBlock, arrayInputConnection);
2775
+ }
2776
+ break;
2777
+ case 'component':
2778
+ paramBlock = generateBlockFromComponent(valueToLoad, workspace, library, schema.$ref);
2779
+ break;
2780
+ case 'pins':
2781
+ paramBlock = generateBlockFromPins(valueToLoad, workspace);
2782
+ break;
2783
+ case 'object':
2784
+ paramBlock = generateBlockFromJson(valueToLoad, workspace);
2785
+ break;
2786
+ default:
2787
+ paramBlock = workspace.newBlock('unknown-format');
2788
+ break;
2789
+ }
2790
+ return paramBlock;
2791
+ }
2792
+ function getParameterType(schema) {
2793
+ let typeToReturn = 'unknown-type';
2794
+ const basicTypes = [
2795
+ 'string',
2796
+ 'number',
2797
+ 'boolean',
2798
+ 'array',
2799
+ 'object'
2800
+ ];
2801
+ if (schema !== null && typeof schema !== 'undefined') {
2802
+ if (Object.prototype.hasOwnProperty.call(schema, 'type')) {
2803
+ if (basicTypes.includes(schema.type)) {
2804
+ typeToReturn = schema.type;
2805
+ }
2806
+ } else if (Object.prototype.hasOwnProperty.call(schema, '$ref')) {
2807
+ if (schema.$ref.includes('#/components/schemas/')) {
2808
+ typeToReturn = 'component';
2809
+ } else typeToReturn = 'pins';
2810
+ }
2811
+ }
2812
+ return typeToReturn;
2813
+ }
2814
+ function getLibraryFromName(name) {
2815
+ const library = libraries.find((library)=>library.info.title === name);
2816
+ return library;
2817
+ }
2818
+ function connectBlock(targetBlock, parentConnection) {
2819
+ if (parentConnection) {
2820
+ const childConnection = (targetBlock == null ? void 0 : targetBlock.outputConnection) || (targetBlock == null ? void 0 : targetBlock.previousConnection);
2821
+ parentConnection.connect(childConnection);
2822
+ }
2823
+ targetBlock == null ? void 0 : targetBlock.initSvg();
2824
+ targetBlock == null ? void 0 : targetBlock.render();
2825
+ }
2826
+ function generateBlockFromJson(json_structure, workspace) {
2827
+ if (json_structure === null) {
2828
+ const targetBlock = workspace.newBlock('logic_null');
2829
+ return targetBlock;
2830
+ }
2831
+ const type = typeof json_structure;
2832
+ let targetBlock;
2833
+ let memberInputConnection;
2834
+ switch(type){
2835
+ case 'string':
2836
+ targetBlock = workspace.newBlock('text_multiline');
2837
+ targetBlock.setFieldValue(json_structure, 'TEXT');
2838
+ break;
2839
+ case 'number':
2840
+ targetBlock = workspace.newBlock('math_number');
2841
+ targetBlock.setFieldValue(String(json_structure), 'NUM');
2842
+ break;
2843
+ case 'boolean':
2844
+ targetBlock = workspace.newBlock('logic_boolean');
2845
+ targetBlock.setFieldValue(json_structure ? 'TRUE' : 'FALSE', 'BOOL');
2846
+ break;
2847
+ case 'object':
2848
+ if (Array.isArray(json_structure)) {
2849
+ targetBlock = workspace.newBlock('array');
2850
+ targetBlock.initSvg();
2851
+ targetBlock.render();
2852
+ memberInputConnection = targetBlock.getInput('MEMBERS').connection;
2853
+ for(let key = json_structure.length - 1; key >= 0; key--){
2854
+ const memberBlock = workspace.newBlock('array-input');
2855
+ memberBlock.initSvg();
2856
+ memberBlock.render();
2857
+ const parentConnection = memberBlock.getInput('MEMBER_VALUE').connection;
2858
+ const newBlock = generateBlockFromJson(json_structure[key], workspace);
2859
+ connectBlock(newBlock, parentConnection);
2860
+ memberBlock.initSvg();
2861
+ memberBlock.render();
2862
+ connectBlock(memberBlock, memberInputConnection);
2863
+ }
2864
+ } else {
2865
+ targetBlock = workspace.newBlock('object');
2866
+ targetBlock.initSvg();
2867
+ targetBlock.render();
2868
+ memberInputConnection = targetBlock.getInput('MEMBERS').connection;
2869
+ const keys = Object.keys(json_structure);
2870
+ for(let key = keys.length - 1; key >= 0; key--){
2871
+ const memberBlock = workspace.newBlock('member');
2872
+ memberBlock.setFieldValue(keys[key], 'MEMBER_NAME');
2873
+ memberBlock.initSvg();
2874
+ memberBlock.render();
2875
+ const parentConnection = memberBlock.getInput('MEMBER_VALUE').connection;
2876
+ const newBlock = generateBlockFromJson(json_structure[keys[key]], workspace);
2877
+ connectBlock(newBlock, parentConnection);
2878
+ memberBlock.initSvg();
2879
+ memberBlock.render();
2880
+ connectBlock(memberBlock, memberInputConnection);
2881
+ }
2882
+ }
2883
+ break;
2884
+ }
2885
+ return targetBlock;
2886
+ }
2887
+ function itemListFromPinsSettings(pinsSettings, pinsDefinition) {
2888
+ const inputArray = [];
2889
+ if (!pinsSettings || !pinsDefinition) {
2890
+ console.log('[itemListFromPinsSettings] - Undefined pinsSettings or pinsDefinition');
2891
+ return inputArray;
2892
+ }
2893
+ if (pinsDefinition.parameters && pinsSettings.properties) {
2894
+ for (const parameter of pinsDefinition.parameters){
2895
+ if (!Object.prototype.hasOwnProperty.call(pinsSettings.properties, parameter.name)) {
2896
+ continue;
2897
+ }
2898
+ inputArray.push({
2899
+ id: parameter.name,
2900
+ name: parameter.summary || parameter.name
2901
+ });
2902
+ }
2903
+ }
2904
+ if (pinsDefinition.tags && pinsDefinition.tags.includes('needPins')) {
2905
+ inputArray.push({
2906
+ id: 'pins',
2907
+ name: 'pins'
2908
+ });
2909
+ }
2910
+ if (pinsDefinition['x-events'] && pinsSettings.events) {
2911
+ for (const event of pinsDefinition['x-events']){
2912
+ if (!Object.prototype.hasOwnProperty.call(pinsSettings.events, event.name)) {
2913
+ continue;
2914
+ }
2915
+ inputArray.push({
2916
+ id: '__EVENT__/' + event.name,
2917
+ name: '@' + (event.summary || event.name)
2918
+ });
2919
+ }
2920
+ }
2921
+ return inputArray;
2922
+ }
2923
+ function itemListFromComponentSettings(componentSettings, componentDefinition) {
2924
+ const inputArray = [];
2925
+ for (const [propertyKey, _propertyValue] of Object.entries(componentDefinition.properties)){
2926
+ if (!Object.prototype.hasOwnProperty.call(componentSettings, propertyKey)) {
2927
+ continue;
2928
+ }
2929
+ inputArray.push({
2930
+ id: propertyKey,
2931
+ name: propertyKey
2932
+ });
2933
+ }
2934
+ return inputArray;
2935
+ }
2936
+ function itemListFromSceneSettings(sceneSettings, sceneDefinition) {
2937
+ const inputArray = [];
2938
+ if (sceneDefinition.parameters && sceneSettings.properties) {
2939
+ for (const parameter of sceneDefinition.parameters){
2940
+ if (!Object.prototype.hasOwnProperty.call(sceneSettings.properties, parameter.name)) {
2941
+ continue;
2942
+ }
2943
+ inputArray.push({
2944
+ id: parameter.name,
2945
+ name: parameter.name
2946
+ });
2947
+ }
2948
+ }
2949
+ return inputArray;
2950
+ }
2951
+
2952
+ const Toastify$1 = toastify;
2953
+ const BASE_URL = 'https://cdn.jsdelivr.net/npm';
2954
+ const BLOCKLY_VERSION = '10.4.3';
2955
+ let jsonGenerator, generateBlocklyBlockFromLibraries, generateToolboxFromLibraries, initializeMutator;
2956
+ class GenericSceneElement extends s {
2957
+ createRenderRoot() {
2958
+ return this;
2959
+ }
2960
+ connectedCallback() {
2961
+ super.connectedCallback();
2962
+ this.initialize();
2963
+ }
2964
+ async initialize() {
2965
+ const link = document.createElement('link');
2966
+ link.rel = 'stylesheet';
2967
+ link.href = `${BASE_URL}/toastify-js/src/toastify.min.css`;
2968
+ link.type = 'text/css';
2969
+ document.head.appendChild(link);
2970
+ let script, promise;
2971
+ script = document.createElement('script');
2972
+ script.src = `${BASE_URL}/blockly@${BLOCKLY_VERSION}/blockly_compressed.js`;
2973
+ promise = new Promise((resolve)=>{
2974
+ script.onload = resolve;
2975
+ });
2976
+ document.head.appendChild(script);
2977
+ await promise;
2978
+ script = document.createElement('script');
2979
+ script.src = `${BASE_URL}/blockly@${BLOCKLY_VERSION}/blocks_compressed.js`;
2980
+ promise = new Promise((resolve)=>{
2981
+ script.onload = resolve;
2982
+ });
2983
+ document.head.appendChild(script);
2984
+ await promise;
2985
+ script = document.createElement('script');
2986
+ script.src = `${BASE_URL}/blockly@${BLOCKLY_VERSION}/msg/en.js`;
2987
+ promise = new Promise((resolve)=>{
2988
+ script.onload = resolve;
2989
+ });
2990
+ document.head.appendChild(script);
2991
+ await promise;
2992
+ const blocklyToJson = await import('./blockly-to-json.esm.js');
2993
+ jsonGenerator = blocklyToJson.jsonGenerator;
2994
+ const pinsToBlockly = await import('./pins-to-blockly.esm.js');
2995
+ generateBlocklyBlockFromLibraries = pinsToBlockly.generateBlocklyBlockFromLibraries;
2996
+ generateToolboxFromLibraries = pinsToBlockly.generateToolboxFromLibraries;
2997
+ initializeMutator = pinsToBlockly.initializeMutator;
2998
+ setTimeout(()=>this.loadScene(this.digipair, this.reasoning), 1);
2999
+ this.addEventListener('setReasoning', ({ detail })=>this.loadReasoning(detail));
3000
+ }
3001
+ loadReasoning(detail) {
3002
+ const scene = _extends({}, detail, {
3003
+ properties: _extends({}, (detail.properties.trigger || []).reduce((acc, { name, value })=>_extends({}, acc, {
3004
+ [name]: value
3005
+ }), {}), {
3006
+ actions: detail.properties.actions.map((action)=>{
3007
+ var _action_properties;
3008
+ return _extends({}, action, {
3009
+ properties: (_action_properties = action.properties) == null ? void 0 : _action_properties.reduce((acc, { name, value })=>_extends({}, acc, {
3010
+ [name]: value
3011
+ }), {})
3012
+ });
3013
+ }),
3014
+ conditions: detail.properties.conditions.map((action)=>{
3015
+ var _action_properties;
3016
+ return _extends({}, action, {
3017
+ properties: (_action_properties = action.properties) == null ? void 0 : _action_properties.reduce((acc, { name, value })=>_extends({}, acc, {
3018
+ [name]: value
3019
+ }), {})
3020
+ });
3021
+ }),
3022
+ pins: []
3023
+ })
3024
+ });
3025
+ Blockly.Events.disable();
3026
+ initializeWorkspaceFromPinsAndLibraries(scene, this.workspace, this.librariesToLoad);
3027
+ Blockly.Events.enable();
3028
+ }
3029
+ async getReasoning(digipair, reasoning) {
3030
+ const response = await fetch(`${window.origin}/admin/reasoning-read`, {
3031
+ headers: {
3032
+ 'content-type': 'application/json'
3033
+ },
3034
+ body: JSON.stringify({
3035
+ digipair,
3036
+ reasoning
3037
+ }),
3038
+ method: 'POST'
3039
+ });
3040
+ const content = await response.json();
3041
+ return content;
3042
+ }
3043
+ async getLibraries(libraries) {
3044
+ const list = await Promise.all(Object.keys(libraries).map(async (library, i)=>// fetch(`${BASE_URL}/${library}@${libraries[library]}/schema.json`).then(res => res.json()),
3045
+ // @todo: to replace
3046
+ fetch(`http://localhost:4000/${library.split('/')[1]}/schema.json`).then((res)=>res.json())));
3047
+ return list;
3048
+ }
3049
+ async loadScene(digipair, reasoning) {
3050
+ this.reasoningData = await this.getReasoning(digipair, reasoning);
3051
+ const scene = this.reasoningData.content;
3052
+ this.librariesToLoad = await this.getLibraries(this.reasoningData.libraries);
3053
+ this.loadBlockly(scene);
3054
+ if (!scene) {
3055
+ return;
3056
+ }
3057
+ this.canSave = this.verifyCanSaveAndGetCode();
3058
+ }
3059
+ verifyCanSaveAndGetCode() {
3060
+ const code = jsonGenerator.workspaceToCode(this.workspace);
3061
+ try {
3062
+ this.codeInWorkspace = _extends({
3063
+ type: this.reasoningData.content.type,
3064
+ name: this.reasoning,
3065
+ description: this.reasoningData.content.description
3066
+ }, JSON.parse(code));
3067
+ return true;
3068
+ } catch (e) {
3069
+ return false;
3070
+ }
3071
+ }
3072
+ async saveScene() {
3073
+ if (this.canSave == true) {
3074
+ this.dispatchEvent(new CustomEvent('save', {
3075
+ detail: {
3076
+ digipair: this.digipair,
3077
+ reasoning: this.reasoning,
3078
+ value: this.codeInWorkspace
3079
+ }
3080
+ }));
3081
+ } else {
3082
+ Toastify$1({
3083
+ text: 'Your scene cannot be saved, invalid format',
3084
+ position: 'center',
3085
+ style: {
3086
+ 'font-family': 'Arial, Helvetica, sans- serif',
3087
+ background: 'linear-gradient(90deg, rgba(121,9,9,1) 0%, rgba(203,62,62,1) 100%)'
3088
+ },
3089
+ duration: 3000
3090
+ }).showToast();
3091
+ }
3092
+ }
3093
+ loadBlockly(scene) {
3094
+ initializeMutator();
3095
+ const generatedBlocks = generateBlocklyBlockFromLibraries(this.librariesToLoad, blocksLegacy);
3096
+ this.blocks = Blockly.common.createBlockDefinitionsFromJsonArray(generatedBlocks);
3097
+ this.toolbox = generateToolboxFromLibraries(this.librariesToLoad);
3098
+ Blockly.common.defineBlocks(this.blocks);
3099
+ const container = this.renderRoot.querySelector('[data-scene]');
3100
+ this.workspace = Blockly.inject(container, {
3101
+ toolbox: this.toolbox,
3102
+ scrollbars: true,
3103
+ infiniteBlocks: true,
3104
+ trashcan: false,
3105
+ move: {
3106
+ scrollbars: true,
3107
+ drag: true,
3108
+ wheel: true
3109
+ }
3110
+ });
3111
+ this.workspace.addChangeListener((e)=>{
3112
+ if (e.isUiEvent || e.type == Blockly.Events.FINISHED_LOADING) {
3113
+ return;
3114
+ }
3115
+ if (this.workspace.isDragging()) {
3116
+ return;
3117
+ }
3118
+ this.canSave = this.verifyCanSaveAndGetCode();
3119
+ });
3120
+ Blockly.Events.disable();
3121
+ initializeWorkspaceFromPinsAndLibraries(scene, this.workspace, this.librariesToLoad);
3122
+ Blockly.Events.enable();
3123
+ }
3124
+ render() {
3125
+ return x`
3126
+ <style>
3127
+ .blocklyToolboxDiv {
3128
+ background-color: #09121d;
3129
+ color: white;
3130
+ width: 370px;
3131
+ }
3132
+
3133
+ .header {
3134
+ position: unset !important;
3135
+ }
3136
+
3137
+ .menu-item > a::after {
3138
+ content: '> ';
3139
+ margin-left: 30px;
3140
+ }
3141
+
3142
+ .header__logo {
3143
+ margin-left: 80px;
3144
+ }
3145
+
3146
+ .header .main-nav {
3147
+ position: unset;
3148
+ margin-top: 50px;
3149
+ margin-left: 60px;
3150
+ }
3151
+
3152
+ .header .container {
3153
+ margin: 0;
3154
+ }
3155
+
3156
+ .blocklyTreeRow {
3157
+ height: 30px;
3158
+ line-height: 30px;
3159
+ }
3160
+ </style>
3161
+
3162
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
3163
+ <div>
3164
+ <div style="position: fixed; top: 0; right: 0; bottom: 0; left: 0;" data-scene></div>
3165
+ <div
3166
+ style ="position: absolute;
3167
+ top: 24px;
3168
+ right: 24px;
3169
+ border-radius: 100%;
3170
+ color: #fff;
3171
+ width: 56px;
3172
+ height: 56px;
3173
+ line-height: 56px;
3174
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
3175
+ transition: box-shadow 0.3s ease-in-out;
3176
+ text-align: center;
3177
+ font-weight: 500;
3178
+ background-color:${this.canSave ? '#12b5cd' : '#5F5F5F'} ;
3179
+ cursor: pointer;"
3180
+ class="material-icons"
3181
+ aria-hidden="true"
3182
+ @click=${()=>this.saveScene()}>save</div>
3183
+ </div>
3184
+ </div>
3185
+ `;
3186
+ }
3187
+ constructor(...args){
3188
+ super(...args);
3189
+ this.canSave = false;
3190
+ }
3191
+ }
3192
+ __decorate([
3193
+ n(),
3194
+ __metadata("design:type", String)
3195
+ ], GenericSceneElement.prototype, "digipair", void 0);
3196
+ __decorate([
3197
+ n(),
3198
+ __metadata("design:type", String)
3199
+ ], GenericSceneElement.prototype, "reasoning", void 0);
3200
+ __decorate([
3201
+ r()
3202
+ ], GenericSceneElement.prototype, "canSave", void 0);
3203
+ GenericSceneElement = __decorate([
3204
+ t('digipair-editor')
3205
+ ], GenericSceneElement);
3206
+
3207
+ const Toastify = toastify;
3208
+ let EditorService = class EditorService {
3209
+ async information(params, _pinsSettingsList, _context) {
3210
+ const { message } = params;
3211
+ Toastify({
3212
+ text: message,
3213
+ position: 'center',
3214
+ style: {
3215
+ 'font-family': 'Arial, Helvetica, sans- serif',
3216
+ background: 'linear-gradient(90deg, rgba(7,99,101,1) 0%, rgba(4,129,58,1) 100%)'
3217
+ },
3218
+ duration: 3000
3219
+ }).showToast();
3220
+ }
3221
+ async error(params, _pinsSettingsList, _context) {
3222
+ const { message } = params;
3223
+ Toastify({
3224
+ text: message,
3225
+ position: 'center',
3226
+ style: {
3227
+ 'font-family': 'Arial, Helvetica, sans- serif',
3228
+ background: 'linear-gradient(90deg, rgba(121,9,9,1) 0%, rgba(203,62,62,1) 100%)'
3229
+ },
3230
+ duration: 3000
3231
+ }).showToast();
3232
+ }
3233
+ };
3234
+ const information = (params, pinsSettingsList, context)=>new EditorService().information(params, pinsSettingsList, context);
3235
+ const error = (params, pinsSettingsList, context)=>new EditorService().error(params, pinsSettingsList, context);
3236
+
3237
+ export { GenericSceneElement as G, _extends as _, error as e, information as i };