1import{j as n,r as u}from"./utm-Cy4lOW-Q.js";import"./createLucideIcon-dPnAjM8L.js";import{dZ as S,d_ as P,d$ as Y,e0 as R,e1 as M,e2 as Q,e3 as H,e4 as K,e5 as z,e6 as B,aa as T,ab as w,ac as C,ad as L,ap as A,a1 as I,e7 as U}from"./useCreditBalance-HBJ5NF0b.js";import{F as V,L as W}from"./LinkedinIcon-BOa6vTkX.js";import{e as t,bT as $,aQ as q,aP as Z,aS as J,u as ee,I as te}from"./useReferenceImages-CsBgr4xj.js";import{w as ne,ac as oe,a6 as ae,d as g,af as se,P as ie,bH as re}from"./authContext-DDS04vem.js";import"./isArrayLike-web9Nrm3.js";import"./onboardingFunnelEvents-DqAy5zM4.js";import"./x-CsxYt7Kp.js";import"./trendPulse-XRdIb8F0.js";import"./analytics-Zu3G7Flx.js";import"./medium-CNY0dU20.js";import"./rng-BlqX2qel.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};o.SENTRY_RELEASE={id:"v20261009-gen9227-idb-noise-61c858d6"};var c=new o.Error().stack;c&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[c]="8ddc497e-d461-4c67-9bc6-b398c101782e",o._sentryDebugIdIdentifier="sentry-dbid-8ddc497e-d461-4c67-9bc6-b398c101782e")}catch{}})();const ce=({id:o,hasIntegration:c,onClick:s,img:m,Icon:f,alt:k,title:d,description:b})=>{let r=o===t.Degods?"Connect":c?"Disconnect":"Connect";return o===t.XEL&&c&&(r="View XEL"),n.jsxs("div",{"data-testid":`card-platform-${o}`,className:"flex size-[200px] flex-col place-content-between rounded-2xl bg-[#1e2235] p-3 text-white",children:[n.jsx("p",{className:"align-left text-sm font-semibold",children:d}),n.jsx("div",{className:"flex items-center justify-center",children:m?n.jsx("img",{src:m,alt:k,width:50}):f?n.jsx(f,{"aria-label":k,className:"size-[50px]"}):n.jsx("span",{className:"align-left text-sm",children:b})}),n.jsx("button",{className:"mb-1 w-full rounded-md border border-white py-1 font-semibold text-white transition hover:bg-white hover:text-[#1e2235]",onClick:()=>s(o),children:r})]})};function je(){const o=ne(e=>e.agentId),s=$(o).data||[],m=q(),f=Z(),k=J(),{data:d}=oe(o),[b,r]=u.useState(!1),x=u.useRef(null),[v,D]=u.useState(!1),[p,h]=u.useState(null),E=ae(),{integration:N}=ee(),j=N.xel,y=!!(d!=null&&d.primary_avatar_url),a={[t.Tiktok]:s.some(e=>e.platform===t.Tiktok),[t.Instagram]:s.some(e=>e.platform===t.Instagram),[t.Facebook]:s.some(e=>e.platform===t.Facebook),[t.Youtube]:s.some(e=>e.platform===t.Youtube),[t.X]:s.some(e=>e.platform===t.X),[t.Linkedin]:s.some(e=>e.platform===t.Linkedin)},X=()=>{var e,i;(e=x.current)!=null&&e.value&&(r(!1),_((i=x.current)==null?void 0:i.value))},_=async e=>{try{await k.mutateAsync({agentId:o,socialAccountIdentifier:e}),g.success("connect to tiktok successfully!")}catch(i){g.error(i.message)}},F=()=>{if(!j){r(!0);return}E(se(ie.AURA_WITH_AGENT_ID,o))},l=async e=>{if(a[e])h(e);else{try{const i=await m.mutateAsync({platform:e,agentId:o});i.url&&window.location.assign(i.url)}catch(i){g.error(re(i,e))}return}},O=async e=>{if(e)try{await f.mutateAsync({platform:e,agentId:o}),g("Disconnected successfully"),h(null)}catch{g.error("Failed to disconnect to "+e)}},G=[{id:t.XEL,hasIntegration:j,onClick:F,img:null,description:"Auto engage to grow your followers (beta). Includes cloud device and free gmail account to setup multiple accounts.",alt:"Xel",title:"XEL"},{id:t.Tiktok,hasIntegration:a[t.Tiktok],onClick:l,img:a[t.Tiktok]?P:S,alt:"tiktok",title:"TikTok"},{id:t.Instagram,hasIntegration:a[t.Instagram],onClick:l,img:a[t.Instagram]?R:Y,alt:"instagram",title:"Instagram Business"},{id:t.Facebook,hasIntegration:a[t.Facebook],onClick:l,img:null,Icon:V,alt:"facebook",title:"Facebook"},{id:t.Youtube,hasIntegration:a[t.Youtube],onClick:l,img:a[t.Youtube]?Q:M,alt:"youtube",title:"YouTube"},{id:t.X,hasIntegration:a[t.X],onClick:l,img:a[t.X]?K:H,alt:"x",title:"X"},{id:t.Linkedin,hasIntegration:a[t.Linkedin],onClick:l,img:null,Icon:W,alt:"linkedin",title:"LinkedIn"},{id:t.Degods,hasIntegration:y,onClick:()=>{D(!0)},img:y?B:z,alt:y?"DeID":"DeGod",title:"DeGod"}].filter(e=>e.id!==t.Facebook||e.hasIntegration);return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"mt-10 flex flex-wrap gap-2",children:G.map(e=>u.createElement(ce,{...e,key:e.id}))}),n.jsx(T,{open:b,onOpenChange:r,children:n.jsxs(w,{children:[n.jsx(C,{children:n.jsx(L,{children:"Api Key"})}),n.jsx(te,{type:"text",required:!0,ref:x}),n.jsxs(A,{className:"flex-row-reverse gap-2",children:[n.jsx(I,{onClick:X,children:"connect"}),n.jsx(I,{variant:"outline",onClick:()=>r(!1),children:"cancel"})]})]})}),n.jsx(U,{open:v,onOpenChange:D,agentId:o}),n.jsx(T,{open:!!p,onOpenChange:e=>h(e?p:null),children:n.jsxs(w,{children:[n.jsx(C,{children:n.jsx(L,{children:"Disconnect"})}),n.jsxs("p",{children:["Are you sure you want to disconnect ",p,"?"]}),n.jsxs(A,{children:[n.jsx(I,{variant:"outline",onClick:()=>h(null),children:"cancel"}),n.jsx(I,{onClick:()=>O(p),children:"disconnect"})]})]})})]})}export{je 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.