@eox/drawtools 0.4.2 → 0.6.0

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.
@@ -1,30 +1,32 @@
1
- var K = (r, t, e) => {
1
+ var yt = Object.defineProperty;
2
+ var gt = (r, t, e) => t in r ? yt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var A = (r, t, e) => (gt(r, typeof t != "symbol" ? t + "" : t, e), e), J = (r, t, e) => {
2
4
  if (!t.has(r))
3
5
  throw TypeError("Cannot " + e);
4
6
  };
5
- var g = (r, t, e) => (K(r, t, "read from private field"), e ? e.call(r) : t.get(r)), V = (r, t, e) => {
7
+ var $ = (r, t, e) => (J(r, t, "read from private field"), e ? e.call(r) : t.get(r)), V = (r, t, e) => {
6
8
  if (t.has(r))
7
9
  throw TypeError("Cannot add the same private member more than once");
8
10
  t instanceof WeakSet ? t.add(r) : t.set(r, e);
9
- }, L = (r, t, e, i) => (K(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e);
11
+ }, R = (r, t, e, s) => (J(r, t, "write to private field"), s ? s.call(r, e) : t.set(r, e), e);
10
12
  /**
11
13
  * @license
12
14
  * Copyright 2019 Google LLC
13
15
  * SPDX-License-Identifier: BSD-3-Clause
14
16
  */
15
- const O = window, J = O.ShadowRoot && (O.ShadyCSS === void 0 || O.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, at = Symbol(), Q = /* @__PURE__ */ new WeakMap();
16
- let vt = class {
17
- constructor(t, e, i) {
18
- if (this._$cssResult$ = !0, i !== at)
17
+ const T = globalThis, Z = T.ShadowRoot && (T.ShadyCSS === void 0 || T.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, nt = Symbol(), K = /* @__PURE__ */ new WeakMap();
18
+ let ft = class {
19
+ constructor(t, e, s) {
20
+ if (this._$cssResult$ = !0, s !== nt)
19
21
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
20
22
  this.cssText = t, this.t = e;
21
23
  }
22
24
  get styleSheet() {
23
25
  let t = this.o;
24
26
  const e = this.t;
25
- if (J && t === void 0) {
26
- const i = e !== void 0 && e.length === 1;
27
- i && (t = Q.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Q.set(e, t));
27
+ if (Z && t === void 0) {
28
+ const s = e !== void 0 && e.length === 1;
29
+ s && (t = K.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && K.set(e, t));
28
30
  }
29
31
  return t;
30
32
  }
@@ -32,27 +34,29 @@ let vt = class {
32
34
  return this.cssText;
33
35
  }
34
36
  };
35
- const gt = (r) => new vt(typeof r == "string" ? r : r + "", void 0, at), yt = (r, t) => {
36
- J ? r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet) : t.forEach((e) => {
37
- const i = document.createElement("style"), s = O.litNonce;
38
- s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
39
- });
40
- }, X = J ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
37
+ const mt = (r) => new ft(typeof r == "string" ? r : r + "", void 0, nt), _t = (r, t) => {
38
+ if (Z)
39
+ r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
40
+ else
41
+ for (const e of t) {
42
+ const s = document.createElement("style"), i = T.litNonce;
43
+ i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
44
+ }
45
+ }, G = Z ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
41
46
  let e = "";
42
- for (const i of t.cssRules)
43
- e += i.cssText;
44
- return gt(e);
47
+ for (const s of t.cssRules)
48
+ e += s.cssText;
49
+ return mt(e);
45
50
  })(r) : r;
46
51
  /**
47
52
  * @license
48
53
  * Copyright 2017 Google LLC
49
54
  * SPDX-License-Identifier: BSD-3-Clause
50
55
  */
51
- var R;
52
- const k = window, G = k.trustedTypes, _t = G ? G.emptyScript : "", Y = k.reactiveElementPolyfillSupport, q = { toAttribute(r, t) {
56
+ const { is: wt, defineProperty: bt, getOwnPropertyDescriptor: At, getOwnPropertyNames: vt, getOwnPropertySymbols: xt, getPrototypeOf: Et } = Object, m = globalThis, Q = m.trustedTypes, St = Q ? Q.emptyScript : "", B = m.reactiveElementPolyfillSupport, k = (r, t) => r, W = { toAttribute(r, t) {
53
57
  switch (t) {
54
58
  case Boolean:
55
- r = r ? _t : null;
59
+ r = r ? St : null;
56
60
  break;
57
61
  case Object:
58
62
  case Array:
@@ -77,131 +81,154 @@ const k = window, G = k.trustedTypes, _t = G ? G.emptyScript : "", Y = k.reactiv
77
81
  }
78
82
  }
79
83
  return e;
80
- } }, ht = (r, t) => t !== r && (t == t || r == r), B = { attribute: !0, type: String, converter: q, reflect: !1, hasChanged: ht }, W = "finalized";
81
- let A = class extends HTMLElement {
82
- constructor() {
83
- super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this.u();
84
- }
84
+ } }, at = (r, t) => !wt(r, t), X = { attribute: !0, type: String, converter: W, reflect: !1, hasChanged: at };
85
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), m.litPropertyMetadata ?? (m.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
86
+ class v extends HTMLElement {
85
87
  static addInitializer(t) {
86
- var e;
87
- this.finalize(), ((e = this.h) !== null && e !== void 0 ? e : this.h = []).push(t);
88
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
88
89
  }
89
90
  static get observedAttributes() {
90
- this.finalize();
91
- const t = [];
92
- return this.elementProperties.forEach((e, i) => {
93
- const s = this._$Ep(i, e);
94
- s !== void 0 && (this._$Ev.set(s, i), t.push(s));
95
- }), t;
96
- }
97
- static createProperty(t, e = B) {
98
- if (e.state && (e.attribute = !1), this.finalize(), this.elementProperties.set(t, e), !e.noAccessor && !this.prototype.hasOwnProperty(t)) {
99
- const i = typeof t == "symbol" ? Symbol() : "__" + t, s = this.getPropertyDescriptor(t, i, e);
100
- s !== void 0 && Object.defineProperty(this.prototype, t, s);
91
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
92
+ }
93
+ static createProperty(t, e = X) {
94
+ if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
95
+ const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
96
+ i !== void 0 && bt(this.prototype, t, i);
101
97
  }
102
98
  }
103
- static getPropertyDescriptor(t, e, i) {
104
- return { get() {
99
+ static getPropertyDescriptor(t, e, s) {
100
+ const { get: i, set: n } = At(this.prototype, t) ?? { get() {
105
101
  return this[e];
106
- }, set(s) {
107
- const n = this[t];
108
- this[e] = s, this.requestUpdate(t, n, i);
102
+ }, set(o) {
103
+ this[e] = o;
104
+ } };
105
+ return { get() {
106
+ return i == null ? void 0 : i.call(this);
107
+ }, set(o) {
108
+ const d = i == null ? void 0 : i.call(this);
109
+ n.call(this, o), this.requestUpdate(t, d, s);
109
110
  }, configurable: !0, enumerable: !0 };
110
111
  }
111
112
  static getPropertyOptions(t) {
112
- return this.elementProperties.get(t) || B;
113
+ return this.elementProperties.get(t) ?? X;
114
+ }
115
+ static _$Ei() {
116
+ if (this.hasOwnProperty(k("elementProperties")))
117
+ return;
118
+ const t = Et(this);
119
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
113
120
  }
114
121
  static finalize() {
115
- if (this.hasOwnProperty(W))
116
- return !1;
117
- this[W] = !0;
118
- const t = Object.getPrototypeOf(this);
119
- if (t.finalize(), t.h !== void 0 && (this.h = [...t.h]), this.elementProperties = new Map(t.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
120
- const e = this.properties, i = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
121
- for (const s of i)
122
- this.createProperty(s, e[s]);
122
+ if (this.hasOwnProperty(k("finalized")))
123
+ return;
124
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(k("properties"))) {
125
+ const e = this.properties, s = [...vt(e), ...xt(e)];
126
+ for (const i of s)
127
+ this.createProperty(i, e[i]);
123
128
  }
124
- return this.elementStyles = this.finalizeStyles(this.styles), !0;
129
+ const t = this[Symbol.metadata];
130
+ if (t !== null) {
131
+ const e = litPropertyMetadata.get(t);
132
+ if (e !== void 0)
133
+ for (const [s, i] of e)
134
+ this.elementProperties.set(s, i);
135
+ }
136
+ this._$Eh = /* @__PURE__ */ new Map();
137
+ for (const [e, s] of this.elementProperties) {
138
+ const i = this._$Eu(e, s);
139
+ i !== void 0 && this._$Eh.set(i, e);
140
+ }
141
+ this.elementStyles = this.finalizeStyles(this.styles);
125
142
  }
126
143
  static finalizeStyles(t) {
127
144
  const e = [];
128
145
  if (Array.isArray(t)) {
129
- const i = new Set(t.flat(1 / 0).reverse());
130
- for (const s of i)
131
- e.unshift(X(s));
146
+ const s = new Set(t.flat(1 / 0).reverse());
147
+ for (const i of s)
148
+ e.unshift(G(i));
132
149
  } else
133
- t !== void 0 && e.push(X(t));
150
+ t !== void 0 && e.push(G(t));
134
151
  return e;
135
152
  }
136
- static _$Ep(t, e) {
137
- const i = e.attribute;
138
- return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
153
+ static _$Eu(t, e) {
154
+ const s = e.attribute;
155
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
139
156
  }
140
- u() {
157
+ constructor() {
158
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
159
+ }
160
+ _$Ev() {
141
161
  var t;
142
- this._$E_ = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), (t = this.constructor.h) === null || t === void 0 || t.forEach((e) => e(this));
162
+ this._$Eg = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
143
163
  }
144
164
  addController(t) {
145
- var e, i;
146
- ((e = this._$ES) !== null && e !== void 0 ? e : this._$ES = []).push(t), this.renderRoot !== void 0 && this.isConnected && ((i = t.hostConnected) === null || i === void 0 || i.call(t));
165
+ var e;
166
+ (this._$ES ?? (this._$ES = [])).push(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
147
167
  }
148
168
  removeController(t) {
149
169
  var e;
150
- (e = this._$ES) === null || e === void 0 || e.splice(this._$ES.indexOf(t) >>> 0, 1);
170
+ (e = this._$ES) == null || e.splice(this._$ES.indexOf(t) >>> 0, 1);
151
171
  }
152
- _$Eg() {
153
- this.constructor.elementProperties.forEach((t, e) => {
154
- this.hasOwnProperty(e) && (this._$Ei.set(e, this[e]), delete this[e]);
155
- });
172
+ _$E_() {
173
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
174
+ for (const s of e.keys())
175
+ this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
176
+ t.size > 0 && (this._$Ep = t);
156
177
  }
157
178
  createRenderRoot() {
158
- var t;
159
- const e = (t = this.shadowRoot) !== null && t !== void 0 ? t : this.attachShadow(this.constructor.shadowRootOptions);
160
- return yt(e, this.constructor.elementStyles), e;
179
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
180
+ return _t(t, this.constructor.elementStyles), t;
161
181
  }
162
182
  connectedCallback() {
163
183
  var t;
164
- this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) === null || t === void 0 || t.forEach((e) => {
165
- var i;
166
- return (i = e.hostConnected) === null || i === void 0 ? void 0 : i.call(e);
184
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$ES) == null || t.forEach((e) => {
185
+ var s;
186
+ return (s = e.hostConnected) == null ? void 0 : s.call(e);
167
187
  });
168
188
  }
169
189
  enableUpdating(t) {
170
190
  }
171
191
  disconnectedCallback() {
172
192
  var t;
173
- (t = this._$ES) === null || t === void 0 || t.forEach((e) => {
174
- var i;
175
- return (i = e.hostDisconnected) === null || i === void 0 ? void 0 : i.call(e);
193
+ (t = this._$ES) == null || t.forEach((e) => {
194
+ var s;
195
+ return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
176
196
  });
177
197
  }
178
- attributeChangedCallback(t, e, i) {
179
- this._$AK(t, i);
198
+ attributeChangedCallback(t, e, s) {
199
+ this._$AK(t, s);
180
200
  }
181
- _$EO(t, e, i = B) {
182
- var s;
183
- const n = this.constructor._$Ep(t, i);
184
- if (n !== void 0 && i.reflect === !0) {
185
- const o = (((s = i.converter) === null || s === void 0 ? void 0 : s.toAttribute) !== void 0 ? i.converter : q).toAttribute(e, i.type);
186
- this._$El = t, o == null ? this.removeAttribute(n) : this.setAttribute(n, o), this._$El = null;
201
+ _$EO(t, e) {
202
+ var n;
203
+ const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
204
+ if (i !== void 0 && s.reflect === !0) {
205
+ const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : W).toAttribute(e, s.type);
206
+ this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
187
207
  }
188
208
  }
189
209
  _$AK(t, e) {
190
- var i;
191
- const s = this.constructor, n = s._$Ev.get(t);
192
- if (n !== void 0 && this._$El !== n) {
193
- const o = s.getPropertyOptions(n), h = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((i = o.converter) === null || i === void 0 ? void 0 : i.fromAttribute) !== void 0 ? o.converter : q;
194
- this._$El = n, this[n] = h.fromAttribute(e, o.type), this._$El = null;
210
+ var n;
211
+ const s = this.constructor, i = s._$Eh.get(t);
212
+ if (i !== void 0 && this._$Em !== i) {
213
+ const o = s.getPropertyOptions(i), d = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : W;
214
+ this._$Em = i, this[i] = d.fromAttribute(e, o.type), this._$Em = null;
215
+ }
216
+ }
217
+ requestUpdate(t, e, s, i = !1, n) {
218
+ if (t !== void 0) {
219
+ if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? at)(i ? n : this[t], e))
220
+ return;
221
+ this.C(t, e, s);
195
222
  }
223
+ this.isUpdatePending === !1 && (this._$Eg = this._$EP());
196
224
  }
197
- requestUpdate(t, e, i) {
198
- let s = !0;
199
- t !== void 0 && (((i = i || this.constructor.getPropertyOptions(t)).hasChanged || ht)(this[t], e) ? (this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$El !== t && (this._$EC === void 0 && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t, i))) : s = !1), !this.isUpdatePending && s && (this._$E_ = this._$Ej());
225
+ C(t, e, s) {
226
+ this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
200
227
  }
201
- async _$Ej() {
228
+ async _$EP() {
202
229
  this.isUpdatePending = !0;
203
230
  try {
204
- await this._$E_;
231
+ await this._$Eg;
205
232
  } catch (e) {
206
233
  Promise.reject(e);
207
234
  }
@@ -212,139 +239,141 @@ let A = class extends HTMLElement {
212
239
  return this.performUpdate();
213
240
  }
214
241
  performUpdate() {
215
- var t;
242
+ var s;
216
243
  if (!this.isUpdatePending)
217
244
  return;
218
- this.hasUpdated, this._$Ei && (this._$Ei.forEach((s, n) => this[n] = s), this._$Ei = void 0);
219
- let e = !1;
220
- const i = this._$AL;
245
+ if (!this.hasUpdated) {
246
+ if (this._$Ep) {
247
+ for (const [n, o] of this._$Ep)
248
+ this[n] = o;
249
+ this._$Ep = void 0;
250
+ }
251
+ const i = this.constructor.elementProperties;
252
+ if (i.size > 0)
253
+ for (const [n, o] of i)
254
+ o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.C(n, this[n], o);
255
+ }
256
+ let t = !1;
257
+ const e = this._$AL;
221
258
  try {
222
- e = this.shouldUpdate(i), e ? (this.willUpdate(i), (t = this._$ES) === null || t === void 0 || t.forEach((s) => {
259
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$ES) == null || s.forEach((i) => {
223
260
  var n;
224
- return (n = s.hostUpdate) === null || n === void 0 ? void 0 : n.call(s);
225
- }), this.update(i)) : this._$Ek();
226
- } catch (s) {
227
- throw e = !1, this._$Ek(), s;
261
+ return (n = i.hostUpdate) == null ? void 0 : n.call(i);
262
+ }), this.update(e)) : this._$ET();
263
+ } catch (i) {
264
+ throw t = !1, this._$ET(), i;
228
265
  }
229
- e && this._$AE(i);
266
+ t && this._$AE(e);
230
267
  }
231
268
  willUpdate(t) {
232
269
  }
233
270
  _$AE(t) {
234
271
  var e;
235
- (e = this._$ES) === null || e === void 0 || e.forEach((i) => {
236
- var s;
237
- return (s = i.hostUpdated) === null || s === void 0 ? void 0 : s.call(i);
272
+ (e = this._$ES) == null || e.forEach((s) => {
273
+ var i;
274
+ return (i = s.hostUpdated) == null ? void 0 : i.call(s);
238
275
  }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
239
276
  }
240
- _$Ek() {
277
+ _$ET() {
241
278
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
242
279
  }
243
280
  get updateComplete() {
244
281
  return this.getUpdateComplete();
245
282
  }
246
283
  getUpdateComplete() {
247
- return this._$E_;
284
+ return this._$Eg;
248
285
  }
249
286
  shouldUpdate(t) {
250
287
  return !0;
251
288
  }
252
289
  update(t) {
253
- this._$EC !== void 0 && (this._$EC.forEach((e, i) => this._$EO(i, this[i], e)), this._$EC = void 0), this._$Ek();
290
+ this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EO(e, this[e]))), this._$ET();
254
291
  }
255
292
  updated(t) {
256
293
  }
257
294
  firstUpdated(t) {
258
295
  }
259
- };
260
- A[W] = !0, A.elementProperties = /* @__PURE__ */ new Map(), A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, Y == null || Y({ ReactiveElement: A }), ((R = k.reactiveElementVersions) !== null && R !== void 0 ? R : k.reactiveElementVersions = []).push("1.6.2");
296
+ }
297
+ v.elementStyles = [], v.shadowRootOptions = { mode: "open" }, v[k("elementProperties")] = /* @__PURE__ */ new Map(), v[k("finalized")] = /* @__PURE__ */ new Map(), B == null || B({ ReactiveElement: v }), (m.reactiveElementVersions ?? (m.reactiveElementVersions = [])).push("2.0.1");
261
298
  /**
262
299
  * @license
263
300
  * Copyright 2017 Google LLC
264
301
  * SPDX-License-Identifier: BSD-3-Clause
265
302
  */
266
- var I;
267
- const T = window, b = T.trustedTypes, tt = b ? b.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, Z = "$lit$", y = `lit$${(Math.random() + "").slice(9)}$`, dt = "?" + y, ft = `<${dt}>`, m = document, C = () => m.createComment(""), H = (r) => r === null || typeof r != "object" && typeof r != "function", ct = Array.isArray, mt = (r) => ct(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", F = `[
268
- \f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, et = /-->/g, it = />/g, _ = RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^
269
- \f\r"'\`<>=]|("|')|))|$)`, "g"), st = /'/g, rt = /"/g, ut = /^(?:script|style|textarea|title)$/i, At = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), bt = At(1), w = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), nt = /* @__PURE__ */ new WeakMap(), f = m.createTreeWalker(m, 129, null, !1);
303
+ const M = globalThis, O = M.trustedTypes, Y = O ? O.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ht = "$lit$", f = `lit$${(Math.random() + "").slice(9)}$`, lt = "?" + f, Ct = `<${lt}>`, b = document, U = () => b.createComment(""), P = (r) => r === null || typeof r != "object" && typeof r != "function", dt = Array.isArray, Ht = (r) => dt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", z = `[
304
+ \f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, tt = /-->/g, et = />/g, _ = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
305
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), st = /'/g, it = /"/g, ct = /^(?:script|style|textarea|title)$/i, kt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), F = kt(1), S = Symbol.for("lit-noChange"), l = Symbol.for("lit-nothing"), rt = /* @__PURE__ */ new WeakMap(), w = b.createTreeWalker(b, 129);
270
306
  function pt(r, t) {
271
307
  if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
272
308
  throw Error("invalid template strings array");
273
- return tt !== void 0 ? tt.createHTML(t) : t;
309
+ return Y !== void 0 ? Y.createHTML(t) : t;
274
310
  }
275
- const wt = (r, t) => {
276
- const e = r.length - 1, i = [];
277
- let s, n = t === 2 ? "<svg>" : "", o = E;
278
- for (let h = 0; h < e; h++) {
279
- const l = r[h];
280
- let a, d, c = -1, p = 0;
281
- for (; p < l.length && (o.lastIndex = p, d = o.exec(l), d !== null); )
282
- p = o.lastIndex, o === E ? d[1] === "!--" ? o = et : d[1] !== void 0 ? o = it : d[2] !== void 0 ? (ut.test(d[2]) && (s = RegExp("</" + d[2], "g")), o = _) : d[3] !== void 0 && (o = _) : o === _ ? d[0] === ">" ? (o = s ?? E, c = -1) : d[1] === void 0 ? c = -2 : (c = o.lastIndex - d[2].length, a = d[1], o = d[3] === void 0 ? _ : d[3] === '"' ? rt : st) : o === rt || o === st ? o = _ : o === et || o === it ? o = E : (o = _, s = void 0);
283
- const $ = o === _ && r[h + 1].startsWith("/>") ? " " : "";
284
- n += o === E ? l + ft : c >= 0 ? (i.push(a), l.slice(0, c) + Z + l.slice(c) + y + $) : l + y + (c === -2 ? (i.push(void 0), h) : $);
285
- }
286
- return [pt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
311
+ const Mt = (r, t) => {
312
+ const e = r.length - 1, s = [];
313
+ let i, n = t === 2 ? "<svg>" : "", o = H;
314
+ for (let d = 0; d < e; d++) {
315
+ const a = r[d];
316
+ let c, p, h = -1, y = 0;
317
+ for (; y < a.length && (o.lastIndex = y, p = o.exec(a), p !== null); )
318
+ y = o.lastIndex, o === H ? p[1] === "!--" ? o = tt : p[1] !== void 0 ? o = et : p[2] !== void 0 ? (ct.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = _) : p[3] !== void 0 && (o = _) : o === _ ? p[0] === ">" ? (o = i ?? H, h = -1) : p[1] === void 0 ? h = -2 : (h = o.lastIndex - p[2].length, c = p[1], o = p[3] === void 0 ? _ : p[3] === '"' ? it : st) : o === it || o === st ? o = _ : o === tt || o === et ? o = H : (o = _, i = void 0);
319
+ const g = o === _ && r[d + 1].startsWith("/>") ? " " : "";
320
+ n += o === H ? a + Ct : h >= 0 ? (s.push(c), a.slice(0, h) + ht + a.slice(h) + f + g) : a + f + (h === -2 ? d : g);
321
+ }
322
+ return [pt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), s];
287
323
  };
288
- class U {
289
- constructor({ strings: t, _$litType$: e }, i) {
290
- let s;
324
+ class I {
325
+ constructor({ strings: t, _$litType$: e }, s) {
326
+ let i;
291
327
  this.parts = [];
292
328
  let n = 0, o = 0;
293
- const h = t.length - 1, l = this.parts, [a, d] = wt(t, e);
294
- if (this.el = U.createElement(a, i), f.currentNode = this.el.content, e === 2) {
295
- const c = this.el.content, p = c.firstChild;
296
- p.remove(), c.append(...p.childNodes);
329
+ const d = t.length - 1, a = this.parts, [c, p] = Mt(t, e);
330
+ if (this.el = I.createElement(c, s), w.currentNode = this.el.content, e === 2) {
331
+ const h = this.el.content.firstChild;
332
+ h.replaceWith(...h.childNodes);
297
333
  }
298
- for (; (s = f.nextNode()) !== null && l.length < h; ) {
299
- if (s.nodeType === 1) {
300
- if (s.hasAttributes()) {
301
- const c = [];
302
- for (const p of s.getAttributeNames())
303
- if (p.endsWith(Z) || p.startsWith(y)) {
304
- const $ = d[o++];
305
- if (c.push(p), $ !== void 0) {
306
- const $t = s.getAttribute($.toLowerCase() + Z).split(y), D = /([.?@])?(.*)/.exec($);
307
- l.push({ type: 1, index: n, name: D[2], strings: $t, ctor: D[1] === "." ? Et : D[1] === "?" ? Ct : D[1] === "@" ? Ht : N });
308
- } else
309
- l.push({ type: 6, index: n });
310
- }
311
- for (const p of c)
312
- s.removeAttribute(p);
313
- }
314
- if (ut.test(s.tagName)) {
315
- const c = s.textContent.split(y), p = c.length - 1;
316
- if (p > 0) {
317
- s.textContent = b ? b.emptyScript : "";
318
- for (let $ = 0; $ < p; $++)
319
- s.append(c[$], C()), f.nextNode(), l.push({ type: 2, index: ++n });
320
- s.append(c[p], C());
334
+ for (; (i = w.nextNode()) !== null && a.length < d; ) {
335
+ if (i.nodeType === 1) {
336
+ if (i.hasAttributes())
337
+ for (const h of i.getAttributeNames())
338
+ if (h.endsWith(ht)) {
339
+ const y = p[o++], g = i.getAttribute(h).split(f), D = /([.?@])?(.*)/.exec(y);
340
+ a.push({ type: 1, index: n, name: D[2], strings: g, ctor: D[1] === "." ? Pt : D[1] === "?" ? It : D[1] === "@" ? Lt : N }), i.removeAttribute(h);
341
+ } else
342
+ h.startsWith(f) && (a.push({ type: 6, index: n }), i.removeAttribute(h));
343
+ if (ct.test(i.tagName)) {
344
+ const h = i.textContent.split(f), y = h.length - 1;
345
+ if (y > 0) {
346
+ i.textContent = O ? O.emptyScript : "";
347
+ for (let g = 0; g < y; g++)
348
+ i.append(h[g], U()), w.nextNode(), a.push({ type: 2, index: ++n });
349
+ i.append(h[y], U());
321
350
  }
322
351
  }
323
- } else if (s.nodeType === 8)
324
- if (s.data === dt)
325
- l.push({ type: 2, index: n });
352
+ } else if (i.nodeType === 8)
353
+ if (i.data === lt)
354
+ a.push({ type: 2, index: n });
326
355
  else {
327
- let c = -1;
328
- for (; (c = s.data.indexOf(y, c + 1)) !== -1; )
329
- l.push({ type: 7, index: n }), c += y.length - 1;
356
+ let h = -1;
357
+ for (; (h = i.data.indexOf(f, h + 1)) !== -1; )
358
+ a.push({ type: 7, index: n }), h += f.length - 1;
330
359
  }
331
360
  n++;
332
361
  }
333
362
  }
334
363
  static createElement(t, e) {
335
- const i = m.createElement("template");
336
- return i.innerHTML = t, i;
364
+ const s = b.createElement("template");
365
+ return s.innerHTML = t, s;
337
366
  }
338
367
  }
339
- function x(r, t, e = r, i) {
340
- var s, n, o, h;
341
- if (t === w)
368
+ function C(r, t, e = r, s) {
369
+ var o, d;
370
+ if (t === S)
342
371
  return t;
343
- let l = i !== void 0 ? (s = e._$Co) === null || s === void 0 ? void 0 : s[i] : e._$Cl;
344
- const a = H(t) ? void 0 : t._$litDirective$;
345
- return (l == null ? void 0 : l.constructor) !== a && ((n = l == null ? void 0 : l._$AO) === null || n === void 0 || n.call(l, !1), a === void 0 ? l = void 0 : (l = new a(r), l._$AT(r, e, i)), i !== void 0 ? ((o = (h = e)._$Co) !== null && o !== void 0 ? o : h._$Co = [])[i] = l : e._$Cl = l), l !== void 0 && (t = x(r, l._$AS(r, t.values), l, i)), t;
372
+ let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
373
+ const n = P(t) ? void 0 : t._$litDirective$;
374
+ return (i == null ? void 0 : i.constructor) !== n && ((d = i == null ? void 0 : i._$AO) == null || d.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = C(r, i._$AS(r, t.values), i, s)), t;
346
375
  }
347
- class xt {
376
+ class Ut {
348
377
  constructor(t, e) {
349
378
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
350
379
  }
@@ -355,33 +384,31 @@ class xt {
355
384
  return this._$AM._$AU;
356
385
  }
357
386
  u(t) {
358
- var e;
359
- const { el: { content: i }, parts: s } = this._$AD, n = ((e = t == null ? void 0 : t.creationScope) !== null && e !== void 0 ? e : m).importNode(i, !0);
360
- f.currentNode = n;
361
- let o = f.nextNode(), h = 0, l = 0, a = s[0];
387
+ const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? b).importNode(e, !0);
388
+ w.currentNode = i;
389
+ let n = w.nextNode(), o = 0, d = 0, a = s[0];
362
390
  for (; a !== void 0; ) {
363
- if (h === a.index) {
364
- let d;
365
- a.type === 2 ? d = new M(o, o.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (d = new Ut(o, this, t)), this._$AV.push(d), a = s[++l];
391
+ if (o === a.index) {
392
+ let c;
393
+ a.type === 2 ? c = new L(n, n.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (c = new Dt(n, this, t)), this._$AV.push(c), a = s[++d];
366
394
  }
367
- h !== (a == null ? void 0 : a.index) && (o = f.nextNode(), h++);
395
+ o !== (a == null ? void 0 : a.index) && (n = w.nextNode(), o++);
368
396
  }
369
- return f.currentNode = m, n;
397
+ return w.currentNode = b, i;
370
398
  }
371
- v(t) {
399
+ p(t) {
372
400
  let e = 0;
373
- for (const i of this._$AV)
374
- i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
401
+ for (const s of this._$AV)
402
+ s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
375
403
  }
376
404
  }
377
- class M {
378
- constructor(t, e, i, s) {
379
- var n;
380
- this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cp = (n = s == null ? void 0 : s.isConnected) === null || n === void 0 || n;
381
- }
405
+ class L {
382
406
  get _$AU() {
383
- var t, e;
384
- return (e = (t = this._$AM) === null || t === void 0 ? void 0 : t._$AU) !== null && e !== void 0 ? e : this._$Cp;
407
+ var t;
408
+ return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
409
+ }
410
+ constructor(t, e, s, i) {
411
+ this.type = 2, this._$AH = l, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
385
412
  }
386
413
  get parentNode() {
387
414
  let t = this._$AA.parentNode;
@@ -395,7 +422,7 @@ class M {
395
422
  return this._$AB;
396
423
  }
397
424
  _$AI(t, e = this) {
398
- t = x(this, t, e), H(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== w && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : mt(t) ? this.T(t) : this._(t);
425
+ t = C(this, t, e), P(t) ? t === l || t == null || t === "" ? (this._$AH !== l && this._$AR(), this._$AH = l) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.g(t) : t.nodeType !== void 0 ? this.$(t) : Ht(t) ? this.T(t) : this._(t);
399
426
  }
400
427
  k(t) {
401
428
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -404,165 +431,201 @@ class M {
404
431
  this._$AH !== t && (this._$AR(), this._$AH = this.k(t));
405
432
  }
406
433
  _(t) {
407
- this._$AH !== u && H(this._$AH) ? this._$AA.nextSibling.data = t : this.$(m.createTextNode(t)), this._$AH = t;
434
+ this._$AH !== l && P(this._$AH) ? this._$AA.nextSibling.data = t : this.$(b.createTextNode(t)), this._$AH = t;
408
435
  }
409
436
  g(t) {
410
- var e;
411
- const { values: i, _$litType$: s } = t, n = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = U.createElement(pt(s.h, s.h[0]), this.options)), s);
412
- if (((e = this._$AH) === null || e === void 0 ? void 0 : e._$AD) === n)
413
- this._$AH.v(i);
437
+ var n;
438
+ const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = I.createElement(pt(s.h, s.h[0]), this.options)), s);
439
+ if (((n = this._$AH) == null ? void 0 : n._$AD) === i)
440
+ this._$AH.p(e);
414
441
  else {
415
- const o = new xt(n, this), h = o.u(this.options);
416
- o.v(i), this.$(h), this._$AH = o;
442
+ const o = new Ut(i, this), d = o.u(this.options);
443
+ o.p(e), this.$(d), this._$AH = o;
417
444
  }
418
445
  }
419
446
  _$AC(t) {
420
- let e = nt.get(t.strings);
421
- return e === void 0 && nt.set(t.strings, e = new U(t)), e;
447
+ let e = rt.get(t.strings);
448
+ return e === void 0 && rt.set(t.strings, e = new I(t)), e;
422
449
  }
423
450
  T(t) {
424
- ct(this._$AH) || (this._$AH = [], this._$AR());
451
+ dt(this._$AH) || (this._$AH = [], this._$AR());
425
452
  const e = this._$AH;
426
- let i, s = 0;
453
+ let s, i = 0;
427
454
  for (const n of t)
428
- s === e.length ? e.push(i = new M(this.k(C()), this.k(C()), this, this.options)) : i = e[s], i._$AI(n), s++;
429
- s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
455
+ i === e.length ? e.push(s = new L(this.k(U()), this.k(U()), this, this.options)) : s = e[i], s._$AI(n), i++;
456
+ i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
430
457
  }
431
458
  _$AR(t = this._$AA.nextSibling, e) {
432
- var i;
433
- for ((i = this._$AP) === null || i === void 0 || i.call(this, !1, !0, e); t && t !== this._$AB; ) {
434
- const s = t.nextSibling;
435
- t.remove(), t = s;
459
+ var s;
460
+ for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
461
+ const i = t.nextSibling;
462
+ t.remove(), t = i;
436
463
  }
437
464
  }
438
465
  setConnected(t) {
439
466
  var e;
440
- this._$AM === void 0 && (this._$Cp = t, (e = this._$AP) === null || e === void 0 || e.call(this, t));
467
+ this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
441
468
  }
442
469
  }
443
470
  class N {
444
- constructor(t, e, i, s, n) {
445
- this.type = 1, this._$AH = u, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = u;
446
- }
447
471
  get tagName() {
448
472
  return this.element.tagName;
449
473
  }
450
474
  get _$AU() {
451
475
  return this._$AM._$AU;
452
476
  }
453
- _$AI(t, e = this, i, s) {
477
+ constructor(t, e, s, i, n) {
478
+ this.type = 1, this._$AH = l, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = l;
479
+ }
480
+ _$AI(t, e = this, s, i) {
454
481
  const n = this.strings;
455
482
  let o = !1;
456
483
  if (n === void 0)
457
- t = x(this, t, e, 0), o = !H(t) || t !== this._$AH && t !== w, o && (this._$AH = t);
484
+ t = C(this, t, e, 0), o = !P(t) || t !== this._$AH && t !== S, o && (this._$AH = t);
458
485
  else {
459
- const h = t;
460
- let l, a;
461
- for (t = n[0], l = 0; l < n.length - 1; l++)
462
- a = x(this, h[i + l], e, l), a === w && (a = this._$AH[l]), o || (o = !H(a) || a !== this._$AH[l]), a === u ? t = u : t !== u && (t += (a ?? "") + n[l + 1]), this._$AH[l] = a;
486
+ const d = t;
487
+ let a, c;
488
+ for (t = n[0], a = 0; a < n.length - 1; a++)
489
+ c = C(this, d[s + a], e, a), c === S && (c = this._$AH[a]), o || (o = !P(c) || c !== this._$AH[a]), c === l ? t = l : t !== l && (t += (c ?? "") + n[a + 1]), this._$AH[a] = c;
463
490
  }
464
- o && !s && this.j(t);
491
+ o && !i && this.O(t);
465
492
  }
466
- j(t) {
467
- t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
493
+ O(t) {
494
+ t === l ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
468
495
  }
469
496
  }
470
- class Et extends N {
497
+ class Pt extends N {
471
498
  constructor() {
472
499
  super(...arguments), this.type = 3;
473
500
  }
474
- j(t) {
475
- this.element[this.name] = t === u ? void 0 : t;
501
+ O(t) {
502
+ this.element[this.name] = t === l ? void 0 : t;
476
503
  }
477
504
  }
478
- const St = b ? b.emptyScript : "";
479
- class Ct extends N {
505
+ class It extends N {
480
506
  constructor() {
481
507
  super(...arguments), this.type = 4;
482
508
  }
483
- j(t) {
484
- t && t !== u ? this.element.setAttribute(this.name, St) : this.element.removeAttribute(this.name);
509
+ O(t) {
510
+ this.element.toggleAttribute(this.name, !!t && t !== l);
485
511
  }
486
512
  }
487
- class Ht extends N {
488
- constructor(t, e, i, s, n) {
489
- super(t, e, i, s, n), this.type = 5;
513
+ class Lt extends N {
514
+ constructor(t, e, s, i, n) {
515
+ super(t, e, s, i, n), this.type = 5;
490
516
  }
491
517
  _$AI(t, e = this) {
492
- var i;
493
- if ((t = (i = x(this, t, e, 0)) !== null && i !== void 0 ? i : u) === w)
518
+ if ((t = C(this, t, e, 0) ?? l) === S)
494
519
  return;
495
- const s = this._$AH, n = t === u && s !== u || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== u && (s === u || n);
496
- n && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
520
+ const s = this._$AH, i = t === l && s !== l || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== l && (s === l || i);
521
+ i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
497
522
  }
498
523
  handleEvent(t) {
499
- var e, i;
500
- typeof this._$AH == "function" ? this._$AH.call((i = (e = this.options) === null || e === void 0 ? void 0 : e.host) !== null && i !== void 0 ? i : this.element, t) : this._$AH.handleEvent(t);
524
+ var e;
525
+ typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
501
526
  }
502
527
  }
503
- class Ut {
504
- constructor(t, e, i) {
505
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
528
+ class Dt {
529
+ constructor(t, e, s) {
530
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
506
531
  }
507
532
  get _$AU() {
508
533
  return this._$AM._$AU;
509
534
  }
510
535
  _$AI(t) {
511
- x(this, t);
536
+ C(this, t);
512
537
  }
513
538
  }
514
- const ot = T.litHtmlPolyfillSupport;
515
- ot == null || ot(U, M), ((I = T.litHtmlVersions) !== null && I !== void 0 ? I : T.litHtmlVersions = []).push("2.8.0");
516
- const Pt = (r, t, e) => {
517
- var i, s;
518
- const n = (i = e == null ? void 0 : e.renderBefore) !== null && i !== void 0 ? i : t;
519
- let o = n._$litPart$;
520
- if (o === void 0) {
521
- const h = (s = e == null ? void 0 : e.renderBefore) !== null && s !== void 0 ? s : null;
522
- n._$litPart$ = o = new M(t.insertBefore(C(), h), h, void 0, e ?? {});
523
- }
524
- return o._$AI(r), o;
539
+ const q = M.litHtmlPolyfillSupport;
540
+ q == null || q(I, L), (M.litHtmlVersions ?? (M.litHtmlVersions = [])).push("3.1.0");
541
+ const Tt = (r, t, e) => {
542
+ const s = (e == null ? void 0 : e.renderBefore) ?? t;
543
+ let i = s._$litPart$;
544
+ if (i === void 0) {
545
+ const n = (e == null ? void 0 : e.renderBefore) ?? null;
546
+ s._$litPart$ = i = new L(t.insertBefore(U(), n), n, void 0, e ?? {});
547
+ }
548
+ return i._$AI(r), i;
525
549
  };
526
550
  /**
527
551
  * @license
528
552
  * Copyright 2017 Google LLC
529
553
  * SPDX-License-Identifier: BSD-3-Clause
530
554
  */
531
- var z, j;
532
- class S extends A {
555
+ class x extends v {
533
556
  constructor() {
534
557
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
535
558
  }
536
559
  createRenderRoot() {
537
- var t, e;
538
- const i = super.createRenderRoot();
539
- return (t = (e = this.renderOptions).renderBefore) !== null && t !== void 0 || (e.renderBefore = i.firstChild), i;
560
+ var e;
561
+ const t = super.createRenderRoot();
562
+ return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
540
563
  }
541
564
  update(t) {
542
565
  const e = this.render();
543
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Pt(e, this.renderRoot, this.renderOptions);
566
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Tt(e, this.renderRoot, this.renderOptions);
544
567
  }
545
568
  connectedCallback() {
546
569
  var t;
547
- super.connectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!0);
570
+ super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
548
571
  }
549
572
  disconnectedCallback() {
550
573
  var t;
551
- super.disconnectedCallback(), (t = this._$Do) === null || t === void 0 || t.setConnected(!1);
574
+ super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
552
575
  }
553
576
  render() {
554
- return w;
577
+ return S;
555
578
  }
556
579
  }
557
- S.finalized = !0, S._$litElement$ = !0, (z = globalThis.litElementHydrateSupport) === null || z === void 0 || z.call(globalThis, { LitElement: S });
558
- const lt = globalThis.litElementPolyfillSupport;
559
- lt == null || lt({ LitElement: S });
560
- ((j = globalThis.litElementVersions) !== null && j !== void 0 ? j : globalThis.litElementVersions = []).push("3.3.2");
561
- const Mt = `
562
- :host {
563
- display: block;
564
- }
565
- `, Dt = `
580
+ var ot;
581
+ x._$litElement$ = !0, x.finalized = !0, (ot = globalThis.litElementHydrateSupport) == null || ot.call(globalThis, { LitElement: x });
582
+ const j = globalThis.litElementPolyfillSupport;
583
+ j == null || j({ LitElement: x });
584
+ (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.1");
585
+ /**
586
+ * @license
587
+ * Copyright 2017 Google LLC
588
+ * SPDX-License-Identifier: BSD-3-Clause
589
+ */
590
+ const Ot = (r) => (...t) => ({ _$litDirective$: r, values: t });
591
+ let Ft = class {
592
+ constructor(t) {
593
+ }
594
+ get _$AU() {
595
+ return this._$AM._$AU;
596
+ }
597
+ _$AT(t, e, s) {
598
+ this._$Ct = t, this._$AM = e, this._$Ci = s;
599
+ }
600
+ _$AS(t, e) {
601
+ return this.update(t, e);
602
+ }
603
+ update(t, e) {
604
+ return this.render(...e);
605
+ }
606
+ };
607
+ /**
608
+ * @license
609
+ * Copyright 2020 Google LLC
610
+ * SPDX-License-Identifier: BSD-3-Clause
611
+ */
612
+ const Nt = {}, Vt = (r, t = Nt) => r._$AH = t;
613
+ /**
614
+ * @license
615
+ * Copyright 2021 Google LLC
616
+ * SPDX-License-Identifier: BSD-3-Clause
617
+ */
618
+ const Rt = Ot(class extends Ft {
619
+ constructor() {
620
+ super(...arguments), this.key = l;
621
+ }
622
+ render(r, t) {
623
+ return this.key = r, t;
624
+ }
625
+ update(r, [t, e]) {
626
+ return t !== this.key && (Vt(r), this.key = t), e;
627
+ }
628
+ }), Bt = `
566
629
  button {
567
630
  /* TODO: why does this only work here and not from :root? */
568
631
  --primary-color: #004170;
@@ -651,74 +714,303 @@ button.small {
651
714
  padding: 12.4px;
652
715
  font-size: .75rem;
653
716
  }
654
- `, Ot = `
655
- * {
656
- font-family: Roboto, sans-serif;
657
- }
717
+ `, ut = `
718
+ * {
719
+ font-family: Roboto, sans-serif;
720
+ }
658
721
 
659
- ${Dt}
722
+ ${Bt}
660
723
 
661
- button.discard:before {
662
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23FF5252' viewBox='0 0 24 24'%3E%3Ctitle%3Etrash-can-outline%3C/title%3E%3Cpath d='M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z' /%3E%3C/svg%3E")
663
- }
724
+ button.discard:before {
725
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23FF5252' viewBox='0 0 24 24'%3E%3Ctitle%3Etrash-can-outline%3C/title%3E%3Cpath d='M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z' /%3E%3C/svg%3E")
726
+ }
727
+
728
+ button.polygon:before {
729
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eshape-polygon-plus%3C/title%3E%3Cpath d='M17,15.7V13H19V17L10,21L3,14L7,5H11V7H8.3L5.4,13.6L10.4,18.6L17,15.7M22,5V7H19V10H17V7H14V5H17V2H19V5H22Z' /%3E%3C/svg%3E");
730
+ }
731
+ ul {
732
+ padding: 0;
733
+ }
734
+ ul ul {
735
+ padding-left: 48px;
736
+ }
737
+ li:hover {
738
+ background: #f0f5f9;
739
+ }
740
+ li.selected {
741
+ background: #f0f5f9;
742
+ }
743
+ li {
744
+ list-style: none;
745
+ padding: 4px;
746
+ }
747
+ li {
748
+ border-bottom: 1px solid #0041703a;
749
+ }
750
+ li:first-child {
751
+ border-top: 1px solid #0041703a;
752
+ }
753
+ li.sortable-chosen {
754
+ background: #eeea;
755
+ }
756
+ li.sortable-drag {
757
+ opacity: 0;
758
+ }
759
+ li.sortable-ghost {
760
+ }
761
+ button.small.icon, button.small.icon::before {
762
+ height: 16px;
763
+ width: 16px;
764
+ padding: 0px;
765
+ }
766
+ button.discard.icon {
767
+ opacity: .7;
768
+ }
769
+ button.discard.icon:hover {
770
+ opacity: 1;
771
+ }
772
+ eox-drawtools-list {
773
+ width: 100%;
774
+ }
775
+ .list {
776
+ width: 100%;
777
+ align-items: center;
778
+ justify-content: space-between;
779
+ display: flex;
780
+ align-items: center;
781
+ cursor: pointer;
782
+ font-size: small;
783
+ gap: 10px;
664
784
 
665
- button.polygon:before {
666
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eshape-polygon-plus%3C/title%3E%3Cpath d='M17,15.7V13H19V17L10,21L3,14L7,5H11V7H8.3L5.4,13.6L10.4,18.6L17,15.7M22,5V7H19V10H17V7H14V5H17V2H19V5H22Z' /%3E%3C/svg%3E");
785
+ }
786
+ label {
787
+ gap: 10px;
788
+ }
789
+ label, span {
790
+ display: flex;
791
+ align-items: center;
792
+ cursor: pointer;
793
+ font-size: small;
794
+ flex-grow: 1;
795
+ }
796
+ `;
797
+ class $t extends x {
798
+ constructor() {
799
+ super();
800
+ /**
801
+ * @type import("../../../map/src/select").EOxSelectInteraction
802
+ */
803
+ A(this, "hoverInteraction");
804
+ /**
805
+ * @type import("../../../map/src/select").EOxSelectInteraction
806
+ */
807
+ A(this, "clickInteraction");
808
+ /**
809
+ * @type string | number
810
+ */
811
+ A(this, "hoverId");
812
+ /**
813
+ * @type string | number
814
+ */
815
+ A(this, "clickId");
816
+ this.eoxMap = null, this.olMap = null, this.draw = null, this.layer = "draw", this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.unstyled = !1;
817
+ }
818
+ /**
819
+ * Delete individual feature @param {any} evt
820
+ */
821
+ _handleDelete(e) {
822
+ e.stopPropagation();
823
+ const s = e.target.getAttribute("index"), i = this.drawnFeatures[s];
824
+ this.drawLayer.getSource().removeFeature(i), this.drawnFeatures.splice(s, 1), this.requestUpdate();
825
+ }
826
+ /**
827
+ * Select and Deselect feature from the list
828
+ *
829
+ * @param {import("ol").Feature} feature
830
+ */
831
+ _handleFeatureSelectAndDeselect(e) {
832
+ const s = e.get("id");
833
+ if (this.clickId === s) {
834
+ const i = this.drawLayer.getSource().getExtent();
835
+ this.olMap.getView().fit(i, { duration: 750 }), this.clickInteraction.highlightById([]);
836
+ } else
837
+ this.clickInteraction.highlightById([s]), this.olMap.getView().fit(e.getGeometry().getExtent(), { duration: 750 });
838
+ this.requestUpdate();
839
+ }
840
+ firstUpdated() {
841
+ this.hoverInteraction = this.eoxMap.selectInteractions.selectHover, this.clickInteraction = this.eoxMap.selectInteractions.selectClick, this.hoverInteraction.selectStyleLayer.on(
842
+ "change",
843
+ () => this.requestUpdate()
844
+ ), this.clickInteraction.selectStyleLayer.on(
845
+ "change",
846
+ () => this.requestUpdate()
847
+ );
848
+ }
849
+ render() {
850
+ var e, s;
851
+ return this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (s = this.clickInteraction) == null ? void 0 : s.selectedFids[0], F`
852
+ <style>
853
+ ${!this.unstyled && ut}
854
+ </style>
855
+ <ul>
856
+ ${this.drawnFeatures.map((i, n) => {
857
+ const o = i.get("id"), d = this.hoverId === o || this.clickId === o;
858
+ return Rt(
859
+ n + 1,
860
+ F`
861
+ <li
862
+ class="${d ? "selected" : l}"
863
+ @mouseover=${() => {
864
+ this.clickId !== o && this.hoverInteraction.highlightById([o]);
865
+ }}
866
+ @mouseout=${() => {
867
+ this.clickId !== o && this.hoverInteraction.highlightById([]);
868
+ }}
869
+ >
870
+ <div
871
+ class="list"
872
+ @click="${() => this._handleFeatureSelectAndDeselect(i)}"
873
+ >
874
+ <span class="title">Feature #${n + 1}</span>
875
+ <button
876
+ index=${n}
877
+ class="icon small discard"
878
+ @click="${this._handleDelete}"
879
+ >
880
+ ${this.unstyled ? "x" : l}
881
+ </button>
882
+ </div>
883
+ </li>
884
+ `
885
+ );
886
+ })}
887
+ </ul>
888
+ `;
889
+ }
890
+ }
891
+ A($t, "properties", {
892
+ eoxMap: { attribute: !1, state: !0 },
893
+ olMap: { attribute: !1, state: !0 },
894
+ draw: { attribute: !1, state: !0 },
895
+ layer: { type: String },
896
+ drawLayer: { attribute: !1, state: !0 },
897
+ drawnFeatures: { attribute: !1, state: !0, type: Array },
898
+ modify: { attribute: !1, state: !0 },
899
+ unstyled: { type: Boolean }
900
+ });
901
+ customElements.define("eox-drawtools-list", $t);
902
+ const zt = `
903
+ :host {
904
+ display: block;
667
905
  }
668
906
  `;
669
- var v, P;
670
- class kt extends S {
907
+ var u, E;
908
+ class qt extends x {
671
909
  constructor() {
672
910
  super();
673
911
  /**
674
912
  * @type import("../../map/main").EOxMap
675
913
  */
676
- V(this, v, void 0);
914
+ V(this, u, void 0);
677
915
  /**
678
916
  * @type import("ol").Map
679
917
  */
680
- V(this, P, void 0);
681
- this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.layer = "draw", this.modify = null, this.multipleFeatures = !1, this.unstyled = !1;
918
+ V(this, E, void 0);
919
+ this.allowModify = !1, this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.multipleFeatures = !1, this.showList = !1, this.type = "Polygon", this.unstyled = !1;
682
920
  }
683
921
  static get properties() {
684
922
  return {
923
+ allowModify: { attribute: "allow-modify", type: Boolean },
685
924
  for: { type: String },
686
925
  currentlyDrawing: { attribute: !1, state: !0, type: Boolean },
687
926
  draw: { attribute: !1, state: !0 },
688
927
  drawLayer: { attribute: !1, state: !0 },
689
928
  drawnFeatures: { attribute: !1, state: !0, type: Array },
690
- layer: { type: String },
691
929
  modify: { attribute: !1, state: !0 },
692
930
  multipleFeatures: { attribute: "multiple-features", type: Boolean },
931
+ showList: { attribute: "show-list", type: Boolean },
932
+ type: { type: String },
693
933
  unstyled: { type: Boolean }
694
934
  };
695
935
  }
696
- startDrawing() {
697
- var e, i;
698
- g(this, v).addDraw(this.layer, {
699
- id: "drawInteraction",
700
- type: "Polygon",
701
- stopClick: !0
936
+ initDrawLayer() {
937
+ var s, i;
938
+ const e = document.querySelector(this.for);
939
+ R(
940
+ this,
941
+ u,
942
+ /** @type {import("@eox/map/main").EOxMap} */
943
+ e
944
+ ), R(
945
+ this,
946
+ E,
947
+ /** @type {import("ol").Map} */
948
+ $(this, u).map
949
+ ), this.drawLayer = $(this, u).addOrUpdateLayer({
950
+ type: "Vector",
951
+ properties: {
952
+ id: "drawLayer",
953
+ layerControlHide: !0
954
+ },
955
+ source: {
956
+ type: "Vector"
957
+ },
958
+ // check if the drawInteraction has already been added before adding again
959
+ // TEMP/TODO: this should probably be done by the map in the addOrUpdateLayer method
960
+ ...$(this, u).interactions.drawInteraction ? {} : {
961
+ interactions: [
962
+ {
963
+ type: "draw",
964
+ options: {
965
+ active: !1,
966
+ id: "drawInteraction",
967
+ type: this.type,
968
+ modify: this.allowModify,
969
+ stopClick: !0
970
+ }
971
+ },
972
+ {
973
+ type: "select",
974
+ options: {
975
+ id: "selectHover",
976
+ condition: "pointermove",
977
+ style: {
978
+ "fill-color": "rgba(51, 153, 204,0.5)",
979
+ "stroke-color": "#3399CC",
980
+ "stroke-width": 2.5
981
+ }
982
+ }
983
+ },
984
+ {
985
+ type: "select",
986
+ options: {
987
+ id: "selectClick",
988
+ condition: "click",
989
+ panIn: !0,
990
+ style: {
991
+ "fill-color": "rgba(51, 153, 204,0.5)",
992
+ "stroke-color": "#3399CC",
993
+ "stroke-width": 2.5
994
+ }
995
+ }
996
+ }
997
+ ]
998
+ }
702
999
  }), this.draw = /** @type {import("ol/interaction").Draw} */
703
1000
  /** @type {unknown} */
704
- g(this, v).interactions.drawInteraction, this.modify = /** @type {import("ol/interaction").Modify} */
1001
+ $(this, u).interactions.drawInteraction, this.modify = /** @type {import("ol/interaction").Modify} */
705
1002
  /** @type {unknown} */
706
- g(this, v).interactions.drawInteractionmodify, (e = this.draw) == null || e.on("drawend", (s) => this.onDrawEnd(s)), (i = this.modify) == null || i.on("modifyend", (s) => this.onModifyEnd(s)), this.currentlyDrawing = !0, this.requestUpdate();
1003
+ $(this, u).interactions.drawInteractionmodify, (s = this.draw) == null || s.on("drawend", () => this.onDrawEnd()), (i = this.modify) == null || i.on("modifyend", () => this.onModifyEnd());
1004
+ }
1005
+ startDrawing() {
1006
+ this.initDrawLayer(), this.draw.setActive(!0), this.currentlyDrawing = !0, this.requestUpdate();
707
1007
  }
708
1008
  discardDrawing() {
709
- this.drawnFeatures = [], g(this, v).removeInteraction("drawInteraction"), this.drawLayer.getSource().clear(), this.emitDrawnFeatures(), this.currentlyDrawing = !1, this.requestUpdate();
1009
+ this.drawnFeatures = [], this.draw.setActive(!1), this.drawLayer.getSource().clear(), $(this, u).removeInteraction("drawInteraction"), $(this, E).removeLayer(this.drawLayer), this.emitDrawnFeatures(), this.currentlyDrawing = !1, this.requestUpdate();
710
1010
  }
711
- /**
712
- *
713
- * @param {import("ol/interaction/Draw").DrawEvent} evt
714
- */
715
1011
  onDrawEnd() {
716
- this.emitDrawnFeatures(), g(this, v).removeInteraction("drawInteraction"), this.currentlyDrawing = !1, this.requestUpdate();
1012
+ this.emitDrawnFeatures(), this.draw.setActive(!1), this.currentlyDrawing = !1, this.requestUpdate();
717
1013
  }
718
- /**
719
- *
720
- * @param {import("ol/interaction/Modify").ModifyEvent} evt
721
- */
722
1014
  onModifyEnd() {
723
1015
  this.emitDrawnFeatures();
724
1016
  }
@@ -732,30 +1024,18 @@ class kt extends S {
732
1024
  }, 0);
733
1025
  }
734
1026
  render() {
735
- var i, s;
736
- const e = document.querySelector(this.for);
737
- return L(
738
- this,
739
- v,
740
- /** @type {import("@eox/map/main").EOxMap} */
741
- e
742
- ), L(
743
- this,
744
- P,
745
- /** @type {import("ol").Map} */
746
- g(this, v).map
747
- ), this.drawLayer = /** @type {import("ol/layer").Vector<import("ol/source").Vector>} */
748
- g(this, P).getLayers().getArray().find((n) => n.get("id") === this.layer), this.requestUpdate(), bt`
1027
+ var e, s, i;
1028
+ return F`
749
1029
  <style>
750
- ${Mt}
751
- ${!this.unstyled && Ot}
1030
+ ${zt}
1031
+ ${!this.unstyled && ut}
752
1032
  </style>
753
1033
  <div>
754
1034
  <slot></slot>
755
1035
  <button
756
1036
  data-cy="drawBtn"
757
1037
  class="polygon icon"
758
- disabled="${!this.multipleFeatures && ((i = this.drawnFeatures) == null ? void 0 : i.length) > 0 || this.currentlyDrawing || u}"
1038
+ disabled="${!this.multipleFeatures && ((e = this.drawnFeatures) == null ? void 0 : e.length) > 0 || this.currentlyDrawing || l}"
759
1039
  @click="${() => this.startDrawing()}"
760
1040
  >
761
1041
  ${this.currentlyDrawing ? "drawing" : "draw"}
@@ -763,17 +1043,29 @@ class kt extends S {
763
1043
  <button
764
1044
  data-cy="discardBtn"
765
1045
  class="discard icon"
766
- disabled="${!((s = this.drawnFeatures) != null && s.length) && !this.currentlyDrawing || u}"
1046
+ disabled="${!((s = this.drawnFeatures) != null && s.length) && !this.currentlyDrawing || l}"
767
1047
  @click="${() => this.discardDrawing()}"
768
1048
  >
769
1049
  discard
770
1050
  </button>
771
1051
  </div>
1052
+ ${this.showList && ((i = this.drawnFeatures) != null && i.length) ? F`<eox-drawtools-list
1053
+ .eoxMap=${$(this, u)}
1054
+ .olMap=${$(this, E)}
1055
+ .draw=${this.draw}
1056
+ .layer=${this.layer}
1057
+ .drawLayer=${this.drawLayer}
1058
+ .drawnFeatures=${this.drawnFeatures}
1059
+ .modify=${this.modify}
1060
+ .unstyled=${this.unstyled}
1061
+ @changed=${() => this.requestUpdate()}
1062
+ >
1063
+ </eox-drawtools-list>` : l}
772
1064
  `;
773
1065
  }
774
1066
  }
775
- v = new WeakMap(), P = new WeakMap();
776
- customElements.define("eox-drawtools", kt);
1067
+ u = new WeakMap(), E = new WeakMap();
1068
+ customElements.define("eox-drawtools", qt);
777
1069
  export {
778
- kt as EOxDrawTools
1070
+ qt as EOxDrawTools
779
1071
  };