PageSourceSearch

https://www.getupgraded.ai/_next/static/chunks/80287.9840a13abb547bcd.js

js getupgraded.ai collected 2026-10-05 15:23:41 UTC 17,829 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[80287],{52528:(e,a,t)=>{t.d(a,{A:()=>s});var n=t(12115);let s=n.forwardRef(function(e,a){let{title:t,titleId:s,...l}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?n.createElement("title",{id:s},t):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"}))})},80287:(e,a,t)=>{t.r(a),t.d(a,{AutoEngagePanel:()=>S});var n=t(95155),s=t(12115),l=t(17349),i=t(43569),o=t(98498),r=t(52528),c=t(89731),d=t(9554),u=t(57218),m=t(88125),h=t(18720);let p={gmail:100,linkedin:10};var g=t(73604),x=t(4625),y=t(46646);let f=[{v:1,l:"M"},{v:2,l:"T"},{v:3,l:"W"},{v:4,l:"T"},{v:5,l:"F"},{v:6,l:"S"},{v:7,l:"S"}],b=x.ll.map(e=>({value:e.value,label:e.label,group:e.country})),_=x.g2.map(e=>({value:e,label:e})),v=x.a3.map(e=>({value:e,label:e})),j=y.YW.map(e=>({value:e,label:e}));function N(e,a){let t=new Set(e.map(e=>e.value)),n=a.filter(e=>e&&!t.has(e)).map(e=>({value:e,label:e}));return n.length?[...e,...n]:e}function w(e){try{var a,t;let n=null!=(t=null==(a=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).formatToParts(new Date).find(e=>"timeZoneName"===e.type))?void 0:a.value)?t:"GMT";return"GMT"===n?"UTC+00:00":n.replace("GMT","UTC")}catch(e){return"UTC+00:00"}}function k(e){let a=w(e).match(/UTC([+-])(\d{2}):(\d{2})/);return a?("-"===a[1]?-1:1)*(60*parseInt(a[2],10)+parseInt(a[3],10)):0}let C=[{tz:"Pacific/Midway",city:"Midway"},{tz:"Pacific/Honolulu",city:"Honolulu"},{tz:"America/Anchorage",city:"Anchorage (Alaska)"},{tz:"America/Los_Angeles",city:"Los Angeles (Pacific)"},{tz:"America/Denver",city:"Denver (Mountain)"},{tz:"America/Chicago",city:"Chicago (Central)"},{tz:"America/New_York",city:"New York (Eastern)"},{tz:"America/Halifax",city:"Halifax (Atlantic)"},{tz:"America/St_Johns",city:"Newfoundland"},{tz:"America/Sao_Paulo",city:"S\xe3o Paulo"},{tz:"Atlantic/Azores",city:"Azores"},{tz:"UTC",city:"UTC"},{tz:"Europe/London",city:"London"},{tz:"Europe/Paris",city:"Paris (Central Europe)"},{tz:"Europe/Athens",city:"Athens (Eastern Europe)"},{tz:"Europe/Moscow",city:"Moscow"},{tz:"Asia/Dubai",city:"Dubai"},{tz:"Asia/Karachi",city:"Karachi"},{tz:"Asia/Kolkata",city:"India"},{tz:"Asia/Dhaka",city:"Dhaka"},{tz:"Asia/Bangkok",city:"Bangkok"},{tz:"Asia/Singapore",city:"Singapore"},{tz:"Asia/Tokyo",city:"Tokyo"},{tz:"Australia/Sydney",city:"Sydney"},{tz:"Pacific/Auckland",city:"Auckland"}].sort((e,a)=>k(e.tz)-k(a.tz)).map(e=>{let{tz:a,city:t}=e;return{value:a,label:"(".concat(w(a),") ").concat(t)}});function A(e){return"".concat(e%12==0?12:e%12,":00 ").concat(e<12?"AM":"PM")}function z(){return{name:"",channel:"gmail",daily_limit:50,send_hour:9,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC",send_days:[1,2,3,4,5],locations:[],employee_ranges:[],industries:[],titles:[],new_share_pct:100,followup_gap_days:7,linkedin_connect_policy:"request_and_message",campaign_instruction:"",notify_out_of_leads:!0,draft_mode:!1}}function S(e){let{onClose:a,isDark:t=!1}=e,[x,y]=(0,s.useState)([]),[k,S]=(0,s.useState)(!0),[T,E]=(0,s.useState)("list"),[M,D]=(0,s.useState)(z()),[P,L]=(0,s.useState)(!1),[I,O]=(0,s.useState)(!1),[U,G]=(0,s.useState)(null),H=(0,s.useRef)(null),W=(0,s.useMemo)(()=>!M.timezone||C.some(e=>e.value===M.timezone)?C:[{value:M.timezone,label:"(".concat(w(M.timezone),") ").concat(M.timezone)},...C],[M.timezone]),q=(0,s.useCallback)(()=>{S(!0),fetch("/api/inbox/auto-engage").then(e=>e.json()).then(e=>y(Array.isArray(e.campaigns)?e.campaigns:[])).catch(()=>y([])).finally(()=>S(!1))},[]);(0,s.useEffect)(()=>{q()},[q]),(0,s.useEffect)(()=>{if("form"===T)return H.current&&clearTimeout(H.current),H.current=setTimeout(()=>{fetch("/api/inbox/auto-engage/preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:M.channel,icp_criteria:{locations:M.locations,employee_ranges:M.employee_ranges,industries:M.industries,titles:M.titles}})}).then(e=>e.json()).then(e=>G("number"==typeof e.count?e.count:null)).catch(()=>G(null))},500),()=>{H.current&&clearTimeout(H.current)}},[T,M.channel,M.locations,M.employee_ranges,M.industries,M.titles]);let F=async()=>
1{if(!M.name.trim())return void h.o.error("Give your campaign a name.");L(!0);let e={name:M.name,channel:M.channel,daily_limit:M.daily_limit,send_hour:M.send_hour,timezone:M.timezone,send_days:M.send_days,icp_criteria:{locations:M.locations,employee_ranges:M.employee_ranges,industries:M.industries,titles:M.titles},new_share_pct:M.new_share_pct,followup_gap_days:M.followup_gap_days,linkedin_connect_policy:M.linkedin_connect_policy,campaign_instruction:M.campaign_instruction,notify_out_of_leads:M.notify_out_of_leads,draft_mode:"gmail"===M.channel&&M.draft_mode};try{let a=await fetch(M.id?"/api/inbox/auto-engage/".concat(M.id):"/api/inbox/auto-engage",{method:M.id?"PATCH":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await a.json();if(403===a.status&&t.upgradeRequired)return void O(!0);if(!a.ok)return void h.o.error(t.error||"Could not save campaign");h.o.success(M.id?"Campaign updated":"Campaign created"),E("list"),q()}catch(e){h.o.error("Could not save campaign")}finally{L(!1)}},J=async e=>{let a="active"===e.status?"paused":"active",t=await fetch("/api/inbox/auto-engage/".concat(e.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:a})}),n=await t.json().catch(()=>({}));if(!t.ok)return void h.o.error(n.error||"Could not update");q()},R=async e=>{if(confirm('Delete "'.concat(e.name,'"?'))){if(!(await fetch("/api/inbox/auto-engage/".concat(e.id),{method:"DELETE"})).ok)return void h.o.error("Could not delete");h.o.success("Campaign deleted"),q()}},Z=t?"bg-gray-800 border-gray-700":"bg-white border-[#e5e5e3]",B="w-full rounded-xl border px-3 py-2 text-sm outline-none focus:ring-2 ".concat(t?"bg-gray-800 border-gray-700 text-gray-200 focus:ring-gray-600":"bg-white/80 border-[#e5e5e3] text-gray-800 focus:ring-gray-300"),K="block text-xs font-semibold mb-1 ".concat(t?"text-gray-300":"text-gray-600"),Y=p[M.channel];return(0,n.jsxs)("div",{className:"flex h-full flex-col ".concat(t?"text-gray-200":"text-gray-800"),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-3 ".concat(t?"border-gray-700":"border-[#e5e5e3]"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.A,{className:"h-5 w-5 ".concat(t?"text-amber-400":"text-amber-600")}),(0,n.jsx)("h2",{className:"text-sm font-semibold",children:"Auto-Engage"})]}),(0,n.jsx)("button",{type:"button",onClick:a,"aria-label":"Close",className:"rounded-lg p-1 ".concat(t?"hover:bg-gray-700":"hover:bg-gray-100"),children:(0,n.jsx)(i.A,{className:"h-5 w-5"})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto p-4",children:["list"===T&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"mb-3 text-xs ".concat(t?"text-gray-400":"text-gray-500"),children:"Scheduled campaigns that reach out to your leads automatically — even with the app closed."}),k?(0,n.jsx)("p",{className:"text-sm text-gray-400",children:"Loading…"}):0===x.length?(0,n.jsxs)("div",{className:"rounded-xl border p-6 text-center ".concat(Z),children:[(0,n.jsx)(l.A,{className:"mx-auto h-8 w-8 ".concat(t?"text-gray-600":"text-gray-300")}),(0,n.jsx)("p",{className:"mt-2 text-sm font-medium",children:"No automated campaigns yet"}),(0,n.jsx)("p",{className:"mt-1 text-xs ".concat(t?"text-gray-400":"text-gray-500"),children:"Create one to start reaching leads on a schedule."})]}):(0,n.jsx)("div",{className:"space-y-2",children:x.map(e=>(0,n.jsx)("div",{className:"rounded-xl border p-3 shadow-sm ".concat(Z),children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"truncate text-sm font-semibold",children:e.name}),(0,n.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium ".concat("gmail"===e.channel?"bg-blue-100 text-blue-700":"bg-indigo-100 text-indigo-700"),children:"gmail"===e.channel?"Gmail":"LinkedIn"}),(0,n.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium ".concat("active"===e.status?"bg-green-100 text-green-700":"bg-gray-200 text-gray-600"),children:e.status}),e.draft_mode&&(0,n.jsx)("span",{className:"rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-700",children:"Draft"})]}),(0,n.jsxs)("p",{className:"mt-0.5 text-xs ".concat(t?"text-gray-400":"text-gray-500"),children:["Up to ",e.daily_limit,"/day \xb7 starts ",A(e.send_hour),e.last_status?" \xb7 ".concat(e.last_status.replace(/_/g," ")):""]})]}),(0,n.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>J(e),"aria-label":"active"===e.status?"Pause":"Resume",className:"rounded-lg p-1.5 ".concat(t?"hover:bg-gray-700":"hover:bg-gray-100"),children:"active"===e.status?(0,n.jsx)(o.A,{className:"h-4 w-4"}):(0,n.jsx)(r.A,{className:"h-4 w-4"})}),(0,n.jsx)("button",{type:"button",onClick:()=>{var a,t,n,s,l,i,o,r,c,d;D({id:e.id,name:e.name,channel:e.channel,daily_limit:e.daily_limit,send_hour:e.send_hour,timezone:e.timezone,send_days:e.send_days,locations:null!=(l=null==(a=e.icp_criteria)?void 0:a.locations)?l:[],employee_ranges:null!=(i=null==(t=e.icp_criteria)?void 0:t.employee_ranges)?i:[],industries:null!=(o=null==(n=e.icp_criteria)?void 0:n.industries)?o:[],titles:null!=(r=null==(s=e.icp_criteria)?void 0:s.titles)?r:[],new_share_pct:e.new_share_pct,followup_gap_days:e.followup_gap_days,linkedin_connect_policy:e.linkedin_connect_policy,campaign_instruction:null!=(c=e.campaign_instruction)?c:"",notify_out_of_leads:e.notify_out_of_leads,draft_mode:null!=(d=e.draft_mode)&&d}),O(!1),E("form")},"aria-label":"Edit",className:"rounded-lg p-1.5 ".concat(t?"hover:bg-gray-700":"hover:bg-gray-100"),children:(0,n.jsx)(c.A,{className:"h-4 w-4"})}),(0,n.jsx)("button",{type:"button",onClick:()=>R(e),"aria-label":"Delete",className:"rounded-lg p-1.5 text-red-500 ".concat(t?"hover:bg-gray-700":"hover:bg-gray-100"),children:(0,n.jsx)(d.A,{className:"h-4 w-4"})})]})]})},e.id))}),(0,n.jsxs)("button",{type:"button",onClick:()=>{D(z()),O(!1),G(null),E("form")},className:"mt-3 flex w-full items-center justify-center gap-1.5 rounded-xl border py-2 text-sm font-medium shadow-sm hover:shadow-md ".concat(Z),children:[(0,n.jsx)(u.A,{className:"h-4 w-4"})," New automated engage"]})]}),"form"===T&&(0,n.jsxs)("div",{className:"space-y-4",children:[I&&(0,n.jsx)("div",{className:"rounded-xl border border-amber-300 bg-amber-50 p-3 text-sm text-amber-800",children:"Upgrade to Starter to run AutoEngage without even opening the website."}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:K,children:"Channel"}),(0,n.jsx)("div",{className:"flex gap-2",children:["gmail","linkedin"].map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>D(a=>{if(a.channel===e)return a;let t=z();return{...t,id:a.id,name:a.name,channel:e,daily_limit:Math.min(t.daily_limit,p[e])}}),className:"flex-1 rounded-xl border py-2 text-sm font-medium ".concat(M.channel===e?t?"bg-gray-700 border-gray-600":"bg-[#f0f1f4] border-[#e5e5e3]":Z),children:"gmail"===e?"Gmail":"LinkedIn"},e))})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:K,children:"Name"}),(0,n.jsx)("input",{className:B,value:M.name,onChange:e=>D(a=>({...a,name:e.target.value})),placeholder:"Q3 CTO outreach"})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:K,children:["Message up to how many leads per day? (max ",Y,")"]}),(0,n.jsx)("input",{type:"number",min:1,max:Y,className:B,value:M.daily_limit,onChange:e=>D(a=>({...a,daily_limit:Math.max(1,Math.min(Y,Number(e.target.value)||1))}
1))}),"linkedin"===M.channel&&(0,n.jsxs)("div",{className:"mt-1.5 flex items-start gap-1.5 rounded-lg bg-amber-50 p-2 text-[11px] text-amber-800",children:[(0,n.jsx)(m.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,n.jsx)("span",{children:"Higher LinkedIn volume raises the risk of account restriction. We cap this at 10/day for safety."})]})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:K,children:"Start hour (local)"}),(0,n.jsx)("select",{className:B,value:M.send_hour,onChange:e=>D(a=>({...a,send_hour:Number(e.target.value)})),children:Array.from({length:24},(e,a)=>(0,n.jsx)("option",{value:a,children:A(a)},a))})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:K,children:"Timezone"}),(0,n.jsx)("select",{className:B,value:M.timezone,onChange:e=>D(a=>({...a,timezone:e.target.value})),children:W.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:K,children:"Send days"}),(0,n.jsx)("div",{className:"flex gap-1",children:f.map(e=>{let a=M.send_days.includes(e.v);return(0,n.jsx)("button",{type:"button",onClick:()=>D(t=>({...t,send_days:a?t.send_days.filter(a=>a!==e.v):[...t.send_days,e.v].sort()})),className:"h-8 w-8 rounded-lg text-xs font-medium ".concat(a?t?"bg-gray-600 text-white":"bg-gray-800 text-white":Z),children:e.l},e.v)})})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("span",{className:K,children:"Who to reach (ICP)"}),(0,n.jsx)(g.c,{placeholder:"Locations",options:N(b,M.locations),value:M.locations,onChange:e=>D(a=>({...a,locations:e})),grouped:!0,isDark:t,variant:"sidebar"}),(0,n.jsx)(g.c,{placeholder:"Industries",options:N(v,M.industries),value:M.industries,onChange:e=>D(a=>({...a,industries:e})),isDark:t,variant:"sidebar"}),(0,n.jsx)(g.c,{placeholder:"Company size",options:N(_,M.employee_ranges),value:M.employee_ranges,onChange:e=>D(a=>({...a,employee_ranges:e})),isDark:t,variant:"sidebar"}),(0,n.jsx)(g.c,{placeholder:"Job titles",options:N(j,M.titles),value:M.titles,onChange:e=>D(a=>({...a,titles:e})),searchable:!0,isDark:t,variant:"sidebar",addCustom:{label:"Add custom title…",placeholder:"e.g. Head of Growth",onAdd:async e=>e.trim()||null}}),null!==U&&(0,n.jsxs)("p",{className:"text-xs ".concat(t?"text-gray-400":"text-gray-500"),children:["~",U," leads match right now"]})]}),"gmail"===M.channel?(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:K,children:[M.new_share_pct,"% new leads \xb7 ",100-M.new_share_pct,"% follow-ups"]}),(0,n.jsx)("input",{type:"range",min:0,max:100,step:5,value:M.new_share_pct,className:"w-full",onChange:e=>D(a=>({...a,new_share_pct:Number(e.target.value)}))}),(0,n.jsx)("label",{className:"".concat(K," mt-2"),children:"Follow up no sooner than (days)"}),(0,n.jsx)("input",{type:"number",min:3,max:30,className:B,value:M.followup_gap_days,onChange:e=>D(a=>({...a,followup_gap_days:Math.max(3,Math.min(30,Number(e.target.value)||3))}))})]}):(0,n.jsx)("p",{className:"text-xs ".concat(t?"text-gray-400":"text-gray-500"),children:"LinkedIn engages new connections; the message auto-sends when they accept."}),"linkedin"===M.channel&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:K,children:"When not connected"}),(0,n.jsxs)("select",{className:B,value:M.linkedin_connect_policy,onChange:e=>D(a=>({...a,linkedin_connect_policy:e.target.value})),children:[(0,n.jsx)("option",{value:"request_and_message",children:"Connect + auto-send on accept"}),(0,n.jsx)("option",{value:"request",children:"Send a connection request only"}),(0,n.jsx)("option",{value:"skip",children:"Skip the contact"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:K,children:"Campaign instruction (optional)"}),(0,n.jsx)("textarea",{rows:3,className:B,value:M.campaign_instruction,onChange:e=>D(a=>({...a,campaign_instruction:e.target.value})),placeholder:"What's this campaign about? The AI uses this to angle each message."})]}),(0,n.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)("input",{type:"checkbox",checked:M.notify_out_of_leads,onChange:e=>D(a=>({...a,notify_out_of_leads:e.target.checked}))}),"Email me when this runs out of leads"]}),"gmail"===M.channel&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)("input",{type:"checkbox",checked:M.draft_mode,onCh
1ange:e=>D(a=>({...a,draft_mode:e.target.checked}))}),"Draft mode — create Gmail drafts instead of sending"]}),(0,n.jsx)("p",{className:"mt-1 pl-6 text-[11px] ".concat(t?"text-gray-400":"text-gray-500"),children:"Each lead gets a ready-to-send draft in your Gmail Drafts folder to review and send yourself. Nothing goes out automatically."})]}),(0,n.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>E("list"),className:"flex-1 rounded-xl border py-2 text-sm font-medium ".concat(Z),children:"Cancel"}),(0,n.jsx)("button",{type:"button",onClick:F,disabled:P,className:"flex-1 rounded-xl border py-2 text-sm font-semibold shadow-sm hover:shadow-md disabled:opacity-50 ".concat(Z),children:P?"Saving…":M.id?"Save changes":"Create campaign"})]})]})]})]})}},98498:(e,a,t)=>{t.d(a,{A:()=>s});var n=t(12115);let s=n.forwardRef(function(e,a){let{title:t,titleId:s,...l}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?n.createElement("title",{id:s},t):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25v13.5m-7.5-13.5v13.5"}))})}}]);

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.