@sps-woodland/buttons 8.17.2 → 8.19.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.
package/lib/index.es.js CHANGED
@@ -1,76 +1,76 @@
1
1
  import * as c from "react";
2
- import we, { useRef as Q, useCallback as Y, useEffect as X, useState as Ee, useMemo as Te, useContext as Ke } from "react";
3
- import { Metadata as Ae, I18nContext as Le, Spinner as Me, cl as Fe, Icon as Ue } from "@sps-woodland/core";
4
- import { useFocusable as He, FocusRing as Re } from "@react-aria/focus";
5
- import { code as v } from "@spscommerce/utils";
6
- const Be = typeof document < "u" ? we.useLayoutEffect : () => {
2
+ import Be, { useRef as ee, useCallback as z, useEffect as J, useState as $e, useMemo as Ee, useContext as Le } from "react";
3
+ import { Metadata as Me, I18nContext as Fe, Spinner as Ue, cl as He, Icon as Re } from "@sps-woodland/core";
4
+ import { useFocusable as Ge, FocusRing as Ve } from "@react-aria/focus";
5
+ import { code as h } from "@spscommerce/utils";
6
+ const Pe = typeof document < "u" ? Be.useLayoutEffect : () => {
7
7
  };
8
- function F(e) {
9
- const t = Q(null);
10
- return Be(() => {
8
+ function H(e) {
9
+ const t = ee(null);
10
+ return Pe(() => {
11
11
  t.current = e;
12
12
  }, [
13
13
  e
14
- ]), Y((...o) => {
15
- const r = t.current;
16
- return r == null ? void 0 : r(...o);
14
+ ]), z((...r) => {
15
+ const o = t.current;
16
+ return o == null ? void 0 : o(...r);
17
17
  }, []);
18
18
  }
19
- let pe = /* @__PURE__ */ new Map();
20
- function Ge(e, t) {
19
+ let fe = /* @__PURE__ */ new Map();
20
+ function We(e, t) {
21
21
  if (e === t) return e;
22
- let o = pe.get(e);
23
- if (o)
24
- return o(t), t;
25
- let r = pe.get(t);
26
- return r ? (r(e), e) : t;
22
+ let r = fe.get(e);
23
+ if (r)
24
+ return r(t), t;
25
+ let o = fe.get(t);
26
+ return o ? (o(e), e) : t;
27
27
  }
28
- function $e(...e) {
28
+ function xe(...e) {
29
29
  return (...t) => {
30
- for (let o of e) typeof o == "function" && o(...t);
30
+ for (let r of e) typeof r == "function" && r(...t);
31
31
  };
32
32
  }
33
- const C = (e) => {
33
+ const K = (e) => {
34
34
  var t;
35
35
  return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
36
- }, se = (e) => e && "window" in e && e.window === e ? e : C(e).defaultView || window;
37
- function Pe(e) {
38
- var t, o, r = "";
39
- if (typeof e == "string" || typeof e == "number") r += e;
36
+ }, ie = (e) => e && "window" in e && e.window === e ? e : K(e).defaultView || window;
37
+ function Se(e) {
38
+ var t, r, o = "";
39
+ if (typeof e == "string" || typeof e == "number") o += e;
40
40
  else if (typeof e == "object") if (Array.isArray(e)) {
41
41
  var a = e.length;
42
- for (t = 0; t < a; t++) e[t] && (o = Pe(e[t])) && (r && (r += " "), r += o);
43
- } else for (o in e) e[o] && (r && (r += " "), r += o);
44
- return r;
42
+ for (t = 0; t < a; t++) e[t] && (r = Se(e[t])) && (o && (o += " "), o += r);
43
+ } else for (r in e) e[r] && (o && (o += " "), o += r);
44
+ return o;
45
45
  }
46
- function Ve() {
47
- for (var e, t, o = 0, r = "", a = arguments.length; o < a; o++) (e = arguments[o]) && (t = Pe(e)) && (r && (r += " "), r += t);
48
- return r;
46
+ function Ye() {
47
+ for (var e, t, r = 0, o = "", a = arguments.length; r < a; r++) (e = arguments[r]) && (t = Se(e)) && (o && (o += " "), o += t);
48
+ return o;
49
49
  }
50
- function H(...e) {
50
+ function G(...e) {
51
51
  let t = {
52
52
  ...e[0]
53
53
  };
54
- for (let o = 1; o < e.length; o++) {
55
- let r = e[o];
56
- for (let a in r) {
57
- let p = t[a], u = r[a];
58
- typeof p == "function" && typeof u == "function" && // This is a lot faster than a regex.
54
+ for (let r = 1; r < e.length; r++) {
55
+ let o = e[r];
56
+ for (let a in o) {
57
+ let d = t[a], u = o[a];
58
+ typeof d == "function" && typeof u == "function" && // This is a lot faster than a regex.
59
59
  a[0] === "o" && a[1] === "n" && a.charCodeAt(2) >= /* 'A' */
60
60
  65 && a.charCodeAt(2) <= /* 'Z' */
61
- 90 ? t[a] = $e(p, u) : (a === "className" || a === "UNSAFE_className") && typeof p == "string" && typeof u == "string" ? t[a] = Ve(p, u) : a === "id" && p && u ? t.id = Ge(p, u) : t[a] = u !== void 0 ? u : p;
61
+ 90 ? t[a] = xe(d, u) : (a === "className" || a === "UNSAFE_className") && typeof d == "string" && typeof u == "string" ? t[a] = Ye(d, u) : a === "id" && d && u ? t.id = We(d, u) : t[a] = u !== void 0 ? u : d;
62
62
  }
63
63
  }
64
64
  return t;
65
65
  }
66
- const We = /* @__PURE__ */ new Set([
66
+ const je = /* @__PURE__ */ new Set([
67
67
  "id"
68
- ]), je = /* @__PURE__ */ new Set([
68
+ ]), Xe = /* @__PURE__ */ new Set([
69
69
  "aria-label",
70
70
  "aria-labelledby",
71
71
  "aria-describedby",
72
72
  "aria-details"
73
- ]), Ye = /* @__PURE__ */ new Set([
73
+ ]), ze = /* @__PURE__ */ new Set([
74
74
  "href",
75
75
  "hrefLang",
76
76
  "target",
@@ -78,281 +78,283 @@ const We = /* @__PURE__ */ new Set([
78
78
  "download",
79
79
  "ping",
80
80
  "referrerPolicy"
81
- ]), ze = /^(data-.*)$/;
82
- function Xe(e, t = {}) {
83
- let { labelable: o, isLink: r, propNames: a } = t, p = {};
84
- for (const u in e) Object.prototype.hasOwnProperty.call(e, u) && (We.has(u) || o && je.has(u) || r && Ye.has(u) || a != null && a.has(u) || ze.test(u)) && (p[u] = e[u]);
85
- return p;
81
+ ]), qe = /^(data-.*)$/;
82
+ function Je(e, t = {}) {
83
+ let { labelable: r, isLink: o, propNames: a } = t, d = {};
84
+ for (const u in e) Object.prototype.hasOwnProperty.call(e, u) && (je.has(u) || r && Xe.has(u) || o && ze.has(u) || a != null && a.has(u) || qe.test(u)) && (d[u] = e[u]);
85
+ return d;
86
86
  }
87
- function U(e) {
88
- if (qe()) e.focus({
87
+ function R(e) {
88
+ if (Qe()) e.focus({
89
89
  preventScroll: !0
90
90
  });
91
91
  else {
92
- let t = Je(e);
93
- e.focus(), Qe(t);
92
+ let t = Ze(e);
93
+ e.focus(), et(t);
94
94
  }
95
95
  }
96
- let G = null;
97
- function qe() {
98
- if (G == null) {
99
- G = !1;
96
+ let W = null;
97
+ function Qe() {
98
+ if (W == null) {
99
+ W = !1;
100
100
  try {
101
101
  document.createElement("div").focus({
102
102
  get preventScroll() {
103
- return G = !0, !0;
103
+ return W = !0, !0;
104
104
  }
105
105
  });
106
106
  } catch {
107
107
  }
108
108
  }
109
- return G;
109
+ return W;
110
110
  }
111
- function Je(e) {
112
- let t = e.parentNode, o = [], r = document.scrollingElement || document.documentElement;
113
- for (; t instanceof HTMLElement && t !== r; )
114
- (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && o.push({
111
+ function Ze(e) {
112
+ let t = e.parentNode, r = [], o = document.scrollingElement || document.documentElement;
113
+ for (; t instanceof HTMLElement && t !== o; )
114
+ (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && r.push({
115
115
  element: t,
116
116
  scrollTop: t.scrollTop,
117
117
  scrollLeft: t.scrollLeft
118
118
  }), t = t.parentNode;
119
- return r instanceof HTMLElement && o.push({
120
- element: r,
121
- scrollTop: r.scrollTop,
122
- scrollLeft: r.scrollLeft
123
- }), o;
119
+ return o instanceof HTMLElement && r.push({
120
+ element: o,
121
+ scrollTop: o.scrollTop,
122
+ scrollLeft: o.scrollLeft
123
+ }), r;
124
124
  }
125
- function Qe(e) {
126
- for (let { element: t, scrollTop: o, scrollLeft: r } of e)
127
- t.scrollTop = o, t.scrollLeft = r;
125
+ function et(e) {
126
+ for (let { element: t, scrollTop: r, scrollLeft: o } of e)
127
+ t.scrollTop = r, t.scrollLeft = o;
128
128
  }
129
- function Z(e) {
129
+ function te(e) {
130
130
  var t;
131
- return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((o) => e.test(o.brand))) || e.test(window.navigator.userAgent);
131
+ return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((r) => e.test(r.brand))) || e.test(window.navigator.userAgent);
132
132
  }
133
- function ue(e) {
133
+ function de(e) {
134
134
  var t;
135
135
  return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
136
136
  }
137
- function q() {
138
- return ue(/^Mac/i);
139
- }
140
- function Ze() {
141
- return ue(/^iPhone/i);
142
- }
143
- function xe() {
144
- return ue(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
145
- q() && navigator.maxTouchPoints > 1;
146
- }
147
- function Se() {
148
- return Ze() || xe();
137
+ function I(e) {
138
+ let t = null;
139
+ return () => (t == null && (t = e()), t);
149
140
  }
150
- function et() {
151
- return Z(/AppleWebKit/i) && !tt();
152
- }
153
- function tt() {
154
- return Z(/Chrome/i);
155
- }
156
- function Ne() {
157
- return Z(/Android/i);
158
- }
159
- function nt() {
160
- return Z(/Firefox/i);
161
- }
162
- function R(e, t, o = !0) {
163
- var r, a;
164
- let { metaKey: p, ctrlKey: u, altKey: d, shiftKey: _ } = t;
165
- nt() && (!((a = window.event) === null || a === void 0 || (r = a.type) === null || r === void 0) && r.startsWith("key")) && e.target === "_blank" && (q() ? p = !0 : u = !0);
166
- let h = et() && q() && !xe() ? new KeyboardEvent("keydown", {
141
+ const Q = I(function() {
142
+ return de(/^Mac/i);
143
+ }), tt = I(function() {
144
+ return de(/^iPhone/i);
145
+ }), Ne = I(function() {
146
+ return de(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
147
+ Q() && navigator.maxTouchPoints > 1;
148
+ }), Oe = I(function() {
149
+ return tt() || Ne();
150
+ }), nt = I(function() {
151
+ return te(/AppleWebKit/i) && !ot();
152
+ }), ot = I(function() {
153
+ return te(/Chrome/i);
154
+ }), De = I(function() {
155
+ return te(/Android/i);
156
+ }), rt = I(function() {
157
+ return te(/Firefox/i);
158
+ });
159
+ function V(e, t, r = !0) {
160
+ var o, a;
161
+ let { metaKey: d, ctrlKey: u, altKey: p, shiftKey: m } = t;
162
+ rt() && (!((a = window.event) === null || a === void 0 || (o = a.type) === null || o === void 0) && o.startsWith("key")) && e.target === "_blank" && (Q() ? d = !0 : u = !0);
163
+ let g = nt() && Q() && !Ne() ? new KeyboardEvent("keydown", {
167
164
  keyIdentifier: "Enter",
168
- metaKey: p,
165
+ metaKey: d,
169
166
  ctrlKey: u,
170
- altKey: d,
171
- shiftKey: _
167
+ altKey: p,
168
+ shiftKey: m
172
169
  }) : new MouseEvent("click", {
173
- metaKey: p,
170
+ metaKey: d,
174
171
  ctrlKey: u,
175
- altKey: d,
176
- shiftKey: _,
172
+ altKey: p,
173
+ shiftKey: m,
177
174
  bubbles: !0,
178
175
  cancelable: !0
179
176
  });
180
- R.isOpening = o, U(e), e.dispatchEvent(h), R.isOpening = !1;
177
+ V.isOpening = r, R(e), e.dispatchEvent(g), V.isOpening = !1;
181
178
  }
182
- R.isOpening = !1;
183
- let L = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Set();
184
- function de() {
179
+ V.isOpening = !1;
180
+ let F = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Set();
181
+ function me() {
185
182
  if (typeof window > "u") return;
186
- function e(r) {
187
- return "propertyName" in r;
183
+ function e(o) {
184
+ return "propertyName" in o;
188
185
  }
189
- let t = (r) => {
190
- if (!e(r) || !r.target) return;
191
- let a = L.get(r.target);
192
- a || (a = /* @__PURE__ */ new Set(), L.set(r.target, a), r.target.addEventListener("transitioncancel", o, {
186
+ let t = (o) => {
187
+ if (!e(o) || !o.target) return;
188
+ let a = F.get(o.target);
189
+ a || (a = /* @__PURE__ */ new Set(), F.set(o.target, a), o.target.addEventListener("transitioncancel", r, {
193
190
  once: !0
194
- })), a.add(r.propertyName);
195
- }, o = (r) => {
196
- if (!e(r) || !r.target) return;
197
- let a = L.get(r.target);
198
- if (a && (a.delete(r.propertyName), a.size === 0 && (r.target.removeEventListener("transitioncancel", o), L.delete(r.target)), L.size === 0)) {
199
- for (let p of ae) p();
200
- ae.clear();
191
+ })), a.add(o.propertyName);
192
+ }, r = (o) => {
193
+ if (!e(o) || !o.target) return;
194
+ let a = F.get(o.target);
195
+ if (a && (a.delete(o.propertyName), a.size === 0 && (o.target.removeEventListener("transitioncancel", r), F.delete(o.target)), F.size === 0)) {
196
+ for (let d of le) d();
197
+ le.clear();
201
198
  }
202
199
  };
203
- document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", o);
200
+ document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", r);
204
201
  }
205
- typeof document < "u" && (document.readyState !== "loading" ? de() : document.addEventListener("DOMContentLoaded", de));
206
- function ot(e) {
202
+ typeof document < "u" && (document.readyState !== "loading" ? me() : document.addEventListener("DOMContentLoaded", me));
203
+ function st(e) {
207
204
  requestAnimationFrame(() => {
208
- L.size === 0 ? e() : ae.add(e);
205
+ F.size === 0 ? e() : le.add(e);
209
206
  });
210
207
  }
211
- function rt() {
212
- let e = Q(/* @__PURE__ */ new Map()), t = Y((a, p, u, d) => {
213
- let _ = d != null && d.once ? (...h) => {
214
- e.current.delete(u), u(...h);
208
+ function at() {
209
+ let e = ee(/* @__PURE__ */ new Map()), t = z((a, d, u, p) => {
210
+ let m = p != null && p.once ? (...g) => {
211
+ e.current.delete(u), u(...g);
215
212
  } : u;
216
213
  e.current.set(u, {
217
- type: p,
214
+ type: d,
218
215
  eventTarget: a,
219
- fn: _,
220
- options: d
221
- }), a.addEventListener(p, u, d);
222
- }, []), o = Y((a, p, u, d) => {
223
- var _;
224
- let h = ((_ = e.current.get(u)) === null || _ === void 0 ? void 0 : _.fn) || u;
225
- a.removeEventListener(p, h, d), e.current.delete(u);
226
- }, []), r = Y(() => {
227
- e.current.forEach((a, p) => {
228
- o(a.eventTarget, a.type, p, a.options);
216
+ fn: m,
217
+ options: p
218
+ }), a.addEventListener(d, u, p);
219
+ }, []), r = z((a, d, u, p) => {
220
+ var m;
221
+ let g = ((m = e.current.get(u)) === null || m === void 0 ? void 0 : m.fn) || u;
222
+ a.removeEventListener(d, g, p), e.current.delete(u);
223
+ }, []), o = z(() => {
224
+ e.current.forEach((a, d) => {
225
+ r(a.eventTarget, a.type, d, a.options);
229
226
  });
230
227
  }, [
231
- o
232
- ]);
233
- return X(() => r, [
234
228
  r
229
+ ]);
230
+ return J(() => o, [
231
+ o
235
232
  ]), {
236
233
  addGlobalListener: t,
237
- removeGlobalListener: o,
238
- removeAllGlobalListeners: r
234
+ removeGlobalListener: r,
235
+ removeAllGlobalListeners: o
239
236
  };
240
237
  }
241
- function st(e, t) {
242
- Be(() => {
238
+ function it(e, t) {
239
+ Pe(() => {
243
240
  if (e && e.ref && t)
244
241
  return e.ref.current = t.current, () => {
245
242
  e.ref && (e.ref.current = null);
246
243
  };
247
244
  });
248
245
  }
249
- function fe(e) {
250
- return e.mozInputSource === 0 && e.isTrusted ? !0 : Ne() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
246
+ function _e(e) {
247
+ return e.mozInputSource === 0 && e.isTrusted ? !0 : De() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
251
248
  }
252
- function at(e) {
253
- return !Ne() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
249
+ function lt(e) {
250
+ return !De() && e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse";
254
251
  }
255
- let M = "default", ie = "", z = /* @__PURE__ */ new WeakMap();
256
- function me(e) {
257
- if (Se()) {
258
- if (M === "default") {
259
- const t = C(e);
260
- ie = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
252
+ let U = "default", ue = "", q = /* @__PURE__ */ new WeakMap();
253
+ function be(e) {
254
+ if (Oe()) {
255
+ if (U === "default") {
256
+ const t = K(e);
257
+ ue = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
261
258
  }
262
- M = "disabled";
263
- } else (e instanceof HTMLElement || e instanceof SVGElement) && (z.set(e, e.style.userSelect), e.style.userSelect = "none");
259
+ U = "disabled";
260
+ } else (e instanceof HTMLElement || e instanceof SVGElement) && (q.set(e, e.style.userSelect), e.style.userSelect = "none");
264
261
  }
265
- function V(e) {
266
- if (Se()) {
267
- if (M !== "disabled") return;
268
- M = "restoring", setTimeout(() => {
269
- ot(() => {
270
- if (M === "restoring") {
271
- const t = C(e);
272
- t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = ie || ""), ie = "", M = "default";
262
+ function Y(e) {
263
+ if (Oe()) {
264
+ if (U !== "disabled") return;
265
+ U = "restoring", setTimeout(() => {
266
+ st(() => {
267
+ if (U === "restoring") {
268
+ const t = K(e);
269
+ t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = ue || ""), ue = "", U = "default";
273
270
  }
274
271
  });
275
272
  }, 300);
276
- } else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && z.has(e)) {
277
- let t = z.get(e);
278
- e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), z.delete(e);
273
+ } else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && q.has(e)) {
274
+ let t = q.get(e);
275
+ e.style.userSelect === "none" && (e.style.userSelect = t), e.getAttribute("style") === "" && e.removeAttribute("style"), q.delete(e);
279
276
  }
280
277
  }
281
- const Oe = we.createContext({
278
+ const Ce = Be.createContext({
282
279
  register: () => {
283
280
  }
284
281
  });
285
- Oe.displayName = "PressResponderContext";
286
- function it(e, t) {
282
+ Ce.displayName = "PressResponderContext";
283
+ function ut(e, t) {
287
284
  return t.get ? t.get.call(e) : t.value;
288
285
  }
289
- function De(e, t, o) {
290
- if (!t.has(e)) throw new TypeError("attempted to " + o + " private field on non-instance");
286
+ function Ke(e, t, r) {
287
+ if (!t.has(e)) throw new TypeError("attempted to " + r + " private field on non-instance");
291
288
  return t.get(e);
292
289
  }
293
- function lt(e, t) {
294
- var o = De(e, t, "get");
295
- return it(e, o);
290
+ function ct(e, t) {
291
+ var r = Ke(e, t, "get");
292
+ return ut(e, r);
296
293
  }
297
- function ut(e, t) {
294
+ function dt(e, t) {
298
295
  if (t.has(e))
299
296
  throw new TypeError("Cannot initialize the same private elements twice on an object");
300
297
  }
301
- function ct(e, t, o) {
302
- ut(e, t), t.set(e, o);
298
+ function pt(e, t, r) {
299
+ dt(e, t), t.set(e, r);
303
300
  }
304
- function pt(e, t, o) {
305
- if (t.set) t.set.call(e, o);
301
+ function ft(e, t, r) {
302
+ if (t.set) t.set.call(e, r);
306
303
  else {
307
304
  if (!t.writable)
308
305
  throw new TypeError("attempted to set read only private field");
309
- t.value = o;
306
+ t.value = r;
310
307
  }
311
308
  }
312
- function _e(e, t, o) {
313
- var r = De(e, t, "set");
314
- return pt(e, r, o), o;
309
+ function ge(e, t, r) {
310
+ var o = Ke(e, t, "set");
311
+ return ft(e, o, r), r;
315
312
  }
316
- function dt(e) {
317
- let t = Ke(Oe);
313
+ function mt(e) {
314
+ let t = Le(Ce);
318
315
  if (t) {
319
- let { register: o, ...r } = t;
320
- e = H(r, e), o();
316
+ let { register: r, ...o } = t;
317
+ e = G(o, e), r();
321
318
  }
322
- return st(t, e.ref), e;
319
+ return it(t, e.ref), e;
323
320
  }
324
- var W = /* @__PURE__ */ new WeakMap();
325
- class j {
321
+ var j = /* @__PURE__ */ new WeakMap();
322
+ class X {
326
323
  continuePropagation() {
327
- _e(this, W, !1);
324
+ ge(this, j, !1);
328
325
  }
329
326
  get shouldStopPropagation() {
330
- return lt(this, W);
327
+ return ct(this, j);
331
328
  }
332
- constructor(t, o, r) {
333
- ct(this, W, {
329
+ constructor(t, r, o, a) {
330
+ pt(this, j, {
334
331
  writable: !0,
335
332
  value: void 0
336
- }), _e(this, W, !0), this.type = t, this.pointerType = o, this.target = r.currentTarget, this.shiftKey = r.shiftKey, this.metaKey = r.metaKey, this.ctrlKey = r.ctrlKey, this.altKey = r.altKey;
333
+ }), ge(this, j, !0);
334
+ var d;
335
+ let u = (d = a == null ? void 0 : a.target) !== null && d !== void 0 ? d : o.currentTarget;
336
+ const p = u == null ? void 0 : u.getBoundingClientRect();
337
+ let m, g = 0, b, E = null;
338
+ o.clientX != null && o.clientY != null && (b = o.clientX, E = o.clientY), p && (b != null && E != null ? (m = b - p.left, g = E - p.top) : (m = p.width / 2, g = p.height / 2)), this.type = t, this.pointerType = r, this.target = o.currentTarget, this.shiftKey = o.shiftKey, this.metaKey = o.metaKey, this.ctrlKey = o.ctrlKey, this.altKey = o.altKey, this.x = m, this.y = g;
337
339
  }
338
340
  }
339
- const be = Symbol("linkClicked");
340
- function ft(e) {
341
+ const ve = Symbol("linkClicked");
342
+ function _t(e) {
341
343
  let {
342
344
  onPress: t,
343
- onPressChange: o,
344
- onPressStart: r,
345
+ onPressChange: r,
346
+ onPressStart: o,
345
347
  onPressEnd: a,
346
- onPressUp: p,
348
+ onPressUp: d,
347
349
  isDisabled: u,
348
- isPressed: d,
349
- preventFocusOnPress: _,
350
- shouldCancelOnPointerExit: h,
350
+ isPressed: p,
351
+ preventFocusOnPress: m,
352
+ shouldCancelOnPointerExit: g,
351
353
  allowTextSelectionOnPress: b,
352
354
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
353
- ref: O,
354
- ...P
355
- } = dt(e), [m, $] = Ee(!1), w = Q({
355
+ ref: E,
356
+ ...x
357
+ } = mt(e), [_, P] = $e(!1), w = ee({
356
358
  isPressed: !1,
357
359
  ignoreEmulatedMouseEvents: !1,
358
360
  ignoreClickAfterPress: !1,
@@ -362,164 +364,164 @@ function ft(e) {
362
364
  target: null,
363
365
  isOverTarget: !1,
364
366
  pointerType: null
365
- }), { addGlobalListener: T, removeAllGlobalListeners: x } = rt(), B = F((n, f) => {
366
- let E = w.current;
367
- if (u || E.didFirePressStart) return !1;
367
+ }), { addGlobalListener: B, removeAllGlobalListeners: S } = at(), $ = H((n, f) => {
368
+ let T = w.current;
369
+ if (u || T.didFirePressStart) return !1;
368
370
  let l = !0;
369
- if (E.isTriggeringEvent = !0, r) {
370
- let g = new j("pressstart", f, n);
371
- r(g), l = g.shouldStopPropagation;
371
+ if (T.isTriggeringEvent = !0, o) {
372
+ let v = new X("pressstart", f, n);
373
+ o(v), l = v.shouldStopPropagation;
372
374
  }
373
- return o && o(!0), E.isTriggeringEvent = !1, E.didFirePressStart = !0, $(!0), l;
374
- }), k = F((n, f, E = !0) => {
375
+ return r && r(!0), T.isTriggeringEvent = !1, T.didFirePressStart = !0, P(!0), l;
376
+ }), k = H((n, f, T = !0) => {
375
377
  let l = w.current;
376
378
  if (!l.didFirePressStart) return !1;
377
379
  l.ignoreClickAfterPress = !0, l.didFirePressStart = !1, l.isTriggeringEvent = !0;
378
- let g = !0;
380
+ let v = !0;
379
381
  if (a) {
380
- let s = new j("pressend", f, n);
381
- a(s), g = s.shouldStopPropagation;
382
+ let s = new X("pressend", f, n);
383
+ a(s), v = s.shouldStopPropagation;
382
384
  }
383
- if (o && o(!1), $(!1), t && E && !u) {
384
- let s = new j("press", f, n);
385
- t(s), g && (g = s.shouldStopPropagation);
385
+ if (r && r(!1), P(!1), t && T && !u) {
386
+ let s = new X("press", f, n);
387
+ t(s), v && (v = s.shouldStopPropagation);
386
388
  }
387
- return l.isTriggeringEvent = !1, g;
388
- }), N = F((n, f) => {
389
- let E = w.current;
389
+ return l.isTriggeringEvent = !1, v;
390
+ }), O = H((n, f) => {
391
+ let T = w.current;
390
392
  if (u) return !1;
391
- if (p) {
392
- E.isTriggeringEvent = !0;
393
- let l = new j("pressup", f, n);
394
- return p(l), E.isTriggeringEvent = !1, l.shouldStopPropagation;
393
+ if (d) {
394
+ T.isTriggeringEvent = !0;
395
+ let l = new X("pressup", f, n);
396
+ return d(l), T.isTriggeringEvent = !1, l.shouldStopPropagation;
395
397
  }
396
398
  return !0;
397
- }), S = F((n) => {
399
+ }), N = H((n) => {
398
400
  let f = w.current;
399
- f.isPressed && f.target && (f.isOverTarget && f.pointerType != null && k(D(f.target, n), f.pointerType, !1), f.isPressed = !1, f.isOverTarget = !1, f.activePointerId = null, f.pointerType = null, x(), b || V(f.target));
400
- }), I = F((n) => {
401
- h && S(n);
402
- }), te = Te(() => {
401
+ f.isPressed && f.target && (f.isOverTarget && f.pointerType != null && k(D(f.target, n), f.pointerType, !1), f.isPressed = !1, f.isOverTarget = !1, f.activePointerId = null, f.pointerType = null, S(), b || Y(f.target));
402
+ }), A = H((n) => {
403
+ g && N(n);
404
+ }), oe = Ee(() => {
403
405
  let n = w.current, f = {
404
406
  onKeyDown(l) {
405
- if (ne(l.nativeEvent, l.currentTarget) && l.currentTarget.contains(l.target)) {
406
- var g;
407
- ve(l.target, l.key) && l.preventDefault();
407
+ if (re(l.nativeEvent, l.currentTarget) && l.currentTarget.contains(l.target)) {
408
+ var v;
409
+ ye(l.target, l.key) && l.preventDefault();
408
410
  let s = !0;
409
411
  if (!n.isPressed && !l.repeat) {
410
- n.target = l.currentTarget, n.isPressed = !0, s = B(l, "keyboard");
411
- let i = l.currentTarget, y = (K) => {
412
- ne(K, i) && !K.repeat && i.contains(K.target) && n.target && N(D(n.target, K), "keyboard");
412
+ n.target = l.currentTarget, n.isPressed = !0, s = $(l, "keyboard");
413
+ let i = l.currentTarget, y = (L) => {
414
+ re(L, i) && !L.repeat && i.contains(L.target) && n.target && O(D(n.target, L), "keyboard");
413
415
  };
414
- T(C(l.currentTarget), "keyup", $e(y, E), !0);
416
+ B(K(l.currentTarget), "keyup", xe(y, T), !0);
415
417
  }
416
- s && l.stopPropagation(), l.metaKey && q() && ((g = n.metaKeyEvents) === null || g === void 0 || g.set(l.key, l.nativeEvent));
418
+ s && l.stopPropagation(), l.metaKey && Q() && ((v = n.metaKeyEvents) === null || v === void 0 || v.set(l.key, l.nativeEvent));
417
419
  } else l.key === "Meta" && (n.metaKeyEvents = /* @__PURE__ */ new Map());
418
420
  },
419
421
  onClick(l) {
420
- if (!(l && !l.currentTarget.contains(l.target)) && l && l.button === 0 && !n.isTriggeringEvent && !R.isOpening) {
421
- let g = !0;
422
- if (u && l.preventDefault(), !n.ignoreClickAfterPress && !n.ignoreEmulatedMouseEvents && !n.isPressed && (n.pointerType === "virtual" || fe(l.nativeEvent))) {
423
- !u && !_ && U(l.currentTarget);
424
- let s = B(l, "virtual"), i = N(l, "virtual"), y = k(l, "virtual");
425
- g = s && i && y;
422
+ if (!(l && !l.currentTarget.contains(l.target)) && l && l.button === 0 && !n.isTriggeringEvent && !V.isOpening) {
423
+ let v = !0;
424
+ if (u && l.preventDefault(), !n.ignoreClickAfterPress && !n.ignoreEmulatedMouseEvents && !n.isPressed && (n.pointerType === "virtual" || _e(l.nativeEvent))) {
425
+ !u && !m && R(l.currentTarget);
426
+ let s = $(l, "virtual"), i = O(l, "virtual"), y = k(l, "virtual");
427
+ v = s && i && y;
426
428
  }
427
- n.ignoreEmulatedMouseEvents = !1, n.ignoreClickAfterPress = !1, g && l.stopPropagation();
429
+ n.ignoreEmulatedMouseEvents = !1, n.ignoreClickAfterPress = !1, v && l.stopPropagation();
428
430
  }
429
431
  }
430
- }, E = (l) => {
431
- var g;
432
- if (n.isPressed && n.target && ne(l, n.target)) {
432
+ }, T = (l) => {
433
+ var v;
434
+ if (n.isPressed && n.target && re(l, n.target)) {
433
435
  var s;
434
- ve(l.target, l.key) && l.preventDefault();
436
+ ye(l.target, l.key) && l.preventDefault();
435
437
  let y = l.target;
436
- k(D(n.target, l), "keyboard", n.target.contains(y)), x(), l.key !== "Enter" && ce(n.target) && n.target.contains(y) && !l[be] && (l[be] = !0, R(n.target, l, !1)), n.isPressed = !1, (s = n.metaKeyEvents) === null || s === void 0 || s.delete(l.key);
437
- } else if (l.key === "Meta" && (!((g = n.metaKeyEvents) === null || g === void 0) && g.size)) {
438
+ k(D(n.target, l), "keyboard", n.target.contains(y)), S(), l.key !== "Enter" && pe(n.target) && n.target.contains(y) && !l[ve] && (l[ve] = !0, V(n.target, l, !1)), n.isPressed = !1, (s = n.metaKeyEvents) === null || s === void 0 || s.delete(l.key);
439
+ } else if (l.key === "Meta" && (!((v = n.metaKeyEvents) === null || v === void 0) && v.size)) {
438
440
  var i;
439
441
  let y = n.metaKeyEvents;
440
442
  n.metaKeyEvents = void 0;
441
- for (let K of y.values()) (i = n.target) === null || i === void 0 || i.dispatchEvent(new KeyboardEvent("keyup", K));
443
+ for (let L of y.values()) (i = n.target) === null || i === void 0 || i.dispatchEvent(new KeyboardEvent("keyup", L));
442
444
  }
443
445
  };
444
446
  if (typeof PointerEvent < "u") {
445
447
  f.onPointerDown = (i) => {
446
448
  if (i.button !== 0 || !i.currentTarget.contains(i.target)) return;
447
- if (at(i.nativeEvent)) {
449
+ if (lt(i.nativeEvent)) {
448
450
  n.pointerType = "virtual";
449
451
  return;
450
452
  }
451
- oe(i.currentTarget) && i.preventDefault(), n.pointerType = i.pointerType;
453
+ se(i.currentTarget) && i.preventDefault(), n.pointerType = i.pointerType;
452
454
  let y = !0;
453
- n.isPressed || (n.isPressed = !0, n.isOverTarget = !0, n.activePointerId = i.pointerId, n.target = i.currentTarget, !u && !_ && U(i.currentTarget), b || me(n.target), y = B(i, n.pointerType), T(C(i.currentTarget), "pointermove", l, !1), T(C(i.currentTarget), "pointerup", g, !1), T(C(i.currentTarget), "pointercancel", s, !1)), y && i.stopPropagation();
455
+ n.isPressed || (n.isPressed = !0, n.isOverTarget = !0, n.activePointerId = i.pointerId, n.target = i.currentTarget, !u && !m && R(i.currentTarget), b || be(n.target), y = $(i, n.pointerType), B(K(i.currentTarget), "pointermove", l, !1), B(K(i.currentTarget), "pointerup", v, !1), B(K(i.currentTarget), "pointercancel", s, !1)), y && i.stopPropagation();
454
456
  }, f.onMouseDown = (i) => {
455
- i.currentTarget.contains(i.target) && i.button === 0 && (oe(i.currentTarget) && i.preventDefault(), i.stopPropagation());
457
+ i.currentTarget.contains(i.target) && i.button === 0 && (se(i.currentTarget) && i.preventDefault(), i.stopPropagation());
456
458
  }, f.onPointerUp = (i) => {
457
- !i.currentTarget.contains(i.target) || n.pointerType === "virtual" || i.button === 0 && A(i, i.currentTarget) && N(i, n.pointerType || i.pointerType);
459
+ !i.currentTarget.contains(i.target) || n.pointerType === "virtual" || i.button === 0 && M(i, i.currentTarget) && O(i, n.pointerType || i.pointerType);
458
460
  };
459
461
  let l = (i) => {
460
- i.pointerId === n.activePointerId && (n.target && A(i, n.target) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, B(D(n.target, i), n.pointerType)) : n.target && n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, k(D(n.target, i), n.pointerType, !1), I(i)));
461
- }, g = (i) => {
462
- i.pointerId === n.activePointerId && n.isPressed && i.button === 0 && n.target && (A(i, n.target) && n.pointerType != null ? k(D(n.target, i), n.pointerType) : n.isOverTarget && n.pointerType != null && k(D(n.target, i), n.pointerType, !1), n.isPressed = !1, n.isOverTarget = !1, n.activePointerId = null, n.pointerType = null, x(), b || V(n.target));
462
+ i.pointerId === n.activePointerId && (n.target && M(i, n.target) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, $(D(n.target, i), n.pointerType)) : n.target && n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, k(D(n.target, i), n.pointerType, !1), A(i)));
463
+ }, v = (i) => {
464
+ i.pointerId === n.activePointerId && n.isPressed && i.button === 0 && n.target && (M(i, n.target) && n.pointerType != null ? k(D(n.target, i), n.pointerType) : n.isOverTarget && n.pointerType != null && k(D(n.target, i), n.pointerType, !1), n.isPressed = !1, n.isOverTarget = !1, n.activePointerId = null, n.pointerType = null, S(), b || Y(n.target));
463
465
  }, s = (i) => {
464
- S(i);
466
+ N(i);
465
467
  };
466
468
  f.onDragStart = (i) => {
467
- i.currentTarget.contains(i.target) && S(i);
469
+ i.currentTarget.contains(i.target) && N(i);
468
470
  };
469
471
  } else {
470
472
  f.onMouseDown = (s) => {
471
473
  if (s.button !== 0 || !s.currentTarget.contains(s.target)) return;
472
- if (oe(s.currentTarget) && s.preventDefault(), n.ignoreEmulatedMouseEvents) {
474
+ if (se(s.currentTarget) && s.preventDefault(), n.ignoreEmulatedMouseEvents) {
473
475
  s.stopPropagation();
474
476
  return;
475
477
  }
476
- n.isPressed = !0, n.isOverTarget = !0, n.target = s.currentTarget, n.pointerType = fe(s.nativeEvent) ? "virtual" : "mouse", !u && !_ && U(s.currentTarget), B(s, n.pointerType) && s.stopPropagation(), T(C(s.currentTarget), "mouseup", l, !1);
478
+ n.isPressed = !0, n.isOverTarget = !0, n.target = s.currentTarget, n.pointerType = _e(s.nativeEvent) ? "virtual" : "mouse", !u && !m && R(s.currentTarget), $(s, n.pointerType) && s.stopPropagation(), B(K(s.currentTarget), "mouseup", l, !1);
477
479
  }, f.onMouseEnter = (s) => {
478
480
  if (!s.currentTarget.contains(s.target)) return;
479
481
  let i = !0;
480
- n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !0, i = B(s, n.pointerType)), i && s.stopPropagation();
482
+ n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !0, i = $(s, n.pointerType)), i && s.stopPropagation();
481
483
  }, f.onMouseLeave = (s) => {
482
484
  if (!s.currentTarget.contains(s.target)) return;
483
485
  let i = !0;
484
- n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !1, i = k(s, n.pointerType, !1), I(s)), i && s.stopPropagation();
486
+ n.isPressed && !n.ignoreEmulatedMouseEvents && n.pointerType != null && (n.isOverTarget = !1, i = k(s, n.pointerType, !1), A(s)), i && s.stopPropagation();
485
487
  }, f.onMouseUp = (s) => {
486
- s.currentTarget.contains(s.target) && !n.ignoreEmulatedMouseEvents && s.button === 0 && N(s, n.pointerType || "mouse");
488
+ s.currentTarget.contains(s.target) && !n.ignoreEmulatedMouseEvents && s.button === 0 && O(s, n.pointerType || "mouse");
487
489
  };
488
490
  let l = (s) => {
489
491
  if (s.button === 0) {
490
- if (n.isPressed = !1, x(), n.ignoreEmulatedMouseEvents) {
492
+ if (n.isPressed = !1, S(), n.ignoreEmulatedMouseEvents) {
491
493
  n.ignoreEmulatedMouseEvents = !1;
492
494
  return;
493
495
  }
494
- n.target && A(s, n.target) && n.pointerType != null ? k(D(n.target, s), n.pointerType) : n.target && n.isOverTarget && n.pointerType != null && k(D(n.target, s), n.pointerType, !1), n.isOverTarget = !1;
496
+ n.target && M(s, n.target) && n.pointerType != null ? k(D(n.target, s), n.pointerType) : n.target && n.isOverTarget && n.pointerType != null && k(D(n.target, s), n.pointerType, !1), n.isOverTarget = !1;
495
497
  }
496
498
  };
497
499
  f.onTouchStart = (s) => {
498
500
  if (!s.currentTarget.contains(s.target)) return;
499
- let i = mt(s.nativeEvent);
501
+ let i = bt(s.nativeEvent);
500
502
  if (!i) return;
501
- n.activePointerId = i.identifier, n.ignoreEmulatedMouseEvents = !0, n.isOverTarget = !0, n.isPressed = !0, n.target = s.currentTarget, n.pointerType = "touch", !u && !_ && U(s.currentTarget), b || me(n.target), B(s, n.pointerType) && s.stopPropagation(), T(se(s.currentTarget), "scroll", g, !0);
503
+ n.activePointerId = i.identifier, n.ignoreEmulatedMouseEvents = !0, n.isOverTarget = !0, n.isPressed = !0, n.target = s.currentTarget, n.pointerType = "touch", !u && !m && R(s.currentTarget), b || be(n.target), $(C(n.target, s), n.pointerType) && s.stopPropagation(), B(ie(s.currentTarget), "scroll", v, !0);
502
504
  }, f.onTouchMove = (s) => {
503
505
  if (!s.currentTarget.contains(s.target)) return;
504
506
  if (!n.isPressed) {
505
507
  s.stopPropagation();
506
508
  return;
507
509
  }
508
- let i = ge(s.nativeEvent, n.activePointerId), y = !0;
509
- i && A(i, s.currentTarget) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, y = B(s, n.pointerType)) : n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, y = k(s, n.pointerType, !1), I(s)), y && s.stopPropagation();
510
+ let i = he(s.nativeEvent, n.activePointerId), y = !0;
511
+ i && M(i, s.currentTarget) ? !n.isOverTarget && n.pointerType != null && (n.isOverTarget = !0, y = $(C(n.target, s), n.pointerType)) : n.isOverTarget && n.pointerType != null && (n.isOverTarget = !1, y = k(C(n.target, s), n.pointerType, !1), A(C(n.target, s))), y && s.stopPropagation();
510
512
  }, f.onTouchEnd = (s) => {
511
513
  if (!s.currentTarget.contains(s.target)) return;
512
514
  if (!n.isPressed) {
513
515
  s.stopPropagation();
514
516
  return;
515
517
  }
516
- let i = ge(s.nativeEvent, n.activePointerId), y = !0;
517
- i && A(i, s.currentTarget) && n.pointerType != null ? (N(s, n.pointerType), y = k(s, n.pointerType)) : n.isOverTarget && n.pointerType != null && (y = k(s, n.pointerType, !1)), y && s.stopPropagation(), n.isPressed = !1, n.activePointerId = null, n.isOverTarget = !1, n.ignoreEmulatedMouseEvents = !0, n.target && !b && V(n.target), x();
518
+ let i = he(s.nativeEvent, n.activePointerId), y = !0;
519
+ i && M(i, s.currentTarget) && n.pointerType != null ? (O(C(n.target, s), n.pointerType), y = k(C(n.target, s), n.pointerType)) : n.isOverTarget && n.pointerType != null && (y = k(C(n.target, s), n.pointerType, !1)), y && s.stopPropagation(), n.isPressed = !1, n.activePointerId = null, n.isOverTarget = !1, n.ignoreEmulatedMouseEvents = !0, n.target && !b && Y(n.target), S();
518
520
  }, f.onTouchCancel = (s) => {
519
- s.currentTarget.contains(s.target) && (s.stopPropagation(), n.isPressed && S(s));
521
+ s.currentTarget.contains(s.target) && (s.stopPropagation(), n.isPressed && N(C(n.target, s)));
520
522
  };
521
- let g = (s) => {
522
- n.isPressed && s.target.contains(n.target) && S({
523
+ let v = (s) => {
524
+ n.isPressed && s.target.contains(n.target) && N({
523
525
  currentTarget: n.target,
524
526
  shiftKey: !1,
525
527
  ctrlKey: !1,
@@ -528,84 +530,99 @@ function ft(e) {
528
530
  });
529
531
  };
530
532
  f.onDragStart = (s) => {
531
- s.currentTarget.contains(s.target) && S(s);
533
+ s.currentTarget.contains(s.target) && N(s);
532
534
  };
533
535
  }
534
536
  return f;
535
537
  }, [
536
- T,
538
+ B,
537
539
  u,
538
- _,
539
- x,
540
- b,
540
+ m,
541
541
  S,
542
- I,
542
+ b,
543
+ N,
544
+ A,
543
545
  k,
544
- B,
545
- N
546
+ $,
547
+ O
546
548
  ]);
547
- return X(() => () => {
549
+ return J(() => () => {
548
550
  var n;
549
- b || V((n = w.current.target) !== null && n !== void 0 ? n : void 0);
551
+ b || Y((n = w.current.target) !== null && n !== void 0 ? n : void 0);
550
552
  }, [
551
553
  b
552
554
  ]), {
553
- isPressed: d || m,
554
- pressProps: H(P, te)
555
+ isPressed: p || _,
556
+ pressProps: G(x, oe)
555
557
  };
556
558
  }
557
- function ce(e) {
559
+ function pe(e) {
558
560
  return e.tagName === "A" && e.hasAttribute("href");
559
561
  }
560
- function ne(e, t) {
561
- const { key: o, code: r } = e, a = t, p = a.getAttribute("role");
562
- return (o === "Enter" || o === " " || o === "Spacebar" || r === "Space") && !(a instanceof se(a).HTMLInputElement && !Ce(a, o) || a instanceof se(a).HTMLTextAreaElement || a.isContentEditable) && // Links should only trigger with Enter key
563
- !((p === "link" || !p && ce(a)) && o !== "Enter");
562
+ function re(e, t) {
563
+ const { key: r, code: o } = e, a = t, d = a.getAttribute("role");
564
+ return (r === "Enter" || r === " " || r === "Spacebar" || o === "Space") && !(a instanceof ie(a).HTMLInputElement && !Ie(a, r) || a instanceof ie(a).HTMLTextAreaElement || a.isContentEditable) && // Links should only trigger with Enter key
565
+ !((d === "link" || !d && pe(a)) && r !== "Enter");
564
566
  }
565
- function mt(e) {
567
+ function bt(e) {
566
568
  const { targetTouches: t } = e;
567
569
  return t.length > 0 ? t[0] : null;
568
570
  }
569
- function ge(e, t) {
570
- const o = e.changedTouches;
571
- for (let r = 0; r < o.length; r++) {
572
- const a = o[r];
571
+ function he(e, t) {
572
+ const r = e.changedTouches;
573
+ for (let o = 0; o < r.length; o++) {
574
+ const a = r[o];
573
575
  if (a.identifier === t) return a;
574
576
  }
575
577
  return null;
576
578
  }
579
+ function C(e, t) {
580
+ let r = 0, o = 0;
581
+ return t.targetTouches && t.targetTouches.length === 1 && (r = t.targetTouches[0].clientX, o = t.targetTouches[0].clientY), {
582
+ currentTarget: e,
583
+ shiftKey: t.shiftKey,
584
+ ctrlKey: t.ctrlKey,
585
+ metaKey: t.metaKey,
586
+ altKey: t.altKey,
587
+ clientX: r,
588
+ clientY: o
589
+ };
590
+ }
577
591
  function D(e, t) {
592
+ let r = t.clientX, o = t.clientY;
578
593
  return {
579
594
  currentTarget: e,
580
595
  shiftKey: t.shiftKey,
581
596
  ctrlKey: t.ctrlKey,
582
597
  metaKey: t.metaKey,
583
- altKey: t.altKey
598
+ altKey: t.altKey,
599
+ clientX: r,
600
+ clientY: o
584
601
  };
585
602
  }
586
- function _t(e) {
587
- let t = 0, o = 0;
588
- return e.width !== void 0 ? t = e.width / 2 : e.radiusX !== void 0 && (t = e.radiusX), e.height !== void 0 ? o = e.height / 2 : e.radiusY !== void 0 && (o = e.radiusY), {
589
- top: e.clientY - o,
603
+ function gt(e) {
604
+ let t = 0, r = 0;
605
+ return e.width !== void 0 ? t = e.width / 2 : e.radiusX !== void 0 && (t = e.radiusX), e.height !== void 0 ? r = e.height / 2 : e.radiusY !== void 0 && (r = e.radiusY), {
606
+ top: e.clientY - r,
590
607
  right: e.clientX + t,
591
- bottom: e.clientY + o,
608
+ bottom: e.clientY + r,
592
609
  left: e.clientX - t
593
610
  };
594
611
  }
595
- function bt(e, t) {
612
+ function vt(e, t) {
596
613
  return !(e.left > t.right || t.left > e.right || e.top > t.bottom || t.top > e.bottom);
597
614
  }
598
- function A(e, t) {
599
- let o = t.getBoundingClientRect(), r = _t(e);
600
- return bt(o, r);
615
+ function M(e, t) {
616
+ let r = t.getBoundingClientRect(), o = gt(e);
617
+ return vt(r, o);
601
618
  }
602
- function oe(e) {
619
+ function se(e) {
603
620
  return !(e instanceof HTMLElement) || !e.hasAttribute("draggable");
604
621
  }
605
- function ve(e, t) {
606
- return e instanceof HTMLInputElement ? !Ce(e, t) : e instanceof HTMLButtonElement ? e.type !== "submit" && e.type !== "reset" : !ce(e);
622
+ function ye(e, t) {
623
+ return e instanceof HTMLInputElement ? !Ie(e, t) : e instanceof HTMLButtonElement ? e.type !== "submit" && e.type !== "reset" : !pe(e);
607
624
  }
608
- const gt = /* @__PURE__ */ new Set([
625
+ const ht = /* @__PURE__ */ new Set([
609
626
  "checkbox",
610
627
  "radio",
611
628
  "range",
@@ -616,261 +633,261 @@ const gt = /* @__PURE__ */ new Set([
616
633
  "submit",
617
634
  "reset"
618
635
  ]);
619
- function Ce(e, t) {
620
- return e.type === "checkbox" || e.type === "radio" ? t === " " : gt.has(e.type);
636
+ function Ie(e, t) {
637
+ return e.type === "checkbox" || e.type === "radio" ? t === " " : ht.has(e.type);
621
638
  }
622
- let J = !1, re = 0;
623
- function le() {
624
- J = !0, setTimeout(() => {
625
- J = !1;
639
+ let Z = !1, ae = 0;
640
+ function ce() {
641
+ Z = !0, setTimeout(() => {
642
+ Z = !1;
626
643
  }, 50);
627
644
  }
628
- function he(e) {
629
- e.pointerType === "touch" && le();
645
+ function ke(e) {
646
+ e.pointerType === "touch" && ce();
630
647
  }
631
- function vt() {
648
+ function yt() {
632
649
  if (!(typeof document > "u"))
633
- return typeof PointerEvent < "u" ? document.addEventListener("pointerup", he) : document.addEventListener("touchend", le), re++, () => {
634
- re--, !(re > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", he) : document.removeEventListener("touchend", le));
650
+ return typeof PointerEvent < "u" ? document.addEventListener("pointerup", ke) : document.addEventListener("touchend", ce), ae++, () => {
651
+ ae--, !(ae > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", ke) : document.removeEventListener("touchend", ce));
635
652
  };
636
653
  }
637
- function ht(e) {
638
- let { onHoverStart: t, onHoverChange: o, onHoverEnd: r, isDisabled: a } = e, [p, u] = Ee(!1), d = Q({
654
+ function kt(e) {
655
+ let { onHoverStart: t, onHoverChange: r, onHoverEnd: o, isDisabled: a } = e, [d, u] = $e(!1), p = ee({
639
656
  isHovered: !1,
640
657
  ignoreEmulatedMouseEvents: !1,
641
658
  pointerType: "",
642
659
  target: null
643
660
  }).current;
644
- X(vt, []);
645
- let { hoverProps: _, triggerHoverEnd: h } = Te(() => {
646
- let b = (m, $) => {
647
- if (d.pointerType = $, a || $ === "touch" || d.isHovered || !m.currentTarget.contains(m.target)) return;
648
- d.isHovered = !0;
649
- let w = m.currentTarget;
650
- d.target = w, t && t({
661
+ J(yt, []);
662
+ let { hoverProps: m, triggerHoverEnd: g } = Ee(() => {
663
+ let b = (_, P) => {
664
+ if (p.pointerType = P, a || P === "touch" || p.isHovered || !_.currentTarget.contains(_.target)) return;
665
+ p.isHovered = !0;
666
+ let w = _.currentTarget;
667
+ p.target = w, t && t({
651
668
  type: "hoverstart",
652
669
  target: w,
653
- pointerType: $
654
- }), o && o(!0), u(!0);
655
- }, O = (m, $) => {
656
- if (d.pointerType = "", d.target = null, $ === "touch" || !d.isHovered) return;
657
- d.isHovered = !1;
658
- let w = m.currentTarget;
659
- r && r({
670
+ pointerType: P
671
+ }), r && r(!0), u(!0);
672
+ }, E = (_, P) => {
673
+ if (p.pointerType = "", p.target = null, P === "touch" || !p.isHovered) return;
674
+ p.isHovered = !1;
675
+ let w = _.currentTarget;
676
+ o && o({
660
677
  type: "hoverend",
661
678
  target: w,
662
- pointerType: $
663
- }), o && o(!1), u(!1);
664
- }, P = {};
665
- return typeof PointerEvent < "u" ? (P.onPointerEnter = (m) => {
666
- J && m.pointerType === "mouse" || b(m, m.pointerType);
667
- }, P.onPointerLeave = (m) => {
668
- !a && m.currentTarget.contains(m.target) && O(m, m.pointerType);
669
- }) : (P.onTouchStart = () => {
670
- d.ignoreEmulatedMouseEvents = !0;
671
- }, P.onMouseEnter = (m) => {
672
- !d.ignoreEmulatedMouseEvents && !J && b(m, "mouse"), d.ignoreEmulatedMouseEvents = !1;
673
- }, P.onMouseLeave = (m) => {
674
- !a && m.currentTarget.contains(m.target) && O(m, "mouse");
679
+ pointerType: P
680
+ }), r && r(!1), u(!1);
681
+ }, x = {};
682
+ return typeof PointerEvent < "u" ? (x.onPointerEnter = (_) => {
683
+ Z && _.pointerType === "mouse" || b(_, _.pointerType);
684
+ }, x.onPointerLeave = (_) => {
685
+ !a && _.currentTarget.contains(_.target) && E(_, _.pointerType);
686
+ }) : (x.onTouchStart = () => {
687
+ p.ignoreEmulatedMouseEvents = !0;
688
+ }, x.onMouseEnter = (_) => {
689
+ !p.ignoreEmulatedMouseEvents && !Z && b(_, "mouse"), p.ignoreEmulatedMouseEvents = !1;
690
+ }, x.onMouseLeave = (_) => {
691
+ !a && _.currentTarget.contains(_.target) && E(_, "mouse");
675
692
  }), {
676
- hoverProps: P,
677
- triggerHoverEnd: O
693
+ hoverProps: x,
694
+ triggerHoverEnd: E
678
695
  };
679
696
  }, [
680
697
  t,
681
- o,
682
698
  r,
699
+ o,
683
700
  a,
684
- d
701
+ p
685
702
  ]);
686
- return X(() => {
687
- a && h({
688
- currentTarget: d.target
689
- }, d.pointerType);
703
+ return J(() => {
704
+ a && g({
705
+ currentTarget: p.target
706
+ }, p.pointerType);
690
707
  }, [
691
708
  a
692
709
  ]), {
693
- hoverProps: _,
694
- isHovered: p
710
+ hoverProps: m,
711
+ isHovered: d
695
712
  };
696
713
  }
697
- function yt(e, t) {
714
+ function wt(e, t) {
698
715
  let {
699
- elementType: o = "button",
700
- isDisabled: r,
716
+ elementType: r = "button",
717
+ isDisabled: o,
701
718
  onPress: a,
702
- onPressStart: p,
719
+ onPressStart: d,
703
720
  onPressEnd: u,
704
- onPressUp: d,
705
- onPressChange: _,
706
- preventFocusOnPress: h,
721
+ onPressUp: p,
722
+ onPressChange: m,
723
+ preventFocusOnPress: g,
707
724
  allowFocusWhenDisabled: b,
708
725
  // @ts-ignore
709
- onClick: O,
710
- href: P,
711
- target: m,
712
- rel: $,
726
+ onClick: E,
727
+ href: x,
728
+ target: _,
729
+ rel: P,
713
730
  type: w = "button"
714
- } = e, T;
715
- o === "button" ? T = {
731
+ } = e, B;
732
+ r === "button" ? B = {
716
733
  type: w,
717
- disabled: r
718
- } : T = {
734
+ disabled: o
735
+ } : B = {
719
736
  role: "button",
720
- tabIndex: r ? void 0 : 0,
721
- href: o === "a" && r ? void 0 : P,
722
- target: o === "a" ? m : void 0,
723
- type: o === "input" ? w : void 0,
724
- disabled: o === "input" ? r : void 0,
725
- "aria-disabled": !r || o === "input" ? void 0 : r,
726
- rel: o === "a" ? $ : void 0
737
+ tabIndex: o ? void 0 : 0,
738
+ href: r === "a" && o ? void 0 : x,
739
+ target: r === "a" ? _ : void 0,
740
+ type: r === "input" ? w : void 0,
741
+ disabled: r === "input" ? o : void 0,
742
+ "aria-disabled": !o || r === "input" ? void 0 : o,
743
+ rel: r === "a" ? P : void 0
727
744
  };
728
- let { pressProps: x, isPressed: B } = ft({
729
- onPressStart: p,
745
+ let { pressProps: S, isPressed: $ } = _t({
746
+ onPressStart: d,
730
747
  onPressEnd: u,
731
- onPressChange: _,
748
+ onPressChange: m,
732
749
  onPress: a,
733
- onPressUp: d,
734
- isDisabled: r,
735
- preventFocusOnPress: h,
750
+ onPressUp: p,
751
+ isDisabled: o,
752
+ preventFocusOnPress: g,
736
753
  ref: t
737
- }), { focusableProps: k } = He(e, t);
738
- b && (k.tabIndex = r ? -1 : k.tabIndex);
739
- let N = H(k, x, Xe(e, {
754
+ }), { focusableProps: k } = Ge(e, t);
755
+ b && (k.tabIndex = o ? -1 : k.tabIndex);
756
+ let O = G(k, S, Je(e, {
740
757
  labelable: !0
741
758
  }));
742
759
  return {
743
- isPressed: B,
744
- buttonProps: H(T, N, {
760
+ isPressed: $,
761
+ buttonProps: G(B, O, {
745
762
  "aria-haspopup": e["aria-haspopup"],
746
763
  "aria-expanded": e["aria-expanded"],
747
764
  "aria-controls": e["aria-controls"],
748
765
  "aria-pressed": e["aria-pressed"],
749
- onClick: (S) => {
750
- O && (O(S), console.warn("onClick is deprecated, please use onPress"));
766
+ onClick: (N) => {
767
+ E && (E(N), console.warn("onClick is deprecated, please use onPress"));
751
768
  }
752
769
  })
753
770
  };
754
771
  }
755
- function kt(e, t, o) {
772
+ function Tt(e, t, r) {
756
773
  return t in e ? Object.defineProperty(e, t, {
757
- value: o,
774
+ value: r,
758
775
  enumerable: !0,
759
776
  configurable: !0,
760
777
  writable: !0
761
- }) : e[t] = o, e;
778
+ }) : e[t] = r, e;
762
779
  }
763
- function ye(e, t) {
764
- var o = Object.keys(e);
780
+ function we(e, t) {
781
+ var r = Object.keys(e);
765
782
  if (Object.getOwnPropertySymbols) {
766
- var r = Object.getOwnPropertySymbols(e);
767
- t && (r = r.filter(function(a) {
783
+ var o = Object.getOwnPropertySymbols(e);
784
+ t && (o = o.filter(function(a) {
768
785
  return Object.getOwnPropertyDescriptor(e, a).enumerable;
769
- })), o.push.apply(o, r);
786
+ })), r.push.apply(r, o);
770
787
  }
771
- return o;
788
+ return r;
772
789
  }
773
- function ke(e) {
790
+ function Te(e) {
774
791
  for (var t = 1; t < arguments.length; t++) {
775
- var o = arguments[t] != null ? arguments[t] : {};
776
- t % 2 ? ye(Object(o), !0).forEach(function(r) {
777
- kt(e, r, o[r]);
778
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : ye(Object(o)).forEach(function(r) {
779
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(o, r));
792
+ var r = arguments[t] != null ? arguments[t] : {};
793
+ t % 2 ? we(Object(r), !0).forEach(function(o) {
794
+ Tt(e, o, r[o]);
795
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : we(Object(r)).forEach(function(o) {
796
+ Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(r, o));
780
797
  });
781
798
  }
782
799
  return e;
783
800
  }
784
- var wt = (e, t, o) => {
785
- for (var r of Object.keys(e)) {
801
+ var Bt = (e, t, r) => {
802
+ for (var o of Object.keys(e)) {
786
803
  var a;
787
- if (e[r] !== ((a = t[r]) !== null && a !== void 0 ? a : o[r]))
804
+ if (e[o] !== ((a = t[o]) !== null && a !== void 0 ? a : r[o]))
788
805
  return !1;
789
806
  }
790
807
  return !0;
791
- }, ee = (e) => (t) => {
792
- var o = e.defaultClassName, r = ke(ke({}, e.defaultVariants), t);
793
- for (var a in r) {
794
- var p, u = (p = r[a]) !== null && p !== void 0 ? p : e.defaultVariants[a];
808
+ }, ne = (e) => (t) => {
809
+ var r = e.defaultClassName, o = Te(Te({}, e.defaultVariants), t);
810
+ for (var a in o) {
811
+ var d, u = (d = o[a]) !== null && d !== void 0 ? d : e.defaultVariants[a];
795
812
  if (u != null) {
796
- var d = u;
797
- typeof d == "boolean" && (d = d === !0 ? "true" : "false");
798
- var _ = (
813
+ var p = u;
814
+ typeof p == "boolean" && (p = p === !0 ? "true" : "false");
815
+ var m = (
799
816
  // @ts-expect-error
800
- e.variantClassNames[a][d]
817
+ e.variantClassNames[a][p]
801
818
  );
802
- _ && (o += " " + _);
819
+ m && (r += " " + m);
803
820
  }
804
821
  }
805
- for (var [h, b] of e.compoundVariants)
806
- wt(h, r, e.defaultVariants) && (o += " " + b);
807
- return o;
808
- }, Et = ee({ defaultClassName: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy0", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy1", false: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy2" }, kind: { default: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy3", link: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy4", confirm: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy5", delete: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy6", key: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy7", icon: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy8" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy9", false: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxya" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [[{ kind: "icon", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyb"], [{ kind: "default", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyc"], [{ kind: "confirm", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyd"], [{ kind: "delete", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxye"], [{ kind: "key", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyf"], [{ disabled: !0, spinning: !1 }, "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyg"]] }), Tt = ee({ defaultClassName: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyh", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyi", false: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyj" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyk", default: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyl", delete: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxym", key: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyn", confirm: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyo", link: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyp" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyq", false: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyr" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [] }), Bt = "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy11", $t = ee({ defaultClassName: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy12", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy13", false: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy14" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] }), Pt = ee({ defaultClassName: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxys", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyt", false: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyu" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyv", default: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyw", delete: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyx", key: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyy", confirm: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxyz", link: "pkg_sps-woodland_buttons__version_8_17_2__hash_125pcxy10" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] });
809
- function xt({
822
+ for (var [g, b] of e.compoundVariants)
823
+ Bt(g, o, e.defaultVariants) && (r += " " + b);
824
+ return r;
825
+ }, $t = ne({ defaultClassName: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy0", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy1", false: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy2" }, kind: { default: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy3", link: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy4", confirm: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy5", delete: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy6", key: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy7", icon: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy8" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy9", false: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxya" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [[{ kind: "icon", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyb"], [{ kind: "default", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyc"], [{ kind: "confirm", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyd"], [{ kind: "delete", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxye"], [{ kind: "key", spinning: !0 }, "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyf"], [{ disabled: !0, spinning: !1 }, "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyg"]] }), Et = ne({ defaultClassName: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyh", variantClassNames: { disabled: { true: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyi", false: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyj" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyk", default: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyl", delete: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxym", key: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyn", confirm: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyo", link: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyp" }, spinning: { true: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyq", false: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyr" } }, defaultVariants: { disabled: !1, kind: "default", spinning: !1 }, compoundVariants: [] }), Pt = "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy11", xt = ne({ defaultClassName: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy12", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy13", false: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy14" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] }), St = ne({ defaultClassName: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxys", variantClassNames: { spinning: { true: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyt", false: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyu" }, kind: { icon: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyv", default: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyw", delete: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyx", key: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyy", confirm: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxyz", link: "pkg_sps-woodland_buttons__version_8_19_0__hash_125pcxy10" } }, defaultVariants: { spinning: !1 }, compoundVariants: [] });
826
+ function Nt({
810
827
  as: e,
811
828
  onClick: t,
812
- onPress: o,
813
- children: r,
829
+ onPress: r,
830
+ children: o,
814
831
  className: a,
815
- isDisabled: p,
832
+ isDisabled: d,
816
833
  disabled: u,
817
- href: d,
818
- icon: _,
819
- kind: h = "default",
834
+ href: p,
835
+ icon: m,
836
+ kind: g = "default",
820
837
  spinning: b,
821
- spinningTitle: O,
822
- title: P,
823
- ...m
824
- }, $) {
825
- const w = e ?? (d ? "a" : "button"), T = {
826
- onPress: o ?? t,
838
+ spinningTitle: E,
839
+ title: x,
840
+ ..._
841
+ }, P) {
842
+ const w = e ?? (p ? "a" : "button"), B = {
843
+ onPress: r ?? t,
827
844
  // the button element should be disabled if the button is marked as disabled or spinning
828
- isDisabled: u ?? p ?? b,
829
- ...m
830
- }, { "data-testid": x } = m, B = $ || c.useRef(null), { buttonProps: k } = yt(T, B), { hoverProps: N } = ht({ isDisabled: T.isDisabled }), { type: S, ...I } = k, te = {
831
- ...H(I, N),
832
- ref: B,
833
- title: P,
834
- className: d ? Pt({ spinning: b, kind: h }) : Tt({ disabled: p || u, kind: h, spinning: b }),
835
- ...d ? { href: d } : { type: S },
836
- ...m
837
- }, { t: n } = c.useContext(Le), f = _ && /* @__PURE__ */ c.createElement(
838
- Ue,
845
+ isDisabled: u ?? d ?? b,
846
+ ..._
847
+ }, { "data-testid": S } = _, $ = P || c.useRef(null), { buttonProps: k } = wt(B, $), { hoverProps: O } = kt({ isDisabled: B.isDisabled }), { type: N, ...A } = k, oe = {
848
+ ...G(A, O),
849
+ ref: $,
850
+ title: x,
851
+ className: p ? St({ spinning: b, kind: g }) : Et({ disabled: d || u, kind: g, spinning: b }),
852
+ ...p ? { href: p } : { type: N },
853
+ ..._
854
+ }, { t: n } = c.useContext(Fe), f = m && /* @__PURE__ */ c.createElement(
855
+ Re,
839
856
  {
840
- className: Bt,
841
- icon: _,
857
+ className: Pt,
858
+ icon: m,
842
859
  "aria-hidden": "true",
843
- "data-testid": `${x}__${_}-icon`
860
+ "data-testid": `${S}__${m}-icon`
844
861
  }
845
862
  );
846
- let E;
847
- h === "default" || h === "icon" || h === "link" ? E = "dark" : E = "light";
863
+ let T;
864
+ g === "default" || g === "icon" || g === "link" ? T = "dark" : T = "light";
848
865
  const l = b && /* @__PURE__ */ c.createElement(
849
- Me,
866
+ Ue,
850
867
  {
851
- color: E,
852
- className: $t({ spinning: b }),
853
- title: O || n("design-system:button.spinningTitle"),
854
- "data-testid": `${x}__spinner`
868
+ color: T,
869
+ className: xt({ spinning: b }),
870
+ title: E || n("design-system:button.spinningTitle"),
871
+ "data-testid": `${S}__spinner`
855
872
  }
856
873
  );
857
- return /* @__PURE__ */ c.createElement(Re, null, /* @__PURE__ */ c.createElement(
874
+ return /* @__PURE__ */ c.createElement(Ve, null, /* @__PURE__ */ c.createElement(
858
875
  "div",
859
876
  {
860
- className: Fe(
861
- Et({
862
- disabled: p || u,
863
- kind: h,
877
+ className: He(
878
+ $t({
879
+ disabled: d || u,
880
+ kind: g,
864
881
  spinning: b
865
882
  }),
866
883
  a
867
884
  )
868
885
  },
869
- /* @__PURE__ */ c.createElement(w, { ...te }, f, r ? /* @__PURE__ */ c.createElement("span", null, r) : "", l)
886
+ /* @__PURE__ */ c.createElement(w, { ...oe }, f, o ? /* @__PURE__ */ c.createElement("span", null, o) : "", l)
870
887
  ));
871
888
  }
872
- const Ie = c.forwardRef(xt);
873
- Ae.set(Ie, {
889
+ const Ae = c.forwardRef(Nt);
890
+ Me.set(Ae, {
874
891
  name: "Button",
875
892
  props: {
876
893
  disabled: "boolean",
@@ -886,8 +903,8 @@ Ae.set(Ie, {
886
903
  },
887
904
  panellable: !0
888
905
  });
889
- const St = {
890
- components: [Ie],
906
+ const Ot = {
907
+ components: [Ae],
891
908
  description: () => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, "Buttons are used to initiate events or actions. The labels and/or icons describe what the button will do."), /* @__PURE__ */ c.createElement("br", null), /* @__PURE__ */ c.createElement("h5", null, "Variants"), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Default: "), "For tertiary actions or actions of lower importance on a page."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Key: "), "For primary or important actions on a page."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Confirm: "), "For the main call to action on a page. There should only be one Confirm button per screen."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Delete: "), "For deleting information or another destructive action. These should always be paired with a Delete Confirmation Modal."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "Disabled: "), "For actions that are not permitted in a particular state. These can be accompanied by a Tooltip on hover describing why it’s disabled."), /* @__PURE__ */ c.createElement("div", { className: "sps-body-14" }, /* @__PURE__ */ c.createElement("span", { className: "sps-text-semibold" }, "With an Icon: "), "For further illustrating the action. Example: Pencil icon in an Edit button. There can also be Icon Buttons without text.")),
892
909
  examples: {
893
910
  basic: {
@@ -896,7 +913,7 @@ const St = {
896
913
  examples: {
897
914
  withoutIcons: {
898
915
  description: "Without Icons",
899
- react: v`
916
+ react: h`
900
917
  import { Button } from "@sps-woodland/buttons";
901
918
  import { sprinkles } from "@sps-woodland/tokens";
902
919
 
@@ -915,7 +932,7 @@ const St = {
915
932
  },
916
933
  withIcons: {
917
934
  description: "With Icons",
918
- react: v`
935
+ react: h`
919
936
  import { Button } from "@sps-woodland/buttons";
920
937
  import { sprinkles } from "@sps-woodland/tokens";
921
938
 
@@ -934,7 +951,7 @@ const St = {
934
951
  },
935
952
  spinning: {
936
953
  description: "Spinning",
937
- react: v`
954
+ react: h`
938
955
  import { Button } from "@sps-woodland/buttons";
939
956
  import { sprinkles } from "@sps-woodland/tokens";
940
957
 
@@ -958,7 +975,7 @@ const St = {
958
975
  examples: {
959
976
  withoutIcons: {
960
977
  description: "Without Icons",
961
- react: v`
978
+ react: h`
962
979
  import { SpsDropdown } from "@spscommerce/ds-react";
963
980
 
964
981
  function Component() {
@@ -1000,7 +1017,7 @@ const St = {
1000
1017
  },
1001
1018
  withIcons: {
1002
1019
  description: "With Icons",
1003
- react: v`
1020
+ react: h`
1004
1021
  import { SpsDropdown } from "@spscommerce/ds-react";
1005
1022
 
1006
1023
  function Component() {
@@ -1047,7 +1064,7 @@ const St = {
1047
1064
  },
1048
1065
  spinning: {
1049
1066
  description: "Spinning",
1050
- react: v`
1067
+ react: h`
1051
1068
  import { SpsDropdown } from "@spscommerce/ds-react";
1052
1069
 
1053
1070
  function Component() {
@@ -1093,7 +1110,7 @@ const St = {
1093
1110
  examples: {
1094
1111
  withoutIcons: {
1095
1112
  description: "Without Icons",
1096
- react: v`
1113
+ react: h`
1097
1114
  import { SpsSplitButton } from "@spscommerce/ds-react";
1098
1115
 
1099
1116
  function Component() {
@@ -1123,7 +1140,7 @@ const St = {
1123
1140
  },
1124
1141
  withIcons: {
1125
1142
  description: "With Icons",
1126
- react: v`
1143
+ react: h`
1127
1144
  import { SpsSplitButton } from "@spscommerce/ds-react";
1128
1145
 
1129
1146
  function Component() {
@@ -1171,7 +1188,7 @@ const St = {
1171
1188
  examples: {
1172
1189
  standard: {
1173
1190
  description: "Standard Icon Buttons",
1174
- react: v`
1191
+ react: h`
1175
1192
  import { Button } from "@sps-woodland/buttons";
1176
1193
  import { sprinkles } from "@sps-woodland/tokens";
1177
1194
 
@@ -1194,7 +1211,7 @@ const St = {
1194
1211
  },
1195
1212
  dropdown: {
1196
1213
  description: ({ NavigateTo: e }) => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("h5", null, "Dropdown Icon Buttons"), /* @__PURE__ */ c.createElement("p", null, "Use these when there are several options available for action. Example: Dropdown Icon Button in a ", /* @__PURE__ */ c.createElement(e, { to: "content-rows" }, "Content Row"), ".")),
1197
- react: v`
1214
+ react: h`
1198
1215
  import { SpsDropdown } from "@spscommerce/ds-react";
1199
1216
 
1200
1217
  function Component() {
@@ -1212,7 +1229,7 @@ const St = {
1212
1229
  },
1213
1230
  spinner: {
1214
1231
  description: "Spinner",
1215
- react: v`
1232
+ react: h`
1216
1233
  import { Button } from "@sps-woodland/buttons";
1217
1234
 
1218
1235
  function Component() {
@@ -1232,7 +1249,7 @@ const St = {
1232
1249
  examples: {
1233
1250
  withoutIcons: {
1234
1251
  description: "Without Icons",
1235
- react: v`
1252
+ react: h`
1236
1253
  import { Button } from "@sps-woodland/buttons";
1237
1254
  import { sprinkles } from "@sps-woodland/tokens";
1238
1255
 
@@ -1249,7 +1266,7 @@ const St = {
1249
1266
  },
1250
1267
  withIcons: {
1251
1268
  description: "With Icons",
1252
- react: v`
1269
+ react: h`
1253
1270
  import { Button } from "@sps-woodland/buttons";
1254
1271
  import { sprinkles } from "@sps-woodland/tokens";
1255
1272
 
@@ -1266,7 +1283,7 @@ const St = {
1266
1283
  },
1267
1284
  spinner: {
1268
1285
  description: "Spinner",
1269
- react: v`
1286
+ react: h`
1270
1287
  import { Button } from "@sps-woodland/buttons";
1271
1288
 
1272
1289
  function Component() {
@@ -1285,7 +1302,7 @@ const St = {
1285
1302
  description: ({ NavigateTo: e }) => /* @__PURE__ */ c.createElement("p", null, "Use to submit a form. There can be a number of visual variations, for example a", " ", /* @__PURE__ */ c.createElement(e, { to: "modals" }, "Modal"), " uses Basic Button (Key) as its Submit Button."),
1286
1303
  examples: {
1287
1304
  basic: {
1288
- react: v`
1305
+ react: h`
1289
1306
  import { Button } from "@sps-woodland/buttons";
1290
1307
  import { sprinkles } from "@sps-woodland/tokens";
1291
1308
 
@@ -1313,7 +1330,7 @@ const St = {
1313
1330
  description: "Used to link to another page, such as an external website. They may open in the same window or in a new one. It should only be used when a Text Button doesn't provide enough visual emphasis.",
1314
1331
  examples: {
1315
1332
  basic: {
1316
- react: v`
1333
+ react: h`
1317
1334
  import { Button } from "@sps-woodland/buttons";
1318
1335
 
1319
1336
  function Component() {
@@ -1335,7 +1352,7 @@ const St = {
1335
1352
  examples: {
1336
1353
  basic: {
1337
1354
  description: "Basic Button Groups",
1338
- react: v`
1355
+ react: h`
1339
1356
  import { Button } from "@sps-woodland/buttons";
1340
1357
  import { sprinkles } from "@sps-woodland/tokens";
1341
1358
 
@@ -1351,7 +1368,7 @@ const St = {
1351
1368
  },
1352
1369
  icon: {
1353
1370
  description: "Icon Button Groups",
1354
- react: v`
1371
+ react: h`
1355
1372
  import { Button } from "@sps-woodland/buttons";
1356
1373
 
1357
1374
  function Component() {
@@ -1366,7 +1383,7 @@ const St = {
1366
1383
  },
1367
1384
  textAndIcons: {
1368
1385
  description: "Text Buttons + Icon Buttons Group",
1369
- react: v`
1386
+ react: h`
1370
1387
  import { Button } from "@sps-woodland/buttons";
1371
1388
  import { sprinkles } from "@sps-woodland/tokens";
1372
1389
  import { VericalRule } from "@sps-woodland/core";
@@ -1385,7 +1402,7 @@ const St = {
1385
1402
  },
1386
1403
  textAndBasic: {
1387
1404
  description: "Text Buttons + Basic Buttons Group",
1388
- react: v`
1405
+ react: h`
1389
1406
  import { Button } from "@sps-woodland/buttons";
1390
1407
  import { sprinkles } from "@sps-woodland/tokens";
1391
1408
  import { VericalRule } from "@sps-woodland/core";
@@ -1405,7 +1422,7 @@ const St = {
1405
1422
  },
1406
1423
  iconsAndBasic: {
1407
1424
  description: "Icon Buttons + Basic Buttons Group",
1408
- react: v`
1425
+ react: h`
1409
1426
  import { Button } from "@sps-woodland/buttons";
1410
1427
  import { sprinkles } from "@sps-woodland/tokens";
1411
1428
  import { VericalRule } from "@sps-woodland/core";
@@ -1426,7 +1443,7 @@ const St = {
1426
1443
  },
1427
1444
  textIconsAndBasic: {
1428
1445
  description: "Text Buttons + Icon Buttons + Basic Buttons Group",
1429
- react: v`
1446
+ react: h`
1430
1447
  import { Button } from "@sps-woodland/buttons";
1431
1448
  import { sprinkles } from "@sps-woodland/tokens";
1432
1449
  import { VericalRule } from "@sps-woodland/core";
@@ -1450,10 +1467,10 @@ const St = {
1450
1467
  }
1451
1468
  }
1452
1469
  }
1453
- }, It = {
1454
- Buttons: St
1470
+ }, At = {
1471
+ Buttons: Ot
1455
1472
  };
1456
1473
  export {
1457
- Ie as Button,
1458
- It as MANIFEST
1474
+ Ae as Button,
1475
+ At as MANIFEST
1459
1476
  };