@usethrottle/storefront-react 0.0.0-stage → 0.1.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.
Files changed (122) hide show
  1. package/CLAUDE.md +67 -0
  2. package/README.md +119 -2
  3. package/dist/StorefrontProvider-Br4wUHui.d.cts +559 -0
  4. package/dist/StorefrontProvider-DLEPEjg6.d.ts +559 -0
  5. package/dist/account/index.cjs +69 -0
  6. package/dist/account/index.cjs.map +1 -0
  7. package/dist/account/index.d.cts +23 -0
  8. package/dist/account/index.d.ts +23 -0
  9. package/dist/account/index.js +68 -0
  10. package/dist/account/index.js.map +1 -0
  11. package/dist/chunk-2LCPIY2P.cjs +16 -0
  12. package/dist/chunk-2LCPIY2P.cjs.map +1 -0
  13. package/dist/chunk-3A72UY6T.js +2126 -0
  14. package/dist/chunk-3A72UY6T.js.map +1 -0
  15. package/dist/chunk-3JMIVAHN.js +185 -0
  16. package/dist/chunk-3JMIVAHN.js.map +1 -0
  17. package/dist/chunk-4J6AGWNC.cjs +24 -0
  18. package/dist/chunk-4J6AGWNC.cjs.map +1 -0
  19. package/dist/chunk-4U6MYDZV.js +17 -0
  20. package/dist/chunk-4U6MYDZV.js.map +1 -0
  21. package/dist/chunk-66HDJVPS.js +22 -0
  22. package/dist/chunk-66HDJVPS.js.map +1 -0
  23. package/dist/chunk-6X2OZSNV.cjs +83 -0
  24. package/dist/chunk-6X2OZSNV.cjs.map +1 -0
  25. package/dist/chunk-6ZMMZ245.cjs +2127 -0
  26. package/dist/chunk-6ZMMZ245.cjs.map +1 -0
  27. package/dist/chunk-7R37CVAB.cjs +23 -0
  28. package/dist/chunk-7R37CVAB.cjs.map +1 -0
  29. package/dist/chunk-A3IFWQUV.js +368 -0
  30. package/dist/chunk-A3IFWQUV.js.map +1 -0
  31. package/dist/chunk-AYC2YK4E.cjs +95 -0
  32. package/dist/chunk-AYC2YK4E.cjs.map +1 -0
  33. package/dist/chunk-AZV5U7YB.cjs +18 -0
  34. package/dist/chunk-AZV5U7YB.cjs.map +1 -0
  35. package/dist/chunk-CE2SKNQP.cjs +71 -0
  36. package/dist/chunk-CE2SKNQP.cjs.map +1 -0
  37. package/dist/chunk-D76CRI4X.js +2175 -0
  38. package/dist/chunk-D76CRI4X.js.map +1 -0
  39. package/dist/chunk-DOAII637.cjs +186 -0
  40. package/dist/chunk-DOAII637.cjs.map +1 -0
  41. package/dist/chunk-DYHHAOMG.cjs +17 -0
  42. package/dist/chunk-DYHHAOMG.cjs.map +1 -0
  43. package/dist/chunk-EYSVU5SJ.js +196 -0
  44. package/dist/chunk-EYSVU5SJ.js.map +1 -0
  45. package/dist/chunk-HSUUDZWS.js +37 -0
  46. package/dist/chunk-HSUUDZWS.js.map +1 -0
  47. package/dist/chunk-HZ6VEN6Q.cjs +101 -0
  48. package/dist/chunk-HZ6VEN6Q.cjs.map +1 -0
  49. package/dist/chunk-IJOTLGPT.js +16 -0
  50. package/dist/chunk-IJOTLGPT.js.map +1 -0
  51. package/dist/chunk-ISDATHVC.js +219 -0
  52. package/dist/chunk-ISDATHVC.js.map +1 -0
  53. package/dist/chunk-LW2A6USV.js +100 -0
  54. package/dist/chunk-LW2A6USV.js.map +1 -0
  55. package/dist/chunk-M4YXSLRG.cjs +369 -0
  56. package/dist/chunk-M4YXSLRG.cjs.map +1 -0
  57. package/dist/chunk-NDUEJJLP.cjs +2176 -0
  58. package/dist/chunk-NDUEJJLP.cjs.map +1 -0
  59. package/dist/chunk-NNE4FYRT.js +820 -0
  60. package/dist/chunk-NNE4FYRT.js.map +1 -0
  61. package/dist/chunk-NW3EFHY2.js +15 -0
  62. package/dist/chunk-NW3EFHY2.js.map +1 -0
  63. package/dist/chunk-NZRUQUN5.js +167 -0
  64. package/dist/chunk-NZRUQUN5.js.map +1 -0
  65. package/dist/chunk-P6HHE57S.cjs +38 -0
  66. package/dist/chunk-P6HHE57S.cjs.map +1 -0
  67. package/dist/chunk-PHY7AY27.cjs +197 -0
  68. package/dist/chunk-PHY7AY27.cjs.map +1 -0
  69. package/dist/chunk-PNJOFFTL.cjs +128 -0
  70. package/dist/chunk-PNJOFFTL.cjs.map +1 -0
  71. package/dist/chunk-PXZQ4ONA.js +127 -0
  72. package/dist/chunk-PXZQ4ONA.js.map +1 -0
  73. package/dist/chunk-Q3VTUBPP.js +82 -0
  74. package/dist/chunk-Q3VTUBPP.js.map +1 -0
  75. package/dist/chunk-Q3XFD5UI.js +45 -0
  76. package/dist/chunk-Q3XFD5UI.js.map +1 -0
  77. package/dist/chunk-QM7KTT7F.js +94 -0
  78. package/dist/chunk-QM7KTT7F.js.map +1 -0
  79. package/dist/chunk-RLWZOLXL.js +70 -0
  80. package/dist/chunk-RLWZOLXL.js.map +1 -0
  81. package/dist/chunk-SV53BRP2.js +23 -0
  82. package/dist/chunk-SV53BRP2.js.map +1 -0
  83. package/dist/chunk-VWXJO427.cjs +821 -0
  84. package/dist/chunk-VWXJO427.cjs.map +1 -0
  85. package/dist/chunk-WIIOJDHR.cjs +220 -0
  86. package/dist/chunk-WIIOJDHR.cjs.map +1 -0
  87. package/dist/chunk-XQHGFWLG.cjs +46 -0
  88. package/dist/chunk-XQHGFWLG.cjs.map +1 -0
  89. package/dist/chunk-ZHCXI2ZZ.cjs +168 -0
  90. package/dist/chunk-ZHCXI2ZZ.cjs.map +1 -0
  91. package/dist/index-RSj2Rg62.d.cts +8 -0
  92. package/dist/index-RSj2Rg62.d.ts +8 -0
  93. package/dist/index.cjs +2829 -0
  94. package/dist/index.cjs.map +1 -0
  95. package/dist/index.d.cts +1718 -0
  96. package/dist/index.d.ts +1718 -0
  97. package/dist/index.js +2828 -0
  98. package/dist/index.js.map +1 -0
  99. package/dist/metadata-QhKw-tvz.d.cts +188 -0
  100. package/dist/metadata-QhKw-tvz.d.ts +188 -0
  101. package/dist/next/client.cjs +84 -0
  102. package/dist/next/client.cjs.map +1 -0
  103. package/dist/next/client.d.cts +40 -0
  104. package/dist/next/client.d.ts +40 -0
  105. package/dist/next/client.js +83 -0
  106. package/dist/next/client.js.map +1 -0
  107. package/dist/next/index.cjs +1090 -0
  108. package/dist/next/index.cjs.map +1 -0
  109. package/dist/next/index.d.cts +218 -0
  110. package/dist/next/index.d.ts +218 -0
  111. package/dist/next/index.js +1049 -0
  112. package/dist/next/index.js.map +1 -0
  113. package/dist/server/index.cjs +994 -0
  114. package/dist/server/index.cjs.map +1 -0
  115. package/dist/server/index.d.cts +229 -0
  116. package/dist/server/index.d.ts +229 -0
  117. package/dist/server/index.js +951 -0
  118. package/dist/server/index.js.map +1 -0
  119. package/dist/styles.css +2111 -0
  120. package/dist/use-part-DCfFk7kf.d.ts +24 -0
  121. package/dist/use-part-DgjPBL_O.d.cts +24 -0
  122. package/package.json +121 -3
@@ -0,0 +1,2127 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
3
+
4
+
5
+ var _chunk2LCPIY2Pcjs = require('./chunk-2LCPIY2P.cjs');
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+ var _chunkM4YXSLRGcjs = require('./chunk-M4YXSLRG.cjs');
16
+
17
+
18
+
19
+
20
+ var _chunkVWXJO427cjs = require('./chunk-VWXJO427.cjs');
21
+
22
+ // src/link.tsx
23
+ var _jsxruntime = require('react/jsx-runtime');
24
+ var DefaultLink = ({ prefetch: _prefetch, ...anchor }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { ...anchor });
25
+
26
+ // src/settings/normalize.ts
27
+ var SORT_KEYS = [
28
+ "relevance",
29
+ "featured",
30
+ "manual",
31
+ "title_asc",
32
+ "title_desc",
33
+ "price_asc",
34
+ "price_desc",
35
+ "newest",
36
+ "updated",
37
+ "best_rated"
38
+ ];
39
+ var ENUMS = [
40
+ [["theme", "colorScheme"], ["light", "dark", "auto"]],
41
+ [["theme", "spacingScale"], ["compact", "comfortable", "roomy"]],
42
+ [["listing", "pagination"], ["numbered", "load_more", "infinite"]],
43
+ [["listing", "filterLayout"], ["sidebar", "topbar", "drawer"]],
44
+ [["listing", "defaultSort"], SORT_KEYS],
45
+ [["card", "style"], ["standard", "minimal", "overlay", "row"]],
46
+ [["product", "layout"], ["classic", "stacked", "editorial"]],
47
+ [["product", "sectionsStyle"], ["auto", "tabs", "accordion", "stacked"]]
48
+ ];
49
+ var SECTION_KEYS = ["description", "specs", "shipping", "tags", "categories", "related", "reviews"];
50
+ function fill(defaults, raw) {
51
+ if (_chunkM4YXSLRGcjs.isRecord.call(void 0, defaults)) {
52
+ const given = _chunkM4YXSLRGcjs.isRecord.call(void 0, raw) ? raw : {};
53
+ const out = {};
54
+ for (const key of Object.keys(defaults)) out[key] = fill(defaults[key], given[key]);
55
+ for (const key of Object.keys(given)) if (!_chunkM4YXSLRGcjs.isUnsafeKey.call(void 0, key) && !(key in out)) out[key] = given[key];
56
+ return out;
57
+ }
58
+ if (Array.isArray(defaults)) return Array.isArray(raw) ? raw : defaults;
59
+ if (defaults === null) return raw === void 0 ? null : raw;
60
+ if (typeof defaults === "number") return typeof raw === "number" && Number.isFinite(raw) ? raw : defaults;
61
+ return typeof raw === typeof defaults ? raw : defaults;
62
+ }
63
+ function cleanMenu(items) {
64
+ if (!Array.isArray(items)) return [];
65
+ return items.flatMap((item) => {
66
+ if (!_chunkM4YXSLRGcjs.isRecord.call(void 0, item) || typeof item.label !== "string" || !_chunkM4YXSLRGcjs.isRecord.call(void 0, item.target)) return [];
67
+ if (item.children === void 0) return [item];
68
+ if (!Array.isArray(item.children)) return [];
69
+ return [{ ...item, children: cleanMenu(item.children) }];
70
+ });
71
+ }
72
+ var warned = /* @__PURE__ */ new Set();
73
+ function warnOnce(key, message) {
74
+ if (process.env.NODE_ENV === "production" || warned.has(key)) return;
75
+ warned.add(key);
76
+ console.warn(`[@usethrottle/storefront-react] ${message}`);
77
+ }
78
+ function get(obj, path) {
79
+ let at = obj;
80
+ for (const key of path) at = _chunkM4YXSLRGcjs.isRecord.call(void 0, at) ? at[key] : void 0;
81
+ return at;
82
+ }
83
+ function set(obj, path, value) {
84
+ let at = obj;
85
+ for (const key of path.slice(0, -1)) at = at[key];
86
+ at[path[path.length - 1]] = value;
87
+ }
88
+ function normalizeSettings(raw) {
89
+ const out = fill(_chunkM4YXSLRGcjs.DEFAULT_SETTINGS, raw);
90
+ const strings = out.strings;
91
+ const defaultStrings = _chunkM4YXSLRGcjs.DEFAULT_SETTINGS.strings;
92
+ for (const key of Object.keys(defaultStrings)) if (strings[key] === "") strings[key] = defaultStrings[key];
93
+ for (const [path, allowed] of ENUMS) {
94
+ const value = get(out, path);
95
+ if (typeof value === "string" && allowed.includes(value)) continue;
96
+ const dotted = path.join(".");
97
+ warnOnce(`enum:${dotted}`, `settings.${dotted} has an unknown value (${JSON.stringify(value)}); using the default.`);
98
+ set(out, path, get(_chunkM4YXSLRGcjs.DEFAULT_SETTINGS, path));
99
+ }
100
+ const listing = out.listing;
101
+ listing.sorts = listing.sorts.filter(
102
+ (s) => _chunkM4YXSLRGcjs.isRecord.call(void 0, s) && typeof s.key === "string" && SORT_KEYS.includes(s.key)
103
+ );
104
+ const product = out.product;
105
+ product.sections = product.sections.filter(
106
+ (s) => _chunkM4YXSLRGcjs.isRecord.call(void 0, s) && typeof s.key === "string" && SECTION_KEYS.includes(s.key)
107
+ );
108
+ const nav = out.navigation;
109
+ nav.header = cleanMenu(nav.header);
110
+ nav.footer = cleanMenu(nav.footer);
111
+ const badges = out.badges;
112
+ badges.custom = badges.custom.filter(_chunkM4YXSLRGcjs.isRecord);
113
+ const home = out.home;
114
+ home.shelves = home.shelves.filter(_chunkM4YXSLRGcjs.isRecord);
115
+ return out;
116
+ }
117
+
118
+ // src/styles/index.ts
119
+ var _ui = require('@usethrottle/ui');
120
+
121
+ // src/presets/bold.css.ts
122
+ var BOLD_CSS = `
123
+ [data-throttle-preset="bold"] {
124
+ --throttle-sf-heading-weight: 800;
125
+ --throttle-sf-heading-tracking: 0.02em;
126
+ --throttle-sf-heading-transform: uppercase;
127
+ }
128
+ `;
129
+
130
+ // src/presets/clean.css.ts
131
+ var CLEAN_CSS = `
132
+ [data-throttle-preset="clean"] {
133
+ --throttle-sf-heading-weight: 600;
134
+ --throttle-sf-heading-tracking: -0.01em;
135
+ --throttle-sf-heading-transform: none;
136
+ }
137
+ `;
138
+
139
+ // src/presets/editorial.css.ts
140
+ var EDITORIAL_CSS = `
141
+ [data-throttle-preset="editorial"] {
142
+ --throttle-sf-heading-weight: 400;
143
+ --throttle-sf-heading-tracking: 0;
144
+ --throttle-sf-heading-transform: none;
145
+ }
146
+ `;
147
+
148
+ // src/presets/index.ts
149
+ var PRESET_CSS = CLEAN_CSS + EDITORIAL_CSS + BOLD_CSS;
150
+
151
+ // src/styles/base.css.ts
152
+ var BASE_CSS = `
153
+ .tsf-root {
154
+ --throttle-sf-accent: #2563eb;
155
+ --throttle-sf-accent-hover: #1d4ed8;
156
+ --throttle-sf-accent-subtle: #eaf0fd;
157
+ --throttle-sf-sale: #b91c1c;
158
+ --throttle-sf-success: #15803d;
159
+ --throttle-sf-warning: #b45309;
160
+ --throttle-sf-danger: #b91c1c;
161
+ --throttle-sf-card-radius: 8px;
162
+ --throttle-sf-grid-gap: 20px;
163
+ --throttle-sf-heading-weight: 600;
164
+ --throttle-sf-heading-tracking: -0.01em;
165
+ --throttle-sf-heading-transform: none;
166
+ background: var(--throttle-color-background);
167
+ color: var(--throttle-color-foreground);
168
+ text-align: start;
169
+ }
170
+
171
+ .tsf-slot-outlet { display: block; }
172
+ `;
173
+
174
+ // src/styles/frame.css.ts
175
+ var FRAME_CSS = `
176
+ .tsf-skip-link {
177
+ position: absolute;
178
+ inset-inline-start: 8px;
179
+ inset-block-start: -120px;
180
+ z-index: 1000;
181
+ padding: 12px 16px;
182
+ border-radius: 8px;
183
+ background: var(--throttle-color-primary);
184
+ color: var(--throttle-color-primary-foreground);
185
+ font-weight: 600;
186
+ text-decoration: none;
187
+ }
188
+ .tsf-skip-link:focus { inset-block-start: 8px; }
189
+
190
+ .tsf-store-frame { display: flex; flex-direction: column; min-block-size: 100vh; }
191
+ .tsf-store-frame-main { flex: 1 0 auto; }
192
+ .tsf-store-frame-main:focus { outline: none; }
193
+
194
+ .tsf-announcement-bar {
195
+ position: relative;
196
+ display: flex;
197
+ align-items: center;
198
+ justify-content: center;
199
+ min-block-size: 44px;
200
+ padding-block: 4px;
201
+ padding-inline: 52px;
202
+ background: var(--throttle-color-primary);
203
+ color: var(--throttle-color-primary-foreground);
204
+ font-size: 13px;
205
+ text-align: center;
206
+ }
207
+ .tsf-announcement-bar-text { display: inline-flex; align-items: center; min-block-size: 44px; margin: 0; color: inherit; text-decoration: none; }
208
+ .tsf-announcement-bar-text:hover { text-decoration: underline; }
209
+ .tsf-announcement-bar-dismiss {
210
+ position: absolute;
211
+ inset-inline-end: 4px;
212
+ inset-block-start: 0;
213
+ display: inline-flex;
214
+ align-items: center;
215
+ justify-content: center;
216
+ min-inline-size: 44px;
217
+ min-block-size: 44px;
218
+ border: 0;
219
+ background: transparent;
220
+ color: inherit;
221
+ cursor: pointer;
222
+ }
223
+
224
+ .tsf-header:focus { outline: none; }
225
+ .tsf-header { border-block-end: 1px solid var(--throttle-color-border); background: var(--throttle-color-background); color: var(--throttle-color-foreground); }
226
+ .tsf-header-bar {
227
+ display: flex;
228
+ flex-wrap: wrap;
229
+ align-items: center;
230
+ gap: 4px 12px;
231
+ max-inline-size: 1280px;
232
+ margin-inline: auto;
233
+ padding-block: 8px;
234
+ padding-inline: 16px;
235
+ }
236
+ .tsf-header-menu-button,
237
+ .tsf-header-drawer-close,
238
+ .tsf-category-nav-toggle,
239
+ .tsf-cart-button,
240
+ .tsf-account-button {
241
+ position: relative;
242
+ display: inline-flex;
243
+ align-items: center;
244
+ justify-content: center;
245
+ min-inline-size: 44px;
246
+ min-block-size: 44px;
247
+ border: 0;
248
+ border-radius: 8px;
249
+ background: transparent;
250
+ color: inherit;
251
+ cursor: pointer;
252
+ text-decoration: none;
253
+ }
254
+ .tsf-header-menu-button:hover,
255
+ .tsf-header-drawer-close:hover,
256
+ .tsf-cart-button:hover,
257
+ .tsf-account-button:hover { background: var(--throttle-color-muted); }
258
+ @media (min-width: 960px) { .tsf-header-menu-button { display: none; } }
259
+
260
+ .tsf-header-brand {
261
+ display: inline-flex;
262
+ align-items: center;
263
+ gap: 8px;
264
+ flex: none;
265
+ min-inline-size: 44px;
266
+ min-block-size: 44px;
267
+ color: inherit;
268
+ font-size: 20px;
269
+ font-weight: var(--throttle-sf-heading-weight);
270
+ letter-spacing: var(--throttle-sf-heading-tracking);
271
+ text-transform: var(--throttle-sf-heading-transform);
272
+ text-decoration: none;
273
+ }
274
+ .tsf-header-logo { display: block; block-size: 32px; inline-size: auto; max-inline-size: 160px; }
275
+ .tsf-header-store-name:where([data-has-logo]) {
276
+ position: absolute;
277
+ inline-size: 1px;
278
+ block-size: 1px;
279
+ margin: -1px;
280
+ padding: 0;
281
+ overflow: hidden;
282
+ clip: rect(0 0 0 0);
283
+ white-space: nowrap;
284
+ border: 0;
285
+ }
286
+ .tsf-header-search { order: 3; flex: 1 1 100%; min-inline-size: 0; }
287
+ @media (min-width: 640px) {
288
+ .tsf-header-search { order: 0; flex: 1 1 auto; max-inline-size: 520px; margin-inline: auto; }
289
+ }
290
+ .tsf-header-actions { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; }
291
+ @media (min-width: 640px) { .tsf-header-actions { margin-inline-start: 0; } }
292
+
293
+ .tsf-header-nav-row {
294
+ display: flex;
295
+ align-items: center;
296
+ justify-content: space-between;
297
+ gap: 16px;
298
+ max-inline-size: 1280px;
299
+ margin-inline: auto;
300
+ padding-inline: 16px;
301
+ }
302
+ @media (max-width: 959px) { .tsf-header-nav-row { display: none; } }
303
+ .tsf-header-prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-inline-start: auto; }
304
+ .tsf-header-prefs:where([data-in-drawer]) { margin-inline-start: 0; padding-block: 8px; padding-inline: 16px; }
305
+ .tsf-header-drawer-top {
306
+ display: flex;
307
+ align-items: center;
308
+ justify-content: space-between;
309
+ padding-block: 8px;
310
+ padding-inline: 16px;
311
+ border-block-end: 1px solid var(--throttle-color-border);
312
+ }
313
+ .tsf-header-drawer-title { margin: 0; font-size: 18px; font-weight: var(--throttle-sf-heading-weight); }
314
+
315
+ .tsf-category-nav-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; margin: 0; padding: 0; list-style: none; }
316
+ .tsf-category-nav-list:where([data-stacked="true"]) { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding-block: 8px; padding-inline: 16px; }
317
+ .tsf-category-nav-item { position: relative; display: flex; align-items: center; }
318
+ .tsf-category-nav-item:where([data-stacked="true"]) { flex-wrap: wrap; }
319
+ .tsf-category-nav-link {
320
+ display: inline-flex;
321
+ align-items: center;
322
+ min-block-size: 44px;
323
+ color: inherit;
324
+ text-decoration: none;
325
+ }
326
+ .tsf-category-nav-link:hover { color: var(--throttle-sf-accent); }
327
+ .tsf-category-nav-toggle { min-inline-size: 28px; }
328
+ .tsf-category-nav-panel {
329
+ position: absolute;
330
+ inset-block-start: 100%;
331
+ inset-inline-start: 0;
332
+ z-index: 30;
333
+ min-inline-size: 200px;
334
+ margin: 0;
335
+ padding: 8px;
336
+ list-style: none;
337
+ background: var(--throttle-color-background);
338
+ border: 1px solid var(--throttle-color-border);
339
+ border-radius: var(--throttle-radius, 8px);
340
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
341
+ }
342
+ .tsf-category-nav-panel:where([data-stacked="true"]) {
343
+ position: static;
344
+ flex-basis: 100%;
345
+ min-inline-size: 0;
346
+ padding-block: 0;
347
+ padding-inline: 16px 0;
348
+ border: 0;
349
+ box-shadow: none;
350
+ }
351
+
352
+ .tsf-search-box {
353
+ position: relative;
354
+ display: flex;
355
+ align-items: center;
356
+ gap: 8px;
357
+ min-block-size: 44px;
358
+ padding-inline: 12px;
359
+ border: 1px solid var(--throttle-color-border-control);
360
+ border-radius: 999px;
361
+ background: var(--throttle-color-background);
362
+ color: var(--throttle-color-muted-foreground);
363
+ }
364
+ .tsf-search-box:focus-within { outline: 2px solid var(--throttle-sf-accent); outline-offset: 2px; }
365
+ .tsf-search-box-input {
366
+ flex: 1 1 auto;
367
+ min-inline-size: 0;
368
+ padding-block: 10px;
369
+ border: 0;
370
+ outline: none;
371
+ background: transparent;
372
+ color: var(--throttle-color-foreground);
373
+ font: inherit;
374
+ }
375
+ .tsf-search-box-panel {
376
+ position: absolute;
377
+ inset-inline: 0;
378
+ inset-block-start: calc(100% + 4px);
379
+ z-index: 40;
380
+ max-block-size: min(70vh, 480px);
381
+ overflow: auto;
382
+ padding: 8px;
383
+ border: 1px solid var(--throttle-color-border);
384
+ border-radius: var(--throttle-radius, 8px);
385
+ background: var(--throttle-color-background);
386
+ color: var(--throttle-color-foreground);
387
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
388
+ }
389
+ .tsf-search-box-group-label {
390
+ padding-block: 8px 4px;
391
+ padding-inline: 8px;
392
+ color: var(--throttle-color-muted-foreground);
393
+ font-size: 12px;
394
+ font-weight: 600;
395
+ letter-spacing: 0.04em;
396
+ text-transform: uppercase;
397
+ }
398
+ .tsf-search-box-option,
399
+ .tsf-search-box-all {
400
+ display: flex;
401
+ align-items: center;
402
+ gap: 10px;
403
+ min-block-size: 44px;
404
+ padding: 6px 8px;
405
+ border-radius: 6px;
406
+ color: inherit;
407
+ text-decoration: none;
408
+ }
409
+ .tsf-search-box-option:hover,
410
+ .tsf-search-box-all:hover,
411
+ .tsf-search-box-option:where([aria-selected="true"]),
412
+ .tsf-search-box-all:where([aria-selected="true"]) { background: var(--throttle-color-muted); }
413
+ .tsf-search-box-all { font-weight: 600; color: var(--throttle-sf-accent); }
414
+ .tsf-search-box-thumb { flex: none; inline-size: 40px; }
415
+ .tsf-search-box-option-name { flex: 1 1 auto; min-inline-size: 0; overflow-wrap: anywhere; }
416
+ .tsf-search-box-option-meta { flex: none; color: var(--throttle-color-muted-foreground); font-size: 13px; }
417
+ .tsf-search-box-none { margin: 0; padding: 8px; color: var(--throttle-color-muted-foreground); }
418
+ .tsf-search-box-status {
419
+ position: absolute;
420
+ inline-size: 1px;
421
+ block-size: 1px;
422
+ margin: -1px;
423
+ padding: 0;
424
+ overflow: hidden;
425
+ clip: rect(0 0 0 0);
426
+ white-space: nowrap;
427
+ border: 0;
428
+ }
429
+
430
+ .tsf-locale-switch,
431
+ .tsf-currency-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
432
+ .tsf-locale-switch-label,
433
+ .tsf-currency-switch-label { color: var(--throttle-color-muted-foreground); }
434
+ .tsf-locale-switch-select,
435
+ .tsf-currency-switch-select {
436
+ min-block-size: 44px;
437
+ padding-inline: 8px;
438
+ border: 1px solid var(--throttle-color-border-control);
439
+ border-radius: 6px;
440
+ background: var(--throttle-color-background);
441
+ color: var(--throttle-color-foreground);
442
+ font: inherit;
443
+ }
444
+
445
+ .tsf-cart-button-count {
446
+ position: absolute;
447
+ inset-block-start: 4px;
448
+ inset-inline-end: 2px;
449
+ min-inline-size: 18px;
450
+ block-size: 18px;
451
+ padding-inline: 4px;
452
+ border-radius: 999px;
453
+ background: var(--throttle-sf-accent);
454
+ color: #ffffff;
455
+ font-size: 11px;
456
+ font-weight: 600;
457
+ line-height: 18px;
458
+ text-align: center;
459
+ font-variant-numeric: tabular-nums;
460
+ }
461
+ .tsf-cart-button-count:where([data-empty]) { display: none; }
462
+
463
+ .tsf-header-menu-button:focus-visible,
464
+ .tsf-header-drawer-close:focus-visible,
465
+ .tsf-header-brand:focus-visible,
466
+ .tsf-category-nav-link:focus-visible,
467
+ .tsf-category-nav-toggle:focus-visible,
468
+ .tsf-cart-button:focus-visible,
469
+ .tsf-account-button:focus-visible,
470
+ .tsf-announcement-bar-dismiss:focus-visible,
471
+ .tsf-announcement-bar-text:focus-visible,
472
+ .tsf-footer-link:focus-visible,
473
+ .tsf-search-box-option:focus-visible,
474
+ .tsf-search-box-all:focus-visible,
475
+ .tsf-locale-switch-select:focus-visible,
476
+ .tsf-currency-switch-select:focus-visible { outline: 2px solid var(--throttle-sf-accent); outline-offset: 2px; }
477
+
478
+ .tsf-footer {
479
+ margin-block-start: 48px;
480
+ padding-block: 32px;
481
+ padding-inline: 16px;
482
+ border-block-start: 1px solid var(--throttle-color-border);
483
+ background: var(--throttle-color-surface);
484
+ color: var(--throttle-color-foreground);
485
+ }
486
+ .tsf-footer-brand,
487
+ .tsf-footer-extra { max-inline-size: 1280px; margin-inline: auto; margin-block-end: 24px; }
488
+ .tsf-footer-extra { margin-block: 24px 0; }
489
+ .tsf-footer-nav { max-inline-size: 1280px; margin-inline: auto; }
490
+ .tsf-footer-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 40px; margin: 0; padding: 0; list-style: none; }
491
+ .tsf-footer-sublist { display: grid; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; }
492
+ .tsf-footer-link { display: inline-flex; align-items: center; min-inline-size: 44px; min-block-size: 44px; color: inherit; text-decoration: none; }
493
+ .tsf-footer-link:hover { color: var(--throttle-sf-accent); text-decoration: underline; }
494
+ .tsf-footer-copyright { max-inline-size: 1280px; margin-block: 24px 0; margin-inline: auto; color: color-mix(in srgb, var(--throttle-color-muted-foreground) 75%, var(--throttle-color-foreground)); font-size: 13px; }
495
+ `;
496
+
497
+ // src/styles/merch.css.ts
498
+ var MERCH_CSS = `
499
+ .tsf-merch-skeleton { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--throttle-sf-grid-gap); }
500
+ .tsf-merch-skeleton-item { aspect-ratio: 4 / 5; border-radius: var(--throttle-sf-card-radius); background: var(--throttle-color-muted); }
501
+ @media (min-width: 768px) { .tsf-merch-skeleton { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
502
+
503
+ .tsf-collection-shelf { display: block; }
504
+ .tsf-collection-shelf-header,
505
+ .tsf-product-carousel-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-block-end: 16px; }
506
+ .tsf-collection-shelf-title,
507
+ .tsf-product-carousel-title { margin: 0; font-size: 22px; font-weight: var(--throttle-sf-heading-weight); letter-spacing: var(--throttle-sf-heading-tracking); text-transform: var(--throttle-sf-heading-transform); }
508
+ .tsf-collection-shelf-eyebrow,
509
+ .tsf-product-carousel-eyebrow { flex: 1 0 100%; margin: 0; color: var(--throttle-sf-accent); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
510
+ .tsf-collection-shelf-link { display: inline-flex; align-items: center; min-block-size: 44px; color: var(--throttle-sf-accent); font-weight: 500; text-decoration: none; }
511
+ .tsf-collection-shelf-link:hover { color: var(--throttle-sf-accent-hover); text-decoration: underline; }
512
+ .tsf-collection-shelf-grid { display: grid; grid-template-columns: repeat(var(--tsf-columns-mobile, 2), minmax(0, 1fr)); gap: var(--throttle-sf-grid-gap); margin: 0; padding: 0; list-style: none; }
513
+ .tsf-collection-shelf-item { min-inline-size: 0; }
514
+ @media (min-width: 768px) { .tsf-collection-shelf-grid { grid-template-columns: repeat(var(--tsf-columns-desktop, 4), minmax(0, 1fr)); } }
515
+
516
+ .tsf-product-carousel { display: block; }
517
+ .tsf-product-carousel-controls { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
518
+ .tsf-product-carousel-prev,
519
+ .tsf-product-carousel-next { display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; padding: 0; border: 1px solid var(--throttle-color-border-control); border-radius: 999px; background: var(--throttle-color-background); color: var(--throttle-color-foreground); cursor: pointer; }
520
+ .tsf-product-carousel-prev:hover:not(:disabled),
521
+ .tsf-product-carousel-next:hover:not(:disabled) { border-color: var(--throttle-color-foreground); }
522
+ .tsf-product-carousel-prev:disabled,
523
+ .tsf-product-carousel-next:disabled { opacity: 0.4; cursor: default; }
524
+ .tsf-product-carousel-track { display: flex; gap: var(--throttle-sf-grid-gap); margin: 0; padding: 0; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
525
+ .tsf-product-carousel-item { flex: 0 0 68%; min-inline-size: 0; scroll-snap-align: start; }
526
+ @media (min-width: 640px) { .tsf-product-carousel-item { flex-basis: calc((100% - var(--throttle-sf-grid-gap)) / 2); } }
527
+ @media (min-width: 900px) { .tsf-product-carousel-item { flex-basis: calc((100% - 2 * var(--throttle-sf-grid-gap)) / 3); } }
528
+ @media (min-width: 1200px) { .tsf-product-carousel-item { flex-basis: calc((100% - 3 * var(--throttle-sf-grid-gap)) / 4); } }
529
+ @media (prefers-reduced-motion: no-preference) { .tsf-product-carousel-track { scroll-behavior: smooth; } }
530
+
531
+ .tsf-featured-product { display: grid; gap: 24px; align-items: center; }
532
+ .tsf-featured-product-media { min-inline-size: 0; max-inline-size: 520px; }
533
+ .tsf-featured-product-media-link { display: block; }
534
+ .tsf-featured-product-placeholder { inline-size: 100%; background: var(--throttle-color-muted); border-radius: var(--throttle-sf-card-radius); }
535
+ .tsf-featured-product-body { display: grid; gap: 12px; justify-items: start; min-inline-size: 0; }
536
+ .tsf-featured-product-title { margin: 0; font-size: 28px; font-weight: var(--throttle-sf-heading-weight); letter-spacing: var(--throttle-sf-heading-tracking); text-transform: var(--throttle-sf-heading-transform); }
537
+ .tsf-featured-product-price { margin: 0; font-size: 18px; }
538
+ .tsf-featured-product-from { font-size: 14px; color: var(--throttle-color-muted-foreground); }
539
+ .tsf-featured-product-description { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; color: var(--throttle-color-muted-foreground); }
540
+ .tsf-featured-product-link { display: inline-flex; padding: 10px 20px; border-radius: var(--throttle-radius-md, 6px); background: var(--throttle-sf-accent); color: var(--throttle-color-background); font-weight: 600; text-decoration: none; }
541
+ .tsf-featured-product-link:hover { background: var(--throttle-sf-accent-hover); }
542
+ @media (min-width: 768px) {
543
+ .tsf-featured-product:where([data-layout="image-left"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
544
+ .tsf-featured-product:where([data-layout="image-right"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
545
+ .tsf-featured-product-media:where([data-layout="image-right"]) { order: 2; }
546
+ }
547
+
548
+ .tsf-category-directory { display: block; }
549
+ .tsf-category-directory-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
550
+ .tsf-category-directory-list:where([data-layout="list"]) { grid-template-columns: minmax(0, 1fr); gap: 4px; }
551
+ @media (min-width: 768px) { .tsf-category-directory-list:where([data-layout="grid"]) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
552
+ .tsf-category-directory-item { min-inline-size: 0; }
553
+ .tsf-category-directory-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--throttle-color-border); border-radius: var(--throttle-sf-card-radius); color: inherit; text-decoration: none; }
554
+ .tsf-category-directory-link:hover { border-color: var(--throttle-color-foreground); }
555
+ .tsf-category-directory-image { inline-size: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--throttle-sf-card-radius); background: var(--throttle-color-muted); }
556
+ .tsf-category-directory-name { font-weight: 600; }
557
+ .tsf-category-directory-count { font-size: 13px; color: var(--throttle-color-muted-foreground); }
558
+ .tsf-category-directory-children { display: grid; gap: 2px; margin: 6px 0 0; padding: 0; padding-inline-start: 16px; list-style: none; font-size: 14px; }
559
+
560
+ .tsf-reviews-list { display: block; }
561
+ .tsf-reviews-list-items { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
562
+ .tsf-reviews-list-item { display: grid; gap: 6px; padding-block-end: 20px; border-block-end: 1px solid var(--throttle-color-border); }
563
+ .tsf-reviews-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
564
+ .tsf-reviews-list-title { margin: 0; font-size: 16px; font-weight: 600; }
565
+ .tsf-reviews-list-body { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
566
+ .tsf-reviews-list-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 13px; color: var(--throttle-color-muted-foreground); }
567
+ .tsf-reviews-list-author { font-weight: 600; color: var(--throttle-color-foreground); }
568
+ .tsf-reviews-list-verified { color: var(--throttle-sf-success); }
569
+ .tsf-reviews-list-product { color: var(--throttle-sf-accent); }
570
+ @media (max-width: 767px) {
571
+ .tsf-reviews-list-product { display: inline-flex; align-items: center; min-block-size: 44px; }
572
+ }
573
+ .tsf-reviews-list-reply { padding: 10px 14px; border-inline-start: 3px solid var(--throttle-color-border); background: var(--throttle-color-muted); font-size: 14px; }
574
+ `;
575
+
576
+ // src/styles/pages.css.ts
577
+ var PAGES_CSS = `
578
+ .tsf-search-results { max-inline-size: 1280px; margin-inline: auto; padding-block: 24px; padding-inline: 16px; }
579
+ .tsf-search-results-title {
580
+ margin-block: 0 16px;
581
+ font-size: 28px;
582
+ font-weight: var(--throttle-sf-heading-weight);
583
+ letter-spacing: var(--throttle-sf-heading-tracking);
584
+ text-transform: var(--throttle-sf-heading-transform);
585
+ }
586
+ .tsf-search-results-prompt { margin: 0; color: var(--throttle-color-muted-foreground); }
587
+
588
+ .tsf-not-found {
589
+ display: grid;
590
+ justify-items: center;
591
+ gap: 12px;
592
+ padding-block: 64px;
593
+ padding-inline: 16px;
594
+ text-align: center;
595
+ }
596
+ .tsf-not-found-code {
597
+ margin: 0;
598
+ color: var(--throttle-color-muted-foreground);
599
+ font-size: 72px;
600
+ font-weight: 700;
601
+ line-height: 1;
602
+ letter-spacing: -0.03em;
603
+ }
604
+ .tsf-not-found-title {
605
+ margin: 0;
606
+ font-size: 28px;
607
+ font-weight: var(--throttle-sf-heading-weight);
608
+ letter-spacing: var(--throttle-sf-heading-tracking);
609
+ text-transform: var(--throttle-sf-heading-transform);
610
+ }
611
+ .tsf-not-found-body { max-inline-size: 44ch; margin: 0; color: var(--throttle-color-muted-foreground); }
612
+ .tsf-not-found-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-block: 12px 0; margin-inline: 0; }
613
+ .tsf-not-found-link {
614
+ display: inline-flex;
615
+ align-items: center;
616
+ min-block-size: 44px;
617
+ padding-inline: 20px;
618
+ border: 1px solid var(--throttle-color-border-control);
619
+ border-radius: var(--throttle-radius, 8px);
620
+ color: inherit;
621
+ font-weight: 600;
622
+ text-decoration: none;
623
+ }
624
+ .tsf-not-found-link:first-child { border-color: transparent; background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground); }
625
+ .tsf-not-found-link:focus-visible { outline: 2px solid var(--throttle-sf-accent); outline-offset: 2px; }
626
+
627
+ .tsf-account-page { max-inline-size: 960px; margin-inline: auto; padding-block: 32px; padding-inline: 16px; }
628
+ .tsf-account-page-title { margin-block: 0 16px; font-size: 28px; font-weight: var(--throttle-sf-heading-weight); letter-spacing: var(--throttle-sf-heading-tracking); text-transform: var(--throttle-sf-heading-transform); }
629
+ .tsf-account-page-setup-notice {
630
+ max-inline-size: 560px;
631
+ margin-block: 48px;
632
+ margin-inline: auto;
633
+ padding: 24px;
634
+ border: 1px solid var(--throttle-color-border);
635
+ border-radius: var(--throttle-radius, 8px);
636
+ background: var(--throttle-color-surface);
637
+ }
638
+ .tsf-account-page-setup-title { margin-block: 0 8px; font-size: 18px; }
639
+ .tsf-account-page-setup-body { margin: 0; color: color-mix(in srgb, var(--throttle-color-muted-foreground) 75%, var(--throttle-color-foreground)); }
640
+ `;
641
+
642
+ // src/styles/pieces.css.ts
643
+ var PIECES_CSS = `
644
+ .tsf-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
645
+ .tsf-link:hover { color: var(--throttle-sf-accent); }
646
+
647
+ .tsf-image { display: block; inline-size: 100%; block-size: auto; object-fit: cover; background: var(--throttle-color-muted); }
648
+
649
+ .tsf-rich-text { overflow-wrap: anywhere; line-height: 1.6; }
650
+ .tsf-rich-text-link { color: var(--throttle-sf-accent); }
651
+
652
+ .tsf-money { font-variant-numeric: tabular-nums; }
653
+ .tsf-money-compare { margin-inline-start: 6px; color: var(--throttle-color-muted-foreground); font-weight: 400; font-variant-numeric: tabular-nums; }
654
+
655
+ .tsf-price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-weight: 600; }
656
+ .tsf-price-label { flex-basis: 100%; font-size: 12px; font-weight: 500; color: var(--throttle-sf-accent); }
657
+ .tsf-price-hint { flex-basis: 100%; font-size: 12px; font-weight: 400; color: var(--throttle-color-muted-foreground); }
658
+
659
+ .tsf-star-rating { display: inline-flex; align-items: center; gap: 6px; color: var(--throttle-color-muted-foreground); font-size: 13px; }
660
+ .tsf-star-rating-stars { display: inline-flex; gap: 1px; color: var(--throttle-color-warning); }
661
+ .tsf-star-rating-count { font-variant-numeric: tabular-nums; }
662
+
663
+ .tsf-product-badge {
664
+ display: inline-flex;
665
+ align-items: center;
666
+ padding: 2px 8px;
667
+ border-radius: 999px;
668
+ font-size: 12px;
669
+ font-weight: 600;
670
+ line-height: 1.4;
671
+ background: var(--tsf-badge-bg, var(--throttle-color-foreground));
672
+ color: var(--tsf-badge-fg, var(--throttle-color-background));
673
+ }
674
+
675
+ .tsf-swatch {
676
+ display: inline-block;
677
+ inline-size: 16px;
678
+ block-size: 16px;
679
+ border-radius: 999px;
680
+ border: 1px solid var(--throttle-color-border-control);
681
+ background-color: var(--throttle-color-muted);
682
+ background-size: cover;
683
+ background-position: center;
684
+ box-sizing: border-box;
685
+ vertical-align: middle;
686
+ }
687
+ .tsf-swatch:where([data-selected="true"]) { outline: 2px solid var(--throttle-color-foreground); outline-offset: 2px; }
688
+ .tsf-swatch:where([data-disabled="true"]) { opacity: 0.4; }
689
+
690
+ /* The card: the variant sets the properties, the parts read them. */
691
+ .tsf-product-card {
692
+ --tsf-card-border: 1px solid var(--throttle-color-border);
693
+ --tsf-card-radius: var(--throttle-sf-card-radius);
694
+ --tsf-body-padding: 12px;
695
+ --tsf-media-radius: 0;
696
+ position: relative;
697
+ display: flex;
698
+ flex-direction: column;
699
+ min-inline-size: 0;
700
+ border: var(--tsf-card-border);
701
+ border-radius: var(--tsf-card-radius);
702
+ background: var(--throttle-color-background);
703
+ color: var(--throttle-color-foreground);
704
+ overflow: hidden;
705
+ }
706
+ .tsf-product-card:where([data-variant="minimal"]) {
707
+ --tsf-card-border: 0 solid transparent;
708
+ --tsf-card-radius: 0;
709
+ --tsf-body-padding: 10px 0 0;
710
+ --tsf-media-radius: var(--throttle-sf-card-radius);
711
+ overflow: visible;
712
+ background: transparent;
713
+ }
714
+ .tsf-product-card:where([data-variant="overlay"]) {
715
+ --tsf-card-border: 0 solid transparent;
716
+ --tsf-body-padding: 40px 14px 14px;
717
+ --tsf-body-position: absolute;
718
+ --tsf-body-events: none;
719
+ --tsf-body-color: #fff;
720
+ --tsf-body-background: linear-gradient(to top, rgb(0 0 0 / 0.72), rgb(0 0 0 / 0));
721
+ }
722
+ .tsf-product-card:where([data-variant="row"]) { --tsf-media-basis: 38%; }
723
+ .tsf-product-card:where([data-sold-out]) { --tsf-media-opacity: 0.6; }
724
+
725
+ .tsf-product-card-row { display: flex; align-items: stretch; flex: 1; min-inline-size: 0; }
726
+
727
+ .tsf-product-card-media {
728
+ --tsf-alt: 0;
729
+ position: relative;
730
+ flex: 0 0 var(--tsf-media-basis, auto);
731
+ overflow: hidden;
732
+ border-radius: var(--tsf-media-radius);
733
+ background: var(--throttle-color-muted);
734
+ }
735
+ .tsf-product-card-media:focus-within { --tsf-alt: 1; }
736
+ @media (hover: hover) {
737
+ .tsf-product-card-media:hover { --tsf-alt: 1; }
738
+ }
739
+ .tsf-product-card-media-link { display: block; color: inherit; text-decoration: none; opacity: var(--tsf-media-opacity, 1); }
740
+ .tsf-product-card-image { display: block; }
741
+ .tsf-product-card-image-alt {
742
+ position: absolute;
743
+ inset: 0;
744
+ opacity: var(--tsf-alt);
745
+ transition: opacity 0.2s ease;
746
+ background: var(--throttle-color-muted);
747
+ }
748
+ /* No hover on a touch screen: the two images sit side by side and the shopper swipes. */
749
+ @media (hover: none) {
750
+ .tsf-product-card-media-link { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
751
+ .tsf-product-card-image, .tsf-product-card-image-alt { position: static; flex: 0 0 100%; opacity: 1; scroll-snap-align: start; }
752
+ }
753
+ @media (prefers-reduced-motion: reduce) {
754
+ .tsf-product-card-image-alt { transition: none; }
755
+ }
756
+ .tsf-product-card-placeholder { inline-size: 100%; background: var(--throttle-color-muted); }
757
+
758
+ .tsf-product-card-badges {
759
+ position: absolute;
760
+ inset-block-start: 8px;
761
+ inset-inline-start: 8px;
762
+ display: flex;
763
+ flex-wrap: wrap;
764
+ gap: 4px;
765
+ max-inline-size: calc(100% - 16px);
766
+ pointer-events: none;
767
+ }
768
+ .tsf-product-card-actions {
769
+ position: absolute;
770
+ inset-block-end: 8px;
771
+ inset-inline-end: 8px;
772
+ display: flex;
773
+ flex-direction: column;
774
+ gap: 6px;
775
+ }
776
+
777
+ .tsf-product-card-body {
778
+ position: var(--tsf-body-position, static);
779
+ inset-inline: 0;
780
+ inset-block-end: 0;
781
+ flex: 1;
782
+ display: flex;
783
+ flex-direction: column;
784
+ align-items: flex-start;
785
+ gap: 6px;
786
+ padding: var(--tsf-body-padding);
787
+ min-inline-size: 0;
788
+ color: var(--tsf-body-color, inherit);
789
+ background: var(--tsf-body-background, transparent);
790
+ pointer-events: var(--tsf-body-events, auto);
791
+ }
792
+ .tsf-product-card-brand { margin: 0; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; }
793
+ .tsf-product-card-title {
794
+ margin: 0;
795
+ font-size: 15px;
796
+ font-weight: var(--throttle-sf-heading-weight);
797
+ letter-spacing: var(--throttle-sf-heading-tracking);
798
+ text-transform: var(--throttle-sf-heading-transform);
799
+ line-height: 1.3;
800
+ overflow-wrap: anywhere;
801
+ }
802
+ .tsf-product-card-title-link { color: inherit; text-decoration: none; pointer-events: auto; }
803
+ .tsf-product-card-title-link:hover { text-decoration: underline; }
804
+ .tsf-product-card-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
805
+ .tsf-product-card-swatch-more { font-size: 12px; opacity: 0.7; }
806
+ .tsf-product-card-rating { color: inherit; }
807
+ .tsf-product-card-price { margin: 0; font-size: 15px; }
808
+ .tsf-product-card-from { font-size: 12px; font-weight: 400; opacity: 0.7; }
809
+ .tsf-product-card-unpriced { font-size: 13px; opacity: 0.7; }
810
+ `;
811
+
812
+ // src/styles/product.css.ts
813
+ var PRODUCT_CSS = `
814
+ .tsf-product-page {
815
+ --tsf-main-columns: minmax(0, 1.1fr) minmax(0, 1fr);
816
+ --tsf-main-gap: 48px;
817
+ --tsf-buy-position: static;
818
+ --tsf-gallery-max: none;
819
+ --tsf-buy-max: none;
820
+ --tsf-main-justify: stretch;
821
+ display: block;
822
+ max-inline-size: 1280px;
823
+ margin-inline: auto;
824
+ padding-block: 24px 96px;
825
+ padding-inline: 16px;
826
+ box-sizing: border-box;
827
+ }
828
+ .tsf-product-page:where([data-layout="stacked"]) {
829
+ --tsf-main-columns: minmax(0, 1fr);
830
+ --tsf-main-gap: 32px;
831
+ --tsf-gallery-max: 720px;
832
+ --tsf-buy-max: 640px;
833
+ --tsf-main-justify: center;
834
+ }
835
+ .tsf-product-page:where([data-layout="editorial"]) {
836
+ --tsf-main-columns: minmax(0, 1.7fr) minmax(0, 1fr);
837
+ --tsf-main-gap: 64px;
838
+ --tsf-buy-position: sticky;
839
+ }
840
+ @media (max-width: 767px) {
841
+ .tsf-product-page,
842
+ .tsf-product-page:where([data-layout="stacked"]),
843
+ .tsf-product-page:where([data-layout="editorial"]) {
844
+ --tsf-main-columns: minmax(0, 1fr);
845
+ --tsf-main-gap: 24px;
846
+ --tsf-buy-position: static;
847
+ --tsf-gallery-max: none;
848
+ --tsf-buy-max: none;
849
+ }
850
+ }
851
+
852
+ .tsf-product-page-main {
853
+ display: grid;
854
+ grid-template-columns: var(--tsf-main-columns);
855
+ gap: var(--tsf-main-gap);
856
+ justify-content: var(--tsf-main-justify);
857
+ align-items: start;
858
+ margin-block-end: 48px;
859
+ }
860
+
861
+ /* Breadcrumbs */
862
+ .tsf-product-breadcrumbs { margin-block-end: 16px; font-size: var(--throttle-font-size-sm, 14px); color: var(--throttle-color-muted-foreground); }
863
+ .tsf-product-breadcrumbs-list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
864
+ .tsf-product-breadcrumbs-item { display: inline-flex; align-items: center; gap: 8px; }
865
+ .tsf-product-breadcrumbs-item:not(:last-child)::after { content: "/"; color: var(--throttle-color-border-control); }
866
+ .tsf-product-breadcrumbs-link { color: inherit; text-decoration: none; }
867
+ .tsf-product-breadcrumbs-link:hover { color: var(--throttle-color-foreground); text-decoration: underline; }
868
+ .tsf-product-breadcrumbs-current { color: var(--throttle-color-foreground); }
869
+ @media (max-width: 767px) {
870
+ .tsf-product-breadcrumbs-link,
871
+ .tsf-buy-box-rating { display: inline-flex; align-items: center; min-block-size: 44px; }
872
+ }
873
+
874
+ /* Gallery */
875
+ .tsf-gallery { display: grid; gap: 12px; max-inline-size: var(--tsf-gallery-max); inline-size: 100%; margin-inline: auto; min-inline-size: 0; }
876
+ .tsf-gallery-stage {
877
+ position: relative;
878
+ overflow: hidden;
879
+ border-radius: var(--throttle-sf-card-radius);
880
+ background: var(--throttle-color-muted);
881
+ touch-action: pan-y;
882
+ cursor: zoom-in;
883
+ outline-offset: 2px;
884
+ }
885
+ .tsf-gallery-stage:focus-visible { outline: 2px solid var(--throttle-color-primary); }
886
+ .tsf-gallery-item { display: block; transition: transform 0.2s ease; will-change: transform; }
887
+ .tsf-gallery-item:where([data-zoomed="true"]) { transform: scale(1.9); }
888
+ .tsf-gallery-item:where([data-zoomed="true"]) { cursor: zoom-in; }
889
+ .tsf-gallery-video { display: block; inline-size: 100%; block-size: auto; background: #000; }
890
+ .tsf-gallery-placeholder { aspect-ratio: 4 / 5; background: var(--throttle-color-muted); }
891
+ .tsf-gallery-previous, .tsf-gallery-next, .tsf-gallery-enlarge, .tsf-lightbox-previous, .tsf-lightbox-next {
892
+ position: absolute;
893
+ display: inline-flex;
894
+ align-items: center;
895
+ justify-content: center;
896
+ inline-size: 44px;
897
+ block-size: 44px;
898
+ padding: 0;
899
+ border: 1px solid var(--throttle-color-border);
900
+ border-radius: 999px;
901
+ background: color-mix(in srgb, var(--throttle-color-background) 88%, transparent);
902
+ color: var(--throttle-color-foreground);
903
+ cursor: pointer;
904
+ }
905
+ .tsf-gallery-previous { inset-inline-start: 12px; inset-block-start: calc(50% - 22px); }
906
+ .tsf-gallery-next { inset-inline-end: 12px; inset-block-start: calc(50% - 22px); }
907
+ .tsf-gallery-enlarge { inset-inline-end: 12px; inset-block-end: 12px; }
908
+ .tsf-gallery-previous:hover, .tsf-gallery-next:hover, .tsf-gallery-enlarge:hover { background: var(--throttle-color-background); }
909
+ .tsf-gallery-counter {
910
+ position: absolute;
911
+ inset-inline-start: 12px;
912
+ inset-block-end: 12px;
913
+ margin: 0;
914
+ padding: 2px 10px;
915
+ border-radius: 999px;
916
+ background: color-mix(in srgb, var(--throttle-color-background) 88%, transparent);
917
+ font-size: 12px;
918
+ font-variant-numeric: tabular-nums;
919
+ }
920
+ .tsf-gallery-thumbs { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; overflow-x: auto; }
921
+ .tsf-gallery-thumbs-item { flex: 0 0 72px; }
922
+ .tsf-gallery-thumb {
923
+ display: block;
924
+ inline-size: 72px;
925
+ padding: 0;
926
+ border: 2px solid transparent;
927
+ border-radius: calc(var(--throttle-sf-card-radius) / 1.5);
928
+ background: var(--throttle-color-muted);
929
+ overflow: hidden;
930
+ cursor: pointer;
931
+ opacity: 0.7;
932
+ }
933
+ .tsf-gallery-thumb:where([aria-current="true"]) { border-color: var(--throttle-color-foreground); opacity: 1; }
934
+ .tsf-gallery-thumb:hover { opacity: 1; }
935
+ .tsf-gallery-thumb:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }
936
+
937
+ /* Lightbox (inside the ui modal) */
938
+ .tsf-lightbox { position: relative; display: grid; place-items: center; min-inline-size: min(92vw, 960px); min-block-size: 50vh; }
939
+ .tsf-lightbox-title { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
940
+ .tsf-lightbox-stage { display: grid; place-items: center; max-block-size: 82vh; }
941
+ .tsf-lightbox-previous { inset-inline-start: 8px; inset-block-start: calc(50% - 22px); }
942
+ .tsf-lightbox-next { inset-inline-end: 8px; inset-block-start: calc(50% - 22px); }
943
+ .tsf-lightbox-counter { margin: 8px 0 0; font-size: 13px; color: var(--throttle-color-muted-foreground); font-variant-numeric: tabular-nums; }
944
+
945
+ /* Buy box */
946
+ .tsf-buy-box {
947
+ position: var(--tsf-buy-position);
948
+ inset-block-start: 24px;
949
+ display: grid;
950
+ gap: 16px;
951
+ max-inline-size: var(--tsf-buy-max);
952
+ inline-size: 100%;
953
+ margin-inline: auto;
954
+ min-inline-size: 0;
955
+ }
956
+ .tsf-buy-box-kicker { margin: 0; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--throttle-color-muted-foreground); }
957
+ .tsf-buy-box-title {
958
+ margin: 0;
959
+ font-family: var(--throttle-font-family-heading, inherit);
960
+ font-size: clamp(26px, 3vw, 36px);
961
+ line-height: 1.15;
962
+ font-weight: var(--throttle-sf-heading-weight);
963
+ letter-spacing: var(--throttle-sf-heading-tracking);
964
+ text-transform: var(--throttle-sf-heading-transform);
965
+ overflow-wrap: anywhere;
966
+ }
967
+ .tsf-buy-box-rating { justify-self: start; color: inherit; text-decoration: none; }
968
+ .tsf-buy-box-summary { margin: 0; color: var(--throttle-color-muted-foreground); line-height: 1.55; }
969
+ .tsf-buy-box-price { margin: 0; font-size: 22px; }
970
+ .tsf-buy-box-sku { margin: 0; font-size: 13px; color: var(--throttle-color-muted-foreground); }
971
+ .tsf-buy-box-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
972
+
973
+ /* Variant picker */
974
+ .tsf-variant-picker { display: grid; gap: 16px; }
975
+ .tsf-variant-option { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
976
+ .tsf-variant-option-legend { display: flex; gap: 8px; align-items: baseline; padding: 0; margin-block-end: 8px; font-size: 14px; }
977
+ .tsf-variant-option-name { font-weight: 600; }
978
+ .tsf-variant-option-chosen { color: var(--throttle-color-muted-foreground); }
979
+ .tsf-variant-option-values { display: flex; flex-wrap: wrap; gap: 8px; }
980
+ .tsf-variant-value {
981
+ position: relative;
982
+ display: inline-flex;
983
+ align-items: center;
984
+ justify-content: center;
985
+ min-inline-size: 44px;
986
+ min-block-size: 44px;
987
+ padding-inline: 14px;
988
+ border: 1px solid var(--throttle-color-border-control);
989
+ border-radius: var(--throttle-radius);
990
+ background: var(--throttle-color-background);
991
+ color: var(--throttle-color-foreground);
992
+ font: inherit;
993
+ cursor: pointer;
994
+ overflow: hidden;
995
+ }
996
+ .tsf-variant-value:where([data-kind="swatch"]) { padding-inline: 0; border-radius: 999px; min-inline-size: 44px; }
997
+ .tsf-variant-value:hover { border-color: var(--throttle-color-foreground); }
998
+ .tsf-variant-value:where([aria-pressed="true"]) { border-color: var(--throttle-color-foreground); box-shadow: inset 0 0 0 1px var(--throttle-color-foreground); }
999
+ .tsf-variant-value:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }
1000
+ .tsf-variant-value:where([data-sold-out]), .tsf-variant-value:where([data-unavailable]) { color: var(--throttle-color-muted-foreground); }
1001
+ .tsf-variant-value:where([data-sold-out])::after {
1002
+ content: "";
1003
+ position: absolute;
1004
+ inset: 0;
1005
+ background: linear-gradient(to bottom right, transparent calc(50% - 1px), var(--throttle-color-muted-foreground) 50%, transparent calc(50% + 1px));
1006
+ pointer-events: none;
1007
+ }
1008
+ .tsf-variant-value:where([data-unavailable]) { border-style: dashed; }
1009
+ .tsf-variant-value-label { pointer-events: none; }
1010
+
1011
+ /* Stock, quantity, add */
1012
+ .tsf-stock-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
1013
+ .tsf-stock-status::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 999px; background: var(--throttle-sf-success); }
1014
+ .tsf-stock-status:where([data-state="low"])::before { background: var(--throttle-sf-warning); }
1015
+ .tsf-stock-status:where([data-state="out"])::before, .tsf-stock-status:where([data-state="no_currency"])::before { background: var(--throttle-color-muted-foreground); }
1016
+ .tsf-stock-status:where([data-state="backorder"])::before, .tsf-stock-status:where([data-state="preorder"])::before { background: var(--throttle-sf-accent); }
1017
+
1018
+ .tsf-quantity-input { display: inline-flex; align-items: stretch; border: 1px solid var(--throttle-color-border-control); border-radius: var(--throttle-radius); overflow: hidden; }
1019
+ .tsf-quantity-decrease, .tsf-quantity-increase {
1020
+ inline-size: 44px;
1021
+ min-block-size: 48px;
1022
+ padding: 0;
1023
+ border: 0;
1024
+ background: var(--throttle-color-background);
1025
+ color: var(--throttle-color-foreground);
1026
+ font-size: 18px;
1027
+ cursor: pointer;
1028
+ }
1029
+ .tsf-quantity-decrease:where([aria-disabled="true"]), .tsf-quantity-increase:where([aria-disabled="true"]) { opacity: 0.4; cursor: not-allowed; }
1030
+ .tsf-quantity-field {
1031
+ inline-size: 56px;
1032
+ padding: 0;
1033
+ border: 0;
1034
+ border-inline: 1px solid var(--throttle-color-border);
1035
+ background: var(--throttle-color-background);
1036
+ color: var(--throttle-color-foreground);
1037
+ font: inherit;
1038
+ text-align: center;
1039
+ appearance: textfield;
1040
+ -moz-appearance: textfield;
1041
+ }
1042
+ .tsf-quantity-field::-webkit-outer-spin-button, .tsf-quantity-field::-webkit-inner-spin-button { appearance: none; margin: 0; }
1043
+
1044
+ .tsf-add-to-cart { display: grid; gap: 8px; min-inline-size: 0; }
1045
+ .tsf-add-to-cart-button, .tsf-sticky-add-to-cart-button {
1046
+ display: inline-flex;
1047
+ align-items: center;
1048
+ justify-content: center;
1049
+ gap: 8px;
1050
+ inline-size: 100%;
1051
+ min-block-size: 48px;
1052
+ padding-inline: 20px;
1053
+ border: 1px solid transparent;
1054
+ border-radius: var(--throttle-radius);
1055
+ background: var(--throttle-color-primary);
1056
+ color: var(--throttle-color-primary-foreground);
1057
+ font: inherit;
1058
+ font-weight: 600;
1059
+ cursor: pointer;
1060
+ }
1061
+ .tsf-add-to-cart-button:hover:not(:disabled), .tsf-sticky-add-to-cart-button:hover:not(:disabled) { filter: brightness(0.92); }
1062
+ .tsf-add-to-cart-button:disabled, .tsf-sticky-add-to-cart-button:disabled { opacity: 0.55; cursor: not-allowed; }
1063
+ .tsf-add-to-cart-button:where([aria-disabled="true"]) { cursor: progress; }
1064
+ .tsf-add-to-cart-button:focus-visible, .tsf-sticky-add-to-cart-button:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: 2px; }
1065
+ .tsf-add-to-cart-message { margin: 0; min-block-size: 1.4em; font-size: 14px; }
1066
+ .tsf-add-to-cart-message:where([data-tone="ok"]) { color: var(--throttle-sf-success); }
1067
+ .tsf-add-to-cart-message:where([data-tone="refused"]) { color: var(--throttle-sf-danger); }
1068
+
1069
+ .tsf-sticky-add-to-cart {
1070
+ position: fixed;
1071
+ inset-inline: 0;
1072
+ inset-block-end: 0;
1073
+ z-index: var(--throttle-z-popover, 30);
1074
+ display: flex;
1075
+ align-items: center;
1076
+ gap: 16px;
1077
+ padding: 12px 16px;
1078
+ border-block-start: 1px solid var(--throttle-color-border);
1079
+ background: var(--throttle-color-background);
1080
+ box-shadow: var(--throttle-shadow-popover, 0 -4px 16px rgba(0, 0, 0, 0.08));
1081
+ }
1082
+ .tsf-sticky-add-to-cart-title { flex: 1 1 auto; margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-inline-size: 0; }
1083
+ .tsf-sticky-add-to-cart-price { margin: 0; flex: 0 0 auto; }
1084
+ .tsf-sticky-add-to-cart-button { inline-size: auto; flex: 0 0 auto; }
1085
+
1086
+ /* Sections */
1087
+ .tsf-product-sections { display: grid; gap: 32px; }
1088
+ .tsf-product-sections:where([data-style="accordion"]) { gap: 0; border-block-start: 1px solid var(--throttle-color-border); }
1089
+ .tsf-product-section { min-inline-size: 0; scroll-margin-block-start: 16px; }
1090
+ .tsf-product-section:where([hidden]) { display: none; }
1091
+ .tsf-product-section-title {
1092
+ margin: 0 0 12px;
1093
+ font-family: var(--throttle-font-family-heading, inherit);
1094
+ font-size: 22px;
1095
+ font-weight: var(--throttle-sf-heading-weight);
1096
+ letter-spacing: var(--throttle-sf-heading-tracking);
1097
+ text-transform: var(--throttle-sf-heading-transform);
1098
+ }
1099
+ .tsf-product-section-title:where([data-in-tabs]) { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
1100
+ .tsf-product-section-trigger {
1101
+ display: flex;
1102
+ align-items: center;
1103
+ justify-content: space-between;
1104
+ inline-size: 100%;
1105
+ min-block-size: 56px;
1106
+ padding: 0;
1107
+ border: 0;
1108
+ border-block-end: 1px solid var(--throttle-color-border);
1109
+ background: none;
1110
+ color: inherit;
1111
+ font: inherit;
1112
+ text-align: start;
1113
+ cursor: pointer;
1114
+ }
1115
+ .tsf-product-section-trigger:focus-visible { outline: 2px solid var(--throttle-color-primary); outline-offset: -2px; }
1116
+ .tsf-product-section-body { padding-block: 16px; min-inline-size: 0; }
1117
+ .tsf-product-section-body:where([hidden]) { display: none; }
1118
+ .tsf-product-specs { display: grid; margin: 0; }
1119
+ .tsf-product-specs-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 16px; padding-block: 10px; border-block-end: 1px solid var(--throttle-color-border); }
1120
+ .tsf-product-specs-label { margin: 0; color: var(--throttle-color-muted-foreground); text-transform: capitalize; }
1121
+ .tsf-product-specs-value { margin: 0; overflow-wrap: anywhere; }
1122
+ .tsf-shipping-section { line-height: 1.6; }
1123
+
1124
+ .tsf-tag-list, .tsf-category-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
1125
+ .tsf-tag-list-link, .tsf-category-list-link {
1126
+ display: inline-flex;
1127
+ align-items: center;
1128
+ min-block-size: 36px;
1129
+ padding-inline: 14px;
1130
+ border: 1px solid var(--throttle-color-border-control);
1131
+ border-radius: 999px;
1132
+ color: inherit;
1133
+ text-decoration: none;
1134
+ font-size: 14px;
1135
+ }
1136
+ .tsf-tag-list-link:hover, .tsf-category-list-link:hover { border-color: var(--throttle-color-foreground); }
1137
+
1138
+ .tsf-related-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--throttle-sf-grid-gap); margin: 0; padding: 0; list-style: none; }
1139
+ .tsf-related-products-item { min-inline-size: 0; }
1140
+
1141
+ /* Reviews */
1142
+ .tsf-product-reviews { display: grid; gap: 24px; }
1143
+ .tsf-product-reviews-summary { display: grid; gap: 12px; max-inline-size: 420px; }
1144
+ .tsf-product-reviews-main { display: grid; gap: 24px; min-inline-size: 0; }
1145
+ @media (min-width: 768px) {
1146
+ .tsf-product-reviews:where([data-layout="columns"]) { grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); gap: 48px; align-items: start; }
1147
+ .tsf-product-reviews-summary:where([data-layout="columns"]) { max-inline-size: none; }
1148
+ }
1149
+ .tsf-product-reviews-average { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 36px; font-weight: 600; }
1150
+ .tsf-product-reviews-histogram { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
1151
+ .tsf-product-reviews-histogram-row {
1152
+ display: grid;
1153
+ grid-template-columns: 36px minmax(0, 1fr) 32px;
1154
+ align-items: center;
1155
+ gap: 10px;
1156
+ inline-size: 100%;
1157
+ min-block-size: 32px;
1158
+ padding: 0 6px;
1159
+ border: 1px solid transparent;
1160
+ border-radius: var(--throttle-radius-sm, 6px);
1161
+ background: none;
1162
+ color: inherit;
1163
+ font: inherit;
1164
+ font-size: 14px;
1165
+ cursor: pointer;
1166
+ }
1167
+ .tsf-product-reviews-histogram-row:hover { background: var(--throttle-color-muted); }
1168
+ .tsf-product-reviews-histogram-row:where([aria-pressed="true"]) { border-color: var(--throttle-color-foreground); background: var(--throttle-color-muted); }
1169
+ .tsf-product-reviews-histogram-row:focus-visible { outline: 2px solid var(--throttle-color-primary); }
1170
+ .tsf-product-reviews-histogram-bar { display: block; block-size: 8px; border-radius: 999px; background: var(--throttle-color-muted); overflow: hidden; }
1171
+ .tsf-product-reviews-histogram-fill { display: block; block-size: 100%; background: var(--throttle-color-warning); }
1172
+ .tsf-product-reviews-histogram-count { text-align: end; font-variant-numeric: tabular-nums; color: var(--throttle-color-muted-foreground); }
1173
+ .tsf-product-reviews-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
1174
+ .tsf-product-reviews-clear { min-block-size: 44px; padding-inline: 4px; border: 0; background: none; color: var(--throttle-sf-accent); font: inherit; text-decoration: underline; cursor: pointer; }
1175
+ .tsf-product-reviews-list { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
1176
+ .tsf-product-review { display: grid; gap: 6px; padding-block-end: 20px; border-block-end: 1px solid var(--throttle-color-border); }
1177
+ .tsf-product-review-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
1178
+ .tsf-product-review-date { font-size: 13px; color: var(--throttle-color-muted-foreground); }
1179
+ .tsf-product-review-title { margin: 0; font-size: 16px; }
1180
+ .tsf-product-review-body { margin: 0; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-line; }
1181
+ .tsf-product-review-author { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--throttle-color-muted-foreground); }
1182
+ .tsf-product-review-reply { padding: 12px 16px; border-inline-start: 3px solid var(--throttle-color-border-control); background: var(--throttle-color-muted); font-size: 14px; }
1183
+ .tsf-product-reviews-load-more {
1184
+ justify-self: start;
1185
+ min-block-size: 44px;
1186
+ padding-inline: 20px;
1187
+ border: 1px solid var(--throttle-color-border-control);
1188
+ border-radius: var(--throttle-radius);
1189
+ background: var(--throttle-color-background);
1190
+ color: inherit;
1191
+ font: inherit;
1192
+ cursor: pointer;
1193
+ }
1194
+ .tsf-product-reviews-load-more:where([aria-disabled="true"]) { cursor: progress; opacity: 0.7; }
1195
+ .tsf-product-reviews-empty, .tsf-product-reviews-gate, .tsf-product-reviews-error { margin: 0; color: var(--throttle-color-muted-foreground); }
1196
+ .tsf-product-reviews-error { color: var(--throttle-sf-danger); }
1197
+
1198
+ .tsf-review-form { display: grid; gap: 14px; max-inline-size: 520px; padding: 20px; border: 1px solid var(--throttle-color-border); border-radius: var(--throttle-sf-card-radius); }
1199
+ .tsf-review-form-title { margin: 0; font-weight: 600; font-size: 18px; }
1200
+ .tsf-review-form-stars { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; border: 0; }
1201
+ .tsf-review-form-star { position: relative; display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; font-size: 26px; color: var(--throttle-color-border-control); cursor: pointer; }
1202
+ .tsf-review-form-star:where([data-on="true"]) { color: var(--throttle-color-warning); }
1203
+ .tsf-review-form-star-input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
1204
+ .tsf-review-form-star:focus-within { outline: 2px solid var(--throttle-color-primary); border-radius: 6px; }
1205
+ .tsf-review-form-field { display: grid; gap: 6px; font-size: 14px; }
1206
+ .tsf-review-form-textarea { padding: 10px 12px; border: 1px solid var(--throttle-color-border-control); border-radius: var(--throttle-radius); background: var(--throttle-color-background); color: inherit; font: inherit; resize: vertical; }
1207
+ .tsf-review-form-error { display: block; font-size: 13px; color: var(--throttle-sf-danger); }
1208
+ .tsf-review-form-submit { justify-self: start; min-block-size: 48px; padding-inline: 24px; border: 0; border-radius: var(--throttle-radius); background: var(--throttle-color-primary); color: var(--throttle-color-primary-foreground); font: inherit; font-weight: 600; cursor: pointer; }
1209
+ .tsf-review-form-submit:where([aria-disabled="true"]) { cursor: progress; opacity: 0.7; }
1210
+ .tsf-review-form-thanks { margin: 0; padding: 14px 16px; border-radius: var(--throttle-radius); background: var(--throttle-color-success-surface, var(--throttle-color-muted)); }
1211
+
1212
+ @media (prefers-reduced-motion: reduce) {
1213
+ .tsf-gallery-item { transition: none; }
1214
+ }
1215
+ `;
1216
+
1217
+ // src/styles/shop.css.ts
1218
+ var SHOP_CSS = `
1219
+ .tsf-shop-all { display: flex; flex-direction: column; gap: 16px; min-inline-size: 0; padding-block: 24px; }
1220
+
1221
+ .tsf-shop-all-heading {
1222
+ margin: 0;
1223
+ font-size: 28px;
1224
+ line-height: 1.2;
1225
+ font-weight: var(--throttle-sf-heading-weight);
1226
+ letter-spacing: var(--throttle-sf-heading-tracking);
1227
+ text-transform: var(--throttle-sf-heading-transform);
1228
+ }
1229
+ .tsf-shop-all-description { margin: 0; max-inline-size: 70ch; color: var(--throttle-color-muted-foreground); line-height: 1.6; }
1230
+
1231
+ .tsf-shop-all-breadcrumb-list { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--throttle-color-muted-foreground); }
1232
+ .tsf-shop-all-breadcrumb:where(:not(:last-child))::after { content: "/"; margin-inline-start: 8px; opacity: 0.6; }
1233
+ .tsf-shop-all-breadcrumb-link { color: inherit; text-decoration: none; }
1234
+ .tsf-shop-all-breadcrumb-link:hover { color: var(--throttle-color-foreground); text-decoration: underline; }
1235
+
1236
+ .tsf-shop-all-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
1237
+ .tsf-shop-all-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
1238
+ .tsf-result-count { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 14px; }
1239
+
1240
+ .tsf-shop-all-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
1241
+ .tsf-shop-all-body:where([data-layout="sidebar"]) { grid-template-columns: 240px minmax(0, 1fr); }
1242
+ .tsf-shop-all-main { display: flex; flex-direction: column; gap: 24px; min-inline-size: 0; }
1243
+
1244
+ .tsf-live-region {
1245
+ position: absolute;
1246
+ inline-size: 1px;
1247
+ block-size: 1px;
1248
+ margin: -1px;
1249
+ padding: 0;
1250
+ overflow: hidden;
1251
+ clip: rect(0 0 0 0);
1252
+ white-space: nowrap;
1253
+ border: 0;
1254
+ }
1255
+
1256
+ /* Sort */
1257
+ .tsf-sort-select { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
1258
+ .tsf-sort-select-input,
1259
+ .tsf-facet-select,
1260
+ .tsf-facet-search,
1261
+ .tsf-facet-range-input {
1262
+ min-block-size: 44px;
1263
+ padding-inline: 12px;
1264
+ border: 1px solid var(--throttle-color-border-control);
1265
+ border-radius: var(--throttle-sf-card-radius);
1266
+ background: var(--throttle-color-background);
1267
+ color: var(--throttle-color-foreground);
1268
+ font: inherit;
1269
+ box-sizing: border-box;
1270
+ }
1271
+ .tsf-facet-select, .tsf-facet-search { inline-size: 100%; }
1272
+
1273
+ /* Filters: the column */
1274
+ .tsf-filter-sidebar { display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }
1275
+ .tsf-filter-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block-end: 8px; }
1276
+ .tsf-filter-sidebar-title { margin: 0; font-size: 16px; font-weight: var(--throttle-sf-heading-weight); }
1277
+ .tsf-filter-clear, .tsf-active-filters-clear, .tsf-facet-range-clear, .tsf-facet-show-all {
1278
+ padding: 0;
1279
+ min-block-size: 44px;
1280
+ border: 0;
1281
+ background: none;
1282
+ color: var(--throttle-sf-accent);
1283
+ font: inherit;
1284
+ font-size: 14px;
1285
+ text-decoration: underline;
1286
+ text-underline-offset: 2px;
1287
+ cursor: pointer;
1288
+ }
1289
+
1290
+ /* Filters: the top bar and the drawer trigger */
1291
+ .tsf-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
1292
+ .tsf-filter-bar-more,
1293
+ .tsf-filter-drawer-trigger {
1294
+ display: inline-flex;
1295
+ align-items: center;
1296
+ gap: 8px;
1297
+ min-block-size: 44px;
1298
+ padding-inline: 14px;
1299
+ border: 1px solid var(--throttle-color-border-control);
1300
+ border-radius: var(--throttle-sf-card-radius);
1301
+ background: var(--throttle-color-background);
1302
+ color: var(--throttle-color-foreground);
1303
+ font: inherit;
1304
+ cursor: pointer;
1305
+ }
1306
+ .tsf-filter-drawer-count, .tsf-facet-selected {
1307
+ display: inline-flex;
1308
+ align-items: center;
1309
+ justify-content: center;
1310
+ min-inline-size: 20px;
1311
+ padding-inline: 6px;
1312
+ border-radius: 999px;
1313
+ background: var(--throttle-sf-accent);
1314
+ color: var(--throttle-color-background);
1315
+ font-size: 12px;
1316
+ line-height: 20px;
1317
+ }
1318
+
1319
+ /* A facet */
1320
+ .tsf-facet { min-inline-size: 0; border-block-start: 1px solid var(--throttle-color-border); }
1321
+ .tsf-facet:where([data-presentation="dropdown"]) { border: 0; position: relative; }
1322
+ .tsf-facet-heading { margin: 0; font-size: 15px; }
1323
+ .tsf-facet-toggle {
1324
+ display: flex;
1325
+ align-items: center;
1326
+ gap: 8px;
1327
+ inline-size: 100%;
1328
+ min-block-size: 44px;
1329
+ padding: 0;
1330
+ border: 0;
1331
+ background: none;
1332
+ color: inherit;
1333
+ font: inherit;
1334
+ font-weight: 600;
1335
+ text-align: start;
1336
+ cursor: pointer;
1337
+ }
1338
+ .tsf-facet-label { flex: 1; text-align: start; }
1339
+ .tsf-facet-body { padding-block-end: 12px; }
1340
+ .tsf-facet-fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
1341
+ .tsf-facet-legend {
1342
+ position: absolute;
1343
+ inline-size: 1px;
1344
+ block-size: 1px;
1345
+ margin: -1px;
1346
+ padding: 0;
1347
+ overflow: hidden;
1348
+ clip: rect(0 0 0 0);
1349
+ white-space: nowrap;
1350
+ border: 0;
1351
+ }
1352
+ .tsf-facet-trigger {
1353
+ display: inline-flex;
1354
+ align-items: center;
1355
+ gap: 8px;
1356
+ min-block-size: 44px;
1357
+ padding-inline: 14px;
1358
+ border: 1px solid var(--throttle-color-border-control);
1359
+ border-radius: var(--throttle-sf-card-radius);
1360
+ background: var(--throttle-color-background);
1361
+ color: var(--throttle-color-foreground);
1362
+ font: inherit;
1363
+ cursor: pointer;
1364
+ }
1365
+ .tsf-facet-trigger:where([aria-expanded="true"]) { border-color: var(--throttle-color-foreground); }
1366
+ .tsf-facet-panel {
1367
+ position: absolute;
1368
+ inset-block-start: calc(100% + 4px);
1369
+ inset-inline-start: 0;
1370
+ z-index: 20;
1371
+ min-inline-size: 240px;
1372
+ max-block-size: 360px;
1373
+ overflow-y: auto;
1374
+ padding: 8px 14px;
1375
+ border: 1px solid var(--throttle-color-border);
1376
+ border-radius: var(--throttle-sf-card-radius);
1377
+ background: var(--throttle-color-background);
1378
+ box-shadow: 0 8px 24px rgb(0 0 0 / 0.14);
1379
+ }
1380
+ .tsf-facet-options { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
1381
+ .tsf-facet-search { margin-block-end: 8px; }
1382
+ .tsf-facet-option-label { display: flex; align-items: center; gap: 10px; min-block-size: 44px; cursor: pointer; font-size: 14px; }
1383
+ .tsf-facet-option:where([data-empty]) { opacity: 0.5; }
1384
+ .tsf-facet-option-input { inline-size: 18px; block-size: 18px; margin: 0; accent-color: var(--throttle-sf-accent); }
1385
+ .tsf-facet-option-text { flex: 1; overflow-wrap: anywhere; }
1386
+ .tsf-facet-option-count { color: var(--throttle-color-muted-foreground); font-variant-numeric: tabular-nums; font-size: 13px; }
1387
+ .tsf-facet-empty { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 14px; }
1388
+ .tsf-facet-boolean { display: flex; flex-direction: column; }
1389
+
1390
+ .tsf-facet-range { display: flex; flex-direction: column; gap: 8px; }
1391
+ .tsf-facet-range-fields { display: flex; gap: 8px; }
1392
+ .tsf-facet-range-field { display: flex; flex: 1; flex-direction: column; gap: 4px; min-inline-size: 0; font-size: 13px; }
1393
+ .tsf-facet-range-input { inline-size: 100%; }
1394
+ .tsf-facet-range-error { margin: 0; color: var(--throttle-sf-danger); font-size: 13px; }
1395
+ .tsf-facet-range-hint { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 13px; }
1396
+ .tsf-facet-range-actions { display: flex; align-items: center; gap: 12px; }
1397
+ .tsf-facet-range-apply {
1398
+ min-block-size: 44px;
1399
+ padding-inline: 16px;
1400
+ border: 1px solid var(--throttle-color-border-control);
1401
+ border-radius: var(--throttle-sf-card-radius);
1402
+ background: var(--throttle-color-background);
1403
+ color: var(--throttle-color-foreground);
1404
+ font: inherit;
1405
+ cursor: pointer;
1406
+ }
1407
+
1408
+ /* Filters: the drawer */
1409
+ .tsf-filter-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 20px; border-block-end: 1px solid var(--throttle-color-border); }
1410
+ .tsf-filter-drawer-title { margin: 0; font-size: 18px; font-weight: var(--throttle-sf-heading-weight); }
1411
+ .tsf-filter-drawer-close { display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; border: 0; background: none; color: inherit; cursor: pointer; }
1412
+ .tsf-filter-drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
1413
+ .tsf-filter-drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-block-start: 1px solid var(--throttle-color-border); }
1414
+ .tsf-filter-drawer-apply {
1415
+ flex: 1;
1416
+ min-block-size: 44px;
1417
+ padding-inline: 16px;
1418
+ border: 0;
1419
+ border-radius: var(--throttle-sf-card-radius);
1420
+ background: var(--throttle-color-primary);
1421
+ color: var(--throttle-color-primary-foreground);
1422
+ font: inherit;
1423
+ font-weight: 600;
1424
+ cursor: pointer;
1425
+ }
1426
+
1427
+ /* The chips */
1428
+ .tsf-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
1429
+ .tsf-active-filter-remove {
1430
+ display: inline-flex;
1431
+ align-items: center;
1432
+ gap: 6px;
1433
+ min-block-size: 36px;
1434
+ padding-inline: 12px;
1435
+ border: 1px solid var(--throttle-color-border-control);
1436
+ border-radius: 999px;
1437
+ background: var(--throttle-color-muted);
1438
+ color: inherit;
1439
+ font: inherit;
1440
+ font-size: 13px;
1441
+ cursor: pointer;
1442
+ }
1443
+
1444
+ /* The grid */
1445
+ .tsf-product-grid-pages { display: flex; flex-direction: column; gap: var(--throttle-sf-grid-gap); }
1446
+ .tsf-product-grid, .tsf-product-grid-skeleton {
1447
+ display: grid;
1448
+ grid-template-columns: repeat(var(--tsf-cols-mobile, 2), minmax(0, 1fr));
1449
+ gap: var(--throttle-sf-grid-gap);
1450
+ align-items: start;
1451
+ margin: 0;
1452
+ padding: 0;
1453
+ list-style: none;
1454
+ }
1455
+ @media (min-width: 768px) {
1456
+ .tsf-product-grid, .tsf-product-grid-skeleton { grid-template-columns: repeat(var(--tsf-cols-desktop, 4), minmax(0, 1fr)); }
1457
+ }
1458
+ .tsf-product-grid:where([data-previous]) { opacity: 0.55; transition: opacity 0.15s ease; }
1459
+ .tsf-product-grid-item { min-inline-size: 0; }
1460
+ .tsf-product-grid-skeleton-item { aspect-ratio: 4 / 5; border-radius: var(--throttle-sf-card-radius); background: var(--throttle-color-muted); animation: tsf-shop-pulse 1.4s ease-in-out infinite; }
1461
+ @keyframes tsf-shop-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
1462
+ @media (prefers-reduced-motion: reduce) {
1463
+ .tsf-product-grid-skeleton-item { animation: none; }
1464
+ .tsf-product-grid:where([data-previous]) { transition: none; }
1465
+ }
1466
+ .tsf-product-grid-empty, .tsf-product-grid-error { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-block: 48px; text-align: center; color: var(--throttle-color-muted-foreground); }
1467
+
1468
+ /* Pagination */
1469
+ .tsf-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
1470
+ .tsf-pagination-list { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
1471
+ .tsf-pagination-link, .tsf-pagination-step, .tsf-pagination-gap {
1472
+ display: inline-flex;
1473
+ align-items: center;
1474
+ justify-content: center;
1475
+ min-inline-size: 44px;
1476
+ min-block-size: 44px;
1477
+ padding-inline: 8px;
1478
+ border-radius: var(--throttle-sf-card-radius);
1479
+ color: inherit;
1480
+ text-decoration: none;
1481
+ font-variant-numeric: tabular-nums;
1482
+ box-sizing: border-box;
1483
+ }
1484
+ .tsf-pagination-link:hover, .tsf-pagination-step:hover { background: var(--throttle-color-muted); }
1485
+ .tsf-pagination-link:where([aria-current="page"]) { border: 1px solid var(--throttle-color-foreground); font-weight: 600; }
1486
+ .tsf-pagination-step:where([data-disabled]) { opacity: 0.4; }
1487
+ .tsf-pagination-more {
1488
+ min-block-size: 44px;
1489
+ padding-inline: 24px;
1490
+ border: 1px solid var(--throttle-color-border-control);
1491
+ border-radius: var(--throttle-sf-card-radius);
1492
+ background: var(--throttle-color-background);
1493
+ color: var(--throttle-color-foreground);
1494
+ font: inherit;
1495
+ cursor: pointer;
1496
+ }
1497
+ .tsf-pagination-more:where([aria-disabled="true"]) { opacity: 0.6; cursor: progress; }
1498
+ .tsf-pagination-crawl {
1499
+ position: absolute;
1500
+ inline-size: 1px;
1501
+ block-size: 1px;
1502
+ margin: -1px;
1503
+ overflow: hidden;
1504
+ clip: rect(0 0 0 0);
1505
+ white-space: nowrap;
1506
+ }
1507
+
1508
+ /* From 768px up the sidebar or the bar are the filters, and the drawer's button is only for phones. */
1509
+ @media (min-width: 768px) {
1510
+ .tsf-filter-drawer-trigger:where([data-phone-only]) { display: none; }
1511
+ }
1512
+
1513
+ /* Phones: every filter layout is the drawer. */
1514
+ @media (max-width: 767px) {
1515
+ .tsf-filter-sidebar, .tsf-filter-bar { display: none; }
1516
+ .tsf-shop-all-body:where([data-layout="sidebar"]) { grid-template-columns: minmax(0, 1fr); }
1517
+ }
1518
+ `;
1519
+
1520
+ // src/styles/shopper.css.ts
1521
+ var SHOPPER_CSS = `
1522
+ /* Cart drawer */
1523
+ .tsf-cart-drawer {
1524
+ display: flex;
1525
+ flex-direction: column;
1526
+ block-size: 100%;
1527
+ min-block-size: 0;
1528
+ color: var(--throttle-color-foreground);
1529
+ }
1530
+ .tsf-cart-drawer:where([data-inline]) { block-size: auto; }
1531
+ .tsf-cart-drawer-top {
1532
+ display: flex;
1533
+ align-items: center;
1534
+ justify-content: space-between;
1535
+ gap: 12px;
1536
+ padding-block: 12px;
1537
+ padding-inline: 20px;
1538
+ border-block-end: 1px solid var(--throttle-color-border);
1539
+ }
1540
+ .tsf-cart-drawer-title {
1541
+ margin: 0;
1542
+ font-family: var(--throttle-font-family-heading, inherit);
1543
+ font-size: 20px;
1544
+ font-weight: var(--throttle-sf-heading-weight);
1545
+ letter-spacing: var(--throttle-sf-heading-tracking);
1546
+ text-transform: var(--throttle-sf-heading-transform);
1547
+ }
1548
+ .tsf-cart-drawer-title:where([data-inline]) { margin-block-end: 12px; }
1549
+ .tsf-cart-drawer-close {
1550
+ display: inline-flex;
1551
+ align-items: center;
1552
+ justify-content: center;
1553
+ min-inline-size: 44px;
1554
+ min-block-size: 44px;
1555
+ border: 0;
1556
+ border-radius: 8px;
1557
+ background: transparent;
1558
+ color: inherit;
1559
+ cursor: pointer;
1560
+ }
1561
+ .tsf-cart-drawer-close:focus-visible,
1562
+ .tsf-cart-line-remove:focus-visible,
1563
+ .tsf-cart-line-decrease:focus-visible,
1564
+ .tsf-cart-line-increase:focus-visible,
1565
+ .tsf-cart-checkout:focus-visible,
1566
+ .tsf-cart-continue:focus-visible,
1567
+ .tsf-quick-add-button:focus-visible,
1568
+ .tsf-compare-button:focus-visible,
1569
+ .tsf-compare-clear:focus-visible,
1570
+ .tsf-compare-product-remove:focus-visible {
1571
+ outline: 2px solid var(--throttle-color-primary);
1572
+ outline-offset: 2px;
1573
+ }
1574
+ .tsf-cart-drawer-body {
1575
+ display: flex;
1576
+ flex-direction: column;
1577
+ flex: 1 1 auto;
1578
+ min-block-size: 0;
1579
+ }
1580
+ .tsf-cart-status:empty { display: none; }
1581
+ .tsf-cart-status { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
1582
+ .tsf-cart-error {
1583
+ margin: 12px 20px 0;
1584
+ padding: 10px 12px;
1585
+ border-radius: var(--throttle-radius);
1586
+ background: var(--throttle-color-muted);
1587
+ color: var(--throttle-sf-danger);
1588
+ font-size: 14px;
1589
+ }
1590
+ .tsf-cart-loading { padding: 20px; }
1591
+ .tsf-cart-empty { display: grid; justify-items: center; gap: 16px; padding: 48px 20px; text-align: center; }
1592
+ .tsf-cart-empty-text { margin: 0; color: var(--throttle-color-muted-foreground); }
1593
+ .tsf-cart-lines {
1594
+ flex: 1 1 auto;
1595
+ min-block-size: 0;
1596
+ margin: 0;
1597
+ padding: 0 20px;
1598
+ list-style: none;
1599
+ overflow-y: auto;
1600
+ }
1601
+ .tsf-cart-line {
1602
+ display: grid;
1603
+ grid-template-columns: 72px minmax(0, 1fr) auto;
1604
+ grid-template-areas: "media body total" "media body remove";
1605
+ align-items: start;
1606
+ gap: 4px 12px;
1607
+ padding-block: 16px;
1608
+ border-block-end: 1px solid var(--throttle-color-border);
1609
+ }
1610
+ .tsf-cart-line:where([data-busy]) { opacity: 0.7; }
1611
+ .tsf-cart-line-media { grid-area: media; overflow: hidden; border-radius: var(--throttle-radius); background: var(--throttle-color-muted); }
1612
+ .tsf-cart-line-body { grid-area: body; display: grid; gap: 4px; min-inline-size: 0; }
1613
+ .tsf-cart-line-name { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
1614
+ .tsf-cart-line-price { margin: 0; color: var(--throttle-color-muted-foreground); font-size: 14px; }
1615
+ .tsf-cart-line-note { margin: 0; color: var(--throttle-sf-danger); font-size: 13px; }
1616
+ .tsf-cart-line-quantity {
1617
+ display: inline-flex;
1618
+ align-items: center;
1619
+ justify-self: start;
1620
+ margin-block-start: 4px;
1621
+ border: 1px solid var(--throttle-color-border-control);
1622
+ border-radius: var(--throttle-radius);
1623
+ }
1624
+ .tsf-cart-line-decrease,
1625
+ .tsf-cart-line-increase {
1626
+ display: inline-flex;
1627
+ align-items: center;
1628
+ justify-content: center;
1629
+ min-inline-size: 44px;
1630
+ min-block-size: 44px;
1631
+ border: 0;
1632
+ background: transparent;
1633
+ color: inherit;
1634
+ cursor: pointer;
1635
+ }
1636
+ .tsf-cart-line-decrease:disabled,
1637
+ .tsf-cart-line-increase:disabled { opacity: 0.4; cursor: not-allowed; }
1638
+ .tsf-cart-line-count { min-inline-size: 28px; text-align: center; font-variant-numeric: tabular-nums; }
1639
+ .tsf-cart-line-total { grid-area: total; margin: 0; font-weight: 600; text-align: end; }
1640
+ .tsf-cart-line-remove {
1641
+ grid-area: remove;
1642
+ align-self: end;
1643
+ justify-self: end;
1644
+ min-block-size: 44px;
1645
+ padding-inline: 4px;
1646
+ border: 0;
1647
+ background: transparent;
1648
+ color: var(--throttle-color-muted-foreground);
1649
+ font: inherit;
1650
+ font-size: 13px;
1651
+ text-decoration: underline;
1652
+ cursor: pointer;
1653
+ }
1654
+ .tsf-cart-line-remove:disabled { opacity: 0.5; cursor: not-allowed; }
1655
+ .tsf-cart-footer {
1656
+ display: grid;
1657
+ gap: 12px;
1658
+ padding-block: 16px;
1659
+ padding-inline: 20px;
1660
+ border-block-start: 1px solid var(--throttle-color-border);
1661
+ background: var(--throttle-color-background);
1662
+ }
1663
+ .tsf-cart-subtotal { display: flex; align-items: baseline; justify-content: space-between; margin: 0; font-size: 18px; font-weight: 600; }
1664
+ .tsf-cart-checkout {
1665
+ min-block-size: 48px;
1666
+ padding-inline: 20px;
1667
+ border: 1px solid transparent;
1668
+ border-radius: var(--throttle-radius);
1669
+ background: var(--throttle-color-primary);
1670
+ color: var(--throttle-color-primary-foreground);
1671
+ font: inherit;
1672
+ font-weight: 600;
1673
+ cursor: pointer;
1674
+ }
1675
+ .tsf-cart-checkout:hover:not(:disabled) { filter: brightness(0.92); }
1676
+ .tsf-cart-checkout:disabled { opacity: 0.55; cursor: not-allowed; }
1677
+ .tsf-cart-checkout:where([aria-disabled="true"]) { cursor: progress; }
1678
+ .tsf-cart-continue {
1679
+ display: inline-flex;
1680
+ align-items: center;
1681
+ justify-content: center;
1682
+ min-block-size: 44px;
1683
+ padding-inline: 12px;
1684
+ border: 0;
1685
+ background: transparent;
1686
+ color: var(--throttle-sf-accent);
1687
+ font: inherit;
1688
+ text-decoration: underline;
1689
+ cursor: pointer;
1690
+ }
1691
+
1692
+ /* Quick add */
1693
+ .tsf-quick-add { position: relative; display: grid; gap: 4px; justify-items: end; }
1694
+ .tsf-quick-add-button,
1695
+ .tsf-compare-button {
1696
+ min-block-size: 44px;
1697
+ padding-inline: 14px;
1698
+ border: 1px solid var(--throttle-color-border-control);
1699
+ border-radius: var(--throttle-radius);
1700
+ background: var(--throttle-color-background);
1701
+ color: var(--throttle-color-foreground);
1702
+ font: inherit;
1703
+ font-size: 14px;
1704
+ font-weight: 600;
1705
+ cursor: pointer;
1706
+ }
1707
+ .tsf-quick-add-button:hover,
1708
+ .tsf-compare-button:hover:not(:disabled) { background: var(--throttle-color-muted); }
1709
+ .tsf-quick-add-button:where([aria-disabled="true"]) { cursor: progress; }
1710
+ .tsf-compare-button:where([aria-pressed="true"]) { border-color: var(--throttle-sf-accent); color: var(--throttle-sf-accent); }
1711
+ .tsf-compare-button:disabled { opacity: 0.5; cursor: not-allowed; }
1712
+ .tsf-quick-add-message { margin: 0; max-inline-size: 220px; font-size: 13px; text-align: end; }
1713
+ .tsf-quick-add-message:empty { display: none; }
1714
+ .tsf-quick-add-message:where([data-tone="ok"]) { color: var(--throttle-sf-success); }
1715
+ .tsf-quick-add-message:where([data-tone="refused"]) { color: var(--throttle-sf-danger); }
1716
+ .tsf-quick-add-panel {
1717
+ position: fixed;
1718
+ z-index: var(--throttle-z-popover, 30);
1719
+ display: grid;
1720
+ gap: 12px;
1721
+ inline-size: min(280px, calc(100vw - 16px));
1722
+ overflow-y: auto;
1723
+ padding: 16px;
1724
+ border: 1px solid var(--throttle-color-border);
1725
+ border-radius: var(--throttle-radius);
1726
+ background: var(--throttle-color-background);
1727
+ color: var(--throttle-color-foreground);
1728
+ box-shadow: var(--throttle-shadow-popover, 0 8px 24px rgba(0, 0, 0, 0.12));
1729
+ text-align: start;
1730
+ }
1731
+ .tsf-quick-add-title { margin: 0; font-weight: 600; }
1732
+
1733
+ /* Quick view */
1734
+ .tsf-quick-view-title {
1735
+ position: absolute;
1736
+ inline-size: 1px;
1737
+ block-size: 1px;
1738
+ margin: -1px;
1739
+ overflow: hidden;
1740
+ clip-path: inset(50%);
1741
+ white-space: nowrap;
1742
+ }
1743
+ .tsf-quick-view { padding: 24px; }
1744
+ .tsf-quick-view-message { margin: 0; padding: 24px; text-align: center; color: var(--throttle-color-muted-foreground); }
1745
+ .tsf-quick-view-body { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
1746
+ @media (min-width: 640px) {
1747
+ .tsf-quick-view-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
1748
+ }
1749
+ .tsf-quick-view-gallery, .tsf-quick-view-details { min-inline-size: 0; }
1750
+ .tsf-quick-view-details { display: grid; align-content: start; gap: 16px; }
1751
+ .tsf-quick-view-link { color: var(--throttle-sf-accent); text-decoration: underline; }
1752
+
1753
+ /* Recently viewed */
1754
+ .tsf-recently-viewed { display: grid; gap: 16px; }
1755
+ .tsf-recently-viewed-title {
1756
+ margin: 0;
1757
+ font-family: var(--throttle-font-family-heading, inherit);
1758
+ font-size: 22px;
1759
+ font-weight: var(--throttle-sf-heading-weight);
1760
+ letter-spacing: var(--throttle-sf-heading-tracking);
1761
+ text-transform: var(--throttle-sf-heading-transform);
1762
+ }
1763
+ .tsf-recently-viewed-list {
1764
+ display: flex;
1765
+ gap: var(--throttle-sf-grid-gap, 16px);
1766
+ margin: 0;
1767
+ padding: 0;
1768
+ list-style: none;
1769
+ overflow-x: auto;
1770
+ scroll-snap-type: x proximity;
1771
+ }
1772
+ .tsf-recently-viewed-item { flex: 0 0 min(220px, 60vw); min-inline-size: 0; scroll-snap-align: start; }
1773
+
1774
+ /* Compare */
1775
+ .tsf-compare { display: grid; gap: 16px; }
1776
+ .tsf-compare-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
1777
+ .tsf-compare-title {
1778
+ margin: 0;
1779
+ font-family: var(--throttle-font-family-heading, inherit);
1780
+ font-size: 22px;
1781
+ font-weight: var(--throttle-sf-heading-weight);
1782
+ letter-spacing: var(--throttle-sf-heading-tracking);
1783
+ text-transform: var(--throttle-sf-heading-transform);
1784
+ }
1785
+ .tsf-compare-clear {
1786
+ min-block-size: 44px;
1787
+ padding-inline: 12px;
1788
+ border: 0;
1789
+ background: transparent;
1790
+ color: var(--throttle-sf-accent);
1791
+ font: inherit;
1792
+ text-decoration: underline;
1793
+ cursor: pointer;
1794
+ }
1795
+ .tsf-compare-empty { margin: 0; color: var(--throttle-color-muted-foreground); }
1796
+ .tsf-compare-scroll { overflow-x: auto; }
1797
+ .tsf-compare-table { inline-size: 100%; min-inline-size: 560px; border-collapse: collapse; table-layout: fixed; }
1798
+ .tsf-compare-caption {
1799
+ position: absolute;
1800
+ inline-size: 1px;
1801
+ block-size: 1px;
1802
+ margin: -1px;
1803
+ overflow: hidden;
1804
+ clip-path: inset(50%);
1805
+ white-space: nowrap;
1806
+ }
1807
+ .tsf-compare-label {
1808
+ inline-size: 140px;
1809
+ padding: 12px;
1810
+ border-block-end: 1px solid var(--throttle-color-border);
1811
+ color: var(--throttle-color-muted-foreground);
1812
+ font-size: 14px;
1813
+ font-weight: 600;
1814
+ text-align: start;
1815
+ vertical-align: top;
1816
+ }
1817
+ .tsf-compare-product {
1818
+ position: relative;
1819
+ padding: 12px;
1820
+ border-block-end: 1px solid var(--throttle-color-border);
1821
+ font-weight: 600;
1822
+ text-align: start;
1823
+ vertical-align: top;
1824
+ }
1825
+ .tsf-compare-product-media { overflow: hidden; margin-block-end: 8px; border-radius: var(--throttle-radius); background: var(--throttle-color-muted); }
1826
+ .tsf-compare-product-link { color: inherit; text-decoration: none; }
1827
+ .tsf-compare-product-link:hover { text-decoration: underline; }
1828
+ .tsf-compare-product-remove {
1829
+ position: absolute;
1830
+ inset-block-start: 4px;
1831
+ inset-inline-end: 4px;
1832
+ display: inline-flex;
1833
+ align-items: center;
1834
+ justify-content: center;
1835
+ min-inline-size: 44px;
1836
+ min-block-size: 44px;
1837
+ border: 0;
1838
+ border-radius: 999px;
1839
+ background: var(--throttle-color-background);
1840
+ color: var(--throttle-color-foreground);
1841
+ cursor: pointer;
1842
+ }
1843
+ .tsf-compare-cell { padding: 12px; border-block-end: 1px solid var(--throttle-color-border); vertical-align: top; overflow-wrap: anywhere; }
1844
+ `;
1845
+
1846
+ // src/styles/index.ts
1847
+ var STOREFRONT_STYLE_ID = "throttle-storefront-styles";
1848
+ var STOREFRONT_LAYER_ORDER_ID = "throttle-storefront-layer-order";
1849
+ var STOREFRONT_LAYER_ORDER = "@layer theme, base, throttle, components, utilities;";
1850
+ var STOREFRONT_STYLES = "@layer throttle{" + _ui.primitiveStyles.call(void 0, "tsf-") + BASE_CSS + PIECES_CSS + SHOP_CSS + PRODUCT_CSS + FRAME_CSS + MERCH_CSS + SHOPPER_CSS + PAGES_CSS + PRESET_CSS + "}";
1851
+
1852
+ // src/theme/to-variables.ts
1853
+ var _catalog = require('@usethrottle/catalog');
1854
+ var BLACK = "#000000";
1855
+ var GRID_GAP = {
1856
+ compact: "12px",
1857
+ comfortable: "20px",
1858
+ roomy: "32px"
1859
+ };
1860
+ var hex = (value) => _chunkM4YXSLRGcjs.isHexColor.call(void 0, value) ? _chunkM4YXSLRGcjs.normalizeHex.call(void 0, value) : void 0;
1861
+ function themeToVariables(theme, scheme) {
1862
+ const mapped = _catalog.toAuthAppearance.call(void 0,
1863
+ { light: theme.light, dark: theme.dark, fonts: theme.fonts, radius: theme.radius },
1864
+ scheme
1865
+ );
1866
+ const variables = { ...mapped.variables };
1867
+ const palette = theme[scheme];
1868
+ const sf = {
1869
+ "--throttle-sf-card-radius": `${Number.isFinite(theme.radius) ? theme.radius : 0}px`,
1870
+ "--throttle-sf-grid-gap": _nullishCoalesce(GRID_GAP[theme.spacingScale], () => ( GRID_GAP.comfortable))
1871
+ };
1872
+ const put = (name, value) => {
1873
+ if (value !== void 0) sf[`--throttle-sf-${name}`] = value;
1874
+ };
1875
+ put("sale", hex(palette.colorSale));
1876
+ put("success", hex(palette.colorSuccess));
1877
+ put("warning", hex(palette.colorWarning));
1878
+ put("danger", hex(palette.colorDanger));
1879
+ const accent = hex(palette.colorAccent);
1880
+ if (accent !== void 0) {
1881
+ const bright = _chunkM4YXSLRGcjs.brighten.call(void 0, accent, 0.165, 1.15);
1882
+ const surface = hex(palette.colorSurface);
1883
+ put("accent", accent);
1884
+ put("accent-hover", scheme === "light" ? _chunkM4YXSLRGcjs.mix.call(void 0, accent, BLACK, 0.8) : bright);
1885
+ put("accent-subtle", surface === void 0 ? void 0 : _chunkM4YXSLRGcjs.mix.call(void 0, bright, surface, 0.15));
1886
+ }
1887
+ return { variables, sf };
1888
+ }
1889
+
1890
+ // src/provider/router.ts
1891
+ var _react = require('react');
1892
+ var listeners = /* @__PURE__ */ new Set();
1893
+ var notify = () => listeners.forEach((l) => l());
1894
+ function subscribe(listener) {
1895
+ if (listeners.size === 0) window.addEventListener("popstate", notify);
1896
+ listeners.add(listener);
1897
+ return () => {
1898
+ listeners.delete(listener);
1899
+ if (listeners.size === 0) window.removeEventListener("popstate", notify);
1900
+ };
1901
+ }
1902
+ var snapshot = () => window.location.pathname + window.location.search;
1903
+ var serverSnapshot = () => "/";
1904
+ function navigate(mode, href, options) {
1905
+ window.history[mode === "push" ? "pushState" : "replaceState"](null, "", href);
1906
+ notify();
1907
+ if (_optionalChain([options, 'optionalAccess', _ => _.scroll]) !== false) window.scrollTo(0, 0);
1908
+ }
1909
+ function useHistoryRouter() {
1910
+ const location = _react.useSyncExternalStore.call(void 0, subscribe, snapshot, serverSnapshot);
1911
+ return _react.useMemo.call(void 0, () => {
1912
+ const at = location.indexOf("?");
1913
+ return {
1914
+ pathname: at === -1 ? location : location.slice(0, at),
1915
+ searchParams: new URLSearchParams(at === -1 ? "" : location.slice(at + 1)),
1916
+ push: (href, options) => navigate("push", href, options),
1917
+ replace: (href, options) => navigate("replace", href, options)
1918
+ };
1919
+ }, [location]);
1920
+ }
1921
+
1922
+ // src/provider/StorefrontProvider.tsx
1923
+
1924
+
1925
+
1926
+
1927
+
1928
+ var _react3 = require('@usethrottle/catalog/react');
1929
+
1930
+
1931
+
1932
+
1933
+
1934
+
1935
+
1936
+
1937
+
1938
+ var MIN_WATCH_INTERVAL_MS = 6e4;
1939
+ var NO_ANALYTICS = { track() {
1940
+ } };
1941
+ var declarations = (vars) => Object.entries(vars).map(([name, value]) => `${name}: ${value};`).join(" ");
1942
+ function scopeIdOf(text) {
1943
+ let hash = 5381;
1944
+ for (let i = 0; i < text.length; i++) hash = (hash << 5) + hash + text.charCodeAt(i) | 0;
1945
+ return `f${(hash >>> 0).toString(36)}`;
1946
+ }
1947
+ function StorefrontProvider(props) {
1948
+ const { catalogKey, client: given, currency, locale } = props;
1949
+ const client = _react.useMemo.call(void 0, () => {
1950
+ if (given) return given;
1951
+ if (!catalogKey) throw new Error("StorefrontProvider needs a `catalogKey` or a `client`.");
1952
+ return _catalog.createCatalogClient.call(void 0, {
1953
+ publishableKey: catalogKey,
1954
+ ...currency ? { currency } : {},
1955
+ ...locale ? { locale } : {}
1956
+ });
1957
+ }, [given, catalogKey, currency, locale]);
1958
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1959
+ _react3.CatalogProvider,
1960
+ {
1961
+ client,
1962
+ customerKey: _nullishCoalesce(props.customerKey, () => ( null)),
1963
+ cartStorage: props.cartStorage,
1964
+ customerCart: props.customerCart,
1965
+ cartUrls: props.cartUrls,
1966
+ throttleBaseUrl: props.throttleBaseUrl,
1967
+ throttleCheckoutUrl: props.throttleCheckoutUrl,
1968
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StorefrontRoot, { ...props, client })
1969
+ }
1970
+ );
1971
+ }
1972
+ function StorefrontRoot(props) {
1973
+ const {
1974
+ client,
1975
+ settings: initialSettings,
1976
+ preset,
1977
+ scheme,
1978
+ appearance,
1979
+ localization,
1980
+ icons,
1981
+ analytics,
1982
+ router,
1983
+ linkComponent,
1984
+ injectStyles = true,
1985
+ reviewsOnLists = true,
1986
+ throttlePublishableKey,
1987
+ onGenerationChange,
1988
+ generationWatch = true,
1989
+ currency,
1990
+ children
1991
+ } = props;
1992
+ const locale = _nullishCoalesce(props.locale, () => ( "en"));
1993
+ const dir = _nullishCoalesce(props.dir, () => ( (_ui.isRtlLocale.call(void 0, locale) ? "rtl" : "ltr")));
1994
+ const seeded = _react.useMemo.call(void 0,
1995
+ () => initialSettings ? { settings: initialSettings, settingsVersion: 0, generation: 0 } : void 0,
1996
+ [initialSettings]
1997
+ );
1998
+ const query = _react3.useStorefrontSettings.call(void 0, seeded ? { initialData: seeded } : void 0);
1999
+ const settings = _react.useMemo.call(void 0,
2000
+ () => normalizeSettings(_nullishCoalesce(_optionalChain([query, 'access', _2 => _2.data, 'optionalAccess', _3 => _3.settings]), () => ( initialSettings))),
2001
+ [query.data, initialSettings]
2002
+ );
2003
+ const status = query.data ? "ready" : query.error ? "error" : "loading";
2004
+ const siteDesign = _ui.useSiteDesign.call(void 0, );
2005
+ const themeKey = JSON.stringify(_nullishCoalesce(props.theme, () => ( null)));
2006
+ const site = _react.useMemo.call(void 0,
2007
+ () => _chunkM4YXSLRGcjs.resolveSiteDesign.call(void 0, {
2008
+ site: siteDesign,
2009
+ settings,
2010
+ preset,
2011
+ theme: props.theme,
2012
+ scheme,
2013
+ throttlePublishableKey
2014
+ }),
2015
+ // `theme` is compared by value: an inline object must not rebuild every context below.
2016
+ [siteDesign, settings, preset, themeKey, scheme, throttlePublishableKey]
2017
+ );
2018
+ _ui.useInjectStyles.call(void 0, STOREFRONT_LAYER_ORDER_ID, STOREFRONT_LAYER_ORDER, { enabled: injectStyles, position: "prepend" });
2019
+ _ui.useInjectStyles.call(void 0, STOREFRONT_STYLE_ID, STOREFRONT_STYLES, { enabled: injectStyles });
2020
+ const effectiveScheme = _nullishCoalesce(_optionalChain([appearance, 'optionalAccess', _4 => _4.theme]), () => ( site.scheme));
2021
+ const light = _react.useMemo.call(void 0, () => themeToVariables(site.theme, "light"), [site.theme]);
2022
+ const dark = _react.useMemo.call(void 0, () => themeToVariables(site.theme, "dark"), [site.theme]);
2023
+ const uiAppearance = _react.useMemo.call(void 0, () => {
2024
+ const own = _optionalChain([appearance, 'optionalAccess', _5 => _5.variables]);
2025
+ const ownDark = _optionalChain([appearance, 'optionalAccess', _6 => _6.darkVariables]);
2026
+ const base = { ...(effectiveScheme === "dark" ? dark : light).variables, ...own };
2027
+ const value2 = { theme: effectiveScheme, variables: base };
2028
+ if (effectiveScheme === "auto") value2.darkVariables = { ...dark.variables, ...own, ...ownDark };
2029
+ else if (effectiveScheme === "dark" && ownDark) value2.darkVariables = ownDark;
2030
+ if (_optionalChain([appearance, 'optionalAccess', _7 => _7.elements])) value2.elements = appearance.elements;
2031
+ if (_optionalChain([appearance, 'optionalAccess', _8 => _8.parts])) value2.parts = appearance.parts;
2032
+ if (_optionalChain([appearance, 'optionalAccess', _9 => _9.components])) value2.components = appearance.components;
2033
+ return value2;
2034
+ }, [appearance, effectiveScheme, light, dark]);
2035
+ const historyRouter = useHistoryRouter();
2036
+ const [drawerOpen, setDrawerOpen] = _react.useState.call(void 0, false);
2037
+ const drawer = _react.useMemo.call(void 0, () => ({ open: drawerOpen, setOpen: setDrawerOpen }), [drawerOpen]);
2038
+ const value = _react.useMemo.call(void 0,
2039
+ () => ({
2040
+ settings,
2041
+ site,
2042
+ preset: site.preset,
2043
+ scheme: site.scheme,
2044
+ dir,
2045
+ locale,
2046
+ currency,
2047
+ client,
2048
+ router: _nullishCoalesce(router, () => ( historyRouter)),
2049
+ analytics: _nullishCoalesce(analytics, () => ( NO_ANALYTICS)),
2050
+ Link: _nullishCoalesce(linkComponent, () => ( DefaultLink)),
2051
+ reviewsOnLists,
2052
+ throttlePublishableKey: site.throttlePublishableKey
2053
+ }),
2054
+ [settings, site, dir, locale, currency, client, router, historyRouter, analytics, linkComponent, reviewsOnLists]
2055
+ );
2056
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ui.ThrottleUIProvider, { appearance: uiAppearance, classPrefix: "tsf-", dir, icons, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVWXJO427cjs.SfLocalizationProvider, { value: _nullishCoalesce(localization, () => ( {})), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkVWXJO427cjs.StorefrontContext.Provider, { value, children: [
2057
+ generationWatch !== false ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2058
+ GenerationWatcher,
2059
+ {
2060
+ intervalMs: typeof generationWatch === "object" ? generationWatch.intervalMs : void 0,
2061
+ onChange: onGenerationChange
2062
+ }
2063
+ ) : null,
2064
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2LCPIY2Pcjs.CartDrawerContext.Provider, { value: drawer, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2065
+ StorefrontRootElement,
2066
+ {
2067
+ site,
2068
+ scheme: effectiveScheme,
2069
+ sf: { light: light.sf, dark: dark.sf },
2070
+ dir,
2071
+ status,
2072
+ children
2073
+ }
2074
+ ) })
2075
+ ] }) }) });
2076
+ }
2077
+ function GenerationWatcher({ intervalMs, onChange }) {
2078
+ _react3.useGenerationWatch.call(void 0, { intervalMs: Math.max(_nullishCoalesce(intervalMs, () => ( MIN_WATCH_INTERVAL_MS)), MIN_WATCH_INTERVAL_MS), onChange });
2079
+ return null;
2080
+ }
2081
+ function StorefrontRootElement(props) {
2082
+ const { site, scheme, sf, dir, status, children } = props;
2083
+ const { rootProps, scopeCss } = _ui.useAppearance.call(void 0, );
2084
+ const part = _chunkVWXJO427cjs.usePart.call(void 0, "storefront-root");
2085
+ const sfScope = scheme === "auto" ? scopeIdOf(JSON.stringify(sf)) : null;
2086
+ const sfCss = sfScope === null ? null : `.tsf-root[data-sf-scope="${sfScope}"] { ${declarations(sf.light)} }
2087
+ @media (prefers-color-scheme: dark) {
2088
+ .tsf-root[data-sf-scope="${sfScope}"] { ${declarations(sf.dark)} }
2089
+ }
2090
+ `;
2091
+ const style = scheme === "auto" ? rootProps.style : { ...rootProps.style, ...scheme === "dark" ? sf.dark : sf.light };
2092
+ const className = [rootProps.className, part.className].filter(Boolean).join(" ");
2093
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2094
+ "div",
2095
+ {
2096
+ className,
2097
+ style,
2098
+ "data-throttle-part": part["data-throttle-part"],
2099
+ "data-throttle-preset": site.preset,
2100
+ "data-throttle-theme": rootProps["data-throttle-theme"],
2101
+ "data-throttle-scope": rootProps["data-throttle-scope"],
2102
+ "data-sf-scope": _nullishCoalesce(sfScope, () => ( void 0)),
2103
+ "data-site-source": site.source,
2104
+ "data-theme-accent": site.theme.light.colorAccent,
2105
+ "data-theme-radius": site.theme.radius,
2106
+ "data-settings-status": status,
2107
+ dir,
2108
+ children: [
2109
+ scopeCss ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children: scopeCss }) : null,
2110
+ sfCss ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { children: sfCss }) : null,
2111
+ children
2112
+ ]
2113
+ }
2114
+ );
2115
+ }
2116
+
2117
+
2118
+
2119
+
2120
+
2121
+
2122
+
2123
+
2124
+
2125
+
2126
+ exports.DefaultLink = DefaultLink; exports.normalizeSettings = normalizeSettings; exports.STOREFRONT_STYLE_ID = STOREFRONT_STYLE_ID; exports.STOREFRONT_LAYER_ORDER_ID = STOREFRONT_LAYER_ORDER_ID; exports.STOREFRONT_STYLES = STOREFRONT_STYLES; exports.themeToVariables = themeToVariables; exports.useHistoryRouter = useHistoryRouter; exports.StorefrontProvider = StorefrontProvider;
2127
+ //# sourceMappingURL=chunk-6ZMMZ245.cjs.map