PageSourceSearch

https://www.marketninja.ai/_next/static/chunks/36710.d2a3c8b2b257ab3f.js

js marketninja.ai collected 2026-10-05 13:38:13 UTC 30,746 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]="bab61965-4a2d-4273-ac0f-45879a631478",e._sentryDebugIdIdentifier="sentry-dbid-bab61965-4a2d-4273-ac0f-45879a631478")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[36710],{6281:(e,t,s)=>{s.d(t,{GB:()=>i,WR:()=>l}),(0,s(45348).aQ)();let n={traffic:"Traffic",search_visibility:"Search visibility",rankings:"Rankings",business_outcomes:"Business outcomes"},a=["traffic","search_visibility","rankings","business_outcomes"];function i(e,t){if(null==e||Number.isNaN(e))return"—";switch(t){case"percent":return"".concat(e.toLocaleString(void 0,{maximumFractionDigits:1}),"%");case"decimal":return e.toLocaleString(void 0,{minimumFractionDigits:1,maximumFractionDigits:1});case"currency":return e.toLocaleString(void 0,{style:"currency",currency:"GBP",maximumFractionDigits:0});default:return e.toLocaleString(void 0,{maximumFractionDigits:0})}}function l(e){return a.map(t=>({group:t,label:n[t],metrics:e.filter(e=>e.group===t)})).filter(e=>e.metrics.length>0)}},36710:(e,t,s)=>{s.r(t),s.d(t,{default:()=>y});var n=s(95155),a=s(12115),i=s(88125),l=s(6956),r=s(52704),o=s(10874),c=s(87796),d=s(3941),u=s(1488);function f(e){return"tracking_setup_active_tests:".concat(e)}var m=s(45348),p=s(46589),x=s(93101),b=s(97052);function h(e){var t,s,i;let{businessSlug:l,snippets:o,saving:c,onSave:d,onConfirm:u,snippetsAddressed:f}=e,m=l?"/businesses/".concat(l,"/website/advanced"):null,[p,x]=(0,a.useState)(o);(0,a.useEffect)(()=>{x(o)},[o]);let h=m?(0,n.jsx)(b.A,{href:m,className:"text-cyan-200 underline hover:text-cyan-100",children:"Website → Advanced"}):"Website → Advanced";return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("p",{className:"text-base text-[#ffffff]/60",children:["Add tracking codes so you can see what visitors do on your site. We inject them correctly when visitors accept cookies. If you already set these on ",h,", they will appear here too."]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"mb-1 block text-sm font-medium text-[#ffffff]/80",children:"Google Search Console verification"}),(0,n.jsxs)("p",{className:"mb-2 text-xs text-[#ffffff]/45",children:["Paste the ",(0,n.jsx)("strong",{className:"text-white/70",children:"content"})," value only from Google's HTML tag — not the whole meta tag."]}),(0,n.jsx)("input",{type:"text",value:null!=(t=p.google_site_verification)?t:"",onChange:e=>x(t=>({...t,google_site_verification:e.target.value})),disabled:c,className:"w-full rounded-xl border border-white/15 bg-black/30 px-3 py-2.5 text-sm font-mono text-white placeholder:text-white/30 disabled:opacity-50",placeholder:"e.g. AbCdEf123…",autoComplete:"off"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"mb-1 block text-sm font-medium text-[#ffffff]/80",children:"Google Analytics 4 Measurement ID"}),(0,n.jsxs)("p",{className:"mb-2 text-xs text-[#ffffff]/45",children:["From GA4 Admin → Data streams — format ",(0,n.jsx)("code",{className:"rounded bg-white/10 px-1",children:"G-XXXXXXXXXX"}),"."]}),(0,n.jsx)("input",{type:"text",value:null!=(s=p.ga4_measurement_id)?s:"",onChange:e=>x(t=>({...t,ga4_measurement_id:e.target.value})),disabled:c,className:"w-full rounded-xl border border-white/15 bg-black/30 px-3 py-2.5 text-sm font-mono text-white placeholder:text-white/30 disabled:opacity-50",placeholder:"G-XXXXXXXXXX",autoComplete:"off"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"mb-1 block text-sm font-medium text-[#ffffff]/80",children:"Microsoft Clarity project ID"}),(0,n.jsxs)("p",{className:"mb-2 text-xs text-[#ffffff]/45",children:["From"," ",(0,n.jsx)("a",{href:"https://clarity.microsoft.com",target:"_blank",rel:"noopener noreferrer",className:"text-cyan-200 underline hover:text-cyan-100",children:"clarity.microsoft.com"})," ","→ your project → Setup. Project ID only — not the full script."]}),(0,n.jsx)("input",{type:"text",value:null!=(i=p.clarity_project_id)?i:"",onCh
1ange:e=>x(t=>({...t,clarity_project_id:e.target.value})),disabled:c,className:"w-full rounded-xl border border-white/15 bg-black/30 px-3 py-2.5 text-sm font-mono text-white placeholder:text-white/30 disabled:opacity-50",placeholder:"abc12def34",autoComplete:"off"})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,n.jsx)("button",{type:"button",disabled:c,onClick:()=>void d(p),className:"rounded-full bg-[#f72685] px-4 py-2.5 text-sm font-semibold text-white disabled:opacity-50",children:c?"Saving…":"Save tracking codes"}),f?(0,n.jsx)("span",{className:"inline-flex items-center text-sm text-emerald-200/80",children:"Tracking codes confirmed."}):(0,n.jsx)("button",{type:"button",disabled:c,onClick:()=>void u(),className:"rounded-full border border-white/15 bg-white/[0.08] px-4 py-2.5 text-sm font-semibold text-[#ffffff] transition hover:bg-white/[0.12] disabled:opacity-50",children:"Codes are on my live site"})]}),m?(0,n.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-200 hover:text-cyan-100",children:["Open full Advanced settings",(0,n.jsx)(r.A,{className:"h-4 w-4"})]}):null]})}function g(e){return!!e&&(0,u.OT)(e)}function y(e){let{taskId:t,businessId:s,onGateChange:b,onWorkspaceMetaChange:y}=e,{loading:v,error:w,connections:j,progress:N,baselineConfig:k,goals:_,baselineSnapshot:C,activeTests:S,startingTestGoalId:A,saving:I,capturingBaseline:O,addressConnections:G,startConversionTest:E,confirmConversionManual:L,skipOptionalConversion:T,skipRequiredConversion:X,captureBaseline:R,siteSnippets:D,showSiteTrackingSnippets:M,businessSlug:U,strategyKey:F,updateSiteSnippets:q,confirmSiteSnippets:J}=function(e,t){let[s,n]=(0,a.useState)(!0),[i,l]=(0,a.useState)(null),[r,o]=(0,a.useState)(null),[c,m]=(0,a.useState)(null),[p,x]=(0,a.useState)(null),[b,h]=(0,a.useState)(null),[g,y]=(0,a.useState)([]),[v,w]=(0,a.useState)(null),[j,N]=(0,a.useState)({ga4_measurement_id:null,google_site_verification:null,clarity_project_id:null}),[k,_]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[A,I]=(0,a.useState)(null),[O,G]=(0,a.useState)({}),[E,L]=(0,a.useState)(null),[T,X]=(0,a.useState)(!1),[R,D]=(0,a.useState)(!1),M=(0,a.useRef)({}),U=(0,a.useRef)({}),F=(0,a.useRef)(t),q=(0,a.useRef)([]);(0,a.useEffect)(()=>{F.current=t},[t]);let J=(0,a.useCallback)(async()=>{let{data:{session:e}}=await d.supabase.auth.getSession(),t={};return(null==e?void 0:e.access_token)&&(t.Authorization="Bearer ".concat(e.access_token)),t},[]),K=(0,a.useCallback)(t=>{!function(e,t){let s=Object.keys(e),n=Object.keys(t);return s.length===n.length&&s.every(s=>{let n=e[s],a=t[s];return!!a&&n.sessionId===a.sessionId&&n.startedAt===a.startedAt&&n.status===a.status&&n.testUrl===a.testUrl&&!!n.preparing==!!a.preparing})}(U.current,t)&&(U.current=t,G(t),e&&function(e,t){try{if(0===Object.keys(t).length)return void sessionStorage.removeItem(f(e));sessionStorage.setItem(f(e),JSON.stringify(t))}catch(e){}}(e,Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return!t.preparing&&t.testUrl}))))},[e]),B=(0,a.useCallback)(e=>{clearInterval(M.current[e]),delete M.current[e]},[]),P=(0,a.useCallback)(async t=>{if(!e)return;let s=(null==t?void 0:t.showLoading)!==!1;s&&(n(!0),l(null));try{var a,i,r,c,d,u,p;let t=await J(),s=await fetch("/api/tasks/".concat(e,"/tracking-setup"),{headers:t}),n=await s.json().catch(()=>({}));if(!s.ok)throw Error(n.error||"Could not load tracking setup");o(null!=(i=n.connections)?i:null),m(null!=(r=n.storefrontOrigin)?r:null);let l=null!=(c=n.progress)?c:null;x(l),q.current=(null==l?void 0:l.verifiedGoalIds)||[],null==(a=F.current)||a.call(F,l),h(null!=(d=n.baselineConfig)?d:null),y(Array.isArray(n.goals)?n.goals:[]),w(null!=(u=n.baselineSnapshot)?u:null),N(null!=(p=n.siteSnippets)?p:{ga4_measurement_id:null,google_site_verification:null,clarity_project_id:null}),_(!!n.showSiteTrackingSnippets),S("string"==typeof n.businessSlug?n.businessSlug:null),I("string"==typeof n.strategyKey?n.strategyKey:null);let b=function(e){try{let t=sessionStorage.getItem(f(e));if(!t)return{};let s=JSON.parse(t);return s&&"object"==typeof s?s:{}}catch(e){return{}}}(e),g=new Set((null==l?void 0:l.verifiedGoalIds)||[]),v={};for(let[e,t]of Object.entries(b))g.has(e)||(v[e]=t);K(v)}catch(e){l(e instanceof Error?e.message:"Could not load tracking setup")}finally{s&&n(!1)}},[J,K,e]),W=(0,a.useCallback)(async t=>{if(!e)return null;X(!0);try{let n={"Content-Type":"application/json",...await J()},a=await fetch("/api/tasks/".concat(e,"/tracking-setup"),{method:"POST",headers:n,body:JSON.stringify(t)}),i=await a.json().catch(()=>({}));if(!a.ok)throw Error(i.error||"Request failed");if(i.progress){var s;x(i.progress),q.current=i.progress.verifiedGoalIds||[],null==(s=F.current)||s.call(F,i.progress)}return i.baselineSnapshot&&w(i.baselineSnapshot),i.siteSnippets&&N(i.siteSnippets),i}finally{X(!1)}},[J,e]),Q=(0,a.useCallback)(async t=>{var s;if(!e)return;let n=U.current[t];if(!n||n.preparing)return;let a=await J(),i=new URLSearchParams({pollGoalId:n.goalId,sessionId:n.sessionId,since:n.startedAt}),l=await fetch("/api/tasks/".concat(e,"/tracking-setup?").concat(i),{headers:a}),r=(null==(s=(await l.json().catch(()=>({}))).pollResult)?void 0:s.status)||"pending",o=(0,u.JU)(r);
1if(K({...U.current,[t]:{...n,status:r,message:o}}),"detected"===r){B(t),await W({action:"confirm_conversion_verified",goalId:n.goalId,sessionId:n.sessionId,since:n.startedAt});let e={...U.current};delete e[t],K(e),await P({showLoading:!1})}},[J,W,P,B,K,e]),V=(0,a.useCallback)(e=>{B(e),M.current[e]=setInterval(()=>{Q(e)},3e3),Q(e)},[Q,B]);(0,a.useEffect)(()=>e?(P({showLoading:!0}),()=>{Object.values(M.current).forEach(clearInterval),M.current={}}):void n(!1),[e,P]),(0,a.useEffect)(()=>{if(s||!e)return;let t=q.current;for(let e of Object.keys(U.current)){if(t.includes(e)){B(e);continue}M.current[e]||V(e)}},[O,s,V,B,e]);let Y=(0,a.useCallback)(async e=>{await W({action:"address_connections",choice:e}),await P({showLoading:!1})},[W,P]),z=(0,a.useCallback)(async t=>{if(!e||E)return;let s={goalId:t,sessionId:"",startedAt:new Date().toISOString(),testUrl:"",status:"pending",message:(0,u.IK)(),preparing:!0};L(t),l(null),K({...U.current,[t]:s});try{let s={"Content-Type":"application/json",...await J()},n=await fetch("/api/tasks/".concat(e,"/tracking-setup"),{method:"POST",headers:s,body:JSON.stringify({action:"start_conversion_test",goalId:t})}),a=await n.json().catch(()=>({}));if(!n.ok)throw Error(a.error||"Could not start conversion test");if(!(null==a?void 0:a.sessionId)||!(null==a?void 0:a.startedAt)||!(null==a?void 0:a.testUrl))throw Error("Could not start conversion test");let i={goalId:t,sessionId:a.sessionId,startedAt:a.startedAt,testUrl:a.testUrl,status:"pending",message:(0,u.JU)("pending"),preparing:!1};K({...U.current,[t]:i}),V(t)}catch(s){let e={...U.current};delete e[t],K(e),l(s instanceof Error?s.message:"Could not start conversion test")}finally{L(null)}},[J,V,E,K,e]),H=(0,a.useCallback)(async e=>{let t=U.current[e];if(!t)return;await W({action:"confirm_conversion_manual",goalId:e,sessionId:t.sessionId,since:t.startedAt}),B(e);let s={...U.current};delete s[e],K(s),await P({showLoading:!1})},[W,P,B,K]),Z=(0,a.useCallback)(async e=>{await W({action:"skip_optional_conversion",goalId:e}),B(e);let t={...U.current};delete t[e],K(t),await P({showLoading:!1})},[W,P,B,K]),$=(0,a.useCallback)(async e=>{await W({action:"skip_required_conversion",goalId:e}),B(e);let t={...U.current};delete t[e],K(t),await P({showLoading:!1})},[W,P,B,K]),ee=(0,a.useCallback)(async e=>{D(!0);try{await W({action:"capture_baseline",...e?{manualMetrics:e}:{}}),await P({showLoading:!1})}finally{D(!1)}},[W,P]);return{loading:s,error:i,connections:r,storefrontOrigin:c,progress:p,baselineConfig:b,goals:g,baselineSnapshot:v,siteSnippets:j,showSiteTrackingSnippets:k,businessSlug:C,strategyKey:A,activeTests:O,startingTestGoalId:E,saving:T,capturingBaseline:R,refresh:()=>P({showLoading:!1}),addressConnections:Y,startConversionTest:z,confirmConversionManual:H,skipOptionalConversion:Z,skipRequiredConversion:$,captureBaseline:ee,updateSiteSnippets:(0,a.useCallback)(async e=>{var t,s,n;N(e),await W({action:"update_site_snippets",ga4_measurement_id:null!=(t=e.ga4_measurement_id)?t:"",google_site_verification:null!=(s=e.google_site_verification)?s:"",clarity_project_id:null!=(n=e.clarity_project_id)?n:""}),await P({showLoading:!1})},[W,P]),confirmSiteSnippets:(0,a.useCallback)(async()=>{await W({action:"confirm_site_snippets"}),await P({showLoading:!1})},[W,P])}}(t,(0,a.useCallback)(e=>{null==b||b(!!(null==e?void 0:e.gateSatisfied),e)},[b])),[K,B]=(0,a.useState)({}),[P,W]=(0,a.useState)(null),Q=(0,a.useRef)(!1),V=(0,a.useRef)(null);(0,a.useEffect)(()=>{!v&&N&&!Q.current&&(Q.current=!0,W(!M||(null==N?void 0:N.siteSnippetsAddressed)?(null==N?void 0:N.connectionsAddressed)?g(N)?N.baselineCaptured||!1!==N.gateSatisfied?null:"baseline":"conversions":"connections":"site_snippets"))},[v,N,M]),(0,a.useEffect)(()=>{let e=V.current;if(!N){V.current=N;return}e&&(M&&!e.siteSnippetsAddressed&&N.siteSnippetsAddressed?W("connections"):!e.connectionsAddressed&&N.connectionsAddressed?W("conversions"):!g(e)&&g(N)&&W("pco"===F?null:"baseline")),V.current=N},[N]),(0,a.useEffect)(()=>{!v&&D&&(null==y||y({siteSnippets:D,showSiteTrackingSnippets:M,strategyKey:F}))},[v,y,M,D,F]);let Y=e=>{W(t=>t===e?null:e)};if(v)return(0,n.jsx)("div",{className:"rounded-2xl border border-white/10 bg-black/20 p-6 text-sm text-[#ffffff]/55",children:"Loading tracking setup…"});if(w)return(0,n.jsx)("div",{className:"rounded-2xl border border-amber-300/20 bg-amber-400/10 p-6 text-sm text-amber-100/85",children:w});let z=null==C?void 0:C.metrics,H=(null==k?void 0:k.metrics.filter(e=>"manual"===e.captureMode))||[],Z=(0,m.aQ)(),$=!!(null==N?void 0:N.connectionsAddressed),ee=g(N),et=!!(null==N?void 0:N.baselineCaptured),es=!!(null==N?void 0:N.siteSnippetsAddressed),en="pco"===F,ea=M?2:1,ei=M?3:2,el=M?4:3,er=(null==j?void 0:j.googleAnalytics.connected)||(null==j?void 0:j.searchConsole.connected)?"Google Analytics and Search Console are connected — your baseline will include data from connected sources.":(null==N?void 0:N.connectionsChoice)==="skipped_google"?"Continuing with Market Ninja tracking only.":"Google tools noted — baseline will include connected sources when available.";return(0,n.jsxs)("div",{className:"space-y-3",children:[M?(0,n.jsx)(x.A,{step:1,title:"Add tracking codes to your site",summary:"Google Analytics, Search Console verification, and Microsoft Clarity — so you can see what visitors do.",done:es,isOpen:"site_snippets"===P,onToggle:()=>Y("site_snippets"),children:(0,n.jsx)(h,{businessSlug:U,snippets:D,saving:I,onSave:q,onConfirm:J,snippetsAddressed:es})}):null,(0,n.jsxs)(x.A,{step:ea,title:"Connect Google Analytics & Search Console (optional)",summary:"Market Ninja tracking is enough. Connect Google when you have access for richer reports — or continue without them.",done:$,isOpen:"connections"===P,onToggle:()=>Y("connections"),children:[(0,n.jsx)("p",{className:"text-base text-[#ffffff]/60",children:"Connect Google Analytics and Search Console for richer data."}),(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,n.jsx)("span",{className:"rounded-full border border-emerald-300/20 bg-emerald-400/10 px-3 py-1 text-xs font-medium text-emerald-100",children:"Market Ninja tracking active"}),(null==j?void 0:j.googleAnalytics.connected)?(0,n.jsx)("span",{className:"rounded-full border border-blue-300/20 bg-blue-400/10 px-3 py-1 text-xs font-medium text-blue-100",children:"Google Analytics connected"}):null,(null==j?void 0:j.searchConsole.connected)?(0,n.jsx)("span",{className:"rounded-full border border-cyan-300/20 bg-cyan-400/10 px-3 py-1 text-xs font-medium text-cyan-100",children:"Search Console connected"}):null]}),$?(0,n.jsx)("p",{className:"mt-4 text-sm text-emerald-200/80",children:er}):(0,n.jsxs)("div",{className:"mt-5 space-y-4",children:[(0,n.jsx)(c.Q,{businessId:s,connected:!!(null==j?void 0:j.googleAnalytics.connected),propertyName:null==j?void 0:j.googleAnalytics.propertyName,gaConnected:null==j?void 0:j.googleAnalytics.connected}),(0,n.jsx)(c.b,{businessId:s,connected:!!(null==j?void 0:j.searchConsole.connected),siteName:null==j?void 0:j.searchConsole.siteName,gscConnected:null==j?void 0:j.searchConsole.connected}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,n.jsx)("button",{type:"button",disabled:I,onClick:()=>void G("connected"),className:"rounded-full border border-white/15 bg-white/[0.08] px-4 py-2.5 text-sm font-semibold text-[#ffffff] transition hover:bg-white/[0.12] disabled:opacity-50",children:"Google tools connected — continue"}),(0,n.jsx)("button",{type:"button",disabled:I,onClick:()=>void G("skipped_google"),className:"rounded-full border border-white/20 bg-transparent px-4 py-2.5 text-sm font-semibold text-[#ffffff]/80 transition hover:bg-white/[0.06] disabled:opacity-50",children:"Continue without Google tools"})]})]})]}),(0,n.jsxs)(x.A,{step:ei,title:"Verify conversions",summary:"Test enquiry form tracking (required). Newsletter signup 
1is optional — skip if Resend is not set up yet.",done:ee,isOpen:"conversions"===P,onToggle:()=>Y("conversions"),children:[(0,n.jsx)("p",{className:"text-base text-[#ffffff]/60",children:"Verify your enquiry form is tracked (required). Newsletter signup is optional. Open the test link, accept analytics cookies, then submit in a private/incognito window."}),$?null:(0,n.jsxs)("p",{className:"mt-4 flex items-start gap-2 text-sm text-amber-100/85",children:[(0,n.jsx)(i.A,{className:"mt-0.5 h-4 w-4 shrink-0"}),"Complete connections first (or choose continue without Google tools)."]}),(0,n.jsx)("div",{className:"mt-5 space-y-4",children:_.map(e=>{var t,s;let a=!!e.optional,i=null==N?void 0:N.verifiedGoalIds.includes(e.id),c=null==N||null==(t=N.skippedOptionalGoalIds)?void 0:t.includes(e.id),d=null==N||null==(s=N.skippedRequiredGoalIds)?void 0:s.includes(e.id),f=c||d,m=(0,u.Ix)(F,e.id),p=i||f,x=S[e.id],b=A===e.id,h=!!x&&!p,g=null==x?void 0:x.status,y=!!(null==x?void 0:x.preparing)||b,v="consent_blocked"===g,w="tracking_blocked"===g,j="team_excluded"===g,k="unlinked_conversion"===g;return(0,n.jsxs)("div",{className:"rounded-xl border border-white/10 bg-black/20 p-4",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("p",{className:"font-medium text-[#ffffff]/85",children:[e.label,a?(0,n.jsx)("span",{className:"ml-2 text-xs font-normal text-[#ffffff]/40",children:"(optional)"}):null]}),(0,n.jsx)("p",{className:"mt-2 mb-2 text-base text-[#ffffff]/45",children:a?"Test when newsletter is live, or skip if Resend is not configured.":"Required — test that this goal fires on the live site."})]}),p?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm font-medium text-emerald-200",children:[(0,n.jsx)(l.A,{className:"h-4 w-4"}),f?"Skipped":"Verified"]}):(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)("button",{type:"button",disabled:!!A||I||!$,onClick:()=>void E(e.id),className:"rounded-full bg-[#f72685] px-4 py-2 text-sm font-semibold text-[#ffffff] disabled:cursor-not-allowed disabled:opacity-50",children:b?"Starting…":"Start test"}),a?(0,n.jsx)("button",{type:"button",disabled:I||!$,onClick:()=>void T(e.id),className:"rounded-full border border-white/20 bg-transparent px-4 py-2 text-sm font-semibold text-[#ffffff]/75 transition hover:bg-white/[0.06] disabled:cursor-not-allowed disabled:opacity-50",children:"Skip — not set up yet"}):m?(0,n.jsx)("button",{type:"button",disabled:I||!$,onClick:()=>void X(e.id),className:"rounded-full border border-white/20 bg-transparent px-4 py-2 text-sm font-semibold text-[#ffffff]/75 transition hover:bg-white/[0.06] disabled:cursor-not-allowed disabled:opacity-50",children:"Skip for now"}):null]})]}),h?(0,n.jsxs)("div",{className:"mt-4 space-y-3 rounded-lg border border-white/10 bg-white/[0.03] p-3",children:[(0,n.jsx)("p",{className:"text-sm text-[#ffffff]/70",children:y?(0,u.IK)():(null==x?void 0:x.message)||(0,u.JU)("pending")}),!y&&(null==x?void 0:x.testUrl)?(0,n.jsxs)("a",{href:x.testUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm font-medium text-cyan-200 hover:text-cyan-100",children:["Open test page",(0,n.jsx)(r.A,{className:"h-4 w-4"})]}):null,v?(0,n.jsxs)("div",{className:"rounded-lg border border-amber-300/25 bg-amber-400/10 p-3 text-sm text-amber-50/90",children:[(0,n.jsx)("p",{className:"font-medium",children:"Form works — conversion tracking not verified yet"}),(0,n.jsx)("p",{className:"mt-1 text-amber-50/75",children:"Your test submission went through, but analytics cookies were not accepted, so no conversion was recorded for the campaign. Real leads who accept cookies need the same tracking path to work — accept analytics cookies on the test page, then submit one more test so we can confirm the full pipeline."})]}):null,w?(0,n.jsxs)("div",{className:"rounded-lg border border-amber-300/25 bg-amber-400/10 p-3 text-sm text-amber-50/90",children:[(0,n.jsx)("p",{className:"font-medium",children:"Form worked — conversion event not recorded"}),(0,n.jsx)("p",{className:"mt-1 text-amber-50/75",children:"This is not a broken form. Test in a private/incognito window (logged out of Market Ninja), accept analytics cookies on the test page, then submit again."})]}):null,j?(0,n.jsxs)("div",{className:"rounded-lg border border-amber-300/25 bg-amber-400/10 p-3 text-sm text-amber-50/90",children:[(0,n.jsx)("p",{className:"font-medium",children:"Logged-in team traffic is excluded from tracking"}),(0,n.jsx)("p",{className:"mt-1 text-amber-50/75",children:"Test in a private/incognito window while logged out of Market Ninja."})]}):null,k?(0,n.jsxs)("div",{className:"rounded-lg border border-cyan-300/25 bg-cyan-400/10 p-3 text-sm text-cyan-50/90",children:[(0,n.jsx)("p",{className:"font-medium",children:"Enquiry activity detected in analytics"}),(0,n.jsx)("p",{className:"mt-1 text-cyan-50/75",children:"We recorded a conversion in your test window, but it was not linked to this test session (often because the test link opened a different page than the form you used). If you received your test email, confirm below to mark this goal verified."}),(0,n.jsx)("button",{type:"button",disabled:I,onClick:()=>void L(e.id),className:"mt-3 rounded-full border border-cyan-200/30 bg-cyan-300/15 px-4 py-2 text-sm font-semibold text-cyan-50 transition hover:bg-cyan-300/25 disabled:opacity-50",children:"Yes — that was my test submission"})]}):null,"pending"!==g||y?y?(0,n.jsxs)("p",{className:"flex items-center gap-2 text-xs text-[#ffffff]/45",children:[(0,n.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}),"Finding the best page to test on your site…"]}):null:(0,n.jsxs)("p",{className:"flex items-center gap-2 text-xs text-[#ffffff]/45",children:[(0,n.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}),"Listening for your test submission…"]}),!g||"pending"===g||"detected"===g||"unlinked_conversion"===g||v||w||j?null:(0,n.jsx)("p",{className:"text-xs text-[#ffffff]/50",children:(0,u.JU)(g)})]}):null]},e.id)})}),!ee&&$&&"pco"===F?(0,n.jsxs)("div",{className:"mt-5 border-t border-white/10 pt-4",children:[(0,n.jsx)("button",{type:"button",disabled:I,onClick:()=>{let e=_.find(e=>"enquiry"===e.id);e&&(0,u.Ix)(F,e.id)&&X(e.id)},className:"rounded-full border border-white/20 bg-transparent px-4 py-2.5 text-sm font-semibold text-[#ffffff]/75 transition hover:bg-white/[0.06] disabled:cursor-not-allowed disabled:opacity-50",children:"Skip verification for now — I'll test the enquiry form later"}),(0,n.jsx)("p",{className:"mt-2 text-xs text-[#ffffff]/45",children:"Use this if you cannot run a live form test right now. You can return and verify anytime."})]}):null]}),en?null:(0,n.jsxs)(x.A,{step:el,title:"Campaign baseline",summary:(null==k?void 0:k.captureMode)==="auto"?"Capture the ".concat(Z," ending today as your starting line — core metrics fill in automatically."):(null==k?void 0:k.manualGuidance)||"Capture your campaign starting metrics.",done:et,isOpen:"baseline"===P,onToggle:()=>Y("baseline"),children:[(0,n.jsx)("p",{className:"text-base text-[#ffffff]/60",children:(null==k?void 0:k.captureMode)==="auto"?"Click the 'Capture baseline' button to capture the last ".concat(Z," ending today and freeze the numbers as your starting line."):null==k?void 0:k.manualGuidance}),(null==k?void 0:k.captureMode)==="auto"?(0,n.jsxs)(n.Fragment,{children:[!et&&H.length>0?(0,n.jsxs)("div",{className:"mt-5 rounded-xl border border-white/10 bg-black/15 p-4",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-[#ffffff]/75",children:"Optional manual metrics"}),(0,n.jsx)("p",{className:"mt-2 mb-2 text-base text-[#ffffff]/45",children:"Add business outcomes you track outside Market Ninja before capturing the baseline."}),(0,n.jsx)("div",{className:"mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:H.map(e=>(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-[#ffffff]/40",children:e.label}),(0,n.jsx)("input",{type:"number",min:0,step:"currency"===e.format?"0.01":"1",value:K[e.autoSourceKey||e.id]||"",onChange:t=>B(s=>({...s,[e.autoSourceKey||e.id]:t.target.value})),placeholder:"Optional",className:"mt-1 w-full rounded-lg border border-white/10 bg-black/30 px-3 py-2 text-sm text-[#ffffff] placeholder:text-[#ffffff]/25"})]},e.id))})]}):null,(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(p.A,{metricDefinitions:k.metrics,baselineMetrics:et?z:null,mode:"baseline_only"})})]}):null,et?(0,n.jsxs)("p",{className:"mt-4 inline-flex items-center gap-2 text-sm font-medium text-emerald-200",children:[(0,n.jsx)(l.A,{className:"h-4 w-4"}),"Baseline captured — this is your campaign starting line."]}):(0,n.jsxs)(n.Fragment,{children:[$&&ee?(0,n.jsx)("p",{className:"mt-4 text-sm text-emerald-200/85",children:"Conversions verified — capture your baseline snapshot below to enable Complete."}):null,(0,n.jsx)("button",{type:"button",disabled:I||O||!$||!ee,onClick:()=>{let e={};for(let[t,s]of Object.entries(K)){let n=s.trim();if(!n)continue;let a=Number(n);
1Number.isNaN(a)||(e[t]=a)}R(Object.keys(e).length>0?e:void 0)},className:"mt-5 rounded-full border border-emerald-400/30 bg-emerald-500/15 px-5 py-2.5 text-sm font-semibold text-emerald-100 disabled:cursor-not-allowed disabled:opacity-50",children:O?"Capturing baseline…":"Capture baseline snapshot"}),O?(0,n.jsxs)("p",{className:"mt-2 flex items-center gap-2 text-xs text-[#ffffff]/50",children:[(0,n.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}),"Pulling analytics for your baseline — this can take up to a minute."]}):null]}),$&&ee?null:(0,n.jsxs)("p",{className:"mt-3 flex items-start gap-2 text-xs text-[#ffffff]/45",children:[(0,n.jsx)(i.A,{className:"mt-0.5 h-4 w-4 shrink-0"}),"Complete connections and verify every conversion goal before capturing the baseline."]})]})]})}},45348:(e,t,s)=>{s.d(t,{aQ:()=>n});function n(){return"last ".concat(28," days")}},46589:(e,t,s)=>{s.d(t,{A:()=>r});var n=s(95155),a=s(6281);function i(e,t){if(!e||!t)return null;let s=e[t];return"number"!=typeof s||Number.isNaN(s)?null:s}function l(e){let{value:t,format:s,tone:i="default"}=e;return(0,n.jsx)("p",{className:"current"===i?"text-2xl font-semibold text-emerald-100":"text-2xl font-semibold text-white",children:(0,a.GB)(t,s)})}function r(e){let{metricDefinitions:t,baselineMetrics:s,currentMetrics:r,mode:o,showDescriptions:c=!0}=e,d=(0,a.WR)(t);return(0,n.jsx)("div",{className:"space-y-6",children:d.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-white/45",children:e.label}),(0,n.jsx)("div",{className:"mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:e.metrics.map(e=>{let t=i(s,e.autoSourceKey),a=i(r,e.autoSourceKey);return(0,n.jsxs)("div",{className:"rounded-xl border border-white/10 bg-black/20 p-3 sm:p-4",children:[(0,n.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-white/40",children:e.label}),"compare"===o?(0,n.jsxs)("div",{className:"mt-2 flex items-end gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-white/35",children:"Baseline"}),(0,n.jsx)(l,{value:t,format:e.format})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-white/35",children:"Now"}),(0,n.jsx)(l,{value:a,format:e.format,tone:"current"})]})]}):(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(l,{value:t,format:e.format})}),c?(0,n.jsx)("p",{className:"mt-2 text-xs text-white/40",children:e.description}):null,"manual"===e.captureMode&&"baseline_only"===o&&null==t?(0,n.jsx)("p",{className:"mt-2 text-[11px] text-white/35",children:"Optional — add before capture if you track this."}):null]},e.id)})})]},e.group))})}},93101:(e,t,s)=>{s.d(t,{A:()=>l});var n=s(95155);s(12115);var a=s(6956),i=s(96059);function l(e){let{step:t,title:s,summary:l,done:r=!1,isOpen:o,onToggle:c,children:d}=e;return(0,n.jsxs)("section",{className:"rounded-2xl border bg-white/[0.04] transition-colors ".concat(o?"border-white/15":"border-white/10"),children:[(0,n.jsxs)("button",{type:"button",onClick:c,"aria-expanded":o,className:"flex w-full items-start gap-3 px-5 py-4 text-left transition hover:bg-white/[0.03]",children:[(0,n.jsx)("span",{className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border text-xs font-bold ".concat(r?"border-emerald-300/30 bg-emerald-400/15 text-emerald-100":"border-white/15 bg-white/[0.06] text-[#ffffff]/55"),children:r?(0,n.jsx)(a.A,{className:"h-4 w-4"}):t}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("h3",{className:"text-base font-semibold text-[#ffffff]/90",children:s}),r?(0,n.jsx)("span",{className:"rounded-full border border-emerald-300/25 bg-emerald-400/10 px-2 py-0.5 text-[11px] font-medium text-emerald-100",children:"Done"}):null]}),!o&&l?(0,n.jsx)("p",{className:"mt-1 text-sm leading-relaxed text-[#ffffff]/50",children:l}):null]}),(0,n.jsx)(i.A,{className:"mt-1 h-5 w-5 shrink-0 text-[#ffffff]/40 transition-transform ".concat(o?"rotate-180":"")})]}),o?(0,n.jsx)("div",{className:"border-t border-white/10 px-5 pb-5 pt-4",children:d}):null]})}}}]);

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.