@opensite/ui 1.3.2 → 1.3.4

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 (167) hide show
  1. package/dist/footer-accordion-social.cjs +1344 -0
  2. package/dist/footer-accordion-social.d.cts +154 -0
  3. package/dist/footer-accordion-social.d.ts +154 -0
  4. package/dist/footer-accordion-social.js +1322 -0
  5. package/dist/footer-info-cards-accordion.cjs +1427 -0
  6. package/dist/footer-info-cards-accordion.d.cts +278 -0
  7. package/dist/footer-info-cards-accordion.d.ts +278 -0
  8. package/dist/footer-info-cards-accordion.js +1404 -0
  9. package/dist/footer-newsletter-contact.cjs +1281 -0
  10. package/dist/footer-newsletter-contact.d.cts +163 -0
  11. package/dist/footer-newsletter-contact.d.ts +163 -0
  12. package/dist/footer-newsletter-contact.js +1259 -0
  13. package/dist/footer-split-image-accordion.cjs +1395 -0
  14. package/dist/footer-split-image-accordion.d.cts +236 -0
  15. package/dist/footer-split-image-accordion.d.ts +236 -0
  16. package/dist/footer-split-image-accordion.js +1372 -0
  17. package/dist/list-achievements-showcase.cjs +1141 -0
  18. package/dist/list-achievements-showcase.d.cts +131 -0
  19. package/dist/list-achievements-showcase.d.ts +131 -0
  20. package/dist/list-achievements-showcase.js +1119 -0
  21. package/dist/list-career-timeline.cjs +531 -0
  22. package/dist/list-career-timeline.d.cts +153 -0
  23. package/dist/list-career-timeline.d.ts +153 -0
  24. package/dist/list-career-timeline.js +509 -0
  25. package/dist/list-feature-comparison.cjs +1211 -0
  26. package/dist/list-feature-comparison.d.cts +189 -0
  27. package/dist/list-feature-comparison.d.ts +189 -0
  28. package/dist/list-feature-comparison.js +1190 -0
  29. package/dist/list-metrics-dashboard.cjs +1402 -0
  30. package/dist/list-metrics-dashboard.d.cts +191 -0
  31. package/dist/list-metrics-dashboard.d.ts +191 -0
  32. package/dist/list-metrics-dashboard.js +1379 -0
  33. package/dist/list-service-category-table.cjs +762 -0
  34. package/dist/list-service-category-table.d.cts +135 -0
  35. package/dist/list-service-category-table.d.ts +135 -0
  36. package/dist/list-service-category-table.js +741 -0
  37. package/dist/offer-modal-membership-image.cjs +1361 -0
  38. package/dist/offer-modal-membership-image.d.cts +194 -0
  39. package/dist/offer-modal-membership-image.d.ts +194 -0
  40. package/dist/offer-modal-membership-image.js +1339 -0
  41. package/dist/offer-modal-newsletter-discount.cjs +1296 -0
  42. package/dist/offer-modal-newsletter-discount.d.cts +164 -0
  43. package/dist/offer-modal-newsletter-discount.d.ts +164 -0
  44. package/dist/offer-modal-newsletter-discount.js +1274 -0
  45. package/dist/offer-modal-sheet-newsletter.cjs +1360 -0
  46. package/dist/offer-modal-sheet-newsletter.d.cts +221 -0
  47. package/dist/offer-modal-sheet-newsletter.d.ts +221 -0
  48. package/dist/offer-modal-sheet-newsletter.js +1337 -0
  49. package/dist/pricing-addons-cards.cjs +1143 -0
  50. package/dist/pricing-addons-cards.d.cts +203 -0
  51. package/dist/pricing-addons-cards.d.ts +203 -0
  52. package/dist/pricing-addons-cards.js +1122 -0
  53. package/dist/pricing-addons-featured.cjs +1224 -0
  54. package/dist/pricing-addons-featured.d.cts +271 -0
  55. package/dist/pricing-addons-featured.d.ts +271 -0
  56. package/dist/pricing-addons-featured.js +1203 -0
  57. package/dist/pricing-collapsible-plans.cjs +1315 -0
  58. package/dist/pricing-collapsible-plans.d.cts +258 -0
  59. package/dist/pricing-collapsible-plans.d.ts +258 -0
  60. package/dist/pricing-collapsible-plans.js +1294 -0
  61. package/dist/pricing-columns-toggle.cjs +1234 -0
  62. package/dist/pricing-columns-toggle.d.cts +251 -0
  63. package/dist/pricing-columns-toggle.d.ts +251 -0
  64. package/dist/pricing-columns-toggle.js +1212 -0
  65. package/dist/pricing-comparison-headers.cjs +1235 -0
  66. package/dist/pricing-comparison-headers.d.cts +245 -0
  67. package/dist/pricing-comparison-headers.d.ts +245 -0
  68. package/dist/pricing-comparison-headers.js +1213 -0
  69. package/dist/pricing-comparison-table.cjs +1374 -0
  70. package/dist/pricing-comparison-table.d.cts +280 -0
  71. package/dist/pricing-comparison-table.d.ts +280 -0
  72. package/dist/pricing-comparison-table.js +1352 -0
  73. package/dist/pricing-discount-card.cjs +1217 -0
  74. package/dist/pricing-discount-card.d.cts +195 -0
  75. package/dist/pricing-discount-card.d.ts +195 -0
  76. package/dist/pricing-discount-card.js +1195 -0
  77. package/dist/pricing-enterprise-contact.cjs +1094 -0
  78. package/dist/pricing-enterprise-contact.d.cts +170 -0
  79. package/dist/pricing-enterprise-contact.d.ts +170 -0
  80. package/dist/pricing-enterprise-contact.js +1073 -0
  81. package/dist/pricing-feature-matrix.cjs +1197 -0
  82. package/dist/pricing-feature-matrix.d.cts +56 -0
  83. package/dist/pricing-feature-matrix.d.ts +56 -0
  84. package/dist/pricing-feature-matrix.js +1174 -0
  85. package/dist/pricing-four-tier-toggle.cjs +1320 -0
  86. package/dist/pricing-four-tier-toggle.d.cts +266 -0
  87. package/dist/pricing-four-tier-toggle.d.ts +266 -0
  88. package/dist/pricing-four-tier-toggle.js +1297 -0
  89. package/dist/pricing-full-comparison.cjs +1301 -0
  90. package/dist/pricing-full-comparison.d.cts +265 -0
  91. package/dist/pricing-full-comparison.d.ts +265 -0
  92. package/dist/pricing-full-comparison.js +1279 -0
  93. package/dist/pricing-gradient-cards.cjs +1248 -0
  94. package/dist/pricing-gradient-cards.d.cts +258 -0
  95. package/dist/pricing-gradient-cards.d.ts +258 -0
  96. package/dist/pricing-gradient-cards.js +1226 -0
  97. package/dist/pricing-icon-headers.cjs +1163 -0
  98. package/dist/pricing-icon-headers.d.cts +218 -0
  99. package/dist/pricing-icon-headers.d.ts +218 -0
  100. package/dist/pricing-icon-headers.js +1142 -0
  101. package/dist/pricing-minimal-cards.cjs +1146 -0
  102. package/dist/pricing-minimal-cards.d.cts +210 -0
  103. package/dist/pricing-minimal-cards.d.ts +210 -0
  104. package/dist/pricing-minimal-cards.js +1125 -0
  105. package/dist/pricing-packages-radio.cjs +1203 -0
  106. package/dist/pricing-packages-radio.d.cts +243 -0
  107. package/dist/pricing-packages-radio.d.ts +243 -0
  108. package/dist/pricing-packages-radio.js +1182 -0
  109. package/dist/pricing-popular-highlight.cjs +1293 -0
  110. package/dist/pricing-popular-highlight.d.cts +255 -0
  111. package/dist/pricing-popular-highlight.d.ts +255 -0
  112. package/dist/pricing-popular-highlight.js +1271 -0
  113. package/dist/pricing-radio-toggle.cjs +1277 -0
  114. package/dist/pricing-radio-toggle.d.cts +251 -0
  115. package/dist/pricing-radio-toggle.d.ts +251 -0
  116. package/dist/pricing-radio-toggle.js +1255 -0
  117. package/dist/pricing-responsive-table.cjs +1229 -0
  118. package/dist/pricing-responsive-table.d.cts +55 -0
  119. package/dist/pricing-responsive-table.d.ts +55 -0
  120. package/dist/pricing-responsive-table.js +1206 -0
  121. package/dist/pricing-services-cards.cjs +1209 -0
  122. package/dist/pricing-services-cards.d.cts +230 -0
  123. package/dist/pricing-services-cards.d.ts +230 -0
  124. package/dist/pricing-services-cards.js +1188 -0
  125. package/dist/pricing-simple-card.cjs +1102 -0
  126. package/dist/pricing-simple-card.d.cts +174 -0
  127. package/dist/pricing-simple-card.d.ts +174 -0
  128. package/dist/pricing-simple-card.js +1081 -0
  129. package/dist/pricing-single-card.cjs +1174 -0
  130. package/dist/pricing-single-card.d.cts +201 -0
  131. package/dist/pricing-single-card.d.ts +201 -0
  132. package/dist/pricing-single-card.js +1152 -0
  133. package/dist/pricing-split-layout.cjs +1001 -0
  134. package/dist/pricing-split-layout.d.cts +44 -0
  135. package/dist/pricing-split-layout.d.ts +44 -0
  136. package/dist/pricing-split-layout.js +980 -0
  137. package/dist/pricing-spotlight-card.cjs +1157 -0
  138. package/dist/pricing-spotlight-card.d.cts +201 -0
  139. package/dist/pricing-spotlight-card.d.ts +201 -0
  140. package/dist/pricing-spotlight-card.js +1136 -0
  141. package/dist/pricing-switch-cards.cjs +1274 -0
  142. package/dist/pricing-switch-cards.d.cts +254 -0
  143. package/dist/pricing-switch-cards.d.ts +254 -0
  144. package/dist/pricing-switch-cards.js +1252 -0
  145. package/dist/pricing-tabs-toggle.cjs +1314 -0
  146. package/dist/pricing-tabs-toggle.d.cts +274 -0
  147. package/dist/pricing-tabs-toggle.d.ts +274 -0
  148. package/dist/pricing-tabs-toggle.js +1291 -0
  149. package/dist/pricing-tier-grid.cjs +1190 -0
  150. package/dist/pricing-tier-grid.d.cts +224 -0
  151. package/dist/pricing-tier-grid.d.ts +224 -0
  152. package/dist/pricing-tier-grid.js +1169 -0
  153. package/dist/pricing-toggle-cards.cjs +1330 -0
  154. package/dist/pricing-toggle-cards.d.cts +267 -0
  155. package/dist/pricing-toggle-cards.d.ts +267 -0
  156. package/dist/pricing-toggle-cards.js +1307 -0
  157. package/dist/pricing-toggle-period.cjs +1251 -0
  158. package/dist/pricing-toggle-period.d.cts +265 -0
  159. package/dist/pricing-toggle-period.d.ts +265 -0
  160. package/dist/pricing-toggle-period.js +1230 -0
  161. package/dist/pricing-two-column-basic.cjs +1243 -0
  162. package/dist/pricing-two-column-basic.d.cts +244 -0
  163. package/dist/pricing-two-column-basic.d.ts +244 -0
  164. package/dist/pricing-two-column-basic.js +1222 -0
  165. package/dist/registry.cjs +109 -85
  166. package/dist/registry.js +931 -907
  167. package/package.json +1 -1
@@ -0,0 +1,1322 @@
1
+ "use client";
2
+ import * as React from 'react';
3
+ import React__default, { useMemo } from 'react';
4
+ import { useForm, Form, Field } from '@page-speed/forms';
5
+ import { TextInput as TextInput$1 } from '@page-speed/forms/inputs';
6
+ import { Img } from '@page-speed/img';
7
+ import { clsx } from 'clsx';
8
+ import { twMerge } from 'tailwind-merge';
9
+ import { cva } from 'class-variance-authority';
10
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
12
+ import { serializeForRails, deserializeErrors } from '@page-speed/forms/integration';
13
+
14
+ // components/blocks/footers/footer-accordion-social.tsx
15
+ var TextInput = TextInput$1;
16
+ function cn(...inputs) {
17
+ return twMerge(clsx(inputs));
18
+ }
19
+ function normalizePhoneNumber(input) {
20
+ const trimmed = input.trim();
21
+ if (trimmed.toLowerCase().startsWith("tel:")) {
22
+ return trimmed;
23
+ }
24
+ const match = trimmed.match(/^[\s\+\-\(\)]*(\d[\d\s\-\(\)\.]*\d)[\s\-]*(x|ext\.?|extension)?[\s\-]*(\d+)?$/i);
25
+ if (match) {
26
+ const mainNumber = match[1].replace(/[\s\-\(\)\.]/g, "");
27
+ const extension = match[3];
28
+ const normalized = mainNumber.length >= 10 && !trimmed.startsWith("+") ? `+${mainNumber}` : mainNumber;
29
+ const withExtension = extension ? `${normalized};ext=${extension}` : normalized;
30
+ return `tel:${withExtension}`;
31
+ }
32
+ const cleaned = trimmed.replace(/[\s\-\(\)\.]/g, "");
33
+ return `tel:${cleaned}`;
34
+ }
35
+ function normalizeEmail(input) {
36
+ const trimmed = input.trim();
37
+ if (trimmed.toLowerCase().startsWith("mailto:")) {
38
+ return trimmed;
39
+ }
40
+ return `mailto:${trimmed}`;
41
+ }
42
+ function isEmail(input) {
43
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
44
+ return emailRegex.test(input.trim());
45
+ }
46
+ function isPhoneNumber(input) {
47
+ const trimmed = input.trim();
48
+ if (trimmed.toLowerCase().startsWith("tel:")) {
49
+ return true;
50
+ }
51
+ const phoneRegex = /^[\s\+\-\(\)]*\d[\d\s\-\(\)\.]*\d[\s\-]*(x|ext\.?|extension)?[\s\-]*\d*$/i;
52
+ return phoneRegex.test(trimmed);
53
+ }
54
+ function isInternalUrl(href) {
55
+ if (typeof window === "undefined") {
56
+ return href.startsWith("/") && !href.startsWith("//");
57
+ }
58
+ const trimmed = href.trim();
59
+ if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
60
+ return true;
61
+ }
62
+ try {
63
+ const url = new URL(trimmed, window.location.href);
64
+ const currentOrigin = window.location.origin;
65
+ const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
66
+ return normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin);
67
+ } catch {
68
+ return false;
69
+ }
70
+ }
71
+ function toRelativePath(href) {
72
+ if (typeof window === "undefined") {
73
+ return href;
74
+ }
75
+ const trimmed = href.trim();
76
+ if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
77
+ return trimmed;
78
+ }
79
+ try {
80
+ const url = new URL(trimmed, window.location.href);
81
+ const currentOrigin = window.location.origin;
82
+ const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
83
+ if (normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin)) {
84
+ return url.pathname + url.search + url.hash;
85
+ }
86
+ } catch {
87
+ }
88
+ return trimmed;
89
+ }
90
+ function useNavigation({
91
+ href,
92
+ onClick
93
+ } = {}) {
94
+ const linkType = React.useMemo(() => {
95
+ if (!href || href.trim() === "") {
96
+ return onClick ? "none" : "none";
97
+ }
98
+ const trimmed = href.trim();
99
+ if (trimmed.toLowerCase().startsWith("mailto:") || isEmail(trimmed)) {
100
+ return "mailto";
101
+ }
102
+ if (trimmed.toLowerCase().startsWith("tel:") || isPhoneNumber(trimmed)) {
103
+ return "tel";
104
+ }
105
+ if (isInternalUrl(trimmed)) {
106
+ return "internal";
107
+ }
108
+ try {
109
+ new URL(trimmed, typeof window !== "undefined" ? window.location.href : "http://localhost");
110
+ return "external";
111
+ } catch {
112
+ return "internal";
113
+ }
114
+ }, [href, onClick]);
115
+ const normalizedHref = React.useMemo(() => {
116
+ if (!href || href.trim() === "") {
117
+ return void 0;
118
+ }
119
+ const trimmed = href.trim();
120
+ switch (linkType) {
121
+ case "tel":
122
+ return normalizePhoneNumber(trimmed);
123
+ case "mailto":
124
+ return normalizeEmail(trimmed);
125
+ case "internal":
126
+ return toRelativePath(trimmed);
127
+ case "external":
128
+ return trimmed;
129
+ default:
130
+ return trimmed;
131
+ }
132
+ }, [href, linkType]);
133
+ const target = React.useMemo(() => {
134
+ switch (linkType) {
135
+ case "external":
136
+ return "_blank";
137
+ case "internal":
138
+ return "_self";
139
+ case "mailto":
140
+ case "tel":
141
+ return void 0;
142
+ default:
143
+ return void 0;
144
+ }
145
+ }, [linkType]);
146
+ const rel = React.useMemo(() => {
147
+ if (linkType === "external") {
148
+ return "noopener noreferrer";
149
+ }
150
+ return void 0;
151
+ }, [linkType]);
152
+ const isExternal = linkType === "external";
153
+ const isInternal = linkType === "internal";
154
+ const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
155
+ const handleClick = React.useCallback(
156
+ (event) => {
157
+ if (onClick) {
158
+ try {
159
+ onClick(event);
160
+ } catch (error) {
161
+ console.error("Error in user onClick handler:", error);
162
+ }
163
+ }
164
+ if (event.defaultPrevented) {
165
+ return;
166
+ }
167
+ if (shouldUseRouter && normalizedHref && event.button === 0 && // left-click only
168
+ !event.metaKey && !event.altKey && !event.ctrlKey && !event.shiftKey) {
169
+ if (typeof window !== "undefined") {
170
+ const handler = window.__opensiteNavigationHandler;
171
+ if (typeof handler === "function") {
172
+ try {
173
+ const handled = handler(normalizedHref, event.nativeEvent || event);
174
+ if (handled !== false) {
175
+ event.preventDefault();
176
+ }
177
+ } catch (error) {
178
+ console.error("Error in navigation handler:", error);
179
+ }
180
+ }
181
+ }
182
+ }
183
+ },
184
+ [onClick, shouldUseRouter, normalizedHref]
185
+ );
186
+ return {
187
+ linkType,
188
+ normalizedHref,
189
+ target,
190
+ rel,
191
+ isExternal,
192
+ isInternal,
193
+ shouldUseRouter,
194
+ handleClick
195
+ };
196
+ }
197
+ var baseStyles = [
198
+ // Layout
199
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap shrink-0",
200
+ // Typography - using CSS variables with sensible defaults
201
+ "font-[var(--button-font-family,inherit)]",
202
+ "font-[var(--button-font-weight,500)]",
203
+ "tracking-[var(--button-letter-spacing,0)]",
204
+ "leading-[var(--button-line-height,1.25)]",
205
+ "[text-transform:var(--button-text-transform,none)]",
206
+ "text-sm",
207
+ // Border radius
208
+ "rounded-[var(--button-radius,var(--radius,0.375rem))]",
209
+ // Smooth transition - using [transition:...] to set full shorthand property (not just transition-property)
210
+ "[transition:var(--button-transition,all_250ms_cubic-bezier(0.4,0,0.2,1))]",
211
+ // Box shadow (master level) - using [box-shadow:...] for complex multi-value shadows
212
+ "[box-shadow:var(--button-shadow,none)]",
213
+ "hover:[box-shadow:var(--button-shadow-hover,var(--button-shadow,none))]",
214
+ // Disabled state
215
+ "disabled:pointer-events-none disabled:opacity-50",
216
+ // SVG handling
217
+ "[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
218
+ // Focus styles
219
+ "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
220
+ // Invalid state
221
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
222
+ ].join(" ");
223
+ var buttonVariants = cva(baseStyles, {
224
+ variants: {
225
+ variant: {
226
+ // Default (Primary) variant - full customization
227
+ default: [
228
+ "bg-[var(--button-default-bg,hsl(var(--primary)))]",
229
+ "text-[var(--button-default-fg,hsl(var(--primary-foreground)))]",
230
+ "border-[length:var(--button-default-border-width,0px)]",
231
+ "border-[color:var(--button-default-border,transparent)]",
232
+ "[box-shadow:var(--button-default-shadow,var(--button-shadow,none))]",
233
+ "hover:bg-[var(--button-default-hover-bg,hsl(var(--primary)/0.9))]",
234
+ "hover:text-[var(--button-default-hover-fg,var(--button-default-fg,hsl(var(--primary-foreground))))]",
235
+ "hover:border-[color:var(--button-default-hover-border,var(--button-default-border,transparent))]",
236
+ "hover:[box-shadow:var(--button-default-shadow-hover,var(--button-shadow-hover,var(--button-default-shadow,var(--button-shadow,none))))]"
237
+ ].join(" "),
238
+ // Destructive variant - full customization
239
+ destructive: [
240
+ "bg-[var(--button-destructive-bg,hsl(var(--destructive)))]",
241
+ "text-[var(--button-destructive-fg,white)]",
242
+ "border-[length:var(--button-destructive-border-width,0px)]",
243
+ "border-[color:var(--button-destructive-border,transparent)]",
244
+ "[box-shadow:var(--button-destructive-shadow,var(--button-shadow,none))]",
245
+ "hover:bg-[var(--button-destructive-hover-bg,hsl(var(--destructive)/0.9))]",
246
+ "hover:text-[var(--button-destructive-hover-fg,var(--button-destructive-fg,white))]",
247
+ "hover:border-[color:var(--button-destructive-hover-border,var(--button-destructive-border,transparent))]",
248
+ "hover:[box-shadow:var(--button-destructive-shadow-hover,var(--button-shadow-hover,var(--button-destructive-shadow,var(--button-shadow,none))))]",
249
+ "focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
250
+ "dark:bg-destructive/60"
251
+ ].join(" "),
252
+ // Outline variant - full customization with proper border handling
253
+ outline: [
254
+ "bg-[var(--button-outline-bg,hsl(var(--background)))]",
255
+ "text-[var(--button-outline-fg,inherit)]",
256
+ "border-[length:var(--button-outline-border-width,1px)]",
257
+ "border-[color:var(--button-outline-border,hsl(var(--border)))]",
258
+ "[box-shadow:var(--button-outline-shadow,var(--button-shadow,0_1px_2px_0_rgb(0_0_0/0.05)))]",
259
+ "hover:bg-[var(--button-outline-hover-bg,hsl(var(--accent)))]",
260
+ "hover:text-[var(--button-outline-hover-fg,hsl(var(--accent-foreground)))]",
261
+ "hover:border-[color:var(--button-outline-hover-border,var(--button-outline-border,hsl(var(--border))))]",
262
+ "hover:[box-shadow:var(--button-outline-shadow-hover,var(--button-shadow-hover,var(--button-outline-shadow,var(--button-shadow,none))))]",
263
+ "dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
264
+ ].join(" "),
265
+ // Secondary variant - full customization
266
+ secondary: [
267
+ "bg-[var(--button-secondary-bg,hsl(var(--secondary)))]",
268
+ "text-[var(--button-secondary-fg,hsl(var(--secondary-foreground)))]",
269
+ "border-[length:var(--button-secondary-border-width,0px)]",
270
+ "border-[color:var(--button-secondary-border,transparent)]",
271
+ "[box-shadow:var(--button-secondary-shadow,var(--button-shadow,none))]",
272
+ "hover:bg-[var(--button-secondary-hover-bg,hsl(var(--secondary)/0.8))]",
273
+ "hover:text-[var(--button-secondary-hover-fg,var(--button-secondary-fg,hsl(var(--secondary-foreground))))]",
274
+ "hover:border-[color:var(--button-secondary-hover-border,var(--button-secondary-border,transparent))]",
275
+ "hover:[box-shadow:var(--button-secondary-shadow-hover,var(--button-shadow-hover,var(--button-secondary-shadow,var(--button-shadow,none))))]"
276
+ ].join(" "),
277
+ // Ghost variant - full customization
278
+ ghost: [
279
+ "bg-[var(--button-ghost-bg,transparent)]",
280
+ "text-[var(--button-ghost-fg,inherit)]",
281
+ "border-[length:var(--button-ghost-border-width,0px)]",
282
+ "border-[color:var(--button-ghost-border,transparent)]",
283
+ "[box-shadow:var(--button-ghost-shadow,var(--button-shadow,none))]",
284
+ "hover:bg-[var(--button-ghost-hover-bg,hsl(var(--accent)))]",
285
+ "hover:text-[var(--button-ghost-hover-fg,hsl(var(--accent-foreground)))]",
286
+ "hover:border-[color:var(--button-ghost-hover-border,var(--button-ghost-border,transparent))]",
287
+ "hover:[box-shadow:var(--button-ghost-shadow-hover,var(--button-shadow-hover,var(--button-ghost-shadow,var(--button-shadow,none))))]",
288
+ "dark:hover:bg-accent/50"
289
+ ].join(" "),
290
+ // Link variant - full customization
291
+ link: [
292
+ "bg-[var(--button-link-bg,transparent)]",
293
+ "text-[var(--button-link-fg,hsl(var(--primary)))]",
294
+ "border-[length:var(--button-link-border-width,0px)]",
295
+ "border-[color:var(--button-link-border,transparent)]",
296
+ "[box-shadow:var(--button-link-shadow,none)]",
297
+ "hover:bg-[var(--button-link-hover-bg,transparent)]",
298
+ "hover:text-[var(--button-link-hover-fg,var(--button-link-fg,hsl(var(--primary))))]",
299
+ "hover:[box-shadow:var(--button-link-shadow-hover,none)]",
300
+ "underline-offset-4 hover:underline"
301
+ ].join(" ")
302
+ },
303
+ size: {
304
+ default: [
305
+ "h-[var(--button-height-md,2.25rem)]",
306
+ "px-[var(--button-padding-x-md,1rem)]",
307
+ "py-[var(--button-padding-y-md,0.5rem)]",
308
+ "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
309
+ ].join(" "),
310
+ sm: [
311
+ "h-[var(--button-height-sm,2rem)]",
312
+ "px-[var(--button-padding-x-sm,0.75rem)]",
313
+ "py-[var(--button-padding-y-sm,0.25rem)]",
314
+ "gap-1.5",
315
+ "has-[>svg]:px-[calc(var(--button-padding-x-sm,0.75rem)*0.83)]"
316
+ ].join(" "),
317
+ md: [
318
+ "h-[var(--button-height-md,2.25rem)]",
319
+ "px-[var(--button-padding-x-md,1rem)]",
320
+ "py-[var(--button-padding-y-md,0.5rem)]",
321
+ "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
322
+ ].join(" "),
323
+ lg: [
324
+ "h-[var(--button-height-lg,2.5rem)]",
325
+ "px-[var(--button-padding-x-lg,1.5rem)]",
326
+ "py-[var(--button-padding-y-lg,0.5rem)]",
327
+ "has-[>svg]:px-[calc(var(--button-padding-x-lg,1.5rem)*0.67)]"
328
+ ].join(" "),
329
+ icon: "size-[var(--button-height-md,2.25rem)]",
330
+ "icon-sm": "size-[var(--button-height-sm,2rem)]",
331
+ "icon-lg": "size-[var(--button-height-lg,2.5rem)]"
332
+ }
333
+ },
334
+ defaultVariants: {
335
+ variant: "default",
336
+ size: "default"
337
+ }
338
+ });
339
+ var Pressable = React.forwardRef(
340
+ ({
341
+ children,
342
+ className,
343
+ href,
344
+ onClick,
345
+ variant,
346
+ size,
347
+ asButton = false,
348
+ fallbackComponentType = "span",
349
+ componentType,
350
+ "aria-label": ariaLabel,
351
+ "aria-describedby": ariaDescribedby,
352
+ id,
353
+ ...props
354
+ }, ref) => {
355
+ const navigation = useNavigation({ href, onClick });
356
+ const {
357
+ normalizedHref,
358
+ target,
359
+ rel,
360
+ linkType,
361
+ isInternal,
362
+ handleClick
363
+ } = navigation;
364
+ const shouldRenderLink = normalizedHref && linkType !== "none";
365
+ const shouldRenderButton = !shouldRenderLink && onClick;
366
+ const effectiveComponentType = componentType || (shouldRenderLink ? "a" : shouldRenderButton ? "button" : fallbackComponentType);
367
+ const finalComponentType = isInternal && shouldRenderLink ? "a" : effectiveComponentType;
368
+ const shouldApplyButtonStyles = asButton || variant || size;
369
+ const combinedClassName = cn(
370
+ shouldApplyButtonStyles && buttonVariants({ variant, size }),
371
+ className
372
+ );
373
+ const dataProps = Object.fromEntries(
374
+ Object.entries(props).filter(([key]) => key.startsWith("data-"))
375
+ );
376
+ const buttonDataAttributes = shouldApplyButtonStyles ? {
377
+ "data-slot": "button",
378
+ "data-variant": variant ?? "default",
379
+ "data-size": size ?? "default"
380
+ } : {};
381
+ const commonProps = {
382
+ className: combinedClassName,
383
+ onClick: handleClick,
384
+ "aria-label": ariaLabel,
385
+ "aria-describedby": ariaDescribedby,
386
+ id,
387
+ ...dataProps,
388
+ ...buttonDataAttributes
389
+ };
390
+ if (finalComponentType === "a" && shouldRenderLink) {
391
+ return /* @__PURE__ */ jsx(
392
+ "a",
393
+ {
394
+ ref,
395
+ href: normalizedHref,
396
+ target,
397
+ rel,
398
+ ...commonProps,
399
+ ...props,
400
+ children
401
+ }
402
+ );
403
+ }
404
+ if (finalComponentType === "button") {
405
+ return /* @__PURE__ */ jsx(
406
+ "button",
407
+ {
408
+ ref,
409
+ type: props.type || "button",
410
+ ...commonProps,
411
+ ...props,
412
+ children
413
+ }
414
+ );
415
+ }
416
+ if (finalComponentType === "div") {
417
+ return /* @__PURE__ */ jsx(
418
+ "div",
419
+ {
420
+ ref,
421
+ ...commonProps,
422
+ children
423
+ }
424
+ );
425
+ }
426
+ return /* @__PURE__ */ jsx(
427
+ "span",
428
+ {
429
+ ref,
430
+ ...commonProps,
431
+ children
432
+ }
433
+ );
434
+ }
435
+ );
436
+ Pressable.displayName = "Pressable";
437
+ var svgCache = /* @__PURE__ */ new Map();
438
+ function DynamicIcon({
439
+ name,
440
+ size = 28,
441
+ color,
442
+ className,
443
+ alt
444
+ }) {
445
+ const [svgContent, setSvgContent] = React.useState(null);
446
+ const [isLoading, setIsLoading] = React.useState(true);
447
+ const [error, setError] = React.useState(null);
448
+ const { url, iconName } = React.useMemo(() => {
449
+ const separator = name.includes("/") ? "/" : ":";
450
+ const [prefix, iconName2] = name.split(separator);
451
+ const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
452
+ return {
453
+ url: baseUrl,
454
+ iconName: iconName2
455
+ };
456
+ }, [name, size]);
457
+ React.useEffect(() => {
458
+ let isMounted = true;
459
+ const fetchSvg = async () => {
460
+ const cached = svgCache.get(url);
461
+ if (cached) {
462
+ if (isMounted) {
463
+ setSvgContent(cached);
464
+ setIsLoading(false);
465
+ }
466
+ return;
467
+ }
468
+ try {
469
+ setIsLoading(true);
470
+ setError(null);
471
+ const response = await fetch(url);
472
+ if (!response.ok) {
473
+ throw new Error(`Failed to fetch icon: ${response.status}`);
474
+ }
475
+ let svg = await response.text();
476
+ svg = processSvgForCurrentColor(svg);
477
+ svgCache.set(url, svg);
478
+ if (isMounted) {
479
+ setSvgContent(svg);
480
+ setIsLoading(false);
481
+ }
482
+ } catch (err) {
483
+ if (isMounted) {
484
+ setError(err instanceof Error ? err.message : "Failed to load icon");
485
+ setIsLoading(false);
486
+ }
487
+ }
488
+ };
489
+ fetchSvg();
490
+ return () => {
491
+ isMounted = false;
492
+ };
493
+ }, [url]);
494
+ if (isLoading) {
495
+ return /* @__PURE__ */ jsx(
496
+ "span",
497
+ {
498
+ className: cn("inline-block", className),
499
+ style: { width: size, height: size },
500
+ "aria-hidden": "true"
501
+ }
502
+ );
503
+ }
504
+ if (error || !svgContent) {
505
+ return /* @__PURE__ */ jsx(
506
+ "span",
507
+ {
508
+ className: cn("inline-block", className),
509
+ style: { width: size, height: size },
510
+ role: "img",
511
+ "aria-label": alt || iconName
512
+ }
513
+ );
514
+ }
515
+ return /* @__PURE__ */ jsx(
516
+ "span",
517
+ {
518
+ className: cn("inline-flex items-center justify-center", className),
519
+ style: {
520
+ width: size,
521
+ height: size,
522
+ color: color || "inherit"
523
+ },
524
+ role: "img",
525
+ "aria-label": alt || iconName,
526
+ dangerouslySetInnerHTML: { __html: svgContent }
527
+ }
528
+ );
529
+ }
530
+ function processSvgForCurrentColor(svg) {
531
+ let processed = svg;
532
+ processed = processed.replace(
533
+ /stroke=["'](#000000|#000|black)["']/gi,
534
+ 'stroke="currentColor"'
535
+ );
536
+ processed = processed.replace(
537
+ /fill=["'](#000000|#000|black)["']/gi,
538
+ 'fill="currentColor"'
539
+ );
540
+ return processed;
541
+ }
542
+ function Accordion({
543
+ ...props
544
+ }) {
545
+ return /* @__PURE__ */ jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
546
+ }
547
+ function AccordionItem({
548
+ className,
549
+ ...props
550
+ }) {
551
+ return /* @__PURE__ */ jsx(
552
+ AccordionPrimitive.Item,
553
+ {
554
+ "data-slot": "accordion-item",
555
+ className: cn("border-b ", className),
556
+ ...props
557
+ }
558
+ );
559
+ }
560
+ function AccordionTrigger({
561
+ className,
562
+ children,
563
+ ...props
564
+ }) {
565
+ return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
566
+ AccordionPrimitive.Trigger,
567
+ {
568
+ "data-slot": "accordion-trigger",
569
+ className: cn(
570
+ "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
571
+ className
572
+ ),
573
+ ...props,
574
+ children: [
575
+ children,
576
+ /* @__PURE__ */ jsx(
577
+ DynamicIcon,
578
+ {
579
+ name: "lucide/chevron-down",
580
+ className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"
581
+ }
582
+ )
583
+ ]
584
+ }
585
+ ) });
586
+ }
587
+ function AccordionContent({
588
+ className,
589
+ children,
590
+ ...props
591
+ }) {
592
+ return /* @__PURE__ */ jsx(
593
+ AccordionPrimitive.Content,
594
+ {
595
+ "data-slot": "accordion-content",
596
+ className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
597
+ ...props,
598
+ children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4", className), children })
599
+ }
600
+ );
601
+ }
602
+ var PageSpeedFormSubmissionError = class extends Error {
603
+ constructor(message, options = {}) {
604
+ super(message);
605
+ this.name = "PageSpeedFormSubmissionError";
606
+ this.formErrors = options.formErrors;
607
+ this.status = options.status;
608
+ }
609
+ };
610
+ var EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
611
+ function isValidEmail(value) {
612
+ return EMAIL_REGEX.test(value);
613
+ }
614
+ function buildUrlWithParams(endpoint, values) {
615
+ const base = typeof window === "undefined" ? "http://localhost" : window.location.origin;
616
+ const url = new URL(endpoint, base);
617
+ Object.entries(values).forEach(([key, value]) => {
618
+ if (value === void 0 || value === null) {
619
+ return;
620
+ }
621
+ if (Array.isArray(value)) {
622
+ value.forEach((item) => {
623
+ if (item !== void 0 && item !== null) {
624
+ url.searchParams.append(key, String(item));
625
+ }
626
+ });
627
+ return;
628
+ }
629
+ url.searchParams.set(key, String(value));
630
+ });
631
+ return url.toString();
632
+ }
633
+ function normalizeMethod(method) {
634
+ return (method || "post").toUpperCase();
635
+ }
636
+ function resolveFormat(config) {
637
+ if (config?.format) {
638
+ return config.format;
639
+ }
640
+ return config?.apiKey ? "rails" : "json";
641
+ }
642
+ function mergeValues(values, config) {
643
+ return {
644
+ ...config?.values ?? {},
645
+ ...values
646
+ };
647
+ }
648
+ async function submitPageSpeedForm(values, config) {
649
+ if (!config?.endpoint) {
650
+ return null;
651
+ }
652
+ const payload = mergeValues(values, config);
653
+ const method = normalizeMethod(config.method);
654
+ const format = resolveFormat(config);
655
+ const headers = { ...config.headers ?? {} };
656
+ if (format === "rails") {
657
+ if (!config.apiKey) {
658
+ throw new PageSpeedFormSubmissionError(
659
+ "Missing apiKey for Rails form submission."
660
+ );
661
+ }
662
+ const railsConfig = {
663
+ apiKey: config.apiKey,
664
+ contactCategoryToken: config.contactCategoryToken,
665
+ locationId: config.locationId,
666
+ websiteId: config.websiteId,
667
+ websiteFormAssignmentId: config.websiteFormAssignmentId,
668
+ visitorIpAddress: config.visitorIpAddress
669
+ };
670
+ const serialized = serializeForRails(payload, railsConfig);
671
+ if (serialized.contact.contact_form_upload_tokens) {
672
+ serialized.contact.contact_form_upload_tokens = serialized.contact.contact_form_upload_tokens.map((token) => token.replace(/^upload_/, ""));
673
+ }
674
+ headers["Content-Type"] ?? (headers["Content-Type"] = "application/json");
675
+ const response2 = await fetch(config.endpoint, {
676
+ method,
677
+ headers,
678
+ body: JSON.stringify(serialized)
679
+ });
680
+ const data2 = await response2.json().catch(() => null);
681
+ if (!response2.ok || data2 && data2.errors) {
682
+ const errorResponse = {
683
+ errors: data2?.errors ?? { base: ["Form submission failed"] },
684
+ status: data2?.status ?? response2.status
685
+ };
686
+ const formErrors = deserializeErrors(errorResponse);
687
+ throw new PageSpeedFormSubmissionError("Form submission failed.", {
688
+ formErrors,
689
+ status: errorResponse.status
690
+ });
691
+ }
692
+ return data2;
693
+ }
694
+ if (method === "GET") {
695
+ const url = buildUrlWithParams(config.endpoint, payload);
696
+ const response2 = await fetch(url, { method, headers });
697
+ const data2 = await response2.json().catch(() => null);
698
+ if (!response2.ok) {
699
+ throw new PageSpeedFormSubmissionError(
700
+ data2?.message || "Form submission failed.",
701
+ { status: response2.status }
702
+ );
703
+ }
704
+ return data2;
705
+ }
706
+ headers["Content-Type"] ?? (headers["Content-Type"] = "application/json");
707
+ const response = await fetch(config.endpoint, {
708
+ method,
709
+ headers,
710
+ body: JSON.stringify(payload)
711
+ });
712
+ const data = await response.json().catch(() => null);
713
+ if (!response.ok) {
714
+ throw new PageSpeedFormSubmissionError(
715
+ data?.message || "Form submission failed.",
716
+ { status: response.status }
717
+ );
718
+ }
719
+ return data;
720
+ }
721
+ var maxWidthStyles = {
722
+ sm: "max-w-screen-sm",
723
+ md: "max-w-screen-md",
724
+ lg: "max-w-screen-lg",
725
+ xl: "max-w-7xl",
726
+ "2xl": "max-w-screen-2xl",
727
+ "4xl": "max-w-[1536px]",
728
+ full: "max-w-full"
729
+ };
730
+ var Container = React__default.forwardRef(
731
+ ({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
732
+ const Component = as;
733
+ return /* @__PURE__ */ jsx(
734
+ Component,
735
+ {
736
+ ref,
737
+ className: cn(
738
+ "mx-auto w-full px-2 sm:px-4 lg:px-8",
739
+ maxWidthStyles[maxWidth],
740
+ className
741
+ ),
742
+ ...props,
743
+ children
744
+ }
745
+ );
746
+ }
747
+ );
748
+ Container.displayName = "Container";
749
+
750
+ // lib/patternSvgs.ts
751
+ var patternSvgs = {
752
+ squareAltGrid: "https://cdn.ing/assets/files/record/286187/4gpn0yq2ptra8iwlvmwwv860ggwv",
753
+ grid1: "https://cdn.ing/assets/files/record/286186/nbdflpgp4ostrno079hygibsflp3",
754
+ noise: "https://cdn.ing/assets/i/r/286188/zrqcp9hynh3j7p2laihwzfbujgrl/noise.png",
755
+ dots: "https://cdn.ing/assets/files/record/286198/yfsjx9thvtxzhl2qtshxyhkrm524",
756
+ dotPattern: "https://cdn.ing/assets/files/record/286192/7ig0cku8aqbboiza8nuk6hw0nnsr",
757
+ dotPattern2: "https://cdn.ing/assets/files/record/286189/arez6gd2s7isn9i1o6c7sexdq7bl",
758
+ circles: "https://cdn.ing/assets/files/record/286190/gtmia3sncjtzetdshc20zf1d3c17",
759
+ waves: "https://cdn.ing/assets/files/record/286191/mqlb33fzxz9cdth1bx7if0wmpkp1",
760
+ crossPattern: "https://cdn.ing/assets/files/record/286193/9yfqwdbnqaipbp7fsb3wbzzmq472",
761
+ architect: "https://cdn.ing/assets/files/record/286194/vgs88ugpvyhxu13wqgy0acvae6re",
762
+ tinyCheckers: "https://cdn.ing/assets/files/record/286195/65efaknsw8kcpf9o3c2gybytsl5b",
763
+ p6: "https://cdn.ing/assets/i/r/286196/6kl0rqnd6mjk8j7e525fo8fo0vkc/p6.webp"
764
+ };
765
+ var maskTop = "radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%)";
766
+ var maskBottom = "radial-gradient(ellipse 100% 80% at 50% 100%, #000 50%, transparent 90%)";
767
+ var maskCenter = "radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 70%)";
768
+ var maskTopLeft = "radial-gradient(ellipse 80% 80% at 0% 0%, #000 50%, transparent 90%)";
769
+ var maskTopRight = "radial-gradient(ellipse 80% 80% at 100% 0%, #000 50%, transparent 90%)";
770
+ var maskBottomLeft = "radial-gradient(ellipse 80% 80% at 0% 100%, #000 50%, transparent 90%)";
771
+ var maskBottomRight = "radial-gradient(ellipse 80% 80% at 100% 100%, #000 50%, transparent 90%)";
772
+ var circuitBoardPattern = (id, mask) => /* @__PURE__ */ jsxs(
773
+ "svg",
774
+ {
775
+ className: "h-full w-full",
776
+ xmlns: "http://www.w3.org/2000/svg",
777
+ style: mask ? {
778
+ maskImage: mask,
779
+ WebkitMaskImage: mask
780
+ } : void 0,
781
+ children: [
782
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
783
+ "pattern",
784
+ {
785
+ id,
786
+ x: "0",
787
+ y: "0",
788
+ width: "100",
789
+ height: "100",
790
+ patternUnits: "userSpaceOnUse",
791
+ children: [
792
+ /* @__PURE__ */ jsx(
793
+ "path",
794
+ {
795
+ d: "M0 50h40M60 50h40M50 0v40M50 60v40",
796
+ stroke: "hsl(var(--muted))",
797
+ strokeWidth: "1",
798
+ fill: "none"
799
+ }
800
+ ),
801
+ /* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "3", fill: "hsl(var(--muted))" }),
802
+ /* @__PURE__ */ jsx("circle", { cx: "0", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
803
+ /* @__PURE__ */ jsx("circle", { cx: "100", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
804
+ /* @__PURE__ */ jsx("circle", { cx: "50", cy: "0", r: "2", fill: "hsl(var(--muted))" }),
805
+ /* @__PURE__ */ jsx("circle", { cx: "50", cy: "100", r: "2", fill: "hsl(var(--muted))" })
806
+ ]
807
+ }
808
+ ) }),
809
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
810
+ ]
811
+ }
812
+ );
813
+ var gridDotsPattern = (id, mask) => /* @__PURE__ */ jsxs(
814
+ "svg",
815
+ {
816
+ className: "h-full w-full",
817
+ xmlns: "http://www.w3.org/2000/svg",
818
+ style: mask ? {
819
+ maskImage: mask,
820
+ WebkitMaskImage: mask
821
+ } : void 0,
822
+ children: [
823
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
824
+ "pattern",
825
+ {
826
+ id,
827
+ x: "0",
828
+ y: "0",
829
+ width: "40",
830
+ height: "40",
831
+ patternUnits: "userSpaceOnUse",
832
+ children: [
833
+ /* @__PURE__ */ jsx(
834
+ "path",
835
+ {
836
+ d: "M0 20h40M20 0v40",
837
+ stroke: "hsl(var(--muted))",
838
+ strokeWidth: "0.5",
839
+ fill: "none"
840
+ }
841
+ ),
842
+ /* @__PURE__ */ jsx("circle", { cx: "20", cy: "20", r: "2", fill: "hsl(var(--muted))" })
843
+ ]
844
+ }
845
+ ) }),
846
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
847
+ ]
848
+ }
849
+ );
850
+ var gridPattern = (size, mask) => /* @__PURE__ */ jsx(
851
+ "div",
852
+ {
853
+ className: "h-full w-full bg-[linear-gradient(to_right,_hsl(var(--muted))_1px,_transparent_1px),linear-gradient(to_bottom,_hsl(var(--muted))_1px,_transparent_1px)]",
854
+ style: {
855
+ backgroundSize: `${size}px ${size}px`,
856
+ ...mask ? {
857
+ maskImage: mask,
858
+ WebkitMaskImage: mask
859
+ } : {}
860
+ }
861
+ }
862
+ );
863
+ var diagonalCrossPattern = (mask) => /* @__PURE__ */ jsx(
864
+ "div",
865
+ {
866
+ className: "h-full w-full",
867
+ style: {
868
+ backgroundImage: "repeating-linear-gradient(45deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px), repeating-linear-gradient(135deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px)",
869
+ ...mask ? {
870
+ maskImage: mask,
871
+ WebkitMaskImage: mask
872
+ } : {}
873
+ }
874
+ }
875
+ );
876
+ var dashedGridMaskBase = "repeating-linear-gradient(to right, black 0px, black 3px, transparent 3px, transparent 8px), repeating-linear-gradient(to bottom, black 0px, black 3px, transparent 3px, transparent 8px)";
877
+ var dashedGridPattern = (fadeMask) => {
878
+ const mask = fadeMask ? `${dashedGridMaskBase}, ${fadeMask}` : dashedGridMaskBase;
879
+ return /* @__PURE__ */ jsx(
880
+ "div",
881
+ {
882
+ className: "h-full w-full",
883
+ style: {
884
+ backgroundImage: "linear-gradient(to right, hsl(var(--muted)) 1px, transparent 1px), linear-gradient(to bottom, hsl(var(--muted)) 1px, transparent 1px)",
885
+ backgroundSize: "20px 20px",
886
+ backgroundPosition: "0 0, 0 0",
887
+ maskImage: mask,
888
+ WebkitMaskImage: mask,
889
+ maskComposite: "intersect",
890
+ WebkitMaskComposite: "source-in"
891
+ }
892
+ }
893
+ );
894
+ };
895
+ var gradientGlow = (position) => /* @__PURE__ */ jsx(
896
+ "div",
897
+ {
898
+ className: cn(
899
+ "pointer-events-none absolute left-1/2 z-0 aspect-square w-3/4 -translate-x-1/2 rounded-full opacity-50 blur-3xl",
900
+ position === "top" ? "-top-1/4" : "-bottom-1/4"
901
+ ),
902
+ style: {
903
+ background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
904
+ }
905
+ }
906
+ );
907
+ var spotlight = (position) => /* @__PURE__ */ jsx(
908
+ "div",
909
+ {
910
+ className: cn(
911
+ "pointer-events-none absolute top-1/2 z-0 aspect-square w-3/4 -translate-y-1/2 rounded-full opacity-40 blur-3xl",
912
+ position === "left" ? "-left-1/4" : "-right-1/4"
913
+ ),
914
+ style: {
915
+ background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
916
+ }
917
+ }
918
+ );
919
+ var patternOverlays = {
920
+ circuitBoardBasic: () => circuitBoardPattern("circuit-board-basic"),
921
+ circuitBoardFadeTop: () => circuitBoardPattern("circuit-board-fade-top", maskTop),
922
+ circuitBoardFadeBottom: () => circuitBoardPattern("circuit-board-fade-bottom", maskBottom),
923
+ circuitBoardFadeCenter: () => circuitBoardPattern("circuit-board-fade-center", maskCenter),
924
+ circuitBoardFadeTopLeft: () => circuitBoardPattern("circuit-board-fade-top-left", maskTopLeft),
925
+ circuitBoardFadeTopRight: () => circuitBoardPattern("circuit-board-fade-top-right", maskTopRight),
926
+ circuitBoardFadeBottomLeft: () => circuitBoardPattern("circuit-board-fade-bottom-left", maskBottomLeft),
927
+ circuitBoardFadeBottomRight: () => circuitBoardPattern("circuit-board-fade-bottom-right", maskBottomRight),
928
+ dashedGridBasic: () => dashedGridPattern(),
929
+ dashedGridFadeTop: () => dashedGridPattern(maskTop),
930
+ dashedGridFadeBottom: () => dashedGridPattern(maskBottom),
931
+ dashedGridFadeCenter: () => dashedGridPattern(maskCenter),
932
+ dashedGridFadeTopLeft: () => dashedGridPattern(maskTopLeft),
933
+ dashedGridFadeTopRight: () => dashedGridPattern(maskTopRight),
934
+ dashedGridFadeBottomLeft: () => dashedGridPattern(maskBottomLeft),
935
+ dashedGridFadeBottomRight: () => dashedGridPattern(maskBottomRight),
936
+ diagonalCrossBasic: () => diagonalCrossPattern(),
937
+ diagonalCrossFadeTop: () => diagonalCrossPattern(maskTop),
938
+ diagonalCrossFadeBottom: () => diagonalCrossPattern(maskBottom),
939
+ diagonalCrossFadeCenter: () => diagonalCrossPattern(maskCenter),
940
+ diagonalCrossFadeTopLeft: () => diagonalCrossPattern(maskTopLeft),
941
+ diagonalCrossFadeTopRight: () => diagonalCrossPattern(maskTopRight),
942
+ diagonalCrossFadeBottomLeft: () => diagonalCrossPattern(maskBottomLeft),
943
+ diagonalCrossFadeBottomRight: () => diagonalCrossPattern(maskBottomRight),
944
+ gridBasic: () => gridPattern(40),
945
+ gridFadeTop: () => gridPattern(32, maskTop),
946
+ gridFadeBottom: () => gridPattern(32, maskBottom),
947
+ gridFadeCenter: () => gridPattern(40, maskCenter),
948
+ gridFadeTopLeft: () => gridPattern(32, maskTopLeft),
949
+ gridFadeTopRight: () => gridPattern(32, maskTopRight),
950
+ gridFadeBottomLeft: () => gridPattern(32, maskBottomLeft),
951
+ gridFadeBottomRight: () => gridPattern(32, maskBottomRight),
952
+ gridDotsBasic: () => gridDotsPattern("grid-dots-basic"),
953
+ gridDotsFadeCenter: () => gridDotsPattern("grid-dots-fade-center", maskCenter),
954
+ gradientGlowTop: () => gradientGlow("top"),
955
+ gradientGlowBottom: () => gradientGlow("bottom"),
956
+ spotlightLeft: () => spotlight("left"),
957
+ spotlightRight: () => spotlight("right")
958
+ };
959
+ var inlinePatternStyles = {
960
+ radialGradientTop: {
961
+ background: "radial-gradient(125% 125% at 50% 10%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
962
+ },
963
+ radialGradientBottom: {
964
+ background: "radial-gradient(125% 125% at 50% 90%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
965
+ }
966
+ };
967
+ function PatternBackground({
968
+ pattern,
969
+ opacity = 0.08,
970
+ className,
971
+ style
972
+ }) {
973
+ if (!pattern) {
974
+ return null;
975
+ }
976
+ if (pattern in inlinePatternStyles) {
977
+ const inlineStyle = inlinePatternStyles[pattern];
978
+ return /* @__PURE__ */ jsx(
979
+ "div",
980
+ {
981
+ className: cn("pointer-events-none absolute inset-0 z-0", className),
982
+ style: { ...inlineStyle, opacity, ...style },
983
+ "aria-hidden": "true"
984
+ }
985
+ );
986
+ }
987
+ if (pattern in patternOverlays) {
988
+ const Overlay = patternOverlays[pattern];
989
+ return /* @__PURE__ */ jsx(
990
+ "div",
991
+ {
992
+ className: cn("pointer-events-none absolute inset-0 z-0", className),
993
+ style: { opacity, ...style },
994
+ "aria-hidden": "true",
995
+ children: Overlay()
996
+ }
997
+ );
998
+ }
999
+ const patternUrl = pattern in patternSvgs ? patternSvgs[pattern] : pattern;
1000
+ return /* @__PURE__ */ jsx(
1001
+ "div",
1002
+ {
1003
+ className: cn("pointer-events-none absolute inset-0 z-0", className),
1004
+ style: {
1005
+ backgroundImage: `url(${patternUrl})`,
1006
+ backgroundRepeat: "repeat",
1007
+ backgroundSize: "auto",
1008
+ opacity,
1009
+ ...style
1010
+ },
1011
+ "aria-hidden": "true"
1012
+ }
1013
+ );
1014
+ }
1015
+ var backgroundStyles = {
1016
+ default: "bg-background text-foreground",
1017
+ white: "bg-white text-dark",
1018
+ gray: "bg-muted/30 text-foreground",
1019
+ dark: "bg-foreground text-background",
1020
+ transparent: "bg-transparent text-foreground",
1021
+ gradient: "bg-linear-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
1022
+ primary: "bg-primary text-primary-foreground",
1023
+ secondary: "bg-secondary text-secondary-foreground",
1024
+ muted: "bg-muted text-muted-foreground"
1025
+ };
1026
+ var spacingStyles = {
1027
+ none: "py-0 md:py-0",
1028
+ sm: "py-12 md:py-16",
1029
+ md: "py-16 md:py-24",
1030
+ lg: "py-20 md:py-32",
1031
+ xl: "py-24 md:py-40"
1032
+ };
1033
+ var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
1034
+ var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
1035
+ var Section = React__default.forwardRef(
1036
+ ({
1037
+ id,
1038
+ title,
1039
+ subtitle,
1040
+ children,
1041
+ className,
1042
+ style,
1043
+ background = "default",
1044
+ spacing = "lg",
1045
+ pattern,
1046
+ patternOpacity,
1047
+ patternClassName,
1048
+ containerClassName,
1049
+ containerMaxWidth = "xl",
1050
+ ...props
1051
+ }, ref) => {
1052
+ const effectivePatternOpacity = patternOpacity !== void 0 ? patternOpacity : pattern ? 1 : 0;
1053
+ return /* @__PURE__ */ jsxs(
1054
+ "section",
1055
+ {
1056
+ ref,
1057
+ id,
1058
+ className: cn(
1059
+ "relative",
1060
+ pattern ? "overflow-hidden" : null,
1061
+ backgroundStyles[background],
1062
+ isPredefinedSpacing(spacing) ? spacingStyles[spacing] : spacing,
1063
+ className
1064
+ ),
1065
+ style,
1066
+ ...props,
1067
+ children: [
1068
+ /* @__PURE__ */ jsx(
1069
+ PatternBackground,
1070
+ {
1071
+ pattern,
1072
+ opacity: effectivePatternOpacity,
1073
+ className: patternClassName
1074
+ }
1075
+ ),
1076
+ /* @__PURE__ */ jsxs(
1077
+ Container,
1078
+ {
1079
+ maxWidth: containerMaxWidth,
1080
+ className: cn("relative z-10", containerClassName),
1081
+ children: [
1082
+ (title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "mb-6 text-center md:mb-16", children: [
1083
+ subtitle && /* @__PURE__ */ jsx("p", { className: "mb-2 text-sm font-semibold uppercase tracking-wider", children: subtitle }),
1084
+ title && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold tracking-tight md:text-4xl lg:text-5xl", children: title })
1085
+ ] }),
1086
+ children
1087
+ ]
1088
+ }
1089
+ )
1090
+ ]
1091
+ }
1092
+ );
1093
+ }
1094
+ );
1095
+ Section.displayName = "Section";
1096
+ function FooterAccordionSocial({
1097
+ newsletterTitle,
1098
+ newsletterDescription,
1099
+ footerLinks,
1100
+ socialLinks,
1101
+ logo,
1102
+ copyright,
1103
+ className,
1104
+ optixFlowConfig,
1105
+ formConfig,
1106
+ onSubmit,
1107
+ onSuccess,
1108
+ onError,
1109
+ background,
1110
+ spacing,
1111
+ pattern,
1112
+ patternOpacity,
1113
+ patternClassName
1114
+ }) {
1115
+ const [isDesktop, setIsDesktop] = React.useState(false);
1116
+ const [accordionValue, setAccordionValue] = React.useState("");
1117
+ const form = useForm({
1118
+ initialValues: {
1119
+ email: ""
1120
+ },
1121
+ validationSchema: {
1122
+ email: (value) => {
1123
+ if (!value) return "Email is required";
1124
+ if (!isValidEmail(value)) return "Please enter a valid email address";
1125
+ return void 0;
1126
+ }
1127
+ },
1128
+ onSubmit: async (values, helpers) => {
1129
+ const shouldAutoSubmit = Boolean(formConfig?.endpoint);
1130
+ if (!shouldAutoSubmit && !onSubmit) {
1131
+ return;
1132
+ }
1133
+ try {
1134
+ let result;
1135
+ if (shouldAutoSubmit) {
1136
+ result = await submitPageSpeedForm(values, formConfig);
1137
+ }
1138
+ if (onSubmit) {
1139
+ await onSubmit(values.email);
1140
+ }
1141
+ if (shouldAutoSubmit || onSubmit) {
1142
+ if (formConfig?.resetOnSuccess !== false) {
1143
+ helpers.resetForm();
1144
+ }
1145
+ onSuccess?.(result);
1146
+ }
1147
+ } catch (error) {
1148
+ if (error instanceof PageSpeedFormSubmissionError && error.formErrors) {
1149
+ helpers.setErrors(error.formErrors);
1150
+ }
1151
+ onError?.(error);
1152
+ throw error;
1153
+ }
1154
+ }
1155
+ });
1156
+ const formMethod = formConfig?.method?.toLowerCase() === "get" ? "get" : "post";
1157
+ React.useEffect(() => {
1158
+ const checkDesktop = () => setIsDesktop(window.innerWidth >= 1024);
1159
+ checkDesktop();
1160
+ window.addEventListener("resize", checkDesktop);
1161
+ return () => window.removeEventListener("resize", checkDesktop);
1162
+ }, []);
1163
+ const allAccordionIds = useMemo(() => {
1164
+ if (!footerLinks || footerLinks.length === 0) return [];
1165
+ return footerLinks.map(({ id }) => id);
1166
+ }, [footerLinks]);
1167
+ return /* @__PURE__ */ jsx(
1168
+ Section,
1169
+ {
1170
+ background,
1171
+ spacing,
1172
+ pattern,
1173
+ patternOpacity,
1174
+ patternClassName,
1175
+ className,
1176
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-10", children: [
1177
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-10 lg:grid-cols-2 lg:gap-20", children: [
1178
+ /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
1179
+ logo?.url && /* @__PURE__ */ jsxs(Pressable, { href: logo.url, className: "inline-block max-w-48", children: [
1180
+ logo.light && /* @__PURE__ */ jsx(
1181
+ Img,
1182
+ {
1183
+ src: logo.light,
1184
+ alt: "Logo",
1185
+ className: "w-full dark:hidden",
1186
+ optixFlowConfig
1187
+ }
1188
+ ),
1189
+ logo.dark && /* @__PURE__ */ jsx(
1190
+ Img,
1191
+ {
1192
+ src: logo.dark,
1193
+ alt: "Logo",
1194
+ className: "hidden w-full dark:block",
1195
+ optixFlowConfig
1196
+ }
1197
+ )
1198
+ ] }),
1199
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
1200
+ /* @__PURE__ */ jsx("h3", { className: "text-2xl font-semibold", children: newsletterTitle }),
1201
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: newsletterDescription })
1202
+ ] }),
1203
+ /* @__PURE__ */ jsxs(
1204
+ Form,
1205
+ {
1206
+ form,
1207
+ action: formConfig?.endpoint,
1208
+ method: formMethod,
1209
+ className: "flex gap-2",
1210
+ children: [
1211
+ /* @__PURE__ */ jsx(Field, { name: "email", className: "flex-1", children: ({ field, meta }) => /* @__PURE__ */ jsx(
1212
+ TextInput,
1213
+ {
1214
+ ...field,
1215
+ type: "email",
1216
+ placeholder: "Email Address",
1217
+ error: meta.touched && !!meta.error,
1218
+ className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1219
+ "aria-label": "Email Address"
1220
+ }
1221
+ ) }),
1222
+ /* @__PURE__ */ jsx(
1223
+ Pressable,
1224
+ {
1225
+ componentType: "button",
1226
+ type: "submit",
1227
+ className: "inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground hover:bg-primary/90",
1228
+ asButton: false,
1229
+ disabled: form.isSubmitting,
1230
+ children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/arrow-right", size: 16 })
1231
+ }
1232
+ )
1233
+ ]
1234
+ }
1235
+ )
1236
+ ] }),
1237
+ isDesktop ? /* @__PURE__ */ jsx(
1238
+ Accordion,
1239
+ {
1240
+ value: allAccordionIds,
1241
+ type: "multiple",
1242
+ className: "grid grid-cols-2 gap-x-16 gap-y-4 lg:grid-cols-3",
1243
+ children: footerLinks && footerLinks.length > 0 && footerLinks.map((section) => /* @__PURE__ */ jsxs(
1244
+ AccordionItem,
1245
+ {
1246
+ value: section.id,
1247
+ className: "border-none",
1248
+ children: [
1249
+ /* @__PURE__ */ jsx(AccordionTrigger, { className: "cursor-auto rounded-none pb-4 pt-0 text-lg font-bold leading-none hover:no-underline [&>svg]:hidden", children: section.title }),
1250
+ /* @__PURE__ */ jsx(AccordionContent, { className: "pb-0", children: /* @__PURE__ */ jsx("ul", { className: "space-y-2", children: section.items.map((item, idx) => /* @__PURE__ */ jsx("li", { className: "text-sm font-light leading-tight", children: item.type === "email" ? /* @__PURE__ */ jsxs(Fragment, { children: [
1251
+ /* @__PURE__ */ jsx("p", { className: "mb-1.5", children: item.text }),
1252
+ /* @__PURE__ */ jsx(
1253
+ Pressable,
1254
+ {
1255
+ href: `mailto:${item.email}`,
1256
+ className: "underline underline-offset-2",
1257
+ children: item.email
1258
+ }
1259
+ )
1260
+ ] }) : /* @__PURE__ */ jsx(Pressable, { href: item.link, children: item.text }) }, idx)) }) })
1261
+ ]
1262
+ },
1263
+ section.id
1264
+ ))
1265
+ }
1266
+ ) : /* @__PURE__ */ jsx(
1267
+ Accordion,
1268
+ {
1269
+ value: accordionValue,
1270
+ type: "single",
1271
+ collapsible: true,
1272
+ onValueChange: setAccordionValue,
1273
+ className: "space-y-0",
1274
+ children: footerLinks && footerLinks.length > 0 && footerLinks.map((section) => /* @__PURE__ */ jsxs(
1275
+ AccordionItem,
1276
+ {
1277
+ value: section.id,
1278
+ className: "border-b",
1279
+ children: [
1280
+ /* @__PURE__ */ jsxs(AccordionTrigger, { className: "py-4 text-lg font-bold leading-none hover:no-underline [&>svg]:hidden", children: [
1281
+ section.title,
1282
+ /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/plus", size: 20, className: "lg:hidden" })
1283
+ ] }),
1284
+ /* @__PURE__ */ jsx(AccordionContent, { className: "pb-4", children: /* @__PURE__ */ jsx("ul", { className: "space-y-2 pl-4", children: section.items.map((item, idx) => /* @__PURE__ */ jsx("li", { className: "text-sm font-light leading-tight", children: item.type === "email" ? /* @__PURE__ */ jsxs(Fragment, { children: [
1285
+ /* @__PURE__ */ jsx("p", { className: "mb-1.5", children: item.text }),
1286
+ /* @__PURE__ */ jsx(
1287
+ Pressable,
1288
+ {
1289
+ href: `mailto:${item.email}`,
1290
+ className: "underline underline-offset-2",
1291
+ children: item.email
1292
+ }
1293
+ )
1294
+ ] }) : /* @__PURE__ */ jsx(Pressable, { href: item.link, children: item.text }) }, idx)) }) })
1295
+ ]
1296
+ },
1297
+ section.id
1298
+ ))
1299
+ }
1300
+ )
1301
+ ] }),
1302
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-6 border-t pt-8", children: [
1303
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: copyright }),
1304
+ socialLinks && socialLinks.length > 0 && /* @__PURE__ */ jsx("ul", { className: "flex flex-wrap gap-4", children: socialLinks.map((social, idx) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
1305
+ Pressable,
1306
+ {
1307
+ href: social.link,
1308
+ variant: "outline",
1309
+ size: "icon",
1310
+ asButton: true,
1311
+ className: "rounded-full",
1312
+ "aria-label": social.label,
1313
+ children: /* @__PURE__ */ jsx(DynamicIcon, { name: social.icon, size: 20 })
1314
+ }
1315
+ ) }, idx)) })
1316
+ ] })
1317
+ ] })
1318
+ }
1319
+ );
1320
+ }
1321
+
1322
+ export { FooterAccordionSocial };