PageSourceSearch

https://app.xlift.ai/assets/BaitPage-WyrGqjga.js

js xlift.ai collected 2026-10-05 13:20:51 UTC 16,034 bytes, 1 lines download raw bytes

1import{ai as Fe,o as n,A as P,al as D,a4 as R,an as Ne,a5 as Re,U as p,j as e,aM as Qe,C as v,G as c,aB as ze,$ as Ue,T as r,X as q,D as O,I as X,E as m,W as E,a7 as $e,F as K,ao as Ge,Z as Ie,L as F,K as H}from"./index-dE8a1mPK.js";import{E as Ke}from"./ErrorState-gVNyx0--.js";import{E as He}from"./EmptyState-BpgfYYCq.js";import{I as Te}from"./IconPlus-B47PY1MC.js";import{S as Le}from"./SegmentedControl-CNEtbfTu.js";import{I as Oe}from"./IconExternalLink-DcQXcLz7.js";import{I as Ee}from"./IconArrowRight-Ajq43paw.js";import{I as Xe}from"./IconAlertCircle-CMVlR14T.js";import{S as V}from"./Switch-Bm85N10X.js";import{I as Ve}from"./IconDownload-CbNmsJhq.js";import{I as Ze}from"./IconTrash-DIXYcrq7.js";import{S as M}from"./Select-DebRlW67.js";import{T as qe}from"./Textarea-BtbUvWWM.js";import{N as T}from"./NumberInput-EbCp_odp.js";import"./IconCopy-B63sUmw8.js";import"./Code-YtMEZkZ5.js";import"./get-env-uyVen0u2.js";import"./InputsGroupFieldset-C0syow2C.js";import"./OptionsDropdown-wonErrz5.js";import"./CheckIcon-DkMc45y2.js";function yt(){var l,S;const a=Fe(),[b,g]=n.useState(!1),[A,i]=n.useState("live"),f=P({queryKey:["baits"],queryFn:()=>p.listBaits()}),k=P({queryKey:["lists"],queryFn:()=>p.listLists()}),x=D({mutationFn:s=>p.refreshBait(s),onSuccess:(s,o)=>{s.skipped?Ne(`Skipped: ${s.skipped}`):Re(`Piped ${s.added??0} new engager(s). ${s.totalAdded??0} total added.`),a.invalidateQueries({queryKey:["baits"]}),a.invalidateQueries({queryKey:["lists"]})},onError:s=>R(s)}),j=D({mutationFn:s=>p.removeBait(s),onSuccess:()=>a.invalidateQueries({queryKey:["baits"]}),onError:s=>R(s)}),y=D({mutationFn:({id:s,patch:o})=>p.updateBait(s,o),onSuccess:()=>a.invalidateQueries({queryKey:["baits"]}),onError:s=>R(s)});if(f.isLoading)return e.jsx(Qe,{});if(f.error)return e.jsx(Ke,{error:f.error,onRetry:()=>f.refetch()});const d=((l=f.data)==null?void 0:l.baits)||[],w=d.filter(s=>{const u=s.expiresAt&&s.expiresAt<Date.now()||!s.enabled;return A==="live"?!u:u}),h=d.filter(s=>!(s.expiresAt&&s.expiresAt<Date.now())&&s.enabled).length,C=d.length-h;return e.jsxs(v,{gap:"md",children:[e.jsxs(c,{justify:"space-between",align:"flex-start",children:[e.jsxs(v,{gap:2,children:[e.jsxs(c,{gap:"xs",children:[e.jsx(ze,{size:22}),e.jsx(Ue,{order:2,children:"Bait campaigns"})]}),e.jsxs(r,{c:"dimmed",size:"sm",maw:720,children:["Paste a tweet of yours that's designed to bait the right audience into replying. The worker polls every few hours, pipes new repliers into a list. Wire a Sequence campaign at that same list to close the loop end-to-end:",e.jsx("br",{}),e.jsx("b",{children:"tweet → engagers → list → sequence → pipeline."})]})]}),e.jsx(q,{leftSection:e.jsx(Te,{size:14}),onClick:()=>g(!0),children:"New bait campaign"})]}),d.length>0&&e.jsx(Le,{value:A,onChange:i,data:[{value:"live",label:`Live (${h})`},{value:"archive",label:`Archive (${C})`}]}),w.length===0&&e.jsx(He,{icon:e.jsx(ze,{size:32,stroke:1.5}),title:"No bait campaigns yet",description:"Post a tweet that asks a question or provokes a reply, then attach it here. The repliers auto-flow into a list of your choice.",cta:{label:"New bait campaign",icon:e.jsx(Te,{size:14}),onClick:()=>g(!0)}}),e.jsx(v,{gap:"md",children:w.map(s=>{var o;return e.jsx(_e,{bait:s,list:(((o=k.data)==null?void 0:o.lists)||[]).find(u=>u.id===s.targetListId),onRefresh:()=>x.mutate(s.id),onRemove:()=>j.mutate(s.id),onToggle:u=>y.mutate({id:s.id,patch:{enabled:u}}),onExtend:()=>y.mutate({id:s.id,patch:{extendDays:7}}),refreshing:x.isPending&&x.variables===s.id},s.id)})}),e.jsx(Ye,{opened:b,onClose:()=>g(!1),lists:(((S=k.data)==null?void 0:S.lists)||[]).filter(s=>s.kind!=="smart"),onCreated:()=>{g(!1),a.invalidateQueries({queryKey:["baits"]})}})]})}function _e({bait:a,list:b,onRefresh:g,onRemove:A,onToggle:i,onExtend:f,refreshing:k}){var j,y,d,w,h,C;const x=a.expiresAt&&a.expiresAt<Date.now();return e.jsx(O,{withBorder:!0,children:e.jsxs(c,{justify:"space-between",align:"flex-start",wrap:"wrap",gap:"sm",children:[e.jsxs(v,{gap:4,style:{flex:1,minWidth:0},children:[e.jsxs(c,{gap:"xs",wrap:"wrap",children:[e.jsx(r,{fw:600,children:a.label}),a.authorHandle&&e.jsxs(X,{href:a.tweetUrl,target:"_blank",rel:"noreferrer",size:"xs",children:["@",a.authorHandle," ",e.jsx(Oe,{size:10,style:{verticalAlign:-1}})]}),e.jsx(m,{variant:"light",color:x?"gray":a.enabled?"green":"gray",size:"sm",children:x?"expired":a.enabled?"live":"paused"})]}),e.jsxs(c,{gap:"xs",wrap:"wrap",children:[e.jsxs(m,{variant:"light",children:[((j=a.stats)==null?void 0:j.totalAdded)??0," added · ",((y=a.stats)==null?void 0:y.totalSeen)??0," seen"]}),((d=a.stats)==null?void 0:d.filteredOut)>0&&e.jsx(E,{label:"Engagers blocked at intake by your filter (low followers, no bio, on DNC).",children:e.jsxs(m,{variant:"light",color:"gray",children:[a.stats.filteredOut," filtered"]})}),((w=a.stats)==null?void 0:w.enrolledInSeq)>0&&e.jsxs(m,{variant:"light",color:"green",children:[a.stats.enrolledInSeq," enrolled in seq"]}),((h=a.stats)==null?void 0:h.autoWatched)>0&&e.jsxs(m,{variant:"light",color:"blue",children:[a.stats.autoWatched," auto-watched"]}),b?e.jsxs(X,{component:$e,to:"/lists",size:"xs",children:[e.jsx(Ee,{size:10,style:{verticalAlign:-1}})," ",b.name]}):e.jsx(m,{size:"xs",color:"red",variant:"light",children:"target list missing"}),e.jsx(r,{size:"xs",c:"dimmed",children:a.lastRunAt?`last poll ${new Date(a.lastRunAt).toLocaleStr
1ing()}`:"awaiting first poll"}),e.jsxs(r,{size:"xs",c:"dimmed",children:["every ",a.refreshHours,"h · cap ",a.maxEngagers]}),a.expiresAt&&e.jsxs(r,{size:"xs",c:x?"red":"dimmed",children:["expires ",new Date(a.expiresAt).toLocaleDateString()]}),a.lastError&&e.jsxs(c,{gap:4,children:[e.jsx(Xe,{size:11,color:"var(--mantine-color-red-6)"}),e.jsx(r,{size:"xs",c:"red",children:a.lastError})]})]})]}),e.jsxs(c,{gap:"xs",wrap:"wrap",children:[e.jsx(V,{size:"sm",checked:!!a.enabled,onChange:l=>i(l.currentTarget.checked),label:a.enabled?"on":"off"}),e.jsx(E,{label:"Push expiry +7d",children:e.jsx(q,{size:"xs",variant:"default",onClick:f,children:"Extend +7d"})}),e.jsx(E,{label:"Force a poll now",children:e.jsx(K,{size:"lg",variant:"default",onClick:g,loading:k,children:e.jsx(Ge,{size:14})})}),((C=a.stats)==null?void 0:C.totalAdded)>0&&e.jsx(E,{label:"Download engagers as CSV",children:e.jsx(K,{size:"lg",variant:"default",onClick:async()=>{try{const l=await p.exportBait(a.id),S=new Blob([l],{type:"text/csv;charset=utf-8"}),s=URL.createObjectURL(S),o=document.createElement("a");o.href=s,o.download=`bait-${a.id}.csv`,o.click(),URL.revokeObjectURL(s)}catch(l){R(l)}},children:e.jsx(Ve,{size:14})})}),e.jsx(E,{label:"Remove",children:e.jsx(K,{size:"lg",variant:"subtle",color:"red",onClick:A,children:e.jsx(Ze,{size:14})})})]})]})})}function Ye({opened:a,onClose:b,lists:g,onCreated:A}){var ve,ye,be,ke,Ce,Se,Ae;const[i,f]=n.useState("compose"),[k,x]=n.useState(""),[j,y]=n.useState(""),[d,w]=n.useState(""),[h,C]=n.useState(null),[l,S]=n.useState(null),[s,o]=n.useState(null),[u,Z]=n.useState(null),[_,Y]=n.useState(4),[J,ee]=n.useState(500),[te,se]=n.useState(7),[ae,ne]=n.useState(5),[ie,le]=n.useState(!0),[N,re]=n.useState(0),[oe,ce]=n.useState(""),[de,ue]=n.useState(null),[he,pe]=n.useState(!0),[Q,xe]=n.useState(null),[me,ge]=n.useState(1e3),z=(((ve=P({queryKey:["accounts"],queryFn:()=>p.listAccounts(),enabled:a}).data)==null?void 0:ve.accounts)||[]).filter(t=>t.executionMode==="cookie"&&t.status==="active"),Me=(((ye=P({queryKey:["campaigns"],queryFn:()=>p.listCampaigns(),enabled:a}).data)==null?void 0:ye.campaigns)||[]).filter(t=>t.type==="sequence"&&t.status==="running"),L=P({queryKey:["bait-recent",l],queryFn:()=>p.baitRecentTweets(l),enabled:i==="pick"&&!!l}),fe=(j.match(/status\/(\d{5,})/)||[])[1]||null;let B=!1;i==="compose"?B=!!(d.trim()&&h&&u):i==="pick"?B=!!(s&&u):B=!!(fe&&u);const je=D({mutationFn:()=>{var I;let t={label:k.trim(),targetListId:u,refreshHours:_,maxEngagers:J,daysLive:te,engagerFilter:{minFollowers:ae,requireBio:ie,qualityMin:N,audienceDescription:oe.trim()},autoEnrollSequenceId:de||null,smartCadence:he,autoWatchInReplyGuyAccountId:Q||null,autoWatchMinFollowers:me};if(i==="compose")t={...t,composeText:d.trim(),composeAccountId:h};else if(i==="pick"){const G=(((I=L.data)==null?void 0:I.tweets)||[]).find(We=>We.id===s);t={...t,tweetUrl:G==null?void 0:G.url}}else t={...t,tweetUrl:j.trim()};return p.createBait(t)},onSuccess:()=>{Re(i==="compose"?"Posted + bait live.":"Bait campaign live — first poll in ~1 min."),x(""),y(""),w(""),C(null),S(null),o(null),Z(null),Y(4),ee(500),se(7),ne(5),le(!0),re(0),ce(""),ue(null),pe(!0),xe(null),ge(1e3),A()},onError:t=>R(t)}),[Pe,U]=n.useState(!1),[$,De]=n.useState(""),[we,Be]=n.useState(""),W=D({mutationFn:()=>p.baitAiWrite({audience:$,topic:we,count:3}),onError:t=>R(t)});return e.jsxs(Ie,{opened:a,onClose:b,title:"New bait campaign",size:"lg",children:[e.jsxs(v,{gap:"sm",children:[e.jsx(Le,{fullWidth:!0,value:i,onChange:f,data:[{value:"compose",label:"Write + post"},{value:"pick",label:"Pick a recent tweet"},{value:"paste",label:"Paste URL"}]}),e.jsx(F,{label:"Label",placeholder:"e.g., 'Question for Shopify operators'",value:k,onChange:t=>x(t.currentTarget.value)}),i==="compose"&&e.jsxs(v,{gap:"xs",children:[e.jsx(M,{label:"Post from",data:z.map(t=>({value:t.id,label:t.handle?`@${t.handle}`:t.id})),value:h,onChange:C,placeholder:z.length?"Pick an account":"No active cookie accounts",searchable:!0}),e.jsxs(c,{justify:"space-between",align:"flex-end",children:[e.jsxs(r,{size:"xs",c:"dimmed",children:["Write the bait tweet — we'll post it from ",h?`@${((be=z.find(t=>
1t.id===h))==null?void 0:be.handle)||""}`:"the chosen account"," and track its repliers."]}),e.jsx(q,{size:"xs",variant:"default",leftSection:e.jsx(Ee,{size:12}),onClick:()=>U(!0),children:"AI write"})]}),e.jsx(qe,{placeholder:"What's the best tool for X that does Y? Asking because we just hit Z and the off-the-shelf options feel wrong.",value:d,onChange:t=>w(t.currentTarget.value),autosize:!0,minRows:3,maxLength:280,error:d.length>280?"Too long for X (280 max)":null}),e.jsxs(r,{size:"xs",c:"dimmed",children:[d.length," / 280"]})]}),i==="pick"&&e.jsxs(v,{gap:"xs",children:[e.jsx(M,{label:"From which account?",data:z.map(t=>({value:t.id,label:t.handle?`@${t.handle}`:t.id})),value:l,onChange:t=>{S(t),o(null)},placeholder:z.length?"Pick an account":"No active cookie accounts",searchable:!0}),l&&L.isLoading&&e.jsx(r,{size:"xs",c:"dimmed",children:"Loading recent tweets…"}),l&&!L.isLoading&&(((Ce=(ke=L.data)==null?void 0:ke.tweets)==null?void 0:Ce.length)||0)===0&&e.jsx(r,{size:"xs",c:"dimmed",children:"No recent tweets found for this account."}),(((Se=L.data)==null?void 0:Se.tweets)||[]).map(t=>e.jsxs(O,{withBorder:!0,p:"xs",onClick:()=>o(t.id),style:{cursor:"pointer",borderColor:s===t.id?"var(--mantine-color-text)":void 0,borderWidth:s===t.id?2:void 0},children:[e.jsx(r,{size:"sm",lineClamp:2,children:t.text}),e.jsxs(c,{gap:"xs",mt:4,children:[e.jsxs(m,{size:"xs",variant:"light",children:[t.replyCount," replies"]}),e.jsxs(m,{size:"xs",variant:"light",children:[t.likeCount," likes"]}),e.jsxs(m,{size:"xs",variant:"light",children:[t.retweetCount," RTs"]}),e.jsx(X,{href:t.url,target:"_blank",rel:"noreferrer",size:"xs",onClick:I=>I.stopPropagation(),children:"open on X"})]})]},t.id))]}),i==="paste"&&e.jsx(F,{label:"Tweet URL",description:"Must be a full x.com/<handle>/status/<id> URL",placeholder:"https://x.com/.../status/1234567890",value:j,onChange:t=>y(t.currentTarget.value),error:j&&!fe?"Doesn't look like a status URL":null}),e.jsx(M,{label:"Target list",description:"Smart lists are excluded — their members come from a rule.",data:g.map(t=>({value:t.id,label:`${t.name} · ${t.handleCount||0}`})),value:u,onChange:Z,placeholder:g.length?"Pick a list":"No regular lists — create one first",searchable:!0}),e.jsx(M,{label:"Auto-enroll engagers into a sequence (optional)",description:"Every new engager piped into the list is also enrolled in this sequence — closes the bait → DM funnel.",data:[{value:"",label:"(no — pipe to list only)"},...Me.map(t=>({value:t.id,label:`${t.name||"(unnamed)"} · ${t.status}`}))],value:de||"",onChange:t=>ue(t||null),allowDeselect:!1}),e.jsx(H,{label:"Engager filter",labelPosition:"left"}),e.jsxs(c,{grow:!0,children:[e.jsx(T,{label:"Min followers",description:"Filter out throwaway accounts. 0 disables.",value:ae,onChange:t=>ne(Math.max(0,Math.min(1e5,Number(t)||0))),min:0,max:1e5,step:5}),e.jsx(V,{label:"Require bio",description:"Skip engagers with no bio — usually bots or fresh sock-puppets.",checked:ie,onChange:t=>le(t.currentTarget.checked)})]}),e.jsx(T,{label:"AI quality minimum (optional)",description:"0-100. When > 0 AND audience set, Gemini scores each engager against your audience description. Below this they're skipped. 0 disables.",value:N,onChange:t=>re(Math.max(0,Math.min(100,Number(t)||0))),min:0,max:100}),N>0&&e.jsx(qe,{label:"Audience description (for AI scoring)",description:"Plain English. The same audience description you'd write for Discover.",placeholder:"Shopify operators with their own store (not agencies). Bonus signal: bio mentions store URL or product.",value:oe,onChange:t=>ce(t.currentTarget.value),autosize:!0,minRows:2,maxLength:500}),e.jsx(V,{label:"Smart cadence",description:"Auto-tighten polling when the bait is hot (≥5 new engagers/tick) and taper when cold. Auto-extends expiry by 7d if still hot near the end.",checked:he,onChange:t=>pe(t.currentTarget.checked)}),e.jsx(H,{label:"Auto-watch hot engagers in Reply Guy (optional)",labelPosition:"left"}),e.jsxs(c,{grow:!0,children:[e.jsx(M,{label:"Add to which Reply Guy config?",description:"When set, engagers above the follower threshold are also added to this Reply Guy config's watch list.",data:[{value:"",label:"(off)"},...z.map(t=>({value:t.id,label:t.handle?`@${t.handle}`:t.id}))],value:Q||"",onChange:t=>xe(t||null),allowDeselect:!1}),e.jsx(T,{label:"Min followers",description:"Skip lower-follower engagers — Reply Guy slots are precious.",value:me,onChange:t=>ge(Math.max(0,Math.min(1e6,Number(t)||0))),min:0,max:1e6,step:500,disabled:!Q})]}),e.jsx(H,{label:"Advanced",labelPosition:"left"}),e.jsxs(c,{grow:!0,children:[e.jsx(T,{label:"Poll interval (hours)",value:_,onCh
1ange:t=>Y(Math.max(1,Math.min(24,Number(t)||4))),min:1,max:24}),e.jsx(T,{label:"Max engagers",description:"Auto-stops after this many handles added",value:J,onChange:t=>ee(Math.max(50,Math.min(2e3,Number(t)||500))),min:50,max:2e3,step:50}),e.jsx(T,{label:"Days live",value:te,onChange:t=>se(Math.max(1,Math.min(60,Number(t)||7))),min:1,max:60})]}),e.jsxs(c,{justify:"flex-end",mt:"sm",children:[e.jsx(q,{variant:"default",onClick:b,children:"Cancel"}),e.jsx(q,{onClick:()=>je.mutate(),loading:je.isPending,disabled:!B,children:i==="compose"?"Post + bait":"Launch"})]})]}),e.jsx(Ie,{opened:Pe,onClose:()=>U(!1),title:"AI bait writer",size:"md",zIndex:1100,children:e.jsxs(v,{gap:"sm",children:[e.jsx(r,{size:"xs",c:"dimmed",children:"Describe your target audience + (optionally) niche. We'll generate 3 candidate bait tweets across proven patterns (question, opinion, list-request)."}),e.jsx(F,{label:"Target audience",placeholder:"Shopify operators with their own store (not agencies)",value:$,onChange:t=>De(t.currentTarget.value)}),e.jsx(F,{label:"Topic / niche (optional)",placeholder:"fulfillment software",value:we,onChange:t=>Be(t.currentTarget.value)}),e.jsx(q,{onClick:()=>W.mutate(),loading:W.isPending,disabled:!$.trim(),children:"Generate 3 candidates"}),(((Ae=W.data)==null?void 0:Ae.candidates)||[]).length>0&&e.jsxs(v,{gap:"xs",children:[(W.data.candidates||[]).map((t,I)=>e.jsxs(O,{withBorder:!0,p:"xs",onClick:()=>{w(t.text),U(!1)},style:{cursor:"pointer"},children:[e.jsx(r,{size:"sm",children:t.text}),e.jsxs(c,{gap:"xs",mt:4,children:[e.jsx(m,{size:"xs",variant:"light",children:t.pattern}),e.jsx(r,{size:"xs",c:"dimmed",children:t.why})]})]},I)),e.jsx(r,{size:"xs",c:"dimmed",children:"Click a candidate to copy it into the compose box."})]})]})})]})}export{yt 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.