@burdenoff/microfe-headshotmarketing 2026.1205.1 → 2026.1206.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/generated/global-types.d.ts +3589 -380
  2. package/dist/generated/wspace-operations.d.ts +101 -3
  3. package/dist/generated/wspace-operations.js.map +1 -1
  4. package/dist/generated/wspace-types.d.ts +61782 -2332
  5. package/dist/generated/wspace-types.js.map +1 -1
  6. package/dist/headshotmarketing/components/EntityTagPicker.js +29 -28
  7. package/dist/headshotmarketing/components/EntityTagPicker.js.map +1 -1
  8. package/dist/headshotmarketing/components/InfluencerModals.js +264 -263
  9. package/dist/headshotmarketing/components/InfluencerModals.js.map +1 -1
  10. package/dist/headshotmarketing/components/QueryStateBoundary.js +31 -22
  11. package/dist/headshotmarketing/components/QueryStateBoundary.js.map +1 -1
  12. package/dist/headshotmarketing/components/StatusBadge.js +1 -1
  13. package/dist/headshotmarketing/components/StatusBadge.js.map +1 -1
  14. package/dist/headshotmarketing/components/Toast.js +3 -3
  15. package/dist/headshotmarketing/components/Toast.js.map +1 -1
  16. package/dist/headshotmarketing/components/TrackedLinksPanel.js +97 -96
  17. package/dist/headshotmarketing/components/TrackedLinksPanel.js.map +1 -1
  18. package/dist/headshotmarketing/hooks/useAssetUpload.js +41 -40
  19. package/dist/headshotmarketing/hooks/useAssetUpload.js.map +1 -1
  20. package/dist/headshotmarketing/pages/HomePage.js +6 -6
  21. package/dist/headshotmarketing/pages/HomePage.js.map +1 -1
  22. package/dist/headshotmarketing/pages/ads/AdBudgetAiPanel.js +47 -46
  23. package/dist/headshotmarketing/pages/ads/AdBudgetAiPanel.js.map +1 -1
  24. package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js +66 -65
  25. package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js.map +1 -1
  26. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +273 -272
  27. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
  28. package/dist/headshotmarketing/pages/ads/AdCreativeTestsSection.js +3 -3
  29. package/dist/headshotmarketing/pages/ads/AdCreativeTestsSection.js.map +1 -1
  30. package/dist/headshotmarketing/pages/ads/AdCreativesPage.js +125 -124
  31. package/dist/headshotmarketing/pages/ads/AdCreativesPage.js.map +1 -1
  32. package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js +33 -32
  33. package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js.map +1 -1
  34. package/dist/headshotmarketing/pages/ads/AdPlatformSyncPanel.js +108 -107
  35. package/dist/headshotmarketing/pages/ads/AdPlatformSyncPanel.js.map +1 -1
  36. package/dist/headshotmarketing/pages/ads/AdReachEstimatePanel.js +65 -60
  37. package/dist/headshotmarketing/pages/ads/AdReachEstimatePanel.js.map +1 -1
  38. package/dist/headshotmarketing/pages/ads/AdsPage.js +4 -4
  39. package/dist/headshotmarketing/pages/ads/AdsPage.js.map +1 -1
  40. package/dist/headshotmarketing/pages/ads/AudiencesPage.js +287 -286
  41. package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
  42. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +59 -54
  43. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
  44. package/dist/headshotmarketing/pages/ads/CreateAudiencePage.js +96 -95
  45. package/dist/headshotmarketing/pages/ads/CreateAudiencePage.js.map +1 -1
  46. package/dist/headshotmarketing/pages/ai/AiDecisionCard.js +5 -5
  47. package/dist/headshotmarketing/pages/ai/AiDecisionCard.js.map +1 -1
  48. package/dist/headshotmarketing/pages/ai/AiOperationsPage.js +179 -178
  49. package/dist/headshotmarketing/pages/ai/AiOperationsPage.js.map +1 -1
  50. package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.js +156 -151
  51. package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.js.map +1 -1
  52. package/dist/headshotmarketing/pages/analytics/ReportsPage.js +222 -217
  53. package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
  54. package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.js +59 -58
  55. package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.js.map +1 -1
  56. package/dist/headshotmarketing/pages/analytics/analyticsWidgets.js +152 -151
  57. package/dist/headshotmarketing/pages/analytics/analyticsWidgets.js.map +1 -1
  58. package/dist/headshotmarketing/pages/automation/AutomationPage.js +34 -33
  59. package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
  60. package/dist/headshotmarketing/pages/automation/TriggersPage.js +6 -6
  61. package/dist/headshotmarketing/pages/automation/TriggersPage.js.map +1 -1
  62. package/dist/headshotmarketing/pages/automation/WorkflowActions.js +1 -1
  63. package/dist/headshotmarketing/pages/automation/WorkflowActions.js.map +1 -1
  64. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +235 -234
  65. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
  66. package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js +24 -23
  67. package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js.map +1 -1
  68. package/dist/headshotmarketing/pages/automation/WorkflowsPage.js +1 -1
  69. package/dist/headshotmarketing/pages/automation/WorkflowsPage.js.map +1 -1
  70. package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js +4 -4
  71. package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js.map +1 -1
  72. package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js +339 -338
  73. package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js.map +1 -1
  74. package/dist/headshotmarketing/pages/campaigns/CampaignAiPanel.js +95 -94
  75. package/dist/headshotmarketing/pages/campaigns/CampaignAiPanel.js.map +1 -1
  76. package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js +82 -81
  77. package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js.map +1 -1
  78. package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js +107 -106
  79. package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js.map +1 -1
  80. package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js +104 -103
  81. package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js.map +1 -1
  82. package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js +262 -261
  83. package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js.map +1 -1
  84. package/dist/headshotmarketing/pages/campaigns/CreateTemplateModal.js +68 -67
  85. package/dist/headshotmarketing/pages/campaigns/CreateTemplateModal.js.map +1 -1
  86. package/dist/headshotmarketing/pages/content/AIToolsPage.js +204 -203
  87. package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
  88. package/dist/headshotmarketing/pages/content/AssetLibraryPage.js +177 -176
  89. package/dist/headshotmarketing/pages/content/AssetLibraryPage.js.map +1 -1
  90. package/dist/headshotmarketing/pages/content/ContentCreationPage.js +373 -372
  91. package/dist/headshotmarketing/pages/content/ContentCreationPage.js.map +1 -1
  92. package/dist/headshotmarketing/pages/content/ContentDetailsPage.js +1 -1
  93. package/dist/headshotmarketing/pages/content/ContentDetailsPage.js.map +1 -1
  94. package/dist/headshotmarketing/pages/content/ContentLibraryCard.js +4 -4
  95. package/dist/headshotmarketing/pages/content/ContentLibraryCard.js.map +1 -1
  96. package/dist/headshotmarketing/pages/crm/ConvertLeadButton.js +51 -50
  97. package/dist/headshotmarketing/pages/crm/ConvertLeadButton.js.map +1 -1
  98. package/dist/headshotmarketing/pages/crm/CreateContactPage.js +100 -99
  99. package/dist/headshotmarketing/pages/crm/CreateContactPage.js.map +1 -1
  100. package/dist/headshotmarketing/pages/crm/CreateDealPage.js +134 -133
  101. package/dist/headshotmarketing/pages/crm/CreateDealPage.js.map +1 -1
  102. package/dist/headshotmarketing/pages/crm/CreatePipelineModal.js +66 -65
  103. package/dist/headshotmarketing/pages/crm/CreatePipelineModal.js.map +1 -1
  104. package/dist/headshotmarketing/pages/crm/CrmActions.js +229 -228
  105. package/dist/headshotmarketing/pages/crm/CrmActions.js.map +1 -1
  106. package/dist/headshotmarketing/pages/crm/DealNextActionPanel.js +62 -61
  107. package/dist/headshotmarketing/pages/crm/DealNextActionPanel.js.map +1 -1
  108. package/dist/headshotmarketing/pages/crm/LeadAiDecisionPanel.js +126 -125
  109. package/dist/headshotmarketing/pages/crm/LeadAiDecisionPanel.js.map +1 -1
  110. package/dist/headshotmarketing/pages/crm/LeadCreateModal.js +93 -92
  111. package/dist/headshotmarketing/pages/crm/LeadCreateModal.js.map +1 -1
  112. package/dist/headshotmarketing/pages/crm/PipelinePage.js +5 -5
  113. package/dist/headshotmarketing/pages/crm/PipelinePage.js.map +1 -1
  114. package/dist/headshotmarketing/pages/events/CreateEventPage.js +127 -126
  115. package/dist/headshotmarketing/pages/events/CreateEventPage.js.map +1 -1
  116. package/dist/headshotmarketing/pages/events/EventDetailsPage.js +76 -75
  117. package/dist/headshotmarketing/pages/events/EventDetailsPage.js.map +1 -1
  118. package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js +8 -8
  119. package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js.map +1 -1
  120. package/dist/headshotmarketing/pages/influencers/InfluencersPage.js +4 -4
  121. package/dist/headshotmarketing/pages/influencers/InfluencersPage.js.map +1 -1
  122. package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js +4 -4
  123. package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js.map +1 -1
  124. package/dist/headshotmarketing/pages/seo/SeoScorePanel.js +1 -1
  125. package/dist/headshotmarketing/pages/seo/SeoScorePanel.js.map +1 -1
  126. package/dist/headshotmarketing/pages/seo/SeoToolsPage.js +104 -103
  127. package/dist/headshotmarketing/pages/seo/SeoToolsPage.js.map +1 -1
  128. package/dist/headshotmarketing/pages/social-media/AccountsPage.js +102 -101
  129. package/dist/headshotmarketing/pages/social-media/AccountsPage.js.map +1 -1
  130. package/dist/headshotmarketing/pages/social-media/CreateAccountPage.js +59 -58
  131. package/dist/headshotmarketing/pages/social-media/CreateAccountPage.js.map +1 -1
  132. package/dist/headshotmarketing/pages/social-media/MediaDropZone.js +1 -1
  133. package/dist/headshotmarketing/pages/social-media/MediaDropZone.js.map +1 -1
  134. package/dist/headshotmarketing/pages/social-media/PostsPage.js +103 -102
  135. package/dist/headshotmarketing/pages/social-media/PostsPage.js.map +1 -1
  136. package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js +123 -122
  137. package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js.map +1 -1
  138. package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js +4 -4
  139. package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js.map +1 -1
  140. package/dist/headshotmarketing/utils/index.d.ts +1 -0
  141. package/dist/headshotmarketing/utils/readableError.d.ts +16 -0
  142. package/dist/headshotmarketing/utils/readableError.js +12 -0
  143. package/dist/headshotmarketing/utils/readableError.js.map +1 -0
  144. package/package.json +5 -3
@@ -8,25 +8,26 @@ import { StatCard as m } from "../../components/StatCard.js";
8
8
  import { EmptyState as h } from "../../components/EmptyState.js";
9
9
  import { StatusBadge as g } from "../../components/StatusBadge.js";
10
10
  import { FilterBar as ee } from "../../components/FilterBar.js";
11
- import { Modal as te } from "../../components/Modal.js";
11
+ import { Modal as _ } from "../../components/Modal.js";
12
+ import { useHeadshotMarketing as te } from "../../context/HeadshotMarketingContext.js";
12
13
  import { QueryStateBoundary as ne } from "../../components/QueryStateBoundary.js";
13
14
  import { Pagination as re } from "../../components/Pagination.js";
14
- import { useHeadshotMarketing as ie } from "../../context/HeadshotMarketingContext.js";
15
- import { useHeadshotmarketingBootstrap as ae } from "../../hooks/useHeadshotmarketingBootstrap.js";
16
- import { usePagination as oe } from "../../hooks/usePagination.js";
17
- import { platformLabel as _, renderPlatformIcon as v } from "./AdPlatformChips.js";
18
- import { useEffect as y, useMemo as b, useState as x } from "react";
19
- import { Copy as S, DollarSign as se, Eye as ce, Megaphone as le, MoreHorizontal as C, MousePointerClick as ue, Pause as de, Pencil as fe, Play as pe, Plus as me, Settings2 as w, Trash2 as he, TrendingUp as ge } from "lucide-react";
20
- import { useExclusiveMenu as T } from "@burdenoff/fe-libs/shared/hooks";
21
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
22
- import { PagePurpose as _e, ThemedSelect as k } from "@burdenoff/fe-libs/ui";
15
+ import { useHeadshotmarketingBootstrap as ie } from "../../hooks/useHeadshotmarketingBootstrap.js";
16
+ import { usePagination as ae } from "../../hooks/usePagination.js";
17
+ import { platformLabel as v, renderPlatformIcon as y } from "./AdPlatformChips.js";
18
+ import { readableError as b } from "../../utils/readableError.js";
19
+ import { useEffect as x, useMemo as S, useState as C } from "react";
20
+ import { Copy as w, DollarSign as oe, Eye as se, Megaphone as ce, MoreHorizontal as T, MousePointerClick as le, Pause as ue, Pencil as de, Play as fe, Plus as E, Settings2 as D, Trash2 as pe, TrendingUp as me } from "lucide-react";
21
+ import { useExclusiveMenu as O } from "@burdenoff/fe-libs/shared/hooks";
22
+ import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
23
+ import { PagePurpose as he, ThemedSelect as M } from "@burdenoff/fe-libs/ui";
23
24
  // src/headshotmarketing/pages/ads/AdCampaignsPage.tsx
24
- var ve = {
25
+ var ge = {
25
26
  active: i.Active,
26
27
  paused: i.Paused,
27
28
  completed: i.Completed,
28
29
  draft: i.Draft
29
- }, ye = {
30
+ }, _e = {
30
31
  google_ads: a.GoogleAds,
31
32
  facebook: a.FacebookAds,
32
33
  instagram: a.InstagramAds,
@@ -34,39 +35,39 @@ var ve = {
34
35
  twitter: a.TwitterAds,
35
36
  tiktok: a.TiktokAds
36
37
  };
37
- function A(e) {
38
+ function N(e) {
38
39
  if (!e) return "";
39
40
  let t = new Date(e);
40
41
  return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
41
42
  }
42
- var j = () => {
43
- let { navigate: a, basePath: o } = ie(), l = (e) => a(o + e), { data: g, refetch: _ } = ae(), [v, S] = x(""), [C, fe] = x(""), [w, he] = x("all"), [T, j] = x("all"), [M, N] = x(null), [P, F] = x(null), [I, L] = x(null), [R, z] = x(null), [B, V] = x(/* @__PURE__ */ new Set()), [H, U] = x(!1), W = oe({ initialPageSize: 10 }), { limit: xe, offset: Se, setPage: G, setTotal: Ce } = W;
44
- y(() => {
45
- let e = setTimeout(() => fe(v), 300);
43
+ var P = () => {
44
+ let { navigate: a, basePath: o } = te(), l = (e) => a(o + e), { data: g, refetch: v } = ie(), [y, w] = C(""), [T, de] = C(""), [D, pe] = C("all"), [O, P] = C("all"), [F, I] = C(null), [L, R] = C(null), [z, B] = C(null), [V, H] = C(null), [U, W] = C(/* @__PURE__ */ new Set()), [ye, G] = C(!1), K = ae({ initialPageSize: 10 }), { limit: be, offset: xe, setPage: Se, setTotal: Ce } = K;
45
+ x(() => {
46
+ let e = setTimeout(() => de(y), 300);
46
47
  return () => clearTimeout(e);
47
- }, [v]), y(() => {
48
- G(1);
48
+ }, [y]), x(() => {
49
+ Se(1);
49
50
  }, [
50
- C,
51
- w,
52
51
  T,
53
- G
52
+ D,
53
+ O,
54
+ Se
54
55
  ]);
55
- let { data: K, loading: we, error: Te, refetch: Ee } = n({
56
+ let { data: q, loading: we, error: Te, refetch: Ee } = n({
56
57
  variables: {
57
- limit: xe,
58
- offset: Se,
59
- search: C || null,
60
- status: ve[w] ?? null,
61
- platform: ye[T] ?? null
58
+ limit: be,
59
+ offset: xe,
60
+ search: T || null,
61
+ status: ge[D] ?? null,
62
+ platform: _e[O] ?? null
62
63
  },
63
64
  errorPolicy: "all",
64
65
  notifyOnNetworkStatusChange: !0
65
- }), q = K?.headshotmarketingAdCampaigns.total ?? 0;
66
- y(() => {
67
- Ce(q);
68
- }, [q, Ce]);
69
- let J = b(() => (K?.headshotmarketingAdCampaigns.items ?? []).map((e) => u(e)), [K?.headshotmarketingAdCampaigns.items]), Y = b(() => {
66
+ }), J = q?.headshotmarketingAdCampaigns.total ?? 0;
67
+ x(() => {
68
+ Ce(J);
69
+ }, [J, Ce]);
70
+ let Y = S(() => (q?.headshotmarketingAdCampaigns.items ?? []).map((e) => u(e)), [q?.headshotmarketingAdCampaigns.items]), X = S(() => {
70
71
  let e = g?.headshotmarketingAdMetrics, t = (g?.headshotmarketingAdCampaigns.items ?? []).map((e) => u(e)), n = t.filter((e) => e.metrics.roas > 0), r = n.length > 0 ? n.reduce((e, t) => e + t.metrics.roas, 0) / n.length : 0;
71
72
  return {
72
73
  active: e?.activeAdCampaigns ?? t.filter((e) => e.status === "active").length,
@@ -76,45 +77,45 @@ var j = () => {
76
77
  avgRoas: r
77
78
  };
78
79
  }, [g?.headshotmarketingAdCampaigns.items, g?.headshotmarketingAdMetrics]);
79
- y(() => {
80
- V((e) => {
81
- let t = new Set(J.map((e) => e.id)), n = new Set([...e].filter((e) => t.has(e)));
80
+ x(() => {
81
+ W((e) => {
82
+ let t = new Set(Y.map((e) => e.id)), n = new Set([...e].filter((e) => t.has(e)));
82
83
  return n.size === e.size ? e : n;
83
84
  });
84
- }, [J]);
85
- let De = J.length > 0 && J.every((e) => B.has(e.id)), Oe = (e) => {
86
- V((t) => {
85
+ }, [Y]);
86
+ let De = Y.length > 0 && Y.every((e) => U.has(e.id)), Oe = (e) => {
87
+ W((t) => {
87
88
  let n = new Set(t);
88
89
  return n.has(e) ? n.delete(e) : n.add(e), n;
89
90
  });
90
91
  }, ke = () => {
91
- V(De ? /* @__PURE__ */ new Set() : new Set(J.map((e) => e.id)));
92
- }, [Ae] = e(), [X, { loading: je }] = r(), [Me, { loading: Z }] = t(), Q = async () => {
93
- await Promise.all([Ee(), _()]);
94
- }, Ne = async (e) => {
95
- N(null), z(null);
92
+ W(De ? /* @__PURE__ */ new Set() : new Set(Y.map((e) => e.id)));
93
+ }, [Ae] = e(), [Z, { loading: je }] = r(), [Me, { loading: Ne }] = t(), Q = async () => {
94
+ await Promise.all([Ee(), v()]);
95
+ }, Pe = async (e) => {
96
+ I(null), H(null);
96
97
  try {
97
- await X({ variables: {
98
+ await Z({ variables: {
98
99
  id: e.id,
99
100
  input: { status: e.status === "active" ? i.Paused : i.Active }
100
101
  } }), await Q();
101
102
  } catch (e) {
102
- z(e instanceof Error ? e.message : "Failed to update campaign.");
103
+ H(b(e, "Failed to update campaign."));
103
104
  }
104
105
  }, $ = async (e) => {
105
- z(null), U(!0);
106
+ H(null), G(!0);
106
107
  try {
107
- await Promise.all([...B].map((t) => X({ variables: {
108
+ await Promise.all([...U].map((t) => Z({ variables: {
108
109
  id: t,
109
110
  input: { status: e }
110
- } }))), V(/* @__PURE__ */ new Set()), await Q();
111
+ } }))), W(/* @__PURE__ */ new Set()), await Q();
111
112
  } catch (e) {
112
- z(e instanceof Error ? e.message : "Failed to update campaigns.");
113
+ H(b(e, "Failed to update campaigns."));
113
114
  } finally {
114
- U(!1);
115
+ G(!1);
115
116
  }
116
- }, Pe = async (e) => {
117
- N(null), z(null);
117
+ }, Fe = async (e) => {
118
+ I(null), H(null);
118
119
  try {
119
120
  await Ae({ variables: { input: {
120
121
  name: `${e.name} (Copy)`,
@@ -127,218 +128,218 @@ var j = () => {
127
128
  audienceId: e.audiences[0] ?? null
128
129
  } } }), await Q();
129
130
  } catch (e) {
130
- z(e instanceof Error ? e.message : "Failed to duplicate campaign.");
131
+ H(b(e, "Failed to duplicate campaign."));
131
132
  }
132
- }, Fe = async () => {
133
- if (!P) return;
134
- if (!P.name.trim()) {
135
- z("Campaign name is required.");
133
+ }, Ie = async () => {
134
+ if (!L) return;
135
+ if (!L.name.trim()) {
136
+ H("Campaign name is required.");
136
137
  return;
137
138
  }
138
- z(null);
139
- let e = Number(P.totalBudget);
139
+ H(null);
140
+ let e = Number(L.totalBudget);
140
141
  try {
141
- await X({ variables: {
142
- id: P.id,
142
+ await Z({ variables: {
143
+ id: L.id,
143
144
  input: {
144
- name: P.name.trim(),
145
- status: d(P.status),
146
- bidStrategy: P.bidStrategy || null,
147
- totalBudget: P.totalBudget && Number.isFinite(e) ? e : null,
148
- startDate: P.startDate ? new Date(P.startDate).toISOString() : null,
149
- endDate: P.endDate ? new Date(P.endDate).toISOString() : null
145
+ name: L.name.trim(),
146
+ status: d(L.status),
147
+ bidStrategy: L.bidStrategy || null,
148
+ totalBudget: L.totalBudget && Number.isFinite(e) ? e : null,
149
+ startDate: L.startDate ? new Date(L.startDate).toISOString() : null,
150
+ endDate: L.endDate ? new Date(L.endDate).toISOString() : null
150
151
  }
151
- } }), F(null), await Q();
152
+ } }), R(null), await Q();
152
153
  } catch (e) {
153
- z(e instanceof Error ? e.message : "Failed to save campaign.");
154
+ H(b(e, "Failed to save campaign."));
154
155
  }
155
- }, Ie = async () => {
156
- if (I) {
157
- z(null);
156
+ }, Le = async () => {
157
+ if (z) {
158
+ H(null);
158
159
  try {
159
- await Me({ variables: { id: I.id } }), L(null), await Q();
160
+ await Me({ variables: { id: z.id } }), B(null), await Q();
160
161
  } catch (e) {
161
- z(e instanceof Error ? e.message : "Failed to delete campaign.");
162
+ H(b(e, "Failed to delete campaign."));
162
163
  }
163
164
  }
164
- }, Le = (e) => {
165
- N(null), z(null), F({
165
+ }, Re = (e) => {
166
+ I(null), H(null), R({
166
167
  id: e.id,
167
168
  name: e.name,
168
169
  status: e.status,
169
170
  totalBudget: e.budget.total > 0 ? String(e.budget.total) : "",
170
171
  bidStrategy: e.bidStrategy,
171
- startDate: A(e.startDate),
172
- endDate: A(e.endDate)
172
+ startDate: N(e.startDate),
173
+ endDate: N(e.endDate)
173
174
  });
174
175
  };
175
- return /* @__PURE__ */ O(p, {
176
+ return /* @__PURE__ */ j(p, {
176
177
  title: "Ad Campaigns",
177
178
  description: "Create and manage your advertising campaigns",
178
- actions: /* @__PURE__ */ O("button", {
179
+ actions: /* @__PURE__ */ j("button", {
179
180
  onClick: () => l("/ads/campaigns/new"),
180
181
  className: "inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90",
181
- children: [/* @__PURE__ */ D(me, { className: "h-4 w-4" }), "New Ad Campaign"]
182
+ children: [/* @__PURE__ */ A(E, { className: "h-4 w-4" }), "New Ad Campaign"]
182
183
  }),
183
184
  children: [
184
- /* @__PURE__ */ D(_e, { children: "A focused view of every ad campaign — filter by platform or status, watch budget pacing at a glance, and pause, edit or duplicate any campaign without leaving the list." }),
185
- /* @__PURE__ */ O("div", {
185
+ /* @__PURE__ */ A(he, { children: "A focused view of every ad campaign — filter by platform or status, watch budget pacing at a glance, and pause, edit or duplicate any campaign without leaving the list." }),
186
+ /* @__PURE__ */ j("div", {
186
187
  className: "grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-5",
187
188
  children: [
188
- /* @__PURE__ */ D(m, {
189
+ /* @__PURE__ */ A(m, {
189
190
  featured: !0,
190
191
  title: "Total Ad Spend",
191
- value: s(Y.totalSpend),
192
- icon: /* @__PURE__ */ D(se, { className: "h-4 w-4" })
192
+ value: s(X.totalSpend),
193
+ icon: /* @__PURE__ */ A(oe, { className: "h-4 w-4" })
193
194
  }),
194
- /* @__PURE__ */ D(m, {
195
+ /* @__PURE__ */ A(m, {
195
196
  title: "Active Ad Campaigns",
196
- value: c(Y.active),
197
- icon: /* @__PURE__ */ D(le, { className: "h-4 w-4" })
197
+ value: c(X.active),
198
+ icon: /* @__PURE__ */ A(ce, { className: "h-4 w-4" })
198
199
  }),
199
- /* @__PURE__ */ D(m, {
200
+ /* @__PURE__ */ A(m, {
200
201
  title: "Impressions",
201
- value: c(Y.totalImpressions),
202
- icon: /* @__PURE__ */ D(ce, { className: "h-4 w-4" })
202
+ value: c(X.totalImpressions),
203
+ icon: /* @__PURE__ */ A(se, { className: "h-4 w-4" })
203
204
  }),
204
- /* @__PURE__ */ D(m, {
205
+ /* @__PURE__ */ A(m, {
205
206
  title: "Clicks",
206
- value: c(Y.totalClicks),
207
- icon: /* @__PURE__ */ D(ue, { className: "h-4 w-4" })
207
+ value: c(X.totalClicks),
208
+ icon: /* @__PURE__ */ A(le, { className: "h-4 w-4" })
208
209
  }),
209
- /* @__PURE__ */ D(m, {
210
+ /* @__PURE__ */ A(m, {
210
211
  title: "Avg ROAS",
211
- value: `${Y.avgRoas.toFixed(1)}x`,
212
- icon: /* @__PURE__ */ D(ge, { className: "h-4 w-4" })
212
+ value: `${X.avgRoas.toFixed(1)}x`,
213
+ icon: /* @__PURE__ */ A(me, { className: "h-4 w-4" })
213
214
  })
214
215
  ]
215
216
  }),
216
- /* @__PURE__ */ D(ee, {
217
- searchValue: v,
218
- onSearchChange: S,
217
+ /* @__PURE__ */ A(ee, {
218
+ searchValue: y,
219
+ onSearchChange: w,
219
220
  searchPlaceholder: "Search campaigns...",
220
- filters: /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ O(k, {
221
+ filters: /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ j(M, {
221
222
  "aria-label": "Status",
222
- value: w,
223
- onChange: (e) => he(e.target.value),
223
+ value: D,
224
+ onChange: (e) => pe(e.target.value),
224
225
  className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
225
226
  children: [
226
- /* @__PURE__ */ D("option", {
227
+ /* @__PURE__ */ A("option", {
227
228
  value: "all",
228
229
  children: "All Status"
229
230
  }),
230
- /* @__PURE__ */ D("option", {
231
+ /* @__PURE__ */ A("option", {
231
232
  value: "active",
232
233
  children: "Active"
233
234
  }),
234
- /* @__PURE__ */ D("option", {
235
+ /* @__PURE__ */ A("option", {
235
236
  value: "paused",
236
237
  children: "Paused"
237
238
  }),
238
- /* @__PURE__ */ D("option", {
239
+ /* @__PURE__ */ A("option", {
239
240
  value: "completed",
240
241
  children: "Completed"
241
242
  }),
242
- /* @__PURE__ */ D("option", {
243
+ /* @__PURE__ */ A("option", {
243
244
  value: "draft",
244
245
  children: "Draft"
245
246
  })
246
247
  ]
247
- }), /* @__PURE__ */ O(k, {
248
+ }), /* @__PURE__ */ j(M, {
248
249
  "aria-label": "Platform",
249
- value: T,
250
- onChange: (e) => j(e.target.value),
250
+ value: O,
251
+ onChange: (e) => P(e.target.value),
251
252
  className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
252
253
  children: [
253
- /* @__PURE__ */ D("option", {
254
+ /* @__PURE__ */ A("option", {
254
255
  value: "all",
255
256
  children: "All Platforms"
256
257
  }),
257
- /* @__PURE__ */ D("option", {
258
+ /* @__PURE__ */ A("option", {
258
259
  value: "google_ads",
259
260
  children: "Google Ads"
260
261
  }),
261
- /* @__PURE__ */ D("option", {
262
+ /* @__PURE__ */ A("option", {
262
263
  value: "facebook",
263
264
  children: "Facebook"
264
265
  }),
265
- /* @__PURE__ */ D("option", {
266
+ /* @__PURE__ */ A("option", {
266
267
  value: "instagram",
267
268
  children: "Instagram"
268
269
  }),
269
- /* @__PURE__ */ D("option", {
270
+ /* @__PURE__ */ A("option", {
270
271
  value: "linkedin",
271
272
  children: "LinkedIn"
272
273
  }),
273
- /* @__PURE__ */ D("option", {
274
+ /* @__PURE__ */ A("option", {
274
275
  value: "twitter",
275
276
  children: "Twitter"
276
277
  }),
277
- /* @__PURE__ */ D("option", {
278
+ /* @__PURE__ */ A("option", {
278
279
  value: "tiktok",
279
280
  children: "TikTok"
280
281
  })
281
282
  ]
282
283
  })] })
283
284
  }),
284
- R && /* @__PURE__ */ D("div", {
285
+ V && /* @__PURE__ */ A("div", {
285
286
  role: "alert",
286
287
  className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
287
- children: R
288
+ children: V
288
289
  }),
289
- /* @__PURE__ */ D(ne, {
290
+ /* @__PURE__ */ A(ne, {
290
291
  loading: we,
291
292
  error: Te,
292
293
  onRetry: Ee,
293
- hasData: !!K,
294
- children: J.length === 0 ? /* @__PURE__ */ D(h, {
295
- illustration: q === 0 ? "empty-generic" : "empty-search",
296
- title: q === 0 ? "No ad campaigns yet" : "No campaigns match your filters",
297
- description: q === 0 ? "Create your first ad campaign to start running paid traffic." : "Try a different search term, platform or status.",
298
- action: q === 0 ? /* @__PURE__ */ O("button", {
294
+ hasData: !!q,
295
+ children: Y.length === 0 ? /* @__PURE__ */ A(h, {
296
+ illustration: J === 0 ? "empty-generic" : "empty-search",
297
+ title: J === 0 ? "No ad campaigns yet" : "No campaigns match your filters",
298
+ description: J === 0 ? "Create your first ad campaign to start running paid traffic." : "Try a different search term, platform or status.",
299
+ action: J === 0 ? /* @__PURE__ */ j("button", {
299
300
  onClick: () => l("/ads/campaigns/new"),
300
301
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
301
- children: [/* @__PURE__ */ D(me, { className: "h-4 w-4" }), "Create Campaign"]
302
+ children: [/* @__PURE__ */ A(E, { className: "h-4 w-4" }), "Create Campaign"]
302
303
  }) : void 0
303
- }) : /* @__PURE__ */ O(E, { children: [
304
- B.size > 0 && /* @__PURE__ */ O("div", {
304
+ }) : /* @__PURE__ */ j(k, { children: [
305
+ U.size > 0 && /* @__PURE__ */ j("div", {
305
306
  className: "flex flex-wrap items-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-4 py-2 text-sm",
306
307
  children: [
307
- /* @__PURE__ */ O("span", {
308
+ /* @__PURE__ */ j("span", {
308
309
  className: "font-medium text-text-primary",
309
- children: [B.size, " selected"]
310
+ children: [U.size, " selected"]
310
311
  }),
311
- /* @__PURE__ */ O("button", {
312
+ /* @__PURE__ */ j("button", {
312
313
  onClick: () => $(i.Paused),
313
- disabled: H,
314
+ disabled: ye,
314
315
  className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-text-primary hover:bg-bg-sunken disabled:opacity-60",
315
- children: [/* @__PURE__ */ D(de, { className: "h-3.5 w-3.5" }), "Pause"]
316
+ children: [/* @__PURE__ */ A(ue, { className: "h-3.5 w-3.5" }), "Pause"]
316
317
  }),
317
- /* @__PURE__ */ O("button", {
318
+ /* @__PURE__ */ j("button", {
318
319
  onClick: () => $(i.Active),
319
- disabled: H,
320
+ disabled: ye,
320
321
  className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-text-primary hover:bg-bg-sunken disabled:opacity-60",
321
- children: [/* @__PURE__ */ D(pe, { className: "h-3.5 w-3.5" }), "Activate"]
322
+ children: [/* @__PURE__ */ A(fe, { className: "h-3.5 w-3.5" }), "Activate"]
322
323
  }),
323
- /* @__PURE__ */ D("button", {
324
- onClick: () => V(/* @__PURE__ */ new Set()),
324
+ /* @__PURE__ */ A("button", {
325
+ onClick: () => W(/* @__PURE__ */ new Set()),
325
326
  className: "ms-auto text-text-secondary hover:text-text-primary",
326
327
  children: "Clear"
327
328
  })
328
329
  ]
329
330
  }),
330
- /* @__PURE__ */ D("div", {
331
+ /* @__PURE__ */ A("div", {
331
332
  className: "overflow-x-auto rounded-lg border border-border-seam bg-gloss-card shadow-pop",
332
- children: /* @__PURE__ */ O("table", {
333
+ children: /* @__PURE__ */ j("table", {
333
334
  className: "w-full min-w-[960px] text-sm",
334
335
  "aria-label": "Ad campaigns",
335
- children: [/* @__PURE__ */ D("thead", {
336
+ children: [/* @__PURE__ */ A("thead", {
336
337
  className: "border-b border-border-seam bg-bg-sunken/60 text-start text-xs font-medium text-text-secondary",
337
- children: /* @__PURE__ */ O("tr", { children: [
338
- /* @__PURE__ */ D("th", {
338
+ children: /* @__PURE__ */ j("tr", { children: [
339
+ /* @__PURE__ */ A("th", {
339
340
  scope: "col",
340
341
  className: "w-10 px-4 py-3",
341
- children: /* @__PURE__ */ D("input", {
342
+ children: /* @__PURE__ */ A("input", {
342
343
  type: "checkbox",
343
344
  "aria-label": "Select all campaigns on this page",
344
345
  checked: De,
@@ -346,230 +347,230 @@ var j = () => {
346
347
  className: "h-4 w-4 rounded border-border-subtle"
347
348
  })
348
349
  }),
349
- /* @__PURE__ */ D("th", {
350
+ /* @__PURE__ */ A("th", {
350
351
  scope: "col",
351
352
  className: "px-3 py-3",
352
353
  children: "Campaign"
353
354
  }),
354
- /* @__PURE__ */ D("th", {
355
+ /* @__PURE__ */ A("th", {
355
356
  scope: "col",
356
357
  className: "px-3 py-3",
357
358
  children: "Platform"
358
359
  }),
359
- /* @__PURE__ */ D("th", {
360
+ /* @__PURE__ */ A("th", {
360
361
  scope: "col",
361
362
  className: "px-3 py-3",
362
363
  children: "Status"
363
364
  }),
364
- /* @__PURE__ */ D("th", {
365
+ /* @__PURE__ */ A("th", {
365
366
  scope: "col",
366
367
  className: "px-3 py-3 text-end",
367
368
  children: "Daily Budget"
368
369
  }),
369
- /* @__PURE__ */ D("th", {
370
+ /* @__PURE__ */ A("th", {
370
371
  scope: "col",
371
372
  className: "px-3 py-3",
372
373
  children: "Spent"
373
374
  }),
374
- /* @__PURE__ */ D("th", {
375
+ /* @__PURE__ */ A("th", {
375
376
  scope: "col",
376
377
  className: "px-3 py-3 text-end",
377
378
  children: "Impressions"
378
379
  }),
379
- /* @__PURE__ */ D("th", {
380
+ /* @__PURE__ */ A("th", {
380
381
  scope: "col",
381
382
  className: "px-3 py-3 text-end",
382
383
  children: "Clicks"
383
384
  }),
384
- /* @__PURE__ */ D("th", {
385
+ /* @__PURE__ */ A("th", {
385
386
  scope: "col",
386
387
  className: "px-3 py-3 text-end",
387
388
  children: "CTR"
388
389
  }),
389
- /* @__PURE__ */ D("th", {
390
+ /* @__PURE__ */ A("th", {
390
391
  scope: "col",
391
392
  className: "px-3 py-3 text-end",
392
393
  children: "ROAS"
393
394
  }),
394
- /* @__PURE__ */ D("th", {
395
+ /* @__PURE__ */ A("th", {
395
396
  scope: "col",
396
397
  className: "w-12 px-3 py-3",
397
- children: /* @__PURE__ */ D("span", {
398
+ children: /* @__PURE__ */ A("span", {
398
399
  className: "sr-only",
399
400
  children: "Actions"
400
401
  })
401
402
  })
402
403
  ] })
403
- }), /* @__PURE__ */ D("tbody", { children: J.map((e) => /* @__PURE__ */ D(be, {
404
+ }), /* @__PURE__ */ A("tbody", { children: Y.map((e) => /* @__PURE__ */ A(ve, {
404
405
  campaign: e,
405
- selected: B.has(e.id),
406
+ selected: U.has(e.id),
406
407
  onToggleSelected: () => Oe(e.id),
407
- menuOpen: M === e.id,
408
- onToggleMenu: () => N(M === e.id ? null : e.id),
409
- onCloseMenu: () => N(null),
408
+ menuOpen: F === e.id,
409
+ onToggleMenu: () => I(F === e.id ? null : e.id),
410
+ onCloseMenu: () => I(null),
410
411
  onManage: () => l("/ads/campaigns/" + e.id),
411
- onEdit: () => Le(e),
412
- onToggleStatus: () => Ne(e),
413
- onDuplicate: () => Pe(e),
412
+ onEdit: () => Re(e),
413
+ onToggleStatus: () => Pe(e),
414
+ onDuplicate: () => Fe(e),
414
415
  onDelete: () => {
415
- N(null), L(e);
416
+ I(null), B(e);
416
417
  }
417
418
  }, e.id)) })]
418
419
  })
419
420
  }),
420
- /* @__PURE__ */ D(re, {
421
- page: W.page,
422
- pageSize: W.pageSize,
423
- total: W.total,
424
- onPageChange: W.setPage,
425
- onPageSizeChange: W.setPageSize,
421
+ /* @__PURE__ */ A(re, {
422
+ page: K.page,
423
+ pageSize: K.pageSize,
424
+ total: K.total,
425
+ onPageChange: K.setPage,
426
+ onPageSizeChange: K.setPageSize,
426
427
  disabled: we,
427
428
  hideWhenSinglePage: !0
428
429
  })
429
430
  ] })
430
431
  }),
431
- /* @__PURE__ */ D(te, {
432
- open: P !== null,
433
- onClose: () => F(null),
432
+ /* @__PURE__ */ A(_, {
433
+ open: L !== null,
434
+ onClose: () => R(null),
434
435
  title: "Edit Campaign",
435
436
  description: "Update campaign details",
436
437
  size: "lg",
437
- footer: /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("button", {
438
- onClick: () => F(null),
438
+ footer: /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("button", {
439
+ onClick: () => R(null),
439
440
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
440
441
  children: "Cancel"
441
- }), /* @__PURE__ */ D("button", {
442
- onClick: Fe,
442
+ }), /* @__PURE__ */ A("button", {
443
+ onClick: Ie,
443
444
  disabled: je,
444
445
  className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
445
446
  children: je ? "Saving..." : "Save Changes"
446
447
  })] }),
447
- children: P && /* @__PURE__ */ O("div", {
448
+ children: L && /* @__PURE__ */ j("div", {
448
449
  className: "space-y-4",
449
450
  children: [
450
- /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
451
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
451
452
  className: "mb-1.5 block text-sm font-medium text-text-primary",
452
453
  children: "Campaign Name"
453
- }), /* @__PURE__ */ D("input", {
454
+ }), /* @__PURE__ */ A("input", {
454
455
  type: "text",
455
- value: P.name,
456
- onChange: (e) => F({
457
- ...P,
456
+ value: L.name,
457
+ onChange: (e) => R({
458
+ ...L,
458
459
  name: e.target.value
459
460
  }),
460
461
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
461
462
  })] }),
462
- /* @__PURE__ */ O("div", {
463
+ /* @__PURE__ */ j("div", {
463
464
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
464
- children: [/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
465
+ children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
465
466
  className: "mb-1.5 block text-sm font-medium text-text-primary",
466
467
  children: "Status"
467
- }), /* @__PURE__ */ O(k, {
468
- value: P.status,
469
- onChange: (e) => F({
470
- ...P,
468
+ }), /* @__PURE__ */ j(M, {
469
+ value: L.status,
470
+ onChange: (e) => R({
471
+ ...L,
471
472
  status: e.target.value
472
473
  }),
473
474
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
474
475
  children: [
475
- /* @__PURE__ */ D("option", {
476
+ /* @__PURE__ */ A("option", {
476
477
  value: "draft",
477
478
  children: "Draft"
478
479
  }),
479
- /* @__PURE__ */ D("option", {
480
+ /* @__PURE__ */ A("option", {
480
481
  value: "active",
481
482
  children: "Active"
482
483
  }),
483
- /* @__PURE__ */ D("option", {
484
+ /* @__PURE__ */ A("option", {
484
485
  value: "paused",
485
486
  children: "Paused"
486
487
  }),
487
- /* @__PURE__ */ D("option", {
488
+ /* @__PURE__ */ A("option", {
488
489
  value: "completed",
489
490
  children: "Completed"
490
491
  })
491
492
  ]
492
- })] }), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
493
+ })] }), /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
493
494
  className: "mb-1.5 block text-sm font-medium text-text-primary",
494
495
  children: "Total Budget (USD)"
495
- }), /* @__PURE__ */ D("input", {
496
+ }), /* @__PURE__ */ A("input", {
496
497
  type: "number",
497
- value: P.totalBudget,
498
- onChange: (e) => F({
499
- ...P,
498
+ value: L.totalBudget,
499
+ onChange: (e) => R({
500
+ ...L,
500
501
  totalBudget: e.target.value
501
502
  }),
502
503
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
503
504
  })] })]
504
505
  }),
505
- /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
506
+ /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
506
507
  className: "mb-1.5 block text-sm font-medium text-text-primary",
507
508
  children: "Bid Strategy"
508
- }), /* @__PURE__ */ D("input", {
509
+ }), /* @__PURE__ */ A("input", {
509
510
  type: "text",
510
- value: P.bidStrategy,
511
- onChange: (e) => F({
512
- ...P,
511
+ value: L.bidStrategy,
512
+ onChange: (e) => R({
513
+ ...L,
513
514
  bidStrategy: e.target.value
514
515
  }),
515
516
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
516
517
  })] }),
517
- /* @__PURE__ */ O("div", {
518
+ /* @__PURE__ */ j("div", {
518
519
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
519
- children: [/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
520
+ children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
520
521
  className: "mb-1.5 block text-sm font-medium text-text-primary",
521
522
  children: "Start Date"
522
- }), /* @__PURE__ */ D("input", {
523
+ }), /* @__PURE__ */ A("input", {
523
524
  type: "date",
524
- value: P.startDate,
525
- onChange: (e) => F({
526
- ...P,
525
+ value: L.startDate,
526
+ onChange: (e) => R({
527
+ ...L,
527
528
  startDate: e.target.value
528
529
  }),
529
530
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
530
- })] }), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("label", {
531
+ })] }), /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
531
532
  className: "mb-1.5 block text-sm font-medium text-text-primary",
532
533
  children: "End Date"
533
- }), /* @__PURE__ */ D("input", {
534
+ }), /* @__PURE__ */ A("input", {
534
535
  type: "date",
535
- value: P.endDate,
536
- onChange: (e) => F({
537
- ...P,
536
+ value: L.endDate,
537
+ onChange: (e) => R({
538
+ ...L,
538
539
  endDate: e.target.value
539
540
  }),
540
541
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
541
542
  })] })]
542
543
  }),
543
- R && /* @__PURE__ */ D("p", {
544
+ V && /* @__PURE__ */ A("p", {
544
545
  className: "text-sm text-status-error-text",
545
- children: R
546
+ children: V
546
547
  })
547
548
  ]
548
549
  })
549
550
  }),
550
- /* @__PURE__ */ D(te, {
551
- open: I !== null,
552
- onClose: () => L(null),
551
+ /* @__PURE__ */ A(_, {
552
+ open: z !== null,
553
+ onClose: () => B(null),
553
554
  title: "Delete Campaign",
554
555
  size: "sm",
555
- footer: /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("button", {
556
- onClick: () => L(null),
556
+ footer: /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("button", {
557
+ onClick: () => B(null),
557
558
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
558
559
  children: "Cancel"
559
- }), /* @__PURE__ */ D("button", {
560
- onClick: Ie,
561
- disabled: Z,
560
+ }), /* @__PURE__ */ A("button", {
561
+ onClick: Le,
562
+ disabled: Ne,
562
563
  className: "rounded-md bg-status-error-text px-4 py-2 text-sm font-medium text-background hover:opacity-90 disabled:opacity-60",
563
- children: Z ? "Deleting..." : "Delete"
564
+ children: Ne ? "Deleting..." : "Delete"
564
565
  })] }),
565
- children: /* @__PURE__ */ O("p", {
566
+ children: /* @__PURE__ */ j("p", {
566
567
  className: "text-sm text-text-secondary",
567
568
  children: [
568
569
  "Are you sure you want to delete",
569
570
  " ",
570
- /* @__PURE__ */ D("span", {
571
+ /* @__PURE__ */ A("span", {
571
572
  className: "font-semibold text-text-primary",
572
- children: I?.name
573
+ children: z?.name
573
574
  }),
574
575
  "? This action cannot be undone."
575
576
  ]
@@ -577,15 +578,15 @@ var j = () => {
577
578
  })
578
579
  ]
579
580
  });
580
- }, be = ({ campaign: e, selected: t, onToggleSelected: n, menuOpen: r, onToggleMenu: i, onCloseMenu: a, onManage: u, onEdit: d, onToggleStatus: f, onDuplicate: p, onDelete: m }) => {
581
- T(`ad-campaign-${e.id}`, r, a);
581
+ }, ve = ({ campaign: e, selected: t, onToggleSelected: n, menuOpen: r, onToggleMenu: i, onCloseMenu: a, onManage: u, onEdit: d, onToggleStatus: f, onDuplicate: p, onDelete: m }) => {
582
+ O(`ad-campaign-${e.id}`, r, a);
582
583
  let h = e.budget.total > 0 ? e.budget.spent / e.budget.total * 100 : 0;
583
- return /* @__PURE__ */ O("tr", {
584
+ return /* @__PURE__ */ j("tr", {
584
585
  className: o("border-b border-border-subtle last:border-b-0 hover:bg-bg-sunken/40", t && "bg-bg-sunken/60"),
585
586
  children: [
586
- /* @__PURE__ */ D("td", {
587
+ /* @__PURE__ */ A("td", {
587
588
  className: "px-4 py-3",
588
- children: /* @__PURE__ */ D("input", {
589
+ children: /* @__PURE__ */ A("input", {
589
590
  type: "checkbox",
590
591
  "aria-label": `Select ${e.name}`,
591
592
  checked: t,
@@ -593,116 +594,116 @@ var j = () => {
593
594
  className: "h-4 w-4 rounded border-border-subtle"
594
595
  })
595
596
  }),
596
- /* @__PURE__ */ O("td", {
597
+ /* @__PURE__ */ j("td", {
597
598
  className: "px-3 py-3",
598
- children: [/* @__PURE__ */ D("button", {
599
+ children: [/* @__PURE__ */ A("button", {
599
600
  onClick: u,
600
601
  className: "block max-w-[260px] truncate rounded text-start font-medium text-text-primary hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
601
602
  children: e.name
602
- }), /* @__PURE__ */ O("div", {
603
+ }), /* @__PURE__ */ j("div", {
603
604
  className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
604
- children: [/* @__PURE__ */ D("span", { children: "Sync:" }), /* @__PURE__ */ D(g, {
605
+ children: [/* @__PURE__ */ A("span", { children: "Sync:" }), /* @__PURE__ */ A(g, {
605
606
  status: e.syncStatus,
606
607
  className: "px-1.5 py-0 text-[10px]"
607
608
  })]
608
609
  })]
609
610
  }),
610
- /* @__PURE__ */ D("td", {
611
+ /* @__PURE__ */ A("td", {
611
612
  className: "px-3 py-3",
612
- children: /* @__PURE__ */ O("span", {
613
+ children: /* @__PURE__ */ j("span", {
613
614
  className: "inline-flex items-center gap-2 whitespace-nowrap text-text-primary",
614
- children: [v(e.platform, "h-4 w-4 shrink-0"), _(e.platform)]
615
+ children: [y(e.platform, "h-4 w-4 shrink-0"), v(e.platform)]
615
616
  })
616
617
  }),
617
- /* @__PURE__ */ D("td", {
618
+ /* @__PURE__ */ A("td", {
618
619
  className: "px-3 py-3",
619
- children: /* @__PURE__ */ D(g, { status: e.status })
620
+ children: /* @__PURE__ */ A(g, { status: e.status })
620
621
  }),
621
- /* @__PURE__ */ D("td", {
622
+ /* @__PURE__ */ A("td", {
622
623
  className: "whitespace-nowrap px-3 py-3 text-end tabular-nums text-text-primary",
623
624
  children: e.dailyBudget > 0 ? s(e.dailyBudget) : "—"
624
625
  }),
625
- /* @__PURE__ */ D("td", {
626
+ /* @__PURE__ */ A("td", {
626
627
  className: "px-3 py-3",
627
- children: /* @__PURE__ */ O("div", {
628
+ children: /* @__PURE__ */ j("div", {
628
629
  className: "flex items-center gap-2",
629
- children: [/* @__PURE__ */ D("span", {
630
+ children: [/* @__PURE__ */ A("span", {
630
631
  className: "whitespace-nowrap tabular-nums text-text-primary",
631
632
  children: s(e.budget.spent)
632
- }), /* @__PURE__ */ D("div", {
633
+ }), /* @__PURE__ */ A("div", {
633
634
  className: "h-1.5 w-16 overflow-hidden rounded-full bg-bg-sunken",
634
635
  role: "progressbar",
635
636
  "aria-label": `Budget used for ${e.name}`,
636
637
  "aria-valuemin": 0,
637
638
  "aria-valuemax": 100,
638
639
  "aria-valuenow": Math.round(Math.min(h, 100)),
639
- children: /* @__PURE__ */ D("div", {
640
+ children: /* @__PURE__ */ A("div", {
640
641
  className: o("h-full rounded-full", h > 90 ? "bg-status-error-text" : h > 70 ? "bg-status-warning-text" : "bg-status-success-text"),
641
642
  style: { width: `${Math.min(h, 100)}%` }
642
643
  })
643
644
  })]
644
645
  })
645
646
  }),
646
- /* @__PURE__ */ D("td", {
647
+ /* @__PURE__ */ A("td", {
647
648
  className: "px-3 py-3 text-end tabular-nums text-text-primary",
648
649
  children: c(e.metrics.impressions)
649
650
  }),
650
- /* @__PURE__ */ D("td", {
651
+ /* @__PURE__ */ A("td", {
651
652
  className: "px-3 py-3 text-end tabular-nums text-text-primary",
652
653
  children: c(e.metrics.clicks)
653
654
  }),
654
- /* @__PURE__ */ D("td", {
655
+ /* @__PURE__ */ A("td", {
655
656
  className: "px-3 py-3 text-end tabular-nums text-text-primary",
656
657
  children: l(e.metrics.ctr, 2)
657
658
  }),
658
- /* @__PURE__ */ O("td", {
659
+ /* @__PURE__ */ j("td", {
659
660
  className: "px-3 py-3 text-end tabular-nums text-text-primary",
660
661
  children: [e.metrics.roas.toFixed(1), "x"]
661
662
  }),
662
- /* @__PURE__ */ D("td", {
663
+ /* @__PURE__ */ A("td", {
663
664
  className: "px-3 py-3",
664
- children: /* @__PURE__ */ O("div", {
665
+ children: /* @__PURE__ */ j("div", {
665
666
  className: "relative flex justify-end",
666
- children: [/* @__PURE__ */ D("button", {
667
+ children: [/* @__PURE__ */ A("button", {
667
668
  onClick: i,
668
669
  "aria-haspopup": "menu",
669
670
  "aria-expanded": r,
670
671
  "aria-label": `Actions for ${e.name}`,
671
672
  className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
672
- children: /* @__PURE__ */ D(C, { className: "h-4 w-4" })
673
- }), r && /* @__PURE__ */ O("div", {
673
+ children: /* @__PURE__ */ A(T, { className: "h-4 w-4" })
674
+ }), r && /* @__PURE__ */ j("div", {
674
675
  role: "menu",
675
676
  className: "absolute end-0 top-8 z-20 w-44 rounded-md border border-border-seam bg-gloss-card py-1 shadow-lg",
676
677
  children: [
677
- /* @__PURE__ */ O("button", {
678
+ /* @__PURE__ */ j("button", {
678
679
  role: "menuitem",
679
680
  onClick: u,
680
681
  className: "flex w-full items-center gap-2 px-4 py-2 text-start text-sm text-text-primary hover:bg-bg-sunken",
681
- children: [/* @__PURE__ */ D(w, { className: "h-3.5 w-3.5" }), "Manage"]
682
+ children: [/* @__PURE__ */ A(D, { className: "h-3.5 w-3.5" }), "Manage"]
682
683
  }),
683
- /* @__PURE__ */ O("button", {
684
+ /* @__PURE__ */ j("button", {
684
685
  role: "menuitem",
685
686
  onClick: d,
686
687
  className: "flex w-full items-center gap-2 px-4 py-2 text-start text-sm text-text-primary hover:bg-bg-sunken",
687
- children: [/* @__PURE__ */ D(fe, { className: "h-3.5 w-3.5" }), "Edit"]
688
+ children: [/* @__PURE__ */ A(de, { className: "h-3.5 w-3.5" }), "Edit"]
688
689
  }),
689
- /* @__PURE__ */ D("button", {
690
+ /* @__PURE__ */ A("button", {
690
691
  role: "menuitem",
691
692
  onClick: f,
692
693
  className: "flex w-full items-center gap-2 px-4 py-2 text-start text-sm text-text-primary hover:bg-bg-sunken",
693
- children: e.status === "active" ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(de, { className: "h-3.5 w-3.5" }), "Pause"] }) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(pe, { className: "h-3.5 w-3.5" }), "Resume"] })
694
+ children: e.status === "active" ? /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(ue, { className: "h-3.5 w-3.5" }), "Pause"] }) : /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(fe, { className: "h-3.5 w-3.5" }), "Resume"] })
694
695
  }),
695
- /* @__PURE__ */ O("button", {
696
+ /* @__PURE__ */ j("button", {
696
697
  role: "menuitem",
697
698
  onClick: p,
698
699
  className: "flex w-full items-center gap-2 px-4 py-2 text-start text-sm text-text-primary hover:bg-bg-sunken",
699
- children: [/* @__PURE__ */ D(S, { className: "h-3.5 w-3.5" }), "Duplicate"]
700
+ children: [/* @__PURE__ */ A(w, { className: "h-3.5 w-3.5" }), "Duplicate"]
700
701
  }),
701
- /* @__PURE__ */ O("button", {
702
+ /* @__PURE__ */ j("button", {
702
703
  role: "menuitem",
703
704
  onClick: m,
704
705
  className: "flex w-full items-center gap-2 px-4 py-2 text-start text-sm text-status-error-text hover:bg-bg-sunken",
705
- children: [/* @__PURE__ */ D(he, { className: "h-3.5 w-3.5" }), "Delete"]
706
+ children: [/* @__PURE__ */ A(pe, { className: "h-3.5 w-3.5" }), "Delete"]
706
707
  })
707
708
  ]
708
709
  })]
@@ -711,6 +712,6 @@ var j = () => {
711
712
  ]
712
713
  });
713
714
  };
714
- export { j as AdCampaignsPage };
715
+ export { P as AdCampaignsPage };
715
716
 
716
717
  //# sourceMappingURL=AdCampaignsPage.js.map