PageSourceSearch

https://app.tweethunter.io/_next/static/chunks/pages/agents-31d68f3a6477300f.js

js tweethunter.io collected 2026-09-24 09:24:06 UTC 15,817 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c04eb6ec-d36c-4d6e-8439-86de5abb5463",e._sentryDebugIdIdentifier="sentry-dbid-c04eb6ec-d36c-4d6e-8439-86de5abb5463")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1013],{95541:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/agents",function(){return n(39492)}])},78220:function(e,t,n){"use strict";n.d(t,{O:function(){return C}});var i=n(85893),o=n(67294),l=n(48633),s=n(83658),r=n(38488),d=n(68029),a=n(88329),c=n(90092),u=n(18118),v=n(8186),g=n(6630),p=n(74931),h=n(85330),x=n(26281),f=n(52154),m=n(29992),j=n(67142),w=n(95857),y=n(12519),b=n(3712),k=n(8193),S=n(61900);function _(e){let{agent:t,onDelete:n=()=>{},onEditAgent:u=()=>{}}=e,[v,g]=(0,o.useState)(!1),[p,h]=(0,o.useState)(!1),{isOpen:f,onOpen:_,onClose:C}=(0,s.q)();(0,o.useRef)(null);let[z]=(0,l.kP)(),D=(0,m.I)(),A=async()=>{var e,i;h(!0);let o=j.GX.firestore();await o.collection("users").doc(null===(e=(0,w.D0)(z))||void 0===e?void 0:e.id).collection("accounts").doc(null===(i=(0,w.D0)(z))||void 0===i?void 0:i.idAccount).collection("agents").doc(t.id).delete(),h(!1),n()};return(0,o.useEffect)(()=>{D&&!v&&g(!0)},[D]),(0,i.jsxs)(d.x,{width:"100%",children:[(0,i.jsxs)(a.k,{justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(c.x,{fontWeight:"medium",fontSize:"lg",noOfLines:1,wordBreak:"break-all",children:t.name}),(0,i.jsx)(y.h,{"aria-label":"watcher setting",icon:(0,i.jsx)(k.zPD,{}),variant:"text",colorScheme:"neutral",onClick:_})]}),(0,i.jsx)(d.x,{mt:"2",maxW:"260px",children:(0,i.jsxs)(c.x,{fontSize:"sm",mt:"3",children:[(0,i.jsx)("b",{children:"Goal:"})," ",t.prompt]})}),(0,i.jsx)(b.K,{direction:{base:"column",md:"row"},mt:"5",spacing:"3",justifyContent:"end",children:(0,i.jsx)(r.z,{variant:"outline",colorScheme:"neutral",size:"sm",leftIcon:S.p,onClick:A,isLoading:p,children:"DELETE AGENT"})}),(0,i.jsx)(x.zZ,{isOpen:f,onClose:C,agent:t,onAddSuccess:u})]})}function C(){let[e,t]=(0,o.useState)({}),[n,y]=(0,o.useState)(!1),[b,k]=(0,o.useState)([]),{isOpen:S,onOpen:C,onClose:z}=(0,s.q)(),{isOpen:D,onOpen:A,onClose:N}=(0,s.q)(),{isOpen:P,onOpen:I,onClose:O}=(0,s.q)(),[T]=(0,l.kP)(),E=(0,m.I)(),G=async()=>{var e,t;y(!0);let n=j.GX.firestore(),i=await n.collection("users").doc(null===(e=(0,w.D0)(T))||void 0===e?void 0:e.id).collection("accounts").doc(null===(t=(0,w.D0)(T))||void 0===t?void 0:t.idAccount).collection("agents").get();if(i.size>0){let e=i.docs.map(e=>({...e.data(),id:e.id}));k(e)}else k([]);y(!1)};(0,o.useEffect)(()=>{E&&G()},[E,e]);let R=(0,i.jsx)(r.z,{leftIcon:(0,i.jsx)(h.d,{h:"3",w:"3"}),background:"none",ml:"3",color:"gray",onClick:()=>{if(!(0,f.yy)(null==T?void 0:T.user,"leadFinder")){A();return}if((null==b?void 0:b.length)>=3){p.default.error("You can only have 3 agents at the same time");return}I()},children:"Create a new agent"});return(0,i.jsxs)(d.x,{w:"100%",children:[(0,i.jsxs)(d.x,{children:[(0,i.jsxs)(a.k,{alignItems:"center",children:[(0,i.jsx)(c.x,{fontWeight:"medium",children:"Agents"}),R]}),(0,i.jsx)(c.x,{color:"neutral.content",fontSize:"md",mt:"1",children:"You can create up to 3 agents. The agent will attempt to give you the most useful advice."})]}),n?(0,i.jsx)(a.k,{justifyContent:"center",mt:"16",children:(0,i.jsx)(g.r,{loading:n,css:"display: block; margin: 0 auto; border-color: red;",size:50})}):(null==b?void 0:b.length)>0?(0,i.jsx)(u.E,{spacing:"5",direction:"row",mt:"8",flexWrap:"nowrap",w:"100%",children:b.map(e=>(0,i.jsx)(u.U,{bg:"neutral.border",p:"4",borderRadius:"md",children:(0,i.jsx)(_,{agent:e,onDelete:()=>t({}),onEditAgent:()=>{O(),t({})}})},e.id))}):(0,i.jsxs)(v.g,{justifyContent:"center",mt:"10",spacing:3,children:[(0,i.jsx)(c.x,{textAlign:"center",children:'You haven\'t created a "agents" yet, create your first now!'}),R]}),(0,i.jsx)(x.zZ,{isOpen:P,onClose:O,onAddSuccess:()=>{t({}),O()}}),(0,i.jsx)(x.z9,{isOpen:D,onClose:N,title:"Unlock Lead Finder and more"}),(0,i.jsx)(x._s,{isOpen:S,onClose:z})]})}},80887:function(e,t,n){"use strict";n.a(e,async function(e,i){try{n.d(t,{Z:function(){return O}});var o=n(85893),l=n(67294),s=n(83658),r=n(88329),d=n(50232),a=n(38488),c=n(52867),u=n(15715),v=n(95478),g=n(59342),p=n(90573),h=n(33229),x=n(8387),f=n(63750),m=n(8193),j=n(81872),w=n(48633),y=n(96885),b=n(95857),k=n(16482),S=n(29141),_=n(48116),C=n.n(_),z=n(67142),D=n(96879),A=n(74931),N=n(6630),P=n(1814),I=e([P]);function O(e){var t,n,i,_,I,O,T,E,G,R,X,L,q,M,F,H,V,Z,B,W,U,Y,K,Q,$,J;let{suggestion:ee,suggestions:et,setSuggestions:en}=e,[ei,eo]=(0,w.kP)(),[el,es]=(0,l.useState)(!1),[er,ed]=(0,l.useState)(null);(0,y.useRouter)();let ea=(0,l.useContext)(S.B1),{isOpen:ec,onOpen:eu,onClose:ev}=(0,s.q)(),[eg,ep]=(0,l.useState)([]),[eh,ex]=(0,l.useState)([]),[ef,em]=(0,l.useState)(!1),ej=async()=>{eu(),em(!0);let e=z.GX.firestore(),t=await e.collection("w_memories").doc(ee.idChat).get(),n=t.data();if(em(!1),!n){A.default.error("No history found");return}ep(null==n?void 0:n.history),ex(null==n?void 0:n.prompts)},ew=async()=>{var e,t;let n=et.filter(e=>e!==ee);en(n);let i=z.GX.firestore();await i.collection("users").doc(null===(e=(0,b.D0)(ei))||void 0===e?void 0:e.id).collection("accounts").doc(null===(t=(0,b.D0)(ei))||void 0===t?void 0:t.idAccount).collection("suggestions").doc(ee.id).delete()},ey=async()=>{var e;(null==ee?void 0:ee.type)==="publish_tweet"&&(ea.newTweet({text:null==ee?void 0:null===(e=ee.args)||void 0===e?void 0:e.text}),ea.setIsTweetTextChanged(!0),ea.open())},eb=async()=>{var e,t,n;if(ed(!0),(null==ee?void 0:ee.type)==="reply_to_tweet"){let n={id_str:null==ee?void 0:null===(e=ee.args)||void 0===e?void 0:e.id,text:null==ee?void 0:null===(t=ee.args)||void 0===t?void 0:t.reply};await (0,k.j2)(void 0,n,ei)}else(null==ee?void 0:ee.type)==="publish_tweet"&&await (0,k.qm)(ei,ea,null==ee?void 0:null===(n=ee.args)||void 0===n?void 0:n.text);await ew(),ed(!1)};(0,l.useEffect)(()=>{},[ei]);let ek="",eS="",e_="",eC="Reject",ez=(0,o.jsx)(f.O6K,{fontSize:"2xl"}),eD="neutral.background-hover";return(null==ee?void 0:ee.type)==="reply_to_tweet"?(ek="Reply to tweet "+(null==ee?void 0:null===(J=ee.args)||void 0===J?void 0:J.id),eS="Post Reply",eD="accent.background-subdued"):(null==ee?void 0:ee.type)==="publish_tweet"?(ek="Publish tweet",eS="Add To Queue",e_="Edit & Tweet",ez=(0,o.jsx)(m.$iz,{fontSize:"2xl"}),eD="brand.background-subdued"):(null==ee?void 0:ee.type)==="stats_insights"?(ek="Insights",eS="NA",eC="Dismiss",ez=(0,o.jsx)(j.lUh,{fontSize:"2xl"}),eD="success.background-subdued"):(ek=null==ee?void 0:ee.type,eS="NA"),console.log("suggestion - tweet: ",null==ee?void 0:null===(t=ee.args)||void 0===t?void 0:t.tweet),console.log("suggestion - text: ",null==ee?void 0:null===(n=ee.args)||void 0===n?void 0:n.text),(0,o.jsxs)(r.k,{p:4,mt:4,rounded:"lg",minH:"100px",shadow:"md",bg:eD,flexDir:"column",alignItems:"start",cursor:"pointer",onClick:()=>{ej()},children:[(0,o.jsxs)(r.k,{w:"100%",justifyContent:"space-between",children:[(0,o.jsxs)(r.k,{alignItems:"center",children:[ez,(0,o.jsx)(d.X,{ml:5,fontSize:"lg",children:ek})]}),(0,o.jsxs)(r.k,{children:[(0,o.jsx)(a.z,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:async e=>{e.stopPropagation(),ed(!0),await ew(),ed(!1)},isLoading:er,children:eC}),e_&&(0,o.jsx)(a.z,{ml:2,variant:"outline",colorScheme:"neutral",size:"sm",isLoading:er,onClick:e=>{e.stopPropagation(),ey()},children:e_}),"NA"!==eS&&(0,o.jsx)(a.z,{ml:2,variant:"outline",colorScheme:"neutral",size:"sm",isLoading:er,onClick:e=>{e.stopPropagation(),eb()},children:eS})]})]}),(0,o.jsxs)(r.k,{w:"100%",mt:2,flexDir:"column",whiteSpace:"pre-line",children:[(null==ee?void 0:null===(_=ee.args)||void 0===_?void 0:null===(i=_.tweet)||void 0===i?void 0:i.fullText)?"tweet: "+(null==ee?void 0:null===(O=ee.args)||void 0===O?void 0:null===(I=O.tweet)||void 0===I?void 0:I.fullText):"",(null==ee?void 0:null===(T=ee.args)||void 0===T?void 0:T.text)?null==ee?void 0:null===(G=ee.args)||void 0===G?void 0:null===(E=G.text)||void 0===E?void 0:E.replace(/\\n
1/g,"\n"):"",(null==ee?void 0:null===(X=ee.args)||void 0===X?void 0:null===(R=X.insights)||void 0===R?void 0:R.length)&&(0,o.jsx)(c.QI,{ml:8,children:null==ee?void 0:null===(q=ee.args)||void 0===q?void 0:null===(L=q.insights)||void 0===L?void 0:L.map((e,t)=>(0,o.jsx)(c.HC,{mt:2,children:e},t))}),(null==ee?void 0:null===(M=ee.args)||void 0===M?void 0:M.reply)&&(null==ee?void 0:null===(V=ee.args)||void 0===V?void 0:null===(H=V.tweet)||void 0===H?void 0:null===(F=H.parentTweet)||void 0===F?void 0:F.id_str)&&(0,o.jsx)(u.M,{w:"100%",m:5,onClick:e=>e.stopPropagation(),children:(0,o.jsx)(P.tl,{type:"mentions&replies",tweet:{data:null==ee?void 0:null===(Z=ee.args)||void 0===Z?void 0:Z.tweet},forceReply:null==ee?void 0:null===(B=ee.args)||void 0===B?void 0:B.reply,removeTweet:ew,refresher:()=>{},isFocused:!1,disableDivider:!0})})]}),(null===(W=(0,b.D0)(ei))||void 0===W?void 0:W.isAdmin)&&(0,o.jsxs)(r.k,{mt:5,fontSize:"xs",onClick:e=>e.stopPropagation(),children:["(Debug:"," Date: "+C()(null==ee?void 0:null===(U=ee.date)||void 0===U?void 0:U.toDate(),"yyyy-mm-dd HH:MM"),(null==ee?void 0:null===(Y=ee.agent)||void 0===Y?void 0:Y.name)?" // Agent: "+(null==ee?void 0:null===(K=ee.agent)||void 0===K?void 0:K.name):"",(null==ee?void 0:null===(Q=ee.agent)||void 0===Q?void 0:Q.date)?" // date: "+C()(null==ee?void 0:null===($=ee.agent)||void 0===$?void 0:$.date,"yyyy-mm-dd h:MM"):"",(null==ee?void 0:ee.idChat)?" // idChat: "+(null==ee?void 0:ee.idChat):"",(null==ee?void 0:ee.id)?" // id: "+(null==ee?void 0:ee.id):"",")"]}),(0,o.jsx)(D.P,{isOpen:ec,onClose:ev,title:"History of the AI Agent",allowClickBackground:!0,size:"xl",body:(0,o.jsx)(r.k,{children:ef?(0,o.jsx)(u.M,{pt:10,w:"100%",children:(0,o.jsx)(N.r,{loading:!0,css:"display: block; margin: 0 auto; border-color: red;",size:50})}):(0,o.jsxs)(v.m,{children:[(0,o.jsxs)(g.t,{children:[(0,o.jsx)(p.O,{children:"History"}),(0,o.jsx)(p.O,{children:"Prompts"})]}),(0,o.jsxs)(h.n,{children:[(0,o.jsx)(x.x,{children:null==eg?void 0:eg.map((e,t)=>(0,o.jsx)(r.k,{mt:2,p:2,bg:"neutral.background-hover",flexDir:"column",whiteSpace:"pre-line",children:e.insight},t))}),(0,o.jsx)(x.x,{children:null==eh?void 0:eh.map((e,t)=>(0,o.jsx)(r.k,{mt:2,p:2,bg:"neutral.background-hover",flexDir:"column",whiteSpace:"pre-line",children:e.prompt},t))})]})]})}),cta:"Close",callback:async()=>{}})]})}P=(I.then?(await I)():I)[0],i()}catch(e){i(e)}})},39492:function(e,t,n){"use strict";n.a(e,async function(e,i){try{n.r(t),n.d(t,{default:function(){return y}});var o=n(85893),l=n(67294),s=n(8186),r=n(88329),d=n(50232),a=n(38488),c=n(48633),u=n(96885),v=n(493),g=n(1467),p=n(5913),h=n(95857),x=n(78220),f=n(80887),m=n(67142),j=n(29992),w=e([g,f]);function y(){let[e,t]=(0,c.kP)(),[n,i]=(0,l.useState)(!1),[w,y]=(0,l.useState)(null),[b,k]=(0,l.useState)(!1);(0,l.useContext)(p.T),(0,u.useRouter)();let[S,_]=(0,l.useState)([]),C=(0,j.I)();(0,l.useEffect)(()=>{e&&!b&&k(!0)},[e]),(0,l.useEffect)(()=>{C&&D()},[C]);let z=async()=>{_([]);let t=m.GX.firestore();for await(let o of S){var n,i;await t.collection("users").doc(null===(n=(0,h.D0)(e))||void 0===n?void 0:n.id).collection("accounts").doc(null===(i=(0,h.D0)(e))||void 0===i?void 0:i.idAccount).collection("suggestions").doc(o.id).delete()}},D=async()=>{var t,n;let i=m.GX.firestore(),o=await i.collection("users").doc(null===(t=(0,h.D0)(e))||void 0===t?void 0:t.id).collection("accounts").doc(null===(n=(0,h.D0)(e))||void 0===n?void 0:n.idAccount).collection("suggestions").orderBy("date","desc").get(),l=o.docs.map(e=>({...e.data(),id:e.id}));console.log("fetchedSuggestions:",l),_(l)};return t||e?(0,o.jsxs)(g.T,{title:"AI Agents",description:"Get AI Agents working for you, generate oppotunities and grow your business",children:[(0,o.jsx)(s.g,{mt:10,w:"100%",alignItems:"start",children:(0,o.jsx)(x.O,{})}),(null==S?void 0:S.length)>0&&(0,o.jsxs)(r.k,{mt:10,flexDir:"column",children:[(0,o.jsxs)(r.k,{justifyContent:"space-between",children:[(0,o.jsx)(d.X,{fontSize:"xl",children:"Agents Suggestions"}),(0,o.jsx)(a.z,{variant:"text",colorScheme:"neutral",size:"sm",onClick:z,children:"Dismiss All"})]}),null==S?void 0:S.map((e,t)=>(0,o.jsx)(f.Z,{suggestion:e,suggestions:S,setSuggestions:_},"suggestion-"+t))]})]}):(0,o.jsx)(v.Z,{})}[g,f]=w.then?(await w)():w,i()}catch(e){i(e)}})},46051:function(e,t,n){"use strict";n.d(t,{eg:function(){return l},q_:function(){return r},sV:function(){return s},tR:function(){return d}});var i=n(52110),o=n(66140);let[l,s]=(0,i.k)({name:"StepContext"}
1),[r,d]=(0,o.eC)("Stepper")},27062:function(e,t,n){"use strict";n.d(t,{O:function(){return d}});var i=n(85893),o=n(34926),l=n(46051),s=n(49381),r=n(17997);let d=(0,s.G)(function(e,t){let{status:n}=(0,l.sV)(),s=(0,l.tR)();return(0,i.jsx)(r.m.div,{ref:t,"data-status":n,...e,__css:s.indicator,className:(0,o.cx)("chakra-step__indicator",e.className)})})},38702:function(e,t,n){"use strict";n.d(t,{F:function(){return d}});var i=n(85893),o=n(34926),l=n(46051),s=n(49381),r=n(17997);let d=(0,s.G)(function(e,t){let{orientation:n,status:s,isLast:d,showLastSeparator:a}=(0,l.sV)(),c=(0,l.tR)();return d&&!a?null:(0,i.jsx)(r.m.div,{ref:t,role:"separator","data-orientation":n,"data-status":s,__css:c.separator,...e,className:(0,o.cx)("chakra-step__separator",e.className)})})},67542:function(e,t,n){"use strict";n.d(t,{k:function(){return s}});var i=n(85893),o=n(2847),l=n(46051);function s(e){let{complete:t,incomplete:n,active:s}=e,r=(0,l.sV)(),d=null;switch(r.status){case"complete":d=(0,o.P)(t,r);break;case"incomplete":d=(0,o.P)(n,r);break;case"active":d=(0,o.P)(s,r)}return d?(0,i.jsx)(i.Fragment,{children:d}):null}},19074:function(e,t,n){"use strict";n.d(t,{r:function(){return d}});var i=n(85893),o=n(34926),l=n(46051),s=n(49381),r=n(17997);let d=(0,s.G)(function(e,t){let{status:n}=(0,l.sV)(),s=(0,l.tR)();return(0,i.jsx)(r.m.h3,{ref:t,"data-status":n,...e,__css:s.title,className:(0,o.cx)("chakra-step__title",e.className)})})},13439:function(e,t,n){"use strict";n.d(t,{h:function(){return a}});var i=n(85893),o=n(20397),l=n(34926),s=n(46051),r=n(49381),d=n(17997);let a=(0,r.G)(function(e,t){let{orientation:n,status:r,showLastSeparator:a}=(0,s.sV)(),c=(0,s.tR)();return(0,i.jsx)(d.m.div,{ref:t,"data-status":r,"data-orientation":n,"data-stretch":(0,o.P)(a),__css:c.step,...e,className:(0,l.cx)("chakra-step",e.className)})})},96338:function(e,t,n){"use strict";n.d(t,{v:function(){return u}});var i=n(85893),o=n(65544),l=n(34926),s=n(67294),r=n(46051),d=n(49381),a=n(73035),c=n(17997);let u=(0,d.G)(function(e,t){let n=(0,a.j)("Stepper",e),{children:d,index:u,orientation:v="horizontal",showLastSeparator:g=!1,...p}=(0,o.L)(e),h=s.Children.toArray(d),x=h.length;return(0,i.jsx)(c.m.div,{ref:t,"aria-label":"Progress","data-orientation":v,...p,__css:n.stepper,className:(0,l.cx)("chakra-stepper",e.className),children:(0,i.jsx)(r.q_,{value:n,children:h.map((e,t)=>(0,i.jsx)(r.eg,{value:{index:t,status:t<u?"complete":t>u?"incomplete":"active",orientation:v,showLastSeparator:g,count:x,isFirst:0===t,isLast:t===x-1},children:e},t))})})})},18352:function(e,t,n){"use strict";n.d(t,{h:function(){return o}});var i=n(67294);function o(e={}){let{index:t=0,count:n}=e,[o,l]=(0,i.useState)(t),s="number"==typeof n?n-1:0,r=o/s;return{activeStep:o,setActiveStep:l,activeStepPercent:Number.isNaN(r)?0:r,isActiveStep:e=>e===o,isCompleteStep:e=>e<o,isIncompleteStep:e=>e>o,getStatus:e=>e<o?"complete":e>o?"incomplete":"active",goToNext(){l(e=>"number"==typeof n?Math.min(n,e+1):e+1)},goToPrevious(){l(e=>Math.max(0,e-1))}}}}},function(e){e.O(0,[4980,1778,9866,994,4660,6765,1467,6281,439,9774,2888,179],function(){return e(e.s=95541)}),_N_E=e.O()}]);

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.