@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.
- package/dist/generated/global-types.d.ts +3589 -380
- package/dist/generated/wspace-operations.d.ts +101 -3
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +61782 -2332
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/components/EntityTagPicker.js +29 -28
- package/dist/headshotmarketing/components/EntityTagPicker.js.map +1 -1
- package/dist/headshotmarketing/components/InfluencerModals.js +264 -263
- package/dist/headshotmarketing/components/InfluencerModals.js.map +1 -1
- package/dist/headshotmarketing/components/QueryStateBoundary.js +31 -22
- package/dist/headshotmarketing/components/QueryStateBoundary.js.map +1 -1
- package/dist/headshotmarketing/components/StatusBadge.js +1 -1
- package/dist/headshotmarketing/components/StatusBadge.js.map +1 -1
- package/dist/headshotmarketing/components/Toast.js +3 -3
- package/dist/headshotmarketing/components/Toast.js.map +1 -1
- package/dist/headshotmarketing/components/TrackedLinksPanel.js +97 -96
- package/dist/headshotmarketing/components/TrackedLinksPanel.js.map +1 -1
- package/dist/headshotmarketing/hooks/useAssetUpload.js +41 -40
- package/dist/headshotmarketing/hooks/useAssetUpload.js.map +1 -1
- package/dist/headshotmarketing/pages/HomePage.js +6 -6
- package/dist/headshotmarketing/pages/HomePage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdBudgetAiPanel.js +47 -46
- package/dist/headshotmarketing/pages/ads/AdBudgetAiPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js +66 -65
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +273 -272
- package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativeTestsSection.js +3 -3
- package/dist/headshotmarketing/pages/ads/AdCreativeTestsSection.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js +125 -124
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js +33 -32
- package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdPlatformSyncPanel.js +108 -107
- package/dist/headshotmarketing/pages/ads/AdPlatformSyncPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdReachEstimatePanel.js +65 -60
- package/dist/headshotmarketing/pages/ads/AdReachEstimatePanel.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdsPage.js +4 -4
- package/dist/headshotmarketing/pages/ads/AdsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js +287 -286
- package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +59 -54
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/CreateAudiencePage.js +96 -95
- package/dist/headshotmarketing/pages/ads/CreateAudiencePage.js.map +1 -1
- package/dist/headshotmarketing/pages/ai/AiDecisionCard.js +5 -5
- package/dist/headshotmarketing/pages/ai/AiDecisionCard.js.map +1 -1
- package/dist/headshotmarketing/pages/ai/AiOperationsPage.js +179 -178
- package/dist/headshotmarketing/pages/ai/AiOperationsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.js +156 -151
- package/dist/headshotmarketing/pages/analytics/ReportScheduleDialog.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js +222 -217
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.js +59 -58
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/analyticsWidgets.js +152 -151
- package/dist/headshotmarketing/pages/analytics/analyticsWidgets.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/AutomationPage.js +34 -33
- package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/TriggersPage.js +6 -6
- package/dist/headshotmarketing/pages/automation/TriggersPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowActions.js +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowActions.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +235 -234
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js +24 -23
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js +4 -4
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js.map +1 -1
- package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js +339 -338
- package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignAiPanel.js +95 -94
- package/dist/headshotmarketing/pages/campaigns/CampaignAiPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js +82 -81
- package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js +107 -106
- package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js +104 -103
- package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js +262 -261
- package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/campaigns/CreateTemplateModal.js +68 -67
- package/dist/headshotmarketing/pages/campaigns/CreateTemplateModal.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AIToolsPage.js +204 -203
- package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js +177 -176
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js +373 -372
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentDetailsPage.js +1 -1
- package/dist/headshotmarketing/pages/content/ContentDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.js +4 -4
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/ConvertLeadButton.js +51 -50
- package/dist/headshotmarketing/pages/crm/ConvertLeadButton.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CreateContactPage.js +100 -99
- package/dist/headshotmarketing/pages/crm/CreateContactPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CreateDealPage.js +134 -133
- package/dist/headshotmarketing/pages/crm/CreateDealPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CreatePipelineModal.js +66 -65
- package/dist/headshotmarketing/pages/crm/CreatePipelineModal.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/CrmActions.js +229 -228
- package/dist/headshotmarketing/pages/crm/CrmActions.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/DealNextActionPanel.js +62 -61
- package/dist/headshotmarketing/pages/crm/DealNextActionPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadAiDecisionPanel.js +126 -125
- package/dist/headshotmarketing/pages/crm/LeadAiDecisionPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadCreateModal.js +93 -92
- package/dist/headshotmarketing/pages/crm/LeadCreateModal.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/PipelinePage.js +5 -5
- package/dist/headshotmarketing/pages/crm/PipelinePage.js.map +1 -1
- package/dist/headshotmarketing/pages/events/CreateEventPage.js +127 -126
- package/dist/headshotmarketing/pages/events/CreateEventPage.js.map +1 -1
- package/dist/headshotmarketing/pages/events/EventDetailsPage.js +76 -75
- package/dist/headshotmarketing/pages/events/EventDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js +8 -8
- package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.js +4 -4
- package/dist/headshotmarketing/pages/influencers/InfluencersPage.js.map +1 -1
- package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js +4 -4
- package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/seo/SeoScorePanel.js +1 -1
- package/dist/headshotmarketing/pages/seo/SeoScorePanel.js.map +1 -1
- package/dist/headshotmarketing/pages/seo/SeoToolsPage.js +104 -103
- package/dist/headshotmarketing/pages/seo/SeoToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/AccountsPage.js +102 -101
- package/dist/headshotmarketing/pages/social-media/AccountsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/CreateAccountPage.js +59 -58
- package/dist/headshotmarketing/pages/social-media/CreateAccountPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/MediaDropZone.js +1 -1
- package/dist/headshotmarketing/pages/social-media/MediaDropZone.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/PostsPage.js +103 -102
- package/dist/headshotmarketing/pages/social-media/PostsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js +123 -122
- package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js +4 -4
- package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js.map +1 -1
- package/dist/headshotmarketing/utils/index.d.ts +1 -0
- package/dist/headshotmarketing/utils/readableError.d.ts +16 -0
- package/dist/headshotmarketing/utils/readableError.js +12 -0
- package/dist/headshotmarketing/utils/readableError.js.map +1 -0
- package/package.json +5 -3
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { HeadshotmarketingCampaignByIdDocument as e, HeadshotmarketingCampaignsListDocument as t, useCreateHeadshotmarketingCampaignMutation as n, useHeadshotmarketingCampaignByIdQuery as r, useUpdateHeadshotmarketingCampaignMutation as i } from "../../../generated/wspace-operations.js";
|
|
2
2
|
import { cn as a } from "../../utils/helpers.js";
|
|
3
|
-
import { toCampaignModel as
|
|
3
|
+
import { toCampaignModel as o } from "../../utils/campaignMapper.js";
|
|
4
4
|
import "../../components/index.js";
|
|
5
|
-
import { UploadAudienceSelect as
|
|
6
|
-
import { PageLayout as
|
|
7
|
-
import { useHeadshotMarketing as
|
|
8
|
-
import { HeadshotmarketingCampaignStatus as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
5
|
+
import { UploadAudienceSelect as ee } from "../../components/UploadAudienceSelect.js";
|
|
6
|
+
import { PageLayout as s } from "../../components/PageLayout.js";
|
|
7
|
+
import { useHeadshotMarketing as te } from "../../context/HeadshotMarketingContext.js";
|
|
8
|
+
import { HeadshotmarketingCampaignStatus as c, HeadshotmarketingCampaignType as l } from "../../../generated/wspace-types.js";
|
|
9
|
+
import { readableError as u, readableErrorOrNull as d } from "../../utils/readableError.js";
|
|
10
|
+
import { useEffect as ne, useRef as f, useState as p } from "react";
|
|
11
|
+
import { ArrowLeft as m, FileText as h, Image as re, Rocket as ie, Save as ae, Upload as oe, Video as se, X as g } from "lucide-react";
|
|
12
|
+
import { useParams as _ } from "react-router";
|
|
13
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
|
+
import { EmphasisPanel as ce, PagePurpose as le, ThemedSelect as b } from "@burdenoff/fe-libs/ui";
|
|
14
15
|
import { fileUploadVisibility as ue, useSaveToFiles as de } from "@burdenoff/fe-libs/storage";
|
|
15
16
|
// src/headshotmarketing/pages/campaigns/CreateCampaignPage.tsx
|
|
16
17
|
var fe = /\.(jpe?g|png|gif|webp|svg|avif|bmp)$/i, pe = /\.(mp4|webm|mov|avi|mkv)$/i, me = /\.(pdf|docx?|xlsx?|pptx?|txt|csv|rtf|odt|ods)$/i, he = [
|
|
@@ -44,7 +45,7 @@ var fe = /\.(jpe?g|png|gif|webp|svg|avif|bmp)$/i, pe = /\.(mp4|webm|mov|avi|mkv)
|
|
|
44
45
|
"Revenue",
|
|
45
46
|
"Engagement Rate",
|
|
46
47
|
"Reach"
|
|
47
|
-
],
|
|
48
|
+
], ve = [
|
|
48
49
|
{
|
|
49
50
|
value: "email",
|
|
50
51
|
label: "Email"
|
|
@@ -73,20 +74,20 @@ var fe = /\.(jpe?g|png|gif|webp|svg|avif|bmp)$/i, pe = /\.(mp4|webm|mov|avi|mkv)
|
|
|
73
74
|
value: "content",
|
|
74
75
|
label: "Content"
|
|
75
76
|
}
|
|
76
|
-
],
|
|
77
|
+
], ye = [
|
|
77
78
|
"USD",
|
|
78
79
|
"EUR",
|
|
79
80
|
"GBP",
|
|
80
81
|
"CAD",
|
|
81
82
|
"AUD"
|
|
82
|
-
],
|
|
83
|
+
], be = [
|
|
83
84
|
"Urban Professionals",
|
|
84
85
|
"College Students",
|
|
85
86
|
"Parents",
|
|
86
87
|
"Retirees",
|
|
87
88
|
"Tech Enthusiasts",
|
|
88
89
|
"Small Business Owners"
|
|
89
|
-
],
|
|
90
|
+
], xe = [
|
|
90
91
|
{
|
|
91
92
|
key: "basics",
|
|
92
93
|
label: "Basics"
|
|
@@ -108,74 +109,74 @@ var fe = /\.(jpe?g|png|gif|webp|svg|avif|bmp)$/i, pe = /\.(mp4|webm|mov|avi|mkv)
|
|
|
108
109
|
label: "Tracking"
|
|
109
110
|
}
|
|
110
111
|
];
|
|
111
|
-
function
|
|
112
|
+
function x(e) {
|
|
112
113
|
return typeof e == "object" && e && !Array.isArray(e) ? e : {};
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
+
function S(e) {
|
|
115
116
|
return Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
+
function C(e, t) {
|
|
118
119
|
let n = Number(e);
|
|
119
120
|
return Number.isFinite(n) ? String(n) : t;
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
-
let n =
|
|
122
|
+
function w(e, t) {
|
|
123
|
+
let n = x(t.ageRange);
|
|
123
124
|
return {
|
|
124
125
|
name: e?.name ?? "",
|
|
125
126
|
description: e?.description ?? "",
|
|
126
127
|
type: e?.type ?? "",
|
|
127
|
-
objectives:
|
|
128
|
+
objectives: S(t.objectives),
|
|
128
129
|
channels: e?.channels ?? [],
|
|
129
130
|
budget: e ? String(e.budget.total) : "",
|
|
130
131
|
currency: String(t.currency ?? e?.budget.currency ?? "USD"),
|
|
131
132
|
startDate: e?.timeline.startDate ?? "",
|
|
132
133
|
endDate: e?.timeline.endDate ?? "",
|
|
133
|
-
kpis:
|
|
134
|
+
kpis: S(t.kpis),
|
|
134
135
|
tags: e?.tags ?? [],
|
|
135
|
-
ageMin:
|
|
136
|
-
ageMax:
|
|
136
|
+
ageMin: C(n.min, "18"),
|
|
137
|
+
ageMax: C(n.max, "65"),
|
|
137
138
|
demographics: e?.targeting.demographics ?? [],
|
|
138
139
|
assets: e?.assets ?? []
|
|
139
140
|
};
|
|
140
141
|
}
|
|
141
|
-
var
|
|
142
|
-
let { navigate:
|
|
143
|
-
skip: !
|
|
144
|
-
variables:
|
|
145
|
-
}),
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}, [
|
|
149
|
-
let
|
|
150
|
-
|
|
142
|
+
var T = () => {
|
|
143
|
+
let { navigate: S, basePath: C } = te(), { campaignId: T } = _(), { data: Se, loading: E, error: Ce } = r({
|
|
144
|
+
skip: !T,
|
|
145
|
+
variables: T ? { id: T } : void 0
|
|
146
|
+
}), D = Se?.headshotmarketingCampaign, O = D ? o(D) : null, k = x(D?.goals), A = !!T, [we, { loading: Te, error: Ee }] = n(), [De, { loading: Oe, error: ke }] = i(), [j, Ae] = p("basics"), [M, N] = p(""), [P, F] = p(""), [je, I] = p(null), [L, R] = p(() => w(O, k));
|
|
147
|
+
ne(() => {
|
|
148
|
+
O && R(w(O, k));
|
|
149
|
+
}, [D?.id, D?.updatedAt]);
|
|
150
|
+
let z = (e, t) => {
|
|
151
|
+
R((n) => ({
|
|
151
152
|
...n,
|
|
152
153
|
[e]: t
|
|
153
154
|
}));
|
|
154
|
-
},
|
|
155
|
-
|
|
155
|
+
}, B = (e, t) => {
|
|
156
|
+
R((n) => ({
|
|
156
157
|
...n,
|
|
157
158
|
[e]: n[e].includes(t) ? n[e].filter((e) => e !== t) : [...n[e], t]
|
|
158
159
|
}));
|
|
159
|
-
},
|
|
160
|
-
let e =
|
|
161
|
-
e && !
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
let t = (e ||
|
|
166
|
-
t && !
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
}, { save:
|
|
170
|
-
if (!e || e.length === 0 ||
|
|
171
|
-
|
|
172
|
-
let t =
|
|
160
|
+
}, V = () => {
|
|
161
|
+
let e = M.trim();
|
|
162
|
+
e && !L.tags.includes(e) && z("tags", [...L.tags, e]), N("");
|
|
163
|
+
}, Me = (e) => {
|
|
164
|
+
z("tags", L.tags.filter((t) => t !== e));
|
|
165
|
+
}, H = (e) => {
|
|
166
|
+
let t = (e || P).trim();
|
|
167
|
+
t && !L.demographics.includes(t) && z("demographics", [...L.demographics, t]), F("");
|
|
168
|
+
}, Ne = (e) => {
|
|
169
|
+
z("demographics", L.demographics.filter((t) => t !== e));
|
|
170
|
+
}, { save: Pe, isPending: Fe } = de(), [U, W] = p(null), [G, Ie] = p("PRIVATE"), [Le, K] = p(!1), q = f(!1), J = Fe || Le, Re = async (e) => {
|
|
171
|
+
if (!e || e.length === 0 || q.current) return;
|
|
172
|
+
W(null);
|
|
173
|
+
let t = L.name.trim() || "Untitled Campaign";
|
|
173
174
|
try {
|
|
174
|
-
let n = ue(
|
|
175
|
-
|
|
175
|
+
let n = ue(G);
|
|
176
|
+
q.current = !0, K(!0);
|
|
176
177
|
let r = [];
|
|
177
178
|
for (let i of Array.from(e)) {
|
|
178
|
-
let e = i.type || "application/octet-stream", a = await
|
|
179
|
+
let e = i.type || "application/octet-stream", a = await Pe({
|
|
179
180
|
source: {
|
|
180
181
|
kind: "blob",
|
|
181
182
|
getBlob: async () => ({
|
|
@@ -191,88 +192,88 @@ var w = () => {
|
|
|
191
192
|
});
|
|
192
193
|
r.push(a.name);
|
|
193
194
|
}
|
|
194
|
-
|
|
195
|
+
R((e) => ({
|
|
195
196
|
...e,
|
|
196
197
|
assets: Array.from(/* @__PURE__ */ new Set([...e.assets, ...r]))
|
|
197
198
|
}));
|
|
198
199
|
} catch (e) {
|
|
199
|
-
|
|
200
|
+
W(u(e, "Failed to upload file(s)."));
|
|
200
201
|
} finally {
|
|
201
|
-
|
|
202
|
+
q.current = !1, K(!1);
|
|
202
203
|
}
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
},
|
|
204
|
+
}, ze = (e) => {
|
|
205
|
+
z("assets", L.assets.filter((t) => t !== e));
|
|
206
|
+
}, Be = (e) => {
|
|
206
207
|
switch (e) {
|
|
207
|
-
case "email": return
|
|
208
|
-
case "social": return
|
|
208
|
+
case "email": return l.Email;
|
|
209
|
+
case "social": return l.Social;
|
|
209
210
|
case "ppc":
|
|
210
211
|
case "display":
|
|
211
|
-
case "video": return
|
|
212
|
-
case "influencer": return
|
|
213
|
-
default: return
|
|
212
|
+
case "video": return l.Ad;
|
|
213
|
+
case "influencer": return l.Influencer;
|
|
214
|
+
default: return l.Content;
|
|
214
215
|
}
|
|
215
|
-
},
|
|
216
|
-
if (e === "draft") return
|
|
217
|
-
if (
|
|
218
|
-
let e = new Date(
|
|
219
|
-
if (Number.isFinite(e) && e > Date.now()) return
|
|
216
|
+
}, Ve = (e) => {
|
|
217
|
+
if (e === "draft") return c.Draft;
|
|
218
|
+
if (L.startDate) {
|
|
219
|
+
let e = new Date(L.startDate).getTime();
|
|
220
|
+
if (Number.isFinite(e) && e > Date.now()) return c.Scheduled;
|
|
220
221
|
}
|
|
221
|
-
return
|
|
222
|
-
},
|
|
223
|
-
if (!
|
|
224
|
-
if (!
|
|
225
|
-
if (
|
|
226
|
-
let e = Number(
|
|
222
|
+
return c.Active;
|
|
223
|
+
}, Y = () => {
|
|
224
|
+
if (!L.name.trim()) return "Campaign name is required.";
|
|
225
|
+
if (!L.type) return "Campaign type is required.";
|
|
226
|
+
if (L.budget) {
|
|
227
|
+
let e = Number(L.budget);
|
|
227
228
|
if (!Number.isFinite(e) || e < 0) return "Budget must be a valid non-negative number.";
|
|
228
229
|
}
|
|
229
|
-
let e = Number(
|
|
230
|
+
let e = Number(L.ageMin), t = Number(L.ageMax);
|
|
230
231
|
if (!Number.isFinite(e) || !Number.isFinite(t) || e > t) return "Age range is invalid.";
|
|
231
|
-
if (
|
|
232
|
-
let e = new Date(
|
|
232
|
+
if (L.startDate && L.endDate) {
|
|
233
|
+
let e = new Date(L.startDate).getTime(), t = new Date(L.endDate).getTime();
|
|
233
234
|
if (Number.isFinite(e) && Number.isFinite(t) && t < e) return "End date must be on or after start date.";
|
|
234
235
|
}
|
|
235
236
|
return null;
|
|
236
237
|
}, X = (e) => {
|
|
237
|
-
let t =
|
|
238
|
+
let t = L.type ? Be(L.type) : l.Content;
|
|
238
239
|
return {
|
|
239
|
-
name:
|
|
240
|
-
description:
|
|
240
|
+
name: L.name,
|
|
241
|
+
description: L.description || null,
|
|
241
242
|
type: t,
|
|
242
|
-
status:
|
|
243
|
-
budget:
|
|
244
|
-
startDate:
|
|
245
|
-
endDate:
|
|
246
|
-
tags:
|
|
247
|
-
metadata: { currency:
|
|
243
|
+
status: Ve(e),
|
|
244
|
+
budget: L.budget ? Number(L.budget) : null,
|
|
245
|
+
startDate: L.startDate || null,
|
|
246
|
+
endDate: L.endDate || null,
|
|
247
|
+
tags: L.tags,
|
|
248
|
+
metadata: { currency: L.currency },
|
|
248
249
|
goals: {
|
|
249
|
-
currency:
|
|
250
|
-
objectives:
|
|
251
|
-
channels:
|
|
252
|
-
kpis:
|
|
253
|
-
demographics:
|
|
254
|
-
assets:
|
|
250
|
+
currency: L.currency,
|
|
251
|
+
objectives: L.objectives,
|
|
252
|
+
channels: L.channels,
|
|
253
|
+
kpis: L.kpis,
|
|
254
|
+
demographics: L.demographics,
|
|
255
|
+
assets: L.assets,
|
|
255
256
|
ageRange: {
|
|
256
|
-
min: Number(
|
|
257
|
-
max: Number(
|
|
257
|
+
min: Number(L.ageMin || "18"),
|
|
258
|
+
max: Number(L.ageMax || "65")
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
};
|
|
261
262
|
}, Z = async (n) => {
|
|
262
|
-
if (
|
|
263
|
-
let r =
|
|
264
|
-
if (r)
|
|
263
|
+
if (q.current) return;
|
|
264
|
+
let r = Y();
|
|
265
|
+
if (r) I(r);
|
|
265
266
|
else {
|
|
266
|
-
|
|
267
|
+
I(null);
|
|
267
268
|
try {
|
|
268
|
-
|
|
269
|
+
A && T ? await De({
|
|
269
270
|
variables: {
|
|
270
|
-
id:
|
|
271
|
+
id: T,
|
|
271
272
|
input: X(n)
|
|
272
273
|
},
|
|
273
274
|
refetchQueries: [{
|
|
274
275
|
query: e,
|
|
275
|
-
variables: { id:
|
|
276
|
+
variables: { id: T }
|
|
276
277
|
}, {
|
|
277
278
|
query: t,
|
|
278
279
|
variables: {
|
|
@@ -281,7 +282,7 @@ var w = () => {
|
|
|
281
282
|
}
|
|
282
283
|
}],
|
|
283
284
|
awaitRefetchQueries: !0
|
|
284
|
-
}) : await
|
|
285
|
+
}) : await we({
|
|
285
286
|
variables: { input: X(n) },
|
|
286
287
|
refetchQueries: [{
|
|
287
288
|
query: t,
|
|
@@ -291,214 +292,214 @@ var w = () => {
|
|
|
291
292
|
}
|
|
292
293
|
}],
|
|
293
294
|
awaitRefetchQueries: !0
|
|
294
|
-
}),
|
|
295
|
+
}), S(C + "/campaigns");
|
|
295
296
|
} catch (e) {
|
|
296
|
-
|
|
297
|
+
I(u(e, "Failed to save campaign."));
|
|
297
298
|
}
|
|
298
299
|
}
|
|
299
|
-
}, Q =
|
|
300
|
-
return
|
|
300
|
+
}, Q = Te || Oe, $ = je ?? d(Ee) ?? d(ke) ?? null;
|
|
301
|
+
return A && E && !O ? /* @__PURE__ */ v(s, {
|
|
301
302
|
title: "Edit Campaign",
|
|
302
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ v("div", {
|
|
303
304
|
className: "rounded-lg border border-border-seam bg-gloss-card shadow-pop p-6 text-sm text-text-secondary",
|
|
304
305
|
children: "Loading campaign details..."
|
|
305
306
|
})
|
|
306
|
-
}) :
|
|
307
|
+
}) : A && !E && !O ? /* @__PURE__ */ v(s, {
|
|
307
308
|
title: "Edit Campaign",
|
|
308
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ y("div", {
|
|
309
310
|
className: "rounded-lg border border-border-seam bg-gloss-card shadow-pop p-6",
|
|
310
311
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ v("p", {
|
|
312
313
|
className: "text-sm font-medium text-text-primary",
|
|
313
314
|
children: "Campaign not found."
|
|
314
315
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ v("p", {
|
|
316
317
|
className: "text-xs text-text-secondary mt-1",
|
|
317
|
-
children:
|
|
318
|
+
children: d(Ce) ?? "The requested campaign could not be loaded."
|
|
318
319
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
onClick: () =>
|
|
320
|
+
/* @__PURE__ */ y("button", {
|
|
321
|
+
onClick: () => S(C + "/campaigns"),
|
|
321
322
|
className: "mt-4 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",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ v(m, { className: "h-4 w-4" }), "Back to Campaigns"]
|
|
323
324
|
})
|
|
324
325
|
]
|
|
325
326
|
})
|
|
326
|
-
}) : /* @__PURE__ */
|
|
327
|
-
title:
|
|
328
|
-
actions: /* @__PURE__ */
|
|
329
|
-
onClick: () =>
|
|
327
|
+
}) : /* @__PURE__ */ y(s, {
|
|
328
|
+
title: A ? "Edit Campaign" : "Create Campaign",
|
|
329
|
+
actions: /* @__PURE__ */ y("button", {
|
|
330
|
+
onClick: () => S(C + "/campaigns"),
|
|
330
331
|
className: "inline-flex items-center gap-2 rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
331
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ v(m, { className: "h-4 w-4" }), "Back to Campaigns"]
|
|
332
333
|
}),
|
|
333
334
|
children: [
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ v(le, { children: A ? "Refine this campaign's setup — its goals, audience targeting, creative, budget and the KPIs you'll track. Changes apply the next time the campaign runs." : "Set up a new campaign step by step: name it and pick a type, define who you're targeting, attach creative, set a budget and timeline, then choose the KPIs you want to measure. Save as a draft anytime or launch when ready." }),
|
|
336
|
+
/* @__PURE__ */ v("div", {
|
|
336
337
|
className: "flex flex-nowrap items-center gap-1 overflow-x-auto border-b border-border-subtle",
|
|
337
|
-
children:
|
|
338
|
-
onClick: () =>
|
|
339
|
-
className: a("px-4 py-2 text-sm font-medium border-b-2 transition-colors -mb-px",
|
|
340
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: xe.map((e, t) => /* @__PURE__ */ y("button", {
|
|
339
|
+
onClick: () => Ae(e.key),
|
|
340
|
+
className: a("px-4 py-2 text-sm font-medium border-b-2 transition-colors -mb-px", j === e.key ? "border-primary text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
|
|
341
|
+
children: [/* @__PURE__ */ y("span", {
|
|
341
342
|
className: "me-1.5 text-xs text-text-secondary",
|
|
342
343
|
children: [t + 1, "."]
|
|
343
344
|
}), e.label]
|
|
344
345
|
}, e.key))
|
|
345
346
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ y(ce, {
|
|
347
348
|
className: "p-6",
|
|
348
349
|
children: [
|
|
349
|
-
|
|
350
|
+
j === "basics" && /* @__PURE__ */ y("div", {
|
|
350
351
|
className: "space-y-6 max-w-2xl",
|
|
351
352
|
children: [
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
353
354
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
354
355
|
children: "Campaign Name"
|
|
355
|
-
}), /* @__PURE__ */
|
|
356
|
+
}), /* @__PURE__ */ v("input", {
|
|
356
357
|
type: "text",
|
|
357
|
-
value:
|
|
358
|
-
onChange: (e) =>
|
|
358
|
+
value: L.name,
|
|
359
|
+
onChange: (e) => z("name", e.target.value),
|
|
359
360
|
placeholder: "Enter campaign name...",
|
|
360
361
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
361
362
|
})] }),
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
363
364
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
364
365
|
children: "Campaign Type"
|
|
365
|
-
}), /* @__PURE__ */
|
|
366
|
-
value:
|
|
367
|
-
onChange: (e) =>
|
|
366
|
+
}), /* @__PURE__ */ y(b, {
|
|
367
|
+
value: L.type,
|
|
368
|
+
onChange: (e) => z("type", e.target.value),
|
|
368
369
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
369
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ v("option", {
|
|
370
371
|
value: "",
|
|
371
372
|
children: "Select type..."
|
|
372
|
-
}),
|
|
373
|
+
}), ve.map((e) => /* @__PURE__ */ v("option", {
|
|
373
374
|
value: e.value,
|
|
374
375
|
children: e.label
|
|
375
376
|
}, e.value))]
|
|
376
377
|
})] }),
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
378
379
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
379
380
|
children: "Description"
|
|
380
|
-
}), /* @__PURE__ */
|
|
381
|
-
value:
|
|
382
|
-
onChange: (e) =>
|
|
381
|
+
}), /* @__PURE__ */ v("textarea", {
|
|
382
|
+
value: L.description,
|
|
383
|
+
onChange: (e) => z("description", e.target.value),
|
|
383
384
|
placeholder: "Describe the campaign goals and strategy...",
|
|
384
385
|
rows: 4,
|
|
385
386
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none"
|
|
386
387
|
})] }),
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
388
389
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
389
390
|
children: "Objectives"
|
|
390
|
-
}), /* @__PURE__ */
|
|
391
|
+
}), /* @__PURE__ */ v("div", {
|
|
391
392
|
className: "flex flex-wrap gap-2",
|
|
392
|
-
children: he.map((e) => /* @__PURE__ */
|
|
393
|
-
onClick: () =>
|
|
394
|
-
className: a("rounded-full px-3 py-1.5 text-xs font-medium border transition-colors",
|
|
393
|
+
children: he.map((e) => /* @__PURE__ */ v("button", {
|
|
394
|
+
onClick: () => B("objectives", e),
|
|
395
|
+
className: a("rounded-full px-3 py-1.5 text-xs font-medium border transition-colors", L.objectives.includes(e) ? "border-primary bg-action-primary-bg text-action-primary-text" : "border-border-subtle bg-bg-surface text-text-primary hover:bg-bg-sunken"),
|
|
395
396
|
children: e
|
|
396
397
|
}, e))
|
|
397
398
|
})] })
|
|
398
399
|
]
|
|
399
400
|
}),
|
|
400
|
-
|
|
401
|
+
j === "targeting" && /* @__PURE__ */ y("div", {
|
|
401
402
|
className: "space-y-6 max-w-2xl",
|
|
402
403
|
children: [
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
404
405
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
405
406
|
children: "Age Range"
|
|
406
|
-
}), /* @__PURE__ */
|
|
407
|
+
}), /* @__PURE__ */ y("div", {
|
|
407
408
|
className: "flex items-center gap-3",
|
|
408
409
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ v("input", {
|
|
410
411
|
type: "number",
|
|
411
|
-
value:
|
|
412
|
-
onChange: (e) =>
|
|
412
|
+
value: L.ageMin,
|
|
413
|
+
onChange: (e) => z("ageMin", e.target.value),
|
|
413
414
|
min: 13,
|
|
414
415
|
max: 100,
|
|
415
416
|
className: "w-24 rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
416
417
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ v("span", {
|
|
418
419
|
className: "text-sm text-text-secondary",
|
|
419
420
|
children: "to"
|
|
420
421
|
}),
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ v("input", {
|
|
422
423
|
type: "number",
|
|
423
|
-
value:
|
|
424
|
-
onChange: (e) =>
|
|
424
|
+
value: L.ageMax,
|
|
425
|
+
onChange: (e) => z("ageMax", e.target.value),
|
|
425
426
|
min: 13,
|
|
426
427
|
max: 100,
|
|
427
428
|
className: "w-24 rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
428
429
|
})
|
|
429
430
|
]
|
|
430
431
|
})] }),
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ y("div", { children: [
|
|
433
|
+
/* @__PURE__ */ v("label", {
|
|
433
434
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
434
435
|
children: "Demographics"
|
|
435
436
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ v("div", {
|
|
437
438
|
className: "flex flex-wrap gap-2 mb-2",
|
|
438
|
-
children:
|
|
439
|
+
children: L.demographics.map((e) => /* @__PURE__ */ y("span", {
|
|
439
440
|
className: "inline-flex items-center gap-1 rounded-full border border-border-subtle bg-bg-sunken px-2.5 py-1 text-xs font-medium text-text-primary",
|
|
440
|
-
children: [e, /* @__PURE__ */
|
|
441
|
-
onClick: () =>
|
|
441
|
+
children: [e, /* @__PURE__ */ v("button", {
|
|
442
|
+
onClick: () => Ne(e),
|
|
442
443
|
className: "text-text-secondary hover:text-text-primary",
|
|
443
|
-
children: /* @__PURE__ */ g
|
|
444
|
+
children: /* @__PURE__ */ v(g, { className: "h-3 w-3" })
|
|
444
445
|
})]
|
|
445
446
|
}, e))
|
|
446
447
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ y("div", {
|
|
448
449
|
className: "flex items-center gap-2 mb-2",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
450
|
+
children: [/* @__PURE__ */ v("input", {
|
|
450
451
|
type: "text",
|
|
451
|
-
value:
|
|
452
|
-
onChange: (e) =>
|
|
453
|
-
onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(),
|
|
452
|
+
value: P,
|
|
453
|
+
onChange: (e) => F(e.target.value),
|
|
454
|
+
onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(), H()),
|
|
454
455
|
placeholder: "Add demographic...",
|
|
455
456
|
className: "flex-1 rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
456
|
-
}), /* @__PURE__ */
|
|
457
|
-
onClick: () =>
|
|
457
|
+
}), /* @__PURE__ */ v("button", {
|
|
458
|
+
onClick: () => H(),
|
|
458
459
|
className: "rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
459
460
|
children: "Add"
|
|
460
461
|
})]
|
|
461
462
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ v("div", {
|
|
463
464
|
className: "flex flex-wrap gap-1.5",
|
|
464
|
-
children:
|
|
465
|
-
onClick: () =>
|
|
465
|
+
children: be.filter((e) => !L.demographics.includes(e)).map((e) => /* @__PURE__ */ y("button", {
|
|
466
|
+
onClick: () => H(e),
|
|
466
467
|
className: "rounded-full border border-dashed border-border-subtle px-2.5 py-1 text-xs text-text-secondary hover:text-text-primary hover:border-foreground transition-colors",
|
|
467
468
|
children: ["+ ", e]
|
|
468
469
|
}, e))
|
|
469
470
|
})
|
|
470
471
|
] }),
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
472
473
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
473
474
|
children: "Channels"
|
|
474
|
-
}), /* @__PURE__ */
|
|
475
|
+
}), /* @__PURE__ */ v("div", {
|
|
475
476
|
className: "flex flex-wrap gap-2",
|
|
476
|
-
children: ge.map((e) => /* @__PURE__ */
|
|
477
|
-
onClick: () =>
|
|
478
|
-
className: a("rounded-full px-3 py-1.5 text-xs font-medium border transition-colors",
|
|
477
|
+
children: ge.map((e) => /* @__PURE__ */ v("button", {
|
|
478
|
+
onClick: () => B("channels", e),
|
|
479
|
+
className: a("rounded-full px-3 py-1.5 text-xs font-medium border transition-colors", L.channels.includes(e) ? "border-primary bg-action-primary-bg text-action-primary-text" : "border-border-subtle bg-bg-surface text-text-primary hover:bg-bg-sunken"),
|
|
479
480
|
children: e
|
|
480
481
|
}, e))
|
|
481
482
|
})] })
|
|
482
483
|
]
|
|
483
484
|
}),
|
|
484
|
-
|
|
485
|
+
j === "content" && /* @__PURE__ */ y("div", {
|
|
485
486
|
className: "space-y-6",
|
|
486
487
|
children: [
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
value:
|
|
489
|
-
onChange:
|
|
490
|
-
disabled:
|
|
488
|
+
/* @__PURE__ */ v(ee, {
|
|
489
|
+
value: G,
|
|
490
|
+
onChange: Ie,
|
|
491
|
+
disabled: J || Q
|
|
491
492
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ v("p", {
|
|
493
494
|
className: "text-sm text-text-secondary",
|
|
494
495
|
children: "Upload creative assets for your campaign. Files are stored in your workspace Files and attached to this campaign."
|
|
495
496
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ v("div", {
|
|
497
498
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
498
499
|
children: [
|
|
499
500
|
{
|
|
500
501
|
label: "Images",
|
|
501
|
-
icon:
|
|
502
|
+
icon: re,
|
|
502
503
|
accept: "image/*",
|
|
503
504
|
match: fe
|
|
504
505
|
},
|
|
@@ -510,31 +511,31 @@ var w = () => {
|
|
|
510
511
|
},
|
|
511
512
|
{
|
|
512
513
|
label: "Documents",
|
|
513
|
-
icon:
|
|
514
|
+
icon: h,
|
|
514
515
|
accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv",
|
|
515
516
|
match: me
|
|
516
517
|
}
|
|
517
518
|
].map((e) => {
|
|
518
|
-
let t =
|
|
519
|
-
return /* @__PURE__ */
|
|
520
|
-
className: a("flex flex-col items-center justify-center rounded-lg border-2 border-dashed border-border-subtle bg-bg-sunken/30 p-8 text-center transition-colors",
|
|
519
|
+
let t = L.assets.filter((t) => e.match.test(t)).length;
|
|
520
|
+
return /* @__PURE__ */ y("label", {
|
|
521
|
+
className: a("flex flex-col items-center justify-center rounded-lg border-2 border-dashed border-border-subtle bg-bg-sunken/30 p-8 text-center transition-colors", J ? "cursor-progress opacity-70" : "cursor-pointer hover:border-primary/50 hover:bg-bg-sunken/50"),
|
|
521
522
|
children: [
|
|
522
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ v("input", {
|
|
523
524
|
type: "file",
|
|
524
525
|
accept: e.accept,
|
|
525
526
|
multiple: !0,
|
|
526
|
-
disabled:
|
|
527
|
+
disabled: J || Q,
|
|
527
528
|
className: "sr-only",
|
|
528
529
|
onChange: (e) => {
|
|
529
|
-
|
|
530
|
+
Re(e.currentTarget.files), e.currentTarget.value = "";
|
|
530
531
|
}
|
|
531
532
|
}),
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ v(e.icon, { className: "h-10 w-10 text-text-secondary mb-3" }),
|
|
534
|
+
/* @__PURE__ */ v("p", {
|
|
534
535
|
className: "text-sm font-medium text-text-primary",
|
|
535
536
|
children: e.label
|
|
536
537
|
}),
|
|
537
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ y("p", {
|
|
538
539
|
className: "text-xs text-text-secondary mt-1",
|
|
539
540
|
children: [
|
|
540
541
|
t,
|
|
@@ -543,132 +544,132 @@ var w = () => {
|
|
|
543
544
|
" uploaded"
|
|
544
545
|
]
|
|
545
546
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ y("span", {
|
|
547
548
|
className: "mt-3 inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
548
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ v(oe, { className: "h-3 w-3" }), J ? "Uploading..." : "Upload"]
|
|
549
550
|
})
|
|
550
551
|
]
|
|
551
552
|
}, e.label);
|
|
552
553
|
})
|
|
553
554
|
}),
|
|
554
|
-
|
|
555
|
+
U && /* @__PURE__ */ v("div", {
|
|
555
556
|
className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
|
|
556
|
-
children:
|
|
557
|
+
children: U
|
|
557
558
|
}),
|
|
558
|
-
|
|
559
|
+
L.assets.length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
559
560
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
560
561
|
children: [
|
|
561
562
|
"Attached Assets (",
|
|
562
|
-
|
|
563
|
+
L.assets.length,
|
|
563
564
|
")"
|
|
564
565
|
]
|
|
565
|
-
}), /* @__PURE__ */
|
|
566
|
+
}), /* @__PURE__ */ v("div", {
|
|
566
567
|
className: "space-y-2",
|
|
567
|
-
children:
|
|
568
|
+
children: L.assets.map((e) => /* @__PURE__ */ y("div", {
|
|
568
569
|
className: "flex items-center justify-between gap-3 rounded-md border border-border-subtle bg-bg-surface px-3 py-2",
|
|
569
|
-
children: [/* @__PURE__ */
|
|
570
|
+
children: [/* @__PURE__ */ y("div", {
|
|
570
571
|
className: "flex min-w-0 items-center gap-2",
|
|
571
|
-
children: [/* @__PURE__ */
|
|
572
|
+
children: [/* @__PURE__ */ v(h, { className: "h-4 w-4 flex-shrink-0 text-text-secondary" }), /* @__PURE__ */ v("span", {
|
|
572
573
|
className: "truncate text-sm text-text-primary",
|
|
573
574
|
children: e.split("/").pop() ?? e
|
|
574
575
|
})]
|
|
575
|
-
}), /* @__PURE__ */
|
|
576
|
+
}), /* @__PURE__ */ v("button", {
|
|
576
577
|
type: "button",
|
|
577
|
-
onClick: () =>
|
|
578
|
+
onClick: () => ze(e),
|
|
578
579
|
className: "flex-shrink-0 rounded-md p-1 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
|
|
579
580
|
"aria-label": `Remove ${e}`,
|
|
580
|
-
children: /* @__PURE__ */ g
|
|
581
|
+
children: /* @__PURE__ */ v(g, { className: "h-4 w-4" })
|
|
581
582
|
})]
|
|
582
583
|
}, e))
|
|
583
584
|
})] })
|
|
584
585
|
]
|
|
585
586
|
}),
|
|
586
|
-
|
|
587
|
+
j === "budget" && /* @__PURE__ */ y("div", {
|
|
587
588
|
className: "space-y-6 max-w-2xl",
|
|
588
|
-
children: [/* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ y("div", {
|
|
589
590
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
590
|
-
children: [/* @__PURE__ */
|
|
591
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
591
592
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
592
593
|
children: "Budget"
|
|
593
|
-
}), /* @__PURE__ */
|
|
594
|
+
}), /* @__PURE__ */ v("input", {
|
|
594
595
|
type: "number",
|
|
595
|
-
value:
|
|
596
|
-
onChange: (e) =>
|
|
596
|
+
value: L.budget,
|
|
597
|
+
onChange: (e) => z("budget", e.target.value),
|
|
597
598
|
placeholder: "0",
|
|
598
599
|
min: 0,
|
|
599
600
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
600
|
-
})] }), /* @__PURE__ */
|
|
601
|
+
})] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
601
602
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
602
603
|
children: "Currency"
|
|
603
|
-
}), /* @__PURE__ */
|
|
604
|
-
value:
|
|
605
|
-
onChange: (e) =>
|
|
604
|
+
}), /* @__PURE__ */ v(b, {
|
|
605
|
+
value: L.currency,
|
|
606
|
+
onChange: (e) => z("currency", e.target.value),
|
|
606
607
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
607
|
-
children:
|
|
608
|
+
children: ye.map((e) => /* @__PURE__ */ v("option", {
|
|
608
609
|
value: e,
|
|
609
610
|
children: e
|
|
610
611
|
}, e))
|
|
611
612
|
})] })]
|
|
612
|
-
}), /* @__PURE__ */
|
|
613
|
+
}), /* @__PURE__ */ y("div", {
|
|
613
614
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
614
|
-
children: [/* @__PURE__ */
|
|
615
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
615
616
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
616
617
|
children: "Start Date"
|
|
617
|
-
}), /* @__PURE__ */
|
|
618
|
+
}), /* @__PURE__ */ v("input", {
|
|
618
619
|
type: "date",
|
|
619
|
-
value:
|
|
620
|
-
onChange: (e) =>
|
|
620
|
+
value: L.startDate,
|
|
621
|
+
onChange: (e) => z("startDate", e.target.value),
|
|
621
622
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
622
|
-
})] }), /* @__PURE__ */
|
|
623
|
+
})] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
623
624
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
624
625
|
children: "End Date"
|
|
625
|
-
}), /* @__PURE__ */
|
|
626
|
+
}), /* @__PURE__ */ v("input", {
|
|
626
627
|
type: "date",
|
|
627
|
-
value:
|
|
628
|
-
onChange: (e) =>
|
|
628
|
+
value: L.endDate,
|
|
629
|
+
onChange: (e) => z("endDate", e.target.value),
|
|
629
630
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
630
631
|
})] })]
|
|
631
632
|
})]
|
|
632
633
|
}),
|
|
633
|
-
|
|
634
|
+
j === "tracking" && /* @__PURE__ */ y("div", {
|
|
634
635
|
className: "space-y-6 max-w-2xl",
|
|
635
|
-
children: [/* @__PURE__ */
|
|
636
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
636
637
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
637
638
|
children: "Key Performance Indicators"
|
|
638
|
-
}), /* @__PURE__ */
|
|
639
|
+
}), /* @__PURE__ */ v("div", {
|
|
639
640
|
className: "flex flex-wrap gap-2",
|
|
640
|
-
children: _e.map((e) => /* @__PURE__ */
|
|
641
|
-
onClick: () =>
|
|
642
|
-
className: a("rounded-full px-3 py-1.5 text-xs font-medium border transition-colors",
|
|
641
|
+
children: _e.map((e) => /* @__PURE__ */ v("button", {
|
|
642
|
+
onClick: () => B("kpis", e),
|
|
643
|
+
className: a("rounded-full px-3 py-1.5 text-xs font-medium border transition-colors", L.kpis.includes(e) ? "border-primary bg-action-primary-bg text-action-primary-text" : "border-border-subtle bg-bg-surface text-text-primary hover:bg-bg-sunken"),
|
|
643
644
|
children: e
|
|
644
645
|
}, e))
|
|
645
|
-
})] }), /* @__PURE__ */
|
|
646
|
-
/* @__PURE__ */
|
|
646
|
+
})] }), /* @__PURE__ */ y("div", { children: [
|
|
647
|
+
/* @__PURE__ */ v("label", {
|
|
647
648
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
648
649
|
children: "Tags"
|
|
649
650
|
}),
|
|
650
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ v("div", {
|
|
651
652
|
className: "flex flex-wrap gap-2 mb-2",
|
|
652
|
-
children:
|
|
653
|
+
children: L.tags.map((e) => /* @__PURE__ */ y("span", {
|
|
653
654
|
className: "inline-flex items-center gap-1 rounded-full border border-border-subtle bg-bg-sunken px-2.5 py-1 text-xs font-medium text-text-primary",
|
|
654
|
-
children: [e, /* @__PURE__ */
|
|
655
|
-
onClick: () =>
|
|
655
|
+
children: [e, /* @__PURE__ */ v("button", {
|
|
656
|
+
onClick: () => Me(e),
|
|
656
657
|
className: "text-text-secondary hover:text-text-primary",
|
|
657
|
-
children: /* @__PURE__ */ g
|
|
658
|
+
children: /* @__PURE__ */ v(g, { className: "h-3 w-3" })
|
|
658
659
|
})]
|
|
659
660
|
}, e))
|
|
660
661
|
}),
|
|
661
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ y("div", {
|
|
662
663
|
className: "flex items-center gap-2",
|
|
663
|
-
children: [/* @__PURE__ */
|
|
664
|
+
children: [/* @__PURE__ */ v("input", {
|
|
664
665
|
type: "text",
|
|
665
|
-
value:
|
|
666
|
-
onChange: (e) =>
|
|
667
|
-
onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(),
|
|
666
|
+
value: M,
|
|
667
|
+
onChange: (e) => N(e.target.value),
|
|
668
|
+
onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(), V()),
|
|
668
669
|
placeholder: "Add a tag...",
|
|
669
670
|
className: "flex-1 rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
670
|
-
}), /* @__PURE__ */
|
|
671
|
-
onClick:
|
|
671
|
+
}), /* @__PURE__ */ v("button", {
|
|
672
|
+
onClick: V,
|
|
672
673
|
className: "rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
673
674
|
children: "Add"
|
|
674
675
|
})]
|
|
@@ -677,35 +678,35 @@ var w = () => {
|
|
|
677
678
|
})
|
|
678
679
|
]
|
|
679
680
|
}),
|
|
680
|
-
$ && /* @__PURE__ */
|
|
681
|
+
$ && /* @__PURE__ */ v("div", {
|
|
681
682
|
className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
|
|
682
683
|
children: $
|
|
683
684
|
}),
|
|
684
|
-
/* @__PURE__ */
|
|
685
|
+
/* @__PURE__ */ y("div", {
|
|
685
686
|
className: "flex flex-wrap items-center justify-end gap-3 rounded-lg border border-border-seam bg-gloss-card p-4 shadow-pop",
|
|
686
687
|
children: [
|
|
687
|
-
/* @__PURE__ */
|
|
688
|
-
onClick: () =>
|
|
688
|
+
/* @__PURE__ */ v("button", {
|
|
689
|
+
onClick: () => S(C + "/campaigns"),
|
|
689
690
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
690
691
|
children: "Cancel"
|
|
691
692
|
}),
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ y("button", {
|
|
693
694
|
onClick: () => Z("draft"),
|
|
694
|
-
disabled: Q ||
|
|
695
|
+
disabled: Q || J,
|
|
695
696
|
className: "inline-flex items-center gap-2 rounded-md border border-border-seam bg-gloss-card shadow-pop px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-60",
|
|
696
|
-
children: [/* @__PURE__ */
|
|
697
|
+
children: [/* @__PURE__ */ v(ae, { className: "h-4 w-4" }), "Save Draft"]
|
|
697
698
|
}),
|
|
698
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ y("button", {
|
|
699
700
|
onClick: () => Z("launch"),
|
|
700
|
-
disabled: Q ||
|
|
701
|
+
disabled: Q || J,
|
|
701
702
|
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 disabled:opacity-60",
|
|
702
|
-
children: [/* @__PURE__ */
|
|
703
|
+
children: [/* @__PURE__ */ v(ie, { className: "h-4 w-4" }), A ? "Update Campaign" : "Create Campaign"]
|
|
703
704
|
})
|
|
704
705
|
]
|
|
705
706
|
})
|
|
706
707
|
]
|
|
707
708
|
});
|
|
708
709
|
};
|
|
709
|
-
export {
|
|
710
|
+
export { T as CreateCampaignPage };
|
|
710
711
|
|
|
711
712
|
//# sourceMappingURL=CreateCampaignPage.js.map
|