@digipair/skill-web-editor
Version:
1,207 lines (1,202 loc) • 2.77 MB
JavaScript
'use strict';
function _extends() {
_extends = Object.assign || function assign(target) {
for(var i = 1; i < arguments.length; i++){
var source = arguments[i];
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends.apply(this, arguments);
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
typeof SuppressedError === "function" ? SuppressedError : function _SuppressedError(error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/ function _class_call_check$3(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties$3(target, props) {
for(var i = 0; i < props.length; i++){
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _create_class$3(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
if (staticProps) _defineProperties$3(Constructor, staticProps);
return Constructor;
}
function _instanceof(left, right) {
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
return !!right[Symbol.hasInstance](left);
} else {
return left instanceof right;
}
}
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$1 = Symbol(), o$3 = new WeakMap;
var n$3 = /*#__PURE__*/ function() {
function n(t, e, o) {
_class_call_check$3(this, n);
if (this._$cssResult$ = !0, o !== s$1) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = t, this.t = e;
}
_create_class$3(n, [
{
key: "styleSheet",
get: function get() {
var t = this.o;
var s = this.t;
if (e$2 && void 0 === t) {
var e1 = void 0 !== s && 1 === s.length;
e1 && (t = o$3.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet).replaceSync(this.cssText), e1 && o$3.set(s, t));
}
return t;
}
},
{
key: "toString",
value: function toString() {
return this.cssText;
}
}
]);
return n;
}();
var r$4 = function(t) {
return new n$3("string" == typeof t ? t : t + "", void 0, s$1);
}, S$1 = function(s, o) {
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
if (e$2) s.adoptedStyleSheets = o.map(function(t) {
return _instanceof(t, CSSStyleSheet) ? t : t.styleSheet;
});
else try {
for(var _iterator = o[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
var e1 = _step.value;
var _$o = document.createElement("style"), n = t$2.litNonce;
void 0 !== n && _$o.setAttribute("nonce", n), _$o.textContent = e1.cssText, s.appendChild(_$o);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally{
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally{
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}, c$2 = e$2 ? function(t) {
return t;
} : function(t) {
return _instanceof(t, CSSStyleSheet) ? function(t) {
var e = "";
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
try {
for(var _iterator = t.cssRules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
var s = _step.value;
e += s.cssText;
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally{
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally{
if (_didIteratorError) {
throw _iteratorError;
}
}
}
return r$4(e);
}(t) : t;
};
function _array_like_to_array$1(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
return arr2;
}
function _array_with_holes$1(arr) {
if (Array.isArray(arr)) return arr;
}
function _array_without_holes$1(arr) {
if (Array.isArray(arr)) return _array_like_to_array$1(arr);
}
function _assert_this_initialized$2(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _async_to_generator(fn) {
return function() {
var self = this, args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _class_call_check$2(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _construct(Parent, args, Class) {
if (_is_native_reflect_construct$2()) {
_construct = Reflect.construct;
} else {
_construct = function construct(Parent, args, Class) {
var a = [
null
];
a.push.apply(a, args);
var Constructor = Function.bind.apply(Parent, a);
var instance = new Constructor();
if (Class) _set_prototype_of$2(instance, Class.prototype);
return instance;
};
}
return _construct.apply(null, arguments);
}
function _defineProperties$2(target, props) {
for(var i = 0; i < props.length; i++){
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _create_class$2(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
if (staticProps) _defineProperties$2(Constructor, staticProps);
return Constructor;
}
function _get_prototype_of$2(o) {
_get_prototype_of$2 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _get_prototype_of$2(o);
}
function _inherits$2(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _set_prototype_of$2(subClass, superClass);
}
function _is_native_function(fn) {
return Function.toString.call(fn).indexOf("[native code]") !== -1;
}
function _iterable_to_array$1(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _iterable_to_array_limit$1(arr, i) {
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
if (_i == null) return;
var _arr = [];
var _n = true;
var _d = false;
var _s, _e;
try {
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally{
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally{
if (_d) throw _e;
}
}
return _arr;
}
function _non_iterable_rest$1() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _non_iterable_spread$1() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _possible_constructor_return$2(self, call) {
if (call && (_type_of$2(call) === "object" || typeof call === "function")) {
return call;
}
return _assert_this_initialized$2(self);
}
function _set_prototype_of$2(o, p) {
_set_prototype_of$2 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _set_prototype_of$2(o, p);
}
function _sliced_to_array$1(arr, i) {
return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
}
function _to_consumable_array$1(arr) {
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
}
function _type_of$2(obj) {
"@swc/helpers - typeof";
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
}
function _unsupported_iterable_to_array$1(o, minLen) {
if (!o) return;
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(n);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
}
function _wrap_native_super(Class) {
var _cache = typeof Map === "function" ? new Map() : undefined;
_wrap_native_super = function wrapNativeSuper(Class) {
if (Class === null || !_is_native_function(Class)) return Class;
if (typeof Class !== "function") {
throw new TypeError("Super expression must either be null or a function");
}
if (typeof _cache !== "undefined") {
if (_cache.has(Class)) return _cache.get(Class);
_cache.set(Class, Wrapper);
}
function Wrapper() {
return _construct(Class, arguments, _get_prototype_of$2(this).constructor);
}
Wrapper.prototype = Object.create(Class.prototype, {
constructor: {
value: Wrapper,
enumerable: false,
writable: true,
configurable: true
}
});
return _set_prototype_of$2(Wrapper, Class);
};
return _wrap_native_super(Class);
}
function _is_native_reflect_construct$2() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
return true;
} catch (e) {
return false;
}
}
function _create_super$2(Derived) {
var hasNativeReflectConstruct = _is_native_reflect_construct$2();
return function _createSuperInternal() {
var Super = _get_prototype_of$2(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _get_prototype_of$2(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possible_constructor_return$2(this, result);
};
}
function _ts_generator(thisArg, body) {
var f, y, t, g, _ = {
label: 0,
sent: function() {
if (t[0] & 1) throw t[1];
return t[1];
},
trys: [],
ops: []
};
return g = {
next: verb(0),
"throw": verb(1),
"return": verb(2)
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
return this;
}), g;
function verb(n) {
return function(v) {
return step([
n,
v
]);
};
}
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while(_)try {
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;
if (y = 0, t) op = [
op[0] & 2,
t.value
];
switch(op[0]){
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return {
value: op[1],
done: false
};
case 5:
_.label++;
y = op[1];
op = [
0
];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [
6,
e
];
y = 0;
} finally{
f = t = 0;
}
if (op[0] & 5) throw op[1];
return {
value: op[0] ? op[1] : void 0,
done: true
};
}
}
var _Symbol, _a, _a1;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/ var i$2 = Object.is, e$1 = Object.defineProperty, r$3 = 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) {
return t;
}, u$1 = {
toAttribute: function toAttribute(t, s) {
switch(s){
case Boolean:
t = t ? l$1 : null;
break;
case Object:
case Array:
t = null == t ? t : JSON.stringify(t);
}
return t;
},
fromAttribute: function fromAttribute(t, s) {
var i = t;
switch(s){
case Boolean:
i = null !== t;
break;
case Number:
i = null === t ? null : Number(t);
break;
case Object:
case Array:
try {
i = JSON.parse(t);
} catch (t) {
i = null;
}
}
return i;
}
}, f$1 = function(t, s) {
return !i$2(t, s);
}, y$1 = {
attribute: !0,
type: String,
converter: u$1,
reflect: !1,
hasChanged: f$1
};
var _metadata, _litPropertyMetadata;
(_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;
var b = /*#__PURE__*/ function(HTMLElement1) {
_inherits$2(b, HTMLElement1);
var _super = _create_super$2(b);
function b() {
_class_call_check$2(this, b);
var _this;
_this = _super.call(this), _this._$Ep = void 0, _this.isUpdatePending = !1, _this.hasUpdated = !1, _this._$Em = null, _this._$Ev();
return _possible_constructor_return$2(_this);
}
_create_class$2(b, [
{
key: "_$Ev",
value: function _$Ev() {
var _this = this;
var _this_constructor_l;
this._$ES = new Promise(function(t) {
return _this.enableUpdating = t;
}), 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) {
return t(_this);
});
}
},
{
key: "addController",
value: function addController(t) {
var _t_hostConnected;
var _this__$EO;
((_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));
}
},
{
key: "removeController",
value: function removeController(t) {
var _this__$EO;
(_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.delete(t);
}
},
{
key: "_$E_",
value: function _$E_() {
var t = new Map, s = this.constructor.elementProperties;
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
try {
for(var _iterator = s.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
var i = _step.value;
this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally{
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally{
if (_didIteratorError) {
throw _iteratorError;
}
}
}
t.size > 0 && (this._$Ep = t);
}
},
{
key: "createRenderRoot",
value: function createRenderRoot() {
var _this_shadowRoot;
var t = (_this_shadowRoot = this.shadowRoot) !== null && _this_shadowRoot !== void 0 ? _this_shadowRoot : this.attachShadow(this.constructor.shadowRootOptions);
return S$1(t, this.constructor.elementStyles), t;
}
},
{
key: "connectedCallback",
value: function connectedCallback() {
var _this__$EO;
var _this_renderRoot;
(_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) {
var _t_hostConnected;
return (_t_hostConnected = t.hostConnected) === null || _t_hostConnected === void 0 ? void 0 : _t_hostConnected.call(t);
});
}
},
{
key: "enableUpdating",
value: function enableUpdating(t) {}
},
{
key: "disconnectedCallback",
value: function disconnectedCallback() {
var _this__$EO;
(_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
var _t_hostDisconnected;
return (_t_hostDisconnected = t.hostDisconnected) === null || _t_hostDisconnected === void 0 ? void 0 : _t_hostDisconnected.call(t);
});
}
},
{
key: "attributeChangedCallback",
value: function attributeChangedCallback(t, s, i) {
this._$AK(t, i);
}
},
{
key: "_$EC",
value: function _$EC(t, s) {
var i = this.constructor.elementProperties.get(t), e = this.constructor._$Eu(t, i);
if (void 0 !== e && !0 === i.reflect) {
var _i_converter;
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);
this._$Em = t, null == r ? this.removeAttribute(e) : this.setAttribute(e, r), this._$Em = null;
}
}
},
{
key: "_$AK",
value: function _$AK(t, s) {
var i = this.constructor, e = i._$Eh.get(t);
if (void 0 !== e && this._$Em !== e) {
var _t_converter;
var _$t = i.getPropertyOptions(e), r = "function" == typeof _$t.converter ? {
fromAttribute: _$t.converter
} : void 0 !== ((_t_converter = _$t.converter) === null || _t_converter === void 0 ? void 0 : _t_converter.fromAttribute) ? _$t.converter : u$1;
this._$Em = e, this[e] = r.fromAttribute(s, _$t.type), this._$Em = null;
}
}
},
{
key: "requestUpdate",
value: function requestUpdate(t, s, i) {
if (void 0 !== t) {
var _i_hasChanged;
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;
this.P(t, s, i);
}
!1 === this.isUpdatePending && (this._$ES = this._$ET());
}
},
{
key: "P",
value: function P(t, s, i) {
var _this__$Ej;
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);
}
},
{
key: "_$ET",
value: function _$ET() {
var _this = this;
return _async_to_generator(function() {
var t, _$t, _tmp;
return _ts_generator(this, function(_state) {
switch(_state.label){
case 0:
_this.isUpdatePending = !0;
_state.label = 1;
case 1:
_state.trys.push([
1,
3,
,
4
]);
return [
4,
_this._$ES
];
case 2:
_state.sent();
return [
3,
4
];
case 3:
t = _state.sent();
Promise.reject(t);
return [
3,
4
];
case 4:
_$t = _this.scheduleUpdate();
_tmp = null != _$t;
if (!_tmp) return [
3,
6
];
return [
4,
_$t
];
case 5:
_tmp = _state.sent();
_state.label = 6;
case 6:
return [
2,
(!_this.isUpdatePending)
];
}
});
})();
}
},
{
key: "scheduleUpdate",
value: function scheduleUpdate() {
return this.performUpdate();
}
},
{
key: "performUpdate",
value: function performUpdate() {
if (!this.isUpdatePending) return;
if (!this.hasUpdated) {
var _this_renderRoot;
if ((_this_renderRoot = this.renderRoot) !== null && _this_renderRoot !== void 0 ? _this_renderRoot : this.renderRoot = this.createRenderRoot(), this._$Ep) {
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
try {
for(var _iterator = this._$Ep[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
var _step_value = _sliced_to_array$1(_step.value, 2), t = _step_value[0], _$s = _step_value[1];
this[t] = _$s;
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally{
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally{
if (_didIteratorError) {
throw _iteratorError;
}
}
}
this._$Ep = void 0;
}
var t1 = this.constructor.elementProperties;
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
if (t1.size > 0) try {
for(var _iterator1 = t1[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
var _step_value1 = _sliced_to_array$1(_step1.value, 2), _$s1 = _step_value1[0], i = _step_value1[1];
!0 !== i.wrapped || this._$AL.has(_$s1) || void 0 === this[_$s1] || this.P(_$s1, this[_$s1], i);
}
} catch (err) {
_didIteratorError1 = true;
_iteratorError1 = err;
} finally{
try {
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
_iterator1.return();
}
} finally{
if (_didIteratorError1) {
throw _iteratorError1;
}
}
}
}
var t2 = !1;
var _$s2 = this._$AL;
try {
var _this__$EO;
t2 = this.shouldUpdate(_$s2), t2 ? (this.willUpdate(_$s2), (_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
var _t_hostUpdate;
return (_t_hostUpdate = t.hostUpdate) === null || _t_hostUpdate === void 0 ? void 0 : _t_hostUpdate.call(t);
}), this.update(_$s2)) : this._$EU();
} catch (s) {
throw t2 = !1, this._$EU(), s;
}
t2 && this._$AE(_$s2);
}
},
{
key: "willUpdate",
value: function willUpdate(t) {}
},
{
key: "_$AE",
value: function _$AE(t) {
var _this__$EO;
(_this__$EO = this._$EO) === null || _this__$EO === void 0 ? void 0 : _this__$EO.forEach(function(t) {
var _t_hostUpdated;
return (_t_hostUpdated = t.hostUpdated) === null || _t_hostUpdated === void 0 ? void 0 : _t_hostUpdated.call(t);
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
}
},
{
key: "_$EU",
value: function _$EU() {
this._$AL = new Map, this.isUpdatePending = !1;
}
},
{
key: "updateComplete",
get: function get() {
return this.getUpdateComplete();
}
},
{
key: "getUpdateComplete",
value: function getUpdateComplete() {
return this._$ES;
}
},
{
key: "shouldUpdate",
value: function shouldUpdate(t) {
return !0;
}
},
{
key: "update",
value: function update(t) {
var _this = this;
this._$Ej && (this._$Ej = this._$Ej.forEach(function(t) {
return _this._$EC(t, _this[t]);
})), this._$EU();
}
},
{
key: "updated",
value: function updated(t) {}
},
{
key: "firstUpdated",
value: function firstUpdated(t) {}
}
], [
{
key: "addInitializer",
value: function addInitializer(t) {
var _this_l;
this._$Ei(), ((_this_l = this.l) !== null && _this_l !== void 0 ? _this_l : this.l = []).push(t);
}
},
{
key: "observedAttributes",
get: function get() {
return this.finalize(), this._$Eh && _to_consumable_array$1(this._$Eh.keys());
}
},
{
key: "createProperty",
value: function createProperty(t) {
var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : y$1;
if (s.state && (s.attribute = !1), this._$Ei(), this.elementProperties.set(t, s), !s.noAccessor) {
var i = Symbol(), r = this.getPropertyDescriptor(t, i, s);
void 0 !== r && e$1(this.prototype, t, r);
}
}
},
{
key: "getPropertyDescriptor",
value: function getPropertyDescriptor(t, s, i) {
var _r;
var _ref = (_r = r$3(this.prototype, t)) !== null && _r !== void 0 ? _r : {
get: function get() {
return this[s];
},
set: function set(t) {
this[s] = t;
}
}, e = _ref.get, h = _ref.set;
return {
get: function get() {
return e === null || e === void 0 ? void 0 : e.call(this);
},
set: function set(s) {
var r = e === null || e === void 0 ? void 0 : e.call(this);
h.call(this, s), this.requestUpdate(t, r, i);
},
configurable: !0,
enumerable: !0
};
}
},
{
key: "getPropertyOptions",
value: function getPropertyOptions(t) {
var _this_elementProperties_get;
return (_this_elementProperties_get = this.elementProperties.get(t)) !== null && _this_elementProperties_get !== void 0 ? _this_elementProperties_get : y$1;
}
},
{
key: "_$Ei",
value: function _$Ei() {
if (this.hasOwnProperty(d$1("elementProperties"))) return;
var t = n$2(this);
t.finalize(), void 0 !== t.l && (this.l = _to_consumable_array$1(t.l)), this.elementProperties = new Map(t.elementProperties);
}
},
{
key: "finalize",
value: function finalize() {
if (this.hasOwnProperty(d$1("finalized"))) return;
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
var t = this.properties, s = _to_consumable_array$1(h$1(t)).concat(_to_consumable_array$1(o$2(t)));
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
try {
for(var _iterator = s[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
var i = _step.value;
this.createProperty(i, t[i]);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally{
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally{
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
var t1 = this[Symbol.metadata];
if (null !== t1) {
var s1 = litPropertyMetadata.get(t1);
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
if (void 0 !== s1) try {
for(var _iterator1 = s1[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
var _step_value = _sliced_to_array$1(_step1.value, 2), t2 = _step_value[0], i1 = _step_value[1];
this.elementProperties.set(t2, i1);
}
} catch (err) {
_didIteratorError1 = true;
_iteratorError1 = err;
} finally{
try {
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
_iterator1.return();
}
} finally{
if (_didIteratorError1) {
throw _iteratorError1;
}
}
}
}
this._$Eh = new Map;
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
try {
for(var _iterator2 = this.elementProperties[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
var _step_value1 = _sliced_to_array$1(_step2.value, 2), t3 = _step_value1[0], s2 = _step_value1[1];
var i2 = this._$Eu(t3, s2);
void 0 !== i2 && this._$Eh.set(i2, t3);
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally{
try {
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
_iterator2.return();
}
} finally{
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
this.elementStyles = this.finalizeStyles(this.styles);
}
},
{
key: "finalizeStyles",
value: function finalizeStyles(s) {
var i = [];
if (Array.isArray(s)) {
var e = new Set(s.flat(1 / 0).reverse());
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
try {
for(var _iterator = e[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
var _$s = _step.value;
i.unshift(c$2(_$s));
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally{
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally{
if (_didIteratorError) {
throw _iteratorError;
}
}
}
} else void 0 !== s && i.push(c$2(s));
return i;
}
},
{
key: "_$Eu",
value: function _$Eu(t, s) {
var i = s.attribute;
return !1 === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
}
}
]);
return b;
}(_wrap_native_super(HTMLElement));
var _reactiveElementVersions;
b.elementStyles = [], b.shadowRootOptions = {
mode: "open"
}, b[d$1("elementProperties")] = new Map, b[d$1("finalized")] = new Map, p$1 === null || p$1 === void 0 ? void 0 : p$1({
ReactiveElement: b
}), ((_reactiveElementVersions = (_a1 = a$1).reactiveElementVersions) !== null && _reactiveElementVersions !== void 0 ? _reactiveElementVersions : _a1.reactiveElementVersions = []).push("2.0.4");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/ function _array_like_to_array(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
return arr2;
}
function _array_with_holes(arr) {
if (Array.isArray(arr)) return arr;
}
function _array_without_holes(arr) {
if (Array.isArray(arr)) return _array_like_to_array(arr);
}
function _assert_this_initialized$1(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _class_call_check$1(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties$1(target, props) {
for(var i = 0; i < props.length; i++){
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _create_class$1(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
if (staticProps) _defineProperties$1(Constructor, staticProps);
return Constructor;
}
function _get_prototype_of$1(o) {
_get_prototype_of$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _get_prototype_of$1(o);
}
function _inherits$1(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _set_prototype_of$1(subClass, superClass);
}
function _iterable_to_array(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _iterable_to_array_limit(arr, i) {
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
if (_i == null) return;
var _arr = [];
var _n = true;
var _d = false;
var _s, _e;
try {
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally{
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally{
if (_d) throw _e;
}
}
return _arr;
}
function _non_iterable_rest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _non_iterable_spread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _possible_constructor_return$1(self, call) {
if (call && (_type_of$1(call) === "object" || typeof call === "function")) {
return call;
}
return _assert_this_initialized$1(self);
}
function _set_prototype_of$1(o, p) {
_set_prototype_of$1 = Object.setPrototypeOf || function setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _set_prototype_of$1(o, p);
}
function _sliced_to_array(arr, i) {
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _to_consumable_array(arr) {
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
}
function _type_of$1(obj) {
"@swc/helpers - typeof";
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
}
function _unsupported_iterable_to_array(o, minLen) {
if (!o) return;
if (typeof o === "string") return _array_like_to_array(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(n);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
function _is_native_reflect_construct$1() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
return true;
} catch (e) {
return false;
}
}
function _create_super$1(Derived) {
var hasNativeReflectConstruct = _is_native_reflect_construct$1();
return function _createSuperInternal() {
var Super = _get_prototype_of$1(Derived), result;
if (hasNativeReflectConstruct) {
var NewTarget = _get_prototype_of$1(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possible_constructor_return$1(this, result);
};
}
var _t;
var t$1 = globalThis, i$1 = t$1.trustedTypes, s = i$1 ? i$1.createPolicy("lit-html", {
createHTML: function(t) {
return t;
}
}) : void 0, e = "$lit$", h = "lit$".concat(Math.random().toFixed(9).slice(2), "$"), o$1 = "?" + h, n$1 = "<".concat(o$1, ">"), r$2 = document, l = function() {
return r$2.createComment("");
}, c = function(t) {
return null === t || "object" != typeof t && "function" != typeof t;
}, a = Array.isArray, u = function(t) {
return a(t) || "function" == typeof (t === null || t === void 0 ? void 0 : t[Symbol.iterator]);
}, 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) {
return function(i) {
for(var _len = arguments.length, s = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
s[_key - 1] = arguments[_key];
}
return {
_$litType$: t,
strings: i,
values: s
};
};
}, x = y(1), T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = new WeakMap, C = r$2.createTreeWalker(r$2, 129);
function P(t, i) {
if (!a(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
return void 0 !== s ? s.createHTML(i) : i;
}
var V = function(t, i) {
var s = t.length - 1, o = [];
var r, l = 2 === i ? "<svg>" : 3 === i ? "<math>" : "", c = f;
for(var _$i = 0; _$i < s; _$i++){
var s1 = t[_$i];
var a = void 0, u = void 0, d = -1, y = 0;
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);
var x = c === m && t[_$i + 1].startsWith("/>") ? " " : "";
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);
}
return [
P(t, l + (t[s] |