@burdenoff/microfe-headshotmarketing 2026.704.4 → 2026.704.5
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/wspace-operations.js +118 -111
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.js +27 -19
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/components/Toast.js +56 -2
- package/dist/headshotmarketing/components/Toast.js.map +1 -0
- package/dist/headshotmarketing/pages/HomeFunnel.js +54 -0
- package/dist/headshotmarketing/pages/HomeFunnel.js.map +1 -0
- package/dist/headshotmarketing/pages/HomePage.js +423 -259
- package/dist/headshotmarketing/pages/HomePage.js.map +1 -1
- package/dist/headshotmarketing/pages/HomeStatCard.js +79 -0
- package/dist/headshotmarketing/pages/HomeStatCard.js.map +1 -0
- package/dist/headshotmarketing/pages/ads/AdPlatformChips.js +93 -0
- package/dist/headshotmarketing/pages/ads/AdPlatformChips.js.map +1 -0
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +452 -390
- package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js +405 -115
- package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +565 -345
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.js +107 -0
- package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.js.map +1 -0
- package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.js +213 -0
- package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.js.map +1 -0
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js +150 -0
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js.map +1 -0
- package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js +380 -371
- package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/builder/SectionCanvasBlock.js +92 -0
- package/dist/headshotmarketing/pages/builder/SectionCanvasBlock.js.map +1 -0
- package/dist/headshotmarketing/pages/builder/SectionContent.js +346 -0
- package/dist/headshotmarketing/pages/builder/SectionContent.js.map +1 -0
- package/dist/headshotmarketing/pages/builder/SectionInspector.js +358 -0
- package/dist/headshotmarketing/pages/builder/SectionInspector.js.map +1 -0
- package/dist/headshotmarketing/pages/builder/builderCatalog.js +274 -0
- package/dist/headshotmarketing/pages/builder/builderCatalog.js.map +1 -0
- package/dist/headshotmarketing/pages/content/AIToolsPage.js +479 -193
- package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js +492 -197
- package/dist/headshotmarketing/pages/content/AssetLibraryPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/AssetThumbnail.js +37 -0
- package/dist/headshotmarketing/pages/content/AssetThumbnail.js.map +1 -0
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js +672 -219
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.js +200 -0
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.js.map +1 -0
- package/dist/headshotmarketing/pages/content/ContentPage.js +224 -204
- package/dist/headshotmarketing/pages/content/ContentPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentSubNav.js +51 -0
- package/dist/headshotmarketing/pages/content/ContentSubNav.js.map +1 -0
- package/dist/headshotmarketing/pages/crm/LeadsPage.js +250 -131
- package/dist/headshotmarketing/pages/crm/LeadsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadsWidgets.js +179 -0
- package/dist/headshotmarketing/pages/crm/LeadsWidgets.js.map +1 -0
- package/dist/headshotmarketing/pages/events/CreateEventPage.js +631 -379
- package/dist/headshotmarketing/pages/events/CreateEventPage.js.map +1 -1
- package/dist/headshotmarketing/pages/events/EventImageUpload.js +123 -0
- package/dist/headshotmarketing/pages/events/EventImageUpload.js.map +1 -0
- package/dist/headshotmarketing/pages/events/EventPagePreview.js +99 -0
- package/dist/headshotmarketing/pages/events/EventPagePreview.js.map +1 -0
- package/dist/headshotmarketing/pages/events/EventsPage.js +267 -228
- package/dist/headshotmarketing/pages/events/EventsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/seo/SeoScoreGauge.js +50 -0
- package/dist/headshotmarketing/pages/seo/SeoScoreGauge.js.map +1 -0
- package/dist/headshotmarketing/pages/seo/SeoScorePanel.js +147 -0
- package/dist/headshotmarketing/pages/seo/SeoScorePanel.js.map +1 -0
- package/dist/headshotmarketing/pages/seo/SeoToolsPage.js +562 -419
- package/dist/headshotmarketing/pages/seo/SeoToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/MediaDropZone.js +108 -0
- package/dist/headshotmarketing/pages/social-media/MediaDropZone.js.map +1 -0
- package/dist/headshotmarketing/pages/social-media/SocialComposerPreview.js +100 -0
- package/dist/headshotmarketing/pages/social-media/SocialComposerPreview.js.map +1 -0
- package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js +315 -250
- package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/socialComposerMeta.js +60 -0
- package/dist/headshotmarketing/pages/social-media/socialComposerMeta.js.map +1 -0
- package/dist/headshotmarketing/utils/automationMapper.js +1 -1
- package/dist/headshotmarketing/utils/automationMapper.js.map +1 -1
- package/dist/headshotmarketing/utils/contentMapper.js +4 -24
- package/dist/headshotmarketing/utils/contentMapper.js.map +1 -1
- package/dist/headshotmarketing/utils/eventsMapper.js +9 -9
- package/dist/headshotmarketing/utils/eventsMapper.js.map +1 -1
- package/dist/headshotmarketing/utils/helpers.js +7 -4
- package/dist/headshotmarketing/utils/helpers.js.map +1 -1
- package/dist/headshotmarketing/utils/influencerMapper.js +1 -1
- package/dist/headshotmarketing/utils/influencerMapper.js.map +1 -1
- package/dist/node_modules/lodash/_arrayEach.js +14 -0
- package/dist/node_modules/lodash/_arrayEach.js.map +1 -0
- package/dist/node_modules/lodash/_assignValue.js +17 -0
- package/dist/node_modules/lodash/_assignValue.js.map +1 -0
- package/dist/node_modules/lodash/_baseAssign.js +16 -0
- package/dist/node_modules/lodash/_baseAssign.js.map +1 -0
- package/dist/node_modules/lodash/_baseAssignIn.js +16 -0
- package/dist/node_modules/lodash/_baseAssignIn.js.map +1 -0
- package/dist/node_modules/lodash/_baseClone.js +64 -0
- package/dist/node_modules/lodash/_baseClone.js.map +1 -0
- package/dist/node_modules/lodash/_baseCreate.js +21 -0
- package/dist/node_modules/lodash/_baseCreate.js.map +1 -0
- package/dist/node_modules/lodash/_baseIsMap.js +16 -0
- package/dist/node_modules/lodash/_baseIsMap.js.map +1 -0
- package/dist/node_modules/lodash/_baseIsSet.js +16 -0
- package/dist/node_modules/lodash/_baseIsSet.js.map +1 -0
- package/dist/node_modules/lodash/_baseKeysIn.js +20 -0
- package/dist/node_modules/lodash/_baseKeysIn.js.map +1 -0
- package/dist/node_modules/lodash/_baseUnset.js +26 -0
- package/dist/node_modules/lodash/_baseUnset.js.map +1 -0
- package/dist/node_modules/lodash/_cloneArrayBuffer.js +16 -0
- package/dist/node_modules/lodash/_cloneArrayBuffer.js.map +1 -0
- package/dist/node_modules/lodash/_cloneBuffer.js +17 -0
- package/dist/node_modules/lodash/_cloneBuffer.js.map +1 -0
- package/dist/node_modules/lodash/_cloneDataView.js +16 -0
- package/dist/node_modules/lodash/_cloneDataView.js.map +1 -0
- package/dist/node_modules/lodash/_cloneRegExp.js +15 -0
- package/dist/node_modules/lodash/_cloneRegExp.js.map +1 -0
- package/dist/node_modules/lodash/_cloneSymbol.js +15 -0
- package/dist/node_modules/lodash/_cloneSymbol.js.map +1 -0
- package/dist/node_modules/lodash/_cloneTypedArray.js +16 -0
- package/dist/node_modules/lodash/_cloneTypedArray.js.map +1 -0
- package/dist/node_modules/lodash/_copyArray.js +15 -0
- package/dist/node_modules/lodash/_copyArray.js.map +1 -0
- package/dist/node_modules/lodash/_copyObject.js +22 -0
- package/dist/node_modules/lodash/_copyObject.js.map +1 -0
- package/dist/node_modules/lodash/_copySymbols.js +16 -0
- package/dist/node_modules/lodash/_copySymbols.js.map +1 -0
- package/dist/node_modules/lodash/_copySymbolsIn.js +16 -0
- package/dist/node_modules/lodash/_copySymbolsIn.js.map +1 -0
- package/dist/node_modules/lodash/_customOmitClone.js +15 -0
- package/dist/node_modules/lodash/_customOmitClone.js.map +1 -0
- package/dist/node_modules/lodash/_flatRest.js +17 -0
- package/dist/node_modules/lodash/_flatRest.js.map +1 -0
- package/dist/node_modules/lodash/_getAllKeysIn.js +17 -0
- package/dist/node_modules/lodash/_getAllKeysIn.js.map +1 -0
- package/dist/node_modules/lodash/_getSymbolsIn.js +18 -0
- package/dist/node_modules/lodash/_getSymbolsIn.js.map +1 -0
- package/dist/node_modules/lodash/_initCloneArray.js +15 -0
- package/dist/node_modules/lodash/_initCloneArray.js.map +1 -0
- package/dist/node_modules/lodash/_initCloneByTag.js +40 -0
- package/dist/node_modules/lodash/_initCloneByTag.js.map +1 -0
- package/dist/node_modules/lodash/_initCloneObject.js +17 -0
- package/dist/node_modules/lodash/_initCloneObject.js.map +1 -0
- package/dist/node_modules/lodash/_nativeKeysIn.js +15 -0
- package/dist/node_modules/lodash/_nativeKeysIn.js.map +1 -0
- package/dist/node_modules/lodash/_parent.js +16 -0
- package/dist/node_modules/lodash/_parent.js.map +1 -0
- package/dist/node_modules/lodash/flatten.js +15 -0
- package/dist/node_modules/lodash/flatten.js.map +1 -0
- package/dist/node_modules/lodash/isMap.js +14 -0
- package/dist/node_modules/lodash/isMap.js.map +1 -0
- package/dist/node_modules/lodash/isSet.js +14 -0
- package/dist/node_modules/lodash/isSet.js.map +1 -0
- package/dist/node_modules/lodash/keysIn.js +17 -0
- package/dist/node_modules/lodash/keysIn.js.map +1 -0
- package/dist/node_modules/lodash/omit.js +28 -0
- package/dist/node_modules/lodash/omit.js.map +1 -0
- package/dist/node_modules/recharts/es6/chart/FunnelChart.js +15 -0
- package/dist/node_modules/recharts/es6/chart/FunnelChart.js.map +1 -0
- package/dist/node_modules/recharts/es6/numberAxis/Funnel.js +370 -0
- package/dist/node_modules/recharts/es6/numberAxis/Funnel.js.map +1 -0
- package/dist/node_modules/recharts/es6/util/ActiveShapeUtils.js +1 -1
- package/dist/node_modules/recharts/es6/util/FunnelUtils.js +81 -0
- package/dist/node_modules/recharts/es6/util/FunnelUtils.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useHeadshotmarketingCreateContentItemMutation as e } from "../../../generated/wspace-operations.js";
|
|
2
|
+
import { useHeadshotMarketing as t } from "../../context/HeadshotMarketingContext.js";
|
|
3
|
+
import { cn as n, formatDate as r, formatNumber as i } from "../../utils/helpers.js";
|
|
4
|
+
import { HeadshotmarketingAiToolCategory as a, HeadshotmarketingContentItemType as o } from "../../../generated/wspace-types.js";
|
|
5
|
+
import { PageLayout as s } from "../../components/PageLayout.js";
|
|
6
|
+
import { EmptyState as ee } from "../../components/EmptyState.js";
|
|
7
|
+
import { QueryStateBoundary as te } from "../../components/QueryStateBoundary.js";
|
|
5
8
|
import "../../components/index.js";
|
|
6
|
-
import { useHeadshotmarketingBootstrap as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { EmphasisPanel as E, PagePurpose as D } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
import { useHeadshotmarketingBootstrap as ne } from "../../hooks/useHeadshotmarketingBootstrap.js";
|
|
10
|
+
import { useEffect as re, useMemo as c, useState as l } from "react";
|
|
11
|
+
import { Check as u, Clock as ie, Copy as ae, Cpu as oe, FilePlus2 as d, GitBranch as f, Image as p, Languages as m, Loader2 as h, Mail as g, Megaphone as _, MessageSquare as se, Mic as v, PenTool as y, ScanText as b, Search as x, Send as ce, Sparkles as S, Video as C, Wand2 as le, Zap as ue } from "lucide-react";
|
|
12
|
+
import { useCopyToClipboard as de } from "@burdenoff/fe-libs/shared/hooks";
|
|
13
|
+
import { gql as w } from "@apollo/client";
|
|
14
|
+
import { useMutation as fe } from "@apollo/client/react";
|
|
15
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
16
|
+
import { GlassCard as pe, PagePurpose as me, Select as he, SelectContent as ge, SelectItem as _e, SelectTrigger as ve, SelectValue as ye, Textarea as be } from "@burdenoff/fe-libs/ui";
|
|
15
17
|
//#region src/headshotmarketing/pages/content/AIToolsPage.tsx
|
|
16
|
-
var
|
|
18
|
+
var xe = w`
|
|
17
19
|
mutation HeadshotmarketingExecuteAITool(
|
|
18
20
|
$input: HeadshotmarketingExecuteAIToolInput!
|
|
19
21
|
) {
|
|
@@ -28,20 +30,49 @@ var O = x`
|
|
|
28
30
|
createdAt
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
`,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
`, O = {
|
|
34
|
+
[a.ContentGeneration]: y,
|
|
35
|
+
[a.Copywriting]: _,
|
|
36
|
+
[a.ImageGeneration]: p,
|
|
37
|
+
[a.SeoOptimization]: x,
|
|
38
|
+
[a.Summarization]: b,
|
|
39
|
+
[a.Translation]: m,
|
|
40
|
+
[a.VideoGeneration]: C,
|
|
41
|
+
[a.Other]: S
|
|
42
|
+
}, Se = {
|
|
43
|
+
[a.ContentGeneration]: "Content",
|
|
44
|
+
[a.Copywriting]: "Copywriting",
|
|
45
|
+
[a.ImageGeneration]: "Image",
|
|
46
|
+
[a.SeoOptimization]: "SEO",
|
|
47
|
+
[a.Summarization]: "Summarize",
|
|
48
|
+
[a.Translation]: "Translation",
|
|
49
|
+
[a.VideoGeneration]: "Video",
|
|
50
|
+
[a.Other]: "AI"
|
|
38
51
|
};
|
|
39
|
-
function
|
|
52
|
+
function Ce(e, t) {
|
|
53
|
+
let n = e.toLowerCase();
|
|
54
|
+
return n.includes("blog") ? y : n.includes("subject line") || n.includes("email") ? g : n.includes("caption") || n.includes("social") ? se : n.includes("ad copy") || n.includes("ad ") || n.includes("advert") ? _ : n.includes("seo") || n.includes("meta") || n.includes("keyword") ? x : n.includes("alt") || n.includes("image") || n.includes("photo") ? p : n.includes("repurpose") || n.includes("remix") ? f : n.includes("voice") || n.includes("tone") ? v : n.includes("translat") ? m : n.includes("summar") ? b : n.includes("video") || n.includes("script") ? C : O[t] ?? S;
|
|
55
|
+
}
|
|
56
|
+
function we(e, t) {
|
|
57
|
+
let n = e.toLowerCase();
|
|
58
|
+
if (n.includes("blog")) return o.BlogPost;
|
|
59
|
+
if (n.includes("caption") || n.includes("social")) return o.SocialPost;
|
|
60
|
+
if (n.includes("email") || n.includes("subject line")) return o.Email;
|
|
61
|
+
if (n.includes("ad")) return o.AdCopy;
|
|
62
|
+
if (n.includes("video") || n.includes("script")) return o.VideoScript;
|
|
63
|
+
switch (t) {
|
|
64
|
+
case a.ContentGeneration: return o.BlogPost;
|
|
65
|
+
case a.Copywriting: return o.AdCopy;
|
|
66
|
+
case a.VideoGeneration: return o.VideoScript;
|
|
67
|
+
default: return o.Other;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function k(e) {
|
|
40
71
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
41
72
|
}
|
|
42
|
-
function
|
|
73
|
+
function A(e) {
|
|
43
74
|
if (typeof e == "string") return e;
|
|
44
|
-
if (
|
|
75
|
+
if (k(e)) for (let t of [
|
|
45
76
|
"text",
|
|
46
77
|
"content",
|
|
47
78
|
"result",
|
|
@@ -52,11 +83,11 @@ function j(e) {
|
|
|
52
83
|
}
|
|
53
84
|
return JSON.stringify(e);
|
|
54
85
|
}
|
|
55
|
-
function
|
|
86
|
+
function j(e) {
|
|
56
87
|
if (e == null) return [];
|
|
57
88
|
if (typeof e == "string") return e.trim() ? [e] : [];
|
|
58
|
-
if (Array.isArray(e)) return e.map(
|
|
59
|
-
if (
|
|
89
|
+
if (Array.isArray(e)) return e.map(A);
|
|
90
|
+
if (k(e)) {
|
|
60
91
|
for (let t of [
|
|
61
92
|
"variations",
|
|
62
93
|
"results",
|
|
@@ -65,7 +96,7 @@ function M(e) {
|
|
|
65
96
|
"suggestions"
|
|
66
97
|
]) {
|
|
67
98
|
let n = e[t];
|
|
68
|
-
if (Array.isArray(n)) return n.map(
|
|
99
|
+
if (Array.isArray(n)) return n.map(A);
|
|
69
100
|
}
|
|
70
101
|
for (let t of [
|
|
71
102
|
"text",
|
|
@@ -84,195 +115,450 @@ function M(e) {
|
|
|
84
115
|
}
|
|
85
116
|
return [String(e)];
|
|
86
117
|
}
|
|
87
|
-
|
|
88
|
-
let
|
|
89
|
-
|
|
90
|
-
|
|
118
|
+
function Te(e, t) {
|
|
119
|
+
let n = e.split("\n").find((e) => e.trim())?.trim() ?? "";
|
|
120
|
+
return (n.length > 64 ? `${n.slice(0, 61)}…` : n) || `${t} draft`;
|
|
121
|
+
}
|
|
122
|
+
var M = () => {
|
|
123
|
+
let { data: f, loading: p, error: m, refetch: g } = ne(), { navigate: _, basePath: se } = t(), { copy: v } = de(), [y, { loading: b }] = fe(xe), [x] = e(), [C, w] = l(null), [O, k] = l(""), [A, M] = l(""), [N, P] = l([]), [F, I] = l(null), [Ee, L] = l(null), [R, De] = l(null), [z, B] = l(null), [V, H] = l(/* @__PURE__ */ new Set()), [U, W] = l(null), G = c(() => f?.headshotmarketingAITools.items ?? [], [f]), K = c(() => f?.headshotmarketingAIToolExecutions.items ?? [], [f]), q = c(() => {
|
|
124
|
+
let e = /* @__PURE__ */ new Date();
|
|
125
|
+
return new Date(e.getFullYear(), e.getMonth(), 1).getTime();
|
|
126
|
+
}, []), Oe = c(() => {
|
|
127
|
+
let e = /* @__PURE__ */ new Map();
|
|
128
|
+
for (let t of K) new Date(t.createdAt).getTime() >= q && e.set(t.toolId, (e.get(t.toolId) ?? 0) + 1);
|
|
129
|
+
return e;
|
|
130
|
+
}, [K, q]), ke = c(() => {
|
|
131
|
+
let e = 0;
|
|
132
|
+
for (let t of K) new Date(t.createdAt).getTime() >= q && (e += t.tokensUsed ?? 0);
|
|
133
|
+
return e;
|
|
134
|
+
}, [K, q]), Ae = c(() => K.filter((e) => new Date(e.createdAt).getTime() >= q).length, [K, q]), je = c(() => {
|
|
135
|
+
let e = /* @__PURE__ */ new Map();
|
|
136
|
+
for (let t of G) {
|
|
137
|
+
if (!t.model) continue;
|
|
138
|
+
let n = e.get(t.provider) ?? /* @__PURE__ */ new Set();
|
|
139
|
+
n.add(t.model), e.set(t.provider, n);
|
|
140
|
+
}
|
|
141
|
+
return e;
|
|
142
|
+
}, [G]), J = c(() => G.map((e) => ({
|
|
143
|
+
id: e.id,
|
|
144
|
+
name: e.name,
|
|
145
|
+
description: e.description ?? "",
|
|
146
|
+
category: e.category,
|
|
147
|
+
provider: e.provider,
|
|
148
|
+
model: e.model ?? null,
|
|
149
|
+
isAvailable: e.isEnabled,
|
|
150
|
+
icon: Ce(e.name, e.category),
|
|
151
|
+
inputType: e.category === a.SeoOptimization ? "url" : "text",
|
|
152
|
+
contentType: we(e.name, e.category),
|
|
153
|
+
monthlyUses: Oe.get(e.id) ?? 0
|
|
154
|
+
})), [G, Oe]), Me = c(() => new Map(J.map((e) => [e.id, e])), [J]), Y = J.find((e) => e.id === C), Ne = J.filter((e) => e.isAvailable).length;
|
|
155
|
+
re(() => {
|
|
156
|
+
!C && J.length > 0 && w((J.find((e) => e.isAvailable) ?? J[0]).id);
|
|
157
|
+
}, [C, J]);
|
|
158
|
+
let X = c(() => {
|
|
159
|
+
if (!Y) return [];
|
|
160
|
+
let e = new Set(je.get(Y.provider) ?? []);
|
|
161
|
+
return Y.model && e.add(Y.model), Array.from(e);
|
|
162
|
+
}, [Y, je]), Z = A || Y?.model || X[0] || "", Pe = (e) => {
|
|
163
|
+
w(e), P([]), I(null), L(null), W(null), k(""), M(""), H(/* @__PURE__ */ new Set());
|
|
164
|
+
}, Fe = async () => {
|
|
165
|
+
if (!(!O.trim() || !Y || !Y.isAvailable)) {
|
|
166
|
+
L(null), W(null), H(/* @__PURE__ */ new Set());
|
|
91
167
|
try {
|
|
92
168
|
let e = (await y({ variables: { input: {
|
|
93
|
-
toolId:
|
|
94
|
-
input: { prompt:
|
|
169
|
+
toolId: Y.id,
|
|
170
|
+
input: { prompt: O.trim() },
|
|
171
|
+
metadata: Z ? {
|
|
172
|
+
model: Z,
|
|
173
|
+
provider: Y.provider
|
|
174
|
+
} : { provider: Y.provider }
|
|
95
175
|
} } })).data?.headshotmarketingExecuteAITool;
|
|
96
176
|
if (!e) throw Error("No response from the tool.");
|
|
97
|
-
e.status === "FAILED" ? (
|
|
177
|
+
e.status === "FAILED" ? (P([]), I(null), L(e.errorMessage ?? "The tool failed to generate a result. Please try again.")) : (P(j(e.output)), I({
|
|
178
|
+
tokensUsed: e.tokensUsed,
|
|
179
|
+
durationMs: e.durationMs
|
|
180
|
+
})), await g();
|
|
98
181
|
} catch (e) {
|
|
99
|
-
|
|
182
|
+
L(e instanceof Error ? e.message : "Generation failed.");
|
|
100
183
|
}
|
|
101
184
|
}
|
|
102
|
-
},
|
|
103
|
-
await
|
|
104
|
-
}
|
|
105
|
-
|
|
185
|
+
}, Q = async (e, t) => {
|
|
186
|
+
await v(t), De(e), window.setTimeout(() => De((t) => t === e ? null : t), 1500);
|
|
187
|
+
}, $ = async (e, t, n) => {
|
|
188
|
+
if (t.trim()) {
|
|
189
|
+
W(null), B(e);
|
|
190
|
+
try {
|
|
191
|
+
await x({ variables: { input: {
|
|
192
|
+
title: Te(t, n?.name ?? "AI"),
|
|
193
|
+
body: t,
|
|
194
|
+
summary: t.replace(/\s+/g, " ").trim().slice(0, 180),
|
|
195
|
+
type: n ? we(n.name, n.category) : o.Other,
|
|
196
|
+
tags: ["ai-generated"],
|
|
197
|
+
metadata: {
|
|
198
|
+
source: "ai-tools",
|
|
199
|
+
toolId: n?.id ?? null,
|
|
200
|
+
provider: n?.provider ?? null,
|
|
201
|
+
model: Z || n?.model || null
|
|
202
|
+
}
|
|
203
|
+
} } }), H((t) => new Set(t).add(e)), g();
|
|
204
|
+
} catch (e) {
|
|
205
|
+
W(e instanceof Error ? e.message : "Could not save draft.");
|
|
206
|
+
} finally {
|
|
207
|
+
B(null);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}, Ie = N.join("\n\n"), Le = [
|
|
211
|
+
{
|
|
212
|
+
label: "Available tools",
|
|
213
|
+
value: String(Ne),
|
|
214
|
+
icon: le
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
label: "Generations this month",
|
|
218
|
+
value: i(Ae),
|
|
219
|
+
icon: S
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
label: "Tokens this month",
|
|
223
|
+
value: i(ke),
|
|
224
|
+
icon: ue
|
|
225
|
+
}
|
|
226
|
+
];
|
|
227
|
+
return /* @__PURE__ */ D(s, {
|
|
106
228
|
title: "AI Tools",
|
|
107
229
|
description: "AI-powered marketing content and optimization tools",
|
|
108
|
-
children: [/* @__PURE__ */
|
|
109
|
-
loading:
|
|
110
|
-
error:
|
|
111
|
-
onRetry: () => void
|
|
112
|
-
hasData: !!
|
|
113
|
-
children:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
230
|
+
children: [/* @__PURE__ */ E(me, { children: "Let AI do the heavy lifting on content. Generate copy, headlines and ideas, rewrite or optimize what you have, and turn a rough brief into a polished draft in seconds — then save it straight to your content library to refine it in your brand voice." }), /* @__PURE__ */ E(te, {
|
|
231
|
+
loading: p,
|
|
232
|
+
error: m,
|
|
233
|
+
onRetry: () => void g(),
|
|
234
|
+
hasData: !!f,
|
|
235
|
+
children: J.length === 0 ? /* @__PURE__ */ E(ee, {
|
|
236
|
+
illustration: "empty-generic",
|
|
237
|
+
title: "No AI tools available",
|
|
238
|
+
description: "AI tools will appear here once they're enabled for your workspace."
|
|
239
|
+
}) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("div", {
|
|
240
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
241
|
+
children: Le.map((e) => {
|
|
242
|
+
let t = e.icon;
|
|
243
|
+
return /* @__PURE__ */ D(pe, {
|
|
244
|
+
treatment: "metric",
|
|
245
|
+
className: "flex items-center gap-3 p-4",
|
|
246
|
+
children: [/* @__PURE__ */ E("span", {
|
|
247
|
+
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
248
|
+
children: /* @__PURE__ */ E(t, { className: "h-5 w-5" })
|
|
249
|
+
}), /* @__PURE__ */ D("span", {
|
|
250
|
+
className: "min-w-0",
|
|
251
|
+
children: [/* @__PURE__ */ E("span", {
|
|
252
|
+
className: "block text-xl font-bold leading-none text-text-primary",
|
|
253
|
+
children: e.value
|
|
254
|
+
}), /* @__PURE__ */ E("span", {
|
|
255
|
+
className: "mt-1 block truncate text-xs text-text-secondary",
|
|
256
|
+
children: e.label
|
|
257
|
+
})]
|
|
258
|
+
})]
|
|
259
|
+
}, e.label);
|
|
260
|
+
})
|
|
261
|
+
}), /* @__PURE__ */ D("div", {
|
|
262
|
+
className: "grid grid-cols-1 gap-6 lg:grid-cols-[1fr_minmax(340px,380px)] xl:grid-cols-[1fr_400px]",
|
|
263
|
+
children: [/* @__PURE__ */ D("div", {
|
|
264
|
+
className: "min-w-0 space-y-6",
|
|
265
|
+
children: [/* @__PURE__ */ D("section", { children: [/* @__PURE__ */ E("h3", {
|
|
266
|
+
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
267
|
+
children: "Choose a tool"
|
|
268
|
+
}), /* @__PURE__ */ E("div", {
|
|
269
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",
|
|
270
|
+
children: J.map((e) => {
|
|
271
|
+
let t = e.icon, r = C === e.id;
|
|
272
|
+
return /* @__PURE__ */ D("button", {
|
|
273
|
+
type: "button",
|
|
274
|
+
onClick: () => Pe(e.id),
|
|
275
|
+
disabled: !e.isAvailable,
|
|
276
|
+
"aria-pressed": r,
|
|
277
|
+
className: n("group relative flex min-h-[44px] flex-col items-start rounded-card border p-4 text-left transition-[box-shadow,border-color,background-color] duration-200", r ? "border-primary bg-accent-wash shadow-elevation-2" : e.isAvailable ? "border-border-subtle bg-bg-surface hover:border-border-strong hover:shadow-elevation-2" : "cursor-not-allowed border-border-subtle bg-bg-sunken opacity-60"),
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ E(S, { className: n("absolute right-3 top-3 h-4 w-4 transition-opacity", r ? "text-primary opacity-90" : "text-primary opacity-30 group-hover:opacity-60") }),
|
|
280
|
+
/* @__PURE__ */ E("span", {
|
|
281
|
+
className: n("flex h-10 w-10 items-center justify-center rounded-lg transition-colors", r ? "bg-action-primary-bg text-action-primary-text" : "bg-action-primary-bg/10 text-primary"),
|
|
282
|
+
children: /* @__PURE__ */ E(t, { className: "h-5 w-5" })
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ E("h4", {
|
|
285
|
+
className: "mt-3 pr-5 text-sm font-semibold text-text-primary",
|
|
286
|
+
children: e.name
|
|
287
|
+
}),
|
|
288
|
+
e.description && /* @__PURE__ */ E("p", {
|
|
289
|
+
className: "mt-1 line-clamp-2 text-xs text-text-secondary",
|
|
290
|
+
children: e.description
|
|
291
|
+
}),
|
|
292
|
+
/* @__PURE__ */ D("div", {
|
|
293
|
+
className: "mt-3 flex w-full items-center justify-between gap-2 text-xs",
|
|
294
|
+
children: [/* @__PURE__ */ E("span", {
|
|
295
|
+
className: "rounded-full bg-bg-sunken px-2 py-0.5 font-medium text-text-secondary",
|
|
296
|
+
children: Se[e.category]
|
|
297
|
+
}), e.isAvailable ? /* @__PURE__ */ D("span", {
|
|
298
|
+
className: "text-text-secondary",
|
|
299
|
+
children: [
|
|
300
|
+
e.monthlyUses,
|
|
301
|
+
" ",
|
|
302
|
+
e.monthlyUses === 1 ? "use" : "uses",
|
|
303
|
+
" this month"
|
|
304
|
+
]
|
|
305
|
+
}) : /* @__PURE__ */ E("span", {
|
|
306
|
+
className: "font-medium text-status-warning-text",
|
|
307
|
+
children: "Coming soon"
|
|
141
308
|
})]
|
|
309
|
+
})
|
|
310
|
+
]
|
|
311
|
+
}, e.id);
|
|
312
|
+
})
|
|
313
|
+
})] }), /* @__PURE__ */ D("section", { children: [/* @__PURE__ */ E("h3", {
|
|
314
|
+
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
315
|
+
children: "Recent generations"
|
|
316
|
+
}), K.length === 0 ? /* @__PURE__ */ E(ee, {
|
|
317
|
+
illustration: "empty-generic",
|
|
318
|
+
title: "No generations yet",
|
|
319
|
+
description: "Run a tool and your recent AI generations will show up here."
|
|
320
|
+
}) : /* @__PURE__ */ E("div", {
|
|
321
|
+
className: "space-y-3",
|
|
322
|
+
children: K.map((e) => {
|
|
323
|
+
let t = Me.get(e.toolId), n = j(e.input)[0] ?? "—", i = j(e.output)[0] ?? "—", a = t?.icon ?? S, o = `gen-${e.id}`, s = V.has(o);
|
|
324
|
+
return /* @__PURE__ */ D("div", {
|
|
325
|
+
className: "rounded-card border border-border-seam bg-gloss-card p-4 shadow-pop",
|
|
326
|
+
children: [
|
|
327
|
+
/* @__PURE__ */ D("div", {
|
|
328
|
+
className: "mb-2 flex items-center justify-between gap-2",
|
|
329
|
+
children: [/* @__PURE__ */ D("div", {
|
|
330
|
+
className: "flex min-w-0 items-center gap-2",
|
|
331
|
+
children: [/* @__PURE__ */ E(a, { className: "h-3.5 w-3.5 shrink-0 text-primary" }), /* @__PURE__ */ E("span", {
|
|
332
|
+
className: "truncate text-xs font-medium text-text-primary",
|
|
333
|
+
children: t?.name ?? "AI Tool"
|
|
334
|
+
})]
|
|
335
|
+
}), /* @__PURE__ */ D("div", {
|
|
336
|
+
className: "flex shrink-0 items-center gap-1 text-xs text-text-secondary",
|
|
337
|
+
children: [/* @__PURE__ */ E(ie, { className: "h-3 w-3" }), /* @__PURE__ */ E("span", { children: r(e.createdAt, "relative") })]
|
|
338
|
+
})]
|
|
339
|
+
}),
|
|
340
|
+
/* @__PURE__ */ D("p", {
|
|
341
|
+
className: "line-clamp-1 text-xs text-text-secondary",
|
|
342
|
+
children: ["Prompt: ", n]
|
|
343
|
+
}),
|
|
344
|
+
/* @__PURE__ */ E("p", {
|
|
345
|
+
className: "mt-1 line-clamp-3 whitespace-pre-wrap text-sm text-text-primary",
|
|
346
|
+
children: i
|
|
347
|
+
}),
|
|
348
|
+
i !== "—" && /* @__PURE__ */ D("div", {
|
|
349
|
+
className: "mt-2 flex items-center gap-3",
|
|
350
|
+
children: [/* @__PURE__ */ E("button", {
|
|
351
|
+
type: "button",
|
|
352
|
+
onClick: () => void Q(o, i),
|
|
353
|
+
className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",
|
|
354
|
+
children: R === o ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(u, { className: "h-3 w-3" }), " Copied"] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(ae, { className: "h-3 w-3" }), " Copy"] })
|
|
355
|
+
}), /* @__PURE__ */ E("button", {
|
|
356
|
+
type: "button",
|
|
357
|
+
onClick: () => void $(o, i, t),
|
|
358
|
+
disabled: z === o || s,
|
|
359
|
+
className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline disabled:opacity-60",
|
|
360
|
+
children: z === o ? /* @__PURE__ */ D(T, { children: [
|
|
361
|
+
/* @__PURE__ */ E(h, { className: "h-3 w-3 animate-spin" }),
|
|
362
|
+
" ",
|
|
363
|
+
"Saving"
|
|
364
|
+
] }) : s ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(u, { className: "h-3 w-3" }), " Saved"] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(d, { className: "h-3 w-3" }), " Save as draft"] })
|
|
365
|
+
})]
|
|
366
|
+
})
|
|
367
|
+
]
|
|
368
|
+
}, e.id);
|
|
369
|
+
})
|
|
370
|
+
})] })]
|
|
371
|
+
}), /* @__PURE__ */ E("div", {
|
|
372
|
+
className: "lg:sticky lg:top-4 lg:self-start",
|
|
373
|
+
children: /* @__PURE__ */ D(pe, {
|
|
374
|
+
treatment: "glass",
|
|
375
|
+
glow: !0,
|
|
376
|
+
className: "p-5",
|
|
377
|
+
children: [
|
|
378
|
+
/* @__PURE__ */ D("div", {
|
|
379
|
+
className: "mb-4 flex items-center gap-2",
|
|
380
|
+
children: [/* @__PURE__ */ E("span", {
|
|
381
|
+
className: "flex h-8 w-8 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
382
|
+
children: /* @__PURE__ */ E(le, { className: "h-4 w-4" })
|
|
383
|
+
}), /* @__PURE__ */ D("div", {
|
|
384
|
+
className: "min-w-0",
|
|
385
|
+
children: [/* @__PURE__ */ E("h3", {
|
|
386
|
+
className: "truncate text-sm font-semibold text-text-primary",
|
|
387
|
+
children: Y ? Y.name : "AI Console"
|
|
388
|
+
}), Y && /* @__PURE__ */ E("p", {
|
|
389
|
+
className: "truncate text-xs text-text-secondary",
|
|
390
|
+
children: Y.provider
|
|
142
391
|
})]
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
392
|
+
})]
|
|
393
|
+
}),
|
|
394
|
+
/* @__PURE__ */ E("label", {
|
|
395
|
+
className: "mb-1.5 block text-xs font-medium text-text-secondary",
|
|
396
|
+
children: Y?.inputType === "url" ? "Page URL" : "Your prompt"
|
|
397
|
+
}),
|
|
398
|
+
/* @__PURE__ */ E(be, {
|
|
399
|
+
value: O,
|
|
400
|
+
onChange: (e) => k(e.target.value),
|
|
401
|
+
disabled: !Y?.isAvailable,
|
|
402
|
+
placeholder: Y?.inputType === "url" ? "https://your-website.com/page" : "Describe what you want to generate… (Enter to generate, Shift+Enter for a new line)",
|
|
403
|
+
rows: 4,
|
|
404
|
+
className: "min-h-[112px] resize-y",
|
|
405
|
+
onKeyDown: (e) => {
|
|
406
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Fe());
|
|
407
|
+
}
|
|
408
|
+
}),
|
|
409
|
+
/* @__PURE__ */ D("div", {
|
|
410
|
+
className: "mt-3 flex flex-col gap-2 sm:flex-row",
|
|
411
|
+
children: [X.length > 0 ? /* @__PURE__ */ D(he, {
|
|
412
|
+
value: Z,
|
|
413
|
+
onValueChange: M,
|
|
414
|
+
disabled: !Y?.isAvailable,
|
|
415
|
+
children: [/* @__PURE__ */ E(ve, {
|
|
416
|
+
"aria-label": "Model",
|
|
417
|
+
className: "h-11 flex-1",
|
|
418
|
+
children: /* @__PURE__ */ D("span", {
|
|
419
|
+
className: "flex items-center gap-2 truncate",
|
|
420
|
+
children: [/* @__PURE__ */ E(oe, { className: "h-4 w-4 shrink-0 text-text-muted" }), /* @__PURE__ */ E(ye, { placeholder: "Model" })]
|
|
163
421
|
})
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
className: "text-sm font-semibold text-text-primary",
|
|
176
|
-
children: W.name
|
|
177
|
-
})]
|
|
178
|
-
}), /* @__PURE__ */ T("div", {
|
|
179
|
-
className: "space-y-4",
|
|
180
|
-
children: [
|
|
181
|
-
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("label", {
|
|
182
|
-
className: "block text-sm font-medium text-text-primary mb-1",
|
|
183
|
-
children: W.inputType === "url" ? "Enter URL" : W.inputType === "data" ? "Describe your data" : "Enter your prompt"
|
|
184
|
-
}), /* @__PURE__ */ T("div", {
|
|
185
|
-
className: "flex flex-col gap-2 sm:flex-row",
|
|
186
|
-
children: [/* @__PURE__ */ w("input", {
|
|
187
|
-
type: W.inputType === "url" ? "url" : "text",
|
|
188
|
-
value: N,
|
|
189
|
-
onChange: (e) => P(e.target.value),
|
|
190
|
-
placeholder: W.inputType === "url" ? "https://your-website.com/page" : "Describe what you want to generate...",
|
|
191
|
-
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)]",
|
|
192
|
-
onKeyDown: (e) => {
|
|
193
|
-
e.key === "Enter" && G();
|
|
194
|
-
}
|
|
195
|
-
}), /* @__PURE__ */ w("button", {
|
|
422
|
+
}), /* @__PURE__ */ E(ge, { children: X.map((e) => /* @__PURE__ */ E(_e, {
|
|
423
|
+
value: e,
|
|
424
|
+
children: e
|
|
425
|
+
}, e)) })]
|
|
426
|
+
}) : /* @__PURE__ */ D("div", {
|
|
427
|
+
className: "flex h-11 flex-1 items-center gap-2 rounded-input border border-border-default bg-bg-surface px-3 text-sm text-text-secondary",
|
|
428
|
+
children: [/* @__PURE__ */ E(oe, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ E("span", {
|
|
429
|
+
className: "truncate",
|
|
430
|
+
children: Y?.provider ?? "Default model"
|
|
431
|
+
})]
|
|
432
|
+
}), /* @__PURE__ */ E("button", {
|
|
196
433
|
type: "button",
|
|
197
|
-
onClick: () => void
|
|
198
|
-
disabled:
|
|
199
|
-
className:
|
|
200
|
-
children:
|
|
434
|
+
onClick: () => void Fe(),
|
|
435
|
+
disabled: b || !O.trim() || !Y?.isAvailable,
|
|
436
|
+
className: n("inline-flex min-h-[44px] items-center justify-center gap-2 rounded-md px-5 text-sm font-semibold transition-colors sm:min-w-[132px]", b || !O.trim() || !Y?.isAvailable ? "cursor-not-allowed bg-bg-sunken text-text-secondary" : "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90"),
|
|
437
|
+
children: b ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(h, { className: "h-4 w-4 animate-spin" }), "Generating…"] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(ce, { className: "h-4 w-4" }), "Generate"] })
|
|
201
438
|
})]
|
|
202
|
-
})
|
|
203
|
-
|
|
439
|
+
}),
|
|
440
|
+
Ee && /* @__PURE__ */ E("div", {
|
|
204
441
|
role: "alert",
|
|
205
|
-
className: "rounded-md border border-status-error-border/30 bg-status-error-bg/10 px-
|
|
206
|
-
children:
|
|
442
|
+
className: "mt-3 rounded-md border border-status-error-border/30 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text",
|
|
443
|
+
children: Ee
|
|
207
444
|
}),
|
|
208
|
-
|
|
209
|
-
className: "
|
|
210
|
-
children: [
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
445
|
+
/* @__PURE__ */ D("div", {
|
|
446
|
+
className: "mt-4 overflow-hidden rounded-card border border-border-seam bg-bg-surface",
|
|
447
|
+
children: [
|
|
448
|
+
/* @__PURE__ */ D("div", {
|
|
449
|
+
className: "flex items-center justify-between border-b border-border-subtle px-3 py-2",
|
|
450
|
+
children: [/* @__PURE__ */ E("span", {
|
|
451
|
+
className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
|
|
452
|
+
children: "Generated"
|
|
453
|
+
}), /* @__PURE__ */ D("div", {
|
|
454
|
+
className: "flex items-center gap-1",
|
|
455
|
+
children: [/* @__PURE__ */ E("button", {
|
|
456
|
+
type: "button",
|
|
457
|
+
onClick: () => void Q("out-all", Ie),
|
|
458
|
+
disabled: N.length === 0,
|
|
459
|
+
className: "inline-flex min-h-[32px] items-center gap-1 rounded px-2 text-xs font-medium text-primary transition-colors hover:bg-bg-sunken disabled:opacity-40",
|
|
460
|
+
children: R === "out-all" ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(u, { className: "h-3.5 w-3.5" }), " Copied"] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(ae, { className: "h-3.5 w-3.5" }), " Copy"] })
|
|
461
|
+
}), /* @__PURE__ */ E("button", {
|
|
462
|
+
type: "button",
|
|
463
|
+
onClick: () => void $("out-all", Ie, Y),
|
|
464
|
+
disabled: N.length === 0 || z === "out-all" || V.has("out-all"),
|
|
465
|
+
className: "inline-flex min-h-[32px] items-center gap-1 rounded px-2 text-xs font-medium text-primary transition-colors hover:bg-bg-sunken disabled:opacity-40",
|
|
466
|
+
children: z === "out-all" ? /* @__PURE__ */ D(T, { children: [
|
|
467
|
+
/* @__PURE__ */ E(h, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
468
|
+
" ",
|
|
469
|
+
"Saving"
|
|
470
|
+
] }) : V.has("out-all") ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(u, { className: "h-3.5 w-3.5" }), " Saved"] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(d, { className: "h-3.5 w-3.5" }), " Insert"] })
|
|
471
|
+
})]
|
|
472
|
+
})]
|
|
473
|
+
}),
|
|
474
|
+
/* @__PURE__ */ E("div", {
|
|
475
|
+
className: "max-h-[340px] min-h-[148px] overflow-y-auto p-3",
|
|
476
|
+
children: b ? /* @__PURE__ */ D("div", {
|
|
477
|
+
className: "flex h-[124px] flex-col items-center justify-center gap-2 text-text-secondary",
|
|
478
|
+
children: [/* @__PURE__ */ E(h, { className: "h-5 w-5 animate-spin" }), /* @__PURE__ */ E("span", {
|
|
479
|
+
className: "text-xs",
|
|
480
|
+
children: "Generating your content…"
|
|
481
|
+
})]
|
|
482
|
+
}) : N.length === 0 ? /* @__PURE__ */ D("div", {
|
|
483
|
+
className: "flex h-[124px] flex-col items-center justify-center gap-2 text-center text-text-secondary",
|
|
484
|
+
children: [/* @__PURE__ */ E(S, { className: "h-5 w-5 opacity-60" }), /* @__PURE__ */ E("span", {
|
|
485
|
+
className: "text-xs",
|
|
486
|
+
children: "Your generated content will appear here."
|
|
487
|
+
})]
|
|
488
|
+
}) : /* @__PURE__ */ E("div", {
|
|
489
|
+
className: "space-y-3",
|
|
490
|
+
children: N.map((e, t) => {
|
|
491
|
+
let r = `out-${t}`;
|
|
492
|
+
return /* @__PURE__ */ D("div", {
|
|
493
|
+
className: n(N.length > 1 && "rounded-md border border-border-subtle bg-bg-sunken p-3"),
|
|
494
|
+
children: [N.length > 1 && /* @__PURE__ */ D("div", {
|
|
495
|
+
className: "mb-1.5 flex items-center justify-between",
|
|
496
|
+
children: [/* @__PURE__ */ D("span", {
|
|
497
|
+
className: "text-xs font-medium text-text-secondary",
|
|
498
|
+
children: ["Variation ", t + 1]
|
|
499
|
+
}), /* @__PURE__ */ D("div", {
|
|
500
|
+
className: "flex items-center gap-2",
|
|
501
|
+
children: [/* @__PURE__ */ E("button", {
|
|
502
|
+
type: "button",
|
|
503
|
+
onClick: () => void Q(r, e),
|
|
504
|
+
className: "text-xs font-medium text-primary hover:underline",
|
|
505
|
+
children: R === r ? "Copied" : "Copy"
|
|
506
|
+
}), /* @__PURE__ */ E("button", {
|
|
507
|
+
type: "button",
|
|
508
|
+
onClick: () => void $(r, e, Y),
|
|
509
|
+
disabled: z === r || V.has(r),
|
|
510
|
+
className: "text-xs font-medium text-primary hover:underline disabled:opacity-60",
|
|
511
|
+
children: z === r ? "Saving" : V.has(r) ? "Saved" : "Insert"
|
|
512
|
+
})]
|
|
513
|
+
})]
|
|
514
|
+
}), /* @__PURE__ */ E("p", {
|
|
515
|
+
className: "whitespace-pre-wrap text-sm text-text-primary",
|
|
516
|
+
children: e
|
|
517
|
+
})]
|
|
518
|
+
}, r);
|
|
519
|
+
})
|
|
520
|
+
})
|
|
521
|
+
}),
|
|
522
|
+
(F || U) && /* @__PURE__ */ D("div", {
|
|
523
|
+
className: "flex items-center justify-between gap-2 border-t border-border-subtle px-3 py-2 text-xs",
|
|
524
|
+
children: [F ? /* @__PURE__ */ D("span", {
|
|
525
|
+
className: "flex items-center gap-3 text-text-secondary",
|
|
526
|
+
children: [F.durationMs != null && /* @__PURE__ */ D("span", {
|
|
527
|
+
className: "flex items-center gap-1",
|
|
528
|
+
children: [
|
|
529
|
+
/* @__PURE__ */ E(ie, { className: "h-3 w-3" }),
|
|
530
|
+
(F.durationMs / 1e3).toFixed(1),
|
|
531
|
+
"s"
|
|
532
|
+
]
|
|
533
|
+
}), F.tokensUsed != null && /* @__PURE__ */ D("span", {
|
|
534
|
+
className: "flex items-center gap-1",
|
|
535
|
+
children: [
|
|
536
|
+
/* @__PURE__ */ E(ue, { className: "h-3 w-3" }),
|
|
537
|
+
i(F.tokensUsed),
|
|
538
|
+
" tokens"
|
|
539
|
+
]
|
|
540
|
+
})]
|
|
541
|
+
}) : /* @__PURE__ */ E("span", {}), U && /* @__PURE__ */ E("span", {
|
|
542
|
+
className: "text-status-error-text",
|
|
543
|
+
children: U
|
|
225
544
|
})]
|
|
226
545
|
})
|
|
227
|
-
|
|
546
|
+
]
|
|
547
|
+
}),
|
|
548
|
+
V.size > 0 && /* @__PURE__ */ D("button", {
|
|
549
|
+
type: "button",
|
|
550
|
+
onClick: () => _(se + "/content"),
|
|
551
|
+
className: "mt-3 inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",
|
|
552
|
+
children: [/* @__PURE__ */ E(d, { className: "h-3.5 w-3.5" }), "View saved drafts in Content"]
|
|
228
553
|
})
|
|
229
554
|
]
|
|
230
|
-
})]
|
|
231
|
-
}),
|
|
232
|
-
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h3", {
|
|
233
|
-
className: "text-sm font-semibold text-text-primary mb-3",
|
|
234
|
-
children: "Recent Generations"
|
|
235
|
-
}), H.length === 0 ? /* @__PURE__ */ w(i, {
|
|
236
|
-
illustration: "empty-generic",
|
|
237
|
-
title: "No generations yet",
|
|
238
|
-
description: "Run a tool above and your recent AI generations will show up here."
|
|
239
|
-
}) : /* @__PURE__ */ w("div", {
|
|
240
|
-
className: "space-y-3",
|
|
241
|
-
children: H.map((e) => {
|
|
242
|
-
let n = M(e.input)[0] ?? "—", r = M(e.output)[0] ?? "—";
|
|
243
|
-
return /* @__PURE__ */ T("div", {
|
|
244
|
-
className: "rounded-lg border border-border-seam bg-gloss-card shadow-pop p-4",
|
|
245
|
-
children: [
|
|
246
|
-
/* @__PURE__ */ T("div", {
|
|
247
|
-
className: "flex items-center justify-between mb-2",
|
|
248
|
-
children: [/* @__PURE__ */ T("div", {
|
|
249
|
-
className: "flex items-center gap-2",
|
|
250
|
-
children: [/* @__PURE__ */ w(_, { className: "h-3.5 w-3.5 text-primary" }), /* @__PURE__ */ w("span", {
|
|
251
|
-
className: "text-xs font-medium text-text-primary",
|
|
252
|
-
children: U.get(e.toolId) ?? "AI Tool"
|
|
253
|
-
})]
|
|
254
|
-
}), /* @__PURE__ */ T("div", {
|
|
255
|
-
className: "flex items-center gap-1 text-xs text-text-secondary",
|
|
256
|
-
children: [/* @__PURE__ */ w(l, { className: "h-3 w-3" }), /* @__PURE__ */ w("span", { children: t(e.createdAt, "relative") })]
|
|
257
|
-
})]
|
|
258
|
-
}),
|
|
259
|
-
/* @__PURE__ */ T("p", {
|
|
260
|
-
className: "text-xs text-text-secondary line-clamp-2",
|
|
261
|
-
children: ["Input: ", n]
|
|
262
|
-
}),
|
|
263
|
-
/* @__PURE__ */ w("p", {
|
|
264
|
-
className: "text-sm text-text-primary mt-1 line-clamp-3 whitespace-pre-wrap",
|
|
265
|
-
children: r
|
|
266
|
-
})
|
|
267
|
-
]
|
|
268
|
-
}, e.id);
|
|
269
555
|
})
|
|
270
|
-
})]
|
|
271
|
-
]
|
|
556
|
+
})]
|
|
557
|
+
})] })
|
|
272
558
|
})]
|
|
273
559
|
});
|
|
274
560
|
};
|
|
275
561
|
//#endregion
|
|
276
|
-
export {
|
|
562
|
+
export { M as AIToolsPage };
|
|
277
563
|
|
|
278
564
|
//# sourceMappingURL=AIToolsPage.js.map
|