@mhmo91/schmancy 0.2.193 → 0.2.194

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.
Files changed (93) hide show
  1. package/ai/area.md +125 -0
  2. package/ai/autocomplete.md +135 -0
  3. package/ai/avatar.md +178 -0
  4. package/ai/badge.md +100 -0
  5. package/ai/busy.md +195 -0
  6. package/ai/button.md +112 -0
  7. package/ai/card.md +155 -0
  8. package/ai/checkbox.md +108 -0
  9. package/ai/chips.md +180 -0
  10. package/ai/component-relationships.md +93 -0
  11. package/ai/dialog.md +109 -0
  12. package/ai/dropdown.md +238 -0
  13. package/ai/form.md +148 -0
  14. package/ai/icons.md +147 -0
  15. package/ai/index.md +71 -0
  16. package/ai/input.md +167 -0
  17. package/ai/layout.md +166 -0
  18. package/ai/list.md +145 -0
  19. package/ai/menu.md +217 -0
  20. package/ai/notification.md +93 -0
  21. package/ai/radio-group.md +176 -0
  22. package/ai/select.md +174 -0
  23. package/ai/sheet.md +122 -0
  24. package/ai/store.md +235 -0
  25. package/ai/surface.md +221 -0
  26. package/ai/table.md +236 -0
  27. package/ai/tabs.md +71 -0
  28. package/ai/template.md +144 -0
  29. package/ai/textarea.md +147 -0
  30. package/ai/tooltip.md +149 -0
  31. package/ai/tree.md +279 -0
  32. package/ai/typography.md +170 -0
  33. package/dist/ai/area.md +125 -0
  34. package/dist/ai/autocomplete.md +135 -0
  35. package/dist/ai/avatar.md +178 -0
  36. package/dist/ai/badge.md +100 -0
  37. package/dist/ai/busy.md +195 -0
  38. package/dist/ai/button.md +112 -0
  39. package/dist/ai/card.md +155 -0
  40. package/dist/ai/checkbox.md +108 -0
  41. package/dist/ai/chips.md +180 -0
  42. package/dist/ai/component-relationships.md +93 -0
  43. package/dist/ai/dialog.md +109 -0
  44. package/dist/ai/dropdown.md +238 -0
  45. package/dist/ai/form.md +148 -0
  46. package/dist/ai/icons.md +147 -0
  47. package/dist/ai/index.md +71 -0
  48. package/dist/ai/input.md +167 -0
  49. package/dist/ai/layout.md +166 -0
  50. package/dist/ai/list.md +145 -0
  51. package/dist/ai/menu.md +217 -0
  52. package/dist/ai/notification.md +93 -0
  53. package/dist/ai/radio-group.md +176 -0
  54. package/dist/ai/select.md +174 -0
  55. package/dist/ai/sheet.md +122 -0
  56. package/dist/ai/store.md +235 -0
  57. package/dist/ai/surface.md +221 -0
  58. package/dist/ai/table.md +236 -0
  59. package/dist/ai/tabs.md +71 -0
  60. package/dist/ai/template.md +144 -0
  61. package/dist/ai/textarea.md +147 -0
  62. package/dist/ai/tooltip.md +149 -0
  63. package/dist/ai/tree.md +279 -0
  64. package/dist/ai/typography.md +170 -0
  65. package/dist/area.cjs +1 -1
  66. package/dist/area.component-CzFJM7Y4.js +143 -0
  67. package/dist/area.component-CzFJM7Y4.js.map +1 -0
  68. package/dist/area.component-WxccFh1z.cjs +8 -0
  69. package/dist/area.component-WxccFh1z.cjs.map +1 -0
  70. package/dist/area.js +1 -1
  71. package/dist/{avatar-s-2jSsaH.cjs → avatar-Bmg5TXj9.cjs} +2 -2
  72. package/dist/{avatar-s-2jSsaH.cjs.map → avatar-Bmg5TXj9.cjs.map} +1 -1
  73. package/dist/{avatar-WAIlaNJg.js → avatar-CgP1tBZq.js} +2 -2
  74. package/dist/{avatar-WAIlaNJg.js.map → avatar-CgP1tBZq.js.map} +1 -1
  75. package/dist/badge.cjs +1 -1
  76. package/dist/badge.js +1 -1
  77. package/dist/card.cjs +1 -1
  78. package/dist/card.js +1 -1
  79. package/dist/content-drawer.cjs +1 -1
  80. package/dist/content-drawer.js +1 -1
  81. package/dist/index.cjs +1 -1
  82. package/dist/index.js +2 -2
  83. package/dist/nav-drawer.cjs +1 -1
  84. package/dist/nav-drawer.js +1 -1
  85. package/dist/teleport.cjs +1 -1
  86. package/dist/teleport.js +1 -1
  87. package/package.json +2 -1
  88. package/types/src/area/area.service.d.ts +53 -4
  89. package/types/src/area/router.types.d.ts +41 -2
  90. package/dist/area.component-CZELEuMj.js +0 -107
  91. package/dist/area.component-CZELEuMj.js.map +0 -1
  92. package/dist/area.component-grRkXEse.cjs +0 -8
  93. package/dist/area.component-grRkXEse.cjs.map +0 -1
@@ -0,0 +1,170 @@
1
+ # Schmancy Typography - AI Reference
2
+
3
+ ```js
4
+ // Basic Typography
5
+ <schmancy-typography
6
+ variant="h1|h2|h3|h4|h5|h6|subtitle1|subtitle2|body1|body2|button|caption|overline"
7
+ color="primary|secondary|tertiary|error|text-primary|text-secondary|text-disabled"
8
+ align="left|center|right|justify"
9
+ weight="thin|light|regular|medium|bold"
10
+ transform="none|uppercase|lowercase|capitalize"
11
+ truncate?
12
+ no-wrap?
13
+ gutter-bottom?>
14
+ Text content goes here
15
+ </schmancy-typography>
16
+
17
+ // Typography heading variants
18
+ <schmancy-typography variant="h1">Heading 1</schmancy-typography>
19
+ <schmancy-typography variant="h2">Heading 2</schmancy-typography>
20
+ <schmancy-typography variant="h3">Heading 3</schmancy-typography>
21
+ <schmancy-typography variant="h4">Heading 4</schmancy-typography>
22
+ <schmancy-typography variant="h5">Heading 5</schmancy-typography>
23
+ <schmancy-typography variant="h6">Heading 6</schmancy-typography>
24
+
25
+ // Typography body variants
26
+ <schmancy-typography variant="subtitle1">Subtitle 1</schmancy-typography>
27
+ <schmancy-typography variant="subtitle2">Subtitle 2</schmancy-typography>
28
+ <schmancy-typography variant="body1">Body 1 text</schmancy-typography>
29
+ <schmancy-typography variant="body2">Body 2 text</schmancy-typography>
30
+ <schmancy-typography variant="button">Button text</schmancy-typography>
31
+ <schmancy-typography variant="caption">Caption text</schmancy-typography>
32
+ <schmancy-typography variant="overline">Overline text</schmancy-typography>
33
+
34
+ // Typography Properties
35
+ variant: string // Text style variant
36
+ color: string // Text color
37
+ align: string // Text alignment
38
+ weight: string // Font weight
39
+ transform: string // Text transformation
40
+ truncate: boolean // Truncate overflow with ellipsis
41
+ noWrap: boolean // Prevent text wrapping
42
+ gutterBottom: boolean // Add margin at the bottom
43
+ italic: boolean // Italic style
44
+ underline: boolean // Underline text
45
+ lineHeight: string // Line height
46
+ letterSpacing: string // Letter spacing
47
+ fontFamily: string // Font family
48
+ size: string // Custom font size (overrides variant)
49
+ responsive: boolean // Apply responsive sizing
50
+
51
+ // Examples
52
+ // Basic usage
53
+ <schmancy-typography variant="h2" color="primary">
54
+ Welcome to Our Application
55
+ </schmancy-typography>
56
+
57
+ <schmancy-typography variant="body1">
58
+ This is a paragraph of text that demonstrates the body1 typography variant.
59
+ It's commonly used for the main content text on a page.
60
+ </schmancy-typography>
61
+
62
+ // Styled text
63
+ <schmancy-typography
64
+ variant="subtitle1"
65
+ weight="bold"
66
+ color="secondary"
67
+ transform="uppercase">
68
+ Important Notice
69
+ </schmancy-typography>
70
+
71
+ // Truncated text
72
+ <schmancy-typography
73
+ variant="body2"
74
+ truncate
75
+ style="max-width: 200px;">
76
+ This is a very long text that will be truncated with an ellipsis when it exceeds the container width.
77
+ </schmancy-typography>
78
+
79
+ // Responsive headings
80
+ <schmancy-typography
81
+ variant="h1"
82
+ responsive
83
+ align="center"
84
+ gutter-bottom>
85
+ Responsive Heading
86
+ </schmancy-typography>
87
+
88
+ // Text with custom styling
89
+ <schmancy-typography
90
+ variant="body1"
91
+ italic
92
+ letter-spacing="0.5px"
93
+ line-height="1.8">
94
+ This text has custom letter spacing and line height, with italic styling.
95
+ </schmancy-typography>
96
+
97
+ // Text with different weights
98
+ <div>
99
+ <schmancy-typography variant="body1" weight="thin">
100
+ This text has thin weight.
101
+ </schmancy-typography>
102
+
103
+ <schmancy-typography variant="body1" weight="light">
104
+ This text has light weight.
105
+ </schmancy-typography>
106
+
107
+ <schmancy-typography variant="body1" weight="regular">
108
+ This text has regular weight.
109
+ </schmancy-typography>
110
+
111
+ <schmancy-typography variant="body1" weight="medium">
112
+ This text has medium weight.
113
+ </schmancy-typography>
114
+
115
+ <schmancy-typography variant="body1" weight="bold">
116
+ This text has bold weight.
117
+ </schmancy-typography>
118
+ </div>
119
+
120
+ // Typography in a card
121
+ <schmancy-card>
122
+ <schmancy-card-content>
123
+ <schmancy-typography variant="h4" gutter-bottom>
124
+ Card Title
125
+ </schmancy-typography>
126
+
127
+ <schmancy-typography variant="body2" color="text-secondary" gutter-bottom>
128
+ Posted on January 1, 2023
129
+ </schmancy-typography>
130
+
131
+ <schmancy-typography variant="body1">
132
+ This is the main content of the card. It uses the body1 typography variant
133
+ which is suitable for longer text content.
134
+ </schmancy-typography>
135
+ </schmancy-card-content>
136
+
137
+ <schmancy-card-actions>
138
+ <schmancy-button>
139
+ <schmancy-typography variant="button">
140
+ Read More
141
+ </schmancy-typography>
142
+ </schmancy-button>
143
+ </schmancy-card-actions>
144
+ </schmancy-card>
145
+
146
+ // Error message
147
+ <schmancy-typography
148
+ variant="body2"
149
+ color="error"
150
+ gutter-bottom>
151
+ The username or password you entered is incorrect.
152
+ </schmancy-typography>
153
+
154
+ // Caption with custom size
155
+ <schmancy-typography
156
+ variant="caption"
157
+ color="text-secondary"
158
+ size="10px">
159
+ * Terms and conditions apply
160
+ </schmancy-typography>
161
+
162
+ // Paragraph with custom font family
163
+ <schmancy-typography
164
+ variant="body1"
165
+ font-family="'Georgia', serif"
166
+ line-height="1.7">
167
+ This paragraph uses a serif font for a more traditional typographic style.
168
+ Custom font families can be specified when needed for special sections.
169
+ </schmancy-typography>
170
+ ```
package/dist/area.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./area.component-grRkXEse.cjs");exports.FINDING_MORTIES=e.FINDING_MORTIES,exports.HERE_RICKY=e.HERE_RICKY,exports.HISTORY_STRATEGY=e.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>e.SchmancyArea}),exports.area=e.area,exports.routerHistory=e.routerHistory;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./area.component-WxccFh1z.cjs");exports.FINDING_MORTIES=e.FINDING_MORTIES,exports.HERE_RICKY=e.HERE_RICKY,exports.HISTORY_STRATEGY=e.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>e.SchmancyArea}),exports.area=e.area,exports.routerHistory=e.routerHistory;
2
2
  //# sourceMappingURL=area.cjs.map
@@ -0,0 +1,143 @@
1
+ import { Subject as R, ReplaySubject as d, skip as b, map as o, filter as c, zip as I, fromEvent as w, of as i, bufferTime as P, tap as u, timeout as O, catchError as E, EMPTY as j, merge as U, switchMap as f, take as N, takeUntil as y, distinctUntilChanged as v, from as $ } from "rxjs";
2
+ import "lit/directives/class-map.js";
3
+ import "lit/directives/style-map.js";
4
+ import { $ as x } from "./litElement.mixin-B9Qdq5S_.js";
5
+ import "./tailwind.mixin-Di7KWye7.js";
6
+ import { css as F, html as T } from "lit";
7
+ import { property as C, customElement as A } from "lit/decorators.js";
8
+ import { l as L } from "./index-CuY8m6ta.js";
9
+ const V = new R(), M = "FINDING_MORTIES", J = "HERE_RICKY";
10
+ class p {
11
+ constructor() {
12
+ this.prettyURL = !1, this.mode = "HISTORY", this.request = new d(1), this.current = /* @__PURE__ */ new Map(), this.$current = new d(1), this.areaSubjects = /* @__PURE__ */ new Map(), this.enableHistoryMode = !0, this.findingMortiesEvent = new CustomEvent(M), this.$current.next(this.current), this.$current.subscribe((t) => {
13
+ t.forEach((e, n) => {
14
+ this.getOrCreateAreaSubject(n).next(e);
15
+ });
16
+ });
17
+ }
18
+ getOrCreateAreaSubject(t) {
19
+ if (!this.areaSubjects.has(t)) {
20
+ const n = new d(1);
21
+ this.areaSubjects.set(t, n);
22
+ const s = this.current.get(t);
23
+ s && n.next({ ...s, state: s.state || {}, params: s.params || {} });
24
+ }
25
+ const e = this.areaSubjects.get(t);
26
+ if (!e) throw new Error(`Failed to create or retrieve subject for area: ${t}`);
27
+ return e;
28
+ }
29
+ on(t, e = !1) {
30
+ const n = this.getOrCreateAreaSubject(t);
31
+ return e ? n.pipe(b(1)) : n.asObservable();
32
+ }
33
+ all(t = !1) {
34
+ return t ? this.$current.pipe(b(1)) : this.$current.asObservable();
35
+ }
36
+ getState(t) {
37
+ return this.on(t).pipe(o((e) => e.state), c((e) => e !== void 0), o((e) => e));
38
+ }
39
+ params(t) {
40
+ return this.on(t).pipe(o((e) => e.params), c((e) => e !== void 0), o((e) => e));
41
+ }
42
+ param(t, e) {
43
+ return this.params(t).pipe(o((n) => n[e]), c((n) => n !== void 0), o((n) => n));
44
+ }
45
+ find() {
46
+ return I([w(window, J).pipe(o((t) => t.detail), P(0), u(console.log)), i(1).pipe(u(() => window.dispatchEvent(this.findingMortiesEvent)))]).pipe(o(([t]) => t), O(1));
47
+ }
48
+ push(t) {
49
+ const e = { ...t, state: t.state || {}, params: t.params || {} };
50
+ this.request.next(e), this.dispatchAreaEvent(e.area, e);
51
+ }
52
+ dispatchAreaEvent(t, e) {
53
+ const n = new CustomEvent(`schmancy-area-${t}-changed`, { detail: { area: t, component: e.component, state: e.state, params: e.params, historyStrategy: e.historyStrategy }, bubbles: !0, composed: !0 });
54
+ window.dispatchEvent(n);
55
+ }
56
+ pop(t) {
57
+ const e = JSON.parse(JSON.stringify(m.state));
58
+ delete e[t], history.replaceState(null, "", encodeURIComponent(JSON.stringify(e)));
59
+ }
60
+ static getInstance() {
61
+ return p.instance || (p.instance = new p()), p.instance;
62
+ }
63
+ get state() {
64
+ const t = location.pathname.split("/").pop();
65
+ let e = {};
66
+ try {
67
+ e = t ? JSON.parse(decodeURIComponent(t)) : {};
68
+ } catch {
69
+ e = {};
70
+ }
71
+ return e;
72
+ }
73
+ }
74
+ const m = p.getInstance();
75
+ var S = ((a) => (a.push = "push", a.replace = "replace", a.pop = "pop", a.silent = "silent", a))(S || {}), k = Object.defineProperty, q = Object.getOwnPropertyDescriptor, g = (a, t, e, n) => {
76
+ for (var s, r = n > 1 ? void 0 : n ? q(t, e) : t, l = a.length - 1; l >= 0; l--) (s = a[l]) && (r = (n ? s(t, e, r) : s(r)) || r);
77
+ return n && r && k(t, e, r), r;
78
+ };
79
+ let h = class extends x(F`
80
+ :host {
81
+ position: relative;
82
+ display: block;
83
+ inset: 0;
84
+ }
85
+ `) {
86
+ getComponentFromPathname(a, t) {
87
+ return i(a).pipe(o((e) => e.split("/").pop() ?? ""), o((e) => decodeURIComponent(e)), o((e) => JSON.parse(e)), o((e) => e[this.name]), o((e) => !e && this.default ? { component: this.default, state: void 0 } : e), c((e) => L.isPresent(e)), o((e) => ({ area: this.name, component: e.component ?? this.default, state: e.state, historyStrategy: t })), o((e) => e), E(() => this.default ? i({ area: this.name, component: this.default, historyStrategy: t }) : j));
88
+ }
89
+ firstUpdated() {
90
+ if (!this.name) throw new Error("Area name or default component not set");
91
+ U(i(location.pathname).pipe(f((a) => this.getComponentFromPathname(a, S.silent)), o((a) => a), N(1)), m.request.pipe(c(({ area: a }) => a === this.name)), w(window, "popstate").pipe(o((a) => a.target.location.pathname), f((a) => this.getComponentFromPathname(a, S.silent)), o((a) => a))).pipe(c((a) => !!a.component), y(this.disconnecting), v((a, t) => {
92
+ let e, n;
93
+ return typeof a.component != "function" && (typeof a.component == "string" && (e = a.component), typeof t.component != "function" && (typeof t.component == "string" && (n = t.component), (n == null ? void 0 : n.replaceAll("-", "").toLowerCase()) === (e == null ? void 0 : e.replaceAll("-", "").toLowerCase())));
94
+ })).pipe(f((a) => {
95
+ const t = a.component;
96
+ return t instanceof Promise ? $(t).pipe(o((e) => ({ component: e.exports.default, route: a }))) : i({ component: t, route: a });
97
+ }), o(({ component: a, route: t }) => typeof a == "string" ? { component: document.createElement(a), route: t } : a instanceof HTMLElement ? { component: a, route: t } : typeof a == "function" ? { component: new a(), route: t } : void 0), v((a, t) => a.component.tagName === t.component.tagName), o(({ component: a, route: t }) => {
98
+ var s, r;
99
+ const e = (s = this.shadowRoot) == null ? void 0 : s.children[0], n = !!e;
100
+ return e.remove(), a.classList.add("opacity-0"), (r = this.shadowRoot) == null || r.append(a), a.animate([{ opacity: 0 }, { opacity: 1 }], { duration: n ? 150 : 100, easing: "cubic-bezier(0.25, 0.8, 0.25, 1)", fill: "forwards" }), { component: a, route: t };
101
+ }), u(({ component: a, route: t }) => {
102
+ t.historyStrategy === void 0 || t.historyStrategy === "push" ? history.pushState(t.state, "", this.newPath(a.tagName, t)) : t.historyStrategy && ["replace", "pop"].includes(t.historyStrategy) && history.replaceState(t.state, "", this.newPath(a.tagName, t)), m.current.set(this.name, { component: a.tagName, state: t.state || {}, area: this.name, params: t.params || {} }), m.$current.next(m.current);
103
+ }), y(this.disconnecting)).subscribe();
104
+ }
105
+ newPath(a, t) {
106
+ const e = location.pathname.split("/").pop();
107
+ let n = {};
108
+ try {
109
+ n = e ? JSON.parse(decodeURIComponent(e)) : {};
110
+ } catch {
111
+ n = {};
112
+ }
113
+ t.state = t.state ?? {};
114
+ const s = t.clearQueryParams ? this.queryParamClear(t.clearQueryParams) : document.location.search;
115
+ return encodeURIComponent(JSON.stringify({ ...n, [this.name]: { component: a.toLowerCase(), state: t.state, params: t.params } })).concat(`${s}`);
116
+ }
117
+ queryParamClear(a) {
118
+ if (!a) return "";
119
+ const t = new URLSearchParams(location.search);
120
+ return a.forEach((e) => t.delete(e)), t.toString() === "" ? "" : `?${t.toString()}`;
121
+ }
122
+ checkForTeleportationRequests() {
123
+ return w(window, "FLIP_REQUEST").pipe(o((a) => a.detail), P(0), u(() => {
124
+ this.dispatchEvent(new CustomEvent("FLIP_STARTED"));
125
+ }), y(this.disconnecting), O(0), E(() => i(null)));
126
+ }
127
+ disconnectedCallback() {
128
+ super.disconnectedCallback(), this.disconnecting.next(!0);
129
+ }
130
+ render() {
131
+ return T` <slot> </slot> `;
132
+ }
133
+ };
134
+ g([C()], h.prototype, "name", 2), g([C()], h.prototype, "default", 2), h = g([A("schmancy-area")], h);
135
+ export {
136
+ M as F,
137
+ J as H,
138
+ h as S,
139
+ m as a,
140
+ S as b,
141
+ V as r
142
+ };
143
+ //# sourceMappingURL=area.component-CzFJM7Y4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"area.component-CzFJM7Y4.js","sources":["../src/area/area.service.ts","../src/area/router.types.ts","../src/area/area.component.ts"],"sourcesContent":["import { Observable, ReplaySubject, Subject, bufferTime, filter, fromEvent, map, of, skip, tap, timeout, zip } from 'rxjs'\nimport { SchmancyTeleportation } from '../teleport'\nimport { ActiveRoute, AreaSubscription, RouteAction } from './router.types'\n\nexport const routerHistory = new Subject<RouteAction>()\n\nexport const FINDING_MORTIES = 'FINDING_MORTIES'\nexport const HERE_RICKY = 'HERE_RICKY'\nexport type HERE_RICKY_EVENT = CustomEvent<{\n\tcomponent: SchmancyTeleportation\n}>\nexport type FINDING_MORTIES_EVENT = CustomEvent<{\n\tcomponent: SchmancyTeleportation\n}>\n\nclass AreaService implements AreaSubscription {\n\tprivate static instance: AreaService\n\tpublic prettyURL = false\n\tpublic mode: 'SILENT' | 'HISTORY' = 'HISTORY'\n\tpublic request = new ReplaySubject<RouteAction>(1)\n\tpublic current = new Map<string, ActiveRoute>()\n\tpublic $current = new ReplaySubject<Map<string, ActiveRoute>>(1)\n\t\n\t// Create a dictionary of ReplaySubjects for area-specific subscriptions\n\tprivate areaSubjects = new Map<string, ReplaySubject<ActiveRoute>>()\n\t\n\tpublic enableHistoryMode = true\n\tprivate findingMortiesEvent = new CustomEvent<FINDING_MORTIES_EVENT['detail']>(FINDING_MORTIES)\n\n\tconstructor() {\n\t\tthis.$current.next(this.current)\n\t\t\n\t\t// Subscribe to current changes to update area-specific subjects\n\t\tthis.$current.subscribe(currentAreas => {\n\t\t\t// For each area in the current map\n\t\t\tcurrentAreas.forEach((route, areaName) => {\n\t\t\t\t// Get or create a subject for this area\n\t\t\t\tconst areaSubject = this.getOrCreateAreaSubject(areaName)\n\t\t\t\t// Emit the updated route to area-specific subscribers\n\t\t\t\tareaSubject.next(route)\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Get or create a ReplaySubject for a specific area\n\t * @param areaName The name of the area\n\t * @returns ReplaySubject for the specified area\n\t */\n\tprivate getOrCreateAreaSubject(areaName: string): ReplaySubject<ActiveRoute> {\n\t\tif (!this.areaSubjects.has(areaName)) {\n\t\t\tconst subject = new ReplaySubject<ActiveRoute>(1)\n\t\t\tthis.areaSubjects.set(areaName, subject)\n\t\t\t\n\t\t\t// If the area already exists in current, emit it immediately\n\t\t\tconst currentRoute = this.current.get(areaName)\n\t\t\tif (currentRoute) {\n\t\t\t\tsubject.next({\n\t\t\t\t\t...currentRoute,\n\t\t\t\t\t// Ensure state and params are initialized if undefined\n\t\t\t\t\tstate: currentRoute.state || {},\n\t\t\t\t\tparams: currentRoute.params || {}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\t\n\t\tconst subject = this.areaSubjects.get(areaName)\n\t\tif (!subject) {\n\t\t\tthrow new Error(`Failed to create or retrieve subject for area: ${areaName}`)\n\t\t}\n\t\t\n\t\treturn subject\n\t}\n\n\t/**\n\t * Subscribe to a specific area\n\t * @param areaName Name of the area to subscribe to\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of the active route for the specified area\n\t */\n\ton(areaName: string, skipCurrent = false): Observable<ActiveRoute> {\n\t\tconst areaSubject = this.getOrCreateAreaSubject(areaName)\n\t\t\n\t\treturn skipCurrent ? areaSubject.pipe(skip(1)) : areaSubject.asObservable()\n\t}\n\t\n\t/**\n\t * Subscribe to all areas\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of all active routes\n\t */\n\tall(skipCurrent = false): Observable<Map<string, ActiveRoute>> {\n\t\treturn skipCurrent ? this.$current.pipe(skip(1)) : this.$current.asObservable()\n\t}\n\t\n\t/**\n\t * Get state from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's state\n\t */\n\tgetState<T = unknown>(areaName: string): Observable<T> {\n\t\treturn this.on(areaName).pipe(\n\t\t\tmap(route => route.state as unknown),\n\t\t\tfilter((state): state is NonNullable<unknown> => state !== undefined),\n\t\t\tmap(state => state as T)\n\t\t)\n\t}\n\t\n\t/**\n\t * Get params from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's params\n\t */\n\tparams<T extends Record<string, unknown> = Record<string, unknown>>(areaName: string): Observable<T> {\n\t\treturn this.on(areaName).pipe(\n\t\t\tmap(route => route.params as unknown),\n\t\t\tfilter((params): params is NonNullable<unknown> => params !== undefined),\n\t\t\tmap(params => params as T)\n\t\t)\n\t}\n\t\n\t/**\n\t * Get a specific param from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @param key Key of the param to select\n\t * @returns Observable of the param value\n\t */\n\tparam<T = unknown>(areaName: string, key: string): Observable<T> {\n\t\treturn this.params<Record<string, unknown>>(areaName).pipe(\n\t\t\tmap(params => params[key] as unknown),\n\t\t\tfilter((value): value is NonNullable<unknown> => value !== undefined),\n\t\t\tmap(value => value as T)\n\t\t)\n\t}\n\n\tfind() {\n\t\treturn zip([\n\t\t\tfromEvent<HERE_RICKY_EVENT>(window, HERE_RICKY).pipe(\n\t\t\t\tmap(e => e.detail),\n\t\t\t\tbufferTime(0),\n\t\t\t\ttap(console.log),\n\t\t\t),\n\t\t\tof(1).pipe(tap(() => window.dispatchEvent(this.findingMortiesEvent))),\n\t\t]).pipe(\n\t\t\tmap(([component]) => component),\n\t\t\ttimeout(1),\n\t\t)\n\t}\n\n\t/**\n\t * Push a new route action\n\t * @param r Route action to push\n\t */\n\tpush(r: RouteAction) {\n\t\t// Ensure state and params are initialized\n\t\tconst routeAction = {\n\t\t\t...r,\n\t\t\tstate: r.state || {},\n\t\t\tparams: r.params || {}\n\t\t}\n\t\t\n\t\tthis.request.next(routeAction)\n\t\t// Emit an area-specific event for those who want to listen directly to DOM events\n\t\tthis.dispatchAreaEvent(routeAction.area, routeAction)\n\t}\n\t\n\t/**\n\t * Dispatch a DOM event for a specific area change\n\t * @param areaName Name of the area that changed\n\t * @param routeAction The route action that was pushed\n\t */\n\tprivate dispatchAreaEvent(areaName: string, routeAction: RouteAction) {\n\t\tconst eventName = `schmancy-area-${areaName}-changed`\n\t\tconst event = new CustomEvent(eventName, { \n\t\t\tdetail: { \n\t\t\t\tarea: areaName,\n\t\t\t\tcomponent: routeAction.component,\n\t\t\t\tstate: routeAction.state,\n\t\t\t\tparams: routeAction.params,\n\t\t\t\thistoryStrategy: routeAction.historyStrategy\n\t\t\t},\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t})\n\t\twindow.dispatchEvent(event)\n\t}\n\n\tpop(name: string) {\n\t\tconst newState = JSON.parse(JSON.stringify(area.state))\n\t\tdelete newState[name]\n\t\tconsole.log(area.state, newState)\n\t\thistory.replaceState(null, '', encodeURIComponent(JSON.stringify(newState)))\n\t}\n\t\n\tstatic getInstance() {\n\t\tif (!AreaService.instance) {\n\t\t\tAreaService.instance = new AreaService()\n\t\t}\n\t\treturn AreaService.instance\n\t}\n\n\tget state() {\n\t\tconst pathname = location.pathname.split('/').pop()\n\t\tlet areaState = {}\n\t\ttry {\n\t\t\tareaState = pathname ? JSON.parse(decodeURIComponent(pathname)) : {}\n\t\t} catch {\n\t\t\tareaState = {}\n\t\t}\n\t\treturn areaState\n\t}\n}\n\nexport const area = AreaService.getInstance()\nexport default area\n","export type RouteAction = {\n\tcomponent: CustomElementConstructor | string | HTMLElement\n\tarea: string\n\tstate?: Record<string, unknown>\n\tparams?: Record<string, unknown>\n\thistoryStrategy?: THistoryStrategy\n\tclearQueryParams?: string[] | null\n}\n\nexport type ActiveRoute = {\n\tcomponent: string\n\tarea: string\n\tstate?: Record<string, unknown>\n\tparams?: Record<string, unknown>\n}\n\n/**\n * Interface for subscribing to area changes\n */\nexport interface AreaSubscription {\n\t/**\n\t * Subscribe to a specific area\n\t * @param areaName Name of the area to subscribe to\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of the active route for the specified area\n\t */\n\ton(areaName: string, skipCurrent?: boolean): import('rxjs').Observable<ActiveRoute>\n\t\n\t/**\n\t * Subscribe to all areas\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of all active routes\n\t */\n\tall(skipCurrent?: boolean): import('rxjs').Observable<Map<string, ActiveRoute>>\n\t\n\t/**\n\t * Get state from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's state\n\t */\n\tgetState<T = unknown>(areaName: string): import('rxjs').Observable<T>\n\t\n\t/**\n\t * Get params from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's params\n\t */\n\tparams<T extends Record<string, unknown> = Record<string, unknown>>(areaName: string): import('rxjs').Observable<T>\n\t\n\t/**\n\t * Get a specific param from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @param key Key of the param to select\n\t * @returns Observable of the param value\n\t */\n\tparam<T = unknown>(areaName: string, key: string): import('rxjs').Observable<T>\n}\n\nexport type THistoryStrategy = 'push' | 'replace' | 'pop' | 'silent'\n\nexport enum HISTORY_STRATEGY {\n\tpush = 'push',\n\treplace = 'replace',\n\tpop = 'pop',\n\tsilent = 'silent',\n}\n","import { $LitElement } from '@mixins/index'\nimport { TemplateResult, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport {\n\tEMPTY,\n\tbufferTime,\n\tcatchError,\n\tdistinctUntilChanged,\n\tfilter,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tof,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimeout,\n} from 'rxjs'\nimport { isPresent } from 'ts-is-present'\nimport area from './area.service'\nimport { HISTORY_STRATEGY, RouteAction } from './router.types'\n\ntype TRouteArea = {\n\tcomponent: string\n\tstate: object | undefined\n}\n\n@customElement('schmancy-area')\nexport class SchmancyArea extends $LitElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: block;\n\t\tinset: 0;\n\t}\n`) {\n\t/**\n\t * The name of the router outlet\n\t * @attr\n\t * @type {string}\n\t * @public\n\t * @required\n\t */\n\t@property() name!: string\n\n\t@property() default!: string | Promise<NodeModule> | CustomElementConstructor | TemplateResult<1>\n\n\t/**\n\t *\n\t * @param pathname pathname from the browser location API\n\t * @param historyStrategy the history strategy to use for the route like PUSH, REPLACE, or SILENT\n\t * @returns rxjs pipes that will return the component to render and the history strategy to use\n\t */\n\tgetComponentFromPathname(pathname: string, historyStrategy: HISTORY_STRATEGY) {\n\t\treturn of(pathname).pipe(\n\t\t\tmap(path => path.split('/').pop() ?? ''),\n\t\t\tmap(path => decodeURIComponent(path)),\n\t\t\tmap(path => JSON.parse(path)),\n\t\t\tmap(routes => routes[this.name] as TRouteArea),\n\t\t\tmap(component =>\n\t\t\t\t!component && this.default\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcomponent: this.default,\n\t\t\t\t\t\t\tstate: undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t: component,\n\t\t\t),\n\t\t\tfilter(x => isPresent(x)),\n\t\t\tmap((component: TRouteArea) => ({\n\t\t\t\tarea: this.name,\n\t\t\t\tcomponent: component.component ?? this.default,\n\t\t\t\tstate: component.state,\n\t\t\t\thistoryStrategy,\n\t\t\t})),\n\t\t\tmap(x => x as RouteAction),\n\t\t\tcatchError(() => {\n\t\t\t\treturn this.default\n\t\t\t\t\t? of({\n\t\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t\t\tcomponent: this.default,\n\t\t\t\t\t\t\thistoryStrategy,\n\t\t\t\t\t\t} as RouteAction)\n\t\t\t\t\t: EMPTY\n\t\t\t}),\n\t\t)\n\t}\n\n\tprotected firstUpdated(): void {\n\t\tif (!this.name) {\n\t\t\t// TOOD: maybe enforce this to be unique\n\t\t\tthrow new Error('Area name or default component not set')\n\t\t}\n\n\t\t// active outlet changes\n\t\tmerge(\n\t\t\t// 1) initial load from location.pathname\n\t\t\tof(location.pathname).pipe(\n\t\t\t\tswitchMap(pathname => this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)),\n\t\t\t\tmap(route => route as RouteAction),\n\t\t\t\ttake(1),\n\t\t\t),\n\t\t\t// 2) requests to change the route for this area\n\t\t\tarea.request.pipe(filter(({ area }) => area === this.name)),\n\t\t\t// 3) popstate events (back, forward)\n\t\t\tfromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\t\tmap(e => (e.target as Window).location.pathname),\n\t\t\t\tswitchMap(pathname => this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)),\n\t\t\t\tmap(route => route as RouteAction),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(\n\t\t\t\tfilter(request => !!request.component),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\tdistinctUntilChanged((a, b) => {\n\t\t\t\t\tlet aComponent, bComponent\n\t\t\t\t\tif (typeof a.component === 'function') return false\n\t\t\t\t\telse if (typeof a.component === 'string') aComponent = a.component\n\n\t\t\t\t\tif (typeof b.component === 'function') return false\n\t\t\t\t\telse if (typeof b.component === 'string') bComponent = b.component\n\n\t\t\t\t\treturn bComponent?.replaceAll('-', '').toLowerCase() === aComponent?.replaceAll('-', '').toLowerCase()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(route => {\n\t\t\t\t\tconst c = route.component\n\t\t\t\t\tif (c instanceof Promise) {\n\t\t\t\t\t\t// Dynamic import module\n\t\t\t\t\t\treturn from(c).pipe(map(x => ({ component: x.exports.default as CustomElementConstructor, route })))\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Already a string, function, or element\n\t\t\t\t\t\treturn of({ component: c, route })\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ component, route }) => {\n\t\t\t\t\tif (typeof component === 'string') {\n\t\t\t\t\t\t// Tag name\n\t\t\t\t\t\treturn { component: document.createElement(component), route }\n\t\t\t\t\t} else if (component instanceof HTMLElement) {\n\t\t\t\t\t\t// Already an element instance\n\t\t\t\t\t\treturn { component, route }\n\t\t\t\t\t} else if (typeof component === 'function') {\n\t\t\t\t\t\t// Custom element constructor\n\t\t\t\t\t\treturn { component: new component(), route }\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tdistinctUntilChanged((prev, curr) => prev.component.tagName === curr.component.tagName),\n\t\t\t\t// create the new view and add it to the DOM\n\t\t\t\tmap(({ component, route }) => {\n\t\t\t\t\tconst oldView = this.shadowRoot?.children[0]\n\t\t\t\t\tconst oldViewExists = !!oldView\n\n\t\t\t\t\t// Remove the old view (if any)\n\t\t\t\t\toldView.remove()\n\t\t\t\t\t// Native Web Animations API - fade in\n\t\t\t\t\t// \"ease: cubic-bezier(0.25, 0.8, 0.25, 1)\" was used in the old code\n\t\t\t\t\tcomponent.classList.add('opacity-0')\n\t\t\t\t\tthis.shadowRoot?.append(component)\n\t\t\t\t\tcomponent.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\t\t\t\tduration: oldViewExists ? 150 : 100,\n\t\t\t\t\t\teasing: 'cubic-bezier(0.25, 0.8, 0.25, 1)',\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t})\n\n\t\t\t\t\t// Insert the new view\n\n\t\t\t\t\treturn { component, route }\n\t\t\t\t}),\n\t\t\t\ttap(({ component, route }) => {\n\t\t\t\t\t// Handle history updates\n\t\t\t\t\tif (typeof route.historyStrategy === 'undefined' || route.historyStrategy === 'push') {\n\t\t\t\t\t\thistory.pushState(route.state, '', this.newPath(component.tagName, route))\n\t\t\t\t\t} else if (route.historyStrategy && ['replace', 'pop'].includes(route.historyStrategy)) {\n\t\t\t\t\t\thistory.replaceState(route.state, '', this.newPath(component.tagName, route))\n\t\t\t\t\t}\n\t\t\t\t\tarea.current.set(this.name, {\n\t\t\t\t\t\tcomponent: component.tagName,\n\t\t\t\t\t\tstate: route.state || {},\n\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t\tparams: route.params || {},\n\t\t\t\t\t})\n\n\t\t\t\t\tarea.$current.next(area.current)\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tnewPath(tag: string, route: RouteAction) {\n\t\tconst oldPathname = location.pathname.split('/').pop()\n\t\tlet oldAreaState = {}\n\t\ttry {\n\t\t\toldAreaState = oldPathname ? JSON.parse(decodeURIComponent(oldPathname)) : {}\n\t\t} catch {\n\t\t\toldAreaState = {}\n\t\t}\n\t\troute.state = route.state ?? {}\n\t\tconst queryParams = route.clearQueryParams ? this.queryParamClear(route.clearQueryParams) : document.location.search\n\n\t\treturn encodeURIComponent(\n\t\t\tJSON.stringify({\n\t\t\t\t...oldAreaState,\n\t\t\t\t[this.name]: { component: tag.toLowerCase(), state: route.state, params: route.params },\n\t\t\t}),\n\t\t).concat(`${queryParams}`)\n\t}\n\n\tqueryParamClear(params?: string[]) {\n\t\tif (!params) {\n\t\t\treturn ''\n\t\t}\n\t\t// get query params from url\n\t\tconst urlParams = new URLSearchParams(location.search)\n\t\t// remove query params\n\t\tparams.forEach(param => urlParams.delete(param))\n\t\t// update url\n\t\tif (urlParams.toString() === '') return ''\n\t\treturn `?${urlParams.toString()}`\n\t}\n\n\tcheckForTeleportationRequests() {\n\t\treturn fromEvent<CustomEvent>(window, 'FLIP_REQUEST').pipe(\n\t\t\tmap(e => e.detail),\n\t\t\tbufferTime(0),\n\t\t\ttap(() => {\n\t\t\t\tthis.dispatchEvent(new CustomEvent('FLIP_STARTED'))\n\t\t\t}),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t\ttimeout(0),\n\t\t\tcatchError(() => of(null)),\n\t\t)\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\trender() {\n\t\treturn html` <slot> </slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-area': SchmancyArea\n\t}\n}"],"names":["routerHistory","Subject","FINDING_MORTIES","HERE_RICKY","AreaService","constructor","this","prettyURL","mode","request","ReplaySubject","current","Map","$current","areaSubjects","enableHistoryMode","findingMortiesEvent","CustomEvent","next","subscribe","currentAreas","forEach","route","areaName","getOrCreateAreaSubject","has","subject","set","currentRoute","get","state","params","Error","skipCurrent","areaSubject","pipe","skip","asObservable","on","map","filter","key","value","zip","fromEvent","window","e","detail","bufferTime","tap","console","log","of","dispatchEvent","component","timeout","r","routeAction","dispatchAreaEvent","area","event","historyStrategy","bubbles","composed","name","newState","JSON","parse","stringify","history","replaceState","encodeURIComponent","instance","pathname","location","split","pop","areaState","decodeURIComponent","getInstance","HISTORY_STRATEGY","SchmancyArea","$LitElement","css","path","routes","default","x","isPresent","catchError","EMPTY","firstUpdated","merge","switchMap","getComponentFromPathname","silent","take","target","takeUntil","disconnecting","distinctUntilChanged","a","b","aComponent","bComponent","replaceAll","toLowerCase","c","Promise","from","exports","t","document","createElement","HTMLElement","prev","curr","tagName","oldView","shadowRoot","children","oldViewExists","remove","classList","add","append","animate","opacity","duration","easing","fill","pushState","newPath","includes","tag","oldPathname","oldAreaState","queryParams","clearQueryParams","queryParamClear","search","concat","urlParams","URLSearchParams","param","delete","toString","checkForTeleportationRequests","disconnectedCallback","super","render","html","__decorateClass","property","prototype","customElement"],"mappings":";;;;;;;;AAIa,MAAAA,IAAgB,IAAIC,KAEpBC,IAAkB,mBAClBC,IAAa;AAQ1B,MAAMC,EAAAA;AAAAA,EAcL,cAAAC;AAZAC,SAAOC,YAAAA,IACPD,KAAOE,OAA6B,WAC7BF,KAAAG,UAAU,IAAIC,EAA2B,CACzCJ,GAAAA,KAAAK,8BAAcC,OACdN,KAAAO,WAAW,IAAIH,EAAwC,CAGtDJ,GAAAA,KAAAQ,mCAAmBF,OAE3BN,KAAOS,oBAAoB,IACnBT,KAAAU,sBAAsB,IAAIC,YAA6Cf,CAGzEI,GAAAA,KAAAO,SAASK,KAAKZ,KAAKK,OAAAA,GAGnBL,KAAAO,SAASM,UAA0BC,OAAAA;AAE1BA,QAAAC,QAAQ,CAACC,GAAOC,MAERjB;AAAAA,aAAKkB,uBAAuBD,CAEpCL,EAAAA,KAAKI,CAAK;AAAA,MAAA,CAAA;AAAA,IACtB,CACD;AAAA,EAAA;AAAA,EAQM,uBAAuBC,GAC9B;AAAA,Q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,YAAe5E,GAAAA,OAAOR,EAAMQ,OAAOC,QAAQT,EAAMS,OAE/E8G,EAAAA,CAAAA,CAAAA,EAAAA,OAAO,GAAGJ,CAAa,EAAA;AAAA,EAAA;AAAA,EAG1B,gBAAgB1G,GACf;AAAA,QAAA,CAAKA,EACG,QAAA;AAGR,UAAM+G,IAAY,IAAIC,gBAAgBrE,SAASkE,MAI/C;AAAA,WAFA7G,EAAOV,QAAQ2H,CAAAA,MAASF,EAAUG,OAAOD,CAAAA,CAAAA,GAErCF,EAAUI,SAA0B,MAAX,KAAW,KACjC,IAAIJ,EAAUI,SAAU,CAAA;AAAA,EAAA;AAAA,EAGhC,gCAAAC;AACQ,WAAAvG,EAAuBC,QAAQ,cAAgBV,EAAAA,KACrDI,EAASO,CAAAA,MAAAA,EAAEC,MAAAA,GACXC,EAAW,CAAA,GACXC,EAAI,MAAA;AACH3C,WAAK+C,cAAc,IAAIpC,YAAY,cAAe,CAAA;AAAA,IAAA,CAAA,GAEnDiF,EAAU5F,KAAK6F,aACf5C,GAAAA,EAAQ,CACRkC,GAAAA,EAAW,MAAMrC,EAAG,IACrB,CAAA,CAAA;AAAA,EAAA;AAAA,EAGD,uBAAAgG;AACCC,UAAMD,qBAAAA,GACD9I,KAAA6F,cAAcjF,KAAAA,EAAS;AAAA,EAAA;AAAA,EAG7B,SAAAoI;AACQ,WAAAC;AAAAA,EAAA;AAAA;AAtMIC,EAAA,CAAXC,EAdWxE,CAAAA,GAAAA,EAcAyE,WAAA,QAAA,IAEAF,EAAA,CAAXC,EAhBWxE,CAAAA,GAAAA,EAgBAyE,WAAA,WAAA,CAhBAzE,GAAAA,IAANuE,EAAA,CADNG,EAAc,eAAA,CAAA,GACF1E;"}
@@ -0,0 +1,8 @@
1
+ "use strict";const a=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const y=require("./litElement.mixin-CHvyxfxf.cjs");require("./tailwind.mixin-Dm5QDZav.cjs");const l=require("lit"),h=require("lit/decorators.js"),g=require("./index-DyJ0oDpR.cjs"),S=new a.Subject,d="FINDING_MORTIES",f="HERE_RICKY";class p{constructor(){this.prettyURL=!1,this.mode="HISTORY",this.request=new a.ReplaySubject(1),this.current=new Map,this.$current=new a.ReplaySubject(1),this.areaSubjects=new Map,this.enableHistoryMode=!0,this.findingMortiesEvent=new CustomEvent(d),this.$current.next(this.current),this.$current.subscribe(t=>{t.forEach((e,r)=>{this.getOrCreateAreaSubject(r).next(e)})})}getOrCreateAreaSubject(t){if(!this.areaSubjects.has(t)){const r=new a.ReplaySubject(1);this.areaSubjects.set(t,r);const o=this.current.get(t);o&&r.next({...o,state:o.state||{},params:o.params||{}})}const e=this.areaSubjects.get(t);if(!e)throw new Error(`Failed to create or retrieve subject for area: ${t}`);return e}on(t,e=!1){const r=this.getOrCreateAreaSubject(t);return e?r.pipe(a.skip(1)):r.asObservable()}all(t=!1){return t?this.$current.pipe(a.skip(1)):this.$current.asObservable()}getState(t){return this.on(t).pipe(a.map(e=>e.state),a.filter(e=>e!==void 0),a.map(e=>e))}params(t){return this.on(t).pipe(a.map(e=>e.params),a.filter(e=>e!==void 0),a.map(e=>e))}param(t,e){return this.params(t).pipe(a.map(r=>r[e]),a.filter(r=>r!==void 0),a.map(r=>r))}find(){return a.zip([a.fromEvent(window,f).pipe(a.map(t=>t.detail),a.bufferTime(0),a.tap(console.log)),a.of(1).pipe(a.tap(()=>window.dispatchEvent(this.findingMortiesEvent)))]).pipe(a.map(([t])=>t),a.timeout(1))}push(t){const e={...t,state:t.state||{},params:t.params||{}};this.request.next(e),this.dispatchAreaEvent(e.area,e)}dispatchAreaEvent(t,e){const r=new CustomEvent(`schmancy-area-${t}-changed`,{detail:{area:t,component:e.component,state:e.state,params:e.params,historyStrategy:e.historyStrategy},bubbles:!0,composed:!0});window.dispatchEvent(r)}pop(t){const e=JSON.parse(JSON.stringify(i.state));delete e[t],history.replaceState(null,"",encodeURIComponent(JSON.stringify(e)))}static getInstance(){return p.instance||(p.instance=new p),p.instance}get state(){const t=location.pathname.split("/").pop();let e={};try{e=t?JSON.parse(decodeURIComponent(t)):{}}catch{e={}}return e}}const i=p.getInstance();var c=(n=>(n.push="push",n.replace="replace",n.pop="pop",n.silent="silent",n))(c||{}),w=Object.defineProperty,E=Object.getOwnPropertyDescriptor,u=(n,t,e,r)=>{for(var o,s=r>1?void 0:r?E(t,e):t,m=n.length-1;m>=0;m--)(o=n[m])&&(s=(r?o(t,e,s):o(s))||s);return r&&s&&w(t,e,s),s};exports.SchmancyArea=class extends y.$LitElement(l.css`
2
+ :host {
3
+ position: relative;
4
+ display: block;
5
+ inset: 0;
6
+ }
7
+ `){getComponentFromPathname(n,t){return a.of(n).pipe(a.map(e=>e.split("/").pop()??""),a.map(e=>decodeURIComponent(e)),a.map(e=>JSON.parse(e)),a.map(e=>e[this.name]),a.map(e=>!e&&this.default?{component:this.default,state:void 0}:e),a.filter(e=>g.libExports.isPresent(e)),a.map(e=>({area:this.name,component:e.component??this.default,state:e.state,historyStrategy:t})),a.map(e=>e),a.catchError(()=>this.default?a.of({area:this.name,component:this.default,historyStrategy:t}):a.EMPTY))}firstUpdated(){if(!this.name)throw new Error("Area name or default component not set");a.merge(a.of(location.pathname).pipe(a.switchMap(n=>this.getComponentFromPathname(n,c.silent)),a.map(n=>n),a.take(1)),i.request.pipe(a.filter(({area:n})=>n===this.name)),a.fromEvent(window,"popstate").pipe(a.map(n=>n.target.location.pathname),a.switchMap(n=>this.getComponentFromPathname(n,c.silent)),a.map(n=>n))).pipe(a.filter(n=>!!n.component),a.takeUntil(this.disconnecting),a.distinctUntilChanged((n,t)=>{let e,r;return typeof n.component!="function"&&(typeof n.component=="string"&&(e=n.component),typeof t.component!="function"&&(typeof t.component=="string"&&(r=t.component),(r==null?void 0:r.replaceAll("-","").toLowerCase())===(e==null?void 0:e.replaceAll("-","").toLowerCase())))})).pipe(a.switchMap(n=>{const t=n.component;return t instanceof Promise?a.from(t).pipe(a.map(e=>({component:e.exports.default,route:n}))):a.of({component:t,route:n})}),a.map(({component:n,route:t})=>typeof n=="string"?{component:document.createElement(n),route:t}:n instanceof HTMLElement?{component:n,route:t}:typeof n=="function"?{component:new n,route:t}:void 0),a.distinctUntilChanged((n,t)=>n.component.tagName===t.component.tagName),a.map(({component:n,route:t})=>{var o,s;const e=(o=this.shadowRoot)==null?void 0:o.children[0],r=!!e;return e.remove(),n.classList.add("opacity-0"),(s=this.shadowRoot)==null||s.append(n),n.animate([{opacity:0},{opacity:1}],{duration:r?150:100,easing:"cubic-bezier(0.25, 0.8, 0.25, 1)",fill:"forwards"}),{component:n,route:t}}),a.tap(({component:n,route:t})=>{t.historyStrategy===void 0||t.historyStrategy==="push"?history.pushState(t.state,"",this.newPath(n.tagName,t)):t.historyStrategy&&["replace","pop"].includes(t.historyStrategy)&&history.replaceState(t.state,"",this.newPath(n.tagName,t)),i.current.set(this.name,{component:n.tagName,state:t.state||{},area:this.name,params:t.params||{}}),i.$current.next(i.current)}),a.takeUntil(this.disconnecting)).subscribe()}newPath(n,t){const e=location.pathname.split("/").pop();let r={};try{r=e?JSON.parse(decodeURIComponent(e)):{}}catch{r={}}t.state=t.state??{};const o=t.clearQueryParams?this.queryParamClear(t.clearQueryParams):document.location.search;return encodeURIComponent(JSON.stringify({...r,[this.name]:{component:n.toLowerCase(),state:t.state,params:t.params}})).concat(`${o}`)}queryParamClear(n){if(!n)return"";const t=new URLSearchParams(location.search);return n.forEach(e=>t.delete(e)),t.toString()===""?"":`?${t.toString()}`}checkForTeleportationRequests(){return a.fromEvent(window,"FLIP_REQUEST").pipe(a.map(n=>n.detail),a.bufferTime(0),a.tap(()=>{this.dispatchEvent(new CustomEvent("FLIP_STARTED"))}),a.takeUntil(this.disconnecting),a.timeout(0),a.catchError(()=>a.of(null)))}disconnectedCallback(){super.disconnectedCallback(),this.disconnecting.next(!0)}render(){return l.html` <slot> </slot> `}},u([h.property()],exports.SchmancyArea.prototype,"name",2),u([h.property()],exports.SchmancyArea.prototype,"default",2),exports.SchmancyArea=u([h.customElement("schmancy-area")],exports.SchmancyArea),exports.FINDING_MORTIES=d,exports.HERE_RICKY=f,exports.HISTORY_STRATEGY=c,exports.area=i,exports.routerHistory=S;
8
+ //# sourceMappingURL=area.component-WxccFh1z.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"area.component-WxccFh1z.cjs","sources":["../src/area/area.service.ts","../src/area/router.types.ts","../src/area/area.component.ts"],"sourcesContent":["import { Observable, ReplaySubject, Subject, bufferTime, filter, fromEvent, map, of, skip, tap, timeout, zip } from 'rxjs'\nimport { SchmancyTeleportation } from '../teleport'\nimport { ActiveRoute, AreaSubscription, RouteAction } from './router.types'\n\nexport const routerHistory = new Subject<RouteAction>()\n\nexport const FINDING_MORTIES = 'FINDING_MORTIES'\nexport const HERE_RICKY = 'HERE_RICKY'\nexport type HERE_RICKY_EVENT = CustomEvent<{\n\tcomponent: SchmancyTeleportation\n}>\nexport type FINDING_MORTIES_EVENT = CustomEvent<{\n\tcomponent: SchmancyTeleportation\n}>\n\nclass AreaService implements AreaSubscription {\n\tprivate static instance: AreaService\n\tpublic prettyURL = false\n\tpublic mode: 'SILENT' | 'HISTORY' = 'HISTORY'\n\tpublic request = new ReplaySubject<RouteAction>(1)\n\tpublic current = new Map<string, ActiveRoute>()\n\tpublic $current = new ReplaySubject<Map<string, ActiveRoute>>(1)\n\t\n\t// Create a dictionary of ReplaySubjects for area-specific subscriptions\n\tprivate areaSubjects = new Map<string, ReplaySubject<ActiveRoute>>()\n\t\n\tpublic enableHistoryMode = true\n\tprivate findingMortiesEvent = new CustomEvent<FINDING_MORTIES_EVENT['detail']>(FINDING_MORTIES)\n\n\tconstructor() {\n\t\tthis.$current.next(this.current)\n\t\t\n\t\t// Subscribe to current changes to update area-specific subjects\n\t\tthis.$current.subscribe(currentAreas => {\n\t\t\t// For each area in the current map\n\t\t\tcurrentAreas.forEach((route, areaName) => {\n\t\t\t\t// Get or create a subject for this area\n\t\t\t\tconst areaSubject = this.getOrCreateAreaSubject(areaName)\n\t\t\t\t// Emit the updated route to area-specific subscribers\n\t\t\t\tareaSubject.next(route)\n\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Get or create a ReplaySubject for a specific area\n\t * @param areaName The name of the area\n\t * @returns ReplaySubject for the specified area\n\t */\n\tprivate getOrCreateAreaSubject(areaName: string): ReplaySubject<ActiveRoute> {\n\t\tif (!this.areaSubjects.has(areaName)) {\n\t\t\tconst subject = new ReplaySubject<ActiveRoute>(1)\n\t\t\tthis.areaSubjects.set(areaName, subject)\n\t\t\t\n\t\t\t// If the area already exists in current, emit it immediately\n\t\t\tconst currentRoute = this.current.get(areaName)\n\t\t\tif (currentRoute) {\n\t\t\t\tsubject.next({\n\t\t\t\t\t...currentRoute,\n\t\t\t\t\t// Ensure state and params are initialized if undefined\n\t\t\t\t\tstate: currentRoute.state || {},\n\t\t\t\t\tparams: currentRoute.params || {}\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\t\n\t\tconst subject = this.areaSubjects.get(areaName)\n\t\tif (!subject) {\n\t\t\tthrow new Error(`Failed to create or retrieve subject for area: ${areaName}`)\n\t\t}\n\t\t\n\t\treturn subject\n\t}\n\n\t/**\n\t * Subscribe to a specific area\n\t * @param areaName Name of the area to subscribe to\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of the active route for the specified area\n\t */\n\ton(areaName: string, skipCurrent = false): Observable<ActiveRoute> {\n\t\tconst areaSubject = this.getOrCreateAreaSubject(areaName)\n\t\t\n\t\treturn skipCurrent ? areaSubject.pipe(skip(1)) : areaSubject.asObservable()\n\t}\n\t\n\t/**\n\t * Subscribe to all areas\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of all active routes\n\t */\n\tall(skipCurrent = false): Observable<Map<string, ActiveRoute>> {\n\t\treturn skipCurrent ? this.$current.pipe(skip(1)) : this.$current.asObservable()\n\t}\n\t\n\t/**\n\t * Get state from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's state\n\t */\n\tgetState<T = unknown>(areaName: string): Observable<T> {\n\t\treturn this.on(areaName).pipe(\n\t\t\tmap(route => route.state as unknown),\n\t\t\tfilter((state): state is NonNullable<unknown> => state !== undefined),\n\t\t\tmap(state => state as T)\n\t\t)\n\t}\n\t\n\t/**\n\t * Get params from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's params\n\t */\n\tparams<T extends Record<string, unknown> = Record<string, unknown>>(areaName: string): Observable<T> {\n\t\treturn this.on(areaName).pipe(\n\t\t\tmap(route => route.params as unknown),\n\t\t\tfilter((params): params is NonNullable<unknown> => params !== undefined),\n\t\t\tmap(params => params as T)\n\t\t)\n\t}\n\t\n\t/**\n\t * Get a specific param from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @param key Key of the param to select\n\t * @returns Observable of the param value\n\t */\n\tparam<T = unknown>(areaName: string, key: string): Observable<T> {\n\t\treturn this.params<Record<string, unknown>>(areaName).pipe(\n\t\t\tmap(params => params[key] as unknown),\n\t\t\tfilter((value): value is NonNullable<unknown> => value !== undefined),\n\t\t\tmap(value => value as T)\n\t\t)\n\t}\n\n\tfind() {\n\t\treturn zip([\n\t\t\tfromEvent<HERE_RICKY_EVENT>(window, HERE_RICKY).pipe(\n\t\t\t\tmap(e => e.detail),\n\t\t\t\tbufferTime(0),\n\t\t\t\ttap(console.log),\n\t\t\t),\n\t\t\tof(1).pipe(tap(() => window.dispatchEvent(this.findingMortiesEvent))),\n\t\t]).pipe(\n\t\t\tmap(([component]) => component),\n\t\t\ttimeout(1),\n\t\t)\n\t}\n\n\t/**\n\t * Push a new route action\n\t * @param r Route action to push\n\t */\n\tpush(r: RouteAction) {\n\t\t// Ensure state and params are initialized\n\t\tconst routeAction = {\n\t\t\t...r,\n\t\t\tstate: r.state || {},\n\t\t\tparams: r.params || {}\n\t\t}\n\t\t\n\t\tthis.request.next(routeAction)\n\t\t// Emit an area-specific event for those who want to listen directly to DOM events\n\t\tthis.dispatchAreaEvent(routeAction.area, routeAction)\n\t}\n\t\n\t/**\n\t * Dispatch a DOM event for a specific area change\n\t * @param areaName Name of the area that changed\n\t * @param routeAction The route action that was pushed\n\t */\n\tprivate dispatchAreaEvent(areaName: string, routeAction: RouteAction) {\n\t\tconst eventName = `schmancy-area-${areaName}-changed`\n\t\tconst event = new CustomEvent(eventName, { \n\t\t\tdetail: { \n\t\t\t\tarea: areaName,\n\t\t\t\tcomponent: routeAction.component,\n\t\t\t\tstate: routeAction.state,\n\t\t\t\tparams: routeAction.params,\n\t\t\t\thistoryStrategy: routeAction.historyStrategy\n\t\t\t},\n\t\t\tbubbles: true,\n\t\t\tcomposed: true\n\t\t})\n\t\twindow.dispatchEvent(event)\n\t}\n\n\tpop(name: string) {\n\t\tconst newState = JSON.parse(JSON.stringify(area.state))\n\t\tdelete newState[name]\n\t\tconsole.log(area.state, newState)\n\t\thistory.replaceState(null, '', encodeURIComponent(JSON.stringify(newState)))\n\t}\n\t\n\tstatic getInstance() {\n\t\tif (!AreaService.instance) {\n\t\t\tAreaService.instance = new AreaService()\n\t\t}\n\t\treturn AreaService.instance\n\t}\n\n\tget state() {\n\t\tconst pathname = location.pathname.split('/').pop()\n\t\tlet areaState = {}\n\t\ttry {\n\t\t\tareaState = pathname ? JSON.parse(decodeURIComponent(pathname)) : {}\n\t\t} catch {\n\t\t\tareaState = {}\n\t\t}\n\t\treturn areaState\n\t}\n}\n\nexport const area = AreaService.getInstance()\nexport default area\n","export type RouteAction = {\n\tcomponent: CustomElementConstructor | string | HTMLElement\n\tarea: string\n\tstate?: Record<string, unknown>\n\tparams?: Record<string, unknown>\n\thistoryStrategy?: THistoryStrategy\n\tclearQueryParams?: string[] | null\n}\n\nexport type ActiveRoute = {\n\tcomponent: string\n\tarea: string\n\tstate?: Record<string, unknown>\n\tparams?: Record<string, unknown>\n}\n\n/**\n * Interface for subscribing to area changes\n */\nexport interface AreaSubscription {\n\t/**\n\t * Subscribe to a specific area\n\t * @param areaName Name of the area to subscribe to\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of the active route for the specified area\n\t */\n\ton(areaName: string, skipCurrent?: boolean): import('rxjs').Observable<ActiveRoute>\n\t\n\t/**\n\t * Subscribe to all areas\n\t * @param skipCurrent Whether to skip the current value\n\t * @returns Observable of all active routes\n\t */\n\tall(skipCurrent?: boolean): import('rxjs').Observable<Map<string, ActiveRoute>>\n\t\n\t/**\n\t * Get state from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's state\n\t */\n\tgetState<T = unknown>(areaName: string): import('rxjs').Observable<T>\n\t\n\t/**\n\t * Get params from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @returns Observable of the area's params\n\t */\n\tparams<T extends Record<string, unknown> = Record<string, unknown>>(areaName: string): import('rxjs').Observable<T>\n\t\n\t/**\n\t * Get a specific param from an area\n\t * @param areaName Name of the area to subscribe to\n\t * @param key Key of the param to select\n\t * @returns Observable of the param value\n\t */\n\tparam<T = unknown>(areaName: string, key: string): import('rxjs').Observable<T>\n}\n\nexport type THistoryStrategy = 'push' | 'replace' | 'pop' | 'silent'\n\nexport enum HISTORY_STRATEGY {\n\tpush = 'push',\n\treplace = 'replace',\n\tpop = 'pop',\n\tsilent = 'silent',\n}\n","import { $LitElement } from '@mixins/index'\nimport { TemplateResult, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport {\n\tEMPTY,\n\tbufferTime,\n\tcatchError,\n\tdistinctUntilChanged,\n\tfilter,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tof,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimeout,\n} from 'rxjs'\nimport { isPresent } from 'ts-is-present'\nimport area from './area.service'\nimport { HISTORY_STRATEGY, RouteAction } from './router.types'\n\ntype TRouteArea = {\n\tcomponent: string\n\tstate: object | undefined\n}\n\n@customElement('schmancy-area')\nexport class SchmancyArea extends $LitElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: block;\n\t\tinset: 0;\n\t}\n`) {\n\t/**\n\t * The name of the router outlet\n\t * @attr\n\t * @type {string}\n\t * @public\n\t * @required\n\t */\n\t@property() name!: string\n\n\t@property() default!: string | Promise<NodeModule> | CustomElementConstructor | TemplateResult<1>\n\n\t/**\n\t *\n\t * @param pathname pathname from the browser location API\n\t * @param historyStrategy the history strategy to use for the route like PUSH, REPLACE, or SILENT\n\t * @returns rxjs pipes that will return the component to render and the history strategy to use\n\t */\n\tgetComponentFromPathname(pathname: string, historyStrategy: HISTORY_STRATEGY) {\n\t\treturn of(pathname).pipe(\n\t\t\tmap(path => path.split('/').pop() ?? ''),\n\t\t\tmap(path => decodeURIComponent(path)),\n\t\t\tmap(path => JSON.parse(path)),\n\t\t\tmap(routes => routes[this.name] as TRouteArea),\n\t\t\tmap(component =>\n\t\t\t\t!component && this.default\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcomponent: this.default,\n\t\t\t\t\t\t\tstate: undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t: component,\n\t\t\t),\n\t\t\tfilter(x => isPresent(x)),\n\t\t\tmap((component: TRouteArea) => ({\n\t\t\t\tarea: this.name,\n\t\t\t\tcomponent: component.component ?? this.default,\n\t\t\t\tstate: component.state,\n\t\t\t\thistoryStrategy,\n\t\t\t})),\n\t\t\tmap(x => x as RouteAction),\n\t\t\tcatchError(() => {\n\t\t\t\treturn this.default\n\t\t\t\t\t? of({\n\t\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t\t\tcomponent: this.default,\n\t\t\t\t\t\t\thistoryStrategy,\n\t\t\t\t\t\t} as RouteAction)\n\t\t\t\t\t: EMPTY\n\t\t\t}),\n\t\t)\n\t}\n\n\tprotected firstUpdated(): void {\n\t\tif (!this.name) {\n\t\t\t// TOOD: maybe enforce this to be unique\n\t\t\tthrow new Error('Area name or default component not set')\n\t\t}\n\n\t\t// active outlet changes\n\t\tmerge(\n\t\t\t// 1) initial load from location.pathname\n\t\t\tof(location.pathname).pipe(\n\t\t\t\tswitchMap(pathname => this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)),\n\t\t\t\tmap(route => route as RouteAction),\n\t\t\t\ttake(1),\n\t\t\t),\n\t\t\t// 2) requests to change the route for this area\n\t\t\tarea.request.pipe(filter(({ area }) => area === this.name)),\n\t\t\t// 3) popstate events (back, forward)\n\t\t\tfromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\t\tmap(e => (e.target as Window).location.pathname),\n\t\t\t\tswitchMap(pathname => this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)),\n\t\t\t\tmap(route => route as RouteAction),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(\n\t\t\t\tfilter(request => !!request.component),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\tdistinctUntilChanged((a, b) => {\n\t\t\t\t\tlet aComponent, bComponent\n\t\t\t\t\tif (typeof a.component === 'function') return false\n\t\t\t\t\telse if (typeof a.component === 'string') aComponent = a.component\n\n\t\t\t\t\tif (typeof b.component === 'function') return false\n\t\t\t\t\telse if (typeof b.component === 'string') bComponent = b.component\n\n\t\t\t\t\treturn bComponent?.replaceAll('-', '').toLowerCase() === aComponent?.replaceAll('-', '').toLowerCase()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(route => {\n\t\t\t\t\tconst c = route.component\n\t\t\t\t\tif (c instanceof Promise) {\n\t\t\t\t\t\t// Dynamic import module\n\t\t\t\t\t\treturn from(c).pipe(map(x => ({ component: x.exports.default as CustomElementConstructor, route })))\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Already a string, function, or element\n\t\t\t\t\t\treturn of({ component: c, route })\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ component, route }) => {\n\t\t\t\t\tif (typeof component === 'string') {\n\t\t\t\t\t\t// Tag name\n\t\t\t\t\t\treturn { component: document.createElement(component), route }\n\t\t\t\t\t} else if (component instanceof HTMLElement) {\n\t\t\t\t\t\t// Already an element instance\n\t\t\t\t\t\treturn { component, route }\n\t\t\t\t\t} else if (typeof component === 'function') {\n\t\t\t\t\t\t// Custom element constructor\n\t\t\t\t\t\treturn { component: new component(), route }\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tdistinctUntilChanged((prev, curr) => prev.component.tagName === curr.component.tagName),\n\t\t\t\t// create the new view and add it to the DOM\n\t\t\t\tmap(({ component, route }) => {\n\t\t\t\t\tconst oldView = this.shadowRoot?.children[0]\n\t\t\t\t\tconst oldViewExists = !!oldView\n\n\t\t\t\t\t// Remove the old view (if any)\n\t\t\t\t\toldView.remove()\n\t\t\t\t\t// Native Web Animations API - fade in\n\t\t\t\t\t// \"ease: cubic-bezier(0.25, 0.8, 0.25, 1)\" was used in the old code\n\t\t\t\t\tcomponent.classList.add('opacity-0')\n\t\t\t\t\tthis.shadowRoot?.append(component)\n\t\t\t\t\tcomponent.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\t\t\t\tduration: oldViewExists ? 150 : 100,\n\t\t\t\t\t\teasing: 'cubic-bezier(0.25, 0.8, 0.25, 1)',\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t})\n\n\t\t\t\t\t// Insert the new view\n\n\t\t\t\t\treturn { component, route }\n\t\t\t\t}),\n\t\t\t\ttap(({ component, route }) => {\n\t\t\t\t\t// Handle history updates\n\t\t\t\t\tif (typeof route.historyStrategy === 'undefined' || route.historyStrategy === 'push') {\n\t\t\t\t\t\thistory.pushState(route.state, '', this.newPath(component.tagName, route))\n\t\t\t\t\t} else if (route.historyStrategy && ['replace', 'pop'].includes(route.historyStrategy)) {\n\t\t\t\t\t\thistory.replaceState(route.state, '', this.newPath(component.tagName, route))\n\t\t\t\t\t}\n\t\t\t\t\tarea.current.set(this.name, {\n\t\t\t\t\t\tcomponent: component.tagName,\n\t\t\t\t\t\tstate: route.state || {},\n\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t\tparams: route.params || {},\n\t\t\t\t\t})\n\n\t\t\t\t\tarea.$current.next(area.current)\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tnewPath(tag: string, route: RouteAction) {\n\t\tconst oldPathname = location.pathname.split('/').pop()\n\t\tlet oldAreaState = {}\n\t\ttry {\n\t\t\toldAreaState = oldPathname ? JSON.parse(decodeURIComponent(oldPathname)) : {}\n\t\t} catch {\n\t\t\toldAreaState = {}\n\t\t}\n\t\troute.state = route.state ?? {}\n\t\tconst queryParams = route.clearQueryParams ? this.queryParamClear(route.clearQueryParams) : document.location.search\n\n\t\treturn encodeURIComponent(\n\t\t\tJSON.stringify({\n\t\t\t\t...oldAreaState,\n\t\t\t\t[this.name]: { component: tag.toLowerCase(), state: route.state, params: route.params },\n\t\t\t}),\n\t\t).concat(`${queryParams}`)\n\t}\n\n\tqueryParamClear(params?: string[]) {\n\t\tif (!params) {\n\t\t\treturn ''\n\t\t}\n\t\t// get query params from url\n\t\tconst urlParams = new URLSearchParams(location.search)\n\t\t// remove query params\n\t\tparams.forEach(param => urlParams.delete(param))\n\t\t// update url\n\t\tif (urlParams.toString() === '') return ''\n\t\treturn `?${urlParams.toString()}`\n\t}\n\n\tcheckForTeleportationRequests() {\n\t\treturn fromEvent<CustomEvent>(window, 'FLIP_REQUEST').pipe(\n\t\t\tmap(e => e.detail),\n\t\t\tbufferTime(0),\n\t\t\ttap(() => {\n\t\t\t\tthis.dispatchEvent(new CustomEvent('FLIP_STARTED'))\n\t\t\t}),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t\ttimeout(0),\n\t\t\tcatchError(() => of(null)),\n\t\t)\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\trender() {\n\t\treturn html` <slot> </slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-area': SchmancyArea\n\t}\n}"],"names":["routerHistory","Subject","FINDING_MORTIES","HERE_RICKY","AreaService","constructor","this","prettyURL","mode","request","ReplaySubject","current","Map","$current","areaSubjects","enableHistoryMode","findingMortiesEvent","CustomEvent","next","subscribe","currentAreas","forEach","route","areaName","getOrCreateAreaSubject","has","subject","set","currentRoute","get","state","params","Error","skipCurrent","areaSubject","pipe","skip","asObservable","on","map","filter","key","value","zip","fromEvent","window","e","detail","bufferTime","tap","console","log","of","dispatchEvent","component","timeout","r","routeAction","dispatchAreaEvent","area","event","historyStrategy","bubbles","composed","name","newState","JSON","parse","stringify","history","replaceState","encodeURIComponent","instance","pathname","location","split","pop","areaState","decodeURIComponent","getInstance","HISTORY_STRATEGY","SchmancyArea","$LitElement","css","path","routes","default","x","isPresent","libExports","catchError","EMPTY","firstUpdated","merge","switchMap","getComponentFromPathname","silent","take","target","takeUntil","disconnecting","distinctUntilChanged","a","b","aComponent","bComponent","replaceAll","toLowerCase","c","Promise","from","exports","document","createElement","HTMLElement","prev","curr","tagName","oldView","shadowRoot","children","oldViewExists","remove","classList","add","append","animate","opacity","duration","easing","fill","pushState","newPath","includes","tag","oldPathname","oldAreaState","queryParams","clearQueryParams","queryParamClear","search","concat","urlParams","URLSearchParams","param","delete","toString","disconnectedCallback","super","render","html","__decorateClass","property","prototype","customElement"],"mappings":"uSAIaA,EAAgB,IAAIC,EAAqBA,QAEzCC,EAAkB,kBAClBC,EAAa,aAQ1B,MAAMC,CAAAA,CAcL,aAAAC,CAZAC,KAAOC,UAAAA,GACPD,KAAOE,KAA6B,UAC7BF,KAAAG,QAAU,IAAIC,EAAAA,cAA2B,CAAA,EACzCJ,KAAAK,YAAcC,IACdN,KAAAO,SAAW,IAAIH,EAAAA,cAAwC,CAAA,EAGtDJ,KAAAQ,iBAAmBF,IAE3BN,KAAOS,kBAAAA,GACCT,KAAAU,oBAAsB,IAAIC,YAA6Cf,CAAAA,EAGzEI,KAAAO,SAASK,KAAKZ,KAAKK,OAGnBL,EAAAA,KAAAO,SAASM,UAA0BC,GAE1BA,CAAAA,EAAA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,MAAOC,OAAQT,EAAMS,MAE/E8G,CAAAA,CAAAA,CAAAA,EAAAA,OAAO,GAAGJ,CAAAA,EAAAA,CAAa,CAG1B,gBAAgB1G,EACf,CAAA,GAAA,CAAKA,EACG,MAAA,GAGR,MAAM+G,EAAY,IAAIC,gBAAgBrE,SAASkE,MAI/C,EAAA,OAFA7G,EAAOV,QAAQ2H,GAASF,EAAUG,OAAOD,CAAAA,CAAAA,EAErCF,EAAUI,SAAAA,IAAe,GAAW,GACjC,IAAIJ,EAAUI,SAAAA,CAAAA,EAAU,CAGhC,gCACQ,OAAAtG,YAAuBC,OAAQ,cAAgBV,EAAAA,KACrDI,EAAAA,IAASO,GAAAA,EAAEC,MAAAA,EACXC,EAAAA,WAAW,GACXC,EAAAA,IAAI,IACH3C,CAAAA,KAAK+C,cAAc,IAAIpC,YAAY,cAAe,CAAA,CAAA,CAAA,EAEnDkF,EAAAA,UAAU7F,KAAK8F,aAAAA,EACf7C,EAAAA,QAAQ,CAAA,EACRmC,aAAW,IAAMtC,EAAGA,GAAA,IAAA,CAAA,CAAA,CACrB,CAGD,sBAAA+F,CACCC,MAAMD,qBAAAA,EACD7I,KAAA8F,cAAclF,KAAK,EAAA,CAAI,CAG7B,QAAAmI,CACQ,OAAAC,EAAAA,sBAAA,CAAA,EAtMIC,EAAA,CAAXC,EAASA,SAdEvE,CAAAA,EAAAA,qBAcAwE,UAAA,OAAA,CAAA,EAEAF,EAAA,CAAXC,EAASA,SAhBEvE,CAAAA,EAAAA,qBAgBAwE,UAAA,UAAA,CAAA,EAhBAxE,QAANA,aAAAsE,EAAA,CADNG,EAAAA,cAAc,eAAA,CAAA,EACFzE"}
package/dist/area.js CHANGED
@@ -1,4 +1,4 @@
1
- import { F as s, H as I, b as R, S, a as e, r as o } from "./area.component-CZELEuMj.js";
1
+ import { F as s, H as I, b as R, S, a as e, r as o } from "./area.component-CzFJM7Y4.js";
2
2
  export {
3
3
  s as FINDING_MORTIES,
4
4
  I as HERE_RICKY,
@@ -1,4 +1,4 @@
1
- "use strict";const l=require("lit"),a=require("lit/decorators.js"),n=require("rxjs");require("./animated-text-9AM64DHd.cjs");const k=require("./area.component-grRkXEse.cjs");require("./autocomplete-DBXvIJgc.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const x=require("./tailwind.mixin-Dm5QDZav.cjs"),g=require("./ripple-C2BHbhcS.cjs");require("./spinner-DxVJ7QJZ.cjs"),require("./icon-button-D0BbHnDL.cjs");const o=require("./theme.interface-Xg5Zi46a.cjs");require("./checkbox-DtnX5sT6.cjs"),require("./chips-CVDnpVUM.cjs"),require("./payment-card-form-UWbAYNPR.cjs");const p=require("./types.cjs"),d=require("./provide-BGGp1Iks.cjs"),b=require("./litElement.mixin-CHvyxfxf.cjs"),m=require("./consume-uKrSupzs.cjs");require("./date-range-DbPA5Y-t.cjs"),require("./delay-BgNgQV2G.cjs"),require("./dialog-content-qj1E8aye.cjs"),require("./divider-CHckHGEQ.cjs"),require("./dropdown-content-B41MDDRG.cjs"),require("./timezone-VUMRmZaJ.cjs"),require("./form-BN75s0PI.cjs"),require("./icon-Cu-imayV.cjs"),require("./input-B2oV6Hck.cjs"),require("./flex-CFv-Zb76.cjs"),require("./list-CMHoPfX9.cjs"),require("./menu-BcSplMNh.cjs");const U=require("lit/directives/when.js");require("./notification-service-BV9ybQBu.cjs"),require("./option-CkLBgH71.cjs"),require("./radio-button-BykiVxTD.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-DE57Nios.cjs");const B=require("./sheet-fZYAWGsm.cjs");require("./slider-CejrdmPF.cjs"),require("./schmancy-steps-container-B1mIGa9M.cjs"),require("./context-object-CP7HbDFQ.cjs");const P=require("rxjs/operators");require("./surface-BTuzKmT2.cjs"),require("./table-CBhyHINV.cjs"),require("./tabs-compatibility-DPD6jfGF.cjs"),require("./textarea-CesFdBkm.cjs"),require("./theme.component-BlBaN7d6.cjs"),require("./theme-button-Bt2OV4iu.cjs"),require("./tooltip-Cvoroe7w.cjs"),require("./tree-Cyp2AZ8g.cjs"),require("./typewriter-BIm2tOe4.cjs"),require("./typography-OpLt6LNd.cjs");var F=Object.defineProperty,G=Object.getOwnPropertyDescriptor,v=(e,t,s,i)=>{for(var c,r=i>1?void 0:i?G(t,s):t,h=e.length-1;h>=0;h--)(c=e[h])&&(r=(i?c(t,s,r):c(r))||r);return i&&r&&F(t,s,r),r};exports.SchmancyBadgeV2=class extends x.TailwindElement(l.css`
1
+ "use strict";const l=require("lit"),a=require("lit/decorators.js"),n=require("rxjs");require("./animated-text-9AM64DHd.cjs");const k=require("./area.component-WxccFh1z.cjs");require("./autocomplete-DBXvIJgc.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const x=require("./tailwind.mixin-Dm5QDZav.cjs"),g=require("./ripple-C2BHbhcS.cjs");require("./spinner-DxVJ7QJZ.cjs"),require("./icon-button-D0BbHnDL.cjs");const o=require("./theme.interface-Xg5Zi46a.cjs");require("./checkbox-DtnX5sT6.cjs"),require("./chips-CVDnpVUM.cjs"),require("./payment-card-form-UWbAYNPR.cjs");const p=require("./types.cjs"),d=require("./provide-BGGp1Iks.cjs"),b=require("./litElement.mixin-CHvyxfxf.cjs"),m=require("./consume-uKrSupzs.cjs");require("./date-range-DbPA5Y-t.cjs"),require("./delay-BgNgQV2G.cjs"),require("./dialog-content-qj1E8aye.cjs"),require("./divider-CHckHGEQ.cjs"),require("./dropdown-content-B41MDDRG.cjs"),require("./timezone-VUMRmZaJ.cjs"),require("./form-BN75s0PI.cjs"),require("./icon-Cu-imayV.cjs"),require("./input-B2oV6Hck.cjs"),require("./flex-CFv-Zb76.cjs"),require("./list-CMHoPfX9.cjs"),require("./menu-BcSplMNh.cjs");const U=require("lit/directives/when.js");require("./notification-service-BV9ybQBu.cjs"),require("./option-CkLBgH71.cjs"),require("./radio-button-BykiVxTD.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-DE57Nios.cjs");const B=require("./sheet-fZYAWGsm.cjs");require("./slider-CejrdmPF.cjs"),require("./schmancy-steps-container-B1mIGa9M.cjs"),require("./context-object-CP7HbDFQ.cjs");const P=require("rxjs/operators");require("./surface-BTuzKmT2.cjs"),require("./table-CBhyHINV.cjs"),require("./tabs-compatibility-DPD6jfGF.cjs"),require("./textarea-CesFdBkm.cjs"),require("./theme.component-BlBaN7d6.cjs"),require("./theme-button-Bt2OV4iu.cjs"),require("./tooltip-Cvoroe7w.cjs"),require("./tree-Cyp2AZ8g.cjs"),require("./typewriter-BIm2tOe4.cjs"),require("./typography-OpLt6LNd.cjs");var F=Object.defineProperty,G=Object.getOwnPropertyDescriptor,v=(e,t,s,i)=>{for(var c,r=i>1?void 0:i?G(t,s):t,h=e.length-1;h>=0;h--)(c=e[h])&&(r=(i?c(t,s,r):c(r))||r);return i&&r&&F(t,s,r),r};exports.SchmancyBadgeV2=class extends x.TailwindElement(l.css`
2
2
  :host {
3
3
  display: inline-flex;
4
4
  }
@@ -240,4 +240,4 @@
240
240
  `}getColorAttributes(){const e={primary:{bgColor:o.SchmancyTheme.sys.color.primary.container,color:o.SchmancyTheme.sys.color.primary.onContainer},secondary:{bgColor:o.SchmancyTheme.sys.color.secondary.container,color:o.SchmancyTheme.sys.color.secondary.onContainer},tertiary:{bgColor:o.SchmancyTheme.sys.color.tertiary.container,color:o.SchmancyTheme.sys.color.tertiary.onContainer},success:{bgColor:o.SchmancyTheme.sys.color.success.container,color:o.SchmancyTheme.sys.color.success.onContainer},error:{bgColor:o.SchmancyTheme.sys.color.error.container,color:o.SchmancyTheme.sys.color.error.onContainer},neutral:{bgColor:o.SchmancyTheme.sys.color.surface.container,color:o.SchmancyTheme.sys.color.surface.on}};return g.color(e[this.color])}renderStatusIndicator(){const e={online:o.SchmancyTheme.sys.color.success.default,offline:o.SchmancyTheme.sys.color.surface.onVariant,busy:o.SchmancyTheme.sys.color.error.default,away:o.SchmancyTheme.sys.color.tertiary.default},t={"absolute bottom-0 right-0 rounded-full border-2 border-surface-default":!0,[{xs:"w-1.5 h-1.5",sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3",xl:"w-4 h-4"}[this.size]]:!0};return l.html`
241
241
  <div class="${this.classMap(t)}" style="background-color: ${e[this.status]};"></div>
242
242
  `}},u([a.property({type:String})],exports.SchmancyAvatar.prototype,"initials",2),u([a.property({type:String})],exports.SchmancyAvatar.prototype,"src",2),u([a.property({type:String})],exports.SchmancyAvatar.prototype,"icon",2),u([a.property({type:String})],exports.SchmancyAvatar.prototype,"size",2),u([a.property({type:String})],exports.SchmancyAvatar.prototype,"color",2),u([a.property({type:String})],exports.SchmancyAvatar.prototype,"shape",2),u([a.property({type:Boolean})],exports.SchmancyAvatar.prototype,"bordered",2),u([a.property({type:String})],exports.SchmancyAvatar.prototype,"status",2),exports.SchmancyAvatar=u([a.customElement("schmancy-avatar")],exports.SchmancyAvatar),exports.$drawer=le,exports.HereMorty=H,exports.SchmancyContentDrawerID=R,exports.SchmancyContentDrawerMaxHeight=z,exports.SchmancyContentDrawerMinWidth=N,exports.SchmancyContentDrawerSheetMode=M,exports.SchmancyContentDrawerSheetState=_,exports.SchmancyDrawerNavbarMode=j,exports.SchmancyDrawerNavbarState=W,exports.WhereAreYouRicky=X,exports.schmancyContentDrawer=se,exports.schmancyNavDrawer=Y,exports.teleport=C;
243
- //# sourceMappingURL=avatar-s-2jSsaH.cjs.map
243
+ //# sourceMappingURL=avatar-Bmg5TXj9.cjs.map