@fluid-app/fluid-cli-theme-dev 0.1.171 → 0.1.173

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 (92) hide show
  1. package/dist/dist-cli-preview/.vite/manifest.json +583 -181
  2. package/dist/dist-cli-preview/account-screens.css +1 -0
  3. package/dist/dist-cli-preview/account-screens.js +1 -1
  4. package/dist/dist-cli-preview/chunks/{Breadcrumb-BQKo8hPc.js → Breadcrumb-8-7shsB6.js} +1 -1
  5. package/dist/dist-cli-preview/chunks/Combobox-m3vSk0_A.js +521 -0
  6. package/dist/dist-cli-preview/chunks/{ContactsScreen-IsIZ_lQ0.js → ContactsScreen-CBjQOWmH.js} +1523 -1854
  7. package/dist/dist-cli-preview/chunks/MediaScreen-1akMnH12.js +17379 -0
  8. package/dist/dist-cli-preview/chunks/{MemberManagementProviders-DiQkiWzc.js → MemberManagementProviders-WSjb3a8B.js} +189 -199
  9. package/dist/dist-cli-preview/chunks/{MessagingScreen-B8ZxAE0L.js → MessagingScreen-By-jZq6v.js} +27645 -30195
  10. package/dist/dist-cli-preview/chunks/{MobileActionSheet-DMeTsLlK.js → MobileActionSheet-ERpw3qUF.js} +644 -589
  11. package/dist/dist-cli-preview/chunks/MySiteScreen-JAGvVMx-.js +1706 -0
  12. package/dist/dist-cli-preview/chunks/OrdersScreen-B1HQVMZC.js +9 -0
  13. package/dist/dist-cli-preview/chunks/{OrdersScreen-DrZ3SwEu.js → OrdersScreen-Cb32bBjd.js} +35 -35
  14. package/dist/dist-cli-preview/chunks/PortalTenantClientProvider-CguU_uRG.js +15 -0
  15. package/dist/dist-cli-preview/chunks/{ProfileScreen-Dxspc-6p.js → ProfileScreen-CCWM6TBs.js} +454 -463
  16. package/dist/dist-cli-preview/chunks/Select-5fzq5MB-.js +940 -0
  17. package/dist/dist-cli-preview/chunks/{SubscriptionsScreen-Be0C29uw.js → SubscriptionsScreen-DLdsaVJK.js} +3 -3
  18. package/dist/dist-cli-preview/chunks/Textarea-xoKqLVgY.js +330 -0
  19. package/dist/dist-cli-preview/chunks/{account-screen-runtime-DYMunv0A.js → account-screen-runtime-CCBl8DXt.js} +866 -860
  20. package/dist/dist-cli-preview/chunks/ar-D6LJV1_E.js +679 -0
  21. package/dist/dist-cli-preview/chunks/{arrow-left-Bd7dJtIV.js → arrow-left-CTYaRdTX.js} +1 -1
  22. package/dist/dist-cli-preview/chunks/bg-C5Ldmily.js +679 -0
  23. package/dist/dist-cli-preview/chunks/bn-kfMPWNR6.js +679 -0
  24. package/dist/dist-cli-preview/chunks/{cli-preview-C7Db08Ij.js → cli-preview-HAt0Lt-9.js} +20 -13
  25. package/dist/dist-cli-preview/chunks/{client.gen-Ck6Pm2jV.js → client.gen-B7RMYGYu.js} +1 -1
  26. package/dist/dist-cli-preview/chunks/copy-DHN1DxE_.js +14 -0
  27. package/dist/dist-cli-preview/chunks/{countries-api-adapter-InKUzF1q.js → countries-api-adapter-B4TefdRP.js} +2 -2
  28. package/dist/dist-cli-preview/chunks/{create-card-entry-container-C9z7JILL.js → create-card-entry-container-5NqOQ4D_.js} +3612 -3932
  29. package/dist/dist-cli-preview/chunks/cs-DqEgtV8D.js +679 -0
  30. package/dist/dist-cli-preview/chunks/da-BbuvL7Gx.js +679 -0
  31. package/dist/dist-cli-preview/chunks/de-BfJ7rQig.js +679 -0
  32. package/dist/dist-cli-preview/chunks/el-BO0rLq6D.js +679 -0
  33. package/dist/dist-cli-preview/chunks/es-BEVtEUXk.js +679 -0
  34. package/dist/dist-cli-preview/chunks/eye-qMoMW7-Z.js +20 -0
  35. package/dist/dist-cli-preview/chunks/fi-DjISV3UN.js +679 -0
  36. package/dist/dist-cli-preview/chunks/fr-1fFd-aKy.js +679 -0
  37. package/dist/dist-cli-preview/chunks/he-CaT9bwVp.js +679 -0
  38. package/dist/dist-cli-preview/chunks/{hey-api-client-DGRBsZ7Y.js → hey-api-client-JMNyZwcF.js} +79 -39
  39. package/dist/dist-cli-preview/chunks/hi-DkzEm57l.js +679 -0
  40. package/dist/dist-cli-preview/chunks/hr-DqM5N_bj.js +679 -0
  41. package/dist/dist-cli-preview/chunks/hu-DiLqjo5c.js +679 -0
  42. package/dist/dist-cli-preview/chunks/id-DA1KmwgX.js +679 -0
  43. package/dist/dist-cli-preview/chunks/index-BS4PnEcu.js +353 -0
  44. package/dist/dist-cli-preview/chunks/index-BhMjUmAr.js +2572 -0
  45. package/dist/dist-cli-preview/chunks/{screen-route-slug-utils-BDjSpDoe.js → index-Dor8vM2o.js} +2417 -3035
  46. package/dist/dist-cli-preview/chunks/it-CTEVWCRz.js +679 -0
  47. package/dist/dist-cli-preview/chunks/ja-fxqg1hhg.js +679 -0
  48. package/dist/dist-cli-preview/chunks/ko-Btp1_5YS.js +679 -0
  49. package/dist/dist-cli-preview/chunks/lock-DQTMeEw0.js +14 -0
  50. package/dist/dist-cli-preview/chunks/{log-out-CSPZjXTK.js → log-out-DUdRJX4l.js} +1 -1
  51. package/dist/dist-cli-preview/chunks/{map-pin-B2ScoijR.js → map-pin-DyIkpqP0.js} +1 -1
  52. package/dist/dist-cli-preview/chunks/media-vkLeBb90.js +4 -0
  53. package/dist/dist-cli-preview/chunks/member-permissions-ndhNmlOk.js +19 -0
  54. package/dist/dist-cli-preview/chunks/{mount-account-screen-5thBUz3X.js → mount-account-screen--gdc5WO_.js} +1869 -1884
  55. package/dist/dist-cli-preview/chunks/ms-DqRbmHx8.js +679 -0
  56. package/dist/dist-cli-preview/chunks/navigate-account-screen-AVNopuIP.js +38 -0
  57. package/dist/dist-cli-preview/chunks/nl-CkPNddxO.js +679 -0
  58. package/dist/dist-cli-preview/chunks/no-ftcy0RcQ.js +679 -0
  59. package/dist/dist-cli-preview/chunks/pl-wyJLqfip.js +679 -0
  60. package/dist/dist-cli-preview/chunks/{plus-CocoE5gC.js → plus-DZjrp536.js} +1 -1
  61. package/dist/dist-cli-preview/chunks/pt-7uHLacuI.js +679 -0
  62. package/dist/dist-cli-preview/chunks/ro-Dh12ghww.js +679 -0
  63. package/dist/dist-cli-preview/chunks/ru-DFM7xWFz.js +679 -0
  64. package/dist/dist-cli-preview/chunks/{schemas-D94nZk5x.js → schemas-BTblatUV.js} +1107 -1062
  65. package/dist/dist-cli-preview/chunks/screen-route-slug-utils-DozJp-uc.js +620 -0
  66. package/dist/dist-cli-preview/chunks/{sheet-haptics-context-iOjKcNDj.js → sheet-haptics-context-CYrEaGtf.js} +3 -3
  67. package/dist/dist-cli-preview/chunks/sidebar-9qopXeR1.js +598 -0
  68. package/dist/dist-cli-preview/chunks/sk-CsuNYa1k.js +679 -0
  69. package/dist/dist-cli-preview/chunks/sortable.esm-Dlen88Fc.js +3283 -0
  70. package/dist/dist-cli-preview/chunks/{store-api-context-B96Ip2FB.js → store-api-context-B9pW_xao.js} +1 -1
  71. package/dist/dist-cli-preview/chunks/sv-DVrPaJbh.js +679 -0
  72. package/dist/dist-cli-preview/chunks/th-BEkMpcVW.js +679 -0
  73. package/dist/dist-cli-preview/chunks/tl-CqwwplQC.js +679 -0
  74. package/dist/dist-cli-preview/chunks/tr-XEp4ekrM.js +679 -0
  75. package/dist/dist-cli-preview/chunks/{trash-2-wVweQZMw.js → trash-2-ClRyi9iY.js} +12 -12
  76. package/dist/dist-cli-preview/chunks/uk-DWdZFWBl.js +679 -0
  77. package/dist/dist-cli-preview/chunks/use-mobile-srOt50VV.js +254 -0
  78. package/dist/dist-cli-preview/chunks/{use-optional-store-lZUz976C.js → use-optional-store-BgrOjfZJ.js} +2 -2
  79. package/dist/dist-cli-preview/chunks/{use-store-DVmgsDXy.js → use-store-CUSQx1E-.js} +25 -36
  80. package/dist/dist-cli-preview/chunks/{useInfiniteQuery-Dtzov9uh.js → useInfiniteQuery-DGc8fotv.js} +1 -1
  81. package/dist/dist-cli-preview/chunks/user-Ca2sKJ-h.js +14 -0
  82. package/dist/dist-cli-preview/chunks/users-Dh7zTrKY.js +16 -0
  83. package/dist/dist-cli-preview/chunks/vi-H__PaPsC.js +679 -0
  84. package/dist/dist-cli-preview/chunks/zh_CN-B62j_w_1.js +679 -0
  85. package/dist/dist-cli-preview/chunks/zh_TW-CYUIGBvP.js +679 -0
  86. package/package.json +1 -1
  87. package/dist/dist-cli-preview/chunks/Combobox-cf11L_T-.js +0 -1455
  88. package/dist/dist-cli-preview/chunks/MySiteScreen-Dtw1rsF9.js +0 -4950
  89. package/dist/dist-cli-preview/chunks/OrdersScreen-DkltVCtr.js +0 -9
  90. package/dist/dist-cli-preview/chunks/sidebar-Ckzom4Xc.js +0 -848
  91. package/dist/dist-cli-preview/chunks/user-B81IrSgp.js +0 -31
  92. package/dist/dist-cli-preview/chunks/users-BXTjoCUz.js +0 -27
@@ -0,0 +1,1706 @@
1
+ import { c as xe, a8 as Ie, l as i, j as t, U as Be, K as g, L as Re, M as le, Y as oe, B as Oe, J as Ue, R as de, bC as Ke, E as $e, N as He, a9 as qe, z as Ve } from "./account-screen-runtime-CCBl8DXt.js";
2
+ import { C as B, h as ae, i as ge, a as W, j as Ge, k as Ye, l as We, m as Je, n as Qe, o as Ze, c as be, d as Y, f as ye, D as _e, e as ve, S as je, v as Ne, s as ke, K as Ce, P as Se, u as we, b as Le, G as Ee, p as Xe, q as et, r as tt, t as Pe, w as st, x as at, L as nt, M as rt } from "./sortable.esm-Dlen88Fc.js";
3
+ import { c as it, a as lt } from "./client.gen-B7RMYGYu.js";
4
+ import { B as ot, a as dt, b as ce, d as ct, c as ue, e as ut } from "./Breadcrumb-8-7shsB6.js";
5
+ import { a as mt, c as pt, b as ft, u as ht, S as E, I as me } from "./sheet-haptics-context-CYrEaGtf.js";
6
+ import { E as xt } from "./eye-qMoMW7-Z.js";
7
+ import { U as gt } from "./users-Dh7zTrKY.js";
8
+ import { C as bt } from "./copy-DHN1DxE_.js";
9
+ import { A as ne } from "./arrow-left-CTYaRdTX.js";
10
+ import { C as yt, o as w, n as _, s as c, d as ee, R as te, j as se, P as _t } from "./schemas-BTblatUV.js";
11
+ import { u as vt, T as re } from "./trash-2-ClRyi9iY.js";
12
+ import { u as De } from "./sidebar-9qopXeR1.js";
13
+ import { P as pe } from "./plus-DZjrp536.js";
14
+ import { U as jt } from "./user-Ca2sKJ-h.js";
15
+ /**
16
+ * @license lucide-react v0.575.0 - ISC
17
+ *
18
+ * This source code is licensed under the ISC license.
19
+ * See the LICENSE file in the root directory of this source tree.
20
+ */
21
+ const Nt = [
22
+ ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
23
+ ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
24
+ ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
25
+ ], kt = xe("link-2", Nt);
26
+ /**
27
+ * @license lucide-react v0.575.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */
32
+ const Ct = [
33
+ [
34
+ "path",
35
+ {
36
+ d: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",
37
+ key: "e79jfc"
38
+ }
39
+ ],
40
+ ["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
41
+ ["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
42
+ ["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
43
+ ["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
44
+ ], Me = xe("palette", Ct);
45
+ function St(e) {
46
+ return e instanceof DOMException && e.name === "AbortError" || e instanceof Error && e.name === "AbortError";
47
+ }
48
+ function wt(e) {
49
+ const s = it({
50
+ baseUrl: e.baseUrl,
51
+ credentials: "include",
52
+ fetch: e.fetch,
53
+ headers: {
54
+ Accept: "application/json",
55
+ "Content-Type": "application/json",
56
+ ...e.defaultHeaders
57
+ },
58
+ throwOnError: !0
59
+ });
60
+ return s.interceptors.request.use((n) => {
61
+ const a = e.getDefaultHeaders?.();
62
+ if (!a)
63
+ return n;
64
+ const l = new Headers(n.headers);
65
+ for (const [r, o] of Object.entries(a))
66
+ l.set(r, o);
67
+ return new Request(n, { headers: l });
68
+ }), s.interceptors.error.use(
69
+ lt({
70
+ onResponseError: (n) => {
71
+ n.status === 401 && e.onAuthError?.();
72
+ },
73
+ shouldPassThroughTransportError: St
74
+ })
75
+ ), s;
76
+ }
77
+ const Lt = (e) => e.client.get({
78
+ responseStyle: "data",
79
+ url: "/api/mysite/profile",
80
+ ...e
81
+ }), fe = (e) => e.client.put({
82
+ responseStyle: "data",
83
+ url: "/api/mysite/profile",
84
+ ...e,
85
+ headers: {
86
+ "Content-Type": "application/json",
87
+ ...e.headers
88
+ }
89
+ }), Et = (e) => e.client.get({
90
+ responseStyle: "data",
91
+ url: "/api/mysite/themes",
92
+ ...e
93
+ }), Pt = (e) => e.client.put({
94
+ responseStyle: "data",
95
+ url: "/api/mysite/settings",
96
+ ...e,
97
+ headers: {
98
+ "Content-Type": "application/json",
99
+ ...e.headers
100
+ }
101
+ }), Dt = (e) => e.client.get({
102
+ responseStyle: "data",
103
+ url: "/api/mysite/links",
104
+ ...e
105
+ }), Mt = (e) => e.client.post({
106
+ responseStyle: "data",
107
+ url: "/api/mysite/links",
108
+ ...e,
109
+ headers: {
110
+ "Content-Type": "application/json",
111
+ ...e.headers
112
+ }
113
+ }), Ft = (e) => e.client.delete({
114
+ responseStyle: "data",
115
+ url: "/api/mysite/links/{id}",
116
+ ...e
117
+ }), zt = (e) => e.client.put({
118
+ responseStyle: "data",
119
+ url: "/api/mysite/links/{id}",
120
+ ...e,
121
+ headers: {
122
+ "Content-Type": "application/json",
123
+ ...e.headers
124
+ }
125
+ }), Tt = (e) => e.client.patch({
126
+ responseStyle: "data",
127
+ url: "/api/mysite/links/bulk",
128
+ ...e,
129
+ headers: {
130
+ "Content-Type": "application/json",
131
+ ...e.headers
132
+ }
133
+ }), At = (e) => e.client.get({
134
+ responseStyle: "data",
135
+ url: "/api/mysite/favorites",
136
+ ...e
137
+ }), It = (e) => e.client.post({
138
+ responseStyle: "data",
139
+ url: "/api/mysite/favorites",
140
+ ...e,
141
+ headers: {
142
+ "Content-Type": "application/json",
143
+ ...e.headers
144
+ }
145
+ }), Bt = (e) => e.client.delete({
146
+ responseStyle: "data",
147
+ url: "/api/mysite/favorites/{id}",
148
+ ...e
149
+ }), Rt = (e) => e.client.patch({
150
+ responseStyle: "data",
151
+ url: "/api/mysite/favorites/bulk",
152
+ ...e,
153
+ headers: {
154
+ "Content-Type": "application/json",
155
+ ...e.headers
156
+ }
157
+ });
158
+ function he(e) {
159
+ return {
160
+ id: e.id ?? 0,
161
+ mysite_url: e.mysite_url ?? null,
162
+ mysite_views: e.mysite_views ?? 0,
163
+ mysite_leads: e.mysite_leads ?? 0,
164
+ theme_id: e.theme_id ?? null,
165
+ bio: e.bio ?? null,
166
+ avatar_url: e.avatar_url ?? null,
167
+ display_name: e.display_name ?? null,
168
+ slug: e.slug ?? null
169
+ };
170
+ }
171
+ function V(e) {
172
+ return {
173
+ id: e.id ?? 0,
174
+ url: e.url ?? "",
175
+ title: e.title ?? "",
176
+ position: e.position ?? 0
177
+ };
178
+ }
179
+ function X(e) {
180
+ return {
181
+ id: e.id ?? 0,
182
+ favoriteable_id: e.favoriteable_id ?? e.product_id ?? 0,
183
+ favoriteable_type: e.favoriteable_type ?? "Product",
184
+ name: e.name ?? e.product_name ?? null,
185
+ image_url: e.image_url ?? e.product_image_url ?? null,
186
+ product_id: e.product_id ?? e.favoriteable_id ?? 0,
187
+ product_name: e.product_name ?? e.name ?? null,
188
+ product_image_url: e.product_image_url ?? e.image_url ?? null,
189
+ position: e.position ?? 0,
190
+ created_at: e.created_at ?? null
191
+ };
192
+ }
193
+ function Ot(e) {
194
+ return {
195
+ id: e.id ?? 0,
196
+ name: e.name ?? "",
197
+ preview_url: e.preview_url ?? null
198
+ };
199
+ }
200
+ function Ut(e) {
201
+ return {
202
+ fetchProfile: async () => {
203
+ const s = await Lt({ client: e });
204
+ return he(s.profile ?? {});
205
+ },
206
+ updateProfile: async (s) => {
207
+ const n = await fe({
208
+ client: e,
209
+ body: {
210
+ profile: {
211
+ display_name: s.display_name,
212
+ bio: s.bio,
213
+ avatar_url: s.avatar_url
214
+ }
215
+ }
216
+ });
217
+ return he(n.profile ?? {});
218
+ },
219
+ updateSettings: async (s) => {
220
+ await Promise.all([
221
+ s.theme_id !== void 0 ? Pt({
222
+ client: e,
223
+ body: { settings: { theme_id: s.theme_id } }
224
+ }) : Promise.resolve(),
225
+ s.slug !== void 0 ? fe({
226
+ client: e,
227
+ body: { profile: { slug: s.slug } }
228
+ }) : Promise.resolve()
229
+ ]);
230
+ },
231
+ listLinks: async () => ((await Dt({ client: e })).links ?? []).map(V),
232
+ createLink: async (s) => {
233
+ const n = await Mt({
234
+ client: e,
235
+ body: { link: { title: s.title, url: s.url } }
236
+ });
237
+ return V(n.link ?? {});
238
+ },
239
+ updateLink: async (s, n) => {
240
+ const a = await zt({
241
+ client: e,
242
+ path: { id: s },
243
+ body: { link: { title: n.title, url: n.url } }
244
+ });
245
+ return V(a.link ?? {});
246
+ },
247
+ deleteLink: async (s) => {
248
+ await Ft({ client: e, path: { id: s } });
249
+ },
250
+ reorderLinks: async (s) => ((await Tt({
251
+ client: e,
252
+ body: { ordered_ids: s }
253
+ })).links ?? []).map(V),
254
+ listFavorites: async () => ((await At({ client: e })).favorites ?? []).map(X),
255
+ addFavorite: async (s) => {
256
+ const n = await It({
257
+ client: e,
258
+ body: { favorite: { product_id: s.product_id } }
259
+ });
260
+ return X(n.favorite ?? {});
261
+ },
262
+ deleteFavorite: async (s) => {
263
+ await Bt({
264
+ client: e,
265
+ path: { id: s }
266
+ });
267
+ },
268
+ reorderFavorites: async (s) => ((await Rt({
269
+ client: e,
270
+ body: { ordered_ids: s }
271
+ })).favorites ?? []).map(X),
272
+ listThemes: async () => ((await Et({ client: e })).themes ?? []).map(Ot)
273
+ };
274
+ }
275
+ const Kt = {
276
+ heading: "MySite",
277
+ nav_profile: "Profile",
278
+ nav_theme: "Theme",
279
+ nav_content: "MySite Content",
280
+ nav_buttons: "Buttons",
281
+ visitor_details: "Visitor Details",
282
+ views: "Views",
283
+ leads: "Leads",
284
+ your_mysite_link: "Your MySite Link",
285
+ edit_link: "Edit Link",
286
+ not_configured: "Not configured",
287
+ slug_empty_error: "Slug cannot be empty",
288
+ link_updated: "MySite link updated",
289
+ link_update_failed: "Failed to update link",
290
+ link_copied: "Link copied to clipboard",
291
+ link_copy_failed: "Failed to copy link",
292
+ cancel: "Cancel",
293
+ save: "Save",
294
+ saving: "Saving...",
295
+ delete: "Delete",
296
+ deleting: "Deleting...",
297
+ remove: "Remove",
298
+ removing: "Removing...",
299
+ current_theme: "Current Theme",
300
+ preview: "Preview",
301
+ mysite_preview: "MySite Preview",
302
+ no_site_configured: "No site configured",
303
+ choose_a_theme: "Choose a Theme",
304
+ no_themes_available: "No themes available",
305
+ buttons_heading: "Buttons",
306
+ add_button: "Add Button",
307
+ no_buttons_empty: "No buttons yet. Add custom link buttons to display on your MySite.",
308
+ drag_to_reorder: "Drag to reorder",
309
+ edit_button_aria: "Edit button",
310
+ delete_button_aria: "Delete button",
311
+ edit_button_dialog: "Edit Button",
312
+ add_button_dialog: "Add Button",
313
+ button_text_label: "Button Text",
314
+ button_text_placeholder: "Enter button text...",
315
+ url_label: "URL",
316
+ url_placeholder: "https://example.com",
317
+ button_updated: "Button updated",
318
+ button_update_failed: "Failed to update button",
319
+ button_created: "Button created",
320
+ button_create_failed: "Failed to create button",
321
+ delete_button_dialog: "Delete Button",
322
+ delete_button_confirm: 'Are you sure you want to delete the button "{{name}}"? This action cannot be undone.',
323
+ button_deleted: "Button deleted",
324
+ button_delete_failed: "Failed to delete button",
325
+ reorder_buttons_failed: "Failed to reorder buttons",
326
+ content_heading: "MySite Content",
327
+ no_content_empty: "No featured content yet. Favorite products, media, or pages to display on your MySite.",
328
+ untitled: "Untitled",
329
+ no_image: "N/A",
330
+ remove_favorite_aria: "Remove favorite",
331
+ remove_content_dialog: "Remove Content",
332
+ remove_content_confirm: 'Are you sure you want to remove "{{name}}" from your MySite? This action cannot be undone.',
333
+ content_removed: "Content removed",
334
+ content_remove_failed: "Failed to remove content",
335
+ reorder_content_failed: "Failed to reorder content",
336
+ theme_changed: 'Theme changed to "{{name}}"',
337
+ theme_update_failed: "Failed to update theme",
338
+ type_media: "Media",
339
+ type_playlist: "Playlist",
340
+ type_enrollment_pack: "Enrollment Pack",
341
+ type_page: "Page",
342
+ validation_button_text_required: "Button text is required",
343
+ validation_url_invalid: "Must be a valid URL",
344
+ loading: "Loading...",
345
+ default_badge: "Default",
346
+ dashboard_breadcrumb: "Dashboard",
347
+ mysite_themes_title: "Mysite Themes",
348
+ themes_library_heading: "Mysite Theme Library",
349
+ no_mysite_themes_found: "No Mysite themes found",
350
+ reset_cache: "Reset Cache",
351
+ resetting: "Resetting...",
352
+ cache_reset_started: "Cache reset started successfully",
353
+ cache_reset_failed: "Failed to reset cache",
354
+ last_save: "Last save:",
355
+ customize: "Customize",
356
+ add_theme: "Add Theme",
357
+ rename_theme_aria: "Rename theme",
358
+ cancel_rename_aria: "Cancel rename",
359
+ theme_name_aria: "Theme name",
360
+ rename_failed: "Couldn't rename theme. Try again.",
361
+ name_validation_error: "Name {{error}}"
362
+ }, $t = pt({
363
+ fallback: Kt,
364
+ loaders: {
365
+ ar: () => import("./ar-D_B30x0o.js").then(
366
+ (e) => e.default
367
+ ),
368
+ bg: () => import("./bg-CIgMfa9k.js").then(
369
+ (e) => e.default
370
+ ),
371
+ bn: () => import("./bn-BgnBXWHo.js").then(
372
+ (e) => e.default
373
+ ),
374
+ cs: () => import("./cs-DmLSumGB.js").then(
375
+ (e) => e.default
376
+ ),
377
+ da: () => import("./da-EfkyseOR.js").then(
378
+ (e) => e.default
379
+ ),
380
+ de: () => import("./de-EARi-xk5.js").then(
381
+ (e) => e.default
382
+ ),
383
+ el: () => import("./el-BPz4rb5a.js").then(
384
+ (e) => e.default
385
+ ),
386
+ es: () => import("./es-CFZtv6aF.js").then(
387
+ (e) => e.default
388
+ ),
389
+ fi: () => import("./fi-Bn9_l4IH.js").then(
390
+ (e) => e.default
391
+ ),
392
+ fr: () => import("./fr-BSouGEGN.js").then(
393
+ (e) => e.default
394
+ ),
395
+ he: () => import("./he-BYEZTUry.js").then(
396
+ (e) => e.default
397
+ ),
398
+ hi: () => import("./hi-BLnEaAml.js").then(
399
+ (e) => e.default
400
+ ),
401
+ hr: () => import("./hr-B1T2UY_p.js").then(
402
+ (e) => e.default
403
+ ),
404
+ hu: () => import("./hu-cQw9hgLe.js").then(
405
+ (e) => e.default
406
+ ),
407
+ id: () => import("./id-Zd_5csjz.js").then(
408
+ (e) => e.default
409
+ ),
410
+ it: () => import("./it-CmxC_FIJ.js").then(
411
+ (e) => e.default
412
+ ),
413
+ ja: () => import("./ja-BcOunH2q.js").then(
414
+ (e) => e.default
415
+ ),
416
+ ko: () => import("./ko-CG_0ufw6.js").then(
417
+ (e) => e.default
418
+ ),
419
+ ms: () => import("./ms-DTN7PIDq.js").then(
420
+ (e) => e.default
421
+ ),
422
+ nl: () => import("./nl-x2lc8Ct5.js").then(
423
+ (e) => e.default
424
+ ),
425
+ no: () => import("./no-R8FScfrK.js").then(
426
+ (e) => e.default
427
+ ),
428
+ pl: () => import("./pl-Bl9G1yOR.js").then(
429
+ (e) => e.default
430
+ ),
431
+ pt: () => import("./pt-nD60RpwN.js").then(
432
+ (e) => e.default
433
+ ),
434
+ ro: () => import("./ro-D6ybG7vp.js").then(
435
+ (e) => e.default
436
+ ),
437
+ ru: () => import("./ru-C0oMeuhb.js").then(
438
+ (e) => e.default
439
+ ),
440
+ sk: () => import("./sk-Bpdt_mn0.js").then(
441
+ (e) => e.default
442
+ ),
443
+ sv: () => import("./sv-CEmTDhJy.js").then(
444
+ (e) => e.default
445
+ ),
446
+ th: () => import("./th-F8oLBw5n.js").then(
447
+ (e) => e.default
448
+ ),
449
+ tl: () => import("./tl-BXIS85ly.js").then(
450
+ (e) => e.default
451
+ ),
452
+ tr: () => import("./tr-YXIIDIEV.js").then(
453
+ (e) => e.default
454
+ ),
455
+ uk: () => import("./uk-CYYjeT-V.js").then(
456
+ (e) => e.default
457
+ ),
458
+ vi: () => import("./vi-DT4XS4HU.js").then(
459
+ (e) => e.default
460
+ ),
461
+ zh_CN: () => import("./zh_CN-BeGANQIJ.js").then(
462
+ (e) => e.default
463
+ ),
464
+ zh_TW: () => import("./zh_TW-D9gGVyEb.js").then(
465
+ (e) => e.default
466
+ )
467
+ }
468
+ });
469
+ function Ht(e, s) {
470
+ return mt(e, s);
471
+ }
472
+ const { Provider: qt, useTranslation: Vt } = ft("Mysite"), Gt = qt, P = Vt;
473
+ function Yt({
474
+ children: e
475
+ }) {
476
+ const { locale: s } = Ie(), n = ht($t, s), a = i.useMemo(
477
+ () => Ht(s, n),
478
+ [s, n]
479
+ );
480
+ return /* @__PURE__ */ t.jsx(Gt, { value: a, children: e });
481
+ }
482
+ const T = 300, G = 500;
483
+ function Wt(e) {
484
+ switch (e) {
485
+ case "idle":
486
+ return "opacity-100 transition-none";
487
+ case "fade-out":
488
+ return "opacity-0 transition-opacity duration-300 ease-in-out";
489
+ case "slide":
490
+ return "opacity-0 2xl:translate-x-[50%] transition-transform duration-500 ease-in-out";
491
+ case "fade-in":
492
+ return "opacity-100 2xl:translate-x-[50%] transition-opacity duration-300 ease-in-out";
493
+ case "editing":
494
+ return "opacity-100 2xl:translate-x-[50%] transition-none";
495
+ case "exit-fade-out":
496
+ return "opacity-0 2xl:translate-x-[50%] transition-opacity duration-300 ease-in-out";
497
+ case "exit-slide":
498
+ return "opacity-0 transition-transform duration-500 ease-in-out";
499
+ case "exit-fade-in":
500
+ return "opacity-100 transition-opacity duration-300 ease-in-out";
501
+ }
502
+ }
503
+ function Jt(e) {
504
+ switch (e) {
505
+ case "idle":
506
+ case "fade-out":
507
+ case "exit-fade-in":
508
+ return "transition-none";
509
+ case "slide":
510
+ return "2xl:-translate-x-[200%] transition-transform duration-500 ease-in-out";
511
+ case "fade-in":
512
+ case "editing":
513
+ case "exit-fade-out":
514
+ return "2xl:-translate-x-[200%] transition-none";
515
+ case "exit-slide":
516
+ return "transition-transform duration-500 ease-in-out";
517
+ }
518
+ }
519
+ function Qt({
520
+ views: e,
521
+ leads: s
522
+ }) {
523
+ const { t: n } = P();
524
+ return /* @__PURE__ */ t.jsxs(B, { className: "h-auto gap-0 py-0 shadow-none", children: [
525
+ /* @__PURE__ */ t.jsx(ae, { className: "p-4 pb-3", children: /* @__PURE__ */ t.jsx(ge, { className: "text-sm", children: n("visitor_details") }) }),
526
+ /* @__PURE__ */ t.jsxs(W, { className: "flex px-4 pb-4", children: [
527
+ /* @__PURE__ */ t.jsxs("div", { className: "flex-1", children: [
528
+ /* @__PURE__ */ t.jsxs("div", { className: "mb-2 flex items-center gap-1.5", children: [
529
+ /* @__PURE__ */ t.jsx(xt, { className: "text-muted-foreground size-3.5" }),
530
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground text-sm", children: n("views") })
531
+ ] }),
532
+ /* @__PURE__ */ t.jsx("p", { className: "text-foreground text-2xl font-bold", children: e.toLocaleString() })
533
+ ] }),
534
+ /* @__PURE__ */ t.jsx(Be, { orientation: "vertical", className: "bg-border mx-4 h-auto" }),
535
+ /* @__PURE__ */ t.jsxs("div", { className: "flex-1", children: [
536
+ /* @__PURE__ */ t.jsxs("div", { className: "mb-2 flex items-center gap-1.5", children: [
537
+ /* @__PURE__ */ t.jsx(gt, { className: "text-muted-foreground size-3.5" }),
538
+ /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground text-sm", children: n("leads") })
539
+ ] }),
540
+ /* @__PURE__ */ t.jsx("p", { className: "text-foreground text-2xl font-bold", children: s.toLocaleString() })
541
+ ] })
542
+ ] })
543
+ ] });
544
+ }
545
+ function Zt({
546
+ mysiteUrl: e,
547
+ displayUrl: s,
548
+ onUpdateSlug: n,
549
+ onToast: a
550
+ }) {
551
+ const { t: l } = P(), r = s.lastIndexOf("/"), o = r >= 0 ? s.slice(0, r + 1) : "", d = r >= 0 ? s.slice(r + 1) : s, [u, f] = i.useState(!1), [m, p] = i.useState(d), [y, j] = i.useState(!1), v = i.useCallback(() => {
552
+ p(d), f(!0);
553
+ }, [d]), N = i.useCallback(() => {
554
+ f(!1), p(d);
555
+ }, [d]), D = i.useCallback(async () => {
556
+ const h = m.trim();
557
+ if (!h) {
558
+ a?.(l("slug_empty_error"), "error");
559
+ return;
560
+ }
561
+ if (h === d) {
562
+ f(!1);
563
+ return;
564
+ }
565
+ if (n) {
566
+ j(!0);
567
+ try {
568
+ await n(h), a?.(l("link_updated"), "success"), f(!1);
569
+ } catch {
570
+ a?.(l("link_update_failed"), "error");
571
+ } finally {
572
+ j(!1);
573
+ }
574
+ }
575
+ }, [m, d, n, a, l]), C = i.useCallback(async () => {
576
+ if (e)
577
+ try {
578
+ await navigator.clipboard.writeText(e), a?.(l("link_copied"), "success");
579
+ } catch {
580
+ a?.(l("link_copy_failed"), "error");
581
+ }
582
+ }, [e, a, l]);
583
+ return /* @__PURE__ */ t.jsxs(B, { className: "h-auto gap-0 py-0 shadow-none", children: [
584
+ /* @__PURE__ */ t.jsxs(ae, { className: "items-center p-4", children: [
585
+ /* @__PURE__ */ t.jsx(ge, { className: "text-sm", children: l("your_mysite_link") }),
586
+ !u && n && /* @__PURE__ */ t.jsx(Ge, { children: /* @__PURE__ */ t.jsx(g, { variant: "link", size: "sm", onClick: v, children: l("edit_link") }) })
587
+ ] }),
588
+ /* @__PURE__ */ t.jsxs(W, { className: "px-4 pb-4", children: [
589
+ /* @__PURE__ */ t.jsxs("div", { className: "text-foreground flex items-center gap-2 rounded-lg border bg-gradient-to-r from-[rgba(72,187,120,0.2)] via-[rgba(236,72,153,0.15)] to-[rgba(251,146,60,0.15)] px-3 py-2.5", children: [
590
+ u ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
591
+ /* @__PURE__ */ t.jsx("span", { className: "shrink-0 text-sm", children: o }),
592
+ /* @__PURE__ */ t.jsx(
593
+ "input",
594
+ {
595
+ type: "text",
596
+ value: m,
597
+ onChange: (h) => p(h.target.value),
598
+ onKeyDown: (h) => {
599
+ h.key === "Enter" && !y && D(), h.key === "Escape" && N();
600
+ },
601
+ className: "border-input text-foreground focus:ring-primary bg-background/60 min-w-0 flex-1 rounded-md border px-2 py-1 text-sm font-medium outline-none focus:ring-1",
602
+ autoFocus: !0
603
+ }
604
+ )
605
+ ] }) : /* @__PURE__ */ t.jsx("span", { className: "min-w-0 flex-1 truncate text-sm", children: s || l("not_configured") }),
606
+ /* @__PURE__ */ t.jsx(
607
+ g,
608
+ {
609
+ variant: "ghost",
610
+ size: "icon",
611
+ onClick: C,
612
+ disabled: !e,
613
+ children: /* @__PURE__ */ t.jsx(bt, { className: "size-4" })
614
+ }
615
+ )
616
+ ] }),
617
+ /* @__PURE__ */ t.jsx(
618
+ "div",
619
+ {
620
+ className: "grid transition-all duration-300 ease-in-out",
621
+ style: {
622
+ gridTemplateRows: u ? "1fr" : "0fr",
623
+ opacity: u ? 1 : 0,
624
+ marginTop: u ? 12 : 0
625
+ },
626
+ children: /* @__PURE__ */ t.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ t.jsxs("div", { className: "flex justify-end gap-2", children: [
627
+ /* @__PURE__ */ t.jsx(
628
+ g,
629
+ {
630
+ variant: "secondary",
631
+ size: "sm",
632
+ onClick: N,
633
+ children: l("cancel")
634
+ }
635
+ ),
636
+ /* @__PURE__ */ t.jsx(g, { size: "sm", onClick: D, disabled: y, children: l(y ? "saving" : "save") })
637
+ ] }) })
638
+ }
639
+ )
640
+ ] })
641
+ ] });
642
+ }
643
+ function Xt({
644
+ mysiteUrl: e,
645
+ themeName: s,
646
+ previewKey: n,
647
+ isUpdating: a,
648
+ onPreview: l
649
+ }) {
650
+ const { t: r } = P(), o = i.useRef(null), d = `${e}?preview=true`, u = i.useRef(!0);
651
+ i.useEffect(() => {
652
+ u.current = !0;
653
+ }, [n]);
654
+ const f = () => {
655
+ if (u.current) {
656
+ u.current = !1;
657
+ return;
658
+ }
659
+ const m = o.current;
660
+ m && (u.current = !0, m.src = d);
661
+ };
662
+ return /* @__PURE__ */ t.jsxs(B, { className: "items-center gap-4 py-5", children: [
663
+ /* @__PURE__ */ t.jsxs(ae, { className: "w-full items-center px-5", children: [
664
+ /* @__PURE__ */ t.jsxs("div", { children: [
665
+ /* @__PURE__ */ t.jsx("p", { className: "text-muted-foreground text-xs", children: r("current_theme") }),
666
+ /* @__PURE__ */ t.jsx("p", { className: "text-foreground text-sm font-semibold", children: s })
667
+ ] }),
668
+ /* @__PURE__ */ t.jsx(
669
+ g,
670
+ {
671
+ className: "col-start-2 row-span-2 row-start-1 cursor-pointer self-center justify-self-end",
672
+ variant: "secondary",
673
+ size: "sm",
674
+ onClick: l,
675
+ disabled: !e,
676
+ children: r("preview")
677
+ }
678
+ )
679
+ ] }),
680
+ /* @__PURE__ */ t.jsxs(W, { className: "relative mx-auto my-auto w-[260px] px-0 sm:w-[320px]", children: [
681
+ /* @__PURE__ */ t.jsxs("div", { className: "overflow-hidden rounded-[32px] border-[6px] border-[#1e2939] bg-[#1e2939] shadow-xl sm:rounded-[40px] sm:border-[8px]", children: [
682
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between bg-[#101828] px-5 py-1 sm:px-6 sm:py-1.5", children: [
683
+ /* @__PURE__ */ t.jsx("span", { className: "text-[10px] font-medium text-[#ffffff] sm:text-[11px]", children: "9:41" }),
684
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
685
+ /* @__PURE__ */ t.jsx("div", { className: "h-2 w-2 rounded-full bg-[#ffffff60] sm:h-2.5 sm:w-2.5" }),
686
+ /* @__PURE__ */ t.jsx("div", { className: "h-2 w-3.5 rounded-sm bg-[#ffffff60] sm:h-2.5 sm:w-4" })
687
+ ] })
688
+ ] }),
689
+ /* @__PURE__ */ t.jsx(
690
+ "div",
691
+ {
692
+ className: "relative h-[490px] overflow-y-auto bg-[#ffffff] sm:h-[600px]",
693
+ style: { scrollbarWidth: "none" },
694
+ "aria-busy": a,
695
+ children: e ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
696
+ /* @__PURE__ */ t.jsx(
697
+ "iframe",
698
+ {
699
+ ref: o,
700
+ className: "h-full w-full origin-top-left bg-[#ffffff]",
701
+ src: d,
702
+ title: r("mysite_preview"),
703
+ tabIndex: -1,
704
+ sandbox: "allow-scripts allow-same-origin",
705
+ onLoad: f
706
+ },
707
+ n
708
+ ),
709
+ a && /* @__PURE__ */ t.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-white/60", children: /* @__PURE__ */ t.jsx(Re, { className: "text-muted-foreground size-6 animate-spin" }) })
710
+ ] }) : /* @__PURE__ */ t.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ t.jsx("p", { className: "text-muted-foreground text-sm", children: r("no_site_configured") }) })
711
+ }
712
+ )
713
+ ] }),
714
+ /* @__PURE__ */ t.jsx("div", { className: "absolute bottom-1.5 left-1/2 h-1 w-24 -translate-x-1/2 rounded-full bg-white sm:bottom-2 sm:w-28" })
715
+ ] })
716
+ ] });
717
+ }
718
+ const es = 137, ts = (e) => {
719
+ let s = 0;
720
+ for (const a of e)
721
+ s = s * 31 + (a.codePointAt(0) ?? 0) >>> 0;
722
+ return `color-mix(in oklab, hsl(${s * es % 360} 70% 50%) 28%, var(--color-muted))`;
723
+ };
724
+ function ss({
725
+ themes: e,
726
+ selectedThemeId: s,
727
+ onSelectTheme: n,
728
+ isPending: a,
729
+ onBack: l
730
+ }) {
731
+ const { t: r } = P();
732
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
733
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-3", children: [
734
+ /* @__PURE__ */ t.jsx(g, { variant: "ghost", size: "icon", onClick: l, children: /* @__PURE__ */ t.jsx(ne, { className: "size-4" }) }),
735
+ /* @__PURE__ */ t.jsx("h1", { className: "text-foreground text-xl font-bold", children: r("choose_a_theme") })
736
+ ] }),
737
+ e.length === 0 ? /* @__PURE__ */ t.jsx(B, { children: /* @__PURE__ */ t.jsx(W, { className: "py-8 text-center", children: /* @__PURE__ */ t.jsx("p", { className: "text-muted-foreground", children: r("no_themes_available") }) }) }) : /* @__PURE__ */ t.jsx("div", { className: "grid grid-cols-2 gap-4 sm:grid-cols-3", children: e.map((o) => {
738
+ const d = o.id === s, u = o.preview_url || o.image_url;
739
+ return /* @__PURE__ */ t.jsxs(
740
+ "button",
741
+ {
742
+ type: "button",
743
+ onClick: () => n(o),
744
+ className: le(
745
+ "group focus:ring-primary relative overflow-hidden rounded-lg border-2 transition-all focus:ring-2 focus:ring-offset-2 focus:outline-none",
746
+ d ? "border-primary ring-primary ring-2" : "border-border hover:border-muted-foreground/50"
747
+ ),
748
+ "aria-pressed": d,
749
+ disabled: a,
750
+ children: [
751
+ /* @__PURE__ */ t.jsxs("div", { className: "bg-muted relative aspect-[4/3] w-full", children: [
752
+ u ? /* @__PURE__ */ t.jsx(
753
+ "img",
754
+ {
755
+ src: u,
756
+ alt: o.name,
757
+ loading: "lazy",
758
+ className: "absolute inset-0 h-full w-full object-cover"
759
+ }
760
+ ) : /* @__PURE__ */ t.jsx(
761
+ "div",
762
+ {
763
+ className: "text-muted-foreground/50 flex h-full w-full items-center justify-center",
764
+ style: { backgroundColor: ts(o.name) },
765
+ children: /* @__PURE__ */ t.jsx(Me, { className: "size-8" })
766
+ }
767
+ ),
768
+ d && /* @__PURE__ */ t.jsx("div", { className: "bg-primary/20 absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ t.jsx("div", { className: "bg-primary text-primary-foreground flex size-8 items-center justify-center rounded-full", children: /* @__PURE__ */ t.jsx(yt, { className: "size-5" }) }) }),
769
+ !d && /* @__PURE__ */ t.jsx("div", { className: "group-hover:bg-foreground/10 absolute inset-0 transition-colors" })
770
+ ] }),
771
+ /* @__PURE__ */ t.jsx("div", { className: "bg-card p-2", children: /* @__PURE__ */ t.jsx(
772
+ "p",
773
+ {
774
+ className: le(
775
+ "truncate text-sm font-medium",
776
+ d ? "text-primary" : "text-foreground"
777
+ ),
778
+ children: o.name
779
+ }
780
+ ) })
781
+ ]
782
+ },
783
+ o.id
784
+ );
785
+ }) })
786
+ ] });
787
+ }
788
+ w({
789
+ id: _(),
790
+ url: c(),
791
+ text: c(),
792
+ order: _(),
793
+ clicks: _().optional().default(0)
794
+ });
795
+ const as = w({
796
+ id: _(),
797
+ title: c().nullable().optional(),
798
+ name: c().nullable().optional(),
799
+ image_url: c().nullable().optional(),
800
+ type: c().optional()
801
+ }).passthrough();
802
+ w({
803
+ id: _(),
804
+ favoriteable_id: _().optional(),
805
+ favoriteable_type: c(),
806
+ order: _(),
807
+ user_company_id: _().optional(),
808
+ created_at: c().optional(),
809
+ favoriteable: as.nullable()
810
+ }).passthrough();
811
+ w({
812
+ id: _()
813
+ }).passthrough();
814
+ w({
815
+ id: _(),
816
+ bio: c().nullable(),
817
+ facebook: c().nullable(),
818
+ twitter: c().nullable(),
819
+ instagram: c().nullable(),
820
+ youtube: c().nullable(),
821
+ pinterest: c().nullable(),
822
+ tiktok: c().nullable(),
823
+ linkedin: c().nullable(),
824
+ whatsapp: c().nullable(),
825
+ wechat: c().nullable(),
826
+ image_url: c().nullable()
827
+ });
828
+ w({
829
+ id: _(),
830
+ name: c(),
831
+ description: c().nullable(),
832
+ public: ee(),
833
+ company_id: _().nullable(),
834
+ created_at: c().datetime(),
835
+ updated_at: c().datetime(),
836
+ image_url: c().nullable(),
837
+ picker_image_url: c().nullish(),
838
+ application_theme_template_id: _().nullable(),
839
+ default: ee().nullable().optional()
840
+ });
841
+ const ns = w({
842
+ id: _(),
843
+ name: c(),
844
+ content: c().nullable(),
845
+ stylesheet: c().nullable(),
846
+ head: c().nullable(),
847
+ status: c()
848
+ });
849
+ w({
850
+ data: w({
851
+ legacy_theme: w({
852
+ id: _(),
853
+ name: c(),
854
+ description: c().nullable(),
855
+ image_url: c().nullable(),
856
+ public: ee(),
857
+ company_id: _().nullable(),
858
+ template: ns
859
+ })
860
+ })
861
+ });
862
+ function Fe(e) {
863
+ if (!e) return e;
864
+ try {
865
+ const s = new URL(e);
866
+ return s.searchParams.has("public_id") ? (s.searchParams.delete("public_id"), s.toString()) : e;
867
+ } catch {
868
+ return e;
869
+ }
870
+ }
871
+ function rs(e) {
872
+ const s = e.trim();
873
+ return s ? /^https?:\/\//i.test(s) ? s : `https://${s}` : "";
874
+ }
875
+ function is(e) {
876
+ return w({
877
+ title: c().min(1, e("validation_button_text_required")),
878
+ url: c().transform(rs).pipe(c().url(e("validation_url_invalid")))
879
+ });
880
+ }
881
+ function ls({
882
+ link: e,
883
+ onEdit: s,
884
+ onDelete: n
885
+ }) {
886
+ const { t: a } = P(), {
887
+ attributes: l,
888
+ listeners: r,
889
+ setNodeRef: o,
890
+ transform: d,
891
+ transition: u,
892
+ isDragging: f
893
+ } = we({ id: e.id }), m = {
894
+ transform: Le.Transform.toString(d),
895
+ transition: u
896
+ }, p = Fe(e.url), y = p.length > 40 ? `${p.substring(0, 40)}...` : p;
897
+ return /* @__PURE__ */ t.jsxs(
898
+ "div",
899
+ {
900
+ ref: o,
901
+ style: m,
902
+ className: `border-border bg-card flex items-center gap-3 rounded-lg border p-3 sm:p-4 ${f ? "opacity-50 shadow-lg" : ""}`,
903
+ children: [
904
+ /* @__PURE__ */ t.jsx(
905
+ "button",
906
+ {
907
+ type: "button",
908
+ className: "text-muted-foreground hover:text-foreground cursor-grab touch-none",
909
+ "aria-label": a("drag_to_reorder"),
910
+ ...l,
911
+ ...r,
912
+ children: /* @__PURE__ */ t.jsx(Ee, { className: "size-5" })
913
+ }
914
+ ),
915
+ /* @__PURE__ */ t.jsxs("div", { className: "min-w-0 flex-1", children: [
916
+ /* @__PURE__ */ t.jsx("p", { className: "text-foreground truncate font-medium", children: e.title }),
917
+ /* @__PURE__ */ t.jsx("p", { className: "text-muted-foreground truncate text-sm", children: y })
918
+ ] }),
919
+ /* @__PURE__ */ t.jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
920
+ /* @__PURE__ */ t.jsx(
921
+ g,
922
+ {
923
+ variant: "ghost",
924
+ size: "sm",
925
+ className: "text-muted-foreground hover:text-foreground",
926
+ onClick: () => s(e),
927
+ "aria-label": a("edit_button_aria"),
928
+ children: /* @__PURE__ */ t.jsx(_t, { className: "size-4" })
929
+ }
930
+ ),
931
+ /* @__PURE__ */ t.jsx(
932
+ g,
933
+ {
934
+ variant: "ghost",
935
+ size: "sm",
936
+ className: "text-muted-foreground hover:text-destructive",
937
+ onClick: () => n(e),
938
+ "aria-label": a("delete_button_aria"),
939
+ children: /* @__PURE__ */ t.jsx(re, { className: "size-4" })
940
+ }
941
+ )
942
+ ] })
943
+ ]
944
+ }
945
+ );
946
+ }
947
+ function os({
948
+ onBack: e,
949
+ onRefreshPreview: s,
950
+ onToast: n
951
+ }) {
952
+ "use no memo";
953
+ const { t: a } = P(), { isMobile: l } = De(), r = i.useMemo(() => is(a), [a]), { data: o = [], isLoading: d } = Ye(), u = We(), f = Je(), m = Qe(), p = Ze(), [y, j] = i.useState(!1), [v, N] = i.useState(null), [D, C] = i.useState(!1), [h, M] = i.useState(null), {
954
+ register: k,
955
+ handleSubmit: R,
956
+ reset: L,
957
+ formState: { errors: S, isSubmitting: I }
958
+ } = vt(r, {
959
+ defaultValues: { title: "", url: "" }
960
+ }), F = be(
961
+ Y(Se),
962
+ Y(Ce, {
963
+ coordinateGetter: ke
964
+ })
965
+ ), $ = i.useCallback(() => {
966
+ N(null), L({ title: "", url: "" }), j(!0);
967
+ }, [L]), H = i.useCallback(
968
+ (b) => {
969
+ N(b), L({
970
+ title: b.title,
971
+ url: Fe(b.url)
972
+ }), j(!0);
973
+ },
974
+ [L]
975
+ ), A = i.useCallback(() => {
976
+ j(!1), N(null), L({ title: "", url: "" });
977
+ }, [L]), J = i.useCallback(
978
+ (b) => {
979
+ v ? f.mutate(
980
+ {
981
+ linkId: v.id,
982
+ body: { title: b.title, url: b.url }
983
+ },
984
+ {
985
+ onSuccess: () => {
986
+ n?.(a("button_updated"), "success"), A(), s?.();
987
+ },
988
+ onError: () => {
989
+ n?.(a("button_update_failed"), "error");
990
+ }
991
+ }
992
+ ) : u.mutate(
993
+ { title: b.title, url: b.url },
994
+ {
995
+ onSuccess: () => {
996
+ n?.(a("button_created"), "success"), A(), s?.();
997
+ },
998
+ onError: () => {
999
+ n?.(a("button_create_failed"), "error");
1000
+ }
1001
+ }
1002
+ );
1003
+ },
1004
+ [
1005
+ v,
1006
+ u,
1007
+ f,
1008
+ A,
1009
+ s,
1010
+ n,
1011
+ a
1012
+ ]
1013
+ ), x = i.useCallback((b) => {
1014
+ M(b), C(!0);
1015
+ }, []), z = i.useCallback(() => {
1016
+ C(!1), M(null);
1017
+ }, []), O = i.useCallback(() => {
1018
+ h && m.mutate(h.id, {
1019
+ onSuccess: () => {
1020
+ n?.(a("button_deleted"), "success"), z(), s?.();
1021
+ },
1022
+ onError: () => {
1023
+ n?.(a("button_delete_failed"), "error");
1024
+ }
1025
+ });
1026
+ }, [
1027
+ h,
1028
+ m,
1029
+ z,
1030
+ s,
1031
+ n,
1032
+ a
1033
+ ]), Q = i.useCallback(
1034
+ (b) => {
1035
+ const { active: q, over: Z } = b;
1036
+ if (Z && q.id !== Z.id) {
1037
+ const ze = o.findIndex((U) => U.id === q.id), Te = o.findIndex((U) => U.id === Z.id), ie = ye(o, ze, Te), Ae = ie.map((U) => U.id);
1038
+ p.mutate(
1039
+ { orderedIds: Ae, optimisticItems: ie },
1040
+ {
1041
+ onSuccess: () => {
1042
+ s?.();
1043
+ },
1044
+ onError: () => {
1045
+ n?.(a("reorder_buttons_failed"), "error");
1046
+ }
1047
+ }
1048
+ );
1049
+ }
1050
+ },
1051
+ [o, p, s, n, a]
1052
+ );
1053
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1054
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between", children: [
1055
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-3", children: [
1056
+ /* @__PURE__ */ t.jsx(g, { variant: "ghost", size: "icon", onClick: e, children: /* @__PURE__ */ t.jsx(ne, { className: "size-4" }) }),
1057
+ /* @__PURE__ */ t.jsx("h1", { className: "text-foreground text-xl font-bold", children: a("buttons_heading") })
1058
+ ] }),
1059
+ /* @__PURE__ */ t.jsxs(g, { size: "sm", onClick: $, children: [
1060
+ /* @__PURE__ */ t.jsx(pe, { className: "mr-1 size-4" }),
1061
+ a("add_button")
1062
+ ] })
1063
+ ] }),
1064
+ d ? /* @__PURE__ */ t.jsx("div", { className: "space-y-2", children: Array.from({ length: 3 }).map((b, q) => /* @__PURE__ */ t.jsxs(
1065
+ "div",
1066
+ {
1067
+ className: "border-border bg-card flex items-center gap-3 rounded-lg border p-3 sm:p-4",
1068
+ children: [
1069
+ /* @__PURE__ */ t.jsx(E, { className: "size-5" }),
1070
+ /* @__PURE__ */ t.jsxs("div", { className: "min-w-0 flex-1 space-y-2", children: [
1071
+ /* @__PURE__ */ t.jsx(E, { className: "h-4 w-32" }),
1072
+ /* @__PURE__ */ t.jsx(E, { className: "h-3 w-48" })
1073
+ ] }),
1074
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-1", children: [
1075
+ /* @__PURE__ */ t.jsx(E, { className: "size-8" }),
1076
+ /* @__PURE__ */ t.jsx(E, { className: "size-8" })
1077
+ ] })
1078
+ ]
1079
+ },
1080
+ q
1081
+ )) }) : o.length === 0 ? /* @__PURE__ */ t.jsxs(B, { className: "p-6 text-center sm:p-8", children: [
1082
+ /* @__PURE__ */ t.jsx("p", { className: "text-muted-foreground mb-4", children: a("no_buttons_empty") }),
1083
+ /* @__PURE__ */ t.jsxs(g, { size: "sm", onClick: $, children: [
1084
+ /* @__PURE__ */ t.jsx(pe, { className: "mr-1 size-4" }),
1085
+ a("add_button")
1086
+ ] })
1087
+ ] }) : /* @__PURE__ */ t.jsx(
1088
+ _e,
1089
+ {
1090
+ sensors: F,
1091
+ collisionDetection: ve,
1092
+ onDragEnd: Q,
1093
+ children: /* @__PURE__ */ t.jsx(
1094
+ je,
1095
+ {
1096
+ items: o.map((b) => b.id),
1097
+ strategy: Ne,
1098
+ children: /* @__PURE__ */ t.jsx("div", { className: "space-y-2", children: o.map((b) => /* @__PURE__ */ t.jsx(
1099
+ ls,
1100
+ {
1101
+ link: b,
1102
+ onEdit: H,
1103
+ onDelete: x
1104
+ },
1105
+ b.id
1106
+ )) })
1107
+ }
1108
+ )
1109
+ }
1110
+ ),
1111
+ /* @__PURE__ */ t.jsx(
1112
+ te,
1113
+ {
1114
+ open: y,
1115
+ onOpenChange: j,
1116
+ title: a(v ? "edit_button_dialog" : "add_button_dialog"),
1117
+ presentation: l ? "bottom-sheet" : "dialog",
1118
+ children: /* @__PURE__ */ t.jsxs(
1119
+ "form",
1120
+ {
1121
+ onSubmit: R(J),
1122
+ className: "space-y-4",
1123
+ children: [
1124
+ /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
1125
+ /* @__PURE__ */ t.jsx(oe, { htmlFor: "title", children: a("button_text_label") }),
1126
+ /* @__PURE__ */ t.jsx(
1127
+ me,
1128
+ {
1129
+ id: "title",
1130
+ placeholder: a("button_text_placeholder"),
1131
+ ...k("title"),
1132
+ className: S.title ? "border-destructive" : ""
1133
+ }
1134
+ ),
1135
+ S.title && /* @__PURE__ */ t.jsx("p", { className: "text-destructive text-sm", children: S.title.message })
1136
+ ] }),
1137
+ /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
1138
+ /* @__PURE__ */ t.jsx(oe, { htmlFor: "url", children: a("url_label") }),
1139
+ /* @__PURE__ */ t.jsx(
1140
+ me,
1141
+ {
1142
+ id: "url",
1143
+ placeholder: a("url_placeholder"),
1144
+ ...k("url"),
1145
+ className: S.url ? "border-destructive" : ""
1146
+ }
1147
+ ),
1148
+ S.url && /* @__PURE__ */ t.jsx("p", { className: "text-destructive text-sm", children: S.url.message })
1149
+ ] }),
1150
+ /* @__PURE__ */ t.jsxs(se, { className: "flex justify-between", children: [
1151
+ v ? /* @__PURE__ */ t.jsxs(
1152
+ g,
1153
+ {
1154
+ type: "button",
1155
+ variant: "destructive",
1156
+ onClick: () => {
1157
+ A(), x(v);
1158
+ },
1159
+ children: [
1160
+ /* @__PURE__ */ t.jsx(re, { className: "mr-1 size-4" }),
1161
+ a("delete")
1162
+ ]
1163
+ }
1164
+ ) : /* @__PURE__ */ t.jsx("div", {}),
1165
+ /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2", children: [
1166
+ /* @__PURE__ */ t.jsx(
1167
+ g,
1168
+ {
1169
+ type: "button",
1170
+ variant: "outline",
1171
+ onClick: A,
1172
+ children: a("cancel")
1173
+ }
1174
+ ),
1175
+ /* @__PURE__ */ t.jsx(
1176
+ g,
1177
+ {
1178
+ type: "submit",
1179
+ disabled: I || u.isPending || f.isPending,
1180
+ children: I || u.isPending || f.isPending ? a("saving") : a("save")
1181
+ }
1182
+ )
1183
+ ] })
1184
+ ] })
1185
+ ]
1186
+ }
1187
+ )
1188
+ }
1189
+ ),
1190
+ /* @__PURE__ */ t.jsxs(
1191
+ te,
1192
+ {
1193
+ open: D,
1194
+ onOpenChange: C,
1195
+ title: a("delete_button_dialog"),
1196
+ presentation: l ? "bottom-sheet" : "dialog",
1197
+ size: "compact",
1198
+ children: [
1199
+ /* @__PURE__ */ t.jsx("p", { className: "text-muted-foreground", children: a("delete_button_confirm", {
1200
+ name: h?.title ?? ""
1201
+ }) }),
1202
+ /* @__PURE__ */ t.jsxs(se, { children: [
1203
+ /* @__PURE__ */ t.jsx(
1204
+ g,
1205
+ {
1206
+ type: "button",
1207
+ variant: "outline",
1208
+ onClick: z,
1209
+ children: a("cancel")
1210
+ }
1211
+ ),
1212
+ /* @__PURE__ */ t.jsx(
1213
+ g,
1214
+ {
1215
+ type: "button",
1216
+ variant: "destructive",
1217
+ onClick: O,
1218
+ disabled: m.isPending,
1219
+ children: m.isPending ? a("deleting") : a("delete")
1220
+ }
1221
+ )
1222
+ ] })
1223
+ ]
1224
+ }
1225
+ )
1226
+ ] });
1227
+ }
1228
+ const ds = {
1229
+ Medium: "type_media",
1230
+ Library: "type_playlist",
1231
+ EnrollmentPack: "type_enrollment_pack",
1232
+ Page: "type_page"
1233
+ };
1234
+ function cs({
1235
+ favorite: e,
1236
+ onDelete: s
1237
+ }) {
1238
+ const { t: n } = P(), {
1239
+ attributes: a,
1240
+ listeners: l,
1241
+ setNodeRef: r,
1242
+ transform: o,
1243
+ transition: d,
1244
+ isDragging: u
1245
+ } = we({ id: e.id }), f = {
1246
+ transform: Le.Transform.toString(o),
1247
+ transition: d
1248
+ }, m = e.name ?? n("untitled"), p = e.image_url, y = ds[e.favoriteable_type], j = e.favoriteable_type !== "Product" ? y ? n(y) : e.favoriteable_type : null;
1249
+ return /* @__PURE__ */ t.jsxs(
1250
+ "div",
1251
+ {
1252
+ ref: r,
1253
+ style: f,
1254
+ className: `border-border bg-card flex items-center gap-3 rounded-lg border p-3 sm:p-4 ${u ? "opacity-50 shadow-lg" : ""}`,
1255
+ children: [
1256
+ /* @__PURE__ */ t.jsx(
1257
+ "button",
1258
+ {
1259
+ type: "button",
1260
+ className: "text-muted-foreground hover:text-foreground cursor-grab touch-none",
1261
+ "aria-label": n("drag_to_reorder"),
1262
+ ...a,
1263
+ ...l,
1264
+ children: /* @__PURE__ */ t.jsx(Ee, { className: "size-5" })
1265
+ }
1266
+ ),
1267
+ /* @__PURE__ */ t.jsx("div", { className: "bg-muted size-10 shrink-0 overflow-hidden rounded-md", children: p ? /* @__PURE__ */ t.jsx(
1268
+ "img",
1269
+ {
1270
+ src: p,
1271
+ alt: m,
1272
+ loading: "lazy",
1273
+ width: 40,
1274
+ height: 40,
1275
+ className: "h-full w-full object-cover"
1276
+ }
1277
+ ) : /* @__PURE__ */ t.jsx("div", { className: "text-muted-foreground flex h-full w-full items-center justify-center text-xs", children: n("no_image") }) }),
1278
+ /* @__PURE__ */ t.jsxs("div", { className: "min-w-0 flex-1", children: [
1279
+ /* @__PURE__ */ t.jsx("p", { className: "text-foreground truncate font-medium", children: m }),
1280
+ j ? /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground text-xs", children: j }) : null
1281
+ ] }),
1282
+ /* @__PURE__ */ t.jsx("div", { className: "flex shrink-0 items-center gap-1", children: /* @__PURE__ */ t.jsx(
1283
+ g,
1284
+ {
1285
+ variant: "ghost",
1286
+ size: "sm",
1287
+ className: "text-muted-foreground hover:text-destructive",
1288
+ onClick: () => s(e),
1289
+ "aria-label": n("remove_favorite_aria"),
1290
+ children: /* @__PURE__ */ t.jsx(re, { className: "size-4" })
1291
+ }
1292
+ ) })
1293
+ ]
1294
+ }
1295
+ );
1296
+ }
1297
+ function us({
1298
+ onBack: e,
1299
+ onRefreshPreview: s,
1300
+ onToast: n
1301
+ }) {
1302
+ const { t: a } = P(), { isMobile: l } = De(), { data: r = [], isLoading: o } = Xe(), d = et(), u = tt(), [f, m] = i.useState(!1), [p, y] = i.useState(null), j = be(
1303
+ Y(Se),
1304
+ Y(Ce, {
1305
+ coordinateGetter: ke
1306
+ })
1307
+ ), v = i.useCallback(
1308
+ (h) => {
1309
+ y(h), m(!0);
1310
+ },
1311
+ []
1312
+ ), N = i.useCallback(() => {
1313
+ m(!1), y(null);
1314
+ }, []), D = i.useCallback(() => {
1315
+ p && d.mutate(p.id, {
1316
+ onSuccess: () => {
1317
+ n?.(a("content_removed"), "success"), N(), s?.();
1318
+ },
1319
+ onError: () => {
1320
+ n?.(a("content_remove_failed"), "error");
1321
+ }
1322
+ });
1323
+ }, [
1324
+ p,
1325
+ d,
1326
+ N,
1327
+ s,
1328
+ n,
1329
+ a
1330
+ ]), C = i.useCallback(
1331
+ (h) => {
1332
+ const { active: M, over: k } = h;
1333
+ if (k && M.id !== k.id) {
1334
+ const R = r.findIndex((F) => F.id === M.id), L = r.findIndex((F) => F.id === k.id), S = ye(r, R, L), I = S.map((F) => F.id);
1335
+ u.mutate(
1336
+ { orderedIds: I, optimisticItems: S },
1337
+ {
1338
+ onSuccess: () => {
1339
+ s?.();
1340
+ },
1341
+ onError: () => {
1342
+ n?.(a("reorder_content_failed"), "error");
1343
+ }
1344
+ }
1345
+ );
1346
+ }
1347
+ },
1348
+ [r, u, s, n, a]
1349
+ );
1350
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1351
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-3", children: [
1352
+ /* @__PURE__ */ t.jsx(g, { variant: "ghost", size: "icon", onClick: e, children: /* @__PURE__ */ t.jsx(ne, { className: "size-4" }) }),
1353
+ /* @__PURE__ */ t.jsx("h1", { className: "text-foreground text-xl font-bold", children: a("content_heading") })
1354
+ ] }),
1355
+ o ? /* @__PURE__ */ t.jsx("div", { className: "space-y-2", children: Array.from({ length: 3 }).map((h, M) => /* @__PURE__ */ t.jsxs(
1356
+ "div",
1357
+ {
1358
+ className: "border-border bg-card flex items-center gap-3 rounded-lg border p-3 sm:p-4",
1359
+ children: [
1360
+ /* @__PURE__ */ t.jsx(E, { className: "size-5" }),
1361
+ /* @__PURE__ */ t.jsx(E, { className: "size-10 rounded-md" }),
1362
+ /* @__PURE__ */ t.jsxs("div", { className: "min-w-0 flex-1 space-y-2", children: [
1363
+ /* @__PURE__ */ t.jsx(E, { className: "h-4 w-32" }),
1364
+ /* @__PURE__ */ t.jsx(E, { className: "h-3 w-20" })
1365
+ ] }),
1366
+ /* @__PURE__ */ t.jsx(E, { className: "size-8" })
1367
+ ]
1368
+ },
1369
+ M
1370
+ )) }) : r.length === 0 ? /* @__PURE__ */ t.jsx(B, { className: "p-6 text-center sm:p-8", children: /* @__PURE__ */ t.jsx("p", { className: "text-muted-foreground", children: a("no_content_empty") }) }) : /* @__PURE__ */ t.jsx(
1371
+ _e,
1372
+ {
1373
+ sensors: j,
1374
+ collisionDetection: ve,
1375
+ onDragEnd: C,
1376
+ children: /* @__PURE__ */ t.jsx(
1377
+ je,
1378
+ {
1379
+ items: r.map((h) => h.id),
1380
+ strategy: Ne,
1381
+ children: /* @__PURE__ */ t.jsx("div", { className: "space-y-2", children: r.map((h) => /* @__PURE__ */ t.jsx(
1382
+ cs,
1383
+ {
1384
+ favorite: h,
1385
+ onDelete: v
1386
+ },
1387
+ h.id
1388
+ )) })
1389
+ }
1390
+ )
1391
+ }
1392
+ ),
1393
+ /* @__PURE__ */ t.jsxs(
1394
+ te,
1395
+ {
1396
+ open: f,
1397
+ onOpenChange: m,
1398
+ title: a("remove_content_dialog"),
1399
+ presentation: l ? "bottom-sheet" : "dialog",
1400
+ size: "compact",
1401
+ children: [
1402
+ /* @__PURE__ */ t.jsx("p", { className: "text-muted-foreground", children: a("remove_content_confirm", {
1403
+ name: p?.name ?? a("untitled")
1404
+ }) }),
1405
+ /* @__PURE__ */ t.jsxs(se, { children: [
1406
+ /* @__PURE__ */ t.jsx(
1407
+ g,
1408
+ {
1409
+ type: "button",
1410
+ variant: "outline",
1411
+ onClick: N,
1412
+ children: a("cancel")
1413
+ }
1414
+ ),
1415
+ /* @__PURE__ */ t.jsx(
1416
+ g,
1417
+ {
1418
+ type: "button",
1419
+ variant: "destructive",
1420
+ onClick: D,
1421
+ disabled: d.isPending,
1422
+ children: d.isPending ? a("removing") : a("remove")
1423
+ }
1424
+ )
1425
+ ] })
1426
+ ]
1427
+ }
1428
+ )
1429
+ ] });
1430
+ }
1431
+ const ms = [
1432
+ { labelKey: "nav_profile", slug: "profile", icon: jt },
1433
+ { labelKey: "nav_theme", key: "theme", icon: Me },
1434
+ { labelKey: "nav_content", key: "content", icon: nt },
1435
+ { labelKey: "nav_buttons", key: "buttons", icon: kt }
1436
+ ];
1437
+ function K(e, s) {
1438
+ $e({ title: e, type: s });
1439
+ }
1440
+ function ps({
1441
+ editingSection: e,
1442
+ animPhase: s,
1443
+ showEditContent: n,
1444
+ onEditSection: a,
1445
+ onBackClick: l
1446
+ }) {
1447
+ const { t: r } = P(), { navigate: o } = Oe(), { data: d, isLoading: u } = Pe(), { data: f = [] } = st(), m = Ue(), p = at({
1448
+ // The theme saves through here too, and only a slug write moves the URL.
1449
+ onSuccess: (x) => x.slug === void 0 ? void 0 : Ke(m)
1450
+ }), [y, j] = i.useState(0), v = i.useCallback(() => j((x) => x + 1), []), [N, D] = i.useState(null), C = N ?? d?.theme_id ?? f.find((x) => x.name === "Default")?.id ?? f[0]?.id ?? null, M = f.find((x) => x.id === C)?.name ?? "Default", k = d?.mysite_url ?? "", R = k ? k.replace(/^https?:\/\//, "") : "", L = d?.mysite_views ?? 0, S = d?.mysite_leads ?? 0, I = i.useCallback(
1451
+ (x) => {
1452
+ if (x.id === C) return;
1453
+ const z = N;
1454
+ D(x.id), p.mutate(
1455
+ { theme_id: x.id },
1456
+ {
1457
+ onSuccess: () => {
1458
+ K(r("theme_changed", { name: x.name }), "success"), v();
1459
+ },
1460
+ onError: () => {
1461
+ D(z), K(r("theme_update_failed"), "error");
1462
+ }
1463
+ }
1464
+ );
1465
+ },
1466
+ [
1467
+ C,
1468
+ N,
1469
+ p,
1470
+ v,
1471
+ r
1472
+ ]
1473
+ ), F = i.useCallback(
1474
+ async (x) => {
1475
+ await new Promise((z, O) => {
1476
+ p.mutate(
1477
+ { slug: x },
1478
+ {
1479
+ onSuccess: () => z(),
1480
+ onError: () => O(new Error("Failed"))
1481
+ }
1482
+ );
1483
+ });
1484
+ },
1485
+ [p]
1486
+ ), $ = i.useCallback(() => {
1487
+ k && window.open(`${k}?preview=true`, "_blank");
1488
+ }, [k]), H = i.useMemo(() => e === "theme" ? r("nav_theme") : e === "buttons" ? r("nav_buttons") : e === "content" ? r("nav_content") : "", [e, r]);
1489
+ if (u)
1490
+ return /* @__PURE__ */ t.jsxs("div", { className: "flex h-full flex-col overflow-y-auto px-2 py-6 2xl:flex-row 2xl:overflow-hidden", children: [
1491
+ /* @__PURE__ */ t.jsx("div", { className: "w-full px-4 2xl:w-2/3 2xl:shrink-0", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-5", children: [
1492
+ /* @__PURE__ */ t.jsx("div", { className: "bg-muted h-7 w-32 animate-pulse rounded-md" }),
1493
+ /* @__PURE__ */ t.jsx("div", { className: "bg-muted h-20 w-full animate-pulse rounded-lg" }),
1494
+ /* @__PURE__ */ t.jsx("div", { className: "bg-muted h-16 w-full animate-pulse rounded-lg" }),
1495
+ /* @__PURE__ */ t.jsx("div", { className: "bg-muted h-40 w-full animate-pulse rounded-lg" })
1496
+ ] }) }),
1497
+ /* @__PURE__ */ t.jsx("div", { className: "w-full shrink-0 overflow-y-hidden px-4 pt-5 2xl:h-full 2xl:w-1/3 2xl:overflow-y-auto 2xl:pt-0", children: /* @__PURE__ */ t.jsxs("div", { className: "bg-muted flex h-full flex-col items-center gap-4 rounded-xl p-5", children: [
1498
+ /* @__PURE__ */ t.jsxs("div", { className: "flex w-full items-center justify-between", children: [
1499
+ /* @__PURE__ */ t.jsxs("div", { className: "space-y-1", children: [
1500
+ /* @__PURE__ */ t.jsx("div", { className: "bg-background/50 h-3 w-24 animate-pulse rounded" }),
1501
+ /* @__PURE__ */ t.jsx("div", { className: "bg-background/50 h-4 w-28 animate-pulse rounded" })
1502
+ ] }),
1503
+ /* @__PURE__ */ t.jsx("div", { className: "bg-background/50 h-8 w-20 animate-pulse rounded-md" })
1504
+ ] }),
1505
+ /* @__PURE__ */ t.jsx("div", { className: "bg-background/50 h-[490px] w-[260px] animate-pulse rounded-[36px] sm:h-[600px] sm:w-[320px]" })
1506
+ ] }) })
1507
+ ] });
1508
+ const A = Wt(s), J = Jt(s);
1509
+ return /* @__PURE__ */ t.jsxs("div", { className: "flex h-full flex-col overflow-y-auto px-2 py-6 2xl:flex-row 2xl:overflow-hidden", children: [
1510
+ /* @__PURE__ */ t.jsx(
1511
+ "div",
1512
+ {
1513
+ className: `w-full px-4 2xl:w-2/3 2xl:shrink-0 ${A}`,
1514
+ children: /* @__PURE__ */ t.jsx("div", { className: "flex min-w-0 flex-col gap-5 2xl:h-full 2xl:overflow-y-auto", children: n && e === "theme" ? /* @__PURE__ */ t.jsx(
1515
+ ss,
1516
+ {
1517
+ themes: f,
1518
+ selectedThemeId: C,
1519
+ onSelectTheme: I,
1520
+ isPending: p.isPending,
1521
+ onBack: l
1522
+ }
1523
+ ) : n && e === "buttons" ? /* @__PURE__ */ t.jsx(
1524
+ os,
1525
+ {
1526
+ onBack: l,
1527
+ onRefreshPreview: v,
1528
+ onToast: K
1529
+ }
1530
+ ) : n && e === "content" ? /* @__PURE__ */ t.jsx(
1531
+ us,
1532
+ {
1533
+ onBack: l,
1534
+ onRefreshPreview: v,
1535
+ onToast: K
1536
+ }
1537
+ ) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1538
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
1539
+ /* @__PURE__ */ t.jsx("h1", { className: "text-foreground text-xl font-bold", children: r("heading") }),
1540
+ s !== "idle" && H && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1541
+ /* @__PURE__ */ t.jsx(de, { className: "text-muted-foreground size-4" }),
1542
+ /* @__PURE__ */ t.jsx("span", { className: "text-foreground text-xl font-bold", children: H })
1543
+ ] })
1544
+ ] }),
1545
+ /* @__PURE__ */ t.jsx(Qt, { views: L, leads: S }),
1546
+ /* @__PURE__ */ t.jsx(
1547
+ Zt,
1548
+ {
1549
+ mysiteUrl: k,
1550
+ displayUrl: R,
1551
+ onUpdateSlug: F,
1552
+ onToast: K
1553
+ }
1554
+ ),
1555
+ /* @__PURE__ */ t.jsx("div", { className: "border-border bg-card divide-border divide-y overflow-hidden rounded-lg border", children: ms.map((x) => {
1556
+ const z = x.icon, O = "group hover:bg-muted flex w-full items-center gap-2.5 px-3 py-2.5 transition-colors text-left cursor-pointer", Q = "slug" in x ? () => o(x.slug) : () => a(x.key);
1557
+ return /* @__PURE__ */ t.jsxs(
1558
+ "button",
1559
+ {
1560
+ type: "button",
1561
+ onClick: Q,
1562
+ className: O,
1563
+ children: [
1564
+ /* @__PURE__ */ t.jsx("div", { className: "bg-muted text-foreground flex size-7 shrink-0 items-center justify-center rounded-full", children: /* @__PURE__ */ t.jsx(z, { className: "size-3.5" }) }),
1565
+ /* @__PURE__ */ t.jsx("span", { className: "text-foreground flex-1 text-sm font-medium", children: r(x.labelKey) }),
1566
+ /* @__PURE__ */ t.jsx(de, { className: "text-muted-foreground size-3 shrink-0 transition-transform group-hover:translate-x-0.5" })
1567
+ ]
1568
+ },
1569
+ x.labelKey
1570
+ );
1571
+ }) })
1572
+ ] }) })
1573
+ }
1574
+ ),
1575
+ /* @__PURE__ */ t.jsx(
1576
+ "div",
1577
+ {
1578
+ className: `w-full shrink-0 overflow-y-hidden px-4 pt-5 2xl:h-full 2xl:w-1/3 2xl:overflow-y-auto 2xl:pt-0 ${J}`,
1579
+ children: /* @__PURE__ */ t.jsx(
1580
+ Xt,
1581
+ {
1582
+ mysiteUrl: k,
1583
+ themeName: M,
1584
+ previewKey: y,
1585
+ isUpdating: p.isPending,
1586
+ onPreview: $
1587
+ }
1588
+ )
1589
+ }
1590
+ )
1591
+ ] });
1592
+ }
1593
+ function fs() {
1594
+ const [e, s] = i.useState("idle"), [n, a] = i.useState(null), l = i.useRef([]);
1595
+ i.useEffect(() => {
1596
+ const m = l;
1597
+ return () => m.current.forEach(clearTimeout);
1598
+ }, []);
1599
+ const r = i.useCallback(() => {
1600
+ l.current.forEach(clearTimeout), l.current = [];
1601
+ }, []), o = i.useCallback((m, p) => {
1602
+ const y = setTimeout(() => s(m), p);
1603
+ l.current.push(y);
1604
+ }, []), d = [
1605
+ "slide",
1606
+ "fade-in",
1607
+ "editing",
1608
+ "exit-fade-out",
1609
+ "exit-slide"
1610
+ ].includes(e), u = i.useCallback(
1611
+ (m) => {
1612
+ r(), a(m), s("fade-out"), o("slide", T), o("fade-in", T + G), o("editing", T + G + T);
1613
+ },
1614
+ [r, o]
1615
+ ), f = i.useCallback(() => {
1616
+ r(), s("exit-fade-out"), o("exit-slide", T), o("exit-fade-in", T + G);
1617
+ const m = setTimeout(
1618
+ () => {
1619
+ s("idle"), a(null);
1620
+ },
1621
+ T + G + T
1622
+ );
1623
+ l.current.push(m);
1624
+ }, [r, o]);
1625
+ return {
1626
+ editingSection: n,
1627
+ animPhase: e,
1628
+ showEditContent: d,
1629
+ handleEditSection: u,
1630
+ handleBackClick: f
1631
+ };
1632
+ }
1633
+ function hs({
1634
+ /* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */
1635
+ background: e,
1636
+ textColor: s,
1637
+ accentColor: n,
1638
+ padding: a,
1639
+ borderRadius: l,
1640
+ /* eslint-enable @typescript-eslint/no-unused-vars */
1641
+ ...r
1642
+ }) {
1643
+ return /* @__PURE__ */ t.jsx(Yt, { children: /* @__PURE__ */ t.jsx(xs, { ...r }) });
1644
+ }
1645
+ function xs(e) {
1646
+ const { t: s } = P(), {
1647
+ editingSection: n,
1648
+ animPhase: a,
1649
+ showEditContent: l,
1650
+ handleEditSection: r,
1651
+ handleBackClick: o
1652
+ } = fs(), d = i.useMemo(() => n === "theme" ? s("nav_theme") : n === "buttons" ? s("nav_buttons") : n === "content" ? s("nav_content") : null, [n, s]), u = i.useCallback(
1653
+ (f) => {
1654
+ f.preventDefault(), n !== null && o();
1655
+ },
1656
+ [n, o]
1657
+ );
1658
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1659
+ /* @__PURE__ */ t.jsx(He, { children: /* @__PURE__ */ t.jsx(ot, { children: /* @__PURE__ */ t.jsxs(dt, { className: "text-lg", children: [
1660
+ /* @__PURE__ */ t.jsx(ce, { children: d ? /* @__PURE__ */ t.jsx(ct, { href: "#", onClick: u, children: "MySite" }) : /* @__PURE__ */ t.jsx(ue, { className: "font-semibold", children: "MySite" }) }),
1661
+ d && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1662
+ /* @__PURE__ */ t.jsx(ut, {}),
1663
+ /* @__PURE__ */ t.jsx(ce, { children: /* @__PURE__ */ t.jsx(ue, { className: "font-semibold", children: d }) })
1664
+ ] })
1665
+ ] }) }) }),
1666
+ /* @__PURE__ */ t.jsx(
1667
+ "div",
1668
+ {
1669
+ ...e,
1670
+ className: `h-full min-h-0 flex-1 ${e.className ?? ""}`,
1671
+ children: /* @__PURE__ */ t.jsx(
1672
+ ps,
1673
+ {
1674
+ editingSection: n,
1675
+ animPhase: a,
1676
+ showEditContent: l,
1677
+ onEditSection: r,
1678
+ onBackClick: o
1679
+ }
1680
+ )
1681
+ }
1682
+ )
1683
+ ] });
1684
+ }
1685
+ function Ms() {
1686
+ const { config: e } = qe(), { fetch: s } = Ve(), { baseUrl: n, defaultHeaders: a, onAuthError: l } = e, r = i.useMemo(
1687
+ () => Ut(
1688
+ wt({
1689
+ baseUrl: n,
1690
+ fetch: s,
1691
+ defaultHeaders: a,
1692
+ onAuthError: l
1693
+ })
1694
+ ),
1695
+ [n, a, l, s]
1696
+ );
1697
+ return /* @__PURE__ */ t.jsx(rt, { value: r, children: /* @__PURE__ */ t.jsx(gs, {}) });
1698
+ }
1699
+ function gs() {
1700
+ const { error: e } = Pe();
1701
+ if (e) throw e;
1702
+ return /* @__PURE__ */ t.jsx(hs, {});
1703
+ }
1704
+ export {
1705
+ Ms as default
1706
+ };