@a4ui/core 0.37.1 → 0.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/dist/Collapse-Cr5cDqAl.js +375 -0
- package/dist/charts/AreaChart.d.ts +38 -0
- package/dist/charts/BarChart.d.ts +17 -1
- package/dist/charts/PieChart.d.ts +29 -0
- package/dist/charts/RadialBarChart.d.ts +33 -0
- package/dist/charts/index.d.ts +5 -0
- package/dist/charts/shared.d.ts +111 -0
- package/dist/charts.js +1493 -780
- package/dist/commerce.js +625 -634
- package/dist/elements.css +1076 -8
- package/dist/elements.iife.js +1 -6
- package/dist/elements.js +7774 -9133
- package/dist/full.css +1076 -8
- package/dist/index.d.ts +30 -3
- package/dist/index.js +17502 -15126
- package/dist/layout/Aurora.d.ts +16 -0
- package/dist/layout/EffectsToggle.d.ts +1 -1
- package/dist/layout/SpaceBackground.d.ts +1 -1
- package/dist/motion-CTIBwMCA.js +104 -0
- package/dist/styles.css +110 -3
- package/dist/ui/AspectRatio.d.ts +19 -0
- package/dist/ui/Attachment.d.ts +70 -0
- package/dist/ui/ButtonGroup.d.ts +37 -0
- package/dist/ui/ChatMarker.d.ts +20 -0
- package/dist/ui/ChatThread.d.ts +32 -8
- package/dist/ui/ContactSection.d.ts +49 -0
- package/dist/ui/CtaBanner.d.ts +28 -0
- package/dist/ui/Drawer.d.ts +5 -2
- package/dist/ui/Faq.d.ts +29 -0
- package/dist/ui/FeatureGrid.d.ts +35 -0
- package/dist/ui/Field.d.ts +148 -0
- package/dist/ui/Hero.d.ts +48 -0
- package/dist/ui/InputGroup.d.ts +93 -0
- package/dist/ui/Item.d.ts +63 -0
- package/dist/ui/Label.d.ts +23 -0
- package/dist/ui/Menubar.d.ts +83 -0
- package/dist/ui/Message.d.ts +51 -5
- package/dist/ui/Modal.d.ts +8 -2
- package/dist/ui/NativeSelect.d.ts +26 -0
- package/dist/ui/NavigationMenu.d.ts +85 -0
- package/dist/ui/PromptComposer.d.ts +5 -0
- package/dist/ui/Prose.d.ts +21 -0
- package/dist/ui/Questionnaire.d.ts +71 -0
- package/dist/ui/ScrollArea.d.ts +30 -0
- package/dist/ui/Sidebar.d.ts +229 -0
- package/dist/ui/SiteFooter.d.ts +39 -0
- package/dist/ui/SiteNav.d.ts +35 -0
- package/dist/ui/TeamGrid.d.ts +33 -0
- package/dist/ui/Testimonials.d.ts +37 -0
- package/dist/ui/internal/sectionKit.d.ts +22 -0
- package/dist/ui/internal/socialIcons.d.ts +9 -0
- package/package.json +38 -26
- package/preset.d.ts +23 -0
- package/src/charts/AreaChart.tsx +206 -0
- package/src/charts/BarChart.tsx +241 -5
- package/src/charts/DonutChart.tsx +8 -11
- package/src/charts/LineChart.tsx +2 -3
- package/src/charts/PieChart.tsx +145 -0
- package/src/charts/RadialBarChart.tsx +141 -0
- package/src/charts/index.ts +14 -0
- package/src/charts/shared.tsx +304 -0
- package/src/index.ts +192 -3
- package/src/layout/Aurora.tsx +36 -7
- package/src/layout/sceneEffects.ts +22 -3
- package/src/ui/AlertDialog.tsx +6 -3
- package/src/ui/AspectRatio.tsx +35 -0
- package/src/ui/Attachment.tsx +189 -0
- package/src/ui/ButtonGroup.tsx +89 -0
- package/src/ui/ChatMarker.tsx +58 -0
- package/src/ui/ChatThread.tsx +115 -23
- package/src/ui/Command.tsx +6 -3
- package/src/ui/ContactSection.tsx +199 -0
- package/src/ui/CtaBanner.tsx +62 -0
- package/src/ui/DateField.tsx +2 -1
- package/src/ui/DateRangePicker.tsx +2 -1
- package/src/ui/Drawer.tsx +43 -7
- package/src/ui/Faq.tsx +57 -0
- package/src/ui/FeatureGrid.tsx +77 -0
- package/src/ui/Field.tsx +374 -0
- package/src/ui/Hero.tsx +146 -0
- package/src/ui/Image.tsx +6 -3
- package/src/ui/InputGroup.tsx +219 -0
- package/src/ui/Item.tsx +185 -0
- package/src/ui/Label.tsx +50 -0
- package/src/ui/Menubar.tsx +212 -0
- package/src/ui/Message.tsx +139 -13
- package/src/ui/Modal.tsx +47 -8
- package/src/ui/MultiSelect.tsx +2 -1
- package/src/ui/NativeSelect.tsx +66 -0
- package/src/ui/NavigationMenu.tsx +262 -0
- package/src/ui/PromptComposer.tsx +11 -0
- package/src/ui/Prose.tsx +63 -0
- package/src/ui/Questionnaire.tsx +331 -0
- package/src/ui/ScrollArea.tsx +70 -0
- package/src/ui/Sidebar.tsx +753 -0
- package/src/ui/SiteFooter.tsx +112 -0
- package/src/ui/SiteNav.tsx +146 -0
- package/src/ui/TeamGrid.tsx +81 -0
- package/src/ui/Testimonials.tsx +103 -0
- package/src/ui/TimeField.tsx +2 -1
- package/src/ui/internal/sectionKit.tsx +72 -0
- package/src/ui/internal/socialIcons.tsx +41 -0
- package/dist/NumberInput-Bnh2u7pp.js +0 -381
- package/dist/motion-jYMWmZqB.js +0 -119
package/dist/commerce.js
CHANGED
|
@@ -1,650 +1,641 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { g as e } from "./motion-CTIBwMCA.js";
|
|
2
|
+
import { a as t, g as n, i as r, n as i, p as a, r as o, t as s } from "./Collapse-Cr5cDqAl.js";
|
|
3
|
+
import { For as c, Show as l, createMemo as u, createSignal as d } from "solid-js";
|
|
4
|
+
import { className as f, createComponent as p, delegateEvents as m, effect as h, insert as g, memo as _, setAttribute as v, setStyleProperty as y, template as b } from "solid-js/web";
|
|
5
|
+
import { CreditCard as x, Minus as S, Plus as C, Trash2 as w, X as ee } from "lucide-solid";
|
|
6
|
+
// src/commerce/PriceTag.tsx
|
|
7
|
+
var T = /*#__PURE__*/ b("<span class=\"text-muted-foreground line-through\">"), E = /*#__PURE__*/ b("<div><span>"), D = {
|
|
8
|
+
sm: "text-sm",
|
|
9
|
+
md: "text-lg",
|
|
10
|
+
lg: "text-2xl"
|
|
11
11
|
};
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
12
|
+
function O(t) {
|
|
13
|
+
let r = (e) => new Intl.NumberFormat(t.locale ?? "en-US", {
|
|
14
|
+
style: "currency",
|
|
15
|
+
currency: t.currency ?? "USD"
|
|
16
|
+
}).format(e), i = () => (t.compareAt ?? 0) > t.amount, a = () => Math.round((1 - t.amount / t.compareAt) * 100);
|
|
17
|
+
return (() => {
|
|
18
|
+
var o = E(), s = o.firstChild;
|
|
19
|
+
return g(s, () => r(t.amount)), g(o, p(l, {
|
|
20
|
+
get when() {
|
|
21
|
+
return i();
|
|
22
|
+
},
|
|
23
|
+
get children() {
|
|
24
|
+
return [(() => {
|
|
25
|
+
var e = T();
|
|
26
|
+
return g(e, () => r(t.compareAt)), e;
|
|
27
|
+
})(), p(n, {
|
|
28
|
+
tone: "danger",
|
|
29
|
+
get children() {
|
|
30
|
+
return [
|
|
31
|
+
"-",
|
|
32
|
+
_(() => a()),
|
|
33
|
+
"%"
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
})];
|
|
37
|
+
}
|
|
38
|
+
}), null), h((n) => {
|
|
39
|
+
var r = e("inline-flex items-center gap-2", t.class), i = e("font-bold text-foreground", D[t.size ?? "md"]);
|
|
40
|
+
return r !== n.e && f(o, n.e = r), i !== n.t && f(s, n.t = i), n;
|
|
41
|
+
}, {
|
|
42
|
+
e: void 0,
|
|
43
|
+
t: void 0
|
|
44
|
+
}), o;
|
|
45
|
+
})();
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
a: void 0
|
|
59
|
-
}), a;
|
|
60
|
-
})();
|
|
47
|
+
// src/commerce/QuantityStepper.tsx
|
|
48
|
+
var k = /*#__PURE__*/ b("<div><button type=button aria-label=\"Decrease quantity\"class=\"grid h-8 w-8 place-items-center hover:bg-muted disabled:opacity-40\"></button><span class=\"grid min-w-[2.5rem] place-items-center tabular-nums\"></span><button type=button aria-label=\"Increase quantity\"class=\"grid h-8 w-8 place-items-center hover:bg-muted disabled:opacity-40\">");
|
|
49
|
+
function A(t) {
|
|
50
|
+
let n = () => t.min ?? 0, r = () => t.max ?? 2 ** 53 - 1, i = (e) => Math.min(r(), Math.max(n(), e)), a = () => t.onChange(i(t.value - 1)), o = () => t.onChange(i(t.value + 1));
|
|
51
|
+
return (() => {
|
|
52
|
+
var i = k(), s = i.firstChild, c = s.nextSibling, l = c.nextSibling;
|
|
53
|
+
return s.$$click = a, g(s, p(S, { class: "h-4 w-4" })), g(c, () => t.value), l.$$click = o, g(l, p(C, { class: "h-4 w-4" })), h((a) => {
|
|
54
|
+
var o = e("inline-flex items-stretch rounded-md border border-input", t.class), c = t.disabled || t.value <= n(), u = t.disabled || t.value >= r();
|
|
55
|
+
return o !== a.e && f(i, a.e = o), c !== a.t && (s.disabled = a.t = c), u !== a.a && (l.disabled = a.a = u), a;
|
|
56
|
+
}, {
|
|
57
|
+
e: void 0,
|
|
58
|
+
t: void 0,
|
|
59
|
+
a: void 0
|
|
60
|
+
}), i;
|
|
61
|
+
})();
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
m(["click"]);
|
|
64
|
+
// src/commerce/ProductCard.tsx
|
|
65
|
+
var j = /*#__PURE__*/ b("<span>"), M = /*#__PURE__*/ b("<div class=\"relative aspect-square overflow-hidden rounded-lg bg-muted\"><img loading=lazy class=\"h-full w-full object-cover\">", !0, !1, !1), N = /*#__PURE__*/ b("<span class=\"text-[11px] font-medium uppercase tracking-wide text-muted-foreground\">"), P = /*#__PURE__*/ b("<span class=\"w-fit rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground\">"), F = /*#__PURE__*/ b("<div class=\"mt-3 flex flex-1 flex-col gap-1.5\"><p class=\"line-clamp-1 font-medium text-foreground\">"), I = {
|
|
66
|
+
sale: "bg-destructive text-destructive-foreground",
|
|
67
|
+
new: "bg-primary text-primary-foreground",
|
|
68
|
+
featured: "bg-accent text-accent-foreground"
|
|
68
69
|
};
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
function L(e, t) {
|
|
71
|
+
if (t) return t;
|
|
72
|
+
let n = (e ?? "").toLowerCase();
|
|
73
|
+
return /sale|off|%|deal/.test(n) ? "sale" : /new/.test(n) ? "new" : "featured";
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
});
|
|
75
|
+
function R(n) {
|
|
76
|
+
return p(t, {
|
|
77
|
+
glass: !0,
|
|
78
|
+
glow: !0,
|
|
79
|
+
get tilt() {
|
|
80
|
+
return n.tilt;
|
|
81
|
+
},
|
|
82
|
+
get spotlight() {
|
|
83
|
+
return n.spotlight;
|
|
84
|
+
},
|
|
85
|
+
get class() {
|
|
86
|
+
return e("flex h-full flex-col overflow-hidden p-4", n.class);
|
|
87
|
+
},
|
|
88
|
+
get children() {
|
|
89
|
+
return [(() => {
|
|
90
|
+
var t = M(), r = t.firstChild;
|
|
91
|
+
return g(t, p(l, {
|
|
92
|
+
get when() {
|
|
93
|
+
return n.badge;
|
|
94
|
+
},
|
|
95
|
+
get children() {
|
|
96
|
+
var t = j();
|
|
97
|
+
return g(t, () => n.badge), h(() => f(t, e("absolute -right-9 top-3.5 w-32 rotate-45 py-1 text-center text-[11px] font-semibold uppercase tracking-wide shadow-md", I[L(n.badge, n.badgeTone)]))), t;
|
|
98
|
+
}
|
|
99
|
+
}), null), h((e) => {
|
|
100
|
+
var t = n.image, i = n.title;
|
|
101
|
+
return t !== e.e && v(r, "src", e.e = t), i !== e.t && v(r, "alt", e.t = i), e;
|
|
102
|
+
}, {
|
|
103
|
+
e: void 0,
|
|
104
|
+
t: void 0
|
|
105
|
+
}), t;
|
|
106
|
+
})(), (() => {
|
|
107
|
+
var e = F(), t = e.firstChild;
|
|
108
|
+
return g(e, p(l, {
|
|
109
|
+
get when() {
|
|
110
|
+
return n.brand;
|
|
111
|
+
},
|
|
112
|
+
get children() {
|
|
113
|
+
var e = N();
|
|
114
|
+
return g(e, () => n.brand), e;
|
|
115
|
+
}
|
|
116
|
+
}), t), g(t, () => n.title), g(e, p(l, {
|
|
117
|
+
get when() {
|
|
118
|
+
return n.category;
|
|
119
|
+
},
|
|
120
|
+
get children() {
|
|
121
|
+
var e = P();
|
|
122
|
+
return g(e, () => n.category), e;
|
|
123
|
+
}
|
|
124
|
+
}), null), g(e, p(l, {
|
|
125
|
+
get when() {
|
|
126
|
+
return n.rating !== void 0;
|
|
127
|
+
},
|
|
128
|
+
get children() {
|
|
129
|
+
return p(i, {
|
|
130
|
+
get value() {
|
|
131
|
+
return n.rating;
|
|
132
|
+
},
|
|
133
|
+
readonly: !0,
|
|
134
|
+
max: 5
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}), null), g(e, p(O, {
|
|
138
|
+
get amount() {
|
|
139
|
+
return n.price;
|
|
140
|
+
},
|
|
141
|
+
get compareAt() {
|
|
142
|
+
return n.compareAt;
|
|
143
|
+
},
|
|
144
|
+
get currency() {
|
|
145
|
+
return n.currency;
|
|
146
|
+
},
|
|
147
|
+
get locale() {
|
|
148
|
+
return n.locale;
|
|
149
|
+
}
|
|
150
|
+
}), null), g(e, p(l, {
|
|
151
|
+
get when() {
|
|
152
|
+
return n.onAddToCart;
|
|
153
|
+
},
|
|
154
|
+
get children() {
|
|
155
|
+
return p(a, {
|
|
156
|
+
class: "mt-auto w-full",
|
|
157
|
+
onClick: (e) => {
|
|
158
|
+
e.stopPropagation(), n.onAddToCart?.();
|
|
159
|
+
},
|
|
160
|
+
children: "Add to cart"
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}), null), e;
|
|
164
|
+
})()];
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
167
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
168
|
+
// src/commerce/ProductGrid.tsx
|
|
169
|
+
var z = /*#__PURE__*/ b("<div>");
|
|
170
|
+
function B(t) {
|
|
171
|
+
return (() => {
|
|
172
|
+
var n = z();
|
|
173
|
+
return g(n, () => t.children), h(() => f(n, e("grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4", t.class))), n;
|
|
174
|
+
})();
|
|
174
175
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return (u = e.onRemove) == null ? void 0 : u.call(e);
|
|
226
|
-
}, n(t, c(X, {
|
|
227
|
-
class: "h-4 w-4"
|
|
228
|
-
})), t;
|
|
229
|
-
}
|
|
230
|
-
}), null), $(() => C(r, _("flex flex-wrap items-center gap-4", e.class))), r;
|
|
231
|
-
})();
|
|
176
|
+
// src/commerce/CartLine.tsx
|
|
177
|
+
var V = /*#__PURE__*/ b("<img class=\"h-16 w-16 shrink-0 rounded-md bg-muted object-cover\">"), H = /*#__PURE__*/ b("<button type=button aria-label=\"Remove item\"class=\"text-muted-foreground hover:text-foreground\">"), U = /*#__PURE__*/ b("<div><div class=\"min-w-[8rem] flex-1\"><p class=\"line-clamp-1 font-medium text-foreground\"></p></div><span class=\"min-w-[4rem] text-right font-medium tabular-nums text-foreground\">");
|
|
178
|
+
function W(t) {
|
|
179
|
+
let n = () => t.price * t.quantity, r = (e) => new Intl.NumberFormat(t.locale ?? "en-US", {
|
|
180
|
+
style: "currency",
|
|
181
|
+
currency: t.currency ?? "USD"
|
|
182
|
+
}).format(e);
|
|
183
|
+
return (() => {
|
|
184
|
+
var i = U(), a = i.firstChild, o = a.firstChild, s = a.nextSibling;
|
|
185
|
+
return g(i, p(l, {
|
|
186
|
+
get when() {
|
|
187
|
+
return t.image;
|
|
188
|
+
},
|
|
189
|
+
get children() {
|
|
190
|
+
var e = V();
|
|
191
|
+
return h((n) => {
|
|
192
|
+
var r = t.image, i = t.title;
|
|
193
|
+
return r !== n.e && v(e, "src", n.e = r), i !== n.t && v(e, "alt", n.t = i), n;
|
|
194
|
+
}, {
|
|
195
|
+
e: void 0,
|
|
196
|
+
t: void 0
|
|
197
|
+
}), e;
|
|
198
|
+
}
|
|
199
|
+
}), a), g(o, () => t.title), g(a, p(O, {
|
|
200
|
+
get amount() {
|
|
201
|
+
return t.price;
|
|
202
|
+
},
|
|
203
|
+
get currency() {
|
|
204
|
+
return t.currency;
|
|
205
|
+
},
|
|
206
|
+
get locale() {
|
|
207
|
+
return t.locale;
|
|
208
|
+
},
|
|
209
|
+
size: "sm"
|
|
210
|
+
}), null), g(i, p(A, {
|
|
211
|
+
get value() {
|
|
212
|
+
return t.quantity;
|
|
213
|
+
},
|
|
214
|
+
onChange: (e) => t.onQuantityChange?.(e),
|
|
215
|
+
min: 1
|
|
216
|
+
}), s), g(s, () => r(n())), g(i, p(l, {
|
|
217
|
+
get when() {
|
|
218
|
+
return t.onRemove;
|
|
219
|
+
},
|
|
220
|
+
get children() {
|
|
221
|
+
var e = H();
|
|
222
|
+
return e.$$click = () => t.onRemove?.(), g(e, p(w, { class: "h-4 w-4" })), e;
|
|
223
|
+
}
|
|
224
|
+
}), null), h(() => f(i, e("flex flex-wrap items-center gap-4", t.class))), i;
|
|
225
|
+
})();
|
|
232
226
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}), null), $(() => C(o, _("card glow-edge rounded-xl p-5 text-card-foreground", e.class))), o;
|
|
267
|
-
})();
|
|
227
|
+
m(["click"]);
|
|
228
|
+
// src/commerce/CartSummary.tsx
|
|
229
|
+
var G = /*#__PURE__*/ b("<div><div class=\"my-3 border-t border-border\"></div><div class=\"flex items-center justify-between text-base font-bold text-foreground\"><span>Total</span><span class=tabular-nums>"), K = /*#__PURE__*/ b("<div class=\"flex items-center justify-between py-1 text-sm\"><span class=text-muted-foreground></span><span class=\"tabular-nums text-foreground\">");
|
|
230
|
+
function q(t) {
|
|
231
|
+
let n = (e) => new Intl.NumberFormat(t.locale ?? "en-US", {
|
|
232
|
+
style: "currency",
|
|
233
|
+
currency: t.currency ?? "USD"
|
|
234
|
+
}).format(e);
|
|
235
|
+
return (() => {
|
|
236
|
+
var r = G(), i = r.firstChild, o = i.nextSibling.firstChild.nextSibling;
|
|
237
|
+
return g(r, p(c, {
|
|
238
|
+
get each() {
|
|
239
|
+
return t.lines;
|
|
240
|
+
},
|
|
241
|
+
children: (e) => (() => {
|
|
242
|
+
var t = K(), r = t.firstChild, i = r.nextSibling;
|
|
243
|
+
return g(r, () => e.label), g(i, () => n(e.amount)), t;
|
|
244
|
+
})()
|
|
245
|
+
}), i), g(o, () => n(t.total)), g(r, p(l, {
|
|
246
|
+
get when() {
|
|
247
|
+
return t.onCheckout;
|
|
248
|
+
},
|
|
249
|
+
get children() {
|
|
250
|
+
return p(a, {
|
|
251
|
+
class: "mt-4 w-full",
|
|
252
|
+
onClick: () => t.onCheckout?.(),
|
|
253
|
+
get children() {
|
|
254
|
+
return t.checkoutLabel ?? "Checkout";
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}), null), h(() => f(r, e("card glow-edge rounded-xl p-5 text-card-foreground", t.class))), r;
|
|
259
|
+
})();
|
|
268
260
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
261
|
+
// src/commerce/FilterGroup.tsx
|
|
262
|
+
var J = /*#__PURE__*/ b("<div><p class=\"text-sm font-semibold text-foreground\"></p><div class=space-y-1.5>"), te = /*#__PURE__*/ b("<span class=\"text-xs text-muted-foreground\">"), Y = /*#__PURE__*/ b("<div class=\"flex items-center justify-between gap-2\">");
|
|
263
|
+
function X(t) {
|
|
264
|
+
let n = (e, n) => {
|
|
265
|
+
let r = t.selected.slice(), i = r.indexOf(e);
|
|
266
|
+
n ? i === -1 && r.push(e) : i !== -1 && r.splice(i, 1), t.onChange(r);
|
|
267
|
+
};
|
|
268
|
+
return (() => {
|
|
269
|
+
var i = J(), a = i.firstChild, o = a.nextSibling;
|
|
270
|
+
return g(a, () => t.title), g(o, p(c, {
|
|
271
|
+
get each() {
|
|
272
|
+
return t.options;
|
|
273
|
+
},
|
|
274
|
+
children: (e) => (() => {
|
|
275
|
+
var i = Y();
|
|
276
|
+
return g(i, p(r, {
|
|
277
|
+
get checked() {
|
|
278
|
+
return t.selected.includes(e.value);
|
|
279
|
+
},
|
|
280
|
+
onChange: (t) => n(e.value, t),
|
|
281
|
+
get label() {
|
|
282
|
+
return e.label;
|
|
283
|
+
}
|
|
284
|
+
}), null), g(i, p(l, {
|
|
285
|
+
get when() {
|
|
286
|
+
return e.count != null;
|
|
287
|
+
},
|
|
288
|
+
get children() {
|
|
289
|
+
var t = te();
|
|
290
|
+
return g(t, () => e.count), t;
|
|
291
|
+
}
|
|
292
|
+
}), null), i;
|
|
293
|
+
})()
|
|
294
|
+
})), h(() => f(i, e("space-y-2", t.class))), i;
|
|
295
|
+
})();
|
|
303
296
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
297
|
+
// src/commerce/FacetSidebar.tsx
|
|
298
|
+
var Z = /*#__PURE__*/ b("<div class=space-y-2><p class=\"text-sm font-semibold text-foreground\">"), Q = /*#__PURE__*/ b("<p class=\"text-sm text-muted-foreground\"> results"), ne = /*#__PURE__*/ b("<div class=\"flex flex-wrap gap-2\">"), re = /*#__PURE__*/ b("<div><div class=\"flex items-center justify-between gap-2\">"), ie = /*#__PURE__*/ b("<span class=\"inline-flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-xs\"><button type=button class=\"text-muted-foreground hover:text-foreground\">"), ae = /*#__PURE__*/ b("<div class=space-y-2><div class=\"flex items-center justify-between\"><p class=\"text-sm font-semibold text-foreground\">Price</p><p class=\"text-xs text-muted-foreground\">$<!> – $</p></div><div class=\"flex items-center gap-2\"><span class=\"text-sm text-muted-foreground\">–");
|
|
299
|
+
function oe(e) {
|
|
300
|
+
let [t, n] = d(e.section.defaultOpen ?? !0);
|
|
301
|
+
return p(l, {
|
|
302
|
+
get when() {
|
|
303
|
+
return e.section.collapsible ?? !0;
|
|
304
|
+
},
|
|
305
|
+
get fallback() {
|
|
306
|
+
return (() => {
|
|
307
|
+
var t = Z(), n = t.firstChild;
|
|
308
|
+
return g(n, () => e.section.title), g(t, p(X, {
|
|
309
|
+
title: "",
|
|
310
|
+
get options() {
|
|
311
|
+
return e.section.options;
|
|
312
|
+
},
|
|
313
|
+
get selected() {
|
|
314
|
+
return e.selected;
|
|
315
|
+
},
|
|
316
|
+
get onChange() {
|
|
317
|
+
return e.onChange;
|
|
318
|
+
}
|
|
319
|
+
}), null), t;
|
|
320
|
+
})();
|
|
321
|
+
},
|
|
322
|
+
get children() {
|
|
323
|
+
return p(s, {
|
|
324
|
+
get open() {
|
|
325
|
+
return t();
|
|
326
|
+
},
|
|
327
|
+
onOpenChange: n,
|
|
328
|
+
get title() {
|
|
329
|
+
return e.section.title;
|
|
330
|
+
},
|
|
331
|
+
get children() {
|
|
332
|
+
return p(X, {
|
|
333
|
+
title: "",
|
|
334
|
+
get options() {
|
|
335
|
+
return e.section.options;
|
|
336
|
+
},
|
|
337
|
+
get selected() {
|
|
338
|
+
return e.selected;
|
|
339
|
+
},
|
|
340
|
+
get onChange() {
|
|
341
|
+
return e.onChange;
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
});
|
|
354
348
|
}
|
|
355
|
-
function
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
},
|
|
468
|
-
onChange: (u) => e.onChange(t.key, u)
|
|
469
|
-
})
|
|
470
|
-
}), null), $(() => C(d, _("space-y-5", e.class))), d;
|
|
471
|
-
})();
|
|
349
|
+
function se(t) {
|
|
350
|
+
let n = () => {
|
|
351
|
+
let e = [];
|
|
352
|
+
for (let n of t.sections) {
|
|
353
|
+
let r = t.selected[n.key] ?? [];
|
|
354
|
+
for (let t of r) {
|
|
355
|
+
let r = n.options.find((e) => e.value === t);
|
|
356
|
+
e.push({
|
|
357
|
+
sectionKey: n.key,
|
|
358
|
+
value: t,
|
|
359
|
+
label: r?.label ?? t
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return e;
|
|
364
|
+
}, r = (e) => {
|
|
365
|
+
let n = t.selected[e.sectionKey] ?? [];
|
|
366
|
+
t.onChange(e.sectionKey, n.filter((t) => t !== e.value));
|
|
367
|
+
}, i = (e) => {
|
|
368
|
+
if (!t.price || !t.onPriceChange) return;
|
|
369
|
+
let n = Math.min(e, t.price.value[1]);
|
|
370
|
+
t.onPriceChange([n, t.price.value[1]]);
|
|
371
|
+
}, s = (e) => {
|
|
372
|
+
if (!t.price || !t.onPriceChange) return;
|
|
373
|
+
let n = Math.max(e, t.price.value[0]);
|
|
374
|
+
t.onPriceChange([t.price.value[0], n]);
|
|
375
|
+
};
|
|
376
|
+
return (() => {
|
|
377
|
+
var u = re(), d = u.firstChild;
|
|
378
|
+
return g(d, p(l, {
|
|
379
|
+
get when() {
|
|
380
|
+
return t.resultCount != null;
|
|
381
|
+
},
|
|
382
|
+
get children() {
|
|
383
|
+
var e = Q(), n = e.firstChild;
|
|
384
|
+
return g(e, () => t.resultCount, n), e;
|
|
385
|
+
}
|
|
386
|
+
}), null), g(d, p(l, {
|
|
387
|
+
get when() {
|
|
388
|
+
return t.onClearAll;
|
|
389
|
+
},
|
|
390
|
+
get children() {
|
|
391
|
+
return p(a, {
|
|
392
|
+
variant: "ghost",
|
|
393
|
+
class: "ml-auto h-auto px-2 py-1 text-xs",
|
|
394
|
+
onClick: () => t.onClearAll?.(),
|
|
395
|
+
children: "Clear all"
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}), null), g(u, p(l, {
|
|
399
|
+
get when() {
|
|
400
|
+
return n().length > 0;
|
|
401
|
+
},
|
|
402
|
+
get children() {
|
|
403
|
+
var e = ne();
|
|
404
|
+
return g(e, p(c, {
|
|
405
|
+
get each() {
|
|
406
|
+
return n();
|
|
407
|
+
},
|
|
408
|
+
children: (e) => (() => {
|
|
409
|
+
var t = ie(), n = t.firstChild;
|
|
410
|
+
return g(t, () => e.label, n), n.$$click = () => r(e), g(n, p(ee, { class: "h-3 w-3" })), h(() => v(n, "aria-label", `Remove ${e.label}`)), t;
|
|
411
|
+
})()
|
|
412
|
+
})), e;
|
|
413
|
+
}
|
|
414
|
+
}), null), g(u, p(l, {
|
|
415
|
+
get when() {
|
|
416
|
+
return t.price;
|
|
417
|
+
},
|
|
418
|
+
children: (e) => (() => {
|
|
419
|
+
var t = ae(), n = t.firstChild, r = n.firstChild.nextSibling, a = r.firstChild.nextSibling;
|
|
420
|
+
a.nextSibling;
|
|
421
|
+
var c = n.nextSibling, l = c.firstChild;
|
|
422
|
+
return g(r, () => e().value[0], a), g(r, () => e().value[1], null), g(c, p(o, {
|
|
423
|
+
get value() {
|
|
424
|
+
return e().value[0];
|
|
425
|
+
},
|
|
426
|
+
onChange: i,
|
|
427
|
+
get min() {
|
|
428
|
+
return e().min;
|
|
429
|
+
},
|
|
430
|
+
get max() {
|
|
431
|
+
return e().value[1];
|
|
432
|
+
},
|
|
433
|
+
"aria-label": "Minimum price"
|
|
434
|
+
}), l), g(c, p(o, {
|
|
435
|
+
get value() {
|
|
436
|
+
return e().value[1];
|
|
437
|
+
},
|
|
438
|
+
onChange: s,
|
|
439
|
+
get min() {
|
|
440
|
+
return e().value[0];
|
|
441
|
+
},
|
|
442
|
+
get max() {
|
|
443
|
+
return e().max;
|
|
444
|
+
},
|
|
445
|
+
"aria-label": "Maximum price"
|
|
446
|
+
}), null), t;
|
|
447
|
+
})()
|
|
448
|
+
}), null), g(u, p(c, {
|
|
449
|
+
get each() {
|
|
450
|
+
return t.sections;
|
|
451
|
+
},
|
|
452
|
+
children: (e) => p(oe, {
|
|
453
|
+
section: e,
|
|
454
|
+
get selected() {
|
|
455
|
+
return t.selected[e.key] ?? [];
|
|
456
|
+
},
|
|
457
|
+
onChange: (n) => t.onChange(e.key, n)
|
|
458
|
+
})
|
|
459
|
+
}), null), h(() => f(u, e("space-y-5", t.class))), u;
|
|
460
|
+
})();
|
|
472
461
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
462
|
+
m(["click"]);
|
|
463
|
+
// src/commerce/PriceBlock.tsx
|
|
464
|
+
var ce = /*#__PURE__*/ b("<span class=\"text-muted-foreground line-through\">"), le = /*#__PURE__*/ b("<span class=\"inline-flex items-center gap-1 text-sm text-muted-foreground\">As low as <!>/mo"), ue = /*#__PURE__*/ b("<div><div class=\"flex flex-wrap items-center gap-2\"><span>"), de = /*#__PURE__*/ b("<span class=\"text-sm text-muted-foreground\"> after code "), fe = /*#__PURE__*/ b("<div class=\"flex flex-wrap items-center gap-2\"><span class=\"inline-flex items-center gap-1 rounded-md border border-dashed border-primary/50 px-2 py-0.5 text-xs font-mono text-foreground\"> "), pe = {
|
|
465
|
+
md: "text-xl",
|
|
466
|
+
lg: "text-3xl"
|
|
478
467
|
};
|
|
479
|
-
function
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
468
|
+
function $(t) {
|
|
469
|
+
let r = (e) => new Intl.NumberFormat(t.locale ?? "en-US", {
|
|
470
|
+
style: "currency",
|
|
471
|
+
currency: t.currency ?? "USD"
|
|
472
|
+
}).format(e), i = () => (t.compareAt ?? 0) > t.amount, a = () => t.compareAt - t.amount, o = () => Math.round((1 - t.amount / t.compareAt) * 100), s = () => {
|
|
473
|
+
let e = t.coupon?.amount ?? 0;
|
|
474
|
+
return Math.max(0, t.amount - e);
|
|
475
|
+
}, c = () => {
|
|
476
|
+
let e = t.financing, n = e.apr ?? 0;
|
|
477
|
+
if (n > 0) {
|
|
478
|
+
let r = n / 12, i = e.months, a = t.amount * r / (1 - (1 + r) ** -i);
|
|
479
|
+
return Math.round(a * 100) / 100;
|
|
480
|
+
}
|
|
481
|
+
return Math.round(t.amount / e.months * 100) / 100;
|
|
482
|
+
};
|
|
483
|
+
return (() => {
|
|
484
|
+
var u = ue(), d = u.firstChild, m = d.firstChild;
|
|
485
|
+
return g(m, () => r(t.amount)), g(d, p(l, {
|
|
486
|
+
get when() {
|
|
487
|
+
return i();
|
|
488
|
+
},
|
|
489
|
+
get children() {
|
|
490
|
+
return [(() => {
|
|
491
|
+
var e = ce();
|
|
492
|
+
return g(e, () => r(t.compareAt)), e;
|
|
493
|
+
})(), p(n, {
|
|
494
|
+
tone: "danger",
|
|
495
|
+
get children() {
|
|
496
|
+
return [
|
|
497
|
+
"Save ",
|
|
498
|
+
_(() => r(a())),
|
|
499
|
+
" (-",
|
|
500
|
+
_(() => o()),
|
|
501
|
+
"%)"
|
|
502
|
+
];
|
|
503
|
+
}
|
|
504
|
+
})];
|
|
505
|
+
}
|
|
506
|
+
}), null), g(u, p(l, {
|
|
507
|
+
get when() {
|
|
508
|
+
return t.coupon;
|
|
509
|
+
},
|
|
510
|
+
children: (e) => (() => {
|
|
511
|
+
var t = fe(), n = t.firstChild, i = n.firstChild;
|
|
512
|
+
return g(n, () => e().label ?? "Coupon", i), g(n, () => e().code, null), g(t, p(l, {
|
|
513
|
+
get when() {
|
|
514
|
+
return e().amount !== void 0;
|
|
515
|
+
},
|
|
516
|
+
get children() {
|
|
517
|
+
var t = de(), n = t.firstChild;
|
|
518
|
+
return g(t, () => r(s()), n), g(t, () => e().code, null), t;
|
|
519
|
+
}
|
|
520
|
+
}), null), t;
|
|
521
|
+
})()
|
|
522
|
+
}), null), g(u, p(l, {
|
|
523
|
+
get when() {
|
|
524
|
+
return t.financing;
|
|
525
|
+
},
|
|
526
|
+
get children() {
|
|
527
|
+
var e = le(), t = e.firstChild, n = t.nextSibling;
|
|
528
|
+
return n.nextSibling, g(e, p(x, { class: "h-4 w-4" }), t), g(e, () => r(c()), n), e;
|
|
529
|
+
}
|
|
530
|
+
}), null), g(u, p(l, {
|
|
531
|
+
get when() {
|
|
532
|
+
return t.note;
|
|
533
|
+
},
|
|
534
|
+
get children() {
|
|
535
|
+
return t.note;
|
|
536
|
+
}
|
|
537
|
+
}), null), h((n) => {
|
|
538
|
+
var r = e("flex flex-col gap-1", t.class), i = e("font-bold text-foreground", pe[t.size ?? "lg"]);
|
|
539
|
+
return r !== n.e && f(u, n.e = r), i !== n.t && f(m, n.t = i), n;
|
|
540
|
+
}, {
|
|
541
|
+
e: void 0,
|
|
542
|
+
t: void 0
|
|
543
|
+
}), u;
|
|
544
|
+
})();
|
|
553
545
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
},
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
546
|
+
// src/commerce/ConditionScale.tsx
|
|
547
|
+
var me = /*#__PURE__*/ b("<span class=\"text-sm text-muted-foreground\"> / "), he = /*#__PURE__*/ b("<div><div class=\"flex items-end justify-between gap-2\"><span class=\"font-semibold text-foreground\"></span></div><div class=\"relative mt-2 h-2 w-full rounded-full bg-muted\"role=meter><div class=\"absolute h-2 rounded-full bg-gradient-to-r from-primary/40 to-primary\"></div><div class=\"absolute -top-1 h-4 w-4 -translate-x-1/2 rounded-full border-2 border-background bg-primary shadow\"></div></div><div class=\"flex items-center justify-between text-xs text-muted-foreground\">"), ge = /*#__PURE__*/ b("<span>"), _e = [
|
|
548
|
+
{
|
|
549
|
+
min: 10,
|
|
550
|
+
label: "Brand New"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
min: 9,
|
|
554
|
+
label: "Excellent"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
min: 7,
|
|
558
|
+
label: "Very Good"
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
min: 5,
|
|
562
|
+
label: "Good"
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
min: 1,
|
|
566
|
+
label: "Fair"
|
|
567
|
+
}
|
|
568
|
+
];
|
|
569
|
+
function ve(t) {
|
|
570
|
+
let n = () => t.min ?? 1, r = () => t.max ?? 10, i = () => (t.tiers ?? _e).slice().sort((e, t) => e.min - t.min), a = () => {
|
|
571
|
+
let e = r() - n();
|
|
572
|
+
return e <= 0 ? 0 : Math.max(0, Math.min(100, (t.value - n()) / e * 100));
|
|
573
|
+
}, o = () => {
|
|
574
|
+
let e = i(), n = e[0];
|
|
575
|
+
for (let r of e) r.min <= t.value && (n = r);
|
|
576
|
+
return n;
|
|
577
|
+
};
|
|
578
|
+
return (() => {
|
|
579
|
+
var s = he(), u = s.firstChild, d = u.firstChild, m = u.nextSibling, _ = m.firstChild, b = _.nextSibling, x = m.nextSibling;
|
|
580
|
+
return g(d, () => o()?.label), g(u, p(l, {
|
|
581
|
+
get when() {
|
|
582
|
+
return t.showValue ?? !0;
|
|
583
|
+
},
|
|
584
|
+
get children() {
|
|
585
|
+
var e = me(), n = e.firstChild;
|
|
586
|
+
return g(e, () => t.value, n), g(e, r, null), e;
|
|
587
|
+
}
|
|
588
|
+
}), null), g(x, p(c, {
|
|
589
|
+
get each() {
|
|
590
|
+
return [i()[0], i()[i().length - 1]];
|
|
591
|
+
},
|
|
592
|
+
children: (e) => (() => {
|
|
593
|
+
var t = ge();
|
|
594
|
+
return g(t, () => e?.label), t;
|
|
595
|
+
})()
|
|
596
|
+
})), h((i) => {
|
|
597
|
+
var c = e("flex flex-col gap-2", t.class), l = n(), u = r(), d = t.value, p = o()?.label ?? "Condition", h = `${a()}%`, g = `${a()}%`;
|
|
598
|
+
return c !== i.e && f(s, i.e = c), l !== i.t && v(m, "aria-valuemin", i.t = l), u !== i.a && v(m, "aria-valuemax", i.a = u), d !== i.o && v(m, "aria-valuenow", i.o = d), p !== i.i && v(m, "aria-label", i.i = p), h !== i.n && y(_, "width", i.n = h), g !== i.s && y(b, "left", i.s = g), i;
|
|
599
|
+
}, {
|
|
600
|
+
e: void 0,
|
|
601
|
+
t: void 0,
|
|
602
|
+
a: void 0,
|
|
603
|
+
o: void 0,
|
|
604
|
+
i: void 0,
|
|
605
|
+
n: void 0,
|
|
606
|
+
s: void 0
|
|
607
|
+
}), s;
|
|
608
|
+
})();
|
|
617
609
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
610
|
+
// src/commerce/createCart.ts
|
|
611
|
+
function ye(e = []) {
|
|
612
|
+
let [t, n] = d(e), r = (e, t = 1) => {
|
|
613
|
+
n((n) => n.find((t) => t.product.id === e.id) ? n.map((n) => n.product.id === e.id ? {
|
|
614
|
+
...n,
|
|
615
|
+
qty: n.qty + t
|
|
616
|
+
} : n) : [...n, {
|
|
617
|
+
product: e,
|
|
618
|
+
qty: t
|
|
619
|
+
}]);
|
|
620
|
+
}, i = (e) => {
|
|
621
|
+
n((t) => t.filter((t) => t.product.id !== e));
|
|
622
|
+
};
|
|
623
|
+
return {
|
|
624
|
+
items: t,
|
|
625
|
+
add: r,
|
|
626
|
+
remove: i,
|
|
627
|
+
setQty: (e, t) => {
|
|
628
|
+
t <= 0 ? i(e) : n((n) => n.map((n) => n.product.id === e ? {
|
|
629
|
+
...n,
|
|
630
|
+
qty: t
|
|
631
|
+
} : n));
|
|
632
|
+
},
|
|
633
|
+
clear: () => {
|
|
634
|
+
n([]);
|
|
635
|
+
},
|
|
636
|
+
count: u(() => t().reduce((e, t) => e + t.qty, 0)),
|
|
637
|
+
subtotal: u(() => t().reduce((e, t) => e + t.product.price * t.qty, 0)),
|
|
638
|
+
has: (e) => t().some((t) => t.product.id === e)
|
|
639
|
+
};
|
|
637
640
|
}
|
|
638
|
-
export {
|
|
639
|
-
Oe as CartLine,
|
|
640
|
-
Ge as CartSummary,
|
|
641
|
-
Qe as ConditionScale,
|
|
642
|
-
ze as FacetSidebar,
|
|
643
|
-
q as FilterGroup,
|
|
644
|
-
Ke as PriceBlock,
|
|
645
|
-
L as PriceTag,
|
|
646
|
-
De as ProductCard,
|
|
647
|
-
Le as ProductGrid,
|
|
648
|
-
ee as QuantityStepper,
|
|
649
|
-
Ve as createCart
|
|
650
|
-
};
|
|
641
|
+
export { W as CartLine, q as CartSummary, ve as ConditionScale, se as FacetSidebar, X as FilterGroup, $ as PriceBlock, O as PriceTag, R as ProductCard, B as ProductGrid, A as QuantityStepper, ye as createCart };
|