lunchboxjs 2.1.17 → 2.2.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.
- package/dist/lunchboxjs.cjs +2 -2
- package/dist/lunchboxjs.js +457 -452
- package/dist/lunchboxjs.umd.cjs +2 -2
- package/package.json +1 -1
- package/src/html-anchor.ts +9 -6
- package/src/three-lunchbox.ts +16 -5
package/dist/lunchboxjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as p from "three";
|
|
2
|
-
const
|
|
2
|
+
const Ae = [
|
|
3
3
|
// ORDER MATTERS HERE!
|
|
4
4
|
// Place the objects most likely to wrap other objects at the beginning of the list.
|
|
5
5
|
// Main wrappers
|
|
@@ -91,237 +91,237 @@ const At = [
|
|
|
91
91
|
* Copyright 2019 Google LLC
|
|
92
92
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
93
93
|
*/
|
|
94
|
-
const j = globalThis, Y = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, X = Symbol(),
|
|
95
|
-
let
|
|
96
|
-
constructor(
|
|
94
|
+
const j = globalThis, Y = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, X = Symbol(), re = /* @__PURE__ */ new WeakMap();
|
|
95
|
+
let be = class {
|
|
96
|
+
constructor(e, t, s) {
|
|
97
97
|
if (this._$cssResult$ = !0, s !== X)
|
|
98
98
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
99
|
-
this.cssText =
|
|
99
|
+
this.cssText = e, this.t = t;
|
|
100
100
|
}
|
|
101
101
|
get styleSheet() {
|
|
102
|
-
let
|
|
103
|
-
const
|
|
104
|
-
if (Y &&
|
|
105
|
-
const s =
|
|
106
|
-
s && (
|
|
102
|
+
let e = this.o;
|
|
103
|
+
const t = this.t;
|
|
104
|
+
if (Y && e === void 0) {
|
|
105
|
+
const s = t !== void 0 && t.length === 1;
|
|
106
|
+
s && (e = re.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && re.set(t, e));
|
|
107
107
|
}
|
|
108
|
-
return
|
|
108
|
+
return e;
|
|
109
109
|
}
|
|
110
110
|
toString() {
|
|
111
111
|
return this.cssText;
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
const
|
|
115
|
-
const
|
|
114
|
+
const Me = (i) => new be(typeof i == "string" ? i : i + "", void 0, X), Oe = (i, ...e) => {
|
|
115
|
+
const t = i.length === 1 ? i[0] : e.reduce((s, r, n) => s + ((o) => {
|
|
116
116
|
if (o._$cssResult$ === !0)
|
|
117
117
|
return o.cssText;
|
|
118
118
|
if (typeof o == "number")
|
|
119
119
|
return o;
|
|
120
120
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
121
121
|
})(r) + i[n + 1], i[0]);
|
|
122
|
-
return new
|
|
123
|
-
},
|
|
122
|
+
return new be(t, i, X);
|
|
123
|
+
}, xe = (i, e) => {
|
|
124
124
|
if (Y)
|
|
125
|
-
i.adoptedStyleSheets =
|
|
125
|
+
i.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
126
126
|
else
|
|
127
|
-
for (const
|
|
127
|
+
for (const t of e) {
|
|
128
128
|
const s = document.createElement("style"), r = j.litNonce;
|
|
129
|
-
r !== void 0 && s.setAttribute("nonce", r), s.textContent =
|
|
129
|
+
r !== void 0 && s.setAttribute("nonce", r), s.textContent = t.cssText, i.appendChild(s);
|
|
130
130
|
}
|
|
131
|
-
},
|
|
132
|
-
let
|
|
133
|
-
for (const s of
|
|
134
|
-
|
|
135
|
-
return
|
|
131
|
+
}, ie = Y ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((e) => {
|
|
132
|
+
let t = "";
|
|
133
|
+
for (const s of e.cssRules)
|
|
134
|
+
t += s.cssText;
|
|
135
|
+
return Me(t);
|
|
136
136
|
})(i) : i;
|
|
137
137
|
/**
|
|
138
138
|
* @license
|
|
139
139
|
* Copyright 2017 Google LLC
|
|
140
140
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
141
141
|
*/
|
|
142
|
-
const { is:
|
|
143
|
-
switch (
|
|
142
|
+
const { is: Re, defineProperty: Ne, getOwnPropertyDescriptor: Le, getOwnPropertyNames: Ue, getOwnPropertySymbols: He, getPrototypeOf: je } = Object, A = globalThis, ne = A.trustedTypes, De = ne ? ne.emptyScript : "", W = A.reactiveElementPolyfillSupport, O = (i, e) => i, k = { toAttribute(i, e) {
|
|
143
|
+
switch (e) {
|
|
144
144
|
case Boolean:
|
|
145
|
-
i = i ?
|
|
145
|
+
i = i ? De : null;
|
|
146
146
|
break;
|
|
147
147
|
case Object:
|
|
148
148
|
case Array:
|
|
149
149
|
i = i == null ? i : JSON.stringify(i);
|
|
150
150
|
}
|
|
151
151
|
return i;
|
|
152
|
-
}, fromAttribute(i,
|
|
153
|
-
let
|
|
154
|
-
switch (
|
|
152
|
+
}, fromAttribute(i, e) {
|
|
153
|
+
let t = i;
|
|
154
|
+
switch (e) {
|
|
155
155
|
case Boolean:
|
|
156
|
-
|
|
156
|
+
t = i !== null;
|
|
157
157
|
break;
|
|
158
158
|
case Number:
|
|
159
|
-
|
|
159
|
+
t = i === null ? null : Number(i);
|
|
160
160
|
break;
|
|
161
161
|
case Object:
|
|
162
162
|
case Array:
|
|
163
163
|
try {
|
|
164
|
-
|
|
164
|
+
t = JSON.parse(i);
|
|
165
165
|
} catch {
|
|
166
|
-
|
|
166
|
+
t = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
return
|
|
170
|
-
} }, Q = (i,
|
|
169
|
+
return t;
|
|
170
|
+
} }, Q = (i, e) => !Re(i, e), oe = { attribute: !0, type: String, converter: k, reflect: !1, useDefault: !1, hasChanged: Q };
|
|
171
171
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), A.litPropertyMetadata ?? (A.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
172
172
|
let S = class extends HTMLElement {
|
|
173
|
-
static addInitializer(
|
|
174
|
-
this._$Ei(), (this.l ?? (this.l = [])).push(
|
|
173
|
+
static addInitializer(e) {
|
|
174
|
+
this._$Ei(), (this.l ?? (this.l = [])).push(e);
|
|
175
175
|
}
|
|
176
176
|
static get observedAttributes() {
|
|
177
177
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
178
178
|
}
|
|
179
|
-
static createProperty(
|
|
180
|
-
if (
|
|
181
|
-
const s = Symbol(), r = this.getPropertyDescriptor(
|
|
182
|
-
r !== void 0 &&
|
|
179
|
+
static createProperty(e, t = oe) {
|
|
180
|
+
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
181
|
+
const s = Symbol(), r = this.getPropertyDescriptor(e, s, t);
|
|
182
|
+
r !== void 0 && Ne(this.prototype, e, r);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
static getPropertyDescriptor(
|
|
186
|
-
const { get: r, set: n } =
|
|
187
|
-
return this[
|
|
185
|
+
static getPropertyDescriptor(e, t, s) {
|
|
186
|
+
const { get: r, set: n } = Le(this.prototype, e) ?? { get() {
|
|
187
|
+
return this[t];
|
|
188
188
|
}, set(o) {
|
|
189
|
-
this[
|
|
189
|
+
this[t] = o;
|
|
190
190
|
} };
|
|
191
191
|
return { get: r, set(o) {
|
|
192
192
|
const a = r == null ? void 0 : r.call(this);
|
|
193
|
-
n == null || n.call(this, o), this.requestUpdate(
|
|
193
|
+
n == null || n.call(this, o), this.requestUpdate(e, a, s);
|
|
194
194
|
}, configurable: !0, enumerable: !0 };
|
|
195
195
|
}
|
|
196
|
-
static getPropertyOptions(
|
|
197
|
-
return this.elementProperties.get(
|
|
196
|
+
static getPropertyOptions(e) {
|
|
197
|
+
return this.elementProperties.get(e) ?? oe;
|
|
198
198
|
}
|
|
199
199
|
static _$Ei() {
|
|
200
200
|
if (this.hasOwnProperty(O("elementProperties")))
|
|
201
201
|
return;
|
|
202
|
-
const
|
|
203
|
-
|
|
202
|
+
const e = je(this);
|
|
203
|
+
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
204
204
|
}
|
|
205
205
|
static finalize() {
|
|
206
206
|
if (this.hasOwnProperty(O("finalized")))
|
|
207
207
|
return;
|
|
208
208
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(O("properties"))) {
|
|
209
|
-
const
|
|
209
|
+
const t = this.properties, s = [...Ue(t), ...He(t)];
|
|
210
210
|
for (const r of s)
|
|
211
|
-
this.createProperty(r,
|
|
211
|
+
this.createProperty(r, t[r]);
|
|
212
212
|
}
|
|
213
|
-
const
|
|
214
|
-
if (
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
217
|
-
for (const [s, r] of
|
|
213
|
+
const e = this[Symbol.metadata];
|
|
214
|
+
if (e !== null) {
|
|
215
|
+
const t = litPropertyMetadata.get(e);
|
|
216
|
+
if (t !== void 0)
|
|
217
|
+
for (const [s, r] of t)
|
|
218
218
|
this.elementProperties.set(s, r);
|
|
219
219
|
}
|
|
220
220
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
221
|
-
for (const [
|
|
222
|
-
const r = this._$Eu(
|
|
223
|
-
r !== void 0 && this._$Eh.set(r,
|
|
221
|
+
for (const [t, s] of this.elementProperties) {
|
|
222
|
+
const r = this._$Eu(t, s);
|
|
223
|
+
r !== void 0 && this._$Eh.set(r, t);
|
|
224
224
|
}
|
|
225
225
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
226
226
|
}
|
|
227
|
-
static finalizeStyles(
|
|
228
|
-
const
|
|
229
|
-
if (Array.isArray(
|
|
230
|
-
const s = new Set(
|
|
227
|
+
static finalizeStyles(e) {
|
|
228
|
+
const t = [];
|
|
229
|
+
if (Array.isArray(e)) {
|
|
230
|
+
const s = new Set(e.flat(1 / 0).reverse());
|
|
231
231
|
for (const r of s)
|
|
232
|
-
|
|
232
|
+
t.unshift(ie(r));
|
|
233
233
|
} else
|
|
234
|
-
|
|
235
|
-
return
|
|
234
|
+
e !== void 0 && t.push(ie(e));
|
|
235
|
+
return t;
|
|
236
236
|
}
|
|
237
|
-
static _$Eu(
|
|
238
|
-
const s =
|
|
239
|
-
return s === !1 ? void 0 : typeof s == "string" ? s : typeof
|
|
237
|
+
static _$Eu(e, t) {
|
|
238
|
+
const s = t.attribute;
|
|
239
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
240
240
|
}
|
|
241
241
|
constructor() {
|
|
242
242
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
243
243
|
}
|
|
244
244
|
_$Ev() {
|
|
245
|
-
var t;
|
|
246
|
-
this._$ES = 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));
|
|
247
|
-
}
|
|
248
|
-
addController(t) {
|
|
249
245
|
var e;
|
|
250
|
-
|
|
246
|
+
this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (e = this.constructor.l) == null || e.forEach((t) => t(this));
|
|
251
247
|
}
|
|
252
|
-
|
|
253
|
-
var
|
|
254
|
-
(
|
|
248
|
+
addController(e) {
|
|
249
|
+
var t;
|
|
250
|
+
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(e), this.renderRoot !== void 0 && this.isConnected && ((t = e.hostConnected) == null || t.call(e));
|
|
251
|
+
}
|
|
252
|
+
removeController(e) {
|
|
253
|
+
var t;
|
|
254
|
+
(t = this._$EO) == null || t.delete(e);
|
|
255
255
|
}
|
|
256
256
|
_$E_() {
|
|
257
|
-
const
|
|
258
|
-
for (const s of
|
|
259
|
-
this.hasOwnProperty(s) && (
|
|
260
|
-
|
|
257
|
+
const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
|
|
258
|
+
for (const s of t.keys())
|
|
259
|
+
this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
|
|
260
|
+
e.size > 0 && (this._$Ep = e);
|
|
261
261
|
}
|
|
262
262
|
createRenderRoot() {
|
|
263
|
-
const
|
|
264
|
-
return
|
|
263
|
+
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
264
|
+
return xe(e, this.constructor.elementStyles), e;
|
|
265
265
|
}
|
|
266
266
|
connectedCallback() {
|
|
267
|
-
var
|
|
268
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (
|
|
267
|
+
var e;
|
|
268
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$EO) == null || e.forEach((t) => {
|
|
269
269
|
var s;
|
|
270
|
-
return (s =
|
|
270
|
+
return (s = t.hostConnected) == null ? void 0 : s.call(t);
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
|
-
enableUpdating(
|
|
273
|
+
enableUpdating(e) {
|
|
274
274
|
}
|
|
275
275
|
disconnectedCallback() {
|
|
276
|
-
var
|
|
277
|
-
(
|
|
276
|
+
var e;
|
|
277
|
+
(e = this._$EO) == null || e.forEach((t) => {
|
|
278
278
|
var s;
|
|
279
|
-
return (s =
|
|
279
|
+
return (s = t.hostDisconnected) == null ? void 0 : s.call(t);
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
|
-
attributeChangedCallback(
|
|
283
|
-
this._$AK(
|
|
282
|
+
attributeChangedCallback(e, t, s) {
|
|
283
|
+
this._$AK(e, s);
|
|
284
284
|
}
|
|
285
|
-
_$ET(
|
|
285
|
+
_$ET(e, t) {
|
|
286
286
|
var n;
|
|
287
|
-
const s = this.constructor.elementProperties.get(
|
|
287
|
+
const s = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, s);
|
|
288
288
|
if (r !== void 0 && s.reflect === !0) {
|
|
289
|
-
const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : k).toAttribute(
|
|
290
|
-
this._$Em =
|
|
289
|
+
const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : k).toAttribute(t, s.type);
|
|
290
|
+
this._$Em = e, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
_$AK(
|
|
293
|
+
_$AK(e, t) {
|
|
294
294
|
var n, o;
|
|
295
|
-
const s = this.constructor, r = s._$Eh.get(
|
|
295
|
+
const s = this.constructor, r = s._$Eh.get(e);
|
|
296
296
|
if (r !== void 0 && this._$Em !== r) {
|
|
297
297
|
const a = s.getPropertyOptions(r), h = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((n = a.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? a.converter : k;
|
|
298
298
|
this._$Em = r;
|
|
299
|
-
const c = h.fromAttribute(
|
|
299
|
+
const c = h.fromAttribute(t, a.type);
|
|
300
300
|
this[r] = c ?? ((o = this._$Ej) == null ? void 0 : o.get(r)) ?? c, this._$Em = null;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
requestUpdate(
|
|
303
|
+
requestUpdate(e, t, s, r = !1, n) {
|
|
304
304
|
var o;
|
|
305
|
-
if (
|
|
305
|
+
if (e !== void 0) {
|
|
306
306
|
const a = this.constructor;
|
|
307
|
-
if (r === !1 && (n = this[
|
|
307
|
+
if (r === !1 && (n = this[e]), s ?? (s = a.getPropertyOptions(e)), !((s.hasChanged ?? Q)(n, t) || s.useDefault && s.reflect && n === ((o = this._$Ej) == null ? void 0 : o.get(e)) && !this.hasAttribute(a._$Eu(e, s))))
|
|
308
308
|
return;
|
|
309
|
-
this.C(
|
|
309
|
+
this.C(e, t, s);
|
|
310
310
|
}
|
|
311
311
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
312
312
|
}
|
|
313
|
-
C(
|
|
314
|
-
s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(
|
|
313
|
+
C(e, t, { useDefault: s, reflect: r, wrapped: n }, o) {
|
|
314
|
+
s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(e) && (this._$Ej.set(e, o ?? t ?? this[e]), n !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), r === !0 && this._$Em !== e && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(e));
|
|
315
315
|
}
|
|
316
316
|
async _$EP() {
|
|
317
317
|
this.isUpdatePending = !0;
|
|
318
318
|
try {
|
|
319
319
|
await this._$ES;
|
|
320
|
-
} catch (
|
|
321
|
-
Promise.reject(
|
|
320
|
+
} catch (t) {
|
|
321
|
+
Promise.reject(t);
|
|
322
322
|
}
|
|
323
|
-
const
|
|
324
|
-
return
|
|
323
|
+
const e = this.scheduleUpdate();
|
|
324
|
+
return e != null && await e, !this.isUpdatePending;
|
|
325
325
|
}
|
|
326
326
|
scheduleUpdate() {
|
|
327
327
|
return this.performUpdate();
|
|
@@ -343,26 +343,26 @@ let S = class extends HTMLElement {
|
|
|
343
343
|
a !== !0 || this._$AL.has(n) || h === void 0 || this.C(n, void 0, o, h);
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
let
|
|
347
|
-
const
|
|
346
|
+
let e = !1;
|
|
347
|
+
const t = this._$AL;
|
|
348
348
|
try {
|
|
349
|
-
|
|
349
|
+
e = this.shouldUpdate(t), e ? (this.willUpdate(t), (s = this._$EO) == null || s.forEach((r) => {
|
|
350
350
|
var n;
|
|
351
351
|
return (n = r.hostUpdate) == null ? void 0 : n.call(r);
|
|
352
|
-
}), this.update(
|
|
352
|
+
}), this.update(t)) : this._$EM();
|
|
353
353
|
} catch (r) {
|
|
354
|
-
throw
|
|
354
|
+
throw e = !1, this._$EM(), r;
|
|
355
355
|
}
|
|
356
|
-
|
|
356
|
+
e && this._$AE(t);
|
|
357
357
|
}
|
|
358
|
-
willUpdate(
|
|
358
|
+
willUpdate(e) {
|
|
359
359
|
}
|
|
360
|
-
_$AE(
|
|
361
|
-
var
|
|
362
|
-
(
|
|
360
|
+
_$AE(e) {
|
|
361
|
+
var t;
|
|
362
|
+
(t = this._$EO) == null || t.forEach((s) => {
|
|
363
363
|
var r;
|
|
364
364
|
return (r = s.hostUpdated) == null ? void 0 : r.call(s);
|
|
365
|
-
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(
|
|
365
|
+
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
366
366
|
}
|
|
367
367
|
_$EM() {
|
|
368
368
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -373,15 +373,15 @@ let S = class extends HTMLElement {
|
|
|
373
373
|
getUpdateComplete() {
|
|
374
374
|
return this._$ES;
|
|
375
375
|
}
|
|
376
|
-
shouldUpdate(
|
|
376
|
+
shouldUpdate(e) {
|
|
377
377
|
return !0;
|
|
378
378
|
}
|
|
379
|
-
update(
|
|
380
|
-
this._$Eq && (this._$Eq = this._$Eq.forEach((
|
|
379
|
+
update(e) {
|
|
380
|
+
this._$Eq && (this._$Eq = this._$Eq.forEach((t) => this._$ET(t, this[t]))), this._$EM();
|
|
381
381
|
}
|
|
382
|
-
updated(
|
|
382
|
+
updated(e) {
|
|
383
383
|
}
|
|
384
|
-
firstUpdated(
|
|
384
|
+
firstUpdated(e) {
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
387
|
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[O("elementProperties")] = /* @__PURE__ */ new Map(), S[O("finalized")] = /* @__PURE__ */ new Map(), W == null || W({ ReactiveElement: S }), (A.reactiveElementVersions ?? (A.reactiveElementVersions = [])).push("2.1.2");
|
|
@@ -390,34 +390,34 @@ S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[O("elementProper
|
|
|
390
390
|
* Copyright 2017 Google LLC
|
|
391
391
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
392
392
|
*/
|
|
393
|
-
const x = globalThis,
|
|
394
|
-
\f\r]`,
|
|
395
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
396
|
-
function
|
|
397
|
-
if (!
|
|
393
|
+
const x = globalThis, ae = (i) => i, I = x.trustedTypes, he = I ? I.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, Ee = "$lit$", g = `lit$${Math.random().toFixed(9).slice(2)}$`, _e = "?" + g, ke = `<${_e}>`, C = document, R = () => C.createComment(""), N = (i) => i === null || typeof i != "object" && typeof i != "function", ee = Array.isArray, Ie = (i) => ee(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", q = `[
|
|
394
|
+
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ce = /-->/g, le = />/g, E = RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
|
|
395
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), de = /'/g, ue = /"/g, ve = /^(?:script|style|textarea|title)$/i, Be = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), te = Be(1), P = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), pe = /* @__PURE__ */ new WeakMap(), _ = C.createTreeWalker(C, 129);
|
|
396
|
+
function we(i, e) {
|
|
397
|
+
if (!ee(i) || !i.hasOwnProperty("raw"))
|
|
398
398
|
throw Error("invalid template strings array");
|
|
399
|
-
return
|
|
399
|
+
return he !== void 0 ? he.createHTML(e) : e;
|
|
400
400
|
}
|
|
401
|
-
const
|
|
402
|
-
const
|
|
403
|
-
let r, n =
|
|
404
|
-
for (let a = 0; a <
|
|
401
|
+
const Ge = (i, e) => {
|
|
402
|
+
const t = i.length - 1, s = [];
|
|
403
|
+
let r, n = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = M;
|
|
404
|
+
for (let a = 0; a < t; a++) {
|
|
405
405
|
const h = i[a];
|
|
406
406
|
let c, d, l = -1, m = 0;
|
|
407
407
|
for (; m < h.length && (o.lastIndex = m, d = o.exec(h), d !== null); )
|
|
408
|
-
m = o.lastIndex, o ===
|
|
409
|
-
const $ = o ===
|
|
410
|
-
n += o ===
|
|
408
|
+
m = o.lastIndex, o === M ? d[1] === "!--" ? o = ce : d[1] !== void 0 ? o = le : d[2] !== void 0 ? (ve.test(d[2]) && (r = RegExp("</" + d[2], "g")), o = E) : d[3] !== void 0 && (o = E) : o === E ? d[0] === ">" ? (o = r ?? M, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? E : d[3] === '"' ? ue : de) : o === ue || o === de ? o = E : o === ce || o === le ? o = M : (o = E, r = void 0);
|
|
409
|
+
const $ = o === E && i[a + 1].startsWith("/>") ? " " : "";
|
|
410
|
+
n += o === M ? h + ke : l >= 0 ? (s.push(c), h.slice(0, l) + Ee + h.slice(l) + g + $) : h + g + (l === -2 ? a : $);
|
|
411
411
|
}
|
|
412
|
-
return [
|
|
412
|
+
return [we(i, n + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
413
413
|
};
|
|
414
414
|
class L {
|
|
415
|
-
constructor({ strings:
|
|
415
|
+
constructor({ strings: e, _$litType$: t }, s) {
|
|
416
416
|
let r;
|
|
417
417
|
this.parts = [];
|
|
418
418
|
let n = 0, o = 0;
|
|
419
|
-
const a =
|
|
420
|
-
if (this.el = L.createElement(c, s), _.currentNode = this.el.content,
|
|
419
|
+
const a = e.length - 1, h = this.parts, [c, d] = Ge(e, t);
|
|
420
|
+
if (this.el = L.createElement(c, s), _.currentNode = this.el.content, t === 2 || t === 3) {
|
|
421
421
|
const l = this.el.content.firstChild;
|
|
422
422
|
l.replaceWith(...l.childNodes);
|
|
423
423
|
}
|
|
@@ -425,12 +425,12 @@ class L {
|
|
|
425
425
|
if (r.nodeType === 1) {
|
|
426
426
|
if (r.hasAttributes())
|
|
427
427
|
for (const l of r.getAttributeNames())
|
|
428
|
-
if (l.endsWith(
|
|
428
|
+
if (l.endsWith(Ee)) {
|
|
429
429
|
const m = d[o++], $ = r.getAttribute(l).split(g), H = /([.?@])?(.*)/.exec(m);
|
|
430
|
-
h.push({ type: 1, index: n, name: H[2], strings: $, ctor: H[1] === "." ?
|
|
430
|
+
h.push({ type: 1, index: n, name: H[2], strings: $, ctor: H[1] === "." ? We : H[1] === "?" ? qe : H[1] === "@" ? Fe : z }), r.removeAttribute(l);
|
|
431
431
|
} else
|
|
432
432
|
l.startsWith(g) && (h.push({ type: 6, index: n }), r.removeAttribute(l));
|
|
433
|
-
if (
|
|
433
|
+
if (ve.test(r.tagName)) {
|
|
434
434
|
const l = r.textContent.split(g), m = l.length - 1;
|
|
435
435
|
if (m > 0) {
|
|
436
436
|
r.textContent = I ? I.emptyScript : "";
|
|
@@ -440,7 +440,7 @@ class L {
|
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
} else if (r.nodeType === 8)
|
|
443
|
-
if (r.data ===
|
|
443
|
+
if (r.data === _e)
|
|
444
444
|
h.push({ type: 2, index: n });
|
|
445
445
|
else {
|
|
446
446
|
let l = -1;
|
|
@@ -450,22 +450,22 @@ class L {
|
|
|
450
450
|
n++;
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
static createElement(
|
|
453
|
+
static createElement(e, t) {
|
|
454
454
|
const s = C.createElement("template");
|
|
455
|
-
return s.innerHTML =
|
|
455
|
+
return s.innerHTML = e, s;
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function T(i, e, t = i, s) {
|
|
459
459
|
var o, a;
|
|
460
|
-
if (
|
|
461
|
-
return
|
|
462
|
-
let r = s !== void 0 ? (o =
|
|
463
|
-
const n = N(
|
|
464
|
-
return (r == null ? void 0 : r.constructor) !== n && ((a = r == null ? void 0 : r._$AO) == null || a.call(r, !1), n === void 0 ? r = void 0 : (r = new n(i), r._$AT(i,
|
|
460
|
+
if (e === P)
|
|
461
|
+
return e;
|
|
462
|
+
let r = s !== void 0 ? (o = t._$Co) == null ? void 0 : o[s] : t._$Cl;
|
|
463
|
+
const n = N(e) ? void 0 : e._$litDirective$;
|
|
464
|
+
return (r == null ? void 0 : r.constructor) !== n && ((a = r == null ? void 0 : r._$AO) == null || a.call(r, !1), n === void 0 ? r = void 0 : (r = new n(i), r._$AT(i, t, s)), s !== void 0 ? (t._$Co ?? (t._$Co = []))[s] = r : t._$Cl = r), r !== void 0 && (e = T(i, r._$AS(i, e.values), r, s)), e;
|
|
465
465
|
}
|
|
466
|
-
class
|
|
467
|
-
constructor(
|
|
468
|
-
this._$AV = [], this._$AN = void 0, this._$AD =
|
|
466
|
+
class ze {
|
|
467
|
+
constructor(e, t) {
|
|
468
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
469
469
|
}
|
|
470
470
|
get parentNode() {
|
|
471
471
|
return this._$AM.parentNode;
|
|
@@ -473,37 +473,37 @@ class zt {
|
|
|
473
473
|
get _$AU() {
|
|
474
474
|
return this._$AM._$AU;
|
|
475
475
|
}
|
|
476
|
-
u(
|
|
477
|
-
const { el: { content:
|
|
476
|
+
u(e) {
|
|
477
|
+
const { el: { content: t }, parts: s } = this._$AD, r = ((e == null ? void 0 : e.creationScope) ?? C).importNode(t, !0);
|
|
478
478
|
_.currentNode = r;
|
|
479
479
|
let n = _.nextNode(), o = 0, a = 0, h = s[0];
|
|
480
480
|
for (; h !== void 0; ) {
|
|
481
481
|
if (o === h.index) {
|
|
482
482
|
let c;
|
|
483
|
-
h.type === 2 ? c = new U(n, n.nextSibling, this,
|
|
483
|
+
h.type === 2 ? c = new U(n, n.nextSibling, this, e) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, e) : h.type === 6 && (c = new Ve(n, this, e)), this._$AV.push(c), h = s[++a];
|
|
484
484
|
}
|
|
485
485
|
o !== (h == null ? void 0 : h.index) && (n = _.nextNode(), o++);
|
|
486
486
|
}
|
|
487
487
|
return _.currentNode = C, r;
|
|
488
488
|
}
|
|
489
|
-
p(
|
|
490
|
-
let
|
|
489
|
+
p(e) {
|
|
490
|
+
let t = 0;
|
|
491
491
|
for (const s of this._$AV)
|
|
492
|
-
s !== void 0 && (s.strings !== void 0 ? (s._$AI(
|
|
492
|
+
s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
class U {
|
|
496
496
|
get _$AU() {
|
|
497
|
-
var
|
|
498
|
-
return ((
|
|
497
|
+
var e;
|
|
498
|
+
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
499
499
|
}
|
|
500
|
-
constructor(
|
|
501
|
-
this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA =
|
|
500
|
+
constructor(e, t, s, r) {
|
|
501
|
+
this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
|
|
502
502
|
}
|
|
503
503
|
get parentNode() {
|
|
504
|
-
let
|
|
505
|
-
const
|
|
506
|
-
return
|
|
504
|
+
let e = this._$AA.parentNode;
|
|
505
|
+
const t = this._$AM;
|
|
506
|
+
return t !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = t.parentNode), e;
|
|
507
507
|
}
|
|
508
508
|
get startNode() {
|
|
509
509
|
return this._$AA;
|
|
@@ -511,50 +511,50 @@ class U {
|
|
|
511
511
|
get endNode() {
|
|
512
512
|
return this._$AB;
|
|
513
513
|
}
|
|
514
|
-
_$AI(
|
|
515
|
-
|
|
514
|
+
_$AI(e, t = this) {
|
|
515
|
+
e = T(this, e, t), N(e) ? e === u || e == null || e === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : e !== this._$AH && e !== P && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ie(e) ? this.k(e) : this._(e);
|
|
516
516
|
}
|
|
517
|
-
O(
|
|
518
|
-
return this._$AA.parentNode.insertBefore(
|
|
517
|
+
O(e) {
|
|
518
|
+
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
519
519
|
}
|
|
520
|
-
T(
|
|
521
|
-
this._$AH !==
|
|
520
|
+
T(e) {
|
|
521
|
+
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
522
522
|
}
|
|
523
|
-
_(
|
|
524
|
-
this._$AH !== u && N(this._$AH) ? this._$AA.nextSibling.data =
|
|
523
|
+
_(e) {
|
|
524
|
+
this._$AH !== u && N(this._$AH) ? this._$AA.nextSibling.data = e : this.T(C.createTextNode(e)), this._$AH = e;
|
|
525
525
|
}
|
|
526
|
-
$(
|
|
526
|
+
$(e) {
|
|
527
527
|
var n;
|
|
528
|
-
const { values:
|
|
528
|
+
const { values: t, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = L.createElement(we(s.h, s.h[0]), this.options)), s);
|
|
529
529
|
if (((n = this._$AH) == null ? void 0 : n._$AD) === r)
|
|
530
|
-
this._$AH.p(
|
|
530
|
+
this._$AH.p(t);
|
|
531
531
|
else {
|
|
532
|
-
const o = new
|
|
533
|
-
o.p(
|
|
532
|
+
const o = new ze(r, this), a = o.u(this.options);
|
|
533
|
+
o.p(t), this.T(a), this._$AH = o;
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
-
_$AC(
|
|
537
|
-
let
|
|
538
|
-
return
|
|
536
|
+
_$AC(e) {
|
|
537
|
+
let t = pe.get(e.strings);
|
|
538
|
+
return t === void 0 && pe.set(e.strings, t = new L(e)), t;
|
|
539
539
|
}
|
|
540
|
-
k(
|
|
541
|
-
|
|
542
|
-
const
|
|
540
|
+
k(e) {
|
|
541
|
+
ee(this._$AH) || (this._$AH = [], this._$AR());
|
|
542
|
+
const t = this._$AH;
|
|
543
543
|
let s, r = 0;
|
|
544
|
-
for (const n of
|
|
545
|
-
r ===
|
|
546
|
-
r <
|
|
544
|
+
for (const n of e)
|
|
545
|
+
r === t.length ? t.push(s = new U(this.O(R()), this.O(R()), this, this.options)) : s = t[r], s._$AI(n), r++;
|
|
546
|
+
r < t.length && (this._$AR(s && s._$AB.nextSibling, r), t.length = r);
|
|
547
547
|
}
|
|
548
|
-
_$AR(
|
|
548
|
+
_$AR(e = this._$AA.nextSibling, t) {
|
|
549
549
|
var s;
|
|
550
|
-
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0,
|
|
551
|
-
const r =
|
|
552
|
-
|
|
550
|
+
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, t); e !== this._$AB; ) {
|
|
551
|
+
const r = ae(e).nextSibling;
|
|
552
|
+
ae(e).remove(), e = r;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
setConnected(
|
|
556
|
-
var
|
|
557
|
-
this._$AM === void 0 && (this._$Cv =
|
|
555
|
+
setConnected(e) {
|
|
556
|
+
var t;
|
|
557
|
+
this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
class z {
|
|
@@ -564,76 +564,76 @@ class z {
|
|
|
564
564
|
get _$AU() {
|
|
565
565
|
return this._$AM._$AU;
|
|
566
566
|
}
|
|
567
|
-
constructor(
|
|
568
|
-
this.type = 1, this._$AH = u, this._$AN = void 0, this.element =
|
|
567
|
+
constructor(e, t, s, r, n) {
|
|
568
|
+
this.type = 1, this._$AH = u, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = u;
|
|
569
569
|
}
|
|
570
|
-
_$AI(
|
|
570
|
+
_$AI(e, t = this, s, r) {
|
|
571
571
|
const n = this.strings;
|
|
572
572
|
let o = !1;
|
|
573
573
|
if (n === void 0)
|
|
574
|
-
|
|
574
|
+
e = T(this, e, t, 0), o = !N(e) || e !== this._$AH && e !== P, o && (this._$AH = e);
|
|
575
575
|
else {
|
|
576
|
-
const a =
|
|
576
|
+
const a = e;
|
|
577
577
|
let h, c;
|
|
578
|
-
for (
|
|
579
|
-
c =
|
|
578
|
+
for (e = n[0], h = 0; h < n.length - 1; h++)
|
|
579
|
+
c = T(this, a[s + h], t, h), c === P && (c = this._$AH[h]), o || (o = !N(c) || c !== this._$AH[h]), c === u ? e = u : e !== u && (e += (c ?? "") + n[h + 1]), this._$AH[h] = c;
|
|
580
580
|
}
|
|
581
|
-
o && !r && this.j(
|
|
581
|
+
o && !r && this.j(e);
|
|
582
582
|
}
|
|
583
|
-
j(
|
|
584
|
-
|
|
583
|
+
j(e) {
|
|
584
|
+
e === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
class
|
|
587
|
+
class We extends z {
|
|
588
588
|
constructor() {
|
|
589
589
|
super(...arguments), this.type = 3;
|
|
590
590
|
}
|
|
591
|
-
j(
|
|
592
|
-
this.element[this.name] =
|
|
591
|
+
j(e) {
|
|
592
|
+
this.element[this.name] = e === u ? void 0 : e;
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
class
|
|
595
|
+
class qe extends z {
|
|
596
596
|
constructor() {
|
|
597
597
|
super(...arguments), this.type = 4;
|
|
598
598
|
}
|
|
599
|
-
j(
|
|
600
|
-
this.element.toggleAttribute(this.name, !!
|
|
599
|
+
j(e) {
|
|
600
|
+
this.element.toggleAttribute(this.name, !!e && e !== u);
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
|
-
class
|
|
604
|
-
constructor(
|
|
605
|
-
super(
|
|
603
|
+
class Fe extends z {
|
|
604
|
+
constructor(e, t, s, r, n) {
|
|
605
|
+
super(e, t, s, r, n), this.type = 5;
|
|
606
606
|
}
|
|
607
|
-
_$AI(
|
|
608
|
-
if ((
|
|
607
|
+
_$AI(e, t = this) {
|
|
608
|
+
if ((e = T(this, e, t, 0) ?? u) === P)
|
|
609
609
|
return;
|
|
610
|
-
const s = this._$AH, r =
|
|
611
|
-
r && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this,
|
|
610
|
+
const s = this._$AH, r = e === u && s !== u || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, n = e !== u && (s === u || r);
|
|
611
|
+
r && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
612
612
|
}
|
|
613
|
-
handleEvent(
|
|
614
|
-
var
|
|
615
|
-
typeof this._$AH == "function" ? this._$AH.call(((
|
|
613
|
+
handleEvent(e) {
|
|
614
|
+
var t;
|
|
615
|
+
typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
class
|
|
619
|
-
constructor(
|
|
620
|
-
this.element =
|
|
618
|
+
class Ve {
|
|
619
|
+
constructor(e, t, s) {
|
|
620
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
|
|
621
621
|
}
|
|
622
622
|
get _$AU() {
|
|
623
623
|
return this._$AM._$AU;
|
|
624
624
|
}
|
|
625
|
-
_$AI(
|
|
626
|
-
|
|
625
|
+
_$AI(e) {
|
|
626
|
+
T(this, e);
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
const F = x.litHtmlPolyfillSupport;
|
|
630
630
|
F == null || F(L, U), (x.litHtmlVersions ?? (x.litHtmlVersions = [])).push("3.3.2");
|
|
631
|
-
const
|
|
632
|
-
const s = (
|
|
631
|
+
const Je = (i, e, t) => {
|
|
632
|
+
const s = (t == null ? void 0 : t.renderBefore) ?? e;
|
|
633
633
|
let r = s._$litPart$;
|
|
634
634
|
if (r === void 0) {
|
|
635
|
-
const n = (
|
|
636
|
-
s._$litPart$ = r = new U(
|
|
635
|
+
const n = (t == null ? void 0 : t.renderBefore) ?? null;
|
|
636
|
+
s._$litPart$ = r = new U(e.insertBefore(R(), n), n, void 0, t ?? {});
|
|
637
637
|
}
|
|
638
638
|
return r._$AI(i), r;
|
|
639
639
|
};
|
|
@@ -648,182 +648,182 @@ class w extends S {
|
|
|
648
648
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
649
649
|
}
|
|
650
650
|
createRenderRoot() {
|
|
651
|
-
var
|
|
652
|
-
const
|
|
653
|
-
return (
|
|
651
|
+
var t;
|
|
652
|
+
const e = super.createRenderRoot();
|
|
653
|
+
return (t = this.renderOptions).renderBefore ?? (t.renderBefore = e.firstChild), e;
|
|
654
654
|
}
|
|
655
|
-
update(
|
|
656
|
-
const
|
|
657
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(
|
|
655
|
+
update(e) {
|
|
656
|
+
const t = this.render();
|
|
657
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Je(t, this.renderRoot, this.renderOptions);
|
|
658
658
|
}
|
|
659
659
|
connectedCallback() {
|
|
660
|
-
var
|
|
661
|
-
super.connectedCallback(), (
|
|
660
|
+
var e;
|
|
661
|
+
super.connectedCallback(), (e = this._$Do) == null || e.setConnected(!0);
|
|
662
662
|
}
|
|
663
663
|
disconnectedCallback() {
|
|
664
|
-
var
|
|
665
|
-
super.disconnectedCallback(), (
|
|
664
|
+
var e;
|
|
665
|
+
super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
|
|
666
666
|
}
|
|
667
667
|
render() {
|
|
668
668
|
return P;
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
|
-
var
|
|
672
|
-
w._$litElement$ = !0, w.finalized = !0, (
|
|
671
|
+
var ge;
|
|
672
|
+
w._$litElement$ = !0, w.finalized = !0, (ge = v.litElementHydrateSupport) == null || ge.call(v, { LitElement: w });
|
|
673
673
|
const V = v.litElementPolyfillSupport;
|
|
674
674
|
V == null || V({ LitElement: w });
|
|
675
675
|
(v.litElementVersions ?? (v.litElementVersions = [])).push("4.2.2");
|
|
676
|
-
const
|
|
677
|
-
if (!
|
|
676
|
+
const Ze = (i, e, t) => {
|
|
677
|
+
if (!e)
|
|
678
678
|
return;
|
|
679
|
-
const s = Array.isArray(
|
|
679
|
+
const s = Array.isArray(e) ? e : e.match(/([^[.\]])+/g), r = s == null ? void 0 : s.reduce(
|
|
680
680
|
(n, o) => n && n[o],
|
|
681
681
|
i
|
|
682
682
|
);
|
|
683
|
-
return r === void 0 ?
|
|
683
|
+
return r === void 0 ? t : r;
|
|
684
684
|
};
|
|
685
|
-
function
|
|
685
|
+
function Ke(i) {
|
|
686
686
|
if (!i)
|
|
687
687
|
return !1;
|
|
688
|
-
const
|
|
688
|
+
const e = i.constructor && i.constructor.toString().substring(0, 5) === "class";
|
|
689
689
|
if (i.prototype === void 0)
|
|
690
|
-
return
|
|
691
|
-
const
|
|
692
|
-
return
|
|
690
|
+
return e;
|
|
691
|
+
const t = i.prototype.constructor && i.prototype.constructor.toString && i.prototype.constructor.toString().substring(0, 5) === "class";
|
|
692
|
+
return e || t;
|
|
693
693
|
}
|
|
694
|
-
const
|
|
695
|
-
const i = "[object Number]",
|
|
694
|
+
const Ye = () => {
|
|
695
|
+
const i = "[object Number]", t = Object.prototype.toString;
|
|
696
696
|
function s(n) {
|
|
697
697
|
return !!n && typeof n == "object";
|
|
698
698
|
}
|
|
699
699
|
return function(o) {
|
|
700
|
-
return typeof o == "number" || s(o) &&
|
|
700
|
+
return typeof o == "number" || s(o) && t.call(o) == i;
|
|
701
701
|
};
|
|
702
|
-
},
|
|
703
|
-
const s = Array.isArray(
|
|
704
|
-
s == null || s.reduce((r, n, o) => (r[n] === void 0 && (r[n] = {}), o === s.length - 1 && (r[n] =
|
|
705
|
-
},
|
|
706
|
-
var
|
|
707
|
-
let
|
|
708
|
-
for (;
|
|
709
|
-
|
|
710
|
-
return
|
|
702
|
+
}, Xe = Ye(), Qe = (i, e, t) => {
|
|
703
|
+
const s = Array.isArray(e) ? e : e.match(/([^[.\]])+/g);
|
|
704
|
+
s == null || s.reduce((r, n, o) => (r[n] === void 0 && (r[n] = {}), o === s.length - 1 && (r[n] = t), r[n]), i);
|
|
705
|
+
}, Ce = "data-three-uuid", me = (i) => {
|
|
706
|
+
var t, s, r;
|
|
707
|
+
let e = i.parentNode;
|
|
708
|
+
for (; e && !(e != null && e.instance) && !((t = e == null ? void 0 : e.three) != null && t.scene); )
|
|
709
|
+
e = (e == null ? void 0 : e.parentNode) || (e == null ? void 0 : e.host) || ((r = (s = e.getRootNode) == null ? void 0 : s.call(e)) == null ? void 0 : r.host);
|
|
710
|
+
return e;
|
|
711
711
|
};
|
|
712
|
-
function D(i,
|
|
713
|
-
return i ? i instanceof ShadowRoot ? D(i.host,
|
|
712
|
+
function D(i, e) {
|
|
713
|
+
return i ? i instanceof ShadowRoot ? D(i.host, e) : i instanceof HTMLElement && (typeof e == "string" && i.matches(e) || typeof e == "function" && e(i)) ? i : D(i.parentNode, e) : null;
|
|
714
714
|
}
|
|
715
|
-
const Z = (i,
|
|
715
|
+
const Z = (i, e, t) => {
|
|
716
716
|
var n, o;
|
|
717
|
-
const s =
|
|
718
|
-
if (
|
|
719
|
-
s.setScalar(+
|
|
717
|
+
const s = Ze(i, e);
|
|
718
|
+
if (Xe(t) && (s != null && s.setScalar))
|
|
719
|
+
s.setScalar(+t);
|
|
720
720
|
else if (s != null && s.set)
|
|
721
|
-
if (typeof
|
|
722
|
-
const a =
|
|
723
|
-
if ((n =
|
|
724
|
-
if (
|
|
725
|
-
const c = [
|
|
721
|
+
if (typeof t == "string") {
|
|
722
|
+
const a = t.split(","), h = a.every((c) => !c.match(/^[^\d,]+$/));
|
|
723
|
+
if ((n = t.toLowerCase().trim().match(/^#[\dabcdef]{3,6}$/)) != null && n.length)
|
|
724
|
+
if (t.length === 4) {
|
|
725
|
+
const c = [t[1], t[1], t[2], t[2], t[3], t[3]].join("");
|
|
726
726
|
s.set(+`0x${c}`);
|
|
727
727
|
} else
|
|
728
|
-
s.set(+`0x${
|
|
728
|
+
s.set(+`0x${t.slice(1)}`);
|
|
729
729
|
else
|
|
730
|
-
a != null && a.length && h ? s.set(...a.map((c) => +c)) : s.set(
|
|
730
|
+
a != null && a.length && h ? s.set(...a.map((c) => +c)) : s.set(t);
|
|
731
731
|
} else {
|
|
732
|
-
const a = Array.isArray(
|
|
732
|
+
const a = Array.isArray(t) ? t : [t];
|
|
733
733
|
s.set(...a);
|
|
734
734
|
}
|
|
735
735
|
else
|
|
736
|
-
|
|
736
|
+
Qe(i, e, t);
|
|
737
737
|
const r = i;
|
|
738
738
|
typeof r.type == "string" && ((o = r.type) != null && o.toLowerCase().endsWith("material")) && (r.needsUpdate = !0);
|
|
739
739
|
}, J = {
|
|
740
740
|
$scene: (i) => {
|
|
741
|
-
const
|
|
742
|
-
return
|
|
741
|
+
const e = i.closest("three-lunchbox");
|
|
742
|
+
return e == null ? void 0 : e.three.scene;
|
|
743
743
|
},
|
|
744
744
|
$camera: (i) => {
|
|
745
|
-
const
|
|
746
|
-
return
|
|
745
|
+
const e = i.closest("three-lunchbox");
|
|
746
|
+
return e == null ? void 0 : e.three.camera;
|
|
747
747
|
},
|
|
748
748
|
$renderer: (i) => {
|
|
749
|
-
const
|
|
750
|
-
return
|
|
749
|
+
const e = i.closest("three-lunchbox");
|
|
750
|
+
return e == null ? void 0 : e.three.renderer;
|
|
751
751
|
},
|
|
752
752
|
$domElement: (i) => {
|
|
753
|
-
var
|
|
754
|
-
const
|
|
755
|
-
return (
|
|
753
|
+
var t;
|
|
754
|
+
const e = i.closest("three-lunchbox");
|
|
755
|
+
return (t = e == null ? void 0 : e.three.renderer) == null ? void 0 : t.domElement;
|
|
756
756
|
}
|
|
757
|
-
}, B = (i,
|
|
757
|
+
}, B = (i, e) => {
|
|
758
758
|
var s;
|
|
759
759
|
if (typeof i != "string")
|
|
760
760
|
return i;
|
|
761
761
|
if (i === "")
|
|
762
762
|
return !0;
|
|
763
|
-
const
|
|
764
|
-
return CSS.supports("color", i) ? new p.Color(i) :
|
|
763
|
+
const t = (s = J[i]) == null ? void 0 : s.call(J, e);
|
|
764
|
+
return CSS.supports("color", i) ? new p.Color(i) : t ?? i;
|
|
765
765
|
};
|
|
766
766
|
/**
|
|
767
767
|
* @license
|
|
768
768
|
* Copyright 2017 Google LLC
|
|
769
769
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
770
770
|
*/
|
|
771
|
-
const
|
|
772
|
-
const { kind: s, metadata: r } =
|
|
771
|
+
const et = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: Q }, tt = (i = et, e, t) => {
|
|
772
|
+
const { kind: s, metadata: r } = t;
|
|
773
773
|
let n = globalThis.litPropertyMetadata.get(r);
|
|
774
|
-
if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), n.set(
|
|
775
|
-
const { name: o } =
|
|
774
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), n.set(t.name, i), s === "accessor") {
|
|
775
|
+
const { name: o } = t;
|
|
776
776
|
return { set(a) {
|
|
777
|
-
const h =
|
|
778
|
-
|
|
777
|
+
const h = e.get.call(this);
|
|
778
|
+
e.set.call(this, a), this.requestUpdate(o, h, i, !0, a);
|
|
779
779
|
}, init(a) {
|
|
780
780
|
return a !== void 0 && this.C(o, void 0, i, a), a;
|
|
781
781
|
} };
|
|
782
782
|
}
|
|
783
783
|
if (s === "setter") {
|
|
784
|
-
const { name: o } =
|
|
784
|
+
const { name: o } = t;
|
|
785
785
|
return function(a) {
|
|
786
786
|
const h = this[o];
|
|
787
|
-
|
|
787
|
+
e.call(this, a), this.requestUpdate(o, h, i, !0, a);
|
|
788
788
|
};
|
|
789
789
|
}
|
|
790
790
|
throw Error("Unsupported decorator location: " + s);
|
|
791
791
|
};
|
|
792
792
|
function y(i) {
|
|
793
|
-
return (
|
|
793
|
+
return (e, t) => typeof t == "object" ? tt(i, e, t) : ((s, r, n) => {
|
|
794
794
|
const o = r.hasOwnProperty(n);
|
|
795
795
|
return r.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
|
|
796
|
-
})(i,
|
|
796
|
+
})(i, e, t);
|
|
797
797
|
}
|
|
798
798
|
/**
|
|
799
799
|
* @license
|
|
800
800
|
* Copyright 2017 Google LLC
|
|
801
801
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
802
802
|
*/
|
|
803
|
-
function
|
|
803
|
+
function st(i) {
|
|
804
804
|
return y({ ...i, state: !0, attribute: !1 });
|
|
805
805
|
}
|
|
806
|
-
var
|
|
806
|
+
var rt = Object.defineProperty, Se = (i, e, t, s) => {
|
|
807
807
|
for (var r = void 0, n = i.length - 1, o; n >= 0; n--)
|
|
808
|
-
(o = i[n]) && (r = o(
|
|
809
|
-
return r &&
|
|
808
|
+
(o = i[n]) && (r = o(e, t, r) || r);
|
|
809
|
+
return r && rt(e, t, r), r;
|
|
810
810
|
};
|
|
811
|
-
const K = "raycast",
|
|
811
|
+
const K = "raycast", fe = [
|
|
812
812
|
K,
|
|
813
813
|
"args",
|
|
814
814
|
"data"
|
|
815
|
-
],
|
|
815
|
+
], ye = (i) => i.split("-");
|
|
816
816
|
class G extends w {
|
|
817
|
-
constructor(
|
|
818
|
-
super(), this.classSource =
|
|
817
|
+
constructor(e) {
|
|
818
|
+
super(), this.classSource = e, this.instance = null, this.dispose = [], this.mutationObserver = null, this.tryAddOnce = !1, this.connected = !1;
|
|
819
819
|
}
|
|
820
820
|
observeAttributes() {
|
|
821
|
-
this.mutationObserver = new MutationObserver((
|
|
822
|
-
|
|
821
|
+
this.mutationObserver = new MutationObserver((e) => {
|
|
822
|
+
e.forEach((t) => {
|
|
823
823
|
var r;
|
|
824
|
-
if (!
|
|
824
|
+
if (!t.attributeName || (r = Object.getPrototypeOf(this).constructor.observedAttributes) != null && r.includes(t.attributeName))
|
|
825
825
|
return;
|
|
826
|
-
const s = this.attributes.getNamedItem(
|
|
826
|
+
const s = this.attributes.getNamedItem(t.attributeName);
|
|
827
827
|
s && this.updateProperty(s);
|
|
828
828
|
});
|
|
829
829
|
}), this.mutationObserver.observe(this, {
|
|
@@ -831,27 +831,27 @@ class G extends w {
|
|
|
831
831
|
});
|
|
832
832
|
}
|
|
833
833
|
parsedArgs() {
|
|
834
|
-
const
|
|
835
|
-
return typeof
|
|
834
|
+
const e = this.args ?? this.getAttribute("args") ?? [];
|
|
835
|
+
return typeof e == "string" ? JSON.parse(e) : e;
|
|
836
836
|
}
|
|
837
837
|
createUnderlyingThreeObject() {
|
|
838
|
-
this.instance = new this.classSource(...this.parsedArgs().map((
|
|
838
|
+
this.instance = new this.classSource(...this.parsedArgs().map((e) => B(e, this)));
|
|
839
839
|
}
|
|
840
840
|
refreshAttributes() {
|
|
841
|
-
this.getAttributeNames().forEach((
|
|
842
|
-
const
|
|
843
|
-
|
|
841
|
+
this.getAttributeNames().forEach((e) => {
|
|
842
|
+
const t = this.attributes.getNamedItem(e);
|
|
843
|
+
t && this.updateProperty(t);
|
|
844
844
|
}), Array.from(this.attributes).forEach(this.updateProperty.bind(this));
|
|
845
845
|
}
|
|
846
846
|
async onUnderlyingThreeObjectReady() {
|
|
847
847
|
var s, r, n, o;
|
|
848
|
-
const
|
|
849
|
-
|
|
850
|
-
let
|
|
851
|
-
for (; this != null && this.connected && !this.tryAddOnce && !
|
|
852
|
-
await new Promise(requestAnimationFrame),
|
|
853
|
-
if (
|
|
854
|
-
const a = this.instance, h = this.instance, c =
|
|
848
|
+
const e = this.instance;
|
|
849
|
+
e.uuid && this.setAttribute(Ce, e.uuid);
|
|
850
|
+
let t = me(this);
|
|
851
|
+
for (; this != null && this.connected && !this.tryAddOnce && !t; )
|
|
852
|
+
await new Promise(requestAnimationFrame), t = me(this);
|
|
853
|
+
if (t && t.instance || (s = t == null ? void 0 : t.three) != null && s.scene) {
|
|
854
|
+
const a = this.instance, h = this.instance, c = t.instance, d = t.instance ?? ((r = t.three) == null ? void 0 : r.scene), l = this.instance;
|
|
855
855
|
if ((n = a.type) != null && n.toLowerCase().includes("geometry") && c.geometry)
|
|
856
856
|
c.geometry = a;
|
|
857
857
|
else if ((o = h.type) != null && o.toLowerCase().includes("material") && c.material)
|
|
@@ -879,14 +879,14 @@ class G extends w {
|
|
|
879
879
|
})), this.connected = !0, this.onUnderlyingThreeObjectReady.call(this);
|
|
880
880
|
}
|
|
881
881
|
/** Update an instance's property. When creating a `<mesh position-y="0.5">`, for example, this sets `mesh.position.y = 0.5`. */
|
|
882
|
-
updateProperty(
|
|
883
|
-
const { name:
|
|
884
|
-
let r =
|
|
882
|
+
updateProperty(e) {
|
|
883
|
+
const { name: t, value: s } = e;
|
|
884
|
+
let r = t;
|
|
885
885
|
Object.keys(this.instance ?? {}).forEach((a) => {
|
|
886
886
|
a.toLowerCase() === r && (r = a);
|
|
887
887
|
});
|
|
888
|
-
const n =
|
|
889
|
-
if (
|
|
888
|
+
const n = ye(r);
|
|
889
|
+
if (fe.includes(r) || fe.includes(n[0]))
|
|
890
890
|
return;
|
|
891
891
|
let o = B(s, this);
|
|
892
892
|
try {
|
|
@@ -895,46 +895,46 @@ class G extends w {
|
|
|
895
895
|
}
|
|
896
896
|
this.instance && Z(this.instance, n, o);
|
|
897
897
|
}
|
|
898
|
-
executeAttach(
|
|
898
|
+
executeAttach(e, t) {
|
|
899
899
|
const s = this.parentElement;
|
|
900
|
-
s.instance && Z(s.instance,
|
|
900
|
+
s.instance && Z(s.instance, ye(e), t);
|
|
901
901
|
}
|
|
902
902
|
disconnectedCallback() {
|
|
903
903
|
super.disconnectedCallback();
|
|
904
|
-
const
|
|
905
|
-
this.disposeThreeObjects.call(this,
|
|
904
|
+
const e = [this.instance];
|
|
905
|
+
this.disposeThreeObjects.call(this, e), this.connected = !1;
|
|
906
906
|
}
|
|
907
|
-
disposeThreeObjects(
|
|
908
|
-
|
|
907
|
+
disposeThreeObjects(e) {
|
|
908
|
+
e.forEach((t) => {
|
|
909
909
|
var n, o;
|
|
910
|
-
if (!
|
|
910
|
+
if (!t)
|
|
911
911
|
return;
|
|
912
|
-
const s =
|
|
912
|
+
const s = t, r = t;
|
|
913
913
|
(n = s.dispose) == null || n.call(s), (o = r.removeFromParent) == null || o.call(r);
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
916
|
/** Render */
|
|
917
917
|
render() {
|
|
918
|
-
return
|
|
918
|
+
return te`<slot></slot>`;
|
|
919
919
|
}
|
|
920
920
|
createRenderRoot() {
|
|
921
921
|
return this;
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
|
-
|
|
924
|
+
Se([
|
|
925
925
|
y({ type: Boolean, attribute: "try-add-once" })
|
|
926
926
|
], G.prototype, "tryAddOnce");
|
|
927
|
-
|
|
928
|
-
|
|
927
|
+
Se([
|
|
928
|
+
st()
|
|
929
929
|
], G.prototype, "connected");
|
|
930
|
-
const
|
|
931
|
-
const
|
|
932
|
-
if (!
|
|
930
|
+
const Pe = (i) => {
|
|
931
|
+
const e = typeof i == "string" ? p[i] : i;
|
|
932
|
+
if (!Ke(e))
|
|
933
933
|
return null;
|
|
934
|
-
const
|
|
934
|
+
const t = i.toString().toLowerCase().endsWith("loader");
|
|
935
935
|
class s extends G {
|
|
936
936
|
constructor() {
|
|
937
|
-
super(
|
|
937
|
+
super(e);
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
940
|
class r extends G {
|
|
@@ -942,7 +942,7 @@ const Pt = (i) => {
|
|
|
942
942
|
super(...arguments), this.loader = null;
|
|
943
943
|
}
|
|
944
944
|
createUnderlyingThreeObject() {
|
|
945
|
-
this.loader = new
|
|
945
|
+
this.loader = new e(...this.parsedArgs().map((o) => B(o, this)));
|
|
946
946
|
}
|
|
947
947
|
async onUnderlyingThreeObjectReady() {
|
|
948
948
|
const o = this.getAttribute("src");
|
|
@@ -966,23 +966,19 @@ const Pt = (i) => {
|
|
|
966
966
|
super.disconnectedCallback(), this.disposeThreeObjects.call(this, [this.loader]);
|
|
967
967
|
}
|
|
968
968
|
}
|
|
969
|
-
return
|
|
969
|
+
return t ? r : s;
|
|
970
970
|
};
|
|
971
|
-
var
|
|
971
|
+
var it = Object.defineProperty, b = (i, e, t, s) => {
|
|
972
972
|
for (var r = void 0, n = i.length - 1, o; n >= 0; n--)
|
|
973
|
-
(o = i[n]) && (r = o(
|
|
974
|
-
return r &&
|
|
973
|
+
(o = i[n]) && (r = o(e, t, r) || r);
|
|
974
|
+
return r && it(e, t, r), r;
|
|
975
975
|
};
|
|
976
|
-
const
|
|
976
|
+
const nt = "orthographic", $e = 1 / 0, se = class se extends w {
|
|
977
977
|
constructor() {
|
|
978
|
-
super(), this.scratchV2 = new p.Vector2(), this.three = {
|
|
979
|
-
|
|
980
|
-
camera: null,
|
|
981
|
-
renderer: null
|
|
982
|
-
}, this.background = null, this.dpr = $t, this.headless = !1, this.manualRender = !1, this.dispatchBeforeRender = !1, this.dispatchAfterRender = !1, this.rendererArgs = [], this.cameraArgs = [], this.raycaster = new p.Raycaster(), this.raycastPool = [], this.frame = 1 / 0, this.resizeObserver = new ResizeObserver((t) => {
|
|
983
|
-
t.forEach(({ target: e, contentRect: s }) => {
|
|
978
|
+
super(), this.scratchV2 = new p.Vector2(), this.background = null, this.dpr = $e, this.headless = !1, this.manualRender = !1, this.dispatchBeforeRender = !1, this.dispatchAfterRender = !1, this.rendererArgs = [], this.cameraArgs = [], this.raycaster = new p.Raycaster(), this.raycastPool = [], this.frame = 1 / 0, this.three = this.createThree(), this.resizeObserver = new ResizeObserver((e) => {
|
|
979
|
+
e.forEach(({ target: t, contentRect: s }) => {
|
|
984
980
|
var r;
|
|
985
|
-
if (
|
|
981
|
+
if (t === this && ((r = this.three.renderer) == null || r.setSize(s.width * this.dpr, s.height * this.dpr), this.three.camera)) {
|
|
986
982
|
const n = s.width / s.height;
|
|
987
983
|
if (this.three.camera.type.toLowerCase() === "perspectivecamera")
|
|
988
984
|
this.three.camera.aspect = n, this.three.camera.updateProjectionMatrix();
|
|
@@ -995,91 +991,102 @@ const ne = "orthographic", $t = 1 / 0, st = class st extends w {
|
|
|
995
991
|
});
|
|
996
992
|
});
|
|
997
993
|
}
|
|
994
|
+
/** Function called at startup when creating Lunchbox's default scene. */
|
|
995
|
+
createDefaultScene() {
|
|
996
|
+
return new p.Scene();
|
|
997
|
+
}
|
|
998
|
+
createThree() {
|
|
999
|
+
return {
|
|
1000
|
+
scene: this.createDefaultScene(),
|
|
1001
|
+
camera: null,
|
|
1002
|
+
renderer: null
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
998
1005
|
/** To run on start. */
|
|
999
1006
|
connectedCallback() {
|
|
1000
|
-
if (super.connectedCallback(), this.dpr === $
|
|
1001
|
-
const
|
|
1007
|
+
if (super.connectedCallback(), this.dpr === $e && (this.dpr = window.devicePixelRatio), this.getAttribute(nt) !== null ? this.three.camera = new p.OrthographicCamera(...this.cameraArgs) : this.three.camera = new p.PerspectiveCamera(...this.cameraArgs.length ? this.cameraArgs : [75]), ["scene", "camera", "renderer"].forEach((e) => {
|
|
1008
|
+
const t = this[e] ?? this.getAttribute(e) ?? {}, s = typeof t == "string" ? JSON.parse(t) : t;
|
|
1002
1009
|
Object.entries(s).forEach(([r, n]) => {
|
|
1003
|
-
this.three[
|
|
1010
|
+
this.three[e] && Z(this.three[e], r.split("-"), B(n, this));
|
|
1004
1011
|
});
|
|
1005
1012
|
}), this.resizeObserver.observe(this), this.background !== null && (this.three.scene.background = new p.Color(this.background)), !this.headless) {
|
|
1006
|
-
const
|
|
1007
|
-
|
|
1013
|
+
const e = new p.WebGLRenderer(...this.rendererArgs);
|
|
1014
|
+
e.domElement.addEventListener("pointermove", this.onPointerMove.bind(this)), e.domElement.addEventListener("mousemove", this.onPointerMove.bind(this)), e.domElement.addEventListener("click", this.onClick.bind(this)), this.three.renderer = e;
|
|
1008
1015
|
}
|
|
1009
1016
|
this.manualRender || this.updateLoop();
|
|
1010
1017
|
}
|
|
1011
1018
|
disconnectedCallback() {
|
|
1012
|
-
var
|
|
1013
|
-
(
|
|
1019
|
+
var e, t, s, r;
|
|
1020
|
+
(e = this.three.renderer) == null || e.domElement.removeEventListener("pointermove", this.onPointerMove.bind(this)), (t = this.three.renderer) == null || t.domElement.removeEventListener("mousemove", this.onPointerMove.bind(this)), (s = this.three.renderer) == null || s.domElement.removeEventListener("click", this.onClick.bind(this)), (r = this.three.renderer) == null || r.dispose(), this.resizeObserver.unobserve(this), cancelAnimationFrame(this.frame);
|
|
1014
1021
|
}
|
|
1015
|
-
handleDefaultSlotChange(
|
|
1016
|
-
|
|
1017
|
-
const s =
|
|
1018
|
-
s.instance instanceof p.Object3D &&
|
|
1022
|
+
handleDefaultSlotChange(e) {
|
|
1023
|
+
e.target.assignedElements().forEach((t) => {
|
|
1024
|
+
const s = t;
|
|
1025
|
+
s.instance instanceof p.Object3D && t.getAttributeNames().includes(K) && t.getAttributeNames().includes(K) && this.raycastPool.push(s.instance);
|
|
1019
1026
|
}), this.renderThree();
|
|
1020
1027
|
}
|
|
1021
|
-
runRaycast(
|
|
1028
|
+
runRaycast(e) {
|
|
1022
1029
|
var a, h;
|
|
1023
1030
|
if (!this.raycastPool.length || !this.three.camera)
|
|
1024
1031
|
return [];
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
-(
|
|
1032
|
+
const t = ((a = this.three.renderer) == null ? void 0 : a.domElement.width) ?? 0, s = ((h = this.three.renderer) == null ? void 0 : h.domElement.height) ?? 0, r = this.scratchV2.clone().set(
|
|
1033
|
+
e.clientX / (t / this.dpr) * 2 - 1,
|
|
1034
|
+
-(e.clientY / (s / this.dpr)) * 2 + 1
|
|
1028
1035
|
);
|
|
1029
1036
|
return this.raycaster.setFromCamera(r, this.three.camera), this.raycaster.intersectObjects(this.raycastPool).map((c) => ({
|
|
1030
1037
|
intersect: c,
|
|
1031
1038
|
// TODO: cache result of this query selector somewhere?
|
|
1032
|
-
element: this.querySelector(`[${
|
|
1039
|
+
element: this.querySelector(`[${Ce}="${c.object.uuid}"]`)
|
|
1033
1040
|
}));
|
|
1034
1041
|
}
|
|
1035
1042
|
// Pointer movement
|
|
1036
1043
|
// ==================
|
|
1037
|
-
onPointerMove(
|
|
1038
|
-
this.runRaycast.bind(this)(
|
|
1044
|
+
onPointerMove(e) {
|
|
1045
|
+
this.runRaycast.bind(this)(e).forEach((s) => {
|
|
1039
1046
|
var r, n, o, a;
|
|
1040
|
-
|
|
1047
|
+
e.type === "pointermove" ? ((r = s.element) == null || r.dispatchEvent(new PointerEvent("pointermove")), (n = s.element) == null || n.dispatchEvent(new CustomEvent(at, { detail: s }))) : e.type === "mousemove" && ((o = s.element) == null || o.dispatchEvent(new MouseEvent("mousemove")), (a = s.element) == null || a.dispatchEvent(new CustomEvent(ht, { detail: s })));
|
|
1041
1048
|
});
|
|
1042
1049
|
}
|
|
1043
1050
|
// Click handling
|
|
1044
1051
|
// ==================
|
|
1045
|
-
onClick(
|
|
1046
|
-
let
|
|
1047
|
-
if (
|
|
1048
|
-
const s =
|
|
1049
|
-
|
|
1052
|
+
onClick(e) {
|
|
1053
|
+
let t = [];
|
|
1054
|
+
if (e instanceof TouchEvent) {
|
|
1055
|
+
const s = e.touches[0];
|
|
1056
|
+
t = this.runRaycast.bind(this)(s), t.forEach((r) => {
|
|
1050
1057
|
var n;
|
|
1051
1058
|
(n = r.element) == null || n.dispatchEvent(new TouchEvent("touchstart"));
|
|
1052
1059
|
});
|
|
1053
1060
|
} else
|
|
1054
|
-
|
|
1061
|
+
t = this.runRaycast.bind(this)(e), t.forEach((s) => {
|
|
1055
1062
|
var r;
|
|
1056
1063
|
(r = s.element) == null || r.dispatchEvent(new MouseEvent("click"));
|
|
1057
1064
|
});
|
|
1058
|
-
|
|
1065
|
+
t.forEach((s) => {
|
|
1059
1066
|
var r;
|
|
1060
|
-
(r = s.element) == null || r.dispatchEvent(new CustomEvent(
|
|
1067
|
+
(r = s.element) == null || r.dispatchEvent(new CustomEvent(ct, { detail: s }));
|
|
1061
1068
|
});
|
|
1062
1069
|
}
|
|
1063
1070
|
updateLoop() {
|
|
1064
1071
|
this.renderThree(), this.manualRender || (this.frame = requestAnimationFrame(this.updateLoop.bind(this)));
|
|
1065
1072
|
}
|
|
1066
1073
|
/** Render the 3D scene. Optional scene/camera overrides; defaults to the internal scene and camera. */
|
|
1067
|
-
renderThree(
|
|
1074
|
+
renderThree(e, t) {
|
|
1068
1075
|
var s;
|
|
1069
|
-
this.dispatchBeforeRender && this.dispatchEvent(new CustomEvent(
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
), this.dispatchAfterRender && this.dispatchEvent(new CustomEvent(
|
|
1076
|
+
this.dispatchBeforeRender && this.dispatchEvent(new CustomEvent(lt, {})), this.three.camera && ((s = this.three.renderer) == null || s.render(
|
|
1077
|
+
e ?? this.three.scene,
|
|
1078
|
+
t ?? this.three.camera
|
|
1079
|
+
), this.dispatchAfterRender && this.dispatchEvent(new CustomEvent(dt, {})));
|
|
1073
1080
|
}
|
|
1074
1081
|
render() {
|
|
1075
|
-
var
|
|
1076
|
-
return
|
|
1082
|
+
var e;
|
|
1083
|
+
return te`
|
|
1077
1084
|
<slot @slotchange=${this.handleDefaultSlotChange}></slot>
|
|
1078
|
-
${(
|
|
1085
|
+
${(e = this.three.renderer) == null ? void 0 : e.domElement}
|
|
1079
1086
|
`;
|
|
1080
1087
|
}
|
|
1081
1088
|
};
|
|
1082
|
-
|
|
1089
|
+
se.styles = Oe`
|
|
1083
1090
|
:host {
|
|
1084
1091
|
width: 100%;
|
|
1085
1092
|
height: 100%;
|
|
@@ -1093,92 +1100,90 @@ st.styles = Ot`
|
|
|
1093
1100
|
max-height: 100%;
|
|
1094
1101
|
}
|
|
1095
1102
|
`;
|
|
1096
|
-
let f =
|
|
1097
|
-
|
|
1103
|
+
let f = se;
|
|
1104
|
+
b([
|
|
1098
1105
|
y()
|
|
1099
1106
|
], f.prototype, "background");
|
|
1100
|
-
|
|
1107
|
+
b([
|
|
1101
1108
|
y()
|
|
1102
1109
|
], f.prototype, "dpr");
|
|
1103
|
-
|
|
1110
|
+
b([
|
|
1104
1111
|
y()
|
|
1105
1112
|
], f.prototype, "headless");
|
|
1106
|
-
|
|
1113
|
+
b([
|
|
1107
1114
|
y({
|
|
1108
1115
|
attribute: "manual-render",
|
|
1109
1116
|
type: Boolean
|
|
1110
1117
|
})
|
|
1111
1118
|
], f.prototype, "manualRender");
|
|
1112
|
-
|
|
1119
|
+
b([
|
|
1113
1120
|
y({
|
|
1114
1121
|
attribute: "dispatch-before-render",
|
|
1115
1122
|
type: Boolean
|
|
1116
1123
|
})
|
|
1117
1124
|
], f.prototype, "dispatchBeforeRender");
|
|
1118
|
-
|
|
1125
|
+
b([
|
|
1119
1126
|
y({
|
|
1120
1127
|
attribute: "dispatch-after-render",
|
|
1121
1128
|
type: Boolean
|
|
1122
1129
|
})
|
|
1123
1130
|
], f.prototype, "dispatchAfterRender");
|
|
1124
|
-
|
|
1131
|
+
b([
|
|
1125
1132
|
y({
|
|
1126
1133
|
attribute: "renderer-args",
|
|
1127
1134
|
type: Object
|
|
1128
1135
|
})
|
|
1129
1136
|
], f.prototype, "rendererArgs");
|
|
1130
|
-
|
|
1137
|
+
b([
|
|
1131
1138
|
y({
|
|
1132
1139
|
attribute: "camera-args",
|
|
1133
1140
|
type: Object
|
|
1134
1141
|
})
|
|
1135
1142
|
], f.prototype, "cameraArgs");
|
|
1136
|
-
class
|
|
1143
|
+
class ot extends w {
|
|
1137
1144
|
constructor() {
|
|
1138
1145
|
super(...arguments), this.parentLunchbox = null, this.frame = -1, this.scratchV3 = new p.Vector3(), this.scratchFrustum = new p.Frustum(), this.scratchMatrix4 = new p.Matrix4();
|
|
1139
1146
|
}
|
|
1140
1147
|
/** Try attaching the update function to pass the parent's position to children. */
|
|
1141
1148
|
tryAttachUpdate() {
|
|
1142
1149
|
var o;
|
|
1143
|
-
const
|
|
1144
|
-
if (!
|
|
1150
|
+
const e = (o = this.parentLunchbox) == null ? void 0 : o.instance;
|
|
1151
|
+
if (!e)
|
|
1145
1152
|
return !1;
|
|
1146
|
-
if (!
|
|
1153
|
+
if (!e.isObject3D)
|
|
1147
1154
|
throw new Error("html-anchor must be the child of an Object3D");
|
|
1148
|
-
const
|
|
1155
|
+
const t = D(this, (a) => {
|
|
1149
1156
|
var h;
|
|
1150
1157
|
return !!((h = a == null ? void 0 : a.three) != null && h.renderer);
|
|
1151
1158
|
});
|
|
1152
|
-
if (!
|
|
1159
|
+
if (!t)
|
|
1153
1160
|
return console.error("three-lunchbox parent required for html-anchor"), !1;
|
|
1154
|
-
const s =
|
|
1161
|
+
const s = t.three.camera;
|
|
1155
1162
|
if (!s)
|
|
1156
1163
|
return console.error("camera required for html-anchor"), !1;
|
|
1157
|
-
const r =
|
|
1164
|
+
const r = t.three.renderer;
|
|
1158
1165
|
if (!(r != null && r.domElement))
|
|
1159
1166
|
return console.error("renderer and DOM element required for html-anchor"), !1;
|
|
1160
1167
|
const n = () => {
|
|
1161
|
-
this.frame = requestAnimationFrame(n), s.updateMatrix(), s.updateMatrixWorld(),
|
|
1168
|
+
this.frame = requestAnimationFrame(n), s.updateMatrix(), s.updateMatrixWorld(), e.getWorldPosition(this.scratchV3);
|
|
1162
1169
|
const a = this.scratchV3.clone();
|
|
1163
1170
|
this.scratchV3.project(s), this.scratchV3.multiplyScalar(0.5).addScalar(0.5), this.scratchV3.y = 1 - this.scratchV3.y;
|
|
1164
1171
|
const h = this.scratchV3.clone().set(r.domElement.width, r.domElement.height, 1);
|
|
1165
1172
|
h.divideScalar(devicePixelRatio), this.scratchV3.multiply(h);
|
|
1166
|
-
const c =
|
|
1173
|
+
const c = e.position.clone().distanceTo(s.getWorldPosition(this.scratchV3.clone()));
|
|
1167
1174
|
this.scratchFrustum.setFromProjectionMatrix(this.scratchMatrix4.clone().multiplyMatrices(s.projectionMatrix, s.matrixWorldInverse));
|
|
1168
1175
|
const d = this.scratchFrustum.containsPoint(a);
|
|
1169
|
-
|
|
1170
|
-
l.style.setProperty("--left", `${this.scratchV3.x}px`), l.style.setProperty("--top", `${this.scratchV3.y}px`), l.style.setProperty("--distance-from-camera", `${c}`), l.style.setProperty("--in-frustum", `${d ? 1 : 0}`);
|
|
1171
|
-
});
|
|
1176
|
+
this.style.setProperty("--left", `${this.scratchV3.x}px`), this.style.setProperty("--top", `${this.scratchV3.y}px`), this.style.setProperty("--distance-from-camera", `${c}`), this.style.setProperty("--in-frustum", `${d ? 1 : 0}`), d ? this.classList.add("in-frustum") : this.classList.remove("in-frustum");
|
|
1172
1177
|
};
|
|
1173
1178
|
return n(), !0;
|
|
1174
1179
|
}
|
|
1175
1180
|
// Setup - save local parent and try adding update
|
|
1176
1181
|
connectedCallback() {
|
|
1177
1182
|
super.connectedCallback();
|
|
1178
|
-
const
|
|
1179
|
-
if (!
|
|
1183
|
+
const e = this.parentNode;
|
|
1184
|
+
if (!e)
|
|
1180
1185
|
throw new Error("html-anchor requires a 3D parent");
|
|
1181
|
-
this.parentLunchbox =
|
|
1186
|
+
this.parentLunchbox = e, this.tryAttachUpdate() || this.parentLunchbox.addEventListener("instanceadded", () => {
|
|
1182
1187
|
if (!this.tryAttachUpdate())
|
|
1183
1188
|
throw new Error("error attaching html-anchor to Object3D");
|
|
1184
1189
|
}, { once: !0 });
|
|
@@ -1188,52 +1193,52 @@ class oe extends w {
|
|
|
1188
1193
|
this.frame !== -1 && cancelAnimationFrame(this.frame);
|
|
1189
1194
|
}
|
|
1190
1195
|
render() {
|
|
1191
|
-
return
|
|
1196
|
+
return te`<slot></slot>`;
|
|
1192
1197
|
}
|
|
1193
1198
|
createRenderRoot() {
|
|
1194
1199
|
return this;
|
|
1195
1200
|
}
|
|
1196
1201
|
}
|
|
1197
|
-
const
|
|
1202
|
+
const mt = ({
|
|
1198
1203
|
prependList: i = []
|
|
1199
1204
|
} = {}) => {
|
|
1200
1205
|
Object.entries({
|
|
1201
1206
|
"three-lunchbox": f,
|
|
1202
|
-
"html-anchor":
|
|
1203
|
-
}).forEach(([
|
|
1204
|
-
customElements.get(
|
|
1205
|
-
}), [...i, ...
|
|
1206
|
-
const s =
|
|
1207
|
+
"html-anchor": ot
|
|
1208
|
+
}).forEach(([t, s]) => {
|
|
1209
|
+
customElements.get(t) || customElements.define(t, s);
|
|
1210
|
+
}), [...i, ...Ae].forEach((t) => {
|
|
1211
|
+
const s = Te(t);
|
|
1207
1212
|
if (customElements.get(s))
|
|
1208
1213
|
return;
|
|
1209
|
-
const r =
|
|
1214
|
+
const r = Pe(t);
|
|
1210
1215
|
r && customElements.define(s, r);
|
|
1211
1216
|
});
|
|
1212
|
-
},
|
|
1213
|
-
if (
|
|
1217
|
+
}, ft = (i, e, t = window) => {
|
|
1218
|
+
if (t.customElements.get(i)) {
|
|
1214
1219
|
console.log(`${i} already registered as a custom element. Try a different name if registering is still required.`);
|
|
1215
1220
|
return;
|
|
1216
1221
|
}
|
|
1217
|
-
const s =
|
|
1222
|
+
const s = Pe(e);
|
|
1218
1223
|
if (s)
|
|
1219
|
-
|
|
1224
|
+
t.customElements.define(i, s);
|
|
1220
1225
|
else
|
|
1221
1226
|
throw new Error(`Could not extend ${i}. The second paramater must be a class.`);
|
|
1222
|
-
},
|
|
1223
|
-
let
|
|
1224
|
-
return
|
|
1225
|
-
},
|
|
1227
|
+
}, at = "threepointermove", ht = "threemousemove", ct = "threeclick", lt = "beforerender", dt = "afterrender", Te = (i) => {
|
|
1228
|
+
let e = i.split(/\.?(?=[A-Z])/).join("-").toLowerCase().replace(/-g-l-/, "-gl-");
|
|
1229
|
+
return e.includes("-") || (e = `three-${e}`), e;
|
|
1230
|
+
}, yt = Ae.map(Te);
|
|
1226
1231
|
export {
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1232
|
+
dt as AFTER_RENDER_EVENT_NAME,
|
|
1233
|
+
lt as BEFORE_RENDER_EVENT_NAME,
|
|
1234
|
+
ot as HtmlAnchor,
|
|
1235
|
+
ct as THREE_CLICK_EVENT_NAME,
|
|
1236
|
+
ht as THREE_MOUSE_MOVE_EVENT_NAME,
|
|
1237
|
+
at as THREE_POINTER_MOVE_EVENT_NAME,
|
|
1233
1238
|
G as ThreeBase,
|
|
1234
1239
|
f as ThreeLunchbox,
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1240
|
+
Ae as autoComponents,
|
|
1241
|
+
ft as extend,
|
|
1242
|
+
mt as initLunchbox,
|
|
1243
|
+
yt as webComponentNames
|
|
1239
1244
|
};
|