@miravo/cli-linux-x64 0.6.5 → 0.7.0

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.
Files changed (113) hide show
  1. package/console-dist/assets/{AnimatePresence-CVhkybDC.js → AnimatePresence-DOKfbxUr.js} +1 -1
  2. package/console-dist/assets/activity-CHJbwIn_.js +1 -0
  3. package/console-dist/assets/api-Dr74arfP.js +1 -0
  4. package/console-dist/assets/arrow-right-DzTjpAuX.js +1 -0
  5. package/console-dist/assets/arrow-up-down-Dpy1cI5X.js +1 -0
  6. package/console-dist/assets/auth-screen-backdrop-UsGua6Zt.js +1 -0
  7. package/console-dist/assets/badge-Dl0qmCnt.js +1 -0
  8. package/console-dist/assets/catalog-BpH3Cu8D.js +1 -0
  9. package/console-dist/assets/catalog-eEp5qWXA.js +1 -0
  10. package/console-dist/assets/catalog-source-CwrkTmsS.js +1 -0
  11. package/console-dist/assets/catalog-template-icons-MOd-xD7l.js +1 -0
  12. package/console-dist/assets/checkbox-_saaQAja.js +1 -0
  13. package/console-dist/assets/circle-question-mark-BwjC8Yj-.js +1 -0
  14. package/console-dist/assets/combobox-BqGaRFom.js +1 -0
  15. package/console-dist/assets/control-Cs6l0S42.js +1 -0
  16. package/console-dist/assets/control-HmsS8PVv.js +1 -0
  17. package/console-dist/assets/copy-button-BYq-qqmM.js +1 -0
  18. package/console-dist/assets/download-BP5RD-RZ.js +1 -0
  19. package/console-dist/assets/dropdown-menu-6JrsGi7P.js +1 -0
  20. package/console-dist/assets/engine-store-BXfht5ME.js +1 -0
  21. package/console-dist/assets/events-DWA1VT_k.js +1 -0
  22. package/console-dist/assets/events-cE0ex41b.js +1 -0
  23. package/console-dist/assets/fleet-BFlqrO3Q.js +1 -0
  24. package/console-dist/assets/fleet-BwUT-GVy.js +1 -0
  25. package/console-dist/assets/format-B243kebG.js +1 -0
  26. package/console-dist/assets/get-error-message-CCNo4ZY0.js +1 -0
  27. package/console-dist/assets/index-BPBcRRBZ.css +2 -0
  28. package/console-dist/assets/index-Bj0gjqob.js +12 -0
  29. package/console-dist/assets/instance-detail-Dj-HV8SZ.js +1 -0
  30. package/console-dist/assets/label-CM_MIru8.js +1 -0
  31. package/console-dist/assets/layers-Cg3yeSqL.js +1 -0
  32. package/console-dist/assets/login--xDTnfsr.js +132 -0
  33. package/console-dist/assets/models-3mtC2SNR.js +1 -0
  34. package/console-dist/assets/models-CeCzWtHx.js +1 -0
  35. package/console-dist/assets/not-found-49MUUPk7.js +1 -0
  36. package/console-dist/assets/platform-targets-DkU1GIU_.js +1 -0
  37. package/console-dist/assets/platforms-BR0rAG4P.js +1 -0
  38. package/console-dist/assets/platforms-w6gbgm2g.js +1 -0
  39. package/console-dist/assets/{proxy-CgM57W61.js → proxy-Dd7NWn5E.js} +1 -1
  40. package/console-dist/assets/query-fetch-error-idV9_p3h.js +1 -0
  41. package/console-dist/assets/route-preload-BFzhCemJ.js +2 -0
  42. package/console-dist/assets/runtime-link-ocutSVA8.js +1 -0
  43. package/console-dist/assets/select-TsdpHrOx.js +1 -0
  44. package/console-dist/assets/select-display-items-C6R8SaIm.js +1 -0
  45. package/console-dist/assets/skeleton-BK5ydi_g.js +1 -0
  46. package/console-dist/assets/tabs-CrmZxWmX.js +1 -0
  47. package/console-dist/assets/tags-B8HK3sMj.js +4 -0
  48. package/console-dist/assets/tags-B_gW580r.js +1 -0
  49. package/console-dist/assets/tooltip-5y0snV5M.js +1 -0
  50. package/console-dist/assets/{transition-nav-link-99H9mlJO.js → transition-nav-link-D6yUsYsK.js} +1 -1
  51. package/console-dist/assets/triangle-alert-B7bgkvtE.js +1 -0
  52. package/console-dist/assets/use-engine-command-mutation-Bc3iCawV.js +1 -0
  53. package/console-dist/assets/use-platform-stream-Dgbg0wbc.js +2 -0
  54. package/console-dist/assets/{use-transition-navigate-Dp3qkQ87.js → use-transition-navigate-Cwez-Egt.js} +1 -1
  55. package/console-dist/assets/utils-CH98NBUe.js +1 -0
  56. package/console-dist/assets/validation-DELUYyVZ.js +1 -0
  57. package/console-dist/assets/vendor-ui-BcvPjvmT.js +1 -0
  58. package/console-dist/index.html +49 -47
  59. package/miravo +0 -0
  60. package/package.json +1 -1
  61. package/console-dist/assets/activity-DP0Us3HU.js +0 -1
  62. package/console-dist/assets/api-BjnU1LXi.js +0 -1
  63. package/console-dist/assets/arrow-right-DrKCU9WM.js +0 -1
  64. package/console-dist/assets/arrow-up-down-CBuv2TSF.js +0 -1
  65. package/console-dist/assets/auth-screen-backdrop-OrOL41MR.js +0 -1
  66. package/console-dist/assets/badge-tnWgSITj.js +0 -1
  67. package/console-dist/assets/catalog-BGQVa6B3.js +0 -1
  68. package/console-dist/assets/catalog-DEAID15Z.js +0 -1
  69. package/console-dist/assets/catalog-template-icons-b6a6Gty-.js +0 -1
  70. package/console-dist/assets/checkbox-Xly18Uyz.js +0 -1
  71. package/console-dist/assets/circle-question-mark-Q_q7JZnT.js +0 -1
  72. package/console-dist/assets/combobox-gGNWoksU.js +0 -1
  73. package/console-dist/assets/control-B_Mo9qMu.js +0 -1
  74. package/console-dist/assets/control-ahMsWPz4.js +0 -1
  75. package/console-dist/assets/copy-button-DYqJP5N8.js +0 -1
  76. package/console-dist/assets/createLucideIcon-Yddw9eHa.js +0 -1
  77. package/console-dist/assets/deploy-tab-BRET5egR.js +0 -1
  78. package/console-dist/assets/download-BPgKzo-_.js +0 -1
  79. package/console-dist/assets/engine-store-BUO-9Dsh.js +0 -1
  80. package/console-dist/assets/events-B2IxlA63.js +0 -1
  81. package/console-dist/assets/events-rhPd7QcZ.js +0 -1
  82. package/console-dist/assets/fleet-CF_yW3Xe.js +0 -1
  83. package/console-dist/assets/fleet-DbMmYTAW.js +0 -1
  84. package/console-dist/assets/get-error-message-BzBOywwk.js +0 -1
  85. package/console-dist/assets/index-BswNf6_7.css +0 -2
  86. package/console-dist/assets/index-JB69yOxP.js +0 -12
  87. package/console-dist/assets/input-BCiRHEmc.js +0 -1
  88. package/console-dist/assets/instance-detail-4eUBkrXG.js +0 -1
  89. package/console-dist/assets/label-xIWEC6lW.js +0 -1
  90. package/console-dist/assets/login-B7ZXWxuU.js +0 -132
  91. package/console-dist/assets/models-BUJkHhCT.js +0 -1
  92. package/console-dist/assets/models-DeByQ5rq.js +0 -1
  93. package/console-dist/assets/not-found-ZSvYdbVs.js +0 -1
  94. package/console-dist/assets/platform-targets-BbVxaqAc.js +0 -1
  95. package/console-dist/assets/platforms-Caq2eqh-.js +0 -1
  96. package/console-dist/assets/platforms-DjGsPZpq.js +0 -1
  97. package/console-dist/assets/query-keys-Co1J4HmV.js +0 -1
  98. package/console-dist/assets/route-preload-DZpMivUv.js +0 -2
  99. package/console-dist/assets/select-4wihIkEE.js +0 -1
  100. package/console-dist/assets/select-display-items-DUJCelf2.js +0 -1
  101. package/console-dist/assets/server-D7sb2mj5.js +0 -1
  102. package/console-dist/assets/skeleton-C6iEH-9E.js +0 -1
  103. package/console-dist/assets/tabs-BgPF8MSY.js +0 -1
  104. package/console-dist/assets/tags-CL_-O-ZZ.js +0 -4
  105. package/console-dist/assets/tags-DEKAj0l-.js +0 -1
  106. package/console-dist/assets/tooltip-TtanriwA.js +0 -1
  107. package/console-dist/assets/triangle-alert-DPtblpQC.js +0 -1
  108. package/console-dist/assets/use-engine-command-mutation--eob_QrP.js +0 -1
  109. package/console-dist/assets/use-platform-stream-ScJV0xv8.js +0 -2
  110. package/console-dist/assets/validation-BTuAJAb2.js +0 -1
  111. package/console-dist/assets/vendor-ui-mizMYESS.js +0 -1
  112. /package/console-dist/assets/{transition-types-CMW7IObN.js → transition-types-BNgNegH3.js} +0 -0
  113. /package/console-dist/assets/{vendor-table-wd8JuMmT.js → vendor-table-B6rxzcq0.js} +0 -0
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-COnpUsM8.js";import{o as e,s as t}from"./vendor-charts-CAZdaPlq.js";import{J as n,Y as r,at as i}from"./vendor-ui-mizMYESS.js";import{n as a,t as o}from"./createLucideIcon-Yddw9eHa.js";function s(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function c(e,t){let n=t.trim().toLowerCase();return n?e.toLowerCase().includes(n)||s(e).toLowerCase().includes(n):!0}function l(e,t){let n=t.trim().toLowerCase();return n?e.toLowerCase().includes(n)||y(e).toLowerCase().includes(n):!0}function u(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function d(e){let t=e.trim();return t&&(t.includes(`_`)?u(t):/^[A-Z][A-Z0-9_-]*$/.test(t)?t:t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}function f(e){return e.includes(`_`)?d(e):s(e)}var p={degC:`°C`,"m3/h":`m³/h`,"mm/s":`mm/s`,pu:`pu`,"%":`%`};function m(e){return e?p[e]??e:``}var h=`en-US`;function g(e){let t=Math.max(0,Math.trunc(e));return t<1e6?t.toLocaleString(h):new Intl.NumberFormat(h,{notation:`compact`,compactDisplay:`short`,maximumFractionDigits:1}).format(t)}function _(e){return Number.isInteger(e)?Math.abs(e)>=1e4?e.toLocaleString(h):String(e):Math.abs(e)>=100?e.toFixed(1):Math.abs(e)>=1?e.toFixed(2):e.toFixed(3)}function v(e){return e.toLocaleString(h)}function y(e){let t=e.match(/^(.+)-(\d{3,})$/);if(!t)return s(e);let[,n,r]=t;return n?`${s(n)} ${r}`:s(e)}function b(e){return e.join(`/`)}function x(e,t){return`${b(e)}/${t}`}function S(e){let t=Math.round((Number.isFinite(e)&&e>=0?e:0)*60),n=1440,r=Math.floor(t/n),i=t%n,a=Math.floor(i/60),o=i%60;if(r>=365){let e=Math.floor(r/365),t=r%365,n=[`${e}y`];return t>0&&n.push(`${t}d`),a>0&&n.push(`${a}h`),o>0&&n.push(`${o}m`),n.join(` `)}if(r>0){let e=[`${r}d`];return a>0&&e.push(`${a}h`),o>0&&e.push(`${o}m`),e.join(` `)}return a>0?o>0?`${a}h ${o}m`:`${a}h`:o>0?`${o}m`:`0h`}function C(e){return new Date(e).toLocaleString(h)}function w(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:new Date(e).toLocaleDateString(h,{month:`short`,day:`numeric`})}var T=new Set([`faulted`,`critical`,`stopped`,`emergency`]),E=new Set([`degraded`,`uncertain`]);function D(e){return T.has(e)?`bad`:E.has(e)?`warn`:`neutral`}var O=o(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),k=o(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),A=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,j=e,M=(e,t)=>n=>{if(t?.variants==null)return j(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=A(t)||A(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return j(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},N=i(),P=M(`group/button inline-flex shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:border-destructive/50 aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground border-input bg-input/30 hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 bg-destructive/20 hover:bg-destructive/30 focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[var(--miravo-radius-tight)] px-2 text-xs in-data-[slot=button-group]:rounded-[var(--miravo-radius-stadium-sm)] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[var(--miravo-radius-tight)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-[var(--miravo-radius-stadium-sm)] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`relative size-6 rounded-[var(--miravo-radius-tight)] in-data-[slot=button-group]:rounded-[var(--miravo-radius-stadium-sm)] [&_svg:not([class*='size-'])]:size-3 before:absolute before:inset-[-10px] before:content-['']`,"icon-sm":`relative size-7 rounded-[var(--miravo-radius-tight)] in-data-[slot=button-group]:rounded-[var(--miravo-radius-stadium-sm)] before:absolute before:inset-[-10px] before:content-['']`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function F({className:e,variant:t=`default`,size:n=`default`,...i}){return(0,N.jsx)(r,{"data-slot":`button`,className:a(P({variant:t,size:n,className:e})),...i})}t();function I({className:e,type:t,...r}){return(0,N.jsx)(n,{type:t,"data-slot":`input`,className:a(`h-8 w-full min-w-0 rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/30 px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground hover:bg-input/50 focus-visible:border-primary/35 focus-visible:ring-2 focus-visible:ring-primary/22 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...r})}export{m as C,D as E,u as S,c as T,g as _,k as a,w as b,T as c,b as d,C as f,s as g,v as h,M as i,E as l,y as m,F as n,O as o,d as p,P as r,h as s,I as t,x as u,_ as v,l as w,f as x,S as y};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{a as t,i as n,n as r,r as i,s as a,t as o}from"./vendor-charts-CAZdaPlq.js";import{at as s}from"./vendor-ui-mizMYESS.js";import{_ as c,a as l}from"./api-BjnU1LXi.js";import{a as u,n as d,r as f,t as p}from"./get-error-message-BzBOywwk.js";import{t as m}from"./proxy-CgM57W61.js";import{i as ee,r as te}from"./dist-jROhexoH.js";import{c as ne,l as re}from"./chunk-OE4NN4TA-m2UhO8Q2.js";import{a as h,i as g,n as _,r as v,s as y,t as b}from"./copy-button-DYqJP5N8.js";import{n as x,t as S}from"./createLucideIcon-Yddw9eHa.js";import{i as C,n as w,t as T}from"./tooltip-TtanriwA.js";import{C as E,E as D,S as O,c as k,d as ie,g as A,l as j,m as M,n as N,p as P,t as ae,u as F,v as I,y as oe}from"./input-BCiRHEmc.js";import{r as L}from"./engine-store-BUO-9Dsh.js";import{t as se}from"./activity-DP0Us3HU.js";import{a as ce,c as le,i as ue,n as de,o as R,r as fe,s as z,t as pe}from"./tabs-BgPF8MSY.js";import{c as me,l as he,o as ge,s as B}from"./validation-BTuAJAb2.js";import{a as _e,c as V,o as ve,t as ye}from"./use-engine-command-mutation--eob_QrP.js";import{t as H}from"./triangle-alert-DPtblpQC.js";import{t as U}from"./badge-tnWgSITj.js";import{t as be}from"./query-keys-Co1J4HmV.js";import{t as xe}from"./transition-types-CMW7IObN.js";import{n as Se}from"./auth-screen-backdrop-OrOL41MR.js";var W=S(`layers-2`,[[`path`,{d:`M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74z`,key:`15q6uc`}],[`path`,{d:`m20 14.285 1.5.845a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74l1.5-.845`,key:`byia6g`}]]),Ce=S(`signal`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}],[`path`,{d:`M22 4v16`,key:`sih9yq`}]]),we=S(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),G=e(a(),1),K=s(),q=`bg-transparent bg-transparent`,J=`blueprint-title text-foreground`;function Te(e,t){return t.includes(`rpm`)||t.includes(`speed`)?`e.g. 2500`:t.includes(`temp`)?`e.g. 70.0`:t.includes(`pressure`)?`e.g. 4.5`:e===`Boolean`?`true / false`:e===`String`?`value`:`e.g. 100`}function Ee({detail:e,methodArgs:t,setMethodArgs:n,onInvoke:r,isPending:i=!1,pendingMethod:a=null}){let o=Object.entries(e.methods);if(o.length===0)return null;let s=o.filter(([,e])=>e.inputArguments.length===0),c=o.filter(([,e])=>e.inputArguments.length>0);return(0,K.jsxs)(`div`,{id:`commands`,className:`flex min-w-0 flex-col gap-3 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsx)(`h2`,{className:J,children:`Commands`}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground/75`,children:`Executable methods on this asset`})]}),s.length>0&&(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:s.map(([e,t])=>{let n=a===e&&i,o=n?R:V;return t.description?(0,K.jsxs)(T,{children:[(0,K.jsx)(C,{render:(0,K.jsxs)(N,{size:`sm`,variant:`outline`,disabled:i,title:e,className:x(`h-8 gap-1.5 font-mono text-xs`,q),onClick:()=>r(e),children:[(0,K.jsx)(o,{className:x(`size-3`,n&&`animate-spin`),"aria-hidden":!0}),P(e)]})}),(0,K.jsx)(w,{side:`bottom`,className:`max-w-xs`,children:t.description})]},e):(0,K.jsxs)(N,{size:`sm`,variant:`outline`,disabled:i,title:e,className:x(`h-8 gap-1.5 font-mono text-xs`,q),onClick:()=>r(e),children:[(0,K.jsx)(o,{className:x(`size-3`,n&&`animate-spin`),"aria-hidden":!0}),P(e)]},e)})}),c.length>0&&s.length>0&&(0,K.jsx)(B,{className:`bg-border/60`}),c.map(([e,o])=>{let s=a===e&&i;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{title:e,className:`font-mono text-sm font-medium`,children:P(e)}),o.description&&(0,K.jsx)(`p`,{className:`mt-0.5 text-[10px] text-muted-foreground`,children:o.description})]}),(0,K.jsxs)(N,{size:`sm`,variant:`default`,disabled:i,className:`shrink-0`,onClick:()=>r(e),children:[s?(0,K.jsx)(R,{className:`mr-1 size-3 animate-spin`,"aria-hidden":!0}):(0,K.jsx)(V,{className:`mr-1 size-3`,"aria-hidden":!0}),`Execute`]})]}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-col gap-1.5 border-t border-border/50 pt-3`,children:o.inputArguments.map(r=>(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`span`,{title:r.name,className:`w-28 shrink-0 truncate pt-1.5 font-mono text-[10px] leading-tight text-muted-foreground`,children:P(r.name)}),(0,K.jsx)(ae,{className:`h-7 flex-1 font-mono text-xs`,placeholder:Te(r.dataType,r.name),value:t[e]?.[r.name]??``,onChange:t=>n(n=>({...n,[e]:{...n[e],[r.name]:t.target.value}}))})]},r.name))})]},e)})]})}function De({activeFaults:e,availableFaults:t,onTriggerFault:n,onClearFault:r}){let i=e.length>0,[a,o]=(0,G.useState)(null);return(0,K.jsxs)(`div`,{id:`faults`,className:`flex min-w-0 flex-col gap-3 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,K.jsx)(`h2`,{className:J,children:`Alarms`}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground/75`,children:`Active faults and injectable failure modes (environment)`})]}),i?(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[var(--miravo-radius-tight)] border border-destructive/30 bg-transparent py-2.5 pl-3 pr-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(H,{className:`size-4 shrink-0 text-destructive`}),(0,K.jsx)(`span`,{title:e,className:`font-mono text-sm font-medium text-destructive`,children:P(e)})]}),(0,K.jsxs)(N,{size:`sm`,variant:`outline`,className:x(`h-8 shrink-0 gap-1 border-destructive/30 px-2.5 font-mono text-[0.75rem] text-destructive shadow-none`,`hover:border-destructive/45 hover:bg-destructive/5 hover:text-destructive`,`focus-visible:border-destructive/40 focus-visible:ring-destructive/20`,q),onClick:()=>r(e),children:[(0,K.jsx)(z,{className:`size-3.5`,"aria-hidden":!0}),`Clear`]})]},e))}):(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,K.jsx)(le,{className:`size-4 text-success`}),`All clear — no active faults`]}),t.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(B,{className:`bg-border/60`}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`p`,{className:x(J,`mb-2`),children:[`Inject fault`,(0,K.jsxs)(U,{variant:`secondary`,className:`ml-2 text-[10px]`,children:[t.filter(t=>!e.includes(t)).length,` available`]})]}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.filter(t=>!e.includes(t)).map(e=>(0,K.jsx)(N,{size:`sm`,variant:`outline`,title:e,className:x(`h-7 font-mono text-[10px]`,q),onClick:()=>o(e),children:P(e)},e))})]})]}),(0,K.jsx)(_,{open:a!==null,onOpenChange:e=>{e||o(null)},children:(0,K.jsxs)(v,{children:[(0,K.jsx)(y,{className:`font-heading text-lg font-semibold tracking-tight`,children:`Inject fault?`}),(0,K.jsxs)(g,{className:`text-sm text-muted-foreground`,children:[`This asserts`,` `,(0,K.jsx)(`span`,{title:a??void 0,className:`font-mono text-foreground`,children:a?P(a):``}),` `,`on the running environment. Downstream consumers will see the fault immediately. Clear it from the active list when you're done.`]}),(0,K.jsxs)(h,{children:[(0,K.jsx)(N,{variant:`outline`,onClick:()=>o(null),children:`Cancel`}),(0,K.jsxs)(N,{variant:`destructive`,onClick:()=>{a&&n(a),o(null)},children:[(0,K.jsx)(H,{className:`mr-1 size-3.5`,"aria-hidden":!0}),`Inject fault`]})]})]})})]})}function Oe({detail:e,tick:t,activeFaults:n,memberValues:r,onBack:i}){let a=n.length,o=e.isQuarantined,s=`OK`,c=`ok`;a>0?(s=`FAULT`,c=`bad`):o&&(s=`QRTN`,c=`warn`);let l=0;if(r)for(let e of r.values())e.quality!==`good`&&l++;let u=Object.keys(e.members).length,d=r?.get(`availability_state`)?.value,f=e.members.availability_state?.value,p=typeof d==`string`?d:typeof f==`string`?f:`unknown`,m=p===`running`?{dot:`bg-success`,pulse:`bg-success/60`,animate:!0}:p===`faulted`?{dot:`bg-destructive`,pulse:`bg-destructive/60`,animate:!0}:p===`stopped`?{dot:`bg-warning`,pulse:`bg-warning/60`,animate:!0}:{dot:`bg-muted-foreground/60`,pulse:`bg-muted-foreground/50`,animate:!1},ee=p===`running`?`Availability state is running — the asset is available and in service.`:p===`faulted`?`Availability state is faulted — the asset is unavailable because a fault is active.`:p===`stopped`?`Availability state is stopped — the asset is available but not running.`:`Availability state is not available for this asset yet.`;return(0,K.jsxs)(`header`,{className:x(ve,`flex w-full min-w-0 flex-col`),children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 px-5 py-4 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:i,className:`transition-colors hover:text-foreground`,children:`Fleet`}),(0,K.jsx)(`span`,{"aria-hidden":!0,children:`/`}),(0,K.jsx)(`span`,{className:`truncate`,children:A(e.assetType)})]}),(0,K.jsx)(G.ViewTransition,{name:`instance-${e.id}`,default:`none`,children:(0,K.jsx)(`h1`,{className:`font-heading mt-1 text-2xl font-semibold uppercase leading-tight tracking-wide`,children:M(e.id)})}),(0,K.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-1.5`,children:[(0,K.jsx)(`p`,{className:`m-0 min-w-0 flex-1 font-mono text-[10px] leading-tight tracking-tight text-muted-foreground`,children:(0,K.jsx)(`span`,{className:`break-all`,children:e.browsePath.join(` / `)})}),(0,K.jsx)(`span`,{className:`inline-flex shrink-0`,children:(0,K.jsx)(b,{value:ie(e.browsePath),label:`Copy Topic / UNS path`})})]})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 self-end font-mono text-xs sm:self-start`,children:[(0,K.jsx)(ce,{className:`size-3.5 animate-pulse text-primary`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`font-medium text-primary`,children:`LIVE`}),(0,K.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[`t=`,t]}),(0,K.jsxs)(T,{children:[(0,K.jsx)(C,{render:(0,K.jsx)(`span`,{className:`inline-flex size-3.5 items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-ring`}),children:(0,K.jsxs)(`span`,{"aria-hidden":!0,className:`relative flex size-1.5 shrink-0 items-center justify-center`,children:[(0,K.jsx)(`span`,{className:x(`relative inline-flex size-1.5 rounded-full`,m.dot)}),m.animate&&(0,K.jsx)(`span`,{className:x(`absolute inline-flex size-2.5 animate-ping rounded-full opacity-75`,m.pulse)})]})}),(0,K.jsx)(w,{side:`top`,align:`end`,children:(0,K.jsxs)(`span`,{className:`block max-w-[16rem] text-[11px] leading-snug`,children:[(0,K.jsx)(`span`,{className:`font-medium uppercase tracking-[0.08em]`,children:`Availability`}),` `,(0,K.jsxs)(`span`,{className:`text-muted-foreground`,children:[`— `,ee]})]})})]})]})]}),(0,K.jsxs)(`fieldset`,{"aria-label":`Instance status`,className:`m-0 flex flex-col border-0 border-t border-border/50 p-0`,children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-px bg-transparent`,children:[(0,K.jsx)(Y,{variant:`primary`,icon:se,label:`Health`,value:s,tone:c,tooltip:`Rolls up active faults and quarantine into a single status — OK when nothing is asserted, FAULT when any fault is active, QRTN when the asset is excluded from the running fleet.`}),(0,K.jsx)(Y,{variant:`primary`,icon:H,label:`Active faults`,labelCompact:`Faults`,value:String(a),tone:a>0?`bad`:`neutral`,tooltip:`Fault codes currently asserted on this asset. Clear or inject faults from the Alarms section below.`})]}),(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-t border-border/50 bg-transparent sm:grid-cols-4`,children:[(0,K.jsx)(Y,{variant:`compact`,icon:W,label:`Lifecycle`,labelCompact:`Life`,value:P(e.lifecycleStage),tone:D(e.lifecycleStage),tooltip:`Where this asset sits in its operational lifecycle (e.g. commissioning, operating, maintenance, retired).`}),(0,K.jsx)(Y,{variant:`compact`,icon:he,label:`Tags`,value:String(u),tone:`neutral`,tooltip:`Total members exposed by this asset — process variables, state flags, counters, commands, and reference fields combined.`}),(0,K.jsx)(Y,{variant:`compact`,icon:Ce,label:`Bad quality`,value:String(l),tone:l>0?`warn`:`neutral`,tooltip:`Members whose quality stamp is anything other than good (uncertain or bad). A healthy asset reads 0.`}),(0,K.jsx)(Y,{variant:`compact`,icon:we,label:`Operating age`,value:oe(e.operatingHours),tone:`neutral`,tooltip:`Total operating age on this asset, including any environment-seeded starting hours plus simulated runtime elapsed in this session.`})]})]})]})}function Y({icon:e,label:t,labelCompact:n,value:r,suffix:i,tone:a,variant:o=`compact`,tooltip:s}){let c=o===`primary`;return(0,K.jsxs)(`div`,{className:x(`relative flex min-w-0 flex-col justify-center`,c?`min-h-20 gap-1.5 px-4 py-4 sm:min-h-24 sm:px-6 sm:py-5 lg:min-h-28 lg:px-8`:`min-h-12 gap-1 px-3 py-2.5 sm:min-h-13 sm:px-4 lg:min-h-14 lg:px-5`),children:[(0,K.jsx)(`div`,{className:`flex min-h-0 min-w-0 items-center gap-2`,children:(0,K.jsxs)(T,{children:[(0,K.jsxs)(C,{className:`flex min-h-0 min-w-0 flex-1 cursor-default items-center gap-2 text-left`,render:(0,K.jsx)(`div`,{}),children:[(0,K.jsx)(e,{className:x(`shrink-0 text-muted-foreground`,c?`size-4`:`size-3.5`),"aria-hidden":!0}),(0,K.jsxs)(`span`,{className:x(`min-w-0 flex-1 font-medium tracking-wide text-muted-foreground uppercase 2xl:tracking-wider`,c?`text-[11px] leading-snug sm:text-[12px]`:`text-[9px] leading-snug sm:text-[10px]`),children:[(0,K.jsx)(`span`,{className:`block wrap-break-word 2xl:hidden`,children:n??t}),(0,K.jsx)(`span`,{className:`hidden wrap-break-word 2xl:block`,children:t})]})]}),(0,K.jsx)(w,{side:`top`,align:`start`,sideOffset:6,className:`max-w-xs`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:s??t})]})})]})}),(0,K.jsxs)(`p`,{className:x(`min-w-0 wrap-break-word font-mono font-semibold leading-tight tracking-tight tabular-nums`,c?`text-2xl sm:text-3xl lg:text-4xl`:`text-base lg:text-lg`,a===`ok`&&`text-success`,a===`warn`&&`text-warning`,a===`bad`&&`text-destructive`,a===`neutral`&&`text-foreground`),children:[r,i?(0,K.jsx)(`span`,{className:x(`ml-0.5 font-medium text-muted-foreground`,c?`text-base lg:text-lg`:`text-xs lg:text-sm`),children:i}):null]})]})}function X({title:e,subtitle:t,children:n,className:r,id:i}){return(0,K.jsxs)(`section`,{id:i,className:x(_e,r),children:[(0,K.jsxs)(`div`,{className:`border-b border-border/60 px-4 py-3`,children:[(0,K.jsx)(`h2`,{className:`blueprint-title text-foreground`,children:e}),t?(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t}):null]}),(0,K.jsx)(`div`,{className:`overflow-hidden p-0`,children:n})]})}function Z({className:e,counters:t,memberValues:n}){return(0,K.jsx)(X,{title:`Counters`,subtitle:`Totals, hours, and accumulators`,className:e,children:(0,K.jsx)(`div`,{className:`flex flex-col gap-2 p-4`,children:t.map(([e,t])=>{let r=n?.get(e),i=r?r.value:t.value;return(0,K.jsxs)(`div`,{className:`flex items-center justify-between rounded-[var(--miravo-radius-tight)] border border-border/60 bg-transparent px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:O(e)}),(0,K.jsxs)(`span`,{className:`blueprint-stat text-sm font-medium`,children:[typeof i==`number`?I(i):String(i),t.meta.unit&&(0,K.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:E(t.meta.unit)})]})]},e)})})})}function Q({className:e,detail:t,referenceMembers:n,memberValues:r}){let i=Object.keys(t.parameters).length>0,a=n.length>0;return!i&&!a?null:(0,K.jsx)(X,{title:`Nameplate & configuration`,subtitle:`Design parameters, identity, and reference values`,className:e,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[i&&(0,K.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:Object.entries(t.parameters).map(([e,t])=>(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5 py-1.5`,children:[(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:O(e)}),(0,K.jsxs)(`span`,{className:`font-mono text-sm font-medium`,children:[typeof t.value==`number`?I(t.value):String(t.value),t.unit&&(0,K.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:E(t.unit)})]})]},e))}),a&&(0,K.jsx)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:n.map(([e,t])=>{let n=r?.get(e),i=n?n.value:t.value;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-[var(--miravo-radius-tight)] border border-border/60 bg-transparent p-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:O(e)}),(0,K.jsxs)(`span`,{className:`font-mono text-sm font-medium`,children:[typeof i==`number`?I(i):String(i),t.meta.unit&&(0,K.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:E(t.meta.unit)})]})]},e)})})]})})}var ke=new Set([`pu`,`h`]),Ae=[`_reference`,`_baseline`,`_setpoint`,`_command`],$=`var(--color-primary)`,je=`var(--color-background)`;function Me(e){return Object.entries(e.members).filter(([e,t])=>t.meta.kind===`variable`&&t.meta.access===`read`&&t.meta.dataType===`Double`&&t.meta.euRange!==null&&!ke.has(t.meta.unit??``)&&!Ae.some(t=>e.endsWith(t)))}function Ne(e){if(e.length<3)return!1;let t=e[0]?.value??0;return e.some(e=>Math.abs(e.value-t)>.001)}function Pe({data:e,chartHeight:a=34}){let s=(0,G.useId)(),[c,l]=(0,G.useState)(null),u=e.map(e=>e.value),d=Math.min(...u),f=Math.max(...u);return(0,K.jsxs)(`div`,{className:`flex min-h-0 w-full flex-col overflow-hidden`,style:{height:a+14},children:[(0,K.jsx)(`div`,{style:{height:a,width:`100%`},children:(0,K.jsx)(n,{width:`100%`,height:a,children:(0,K.jsxs)(o,{data:e,margin:{top:2,right:2,bottom:2,left:0},onMouseMove:e=>{let t=e?.activePayload?.[0]?.value;typeof t==`number`&&l(t)},onMouseLeave:()=>l(null),children:[(0,K.jsx)(`defs`,{children:(0,K.jsxs)(`linearGradient`,{id:s,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:$,stopOpacity:.3}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:$,stopOpacity:0})]})}),(0,K.jsx)(r,{domain:[`auto`,`auto`],hide:!0}),(0,K.jsx)(t,{content:()=>null,cursor:!1}),(0,K.jsx)(i,{type:`monotone`,dataKey:`value`,stroke:$,strokeWidth:1.5,fill:`url(#${s})`,isAnimationActive:!1,dot:!1,activeDot:{r:3,fill:$,stroke:je,strokeWidth:1}})]})})}),(0,K.jsx)(`span`,{className:`text-[10px] leading-none tabular-nums text-muted-foreground`,children:c===null?(0,K.jsxs)(K.Fragment,{children:[I(d),`–`,I(f)]}):(0,K.jsx)(`span`,{className:`font-medium text-primary`,children:I(c)})})]})}function Fe({detail:e,processVariables:t,memberValues:n,historyRef:r,showQuality:i}){let a=(0,G.useMemo)(()=>[...t].sort(([e],[t])=>{let n=r.current.get(e)??[],i=r.current.get(t)??[],a=n.length>2&&Ne(n);return a===(i.length>2&&Ne(i))?0:a?-1:1}),[t,n,r]);return t.length===0?(0,K.jsx)(X,{title:`Process`,subtitle:`No continuous analog readings defined for this asset`,className:`opacity-90`,children:(0,K.jsx)(`p`,{className:`px-4 py-6 text-center text-sm text-muted-foreground`,children:`This asset exposes no continuous process variables. Discrete states, flags, and commands are available in the Tags section below.`})}):(0,K.jsx)(X,{title:`Process`,subtitle:`Live tag readings — trend is ~2 min at 1 Hz`,children:(0,K.jsx)(`ul`,{className:`divide-y divide-border/40`,children:a.map(([t,a])=>{let o=n?.get(t),s=o?o.value:a.value,c=o?o.quality:a.quality,l=r.current.get(t)??[],u=F(e.browsePath,t),d=l.length>2&&Ne(l),f=E(a.meta.unit),p=O(t);return(0,K.jsxs)(m.li,{layout:!0,transition:{duration:.32,ease:[.22,1,.36,1]},className:`flex flex-col gap-2.5 bg-background px-4 py-3 sm:flex-row sm:items-center sm:gap-5 sm:py-3.5`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 sm:w-44 sm:shrink-0`,children:[(0,K.jsxs)(T,{children:[(0,K.jsx)(C,{className:`min-w-0 flex-1 cursor-default truncate text-left text-[11px] font-medium uppercase tracking-[var(--miravo-tracking-eyebrow)] text-muted-foreground`,render:(0,K.jsx)(`span`,{}),children:p}),(0,K.jsx)(w,{side:`top`,align:`start`,className:`max-w-xs`,children:p})]}),(0,K.jsx)(b,{value:u,label:`Copy Topic / UNS path`})]}),(0,K.jsxs)(`div`,{className:`relative h-[56px] min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border/30`}),d?(0,K.jsx)(Pe,{data:l,chartHeight:42}):(0,K.jsx)(`p`,{className:`flex h-full items-center text-[10px] uppercase tracking-widest text-muted-foreground`,children:l.length<=2?`Collecting trend…`:`No change (last 2 min)`})]}),(0,K.jsxs)(`div`,{className:`flex items-baseline gap-2 sm:min-w-36 sm:shrink-0 sm:justify-end`,children:[(0,K.jsx)(`span`,{className:`blueprint-stat text-2xl font-semibold leading-none tabular-nums text-foreground`,children:typeof s==`number`?I(s):String(s)}),f&&(0,K.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:f}),i&&c!==`good`&&(0,K.jsx)(U,{variant:c===`uncertain`?`secondary`:`destructive`,className:`shrink-0 text-[10px]`,children:c})]})]},t)})})})}function Ie({name:e,value:t,dataType:n,unit:r,access:i}){let a=O(e),o=i===`readwrite`;if(n===`Boolean`||typeof t==`boolean`||r===`pu`&&(t===0||t===1)){let n=t===!0||t===`true`||t===1,r=e.includes(`fault`);return(0,K.jsxs)(`div`,{className:`flex min-h-9 min-w-0 items-center justify-between gap-2 rounded-[var(--miravo-radius-tight)] border px-2 py-1 ${r&&n?`border-destructive/30 bg-transparent`:``}`,children:[(0,K.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-left text-[10px] leading-snug text-muted-foreground`,children:[a,o&&(0,K.jsx)(`span`,{className:`ml-1 text-[8px] text-primary`,children:`CMD`})]}),(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-xs font-medium tabular-nums ${r&&n?`text-destructive`:n?`text-success`:`text-muted-foreground`}`,children:n?`ON`:`OFF`})]})}if(n===`String`){let n=String(t),r=n===`none`||n===``,i=k.has(n)||e.includes(`fault_code`)&&!r,o=!i&&j.has(n);return(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col justify-center gap-1 rounded-[var(--miravo-radius-tight)] border px-2 py-2 ${i?`border-destructive/30 bg-transparent`:o?`border-warning/30 bg-warning/5`:``}`,children:[(0,K.jsx)(`span`,{className:`wrap-break-word text-[10px] leading-tight text-muted-foreground`,children:a}),r?(0,K.jsx)(`span`,{className:`wrap-break-word font-mono text-sm font-medium leading-snug text-muted-foreground`,children:`—`}):(0,K.jsx)(`span`,{title:n,className:`wrap-break-word font-mono text-sm font-medium leading-snug ${i?`text-destructive`:o?`text-warning`:`text-foreground`}`,children:P(n)})]})}return(0,K.jsxs)(`div`,{className:`flex min-h-9 min-w-0 items-center justify-between gap-2 rounded-[var(--miravo-radius-tight)] border px-2 py-1`,children:[(0,K.jsxs)(`span`,{className:`min-w-0 flex-1 truncate text-left text-[10px] leading-snug text-muted-foreground`,children:[a,o&&(0,K.jsx)(`span`,{className:`ml-1 text-[8px] text-primary`,children:`CMD`})]}),(0,K.jsxs)(`span`,{className:`shrink-0 text-right font-mono text-xs font-medium tabular-nums`,children:[typeof t==`number`?I(t):String(t),r&&(0,K.jsx)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:E(r)})]})]})}function Le(e){return[...e].sort((e,t)=>{let n=e[1].meta.access===`readwrite`;return n===(t[1].meta.access===`readwrite`)?e[0].localeCompare(t[0]):n?-1:1})}function Re({stringEnumMembers:e,nonStringOperationalMembers:t,memberValues:n,className:r}){let i=(0,G.useMemo)(()=>Le(e),[e]),a=(0,G.useMemo)(()=>Le(t),[t]),o=`grid min-w-0 gap-2 [grid-template-columns:repeat(auto-fill,minmax(min(100%,12.5rem),1fr))]`;return(0,K.jsx)(X,{title:`Tags`,subtitle:`Mode, status flags, and control tags`,className:r,children:(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5 p-4`,children:[i.length>0&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a.length>0&&(0,K.jsx)(`h3`,{className:`blueprint-title text-muted-foreground`,children:`States`}),(0,K.jsx)(`div`,{className:o,children:i.map(([e,t])=>{let r=n?.get(e);return(0,K.jsx)(Ie,{name:e,value:r?r.value:t.value,dataType:t.meta.dataType,unit:t.meta.unit,access:t.meta.access},e)})})]}),a.length>0&&(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[i.length>0&&(0,K.jsx)(`h3`,{className:`blueprint-title text-muted-foreground`,children:`Flags & commands`}),(0,K.jsx)(`div`,{className:o,children:a.map(([e,t])=>{let r=n?.get(e);return(0,K.jsx)(Ie,{name:e,value:r?r.value:t.value,dataType:t.meta.dataType,unit:t.meta.unit,access:t.meta.access},e)})})]})]})})}var ze=120,Be=`gap-4 sm:gap-5 lg:gap-x-6 lg:gap-y-5 xl:gap-x-8`,Ve=`instance-detail-page relative isolate mx-auto flex min-h-full w-full max-w-screen-2xl flex-col gap-6 p-4 sm:gap-8 sm:p-6`;function He(e){return e instanceof Error&&`code`in e&&e.code===`NOT_FOUND`?!0:e instanceof Error&&/^404\b/.test(e.message.trim())}function Ue(){let{id:e}=re(),t=ne(),n=(0,G.useCallback)(()=>{(0,G.startTransition)(()=>{(0,G.addTransitionType)(xe),t(`/`)})},[t]),[r,i]=(0,G.useState)({}),[a,o]=(0,G.useState)(null),[s,h]=(0,G.useState)(!1),[g,_]=ee(`tab`,te([`hmi`,`operate`,`data`,`operations`]).withDefault(`hmi`)),v=g===`data`||g===`operations`?`operate`:g,y=ye();(0,G.useEffect)(()=>{y.isPending||o(null)},[y.isPending]),(0,G.useEffect)(()=>{(g===`data`||g===`operations`)&&_(`operate`)},[g,_]);let b=(0,G.useCallback)(e=>{_(`operate`),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`})})})},[_]);(0,G.useEffect)(()=>{let e=null,t=!1,r=()=>{t=!1,e&&=(clearTimeout(e),null)},i=i=>{if(i.metaKey||i.ctrlKey||i.altKey)return;let a=i.target;if(a){let e=a.tagName;if(e===`INPUT`||e===`TEXTAREA`||e===`SELECT`||a.isContentEditable)return}if(t){i.key===`f`?(b(`faults`),i.preventDefault()):i.key===`c`&&(b(`commands`),i.preventDefault()),r();return}if(i.key===`g`){t=!0,e=setTimeout(r,1200);return}i.key===`b`&&!i.shiftKey?(n(),i.preventDefault()):i.key===`?`&&(h(!0),i.preventDefault())};return window.addEventListener(`keydown`,i),()=>{window.removeEventListener(`keydown`,i),r()}},[n,b]);let S=u({queryKey:be.instances.detail(e??``),queryFn:()=>l(`/instances/${e}`,c.instanceDetail),enabled:e!==void 0}),C=(0,G.useDeferredValue)(S.data??null),w=S.isError,T=L(e=>e.memberValues),E=(0,G.useMemo)(()=>e?T.get(e):void 0,[T,e]),D=L(e=>e.models),O=L(e=>e.instances),k=(0,G.useMemo)(()=>O.find(t=>t.id===e),[O,e]),ie=(0,G.useMemo)(()=>k?.activeFaults??[],[k]),A=(0,G.useRef)(new Map),j=L(e=>e.tick);(0,G.useEffect)(()=>{if(!E||!e)return;let t=A.current;for(let[e,n]of E){if(typeof n.value!=`number`)continue;let r=t.get(e);r||(r=[],t.set(e,r)),(r.length===0||r[r.length-1]?.tick!==j)&&(r.push({value:n.value,tick:j}),r.length>ze&&r.shift())}},[E,j,e]);let M=(0,G.useMemo)(()=>C?Me(C):[],[C]),P=(0,G.useMemo)(()=>{if(!C)return{operational:[],counters:[],reference:[]};let e=new Set(M.map(([e])=>e)),t=Object.entries(C.members).filter(([t])=>!e.has(t)),n=[],r=[],i=[];for(let e of t){let[,t]=e,a=t.meta.dataType,o=t.meta.kind,s=t.meta.unit,c=s===`pu`&&t.meta.euRange?.[0]===0&&t.meta.euRange?.[1]===1;o===`property`?i.push(e):a===`Boolean`||a===`String`||c?n.push(e):s===`count`||a===`UInt16`||a===`UInt32`?r.push(e):t.meta.access===`readwrite`||Ae.some(t=>e[0].endsWith(t))?n.push(e):s===`pu`||s===`h`?r.push(e):i.push(e)}return{operational:n,counters:r,reference:i}},[C,M]),ae=(0,G.useMemo)(()=>C?D.find(e=>e.name===C.assetType)?.faultNames??[]:[],[C,D]),F=ie??C?.activeFaults??[],I=(0,G.useMemo)(()=>{if(!E)return F.length>0;for(let[,e]of E)if(e.quality!==`good`)return!0;return!1},[E,F.length]),oe=(0,G.useMemo)(()=>P.operational.filter(([,e])=>e.meta.dataType===`String`),[P.operational]),se=(0,G.useMemo)(()=>P.operational.filter(([,e])=>e.meta.dataType!==`String`),[P.operational]),ce=t=>{if(!e)return;let n={},i=C?.methods[t];if(i)for(let e of i.inputArguments){let i=r[t]?.[e.name]??``,a=ge(e.name,i,e.dataType);if(!a)return;n[e.name]=a.value}o(t),y.mutateAsync({type:`invokeMethod`,instanceId:e,method:t,arguments:n}).then(async()=>{await S.refetch()}).catch(()=>{})},le=t=>{e&&y.mutate({type:`triggerFault`,instanceId:e,fault:t})},R=t=>{e&&y.mutate({type:`clearFault`,instanceId:e,fault:t})};if(!C)return w?He(S.error)?(0,K.jsx)(Se,{className:`min-h-full`,children:(0,K.jsx)(`div`,{className:`flex min-h-[40vh] items-center justify-center p-6 sm:p-12`,children:(0,K.jsx)(`div`,{className:`w-full max-w-md`,children:(0,K.jsxs)(f,{eyebrow:`Instance lookup`,stamp:`404`,title:`Instance not found`,detail:e??`Unknown instance id`,detailLabel:`Requested instance`,primaryLabel:`Back to Fleet`,onPrimary:n,children:[(0,K.jsx)(`p`,{children:`The requested asset is no longer in the running fleet or the URL is wrong.`}),(0,K.jsx)(`p`,{children:`Return to Fleet and pick a live instance from the current environment.`})]})})})}):(0,K.jsx)(Se,{className:`min-h-full`,children:(0,K.jsxs)(`div`,{className:`flex min-h-[40vh] flex-col items-center justify-center gap-4 p-6 sm:p-12`,children:[(0,K.jsx)(`div`,{className:`w-full max-w-md`,children:(0,K.jsx)(d,{message:p(S.error,`Could not load instance.`),onRetry:()=>void S.refetch(),isRetrying:S.isFetching})}),(0,K.jsx)(N,{variant:`outline`,size:`sm`,onClick:n,children:`Back to Fleet`})]})}):k?(0,K.jsx)(`div`,{className:Ve,children:(0,K.jsx)(Oe,{detail:{id:k.id,assetType:k.model,browsePath:k.browsePath,lifecycleStage:k.lifecycleStage,operatingHours:k.operatingHours,activeFaults:k.activeFaults,isQuarantined:k.isQuarantined,parameters:{},members:{},methods:{}},tick:j,activeFaults:F,memberValues:E,onBack:n})}):null;let z=P.operational.length>0,B=P.counters.length>0,V=P.reference.length>0||Object.keys(C.parameters).length>0,ve=z||B||V,H=Object.keys(C.methods).length>0,U=z&&!B&&!V,W=z&&B&&V;return(0,K.jsxs)(`div`,{className:Ve,children:[(0,K.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10 hidden select-none overflow-hidden md:block`,children:(0,K.jsx)(`span`,{className:`absolute -top-2 left-0 whitespace-nowrap uppercase leading-none opacity-35 blur-[2px]`,style:{fontFamily:`var(--miravo-font-heading)`,fontSize:`clamp(5rem, 14vw, 12rem)`,fontWeight:`var(--miravo-weight-medium)`,letterSpacing:`var(--miravo-tracking-heading)`,color:`var(--miravo-ghost)`},children:C.assetType.replace(/_/g,` `)})}),(0,K.jsx)(Oe,{detail:C,tick:j,activeFaults:F,memberValues:E,onBack:n}),(0,K.jsx)(G.ViewTransition,{enter:`fade-in`,default:`none`,children:(0,K.jsxs)(pe,{value:v,onValueChange:e=>{_(e)},className:`min-h-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`shrink-0 overflow-x-auto`,children:(0,K.jsxs)(fe,{variant:`line`,className:`h-10! min-w-max gap-0.5`,children:[(0,K.jsxs)(ue,{value:`hmi`,className:`gap-1.5 px-3 text-sm`,children:[(0,K.jsx)(he,{className:`size-3.5 shrink-0`}),`HMI`]}),(0,K.jsxs)(ue,{value:`operate`,className:`gap-1.5 px-3 text-sm`,children:[(0,K.jsx)(me,{className:`size-3.5 shrink-0`}),`Operate`]})]})}),(0,K.jsx)(de,{value:`hmi`,className:`flex-1 py-2`,children:(0,K.jsx)(m.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},children:(0,K.jsx)(Fe,{detail:C,processVariables:M,memberValues:E,historyRef:A,showQuality:I})},`hmi`)}),(0,K.jsx)(de,{value:`operate`,className:`flex-1 py-2`,children:(0,K.jsxs)(m.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},className:`flex min-w-0 flex-col gap-4`,children:[ve&&(0,K.jsxs)(`section`,{"aria-label":`Data`,className:x(`grid min-w-0 grid-cols-1`,Be,W&&`lg:grid-cols-2 lg:grid-rows-[auto_auto] lg:items-start`,!W&&z&&(B||V)&&`lg:grid-cols-2 lg:items-start`),children:[z&&(0,K.jsx)(Re,{stringEnumMembers:oe,nonStringOperationalMembers:se,memberValues:E,className:x(`min-h-0 min-w-0 self-stretch`,U&&`lg:col-span-2`,W&&`lg:row-span-2`)}),!z&&B&&V&&(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col gap-6 lg:col-span-2`,children:[(0,K.jsx)(Z,{counters:P.counters,memberValues:E}),(0,K.jsx)(Q,{detail:C,referenceMembers:P.reference,memberValues:E})]}),!z&&B&&!V&&(0,K.jsx)(Z,{className:`lg:col-span-2`,counters:P.counters,memberValues:E}),!z&&!B&&V&&(0,K.jsx)(Q,{className:`lg:col-span-2`,detail:C,referenceMembers:P.reference,memberValues:E}),z&&B&&(0,K.jsx)(Z,{className:`min-h-0 min-w-0 self-stretch lg:col-start-2 lg:row-start-1`,counters:P.counters,memberValues:E}),z&&V&&(0,K.jsx)(Q,{className:x(`min-h-0 min-w-0 self-stretch lg:col-start-2`,W?`lg:row-start-2`:`lg:row-start-1`),detail:C,referenceMembers:P.reference,memberValues:E})]}),(0,K.jsxs)(`section`,{"aria-label":`Operations`,className:x(_e,`grid grid-cols-1`,H&&`lg:grid-cols-2`),children:[(0,K.jsx)(De,{activeFaults:F,availableFaults:ae,onTriggerFault:le,onClearFault:R}),H&&(0,K.jsx)(`div`,{className:`border-t border-border/50 lg:border-l lg:border-t-0`,children:(0,K.jsx)(Ee,{detail:C,methodArgs:r,setMethodArgs:i,onInvoke:ce,isPending:y.isPending,pendingMethod:a})})]})]},`operate`)})]})}),(0,K.jsx)(We,{open:s,onOpenChange:h})]})}function We({open:e,onOpenChange:t}){return(0,K.jsx)(_,{open:e,onOpenChange:t,children:(0,K.jsxs)(v,{children:[(0,K.jsx)(y,{className:`font-heading text-lg font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,K.jsx)(g,{className:`text-sm text-muted-foreground`,children:`Navigate this instance without leaving the keyboard.`}),(0,K.jsx)(`ul`,{className:`flex flex-col gap-2 pt-1`,children:[{keys:[`g`,`f`],label:`Jump to Alarms`},{keys:[`g`,`c`],label:`Jump to Commands`},{keys:[`b`],label:`Back to Fleet`},{keys:[`?`],label:`Show this sheet`}].map(e=>(0,K.jsxs)(`li`,{className:`flex items-center justify-between gap-4`,children:[(0,K.jsx)(`span`,{className:`text-sm text-foreground`,children:e.label}),(0,K.jsx)(`span`,{className:`flex items-center gap-1`,children:e.keys.map((t,n)=>(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(`kbd`,{className:`rounded-[var(--miravo-radius-tight)] border border-border bg-muted/40 px-1.5 py-0.5 font-mono text-[11px] font-medium text-foreground`,children:t}),n<e.keys.length-1&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`then`})]},`${e.label}-${t}`))})]},e.label))})]})})}export{Ue as InstanceDetailPage};
@@ -1 +0,0 @@
1
- import{at as e}from"./vendor-ui-mizMYESS.js";import{n as t}from"./createLucideIcon-Yddw9eHa.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`label`,{"data-slot":`label`,className:t(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...r})}export{r as t};
@@ -1,132 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-mizMYESS.js";import{c as r,g as i,r as a}from"./api-BjnU1LXi.js";import{t as o}from"./use-transition-navigate-Dp3qkQ87.js";import{t as s}from"./transition-nav-link-99H9mlJO.js";var c=e(t(),1),l=n(),u=`
2
- @keyframes readout-appear {
3
- from { opacity: 0; transform: translateY(8px) scale(0.95); }
4
- to { opacity: 1; transform: translateY(0) scale(1); }
5
- }
6
- @keyframes dot-pulse {
7
- 0%, 100% { opacity: 1; }
8
- 50% { opacity: 0.3; }
9
- }
10
- @keyframes login-glow-pulse {
11
- 0% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
12
- 100% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.03); }
13
- }
14
- @keyframes status-blink {
15
- 0%, 100% { opacity: 1; }
16
- 50% { opacity: 0.35; }
17
- }
18
- @keyframes live-dot {
19
- 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 20%, transparent); }
20
- 50% { box-shadow: 0 0 0 2px transparent; }
21
- }
22
- @keyframes terminal-appear {
23
- from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
24
- to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
25
- }
26
- @keyframes terminal-line {
27
- from { opacity: 0; transform: translateY(4px); }
28
- to { opacity: 1; transform: translateY(0); }
29
- }
30
- @keyframes cursor-blink {
31
- 0%, 49% { opacity: 0.8; }
32
- 50%, 100% { opacity: 0; }
33
- }
34
- @keyframes tree-line {
35
- from { opacity: 0; transform: translateX(-6px); }
36
- to { opacity: 1; transform: translateX(0); }
37
- }
38
-
39
- /* ── Layout ───────────────────────────────── */
40
- .login-page {
41
- display: grid;
42
- min-height: 100svh;
43
- grid-template-columns: 1.2fr 1fr;
44
- }
45
- .login-left { display: block; order: -1; }
46
-
47
- @media (max-width: 1023px) {
48
- .login-page { grid-template-columns: 1fr; }
49
- .login-left { display: none !important; }
50
- }
51
- @media (max-width: 640px) {
52
- .login-card { padding: 1.75rem !important; }
53
- .login-form-area { padding: 2rem 1.25rem !important; }
54
- .login-topbar { padding: 1rem 1.25rem !important; }
55
- .login-footer { padding: 0.75rem 1.25rem !important; }
56
- }
57
- @media (max-width: 400px) {
58
- .login-card { padding: 1.5rem !important; }
59
- .login-form-area { padding: 1.5rem 1rem !important; }
60
- .login-topbar { padding: 0.85rem 1rem !important; }
61
- .login-footer { padding: 0.65rem 1rem !important; }
62
- .miravo-input { padding: 0.8rem 0.9rem !important; font-size: 1rem !important; }
63
- .miravo-btn { padding: 0.9rem !important; font-size: 0.95rem !important; }
64
- }
65
-
66
- /* ── Form elements ────────────────────────── */
67
- .miravo-input {
68
- width: 100%;
69
- padding: 0.7rem 0.9rem;
70
- background: var(--secondary);
71
- border: 1px solid color-mix(in srgb, var(--tooltip-border) 45%, transparent);
72
- border-radius: 4px;
73
- color: var(--foreground);
74
- font-family: var(--font-body);
75
- font-size: 0.88rem;
76
- outline: none;
77
- transition: border-color 0.2s, box-shadow 0.2s;
78
- box-sizing: border-box;
79
- }
80
- .miravo-input:focus {
81
- border-color: color-mix(in srgb, var(--ring) 45%, transparent);
82
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 6%, transparent);
83
- }
84
- .miravo-input::placeholder {
85
- color: color-mix(in srgb, var(--tooltip-border) 70%, transparent);
86
- }
87
-
88
- .miravo-btn {
89
- width: 100%;
90
- padding: 0.78rem;
91
- background: var(--primary);
92
- border: none;
93
- border-radius: 20px;
94
- color: var(--primary-foreground);
95
- font-family: var(--font-heading);
96
- font-size: 0.88rem;
97
- font-weight: 700;
98
- cursor: pointer;
99
- letter-spacing: -0.01em;
100
- box-shadow:
101
- 0 0 20px color-mix(in srgb, var(--primary) 15%, transparent),
102
- 0 1px 3px color-mix(in srgb, var(--background) 30%, transparent);
103
- transition: all 0.2s ease;
104
- }
105
- .miravo-btn:hover:not(:disabled) {
106
- filter: brightness(1.1);
107
- box-shadow:
108
- 0 0 30px color-mix(in srgb, var(--primary) 22%, transparent),
109
- 0 2px 8px color-mix(in srgb, var(--background) 40%, transparent);
110
- transform: translateY(-1px);
111
- }
112
- .miravo-btn:active:not(:disabled) { transform: translateY(0); }
113
- .miravo-btn:disabled { opacity: 0.5; cursor: not-allowed; }
114
-
115
- .miravo-btn-ghost {
116
- background: transparent;
117
- border: none;
118
- font-family: var(--font-body);
119
- font-size: 0.78rem;
120
- color: var(--muted-foreground);
121
- cursor: pointer;
122
- transition: color 0.2s;
123
- padding: 0;
124
- text-decoration: underline;
125
- text-underline-offset: 3px;
126
- text-decoration-color: transparent;
127
- }
128
- .miravo-btn-ghost:hover {
129
- color: var(--foreground);
130
- text-decoration-color: var(--tooltip-border);
131
- }
132
- `;function d(e,t){return`color-mix(in srgb, ${e} ${t*100}%, transparent)`}function f({label:e,forId:t,children:n}){return(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{htmlFor:t,style:{fontFamily:`var(--font-mono)`,fontSize:`0.6rem`,color:`var(--muted-foreground)`,display:`block`,marginBottom:`0.5rem`},children:e}),n]})}function p({message:e}){return(0,l.jsx)(`p`,{style:{fontSize:`0.82rem`,color:`var(--destructive)`,textAlign:`center`,padding:`0.55rem 0.9rem`,background:`color-mix(in srgb, var(--destructive) 6%, transparent)`,border:`1px solid color-mix(in srgb, var(--destructive) 12%, transparent)`,borderRadius:4,margin:`0 0 1rem`},children:e})}function m({onChangePassword:e}){let t=o(),[n,a]=(0,c.useState)(``),[s,u]=(0,c.useState)(``),[d,m]=(0,c.useState)(``),[h,g]=(0,c.useState)(!1);async function _(a){a.preventDefault(),m(``),g(!0);try{(await r(n,s)).changePassword?e():(i.removeQueries({queryKey:[`bootstrap`]}),t(`/`,{replace:!0}))}catch(e){m(e instanceof Error?e.message:`Login failed`)}finally{g(!1)}}return(0,l.jsxs)(`form`,{onSubmit:_,children:[(0,l.jsxs)(`div`,{style:{marginBottom:`2rem`},children:[(0,l.jsx)(`div`,{style:{fontFamily:`var(--font-mono)`,fontSize:`0.52rem`,color:`var(--tooltip-border)`,marginBottom:`0.7rem`},children:`SYS.AUTH — OPERATOR LOGIN`}),(0,l.jsx)(`h1`,{style:{fontFamily:`var(--font-heading)`,fontSize:`1.5rem`,fontWeight:800,color:`var(--foreground)`,letterSpacing:`-0.035em`,lineHeight:1.15,margin:0},children:`Log in`}),(0,l.jsx)(`p`,{style:{fontSize:`0.82rem`,color:`var(--muted-foreground)`,marginTop:`0.4rem`,lineHeight:1.5},children:`Authenticate to access the control console`})]}),d&&(0,l.jsx)(p,{message:d}),(0,l.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`1.15rem`},children:[(0,l.jsx)(f,{label:`Username`,forId:`username`,children:(0,l.jsx)(`input`,{id:`username`,type:`text`,className:`miravo-input`,autoComplete:`username`,required:!0,value:n,onChange:e=>a(e.target.value)})}),(0,l.jsx)(f,{label:`Password`,forId:`password`,children:(0,l.jsx)(`input`,{id:`password`,type:`password`,className:`miravo-input`,autoComplete:`current-password`,required:!0,value:s,onChange:e=>u(e.target.value)})}),(0,l.jsx)(`button`,{type:`submit`,className:`miravo-btn`,disabled:h,style:{marginTop:`0.5rem`},children:`Log in`})]})]})}function h(){let e=o(),[t,n]=(0,c.useState)(``),[r,s]=(0,c.useState)(``),[u,d]=(0,c.useState)(``),[m,h]=(0,c.useState)(!1);async function g(n){if(n.preventDefault(),d(``),t!==r){d(`Passwords do not match`);return}if(t.length<6){d(`Password must be at least 6 characters`);return}h(!0);try{await a(`admin`,t),i.removeQueries({queryKey:[`bootstrap`]}),e(`/`,{replace:!0})}catch(e){d(e instanceof Error?e.message:`Password change failed`)}finally{h(!1)}}return(0,l.jsxs)(`form`,{onSubmit:g,children:[(0,l.jsxs)(`div`,{style:{marginBottom:`2rem`},children:[(0,l.jsx)(`div`,{style:{fontFamily:`var(--font-mono)`,fontSize:`0.52rem`,color:`var(--tooltip-border)`,marginBottom:`0.7rem`},children:`SYS.AUTH — PASSWORD RESET`}),(0,l.jsx)(`h1`,{style:{fontFamily:`var(--font-heading)`,fontSize:`1.5rem`,fontWeight:800,color:`var(--foreground)`,letterSpacing:`-0.035em`,lineHeight:1.15,margin:0},children:`Update password`}),(0,l.jsxs)(`p`,{style:{fontSize:`0.82rem`,color:`var(--muted-foreground)`,marginTop:`0.4rem`,lineHeight:1.5},children:[`Default password detected.`,` `,(0,l.jsx)(`span`,{style:{color:`var(--warning)`},children:`Please set a new one.`})]})]}),u&&(0,l.jsx)(p,{message:u}),(0,l.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`1.1rem`},children:[(0,l.jsx)(f,{label:`New password`,forId:`new-password`,children:(0,l.jsx)(`input`,{id:`new-password`,type:`password`,className:`miravo-input`,autoComplete:`new-password`,required:!0,minLength:6,value:t,onChange:e=>n(e.target.value)})}),(0,l.jsx)(f,{label:`Confirm password`,forId:`confirm-password`,children:(0,l.jsx)(`input`,{id:`confirm-password`,type:`password`,className:`miravo-input`,autoComplete:`new-password`,required:!0,minLength:6,value:r,onChange:e=>s(e.target.value)})}),(0,l.jsx)(`button`,{type:`submit`,className:`miravo-btn`,disabled:m,style:{marginTop:`0.4rem`},children:`Set password`}),(0,l.jsx)(`div`,{style:{textAlign:`center`,marginTop:`0.15rem`},children:(0,l.jsx)(`button`,{type:`button`,className:`miravo-btn-ghost`,onClick:()=>{i.removeQueries({queryKey:[`bootstrap`]}),e(`/`,{replace:!0})},children:`Skip for now`})})]})]})}function g(){let e=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let t=e.current;if(!t)return;let n=t.getContext(`2d`);if(!n)return;let r=t,i=n,a=getComputedStyle(document.documentElement).getPropertyValue(`--primary`).trim(),o=window.devicePixelRatio||1,s=0,c=0,l=0,u=!0,f=0,p=[],m=[],h=[];function g(){p=[],m=[],h=[];let e=Math.max(15,Math.floor(s*c/35e3));for(let t=0;t<e;t++)p.push({x:0,y:0,bx:25+Math.random()*(s-50),by:25+Math.random()*(c-50),r:1+Math.random()*1.2,phase:Math.random()*Math.PI*2});for(let e=0;e<p.length;e++)for(let t=e+1;t<p.length;t++){let n=p[e],r=p[t];!n||!r||Math.hypot(n.bx-r.bx,n.by-r.by)<160&&Math.random()>.5&&m.push({from:e,to:t})}}function _(){s=r.offsetWidth,c=r.offsetHeight,r.width=s*o,r.height=c*o,i.setTransform(o,0,0,o,0,0),g()}function v(){if(!u){f=requestAnimationFrame(v);return}l+=.016,i.clearRect(0,0,s,c);for(let e of p)e.x=e.bx+Math.sin(l*.15+e.phase)*5,e.y=e.by+Math.cos(l*.1+e.phase*1.3)*4;let e=new Set;for(let t of h)e.add(`${t.conn.from}-${t.conn.to}`);for(let t of m){let n=p[t.from],r=p[t.to];!n||!r||(i.beginPath(),i.moveTo(n.x,n.y),i.lineTo(r.x,r.y),i.strokeStyle=e.has(`${t.from}-${t.to}`)?d(a,.04):d(a,.012),i.lineWidth=.5,i.stroke())}for(let e of p){let t=.6+Math.sin(l*.4+e.phase)*.4;i.beginPath(),i.arc(e.x,e.y,e.r,0,Math.PI*2),i.fillStyle=d(a,.08*t),i.fill()}if(Math.random()<.03&&m.length&&h.length<10){let e=m[Math.floor(Math.random()*m.length)];e&&h.push({conn:e,t:0,speed:.002+Math.random()*.003,alpha:.25+Math.random()*.35,size:1+Math.random()*1})}for(let e=h.length-1;e>=0;e--){let t=h[e];if(!t)continue;if(t.t+=t.speed,t.t>=1){h.splice(e,1);continue}let n=p[t.conn.from],r=p[t.conn.to];if(!n||!r)continue;let o=n.x+(r.x-n.x)*t.t,s=n.y+(r.y-n.y)*t.t;i.beginPath(),i.arc(o,s,t.size,0,Math.PI*2),i.fillStyle=d(a,t.alpha*.35),i.fill()}f=requestAnimationFrame(v)}let y=()=>{u=!document.hidden},b,x=()=>{window.clearTimeout(b),b=window.setTimeout(_,250)};return document.addEventListener(`visibilitychange`,y),window.addEventListener(`resize`,x),_(),v(),()=>{cancelAnimationFrame(f),window.clearTimeout(b),document.removeEventListener(`visibilitychange`,y),window.removeEventListener(`resize`,x)}},[]),(0,l.jsx)(`canvas`,{ref:e,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`}})}var _=[{path:`pump-001/temp`,base:87.3,range:5,decimals:1,unit:`°C`,style:{left:`6%`,top:`18%`},delay:`1.4s`},{path:`comp/pressure`,base:4.21,range:.5,decimals:2,unit:`bar`,style:{right:`5%`,top:`12%`},delay:`1.7s`},{path:`motor/vibration`,base:2.14,range:.3,decimals:2,unit:`mm/s`,style:{left:`4%`,bottom:`18%`},delay:`2.0s`},{path:`gen/power`,base:482,range:20,decimals:0,unit:`kW`,style:{right:`4%`,bottom:`17%`},delay:`2.3s`},{path:`boiler/temp`,base:312,range:8,decimals:0,unit:`°C`,style:{left:`22%`,top:`8%`},delay:`2.6s`},{path:`turb/rpm`,base:1480,range:30,decimals:0,unit:`rpm`,style:{left:0,right:0,marginLeft:`auto`,marginRight:`auto`,width:`max-content`,bottom:`10%`},delay:`2.9s`}];function v(){let[e,t]=(0,c.useState)(()=>_.map(e=>({...e,displayValue:(e.base+(Math.random()-.5)*e.range).toFixed(e.decimals),flash:!1})));return(0,c.useEffect)(()=>{let e={id:void 0},n=window.setInterval(()=>{t(e=>e.map(e=>({...e,displayValue:(e.base+(Math.random()-.5)*e.range).toFixed(e.decimals),flash:!0}))),window.clearTimeout(e.id),e.id=window.setTimeout(()=>{t(e=>e.map(e=>({...e,flash:!1})))},400)},2200);return()=>{window.clearInterval(n),window.clearTimeout(e.id)}},[]),(0,l.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:3,pointerEvents:`none`},children:e.map(e=>(0,l.jsxs)(`div`,{style:{position:`absolute`,...e.style,display:`flex`,alignItems:`center`,gap:`0.45rem`,padding:`0.32rem 0.7rem`,background:`color-mix(in srgb, var(--background) 70%, transparent)`,backdropFilter:`blur(6px)`,WebkitBackdropFilter:`blur(6px)`,border:`1px solid color-mix(in srgb, var(--primary) 8%, transparent)`,borderRadius:4,fontFamily:`var(--font-mono)`,fontSize:`0.61rem`,letterSpacing:`0.02em`,opacity:0,animation:`readout-appear 0.6s cubic-bezier(0.22,1,0.36,1) ${e.delay} forwards`},children:[(0,l.jsx)(`span`,{style:{width:4,height:4,borderRadius:`50%`,background:`var(--primary)`,boxShadow:`0 0 3px color-mix(in srgb, var(--primary) 18%, transparent)`,animation:`dot-pulse 2.5s ease-in-out infinite`,flexShrink:0,display:`block`}}),(0,l.jsx)(`span`,{style:{color:`var(--tooltip-border)`},children:e.path}),(0,l.jsx)(`span`,{style:{color:e.flash?`#f5c542`:`var(--primary)`,fontWeight:600,minWidth:`3em`,textAlign:`right`,transition:`color 0.4s`},children:e.displayValue}),(0,l.jsx)(`span`,{style:{color:`var(--tooltip-border)`,fontSize:`0.54rem`},children:e.unit})]},e.path))})}var y=`miravo start --template smart-factory`,b=6,x=[{id:`sf`,indent:``,label:`site`,text:`smart-factory`},{id:`l1`,indent:` `,label:`area`,text:`line-1`},{id:`p001`,indent:` `,label:`cell`,text:`pump-001`},{id:`p001-t`,indent:` `,text:`temperature`,value:{base:87.3,range:5,decimals:1,unit:`°C`},protocol:`mqtt`},{id:`p001-p`,indent:` `,text:`pressure`,value:{base:4.21,range:.5,decimals:2,unit:`bar`},protocol:`opcua`},{id:`p001-v`,indent:` `,text:`vibration`,value:{base:2.14,range:.3,decimals:2,unit:`mm/s`},protocol:`modbus`},{id:`b002`,indent:` `,label:`cell`,text:`boiler-002`},{id:`b002-t`,indent:` `,text:`temperature`,value:{base:312,range:8,decimals:0,unit:`°C`},protocol:`mqtt`},{id:`c003`,indent:` `,label:`cell`,text:`comp-003`},{id:`c003-r`,indent:` `,text:`rpm`,value:{base:1480,range:30,decimals:0,unit:`rpm`},protocol:`modbus`},{id:`l2`,indent:` `,label:`area`,text:`line-2`},{id:`t004`,indent:` `,label:`cell`,text:`tank-004`},{id:`t004-l`,indent:` `,text:`level`,value:{base:72.1,range:5,decimals:1,unit:`%`},protocol:`mqtt`},{id:`m005`,indent:` `,label:`cell`,text:`motor-005`},{id:`m005-c`,indent:` `,text:`current`,value:{base:12.4,range:1.5,decimals:1,unit:`A`},protocol:`opcua`}],S=14,C=x.flatMap((e,t)=>e.value?[t]:[]),w=4+x.length,T=.66,E=1.85,D=2.1+w*T*E+1.15*T,O=[{assetId:`p001`,name:`cavitation`,event:`fault:cavitation on pump-001 — pressure drop`,resolve:`fault:resolved on pump-001 — nominal`,overrides:[{tagId:`p001-t`,base:95.2,range:3},{tagId:`p001-p`,base:1.83,range:.3},{tagId:`p001-v`,base:8.71,range:1.5}]},{assetId:`c003`,name:`bearing-wear`,event:`lifecycle:degraded on comp-003 — rpm declining`,resolve:`lifecycle:restored on comp-003 — nominal`,overrides:[{tagId:`c003-r`,base:924,range:40}]},{assetId:`m005`,name:`overcurrent`,event:`fault:overcurrent on motor-005 — current spike`,resolve:`fault:resolved on motor-005 — nominal`,overrides:[{tagId:`m005-c`,base:24.8,range:3}]}],k=new Map(x.map((e,t)=>[e.id,t]));function A(){let[e,t]=(0,c.useState)(0),[n,r]=(0,c.useState)(0),[i,a]=(0,c.useState)(()=>x.map(e=>e.value?(e.value.base+(Math.random()-.5)*e.value.range).toFixed(e.value.decimals):``)),[o,s]=(0,c.useState)(new Set),[u,d]=(0,c.useState)(null),[f,p]=(0,c.useState)(`+231 tags streaming`),m=(0,c.useRef)(new Set);(0,c.useEffect)(()=>{let e={timers:[],typeInt:0,liveInt:0,flashT:0},n=(t,n)=>{e.timers.push(window.setTimeout(t,n))},i=0;return n(()=>{e.typeInt=window.setInterval(()=>{if(i++,t(i),i>=37){window.clearInterval(e.typeInt),n(()=>r(1),400),n(()=>r(2),750),n(()=>r(3),1150);for(let e=0;e<x.length;e++)n(()=>r(4+e),1300+e*110);let t=1300+x.length*110+250;n(()=>r(w),t),n(()=>{e.liveInt=window.setInterval(()=>{let t=2+Math.floor(Math.random()*2),n=[...C.filter(e=>!m.current.has(e))].sort(()=>Math.random()-.5).slice(0,t),r=new Set(n);a(e=>{let t=[...e];for(let e of r){let n=x[e]?.value;n&&(t[e]=(n.base+(Math.random()-.5)*n.range).toFixed(n.decimals))}return t}),s(r),window.clearTimeout(e.flashT),e.flashT=window.setTimeout(()=>s(new Set),350)},1600);let t=0,r=()=>{let e=O[t%O.length];if(!e)return;let i=new Set(e.overrides.map(e=>k.get(e.tagId)).filter(e=>e!==void 0));m.current=i,d({assetId:e.assetId,name:e.name,indices:i}),p(e.event),a(t=>{let n=[...t];for(let t of e.overrides){let e=k.get(t.tagId);if(e!==void 0){let r=x[e];n[e]=(t.base+(Math.random()-.5)*t.range).toFixed(r?.value?.decimals??1)}}return n}),n(()=>{m.current=new Set,d(null),p(e.resolve),a(t=>{let n=[...t];for(let t of e.overrides){let e=k.get(t.tagId);if(e!==void 0){let t=x[e];t?.value&&(n[e]=(t.value.base+(Math.random()-.5)*t.value.range).toFixed(t.value.decimals))}}return n}),n(()=>{p(`+231 tags streaming`),t++,n(r,8e3)},4e3)},1e4)};n(r,8e3)},t+500)}},32)},200),()=>{for(let t of e.timers)window.clearTimeout(t);window.clearInterval(e.typeInt),window.clearInterval(e.liveInt),window.clearTimeout(e.flashT)}},[]);let h=y.slice(0,Math.min(e,b)),g=e>b?y.slice(b,e):``;return(0,l.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,zIndex:5,pointerEvents:`none`},children:(0,l.jsxs)(`div`,{style:{border:`1px solid color-mix(in srgb, var(--primary) 10%, transparent)`,borderRadius:4,boxShadow:`none`,overflow:`hidden`,width:540},children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`0.5rem 0.85rem`,background:`color-mix(in srgb, var(--sidebar) 50%, transparent)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`,borderBottom:`1px solid color-mix(in srgb, var(--primary) 6%, transparent)`},children:[(0,l.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:`#ff5f57`,opacity:.5}}),(0,l.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:`#febc2e`,opacity:.5}}),(0,l.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:`#28c840`,opacity:.5}}),(0,l.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`0.5rem`,color:`var(--tooltip-foreground)`,marginLeft:`auto`,letterSpacing:`0.04em`,opacity:.5},children:`Build realistic industrial environments`})]}),(0,l.jsxs)(`div`,{style:{height:`min(${D}rem, calc(100vh - 11rem))`,overflowY:`auto`,overflowX:`hidden`,background:`color-mix(in srgb, var(--card) 60%, transparent)`,padding:`1rem 1.25rem 1.1rem`,fontFamily:`var(--font-mono)`,fontSize:`${T}rem`,lineHeight:E,whiteSpace:`pre`},children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`$ `}),(0,l.jsx)(`span`,{style:{color:`var(--primary)`},children:h}),(0,l.jsx)(`span`,{style:{color:`var(--foreground)`,opacity:.9},children:g}),e>0&&e<37&&(0,l.jsx)(`span`,{style:{display:`inline-block`,width:5,height:10,background:`var(--primary)`,verticalAlign:`text-bottom`,marginLeft:1,animation:`cursor-blink 1s step-end infinite`}})]}),n>=1&&(0,l.jsxs)(`div`,{style:{opacity:0,animation:`terminal-line 0.4s ease forwards`},children:[(0,l.jsx)(`span`,{style:{color:`var(--primary)`},children:`✓`}),(0,l.jsx)(`span`,{style:{color:`var(--tooltip-foreground)`},children:` Loaded `}),(0,l.jsx)(`span`,{style:{color:`var(--primary)`},children:`smart-factory`}),(0,l.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:` — 10 assets · 240 tags`})]}),n>=2&&(0,l.jsxs)(`div`,{style:{opacity:0,animation:`terminal-line 0.4s ease 0.05s forwards`},children:[(0,l.jsx)(`span`,{style:{color:`var(--primary)`},children:`✓`}),(0,l.jsx)(`span`,{style:{color:`var(--tooltip-foreground)`},children:` Protocols `}),(0,l.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`mqtt :1883 · opcua :4840 · modbus :1502`})]}),n>=3&&(0,l.jsx)(`div`,{style:{opacity:0,animation:`terminal-line 0.3s ease forwards`,marginTop:`0.6em`}}),x.map((e,t)=>{if(n<4+t)return null;let r=!!e.value;return(0,l.jsxs)(`div`,{style:{opacity:0,animation:`tree-line 0.3s ease forwards`},children:[(0,l.jsx)(`span`,{style:{color:`var(--tooltip-border)`},children:e.indent}),r&&e.value?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:e.text.padEnd(S)}),(0,l.jsx)(`span`,{style:{color:u?.indices.has(t)?`var(--destructive)`:o.has(t)?`var(--primary)`:`var(--foreground)`,transition:`color 0.3s`},children:(i[t]??``).padStart(7)}),(0,l.jsx)(`span`,{style:{color:`var(--tooltip-border)`},children:` ${e.value.unit.padEnd(5)}`}),e.protocol&&(0,l.jsx)(`span`,{style:{color:`var(--tooltip-border)`},children:e.protocol})]}):(0,l.jsxs)(l.Fragment,{children:[e.label&&(0,l.jsx)(`span`,{style:{color:`var(--tooltip-border)`},children:`${e.label}: `}),(0,l.jsx)(`span`,{style:{color:`var(--tooltip-foreground)`},children:e.text}),e.label===`cell`&&u?.assetId===e.id&&(0,l.jsxs)(`span`,{style:{marginLeft:`0.8em`,color:`var(--destructive)`,fontSize:`0.9em`},children:[`— `,u.name]})]})]},e.id)}),n>=w&&(0,l.jsx)(`div`,{style:{opacity:0,animation:`terminal-line 0.4s ease forwards`,marginTop:`0.55em`,textAlign:`right`},children:(0,l.jsx)(`span`,{style:{color:f.includes(`resolved`)||f.includes(`restored`)||f.includes(`fault:`)||f.includes(`lifecycle:`)?`var(--muted-foreground)`:`var(--tooltip-border)`,transition:`color 0.4s`},children:f})})]})]})})}function j(){let[e,t]=(0,c.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`style`,{children:u}),(0,l.jsxs)(`div`,{className:`login-page`,children:[(0,l.jsxs)(`div`,{style:{background:`var(--background)`,backgroundImage:`radial-gradient(circle, color-mix(in srgb, var(--primary) 2.2%, transparent) 1px, transparent 1px)`,backgroundSize:`70px 70px`,display:`flex`,flexDirection:`column`,position:`relative`,overflow:`hidden`},children:[(0,l.jsx)(`div`,{style:{position:`absolute`,bottom:-80,right:-80,width:400,height:400,background:`radial-gradient(circle, color-mix(in srgb, var(--primary) 3.5%, transparent) 0%, transparent 65%)`,pointerEvents:`none`}}),(0,l.jsxs)(`div`,{className:`login-topbar`,style:{padding:`1.25rem 2rem`,borderBottom:`1px solid var(--secondary)`,zIndex:1,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,l.jsxs)(s,{to:`/`,style:{display:`inline-flex`,alignItems:`center`,gap:`0.6rem`,textDecoration:`none`},children:[(0,l.jsx)(`img`,{src:`/miravo-logo.webp`,alt:`Miravo`,loading:`lazy`,decoding:`async`,style:{width:24,height:24,objectFit:`contain`}}),(0,l.jsx)(`span`,{style:{fontFamily:`var(--font-heading)`,fontSize:`0.95rem`,fontWeight:700,color:`var(--foreground)`,letterSpacing:`-0.02em`},children:`Miravo`}),(0,l.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`0.52rem`,fontWeight:600,color:`var(--primary)`,background:`color-mix(in srgb, var(--primary) 6%, transparent)`,border:`1px solid color-mix(in srgb, var(--primary) 14%, transparent)`,padding:`0.15rem 0.5rem`,borderRadius:4,lineHeight:1,display:`inline-flex`,alignItems:`center`},children:`Console`})]}),(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`0.4rem`,fontFamily:`var(--font-mono)`,fontSize:`0.5rem`,color:`var(--tooltip-border)`},children:[(0,l.jsx)(`span`,{style:{width:5,height:5,borderRadius:`50%`,background:`var(--primary)`,display:`block`,animation:`status-blink 3s ease-in-out infinite`}}),`System active`]})]}),(0,l.jsx)(`div`,{className:`login-form-area`,style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`2.5rem 2rem`,zIndex:1},children:(0,l.jsx)(`div`,{style:{width:`100%`,maxWidth:370},children:(0,l.jsxs)(`div`,{className:`login-card`,style:{position:`relative`,background:`var(--card)`,border:`1px solid color-mix(in srgb, var(--secondary) 80%, transparent)`,borderRadius:4,overflow:`hidden`,padding:`2.25rem`},children:[(0,l.jsx)(`div`,{style:{position:`absolute`,top:0,left:14,right:14,height:1,background:`linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 35%, transparent) 20%, color-mix(in srgb, var(--primary) 35%, transparent) 80%, transparent)`}}),e?(0,l.jsx)(h,{}):(0,l.jsx)(m,{onChangePassword:()=>t(!0)})]})})}),(0,l.jsxs)(`div`,{className:`login-footer`,style:{padding:`0.9rem 2rem`,borderTop:`1px solid var(--secondary)`,display:`flex`,justifyContent:`space-between`,alignItems:`center`,zIndex:1},children:[(0,l.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`0.6rem`,color:`var(--tooltip-border)`,letterSpacing:`0.04em`},children:`Miravo Console`}),(0,l.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`0.6rem`,color:`var(--tooltip-border)`,letterSpacing:`0.04em`},children:`© 2026`})]})]}),(0,l.jsxs)(`div`,{className:`login-left`,style:{position:`relative`,background:`var(--background)`,overflow:`hidden`,borderRight:`1px solid color-mix(in srgb, var(--primary) 8%, transparent)`},children:[(0,l.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:9999,pointerEvents:`none`,opacity:.025,backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`,backgroundSize:`200px 200px`}}),(0,l.jsx)(g,{}),(0,l.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:1,background:`radial-gradient(ellipse 75% 70% at 50% 50%, transparent 40%, color-mix(in srgb, var(--background) 55%, transparent) 100%)`,pointerEvents:`none`}}),(0,l.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,width:700,height:500,background:`radial-gradient(ellipse at center, color-mix(in srgb, var(--primary) 1.8%, transparent) 0%, transparent 65%)`,pointerEvents:`none`,zIndex:2,animation:`login-glow-pulse 8s ease-in-out infinite alternate`}}),(0,l.jsx)(v,{}),(0,l.jsx)(A,{}),(0,l.jsxs)(`div`,{style:{position:`absolute`,top:`1.2rem`,right:`1.2rem`,zIndex:10,display:`flex`,alignItems:`center`,gap:`0.4rem`,padding:`0.3rem 0.65rem`,background:`color-mix(in srgb, var(--background) 65%, transparent)`,backdropFilter:`blur(6px)`,WebkitBackdropFilter:`blur(6px)`,border:`1px solid color-mix(in srgb, var(--primary) 10%, transparent)`,borderRadius:4,fontFamily:`var(--font-mono)`,fontSize:`0.5rem`,color:`var(--muted-foreground)`,pointerEvents:`none`},children:[(0,l.jsx)(`span`,{style:{width:5,height:5,borderRadius:`50%`,background:`var(--primary)`,display:`block`,animation:`live-dot 2s ease-in-out infinite`}}),`Live topology`]})]})]})]})}export{j as LoginPage};
@@ -1 +0,0 @@
1
- import{t as e}from"./models-DeByQ5rq.js";export{e as ModelsPage};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-mizMYESS.js";import{_ as r,a as i}from"./api-BjnU1LXi.js";import{a,n as o,t as s}from"./get-error-message-BzBOywwk.js";import{t as c}from"./proxy-CgM57W61.js";import{t as l}from"./AnimatePresence-CVhkybDC.js";import{a as u,i as d,n as f,o as p,r as m,s as h}from"./copy-button-DYqJP5N8.js";import{n as g,t as _}from"./createLucideIcon-Yddw9eHa.js";import{S as v,g as y,h as b,n as x,p as S,t as C}from"./input-BCiRHEmc.js";import{t as w}from"./activity-DP0Us3HU.js";import{C as T,n as E,t as D,w as O}from"./use-platform-stream-ScJV0xv8.js";import{l as k}from"./select-4wihIkEE.js";import{i as A,n as j,r as M,t as N}from"./tabs-BgPF8MSY.js";import{n as ee}from"./checkbox-Xly18Uyz.js";import{a as P,c as F,i as I,l as L,n as R,o as z,r as B,s as V,t as H}from"./deploy-tab-BRET5egR.js";import{c as U,n as te,r as ne,s as re,t as ie}from"./use-engine-command-mutation--eob_QrP.js";import{t as W}from"./triangle-alert-DPtblpQC.js";import{t as G}from"./badge-tnWgSITj.js";import{t as K}from"./query-keys-Co1J4HmV.js";var q=_(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),J=_(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),ae=_(`heart-pulse`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]),oe=_(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),se=_(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Y=e(t(),1),X=n(),ce=new Set([`fault_active`,`fault_count`,`active_fault_code`,`lifecycle_stage`,`health_state`,`availability_state`]);function le(e){let t=[],n=[],r=[],i=[];for(let[a,o]of Object.entries(e)){let e={name:a,kind:o.kind,dataType:o.dataType,access:o.access,unit:o.unit,euRange:o.euRange};ce.has(a)?i.push(e):o.kind===`property`?t.push(e):o.access===`readwrite`?n.push(e):r.push(e)}let a=[];return t.length>0&&a.push({key:`nameplate`,label:`Nameplate`,icon:(0,X.jsx)(V,{className:`size-3`}),members:t,accentClass:`text-muted-foreground`}),n.length>0&&a.push({key:`commands`,label:`Commands`,icon:(0,X.jsx)(oe,{className:`size-3`}),members:n,accentClass:`text-info`}),r.length>0&&a.push({key:`process`,label:`Process Tags`,icon:(0,X.jsx)(w,{className:`size-3`}),members:r,accentClass:`text-primary`}),i.length>0&&a.push({key:`health`,label:`Health & Status`,icon:(0,X.jsx)(ae,{className:`size-3`}),members:i,accentClass:`text-success`}),a}function ue({modelName:e,onClose:t}){let[n,l]=(0,Y.useState)(new Set([`nameplate`,`process`])),u=a({queryKey:K.catalog.modelSchema(e??``),queryFn:()=>i(`/catalog/models/${e}`,r.catalogModelDetail),enabled:e!==null}),d=u.data,f=u.isPending&&!d,p=u.isError,m=s(u.error,`Failed to load model.`);(0,Y.useEffect)(()=>{e&&l(new Set([`nameplate`,`process`]))},[e]);let h=(0,Y.useMemo)(()=>d?le(d.members):[],[d]),g=(0,Y.useCallback)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),_=D(),b=d?Object.keys(d.members).length:0,x=d?Object.keys(d.methods).length:0;return(0,X.jsx)(R,{open:e!==null,onOpenChange:e=>{e||(_.reset(),t())},children:(0,X.jsx)(B,{side:`right`,className:`flex w-full flex-col gap-4 touch-manipulation`,children:f?null:p&&!d?(0,X.jsx)(`div`,{className:`flex flex-1 flex-col justify-center px-2`,children:(0,X.jsx)(o,{message:m,onRetry:()=>void u.refetch(),isRetrying:u.isFetching})}):d?(0,X.jsxs)(c.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.18},className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,X.jsxs)(P,{className:`gap-1 pb-0 pe-12`,children:[(0,X.jsx)(z,{className:`font-heading text-base uppercase tracking-wide`,children:y(d.name)}),d.description&&(0,X.jsx)(I,{className:`text-xs leading-relaxed text-foreground/88`,children:d.description}),(0,X.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[b,` members`]}),(0,X.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[x,` methods`]}),(0,X.jsxs)(G,{variant:`outline`,className:`font-mono text-xs`,children:[d.faults.length,` faults`]}),d.lifecycle&&(0,X.jsxs)(G,{variant:`outline`,className:`font-mono text-xs text-primary`,children:[d.lifecycle.stages.length,`-stage lifecycle`]}),(0,X.jsx)(E,{stream:_})]})]}),(0,X.jsxs)(N,{defaultValue:`overview`,className:`flex min-h-0 flex-1 flex-col gap-1 pt-0`,children:[(0,X.jsxs)(M,{variant:`line`,className:`h-8! shrink-0 gap-0.5 border-b-border/60 px-2 py-0.5`,children:[(0,X.jsx)(A,{value:`overview`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Overview`}),(0,X.jsx)(A,{value:`deploy`,className:`min-h-10 px-2 py-1 text-xs text-foreground/82 after:bottom-[-3px] data-active:text-foreground sm:min-h-0 sm:px-2.5 sm:py-1`,children:`Deploy`})]}),(0,X.jsx)(j,{value:`overview`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5 pb-1 pt-0.5`,children:[h.map(e=>(0,X.jsx)(Z,{sectionKey:e.key,label:e.label,count:e.members.length,icon:e.icon,accentClass:e.accentClass,expanded:n.has(e.key),onToggle:g,children:(0,X.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.members.map(e=>(0,X.jsx)(de,{member:e},e.name))})},e.key)),d.faults.length>0&&(0,X.jsx)(Z,{sectionKey:`faults`,label:`Faults`,count:d.faults.length,icon:(0,X.jsx)(W,{className:`size-3`}),accentClass:`text-warning`,expanded:n.has(`faults`),onToggle:g,children:(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:d.faults.map(e=>(0,X.jsx)(G,{variant:`secondary`,className:`text-[10px] text-warning`,children:v(e)},e))})}),d.lifecycle&&(0,X.jsx)(Z,{sectionKey:`lifecycle`,label:`Lifecycle`,count:d.lifecycle.stages.length,icon:(0,X.jsx)(J,{className:`size-3`}),accentClass:`text-primary`,expanded:n.has(`lifecycle`),onToggle:g,children:(0,X.jsx)(fe,{lifecycle:d.lifecycle})}),x>0&&(0,X.jsx)(Z,{sectionKey:`methods`,label:`Methods`,count:x,icon:(0,X.jsx)(se,{className:`size-3`}),accentClass:`text-info`,expanded:n.has(`methods`),onToggle:g,children:(0,X.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:Object.entries(d.methods).map(([e,t])=>(0,X.jsx)(pe,{name:e,method:t},e))})})]})})})}),(0,X.jsx)(j,{value:`deploy`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,X.jsx)(H,{kind:`model`,id:d.name,displayName:y(d.name),yamlPath:`/catalog/models/${d.name}/yaml`,yamlFilename:`${d.name}.twin.yaml`,stream:_})})})]})]},d.name):(0,X.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Model not found`})})})}function Z({sectionKey:e,label:t,count:n,icon:r,accentClass:i,expanded:a,onToggle:o,children:s}){return(0,X.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50`,children:[(0,X.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left text-xs font-medium transition-colors hover:bg-muted/30`,onClick:()=>o(e),children:[(0,X.jsx)(`span`,{className:i,children:r}),(0,X.jsx)(`span`,{className:`uppercase tracking-wider`,children:t}),(0,X.jsx)(G,{variant:`secondary`,className:`ml-auto text-[10px]`,children:n}),(0,X.jsx)(k,{className:`size-3 text-muted-foreground transition-transform ${a?`rotate-180`:``}`})]}),(0,X.jsx)(l,{initial:!1,children:a&&(0,X.jsx)(c.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,X.jsx)(`div`,{className:`border-t px-2.5 py-1.5`,children:s})},`content`)})]})}function de({member:e}){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 py-0.5 text-xs`,children:[(0,X.jsx)(`span`,{title:e.name,className:`min-w-0 truncate font-mono text-foreground`,children:S(e.name)}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:e.dataType}),e.unit&&(0,X.jsx)(G,{variant:`outline`,className:`px-1 py-0 text-[10px]`,children:e.unit}),e.euRange&&(0,X.jsxs)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground`,children:[`[`,e.euRange[0],`–`,e.euRange[1],`]`]})]})}var Q={healthy:`bg-success`,normal:`bg-success`,degraded:`bg-warning`,critical:`bg-destructive`,failed:`bg-destructive`};function fe({lifecycle:e}){let t=e.stages.length;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(`div`,{className:`flex h-2.5 w-full overflow-hidden rounded-full bg-muted`,children:e.stages.map((e,n)=>(0,X.jsx)(`div`,{className:`transition-[background-color] ${Q[e]??`bg-chart-1`} ${n===0?`rounded-l-full`:``} ${n===t-1?`rounded-r-full`:``}`,style:{width:`${100/t}%`}},`${e}-${n}`))}),(0,X.jsx)(`div`,{className:`flex items-center gap-3`,children:e.stages.map((e,t)=>(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,X.jsx)(`span`,{className:`size-2 rounded-full ${Q[e]??`bg-chart-1`}`}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:v(e)})]},`${e}-${t}`))}),(0,X.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[`~`,b(e.totalHours),` total hours`]})]})}function pe({name:e,method:t}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:e}),t.inputArguments.length>0&&(0,X.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,t.inputArguments.map(e=>`${e.name}: ${e.dataType}`).join(`, `),`)`]})]}),t.description&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.description})]})}function me(){let[e,t]=(0,Y.useState)(``),[n,_]=(0,Y.useState)({}),[v,b]=(0,Y.useState)(null),[S,w]=(0,Y.useState)(null),[T,E]=(0,Y.useState)(null),D=(0,Y.useRef)(null),O=ie();(0,Y.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),D.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let k=a({queryKey:K.catalog.models(),queryFn:()=>i(`/catalog/models`,r.catalogModels)}),A=k.data??[],j=k.isPending&&!k.data,M=k.isError&&!k.data,N=k.isError&&!!k.data,P=s(k.error,`Failed to load models.`),I=e=>n[e]??1,L=(0,Y.useCallback)((e,t)=>{_(n=>({...n,[e]:Math.max(1,Math.min(10,t))}))},[]),R=(0,Y.useCallback)(e=>{E(e)},[]),z=(0,Y.useCallback)(e=>{w(e)},[]),B=async e=>{b(e);try{return await O.mutateAsync({type:`spawn`,model:e,count:I(e)}),!0}catch{return!1}finally{b(null)}},V=e?A.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||(t.description?.toLowerCase().includes(e.toLowerCase())??!1)):A;return(0,X.jsxs)(`div`,{className:`@container/models mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Asset Model Library`}),(0,X.jsx)(G,{variant:`outline`,className:`text-xs`,children:M?(0,X.jsx)(`span`,{className:`text-destructive`,children:`Unavailable`}):j&&A.length===0?(0,X.jsx)(X.Fragment,{children:`Loading...`}):(0,X.jsxs)(X.Fragment,{children:[A.length,` built-in`]})})]}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Canonical twin models with realistic physics, lifecycle degradation, and fault modes. Inspect to explore schema, copy YAML, or export.`})]}),M&&(0,X.jsx)(o,{message:P,onRetry:()=>void k.refetch(),isRetrying:k.isFetching}),N&&(0,X.jsx)(o,{message:`${P} Showing cached models.`,onRetry:()=>void k.refetch(),isRetrying:k.isFetching}),!M&&A.length>6&&(0,X.jsxs)(`div`,{className:`relative max-w-xs`,children:[(0,X.jsx)(F,{className:`absolute left-2.5 top-2.5 size-4 text-muted-foreground`}),(0,X.jsx)(C,{ref:D,placeholder:`Filter models...`,value:e,onChange:e=>t(e.target.value),className:`pl-9 pr-7`}),!e&&(0,X.jsx)(`kbd`,{className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded-[var(--miravo-radius-tight)] border border-border bg-muted px-1 font-mono text-[10px] text-muted-foreground`,children:`/`})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-4 @[720px]/models:grid-cols-2 @[1120px]/models:grid-cols-3`,"aria-busy":j&&!M,children:M?null:(0,X.jsxs)(X.Fragment,{children:[j&&A.length===0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`}),(0,X.jsx)(`div`,{className:`h-44 animate-pulse rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-card/30`})]}),(0,X.jsx)(l,{children:V.map((e,t)=>(0,X.jsx)(c.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.96,transition:{duration:.15}},transition:{type:`spring`,stiffness:380,damping:30,delay:t*.04},className:`grid`,children:(0,X.jsx)(he,{model:e,count:I(e.name),spawning:v===e.name,onCountChange:L,onInspect:R,onSpawn:z})},e.name))}),V.length===0&&A.length>0&&(0,X.jsxs)(`p`,{className:`col-span-full py-8 text-center text-sm text-muted-foreground`,children:[`No models match “`,e,`”`]})]})}),A.length>0&&(0,X.jsx)(`div`,{className:g(ne,`p-0`),children:(0,X.jsx)(`div`,{className:`community-teaser relative overflow-hidden rounded-[inherit]`,children:(0,X.jsx)(`div`,{className:`relative z-10 mx-auto max-w-3xl px-5 py-10 sm:px-10 sm:py-12`,children:(0,X.jsxs)(`div`,{className:`grid items-center gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,17rem)]`,children:[(0,X.jsxs)(`div`,{className:`order-2 flex min-w-0 flex-col gap-4 lg:order-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,X.jsx)(`p`,{className:`blueprint-title text-primary`,children:`Future channel`}),(0,X.jsx)(`span`,{className:`blueprint-stat text-[10px] text-muted-foreground`,children:`MIRAVO_REGISTRY · NOT_CONNECTED`})]}),(0,X.jsx)(`h2`,{className:`font-heading text-xl font-semibold tracking-tight sm:text-2xl`,children:`Community Models`}),(0,X.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:`Publish your custom twin models to the Miravo registry. Discover equipment models from other engineers, fork them, and adapt parameters for your use case.`}),(0,X.jsx)(`div`,{children:(0,X.jsx)(G,{variant:`outline`,className:`community-teaser-soon border-primary/35 bg-primary/5 text-[10px] text-primary`,children:`Coming Soon`})})]}),(0,X.jsx)(`div`,{className:`order-1 flex justify-center lg:order-2 lg:justify-end`,children:(0,X.jsxs)(`div`,{className:`community-teaser-module relative flex w-full max-w-[14rem] flex-col items-center justify-center gap-3 border border-primary/15 bg-muted/15 py-8 sm:max-w-[15.5rem] sm:py-10`,"aria-hidden":!0,children:[(0,X.jsx)(`div`,{className:`community-teaser-icon-ring relative z-[1] flex size-[4.25rem] items-center justify-center rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-gradient-to-br from-primary/18 to-primary/5`,children:(0,X.jsx)(ee,{className:`size-9 text-primary`,"aria-hidden":!0})}),(0,X.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] tracking-[0.18em] text-muted-foreground`,children:`AWAITING SIGNAL`}),(0,X.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] text-muted-foreground`,children:`Uplink idle`})]})})]})})})}),(0,X.jsx)(f,{open:S!==null,onOpenChange:e=>{e||w(null)},children:(0,X.jsxs)(m,{children:[(0,X.jsxs)(p,{children:[(0,X.jsx)(h,{children:`Spawn instances?`}),(0,X.jsx)(d,{children:S!==null&&(0,X.jsxs)(X.Fragment,{children:[`This spawns `,I(S),` instance`,I(S)===1?``:`s`,` of`,` `,(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:y(S)}),` `,`into the running environment.`]})})]}),(0,X.jsxs)(u,{children:[(0,X.jsx)(x,{variant:`outline`,disabled:v!==null,onClick:()=>w(null),children:`Cancel`}),(0,X.jsx)(x,{disabled:v!==null||S===null,onClick:async()=>{S!==null&&await B(S)&&w(null)},children:v===S?`Spawning...`:`Spawn`})]})]})}),(0,X.jsx)(ue,{modelName:T,onClose:()=>E(null)})]})}var he=(0,Y.memo)(function({model:e,count:t,spawning:n,onCountChange:r,onInspect:i,onSpawn:a}){return(0,X.jsxs)(`div`,{className:g(re,`flex flex-col gap-4 p-5`),children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,X.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] bg-primary/10 text-primary`,children:(0,X.jsx)(q,{className:`size-4`})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex flex-col gap-0.5`,children:[(0,X.jsx)(`span`,{className:`font-heading text-sm font-semibold uppercase tracking-wide`,children:y(e.name)}),e.description&&(0,X.jsx)(`span`,{className:`line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[11px] text-muted-foreground`,children:[(0,X.jsx)($,{label:`mbr`,value:e.memberCount}),(0,X.jsx)($,{label:`mth`,value:e.methodCount}),(0,X.jsx)($,{label:`flt`,value:e.faultCount}),e.hasLifecycle&&(0,X.jsxs)(`span`,{className:`flex items-center gap-1 text-primary`,children:[(0,X.jsx)(`span`,{className:`text-[10px]`,children:`◈`}),(0,X.jsxs)(`span`,{children:[e.lifecycleStageCount,`-stage`]})]}),(0,X.jsx)(G,{variant:`secondary`,className:`ml-auto shrink-0 font-sans text-[10px] font-medium`,children:e.source})]}),(0,X.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 border-t border-border/30 pt-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center rounded-[var(--miravo-radius-tight)] border bg-muted/30`,children:[(0,X.jsx)(x,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-l-md`,disabled:t<=1,"aria-label":`Decrease count`,onClick:n=>{n.stopPropagation(),r(e.name,t-1)},children:(0,X.jsx)(L,{className:`size-3`})}),(0,X.jsx)(`span`,{className:`flex size-7 items-center justify-center border-x font-mono text-xs`,children:t}),(0,X.jsx)(x,{variant:`ghost`,size:`icon`,className:`size-7 rounded-none rounded-r-md`,disabled:t>=10,"aria-label":`Increase count`,onClick:n=>{n.stopPropagation(),r(e.name,t+1)},children:(0,X.jsx)(T,{className:`size-3`})})]}),(0,X.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e.name),className:te,children:[(0,X.jsx)(O,{className:`size-3.5`,"aria-hidden":!0}),`Inspect`]}),(0,X.jsxs)(x,{size:`sm`,className:`ml-auto`,disabled:n,onClick:()=>a(e.name),children:[(0,X.jsx)(U,{className:`mr-1 size-3`}),n?`...`:`Spawn`]})]})]})});function $({label:e,value:t}){return(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`text-foreground`,children:t}),` `,(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:e})]})}export{q as n,me as t};
@@ -1 +0,0 @@
1
- import{at as e}from"./vendor-ui-mizMYESS.js";import{n as t,s as n}from"./chunk-OE4NN4TA-m2UhO8Q2.js";import{t as r}from"./createLucideIcon-Yddw9eHa.js";import{t as i}from"./triangle-alert-DPtblpQC.js";import{n as a}from"./auth-screen-backdrop-OrOL41MR.js";var o=r(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),s=r(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),c=e();function l(){let e=n();return(0,c.jsx)(a,{className:`min-h-full px-6 py-8 md:px-8`,children:(0,c.jsx)(`div`,{className:`mx-auto flex min-h-[calc(100svh-9rem)] max-w-3xl items-center justify-center`,children:(0,c.jsx)(`section`,{className:`relative w-full overflow-hidden rounded-[var(--miravo-radius-stadium-lg)] border border-primary/20 bg-transparent p-8 md:p-10`,children:(0,c.jsxs)(`div`,{className:`relative space-y-8`,children:[(0,c.jsxs)(`div`,{className:`space-y-4`,children:[(0,c.jsx)(`p`,{className:`font-mono text-xs uppercase tracking-[0.4em] text-muted-foreground`,children:`Fault code 404`}),(0,c.jsxs)(`div`,{className:`flex items-end gap-4`,children:[(0,c.jsx)(`span`,{className:`font-heading text-7xl font-black leading-none tracking-[-0.08em] text-transparent [-webkit-text-stroke:1px_color-mix(in_srgb,var(--primary)_55%,transparent)] md:text-9xl`,children:`404`}),(0,c.jsx)(`div`,{className:`mb-2 h-px flex-1 bg-linear-to-r from-primary/60 to-transparent`})]}),(0,c.jsxs)(`div`,{className:`max-w-2xl space-y-3`,children:[(0,c.jsx)(`h1`,{className:`text-4xl font-semibold tracking-[-0.04em] text-foreground md:text-5xl`,children:`Route not found in the control surface`}),(0,c.jsx)(`p`,{className:`max-w-xl text-base text-muted-foreground md:text-lg`,children:`This address does not map to an active console view.`})]})]}),(0,c.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-stadium-sm)] border border-border/80 bg-background/55 p-5 backdrop-blur-sm`,children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 font-mono text-[0.7rem] uppercase tracking-[0.28em] text-muted-foreground`,children:[(0,c.jsx)(i,{className:`size-3.5 text-primary`}),`Requested path`]}),(0,c.jsx)(`code`,{className:`block overflow-x-auto rounded-[var(--miravo-radius-stadium-sm)] border border-primary/15 bg-background/30 px-4 py-3 font-mono text-sm text-primary`,children:e.pathname})]}),(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,c.jsxs)(t,{to:`/`,className:`inline-flex items-center gap-2 rounded-[var(--miravo-radius-pill)] border border-foreground/15 bg-foreground px-4 py-2.5 font-medium text-background transition hover:bg-foreground/90`,children:[(0,c.jsx)(s,{className:`size-4`}),`Return to Fleet`]}),(0,c.jsxs)(t,{to:`/catalog`,className:`group inline-flex items-center gap-3 rounded-[var(--miravo-radius-pill)] border border-foreground/8 bg-background/20 px-3 py-2.5 text-foreground shadow-[inset_0_1px_0_color-mix(in_srgb,var(--foreground)_4%,transparent)] backdrop-blur-sm transition hover:border-primary/30 hover:bg-primary/8 hover:text-primary`,children:[(0,c.jsx)(`span`,{className:`inline-flex size-8 items-center justify-center rounded-[var(--miravo-radius-tight)] border border-foreground/8 bg-foreground/4 text-muted-foreground transition group-hover:border-primary/25 group-hover:bg-primary/12 group-hover:text-primary`,children:(0,c.jsx)(o,{className:`size-4`})}),(0,c.jsx)(`span`,{className:`font-medium tracking-[-0.01em]`,children:`Open Catalog`})]})]})]})})})})}export{l as NotFoundPage};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-Yddw9eHa.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),n=[{id:`litmus-edge`,label:`Litmus Edge`,exportLabel:`Litmus Edge Digital Twin`,shortCode:`LE`,status:`available`},{id:`azure-dtdl`,label:`Azure Digital Twins (DTDL)`,exportLabel:`Azure Digital Twins (DTDL)`,shortCode:`AZ`,status:`coming-soon`},{id:`aws-sitewise`,label:`AWS IoT SiteWise`,exportLabel:`AWS IoT SiteWise`,shortCode:`AWS`,status:`coming-soon`},{id:`ignition-udt`,label:`Ignition UDT`,exportLabel:`Ignition UDT`,shortCode:`IGN`,status:`coming-soon`}],r=n.filter(e=>e.status===`available`),i=n.filter(e=>e.status===`coming-soon`),a=r[0]??n[0];export{t as a,n as i,i as n,a as r,r as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./platforms-DjGsPZpq.js";export{e as PlatformsPage};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-mizMYESS.js";import{F as r,I as i,L as a,_ as o,a as s,g as c}from"./api-BjnU1LXi.js";import{a as l,i as u,l as d,n as f,o as p,t as m}from"./get-error-message-BzBOywwk.js";import{t as h}from"./proxy-CgM57W61.js";import{t as g}from"./AnimatePresence-CVhkybDC.js";import{i as _,r as v}from"./dist-jROhexoH.js";import{n as y}from"./chunk-OE4NN4TA-m2UhO8Q2.js";import{a as b,i as x,l as S,n as C,o as ee,r as te,s as w,t as T}from"./copy-button-DYqJP5N8.js";import{n as E,t as D}from"./createLucideIcon-Yddw9eHa.js";import{i as O,n as k,t as ne}from"./tooltip-TtanriwA.js";import{a as A,b as j,f as M,g as re,n as N,r as P}from"./input-BCiRHEmc.js";import{t as F}from"./activity-DP0Us3HU.js";import{t as ie}from"./arrow-right-DrKCU9WM.js";import{C as ae,S as I,_ as oe,a as se,c as ce,d as le,f as ue,h as de,i as fe,l as pe,m as me,n as he,o as ge,p as _e,r as ve,s as ye,t as be,u as xe,v as Se,x as Ce,y as we}from"./use-platform-stream-ScJV0xv8.js";import{n as Te,t as Ee}from"./catalog-template-icons-b6a6Gty-.js";import{c as L,i as R,l as De,n as z,s as B,t as V}from"./select-4wihIkEE.js";import{a as Oe,i as ke,r as H}from"./platform-targets-BbVxaqAc.js";import{c as U,i as W,n as G,o as Ae,r as je,s as Me,t as Ne}from"./tabs-BgPF8MSY.js";import{n as Pe,r as Fe,t as Ie}from"./checkbox-Xly18Uyz.js";import{n as Le,t as K}from"./server-D7sb2mj5.js";import{t as Re}from"./triangle-alert-DPtblpQC.js";import{t as ze}from"./badge-tnWgSITj.js";import{t as q}from"./skeleton-C6iEH-9E.js";import{t as J}from"./query-keys-Co1J4HmV.js";import{t as Be}from"./label-xIWEC6lW.js";var Ve=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:a()})}getOptimisticResult(e){return e.behavior=a(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,a=super.createResult(e,t),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=n.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:r(t,n.data),hasPreviousPage:i(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function He(e,t){return p(e,Ve,t)}var Ue=D(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),We=D(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Ge=D(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ke=D(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Y=e(t(),1),X=n(),qe=`rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/55 bg-muted/10`;function Je(){return(0,X.jsx)(`p`,{className:`mt-2 text-pretty text-sm leading-relaxed text-muted-foreground`,children:`Add a target to get started.`})}function Ye({onClick:e}){return(0,X.jsxs)(N,{type:`button`,size:`sm`,className:`h-7 shrink-0 gap-1.5 text-xs`,onClick:e,children:[(0,X.jsx)(ae,{className:`size-3.5`,"aria-hidden":!0}),`Add Target`]})}function Xe({titleId:e,frameIcon:t,description:n,children:r}){return(0,X.jsx)(`section`,{"aria-labelledby":e,className:qe,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-4 py-10 text-center`,children:[(0,X.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/50`,children:t}),(0,X.jsxs)(`div`,{className:`max-w-sm`,children:[(0,X.jsx)(`h2`,{id:e,className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`No targets yet`}),n]}),r]})})}function Ze({stream:e,onReset:t,catalogTemplates:n}){let[r,i]=(0,Y.useState)(!1),a=e.operation?.operationId;if((0,Y.useEffect)(()=>{i(!1)},[a]),!e.operation&&e.status!==`running`)return null;let{title:o,subtitle:s}=fe(e),c=e.status===`complete`,l=e.status===`error`,u=e.status===`running`,d=c||l;async function f(){i(!0);try{await e.cancel()}catch{i(!1)}}return(0,X.jsx)(me,{title:o,subtitle:s,footerAction:u&&e.operation?.operationId?(0,X.jsx)(`div`,{className:`ml-auto shrink-0`,children:(0,X.jsx)(`button`,{type:`button`,onClick:f,disabled:r,"aria-busy":r,className:E(P({variant:`outline`,size:`sm`}),`group h-8 gap-1.5 px-3 text-xs`,r?`cursor-not-allowed`:`hover:bg-destructive/12 hover:text-destructive hover:border-destructive/35`),children:r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ae,{className:`size-3.5 shrink-0 animate-spin text-muted-foreground`,"aria-hidden":!0}),(0,X.jsx)(h.span,{animate:{opacity:[1,.72,1]},transition:{duration:1.25,repeat:1/0,ease:`easeInOut`},className:`font-medium text-foreground`,children:`Cancelling…`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{className:`size-3.5 shrink-0 text-foreground/65 group-hover:text-destructive`,"aria-hidden":!0}),(0,X.jsx)(h.span,{animate:{opacity:[1,.88,1]},transition:{duration:2.2,repeat:1/0,ease:`easeInOut`},children:`Cancel`})]})})}):d?(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 w-full flex-1 flex-wrap items-center justify-between gap-x-3 gap-y-1`,children:[(0,X.jsxs)(y,{to:`/platforms?tab=activity`,className:E(P({variant:`ghost`,size:`xs`}),`group inline-flex h-6 shrink-0 items-center gap-1.5 px-2 text-[11px] font-medium text-foreground/80`,`hover:bg-primary/12 hover:text-primary`),children:[(0,X.jsx)(F,{className:`size-3 shrink-0 text-foreground/70 group-hover:text-primary`,"aria-hidden":!0}),`View full activity`,(0,X.jsx)(Oe,{className:`size-2.5 shrink-0 text-foreground/50 group-hover:text-primary`,"aria-hidden":!0})]}),(0,X.jsx)(`div`,{className:`flex shrink-0 items-center`,children:(0,X.jsx)(N,{type:`button`,variant:`secondary`,size:`xs`,className:`h-6 px-2.5 text-[11px] font-medium`,onClick:t,children:`Close`})})]}),e.operation?.status===`cancelled`||l&&e.operation?(0,X.jsx)(Se,{type:e.operation.type,errorMessage:e.operation.error,className:`mt-2.5 w-full min-w-0`}):null]}):void 0,onDismiss:t,children:e.operation?(0,X.jsx)(oe,{operation:e.operation,catalogTemplates:n}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 py-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Ae,{className:`size-3.5 animate-spin text-primary`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-xs text-foreground/78`,children:`Connecting to Litmus Edge…`})]}),(0,X.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-muted/55`,children:(0,X.jsx)(h.div,{className:`h-full w-2/5 rounded-full bg-primary`,animate:{x:[`-100%`,`250%`]},transition:{duration:1.2,repeat:1/0,ease:`easeInOut`}})})]})})}function Qe(e){return e.map(e=>e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join(`, `)}function $e({onCloseTable:e,planKind:t=`apply`}){return(0,X.jsx)(`div`,{className:`border-b border-border/40 px-3 py-3 sm:px-4`,children:(0,X.jsxs)(`div`,{className:`flex gap-3`,children:[(0,X.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 bg-muted/15`,children:(0,X.jsx)(Ue,{className:`size-4 text-muted-foreground`,"aria-hidden":!0})}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-1 pt-0.5 sm:gap-2`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,X.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.14em] text-foreground`,children:t===`cleanup`?`Expected removals`:`Expected changes`}),(0,X.jsx)(`span`,{className:`rounded-[var(--miravo-radius-tight)] border border-primary/25 bg-primary/5 px-1.5 py-px font-mono text-[9px] uppercase tracking-wider text-primary/90`,children:`Draft`})]}),(0,X.jsx)(`p`,{className:`mt-1.5 max-w-prose text-[10px] leading-relaxed text-muted-foreground`,children:t===`cleanup`?`Preview only — nothing runs until you confirm cleanup.`:`Preview only — nothing runs until you confirm deploy.`})]}),e&&(0,X.jsx)(N,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 text-muted-foreground hover:text-foreground`,onClick:e,"aria-label":`Close table`,children:(0,X.jsx)(A,{className:`size-4`,"aria-hidden":!0})})]})]})})}var et={create:`border-success/30 bg-success/12 text-success`,update:`border-info/30 bg-info/12 text-info`,replace:`border-chart-2/30 bg-chart-2/12 text-chart-2`,delete:`border-destructive/30 bg-destructive/12 text-destructive`,blocked:`border-warning/30 bg-warning/12 text-warning`};function tt({plan:e,planKind:t}){let n=t===`apply`&&e.sourceHostname!=null&&e.sourceHostname!==``;return(0,X.jsx)(`div`,{className:`border-b border-border/35 bg-muted/10 px-3 py-2 sm:px-4`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-[10px] leading-snug sm:flex-row sm:flex-wrap sm:items-baseline sm:gap-x-4 sm:gap-y-1`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/85`,children:`Target LE`}),(0,X.jsx)(`span`,{className:`font-mono text-foreground/90 wrap-anywhere`,children:e.targetHost})]}),n?(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5 sm:border-l sm:border-border/50 sm:pl-4`,children:[(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/85`,children:Ce}),(0,X.jsx)(`span`,{className:`font-mono text-foreground/90 wrap-anywhere`,children:e.sourceHostname})]}):null]})})}function nt({entries:e}){let t=e.reduce((e,t)=>(e[t.action]++,e),{create:0,update:0,replace:0,delete:0,blocked:0});return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/35 px-3 py-2.5 sm:px-4`,children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`Summary of planned actions`}),(0,X.jsx)(`span`,{className:`font-mono text-[9px] uppercase tracking-[0.18em] text-muted-foreground`,children:`Manifest`}),(0,X.jsx)(`span`,{className:`hidden h-3 w-px bg-border/60 sm:block`,"aria-hidden":!0}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[t.create>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-success/25 bg-success/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-success`,children:[`+`,t.create,` new`]}),t.update>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-info/25 bg-info/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-info`,children:[`~`,t.update,` update`]}),t.replace>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-chart-2/25 bg-chart-2/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-chart-2`,children:[`↺`,t.replace,` replace`]}),t.delete>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-destructive/25 bg-destructive/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-destructive`,children:[`−`,t.delete,` remove`]}),t.blocked>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-warning/25 bg-warning/10 px-2 py-0.5 font-mono text-[10px] tabular-nums text-warning`,children:[t.blocked,` skipped`]})]})]})}function rt({plan:e,onCloseTable:t,planKind:n=`apply`}){return e.entries.length===0?(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border/55`,children:[(0,X.jsx)($e,{onCloseTable:t,planKind:n}),(0,X.jsx)(tt,{plan:e,planKind:n}),(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-3 px-4 py-10 text-center`,children:[(0,X.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/50`,children:(0,X.jsx)(Ue,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:n===`cleanup`?`Nothing to remove`:`Nothing to change`}),(0,X.jsx)(`p`,{className:`mx-auto mt-2 max-w-sm text-[11px] leading-relaxed text-muted-foreground`,children:n===`cleanup`?`No Miravo-managed resources matched this cleanup scope on the environment — nothing would be deleted.`:`This environment already matches what is on the target — no create or update steps.`})]})]})]}):(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/45`,children:[(0,X.jsx)($e,{onCloseTable:t,planKind:n}),(0,X.jsx)(tt,{plan:e,planKind:n}),(0,X.jsx)(nt,{entries:e.entries}),(0,X.jsx)(`div`,{className:`overflow-x-auto`,children:(0,X.jsxs)(`table`,{className:`w-full min-w-lg text-xs`,children:[(0,X.jsx)(`caption`,{className:`sr-only`,children:n===`cleanup`?`Detailed list of planned cleanup actions in deletion order`:`Detailed list of create, update, and delete actions in deployment order`}),(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`border-b border-border/45`,children:[(0,X.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:px-3.5`,children:`Action`}),(0,X.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:px-3.5`,children:`Type`}),(0,X.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:px-3.5`,children:`Name`}),(0,X.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground sm:table-cell sm:px-3.5`,children:`Protocol`}),(0,X.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left font-heading text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground md:table-cell md:px-3.5`,children:`Detail`})]})}),(0,X.jsx)(`tbody`,{children:e.entries.map((e,t)=>(0,X.jsxs)(`tr`,{className:E(`border-b border-border/25 transition-colors`,t%2==1?`bg-muted/35`:`bg-transparent`,`hover:bg-primary/4`),children:[(0,X.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,X.jsx)(ze,{variant:`outline`,className:E(`border px-1.5 py-0 font-mono text-[10px] uppercase tracking-wide`,et[e.action]),children:e.action})}),(0,X.jsx)(`td`,{className:`px-3 py-2 align-middle font-mono text-[11px] text-foreground sm:px-3.5`,children:e.resourceType}),(0,X.jsx)(`td`,{className:`max-w-[min(16rem,28vw)] truncate px-3 py-2 align-middle font-mono text-[11px] text-foreground sm:max-w-xs sm:px-3.5`,children:e.name}),(0,X.jsx)(`td`,{className:`hidden px-3 py-2 align-middle font-mono text-[11px] text-muted-foreground sm:table-cell sm:px-3.5`,children:e.protocol??`—`}),(0,X.jsx)(`td`,{className:`hidden max-w-xs truncate px-3 py-2 align-middle text-[11px] text-muted-foreground md:table-cell md:px-3.5`,children:e.blockReason??e.detail??`—`})]},`${e.action}-${e.resourceType}-${e.name}-${e.protocol??``}-${e.detail??e.blockReason??``}`))})]})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border/40 px-3 py-3 text-[10px] text-muted-foreground sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-4`,children:[(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`font-mono tabular-nums text-foreground/90`,children:e.entries.length}),` `,(0,X.jsxs)(`span`,{className:`text-muted-foreground/90`,children:[e.entries.length===1?`action`:`actions`,` queued`]})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[10px] wrap-anywhere`,children:[(0,X.jsx)(`span`,{className:`shrink-0 text-[9px] uppercase tracking-wider text-muted-foreground/80`,children:`Scope`}),(0,X.jsx)(`span`,{className:`min-w-0 text-foreground/90`,children:Qe(e.scope)})]})]})]})}var it=[`s1`,`s2`,`s3`,`s4`];function at(){return(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/45`,role:`status`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`Loading plan preview`}),(0,X.jsx)(`div`,{className:`border-b border-border/40 px-3 py-3 sm:px-4`,children:(0,X.jsxs)(`div`,{className:`flex gap-3`,children:[(0,X.jsx)(q,{className:`size-10 shrink-0 rounded-[var(--miravo-radius-stadium-sm)]`}),(0,X.jsx)(`div`,{className:`flex min-w-0 flex-1 items-start gap-1 pt-0.5 sm:gap-2`,children:(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,X.jsx)(q,{className:`h-3.5 w-40`}),(0,X.jsx)(q,{className:`h-4 w-11 rounded-[var(--miravo-radius-tight)] border`})]}),(0,X.jsx)(q,{className:`mt-1.5 h-3 max-w-prose`})]})})]})}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-border/35 px-3 py-2.5 sm:px-4`,children:[(0,X.jsx)(q,{className:`h-2.5 w-14`}),(0,X.jsx)(q,{className:`hidden h-3 w-px shrink-0 sm:block`}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[(0,X.jsx)(q,{className:`h-5 w-18 rounded-[var(--miravo-radius-tight)]`}),(0,X.jsx)(q,{className:`h-5 w-24 rounded-[var(--miravo-radius-tight)]`}),(0,X.jsx)(q,{className:`h-5 w-20 rounded-[var(--miravo-radius-tight)]`})]})]}),(0,X.jsx)(`div`,{className:`overflow-x-auto`,children:(0,X.jsxs)(`table`,{className:`w-full min-w-lg text-xs`,"aria-hidden":!0,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`border-b border-border/45`,children:[(0,X.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,X.jsx)(q,{className:`h-2.5 w-12`})}),(0,X.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,X.jsx)(q,{className:`h-2.5 w-9`})}),(0,X.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,X.jsx)(q,{className:`h-2.5 w-10`})}),(0,X.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left sm:table-cell sm:px-3.5`,children:(0,X.jsx)(q,{className:`h-2.5 w-14`})}),(0,X.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 hidden bg-background px-3 py-2 text-left md:table-cell md:px-3.5`,children:(0,X.jsx)(q,{className:`h-2.5 w-11`})})]})}),(0,X.jsx)(`tbody`,{children:it.map((e,t)=>(0,X.jsxs)(`tr`,{className:E(`border-b border-border/25 transition-colors`,t%2==1?`bg-muted/35`:`bg-transparent`,`hover:bg-primary/4`),children:[(0,X.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,X.jsx)(q,{className:`h-5 w-13 rounded-[var(--miravo-radius-tight)]`})}),(0,X.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,X.jsx)(q,{className:`h-3.5 w-16 font-mono`})}),(0,X.jsx)(`td`,{className:`max-w-[min(16rem,28vw)] px-3 py-2 align-middle sm:max-w-xs sm:px-3.5`,children:(0,X.jsx)(q,{className:`h-3.5 w-full max-w-48 font-mono`})}),(0,X.jsx)(`td`,{className:`hidden px-3 py-2 align-middle sm:table-cell sm:px-3.5`,children:(0,X.jsx)(q,{className:`h-3.5 w-10 font-mono`})}),(0,X.jsx)(`td`,{className:`hidden max-w-xs px-3 py-2 align-middle md:table-cell md:px-3.5`,children:(0,X.jsx)(q,{className:`h-3.5 w-full max-w-40`})})]},e))})]})}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border/40 px-3 py-3 text-[10px] text-muted-foreground sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:px-4`,children:[(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,X.jsx)(q,{className:`inline-block h-3 w-6 rounded-[var(--miravo-radius-tight)]`}),(0,X.jsx)(q,{className:`inline-block h-3 w-28`})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[10px] wrap-anywhere`,children:[(0,X.jsx)(q,{className:`h-2.5 w-8 shrink-0`}),(0,X.jsx)(q,{className:`h-6 min-w-32 rounded-[var(--miravo-radius-tight)] border border-border/50 px-2 py-0.5`}),(0,X.jsx)(q,{className:`h-1 w-1 shrink-0 rounded-full`}),(0,X.jsx)(q,{className:`h-2.5 w-10 shrink-0`}),(0,X.jsx)(q,{className:`h-3 min-w-16 max-w-56 flex-1`})]})]})]})}function ot(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}function st({targets:e,stream:t}){let[n,r]=(0,Y.useState)(`apply`),[i,a]=(0,Y.useState)(``),[c,u]=(0,Y.useState)(``),[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(!1),[v,y]=(0,Y.useState)(!1),b=(0,Y.useRef)(0),x=(0,Y.useRef)(null),C=t.status===`running`,ee=l({queryKey:J.catalog.templates(),queryFn:()=>s(`/catalog/templates`,o.catalogTemplates)}),te=n===`apply`?!!i&&!!c:!!i&&(d||!!c),w=e.find(e=>e.id===i),T=(0,Y.useCallback)(()=>{b.current+=1,x.current?.abort(),x.current=null,_(!1),m(null)},[]),D=(0,Y.useCallback)(()=>{T(),S.message(`Preview cancelled`)},[T]),O=e=>{C||(r(e),T(),f(!1))},k=(0,Y.useCallback)(async e=>{if(e===`apply`){if(!i||!c)return}else if(!i||!d&&!c)return;t.operation&&t.status!==`running`&&t.reset(),x.current?.abort(),b.current+=1;let n=b.current,r=new AbortController;x.current=r,_(!0),m(null);try{let t=e===`apply`?await xe({targetId:i,template:c},{signal:r.signal}):await pe({targetId:i,...d?{allManaged:!0}:{template:c}},{signal:r.signal});if(n!==b.current)return;m(t.plan)}catch(t){if(n!==b.current||ot(t))return;S.error(t instanceof Error?t.message:e===`apply`?`Plan failed`:`Cleanup plan failed`)}finally{n===b.current&&_(!1)}},[i,c,d,t]),ne=(0,Y.useCallback)(e=>{y(!1),T();let{scope:r,ifUnmanaged:a}=e;n===`apply`?t.startApply({targetId:i,template:c,scope:r,ifUnmanaged:a}):t.startCleanup({targetId:i,...d?{allManaged:!0}:{template:c},scope:r})},[n,i,c,d,t,T]),j=n===`apply`,M=ee.data??[],re=M.find(e=>e.id===c)?.name??c,P=te&&!C,F=`Provisions devices, tags, and Digital Twin models from the selected environment on the selected target.`;return j||(F=d?`Removes all Miravo-managed resources from the target (ignores environment scope).`:`Removes Miravo-managed resources for this environment from the selected target.`),(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,X.jsxs)(`div`,{role:`toolbar`,"aria-label":`Operation mode`,className:`inline-flex items-center gap-0.5 rounded-[var(--miravo-radius-pill)] border border-border/50 bg-muted/15 p-0.5`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":j,className:E(`relative flex items-center gap-1.5 rounded-[var(--miravo-radius-pill)] px-4 py-1.5 text-xs font-medium transition-colors`,j?`text-primary`:`text-muted-foreground hover:text-foreground`),onClick:()=>O(`apply`),disabled:C,children:[j&&(0,X.jsx)(h.span,{layoutId:`mode-pill`,className:`absolute inset-0 rounded-[var(--miravo-radius-pill)] bg-primary/15 shadow-sm`,transition:{type:`spring`,stiffness:500,damping:40}}),(0,X.jsx)(Ke,{className:`relative z-10 size-3.5`}),(0,X.jsx)(`span`,{className:`relative z-10`,children:`Apply`})]}),(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":!j,className:E(`relative flex items-center gap-1.5 rounded-[var(--miravo-radius-pill)] px-4 py-1.5 text-xs font-medium transition-colors`,j?`text-muted-foreground hover:text-foreground`:`text-destructive`),onClick:()=>O(`cleanup`),disabled:C,children:[!j&&(0,X.jsx)(h.span,{layoutId:`mode-pill`,className:`absolute inset-0 rounded-[var(--miravo-radius-pill)] bg-destructive/15 shadow-sm`,transition:{type:`spring`,stiffness:500,damping:40}}),(0,X.jsx)(I,{className:`relative z-10 size-3.5`}),(0,X.jsx)(`span`,{className:`relative z-10`,children:`Cleanup`})]})]}),(0,X.jsx)(he,{stream:t})]}),(0,X.jsx)(de,{children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-border/25 pb-3`,children:[(0,X.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-primary/25 bg-primary/9 shadow-[inset_0_1px_0_0_var(--miravo-inset-highlight)]`,children:(0,X.jsx)(Le,{className:`size-4 text-primary`,"aria-hidden":!0})}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.12em] text-foreground`,children:`Litmus Edge`}),(0,X.jsx)(`p`,{className:`mt-0.5 text-[11px] leading-relaxed text-muted-foreground`,children:F})]})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(Be,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Target`}),(0,X.jsx)(ue,{targets:e,value:i,onValueChange:e=>{a(e),T()},disabled:C,size:`sm`,className:`min-w-0 w-full text-xs`})]}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(Be,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground`,children:`Environment`}),(0,X.jsxs)(V,{value:c,onValueChange:e=>{e&&(u(e),T(),j&&t.reset())},disabled:n===`cleanup`&&d||C,children:[(0,X.jsx)(B,{size:`sm`,className:`min-w-0 w-full text-xs h-9! min-h-9 py-0`,"aria-label":`Environment`,children:(0,X.jsx)(L,{placeholder:d?`All managed`:`Select environment`,children:e=>n===`cleanup`&&d?`All managed resources`:M.find(t=>t.id===e)?.name??(d?`All managed`:`Select environment`)})}),(0,X.jsx)(z,{className:`max-h-48 w-(--anchor-width) min-w-0 p-1`,children:M.map(e=>(0,X.jsx)(R,{value:e.id,className:`h-9 gap-1.5 rounded-[var(--miravo-radius-tight)] py-0 pr-7 pl-1.5 text-xs leading-tight`,children:(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] border border-border/35 bg-muted/25 text-primary`,children:(0,X.jsx)(Ee,{id:e.id,className:`size-3.5`})}),(0,X.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name})]})},e.id))})]})]})]}),(0,X.jsxs)(`button`,{type:`button`,disabled:!P,onClick:()=>y(!0),className:E(`group flex w-full min-h-14 min-w-0 items-stretch overflow-hidden rounded-[var(--miravo-radius-stadium-lg)] text-left outline-none`,`transition-[border-color,box-shadow,background-color] duration-200 ease-out`,`focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`disabled:pointer-events-none disabled:opacity-55`,P?[`border-2 border-primary/40 bg-background`,`bg-linear-to-r from-primary/12 via-background to-background`,`shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025)]`,`hover:border-primary/56 hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.025),0_0_14px_-8px_color-mix(in_srgb,var(--primary)_18%,transparent),0_0_22px_-12px_color-mix(in_srgb,var(--primary)_8%,transparent)]`]:[`border border-dashed border-border/65 bg-muted/15`,`hover:bg-muted/22`]),children:[(0,X.jsx)(`span`,{className:`relative flex w-18 shrink-0 items-center justify-center bg-transparent`,"aria-hidden":!0,children:j?(0,X.jsx)(Pe,{className:E(`relative size-5`,P?`text-primary`:`text-muted-foreground`)}):(0,X.jsx)(I,{className:E(`relative size-5`,P?`text-primary`:`text-muted-foreground`)})}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-0.5 overflow-hidden px-3 py-2.5 sm:px-4`,children:[(0,X.jsx)(`span`,{className:E(`font-heading text-[11px] font-semibold uppercase tracking-[0.18em]`,P?`text-primary`:`text-muted-foreground`),children:P?j?`Commit deploy`:`Commit cleanup`:`Awaiting selection`}),(0,X.jsx)(`span`,{className:E(`truncate font-mono text-[13px] leading-tight tracking-tight`,P?`text-foreground`:`text-muted-foreground`),children:w?.label??`Select target and environment`})]}),(0,X.jsx)(`span`,{className:E(`flex shrink-0 items-center pr-2.5 sm:pr-3`,P&&`pl-1`),children:(0,X.jsx)(`span`,{className:E(`flex size-9 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border bg-transparent transition-[border-color,color] duration-200`,P?`border-primary/40 text-primary group-hover:border-primary/55`:`border-border/45 text-muted-foreground`),"aria-hidden":!0,children:(0,X.jsx)(Oe,{className:`size-4`,strokeWidth:2.25})})})]}),!j&&(0,X.jsx)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-end gap-2`,children:(0,X.jsxs)(Be,{id:`all-managed-label`,htmlFor:`all-managed`,"aria-disabled":C,className:E(`inline-flex h-8 w-fit max-w-full cursor-pointer items-center gap-2 text-xs font-medium leading-none`,C&&`pointer-events-none opacity-40`),children:[(0,X.jsx)(Ie,{id:`all-managed`,checked:d,onCheckedChange:e=>f(e===!0),disabled:C}),(0,X.jsx)(`span`,{className:`shrink-0`,children:`Remove all Miravo managed resources`})]})})]})}),(g||p)&&!C&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[g&&(0,X.jsx)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center justify-end gap-2`,children:(0,X.jsxs)(N,{type:`button`,variant:`ghost`,size:`sm`,className:`h-8 shrink-0 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:D,children:[(0,X.jsx)(A,{className:`size-3.5`,"aria-hidden":!0}),`Cancel preview`]})}),g&&(0,X.jsx)(at,{}),p&&!g&&(0,X.jsx)(rt,{plan:p,planKind:j?`apply`:`cleanup`,onCloseTable:T})]}),w&&(0,X.jsx)(we,{open:v,onOpenChange:y,type:n,label:!j&&d?`All managed resources`:re,targetLabel:w.label,hostname:w.hostname,sourceHostname:w.sourceHostname,onConfirm:ne,applyPreview:j?{onPreview:()=>void k(`apply`),planLoading:g,disabled:!i||!c||C}:void 0,cleanupPreview:j?void 0:{onPreview:()=>void k(`cleanup`),planLoading:g,disabled:!i||!d&&!c||C}})]})}function ct(){return(0,X.jsx)(`section`,{"aria-labelledby":`platforms-operation-log-empty-title`,className:qe,children:(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-4 py-8 text-center sm:py-10`,children:[(0,X.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-(--miravo-radius-stadium-sm) border border-dashed border-border/50`,children:(0,X.jsx)(F,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0})}),(0,X.jsxs)(`div`,{className:`max-w-sm`,children:[(0,X.jsx)(`h2`,{id:`platforms-operation-log-empty-title`,className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`No operations yet`}),(0,X.jsx)(`p`,{className:`mt-2 text-pretty text-sm leading-relaxed text-muted-foreground`,children:`Run apply or cleanup from the Operations tab. Finished runs show up here with full detail.`})]})]})})}function lt(e){let t=new Date(e),n=new Date,r=new Date(n);return r.setDate(n.getDate()-1),t.toDateString()===n.toDateString()?`Today`:t.toDateString()===r.toDateString()?`Yesterday`:t.toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`})}function ut(e){let t=new Map;for(let n of e){let e=new Date(n.completedAt).toDateString(),r=t.get(e);r?r.push(n):t.set(e,[n])}return Array.from(t.entries()).map(([,e])=>({label:lt(e[0]?.completedAt??Date.now()),ops:e}))}function Z(e,t){return e===`device`?t.operationType===`apply`?`Tag/register writes per device step—not a device count.`:`One count per device removed from DeviceHub.`:e===`model`?`One count per model in this run.`:e===`instance`?`One count per twin instance in this run.`:`Sets the device parameter to the bound DeviceHub device.`}var dt={devices:`Devices`,models:`DT models`,instances:`DT instances`},Q={create:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-success/35 bg-success/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-success`,update:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-primary/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-primary`,replace:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-chart-2/35 bg-chart-2/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-chart-2`,delete:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-destructive/35 bg-destructive/12 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-destructive`,failed:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-destructive/40 bg-destructive/18 px-1.5 py-0.5 font-mono text-[10px] font-semibold tabular-nums text-destructive`};function ft(e){return[{key:`device`,title:`DeviceHub — protocol tags`,subtitle:Z(`device`,e),counts:e.resourceCounts.device},{key:`model`,title:`Digital Twin models`,subtitle:Z(`model`,e),counts:e.resourceCounts.model},{key:`instance`,title:`Twin instances`,subtitle:Z(`instance`,e),counts:e.resourceCounts.instance},{key:`param-sync`,title:`Parameter sync`,subtitle:Z(`param-sync`,e),counts:e.resourceCounts[`param-sync`]}].filter(e=>e.counts.total>0||e.counts.failed>0)}function pt(e){return e.length===0?`Default (devices, models, instances)`:e.map(e=>dt[e]??e).join(` · `)}function mt(e){let t=[];return e.filters.area&&t.push(`Area ${e.filters.area}`),e.filters.line&&t.push(`Line ${e.filters.line}`),e.filters.instance&&t.push(`Instance ${e.filters.instance}`),t.length>0?t.join(` · `):null}function $(e,t,n){if(e===`device`)switch(t){case`create`:return`+${n} tags (new device)`;case`update`:return`${n} tags rewritten`;case`replace`:return`↻${n} tags (device replaced)`;case`delete`:return`−${n} removed`}switch(t){case`create`:return`+${n} created`;case`update`:return`${n} updated`;case`replace`:return`↻${n} replaced`;case`delete`:return`−${n} removed`}}function ht({row:e}){let{key:t,counts:n}=e;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`,children:[n.create>0&&(0,X.jsx)(`span`,{className:Q.create,children:$(t,`create`,n.create)}),n.update>0&&(0,X.jsx)(`span`,{className:Q.update,children:$(t,`update`,n.update)}),n.replace>0&&(0,X.jsx)(`span`,{className:Q.replace,children:$(t,`replace`,n.replace)}),n.delete>0&&(0,X.jsx)(`span`,{className:Q.delete,children:$(t,`delete`,n.delete)}),n.failed>0&&(0,X.jsx)(`span`,{className:Q.failed,children:`${n.failed} failed`})]})}function gt({op:e}){let t=mt(e);return(0,X.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 bg-muted/25 px-3 py-2.5`,children:[(0,X.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-[0.16em] text-foreground/72`,children:`Run context`}),(0,X.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[minmax(0,7.5rem)_1fr] gap-x-3 gap-y-1.5 text-xs sm:grid-cols-[9rem_1fr]`,children:[(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Operation`}),(0,X.jsx)(`dd`,{className:`font-medium capitalize text-foreground`,children:e.operationType}),(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Target host`}),(0,X.jsx)(`dd`,{className:`break-all font-mono text-[11px] text-foreground`,children:e.hostname}),(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Scope`}),(0,X.jsx)(`dd`,{className:`text-foreground`,children:pt(e.scope)}),t&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Filters`}),(0,X.jsx)(`dd`,{className:`text-foreground`,children:t})]}),(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Duration`}),(0,X.jsxs)(`dd`,{className:`tabular-nums text-foreground`,children:[(e.durationMs/1e3).toFixed(1),`s`]}),(0,X.jsx)(`dt`,{className:`text-foreground/70`,children:`Outcome`}),(0,X.jsxs)(`dd`,{className:`text-foreground`,children:[(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.successCount}),` steps succeeded`,e.failedCount>0&&(0,X.jsxs)(`span`,{className:`text-destructive`,children:[` `,`· `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.failedCount}),` failed`]}),e.blockedCount>0&&(0,X.jsxs)(`span`,{className:`text-warning`,children:[` `,`· `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.blockedCount}),` blocked in plan`]})]})]})]})}function _t({status:e}){switch(e){case`success`:return(0,X.jsx)(U,{className:`mt-px size-4 shrink-0 text-success`});case`failed`:return(0,X.jsx)(Me,{className:`mt-px size-4 shrink-0 text-destructive`});case`partial`:case`blocked`:return(0,X.jsx)(Re,{className:`mt-px size-4 shrink-0 text-warning`});case`noop`:return(0,X.jsx)(We,{className:`mt-px size-4 shrink-0 text-foreground/55`})}}function vt(e){let t=e.operationType===`apply`?`Applied`:`Cleaned up`,n=`${(e.durationMs/1e3).toFixed(1)}s`,r=[];return e.successCount>0&&r.push(`${e.successCount} resources`),e.failedCount>0&&r.push(`${e.failedCount} failed`),e.blockedCount>0&&r.push(`${e.blockedCount} blocked`),r.length===0?`${t} · no changes · ${n}`:`${t} · ${r.join(`, `)} · ${n}`}function yt(e){return e.operationType===`cleanup`&&e.successCount===0&&e.failedCount===0&&e.blockedCount===0?`No Miravo-managed resources were found to clean up.`:e.failedCount>0&&e.blockedCount>0?`No per-phase counts — failures and blocked plan entries.`:e.failedCount>0?`No per-phase counts — run failed.`:e.blockedCount>0?`No per-phase counts — blocked plan entries.`:`No per-phase counts recorded.`}function bt({op:e}){let t=ft(e);return t.length===0?(0,X.jsx)(`p`,{className:`py-1 text-sm text-foreground/75`,children:yt(e)}):(0,X.jsxs)(`div`,{className:`space-y-3 pt-1`,children:[(0,X.jsx)(`div`,{className:`flex flex-col divide-y divide-border/45 rounded-[var(--miravo-radius-tight)] border border-border/50`,children:t.map(e=>(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 px-3 py-2.5 sm:flex-row sm:items-start sm:gap-4`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 shrink-0 sm:w-[11.5rem]`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium leading-snug text-foreground`,children:e.title}),(0,X.jsxs)(ne,{children:[(0,X.jsx)(O,{type:`button`,className:`inline-flex shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] p-0.5 text-foreground/60 hover:bg-muted/50 hover:text-foreground`,"aria-label":`About ${e.title}`,children:(0,X.jsx)(Fe,{className:`size-3.5`,"aria-hidden":!0})}),(0,X.jsx)(k,{side:`top`,className:`max-w-xs text-left`,children:e.subtitle})]})]}),(0,X.jsx)(`p`,{className:`mt-0.5 text-[11px] leading-snug text-foreground/72 sm:hidden`,children:e.subtitle})]}),(0,X.jsx)(ht,{row:e})]},e.key))}),e.blockedCount>0&&(0,X.jsxs)(`p`,{className:`rounded-[var(--miravo-radius-tight)] border border-warning/20 bg-warning/5 px-2.5 py-1.5 text-[11px] text-warning`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.blockedCount}),` plan entries were blocked (skipped). Open a `,(0,X.jsx)(`span`,{className:`font-medium`,children:`deploy preview`}),` before running to see block reasons.`]})]})}function xt({operation:e}){let[t,n]=(0,Y.useState)(!1),r=e.targetLabel;return(0,X.jsxs)(`div`,{className:E(`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/55`,`transition-colors duration-150`),children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:E(`flex w-full items-start gap-3 p-3.5 text-left`,`transition-colors duration-100`,`hover:bg-muted/25`,t&&`bg-muted/18`),children:[(0,X.jsx)(_t,{status:e.status}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,X.jsxs)(`p`,{className:`min-w-0 truncate text-sm`,children:[(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:re(e.templateId)}),(0,X.jsx)(`span`,{className:`mx-1.5 text-foreground/50`,children:`→`}),(0,X.jsx)(`span`,{className:`text-foreground/82`,children:r})]}),(0,X.jsx)(`time`,{dateTime:new Date(e.completedAt).toISOString(),title:M(e.completedAt),className:`shrink-0 text-xs text-foreground/75`,children:j(e.completedAt)})]}),(0,X.jsx)(`p`,{className:`text-xs text-foreground/78`,children:vt(e)}),(e.failedCount>0||e.status===`failed`)&&(0,X.jsx)(`p`,{className:`text-[11px] leading-snug text-foreground/72`,children:`Temporary edge issue? Run apply again from Operations — Miravo usually succeeds on retry.`})]}),(0,X.jsx)(De,{className:E(`mt-0.5 size-3.5 shrink-0 text-foreground/55 transition-transform duration-150`,t&&`rotate-180`)})]}),(0,X.jsx)(g,{initial:!1,children:t&&(0,X.jsx)(h.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,X.jsxs)(`div`,{className:`space-y-3 border-t border-border/45 px-4 pb-3 pt-3`,children:[(0,X.jsx)(gt,{op:e}),e.error&&(0,X.jsxs)(`div`,{className:`relative rounded-[var(--miravo-radius-tight)] border border-destructive/40 bg-destructive/15 px-3 py-2 pr-10 text-xs font-medium`,children:[(0,X.jsx)(`div`,{className:`absolute top-1.5 right-1.5 z-10`,children:(0,X.jsx)(T,{value:e.error,label:`Copy error`,className:`text-destructive hover:bg-destructive/25 hover:text-foreground`})}),(0,X.jsx)(`p`,{className:`whitespace-normal break-words text-destructive [overflow-wrap:anywhere]`,children:e.error}),(0,X.jsx)(`p`,{className:`mt-2 text-[11px] font-normal leading-snug text-foreground/78 [overflow-wrap:anywhere]`,children:`Retry apply if the edge was slow or unreachable.`})]}),(0,X.jsx)(bt,{op:e})]})})})]})}function St({label:e}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,X.jsx)(`div`,{className:`h-px flex-1 bg-border/65`}),(0,X.jsx)(`span`,{className:`text-xs font-medium text-foreground/78`,children:e}),(0,X.jsx)(`div`,{className:`h-px flex-1 bg-border/65`})]})}var Ct={type:``,status:``,target:``,search:``},wt={_all:`All types`,apply:`Apply`,cleanup:`Cleanup`},Tt={_all:`All statuses`,success:`Success`,partial:`Partial`,failed:`Failed`,blocked:`Blocked`,noop:`No-op`},Et=`h-7 min-h-7 gap-1.5 border-border/50 bg-transparent px-2 text-xs hover:bg-muted/30 focus:ring-0`;function Dt({filters:e,targetOptions:t,hasFilters:n,searchRef:r,onTypeChange:i,onStatusChange:a,onTargetChange:o,onSearchChange:s,onClear:c}){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b border-border/50 px-3 py-2`,children:[(0,X.jsxs)(V,{value:e.type||`_all`,onValueChange:e=>e&&i(e===`_all`?``:e),children:[(0,X.jsx)(B,{size:`sm`,className:Et,"aria-label":`Operation type`,children:(0,X.jsx)(L,{children:e=>wt[e??`_all`]??wt._all})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(R,{value:`_all`,children:`All types`}),(0,X.jsx)(R,{value:`apply`,children:`Apply`}),(0,X.jsx)(R,{value:`cleanup`,children:`Cleanup`})]})]}),(0,X.jsxs)(V,{value:e.status||`_all`,onValueChange:e=>e&&a(e===`_all`?``:e),children:[(0,X.jsx)(B,{size:`sm`,className:Et,"aria-label":`Operation status`,children:(0,X.jsx)(L,{children:e=>Tt[e??`_all`]??Tt._all})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(R,{value:`_all`,children:`All statuses`}),(0,X.jsx)(R,{value:`success`,children:`Success`}),(0,X.jsx)(R,{value:`partial`,children:`Partial`}),(0,X.jsx)(R,{value:`failed`,children:`Failed`}),(0,X.jsx)(R,{value:`blocked`,children:`Blocked`}),(0,X.jsx)(R,{value:`noop`,children:`No-op`})]})]}),t.length>1&&(0,X.jsxs)(V,{value:e.target||`_all`,onValueChange:e=>e&&o(e===`_all`?``:e),children:[(0,X.jsx)(B,{size:`sm`,className:Et,"aria-label":`Target filter`,children:(0,X.jsx)(L,{children:e=>!e||e===`_all`?`All targets`:e})}),(0,X.jsxs)(z,{children:[(0,X.jsx)(R,{value:`_all`,children:`All targets`}),t.map(e=>(0,X.jsx)(R,{value:e,children:e},e))]})]}),(0,X.jsxs)(`div`,{className:`relative flex min-w-[140px] flex-1 items-center`,children:[(0,X.jsx)(`input`,{ref:r,type:`search`,value:e.search,onChange:e=>s(e.target.value),placeholder:`Search environment or target…`,"aria-describedby":`ops-search-shortcut`,className:E(`h-7 w-full rounded-[var(--miravo-radius-tight)] border border-border/50 bg-transparent pl-2 pr-7 text-xs`,`placeholder:text-foreground/60 focus:outline-none focus:ring-1 focus:ring-ring/40`,e.search&&`pr-2`)}),(0,X.jsx)(`span`,{id:`ops-search-shortcut`,className:`sr-only`,children:`Press slash to focus search`}),!e.search&&(0,X.jsx)(`kbd`,{"aria-hidden":!0,className:`pointer-events-none absolute right-2 flex h-4 items-center rounded-[var(--miravo-radius-tight)] border border-border/60 bg-muted/50 px-1 font-mono text-[10px] text-foreground/65`,children:`/`})]}),n&&(0,X.jsxs)(`button`,{type:`button`,onClick:c,className:`flex h-7 items-center gap-1 rounded-[var(--miravo-radius-tight)] px-2 text-xs text-foreground/72 transition-colors hover:bg-muted/40 hover:text-foreground`,children:[(0,X.jsx)(A,{className:`size-3`}),`Clear`]})]})}function Ot({operations:e,totalKnown:t,isLoading:n,error:r,onRefresh:i,hasNextPage:a=!1,isFetchingNextPage:o=!1,loadMoreError:s=null,onRetryLoadMore:c,onLoadMore:l}){let[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(Ct),_=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let e=e=>{if(e.key!==`/`||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.preventDefault(),_.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let v=()=>{f(!0),i(),S.success(`Operations refreshed`),setTimeout(()=>f(!1),600)},y=(0,Y.useMemo)(()=>{let t=new Set;for(let n of e){let e=n.targetLabel;t.add(e)}return[...t].sort()},[e]),b=(0,Y.useMemo)(()=>{let t=e;if(p.type&&(t=t.filter(e=>e.operationType===p.type)),p.status&&(t=t.filter(e=>e.status===p.status)),p.target&&(t=t.filter(e=>e.targetLabel===p.target)),p.search){let e=p.search.toLowerCase();t=t.filter(t=>{let n=t.targetLabel;return t.templateId.toLowerCase().includes(e)||re(t.templateId).toLowerCase().includes(e)||n.toLowerCase().includes(e)})}return t},[e,p]),x=p.type!==``||p.status!==``||p.target!==``||p.search!==``,C=(0,Y.useMemo)(()=>ut(b),[b]);return(0,X.jsxs)(`div`,{className:`flex h-full flex-col rounded-[var(--miravo-radius-stadium-sm)] border border-border/55`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border/50 px-3.5 py-2.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Operation log`}),e.length>0&&(0,X.jsx)(`span`,{className:`font-mono text-xs tabular-nums text-foreground/75`,children:typeof t==`number`&&t>0&&e.length<t?`${e.length} / ${t}`:String(e.length)})]}),(0,X.jsx)(`button`,{type:`button`,onClick:v,disabled:d,"aria-label":`Refresh operation list`,className:`relative rounded-[var(--miravo-radius-tight)] p-1 text-foreground/70 transition-colors before:absolute before:inset-[-10px] before:content-[''] hover:bg-muted/50 hover:text-foreground disabled:pointer-events-none`,children:(0,X.jsx)(u,{className:E(`size-3.5`,d&&`animate-spin`),"aria-hidden":!0})})]}),(0,X.jsx)(Dt,{filters:p,targetOptions:y,hasFilters:x,searchRef:_,onTypeChange:e=>m(t=>({...t,type:e})),onStatusChange:e=>m(t=>({...t,status:e})),onTargetChange:e=>m(t=>({...t,target:e})),onSearchChange:e=>m(t=>({...t,search:e})),onClear:()=>m(Ct)}),(0,X.jsxs)(`div`,{className:`flex flex-1 min-h-0 flex-col gap-2 overflow-y-auto overscroll-y-contain p-3`,children:[r&&(0,X.jsxs)(`p`,{className:`py-2 text-xs text-destructive`,children:[`✕ `,r.message]}),n&&e.length===0&&!r&&(0,X.jsx)(`p`,{className:`py-4 text-sm text-foreground/75`,children:`Loading…`}),!n&&e.length===0&&!r&&(0,X.jsx)(ct,{}),!n&&e.length>0&&b.length===0&&(0,X.jsxs)(`p`,{className:`py-6 text-center text-sm text-foreground/75`,children:[`No operations match your filters.`,` `,(0,X.jsx)(`button`,{type:`button`,onClick:()=>m(Ct),className:`text-primary hover:underline`,children:`Clear filters`})]}),x&&b.length>0&&b.length!==e.length&&(0,X.jsxs)(`p`,{className:`text-xs text-foreground/75`,children:[`Showing`,` `,(0,X.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:b.length}),` of`,` `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:e.length}),` loaded`]}),!x&&typeof t==`number`&&t>0&&e.length<t&&(0,X.jsxs)(`p`,{className:`text-xs text-foreground/75`,children:[`Showing`,` `,(0,X.jsx)(`span`,{className:`font-medium tabular-nums text-foreground`,children:e.length}),` `,`of `,(0,X.jsx)(`span`,{className:`tabular-nums`,children:t}),`. Load more for older entries.`]}),(0,X.jsx)(g,{initial:!1,children:C.map(e=>(0,X.jsxs)(h.div,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(St,{label:e.label}),(0,X.jsx)(g,{initial:!1,children:e.ops.map(e=>(0,X.jsx)(h.div,{initial:b.length>40?!1:{opacity:0,x:-6},animate:{opacity:1,x:0},transition:{type:`spring`,stiffness:400,damping:35},children:(0,X.jsx)(xt,{operation:e})},`${e.operationId}-${e.completedAt}`))})]},e.label))}),s?(0,X.jsxs)(`div`,{role:`alert`,className:`flex shrink-0 flex-col items-center gap-2 border-t border-border/50 pt-3 pb-1 text-center`,children:[(0,X.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Could not load older entries: `,s.message]}),c?(0,X.jsx)(N,{type:`button`,variant:`outline`,size:`sm`,onClick:c,children:`Retry`}):null]}):a&&l?(0,X.jsx)(`div`,{className:`flex shrink-0 justify-center border-t border-border/50 pt-3 pb-1`,children:(0,X.jsx)(N,{type:`button`,variant:`outline`,size:`sm`,className:`min-w-[7rem]`,disabled:o,"aria-busy":o,"aria-label":o?`Loading older operations`:`Load older operations`,onClick:l,children:o?`Loading…`:`Load more`})}):null]})]})}function kt(e){return ke.find(t=>t.id===e)?.label??e}function At(e){if(!e)return`var(--tooltip-border)`;switch(e.status){case`success`:return`var(--success)`;case`partial`:case`blocked`:return`var(--warning)`;case`noop`:return`var(--muted-foreground)`;case`failed`:return`var(--destructive)`}}function jt({status:e}){switch(e){case`success`:return(0,X.jsx)(U,{className:`size-3 text-success`});case`partial`:case`blocked`:return(0,X.jsx)(Re,{className:`size-3 text-warning`});case`noop`:return(0,X.jsx)(We,{className:`size-3 text-muted-foreground`});case`failed`:return(0,X.jsx)(Me,{className:`size-3 text-destructive`})}}function Mt({target:e,lastOp:t,onEdit:n,onDelete:r}){return(0,X.jsxs)(`div`,{className:`env-orbital relative overflow-hidden border`,style:{"--_status":At(t)},children:[(0,X.jsx)(`div`,{className:`relative z-10 px-4 pt-3.5 pb-3`,children:(0,X.jsx)(`p`,{className:`font-heading text-[13px] font-semibold leading-tight tracking-tight text-foreground`,children:e.label})}),(0,X.jsx)(`div`,{className:`relative z-10 px-4 py-0.5`,children:(0,X.jsx)(`p`,{className:`font-mono text-xs tracking-tight text-muted-foreground`,children:e.hostname})}),(0,X.jsxs)(`div`,{className:`relative z-10 mx-4 mb-3 flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-muted-foreground`,children:e.sourceHostname}),(0,X.jsx)(`div`,{className:`env-orbital-path min-w-6 flex-1`}),(0,X.jsx)(ie,{className:`size-3 shrink-0 text-muted-foreground`})]}),(0,X.jsxs)(`div`,{className:`relative z-10 flex items-center gap-2 border-t border-border/30 px-3 py-1.5`,children:[(0,X.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 rounded-full border border-border/40 px-2 py-0.5`,children:[(0,X.jsx)(`span`,{className:`protocol-card-live-dot size-[5px]`}),(0,X.jsx)(`span`,{className:`text-[11px] font-medium tracking-wide text-muted-foreground`,children:kt(e.platformId)})]}),t&&(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 truncate text-[11px] text-muted-foreground`,children:[(0,X.jsx)(jt,{status:t.status}),t.operationType===`apply`?`Applied`:`Cleaned`,` `,(0,X.jsx)(`time`,{dateTime:new Date(t.completedAt).toISOString(),title:M(t.completedAt),children:j(t.completedAt)})]}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(N,{variant:`ghost`,size:`icon-sm`,"aria-label":`Edit target`,onClick:n,children:(0,X.jsx)(Ge,{className:`size-3`})}),(0,X.jsx)(N,{variant:`ghost`,size:`icon-sm`,className:`text-destructive hover:text-destructive`,"aria-label":`Delete target`,onClick:r,children:(0,X.jsx)(I,{className:`size-3`})})]})]})]})}function Nt({onClick:e}){return(0,X.jsxs)(`button`,{type:`button`,onClick:e,className:`env-orbital group h-full w-full flex flex-col items-center justify-center gap-2 border border-dashed py-10 text-muted-foreground transition-colors hover:border-primary/30 hover:text-primary`,style:{"--_status":`var(--tooltip-border)`},children:[(0,X.jsx)(ae,{className:`size-5 transition-transform group-hover:scale-110`}),(0,X.jsx)(`span`,{className:`text-xs`,children:`Add Target`})]})}function Pt({targets:e,onMutate:t,lastOpByTarget:n}){let[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(H.id),[l,u]=(0,Y.useState)({label:``,hostname:``,apiToken:``,sourceHostname:``}),[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(!1),{testing:_,runTest:v,cancelInFlight:y}=ve(),[T,E]=(0,Y.useState)(null),D=s===H.id&&l.hostname.trim().length>0&&l.sourceHostname.trim().length>0&&(a!==null||l.apiToken.trim().length>0),O=()=>{o(null),c(H.id),u({label:``,hostname:``,apiToken:``,sourceHostname:``}),m(!1),i(!0)},k=e=>{o(e.id),c(ke.some(t=>t.id===e.platformId)?e.platformId:H.id),u({label:e.label,hostname:e.hostname,apiToken:``,sourceHostname:e.sourceHostname}),m(!1),i(!0)},ne=async()=>{if(s!==H.id){S.error(`${kt(s)} target setup is coming soon.`);return}if(!l.label||!l.hostname||!l.sourceHostname){S.error(`Label, hostname, and source host are required.`);return}if(!a&&!l.apiToken){S.error(`API token is required for new targets.`);return}f(!0);try{a?(await le(a,{platformId:s,label:l.label,hostname:l.hostname,sourceHostname:l.sourceHostname,...l.apiToken?{apiToken:l.apiToken}:{}}),S.success(`Target updated.`)):(await se({...l,platformId:s}),S.success(`Target added.`)),i(!1),t()}catch(e){S.error(e instanceof Error?e.message:`Failed to save target.`)}finally{f(!1)}};return(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`h2`,{className:`flex h-5 items-center text-xs font-medium leading-none uppercase tracking-wider text-muted-foreground`,children:`Platform Targets`}),e.length>0?(0,X.jsx)(ze,{variant:`secondary`,className:`relative -top-px h-5 shrink-0 px-1.5 py-0 font-mono text-[10px] leading-none tabular-nums`,children:e.length}):null]}),(0,X.jsxs)(N,{size:`sm`,className:`h-7 shrink-0 gap-1.5 text-xs`,onClick:O,children:[(0,X.jsx)(ae,{className:`size-3.5`}),` Add Target`]})]}),e.length===0?(0,X.jsx)(Xe,{titleId:`platforms-targets-empty-title`,frameIcon:(0,X.jsx)(K,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0}),description:(0,X.jsx)(Je,{}),children:(0,X.jsx)(Ye,{onClick:O})}):(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 @2xl/main:grid-cols-2 @5xl/main:grid-cols-3`,children:(0,X.jsxs)(g,{children:[e.map((e,t)=>(0,X.jsx)(h.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.96,transition:{duration:.15}},transition:{type:`spring`,stiffness:380,damping:30,delay:t*.04},children:(0,X.jsx)(Mt,{target:e,lastOp:n.get(e.id),onEdit:()=>k(e),onDelete:()=>E(e)})},e.id)),(0,X.jsx)(h.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{type:`spring`,stiffness:380,damping:30,delay:e.length*.04},children:(0,X.jsx)(Nt,{onClick:O})},`add-card`)]})}),(0,X.jsx)(_e,{open:r,editing:a!==null,platformId:s,form:l,showToken:p,saving:d,testing:_,canTestConnection:D,onOpenChange:i,onPlatformChange:c,onFormChange:u,onShowTokenChange:m,onSave:()=>void ne(),onTestConnection:()=>{D&&v({hostname:l.hostname.trim(),sourceHostname:l.sourceHostname.trim(),...l.apiToken.trim()?{apiToken:l.apiToken.trim()}:{}})},onCancelInFlight:y}),(0,X.jsx)(C,{open:T!==null,onOpenChange:e=>!e&&E(null),children:(0,X.jsxs)(te,{children:[(0,X.jsxs)(ee,{children:[(0,X.jsx)(w,{children:`Remove Target`}),(0,X.jsxs)(x,{children:[`Remove “`,T?.label,`”? This only deletes the saved credentials — it does not affect resources on the target platform.`]})]}),(0,X.jsxs)(b,{children:[(0,X.jsx)(N,{variant:`outline`,onClick:()=>E(null),children:`Cancel`}),(0,X.jsx)(N,{variant:`destructive`,onClick:async()=>{if(!T)return;let e=T.id;E(null);try{await ge(e),S.success(`Target removed.`),t()}catch(e){S.error(e instanceof Error?e.message:`Failed to remove target.`)}},children:`Remove`})]})]})})]})}var Ft=25;function It({status:e}){switch(e){case`success`:return(0,X.jsx)(U,{className:`size-3 text-success`});case`partial`:case`blocked`:return(0,X.jsx)(Re,{className:`size-3 text-warning`});case`noop`:return(0,X.jsx)(We,{className:`size-3 text-muted-foreground`});case`failed`:return(0,X.jsx)(Me,{className:`size-3 text-destructive`})}}function Lt({targetCount:e,opCount:t,lastOp:n}){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(K,{className:`size-3`}),(0,X.jsx)(`span`,{className:`font-mono`,children:e}),` target`,e===1?``:`s`]}),(0,X.jsx)(`span`,{className:`hidden h-3 w-px bg-border/40 sm:inline-block`}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(g,{mode:`popLayout`,initial:!1,children:(0,X.jsx)(h.span,{initial:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:{type:`spring`,stiffness:500,damping:35},className:`font-mono tabular-nums`,children:t},t)}),` `,`operation`,t===1?``:`s`]}),n&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`hidden h-3 w-px bg-border/40 sm:inline-block`}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(It,{status:n.status}),(0,X.jsxs)(`span`,{children:[n.operationType===`apply`?`Applied`:`Cleaned`,` `,(0,X.jsx)(`time`,{dateTime:new Date(n.completedAt).toISOString(),title:M(n.completedAt),children:j(n.completedAt)})]})]})]})]})}function Rt(){let e=l({queryKey:J.platforms.targets(),queryFn:()=>ce()}),t=e.data??[],n=He({queryKey:J.platforms.operationsList(),queryFn:({pageParam:e})=>ye({limit:Ft,offset:e}),initialPageParam:0,getNextPageParam:(e,t,n)=>e.hasMore&&e.operations.length>0?n+Ft:void 0}),r=(0,Y.useMemo)(()=>n.data?.pages.flatMap(e=>e.operations)??[],[n.data]),i=n.data?.pages[0]?.total??0,a=l({queryKey:J.catalog.templates(),queryFn:()=>s(`/catalog/templates`,o.catalogTemplates)}).data??[],u=be(),d=(0,Y.useRef)(u.status);(0,Y.useEffect)(()=>{let e=d.current;d.current=u.status,e===`running`&&u.status===`complete`&&c.invalidateQueries({queryKey:J.platforms.operationsList()})},[u.status]);let p=(0,Y.useMemo)(()=>{let e=new Map;for(let t of r)e.has(t.targetId)||e.set(t.targetId,t);return e},[r]),[y,b]=_(`tab`,v([`targets`,`operations`,`activity`]).withDefault(`targets`)),x;return x=e.isPending&&e.data===void 0?(0,X.jsxs)(`div`,{role:`status`,"aria-busy":`true`,className:qe,children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`Loading targets`}),(0,X.jsxs)(`div`,{className:`mx-auto flex max-w-md flex-col items-center gap-4 px-4 py-10`,children:[(0,X.jsx)(q,{className:`h-5 w-48`}),(0,X.jsx)(q,{className:`h-4 w-full max-w-sm`}),(0,X.jsx)(q,{className:`h-9 w-40 rounded-(--miravo-radius-stadium-sm)`})]})]}):e.isError&&e.data===void 0?(0,X.jsx)(f,{message:m(e.error,`Could not load targets.`),onRetry:()=>void e.refetch(),isRetrying:e.isFetching&&!e.isPending}):t.length===0?(0,X.jsx)(Xe,{titleId:`platforms-operations-empty-title`,frameIcon:(0,X.jsx)(K,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0}),description:(0,X.jsx)(Je,{}),children:(0,X.jsx)(Ye,{onClick:()=>void b(`targets`)})}):(0,X.jsx)(st,{targets:t,stream:u}),(0,X.jsxs)(`div`,{className:`mx-auto flex h-full w-full min-w-0 max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,X.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,X.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Platforms`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect Platforms as targets, then apply templates or run cleanup from Operations.`}),(0,X.jsx)(Lt,{targetCount:t.length,opCount:i,lastOp:r[0]})]}),(0,X.jsxs)(Ne,{value:y,onValueChange:e=>{b(e)},className:`flex-1 min-h-0`,children:[(0,X.jsx)(`div`,{className:`shrink-0 overflow-x-auto`,children:(0,X.jsxs)(je,{variant:`line`,className:`h-10! gap-0.5 min-w-max`,children:[(0,X.jsxs)(W,{value:`targets`,className:`gap-1.5 px-3 text-sm`,children:[(0,X.jsx)(K,{className:`size-3.5 shrink-0`}),`Targets`]}),(0,X.jsxs)(W,{value:`operations`,className:`gap-1.5 px-3 text-sm`,children:[(0,X.jsx)(Te,{className:`size-3.5 shrink-0`}),`Operations`]}),(0,X.jsxs)(W,{value:`activity`,className:`gap-1.5 px-3 text-sm`,children:[(0,X.jsx)(F,{className:`size-3.5 shrink-0`}),`Activity`]})]})}),(0,X.jsx)(G,{value:`targets`,className:`flex-1 py-2`,children:(0,X.jsx)(h.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},children:(0,X.jsx)(Pt,{targets:t,onMutate:()=>void e.refetch(),lastOpByTarget:p})},`targets`)}),(0,X.jsx)(G,{value:`operations`,className:`flex-1 py-2`,children:(0,X.jsx)(h.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},children:x},`operations`)}),(0,X.jsx)(G,{value:`activity`,className:`flex flex-col flex-1 min-h-0 py-2`,children:(0,X.jsx)(h.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:`easeOut`},className:`flex flex-col flex-1 min-h-0`,children:(0,X.jsx)(Ot,{operations:r,totalKnown:i,isLoading:n.isPending&&!n.data,error:n.error,onRefresh:()=>void c.invalidateQueries({queryKey:J.platforms.operationsList()}),hasNextPage:n.hasNextPage,isFetchingNextPage:n.isFetchingNextPage,loadMoreError:n.isFetchNextPageError&&n.error instanceof Error?n.error:null,onRetryLoadMore:()=>void n.fetchNextPage(),onLoadMore:()=>void n.fetchNextPage()})},`activity`)})]}),(0,X.jsx)(g,{children:u.operation||u.status===`running`?(0,X.jsx)(Ze,{stream:u,onReset:u.reset,catalogTemplates:a}):null})]})}export{Rt as t};
@@ -1 +0,0 @@
1
- var e={catalog:{templates:()=>[`catalog`,`templates`],models:()=>[`catalog`,`models`],templateDetail:e=>[`catalog`,`template`,e],modelSchema:e=>[`catalog`,`model-schema`,e],modelSchemasBatch:e=>[`catalog`,`model-schemas-batch`,e]},events:(e,t)=>[`events`,e,t],tags:{manifest:e=>[`tags`,`manifest`,e]},platforms:{targets:()=>[`platforms`,`targets`],operationsList:()=>[`platforms`,`operations`,`list`]},instances:{detail:e=>[`instances`,e]}};export{e as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/fleet-DbMmYTAW.js","assets/fleet-CF_yW3Xe.js","assets/rolldown-runtime-COnpUsM8.js","assets/chunk-OE4NN4TA-m2UhO8Q2.js","assets/vendor-charts-CAZdaPlq.js","assets/api-BjnU1LXi.js","assets/vendor-ui-mizMYESS.js","assets/input-BCiRHEmc.js","assets/createLucideIcon-Yddw9eHa.js","assets/arrow-right-DrKCU9WM.js","assets/arrow-up-down-CBuv2TSF.js","assets/select-4wihIkEE.js","assets/circle-question-mark-Q_q7JZnT.js","assets/dist-jROhexoH.js","assets/engine-store-BUO-9Dsh.js","assets/shallow-ODRQsuRf.js","assets/badge-tnWgSITj.js","assets/combobox-gGNWoksU.js","assets/skeleton-C6iEH-9E.js","assets/select-display-items-DUJCelf2.js","assets/tooltip-TtanriwA.js","assets/query-keys-Co1J4HmV.js","assets/transition-types-CMW7IObN.js","assets/catalog-DEAID15Z.js","assets/catalog-BGQVa6B3.js","assets/get-error-message-BzBOywwk.js","assets/AnimatePresence-CVhkybDC.js","assets/proxy-CgM57W61.js","assets/use-platform-stream-ScJV0xv8.js","assets/platform-targets-BbVxaqAc.js","assets/tabs-BgPF8MSY.js","assets/copy-button-DYqJP5N8.js","assets/checkbox-Xly18Uyz.js","assets/triangle-alert-DPtblpQC.js","assets/label-xIWEC6lW.js","assets/catalog-template-icons-b6a6Gty-.js","assets/deploy-tab-BRET5egR.js","assets/download-BPgKzo-_.js","assets/use-engine-command-mutation--eob_QrP.js","assets/models-BUJkHhCT.js","assets/models-DeByQ5rq.js","assets/activity-DP0Us3HU.js","assets/events-rhPd7QcZ.js","assets/events-B2IxlA63.js","assets/auth-screen-backdrop-OrOL41MR.js","assets/use-transition-navigate-Dp3qkQ87.js","assets/control-ahMsWPz4.js","assets/control-B_Mo9qMu.js","assets/validation-BTuAJAb2.js","assets/server-D7sb2mj5.js","assets/transition-nav-link-99H9mlJO.js","assets/tags-DEKAj0l-.js","assets/tags-CL_-O-ZZ.js","assets/vendor-table-wd8JuMmT.js","assets/platforms-Caq2eqh-.js","assets/platforms-DjGsPZpq.js","assets/instance-detail-4eUBkrXG.js","assets/login-B7ZXWxuU.js"])))=>i.map(i=>d[i]);
2
- import{d as e}from"./chunk-OE4NN4TA-m2UhO8Q2.js";var t=[{test:e=>e===`/`,load:()=>e(()=>import(`./fleet-DbMmYTAW.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]))},{test:e=>e===`/catalog`,load:()=>e(()=>import(`./catalog-DEAID15Z.js`),__vite__mapDeps([23,24,2,5,6,4,25,7,8,26,27,28,11,29,30,12,31,20,32,33,16,34,35,36,37,21,38,14]))},{test:e=>e===`/models`,load:()=>e(()=>import(`./models-BUJkHhCT.js`),__vite__mapDeps([39,40,2,5,6,4,25,7,8,26,27,41,28,11,29,30,12,31,20,32,33,16,34,36,37,21,38,14]))},{test:e=>e===`/events`,load:()=>e(()=>import(`./events-rhPd7QcZ.js`),__vite__mapDeps([42,43,2,3,4,5,6,25,7,8,26,27,11,14,44,16,17,19,45,21,22]))},{test:e=>e===`/control`,load:()=>e(()=>import(`./control-ahMsWPz4.js`),__vite__mapDeps([46,47,2,5,6,4,7,8,26,27,41,9,11,30,31,20,48,32,49,38,14,33,13,15,50,3,45,16,17,34]))},{test:e=>e===`/tags`,load:()=>e(()=>import(`./tags-DEKAj0l-.js`),__vite__mapDeps([51,52,2,3,4,5,6,25,7,8,53,26,27,10,11,29,31,20,37,13,14,44,17,34,21]))},{test:e=>e===`/platforms`,load:()=>e(()=>import(`./platforms-Caq2eqh-.js`),__vite__mapDeps([54,55,2,3,4,5,6,25,7,8,26,27,41,9,28,11,29,30,12,31,20,32,33,16,34,35,49,13,18,21]))},{test:e=>e.startsWith(`/instance/`),load:()=>e(()=>import(`./instance-detail-4eUBkrXG.js`),__vite__mapDeps([56,2,3,4,5,6,25,7,8,27,41,30,31,20,48,38,14,33,13,44,16,21,22]))},{test:e=>e===`/login`,load:()=>e(()=>import(`./login-B7ZXWxuU.js`),__vite__mapDeps([57,2,5,6,4,50,3,45]))}],n=new Set;function r(e){if(!e.startsWith(`/`))return null;let t=e.indexOf(`?`),n=e.indexOf(`#`),r=t===-1?n===-1?e.length:n:n===-1?t:Math.min(t,n);return e.slice(0,r)}function i(e){let i=r(e);if(!i||n.has(i))return;let a=t.find(e=>e.test(i));a&&(n.add(i),a.load().catch(()=>{n.delete(i)}))}export{i as t};
@@ -1 +0,0 @@
1
- import{C as e,D as t,E as n,S as r,T as i,_ as a,at as o,b as s,g as c,h as l,q as u,v as d,w as f,x as p,y as m}from"./vendor-ui-mizMYESS.js";import{n as h,t as g}from"./createLucideIcon-Yddw9eHa.js";import{o as _}from"./input-BCiRHEmc.js";var v=g(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),y=o(),b=t;function x({className:e,...t}){return(0,y.jsx)(c,{"data-slot":`select-group`,className:h(`scroll-my-1 p-1`,e),...t})}function S({className:e,...t}){return(0,y.jsx)(i,{"data-slot":`select-value`,className:h(`flex flex-1 text-left`,e),...t})}function C({className:e,size:t=`default`,children:r,...i}){return(0,y.jsxs)(n,{"data-slot":`select-trigger`,"data-size":t,className:h(`flex w-fit min-w-0 items-center justify-between gap-1.5 rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/30 px-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none hover:bg-input/50 focus-visible:border-primary/35 focus-visible:ring-2 focus-visible:ring-primary/22 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[var(--miravo-radius-stadium-sm)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...i,children:[r,(0,y.jsx)(f,{render:(0,y.jsx)(v,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function w({className:t,children:n,side:i=`bottom`,sideOffset:a=6,align:o=`center`,alignOffset:c=0,alignItemWithTrigger:l=!1,...u}){return(0,y.jsx)(e,{children:(0,y.jsx)(r,{side:i,sideOffset:a,align:o,alignOffset:c,alignItemWithTrigger:l,className:`isolate z-50`,children:(0,y.jsx)(p,{"data-slot":`select-content`,"data-align-trigger":l,className:h(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--miravo-radius-tight)] bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:data-open:duration-0 motion-reduce:data-closed:duration-0`,t),...u,children:(0,y.jsx)(s,{children:n})})})})}function T({className:e,...t}){return(0,y.jsx)(l,{"data-slot":`select-label`,className:h(`px-2 py-1.5 text-xs text-muted-foreground`,e),...t})}var E=`relative flex w-full cursor-pointer items-center gap-1.5 rounded-[var(--miravo-radius-tight)] py-1 pr-8 pl-1.5 text-xs text-muted-foreground outline-hidden select-none data-[highlighted]:bg-sidebar-accent data-[highlighted]:text-sidebar-accent-foreground not-data-[variant=destructive]:data-[highlighted]:**:text-sidebar-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`;function D({className:e,children:t,...n}){return(0,y.jsxs)(m,{"data-slot":`select-item`,className:h(E,e),...n,children:[(0,y.jsx)(a,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,y.jsx)(d,{render:(0,y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,y.jsx)(_,{className:`pointer-events-none`})})]})}function O({className:e,...t}){return(0,y.jsx)(u,{"data-slot":`select-separator`,className:h(`pointer-events-none -mx-1 my-1 h-px bg-border`,e),...t})}export{T as a,S as c,D as i,v as l,w as n,O as o,x as r,C as s,b as t};
@@ -1 +0,0 @@
1
- import{at as e}from"./vendor-ui-mizMYESS.js";import{n as t}from"./createLucideIcon-Yddw9eHa.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`div`,{className:`relative w-full overflow-x-auto`,children:(0,n.jsx)(`table`,{"data-slot":`table`,className:t(`min-w-full caption-bottom text-sm`,e),...r})})}function i({className:e,...r}){return(0,n.jsx)(`thead`,{"data-slot":`table-header`,className:t(`[&_tr]:border-b`,e),...r})}function a({className:e,...r}){return(0,n.jsx)(`tbody`,{"data-slot":`table-body`,className:t(`[&_tr:last-child]:border-0`,e),...r})}function o({className:e,...r}){return(0,n.jsx)(`tr`,{"data-slot":`table-row`,className:t(`border-b transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground data-[state=selected]:bg-sidebar-accent data-[state=selected]:text-sidebar-accent-foreground`,e),...r})}function s({className:e,...r}){return(0,n.jsx)(`th`,{"data-slot":`table-head`,className:t(`h-10 px-1.5 text-left align-middle font-medium whitespace-nowrap text-foreground sm:px-2 [&:has([role=checkbox])]:pr-0`,e),...r})}function c({className:e,...r}){return(0,n.jsx)(`td`,{"data-slot":`table-cell`,className:t(`p-1.5 align-middle whitespace-nowrap sm:p-2 [&:has([role=checkbox])]:pr-0`,e),...r})}var l=[{value:`all`,label:`All events`},{value:`fault:triggered`,label:`Fault Triggered`},{value:`fault:cleared`,label:`Fault Cleared`},{value:`lifecycle:changed`,label:`Lifecycle Changed`},{value:`instance:created`,label:`Instance Created`},{value:`instance:removed`,label:`Instance Removed`},{value:`engine:state-changed`,label:`Engine State`},{value:`platform:resource`,label:`Platform Resource`},{value:`platform:operation`,label:`Platform Operation`}],u=[{value:`all`,label:`All status`},{value:`healthy`,label:`Healthy`},{value:`faulted`,label:`Faulted`},{value:`quarantined`,label:`Quarantined`}];export{c as a,o as c,a as i,u as n,s as o,r,i as s,l as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-Yddw9eHa.js";var t=e(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),n=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]);export{t as n,n as t};
@@ -1 +0,0 @@
1
- import{at as e}from"./vendor-ui-mizMYESS.js";import{n as t}from"./createLucideIcon-Yddw9eHa.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`skeleton`,className:t(`animate-pulse rounded-[var(--miravo-radius-tight)] bg-muted`,e),...r})}export{r as t};
@@ -1 +0,0 @@
1
- import{at as e,d as t,f as n,m as r,p as i}from"./vendor-ui-mizMYESS.js";import{n as a,t as o}from"./createLucideIcon-Yddw9eHa.js";import{i as s}from"./input-BCiRHEmc.js";var c=o(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),l=o(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),u=o(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),d=o(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),f=e();function p({className:e,orientation:t=`horizontal`,...n}){return(0,f.jsx)(r,{"data-slot":`tabs`,"data-orientation":t,className:a(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var m=s(`group/tabs-list inline-flex w-fit items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-0 border-b border-border/50 bg-transparent p-0 shadow-none group-data-horizontal/tabs:h-auto group-data-horizontal/tabs:min-h-8`}},defaultVariants:{variant:`default`}});function h({className:e,variant:n=`default`,...r}){return(0,f.jsx)(t,{"data-slot":`tabs-list`,"data-variant":n,className:a(m({variant:n}),e),...r})}function g({className:e,...t}){return(0,f.jsx)(i,{"data-slot":`tabs-trigger`,className:a(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-[var(--miravo-radius-tight)] border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-muted-foreground transition-[color,box-shadow,transform] duration-200 ease-out group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:font-heading group-data-[variant=line]/tabs-list:tracking-tight group-data-[variant=line]/tabs-list:text-sm group-data-[variant=line]/tabs-list:text-muted-foreground group-data-[variant=line]/tabs-list:hover:text-foreground group-data-[variant=line]/tabs-list:data-active:font-semibold group-data-[variant=line]/tabs-list:data-active:text-foreground`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent group-data-[variant=line]/tabs-list:data-active:border-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`group-data-[variant=line]/tabs-list:rounded-none group-data-[variant=line]/tabs-list:px-3 group-data-[variant=line]/tabs-list:py-2`,`data-active:bg-background data-active:text-foreground data-active:border-input data-active:bg-input/30 data-active:text-foreground`,`after:pointer-events-none after:absolute after:bg-foreground after:opacity-0 after:transition-[opacity,transform] after:duration-300 after:ease-out group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5`,`group-data-[variant=line]/tabs-list:after:bg-primary group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:after:bottom-0 group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:after:h-[2px] group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:after:rounded-sm group-data-[variant=line]/tabs-list:data-active:after:opacity-100 group-data-horizontal/tabs:group-data-[variant=line]/tabs-list:data-active:after:shadow-[0_0_14px_-3px_color-mix(in_srgb,var(--primary)_50%,transparent)]`,e),...t})}function _({className:e,...t}){return(0,f.jsx)(n,{"data-slot":`tabs-content`,className:a(`flex-1 text-sm outline-none py-2`,e),...t})}export{d as a,c,g as i,_ as n,u as o,h as r,l as s,p as t};