@plitzi/plitzi-sdk 0.37.2 → 0.37.4
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.
- package/CHANGELOG.md +1188 -0
- package/dist/index.d.ts +12 -4
- package/dist/index.html +2 -1
- package/dist/modules/App/SpaceThemeProvider.d.ts +19 -0
- package/dist/modules/Network/graphqlClient.d.ts +18 -0
- package/dist/plitzi-sdk-devtools-Q71kUXbL.js +294 -0
- package/dist/plitzi-sdk-devtools-Q71kUXbL.js.gz +0 -0
- package/dist/plitzi-sdk-devtools.css +1 -1
- package/dist/plitzi-sdk-devtools.css.gz +0 -0
- package/dist/plitzi-sdk.css +1 -1
- package/dist/plitzi-sdk.css.gz +0 -0
- package/dist/plitzi-sdk.js +146 -614
- package/dist/plitzi-sdk.js.gz +0 -0
- package/package.json +15 -17
- package/dist/modules/App/AppHelper.d.ts +0 -3
- package/dist/modules/Space/SpaceContext.d.ts +0 -2
- package/dist/modules/Space/SpaceContextProvider.d.ts +0 -6
- package/dist/rolldown-runtime-CxhCXM28.js +0 -1
- package/dist/withElement-DOJg5xqo.js +0 -5
- /package/dist/modules/{index.d.ts → Network/graphqlClient.test.d.ts} +0 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import{A as e,C as t,ComponentContext as a,D as r,E as n,M as i,N as l,O as s,S as d,T as c,_ as o,a as m,b as p,c as u,d as h,f as x,g as f,h as v,i as g,j as b,k as y,l as k,m as N,n as z,o as w,p as C,r as S,s as j,t as T,u as $,v as I,w as V,x as L,y as R}from"@plitzi/plitzi-sdk";import E,{Fragment as D,createContext as A,forwardRef as M,memo as J,use as O,useCallback as F,useContext as P,useEffect as B,useMemo as U,useReducer as K,useRef as H,useState as W,useSyncExternalStore as q}from"react";import{Fragment as Q,jsx as Z,jsxs as _}from"react/jsx-runtime";var X={entries:[],index:-1,canUndo:!1,canRedo:!1},G=()=>{},Y=()=>G,ee=()=>X,te=/* @__PURE__ */new WeakSet;var ae=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>`},re=/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,ne=e=>e?.replace(re,ae)??e,ie=(e,t=!1)=>{let{field:a,value:r}=e;return t?{[a]:{$not:{$regex:r,$options:"i"}}}:{[a]:{$regex:r,$options:"i"}}},le=(e,t=!1)=>{let{field:a,value:r}=e;return t?{[a]:{$not:{$regex:`^${r}`,$options:"i"}}}:{[a]:{$regex:`^${r}`,$options:"i"}}},se=(e,t=!1)=>{let{field:a,value:r}=e;return t?{[a]:{$not:{$regex:`${r}$`,$options:"i"}}}:{[a]:{$regex:`${r}$`,$options:"i"}}},de=(e,t=!1)=>{let{field:a}=e;return t?{[a]:{$ne:""}}:{[a]:""}},ce=(e,t=!1)=>{let{field:a,value:r}=e,n=[];return"string"==typeof r&&r.includes(",")?n=r.split(",").map(e=>e.trim()):("string"==typeof r||"number"==typeof r)&&(n=[r]),t?{[a]:{$nin:n}}:{[a]:{$in:n}}};function oe(e,t=!1,a={}){if(!e)return{};let{combinator:r,rules:n,enabled:i}=e;if(!Array.isArray(n)||!1===i)return{};let l=n.filter(e=>!1!==e.enabled).map(e=>"rules"in e?oe(e,t,a):((e,t)=>{if(!e)return{};let{isBinding:a}=e;a&&(e=((e,t)=>{let{isBinding:a}=e;return a?{...e,value:V(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&&I(r)?{[t]:{$lt:parseFloat(r)}}:{[t]:{$lt:r}};case">":return"string"==typeof r&&I(r)?{[t]:{$gt:parseFloat(r)}}:{[t]:{$gt:r}};case"<=":return"string"==typeof r&&I(r)?{[t]:{$lte:parseFloat(r)}}:{[t]:{$lte:r}};case">=":return"string"==typeof r&&I(r)?{[t]:{$gte:parseFloat(r)}}:{[t]:{$gte:r}};default:return{}}})(e);case"contains":return ie(e);case"doesNotContain":return ie(e,!0);case"beginsWith":return le(e);case"doesNotBeginWith":return le(e,!0);case"endsWith":return se(e);case"doesNotEndWith":return se(e,!0);case"empty":return de(e);case"notEmpty":return de(e,!0);case"in":return ce(e);case"notIn":return ce(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}:d(r[0])&&d(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?l:l.length?1===l.length?l[0]:{[`$${r}`]:l}:{}}var me=(e,t=!1)=>{let{field:a,value:r}=e;return`${a}${t?" not":""} like '%${r}%'`},pe=(e,t=!1)=>{let{field:a,value:r}=e;return`${a}${t?" not":""} like '${r}%'`},ue=(e,t=!1)=>{let{field:a,value:r}=e;return`${a}${t?" not":""} like '%${r}'`},he=(e,t=!1)=>{let{field:a}=e;return`${a} is${t?" not":""} NULL`},xe=(e,t=!1)=>{let{field:a,value:r}=e,n=[];return"string"==typeof r&&r.includes(",")?n=r.split(","):("string"==typeof r||"number"==typeof r)&&(n=[r.toString()]),0!==n.length&&`${a}${t?" not":""} in (${n.map(e=>`'${e.trim()}'`).join(", ")})`},fe=(e,t=!1)=>{let{field:a,value:r}=e,n=[];return"string"==typeof r&&(n=r.split(",").map(e=>e.trim())),!(n.length<2)&&(d(n[0])&&d(n[1])?`${a}${t?" not":""} between DATE '${n[0]}' and '${n[1]}'`:`${a}${t?" not":""} between '${n[0]}' and '${n[1]}'`)};function ve(e,t=!0,a={}){if(!e)return"";let{combinator:r,rules:n,enabled:i}=e;if(!Array.isArray(n)||!1===i)return"";let l=n.filter(e=>!1!==e.enabled).map(e=>"rules"in e?`(${t?ve(e,t,a).toString():ve(e,t,a)})`:((e,t)=>{if(!e)return{};let{isBinding:a}=e;a&&(e=((e,t)=>e.isBinding?{...e,value:V(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||I(a)?"number"==typeof a||I(a)?`${t} ${r} ${a}`:d(a)?`${t} ${r} DATE '${a.toString()}'`:`${t} ${r} '${JSON.stringify(a)}'`:`${t} ${r} '${a}'`})(e);case"contains":return me(e);case"doesNotContain":return!me(e,!0);case"beginsWith":return pe(e);case"doesNotBeginWith":return pe(e,!0);case"endsWith":return ue(e);case"doesNotEndWith":return ue(e,!0);case"empty":return he(e);case"notEmpty":return he(e,!0);case"in":return xe(e);case"notIn":return xe(e,!0);case"between":return fe(e);case"notBetween":return fe(e,!0);default:return!1}})(e,a));return t?l:l.join(` ${r} `)}var ge=()=>{let e=q(x.subscribe,x.getState,x.getState);return B(()=>(h.start(),h.stop),[]),{...e,clear:h.clear}},be=({className:e,onOpen:t})=>{let{logs:a}=O(N),{errors:r,warnings:n}=U(()=>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]),i=F(()=>{r>0?t("danger"):n>0?t("warning"):t()},[r,n,t]);/* @__PURE__ */
|
|
2
|
+
return Z("div",{className:l("absolute bottom-3 left-3 z-[1000000]",e),children:/* @__PURE__ */_("button",{className:l("flex cursor-pointer items-center gap-2 rounded border border-zinc-200 bg-white px-2 py-1.5 text-[12px]/[16px]","font-bold text-zinc-600 shadow-md transition-colors select-none hover:bg-zinc-50","dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800"),title:"Plitzi dev tools",onClick:i,children:["Plitzi",r>0&&/* @__PURE__ */_("span",{className:"flex items-center gap-1 text-red-600 dark:text-red-400",children:[/* @__PURE__ */Z("i",{className:"fa-regular fa-circle-xmark text-[11px]"}),r]}),n>0&&/* @__PURE__ */_("span",{className:"flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-triangle-exclamation text-[11px]"}),n]}),0===r&&0===n&&/* @__PURE__ */Z("i",{className:"fa-solid fa-terminal text-[11px] text-zinc-400"})]})})},ye=[{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"}],ke=({filter:e,query:t,liveCount:a,runCount:r,onFilterChange:n,onQueryChange:i,onClear:s})=>{let d=F(e=>()=>n(e),[n]),c=F(e=>i(e.target.value),[i]);/* @__PURE__ */
|
|
3
|
+
return _("div",{className:"flex shrink-0 items-center gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1.5 dark:border-zinc-800 dark:bg-zinc-900",children:[
|
|
4
|
+
/* @__PURE__ */Z("div",{className:"flex items-stretch gap-1",children:ye.map(t=>{let r=e===t.id;/* @__PURE__ */
|
|
5
|
+
return _("button",{onClick:d(t.id),"aria-pressed":r,className:l("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors",{"bg-violet-500 text-white":r,"text-zinc-600 hover:bg-zinc-200 dark:text-zinc-400 dark:hover:bg-zinc-700":!r}),children:[
|
|
6
|
+
/* @__PURE__ */Z("i",{className:l(t.icon,"live"===t.id&&a>0&&"fa-spin")}),t.label,"live"===t.id&&a>0&&/* @__PURE__ */Z("span",{className:"tabular-nums",children:a})]},t.id)})}),
|
|
7
|
+
/* @__PURE__ */Z("input",{type:"search",value:t,onChange:c,placeholder:"Filter by action, step or run id",className:"h-6 min-w-0 grow rounded border border-zinc-200 bg-white px-2 text-xs text-zinc-700 placeholder:text-zinc-400 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-200"}),
|
|
8
|
+
/* @__PURE__ */_("span",{className:"shrink-0 text-[10px] text-zinc-400 tabular-nums dark:text-zinc-500",children:[r," runs"]}),
|
|
9
|
+
/* @__PURE__ */_("button",{onClick:s,className:"flex h-6 shrink-0 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 hover:bg-zinc-200 dark:text-zinc-300 dark:hover:bg-zinc-700",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-trash"}),"Clear"]})]})},Ne=({children:e})=>{let[t,a]=T("plitzi-sdk.dev-tools.actions.detail-width",280),r=F(e=>{Number.isFinite(e)&&a(e)},[a]);/* @__PURE__ */
|
|
10
|
+
return Z(k,{className:"shrink-0 border-l border-zinc-200 dark:border-zinc-800",resizeHandles:["w"],axis:"x",autoGrow:!1,width:t,minConstraintsX:200,maxConstraintsX:520,onChange:r,children:/* @__PURE__ */Z("aside",{className:"flex h-full w-full flex-col gap-1.5 overflow-auto bg-zinc-50 px-3 py-2 text-[10px] dark:bg-zinc-900/50",children:e})})},ze=e=>void 0===e.endedAt,we=e=>void 0===e.endedAt?void 0:e.endedAt-e.startedAt,Ce=e=>e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`,Se=e=>new Date(e).toLocaleTimeString(),je={running:"info",streaming:"info",accepted:"info",completed:"success",failed:"danger",aborted:"warning",skipped:"custom"},Te=e=>je[e]??"custom",$e={success:"success",failed:"danger",skipped:"custom",disabled:"custom"},Ie=e=>$e[e],Ve={success:"fa-solid fa-check",failed:"fa-solid fa-xmark",skipped:"fa-solid fa-forward",disabled:"fa-solid fa-ban"},Le={success:"bg-emerald-500/70",failed:"bg-red-500/80",skipped:"bg-zinc-400/40",disabled:"bg-zinc-400/30"},Re={await:"await",detached:"detached",stream:"stream",render:"render"},Ee={await:"fa-solid fa-right-left",detached:"fa-solid fa-paper-plane",stream:"fa-solid fa-wave-square",render:"fa-solid fa-server"},De=e=>`${e} ${1===e?"step":"steps"}`,Ae=e=>e?.find(e=>"failed"===e.status),Me={},Je=/*#__PURE__*/A(Me),Oe=(e,t)=>w({},e,t),Fe=/*#__PURE__*/A(()=>{});function Pe(){return P(Fe)}Fe.displayName="JVR.DispatchShowTools";var Be=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
|
|
11
|
+
return Z(Je.Provider,{value:t,children:/*#__PURE__*/Z(Fe.Provider,{value:a,children:r})})};Be.displayName="JVR.ShowTools";var Ue={},Ke=/*#__PURE__*/A(Ue),He=(e,t)=>w({},e,t),We=()=>P(Ke),qe=/*#__PURE__*/A(()=>{});qe.displayName="JVR.DispatchExpands";var Qe=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
|
|
12
|
+
return Z(Ke.Provider,{value:t,children:/*#__PURE__*/Z(qe.Provider,{value:a,children:r})})};Qe.displayName="JVR.Expands";var Ze={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"}},_e=/*#__PURE__*/A(Ze),Xe=(e,t)=>w({},e,t),Ge=()=>P(_e),Ye=/*#__PURE__*/A(()=>{});function et(e){var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
|
|
13
|
+
return Z(_e.Provider,{value:t,children:/*#__PURE__*/Z(Ye.Provider,{value:a,children:r})})}Ye.displayName="JVR.DispatchTypes",et.displayName="JVR.Types";var tt=["style"];function at(e){var t=e.style,a=j(e,tt),r=w({cursor:"pointer",height:"1em",width:"1em",userSelect:"none",display:"inline-flex"},t);/*#__PURE__*/
|
|
14
|
+
return Z("svg",w({viewBox:"0 0 24 24",fill:"var(--w-rjv-arrow-color, currentColor)",style:r},a,{children:/*#__PURE__*/Z("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}))}at.displayName="JVR.TriangleArrow";var rt={Arrow:{as:"span",className:"w-rjv-arrow",style:{transform:"rotate(0deg)",transition:"all 0.3s"},children:/*#__PURE__*/Z(at,{})},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:"}"}},nt=/*#__PURE__*/A(rt),it=(e,t)=>w({},e,t),lt=()=>P(nt),st=/*#__PURE__*/A(()=>{});st.displayName="JVR.DispatchSymbols";var dt=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
|
|
15
|
+
return Z(nt.Provider,{value:t,children:/*#__PURE__*/Z(st.Provider,{value:a,children:r})})};dt.displayName="JVR.Symbols";var ct={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"}},ot=/*#__PURE__*/A(ct),mt=(e,t)=>w({},e,t),pt=()=>P(ot),ut=/*#__PURE__*/A(()=>{});ut.displayName="JVR.DispatchSection";var ht=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
|
|
16
|
+
return Z(ot.Provider,{value:t,children:/*#__PURE__*/Z(ut.Provider,{value:a,children:r})})};ht.displayName="JVR.Section";var xt={objectSortKeys:!1,indentWidth:15},ft=/*#__PURE__*/A(xt);ft.displayName="JVR.Context";var vt=/*#__PURE__*/A(()=>{});function gt(e,t){return w({},e,t)}vt.displayName="JVR.DispatchContext";var bt=()=>P(ft),yt=e=>{var t=e.children,a=e.initialState,r=e.initialTypes,n=K(gt,Object.assign({},xt,a)),i=n[0],l=n[1],s=K(Oe,Me),d=s[0],c=s[1],o=K(He,Ue),m=o[0],p=o[1],u=K(Xe,Ze),h=u[0],x=u[1],f=K(it,rt),v=f[0],g=f[1],b=K(mt,ct),y=b[0],k=b[1];return B(()=>l(w({},a)),[a]),/*#__PURE__*/Z(ft.Provider,{value:i,children:/*#__PURE__*/Z(vt.Provider,{value:l,children:/*#__PURE__*/Z(Be,{initial:d,dispatch:c,children:/*#__PURE__*/Z(Qe,{initial:m,dispatch:p,children:/*#__PURE__*/Z(et,{initial:w({},h,r),dispatch:x,children:/*#__PURE__*/Z(dt,{initial:v,dispatch:g,children:/*#__PURE__*/Z(ht,{initial:y,dispatch:k,children:t})})})})})})})};yt.displayName="JVR.Provider";var kt=["isNumber","value","parentValue","keyName","keys"],Nt=["as","render"],zt=["as","render"],wt=["as","render"],Ct=["as","style","render"],St=["as","render"],jt=["as","render"],Tt=["as","render"],$t=["as","render"],It=e=>{var t=lt().Quote,a=void 0===t?{}:t,r=e.isNumber,n=e.value,i=e.parentValue,l=e.keyName,s=e.keys,d=j(e,kt);if(r)return null;var c=a.as,o=a.render,m=j(a,Nt),p=c||"span",u=w({},d,m);return"string"==typeof u.children&&(u.children=u.children.trim()||void 0),o&&"function"==typeof o&&o(u,{value:n,parentValue:i,keyName:l,keys:s||(l?[l]:[])})||/*#__PURE__*/Z(p,w({},u))};It.displayName="JVR.Quote";var Vt=e=>{var t=lt().ValueQuote,a=void 0===t?{}:t,r=w({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e)),n=a.as,i=a.render,l=j(a,zt),s=n||"span",d=w({},r,l);return i&&"function"==typeof i&&i(d,{})||/*#__PURE__*/Z(s,w({},d))};Vt.displayName="JVR.ValueQuote";var Lt=e=>{var t=e.value,a=e.parentValue,r=e.keyName,n=e.keys,i=lt().Colon,l=void 0===i?{}:i,s=l.as,d=l.render,c=j(l,wt),o=s||"span";return d&&"function"==typeof d&&d(c,{value:t,parentValue:a,keyName:r,keys:n||(r?[r]:[])})||/*#__PURE__*/Z(o,w({},c))};Lt.displayName="JVR.Colon";var Rt=e=>{var t=lt().Arrow,a=void 0===t?{}:t,r=We(),n=e.expandKey,i=e.style,l=e.value,s=e.parentValue,d=e.keyName,c=e.keys,o=!!r[n],m=a.as,p=a.style,u=a.render,h=j(a,Ct),x=m||"span",f=u&&"function"==typeof u,v=w({},h,{"data-expanded":o,style:w({},p,i)});return f&&u(v,{value:l,parentValue:s,keyName:d,keys:c||(d?[d]:[])})||/*#__PURE__*/Z(x,w({},h,{style:w({},p,i)}))};Rt.displayName="JVR.Arrow";var Et=e=>{var t=e.isBrackets,a=e.value,r=e.parentValue,n=e.keyName,i=e.keys,l=lt(),s=l.BracketsLeft,d=void 0===s?{}:s,c=l.BraceLeft,o=void 0===c?{}:c,m={value:a,parentValue:r,keyName:n,keys:i||(n?[n]:[])};if(t){var p=d.as,u=d.render,h=j(d,St),x=p||"span";return u&&"function"==typeof u&&u(h,m)||/*#__PURE__*/Z(x,w({},h))}var f=o.as,v=o.render,g=j(o,jt),b=f||"span";return v&&"function"==typeof v&&v(g,m)||/*#__PURE__*/Z(b,w({},g))};Et.displayName="JVR.BracketsOpen";var Dt=e=>{var t=e.isBrackets,a=e.isVisiable,r=e.value,n=e.parentValue,i=e.keyName,l={value:r,parentValue:n,keyName:i,keys:e.keys||(i?[i]:[])};if(!a)return null;var s=lt(),d=s.BracketsRight,c=void 0===d?{}:d,o=s.BraceRight,m=void 0===o?{}:o;if(t){var p=c.as,u=c.render,h=j(c,Tt),x=p||"span";return u&&"function"==typeof u&&u(h,l)||/*#__PURE__*/Z(x,w({},h))}var f=m.as,v=m.render,g=j(m,$t),b=f||"span";return v&&"function"==typeof v&&v(g,l)||/*#__PURE__*/Z(b,w({},g))};Dt.displayName="JVR.BracketsClose";var At=e=>{var t,a=e.keyName,r=e.value,n=e.expandKey,i=e.parentValue,l=e.level,s=e.keys,d=void 0===s?[]:s,c=We(),o=bt(),m=o.collapsed,p=o.shouldExpandNodeInitially,u="boolean"==typeof m?m:"number"==typeof m&&l>m,h=null!=(t=c[n])?t:!p&&u,x=p&&p(!h,{value:r,keys:d,level:l,keyName:a,parentValue:i});if(p&&!1===m){if(void 0===c[n]&&!x)return null}else if(void 0===c[n]&&x)return null;var f=Object.keys(r).length;if(h||0===f)return null;var v={keyName:a,value:r,keys:d,parentValue:i},g=Array.isArray(r),b=r instanceof Set;/*#__PURE__*/
|
|
17
|
+
return Z("div",{style:{paddingLeft:4},children:/*#__PURE__*/Z(Dt,w({isBrackets:g||b},v,{isVisiable:!0}))})};At.displayName="JVR.NestedClose";var Mt=["as","render"],Jt=["as","render"],Ot=["as","render"],Ft=["as","render"],Pt=["as","render"],Bt=["as","render"],Ut=["as","render"],Kt=["as","render"],Ht=["as","render"],Wt=["as","render"],qt=["as","render"],Qt=["as","render"],Zt=["as","render"],_t=e=>{if(void 0===e)return"0n";if("string"==typeof e)try{e=BigInt(e)}catch(ei){return"0n"}return e?e.toString()+"n":"0n"},Xt=e=>{var t=e.value,a=e.keyName,r=Ge(),n=r.Set,i=void 0===n?{}:n,l=r.displayDataTypes;if(!(t instanceof Set&&l))return null;var s=i.as,d=i.render,c=j(i,Mt);return d&&"function"==typeof d&&d(c,{type:"type",value:t,keyName:a})||/*#__PURE__*/Z(s||"span",w({},c))};Xt.displayName="JVR.SetComp";var Gt=e=>{var t=e.value,a=e.keyName,r=Ge(),n=r.Map,i=void 0===n?{}:n,l=r.displayDataTypes;if(!(t instanceof Map&&l))return null;var s=i.as,d=i.render,c=j(i,Jt);return d&&"function"==typeof d&&d(c,{type:"type",value:t,keyName:a})||/*#__PURE__*/Z(s||"span",w({},c))};Gt.displayName="JVR.MapComp";var Yt={opacity:.75,paddingRight:4},ea=e=>{var t=e.children,a=void 0===t?"":t,r=e.keyName,n=e.keys,i=Ge(),l=i.Str,s=void 0===l?{}:l,d=i.displayDataTypes,c=bt(),o=c.shortenTextAfterLength,m=void 0===o?30:o,p=c.stringEllipsis,u=void 0===p?"...":p,h=s.as,x=s.render,f=j(s,Ot),v=a,g=W(m&&v.length>m),b=g[0],y=g[1];B(()=>y(m&&v.length>m),[m]);var k=h||"span",N=w({},Yt,s.style||{});m>0&&(f.style=w({},f.style,{cursor:v.length<=m?"initial":"pointer"}),v.length>m&&(f.onClick=()=>{y(!b)}));var z=b?""+v.slice(0,m)+u:v,C=x&&"function"==typeof x,S=C&&x(w({},f,{style:N}),{type:"type",value:a,keyName:r,keys:n}),T=b?"w-rjv-value w-rjv-value-short":"w-rjv-value",$=C&&x(w({},f,{children:z,className:T}),{type:"value",value:a,keyName:r,keys:n});/*#__PURE__*/
|
|
18
|
+
return _(D,{children:[d&&(S||/*#__PURE__*/Z(k,w({},f,{style:N}))),$||/*#__PURE__*/_(D,{children:[
|
|
19
|
+
/*#__PURE__*/Z(Vt,{}),
|
|
20
|
+
/*#__PURE__*/Z(k,w({},f,{className:T,children:z})),
|
|
21
|
+
/*#__PURE__*/Z(Vt,{})]})]})};ea.displayName="JVR.TypeString";var ta=e=>{var t=e.children,a=e.keyName,r=e.keys,n=Ge(),i=n.True,l=void 0===i?{}:i,s=n.displayDataTypes,d=l.as,c=l.render,o=j(l,Ft),m=d||"span",p=w({},Yt,l.style||{}),u=c&&"function"==typeof c,h=u&&c(w({},o,{style:p}),{type:"type",value:t,keyName:a,keys:r}),x=u&&c(w({},o,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
22
|
+
return _(D,{children:[s&&(h||/*#__PURE__*/Z(m,w({},o,{style:p}))),x||/*#__PURE__*/Z(m,w({},o,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};ta.displayName="JVR.TypeTrue";var aa=e=>{var t=e.children,a=e.keyName,r=e.keys,n=Ge(),i=n.False,l=void 0===i?{}:i,s=n.displayDataTypes,d=l.as,c=l.render,o=j(l,Pt),m=d||"span",p=w({},Yt,l.style||{}),u=c&&"function"==typeof c,h=u&&c(w({},o,{style:p}),{type:"type",value:t,keyName:a,keys:r}),x=u&&c(w({},o,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
23
|
+
return _(D,{children:[s&&(h||/*#__PURE__*/Z(m,w({},o,{style:p}))),x||/*#__PURE__*/Z(m,w({},o,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};aa.displayName="JVR.TypeFalse";var ra=e=>{var t=e.children,a=e.keyName,r=e.keys,n=Ge(),i=n.Float,l=void 0===i?{}:i,s=n.displayDataTypes,d=l.as,c=l.render,o=j(l,Bt),m=d||"span",p=w({},Yt,l.style||{}),u=c&&"function"==typeof c,h=u&&c(w({},o,{style:p}),{type:"type",value:t,keyName:a,keys:r}),x=u&&c(w({},o,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
24
|
+
return _(D,{children:[s&&(h||/*#__PURE__*/Z(m,w({},o,{style:p}))),x||/*#__PURE__*/Z(m,w({},o,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};ra.displayName="JVR.TypeFloat";var na=e=>{var t=e.children,a=e.keyName,r=e.keys,n=Ge(),i=n.Int,l=void 0===i?{}:i,s=n.displayDataTypes,d=l.as,c=l.render,o=j(l,Ut),m=d||"span",p=w({},Yt,l.style||{}),u=c&&"function"==typeof c,h=u&&c(w({},o,{style:p}),{type:"type",value:t,keyName:a,keys:r}),x=u&&c(w({},o,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
25
|
+
return _(D,{children:[s&&(h||/*#__PURE__*/Z(m,w({},o,{style:p}))),x||/*#__PURE__*/Z(m,w({},o,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};na.displayName="JVR.TypeInt";var ia=e=>{var t=e.children,a=e.keyName,r=e.keys,n=Ge(),i=n.Bigint,l=void 0===i?{}:i,s=n.displayDataTypes,d=l.as,c=l.render,o=j(l,Kt),m=d||"span",p=w({},Yt,l.style||{}),u=c&&"function"==typeof c,h=u&&c(w({},o,{style:p}),{type:"type",value:t,keyName:a,keys:r}),x=u&&c(w({},o,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
26
|
+
return _(D,{children:[s&&(h||/*#__PURE__*/Z(m,w({},o,{style:p}))),x||/*#__PURE__*/Z(m,w({},o,{className:"w-rjv-value",children:_t(null==t?void 0:t.toString())}))]})};ia.displayName="JVR.TypeFloat";var la=e=>{var t=e.children,a=e.keyName,r=e.keys,n=Ge(),i=n.Url,l=void 0===i?{}:i,s=n.displayDataTypes,d=l.as,c=l.render,o=j(l,Ht),m=d||"span",p=w({},Yt,l.style),u=c&&"function"==typeof c,h=u&&c(w({},o,{style:p}),{type:"type",value:t,keyName:a,keys:r}),x=u&&c(w({},o,{children:null==t?void 0:t.href,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
27
|
+
return _(D,{children:[s&&(h||/*#__PURE__*/Z(m,w({},o,{style:p}))),x||/*#__PURE__*/_("a",w({href:null==t?void 0:t.href,target:"_blank"},o,{className:"w-rjv-value",children:[
|
|
28
|
+
/*#__PURE__*/Z(Vt,{}),null==t?void 0:t.href,
|
|
29
|
+
/*#__PURE__*/Z(Vt,{})]}))]})};la.displayName="JVR.TypeUrl";var sa=e=>{var t=e.children,a=e.keyName,r=e.keys,n=Ge(),i=n.Date,l=void 0===i?{}:i,s=n.displayDataTypes,d=l.as,c=l.render,o=j(l,Wt),m=d||"span",p=w({},Yt,l.style||{}),u=c&&"function"==typeof c,h=u&&c(w({},o,{style:p}),{type:"type",value:t,keyName:a,keys:r}),x=t instanceof Date?t.toLocaleString():t,f=u&&c(w({},o,{children:x,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
30
|
+
return _(D,{children:[s&&(h||/*#__PURE__*/Z(m,w({},o,{style:p}))),f||/*#__PURE__*/Z(m,w({},o,{className:"w-rjv-value",children:x}))]})};sa.displayName="JVR.TypeDate";var da=e=>{var t=e.children,a=e.keyName,r=e.keys,n=Ge(),i=n.Undefined,l=void 0===i?{}:i,s=n.displayDataTypes,d=l.as,c=l.render,o=j(l,qt),m=d||"span",p=w({},Yt,l.style||{}),u=c&&"function"==typeof c,h=u&&c(w({},o,{style:p}),{type:"type",value:t,keyName:a,keys:r}),x=u&&c(w({},o,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
31
|
+
return _(D,{children:[s&&(h||/*#__PURE__*/Z(m,w({},o,{style:p}))),x||/*#__PURE__*/Z(m,w({},o,{className:"w-rjv-value",children:"undefined"}))]})};da.displayName="JVR.TypeUndefined";var ca=e=>{var t=e.children,a=e.keyName,r=e.keys,n=Ge(),i=n.Null,l=void 0===i?{}:i,s=n.displayDataTypes,d=l.as,c=l.render,o=j(l,Qt),m=d||"span",p=w({},Yt,l.style||{}),u=c&&"function"==typeof c,h=u&&c(w({},o,{style:p}),{type:"type",value:t,keyName:a,keys:r}),x=u&&c(w({},o,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
32
|
+
return _(D,{children:[s&&(h||/*#__PURE__*/Z(m,w({},o,{style:p}))),x||/*#__PURE__*/Z(m,w({},o,{className:"w-rjv-value",children:"null"}))]})};ca.displayName="JVR.TypeNull";var oa=e=>{var t=e.children,a=e.keyName,r=e.keys,n=Ge(),i=n.Nan,l=void 0===i?{}:i,s=n.displayDataTypes,d=l.as,c=l.render,o=j(l,Zt),m=d||"span",p=w({},Yt,l.style||{}),u=c&&"function"==typeof c,h=u&&c(w({},o,{style:p}),{type:"type",value:t,keyName:a,keys:r}),x=u&&c(w({},o,{children:null==t?void 0:t.toString(),className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
33
|
+
return _(D,{children:[s&&(h||/*#__PURE__*/Z(m,w({},o,{style:p}))),x||/*#__PURE__*/Z(m,w({},o,{className:"w-rjv-value",children:"NaN"}))]})};oa.displayName="JVR.TypeNan";var ma=e=>{var t=e.value,a={keyName:e.keyName,keys:e.keys};return t instanceof URL?/*#__PURE__*/Z(la,w({},a,{children:t})):"string"==typeof t?/*#__PURE__*/Z(ea,w({},a,{children:t})):!0===t?/*#__PURE__*/Z(ta,w({},a,{children:t})):!1===t?/*#__PURE__*/Z(aa,w({},a,{children:t})):null===t?/*#__PURE__*/Z(ca,w({},a,{children:t})):void 0===t?/*#__PURE__*/Z(da,w({},a,{children:t})):t instanceof Date?/*#__PURE__*/Z(sa,w({},a,{children:t})):"number"==typeof t&&isNaN(t)?/*#__PURE__*/Z(oa,w({},a,{children:t})):"number"==typeof t&&(e=>Number(e)===e&&e%1!=0||isNaN(e))(t)?/*#__PURE__*/Z(ra,w({},a,{children:t})):"bigint"==typeof t?/*#__PURE__*/Z(ia,w({},a,{children:t})):"number"==typeof t?/*#__PURE__*/Z(na,w({},a,{children:t})):null};function pa(e,t,a){var r=P(st),n=[e.className,t.className].filter(Boolean).join(" "),i=w({},e,t,{className:n,style:w({},e.style,t.style),children:t.children||e.children});B(()=>r({[a]:i}),[t])}function ua(e,t,a){var r=P(Ye),n=[e.className,t.className].filter(Boolean).join(" "),i=w({},e,t,{className:n,style:w({},e.style,t.style),children:t.children||e.children});B(()=>r({[a]:i}),[t])}function ha(e,t,a){var r=P(ut),n=[e.className,t.className].filter(Boolean).join(" "),i=w({},e,t,{className:n,style:w({},e.style,t.style),children:t.children||e.children});B(()=>r({[a]:i}),[t])}ma.displayName="JVR.Value";var xa=["as","render"],fa=e=>{var t=pt().KeyName;return ha(void 0===t?{}:t,e,"KeyName"),null};fa.displayName="JVR.KeyName";var va=e=>{var t=e.children,a=e.value,r=e.parentValue,n=e.keyName,i=e.keys,l={color:"number"==typeof t?"var(--w-rjv-key-number, #268bd2)":"var(--w-rjv-key-string, #002b36)"},s=pt().KeyName,d=void 0===s?{}:s,c=d.as,o=d.render,m=j(d,xa);m.style=w({},m.style,l);var p=c||"span";return o&&"function"==typeof o&&o(w({},m,{children:t}),{value:a,parentValue:r,keyName:n,keys:i||(n?[n]:[])})||/*#__PURE__*/Z(p,w({},m,{children:t}))};va.displayName="JVR.KeyNameComp";var ga=["children","value","parentValue","keyName","keys"],ba=["as","render","children"],ya=e=>{var t=pt().Row;return ha(void 0===t?{}:t,e,"Row"),null};ya.displayName="JVR.Row";var ka=e=>{var t=e.children,a=e.value,r=e.parentValue,n=e.keyName,i=e.keys,l=j(e,ga),s=pt().Row,d=void 0===s?{}:s,c=d.as,o=d.render;d.children;var m=j(d,ba),p=c||"div";return o&&"function"==typeof o&&o(w({},l,m,{children:t}),{value:a,keyName:n,parentValue:r,keys:i})||/*#__PURE__*/Z(p,w({},l,m,{children:t}))};ka.displayName="JVR.RowComp";var Na=["keyName","value","parentValue","expandKey","keys","beforeCopy"],za=["as","render"],wa=e=>{var t=e.keyName,a=e.value,r=e.parentValue,n=e.expandKey,i=e.keys,l=e.beforeCopy,s=j(e,Na),d=bt(),c=d.onCopied,o=d.enableClipboard,m=d.beforeCopy,p=P(Je)[n],u=W(!1),h=u[0],x=u[1],f=pt().Copied,v=void 0===f?{}:f,g=null==v?void 0:v.beforeCopy;if(!1===o||!p)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?_t(a):a instanceof Date?a.toLocaleString():JSON.stringify(a,(e,t)=>"bigint"==typeof t?_t(t):t,2);var d=l||g||m;d&&"function"==typeof d&&(s=d(s,t,a,r,n,i)),c&&c(s,a),x(!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(()=>{x(!1),clearTimeout(e)},3e3)}).catch(e=>{})}};v.as;var y=v.render,k=j(v,za),N=w({},k,s,b,{style:w({},k.style,s.style,b.style)});return y&&"function"==typeof y&&y(w({},N,{"data-copied":h}),{value:a,keyName:t,keys:i,parentValue:r})||/*#__PURE__*/Z("svg",w({viewBox:"0 0 32 36"},N,h?{children:/*#__PURE__*/Z("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__*/Z("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 Ca(){var e=H(null);return null===e.current&&(e.current="custom-id-"+Math.random().toString(36).substr(2,9)),e.current}wa.displayName="JVR.Copied";var Sa=e=>{var t,a=e.keyName,r=e.value,n=e.expandKey,i=void 0===n?"":n,l=e.level,s=e.keys,d=void 0===s?[]:s,c=e.parentValue,o=We(),m=bt(),p=m.objectSortKeys,u=m.indentWidth,h=m.collapsed,x=m.shouldExpandNodeInitially,f="boolean"==typeof h?h:"number"==typeof h&&l>h,v=null!=(t=o[i])?t:!x&&f,g=x&&x(!v,{value:r,keys:d,level:l,keyName:a,parentValue:c});if(x&&!1===h){if(void 0===o[i]&&!g)return null}else if(void 0===o[i]&&g)return null;if(v)return null;var b=Array.isArray(r)?Object.entries(r).map(e=>[Number(e[0]),e[1]]):Object.entries(r);return p&&(b=!0===p?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],n=t[0],i=t[1];return"string"==typeof a&&"string"==typeof n?p(a,n,r,i):0})),/*#__PURE__*/Z("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:u,marginLeft:6},children:b.map((e,t)=>{var a=e[0],n=e[1];/*#__PURE__*/
|
|
34
|
+
return Z(Ta,{parentValue:r,keyName:a,keys:[...d,a],value:n,level:l},t)})})};Sa.displayName="JVR.KeyValues";var ja=e=>{var t=e.keyName,a=e.parentValue,r=e.keys,n=e.value,i=bt().highlightUpdates,l="number"==typeof t,s=H(null);!function(e){var t=e.value,a=e.highlightUpdates,r=e.highlightContainer,n=function(e){var t=H();return B(()=>{t.current=e}),t.current}(t),i=U(()=>!(!a||void 0===n)&&(typeof t!=typeof n||("number"==typeof t?!(isNaN(t)&&isNaN(n)||t===n):Array.isArray(t)!==Array.isArray(n)||"object"!=typeof t&&"function"!=typeof t&&(t!==n||void 0))),[a,t]);B(()=>{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:n,highlightUpdates:i,highlightContainer:s});var d={keyName:t,value:n,keys:r,parentValue:a};/*#__PURE__*/
|
|
35
|
+
return _(D,{children:[/*#__PURE__*/_("span",{ref:s,children:[
|
|
36
|
+
/*#__PURE__*/Z(It,w({isNumber:l,"data-placement":"left"},d)),
|
|
37
|
+
/*#__PURE__*/Z(va,w({},d,{children:t})),
|
|
38
|
+
/*#__PURE__*/Z(It,w({isNumber:l,"data-placement":"right"},d))]}),/*#__PURE__*/Z(Lt,w({},d))]})};ja.displayName="JVR.KayName";var Ta=e=>{var t=e.keyName,a=e.value,r=e.parentValue,n=e.level,i=void 0===n?0:n,l=e.keys,s=void 0===l?[]:l,d=Pe(),c=Ca(),o=Array.isArray(a),m=a instanceof Set,p=a instanceof Map,u=a instanceof Date,h=a instanceof URL;if(a&&"object"==typeof a&&!o&&!m&&!p&&!u&&!h||o||m||p){var x=m?Array.from(a):p?Object.fromEntries(a):a;/*#__PURE__*/
|
|
39
|
+
return Z(Ba,{keyName:t,value:x,parentValue:r,initialValue:a,keys:s,level:i+1})}/*#__PURE__*/
|
|
40
|
+
return _(ka,w({className:"w-rjv-line",value:a,keyName:t,keys:s,parentValue:r},{onMouseEnter:()=>d({[c]:!0}),onMouseLeave:()=>d({[c]:!1})},{children:[
|
|
41
|
+
/*#__PURE__*/Z(ja,{keyName:t,value:a,keys:s,parentValue:r}),
|
|
42
|
+
/*#__PURE__*/Z(ma,{keyName:t,value:a,keys:s}),
|
|
43
|
+
/*#__PURE__*/Z(wa,{keyName:t,value:a,keys:s,parentValue:r,expandKey:c})]}))};Ta.displayName="JVR.KeyValuesItem";var $a=["value","keyName"],Ia=["as","render"],Va=e=>{var t=pt().CountInfoExtra;return ha(void 0===t?{}:t,e,"CountInfoExtra"),null};Va.displayName="JVR.CountInfoExtra";var La=e=>{var t=e.value,a=void 0===t?{}:t,r=e.keyName,n=j(e,$a),i=pt().CountInfoExtra,l=void 0===i?{}:i,s=l.as,d=l.render,c=j(l,Ia);if(!d&&!c.children)return null;var o=s||"span",m=d&&"function"==typeof d,p=w({},c,n);return m&&d(p,{value:a,keyName:r})||/*#__PURE__*/Z(o,w({},p))};La.displayName="JVR.CountInfoExtraComps";var Ra=["value","keyName"],Ea=["as","render"],Da=e=>{var t=pt().CountInfo;return ha(void 0===t?{}:t,e,"CountInfo"),null};Da.displayName="JVR.CountInfo";var Aa=e=>{var t=e.value,a=void 0===t?{}:t,r=e.keyName,n=j(e,Ra),i=bt().displayObjectSize,l=pt().CountInfo,s=void 0===l?{}:l;if(!i)return null;var d=s.as,c=s.render,o=j(s,Ea),m=d||"span";o.style=w({},o.style,e.style);var p=Object.keys(a).length;o.children||(o.children=p+" item"+(1===p?"":"s"));var u=w({},o,n);return c&&"function"==typeof c&&c(w({},u,{"data-length":p}),{value:a,keyName:r})||/*#__PURE__*/Z(m,w({},u))};Aa.displayName="JVR.CountInfoComp";var Ma=["as","render"],Ja=e=>{var t=pt().Ellipsis;return ha(void 0===t?{}:t,e,"Ellipsis"),null};Ja.displayName="JVR.Ellipsis";var Oa=e=>{var t=e.isExpanded,a=e.value,r=e.keyName,n=pt().Ellipsis,i=void 0===n?{}:n,l=i.as,s=i.render,d=j(i,Ma),c=l||"span";return s&&"function"==typeof s&&s(w({},d,{"data-expanded":t}),{value:a,keyName:r})||(!t||"object"==typeof a&&0==Object.keys(a).length?null:/*#__PURE__*/Z(c,w({},d)))};Oa.displayName="JVR.EllipsisComp";var Fa=e=>{var t,a=e.keyName,r=e.expandKey,n=e.keys,i=void 0===n?[]:n,l=e.initialValue,s=e.value,d=e.parentValue,c=e.level,o=We(),m=P(qe),p=bt(),u=p.onExpand,h=p.collapsed,x=p.shouldExpandNodeInitially,f="boolean"==typeof h?h:"number"==typeof h&&c>h,v=null!=(t=o[r])?t:!x&&f,g=x&&x(!v,{value:s,keys:i,level:c,keyName:a,parentValue:d});void 0===o[r]&&x&&(v=!g);var b={transform:"rotate("+(v?"-90":"0")+"deg)",transition:"all 0.3s"},y=Object.keys(s).length,k="object"==typeof s,N=Array.isArray(s),z=s instanceof Set,C=0!==y&&(N||z||k),S={style:{display:"inline-flex",alignItems:"center"}};C&&(S.onClick=()=>{var e={expand:!v,value:s,keyid:r,keyName:a};u&&u(e),m({[r]:e.expand})});var j={keyName:a,value:s,keys:i,parentValue:d};/*#__PURE__*/
|
|
44
|
+
return _("span",w({},S,{children:[C&&/*#__PURE__*/Z(Rt,w({style:b,expandKey:r},j)),(a||"number"==typeof a)&&/*#__PURE__*/Z(ja,w({},j)),
|
|
45
|
+
/*#__PURE__*/Z(Xt,{value:l,keyName:a}),
|
|
46
|
+
/*#__PURE__*/Z(Gt,{value:l,keyName:a}),
|
|
47
|
+
/*#__PURE__*/Z(Et,w({isBrackets:N||z},j)),
|
|
48
|
+
/*#__PURE__*/Z(Oa,{keyName:a,value:s,isExpanded:v}),
|
|
49
|
+
/*#__PURE__*/Z(Dt,w({isVisiable:v||!C,isBrackets:N||z},j)),
|
|
50
|
+
/*#__PURE__*/Z(Aa,{value:s,keyName:a}),
|
|
51
|
+
/*#__PURE__*/Z(La,{value:s,keyName:a}),
|
|
52
|
+
/*#__PURE__*/Z(wa,{keyName:a,value:s,expandKey:r,parentValue:d,keys:i})]}))};Fa.displayName="JVR.NestedOpen";var Pa=["className","children","parentValue","keyid","level","value","initialValue","keys","keyName"],Ba=/*#__PURE__*/M((e,t)=>{var a=e.className,r=void 0===a?"":a;e.children;var n=e.parentValue;e.keyid;var i=e.level,l=void 0===i?1:i,s=e.value,d=e.initialValue,c=e.keys,o=e.keyName,m=j(e,Pa),p=Pe(),u=Ca(),h=[r,"w-rjv-inner"].filter(Boolean).join(" ");/*#__PURE__*/
|
|
53
|
+
return _("div",w({className:h,ref:t},m,{onMouseEnter:()=>p({[u]:!0}),onMouseLeave:()=>p({[u]:!1})},{children:[
|
|
54
|
+
/*#__PURE__*/Z(Fa,{expandKey:u,value:s,level:l,keys:c,parentValue:n,keyName:o,initialValue:d}),
|
|
55
|
+
/*#__PURE__*/Z(Sa,{expandKey:u,value:s,level:l,keys:c,parentValue:n,keyName:o}),
|
|
56
|
+
/*#__PURE__*/Z(At,{expandKey:u,value:s,level:l,keys:c,parentValue:n,keyName:o})]}))});Ba.displayName="JVR.Container";var Ua=e=>{var t=lt().BraceLeft;return pa(void 0===t?{}:t,e,"BraceLeft"),null};Ua.displayName="JVR.BraceLeft";var Ka=e=>{var t=lt().BraceRight;return pa(void 0===t?{}:t,e,"BraceRight"),null};Ka.displayName="JVR.BraceRight";var Ha=e=>{var t=lt().BracketsLeft;return pa(void 0===t?{}:t,e,"BracketsLeft"),null};Ha.displayName="JVR.BracketsLeft";var Wa=e=>{var t=lt().BracketsRight;return pa(void 0===t?{}:t,e,"BracketsRight"),null};Wa.displayName="JVR.BracketsRight";var qa=e=>{var t=lt().Arrow;return pa(void 0===t?{}:t,e,"Arrow"),null};qa.displayName="JVR.Arrow";var Qa=e=>{var t=lt().Colon;return pa(void 0===t?{}:t,e,"Colon"),null};Qa.displayName="JVR.Colon";var Za=e=>{var t=lt().Quote;return pa(void 0===t?{}:t,e,"Quote"),null};Za.displayName="JVR.Quote";var _a=e=>{var t=lt().ValueQuote;return pa(void 0===t?{}:t,e,"ValueQuote"),null};_a.displayName="JVR.ValueQuote";var Xa=e=>{var t=Ge().Bigint;return ua(void 0===t?{}:t,e,"Bigint"),null};Xa.displayName="JVR.Bigint";var Ga=e=>{var t=Ge().Date;return ua(void 0===t?{}:t,e,"Date"),null};Ga.displayName="JVR.Date";var Ya=e=>{var t=Ge().False;return ua(void 0===t?{}:t,e,"False"),null};Ya.displayName="JVR.False";var er=e=>{var t=Ge().Float;return ua(void 0===t?{}:t,e,"Float"),null};er.displayName="JVR.Float";var tr=e=>{var t=Ge().Int;return ua(void 0===t?{}:t,e,"Int"),null};tr.displayName="JVR.Int";var ar=e=>{var t=Ge().Map;return ua(void 0===t?{}:t,e,"Map"),null};ar.displayName="JVR.Map";var rr=e=>{var t=Ge().Nan;return ua(void 0===t?{}:t,e,"Nan"),null};rr.displayName="JVR.Nan";var nr=e=>{var t=Ge().Null;return ua(void 0===t?{}:t,e,"Null"),null};nr.displayName="JVR.Null";var ir=e=>{var t=Ge().Set;return ua(void 0===t?{}:t,e,"Set"),null};ir.displayName="JVR.Set";var lr=e=>{var t=Ge().Str;return ua(void 0===t?{}:t,e,"Str"),null};lr.displayName="JVR.StringText";var sr=e=>{var t=Ge().True;return ua(void 0===t?{}:t,e,"True"),null};sr.displayName="JVR.True";var dr=e=>{var t=Ge().Undefined;return ua(void 0===t?{}:t,e,"Undefined"),null};dr.displayName="JVR.Undefined";var cr=e=>{var t=Ge().Url;return ua(void 0===t?{}:t,e,"Url"),null};cr.displayName="JVR.Url";var or=e=>{var t=pt().Copied;return ha(void 0===t?{}:t,e,"Copied"),null};or.displayName="JVR.Copied";var mr=["className","style","value","children","collapsed","shouldExpandNodeInitially","indentWidth","displayObjectSize","shortenTextAfterLength","stringEllipsis","highlightUpdates","enableClipboard","displayDataTypes","objectSortKeys","onExpand","onCopied","beforeCopy"],pr=/*#__PURE__*/M((e,t)=>{var a=e.className,r=void 0===a?"":a,n=e.style,i=e.value,l=e.children,s=e.collapsed,d=void 0!==s&&s,c=e.shouldExpandNodeInitially,o=e.indentWidth,m=void 0===o?15:o,p=e.displayObjectSize,u=void 0===p||p,h=e.shortenTextAfterLength,x=void 0===h?30:h,f=e.stringEllipsis,v=e.highlightUpdates,g=void 0===v||v,b=e.enableClipboard,y=void 0===b||b,k=e.displayDataTypes,N=void 0===k||k,z=e.objectSortKeys,C=void 0!==z&&z,S=e.onExpand,T=e.onCopied,$=e.beforeCopy,I=j(e,mr),V=w({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},n),L=["w-json-view-container","w-rjv",r].filter(Boolean).join(" ");/*#__PURE__*/
|
|
57
|
+
return _(yt,{initialState:{value:i,objectSortKeys:C,indentWidth:m,shouldExpandNodeInitially:!1===d?c:void 0,displayObjectSize:u,collapsed:d,enableClipboard:y,shortenTextAfterLength:x,stringEllipsis:f,highlightUpdates:g,onCopied:T,onExpand:S,beforeCopy:$},initialTypes:{displayDataTypes:N},children:[/*#__PURE__*/Z(Ba,w({value:i},I,{ref:t,className:L,style:V})),l]})});pr.Bigint=Xa,pr.Date=Ga,pr.False=Ya,pr.Float=er,pr.Int=tr,pr.Map=ar,pr.Nan=rr,pr.Null=nr,pr.Set=ir,pr.String=lr,pr.True=sr,pr.Undefined=dr,pr.Url=cr,pr.ValueQuote=_a,pr.Arrow=qa,pr.Colon=Qa,pr.Quote=Za,pr.Ellipsis=Ja,pr.BraceLeft=Ua,pr.BraceRight=Ka,pr.BracketsLeft=Ha,pr.BracketsRight=Wa,pr.Copied=or,pr.CountInfo=Da,pr.CountInfoExtra=Va,pr.KeyName=fa,pr.Row=ya,pr.displayName="JVR.JsonView";var ur,hr={"--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"},xr={...hr,width:"100%",overflow:"auto",padding:"6px",fontSize:"11px"},fr=({value:e})=>{let{resolvedTheme:t}=C();return"object"==typeof e&&e?/* @__PURE__ */Z(pr,{value:e,style:"dark"===t?xr:void 0,enableClipboard:!1,displayDataTypes:!1,collapsed:2}):/* @__PURE__ */Z("pre",{className:"overflow-auto p-1.5 font-mono text-[11px] break-words whitespace-pre-wrap text-zinc-600 dark:text-zinc-300",children:JSON.stringify(e)})},vr=({className:e,logType:t="info",iconClassName:a,title:r,children:n})=>{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__ */
|
|
58
|
+
return _("div",{className:l("flex items-center gap-1",e),title:r,children:[/* @__PURE__ */Z("i",{className:l(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-zinc-500 dark:text-zinc-400":!["danger","warning","info","success"].includes(t)},"text-xs")}),n]})},gr=({bar:e,selected:t,onSelect:a})=>{let{step:r,offset:n,width:i}=e,s=F(()=>a(r.id),[a,r.id]);/* @__PURE__ */
|
|
59
|
+
return _("button",{type:"button",onClick:s,"aria-pressed":t,className:l("flex w-full flex-col gap-1 rounded px-1.5 py-1 text-left transition-colors",{"bg-violet-500/10":t,"hover:bg-zinc-100 dark:hover:bg-zinc-800":!t}),children:[
|
|
60
|
+
/* @__PURE__ */_("div",{className:"flex items-center gap-1.5 text-[11px]",children:[
|
|
61
|
+
/* @__PURE__ */Z(vr,{logType:Ie(r.status),iconClassName:Ve[r.status]}),
|
|
62
|
+
/* @__PURE__ */Z("span",{className:"truncate font-medium text-zinc-700 dark:text-zinc-200",children:r.title}),
|
|
63
|
+
/* @__PURE__ */Z("span",{className:"truncate font-mono text-[10px] text-zinc-400 dark:text-zinc-500",children:r.action}),
|
|
64
|
+
/* @__PURE__ */Z("span",{className:"ml-auto shrink-0 text-zinc-400 tabular-nums dark:text-zinc-500",children:Ce(r.endTime-r.startTime)})]}),
|
|
65
|
+
/* @__PURE__ */Z("div",{className:"h-1 w-full rounded-full bg-zinc-100 dark:bg-zinc-800",children:/* @__PURE__ */Z("div",{className:l("h-1 rounded-full",Le[r.status]),style:{marginLeft:100*n+"%",width:100*i+"%"}})}),void 0!==r.error&&/* @__PURE__ */Z("span",{className:"text-[10px] break-words text-red-600 dark:text-red-400",children:r.error})]})},br=({steps:e,selectedStepId:t,onSelectStep:a})=>{let r=U(()=>(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]),n=r.filter(e=>"flow"===e.step.phase),i=r.filter(e=>"undo"===e.step.phase);/* @__PURE__ */
|
|
66
|
+
return _("div",{className:"flex flex-col gap-0.5",children:[n.map(e=>/* @__PURE__ */Z(gr,{bar:e,selected:e.step.id===t,onSelect:a},e.step.id)),i.length>0&&/* @__PURE__ */_("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__ */Z("i",{className:"fa-solid fa-rotate-left"}),"Compensation"]}),i.map(e=>/* @__PURE__ */Z(gr,{bar:e,selected:e.step.id===t,onSelect:a},e.step.id))]})},yr={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-zinc-500 dark:text-zinc-400"},kr=({run:e,selectedStepId:t,onSelectStep:a})=>{let r=Ae(e.steps),n=we(e),i=U(()=>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__ */
|
|
67
|
+
return _(Q,{children:[
|
|
68
|
+
/* @__PURE__ */_("div",{className:"flex items-center gap-1.5",children:[/* @__PURE__ */Z("span",{className:"truncate text-xs font-medium text-zinc-700 dark:text-zinc-100",children:e.actionId||"(no action named)"}),/* @__PURE__ */Z("span",{className:l("shrink-0 rounded px-1 py-0.5 text-[9px]",yr[Te(e.status)]),children:e.reason??e.status})]}),void 0!==e.error&&/* @__PURE__ */_("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__ */_("span",{className:"font-medium text-red-600 dark:text-red-400",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-circle-exclamation mr-1"}),void 0===r?"The run failed":`Failed at “${r.title}”`]}),/* @__PURE__ */Z("span",{className:"break-words text-red-700 dark:text-red-300",children:e.error})]}),
|
|
69
|
+
/* @__PURE__ */Z("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Flow"}),void 0===e.steps&&/* @__PURE__ */Z("span",{className:"text-zinc-400 italic dark:text-zinc-500",children:ze(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__ */Z(br,{steps:e.steps,selectedStepId:t,onSelectStep:a}),void 0!==t&&void 0===i&&/* @__PURE__ */Z("span",{className:"text-zinc-400 italic dark:text-zinc-500",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__ */Z("div",{className:"overflow-auto rounded border border-zinc-200 dark:border-zinc-700",children:/* @__PURE__ */Z(fr,{value:i})}),
|
|
70
|
+
/* @__PURE__ */Z("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Run"}),
|
|
71
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Mode"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 dark:text-zinc-200",children:Re[e.mode]})]}),
|
|
72
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Started"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:Se(e.startedAt)})]}),
|
|
73
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Took"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:void 0===n?"still running":Ce(n)})]}),void 0!==e.elementId&&/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Element"}),/* @__PURE__ */Z("span",{className:"truncate font-mono text-zinc-600 dark:text-zinc-300",children:e.elementId})]}),void 0!==e.runId&&/* @__PURE__ */_("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Run id"}),/* @__PURE__ */Z("span",{className:"font-mono break-all text-zinc-600 dark:text-zinc-300",children:e.runId})]}),void 0!==e.input&&/* @__PURE__ */_(Q,{children:[/* @__PURE__ */Z("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Input"}),/* @__PURE__ */Z("div",{className:"overflow-auto rounded border border-zinc-200 dark:border-zinc-700",children:/* @__PURE__ */Z(fr,{value:e.input})})]}),void 0!==e.output&&/* @__PURE__ */_(Q,{children:[/* @__PURE__ */Z("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Output"}),/* @__PURE__ */Z("div",{className:"overflow-auto rounded border border-zinc-200 dark:border-zinc-700",children:/* @__PURE__ */Z(fr,{value:e.output})})]}),e.progress.length>0&&/* @__PURE__ */_(Q,{children:[/* @__PURE__ */_("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:["Progress (",e.progress.length,")"]}),/* @__PURE__ */Z("div",{className:"overflow-auto rounded border border-zinc-200 dark:border-zinc-700",children:/* @__PURE__ */Z(fr,{value:e.progress})})]})]})},Nr={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"},zr={info:"border-l-violet-400",success:"border-l-emerald-400",danger:"border-l-red-400",warning:"border-l-amber-400",custom:"border-l-zinc-300 dark:border-l-zinc-600"},wr=({run:e,selected:t,onSelect:a,onCancel:r})=>{let n=F(()=>a(e.id),[a,e.id]),i=F(()=>r(e.id),[r,e.id]),s=Ae(e.steps),d=we(e);/* @__PURE__ */
|
|
74
|
+
return _("div",{className:l("flex items-center gap-2 border-b border-l-2 px-2",zr[Te(e.status)],{"border-b-zinc-100 bg-violet-500/5 dark:border-b-zinc-800":t,"border-b-zinc-100 hover:bg-zinc-50 dark:border-b-zinc-800 dark:hover:bg-zinc-800/60":!t}),children:[/* @__PURE__ */_("button",{type:"button",className:"flex grow flex-col gap-0.5 py-1.5 text-left",onClick:n,children:[/* @__PURE__ */_("div",{className:"flex items-center gap-1.5 text-[11px]",children:[
|
|
75
|
+
/* @__PURE__ */Z(vr,{logType:Te(e.status),iconClassName:Nr[e.status]}),
|
|
76
|
+
/* @__PURE__ */Z("span",{className:"truncate font-medium text-zinc-700 dark:text-zinc-100",children:e.actionId||"(no action named)"}),
|
|
77
|
+
/* @__PURE__ */_("span",{className:"flex shrink-0 items-center gap-1 rounded-sm bg-zinc-100 px-1 text-[9px] text-zinc-500 uppercase dark:bg-zinc-800 dark:text-zinc-400",title:"render"===e.mode?"Run by the server while it built this page":void 0,children:[/* @__PURE__ */Z("i",{className:Ee[e.mode]}),Re[e.mode]]}),
|
|
78
|
+
/* @__PURE__ */Z("span",{className:"ml-auto shrink-0 text-zinc-400 tabular-nums dark:text-zinc-500",children:void 0===d?"…":Ce(d)})]}),/* @__PURE__ */_("div",{className:"flex items-center gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",children:[
|
|
79
|
+
/* @__PURE__ */Z("span",{className:"shrink-0 tabular-nums",children:Se(e.startedAt)}),void 0!==e.steps&&/* @__PURE__ */Z("span",{className:"shrink-0",children:De(e.steps.length)}),void 0!==e.elementId&&/* @__PURE__ */Z("span",{className:"truncate font-mono",children:e.elementId}),void 0!==s&&/* @__PURE__ */_("span",{className:"truncate text-red-500 dark:text-red-400",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-circle-exclamation mr-1"}),s.title]}),void 0===s&&void 0!==e.reason&&/* @__PURE__ */Z("span",{className:"truncate text-amber-600 dark:text-amber-400",children:e.reason})]})]}),ze(e)&&!0===e.cancellable&&/* @__PURE__ */Z(f,{size:"xs",intent:"secondary",onClick:i,children:"Cancel"})]})},Cr=({runs:e,total:t,selectedRunId:a,onSelect:r,onCancel:n})=>/* @__PURE__ */_("div",{className:"flex min-w-0 grow flex-col overflow-auto",children:[0===t&&/* @__PURE__ */Z("div",{className:"p-3 text-[11px] text-zinc-500 dark:text-zinc-400",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__ */Z("div",{className:"p-3 text-[11px] text-zinc-500 dark:text-zinc-400",children:"No run matches this filter."}),e.map(e=>/* @__PURE__ */Z(wr,{run:e,selected:e.id===a,onSelect:r,onCancel:n},e.id))]}),Sr=()=>{let{runs:e,clear:t}=r(),[a]=c("actions.endpoint"),[n,i]=T("plitzi-sdk.dev-tools.actions.filter","all"),[l,d]=W(""),[o,m]=W(),[p,u]=W(),h=U(()=>((e,t,a)=>e.filter(e=>!("live"===t&&!ze(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,n,l),[e,n,l]),x=U(()=>e.filter(ze).length,[e]),f=U(()=>e.find(e=>e.id===o),[e,o]),v=F(e=>{m(t=>t===e?void 0:e),u(void 0)},[]),g=F(e=>{u(t=>t===e?void 0:e)},[]),b=F(e=>s(e),[]),y=F(()=>{t(),m(void 0),u(void 0)},[t]);/* @__PURE__ */
|
|
80
|
+
return _("div",{className:"flex h-full w-full flex-col",children:[
|
|
81
|
+
/* @__PURE__ */Z(ke,{filter:n,query:l,liveCount:x,runCount:e.length,onFilterChange:i,onQueryChange:d,onClear:y}),void 0===a&&/* @__PURE__ */Z("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"}),
|
|
82
|
+
/* @__PURE__ */_("div",{className:"flex min-h-0 grow",children:[/* @__PURE__ */Z(Cr,{runs:h,total:e.length,selectedRunId:o,onSelect:v,onCancel:b}),void 0!==f&&/* @__PURE__ */Z(Ne,{children:/* @__PURE__ */Z(kr,{run:f,selectedStepId:p,onSelectStep:g})})]})]})},jr=({row:e,isOpen:t,value:a,onToggle:r,onExpire:n,onForget:i})=>{let s=F(()=>r(e.key),[r,e.key]),d=F(()=>n(e.uid,e.path),[n,e.uid,e.path]),c=F(()=>i(e.uid,e.path),[i,e.uid,e.path]);/* @__PURE__ */
|
|
83
|
+
return _("li",{className:"border-b border-zinc-100 last:border-0 dark:border-zinc-800",children:[
|
|
84
|
+
/* @__PURE__ */_("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[
|
|
85
|
+
/* @__PURE__ */_("button",{className:"flex min-w-0 grow cursor-pointer items-center gap-2 text-left",onClick:s,"aria-expanded":t,children:[
|
|
86
|
+
/* @__PURE__ */Z("i",{className:l("fa-solid w-2 shrink-0 text-[9px] text-zinc-400 dark:text-zinc-500",t?"fa-chevron-down":"fa-chevron-right")}),
|
|
87
|
+
/* @__PURE__ */Z("span",{className:"shrink-0 rounded-sm bg-zinc-100 px-1 text-[9px] text-zinc-500 uppercase dark:bg-zinc-800 dark:text-zinc-400",children:e.storeLabel}),
|
|
88
|
+
/* @__PURE__ */Z("span",{className:"min-w-0 grow truncate font-mono text-[11px] text-zinc-700 dark:text-zinc-100",children:e.label}),e.tags.map(e=>/* @__PURE__ */Z("span",{className:"shrink-0 rounded bg-violet-500/15 px-1.5 text-[10px] text-violet-600 dark:text-violet-400",children:e},e))]}),
|
|
89
|
+
/* @__PURE__ */Z("span",{className:l("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__ */Z("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:c,children:"Forget"}):/* @__PURE__ */Z("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:d,children:"Expire"})]}),
|
|
90
|
+
/* @__PURE__ */_("div",{className:"flex items-center gap-2 px-2 pb-1.5 pl-6",children:[/* @__PURE__ */Z("span",{className:"h-1 min-w-0 grow overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-800",children:/* @__PURE__ */Z("span",{className:l("block h-full rounded-full",e.isStale?"bg-amber-500/60":"bg-emerald-500/80"),style:{width:`${Math.round(100*e.progress)}%`}})}),/* @__PURE__ */_("span",{className:"shrink-0 text-[10px] text-zinc-500 tabular-nums dark:text-zinc-400",children:["written ",e.age," · ttl ",e.ttl,!1===e.inUse&&" · nothing renders it"+(e.kept?` · ${e.kept}`:"")]})]}),t&&/* @__PURE__ */_("div",{className:"max-h-56 overflow-auto border-t border-zinc-100 bg-zinc-50 px-2 py-1 dark:border-zinc-800 dark:bg-zinc-800/40",children:[/* @__PURE__ */Z("div",{className:"pb-1 font-mono text-[10px] text-zinc-500 dark:text-zinc-400",children:e.path}),/* @__PURE__ */Z(fr,{value:a})]})]})},Tr=g.store,$r=(e,t)=>{if(e===Tr&&t.startsWith("entries."))return g.store.getState().entries[t.slice(8)]},Ir=(e,t)=>{let a=$r(e.entry.store,t);if(!a)return;let r=g.usage(a.key);return{label:a.url,tags:a.tags,usage:r&&{inUse:r.observers>0||r.holds>0,collectAt:r.collectAt}}},Vr=[],Lr=e=>{let t=H(Vr),a=H(/* @__PURE__ */new WeakMap),r=F(t=>{let a=e.map(({store:e})=>e.watchFreshness(t));return()=>a.forEach(e=>e())},[e]),n=F(()=>{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:Vr),t.current},[e]);return q(r,n,n)},Rr=(e,t=0)=>{let[a,r]=W(()=>Date.now());return B(()=>{if(!e)return;let t=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(t)},[e]),Math.max(a,t)},Er=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`},Dr=(e,t)=>{let{store:a,name:r,scopeId:n}=e;return r?a.scopePath?`${r} · ${a.scopePath}`:r:a.scopePath?a.scopePath:a.id?a.id:void 0===n?"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"},Ar=e=>{let t=e.find(e=>void 0===e.scopeId);return t?new Set(Object.keys(t.store.getState())):void 0},Mr=(e,t,a)=>e.filter(e=>e.scopeId===t||void 0===e.scopeId&&t===a),Jr=(e,t)=>t&&e.some(e=>e.uid===t)?t:(e.find(e=>void 0===e.scopeId)??e.at(0))?.uid,Or=/* @__PURE__ */new Set,Fr=e=>(Or.add(e),()=>{Or.delete(e)}),Pr=()=>ur,Br=()=>q(Fr,Pr,Pr),Ur=()=>q(y,e,e),Kr=()=>{let e=Ur(),{instanceIds:t,selectedId:a}=S(),r=Br();return{options:U(()=>((e,t,a)=>{let r=Ar(e);return t.map(t=>({label:t,options:Mr(e,t,a).map(e=>({label:Dr(e,r),value:e.uid}))}))})(e,t,a),[e,t,a]),value:U(()=>Jr(e,r),[e,r]),onSelect:F(t=>{let a=e.find(e=>e.uid===t);a?.scopeId&&z(a.scopeId),(e=>{ur!==e&&(ur=e,(()=>{for(let e of Or)e()})())})(t)},[e])}},Hr=()=>{let e=Ur(),t=Br(),a=U(()=>Jr(e,t),[e,t]);return U(()=>e.find(e=>e.uid===a),[e,a])},Wr=()=>{let e=(()=>{let e=Ur(),{selectedId:t}=S();return U(()=>Mr(e,t,t),[e,t])})(),t=Lr(e),a=U(()=>t.reduce((e,t)=>e+Object.keys(t.records).length,0),[t]),r=Rr(a>0),n=U(()=>Ar(e),[e]),i=F(e=>Dr(e.entry,n),[n]),s=U(()=>((e,t,a,r)=>{let n=a;for(let i of e)for(let e of Object.values(i.records))n=Math.max(n,e.updatedAt);return e.flatMap(e=>{let a=t(e);return Object.entries(e.records).map(([t,i])=>((e,t,a,{updatedAt:r,expiresAt:n,ttl:i},l,s)=>{let d=l>=n,c=Number.isFinite(n),o="no expiry";return d?o="stale":c&&(o=`${Er(n-l)} left`),{key:`${e.entry.uid}:${a}`,uid:e.entry.uid,storeLabel:t,path:a,label:s?.label??a,tags:s?.tags??[],isStale:d,age:`${Er(l-r)} ago`,status:o,ttl:Number.isFinite(i)?Er(i):"∞",inUse:s?.usage?.inUse,kept:s?.usage?.collectAt?`forgotten in ${Er(s.usage.collectAt-l)}`:void 0,progress:d?0:Math.min(1,Number.isFinite(i)?(n-l)/i:1)}})(e,a,t,i,n,r?.(e,t)))}).sort((e,t)=>Number(e.isStale)-Number(t.isStale)||e.storeLabel.localeCompare(t.storeLabel)||e.label.localeCompare(t.label))})(t,i,r,Ir),[t,i,r]),[d,c]=W(""),[o,m]=W(!1),[p,u]=W(void 0),h=U(()=>{let e=d.trim().toLowerCase();return s.filter(t=>!(o&&!t.isStale)&&(!e||t.label.toLowerCase().includes(e)||t.storeLabel.toLowerCase().includes(e)||t.tags.some(t=>t.toLowerCase().includes(e))))},[s,d,o]),x=U(()=>{let e=h.find(e=>e.key===p);if(e)return t.find(t=>t.entry.uid===e.uid)?.entry.store.getPath(e.path)},[h,p,t]),f=F(e=>u(t=>t===e?void 0:e),[]),v=F(()=>m(e=>!e),[]),b=F((e,a)=>{t.find(t=>t.entry.uid===e)?.entry.store.expire(a)},[t]),y=F((e,a)=>{let r=t.find(t=>t.entry.uid===e)?.entry;r&&!((e,t)=>{let a=$r(e,t);return!!a&&g.remove(a.key)})(r.store,a)&&r.store.setState(a,void 0,{unmount:!0})},[t]),k=F(()=>t.forEach(e=>e.entry.store.expire()),[t]);/* @__PURE__ */
|
|
91
|
+
return _("div",{className:"flex h-full w-full flex-col text-[11px]",children:[/* @__PURE__ */_("div",{className:"flex shrink-0 items-center gap-2 border-b border-zinc-200 px-2 py-1 dark:border-zinc-800",children:[
|
|
92
|
+
/* @__PURE__ */Z("span",{className:"font-medium text-zinc-600 dark:text-zinc-300",children:"Cached"}),
|
|
93
|
+
/* @__PURE__ */Z("span",{className:"text-zinc-500 tabular-nums dark:text-zinc-400",children:a}),
|
|
94
|
+
/* @__PURE__ */Z("input",{className:"min-w-0 grow rounded border border-zinc-200 bg-white px-1.5 py-0.5 text-zinc-700 outline-none placeholder:text-zinc-400 focus:border-violet-400 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500",value:d,placeholder:"Filter by URL, store or tag",onChange:e=>c(e.target.value)}),
|
|
95
|
+
/* @__PURE__ */Z("button",{className:l("shrink-0 cursor-pointer rounded px-1.5 py-0.5 font-medium transition-colors",o?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800"),onClick:v,children:"Stale only"}),
|
|
96
|
+
/* @__PURE__ */Z("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:k,children:"Expire all"})]}),0===h.length?/* @__PURE__ */_("div",{className:"flex grow flex-col items-center justify-center gap-2 px-6 text-center text-zinc-500 dark:text-zinc-400",children:[
|
|
97
|
+
/* @__PURE__ */Z("i",{className:"fa-solid fa-database text-3xl opacity-20"}),
|
|
98
|
+
/* @__PURE__ */Z("span",{children:0===a?"Nothing on this page is cached":"Nothing matches the filter"}),0===a&&/* @__PURE__ */Z("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__ */Z("ul",{className:"grow overflow-auto",children:h.map(e=>/* @__PURE__ */Z(jr,{row:e,isOpen:e.key===p,value:e.key===p?x:void 0,onToggle:f,onExpire:b,onForget:y},e.key))})]})},qr=({attribute:e,value:t,isDefinition:a=!1,onSelectElement:r})=>{let[n]=c("schema.flat"),i=F(e=>()=>r?.(e),[r]),l=U(()=>"items"===e&&a&&Array.isArray(t)?/* @__PURE__ */Z("div",{className:"flex flex-col",children:t.map((e,t)=>/* @__PURE__ */Z("div",{className:"cursor-pointer text-purple-400",onClick:i(e),children:V(n,`${e}.definition.label`,e)},t))}):e&&["rootId","parentId"].includes(e)&&a?/* @__PURE__ */Z("div",{className:"cursor-pointer text-purple-400",onClick:i(t),children:V(n,`${t}.definition.label`,t)}):"styleSelectors"===e&&a&&t&&"object"==typeof t?Object.values(t).join(", "):"object"==typeof t&&t?JSON.stringify(t):"boolean"==typeof t?t?"True":"False":t,[e,a,t,i,n]);/* @__PURE__ */
|
|
99
|
+
return Z("div",{className:"grow basis-0 truncate",children:l})},Qr=({attributes:e})=>/* @__PURE__ */Z("div",{className:"w-full text-sm",children:e&&Object.entries(e).map(([e,t],a)=>/* @__PURE__ */_("div",{className:"flex gap-4 border-gray-300 [&:not(:first-child)]:border-t",children:[/* @__PURE__ */Z("div",{className:"grow basis-0",children:e}),/* @__PURE__ */Z(qr,{isAttribute:!0,attribute:e,value:t})]},a))}),Zr=({definition:e,onSelectElement:t})=>/* @__PURE__ */Z("div",{className:"w-full text-sm",children:e&&Object.entries(e).map(([e,a],r)=>/* @__PURE__ */_("div",{className:"flex gap-4 border-gray-300 [&:not(:first-child)]:border-t",children:[/* @__PURE__ */Z("div",{className:"grow basis-0",children:e}),/* @__PURE__ */Z(qr,{isDefinition:!0,attribute:e,value:a,onSelectElement:t})]},r))}),_r=[{label:"Definition"},{label:"Attributes"}],Xr=({definition:e,attributes:t,onSelectElement:a})=>/* @__PURE__ */_(u,{className:"w-full grow gap-4 overflow-hidden p-4",children:[
|
|
100
|
+
/* @__PURE__ */Z(u.Tabs,{items:_r}),
|
|
101
|
+
/* @__PURE__ */Z(u.TabContent,{className:"flex-col",children:/* @__PURE__ */Z(Zr,{definition:e,onSelectElement:a})}),
|
|
102
|
+
/* @__PURE__ */Z(u.TabContent,{children:/* @__PURE__ */Z(Qr,{attributes:t})})]}),Gr=({name:e,id:t,isSelected:a,isVisible:r=!0,onSelect:n})=>{let i=F(()=>n?.(t),[n,t]);/* @__PURE__ */
|
|
103
|
+
return _("div",{className:l("flex w-full cursor-pointer items-center justify-between 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":a,"border-l-transparent text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:border-l-transparent dark:text-zinc-300 dark:hover:bg-zinc-800 dark:hover:text-zinc-100":!a}),onClick:i,children:[/* @__PURE__ */Z("div",{className:"truncate",title:e,children:e}),/* @__PURE__ */Z("i",{className:l("shrink-0 text-[10px]",{"fa-solid fa-eye text-zinc-400 dark:text-zinc-500":r,"fa-solid fa-eye-slash text-zinc-300 dark:text-zinc-700":!r})})]})},Yr=({elements:e,elementSelected:t,onSelect:a})=>{let[r,n]=W(""),i=U(()=>(e??[]).filter(e=>e.definition.label.toLowerCase().includes(r.toLowerCase())),[e,r]),l=U(()=>i.slice(0,200),[i]),s=i.length-l.length,d=F(e=>n(e),[]);/* @__PURE__ */
|
|
104
|
+
return _("div",{className:"flex h-full w-[280px] shrink-0 flex-col gap-2 border-r border-zinc-200 dark:border-zinc-700",children:[/* @__PURE__ */Z("div",{className:"px-2 pt-2",children:/* @__PURE__ */Z(v,{value:r,onChange:d,placeholder:"Search elements...",size:"sm"})}),/* @__PURE__ */_("div",{className:"flex flex-col overflow-y-auto text-xs text-zinc-700 dark:text-zinc-300",children:[0===l.length&&/* @__PURE__ */Z("div",{className:"p-4 text-center text-zinc-400 dark:text-zinc-600",children:"No elements"}),l.map(e=>/* @__PURE__ */Z(Gr,{name:e.definition.label,isSelected:t===e.id,isVisible:V(e,"definition.initialState.visibility",!0),id:e.id,onSelect:a},e.id)),s>0&&/* @__PURE__ */_("div",{className:"p-3 text-center text-[11px] text-zinc-400 dark:text-zinc-600",children:[s," more — narrow the search to reach them"]})]})]})},en=({className:e,elementSelected:t,onSelectElement:a})=>{let[[r,n]]=c(["schema.flat","navigation.currentPageId"]),i=U(()=>Object.values(r).filter(e=>e.definition.rootId===n),[r,n]),s=U(()=>i.find(e=>e.id===t),[i,t]),d=F(e=>a(e),[a]);/* @__PURE__ */
|
|
105
|
+
return _("div",{className:l("flex h-full w-full",e),children:[/* @__PURE__ */Z(Yr,{elements:i,elementSelected:t,onSelect:d}),t&&/* @__PURE__ */Z(Xr,{definition:s?.definition,attributes:s?.attributes,onSelectElement:a})]})},tn=e=>new Date(e).toLocaleTimeString(void 0,{hour12:!1})+"."+String(e%1e3).padStart(3,"0"),an=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},rn=({index:e,path:t,value:a,timestamp:r,isSelected:n,isFuture:i,onSelect:s})=>{let d=H(null),c=F(()=>s(e),[s,e]);return B(()=>{n&&d.current?.scrollIntoView({block:"nearest"})},[n]),/* @__PURE__ */_("button",{ref:d,onClick:c,className:l("flex w-full flex-col gap-0.5 border-b border-zinc-100 px-3 py-1.5 text-left font-mono text-xs dark:border-zinc-800",{"bg-violet-600 text-white dark:bg-violet-600":n,"text-zinc-600 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800/60":!n,"opacity-50":i}),children:[/* @__PURE__ */_("div",{className:"flex w-full items-center gap-2",children:[/* @__PURE__ */Z("span",{className:"grow truncate",children:t??/* @__PURE__ */Z("span",{className:"italic opacity-70",children:0===e?"initial state":"replace"})}),/* @__PURE__ */Z("span",{className:"shrink-0 text-[10px] opacity-70",children:tn(r)})]}),void 0!==a&&/* @__PURE__ */Z("span",{className:"w-full truncate text-[10px] opacity-70",children:an(a)})]})},nn=({index:e,total:t,canUndo:a,canRedo:r,filter:n,onUndo:i,onRedo:l,onClear:s,onFilterChange:d})=>/* @__PURE__ */_("div",{className:"flex shrink-0 flex-col gap-1.5 border-b border-zinc-200 bg-zinc-50 px-2 py-1.5 dark:border-zinc-800 dark:bg-zinc-900",children:[/* @__PURE__ */_("div",{className:"flex items-center gap-1",children:[
|
|
106
|
+
/* @__PURE__ */_("button",{onClick:i,disabled:!a,className:"flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 enabled:hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-300 dark:enabled:hover:bg-zinc-700",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-rotate-left"}),"Undo"]}),
|
|
107
|
+
/* @__PURE__ */_("button",{onClick:l,disabled:!r,className:"flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 enabled:hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-300 dark:enabled:hover:bg-zinc-700",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-rotate-right"}),"Redo"]}),
|
|
108
|
+
/* @__PURE__ */_("div",{className:"ml-auto flex items-center gap-2",children:[/* @__PURE__ */_("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:[e+1," / ",t]}),/* @__PURE__ */_("button",{onClick:s,className:"flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 hover:bg-zinc-200 dark:text-zinc-300 dark:hover:bg-zinc-700",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-trash"}),"Clear"]})]})]}),/* @__PURE__ */Z(v,{value:n,onChange:d,placeholder:"Filter by path...",size:"sm"})]}),ln=()=>{let{entries:e,index:t,canUndo:a,canRedo:r,undo:l,redo:s,travelTo:d,clear:c}=function(){let e=n(void 0,"useStoreHistory"),t=i(e);B(()=>{t||(e=>{b||te.has(e)||te.add(e)})(e)},[t,e]);let a=t?.getSnapshot??ee;return{...q(t?.subscribe??Y,a,a),undo:t?.undo??G,redo:t?.redo??G,travelTo:t?.travelTo??G,clear:t?.clear??G}}(),[o,m]=W(""),p=U(()=>e.map((e,t)=>({entry:e,originalIndex:t})).filter(({entry:e})=>((e,t)=>!t||(e.path??"").toLowerCase().includes(t.toLowerCase()))(e,o)).reverse(),[e,o]),u=F(e=>{if("ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;e.preventDefault();let a,r=p.findIndex(e=>e.originalIndex===t);a=-1===r?"ArrowDown"===e.key?0:p.length-1:"ArrowUp"===e.key?r-1:r+1,!(a<0||a>=p.length)&&d(p[a].originalIndex)},[p,t,d]);/* @__PURE__ */
|
|
109
|
+
return _("div",{className:"flex h-full w-full flex-col",children:[/* @__PURE__ */Z(nn,{index:t,total:e.length,canUndo:a,canRedo:r,filter:o,onUndo:l,onRedo:s,onClear:c,onFilterChange:m}),/* @__PURE__ */_("div",{tabIndex:0,onKeyDown:u,className:"flex flex-1 flex-col overflow-y-auto outline-none",children:[0===p.length&&/* @__PURE__ */_("div",{className:"flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-clock-rotate-left text-3xl opacity-20"}),/* @__PURE__ */Z("span",{className:"text-xs",children:o?"No entries match the filter":"No history yet"})]}),p.map(({entry:e,originalIndex:a})=>/* @__PURE__ */Z(rn,{index:a,path:e.path,value:e.value,timestamp:e.timestamp,isSelected:a===t,isFuture:a>t,onSelect:d},a))]})]})},sn=({className:e="",time:t,message:a,params:r})=>{let{actionId:n,mode:i,runId:s,status:d,reason:c,error:o}=r,m=!!(c??o);/* @__PURE__ */
|
|
110
|
+
return _("div",{className:l("flex flex-col border-b border-gray-100 px-2 py-1 dark:border-zinc-800",e),children:[
|
|
111
|
+
/* @__PURE__ */_("div",{className:"flex items-center gap-2",children:[t&&/* @__PURE__ */Z("span",{className:"text-gray-400",children:t}),
|
|
112
|
+
/* @__PURE__ */Z("span",{className:"grow",children:a??n}),i&&/* @__PURE__ */Z("span",{className:"rounded-sm bg-gray-100 px-1 text-[10px] uppercase dark:bg-zinc-800",children:i}),
|
|
113
|
+
/* @__PURE__ */Z("span",{className:l(m?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-zinc-400"),children:c??d??""})]}),s&&/* @__PURE__ */_("span",{className:"font-mono text-[10px] text-gray-400",children:["run ",s]}),o&&/* @__PURE__ */Z("span",{className:"break-words text-red-600 dark:text-red-400",children:o})]})},dn=({title:e,action:t,duration:a,status:r,level:n,id:i,isSelected:s,onClick:d})=>{let c=F(()=>d(i),[i,d]);/* @__PURE__ */
|
|
114
|
+
return _("div",{className:l("flex cursor-pointer items-center gap-2 border-l-2 px-2 py-1 transition-colors",1===n?"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":s,"border-l-transparent text-zinc-500 hover:bg-zinc-100 hover:text-zinc-800 dark:border-l-transparent dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-200":!s}),onClick:c,children:[/* @__PURE__ */Z("div",{className:l("h-2 w-2 shrink-0 rounded-full",{"bg-emerald-500":"success"===r,"bg-amber-500":"skipped"===r,"bg-zinc-300 dark:bg-zinc-600":"disabled"===r,"bg-zinc-400 dark:bg-zinc-500":"failed"===r}),title:r}),/* @__PURE__ */_("div",{className:"flex min-w-0 grow justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"truncate",children:e}),/* @__PURE__ */_("div",{className:"flex shrink-0 items-center gap-1.5 text-zinc-400 dark:text-zinc-600",children:[/* @__PURE__ */Z("span",{className:"font-mono",children:a}),t&&/* @__PURE__ */Z("span",{className:"rounded bg-zinc-100 px-1 font-mono text-[10px] text-zinc-500 dark:bg-zinc-800 dark:text-zinc-500",children:t})]})]})]})},cn=({className:e,nodeId:t,nodes:a,selected:r,onSelect:n})=>{let i=U(()=>{let e=V(a,t),r=[];for(;e;){let{node:n,startTime:i,endTime:l}=e,s=`${R(i,l)}ms`,d=n.id===t?0:1;r.push({id:n.id,action:n.action,title:n.title,status:e.status,level:d,duration:s}),e=V(a,n.afterNode)}return r},[t,a]),s=F(e=>n?.(e),[n]);/* @__PURE__ */
|
|
115
|
+
return _("div",{className:l("flex flex-col gap-1.5",e),children:[/* @__PURE__ */_("div",{className:"flex items-center gap-1.5 px-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-code-merge"}),"Execution Tree"]}),/* @__PURE__ */Z("div",{className:"flex flex-col",children:i.map((e,t)=>/* @__PURE__ */Z(dn,{id:e.id,action:e.action,title:e.title,duration:e.duration,status:e.status,level:e.level,isSelected:e.id===r,onClick:s},t))})]})},on=({duration:e,status:t,type:a,action:r})=>/* @__PURE__ */_("div",{className:"grid grid-cols-2 gap-x-3 gap-y-0.5 rounded bg-zinc-50 p-2 dark:bg-zinc-800/60",children:[
|
|
116
|
+
/* @__PURE__ */_("div",{className:"flex gap-1.5",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Duration"}),/* @__PURE__ */Z("span",{className:"font-mono text-zinc-700 dark:text-zinc-300",children:e})]}),
|
|
117
|
+
/* @__PURE__ */_("div",{className:"flex gap-1.5",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Type"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 dark:text-zinc-300",children:a})]}),
|
|
118
|
+
/* @__PURE__ */_("div",{className:"flex gap-1.5",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Status"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 dark:text-zinc-300",children:t})]}),
|
|
119
|
+
/* @__PURE__ */_("div",{className:"flex gap-1.5",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Action"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 dark:text-zinc-300",children:r})]})]}),mn=({when:e,whenParams:t})=>{let a=U(()=>e&&0!==Object.keys(e).length?ne(JSON.stringify(o(e,t),null,2)):"",[t,e]);return a?/* @__PURE__ */_("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */Z("span",{className:"text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Params"}),/* @__PURE__ */Z("pre",{className:"overflow-auto rounded bg-zinc-50 p-2 font-mono text-xs leading-5 dark:bg-zinc-800",dangerouslySetInnerHTML:{__html:a}})]}):null},pn=({when:e})=>{let t=U(()=>e&&function(e,t="sql",a=!1,r={}){return"mongodb"===t?oe(e,a,r):ve(e,a,r)}(e)||null,[e]);return t?/* @__PURE__ */_("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */Z("span",{className:"text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Condition"}),/* @__PURE__ */Z("span",{className:"break-all text-zinc-700 dark:text-zinc-300",children:t})]}):null},un=({whenParams:e,name:t="Node Title",startTime:a=0,endTime:r=0,status:n="notStarted",when:i,type:l,action:s})=>{let d=U(()=>`${R(a,r)}ms`,[a,r]);/* @__PURE__ */
|
|
120
|
+
return _("div",{className:"flex w-full flex-col gap-2 p-2 text-zinc-700 dark:text-zinc-300",children:[
|
|
121
|
+
/* @__PURE__ */Z("div",{className:"truncate font-semibold text-zinc-800 dark:text-zinc-200",children:t}),
|
|
122
|
+
/* @__PURE__ */Z(on,{duration:d,status:n,type:l,action:s}),
|
|
123
|
+
/* @__PURE__ */Z(pn,{when:i}),
|
|
124
|
+
/* @__PURE__ */Z(mn,{when:i,whenParams:e})]})},hn=({className:e,node:t,nodes:a})=>{let[r,n]=W(t.id),i=U(()=>V(a,`${r}`),[r,a]),s=F(e=>n(e),[]);/* @__PURE__ */
|
|
125
|
+
return _("div",{className:l("flex",e),children:[
|
|
126
|
+
/* @__PURE__ */Z(cn,{className:"grow basis-0",nodeId:t.id,nodes:a,selected:r,onSelect:s}),
|
|
127
|
+
/* @__PURE__ */Z("div",{className:"mx-1 w-px shrink-0 bg-zinc-200 dark:bg-zinc-800"}),r&&/* @__PURE__ */Z("div",{className:"flex min-w-0 grow basis-0",children:/* @__PURE__ */Z(un,{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})})]})},xn=({triggerName:e,startTime:t,endTime:a,duration:r,elementId:n,hostElementId:i})=>{let[l]=c("schema.flat"),s=U(()=>n?V(l,n):void 0,[n,l]),d=U(()=>p(t,"HH:mm:ss.SSS"),[t]),o=U(()=>p(a,"HH:mm:ss.SSS"),[a]),m=U(()=>{if(typeof document<"u")return document.querySelector(`[data-id="${n}"]`)},[n]),u=F(()=>{m?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[m]),h=F(()=>{m?.classList.add("devtools-element-hovered")},[m]),x=F(()=>{m?.classList.remove("devtools-element-hovered")},[m]);/* @__PURE__ */
|
|
128
|
+
return _("div",{className:"flex justify-around gap-3",children:[
|
|
129
|
+
/* @__PURE__ */_("div",{className:"flex min-w-0 grow basis-0 flex-col",children:[/* @__PURE__ */_("div",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */Z("i",{className:"fa-regular fa-clock"}),"Times"]}),/* @__PURE__ */_("div",{className:"flex flex-col gap-0.5 font-mono text-zinc-700 dark:text-zinc-300",children:[
|
|
130
|
+
/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Start"}),d]}),
|
|
131
|
+
/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"End"}),o]}),
|
|
132
|
+
/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Duration"}),r]})]})]}),
|
|
133
|
+
/* @__PURE__ */Z("div",{className:"w-px shrink-0 bg-zinc-200 dark:bg-zinc-800"}),
|
|
134
|
+
/* @__PURE__ */_("div",{className:"flex min-w-0 grow basis-0 flex-col",children:[/* @__PURE__ */_("div",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-circle-info"}),"Details"]}),/* @__PURE__ */_("div",{className:"flex flex-col gap-0.5 text-zinc-700 dark:text-zinc-300",children:[
|
|
135
|
+
/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Type"}),/* @__PURE__ */Z("span",{children:"Interaction"})]}),
|
|
136
|
+
/* @__PURE__ */_("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */Z("span",{className:"shrink-0 text-zinc-400 dark:text-zinc-500",children:"Trigger"}),/* @__PURE__ */Z("span",{className:"truncate",children:e})]}),i&&/* @__PURE__ */_("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */Z("span",{className:"shrink-0 text-zinc-400 dark:text-zinc-500",children:"Fired on"}),/* @__PURE__ */Z("span",{className:"truncate font-mono",children:i})]}),
|
|
137
|
+
/* @__PURE__ */_("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */Z("span",{className:"shrink-0 text-zinc-400 dark:text-zinc-500",children:"Element"}),/* @__PURE__ */_("span",{className:"cursor-pointer truncate text-violet-600 hover:text-violet-500 dark:text-violet-400 dark:hover:text-violet-300",onClick:u,onMouseEnter:h,onMouseLeave:x,children:[s?.definition.label,n&&/* @__PURE__ */_("span",{className:"ml-1 font-mono text-[10px] text-zinc-400 dark:text-zinc-500",children:["[",n,"]"]})]})]})]})]})]})},fn=({node:e,nodes:t,startTime:a,endTime:r,duration:n,elementId:i,hostElementId:l})=>/* @__PURE__ */_("div",{className:"mx-2 my-1.5 flex flex-col gap-2 overflow-hidden rounded border border-zinc-200 text-xs dark:border-zinc-800",children:[/* @__PURE__ */Z("div",{className:"bg-zinc-50 px-3 py-2 dark:bg-zinc-800/60",children:/* @__PURE__ */Z(xn,{triggerName:e.title,startTime:a,endTime:r,duration:n,elementId:i,hostElementId:l})}),/* @__PURE__ */Z("div",{className:"border-t border-zinc-200 dark:border-zinc-800",children:/* @__PURE__ */Z(hn,{node:e,nodes:t,className:"gap-0"})})]}),vn={danger:"fa-regular fa-circle-xmark",warning:"fa-solid fa-triangle-exclamation",info:"fa-solid fa-circle-info",success:"fa-solid fa-check"},gn={danger:"Error",warning:"Warning",info:"Info",success:"Success"},bn=({className:e,logType:t="info",iconClassName:a,children:r})=>/* @__PURE__ */_("div",{className:l("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-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300":!["danger","warning","info","success"].includes(t)},e),children:[/* @__PURE__ */Z("i",{className:l(a??vn[t],"text-[10px]")}),r??gn[t]]}),yn=({status:e,message:t,time:a})=>/* @__PURE__ */_("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
|
|
138
|
+
/* @__PURE__ */Z("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:a}),"completed"===e&&/* @__PURE__ */Z(bn,{logType:"success",children:"Completed"}),"failed"===e&&/* @__PURE__ */Z(bn,{logType:"danger",children:"Failed"}),"skipped"===e&&/* @__PURE__ */Z(bn,{logType:"custom",iconClassName:"fa-solid fa-forward-step",children:"Skipped"}),
|
|
139
|
+
/* @__PURE__ */Z("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:t})]}),kn=/* @__PURE__ */Z("i",{className:"fa-solid fa-angle-right text-[10px]"}),Nn=/* @__PURE__ */Z("i",{className:"fa-solid fa-angle-down text-[10px]"}),zn=e=>"string"==typeof e?e:JSON.stringify(e),wn=({label:e,children:t})=>/* @__PURE__ */_("div",{className:"flex gap-2",children:[/* @__PURE__ */Z("span",{className:"w-24 shrink-0 text-zinc-400 dark:text-zinc-500",children:e}),/* @__PURE__ */Z("span",{className:"min-w-0 grow break-words text-zinc-700 dark:text-zinc-300",children:t})]}),Cn=({time:e,message:t,params:a})=>{let{node:r,error:n,available:i,param:l,value:s}=a;/* @__PURE__ */
|
|
140
|
+
return _($,{className:"last:border-b-none w-full border-b border-l-2 border-b-zinc-200 border-l-amber-500 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",collapsed:!0,children:[/* @__PURE__ */Z($.Header,{title:/* @__PURE__ */_("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[/* @__PURE__ */Z("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:e}),/* @__PURE__ */Z("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:t})]}),placement:"left",className:{headerTitle:"overflow-hidden",header:"hover:bg-transparent dark:hover:bg-transparent"},iconCollapsed:kn,iconExpanded:Nn}),/* @__PURE__ */Z($.Content,{children:/* @__PURE__ */_("div",{className:"mx-2 my-1.5 flex flex-col gap-1 rounded border border-zinc-200 px-3 py-2 text-xs dark:border-zinc-800",children:[r?.title&&/* @__PURE__ */Z(wn,{label:"Step",children:r.title}),r?.action&&/* @__PURE__ */Z(wn,{label:"Action",children:r.action}),r?.elementId&&/* @__PURE__ */Z(wn,{label:"Element",children:r.elementId}),l&&/* @__PURE__ */Z(wn,{label:"Param",children:l}),void 0!==s&&/* @__PURE__ */Z(wn,{label:"Value",children:zn(s)}),n&&/* @__PURE__ */Z(wn,{label:"Error",children:n}),i&&/* @__PURE__ */Z(wn,{label:"Registered",children:i.length>0?i.join(", "):"nothing on that element"})]})})]})},Sn=/* @__PURE__ */Z("i",{className:"fa-solid fa-angle-right text-[10px]"}),jn=/* @__PURE__ */Z("i",{className:"fa-solid fa-angle-down text-[10px]"}),Tn=({time:e,message:t,params:{elementId:a,hostElementId:r,status:n,node:i,nodes:s,startTime:d=0,endTime:c=0}})=>{let o=U(()=>`${R(d,c)}ms`,[d,c]),{failed:m,skipped:p,disabled:u}=U(()=>{let e=Object.values(s).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}},[s]);/* @__PURE__ */
|
|
141
|
+
return _($,{className:l("last:border-b-none w-full border-b border-l-2 border-b-zinc-200 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",{"border-l-emerald-500":"completed"===n,"border-l-red-500":"failed"===n,"border-l-zinc-300 dark:border-l-zinc-600":"skipped"===n}),collapsed:!0,children:[/* @__PURE__ */Z($.Header,{title:/* @__PURE__ */Z(yn,{status:n,message:t,time:e}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:Sn,iconExpanded:jn,children:/* @__PURE__ */_("div",{className:"flex gap-3 text-zinc-400 dark:text-zinc-500",children:[!!m&&/* @__PURE__ */Z(vr,{logType:"danger",title:"Failed",children:m}),"skipped"!==n&&!!p&&/* @__PURE__ */Z(vr,{logType:"warning",title:"Skipped",children:p}),"skipped"!==n&&!!u&&/* @__PURE__ */Z(vr,{logType:"custom",iconClassName:"fa-solid fa-ban",title:"Disabled",children:u}),o]})}),/* @__PURE__ */Z($.Content,{children:/* @__PURE__ */Z(fn,{elementId:a,hostElementId:r,node:i,nodes:s,startTime:d,endTime:c,duration:o})})]})},$n=({time:e,message:t,params:a})=>(e=>void 0!==e.nodes)(a)?/* @__PURE__ */Z(Tn,{time:e,message:t,params:a}):/* @__PURE__ */Z(Cn,{time:e,message:t,params:a}),In=({elementId:e,startTime:t,endTime:a,duration:r})=>{let[n]=c("schema.flat"),i=U(()=>e?V(n,e):void 0,[e,n]);/* @__PURE__ */
|
|
142
|
+
return _("div",{className:"m-2 flex justify-around gap-4",children:[
|
|
143
|
+
/* @__PURE__ */_("div",{className:"flex min-w-0 grow basis-0 flex-col gap-2",children:[/* @__PURE__ */_("div",{className:"flex items-center gap-1 font-bold",children:[/* @__PURE__ */Z("i",{className:"fa-regular fa-clock"}),"Times"]}),/* @__PURE__ */_("div",{className:"flex flex-col",children:[
|
|
144
|
+
/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z("span",{children:"Started:"}),"string"==typeof t?t:p(t)]}),
|
|
145
|
+
/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z("span",{children:"End:"}),"string"==typeof a?a:p(a)]}),
|
|
146
|
+
/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z("span",{children:"Duration:"}),r]})]})]}),
|
|
147
|
+
/* @__PURE__ */Z("div",{className:"border-r border-gray-300"}),
|
|
148
|
+
/* @__PURE__ */_("div",{className:"flex min-w-0 grow basis-0 flex-col gap-2",children:[/* @__PURE__ */_("div",{className:"flex items-center gap-1",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-circle-info"}),"Details"]}),/* @__PURE__ */_("div",{className:"flex flex-col",children:[
|
|
149
|
+
/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z("span",{children:"Type:"}),/* @__PURE__ */Z("span",{children:"Navigation"})]}),
|
|
150
|
+
/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z("span",{children:"Trigger:"}),/* @__PURE__ */Z("span",{className:"truncate",children:"-"})]}),i&&/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z("span",{children:"Element:"}),/* @__PURE__ */_("span",{className:"cursor-pointer truncate text-blue-500",children:[i.definition.label," [",e,"]"]})]})]})]})]})},Vn=({status:e,message:t,time:a})=>{let{logType:r,statusMessage:n}=U(()=>"normal"===e?{logType:"success",statusMessage:"Success"}:"redirect"===e?{logType:"warning",statusMessage:"Redirected"}:"notFound"===e?{logType:"warning",statusMessage:"Not Found"}:"accessDenied"===e?{logType:"danger",statusMessage:"Access Denied"}:{logType:"custom",statusMessage:""},[e]);/* @__PURE__ */
|
|
151
|
+
return _("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
|
|
152
|
+
/* @__PURE__ */Z("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:"string"==typeof a?a:p(a)}),
|
|
153
|
+
/* @__PURE__ */Z(bn,{logType:r,children:n}),
|
|
154
|
+
/* @__PURE__ */Z("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:t})]})},Ln=/* @__PURE__ */Z("i",{className:"fa-solid fa-angle-right text-[10px]"}),Rn=/* @__PURE__ */Z("i",{className:"fa-solid fa-angle-down text-[10px]"}),En=({time:e,message:t,params:a})=>/* @__PURE__ */_($,{className:l("last:border-b-none w-full border-b border-l-2 border-b-zinc-200 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",{"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__ */Z($.Header,{title:/* @__PURE__ */Z(Vn,{status:a?.status,message:t,time:e}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:Ln,iconExpanded:Rn,children:/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"0ms"})}),/* @__PURE__ */Z($.Content,{children:/* @__PURE__ */Z(In,{elementId:a?.elementId,startTime:e,endTime:e,duration:"0ms"})})]}),Dn=/* @__PURE__ */Z("i",{className:"fa-solid fa-angle-right text-[10px]"}),An=/* @__PURE__ */Z("i",{className:"fa-solid fa-angle-down text-[10px]"}),Mn=({time:e,message:t,params:{event:a,issues:r,payload:n}})=>/* @__PURE__ */_($,{className:"last:border-b-none w-full border-b border-l-2 border-b-zinc-200 border-l-red-500 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",collapsed:!0,children:[/* @__PURE__ */Z($.Header,{title:/* @__PURE__ */_("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
|
|
155
|
+
/* @__PURE__ */Z("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:e}),
|
|
156
|
+
/* @__PURE__ */Z(bn,{logType:"danger",children:"Invalid"}),
|
|
157
|
+
/* @__PURE__ */Z("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:t})]}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:Dn,iconExpanded:An,children:/* @__PURE__ */Z("span",{className:"font-mono text-zinc-400 dark:text-zinc-500",children:a})}),/* @__PURE__ */Z($.Content,{children:/* @__PURE__ */_("div",{className:"flex flex-col gap-1 py-1 pl-4",children:[r.map(e=>/* @__PURE__ */_("div",{className:"flex gap-2",children:[/* @__PURE__ */Z("span",{className:"font-mono text-red-600 dark:text-red-400",children:e.path||"(root)"}),/* @__PURE__ */Z("span",{className:"text-zinc-600 dark:text-zinc-300",children:e.message})]},`${e.path}-${e.message}`)),void 0!==n&&/* @__PURE__ */Z("pre",{className:"mt-1 overflow-x-auto rounded bg-zinc-50 p-2 text-[11px] text-zinc-600 dark:bg-zinc-800/60 dark:text-zinc-300",children:JSON.stringify(n,null,2)})]})})]}),Jn=e=>{if(null==e)return"";if("function"==typeof e)return"Function";try{return JSON.stringify(e,null,2)}catch{return String(e)}},On=({path:e,prev:t,next:a,contextLines:r=10})=>{let n=H(null),[i,s]=W(0),d=U(()=>((e,t)=>{let a=Jn(e).split("\n"),r=Jn(t).split("\n"),n=a.length,i=r.length,l=Array.from({length:n+1},()=>Array(i+1).fill(0));for(let o=1;o<=n;o++)for(let e=1;e<=i;e++)l[o][e]=a[o-1]===r[e-1]?l[o-1][e-1]+1:Math.max(l[o-1][e],l[o][e-1]);let s=[],d=n,c=i;for(;d>0||c>0;)d>0&&c>0&&a[d-1]===r[c-1]?(s.unshift({type:"same",text:a[d-1]}),d--,c--):c>0&&(0===d||l[d][c-1]>=l[d-1][c])?(s.unshift({type:"added",text:r[c-1]}),c--):(s.unshift({type:"removed",text:a[d-1]}),d--);return s})(t,a),[t,a]),c=U(()=>(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})(d),[d]),o=U(()=>((e,t,a)=>{if(0===t.length)return e.map((e,t)=>({kind:"line",line:e,diffIndex:t,hunkIndex:null}));let r=[],n=-1;return t.forEach((i,l)=>{let s=Math.max(0,i.start-a),d=Math.min(e.length-1,i.end+a);s>n+1&&r.push({kind:"separator",hunkIndex:l,total:t.length});for(let t=Math.max(s,n+1);t<=d;t++){let a=t>=i.start&&t<=i.end;r.push({kind:"line",line:e[t],diffIndex:t,hunkIndex:a?l:null})}n=d}),r})(d,c,r),[d,c,r]),m=c.length>0,p=0===i,u=i===c.length-1,h=F(e=>{(n.current?.querySelector(`[data-hunk="${e}"]`))?.scrollIntoView({block:"center"})},[]),x=F(e=>{let t=i+e;t<0||t>=c.length||(s(t),h(t))},[i,c.length,h]);B(()=>{m&&(s(0),h(0))},[d]);let f=F(()=>x(-1),[x]),v=F(()=>x(1),[x]);/* @__PURE__ */
|
|
158
|
+
return _("div",{className:"mx-2 my-1.5 flex flex-col gap-2 rounded border border-zinc-200 bg-zinc-50 font-mono dark:border-zinc-700 dark:bg-zinc-800/50",children:[/* @__PURE__ */_("div",{className:"flex items-center justify-between border-b border-zinc-200 px-2 py-1 dark:border-zinc-700",children:[/* @__PURE__ */_("div",{className:"flex min-w-0 items-center gap-1.5",children:[/* @__PURE__ */Z("span",{className:"shrink-0 text-zinc-500 dark:text-zinc-400",children:"path"}),/* @__PURE__ */Z("span",{className:"truncate text-zinc-400 dark:text-zinc-500",children:e??"(full state)"})]}),/* @__PURE__ */_("div",{className:"flex shrink-0 items-center gap-2",children:[m&&/* @__PURE__ */_("span",{className:"text-zinc-400 tabular-nums dark:text-zinc-600",children:[i+1,"/",c.length]}),
|
|
159
|
+
/* @__PURE__ */Z("button",{className:l("rounded bg-zinc-200 px-2 py-0.5 text-xs text-zinc-600 transition-colors hover:bg-zinc-300 dark:bg-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-600",{"cursor-not-allowed opacity-30 dark:cursor-not-allowed dark:opacity-30":!m||p}),disabled:!m||p,onClick:f,children:"↑ Prev"}),
|
|
160
|
+
/* @__PURE__ */Z("button",{className:l("rounded bg-zinc-200 px-2 py-0.5 text-xs text-zinc-600 transition-colors hover:bg-zinc-300 dark:bg-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-600",{"cursor-not-allowed opacity-30 dark:cursor-not-allowed dark:opacity-30":!m||u}),disabled:!m||u,onClick:v,children:"↓ Next"})]})]}),/* @__PURE__ */_("pre",{ref:n,className:"max-h-64 overflow-auto bg-zinc-50 text-xs leading-5 dark:bg-zinc-800",children:[!m&&/* @__PURE__ */Z("div",{className:"px-3 py-2 text-zinc-400 italic dark:text-zinc-600",children:"No changes"}),o.map((e,t)=>{if("separator"===e.kind){let a=e.hunkIndex===i;/* @__PURE__ */
|
|
161
|
+
return _("div",{"data-hunk":e.hunkIndex,className:l("px-3",{"bg-violet-50 text-violet-600 dark:bg-violet-900/40 dark:text-violet-400":a,"text-zinc-400 dark:text-zinc-700":!a}),children:["@@ hunk ",e.hunkIndex+1,"/",e.total," @@"]},`sep-${t}`)}let{line:a,diffIndex:r,hunkIndex:n}=e,s=n===i;return"removed"===a.type?/* @__PURE__ */_("div",{"data-hunk":n??void 0,className:l("px-3",{"bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-300":s,"bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400":!s}),children:["- ",a.text]},r):"added"===a.type?/* @__PURE__ */_("div",{"data-hunk":n??void 0,className:l("px-3",{"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300":s,"bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400":!s}),children:["+ ",a.text]},r):/* @__PURE__ */_("div",{className:"px-3 text-zinc-400 dark:text-zinc-600",children:[" ",a.text]},r)})]})]})},Fn=({storeName:e,path:t,message:a,time:r})=>/* @__PURE__ */_("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
|
|
162
|
+
/* @__PURE__ */Z("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:"string"==typeof r?r:p(r)}),
|
|
163
|
+
/* @__PURE__ */Z(bn,{logType:"info",children:"Store"}),e&&/* @__PURE__ */Z("span",{className:"shrink-0 font-semibold text-zinc-700 dark:text-zinc-200",children:e}),
|
|
164
|
+
/* @__PURE__ */Z("span",{className:"truncate font-mono text-zinc-400 dark:text-zinc-500",children:t??a??"(full state)"})]}),Pn=/* @__PURE__ */Z("i",{className:"fa-solid fa-angle-right text-[10px]"}),Bn=/* @__PURE__ */Z("i",{className:"fa-solid fa-angle-down text-[10px]"}),Un=({time:e,message:t,params:a})=>/* @__PURE__ */_($,{className:"last:border-b-none w-full border-b border-l-2 border-b-zinc-200 border-l-violet-500 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",collapsed:!0,children:[/* @__PURE__ */Z($.Header,{title:/* @__PURE__ */Z(Fn,{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:Pn,iconExpanded:Bn}),/* @__PURE__ */Z($.Content,{children:/* @__PURE__ */Z(On,{path:a?.path,prev:a?.prev,next:a?.next})})]}),Kn=J(({category:e,message:t,time:a,params:r})=>/* @__PURE__ */_(Q,{children:["interactions"===e&&/* @__PURE__ */Z($n,{message:t,params:r,time:a}),"navigation"===e&&/* @__PURE__ */Z(En,{message:t,params:r,time:a}),"store"===e&&/* @__PURE__ */Z(Un,{message:t,params:r,time:a}),"network"===e&&/* @__PURE__ */Z(Mn,{message:t,params:r,time:a}),"actions"===e&&/* @__PURE__ */Z(sn,{message:t,params:r,time:a})]})),Hn=({className:e,amount:t,suffix:a="All",selected:r,logType:n,onClick:i})=>{let s=F(()=>i?.(n),[i,n]);/* @__PURE__ */
|
|
165
|
+
return _("div",{className:l("flex cursor-pointer items-center gap-2 px-2 py-1.5 transition-colors",r?"bg-zinc-200 dark:bg-zinc-700":"hover:bg-zinc-100 dark:hover:bg-zinc-800",e),onClick:s,children:[
|
|
166
|
+
/* @__PURE__ */Z("i",{className:l("text-xs",{"fa-regular fa-circle-xmark text-red-500 dark:text-red-400":"danger"===n,"fa-solid fa-triangle-exclamation text-amber-500 dark:text-amber-400":"warning"===n,"fa-solid fa-circle-info text-violet-500 dark:text-violet-400":"info"===n,"fa-solid fa-check text-emerald-500 dark:text-emerald-400":"success"===n,"fa-solid fa-list text-zinc-500 dark:text-zinc-400":!n||!["danger","warning","info","success"].includes(n)})}),
|
|
167
|
+
/* @__PURE__ */Z("span",{className:"font-medium text-zinc-700 tabular-nums dark:text-zinc-200",children:t}),
|
|
168
|
+
/* @__PURE__ */Z("span",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:a})]})},Wn=({className:e,orientation:t="horizontal",items:a,logTypeSelected:r,onClick:n})=>{let i=U(()=>a.reduce((e,t)=>{let{logType:a}=t;return e[a]||(e[a]=0),{...e,[a]:++e[a]}},{}),[a]),s=F(e=>n?.(e),[n]);/* @__PURE__ */
|
|
169
|
+
return _("div",{className:l("flex shrink-0 border-zinc-200 select-none dark:border-zinc-700","horizontal"===t?"flex-col border-r":"border-b",e),children:[
|
|
170
|
+
/* @__PURE__ */Z(Hn,{onClick:s,amount:a.length,selected:!r}),
|
|
171
|
+
/* @__PURE__ */Z(Hn,{onClick:s,amount:i.danger??0,suffix:"Errors",logType:"danger",selected:"danger"===r}),
|
|
172
|
+
/* @__PURE__ */Z(Hn,{onClick:s,amount:i.warning??0,suffix:"Warnings",logType:"warning",selected:"warning"===r}),
|
|
173
|
+
/* @__PURE__ */Z(Hn,{onClick:s,amount:i.info??0,suffix:"Info",logType:"info",selected:"info"===r})]})},qn=({items:e=[],autoScrollOffset:t=40,orientation:a="horizontal",logTypeFilter:r,onClear:n})=>{let[i,s]=W(r),d=H(null),c=H(!0);B(()=>{let e=d.current;e&&c.current&&(e.scrollTop=0)},[e]);let o=F(()=>{let e=d.current;e&&(c.current=e.scrollTop<=t)},[t]),m=F(e=>{s(e)},[]);/* @__PURE__ */
|
|
174
|
+
return _("div",{className:"flex h-full w-full flex-col",children:[/* @__PURE__ */_("div",{className:"flex shrink-0 items-center justify-between border-b border-zinc-200 bg-zinc-50 px-2 py-1 dark:border-zinc-700 dark:bg-zinc-800",children:[/* @__PURE__ */_("span",{className:"font-mono text-zinc-400 dark:text-zinc-500",children:[e.length," ",1===e.length?"entry":"entries"]}),/* @__PURE__ */_("button",{className:"rounded px-2 py-0.5 text-xs text-zinc-500 transition-colors hover:bg-zinc-200 hover:text-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-200",onClick:n,children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-trash-can mr-1"}),"Clear"]})]}),/* @__PURE__ */_("div",{className:l("flex h-full w-full overflow-hidden",{"grow basis-0 flex-col":"vertical"===a}),children:[/* @__PURE__ */Z(Wn,{className:l({"h-full":"horizontal"===a}),logTypeSelected:i,items:e,orientation:a,onClick:m}),/* @__PURE__ */Z("div",{ref:d,onScroll:o,className:"flex grow basis-0 flex-col overflow-y-auto",children:0===e.length?/* @__PURE__ */_("div",{className:"flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-terminal text-3xl opacity-20"}),/* @__PURE__ */Z("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__ */Z(Kn,{category:e.category,time:e.time,params:e.params,message:e.message},t))})]})]})},Qn={"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."}},Zn=({entry:e})=>{let{type:t,origin:a,version:r,author:n,settings:i}=e,l=U(()=>i&&0!==Object.keys(i).length?ne(JSON.stringify(i,null,2)):null,[i]);/* @__PURE__ */
|
|
175
|
+
return _("div",{className:"flex h-full grow basis-0 flex-col overflow-y-auto p-4",children:[/* @__PURE__ */_("div",{className:"mb-4 border-b border-zinc-200 pb-3 dark:border-zinc-700",children:[/* @__PURE__ */Z("div",{className:"text-base font-semibold text-zinc-800 dark:text-zinc-200",children:t}),/* @__PURE__ */Z("div",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:Qn[a].label})]}),/* @__PURE__ */_("div",{className:"flex flex-col gap-3",children:[
|
|
176
|
+
/* @__PURE__ */_("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */Z("span",{className:"text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Where it comes from"}),/* @__PURE__ */Z("span",{className:"text-xs text-zinc-800 dark:text-zinc-200",children:Qn[a].hint})]}),
|
|
177
|
+
/* @__PURE__ */_("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */Z("span",{className:"text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Version"}),/* @__PURE__ */Z("span",{className:"font-mono text-xs text-zinc-800 dark:text-zinc-200",children:r??"—"})]}),
|
|
178
|
+
/* @__PURE__ */_("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */Z("span",{className:"text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Author"}),/* @__PURE__ */Z("span",{className:"text-xs text-zinc-800 dark:text-zinc-200",children:n??"—"})]}),
|
|
179
|
+
/* @__PURE__ */_("div",{className:"flex flex-col gap-1",children:[/* @__PURE__ */Z("span",{className:"text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Settings"}),l?/* @__PURE__ */Z("pre",{className:"overflow-auto rounded bg-zinc-50 p-2 font-mono text-xs leading-5 dark:bg-zinc-800",dangerouslySetInnerHTML:{__html:l}}):/* @__PURE__ */Z("span",{className:"text-xs text-zinc-400 italic dark:text-zinc-500",children:"No settings"})]})]})]})},_n=({name:e,label:t,id:a,isSelected:r,className:n,onSelect:i})=>{let s=F(()=>i?.(a),[i,a]);/* @__PURE__ */
|
|
180
|
+
return Z("div",{className:l("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,"border-l-transparent text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:border-l-transparent dark:text-zinc-300 dark:hover:bg-zinc-800 dark:hover:text-zinc-100":!r},n),onClick:s,children:/* @__PURE__ */Z("div",{className:"truncate",title:e,children:t??e})})},Xn=({items:e=[],className:t,value:a,onSelect:r})=>{let[n,i]=W(""),s=U(()=>e.filter(e=>(e.name??"").toLowerCase().includes(n.toLowerCase())),[e,n]),d=U(()=>"string"==typeof a?e.find(e=>e.id===a):a,[a,e]),c=F(e=>i(e),[]),o=F(t=>r?.(e.find(e=>e.id===t)),[e,r]);/* @__PURE__ */
|
|
181
|
+
return _("div",{className:l("flex h-full flex-col gap-2 border-r border-zinc-200 dark:border-zinc-700",t),children:[/* @__PURE__ */Z("div",{className:"px-2 pt-2",children:/* @__PURE__ */Z(v,{value:n,onChange:c,placeholder:"Search...",size:"sm"})}),/* @__PURE__ */_("div",{className:"flex flex-col overflow-y-auto text-xs text-zinc-700 dark:text-zinc-300",children:[!s.length&&/* @__PURE__ */Z("div",{className:"p-4 text-center text-zinc-400 dark:text-zinc-600",children:"No items"}),s.length>0&&s.map((e,t)=>/* @__PURE__ */Z(_n,{label:e.label,name:e.name,isSelected:d?.id===e.id,id:e.id,onSelect:o},t))]})]})},Gn={"local-custom":"Shipped with this space",remote:"Installed"},Yn=({className:e})=>{let{plugins:t}=O(m),{components:r}=O(a),n=U(()=>{let e=/* @__PURE__ */new Map;return Object.entries(r.current).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:n}=a;e.set(t,{type:t,origin:r?.origin??"remote",version:n.version||r?.version,author:n.author,settings:a.settings})}),[...e.values()].map(e=>({...e,id:e.type,name:e.type,label:/* @__PURE__ */_("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */Z("span",{className:"capitalize",children:e.type}),/* @__PURE__ */Z("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:e.version??Gn[e.origin]})]})}))},[t,r.current]),[i,s]=W(),d=F(e=>s(e),[]);/* @__PURE__ */
|
|
182
|
+
return _("div",{className:l("flex h-full w-full",e),children:[/* @__PURE__ */Z(Xn,{className:"w-[240px]",items:n,value:i,onSelect:d}),i?/* @__PURE__ */Z(Zn,{entry:i}):/* @__PURE__ */_("div",{className:"flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-600",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-puzzle-piece text-2xl opacity-30"}),/* @__PURE__ */Z("span",{children:"Select a plugin"})]})]})},ei="\0fn:",ti=e=>{if("object"!=typeof e||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},ai=e=>{if("function"==typeof e)return`${ei}ƒ ${e.name||"anonymous"}()`;if((e=>Array.isArray(e))(e)){let t=e.map(ai);return t.every((t,a)=>t===e[a])?e:t}if(!ti(e))return e;let t={},a=!1;for(let[r,n]of Object.entries(e))t[r]=ai(n),a||=t[r]!==n;return a?t:e},ri=({record:{expiresAt:e},now:t})=>{let a=t>=e,r=Number.isFinite(e)?`${Er(e-t)} left`:"no expiry";/* @__PURE__ */
|
|
183
|
+
return Z("span",{className:l("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})},ni=(e,{type:t,value:a})=>{if("value"!==t||"string"!=typeof a)return null;let r=(e=>e.startsWith(ei)?e.slice(4):"")(a);return r?/* @__PURE__ */Z("span",{className:"w-rjv-value text-violet-400 italic",children:r}):null},ii={},li={...hr,width:"100%",height:"100%",overflow:"auto",padding:"8px",fontSize:"14px"},si=e=>l("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-zinc-500 hover:bg-zinc-200/70 hover:text-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-700/50 dark:hover:text-zinc-100"),di={},ci=[],oi=({elementSelected:e})=>{let{resolvedTheme:t}=C(),{getData:a}=O(N),r=Hr(),n=Hr()?.store,[i,l]=T("plitzi-sdk.dev-tools.store.view","own"),s=((e,t)=>{let a=F(t=>e?e.subscribe(t):()=>{},[e]),r=F(()=>e?t?e.getState():e.getOwnState():ii,[e,t]);return q(a,r,r)})(e?void 0:n,"merged"===i),d=F(()=>l("own"),[l]),c=F(()=>l("merged"),[l]),o=e?a?.(`getElementDataSource-${e}`):s,m=U(()=>(e=>{if(!e)return;let t=ai(e);return ti(t)?t:e})(o),[o]),p=U(()=>r?[r]:ci,[r]),u=Lr(p)[0]?.records??di,h=U(()=>Object.values(u).reduce((e,t)=>Math.max(e,t.updatedAt),0),[u]),x=Rr(Object.keys(u).length>0,h),f=U(()=>((e,t)=>(a,{keys:r})=>{let n=e[(r??[]).join(".")];if(!n)return null;let{className:i,style:l,children:s}=a;/* @__PURE__ */
|
|
184
|
+
return _(Q,{children:[/* @__PURE__ */Z("span",{className:i,style:l,children:s}),/* @__PURE__ */Z(ri,{record:n,now:t})]})})(u,x),[u,x]);/* @__PURE__ */
|
|
185
|
+
return _("div",{className:"flex h-full w-full flex-col",children:[!e&&/* @__PURE__ */_("div",{className:"flex shrink-0 items-center gap-1 border-b border-zinc-200 px-2 py-1 text-[11px] dark:border-zinc-800",children:[
|
|
186
|
+
/* @__PURE__ */Z("span",{className:"mr-1 text-zinc-400 dark:text-zinc-500",children:"View"}),
|
|
187
|
+
/* @__PURE__ */Z("button",{className:si("own"===i),onClick:d,title:"Only this scope's own layer",children:"Own"}),
|
|
188
|
+
/* @__PURE__ */Z("button",{className:si("merged"===i),onClick:c,title:"Own layer merged over the parent scope chain",children:"Merged"})]}),/* @__PURE__ */_(pr,{value:m??L,style:"dark"===t?li:void 0,enableClipboard:!1,indentWidth:15,collapsed:2,displayObjectSize:!1,displayDataTypes:!1,children:[/* @__PURE__ */Z(pr.String,{render:ni}),/* @__PURE__ */Z(pr.KeyName,{render:f})]})]})},mi=(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},pi={ssr:"SSR render (server)",hydration:"Hydration (SSR)",mount:"Mount",mixed:"Mount + update",update:"Update"},ui={ssr:"S",hydration:"H",mount:"M",mixed:"±",update:"·"},hi=[{origin:"ssr",label:"SSR"},{origin:"hydration",label:"Hydration"},{origin:"mount",label:"Mount"},{origin:"mixed",label:"Mount+update"},{origin:"update",label:"Update"}],xi=e=>e<.1?"<0.1ms":`${e.toFixed(1)}ms`,fi=e=>`${Math.round(100*e)}%`,vi=e=>e>=50?"bg-red-500":e>=16?"bg-amber-500":e>=8?"bg-emerald-500":"bg-sky-500",gi=[{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"}],bi="bg-zinc-300 dark:bg-zinc-700",yi={backgroundImage:"repeating-linear-gradient(45deg, rgba(113,113,122,0.22) 0, rgba(113,113,122,0.22) 2px, transparent 2px, transparent 5px)"},ki=e=>"rendered"===e.state?vi(e.selfDuration):"bubbled"===e.state?bi:"bg-transparent",Ni=e=>"bubbled"===e.state?"text-zinc-600 dark:text-zinc-300":"hatched"===e.state?"text-zinc-400 dark:text-zinc-600":"bg-amber-500"===vi(e.selfDuration)?"text-stone-900":"text-white",zi=(e,t)=>{let a=t?.[e];if(!a)return e;let{label:r,type:n}=a.definition;return r||n||e},wi=(e,t)=>t?.[e]?.definition.type??"unknown",Ci=(e,t)=>{let a=V(t?.[e],"definition.initialState.visibility",!0);return!1!==a&&"false"!==a},Si=(e,t)=>"self"===t?e.selfDuration:e.actualDuration,ji=.01,Ti=1e-6,$i=(e,t,a)=>{let r=e.lifetime.get(t);return!r||r.mountedAt<=a&&a<r.unmountedAt},Ii=e=>{let t=/* @__PURE__ */new Map,a=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;for(let l of Object.keys(e)){let{parentId:i,baseDuration:s,elementId:d,mountedAt:c,unmountedAt:o}=e[l];t.set(l,i),a.set(l,s),r.set(l,d),(void 0!==c||void 0!==o)&&n.set(l,{mountedAt:c??0,unmountedAt:o??1/0})}let i=/* @__PURE__ */new Map;for(let[l,s]of t)if(void 0!==s&&t.has(s)){let e=i.get(s);e?e.push(l):i.set(s,[l])}return{parent:t,base:a,children:i,elementOf:r,lifetime:n}},Vi=(e,t)=>{let{parent:a}=t,r=new Map(e.elements.map(e=>[e.id,e])),n=/* @__PURE__ */new Map;for(let l of e.elements)n.set(l.id,l.actualDuration);for(let l of e.elements){let e=a.get(l.id);for(;void 0!==e&&!r.has(e);)e=a.get(e);void 0!==e&&n.set(e,(n.get(e)??0)-l.actualDuration)}for(let[l,s]of n)s<0&&n.set(l,0);let i=/* @__PURE__ */new Set;for(let l of r.keys()){let e=l,t=a.get(l);for(;void 0!==t&&a.has(t);)e=t,t=a.get(t);i.add(e)}return{rendered:r,self:n,roots:[...i]}},Li=(e,t,a,r=Ii(t))=>{let{children:n,base:i,elementOf:l}=r,{rendered:s,self:d,roots:c}=Vi(e,r),o=e=>{let t=i.get(e)??0;if(t>0)return t;let a=s.get(e)?.actualDuration??0;return a>0?a:ji},m=[],p=[],u=0,h=0,x=0,f=[],v=c.map(o),g=v.reduce((e,t)=>e+t,0)||1,b=0;for(c.forEach((e,t)=>{let a=(v[t]||ji)/g;f.push({id:e,parentId:void 0,x:b,width:a,depth:0,ancestorRendered:!1}),b+=a}),f.reverse();f.length>0;){let t=f.pop();if(void 0===t)break;let{id:c,parentId:v,x:g,width:b,depth:y,ancestorRendered:k}=t,N=s.get(c),z=d.get(c)??0,w=N?z>Ti?"rendered":"bubbled":"hatched",C="rendered"===w&&!k;"rendered"===w&&(h+=z,x+=1),C&&p.push(c),u=Math.max(u,y);let S=l.get(c)??N?.elementId??c;m.push({id:c,elementId:S,name:zi(S,a),type:wi(S,a),state:w,visible:Ci(S,a),trigger:C,phase:N?.phase,actualDuration:N?.actualDuration??0,baseDuration:i.get(c)??N?.baseDuration??0,selfDuration:z,depth:y,parentId:v,changedProps:N?.changedProps,x:g,width:b});let j=(n.get(c)??[]).filter(t=>s.has(t)||$i(r,t,e.commitId));if(0===j.length)continue;let T=j.map(o),$=T.reduce((e,t)=>e+t,0),I=Math.max(o(c),$)||1,V=g,L=[];j.forEach((e,t)=>{let a=(T[t]||ji)/I*b;L.push({id:e,parentId:c,x:V,width:a,depth:y+1,ancestorRendered:k||"rendered"===w}),V+=a});for(let e=L.length-1;e>=0;--e)f.push(L[e])}return{nodes:m,maxDepth:u,totalSelf:h,renderedCount:x,triggers:p}},Ri=(e,t,a)=>{let r=Ii(t),n=/* @__PURE__ */new Map;for(let i of e){let{self:e}=Vi(i,r);for(let t of i.elements){let a=e.get(t.id)??0;if(a<=Ti)continue;let i=r.elementOf.get(t.id)??t.elementId,l=n.get(i)??{renders:0,mounts:0,totalSelf:0,maxSelf:0,lastSelf:0};l.renders+=1,l.mounts+=+("mount"===t.phase),l.totalSelf+=a,l.maxSelf=Math.max(l.maxSelf,a),l.lastSelf=a,n.set(i,l)}}return[...n.entries()].map(([e,t])=>({id:e,name:zi(e,a),type:wi(e,a),renders:t.renders,mounts:t.mounts,totalSelf:t.totalSelf,maxSelf:t.maxSelf,avgSelf:t.totalSelf/t.renders,lastSelf:t.lastSelf}))},Ei=({commits:e,selectedIndex:t,hydrated:a,onSelect:r})=>{let n=H(null),i=U(()=>Math.max(1,...e.map(e=>e.duration)),[e]),s=U(()=>e.find(e=>0!==e.commitId)?.commitId,[e]);B(()=>{n.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]);let d=F(e=>()=>r(e),[r]),c=F(a=>{if("ArrowLeft"!==a.key&&"ArrowRight"!==a.key)return;a.preventDefault(),a.stopPropagation();let n=t+("ArrowLeft"===a.key?-1:1);n>=0&&n<e.length&&r(e[n].commitId)},[e,t,r]);/* @__PURE__ */
|
|
189
|
+
return _("div",{className:"flex shrink-0 flex-col border-b border-zinc-200 bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900",children:[/* @__PURE__ */Z("div",{role:"listbox","aria-label":"Commits, total render time","aria-orientation":"horizontal",tabIndex:0,onKeyDown:c,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 c=r===t,o=0===e.commitId,m=o?100:Math.max(6,Math.round(e.duration/i*100)),p=mi(e,a,e.commitId===s),u=e.causes.slice(0,6).map(e=>e.path).join(", "),h=e.causes.length>6?" +"+(e.causes.length-6):"",x=e.causes.length>0?`\nCaused by ${u}${h}`:"";/* @__PURE__ */
|
|
190
|
+
return _("button",{ref:c?n:void 0,role:"option","aria-selected":c,onClick:d(e.commitId),title:o?`Commit #${e.commitId} · ${pi[p]} · no client timing · ${e.elementCount} elements`:`Commit #${e.commitId} · ${pi[p]} · ${xi(e.duration)} total · ${e.elementCount} elements${x}`,className:"flex h-full shrink-0 flex-col items-center justify-end gap-0.5 px-0.5",children:[/* @__PURE__ */Z("div",{style:{height:`${m}%`},className:l("w-3.5 rounded-sm transition-all",o?"bg-violet-400/40":vi(e.duration),{"border border-dashed border-violet-400/70":o,"opacity-100 ring-2 ring-violet-400":c,"opacity-40 hover:opacity-80":!c})}),/* @__PURE__ */Z("span",{className:l("text-[8px] leading-none font-semibold",{"text-violet-600 dark:text-violet-300":"ssr"===p||"hydration"===p,"text-zinc-500 dark:text-zinc-400":"mount"===p||"mixed"===p,"text-transparent":"update"===p}),children:ui[p]})]},e.commitId)})}),/* @__PURE__ */Z("div",{className:"flex items-center gap-x-3 gap-y-0.5 overflow-x-auto px-2 pb-1 text-[9px] text-zinc-400 dark:text-zinc-500",children:hi.map(e=>/* @__PURE__ */_("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */Z("span",{className:"font-semibold text-zinc-500 dark:text-zinc-300",children:ui[e.origin]}),e.label]},e.origin))})]})},Di=({commit:e,model:t,active:a,onSelectElement:r})=>{let n=t.nodes.filter(e=>e.trigger);if(0===n.length&&0===e.causes.length)return null;let i=n.slice(0,6),s=n.length-i.length,d=e.causes.slice(0,6),c=e.causes.length-d.length;/* @__PURE__ */
|
|
191
|
+
return _(Q,{children:[n.length>0&&/* @__PURE__ */_("span",{className:"flex flex-wrap items-center gap-1",children:[
|
|
192
|
+
/* @__PURE__ */Z("span",{className:"mr-0.5 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Triggered by"}),i.map(e=>/* @__PURE__ */_("button",{onClick:()=>r(e.id===a?.id?void 0:e.id),title:`${e.name} (${e.type}) — root-cause re-render of this commit`,className:l("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__ */Z("i",{className:"fa-solid fa-bolt text-[8px]"}),/* @__PURE__ */Z("span",{className:"max-w-32 truncate",children:e.name})]},e.id)),s>0&&/* @__PURE__ */_("span",{className:"text-zinc-400 dark:text-zinc-500",children:["+",s]})]}),e.causes.length>0&&/* @__PURE__ */_("span",{className:"flex flex-wrap items-center gap-1",children:[
|
|
193
|
+
/* @__PURE__ */Z("span",{className:"mr-0.5 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Store write"}),d.map(e=>/* @__PURE__ */_("span",{title:e.preview?`${e.path}\n${e.preview}`:e.path,className:"max-w-56 truncate rounded bg-zinc-500/10 px-1 py-0.5 font-mono text-[9px] text-zinc-600 dark:text-zinc-300",children:[e.path,e.preview&&/* @__PURE__ */Z("span",{className:"ml-1 text-zinc-400 dark:text-zinc-500",children:e.preview})]},e.path)),c>0&&/* @__PURE__ */_("span",{className:"text-zinc-400 dark:text-zinc-500",children:["+",c]})]})]})},Ai=({node:e,commit:t,model:a})=>/* @__PURE__ */_(Q,{children:[
|
|
194
|
+
/* @__PURE__ */_("div",{className:"flex items-center gap-1.5",children:[
|
|
195
|
+
/* @__PURE__ */Z("span",{className:l("h-2.5 w-2.5 shrink-0 rounded-sm",ki(e)),style:"hatched"===e.state?yi:void 0}),
|
|
196
|
+
/* @__PURE__ */Z("span",{className:"truncate text-xs font-medium text-zinc-700 dark:text-zinc-100",children:e.name}),!e.visible&&/* @__PURE__ */Z("i",{className:"fa-solid fa-eye-slash shrink-0 text-amber-500",title:"Hidden via visibility"})]}),
|
|
197
|
+
/* @__PURE__ */Z("span",{className:"truncate text-zinc-400 dark:text-zinc-500",children:e.type}),!e.visible&&/* @__PURE__ */Z("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)"}),
|
|
198
|
+
/* @__PURE__ */_("span",{className:l("w-fit rounded px-1 py-0.5 text-[9px]",{"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"rendered"===e.state,"bg-zinc-500/15 text-zinc-500 dark:text-zinc-400":"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__ */_("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__ */Z("i",{className:"fa-solid fa-bolt mr-1"}),"trigger"]}),
|
|
199
|
+
/* @__PURE__ */Z("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Durations"}),
|
|
200
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Self"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:xi(e.selfDuration)})]}),
|
|
201
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Total (subtree)"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:xi(e.actualDuration)})]}),
|
|
202
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Base"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:xi(e.baseDuration)})]}),
|
|
203
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"% of commit"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:fi(e.actualDuration/t.duration)})]}),"rendered"===e.state&&/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"% of work"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:fi(a.totalSelf>0?e.selfDuration/a.totalSelf:0)})]}),
|
|
204
|
+
/* @__PURE__ */_("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:["Commit #",t.commitId]}),
|
|
205
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Committed at"}),/* @__PURE__ */_("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:[(t.timestamp/1e3).toFixed(1),"s"]})]}),
|
|
206
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Total"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:xi(t.duration)})]}),
|
|
207
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Rendered"}),/* @__PURE__ */_("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:[a.renderedCount," of ",t.elementCount]})]}),
|
|
208
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Triggers"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:a.triggers.length})]}),"rendered"===e.state&&/* @__PURE__ */_(Q,{children:[
|
|
209
|
+
/* @__PURE__ */Z("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Why it rendered"}),"mount"===e.phase&&/* @__PURE__ */Z("span",{className:"text-zinc-400 italic dark:text-zinc-500",children:"first mount"}),"mount"!==e.phase&&void 0===e.changedProps&&/* @__PURE__ */_("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__ */Z("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__ */_("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__ */Z("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__ */_("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__ */Z("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),"no input changed — re-rendered by an ancestor"]}),e.changedProps?.map(e=>/* @__PURE__ */_("div",{className:"flex flex-col gap-0.5 border-l border-zinc-200 pl-1.5 dark:border-zinc-700",children:[/* @__PURE__ */_("span",{className:"flex flex-wrap items-center gap-1",children:[/* @__PURE__ */Z("span",{className:"font-mono text-[9px] font-medium break-all text-zinc-600 dark:text-zinc-300",children:e.key}),e.ref&&/* @__PURE__ */Z("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__ */_("div",{className:"flex flex-col gap-0.5 font-mono text-[9px] leading-snug",children:[/* @__PURE__ */_("span",{className:"break-all text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */Z("span",{className:"text-rose-400/70 select-none dark:text-rose-400/60",children:"− "}),e.prev]}),/* @__PURE__ */_("span",{className:"break-all text-zinc-600 dark:text-zinc-300",children:[/* @__PURE__ */Z("span",{className:"text-emerald-500/80 select-none",children:"+ "}),e.next]})]})]},e.key))]})]}),Mi=()=>/* @__PURE__ */_("div",{className:"flex shrink-0 items-center gap-2 overflow-x-auto border-t border-zinc-200 px-2 py-1 text-[9px] text-zinc-400 dark:border-zinc-800 dark:text-zinc-500",children:[
|
|
210
|
+
/* @__PURE__ */Z("span",{className:"font-medium",children:"Render budget"}),gi.map(e=>/* @__PURE__ */_("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */Z("span",{className:l("h-2 w-2 rounded-sm",e.color)}),e.label]},e.label)),
|
|
211
|
+
/* @__PURE__ */_("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */Z("span",{className:l("h-2 w-2 rounded-sm",bi)}),"subtree only"]}),
|
|
212
|
+
/* @__PURE__ */_("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */Z("span",{className:"h-2 w-2 rounded-sm border border-zinc-400/60 bg-zinc-200 dark:bg-zinc-800",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"]}),
|
|
213
|
+
/* @__PURE__ */_("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */Z("span",{className:"h-2 w-2 rounded-sm bg-violet-600"}),"selected"]}),
|
|
214
|
+
/* @__PURE__ */Z("span",{className:"ml-auto shrink-0",children:"60fps ≈ 16ms · 50ms long task"})]}),Ji=({children:e})=>{let[t,a]=T("plitzi-sdk.dev-tools.tracing.sidebar-width",224),r=F(e=>{Number.isFinite(e)&&a(e)},[a]);/* @__PURE__ */
|
|
215
|
+
return Z(k,{className:"shrink-0 border-l border-zinc-200 dark:border-zinc-800",resizeHandles:["w"],axis:"x",autoGrow:!1,width:t,minConstraintsX:180,maxConstraintsX:480,onChange:r,children:/* @__PURE__ */Z("aside",{className:"flex h-full w-full flex-col gap-1.5 overflow-auto bg-zinc-50 px-3 py-2 text-[10px] dark:bg-zinc-900/50",children:e})})},Oi=()=>/* @__PURE__ */_("div",{className:"flex h-full flex-col items-center justify-center gap-2 px-2 text-center text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-arrow-pointer text-xl opacity-30"}),/* @__PURE__ */Z("span",{className:"text-[10px] leading-relaxed",children:"Select an element to inspect its timing and why it rendered"})]}),Fi=({open:e,onToggle:t,className:a})=>/* @__PURE__ */Z("button",{onClick:t,title:e?"Hide detail panel":"Show detail panel","aria-pressed":e,className:l("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-zinc-400 hover:bg-zinc-500/10 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300",a),children:/* @__PURE__ */Z("i",{className:"fa-solid fa-circle-info"})}),Pi=({node:e,left:t,width:a,top:r,selected:n,onClick:i})=>{let s={left:`${t}%`,width:`${a}%`,top:r,height:18,..."hatched"!==e.state||n?void 0:yi},d=n?"bg-violet-600":"hatched"===e.state?"bg-zinc-200 dark:bg-zinc-800":ki(e);/* @__PURE__ */
|
|
216
|
+
return _("button",{type:"button",onClick:()=>i(e),title:`${e.name} (${e.type})${e.visible?"":" · hidden"}\n${xi(e.selfDuration)} self · ${xi(e.actualDuration)} total · ${fi(e.baseDuration>0?e.width:0)} width`,style:s,className:l("absolute flex cursor-pointer items-center gap-1 overflow-hidden rounded-[1px] border border-zinc-50 px-1 text-left text-[11px] leading-none whitespace-nowrap dark:border-zinc-900",d,n?"z-10 text-white":l(Ni(e),"hover:brightness-110")),children:[e.trigger&&/* @__PURE__ */Z("i",{className:"fa-solid fa-bolt shrink-0 text-[8px] text-violet-200"}),!e.visible&&/* @__PURE__ */Z("i",{className:"fa-solid fa-eye-slash shrink-0 text-[8px] opacity-80"}),
|
|
217
|
+
/* @__PURE__ */Z("span",{className:"truncate",children:e.name})]})},Bi=1e-6,Ui=({commit:e,model:t,active:a,origin:r,sidebarOpen:n,onSelectElement:i,onToggleSidebar:l})=>{let s=U(()=>{let e=/* @__PURE__ */new Map;for(let a of t.nodes)e.set(a.id,a);return e},[t]),d=a,c=d?d.x:0,o=d?d.width:1,m=d?d.depth:0,p=U(()=>{if(!d)return[];let e=[],t=d.parentId;for(;void 0!==t;){let a=s.get(t);if(!a)break;e.push(a),t=a.parentId}return e.reverse()},[d,s]),u=U(()=>t.nodes.filter(e=>e.depth>=m&&e.x>=c-Bi&&e.x+e.width<=c+o+Bi),[t,c,o,m]),h=U(()=>u.filter(e=>e.width/o>=3e-4||e.id===a?.id),[u,o,a]),x=u.length-h.length,f=U(()=>h.reduce((e,t)=>Math.max(e,t.depth),m),[h,m]),v=F(e=>i(e.id===a?.id?void 0:e.id),[a,i]);/* @__PURE__ */
|
|
218
|
+
return _("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[
|
|
219
|
+
/* @__PURE__ */_("div",{className:"flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-zinc-200 px-2 py-1 text-[10px] text-zinc-500 dark:border-zinc-800 dark:text-zinc-400",children:[
|
|
220
|
+
/* @__PURE__ */_("span",{className:"font-medium text-zinc-700 dark:text-zinc-200",children:["Commit #",e.commitId]}),"update"!==r&&/* @__PURE__ */Z("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:pi[r]}),
|
|
221
|
+
/* @__PURE__ */Z("span",{className:"opacity-60",children:"click a frame to zoom · click the focused frame to zoom out"}),x>0&&/* @__PURE__ */_("span",{className:"opacity-60",title:"Frames too narrow to draw at this zoom level — zoom in to see them",children:["· ",x," too narrow to draw"]}),
|
|
222
|
+
/* @__PURE__ */Z(Di,{commit:e,model:t,active:a,onSelectElement:i}),
|
|
223
|
+
/* @__PURE__ */Z(Fi,{className:"ml-auto",open:n,onToggle:l})]}),
|
|
224
|
+
/* @__PURE__ */_("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[/* @__PURE__ */Z("div",{className:"min-h-0 flex-1 overflow-auto p-1",children:/* @__PURE__ */_("div",{className:"relative w-full",style:{height:18*(f+1)},children:[p.map(e=>/* @__PURE__ */Z(Pi,{node:e,left:0,width:100,top:18*e.depth,selected:e.id===a?.id,onClick:v},e.id)),h.map(e=>/* @__PURE__ */Z(Pi,{node:e,left:(e.x-c)/o*100,width:e.width/o*100,top:18*e.depth,selected:e.id===a?.id,onClick:v},e.id))]})}),n&&/* @__PURE__ */Z(Ji,{children:a?/* @__PURE__ */Z(Ai,{node:a,commit:e,model:t}):/* @__PURE__ */Z(Oi,{})})]}),
|
|
225
|
+
/* @__PURE__ */Z(Mi,{})]})},Ki=({row:e,flat:t,sessionSelf:a})=>{let r=Ci(e.id,t);/* @__PURE__ */
|
|
226
|
+
return _("aside",{className:"flex w-52 shrink-0 flex-col gap-1.5 overflow-auto border-l border-zinc-200 bg-zinc-50 px-3 py-2 text-[10px] dark:border-zinc-800 dark:bg-zinc-900/50",children:[
|
|
227
|
+
/* @__PURE__ */_("div",{className:"flex items-center gap-1.5",children:[
|
|
228
|
+
/* @__PURE__ */Z("span",{className:l("h-2.5 w-2.5 shrink-0 rounded-sm",vi(e.maxSelf))}),
|
|
229
|
+
/* @__PURE__ */Z("span",{className:"truncate text-xs font-medium text-zinc-700 dark:text-zinc-100",children:e.name}),!r&&/* @__PURE__ */Z("i",{className:"fa-solid fa-eye-slash shrink-0 text-amber-500",title:"Hidden via visibility"})]}),
|
|
230
|
+
/* @__PURE__ */Z("span",{className:"truncate text-zinc-400 dark:text-zinc-500",children:e.type}),!r&&/* @__PURE__ */Z("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)"}),
|
|
231
|
+
/* @__PURE__ */Z("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Renders (session)"}),
|
|
232
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Total"}),/* @__PURE__ */_("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:[e.renders,"×"]})]}),
|
|
233
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Mounts"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:e.mounts})]}),
|
|
234
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Updates"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:e.renders-e.mounts})]}),
|
|
235
|
+
/* @__PURE__ */Z("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Self time"}),
|
|
236
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Total"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:xi(e.totalSelf)})]}),
|
|
237
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Average"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:xi(e.avgSelf)})]}),
|
|
238
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Max"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:xi(e.maxSelf)})]}),
|
|
239
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Last"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:xi(e.lastSelf)})]}),
|
|
240
|
+
/* @__PURE__ */_("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */Z("span",{className:"text-zinc-400 dark:text-zinc-500",children:"% of session"}),/* @__PURE__ */Z("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:fi(a>0?e.totalSelf/a:0)})]})]})},Hi=[{id:"total",label:"Total"},{id:"renders",label:"Renders"},{id:"avg",label:"Avg"},{id:"max",label:"Max"}],Wi=(e,t)=>"renders"===t?e.renders:"avg"===t?e.avgSelf:"max"===t?e.maxSelf:e.totalSelf,qi=({commits:e,tree:t,flat:a,selectedId:r,onSelectElement:n})=>{let[i,s]=T("plitzi-sdk.dev-tools.tracing.sort","total"),d=H(null),c=U(()=>Ri(e,t,a).sort((e,t)=>Wi(t,i)-Wi(e,i)),[e,t,a,i]),o=U(()=>c.reduce((e,t)=>Math.max(e,Wi(t,i)),0)||1,[c,i]),m=U(()=>c.reduce((e,t)=>e+t.totalSelf,0),[c]),p=U(()=>c.find(e=>e.id===r),[c,r]),u=U(()=>c.findIndex(e=>e.id===r),[c,r]);B(()=>d.current?.scrollIntoView({block:"nearest"}),[r]);let h=F(e=>()=>s(e),[s]),x=F(e=>{if("ArrowUp"!==e.key&&"ArrowDown"!==e.key||0===c.length)return;e.preventDefault();let t=-1===u?0:u,a=Math.max(0,Math.min(c.length-1,t+("ArrowUp"===e.key?-1:1)));n(c[a].id)},[c,u,n]);/* @__PURE__ */
|
|
241
|
+
return _("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[
|
|
242
|
+
/* @__PURE__ */_("div",{className:"flex shrink-0 items-center gap-2 border-b border-zinc-200 px-2 py-1.5 text-[10px] text-zinc-500 dark:border-zinc-800 dark:text-zinc-400",children:[
|
|
243
|
+
/* @__PURE__ */Z("span",{className:"font-medium text-zinc-700 dark:text-zinc-200",children:"Session hotspots"}),
|
|
244
|
+
/* @__PURE__ */_("span",{children:["· ",c.length," elements · ",e.length," commits"]}),
|
|
245
|
+
/* @__PURE__ */_("div",{className:"ml-auto flex items-center gap-1",children:[/* @__PURE__ */Z("span",{children:"sort"}),Hi.map(e=>/* @__PURE__ */Z("button",{onClick:h(e.id),"aria-pressed":i===e.id,className:l("rounded px-1.5 py-0.5 text-[10px] font-medium",{"bg-violet-500 text-white":i===e.id,"text-zinc-600 hover:bg-zinc-200 dark:text-zinc-400 dark:hover:bg-zinc-700":i!==e.id}),children:e.label},e.id))]})]}),
|
|
246
|
+
/* @__PURE__ */_("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[/* @__PURE__ */_("div",{role:"listbox","aria-label":"Session hotspots",tabIndex:0,onKeyDown:x,className:"min-h-0 flex-1 overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-violet-400",children:[0===c.length&&/* @__PURE__ */Z("div",{className:"px-2 py-3 text-center text-[10px] text-zinc-400 dark:text-zinc-500",children:"No renders recorded yet"}),c.map(e=>{let t=e.id===r,a=Wi(e,i),s="renders"===i?e.renders/o:a/o;/* @__PURE__ */
|
|
247
|
+
return _("button",{ref:t?d:void 0,role:"option","aria-selected":t,onClick:()=>n(t?void 0:e.id),title:`${e.name} (${e.type})\n${e.renders} renders (${e.mounts} mount)\ntotal ${xi(e.totalSelf)} · avg ${xi(e.avgSelf)} · max ${xi(e.maxSelf)} · last ${xi(e.lastSelf)}`,className:l("flex w-full items-center gap-2 px-2 py-0.5 text-left",{"bg-violet-500/10":t,"hover:bg-zinc-50 dark:hover:bg-zinc-800/50":!t}),children:[
|
|
248
|
+
/* @__PURE__ */_("span",{className:"flex w-40 shrink-0 flex-col",children:[/* @__PURE__ */Z("span",{className:"truncate text-zinc-700 dark:text-zinc-200",children:e.name}),/* @__PURE__ */Z("span",{className:"truncate text-[9px] text-zinc-400 dark:text-zinc-500",children:e.type})]}),
|
|
249
|
+
/* @__PURE__ */_("span",{className:"w-12 shrink-0 text-right text-[10px] text-zinc-400 tabular-nums dark:text-zinc-500",title:"Times this element rendered itself",children:[e.renders,"×"]}),
|
|
250
|
+
/* @__PURE__ */Z("div",{className:"h-2 flex-1 overflow-hidden rounded-sm bg-zinc-100 dark:bg-zinc-800",children:/* @__PURE__ */Z("div",{style:{width:`${Math.max(2,Math.round(100*s))}%`},className:l("h-full rounded-sm",vi(e.maxSelf))})}),
|
|
251
|
+
/* @__PURE__ */Z("span",{className:"w-14 shrink-0 text-right text-zinc-500 tabular-nums dark:text-zinc-400",children:"renders"===i?`${e.renders}×`:xi(a)})]},e.id)})]}),p&&/* @__PURE__ */Z(Ki,{row:p,flat:a,sessionSelf:m})]}),
|
|
252
|
+
/* @__PURE__ */Z(Mi,{})]})},Qi=[{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)"}],Zi=({metric:e,onChange:t,className:a})=>{let r=F(e=>()=>t(e),[t]);/* @__PURE__ */
|
|
253
|
+
return Z("div",{className:l("flex items-center overflow-hidden rounded border border-zinc-200 dark:border-zinc-700",a),children:Qi.map(t=>/* @__PURE__ */Z("button",{title:t.title,"aria-pressed":e===t.id,onClick:r(t.id),className:l("px-1.5 py-0.5 text-[10px] font-medium",{"bg-violet-500 text-white":e===t.id,"text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-700":e!==t.id}),children:t.label},t.id))})},_i=({commit:e,model:t,active:a,origin:r,sidebarOpen:n,onSelectElement:i,onToggleSidebar:s})=>{let[d,c]=T("plitzi-sdk.dev-tools.tracing.metric","self"),o=H(null),m=U(()=>t.nodes.filter(e=>"rendered"===e.state).sort((e,t)=>Si(t,d)-Si(e,d)),[t,d]),p=U(()=>m.reduce((e,t)=>Math.max(e,Si(t,d)),0)||1,[m,d]),u=U(()=>m.findIndex(e=>e.id===a?.id),[m,a]);B(()=>o.current?.scrollIntoView({block:"nearest"}),[a]);let h=F(e=>{if("ArrowUp"!==e.key&&"ArrowDown"!==e.key||0===m.length)return;e.preventDefault();let t=-1===u?0:u,a=Math.max(0,Math.min(m.length-1,t+("ArrowUp"===e.key?-1:1)));i(m[a].id)},[m,u,i]);/* @__PURE__ */
|
|
254
|
+
return _("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[
|
|
255
|
+
/* @__PURE__ */_("div",{className:"flex shrink-0 flex-wrap items-center gap-x-2 gap-y-1 border-b border-zinc-200 px-2 py-1.5 text-[10px] text-zinc-500 dark:border-zinc-800 dark:text-zinc-400",children:[
|
|
256
|
+
/* @__PURE__ */_("span",{className:"font-medium text-zinc-700 dark:text-zinc-200",children:["Commit #",e.commitId]}),"update"!==r&&/* @__PURE__ */Z("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:pi[r]}),
|
|
257
|
+
/* @__PURE__ */_("span",{children:[xi(e.duration)," total"]}),
|
|
258
|
+
/* @__PURE__ */_("span",{title:"Elements that re-rendered, of all in this commit's subtree",children:["· ",t.renderedCount," of ",e.elementCount," rendered"]}),
|
|
259
|
+
/* @__PURE__ */Z(Di,{commit:e,model:t,active:a,onSelectElement:i}),
|
|
260
|
+
/* @__PURE__ */Z(Zi,{className:"ml-auto",metric:d,onChange:c}),
|
|
261
|
+
/* @__PURE__ */Z(Fi,{open:n,onToggle:s})]}),
|
|
262
|
+
/* @__PURE__ */_("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[/* @__PURE__ */_("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===m.length&&/* @__PURE__ */Z("div",{className:"px-2 py-3 text-center text-[10px] text-zinc-400 dark:text-zinc-500",children:"No element re-rendered in this commit"}),m.map(e=>{let r=Si(e,d),n=e.id===a?.id,s=t.totalSelf>0?e.selfDuration/t.totalSelf:0,c="mount"!==e.phase,m=c&&(void 0===e.changedProps||0===e.changedProps.length&&e.trigger),u=c&&0===e.changedProps?.length&&!e.trigger,h=!!e.changedProps?.length&&e.changedProps.every(e=>e.ref),x=e.changedProps?.map(e=>e.key).join(", "),f=x||(m?"internal state / hook":e.type);/* @__PURE__ */
|
|
263
|
+
return _("button",{ref:n?o:void 0,role:"option","aria-selected":n,onClick:()=>i(e.id===a?.id?void 0:e.id),title:`${e.name} (${e.type})\n${xi(e.selfDuration)} self · ${xi(e.actualDuration)} total · ${xi(e.baseDuration)} base\nphase: ${e.phase??"update"} · ${fi(s)} of render work${u?"\nno input changed — re-rendered by an ancestor":m?"\nno input changed — internal state/hook/context":h?`\nreference-only change (missing memo): ${x}`:x?`\nchanged: ${x}`:""}`,className:l("flex w-full items-center gap-2 px-2 py-0.5 text-left",{"bg-violet-500/10":n,"hover:bg-zinc-50 dark:hover:bg-zinc-800/50":!n}),children:[
|
|
264
|
+
/* @__PURE__ */_("span",{className:"flex w-40 shrink-0 flex-col",children:[/* @__PURE__ */_("span",{className:"flex items-center gap-1 text-zinc-700 dark:text-zinc-200",children:[e.trigger&&/* @__PURE__ */Z("i",{className:"fa-solid fa-bolt shrink-0 text-[9px] text-violet-500",title:"Trigger — a root cause of this commit"}),(u||h)&&/* @__PURE__ */Z("i",{className:"fa-solid fa-triangle-exclamation shrink-0 text-[9px] text-amber-500",title:u?"Re-rendered without any input change — possible unnecessary re-render":"Only reference-changed props (shallow-equal content) — likely a missing memo"}),!e.visible&&/* @__PURE__ */Z("i",{className:"fa-solid fa-eye-slash shrink-0 text-[9px] text-amber-500",title:"Hidden (visibility)"}),
|
|
265
|
+
/* @__PURE__ */Z("span",{className:"truncate",children:e.name})]}),/* @__PURE__ */Z("span",{className:"truncate text-[9px] text-zinc-400 dark:text-zinc-500",children:f})]}),
|
|
266
|
+
/* @__PURE__ */Z("span",{className:l("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"}),
|
|
267
|
+
/* @__PURE__ */Z("div",{className:"h-2 flex-1 overflow-hidden rounded-sm bg-zinc-100 dark:bg-zinc-800",children:/* @__PURE__ */Z("div",{style:{width:`${Math.max(2,Math.round(r/p*100))}%`},className:l("h-full rounded-sm",vi(r))})}),
|
|
268
|
+
/* @__PURE__ */Z("span",{className:"w-10 shrink-0 text-right text-[10px] text-zinc-400 tabular-nums dark:text-zinc-500",title:"Share of this commit's total render work",children:fi(s)}),
|
|
269
|
+
/* @__PURE__ */Z("span",{className:"w-12 shrink-0 text-right text-zinc-500 tabular-nums dark:text-zinc-400",children:xi(r)})]},e.id)})]}),n&&/* @__PURE__ */Z(Ji,{children:a?/* @__PURE__ */Z(Ai,{node:a,commit:e,model:t}):/* @__PURE__ */Z(Oi,{})})]}),
|
|
270
|
+
/* @__PURE__ */Z(Mi,{})]})},Xi=[{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"}],Gi=({view:e,persist:t,commitCount:a,onClear:r,onViewChange:n,onPersistChange:i})=>{let s=F(e=>()=>n(e),[n]),d=F(()=>i(!t),[t,i]);/* @__PURE__ */
|
|
271
|
+
return _("div",{className:"flex shrink-0 items-center gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1.5 dark:border-zinc-800 dark:bg-zinc-900",children:[/* @__PURE__ */Z("div",{className:"flex items-stretch gap-1",children:Xi.map(t=>{let a=e===t.id;/* @__PURE__ */
|
|
272
|
+
return _("button",{onClick:s(t.id),"aria-pressed":a,className:l("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors",{"bg-violet-500 text-white":a,"text-zinc-600 hover:bg-zinc-200 dark:text-zinc-400 dark:hover:bg-zinc-700":!a}),children:[/* @__PURE__ */Z("i",{className:t.icon}),t.label]},t.id)})}),/* @__PURE__ */_("div",{className:"ml-auto flex items-center gap-2",children:[
|
|
273
|
+
/* @__PURE__ */_("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:[a," commits"]}),
|
|
274
|
+
/* @__PURE__ */_("button",{onClick:d,"aria-pressed":t,title:"Keep the recorded commits when navigating to another page",className:l("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors",{"bg-violet-500 text-white":t,"text-zinc-600 hover:bg-zinc-200 dark:text-zinc-300 dark:hover:bg-zinc-700":!t}),children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-thumbtack"}),"Persist"]}),
|
|
275
|
+
/* @__PURE__ */_("button",{onClick:r,className:"flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 hover:bg-zinc-200 dark:text-zinc-300 dark:hover:bg-zinc-700",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-trash"}),"Clear"]})]})]})},Yi=()=>{let{enabled:e,hydrated:t,commits:a,tree:r,clear:n}=ge(),[[i,l]]=c(["schema.flat","navigation.currentPageId"]),[s,d]=T("plitzi-sdk.dev-tools.tracing.view","ranked"),[o,m]=T("plitzi-sdk.dev-tools.tracing.persist",!1),[p,u]=T("plitzi-sdk.dev-tools.tracing.sidebar-open",!1),[h,x]=W(),[f,v]=W(),g=H(l);B(()=>{g.current!==l&&(g.current=l,o||(n(),x(void 0),v(void 0)))},[l,o,n]);let b=U(()=>{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=U(()=>b?[b,...a]:a,[b,a]),k=a[0]?.commitId,N=U(()=>{if(0===y.length)return-1;let e=y.findIndex(e=>e.commitId===h);return-1===e?y.length-1:e},[y,h]),z=-1===N?void 0:y[N],w=0===z?.commitId,C=U(()=>z&&!w?Li(z,r,i):void 0,[z,w,r,i]),S=U(()=>C?.nodes.find(e=>e.id===f)??C?.nodes.find(e=>e.elementId===f),[C,f]);(e=>{B(()=>{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])})(S?.elementId??f);let j=U(()=>z?mi(z,t,z.commitId===k):"update",[z,t,k]),$=F(e=>{x(e),v(void 0)},[]),I=F(e=>{v(e),e&&u(!0)},[u]),V=F(()=>u(e=>!e),[u]),L=F(e=>{let t=N+e;t>=0&&t<y.length&&(x(y[t].commitId),v(void 0))},[y,N]),R=F(e=>{("ArrowLeft"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),L("ArrowLeft"===e.key?-1:1))},[L]);/* @__PURE__ */
|
|
276
|
+
return _("div",e?z?{className:"flex h-full min-h-0 w-full flex-col",onKeyDown:R,children:[
|
|
277
|
+
/* @__PURE__ */Z(Gi,{view:s,persist:o,commitCount:a.length,onClear:n,onViewChange:d,onPersistChange:m}),"hotspots"!==s&&/* @__PURE__ */Z(Ei,{commits:y,selectedIndex:N,hydrated:t,onSelect:$}),"hotspots"!==s&&w&&/* @__PURE__ */_("div",{className:"flex grow flex-col items-center justify-center gap-3 px-6 text-center text-zinc-500 dark:text-zinc-400",children:[
|
|
278
|
+
/* @__PURE__ */Z("i",{className:"fa-solid fa-server text-3xl opacity-30"}),
|
|
279
|
+
/* @__PURE__ */Z("span",{className:"text-sm font-medium text-zinc-600 dark:text-zinc-300",children:"Server render (SSR)"}),
|
|
280
|
+
/* @__PURE__ */_("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 #",k," ","is the client ",
|
|
281
|
+
/* @__PURE__ */Z("span",{className:"font-medium text-violet-600 dark:text-violet-400",children:"hydration"})," of this tree."]}),
|
|
282
|
+
/* @__PURE__ */_("span",{className:"text-[11px] opacity-70",children:[z.elementCount," elements in the rendered tree"]})]}),"ranked"===s&&C&&/* @__PURE__ */Z(_i,{commit:z,model:C,active:S,origin:j,sidebarOpen:p,onSelectElement:I,onToggleSidebar:V}),"flamegraph"===s&&C&&/* @__PURE__ */Z(Ui,{commit:z,model:C,active:S,origin:j,sidebarOpen:p,onSelectElement:I,onToggleSidebar:V}),"hotspots"===s&&/* @__PURE__ */Z(qi,{commits:a,tree:r,flat:i,selectedId:f,onSelectElement:I})]}:{className:"flex h-full min-h-0 w-full flex-col",children:[/* @__PURE__ */Z(Gi,{view:s,persist:o,commitCount:a.length,onClear:n,onViewChange:d,onPersistChange:m}),/* @__PURE__ */_("div",{className:"flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-chart-column text-3xl opacity-20"}),/* @__PURE__ */Z("span",{className:"text-xs",children:"No commits recorded yet — interact with the page"})]})]}:{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-gauge-high text-3xl opacity-20"}),/* @__PURE__ */Z("span",{className:"text-xs",children:"Enable debugMode to record render tracing"})]})},el=({className:e,type:t,preffix:a,value:r})=>/* @__PURE__ */_("div",{className:l("flex items-center gap-1.5",e),children:[a&&/* @__PURE__ */Z("span",{className:"shrink-0 text-[10px] font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:a}),"color"===t&&/* @__PURE__ */Z("div",{className:"h-3.5 w-3.5 shrink-0 rounded-sm border border-zinc-300 dark:border-zinc-600",title:r,style:{backgroundColor:r}}),
|
|
283
|
+
/* @__PURE__ */Z("span",{className:l("truncate font-mono",{"text-zinc-700 dark:text-zinc-300":"color"===t,"text-violet-700 dark:text-violet-300":"color"!==t}),title:r,children:r??"—"})]}),tl=({name:e,type:t,value:a=""})=>/* @__PURE__ */_("div",{className:"grid grid-cols-[1fr_1.5fr] items-center border-b border-zinc-100 px-3 py-1.5 transition-colors hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-800/60",children:[/* @__PURE__ */_("div",{className:"flex min-w-0 flex-col gap-0.5 pr-2",children:[/* @__PURE__ */Z("span",{className:"truncate font-medium text-zinc-800 dark:text-zinc-200",title:e,children:e}),/* @__PURE__ */Z("span",{className:"text-[10px] tracking-wider text-zinc-400 uppercase dark:text-zinc-600",children:t})]}),/* @__PURE__ */_("div",{className:"flex min-w-0 flex-col gap-0.5",children:[("string"==typeof a||"number"==typeof a)&&/* @__PURE__ */Z(el,{type:t,value:a}),"object"==typeof a&&Object.keys(a).map((e,r)=>/* @__PURE__ */Z(el,{type:t,preffix:`${e}:`,value:a[e]},r))]})]}),al=({variables:e,variablesParsed:t})=>e&&0!==e.length?/* @__PURE__ */_("div",{className:"w-full overflow-hidden rounded border border-zinc-200 dark:border-zinc-700",children:[/* @__PURE__ */_("div",{className:"grid grid-cols-[1fr_1.5fr] border-b border-zinc-200 bg-zinc-50 px-3 py-1 text-zinc-400 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-500",children:[/* @__PURE__ */Z("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Name"}),/* @__PURE__ */Z("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Value"})]}),e.map((e,a)=>/* @__PURE__ */Z(tl,{name:e.name,type:e.type,value:t?.[e.name]},a))]}):/* @__PURE__ */Z("div",{className:"py-4 text-center text-xs text-zinc-400 italic dark:text-zinc-600",children:"No variables defined"}),rl=({variables:e})=>{let t=U(()=>Object.keys(e??{}).reduce((t,a)=>{let r=e?.[a];return r&&Object.keys(r).forEach(e=>{t.push({name:e,type:"color"===a?"color":"text",value:r[e]})}),t},[]),[e]);return 0===t.length?/* @__PURE__ */Z("div",{className:"py-4 text-center text-xs text-zinc-400 italic dark:text-zinc-600",children:"No style variables defined"}):/* @__PURE__ */_("div",{className:"w-full overflow-hidden rounded border border-zinc-200 dark:border-zinc-700",children:[/* @__PURE__ */_("div",{className:"grid grid-cols-[1fr_1.5fr] border-b border-zinc-200 bg-zinc-50 px-3 py-1 text-zinc-400 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-500",children:[/* @__PURE__ */Z("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Name"}),/* @__PURE__ */Z("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Value"})]}),t.map((e,t)=>/* @__PURE__ */Z(tl,{name:e.name,type:e.type,value:e.value},t))]})},nl=()=>{let[[e,t,a]]=c(["schema.variables","style.variables","runtime.sources.variables"]);/* @__PURE__ */
|
|
284
|
+
return _("div",{className:"flex w-full flex-col gap-4 overflow-y-auto p-3",children:[/* @__PURE__ */_("section",{className:"flex flex-col gap-1.5",children:[/* @__PURE__ */_("div",{className:"flex items-center gap-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-code"}),"Schema Variables"]}),/* @__PURE__ */Z(al,{variables:e,variablesParsed:a})]}),/* @__PURE__ */_("section",{className:"flex flex-col gap-1.5",children:[/* @__PURE__ */_("div",{className:"flex items-center gap-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */Z("i",{className:"fa-solid fa-palette"}),"Style Variables"]}),/* @__PURE__ */Z(rl,{variables:t})]})]})},il=({className:e,tabSelected:t,orientation:a,logTypeFilter:r,elementSelected:n,onSelectElement:i})=>{let{logs:s,clearLogs:d}=O(N);/* @__PURE__ */
|
|
285
|
+
return Z("div",{className:l("flex h-full w-full grow overflow-auto bg-white dark:bg-zinc-900",e),children:/* @__PURE__ */_("div",{className:"flex w-full flex-col",children:["logs"===t&&/* @__PURE__ */Z(qn,{items:s,orientation:a,logTypeFilter:r,onClear:d}),"store"===t&&/* @__PURE__ */Z(oi,{elementSelected:n}),"cache"===t&&/* @__PURE__ */Z(Wr,{}),"history"===t&&/* @__PURE__ */Z(ln,{}),"variables"===t&&/* @__PURE__ */Z(nl,{}),"elements"===t&&/* @__PURE__ */Z(en,{elementSelected:n,onSelectElement:i}),"plugins"===t&&/* @__PURE__ */Z(Yn,{}),"tracing"===t&&/* @__PURE__ */Z(Yi,{}),"actions"===t&&/* @__PURE__ */Z(Sr,{})]})})},ll=({className:e,iconClassName:t,title:a,isSelected:r=!1,onClick:n})=>/* @__PURE__ */Z("button",{className:l("flex h-6 w-6 cursor-pointer items-center justify-center rounded transition-colors",{"bg-violet-500/10 text-violet-600 dark:bg-violet-500/20 dark:text-violet-400":r,"text-zinc-500 hover:bg-zinc-200 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-100":!r},e),title:a,onClick:n,children:/* @__PURE__ */Z("i",{className:l("text-xs",t)})}),sl={system:"light",light:"dark",dark:"system"},dl={system:"fa-solid fa-desktop",light:"fa-solid fa-sun",dark:"fa-solid fa-moon"},cl={system:"System",light:"Light",dark:"Dark"},ol=()=>{let{theme:e,setTheme:t}=C(),a=F(()=>t(sl[e]),[e,t]);/* @__PURE__ */
|
|
286
|
+
return Z(ll,{iconClassName:dl[e],title:`Theme: ${cl[e]} — click for ${cl[sl[e]]}`,onClick:a})},ml=[{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:"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"}],pl=({tabSelected:e,orientation:t="vertical",onChangeOrientation:a,onCollapse:r,onTabSelect:n})=>{let{options:i,value:s,onSelect:d}=Kr(),c=F(()=>{a?.("horizontal"===t?"vertical":"horizontal")},[t,a]),o=F(e=>()=>n?.(e),[n]),m=F(e=>d(e.target.value),[d]);/* @__PURE__ */
|
|
287
|
+
return _("div",{className:"flex shrink-0 items-stretch justify-between border-b border-zinc-200 bg-zinc-100 select-none dark:border-zinc-700 dark:bg-zinc-800",children:[/* @__PURE__ */Z("div",{className:"flex items-stretch overflow-x-auto",children:ml.map(t=>{let a=e===t.id;/* @__PURE__ */
|
|
288
|
+
return _("button",{onClick:o(t.id),className:l("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,"border-transparent text-zinc-500 hover:bg-zinc-200/70 hover:text-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-700/50 dark:hover:text-zinc-100":!a}),children:[/* @__PURE__ */Z("i",{className:l(t.icon,"text-[10px]")}),t.label]},t.id)})}),/* @__PURE__ */_("div",{className:"flex shrink-0 items-center gap-1 border-l border-zinc-200 px-2 dark:border-zinc-700",children:[i.length>0&&/* @__PURE__ */Z("select",{value:s??"",onChange:m,title:"Instance / StoreProvider driving the panel",className:"max-w-52 rounded border border-zinc-300 bg-white px-1 py-0.5 text-[11px] text-zinc-700 dark:border-zinc-600 dark:bg-zinc-900 dark:text-zinc-200",children:i.map(e=>/* @__PURE__ */Z("optgroup",{label:e.label,children:e.options.map(e=>/* @__PURE__ */Z("option",{value:e.value,children:e.label},e.value))},e.label))}),
|
|
289
|
+
/* @__PURE__ */Z(ol,{}),
|
|
290
|
+
/* @__PURE__ */Z(ll,{iconClassName:l("fa-solid fa-table-columns",{"rotate-90":"vertical"===t}),title:"horizontal"===t?"Switch to side panel":"Switch to bottom panel",onClick:c}),
|
|
291
|
+
/* @__PURE__ */Z(ll,{iconClassName:"fa-solid fa-xmark",title:"Collapse to the indicator",onClick:r})]})]})},ul=({className:e,elementSelected:a,currentPageId:r,onSelectElement:n})=>{let[i,s]=W(!1),d=F(e=>{let{id:t}=e?.dataset??{};n(t)},[n]),c=U(()=>t(d,100),[d]),o=F(e=>{e.target.closest(".plitzi-sdk")&&c(e.target.closest("[data-id]"))},[c]),m=F(e=>{e.target.closest(".plitzi-sdk")&&(e.stopPropagation(),e.preventDefault(),s(!1))},[]),p=F(e=>{e.stopPropagation(),e.preventDefault(),s(!0)},[s]),u=F(()=>{s(!1),n(r)},[r,n]),h=F(()=>{s(!1),n("")},[n]);return B(()=>{if(typeof document>"u")return;let e=document.querySelectorAll(`[data-id="${a}"]`);return e.forEach(e=>e.classList.add("devtools-element-hovered")),()=>{e.forEach(e=>e.classList.remove("devtools-element-hovered"))}},[a]),B(()=>{if(!i||typeof document>"u")return;let e=document.getElementsByClassName("plitzi-sdk")[0];return e?(e.addEventListener("click",m),e.addEventListener("mousemove",o),()=>{e.removeEventListener("click",m),e.removeEventListener("mousemove",o)}):void 0},[m,o,i]),/* @__PURE__ */_("div",{className:l("flex shrink-0 items-center justify-between gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1 dark:border-zinc-700 dark:bg-zinc-800",e),children:[/* @__PURE__ */_("div",{className:"flex gap-1",children:[/* @__PURE__ */Z(ll,{iconClassName:"fa-regular fa-hand-pointer",title:"Select an element in the page to inspect it",onClick:p,isSelected:i}),/* @__PURE__ */Z(ll,{iconClassName:"fa-regular fa-file",title:"Current Page",onClick:u,isSelected:a===r})]}),/* @__PURE__ */Z(ll,{iconClassName:"fa-solid fa-ban",onClick:h,title:"Clear",isSelected:!!a})]})},hl=({className:e,orientation:t="vertical",tabSelected:a,logTypeFilter:r,onCollapse:n,onTabSelect:i,onChangeOrientation:s})=>{let[d,o]=T("plitzi-sdk.dev-tools.size",{width:500,height:200}),[m]=c("navigation.currentPageId"),[p,u]=W(),h=U(()=>"vertical"===t?["w"]:["n"],[t]),x=H(typeof document<"u"?document.querySelector(".plitzi-sdk"):null),f=F(e=>u(e),[u]),v=F((e,t)=>o(a=>({width:Number.isFinite(e)?e:a.width,height:Number.isFinite(t)?t:a.height})),[o]);/* @__PURE__ */
|
|
292
|
+
return Z(k,{className:l("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?d.width:1/0,height:"vertical"===t?1/0:d.height,resizeHandles:h,parentRef:x,autoGrow:!1,onChange:v,children:/* @__PURE__ */_("div",{className:"flex h-full w-full flex-col bg-white text-zinc-800 dark:bg-zinc-900 dark:text-zinc-200",children:[
|
|
293
|
+
/* @__PURE__ */Z(pl,{orientation:t,onChangeOrientation:s,onCollapse:n,onTabSelect:i,tabSelected:a}),["store","elements"].includes(a)&&/* @__PURE__ */Z(ul,{elementSelected:p,onSelectElement:f,currentPageId:m}),
|
|
294
|
+
/* @__PURE__ */Z(il,{orientation:t,tabSelected:a,logTypeFilter:r,elementSelected:p,onSelectElement:f})]})})},xl=({className:e,collapsed:t,orientation:a,tabSelected:r,logTypeFilter:n,onOpen:i,onCollapse:l,onTabSelect:s,onChangeOrientation:d})=>/* @__PURE__ */_(Q,{children:[t&&/* @__PURE__ */Z(be,{className:e,onOpen:i}),!t&&/* @__PURE__ */Z(hl,{className:e,orientation:a,tabSelected:r,logTypeFilter:n,onCollapse:l,onTabSelect:s,onChangeOrientation:d})]});export{xl as default};
|