PageSourceSearch

https://app.makebox.ai/_next/static/chunks/9030.dbb84428b83392c6.js

js makebox.ai collected 2026-09-24 14:30:25 UTC 18,511 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9030],{49030:(e,s,t)=>{t.r(s),t.d(s,{default:()=>x});var a=t(74470),l=t(88166);let r=[["facebook_group","\uD83D\uDCD8 FB group"],["telegram_group","✈️ TG group"],["telegram_channel","\uD83D\uDCE3 TG channel"],["reddit","\uD83D\uDC7D Reddit"],["forum","\uD83C\uDF10 Forum"]],n=["new","email_queued","email_sent","replied","converted","rejected","unsubscribed"],d=["new","reviewing","joined","posting","banned","rejected"],o=e=>{var s;return(null==(s=r.find(s=>{let[t]=s;return t===e}))?void 0:s[1])||e},c={stone:"border-stone-200",leaf:"border-leaf-300",amber:"border-amber-300"};function i(e){let{label:s,value:t,tone:l="stone"}=e;return(0,a.jsxs)("div",{className:"rounded-xl border ".concat(c[l]||c.stone," bg-white p-4"),children:[(0,a.jsx)("div",{className:"text-2xl font-bold text-stone-800",children:"number"==typeof t?t.toLocaleString():t}),(0,a.jsx)("div",{className:"mt-0.5 text-xs font-medium text-stone-500",children:s})]})}function x(){let[e,s]=(0,l.useState)("overview");return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("a",{href:"/adminconsole/sales",className:"flex items-center justify-between rounded-xl bg-stone-900 px-5 py-4 text-white hover:bg-stone-800",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("b",{className:"block text-base",children:"MakeBox Sales Studio"}),(0,a.jsx)("span",{className:"text-xs text-stone-300",children:"Контент-план \xb7 правила груп \xb7 запити клієнтів \xb7 автономний воркер"})]}),(0,a.jsx)("span",{className:"text-sm text-orange-300",children:"Відкрити →"})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-amber-200 bg-amber-50 p-3 text-sm text-amber-900",children:["\uD83D\uDE80 ",(0,a.jsx)("b",{children:"Growth Hub"})," — центр просування застосунку: база продавців Etsy для аутрічу, знайдені FB/Telegram групи й канали з їхніми правилами, конкуренти й готові email-шаблони. Дані на GoDaddy (лише адмін)."]}),(0,a.jsx)("div",{className:"flex gap-1 border-b border-stone-200",children:[["overview","Огляд"],["leads","\uD83D\uDCC7 Leads"],["channels","\uD83D\uDCE2 Канали / групи"],["strategy","\uD83C\uDFAF Стратегія"]].map(t=>{let[l,r]=t;return(0,a.jsx)("button",{onClick:()=>s(l),className:"-mb-px border-b-2 px-4 py-2 text-sm font-medium ".concat(e===l?"border-leaf-600 text-leaf-700":"border-transparent text-stone-500 hover:text-stone-700"),children:r},l)})}),"overview"===e&&(0,a.jsx)(h,{}),"leads"===e&&(0,a.jsx)(p,{}),"channels"===e&&(0,a.jsx)(u,{}),"strategy"===e&&(0,a.jsx)(m,{})]})}function m(){let[e,s]=(0,l.useState)([]),[t,r]=(0,l.useState)([]),[n,d]=(0,l.useState)(null),[o,c]=(0,l.useState)("");if((0,l.useEffect)(()=>{fetch("/api/admin/growth/assets",{cache:"no-store"}).then(e=>e.json()).then(e=>{e.error?d(e.detail||e.error):(s(e.competitors||[]),r(e.sequences||[]))}).catch(()=>d("network"))},[]),n)return(0,a.jsxs)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:["Growth DB: ",n]});let i=Array.from(new Set(t.map(e=>e.product_name).filter(Boolean))),x=o?t.filter(e=>e.product_name===o):t;return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-2 text-sm font-semibold text-stone-700",children:["Конкуренти (",e.length,") — як обходимо"]}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[e.map(e=>(0,a.jsxs)("div",{className:"rounded-xl border border-stone-200 bg-white p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("a",{href:e.url||"#",target:"_blank",rel:"noreferrer",className:"font-semibold text-leaf-700 hover:underline",children:e.name}),(0,a.jsx)("span",{className:"text-xs text-stone-400",children:e.estimated_users?"".concat(e.estimated_users.toLocaleString()," users"):""})]}),e.pricing&&(0,a.jsx)("div",{className:"mt-0.5 text-xs text-stone-500",children:e.pricing}),e.our_advantage&&(0,a.jsxs)("p",{className:"mt-2 text-xs text-stone-700",children:[(0,a.jsx)("b",{className:"text-leaf-700",children:"Наша перевага:"})," ",e.our_advantage]}),e.steal_strategy&&(0,a.jsxs)("p",{className:"mt-1 text-xs text-stone-600",children:[(0,a.jsx)("b",{className:"text-amber-700",children:"Стратегія:"})," ",e.steal_strategy]})]},e.id)),!e.length&&(0,a.jsx)("div",{className:"text-sm text-stone-400",children:"Немає даних"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-3",children:[(0,a.jsxs)("span",{className:"text-sm font-semibold text-stone-700",children:["Email-шаблони (",t.length,")"]}),(0,a.jsxs)("select",{value:o,onChange:e=>c(e.target.value),className:"rounded-lg border border-stone-300 px-2 py-1 text-sm",children:[(0,a.jsx)("option",{value:"",children:"Всі продукти"}),i.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[x.map(e=>(0,a.jsxs)("details",{className:"rounded-xl border border-stone-200 bg-white p-3",children:[(0,a.jsxs)("summary",{className:"cursor-pointer text-sm font-medium text-stone-700",children:[(0,a.jsxs)("span",{className:"text-stone-400",children:[e.product_name," \xb7 крок ",e.step,e.delay_days?" (+".concat(e.delay_days,"д)"):""," — "]}),e.subject_template]}),e.target_persona&&(0,a.jsxs)("p",{className:"mt-2 text-xs text-stone-500",children:[(0,a.jsx)("b",{children:"Персона:"})," ",e.target_persona]}),(0,a.jsx)("pre",{className:"mt-2 whitespace-pre-wrap rounded-lg bg-stone-50 p-3 text-xs text-stone-700",children:e.body_template})]},e.id)),!x.length&&(0,a.jsx)("div",{className:"text-sm text-stone-400",children:"Немає шаблонів"})]})]})]})}function h(){let[e,s]=(0,l.useState)(null),[t,r]=(0,l.useState)(null);return((0,l.useEffect)(()=>{fetch("/api/admin/growth/overview",{cache:"no-store"}).then(e=>e.json()).then(e=>{e.error?r(e.detail||e.error):s(e)}).catch(()=>r("network"))},[]),t)?(0,a.jsxs)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:["Growth DB: ",t]}):e?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,a.jsx)(i,{label:"Leads всього",value:e.leads_total,tone:"leaf"}
1),(0,a.jsx)(i,{label:"З email",value:e.leads_with_email,tone:"leaf"}),(0,a.jsx)(i,{label:"Нові (не чіпані)",value:e.leads_new}),(0,a.jsx)(i,{label:"Контактовані",value:e.leads_contacted})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,a.jsx)(i,{label:"Каналів / груп",value:e.channels_total,tone:"amber"}),(0,a.jsx)(i,{label:"Дозволяють пост",value:e.channels_postable,tone:"amber"}),(0,a.jsx)(i,{label:"Подій (аутріч)",value:e.events_total}),(0,a.jsx)(i,{label:"Платформ",value:e.channels_by_platform.length})]}),e.channels_by_platform.length>0&&(0,a.jsxs)("div",{className:"rounded-xl border border-stone-200 bg-white p-4",children:[(0,a.jsx)("div",{className:"mb-2 text-sm font-semibold text-stone-700",children:"Канали за платформою"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:e.channels_by_platform.map(e=>(0,a.jsxs)("span",{className:"rounded-full bg-stone-100 px-3 py-1 text-xs font-medium text-stone-700",children:[o(e.platform)," \xb7 ",e.n]},e.platform))})]}),e.top_niches.length>0&&(0,a.jsxs)("div",{className:"rounded-xl border border-stone-200 bg-white p-4",children:[(0,a.jsx)("div",{className:"mb-2 text-sm font-semibold text-stone-700",children:"Топ ніш у базі leads"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:e.top_niches.map(e=>(0,a.jsxs)("span",{className:"rounded-full bg-leaf-50 px-3 py-1 text-xs font-medium text-leaf-700",children:[e.niche," \xb7 ",e.n]},e.niche))})]})]}):(0,a.jsx)("div",{className:"p-6 text-stone-500",children:"Завантаження…"})}function p(){let[e,s]=(0,l.useState)([]),[t,r]=(0,l.useState)(0),[d,o]=(0,l.useState)(""),[c,i]=(0,l.useState)(""),[x,m]=(0,l.useState)(""),[h,p]=(0,l.useState)(0),[u,j]=(0,l.useState)(!1),b=(0,l.useCallback)(()=>{j(!0);let e=new URLSearchParams({limit:String(50),offset:String(h),hasEmail:"1"});d&&e.set("q",d),c&&e.set("status",c),x&&e.set("niche",x),fetch("/api/admin/growth/leads?".concat(e),{cache:"no-store"}).then(e=>e.json()).then(e=>{s(e.rows||[]),r(e.total||0)}).finally(()=>j(!1))},[d,c,x,h]);(0,l.useEffect)(()=>{b()},[b]);let g=async(e,t)=>{s(s=>s.map(s=>s.id===e?{...s,status:t}:s)),await fetch("/api/admin/growth/leads",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,status:t,markContacted:"email_sent"===t})})};return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("input",{value:d,onChange:e=>{p(0),o(e.target.value)},placeholder:"Пошук: магазин / email / URL",className:"w-64 rounded-lg border border-stone-300 px-3 py-1.5 text-sm"}),(0,a.jsxs)("select",{value:c,onChange:e=>{p(0),i(e.target.value)},className:"rounded-lg border border-stone-300 px-2 py-1.5 text-sm",children:[(0,a.jsx)("option",{value:"",children:"Статус: всі"}),n.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsx)("input",{value:x,onChange:e=>{p(0),m(e.target.value)},placeholder:"Ніша",className:"w-36 rounded-lg border border-stone-300 px-3 py-1.5 text-sm"}),(0,a.jsx)("span",{className:"text-sm text-stone-500",children:u?"…":"".concat(t.toLocaleString()," leads")})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-stone-200",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-stone-50 text-left text-xs text-stone-500",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2",children:"Магазин"}),(0,a.jsx)("th",{className:"px-3 py-2",children:"Email"}),(0,a.jsx)("th",{className:"px-3 py-2",children:"Ніша"}),(0,a.jsx)("th",{className:"px-3 py-2",children:"Локація"}),(0,a.jsx)("th",{className:"px-3 py-2",children:"Статус"})]})}),(0,a.jsxs)("tbody",{children:[e.map(e=>(0,a.jsxs)("tr",{className:"border-t border-stone-100 hover:bg-stone-50",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:e.shop_url?(0,a.jsx)("a",{href:e.shop_url,target:"_blank",rel:"noreferrer",className:"font-medium text-leaf-700 hover:underline",children:e.shop_name||e.shop_url}):e.shop_name||"—"}),(0,a.jsx)("td",{className:"px-3 py-2",children:e.email?(0,a.jsxs)("button",{onClick:()=>navigator.clipboard.writeText(e.email),title:"Скопіювати",className:"text-stone-700 hover:text-leaf-700",children:[e.email," ⧉"]}):"—"}),(0,a.jsx)("td",{className:"px-3 py-2 text-stone-600",children:e.niche||"—"}),(0,a.jsx)("td",{className:"px-3 py-2 text-stone-600",children:e.location||"—"}),(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("select",{value:e.status||"new",onChange:s=>g(e.id,s.target.value),className:"rounded border border-stone-300 px-1.5 py-1 text-xs",children:n.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})})]},e.id)),!e.length&&!u&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:5,className:"px-3 py-8 text-center text-stone-400",children:"Нічого не знайдено"})})]})]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,a.jsx)("button",{disabled:0===
1h,onClick:()=>p(Math.max(0,h-50)),className:"rounded-lg border border-stone-300 px-3 py-1 disabled:opacity-40",children:"← Назад"}),(0,a.jsxs)("span",{className:"text-stone-500",children:[h+1,"–",Math.min(h+50,t)," з ",t.toLocaleString()]}),(0,a.jsx)("button",{disabled:h+50>=t,onClick:()=>p(h+50),className:"rounded-lg border border-stone-300 px-3 py-1 disabled:opacity-40",children:"Далі →"})]})]})}function u(){let[e,s]=(0,l.useState)([]),[t,n]=(0,l.useState)(""),[c,i]=(0,l.useState)(""),[x,m]=(0,l.useState)(!1),h=(0,l.useCallback)(()=>{m(!0);let e=new URLSearchParams;t&&e.set("platform",t),c&&e.set("status",c),fetch("/api/admin/growth/channels?".concat(e),{cache:"no-store"}).then(e=>e.json()).then(e=>s(e.rows||[])).finally(()=>m(!1))},[t,c]);(0,l.useEffect)(()=>{h()},[h]);let[p,u]=(0,l.useState)("facebook_group"),[j,b]=(0,l.useState)(""),[g,v]=(0,l.useState)("en"),[N,f]=(0,l.useState)("etsy sellers"),[y,w]=(0,l.useState)(!1),[_,S]=(0,l.useState)(null),C=async()=>{let e=j.split(/[\n,]+/).map(e=>e.trim()).filter(Boolean);if(!e.length)return;w(!0),S(null);let s=e.map(e=>({platform:p,url:/^https?:\/\//.test(e)?e:null,name:/^https?:\/\//.test(e)?null:e,language:g,topic:N,discovered_via:"manual"})),t=await fetch("/api/admin/growth/channels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channels:s})}).then(e=>e.json()).catch(()=>({}));w(!1),S(t.ok?"Додано/оновлено: ".concat(t.added):t.error||"помилка"),b(""),h()},k=async(e,t)=>{s(s=>s.map(s=>s.id===e?{...s,...t}:s)),await fetch("/api/admin/growth/channels",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...t})})};return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-stone-200 bg-white p-4",children:[(0,a.jsx)("div",{className:"mb-2 text-sm font-semibold text-stone-700",children:"➕ Додати канали / групи (по одному URL на рядок)"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("select",{value:p,onChange:e=>u(e.target.value),className:"rounded-lg border border-stone-300 px-2 py-1.5 text-sm",children:r.map(e=>{let[s,t]=e;return(0,a.jsx)("option",{value:s,children:t},s)})}),(0,a.jsx)("input",{value:g,onChange:e=>v(e.target.value),placeholder:"мова (en/uk/ru/es)",className:"w-32 rounded-lg border border-stone-300 px-3 py-1.5 text-sm"}),(0,a.jsx)("input",{value:N,onChange:e=>f(e.target.value),placeholder:"тема",className:"w-44 rounded-lg border border-stone-300 px-3 py-1.5 text-sm"})]}),(0,a.jsx)("textarea",{value:j,onChange:e=>b(e.target.value),rows:3,placeholder:"https://facebook.com/groups/etsysellers\nhttps://t.me/etsy_sellers",className:"mt-2 w-full rounded-lg border border-stone-300 px-3 py-2 text-sm"}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-3",children:[(0,a.jsx)("button",{onClick:C,disabled:y,className:"rounded-lg bg-leaf-600 px-4 py-1.5 text-sm font-medium text-white disabled:opacity-50",children:y?"…":"Додати"}),_&&(0,a.jsx)("span",{className:"text-sm text-stone-600",children:_})]}),(0,a.jsx)("p",{className:"mt-2 text-xs text-stone-400",children:"Автопошук FB/Telegram груп за темою й мовою — наступний крок; зараз додаємо вручну, а хаб веде статуси, правила й \xabможна постити\xbb."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:t,onChange:e=>n(e.target.value),className:"rounded-lg border border-stone-300 px-2 py-1.5 text-sm",children:[(0,a.jsx)("option",{value:"",children:"Платформа: всі"}),r.map(e=>{let[s,t]=e;return(0,a.jsx)("option",{value:s,children:t},s)})]}),(0,a.jsxs)("select",{value:c,onChange:e=>i(e.target.value),className:"rounded-lg border border-stone-300 px-2 py-1.5 text-sm",children:[(0,a.jsx)("option",{value:"",children:"Статус: всі"}),d.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsx)("span",{className:"text-sm text-stone-500",children:x?"…":"".concat(e.length," каналів")})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-stone-200",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-stone-50 text-left text-xs text-stone-500",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2",children:"Канал"}),(0,a.jsx)("th",{className:"px-3 py-2",children:"Платформа"}),(0,a.jsx)("th",{className:"px-3 py-2",children:"Мова"}),(0,a.jsx)("th",{className:"px-3 py-2",children:"Учасників"}),(0,a.jsx)("th",{className:"px-3 py-2",children:"Пост?"}),(0,a.jsx)("th",{className:"px-3 py-2",children:"Статус"}),(0,a.jsx)("th",{className:"px-3 py-2",children:"Правила"})]})}),(0,a.jsxs)("tbody",{children:[e.map(e=>{var s;return(0,a.jsxs)("tr",{className:"border-t border-stone-100 align-top hover:bg-stone-50",children:[(0,a.jsxs)("td",{className:"px-3 py-2 max-w-[240px]",children:[e.url?(0,a.jsx)("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"font-medium text-leaf-700 hover:underline",children:e.name||e.url}):e.name||"—",e.topic&&(0,a.jsx)("div",{className:"text-xs text-stone-400",children:e.topic})]}),(0,a.jsx)("td",{className:"px-3 py-2 text-stone-600",children:o(e.platform)}),(0,a.jsx)("td",{className:"px-3 py-2 text-stone-600",children:e.language||"—"}),(0,a.jsx)("td",{className:"px-3 py-2 text-stone-600",children:(null==(s=e.members)?void 0:s.toLocaleStr
1ing())||"—"}),(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsxs)("select",{value:null==e.can_post?"":e.can_post?"1":"0",onChange:s=>k(e.id,{can_post:""===s.target.value?null:"1"===s.target.value}),className:"rounded border border-stone-300 px-1.5 py-1 text-xs",children:[(0,a.jsx)("option",{value:"",children:"?"}),(0,a.jsx)("option",{value:"1",children:"✅ так"}),(0,a.jsx)("option",{value:"0",children:"\uD83D\uDEAB ні"})]})}),(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("select",{value:e.status,onChange:s=>k(e.id,{status:s.target.value}),className:"rounded border border-stone-300 px-1.5 py-1 text-xs",children:d.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})}),(0,a.jsx)("td",{className:"px-3 py-2 max-w-[220px]",children:(0,a.jsx)("input",{defaultValue:e.rules||"",onBlur:s=>{s.target.value!==(e.rules||"")&&k(e.id,{rules:s.target.value})},placeholder:"правила…",className:"w-full rounded border border-stone-200 px-2 py-1 text-xs"})})]},e.id)}),!e.length&&!x&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:7,className:"px-3 py-8 text-center text-stone-400",children:"Ще немає каналів — додай вручну вгорі"})})]})]})})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.