@mhmo91/schmancy 0.10.18 → 0.10.19

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 (164) hide show
  1. package/dist/agent/{flow-CvG1fLW5.js.map → flow-3RrZM-e7.js.map} +1 -1
  2. package/dist/agent/overlay.confirm-body-D3jQyXgA.js +2863 -0
  3. package/dist/agent/overlay.confirm-body-D3jQyXgA.js.map +1 -0
  4. package/dist/agent/{rolldown-runtime-DsMetpgY.js → rolldown-runtime-BIIoCavz.js} +9 -2
  5. package/dist/agent/schmancy.agent.js +3870 -5769
  6. package/dist/agent/schmancy.agent.js.map +1 -1
  7. package/dist/agent/{vendor-material-color-DcL7ZPxx.js.map → vendor-material-color-33Mj762T.js.map} +1 -1
  8. package/dist/{audio-D-TZzpXF.cjs → audio-Cvmemu84.cjs} +1 -1
  9. package/dist/{audio-D-TZzpXF.cjs.map → audio-Cvmemu84.cjs.map} +1 -1
  10. package/dist/{audio-DS43uoRA.js → audio-CxO5a2HL.js} +1 -1
  11. package/dist/{audio-DS43uoRA.js.map → audio-CxO5a2HL.js.map} +1 -1
  12. package/dist/audio.cjs +1 -1
  13. package/dist/audio.js +2 -2
  14. package/dist/badge.cjs +1 -1
  15. package/dist/badge.js +1 -1
  16. package/dist/{boat-cuoSkhGI.js → boat-CNWIQPA1.js} +1 -1
  17. package/dist/{boat-cuoSkhGI.js.map → boat-CNWIQPA1.js.map} +1 -1
  18. package/dist/{boat-DN1_tyvx.cjs → boat-OatK_MGh.cjs} +1 -1
  19. package/dist/{boat-DN1_tyvx.cjs.map → boat-OatK_MGh.cjs.map} +1 -1
  20. package/dist/boat.cjs +1 -1
  21. package/dist/boat.js +1 -1
  22. package/dist/{chips-m2NPN480.js → chips-D1kJrbzo.js} +1 -1
  23. package/dist/{chips-m2NPN480.js.map → chips-D1kJrbzo.js.map} +1 -1
  24. package/dist/{chips-DSdvCpmi.cjs → chips-Dx_WvOGk.cjs} +1 -1
  25. package/dist/{chips-DSdvCpmi.cjs.map → chips-Dx_WvOGk.cjs.map} +1 -1
  26. package/dist/chips.cjs +1 -1
  27. package/dist/chips.js +1 -1
  28. package/dist/connectivity.cjs +1 -1
  29. package/dist/connectivity.js +1 -1
  30. package/dist/content-drawer.cjs +1 -1
  31. package/dist/content-drawer.js +1 -1
  32. package/dist/{date-range-D98QcCHl.js → date-range-Dv-DM6mB.js} +1 -1
  33. package/dist/{date-range-D98QcCHl.js.map → date-range-Dv-DM6mB.js.map} +1 -1
  34. package/dist/{date-range-DxS3Agbj.cjs → date-range-H903Vt_r.cjs} +1 -1
  35. package/dist/{date-range-DxS3Agbj.cjs.map → date-range-H903Vt_r.cjs.map} +1 -1
  36. package/dist/date-range.cjs +1 -1
  37. package/dist/date-range.js +1 -1
  38. package/dist/directives.cjs +1 -1
  39. package/dist/directives.js +1 -1
  40. package/dist/{float-B8NcSE3a.cjs → float-CfbQM_2v.cjs} +1 -1
  41. package/dist/{float-B8NcSE3a.cjs.map → float-CfbQM_2v.cjs.map} +1 -1
  42. package/dist/{float-C-glc-3u.js → float-KmbhaQHA.js} +1 -1
  43. package/dist/{float-C-glc-3u.js.map → float-KmbhaQHA.js.map} +1 -1
  44. package/dist/float.cjs +1 -1
  45. package/dist/float.js +1 -1
  46. package/dist/{form-DJvxIyfW.js → form-8IcmP8uV.js} +2 -2
  47. package/dist/{form-DJvxIyfW.js.map → form-8IcmP8uV.js.map} +1 -1
  48. package/dist/{form-St_IwR7y.cjs → form-CuBIrKOA.cjs} +1 -1
  49. package/dist/{form-St_IwR7y.cjs.map → form-CuBIrKOA.cjs.map} +1 -1
  50. package/dist/form.cjs +1 -1
  51. package/dist/form.js +2 -2
  52. package/dist/handover/agent-runtime-followups.md +1 -1
  53. package/dist/handover/agent-runtime-v1.md +3 -3
  54. package/dist/index.cjs +1 -1
  55. package/dist/index.js +56 -53
  56. package/dist/json.cjs +1 -1
  57. package/dist/json.js +1 -1
  58. package/dist/{layout-Delq-QvR.cjs → layout-BbCIfIgo.cjs} +1 -1
  59. package/dist/{layout-Delq-QvR.cjs.map → layout-BbCIfIgo.cjs.map} +1 -1
  60. package/dist/{layout-BH28sKGc.js → layout-Dq2oeOTS.js} +1 -1
  61. package/dist/{layout-BH28sKGc.js.map → layout-Dq2oeOTS.js.map} +1 -1
  62. package/dist/{menu-Dag0cuWV.cjs → menu-BqKQ-s0C.cjs} +1 -1
  63. package/dist/{menu-Dag0cuWV.cjs.map → menu-BqKQ-s0C.cjs.map} +1 -1
  64. package/dist/{menu-B_-weNpZ.js → menu-C5ksITpG.js} +1 -1
  65. package/dist/{menu-B_-weNpZ.js.map → menu-C5ksITpG.js.map} +1 -1
  66. package/dist/menu.cjs +1 -1
  67. package/dist/menu.js +1 -1
  68. package/dist/nav-drawer.cjs +1 -1
  69. package/dist/nav-drawer.js +1 -1
  70. package/dist/navigation-bar.cjs +1 -1
  71. package/dist/navigation-bar.js +1 -1
  72. package/dist/{notification-yd2KeHjd.cjs → notification-DR3gvWt8.cjs} +1 -1
  73. package/dist/{notification-yd2KeHjd.cjs.map → notification-DR3gvWt8.cjs.map} +1 -1
  74. package/dist/{notification-DySnvQeO.js → notification-eZxtr3NN.js} +1 -1
  75. package/dist/{notification-DySnvQeO.js.map → notification-eZxtr3NN.js.map} +1 -1
  76. package/dist/notification.cjs +1 -1
  77. package/dist/notification.js +1 -1
  78. package/dist/overlay-DG6EeyKt.cjs +80 -0
  79. package/dist/overlay-DG6EeyKt.cjs.map +1 -0
  80. package/dist/overlay-oxM9OLXP.js +745 -0
  81. package/dist/overlay-oxM9OLXP.js.map +1 -0
  82. package/dist/overlay.cjs +1 -80
  83. package/dist/{overlay.confirm-body-sUmd_zVy.cjs.map → overlay.confirm-body-78e1WrN9.cjs.map} +1 -1
  84. package/dist/{overlay.confirm-body-DESGpbru.js.map → overlay.confirm-body-D_P2e7l6.js.map} +1 -1
  85. package/dist/overlay.js +5 -746
  86. package/dist/{overlay.service-DV_o_xQ0.js → overlay.service-C8NwO4Bx.js} +2 -2
  87. package/dist/{overlay.service-DV_o_xQ0.js.map → overlay.service-C8NwO4Bx.js.map} +1 -1
  88. package/dist/{overlay.service-BxtEFFSH.cjs → overlay.service-DQkGPUY7.cjs} +1 -1
  89. package/dist/{overlay.service-BxtEFFSH.cjs.map → overlay.service-DQkGPUY7.cjs.map} +1 -1
  90. package/dist/page.cjs +1 -1
  91. package/dist/page.js +2 -2
  92. package/dist/{rxjs-utils-Dv9T9IpA.js.map → rxjs-utils-Cs6XGwF6.js.map} +1 -1
  93. package/dist/{rxjs-utils-BKB2UM_j.cjs.map → rxjs-utils-Dsj75cJy.cjs.map} +1 -1
  94. package/dist/rxjs-utils.cjs +1 -1
  95. package/dist/rxjs-utils.js +1 -1
  96. package/dist/{sound.service-DyY78ukR.cjs → sound.service-DVJZb9ox.cjs} +1 -1
  97. package/dist/{sound.service-DyY78ukR.cjs.map → sound.service-DVJZb9ox.cjs.map} +1 -1
  98. package/dist/{sound.service-BIN2W7Rv.js → sound.service-v_jqCkos.js} +1 -1
  99. package/dist/{sound.service-BIN2W7Rv.js.map → sound.service-v_jqCkos.js.map} +1 -1
  100. package/dist/{splash-screen-25PTDqnp.cjs.map → splash-screen-BvaDkvJU.cjs.map} +1 -1
  101. package/dist/{splash-screen-bGW_sS4i.js.map → splash-screen-ChMkAPLU.js.map} +1 -1
  102. package/dist/splash-screen.cjs +1 -1
  103. package/dist/splash-screen.js +1 -1
  104. package/dist/{src-Blm9PNcf.cjs → src-BIlD63Cz.cjs} +1 -1
  105. package/dist/{src-Blm9PNcf.cjs.map → src-BIlD63Cz.cjs.map} +1 -1
  106. package/dist/{src-olrlFt4e.js → src-DnunCC4X.js} +18 -17
  107. package/dist/{src-olrlFt4e.js.map → src-DnunCC4X.js.map} +1 -1
  108. package/dist/{state-nm8yzMPp.js → state-CHbIt2Dw.js} +198 -202
  109. package/dist/{state-nm8yzMPp.js.map → state-CHbIt2Dw.js.map} +1 -1
  110. package/dist/state-DcGj-pJJ.cjs +1 -0
  111. package/dist/{state-avic94Ft.cjs.map → state-DcGj-pJJ.cjs.map} +1 -1
  112. package/dist/state.cjs +1 -1
  113. package/dist/state.js +1 -1
  114. package/dist/{tabs-BVC_qn8S.js.map → tabs-CkDNLbiS.js.map} +1 -1
  115. package/dist/{tabs-Dc3_Ox2B.cjs.map → tabs-lxQHWEb7.cjs.map} +1 -1
  116. package/dist/tabs.cjs +1 -1
  117. package/dist/tabs.js +1 -1
  118. package/dist/teleport.cjs +1 -1
  119. package/dist/teleport.js +1 -1
  120. package/dist/{theme-DCybsrfv.cjs → theme-CMyXTDht.cjs} +1 -1
  121. package/dist/{theme-DCybsrfv.cjs.map → theme-CMyXTDht.cjs.map} +1 -1
  122. package/dist/{theme-BiCwFfCf.js → theme-CNWRYdfn.js} +2 -2
  123. package/dist/{theme-BiCwFfCf.js.map → theme-CNWRYdfn.js.map} +1 -1
  124. package/dist/{theme-button-DqiA0rJg.js.map → theme-button-CixloLin.js.map} +1 -1
  125. package/dist/{theme-button-cZGRyQRK.cjs.map → theme-button-kMhsX5Oe.cjs.map} +1 -1
  126. package/dist/theme-button.cjs +1 -1
  127. package/dist/theme-button.js +1 -1
  128. package/dist/theme.cjs +1 -1
  129. package/dist/theme.js +2 -2
  130. package/dist/{theme.service-BOWIT_5k.js → theme.service-CSzNkqBB.js} +1 -1
  131. package/dist/{theme.service-BOWIT_5k.js.map → theme.service-CSzNkqBB.js.map} +1 -1
  132. package/dist/{theme.service-DkdH1t60.cjs → theme.service-CnFUmUpc.cjs} +1 -1
  133. package/dist/{theme.service-DkdH1t60.cjs.map → theme.service-CnFUmUpc.cjs.map} +1 -1
  134. package/dist/{utils-D2QUu4-g.cjs.map → utils-C-Q8ePtG.cjs.map} +1 -1
  135. package/dist/{utils-Cj_nRRyx.js.map → utils-DXE5fBBd.js.map} +1 -1
  136. package/dist/utils.cjs +1 -1
  137. package/dist/utils.js +1 -1
  138. package/dist/{window-DMy5Gsgu.js → window-BcvDNi9D.js} +1 -1
  139. package/dist/{window-DMy5Gsgu.js.map → window-BcvDNi9D.js.map} +1 -1
  140. package/dist/{window-BMecbTzs.cjs → window-qaGFMn_4.cjs} +1 -1
  141. package/dist/{window-BMecbTzs.cjs.map → window-qaGFMn_4.cjs.map} +1 -1
  142. package/dist/window.cjs +1 -1
  143. package/dist/window.js +1 -1
  144. package/package.json +1 -1
  145. package/src/index.ts +8 -0
  146. package/src/state/index.ts +31 -9
  147. package/types/src/index.d.ts +1 -0
  148. package/dist/overlay.cjs.map +0 -1
  149. package/dist/overlay.js.map +0 -1
  150. package/dist/state-avic94Ft.cjs +0 -1
  151. /package/dist/agent/{flow-CvG1fLW5.js → flow-3RrZM-e7.js} +0 -0
  152. /package/dist/agent/{vendor-material-color-DcL7ZPxx.js → vendor-material-color-33Mj762T.js} +0 -0
  153. /package/dist/{overlay.confirm-body-sUmd_zVy.cjs → overlay.confirm-body-78e1WrN9.cjs} +0 -0
  154. /package/dist/{overlay.confirm-body-DESGpbru.js → overlay.confirm-body-D_P2e7l6.js} +0 -0
  155. /package/dist/{rxjs-utils-Dv9T9IpA.js → rxjs-utils-Cs6XGwF6.js} +0 -0
  156. /package/dist/{rxjs-utils-BKB2UM_j.cjs → rxjs-utils-Dsj75cJy.cjs} +0 -0
  157. /package/dist/{splash-screen-25PTDqnp.cjs → splash-screen-BvaDkvJU.cjs} +0 -0
  158. /package/dist/{splash-screen-bGW_sS4i.js → splash-screen-ChMkAPLU.js} +0 -0
  159. /package/dist/{tabs-BVC_qn8S.js → tabs-CkDNLbiS.js} +0 -0
  160. /package/dist/{tabs-Dc3_Ox2B.cjs → tabs-lxQHWEb7.cjs} +0 -0
  161. /package/dist/{theme-button-DqiA0rJg.js → theme-button-CixloLin.js} +0 -0
  162. /package/dist/{theme-button-cZGRyQRK.cjs → theme-button-kMhsX5Oe.cjs} +0 -0
  163. /package/dist/{utils-D2QUu4-g.cjs → utils-C-Q8ePtG.cjs} +0 -0
  164. /package/dist/{utils-Cj_nRRyx.js → utils-DXE5fBBd.js} +0 -0
package/dist/overlay.js CHANGED
@@ -1,746 +1,5 @@
1
- import { c as e } from "./mixins-DCVXqL1Q.js";
2
- import { a as t } from "./active-host-BP0zy_Y9.js";
3
- import { t as n } from "./lazy-D-bO2r4m.js";
4
- import { _ as r, d as i, f as a, u as o } from "./animation-DCznELuT.js";
5
- import { t as s } from "./reduced-motion-D7LqTUMn.js";
6
- import { t as c } from "./layout-BH28sKGc.js";
7
- import { a as l, i as u, n as d, o as f, r as p, t as m } from "./overlay.service-DV_o_xQ0.js";
8
- import { t as h } from "./overlay.confirm-body-DESGpbru.js";
9
- import { Observable as g, Subject as _, debounceTime as v, distinctUntilChanged as ee, filter as y, fromEvent as b, map as x, merge as S, take as C, takeUntil as w, tap as T } from "rxjs";
10
- import { customElement as te, property as E, query as D, state as O } from "lit/decorators.js";
11
- import { css as k, html as A, render as j } from "lit";
12
- import { when as M } from "lit/directives/when.js";
13
- import { autoUpdate as N, computePosition as P, flip as F, offset as I, shift as L, size as R } from "@floating-ui/dom";
14
- var z = s.value;
15
- s.subscribe((e) => {
16
- z = e;
17
- });
18
- var B = "--schmancy-overlay-origin-x", V = "--schmancy-overlay-origin-y", H = `var(${B}, 50%) var(${V}, 50%)`;
19
- function U(e) {
20
- return Number.isNaN(e) || !Number.isFinite(e) ? 50 : Math.max(0, Math.min(100, e));
21
- }
22
- function W(e, t) {
23
- if (z) return t === "in" ? {
24
- keyframes: [{
25
- opacity: 0,
26
- transform: "none"
27
- }, {
28
- opacity: 1,
29
- transform: "none"
30
- }],
31
- options: {
32
- duration: 1,
33
- easing: "linear",
34
- fill: "forwards"
35
- }
36
- } : {
37
- keyframes: [{
38
- opacity: 1,
39
- transform: "none"
40
- }, {
41
- opacity: 0,
42
- transform: "none"
43
- }],
44
- options: {
45
- duration: 1,
46
- easing: "linear",
47
- fill: "forwards"
48
- }
49
- };
50
- switch (e) {
51
- case "centered": return t === "in" ? {
52
- keyframes: [{
53
- opacity: 0,
54
- transform: "scale(0.6)",
55
- transformOrigin: H
56
- }, {
57
- opacity: 1,
58
- transform: "scale(1)",
59
- transformOrigin: H
60
- }],
61
- options: {
62
- duration: a.duration,
63
- easing: r(a),
64
- fill: "forwards"
65
- }
66
- } : {
67
- keyframes: [{
68
- opacity: 1,
69
- transform: "scale(1)",
70
- transformOrigin: H
71
- }, {
72
- opacity: 0,
73
- transform: "scale(0.95)",
74
- transformOrigin: H
75
- }],
76
- options: {
77
- duration: 150,
78
- easing: r(i),
79
- fill: "forwards"
80
- }
81
- };
82
- case "sheet": return t === "in" ? {
83
- keyframes: [{
84
- opacity: 0,
85
- transform: "translateY(100%)"
86
- }, {
87
- opacity: 1,
88
- transform: "translateY(0)"
89
- }],
90
- options: {
91
- duration: o.duration,
92
- easing: r(o),
93
- fill: "forwards"
94
- }
95
- } : {
96
- keyframes: [{
97
- opacity: 1,
98
- transform: "translateY(0)"
99
- }, {
100
- opacity: 0,
101
- transform: "translateY(100%)"
102
- }],
103
- options: {
104
- duration: 150,
105
- easing: r(i),
106
- fill: "forwards"
107
- }
108
- };
109
- case "anchored": return t === "in" ? {
110
- keyframes: [{
111
- opacity: 0,
112
- transform: "scale(0.85)",
113
- transformOrigin: H
114
- }, {
115
- opacity: 1,
116
- transform: "scale(1)",
117
- transformOrigin: H
118
- }],
119
- options: {
120
- duration: a.duration,
121
- easing: r(a),
122
- fill: "forwards"
123
- }
124
- } : {
125
- keyframes: [{
126
- opacity: 1,
127
- transform: "scale(1)",
128
- transformOrigin: H
129
- }, {
130
- opacity: 0,
131
- transform: "scale(0.92)",
132
- transformOrigin: H
133
- }],
134
- options: {
135
- duration: 150,
136
- easing: r(i),
137
- fill: "forwards"
138
- }
139
- };
140
- }
141
- }
142
- function ne(e) {
143
- let { surface: t, dragHandle: n, until$: r } = e;
144
- return new g((e) => {
145
- let i = n ?? t, a = new _(), o = !1, s = null, c = 0, l = 0, u = 0;
146
- return S(b(i, "pointerdown").pipe(y((e) => e.isPrimary && (e.pointerType !== "mouse" || e.button === 0)), y((e) => {
147
- if (n) return !0;
148
- let r = t.getBoundingClientRect();
149
- return e.clientY - r.top <= 40;
150
- }), T((e) => {
151
- o = !0, s = e.pointerId, c = e.clientY, l = performance.now(), u = 0, t.style.transition = "none", t.style.willChange = "transform";
152
- try {
153
- i.setPointerCapture?.(e.pointerId);
154
- } catch {}
155
- })), b(i, "pointermove").pipe(y(() => o), y((e) => e.pointerId === s), T((e) => {
156
- u = function(e) {
157
- if (e >= 0) return e;
158
- let t = -e;
159
- return -Math.max(0, 8 * (Math.log(t + 1) - 2));
160
- }(e.clientY - c), t.style.transform = `translateY(${u}px)`, e.cancelable && e.preventDefault();
161
- })), S(b(i, "pointerup"), b(i, "pointercancel"), b(i, "lostpointercapture")).pipe(y(() => o), y((e) => e.pointerId === s), T(() => {
162
- o = !1;
163
- let n = s;
164
- s = null;
165
- try {
166
- n !== null && i.releasePointerCapture?.(n);
167
- } catch {}
168
- let r = Math.max(1, performance.now() - l), a = u / r, c = t.getBoundingClientRect().height, d = Math.min(80, .25 * c), f = u > d || u > 20 && a > .4;
169
- t.style.willChange = "", f ? (t.style.transition = "transform 300ms cubic-bezier(0.16, 1, 0.3, 1)", t.style.transform = "translateY(100%)", e.next("dismiss"), e.complete()) : (t.style.transition = "transform 300ms cubic-bezier(0.16, 1, 0.3, 1)", t.style.transform = "translateY(0)");
170
- }))).pipe(w(S(a, r))).subscribe(), () => {
171
- a.next(), a.complete(), t.style.transition = "", t.style.transform = "", t.style.willChange = "";
172
- };
173
- }).pipe(C(1));
174
- }
175
- function G(e) {
176
- let { anchor: t, content: n, viewport: r } = e, i = r.width < 640, a = r.isCoarsePointer, o = n.height > .8 * r.height, s = n.width > .9 * r.width;
177
- return i || a || o || s ? "sheet" : t === void 0 ? "centered" : "anchored";
178
- }
179
- function K() {
180
- return {
181
- width: window.innerWidth,
182
- height: window.innerHeight,
183
- isCoarsePointer: window.matchMedia("(pointer: coarse)").matches
184
- };
185
- }
186
- function q(e, t) {
187
- return {
188
- x: e,
189
- y: t,
190
- width: 0,
191
- height: 0,
192
- left: e,
193
- right: e,
194
- top: t,
195
- bottom: t,
196
- toJSON: () => ({
197
- x: e,
198
- y: t,
199
- width: 0,
200
- height: 0,
201
- left: e,
202
- right: e,
203
- top: t,
204
- bottom: t
205
- })
206
- };
207
- }
208
- var J = Object.freeze({
209
- popover: typeof HTMLElement < "u" && "popover" in HTMLElement.prototype && typeof HTMLElement.prototype.showPopover == "function",
210
- cssAnchor: typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --x")
211
- });
212
- function Y(e) {
213
- if (!J.popover) throw Error("positionPopoverAPI requires Popover API support");
214
- e.setAttribute("popover", "auto");
215
- try {
216
- e.showPopover();
217
- } catch {}
218
- return () => {
219
- try {
220
- e.hidePopover?.();
221
- } catch {}
222
- e.removeAttribute("popover");
223
- };
224
- }
225
- function X(e, t, n = {}) {
226
- return new g((r) => {
227
- let i = t.el ?? t.virtual;
228
- if (!i) return void r.error(/* @__PURE__ */ Error("positionFloatingUI requires an element or virtual anchor"));
229
- let a = n.placement ?? "bottom-start", o = n.padding ?? 16, s = n.offsetPx ?? 8, c = N(i, e, async () => {
230
- try {
231
- let { x: t, y: n } = await P(i, e, {
232
- strategy: "fixed",
233
- placement: a,
234
- middleware: [
235
- I(s),
236
- F({
237
- padding: o,
238
- fallbackPlacements: re(a)
239
- }),
240
- L({ padding: o }),
241
- R({
242
- padding: o,
243
- apply({ availableWidth: e, availableHeight: t, elements: n }) {
244
- n.floating.style.maxWidth = `${Math.max(0, e)}px`, n.floating.style.maxHeight = `${Math.max(0, t)}px`;
245
- }
246
- })
247
- ]
248
- });
249
- Object.assign(e.style, {
250
- position: "fixed",
251
- left: `${Math.round(t)}px`,
252
- top: `${Math.round(n)}px`,
253
- transform: "none"
254
- }), r.next();
255
- } catch (e) {
256
- r.error(e);
257
- }
258
- }, {
259
- ancestorScroll: !0,
260
- ancestorResize: !0,
261
- elementResize: !1 !== n.track
262
- });
263
- return () => {
264
- c();
265
- };
266
- });
267
- }
268
- function re(e) {
269
- switch (e) {
270
- case "bottom-start": return [
271
- "top-start",
272
- "bottom-end",
273
- "top-end"
274
- ];
275
- case "bottom-end": return [
276
- "top-end",
277
- "bottom-start",
278
- "top-start"
279
- ];
280
- case "top-start": return [
281
- "bottom-start",
282
- "top-end",
283
- "bottom-end"
284
- ];
285
- case "top-end": return [
286
- "bottom-end",
287
- "top-start",
288
- "bottom-start"
289
- ];
290
- case "left-start": return [
291
- "right-start",
292
- "left-end",
293
- "right-end"
294
- ];
295
- case "left-end": return [
296
- "right-end",
297
- "left-start",
298
- "right-start"
299
- ];
300
- case "right-start": return [
301
- "left-start",
302
- "right-end",
303
- "left-end"
304
- ];
305
- case "right-end": return [
306
- "left-end",
307
- "right-start",
308
- "left-start"
309
- ];
310
- case "top": return [
311
- "bottom",
312
- "left",
313
- "right"
314
- ];
315
- case "bottom": return [
316
- "top",
317
- "left",
318
- "right"
319
- ];
320
- case "left": return [
321
- "right",
322
- "top",
323
- "bottom"
324
- ];
325
- case "right": return [
326
- "left",
327
- "top",
328
- "bottom"
329
- ];
330
- default: return ["top-start", "bottom-end"];
331
- }
332
- }
333
- var Z = "overlay-mount", Q = class extends e {
334
- constructor(...e) {
335
- super(...e), this.layout = "centered", this.dismissable = !0, this.modal = !0, this.tier = "modal", this._active = !1, this._closed$ = new _(), this._mounted = !1, this._closing = !1, this._lastFocusedElement = null, this._inertedSiblings = [], this._lastReResolveAt = 0, this.onBackdropClick = () => {
336
- this.dismissable && this.close("backdrop");
337
- };
338
- }
339
- static {
340
- this.styles = [k`
341
- :host {
342
- position: fixed;
343
- inset: 0;
344
- z-index: var(--schmancy-overlay-z, 10000);
345
- display: none;
346
- pointer-events: none;
347
- }
348
- :host([active]) {
349
- display: block;
350
- }
351
- .shell {
352
- position: fixed;
353
- inset: 0;
354
- pointer-events: none;
355
- }
356
- .backdrop {
357
- position: fixed;
358
- inset: 0;
359
- background: color-mix(in srgb, var(--schmancy-sys-color-surface-container, rgba(12, 12, 16, 0.28)) 60%, transparent);
360
- backdrop-filter: blur(18px) saturate(150%);
361
- -webkit-backdrop-filter: blur(18px) saturate(150%);
362
- pointer-events: auto;
363
- }
364
- .surface {
365
- position: fixed;
366
- pointer-events: auto;
367
- max-width: calc(100vw - 2rem);
368
- max-height: 90dvh;
369
- overflow: auto;
370
- border-radius: var(--schmancy-sys-shape-corner-large, 16px);
371
- background: var(--schmancy-sys-color-surface, #ffffff);
372
- color: var(--schmancy-sys-color-on-surface, #1a1a1a);
373
- box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.35);
374
- }
375
- .surface[data-layout='centered'] {
376
- top: 50%;
377
- left: 50%;
378
- transform: translate(-50%, -50%);
379
- }
380
- .surface[data-layout='sheet'] {
381
- left: 0;
382
- right: 0;
383
- bottom: 0;
384
- max-width: none;
385
- width: 100%;
386
- border-radius: var(--schmancy-sys-shape-corner-large, 16px) var(--schmancy-sys-shape-corner-large, 16px) 0 0;
387
- padding-bottom: env(safe-area-inset-bottom);
388
- }
389
- .surface[data-layout='anchored'] {
390
- max-width: min(480px, calc(100vw - 2rem));
391
- box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.28);
392
- }
393
- /* Popover top-layer surfaces escape normal z-index — zero out host
394
- * display to avoid two surfaces rendering during transitions. */
395
- .surface:popover-open {
396
- margin: 0;
397
- border: 0;
398
- }
399
- @media (prefers-reduced-motion: reduce) {
400
- .surface {
401
- box-shadow: var(--schmancy-sys-elevation-2, 0 2px 6px rgba(0, 0, 0, 0.2));
402
- }
403
- }
404
- `];
405
- }
406
- get closed$() {
407
- return this._closed$.asObservable();
408
- }
409
- async open(e, t) {
410
- if (this._mounted) throw Error("schmancy-overlay: open() called twice on the same element");
411
- this._mounted = !0, this.dismissable = !1 !== t.dismissable, this._rawAnchor = t.anchor, this._anchorOriginAnchor = t.anchor, this._resolvedAnchor = function(e) {
412
- if (!e) return;
413
- if (typeof HTMLElement < "u" && e instanceof HTMLElement) return { el: e };
414
- if (typeof e.getBoundingClientRect == "function") return { virtual: { getBoundingClientRect: () => e.getBoundingClientRect() } };
415
- if (typeof e.width == "number" && typeof e.height == "number" && typeof e.left == "number" && typeof e.top == "number") {
416
- let t = e;
417
- return { virtual: { getBoundingClientRect: () => t } };
418
- }
419
- if (typeof e.clientX == "number" && typeof e.clientY == "number") {
420
- let t = e, n = q(t.clientX, t.clientY);
421
- return { virtual: { getBoundingClientRect: () => n } };
422
- }
423
- if (e.touches !== void 0 && e.touches.length > 0) {
424
- let t = e.touches[0], n = q(t.clientX, t.clientY);
425
- return { virtual: { getBoundingClientRect: () => n } };
426
- }
427
- let t = e, n = q(t.x, t.y);
428
- return { virtual: { getBoundingClientRect: () => n } };
429
- }(t.anchor), this._active = !0, this.setAttribute("active", ""), await this.updateComplete;
430
- let n = this.renderRoot.querySelector(`#${Z}`);
431
- if (!n) throw Error("schmancy-overlay: mount point missing");
432
- await $(e, n, t.props);
433
- let r = K(), i = {
434
- width: n.scrollWidth,
435
- height: n.scrollHeight
436
- };
437
- var a;
438
- if (this.layout = G({
439
- anchor: t.anchor,
440
- content: i,
441
- viewport: r
442
- }), this.modal = t.modal ?? (this.layout === "centered" || this.layout === "sheet"), this.tier = this.modal ? "modal" : this._resolvedAnchor ? (a = this._resolvedAnchor, J.popover && J.cssAnchor && a.el ? "css-anchor" : J.popover ? "popover-fui" : "fui-only") : "modal", await this.updateComplete, this.tier === "css-anchor" && this._resolvedAnchor?.el && this.shadowRoot) {
443
- this._positionerTeardown = function(e, t, n, r = { id: "" }) {
444
- if (!t.el) throw Error("positionCSSAnchor requires an element anchor");
445
- let i = t.el, a = `--ov-${r.id || Math.random().toString(36).slice(2, 10)}`, o = r.placement ?? "bottom-start", s = i.style.getPropertyValue("anchor-name");
446
- i.style.setProperty("anchor-name", a);
447
- let c = new CSSStyleSheet();
448
- return c.replaceSync(`\n\t\t${e.localName}[data-overlay-ref="${r.id}"] {\n\t\t\tposition-anchor: ${a};\n\t\t\t${function(e) {
449
- switch (e) {
450
- case "top":
451
- case "top-start": return "bottom: anchor(top); left: anchor(start);";
452
- case "top-end": return "bottom: anchor(top); right: anchor(end);";
453
- case "bottom":
454
- case "bottom-start": return "top: anchor(bottom); left: anchor(start);";
455
- case "bottom-end": return "top: anchor(bottom); right: anchor(end);";
456
- case "left":
457
- case "left-start": return "right: anchor(left); top: anchor(start);";
458
- case "left-end": return "right: anchor(left); bottom: anchor(end);";
459
- case "right":
460
- case "right-start": return "left: anchor(right); top: anchor(start);";
461
- case "right-end": return "left: anchor(right); bottom: anchor(end);";
462
- }
463
- }(o)}\n\t\t\tmargin: 8px;\n\t\t\tposition-try-fallbacks:\n\t\t\t\tflip-block,\n\t\t\t\tflip-inline,\n\t\t\t\tflip-block flip-inline;\n\t\t}\n\t`), e.dataset.overlayRef = r.id, n.adoptedStyleSheets = [...n.adoptedStyleSheets, c], () => {
464
- s ? i.style.setProperty("anchor-name", s) : i.style.removeProperty("anchor-name"), n.adoptedStyleSheets = n.adoptedStyleSheets.filter((e) => e !== c), delete e.dataset.overlayRef;
465
- };
466
- }(this._surface, this._resolvedAnchor, this.shadowRoot, {
467
- id: `ov-${Math.random().toString(36).slice(2, 10)}`,
468
- placement: t.preferredPlacement ?? "bottom-start"
469
- });
470
- let e = Y(this._surface), n = this._positionerTeardown;
471
- this._positionerTeardown = () => {
472
- e(), n();
473
- };
474
- } else if (this.tier === "popover-fui" && this._resolvedAnchor) {
475
- let e = Y(this._surface), n = X(this._surface, this._resolvedAnchor, {
476
- placement: t.preferredPlacement ?? "bottom-start",
477
- offsetPx: 8,
478
- track: !1 !== t.track
479
- }).pipe(w(this.disconnecting)).subscribe();
480
- this._positionerTeardown = () => {
481
- e(), n.unsubscribe();
482
- };
483
- } else if (this.tier === "fui-only" && this._resolvedAnchor) {
484
- let e = X(this._surface, this._resolvedAnchor, {
485
- placement: t.preferredPlacement ?? "bottom-start",
486
- offsetPx: 8,
487
- track: !1 !== t.track
488
- }).pipe(w(this.disconnecting)).subscribe();
489
- this._positionerTeardown = () => e.unsubscribe();
490
- }
491
- this.setAnchorOriginVars(), this.wireFocusTrap(), this.wireCloseTriggers(t.signal), this.wireResizeObserver(n), await this.playEnterAnimations();
492
- }
493
- async close(e, t) {
494
- if (!this._closing && this._mounted) {
495
- this._closing = !0;
496
- try {
497
- await this.playExitAnimations();
498
- } catch {}
499
- if (this.releaseFocusTrap(), this._positionerTeardown) {
500
- try {
501
- this._positionerTeardown();
502
- } catch {}
503
- this._positionerTeardown = void 0;
504
- }
505
- this._active = !1, this.removeAttribute("active"), this._closed$.next({
506
- reason: e,
507
- result: t
508
- }), this._closed$.complete();
509
- }
510
- }
511
- render() {
512
- return this._active ? A`
513
- <div class="shell" part="shell">
514
- ${M(this.modal, () => A`<div class="backdrop" part="backdrop" @click=${this.onBackdropClick}></div>`)}
515
- <section
516
- class="surface"
517
- part="surface"
518
- data-layout=${this.layout}
519
- data-tier=${this.tier}
520
- role=${this.modal ? "dialog" : "region"}
521
- aria-modal=${this.modal ? "true" : "false"}
522
- tabindex="-1"
523
- >
524
- <div id=${Z}></div>
525
- </section>
526
- </div>
527
- ` : A``;
528
- }
529
- setAnchorOriginVars() {
530
- let e = this._surface;
531
- if (!e) return;
532
- let t = e.getBoundingClientRect(), n = this.layout !== "centered" || this._anchorOriginAnchor ? this.layout !== "sheet" || this._anchorOriginAnchor ? function(e, t) {
533
- if (!e) return {
534
- [B]: "50%",
535
- [V]: "50%"
536
- };
537
- let { x: n, y: r } = function(e) {
538
- if (typeof e.getBoundingClientRect == "function") {
539
- let t = e.getBoundingClientRect();
540
- return {
541
- x: t.left + t.width / 2,
542
- y: t.top + t.height / 2
543
- };
544
- }
545
- if (typeof e.width == "number" && typeof e.height == "number" && typeof e.left == "number" && typeof e.top == "number") {
546
- let t = e;
547
- return {
548
- x: t.left + t.width / 2,
549
- y: t.top + t.height / 2
550
- };
551
- }
552
- if (typeof e.clientX == "number" && typeof e.clientY == "number") {
553
- let t = e;
554
- return {
555
- x: t.clientX,
556
- y: t.clientY
557
- };
558
- }
559
- if (e.touches !== void 0 && e.touches.length > 0) {
560
- let t = e.touches[0];
561
- return {
562
- x: t.clientX,
563
- y: t.clientY
564
- };
565
- }
566
- let t = e;
567
- return {
568
- x: t.x,
569
- y: t.y
570
- };
571
- }(e);
572
- if (!t.width || !t.height) return {
573
- [B]: "50%",
574
- [V]: "50%"
575
- };
576
- let i = U((n - t.left) / t.width * 100), a = U((r - t.top) / t.height * 100);
577
- return {
578
- [B]: `${i}%`,
579
- [V]: `${a}%`
580
- };
581
- }(this._anchorOriginAnchor, t) : {
582
- "--schmancy-overlay-origin-x": "50%",
583
- "--schmancy-overlay-origin-y": "100%"
584
- } : {
585
- "--schmancy-overlay-origin-x": "50%",
586
- "--schmancy-overlay-origin-y": "50%"
587
- };
588
- for (let [t, r] of Object.entries(n)) e.style.setProperty(t, r);
589
- }
590
- wireFocusTrap() {
591
- if (!this.modal) return;
592
- this._lastFocusedElement = document.activeElement ?? null;
593
- let e = this.parentElement;
594
- if (e) {
595
- this._inertedSiblings = [];
596
- for (let t of Array.from(e.children)) t !== this && t instanceof HTMLElement && !t.inert && (t.inert = !0, this._inertedSiblings.push(t));
597
- }
598
- queueMicrotask(() => {
599
- (this._surface?.querySelector("[autofocus]") ?? this._surface)?.focus();
600
- });
601
- }
602
- releaseFocusTrap() {
603
- for (let e of this._inertedSiblings) e.inert = !1;
604
- this._inertedSiblings = [];
605
- try {
606
- this._lastFocusedElement?.focus?.();
607
- } catch {}
608
- this._lastFocusedElement = null;
609
- }
610
- wireCloseTriggers(e) {
611
- let t = this.disconnecting;
612
- b(this, "close").pipe(y((e) => e instanceof CustomEvent), T((e) => {
613
- e.stopPropagation(), this.close("structured", e.detail);
614
- }), w(t)).subscribe(), b(this, "submit").pipe(y((e) => {
615
- let t = e.target;
616
- return !!t && t.method === "dialog";
617
- }), T((e) => {
618
- e.preventDefault();
619
- let t = e.submitter?.value ?? "";
620
- this.close("native-submit", t);
621
- }), w(t)).subscribe(), this.tier === "modal" && b(document, "keydown").pipe(y((e) => e.key === "Escape"), T((e) => {
622
- this.dismissable ? (e.preventDefault(), this.close("escape")) : e.preventDefault();
623
- }), w(t)).subscribe(), this.tier !== "popover-fui" && this.tier !== "css-anchor" || b(this._surface, "toggle").pipe(y((e) => e.newState === "closed"), C(1), T(() => {
624
- this._closing || this.close("light-dismiss");
625
- }), w(t)).subscribe(), this.tier === "fui-only" && b(document, "pointerdown", { capture: !0 }).pipe(y((e) => {
626
- if (!this.dismissable) return !1;
627
- let t = e.composedPath()[0];
628
- return !!t && !this._surface?.contains(t) && !this._resolvedAnchor?.el?.contains(t);
629
- }), C(1), T(() => {
630
- this.close("backdrop");
631
- }), w(t)).subscribe(), this.layout === "sheet" && this.dismissable && ne({
632
- surface: this._surface,
633
- until$: S(t, this._closed$)
634
- }).pipe(C(1)).subscribe(() => {
635
- this.close("swipe");
636
- }), e && (e.aborted ? queueMicrotask(() => {
637
- this.close("abort");
638
- }) : b(e, "abort").pipe(C(1), T(() => {
639
- this.close("abort");
640
- }), w(t)).subscribe());
641
- }
642
- wireResizeObserver(e) {
643
- c(e).pipe(x((e) => {
644
- let t = e[0];
645
- if (!t) return null;
646
- let n = t.contentRect;
647
- return {
648
- w: n.width,
649
- h: n.height
650
- };
651
- }), y((e) => e !== null), ee((e, t) => e.w === t.w && e.h === t.h), v(80), w(S(this.disconnecting, this._closed$))).subscribe((e) => this.maybeReResolve(e));
652
- }
653
- async maybeReResolve(e) {
654
- if (this._closing) return;
655
- let t = K(), n = G({
656
- anchor: this._rawAnchor,
657
- content: {
658
- width: e.w,
659
- height: e.h
660
- },
661
- viewport: t
662
- });
663
- if (n === this.layout || performance.now() - this._lastReResolveAt < 600 || (a = this.layout, o = n, !(a === "centered" && o === "sheet" || a === "anchored" && o === "sheet"))) return;
664
- var a, o;
665
- let s = this._surface, c = s.getBoundingClientRect();
666
- this.layout = n, await this.updateComplete;
667
- let l = function(e, t) {
668
- return z ? {
669
- keyframes: [{ transform: "none" }, { transform: "none" }],
670
- options: {
671
- duration: 1,
672
- easing: "linear",
673
- fill: "forwards"
674
- }
675
- } : {
676
- keyframes: [{
677
- transform: `translate(${e.left - t.left}px, ${e.top - t.top}px) scale(${t.width > 0 ? e.width / t.width : 1}, ${t.height > 0 ? e.height / t.height : 1})`,
678
- transformOrigin: "top left"
679
- }, {
680
- transform: "none",
681
- transformOrigin: "top left"
682
- }],
683
- options: {
684
- duration: i.duration,
685
- easing: r(i),
686
- fill: "forwards"
687
- }
688
- };
689
- }(c, s.getBoundingClientRect());
690
- try {
691
- await s.animate(l.keyframes, l.options).finished;
692
- } catch {}
693
- this._lastReResolveAt = performance.now();
694
- }
695
- async playEnterAnimations() {
696
- let e = this._surface;
697
- if (!e) return;
698
- let t = W(this.layout, "in"), n = [e.animate(t.keyframes, t.options).finished.catch(() => {})], r = this._backdrop;
699
- this.modal && r && n.push(r.animate([{ opacity: 0 }, { opacity: 1 }], {
700
- duration: t.options.duration,
701
- easing: "ease-out",
702
- fill: "forwards"
703
- }).finished.catch(() => {})), await Promise.all(n);
704
- }
705
- async playExitAnimations() {
706
- let e = this._surface;
707
- if (!e) return;
708
- let t = W(this.layout, "out"), n = [e.animate(t.keyframes, t.options).finished.catch(() => {})], r = this._backdrop;
709
- this.modal && r && n.push(r.animate([{ opacity: 1 }, { opacity: 0 }], {
710
- duration: t.options.duration,
711
- easing: "ease-in",
712
- fill: "forwards"
713
- }).finished.catch(() => {})), await Promise.all(n);
714
- }
715
- };
716
- async function $(e, t, n) {
717
- if (typeof (r = e) == "object" && r !== null && "_$litType$" in r) return j(e, t), t;
718
- var r;
719
- if (e instanceof HTMLElement) return n && Object.assign(e, n), t.appendChild(e), e;
720
- if (function(e) {
721
- return typeof e == "function" && ("preload" in e || "_promise" in e);
722
- }(e)) return $((await e()).default, t, n);
723
- if (typeof e == "function") {
724
- let r = new e();
725
- return n && Object.assign(r, n), t.appendChild(r), r;
726
- }
727
- if (typeof e == "string") {
728
- let r = document.createElement(e);
729
- return n && Object.assign(r, n), t.appendChild(r), r;
730
- }
731
- throw Error("schmancy-overlay: unsupported content type");
732
- }
733
- t([E({
734
- type: String,
735
- reflect: !0
736
- })], Q.prototype, "layout", void 0), t([E({
737
- type: Boolean,
738
- reflect: !0
739
- })], Q.prototype, "dismissable", void 0), t([E({
740
- type: Boolean,
741
- reflect: !0
742
- })], Q.prototype, "modal", void 0), t([E({
743
- type: String,
744
- reflect: !0
745
- })], Q.prototype, "tier", void 0), t([O()], Q.prototype, "_active", void 0), t([D(".backdrop")], Q.prototype, "_backdrop", void 0), t([D(".surface")], Q.prototype, "_surface", void 0), Q = t([te("schmancy-overlay")], Q);
746
- export { Q as SchmancyOverlay, h as SchmancyOverlayPromptBody, m as confirm, d as dismissAll, n as lazy, p as openOverlays$, u as overlayEvents, l as prompt, f as show };
1
+ import { t as e } from "./lazy-D-bO2r4m.js";
2
+ import { a as t, i as n, n as r, o as i, r as a, t as o } from "./overlay.service-C8NwO4Bx.js";
3
+ import { t as s } from "./overlay-oxM9OLXP.js";
4
+ import { t as c } from "./overlay.confirm-body-D_P2e7l6.js";
5
+ export { s as SchmancyOverlay, c as SchmancyOverlayPromptBody, o as confirm, r as dismissAll, e as lazy, a as openOverlays$, n as overlayEvents, t as prompt, i as show };