PageSourceSearch

https://oriamarketing.com/assets/setup-advisor-DQvrNRnq.js

js oriamarketing.com collected 2026-09-25 23:17:25 UTC 4,839 bytes, 1 lines download raw bytes

1import{a as y,j as e}from"./react-vendor-Cj4cBEvf.js";import{a as n}from"./query-DuA8FwnC.js";import{B as r,a as c}from"./index-BqvpdcJu.js";import{av as N,X as m,a6 as v,A as w,i as b,j as k}from"./icons-BolBVcAj.js";import"./fullcalendar-DxFl_for.js";import"./router-BMgApeuJ.js";import"./radix-Cu77hBNh.js";import"./charts-C3VUr0cJ.js";const x="setup_advisor_dismissed";function E({onNavigate:h}){const[i,u]=y.useState(()=>sessionStorage.getItem(x)==="true"),{data:p}=n({queryKey:["setup-score"],queryFn:async()=>{const s=await c("/api/admin/setup/score",{credentials:"include"});return s.ok?s.json():null},staleTime:6e4,retry:!1,enabled:!i}),{data:t}=n({queryKey:["setup-next-action"],queryFn:async()=>{const s=await c("/api/admin/setup/next-action",{credentials:"include"});return s.ok?s.json():null},staleTime:6e4,retry:!1,enabled:!i}),{data:g}=n({queryKey:["setup-gaps"],queryFn:async()=>{const s=await c("/api/admin/setup/gaps",{credentials:"include"});return s.ok?s.json():null},staleTime:6e4,retry:!1,enabled:!i});if(i)return null;const a=p?.score??null;if(a===null||a>80)return null;const o=()=>{sessionStorage.setItem(x,"true"),u(!0)},f=()=>{if(!t?.link)return;const s=t.link.match(/[?&]tab=([^&]+)/);s&&h(s[1])},d=()=>{const s=t?`Help me ${t.title.toLowerCase()}. Give me step-by-step instructions.`:"What should I set up first? Check my account and tell me what's missing.";window.dispatchEvent(new CustomEvent("open-ai-assistant",{detail:{message:s}}))},l=g?.length??0,j=t?.priority==="critical"?"text-red-600":t?.priority==="high"?"text-amber-600":"text-teal-600";return a<50?e.jsx("div",{className:"mx-4 mt-3",children:e.jsx("div",{className:"rounded-xl border border-teal-200 bg-gradient-to-r from-teal-50/80 to-white shadow-sm overflow-hidden",children:e.jsxs("div",{className:"px-5 pt-4 pb-4",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-9 h-9 rounded-full bg-[hsl(174,62%,47%)] flex items-center justify-center flex-shrink-0",children:e.jsx(N,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Get your account ready"}),e.jsxs("p",{className:"text-xs text-gray-500",children:["Setup score: ",a,"% — ",l," ",l===1?"thing":"things"," left to do"]})]})]}),e.jsx(r,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600",onClick:o,title:"Dismiss for now",children:e.jsx(m,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"w-full h-1.5 bg-gray-100 rounded-full mb-4 overflow-hidden",children:e.jsx("div",{className:"h-full bg-[hsl(174,62%,47%)] rounded-full transition-all duration-500",style:{width:`${a}%`}})}),t&&e.jsx("div",{className:"bg-white rounded-lg border border-gray-100 p-3.5 mb-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(v,{className:`w-4 h-4 mt-0.5 flex-shrink-0 ${j}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:t.title}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5 line-clamp-2",children:t.description}),t.estimatedMinutes&&e.jsxs("p",{className:"text-[10px] text-gray-400 mt-1",children:["Takes about ",t.estimatedMinutes," min"]})]})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(r,{size:"sm",className:"bg-[hsl(174,62%,47%)] hover:bg-[hsl(174,62%,40%)] text-white text-xs gap-1.5 flex-1",onClick:f,children:["Do it now",e.jsx(w,{className:"w-3.5 h-3.5"})]}),e.jsxs(r,{size:"sm",variant:"outline",className:"text-xs gap-1.5 border-gray-200 hover:border-[hsl(174,62%,47%)] hover:text-[hsl(174,62%,47%)]",onClick:d,children:[e.jsx(b,{className:"w-3.5 h-3.5"}),"Ask AI for help"]})]})]})})}):e.jsx("div",{className:"mx-4 mt-3",children:e.jsx("div",{className:"rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(k,{className:"w-4 h-4 text-[hsl(174,62%,47%)]"}),e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsxs("span",{className:"font-medium",children:[a,"% set up"]}),e.jsx("span",{className:"text-gray-400 mx-1.5",children:"—"}),e.jsxs("span",{className:"text-gray-500",children:[l," ",l===1?"thing":"things"," left"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{size:"sm",variant:"ghost",className:"text-xs text-[hsl(174,62%,47%)] hover:text-[hsl(174,62%,40%)] hover:bg-teal-50 h-7 px-2",onClick:d,children:"See what's missing"}),e.jsx(r,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-gray-400 hover:text-gray-600",onClick:o,title:"Dismiss for now",children:e.jsx(m,{className:"w-3.5 h-3.5"})})]})]})})})}export{E 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.