@glass-sdk/liquid-glass 0.0.3-beta.0 → 0.0.3-beta.1

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.
@@ -14,7 +14,7 @@ function S(S) {
14
14
  let D = /* @__PURE__ */ new Map(), O, k = (e, t, n, r) => {
15
15
  let i = r ? `${r} ${t}` : t;
16
16
  e.written.get(i) !== n && (e.written.set(i, n), (r ? e.split[r] : e.element).style.setProperty(t, n));
17
- }, A = (e) => {
17
+ }, ee = (e) => {
18
18
  if (e.split) return e.split;
19
19
  let t = Object.fromEntries([
20
20
  "glass",
@@ -33,7 +33,7 @@ function S(S) {
33
33
  }), [e, t];
34
34
  }));
35
35
  return t.refracted.style.inset = "auto", t.light.style.mixBlendMode = "plus-lighter", t.glass.append(t.source, t.refracted), e.element.append(t.glass, t.light, t.rim), e.split = t;
36
- }, j = (e, t, n) => {
36
+ }, A = (e, t, n) => {
37
37
  s(e);
38
38
  let r = e.capsule, i = r ? r.cap * n.height / r.height : 0;
39
39
  if (!r || n.width < i * 2) return [{
@@ -59,12 +59,12 @@ function S(S) {
59
59
  width: n.width - i * 2 + 1
60
60
  }
61
61
  ];
62
- }, M = (e) => {
62
+ }, j = (e) => {
63
63
  let t = e.backdrop;
64
64
  t && (e.backdrop = void 0, t.value ? e.host.style.setProperty("backdrop-filter", t.value, t.priority) : e.host.style.removeProperty("backdrop-filter"));
65
- }, N = (e, t) => {
66
- M(t), t.element.remove(), t.isolation ? t.host.style.isolation = t.isolation : t.host.style.removeProperty("isolation"), D.delete(e);
67
- }, ee = (e) => `-moz-element(#${CSS.escape(e.id)})`, P = (e, t, n, r, i) => {
65
+ }, M = (e, t) => {
66
+ j(t), t.element.remove(), t.hostId && t.host.id === t.hostId && t.host.removeAttribute("id"), t.isolation ? t.host.style.isolation = t.isolation : t.host.style.removeProperty("isolation"), D.delete(e);
67
+ }, N = (e) => `-moz-element(#${CSS.escape(e.id)})`, P = (e, t, n, r, i) => {
68
68
  k(e, `${n}-image`, r.length ? r.map((e) => `url("${e.url}")`).join(", ") : "none", t), k(e, `${n}-position`, r.map((e) => `${e.left}px ${i.top}px`).join(", "), t), k(e, `${n}-size`, r.map((e) => `${e.width}px ${i.height}px`).join(", "), t);
69
69
  }, F = (e) => `<filter id="${e}" x="0" y="0" width="1" height="1" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">`, te = (e, t, r, i, a) => {
70
70
  let o = e.options, s = e.frame, d = h(o);
@@ -81,8 +81,8 @@ function S(S) {
81
81
  }, v = [];
82
82
  if (e.mode === "backdrop") {
83
83
  let n = a ? `<feFlood flood-color="${a}" result="lback"/><feMerge result="lbacked"><feMergeNode in="lback"/><feMergeNode in="SourceGraphic"/></feMerge>` : "";
84
- v.push(`${F(`${t.base}-backdrop`)}${n}${m(a ? "lbacked" : "SourceGraphic", !0)}</filter>`), P(t, void 0, "background", [...j(e.maps, "light", i), ...j(e.maps, "rim", i)], i);
85
- } else A(t), k(t, "display", "block", "glass"), k(t, "display", "none", "source"), k(t, "display", "none", "refracted"), k(t, "display", "block", "light"), k(t, "display", "block", "rim"), k(t, "background-color", c, "glass"), P(t, "glass", "mask", j(e.maps, "field", i), i), P(t, "light", "background", j(e.maps, "light", i), i), P(t, "rim", "background", j(e.maps, "rim", i), i), v.push(`${F(`${t.base}-material`)}${m("SourceGraphic", !1)}</filter>`);
84
+ v.push(`${F(`${t.base}-backdrop`)}${n}${m(a ? "lbacked" : "SourceGraphic", !0)}</filter>`), P(t, void 0, "background", [...A(e.maps, "light", i), ...A(e.maps, "rim", i)], i);
85
+ } else ee(t), k(t, "display", "block", "glass"), k(t, "display", "none", "source"), k(t, "display", "none", "refracted"), k(t, "display", "block", "light"), k(t, "display", "block", "rim"), k(t, "background-color", c, "glass"), P(t, "glass", "mask", A(e.maps, "field", i), i), P(t, "light", "background", A(e.maps, "light", i), i), P(t, "rim", "background", A(e.maps, "rim", i), i), v.push(`${F(`${t.base}-material`)}${m("SourceGraphic", !1)}</filter>`);
86
86
  return d && v.push(`${F(`${t.base}-light`)}${p("SourceGraphic", "llight", d)}</filter>`), v;
87
87
  }, I = (e, t, n) => {
88
88
  let r = (e) => `url("#${t(e)}")`, i = n.has(`${e.base}-light`) ? r(`${e.base}-light`) : "none";
@@ -99,7 +99,7 @@ function S(S) {
99
99
  a.getPropertyValue("backdrop-filter") !== o && a.setProperty("backdrop-filter", o), k(e, "filter", i);
100
100
  };
101
101
  return {
102
- update(s, y, b, S, T = !1, M = "") {
102
+ update(s, y, b, S, T = !1, j = "") {
103
103
  y && O?.element !== y && (O && L(), O = {
104
104
  element: y,
105
105
  original: y.getAttribute("id"),
@@ -110,7 +110,7 @@ function S(S) {
110
110
  if (x.test(e.element.tagName)) continue;
111
111
  F.add(e.serial);
112
112
  let r = D.get(e.serial);
113
- if (r && (r.host !== e.element || r.mode !== e.mode) && (N(e.serial, r), r = void 0), !r) {
113
+ if (r && (r.host !== e.element || r.mode !== e.mode) && (M(e.serial, r), r = void 0), !r) {
114
114
  let t = w.createElement("div");
115
115
  t.className = "lg-glass-layer", t.setAttribute("aria-hidden", "true"), t.id = `lg-layer-${C}-${e.serial}`, r = {
116
116
  element: t,
@@ -121,122 +121,132 @@ function S(S) {
121
121
  mode: e.mode
122
122
  }, e.element.style.isolation = "isolate", e.element.append(t), D.set(e.serial, r);
123
123
  }
124
- let i = e.options, a = e.frame, o = t(i, n(e.options, e.w, e.h)), s = Math.max(o.blur, o.fill), c = e.mode === "copy" ? Math.ceil(3 * s + e.refraction + 4) : 0, l = {
125
- left: b.left + e.x - 2,
126
- top: b.top + e.y - 2,
127
- width: e.w + 4,
128
- height: e.h + 4
129
- }, u = {
130
- left: l.left - c,
131
- top: l.top - c,
132
- width: l.width + 2 * c,
133
- height: l.height + 2 * c
134
- };
135
- r.screen = u;
136
- let d = {
137
- left: (u.left - a.left) / a.sx - a.clientLeft,
138
- top: (u.top - a.top) / a.sy - a.clientTop,
139
- width: u.width / a.sx,
140
- height: u.height / a.sy
124
+ let i = e.options, a = e.frame, o = t(i, n(e.options, e.w, e.h)), s = Math.max(o.blur, o.fill), c = e.mode === "copy" ? Math.ceil(3 * s + e.refraction + 4) : 0, l = (e) => Math.round(e * 16) / 16, u = Math.ceil(c / Math.max(a.sx, a.sy)), d = {
125
+ left: u,
126
+ top: u,
127
+ width: l((e.layoutWidth ?? e.w / a.sx) + 4),
128
+ height: l((e.layoutHeight ?? e.h / a.sy) + 4)
141
129
  }, f = {
142
- left: c / a.sx,
143
- top: c / a.sy,
144
- width: l.width / a.sx,
145
- height: l.height / a.sy
130
+ left: (b.left + e.x - a.left) / a.sx - a.clientLeft - 2 - u,
131
+ top: (b.top + e.y - a.top) / a.sy - a.clientTop - 2 - u,
132
+ width: d.width + 2 * u,
133
+ height: d.height + 2 * u
134
+ }, p = {
135
+ left: a.left + (f.left + a.clientLeft) * a.sx,
136
+ top: a.top + (f.top + a.clientTop) * a.sy,
137
+ width: f.width * a.sx,
138
+ height: f.height * a.sy
146
139
  };
147
- z.push({
140
+ r.screen = p, z.push({
148
141
  lens: e,
149
142
  layer: r,
150
- screen: u,
151
- local: d,
152
- lens_: f
143
+ screen: p,
144
+ local: f,
145
+ lens_: d
153
146
  });
154
147
  }
155
- for (let [e, t] of D) F.has(e) || N(e, t);
156
- for (let { lens: i, layer: o, screen: s, local: x, lens_: C } of z) {
148
+ for (let [e, t] of D) F.has(e) || M(e, t);
149
+ for (let { lens: i, layer: o, screen: s, local: x, lens_: w } of z) {
157
150
  if (i.mode !== "copy") {
158
- R.push(...te(i, o, x, C, M));
151
+ R.push(...te(i, o, x, w, j));
159
152
  continue;
160
153
  }
161
154
  if (!y) continue;
162
- let w = i.frame, E = i.options, O = (e, t) => [(e - s.left) / w.sx, (t - s.top) / w.sy], N = [];
155
+ let E = i.frame, O = i.options, M = (e, t) => [(e - s.left) / E.sx, (t - s.top) / E.sy], F = [];
163
156
  for (let e of [...i.parents, ...[...i.beneath].reverse()]) {
164
157
  let t = D.get(e.serial);
165
- t?.screen && t !== o && N.push({
166
- image: ee(t.element),
167
- box: t.screen
158
+ if (!t?.screen || t === o) continue;
159
+ if (i.parents.includes(e)) {
160
+ F.push({
161
+ image: N(t.element),
162
+ box: t.screen
163
+ });
164
+ continue;
165
+ }
166
+ let n = t.host;
167
+ if (i.beneath.some((t) => t !== e && t.element.contains(n))) continue;
168
+ n.id ||= t.hostId = `lg-surface-${C}-${e.serial}`;
169
+ let r = n.getBoundingClientRect(), a = y.getBoundingClientRect();
170
+ F.push({
171
+ image: N(n),
172
+ box: {
173
+ left: r.left - a.left,
174
+ top: r.top - a.top,
175
+ width: r.width,
176
+ height: r.height
177
+ }
168
178
  });
169
179
  }
170
- let F = i.parents[0], I = F && D.get(F.serial)?.screen, L = F && I && F.opacity >= .999 && I.left <= s.left && I.top <= s.top && I.left + I.width >= s.left + s.width && I.top + I.height >= s.top + s.height;
171
- L || N.push({
172
- image: ee(y),
180
+ let I = i.parents[0], L = I && D.get(I.serial)?.screen, z = I && L && I.opacity >= .999 && L.left <= s.left && L.top <= s.top && L.left + L.width >= s.left + s.width && L.top + L.height >= s.top + s.height;
181
+ z || F.push({
182
+ image: N(y),
173
183
  box: b
174
184
  });
175
- let z = L || !S ? [] : S.regions.flatMap((e) => {
176
- let [t, n] = O(b.left + S.left + e.x, b.top + S.top + e.y), r = {
185
+ let B = z || !S ? [] : S.regions.flatMap((e) => {
186
+ let [t, n] = M(b.left + S.left + e.x, b.top + S.top + e.y), r = {
177
187
  ...e,
178
188
  x: t,
179
189
  y: n,
180
- width: e.width / w.sx,
181
- height: e.height / w.sy,
182
- blur: e.blur / Math.max(w.sx, w.sy),
183
- refraction: e.refraction / Math.max(w.sx, w.sy)
190
+ width: e.width / E.sx,
191
+ height: e.height / E.sy,
192
+ blur: e.blur / Math.max(E.sx, E.sy),
193
+ refraction: e.refraction / Math.max(E.sx, E.sy)
184
194
  }, i = 3 * r.blur + r.refraction;
185
195
  return r.x < x.width + i && r.x + r.width > -i && r.y < x.height + i && r.y + r.height > -i ? [r] : [];
186
196
  });
187
- z.length && R.push(v(`${o.base}-blur`, z, x.width, x.height, "gecko"));
188
- let B = n(i.options, i.w, i.h), V = t(E, B), H = V.blur > 0 || V.fill > 0, U = H ? "source" : void 0;
189
- H && A(o), o.split && (k(o, "display", H ? "block" : "none", "glass"), k(o, "display", H ? "block" : "none", "light"), k(o, "display", H ? "block" : "none", "rim")), k(o, "left", `${x.left}px`), k(o, "top", `${x.top}px`), k(o, "width", `${x.width}px`), k(o, "height", `${x.height}px`), k(o, "opacity", String(Math.round(i.opacity * 1e3) / 1e3)), o.split && k(o, "background-image", H ? "none" : N.map((e) => e.image).join(", ")), k(o, "background-image", N.map((e) => e.image).join(", "), U);
197
+ B.length && R.push(v(`${o.base}-blur`, B, x.width, x.height, "gecko"));
198
+ let V = n(i.options, i.w, i.h), ne = t(O, V), H = ne.blur > 0 || ne.fill > 0, U = H ? "source" : void 0;
199
+ H && ee(o), o.split && (k(o, "display", H ? "block" : "none", "glass"), k(o, "display", H ? "block" : "none", "light"), k(o, "display", H ? "block" : "none", "rim")), k(o, "left", `${x.left}px`), k(o, "top", `${x.top}px`), k(o, "width", `${x.width}px`), k(o, "height", `${x.height}px`), k(o, "opacity", String(Math.round(i.opacity * 1e3) / 1e3)), o.split && k(o, "background-image", H ? "none" : F.map((e) => e.image).join(", ")), k(o, "background-image", F.map((e) => e.image).join(", "), U);
190
200
  let W = T ? c : "", G = (e, t) => {
191
201
  (e || o.written.has(t ? `${t} background-color` : "background-color")) && k(o, "background-color", e, t);
192
202
  };
193
- G(H ? "" : W), o.split && G(H ? W : "", "source"), k(o, "background-position", N.map((e) => {
194
- let [t, n] = O(e.box.left, e.box.top);
203
+ G(H ? "" : W), o.split && G(H ? W : "", "source"), k(o, "background-position", F.map((e) => {
204
+ let [t, n] = M(e.box.left, e.box.top);
195
205
  return `${t}px ${n}px`;
196
- }).join(", "), U), k(o, "background-size", N.map((e) => `${e.box.width / w.sx}px ${e.box.height / w.sy}px`).join(", "), U);
197
- let K = `x="${C.left}" y="${C.top}" width="${C.width}" height="${C.height}"`, q = (e, t) => a(i.maps, e, t, C.left, C.top, C.width, C.height), J = Math.max(w.sx, w.sy), Y = (e) => `<filter id="${e}" x="0" y="0" width="1" height="1" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">`;
206
+ }).join(", "), U), k(o, "background-size", F.map((e) => `${e.box.width / E.sx}px ${e.box.height / E.sy}px`).join(", "), U);
207
+ let K = `x="${w.left}" y="${w.top}" width="${w.width}" height="${w.height}"`, q = (e, t) => a(i.maps, e, t, w.left, w.top, w.width, w.height), J = Math.max(E.sx, E.sy), Y = (e) => `<filter id="${e}" x="0" y="0" width="1" height="1" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="sRGB">`;
198
208
  if (H) {
199
- let e = h(E), t = u("l", "SourceGraphic", E, B, 1 / J), n = l("l", t.result, "SourceGraphic", E, B, 1 / J), r = Math.ceil(i.refraction / J) + 2, s = z.length > 0 ? {
209
+ let e = h(O), t = u("l", "SourceGraphic", O, V, 1 / J), n = l("l", t.result, "SourceGraphic", O, V, 1 / J), r = Math.ceil(i.refraction / J) + 2, s = B.length > 0 ? {
200
210
  left: 0,
201
211
  top: 0,
202
212
  width: x.width,
203
213
  height: x.height
204
214
  } : {
205
- left: Math.max(0, C.left - r),
206
- top: Math.max(0, C.top - r),
207
- width: Math.min(x.width, C.left + C.width + r) - Math.max(0, C.left - r),
208
- height: Math.min(x.height, C.top + C.height + r) - Math.max(0, C.top - r)
215
+ left: Math.max(0, w.left - r),
216
+ top: Math.max(0, w.top - r),
217
+ width: Math.min(x.width, w.left + w.width + r) - Math.max(0, w.left - r),
218
+ height: Math.min(x.height, w.top + w.height + r) - Math.max(0, w.top - r)
209
219
  }, c = {
210
- left: C.left - s.left,
211
- top: C.top - s.top,
212
- width: C.width,
213
- height: C.height
220
+ left: w.left - s.left,
221
+ top: w.top - s.top,
222
+ width: w.width,
223
+ height: w.height
214
224
  }, d = `x="${c.left}" y="${c.top}" width="${c.width}" height="${c.height}"`, f = `<feDisplacementMap in="SourceGraphic" in2="lfield" scale="${2 * i.refraction / J}" xChannelSelector="R" yChannelSelector="G" ${d}`;
215
- R.push(`${Y(o.base)}${a(i.maps, "field", "lfield", c.left, c.top, c.width, c.height)}${f}/></filter>`, `${Y(`${o.base}-material`)}${t.markup}${n.markup}${_("l", E, B, n.result)}${e ? g("l", E, e).markup : ""}</filter>`, ...e ? [`${Y(`${o.base}-light`)}${p("SourceGraphic", "llight", e)}</filter>`] : []);
225
+ R.push(`${Y(o.base)}${a(i.maps, "field", "lfield", c.left, c.top, c.width, c.height)}${f}/></filter>`, `${Y(`${o.base}-material`)}${t.markup}${n.markup}${_("l", O, V, n.result)}${e ? g("l", O, e).markup : ""}</filter>`, ...e ? [`${Y(`${o.base}-light`)}${p("SourceGraphic", "llight", e)}</filter>`] : []);
216
226
  for (let [e, t] of Object.entries({
217
227
  left: s.left,
218
228
  top: s.top,
219
229
  width: s.width,
220
230
  height: s.height
221
231
  })) k(o, e, `${t}px`, "refracted");
222
- k(o, "background-image", N.map((e) => e.image).join(", "), "refracted"), G(W, "refracted"), k(o, "background-position", N.map((e) => {
223
- let [t, n] = O(e.box.left, e.box.top);
232
+ k(o, "background-image", F.map((e) => e.image).join(", "), "refracted"), G(W, "refracted"), k(o, "background-position", F.map((e) => {
233
+ let [t, n] = M(e.box.left, e.box.top);
224
234
  return `${t - s.left}px ${n - s.top}px`;
225
- }).join(", "), "refracted"), k(o, "background-size", N.map((e) => `${e.box.width / w.sx}px ${e.box.height / w.sy}px`).join(", "), "refracted"), P(o, "refracted", "mask", j(i.maps, "field", c), c), P(o, "glass", "mask", j(i.maps, "field", C), C), P(o, "light", "background", j(i.maps, "light", C), C), P(o, "rim", "background", j(i.maps, "rim", C), C);
235
+ }).join(", "), "refracted"), k(o, "background-size", F.map((e) => `${e.box.width / E.sx}px ${e.box.height / E.sy}px`).join(", "), "refracted"), P(o, "refracted", "mask", A(i.maps, "field", c), c), P(o, "glass", "mask", A(i.maps, "field", w), w), P(o, "light", "background", A(i.maps, "light", w), w), P(o, "rim", "background", A(i.maps, "rim", w), w);
226
236
  continue;
227
237
  }
228
- let X = "SourceGraphic", Z = [q("field", "lfield")], ne = u("l", X, E, B, 1 / J);
229
- Z.push(ne.markup), X = ne.result, Z.push(m("l", X, i.refraction / J, e(E, B) / J).replace(/<feDisplacementMap\b/g, `<feDisplacementMap ${K}`));
230
- let re = l("l", "lrefracted", "SourceGraphic", E, B, 1 / J);
231
- Z.push(re.markup, _("l", E, B, re.result));
232
- let ie = "lcolor", Q = "llight", $ = h(E);
238
+ let X = "SourceGraphic", Z = [q("field", "lfield")], re = u("l", X, O, V, 1 / J);
239
+ Z.push(re.markup), X = re.result, Z.push(m("l", X, i.refraction / J, e(O, V) / J).replace(/<feDisplacementMap\b/g, `<feDisplacementMap ${K}`));
240
+ let ie = l("l", "lrefracted", "SourceGraphic", O, V, 1 / J);
241
+ Z.push(ie.markup, _("l", O, V, ie.result));
242
+ let ae = "lcolor", Q = "llight", $ = h(O);
233
243
  if ($) {
234
- let e = g("l", E, $);
235
- Z.push(e.markup), ie = e.color, Q = "ltintLight";
244
+ let e = g("l", O, $);
245
+ Z.push(e.markup), ae = e.color, Q = "ltintLight";
236
246
  }
237
- Z.push(q("light", "llight"), ...$ ? [p("llight", Q, $)] : [], d("l", ie, Q, "lfield", E.material).replace(/<feComposite\b/g, `<feComposite ${K}`), q("rim", "lrim"), f("l", "SourceGraphic", "lrim", 1, r(E, B)), `<feComposite in="lrim" in2="lfield" operator="in" ${K} result="lring"/>`, `<feMerge ${K} result="lglass"><feMergeNode in="loutline"/><feMergeNode in="llitInside"/><feMergeNode in="lring"/></feMerge>`);
238
- let ae = Z.join("").replace(/<(feComponentTransfer|feColorMatrix)\b(?![^>]*\sx=")([^>]*?)(\/?)>/g, `<$1$2 ${K}$3>`);
239
- R.push(`${Y(o.base)}${ae}</filter>`);
247
+ Z.push(q("light", "llight"), ...$ ? [p("llight", Q, $)] : [], d("l", ae, Q, "lfield", O.material).replace(/<feComposite\b/g, `<feComposite ${K}`), q("rim", "lrim"), f("l", "SourceGraphic", "lrim", 1, r(O, V)), `<feComposite in="lrim" in2="lfield" operator="in" ${K} result="lring"/>`, `<feMerge ${K} result="lglass"><feMergeNode in="loutline"/><feMergeNode in="llitInside"/><feMergeNode in="lring"/></feMerge>`);
248
+ let oe = Z.join("").replace(/<(feComponentTransfer|feColorMatrix)\b(?![^>]*\sx=")([^>]*?)(\/?)>/g, `<$1$2 ${K}$3>`);
249
+ R.push(`${Y(o.base)}${oe}</filter>`);
240
250
  }
241
251
  let B = i(E, R, o), V = new Set(R.map((e) => /id="([^"]+)"/.exec(e)[1]));
242
252
  for (let { lens: e, layer: t } of z) {
@@ -254,7 +264,7 @@ function S(S) {
254
264
  return !1;
255
265
  },
256
266
  dispose() {
257
- for (let [e, t] of D) N(e, t);
267
+ for (let [e, t] of D) M(e, t);
258
268
  T.remove(), L();
259
269
  }
260
270
  };
@@ -116,13 +116,13 @@ function i(i, a, o) {
116
116
  if (!S) return !1;
117
117
  let A = O(), M = !!T?.moved && c, P = k(E?.tab ?? T?.held ?? S), F = !1;
118
118
  if (T && M) {
119
- let e = k(A[0]), t = k(A[A.length - 1]), r = k(T.held), i = j(T.client) - T.grab - r.length / 2;
120
- u.configure(n.end), d.configure(n.end), i <= e.pos ? (T.held = A[0], P = e) : i + r.length >= t.pos + t.length ? (T.held = A[A.length - 1], P = t) : (P = {
119
+ let e = k(A[0]), t = k(A.at(-1)), r = k(T.held), i = j(T.client) - T.grab - r.length / 2;
120
+ u.configure(n.end), d.configure(n.end), i <= e.pos ? (T.held = A[0], P = e) : i + r.length >= t.pos + t.length ? (T.held = A.at(-1), P = t) : (P = {
121
121
  ...r,
122
122
  pos: i
123
123
  }, F = b);
124
124
  } else u.configure(n.settle), d.configure(n.settle);
125
- !b || !c ? (u.jump(P.pos), d.jump(P.length), f.jump(P.cross), p.jump(P.thickness), m.jump(0), h.jump(0), b = P.length > 0) : (u.target = P.pos, d.target = P.length, f.target = P.cross, p.target = P.thickness), _ = F ? (_ ?? u.value - P.pos) * Math.exp(-50 * t) : null, g = _ === null ? u.velocity : g + ((P.pos + _ - u.value) / (t || 1) - g) * t * 20, h.target = M ? Math.min(.045, Math.abs(g) * 85e-6) : 0;
125
+ !b || !c ? (u.jump(P.pos), d.jump(P.length), f.jump(P.cross), p.jump(P.thickness), m.jump(0), h.jump(0), b = P.length > 0) : (u.target = P.pos, d.target = P.length, f.target = P.cross, p.target = P.thickness), _ = F ? (_ ?? u.value - P.pos) * Math.exp(-50 * t) : null, g = _ === null ? u.velocity : g + ((P.pos + _ - u.value) / (t || 1) - g) * t * 20, h.target = M && v?.style.backdropFilter ? Math.min(.045, Math.abs(g) * 85e-6) : 0;
126
126
  for (let e of [
127
127
  u,
128
128
  d,
@@ -29,11 +29,19 @@ function r(r, i, a = !1) {
29
29
  }) : (m[n].members.push(e), m[n].bounds = i);
30
30
  }
31
31
  for (let { members: e, bounds: t } of m) {
32
- let i = e.length === 1 ? e[0].id : `shared-${r.replace(/[^a-z0-9]/gi, "")}-${e.map((e) => e.id).sort().join("-")}`, l = d(t, u), f = a ? `${i}backed` : "SourceGraphic", p = {
32
+ let i = e.length === 1 ? e[0].id : `shared-${r.replace(/[^a-z0-9]/gi, "")}-${e.map((e) => e.id).sort().join("-")}`, l = d(t, u), f = a ? `${i}backed` : "SourceGraphic", p = a ? `${n(`${i}frostBackdrop`, l)}<feMerge result="${f}" ${c(l)}><feMergeNode in="${i}frostBackdrop"/><feMergeNode in="SourceGraphic"/></feMerge>` : "";
33
+ if (o < .05) {
34
+ for (let t of e) s.set(t.key, {
35
+ result: f,
36
+ markup: p
37
+ });
38
+ continue;
39
+ }
40
+ let m = {
33
41
  result: `${i}mix`,
34
- markup: `${a ? `${n(`${i}frostBackdrop`, l)}<feMerge result="${f}" ${c(l)}><feMergeNode in="${i}frostBackdrop"/><feMergeNode in="SourceGraphic"/></feMerge>` : ""}<feGaussianBlur in="${f}" stdDeviation="${o}" result="${i}mix" ${c(l)}/>`
42
+ markup: `${p}<feGaussianBlur in="${f}" stdDeviation="${o}" result="${i}mix" ${c(l)}/>`
35
43
  };
36
- for (let t of e) s.set(t.key, p);
44
+ for (let t of e) s.set(t.key, m);
37
45
  }
38
46
  }
39
47
  return s;