1import{c as ae,r as g,k as te,a as $,l as J,j as e,B as u,x as M,D as A,an as ee,J as d,al as ne,t as T,a0 as ie,s as z,af as le,a6 as re,a7 as ce,a8 as de,a9 as oe,h as N,I as m,ap as me,aq as ue,ar as xe,as as pe,at as ge,X}from"./index-C4LWZPK9.js";import{T as he}from"./textarea-G6LYtFU8.js";import{T as je,a as ve,b as O,c as D,d as _e,e as f}from"./table-DCqWGOx9.js";import{P as ye}from"./pickaxe-C7vP9o-B.js";import{P as q}from"./plus-Nk5sUbpA.js";import{E as Ne}from"./eye-BuNnJwN2.js";import{E as be}from"./eye-off-cXKwYb2J.js";import{P as fe}from"./pencil-DiYrB8i9.js";import{U as we}from"./upload-CkiK-kaT.js";/** 2 * @license lucide-react v0.475.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Ce=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],F=ae("Link2",Ce),ke=["draft","active","paused","completed"],G={company_name:"",company_logo_url:"",industry:"",tagline:"",description:"",brand_color:"#FF6B35",website_url:"",status:"draft",quiz_questions:[],puzzle_image_url:"",reveal_image_url:"",memory_card_images:[],scramble_words:[],product_names:[],product_images:[],price_match_items:[],sort_order:0,featured:!1};function Y({label:a,value:i,onChange:j}){const[w,_]=g.useState(!1),r=g.useRef(),v=async c=>{if(!c)return;_(!0);const{file_url:C}=await N.integrations.Core.UploadFile({file:c});j(C),_(!1),T.success("Image uploaded!")};return e.jsxs("div",{children:[e.jsx(m,{children:a}),i?e.jsxs("div",{className:"mt-1 relative group w-32 h-32",children:[e.jsx("img",{src:i,alt:"",className:"w-32 h-32 object-cover rounded-lg border border-border"}),e.jsx("button",{type:"button",onClick:()=>j(""),className:"absolute -top-2 -right-2 w-5 h-5 bg-destructive text-white rounded-full flex items-center justify-center text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:"Ã"})]}):e.jsxs("div",{className:"mt-1 border-2 border-dashed border-border rounded-lg p-4 text-center cursor-pointer hover:border-primary transition-colors w-32 h-32 flex flex-col items-center justify-center",onClick:()=>{var c;return(c=r.current)==null?void 0:c.click()},children:[w?e.jsx("div",{className:"w-4 h-4 border-2 border-primary/30 border-t-primary rounded-full animate-spin"}):e.jsx(we,{className:"w-5 h-5 text-muted-foreground mb-1"}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Upload"})]}),e.jsx(d,{value:i,onChange:c=>j(c.target.value),placeholder:"Or paste URL",className:"mt-1 text-xs"}),e.jsx("input",{ref:r,type:"file",accept:"image/*",className:"hidden",onChange:c=>v(c.target.files[0])})]})}function Ie({form:a,setForm:i,onSubmit:j,onCancel:w,isPending:_}){var R,K,Q,B,W,H;const[r,v]=g.useState({question:"",options:["","","",""],correct_index:0}),[c,C]=g.useState(""),[U,l]=g.useState(""),[y,E]=g.useState(""),[k,S]=g.useState(""),[L,I]=g.useState(""),[x,P]=g.useState({name:"",image_url:"",price:""}),V=()=>{!r.question||!r.options.every(s=>s)||(i({...a,quiz_questions:[...a.quiz_questions||[],{...r}]}),v({question:"",options:["","","",""],correct_index:0}))},t=()=>{const s=c.trim();if(!s)return;const n={word:s,hint:U.trim()};i({...a,scramble_words:[...a.scramble_words||[],n]}),C(""),l("")},h=()=>{!x.name||!x.price||(i({...a,price_match_items:[...a.price_match_items||[],{name:x.name,image_url:x.image_url,price:Number(x.price)}]}),P({name:"",image_url:"",price:""}))},b=()=>{var n;const s=y.trim();s&&!((n=a.memory_card_images)!=null&&n.includes(s))&&(i({...a,memory_card_images:[...a.memory_card_images||[],s]}),E(""))};return e.jsxs("form",{onSubmit:s=>s.preventDefault(),children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"col-span-2",children:[e.jsx(m,{children:"Company Name *"}),e.jsx(d,{value:a.company_name,onChange:s=>i({...a,company_name:s.target.value})})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx(m,{children:"Tagline"}),e.jsx(d,{value:a.tagline,onChange:s=>i({...a,tagline:s.target.value}),placeholder:"Short brand tagline"})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx(m,{children:"Description"}),e.jsx(he,{value:a.description,onChange:s=>i({...a,description:s.target.value}),rows:2,placeholder:"What is this brand about?"})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Industry"}),e.jsx(d,{value:a.industry,onChange:s=>i({...a,industry:s.target.value}),placeholder:"e.g. mobile_gaming"})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Website URL"}),e.jsx(d,{value:a.website_url,onChange:s=>i({...a,website_url:s.target.value}),placeholder:"https://..."})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Brand Color"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"color",value:a.brand_color,onChange:s=>i({...a,brand_color:s.target.value}
6),className:"w-10 h-9 rounded border border-border cursor-pointer"}),e.jsx(d,{value:a.brand_color,onChange:s=>i({...a,brand_color:s.target.value}),className:"flex-1"})]})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Status"}),e.jsxs(me,{value:a.status,onValueChange:s=>i({...a,status:s}),children:[e.jsx(ue,{children:e.jsx(xe,{})}),e.jsx(pe,{children:ke.map(s=>e.jsx(ge,{value:s,className:"capitalize",children:s},s))})]})]})]}),e.jsx(Y,{label:"Company Logo",value:a.company_logo_url,onChange:s=>i({...a,company_logo_url:s})}),e.jsx(Y,{label:"Puzzle Image (for sliding puzzle game)",value:a.puzzle_image_url,onChange:s=>i({...a,puzzle_image_url:s})}),e.jsx(Y,{label:"Reveal Image (for Picture Reveal game)",value:a.reveal_image_url,onChange:s=>i({...a,reveal_image_url:s})}),e.jsxs("div",{children:[e.jsx(m,{children:"Product Names (used across all games)"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(d,{value:k,onChange:s=>S(s.target.value),placeholder:"Product name, press Enter",onKeyDown:s=>{var n;if(s.key==="Enter"){s.preventDefault();const o=k.trim();o&&!((n=a.product_names)!=null&&n.includes(o))&&(i({...a,product_names:[...a.product_names||[],o]}),S(""))}}}),e.jsx(u,{type:"button",variant:"outline",onClick:()=>{var n;const s=k.trim();s&&!((n=a.product_names)!=null&&n.includes(s))&&(i({...a,product_names:[...a.product_names||[],s]}),S(""))},children:e.jsx(q,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:(R=a.product_names)==null?void 0:R.map(s=>e.jsxs(z,{variant:"secondary",className:"cursor-pointer gap-1",onClick:()=>i({...a,product_names:a.product_names.filter(n=>n!==s)}),children:[s," Ã"]},s))})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Product Images (used across all games)"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(d,{value:L,onChange:s=>I(s.target.value),placeholder:"Image URL",onKeyDown:s=>{var n;if(s.key==="Enter"){s.preventDefault();const o=L.trim();o&&!((n=a.product_images)!=null&&n.includes(o))&&(i({...a,product_images:[...a.product_images||[],o]}),I(""))}}}),e.jsx(u,{type:"button",variant:"outline",onClick:()=>{var n;const s=L.trim();s&&!((n=a.product_images)!=null&&n.includes(s))&&(i({...a,product_images:[...a.product_images||[],s]}),I(""))},children:e.jsx(q,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:(K=a.product_images)==null?void 0:K.map((s,n)=>e.jsxs(z,{variant:"secondary",className:"cursor-pointer gap-1",onClick:()=>i({...a,product_images:a.product_images.filter((o,p)=>p!==n)}),children:[e.jsx("img",{src:s,alt:"",className:"w-4 h-4 rounded object-cover"})," Image ",n+1," Ã"]},n))}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Upload product images or paste URLs. Games use these automatically."})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Memory Match Images (up to 8)"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(d,{value:y,onChange:s=>E(s.target.value),placeholder:"Image URL",onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),b())}}),e.jsx(u,{type:"button",variant:"outline",onClick:b,children:e.jsx(q,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:(Q=a.memory_card_images)==null?void 0:Q.map((s,n)=>e.jsxs(z,{variant:"secondary",className:"cursor-pointer gap-1",onClick:()=>i({...a,memory_card_images:a.memory_card_images.filter((o,p)=>p!==n)}),children:[e.jsx("img",{src:s,alt:"",className:"w-4 h-4 rounded object-cover"})," Image ",n+1," Ã"]},n))})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Word Scramble Words (with hints)"}),e.jsxs("div",{className:"space-y-2 mt-1 p-3 rounded-lg bg-secondary/30",children:[e.jsx(d,{value:c,onChange:s=>C(s.target.value),placeholder:"Brand word (e.g. CAKE)",onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),t())}}),e.jsx(d,{value:U,onChange:s=>l(s.target.value),placeholder:"Hint/clue (e.g. 'Something you bake')",onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),t())}}),e.jsxs(u,{type:"button",size:"sm",variant:"outline",onClick:t,className:"gap-1",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Add Word"]})]}),((B=a.scramble_words)==null?void 0:B.length)>0&&e.jsx("div",{className:"space-y-1 mt-2",children:a.scramble_words.map((s,n)=>{const o=typeof s=="string"?s:s.word,p=typeof s=="string"?"":s.hint;return e.jsxs("div",{className:"flex items-center gap-2 text-sm p-2 rounded bg-secondary/20",children:[e.jsx("span",{className:"font-semibold",children:o}),p&&e.jsxs("span",{className:"text-muted-foreground text-xs truncate flex-1",children:["ð¡ ",p]}),e.jsx("button",{type:"button",onClick:()=>i({...a,scramble_words:a.scramble_words.filter((Z,se)=>se!==n)}),children:e.jsx(X,{className:"w-3.5 h-3.5 text-destructive"})})]},n)})})]}),e.jsxs("div",{children:[e.jsx(m,{children:"Price Match Products (name, image, price)"}),e.jsxs("div",{className:"space-y-2 mt-1 p-3 rounded-lg bg-secondary/30",children:[e.jsx(d,{value:x.name,onChange:s=>P({...x,name:s.target.value}),placeholder:"Product name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{value:x.image_url,onChange:s=>P({...x,image_url:s.target.value}),placeholder:"Image URL (optional)",className:"flex-1"}),e.jsx(d,{type:"number",step:"0.01",value:x.price,onChange:s=>P({...x,price:s.target.value}),placeholder:"$",className:"w-24"})]}),e.jsxs(u,{type:"button",size:"sm",variant:"outline",onClick:h,className:"gap-1",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Add Product"]})]}),((W=a.price_match_items)==null?void 0:W.length)>0&&e.jsx("div",{className:"space-y-1 mt-2",children:a.price_match_items.map((s,n)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm p-2 rounded bg-secondary/20",children:[s.image_url&&e.jsx("img",{src:s.image_url,alt:"",className:"w-6 h-6 rounded object-cover"}),e.jsx("span",{className:"flex-1 truncate",children:s.name}),e.jsxs(z,{variant:"secondary",className:"text-xs",children:["$",Number(s.price).toFixed(2)]}),e.jsx("button",{type:"button",onClick:()=>i({...a,price_match_items:a.price_match_items.filter((o,p)=>p!==n)}),children:e.jsx(X,{className:"w-3.5 h-3.5 text-destructive"})})]},n))}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Add at least 3 products with prices. Used in the Price Match guessing game."})]}
6),e.jsxs("div",{children:[e.jsx(m,{children:"Quiz Questions (leave empty to use defaults)"}),e.jsxs("div",{className:"space-y-2 mt-1 p-3 rounded-lg bg-secondary/30",children:[e.jsx(d,{value:r.question,onChange:s=>v({...r,question:s.target.value}),placeholder:"Question text"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:r.options.map((s,n)=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"radio",checked:r.correct_index===n,onChange:()=>v({...r,correct_index:n}),className:"shrink-0"}),e.jsx(d,{value:s,onChange:o=>v({...r,options:r.options.map((p,Z)=>Z===n?o.target.value:p)}),placeholder:`Option ${n+1}`,className:"text-sm"})]},n))}),e.jsxs(u,{type:"button",size:"sm",variant:"outline",onClick:V,className:"gap-1",children:[e.jsx(q,{className:"w-3.5 h-3.5"})," Add Question"]})]}),((H=a.quiz_questions)==null?void 0:H.length)>0&&e.jsx("div",{className:"space-y-1 mt-2",children:a.quiz_questions.map((s,n)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm p-2 rounded bg-secondary/20",children:[e.jsx("span",{className:"flex-1 truncate",children:s.question}),e.jsxs(z,{variant:"secondary",className:"text-xs",children:["Correct: ",String.fromCharCode(65+s.correct_index)]}),e.jsx("button",{type:"button",onClick:()=>i({...a,quiz_questions:a.quiz_questions.filter((o,p)=>p!==n)}),children:e.jsx(X,{className:"w-3.5 h-3.5 text-destructive"})})]},n))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{checked:!!a.featured,onCheckedChange:s=>i({...a,featured:s})}),e.jsx(m,{children:"Featured Campaign"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4 mt-2 border-t border-border",children:[e.jsx(u,{type:"button",variant:"outline",onClick:w,disabled:_,children:"Cancel"}),e.jsx(u,{type:"button",disabled:_,className:"bg-primary hover:bg-primary/90",onClick:j,children:_?"Savingâ¦":"Save Campaign"})]})]})}function Ee(){const[a,i]=g.useState(!1),[j,w]=g.useState(null),[_,r]=g.useState(G),v=te(),{data:c=[],isLoading:C}=$({queryKey:["admin-ad-mining-campaigns"],queryFn:()=>N.entities.AdMiningCampaign.list("-created_date",100)}),{data:U=[]}=$({queryKey:["admin-ad-mining-sessions"],queryFn:()=>N.entities.AdMiningSession.list("-created_date",200)}),{data:l}=$({queryKey:["app-settings"],queryFn:()=>N.entities.AppSettings.filter({key:"global"}).then(t=>t[0]||{})}),y=J({mutationFn:async t=>{const h=l!=null&&l.id?l:await N.entities.AppSettings.create({key:"global",ad_mining_enabled:!1});return N.entities.AppSettings.update(h.id,t)},onSuccess:()=>{v.invalidateQueries({queryKey:["app-settings"]}),T.success("Settings updated")}}),E=()=>{const t="ABCDEFGHJKLMNPQRSTUVWXYZ23456789";let h="";for(let b=0;b<12;b++)h+=t[Math.floor(Math.random()*t.length)];return h},k=l!=null&&l.ad_mining_preview_token?`${window.location.origin}/ad-mining?preview=${l.ad_mining_preview_token}`:null,S=J({mutationFn:t=>{const h={...t,sort_order:Number(t.sort_order)||0};return j?N.entities.AdMiningCampaign.update(j.id,h):N.entities.AdMiningCampaign.create(h)},onSuccess:()=>{v.invalidateQueries({queryKey:["admin-ad-mining-campaigns"]}),T.success(j?"Campaign updated":"Campaign created!"),I()},onError:()=>T.error("Failed to save. Please try again.")}),L=J({mutationFn:t=>N.entities.AdMiningCampaign.delete(t),onSuccess:()=>{v.invalidateQueries({queryKey:["admin-ad-mining-campaigns"]}),T.success("Deleted")}}),I=()=>{i(!1),w(null),r(G)},x=t=>{w(t),r({...G,...t}),i(!0)},P=U.filter(t=>!t.completed&&new Date(t.week_end_date)>new Date),V=U.filter(t=>t.completed);return e.jsxs("div",{className:"min-w-0 max-w-full overflow-x-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ye,{className:"w-6 h-6 text-primary"}),e.jsx("h1",{className:"text-2xl font-display font-bold",children:"Ad Mining Manager"})]}),e.jsxs(u,{className:"gap-2 bg-primary hover:bg-primary/90",onClick:()=>{r(G),w(null),i(!0)},children:[e.jsx(q,{className:"w-4 h-4"})," New Campaign"]})]}),e.jsx(M,{className:"bg-secondary/30 mb-6 border-primary/20",children:e.jsxs(A,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[l!=null&&l.ad_mining_enabled?e.jsx(Ne,{className:"w-5 h-5 text-accent"}):e.jsx(be,{className:"w-5 h-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-sm",children:"Ad Mining Visibility"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:l!=null&&l.ad_mining_enabled?"Visible to all users in navigation":"Hidden from users â preview link still works for companies"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:l!=null&&l.ad_mining_enabled?"On":"Off"}),e.jsx(ee,{checked:!!(l!=null&&l.ad_mining_enabled),onCheckedChange:t=>y.mutate({ad_mining_enabled:t}),disabled:y.isPending})]})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(F,{className:"w-4 h-4 text-primary"}),e.jsx("p",{className:"text-sm font-medium",children:"Goby TV Ad Mining â Preview Link"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Share this link with companies so they can view Ad Mining even when it's turned off."}),k?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(d,{readOnly:!0,value:k,className:"text-xs flex-1 font-mono",onClick:t=>t.target.select()}),e.jsxs(u,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:()=>{var t;(t=navigator.clipboard)==null||t.writeText(k),T.success("Preview link copied!")},children:[e.jsx(ne,{className:"w-3.5 h-3.5"})," Copy"]}),e.jsx(u,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>y.mutate({ad_mining_preview_token:E()}),disabled:y.isPending,children:"Regenerate"})]}):e.jsxs(u,{variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>y.mutate({ad_mining_preview_token:E()}),disabled:y.isPending,children:[e.jsx(F,{className:"w-3.5 h-3.5"})," Generate Preview Link"]})]})]})}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6",children:[e.jsx(M,{className:"bg-secondary/30",children:e.jsxs(A,{className:"p-4",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Campaigns"}),e.jsx("p",{className:"text-2xl font-bold mt-1",children:c.length})]})}),e.jsx(M,{className:"bg-secondary/30",children:e.jsxs(A,{className:"p-4",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Active"}),e.jsx("p",{className:"text-2xl font-bold mt-1 text-accent",children:c.filter(t=>t.status==="active").length})]})}),e.jsx(M,{className:"bg-secondary/30",children:e.jsxs(A,{className:"p-4",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Active Miners"}),e.jsx("p",{className:"text-2xl font-bold mt-1",children:P.length})]})}),e.jsx(M,{className:"bg-secondary/30",children:e.jsxs(A,{className:"p-4",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Completed"}),e.jsx("p",{className:"text-2xl font-bold mt-1 text-green-500",children:V.length})]})})]}),e.jsx(M,{className:"bg-secondary/30",children:e.jsx(A,{className:"p-0",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(je,{children:[e.jsx(ve,{children:e.jsxs(O,{children:[e.jsx(D,{children:"Company"}),e.jsx(D,{children:"Industry"}),e.jsx(D,{children:"Brand Color"}),e.jsx(D,{children:"Games Configured"}),e.jsx(D,{children:"Status"}),e.jsx(D,{className:"text-right",children:"Actions"})]})}),e.jsxs(_e,{children:[C&&e.jsx(O,{children:e.jsx(f,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"Loadingâ¦"})}),c.map(t=>{var b,R,K,Q,B,W;const h=[t.company_logo_url?1:0,((b=t.product_names)==null?void 0:b.length)>=3?1:0,((R=t.product_images)==null?void 0:R.length)>=2?1:0,t.puzzle_image_url?1:0,t.reveal_image_url?1:0,((K=t.quiz_questions)==null?void 0:K.length)>=3?1:0,((Q=t.memory_card_images)==null?void 0:Q.length)>=4?1:0,((B=t.scramble_words)==null?void 0:B.length)>=3?1:0,((W=t.price_match_items)==null?void 0:W.length)>=3?1:0].reduce((H,s)=>H+s,0);return e.jsxs(O,{children:[e.jsx(f,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[t.company_logo_url?e.jsx("img",{src:t.company_logo_url,alt:"",className:"w-8 h-8 rounded-lg object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-lg bg-secondary flex items-center justify-center",children:e.jsx(ie,{className:"w-4 h-4 text-muted-foreground"})}),e.jsx("span",{className:"font-medium text-sm",children:t.company_name})]})}),e.jsx(f,{className:"text-sm text-muted-foreground",children:t.industry||"â"}),e.jsx(f,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-4 h-4 rounded",style:{background:t.brand_color||"#FF6B35"}}),e.jsx("span",{className:"text-xs text-muted-foreground",children:t.brand_color||"#FF6B35"})]})}),e.jsx(f,{children:e.jsxs(z,{variant:"secondary",className:"text-xs",children:[h,"/9"]})}),e.jsx(f,{children:e.jsx(z,{className:`text-xs ${t.status==="active"?"bg-accent/20 text-accent":t.status==="draft"?"bg-muted":"bg-yellow-500/20 text-yellow-400"}`,children:t.status})}),e.jsx(f,{className:"text-right",children:e.jsxs("div",{className:"flex justify-end gap-1",children:[e.jsx(u,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>x(t),children:e.jsx(fe,{className:"w-3.5 h-3.5"})}),e.jsx(u,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:()=>{confirm("Delete this campaign?")&&L.mutate(t.id)},children:e.jsx(le,{className:"w-3.5 h-3.5"})})]})})]},t.id)}),!C&&c.length===0&&e.jsx(O,{children:e.jsx(f,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"No campaigns yet. Create one to get started!"})})]})]})})})}),e.jsx(re,{open:a,onOpenChange:t=>{t||I()},children:e.jsxs(ce,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsx(de,{children:e.jsx(oe,{className:"font-display",children:j?"Edit Campaign":"New Ad Mining Campaign"})}),e.jsx(Ie,{form:_,setForm:r,onSubmit:()=>S.mutate(_),onCancel:I,isPending:S.isPending})]})})]})}export{Ee as default};
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.