PageSourceSearch

https://www.promoamp.com/_app/immutable/nodes/32.CvPG8EKd.js

js promoamp.com collected 2026-09-25 18:44:22 UTC 9,594 bytes, 6 lines download raw bytes

1import"../chunks/NZTpNUN0.js";import{p as Ze,l as k,v as Z,H as et,a,b as tt,s as rt,c as l,f as A,e as at,j as e,n as m,r as c,d as s,i as f,g as p,o as r,t as U,u as Le,m as J}from"../chunks/CswluXHk.js";import{s as q}from"../chunks/D5MUd0dc.js";import{i as ee}from"../chunks/Cvwav-Rz.js";import{e as st,i as ot}from"../chunks/DLuIJL9M.js";import{c as u}from"../chunks/DCqg9Lcd.js";import{d as nt,a as it}from"../chunks/BnZqlU5Q.js";import{g as lt}from"../chunks/CdQ3TTyj.js";import{p as ct}from"../chunks/BfpkmJ9v.js";import"../chunks/aH0YTA77.js";import{t as j}from"../chunks/CFi-xeDB.js";import{B as ne}from"../chunks/DltdByd6.js";import{I as Te}from"../chunks/DuX34-Zw.js";import{C as dt}from"../chunks/BFGY4aR1.js";import{C as mt}from"../chunks/C3F0Z4bJ.js";import{C as ut,a as vt,b as ft}from"../chunks/DQXZ4mXD.js";import{C as pt}from"../chunks/BcsrqGLJ.js";import{R as gt,S as ht,a as _t,b as ye}from"../chunks/CbCzraWd.js";import{A as yt}from"../chunks/r7UZdRXb.js";var je=A("<!> <!>",1),$t=A('<div class="border-t pt-4 mt-4"><h3 class="font-medium text-base mb-3">Step 2: Select a Benchmark List</h3> <div class="space-y-2"><label for="listId" class="text-sm font-medium">Select List</label> <!> <p class="text-sm text-gray-500">Select the Benchmark list you want to sync contacts with.</p> <div class="mt-2"><!> <!></div></div></div>'),bt=A('<p class="text-red-500 text-sm"> </p>'),kt=A(`<div class="bg-blue-50 p-3 rounded-md mb-4 text-sm"><p>This integration requires two steps: first enter and save your API
2          token and username, then select which Benchmark list to use.</p></div> <form class="space-y-4"><div><div class="space-y-4"><div class="space-y-2"><label for="apiKey" class="text-sm font-medium">API Token</label> <!> <p class="text-sm text-gray-500">Your Benchmark API token can be found in your account settings
3                under API Integration.</p></div> <div class="space-y-2"><label for="username" class="text-sm font-medium">Username</label> <!> <p class="text-sm text-gray-500">Your Benchmark username is the email address you use to log in
4                to your account.</p></div> <div class="mt-4"><!></div></div></div> <!> <!></form>`,1),xt=A('<div class="flex items-center gap-4"><p class="text-sm text-gray-500">Need help? <a href="https://www.benchmarkemail.com/developers/" target="_blank" rel="noopener noreferrer" class="text-blue-500 hover:underline">Learn how to get your API token</a></p></div> <div class="space-x-2"><!></div>',1),wt=A("<!> <!> <!>",1),St=A('<div class="mb-20"><button class="flex items-center text-sm text-gray-600 hover:text-gray-900 mb-4"><!> Back to Integrations</button> <!></div>');function zt(Ae,ie){Ze(ie,!0);const Fe=()=>at(ct,"$page",Oe),[Oe,Ne]=rt(),_=ie.data.benchmarkIntegration||{config:{api_key:"",username:"",list_id:""}},te=ie.data.team;let y=k(Z(_?.config?.api_key||"")),$=k(Z(_?.config?.username||"")),x=k(Z(_?.config?.list_id||"")),I=k(Z([])),o=k(""),g=k(!1),le=k(!1),C=k(!1),F=k(Z(!!_?.config?.api_key&&!!_?.config?.username));async function re(){if(!(!e(y)||!e($)))try{r(C,!0);const t=await fetch("/api/integrations/benchmark/lists",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:te.id})}),h=await t.json();if(!t.ok)throw new Error(h.error||"Failed to fetch Benchmark lists");r(I,h.lists||[],!0)}catch(t){console.error("Error fetching Benchmark lists:",t),r(o,t instanceof Error?t.message:"Failed to fetch lists from Benchmark",!0),j.error(e(o),{position:"top-right"})}finally{r(C,!1)}}async function Re(){try{if(r(o,""),r(g,!0),!e(y)){r(o,"API Key (Token) is required");return}if(!e($)){r(o,"Username is required");return}const t=_?.config?.api_key||"",h=_?.config?.username||"";if(!(!e(F)||e(y)!==t||e($)!==h)){await re();return}const de=await fetch("/api/install/benchmark",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:te.id,config:{api_key:e(y),username:e($)}})}),se=await de.json();if(!de.ok)throw new Error(se.error||"Failed to save credentials");r(F,!0),await re(),j.success("Benchmark credentials saved successfully",{position:"top-right"})}catch(t){console.error("Error saving Benchmark credentials:",t),r(o,t instanceof Error?t.message:"Failed to save credentials",!0),j.error(e(o),{position:"top-right"})}finally{r(g,!1)}}async function Ke(){try{if(r(o,""),r(g,!0),!e(x)){r(o,"Please select a list");return}const t=await fetch("/api/install/benchmark",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:te.id,config:{api_key:e(y),username:e($),list_id:e(x)}})}),h=await t.json();if(!t.ok)throw new Error(h.error||"Failed to save list selection");j.success("Benchmark list selection saved successfully",{position:"top-right"})}catch(t){console.error("Error saving Benchmark list selection:",t),r(o,t instanceof Error?t.message:"Failed to save list selection",!0),j.error(e(o),{position:"top-right"})}finally{r(g,!1)}}async function Ue(){try{r(le,!0);const t=await fetch("/api/install/benchmark",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:te.id})}),h=await t.json();if(!t.ok)throw new Error(h.error||"Failed to remove integration");r(y,""),r($,""),r(x,""),r(I,[],!0),r(F,!1),j.success("Benchmark integration removed successfully",{position:"top-right"})}catch(t){console.error("Error removing Benchmark integration:",t),r(o,t instanceof Error?t.message:"Failed to remove integration",!0),j.error(e(o),{position:"top-right"})}finally{r(le,!1)}}et(()=>{e(F)&&!e(I).length&&re()});var ce=St(),ae=l(ce),Je=l(ae);yt(Je,{class:"w-4 h-4 mr-1"}),m(),c(ae);var qe=s(ae,2);u(qe,()=>dt,(t,h)=>{h(t,{class:"my-4",children:($e,de)=>{var se=wt(),be=f(se);u(be,()=>ut,(Y,D)=>{D(Y,{children:(H,xe)=>{var w=je(),S=f(w);u(S,()=>vt,(P,v)=>{v(P,{class:"text-lg font-semibold",children:(L,O)=>{m();var T=p("Benchmark Integration");a(L,T)},$$slots:{default:!0}})});var E=s(S,2);u(E,()=>ft,(P,v)=>{v(P,{children:(L,O)=>{m();var T=p(`Connect your Benchmark Email account to sync contacts and manage email
5        campaigns.`);a(L,T)},$$slots:{default:!0}})}),a(H,w)},$$slots:{default:!0}})});var ke=s(be,2);u(ke,()=>mt,(Y,D)=>{D(Y,{children:(H,xe)=>{var w=kt(),S=s(f(w),2),E=l(S),P=l(E),v=l(P),L=s(l(v),2);Te(L,{id:"apiKey",type:"text",placeholder:"Enter your Benchmark API token",class:"w-full",get disabled(){return e(g)},get value(){return e(y)},set value(i){r(y,i,!0)}}),m(2),c(v);var O=s(v,2),T=s(l(O),2);Te(T,{id:"username",type:"text",placeholder:"Enter your Benchmark username",class:"w-full",get disabled(){return e(g)},get value(){return e($)},set value(i){r($,i,!0)}}),m(2),c(O);var we=s(O,2),De=l(we);{let i=Le(()=>!e(y)||!e($));ne(De,{type:"button",onclick:Re,get isLoading(){return e(g)},get disabled(){return e(i)},children:(b,z)=>{m();var G=p();U(()=>q(G,e(F)?"Update Credentials":"Save Credentials")),a(b,G)},$$slots:{default:!0}})}c(we),c(P),c(E);var Se=s(E,2);{var He=i=>{var b=$t(),z=s(l(b),2),G=s(l(z),2);u(G,()=>gt,(M,oe)=>{oe(M,{type:"single",get value(){return e(x)},set value(N){r(x,N,!0)},children:(N,me)=>{var Ie=je(),Ce=f(Ie);u(Ce,()=>ht,(ue,ve)=>{ve(ue,{id:"listId",class:"w-full",get disabled(){return e(C)},children:(fe,Ve)=>{var Q=J(),pe=f(Q);{var ge=B=>{var n=p();U(d=>q(n,d),[()=>e(I).find(d=>d.id===e(x))?.name||"Select a Benchmark list"]),a(B,n)},he=B=>{var n=p();U(()=>q(n,e(C)?"Loading lists...":"Select a Benchmark list")),a(B,n)};ee(pe,B=>{e(x)&&e(I).length>0?B(ge):B(he,-1)})}a(fe,Q)},$$slots:{default:!0}})});var Qe=s(Ce,2);u(Qe,()=>_t,(ue,ve)=>{ve(ue,{children:(fe,Ve)=>{var Q=J(),pe=f(Q);{var ge=n=>{var d=J(),V=f(d);u(V,()=>ye,(W,R)=>{R(W,{value:"",disabled:!0,children:(K,_e)=>{m();var X=p("Loading lists...");a(K,X)},$$slots:{default:!0}})}),a(n,d)},he=n=>{var d=J(),V=f(d);u(V,()=>ye,(W,R)=>{R(W,{value:"",disabled:!0,children:(K,_e)=>{m();var X=p("No lists found");a(K,X)},$$slots:{default:!0}})}),a(n,d)},B=n=>{var d=J(),V=f(d);st(V,17,()=>e(I),ot,(W,R)=>{var K=J(),_e=f(K);u(_e,()=>ye,(X,We)=>
5{We(X,{get value(){return e(R).id},children:(Xe,Pt)=>{m();var Ee=p();U(()=>q(Ee,e(R).name)),a(Xe,Ee)},$$slots:{default:!0}})}),a(W,K)}),a(n,d)};ee(pe,n=>{e(C)?n(ge):e(I).length===0?n(he,1):n(B,-1)})}a(fe,Q)},$$slots:{default:!0}})}),a(N,Ie)},$$slots:{default:!0}})});var Pe=s(G,4),Be=l(Pe);{let M=Le(()=>!e(x)||e(C));ne(Be,{type:"button",onclick:Ke,get isLoading(){return e(g)},get disabled(){return e(M)},children:(oe,N)=>{m();var me=p();U(()=>q(me,_?.config?.list_id?"Update List Selection":"Save List Selection")),a(oe,me)},$$slots:{default:!0}})}var Me=s(Be,2);ne(Me,{type:"button",variant:"outline",class:"ml-2",onclick:re,get isLoading(){return e(C)},get disabled(){return e(g)},children:(M,oe)=>{m();var N=p("Refresh Lists");a(M,N)},$$slots:{default:!0}}),c(Pe),c(z),c(b),a(i,b)};ee(Se,i=>{e(F)&&i(He)})}var ze=s(Se,2);{var Ge=i=>{var b=bt(),z=l(b,!0);c(b),U(()=>q(z,e(o))),a(i,b)};ee(ze,i=>{e(o)&&i(Ge)})}c(S),a(H,w)},$$slots:{default:!0}})});var Ye=s(ke,2);u(Ye,()=>pt,(Y,D)=>{D(Y,{class:"flex justify-between items-center border-t bg-gray-50 rounded-b-[11px] py-4",children:(H,xe)=>{var w=xt(),S=s(f(w),2),E=l(S);{var P=v=>{ne(v,{variant:"destructive",onclick:Ue,get isLoading(){return e(le)},get disabled(){return e(g)},children:(L,O)=>{m();var T=p("Remove Connection");a(L,T)},$$slots:{default:!0}})};ee(E,v=>{_?.config?.api_key&&v(P)})}c(S),a(H,w)},$$slots:{default:!0}})}),a($e,se)},$$slots:{default:!0}})}),c(ce),it("click",ae,()=>lt(`/brand/${Fe().params.teamSlug}/settings/integrations`)),a(Ae,ce),tt(),Ne()}nt(["click"]);export{zt as component};
6//# sourceMappingURL=32.CvPG8EKd.js.map

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.