UNPKG

wawa-vfx

Version:

A simple and easy-to-use library for creating visual effects in React Three Fiber.

1,397 lines 328 kB
import { jsx as Fe, jsxs as _a, Fragment as Ta } from "react/jsx-runtime"; import { useFrame as Ra, extend as $c } from "@react-three/fiber"; import * as Oe from "react"; import g, { useCallback as W, forwardRef as be, Children as _t, isValidElement as xn, createElement as ee, cloneElement as ro, Fragment as Ia, useEffect as Y, createContext as vt, useMemo as ge, useContext as yt, useRef as _, useState as oe, useLayoutEffect as Qe, useReducer as oo, useImperativeHandle as Nn, useDebugValue as xc } from "react"; import * as un from "three"; import { Vector3 as Rt, Quaternion as Aa, Euler as io, Matrix4 as Ec, Color as Sc, AdditiveBlending as Oc, PlaneGeometry as Pc, DynamicDrawUsage as Et } from "three"; import * as Cc from "react-dom"; import _c, { flushSync as ka } from "react-dom"; import { createRoot as Tc } from "react-dom/client"; var Da = /* @__PURE__ */ ((e) => (e[e.Square = 0] = "Square", e[e.Circular = 1] = "Circular", e))(Da || {}), Ma = /* @__PURE__ */ ((e) => (e.StretchBillboard = "stretchBillboard", e.Billboard = "billboard", e.Mesh = "mesh", e))(Ma || {}); const Rc = [ "easeLinear", "easeInPower1", "easeOutPower1", "easeInOutPower1", "easeInPower2", "easeOutPower2", "easeInOutPower2", "easeInPower3", "easeOutPower3", "easeInOutPower3", "easeInPower4", "easeOutPower4", "easeInOutPower4", "easeInQuad", "easeOutQuad", "easeInOutQuad", "easeInCubic", "easeOutCubic", "easeInOutCubic", "easeInQuart", "easeOutQuart", "easeInOutQuart", "easeInQuint", "easeOutQuint", "easeInOutQuint", "easeInSine", "easeOutSine", "easeInOutSine", "easeInExpo", "easeOutExpo", "easeInOutExpo", "easeInCirc", "easeOutCirc", "easeInOutCirc", "easeInElastic", "easeOutElastic", "easeInOutElastic", "easeInBack", "easeOutBack", "easeInOutBack", "easeInBounce", "easeOutBounce", "easeInOutBounce" ]; function fn(e, t) { return e + Math.floor(Math.random() * (t - e + 1)); } function te(e, t) { return e + Math.random() * (t - e); } function we() { return we = Object.assign ? Object.assign.bind() : function(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t]; for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]); } return e; }, we.apply(null, arguments); } function Ic(e, t) { typeof e == "function" ? e(t) : e != null && (e.current = t); } function ja(...e) { return (t) => e.forEach( (n) => Ic(n, t) ); } function At(...e) { return W(ja(...e), e); } const La = /* @__PURE__ */ be((e, t) => { const { children: n, ...r } = e, o = _t.toArray(n), i = o.find(Ac); if (i) { const a = i.props.children, s = o.map((c) => c === i ? _t.count(a) > 1 ? _t.only(null) : /* @__PURE__ */ xn(a) ? a.props.children : null : c); return /* @__PURE__ */ ee(Ar, we({}, r, { ref: t }), /* @__PURE__ */ xn(a) ? /* @__PURE__ */ ro(a, void 0, s) : null); } return /* @__PURE__ */ ee(Ar, we({}, r, { ref: t }), n); }); La.displayName = "Slot"; const Ar = /* @__PURE__ */ be((e, t) => { const { children: n, ...r } = e; return /* @__PURE__ */ xn(n) ? /* @__PURE__ */ ro(n, { ...kc(r, n.props), ref: ja(t, n.ref) }) : _t.count(n) > 1 ? _t.only(null) : null; }); Ar.displayName = "SlotClone"; const za = ({ children: e }) => /* @__PURE__ */ ee(Ia, null, e); function Ac(e) { return /* @__PURE__ */ xn(e) && e.type === za; } function kc(e, t) { const n = { ...t }; for (const r in t) { const o = e[r], i = t[r]; /^on[A-Z]/.test(r) ? o && i ? n[r] = (...s) => { i(...s), o(...s); } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [ o, i ].filter(Boolean).join(" ")); } return { ...e, ...n }; } const Dc = [ "a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "span", "svg", "ul" ], ut = Dc.reduce((e, t) => { const n = /* @__PURE__ */ be((r, o) => { const { asChild: i, ...a } = r, s = i ? La : t; return Y(() => { window[Symbol.for("radix-ui")] = !0; }, []), /* @__PURE__ */ ee(s, we({}, a, { ref: o })); }); return n.displayName = `Primitive.${t}`, { ...e, [t]: n }; }, {}); function Mc(e, t) { e && ka( () => e.dispatchEvent(t) ); } const jc = /* @__PURE__ */ be((e, t) => { var n; const { container: r = globalThis == null || (n = globalThis.document) === null || n === void 0 ? void 0 : n.body, ...o } = e; return r ? /* @__PURE__ */ _c.createPortal(/* @__PURE__ */ ee(ut.div, we({}, o, { ref: t })), r) : null; }), Lc = jc; var Ro = Object.prototype.hasOwnProperty; function Xt(e, t) { var n, r; if (e === t) return !0; if (e && t && (n = e.constructor) === t.constructor) { if (n === Date) return e.getTime() === t.getTime(); if (n === RegExp) return e.toString() === t.toString(); if (n === Array) { if ((r = e.length) === t.length) for (; r-- && Xt(e[r], t[r]); ) ; return r === -1; } if (!n || typeof e == "object") { r = 0; for (n in e) if (Ro.call(e, n) && ++r && !Ro.call(t, n) || !(n in t) || !Xt(e[n], t[n])) return !1; return Object.keys(t).length === r; } } return e !== e && t !== t; } function Fn(e, t) { if (Object.is(e, t)) return !0; if (typeof e != "object" || e === null || typeof t != "object" || t === null) return !1; const n = Object.keys(e); if (n.length !== Object.keys(t).length) return !1; for (let r = 0; r < n.length; r++) if (!Object.prototype.hasOwnProperty.call(t, n[r]) || !Object.is(e[n[r]], t[n[r]])) return !1; return !0; } var Bn = function(t, n, r, o) { this.name = t, this.fn = n, this.args = r, this.modifiers = o; }; Bn.prototype._test = function(t) { var n = this.fn; try { Tt(this.modifiers.slice(), n, this)(t); } catch { n = function() { return !1; }; } try { return Tt(this.modifiers.slice(), n, this)(t); } catch { return !1; } }; Bn.prototype._check = function(t) { try { Tt(this.modifiers.slice(), this.fn, this)(t); } catch { if (Tt(this.modifiers.slice(), function(r) { return r; }, this)(!1)) return; } if (!Tt(this.modifiers.slice(), this.fn, this)(t)) throw null; }; Bn.prototype._testAsync = function(t) { var n = this; return new Promise(function(r, o) { Fa( n.modifiers.slice(), n.fn, n )(t).then(function(i) { i ? r(t) : o(null); }).catch(function(i) { return o(i); }); }); }; function Na(e, t) { return t === void 0 && (t = "simple"), typeof e == "object" ? e[t] : e; } function Tt(e, t, n) { if (e.length) { var r = e.shift(), o = Tt(e, t, n); return r.perform(o, n); } else return Na(t); } function Fa(e, t, n) { if (e.length) { var r = e.shift(), o = Fa(e, t, n); return r.performAsync(o, n); } else return function(i) { return Promise.resolve(Na(t, "async")(i)); }; } var zc = function(t, n, r) { this.name = t, this.perform = n, this.performAsync = r; }, ao = /* @__PURE__ */ function(e) { function t(n, r, o, i) { for (var a = [], s = arguments.length - 4; s-- > 0; ) a[s] = arguments[s + 4]; e.call(this, a), e.captureStackTrace && e.captureStackTrace(this, t), this.rule = n, this.value = r, this.cause = o, this.target = i; } return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t; }(Error), Be = function(t, n) { t === void 0 && (t = []), n === void 0 && (n = []), this.chain = t, this.nextRuleModifiers = n; }; Be.prototype._applyRule = function(t, n) { var r = this; return function() { for (var o = [], i = arguments.length; i--; ) o[i] = arguments[i]; return r.chain.push( new Bn(n, t.apply(r, o), o, r.nextRuleModifiers) ), r.nextRuleModifiers = [], r; }; }; Be.prototype._applyModifier = function(t, n) { return this.nextRuleModifiers.push( new zc(n, t.simple, t.async) ), this; }; Be.prototype._clone = function() { return new Be(this.chain.slice(), this.nextRuleModifiers.slice()); }; Be.prototype.test = function(t) { return this.chain.every(function(n) { return n._test(t); }); }; Be.prototype.testAll = function(t) { var n = []; return this.chain.forEach(function(r) { try { r._check(t); } catch (o) { n.push(new ao(r, t, o)); } }), n; }; Be.prototype.check = function(t) { this.chain.forEach(function(n) { try { n._check(t); } catch (r) { throw new ao(n, t, r); } }); }; Be.prototype.testAsync = function(t) { var n = this; return new Promise(function(r, o) { Ba(t, n.chain.slice(), r, o); }); }; function Ba(e, t, n, r) { if (t.length) { var o = t.shift(); o._testAsync(e).then( function() { Ba(e, t, n, r); }, function(i) { r(new ao(o, e, i)); } ); } else n(e); } var Io = function(e, t) { return t && typeof e == "string" && e.trim().length === 0 ? !0 : e == null; }; function Nc(e, t) { return t === void 0 && (t = !1), { simple: function(n) { return Io(n, t) || e.check(n) === void 0; }, async: function(n) { return Io(n, t) || e.testAsync(n); } }; } function Re() { return typeof Proxy < "u" ? Wa(new Be()) : kr(new Be()); } var Qt = {}; Re.extend = function(e) { Object.assign(Qt, e); }; Re.clearCustomRules = function() { Qt = {}; }; function Wa(e) { return new Proxy(e, { get: function(n, r) { if (r in n) return n[r]; var o = Wa(e._clone()); if (r in En) return o._applyModifier(En[r], r); if (r in Qt) return o._applyRule(Qt[r], r); if (r in Dr) return o._applyRule(Dr[r], r); } }); } function kr(e) { var t = function(o, i) { return Object.keys(o).forEach(function(a) { i[a] = function() { for (var s = [], c = arguments.length; c--; ) s[c] = arguments[c]; var l = kr(i._clone()), u = l._applyRule( o[a], a ).apply(void 0, s); return u; }; }), i; }, n = t(Dr, e), r = t( Qt, n ); return Object.keys(En).forEach(function(o) { Object.defineProperty(r, o, { get: function() { var i = kr(r._clone()); return i._applyModifier(En[o], o); } }); }), r; } var En = { not: { simple: function(e) { return function(t) { return !e(t); }; }, async: function(e) { return function(t) { return Promise.resolve(e(t)).then(function(n) { return !n; }).catch(function() { return !0; }); }; } }, some: { simple: function(e) { return function(t) { return dn(t).some(function(n) { try { return e(n); } catch { return !1; } }); }; }, async: function(e) { return function(t) { return Promise.all( dn(t).map(function(n) { try { return e(n).catch(function() { return !1; }); } catch { return !1; } }) ).then(function(n) { return n.some(Boolean); }); }; } }, every: { simple: function(e) { return function(t) { return t !== !1 && dn(t).every(e); }; }, async: function(e) { return function(t) { return Promise.all(dn(t).map(e)).then(function(n) { return n.every(Boolean); }); }; } }, strict: { simple: function(e, t) { return function(n) { return Ao(t) && n && typeof n == "object" ? Object.keys(t.args[0]).length === Object.keys(n).length && e(n) : e(n); }; }, async: function(e, t) { return function(n) { return Promise.resolve(e(n)).then(function(r) { return Ao(t) && n && typeof n == "object" ? Object.keys(t.args[0]).length === Object.keys(n).length && r : r; }).catch(function() { return !1; }); }; } } }; function Ao(e) { return e && e.name === "schema" && e.args.length > 0 && typeof e.args[0] == "object"; } function dn(e) { return typeof e == "string" ? e.split("") : e; } var Dr = { // Value equal: function(e) { return function(t) { return t == e; }; }, exact: function(e) { return function(t) { return t === e; }; }, // Types number: function(e) { return e === void 0 && (e = !0), function(t) { return typeof t == "number" && (e || isFinite(t)); }; }, integer: function() { return function(e) { var t = Number.isInteger || Fc; return t(e); }; }, numeric: function() { return function(e) { return !isNaN(parseFloat(e)) && isFinite(e); }; }, string: function() { return St("string"); }, boolean: function() { return St("boolean"); }, undefined: function() { return St("undefined"); }, null: function() { return St("null"); }, array: function() { return St("array"); }, object: function() { return St("object"); }, instanceOf: function(e) { return function(t) { return t instanceof e; }; }, // Pattern pattern: function(e) { return function(t) { return e.test(t); }; }, lowercase: function() { return function(e) { return typeof e == "boolean" || e === e.toLowerCase() && e.trim() !== ""; }; }, uppercase: function() { return function(e) { return e === e.toUpperCase() && e.trim() !== ""; }; }, vowel: function() { return function(e) { return /^[aeiou]+$/i.test(e); }; }, consonant: function() { return function(e) { return /^(?=[^aeiou])([a-z]+)$/i.test(e); }; }, // Value at first: function(e) { return function(t) { return t[0] == e; }; }, last: function(e) { return function(t) { return t[t.length - 1] == e; }; }, // Length empty: function() { return function(e) { return e.length === 0; }; }, length: function(e, t) { return function(n) { return n.length >= e && n.length <= (t || e); }; }, minLength: function(e) { return function(t) { return t.length >= e; }; }, maxLength: function(e) { return function(t) { return t.length <= e; }; }, // Range negative: function() { return function(e) { return e < 0; }; }, positive: function() { return function(e) { return e >= 0; }; }, between: function(e, t) { return function(n) { return n >= e && n <= t; }; }, range: function(e, t) { return function(n) { return n >= e && n <= t; }; }, lessThan: function(e) { return function(t) { return t < e; }; }, lessThanOrEqual: function(e) { return function(t) { return t <= e; }; }, greaterThan: function(e) { return function(t) { return t > e; }; }, greaterThanOrEqual: function(e) { return function(t) { return t >= e; }; }, // Divisible even: function() { return function(e) { return e % 2 === 0; }; }, odd: function() { return function(e) { return e % 2 !== 0; }; }, includes: function(e) { return function(t) { return ~t.indexOf(e); }; }, schema: function(e) { return Bc(e); }, // branching passesAnyOf: function() { for (var e = [], t = arguments.length; t--; ) e[t] = arguments[t]; return function(n) { return e.some(function(r) { return r.test(n); }); }; }, optional: Nc }; function St(e) { return function(t) { return Array.isArray(t) && e === "array" || t === null && e === "null" || typeof t === e; }; } function Fc(e) { return typeof e == "number" && isFinite(e) && Math.floor(e) === e; } function Bc(e) { return { simple: function(t) { var n = []; if (Object.keys(e).forEach(function(r) { var o = e[r]; try { o.check((t || {})[r]); } catch (i) { i.target = r, n.push(i); } }), n.length > 0) throw n; return !0; }, async: function(t) { var n = [], r = Object.keys(e).map(function(o) { var i = e[o]; return i.testAsync((t || {})[o]).catch(function(a) { a.target = o, n.push(a); }); }); return Promise.all(r).then(function() { if (n.length > 0) throw n; return !0; }); } }; } var ae = "colors", Se = "sizes", D = "space", Wc = { gap: D, gridGap: D, columnGap: D, gridColumnGap: D, rowGap: D, gridRowGap: D, inset: D, insetBlock: D, insetBlockEnd: D, insetBlockStart: D, insetInline: D, insetInlineEnd: D, insetInlineStart: D, margin: D, marginTop: D, marginRight: D, marginBottom: D, marginLeft: D, marginBlock: D, marginBlockEnd: D, marginBlockStart: D, marginInline: D, marginInlineEnd: D, marginInlineStart: D, padding: D, paddingTop: D, paddingRight: D, paddingBottom: D, paddingLeft: D, paddingBlock: D, paddingBlockEnd: D, paddingBlockStart: D, paddingInline: D, paddingInlineEnd: D, paddingInlineStart: D, top: D, right: D, bottom: D, left: D, scrollMargin: D, scrollMarginTop: D, scrollMarginRight: D, scrollMarginBottom: D, scrollMarginLeft: D, scrollMarginX: D, scrollMarginY: D, scrollMarginBlock: D, scrollMarginBlockEnd: D, scrollMarginBlockStart: D, scrollMarginInline: D, scrollMarginInlineEnd: D, scrollMarginInlineStart: D, scrollPadding: D, scrollPaddingTop: D, scrollPaddingRight: D, scrollPaddingBottom: D, scrollPaddingLeft: D, scrollPaddingX: D, scrollPaddingY: D, scrollPaddingBlock: D, scrollPaddingBlockEnd: D, scrollPaddingBlockStart: D, scrollPaddingInline: D, scrollPaddingInlineEnd: D, scrollPaddingInlineStart: D, fontSize: "fontSizes", background: ae, backgroundColor: ae, backgroundImage: ae, borderImage: ae, border: ae, borderBlock: ae, borderBlockEnd: ae, borderBlockStart: ae, borderBottom: ae, borderBottomColor: ae, borderColor: ae, borderInline: ae, borderInlineEnd: ae, borderInlineStart: ae, borderLeft: ae, borderLeftColor: ae, borderRight: ae, borderRightColor: ae, borderTop: ae, borderTopColor: ae, caretColor: ae, color: ae, columnRuleColor: ae, fill: ae, outline: ae, outlineColor: ae, stroke: ae, textDecorationColor: ae, fontFamily: "fonts", fontWeight: "fontWeights", lineHeight: "lineHeights", letterSpacing: "letterSpacings", blockSize: Se, minBlockSize: Se, maxBlockSize: Se, inlineSize: Se, minInlineSize: Se, maxInlineSize: Se, width: Se, minWidth: Se, maxWidth: Se, height: Se, minHeight: Se, maxHeight: Se, flexBasis: Se, gridTemplateColumns: Se, gridTemplateRows: Se, borderWidth: "borderWidths", borderTopWidth: "borderWidths", borderRightWidth: "borderWidths", borderBottomWidth: "borderWidths", borderLeftWidth: "borderWidths", borderStyle: "borderStyles", borderTopStyle: "borderStyles", borderRightStyle: "borderStyles", borderBottomStyle: "borderStyles", borderLeftStyle: "borderStyles", borderRadius: "radii", borderTopLeftRadius: "radii", borderTopRightRadius: "radii", borderBottomRightRadius: "radii", borderBottomLeftRadius: "radii", boxShadow: "shadows", textShadow: "shadows", transition: "transitions", zIndex: "zIndices" }, Uc = (e, t) => typeof t == "function" ? { "()": Function.prototype.toString.call(t) } : t, kt = () => { const e = /* @__PURE__ */ Object.create(null); return (t, n, ...r) => { const o = ((i) => JSON.stringify(i, Uc))(t); return o in e ? e[o] : e[o] = n(t, ...r); }; }, gt = Symbol.for("sxs.internal"), so = (e, t) => Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)), ko = (e) => { for (const t in e) return !0; return !1; }, { hasOwnProperty: Vc } = Object.prototype, Mr = (e) => e.includes("-") ? e : e.replace(/[A-Z]/g, (t) => "-" + t.toLowerCase()), Hc = /\s+(?![^()]*\))/, Ot = (e) => (t) => e(...typeof t == "string" ? String(t).split(Hc) : [t]), Do = { appearance: (e) => ({ WebkitAppearance: e, appearance: e }), backfaceVisibility: (e) => ({ WebkitBackfaceVisibility: e, backfaceVisibility: e }), backdropFilter: (e) => ({ WebkitBackdropFilter: e, backdropFilter: e }), backgroundClip: (e) => ({ WebkitBackgroundClip: e, backgroundClip: e }), boxDecorationBreak: (e) => ({ WebkitBoxDecorationBreak: e, boxDecorationBreak: e }), clipPath: (e) => ({ WebkitClipPath: e, clipPath: e }), content: (e) => ({ content: e.includes('"') || e.includes("'") || /^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e) ? e : `"${e}"` }), hyphens: (e) => ({ WebkitHyphens: e, hyphens: e }), maskImage: (e) => ({ WebkitMaskImage: e, maskImage: e }), maskSize: (e) => ({ WebkitMaskSize: e, maskSize: e }), tabSize: (e) => ({ MozTabSize: e, tabSize: e }), textSizeAdjust: (e) => ({ WebkitTextSizeAdjust: e, textSizeAdjust: e }), userSelect: (e) => ({ WebkitUserSelect: e, userSelect: e }), marginBlock: Ot((e, t) => ({ marginBlockStart: e, marginBlockEnd: t || e })), marginInline: Ot((e, t) => ({ marginInlineStart: e, marginInlineEnd: t || e })), maxSize: Ot((e, t) => ({ maxBlockSize: e, maxInlineSize: t || e })), minSize: Ot((e, t) => ({ minBlockSize: e, minInlineSize: t || e })), paddingBlock: Ot((e, t) => ({ paddingBlockStart: e, paddingBlockEnd: t || e })), paddingInline: Ot((e, t) => ({ paddingInlineStart: e, paddingInlineEnd: t || e })) }, rr = /([\d.]+)([^]*)/, Yc = (e, t) => e.length ? e.reduce((n, r) => (n.push(...t.map((o) => o.includes("&") ? o.replace(/&/g, /[ +>|~]/.test(r) && /&.*&/.test(o) ? `:is(${r})` : r) : r + " " + o)), n), []) : t, qc = (e, t) => e in Kc && typeof t == "string" ? t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/, (n, r, o, i) => r + (o === "stretch" ? `-moz-available${i};${Mr(e)}:${r}-webkit-fill-available` : `-moz-fit-content${i};${Mr(e)}:${r}fit-content`) + i) : String(t), Kc = { blockSize: 1, height: 1, inlineSize: 1, maxBlockSize: 1, maxHeight: 1, maxInlineSize: 1, maxWidth: 1, minBlockSize: 1, minHeight: 1, minInlineSize: 1, minWidth: 1, width: 1 }, Xe = (e) => e ? e + "-" : "", Ua = (e, t, n) => e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g, (r, o, i, a, s) => a == "$" == !!i ? r : (o || a == "--" ? "calc(" : "") + "var(--" + (a === "$" ? Xe(t) + (s.includes("$") ? "" : Xe(n)) + s.replace(/\$/g, "-") : s) + ")" + (o || a == "--" ? "*" + (o || "") + (i || "1") + ")" : "")), Gc = /\s*,\s*(?![^()]*\))/, Xc = Object.prototype.toString, Ct = (e, t, n, r, o) => { let i, a, s; const c = (l, u, f) => { let d, p; const m = (h) => { for (d in h) { const y = d.charCodeAt(0) === 64, w = y && Array.isArray(h[d]) ? h[d] : [h[d]]; for (p of w) { const x = /[A-Z]/.test(b = d) ? b : b.replace(/-[^]/g, (E) => E[1].toUpperCase()), $ = typeof p == "object" && p && p.toString === Xc && (!r.utils[x] || !u.length); if (x in r.utils && !$) { const E = r.utils[x]; if (E !== a) { a = E, m(E(p)), a = null; continue; } } else if (x in Do) { const E = Do[x]; if (E !== s) { s = E, m(E(p)), s = null; continue; } } if (y && (v = d.slice(1) in r.media ? "@media " + r.media[d.slice(1)] : d, d = v.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g, (E, O, C, B, R, T) => { const A = rr.test(O), M = 0.0625 * (A ? -1 : 1), [Z, G] = A ? [B, O] : [O, B]; return "(" + (C[0] === "=" ? "" : C[0] === ">" === A ? "max-" : "min-") + Z + ":" + (C[0] !== "=" && C.length === 1 ? G.replace(rr, (J, ie, ce) => Number(ie) + M * (C === ">" ? 1 : -1) + ce) : G) + (R ? ") and (" + (R[0] === ">" ? "min-" : "max-") + Z + ":" + (R.length === 1 ? T.replace(rr, (J, ie, ce) => Number(ie) + M * (R === ">" ? -1 : 1) + ce) : T) : "") + ")"; })), $) { const E = y ? f.concat(d) : [...f], O = y ? [...u] : Yc(u, d.split(Gc)); i !== void 0 && o(Mo(...i)), i = void 0, c(p, O, E); } else i === void 0 && (i = [[], u, f]), d = y || d.charCodeAt(0) !== 36 ? d : `--${Xe(r.prefix)}${d.slice(1).replace(/\$/g, "-")}`, p = $ ? p : typeof p == "number" ? p && x in Qc ? String(p) + "px" : String(p) : Ua(qc(x, p ?? ""), r.prefix, r.themeMap[x]), i[0].push(`${y ? `${d} ` : `${Mr(d)}:`}${p}`); } } var v, b; }; m(l), i !== void 0 && o(Mo(...i)), i = void 0; }; c(e, t, n); }, Mo = (e, t, n) => `${n.map((r) => `${r}{`).join("")}${t.length ? `${t.join(",")}{` : ""}${e.join(";")}${t.length ? "}" : ""}${Array(n.length ? n.length + 1 : 0).join("}")}`, Qc = { animationDelay: 1, animationDuration: 1, backgroundSize: 1, blockSize: 1, border: 1, borderBlock: 1, borderBlockEnd: 1, borderBlockEndWidth: 1, borderBlockStart: 1, borderBlockStartWidth: 1, borderBlockWidth: 1, borderBottom: 1, borderBottomLeftRadius: 1, borderBottomRightRadius: 1, borderBottomWidth: 1, borderEndEndRadius: 1, borderEndStartRadius: 1, borderInlineEnd: 1, borderInlineEndWidth: 1, borderInlineStart: 1, borderInlineStartWidth: 1, borderInlineWidth: 1, borderLeft: 1, borderLeftWidth: 1, borderRadius: 1, borderRight: 1, borderRightWidth: 1, borderSpacing: 1, borderStartEndRadius: 1, borderStartStartRadius: 1, borderTop: 1, borderTopLeftRadius: 1, borderTopRightRadius: 1, borderTopWidth: 1, borderWidth: 1, bottom: 1, columnGap: 1, columnRule: 1, columnRuleWidth: 1, columnWidth: 1, containIntrinsicSize: 1, flexBasis: 1, fontSize: 1, gap: 1, gridAutoColumns: 1, gridAutoRows: 1, gridTemplateColumns: 1, gridTemplateRows: 1, height: 1, inlineSize: 1, inset: 1, insetBlock: 1, insetBlockEnd: 1, insetBlockStart: 1, insetInline: 1, insetInlineEnd: 1, insetInlineStart: 1, left: 1, letterSpacing: 1, margin: 1, marginBlock: 1, marginBlockEnd: 1, marginBlockStart: 1, marginBottom: 1, marginInline: 1, marginInlineEnd: 1, marginInlineStart: 1, marginLeft: 1, marginRight: 1, marginTop: 1, maxBlockSize: 1, maxHeight: 1, maxInlineSize: 1, maxWidth: 1, minBlockSize: 1, minHeight: 1, minInlineSize: 1, minWidth: 1, offsetDistance: 1, offsetRotate: 1, outline: 1, outlineOffset: 1, outlineWidth: 1, overflowClipMargin: 1, padding: 1, paddingBlock: 1, paddingBlockEnd: 1, paddingBlockStart: 1, paddingBottom: 1, paddingInline: 1, paddingInlineEnd: 1, paddingInlineStart: 1, paddingLeft: 1, paddingRight: 1, paddingTop: 1, perspective: 1, right: 1, rowGap: 1, scrollMargin: 1, scrollMarginBlock: 1, scrollMarginBlockEnd: 1, scrollMarginBlockStart: 1, scrollMarginBottom: 1, scrollMarginInline: 1, scrollMarginInlineEnd: 1, scrollMarginInlineStart: 1, scrollMarginLeft: 1, scrollMarginRight: 1, scrollMarginTop: 1, scrollPadding: 1, scrollPaddingBlock: 1, scrollPaddingBlockEnd: 1, scrollPaddingBlockStart: 1, scrollPaddingBottom: 1, scrollPaddingInline: 1, scrollPaddingInlineEnd: 1, scrollPaddingInlineStart: 1, scrollPaddingLeft: 1, scrollPaddingRight: 1, scrollPaddingTop: 1, shapeMargin: 1, textDecoration: 1, textDecorationThickness: 1, textIndent: 1, textUnderlineOffset: 1, top: 1, transitionDelay: 1, transitionDuration: 1, verticalAlign: 1, width: 1, wordSpacing: 1 }, jo = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), mt = (e) => ((t) => { let n, r = ""; for (n = Math.abs(t); n > 52; n = n / 52 | 0) r = jo(n % 52) + r; return jo(n % 52) + r; })(((t, n) => { let r = n.length; for (; r; ) t = 33 * t ^ n.charCodeAt(--r); return t; })(5381, JSON.stringify(e)) >>> 0), Vt = ["themed", "global", "styled", "onevar", "resonevar", "allvar", "inline"], Zc = (e) => { if (e.href && !e.href.startsWith(location.origin)) return !1; try { return !!e.cssRules; } catch { return !1; } }, Jc = (e) => { let t; const n = () => { const { cssRules: o } = t.sheet; return [].map.call(o, (i, a) => { const { cssText: s } = i; let c = ""; if (s.startsWith("--sxs")) return ""; if (o[a - 1] && (c = o[a - 1].cssText).startsWith("--sxs")) { if (!i.cssRules.length) return ""; for (const l in t.rules) if (t.rules[l].group === i) return `--sxs{--sxs:${[...t.rules[l].cache].join(" ")}}${s}`; return i.cssRules.length ? `${c}${s}` : ""; } return s; }).join(""); }, r = () => { if (t) { const { rules: s, sheet: c } = t; if (!c.deleteRule) { for (; Object(Object(c.cssRules)[0]).type === 3; ) c.cssRules.splice(0, 1); c.cssRules = []; } for (const l in s) delete s[l]; } const o = Object(e).styleSheets || []; for (const s of o) if (Zc(s)) { for (let c = 0, l = s.cssRules; l[c]; ++c) { const u = Object(l[c]); if (u.type !== 1) continue; const f = Object(l[c + 1]); if (f.type !== 4) continue; ++c; const { cssText: d } = u; if (!d.startsWith("--sxs")) continue; const p = d.slice(14, -3).trim().split(/\s+/), m = Vt[p[0]]; m && (t || (t = { sheet: s, reset: r, rules: {}, toString: n }), t.rules[m] = { group: f, index: c, cache: new Set(p) }); } if (t) break; } if (!t) { const s = (c, l) => ({ type: l, cssRules: [], insertRule(u, f) { this.cssRules.splice(f, 0, s(u, { import: 3, undefined: 1 }[(u.toLowerCase().match(/^@([a-z]+)/) || [])[1]] || 4)); }, get cssText() { return c === "@media{}" ? `@media{${[].map.call(this.cssRules, (u) => u.cssText).join("")}}` : c; } }); t = { sheet: e ? (e.head || e).appendChild(document.createElement("style")).sheet : s("", "text/css"), rules: {}, reset: r, toString: n }; } const { sheet: i, rules: a } = t; for (let s = Vt.length - 1; s >= 0; --s) { const c = Vt[s]; if (!a[c]) { const l = Vt[s + 1], u = a[l] ? a[l].index : i.cssRules.length; i.insertRule("@media{}", u), i.insertRule(`--sxs{--sxs:${s}}`, u), a[c] = { group: i.cssRules[u + 1], index: u, cache: /* @__PURE__ */ new Set([s]) }; } el(a[c]); } }; return r(), t; }, el = (e) => { const t = e.group; let n = t.cssRules.length; e.apply = (r) => { try { t.insertRule(r, n), ++n; } catch { } }; }, Bt = Symbol(), tl = kt(), Lo = (e, t) => tl(e, () => (...n) => { let r = { type: null, composers: /* @__PURE__ */ new Set() }; for (const o of n) if (o != null) if (o[gt]) { r.type == null && (r.type = o[gt].type); for (const i of o[gt].composers) r.composers.add(i); } else o.constructor !== Object || o.$$typeof ? r.type == null && (r.type = o) : r.composers.add(nl(o, e)); return r.type == null && (r.type = "span"), r.composers.size || r.composers.add(["PJLV", {}, [], [], {}, []]), rl(e, r, t); }), nl = ({ variants: e, compoundVariants: t, defaultVariants: n, ...r }, o) => { const i = `${Xe(o.prefix)}c-${mt(r)}`, a = [], s = [], c = /* @__PURE__ */ Object.create(null), l = []; for (const d in n) c[d] = String(n[d]); if (typeof e == "object" && e) for (const d in e) { u = c, f = d, Vc.call(u, f) || (c[d] = "undefined"); const p = e[d]; for (const m in p) { const h = { [d]: String(m) }; String(m) === "undefined" && l.push(d); const v = p[m], b = [h, v, !ko(v)]; a.push(b); } } var u, f; if (typeof t == "object" && t) for (const d of t) { let { css: p, ...m } = d; p = typeof p == "object" && p || {}; for (const v in m) m[v] = String(m[v]); const h = [m, p, !ko(p)]; s.push(h); } return [i, r, a, s, c, l]; }, rl = (e, t, n) => { const [r, o, i, a] = ol(t.composers), s = typeof t.type == "function" || t.type.$$typeof ? ((f) => { function d() { for (let p = 0; p < d[Bt].length; p++) { const [m, h] = d[Bt][p]; f.rules[m].apply(h); } return d[Bt] = [], null; } return d[Bt] = [], d.rules = {}, Vt.forEach((p) => d.rules[p] = { apply: (m) => d[Bt].push([p, m]) }), d; })(n) : null, c = (s || n).rules, l = `.${r}${o.length > 1 ? `:where(.${o.slice(1).join(".")})` : ""}`, u = (f) => { f = typeof f == "object" && f || il; const { css: d, ...p } = f, m = {}; for (const b in i) if (delete p[b], b in f) { let y = f[b]; typeof y == "object" && y ? m[b] = { "@initial": i[b], ...y } : (y = String(y), m[b] = y !== "undefined" || a.has(b) ? y : i[b]); } else m[b] = i[b]; const h = /* @__PURE__ */ new Set([...o]); for (const [b, y, w, x] of t.composers) { n.rules.styled.cache.has(b) || (n.rules.styled.cache.add(b), Ct(y, [`.${b}`], [], e, (O) => { c.styled.apply(O); })); const $ = zo(w, m, e.media), E = zo(x, m, e.media, !0); for (const O of $) if (O !== void 0) for (const [C, B, R] of O) { const T = `${b}-${mt(B)}-${C}`; h.add(T); const A = (R ? n.rules.resonevar : n.rules.onevar).cache, M = R ? c.resonevar : c.onevar; A.has(T) || (A.add(T), Ct(B, [`.${T}`], [], e, (Z) => { M.apply(Z); })); } for (const O of E) if (O !== void 0) for (const [C, B] of O) { const R = `${b}-${mt(B)}-${C}`; h.add(R), n.rules.allvar.cache.has(R) || (n.rules.allvar.cache.add(R), Ct(B, [`.${R}`], [], e, (T) => { c.allvar.apply(T); })); } } if (typeof d == "object" && d) { const b = `${r}-i${mt(d)}-css`; h.add(b), n.rules.inline.cache.has(b) || (n.rules.inline.cache.add(b), Ct(d, [`.${b}`], [], e, (y) => { c.inline.apply(y); })); } for (const b of String(f.className || "").trim().split(/\s+/)) b && h.add(b); const v = p.className = [...h].join(" "); return { type: t.type, className: v, selector: l, props: p, toString: () => v, deferredInjector: s }; }; return so(u, { className: r, selector: l, [gt]: t, toString: () => (n.rules.styled.cache.has(r) || u(), r) }); }, ol = (e) => { let t = ""; const n = [], r = {}, o = []; for (const [i, , , , a, s] of e) { t === "" && (t = i), n.push(i), o.push(...s); for (const c in a) { const l = a[c]; (r[c] === void 0 || l !== "undefined" || s.includes(l)) && (r[c] = l); } } return [t, n, r, new Set(o)]; }, zo = (e, t, n, r) => { const o = []; e: for (let [i, a, s] of e) { if (s) continue; let c, l = 0, u = !1; for (c in i) { const f = i[c]; let d = t[c]; if (d !== f) { if (typeof d != "object" || !d) continue e; { let p, m, h = 0; for (const v in d) { if (f === String(d[v])) { if (v !== "@initial") { const b = v.slice(1); (m = m || []).push(b in n ? n[b] : v.replace(/^@media ?/, "")), u = !0; } l += h, p = !0; } ++h; } if (m && m.length && (a = { ["@media " + m.join(", ")]: a }), !p) continue e; } } } (o[l] = o[l] || []).push([r ? "cv" : `${c}-${i[c]}`, a, u]); } return o; }, il = {}, al = kt(), sl = (e, t) => al(e, () => (...n) => { const r = () => { for (let o of n) { o = typeof o == "object" && o || {}; let i = mt(o); if (!t.rules.global.cache.has(i)) { if (t.rules.global.cache.add(i), "@import" in o) { let a = [].indexOf.call(t.sheet.cssRules, t.rules.themed.group) - 1; for (let s of [].concat(o["@import"])) s = s.includes('"') || s.includes("'") ? s : `"${s}"`, t.sheet.insertRule(`@import ${s};`, a++); delete o["@import"]; } Ct(o, [], [], e, (a) => { t.rules.global.apply(a); }); } } return ""; }; return so(r, { toString: r }); }), cl = kt(), ll = (e, t) => cl(e, () => (n) => { const r = `${Xe(e.prefix)}k-${mt(n)}`, o = () => { if (!t.rules.global.cache.has(r)) { t.rules.global.cache.add(r); const i = []; Ct(n, [], [], e, (s) => i.push(s)); const a = `@keyframes ${r}{${i.join("")}}`; t.rules.global.apply(a); } return r; }; return so(o, { get name() { return o(); }, toString: o }); }), ul = class { constructor(e, t, n, r) { this.token = e == null ? "" : String(e), this.value = t == null ? "" : String(t), this.scale = n == null ? "" : String(n), this.prefix = r == null ? "" : String(r); } get computedValue() { return "var(" + this.variable + ")"; } get variable() { return "--" + Xe(this.prefix) + Xe(this.scale) + this.token; } toString() { return this.computedValue; } }, fl = kt(), dl = (e, t) => fl(e, () => (n, r) => { r = typeof n == "object" && n || Object(r); const o = `.${n = (n = typeof n == "string" ? n : "") || `${Xe(e.prefix)}t-${mt(r)}`}`, i = {}, a = []; for (const c in r) { i[c] = {}; for (const l in r[c]) { const u = `--${Xe(e.prefix)}${c}-${l}`, f = Ua(String(r[c][l]), e.prefix, c); i[c][l] = new ul(l, f, c, e.prefix), a.push(`${u}:${f}`); } } const s = () => { if (a.length && !t.rules.themed.cache.has(n)) { t.rules.themed.cache.add(n); const c = `${r === e.theme ? ":root," : ""}.${n}{${a.join(";")}}`; t.rules.themed.apply(c); } return n; }; return { ...i, get className() { return s(); }, selector: o, toString: s }; }), pl = kt(), hl = kt(), gl = (e) => { const t = ((n) => { let r = !1; const o = pl(n, (i) => { r = !0; const a = "prefix" in (i = typeof i == "object" && i || {}) ? String(i.prefix) : "", s = typeof i.media == "object" && i.media || {}, c = typeof i.root == "object" ? i.root || null : globalThis.document || null, l = typeof i.theme == "object" && i.theme || {}, u = { prefix: a, media: s, theme: l, themeMap: typeof i.themeMap == "object" && i.themeMap || { ...Wc }, utils: typeof i.utils == "object" && i.utils || {} }, f = Jc(c), d = { css: Lo(u, f), globalCss: sl(u, f), keyframes: ll(u, f), createTheme: dl(u, f), reset() { f.reset(), d.theme.toString(); }, theme: {}, sheet: f, config: u, prefix: a, getCssText: f.toString, toString: f.toString }; return String(d.theme = d.createTheme(l)), d; }); return r || o.reset(), o; })(e); return t.styled = (({ config: n, sheet: r }) => hl(n, () => { const o = Lo(n, r); return (...i) => { const a = o(...i), s = a[gt].type, c = g.forwardRef((l, u) => { const f = l && l.as || s, { props: d, deferredInjector: p } = a(l); return delete d.as, d.ref = u, p ? g.createElement(g.Fragment, null, g.createElement(f, d), g.createElement(p, null)) : g.createElement(f, d); }); return c.className = a.className, c.displayName = `Styled.${s.displayName || s.name || s}`, c.selector = a.selector, c.toString = () => a.selector, c[gt] = a[gt], c; }; }))(t), t; }; function ml(e, t, n) { return Math.max(t, Math.min(e, n)); } const xe = { toVector(e, t) { return e === void 0 && (e = t), Array.isArray(e) ? e : [e, e]; }, add(e, t) { return [e[0] + t[0], e[1] + t[1]]; }, sub(e, t) { return [e[0] - t[0], e[1] - t[1]]; }, addTo(e, t) { e[0] += t[0], e[1] += t[1]; }, subTo(e, t) { e[0] -= t[0], e[1] -= t[1]; } }; function No(e, t, n) { return t === 0 || Math.abs(t) === 1 / 0 ? Math.pow(e, n * 5) : e * t * n / (t + n * e); } function Fo(e, t, n, r = 0.15) { return r === 0 ? ml(e, t, n) : e < t ? -No(t - e, n - t, r) + t : e > n ? +No(e - n, n - t, r) + n : e; } function vl(e, [t, n], [r, o]) { const [[i, a], [s, c]] = e; return [Fo(t, i, a, r), Fo(n, s, c, o)]; } function bl(e, t) { if (typeof e != "object" || e === null) return e; var n = e[Symbol.toPrimitive]; if (n !== void 0) { var r = n.call(e, t); if (typeof r != "object") return r; throw new TypeError("@@toPrimitive must return a primitive value."); } return (t === "string" ? String : Number)(e); } function yl(e) { var t = bl(e, "string"); return typeof t == "symbol" ? t : String(t); } function Te(e, t, n) { return t = yl(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e; } function Bo(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e); t && (r = r.filter(function(o) { return Object.getOwnPropertyDescriptor(e, o).enumerable; })), n.push.apply(n, r); } return n; } function de(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t] != null ? arguments[t] : {}; t % 2 ? Bo(Object(n), !0).forEach(function(r) { Te(e, r, n[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Bo(Object(n)).forEach(function(r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r)); }); } return e; } const Va = { pointer: { start: "down", change: "move", end: "up" }, mouse: { start: "down", change: "move", end: "up" }, touch: { start: "start", change: "move", end: "end" }, gesture: { start: "start", change: "change", end: "end" } }; function Wo(e) { return e ? e[0].toUpperCase() + e.slice(1) : ""; } const wl = ["enter", "leave"]; function $l(e = !1, t) { return e && !wl.includes(t); } function xl(e, t = "", n = !1) { const r = Va[e], o = r && r[t] || t; return "on" + Wo(e) + Wo(o) + ($l(n, o) ? "Capture" : ""); } const El = ["gotpointercapture", "lostpointercapture"]; function Sl(e) { let t = e.substring(2).toLowerCase(); const n = !!~t.indexOf("passive"); n && (t = t.replace("passive", "")); const r = El.includes(t) ? "capturecapture" : "capture", o = !!~t.indexOf(r); return o && (t = t.replace("capture", "")), { device: t, capture: o, passive: n }; } function Ol(e, t = "") { const n = Va[e], r = n && n[t] || t; return e + r; } function Wn(e) { return "touches" in e; } function Ha(e) { return Wn(e) ? "touch" : "pointerType" in e ? e.pointerType : "mouse"; } function Pl(e) { return Array.from(e.touches).filter((t) => { var n, r; return t.target === e.currentTarget || ((n = e.currentTarget) === null || n === void 0 || (r = n.contains) === null || r === void 0 ? void 0 : r.call(n, t.target)); }); } function Cl(e) { return e.type === "touchend" || e.type === "touchcancel" ? e.changedTouches : e.targetTouches; } function Ya(e) { return Wn(e) ? Cl(e)[0] : e; } function _l(e) { return Pl(e).map((t) => t.identifier); } function or(e) { const t = Ya(e); return Wn(e) ? t.identifier : t.pointerId; } function Uo(e) { const t = Ya(e); return [t.clientX, t.clientY]; } function Tl(e) { const t = {}; if ("buttons" in e && (t.buttons = e.buttons), "shiftKey" in e) { const { shiftKey: n, altKey: r, metaKey: o, ctrlKey: i } = e; Object.assign(t, { shiftKey: n, altKey: r, metaKey: o, ctrlKey: i }); } return t; } function Sn(e, ...t) { return typeof e == "function" ? e(...t) : e; } function Rl() { } function Il(...e) { return e.length === 0 ? Rl : e.length === 1 ? e[0] : function() { let t; for (const n of e) t = n.apply(this, arguments) || t; return t; }; } function Vo(e, t) { return Object.assign({}, t, e || {}); } const Al = 32; class kl { constructor(t, n, r) { this.ctrl = t, this.args = n, this.key = r, this.state || (this.state = {}, this.computeValues([0, 0]), this.computeInitial(), this.init && this.init(), this.reset()); } get state() { return this.ctrl.state[this.key]; } set state(t) { this.ctrl.state[this.key] = t; } get shared() { return this.ctrl.state.shared; } get eventStore() { return this.ctrl.gestureEventStores[this.key]; } get timeoutStore() { return this.ctrl.gestureTimeoutStores[this.key]; } get config() { return this.ctrl.config[this.key]; } get sharedConfig() { return this.ctrl.config.shared; } get handler() { return this.ctrl.handlers[this.key]; } reset() { const { state: t, shared: n, ingKey: r, args: o } = this; n[r] = t._active = t.active = t._blocked = t._force = !1, t._step = [!1, !1], t.intentional = !1, t._movement = [0, 0], t._distance = [0, 0], t._direction = [0, 0], t._delta = [0, 0], t._bounds = [[-1 / 0, 1 / 0], [-1 / 0, 1 / 0]], t.args = o, t.axis = void 0, t.memo = void 0, t.elapsedTime = t.timeDelta = 0, t.direction = [0, 0], t.distance = [0, 0], t.overflow = [0, 0], t._movementBound = [!1, !1], t.velocity = [0, 0], t.movement = [0, 0], t.delta = [0, 0], t.timeStamp = 0; } start(t) { const n = this.state, r = this.config; n._active || (this.reset(), this.computeInitial(), n._active = !0, n.target = t.target, n.currentTarget = t.currentTarget, n.lastOffset = r.from ? Sn(r.from, n) : n.offset, n.offset = n.lastOffset, n.startTime = n.timeStamp = t.timeStamp); } computeValues(t) { const n = this.state; n._values = t, n.values = this.config.transform(t); } computeInitial() { const t = this.state; t._initial = t._values, t.initial = t.values; } compute(t) { const { state: n, config: r, shared: o } = this; n.args = this.args; let i = 0; if (t && (n.event = t, r.preventDefault && t.cancelable && n.event.preventDefault(), n.type = t.type, o.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, o.locked = !!document.pointerLockElement, Object.assign(o, Tl(t)), o.down = o.pressed = o.buttons % 2 === 1 || o.touches > 0, i = t.timeStamp - n.timeStamp, n.timeStamp = t.timeStamp, n.elapsedTime = n.timeStamp - n.startTime), n._active) { const E = n._delta.map(Math.abs); xe.addTo(n._distance, E); } this.axisIntent && this.axisIntent(t); const [a, s] = n._movement, [c, l] = r.threshold, { _step: u, values: f } = n; if (r.hasCustomTransform ? (u[0] === !1 && (u[0] = Math.abs(a) >= c && f[0]), u[1] === !1 && (u[1] = Math.abs(s) >= l && f[1])) : (u[0] === !1 && (u[0] = Math.abs(a) >= c && Math.sign(a) * c), u[1] === !1 && (u[1] = Math.abs(s) >= l && Math.sign(s) * l)), n.intentional = u[0] !== !1 || u[1] !== !1, !n.intentional) return; const d = [0, 0]; if (r.hasCustomTransform) { const [E, O] = f; d[0] = u[0] !== !1 ? E - u[0] : 0, d[1] = u[1] !== !1 ? O - u[1] : 0; } else d[0] = u[0] !== !1 ? a - u[0] : 0, d[1] = u[1] !== !1 ? s - u[1] : 0; this.restrictToAxis && !n._blocked && this.restrictToAxis(d); const p = n.offset, m = n._active && !n._blocked || n.active; m && (n.first = n._active && !n.active, n.last = !n._active && n.active, n.active = o[this.ingKey] = n._active, t && (n.first && ("bounds" in r && (n._bounds = Sn(r.bounds, n)), this.setup && this.setup()), n.movement = d, this.computeOffset())); const [h, v] = n.offset, [[b, y], [w, x]] = n._bounds; n.overflow = [h < b ? -1 : h > y ? 1 : 0, v < w ? -1 : v > x ? 1 : 0], n._movementBound[0] = n.overflow[0] ? n._movementBound[0] === !1 ? n._movement[0] : n._movementBound[0] : !1, n._movementBound[1] = n.overflow[1] ? n._movementBound[1] === !1 ? n._movement[1] : n._movementBound[1] : !1; const $ = n._active ? r.rubberband || [0, 0] : [0, 0]; if (n.offset = vl(n._bounds, n.offset, $), n.delta = xe.sub(n.offset, p), this.computeMovement(), m && (!n.last || i > Al)) { n.delta = xe.sub(n.offset, p); const E = n.delta.map(Math.abs); xe.addTo(n.distance, E), n.direction = n.delta.map(Math.sign), n._direction = n._delta.map(Math.sign), !n.first && i > 0 && (n.velocity = [E[0] / i, E[1] / i], n.timeDelta = i); } } emit() { const t = this.state, n = this.shared, r = this.config; if (t._active || this.clean(), (t._blocked || !t.intentional) && !t._force && !r.triggerAllEvents) return; const o = this.handler(de(de(de({}, n), t), {}, { [this.aliasKey]: t.values })); o !== void 0 && (t.memo = o); } clean() { this.eventStore.clean(), this.timeoutStore.clean(); } } function Dl([e, t], n) { const r = Math.abs(e), o = Math.abs(t); if (r > o && r > n) return "x"; if (o > r && o > n) return "y"; } class Ml extends kl { constructor(...t) { super(...t), Te(this, "aliasKey", "xy"); } reset() { super.reset(), this.state.axis = void 0; } init() { this.state.offset = [0, 0], this.state.lastOffset = [0, 0]; } computeOffset() { this.state.offset = xe.add(this.state.lastOffset, this.state.movement); } computeMovement() { this.state.movement = xe.sub(this.state.offset, this.state.lastOffset); } axisIntent(t) { const n = this.state, r = this.config; if (!n.axis && t) { const o = typeof r.axisThreshold == "object" ? r.axisThreshold[Ha(t)] : r.axisThreshold; n.axis = Dl(n._movement, o); } n._blocked = (r.lockDirection || !!r.axis) && !n.axis || !!r.axis && r.axis !== n.axis; } restrictToAxis(t) { if (this.config.axis || this.config.lockDirection) switch (this.state.axis) { case "x": t[1] = 0; break; case "y": t[0] = 0; break; } } } const Ho = (e) => e, Yo = 0.15, co = { enabled(e = !0) { return e; }, eventOptions(e, t, n) { return de(de({}, n.shared.eventOptions), e); }, preventDefault(e = !1) { return e; }, triggerAllEvents(e = !1) { return e; }, rubberband(e = 0) { switch (e) { case !0: return [Yo, Yo]; case !1: return [0, 0]; default: return xe.toVector(e); } }, from(e) { if (typeof e == "function") return e; if (e != null) return xe.toVector(e); }, transform(e, t, n) { const r = e || n.shared.transform; if (this.hasCustomTransform = !!r, process.env.NODE_ENV === "development") { cons