PageSourceSearch

https://operator-stack-web-stg.onrender.com/_nuxt/DAfUe6d9.js

js operator-stack-web-stg.onrender.com collected 2026-10-03 11:43:07 UTC 87,814 bytes, 277 lines download raw bytes

1import{d as Y,c as g,e as u,l as z,f as i,g as E,t as $,a as h,p as v,b as L,I as je,F as P,m as T,j as Q,w as me,_ as rt,x as nt,B as Et,M as Lt,C as Ot,r as D,N as ke,n as Ht,E as ze,o as at,T as Ye,H as qt,y as Ft}from"./BJ-fXIum.js";import{_ as ot}from"./DWVO9tK9.js";import{u as lt}from"./D3dKKD4A.js";import{_ as Nt}from"./CqOw22xb.js";import{u as it}from"./D2nMFcDl.js";import{a as ct,u as Gt}from"./C-c2tz7K.js";import{u as Zt}from"./DyOszaq-.js";import{_ as Vt}from"./DlAUqK2U.js";import{u as Ut}from"./BjAABvi_.js";import{u as Qt}from"./DaGf2Aai.js";import{s as Yt}from"./CVusNzQc.js";const Wt=Y({__name:"HealthBadge",props:{status:{}},setup(r){const e=r,s=v(()=>{switch(e.status){case"healthy":return"bg-green-50 text-green-700";case"degraded":return"bg-yellow-50 text-yellow-700";case"stale":return"bg-orange-50 text-orange-700";case"disconnected":return"bg-red-50 text-red-700";default:return"bg-gray-100 text-gray-500"}}),n=v(()=>{switch(e.status){case"healthy":return"bg-green-500";case"degraded":return"bg-yellow-500";case"stale":return"bg-orange-500";case"disconnected":return"bg-red-500";default:return"bg-gray-400"}}),t=v(()=>{switch(e.status){case"healthy":return"Healthy";case"degraded":return"Degraded";case"stale":return"Stale";case"disconnected":return"Disconnected";default:return"No Data"}});return(o,a)=>(h(),g("span",{class:z(["inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-mono font-medium",i(s)])},[u("span",{class:z(["w-1.5 h-1.5 rounded-full",i(n)])},null,2),E(" "+$(i(t)),1)],2))}}),ut=Object.assign(Wt,{__name:"OverviewHealthBadge"}),Kt={class:"bg-white rounded-lg border border-gray-200 p-6"},Xt={class:"flex items-center justify-between mb-4"},Jt={key:0,class:"text-center py-6"},es={class:"grid grid-cols-3 gap-3 mb-4"},ts={class:"bg-gray-50 rounded-md px-3 py-2"},ss={class:"font-mono text-lg font-semibold text-gray-900"},rs={class:"text-xs text-gray-500"},ns={class:"bg-gray-50 rounded-md px-3 py-2"},as={class:"font-mono text-lg font-semibold text-gray-900"},os={class:"bg-gray-50 rounded-md px-3 py-2"},ls={class:"font-mono text-lg font-semibold text-gray-900"},is={key:0,class:"text-xs text-gray-400 font-mono mb-3"},cs={class:"space-y-2"},us={class:"flex-1 min-w-0"},ds={class:"font-mono text-sm text-gray-900 truncate"},ps={class:"text-xs text-gray-400 mt-0.5"},hs={key:1,class:"mt-4 pt-4 border-t border-gray-100 space-y-2"},gs={key:0,class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},fs={key:1,class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ms={key:2,class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ks={class:"text-gray-600"},bs={class:"mt-4 pt-4 border-t border-gray-100"},xs={class:"flex items-center justify-between mb-2"},ys={class:"flex items-center gap-2"},vs={class:"flex-1 text-xs bg-gray-50 border border-gray-200 p-3 rounded font-mono text-gray-900 break-all"},ws=Y({__name:"HealthCard",props:{health:{},scriptTag:{},scriptUrl:{},projectKey:{}},setup(r){const e=r,s=o=>o>=1e3?`${(o/1e3).toFixed(1)}k`:String(o),n=o=>{const a=Date.now(),d=new Date(o).getTime(),l=Math.floor((a-d)/1e3);if(l<60)return"just now";const p=Math.floor(l/60);if(p<60)return`${p}m ago`;const c=Math.floor(p/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`},t=v(()=>{if(!e.health||e.health.status==="no_data")return[];const o=[],a=e.health,d=a.domains.filter(p=>p.status==="stale"),l=a.domains.filter(p=>p.status==="inactive");if(d.length>0){const p=d.map(c=>c.domain).join(", ");o.push({type:"warning",color:"text-yellow-500",text:`No data in 24h from ${p} — check if the script is still installed`})}if(l.length>0){const p=l.map(c=>c.domain).join(", ");o.push({type:"warning",color:"text-yellow-500",text:`No data in 7+ days from ${p} — script may have been removed`})}if(a.total_events_24h>0&&a.total_events_7d>0){const p=a.total_events_7d/7;a.total_events_24h>p*1.5?o.push({type:"success",color:"text-green-500",text:"Traffic today is above your 7-day average"}):a.total_events_24h<p*.5&&a.total_events_24h>0&&o.push({type:"info",color:"text-blue-500",text:"Traffic today is below your 7-day average"})}if(a.total_domains>1){const p=a.domains.filter(c=>c.status==="active");o.push({type:"info",color:"text-blue-500",text:`Receiving data from ${p.length} of ${a.total_domains} domains`})}return o.length===0&&a.status==="healthy"&&o.push({type:"success",color:"text-green-500",text:"All domains actively sending data"}),o});return(o,a)=>{const d=ut,l=rt,p=ot;return h(),g("div",Kt,[u("div",Xt,[a[0]||(a[0]=u("h3",{class:"text-sm font-semibold text-gray-900"},"Installation Health",-1)),L(d,{status:r.health?.status??"no_data"},null,8,["status"])]),!r.health||r.health.status==="no_data"?(h(),g("div",Jt,[...a[1]||(a[1]=[je('<div class="w-12 h-12 mx-auto mb-3 rounded-lg border border-gray-200 flex items-center justify-center"><svg class="w-6 h-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
1<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path></svg></div><p class="text-sm text-gray-500">No data received yet</p><p class="text-xs text-gray-400 mt-1">Install the script tag to start collecting data</p>',3)])])):(h(),g(P,{key:1},[u("div",es,[u("div",ts,[u("div",ss,$(r.health.total_domains),1),u("div",rs,$(r.health.total_domains===1?"Domain":"Domains"),1)]),u("div",ns,[u("div",as,$(s(r.health.total_events_24h)),1),a[2]||(a[2]=u("div",{class:"text-xs text-gray-500"},"Events (24h)",-1))]),u("div",os,[u("div",ls,$(s(r.health.total_events_7d)),1),a[3]||(a[3]=u("div",{class:"text-xs text-gray-500"},"Events (7d)",-1))])]),r.health.last_event_at?(h(),g("div",is," Last data received "+$(n(r.health.last_event_at)),1)):T("",!0),u("div",cs,[(h(!0),g(P,null,Q(r.health.domains,c=>(h(),g("div",{key:c.domain,class:"flex items-center gap-3 px-3 py-2.5 rounded-md border border-gray-100 hover:border-gray-200 transition-colors"},[u("span",{class:z(["w-2 h-2 rounded-full flex-shrink-0",{"bg-green-500":c.status==="active","bg-yellow-500":c.status==="stale","bg-gray-300":c.status==="inactive"}])},null,2),u("div",us,[u("div",ds,$(c.domain),1),u("div",ps,$(c.events_24h)+" events today · "+$(c.unique_visitors_7d)+" visitors (7d) ",1)]),u("span",{class:z(["text-xs font-mono px-1.5 py-0.5 rounded",{"bg-green-50 text-green-600":c.status==="active","bg-yellow-50 text-yellow-600":c.status==="stale","bg-gray-100 text-gray-500":c.status==="inactive"}])},$(c.status),3)]))),128))]),i(t).length>0?(h(),g("div",hs,[(h(!0),g(P,null,Q(i(t),(c,b)=>(h(),g("div",{key:b,class:"flex items-start gap-2 text-xs"},[u("span",{class:z(["mt-0.5 flex-shrink-0",c.color])},[c.type==="info"?(h(),g("svg",gs,[...a[4]||(a[4]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])])):c.type==="warning"?(h(),g("svg",fs,[...a[5]||(a[5]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)])])):(h(),g("svg",ms,[...a[6]||(a[6]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])]))],2),u("span",ks,$(c.text),1)]))),128))])):T("",!0)],64)),u("div",bs,[u("div",xs,[a[8]||(a[8]=u("span",{class:"text-xs text-gray-500 uppercase tracking-wider"},"Script Tag",-1)),L(l,{to:"/docs/embed-script",class:"text-xs font-mono text-green-600 hover:text-green-700 transition-colors"},{default:me(()=>[...a[7]||(a[7]=[E(" Installation docs → ",-1)])]),_:1})]),u("div",ys,[u("code",vs,' <script src="'+$(r.scriptUrl)+'" data-project="'+$(r.projectKey)+'"><\/script> ',1),L(p,{text:r.scriptTag},null,8,["text"])])])])}}}),_s=Object.assign(ws,{__name:"OverviewHealthCard"}),dt=()=>{const{apiFetch:r}=lt();return{fetchInstallationHealth:async s=>r(`/v1/projects/${s}/analytics/installation-health`)}},$s={class:"bg-white rounded-xl border border-gray-200 p-6 mb-6"},Ss={key:0,class:"text-center py-6"},Rs={key:0,class:"w-6 h-6 text-green-600 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ts={key:1,class:"w-6 h-6 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Cs={key:2,class:"w-6 h-6 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},As={class:"text-sm font-semibold text-gray-900 mb-1"},js={class:"text-xs text-gray-500 max-w-sm mx-auto"},zs={class:"bg-gray-100 rounded-lg p-1 flex gap-1 mb-5"},Is=["onClick"],Ps={key:0,class:"mb-6"},Bs={class:"relative"},Ms={class:"block text-xs bg-gray-50 border border-gray-200 p-3 rounded-md font-mono text-gray-900 break-all pr-16"},Ds={class:"absolute top-2 right-2"},Es={key:1,class:"mb-6"},Ls={class:"relative"},Os={class:"block text-xs bg-gray-50 border border-gray-200 p-3 rounded-md font-mono text-gray-900 whitespace-pre-wrap pr-16"},Hs={class:"absolute top-2 right-2"},qs={key:2,class:"mb-6"},Fs={class:"flex items-center justify-start mb-3"}
1,Ns=["label"],Gs=["value"],Zs={key:0},Vs={class:"text-xs text-gray-500 mb-2"},Us={class:"relative"},Qs={class:"text-xs bg-gray-50 border border-gray-200 p-3 rounded-md font-mono text-gray-900 overflow-x-auto whitespace-pre pr-16"},Ys={class:"absolute top-2 right-2"},Ws=12,Ks=Y({__name:"InstallGuide",props:{scriptTag:{},scriptUrl:{},projectKey:{},projectId:{}},emits:["dataReceived"],setup(r,{emit:e}){const s=r,n=e,{fetchInstallationHealth:t}=dt(),o=[{key:"script",label:"Script Tag"},{key:"ai",label:"AI Prompt"},{key:"frameworks",label:"Framework Guides"}],a=D("script"),d=D("html"),l=D(!1),p=D("polling");let c=null;const b=()=>{let A=0;const f=async()=>{if(A>=Ws){p.value="timeout";return}try{if((await t(s.projectId)).status!=="no_data"){p.value="detected",c=setTimeout(()=>{n("dataReceived")},1500);return}}catch{}A++;const _=Math.min(1e3*Math.pow(2,A-1),32e3);c=setTimeout(f,_)};f()},y=()=>{l.value=!0,p.value="polling",b()};nt(()=>{c&&clearTimeout(c)});const R=v(()=>`Add the OperatorStack tracking script to my project. Place this script tag in the <head> of every page:
2
3${s.scriptTag}
4
5Make sure it loads on all pages. It should be placed before the closing </head> tag.`),x=(A,f)=>`<script src="${A}" data-project="${f}"><\/script>`,C=v(()=>{const A=s.scriptUrl,f=s.projectKey,_=x(A,f);return[{label:"Basics",items:[{key:"html",label:"HTML",description:"Paste before the closing </head> tag:",snippet:`<!DOCTYPE html>
6<html>
7<head>
8  <!-- ... -->
9  ${_}
10</head>
11<body>
12  <!-- ... -->
13</body>
14</html>`}]},{label:"React",items:[{key:"nextjs",label:"Next.js",description:"Add to your layout.tsx or _app.tsx:",snippet:`import Script from 'next/script'
15
16export default function RootLayout({ children }) {
17  return (
18    <html>
19      <body>
20        {children}
21        <Script
22          src="${A}"
23          data-project="${f}"
24          strategy="afterInteractive"
25        />
26      </body>
27    </html>
28  )
29}`},{key:"remix",label:"Remix",description:"Add to your root.tsx:",snippet:`// app/root.tsx
30import { Links, Meta, Outlet, Scripts } from "@remix-run/react";
31
32export default function App() {
33  return (
34    <html>
35      <head>
36        <Meta />
37        <Links />
38      </head>
39      <body>
40        <Outlet />
41        <script src="${A}" data-project="${f}" />
42        <Scripts />
43      </body>
44    </html>
45  );
46}`},{key:"gatsby",label:"Gatsby",description:"Add to gatsby-ssr.js (or gatsby-ssr.tsx):",snippet:`// gatsby-ssr.js
47export const onRenderBody = ({ setHeadComponents }) => {
48  setHeadComponents([
49    <script
50      key="operatorstack"
51      src="${A}"
52      data-project="${f}"
53    />,
54  ]);
55};`}]},{label:"Vue",items:[{key:"nuxt",label:"Nuxt",description:"Add to your nuxt.config.ts:",snippet:`export default defineNuxtConfig({
56  app: {
57    head: {
58      script: [
59        {
60          src: '${A}',
61          'data-project': '${f}',
62        },
63      ],
64    },
65  },
66})`},{key:"vite-vue",label:"Vue (Vite)",description:"Add to your index.html:",snippet:`<!DOCTYPE html>
67<html>
68<head>
69  <!-- ... -->
70  ${_}
71</head>
72<body>
73  <div id="app"></div>
74  <script type="module" src="/src/main.ts"><\/script>
75</body>
76</html>`}]},{label:"Svelte",items:[{key:"sveltekit",label:"SvelteKit",description:"Add to your app.html:",snippet:`<!-- src/app.html -->
77<!DOCTYPE html>
78<html>
79<head>
80  %sveltekit.head%
81  ${_}
82</head>
83<body>
84  <div>%sveltekit.body%</div>
85</body>
86</html>`}]},{label:"Other Frameworks",items:[{key:"astro",label:"Astro",description:"Add to your base layout:",snippet:`---
87// src/layouts/Layout.astro
88---
89<html>
90  <head>
91    <slot name="head" />
92    ${_}
93  </head>
94  <body>
95    <slot />
96  </body>
97</html>`},{key:"angular",label:"Angular",description:"Add to your src/index.html:",snippet:`<!DOCTYPE html>
98<html>
99<head>
100  <!-- ... -->
101  ${_}
102</head>
103<body>
104  <app-root></app-root>
105</body>
106</html>`},{key:"eleventy",label:"Eleventy (11ty)",description:"Add to your base layout template:",snippet:`<!-- _includes/base.njk -->
107<!DOCTYPE html>
108<html>
109<head>
110  <title>{{ title }}</title>
111  ${_}
112</head>
113<body>
114  {{ content | safe }}
115</body>
116</html>`},{key:"docusaurus",label:"Docusaurus",description:"Add to your docusaurus.config.js:",snippet:`module.exports = {
117  // ...
118  scripts: [
119    {
120      src: '${A}',
121      'data-project': '${f}',
122      async: true,
123    },
124  ],
125};`},{key:"vitepress",label:"VitePress",description:"Add to your .vitepress/config.ts:",
125snippet:`export default defineConfig({
126  head: [
127    [
128      'script',
129      {
130        src: '${A}',
131        'data-project': '${f}',
132      },
133    ],
134  ],
135})`},{key:"hugo",label:"Hugo",description:"Add to your layouts/partials/head.html:",snippet:`<!-- layouts/partials/head.html -->
136<meta charset="utf-8">
137<title>{{ .Title }}</title>
138${_}`},{key:"jekyll",label:"Jekyll",description:"Add to your _includes/head.html:",snippet:`<!-- _includes/head.html -->
139<head>
140  <meta charset="utf-8">
141  <title>{{ page.title }}</title>
142  ${_}
143</head>`}]},{label:"Backend / Full-Stack",items:[{key:"rails",label:"Ruby on Rails",description:"Add to your application.html.erb layout:",snippet:`<!-- app/views/layouts/application.html.erb -->
144<!DOCTYPE html>
145<html>
146<head>
147  <%= csrf_meta_tags %>
148  <%= csp_meta_tag %>
149  ${_}
150</head>
151<body>
152  <%= yield %>
153</body>
154</html>`},{key:"laravel",label:"Laravel / Blade",description:"Add to your layouts/app.blade.php:",snippet:`<!-- resources/views/layouts/app.blade.php -->
155<!DOCTYPE html>
156<html>
157<head>
158  <title>@yield('title')</title>
159  ${_}
160</head>
161<body>
162  @yield('content')
163</body>
164</html>`},{key:"django",label:"Django",description:"Add to your base template:",snippet:`<!-- templates/base.html -->
165<!DOCTYPE html>
166<html>
167<head>
168  <title>{% block title %}{% endblock %}</title>
169  ${_}
170</head>
171<body>
172  {% block content %}{% endblock %}
173</body>
174</html>`},{key:"flask",label:"Flask / Jinja2",description:"Add to your base template:",snippet:`<!-- templates/base.html -->
175<!DOCTYPE html>
176<html>
177<head>
178  <title>{{ title }}</title>
179  ${_}
180</head>
181<body>
182  {% block content %}{% endblock %}
183</body>
184</html>`},{key:"express",label:"Express.js / EJS",description:"Add to your layout or head partial:",snippet:`<!-- views/layout.ejs -->
185<!DOCTYPE html>
186<html>
187<head>
188  <title><%= title %></title>
189  ${_}
190</head>
191<body>
192  <%- body %>
193</body>
194</html>`},{key:"phoenix",label:"Phoenix / Elixir",description:"Add to your root layout:",snippet:`<!-- lib/my_app_web/components/layouts/root.html.heex -->
195<!DOCTYPE html>
196<html>
197<head>
198  <.live_title><%= assigns[:page_title] %></.live_title>
199  ${_}
200</head>
201<body>
202  <%= @inner_content %>
203</body>
204</html>`}]},{label:"No-Code / CMS",items:[{key:"wordpress",label:"WordPress",description:"Add to your theme's functions.php:",snippet:`// functions.php
205function operatorstack_script() {
206  wp_enqueue_script(
207    'operatorstack',
208    '${A}',
209    array(),
210    null,
211    false
212  );
213  wp_script_add_data('operatorstack', 'data-project', '${f}');
214}
215add_action('wp_enqueue_scripts', 'operatorstack_script');`},{key:"shopify",label:"Shopify",description:"Add to your theme.liquid layout (Online Store > Themes > Edit Code):",snippet:`<!-- layout/theme.liquid -->
216<head>
217  <!-- ... existing tags ... -->
218  ${_}
219</head>`},{key:"webflow",label:"Webflow",description:"Go to Project Settings > Custom Code, paste in the Head Code section:",snippet:_},{key:"squarespace",label:"Squarespace",description:"Go to Settings > Advanced > Code Injection, paste in the Header section:",snippet:_},{key:"wix",label:"Wix",description:"Go to Settings > Custom Code > Add Code, paste the tag and set it to load in the Head on all pages:",snippet:_},{key:"framer",label:"Framer",description:"Go to Site Settings > General > Custom Code, paste in the Start of <head> section:",snippet:_},{key:"ghost",label:"Ghost",description:"Go to Settings > Code Injection, paste in the Site Header section:",snippet:_},{key:"carrd",label:"Carrd",description:"Add an Embed element, set it to Head, and paste the script tag:",snippet:_}]}]}),F=v(()=>C.value.flatMap(A=>A.items)),w=v(()=>F.value.find(A=>A.key===d.value));return(A,f)=>{const _=ot;return h(),g("div",$s,[i(l)?(h(),g("div",Ss,[u("div",{class:z(["w-12 h-12 mx-auto mb-4 rounded-lg flex items-center justify-center",i(p)==="detected"?"border border-green-200 bg-green-50":i(p)==="timeout"?"border border-gray-200 bg-gray-50":"border border-green-200 bg-green-50"])},[i(p)==="polling"?(h(),g("svg",Rs,[...f[2]||(f[2]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])])):i(p)==="detected"?(h(),g("svg",Ts,[...f[3]||(f[3]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)])])):(h(),g("svg",Cs,[...f[4]||(f[4]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])]))],2),u("h3",As,[i(p)==="polling"?(h(),g(P,{key:0},[E("Waiting for data...")],64)):i(p)==="detected"?(h(),g(P,{key:1},[E("Data received!")],64)):(h(),g(P,{key:2},[E("No data yet")],64))]),u("p",js,[i(p)==="polling"?(h(),g(P,{key:0},[E(" Listening for the first event from your site. This usually takes a few seconds after visiting a page with the script installed. ")],64)):i(p)==="detected"?(h(),g(P,{key:1}
219,[E(" Your script is working. Redirecting to your dashboard... ")],64)):(h(),g(P,{key:2},[E(" We didn't detect any data yet. It may take a moment to propagate. Check back soon or verify the script is installed correctly. ")],64))]),i(p)==="timeout"?(h(),g("button",{key:0,class:"mt-4 text-xs font-mono text-green-600 hover:text-green-700 transition-colors cursor-pointer",onClick:f[0]||(f[0]=I=>l.value=!1)}," Show install instructions ")):T("",!0)])):(h(),g(P,{key:1},[f[7]||(f[7]=u("div",{class:"mb-5"},[u("h3",{class:"text-lg font-semibold text-gray-900 mb-1"},"Install OperatorStack"),u("p",{class:"text-xs text-gray-500"}," Add one script tag to start collecting analytics, signups, and more. ")],-1)),u("div",zs,[(h(),g(P,null,Q(o,I=>u("button",{key:I.key,class:z(["flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors cursor-pointer",i(a)===I.key?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"]),onClick:O=>a.value=I.key},$(I.label),11,Is)),64))]),i(a)==="script"?(h(),g("div",Ps,[u("div",Bs,[u("code",Ms,$(r.scriptTag),1),u("div",Ds,[L(_,{text:r.scriptTag},null,8,["text"])])]),f[5]||(f[5]=u("p",{class:"text-xs text-gray-400 mt-2"},[E(" Paste before the closing "),u("code",{class:"text-xs bg-gray-100 px-1 rounded"},"</head>"),E(" tag on every page. ")],-1))])):T("",!0),i(a)==="ai"?(h(),g("div",Es,[f[6]||(f[6]=u("p",{class:"text-xs text-gray-500 mb-3"}," Copy this prompt and paste it into Cursor, Claude Code, GitHub Copilot, or any AI assistant. ",-1)),u("div",Ls,[u("code",Os,$(i(R)),1),u("div",Hs,[L(_,{text:i(R),label:"Copy"},null,8,["text"])])])])):T("",!0),i(a)==="frameworks"?(h(),g("div",qs,[u("div",Fs,[Et(u("select",{"onUpdate:modelValue":f[1]||(f[1]=I=>Ot(d)?d.value=I:null),class:"text-sm font-mono bg-white border border-gray-200 rounded-md px-3 py-1.5 text-gray-900 cursor-pointer focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-green-500"},[(h(!0),g(P,null,Q(i(C),I=>(h(),g("optgroup",{key:I.label,label:I.label},[(h(!0),g(P,null,Q(I.items,O=>(h(),g("option",{key:O.key,value:O.key},$(O.label),9,Gs))),128))],8,Ns))),128))],512),[[Lt,i(d)]])]),i(w)?(h(),g("div",Zs,[u("p",Vs,$(i(w).description),1),u("div",Us,[u("pre",Qs,$(i(w).snippet),1),u("div",Ys,[L(_,{text:i(w).snippet},null,8,["text"])])])])):T("",!0)])):T("",!0),u("div",{class:"pt-4 border-t border-gray-100"},[u("button",{class:"w-full py-2.5 px-4 bg-green-500 hover:bg-green-600 text-white text-sm font-semibold rounded-md transition-colors cursor-pointer",onClick:y}," I installed it ")])],64))])}}}),Xs=Object.assign(Ks,{__name:"OverviewInstallGuide"}),Js={class:"bg-white rounded-xl border border-gray-200 p-6 mb-6"},er={class:"space-y-3"},tr={class:"flex-1 min-w-0 mr-4"},sr={class:"text-sm font-medium text-gray-900"},rr={class:"text-xs text-gray-500"},nr=Y({__name:"FeatureToggles",props:{projectId:{},analyticsEnabled:{type:Boolean},errorLoggingEnabled:{type:Boolean},performanceEnabled:{type:Boolean}},emits:["updated"],setup(r,{emit:e}){const s=r,n=e,{updateProject:t}=it(),{show:o}=ct(),a=D(!1),d=D({analytics_enabled:s.analyticsEnabled,error_logging_enabled:s.errorLoggingEnabled,performance_enabled:s.performanceEnabled});ke(()=>[s.analyticsEnabled,s.errorLoggingEnabled,s.performanceEnabled],([c,b,y])=>{d.value.analytics_enabled=c,d.value.error_logging_enabled=b,d.value.performance_enabled=y});const l=v(()=>[{key:"analytics_enabled",label:"Analytics",description:"Page views, visitors, referral sources, and conversion tracking.",enabled:d.value.analytics_enabled},{key:"performance_enabled",label:"Performance",description:"Core Web Vitals and page load speed monitoring.",enabled:d.value.performance_enabled},{key:"error_logging_enabled",label:"Error Logging",description:"Capture JavaScript errors from your site automatically.",enabled:d.value.error_logging_enabled}]),p=async(c,b)=>{a.value=!0;const y=d.value[c];d.value[c]=b;try{await t(s.projectId,{[c]:b}),n("updated",{[c]:b})}catch{d.value[c]=y,o("Failed to update feature","error")}finally{a.value=!1}};return(c,b)=>{const y=Nt;return h(),g("div",Js,[b[0]||(b[0]=je('<div class="flex items-center gap-2 mb-1"><svg class="w-5 h-5 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
219<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.573-1.066z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg><h3 class="text-sm font-semibold text-gray-900">Features</h3></div><p class="text-xs text-gray-500 mb-4"> Choose which features to enable. You can change these anytime in settings. </p>',2)),u("div",er,[(h(!0),g(P,null,Q(i(l),R=>(h(),g("div",{key:R.key,class:"flex items-center justify-between py-2 px-3 rounded-lg hover:bg-gray-50 transition-colors"},[u("div",tr,[u("div",sr,$(R.label),1),u("div",rr,$(R.description),1)]),L(y,{"model-value":R.enabled,disabled:i(a),"onUpdate:modelValue":x=>p(R.key,x)},null,8,["model-value","disabled","onUpdate:modelValue"])]))),128))])])}}}),ar=Object.assign(nr,{__name:"OverviewFeatureToggles"}),or={class:"flex flex-wrap gap-x-4 gap-y-2 mb-5 py-1"},lr=["onClick"],ir=Y({__name:"StatusStrip",props:{dots:{}},setup(r){const e=r,s=v(()=>{const t=[];for(let o=0;o<e.dots.length;o+=4)t.push(e.dots.slice(o,o+4));return t}),n=t=>{switch(t){case"green":return"bg-green-500";case"yellow":return"bg-yellow-500";case"red":return"bg-red-500";default:return"bg-gray-300"}};return(t,o)=>(h(),g("div",or,[(h(!0),g(P,null,Q(i(s),(a,d)=>(h(),g("div",{key:d,class:"flex items-center gap-4"},[(h(!0),g(P,null,Q(a,l=>(h(),g("button",{key:l.key,class:"flex items-center gap-1.5 text-xs font-mono text-gray-500 hover:text-gray-700 transition-colors whitespace-nowrap cursor-pointer",onClick:p=>("navigateTo"in t?t.navigateTo:i(Ht))(l.route)},[u("span",{class:z(["w-2 h-2 rounded-full flex-shrink-0",n(l.priority)])},null,2),E(" "+$(l.label),1)],8,lr))),128))]))),128))]))}}),cr=Object.assign(ir,{__name:"OverviewStatusStrip"}),ur=["width","height","viewBox"],dr=["points","stroke"],pr=Y({__name:"Sparkline",props:{data:{},color:{default:"#22c55e"},width:{default:60},height:{default:20}},setup(r){const e=r,s=v(()=>{const n=e.data;if(!n.length)return"";const t=Math.max(...n),o=Math.min(...n),a=t-o||1,d=2,l=e.height-d*2,p=n.length>1?(e.width-d*2)/(n.length-1):0;return n.map((c,b)=>{const y=d+b*p,R=d+l-(c-o)/a*l;return`${y},${R}`}).join(" ")});return(n,t)=>(h(),g("svg",{width:r.width,height:r.height,viewBox:`0 0 ${r.width} ${r.height}`,class:"overflow-visible"},[u("polyline",{points:i(s),fill:"none",stroke:r.color,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,dr)],8,ur))}}),hr=Object.assign(pr,{__name:"OverviewSparkline"}),gr={class:"flex items-center justify-between"},fr={class:"flex items-center gap-1.5 mt-1"},mr={class:"text-xs text-gray-500 uppercase tracking-wider"},kr=Y({__name:"KpiCard",props:{value:{},label:{},change:{default:null},sparkData:{default:()=>[]},hero:{type:Boolean,default:!1}},setup(r){const e=r,s=v(()=>typeof e.value=="string"?e.value:e.value>=1e4?`${(e.value/1e3).toFixed(1)}k`:e.value.toLocaleString()),n=v(()=>e.change==null||e.change===0?"":e.change>0?"+":""),t=v(()=>e.change==null||Math.abs(e.change)<.5?"text-gray-400":e.change>0?"text-green-600":"text-red-500"),o=v(()=>e.change==null||Math.abs(e.change)<.5?"#9ca3af":e.change>0?"#22c55e":"#ef4444");return(a,d)=>{const l=hr;return h(),g("div",{class:z(["bg-white rounded-xl border px-[18px] py-4",r.hero?"border-green-200":"border-gray-200"])},[u("div",gr,[u("div",{class:z(["font-mono font-semibold text-gray-900",r.hero?"text-3xl text-green-600":"text-2xl"])},$(i(s)),3),r.sparkData.length>1?(h(),ze(l,{key:0,data:r.sparkData,color:i(o),width:56,height:20},null,8,["data","color"])):T("",!0)]),u("div",fr,[u("span",mr,$(r.label),1),r.change!=null?(h(),g("span",{key:0,class:z(["text-[10px] font-mono",i(t)])},$(i(n))+$(Math.abs(r.change).toFixed(1))+"% ",3)):T("",!0)])],2)}}}),br=Object.assign(kr,{__name:"OverviewKpiCard"});function Ie(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var se=Ie();function pt(r){se=r}var ee={exec:()=>null};function S(r,e=""){let s=typeof r=="string"?r:r.source,n={replace:(t,o)=>
vendor: 4,308 bytes, line 219
219{let a=typeof o=="string"?o:o.source;return a=a.replace(H.caret,"$1"),s=s.replace(t,a),n},getRegex:()=>new RegExp(s,e)};return n}var xr=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),H={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[	 ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},yr=/^(?:[ \t]*(?:\n|$))+/,vr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,wr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ue=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_r=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Pe=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ht=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gt=S(ht).replace(/bull/g,Pe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$r=S(ht).replace(/bull/g,Pe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Be=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Sr=/^[^\n]+/,Me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rr=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Tr=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Pe).getRegex(),ve="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",De=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Cr=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>
vendor: 16,384 bytes, lines 219-244
219)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))","i").replace("comment",De).replace("tag",ve).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ft=S(Be).replace("hr",ue).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ve).getRegex(),Ar=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ft).getRegex(),Ee={blockquote:Ar,code:vr,def:Rr,fences:wr,heading:_r,hr:ue,html:Cr,lheading:gt,list:Tr,newline:yr,paragraph:ft,table:ee,text:Sr},We=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ue).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}	)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ve).getRegex(),jr={...Ee,lheading:$r,table:We,paragraph:S(Be).replace("hr",ue).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",We).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ve).getRegex()},zr={...Ee,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",De).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ee,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(Be).replace("hr",ue).replace("heading",` *#{1,6} *[^
220]`).replace("lheading",gt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ir=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,mt=/^( {2,}|\\)\n(?!\s*$)/,Br=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,we=/[\p{P}\p{S}]/u,Le=/[\s\p{P}\p{S}]/u,kt=/[^\s\p{P}\p{S}]/u,Mr=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Le).getRegex(),bt=/(?!~)[\p{P}\p{S}]/u,Dr=/(?!~)[\s\p{P}\p{S}]/u,Er=/(?:[^\s\p{P}\p{S}]|~)/u,xt=/(?![*_])[\p{P}\p{S}]/u,Lr=/(?![*_])[\s\p{P}\p{S}]/u,Or=/(?:[^\s\p{P}\p{S}]|[*_])/u,Hr=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",xr?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),yt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qr=S(yt,"u").replace(/punct/g,we).getRegex(),Fr=S(yt,"u").replace(/punct/g,bt).getRegex(),vt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Nr=S(vt,"gu").replace(/notPunctSpace/g,kt).replace(/punctSpace/g,Le).replace(/punct/g,we).getRegex(),Gr=S(vt,"gu").replace(/notPunctSpace/g,Er).replace(/punctSpace/g,Dr).replace(/punct/g,bt).getRegex(),Zr=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,kt).replace(/punctSpace/g,Le).replace(/punct/g,we).getRegex(),Vr=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,xt).getRegex(),Ur="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Qr=S(Ur,"gu").replace(/notPunctSpace/g,Or).replace(/punctSpace/g,Lr).replace(/punct/g,xt).getRegex(),Yr=S(/\\(punct)/,"gu").replace(/punct/g,we).getRegex(),Wr=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Kr=S(De).replace("(?:-->|$)","-->").getRegex(),Xr=S("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Kr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),be=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Jr=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",be).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wt=S(/^!?\[(label)\]\[(ref)\]/).replace("label",be).replace("ref",Me).getRegex(),_t=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",Me).getRegex(),en=S("reflink|nolink(?!\\()","g").replace("reflink",wt).replace("nolink",_t).getRegex(),Ke=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Oe={_backpedal:ee,anyPunctuation:Yr,autolink:Wr,blockSkip:Hr,br:mt,code:Pr,del:ee,delLDelim:ee,delRDelim:ee,emStrongLDelim:qr,emStrongRDelimAst:Nr,emStrongRDelimUnd:Zr,escape:Ir,link:Jr,nolink:_t,punctuation:Mr,reflink:wt,reflinkSearch:en,tag:Xr,text:Br,url:ee},tn={...Oe,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",be).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be).getRegex()},Te={...Oe,emStrongRDelimAst:Gr,emStrongLDelim:Fr,delLDelim:Vr,delRDelim:Qr,url:S(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ke).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:S(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ke).getRegex()},sn={...Te,br:S(mt).replace("{2,}","*").getRegex(),text:S(Te.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},fe={normal:Ee,gfm:jr,pedantic:zr},le={normal:Oe,gfm:Te,breaks:sn,pedantic:tn},rn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xe=r=>rn[r];function Z(r,e){if(e){if(H.escapeTest.test(r))return r.replace(H.escapeReplace,Xe)}else if(H.escapeTestNoEncode.test(r))return r.replace(H.escapeReplaceNoEncode,Xe);return r}function Je(r){try{r=encodeURI(r).replace(H.percentDecode,"%")}catch{return null}return r}function et(r,e){let s=r.replace(H.findPipe,(o,a,d)=>{let l=!1,p=a;for(;--p>=0&&d[p]==="\\";)l=!l;return l?"|":" |"}),n=s.split(H.splitPipe),t=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;t<n.length;t++)n[t]=n[t].trim().replace(H.slashPipe,"|");return n}function ie(r,e,s){let n=r.length;if(n===0)return"";let t=0;for(;t<n&&r.charAt(n-t-1)===e;)t++;return r.slice(0,n-t)}function nn(r,e){if(r.indexOf(e[1])===-1)return-1;let s=0;for(let n=0;n<r.length;n++)if(r[n]==="\\")n++;else if(r[n]===e[0])s++;else if(r[n]===e[1]&&(s--,s<0))return n;return s>0?-2:-1}function an(r,e=0){let s=e,n="";for(let t of r)if(t==="	"){let o=4-s%4;n+=" ".repeat(o),s+=o}else n+=t,s++;return n}function tt(r,e,s,n,t){let o=e.href,a=e.title||null,d=r[1].replace(t.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:s,href:o,title:a,text:d,tokens:n.inlineTokens(d)};return n.state.inLink=!1,l}function on(r,e,s){let n=r.match(s.other.indentCodeCompensation);if(n===null)return e;let t=n[1];return e.split(`
221`).map(o=>{let a=o.match(s.other.beginningSpace);if(a===null)return o;let[d]=a;return d.length>=t.length?o.slice(t.length):o}).join(`
222`)}var xe=class{options;rules;lexer;constructor(r){this.options=r||se}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let s=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?s:ie(s,`
223`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let s=e[0],n=on(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let n=ie(s,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(s=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:ie(e[0],`
224`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let s=ie(e[0],`
225`).split(`
226`),n="",t="",o=[];for(;s.length>0;){let a=!1,d=[],l;for(l=0;l<s.length;l++)if(this.rules.other.blockquoteStart.test(s[l]))d.push(s[l]),a=!0;else if(!a)d.push(s[l]);else break;s=s.slice(l);let p=d.join(`
227`),c=p.replace(this.rules.other.blockquoteSetextReplace,`
228    $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
229${p}`:p,t=t?`${t}
230${c}`:c;let b=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,o,!0),this.lexer.state.top=b,s.length===0)break;let y=o.at(-1);if(y?.type==="code")break;if(y?.type==="blockquote"){let R=y,x=R.raw+`
231`+s.join(`
232`),C=this.blockquote(x);o[o.length-1]=C,n=n.substring(0,n.length-R.raw.length)+C.raw,t=t.substring(0,t.length-R.text.length)+C.text;break}else if(y?.type==="list"){let R=y,x=R.raw+`
233`+s.join(`
234`),C=this.list(x);o[o.length-1]=C,n=n.substring(0,n.length-y.raw.length)+C.raw,t=t.substring(0,t.length-R.raw.length)+C.raw,s=x.substring(o.at(-1).raw.length).split(`
235`);continue}}return{type:"blockquote",raw:n,tokens:o,text:t}}}list(r){let e=this.rules.block.list.exec(r);if(e){let s=e[1].trim(),n=s.length>1,t={type:"list",raw:"",ordered:n,start:n?+s.slice(0,-1):"",loose:!1,items:[]};s=n?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=n?s:"[*+-]");let o=this.rules.other.listItemRegex(s),a=!1;for(;r;){let l=!1,p="",c="";if(!(e=o.exec(r))||this.rules.block.hr.test(r))break;p=e[0],r=r.substring(p.length);let b=an(e[2].split(`
236`,1)[0],e[1].length),y=r.split(`
237`,1)[0],R=!b.trim(),x=0;if(this.options.pedantic?(x=2,c=b.trimStart()):R?x=e[1].length+1:(x=b.search(this.rules.other.nonSpaceChar),x=x>4?1:x,c=b.slice(x),x+=e[1].length),R&&this.rules.other.blankLine.test(y)&&(p+=y+`
238`,r=r.substring(y.length+1),l=!0),!l){let C=this.rules.other.nextBulletRegex(x),F=this.rules.other.hrRegex(x),w=this.rules.other.fencesBeginRegex(x),A=this.rules.other.headingBeginRegex(x),f=this.rules.other.htmlBeginRegex(x),_=this.rules.other.blockquoteBeginRegex(x);for(;r;){let I=r.split(`
239`,1)[0],O;if(y=I,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting,"  "),O=y):O=y.replace(this.rules.other.tabCharGlobal,"    "),w.test(y)||A.test(y)||f.test(y)||_.test(y)||C.test(y)||F.test(y))break;if(O.search(this.rules.other.nonSpaceChar)>=x||!y.trim())c+=`
240`+O.slice(x);else{if(R||b.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||w.test(b)||A.test(b)||F.test(b))break;c+=`
241`+y}R=!y.trim(),p+=I+`
242`,r=r.substring(I.length+1),b=O.slice(x)}}t.loose||(a?t.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0)),t.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),t.raw+=p}let d=t.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let l of t.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let c={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=c.checked,t.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!t.loose){let p=l.tokens.filter(b=>b.type==="space"),c=p.length>0&&p.some(b=>this.rules.other.anyLine.test(b.raw));t.loose=c}}if(t.loose)for(let l of t.items){l.loose=!0;for(let p of l.tokens)p.type==="text"&&(p.type="paragraph")}return t}}html(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);if(e){let s=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:s,raw:e[0],href:n,title:t}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let s=et(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
243`):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(s.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<s.length;a++)o.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:o.align[a]});for(let a of t)o.rows.push(et(a,o.header.length).map((d,l)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:o.align[l]})));return o}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let s=e[1].charAt(e[1].length-1)===`
244`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:s,tokens:this.lexer.inline(s)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(
vendor: 4,242 bytes, line 244
244this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=ie(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=nn(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let n=e[2],t="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],t=o[3])}else t=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?n=n.slice(1):n=n.slice(1,-1)),tt(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let s;if((s=this.rules.inline.reflink.exec(r))||(s=this.rules.inline.nolink.exec(r))){let n=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[n.toLowerCase()];if(!t){let o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return tt(s,t,s[0],this.lexer,this.rules)}}emStrong(r,e,s=""){let n=this.rules.inline.emStrongLDelim.exec(r);if(!(!n||n[3]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!s||this.rules.inline.punctuation.exec(s))){let t=[...n[0]].length-1,o,a,d=t,l=0,p=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*r.length+t);(n=p.exec(e))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(a=[...o].length,n[3]||n[4]){d+=a;continue}else if((n[5]||n[6])&&t%3&&!((t+a)%3)){l+=a;continue}if(d-=a,d>0)continue;a=Math.min(a,a+d+l);let c=[...n[0]][0].length,b=r.slice(0,t+n.index+c+a);if(Math.min(t,a)%2){let R=b.slice(1,-1);return{type:"em",raw:b,text:R,tokens:this.lexer.inlineTokens(R)}}let y=b.slice(2,-2);return{type:"strong",raw:b,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let s=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(s),t=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return n&&t&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:e[0],text:s}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,s=""){let n=this.rules.inline.delLDelim.exec(r);if(n&&(!n[1]||!s||this.rules.inline.punctuation.exec(s))){let t=[...n[0]].length-1,o,a,d=t,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*r.length+t);(n=l.exec(e))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o||(a=[...o].length,a!==t))continue;if(n[3]||n[4]){d+=a;continue}if(d-=a,d>0)continue;a=Math.min(a,a+d);let p=[...n[0]][0].length,c=r.slice(0,t+n.index+p+a),b=c.slice(t,-t);return{type:"del",raw:c,text:b,tokens:this.lexer.inlineTokens(b)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let s,n;return e[2]==="@"?(s=e[1],n="mailto:"+s):(s=e[1],n=s),{type:"link",raw:e[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let s,n;if(e[2]==="@")s=e[0],n="mailto:"+s;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);s=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let s=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:s}}}},N=class Ce{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||se,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let s={other:H,block:fe.normal,inline:le.normal};this.options.pedantic?(s.block=fe.pedantic,s.inline=le.pedantic):this.options.gfm&&(s.block=fe.gfm,this.options.breaks?s.inline=le.breaks:s.inl
vendor: 13,001 bytes, lines 244-276
244ine=le.gfm),this.tokenizer.rules=s}static get rules(){return{block:fe,inline:le}}static lex(e,s){return new Ce(s).lex(e)}static lexInline(e,s){return new Ce(s).inlineTokens(e)}lex(e){e=e.replace(H.carriageReturn,`
245`),this.blockTokens(e,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let n=this.inlineQueue[s];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,s=[],n=!1){for(this.options.pedantic&&(e=e.replace(H.tabCharGlobal,"    ").replace(H.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(a=>(t=a.call({lexer:this},e,s))?(e=e.substring(t.raw.length),s.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let a=s.at(-1);t.raw.length===1&&a!==void 0?a.raw+=`
246`:s.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let a=s.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
247`)?"":`
248`)+t.raw,a.text+=`
249`+t.text,this.inlineQueue.at(-1).src=a.text):s.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let a=s.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
250`)?"":`
251`)+t.raw,a.text+=`
252`+t.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},s.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),s.push(t);continue}let o=e;if(this.options.extensions?.startBlock){let a=1/0,d=e.slice(1),l;this.options.extensions.startBlock.forEach(p=>{l=p.call({lexer:this},d),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(t=this.tokenizer.paragraph(o))){let a=s.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
253`)?"":`
254`)+t.raw,a.text+=`
255`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):s.push(t),n=o.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let a=s.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
256`)?"":`
257`)+t.raw,a.text+=`
258`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):s.push(t);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,s}inline(e,s=[]){return this.inlineQueue.push({src:e,tokens:s}),s}inlineTokens(e,s=[]){let n=e,t=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)l.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,t.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)o=t[2]?t[2].length:0,n=n.slice(0,t.index+o)+"["+"a".repeat(t[0].length-o-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,d="";for(;e;){a||(d=""),a=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,s))?(e=e.substring(l.raw.length),s.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=s.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):s.push(l);continue}if(l=this.tokenizer.emStrong(e,n,d)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.del(e,n,d)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),s.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),s.push(l);continue}let p=e;if(this.options.extensions?.startInline){let c=1/0,b=e.slice(1),y;this.options.extensions.startInline.forEach(R=>{y=R.call({lexer:this},b),typeof y=="number"&&y>=0&&(c=Math.min(c,y))}),c<1/0&&c>=0&&(p=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(p)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(d=l.raw.slice(-1)),a=!0;let c=s.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):s.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return s}},ye=class{options;parser;constructor(r){this.options=r||se}space(r){return""}code({text:r,lang:e,escaped:s}){let n=(e||"").match(H.notSpaceStart)?.[0],t=r.replace(H.endingNewline,"")+`
259`;return n?'<pre><code class="language-'+Z(n)+'">'+(s?t:Z(t,!0))+`</code></pre>
260`:"<pre><code>"+(s?t:Z(t,!0))+`</code></pre>
261`}blockquote({tokens:r}){return`<blockquote>
262${this.parser.parse(r)}</blockquote>
263`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
264`}hr(r){return`<hr>
265`}list(r){let e=r.ordered,s=r.start,n="";for(let a=0;a<r.items.length;a++){let d=r.items[a];n+=this.listitem(d)}let t=e?"ol":"ul",o=e&&s!==1?' start="'+s+'"':"";return"<"+t+o+`>
266`+n+"</"+t+`>
267`}listitem(r){return`<li>${this.parser.parse(r.tokens)}</li>
268`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
269`}table(r){let e="",s="";for(let t=0;t<r.header.length;t++)s+=this.tablecell(r.header[t]);e+=this.tablerow({text:s});let n="";for(let t=0;t<r.rows.length;t++){let o=r.rows[t];s="";for(let a=0;a<o.length;a++)s+=this.tablecell(o[a]);n+=this.tablerow({text:s})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
270<thead>
271`+e+`</thead>
272`+n+`</table>
273`}tablerow({text:r}){return`<tr>
274${r}</tr>
275`}tablecell(r){let e=this.parser.parseInline(r.tokens),s=r.header?"th":"td";return(r.align?`<${s} align="${r.align}">`:`<${s}>`)+e+`</${s}>
276`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${Z(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:s}){let n=this.parser.parseInline(s),t=Je(r);if(t===null)return n;r=t;let o='<a href="'+r+'"';return e&&(o+=' title="'+Z(e)+'"'),o+=">"+n+"</a>",o}image({href:r,title:e,text:s,tokens:n}){n&&(s=this.parser.parseInline(n,this.parser.textRenderer));let t=Je(r);if(t===null)return Z(s);r=t;let o=`<img src="${r}" alt="${Z(s)}"`;return e&&(o+=` title="${Z(e)}"`),o+=">",o}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:Z(r.text)}},He=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},G=class Ae{options;renderer;textRenderer;constructor(e){this.options=e||se,this.options.renderer=this.options.renderer||new ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new He}static parse(e,s){return new Ae(s).parse(e)}static parseInline(e,s){return new Ae(s).parseInline(e)}parse(e){let s="";for(let n=0;n<e.length;n++){let t=e[n];if(this.options.extensions?.renderers?.[t.type]){let a=t,d=this.options.extensions.renderers[a.type].call({parser:this},a);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){s+=d||"";continue}}let o=t;switch(o.type){case"space":{s+=this.renderer.space(o);break}case"hr":{s+=this.renderer.hr(o);break}case"heading":{s+=this.renderer.heading(o);break}case"code":{s+=this.renderer.code(o);break}case"table":{s+=this.renderer.table(o);break}case"blockquote":{s+=this.renderer.blockquote(o);break}case"list":{s+=this.renderer.list(o);break}case"checkbox":{s+=this.renderer.checkbox(o);break}case"html":{s+=this.renderer.html(o);break}case"def":{s+=this.renderer.def(o);break}case"paragraph":{s+=this.renderer.paragraph(o);break}case"text":{s+=this.renderer.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,s=this.renderer){let n="";for(let t=0;t<e.length;t++){let o=e[t];if(this.options.extensions?.renderers?.[o.type]){let d=this.options.extensions.renderers[o.type].call({parser:this},o);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=d||"";continue}}let a=o;switch(a.type){case"escape":{n+=s.text(a);break}case"html":{n+=s.html(a);break}case"link":{n+=s.link(a);break}case"image":{n+=s.image(a);break}case"checkbox":{n+=s.checkbox(a);break}case"strong":{n+=s.strong(a);break}case"em":{n+=s.em(a);break}case"codespan":{n+=s.codespan(a);break}case"br":{n+=s.br(a);break}case"del":{n+=s.del(a);break}case"text":{n+=s.text(a);break}default:{let d='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}},ce=class{options;block;constructor(r){this.options=r||se}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(){return this.block?N.lex:N.lexInline}provideParser(){return this.block?G.parse:G.parseInline}},ln=class{defaults=Ie();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=G;Renderer=ye;TextRenderer=He;Lexer=N;Tokenizer=xe;Hooks=ce;constructor(...r){this.use(...r)}walkTokens(r,e){let s=[];for(let n of r)switch(s=s.concat(e.call(this,n)),n.type){case"table":{let t=n;for(let o of t.header)s=s.concat(this.walkTokens(o.tokens,e));for(let o of t.rows)for(let a of o)s=s.concat(this.walkTokens(a.tokens,e));break}case"list":{let t=n;s=s.concat(this.walkTokens(t.items,e));break}default:{let t=n;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(o=>{let a=t[o].flat(1/0);s=s.concat(this.walkTokens(a,e))}):t.tokens&&(s=s.concat(this.walkTokens(t.tokens,e)))}}return s}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(s=>{let n={...s};if(n.async=this.defaults.async||n.async||!1,s.extensions&&(s.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let o=e.renderers[t.name];o?e.renderers[t.name]=function(...a){let d=t.renderer.apply(this,a);return d===!1&&(d=o.apply(this,a)),d}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[t.level];o?o.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),n.extensions=e),s.renderer){let t=this.defaults.renderer||new ye(this.defaults);for(let o in s.renderer){if(!(o in t))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,d=s.renderer[a],l=t[a];t[a]=(...p)=>{let c=d.apply(t,p);return c===!1&&(c=l.apply(t,p)),c||""}}n.renderer=t}if(s.tokenizer){let t=this.defaults.tokenizer||new xe(this.defaults);for(let o in s.tokenizer){if(!(o in t))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,d=s.tokenizer[a],l=t[a];t[a]=(...p)=>{let c=d.apply(t,p);return c===!1&&(c=l.apply(t,p)),c}}n.tokenizer=t}if(s.hooks){let t=this.defaults.hooks||new ce;for(let o in s.hooks){if(!(o in t))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,d=s.hooks[a],l=t[a];ce.passThroughHooks.has(o)?t[a]=p=>
276{if(this.defaults.async&&ce.passThroughHooksRespectAsync.has(o))return(async()=>{let b=await d.call(t,p);return l.call(t,b)})();let c=d.call(t,p);return l.call(t,c)}:t[a]=(...p)=>{if(this.defaults.async)return(async()=>{let b=await d.apply(t,p);return b===!1&&(b=await l.apply(t,p)),b})();let c=d.apply(t,p);return c===!1&&(c=l.apply(t,p)),c}}n.hooks=t}if(s.walkTokens){let t=this.defaults.walkTokens,o=s.walkTokens;n.walkTokens=function(a){let d=[];return d.push(o.call(this,a)),t&&(d=d.concat(t.call(this,a))),d}}this.defaults={...this.defaults,...n}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return N.lex(r,e??this.defaults)}parser(r,e){return G.parse(r,e??this.defaults)}parseMarkdown(r){return(e,s)=>{let n={...s},t={...this.defaults,...n},o=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&n.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=r),t.async)return(async()=>{let a=t.hooks?await t.hooks.preprocess(e):e,d=await(t.hooks?await t.hooks.provideLexer():r?N.lex:N.lexInline)(a,t),l=t.hooks?await t.hooks.processAllTokens(d):d;t.walkTokens&&await Promise.all(this.walkTokens(l,t.walkTokens));let p=await(t.hooks?await t.hooks.provideParser():r?G.parse:G.parseInline)(l,t);return t.hooks?await t.hooks.postprocess(p):p})().catch(o);try{t.hooks&&(e=t.hooks.preprocess(e));let a=(t.hooks?t.hooks.provideLexer():r?N.lex:N.lexInline)(e,t);t.hooks&&(a=t.hooks.processAllTokens(a)),t.walkTokens&&this.walkTokens(a,t.walkTokens);let d=(t.hooks?t.hooks.provideParser():r?G.parse:G.parseInline)(a,t);return t.hooks&&(d=t.hooks.postprocess(d)),d}catch(a){return o(a)}}}onError(r,e){return s=>{if(s.message+=`
277Please report this to https://github.com/markedjs/marked.`,r){let n="<p>An error occurred:</p><pre>"+Z(s.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(s);throw s}}},te=new ln;function j(r,e){return te.parse(r,e)}j.options=j.setOptions=function(r){return te.setOptions(r),j.defaults=te.defaults,pt(j.defaults),j};j.getDefaults=Ie;j.defaults=se;j.use=function(...r){return te.use(...r),j.defaults=te.defaults,pt(j.defaults),j};j.walkTokens=function(r,e){return te.walkTokens(r,e)};j.parseInline=te.parseInline;j.Parser=G;j.parser=G.parse;j.Renderer=ye;j.TextRenderer=He;j.Lexer=N;j.lexer=N.lex;j.Tokenizer=xe;j.Hooks=ce;j.parse=j;j.options;j.setOptions;j.use;j.walkTokens;j.parseInline;G.parse;N.lex;const $t=()=>{const{apiFetch:r}=lt();return{fetchResponses:async o=>r(`/v1/projects/${o}/ai-advisor`),refreshResponses:async o=>{await r(`/v1/projects/${o}/ai-advisor/refresh`,{method:"POST"})},adminRefreshResponses:async o=>{await r(`/v1/projects/${o}/ai-advisor/admin-refresh`,{method:"POST"})},fetchResponseHistory:async(o,a,d=1,l=10)=>r(`/v1/projects/${o}/ai-advisor/history?section=${a}&page=${d}&per_page=${l}`)}},cn={class:"flex items-center gap-2 px-4 pt-3 pb-1"},un={key:0,class:"block w-2 h-2 rounded-full bg-green-400 analyzing-dot"},dn={class:"text-sm font-semibold text-gray-900 flex-shrink-0"},pn={class:"flex items-center gap-1.5 flex-shrink-0"},hn={key:0,class:"text-xs font-mono px-2 py-0.5 rounded text-green-600 bg-green-50 flex-shrink-0 analyzing-text"},gn=["disabled"],fn=["disabled"],mn={key:0,class:"px-4 pb-3"},kn={key:0,class:"px-4 pb-3"},bn={key:1,class:"px-4 pb-3"},xn={key:0,class:"text-sm text-gray-600 leading-relaxed mb-2"},yn={class:"flex justify-end"},vn={key:0,class:"mt-2 pt-2 border-t border-gray-100"},wn=["innerHTML"],st=5,_n=Y({__name:"AdvisorCard",props:{section:{},advisory:{},label:{},projectId:{},route:{default:void 0},analyzing:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(r){const e=r,{fetchResponseHistory:s}=$t(),n=D(0),t=D([]),o=D(!1),a=D(1),d=D("slide-left"),l=D(!1),p=v(()=>e.analyzing),c=v(()=>{if(n.value===0)return e.advisory;const V=n.value-1;return t.value[V]??e.advisory}),b=v(()=>Math.min(a.value,st)),y=v(()=>b.value>1),R=v(()=>n.value<b.value-1),x=v(()=>n.value>0),C=async()=>
277{if(!o.value)try{const V=await s(e.projectId,e.section,1,st);t.value=V.items.slice(1),a.value=V.total,o.value=!0}catch{}};at(()=>{C()}),ke(()=>e.advisory?.id,()=>{o.value=!1,n.value=0,C()});const F=()=>{R.value&&(d.value="slide-left",n.value++)},w=()=>{x.value&&(d.value="slide-right",n.value--)},A=v(()=>c.value?.content?j.parse(c.value.content,{async:!1}):""),f=v(()=>e.disabled?"disabled":p.value?"gray":c.value?.priority??"green"),_=v(()=>f.value==="disabled"?"border-gray-100 opacity-50":f.value==="red"?"border-red-200 shadow-sm shadow-red-50":f.value==="yellow"?"border-amber-200 shadow-sm shadow-amber-50":f.value==="gray"?"border-gray-200":"border-gray-200 hover:border-gray-300"),I=v(()=>f.value==="disabled"?"bg-gray-200":f.value==="red"?"bg-red-400":f.value==="yellow"?"bg-amber-400":f.value==="gray"?"bg-gray-300":"bg-green-400"),O=v(()=>p.value?"":f.value==="red"?"bg-red-500":f.value==="yellow"?"bg-amber-500":"bg-green-500"),q=v(()=>f.value==="red"?"bg-red-50 border-red-200":f.value==="yellow"?"bg-amber-50 border-amber-200":"bg-green-50 border-green-200"),ne=v(()=>f.value==="red"?"text-red-500":f.value==="yellow"?"text-amber-500":"text-green-500"),de=v(()=>f.value==="red"?"text-red-700":f.value==="yellow"?"text-amber-700":"text-green-700"),{formatTimeAgo:_e}=Zt(),$e=V=>_e(V);return(V,B)=>{const Se=rt;return h(),g("div",{class:z(["group relative rounded-xl border bg-white overflow-hidden transition-all duration-200",i(_)])},[u("div",{class:z(["absolute top-0 left-0 right-0 h-0.5",i(I)])},null,2),u("div",cn,[u("span",{class:z(["w-2 h-2 rounded-full flex-shrink-0",i(O)])},[i(p)?(h(),g("span",un)):T("",!0)],2),u("span",dn,$(r.label),1),r.route?(h(),ze(Se,{key:0,to:r.route,class:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-mono border border-gray-200 rounded text-gray-400 hover:text-green-600 hover:border-green-300 hover:bg-green-50 transition-colors"},{default:me(()=>[...B[1]||(B[1]=[E(" Explore ",-1),u("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7l5 5m0 0l-5 5m5-5H6"})],-1)])]),_:1},8,["to"])):T("",!0),B[4]||(B[4]=u("div",{class:"flex-1"},null,-1)),u("div",pn,[i(p)?(h(),g("span",hn," Analyzing ")):i(c)?.created_at?(h(),g("span",{key:1,class:z(["text-xs font-mono px-2 py-0.5 rounded flex-shrink-0",i(n)===0?"text-gray-500 bg-gray-50":"text-amber-700 bg-amber-50"])},$($e(i(c).created_at)),3)):T("",!0),i(y)?(h(),g("button",{key:2,class:z(["inline-flex items-center gap-1 px-2 py-1 text-xs font-mono border rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default",i(R)?"text-gray-600 border-gray-200 hover:bg-gray-50 hover:border-gray-300":"text-gray-300 border-gray-100"]),disabled:!i(R),onClick:F},[...B[2]||(B[2]=[u("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),E(" Older ",-1)])],10,gn)):T("",!0),i(y)?(h(),g("button",{key:3,class:z(["inline-flex items-center gap-1 px-2 py-1 text-xs font-mono border rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default",i(x)?"text-gray-600 border-gray-200 hover:bg-gray-50 hover:border-gray-300":"text-gray-300 border-gray-100"]),disabled:!i(x),onClick:w},[...B[3]||(B[3]=[E(" Newer ",-1),u("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)])],10,fn)):T("",!0)])]),i(p)?(h(),g("div",mn,[...B[5]||(B[5]=[u("div",{class:"space-y-2 animate-pulse"},[u("div",{class:"h-3 bg-gray-100 rounded w-full"}),u("div",{class:"h-3 bg-gray-100 rounded w-4/5"}),u("div",{class:"h-3 bg-gray-100 rounded w-3/5"})],-1)])])):(h(),g(P,{key:1},[i(c)?.status==="error"?(h(),g("div",kn,[...B[6]||(B[6]=[u("p",{class:"text-sm text-gray-400 italic"}," Unable to generate insights. Try refreshing later. ",-1)])])):i(c)?(h(),g("div",bn,[i(c).summary?(h(),g("p",xn,$(i(c).summary),1)):T("",!0),i(c).action?(h(),g("div",{key:1,class:z(["flex items-start gap-2 rounded-lg border px-3 py-2 mb-2",i(q)])},[(h(),g("svg",{class:z(["w-3.5 h-3.5 shrink-0 mt-0.5",i(ne)]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...B[7]||(B[7]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 7l5 5m0 0l-5 5m5-5H6"},null,-1)])],2)),u("span",{class:z(["text-sm font-medium leading-snug",i(de)])},$(i(c).action),3)],2)):T("",!0),u("div",yn,[i(c).content?(h(),g("button",{key:0,class:"inline-flex items-center gap-1 text-xs font-mono text-gray-400 hover:text-green-600 transition-colors cursor-pointer",onClick:B[0]||(B[0]=qe=>l.value=!i(l))}
277,[E($(i(l)?"Less detail":"More detail")+" ",1),(h(),g("svg",{class:z(["w-3 h-3 transition-transform duration-200",i(l)?"rotate-180":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...B[8]||(B[8]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))])):T("",!0)]),L(Ye,{name:"detail-expand"},{default:me(()=>[i(l)?(h(),g("div",vn,[L(Ye,{name:i(d),mode:"out-in"},{default:me(()=>[(h(),g("div",{key:i(n),class:"advisor-content text-sm text-gray-600 leading-relaxed",innerHTML:i(A)},null,8,wn))]),_:1},8,["name"])])):T("",!0)]),_:1})])):T("",!0)],64))],2)}}}),$n=Object.assign(Vt(_n,[["__scopeId","data-v-a2999c66"]]),{__name:"OverviewAdvisorCard"}),Sn={key:0},Rn={class:"flex items-center gap-3 mb-1"},Tn={class:"font-mono text-xl font-semibold text-gray-900"},Cn={key:0,class:"text-sm text-gray-500 font-mono"},An={key:1,class:"text-gray-300"},jn={key:1,class:"mb-6"},zn={key:0,class:"rounded-xl border border-red-200 bg-red-50 p-4 mb-6"},In={class:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-6"},Pn={class:"mb-8"},Bn={class:"flex items-center justify-between mb-4"},Mn={class:"flex items-center gap-2"},Dn={key:0,class:"inline-flex items-center gap-1.5 text-xs text-green-600 font-mono"},En={class:"flex items-center gap-2"},Ln=["disabled"],On={key:1,class:"inline-flex items-center gap-1.5 text-xs font-mono text-green-600 px-2.5 py-1"},Hn={key:0,class:"text-xs text-gray-500 font-mono bg-gray-50 rounded-md px-2.5 py-1"},qn={class:"font-semibold text-gray-700"},Fn=["disabled"],Nn={key:0,class:"rounded-xl border border-gray-200 bg-gray-50 p-6 mb-4"},Gn={class:"text-center"}
277,Zn={key:0,class:"text-xs text-gray-400 mt-2 font-mono"},Vn={key:1,class:"text-gray-500"},na=Y({__name:"index",setup(r){const s=qt().params.id,{fetchProject:n}=it(),{fetchAnalytics:t}=Ut(),{fetchInstallationHealth:o}=dt(),{fetchResponses:a,refreshResponses:d,adminRefreshResponses:l}=$t(),{user:p}=Gt(),{show:c}=ct(),{trackPageViewed:b,track:y}=Qt(),R=Ft(),x=D(null),C=D(null),F=D(null),w=D(null),A=D(!1),f=D(!1),_=D(!1),I=v(()=>`${R.public.webUrl}/os.js`),O=v(()=>`<script src="${I.value}" data-project="${x.value?.project_key??""}"><\/script>`),q=v(()=>w.value?.data_status??"no_data"),ne=v(()=>w.value?.has_sufficient_history??!0),de=v(()=>w.value?.first_event_at??null),_e=v(()=>p.value?.is_admin===!0),$e=m=>{const k=new Date,M=new Date(m),K=k.getTime()-M.getTime(),re=Math.floor(K/6e4),oe=Math.floor(K/36e5);return re<60?`${re}m ago`:oe<24?`${oe}h ago`:`${Math.floor(oe/24)}d ago`},V=v(()=>(C.value?.conversion_rate??0).toFixed(1)),B=v(()=>(C.value?.unique_visitors_over_time??[]).map(m=>m.count)),Se=v(()=>(C.value?.conversions_over_time??[]).map(m=>m.count)),qe=v(()=>(C.value?.page_views_over_time??[]).map(m=>m.count)),St=v(()=>{const m=C.value?.unique_visitors_over_time??[],k=C.value?.conversions_over_time??[];return m.length?m.map((M,K)=>{const re=k[K]?.count??0;return M.count>0?re/M.count*100:0}):[]}),pe=v(()=>w.value?.refresh_available??!0),Fe=v(()=>w.value?.refresh_available_in??null),W=D(null);let U=null;const Ne=v(()=>{const m=W.value;if(m==null||m<=0)return null;const k=Math.floor(m/3600),M=Math.floor(m%3600/60);return k>0?`${k}h ${M}m`:`${M}m`}),Ge=()=>{U&&clearInterval(U),W.value=Fe.value,!(W.value==null||W.value<=0)&&(U=Yt(()=>{W.value!=null&&W.value>0?W.value--:(U&&clearInterval(U),Qe().catch(()=>{}))},1e3))};ke(Fe,m=>{m!=null&&m>0?Ge():(W.value=null,U&&clearInterval(U))});const Ze=[{key:"analytics",label:"Analytics",feature:"analytics"},{key:"signups",label:"Signups",feature:"waitlist"},{key:"referrals",label:"Referrals",feature:"waitlist"},{key:"messages",label:"Messages",feature:"messages"},{key:"forms",label:"Forms",feature:"forms"},{key:"chat",label:"Chat",feature:"chat"},{key:"performance",label:"Performance",feature:"analytics"},{key:"errors",label:"Errors",feature:"errors"}],Ve=m=>({analytics:`/projects/${s}/analytics`,signups:`/projects/${s}/waitlist`,referrals:`/projects/${s}/referrals`,messages:`/projects/${s}/messages`,forms:`/projects/${s}/forms`,chat:`/projects/${s}/ai-chat`,performance:`/projects/${s}/performance`,errors:`/projects/${s}/errors`,installation:`/projects/${s}/settings`})[m]??`/projects/${s}`,Rt=m=>x.value?m.feature==="errors"&&!x.value.error_logging_enabled||m.feature==="analytics"&&!x.value.analytics_enabled:!1,Tt=v(()=>Ze),Ct=m=>{if(!w.value?.any_pending)return!1;const k=w.value?.sections?.[m];return k?k.status==="loading"||k.status==="pending":!0},At=v(()=>Ze.map(m=>({key:m.key,label:m.label,priority:w.value?.sections?.[m.key]?.priority??"gray",route:Ve(m.key)}))),Ue=v(()=>w.value?.any_pending===!0),jt=v(()=>{if(!w.value?.any_pending)return!1;const m=w.value.sections;return Object.values(m).some(k=>k&&(k.status==="loading"||k.status==="pending"&&!k.content))});ke(q,m=>{(m==="degraded"||m==="disconnected")&&(A.value=!0)});let ae=0,J=null,Re=!1;const Qe=async()=>{if(!Re){Re=!0;try{const m=await a(s);w.value=m,console.log(`[Advisor] fetch: any_pending=${m.any_pending} refresh_available=${m.refresh_available} refresh_in=${m.refresh_available_in}s data_status=${m.data_status}`)}finally{Re=!1}}},he=()=>{if(ae>=24){console.log("[Advisor] polling stopped: max polls reached (24)");return}J=setTimeout(async()=>{try{await Qe(),ae++,console.log(`[Advisor] poll #${ae}: any_pending=${w.value?.any_pending}`),w.value?.any_pending?he():console.log("[Advisor] polling stopped: no pending sections")}catch{console.log("[Advisor] polling stopped: fetch error")}},5e3)};at(async()=>{b("overview");try{const[m,k,M,K]=await Promise.all([n(s),t(s).catch(()=>null),a(s).catch(()=>null),o(s).catch(()=>null)]);x.value=m,C.value=k,w.value=M,F.value=K,console.log(`[Advisor] initial load: any_pending=${M?.any_pending} refresh_available=${M?.refresh_available} refresh_in=${M?.refresh_available_in}s`),M&&!M.refresh_available&&M.refresh_available_in&&Ge(),M?.any_pen
277ding&&(console.log("[Advisor] starting poll loop (any_pending=true on load)"),he())}catch{c("Failed to load project","error")}}),nt(()=>{J&&clearTimeout(J),U&&clearInterval(U)});const zt=async()=>{try{const[m,k,M]=await Promise.all([t(s).catch(()=>null),a(s).catch(()=>null),o(s).catch(()=>null)]);C.value=m,w.value=k,F.value=M}catch{window.location.reload()}},It=m=>{x.value&&Object.assign(x.value,m)},Pt=async()=>{if(pe.value){f.value=!0,y("ai_advisor_refreshed");try{if(console.log("[Advisor] manual refresh requested"),await d(s),ae=0,J&&clearTimeout(J),w.value){w.value={...w.value,any_pending:!0};for(const m of Object.keys(w.value.sections)){const k=w.value.sections[m];k&&(w.value.sections[m]={...k,status:"loading"})}}f.value=!1,he()}catch{c("Failed to refresh insights","error"),f.value=!1}}},Bt=async()=>{_.value=!0;try{if(console.log("[Advisor] admin force refresh requested"),await l(s),ae=0,J&&clearTimeout(J),w.value){w.value={...w.value,any_pending:!0};for(const m of Object.keys(w.value.sections)){const k=w.value.sections[m];k&&(w.value.sections[m]={...k,status:"loading"})}}_.value=!1,he()}catch{c("Failed to trigger admin refresh","error"),_.value=!1}};return(m,k)=>{const M=ut,K=_s,re=Xs,oe=ar,Mt=cr,ge=br,Dt=$n;return i(x)?(h(),g("div",Sn,[u("div",Rn,[u("h1",Tn,$(i(x).name),1)]),i(x).url||i(q)!=="no_data"?(h(),g("div",{key:0,class:z(["flex items-center gap-2",i(A)?"mb-3":"mb-6"])},[i(x).url?(h(),g("p",Cn,$(i(x).url),1)):T("",!0),i(x).url&&i(q)!=="no_data"?(h(),g("span",An,"·")):T("",!0),i(q)!=="no_data"?(h(),g("button",{key:2,class:"inline-flex items-center gap-1.5 cursor-pointer transition-opacity hover:opacity-80 text-xs font-mono",onClick:k[0]||(k[0]=X=>A.value=!i(A))},[k[2]||(k[2]=u("span",{class:"text-gray-400"},"Installation:",-1)),L(M,{status:i(F)?.status??i(q)},null,8,["status"]),(h(),g("svg",{class:z(["w-3 h-3 text-gray-400 transition-transform duration-200",i(A)?"rotate-180":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...k[1]||(k[1]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))])):T("",!0)],2)):T("",!0),i(A)&&i(q)!=="no_data"?(h(),g("div",jn,[L(K,{health:i(F),"script-tag":i(O),"script-url":i(I),"project-key":i(x).project_key},null,8,["health","script-tag","script-url","project-key"])])):T("",!0),i(q)==="no_data"?(h(),g(P,{key:2},[L(re,{"script-tag":i(O),"script-url":i(I),"project-key":i(x).project_key,"project-id":i(s),onDataReceived:zt},null,8,["script-tag","script-url","project-key","project-id"]),L(oe,{"project-id":i(s),"analytics-enabled":i(x).analytics_enabled,"error-logging-enabled":i(x).error_logging_enabled,"performance-enabled":i(x).performance_enabled,onUpdated:It},null,8,["project-id","analytics-enabled","error-logging-enabled","performance-enabled"])],64)):T("",!0),i(q)!=="no_data"?(h(),g(P,{key:3},[L(Mt,{dots:i(At)},null,8,["dots"]),i(q)==="disconnected"?(h(),g("div",zn,[...k[3]||(k[3]=[u("div",{class:"flex items-center gap-2 mb-1"},[u("span",{class:"w-2 h-2 rounded-full bg-red-500"}),u("span",{class:"text-sm font-semibold text-red-800"},"Disconnected")],-1),u("p",{class:"text-xs text-red-600"}," No data received in over 7 days. Check that the script tag is still installed on your site. ",-1)])])):T("",!0),u("div",In,[L(ge,{label:"Visitors",value:i(C)?.unique_visitors??0,change:i(C)?.unique_visitors_change,"spark-data":i(B)},null,8,["value","change","spark-data"]),L(ge,{label:"Signups",value:i(C)?.total_conversions_period??0,change:i(C)?.conversions_change,"spark-data":i(Se),hero:""},null,8,["value","change","spark-data"]),L(ge,{label:"Conversion",value:i(V)+"%",change:i(C)?.conversion_rate_change,"spark-data":i(St)},null,8,["value","change","spark-data"]),L(ge,{label:"Page Views",value:i(C)?.page_views??0,change:i(C)?.page_views_change,"spark-data":i(qe)},null,8,["value","change","spark-data"])]),u("div",Pn,[u("div",Bn,[u("div",Mn,[k[5]||(k[5]=u("div",{class:"w-6 h-6 rounded-md bg-green-500 flex items-center justify-center"},[u("svg",{class:"w-3.5 h-3.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})])],-1)),k[6]||(k[6]=u("h2",{class:"text-base font-semibold text-gray-900"},"AI Data Analysis",-1)),i(jt)?(h(),g("span",Dn,[...k[4]||(k[4]=[u("span",{class:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"},null,-1),E(" Analyzing... ",-1)])])):T("",!0)]),u("div",En,[i(_e)&&!i(Ue)?(h(),g("button",{key:0,class:"inline-flex items-center gap-1.5 text-xs font-mono px-2.5 py-1 rounded-md transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-default text-amber-700 bg-amber-50 hover:bg-amber-100 border border-amber-200",disabled:i(_),onClick:Bt},[(h(),g("svg",{class:z(["w-3.5 h-3.5",{"animate-spin":i(_)}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...k[7]||(k[7]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2)),k[8]||(k[8]=E(" Admin Refresh ",-1))],8,Ln)):T("",!0),i(Ue)?(h(),g("div",On,[...k[9]||(k[9]=[u("svg",{class:"w-3.5 h-3.5 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)])])):(h(),g(P,{key:2},[!i(pe)&&i(Ne)&&!i(f)&&i(ne)?(h(),g("div",Hn,[k[10]||(k[10]=E(" Next refresh in ",-1)),u("span",qn,$(i(Ne)),1)])):T("",!0),u("button",{class:z(["inline-flex items-center gap-1.5 text-xs font-mono px-2.5 py-1 rounded-md transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-default",i(pe)&&!i(f)?"text-green-700 bg-green-50 hover:bg-green-100":"text-gray-400 bg-gray-50"]),disabled:i(f)||!i(pe),onClick:Pt},[(h(),g("svg",{class:z(["w-3.5 h-3.5",{"animate-spin":i(f)}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...k[11]||(k[11]=[u("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2)),k[12]||(k[12]=E(" Refresh ",-1))],10,Fn)],64))])]),!i(ne)&&i(q)!=="no_data"?(h(),g("div",Nn,[u("div",Gn,[k[13]||(k[13]=je('<
277div class="w-12 h-12 mx-auto mb-3 rounded-lg border border-gray-200 bg-white flex items-center justify-center"><svg class="w-6 h-6 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div><h3 class="text-sm font-semibold text-gray-500 mb-1">Collecting data...</h3><p class="text-xs text-gray-400 max-w-md mx-auto"> Once your site has at least 24 hours of data, we&#39;ll run an AI analysis across analytics, signups, messages, and more. Check back soon. </p>',3)),i(de)?(h(),g("p",Zn," First data received "+$($e(i(de))),1)):T("",!0)])])):T("",!0),u("div",{class:z(["grid grid-cols-1 md:grid-cols-2 gap-3",{"opacity-30 pointer-events-none":!i(ne)}])},[(h(!0),g(P,null,Q(i(Tt),X=>(h(),ze(Dt,{key:X.key,section:X.key,advisory:i(w)?.sections?.[X.key]??null,label:X.label,"project-id":i(s),route:Ve(X.key),analyzing:Ct(X.key),disabled:Rt(X)},null,8,["section","advisory","label","project-id","route","analyzing","disabled"]))),128))],2)])],64)):T("",!0)])):(h(),g("div",Vn,"Loading..."))}}});export{na 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.