@cloudlet/toast 1.1.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ function T(e) {
16
16
  return t;
17
17
  }
18
18
  var E = ".cloudlet-exit,.cloudlet-slide-out,.cloudlet-chrome-out,.cloudlet-heading-out,.cloudlet-body-out,.cloudlet-badge-out,.cloudlet-page-out", D = class extends y {
19
- #e = j(this);
19
+ #e = A(this);
20
20
  componentDidMount = this.#e.componentDidMount;
21
21
  getSnapshotBeforeUpdate = this.#e.getSnapshotBeforeUpdate;
22
22
  componentDidUpdate = this.#e.componentDidUpdate;
@@ -46,35 +46,35 @@ var E = ".cloudlet-exit,.cloudlet-slide-out,.cloudlet-chrome-out,.cloudlet-headi
46
46
  exitClip: " .cloudlet-stack > .cloudlet-exit > .cloudlet-shell > .cloudlet-clip",
47
47
  exitBg: " .cloudlet-stack > .cloudlet-exit > .cloudlet-shell > .cloudlet-bg",
48
48
  exitBadge: " .cloudlet-stack > .cloudlet-exit > .cloudlet-shell > .cloudlet-badge"
49
- }, O = (e) => Math.max(0, Math.min(1, e)), ne = (e) => e?.setAttribute("inert", ""), k = (e) => `${Math.round(e * 100) / 100}px`, re = (e, t) => t || e <= .01 ? "none" : `blur(${k(e)})`;
50
- function A(e, t, n) {
49
+ }, ne = 3e3, O = (e) => Math.max(0, Math.min(1, e)), re = (e) => e?.setAttribute("inert", ""), k = (e) => `${Math.round(e * 100) / 100}px`, ie = (e, t) => t || e <= .01 ? "none" : `blur(${k(e)})`;
50
+ function ae(e, t, n) {
51
51
  let r = parseFloat(e?.getPropertyValue(t) ?? "");
52
52
  return Number.isFinite(r) ? r : n;
53
53
  }
54
- function j(y) {
55
- let { bridge: x, lease: S, document: E } = y.props, D = E.defaultView, j = b(), oe = b(), se = b(), M = b(), N = b(), ce = b(), le = b(), P = b(), ue = b(), de = b(), F = s(x, S, E, () => y.props.options.announcements), fe = null, pe = null, me = null, he = !1, ge = null, I = {}, _e = !1, L = null, ve = !1, R = null, ye = y.props.options.motion?.overrides, z = u(ye), be = () => {
54
+ function A(y) {
55
+ let { bridge: x, lease: S, document: E } = y.props, D = E.defaultView, A = b(), se = b(), ce = b(), M = b(), N = b(), le = b(), ue = b(), P = b(), de = b(), fe = b(), pe = s(x, S, E, () => y.props.options.announcements), F = null, I = null, me = null, he = !1, ge = null, L = {}, _e = !1, R = null, ve = !1, z = null, ye = y.props.options.motion?.overrides, B = u(ye), be = () => {
56
56
  let e = y.props.options.motion?.overrides;
57
- e !== ye && (ye = e, z = u(e), R?.setConstants(z));
58
- }, B = !1, xe = !1, V = null, H = {
57
+ e !== ye && (ye = e, B = u(e), z?.setConstants(B));
58
+ }, V = !1, xe = !1, H = null, U = {
59
59
  width: 0,
60
60
  height: 0,
61
61
  bodyTop: 0
62
- }, Se = 0, Ce = -Infinity, U = {
62
+ }, Se = 0, Ce = -Infinity, W = {
63
63
  tailOffset: 4,
64
64
  tailScale: .9,
65
65
  pillHeight: 44
66
- }, W = !1, we = "instant", Te = /* @__PURE__ */ new Set(), G = 0, Ee = 2, K = null, De = null, Oe = !1, ke = null, q = null, Ae = !1, J = null, Y = null, X = null, je = /* @__PURE__ */ new WeakSet(), Me = [];
67
- function Ne(e, t, ...n) {
66
+ }, G = !1, we = "instant", Te = /* @__PURE__ */ new Set(), K = 0, Ee = 2, De = null, Oe = null, ke = !1, Ae = null, q = null, je = !1, J = null, Me = null, Y = null, X = !1, Ne, Pe = /* @__PURE__ */ new WeakSet(), Fe = [];
67
+ function Ie(e, t, ...n) {
68
68
  try {
69
69
  let t = e(...n);
70
70
  if (typeof t != "string") throw TypeError("Label formatter must return a string");
71
71
  return t;
72
72
  } catch (r) {
73
- return je.has(e) || (je.add(e), Me.push(r)), t(...n);
73
+ return Pe.has(e) || (Pe.add(e), Fe.push(r)), t(...n);
74
74
  }
75
75
  }
76
- function Pe() {
77
- for (let e of Me.splice(0)) x.reportDiagnostic(S, {
76
+ function Le() {
77
+ for (let e of Fe.splice(0)) x.reportDiagnostic(S, {
78
78
  code: "formatter-error",
79
79
  source: "Toaster.labels",
80
80
  message: "A label formatter failed",
@@ -85,16 +85,16 @@ function j(y) {
85
85
  scope: "host",
86
86
  reason: e,
87
87
  active: t
88
- }), Fe = (e) => {
89
- xe !== e && (xe = e, Z("hover", e), R?.setHover(e));
90
- }, Ie = (e) => {
91
- if (Le(e), !(D && e instanceof D.HTMLElement && !e.closest(".cloudlet-slot") && Q(e)) && !Q(fe)) {
88
+ }), Re = (e) => {
89
+ xe !== e && (xe = e, Z("hover", e), z?.setHover(e));
90
+ }, ze = (e) => {
91
+ if (Be(e), !(D && e instanceof D.HTMLElement && !e.closest(".cloudlet-slot") && Q(e)) && !Q(F)) {
92
92
  let e = E.activeElement;
93
- D && e instanceof D.HTMLElement && e.blur(), j.current?.focus({ preventScroll: !0 });
93
+ D && e instanceof D.HTMLElement && e.blur(), A.current?.focus({ preventScroll: !0 });
94
94
  }
95
95
  };
96
- function Le(e) {
97
- D && e instanceof D.HTMLElement && e !== E.body && !j.current?.contains(e) && (fe = e);
96
+ function Be(e) {
97
+ D && e instanceof D.HTMLElement && e !== E.body && !A.current?.contains(e) && (F = e);
98
98
  }
99
99
  function Q(e) {
100
100
  if (!e?.isConnected || e.closest("[hidden],[inert],[aria-hidden=\"true\"]") || e.matches(":disabled")) return !1;
@@ -104,19 +104,19 @@ function j(y) {
104
104
  }
105
105
  return e.focus({ preventScroll: !0 }), E.activeElement === e;
106
106
  }
107
- function Re() {
108
- if (Q(fe)) return !0;
107
+ function Ve() {
108
+ if (Q(F)) return !0;
109
109
  for (let e of E.querySelectorAll("button,a[href],input,select,textarea,summary,[tabindex]")) if (e.tabIndex >= 0 && !e.closest(".cloudlet-host") && Q(e)) return !0;
110
110
  let e = E.body.getAttribute("tabindex");
111
111
  E.body.setAttribute("tabindex", "-1");
112
112
  let t = Q(E.body);
113
113
  return e === null ? E.body.removeAttribute("tabindex") : E.body.setAttribute("tabindex", e), t;
114
114
  }
115
- let ze = (e) => {
116
- let t = !!e && !!j.current?.contains(e);
115
+ let He = (e) => {
116
+ let t = !!e && !!A.current?.contains(e);
117
117
  Z("focus", t), x.setFocused(S, t ? x.getSnapshot().presentation?.handle ?? null : null);
118
118
  };
119
- function Be() {
119
+ function Ue() {
120
120
  if (!_e || !D) return;
121
121
  let e = E.documentElement.clientWidth || D.innerWidth, t = E.documentElement.clientHeight || D.innerHeight, n = v(e, t, D.visualViewport);
122
122
  for (let e of [
@@ -126,27 +126,30 @@ function j(y) {
126
126
  "left",
127
127
  "width",
128
128
  "height"
129
- ]) I.viewport?.setProperty(`--cloudlet-viewport-${e}`, `${n[e]}px`);
129
+ ]) L.viewport?.setProperty(`--cloudlet-viewport-${e}`, `${n[e]}px`);
130
130
  }
131
- let Ve = () => j.current?.dataset.edge === "bottom", He = () => Ve() ? 1 : -1;
132
- function Ue(e) {
133
- let t = I, { reduced: n } = e, r = Math.max(0, e.width), i = Math.max(0, e.height), a = Math.min(Math.max(0, e.radius), r / 2, i / 2), o = Ve(), s = o ? H.height - i : 0;
131
+ let We = () => A.current?.dataset.edge === "bottom", Ge = () => We() ? 1 : -1, Ke = () => {
132
+ let e = A.current?.dataset.align;
133
+ return e === "left" ? 0 : e === "right" ? 1 : .5;
134
+ };
135
+ function qe(e) {
136
+ let t = L, { reduced: n } = e, r = Math.max(0, e.width), i = Math.max(0, e.height), a = Math.min(Math.max(0, e.radius), r / 2, i / 2), o = We(), s = o ? U.height - i : 0, c = Ke(), l = `translateX(${-c * 100}%)`, u = (U.width - r) * c;
134
137
  t.shell && (t.shell.opacity = String(O(e.opacity)), t.shell.transform = n ? "none" : `translate(${k(e.dragX)}, ${k(e.y + e.dragY)}) scale(${e.scale})`);
135
- let c = ce.current;
136
- if (c && (c.setAttribute("width", String(r)), c.setAttribute("height", String(i)), le.current?.setAttribute("d", m(r, i, a))), t.bg && (t.bg.borderRadius = k(a), t.bg.top = "0px", t.bg.bottom = "auto", t.bg.transform = `translateX(-50%) translateY(${k(s)})`), t.clip && (t.clip.clipPath = `path("${m(r, i, a, (H.width - r) / 2, s)}")`), t.badge) {
137
- let i = n ? 1 : z.badge.scale + (1 - z.badge.scale) * e.badge, a = (r / 2 - 10) * (Ae ? -1 : 1);
138
+ let d = le.current;
139
+ if (d && (d.setAttribute("width", String(r)), d.setAttribute("height", String(i)), ue.current?.setAttribute("d", m(r, i, a))), t.bg && (t.bg.borderRadius = k(a), t.bg.top = "0px", t.bg.bottom = "auto", t.bg.transform = `${l} translateY(${k(s)})`), t.clip && (t.clip.clipPath = `path("${m(r, i, a, u, s)}")`), t.badge) {
140
+ let i = n ? 1 : B.badge.scale + (1 - B.badge.scale) * e.badge, a = (je ? u + 10 : u + r - 10) - U.width / 2;
138
141
  t.badge.opacity = String(O(e.badge)), t.badge.transform = `translate(calc(${k(a)} - 50%), ${o ? "6px" : "-6px"}) scale(${i})`;
139
142
  }
140
- let l = o ? -1 : 1;
143
+ let f = o ? -1 : 1;
141
144
  for (let n of [1, 2]) {
142
145
  let a = t[`tail${n}`];
143
146
  if (!a) continue;
144
147
  let o = e[`tail${n}`];
145
- a.width = k(r), a.height = k(Math.min(i, U.pillHeight)), a.opacity = String(O(e[`tail${n}Opacity`])), a.transform = `translateX(-50%) translateY(${k(l * o * (U.tailOffset + z.hoverLift * e.lift))}) scale(${U.tailScale ** +o})`;
148
+ a.width = k(r), a.height = k(Math.min(i, W.pillHeight)), a.opacity = String(O(e[`tail${n}Opacity`])), a.transform = `${l} translateY(${k(f * o * (W.tailOffset + B.hoverLift * e.lift))}) scale(${W.tailScale ** +o})`;
146
149
  }
147
- t.slideOut && (t.slideOut.transform = n ? "none" : `translateX(${k(e.slide - e.slideDirection * e.slideWidth)})`, t.slideOut.opacity = String(O(e.slideOut))), t.peek && (t.peek.width = k(H.width), t.peek.top = k(H.bodyTop), t.peek.transform = `translateX(${k(e.slide + (J?.side ?? 0) * H.width)})`);
148
- let u = n ? "none" : `translate(${k(e.headX)}, ${k(e.headY)})`;
149
- t.headerIn && (t.headerIn.transform = u), t.headerOut && (t.headerOut.transform = u);
150
+ t.slideOut && (t.slideOut.transform = n ? "none" : `translateX(${k(e.slide - e.slideDirection * e.slideWidth)})`, t.slideOut.opacity = String(O(e.slideOut))), t.peek && (t.peek.width = k(U.width), t.peek.top = k(U.bodyTop), t.peek.transform = `translateX(${k(e.slide + (J?.side ?? 0) * U.width)})`);
151
+ let p = n ? "none" : `translate(${k(e.headX)}, ${k(e.headY)})`;
152
+ t.headerIn && (t.headerIn.transform = p), t.headerOut && (t.headerOut.transform = p);
150
153
  for (let [r, i] of [
151
154
  [t.headerIn, e.headerIn],
152
155
  [t.headerOut, e.headerOut],
@@ -154,38 +157,38 @@ function j(y) {
154
157
  [t.badgeOut, e.badgeOut],
155
158
  [t.pageIn, e.pageIn],
156
159
  [t.pageOut, e.pageOut]
157
- ]) r && (r.opacity = String(O(i)), r.filter = re((1 - O(i)) * z.blur, n));
158
- t.chrome && (t.chrome.opacity = String(O(e.chrome)), t.chrome.transform = n ? "none" : `translateY(${k((1 - O(e.chrome)) * z.chromeOffset)})`), t.chromeOut && (t.chromeOut.opacity = String(O(e.chromeOut))), t.body && (t.body.opacity = String(O(e.chrome) * O(e.bodyIn) * O(e.slideIn)), t.body.transform = n ? "none" : `translateX(${k(e.slide)}) translateY(${k((1 - O(e.chrome)) * z.chromeOffset + (1 - O(e.bodyIn)) * z.bodyOffset)})`), t.bodyOut && (t.bodyOut.opacity = String(O(e.bodyOut))), t.exit && (t.exit.opacity = String(O(e.exitOpacity)), t.exit.transform = n ? "translateX(-50%)" : `translateX(-50%) translate(${k(e.exitX)}, ${k(e.exitY)}) scale(${e.exitScale})`), Oe && K?.isConnected && K.setAttribute("stroke-dasharray", `${Math.round(e.progress * 1e4) / 100} 100`);
160
+ ]) r && (r.opacity = String(O(i)), r.filter = ie((1 - O(i)) * B.blur, n));
161
+ t.chrome && (t.chrome.opacity = String(O(e.chrome)), t.chrome.transform = n ? "none" : `translateY(${k((1 - O(e.chrome)) * B.chromeOffset)})`), t.chromeOut && (t.chromeOut.opacity = String(O(e.chromeOut))), t.body && (t.body.opacity = String(O(e.chrome) * O(e.bodyIn) * O(e.slideIn)), t.body.transform = n ? "none" : `translateX(${k(e.slide)}) translateY(${k((1 - O(e.chrome)) * B.chromeOffset + (1 - O(e.bodyIn)) * B.bodyOffset)})`), t.bodyOut && (t.bodyOut.opacity = String(O(e.bodyOut))), t.exit && (t.exit.opacity = String(O(e.exitOpacity)), t.exit.transform = n ? l : `${l} translate(${k(e.exitX)}, ${k(e.exitY)}) scale(${e.exitScale})`), ke && De?.isConnected && De.setAttribute("stroke-dasharray", `${Math.round(e.progress * 1e4) / 100} 100`);
159
162
  }
160
- function We() {
161
- let e = se.current, t = N.current, n = _(y.props.snapshot).presented;
162
- if (!e || !t || !D || !R || !n) {
163
- W = !1;
163
+ function Je() {
164
+ let e = ce.current, t = N.current, n = _(y.props.snapshot).presented;
165
+ if (!e || !t || !D || !z || !n) {
166
+ G = !1;
164
167
  return;
165
168
  }
166
169
  let r = e.getBoundingClientRect();
167
- if (W = r.width > 0 && r.height > 0, Ke(n), !W) return;
168
- let i = D.getComputedStyle(j.current);
169
- U = {
170
- tailOffset: A(i, "--cloudlet-tail-offset", 4),
171
- tailScale: A(i, "--cloudlet-tail-scale", .9),
172
- pillHeight: A(i, "--cloudlet-pill-height", 44)
170
+ if (G = r.width > 0 && r.height > 0, Xe(n), !G) return;
171
+ let i = D.getComputedStyle(A.current);
172
+ W = {
173
+ tailOffset: ae(i, "--cloudlet-tail-offset", 4),
174
+ tailScale: ae(i, "--cloudlet-tail-scale", .9),
175
+ pillHeight: ae(i, "--cloudlet-pill-height", 44)
173
176
  };
174
177
  let a = y.props.snapshot.island.open, o = parseFloat(D.getComputedStyle(t).borderTopLeftRadius), s = Math.min(Number.isFinite(o) ? o : a ? 24 : r.height / 2, r.height / 2, r.width / 2);
175
- H = {
178
+ U = {
176
179
  width: r.width,
177
180
  height: r.height,
178
181
  bodyTop: $()?.offsetTop ?? 0
179
- }, R.setShape({
182
+ }, z.setShape({
180
183
  width: r.width,
181
184
  height: r.height,
182
185
  radius: s
183
- }, we), we = "close", Ge();
186
+ }, we), we = "close", Ye();
184
187
  }
185
- function Ge() {
188
+ function Ye() {
186
189
  let e = $();
187
190
  if (!e) return;
188
- let t = $e()?.querySelector("[data-cloudlet-title]")?.id;
191
+ let t = rt()?.querySelector("[data-cloudlet-title]")?.id;
189
192
  if (e.scrollHeight - e.clientHeight > 1 && t) e.tabIndex = 0, e.setAttribute("role", "group"), e.setAttribute("aria-labelledby", t);
190
193
  else for (let t of [
191
194
  "tabindex",
@@ -193,160 +196,160 @@ function j(y) {
193
196
  "aria-labelledby"
194
197
  ]) e.removeAttribute(t);
195
198
  }
196
- function Ke(e) {
197
- let t = e && !W && x.getSnapshot().presentation?.readable ? e.handle : null;
198
- t !== ke && (ke && x.setPause(S, {
199
+ function Xe(e) {
200
+ let t = e && !G && x.getSnapshot().presentation?.readable ? e.handle : null;
201
+ t !== Ae && (Ae && x.setPause(S, {
199
202
  scope: "notification",
200
- handle: ke,
203
+ handle: Ae,
201
204
  reason: "content-transition",
202
205
  active: !1
203
- }), ke = t, t && x.setPause(S, {
206
+ }), Ae = t, t && x.setPause(S, {
204
207
  scope: "notification",
205
208
  handle: t,
206
209
  reason: "content-transition",
207
210
  active: !0
208
211
  }));
209
212
  }
210
- function qe() {
213
+ function Ze() {
211
214
  let e = x.getSnapshot().presentation;
212
215
  if (!e?.token || e.readable || Te.size) return;
213
216
  let t = M.current?.querySelector(`[data-cloudlet-presented="${e.handle.generation}"]`), n = t?.getBoundingClientRect();
214
- t && W && n?.width && n.height && D?.getComputedStyle(t).visibility !== "hidden" && x.acknowledgePresentation(S, e.handle, e.token);
217
+ t && G && n?.width && n.height && D?.getComputedStyle(t).visibility !== "hidden" && x.acknowledgePresentation(S, e.handle, e.token);
215
218
  }
216
- let Je = (e) => (Te.add(e), () => {
217
- Te.delete(e), qe();
218
- }), Ye = () => {
219
- Be(), We(), qe();
219
+ let Qe = (e) => (Te.add(e), () => {
220
+ Te.delete(e), Ze();
221
+ }), $e = () => {
222
+ Ue(), Je(), Ze();
220
223
  };
221
- function Xe() {
222
- let e = j.current;
224
+ function et() {
225
+ let e = A.current;
223
226
  return (y.props.snapshot.island.open ? e?.querySelector(".cloudlet-slide [data-cloudlet-title]") : null) ?? e?.querySelector("[data-cloudlet-pill]") ?? null;
224
227
  }
225
- function Ze() {
228
+ function tt() {
226
229
  let e = y.props.snapshot.focusRequest;
227
230
  if (!e || x.getSnapshot().focusRequest?.token !== e.token) return;
228
- let t = j.current, n = e.target, r = null;
229
- n.kind === "anchor" ? r = t : n.kind === "overflow" ? r = t?.querySelector("[data-cloudlet-overflow]") ?? t?.querySelector("[data-cloudlet-pill]") ?? null : n.kind === "notification" && (r = M.current?.querySelector(`[data-cloudlet-presented="${n.handle.generation}"]`) ? n.control ? M.current.querySelector(`[data-cloudlet-control="${n.control}"]`) : Xe() : null), Le(E.activeElement);
231
+ let t = A.current, n = e.target, r = null;
232
+ n.kind === "anchor" ? r = t : n.kind === "overflow" ? r = t?.querySelector("[data-cloudlet-overflow]") ?? t?.querySelector("[data-cloudlet-pill]") ?? null : n.kind === "notification" && (r = M.current?.querySelector(`[data-cloudlet-presented="${n.handle.generation}"]`) ? n.control ? M.current.querySelector(`[data-cloudlet-control="${n.control}"]`) : et() : null), Be(E.activeElement);
230
233
  let i = Q(r);
231
234
  x.acknowledgeFocus(S, e.token, i ? "focused" : "unavailable");
232
235
  }
233
- function Qe(e) {
236
+ function nt(e) {
234
237
  e?.replaceChildren();
235
238
  }
236
- function $e() {
239
+ function rt() {
237
240
  return M.current?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-header > .cloudlet-heading") ?? null;
238
241
  }
239
242
  function $() {
240
243
  return M.current?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-body") ?? null;
241
244
  }
242
- function et(e) {
245
+ function it(e) {
243
246
  let t = M.current, n = N.current;
244
- if (!t || !n || !W) return {};
247
+ if (!t || !n || !G) return {};
245
248
  let r = {};
246
- (e.presence === "exit" || e.presence === "rise" || e.presence === "replace") && (r.exit = T(t), I.exitClip && (I.exitClip.clipPath = I.clip?.clipPath ?? ""), I.exitBg && (I.exitBg.borderRadius = I.bg?.borderRadius ?? ""), I.exitBadge && (I.exitBadge.opacity = I.badge?.opacity ?? "", I.exitBadge.transform = I.badge?.transform ?? ""), I.exit && (I.exit.width = k(H.width)));
249
+ (e.presence === "exit" || e.presence === "rise" || e.presence === "replace") && (r.exit = T(t), L.exitClip && (L.exitClip.clipPath = L.clip?.clipPath ?? ""), L.exitBg && (L.exitBg.borderRadius = L.bg?.borderRadius ?? ""), L.exitBadge && (L.exitBadge.opacity = L.badge?.opacity ?? "", L.exitBadge.transform = L.badge?.transform ?? ""), L.exit && (L.exit.width = k(U.width)));
247
250
  let i = $();
248
- if (e.slide && i && (r.slide = T(i), Se = i.offsetTop, I.slideOut && (I.slideOut.width = k(H.width))), e.morph === "close") {
251
+ if (e.slide && i && (r.slide = T(i), Se = i.offsetTop, L.slideOut && (L.slideOut.width = k(U.width))), e.morph === "close") {
249
252
  let e = T(n);
250
- e.querySelector(".cloudlet-header")?.classList.add("cloudlet-ghost"), r.chrome = e, I.chromeOut && (I.chromeOut.width = k(H.width));
253
+ e.querySelector(".cloudlet-header")?.classList.add("cloudlet-ghost"), r.chrome = e, L.chromeOut && (L.chromeOut.width = k(U.width));
251
254
  }
252
- let a = $e();
255
+ let a = rt();
253
256
  e.header && a && (r.header = T(a));
254
- let o = $(), s = R?.now() ?? 0, c = e.body && s - Ce < (R?.constants.bodyQuiet ?? 0);
255
- e.body && (Ce = s), e.body && !e.slide && o && !c && !R?.swapping("body") && (r.body = T(o), I.bodyOut && (I.bodyOut.top = k(o.offsetTop)));
257
+ let o = $(), s = z?.now() ?? 0, c = e.body && s - Ce < (z?.constants.bodyQuiet ?? 0);
258
+ e.body && (Ce = s), e.body && !e.slide && o && !c && !z?.swapping("body") && (r.body = T(o), L.bodyOut && (L.bodyOut.top = k(o.offsetTop)));
256
259
  let l = t.querySelector(":scope > .cloudlet-badge > .cloudlet-badge-value");
257
260
  e.badge && l && (r.badge = T(l));
258
261
  let u = n.querySelector(":scope > .cloudlet-indicator > .cloudlet-page > .cloudlet-page-value");
259
262
  return e.page && u && (r.page = T(u)), r;
260
263
  }
261
- function tt(e, t) {
262
- let n = M.current, r = e === "exit" ? P.current : e === "slide" ? ue.current : e === "chrome" ? de.current : e === "header" ? n?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-header > .cloudlet-heading-out") : e === "body" ? n?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-body-out") : e === "badge" ? n?.querySelector(":scope > .cloudlet-badge > .cloudlet-badge-out") : n?.querySelector(":scope > .cloudlet-clip > .cloudlet-indicator > .cloudlet-page > .cloudlet-page-out");
264
+ function at(e, t) {
265
+ let n = M.current, r = e === "exit" ? P.current : e === "slide" ? de.current : e === "chrome" ? fe.current : e === "header" ? n?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-header > .cloudlet-heading-out") : e === "body" ? n?.querySelector(":scope > .cloudlet-clip > .cloudlet-slide > .cloudlet-body-out") : e === "badge" ? n?.querySelector(":scope > .cloudlet-badge > .cloudlet-badge-out") : n?.querySelector(":scope > .cloudlet-clip > .cloudlet-indicator > .cloudlet-page > .cloudlet-page-out");
263
266
  return r ? (r.setAttribute("inert", ""), r.replaceChildren(t), r) : null;
264
267
  }
265
- function nt(e, t, n) {
266
- if (!R) return;
268
+ function ot(e, t, n) {
269
+ if (!z) return;
267
270
  let r = n?.plan ?? g(e, t);
268
- rt(t);
271
+ st(t);
269
272
  let i = {};
270
- for (let [e, t] of Object.entries(n?.clones ?? {})) i[e] = tt(e, t);
271
- let a = (e) => () => Qe(i[e]), o = () => {
272
- G && (G = 0, y.forceUpdate());
273
- }, s = () => Qe(P.current);
274
- r.presence === "enter" ? we = "instant" : r.morph === "open" && (we = "open"), We();
275
- let c = n?.heading, l = c && r.morph !== "none" ? $e()?.getBoundingClientRect() : null;
276
- c && l && R.shiftHeading(c.left - l.left, c.top - l.top, r.morph === "open" ? "open" : "close");
277
- let u = He(), d = X && e.presented?.handle === X.handle && !t.stack.includes(X.handle) ? X : void 0;
278
- X && !t.stack.includes(X.handle) && (X = null), (r.presence === "exit" || r.presence === "rise" || r.presence === "replace") && (i.exit ? R.exit(u, s, d) : d && R.release("dragX", 0), r.presence === "exit" && R.hide()), (r.presence === "enter" || r.presence === "replace") && (R.enter(u, Je("presence")), r.presence === "enter" && (R.setTails(t.depth, "settle", 0, o), t.open ? R.open() : R.setBadge(t.badge))), r.presence === "rise" && (R.rise(-u * U.tailOffset, U.tailScale, Je("presence")), R.swap("header", Je("header"), !0)), (r.tails === "arrival" || r.tails === "rise" || r.tails === "settle") && (t.depth < e.depth && (G = Math.max(G, e.depth)), R.setTails(t.depth, r.tails, e.depth, o)), r.morph === "open" ? (G = Math.max(G, e.depth), R.open(o)) : r.morph === "close" && R.collapse(t.depth, t.badge, {
273
+ for (let [e, t] of Object.entries(n?.clones ?? {})) i[e] = at(e, t);
274
+ let a = (e) => () => nt(i[e]), o = () => {
275
+ K && (K = 0, y.forceUpdate());
276
+ }, s = () => nt(P.current);
277
+ r.presence === "enter" ? we = "instant" : r.morph === "open" && (we = "open"), Je();
278
+ let c = n?.heading, l = c && r.morph !== "none" ? rt()?.getBoundingClientRect() : null;
279
+ c && l && z.shiftHeading(c.left - l.left, c.top - l.top, r.morph === "open" ? "open" : "close");
280
+ let u = Ge(), d = Y && e.presented?.handle === Y.handle && !t.stack.includes(Y.handle) ? Y : void 0;
281
+ Y && !t.stack.includes(Y.handle) && (Y = null), (r.presence === "exit" || r.presence === "rise" || r.presence === "replace") && (i.exit ? z.exit(u, s, d) : d && z.release("dragX", 0), r.presence === "exit" && z.hide()), (r.presence === "enter" || r.presence === "replace") && (z.enter(u, Qe("presence")), r.presence === "enter" && (z.setTails(t.depth, "settle", 0, o), t.open ? z.open() : z.setBadge(t.badge))), r.presence === "rise" && (z.rise(-u * W.tailOffset, W.tailScale, Qe("presence")), z.swap("header", Qe("header"), !0)), (r.tails === "arrival" || r.tails === "rise" || r.tails === "settle") && (t.depth < e.depth && (K = Math.max(K, e.depth)), z.setTails(t.depth, r.tails, e.depth, o)), r.morph === "open" ? (K = Math.max(K, e.depth), z.open(o)) : r.morph === "close" && z.collapse(t.depth, t.badge, {
279
282
  chrome: a("chrome"),
280
283
  tails: o
281
284
  });
282
- let f = Ve() && n ? H.height - n.height : 0;
283
- if (I.slideOut && (I.slideOut.top = k(f + Se)), I.chromeOut && i.chrome && (I.chromeOut.top = k(f)), r.slide) {
284
- let e = Je("slide");
285
- R.slide(Ae ? -r.slide : r.slide, H.width, () => {
286
- Qe(i.slide), e();
285
+ let f = We() && n ? U.height - n.height : 0;
286
+ if (L.slideOut && (L.slideOut.top = k(f + Se)), L.chromeOut && i.chrome && (L.chromeOut.top = k(f)), r.slide) {
287
+ let e = Qe("slide");
288
+ z.slide(je ? -r.slide : r.slide, U.width, () => {
289
+ nt(i.slide), e();
287
290
  });
288
291
  }
289
292
  if (i.header) {
290
- let e = Je("header");
291
- R.swap("header", () => {
292
- Qe(i.header), e();
293
+ let e = Qe("header");
294
+ z.swap("header", () => {
295
+ nt(i.header), e();
293
296
  });
294
297
  }
295
- i.body && R.swap("body", a("body")), i.badge && R.swap("badge", a("badge")), i.page && R.swap("page", a("page")), !t.open && e.presented && t.presented && r.morph === "none" && R.setBadge(t.badge);
298
+ i.body && z.swap("body", a("body")), i.badge && z.swap("badge", a("badge")), i.page && z.swap("page", a("page")), !t.open && e.presented && t.presented && r.morph === "none" && z.setBadge(t.badge);
296
299
  let p = x.getSnapshot().presentation;
297
300
  r.begin && r.header && t.presented && p?.token && p.readable && p.handle === t.presented.handle && x.beginPresentation(S, t.presented.handle, p.token);
298
301
  }
299
- function rt(e) {
300
- let t = e.presented, n = t?.content.progress, r = $e()?.querySelector(":scope > .cloudlet-icon > .cloudlet-ring > .cloudlet-progress-fill") ?? null, i = n?.kind === "determinate", a = r !== K || t?.handle !== De || !Oe;
301
- K = r, De = t?.handle ?? null, Oe = i && !!r, R?.setProgress(i ? n.value : null, a);
302
+ function st(e) {
303
+ let t = e.presented, n = t?.content.progress, r = rt()?.querySelector(":scope > .cloudlet-icon > .cloudlet-ring > .cloudlet-progress-fill") ?? null, i = n?.kind === "determinate", a = r !== De || t?.handle !== Oe || !ke;
304
+ De = r, Oe = t?.handle ?? null, ke = i && !!r, z?.setProgress(i ? n.value : null, a);
302
305
  }
303
- function it(e) {
306
+ function ct(e) {
304
307
  (J?.handle !== e?.handle || J?.side !== e?.side) && (J = e, y.forceUpdate());
305
308
  }
306
- function at(e) {
309
+ function lt(e) {
307
310
  return {
308
- move: (e) => R?.drag("dragX", e),
311
+ move: (e) => z?.drag("dragX", e),
309
312
  end: (t, n) => {
310
- let r = f(t, n, H.width, {
313
+ let r = f(t, n, U.width, {
311
314
  negative: !0,
312
315
  positive: !0
313
316
  });
314
317
  if (r) {
315
- if (X = {
318
+ if (Y = {
316
319
  handle: e,
317
320
  direction: r,
318
- distance: H.width,
321
+ distance: U.width,
319
322
  velocity: n * 1e3
320
323
  }, x.dismiss(S, e, "swipe").status === "applied") return;
321
- X = null;
324
+ Y = null;
322
325
  }
323
- R?.release("dragX", n * 1e3);
326
+ z?.release("dragX", n * 1e3);
324
327
  },
325
- cancel: () => R?.release("dragX", 0)
328
+ cancel: () => z?.release("dragX", 0)
326
329
  };
327
330
  }
328
- function ot(e, t) {
331
+ function ut(e, t) {
329
332
  let n = y.props.snapshot.stack, r = n.indexOf(e);
330
- return r < 0 ? null : n[r + t * (Ae ? -1 : 1)] ?? null;
333
+ return r < 0 ? null : n[r + t * (je ? -1 : 1)] ?? null;
331
334
  }
332
- function st(e) {
335
+ function dt(e) {
333
336
  let t = (t) => {
334
- let n = t < 0 ? 1 : -1, r = t ? ot(e, n) : null;
335
- return it(r ? {
337
+ let n = t < 0 ? 1 : -1, r = t ? ut(e, n) : null;
338
+ return ct(r ? {
336
339
  handle: r,
337
340
  side: n
338
- } : null), r ? Math.max(-H.width, Math.min(H.width, t)) : p(t, H.width);
339
- }, n = (e) => R?.release("slide", e, () => it(null));
341
+ } : null), r ? Math.max(-U.width, Math.min(U.width, t)) : p(t, U.width);
342
+ }, n = (e) => z?.release("slide", e, () => ct(null));
340
343
  return {
341
- move: (e) => R?.drag("slide", t(e)),
344
+ move: (e) => z?.drag("slide", t(e)),
342
345
  end: (t, r) => {
343
- let i = f(t, r, H.width, {
344
- negative: !!ot(e, 1),
345
- positive: !!ot(e, -1)
346
- }), a = i ? ot(e, i < 0 ? 1 : -1) : null;
346
+ let i = f(t, r, U.width, {
347
+ negative: !!ut(e, 1),
348
+ positive: !!ut(e, -1)
349
+ }), a = i ? ut(e, i < 0 ? 1 : -1) : null;
347
350
  if (a) {
348
351
  let e = J;
349
- if (J = null, R?.fling("slide", r * 1e3), x.navigate(S, a).status === "applied") return;
352
+ if (J = null, z?.fling("slide", r * 1e3), x.navigate(S, a).status === "applied") return;
350
353
  J = e;
351
354
  }
352
355
  n(J ? r * 1e3 : 0);
@@ -354,24 +357,24 @@ function j(y) {
354
357
  cancel: () => n(0)
355
358
  };
356
359
  }
357
- function ct() {
358
- let e = Ve() ? 1 : -1, t = (t) => p(t, t * e > 0 ? H.height : c.swipe.minDistance);
360
+ function ft() {
361
+ let e = We() ? 1 : -1, t = (t) => p(t, t * e > 0 ? U.height : c.swipe.minDistance);
359
362
  return {
360
- move: (e) => R?.drag("dragY", t(e)),
363
+ move: (e) => z?.drag("dragY", t(e)),
361
364
  end: (t, n) => {
362
- R?.release("dragY", 0);
363
- let r = Math.min(H.height, c.swipe.edge / c.swipe.distance);
365
+ z?.release("dragY", 0);
366
+ let r = Math.min(U.height, c.swipe.edge / c.swipe.distance);
364
367
  f(t, n, r, {
365
368
  negative: e < 0,
366
369
  positive: e > 0
367
370
  }) && x.collapseIsland(S);
368
371
  },
369
- cancel: () => R?.release("dragY", 0)
372
+ cancel: () => z?.release("dragY", 0)
370
373
  };
371
374
  }
372
- function lt(e, t) {
375
+ function pt(e, t) {
373
376
  let n = M.current, r = N.current, { presented: i, open: a } = _(y.props.snapshot);
374
- if (B || !R || !W || !n || !r || !i || !n.contains(e)) return null;
377
+ if (V || !z || !G || !n || !r || !i || !n.contains(e)) return null;
375
378
  let o, s = !1;
376
379
  if (a ? (o = r.contains(e), s = o && t === "pointer" && !!e.closest(".cloudlet-clip > .cloudlet-slide > .cloudlet-header")) : o = t === "pointer" && !!e.closest("[data-cloudlet-pill]"), !o && !s) return null;
377
380
  let { handle: c } = i;
@@ -381,7 +384,7 @@ function j(y) {
381
384
  reason: "gesture",
382
385
  active: !0
383
386
  }).status === "rejected") return null;
384
- Y = {
387
+ Me = {
385
388
  handle: c,
386
389
  open: a
387
390
  };
@@ -389,9 +392,9 @@ function j(y) {
389
392
  return {
390
393
  x: o,
391
394
  y: s,
392
- start: (e) => a ? e === "x" ? st(c) : ct() : at(c),
395
+ start: (e) => a ? e === "x" ? dt(c) : ft() : lt(c),
393
396
  release() {
394
- l || (l = !0, Y = null, x.setPause(S, {
397
+ l || (l = !0, Me = null, x.setPause(S, {
395
398
  scope: "notification",
396
399
  handle: c,
397
400
  reason: "gesture",
@@ -400,36 +403,41 @@ function j(y) {
400
403
  }
401
404
  };
402
405
  }
403
- function ut() {
404
- let e = j.current, t = M.current;
406
+ function mt(e) {
407
+ let t = M.current;
408
+ return !!t && _(y.props.snapshot).open && t.contains(e);
409
+ }
410
+ function ht() {
411
+ let e = A.current, t = M.current;
405
412
  if (!e || !D || !t) return;
406
413
  _e = !0;
407
- let n = oe.current?.sheet, r = `[data-cloudlet-instance="${y.props.snapshot.controller}"]`;
414
+ let n = se.current?.sheet, r = `[data-cloudlet-instance="${y.props.snapshot.controller}"]`;
408
415
  if (n) for (let [e, t] of Object.entries(te)) {
409
416
  let i = n.insertRule(`${r}${t} {}`, n.cssRules.length);
410
- I[e] = n.cssRules[i].style;
417
+ L[e] = n.cssRules[i].style;
411
418
  }
412
419
  for (let e of [
413
420
  P.current,
414
- ue.current,
415
- de.current
421
+ de.current,
422
+ fe.current
416
423
  ]) e?.setAttribute("inert", "");
417
- F.mount(e), q = d(e, {
418
- begin: lt,
424
+ pe.mount(e), q = d(e, {
425
+ begin: pt,
426
+ claimsWheel: mt,
419
427
  now: () => D.performance.now()
420
428
  });
421
429
  let i = D.matchMedia?.("(prefers-reduced-motion: reduce)");
422
- B = i?.matches ?? !1, e.dataset.reducedMotion = String(B), R = l({
430
+ V = i?.matches ?? !1, e.dataset.reducedMotion = String(V), z = l({
423
431
  now: () => D.performance.now(),
424
432
  requestFrame: (e) => D.requestAnimationFrame(e),
425
433
  cancelFrame: (e) => D.cancelAnimationFrame(e),
426
- write: Ue,
427
- reducedMotion: B,
434
+ write: qe,
435
+ reducedMotion: V,
428
436
  timeScale: y.props.options.motion?.timeScale,
429
- constants: z
437
+ constants: B
430
438
  });
431
439
  let a = () => {
432
- B = i?.matches ?? !1, e.dataset.reducedMotion = String(B), B && q?.cancel(), R?.setReducedMotion(B);
440
+ V = i?.matches ?? !1, e.dataset.reducedMotion = String(V), V && q?.cancel(), z?.setReducedMotion(V);
433
441
  }, o = D.matchMedia?.("(min-width: 48rem)"), s = D.matchMedia?.("(prefers-color-scheme: dark)"), c = () => {
434
442
  (y.props.options.theme ?? "system") === "system" && y.forceUpdate();
435
443
  }, u = () => {
@@ -453,7 +461,7 @@ function j(y) {
453
461
  E,
454
462
  "pointerover",
455
463
  (t) => {
456
- xe && !(t.target instanceof D.Node && e.contains(t.target)) && Fe(!1);
464
+ xe && !(t.target instanceof D.Node && e.contains(t.target)) && Re(!1);
457
465
  },
458
466
  !0
459
467
  ],
@@ -470,7 +478,7 @@ function j(y) {
470
478
  [
471
479
  D,
472
480
  "resize",
473
- Ye
481
+ $e
474
482
  ]
475
483
  ];
476
484
  i && p.push([
@@ -488,57 +496,63 @@ function j(y) {
488
496
  ]), D.visualViewport && p.push([
489
497
  D.visualViewport,
490
498
  "resize",
491
- Ye
499
+ $e
492
500
  ], [
493
501
  D.visualViewport,
494
502
  "scroll",
495
- Be
503
+ Ue
496
504
  ]);
497
505
  for (let [e, t, n, r] of p) e.addEventListener(t, n, r);
498
506
  ge = () => {
499
507
  for (let [e, t, n, r] of p) e.removeEventListener(t, n, r);
500
- }, V = D.ResizeObserver ? new D.ResizeObserver(() => {
501
- We(), qe();
502
- }) : null, N.current && V?.observe(N.current), V?.observe(e), f(), Z("window-blur", !E.hasFocus()), ze(E.activeElement), Be(), Pe(), nt(h, _(y.props.snapshot), null), qe(), Ze();
508
+ }, H = D.ResizeObserver ? new D.ResizeObserver(() => {
509
+ Je(), Ze();
510
+ }) : null, N.current && H?.observe(N.current), H?.observe(e), f(), Z("window-blur", !E.hasFocus()), He(E.activeElement), Ue(), Le(), ot(h, _(y.props.snapshot), null), Ze(), tt();
503
511
  }
504
- function dt(e) {
512
+ function gt(e) {
505
513
  let t = _(e.snapshot), n = _(y.props.snapshot), r = g(t, n), i = {
506
514
  plan: r,
507
- clones: et(r),
508
- heading: r.morph !== "none" && W ? $e()?.getBoundingClientRect() ?? null : null,
509
- height: H.height
510
- }, a = pe;
511
- if (pe = null, me = null, a && e.snapshot.notifications.some((e) => e.handle === a) && !y.props.snapshot.notifications.some((e) => e.handle === a)) return i;
512
- let o = j.current, s = E.activeElement;
513
- if (!o || !D || !(s instanceof D.HTMLElement) || s === o || !o.contains(s) || ie(e.snapshot) === ie(y.props.snapshot)) return i;
515
+ clones: it(r),
516
+ heading: r.morph !== "none" && G ? rt()?.getBoundingClientRect() ?? null : null,
517
+ height: U.height
518
+ }, a = I;
519
+ if (I = null, me = null, a && e.snapshot.notifications.some((e) => e.handle === a) && !y.props.snapshot.notifications.some((e) => e.handle === a)) return i;
520
+ let o = A.current, s = E.activeElement;
521
+ if (!o || !D || !(s instanceof D.HTMLElement) || s === o || !o.contains(s) || j(e.snapshot) === j(y.props.snapshot) && xt(e) === xt(y.props)) return i;
514
522
  me = s;
515
523
  let c = y.props.snapshot;
516
- return he = !c.notifications.length && !c.overflow.pending, (!he || !Re()) && o.focus({ preventScroll: !0 }), i;
524
+ return he = !c.notifications.length && !c.overflow.pending, (!he || !Ve()) && o.focus({ preventScroll: !0 }), i;
517
525
  }
518
- function ft(e, t, n) {
526
+ function _t(e, t, n) {
519
527
  let r = me;
520
- me = null, he ? (he = !1, Re()) : r && !Q(r) && (Q(Xe() ?? j.current?.querySelector("[data-cloudlet-overflow]") ?? null) || j.current?.focus({ preventScroll: !0 })), R?.setTimeScale(y.props.options.motion?.timeScale), be();
528
+ me = null, he ? (he = !1, Ve()) : r && !Q(r) && (Q(et() ?? A.current?.querySelector("[data-cloudlet-overflow]") ?? null) || A.current?.focus({ preventScroll: !0 })), X && !xt(y.props) && yt(!1), z?.setTimeScale(y.props.options.motion?.timeScale), be();
521
529
  let i = _(y.props.snapshot);
522
- Y && (Y.handle !== i.presented?.handle || Y.open !== i.open) && q?.cancel(), J && (!i.open || !i.stack.includes(J.handle)) && (q?.cancel(), it(null)), e.snapshot === y.props.snapshot ? We() : nt(_(e.snapshot), i, n), Pe(), qe(), Ze(), ze(E.activeElement);
530
+ Me && (Me.handle !== i.presented?.handle || Me.open !== i.open) && q?.cancel(), J && (!i.open || !i.stack.includes(J.handle)) && (q?.cancel(), ct(null)), e.snapshot === y.props.snapshot ? Je() : ot(_(e.snapshot), i, n), Le(), Ze(), tt(), He(E.activeElement);
523
531
  }
524
- function pt() {
525
- q?.dispose(), q = null, J = null, X = null, F.dispose(), _e = !1, ge?.(), ge = null, V?.disconnect(), V = null, R?.dispose(), R = null, Te.clear();
526
- let e = oe.current?.sheet;
532
+ function vt() {
533
+ q?.dispose(), q = null, J = null, Y = null, yt(!1), pe.dispose(), _e = !1, ge?.(), ge = null, H?.disconnect(), H = null, z?.dispose(), z = null, Te.clear();
534
+ let e = se.current?.sheet;
527
535
  if (e) for (; e.cssRules.length;) e.deleteRule(0);
528
- I = {};
536
+ L = {};
529
537
  for (let e of [
530
538
  P.current,
531
- ue.current,
532
- de.current
533
- ]) Qe(e);
534
- K = null;
539
+ de.current,
540
+ fe.current
541
+ ]) nt(e);
542
+ De = null;
535
543
  let t = E.activeElement;
536
- j.current?.contains(t) && !Re() && t?.blur();
544
+ A.current?.contains(t) && !Ve() && t?.blur();
545
+ }
546
+ function yt(e = !0) {
547
+ D?.clearTimeout(Ne), Ne = void 0, X && (X = !1, e && _e && y.forceUpdate());
537
548
  }
538
- let mt = (e) => {
539
- pe = e, x.dismiss(S, e, "navigation").status !== "applied" && (pe = null);
549
+ function bt() {
550
+ X ? (yt(), x.clearAll(S)) : (X = !0, Ne = D?.setTimeout(yt, ne), y.forceUpdate());
551
+ }
552
+ let xt = (e) => e.options.clearAll !== !1 && _(e.snapshot).open && e.snapshot.stack.length > 1, St = (e) => {
553
+ I = e, x.dismiss(S, e, "navigation").status !== "applied" && (I = null);
540
554
  };
541
- function ht(e, t, n, r) {
555
+ function Ct(e, t, n, r) {
542
556
  if (e.defaultPrevented) return;
543
557
  let i = null;
544
558
  if (e.nativeEvent.isComposing) return;
@@ -551,22 +565,22 @@ function j(y) {
551
565
  let a = i === null ? void 0 : t[i];
552
566
  a && (e.preventDefault(), x.navigate(S, a));
553
567
  }
554
- function gt() {
568
+ function wt() {
555
569
  let { snapshot: s, options: c } = y.props, l = {
556
570
  ...i,
557
571
  ...c.labels
558
572
  }, u = s.controller ?? "cloudlet", d = c.dir ?? (E.documentElement.dir === "rtl" ? "rtl" : "ltr"), f = c.theme ?? "system";
559
- Ae = d === "rtl";
573
+ je = d === "rtl";
560
574
  let p = `${u}-island`, m = _(s), { presented: h, open: g, total: v, index: b, missed: T } = m;
561
575
  m.badge && (Ee = m.count);
562
- let te = g && J ? s.notifications.find((e) => e.handle === J.handle) : void 0, O = c.position ?? "auto", k = O === "bottom-center" || O === "auto" && D?.matchMedia?.("(min-width: 48rem)").matches === !1, re = Math.min(2, Math.max(m.depth, G)), A = h ? o(x, S, h.handle, Ie) : null, ie = Ne(l.page, i.page, b + 1, v), F = a(c.classNames);
563
- return /* @__PURE__ */ w(ee, { children: [c.offsets && /* @__PURE__ */ C(ae, {
576
+ let te = g && J ? s.notifications.find((e) => e.handle === J.handle) : void 0, ne = c.position ?? "auto", O = String(ne), k = O.startsWith("bottom-") || ne === "auto" && D?.matchMedia?.("(min-width: 48rem)").matches === !1, ie = O.endsWith("-left") ? "left" : O.endsWith("-right") ? "right" : "center", ae = Math.min(2, Math.max(m.depth, K)), j = h ? o(x, S, h.handle, ze) : null, pe = Ie(l.page, i.page, b + 1, v), F = Ie(l.clearAllConfirm, i.clearAllConfirm, v), I = a(c.classNames);
577
+ return /* @__PURE__ */ w(ee, { children: [c.offsets && /* @__PURE__ */ C(oe, {
564
578
  instance: u,
565
579
  offsets: c.offsets,
566
580
  nonce: c.nonce
567
581
  }, c.nonce ?? ""), /* @__PURE__ */ w("div", {
568
- ref: j,
569
- className: F("host", "cloudlet-host"),
582
+ ref: A,
583
+ className: I("host", "cloudlet-host"),
570
584
  role: "region",
571
585
  "aria-label": l.region,
572
586
  tabIndex: -1,
@@ -574,52 +588,53 @@ function j(y) {
574
588
  "data-cloudlet-instance": u,
575
589
  "data-theme": f,
576
590
  "data-resolved-theme": f === "system" ? D?.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light" : f,
577
- "data-position": O,
591
+ "data-position": ne,
578
592
  "data-edge": k ? "bottom" : "top",
593
+ "data-align": ie,
579
594
  "data-state": g ? "island" : "stack",
580
595
  "data-island-reason": s.island.reason ?? void 0,
581
596
  "data-overflow": s.overflow.pending,
582
597
  dir: d,
583
598
  onPointerDownCapture: (e) => {
584
- L = e.target.closest("button");
599
+ R = e.target.closest("button");
585
600
  },
586
601
  onPointerCancelCapture: () => {
587
- L = null;
602
+ R = null;
588
603
  },
589
604
  onKeyDownCapture: (e) => {
590
- (e.key === "Enter" || e.key === " ") && e.target.closest("button") && (ve = e.repeat, e.repeat ? e.preventDefault() : L = e.target.closest("button"));
605
+ (e.key === "Enter" || e.key === " ") && e.target.closest("button") && (ve = e.repeat, e.repeat ? e.preventDefault() : R = e.target.closest("button"));
591
606
  },
592
607
  onKeyUpCapture: () => {
593
608
  ve = !1;
594
609
  },
595
610
  onClickCapture: (e) => {
596
- let t = e.target.closest("button"), n = !!t?.matches("[data-cloudlet-control=\"action\"], [data-cloudlet-control=\"retry\"], [data-cloudlet-control=\"cancel\"]");
597
- t && (ve || n && e.detail > 1 || L && L !== t) && (e.preventDefault(), e.stopPropagation()), L = null;
611
+ let t = e.target.closest("button"), n = !!t?.matches("[data-cloudlet-control=\"action\"], [data-cloudlet-control=\"retry\"], [data-cloudlet-control=\"cancel\"], [data-cloudlet-control=\"clear\"]");
612
+ t && (ve || n && e.detail > 1 || R && R !== t) && (e.preventDefault(), e.stopPropagation()), R = null;
598
613
  },
599
614
  onFocus: (e) => {
600
- Le(e.relatedTarget), ze(E.activeElement);
615
+ Be(e.relatedTarget), He(E.activeElement);
601
616
  },
602
- onBlur: (e) => ze(D && e.relatedTarget instanceof D.Element ? e.relatedTarget : null),
603
- onMouseEnter: () => Fe(!0),
604
- onMouseLeave: () => Fe(!1),
617
+ onBlur: (e) => He(D && e.relatedTarget instanceof D.Element ? e.relatedTarget : null),
618
+ onMouseEnter: () => Re(!0),
619
+ onMouseLeave: () => Re(!1),
605
620
  children: [/* @__PURE__ */ C("style", {
606
- ref: oe,
621
+ ref: se,
607
622
  nonce: c.nonce,
608
623
  "data-cloudlet-motion": ""
609
624
  }), /* @__PURE__ */ w("div", {
610
- ref: se,
611
- className: F("stack", "cloudlet-stack"),
625
+ ref: ce,
626
+ className: I("stack", "cloudlet-stack"),
612
627
  "data-empty": !h,
613
628
  children: [
614
- [1, 2].filter((e) => e <= re).map((e) => /* @__PURE__ */ C("div", {
615
- className: F("tail", "cloudlet-tail"),
629
+ [1, 2].filter((e) => e <= ae).map((e) => /* @__PURE__ */ C("div", {
630
+ className: I("tail", "cloudlet-tail"),
616
631
  "data-cloudlet-tail": e,
617
632
  "aria-hidden": "true"
618
633
  }, e)),
619
634
  /* @__PURE__ */ w("div", {
620
635
  ref: M,
621
636
  id: p,
622
- className: F("island", "cloudlet-shell"),
637
+ className: I("island", "cloudlet-shell"),
623
638
  hidden: !h,
624
639
  "data-state": g ? "island" : "stack",
625
640
  "data-kind": h?.kind,
@@ -629,25 +644,25 @@ function j(y) {
629
644
  "aria-label": l.island,
630
645
  "aria-describedby": `${p}-hint`
631
646
  } : {},
632
- onKeyDown: g ? (e) => ht(e, s.stack, b, d === "rtl") : void 0,
647
+ onKeyDown: g ? (e) => Ct(e, s.stack, b, d === "rtl") : void 0,
633
648
  children: [
634
649
  /* @__PURE__ */ C("svg", {
635
- ref: ce,
650
+ ref: le,
636
651
  className: "cloudlet-bg",
637
652
  "aria-hidden": "true",
638
653
  focusable: "false",
639
- children: /* @__PURE__ */ C("path", { ref: le })
654
+ children: /* @__PURE__ */ C("path", { ref: ue })
640
655
  }),
641
656
  /* @__PURE__ */ w("div", {
642
657
  ref: N,
643
658
  className: "cloudlet-clip",
644
659
  children: [
645
660
  /* @__PURE__ */ C("div", {
646
- ref: ue,
661
+ ref: de,
647
662
  className: "cloudlet-slide-out",
648
663
  "aria-hidden": "true"
649
664
  }),
650
- h && A && /* @__PURE__ */ w("div", {
665
+ h && j && /* @__PURE__ */ w("div", {
651
666
  className: "cloudlet-slide",
652
667
  "data-cloudlet-presented": h.handle.generation,
653
668
  "data-kind": h.kind,
@@ -655,16 +670,16 @@ function j(y) {
655
670
  ...g ? {
656
671
  role: "group",
657
672
  "aria-roledescription": l.slide,
658
- "aria-label": ie
673
+ "aria-label": pe
659
674
  } : {},
660
675
  children: [
661
676
  /* @__PURE__ */ w("div", {
662
- className: F("header", "cloudlet-header"),
677
+ className: I("header", "cloudlet-header"),
663
678
  "aria-hidden": g ? void 0 : "true",
664
679
  children: [/* @__PURE__ */ C(t, {
665
680
  notification: h,
666
- slot: A,
667
- part: F,
681
+ slot: j,
682
+ part: I,
668
683
  titleId: `${p}-title`
669
684
  }), /* @__PURE__ */ C("div", {
670
685
  className: "cloudlet-heading-out",
@@ -677,9 +692,9 @@ function j(y) {
677
692
  bridge: x,
678
693
  lease: S,
679
694
  labels: l,
680
- navigate: mt,
681
- slot: A,
682
- part: F,
695
+ navigate: St,
696
+ slot: j,
697
+ part: I,
683
698
  titleId: `${p}-title`
684
699
  }),
685
700
  /* @__PURE__ */ C("div", {
@@ -689,44 +704,69 @@ function j(y) {
689
704
  ]
690
705
  }),
691
706
  te && /* @__PURE__ */ C("div", {
692
- ref: ne,
707
+ ref: re,
693
708
  className: "cloudlet-peek",
694
709
  "aria-hidden": "true",
695
710
  children: /* @__PURE__ */ C(n, {
696
711
  notification: te,
697
712
  labels: l,
698
- part: F
713
+ part: I
699
714
  })
700
715
  }),
701
- h && g && r(l, F, () => x.dismiss(S, h.handle, "close-button")),
716
+ h && g && r(l, I, () => x.dismiss(S, h.handle, "close-button")),
702
717
  g && (v > 1 || T > 0) && /* @__PURE__ */ w("div", {
703
- className: F("indicator", "cloudlet-indicator"),
704
- children: [v > 5 ? /* @__PURE__ */ w("p", {
705
- className: "cloudlet-page",
706
- "aria-hidden": "true",
707
- children: [/* @__PURE__ */ C("span", {
708
- className: "cloudlet-page-value",
709
- children: ie
710
- }), /* @__PURE__ */ C("span", { className: "cloudlet-page-out" })]
711
- }) : v > 1 && s.stack.map((e, t) => /* @__PURE__ */ C("button", {
712
- type: "button",
713
- className: "cloudlet-dot-button",
714
- "aria-current": t === b ? "true" : void 0,
715
- "aria-label": Ne(l.page, i.page, t + 1, v),
716
- onClick: () => x.navigate(S, e),
717
- children: /* @__PURE__ */ C("span", {
718
- className: "cloudlet-dot",
719
- "aria-hidden": "true"
720
- })
721
- }, e.generation)), T > 0 && /* @__PURE__ */ w("div", {
722
- className: F("overflow", "cloudlet-overflow"),
723
- children: [/* @__PURE__ */ C("p", { children: Ne(l.overflowCount, i.overflowCount, T) }), /* @__PURE__ */ C("button", {
718
+ className: I("indicator", "cloudlet-indicator"),
719
+ children: [
720
+ v > 5 ? /* @__PURE__ */ w("p", {
721
+ className: "cloudlet-page",
722
+ "aria-hidden": "true",
723
+ children: [/* @__PURE__ */ C("span", {
724
+ className: "cloudlet-page-value",
725
+ children: pe
726
+ }), /* @__PURE__ */ C("span", { className: "cloudlet-page-out" })]
727
+ }) : v > 1 && /* @__PURE__ */ C("div", {
728
+ className: "cloudlet-dots",
729
+ children: s.stack.map((e, t) => /* @__PURE__ */ C("button", {
730
+ type: "button",
731
+ className: "cloudlet-dot-button",
732
+ "aria-current": t === b ? "true" : void 0,
733
+ "aria-label": Ie(l.page, i.page, t + 1, v),
734
+ onClick: () => x.navigate(S, e),
735
+ children: /* @__PURE__ */ C("span", {
736
+ className: "cloudlet-dot",
737
+ "aria-hidden": "true"
738
+ })
739
+ }, e.generation))
740
+ }),
741
+ xt(y.props) && /* @__PURE__ */ w(ee, { children: [/* @__PURE__ */ w("button", {
724
742
  type: "button",
725
- "data-cloudlet-overflow": "",
726
- onClick: () => x.acknowledgeOverflow(S),
727
- children: l.acknowledgeOverflow
728
- })]
729
- })]
743
+ className: I("clear", "cloudlet-clear"),
744
+ "data-cloudlet-control": "clear",
745
+ "data-armed": X,
746
+ onClick: bt,
747
+ onBlur: () => yt(),
748
+ children: [/* @__PURE__ */ C("span", {
749
+ "aria-hidden": X || void 0,
750
+ children: l.clearAll
751
+ }), /* @__PURE__ */ C("span", {
752
+ "aria-hidden": !X || void 0,
753
+ children: F
754
+ })]
755
+ }), /* @__PURE__ */ C("span", {
756
+ role: "status",
757
+ className: "cloudlet-live",
758
+ children: X ? F : ""
759
+ })] }),
760
+ T > 0 && /* @__PURE__ */ w("div", {
761
+ className: I("overflow", "cloudlet-overflow"),
762
+ children: [/* @__PURE__ */ C("p", { children: Ie(l.overflowCount, i.overflowCount, T) }), /* @__PURE__ */ C("button", {
763
+ type: "button",
764
+ "data-cloudlet-overflow": "",
765
+ onClick: () => x.acknowledgeOverflow(S),
766
+ children: l.acknowledgeOverflow
767
+ })]
768
+ })
769
+ ]
730
770
  }),
731
771
  g && /* @__PURE__ */ C("span", {
732
772
  id: `${p}-hint`,
@@ -734,7 +774,7 @@ function j(y) {
734
774
  children: l.collapse
735
775
  }),
736
776
  /* @__PURE__ */ C("div", {
737
- ref: de,
777
+ ref: fe,
738
778
  className: "cloudlet-chrome-out",
739
779
  "aria-hidden": "true"
740
780
  })
@@ -742,15 +782,15 @@ function j(y) {
742
782
  }),
743
783
  h && !g && /* @__PURE__ */ C("button", {
744
784
  type: "button",
745
- className: F("pill", "cloudlet-pill"),
785
+ className: I("pill", "cloudlet-pill"),
746
786
  "data-cloudlet-pill": "",
747
787
  "aria-expanded": "false",
748
788
  "aria-controls": p,
749
789
  onClick: () => x.openIsland(S, "user"),
750
- "aria-label": [Ne(l.stackSummary, i.stackSummary, h.content.title, v, T), ...h.draft ? [l.draft] : []].join(", ")
790
+ "aria-label": [Ie(l.stackSummary, i.stackSummary, h.content.title, v, T), ...h.draft ? [l.draft] : []].join(", ")
751
791
  }),
752
792
  /* @__PURE__ */ w("span", {
753
- className: F("badge", "cloudlet-badge"),
793
+ className: I("badge", "cloudlet-badge"),
754
794
  "aria-hidden": "true",
755
795
  children: [/* @__PURE__ */ C("span", {
756
796
  className: "cloudlet-badge-value",
@@ -769,14 +809,14 @@ function j(y) {
769
809
  })] });
770
810
  }
771
811
  return {
772
- componentDidMount: ut,
773
- getSnapshotBeforeUpdate: dt,
774
- componentDidUpdate: ft,
775
- componentWillUnmount: pt,
776
- render: gt
812
+ componentDidMount: ht,
813
+ getSnapshotBeforeUpdate: gt,
814
+ componentDidUpdate: _t,
815
+ componentWillUnmount: vt,
816
+ render: wt
777
817
  };
778
818
  }
779
- function ie(e) {
819
+ function j(e) {
780
820
  let t = e.notifications.find((e) => e.location === "current");
781
821
  return [
782
822
  e.island.open,
@@ -790,7 +830,7 @@ function ie(e) {
790
830
  t?.operation?.canCancel
791
831
  ].join("|");
792
832
  }
793
- function ae({ instance: e, offsets: t, nonce: n }) {
833
+ function oe({ instance: e, offsets: t, nonce: n }) {
794
834
  let r = S(null);
795
835
  return x(() => {
796
836
  let n = r.current?.sheet;