@plitzi/plitzi-sdk 0.39.11 → 0.39.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,417 @@
1
+ import{$ as e,A as t,B as a,C as r,ComponentContext as l,D as i,E as n,F as s,G as o,H as d,I as c,J as u,K as m,L as p,M as h,N as f,O as g,P as x,PluginsContext as v,Q as b,R as y,S as N,T as w,U as k,V as S,W as C,X as $,Y as j,Z as T,_ as I,a as L,b as E,c as R,d as A,et as M,f as V,g as z,h as O,i as D,j as F,k as B,l as J,m as P,n as W,o as q,p as U,q as H,r as K,s as Q,t as _,tt as X,u as Z,v as G,w as Y,x as ee,y as te,z as ae}from"@plitzi/plitzi-sdk";import re,{Fragment as le,createContext as ie,forwardRef as ne,memo as se,use as oe,useCallback as de,useContext as ce,useEffect as ue,useEffectEvent as me,useMemo as pe,useReducer as he,useRef as fe,useState as ge,useSyncExternalStore as xe}from"react";import{Fragment as ve,jsx as be,jsxs as ye}from"react/jsx-runtime";var Ne={entries:[],index:-1,canUndo:!1,canRedo:!1},we=()=>{},ke=()=>we,Se=()=>Ne,Ce=/* @__PURE__ */new WeakSet;var $e=e=>{if("string"!=typeof e||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let[t,a,r]=e.split("-").map(Number),l=/* @__PURE__ */new Date(0);return l.setFullYear(t,a-1,r),l.getFullYear()===t&&l.getMonth()===a-1&&l.getDate()===r},je=e=>{let t="number";return/^"/.test(e)?t=/:$/.test(e)?"text-red-700":"text-green-700":/true|false/.test(e)?t="text-blue-700":/null/.test(e)&&(t=""),`<span class="${t}">${e}</span>`},Te=/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,Ie=e=>e?.replace(Te,je)??e,Le=e=>(e=>(e=>null!==e&&"nodeType"in e&&"number"==typeof e.nodeType)(e)&&e.nodeType===Node.ELEMENT_NODE)(e)?e:null,Ee={desktop:{columns:12,gutter:24,margin:32,maxWidth:1200},tablet:{columns:8,gutter:20,margin:24},mobile:{columns:4,gutter:16,margin:16}},Re="rgba(91, 61, 245, 0.07)",Ae="rgba(91, 61, 245, 0.32)",Me=(e,t)=>`${String(e*t)}px`,Ve=(e,t)=>(e=>[{flat:e.flat},...Object.values(e.components).map(e=>({flat:e.flat,componentId:e.id}))])(e).find(e=>Object.hasOwn(e.flat,t)),ze=(e,t)=>Object.hasOwn(e.components,t)?e.components[t]:void 0,Oe={overflow:[],names:[],targets:[],contrast:[],images:[],headings:[]},De=["overflow","names","targets","contrast","images","headings"],Fe={inspect:!1,grid:!1,xray:!1,xrayFilter:"all",tabOrder:!1,viewport:!1,paused:!1,slowMotion:!1,reducedMotion:!1,vision:"none",checks:{overflow:!1,names:!1,targets:!1,contrast:!1,images:!1,headings:!1}},Be="plitzi-reduced-motion",Je="data-plitzi-qa-page",Pe="data-plitzi-qa-finding",We=["data","visibility","flows","motion","flag"],qe="data-plitzi-qa-xray",Ue={data:{label:"Bound to data",description:"A value of it — a text, a style, a state — is read from a binding",colour:"#0ea5e9"},visibility:{label:"Shown on a condition",description:"Whether it shows is bound, or it starts hidden",colour:"#f59e0b"},flows:{label:"Runs a flow",description:"Something done to it starts an interaction",colour:"#ec4899"},motion:{label:"Moves",description:"It arrives, or keeps moving, by its declared motion",colour:"#10b981"},flag:{label:"Behind a flag",description:"It exists only while a feature flag says so",colour:"#8b5cf6"}},He={data:0,visibility:0,flows:0,motion:0,flag:0},Ke=e=>"visibility"===e,Qe=ie({settings:Fe,setSetting:()=>{},setCheck:()=>{},findings:Oe,setFindings:()=>{},xrayCounts:He,setXrayCounts:()=>{},round:0,rescan:()=>{},pinned:void 0,setPinned:()=>{}});Qe.displayName="QaContext";var _e,Xe=({children:e,collapsed:t})=>{let[a,r]=_("plitzi-sdk-dev-tools-qa",Fe),[l,i]=ge(Oe),[n,s]=ge(He),[o,d]=ge(0),[c,u]=ge(),m=pe(()=>({...Fe,...a,checks:{...Fe.checks,...a.checks}}),[a]),p=de((e,t)=>r(a=>({...a,[e]:t})),[r]),h=de((e,t)=>r(a=>({...a,checks:{...Fe.checks,...a.checks,[e]:t}})),[r]),f=de(()=>d(e=>e+1),[]);ue(()=>{t&&(r(e=>({...e,inspect:!1,checks:Fe.checks})),u(void 0))},[t,r]);let g=pe(()=>({settings:m,setSetting:p,setCheck:h,findings:l,setFindings:i,xrayCounts:n,setXrayCounts:s,round:o,rescan:f,pinned:c,setPinned:u}),[m,p,h,l,n,o,f,c]);/* @__PURE__ */
2
+ return be(Qe,{value:g,children:e})},Ze='a[href], button, [role="button"], [role="link"], [role="tab"], input:not([type="hidden"]), select, textarea',Ge=e=>e.getClientRects().length>0,Ye=e=>(e.textContent??"").replace(/\s+/g," ").trim(),et=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?\s*\)$/i,tt=e=>void 0===e?1:e.endsWith("%")?parseFloat(e)/100:parseFloat(e),at=e=>{let t=(()=>{if(void 0===_e)try{let e=document.createElement("canvas");e.width=1,e.height=1,_e=e.getContext("2d",{willReadFrequently:!0})}catch{_e=null}return _e})();if(!t)return(e=>{let t=e.trim(),a=et.exec(t);if(a)return[Number(a[1]),Number(a[2]),Number(a[3]),tt(a.at(4))];let r=/^#([\da-f]{3}|[\da-f]{6})$/i.exec(t)?.[1];if(!r)return"transparent"===t?[0,0,0,0]:void 0;let l=3===r.length?r.replace(/./g,e=>e+e):r,[i,n,s]=[0,2,4].map(e=>parseInt(l.slice(e,e+2),16));return[i,n,s,1]})(e);t.clearRect(0,0,1,1),t.fillStyle="#000",t.fillStyle=e,t.fillRect(0,0,1,1);let[a,r,l,i]=t.getImageData(0,0,1,1).data;return[a,r,l,i/255]},rt=(e,t)=>{let a=e[3]+t[3]*(1-e[3]);if(0===a)return[0,0,0,0];let r=r=>(e[r]*e[3]+t[r]*t[3]*(1-e[3]))/a;return[r(0),r(1),r(2),a]},lt=([e,t,a])=>{let[r,l,i]=[e,t,a].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*r+.7152*l+.0722*i},it=(e,t)=>{let[a,r]=[lt(e),lt(t)].sort((e,t)=>t-e);return(a+.05)/(r+.05)},nt=([e,t,a,r])=>{let l=`#${[e,t,a].map(e=>Math.round(e).toString(16).padStart(2,"0")).join("")}`;return r<1?`${l} · ${String(Math.round(100*r))}%`:l},st=()=>{let e=/* @__PURE__ */new Map,t=/* @__PURE__ */new Map,a=t=>(e.has(t)||e.set(t,at(t)),e.get(t)),r=e=>{if(t.has(e))return t.get(e);let l,i=e.ownerDocument.defaultView?.getComputedStyle(e);if(i&&(!i.backgroundImage||"none"===i.backgroundImage)){let t=a(i.backgroundColor),n=e.parentElement,s=n?r(n):(e=>{let t=e.ownerDocument.documentElement;return e.ownerDocument.defaultView?.getComputedStyle(t).colorScheme.includes("dark")?[18,18,18,1]:[255,255,255,1]})(e);t&&t[3]>=1?l=t:s&&(l=t&&t[3]>0?rt(t,s):s)}return t.set(e,l),l};return{colour:a,backdrop:r}},ot=(e,t)=>e>=24||e>=18.66&&t>=700,dt=e=>{let t=/^h([1-6])$/i.exec(e.tagName)?.[1];return t?Number(t):Number(e.getAttribute("aria-level"))||2},ct=(e,t)=>{let a=e.ownerDocument.defaultView;for(let r=e.parentElement;r&&r!==t;r=r.parentElement){let e=a?.getComputedStyle(r).overflowX;if(e&&"visible"!==e)return!0}return!1},ut={overflow:{label:"Sticks out sideways",description:"Whatever reaches past the page’s sides — what makes a phone scroll sideways",colour:"#f97316",run:e=>{let t=e.getBoundingClientRect(),a=[];for(let r of e.querySelectorAll("*")){if(a.some(e=>e.element.contains(r))||!Ge(r))continue;let{left:l,right:i,width:n}=r.getBoundingClientRect(),s=Math.max(t.left-l,i-t.right);n>0&&s>1&&!ct(r,e)&&a.push({check:"overflow",element:r,note:`${String(Math.round(s))} px past the page`})}return a}},names:{label:"No accessible name",description:"Buttons, links and fields with no words for a screen reader or an agent; pictures with no alt",colour:"#e11d48",run:e=>[...[...e.querySelectorAll(Ze)].filter(e=>Ge(e)&&!(e=>{let t=e.getAttribute("aria-labelledby");if(t){let a=t.split(/\s+/).map(t=>e.ownerDocument.getElementById(t)).map(e=>e?Ye(e):"").join(" ").trim();if(a)return a}let a=e.getAttribute("aria-label")?.trim();if(a)return a;if("labels"in e&&e.labels instanceof NodeList){let t=[...e.labels].map(Ye).join(" ").trim();if(t)return t}let r=[...e.querySelectorAll("img[alt]")].map(e=>e.getAttribute("alt")??"").join(" ");return`${Ye(e)} ${r}`.trim()||(e.getAttribute("title")?.trim()??e.getAttribute("placeholder")?.trim()??"")})(e)).map(e=>({check:"names",element:e,note:`a ${e.tagName.toLowerCase()} with no name`})),...[...e.querySelectorAll("img:not([alt])")].filter(Ge).map(e=>({check:"names",element:e,note:"a picture with no alt"}))]},targets:{label:"Small touch targets",description:"Under 24 × 24 px with another control within reach (WCAG 2.2)",colour:"#d97706",run:e=>{let t=e.ownerDocument.defaultView,a=[...e.querySelectorAll(Ze)].filter(e=>Ge(e)&&"inline"!==t?.getComputedStyle(e).display),r=a.map(e=>e.getBoundingClientRect());return a.flatMap((e,t)=>{let l=r[t];if(l.width>=24&&l.height>=24)return[];let i=l.left+l.width/2,n=l.top+l.height/2;return r.some((r,l)=>l!==t&&!e.contains(a[l])&&((e,t,a)=>Math.hypot(Math.max(a.left-e,0,e-a.right),Math.max(a.top-t,0,t-a.bottom)))(i,n,r)<12)?[{check:"targets",element:e,note:`${String(Math.round(l.width))} × ${String(Math.round(l.height))} px, crowded`}]:[]})}},contrast:{label:"Low contrast",description:"Text under 4.5:1 against what is behind it, 3:1 when large (WCAG AA)",colour:"#db2777",run:e=>{let t=e.ownerDocument.defaultView;if(!t)return[];let a=st();return[...e.querySelectorAll("*")].flatMap(e=>{if(!(e=>[...e.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(Ye).join(" ").trim())(e)||!Ge(e))return[];let r=t.getComputedStyle(e);if("hidden"===r.visibility||0===Number(r.opacity))return[];let l=a.colour(r.color),i=a.backdrop(e);if(!l||!i)return[];let n=it(rt(l,i),i),s=ot(parseFloat(r.fontSize),Number(r.fontWeight)||400)?3:4.5;return n>=s?[]:[{check:"contrast",element:e,note:`${n.toFixed(2)}:1, needs ${String(s)}:1`}]})}},images:{label:"Image sizes",description:"Pictures stretched past their pixels, or files several times bigger than they are shown",colour:"#0891b2",run:e=>{let t=e.ownerDocument.defaultView?.devicePixelRatio??1;return[...e.querySelectorAll("img")].flatMap(e=>{if(!e.complete||0===e.naturalWidth||!Ge(e))return[];let a=e.getBoundingClientRect().width*t;return 0===a?[]:1.25*e.naturalWidth<a?[{check:"images",element:e,note:`${String(e.naturalWidth)} px file drawn at ${String(Math.round(a))} px — soft`}]:e.naturalWidth>2.5*a&&e.naturalWidth>=800?[{check:"images",element:e,note:`${String(e.naturalWidth)} px file for ${String(Math.round(a))} px`}]:[]})}},headings:{label:"Heading outline",description:"No h1, a second one, or a level skipped on the way down",colour:"#7c3aed",run:e=>{let t=[...e.querySelectorAll('h1, h2, h3, h4, h5, h6, [role="heading"]')].filter(Ge);if(0===t.length)return[];let a=[],r=t.filter(e=>1===dt(e));return 0===r.length&&a.push({check:"headings",element:t[0],note:"the page has no h1"}),r.slice(1).forEach(e=>a.push({check:"headings",element:e,note:"another h1"})),t.forEach((e,r)=>{let l=dt(e),i=0===r?1:dt(t[r-1]);l>i+1&&a.push({check:"headings",element:e,note:`h${String(l)} right after h${String(i)}`})}),a}}},mt=({box:e})=>{let t=(({columns:e,gutter:t,margin:a,maxWidth:r},l=1)=>{let i=`calc(100% - ${Me(2*a,l)})`,n=`calc((100% - ${Me(t*(e-1),l)}) / ${String(e)})`;return{width:void 0===r?i:`min(${Me(r,l)}, ${i})`,backgroundImage:`repeating-linear-gradient(to right, ${Re} 0px, ${Re} ${n}, transparent ${n}, transparent calc(${n} + ${Me(t,l)}))`,boxShadow:`inset 1px 0 ${Ae}, inset -1px 0 ${Ae}`}})(Ee[Y(e.viewportWidth)]);/* @__PURE__ */
3
+ return be("div",{"aria-hidden":"true",className:"pointer-events-none fixed top-0 bottom-0 z-[999998]",style:{left:e.left,width:e.width},children:/* @__PURE__ */be("div",{className:"absolute top-0 bottom-0 left-1/2 -translate-x-1/2",style:{width:t.width,backgroundImage:t.backgroundImage,boxShadow:t.boxShadow}})})},pt=e=>parseFloat(e)||0,ht=(e,t,a,r,l)=>({borderStyle:"solid",borderColor:e,borderWidth:`${String(t)}px ${String(a)}px ${String(r)}px ${String(l)}px`}),ft=({element:e})=>{let t=e.ownerDocument.defaultView;if(!t)return null;let a=t.getComputedStyle(e),r=e.getBoundingClientRect(),l=[a.marginTop,a.marginRight,a.marginBottom,a.marginLeft].map(pt),i=[a.borderTopWidth,a.borderRightWidth,a.borderBottomWidth,a.borderLeftWidth].map(pt),n=[a.paddingTop,a.paddingRight,a.paddingBottom,a.paddingLeft].map(pt),[s,o,d,c]=l.map(e=>Math.max(e,0)),[u,m,p,h]=i,[f,g,x,v]=n;/* @__PURE__ */
4
+ return ye(ve,{children:[/* @__PURE__ */be("div",{className:"pointer-events-none fixed z-[999997] box-border",style:{left:r.left-c,top:r.top-s,width:r.width+c+o,height:r.height+s+d,...ht("rgba(249, 115, 22, 0.32)",s,o,d,c)}}),/* @__PURE__ */be("div",{className:"pointer-events-none fixed z-[999997] box-border",style:{left:r.left+h,top:r.top+u,width:Math.max(r.width-h-m,0),height:Math.max(r.height-u-p,0),backgroundColor:"rgba(59, 130, 246, 0.24)",backgroundClip:"padding-box",...ht("rgba(34, 197, 94, 0.32)",f,g,x,v)}})]})},gt=(e,t,a,r)=>({x1:e,y1:t,x2:a,y2:r,length:Math.round(Math.hypot(a-e,r-t))}),xt=(e,t)=>(e+t)/2,vt=({from:e,to:t})=>{let a=((e,t)=>{let a=e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom,r=t.left>=e.left&&t.right<=e.right&&t.top>=e.top&&t.bottom<=e.bottom;if(a||r){let[r,l]=a?[e,t]:[t,e],i=xt(r.left,r.right),n=xt(r.top,r.bottom);return[gt(i,l.top,i,r.top),gt(r.right,n,l.right,n),gt(i,r.bottom,i,l.bottom),gt(l.left,n,r.left,n)].filter(e=>e.length>0)}let l=[],i=xt(Math.max(e.top,t.top),Math.min(e.bottom,t.bottom)),n=xt(Math.max(e.left,t.left),Math.min(e.right,t.right)),s=e.bottom>t.top&&t.bottom>e.top?i:xt(e.top,e.bottom),o=e.right>t.left&&t.right>e.left?n:xt(e.left,e.right);return t.left>=e.right?l.push(gt(e.right,s,t.left,s)):e.left>=t.right&&l.push(gt(t.right,s,e.left,s)),t.top>=e.bottom?l.push(gt(o,e.bottom,o,t.top)):e.top>=t.bottom&&l.push(gt(o,t.bottom,o,e.top)),l})(e.getBoundingClientRect(),t.getBoundingClientRect());/* @__PURE__ */
5
+ return be("svg",{className:"pointer-events-none fixed inset-0 z-[999998] h-full w-full overflow-visible","aria-hidden":"true",children:a.map(({x1:e,y1:t,x2:a,y2:r,length:l})=>/* @__PURE__ */ye("g",{children:[
6
+ /* @__PURE__ */be("line",{x1:e,y1:t,x2:a,y2:r,stroke:"#f43f5e",strokeWidth:1}),
7
+ /* @__PURE__ */be("rect",{x:(e+a)/2-16,y:(t+r)/2-9,width:32,height:18,rx:4,fill:"#f43f5e"}),
8
+ /* @__PURE__ */be("text",{x:(e+a)/2,y:(t+r)/2+4,textAnchor:"middle",fill:"#ffffff",fontSize:11,fontFamily:"ui-monospace, monospace",children:l})]},`${String(e)}-${String(t)}-${String(a)}-${String(r)}`))})},bt=({ratio:e,needs:t})=>/* @__PURE__ */ye("span",{className:m("rounded px-1 font-semibold",{"bg-emerald-500/20 text-emerald-300":e>=t,"bg-rose-500/25 text-rose-300":e<t}),title:`AA needs ${String(t)}:1 for this size`,children:[e.toFixed(2),":1"]}),yt=({colour:e})=>/* @__PURE__ */ye("span",{className:"inline-flex items-center gap-1",children:[/* @__PURE__ */be("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm ring-1 ring-white/30",style:{backgroundColor:e.split(" ")[0]}}),e]}),Nt=["top","right","bottom","left"],wt=(e,t)=>{let[a,r,l,i]=Nt.map(a=>e.getPropertyValue(`${t}-${a}`)||"0px");return a===r&&r===l&&l===i?a:a===l&&r===i?`${a} ${r}`:`${a} ${r} ${l} ${i}`},kt=e=>!e.startsWith("plitzi-component")&&!e.startsWith("plitzi__")&&!e.startsWith("devtools-"),St=e=>e.split(",")[0]?.replace(/["']/g,"").trim()??e,Ct=e=>{let t=e.ownerDocument.defaultView;if(!t)return;let a=t.getComputedStyle(e),r=e.getBoundingClientRect(),l=e.getAttribute("data-type"),i=e.getAttribute("data-plitzi-el"),n=e.tagName.toLowerCase(),s=at(a.color),o=at(a.backgroundColor),d=(e=>st().backdrop(e))(e),c=parseFloat(a.fontSize),u=Number(a.fontWeight)||400,m=s&&d?{ratio:it(rt(s,d),d),needs:ot(c,u)?3:4.5}:void 0;return{name:l&&i?`${l} · ${i}`:n,tag:n,width:Math.round(r.width),height:Math.round(r.height),display:a.display,position:a.position,padding:wt(a,"padding"),margin:wt(a,"margin"),border:`${a.borderTopWidth} ${a.borderTopStyle}`,radius:a.borderTopLeftRadius,gap:"normal"===a.gap?"":a.gap,font:`${St(a.fontFamily)} ${a.fontSize} · ${a.fontWeight}`,lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,colour:s?nt(s):a.color,background:o&&o[3]>0?nt(o):void 0,contrast:m,opacity:a.opacity,zIndex:a.zIndex,classes:[...e.classList].filter(kt)}},$t=({element:e})=>{let t=pe(()=>Ct(e),[e]);if(!t)return null;let a=e.getBoundingClientRect(),r=a.top<120;/* @__PURE__ */
9
+ return ye("div",{className:"pointer-events-none fixed z-[999999] flex max-w-[360px] flex-col gap-1 rounded-lg bg-zinc-900/95 px-2.5 py-2 font-mono text-[11px] leading-snug text-zinc-100 shadow-xl ring-1 ring-white/10",style:{left:Math.max(8,a.left),...r?{top:a.bottom+8}:{bottom:window.innerHeight-a.top+8}},children:[
10
+ /* @__PURE__ */ye("span",{className:"flex items-center gap-2",children:[/* @__PURE__ */be("span",{className:"truncate font-semibold text-violet-300",children:t.name}),/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle",children:[t.width," × ",t.height]})]}),
11
+ /* @__PURE__ */ye("span",{className:"text-ui-fg-subtle",children:[t.font," / ",t.lineHeight]}),
12
+ /* @__PURE__ */ye("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[
13
+ /* @__PURE__ */be(yt,{colour:t.colour}),t.background&&/* @__PURE__ */be(yt,{colour:t.background}),t.contrast&&/* @__PURE__ */be(bt,{ratio:t.contrast.ratio,needs:t.contrast.needs})]}),
14
+ /* @__PURE__ */ye("span",{className:"text-ui-fg-subtle",children:["padding ",t.padding," · margin ",t.margin,t.gap&&` · gap ${t.gap}`]})]})},jt=()=>{let{pinned:e,setPinned:t,setSetting:a}=oe(Qe),r=oe(K),[l,i]=ge(),[n,s]=ge(!1),[,o]=ge(0);ue(()=>{let e=r.current;if(!e)return;let l=t=>t instanceof Element&&e.contains(t),n=0,d=()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>o(e=>e+1))},c=e=>{s(e.altKey),i(l(e.target)?e.target:void 0)},u=e=>{l(e.target)&&(e.preventDefault(),e.stopPropagation(),t(e.target))},m=e=>{s(e.altKey),"keydown"===e.type&&"Escape"===e.key&&a("inspect",!1)};return document.addEventListener("pointermove",c,!0),document.addEventListener("click",u,!0),document.addEventListener("keydown",m,!0),document.addEventListener("keyup",m,!0),document.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{cancelAnimationFrame(n),document.removeEventListener("pointermove",c,!0),document.removeEventListener("click",u,!0),document.removeEventListener("keydown",m,!0),document.removeEventListener("keyup",m,!0),document.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[r,t,a]);let d=e?.isConnected?e:void 0,c=d?.getBoundingClientRect();/* @__PURE__ */
15
+ return ye(ve,{children:[c&&/* @__PURE__ */be("div",{className:"pointer-events-none fixed z-[999998] box-border outline-2 outline-violet-500",style:{left:c.left,top:c.top,width:c.width,height:c.height}}),l&&l!==d&&/* @__PURE__ */be(ft,{element:l}),d&&l&&l!==d&&n&&/* @__PURE__ */be(vt,{from:d,to:l}),l&&!n&&/* @__PURE__ */be($t,{element:l})]})},Tt=()=>{let e=oe(K),[t,a]=ge([]),[,r]=ge(0);return ue(()=>{let t=e.current;if(!t)return;let l,i=0,n=()=>{clearTimeout(l),l=setTimeout(()=>a((e=>{let t=[...e.querySelectorAll(`${Ze}, [tabindex]`)].filter(e=>Number(e.getAttribute("tabindex")??0)>=0&&Ge(e)&&!e.matches(":disabled")),a=e=>Number(e.getAttribute("tabindex")??0);return[...t.filter(e=>a(e)>0).sort((e,t)=>a(e)-a(t)),...t.filter(e=>0===a(e))]})(t)),200)},s=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(()=>r(e=>e+1))};n();let o=new MutationObserver(n);return o.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex","disabled"]}),document.addEventListener("scroll",s,!0),window.addEventListener("resize",n),()=>{clearTimeout(l),cancelAnimationFrame(i),o.disconnect(),document.removeEventListener("scroll",s,!0),window.removeEventListener("resize",n)}},[e]),/* @__PURE__ */be(ve,{children:t.map((e,t)=>{let a=e.getBoundingClientRect();return a.bottom<0||a.top>window.innerHeight?null:/* @__PURE__ */be("span",{className:"pointer-events-none fixed z-[999998] flex h-[18px] min-w-[18px] -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-sky-600 px-1 font-mono text-[10px] font-semibold text-white shadow ring-2 ring-white/80",style:{left:a.left,top:a.top},children:t+1},t)})})},It=({box:e})=>{let t=Math.round(e.width)<e.viewportWidth;/* @__PURE__ */
16
+ return ye("div",{className:"pointer-events-none fixed top-2 z-[999999] -translate-x-1/2 rounded-full bg-zinc-900/90 px-3 py-1 font-mono text-[11px] whitespace-nowrap text-white shadow-lg ring-1 ring-white/10",style:{left:e.left+e.width/2},children:[e.viewportWidth," × ",e.viewportHeight," ·"," ",
17
+ /* @__PURE__ */be("span",{className:"text-violet-300",children:Y(e.viewportWidth)}),t&&/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle",children:[" · page ",Math.round(e.width)]})]})},Lt=e=>We.some(t=>t===e),Et=({filter:e})=>{let t=oe(K),[a,r]=ge([]);return ue(()=>{let a=t.current;if(!a)return;let l=0,i=()=>{cancelAnimationFrame(l),l=requestAnimationFrame(()=>r(((e,t)=>{let a=[],r=/* @__PURE__ */new Set;for(let l of e.querySelectorAll(`[${qe}]`)){if(a.length>=150)break;let e=(l.getAttribute("data-plitzi-qa-xray")??"").split(" ").filter(Lt);if("all"!==t&&!e.includes(t))continue;let i=l.getBoundingClientRect();if(0===i.width||i.bottom<0||i.top>window.innerHeight)continue;let n=e=>`${String(Math.round(i.left))}:${String(Math.round(e))}`,s=i.top>=16?i.top-16+1:Math.max(i.top,0);for(let t=0;t<3&&r.has(n(s));t+=1)s+=16;r.has(n(s))||(r.add(n(s)),a.push({id:l.getAttribute("data-plitzi-el")??"",marks:e,left:i.left,top:s}))}return a})(a,e)))};i();let n=new MutationObserver(i);return n.observe(a,{subtree:!0,attributes:!0,attributeFilter:[qe]}),document.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{cancelAnimationFrame(l),n.disconnect(),document.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[t,e]),/* @__PURE__ */be(ve,{children:a.map(({id:e,marks:t,left:a,top:r})=>/* @__PURE__ */ye("span",{className:"pointer-events-none fixed z-[999998] flex h-[15px] max-w-56 items-center gap-1 rounded-sm bg-zinc-900/85 px-1 font-mono text-[10px] leading-none text-white shadow-sm",style:{left:a,top:r},children:[t.map(e=>/* @__PURE__ */be("span",{title:Ue[e].label,className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:Ue[e].colour}},e)),/* @__PURE__ */be("span",{className:"truncate",children:e})]},`${e}-${String(a)}-${String(r)}`))})},Rt=`[${Je}]`,At=':is([data-type="heading"], [data-type="text"], [data-type="paragraph"], [data-type="button"], [data-type="link"])',Mt=` ${Rt} [data-plitzi-el] { outline: 1px dashed rgba(124, 92, 255, 0.5); outline-offset: -1px; } ${Rt} [data-plitzi-el]:hover { outline: 1.5px solid #7c5cff; outline-offset: -1.5px; } ${Rt} ${At}[data-plitzi-el]:hover { position: relative; } ${Rt} ${At}[data-plitzi-el]:hover::after { content: attr(data-type) ' · ' attr(data-plitzi-el); position: absolute; left: -1px; bottom: 100%; z-index: 2147483000; padding: 1px 6px; border-radius: 4px 4px 0 0; background-color: #7c5cff; color: #ffffff; font: 500 10px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; text-transform: none; white-space: nowrap; pointer-events: none; }`,Vt=e=>[Mt,...We.filter(t=>"all"===e||e===t).reverse().map(e=>`${Rt} [${qe}~="${e}"] { outline: 1.5px solid ${Ue[e].colour}; outline-offset: -1.5px; }`)].join("\n"),zt=`${Rt}, ${Rt} * { cursor: crosshair !important; }`,Ot=`${Rt} *, ${Rt} ::before, ${Rt} ::after { animation-play-state: paused !important; }`,Dt=e=>e.map(e=>`${Rt} [${Pe}~="${e}"] { outline: 2px solid ${ut[e].colour} !important; outline-offset: 1px !important; box-shadow: 0 0 0 4px color-mix(in srgb, ${ut[e].colour} 22%, transparent) !important; }`).join("\n"),Ft=e=>`plitzi-qa-${e}`,Bt={none:"none",grayscale:"grayscale(1)",protanopia:`url(#${Ft("protanopia")})`,deuteranopia:`url(#${Ft("deuteranopia")})`,tritanopia:`url(#${Ft("tritanopia")})`,blurred:"blur(2px)"},Jt={protanopia:"0.567 0.433 0 0 0 0.558 0.442 0 0 0 0 0.242 0.758 0 0 0 0 0 1 0",deuteranopia:"0.625 0.375 0 0 0 0.7 0.3 0 0 0 0 0.3 0.7 0 0 0 0 0 1 0",tritanopia:"0.95 0.05 0 0 0 0 0.433 0.567 0 0 0 0.475 0.525 0 0 0 0 0 1 0"},Pt=e=>{let t=typeof window>"u"?0:window.innerWidth,a=typeof window>"u"?0:window.innerHeight,r=e?.getBoundingClientRect();return{left:r?.left??0,width:r?.width??t,viewportWidth:t,viewportHeight:a}},Wt="http://www.w3.org/2000/svg",qt=()=>{let{settings:e,round:t,setFindings:a,setXrayCounts:r}=oe(Qe),l=oe(K),[[i,n,s]]=ae(["navigation.currentPageId","schema.flat","schema.components"]),o=(e=>{let[t,a]=ge(()=>Pt(e.current));return ue(()=>{let t=e.current,r=()=>a(Pt(t));r(),window.addEventListener("resize",r);let l=t?new ResizeObserver(r):void 0;return t&&l?.observe(t),()=>{window.removeEventListener("resize",r),l?.disconnect()}},[e]),t})(l),d=(e=>e.inspect||e.grid||e.xray||e.tabOrder||e.viewport||e.paused||e.slowMotion||e.reducedMotion||"none"!==e.vision||Object.values(e.checks).some(Boolean))(e),c=pe(()=>(e=>{let t=De.filter(t=>e.checks[t]);return[e.inspect?zt:"",e.xray?Vt(e.xrayFilter):"",e.paused?Ot:"","none"===e.vision?"":`${Rt} { filter: ${Bt[e.vision]}; }`,Dt(t)].filter(Boolean).join("\n")})(e),[e]),u=pe(()=>De.filter(t=>e.checks[t]).join(" "),[e.checks]);return ue(()=>{let e=l.current;if(e&&d)return e.setAttribute(Je,""),()=>e.removeAttribute(Je)},[d,l]),ue(()=>{if(!c)return;let e=document.createElement("style");return e.setAttribute("data-plitzi-qa",""),e.textContent=c,document.head.append(e),()=>e.remove()},[c]),ue(()=>{if(e.reducedMotion)return document.documentElement.classList.add(Be),()=>document.documentElement.classList.remove(Be)},[e.reducedMotion]),ue(()=>{let t=e.vision;if("protanopia"!==t&&"deuteranopia"!==t&&"tritanopia"!==t)return;let a=document.createElementNS(Wt,"svg");a.setAttribute("aria-hidden","true"),a.setAttribute("style","position: absolute; width: 0; height: 0");let r=document.createElementNS(Wt,"filter");r.setAttribute("id",Ft(t));let l=document.createElementNS(Wt,"feColorMatrix");return l.setAttribute("type","matrix"),l.setAttribute("values",Jt[t]),r.append(l),a.append(r),document.body.append(a),()=>a.remove()},[e.vision]),ue(()=>{let t=l.current;if(!t||!e.xray)return void r(He);let a,i=()=>{let e={...He};t.querySelectorAll("[data-plitzi-el]").forEach(t=>{let a=t.getAttribute("data-plitzi-el")??"",r=Ve({flat:n,components:s},a)?.flat[a]?.definition,l=r?(e=>{let t=Object.entries(e.bindings??{}).flatMap(([e,t])=>t.filter(e=>!1!==e.enabled).map(t=>({category:e,to:t.to}))),a=t.some(({category:e,to:t})=>"initialState"===e&&Ke(t)),r={data:t.some(({category:e,to:t})=>!("initialState"===e&&Ke(t))),visibility:a||!1===e.initialState?.visibility,flows:Object.values(e.interactions??{}).some(e=>e.enabled),motion:void 0!==e.motion?.enter||void 0!==e.motion?.loop,flag:void 0!==e.flag};return We.filter(e=>r[e])})(r):[];l.forEach(t=>{e[t]+=1}),0===l.length?t.removeAttribute(qe):t.getAttribute("data-plitzi-qa-xray")!==l.join(" ")&&t.setAttribute("data-plitzi-qa-xray",l.join(" "))}),r(e)};i();let o=new MutationObserver(()=>{clearTimeout(a),a=setTimeout(i,200)});return o.observe(t,{childList:!0,subtree:!0}),()=>{clearTimeout(a),o.disconnect(),t.querySelectorAll(`[${qe}]`).forEach(e=>e.removeAttribute(qe))}},[e.xray,l,n,s,i,r]),ue(()=>{let t=l.current;if(!t||!e.slowMotion)return;let a=e=>t.getAnimations({subtree:!0}).forEach(t=>{t.playbackRate=e}),r=()=>a(.25);return r(),t.addEventListener("animationstart",r),t.addEventListener("transitionrun",r),()=>{t.removeEventListener("animationstart",r),t.removeEventListener("transitionrun",r),a(1)}},[e.slowMotion,l]),ue(()=>{let e=l.current,t=De.filter(e=>u.split(" ").includes(e));if(!e||0===t.length)return void a(Oe);let r,i,n=[],s=()=>{n.forEach(e=>e.removeAttribute(Pe));let r={...Oe};for(let a of t)r[a]=ut[a].run(e);let l=/* @__PURE__ */new Map;t.forEach(e=>r[e].forEach(({element:t})=>l.set(t,[...l.get(t)??[],e]))),l.forEach((e,t)=>t.setAttribute(Pe,e.join(" "))),n=[...l.keys()],a(r)},o=()=>{"function"==typeof requestIdleCallback?i=requestIdleCallback(s,{timeout:1e3}):s()},d=()=>{clearTimeout(r),void 0!==i&&"function"==typeof cancelIdleCallback&&cancelIdleCallback(i),r=setTimeout(o,250)};return d(),window.addEventListener("resize",d),()=>{clearTimeout(r),void 0!==i&&"function"==typeof cancelIdleCallback&&cancelIdleCallback(i),window.removeEventListener("resize",d),n.forEach(e=>e.removeAttribute(Pe))}},[u,l,t,i,a]),/* @__PURE__ */ye(ve,{children:[e.grid&&/* @__PURE__ */be(mt,{box:o}),e.xray&&"none"!==e.xrayFilter&&/* @__PURE__ */be(Et,{filter:e.xrayFilter}),e.tabOrder&&/* @__PURE__ */be(Tt,{}),e.inspect&&/* @__PURE__ */be(jt,{}),e.viewport&&/* @__PURE__ */be(It,{box:o})]})},Ut=({className:e,onOpen:t})=>{let{logs:a}=oe(q),[r,l]=_("plitzi-sdk.dev-tools.badge-side","left"),[n,s]=ge(),o=fe(void 0),d=fe(null),{errors:c,warnings:u}=pe(()=>a.reduce((e,{logType:t})=>({errors:"danger"===t?e.errors+1:e.errors,warnings:"warning"===t?e.warnings+1:e.warnings}),{errors:0,warnings:0}),[a]),p=de(e=>{o.current={x:e.clientX,dragging:!1},e.currentTarget.setPointerCapture(e.pointerId)},[]),h=de(e=>{let t=o.current;!t||!t.dragging&&Math.abs(e.clientX-t.x)<5||(t.dragging=!0,s({from:t.x,x:e.clientX}))},[]),f=de(e=>{let t=d.current?.offsetParent?.getBoundingClientRect();o.current?.dragging&&t&&l(((e,t)=>e<t.left+t.width/2?"left":"right")(e.clientX,t)),s(void 0)},[l]),g=de(()=>{let e=!0===o.current?.dragging;o.current=void 0,e||(c>0?t("danger"):u>0?t("warning"):t())},[c,u,t]);/* @__PURE__ */
18
+ return be("div",{ref:d,className:m("absolute bottom-3 z-[1000000]","right"===r?"right-3":"left-3",e),style:n?{translate:`${String(n.x-n.from)}px 0`}:void 0,[i]:"",children:/* @__PURE__ */ye("button",{className:m("border-ui-line bg-ui-panel flex cursor-pointer touch-none items-center gap-2 rounded border px-2 py-1.5 text-[12px]/[16px]","text-ui-fg-muted hover:bg-ui-hover font-bold shadow-md transition-colors select-none","dark:border-ui-line-strong dark:bg-ui-panel dark:text-ui-fg-muted dark:hover:bg-ui-hover"),title:"Plitzi dev tools — drag to the other corner",onPointerDown:p,onPointerMove:h,onPointerUp:f,onClick:g,children:["Plitzi",c>0&&/* @__PURE__ */ye("span",{className:"flex items-center gap-1 text-red-600 dark:text-red-400",children:[/* @__PURE__ */be("i",{className:"fa-regular fa-circle-xmark text-[11px]"}),c]}),u>0&&/* @__PURE__ */ye("span",{className:"flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-triangle-exclamation text-[11px]"}),u]}),0===c&&0===u&&/* @__PURE__ */be("i",{className:"fa-solid fa-terminal text-ui-fg-subtle text-[11px]"})]})})},Ht=[{id:"all",label:"All",icon:"fa-solid fa-list"},{id:"live",label:"Running",icon:"fa-solid fa-circle-notch"},{id:"failed",label:"Failed",icon:"fa-solid fa-circle-exclamation"}],Kt=({filter:e,query:t,liveCount:a,runCount:r,onFilterChange:l,onQueryChange:i,onClear:n})=>{let s=de(e=>()=>l(e),[l]),o=de(e=>i(e.target.value),[i]);/* @__PURE__ */
19
+ return ye("div",{className:"border-ui-line bg-ui-panel flex shrink-0 items-center gap-2 border-b px-2 py-1.5",children:[
20
+ /* @__PURE__ */be("div",{className:"flex items-stretch gap-1",children:Ht.map(t=>{let r=e===t.id;/* @__PURE__ */
21
+ return ye("button",{onClick:s(t.id),"aria-pressed":r,className:m("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors",{"bg-violet-500 text-white":r,"text-ui-fg-muted hover:bg-ui-hover":!r}),children:[
22
+ /* @__PURE__ */be("i",{className:m(t.icon,"live"===t.id&&a>0&&"fa-spin")}),t.label,"live"===t.id&&a>0&&/* @__PURE__ */be("span",{className:"tabular-nums",children:a})]},t.id)})}),
23
+ /* @__PURE__ */be("input",{type:"search",value:t,onChange:o,placeholder:"Filter by action, step or run id",className:"border-ui-line bg-ui-raised text-ui-fg placeholder:text-ui-fg-subtle h-6 min-w-0 grow rounded border px-2 text-xs"}),
24
+ /* @__PURE__ */ye("span",{className:"text-ui-fg-subtle shrink-0 text-[10px] tabular-nums",children:[r," runs"]}),
25
+ /* @__PURE__ */ye("button",{onClick:n,className:"text-ui-fg-muted hover:bg-ui-hover flex h-6 shrink-0 items-center gap-1 rounded px-2 text-xs font-medium",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-trash"}),"Clear"]})]})},Qt=({storageKey:e,minWidth:t,maxWidth:a,defaultWidth:r,children:l})=>{let[i,n]=_(e,r),s=de(e=>{Number.isFinite(e)&&n(e)},[n]);/* @__PURE__ */
26
+ return be(I,{className:"border-ui-line shrink-0 border-l",resizeHandles:["w"],axis:"x",autoGrow:!1,width:i,minConstraintsX:t,maxConstraintsX:a,onChange:s,children:/* @__PURE__ */be("aside",{className:"bg-ui-panel flex h-full w-full flex-col gap-1.5 overflow-auto px-3 py-2 text-[10px]",children:l})})},_t=({children:e})=>/* @__PURE__ */be(Qt,{storageKey:"plitzi-sdk.dev-tools.actions.detail-width",minWidth:200,maxWidth:520,defaultWidth:280,children:e}),Xt={},Zt=/*#__PURE__*/ie(Xt),Gt=(e,t)=>ee({},e,t),Yt=/*#__PURE__*/ie(()=>{});function ea(){return ce(Yt)}Yt.displayName="JVR.DispatchShowTools";var ta=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
27
+ return be(Zt.Provider,{value:t,children:/*#__PURE__*/be(Yt.Provider,{value:a,children:r})})};ta.displayName="JVR.ShowTools";var aa={},ra=/*#__PURE__*/ie(aa),la=(e,t)=>ee({},e,t),ia=()=>ce(ra),na=/*#__PURE__*/ie(()=>{});na.displayName="JVR.DispatchExpands";var sa=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
28
+ return be(ra.Provider,{value:t,children:/*#__PURE__*/be(na.Provider,{value:a,children:r})})};sa.displayName="JVR.Expands";var oa={Str:{as:"span","data-type":"string",style:{color:"var(--w-rjv-type-string-color, #cb4b16)"},className:"w-rjv-type",children:"string"},Url:{as:"a",style:{color:"var(--w-rjv-type-url-color, #0969da)"},"data-type":"url",className:"w-rjv-type",children:"url"},Undefined:{style:{color:"var(--w-rjv-type-undefined-color, #586e75)"},as:"span","data-type":"undefined",className:"w-rjv-type",children:"undefined"},Null:{style:{color:"var(--w-rjv-type-null-color, #d33682)"},as:"span","data-type":"null",className:"w-rjv-type",children:"null"},Map:{style:{color:"var(--w-rjv-type-map-color, #268bd2)",marginRight:3},as:"span","data-type":"map",className:"w-rjv-type",children:"Map"},Nan:{style:{color:"var(--w-rjv-type-nan-color, #859900)"},as:"span","data-type":"nan",className:"w-rjv-type",children:"NaN"},Bigint:{style:{color:"var(--w-rjv-type-bigint-color, #268bd2)"},as:"span","data-type":"bigint",className:"w-rjv-type",children:"bigint"},Int:{style:{color:"var(--w-rjv-type-int-color, #268bd2)"},as:"span","data-type":"int",className:"w-rjv-type",children:"int"},Set:{style:{color:"var(--w-rjv-type-set-color, #268bd2)",marginRight:3},as:"span","data-type":"set",className:"w-rjv-type",children:"Set"},Float:{style:{color:"var(--w-rjv-type-float-color, #859900)"},as:"span","data-type":"float",className:"w-rjv-type",children:"float"},True:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},False:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},Date:{style:{color:"var(--w-rjv-type-date-color, #268bd2)"},as:"span","data-type":"date",className:"w-rjv-type",children:"date"}},da=/*#__PURE__*/ie(oa),ca=(e,t)=>ee({},e,t),ua=()=>ce(da),ma=/*#__PURE__*/ie(()=>{});function pa(e){var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
29
+ return be(da.Provider,{value:t,children:/*#__PURE__*/be(ma.Provider,{value:a,children:r})})}ma.displayName="JVR.DispatchTypes",pa.displayName="JVR.Types";var ha=["style"];function fa(e){var t=e.style,a=N(e,ha),r=ee({cursor:"pointer",height:"1em",width:"1em",userSelect:"none",display:"inline-flex"},t);/*#__PURE__*/
30
+ return be("svg",ee({viewBox:"0 0 24 24",fill:"var(--w-rjv-arrow-color, currentColor)",style:r},a,{children:/*#__PURE__*/be("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}))}fa.displayName="JVR.TriangleArrow";var ga={Arrow:{as:"span",className:"w-rjv-arrow",style:{transform:"rotate(0deg)",transition:"all 0.3s"},children:/*#__PURE__*/be(fa,{})},Colon:{as:"span",style:{color:"var(--w-rjv-colon-color, var(--w-rjv-color))",marginLeft:0,marginRight:2},className:"w-rjv-colon",children:":"},Quote:{as:"span",style:{color:"var(--w-rjv-quotes-color, #236a7c)"},className:"w-rjv-quotes",children:'"'},ValueQuote:{as:"span",style:{color:"var(--w-rjv-quotes-string-color, #cb4b16)"},className:"w-rjv-quotes",children:'"'},BracketsLeft:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-start",children:"["},BracketsRight:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-end",children:"]"},BraceLeft:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-start",children:"{"},BraceRight:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-end",children:"}"}},xa=/*#__PURE__*/ie(ga),va=(e,t)=>ee({},e,t),ba=()=>ce(xa),ya=/*#__PURE__*/ie(()=>{});ya.displayName="JVR.DispatchSymbols";var Na=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
31
+ return be(xa.Provider,{value:t,children:/*#__PURE__*/be(ya.Provider,{value:a,children:r})})};Na.displayName="JVR.Symbols";var wa={Copied:{className:"w-rjv-copied",style:{height:"1em",width:"1em",cursor:"pointer",verticalAlign:"middle",marginLeft:5}},CountInfo:{as:"span",className:"w-rjv-object-size",style:{color:"var(--w-rjv-info-color, #0000004d)",paddingLeft:8,fontStyle:"italic"}},CountInfoExtra:{as:"span",className:"w-rjv-object-extra",style:{paddingLeft:8}},Ellipsis:{as:"span",style:{cursor:"pointer",color:"var(--w-rjv-ellipsis-color, #cb4b16)",userSelect:"none"},className:"w-rjv-ellipsis",children:"..."},Row:{as:"div",className:"w-rjv-line"},KeyName:{as:"span",className:"w-rjv-object-key"}},ka=/*#__PURE__*/ie(wa),Sa=(e,t)=>ee({},e,t),Ca=()=>ce(ka),$a=/*#__PURE__*/ie(()=>{});$a.displayName="JVR.DispatchSection";var ja=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
32
+ return be(ka.Provider,{value:t,children:/*#__PURE__*/be($a.Provider,{value:a,children:r})})};ja.displayName="JVR.Section";var Ta={objectSortKeys:!1,indentWidth:15},Ia=/*#__PURE__*/ie(Ta);Ia.displayName="JVR.Context";var La=/*#__PURE__*/ie(()=>{});function Ea(e,t){return ee({},e,t)}La.displayName="JVR.DispatchContext";var Ra=()=>ce(Ia),Aa=e=>{var t=e.children,a=e.initialState,r=e.initialTypes,l=he(Ea,Object.assign({},Ta,a)),i=l[0],n=l[1],s=he(Gt,Xt),o=s[0],d=s[1],c=he(la,aa),u=c[0],m=c[1],p=he(ca,oa),h=p[0],f=p[1],g=he(va,ga),x=g[0],v=g[1],b=he(Sa,wa),y=b[0],N=b[1];return ue(()=>n(ee({},a)),[a]),/*#__PURE__*/be(Ia.Provider,{value:i,children:/*#__PURE__*/be(La.Provider,{value:n,children:/*#__PURE__*/be(ta,{initial:o,dispatch:d,children:/*#__PURE__*/be(sa,{initial:u,dispatch:m,children:/*#__PURE__*/be(pa,{initial:ee({},h,r),dispatch:f,children:/*#__PURE__*/be(Na,{initial:x,dispatch:v,children:/*#__PURE__*/be(ja,{initial:y,dispatch:N,children:t})})})})})})})};Aa.displayName="JVR.Provider";var Ma=["isNumber","value","parentValue","keyName","keys"],Va=["as","render"],za=["as","render"],Oa=["as","render"],Da=["as","style","render"],Fa=["as","render"],Ba=["as","render"],Ja=["as","render"],Pa=["as","render"],Wa=e=>{var t=ba().Quote,a=void 0===t?{}:t,r=e.isNumber,l=e.value,i=e.parentValue,n=e.keyName,s=e.keys,o=N(e,Ma);if(r)return null;var d=a.as,c=a.render,u=N(a,Va),m=d||"span",p=ee({},o,u);return"string"==typeof p.children&&(p.children=p.children.trim()||void 0),c&&"function"==typeof c&&c(p,{value:l,parentValue:i,keyName:n,keys:s||(n?[n]:[])})||/*#__PURE__*/be(m,ee({},p))};Wa.displayName="JVR.Quote";var qa=e=>{var t=ba().ValueQuote,a=void 0===t?{}:t,r=ee({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e)),l=a.as,i=a.render,n=N(a,za),s=l||"span",o=ee({},r,n);return i&&"function"==typeof i&&i(o,{})||/*#__PURE__*/be(s,ee({},o))};qa.displayName="JVR.ValueQuote";var Ua=e=>{var t=e.value,a=e.parentValue,r=e.keyName,l=e.keys,i=ba().Colon,n=void 0===i?{}:i,s=n.as,o=n.render,d=N(n,Oa),c=s||"span";return o&&"function"==typeof o&&o(d,{value:t,parentValue:a,keyName:r,keys:l||(r?[r]:[])})||/*#__PURE__*/be(c,ee({},d))};Ua.displayName="JVR.Colon";var Ha=e=>{var t=ba().Arrow,a=void 0===t?{}:t,r=ia(),l=e.expandKey,i=e.style,n=e.value,s=e.parentValue,o=e.keyName,d=e.keys,c=!!r[l],u=a.as,m=a.style,p=a.render,h=N(a,Da),f=u||"span",g=p&&"function"==typeof p,x=ee({},h,{"data-expanded":c,style:ee({},m,i)});return g&&p(x,{value:n,parentValue:s,keyName:o,keys:d||(o?[o]:[])})||/*#__PURE__*/be(f,ee({},h,{style:ee({},m,i)}))};Ha.displayName="JVR.Arrow";var Ka=e=>{var t=e.isBrackets,a=e.value,r=e.parentValue,l=e.keyName,i=e.keys,n=ba(),s=n.BracketsLeft,o=void 0===s?{}:s,d=n.BraceLeft,c=void 0===d?{}:d,u={value:a,parentValue:r,keyName:l,keys:i||(l?[l]:[])};if(t){var m=o.as,p=o.render,h=N(o,Fa),f=m||"span";return p&&"function"==typeof p&&p(h,u)||/*#__PURE__*/be(f,ee({},h))}var g=c.as,x=c.render,v=N(c,Ba),b=g||"span";return x&&"function"==typeof x&&x(v,u)||/*#__PURE__*/be(b,ee({},v))};Ka.displayName="JVR.BracketsOpen";var Qa=e=>{var t=e.isBrackets,a=e.isVisiable,r=e.value,l=e.parentValue,i=e.keyName,n={value:r,parentValue:l,keyName:i,keys:e.keys||(i?[i]:[])};if(!a)return null;var s=ba(),o=s.BracketsRight,d=void 0===o?{}:o,c=s.BraceRight,u=void 0===c?{}:c;if(t){var m=d.as,p=d.render,h=N(d,Ja),f=m||"span";return p&&"function"==typeof p&&p(h,n)||/*#__PURE__*/be(f,ee({},h))}var g=u.as,x=u.render,v=N(u,Pa),b=g||"span";return x&&"function"==typeof x&&x(v,n)||/*#__PURE__*/be(b,ee({},v))};Qa.displayName="JVR.BracketsClose";var _a=e=>{var t,a=e.keyName,r=e.value,l=e.expandKey,i=e.parentValue,n=e.level,s=e.keys,o=void 0===s?[]:s,d=ia(),c=Ra(),u=c.collapsed,m=c.shouldExpandNodeInitially,p="boolean"==typeof u?u:"number"==typeof u&&n>u,h=null!=(t=d[l])?t:!m&&p,f=m&&m(!h,{value:r,keys:o,level:n,keyName:a,parentValue:i});if(m&&!1===u){if(void 0===d[l]&&!f)return null}else if(void 0===d[l]&&f)return null;var g=Object.keys(r).length;if(h||0===g)return null;var x={keyName:a,value:r,keys:o,parentValue:i},v=Array.isArray(r),b=r instanceof Set;/*#__PURE__*/
33
+ return be("div",{style:{paddingLeft:4},children:/*#__PURE__*/be(Qa,ee({isBrackets:v||b},x,{isVisiable:!0}))})};_a.displayName="JVR.NestedClose";var Xa=["as","render"],Za=["as","render"],Ga=["as","render"],Ya=["as","render"],er=["as","render"],tr=["as","render"],ar=["as","render"],rr=["as","render"],lr=["as","render"],ir=["as","render"],nr=["as","render"],sr=["as","render"],or=["as","render"],dr=e=>{if(void 0===e)return"0n";if("string"==typeof e)try{e=BigInt(e)}catch(no){return"0n"}return e?e.toString()+"n":"0n"},cr=e=>{var t=e.value,a=e.keyName,r=ua(),l=r.Set,i=void 0===l?{}:l,n=r.displayDataTypes;if(!(t instanceof Set&&n))return null;var s=i.as,o=i.render,d=N(i,Xa);return o&&"function"==typeof o&&o(d,{type:"type",value:t,keyName:a})||/*#__PURE__*/be(s||"span",ee({},d))};cr.displayName="JVR.SetComp";var ur=e=>{var t=e.value,a=e.keyName,r=ua(),l=r.Map,i=void 0===l?{}:l,n=r.displayDataTypes;if(!(t instanceof Map&&n))return null;var s=i.as,o=i.render,d=N(i,Za);return o&&"function"==typeof o&&o(d,{type:"type",value:t,keyName:a})||/*#__PURE__*/be(s||"span",ee({},d))};ur.displayName="JVR.MapComp";var mr={opacity:.75,paddingRight:4},pr=e=>{var t=e.children,a=void 0===t?"":t,r=e.keyName,l=e.keys,i=ua(),n=i.Str,s=void 0===n?{}:n,o=i.displayDataTypes,d=Ra(),c=d.shortenTextAfterLength,u=void 0===c?30:c,m=d.stringEllipsis,p=void 0===m?"...":m,h=s.as,f=s.render,g=N(s,Ga),x=a,v=ge(u&&x.length>u),b=v[0],y=v[1];ue(()=>y(u&&x.length>u),[u]);var w=h||"span",k=ee({},mr,s.style||{});u>0&&(g.style=ee({},g.style,{cursor:x.length<=u?"initial":"pointer"}),x.length>u&&(g.onClick=()=>{y(!b)}));var S=b?""+x.slice(0,u)+p:x,C=f&&"function"==typeof f,$=C&&f(ee({},g,{style:k}),{type:"type",value:a,keyName:r,keys:l}),j=b?"w-rjv-value w-rjv-value-short":"w-rjv-value",T=C&&f(ee({},g,{children:S,className:j}),{type:"value",value:a,keyName:r,keys:l});/*#__PURE__*/
34
+ return ye(le,{children:[o&&($||/*#__PURE__*/be(w,ee({},g,{style:k}))),T||/*#__PURE__*/ye(le,{children:[
35
+ /*#__PURE__*/be(qa,{}),
36
+ /*#__PURE__*/be(w,ee({},g,{className:j,children:S})),
37
+ /*#__PURE__*/be(qa,{})]})]})};pr.displayName="JVR.TypeString";var hr=e=>{var t=e.children,a=e.keyName,r=e.keys,l=ua(),i=l.True,n=void 0===i?{}:i,s=l.displayDataTypes,o=n.as,d=n.render,c=N(n,Ya),u=o||"span",m=ee({},mr,n.style||{}),p=d&&"function"==typeof d,h=p&&d(ee({},c,{style:m}),{type:"type",value:t,keyName:a,keys:r}),f=p&&d(ee({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
38
+ return ye(le,{children:[s&&(h||/*#__PURE__*/be(u,ee({},c,{style:m}))),f||/*#__PURE__*/be(u,ee({},c,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};hr.displayName="JVR.TypeTrue";var fr=e=>{var t=e.children,a=e.keyName,r=e.keys,l=ua(),i=l.False,n=void 0===i?{}:i,s=l.displayDataTypes,o=n.as,d=n.render,c=N(n,er),u=o||"span",m=ee({},mr,n.style||{}),p=d&&"function"==typeof d,h=p&&d(ee({},c,{style:m}),{type:"type",value:t,keyName:a,keys:r}),f=p&&d(ee({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
39
+ return ye(le,{children:[s&&(h||/*#__PURE__*/be(u,ee({},c,{style:m}))),f||/*#__PURE__*/be(u,ee({},c,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};fr.displayName="JVR.TypeFalse";var gr=e=>{var t=e.children,a=e.keyName,r=e.keys,l=ua(),i=l.Float,n=void 0===i?{}:i,s=l.displayDataTypes,o=n.as,d=n.render,c=N(n,tr),u=o||"span",m=ee({},mr,n.style||{}),p=d&&"function"==typeof d,h=p&&d(ee({},c,{style:m}),{type:"type",value:t,keyName:a,keys:r}),f=p&&d(ee({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
40
+ return ye(le,{children:[s&&(h||/*#__PURE__*/be(u,ee({},c,{style:m}))),f||/*#__PURE__*/be(u,ee({},c,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};gr.displayName="JVR.TypeFloat";var xr=e=>{var t=e.children,a=e.keyName,r=e.keys,l=ua(),i=l.Int,n=void 0===i?{}:i,s=l.displayDataTypes,o=n.as,d=n.render,c=N(n,ar),u=o||"span",m=ee({},mr,n.style||{}),p=d&&"function"==typeof d,h=p&&d(ee({},c,{style:m}),{type:"type",value:t,keyName:a,keys:r}),f=p&&d(ee({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
41
+ return ye(le,{children:[s&&(h||/*#__PURE__*/be(u,ee({},c,{style:m}))),f||/*#__PURE__*/be(u,ee({},c,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};xr.displayName="JVR.TypeInt";var vr=e=>{var t=e.children,a=e.keyName,r=e.keys,l=ua(),i=l.Bigint,n=void 0===i?{}:i,s=l.displayDataTypes,o=n.as,d=n.render,c=N(n,rr),u=o||"span",m=ee({},mr,n.style||{}),p=d&&"function"==typeof d,h=p&&d(ee({},c,{style:m}),{type:"type",value:t,keyName:a,keys:r}),f=p&&d(ee({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
42
+ return ye(le,{children:[s&&(h||/*#__PURE__*/be(u,ee({},c,{style:m}))),f||/*#__PURE__*/be(u,ee({},c,{className:"w-rjv-value",children:dr(null==t?void 0:t.toString())}))]})};vr.displayName="JVR.TypeFloat";var br=e=>{var t=e.children,a=e.keyName,r=e.keys,l=ua(),i=l.Url,n=void 0===i?{}:i,s=l.displayDataTypes,o=n.as,d=n.render,c=N(n,lr),u=o||"span",m=ee({},mr,n.style),p=d&&"function"==typeof d,h=p&&d(ee({},c,{style:m}),{type:"type",value:t,keyName:a,keys:r}),f=p&&d(ee({},c,{children:null==t?void 0:t.href,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
43
+ return ye(le,{children:[s&&(h||/*#__PURE__*/be(u,ee({},c,{style:m}))),f||/*#__PURE__*/ye("a",ee({href:null==t?void 0:t.href,target:"_blank"},c,{className:"w-rjv-value",children:[
44
+ /*#__PURE__*/be(qa,{}),null==t?void 0:t.href,
45
+ /*#__PURE__*/be(qa,{})]}))]})};br.displayName="JVR.TypeUrl";var yr=e=>{var t=e.children,a=e.keyName,r=e.keys,l=ua(),i=l.Date,n=void 0===i?{}:i,s=l.displayDataTypes,o=n.as,d=n.render,c=N(n,ir),u=o||"span",m=ee({},mr,n.style||{}),p=d&&"function"==typeof d,h=p&&d(ee({},c,{style:m}),{type:"type",value:t,keyName:a,keys:r}),f=t instanceof Date?t.toLocaleString():t,g=p&&d(ee({},c,{children:f,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
46
+ return ye(le,{children:[s&&(h||/*#__PURE__*/be(u,ee({},c,{style:m}))),g||/*#__PURE__*/be(u,ee({},c,{className:"w-rjv-value",children:f}))]})};yr.displayName="JVR.TypeDate";var Nr=e=>{var t=e.children,a=e.keyName,r=e.keys,l=ua(),i=l.Undefined,n=void 0===i?{}:i,s=l.displayDataTypes,o=n.as,d=n.render,c=N(n,nr),u=o||"span",m=ee({},mr,n.style||{}),p=d&&"function"==typeof d,h=p&&d(ee({},c,{style:m}),{type:"type",value:t,keyName:a,keys:r}),f=p&&d(ee({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
47
+ return ye(le,{children:[s&&(h||/*#__PURE__*/be(u,ee({},c,{style:m}))),f||/*#__PURE__*/be(u,ee({},c,{className:"w-rjv-value",children:"undefined"}))]})};Nr.displayName="JVR.TypeUndefined";var wr=e=>{var t=e.children,a=e.keyName,r=e.keys,l=ua(),i=l.Null,n=void 0===i?{}:i,s=l.displayDataTypes,o=n.as,d=n.render,c=N(n,sr),u=o||"span",m=ee({},mr,n.style||{}),p=d&&"function"==typeof d,h=p&&d(ee({},c,{style:m}),{type:"type",value:t,keyName:a,keys:r}),f=p&&d(ee({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
48
+ return ye(le,{children:[s&&(h||/*#__PURE__*/be(u,ee({},c,{style:m}))),f||/*#__PURE__*/be(u,ee({},c,{className:"w-rjv-value",children:"null"}))]})};wr.displayName="JVR.TypeNull";var kr=e=>{var t=e.children,a=e.keyName,r=e.keys,l=ua(),i=l.Nan,n=void 0===i?{}:i,s=l.displayDataTypes,o=n.as,d=n.render,c=N(n,or),u=o||"span",m=ee({},mr,n.style||{}),p=d&&"function"==typeof d,h=p&&d(ee({},c,{style:m}),{type:"type",value:t,keyName:a,keys:r}),f=p&&d(ee({},c,{children:null==t?void 0:t.toString(),className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
49
+ return ye(le,{children:[s&&(h||/*#__PURE__*/be(u,ee({},c,{style:m}))),f||/*#__PURE__*/be(u,ee({},c,{className:"w-rjv-value",children:"NaN"}))]})};kr.displayName="JVR.TypeNan";var Sr=e=>{var t=e.value,a={keyName:e.keyName,keys:e.keys};return t instanceof URL?/*#__PURE__*/be(br,ee({},a,{children:t})):"string"==typeof t?/*#__PURE__*/be(pr,ee({},a,{children:t})):!0===t?/*#__PURE__*/be(hr,ee({},a,{children:t})):!1===t?/*#__PURE__*/be(fr,ee({},a,{children:t})):null===t?/*#__PURE__*/be(wr,ee({},a,{children:t})):void 0===t?/*#__PURE__*/be(Nr,ee({},a,{children:t})):t instanceof Date?/*#__PURE__*/be(yr,ee({},a,{children:t})):"number"==typeof t&&isNaN(t)?/*#__PURE__*/be(kr,ee({},a,{children:t})):"number"==typeof t&&(e=>Number(e)===e&&e%1!=0||isNaN(e))(t)?/*#__PURE__*/be(gr,ee({},a,{children:t})):"bigint"==typeof t?/*#__PURE__*/be(vr,ee({},a,{children:t})):"number"==typeof t?/*#__PURE__*/be(xr,ee({},a,{children:t})):null};function Cr(e,t,a){var r=ce(ya),l=[e.className,t.className].filter(Boolean).join(" "),i=ee({},e,t,{className:l,style:ee({},e.style,t.style),children:t.children||e.children});ue(()=>r({[a]:i}),[t])}function $r(e,t,a){var r=ce(ma),l=[e.className,t.className].filter(Boolean).join(" "),i=ee({},e,t,{className:l,style:ee({},e.style,t.style),children:t.children||e.children});ue(()=>r({[a]:i}),[t])}function jr(e,t,a){var r=ce($a),l=[e.className,t.className].filter(Boolean).join(" "),i=ee({},e,t,{className:l,style:ee({},e.style,t.style),children:t.children||e.children});ue(()=>r({[a]:i}),[t])}Sr.displayName="JVR.Value";var Tr=["as","render"],Ir=e=>{var t=Ca().KeyName;return jr(void 0===t?{}:t,e,"KeyName"),null};Ir.displayName="JVR.KeyName";var Lr=e=>{var t=e.children,a=e.value,r=e.parentValue,l=e.keyName,i=e.keys,n={color:"number"==typeof t?"var(--w-rjv-key-number, #268bd2)":"var(--w-rjv-key-string, #002b36)"},s=Ca().KeyName,o=void 0===s?{}:s,d=o.as,c=o.render,u=N(o,Tr);u.style=ee({},u.style,n);var m=d||"span";return c&&"function"==typeof c&&c(ee({},u,{children:t}),{value:a,parentValue:r,keyName:l,keys:i||(l?[l]:[])})||/*#__PURE__*/be(m,ee({},u,{children:t}))};Lr.displayName="JVR.KeyNameComp";var Er=["children","value","parentValue","keyName","keys"],Rr=["as","render","children"],Ar=e=>{var t=Ca().Row;return jr(void 0===t?{}:t,e,"Row"),null};Ar.displayName="JVR.Row";var Mr=e=>{var t=e.children,a=e.value,r=e.parentValue,l=e.keyName,i=e.keys,n=N(e,Er),s=Ca().Row,o=void 0===s?{}:s,d=o.as,c=o.render;o.children;var u=N(o,Rr),m=d||"div";return c&&"function"==typeof c&&c(ee({},n,u,{children:t}),{value:a,keyName:l,parentValue:r,keys:i})||/*#__PURE__*/be(m,ee({},n,u,{children:t}))};Mr.displayName="JVR.RowComp";var Vr=["keyName","value","parentValue","expandKey","keys","beforeCopy"],zr=["as","render"],Or=e=>{var t=e.keyName,a=e.value,r=e.parentValue,l=e.expandKey,i=e.keys,n=e.beforeCopy,s=N(e,Vr),o=Ra(),d=o.onCopied,c=o.enableClipboard,u=o.beforeCopy,m=ce(Zt)[l],p=ge(!1),h=p[0],f=p[1],g=Ca().Copied,x=void 0===g?{}:g,v=null==x?void 0:x.beforeCopy;if(!1===c||!m)return null;var b={style:{display:"inline-flex"},fill:h?"var(--w-rjv-copied-success-color, #28a745)":"var(--w-rjv-copied-color, currentColor)",onClick:e=>{e.stopPropagation();var s="";s="number"==typeof a&&a===1/0?"Infinity":"number"==typeof a&&isNaN(a)?"NaN":"bigint"==typeof a?dr(a):a instanceof Date?a.toLocaleString():JSON.stringify(a,(e,t)=>"bigint"==typeof t?dr(t):t,2);var o=n||v||u;o&&"function"==typeof o&&(s=o(s,t,a,r,l,i)),d&&d(s,a),f(!0),(navigator.clipboard||{writeText:e=>new Promise((t,a)=>{var r=document.createElement("textarea");r.style.position="absolute",r.style.opacity="0",r.style.left="-99999999px",r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy")?t():a(),r.remove()})}).writeText(s).then(()=>{var e=setTimeout(()=>{f(!1),clearTimeout(e)},3e3)}).catch(e=>{})}};x.as;var y=x.render,w=N(x,zr),k=ee({},w,s,b,{style:ee({},w.style,s.style,b.style)});return y&&"function"==typeof y&&y(ee({},k,{"data-copied":h}),{value:a,keyName:t,keys:i,parentValue:r})||/*#__PURE__*/be("svg",ee({viewBox:"0 0 32 36"},k,h?{children:/*#__PURE__*/be("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})}:{children:/*#__PURE__*/be("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})}))};function Dr(){var e=fe(null);return null===e.current&&(e.current="custom-id-"+Math.random().toString(36).substr(2,9)),e.current}Or.displayName="JVR.Copied";var Fr=e=>{var t,a=e.keyName,r=e.value,l=e.expandKey,i=void 0===l?"":l,n=e.level,s=e.keys,o=void 0===s?[]:s,d=e.parentValue,c=ia(),u=Ra(),m=u.objectSortKeys,p=u.indentWidth,h=u.collapsed,f=u.shouldExpandNodeInitially,g="boolean"==typeof h?h:"number"==typeof h&&n>h,x=null!=(t=c[i])?t:!f&&g,v=f&&f(!x,{value:r,keys:o,level:n,keyName:a,parentValue:d});if(f&&!1===h){if(void 0===c[i]&&!v)return null}else if(void 0===c[i]&&v)return null;if(x)return null;var b=Array.isArray(r)?Object.entries(r).map(e=>[Number(e[0]),e[1]]):Object.entries(r);return m&&(b=!0===m?b.sort((e,t)=>{var a=e[0],r=t[0];return"string"==typeof a&&"string"==typeof r?a.localeCompare(r):0}):b.sort((e,t)=>{var a=e[0],r=e[1],l=t[0],i=t[1];return"string"==typeof a&&"string"==typeof l?m(a,l,r,i):0})),/*#__PURE__*/be("div",{className:"w-rjv-wrap",style:{borderLeft:"var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)",paddingLeft:p,marginLeft:6},children:b.map((e,t)=>{var a=e[0],l=e[1];/*#__PURE__*/
50
+ return be(Jr,{parentValue:r,keyName:a,keys:[...o,a],value:l,level:n},t)})})};Fr.displayName="JVR.KeyValues";var Br=e=>{var t=e.keyName,a=e.parentValue,r=e.keys,l=e.value,i=Ra().highlightUpdates,n="number"==typeof t,s=fe(null);!function(e){var t=e.value,a=e.highlightUpdates,r=e.highlightContainer,l=function(e){var t=fe();return ue(()=>{t.current=e}),t.current}(t),i=pe(()=>!(!a||void 0===l)&&(typeof t!=typeof l||("number"==typeof t?!(isNaN(t)&&isNaN(l)||t===l):Array.isArray(t)!==Array.isArray(l)||"object"!=typeof t&&"function"!=typeof t&&(t!==l||void 0))),[a,t]);ue(()=>{r&&r.current&&i&&"animate"in r.current&&r.current.animate([{backgroundColor:"var(--w-rjv-update-color, #ebcb8b)"},{backgroundColor:""}],{duration:1e3,easing:"ease-in"})},[i,t,r])}({value:l,highlightUpdates:i,highlightContainer:s});var o={keyName:t,value:l,keys:r,parentValue:a};/*#__PURE__*/
51
+ return ye(le,{children:[/*#__PURE__*/ye("span",{ref:s,children:[
52
+ /*#__PURE__*/be(Wa,ee({isNumber:n,"data-placement":"left"},o)),
53
+ /*#__PURE__*/be(Lr,ee({},o,{children:t})),
54
+ /*#__PURE__*/be(Wa,ee({isNumber:n,"data-placement":"right"},o))]}),/*#__PURE__*/be(Ua,ee({},o))]})};Br.displayName="JVR.KayName";var Jr=e=>{var t=e.keyName,a=e.value,r=e.parentValue,l=e.level,i=void 0===l?0:l,n=e.keys,s=void 0===n?[]:n,o=ea(),d=Dr(),c=Array.isArray(a),u=a instanceof Set,m=a instanceof Map,p=a instanceof Date,h=a instanceof URL;if(a&&"object"==typeof a&&!c&&!u&&!m&&!p&&!h||c||u||m){var f=u?Array.from(a):m?Object.fromEntries(a):a;/*#__PURE__*/
55
+ return be(tl,{keyName:t,value:f,parentValue:r,initialValue:a,keys:s,level:i+1})}/*#__PURE__*/
56
+ return ye(Mr,ee({className:"w-rjv-line",value:a,keyName:t,keys:s,parentValue:r},{onMouseEnter:()=>o({[d]:!0}),onMouseLeave:()=>o({[d]:!1})},{children:[
57
+ /*#__PURE__*/be(Br,{keyName:t,value:a,keys:s,parentValue:r}),
58
+ /*#__PURE__*/be(Sr,{keyName:t,value:a,keys:s}),
59
+ /*#__PURE__*/be(Or,{keyName:t,value:a,keys:s,parentValue:r,expandKey:d})]}))};Jr.displayName="JVR.KeyValuesItem";var Pr=["value","keyName"],Wr=["as","render"],qr=e=>{var t=Ca().CountInfoExtra;return jr(void 0===t?{}:t,e,"CountInfoExtra"),null};qr.displayName="JVR.CountInfoExtra";var Ur=e=>{var t=e.value,a=void 0===t?{}:t,r=e.keyName,l=N(e,Pr),i=Ca().CountInfoExtra,n=void 0===i?{}:i,s=n.as,o=n.render,d=N(n,Wr);if(!o&&!d.children)return null;var c=s||"span",u=o&&"function"==typeof o,m=ee({},d,l);return u&&o(m,{value:a,keyName:r})||/*#__PURE__*/be(c,ee({},m))};Ur.displayName="JVR.CountInfoExtraComps";var Hr=["value","keyName"],Kr=["as","render"],Qr=e=>{var t=Ca().CountInfo;return jr(void 0===t?{}:t,e,"CountInfo"),null};Qr.displayName="JVR.CountInfo";var _r=e=>{var t=e.value,a=void 0===t?{}:t,r=e.keyName,l=N(e,Hr),i=Ra().displayObjectSize,n=Ca().CountInfo,s=void 0===n?{}:n;if(!i)return null;var o=s.as,d=s.render,c=N(s,Kr),u=o||"span";c.style=ee({},c.style,e.style);var m=Object.keys(a).length;c.children||(c.children=m+" item"+(1===m?"":"s"));var p=ee({},c,l);return d&&"function"==typeof d&&d(ee({},p,{"data-length":m}),{value:a,keyName:r})||/*#__PURE__*/be(u,ee({},p))};_r.displayName="JVR.CountInfoComp";var Xr=["as","render"],Zr=e=>{var t=Ca().Ellipsis;return jr(void 0===t?{}:t,e,"Ellipsis"),null};Zr.displayName="JVR.Ellipsis";var Gr=e=>{var t=e.isExpanded,a=e.value,r=e.keyName,l=Ca().Ellipsis,i=void 0===l?{}:l,n=i.as,s=i.render,o=N(i,Xr),d=n||"span";return s&&"function"==typeof s&&s(ee({},o,{"data-expanded":t}),{value:a,keyName:r})||(!t||"object"==typeof a&&0==Object.keys(a).length?null:/*#__PURE__*/be(d,ee({},o)))};Gr.displayName="JVR.EllipsisComp";var Yr=e=>{var t,a=e.keyName,r=e.expandKey,l=e.keys,i=void 0===l?[]:l,n=e.initialValue,s=e.value,o=e.parentValue,d=e.level,c=ia(),u=ce(na),m=Ra(),p=m.onExpand,h=m.collapsed,f=m.shouldExpandNodeInitially,g="boolean"==typeof h?h:"number"==typeof h&&d>h,x=null!=(t=c[r])?t:!f&&g,v=f&&f(!x,{value:s,keys:i,level:d,keyName:a,parentValue:o});void 0===c[r]&&f&&(x=!v);var b={transform:"rotate("+(x?"-90":"0")+"deg)",transition:"all 0.3s"},y=Object.keys(s).length,N="object"==typeof s,w=Array.isArray(s),k=s instanceof Set,S=0!==y&&(w||k||N),C={style:{display:"inline-flex",alignItems:"center"}};S&&(C.onClick=()=>{var e={expand:!x,value:s,keyid:r,keyName:a};p&&p(e),u({[r]:e.expand})});var $={keyName:a,value:s,keys:i,parentValue:o};/*#__PURE__*/
60
+ return ye("span",ee({},C,{children:[S&&/*#__PURE__*/be(Ha,ee({style:b,expandKey:r},$)),(a||"number"==typeof a)&&/*#__PURE__*/be(Br,ee({},$)),
61
+ /*#__PURE__*/be(cr,{value:n,keyName:a}),
62
+ /*#__PURE__*/be(ur,{value:n,keyName:a}),
63
+ /*#__PURE__*/be(Ka,ee({isBrackets:w||k},$)),
64
+ /*#__PURE__*/be(Gr,{keyName:a,value:s,isExpanded:x}),
65
+ /*#__PURE__*/be(Qa,ee({isVisiable:x||!S,isBrackets:w||k},$)),
66
+ /*#__PURE__*/be(_r,{value:s,keyName:a}),
67
+ /*#__PURE__*/be(Ur,{value:s,keyName:a}),
68
+ /*#__PURE__*/be(Or,{keyName:a,value:s,expandKey:r,parentValue:o,keys:i})]}))};Yr.displayName="JVR.NestedOpen";var el=["className","children","parentValue","keyid","level","value","initialValue","keys","keyName"],tl=/*#__PURE__*/ne((e,t)=>{var a=e.className,r=void 0===a?"":a;e.children;var l=e.parentValue;e.keyid;var i=e.level,n=void 0===i?1:i,s=e.value,o=e.initialValue,d=e.keys,c=e.keyName,u=N(e,el),m=ea(),p=Dr(),h=[r,"w-rjv-inner"].filter(Boolean).join(" ");/*#__PURE__*/
69
+ return ye("div",ee({className:h,ref:t},u,{onMouseEnter:()=>m({[p]:!0}),onMouseLeave:()=>m({[p]:!1})},{children:[
70
+ /*#__PURE__*/be(Yr,{expandKey:p,value:s,level:n,keys:d,parentValue:l,keyName:c,initialValue:o}),
71
+ /*#__PURE__*/be(Fr,{expandKey:p,value:s,level:n,keys:d,parentValue:l,keyName:c}),
72
+ /*#__PURE__*/be(_a,{expandKey:p,value:s,level:n,keys:d,parentValue:l,keyName:c})]}))});tl.displayName="JVR.Container";var al=e=>{var t=ba().BraceLeft;return Cr(void 0===t?{}:t,e,"BraceLeft"),null};al.displayName="JVR.BraceLeft";var rl=e=>{var t=ba().BraceRight;return Cr(void 0===t?{}:t,e,"BraceRight"),null};rl.displayName="JVR.BraceRight";var ll=e=>{var t=ba().BracketsLeft;return Cr(void 0===t?{}:t,e,"BracketsLeft"),null};ll.displayName="JVR.BracketsLeft";var il=e=>{var t=ba().BracketsRight;return Cr(void 0===t?{}:t,e,"BracketsRight"),null};il.displayName="JVR.BracketsRight";var nl=e=>{var t=ba().Arrow;return Cr(void 0===t?{}:t,e,"Arrow"),null};nl.displayName="JVR.Arrow";var sl=e=>{var t=ba().Colon;return Cr(void 0===t?{}:t,e,"Colon"),null};sl.displayName="JVR.Colon";var ol=e=>{var t=ba().Quote;return Cr(void 0===t?{}:t,e,"Quote"),null};ol.displayName="JVR.Quote";var dl=e=>{var t=ba().ValueQuote;return Cr(void 0===t?{}:t,e,"ValueQuote"),null};dl.displayName="JVR.ValueQuote";var cl=e=>{var t=ua().Bigint;return $r(void 0===t?{}:t,e,"Bigint"),null};cl.displayName="JVR.Bigint";var ul=e=>{var t=ua().Date;return $r(void 0===t?{}:t,e,"Date"),null};ul.displayName="JVR.Date";var ml=e=>{var t=ua().False;return $r(void 0===t?{}:t,e,"False"),null};ml.displayName="JVR.False";var pl=e=>{var t=ua().Float;return $r(void 0===t?{}:t,e,"Float"),null};pl.displayName="JVR.Float";var hl=e=>{var t=ua().Int;return $r(void 0===t?{}:t,e,"Int"),null};hl.displayName="JVR.Int";var fl=e=>{var t=ua().Map;return $r(void 0===t?{}:t,e,"Map"),null};fl.displayName="JVR.Map";var gl=e=>{var t=ua().Nan;return $r(void 0===t?{}:t,e,"Nan"),null};gl.displayName="JVR.Nan";var xl=e=>{var t=ua().Null;return $r(void 0===t?{}:t,e,"Null"),null};xl.displayName="JVR.Null";var vl=e=>{var t=ua().Set;return $r(void 0===t?{}:t,e,"Set"),null};vl.displayName="JVR.Set";var bl=e=>{var t=ua().Str;return $r(void 0===t?{}:t,e,"Str"),null};bl.displayName="JVR.StringText";var yl=e=>{var t=ua().True;return $r(void 0===t?{}:t,e,"True"),null};yl.displayName="JVR.True";var Nl=e=>{var t=ua().Undefined;return $r(void 0===t?{}:t,e,"Undefined"),null};Nl.displayName="JVR.Undefined";var wl=e=>{var t=ua().Url;return $r(void 0===t?{}:t,e,"Url"),null};wl.displayName="JVR.Url";var kl=e=>{var t=Ca().Copied;return jr(void 0===t?{}:t,e,"Copied"),null};kl.displayName="JVR.Copied";var Sl=["className","style","value","children","collapsed","shouldExpandNodeInitially","indentWidth","displayObjectSize","shortenTextAfterLength","stringEllipsis","highlightUpdates","enableClipboard","displayDataTypes","objectSortKeys","onExpand","onCopied","beforeCopy"],Cl=/*#__PURE__*/ne((e,t)=>{var a=e.className,r=void 0===a?"":a,l=e.style,i=e.value,n=e.children,s=e.collapsed,o=void 0!==s&&s,d=e.shouldExpandNodeInitially,c=e.indentWidth,u=void 0===c?15:c,m=e.displayObjectSize,p=void 0===m||m,h=e.shortenTextAfterLength,f=void 0===h?30:h,g=e.stringEllipsis,x=e.highlightUpdates,v=void 0===x||x,b=e.enableClipboard,y=void 0===b||b,w=e.displayDataTypes,k=void 0===w||w,S=e.objectSortKeys,C=void 0!==S&&S,$=e.onExpand,j=e.onCopied,T=e.beforeCopy,I=N(e,Sl),L=ee({lineHeight:1.4,fontFamily:"var(--w-rjv-font-family, Menlo, monospace)",color:"var(--w-rjv-color, #002b36)",backgroundColor:"var(--w-rjv-background-color, #00000000)",fontSize:13},l),E=["w-json-view-container","w-rjv",r].filter(Boolean).join(" ");/*#__PURE__*/
73
+ return ye(Aa,{initialState:{value:i,objectSortKeys:C,indentWidth:u,shouldExpandNodeInitially:!1===o?d:void 0,displayObjectSize:p,collapsed:o,enableClipboard:y,shortenTextAfterLength:f,stringEllipsis:g,highlightUpdates:v,onCopied:j,onExpand:$,beforeCopy:T},initialTypes:{displayDataTypes:k},children:[/*#__PURE__*/be(tl,ee({value:i},I,{ref:t,className:E,style:L})),n]})});Cl.Bigint=cl,Cl.Date=ul,Cl.False=ml,Cl.Float=pl,Cl.Int=hl,Cl.Map=fl,Cl.Nan=gl,Cl.Null=xl,Cl.Set=vl,Cl.String=bl,Cl.True=yl,Cl.Undefined=Nl,Cl.Url=wl,Cl.ValueQuote=dl,Cl.Arrow=nl,Cl.Colon=sl,Cl.Quote=ol,Cl.Ellipsis=Zr,Cl.BraceLeft=al,Cl.BraceRight=rl,Cl.BracketsLeft=ll,Cl.BracketsRight=il,Cl.Copied=kl,Cl.CountInfo=Qr,Cl.CountInfoExtra=qr,Cl.KeyName=Ir,Cl.Row=Ar,Cl.displayName="JVR.JsonView";var $l,jl={"--w-rjv-font-family":"monospace","--w-rjv-color":"#9cdcfe","--w-rjv-key-string":"#9cdcfe","--w-rjv-background-color":"#1e1e1e","--w-rjv-line-color":"#36334280","--w-rjv-arrow-color":"#838383","--w-rjv-edit-color":"var(--w-rjv-color)","--w-rjv-info-color":"#9c9c9c7a","--w-rjv-update-color":"#9cdcfe","--w-rjv-copied-color":"#9cdcfe","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#d4d4d4","--w-rjv-colon-color":"#d4d4d4","--w-rjv-brackets-color":"#d4d4d4","--w-rjv-quotes-color":"var(--w-rjv-key-string)","--w-rjv-quotes-string-color":"var(--w-rjv-type-string-color)","--w-rjv-type-string-color":"#ce9178","--w-rjv-type-int-color":"#b5cea8","--w-rjv-type-float-color":"#b5cea8","--w-rjv-type-bigint-color":"#b5cea8","--w-rjv-type-boolean-color":"#569cd6","--w-rjv-type-date-color":"#b5cea8","--w-rjv-type-url-color":"#3b89cf","--w-rjv-type-null-color":"#569cd6","--w-rjv-type-nan-color":"#859900","--w-rjv-type-undefined-color":"#569cd6"},Tl={...jl,width:"100%",overflow:"auto",padding:"6px",fontSize:"11px"},Il=({value:e})=>{let{resolvedTheme:t}=E();return"object"==typeof e&&e?/* @__PURE__ */be(Cl,{value:e,style:"dark"===t?Tl:void 0,enableClipboard:!1,displayDataTypes:!1,collapsed:2}):/* @__PURE__ */be("pre",{className:"text-ui-fg-muted overflow-auto p-1.5 font-mono text-[11px] break-words whitespace-pre-wrap",children:JSON.stringify(e)})},Ll=e=>void 0===e.endedAt,El=e=>void 0===e.endedAt?void 0:e.endedAt-e.startedAt,Rl=e=>e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`,Al=e=>new Date(e).toLocaleTimeString(),Ml={running:"info",streaming:"info",accepted:"info",completed:"success",failed:"danger",aborted:"warning",skipped:"custom"},Vl=e=>Ml[e]??"custom",zl={success:"success",failed:"danger",skipped:"custom",disabled:"custom"},Ol=e=>zl[e],Dl={success:"fa-solid fa-check",failed:"fa-solid fa-xmark",skipped:"fa-solid fa-forward",disabled:"fa-solid fa-ban"},Fl={success:"bg-emerald-500/70",failed:"bg-red-500/80",skipped:"bg-ui-line-strong/40",disabled:"bg-ui-line-strong/30"},Bl={await:"await",detached:"detached",stream:"stream",render:"render"},Jl={await:"fa-solid fa-right-left",detached:"fa-solid fa-paper-plane",stream:"fa-solid fa-wave-square",render:"fa-solid fa-server"},Pl=e=>`${e} ${1===e?"step":"steps"}`,Wl=e=>e?.find(e=>"failed"===e.status),ql=({className:e,logType:t="info",iconClassName:a,title:r,children:l})=>{let i="danger"===t?"fa-regular fa-circle-xmark":"warning"===t?"fa-solid fa-triangle-exclamation":"info"===t?"fa-solid fa-circle-info":"success"===t?"fa-solid fa-check":"fa-solid fa-circle";/* @__PURE__ */
74
+ return ye("div",{className:m("flex items-center gap-1",e),title:r,children:[/* @__PURE__ */be("i",{className:m(a??i,{"text-red-500 dark:text-red-400":"danger"===t,"text-amber-500 dark:text-amber-400":"warning"===t,"text-violet-500 dark:text-violet-400":"info"===t,"text-emerald-500 dark:text-emerald-400":"success"===t,"text-ui-fg-subtle":!["danger","warning","info","success"].includes(t)},"text-xs")}),l]})},Ul=({bar:e,selected:t,onSelect:a})=>{let{step:r,offset:l,width:i}=e,n=de(()=>a(r.id),[a,r.id]);/* @__PURE__ */
75
+ return ye("button",{type:"button",onClick:n,"aria-pressed":t,className:m("flex w-full flex-col gap-1 rounded px-1.5 py-1 text-left transition-colors",{"bg-violet-500/10":t,"hover:bg-ui-hover":!t}),children:[
76
+ /* @__PURE__ */ye("div",{className:"flex items-center gap-1.5 text-[11px]",children:[
77
+ /* @__PURE__ */be(ql,{logType:Ol(r.status),iconClassName:Dl[r.status]}),
78
+ /* @__PURE__ */be("span",{className:"text-ui-fg truncate font-medium",children:r.title}),
79
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle truncate font-mono text-[10px]",children:r.action}),
80
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle ml-auto shrink-0 tabular-nums",children:Rl(r.endTime-r.startTime)})]}),
81
+ /* @__PURE__ */be("div",{className:"bg-ui-raised h-1 w-full rounded-full",children:/* @__PURE__ */be("div",{className:m("h-1 rounded-full",Fl[r.status]),style:{marginLeft:100*l+"%",width:100*i+"%"}})}),void 0!==r.error&&/* @__PURE__ */be("span",{className:"text-[10px] break-words text-red-600 dark:text-red-400",children:r.error})]})},Hl=({steps:e,selectedStepId:t,onSelectStep:a})=>{let r=pe(()=>(e=>{if(0===e.length)return[];let t=Math.min(...e.map(e=>e.startTime)),a=Math.max(...e.map(e=>e.endTime))-t;return e.map(e=>a<=0?{step:e,offset:0,width:1}:{step:e,offset:(e.startTime-t)/a,width:Math.max((e.endTime-e.startTime)/a,.02)})})(e),[e]),l=r.filter(e=>"flow"===e.step.phase),i=r.filter(e=>"undo"===e.step.phase);/* @__PURE__ */
82
+ return ye("div",{className:"flex flex-col gap-0.5",children:[l.map(e=>/* @__PURE__ */be(Ul,{bar:e,selected:e.step.id===t,onSelect:a},e.step.id)),i.length>0&&/* @__PURE__ */ye("div",{className:"mt-2 flex items-center gap-1.5 px-1.5 text-[10px] font-medium tracking-wide text-amber-600 uppercase dark:text-amber-400",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-rotate-left"}),"Compensation"]}),i.map(e=>/* @__PURE__ */be(Ul,{bar:e,selected:e.step.id===t,onSelect:a},e.step.id))]})},Kl={info:"bg-violet-500/15 text-violet-600 dark:text-violet-400",success:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",danger:"bg-red-500/15 text-red-600 dark:text-red-400",warning:"bg-amber-500/15 text-amber-600 dark:text-amber-400",custom:"bg-zinc-500/15 text-ui-fg-subtle"},Ql=({run:e,selectedStepId:t,onSelectStep:a})=>{let r=Wl(e.steps),l=El(e),i=pe(()=>void 0===t?void 0:((e,t)=>e?.find(e=>(e=>{let{node:t}=e;if("object"!=typeof t||!t||!("id"in t))return;let{id:a}=t;return"string"==typeof a?a:void 0})(e)===t)?.result)(e.trace,t),[e.trace,t]);/* @__PURE__ */
83
+ return ye(ve,{children:[
84
+ /* @__PURE__ */ye("div",{className:"flex items-center gap-1.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg truncate text-xs font-medium",children:e.actionId||"(no action named)"}),/* @__PURE__ */be("span",{className:m("shrink-0 rounded px-1 py-0.5 text-[9px]",Kl[Vl(e.status)]),children:e.reason??e.status})]}),void 0!==e.error&&/* @__PURE__ */ye("div",{className:"mt-1 flex flex-col gap-1 rounded border border-red-200 bg-red-50 px-2 py-1.5 dark:border-red-500/30 dark:bg-red-500/10",children:[/* @__PURE__ */ye("span",{className:"font-medium text-red-600 dark:text-red-400",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-circle-exclamation mr-1"}),void 0===r?"The run failed":`Failed at “${r.title}”`]}),/* @__PURE__ */be("span",{className:"break-words text-red-700 dark:text-red-300",children:e.error})]}),
85
+ /* @__PURE__ */be("div",{className:"text-ui-fg-subtle mt-1 font-medium tracking-wide uppercase",children:"Flow"}),void 0===e.steps&&/* @__PURE__ */be("span",{className:"text-ui-fg-subtle italic",children:Ll(e)?"The flow is still running. Its steps arrive with the answer.":"The server did not send the steps for this run: the action is behind a session, or this page is not authorized to debug it."}),void 0!==e.steps&&/* @__PURE__ */be(Hl,{steps:e.steps,selectedStepId:t,onSelectStep:a}),void 0!==t&&void 0===i&&/* @__PURE__ */be("span",{className:"text-ui-fg-subtle italic",children:"This page was sent what the flow DID, not what each step read or answered. Open the action in the builder, or run the deployment in dev mode, to inspect a step."}),void 0!==i&&/* @__PURE__ */be("div",{className:"border-ui-line overflow-auto rounded border",children:/* @__PURE__ */be(Il,{value:i})}),
86
+ /* @__PURE__ */be("div",{className:"text-ui-fg-subtle mt-1 font-medium tracking-wide uppercase",children:"Run"}),
87
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Mode"}),/* @__PURE__ */be("span",{className:"text-ui-fg",children:Bl[e.mode]})]}),
88
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Started"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:Al(e.startedAt)})]}),
89
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Took"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:void 0===l?"still running":Rl(l)})]}),void 0!==e.elementId&&/* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Element"}),/* @__PURE__ */be("span",{className:"text-ui-fg-muted truncate font-mono",children:e.elementId})]}),void 0!==e.runId&&/* @__PURE__ */ye("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Run id"}),/* @__PURE__ */be("span",{className:"text-ui-fg-muted font-mono break-all",children:e.runId})]}),void 0!==e.input&&/* @__PURE__ */ye(ve,{children:[/* @__PURE__ */be("div",{className:"text-ui-fg-subtle mt-1 font-medium tracking-wide uppercase",children:"Input"}),/* @__PURE__ */be("div",{className:"border-ui-line overflow-auto rounded border",children:/* @__PURE__ */be(Il,{value:e.input})})]}),void 0!==e.output&&/* @__PURE__ */ye(ve,{children:[/* @__PURE__ */be("div",{className:"text-ui-fg-subtle mt-1 font-medium tracking-wide uppercase",children:"Output"}),/* @__PURE__ */be("div",{className:"border-ui-line overflow-auto rounded border",children:/* @__PURE__ */be(Il,{value:e.output})})]}),e.progress.length>0&&/* @__PURE__ */ye(ve,{children:[/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle mt-1 font-medium tracking-wide uppercase",children:["Progress (",e.progress.length,")"]}),/* @__PURE__ */be("div",{className:"border-ui-line overflow-auto rounded border",children:/* @__PURE__ */be(Il,{value:e.progress})})]})]})},_l={running:"fa-solid fa-circle-notch fa-spin",streaming:"fa-solid fa-circle-notch fa-spin",accepted:"fa-solid fa-paper-plane",completed:"fa-solid fa-check",failed:"fa-solid fa-xmark",aborted:"fa-solid fa-hand",skipped:"fa-solid fa-forward"},Xl={info:"border-l-violet-400",success:"border-l-emerald-400",danger:"border-l-red-400",warning:"border-l-amber-400",custom:"border-l-ui-line-strong"},Zl=({run:e,selected:t,onSelect:a,onCancel:r})=>{let l=de(()=>a(e.id),[a,e.id]),i=de(()=>r(e.id),[r,e.id]),n=Wl(e.steps),s=El(e);/* @__PURE__ */
90
+ return ye("div",{className:m("flex items-center gap-2 border-b border-l-2 px-2",Xl[Vl(e.status)],{"border-b-ui-line bg-violet-500/5":t,"border-b-ui-line hover:bg-ui-hover":!t}),children:[/* @__PURE__ */ye("button",{type:"button",className:"flex grow flex-col gap-0.5 py-1.5 text-left",onClick:l,children:[/* @__PURE__ */ye("div",{className:"flex items-center gap-1.5 text-[11px]",children:[
91
+ /* @__PURE__ */be(ql,{logType:Vl(e.status),iconClassName:_l[e.status]}),
92
+ /* @__PURE__ */be("span",{className:"text-ui-fg truncate font-medium",children:e.actionId||"(no action named)"}),
93
+ /* @__PURE__ */ye("span",{className:"bg-ui-raised text-ui-fg-subtle flex shrink-0 items-center gap-1 rounded-sm px-1 text-[9px] uppercase",title:"render"===e.mode?"Run by the server while it built this page":void 0,children:[/* @__PURE__ */be("i",{className:Jl[e.mode]}),Bl[e.mode]]}),
94
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle ml-auto shrink-0 tabular-nums",children:void 0===s?"…":Rl(s)})]}),/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex items-center gap-1.5 text-[10px]",children:[
95
+ /* @__PURE__ */be("span",{className:"shrink-0 tabular-nums",children:Al(e.startedAt)}),void 0!==e.steps&&/* @__PURE__ */be("span",{className:"shrink-0",children:Pl(e.steps.length)}),void 0!==e.elementId&&/* @__PURE__ */be("span",{className:"truncate font-mono",children:e.elementId}),void 0!==n&&/* @__PURE__ */ye("span",{className:"truncate text-red-500 dark:text-red-400",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-circle-exclamation mr-1"}),n.title]}),void 0===n&&void 0!==e.reason&&/* @__PURE__ */be("span",{className:"truncate text-amber-600 dark:text-amber-400",children:e.reason})]})]}),Ll(e)&&!0===e.cancellable&&/* @__PURE__ */be(te,{size:"xs",intent:"secondary",onClick:i,children:"Cancel"})]})},Gl=({runs:e,total:t,selectedRunId:a,onSelect:r,onCancel:l})=>/* @__PURE__ */ye("div",{className:"flex min-w-0 grow flex-col overflow-auto",children:[0===t&&/* @__PURE__ */be("div",{className:"text-ui-fg-subtle p-3 text-[11px]",children:"No server action has run on this page yet. A run appears the moment one is SENT — including the ones that never come back — and the server adds the ones it ran to build the page."}),t>0&&0===e.length&&/* @__PURE__ */be("div",{className:"text-ui-fg-subtle p-3 text-[11px]",children:"No run matches this filter."}),e.map(e=>/* @__PURE__ */be(Zl,{run:e,selected:e.id===a,onSelect:r,onCancel:l},e.id))]}),Yl=()=>{let{runs:e,clear:t}=p(),[a]=ae("actions.endpoint"),[r,l]=_("plitzi-sdk.dev-tools.actions.filter","all"),[i,n]=ge(""),[s,o]=ge(),[d,c]=ge(),u=pe(()=>((e,t,a)=>e.filter(e=>!("live"===t&&!Ll(e)||"failed"===t&&!(e=>"failed"===e.status||"aborted"===e.status)(e))&&((e,t)=>{let a=t.trim().toLowerCase();return""===a||[e.actionId,e.runId,e.elementId,e.status,e.reason,e.error,...(e.steps??[]).map(e=>`${e.title} ${e.action} ${e.error??""}`)].some(e=>"string"==typeof e&&e.toLowerCase().includes(a))})(e,a)))(e,r,i),[e,r,i]),m=pe(()=>e.filter(Ll).length,[e]),h=pe(()=>e.find(e=>e.id===s),[e,s]),f=de(e=>{o(t=>t===e?void 0:e),c(void 0)},[]),g=de(e=>{c(t=>t===e?void 0:e)},[]),x=de(e=>y(e),[]),v=de(()=>{t(),o(void 0),c(void 0)},[t]);/* @__PURE__ */
96
+ return ye("div",{className:"flex h-full w-full flex-col",children:[
97
+ /* @__PURE__ */be(Kt,{filter:r,query:i,liveCount:m,runCount:e.length,onFilterChange:l,onQueryChange:n,onClear:v}),void 0===a&&/* @__PURE__ */be("div",{className:"shrink-0 border-b border-amber-200 bg-amber-50 px-2 py-1 text-[10px] text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400",children:"This page is served without a Plitzi server: every action step is inert"}),
98
+ /* @__PURE__ */ye("div",{className:"flex min-h-0 grow",children:[/* @__PURE__ */be(Gl,{runs:u,total:e.length,selectedRunId:s,onSelect:f,onCancel:x}),void 0!==h&&/* @__PURE__ */be(_t,{children:/* @__PURE__ */be(Ql,{run:h,selectedStepId:d,onSelectStep:g})})]})]})},ei=({row:e,isOpen:t,value:a,onToggle:r,onExpire:l,onForget:i})=>{let n=de(()=>r(e.key),[r,e.key]),s=de(()=>l(e.uid,e.path),[l,e.uid,e.path]),o=de(()=>i(e.uid,e.path),[i,e.uid,e.path]);/* @__PURE__ */
99
+ return ye("li",{className:"border-ui-line border-b last:border-0",children:[
100
+ /* @__PURE__ */ye("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[
101
+ /* @__PURE__ */ye("button",{className:"flex min-w-0 grow cursor-pointer items-center gap-2 text-left",onClick:n,"aria-expanded":t,children:[
102
+ /* @__PURE__ */be("i",{className:m("fa-solid text-ui-fg-subtle w-2 shrink-0 text-[9px]",t?"fa-chevron-down":"fa-chevron-right")}),
103
+ /* @__PURE__ */be("span",{className:"bg-ui-raised text-ui-fg-subtle shrink-0 rounded-sm px-1 text-[9px] uppercase",children:e.storeLabel}),
104
+ /* @__PURE__ */be("span",{className:"text-ui-fg min-w-0 grow truncate font-mono text-[11px]",children:e.label}),e.tags.map(e=>/* @__PURE__ */be("span",{className:"shrink-0 rounded bg-violet-500/15 px-1.5 text-[10px] text-violet-600 dark:text-violet-400",children:e},e))]}),
105
+ /* @__PURE__ */be("span",{className:m("w-24 shrink-0 rounded px-1.5 py-0.5 text-center text-[11px] font-medium tabular-nums",e.isStale?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400"),children:e.status}),!1===e.inUse?/* @__PURE__ */be("button",{className:"w-14 shrink-0 cursor-pointer rounded px-1.5 text-[11px] text-violet-600 hover:bg-violet-500/15 dark:text-violet-400",onClick:o,children:"Forget"}):/* @__PURE__ */be("button",{className:"w-14 shrink-0 cursor-pointer rounded px-1.5 text-[11px] text-violet-600 hover:bg-violet-500/15 dark:text-violet-400",onClick:s,children:"Expire"})]}),
106
+ /* @__PURE__ */ye("div",{className:"flex items-center gap-2 px-2 pb-1.5 pl-6",children:[/* @__PURE__ */be("span",{className:"bg-ui-raised h-1 min-w-0 grow overflow-hidden rounded-full",children:/* @__PURE__ */be("span",{className:m("block h-full rounded-full",e.isStale?"bg-amber-500/60":"bg-emerald-500/80"),style:{width:`${Math.round(100*e.progress)}%`}})}),/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle shrink-0 text-[10px] tabular-nums",children:["written ",e.age," · ttl ",e.ttl,!1===e.inUse&&" · nothing renders it"+(e.kept?` · ${e.kept}`:"")]})]}),t&&/* @__PURE__ */ye("div",{className:"border-ui-line bg-ui-raised max-h-56 overflow-auto border-t px-2 py-1",children:[/* @__PURE__ */be("div",{className:"text-ui-fg-subtle pb-1 font-mono text-[10px]",children:e.path}),/* @__PURE__ */be(Il,{value:a})]})]})},ti=r.store,ai=(e,t)=>{if(e===ti&&t.startsWith("entries."))return r.store.getState().entries[t.slice(8)]},ri=(e,t)=>{let a=ai(e.entry.store,t);if(!a)return;let l=r.usage(a.key);return{label:a.url,tags:a.tags,usage:l&&{inUse:l.observers>0||l.holds>0,collectAt:l.collectAt}}},li=[],ii=e=>{let t=fe(li),a=fe(/* @__PURE__ */new WeakMap),r=de(t=>{let a=e.map(({store:e})=>e.watchFreshness(t));return()=>a.forEach(e=>e())},[e]),l=de(()=>{let r=e.map(e=>{let t=e.store.getFreshnessRecords(),r=a.current.get(t);return r||(r=(e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e.ttl>0)))(t),a.current.set(t,r)),{entry:e,records:r}}).filter(e=>Object.keys(e.records).length>0);return((e,t)=>e.length===t.length&&e.every((e,a)=>e.entry===t[a].entry&&e.records===t[a].records))(t.current,r)||(t.current=r.length>0?r:li),t.current},[e]);return xe(r,l,l)},ni=(e,t=0)=>{let[a,r]=ge(()=>Date.now());return ue(()=>{if(!e)return;let t=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(t)},[e]),Math.max(a,t)},si=e=>{let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let a=Math.floor(t/60);return a<60?`${a}m ${t%60}s`:`${Math.floor(a/60)}h ${a%60}m`},oi=(e,t)=>{let{store:a,name:r,scopeId:l}=e;return r?a.scopePath?`${r} · ${a.scopePath}`:r:a.scopePath?a.scopePath:a.id?a.id:void 0===l?"root":((e,t)=>{if(!t)return;let a=Object.keys(e.getState()).filter(e=>!t.has(e));return a.length>0?`{ ${a.slice(0,4).join(", ")} }`:void 0})(a,t)??"scope"},di=e=>{let t=e.find(e=>void 0===e.scopeId);return t?new Set(Object.keys(t.store.getState())):void 0},ci=(e,t,a)=>e.filter(e=>e.scopeId===t||void 0===e.scopeId&&t===a),ui=(e,t)=>t&&e.some(e=>e.uid===t)?t:(e.find(e=>void 0===e.scopeId)??e.at(0))?.uid,mi=/* @__PURE__ */new Set,pi=e=>(mi.add(e),()=>{mi.delete(e)}),hi=()=>$l,fi=()=>xe(pi,hi,hi),gi=()=>xe(k,C,C),xi=()=>{let e=gi(),{instanceIds:t,selectedId:a}=L(),r=fi();return{options:pe(()=>((e,t,a)=>{let r=di(e);return t.map(t=>({label:t,options:ci(e,t,a).map(e=>({label:oi(e,r),value:e.uid}))}))})(e,t,a),[e,t,a]),value:pe(()=>ui(e,r),[e,r]),onSelect:de(t=>{let a=e.find(e=>e.uid===t);a?.scopeId&&D(a.scopeId),(e=>{$l!==e&&($l=e,(()=>{for(let e of mi)e()})())})(t)},[e])}},vi=()=>{let e=gi(),t=fi(),a=pe(()=>ui(e,t),[e,t]);return pe(()=>e.find(e=>e.uid===a),[e,a])},bi=()=>{let e=(()=>{let e=gi(),{selectedId:t}=L();return pe(()=>ci(e,t,t),[e,t])})(),t=ii(e),a=pe(()=>t.reduce((e,t)=>e+Object.keys(t.records).length,0),[t]),l=ni(a>0),i=pe(()=>di(e),[e]),n=de(e=>oi(e.entry,i),[i]),s=pe(()=>((e,t,a,r)=>{let l=a;for(let i of e)for(let e of Object.values(i.records))l=Math.max(l,e.updatedAt);return e.flatMap(e=>{let a=t(e);return Object.entries(e.records).map(([t,i])=>((e,t,a,{updatedAt:r,expiresAt:l,ttl:i},n,s)=>{let o=n>=l,d=Number.isFinite(l),c="no expiry";return o?c="stale":d&&(c=`${si(l-n)} left`),{key:`${e.entry.uid}:${a}`,uid:e.entry.uid,storeLabel:t,path:a,label:s?.label??a,tags:s?.tags??[],isStale:o,age:`${si(n-r)} ago`,status:c,ttl:Number.isFinite(i)?si(i):"∞",inUse:s?.usage?.inUse,kept:s?.usage?.collectAt?`forgotten in ${si(s.usage.collectAt-n)}`:void 0,progress:o?0:Math.min(1,Number.isFinite(i)?(l-n)/i:1)}})(e,a,t,i,l,r?.(e,t)))}).sort((e,t)=>Number(e.isStale)-Number(t.isStale)||e.storeLabel.localeCompare(t.storeLabel)||e.label.localeCompare(t.label))})(t,n,l,ri),[t,n,l]),[o,d]=ge(""),[c,u]=ge(!1),[p,h]=ge(void 0),f=pe(()=>{let e=o.trim().toLowerCase();return s.filter(t=>!(c&&!t.isStale)&&(!e||t.label.toLowerCase().includes(e)||t.storeLabel.toLowerCase().includes(e)||t.tags.some(t=>t.toLowerCase().includes(e))))},[s,o,c]),g=pe(()=>{let e=f.find(e=>e.key===p);if(e)return t.find(t=>t.entry.uid===e.uid)?.entry.store.getPath(e.path)},[f,p,t]),x=de(e=>h(t=>t===e?void 0:e),[]),v=de(()=>u(e=>!e),[]),b=de((e,a)=>{t.find(t=>t.entry.uid===e)?.entry.store.expire(a)},[t]),y=de((e,a)=>{let l=t.find(t=>t.entry.uid===e)?.entry;l&&!((e,t)=>{let a=ai(e,t);return!!a&&r.remove(a.key)})(l.store,a)&&l.store.setState(a,void 0,{unmount:!0})},[t]),N=de(()=>t.forEach(e=>e.entry.store.expire()),[t]);/* @__PURE__ */
107
+ return ye("div",{className:"flex h-full w-full flex-col text-[11px]",children:[/* @__PURE__ */ye("div",{className:"border-ui-line flex shrink-0 items-center gap-2 border-b px-2 py-1",children:[
108
+ /* @__PURE__ */be("span",{className:"text-ui-fg-muted font-medium",children:"Cached"}),
109
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle tabular-nums",children:a}),
110
+ /* @__PURE__ */be("input",{className:"border-ui-line bg-ui-raised text-ui-fg placeholder:text-ui-fg-subtle min-w-0 grow rounded border px-1.5 py-0.5 outline-none focus:border-violet-400",value:o,placeholder:"Filter by URL, store or tag",onChange:e=>d(e.target.value)}),
111
+ /* @__PURE__ */be("button",{className:m("shrink-0 cursor-pointer rounded px-1.5 py-0.5 font-medium transition-colors",c?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"text-ui-fg-subtle hover:bg-ui-hover"),onClick:v,children:"Stale only"}),
112
+ /* @__PURE__ */be("button",{className:"shrink-0 cursor-pointer rounded px-1.5 py-0.5 text-violet-600 hover:bg-violet-500/15 dark:text-violet-400",onClick:N,children:"Expire all"})]}),0===f.length?/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex grow flex-col items-center justify-center gap-2 px-6 text-center",children:[
113
+ /* @__PURE__ */be("i",{className:"fa-solid fa-database text-3xl opacity-20"}),
114
+ /* @__PURE__ */be("span",{children:0===a?"Nothing on this page is cached":"Nothing matches the filter"}),0===a&&/* @__PURE__ */be("span",{className:"max-w-80 text-[10px]",children:"A path appears here once something writes it with a time to live — a provider does that when its author turns its cache on."})]}):/* @__PURE__ */be("ul",{className:"grow overflow-auto",children:f.map(e=>/* @__PURE__ */be(ei,{row:e,isOpen:e.key===p,value:e.key===p?g:void 0,onToggle:x,onExpire:b,onForget:y},e.key))})]})},yi=({name:e,children:t})=>/* @__PURE__ */ye("div",{className:"border-ui-line flex gap-4 py-1 [&:not(:first-child)]:border-t",children:[/* @__PURE__ */be("div",{className:"text-ui-fg-subtle grow basis-0",children:e}),/* @__PURE__ */be("div",{className:"text-ui-fg grow basis-0 truncate",children:t})]}),Ni=({id:e,onSelect:t})=>{let[a]=ae("schema.flat"),r=Object.hasOwn(a,e)?a[e].definition.label:e,l=de(()=>t?.(e),[t,e]);/* @__PURE__ */
115
+ return be("span",{className:"cursor-pointer text-violet-600 hover:underline dark:text-violet-400",onClick:l,children:r})},wi=/* @__PURE__ */new Set(["rootId","parentId"]),ki=(e,t,a)=>"object"==typeof t&&t?a&&"styleSelectors"===e?Object.values(t).join(", "):JSON.stringify(t):"boolean"==typeof t?t?"True":"False":"string"==typeof t||"number"==typeof t?String(t):"",Si=({attribute:e,value:t,isDefinition:a=!1,onSelectElement:r})=>a&&"items"===e&&Array.isArray(t)?/* @__PURE__ */be("div",{className:"flex flex-col",children:t.filter(e=>"string"==typeof e).map(e=>/* @__PURE__ */be(Ni,{id:e,onSelect:r},e))}):a&&wi.has(e)&&"string"==typeof t?/* @__PURE__ */be(Ni,{id:t,onSelect:r}):/* @__PURE__ */be(ve,{children:ki(e,t,a)}),Ci=({attributes:e={}})=>/* @__PURE__ */be("div",{className:"w-full text-sm",children:Object.entries(e).map(([e,t])=>/* @__PURE__ */be(yi,{name:e,children:/* @__PURE__ */be(Si,{attribute:e,value:t})},e))}),$i=({definition:e,onSelectElement:t})=>/* @__PURE__ */be("div",{className:"w-full text-sm",children:Object.entries(e??{}).map(([e,a])=>/* @__PURE__ */be(yi,{name:e,children:/* @__PURE__ */be(Si,{isDefinition:!0,attribute:e,value:a,onSelectElement:t})},e))}),ji=({visible:e,box:t})=>`${e?"Yes":"No"}${t?` · ${String(t.width)}×${String(t.height)} at ${String(t.x)}, ${String(t.y)}`:""}`,Ti=({category:e,to:t,source:a,template:r})=>`${"attributes"===e?"":`${e} · `}${t} ← ${a}${r?` · ${r}`:""}`,Ii=({id:e})=>{let t=ce(d);ni(!0);let a=t&&typeof document<"u"?P(t.getState(),e,document):void 0;/* @__PURE__ */
116
+ return ye("div",a?{className:"w-full text-sm",children:[
117
+ /* @__PURE__ */be(yi,{name:"Type",children:a.type}),a.inComponent&&/* @__PURE__ */be(yi,{name:"In component",children:a.inComponent}),a.instanceOf&&/* @__PURE__ */be(yi,{name:"Places component",children:a.instanceOf}),
118
+ /* @__PURE__ */be(yi,{name:"Copies on the page",children:a.copies}),
119
+ /* @__PURE__ */be(yi,{name:"On screen",children:ji(a)}),void 0!==a.state&&/* @__PURE__ */be(yi,{name:"Own state",children:JSON.stringify(a.state)}),(a.bindings??[]).map(e=>/* @__PURE__ */be(yi,{name:"Reads",children:Ti(e)},`${e.category}-${e.to}`))]}:{className:"text-ui-fg-subtle text-sm",children:["Neither the document nor the page has “",e,"”."]})},Li=[{label:"Runtime"},{label:"Definition"},{label:"Attributes"}],Ei=({id:e,onSelectElement:t})=>{let[[a,r]]=ae(["schema.flat","schema.components"]),l=pe(()=>Ve({flat:a,components:r},e)?.flat[e],[a,r,e]);/* @__PURE__ */
120
+ return ye(z,{className:"w-full grow gap-4 overflow-hidden p-4",children:[
121
+ /* @__PURE__ */be(z.Tabs,{items:Li}),
122
+ /* @__PURE__ */be(z.TabContent,{className:"flex-col overflow-y-auto",children:/* @__PURE__ */be(Ii,{id:e})}),
123
+ /* @__PURE__ */be(z.TabContent,{className:"flex-col overflow-y-auto",children:/* @__PURE__ */be($i,{definition:l?.definition,onSelectElement:t})}),
124
+ /* @__PURE__ */be(z.TabContent,{className:"overflow-y-auto",children:/* @__PURE__ */be(Ci,{attributes:l?.attributes})})]})},Ri=e=>"string"==typeof e?e:"",Ai=(e,t)=>{let a=[],r=/* @__PURE__ */new Set,l=(t,i)=>{let n=Object.hasOwn(e,t)?e[t]:void 0;if(!n||r.has(t))return;r.add(t);let s=(e=>"reference"===e.definition.type&&"component"===e.attributes.referenceType&&!0)(n)?Ri(n.attributes.referenceId):"";a.push({id:t,label:n.definition.label||t,type:n.definition.type,depth:i,hidden:!1===n.definition.initialState?.visibility,...s?{instanceOf:s}:{}});for(let e of n.definition.items??[])l(e,i+1)};return l(t,0),a},Mi=(e,t)=>{let a=t.trim().toLowerCase();if(!a)return[...e];let r=/* @__PURE__ */new Set;return e.forEach((t,l)=>{if(![t.label,t.id,t.type].some(e=>e.toLowerCase().includes(a)))return;r.add(l);let i=t.depth;for(let a=l-1;a>=0&&i>0;a--)e[a].depth<i&&(r.add(a),i=e[a].depth)}),e.filter((e,t)=>r.has(t))},Vi=({row:e,isSelected:t,onSelect:a,onHover:r})=>{let l=de(()=>a(e.id),[a,e.id]),i=de(()=>r(e.id),[r,e.id]),n=de(()=>r(void 0),[r]);/* @__PURE__ */
125
+ return ye("div",{className:m("flex w-full cursor-pointer items-center gap-2 border-l-2 py-1 pr-2 transition-colors",t?"border-l-violet-500 bg-violet-50 text-violet-700 dark:bg-violet-500/15 dark:text-violet-300":"text-ui-fg-muted hover:bg-ui-hover hover:text-ui-fg border-l-transparent"),style:{paddingLeft:8+12*e.depth},onClick:l,onMouseEnter:i,onMouseLeave:n,children:[
126
+ /* @__PURE__ */be("span",{className:"truncate",title:e.id,children:e.label}),
127
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 font-mono text-[10px]",children:e.type}),e.instanceOf&&/* @__PURE__ */ye("span",{className:"shrink-0 rounded bg-violet-100 px-1 text-[10px] text-violet-700 dark:bg-violet-500/20 dark:text-violet-300",children:["◇ ",e.instanceOf]}),
128
+ /* @__PURE__ */be("span",{className:"grow"}),e.hidden&&/* @__PURE__ */be("i",{className:"fa-solid fa-eye-slash text-ui-fg-subtle shrink-0 text-[10px]",title:"Starts hidden"})]})},zi={layout:"fa-solid fa-table-columns",page:"fa-regular fa-file",component:"fa-solid fa-cube"},Oi={layout:"Layout",page:"Page",component:"Component"},Di=({section:e,rows:t,more:a,selected:r,onSelect:l,onHover:i})=>/* @__PURE__ */ye("div",{className:"flex flex-col",children:[
129
+ /* @__PURE__ */ye("div",{className:"border-ui-line bg-ui-raised text-ui-fg-subtle sticky top-0 flex items-center gap-2 border-b px-2 py-1 text-[10px] font-semibold tracking-wider uppercase",children:[
130
+ /* @__PURE__ */be("i",{className:zi[e.kind]}),
131
+ /* @__PURE__ */be("span",{children:Oi[e.kind]}),
132
+ /* @__PURE__ */be("span",{className:"truncate font-normal tracking-normal normal-case",children:e.title})]}),t.map(e=>/* @__PURE__ */be(Vi,{row:e,isSelected:r===e.id,onSelect:l,onHover:i},e.id)),a>0&&/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle p-2 text-center text-[11px]",children:[a," more — narrow the search to reach them"]})]}),Fi=({sections:e,filter:t,selected:a,onFilter:r,onSelect:l,onHover:i})=>{let n=pe(()=>e.map(e=>({section:e,rows:Mi(e.rows,t)})).filter(({rows:e})=>e.length>0),[e,t]);/* @__PURE__ */
133
+ return ye("div",{className:"border-ui-line flex h-full w-[320px] shrink-0 flex-col gap-2 border-r",children:[/* @__PURE__ */be("div",{className:"px-2 pt-2",children:/* @__PURE__ */be(O,{value:t,onChange:r,placeholder:"Search by name, id or type...",size:"sm"})}),/* @__PURE__ */ye("div",{className:"flex flex-col overflow-y-auto text-xs",children:[0===n.length&&/* @__PURE__ */be("div",{className:"text-ui-fg-subtle p-4 text-center",children:"No elements"}),n.map(({section:e,rows:t})=>/* @__PURE__ */be(Di,{section:e,rows:t.slice(0,200),more:Math.max(t.length-200,0),selected:a,onSelect:l,onHover:i},`${e.kind}-${e.id}`))]})]})},Bi=e=>{ue(()=>{if(typeof document>"u"||!e)return;let t=document.querySelectorAll(`[data-id="${e}"]`);return t.forEach(e=>e.classList.add("devtools-element-hovered")),()=>t.forEach(e=>e.classList.remove("devtools-element-hovered"))},[e])},Ji=({className:e,elementSelected:t,onSelectElement:a})=>{let[[r,l,i]]=ae(["schema.flat","schema.components","navigation.currentPageId"]),[n,s]=ge(""),[o,d]=ge(),c=pe(()=>((e,t)=>{let a=Object.hasOwn(e.flat,t)?e.flat[t]:void 0;if(!a)return[];let r=[...X(t=>Object.hasOwn(e.flat,t)?e.flat[t]:void 0,Ri(a.attributes.layout),Ri(a.attributes.layoutContainer)).toReversed().map(({layout:t})=>({kind:"layout",id:t,title:e.flat[t].definition.label||t,rows:Ai(e.flat,t)})),{kind:"page",id:t,title:Ri(a.attributes.name)||a.definition.label||t,rows:Ai(e.flat,t)}],l=/* @__PURE__ */new Set;for(let i=0;i<r.length;i++)for(let t of r[i].rows){let a=t.instanceOf?ze(e,t.instanceOf):void 0;a&&!l.has(a.id)&&(l.add(a.id),r.push({kind:"component",id:a.id,title:a.label??a.id,rows:Ai(a.flat,a.rootId)}))}return r})({flat:r,components:l},i),[r,l,i]);return Bi(o),/* @__PURE__ */ye("div",{className:m("flex h-full w-full",e),children:[/* @__PURE__ */be(Fi,{sections:c,filter:n,selected:t,onFilter:s,onSelect:a,onHover:d}),t&&/* @__PURE__ */be(Ei,{id:t,onSelectElement:a})]})},Pi=({name:e,variant:t,weight:a,forced:r,onForce:l})=>{let i=de(()=>l(e,t),[e,t,l]);/* @__PURE__ */
134
+ return be("button",{type:"button",className:m("rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",{"bg-violet-600 text-white":r,"text-ui-fg-subtle hover:bg-ui-hover":!r}),title:`Force variant ${t.toUpperCase()} (weight ${String(a)}) for this browser`,onClick:i,children:t.toUpperCase()})},Wi=({name:e,weights:t,shown:a,forced:r,onForce:l})=>{let i=t.reduce((e,t)=>e+t,0),n=t.map((e,t)=>{let a=$(t);return a?`${a.toUpperCase()} ${String(i>0?Math.round(e/i*100):0)}%`:""}).join(" · "),s=de(()=>l(e,void 0),[e,l]);/* @__PURE__ */
135
+ return ye("div",{className:"border-ui-line hover:bg-ui-hover grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 border-b px-3 py-1.5 transition-colors",children:[/* @__PURE__ */ye("div",{className:"flex min-w-0 flex-col gap-0.5",children:[/* @__PURE__ */ye("div",{className:"flex min-w-0 items-center gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg truncate font-mono font-medium",title:e,children:e}),a&&/* @__PURE__ */ye("span",{className:"text-ui-fg-muted bg-ui-raised rounded px-1 font-mono text-[10px]",children:["shows ",a.toUpperCase(),r?" · forced":""]})]}),/* @__PURE__ */be("span",{className:"text-ui-fg-subtle truncate text-[11px]",children:n})]}),/* @__PURE__ */ye("div",{className:"flex items-center gap-1",children:[t.map((t,a)=>{let i=$(a);return i&&/* @__PURE__ */be(Pi,{name:e,variant:i,weight:t,forced:r===i,onForce:l},i)}),void 0!==r&&/* @__PURE__ */be("button",{type:"button",className:"text-ui-fg-subtle hover:bg-ui-hover rounded px-1.5 py-0.5 text-[10px]",title:"Stop forcing it: the visitor's own variant shows again",onClick:s,children:/* @__PURE__ */be("i",{className:"fa-solid fa-rotate-left"})})]})]})},qi={},Ui=()=>{let[[e,t,a=qi]]=ae(["schema.flat","schema.components","experiments.assigned"]),[r=qi,l]=ae("experiments.qa"),i=pe(()=>j({flat:e,components:t}),[e,t]),n=Object.keys(i),s=de((e,t)=>{let a=H(r,e,t);l(a),u(a)},[r,l]),o=de(()=>{l({}),u({})},[l]);return 0===n.length?/* @__PURE__ */be("div",{className:"text-ui-fg-subtle py-4 text-center text-xs italic",children:"This space runs no A/B tests"}):/* @__PURE__ */ye("div",{className:"flex w-full flex-col gap-1.5 overflow-y-auto p-3",children:[/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex items-center justify-between gap-2 text-[10px] font-semibold tracking-wider uppercase",children:[/* @__PURE__ */ye("span",{className:"flex items-center gap-2",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-flask"}),"A/B tests"]}),Object.keys(r).length>0&&/* @__PURE__ */be("button",{type:"button",className:"hover:bg-ui-hover rounded px-1.5 py-0.5 font-medium normal-case",onClick:o,children:"Stop forcing all"})]}),/* @__PURE__ */be("div",{className:"border-ui-line w-full overflow-hidden rounded border",children:n.map(e=>/* @__PURE__ */be(Wi,{name:e,weights:i[e].weights,shown:a[e],forced:r[e],onForce:s},e))})]})},Hi={space:"default",server:"server",sdk:"sdk",qa:"forced"},Ki=({resolution:e})=>{if(!e)return null;let{layer:t,rule:a,rollout:r}=e,l="space"===t&&void 0!==a?`rule ${a+1}`:"space"===t&&r?"rollout":Hi[t];/* @__PURE__ */
136
+ return be("span",{className:m("rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wider uppercase",{"bg-ui-raised text-ui-fg-subtle":"space"===t,"bg-sky-100 text-sky-700 dark:bg-sky-950 dark:text-sky-300":"server"===t||"sdk"===t,"bg-amber-100 text-amber-700 dark:bg-amber-950 dark:text-amber-300":"qa"===t}),title:"Which layer decided this flag",children:l})},Qi=({name:e,flag:t,resolution:a,forced:r,onForce:l})=>{let i=a?.value??!1,n=de(()=>l(e,!0),[e,l]),s=de(()=>l(e,!1),[e,l]),o=de(()=>l(e,void 0),[e,l]);/* @__PURE__ */
137
+ return ye("div",{className:"border-ui-line hover:bg-ui-hover grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 border-b px-3 py-1.5 transition-colors",children:[/* @__PURE__ */ye("div",{className:"flex min-w-0 flex-col gap-0.5",children:[/* @__PURE__ */ye("div",{className:"flex min-w-0 items-center gap-2",children:[
138
+ /* @__PURE__ */be("span",{className:m("h-2 w-2 shrink-0 rounded-full",{"bg-emerald-500":i,"bg-ui-line-strong":!i})}),
139
+ /* @__PURE__ */be("span",{className:"text-ui-fg truncate font-mono font-medium",title:e,children:e}),
140
+ /* @__PURE__ */be(Ki,{resolution:a})]}),t.description&&/* @__PURE__ */be("span",{className:"text-ui-fg-subtle truncate text-[11px]",title:t.description,children:t.description})]}),/* @__PURE__ */ye("div",{className:"flex items-center gap-1",children:[
141
+ /* @__PURE__ */be("button",{type:"button",className:m("rounded px-1.5 py-0.5 text-[10px] font-medium",{"bg-emerald-600 text-white":!0===r,"text-ui-fg-subtle hover:bg-ui-hover":!0!==r}),title:"Force this flag on for this browser",onClick:n,children:"On"}),
142
+ /* @__PURE__ */be("button",{type:"button",className:m("rounded px-1.5 py-0.5 text-[10px] font-medium",{"dark:text-ui-fg-subtle bg-zinc-700 text-white dark:bg-zinc-300":!1===r,"text-ui-fg-subtle hover:bg-ui-hover":!1!==r}),title:"Force this flag off for this browser",onClick:s,children:"Off"}),void 0!==r&&/* @__PURE__ */be("button",{type:"button",className:"text-ui-fg-subtle hover:bg-ui-hover rounded px-1.5 py-0.5 text-[10px]",title:"Stop forcing it: the space and its embedding decide again",onClick:o,children:/* @__PURE__ */be("i",{className:"fa-solid fa-rotate-left"})})]})]})},_i={},Xi=()=>{let[[e,t]]=ae(["schema.flags","flags.resolved"]),[a=_i,r]=ae("flags.overrides.qa"),l=Object.keys(e??{}),i=de((e,t)=>{let l=g(a,e,t);r(l),B(window.location.host,l)},[a,r]),n=de(()=>{r({}),B(window.location.host,{})},[r]);return e&&0!==l.length?/* @__PURE__ */ye("div",{className:"flex w-full flex-col gap-1.5 overflow-y-auto p-3",children:[/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex items-center justify-between gap-2 text-[10px] font-semibold tracking-wider uppercase",children:[/* @__PURE__ */ye("span",{className:"flex items-center gap-2",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-flag"}),"Feature Flags"]}),Object.keys(a).length>0&&/* @__PURE__ */be("button",{type:"button",className:"hover:bg-ui-hover rounded px-1.5 py-0.5 font-medium normal-case",onClick:n,children:"Stop forcing all"})]}),/* @__PURE__ */be("div",{className:"border-ui-line w-full overflow-hidden rounded border",children:l.map(r=>/* @__PURE__ */be(Qi,{name:r,flag:e[r],resolution:t?.[r],forced:a[r],onForce:i},r))})]}):/* @__PURE__ */be("div",{className:"text-ui-fg-subtle py-4 text-center text-xs italic",children:"This space declares no feature flags"})},Zi=e=>new Date(e).toLocaleTimeString(void 0,{hour12:!1})+"."+String(e%1e3).padStart(3,"0"),Gi=e=>{if(void 0===e)return"";if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);let t,a=Array.isArray(e)?"[…]":"{…}";try{t=JSON.stringify(e)||a}catch{t=a}return t.length>120?t.slice(0,120)+"…":t},Yi=({index:e,path:t,value:a,timestamp:r,isSelected:l,isFuture:i,onSelect:n})=>{let s=fe(null),o=de(()=>n(e),[n,e]);return ue(()=>{l&&s.current?.scrollIntoView({block:"nearest"})},[l]),/* @__PURE__ */ye("button",{ref:s,onClick:o,className:m("border-ui-line flex w-full flex-col gap-0.5 border-b px-3 py-1.5 text-left font-mono text-xs",{"bg-violet-600 text-white dark:bg-violet-600":l,"text-ui-fg-muted hover:bg-ui-hover":!l,"opacity-50":i}),children:[/* @__PURE__ */ye("div",{className:"flex w-full items-center gap-2",children:[/* @__PURE__ */be("span",{className:"grow truncate",children:t??/* @__PURE__ */be("span",{className:"italic opacity-70",children:0===e?"initial state":"replace"})}),/* @__PURE__ */be("span",{className:"shrink-0 text-[10px] opacity-70",children:Zi(r)})]}),void 0!==a&&/* @__PURE__ */be("span",{className:"w-full truncate text-[10px] opacity-70",children:Gi(a)})]})},en=({index:e,total:t,canUndo:a,canRedo:r,filter:l,onUndo:i,onRedo:n,onClear:s,onFilterChange:o})=>/* @__PURE__ */ye("div",{className:"border-ui-line bg-ui-panel flex shrink-0 flex-col gap-1.5 border-b px-2 py-1.5",children:[/* @__PURE__ */ye("div",{className:"flex items-center gap-1",children:[
143
+ /* @__PURE__ */ye("button",{onClick:i,disabled:!a,className:"text-ui-fg-muted enabled:hover:bg-ui-hover flex h-6 items-center gap-1 rounded px-2 text-xs font-medium disabled:opacity-40",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-rotate-left"}),"Undo"]}),
144
+ /* @__PURE__ */ye("button",{onClick:n,disabled:!r,className:"text-ui-fg-muted enabled:hover:bg-ui-hover flex h-6 items-center gap-1 rounded px-2 text-xs font-medium disabled:opacity-40",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-rotate-right"}),"Redo"]}),
145
+ /* @__PURE__ */ye("div",{className:"ml-auto flex items-center gap-2",children:[/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle text-[10px]",children:[e+1," / ",t]}),/* @__PURE__ */ye("button",{onClick:s,className:"text-ui-fg-muted hover:bg-ui-hover flex h-6 items-center gap-1 rounded px-2 text-xs font-medium",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-trash"}),"Clear"]})]})]}),/* @__PURE__ */be(O,{value:l,onChange:o,placeholder:"Filter by path...",size:"sm"})]}),tn=()=>{let{entries:e,index:t,canUndo:r,canRedo:l,undo:i,redo:n,travelTo:s,clear:d}=function(){let e=S(void 0,"useStoreHistory"),t=a(e);ue(()=>{t||(e=>{o||Ce.has(e)||(Ce.add(e),console.warn("[nexus] useStoreHistory: this store has no history. Add `historyMiddleware()` to its middlewares to record an action log — until then the hook returns an empty, no-op view."))})(e)},[t,e]);let r=t?.getSnapshot??Se;return{...xe(t?.subscribe??ke,r,r),undo:t?.undo??we,redo:t?.redo??we,travelTo:t?.travelTo??we,clear:t?.clear??we}}(),[c,u]=ge(""),m=pe(()=>e.map((e,t)=>({entry:e,originalIndex:t})).filter(({entry:e})=>((e,t)=>!t||(e.path??"").toLowerCase().includes(t.toLowerCase()))(e,c)).reverse(),[e,c]),p=de(e=>{if("ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;e.preventDefault();let a,r=m.findIndex(e=>e.originalIndex===t);a=-1===r?"ArrowDown"===e.key?0:m.length-1:"ArrowUp"===e.key?r-1:r+1,a<0||a>=m.length||s(m[a].originalIndex)},[m,t,s]);/* @__PURE__ */
146
+ return ye("div",{className:"flex h-full w-full flex-col",children:[/* @__PURE__ */be(en,{index:t,total:e.length,canUndo:r,canRedo:l,filter:c,onUndo:i,onRedo:n,onClear:d,onFilterChange:u}),/* @__PURE__ */ye("div",{tabIndex:0,onKeyDown:p,className:"flex flex-1 flex-col overflow-y-auto outline-none",children:[0===m.length&&/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex grow flex-col items-center justify-center gap-2",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-clock-rotate-left text-3xl opacity-20"}),/* @__PURE__ */be("span",{className:"text-xs",children:c?"No entries match the filter":"No history yet"})]}),m.map(({entry:e,originalIndex:a})=>/* @__PURE__ */be(Yi,{index:a,path:e.path,value:e.value,timestamp:e.timestamp,isSelected:a===t,isFuture:a>t,onSelect:s},a))]})]})},an=({className:e="",time:t,message:a,params:r})=>{let{actionId:l,mode:i,runId:n,status:s,reason:o,error:d}=r,c=!!(o??d);/* @__PURE__ */
147
+ return ye("div",{className:m("border-ui-line flex flex-col border-b px-2 py-1",e),children:[
148
+ /* @__PURE__ */ye("div",{className:"flex items-center gap-2",children:[t&&/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:t}),
149
+ /* @__PURE__ */be("span",{className:"grow",children:a??l}),i&&/* @__PURE__ */be("span",{className:"bg-ui-raised rounded-sm px-1 text-[10px] uppercase",children:i}),
150
+ /* @__PURE__ */be("span",{className:m(c?"text-red-600 dark:text-red-400":"text-ui-fg-subtle"),children:o??s??""})]}),n&&/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle font-mono text-[10px]",children:["run ",n]}),d&&/* @__PURE__ */be("span",{className:"break-words text-red-600 dark:text-red-400",children:d})]})},rn=({title:e,action:t,duration:a,status:r,level:l,id:i,isSelected:n,onClick:s})=>{let o=de(()=>s(i),[i,s]);/* @__PURE__ */
151
+ return ye("div",{className:m("flex cursor-pointer items-center gap-2 border-l-2 px-2 py-1 transition-colors",1===l?"pl-5":"pl-2",{"border-l-violet-500 bg-violet-50 text-violet-700 dark:border-l-violet-500 dark:bg-violet-500/15 dark:text-violet-300":n,"text-ui-fg-subtle hover:bg-ui-hover hover:text-ui-fg border-l-transparent dark:border-l-transparent":!n}),onClick:o,children:[/* @__PURE__ */be("div",{className:m("h-2 w-2 shrink-0 rounded-full",{"bg-emerald-500":"success"===r,"bg-amber-500":"skipped"===r,"bg-ui-line-strong":"disabled"===r,"bg-ui-fg-subtle":"failed"===r}),title:r}),/* @__PURE__ */ye("div",{className:"flex min-w-0 grow justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"truncate",children:e}),/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex shrink-0 items-center gap-1.5",children:[/* @__PURE__ */be("span",{className:"font-mono",children:a}),t&&/* @__PURE__ */be("span",{className:"bg-ui-raised text-ui-fg-subtle rounded px-1 font-mono text-[10px]",children:t})]})]})]})},ln=({className:e,nodeId:t,nodes:a,selected:r,onSelect:l})=>{let i=pe(()=>{let e=c(a,t),r=[];for(;e;){let{node:l,startTime:i,endTime:n}=e,s=`${b(i,n)}ms`,o=l.id===t?0:1;r.push({id:l.id,action:l.action,title:l.title,status:e.status,level:o,duration:s}),e=c(a,l.afterNode)}return r},[t,a]),n=de(e=>l?.(e),[l]);/* @__PURE__ */
152
+ return ye("div",{className:m("flex flex-col gap-1.5",e),children:[/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex items-center gap-1.5 px-2 text-[10px] font-semibold tracking-wider uppercase",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-code-merge"}),"Execution Tree"]}),/* @__PURE__ */be("div",{className:"flex flex-col",children:i.map((e,t)=>/* @__PURE__ */be(rn,{id:e.id,action:e.action,title:e.title,duration:e.duration,status:e.status,level:e.level,isSelected:e.id===r,onClick:n},t))})]})},nn=({duration:e,status:t,type:a,action:r})=>/* @__PURE__ */ye("div",{className:"bg-ui-raised grid grid-cols-2 gap-x-3 gap-y-0.5 rounded p-2",children:[
153
+ /* @__PURE__ */ye("div",{className:"flex gap-1.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Duration"}),/* @__PURE__ */be("span",{className:"text-ui-fg font-mono",children:e})]}),
154
+ /* @__PURE__ */ye("div",{className:"flex gap-1.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Type"}),/* @__PURE__ */be("span",{className:"text-ui-fg",children:a})]}),
155
+ /* @__PURE__ */ye("div",{className:"flex gap-1.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Status"}),/* @__PURE__ */be("span",{className:"text-ui-fg",children:t})]}),
156
+ /* @__PURE__ */ye("div",{className:"flex gap-1.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Action"}),/* @__PURE__ */be("span",{className:"text-ui-fg",children:r})]})]}),sn=e=>"number"==typeof e||"string"==typeof e&&!e.includes(",")&&!Number.isNaN(parseFloat(e)),on=(e,t=!1)=>{let{field:a,value:r}=e;return t?{[a]:{$not:{$regex:r,$options:"i"}}}:{[a]:{$regex:r,$options:"i"}}},dn=(e,t=!1)=>{let{field:a,value:r}=e;return t?{[a]:{$not:{$regex:`^${r}`,$options:"i"}}}:{[a]:{$regex:`^${r}`,$options:"i"}}},cn=(e,t=!1)=>{let{field:a,value:r}=e;return t?{[a]:{$not:{$regex:`${r}$`,$options:"i"}}}:{[a]:{$regex:`${r}$`,$options:"i"}}},un=(e,t=!1)=>{let{field:a}=e;return t?{[a]:{$ne:""}}:{[a]:""}},mn=(e,t=!1)=>{let{field:a,value:r}=e,l=[];return"string"==typeof r&&r.includes(",")?l=r.split(",").map(e=>e.trim()):("string"==typeof r||"number"==typeof r)&&(l=[r]),t?{[a]:{$nin:l}}:{[a]:{$in:l}}};function pn(e,t=!1,a={}){if(!e)return{};let{combinator:r,rules:l,enabled:i}=e;if(!Array.isArray(l)||!1===i)return{};let n=l.filter(e=>!1!==e.enabled).map(e=>"rules"in e?pn(e,t,a):((e,t)=>{if(!e)return{};let{isBinding:a}=e;a&&(e=((e,t)=>{let{isBinding:a}=e;return a?{...e,value:c(t,e.value,e.value)}:e})(e,t));let{operator:r}=e;switch(r){case"=":case"!=":case"<":case">":case"<=":case">=":return(e=>{let{field:t,operator:a,value:r}=e;switch(a){case"=":return{[t]:r};case"!=":return{[t]:{$ne:r}};case"<":return"string"==typeof r&&sn(r)?{[t]:{$lt:parseFloat(r)}}:{[t]:{$lt:r}};case">":return"string"==typeof r&&sn(r)?{[t]:{$gt:parseFloat(r)}}:{[t]:{$gt:r}};case"<=":return"string"==typeof r&&sn(r)?{[t]:{$lte:parseFloat(r)}}:{[t]:{$lte:r}};case">=":return"string"==typeof r&&sn(r)?{[t]:{$gte:parseFloat(r)}}:{[t]:{$gte:r}};default:return{}}})(e);case"contains":return on(e);case"doesNotContain":return on(e,!0);case"beginsWith":return dn(e);case"doesNotBeginWith":return dn(e,!0);case"endsWith":return cn(e);case"doesNotEndWith":return cn(e,!0);case"empty":return un(e);case"notEmpty":return un(e,!0);case"in":return mn(e);case"notIn":return mn(e,!0);case"between":return(e=>{let{field:t,value:a}=e,r=[];return"string"==typeof a&&a.includes(",")&&(r=a.split(",").map(e=>e.trim())),r.length<2?{[t]:!1}:$e(r[0])&&$e(r[1])?{[t]:{$gte:new Date(r[0]),$lte:new Date(r[1])}}:{[t]:{$gte:r[0],$lte:r[1]}}})(e);default:return{}}})(e,a));return t?n:n.length?1===n.length?n[0]:{[`$${r}`]:n}:{}}var hn=(e,t=!1)=>{let{field:a,value:r}=e;return`${a}${t?" not":""} like '%${r}%'`},fn=(e,t=!1)=>{let{field:a,value:r}=e;return`${a}${t?" not":""} like '${r}%'`},gn=(e,t=!1)=>{let{field:a,value:r}=e;return`${a}${t?" not":""} like '%${r}'`},xn=(e,t=!1)=>{let{field:a}=e;return`${a} is${t?" not":""} NULL`},vn=(e,t=!1)=>{let{field:a,value:r}=e,l=[];return"string"==typeof r&&r.includes(",")?l=r.split(","):("string"==typeof r||"number"==typeof r)&&(l=[r.toString()]),0!==l.length&&`${a}${t?" not":""} in (${l.map(e=>`'${e.trim()}'`).join(", ")})`},bn=(e,t=!1)=>{let{field:a,value:r}=e,l=[];return"string"==typeof r&&(l=r.split(",").map(e=>e.trim())),!(l.length<2)&&($e(l[0])&&$e(l[1])?`${a}${t?" not":""} between DATE '${l[0]}' and '${l[1]}'`:`${a}${t?" not":""} between '${l[0]}' and '${l[1]}'`)};function yn(e,t=!0,a={}){if(!e)return"";let{combinator:r,rules:l,enabled:i}=e;if(!Array.isArray(l)||!1===i)return"";let n=l.filter(e=>!1!==e.enabled).map(e=>"rules"in e?`(${t?yn(e,t,a).toString():yn(e,t,a)})`:((e,t)=>{if(!e)return{};let{isBinding:a}=e;a&&(e=((e,t)=>e.isBinding?{...e,value:c(t,e.value,e.value)}:e)(e,t));let{operator:r}=e;switch(r){case"=":case"!=":case"<":case">":case"<=":case">=":return(e=>{let{field:t,value:a,operator:r}=e;return"boolean"==typeof a?`${t} ${r} ${a?"TRUE":"FALSE"}`:"string"!=typeof a||sn(a)?"number"==typeof a||sn(a)?`${t} ${r} ${a}`:$e(a)?`${t} ${r} DATE '${a.toString()}'`:`${t} ${r} '${JSON.stringify(a)}'`:`${t} ${r} '${a}'`})(e);case"contains":return hn(e);case"doesNotContain":return!hn(e,!0);case"beginsWith":return fn(e);case"doesNotBeginWith":return fn(e,!0);case"endsWith":return gn(e);case"doesNotEndWith":return gn(e,!0);case"empty":return xn(e);case"notEmpty":return xn(e,!0);case"in":return vn(e);case"notIn":return vn(e,!0);case"between":return bn(e);case"notBetween":return bn(e,!0);default:return!1}})(e,a));return t?n:n.join(` ${r} `)}var Nn=e=>{if(!e||"object"!=typeof e)return;let{combinator:t,enabled:a}=e,{rules:r}=e;return Array.isArray(r)?(r=r.map(e=>{if((e=>"rules"in e)(e))return Nn(e);let{field:t,value:a,operator:r,enabled:l,isBinding:i}=e;return{field:t,value:a,operator:r,enabled:l,isBinding:i}}).filter(Boolean),{rules:r,combinator:t,enabled:a}):void 0},wn=(e,t,a,r=!1)=>{let{rules:l,enabled:i}=e;if(!Array.isArray(l)||!1===i)return{};let n=l.filter(e=>!1!==e.enabled).flatMap(e=>"rules"in e?wn(e,t,a,!0):e);return r?n:n.reduce((e,r)=>{let{field:l,isBinding:i,value:n}=r;return i&&s(e,n,c(t,n,a)),s(e,l,c(t,l,a)),e},{})};var kn=({when:e,whenParams:a})=>{let r=pe(()=>e&&0!==Object.keys(e).length?Ie(JSON.stringify(((e,t={},a)=>wn((e=>Nn(e))(e),t,a))(e,a),null,2)):"",[a,e]);return r?/* @__PURE__ */ye("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-[10px] font-semibold tracking-wider uppercase",children:"Params"}),/* @__PURE__ */be("pre",{className:"bg-ui-raised overflow-auto rounded p-2 font-mono text-xs leading-5",dangerouslySetInnerHTML:{__html:t(r)}})]}):null},Sn=({when:e})=>{let t=pe(()=>e&&function(e,t="sql",a=!1,r={}){return"mongodb"===t?pn(e,a,r):yn(e,a,r)}(e)||null,[e]);return t?/* @__PURE__ */ye("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-[10px] font-semibold tracking-wider uppercase",children:"Condition"}),/* @__PURE__ */be("span",{className:"text-ui-fg break-all",children:t})]}):null},Cn=({whenParams:e,name:t="Node Title",startTime:a=0,endTime:r=0,status:l="notStarted",when:i,type:n,action:s})=>{let o=pe(()=>`${b(a,r)}ms`,[a,r]);/* @__PURE__ */
157
+ return ye("div",{className:"text-ui-fg flex w-full flex-col gap-2 p-2",children:[
158
+ /* @__PURE__ */be("div",{className:"text-ui-fg truncate font-semibold",children:t}),
159
+ /* @__PURE__ */be(nn,{duration:o,status:l,type:n,action:s}),
160
+ /* @__PURE__ */be(Sn,{when:i}),
161
+ /* @__PURE__ */be(kn,{when:i,whenParams:e})]})},$n=({className:e,node:t,nodes:a})=>{let[r,l]=ge(t.id),i=pe(()=>c(a,`${r}`),[r,a]),n=de(e=>l(e),[]);/* @__PURE__ */
162
+ return ye("div",{className:m("flex",e),children:[
163
+ /* @__PURE__ */be(ln,{className:"grow basis-0",nodeId:t.id,nodes:a,selected:r,onSelect:n}),
164
+ /* @__PURE__ */be("div",{className:"bg-ui-raised mx-1 w-px shrink-0"}),r&&/* @__PURE__ */be("div",{className:"flex min-w-0 grow basis-0",children:/* @__PURE__ */be(Cn,{whenParams:i.whenParams,status:i.status,name:i.node.title,startTime:i.startTime,endTime:i.endTime,when:i.node.when,type:i.node.type,action:i.node.action})})]})},jn=({triggerName:t,startTime:a,endTime:r,duration:l,elementId:i,hostElementId:n})=>{let[s]=ae("schema.flat"),o=pe(()=>i?c(s,i):void 0,[i,s]),d=pe(()=>e(a,"HH:mm:ss.SSS"),[a]),u=pe(()=>e(r,"HH:mm:ss.SSS"),[r]),m=pe(()=>{if(typeof document<"u")return document.querySelector(`[data-id="${i}"]`)},[i]),p=de(()=>{m?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[m]),[h,f]=ge(!1);Bi(h?i:void 0);let g=de(()=>f(!0),[]),x=de(()=>f(!1),[]);/* @__PURE__ */
165
+ return ye("div",{className:"flex justify-around gap-3",children:[
166
+ /* @__PURE__ */ye("div",{className:"flex min-w-0 grow basis-0 flex-col",children:[/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider uppercase",children:[/* @__PURE__ */be("i",{className:"fa-regular fa-clock"}),"Times"]}),/* @__PURE__ */ye("div",{className:"text-ui-fg flex flex-col gap-0.5 font-mono",children:[
167
+ /* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Start"}),d]}),
168
+ /* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"End"}),u]}),
169
+ /* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Duration"}),l]})]})]}),
170
+ /* @__PURE__ */be("div",{className:"bg-ui-raised w-px shrink-0"}),
171
+ /* @__PURE__ */ye("div",{className:"flex min-w-0 grow basis-0 flex-col",children:[/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider uppercase",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-circle-info"}),"Details"]}),/* @__PURE__ */ye("div",{className:"text-ui-fg flex flex-col gap-0.5",children:[
172
+ /* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Type"}),/* @__PURE__ */be("span",{children:"Interaction"})]}),
173
+ /* @__PURE__ */ye("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0",children:"Trigger"}),/* @__PURE__ */be("span",{className:"truncate",children:t})]}),n&&/* @__PURE__ */ye("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0",children:"Fired on"}),/* @__PURE__ */be("span",{className:"truncate font-mono",children:n})]}),
174
+ /* @__PURE__ */ye("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0",children:"Element"}),/* @__PURE__ */ye("span",{className:"cursor-pointer truncate text-violet-600 hover:text-violet-500 dark:text-violet-400 dark:hover:text-violet-300",onClick:p,onMouseEnter:g,onMouseLeave:x,children:[o?.definition.label,i&&/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle ml-1 font-mono text-[10px]",children:["[",i,"]"]})]})]})]})]})]})},Tn=({node:e,nodes:t,startTime:a,endTime:r,duration:l,elementId:i,hostElementId:n})=>/* @__PURE__ */ye("div",{className:"border-ui-line mx-2 my-1.5 flex flex-col gap-2 overflow-hidden rounded border text-xs",children:[/* @__PURE__ */be("div",{className:"bg-ui-raised px-3 py-2",children:/* @__PURE__ */be(jn,{triggerName:e.title,startTime:a,endTime:r,duration:l,elementId:i,hostElementId:n})}),/* @__PURE__ */be("div",{className:"border-ui-line border-t",children:/* @__PURE__ */be($n,{node:e,nodes:t,className:"gap-0"})})]}),In={danger:"fa-regular fa-circle-xmark",warning:"fa-solid fa-triangle-exclamation",info:"fa-solid fa-circle-info",success:"fa-solid fa-check"},Ln={danger:"Error",warning:"Warning",info:"Info",success:"Success"},En=({className:e,logType:t="info",iconClassName:a,children:r})=>/* @__PURE__ */ye("div",{className:m("flex items-center gap-1 rounded px-1.5 py-0.5 font-medium",{"bg-red-50 text-red-600 dark:bg-red-500/15 dark:text-red-400":"danger"===t,"bg-amber-50 text-amber-700 dark:bg-amber-500/15 dark:text-amber-400":"warning"===t,"bg-violet-50 text-violet-700 dark:bg-violet-500/15 dark:text-violet-400":"info"===t,"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400":"success"===t,"bg-ui-active text-ui-fg-muted":!["danger","warning","info","success"].includes(t)},e),children:[/* @__PURE__ */be("i",{className:m(a??In[t],"text-[10px]")}),r??Ln[t]]}),Rn=({status:e,message:t,time:a})=>/* @__PURE__ */ye("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
175
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 font-mono tabular-nums",children:a}),"completed"===e&&/* @__PURE__ */be(En,{logType:"success",children:"Completed"}),"failed"===e&&/* @__PURE__ */be(En,{logType:"danger",children:"Failed"}),"skipped"===e&&/* @__PURE__ */be(En,{logType:"custom",iconClassName:"fa-solid fa-forward-step",children:"Skipped"}),
176
+ /* @__PURE__ */be("div",{className:"text-ui-fg grow basis-0 truncate",children:t})]}),An=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-right text-[10px]"}),Mn=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-down text-[10px]"}),Vn=e=>"string"==typeof e?e:JSON.stringify(e),zn=({label:e,children:t})=>/* @__PURE__ */ye("div",{className:"flex gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle w-24 shrink-0",children:e}),/* @__PURE__ */be("span",{className:"text-ui-fg min-w-0 grow break-words",children:t})]}),On=({time:e,message:t,params:a})=>{let{node:r,error:l,available:i,param:n,value:s}=a;/* @__PURE__ */
177
+ return ye(G,{className:"last:border-b-none border-b-ui-line hover:bg-ui-hover w-full border-b border-l-2 border-l-amber-500 px-2 py-1 transition-colors",collapsed:!0,children:[/* @__PURE__ */be(G.Header,{title:/* @__PURE__ */ye("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 font-mono tabular-nums",children:e}),/* @__PURE__ */be("div",{className:"text-ui-fg grow basis-0 truncate",children:t})]}),placement:"left",className:{headerTitle:"overflow-hidden",header:"hover:bg-transparent dark:hover:bg-transparent"},iconCollapsed:An,iconExpanded:Mn}),/* @__PURE__ */be(G.Content,{children:/* @__PURE__ */ye("div",{className:"border-ui-line mx-2 my-1.5 flex flex-col gap-1 rounded border px-3 py-2 text-xs",children:[r?.title&&/* @__PURE__ */be(zn,{label:"Step",children:r.title}),r?.action&&/* @__PURE__ */be(zn,{label:"Action",children:r.action}),r?.elementId&&/* @__PURE__ */be(zn,{label:"Element",children:r.elementId}),n&&/* @__PURE__ */be(zn,{label:"Param",children:n}),void 0!==s&&/* @__PURE__ */be(zn,{label:"Value",children:Vn(s)}),l&&/* @__PURE__ */be(zn,{label:"Error",children:l}),i&&/* @__PURE__ */be(zn,{label:"Registered",children:i.length>0?i.join(", "):"nothing on that element"})]})})]})},Dn=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-right text-[10px]"}),Fn=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-down text-[10px]"}),Bn=({time:e,message:t,params:{elementId:a,hostElementId:r,status:l,node:i,nodes:n,startTime:s=0,endTime:o=0}})=>{let d=pe(()=>`${b(s,o)}ms`,[s,o]),{failed:c,skipped:u,disabled:p}=pe(()=>{let e=Object.values(n).map(({status:e})=>e);return{failed:e.filter(e=>"failed"===e).length,skipped:e.filter(e=>"skipped"===e).length,disabled:e.filter(e=>"disabled"===e).length}},[n]);/* @__PURE__ */
178
+ return ye(G,{className:m("last:border-b-none border-b-ui-line hover:bg-ui-hover w-full border-b border-l-2 px-2 py-1 transition-colors",{"border-l-emerald-500":"completed"===l,"border-l-red-500":"failed"===l,"border-l-ui-line-strong":"skipped"===l}),collapsed:!0,children:[/* @__PURE__ */be(G.Header,{title:/* @__PURE__ */be(Rn,{status:l,message:t,time:e}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:Dn,iconExpanded:Fn,children:/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex gap-3",children:[!!c&&/* @__PURE__ */be(ql,{logType:"danger",title:"Failed",children:c}),"skipped"!==l&&!!u&&/* @__PURE__ */be(ql,{logType:"warning",title:"Skipped",children:u}),"skipped"!==l&&!!p&&/* @__PURE__ */be(ql,{logType:"custom",iconClassName:"fa-solid fa-ban",title:"Disabled",children:p}),d]})}),/* @__PURE__ */be(G.Content,{children:/* @__PURE__ */be(Tn,{elementId:a,hostElementId:r,node:i,nodes:n,startTime:s,endTime:o,duration:d})})]})},Jn=({time:e,message:t,params:a})=>(e=>void 0!==e.nodes)(a)?/* @__PURE__ */be(Bn,{time:e,message:t,params:a}):/* @__PURE__ */be(On,{time:e,message:t,params:a}),Pn=({elementId:t,startTime:a,endTime:r,duration:l})=>{let[i]=ae("schema.flat"),n=pe(()=>t?c(i,t):void 0,[t,i]);/* @__PURE__ */
179
+ return ye("div",{className:"m-2 flex justify-around gap-4",children:[
180
+ /* @__PURE__ */ye("div",{className:"flex min-w-0 grow basis-0 flex-col gap-2",children:[/* @__PURE__ */ye("div",{className:"flex items-center gap-1 font-bold",children:[/* @__PURE__ */be("i",{className:"fa-regular fa-clock"}),"Times"]}),/* @__PURE__ */ye("div",{className:"flex flex-col",children:[
181
+ /* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be("span",{children:"Started:"}),"string"==typeof a?a:e(a)]}),
182
+ /* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be("span",{children:"End:"}),"string"==typeof r?r:e(r)]}),
183
+ /* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be("span",{children:"Duration:"}),l]})]})]}),
184
+ /* @__PURE__ */be("div",{className:"border-ui-line-strong border-r"}),
185
+ /* @__PURE__ */ye("div",{className:"flex min-w-0 grow basis-0 flex-col gap-2",children:[/* @__PURE__ */ye("div",{className:"flex items-center gap-1",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-circle-info"}),"Details"]}),/* @__PURE__ */ye("div",{className:"flex flex-col",children:[
186
+ /* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be("span",{children:"Type:"}),/* @__PURE__ */be("span",{children:"Navigation"})]}),
187
+ /* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be("span",{children:"Trigger:"}),/* @__PURE__ */be("span",{className:"truncate",children:"-"})]}),n&&/* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be("span",{children:"Element:"}),/* @__PURE__ */ye("span",{className:"cursor-pointer truncate text-blue-500",children:[n.definition.label," [",t,"]"]})]})]})]})]})},Wn=({status:t,message:a,time:r})=>{let{logType:l,statusMessage:i}=pe(()=>"normal"===t?{logType:"success",statusMessage:"Success"}:"redirect"===t?{logType:"warning",statusMessage:"Redirected"}:"notFound"===t?{logType:"warning",statusMessage:"Not Found"}:"accessDenied"===t?{logType:"danger",statusMessage:"Access Denied"}:{logType:"custom",statusMessage:""},[t]);/* @__PURE__ */
188
+ return ye("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
189
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 font-mono tabular-nums",children:"string"==typeof r?r:e(r)}),
190
+ /* @__PURE__ */be(En,{logType:l,children:i}),
191
+ /* @__PURE__ */be("div",{className:"text-ui-fg grow basis-0 truncate",children:a})]})},qn=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-right text-[10px]"}),Un=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-down text-[10px]"}),Hn=({time:e,message:t,params:a})=>/* @__PURE__ */ye(G,{className:m("last:border-b-none border-b-ui-line hover:bg-ui-hover w-full border-b border-l-2 px-2 py-1 transition-colors",{"border-l-emerald-500":"normal"===a?.status,"border-l-red-500":"accessDenied"===a?.status,"border-l-amber-500":"normal"!==a?.status&&"accessDenied"===a?.status}),collapsed:!0,children:[/* @__PURE__ */be(G.Header,{title:/* @__PURE__ */be(Wn,{status:a?.status,message:t,time:e}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:qn,iconExpanded:Un,children:/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"0ms"})}),/* @__PURE__ */be(G.Content,{children:/* @__PURE__ */be(Pn,{elementId:a?.elementId,startTime:e,endTime:e,duration:"0ms"})})]}),Kn=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-right text-[10px]"}),Qn=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-down text-[10px]"}),_n=({time:e,message:t,params:{event:a,issues:r,payload:l}})=>/* @__PURE__ */ye(G,{className:"last:border-b-none border-b-ui-line hover:bg-ui-hover w-full border-b border-l-2 border-l-red-500 px-2 py-1 transition-colors",collapsed:!0,children:[/* @__PURE__ */be(G.Header,{title:/* @__PURE__ */ye("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
192
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 font-mono tabular-nums",children:e}),
193
+ /* @__PURE__ */be(En,{logType:"danger",children:"Invalid"}),
194
+ /* @__PURE__ */be("div",{className:"text-ui-fg grow basis-0 truncate",children:t})]}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:Kn,iconExpanded:Qn,children:/* @__PURE__ */be("span",{className:"text-ui-fg-subtle font-mono",children:a})}),/* @__PURE__ */be(G.Content,{children:/* @__PURE__ */ye("div",{className:"flex flex-col gap-1 py-1 pl-4",children:[r.map(e=>/* @__PURE__ */ye("div",{className:"flex gap-2",children:[/* @__PURE__ */be("span",{className:"font-mono text-red-600 dark:text-red-400",children:e.path||"(root)"}),/* @__PURE__ */be("span",{className:"text-ui-fg-muted",children:e.message})]},`${e.path}-${e.message}`)),void 0!==l&&/* @__PURE__ */be("pre",{className:"bg-ui-raised text-ui-fg-muted mt-1 overflow-x-auto rounded p-2 text-[11px]",children:JSON.stringify(l,null,2)})]})})]}),Xn=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-right text-[10px]"}),Zn=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-down text-[10px]"}),Gn={status:"Status",received:"In",published:"Out",refused:"Refused"},Yn=e=>{switch(e.event){case"received":return e.message;case"published":return{data:e.data,delivered:e.delivered};case"status":return{topics:e.topics,transport:e.transport};case"refused":return{reason:e.reason}}},es=({logType:e,time:t,message:a,params:r})=>/* @__PURE__ */ye(G,{className:"last:border-b-none border-b-ui-line hover:bg-ui-hover w-full border-b border-l-2 border-l-sky-500 px-2 py-1 transition-colors",collapsed:!0,children:[/* @__PURE__ */be(G.Header,{title:/* @__PURE__ */ye("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
195
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 font-mono tabular-nums",children:t}),
196
+ /* @__PURE__ */be(En,{logType:e,children:Gn[r.event]}),
197
+ /* @__PURE__ */be("div",{className:"text-ui-fg grow basis-0 truncate",children:a})]}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:Xn,iconExpanded:Zn,children:/* @__PURE__ */be("span",{className:"text-ui-fg-subtle font-mono",children:"realtime"})}),/* @__PURE__ */be(G.Content,{children:/* @__PURE__ */be("pre",{className:"bg-ui-raised text-ui-fg-muted mt-1 overflow-x-auto rounded p-2 text-[11px]",children:JSON.stringify(Yn(r),null,2)})})]}),ts=e=>{if(null==e)return"";if("function"==typeof e)return"Function";try{return JSON.stringify(e,null,2)}catch{return String(e)}},as=({path:e,prev:t,next:a,contextLines:r=10})=>{let l=fe(null),[i,n]=ge(0),s=pe(()=>((e,t)=>{let a=ts(e).split("\n"),r=ts(t).split("\n"),l=a.length,i=r.length,n=Array.from({length:l+1},()=>Array(i+1).fill(0));for(let c=1;c<=l;c++)for(let e=1;e<=i;e++)n[c][e]=a[c-1]===r[e-1]?n[c-1][e-1]+1:Math.max(n[c-1][e],n[c][e-1]);let s=[],o=l,d=i;for(;o>0||d>0;)o>0&&d>0&&a[o-1]===r[d-1]?(s.unshift({type:"same",text:a[o-1]}),o--,d--):d>0&&(0===o||n[o][d-1]>=n[o-1][d])?(s.unshift({type:"added",text:r[d-1]}),d--):(s.unshift({type:"removed",text:a[o-1]}),o--);return s})(t,a),[t,a]),o=pe(()=>(e=>{let t=[],a=-1;for(let r=0;r<e.length;r++)"same"===e[r].type?-1!==a&&(t.push({start:a,end:r-1}),a=-1):-1===a&&(a=r);return-1!==a&&t.push({start:a,end:e.length-1}),t})(s),[s]),d=pe(()=>((e,t,a)=>{if(0===t.length)return e.map((e,t)=>({kind:"line",line:e,diffIndex:t,hunkIndex:null}));let r=[],l=-1;return t.forEach((i,n)=>{let s=Math.max(0,i.start-a),o=Math.min(e.length-1,i.end+a);s>l+1&&r.push({kind:"separator",hunkIndex:n,total:t.length});for(let t=Math.max(s,l+1);t<=o;t++){let a=t>=i.start&&t<=i.end;r.push({kind:"line",line:e[t],diffIndex:t,hunkIndex:a?n:null})}l=o}),r})(s,o,r),[s,o,r]),c=o.length>0,u=0===i,p=i===o.length-1,h=de(e=>{(l.current?.querySelector(`[data-hunk="${e}"]`))?.scrollIntoView({block:"center"})},[]),f=de(e=>{let t=i+e;t<0||t>=o.length||(n(t),h(t))},[i,o.length,h]),g=me(()=>{c&&(n(0),h(0))});ue(()=>g(),[s]);let x=de(()=>f(-1),[f]),v=de(()=>f(1),[f]);/* @__PURE__ */
198
+ return ye("div",{className:"border-ui-line bg-ui-raised mx-2 my-1.5 flex flex-col gap-2 rounded border font-mono",children:[/* @__PURE__ */ye("div",{className:"border-ui-line flex items-center justify-between border-b px-2 py-1",children:[/* @__PURE__ */ye("div",{className:"flex min-w-0 items-center gap-1.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0",children:"path"}),/* @__PURE__ */be("span",{className:"text-ui-fg-subtle truncate",children:e??"(full state)"})]}),/* @__PURE__ */ye("div",{className:"flex shrink-0 items-center gap-2",children:[c&&/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle tabular-nums",children:[i+1,"/",o.length]}),
199
+ /* @__PURE__ */be("button",{className:m("bg-ui-active text-ui-fg-muted hover:bg-ui-hover rounded px-2 py-0.5 text-xs transition-colors",{"cursor-not-allowed opacity-30 dark:cursor-not-allowed dark:opacity-30":!c||u}),disabled:!c||u,onClick:x,children:"↑ Prev"}),
200
+ /* @__PURE__ */be("button",{className:m("bg-ui-active text-ui-fg-muted hover:bg-ui-hover rounded px-2 py-0.5 text-xs transition-colors",{"cursor-not-allowed opacity-30 dark:cursor-not-allowed dark:opacity-30":!c||p}),disabled:!c||p,onClick:v,children:"↓ Next"})]})]}),/* @__PURE__ */ye("pre",{ref:l,className:"bg-ui-raised max-h-64 overflow-auto text-xs leading-5",children:[!c&&/* @__PURE__ */be("div",{className:"text-ui-fg-subtle px-3 py-2 italic",children:"No changes"}),d.map((e,t)=>{if("separator"===e.kind){let a=e.hunkIndex===i;/* @__PURE__ */
201
+ return ye("div",{"data-hunk":e.hunkIndex,className:m("px-3",{"bg-violet-50 text-violet-600 dark:bg-violet-900/40 dark:text-violet-400":a,"text-ui-fg-subtle":!a}),children:["@@ hunk ",e.hunkIndex+1,"/",e.total," @@"]},`sep-${t}`)}let{line:a,diffIndex:r,hunkIndex:l}=e,n=l===i;return"removed"===a.type?/* @__PURE__ */ye("div",{"data-hunk":l??void 0,className:m("px-3",{"bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-300":n,"bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400":!n}),children:["- ",a.text]},r):"added"===a.type?/* @__PURE__ */ye("div",{"data-hunk":l??void 0,className:m("px-3",{"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300":n,"bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400":!n}),children:["+ ",a.text]},r):/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle px-3",children:[" ",a.text]},r)})]})]})},rs=({storeName:t,path:a,message:r,time:l})=>/* @__PURE__ */ye("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
202
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 font-mono tabular-nums",children:"string"==typeof l?l:e(l)}),
203
+ /* @__PURE__ */be(En,{logType:"info",children:"Store"}),t&&/* @__PURE__ */be("span",{className:"text-ui-fg shrink-0 font-semibold",children:t}),
204
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle truncate font-mono",children:a??r??"(full state)"})]}),ls=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-right text-[10px]"}),is=/* @__PURE__ */be("i",{className:"fa-solid fa-angle-down text-[10px]"}),ns=({time:e,message:t,params:a})=>/* @__PURE__ */ye(G,{className:"last:border-b-none border-b-ui-line hover:bg-ui-hover w-full border-b border-l-2 border-l-violet-500 px-2 py-1 transition-colors",collapsed:!0,children:[/* @__PURE__ */be(G.Header,{title:/* @__PURE__ */be(rs,{storeName:a?.storeName,path:a?.path,message:t,time:e}),placement:"left",className:{headerTitle:"overflow-hidden",header:"hover:bg-transparent dark:hover:bg-transparent"},iconCollapsed:ls,iconExpanded:is}),/* @__PURE__ */be(G.Content,{children:/* @__PURE__ */be(as,{path:a?.path,prev:a?.prev,next:a?.next})})]}),ss=se(({log:e})=>{let{message:t,time:a}=e;switch(e.category){case"interactions":/* @__PURE__ */return be(Jn,{message:t,params:e.params,time:a});case"navigation":/* @__PURE__ */return be(Hn,{message:t,params:e.params,time:a});case"store":/* @__PURE__ */return be(ns,{message:t,params:e.params,time:a});case"network":/* @__PURE__ */return be(_n,{message:t,params:e.params,time:a});case"actions":/* @__PURE__ */return be(an,{message:t,params:e.params,time:a});case"realtime":/* @__PURE__ */return be(es,{logType:e.logType,message:t,params:e.params,time:a});case"eventBridge":return null}}),os=({className:e,amount:t,suffix:a="All",selected:r,logType:l,onClick:i})=>{let n=de(()=>i?.(l),[i,l]);/* @__PURE__ */
205
+ return ye("div",{className:m("flex cursor-pointer items-center gap-2 px-2 py-1.5 transition-colors",r?"bg-ui-active":"hover:bg-ui-hover",e),onClick:n,children:[
206
+ /* @__PURE__ */be("i",{className:m("text-xs",{"fa-regular fa-circle-xmark text-red-500 dark:text-red-400":"danger"===l,"fa-solid fa-triangle-exclamation text-amber-500 dark:text-amber-400":"warning"===l,"fa-solid fa-circle-info text-violet-500 dark:text-violet-400":"info"===l,"fa-solid fa-check text-emerald-500 dark:text-emerald-400":"success"===l,"fa-solid fa-list text-ui-fg-subtle":!l||!["danger","warning","info","success"].includes(l)})}),
207
+ /* @__PURE__ */be("span",{className:"text-ui-fg font-medium tabular-nums",children:t}),
208
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-xs",children:a})]})},ds=({className:e,orientation:t="horizontal",items:a,logTypeSelected:r,onClick:l})=>{let i=pe(()=>a.reduce((e,t)=>{let{logType:a}=t;return e[a]||(e[a]=0),{...e,[a]:++e[a]}},{}),[a]),n=de(e=>l?.(e),[l]);/* @__PURE__ */
209
+ return ye("div",{className:m("border-ui-line flex shrink-0 select-none","horizontal"===t?"flex-col border-r":"border-b",e),children:[
210
+ /* @__PURE__ */be(os,{onClick:n,amount:a.length,selected:!r}),
211
+ /* @__PURE__ */be(os,{onClick:n,amount:i.danger??0,suffix:"Errors",logType:"danger",selected:"danger"===r}),
212
+ /* @__PURE__ */be(os,{onClick:n,amount:i.warning??0,suffix:"Warnings",logType:"warning",selected:"warning"===r}),
213
+ /* @__PURE__ */be(os,{onClick:n,amount:i.info??0,suffix:"Info",logType:"info",selected:"info"===r})]})},cs=({items:e=[],autoScrollOffset:t=40,orientation:a="horizontal",logTypeFilter:r,onClear:l})=>{let[i,n]=ge(r),s=fe(null),o=fe(!0);ue(()=>{let e=s.current;e&&o.current&&(e.scrollTop=0)},[e]);let d=de(()=>{let e=s.current;e&&(o.current=e.scrollTop<=t)},[t]),c=de(e=>{n(e)},[]);/* @__PURE__ */
214
+ return ye("div",{className:"flex h-full w-full flex-col",children:[/* @__PURE__ */ye("div",{className:"border-ui-line bg-ui-raised flex shrink-0 items-center justify-between border-b px-2 py-1",children:[/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle font-mono",children:[e.length," ",1===e.length?"entry":"entries"]}),/* @__PURE__ */ye("button",{className:"text-ui-fg-subtle hover:bg-ui-hover hover:text-ui-fg rounded px-2 py-0.5 text-xs transition-colors",onClick:l,children:[/* @__PURE__ */be("i",{className:"fa-solid fa-trash-can mr-1"}),"Clear"]})]}),/* @__PURE__ */ye("div",{className:m("flex h-full w-full overflow-hidden",{"grow basis-0 flex-col":"vertical"===a}),children:[/* @__PURE__ */be(ds,{className:m({"h-full":"horizontal"===a}),logTypeSelected:i,items:e,orientation:a,onClick:c}),/* @__PURE__ */be("div",{ref:s,onScroll:d,className:"flex grow basis-0 flex-col overflow-y-auto",children:0===e.length?/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex grow flex-col items-center justify-center gap-2",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-terminal text-3xl opacity-20"}),/* @__PURE__ */be("span",{children:"No logs yet"})]}):e.map((e,t)=>({item:e,key:t})).filter(({item:e})=>!i||e.logType===i).reverse().map(({item:e,key:t})=>/* @__PURE__ */be(ss,{log:e},t))})]})]})},us={"local-custom":{label:"Shipped with this space",hint:"A file this deployment hands the server, compiled and rendered with everything else."},remote:{label:"Installed",hint:"A published bundle, described by the manifest it was published with."}},ms=({entry:e})=>{let{type:a,origin:r,version:l,author:i,settings:n}=e,s=pe(()=>n&&0!==Object.keys(n).length?Ie(JSON.stringify(n,null,2)):null,[n]);/* @__PURE__ */
215
+ return ye("div",{className:"flex h-full grow basis-0 flex-col overflow-y-auto p-4",children:[/* @__PURE__ */ye("div",{className:"border-ui-line mb-4 border-b pb-3",children:[/* @__PURE__ */be("div",{className:"text-ui-fg text-base font-semibold",children:a}),/* @__PURE__ */be("div",{className:"text-ui-fg-subtle text-xs",children:us[r].label})]}),/* @__PURE__ */ye("div",{className:"flex flex-col gap-3",children:[
216
+ /* @__PURE__ */ye("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-xs font-medium tracking-wider uppercase",children:"Where it comes from"}),/* @__PURE__ */be("span",{className:"text-ui-fg text-xs",children:us[r].hint})]}),
217
+ /* @__PURE__ */ye("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-xs font-medium tracking-wider uppercase",children:"Version"}),/* @__PURE__ */be("span",{className:"text-ui-fg font-mono text-xs",children:l??"—"})]}),
218
+ /* @__PURE__ */ye("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-xs font-medium tracking-wider uppercase",children:"Author"}),/* @__PURE__ */be("span",{className:"text-ui-fg text-xs",children:i??"—"})]}),
219
+ /* @__PURE__ */ye("div",{className:"flex flex-col gap-1",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-xs font-medium tracking-wider uppercase",children:"Settings"}),s?/* @__PURE__ */be("pre",{className:"bg-ui-raised overflow-auto rounded p-2 font-mono text-xs leading-5",dangerouslySetInnerHTML:{__html:t(s)}}):/* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-xs italic",children:"No settings"})]})]})]})},ps=({name:e,label:t,id:a,isSelected:r,className:l,onSelect:i})=>{let n=de(()=>i?.(a),[i,a]);/* @__PURE__ */
220
+ return be("div",{className:m("flex w-full cursor-pointer items-center gap-2 border-l-2 px-2 py-1.5 transition-colors",{"border-l-violet-500 bg-violet-50 text-violet-700 dark:border-l-violet-500 dark:bg-violet-500/15 dark:text-violet-300":r,"text-ui-fg-muted hover:bg-ui-hover hover:text-ui-fg border-l-transparent dark:border-l-transparent":!r},l),onClick:n,children:/* @__PURE__ */be("div",{className:"truncate",title:e,children:t??e})})},hs=({items:e=[],className:t,value:a,onSelect:r})=>{let[l,i]=ge(""),n=pe(()=>e.filter(e=>(e.name??"").toLowerCase().includes(l.toLowerCase())),[e,l]),s=pe(()=>"string"==typeof a?e.find(e=>e.id===a):a,[a,e]),o=de(e=>i(e),[]),d=de(t=>r?.(e.find(e=>e.id===t)),[e,r]);/* @__PURE__ */
221
+ return ye("div",{className:m("border-ui-line flex h-full flex-col gap-2 border-r",t),children:[/* @__PURE__ */be("div",{className:"px-2 pt-2",children:/* @__PURE__ */be(O,{value:l,onChange:o,placeholder:"Search...",size:"sm"})}),/* @__PURE__ */ye("div",{className:"text-ui-fg flex flex-col overflow-y-auto text-xs",children:[!n.length&&/* @__PURE__ */be("div",{className:"text-ui-fg-subtle p-4 text-center",children:"No items"}),n.length>0&&n.map((e,t)=>/* @__PURE__ */be(ps,{label:e.label,name:e.name,isSelected:s?.id===e.id,id:e.id,onSelect:d},t))]})]})},fs={"local-custom":"Shipped with this space",remote:"Installed"},gs=({className:e})=>{let{plugins:t}=oe(v),{components:a}=oe(l),r=a.current,i=pe(()=>{let e=/* @__PURE__ */new Map;return Object.entries(r).forEach(([t,a])=>{let{origin:r}=a;("local-custom"===r||"remote"===r)&&e.set(t,{type:t,origin:r,version:a.version})}),Object.entries(t).forEach(([t,a])=>{let r=e.get(t),{manifest:l}=a;e.set(t,{type:t,origin:r?.origin??"remote",version:l.version||r?.version,author:l.author,settings:a.settings})}),[...e.values()].map(e=>({...e,id:e.type,name:e.type,label:/* @__PURE__ */ye("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */be("span",{className:"capitalize",children:e.type}),/* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-[10px]",children:e.version??fs[e.origin]})]})}))},[t,r]),[n,s]=ge(),o=de(e=>s(e),[]);/* @__PURE__ */
222
+ return ye("div",{className:m("flex h-full w-full",e),children:[/* @__PURE__ */be(hs,{className:"w-[240px]",items:i,value:n,onSelect:o}),n?/* @__PURE__ */be(ms,{entry:n}):/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex grow flex-col items-center justify-center gap-2",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-puzzle-piece text-2xl opacity-30"}),/* @__PURE__ */be("span",{children:"Select a plugin"})]})]})},xs=()=>{let{settings:e,setCheck:t}=oe(Qe),a=De.every(t=>e.checks[t]),r=a?"None":"Run all",l=de(()=>De.forEach(e=>t(e,!a)),[t,a]);/* @__PURE__ */
223
+ return be("button",{type:"button",className:"hover:bg-ui-hover rounded px-1.5 py-0.5 font-medium normal-case",onClick:l,children:r})},vs="devtools-element-hovered",bs=({finding:{element:e,note:t}})=>{let a=e.getAttribute("data-plitzi-el"),r=de(()=>{e.scrollIntoView({block:"center",behavior:"smooth"}),e.classList.add(vs),setTimeout(()=>e.classList.remove(vs),1600)},[e]);/* @__PURE__ */
224
+ return ye("button",{type:"button",className:"hover:bg-ui-hover flex w-full cursor-pointer items-center gap-2 px-3 py-1 pl-6 text-left",onClick:r,children:[
225
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 font-mono",children:e.tagName.toLowerCase()}),a&&/* @__PURE__ */be("span",{className:"truncate font-mono text-violet-600 dark:text-violet-400",children:a}),
226
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle ml-auto shrink-0 text-[11px]",children:t})]})},ys=({check:e})=>{let{settings:t,setCheck:a,findings:r}=oe(Qe),{label:l,description:i,colour:n}=ut[e],s=t.checks[e],o=r[e],d=s?{backgroundColor:n}:{boxShadow:`inset 0 0 0 1.5px ${n}`},c=de(()=>a(e,!s),[a,e,s]);/* @__PURE__ */
227
+ return ye("div",{className:"border-ui-line border-b last:border-b-0",children:[/* @__PURE__ */ye("button",{type:"button",role:"switch","aria-checked":s,title:i,className:"hover:bg-ui-hover flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left",onClick:c,children:[
228
+ /* @__PURE__ */be("span",{className:"h-2.5 w-2.5 shrink-0 rounded-full",style:d}),
229
+ /* @__PURE__ */be("span",{className:"text-ui-fg min-w-0 truncate font-medium",children:l}),s&&/* @__PURE__ */be("span",{className:m("ml-auto rounded-full px-1.5 text-[10px] font-semibold",{"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400":0===o.length,"bg-rose-100 text-rose-700 dark:bg-rose-500/15 dark:text-rose-400":o.length>0}),children:o.length})]}),s&&o.length>0&&/* @__PURE__ */be("div",{className:"max-h-40 overflow-y-auto pb-1",children:o.slice(0,40).map((t,a)=>/* @__PURE__ */be(bs,{finding:t},`${e}-${String(a)}`))})]})},Ns=()=>{let{rescan:e}=oe(Qe),t=de(()=>e(),[e]);/* @__PURE__ */
230
+ return be("button",{type:"button",className:"hover:bg-ui-hover rounded px-1.5 py-0.5 font-medium normal-case",onClick:t,children:"Look again"})},ws=()=>/* @__PURE__ */ye("section",{className:"flex min-w-0 flex-col gap-1.5",children:[/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex items-center justify-between gap-2 text-[10px] font-semibold tracking-wider uppercase",children:[/* @__PURE__ */ye("span",{className:"flex items-center gap-2",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-list-check"}),"Checks"]}),/* @__PURE__ */ye("span",{className:"flex items-center gap-1",children:[/* @__PURE__ */be(Ns,{}),/* @__PURE__ */be(xs,{})]})]}),/* @__PURE__ */be("div",{className:"border-ui-line overflow-hidden rounded border",children:De.map(e=>/* @__PURE__ */be(ys,{check:e},e))})]}),ks=({name:e,children:t})=>/* @__PURE__ */ye("div",{className:"grid grid-cols-[88px_minmax(0,1fr)] items-baseline gap-2 py-0.5",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:e}),/* @__PURE__ */be("span",{className:"text-ui-fg min-w-0 truncate font-mono",children:t})]}),Ss={idle:"Copy",copied:"Copied",refused:"Not copied"},Cs=({rule:{selector:e,declarations:t,media:a}})=>{let[r,l]=ge("idle"),i=de(()=>{h(`${e} { ${t} }`).then(e=>{l(e?"copied":"refused"),setTimeout(()=>l("idle"),1200)})},[e,t]);/* @__PURE__ */
231
+ return ye("div",{className:"group border-ui-line border-b px-2.5 py-1.5 last:border-b-0",children:[/* @__PURE__ */ye("div",{className:"flex items-center gap-2",children:[
232
+ /* @__PURE__ */be("span",{className:"min-w-0 truncate font-mono text-violet-700 dark:text-violet-300",title:e,children:e}),a&&/* @__PURE__ */ye("span",{className:"shrink-0 font-mono text-[10px] text-amber-600 dark:text-amber-400",children:["@media ",a]}),
233
+ /* @__PURE__ */be("button",{type:"button",className:"text-ui-fg-subtle hover:bg-ui-hover hover:text-ui-fg ml-auto shrink-0 rounded px-1 text-[10px] opacity-0 group-hover:opacity-100",onClick:i,title:"refused"===r?F:void 0,children:Ss[r]})]}),/* @__PURE__ */be("div",{className:"text-ui-fg-muted mt-0.5 font-mono text-[11px] leading-relaxed break-words",children:t})]})},$s=/^(\*|:root|:host|html|body|::?before|::?after|::backdrop|::?marker)$/,js=e=>e.split(",").every(e=>$s.test(e.trim())),Ts=e=>e.includes("[data-plitzi-qa")||e.includes("devtools-element-"),Is=e=>[...e].every(e=>e.startsWith("--tw-")),Ls=(e,t)=>t?e.includes("&")?e.replaceAll("&",`:is(${t})`):`:is(${t}) ${e}`:e,Es=(e,t)=>{try{return e.matches(t)}catch{return!1}},Rs=(e,t,a,r,l)=>{let i=e.ownerDocument.defaultView;for(let n of t){if(a.length>=60)return;if(n instanceof CSSStyleRule){let t=Ls(n.selectorText,r);n.style.length>0&&!js(n.selectorText)&&!Ts(n.selectorText)&&!Is(n.style)&&Es(e,t)&&a.push({selector:n.selectorText,declarations:n.style.cssText,...l?{media:l}:{}}),n.cssRules.length>0&&Rs(e,n.cssRules,a,t,l)}else n instanceof CSSMediaRule?("function"!=typeof i?.matchMedia||i.matchMedia(n.media.mediaText).matches)&&Rs(e,n.cssRules,a,r,n.media.mediaText):n instanceof CSSGroupingRule&&Rs(e,n.cssRules,a,r,l)}},As=({element:e})=>{let{setPinned:t}=oe(Qe),a=pe(()=>Ct(e),[e]),r=pe(()=>(e=>{let t=[];for(let a of e.ownerDocument.styleSheets)try{Rs(e,a.cssRules,t,void 0,void 0)}catch{}return t})(e),[e]),l=de(()=>e.scrollIntoView({block:"center",behavior:"smooth"}),[e]),i=de(()=>t(void 0),[t]);return a?/* @__PURE__ */ye("div",{className:"flex min-w-0 flex-col gap-2",children:[
234
+ /* @__PURE__ */ye("div",{className:"flex items-center gap-2",children:[
235
+ /* @__PURE__ */be("span",{className:"min-w-0 truncate font-mono font-semibold text-violet-700 dark:text-violet-300",children:a.name}),
236
+ /* @__PURE__ */ye("span",{className:"text-ui-fg-subtle shrink-0 font-mono",children:[a.width," × ",a.height]}),
237
+ /* @__PURE__ */be("button",{type:"button",className:"hover:bg-ui-hover ml-auto shrink-0 rounded px-1.5 py-0.5",title:"Scroll the page to it",onClick:l,children:/* @__PURE__ */be("i",{className:"fa-solid fa-crosshairs"})}),
238
+ /* @__PURE__ */be("button",{type:"button",className:"hover:bg-ui-hover shrink-0 rounded px-1.5 py-0.5",title:"Let it go",onClick:i,children:/* @__PURE__ */be("i",{className:"fa-solid fa-xmark"})})]}),
239
+ /* @__PURE__ */ye("div",{className:"border-ui-line grid grid-cols-1 gap-x-4 rounded border px-2.5 py-1.5 @lg:grid-cols-2",children:[
240
+ /* @__PURE__ */ye(ks,{name:"display",children:[a.display," · ",a.position]}),
241
+ /* @__PURE__ */be(ks,{name:"font",children:a.font}),
242
+ /* @__PURE__ */be(ks,{name:"padding",children:a.padding}),
243
+ /* @__PURE__ */ye(ks,{name:"line / track",children:[a.lineHeight," · ",a.letterSpacing]}),
244
+ /* @__PURE__ */be(ks,{name:"margin",children:a.margin}),
245
+ /* @__PURE__ */be(ks,{name:"colour",children:/* @__PURE__ */be(yt,{colour:a.colour})}),
246
+ /* @__PURE__ */ye(ks,{name:"border",children:[a.border," · r ",a.radius]}),
247
+ /* @__PURE__ */be(ks,{name:"background",children:a.background&&/* @__PURE__ */be(yt,{colour:a.background})}),
248
+ /* @__PURE__ */ye(ks,{name:"gap · z",children:[a.gap||"—"," · ",a.zIndex]}),
249
+ /* @__PURE__ */be(ks,{name:"contrast",children:a.contrast&&/* @__PURE__ */be(bt,{ratio:a.contrast.ratio,needs:a.contrast.needs})})]}),a.classes.length>0&&/* @__PURE__ */be("div",{className:"flex flex-wrap gap-1",children:a.classes.map(e=>/* @__PURE__ */ye("span",{className:"bg-ui-raised rounded px-1.5 py-0.5 font-mono text-[11px]",children:[".",e]},e))}),
250
+ /* @__PURE__ */ye("div",{className:"flex flex-col",children:[/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle mb-1 text-[10px] font-semibold tracking-wider uppercase",children:["CSS that reaches it · ",r.length]}),/* @__PURE__ */be("div",{className:"border-ui-line overflow-hidden rounded border",children:r.map((e,t)=>/* @__PURE__ */be(Cs,{rule:e},`${e.selector}-${String(t)}`))})]})]}):null},Ms=()=>/* @__PURE__ */ye("div",{className:"border-ui-line text-ui-fg-subtle flex flex-col gap-1.5 rounded border border-dashed p-3",children:[/* @__PURE__ */be("span",{className:"text-ui-fg font-medium",children:"Nothing inspected yet"}),/* @__PURE__ */ye("span",{children:["Turn on ",
251
+ /* @__PURE__ */be("b",{children:"Inspect"})," and point at anything on the page: its box, type, colours and contrast show by the pointer. Click it to keep it here, with the CSS that reaches it. With one kept, hold ",
252
+ /* @__PURE__ */be("b",{children:"Alt"})," over another to measure the distance between them."]})]}),Vs=()=>{let{pinned:e,round:t}=oe(Qe),a=e?.isConnected?e:void 0;/* @__PURE__ */
253
+ return ye("section",{className:"flex min-w-0 flex-col gap-1.5",children:[
254
+ /* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex items-center gap-2 text-[10px] font-semibold tracking-wider uppercase",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-magnifying-glass"}),"Inspector"]}),a&&/* @__PURE__ */be(As,{element:a},t),!a&&/* @__PURE__ */be(Ms,{})]})},zs=()=>/* @__PURE__ */be("span",{className:"bg-ui-active h-4 w-px shrink-0"}),Os=()=>{let e=oe(K),t=de(()=>{e.current?.getAnimations({subtree:!0}).filter(T).forEach(e=>{e.cancel(),e.play()})},[e]);/* @__PURE__ */
255
+ return ye("button",{type:"button",title:"Play the page's arrivals and loops again from the start",className:"border-ui-line text-ui-fg-muted hover:bg-ui-hover flex h-6 shrink-0 cursor-pointer items-center gap-1.5 rounded-md border px-2 font-medium whitespace-nowrap transition-colors",onClick:t,children:[/* @__PURE__ */be("i",{className:"fa-solid fa-rotate-left text-[10px]"}),"Replay"]})},Ds=({setting:e,label:t,icon:a,title:r,primary:l=!1})=>{let{settings:i,setSetting:n}=oe(Qe),s=i[e],o=de(()=>n(e,!s),[n,e,s]);/* @__PURE__ */
256
+ return ye("button",{type:"button","aria-pressed":s,title:r,className:m("flex h-6 shrink-0 cursor-pointer items-center gap-1.5 rounded-md border px-2 font-medium whitespace-nowrap transition-colors",{"border-violet-500 bg-violet-500 text-white":s&&l,"border-violet-400/60 bg-violet-500/10 text-violet-700 dark:text-violet-300":s&&!l,"border-violet-300 text-violet-700 hover:bg-violet-500/10 dark:border-violet-500/50 dark:text-violet-300":!s&&l,"border-ui-line text-ui-fg-muted hover:bg-ui-hover":!s&&!l}),onClick:o,children:[/* @__PURE__ */be("i",{className:m(a,"text-[10px]")}),t]})},Fs=[{mode:"none",label:"Vision: as it is"},{mode:"grayscale",label:"No colour"},{mode:"protanopia",label:"Protanopia (red)"},{mode:"deuteranopia",label:"Deuteranopia (green)"},{mode:"tritanopia",label:"Tritanopia (blue)"},{mode:"blurred",label:"Low vision (blur)"}],Bs=()=>{let{settings:e,setSetting:t}=oe(Qe),a=de(e=>{(e=>Fs.some(({mode:t})=>t===e))(e.target.value)&&t("vision",e.target.value)},[t]);/* @__PURE__ */
257
+ return be("select",{value:e.vision,title:"See the page without one kind of colour, or out of focus",onChange:a,className:m("bg-ui-panel h-6 shrink-0 rounded-md border py-0 pr-6 pl-2 text-[11px] leading-[22px]",{"border-violet-400/60 text-violet-700 dark:text-violet-300":"none"!==e.vision,"border-ui-line text-ui-fg-muted":"none"===e.vision}),children:Fs.map(({mode:e,label:t})=>/* @__PURE__ */be("option",{value:e,children:t},e))})},Js=()=>/* @__PURE__ */ye("div",{className:"border-ui-line flex shrink-0 flex-wrap items-center gap-1.5 border-b px-3 py-2",children:[
258
+ /* @__PURE__ */be(Ds,{setting:"inspect",label:"Inspect",icon:"fa-solid fa-arrow-pointer",title:"Point at an element for its box and style; click to keep it here; hold Alt over another to measure. Esc stops.",primary:!0}),
259
+ /* @__PURE__ */be(zs,{}),
260
+ /* @__PURE__ */be(Ds,{setting:"grid",label:"Grid",icon:"fa-solid fa-table-columns",title:"The page's 12, 8 or 4 columns"}),
261
+ /* @__PURE__ */be(Ds,{setting:"xray",label:"X-ray",icon:"fa-solid fa-x-ray",title:"Every element's box, its type and id when pointed at — and what is bound to data, shown on a condition, runs a flow, moves or sits behind a flag, named on the page"}),
262
+ /* @__PURE__ */be(Ds,{setting:"tabOrder",label:"Tab order",icon:"fa-solid fa-arrow-right-to-bracket",title:"The order the Tab key walks the controls in"}),
263
+ /* @__PURE__ */be(Ds,{setting:"viewport",label:"Viewport",icon:"fa-solid fa-ruler-horizontal",title:"The window's size and the breakpoint showing"}),
264
+ /* @__PURE__ */be(zs,{}),
265
+ /* @__PURE__ */be(Ds,{setting:"paused",label:"Pause",icon:"fa-solid fa-pause",title:"Hold every animation where it is"}),
266
+ /* @__PURE__ */be(Ds,{setting:"slowMotion",label:"Slow",icon:"fa-solid fa-gauge-simple",title:"Every animation at a quarter of its speed"}),
267
+ /* @__PURE__ */be(Os,{}),
268
+ /* @__PURE__ */be(Ds,{setting:"reducedMotion",label:"Reduced motion",icon:"fa-solid fa-person-walking",title:"The page as a visitor who asked for less motion gets it"}),
269
+ /* @__PURE__ */be(Bs,{})]}),Ps=()=>{let{settings:e,setSetting:t}=oe(Qe),a="none"===e.xrayFilter,r=de(()=>t("xrayFilter",a?"all":"none"),[t,a]);/* @__PURE__ */
270
+ return ye("button",{type:"button","aria-pressed":a,title:"Every element's box, its type and id when pointed at — and no wiring. Click again to mark it all.",className:m("border-ui-line flex w-full cursor-pointer items-center gap-2 border-b px-2.5 py-1.5 text-left",{"bg-violet-500/10":a,"hover:bg-ui-hover":!a}),onClick:r,children:[/* @__PURE__ */be("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm border border-dashed border-violet-500"}),/* @__PURE__ */be("span",{className:"text-ui-fg min-w-0 truncate font-medium",children:"Boxes only"})]})},Ws=({mark:e})=>{let{settings:t,setSetting:a,xrayCounts:r}=oe(Qe),{label:l,description:i,colour:n}=Ue[e],s=t.xrayFilter===e,o=de(()=>a("xrayFilter",s?"all":e),[a,s,e]);/* @__PURE__ */
271
+ return ye("button",{type:"button","aria-pressed":s,title:`${i}. Click to show only these; again for all.`,className:m("border-ui-line flex w-full cursor-pointer items-center gap-2 border-b px-2.5 py-1.5 text-left last:border-b-0",{"bg-violet-500/10":s,"hover:bg-ui-hover":!s,"opacity-50":"all"!==t.xrayFilter&&!s}),onClick:o,children:[
272
+ /* @__PURE__ */be("span",{className:"h-2.5 w-2.5 shrink-0 rounded-full",style:{backgroundColor:n}}),
273
+ /* @__PURE__ */be("span",{className:"text-ui-fg min-w-0 truncate font-medium",children:l}),
274
+ /* @__PURE__ */be("span",{className:"bg-ui-raised text-ui-fg-muted ml-auto rounded-full px-1.5 text-[10px] font-semibold tabular-nums",children:r[e]})]})},qs=()=>/* @__PURE__ */ye("section",{className:"flex min-w-0 flex-col gap-1.5",children:[/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex items-center gap-2 text-[10px] font-semibold tracking-wider uppercase",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-x-ray"}),"X-ray"]}),/* @__PURE__ */ye("div",{className:"border-ui-line overflow-hidden rounded border",children:[/* @__PURE__ */be(Ps,{}),We.map(e=>/* @__PURE__ */be(Ws,{mark:e},e))]})]}),Us=()=>{let{settings:e}=oe(Qe);/* @__PURE__ */
275
+ return ye("div",{className:"@container flex h-full min-h-0 w-full flex-col",children:[/* @__PURE__ */be(Js,{}),/* @__PURE__ */ye("div",{className:"grid min-h-0 grow grid-cols-1 content-start gap-3 overflow-y-auto p-3 @3xl:grid-cols-[minmax(0,0.85fr)_minmax(0,1.15fr)]",children:[/* @__PURE__ */ye("div",{className:"flex min-w-0 flex-col gap-3",children:[e.xray&&/* @__PURE__ */be(qs,{}),/* @__PURE__ */be(ws,{})]}),/* @__PURE__ */be(Vs,{})]})]})},Hs=()=>{let{resolvedTheme:e}=E(),t=oe(K),{pointing:a,element:r,missed:l,point:i,forget:n}=(()=>{let[e,t]=ge(!1),[a,r]=ge(),[l,i]=ge(!1);return ue(()=>{if(!e)return;let a=e=>{if(e.target instanceof Element&&e.target.closest("[data-plitzi-devtools]"))return;e.preventDefault(),e.stopPropagation();let a=J(e.target);r(a),i(void 0===a),t(!1)},l=e=>{"Escape"===e.key&&t(!1)};return window.addEventListener("click",a,!0),window.addEventListener("keydown",l,!0),document.body.style.cursor="crosshair",()=>{window.removeEventListener("click",a,!0),window.removeEventListener("keydown",l,!0),document.body.style.cursor=""}},[e]),{pointing:e,element:a,missed:l,point:de(()=>{i(!1),t(!0)},[]),forget:de(()=>{r(void 0),i(!1)},[])}})(),[s,o]=ge(""),[d,c]=ge({kind:"idle"}),u=de(e=>o(e.target.value),[]),p=de(async()=>{c({kind:"sending"});let a=await(async e=>{try{let t=await fetch(U,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json().catch(()=>{}),r=e=>{let t=M(a)?a[e]:void 0;return"string"==typeof t?t:void 0};return t.ok?{sent:r("note")??"Sent to the run’s lead"}:{failed:r("error")??`The preview answered ${String(t.status)}`}}catch(e){return{failed:`The preview did not answer: ${e instanceof Error?e.message:String(e)}`}}})(((e,t,a,r)=>{let{steps:l,earlier:i,from:n}=Q(),s=(e=>{let t=e?Math.round(e.getBoundingClientRect().width):void 0;return void 0!==t&&t>0&&Math.abs(t-window.innerWidth)>1?t:void 0})(r),o=`${window.location.pathname}${window.location.search}`;return{text:e.trim(),path:n,...o===n?{}:{seenOn:o},width:window.innerWidth,height:window.innerHeight,...void 0===s?{}:{pageWidth:s},scheme:a,...t?{element:t}:{},steps:l,...i>0?{earlier:i}:{},at:/* @__PURE__ */(new Date).toISOString()}})(s,r,"dark"===e?"dark":"light",t.current));"failed"in a?c({kind:"failed",why:a.failed}):(R(),o(""),n(),c({kind:"sent",note:a.sent}))},[s,r,e,t,n]),h=de(()=>{p()},[p]);/* @__PURE__ */
276
+ return ye("div",{className:"flex flex-col gap-1.5",children:[
277
+ /* @__PURE__ */ye("div",{className:"flex flex-wrap items-center gap-1.5",children:[
278
+ /* @__PURE__ */ye("button",{type:"button",onClick:i,"aria-pressed":a,className:m("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors",{"bg-violet-500 text-white":a,"text-ui-fg-muted hover:bg-ui-hover":!a}),children:[/* @__PURE__ */be("i",{className:"fa-solid fa-crosshairs"}),"Point at it"]}),a&&/* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-[11px]",children:"Click the element on the page — Esc stops"}),!a&&r&&/* @__PURE__ */ye("span",{className:"bg-ui-raised flex items-center gap-1 rounded px-1.5 py-0.5 font-mono text-[11px]",children:[r,/* @__PURE__ */be("button",{type:"button",onClick:n,title:"Point at nothing",className:"text-ui-fg-subtle hover:text-ui-fg",children:/* @__PURE__ */be("i",{className:"fa-solid fa-xmark"})})]}),!a&&l&&/* @__PURE__ */be("span",{className:"text-[11px] text-amber-700 dark:text-amber-300",children:"That is nothing of the page’s own: point at another, or send it for the page as a whole"})]}),
279
+ /* @__PURE__ */be("textarea",{value:s,onChange:u,maxLength:V,rows:2,placeholder:"What is wrong — sent with where you are, the width and what you did on the page",className:"border-ui-line bg-ui-raised text-ui-fg placeholder:text-ui-fg-subtle w-full resize-y rounded border px-1.5 py-1 outline-none focus:border-violet-400"}),
280
+ /* @__PURE__ */ye("div",{className:"flex flex-wrap items-center gap-2",children:[
281
+ /* @__PURE__ */ye("button",{type:"button",onClick:h,disabled:""===s.trim()||"sending"===d.kind,className:"flex h-6 items-center gap-1 rounded bg-violet-500 px-2 text-xs font-medium text-white hover:bg-violet-600 disabled:opacity-50",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-paper-plane"}),"Send to the lead"]}),"sent"===d.kind&&/* @__PURE__ */be("span",{className:"text-[11px] text-emerald-700 dark:text-emerald-400",children:d.note}),"failed"===d.kind&&/* @__PURE__ */ye("span",{className:"text-[11px] text-red-600 dark:text-red-400",children:["Not sent: ",d.why]})]})]})},Ks={pending:"fa-regular fa-circle",ready:"fa-regular fa-circle-dot","in-progress":"fa-solid fa-play",waiting:"fa-solid fa-hourglass-half","in-review":"fa-solid fa-magnifying-glass","changes-requested":"fa-solid fa-rotate-left",done:"fa-solid fa-check",blocked:"fa-solid fa-ban",failed:"fa-solid fa-xmark"},Qs={done:"text-emerald-600 dark:text-emerald-400","in-review":"text-violet-600 dark:text-violet-400","in-progress":"text-sky-600 dark:text-sky-400","changes-requested":"text-amber-600 dark:text-amber-400",blocked:"text-red-600 dark:text-red-400",failed:"text-red-600 dark:text-red-400"},_s=e=>[e.agent,e.reviewer?`reviewed by ${e.reviewer}`:void 0].filter(Boolean).join(" · "),Xs=({task:e})=>"done"===e.status||"critical"!==e.urgency&&"high"!==e.urgency?null:/* @__PURE__ */be("span",{title:`${e.urgency}: its priority, or that of a task waiting on it`,className:m("shrink-0 text-[10px] font-bold","critical"===e.urgency?"text-red-600 dark:text-red-400":"text-amber-600 dark:text-amber-400"),children:"critical"===e.urgency?"‼":"!"}),Zs=({task:e})=>{let[t,a]=ge(!1),r=de(()=>a(e=>!e),[]);/* @__PURE__ */
282
+ return ye("div",{className:"border-ui-line border-b last:border-b-0",children:[
283
+ /* @__PURE__ */ye("button",{type:"button",onClick:r,"aria-expanded":t,className:"hover:bg-ui-hover flex w-full items-center gap-2 px-2 py-1.5 text-left",children:[
284
+ /* @__PURE__ */be("i",{className:m(Ks[e.status]??"fa-regular fa-circle","w-3 text-[10px]",Qs[e.status])}),
285
+ /* @__PURE__ */be(Xs,{task:e}),
286
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 font-mono text-[11px]",children:e.id}),
287
+ /* @__PURE__ */be("span",{className:"min-w-0 grow truncate",children:e.title}),void 0!==e.fraction&&/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle shrink-0 text-[10px]",children:[Math.round(100*e.fraction)," %"]}),
288
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 text-[10px]",children:_s(e)})]}),e.why&&/* @__PURE__ */be("div",{className:m("truncate px-7 pb-1 text-[10px]","blocked"===e.status?"text-red-600 dark:text-red-400":"text-ui-fg-subtle"),title:e.why,children:e.why}),t&&/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex flex-col gap-0.5 px-7 pb-2 text-[11px]",children:[/* @__PURE__ */ye("span",{children:[e.status,e.round>0?` · round ${String(e.round)}`:""," · ",e.role,e.step?` · ${e.step}`:""]}),e.files.map(e=>/* @__PURE__ */be("span",{className:"font-mono",children:e},e))]})]})},Gs=e=>`${e.slice(11,16)} UTC`,Ys=[{label:"At work",statuses:["in-progress","changes-requested","waiting"]},{label:"In review",statuses:["in-review"]},{label:"Blocked",statuses:["blocked","failed"]},{label:"To do",statuses:["ready","pending"]},{label:"Approved",statuses:["done"]}],eo=new Set(Ys.flatMap(e=>e.statuses)),to={working:"bg-sky-500",reviewing:"bg-violet-500",blocked:"bg-amber-500",asking:"bg-amber-400",waiting:"bg-sky-300","no-signal":"bg-red-500"},ao=({title:e,count:t,children:a})=>/* @__PURE__ */ye("section",{className:"flex min-w-0 flex-col gap-1",children:[/* @__PURE__ */be("h3",{className:"text-ui-fg-subtle text-[10px] font-semibold tracking-wider uppercase",children:/* @__PURE__ */ye("span",{children:[e,void 0!==t&&/* @__PURE__ */ye("span",{className:"ml-1 font-normal",children:["(",t,")"]})]})}),a]}),ro=({children:e})=>/* @__PURE__ */be("div",{className:"border-ui-line w-full overflow-hidden rounded border",children:e}),lo=({agent:e})=>/* @__PURE__ */ye("div",{className:"flex items-center gap-2 px-2 py-1",children:[
289
+ /* @__PURE__ */be("span",{className:m("h-2 w-2 shrink-0 rounded-full",to[e.status]??"bg-ui-line-strong"),title:e.status}),
290
+ /* @__PURE__ */be("span",{className:"w-20 shrink-0 font-medium",children:e.agent}),
291
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle w-28 shrink-0 truncate text-[10px]",children:e.model??"harness model"}),
292
+ /* @__PURE__ */be("span",{className:"text-ui-fg-muted min-w-0 grow truncate",children:e.doing})]}),io=({snapshot:e})=>{if(!e)/* @__PURE__ */return be("div",{className:"text-ui-fg-subtle py-4 text-center text-xs italic",children:"No run of agents behind this page: only a run's preview (npm run start:preview) has one"});let t=0===e.total?0:Math.round(e.done/e.total*100),a=[...Ys.map(t=>({label:t.label,tasks:e.tasks.filter(e=>t.statuses.includes(e.status))})),{label:"Other",tasks:e.tasks.filter(e=>!eo.has(e.status))}].filter(e=>e.tasks.length>0),r=e.feed??[];/* @__PURE__ */
293
+ return ye("div",{className:"@container flex h-full min-h-0 w-full flex-col gap-3 overflow-y-auto p-3",children:[
294
+ /* @__PURE__ */ye("div",{className:"flex flex-col gap-1",children:[
295
+ /* @__PURE__ */ye("div",{className:"flex items-baseline justify-between gap-2",children:[/* @__PURE__ */ye("span",{className:"truncate font-semibold",children:[
296
+ /* @__PURE__ */be("i",{className:"fa-solid fa-people-group mr-2 text-violet-500"}),e.runId,
297
+ /* @__PURE__ */be("span",{className:"bg-ui-raised text-ui-fg-subtle ml-2 rounded px-1.5 py-0.5 text-[10px] font-medium uppercase",children:e.status})]}),/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle shrink-0 text-[10px]",children:["as of ",Gs(e.at)]})]}),
298
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-[11px]",children:e.goal}),
299
+ /* @__PURE__ */be("div",{className:"bg-ui-active h-1.5 w-full overflow-hidden rounded-full",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Tasks approved",children:/* @__PURE__ */be("div",{className:"h-full rounded-full bg-emerald-500",style:{width:`${String(t)}%`}})}),
300
+ /* @__PURE__ */ye("span",{className:"text-ui-fg-subtle text-[11px]",children:[e.done," of ",e.total," tasks approved",e.expectedEnd?` · expected end ${Gs(e.expectedEnd)}`:""]})]}),
301
+ /* @__PURE__ */be(ao,{title:"Report what you see",children:/* @__PURE__ */be(Hs,{})}),
302
+ /* @__PURE__ */ye("div",{className:"grid grid-cols-1 items-start gap-3 @2xl:grid-cols-2",children:[e.tasks.length>0&&/* @__PURE__ */be(ao,{title:"Tasks",count:e.tasks.length,children:/* @__PURE__ */be("div",{className:"border-ui-line max-h-62 w-full overflow-y-auto rounded border",children:a.map(e=>/* @__PURE__ */ye(le,{children:[/* @__PURE__ */ye("div",{className:"border-ui-line bg-ui-panel text-ui-fg-subtle sticky top-0 z-10 border-b px-2 py-0.5 text-[10px] font-semibold tracking-wider uppercase",children:[e.label," ",
303
+ /* @__PURE__ */ye("span",{className:"font-normal",children:["(",e.tasks.length,")"]})]}),e.tasks.map(e=>/* @__PURE__ */be(Zs,{task:e},e.id))]},e.label))})}),/* @__PURE__ */ye("div",{className:"flex min-w-0 flex-col gap-3",children:[e.agents&&e.agents.length>0&&/* @__PURE__ */be(ao,{title:"Agents",count:e.agents.length,children:/* @__PURE__ */be(ro,{children:e.agents.map(e=>/* @__PURE__ */be(lo,{agent:e},e.agent))})}),e.attention.length>0&&/* @__PURE__ */be(ao,{title:"Needs attention",count:e.attention.length,children:/* @__PURE__ */be("div",{className:"flex max-h-48 flex-col gap-1 overflow-y-auto pr-1",children:e.attention.map(e=>/* @__PURE__ */be("span",{className:"shrink-0 rounded-r border-l-2 border-amber-500 bg-amber-50 px-2 py-1 text-[11px] break-words text-amber-800 dark:bg-amber-950/40 dark:text-amber-300",children:e.text},e.text))})})]})]}),r.length>0&&/* @__PURE__ */ye("section",{className:"flex min-h-32 flex-1 flex-col gap-1",children:[/* @__PURE__ */ye("h3",{className:"text-ui-fg-subtle text-[10px] font-semibold tracking-wider uppercase",children:["Activity ",/* @__PURE__ */ye("span",{className:"ml-1 font-normal",children:["(",r.length,")"]})]}),/* @__PURE__ */be("div",{className:"border-ui-line flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto rounded border p-1.5",children:r.map(e=>/* @__PURE__ */ye("div",{className:"flex gap-2 text-[11px]",children:[
304
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0",children:e.at.slice(11,16)}),
305
+ /* @__PURE__ */be("span",{className:"w-24 shrink-0 truncate font-medium",children:e.by}),
306
+ /* @__PURE__ */be("span",{className:m("min-w-0 grow","problem"===e.kind?"text-red-600 dark:text-red-400":"text-ui-fg-muted"),title:e.detail,children:e.text})]},`${e.at}-${e.by}-${e.text}`))})]})]})},no="\0fn:",so=e=>{if("object"!=typeof e||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},oo=e=>{if("function"==typeof e)return`${no}ƒ ${e.name||"anonymous"}()`;if((e=>Array.isArray(e))(e)){let t=e.map(oo);return t.every((t,a)=>t===e[a])?e:t}if(!so(e))return e;let t={},a=!1;for(let[r,l]of Object.entries(e))t[r]=oo(l),a||=t[r]!==l;return a?t:e},co=({record:{expiresAt:e},now:t})=>{let a=t>=e,r=Number.isFinite(e)?`${si(e-t)} left`:"no expiry";/* @__PURE__ */
307
+ return be("span",{className:m("ml-1 rounded px-1 align-middle text-[10px] font-medium",a?"bg-amber-500/15 text-amber-700 dark:text-amber-300":"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300"),children:a?"stale":r})},uo=(e,{type:t,value:a})=>{if("value"!==t||"string"!=typeof a)return null;let r=(e=>e.startsWith(no)?e.slice(4):"")(a);return r?/* @__PURE__ */be("span",{className:"w-rjv-value text-violet-400 italic",children:r}):null},mo={},po={...jl,width:"100%",height:"100%",overflow:"auto",padding:"8px",fontSize:"14px"},ho=e=>m("cursor-pointer rounded px-2 py-0.5 font-medium transition-colors",e?"bg-violet-500/15 text-violet-600 dark:text-violet-300":"text-ui-fg-subtle hover:bg-ui-hover/70 hover:text-ui-fg"),fo={},go=[],xo=({elementSelected:e})=>{let{resolvedTheme:t}=E(),{getData:a}=oe(q),r=vi(),l=vi()?.store,[i,n]=_("plitzi-sdk.dev-tools.store.view","own"),s=((e,t)=>{let a=de(t=>e?e.subscribe(t):()=>{},[e]),r=de(()=>e?t?e.getState():e.getOwnState():mo,[e,t]);return xe(a,r,r)})(e?void 0:l,"merged"===i),o=de(()=>n("own"),[n]),d=de(()=>n("merged"),[n]),c=e?a?.(`getElementDataSource-${e}`):s,u=pe(()=>(e=>{if(!e)return;let t=oo(e);return so(t)?t:e})(c),[c]),m=pe(()=>r?[r]:go,[r]),p=ii(m)[0]?.records??fo,h=pe(()=>Object.values(p).reduce((e,t)=>Math.max(e,t.updatedAt),0),[p]),g=ni(Object.keys(p).length>0,h),x=pe(()=>((e,t)=>(a,{keys:r})=>{let l=e[(r??[]).join(".")];if(!l)return null;let{className:i,style:n,children:s}=a;/* @__PURE__ */
308
+ return ye(ve,{children:[/* @__PURE__ */be("span",{className:i,style:n,children:s}),/* @__PURE__ */be(co,{record:l,now:t})]})})(p,g),[p,g]);/* @__PURE__ */
309
+ return ye("div",{className:"flex h-full w-full flex-col",children:[!e&&/* @__PURE__ */ye("div",{className:"border-ui-line flex shrink-0 items-center gap-1 border-b px-2 py-1 text-[11px]",children:[
310
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle mr-1",children:"View"}),
311
+ /* @__PURE__ */be("button",{className:ho("own"===i),onClick:o,title:"Only this scope's own layer",children:"Own"}),
312
+ /* @__PURE__ */be("button",{className:ho("merged"===i),onClick:d,title:"Own layer merged over the parent scope chain",children:"Merged"})]}),/* @__PURE__ */ye(Cl,{value:u??f,style:"dark"===t?po:void 0,enableClipboard:!1,indentWidth:15,collapsed:2,displayObjectSize:!1,displayDataTypes:!1,children:[/* @__PURE__ */be(Cl.String,{render:uo}),/* @__PURE__ */be(Cl.KeyName,{render:x})]})]})},vo=(e,t,a)=>{if(0===e.commitId)return"ssr";let r=(e=>{let t=0,a=0;for(let r of e.elements)"mount"===r.phase?t+=1:a+=1;return t>0&&0===a?"mount":a>0&&0===t?"update":"mixed"})(e);return"mount"===r?t&&a?"hydration":"mount":r},bo={ssr:"SSR render (server)",hydration:"Hydration (SSR)",mount:"Mount",mixed:"Mount + update",update:"Update"},yo={ssr:"S",hydration:"H",mount:"M",mixed:"±",update:"·"},No=[{origin:"ssr",label:"SSR"},{origin:"hydration",label:"Hydration"},{origin:"mount",label:"Mount"},{origin:"mixed",label:"Mount+update"},{origin:"update",label:"Update"}],wo=e=>e<.1?"<0.1ms":`${e.toFixed(1)}ms`,ko=e=>`${Math.round(100*e)}%`,So=e=>e>=50?"bg-red-500":e>=16?"bg-amber-500":e>=8?"bg-emerald-500":"bg-sky-500",Co=[{color:"bg-sky-500",label:"<8ms"},{color:"bg-emerald-500",label:"8–16ms"},{color:"bg-amber-500",label:"16–50ms"},{color:"bg-red-500",label:"≥50ms"}],$o="bg-ui-active",jo={backgroundImage:"repeating-linear-gradient(45deg, rgba(113,113,122,0.22) 0, rgba(113,113,122,0.22) 2px, transparent 2px, transparent 5px)"},To=e=>"rendered"===e.state?So(e.selfDuration):"bubbled"===e.state?$o:"bg-transparent",Io=e=>"bubbled"===e.state?"text-ui-fg-muted":"hatched"===e.state?"text-ui-fg-subtle":"bg-amber-500"===So(e.selfDuration)?"text-stone-900":"text-white",Lo=(e,t)=>{let a=t?.[e];if(!a)return e;let{label:r,type:l}=a.definition;return r||l||e},Eo=(e,t)=>t?.[e]?.definition.type??"unknown",Ro=(e,t)=>{let a=c(t?.[e],"definition.initialState.visibility",!0);return!1!==a&&"false"!==a},Ao=(e,t)=>"self"===t?e.selfDuration:e.actualDuration,Mo=.01,Vo=1e-6,zo=(e,t,a)=>{let r=e.lifetime.get(t);return!r||r.mountedAt<=a&&a<r.unmountedAt},Oo=e=>{let t=/* @__PURE__ */new Map,a=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map,l=/* @__PURE__ */new Map;for(let n of Object.keys(e)){let{parentId:i,baseDuration:s,elementId:o,mountedAt:d,unmountedAt:c}=e[n];t.set(n,i),a.set(n,s),r.set(n,o),(void 0!==d||void 0!==c)&&l.set(n,{mountedAt:d??0,unmountedAt:c??1/0})}let i=/* @__PURE__ */new Map;for(let[n,s]of t)if(void 0!==s&&t.has(s)){let e=i.get(s);e?e.push(n):i.set(s,[n])}return{parent:t,base:a,children:i,elementOf:r,lifetime:l}},Do=(e,t)=>{let{parent:a}=t,r=new Map(e.elements.map(e=>[e.id,e])),l=/* @__PURE__ */new Map;for(let n of e.elements)l.set(n.id,n.actualDuration);for(let n of e.elements){let e=a.get(n.id);for(;void 0!==e&&!r.has(e);)e=a.get(e);void 0!==e&&l.set(e,(l.get(e)??0)-n.actualDuration)}for(let[n,s]of l)s<0&&l.set(n,0);let i=/* @__PURE__ */new Set;for(let n of r.keys()){let e=n,t=a.get(n);for(;void 0!==t&&a.has(t);)e=t,t=a.get(t);i.add(e)}return{rendered:r,self:l,roots:[...i]}},Fo=(e,t,a,r=Oo(t))=>{let{children:l,base:i,elementOf:n}=r,{rendered:s,self:o,roots:d}=Do(e,r),c=e=>{let t=i.get(e)??0;if(t>0)return t;let a=s.get(e)?.actualDuration??0;return a>0?a:Mo},u=[],m=[],p=0,h=0,f=0,g=[],x=d.map(c),v=x.reduce((e,t)=>e+t,0)||1,b=0;for(d.forEach((e,t)=>{let a=(x[t]||Mo)/v;g.push({id:e,parentId:void 0,x:b,width:a,depth:0,ancestorRendered:!1}),b+=a}),g.reverse();g.length>0;){let t=g.pop();if(void 0===t)break;let{id:d,parentId:x,x:v,width:b,depth:y,ancestorRendered:N}=t,w=s.get(d),k=o.get(d)??0,S=w?k>Vo?"rendered":"bubbled":"hatched",C="rendered"===S&&!N;"rendered"===S&&(h+=k,f+=1),C&&m.push(d),p=Math.max(p,y);let $=n.get(d)??w?.elementId??d;u.push({id:d,elementId:$,name:Lo($,a),type:Eo($,a),state:S,visible:Ro($,a),trigger:C,phase:w?.phase,actualDuration:w?.actualDuration??0,baseDuration:i.get(d)??w?.baseDuration??0,selfDuration:k,depth:y,parentId:x,changedProps:w?.changedProps,x:v,width:b});let j=(l.get(d)??[]).filter(t=>s.has(t)||zo(r,t,e.commitId));if(0===j.length)continue;let T=j.map(c),I=T.reduce((e,t)=>e+t,0),L=Math.max(c(d),I)||1,E=v,R=[];j.forEach((e,t)=>{let a=(T[t]||Mo)/L*b;R.push({id:e,parentId:d,x:E,width:a,depth:y+1,ancestorRendered:N||"rendered"===S}),E+=a});for(let e=R.length-1;e>=0;--e)g.push(R[e])}return{nodes:u,maxDepth:p,totalSelf:h,renderedCount:f,triggers:m}},Bo=(e,t,a)=>{let r=Oo(t),l=/* @__PURE__ */new Map;for(let i of e){let{self:e}=Do(i,r);for(let t of i.elements){let a=e.get(t.id)??0;if(a<=Vo)continue;let i=r.elementOf.get(t.id)??t.elementId,n=l.get(i)??{renders:0,mounts:0,totalSelf:0,maxSelf:0,lastSelf:0};n.renders+=1,n.mounts+=+("mount"===t.phase),n.totalSelf+=a,n.maxSelf=Math.max(n.maxSelf,a),n.lastSelf=a,l.set(i,n)}}return[...l.entries()].map(([e,t])=>({id:e,name:Lo(e,a),type:Eo(e,a),renders:t.renders,mounts:t.mounts,totalSelf:t.totalSelf,maxSelf:t.maxSelf,avgSelf:t.totalSelf/t.renders,lastSelf:t.lastSelf}))},Jo=({commits:e,selectedIndex:t,hydrated:a,onSelect:r})=>{let l=fe(null),i=pe(()=>Math.max(1,...e.map(e=>e.duration)),[e]),n=pe(()=>e.find(e=>0!==e.commitId)?.commitId,[e]);ue(()=>{l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]);let s=de(e=>()=>r(e),[r]),o=de(a=>{if("ArrowLeft"!==a.key&&"ArrowRight"!==a.key)return;a.preventDefault(),a.stopPropagation();let l=t+("ArrowLeft"===a.key?-1:1);l>=0&&l<e.length&&r(e[l].commitId)},[e,t,r]);/* @__PURE__ */
313
+ return ye("div",{className:"border-ui-line bg-ui-panel flex shrink-0 flex-col border-b",children:[/* @__PURE__ */be("div",{role:"listbox","aria-label":"Commits, total render time","aria-orientation":"horizontal",tabIndex:0,onKeyDown:o,className:"flex h-20 items-end gap-1 overflow-x-auto px-2 pt-2 outline-none focus-visible:ring-1 focus-visible:ring-violet-400",children:e.map((e,r)=>{let o=r===t,d=0===e.commitId,c=d?100:Math.max(6,Math.round(e.duration/i*100)),u=vo(e,a,e.commitId===n),p=e.causes.slice(0,6).map(e=>e.path).join(", "),h=e.causes.length>6?" +"+(e.causes.length-6):"",f=e.causes.length>0?`\nCaused by ${p}${h}`:"";/* @__PURE__ */
314
+ return ye("button",{ref:o?l:void 0,role:"option","aria-selected":o,onClick:s(e.commitId),title:d?`Commit #${e.commitId} · ${bo[u]} · no client timing · ${e.elementCount} elements`:`Commit #${e.commitId} · ${bo[u]} · ${wo(e.duration)} total · ${e.elementCount} elements${f}`,className:"flex h-full shrink-0 flex-col items-center justify-end gap-0.5 px-0.5",children:[/* @__PURE__ */be("div",{style:{height:`${c}%`},className:m("w-3.5 rounded-sm transition-all",d?"bg-violet-400/40":So(e.duration),{"border border-dashed border-violet-400/70":d,"opacity-100 ring-2 ring-violet-400":o,"opacity-40 hover:opacity-80":!o})}),/* @__PURE__ */be("span",{className:m("text-[8px] leading-none font-semibold",{"text-violet-600 dark:text-violet-300":"ssr"===u||"hydration"===u,"text-ui-fg-subtle":"mount"===u||"mixed"===u,"text-transparent":"update"===u}),children:yo[u]})]},e.commitId)})}),/* @__PURE__ */be("div",{className:"text-ui-fg-subtle flex items-center gap-x-3 gap-y-0.5 overflow-x-auto px-2 pb-1 text-[9px]",children:No.map(e=>/* @__PURE__ */ye("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-muted font-semibold",children:yo[e.origin]}),e.label]},e.origin))})]})},Po=({commit:e,model:t,active:a,onSelectElement:r})=>{let l=t.nodes.filter(e=>e.trigger);if(0===l.length&&0===e.causes.length)return null;let i=l.slice(0,6),n=l.length-i.length,s=e.causes.slice(0,6),o=e.causes.length-s.length;/* @__PURE__ */
315
+ return ye(ve,{children:[l.length>0&&/* @__PURE__ */ye("span",{className:"flex flex-wrap items-center gap-1",children:[
316
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle mr-0.5 font-medium tracking-wide uppercase",children:"Triggered by"}),i.map(e=>/* @__PURE__ */ye("button",{onClick:()=>r(e.id===a?.id?void 0:e.id),title:`${e.name} (${e.type}) — root-cause re-render of this commit`,className:m("flex items-center gap-1 rounded px-1 py-0.5 text-violet-600 dark:text-violet-300",e.id===a?.id?"bg-violet-500/25":"bg-violet-500/10 hover:bg-violet-500/20"),children:[/* @__PURE__ */be("i",{className:"fa-solid fa-bolt text-[8px]"}),/* @__PURE__ */be("span",{className:"max-w-32 truncate",children:e.name})]},e.id)),n>0&&/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle",children:["+",n]})]}),e.causes.length>0&&/* @__PURE__ */ye("span",{className:"flex flex-wrap items-center gap-1",children:[
317
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle mr-0.5 font-medium tracking-wide uppercase",children:"Store write"}),s.map(e=>/* @__PURE__ */ye("span",{title:e.preview?`${e.path}\n${e.preview}`:e.path,className:"text-ui-fg-muted max-w-56 truncate rounded bg-zinc-500/10 px-1 py-0.5 font-mono text-[9px]",children:[e.path,e.preview&&/* @__PURE__ */be("span",{className:"text-ui-fg-subtle ml-1",children:e.preview})]},e.path)),o>0&&/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle",children:["+",o]})]})]})},Wo=()=>/* @__PURE__ */ye("div",{className:"border-ui-line text-ui-fg-subtle flex shrink-0 items-center gap-2 overflow-x-auto border-t px-2 py-1 text-[9px]",children:[
318
+ /* @__PURE__ */be("span",{className:"font-medium",children:"Render budget"}),Co.map(e=>/* @__PURE__ */ye("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */be("span",{className:m("h-2 w-2 rounded-sm",e.color)}),e.label]},e.label)),
319
+ /* @__PURE__ */ye("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */be("span",{className:m("h-2 w-2 rounded-sm",$o)}),"subtree only"]}),
320
+ /* @__PURE__ */ye("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */be("span",{className:"border-ui-line-strong/60 bg-ui-raised h-2 w-2 rounded-sm border",style:{backgroundImage:"repeating-linear-gradient(45deg, rgba(113,113,122,0.4) 0, rgba(113,113,122,0.4) 1px, transparent 1px, transparent 3px)"}}),"no render"]}),
321
+ /* @__PURE__ */ye("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */be("span",{className:"h-2 w-2 rounded-sm bg-violet-600"}),"selected"]}),
322
+ /* @__PURE__ */be("span",{className:"ml-auto shrink-0",children:"60fps ≈ 16ms · 50ms long task"})]}),qo=({node:e,commit:t,model:a})=>/* @__PURE__ */ye(ve,{children:[
323
+ /* @__PURE__ */ye("div",{className:"flex items-center gap-1.5",children:[
324
+ /* @__PURE__ */be("span",{className:m("h-2.5 w-2.5 shrink-0 rounded-sm",To(e)),style:"hatched"===e.state?jo:void 0}),
325
+ /* @__PURE__ */be("span",{className:"text-ui-fg truncate text-xs font-medium",children:e.name}),!e.visible&&/* @__PURE__ */be("i",{className:"fa-solid fa-eye-slash shrink-0 text-amber-500",title:"Hidden via visibility"})]}),
326
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle truncate",children:e.type}),!e.visible&&/* @__PURE__ */be("span",{className:"w-fit rounded bg-amber-500/15 px-1 py-0.5 text-[9px] text-amber-600 dark:text-amber-400",children:"hidden (visibility)"}),
327
+ /* @__PURE__ */ye("span",{className:m("w-fit rounded px-1 py-0.5 text-[9px]",{"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"rendered"===e.state,"text-ui-fg-subtle bg-zinc-500/15":"rendered"!==e.state}),children:["rendered"===e.state&&`rendered · ${e.phase??"update"}`,"bubbled"===e.state&&"a descendant rendered","hatched"===e.state&&"did not render"]}),e.trigger&&/* @__PURE__ */ye("span",{className:"w-fit rounded bg-violet-500/15 px-1 py-0.5 text-[9px] text-violet-600 dark:text-violet-400",title:"A root cause of this commit — no ancestor re-rendered",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-bolt mr-1"}),"trigger"]}),
328
+ /* @__PURE__ */be("div",{className:"text-ui-fg-subtle mt-1 font-medium tracking-wide uppercase",children:"Durations"}),
329
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Self"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:wo(e.selfDuration)})]}),
330
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Total (subtree)"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:wo(e.actualDuration)})]}),
331
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Base"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:wo(e.baseDuration)})]}),
332
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"% of commit"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:ko(e.actualDuration/t.duration)})]}),"rendered"===e.state&&/* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"% of work"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:ko(a.totalSelf>0?e.selfDuration/a.totalSelf:0)})]}),
333
+ /* @__PURE__ */ye("div",{className:"text-ui-fg-subtle mt-1 font-medium tracking-wide uppercase",children:["Commit #",t.commitId]}),
334
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Committed at"}),/* @__PURE__ */ye("span",{className:"text-ui-fg tabular-nums",children:[(t.timestamp/1e3).toFixed(1),"s"]})]}),
335
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Total"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:wo(t.duration)})]}),
336
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Rendered"}),/* @__PURE__ */ye("span",{className:"text-ui-fg tabular-nums",children:[a.renderedCount," of ",t.elementCount]})]}),
337
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Triggers"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:a.triggers.length})]}),"rendered"===e.state&&/* @__PURE__ */ye(ve,{children:[
338
+ /* @__PURE__ */be("div",{className:"text-ui-fg-subtle mt-1 font-medium tracking-wide uppercase",children:"Why it rendered"}),"mount"===e.phase&&/* @__PURE__ */be("span",{className:"text-ui-fg-subtle italic",children:"first mount"}),"mount"!==e.phase&&void 0===e.changedProps&&/* @__PURE__ */ye("span",{className:"w-fit rounded bg-sky-500/15 px-1 py-0.5 text-[9px] text-sky-600 dark:text-sky-400",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-microchip mr-1"}),"internal React — own state or a hook (props & store inputs unchanged)"]}),"mount"!==e.phase&&0===e.changedProps?.length&&e.trigger&&/* @__PURE__ */ye("span",{className:"w-fit rounded bg-sky-500/15 px-1 py-0.5 text-[9px] text-sky-600 dark:text-sky-400",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-microchip mr-1"}),"internal — a hook or consumed context changed, not props or store"]}),"mount"!==e.phase&&0===e.changedProps?.length&&!e.trigger&&/* @__PURE__ */ye("span",{className:"w-fit rounded bg-amber-500/15 px-1 py-0.5 text-[9px] text-amber-600 dark:text-amber-400",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),"no input changed — re-rendered by an ancestor"]}),e.changedProps?.map(e=>/* @__PURE__ */ye("div",{className:"border-ui-line flex flex-col gap-0.5 border-l pl-1.5",children:[/* @__PURE__ */ye("span",{className:"flex flex-wrap items-center gap-1",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-muted font-mono text-[9px] font-medium break-all",children:e.key}),e.ref&&/* @__PURE__ */be("span",{className:"shrink-0 rounded bg-amber-500/15 px-1 text-[8px] text-amber-600 dark:text-amber-400",title:"Reference changed but the content is shallow-equal — a new object/array, likely a missing memo",children:"new ref"})]}),/* @__PURE__ */ye("div",{className:"flex flex-col gap-0.5 font-mono text-[9px] leading-snug",children:[/* @__PURE__ */ye("span",{className:"text-ui-fg-subtle break-all",children:[/* @__PURE__ */be("span",{className:"text-rose-400/70 select-none dark:text-rose-400/60",children:"− "}),e.prev]}),/* @__PURE__ */ye("span",{className:"text-ui-fg-muted break-all",children:[/* @__PURE__ */be("span",{className:"text-emerald-500/80 select-none",children:"+ "}),e.next]})]})]},e.key))]})]}),Uo=()=>/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex h-full flex-col items-center justify-center gap-2 px-2 text-center",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-arrow-pointer text-xl opacity-30"}),/* @__PURE__ */be("span",{className:"text-[10px] leading-relaxed",children:"Select an element to inspect its timing and why it rendered"})]}),Ho=({active:e,commit:t,model:a})=>/* @__PURE__ */ye(Qt,{storageKey:"plitzi-sdk.dev-tools.tracing.sidebar-width",minWidth:180,maxWidth:480,defaultWidth:224,children:[e&&/* @__PURE__ */be(qo,{node:e,commit:t,model:a}),!e&&/* @__PURE__ */be(Uo,{})]}),Ko=({open:e,onToggle:t,className:a})=>/* @__PURE__ */be("button",{onClick:t,title:e?"Hide detail panel":"Show detail panel","aria-pressed":e,className:m("flex h-4 w-4 items-center justify-center rounded text-[10px]",e?"bg-violet-500/15 text-violet-600 dark:text-violet-300":"text-ui-fg-subtle hover:bg-ui-hover/10 hover:text-ui-fg",a),children:/* @__PURE__ */be("i",{className:"fa-solid fa-circle-info"})}),Qo=({node:e,left:t,width:a,top:r,selected:l,onClick:i})=>{let n={left:`${t}%`,width:`${a}%`,top:r,height:18,..."hatched"!==e.state||l?void 0:jo},s=l?"bg-violet-600":"hatched"===e.state?"bg-ui-raised":To(e);/* @__PURE__ */
339
+ return ye("button",{type:"button",onClick:()=>i(e),title:`${e.name} (${e.type})${e.visible?"":" · hidden"}\n${wo(e.selfDuration)} self · ${wo(e.actualDuration)} total · ${ko(e.baseDuration>0?e.width:0)} width`,style:n,className:m("border-ui-line absolute flex cursor-pointer items-center gap-1 overflow-hidden rounded-[1px] border px-1 text-left text-[11px] leading-none whitespace-nowrap",s,l?"z-10 text-white":m(Io(e),"hover:brightness-110")),children:[e.trigger&&/* @__PURE__ */be("i",{className:"fa-solid fa-bolt shrink-0 text-[8px] text-violet-200"}),!e.visible&&/* @__PURE__ */be("i",{className:"fa-solid fa-eye-slash shrink-0 text-[8px] opacity-80"}),
340
+ /* @__PURE__ */be("span",{className:"truncate",children:e.name})]})},_o=1e-6,Xo=({commit:e,model:t,active:a,origin:r,sidebarOpen:l,onSelectElement:i,onToggleSidebar:n})=>{let s=pe(()=>{let e=/* @__PURE__ */new Map;for(let a of t.nodes)e.set(a.id,a);return e},[t]),o=a,d=o?o.x:0,c=o?o.width:1,u=o?o.depth:0,m=pe(()=>{if(!o)return[];let e=[],t=o.parentId;for(;void 0!==t;){let a=s.get(t);if(!a)break;e.push(a),t=a.parentId}return e.reverse()},[o,s]),p=pe(()=>t.nodes.filter(e=>e.depth>=u&&e.x>=d-_o&&e.x+e.width<=d+c+_o),[t,d,c,u]),h=pe(()=>p.filter(e=>e.width/c>=3e-4||e.id===a?.id),[p,c,a]),f=p.length-h.length,g=pe(()=>h.reduce((e,t)=>Math.max(e,t.depth),u),[h,u]),x=de(e=>i(e.id===a?.id?void 0:e.id),[a,i]);/* @__PURE__ */
341
+ return ye("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[
342
+ /* @__PURE__ */ye("div",{className:"border-ui-line text-ui-fg-subtle flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b px-2 py-1 text-[10px]",children:[
343
+ /* @__PURE__ */ye("span",{className:"text-ui-fg font-medium",children:["Commit #",e.commitId]}),"update"!==r&&/* @__PURE__ */be("span",{className:"rounded bg-violet-100 px-1 text-[9px] font-medium text-violet-700 uppercase dark:bg-violet-500/20 dark:text-violet-300",children:bo[r]}),
344
+ /* @__PURE__ */be("span",{className:"opacity-60",children:"click a frame to zoom · click the focused frame to zoom out"}),f>0&&/* @__PURE__ */ye("span",{className:"opacity-60",title:"Frames too narrow to draw at this zoom level — zoom in to see them",children:["· ",f," too narrow to draw"]}),
345
+ /* @__PURE__ */be(Po,{commit:e,model:t,active:a,onSelectElement:i}),
346
+ /* @__PURE__ */be(Ko,{className:"ml-auto",open:l,onToggle:n})]}),
347
+ /* @__PURE__ */ye("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[/* @__PURE__ */be("div",{className:"min-h-0 flex-1 overflow-auto p-1",children:/* @__PURE__ */ye("div",{className:"relative w-full",style:{height:18*(g+1)},children:[m.map(e=>/* @__PURE__ */be(Qo,{node:e,left:0,width:100,top:18*e.depth,selected:e.id===a?.id,onClick:x},e.id)),h.map(e=>/* @__PURE__ */be(Qo,{node:e,left:(e.x-d)/c*100,width:e.width/c*100,top:18*e.depth,selected:e.id===a?.id,onClick:x},e.id))]})}),l&&/* @__PURE__ */be(Ho,{active:a,commit:e,model:t})]}),
348
+ /* @__PURE__ */be(Wo,{})]})},Zo=({row:e,flat:t,sessionSelf:a})=>{let r=Ro(e.id,t);/* @__PURE__ */
349
+ return ye("aside",{className:"border-ui-line bg-ui-panel flex w-52 shrink-0 flex-col gap-1.5 overflow-auto border-l px-3 py-2 text-[10px]",children:[
350
+ /* @__PURE__ */ye("div",{className:"flex items-center gap-1.5",children:[
351
+ /* @__PURE__ */be("span",{className:m("h-2.5 w-2.5 shrink-0 rounded-sm",So(e.maxSelf))}),
352
+ /* @__PURE__ */be("span",{className:"text-ui-fg truncate text-xs font-medium",children:e.name}),!r&&/* @__PURE__ */be("i",{className:"fa-solid fa-eye-slash shrink-0 text-amber-500",title:"Hidden via visibility"})]}),
353
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle truncate",children:e.type}),!r&&/* @__PURE__ */be("span",{className:"w-fit rounded bg-amber-500/15 px-1 py-0.5 text-[9px] text-amber-600 dark:text-amber-400",children:"hidden (visibility)"}),
354
+ /* @__PURE__ */be("div",{className:"text-ui-fg-subtle mt-1 font-medium tracking-wide uppercase",children:"Renders (session)"}),
355
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Total"}),/* @__PURE__ */ye("span",{className:"text-ui-fg tabular-nums",children:[e.renders,"×"]})]}),
356
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Mounts"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:e.mounts})]}),
357
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Updates"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:e.renders-e.mounts})]}),
358
+ /* @__PURE__ */be("div",{className:"text-ui-fg-subtle mt-1 font-medium tracking-wide uppercase",children:"Self time"}),
359
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Total"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:wo(e.totalSelf)})]}),
360
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Average"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:wo(e.avgSelf)})]}),
361
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Max"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:wo(e.maxSelf)})]}),
362
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"Last"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:wo(e.lastSelf)})]}),
363
+ /* @__PURE__ */ye("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg-subtle",children:"% of session"}),/* @__PURE__ */be("span",{className:"text-ui-fg tabular-nums",children:ko(a>0?e.totalSelf/a:0)})]})]})},Go=[{id:"total",label:"Total"},{id:"renders",label:"Renders"},{id:"avg",label:"Avg"},{id:"max",label:"Max"}],Yo=(e,t)=>"renders"===t?e.renders:"avg"===t?e.avgSelf:"max"===t?e.maxSelf:e.totalSelf,ed=({commits:e,tree:t,flat:a,selectedId:r,onSelectElement:l})=>{let[i,n]=_("plitzi-sdk.dev-tools.tracing.sort","total"),s=fe(null),o=pe(()=>Bo(e,t,a).sort((e,t)=>Yo(t,i)-Yo(e,i)),[e,t,a,i]),d=pe(()=>o.reduce((e,t)=>Math.max(e,Yo(t,i)),0)||1,[o,i]),c=pe(()=>o.reduce((e,t)=>e+t.totalSelf,0),[o]),u=pe(()=>o.find(e=>e.id===r),[o,r]),p=pe(()=>o.findIndex(e=>e.id===r),[o,r]);ue(()=>s.current?.scrollIntoView({block:"nearest"}),[r]);let h=de(e=>()=>n(e),[n]),f=de(e=>{if("ArrowUp"!==e.key&&"ArrowDown"!==e.key||0===o.length)return;e.preventDefault();let t=-1===p?0:p,a=Math.max(0,Math.min(o.length-1,t+("ArrowUp"===e.key?-1:1)));l(o[a].id)},[o,p,l]);/* @__PURE__ */
364
+ return ye("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[
365
+ /* @__PURE__ */ye("div",{className:"border-ui-line text-ui-fg-subtle flex shrink-0 items-center gap-2 border-b px-2 py-1.5 text-[10px]",children:[
366
+ /* @__PURE__ */be("span",{className:"text-ui-fg font-medium",children:"Session hotspots"}),
367
+ /* @__PURE__ */ye("span",{children:["· ",o.length," elements · ",e.length," commits"]}),
368
+ /* @__PURE__ */ye("div",{className:"ml-auto flex items-center gap-1",children:[/* @__PURE__ */be("span",{children:"sort"}),Go.map(e=>/* @__PURE__ */be("button",{onClick:h(e.id),"aria-pressed":i===e.id,className:m("rounded px-1.5 py-0.5 text-[10px] font-medium",{"bg-violet-500 text-white":i===e.id,"text-ui-fg-muted hover:bg-ui-hover":i!==e.id}),children:e.label},e.id))]})]}),
369
+ /* @__PURE__ */ye("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[/* @__PURE__ */ye("div",{role:"listbox","aria-label":"Session hotspots",tabIndex:0,onKeyDown:f,className:"min-h-0 flex-1 overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-violet-400",children:[0===o.length&&/* @__PURE__ */be("div",{className:"text-ui-fg-subtle px-2 py-3 text-center text-[10px]",children:"No renders recorded yet"}),o.map(e=>{let t=e.id===r,a=Yo(e,i),n="renders"===i?e.renders/d:a/d;/* @__PURE__ */
370
+ return ye("button",{ref:t?s:void 0,role:"option","aria-selected":t,onClick:()=>l(t?void 0:e.id),title:`${e.name} (${e.type})\n${e.renders} renders (${e.mounts} mount)\ntotal ${wo(e.totalSelf)} · avg ${wo(e.avgSelf)} · max ${wo(e.maxSelf)} · last ${wo(e.lastSelf)}`,className:m("flex w-full items-center gap-2 px-2 py-0.5 text-left",{"bg-violet-500/10":t,"hover:bg-ui-hover":!t}),children:[
371
+ /* @__PURE__ */ye("span",{className:"flex w-40 shrink-0 flex-col",children:[/* @__PURE__ */be("span",{className:"text-ui-fg truncate",children:e.name}),/* @__PURE__ */be("span",{className:"text-ui-fg-subtle truncate text-[9px]",children:e.type})]}),
372
+ /* @__PURE__ */ye("span",{className:"text-ui-fg-subtle w-12 shrink-0 text-right text-[10px] tabular-nums",title:"Times this element rendered itself",children:[e.renders,"×"]}),
373
+ /* @__PURE__ */be("div",{className:"bg-ui-raised h-2 flex-1 overflow-hidden rounded-sm",children:/* @__PURE__ */be("div",{style:{width:`${Math.max(2,Math.round(100*n))}%`},className:m("h-full rounded-sm",So(e.maxSelf))})}),
374
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle w-14 shrink-0 text-right tabular-nums",children:"renders"===i?`${e.renders}×`:wo(a)})]},e.id)})]}),u&&/* @__PURE__ */be(Zo,{row:u,flat:a,sessionSelf:c})]}),
375
+ /* @__PURE__ */be(Wo,{})]})},td=[{id:"self",label:"Self",title:"Own render work — the real per-element cost"},{id:"total",label:"Total",title:"Subtree-inclusive time (cascades up the tree)"}],ad=({metric:e,onChange:t,className:a})=>{let r=de(e=>()=>t(e),[t]);/* @__PURE__ */
376
+ return be("div",{className:m("border-ui-line flex items-center overflow-hidden rounded border",a),children:td.map(t=>/* @__PURE__ */be("button",{title:t.title,"aria-pressed":e===t.id,onClick:r(t.id),className:m("px-1.5 py-0.5 text-[10px] font-medium",{"bg-violet-500 text-white":e===t.id,"text-ui-fg-subtle hover:bg-ui-hover":e!==t.id}),children:t.label},t.id))})},rd=({commit:e,model:t,active:a,origin:r,sidebarOpen:l,onSelectElement:i,onToggleSidebar:n})=>{let[s,o]=_("plitzi-sdk.dev-tools.tracing.metric","self"),d=fe(null),c=pe(()=>t.nodes.filter(e=>"rendered"===e.state).sort((e,t)=>Ao(t,s)-Ao(e,s)),[t,s]),u=pe(()=>c.reduce((e,t)=>Math.max(e,Ao(t,s)),0)||1,[c,s]),p=pe(()=>c.findIndex(e=>e.id===a?.id),[c,a]);ue(()=>d.current?.scrollIntoView({block:"nearest"}),[a]);let h=de(e=>{if("ArrowUp"!==e.key&&"ArrowDown"!==e.key||0===c.length)return;e.preventDefault();let t=-1===p?0:p,a=Math.max(0,Math.min(c.length-1,t+("ArrowUp"===e.key?-1:1)));i(c[a].id)},[c,p,i]);/* @__PURE__ */
377
+ return ye("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[
378
+ /* @__PURE__ */ye("div",{className:"border-ui-line text-ui-fg-subtle flex shrink-0 flex-wrap items-center gap-x-2 gap-y-1 border-b px-2 py-1.5 text-[10px]",children:[
379
+ /* @__PURE__ */ye("span",{className:"text-ui-fg font-medium",children:["Commit #",e.commitId]}),"update"!==r&&/* @__PURE__ */be("span",{className:"rounded bg-violet-100 px-1 text-[9px] font-medium text-violet-700 uppercase dark:bg-violet-500/20 dark:text-violet-300",children:bo[r]}),
380
+ /* @__PURE__ */ye("span",{children:[wo(e.duration)," total"]}),
381
+ /* @__PURE__ */ye("span",{title:"Elements that re-rendered, of all in this commit's subtree",children:["· ",t.renderedCount," of ",e.elementCount," rendered"]}),
382
+ /* @__PURE__ */be(Po,{commit:e,model:t,active:a,onSelectElement:i}),
383
+ /* @__PURE__ */be(ad,{className:"ml-auto",metric:s,onChange:o}),
384
+ /* @__PURE__ */be(Ko,{open:l,onToggle:n})]}),
385
+ /* @__PURE__ */ye("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[/* @__PURE__ */ye("div",{role:"listbox","aria-label":"Rendered elements, ranked",tabIndex:0,onKeyDown:h,className:"min-h-0 flex-1 overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-violet-400",children:[0===c.length&&/* @__PURE__ */be("div",{className:"text-ui-fg-subtle px-2 py-3 text-center text-[10px]",children:"No element re-rendered in this commit"}),c.map(e=>{let r=Ao(e,s),l=e.id===a?.id,n=t.totalSelf>0?e.selfDuration/t.totalSelf:0,o="mount"!==e.phase,c=o&&(void 0===e.changedProps||0===e.changedProps.length&&e.trigger),p=o&&0===e.changedProps?.length&&!e.trigger,h=!!e.changedProps?.length&&e.changedProps.every(e=>e.ref),f=e.changedProps?.map(e=>e.key).join(", "),g=f||(c?"internal state / hook":e.type);/* @__PURE__ */
386
+ return ye("button",{ref:l?d:void 0,role:"option","aria-selected":l,onClick:()=>i(e.id===a?.id?void 0:e.id),title:`${e.name} (${e.type})\n${wo(e.selfDuration)} self · ${wo(e.actualDuration)} total · ${wo(e.baseDuration)} base\nphase: ${e.phase??"update"} · ${ko(n)} of render work${p?"\nno input changed — re-rendered by an ancestor":c?"\nno input changed — internal state/hook/context":h?`\nreference-only change (missing memo): ${f}`:f?`\nchanged: ${f}`:""}`,className:m("flex w-full items-center gap-2 px-2 py-0.5 text-left",{"bg-violet-500/10":l,"hover:bg-ui-hover":!l}),children:[
387
+ /* @__PURE__ */ye("span",{className:"flex w-40 shrink-0 flex-col",children:[/* @__PURE__ */ye("span",{className:"text-ui-fg flex items-center gap-1",children:[e.trigger&&/* @__PURE__ */be("i",{className:"fa-solid fa-bolt shrink-0 text-[9px] text-violet-500",title:"Trigger — a root cause of this commit"}),(p||h)&&/* @__PURE__ */be("i",{className:"fa-solid fa-triangle-exclamation shrink-0 text-[9px] text-amber-500",title:p?"Re-rendered without any input change — possible unnecessary re-render":"Only reference-changed props (shallow-equal content) — likely a missing memo"}),!e.visible&&/* @__PURE__ */be("i",{className:"fa-solid fa-eye-slash shrink-0 text-[9px] text-amber-500",title:"Hidden (visibility)"}),
388
+ /* @__PURE__ */be("span",{className:"truncate",children:e.name})]}),/* @__PURE__ */be("span",{className:"text-ui-fg-subtle truncate text-[9px]",children:g})]}),
389
+ /* @__PURE__ */be("span",{className:m("rounded px-1 text-[9px] uppercase",{"bg-sky-500/15 text-sky-600 dark:text-sky-400":"mount"===e.phase,"bg-amber-500/15 text-amber-600 dark:text-amber-400":"mount"!==e.phase}),children:"mount"===e.phase?"mount":"update"}),
390
+ /* @__PURE__ */be("div",{className:"bg-ui-raised h-2 flex-1 overflow-hidden rounded-sm",children:/* @__PURE__ */be("div",{style:{width:`${Math.max(2,Math.round(r/u*100))}%`},className:m("h-full rounded-sm",So(r))})}),
391
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle w-10 shrink-0 text-right text-[10px] tabular-nums",title:"Share of this commit's total render work",children:ko(n)}),
392
+ /* @__PURE__ */be("span",{className:"text-ui-fg-subtle w-12 shrink-0 text-right tabular-nums",children:wo(r)})]},e.id)})]}),l&&/* @__PURE__ */be(Ho,{active:a,commit:e,model:t})]}),
393
+ /* @__PURE__ */be(Wo,{})]})},ld=[{id:"ranked",label:"Ranked",icon:"fa-solid fa-ranking-star"},{id:"flamegraph",label:"Flamegraph",icon:"fa-solid fa-fire"},{id:"hotspots",label:"Hotspots",icon:"fa-solid fa-temperature-three-quarters"}],id=({view:e,persist:t,commitCount:a,onClear:r,onViewChange:l,onPersistChange:i})=>{let n=de(e=>()=>l(e),[l]),s=de(()=>i(!t),[t,i]);/* @__PURE__ */
394
+ return ye("div",{className:"border-ui-line bg-ui-panel flex shrink-0 items-center gap-2 border-b px-2 py-1.5",children:[/* @__PURE__ */be("div",{className:"flex items-stretch gap-1",children:ld.map(t=>{let a=e===t.id;/* @__PURE__ */
395
+ return ye("button",{onClick:n(t.id),"aria-pressed":a,className:m("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors",{"bg-violet-500 text-white":a,"text-ui-fg-muted hover:bg-ui-hover":!a}),children:[/* @__PURE__ */be("i",{className:t.icon}),t.label]},t.id)})}),/* @__PURE__ */ye("div",{className:"ml-auto flex items-center gap-2",children:[
396
+ /* @__PURE__ */ye("span",{className:"text-ui-fg-subtle text-[10px]",children:[a," commits"]}),
397
+ /* @__PURE__ */ye("button",{onClick:s,"aria-pressed":t,title:"Keep the recorded commits when navigating to another page",className:m("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors",{"bg-violet-500 text-white":t,"text-ui-fg-muted hover:bg-ui-hover":!t}),children:[/* @__PURE__ */be("i",{className:"fa-solid fa-thumbtack"}),"Persist"]}),
398
+ /* @__PURE__ */ye("button",{onClick:r,className:"text-ui-fg-muted hover:bg-ui-hover flex h-6 items-center gap-1 rounded px-2 text-xs font-medium",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-trash"}),"Clear"]})]})]})},nd=()=>{let{enabled:e,hydrated:t,commits:a,tree:r,clear:l}=(()=>{let e=xe(n.subscribe,n.getState,n.getState);return ue(()=>(w.start(),w.stop),[]),{...e,clear:w.clear}})(),[[i,s]]=ae(["schema.flat","navigation.currentPageId"]),[o,d]=_("plitzi-sdk.dev-tools.tracing.view","ranked"),[c,u]=_("plitzi-sdk.dev-tools.tracing.persist",!1),[m,p]=_("plitzi-sdk.dev-tools.tracing.sidebar-open",!1),[h,f]=ge(),[g,x]=ge(),v=fe(s);ue(()=>{v.current!==s&&(v.current=s,c||(l(),f(void 0),x(void 0)))},[s,c,l]);let b=pe(()=>{if(t&&0!==a.length)return{commitId:0,timestamp:a[0].timestamp,duration:0,elementCount:Object.keys(r).length,elements:[],causes:[]}},[t,a,r]),y=pe(()=>b?[b,...a]:a,[b,a]),N=a[0]?.commitId,k=pe(()=>{if(0===y.length)return-1;let e=y.findIndex(e=>e.commitId===h);return-1===e?y.length-1:e},[y,h]),S=-1===k?void 0:y[k],C=0===S?.commitId,$=pe(()=>S&&!C?Fo(S,r,i):void 0,[S,C,r,i]),j=pe(()=>$?.nodes.find(e=>e.id===g)??$?.nodes.find(e=>e.elementId===g),[$,g]);Bi(j?.elementId??g);let T=pe(()=>S?vo(S,t,S.commitId===N):"update",[S,t,N]),I=de(e=>{f(e),x(void 0)},[]),L=de(e=>{x(e),e&&p(!0)},[p]),E=de(()=>p(e=>!e),[p]),R=de(e=>{let t=k+e;t>=0&&t<y.length&&(f(y[t].commitId),x(void 0))},[y,k]),A=de(e=>{("ArrowLeft"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),R("ArrowLeft"===e.key?-1:1))},[R]);/* @__PURE__ */
399
+ return ye("div",e?S?{className:"flex h-full min-h-0 w-full flex-col",onKeyDown:A,children:[
400
+ /* @__PURE__ */be(id,{view:o,persist:c,commitCount:a.length,onClear:l,onViewChange:d,onPersistChange:u}),"hotspots"!==o&&/* @__PURE__ */be(Jo,{commits:y,selectedIndex:k,hydrated:t,onSelect:I}),"hotspots"!==o&&C&&/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex grow flex-col items-center justify-center gap-3 px-6 text-center",children:[
401
+ /* @__PURE__ */be("i",{className:"fa-solid fa-server text-3xl opacity-30"}),
402
+ /* @__PURE__ */be("span",{className:"text-ui-fg-muted text-sm font-medium",children:"Server render (SSR)"}),
403
+ /* @__PURE__ */ye("span",{className:"max-w-md text-xs leading-relaxed",children:["This page was rendered on the server first. React's Profiler doesn't run during server rendering, so there's no per-element timing for it — this commit marks that baseline. Commit #",N," ","is the client ",
404
+ /* @__PURE__ */be("span",{className:"font-medium text-violet-600 dark:text-violet-400",children:"hydration"})," of this tree."]}),
405
+ /* @__PURE__ */ye("span",{className:"text-[11px] opacity-70",children:[S.elementCount," elements in the rendered tree"]})]}),"ranked"===o&&$&&/* @__PURE__ */be(rd,{commit:S,model:$,active:j,origin:T,sidebarOpen:m,onSelectElement:L,onToggleSidebar:E}),"flamegraph"===o&&$&&/* @__PURE__ */be(Xo,{commit:S,model:$,active:j,origin:T,sidebarOpen:m,onSelectElement:L,onToggleSidebar:E}),"hotspots"===o&&/* @__PURE__ */be(ed,{commits:a,tree:r,flat:i,selectedId:g,onSelectElement:L})]}:{className:"flex h-full min-h-0 w-full flex-col",children:[/* @__PURE__ */be(id,{view:o,persist:c,commitCount:a.length,onClear:l,onViewChange:d,onPersistChange:u}),/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex grow flex-col items-center justify-center gap-2",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-chart-column text-3xl opacity-20"}),/* @__PURE__ */be("span",{className:"text-xs",children:"No commits recorded yet — interact with the page"})]})]}:{className:"text-ui-fg-subtle flex h-full w-full flex-col items-center justify-center gap-2",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-gauge-high text-3xl opacity-20"}),/* @__PURE__ */be("span",{className:"text-xs",children:"Enable debugMode to record render tracing"})]})},sd=({className:e,type:t,preffix:a,value:r})=>/* @__PURE__ */ye("div",{className:m("flex items-center gap-1.5",e),children:[a&&/* @__PURE__ */be("span",{className:"text-ui-fg-subtle shrink-0 text-[10px] font-medium tracking-wider uppercase",children:a}),"color"===t&&/* @__PURE__ */be("div",{className:"border-ui-line-strong h-3.5 w-3.5 shrink-0 rounded-sm border",title:r,style:{backgroundColor:r}}),
406
+ /* @__PURE__ */be("span",{className:m("truncate font-mono",{"text-ui-fg":"color"===t,"text-violet-700 dark:text-violet-300":"color"!==t}),title:r,children:r??"—"})]}),od=({name:e,type:t,value:a=""})=>/* @__PURE__ */ye("div",{className:"border-ui-line hover:bg-ui-hover grid grid-cols-[1fr_1.5fr] items-center border-b px-3 py-1.5 transition-colors",children:[/* @__PURE__ */ye("div",{className:"flex min-w-0 flex-col gap-0.5 pr-2",children:[/* @__PURE__ */be("span",{className:"text-ui-fg truncate font-medium",title:e,children:e}),/* @__PURE__ */be("span",{className:"text-ui-fg-subtle text-[10px] tracking-wider uppercase",children:t})]}),/* @__PURE__ */ye("div",{className:"flex min-w-0 flex-col gap-0.5",children:[("string"==typeof a||"number"==typeof a)&&/* @__PURE__ */be(sd,{type:t,value:a}),"object"==typeof a&&Object.keys(a).map((e,r)=>/* @__PURE__ */be(sd,{type:t,preffix:`${e}:`,value:a[e]},r))]})]}),dd=({variables:e,variablesParsed:t})=>e&&0!==e.length?/* @__PURE__ */ye("div",{className:"border-ui-line w-full overflow-hidden rounded border",children:[/* @__PURE__ */ye("div",{className:"border-ui-line bg-ui-raised text-ui-fg-subtle grid grid-cols-[1fr_1.5fr] border-b px-3 py-1",children:[/* @__PURE__ */be("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Name"}),/* @__PURE__ */be("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Value"})]}),e.map((e,a)=>/* @__PURE__ */be(od,{name:e.name,type:e.type,value:t?.[e.name]},a))]}):/* @__PURE__ */be("div",{className:"text-ui-fg-subtle py-4 text-center text-xs italic",children:"No variables defined"}),cd=({variables:e})=>{let t=pe(()=>Object.entries(e??{}).reduce((e,[t,a])=>(Object.keys(a).forEach(r=>{e.push({name:r,type:"color"===t?"color":"text",value:a[r]})}),e),[]),[e]);return 0===t.length?/* @__PURE__ */be("div",{className:"text-ui-fg-subtle py-4 text-center text-xs italic",children:"No style variables defined"}):/* @__PURE__ */ye("div",{className:"border-ui-line w-full overflow-hidden rounded border",children:[/* @__PURE__ */ye("div",{className:"border-ui-line bg-ui-raised text-ui-fg-subtle grid grid-cols-[1fr_1.5fr] border-b px-3 py-1",children:[/* @__PURE__ */be("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Name"}),/* @__PURE__ */be("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Value"})]}),t.map((e,t)=>/* @__PURE__ */be(od,{name:e.name,type:e.type,value:e.value},t))]})},ud=()=>{let[[e,t,a]]=ae(["schema.variables","style.variables","runtime.sources.variables"]);/* @__PURE__ */
407
+ return ye("div",{className:"flex w-full flex-col gap-4 overflow-y-auto p-3",children:[/* @__PURE__ */ye("section",{className:"flex flex-col gap-1.5",children:[/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex items-center gap-2 text-[10px] font-semibold tracking-wider uppercase",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-code"}),"Schema Variables"]}),/* @__PURE__ */be(dd,{variables:e,variablesParsed:a})]}),/* @__PURE__ */ye("section",{className:"flex flex-col gap-1.5",children:[/* @__PURE__ */ye("div",{className:"text-ui-fg-subtle flex items-center gap-2 text-[10px] font-semibold tracking-wider uppercase",children:[/* @__PURE__ */be("i",{className:"fa-solid fa-palette"}),"Style Variables"]}),/* @__PURE__ */be(cd,{variables:t})]})]})},md=({className:e,tabSelected:t,orientation:a,logTypeFilter:r,elementSelected:l,onSelectElement:i,qa:n=!1,run:s})=>{let{logs:o,clearLogs:d}=oe(q);/* @__PURE__ */
408
+ return be("div",{className:m("bg-ui-panel flex min-h-0 w-full flex-1 overflow-auto",e),children:/* @__PURE__ */ye("div",{className:"flex min-h-0 w-full flex-col",children:["logs"===t&&/* @__PURE__ */be(cs,{items:o,orientation:a,logTypeFilter:r,onClear:d}),"store"===t&&/* @__PURE__ */be(xo,{elementSelected:l}),"cache"===t&&/* @__PURE__ */be(bi,{}),"history"===t&&/* @__PURE__ */be(tn,{}),"variables"===t&&/* @__PURE__ */be(ud,{}),"flags"===t&&/* @__PURE__ */be(Xi,{}),"experiments"===t&&/* @__PURE__ */be(Ui,{}),"elements"===t&&/* @__PURE__ */be(Ji,{elementSelected:l,onSelectElement:i}),"plugins"===t&&/* @__PURE__ */be(gs,{}),"tracing"===t&&/* @__PURE__ */be(nd,{}),"actions"===t&&/* @__PURE__ */be(Yl,{}),n&&"qa"===t&&/* @__PURE__ */be(Us,{}),"run"===t&&/* @__PURE__ */be(io,{snapshot:s})]})})},pd=({className:e,iconClassName:t,title:a,isSelected:r=!1,disabled:l=!1,onClick:i})=>/* @__PURE__ */be("button",{className:m("flex h-6 w-6 cursor-pointer items-center justify-center rounded transition-colors disabled:cursor-not-allowed disabled:opacity-40",{"bg-violet-500/10 text-violet-600 dark:bg-violet-500/20 dark:text-violet-400":r,"text-ui-fg-subtle hover:bg-ui-hover hover:text-ui-fg":!r},e),title:a,disabled:l,onClick:i,children:/* @__PURE__ */be("i",{className:m("text-xs",t)})}),hd={system:"light",light:"dark",dark:"system"},fd={system:"fa-solid fa-desktop",light:"fa-solid fa-sun",dark:"fa-solid fa-moon"},gd={system:"System",light:"Light",dark:"Dark"},xd=()=>{let{theme:e,setTheme:t}=E(),a=de(()=>t(hd[e]),[e,t]);/* @__PURE__ */
409
+ return be(pd,{iconClassName:fd[e],title:`Theme: ${gd[e]} — click for ${gd[hd[e]]}`,onClick:a})},vd=[{id:"logs",label:"Logs",icon:"fa-solid fa-terminal"},{id:"store",label:"Store",icon:"fa-solid fa-database"},{id:"cache",label:"Cache",icon:"fa-solid fa-hourglass-half"},{id:"history",label:"History",icon:"fa-solid fa-clock-rotate-left"},{id:"elements",label:"Elements",icon:"fa-solid fa-layer-group"},{id:"variables",label:"Variables",icon:"fa-solid fa-code"},{id:"flags",label:"Flags",icon:"fa-solid fa-flag"},{id:"experiments",label:"Experiments",icon:"fa-solid fa-flask"},{id:"plugins",label:"Plugins",icon:"fa-solid fa-puzzle-piece"},{id:"tracing",label:"Tracing",icon:"fa-solid fa-gauge-high"},{id:"actions",label:"Actions",icon:"fa-solid fa-bolt"},{id:"qa",label:"QA",icon:"fa-solid fa-ruler-combined"},{id:"run",label:"Run",icon:"fa-solid fa-people-group"}],bd=({tabSelected:e,orientation:t="vertical",onChangeOrientation:a,onCollapse:r,onTabSelect:l,qa:i=!1,run:n=!1})=>{let s=vd.filter(e=>("qa"!==e.id||i)&&("run"!==e.id||n)),o=W(),d=fe(null);ue(()=>{d.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest",inline:"nearest"})},[e]);let{options:c,value:u,onSelect:p}=xi(),h=de(()=>{a?.("horizontal"===t?"vertical":"horizontal")},[t,a]),f=de(e=>()=>l?.(e),[l]),g=de(e=>p(e.target.value),[p]);/* @__PURE__ */
410
+ return ye("div",{className:"border-ui-line bg-ui-raised flex shrink-0 items-stretch justify-between border-b select-none",children:[/* @__PURE__ */be("div",{ref:d,role:"tablist",className:"flex min-w-0 items-stretch overflow-x-auto",children:s.map(t=>{let a=e===t.id;/* @__PURE__ */
411
+ return ye("button",{role:"tab","aria-selected":a,onClick:f(t.id),className:m("flex cursor-pointer items-center gap-1.5 border-b-2 px-3 py-2 font-medium transition-colors",{"border-violet-500 text-violet-600 dark:text-violet-400":a,"text-ui-fg-subtle hover:bg-ui-hover/70 hover:text-ui-fg border-transparent":!a}),children:[/* @__PURE__ */be("i",{className:m(t.icon,"text-[10px]")}),t.label]},t.id)})}),/* @__PURE__ */ye("div",{className:"border-ui-line flex shrink-0 items-center gap-1 border-l px-2",children:[c.length>0&&/* @__PURE__ */be("select",{value:u??"",onChange:g,title:"Instance / StoreProvider driving the panel",className:"border-ui-line-strong bg-ui-panel text-ui-fg max-w-52 rounded border px-1 py-0.5 text-[11px]",children:c.map(e=>/* @__PURE__ */be("optgroup",{label:e.label,children:e.options.map(e=>/* @__PURE__ */be("option",{value:e.value,children:e.label},e.value))},e.label))}),
412
+ /* @__PURE__ */be(xd,{}),
413
+ /* @__PURE__ */be(pd,{iconClassName:m("fa-solid fa-table-columns",{"rotate-90":"vertical"===t}),title:o?"At the bottom while the window is under 900 px: beside it, the page would have no room":"horizontal"===t?"Switch to side panel":"Switch to bottom panel",disabled:o,onClick:h}),
414
+ /* @__PURE__ */be(pd,{iconClassName:"fa-solid fa-xmark",title:"Collapse to the indicator",onClick:r})]})]})},yd=({className:e,elementSelected:t,currentPageId:a,onSelectElement:r})=>{let[l,i]=ge(!1),n=de(e=>{let{id:t}=e?.dataset??{};r(t)},[r]),s=pe(()=>x(n,100),[n]),o=de(e=>{Le(e.target)?.closest(".plitzi-sdk")&&s(Le(e.target)?.closest("[data-id]")??void 0)},[s]),d=de(e=>{Le(e.target)?.closest(".plitzi-sdk")&&(e.stopPropagation(),e.preventDefault(),i(!1))},[]),c=de(e=>{e.stopPropagation(),e.preventDefault(),i(!0)},[i]),u=de(()=>{i(!1),r(a)},[a,r]),p=de(()=>{i(!1),r("")},[r]);return Bi(t),ue(()=>{if(!l||typeof document>"u")return;let e=document.getElementsByClassName("plitzi-sdk")[0];return e?(e.addEventListener("click",d),e.addEventListener("mousemove",o),()=>{e.removeEventListener("click",d),e.removeEventListener("mousemove",o)}):void 0},[d,o,l]),/* @__PURE__ */ye("div",{className:m("border-ui-line bg-ui-raised flex shrink-0 items-center justify-between gap-2 border-b px-2 py-1",e),children:[/* @__PURE__ */ye("div",{className:"flex gap-1",children:[/* @__PURE__ */be(pd,{iconClassName:"fa-regular fa-hand-pointer",title:"Select an element in the page to inspect it",onClick:c,isSelected:l}),/* @__PURE__ */be(pd,{iconClassName:"fa-regular fa-file",title:"Current Page",onClick:u,isSelected:t===a})]}),/* @__PURE__ */be(pd,{iconClassName:"fa-solid fa-ban",onClick:p,title:"Clear",isSelected:!!t})]})},Nd=({className:e,orientation:t="vertical",tabSelected:a,logTypeFilter:r,onCollapse:l,onTabSelect:n,onChangeOrientation:s,qa:o=!1,run:d=!1})=>{let[c,u]=_("plitzi-sdk.dev-tools.size",{width:500,height:200}),[p]=ae("navigation.currentPageId"),[h,f]=ge(),g=(e=>{let[t,a]=ge();return ue(()=>{if(!e||typeof window>"u")return;let t=!1,r=async()=>{try{let e=await fetch(Z,{cache:"no-store"}),r=e.ok?await e.json():void 0;!t&&A(r)&&a(r)}catch{}};r();let l=window.setInterval(()=>{r()},3e3);return()=>{t=!0,window.clearInterval(l)}},[e]),t})(d),x="run"===a&&void 0===g||"qa"===a&&!o?"logs":a,v=pe(()=>"vertical"===t?["w"]:["n"],[t]),b=fe(typeof document<"u"?document.querySelector(".plitzi-sdk"):null),y=de(e=>f(e),[f]),N=de((e,t)=>u(a=>({width:Number.isFinite(e)?e:a.width,height:Number.isFinite(t)?t:a.height})),[u]);/* @__PURE__ */
415
+ return be(I,{className:m("component__container-resizable-sidebar relative z-[1000000] text-xs",e,{"h-full":"vertical"===t}),minConstraintsX:"vertical"===t?500:1/0,maxConstraintsX:"vertical"===t?1e3:1/0,minConstraintsY:"vertical"===t?1/0:34,maxConstraintsY:"vertical"===t?1/0:600,width:"vertical"===t?c.width:1/0,height:"vertical"===t?1/0:c.height,resizeHandles:v,parentRef:b,autoGrow:!1,onChange:N,children:/* @__PURE__ */ye("div",{className:"bg-ui-panel text-ui-fg flex h-full min-h-0 w-full flex-col overflow-hidden",[i]:"",children:[
416
+ /* @__PURE__ */be(bd,{orientation:t,onChangeOrientation:s,onCollapse:l,onTabSelect:n,tabSelected:x,qa:o,run:void 0!==g}),["store","elements"].includes(x)&&/* @__PURE__ */be(yd,{elementSelected:h,onSelectElement:y,currentPageId:p}),
417
+ /* @__PURE__ */be(md,{orientation:t,tabSelected:x,logTypeFilter:r,elementSelected:h,onSelectElement:y,qa:o,run:g})]})})},wd=({className:e,collapsed:t,orientation:a,tabSelected:r,logTypeFilter:l,onOpen:i,onCollapse:n,onTabSelect:s,onChangeOrientation:o,qa:d,run:c})=>{let u=/* @__PURE__ */ye(ve,{children:[t&&/* @__PURE__ */be(Ut,{className:e,onOpen:i}),!t&&/* @__PURE__ */be(Nd,{className:e,orientation:a,tabSelected:r,logTypeFilter:l,qa:d,run:c,onCollapse:n,onTabSelect:s,onChangeOrientation:o})]});return d?/* @__PURE__ */ye(Xe,{collapsed:t,children:[/* @__PURE__ */be(qt,{}),u]}):u};export{wd as default};