tarot-elements 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +71 -2
- package/custom-elements.json +227 -0
- package/dist/cards.d.ts +13 -0
- package/dist/index.d.ts +2 -0
- package/dist/tarot-card.d.ts +27 -0
- package/dist/tarot-elements.js +803 -0
- package/package.json +42 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 jwmazzi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tarot-elements
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A `<tarot-card>` web component built with [Lit](https://lit.dev), for writing
|
|
4
|
+
tarot readings in Markdown or plain HTML. Works anywhere custom elements do,
|
|
5
|
+
including [11ty](https://www.11ty.dev) Markdown posts.
|
|
6
|
+
|
|
7
|
+
The name is a double meaning: custom _elements_, and the classical elements
|
|
8
|
+
that tarot's four suits stand for (wands for fire, cups for water, swords for
|
|
9
|
+
air, pentacles for earth). Cards are coloured by suit accordingly.
|
|
10
|
+
|
|
11
|
+
> Status: early (`0.x`). Cards currently render as simple placeholders; real
|
|
12
|
+
> card art is planned.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install tarot-elements
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Load it once, for example in your page layout:
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<script type="module" src="/path/to/tarot-elements.js"></script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
or import it from your own bundle:
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import "tarot-elements";
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The bundle includes Lit, so there is nothing else to load.
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<tarot-card name="the-fool" position="present"></tarot-card>
|
|
38
|
+
|
|
39
|
+
<tarot-card name="the-tower" position="challenge" reversed>
|
|
40
|
+
Rough week at work, but it resolved itself.
|
|
41
|
+
</tarot-card>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
In Markdown, keep the tag on one line, or put a blank line before any content
|
|
45
|
+
inside it, so the Markdown parser treats it as HTML.
|
|
46
|
+
|
|
47
|
+
### Attributes
|
|
48
|
+
|
|
49
|
+
| Attribute | Type | Description |
|
|
50
|
+
| ---------- | ------- | --------------------------------------------------------------------------- |
|
|
51
|
+
| `name` | string | Card name or slug: `the-fool`, `The Fool`, `ace-of-cups`. Case-insensitive. |
|
|
52
|
+
| `reversed` | boolean | Draw the card upside down. |
|
|
53
|
+
| `position` | string | Optional label shown above the card, such as `past`. |
|
|
54
|
+
|
|
55
|
+
An unrecognised `name` renders an "Unknown card" message.
|
|
56
|
+
|
|
57
|
+
### Slot
|
|
58
|
+
|
|
59
|
+
Anything inside the element is shown as notes beneath the card.
|
|
60
|
+
|
|
61
|
+
## Development
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
npm install
|
|
65
|
+
npm run dev # demo page with hot reload
|
|
66
|
+
npm run watch # rebuild dist/ on change (e.g. for linking into another site)
|
|
67
|
+
npm run build # bundle + type declarations + manifest
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/cards.ts",
|
|
8
|
+
"declarations": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "variable",
|
|
11
|
+
"name": "CARDS",
|
|
12
|
+
"type": {
|
|
13
|
+
"text": "CardData[]"
|
|
14
|
+
},
|
|
15
|
+
"default": "[...majors, ...minors]"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"kind": "function",
|
|
19
|
+
"name": "findCard",
|
|
20
|
+
"return": {
|
|
21
|
+
"type": {
|
|
22
|
+
"text": "CardData | undefined"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"parameters": [
|
|
26
|
+
{
|
|
27
|
+
"name": "name",
|
|
28
|
+
"type": {
|
|
29
|
+
"text": "string"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"description": "Accepts \"the-fool\", \"The Fool\", \"the_fool\"; ignores case."
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"exports": [
|
|
37
|
+
{
|
|
38
|
+
"kind": "js",
|
|
39
|
+
"name": "CARDS",
|
|
40
|
+
"declaration": {
|
|
41
|
+
"name": "CARDS",
|
|
42
|
+
"module": "src/cards.ts"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"kind": "js",
|
|
47
|
+
"name": "findCard",
|
|
48
|
+
"declaration": {
|
|
49
|
+
"name": "findCard",
|
|
50
|
+
"module": "src/cards.ts"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"kind": "javascript-module",
|
|
57
|
+
"path": "src/index.ts",
|
|
58
|
+
"declarations": [],
|
|
59
|
+
"exports": [
|
|
60
|
+
{
|
|
61
|
+
"kind": "js",
|
|
62
|
+
"name": "TarotCard",
|
|
63
|
+
"declaration": {
|
|
64
|
+
"name": "TarotCard",
|
|
65
|
+
"module": "./tarot-card.js"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"kind": "js",
|
|
70
|
+
"name": "CARDS",
|
|
71
|
+
"declaration": {
|
|
72
|
+
"name": "CARDS",
|
|
73
|
+
"module": "./cards.js"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"kind": "js",
|
|
78
|
+
"name": "findCard",
|
|
79
|
+
"declaration": {
|
|
80
|
+
"name": "findCard",
|
|
81
|
+
"module": "./cards.js"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"kind": "js",
|
|
86
|
+
"name": "CardData",
|
|
87
|
+
"declaration": {
|
|
88
|
+
"name": "CardData",
|
|
89
|
+
"module": "./cards.js"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"kind": "js",
|
|
94
|
+
"name": "Suit",
|
|
95
|
+
"declaration": {
|
|
96
|
+
"name": "Suit",
|
|
97
|
+
"module": "./cards.js"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"kind": "javascript-module",
|
|
104
|
+
"path": "src/tarot-card.ts",
|
|
105
|
+
"declarations": [
|
|
106
|
+
{
|
|
107
|
+
"kind": "class",
|
|
108
|
+
"description": "A single tarot card with an optional note.",
|
|
109
|
+
"name": "TarotCard",
|
|
110
|
+
"cssProperties": [
|
|
111
|
+
{
|
|
112
|
+
"description": "Card width.",
|
|
113
|
+
"name": "--tarot-card-width",
|
|
114
|
+
"default": "140px"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"description": "Accent colour (defaults per suit).",
|
|
118
|
+
"name": "--tarot-card-accent"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"cssParts": [
|
|
122
|
+
{
|
|
123
|
+
"description": "The card face.",
|
|
124
|
+
"name": "card"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"description": "The notes beneath the card.",
|
|
128
|
+
"name": "notes"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"slots": [
|
|
132
|
+
{
|
|
133
|
+
"description": "Your notes about this draw (shown beneath the card).",
|
|
134
|
+
"name": ""
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"members": [
|
|
138
|
+
{
|
|
139
|
+
"kind": "field",
|
|
140
|
+
"name": "name",
|
|
141
|
+
"type": {
|
|
142
|
+
"text": "string"
|
|
143
|
+
},
|
|
144
|
+
"default": "\"\"",
|
|
145
|
+
"description": "Card name or slug, e.g. \"the-fool\" or \"Ace of Cups\".",
|
|
146
|
+
"attribute": "name"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"kind": "field",
|
|
150
|
+
"name": "reversed",
|
|
151
|
+
"type": {
|
|
152
|
+
"text": "boolean"
|
|
153
|
+
},
|
|
154
|
+
"default": "false",
|
|
155
|
+
"description": "Draw the card upside down.",
|
|
156
|
+
"attribute": "reversed",
|
|
157
|
+
"reflects": true
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"kind": "field",
|
|
161
|
+
"name": "position",
|
|
162
|
+
"type": {
|
|
163
|
+
"text": "string"
|
|
164
|
+
},
|
|
165
|
+
"default": "\"\"",
|
|
166
|
+
"description": "Optional spread position label, e.g. \"past\".",
|
|
167
|
+
"attribute": "position"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"attributes": [
|
|
171
|
+
{
|
|
172
|
+
"name": "name",
|
|
173
|
+
"type": {
|
|
174
|
+
"text": "string"
|
|
175
|
+
},
|
|
176
|
+
"default": "\"\"",
|
|
177
|
+
"description": "Card name or slug, e.g. \"the-fool\" or \"Ace of Cups\".",
|
|
178
|
+
"fieldName": "name"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "reversed",
|
|
182
|
+
"type": {
|
|
183
|
+
"text": "boolean"
|
|
184
|
+
},
|
|
185
|
+
"default": "false",
|
|
186
|
+
"description": "Draw the card upside down.",
|
|
187
|
+
"fieldName": "reversed"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "position",
|
|
191
|
+
"type": {
|
|
192
|
+
"text": "string"
|
|
193
|
+
},
|
|
194
|
+
"default": "\"\"",
|
|
195
|
+
"description": "Optional spread position label, e.g. \"past\".",
|
|
196
|
+
"fieldName": "position"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"superclass": {
|
|
200
|
+
"name": "LitElement",
|
|
201
|
+
"package": "lit"
|
|
202
|
+
},
|
|
203
|
+
"tagName": "tarot-card",
|
|
204
|
+
"customElement": true
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"exports": [
|
|
208
|
+
{
|
|
209
|
+
"kind": "js",
|
|
210
|
+
"name": "TarotCard",
|
|
211
|
+
"declaration": {
|
|
212
|
+
"name": "TarotCard",
|
|
213
|
+
"module": "src/tarot-card.ts"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"kind": "custom-element-definition",
|
|
218
|
+
"name": "tarot-card",
|
|
219
|
+
"declaration": {
|
|
220
|
+
"name": "TarotCard",
|
|
221
|
+
"module": "src/tarot-card.ts"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
package/dist/cards.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type Suit = "major" | "wands" | "cups" | "swords" | "pentacles";
|
|
2
|
+
export interface CardData {
|
|
3
|
+
slug: string;
|
|
4
|
+
name: string;
|
|
5
|
+
suit: Suit;
|
|
6
|
+
/** Roman numeral for majors, rank label for minors. */
|
|
7
|
+
label: string;
|
|
8
|
+
upright: string;
|
|
9
|
+
reversed: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const CARDS: CardData[];
|
|
12
|
+
/** Accepts "the-fool", "The Fool", "the_fool"; ignores case. */
|
|
13
|
+
export declare function findCard(name: string): CardData | undefined;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* A single tarot card with an optional note.
|
|
4
|
+
*
|
|
5
|
+
* @slot - Your notes about this draw (shown beneath the card).
|
|
6
|
+
*
|
|
7
|
+
* @csspart card - The card face.
|
|
8
|
+
* @csspart notes - The notes beneath the card.
|
|
9
|
+
*
|
|
10
|
+
* @cssprop [--tarot-card-width=140px] - Card width.
|
|
11
|
+
* @cssprop [--tarot-card-accent] - Accent colour (defaults per suit).
|
|
12
|
+
*/
|
|
13
|
+
export declare class TarotCard extends LitElement {
|
|
14
|
+
/** Card name or slug, e.g. "the-fool" or "Ace of Cups". */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Draw the card upside down. */
|
|
17
|
+
reversed: boolean;
|
|
18
|
+
/** Optional spread position label, e.g. "past". */
|
|
19
|
+
position: string;
|
|
20
|
+
static styles: import("lit").CSSResult;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
}
|
|
23
|
+
declare global {
|
|
24
|
+
interface HTMLElementTagNameMap {
|
|
25
|
+
"tarot-card": TarotCard;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,803 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const H = globalThis, B = H.ShadowRoot && (H.ShadyCSS === void 0 || H.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, W = Symbol(), Z = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
let he = class {
|
|
8
|
+
constructor(e, t, s) {
|
|
9
|
+
if (this._$cssResult$ = !0, s !== W) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
|
+
this.cssText = e, this.t = t;
|
|
11
|
+
}
|
|
12
|
+
get styleSheet() {
|
|
13
|
+
let e = this.o;
|
|
14
|
+
const t = this.t;
|
|
15
|
+
if (B && e === void 0) {
|
|
16
|
+
const s = t !== void 0 && t.length === 1;
|
|
17
|
+
s && (e = Z.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && Z.set(t, e));
|
|
18
|
+
}
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
21
|
+
toString() {
|
|
22
|
+
return this.cssText;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const fe = (n) => new he(typeof n == "string" ? n : n + "", void 0, W), $e = (n, ...e) => {
|
|
26
|
+
const t = n.length === 1 ? n[0] : e.reduce((s, i, o) => s + ((r) => {
|
|
27
|
+
if (r._$cssResult$ === !0) return r.cssText;
|
|
28
|
+
if (typeof r == "number") return r;
|
|
29
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + r + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
30
|
+
})(i) + n[o + 1], n[0]);
|
|
31
|
+
return new he(t, n, W);
|
|
32
|
+
}, me = (n, e) => {
|
|
33
|
+
if (B) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
34
|
+
else for (const t of e) {
|
|
35
|
+
const s = document.createElement("style"), i = H.litNonce;
|
|
36
|
+
i !== void 0 && s.setAttribute("nonce", i), s.textContent = t.cssText, n.appendChild(s);
|
|
37
|
+
}
|
|
38
|
+
}, Q = B ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
|
|
39
|
+
let t = "";
|
|
40
|
+
for (const s of e.cssRules) t += s.cssText;
|
|
41
|
+
return fe(t);
|
|
42
|
+
})(n) : n;
|
|
43
|
+
/**
|
|
44
|
+
* @license
|
|
45
|
+
* Copyright 2017 Google LLC
|
|
46
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
+
*/
|
|
48
|
+
const { is: ge, defineProperty: _e, getOwnPropertyDescriptor: ye, getOwnPropertyNames: ve, getOwnPropertySymbols: Ae, getPrototypeOf: be } = Object, m = globalThis, Y = m.trustedTypes, we = Y ? Y.emptyScript : "", z = m.reactiveElementPolyfillSupport, C = (n, e) => n, N = { toAttribute(n, e) {
|
|
49
|
+
switch (e) {
|
|
50
|
+
case Boolean:
|
|
51
|
+
n = n ? we : null;
|
|
52
|
+
break;
|
|
53
|
+
case Object:
|
|
54
|
+
case Array:
|
|
55
|
+
n = n == null ? n : JSON.stringify(n);
|
|
56
|
+
}
|
|
57
|
+
return n;
|
|
58
|
+
}, fromAttribute(n, e) {
|
|
59
|
+
let t = n;
|
|
60
|
+
switch (e) {
|
|
61
|
+
case Boolean:
|
|
62
|
+
t = n !== null;
|
|
63
|
+
break;
|
|
64
|
+
case Number:
|
|
65
|
+
t = n === null ? null : Number(n);
|
|
66
|
+
break;
|
|
67
|
+
case Object:
|
|
68
|
+
case Array:
|
|
69
|
+
try {
|
|
70
|
+
t = JSON.parse(n);
|
|
71
|
+
} catch {
|
|
72
|
+
t = null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return t;
|
|
76
|
+
} }, q = (n, e) => !ge(n, e), G = { attribute: !0, type: String, converter: N, reflect: !1, useDefault: !1, hasChanged: q };
|
|
77
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), m.litPropertyMetadata ?? (m.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
|
+
let A = class extends HTMLElement {
|
|
79
|
+
static addInitializer(e) {
|
|
80
|
+
this._$Ei(), (this.l ?? (this.l = [])).push(e);
|
|
81
|
+
}
|
|
82
|
+
static get observedAttributes() {
|
|
83
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
|
+
}
|
|
85
|
+
static createProperty(e, t = G) {
|
|
86
|
+
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) {
|
|
87
|
+
const s = Symbol(), i = this.getPropertyDescriptor(e, s, t);
|
|
88
|
+
i !== void 0 && _e(this.prototype, e, i);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
static getPropertyDescriptor(e, t, s) {
|
|
92
|
+
const { get: i, set: o } = ye(this.prototype, e) ?? { get() {
|
|
93
|
+
return this[t];
|
|
94
|
+
}, set(r) {
|
|
95
|
+
this[t] = r;
|
|
96
|
+
} };
|
|
97
|
+
return { get: i, set(r) {
|
|
98
|
+
const l = i == null ? void 0 : i.call(this);
|
|
99
|
+
o == null || o.call(this, r), this.requestUpdate(e, l, s);
|
|
100
|
+
}, configurable: !0, enumerable: !0 };
|
|
101
|
+
}
|
|
102
|
+
static getPropertyOptions(e) {
|
|
103
|
+
return this.elementProperties.get(e) ?? G;
|
|
104
|
+
}
|
|
105
|
+
static _$Ei() {
|
|
106
|
+
if (this.hasOwnProperty(C("elementProperties"))) return;
|
|
107
|
+
const e = be(this);
|
|
108
|
+
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
109
|
+
}
|
|
110
|
+
static finalize() {
|
|
111
|
+
if (this.hasOwnProperty(C("finalized"))) return;
|
|
112
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(C("properties"))) {
|
|
113
|
+
const t = this.properties, s = [...ve(t), ...Ae(t)];
|
|
114
|
+
for (const i of s) this.createProperty(i, t[i]);
|
|
115
|
+
}
|
|
116
|
+
const e = this[Symbol.metadata];
|
|
117
|
+
if (e !== null) {
|
|
118
|
+
const t = litPropertyMetadata.get(e);
|
|
119
|
+
if (t !== void 0) for (const [s, i] of t) this.elementProperties.set(s, i);
|
|
120
|
+
}
|
|
121
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
122
|
+
for (const [t, s] of this.elementProperties) {
|
|
123
|
+
const i = this._$Eu(t, s);
|
|
124
|
+
i !== void 0 && this._$Eh.set(i, t);
|
|
125
|
+
}
|
|
126
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
127
|
+
}
|
|
128
|
+
static finalizeStyles(e) {
|
|
129
|
+
const t = [];
|
|
130
|
+
if (Array.isArray(e)) {
|
|
131
|
+
const s = new Set(e.flat(1 / 0).reverse());
|
|
132
|
+
for (const i of s) t.unshift(Q(i));
|
|
133
|
+
} else e !== void 0 && t.push(Q(e));
|
|
134
|
+
return t;
|
|
135
|
+
}
|
|
136
|
+
static _$Eu(e, t) {
|
|
137
|
+
const s = t.attribute;
|
|
138
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
139
|
+
}
|
|
140
|
+
constructor() {
|
|
141
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
142
|
+
}
|
|
143
|
+
_$Ev() {
|
|
144
|
+
var e;
|
|
145
|
+
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));
|
|
146
|
+
}
|
|
147
|
+
addController(e) {
|
|
148
|
+
var t;
|
|
149
|
+
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(e), this.renderRoot !== void 0 && this.isConnected && ((t = e.hostConnected) == null || t.call(e));
|
|
150
|
+
}
|
|
151
|
+
removeController(e) {
|
|
152
|
+
var t;
|
|
153
|
+
(t = this._$EO) == null || t.delete(e);
|
|
154
|
+
}
|
|
155
|
+
_$E_() {
|
|
156
|
+
const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
|
|
157
|
+
for (const s of t.keys()) this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
|
|
158
|
+
e.size > 0 && (this._$Ep = e);
|
|
159
|
+
}
|
|
160
|
+
createRenderRoot() {
|
|
161
|
+
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
162
|
+
return me(e, this.constructor.elementStyles), e;
|
|
163
|
+
}
|
|
164
|
+
connectedCallback() {
|
|
165
|
+
var e;
|
|
166
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$EO) == null || e.forEach((t) => {
|
|
167
|
+
var s;
|
|
168
|
+
return (s = t.hostConnected) == null ? void 0 : s.call(t);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
enableUpdating(e) {
|
|
172
|
+
}
|
|
173
|
+
disconnectedCallback() {
|
|
174
|
+
var e;
|
|
175
|
+
(e = this._$EO) == null || e.forEach((t) => {
|
|
176
|
+
var s;
|
|
177
|
+
return (s = t.hostDisconnected) == null ? void 0 : s.call(t);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
attributeChangedCallback(e, t, s) {
|
|
181
|
+
this._$AK(e, s);
|
|
182
|
+
}
|
|
183
|
+
_$ET(e, t) {
|
|
184
|
+
var o;
|
|
185
|
+
const s = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, s);
|
|
186
|
+
if (i !== void 0 && s.reflect === !0) {
|
|
187
|
+
const r = (((o = s.converter) == null ? void 0 : o.toAttribute) !== void 0 ? s.converter : N).toAttribute(t, s.type);
|
|
188
|
+
this._$Em = e, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
_$AK(e, t) {
|
|
192
|
+
var o, r;
|
|
193
|
+
const s = this.constructor, i = s._$Eh.get(e);
|
|
194
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
195
|
+
const l = s.getPropertyOptions(i), a = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((o = l.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? l.converter : N;
|
|
196
|
+
this._$Em = i;
|
|
197
|
+
const c = a.fromAttribute(t, l.type);
|
|
198
|
+
this[i] = c ?? ((r = this._$Ej) == null ? void 0 : r.get(i)) ?? c, this._$Em = null;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
requestUpdate(e, t, s, i = !1, o) {
|
|
202
|
+
var r;
|
|
203
|
+
if (e !== void 0) {
|
|
204
|
+
const l = this.constructor;
|
|
205
|
+
if (i === !1 && (o = this[e]), s ?? (s = l.getPropertyOptions(e)), !((s.hasChanged ?? q)(o, t) || s.useDefault && s.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(l._$Eu(e, s)))) return;
|
|
206
|
+
this.C(e, t, s);
|
|
207
|
+
}
|
|
208
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
209
|
+
}
|
|
210
|
+
C(e, t, { useDefault: s, reflect: i, wrapped: o }, r) {
|
|
211
|
+
s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(e) && (this._$Ej.set(e, r ?? t ?? this[e]), o !== !0 || r !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), i === !0 && this._$Em !== e && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(e));
|
|
212
|
+
}
|
|
213
|
+
async _$EP() {
|
|
214
|
+
this.isUpdatePending = !0;
|
|
215
|
+
try {
|
|
216
|
+
await this._$ES;
|
|
217
|
+
} catch (t) {
|
|
218
|
+
Promise.reject(t);
|
|
219
|
+
}
|
|
220
|
+
const e = this.scheduleUpdate();
|
|
221
|
+
return e != null && await e, !this.isUpdatePending;
|
|
222
|
+
}
|
|
223
|
+
scheduleUpdate() {
|
|
224
|
+
return this.performUpdate();
|
|
225
|
+
}
|
|
226
|
+
performUpdate() {
|
|
227
|
+
var s;
|
|
228
|
+
if (!this.isUpdatePending) return;
|
|
229
|
+
if (!this.hasUpdated) {
|
|
230
|
+
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
231
|
+
for (const [o, r] of this._$Ep) this[o] = r;
|
|
232
|
+
this._$Ep = void 0;
|
|
233
|
+
}
|
|
234
|
+
const i = this.constructor.elementProperties;
|
|
235
|
+
if (i.size > 0) for (const [o, r] of i) {
|
|
236
|
+
const { wrapped: l } = r, a = this[o];
|
|
237
|
+
l !== !0 || this._$AL.has(o) || a === void 0 || this.C(o, void 0, r, a);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
let e = !1;
|
|
241
|
+
const t = this._$AL;
|
|
242
|
+
try {
|
|
243
|
+
e = this.shouldUpdate(t), e ? (this.willUpdate(t), (s = this._$EO) == null || s.forEach((i) => {
|
|
244
|
+
var o;
|
|
245
|
+
return (o = i.hostUpdate) == null ? void 0 : o.call(i);
|
|
246
|
+
}), this.update(t)) : this._$EM();
|
|
247
|
+
} catch (i) {
|
|
248
|
+
throw e = !1, this._$EM(), i;
|
|
249
|
+
}
|
|
250
|
+
e && this._$AE(t);
|
|
251
|
+
}
|
|
252
|
+
willUpdate(e) {
|
|
253
|
+
}
|
|
254
|
+
_$AE(e) {
|
|
255
|
+
var t;
|
|
256
|
+
(t = this._$EO) == null || t.forEach((s) => {
|
|
257
|
+
var i;
|
|
258
|
+
return (i = s.hostUpdated) == null ? void 0 : i.call(s);
|
|
259
|
+
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
260
|
+
}
|
|
261
|
+
_$EM() {
|
|
262
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
263
|
+
}
|
|
264
|
+
get updateComplete() {
|
|
265
|
+
return this.getUpdateComplete();
|
|
266
|
+
}
|
|
267
|
+
getUpdateComplete() {
|
|
268
|
+
return this._$ES;
|
|
269
|
+
}
|
|
270
|
+
shouldUpdate(e) {
|
|
271
|
+
return !0;
|
|
272
|
+
}
|
|
273
|
+
update(e) {
|
|
274
|
+
this._$Eq && (this._$Eq = this._$Eq.forEach((t) => this._$ET(t, this[t]))), this._$EM();
|
|
275
|
+
}
|
|
276
|
+
updated(e) {
|
|
277
|
+
}
|
|
278
|
+
firstUpdated(e) {
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[C("elementProperties")] = /* @__PURE__ */ new Map(), A[C("finalized")] = /* @__PURE__ */ new Map(), z == null || z({ ReactiveElement: A }), (m.reactiveElementVersions ?? (m.reactiveElementVersions = [])).push("2.1.2");
|
|
282
|
+
/**
|
|
283
|
+
* @license
|
|
284
|
+
* Copyright 2017 Google LLC
|
|
285
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
286
|
+
*/
|
|
287
|
+
const T = globalThis, ee = (n) => n, R = T.trustedTypes, te = R ? R.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, ce = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, de = "?" + $, Ee = `<${de}>`, v = document, P = () => v.createComment(""), U = (n) => n === null || typeof n != "object" && typeof n != "function", F = Array.isArray, Se = (n) => F(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", D = `[
|
|
288
|
+
\f\r]`, S = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, se = /-->/g, ie = />/g, g = RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
|
|
289
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ne = /'/g, re = /"/g, pe = /^(?:script|style|textarea|title)$/i, Ce = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), L = Ce(1), b = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), oe = /* @__PURE__ */ new WeakMap(), _ = v.createTreeWalker(v, 129);
|
|
290
|
+
function ue(n, e) {
|
|
291
|
+
if (!F(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
292
|
+
return te !== void 0 ? te.createHTML(e) : e;
|
|
293
|
+
}
|
|
294
|
+
const Te = (n, e) => {
|
|
295
|
+
const t = n.length - 1, s = [];
|
|
296
|
+
let i, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = S;
|
|
297
|
+
for (let l = 0; l < t; l++) {
|
|
298
|
+
const a = n[l];
|
|
299
|
+
let c, p, h = -1, u = 0;
|
|
300
|
+
for (; u < a.length && (r.lastIndex = u, p = r.exec(a), p !== null); ) u = r.lastIndex, r === S ? p[1] === "!--" ? r = se : p[1] !== void 0 ? r = ie : p[2] !== void 0 ? (pe.test(p[2]) && (i = RegExp("</" + p[2], "g")), r = g) : p[3] !== void 0 && (r = g) : r === g ? p[0] === ">" ? (r = i ?? S, h = -1) : p[1] === void 0 ? h = -2 : (h = r.lastIndex - p[2].length, c = p[1], r = p[3] === void 0 ? g : p[3] === '"' ? re : ne) : r === re || r === ne ? r = g : r === se || r === ie ? r = S : (r = g, i = void 0);
|
|
301
|
+
const f = r === g && n[l + 1].startsWith("/>") ? " " : "";
|
|
302
|
+
o += r === S ? a + Ee : h >= 0 ? (s.push(c), a.slice(0, h) + ce + a.slice(h) + $ + f) : a + $ + (h === -2 ? l : f);
|
|
303
|
+
}
|
|
304
|
+
return [ue(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
305
|
+
};
|
|
306
|
+
class O {
|
|
307
|
+
constructor({ strings: e, _$litType$: t }, s) {
|
|
308
|
+
let i;
|
|
309
|
+
this.parts = [];
|
|
310
|
+
let o = 0, r = 0;
|
|
311
|
+
const l = e.length - 1, a = this.parts, [c, p] = Te(e, t);
|
|
312
|
+
if (this.el = O.createElement(c, s), _.currentNode = this.el.content, t === 2 || t === 3) {
|
|
313
|
+
const h = this.el.content.firstChild;
|
|
314
|
+
h.replaceWith(...h.childNodes);
|
|
315
|
+
}
|
|
316
|
+
for (; (i = _.nextNode()) !== null && a.length < l; ) {
|
|
317
|
+
if (i.nodeType === 1) {
|
|
318
|
+
if (i.hasAttributes()) for (const h of i.getAttributeNames()) if (h.endsWith(ce)) {
|
|
319
|
+
const u = p[r++], f = i.getAttribute(h).split($), M = /([.?@])?(.*)/.exec(u);
|
|
320
|
+
a.push({ type: 1, index: o, name: M[2], strings: f, ctor: M[1] === "." ? Pe : M[1] === "?" ? Ue : M[1] === "@" ? Oe : k }), i.removeAttribute(h);
|
|
321
|
+
} else h.startsWith($) && (a.push({ type: 6, index: o }), i.removeAttribute(h));
|
|
322
|
+
if (pe.test(i.tagName)) {
|
|
323
|
+
const h = i.textContent.split($), u = h.length - 1;
|
|
324
|
+
if (u > 0) {
|
|
325
|
+
i.textContent = R ? R.emptyScript : "";
|
|
326
|
+
for (let f = 0; f < u; f++) i.append(h[f], P()), _.nextNode(), a.push({ type: 2, index: ++o });
|
|
327
|
+
i.append(h[u], P());
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
} else if (i.nodeType === 8) if (i.data === de) a.push({ type: 2, index: o });
|
|
331
|
+
else {
|
|
332
|
+
let h = -1;
|
|
333
|
+
for (; (h = i.data.indexOf($, h + 1)) !== -1; ) a.push({ type: 7, index: o }), h += $.length - 1;
|
|
334
|
+
}
|
|
335
|
+
o++;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
static createElement(e, t) {
|
|
339
|
+
const s = v.createElement("template");
|
|
340
|
+
return s.innerHTML = e, s;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function w(n, e, t = n, s) {
|
|
344
|
+
var r, l;
|
|
345
|
+
if (e === b) return e;
|
|
346
|
+
let i = s !== void 0 ? (r = t._$Co) == null ? void 0 : r[s] : t._$Cl;
|
|
347
|
+
const o = U(e) ? void 0 : e._$litDirective$;
|
|
348
|
+
return (i == null ? void 0 : i.constructor) !== o && ((l = i == null ? void 0 : i._$AO) == null || l.call(i, !1), o === void 0 ? i = void 0 : (i = new o(n), i._$AT(n, t, s)), s !== void 0 ? (t._$Co ?? (t._$Co = []))[s] = i : t._$Cl = i), i !== void 0 && (e = w(n, i._$AS(n, e.values), i, s)), e;
|
|
349
|
+
}
|
|
350
|
+
class xe {
|
|
351
|
+
constructor(e, t) {
|
|
352
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
353
|
+
}
|
|
354
|
+
get parentNode() {
|
|
355
|
+
return this._$AM.parentNode;
|
|
356
|
+
}
|
|
357
|
+
get _$AU() {
|
|
358
|
+
return this._$AM._$AU;
|
|
359
|
+
}
|
|
360
|
+
u(e) {
|
|
361
|
+
const { el: { content: t }, parts: s } = this._$AD, i = ((e == null ? void 0 : e.creationScope) ?? v).importNode(t, !0);
|
|
362
|
+
_.currentNode = i;
|
|
363
|
+
let o = _.nextNode(), r = 0, l = 0, a = s[0];
|
|
364
|
+
for (; a !== void 0; ) {
|
|
365
|
+
if (r === a.index) {
|
|
366
|
+
let c;
|
|
367
|
+
a.type === 2 ? c = new I(o, o.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(o, a.name, a.strings, this, e) : a.type === 6 && (c = new Ie(o, this, e)), this._$AV.push(c), a = s[++l];
|
|
368
|
+
}
|
|
369
|
+
r !== (a == null ? void 0 : a.index) && (o = _.nextNode(), r++);
|
|
370
|
+
}
|
|
371
|
+
return _.currentNode = v, i;
|
|
372
|
+
}
|
|
373
|
+
p(e) {
|
|
374
|
+
let t = 0;
|
|
375
|
+
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
class I {
|
|
379
|
+
get _$AU() {
|
|
380
|
+
var e;
|
|
381
|
+
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
382
|
+
}
|
|
383
|
+
constructor(e, t, s, i) {
|
|
384
|
+
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
|
|
385
|
+
}
|
|
386
|
+
get parentNode() {
|
|
387
|
+
let e = this._$AA.parentNode;
|
|
388
|
+
const t = this._$AM;
|
|
389
|
+
return t !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = t.parentNode), e;
|
|
390
|
+
}
|
|
391
|
+
get startNode() {
|
|
392
|
+
return this._$AA;
|
|
393
|
+
}
|
|
394
|
+
get endNode() {
|
|
395
|
+
return this._$AB;
|
|
396
|
+
}
|
|
397
|
+
_$AI(e, t = this) {
|
|
398
|
+
e = w(this, e, t), U(e) ? e === d || e == null || e === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : e !== this._$AH && e !== b && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Se(e) ? this.k(e) : this._(e);
|
|
399
|
+
}
|
|
400
|
+
O(e) {
|
|
401
|
+
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
402
|
+
}
|
|
403
|
+
T(e) {
|
|
404
|
+
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
405
|
+
}
|
|
406
|
+
_(e) {
|
|
407
|
+
this._$AH !== d && U(this._$AH) ? this._$AA.nextSibling.data = e : this.T(v.createTextNode(e)), this._$AH = e;
|
|
408
|
+
}
|
|
409
|
+
$(e) {
|
|
410
|
+
var o;
|
|
411
|
+
const { values: t, _$litType$: s } = e, i = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = O.createElement(ue(s.h, s.h[0]), this.options)), s);
|
|
412
|
+
if (((o = this._$AH) == null ? void 0 : o._$AD) === i) this._$AH.p(t);
|
|
413
|
+
else {
|
|
414
|
+
const r = new xe(i, this), l = r.u(this.options);
|
|
415
|
+
r.p(t), this.T(l), this._$AH = r;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
_$AC(e) {
|
|
419
|
+
let t = oe.get(e.strings);
|
|
420
|
+
return t === void 0 && oe.set(e.strings, t = new O(e)), t;
|
|
421
|
+
}
|
|
422
|
+
k(e) {
|
|
423
|
+
F(this._$AH) || (this._$AH = [], this._$AR());
|
|
424
|
+
const t = this._$AH;
|
|
425
|
+
let s, i = 0;
|
|
426
|
+
for (const o of e) i === t.length ? t.push(s = new I(this.O(P()), this.O(P()), this, this.options)) : s = t[i], s._$AI(o), i++;
|
|
427
|
+
i < t.length && (this._$AR(s && s._$AB.nextSibling, i), t.length = i);
|
|
428
|
+
}
|
|
429
|
+
_$AR(e = this._$AA.nextSibling, t) {
|
|
430
|
+
var s;
|
|
431
|
+
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, t); e !== this._$AB; ) {
|
|
432
|
+
const i = ee(e).nextSibling;
|
|
433
|
+
ee(e).remove(), e = i;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
setConnected(e) {
|
|
437
|
+
var t;
|
|
438
|
+
this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
class k {
|
|
442
|
+
get tagName() {
|
|
443
|
+
return this.element.tagName;
|
|
444
|
+
}
|
|
445
|
+
get _$AU() {
|
|
446
|
+
return this._$AM._$AU;
|
|
447
|
+
}
|
|
448
|
+
constructor(e, t, s, i, o) {
|
|
449
|
+
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = e, this.name = t, this._$AM = i, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = d;
|
|
450
|
+
}
|
|
451
|
+
_$AI(e, t = this, s, i) {
|
|
452
|
+
const o = this.strings;
|
|
453
|
+
let r = !1;
|
|
454
|
+
if (o === void 0) e = w(this, e, t, 0), r = !U(e) || e !== this._$AH && e !== b, r && (this._$AH = e);
|
|
455
|
+
else {
|
|
456
|
+
const l = e;
|
|
457
|
+
let a, c;
|
|
458
|
+
for (e = o[0], a = 0; a < o.length - 1; a++) c = w(this, l[s + a], t, a), c === b && (c = this._$AH[a]), r || (r = !U(c) || c !== this._$AH[a]), c === d ? e = d : e !== d && (e += (c ?? "") + o[a + 1]), this._$AH[a] = c;
|
|
459
|
+
}
|
|
460
|
+
r && !i && this.j(e);
|
|
461
|
+
}
|
|
462
|
+
j(e) {
|
|
463
|
+
e === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
class Pe extends k {
|
|
467
|
+
constructor() {
|
|
468
|
+
super(...arguments), this.type = 3;
|
|
469
|
+
}
|
|
470
|
+
j(e) {
|
|
471
|
+
this.element[this.name] = e === d ? void 0 : e;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
class Ue extends k {
|
|
475
|
+
constructor() {
|
|
476
|
+
super(...arguments), this.type = 4;
|
|
477
|
+
}
|
|
478
|
+
j(e) {
|
|
479
|
+
this.element.toggleAttribute(this.name, !!e && e !== d);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
class Oe extends k {
|
|
483
|
+
constructor(e, t, s, i, o) {
|
|
484
|
+
super(e, t, s, i, o), this.type = 5;
|
|
485
|
+
}
|
|
486
|
+
_$AI(e, t = this) {
|
|
487
|
+
if ((e = w(this, e, t, 0) ?? d) === b) return;
|
|
488
|
+
const s = this._$AH, i = e === d && s !== d || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, o = e !== d && (s === d || i);
|
|
489
|
+
i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
490
|
+
}
|
|
491
|
+
handleEvent(e) {
|
|
492
|
+
var t;
|
|
493
|
+
typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
class Ie {
|
|
497
|
+
constructor(e, t, s) {
|
|
498
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
|
|
499
|
+
}
|
|
500
|
+
get _$AU() {
|
|
501
|
+
return this._$AM._$AU;
|
|
502
|
+
}
|
|
503
|
+
_$AI(e) {
|
|
504
|
+
w(this, e);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
const V = T.litHtmlPolyfillSupport;
|
|
508
|
+
V == null || V(O, I), (T.litHtmlVersions ?? (T.litHtmlVersions = [])).push("3.3.3");
|
|
509
|
+
const Me = (n, e, t) => {
|
|
510
|
+
const s = (t == null ? void 0 : t.renderBefore) ?? e;
|
|
511
|
+
let i = s._$litPart$;
|
|
512
|
+
if (i === void 0) {
|
|
513
|
+
const o = (t == null ? void 0 : t.renderBefore) ?? null;
|
|
514
|
+
s._$litPart$ = i = new I(e.insertBefore(P(), o), o, void 0, t ?? {});
|
|
515
|
+
}
|
|
516
|
+
return i._$AI(n), i;
|
|
517
|
+
};
|
|
518
|
+
/**
|
|
519
|
+
* @license
|
|
520
|
+
* Copyright 2017 Google LLC
|
|
521
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
522
|
+
*/
|
|
523
|
+
const y = globalThis;
|
|
524
|
+
class x extends A {
|
|
525
|
+
constructor() {
|
|
526
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
527
|
+
}
|
|
528
|
+
createRenderRoot() {
|
|
529
|
+
var t;
|
|
530
|
+
const e = super.createRenderRoot();
|
|
531
|
+
return (t = this.renderOptions).renderBefore ?? (t.renderBefore = e.firstChild), e;
|
|
532
|
+
}
|
|
533
|
+
update(e) {
|
|
534
|
+
const t = this.render();
|
|
535
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Me(t, this.renderRoot, this.renderOptions);
|
|
536
|
+
}
|
|
537
|
+
connectedCallback() {
|
|
538
|
+
var e;
|
|
539
|
+
super.connectedCallback(), (e = this._$Do) == null || e.setConnected(!0);
|
|
540
|
+
}
|
|
541
|
+
disconnectedCallback() {
|
|
542
|
+
var e;
|
|
543
|
+
super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
|
|
544
|
+
}
|
|
545
|
+
render() {
|
|
546
|
+
return b;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
var le;
|
|
550
|
+
x._$litElement$ = !0, x.finalized = !0, (le = y.litElementHydrateSupport) == null || le.call(y, { LitElement: x });
|
|
551
|
+
const X = y.litElementPolyfillSupport;
|
|
552
|
+
X == null || X({ LitElement: x });
|
|
553
|
+
(y.litElementVersions ?? (y.litElementVersions = [])).push("4.2.2");
|
|
554
|
+
/**
|
|
555
|
+
* @license
|
|
556
|
+
* Copyright 2017 Google LLC
|
|
557
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
558
|
+
*/
|
|
559
|
+
const He = (n) => (e, t) => {
|
|
560
|
+
t !== void 0 ? t.addInitializer(() => {
|
|
561
|
+
customElements.define(n, e);
|
|
562
|
+
}) : customElements.define(n, e);
|
|
563
|
+
};
|
|
564
|
+
/**
|
|
565
|
+
* @license
|
|
566
|
+
* Copyright 2017 Google LLC
|
|
567
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
568
|
+
*/
|
|
569
|
+
const Ne = { attribute: !0, type: String, converter: N, reflect: !1, hasChanged: q }, Re = (n = Ne, e, t) => {
|
|
570
|
+
const { kind: s, metadata: i } = t;
|
|
571
|
+
let o = globalThis.litPropertyMetadata.get(i);
|
|
572
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), s === "setter" && ((n = Object.create(n)).wrapped = !0), o.set(t.name, n), s === "accessor") {
|
|
573
|
+
const { name: r } = t;
|
|
574
|
+
return { set(l) {
|
|
575
|
+
const a = e.get.call(this);
|
|
576
|
+
e.set.call(this, l), this.requestUpdate(r, a, n, !0, l);
|
|
577
|
+
}, init(l) {
|
|
578
|
+
return l !== void 0 && this.C(r, void 0, n, l), l;
|
|
579
|
+
} };
|
|
580
|
+
}
|
|
581
|
+
if (s === "setter") {
|
|
582
|
+
const { name: r } = t;
|
|
583
|
+
return function(l) {
|
|
584
|
+
const a = this[r];
|
|
585
|
+
e.call(this, l), this.requestUpdate(r, a, n, !0, l);
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
throw Error("Unsupported decorator location: " + s);
|
|
589
|
+
};
|
|
590
|
+
function J(n) {
|
|
591
|
+
return (e, t) => typeof t == "object" ? Re(n, e, t) : ((s, i, o) => {
|
|
592
|
+
const r = i.hasOwnProperty(o);
|
|
593
|
+
return i.constructor.createProperty(o, s), r ? Object.getOwnPropertyDescriptor(i, o) : void 0;
|
|
594
|
+
})(n, e, t);
|
|
595
|
+
}
|
|
596
|
+
const K = (n) => n.toLowerCase().replace(/\s+/g, "-"), ke = [
|
|
597
|
+
"0",
|
|
598
|
+
"I",
|
|
599
|
+
"II",
|
|
600
|
+
"III",
|
|
601
|
+
"IV",
|
|
602
|
+
"V",
|
|
603
|
+
"VI",
|
|
604
|
+
"VII",
|
|
605
|
+
"VIII",
|
|
606
|
+
"IX",
|
|
607
|
+
"X",
|
|
608
|
+
"XI",
|
|
609
|
+
"XII",
|
|
610
|
+
"XIII",
|
|
611
|
+
"XIV",
|
|
612
|
+
"XV",
|
|
613
|
+
"XVI",
|
|
614
|
+
"XVII",
|
|
615
|
+
"XVIII",
|
|
616
|
+
"XIX",
|
|
617
|
+
"XX",
|
|
618
|
+
"XXI"
|
|
619
|
+
], je = [
|
|
620
|
+
["The Fool", "beginnings, spontaneity, leap of faith", "recklessness, hesitation, naivety"],
|
|
621
|
+
["The Magician", "willpower, skill, manifestation", "manipulation, untapped talent"],
|
|
622
|
+
["The High Priestess", "intuition, mystery, inner knowing", "secrets, disconnected from intuition"],
|
|
623
|
+
["The Empress", "abundance, nurturing, creativity", "dependence, creative block"],
|
|
624
|
+
["The Emperor", "structure, authority, stability", "rigidity, domination"],
|
|
625
|
+
["The Hierophant", "tradition, guidance, convention", "rebellion, unconventional paths"],
|
|
626
|
+
["The Lovers", "union, values, choices", "disharmony, misalignment"],
|
|
627
|
+
["The Chariot", "determination, control, victory", "lack of direction, aggression"],
|
|
628
|
+
["Strength", "courage, patience, compassion", "self-doubt, raw emotion"],
|
|
629
|
+
["The Hermit", "solitude, reflection, seeking", "isolation, withdrawal"],
|
|
630
|
+
["Wheel of Fortune", "cycles, change, destiny", "bad luck, resisting change"],
|
|
631
|
+
["Justice", "fairness, truth, accountability", "unfairness, avoidance"],
|
|
632
|
+
["The Hanged Man", "surrender, new perspective, pause", "stalling, needless sacrifice"],
|
|
633
|
+
["Death", "endings, transformation, release", "resistance to change, stagnation"],
|
|
634
|
+
["Temperance", "balance, moderation, patience", "excess, imbalance"],
|
|
635
|
+
["The Devil", "attachment, shadow, temptation", "release, reclaiming power"],
|
|
636
|
+
["The Tower", "upheaval, revelation, sudden change", "avoiding disaster, fear of change"],
|
|
637
|
+
["The Star", "hope, renewal, serenity", "discouragement, lost faith"],
|
|
638
|
+
["The Moon", "illusion, intuition, the unconscious", "clarity emerging, confusion lifting"],
|
|
639
|
+
["The Sun", "joy, vitality, success", "temporary sadness, dimmed optimism"],
|
|
640
|
+
["Judgement", "reckoning, calling, absolution", "self-doubt, ignoring the call"],
|
|
641
|
+
["The World", "completion, wholeness, achievement", "unfinished business, delays"]
|
|
642
|
+
], ze = [
|
|
643
|
+
["Ace", "new opportunity, potential", "missed chance, delay"],
|
|
644
|
+
["Two", "balance, partnership, choice", "imbalance, indecision"],
|
|
645
|
+
["Three", "growth, collaboration, expression", "obstacles, poor teamwork"],
|
|
646
|
+
["Four", "stability, rest, foundations", "stagnation, restlessness"],
|
|
647
|
+
["Five", "conflict, challenge, loss", "recovery, resolving conflict"],
|
|
648
|
+
["Six", "harmony, progress, generosity", "stalled progress, imbalance"],
|
|
649
|
+
["Seven", "assessment, perseverance, reflection", "impatience, giving up"],
|
|
650
|
+
["Eight", "movement, mastery, change", "burnout, blocked effort"],
|
|
651
|
+
["Nine", "near completion, resilience, solitude", "exhaustion, anxiety"],
|
|
652
|
+
["Ten", "culmination, completion, burden", "overload, release"],
|
|
653
|
+
["Page", "curiosity, messages, learning", "immaturity, hesitation"],
|
|
654
|
+
["Knight", "action, pursuit, momentum", "impulsiveness, stalling"],
|
|
655
|
+
["Queen", "nurturing mastery, maturity", "insecurity, smothering"],
|
|
656
|
+
["King", "authority, command, experience", "misuse of power, rigidity"]
|
|
657
|
+
], ae = {
|
|
658
|
+
wands: "passion, drive, creativity",
|
|
659
|
+
cups: "emotion, relationships, intuition",
|
|
660
|
+
swords: "intellect, truth, conflict",
|
|
661
|
+
pentacles: "work, money, the material world"
|
|
662
|
+
}, De = je.map(([n, e, t], s) => ({
|
|
663
|
+
slug: K(n),
|
|
664
|
+
name: n,
|
|
665
|
+
suit: "major",
|
|
666
|
+
label: ke[s],
|
|
667
|
+
upright: e,
|
|
668
|
+
reversed: t
|
|
669
|
+
})), Le = Object.keys(ae).flatMap(
|
|
670
|
+
(n) => ze.map(([e, t, s]) => ({
|
|
671
|
+
slug: K(`${e} of ${n}`),
|
|
672
|
+
name: `${e} of ${n[0].toUpperCase()}${n.slice(1)}`,
|
|
673
|
+
suit: n,
|
|
674
|
+
label: e,
|
|
675
|
+
upright: `${t} (${ae[n]})`,
|
|
676
|
+
reversed: s
|
|
677
|
+
}))
|
|
678
|
+
), Ve = [...De, ...Le], Xe = new Map(Ve.map((n) => [n.slug, n]));
|
|
679
|
+
function Be(n) {
|
|
680
|
+
return Xe.get(K(n.trim().replace(/_/g, " ")));
|
|
681
|
+
}
|
|
682
|
+
var We = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, j = (n, e, t, s) => {
|
|
683
|
+
for (var i = s > 1 ? void 0 : s ? qe(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
684
|
+
(r = n[o]) && (i = (s ? r(e, t, i) : r(i)) || i);
|
|
685
|
+
return s && i && We(e, t, i), i;
|
|
686
|
+
};
|
|
687
|
+
const Fe = {
|
|
688
|
+
major: "✦",
|
|
689
|
+
wands: "𓋹",
|
|
690
|
+
cups: "♥",
|
|
691
|
+
swords: "⚔",
|
|
692
|
+
pentacles: "⬟"
|
|
693
|
+
}, Je = {
|
|
694
|
+
major: "#6b4fa0",
|
|
695
|
+
wands: "#c2561d",
|
|
696
|
+
cups: "#2b6cb0",
|
|
697
|
+
swords: "#5a6b7b",
|
|
698
|
+
pentacles: "#2f855a"
|
|
699
|
+
};
|
|
700
|
+
let E = class extends x {
|
|
701
|
+
constructor() {
|
|
702
|
+
super(...arguments), this.name = "", this.reversed = !1, this.position = "";
|
|
703
|
+
}
|
|
704
|
+
render() {
|
|
705
|
+
const n = Be(this.name);
|
|
706
|
+
return n ? L`
|
|
707
|
+
<figure
|
|
708
|
+
style="--accent: var(--tarot-card-accent, ${Je[n.suit]})"
|
|
709
|
+
>
|
|
710
|
+
${this.position ? L`<div class="position">${this.position}</div>` : null}
|
|
711
|
+
<div
|
|
712
|
+
class="card"
|
|
713
|
+
part="card"
|
|
714
|
+
role="img"
|
|
715
|
+
aria-label="${n.name}${this.reversed ? ", reversed" : ""}"
|
|
716
|
+
>
|
|
717
|
+
<span class="label">${n.label}</span>
|
|
718
|
+
<span class="symbol">${Fe[n.suit]}</span>
|
|
719
|
+
<span class="title">${n.name}</span>
|
|
720
|
+
</div>
|
|
721
|
+
<figcaption part="notes"><slot></slot></figcaption>
|
|
722
|
+
</figure>
|
|
723
|
+
` : L`<p class="error">Unknown card: “${this.name}”</p>`;
|
|
724
|
+
}
|
|
725
|
+
};
|
|
726
|
+
E.styles = $e`
|
|
727
|
+
:host {
|
|
728
|
+
display: inline-block;
|
|
729
|
+
vertical-align: top;
|
|
730
|
+
margin: 0.5rem;
|
|
731
|
+
text-align: center;
|
|
732
|
+
font-family: inherit;
|
|
733
|
+
}
|
|
734
|
+
figure {
|
|
735
|
+
margin: 0;
|
|
736
|
+
width: var(--tarot-card-width, 140px);
|
|
737
|
+
}
|
|
738
|
+
.position {
|
|
739
|
+
font-size: 0.75rem;
|
|
740
|
+
text-transform: uppercase;
|
|
741
|
+
letter-spacing: 0.08em;
|
|
742
|
+
opacity: 0.7;
|
|
743
|
+
margin-bottom: 0.35rem;
|
|
744
|
+
}
|
|
745
|
+
.card {
|
|
746
|
+
aspect-ratio: 2 / 3;
|
|
747
|
+
border-radius: 8px;
|
|
748
|
+
border: 2px solid var(--accent);
|
|
749
|
+
background: color-mix(in srgb, var(--accent) 12%, #fdf8ee);
|
|
750
|
+
color: #2a2438;
|
|
751
|
+
display: flex;
|
|
752
|
+
flex-direction: column;
|
|
753
|
+
align-items: center;
|
|
754
|
+
justify-content: space-between;
|
|
755
|
+
padding: 0.6rem 0.4rem;
|
|
756
|
+
box-sizing: border-box;
|
|
757
|
+
transition: transform 0.4s ease;
|
|
758
|
+
}
|
|
759
|
+
:host([reversed]) .card {
|
|
760
|
+
transform: rotate(180deg);
|
|
761
|
+
}
|
|
762
|
+
.label {
|
|
763
|
+
font-size: 1.1rem;
|
|
764
|
+
font-weight: 600;
|
|
765
|
+
}
|
|
766
|
+
.symbol {
|
|
767
|
+
font-size: 2.6rem;
|
|
768
|
+
line-height: 1;
|
|
769
|
+
color: var(--accent);
|
|
770
|
+
}
|
|
771
|
+
.title {
|
|
772
|
+
font-size: 0.85rem;
|
|
773
|
+
font-weight: 600;
|
|
774
|
+
line-height: 1.2;
|
|
775
|
+
}
|
|
776
|
+
figcaption {
|
|
777
|
+
margin-top: 0.8rem;
|
|
778
|
+
font-size: 0.8rem;
|
|
779
|
+
opacity: 0.8;
|
|
780
|
+
font-style: italic;
|
|
781
|
+
}
|
|
782
|
+
.error {
|
|
783
|
+
color: #b00020;
|
|
784
|
+
font-size: 0.85rem;
|
|
785
|
+
}
|
|
786
|
+
`;
|
|
787
|
+
j([
|
|
788
|
+
J({ type: String })
|
|
789
|
+
], E.prototype, "name", 2);
|
|
790
|
+
j([
|
|
791
|
+
J({ type: Boolean, reflect: !0 })
|
|
792
|
+
], E.prototype, "reversed", 2);
|
|
793
|
+
j([
|
|
794
|
+
J({ type: String })
|
|
795
|
+
], E.prototype, "position", 2);
|
|
796
|
+
E = j([
|
|
797
|
+
He("tarot-card")
|
|
798
|
+
], E);
|
|
799
|
+
export {
|
|
800
|
+
Ve as CARDS,
|
|
801
|
+
E as TarotCard,
|
|
802
|
+
Be as findCard
|
|
803
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tarot-elements",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A <tarot-card> web component built with Lit, for tarot readings in Markdown and HTML",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "jwmazzi",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/jwmazzi/tarot-elements.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/jwmazzi/tarot-elements#readme",
|
|
13
|
+
"bugs": "https://github.com/jwmazzi/tarot-elements/issues",
|
|
14
|
+
"keywords": ["tarot", "web-component", "custom-element", "lit", "eleventy"],
|
|
15
|
+
"main": "./dist/tarot-elements.js",
|
|
16
|
+
"module": "./dist/tarot-elements.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/tarot-elements.js"
|
|
22
|
+
},
|
|
23
|
+
"./custom-elements.json": "./custom-elements.json"
|
|
24
|
+
},
|
|
25
|
+
"files": ["dist", "custom-elements.json"],
|
|
26
|
+
"customElements": "custom-elements.json",
|
|
27
|
+
"sideEffects": true,
|
|
28
|
+
"scripts": {
|
|
29
|
+
"dev": "vite",
|
|
30
|
+
"build": "vite build && tsc --emitDeclarationOnly && npm run analyze",
|
|
31
|
+
"analyze": "cem analyze --litelement --globs \"src/**/*.ts\"",
|
|
32
|
+
"watch": "vite build --watch",
|
|
33
|
+
"typecheck": "tsc --noEmit",
|
|
34
|
+
"prepublishOnly": "npm run typecheck && npm run build"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"lit": "^3.2.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@custom-elements-manifest/analyzer": "^0.10.0",
|
|
41
|
+
"typescript": "^5.6.0",
|
|
42
|
+
"vite": "^6.0.0"
|
|
43
|
+
}
|
|
44
|
+
}
|