@miravo/cli-linux-arm64-musl 0.7.6 → 0.7.7

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 (44) hide show
  1. package/console-dist/assets/{api-DPmCeS_C.js → api-CrYvIV3A.js} +1 -1
  2. package/console-dist/assets/catalog-CMdsHJtX.js +1 -0
  3. package/console-dist/assets/catalog-DCLloXKb.js +1 -0
  4. package/console-dist/assets/catalog-source-B3vWR4vX.js +1 -0
  5. package/console-dist/assets/control-6TWF0ywx.js +1 -0
  6. package/console-dist/assets/{control-Doh5s9U2.js → control-C_0G31vu.js} +1 -1
  7. package/console-dist/assets/{events-DAKmlfl3.js → events--facGImw.js} +1 -1
  8. package/console-dist/assets/events-D7PCqbvy.js +1 -0
  9. package/console-dist/assets/fleet-DmMO3ebD.js +1 -0
  10. package/console-dist/assets/{fleet-jLriF31S.js → fleet-anqPXBbM.js} +1 -1
  11. package/console-dist/assets/{get-error-message-Btp63MTs.js → get-error-message-BgE2BpPG.js} +1 -1
  12. package/console-dist/assets/index-BNGYKshE.css +2 -0
  13. package/console-dist/assets/{index-0cZ4jnjm.js → index-Dmyw65xM.js} +3 -3
  14. package/console-dist/assets/{instance-detail-CDT9PHVw.js → instance-detail-CDK2JYdW.js} +1 -1
  15. package/console-dist/assets/{login-Cs-sBvVA.js → login-H82N0S2O.js} +1 -1
  16. package/console-dist/assets/models-B7FNHSvb.js +1 -0
  17. package/console-dist/assets/models-Bmif9sIG.js +1 -0
  18. package/console-dist/assets/platforms-DGpl5tPh.js +1 -0
  19. package/console-dist/assets/platforms-Djfu2pyM.js +1 -0
  20. package/console-dist/assets/{query-fetch-error-C-7x_NhM.js → query-fetch-error-BWenDoLQ.js} +1 -1
  21. package/console-dist/assets/{route-preload-cBwnl6Y_.js → route-preload-CLRbqehb.js} +2 -2
  22. package/console-dist/assets/tags-dBHY56Fz.js +1 -0
  23. package/console-dist/assets/{tags-KxhNEiLb.js → tags-zenGXuzO.js} +1 -1
  24. package/console-dist/assets/{transition-nav-link-DVwZxiEL.js → transition-nav-link-BWSxzHUf.js} +1 -1
  25. package/console-dist/assets/{use-engine-command-mutation-iPA57YyA.js → use-engine-command-mutation-CT_3rCP3.js} +1 -1
  26. package/console-dist/assets/use-platform-stream-QBU2PAD2.js +2 -0
  27. package/console-dist/assets/{use-transition-navigate-CUOoK-a_.js → use-transition-navigate-Br9xwrqi.js} +1 -1
  28. package/console-dist/assets/{validation-XGNj2nVO.js → validation-pFKbjwNg.js} +1 -1
  29. package/console-dist/index.html +19 -19
  30. package/miravo +0 -0
  31. package/package.json +1 -1
  32. package/console-dist/assets/catalog-CFU1TdO9.js +0 -1
  33. package/console-dist/assets/catalog-DSNME88V.js +0 -1
  34. package/console-dist/assets/catalog-source-ChUAD0NL.js +0 -1
  35. package/console-dist/assets/control-Cl3BCzup.js +0 -1
  36. package/console-dist/assets/events-9ouwtfN4.js +0 -1
  37. package/console-dist/assets/fleet-C5IPKrdf.js +0 -1
  38. package/console-dist/assets/index-D1lU9Fg9.css +0 -2
  39. package/console-dist/assets/models-D_OCpWPE.js +0 -1
  40. package/console-dist/assets/models-NVvJNhiz.js +0 -1
  41. package/console-dist/assets/platforms-BNTV1g6K.js +0 -1
  42. package/console-dist/assets/platforms-D024zTxj.js +0 -1
  43. package/console-dist/assets/tags-BTciN0-X.js +0 -1
  44. package/console-dist/assets/use-platform-stream-8tr6SVec.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{C as r,S as i,T as a,f as o,m as s,p as c,t as l,w as u}from"./api-CrYvIV3A.js";import{t as d,u as f}from"./proxy-Be4WzmcS.js";import{t as p}from"./AnimatePresence-CPmH1DMY.js";import{a as m,i as h,l as g,n as _,o as v,r as ee,s as te,t as y}from"./copy-button-BvU3RDZa.js";import{S as b,T as x,w as S,x as C}from"./format-CshN6yEB.js";import{n as w,t as T}from"./utils-XFKvwlFT.js";import{a as E,c as D,i as O,l as ne,n as k,o as A,r as j,s as M,t as N}from"./select-CmlY1M1a.js";import{i as P,n as F,r as I,t as L}from"./platform-targets-BIQ1lKOg.js";import{a as R,c as z,o as B,s as V}from"./tabs-4SeH2unv.js";import{t as H}from"./circle-question-mark-CJvcT6V6.js";import{i as re,n as ie,r as ae,t as oe}from"./checkbox-C_4HRnS_.js";import{t as se}from"./triangle-alert-BXrJNk3g.js";import{i as U,n as W,t as G}from"./tooltip-D1ydB4g3.js";import{t as ce}from"./badge-eIn_7YrK.js";import{t as K}from"./label-CMBWxUhA.js";import{n as le,t as ue}from"./get-error-message-BgE2BpPG.js";var de=w(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),fe=w(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),pe=w(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),me=w(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),he=w(`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`}]]),ge=w(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),_e=w(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ve=w(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ye=w(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),be=w(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),xe=w(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Se=w(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),q=e(t(),1),J=n();function Y({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`skeleton`,className:T(`animate-pulse rounded-[var(--miravo-radius-tight)] bg-muted`,e),...t})}var Ce=[`devices`,`models`,`instances`],we=[`instances`,`models`,`devices`],Te={label:`Alias policy`,value:`Miravo hyphens, LE underscores`},Ee=[{label:`Protocol`,value:`Template defaults`},Te],De={devices:`DeviceHub devices`,models:`Digital Twins models`,instances:`Digital Twins instances`},Oe={devices:{apply:`DeviceHub device records and settings on Litmus Edge.`,cleanup:`Remove DeviceHub device records managed from Miravo.`},models:{apply:`Digital Twins model definitions synced to the platform.`,cleanup:`Remove Digital Twins model definitions created by Miravo.`},instances:{apply:`Digital Twins instances bound to DeviceHub devices.`,cleanup:`Remove Digital Twins instances deployed for this target.`}},ke=`Miravo calls this API.`;function Ae(e){return e.length>120?`Use at most 120 characters.`:/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)?null:`Use lowercase letters, numbers, and hyphens only (e.g. motor-001).`}function je(e){return e.replace(/-/g,`_`)}function Me({targetId:e,model:t,protocol:n,result:r}){return{targetId:e,model:t,protocol:n,scope:r.scope,deviceName:r.deviceName,ifUnmanaged:r.ifUnmanaged}}function Ne({targetId:e,template:t,result:n,protocol:r}){return{targetId:e,template:t,...r?{protocol:r}:{},scope:n.scope,ifUnmanaged:n.ifUnmanaged}}function Pe({targetId:e,template:t,allManaged:n,result:r}){return{targetId:e,...n?{allManaged:!0}:{template:t},scope:r.scope}}var X=`Source host (Miravo)`,Fe=`Address Litmus Edge uses to reach your running Miravo environment.`;function Ie({open:e,onOpenChange:t,type:n,label:r,targetLabel:i,hostname:a,sourceHostname:o,onConfirm:s,defaultDeviceName:c,metadata:l=[],applyPreview:u,cleanupPreview:f}){let p=n===`apply`?Ce:we,[g,v]=(0,q.useState)(new Set(p)),[y,x]=(0,q.useState)(!1),[S,w]=(0,q.useState)(!1),[E,D]=(0,q.useState)(``),[O,k]=(0,q.useState)(null),[A,j]=(0,q.useState)(`fail`),M=(0,q.useId)(),N=(0,q.useId)(),P=`if-unmanaged-${N}`,F=n===`apply`,I=F&&c!==void 0&&c!==``,L=(E.trim()===``?c??``:E.trim().toLowerCase()).trim(),R=L?je(L):``;(0,q.useEffect)(()=>{e&&(v(new Set(p)),x(!1),k(null),D(I?c??``:``),j(`fail`),w(!1))},[e,p,I,c]);let z={instances:`models`},B=e=>{v(t=>{let n=new Set(t);if(n.has(e)){n.delete(e);for(let[t,r]of Object.entries(z))r===e&&n.delete(t)}else{n.add(e);let t=z[e];t&&n.add(t)}return n})},V=F?u:f,re=()=>{let e=p.filter(e=>g.has(e));if(e.length===0)return null;if(I){let t=L,n=Ae(t);return n?(k(n),null):(k(null),{scope:e,deviceName:t,ifUnmanaged:A})}return{scope:e,ifUnmanaged:A}},ie=e=>{V?.onPreview(e),t(!1)};return(0,J.jsx)(_,{open:e,onOpenChange:t,children:(0,J.jsxs)(ee,{showCloseButton:!0,className:`flex max-h-[90vh] min-h-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-120`,children:[(0,J.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 px-5 pb-3 pt-5`,children:[(0,J.jsxs)(te,{className:`flex items-center gap-2 text-sm font-semibold leading-snug`,children:[F?(0,J.jsx)(ae,{className:`size-3.5 shrink-0 text-primary`,"aria-hidden":!0}):(0,J.jsx)(Se,{className:`size-3.5 shrink-0 text-destructive`,"aria-hidden":!0}),F?`Apply to Litmus Edge`:`Clean up Litmus Edge`]}),(0,J.jsx)(h,{className:`sr-only`,children:F?`Review connection details and scope before applying.`:`Review target and cleanup scope before confirming.`})]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 pt-4 pb-3`,children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,J.jsx)(`div`,{className:`text-xs leading-snug`,children:(0,J.jsxs)(`dl`,{className:`flex flex-col gap-0`,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5 first:pt-0`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px text-[11px] font-medium text-muted-foreground`,children:F?`Resource`:`Target`}),(0,J.jsx)(`dd`,{className:`min-w-0 wrap-break-word font-medium text-foreground`,children:r})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px text-[11px] font-medium text-muted-foreground`,children:`Target`}),(0,J.jsx)(`dd`,{className:`min-w-0 wrap-break-word font-medium text-foreground`,children:i})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px`,children:(0,J.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[11px] font-medium leading-snug text-muted-foreground`,children:`Litmus Edge API`}),(0,J.jsxs)(G,{children:[(0,J.jsx)(U,{type:`button`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`About Litmus Edge API`,children:(0,J.jsx)(H,{className:`size-3`,"aria-hidden":!0})}),(0,J.jsx)(W,{side:`top`,align:`start`,className:`max-w-xs text-left`,children:ke})]})]})}),(0,J.jsx)(`dd`,{className:`min-w-0`,children:(0,J.jsx)(`span`,{className:`break-all font-mono text-[11px] leading-normal text-foreground/90`,children:a})})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px`,children:(0,J.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[11px] font-medium leading-snug text-muted-foreground`,children:X}),(0,J.jsxs)(G,{children:[(0,J.jsx)(U,{type:`button`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`About ${X}`,children:(0,J.jsx)(H,{className:`size-3`,"aria-hidden":!0})}),(0,J.jsx)(W,{side:`top`,align:`start`,className:`max-w-xs text-left`,children:Fe})]})]})}),(0,J.jsx)(`dd`,{className:`min-w-0`,children:(0,J.jsx)(`span`,{className:`break-all font-mono text-[11px] leading-normal text-foreground/90`,children:o})})]}),I&&L?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px text-[11px] font-medium text-muted-foreground`,children:`Miravo instance ID`}),(0,J.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-[11px] leading-normal text-foreground/90`,children:L})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px text-[11px] font-medium text-muted-foreground`,children:`Litmus Edge alias`}),(0,J.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-[11px] leading-normal text-foreground/90`,children:R})]})]}):null,l.map(e=>(0,J.jsxs)(`div`,{className:`grid grid-cols-2 items-start gap-x-4 border-b border-border/35 py-2.5`,children:[(0,J.jsx)(`dt`,{className:`min-w-0 pt-px text-[11px] font-medium text-muted-foreground`,children:e.label}),(0,J.jsx)(`dd`,{className:`min-w-0 wrap-break-word font-medium text-foreground`,children:e.value})]},`${e.label}:${e.value}`))]})}),V?(0,J.jsxs)(K,{className:T(`flex cursor-pointer items-center gap-2.5 text-[11px] font-medium leading-snug`,V.disabled&&`pointer-events-none opacity-50`),children:[(0,J.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,J.jsx)(oe,{checked:S,onCheckedChange:e=>w(e===!0),disabled:V.disabled})}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 leading-snug`,children:F?`Dry run only — preview the plan without deploying`:`Dry run only — preview the plan without removing resources`})]}):null,I?(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(K,{htmlFor:M,className:`text-[11px] font-medium`,children:`Miravo instance ID`}),(0,J.jsx)(C,{id:M,value:E,onChange:e=>{D(e.target.value),k(null)},placeholder:c,autoComplete:`off`,spellCheck:!1,className:T(`h-9 font-mono text-xs`,O&&`border-destructive`),"aria-invalid":O!=null,"aria-describedby":`${M}-hint`}),(0,J.jsx)(`p`,{id:`${M}-hint`,className:`text-[11px] leading-snug text-foreground/76`,children:`Same instance ID on a later run updates this asset; hyphens stay in Miravo.`}),R?(0,J.jsxs)(`p`,{className:`text-[11px] leading-snug text-foreground/76`,children:[`LE alias`,` `,(0,J.jsxs)(`span`,{className:`font-mono text-foreground`,children:[L,` -> `,R]})]}):null,O?(0,J.jsx)(`p`,{className:`text-[11px] text-destructive`,children:O}):null]}):null,(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center justify-between gap-2 rounded-[var(--miravo-radius-tight)] bg-muted/40 px-2.5 py-2 text-left text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground aria-expanded:bg-muted/55 aria-expanded:text-foreground`,onClick:()=>x(e=>!e),"aria-expanded":y,children:[`Advanced`,(0,J.jsx)(ne,{className:T(`size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-hover:text-foreground/80`,y?`duration-500 rotate-180 text-foreground/80`:`duration-280`),"aria-hidden":!0})]}),(0,J.jsxs)(d.div,{initial:!1,animate:{maxHeight:y?520:0,opacity:+!!y},transition:{maxHeight:{duration:y?.52:.28,ease:y?[.16,1,.3,1]:[.4,0,.2,1]},opacity:{duration:y?.42:.24,ease:y?[.16,1,.3,1]:[.4,0,.2,1]}},className:T(`overflow-hidden`,!y&&`pointer-events-none`),"aria-hidden":!y,inert:!y,children:[(0,J.jsx)(`div`,{className:`flex flex-col gap-1 pt-px`,children:p.map(e=>{let t=Object.entries(z).find(([t,n])=>n===e)?.[0],n=t!==void 0&&g.has(t),r=F?Oe[e].apply:Oe[e].cleanup;return(0,J.jsxs)(K,{htmlFor:`scope-${e}`,className:T(`flex min-h-9 cursor-pointer items-start gap-2 rounded-[var(--miravo-radius-tight)] border border-border/40 bg-muted/10 px-2.5 py-1.5 text-[11px] transition-colors`,n?`opacity-95`:`hover:bg-muted/25`),children:[(0,J.jsx)(`span`,{className:`pt-0.5`,children:(0,J.jsx)(oe,{id:`scope-${e}`,checked:g.has(e),disabled:n,onCheckedChange:()=>B(e)})}),(0,J.jsxs)(`span`,{className:`min-w-0 flex-1 leading-snug`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground`,children:De[e]}),(0,J.jsx)(`span`,{className:`mt-0.5 block text-[11px] font-normal leading-tight text-muted-foreground`,children:r})]}),n?(0,J.jsx)(`span`,{className:`shrink-0 self-start rounded-[var(--miravo-radius-tight)] border border-primary/35 bg-primary/10 px-1.5 py-px text-[10px] font-semibold uppercase tracking-wide text-primary`,title:`Required when Digital Twins instances are selected (models must stay in scope).`,children:`Required`}):null]},e)})}),F&&(0,J.jsxs)(`div`,{className:`mt-2.5 space-y-1.5 border-t border-border/40 pt-2`,children:[(0,J.jsx)(`p`,{id:`${N}-legend`,className:`text-[11px] font-medium uppercase tracking-wide text-foreground/80`,children:`Collision policy`}),(0,J.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`${N}-legend`,className:`flex flex-col gap-1`,children:[(0,J.jsxs)(K,{htmlFor:`if-unmanaged-fail`,className:T(`flex cursor-pointer items-start gap-2 rounded-[var(--miravo-radius-tight)] border px-2.5 py-2 text-[11px] transition-colors`,A===`fail`?`border-primary/45 bg-primary/8`:`border-border/40 bg-muted/10 hover:bg-muted/25`),children:[(0,J.jsx)(`input`,{id:`if-unmanaged-fail`,type:`radio`,name:P,value:`fail`,checked:A===`fail`,onChange:()=>j(`fail`),className:`mt-0.5 size-3.5 shrink-0 accent-primary`}),(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground`,children:`Fail if unmanaged exists`}),(0,J.jsx)(`span`,{className:`mt-px block text-[11px] leading-tight text-foreground/74`,children:`Stop if the target has unmanaged resources.`})]})]}),(0,J.jsxs)(K,{htmlFor:`if-unmanaged-skip`,className:T(`flex cursor-pointer items-start gap-2 rounded-[var(--miravo-radius-tight)] border px-2.5 py-2 text-[11px] transition-colors`,A===`skip`?`border-primary/45 bg-primary/8`:`border-border/40 bg-muted/10 hover:bg-muted/25`),children:[(0,J.jsx)(`input`,{id:`if-unmanaged-skip`,type:`radio`,name:P,value:`skip`,checked:A===`skip`,onChange:()=>j(`skip`),className:`mt-0.5 size-3.5 shrink-0 accent-primary`}),(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground`,children:`Skip unmanaged resources`}),(0,J.jsx)(`span`,{className:`mt-px block text-[11px] leading-tight text-foreground/74`,children:`Only update resources managed by Miravo.`})]})]})]})]})]}),g.size===0&&!(S&&V)?(0,J.jsx)(`p`,{className:`text-[11px] text-destructive`,children:`Select at least one scope or reopen to reset.`}):null]})]})}),(0,J.jsxs)(m,{className:`mx-0 mb-0 shrink-0 flex flex-col gap-2 border-t border-border/60 px-5 py-4 sm:flex-row sm:justify-end`,children:[(0,J.jsx)(b,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:`Cancel`}),(0,J.jsx)(b,{type:`button`,variant:F||S&&f?`default`:`destructive`,onClick:()=>{let e=re();if(e){if(S&&V){ie(e);return}s(e)}},disabled:S&&V?V.disabled||V.planLoading:g.size===0,children:F?S&&u?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ye,{className:`size-3`,"aria-hidden":!0}),`Preview changes`]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ae,{className:`size-3`,"aria-hidden":!0}),`Apply`]}):S&&f?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ye,{className:`size-3`,"aria-hidden":!0}),`Preview changes`]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Se,{className:`size-3`,"aria-hidden":!0}),`Clean up`]})})]})]})})}var Le={initial:{scale:0,opacity:0},animate:{scale:1,opacity:1,originY:0},exit:{scale:0,opacity:0},transition:{type:`spring`,stiffness:350,damping:40}},Re={initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{type:`tween`,duration:.22,ease:[.16,1,.3,1]}};function ze({children:e,variant:t=`default`}){let n=t===`default`;return(0,J.jsx)(d.div,{...n?Le:Re,layout:n,className:`mx-auto w-full`,children:e})}var Be=q.memo(({children:e,className:t,delay:n=1e3,...r})=>{let[i,a]=(0,q.useState)(0),o=(0,q.useMemo)(()=>q.Children.toArray(e),[e]);(0,q.useEffect)(()=>{let e=null;return i<o.length-1&&(e=setTimeout(()=>{a(e=>(e+1)%o.length)},n)),()=>{e!==null&&clearTimeout(e)}},[i,n,o.length]);let s=(0,q.useMemo)(()=>o.slice(0,i+1).reverse(),[i,o]);return(0,J.jsx)(`div`,{className:T(`flex flex-col items-center gap-4`,t),...r,children:(0,J.jsx)(p,{children:s.map(e=>(0,J.jsx)(ze,{children:e},e.key))})})});Be.displayName=`AnimatedList`;var Ve=`could not load certificate or private key from pki`;function He(e){return e.status===`running`?e.operation?e.operation.type===`apply`?`Apply`:`Cleanup`:`Connecting`:e.status===`error`?`Failed`:e.operation&&e.status===`complete`?e.operation.status===`cancelled`?`Cancelled`:`Complete`:null}function Ue(e){return(e?.toLowerCase()??``).includes(Ve)}function We(e,t){if(e===`cleanup`)return`Try cleanup again to resume.`;let n=t?.toLowerCase()??``;return Ue(t)?`Litmus Edge DeviceHub could not start the OPC UA device because its PKI files are broken. Delete the stopped device in DeviceHub, repair /var/lib/loopedge-dh/db/OPC_UA_Client_Advanced/, then run apply again.`:n.includes(`unmanaged device`)||n.includes(`unmanaged instance`)?`Update the collision policy, try apply again to resume, or clean up the created resources.`:`Try apply again to resume, or clean up the created resources.`}function Ge(e){let t=e.operation,n=t?.type===`apply`?`apply`:`cleanup`;switch(e.status){case`running`:return{title:`Operation in progress`,subtitle:`Streaming ${n} steps to Litmus Edge`};case`complete`:return t?.status===`cancelled`?{title:`Operation cancelled`,subtitle:`Stopped — resources created so far remain in Litmus Edge.`}:{title:`Operation complete`,subtitle:n===`apply`?`Apply finished — review the summary below.`:`Cleanup finished — review the summary below.`};case`error`:return{title:`Operation failed`,subtitle:t?.type===`apply`&&Ue(e.error??t?.error)?`OPC UA device stopped on Litmus Edge — repair DeviceHub PKI and retry apply.`:e.error??t?.error??`The operation ended with an error.`};default:return{title:`Operation`,subtitle:``}}}function Ke({type:e,errorMessage:t,className:n}){let r=We(e,t);return(0,J.jsxs)(`div`,{className:T(`flex items-start gap-1.5 rounded-[var(--miravo-radius-tight)] border border-info/40 bg-info/10 px-2.5 py-1.5 text-[10px] font-medium leading-relaxed`,n),children:[(0,J.jsx)(re,{className:`mt-0.5 size-3 shrink-0 text-info`,"aria-hidden":!0}),(0,J.jsx)(`p`,{className:`min-w-0 flex-1 text-left whitespace-normal break-words text-foreground/80 [overflow-wrap:anywhere]`,children:r})]})}var qe=`text-destructive hover:bg-destructive/25 hover:text-foreground`,Je={device:`Devices`,tags:`Tags`,model:`Models`,instance:`Instances`,"param-sync":`Parameters`};function Ye(e){return Je[e]??e}function Xe(e){switch(e){case`create`:return`border border-success/30 bg-success/15 text-success`;case`update`:return`border border-chart-3/30 bg-chart-3/15 text-chart-3`;case`replace`:return`border border-warning/30 bg-warning/15 text-warning`;case`delete`:return`border border-destructive/30 bg-destructive/15 text-destructive`;case`noop`:return`border border-border/60 bg-muted/70 text-foreground/75`;default:return`border border-border/50 bg-muted/80 text-foreground/85`}}function Ze(e){return e===`noop`?`no-op`:e}function Qe({status:e}){switch(e){case`success`:return(0,J.jsx)(z,{className:`size-3.5 shrink-0 text-success`});case`failed`:return(0,J.jsx)(V,{className:`size-3.5 shrink-0 text-destructive`});case`pending`:return(0,J.jsx)(B,{className:`size-3.5 shrink-0 animate-spin text-primary/90`})}}function $e({status:e}){switch(e){case`done`:return(0,J.jsx)(z,{className:`size-3.5 text-success`});case`active`:return(0,J.jsx)(B,{className:`size-3.5 animate-spin text-primary`});case`pending`:return(0,J.jsx)(me,{className:`size-3.5 text-foreground/55`})}}function et({entry:e}){let[t,n]=(0,q.useState)(!1);return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsxs)(`button`,{type:`button`,className:T(`flex items-center gap-2 rounded-[var(--miravo-radius-tight)] px-2 py-1 text-left transition-colors`,e.error?`cursor-pointer hover:bg-muted/40`:`cursor-default`),onClick:()=>e.error&&n(!t),disabled:!e.error,children:[(0,J.jsx)(Qe,{status:e.status}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-foreground`,children:e.name}),(0,J.jsx)(`span`,{className:T(`inline-flex rounded-[var(--miravo-radius-tight)] px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wider`,Xe(e.action)),children:Ze(e.action)}),e.error&&(0,J.jsx)(ne,{className:T(`size-3 text-foreground/75 transition-transform`,t&&`rotate-180`)})]}),(0,J.jsx)(p,{initial:!1,children:t&&e.error&&(0,J.jsxs)(d.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.18},className:`overflow-hidden`,children:[(0,J.jsxs)(`div`,{className:`mb-0 flex min-w-0 w-full items-center gap-1.5 rounded-[var(--miravo-radius-tight)] border border-destructive/40 bg-destructive/15 px-2.5 py-1.5 text-[10px] font-medium leading-relaxed`,children:[(0,J.jsx)(`p`,{className:`min-w-0 flex-1 text-left whitespace-normal break-words text-destructive [overflow-wrap:anywhere]`,children:e.error}),(0,J.jsx)(y,{value:e.error,label:`Copy error`,className:T(qe,`shrink-0`)})]}),(0,J.jsx)(Ke,{type:`apply`,errorMessage:e.error,className:`mb-1 mt-2.5 w-full min-w-0`})]})})]})}function tt({phase:e,open:t,onOpenChange:n}){let r=e.resources.length,i=r===e.total,a=e.resources.length>0;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsxs)(`button`,{type:`button`,className:T(`flex w-full items-center gap-2 rounded-[var(--miravo-radius-tight)] px-1 py-1 text-left transition-colors`,a&&`hover:bg-muted/40`,!a&&`cursor-default`),disabled:!a,"aria-expanded":a?t:void 0,onClick:()=>a&&n(!t),children:[(0,J.jsx)($e,{status:e.status}),(0,J.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-foreground`,children:Ye(e.name)}),(0,J.jsxs)(`span`,{className:`font-mono text-[10px] text-foreground/70`,children:[r,`/`,e.total]}),(0,J.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1.5`,children:[i&&e.status===`done`&&(0,J.jsx)(z,{className:`size-3 text-success`}),a&&(0,J.jsx)(ne,{className:T(`size-3 text-foreground/75 transition-transform`,!t&&`-rotate-90`),"aria-hidden":!0})]})]}),(0,J.jsx)(p,{initial:!1,children:a&&t&&(0,J.jsx)(d.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.25,ease:[.16,1,.3,1]},className:`overflow-hidden`,children:(0,J.jsx)(`div`,{className:`ml-2 flex min-w-0 flex-col border-l border-border/55 pl-2.5 pr-1.5 pb-1 pt-0.5`,children:(0,J.jsx)(f.Provider,{value:null,children:e.resources.map((e,t)=>(0,J.jsx)(ze,{variant:`subtle`,children:(0,J.jsx)(et,{entry:e})},`${e.name}-${t}`))})})})})]})}function nt({operation:e}){let t=e.status===`complete`,n=e.status===`cancelled`,r=e.failed>0,i=e.totalPlanned>0?Math.min(100,it(e)/e.totalPlanned*100):0;return(0,J.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-muted/55`,role:`progressbar`,"aria-valuenow":Math.round(i),"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Operation progress`,children:(0,J.jsx)(d.div,{"aria-hidden":`true`,className:T(`h-full rounded-full transition-colors duration-500`,n?`bg-foreground/30`:t&&!r?`bg-success`:`bg-warning`),initial:{width:`0%`},animate:{width:`${i}%`},transition:{duration:.4,ease:[.25,.1,.25,1]}})})}function rt(e){return e.duration==null?(Date.now()-e.startedAt)/1e3:e.duration/1e3}function it(e){let t=e.applied+e.failed;return e.totalPlanned>0?Math.min(t,e.totalPlanned):t}function at(e,t){let n=e.label;return t?.length?t.find(e=>e.id===n)?.name??n:n}var ot={complete:{Icon:z,className:`size-4 text-success`},partial:{Icon:pe,className:`size-4 text-warning`},cancelled:{Icon:de,className:`size-4 text-foreground/65`},error:{Icon:V,className:`size-4 text-destructive`},running:{Icon:B,className:`size-4 animate-spin text-warning`}};function st({icon:e,className:t}){return(0,J.jsx)(d.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:`spring`,stiffness:500,damping:30},className:`shrink-0`,children:(0,J.jsx)(e,{className:t})})}function ct({operation:e,sourceLabel:t,isAllExpanded:n,onToggleAll:r}){let i=rt(e),a=it(e),o=e.status===`complete`,s=e.status===`cancelled`,c=e.status===`error`,l=e.failed>0,u=o&&!l?`complete`:o&&l?`partial`:s?`cancelled`:c?`error`:`running`,f=ot[u];return(0,J.jsxs)(`div`,{className:T(`sticky top-0 z-10 flex min-w-0 w-full flex-col gap-1.5 rounded-[var(--miravo-radius-stadium-sm)] border px-3 pt-2.5 pb-3.5 backdrop-blur-sm transition-colors duration-500`,o&&!l&&`border-success/30 bg-success/5`,o&&l&&`border-warning/30 bg-warning/5`,s&&`border-border/60 bg-muted/50`,c&&`border-destructive/30 bg-destructive/5`,!o&&!s&&!c&&`border-warning/20 bg-warning/5`),children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,J.jsx)(p,{mode:`wait`,initial:!1,children:(0,J.jsx)(st,{icon:f.Icon,className:f.className},u)}),(0,J.jsx)(`span`,{className:`text-xs font-medium leading-none text-foreground`,children:s?`Cancelled`:o?l?`Completed with errors`:`Complete`:c?`Failed`:e.retryPending?`Failed, retrying attempt ${e.attempt?e.attempt+1:2}/${e.maxAttempts} in ${e.retryDelayMs?e.retryDelayMs/1e3:3}s...`:e.attempt&&e.maxAttempts&&e.attempt>1?`Retrying attempt ${e.attempt}/${e.maxAttempts}...`:e.type===`apply`?`Applying...`:`Cleaning up...`}),(0,J.jsxs)(`span`,{className:`w-full min-w-0 text-[10px] leading-tight text-foreground/78`,children:[(0,J.jsx)(`span`,{className:`font-sans break-words`,children:t}),(0,J.jsx)(`span`,{className:`font-mono break-words`,children:` → ${e.environment}`})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,J.jsx)(ce,{variant:`secondary`,className:`h-5 min-h-5 gap-0 overflow-hidden border border-border/50 bg-muted/70 px-1.5 !py-0 font-mono text-[10px] leading-none text-foreground shadow-sm [&>span]:inline-flex [&>span]:items-center`,children:(0,J.jsxs)(`span`,{className:`gap-1`,children:[(0,J.jsx)(p,{mode:`popLayout`,initial:!1,children:(0,J.jsx)(d.span,{initial:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:{type:`spring`,stiffness:500,damping:35},className:`inline tabular-nums`,children:a},a)}),`/`,e.totalPlanned,(0,J.jsx)(`span`,{className:`text-foreground/72`,children:e.type===`apply`?`applied`:`deleted`})]})}),(0,J.jsx)(p,{initial:!1,children:e.failed>0&&(0,J.jsx)(d.div,{className:`inline-flex items-center`,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:500,damping:30},children:(0,J.jsxs)(ce,{variant:`destructive`,className:`h-5 min-h-5 gap-0 border border-destructive/35 bg-destructive/20 px-1.5 !py-0 font-mono text-[10px] font-semibold leading-none text-destructive`,children:[e.failed,` failed`]})})})]}),(0,J.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono text-[10px] leading-none text-foreground/75`,children:[(0,J.jsx)(ge,{className:`size-3 shrink-0 block text-foreground/65`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`tabular-nums leading-none`,children:typeof i==`number`?`${i.toFixed(1)}s`:`...`})]}),r&&(0,J.jsx)(`div`,{className:`flex items-center border-l border-border/40 pl-2`,children:(0,J.jsx)(`button`,{type:`button`,onClick:r,className:`flex size-4.5 items-center justify-center rounded-[var(--miravo-radius-tight)] text-foreground/55 transition-colors hover:bg-muted/60 hover:text-foreground`,"aria-label":n?`Collapse all phases`:`Expand all phases`,title:n?`Collapse all`:`Expand all`,children:(0,J.jsx)(fe,{className:T(`size-3.5 transition-transform duration-300`,!n&&`opacity-70 scale-y-[-1]`)})})})]})]}),(0,J.jsx)(nt,{operation:e})]})]})}function lt(e){return e?e.closest(`[data-edge-op-scroll]`)??e.closest(`.overflow-y-auto`):null}var ut=350;function Z(e){e?.scrollIntoView({block:`end`,behavior:`auto`,inline:`nearest`})}function dt(e){let t=()=>Z(e);t(),requestAnimationFrame(t),requestAnimationFrame(()=>requestAnimationFrame(t)),window.setTimeout(t,0),window.setTimeout(t,48),window.setTimeout(t,120)}function ft({logs:e}){return e.length===0?null:(0,J.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-2 pb-2`,children:e.map(e=>(0,J.jsxs)(`div`,{className:T(`flex min-w-0 items-start gap-2 rounded-[var(--miravo-radius-tight)] border px-2.5 py-2 text-xs`,e.level===`error`?`border-destructive/35 bg-destructive/12 text-destructive`:e.level===`warn`?`border-warning/35 bg-warning/12 text-warning`:`border-primary/25 bg-primary/8 text-foreground/82`),children:[e.level===`info`?(0,J.jsx)(re,{className:`mt-0.5 size-3.5 shrink-0 text-primary`,"aria-hidden":!0}):(0,J.jsx)(pe,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`min-w-0 wrap-anywhere`,children:e.message})]},e.id))})}function pt({operation:e,catalogTemplates:t,logs:n}){let r=(0,q.useRef)(null),i=(0,q.useRef)(null),a=(0,q.useRef)(!0),o=(0,q.useRef)(e.status);o.current=e.status;let s=(0,q.useRef)(!1),[c,l]=(0,q.useState)(new Set),u=(0,q.useMemo)(()=>at(e,t),[e,t]);(0,q.useLayoutEffect)(()=>{let e=lt(r.current);if(!e)return;let t=()=>{a.current=e.scrollHeight-e.scrollTop-e.clientHeight<ut};return e.addEventListener(`scroll`,t,{passive:!0}),t(),()=>{e.removeEventListener(`scroll`,t)}},[]),(0,q.useLayoutEffect)(()=>{if(e.status===`running`){a.current&&Z(i.current),s.current=!0;return}s.current&&=(dt(i.current),!1)},[e.status,e.applied,e.failed,e.phases]),(0,q.useEffect)(()=>{if(e.status!==`running`)return;let t=r.current;if(!t)return;let n=0,s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>{o.current===`running`&&a.current&&Z(i.current)})});return s.observe(t),a.current&&Z(i.current),()=>{s.disconnect(),cancelAnimationFrame(n)}},[e.status]);let f=e.phases.length>0,m=c.size===0;return(0,J.jsxs)(`div`,{ref:r,className:`flex min-w-0 w-full flex-col gap-2`,children:[(0,J.jsx)(ct,{operation:e,sourceLabel:u,isAllExpanded:m,onToggleAll:f?()=>{l(m?new Set(e.phases.map(e=>e.name)):new Set)}:void 0}),(0,J.jsx)(`div`,{className:`flex flex-col gap-1 px-2 pt-2 pb-4`,children:e.phases.map(e=>(0,J.jsx)(`div`,{children:(0,J.jsx)(tt,{phase:e,open:!c.has(e.name),onOpenChange:t=>{l(n=>{let r=new Set(n);return t?r.delete(e.name):r.add(e.name),r})}})},e.name))}),(0,J.jsx)(p,{initial:!1,children:e.error&&e.retryPending&&(0,J.jsxs)(d.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:`sticky bottom-2 z-20 mx-2 mt-auto mb-2 flex items-center gap-2 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-destructive/40 bg-destructive/15 px-3 py-2 text-xs font-medium text-destructive shadow-md backdrop-blur-md`,children:[(0,J.jsx)(B,{className:`size-4 shrink-0 animate-spin`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.error})]})}),(0,J.jsx)(p,{initial:!1,children:e.error&&e.status===`error`&&(0,J.jsxs)(d.div,{initial:{opacity:0,height:0,marginTop:0},animate:{opacity:1,height:`auto`,marginTop:8},exit:{opacity:0,height:0,marginTop:0},transition:{duration:.2},className:`mx-2 mb-4 flex min-w-0 flex-col gap-0 overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-destructive/40 bg-destructive/15 px-3 py-2 text-xs font-medium`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`p`,{className:`min-w-0 flex-1 text-left wrap-anywhere text-destructive`,children:e.error}),(0,J.jsx)(y,{value:e.error,label:`Copy error`,className:T(qe,`shrink-0`)})]}),(0,J.jsx)(Ke,{type:e.type,errorMessage:e.error,className:`mt-3 w-full min-w-0`})]})}),n&&n.length>0?(0,J.jsx)(ft,{logs:n}):null,(0,J.jsx)(`div`,{ref:i,className:`h-px w-full shrink-0`,"aria-hidden":!0})]})}function mt({format:e,kind:t}){return e===`source-yaml`?t===`model`?`Raw twin model definition. Edit locally, version-control, or use as input for the CLI.`:`Raw environment definition with topology and namespace. Edit, share, or apply via CLI.`:e===`litmus-edge`?t===`model`?`Litmus Edge Digital Twin JSON for manual import via the LE UI or GraphQL API.`:`Litmus Edge template JSON (DeviceHub devices + Digital Twins). Import directly via the Litmus Edge UI.`:`Select a format to download.`}function ht({children:e,className:t}){return(0,J.jsx)(`div`,{className:T(`max-h-[min(36rem,75vh)] min-h-0 overflow-y-auto rounded-[var(--miravo-radius-stadium-sm)] border border-border/60 p-4 sm:p-5`,t),children:e})}function gt({title:e,subtitle:t,footerAction:n,canDismiss:r=!0,onDismiss:i,children:a}){return(0,q.useEffect)(()=>{function e(e){e.key===`Escape`&&r&&i()}return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[r,i]),(0,J.jsx)(d.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:16},transition:{type:`spring`,stiffness:380,damping:30},className:`pointer-events-none fixed bottom-4 left-4 right-4 z-[60] sm:left-auto sm:w-full sm:max-w-md`,children:(0,J.jsxs)(ht,{className:`pointer-events-auto flex flex-col overflow-hidden border-border/70 bg-background p-0 shadow-lg shadow-black/15 ring-1 ring-border/50 backdrop-blur-sm sm:p-0 bg-background shadow-black/50`,children:[(0,J.jsxs)(`div`,{className:`flex shrink-0 items-start gap-2 border-b border-border/45 p-2.5 pb-2 sm:p-3 sm:pb-2`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,J.jsx)(R,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(`p`,{className:`font-heading text-xs font-semibold tracking-tight text-foreground`,children:e}),t?(0,J.jsx)(`p`,{className:`text-[11px] leading-snug text-foreground/80`,children:t}):null]})]}),r?(0,J.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-xs`,className:`shrink-0 text-foreground/70 hover:bg-muted/80 hover:text-foreground`,onClick:i,"aria-label":`Dismiss operation panel`,children:(0,J.jsx)(S,{className:`size-3.5`,"aria-hidden":!0})}):null]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2.5 pt-2.5 sm:px-3 sm:pt-3`,"data-edge-op-scroll":``,children:a}),n?(0,J.jsx)(`div`,{className:`flex w-full shrink-0 min-w-0 items-center gap-2 border-t border-border/40 bg-muted/15 p-2.5 sm:p-3`,children:n}):null]})})}var _t={...Object.fromEntries(P.map(e=>[e.id,e.exportLabel])),"source-yaml":`Source YAML`};function vt(e){return e==null||e===``?`Select platform`:typeof e==`string`?_t[e]??e:`Select platform`}function yt(e){return P.find(t=>t.id===e)?.label??e}function Q({id:e,label:t,hint:n,className:r,labelAdornment:i,children:a}){return(0,J.jsxs)(`div`,{className:T(`flex flex-col gap-2`,r),children:[(0,J.jsxs)(`div`,{className:`space-y-1`,children:[(0,J.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1`,children:[(0,J.jsx)(K,{htmlFor:e,className:`text-[11px] font-medium text-foreground`,children:t}),i]}),n?(0,J.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n}):null]}),a]})}function bt({open:e,editing:t,platformId:n,form:r,showToken:i,saving:a,testing:o,canTestConnection:s,onOpenChange:c,onPlatformChange:l,onFormChange:u,onShowTokenChange:d,onSave:f,onTestConnection:p,onCancelInFlight:g}){let y=n===I.id,x=t?`Edit Target`:`Add Target`,S=t?`Update the deployment connection.`:`Add the target used for platform deploys.`,w=t?`Leave empty to keep the current token.`:`Required for the first save and connection test.`;return(0,J.jsx)(_,{open:e,onOpenChange:e=>{e||g(),c(e)},children:(0,J.jsxs)(ee,{showCloseButton:!0,className:`flex max-h-[min(84vh,38rem)] min-h-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-[38rem]`,children:[(0,J.jsxs)(v,{className:`shrink-0 border-b border-border/60 px-4 pb-3.5 pt-4 pr-12 sm:px-5 sm:pr-14`,children:[(0,J.jsx)(te,{className:`text-base tracking-tight`,children:x}),(0,J.jsx)(h,{className:`max-w-xl text-sm leading-relaxed`,children:S})]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 sm:px-5`,style:{scrollbarGutter:`stable`},children:(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[t?(0,J.jsx)(Q,{label:`Platform`,children:(0,J.jsx)(`div`,{className:`flex h-9 items-center rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/30 px-3 text-sm text-foreground`,children:yt(n)})}):(0,J.jsx)(Q,{label:`Platform`,children:(0,J.jsxs)(N,{value:n,onValueChange:e=>l(e),children:[(0,J.jsx)(M,{className:`h-9 w-full text-sm data-placeholder:text-muted-foreground/55`,"aria-label":`Platform type`,children:(0,J.jsx)(D,{placeholder:`Select platform`,children:e=>vt(e)})}),(0,J.jsxs)(k,{children:[(0,J.jsxs)(j,{children:[(0,J.jsx)(E,{children:`Available`}),L.map(e=>(0,J.jsx)(O,{value:e.id,children:e.label},e.id))]}),(0,J.jsx)(A,{}),(0,J.jsxs)(j,{children:[(0,J.jsx)(E,{children:`Coming soon`}),F.map(e=>(0,J.jsx)(O,{value:e.id,children:e.label},e.id))]})]})]})}),y?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Q,{id:`env-label`,label:`Label`,children:(0,J.jsx)(C,{id:`env-label`,placeholder:`Production`,value:r.label,onChange:e=>u({...r,label:e.currentTarget.value}),autoComplete:`off`,className:`h-9 placeholder:text-muted-foreground/55`})}),(0,J.jsx)(Q,{id:`env-hostname`,label:`Hostname`,children:(0,J.jsx)(C,{id:`env-hostname`,placeholder:`192.168.1.100`,value:r.hostname,onChange:e=>u({...r,hostname:e.currentTarget.value}),autoCapitalize:`none`,autoComplete:`off`,spellCheck:!1,className:`h-9 font-mono text-[13px] placeholder:text-muted-foreground/55`})}),(0,J.jsx)(Q,{id:`env-source`,label:X,labelAdornment:(0,J.jsxs)(G,{children:[(0,J.jsx)(U,{type:`button`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`About ${X}`,children:(0,J.jsx)(H,{className:`size-3`,"aria-hidden":!0})}),(0,J.jsx)(W,{side:`top`,align:`start`,className:`max-w-xs text-left`,children:Fe})]}),children:(0,J.jsx)(C,{id:`env-source`,placeholder:`host.docker.internal`,value:r.sourceHostname,onChange:e=>u({...r,sourceHostname:e.currentTarget.value}),autoCapitalize:`none`,autoComplete:`off`,spellCheck:!1,className:`h-9 font-mono text-[13px] placeholder:text-muted-foreground/55`})}),(0,J.jsx)(Q,{id:`env-token`,label:`API token`,labelAdornment:(0,J.jsxs)(G,{children:[(0,J.jsx)(U,{type:`button`,className:`inline-flex size-5 shrink-0 items-center justify-center rounded-[var(--miravo-radius-tight)] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`About API token`,children:(0,J.jsx)(H,{className:`size-3`,"aria-hidden":!0})}),(0,J.jsx)(W,{side:`top`,align:`start`,className:`max-w-xs text-left`,children:w})]}),children:(0,J.jsxs)(`div`,{className:`relative`,children:[(0,J.jsx)(C,{id:`env-token`,type:i?`text`:`password`,placeholder:t?`••••••••`:`Enter API token`,value:r.apiToken,onChange:e=>u({...r,apiToken:e.currentTarget.value}),autoCapitalize:`none`,autoComplete:`off`,spellCheck:!1,className:`h-9 pr-11 font-mono text-[13px] placeholder:text-muted-foreground/55`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>d(!i),"aria-label":i?`Hide token`:`Show token`,"aria-pressed":i,className:`absolute inset-y-0 right-0 flex w-11 items-center justify-center rounded-r-[var(--miravo-radius-stadium-sm)] text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:i?(0,J.jsx)(_e,{className:`size-3.5`,"aria-hidden":!0}):(0,J.jsx)(ve,{className:`size-3.5`,"aria-hidden":!0})})]})})]}):(0,J.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border/70 px-4 py-3 text-sm text-muted-foreground`,children:[yt(n),` setup is not available yet. Switch back to Litmus Edge to finish target setup now.`]})]})}),(0,J.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:o&&y?`Checking connection to Litmus Edge…`:``}),(0,J.jsxs)(m,{className:`mx-0 mb-0 shrink-0 flex-col gap-2 border-t border-border/60 bg-background px-4 py-3 sm:flex-row sm:justify-end sm:px-5`,children:[(0,J.jsx)(b,{type:`button`,variant:`outline`,size:`lg`,className:`w-full justify-center sm:mr-auto sm:w-auto`,disabled:a||o||!s,"aria-busy":o,onClick:p,children:o?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(B,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),`Testing connection`]}):`Test connection`}),(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2 sm:w-auto sm:flex-row`,children:[(0,J.jsx)(b,{variant:`outline`,size:`lg`,className:`w-full sm:w-auto`,onClick:()=>{g(),c(!1)},disabled:a,children:`Cancel`}),(0,J.jsx)(b,{size:`lg`,className:`w-full sm:w-auto`,onClick:f,disabled:a||!y,children:a?`Saving...`:t?`Save Target`:`Add Target`})]})]})]})})}var xt=`flex size-7 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/35 bg-muted/25 text-primary`;function St({targets:e,value:t,onValueChange:n,size:r=`default`,disabled:i,loading:a=!1,className:o,preferredTargetId:s,onAddNew:c}){return(0,q.useEffect)(()=>{if(t||e.length===0)return;let r=(s?e.find(e=>e.id===s):void 0)??e[0];r&&n(r.id)},[t,e,s,n]),a?(0,J.jsx)(`div`,{className:T(`flex h-9 min-h-9 w-full items-center rounded-[var(--miravo-radius-stadium-sm)] border border-input bg-input/25 px-3 text-xs text-muted-foreground`,o),children:`Loading targets...`}):e.length===0&&c?(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,J.jsx)(`span`,{children:`No targets configured.`}),(0,J.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 text-primary hover:underline`,onClick:c,children:[(0,J.jsx)(be,{className:`inline size-3`}),` Add target`]})]}):(0,J.jsxs)(N,{value:t,onValueChange:e=>e&&n(e),disabled:i,children:[(0,J.jsx)(M,{size:r,className:T(`w-full`,r===`sm`&&`h-9! min-h-9 py-0`,r===`default`&&`h-auto! min-h-9 py-2 **:data-[slot=select-value]:line-clamp-none`,o),children:(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:xt,"aria-hidden":!0,children:(0,J.jsx)(ie,{className:`size-3.5`})}),(0,J.jsx)(D,{placeholder:`Select target`,className:`min-w-0 flex-1`,children:t=>{let n=e.find(e=>e.id===t);return n?r===`sm`?n.label:(0,J.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`text-xs font-medium leading-tight`,children:n.label}),(0,J.jsx)(`span`,{className:`font-mono text-[11px] leading-none text-muted-foreground`,children:n.hostname})]}):`Select target`}})]})}),(0,J.jsx)(k,{className:`rounded-[var(--miravo-radius-stadium-sm)] p-1.5`,children:e.map(e=>(0,J.jsxs)(O,{value:e.id,className:`h-auto items-center gap-2 rounded-[var(--miravo-radius-stadium-sm)] py-2 pr-8 pl-2`,children:[(0,J.jsx)(`span`,{className:xt,"aria-hidden":!0,children:(0,J.jsx)(ie,{className:`size-3.5`})}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5 text-left`,children:[(0,J.jsx)(`span`,{className:`truncate text-xs font-medium leading-tight text-foreground`,children:e.label}),(0,J.jsx)(`span`,{className:`truncate font-mono text-[11px] leading-none text-muted-foreground`,children:e.hostname})]})]},e.id))})]})}async function Ct(){return(await c(`/platforms/le/targets`,i.platformTargets)).targets}function wt(e){return c(`/platforms/le/targets`,i.platformTargetCreate,{body:e})}function Tt(e,t){return c(`/platforms/le/targets/${e}`,i.platformTargetById,{body:t})}function Et(e){return c(`/platforms/le/targets/${e}`,i.platformTargetDelete)}function Dt(e,t){return c(`/platforms/le/targets/test`,i.platformConnectionTest,{body:e,init:{signal:t?.signal}})}function Ot(e,t){return c(`/platforms/le/plan`,i.platformPlan,{body:e,init:{signal:t?.signal}})}function kt(e,t){return c(`/platforms/le/cleanup/plan`,i.platformCleanupPlan,{body:e,init:{signal:t?.signal}})}function At(e={}){let t=new URLSearchParams;e.type&&t.set(`type`,e.type),e.targetId&&t.set(`targetId`,e.targetId),typeof e.limit==`number`&&t.set(`limit`,String(e.limit)),typeof e.offset==`number`&&t.set(`offset`,String(e.offset));let n=t.toString();return c(n?`/platforms/le/operations?${n}`:`/platforms/le/operations`,i.platformOperations)}async function jt(e){try{return await c(`/platforms/le/operations/${e}/cancel`,i.platformOperationCancel),!0}catch(e){if(r.is(e)&&e.status===404)return!1;throw e}}function Mt(e,t,n){return Pt(`/platforms/le/apply/stream`,i.platformApplyStream,e,t,n)}function Nt(e,t,n){return Pt(`/platforms/le/cleanup/stream`,i.platformCleanupStream,e,t,n)}function Pt(e,t,n,i,c){let d=new AbortController;return(async()=>{try{let c=t.body.safeParse(n);if(!c.success)throw Error(`Invalid request for ${t.method} ${t.path}: ${c.error.message}`);let f=await fetch(s(l,e),{method:t.method,headers:{"content-type":`application/json`},credentials:`include`,body:JSON.stringify(c.data),signal:d.signal});if(f.status===401&&t.auth===`required`)throw o(),Error(`Session expired`);if(!f.ok){let e=`HTTP ${f.status}`;try{let e=await f.json(),t=u.safeParse(e);if(t.success)throw new r({code:t.data.code,status:f.status,message:t.data.message,hint:t.data.hint})}catch(e){if(e instanceof r)throw e}throw Error(e)}if(!f.body)throw Error(`No response body`);let p=f.body.getReader(),m=new TextDecoder,h=``,g=``,_=``,v=!1;for(;;){let{done:e,value:t}=await p.read();if(e)break;h+=m.decode(t,{stream:!0});let n=h.split(`
2
+ `);h=n.pop()??``;for(let e of n)if(e.startsWith(`event: `))g=e.slice(7).trim();else if(e.startsWith(`data: `))_=e.slice(6);else if(e===``&&g&&_){let e=!1;try{let t=JSON.parse(_),n=a.safeParse({event:g,data:t});n.success&&((n.data.event===`complete`||n.data.event===`cancelled`||n.data.event===`error`)&&(v=!0,e=!0),i(n.data))}catch{}if(g=``,_=``,e){await p.cancel();return}}}if(!v&&!d.signal.aborted)throw Error(`Connection to server was lost unexpectedly`)}catch(e){if(d.signal.aborted)return;c(e instanceof Error?e:Error(String(e)))}})(),d}function Ft(e){let t=e.trim();if(t.length===0)return{message:`Connection test failed with no details from the server.`};let n=t.toLowerCase();if(t.includes(`timed out`))return{message:`Litmus Edge did not respond in time.`,description:`Check the hostname, VPN or firewall, and that the device is online.`};if(/\b401\b/.test(t)||/\b403\b/.test(t)||n.includes(`unauthorized`))return{message:`The API token was rejected.`,description:`Create or copy a valid token in Litmus Edge and paste it into the API token field.`};if(/\b404\b/.test(t)&&(n.includes(`sysinfo`)||n.includes(`/sysinfo/`)))return{message:`This Litmus Edge host or version does not expose the system info API.`,description:`Confirm the hostname and that Litmus Edge is running a build with GET /sysinfo/devinfo.`};if(n.includes(`econnrefused`)||n.includes(`connection refused`)||n.includes(`enotfound`)||n.includes(`getaddrinfo`)||n.includes(`failed`)&&n.includes(`fetch`))return{message:`Could not reach the Litmus Edge host.`,description:`Check the hostname or IP, TLS, and that this computer can reach the edge network.`};if(t.includes(`Session expired`))return{message:`Your session expired. Sign in again, then retry the connection test.`};if(n.includes(`environment not found`))return{message:`That target was removed. Close the dialog and refresh the list.`};if(n.includes(`unsupported platform`)&&n.includes(`connection`))return{message:`This platform type does not support connection tests yet.`,description:`Use Litmus Edge for remote apply and connection testing.`};if(n.includes(`invalid request body`)||n.includes(`api token is required`))return{message:`Some required fields are missing or invalid.`,description:`Fill in hostname, source host (Miravo), and API token (for new targets).`};let r=t.replace(/^LE\s+\S+\s+/i,``).trim();return{message:`Could not verify the connection to Litmus Edge.`,description:r.length>0&&r.length<=220?r:It(t,200)}}function It(e,t){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t-1)}…`}function Lt(e){if(e.connected){let t=e.litmusEdgeVersion?` Litmus Edge v${e.litmusEdgeVersion}.`:``;if(e.warning){g.warning(`Connected to ${e.hostname}.${t}`,{description:e.warning});return}g.success(`Connected to ${e.hostname}.${t}`);return}let{message:t,description:n}=Ft(e.error);g.error(t,n?{description:n}:void 0)}function Rt(e){let{message:t,description:n}=Ft(e instanceof Error?e.message:String(e));g.error(t,n?{description:n}:void 0)}function zt(e){return!!(typeof DOMException<`u`&&e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&(e.name===`AbortError`||/aborted/i.test(e.message)))}function Bt(){let[e,t]=(0,q.useState)(!1),n=(0,q.useRef)(null),r=(0,q.useCallback)(()=>{n.current?.abort()},[]);return{testing:e,runTest:(0,q.useCallback)(async e=>{let r=new AbortController;n.current=r,t(!0);try{Lt(await Dt(e,{signal:r.signal}))}catch(e){if(zt(e))return;Rt(e)}finally{n.current===r&&(n.current=null),t(!1)}},[]),cancelInFlight:r}}function Vt(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}function Ht(e){return e.map(e=>e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join(`, `)}function Ut({onCloseTable:e,planKind:t=`apply`}){return(0,J.jsx)(`div`,{className:`border-b border-border/40 px-3 py-3 sm:px-4`,children:(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[(0,J.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,J.jsx)(he,{className:`size-4 text-muted-foreground`,"aria-hidden":!0})}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-1 pt-0.5 sm:gap-2`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,J.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.14em] text-foreground`,children:t===`cleanup`?`Expected removals`:`Expected changes`}),(0,J.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,J.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,J.jsx)(b,{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,J.jsx)(S,{className:`size-4`,"aria-hidden":!0})})]})]})})}var Wt={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`,noop:`border-border/50 bg-muted/50 text-foreground/75`,blocked:`border-warning/30 bg-warning/12 text-warning`};function Gt({plan:e,planKind:t}){let n=t===`apply`&&e.sourceHostname!=null&&e.sourceHostname!==``;return(0,J.jsx)(`div`,{className:`border-b border-border/35 bg-muted/10 px-3 py-2 sm:px-4`,children:(0,J.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,J.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,J.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/85`,children:`Target LE`}),(0,J.jsx)(`span`,{className:`font-mono text-foreground/90 wrap-anywhere`,children:e.targetHost})]}),n?(0,J.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,J.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] uppercase tracking-wider text-muted-foreground/85`,children:X}),(0,J.jsx)(`span`,{className:`font-mono text-foreground/90 wrap-anywhere`,children:e.sourceHostname})]}):null]})})}function Kt({entries:e}){let t=e.reduce((e,t)=>(e[t.action]++,e),{create:0,update:0,replace:0,delete:0,noop:0,blocked:0});return(0,J.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,J.jsx)(`span`,{className:`sr-only`,children:`Summary of planned actions`}),(0,J.jsx)(`span`,{className:`font-mono text-[9px] uppercase tracking-[0.18em] text-muted-foreground`,children:`Manifest`}),(0,J.jsx)(`span`,{className:`hidden h-3 w-px bg-border/60 sm:block`,"aria-hidden":!0}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[t.create>0&&(0,J.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,J.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,J.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,J.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.noop>0&&(0,J.jsxs)(`span`,{className:`inline-flex items-center rounded-[var(--miravo-radius-tight)] border border-border/50 bg-muted/50 px-2 py-0.5 font-mono text-[10px] tabular-nums text-foreground/75`,children:[`=`,t.noop,` unchanged`]}),t.blocked>0&&(0,J.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 qt({plan:e,onCloseTable:t,planKind:n=`apply`}){return e.entries.length===0?(0,J.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-dashed border-border/55`,children:[(0,J.jsx)(Ut,{onCloseTable:t,planKind:n}),(0,J.jsx)(Gt,{plan:e,planKind:n}),(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-3 px-4 py-10 text-center`,children:[(0,J.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border border-border/50`,children:(0,J.jsx)(he,{className:`size-6 text-muted-foreground/45`,"aria-hidden":!0})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:n===`cleanup`?`Nothing to remove`:`Nothing to change`}),(0,J.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,J.jsxs)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/45`,children:[(0,J.jsx)(Ut,{onCloseTable:t,planKind:n}),(0,J.jsx)(Gt,{plan:e,planKind:n}),(0,J.jsx)(Kt,{entries:e.entries}),(0,J.jsx)(`div`,{className:`overflow-x-auto`,children:(0,J.jsxs)(`table`,{className:`w-full min-w-lg text-xs`,children:[(0,J.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,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`border-b border-border/45`,children:[(0,J.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,J.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,J.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,J.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,J.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,J.jsx)(`tbody`,{children:e.entries.map((e,t)=>(0,J.jsxs)(`tr`,{className:T(`border-b border-border/25 transition-colors`,t%2==1?`bg-muted/35`:`bg-transparent`,`hover:bg-primary/4`),children:[(0,J.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,J.jsx)(ce,{variant:`outline`,className:T(`border px-1.5 py-0 font-mono text-[10px] uppercase tracking-wide`,Wt[e.action]),children:e.action})}),(0,J.jsx)(`td`,{className:`px-3 py-2 align-middle font-mono text-[11px] text-foreground sm:px-3.5`,children:e.resourceType}),(0,J.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,J.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,J.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,J.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,J.jsxs)(`span`,{children:[(0,J.jsx)(`span`,{className:`font-mono tabular-nums text-foreground/90`,children:e.entries.length}),` `,(0,J.jsxs)(`span`,{className:`text-muted-foreground/90`,children:[e.entries.length===1?`action`:`actions`,` queued`]})]}),(0,J.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,J.jsx)(`span`,{className:`shrink-0 text-[9px] uppercase tracking-wider text-muted-foreground/80`,children:`Scope`}),(0,J.jsx)(`span`,{className:`min-w-0 text-foreground/90`,children:Ht(e.scope)})]})]})]})}var Jt=[`s1`,`s2`,`s3`,`s4`];function Yt(){return(0,J.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,J.jsx)(`span`,{className:`sr-only`,children:`Loading plan preview`}),(0,J.jsx)(`div`,{className:`border-b border-border/40 px-3 py-3 sm:px-4`,children:(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[(0,J.jsx)(Y,{className:`size-10 shrink-0 rounded-[var(--miravo-radius-stadium-sm)]`}),(0,J.jsx)(`div`,{className:`flex min-w-0 flex-1 items-start gap-1 pt-0.5 sm:gap-2`,children:(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,J.jsx)(Y,{className:`h-3.5 w-40`}),(0,J.jsx)(Y,{className:`h-4 w-11 rounded-[var(--miravo-radius-tight)] border`})]}),(0,J.jsx)(Y,{className:`mt-1.5 h-3 max-w-prose`})]})})]})}),(0,J.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,J.jsx)(Y,{className:`h-2.5 w-14`}),(0,J.jsx)(Y,{className:`hidden h-3 w-px shrink-0 sm:block`}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[(0,J.jsx)(Y,{className:`h-5 w-18 rounded-[var(--miravo-radius-tight)]`}),(0,J.jsx)(Y,{className:`h-5 w-24 rounded-[var(--miravo-radius-tight)]`}),(0,J.jsx)(Y,{className:`h-5 w-20 rounded-[var(--miravo-radius-tight)]`})]})]}),(0,J.jsx)(`div`,{className:`overflow-x-auto`,children:(0,J.jsxs)(`table`,{className:`w-full min-w-lg text-xs`,"aria-hidden":!0,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`border-b border-border/45`,children:[(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-2.5 w-12`})}),(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-2.5 w-9`})}),(0,J.jsx)(`th`,{scope:`col`,className:`sticky top-0 z-10 bg-background px-3 py-2 text-left sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-2.5 w-10`})}),(0,J.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,J.jsx)(Y,{className:`h-2.5 w-14`})}),(0,J.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,J.jsx)(Y,{className:`h-2.5 w-11`})})]})}),(0,J.jsx)(`tbody`,{children:Jt.map((e,t)=>(0,J.jsxs)(`tr`,{className:T(`border-b border-border/25 transition-colors`,t%2==1?`bg-muted/35`:`bg-transparent`,`hover:bg-primary/4`),children:[(0,J.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-5 w-13 rounded-[var(--miravo-radius-tight)]`})}),(0,J.jsx)(`td`,{className:`px-3 py-2 align-middle sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-3.5 w-16 font-mono`})}),(0,J.jsx)(`td`,{className:`max-w-[min(16rem,28vw)] px-3 py-2 align-middle sm:max-w-xs sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-3.5 w-full max-w-48 font-mono`})}),(0,J.jsx)(`td`,{className:`hidden px-3 py-2 align-middle sm:table-cell sm:px-3.5`,children:(0,J.jsx)(Y,{className:`h-3.5 w-10 font-mono`})}),(0,J.jsx)(`td`,{className:`hidden max-w-xs px-3 py-2 align-middle md:table-cell md:px-3.5`,children:(0,J.jsx)(Y,{className:`h-3.5 w-full max-w-40`})})]},e))})]})}),(0,J.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,J.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,J.jsx)(Y,{className:`inline-block h-3 w-6 rounded-[var(--miravo-radius-tight)]`}),(0,J.jsx)(Y,{className:`inline-block h-3 w-28`})]}),(0,J.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,J.jsx)(Y,{className:`h-2.5 w-8 shrink-0`}),(0,J.jsx)(Y,{className:`h-6 min-w-32 rounded-[var(--miravo-radius-tight)] border border-border/50 px-2 py-0.5`}),(0,J.jsx)(Y,{className:`h-1 w-1 shrink-0 rounded-full`}),(0,J.jsx)(Y,{className:`h-2.5 w-10 shrink-0`}),(0,J.jsx)(Y,{className:`h-3 min-w-16 max-w-56 flex-1`})]})]})]})}function Xt({stream:e,className:t}){let n=He(e);if(!n)return null;let r=e.status===`running`,i=e.status===`error`,a=e.status===`complete`&&e.operation?.status===`cancelled`,o=e.status===`complete`&&!a;return(0,J.jsxs)(`span`,{className:T(`inline-flex h-6 w-fit min-w-0 shrink-0 items-center justify-center gap-1 rounded-full border px-2 py-0`,`text-xs font-medium leading-none tracking-wide uppercase shadow-[inset_0_1px_0_0_rgba(255,255,255,0.05)]`,t,o&&`border-success/45 bg-success/[0.1] text-success`,a&&`border-muted-foreground/30 bg-muted/[0.1] text-muted-foreground shadow-none`,i&&`border-destructive/50 bg-destructive/[0.1] text-destructive shadow-none`,r&&`border-primary/40 bg-primary/[0.1] text-primary border-primary/35`),children:[o?(0,J.jsx)(x,{className:`size-3 shrink-0 opacity-95`,strokeWidth:2.5,"aria-hidden":!0}):a?(0,J.jsx)(de,{className:`size-3 shrink-0 opacity-95`,"aria-hidden":!0}):i?(0,J.jsx)(se,{className:`size-3 shrink-0 opacity-95`,"aria-hidden":!0}):(0,J.jsx)(B,{className:`size-3 shrink-0 animate-spin`,"aria-hidden":!0}),n]})}var Zt={status:`idle`,operation:null,error:null,logs:[],cancelRequested:!1},Qt=200;function $t(){let[e,t]=(0,q.useState)(Zt),n=(0,q.useRef)(null),r=(0,q.useRef)(0),i=(0,q.useRef)(0),a=(0,q.useCallback)(e=>{let n=le(e,`Platform operation failed.`),r=ue(e),i=r?`${n} ${r}`:n;t(e=>({...e,status:`error`,cancelRequested:!1,error:i,operation:e.operation?{...e.operation,status:`error`,error:i}:null}))},[]),o=(0,q.useCallback)(e=>{switch(e.event){case`accepted`:en(e.data,t);break;case`log`:nn({...e.data,id:`log-${r.current++}`},t);break;case`started`:rn(e.data,t);break;case`phase`:an(e.data,t);break;case`resource`:on(e.data,t);break;case`complete`:sn(e.data,t);break;case`cancelled`:ln(e.data,t);break;case`retrying`:un(e.data,t);break;case`error`:a(Error(e.data.message));break}},[a]),s=(0,q.useCallback)(e=>{let s=++i.current;n.current?.abort(),r.current=0,t({status:`running`,operation:null,error:null,logs:[],cancelRequested:!1}),n.current=Mt(e,e=>{i.current===s&&(o(e),dn(e)&&(n.current?.abort(),n.current=null))},e=>{i.current===s&&(n.current=null,a(e))})},[o,a]),c=(0,q.useCallback)(e=>{let s=++i.current;n.current?.abort(),r.current=0,t({status:`running`,operation:null,error:null,logs:[],cancelRequested:!1}),n.current=Nt(e,e=>{i.current===s&&(o(e),dn(e)&&(n.current?.abort(),n.current=null))},e=>{i.current===s&&(n.current=null,a(e))})},[o,a]),l=(0,q.useCallback)(()=>{i.current++,n.current?.abort(),n.current=null,t(Zt)},[]),u=(0,q.useCallback)(async()=>{let n=e.operation?.operationId;if(!(!n||e.status!==`running`||e.cancelRequested)){t(e=>cn(e,n));try{await jt(n)||a(Error(`Operation finished before cancellation was accepted.`))}catch(e){a(e instanceof Error?e:Error(`Cancellation failed.`))}}},[e.operation?.operationId,e.status,e.cancelRequested,a]);return(0,q.useEffect)(()=>()=>{i.current++,n.current?.abort(),n.current=null},[]),{...e,startApply:s,startCleanup:c,reset:l,cancel:u}}function en(e,t){t(t=>({...t,status:`running`,cancelRequested:!1,error:null,operation:{operationId:e.operationId,type:e.type,label:e.template??e.model??(e.type===`apply`?`Preparing apply`:`Preparing cleanup`),environment:e.targetId??`Resolving target`,totalPlanned:0,phases:[],applied:0,failed:0,status:`running`,startedAt:Date.now()}}))}function tn(e){return(e.template??e.model)||(e.type===`cleanup`?`All managed resources`:`unknown`)}function nn(e,t){t(t=>({...t,logs:[...t.logs,e].slice(-Qt)}))}function rn(e,t){t(t=>({...t,status:`running`,cancelRequested:!1,error:null,operation:{operationId:e.operationId,type:e.type,label:tn(e),environment:e.environment,totalPlanned:e.totalPlanned,phases:[],applied:0,failed:0,status:`running`,startedAt:Date.now(),attempt:e.attempt,maxAttempts:e.maxAttempts}}))}function an(e,t){t(t=>{if(!$(t,e.operationId))return t;let n=t.operation.phases.map(e=>e.status===`active`?{...e,status:`done`}:e),r=n.findIndex(t=>t.name===e.phase),i=r>=0?n.map((t,n)=>n===r?{...t,status:`active`,total:e.total}:t):[...n,{name:e.phase,total:e.total,resources:[],status:`active`}];return{...t,operation:{...t.operation,phases:i}}})}function on(e,t){t(t=>{if(!$(t,e.operationId))return t;let n={name:e.name,action:e.action,status:e.status,error:e.error},r=t.operation.phases.map(t=>t.name===e.phase&&t.status===`active`?{...t,resources:[...t.resources,n]}:t);return{...t,operation:{...t.operation,phases:r,applied:t.operation.applied+ +(e.status===`success`&&e.action!==`noop`),failed:t.operation.failed+ +(e.status===`failed`)}}})}function sn(e,t){t(t=>{if(!$(t,e.operationId))return t;let n=t.operation.phases.map(e=>e.status===`active`?{...e,status:`done`}:e);return{...t,status:`complete`,cancelRequested:!1,error:null,operation:{...t.operation,phases:n,applied:e.applied??e.deleted??0,failed:e.failed,duration:e.duration,status:`complete`}}})}function cn(e,t){return!$(e,t)||e.status!==`running`?e:{...e,cancelRequested:!0}}function ln(e,t){t(t=>{if(!$(t,e.operationId))return t;let n=t.operation.phases.map(e=>e.status===`active`?{...e,status:`done`}:e);return{...t,status:`complete`,cancelRequested:!1,error:null,operation:{...t.operation,phases:n,applied:e.applied??e.deleted??0,failed:e.failed,duration:e.duration,status:`cancelled`}}})}function un(e,t){t(t=>$(t,e.operationId)?{...t,status:`running`,cancelRequested:!1,error:null,operation:{...t.operation,status:`running`,retryPending:!0,retryDelayMs:e.delayMs,attempt:e.attempt,maxAttempts:e.maxAttempts,error:e.error,applied:0,failed:0,phases:[]}}:t)}function $(e,t){return e.operation?.operationId===t}function dn(e){return e.event===`complete`||e.event===`cancelled`||e.event===`error`}export{Ee as A,Ie as C,Ne as D,Me as E,ve as F,me as I,xe as M,be as N,Pe as O,ye as P,Ge as S,X as T,ht as _,Vt as a,Ke as b,Et as c,kt as d,Ot as f,gt as g,bt as h,Yt as i,Se as j,Te as k,At as l,St as m,Xt as n,Bt as o,Tt as p,qt as r,wt as s,$t as t,Ct as u,mt as v,Fe as w,We as x,pt as y};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{c as n}from"./chunk-OE4NN4TA-DBWZidbW.js";import{t as r}from"./route-preload-cBwnl6Y_.js";var i=e(t(),1);function a(){let e=n();return(0,i.useCallback)((t,n)=>{n?.preload!==!1&&r(t),(0,i.startTransition)(()=>{n?.transitionType&&(0,i.addTransitionType)(n.transitionType),e(t,{replace:n?.replace})})},[e])}export{a as t};
1
+ import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{c as n}from"./chunk-OE4NN4TA-DBWZidbW.js";import{t as r}from"./route-preload-CLRbqehb.js";var i=e(t(),1);function a(){let e=n();return(0,i.useCallback)((t,n)=>{n?.preload!==!1&&r(t),(0,i.startTransition)(()=>{n?.transitionType&&(0,i.addTransitionType)(n.transitionType),e(t,{replace:n?.replace})})},[e])}export{a as t};
@@ -1 +1 @@
1
- import{at as e,et as t}from"./vendor-ui-CWUk2ulb.js";import{G as n,H as r,U as i}from"./api-DPmCeS_C.js";import{l as a}from"./copy-button-BvU3RDZa.js";import{n as o,t as s}from"./utils-XFKvwlFT.js";var c=o(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),l=o(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),u=e();function d({className:e,orientation:n=`horizontal`,...r}){return(0,u.jsx)(t,{"data-slot":`separator`,orientation:n,className:s(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}var f=i({multiplier:r({message:`Speed multiplier must be a number.`}).positive(`Speed multiplier must be positive.`).finite(`Speed multiplier must be finite.`).max(1e3,`Speed multiplier cannot exceed 1000.`)}),p=i({model:n().min(1,`Model is required.`),count:r({message:`Count must be a number.`}).int(`Count must be a whole number.`).positive(`Count must be at least 1.`).max(100,`Count cannot exceed 100.`)}),m=i({instanceId:n().min(1,`Instance is required.`),fault:n().min(1,`Fault name is required.`)}),h=i({instanceId:n().min(1,`Instance is required.`)});function g(e,t,n){if(!t.trim())return a.error(`Argument "${e}" is required.`),null;switch(n){case`Double`:case`Float`:{let n=Number(t);return Number.isFinite(n)?{value:n}:(a.error(`"${e}" must be a valid number.`),null)}case`Int32`:case`UInt16`:case`UInt32`:{let r=Number(t);return!Number.isFinite(r)||!Number.isSafeInteger(r)?(a.error(`"${e}" must be a valid integer.`),null):(n===`UInt16`||n===`UInt32`)&&r<0?(a.error(`"${e}" must be non-negative.`),null):{value:r}}case`Boolean`:return t!==`true`&&t!==`false`?(a.error(`"${e}" must be "true" or "false".`),null):{value:t===`true`};case`String`:return{value:t};default:return{value:t}}}function _(e,t){let n=e.safeParse(t);return n.success?n.data:(a.error(n.error.issues[0]?.message??`Validation error.`),null)}export{_ as a,l as c,p as i,c as l,h as n,g as o,f as r,d as s,m as t};
1
+ import{at as e,et as t}from"./vendor-ui-CWUk2ulb.js";import{G as n,H as r,U as i}from"./api-CrYvIV3A.js";import{l as a}from"./copy-button-BvU3RDZa.js";import{n as o,t as s}from"./utils-XFKvwlFT.js";var c=o(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),l=o(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),u=e();function d({className:e,orientation:n=`horizontal`,...r}){return(0,u.jsx)(t,{"data-slot":`separator`,orientation:n,className:s(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}var f=i({multiplier:r({message:`Speed multiplier must be a number.`}).positive(`Speed multiplier must be positive.`).finite(`Speed multiplier must be finite.`).max(1e3,`Speed multiplier cannot exceed 1000.`)}),p=i({model:n().min(1,`Model is required.`),count:r({message:`Count must be a number.`}).int(`Count must be a whole number.`).positive(`Count must be at least 1.`).max(100,`Count cannot exceed 100.`)}),m=i({instanceId:n().min(1,`Instance is required.`),fault:n().min(1,`Fault name is required.`)}),h=i({instanceId:n().min(1,`Instance is required.`)});function g(e,t,n){if(!t.trim())return a.error(`Argument "${e}" is required.`),null;switch(n){case`Double`:case`Float`:{let n=Number(t);return Number.isFinite(n)?{value:n}:(a.error(`"${e}" must be a valid number.`),null)}case`Int32`:case`UInt16`:case`UInt32`:{let r=Number(t);return!Number.isFinite(r)||!Number.isSafeInteger(r)?(a.error(`"${e}" must be a valid integer.`),null):(n===`UInt16`||n===`UInt32`)&&r<0?(a.error(`"${e}" must be non-negative.`),null):{value:r}}case`Boolean`:return t!==`true`&&t!==`false`?(a.error(`"${e}" must be "true" or "false".`),null):{value:t===`true`};case`String`:return{value:t};default:return{value:t}}}function _(e,t){let n=e.safeParse(t);return n.success?n.data:(a.error(n.error.issues[0]?.message??`Validation error.`),null)}export{_ as a,l as c,p as i,c as l,h as n,g as o,f as r,d as s,m as t};
@@ -21,15 +21,15 @@
21
21
  }
22
22
  </style>
23
23
  <title>Miravo</title>
24
- <script type="module" crossorigin src="/assets/index-0cZ4jnjm.js"></script>
24
+ <script type="module" crossorigin src="/assets/index-Dmyw65xM.js"></script>
25
25
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-COnpUsM8.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/vendor-charts-95ykyDlI.js">
27
27
  <link rel="modulepreload" crossorigin href="/assets/chunk-OE4NN4TA-DBWZidbW.js">
28
- <link rel="modulepreload" crossorigin href="/assets/api-DPmCeS_C.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/api-CrYvIV3A.js">
29
29
  <link rel="modulepreload" crossorigin href="/assets/vendor-ui-CWUk2ulb.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/utils-XFKvwlFT.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/format-CshN6yEB.js">
32
- <link rel="modulepreload" crossorigin href="/assets/query-fetch-error-C-7x_NhM.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/query-fetch-error-BWenDoLQ.js">
33
33
  <link rel="modulepreload" crossorigin href="/assets/proxy-Be4WzmcS.js">
34
34
  <link rel="modulepreload" crossorigin href="/assets/AnimatePresence-CPmH1DMY.js">
35
35
  <link rel="modulepreload" crossorigin href="/assets/activity-Cy_niK56.js">
@@ -44,36 +44,36 @@
44
44
  <link rel="modulepreload" crossorigin href="/assets/triangle-alert-BXrJNk3g.js">
45
45
  <link rel="modulepreload" crossorigin href="/assets/badge-eIn_7YrK.js">
46
46
  <link rel="modulepreload" crossorigin href="/assets/label-CMBWxUhA.js">
47
- <link rel="modulepreload" crossorigin href="/assets/get-error-message-Btp63MTs.js">
48
- <link rel="modulepreload" crossorigin href="/assets/use-platform-stream-8tr6SVec.js">
47
+ <link rel="modulepreload" crossorigin href="/assets/get-error-message-BgE2BpPG.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/use-platform-stream-QBU2PAD2.js">
49
49
  <link rel="modulepreload" crossorigin href="/assets/catalog-template-icons-3S8RvUxD.js">
50
50
  <link rel="modulepreload" crossorigin href="/assets/layers-1figUpjG.js">
51
51
  <link rel="modulepreload" crossorigin href="/assets/dist-xY0pK9Wy.js">
52
52
  <link rel="modulepreload" crossorigin href="/assets/dropdown-menu-CrPXVXpG.js">
53
- <link rel="modulepreload" crossorigin href="/assets/platforms-D024zTxj.js">
53
+ <link rel="modulepreload" crossorigin href="/assets/platforms-DGpl5tPh.js">
54
54
  <link rel="modulepreload" crossorigin href="/assets/vendor-table-BAHQgdwg.js">
55
55
  <link rel="modulepreload" crossorigin href="/assets/arrow-up-down-C1oJAmrw.js">
56
56
  <link rel="modulepreload" crossorigin href="/assets/download-DmUZKo9N.js">
57
57
  <link rel="modulepreload" crossorigin href="/assets/engine-store-DMULdR_V.js">
58
58
  <link rel="modulepreload" crossorigin href="/assets/auth-screen-backdrop-Cr8qBSXP.js">
59
59
  <link rel="modulepreload" crossorigin href="/assets/combobox-BCaV1Wbo.js">
60
- <link rel="modulepreload" crossorigin href="/assets/tags-KxhNEiLb.js">
61
- <link rel="modulepreload" crossorigin href="/assets/catalog-source-ChUAD0NL.js">
60
+ <link rel="modulepreload" crossorigin href="/assets/tags-zenGXuzO.js">
61
+ <link rel="modulepreload" crossorigin href="/assets/catalog-source-B3vWR4vX.js">
62
62
  <link rel="modulepreload" crossorigin href="/assets/runtime-link-PMxeHxd6.js">
63
- <link rel="modulepreload" crossorigin href="/assets/use-engine-command-mutation-iPA57YyA.js">
64
- <link rel="modulepreload" crossorigin href="/assets/models-D_OCpWPE.js">
65
- <link rel="modulepreload" crossorigin href="/assets/validation-XGNj2nVO.js">
63
+ <link rel="modulepreload" crossorigin href="/assets/use-engine-command-mutation-CT_3rCP3.js">
64
+ <link rel="modulepreload" crossorigin href="/assets/models-B7FNHSvb.js">
65
+ <link rel="modulepreload" crossorigin href="/assets/validation-pFKbjwNg.js">
66
66
  <link rel="modulepreload" crossorigin href="/assets/shallow-Cin0mLuv.js">
67
- <link rel="modulepreload" crossorigin href="/assets/route-preload-cBwnl6Y_.js">
68
- <link rel="modulepreload" crossorigin href="/assets/use-transition-navigate-CUOoK-a_.js">
69
- <link rel="modulepreload" crossorigin href="/assets/transition-nav-link-DVwZxiEL.js">
70
- <link rel="modulepreload" crossorigin href="/assets/control-Doh5s9U2.js">
71
- <link rel="modulepreload" crossorigin href="/assets/catalog-CFU1TdO9.js">
67
+ <link rel="modulepreload" crossorigin href="/assets/route-preload-CLRbqehb.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/use-transition-navigate-Br9xwrqi.js">
69
+ <link rel="modulepreload" crossorigin href="/assets/transition-nav-link-BWSxzHUf.js">
70
+ <link rel="modulepreload" crossorigin href="/assets/control-C_0G31vu.js">
71
+ <link rel="modulepreload" crossorigin href="/assets/catalog-CMdsHJtX.js">
72
72
  <link rel="modulepreload" crossorigin href="/assets/select-display-items-Bqb6Sbg6.js">
73
73
  <link rel="modulepreload" crossorigin href="/assets/transition-types-2i1blGlR.js">
74
- <link rel="modulepreload" crossorigin href="/assets/fleet-jLriF31S.js">
75
- <link rel="modulepreload" crossorigin href="/assets/events-DAKmlfl3.js">
76
- <link rel="stylesheet" crossorigin href="/assets/index-D1lU9Fg9.css">
74
+ <link rel="modulepreload" crossorigin href="/assets/fleet-anqPXBbM.js">
75
+ <link rel="modulepreload" crossorigin href="/assets/events--facGImw.js">
76
+ <link rel="stylesheet" crossorigin href="/assets/index-BNGYKshE.css">
77
77
  </head>
78
78
  <body>
79
79
  <div id="root"></div>
package/miravo CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miravo/cli-linux-arm64-musl",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "description": "Miravo platform binary for linux-arm64-musl.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{at as n}from"./vendor-ui-CWUk2ulb.js";import{S as r,b as i,o as a}from"./api-DPmCeS_C.js";import{i as o,t as s}from"./query-fetch-error-C-7x_NhM.js";import{t as c}from"./proxy-Be4WzmcS.js";import{t as l}from"./AnimatePresence-CPmH1DMY.js";import{a as u,i as d,n as f,o as p,r as m,s as h,t as g}from"./copy-button-BvU3RDZa.js";import{S as _,c as v,h as y,s as b,u as x,x as ee}from"./format-CshN6yEB.js";import{n as S,t as C}from"./utils-XFKvwlFT.js";import{D as w,T,n as E,t as D,w as te}from"./use-platform-stream-8tr6SVec.js";import{t as O}from"./catalog-template-icons-3S8RvUxD.js";import{l as k}from"./select-CmlY1M1a.js";import{a as A}from"./platform-targets-BIQ1lKOg.js";import{i as j,n as M,r as N,t as P}from"./tabs-4SeH2unv.js";import{r as ne}from"./checkbox-C_4HRnS_.js";import{a as F,c as I,d as L,i as R,l as z,n as B,o as V,r as H,s as re,t as U,u as W}from"./catalog-source-ChUAD0NL.js";import{c as ie,i as ae,n as oe,r as G,t as se}from"./use-engine-command-mutation-iPA57YyA.js";import{t as K}from"./badge-eIn_7YrK.js";import{n as q}from"./get-error-message-Btp63MTs.js";var ce=S(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),le=S(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ue=S(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),J=e(t(),1),Y=n(),X=20,de=14,Z=`flex w-3.5 shrink-0 items-center justify-center`;function fe({instance:e,depth:t,area:n,line:r,detail:i}){let[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!1),l=a?e.tags:e.tags.slice(0,10),u=e.tags.length-10;return(0,Y.jsxs)(Y.Fragment,{children:[l.map(a=>(0,Y.jsx)(Q,{member:a,depth:t,area:n,line:r,instanceId:e.id,detail:i},a.name)),!a&&u>0&&(0,Y.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 border-t border-border/30 py-2 text-left font-mono text-xs text-muted-foreground hover:bg-muted/40 touch-manipulation sm:min-h-0 sm:py-1.5`,style:{paddingLeft:`${t*14+X}px`},onClick:()=>o(!0),children:[(0,Y.jsx)(`span`,{className:Z,"aria-hidden":!0}),(0,Y.jsxs)(`span`,{children:[`+`,u,` more tags`]})]}),e.properties.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 border-t border-border/30 py-2 text-left font-mono text-xs text-muted-foreground hover:bg-muted/40 touch-manipulation sm:min-h-0 sm:py-1.5`,style:{paddingLeft:`${t*14+X}px`},onClick:()=>c(e=>!e),children:[(0,Y.jsx)(`span`,{className:Z,"aria-hidden":!0,children:s?(0,Y.jsx)(k,{className:`size-3.5 opacity-60`,"aria-hidden":!0}):(0,Y.jsx)(A,{className:`size-3.5 opacity-60`,"aria-hidden":!0})}),(0,Y.jsxs)(`span`,{children:[e.properties.length,` properties`]})]}),s&&e.properties.map(a=>(0,Y.jsx)(Q,{member:a,depth:t,area:n,line:r,instanceId:e.id,detail:i},a.name))]})]})}function Q({member:e,depth:t,area:n,line:r,instanceId:i,detail:a}){let o=e.kind===`property`,s=t*14+X+(o?de:0),c=a.namespace,l=[c?.enterprise?`${c.enterprise}/${c.site??``}`:c?.prefix??``,n,r,i,e.name].filter(Boolean).join(`/`);return(0,Y.jsx)(g,{value:l,label:`Copy UNS path`,successMessage:`UNS path copied`,successDescription:l,tooltipSide:`top`,render:()=>(0,Y.jsxs)(`button`,{type:`button`,className:C(`flex w-full cursor-pointer flex-col gap-1 border-t border-border/25 py-2 text-left font-mono text-xs hover:bg-muted/35 touch-manipulation sm:min-h-0 sm:flex-row sm:items-center sm:gap-1.5 sm:py-1.5`,o&&`opacity-65`),style:{paddingLeft:`${s}px`},children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:Z,"aria-hidden":!0,children:(0,Y.jsx)(`span`,{className:C(`size-1 rounded-full ring-1 ring-border/50`,o?`bg-muted-foreground/25`:`bg-primary/50`)})}),(0,Y.jsx)(`span`,{title:e.name,className:C(`min-w-0 truncate`,o?`text-muted-foreground`:`text-foreground`),children:b(e.name)}),o&&(0,Y.jsx)(`span`,{className:`shrink-0 rounded-[var(--miravo-radius-tight)] bg-muted/60 px-1 py-px text-[10px] text-muted-foreground`,children:`PROP`})]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 pl-0 sm:ml-auto sm:flex-1 sm:justify-end sm:pl-0 sm:pr-1`,children:[(0,Y.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.dataType}),e.unit&&(0,Y.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.unit}),e.euRange&&(0,Y.jsxs)(`span`,{className:`ml-auto shrink-0 tabular-nums text-muted-foreground`,children:[`[`,e.euRange[0],`–`,e.euRange[1],`]`]})]})]})})}function $({depth:e,label:t,labelTitle:n,tag:r,tagKind:i,subtitle:a,subtitleTitle:o,count:s,expanded:c,onToggle:l,hasChildren:u}){let d=c?k:A,f=i===`area`?`text-primary`:`text-foreground`;return(0,Y.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full flex-col gap-1 border-t border-border/35 py-2 pr-2 text-left text-xs transition-colors touch-manipulation first:border-t-0 hover:bg-muted/40 sm:min-h-0 sm:flex-row sm:flex-wrap sm:items-center sm:gap-1.5 sm:gap-y-0 sm:py-1.5`,style:{paddingLeft:`${12+e*14}px`},onClick:l,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 w-full items-center gap-1.5 sm:w-auto sm:flex-1 sm:flex-wrap sm:items-center`,children:[u?(0,Y.jsx)(d,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,Y.jsx)(`span`,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{title:n??void 0,className:C(`min-w-0 flex-1 truncate font-medium`,f),children:t}),(0,Y.jsx)(`span`,{className:`shrink-0 text-[10px] tracking-wide text-muted-foreground uppercase`,children:r}),a&&(0,Y.jsx)(`span`,{title:o??void 0,className:`hidden min-w-0 max-w-[min(11rem,38vw)] shrink truncate font-mono text-xs text-muted-foreground sm:inline`,children:a}),s!==void 0&&(0,Y.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-xs text-muted-foreground`,children:s})]}),a&&(0,Y.jsx)(`span`,{title:o??void 0,className:`min-w-0 truncate pl-7 font-mono text-xs text-muted-foreground sm:hidden`,children:a})]})}function pe(e){let t=e.split(/[-_]/).filter(e=>e.length>0);return t[t.length-1]??e}function me(e,t,n){let r=[];for(let i of e){let e=pe(i.model),a=t.get(i.model),o=[],s=[];if(a)for(let[e,t]of Object.entries(a.members)){let n={name:e,kind:t.kind,dataType:t.dataType,unit:t.unit,euRange:t.euRange};t.kind===`property`?s.push(n):o.push(n)}for(let t=0;t<i.count;t++){let t=(n.get(i.model)??0)+1;n.set(i.model,t),r.push({id:`${e}-${String(t).padStart(3,`0`)}`,model:i.model,tags:o,properties:s})}}return r}function he({detail:e}){let[t,n]=(0,J.useState)(new Set),c=(0,J.useRef)(null),l=(0,J.useMemo)(()=>[...new Set(e.models)],[e.models]),u=l.join(`,`),d=o({queryKey:i.catalog.modelSchemasBatch(u),queryFn:async()=>Promise.all(l.map(e=>a(`/catalog/models/${e}`,r.catalogModelDetail)))}),f=d.isPending&&!d.data,p=(0,J.useMemo)(()=>{let e=new Map;if(!d.data)return e;for(let[t,n]of d.data.entries())e.set(l[t],n);return e},[d.data,l]),m=(0,J.useMemo)(()=>{let t=new Map,n=new Map;for(let r of e.topology)for(let e of r.lines)n.set(`${r.name}/${e.name}`,me(e.twins,p,t));return n},[e.topology,p]);(0,J.useEffect)(()=>{if(f)return;let t=e.name;if(c.current===t)return;let r=new Set;for(let t of e.topology){r.add(`area:${t.name}`);for(let e of t.lines)r.add(`line:${t.name}/${e.name}`)}outer:for(let t of e.topology)for(let e of t.lines){let n=(m.get(`${t.name}/${e.name}`)??[])[0];if(n){r.add(`inst:${t.name}/${e.name}/${n.id}`);break outer}}n(r),c.current=t},[f,e.name,e.topology,m]);let h=(0,J.useCallback)(e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return f?null:d.isError&&!d.data?(0,Y.jsx)(s,{message:q(d.error,`Failed to load model schemas.`),onRetry:()=>void d.refetch(),isRetrying:d.isFetching&&!d.isPending}):(0,Y.jsx)(`div`,{className:`overflow-hidden rounded-[var(--miravo-radius-stadium-sm)] border border-border/50 py-2 pl-1 pr-2 touch-manipulation sm:py-2.5 sm:pl-1.5 sm:pr-2.5`,children:e.topology.map(n=>{let r=`area:${n.name}`,i=t.has(r);return(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)($,{depth:0,label:y(n.name),labelTitle:n.name,tag:`AREA`,tagKind:`area`,expanded:i,onToggle:()=>h(r),hasChildren:!0}),i&&n.lines.map(r=>{let i=`line:${n.name}/${r.name}`,a=t.has(i),o=m.get(`${n.name}/${r.name}`)??[];return(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)($,{depth:1,label:y(r.name),labelTitle:r.name,tag:`LINE`,tagKind:`line`,count:o.length,expanded:a,onToggle:()=>h(i),hasChildren:!0}),a&&o.map(i=>{let a=`inst:${n.name}/${r.name}/${i.id}`,o=t.has(a);return(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)($,{depth:2,label:v(i.id),labelTitle:i.id,tag:`INST`,tagKind:`inst`,subtitle:y(i.model),subtitleTitle:i.model,count:i.tags.length+i.properties.length,expanded:o,onToggle:()=>h(a),hasChildren:i.tags.length+i.properties.length>0}),o&&(0,Y.jsx)(fe,{instance:i,depth:3,area:n.name,line:r.name,detail:e})]},i.id)})]},r.name)})]},n.name)})})}function ge(e){return e.lines.reduce((e,t)=>e+t.twins.reduce((e,t)=>e+t.count,0),0)}function _e(e){return Object.values(e.members).filter(e=>e.kind!==`property`).length}function ve(e,t){let n=0;for(let r of e.topology)for(let e of r.lines)for(let r of e.twins){let e=t.get(r.model),i=e?_e(e):0;n+=r.count*i}return n}function ye({template:e,onClose:t}){let[n,l]=(0,J.useState)(new Set),u=o({queryKey:i.catalog.templateDetail(e?.id??``),queryFn:()=>a(`/catalog/templates/${e?.id}`,r.catalogTemplateDetail),enabled:e!==null}),d=u.data,f=u.isPending&&!d,p=u.isError,m=q(u.error,`Failed to load environment.`),h=d?.models?.join(`,`)??``,g=o({queryKey:i.catalog.modelSchemasBatch(h),queryFn:async()=>{let e=d?.models??[];return e.length===0?[]:Promise.all(e.map(e=>a(`/catalog/models/${e}`,r.catalogModelDetail)))},enabled:d!==null}),_=(0,J.useMemo)(()=>{if(!d||!g.data)return null;let e=new Map;for(let[t,n]of g.data.entries())e.set(d.models[t],n);return ve(d,e)},[d,g.data]);(0,J.useEffect)(()=>{e&&d&&l(new Set(d.topology.map(e=>e.name)))},[e,d]);let v=(0,J.useCallback)(e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),y=D();return(0,Y.jsx)(F,{open:e!==null,onOpenChange:e=>{e||(y.reset(),t())},children:(0,Y.jsx)(V,{side:`right`,className:`flex w-full flex-col gap-4 touch-manipulation`,children:f?null:p&&!d?(0,Y.jsx)(`div`,{className:`flex flex-1 flex-col justify-center px-2`,children:(0,Y.jsx)(s,{message:m,onRetry:()=>void u.refetch(),isRetrying:u.isFetching})}):d?(0,Y.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,Y.jsxs)(I,{className:`gap-1 pb-0 pe-12`,children:[(0,Y.jsx)(z,{className:`font-heading text-base uppercase tracking-wide`,children:d.name}),d.description&&(0,Y.jsx)(re,{className:`text-xs leading-relaxed text-foreground/88`,children:d.description})]}),(0,Y.jsxs)(P,{defaultValue:`overview`,className:`flex min-h-0 flex-1 flex-col gap-1 pt-0`,children:[(0,Y.jsxs)(N,{variant:`line`,className:`h-8! shrink-0 gap-0.5 border-b-border/60 px-2 py-0.5`,children:[(0,Y.jsx)(j,{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,Y.jsx)(j,{value:`uns`,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:`UNS`}),(0,Y.jsx)(j,{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,Y.jsx)(M,{value:`overview`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 pb-1 pt-0.5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[d.topology.length,` areas`]}),(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[d.instanceCount,` twins`]}),(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[d.models.length,` models`]}),_!==null&&(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[_,` tags`]}),d.settings?.tickIntervalMs&&(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[`tick `,d.settings.tickIntervalMs,`ms`]}),d.settings?.timeMultiplier&&d.settings.timeMultiplier!==1&&(0,Y.jsxs)(K,{variant:`outline`,className:`font-mono text-xs`,children:[d.settings.timeMultiplier,`× speed`]}),(0,Y.jsx)(E,{stream:y})]}),d.namespace&&(d.namespace.enterprise||d.namespace.site||d.namespace.prefix)&&(0,Y.jsxs)(`div`,{className:`min-w-0 overflow-hidden rounded-[var(--miravo-radius-tight)] border border-border/60 px-2.5 py-2`,children:[(0,Y.jsx)(`h3`,{className:`font-heading text-xs font-semibold uppercase tracking-[0.12em] text-primary`,children:`Namespace`}),(0,Y.jsxs)(`dl`,{className:`mt-1 grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-2`,children:[d.namespace.enterprise&&(0,Y.jsxs)(`div`,{className:`min-w-0 sm:max-w-[min(100%,16rem)]`,children:[(0,Y.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Enterprise`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:d.namespace.enterprise})]}),d.namespace.site&&(0,Y.jsxs)(`div`,{className:`min-w-0 sm:max-w-[min(100%,16rem)]`,children:[(0,Y.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Site`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:d.namespace.site})]}),d.namespace.prefix&&(0,Y.jsxs)(`div`,{className:`min-w-0 sm:col-span-2`,children:[(0,Y.jsx)(`dt`,{className:`font-heading text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:`Prefix`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs leading-snug text-foreground [overflow-wrap:anywhere] break-words`,children:d.namespace.prefix})]})]})]}),d.topology.map(e=>(0,Y.jsx)(be,{area:e,expanded:n.has(e.name),onToggle:()=>v(e.name)},e.name)),d.settings&&(0,Y.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/50 p-2`,children:[(0,Y.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-heading text-xs font-semibold uppercase tracking-[0.12em] text-warning`,children:[(0,Y.jsx)(W,{className:`size-3.5`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{children:`Settings`})]}),(0,Y.jsxs)(`div`,{className:`grid grid-cols-1 gap-1.5 font-mono text-xs sm:grid-cols-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`tick interval`}),(0,Y.jsxs)(`span`,{className:`text-foreground`,children:[d.settings.tickIntervalMs??1e3,`ms`]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`time multiplier`}),(0,Y.jsxs)(`span`,{className:`text-foreground`,children:[d.settings.timeMultiplier??1,`×`]})]})]})]})]})})})}),(0,Y.jsx)(M,{value:`uns`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,Y.jsx)(`div`,{className:`pb-1 pt-0.5`,children:(0,Y.jsx)(he,{detail:d})})})})}),(0,Y.jsx)(M,{value:`deploy`,keepMounted:!0,className:`flex min-h-0 flex-1 flex-col`,children:(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-3 pt-0`,children:(0,Y.jsx)(R,{kind:`template`,id:d.id,displayName:d.name,yamlPath:`/catalog/templates/${d.id}/yaml`,yamlFilename:`${d.id}.miravo.yaml`,stream:y})})})]})]},d.id):(0,Y.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-muted-foreground`,children:`Environment not found`})})})}function be({area:e,expanded:t,onToggle:n}){let r=ge(e);return(0,Y.jsxs)(`div`,{className:G,children:[(0,Y.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-1.5 px-2.5 py-2 text-left text-xs font-medium transition-colors hover:bg-muted/30 touch-manipulation sm:min-h-0 sm:py-1.5`,onClick:n,children:[(0,Y.jsx)(ce,{className:`size-3.5 text-primary`}),(0,Y.jsx)(`span`,{className:`uppercase tracking-wider text-primary`,children:y(e.name)}),(0,Y.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,Y.jsxs)(K,{variant:`secondary`,className:`text-xs`,children:[r,` twins`]}),(0,Y.jsxs)(K,{variant:`secondary`,className:`text-xs`,children:[e.lines.length,` lines`]}),(0,Y.jsx)(k,{className:`size-3 text-muted-foreground transition-transform ${t?`rotate-180`:``}`})]})]}),(0,Y.jsx)(l,{initial:!1,children:t&&(0,Y.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,Y.jsx)(`div`,{className:`flex flex-col gap-1.5 border-t border-border p-2`,children:e.lines.map(e=>(0,Y.jsx)(xe,{line:e},e.name))})},`content`)})]})}function xe({line:e}){return(0,Y.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/60 bg-muted/10 p-2`,children:[(0,Y.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,Y.jsx)(ue,{className:`size-3.5`}),(0,Y.jsx)(`span`,{title:e.name,children:y(e.name)}),(0,Y.jsx)(le,{className:`ml-auto size-3.5 text-muted-foreground`}),(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.twins.reduce((e,t)=>e+t.count,0),` twins`]})]}),(0,Y.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.twins.map(e=>(0,Y.jsx)(Se,{twin:e},`${e.model}-${e.count}`))})]})}function Se({twin:e}){let t=e.parameters&&Object.keys(e.parameters).length>0;return(0,Y.jsxs)(`div`,{className:`rounded-[var(--miravo-radius-tight)] border border-border/30 bg-background/50 px-2.5 py-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,Y.jsx)(`span`,{className:`font-mono font-medium text-primary`,title:e.model,children:y(e.model)}),(0,Y.jsxs)(K,{variant:`secondary`,className:`shrink-0 px-1 py-0 text-xs`,children:[`×`,e.count]}),e.variation>0&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[`±`,(e.variation*100).toFixed(0),`% variation`]})]}),t&&e.parameters&&(0,Y.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-x-4 gap-y-1 border-t border-border/20 pt-1.5 font-mono text-xs`,children:Object.entries(e.parameters).map(([e,t])=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,Y.jsx)(`span`,{className:`text-foreground`,children:t})]},e))})]})}var Ce=[`builtin`,`personal`];function we(){let[e,t]=(0,J.useState)(``),[n,g]=(0,J.useState)(`all`),[v,y]=(0,J.useState)({}),[b,S]=(0,J.useState)(null),[w,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(null),O=(0,J.useRef)(null),k=se();(0,J.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(),O.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let A=o({queryKey:i.catalog.templates(),queryFn:()=>a(`/catalog/templates`,r.catalogTemplates)}),j=A.data??[],M=w===null?null:j.find(e=>e.id===w)??null,N=A.isPending&&!A.data,P=A.isError&&!A.data,F=A.isError&&!!A.data,I=q(A.error,`Failed to load environments.`),L=e=>v[e]??1,R=(0,J.useCallback)((e,t)=>{y(n=>({...n,[e]:Math.max(1,Math.min(10,t))}))},[]),z=(0,J.useCallback)(e=>{D(e)},[]),B=(0,J.useCallback)(e=>{T(e)},[]),V=async e=>{S(e);try{return await k.mutateAsync({type:`loadTemplate`,templatePath:e,count:L(e)}),!0}catch{return!1}finally{S(null)}},re=(0,J.useMemo)(()=>{let e={all:j.length};for(let t of Ce)e[t]=0;for(let t of j){let n=H(t.source);e[n]=(e[n]??0)+1}return e},[j]),U=e.toLowerCase(),W=j.filter(e=>n===`all`||H(e.source)===n).filter(e=>U?e.name.toLowerCase().includes(U)||e.id.toLowerCase().includes(U)||(e.description?.toLowerCase().includes(U)??!1):!0);return(0,Y.jsxs)(`div`,{className:`@container/templates mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`h1`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Environment Catalog`}),(0,Y.jsx)(K,{variant:`outline`,className:`text-xs`,children:P?(0,Y.jsx)(`span`,{className:`text-destructive`,children:`Unavailable`}):N&&j.length===0?(0,Y.jsx)(Y.Fragment,{children:`Loading...`}):(0,Y.jsxs)(Y.Fragment,{children:[new Set(j.map(e=>e.id)).size,` environments`]})})]}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Choose an environment to launch a realistic industrial system. Each environment includes pre-configured asset models with realistic physics, lifecycle degradation, and fault modes.`})]}),P&&(0,Y.jsx)(s,{message:I,onRetry:()=>void A.refetch(),isRetrying:A.isFetching}),F&&(0,Y.jsx)(s,{message:`${I} Showing cached environments.`,onRetry:()=>void A.refetch(),isRetrying:A.isFetching}),!P&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Y.jsxs)(`div`,{className:`relative max-w-xs flex-1 min-w-[14rem]`,children:[(0,Y.jsx)(te,{className:`absolute left-2.5 top-2.5 size-4 text-muted-foreground`}),(0,Y.jsx)(ee,{ref:O,placeholder:`Filter environments...`,value:e,onChange:e=>t(e.target.value),className:`pl-9 pr-7`}),!e&&(0,Y.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,Y.jsx)(De,{value:n,counts:re,onChange:g})]}),(0,Y.jsx)(`div`,{className:`grid grid-cols-1 gap-4 @[720px]/templates:grid-cols-2`,"aria-busy":N&&!P,children:P?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(l,{children:W.map((e,t)=>(0,Y.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,Y.jsx)(Te,{template:e,count:L(e.id),launching:b===e.id,onCountChange:R,onInspect:z,onLaunch:B})},`${e.source}:${e.id}`))}),W.length===0&&j.length>0&&(0,Y.jsx)(`p`,{className:`col-span-full py-8 text-center text-sm text-muted-foreground`,children:`No environments match the current filters.`})]})}),j.length>0&&(0,Y.jsx)(`div`,{className:C(G,`p-0`),children:(0,Y.jsx)(`div`,{className:`community-teaser relative overflow-hidden rounded-[inherit]`,children:(0,Y.jsx)(`div`,{className:`relative z-10 mx-auto max-w-3xl px-5 py-10 sm:px-10 sm:py-12`,children:(0,Y.jsxs)(`div`,{className:`grid items-center gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,17rem)]`,children:[(0,Y.jsxs)(`div`,{className:`order-2 flex min-w-0 flex-col gap-4 lg:order-1`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,Y.jsx)(`p`,{className:`blueprint-title text-primary`,children:`Future channel`}),(0,Y.jsx)(`span`,{className:`blueprint-stat text-[10px] text-muted-foreground`,children:`MIRAVO_REGISTRY · NOT_CONNECTED`})]}),(0,Y.jsx)(`h2`,{className:`font-heading text-xl font-semibold tracking-tight sm:text-2xl`,children:`Community Environments`}),(0,Y.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:`Share your industrial environments with the Miravo community. Publish custom environments, discover configurations from other engineers, and fork them as your starting point.`}),(0,Y.jsx)(`div`,{children:(0,Y.jsx)(K,{variant:`outline`,className:`community-teaser-soon border-primary/35 bg-primary/5 text-[10px] text-primary`,children:`Coming Soon`})})]}),(0,Y.jsx)(`div`,{className:`order-1 flex justify-center lg:order-2 lg:justify-end`,children:(0,Y.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,Y.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,Y.jsx)(ne,{className:`size-9 text-primary`,"aria-hidden":!0})}),(0,Y.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] tracking-[0.18em] text-muted-foreground`,children:`AWAITING SIGNAL`}),(0,Y.jsx)(`span`,{className:`blueprint-stat relative z-[1] text-[9px] text-muted-foreground`,children:`Uplink idle`})]})})]})})})}),(0,Y.jsx)(f,{open:w!==null,onOpenChange:e=>{e||T(null)},children:(0,Y.jsxs)(m,{children:[(0,Y.jsxs)(p,{children:[(0,Y.jsx)(h,{children:`Launch environment?`}),(0,Y.jsx)(d,{children:M!==null&&(0,Y.jsxs)(Y.Fragment,{children:[`This adds `,L(M.id),` instance`,L(M.id)===1?``:`s`,` of`,` `,(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:x(M.name)}),` `,`to the running environment.`]})})]}),(0,Y.jsxs)(u,{children:[(0,Y.jsx)(_,{variant:`outline`,disabled:b!==null,onClick:()=>T(null),children:`Cancel`}),(0,Y.jsx)(_,{disabled:b!==null||M===null,onClick:async()=>{M!==null&&await V(M.id)&&T(null)},children:b===M?.id?`Launching...`:`Launch`})]})]})}),(0,Y.jsx)(ye,{template:E,onClose:()=>D(null)})]})}var Te=(0,J.memo)(function({template:e,count:t,launching:n,onCountChange:r,onInspect:i,onLaunch:a}){return(0,Y.jsxs)(`div`,{className:C(ae,`flex flex-col gap-4 p-5`),children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] bg-primary/10 text-primary`,children:(0,Y.jsx)(O,{id:e.id,className:`size-5`})}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`font-heading text-sm font-semibold uppercase tracking-wide`,children:x(e.name)}),(0,Y.jsx)(`p`,{className:`line-clamp-3 text-xs leading-relaxed text-foreground/75`,children:e.description??`Industrial environment.`}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.id})]})]}),(0,Y.jsx)(`div`,{className:`px-3 py-2`,children:(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.models.map(e=>(0,Y.jsx)(K,{variant:`outline`,className:`h-auto min-h-5 rounded-[var(--miravo-radius-tight)] px-1.5 py-0 font-mono text-[10px] font-normal text-primary`,children:e},e))})}),(0,Y.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-4 font-mono text-[11px] text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`text-foreground`,children:e.instanceCount}),` instances`]}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`text-foreground`,children:e.models.length}),` models`]}),e.memberCount>0&&(0,Y.jsxs)(`span`,{children:[`~`,(0,Y.jsx)(`span`,{className:`text-foreground`,children:Ee(e.memberCount)}),` tags/cycle`]}),(0,Y.jsx)(K,{variant:`outline`,className:C(`ml-auto shrink-0 font-sans text-[10px] font-medium uppercase tracking-wide`,U(e.source)),children:B(e.source)})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/30 pt-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center rounded-[var(--miravo-radius-tight)] border bg-muted/30`,children:[(0,Y.jsx)(_,{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.id,t-1)},children:(0,Y.jsx)(L,{className:`size-3`})}),(0,Y.jsx)(`span`,{className:`flex size-7 items-center justify-center border-x font-mono text-xs`,children:t}),(0,Y.jsx)(_,{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.id,t+1)},children:(0,Y.jsx)(T,{className:`size-3`})})]}),(0,Y.jsxs)(_,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>i(e),className:oe,children:[(0,Y.jsx)(w,{className:`size-3.5`,"aria-hidden":!0}),`Inspect`]}),(0,Y.jsxs)(_,{size:`sm`,className:`ml-auto`,disabled:n,onClick:()=>a(e.id),children:[(0,Y.jsx)(ie,{className:`mr-1 size-3`}),n?`...`:`Launch`]})]})]})});function Ee(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function De({value:e,counts:t,onChange:n}){return(0,Y.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,role:`radiogroup`,"aria-label":`Filter by source`,children:[{id:`all`,label:`All`},...Ce.map(e=>({id:e,label:B(e)}))].map(r=>{let i=e===r.id,a=t[r.id]??0,o=r.id!==`all`&&a===0;return(0,Y.jsxs)(`label`,{className:C(`inline-flex h-7 items-center gap-1.5 rounded-[var(--miravo-radius-pill)] border px-3 text-xs font-medium transition-colors`,i?`border-primary/60 bg-primary/15 text-primary`:`border-border/60 bg-card/30 text-muted-foreground hover:border-border hover:bg-muted/40 hover:text-foreground`,o?`cursor-not-allowed opacity-40 hover:border-border/60 hover:bg-card/30 hover:text-muted-foreground`:`cursor-pointer`),children:[(0,Y.jsx)(`input`,{type:`radio`,name:`catalog-source-filter`,value:r.id,checked:i,disabled:o,onChange:()=>n(r.id),className:`sr-only`}),(0,Y.jsx)(`span`,{children:r.label}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] opacity-70`,children:a})]},r.id)})})}export{we as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./catalog-CFU1TdO9.js";export{e as CatalogPage};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{c as t}from"./vendor-charts-95ykyDlI.js";import{$ as n,J as r,Q as i,X as a,Y as o,Z as s,at as c,q as l}from"./vendor-ui-CWUk2ulb.js";import{S as u,a as d,b as ee,o as f,s as te}from"./api-DPmCeS_C.js";import{i as ne,s as re,t as ie}from"./query-fetch-error-C-7x_NhM.js";import{t as p}from"./proxy-Be4WzmcS.js";import{t as ae}from"./AnimatePresence-CPmH1DMY.js";import{a as oe,i as se,l as m,n as ce,o as le,r as ue,s as de}from"./copy-button-BvU3RDZa.js";import{S as h,w as fe,x as pe}from"./format-CshN6yEB.js";import{n as g,t as _}from"./utils-XFKvwlFT.js";import{S as me,b as he,d as ge,f as _e,g as ve,h as ye,i as be,p as xe,r as Se,s as Ce,x as we,y as Te}from"./use-platform-stream-8tr6SVec.js";import{a as v,c as Ee,i as y,n as De,o as Oe,r as b,s as ke,t as Ae}from"./select-CmlY1M1a.js";import{a as je,i as x,n as Me,r as S,t as Ne}from"./platform-targets-BIQ1lKOg.js";import{a as C,o as w}from"./tabs-4SeH2unv.js";import{t as Pe}from"./download-DmUZKo9N.js";import{r as Fe}from"./checkbox-C_4HRnS_.js";import{t as Ie}from"./badge-eIn_7YrK.js";import{t as T}from"./label-CMBWxUhA.js";import{n as E}from"./get-error-message-Btp63MTs.js";var Le=g(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Re=g(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),D=c();function O({...e}){return(0,D.jsx)(r,{"data-slot":`sheet`,...e})}function k({...e}){return(0,D.jsx)(o,{"data-slot":`sheet-portal`,...e})}function A({className:e,...t}){return(0,D.jsx)(n,{"data-slot":`sheet-overlay`,className:_(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function j({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...o}){return(0,D.jsxs)(k,{children:[(0,D.jsx)(A,{}),(0,D.jsxs)(a,{"data-slot":`sheet-content`,"data-side":n,className:_(`fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-[calc(100vw-1rem)] data-[side=left]:max-w-md data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-[calc(100vw-1rem)] data-[side=right]:max-w-xl data-[side=right]:border-l data-[side=right]:pl-1 data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem]`,e),...o,children:[t,r&&(0,D.jsxs)(i,{"data-slot":`sheet-close`,render:(0,D.jsx)(h,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,D.jsx)(fe,{}),(0,D.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function M({className:e,...t}){return(0,D.jsx)(`div`,{"data-slot":`sheet-header`,className:_(`flex flex-col gap-0.5 p-2`,e),...t})}function N({className:e,...t}){return(0,D.jsx)(l,{"data-slot":`sheet-title`,className:_(`text-base font-medium text-foreground`,e),...t})}function P({className:e,...t}){return(0,D.jsx)(s,{"data-slot":`sheet-description`,className:_(`text-sm text-muted-foreground`,e),...t})}var F=e(t(),1),ze=[{value:`opcua`,label:`OPC UA`},{value:`mqtt`,label:`MQTT`},{value:`modbus`,label:`Modbus`}];function Be({value:e,onValueChange:t,labelledBy:n}){return(0,D.jsx)(`fieldset`,{"aria-labelledby":n,className:`min-w-0 border-0 p-0`,children:(0,D.jsx)(`div`,{className:`flex gap-1.5`,children:ze.map(n=>{let r=e===n.value;return(0,D.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>t(n.value),className:_(`flex flex-1 items-center justify-center rounded-[var(--miravo-radius-pill)] border py-1.5 text-center transition-[background-color,border-color,color,box-shadow] duration-200`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/80 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,r?`border-primary/45 bg-primary/10 text-primary shadow-[inset_0_1px_0_0_rgba(255,255,255,0.06),0_0_0_1px_color-mix(in_srgb,var(--primary)_25%,transparent)]`:`border-border/75 bg-background/55 text-foreground/82 hover:border-border/90 hover:bg-background/70 hover:text-foreground/92`),children:(0,D.jsxs)(`span`,{className:`inline-flex items-center justify-center gap-1.5 font-mono text-[11px] font-medium leading-none tracking-wide`,children:[(0,D.jsx)(C,{className:`size-2.5 shrink-0 -translate-y-px opacity-80`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:n.label})]})},n.value)})})})}var I=`172.17.0.1`;async function Ve(e){let t=await f(`/catalog/models/${encodeURIComponent(e)}/le-dt.json`,u.catalogModelLeDt);return JSON.stringify(t,null,2)}async function He(e,t={host:I}){let n=u.catalogTemplateLeTemplateJson.query;if(!n)throw Error(`Missing query schema for ${u.catalogTemplateLeTemplateJson.method} ${u.catalogTemplateLeTemplateJson.path}`);let r=n.safeParse(t);if(!r.success)throw Error(`Invalid request for ${u.catalogTemplateLeTemplateJson.method} ${u.catalogTemplateLeTemplateJson.path}: ${r.error.message}`);return d(`/catalog/templates/${encodeURIComponent(e)}/le-template.json${L(r.data)}`,u.catalogTemplateLeTemplateJson)}function L(e){let t=new URLSearchParams;return e.host&&t.set(`host`,e.host),e.protocol&&t.set(`protocol`,e.protocol),t.size>0?`?${t.toString()}`:``}function Ue(e){let t=e.split(/[-_]/).filter(e=>e.length>0);return t[t.length-1]??e}function We(e){return`${Ue(e)}-001`}function Ge(e,t){return[t,...e?.filter(e=>e.id!==t.id)??[]]}async function Ke(e){let t=await e.create();e.onCreated(t);try{await e.refresh()}catch(t){e.onRefreshFailed(t)}}function qe(e){return x.find(t=>t.id===e)?.label??e}function Je(e){return e===`template`?`Litmus Edge Template`:`Litmus Edge`}function R({kind:e,id:t,displayName:n,yamlPath:r,yamlFilename:i,stream:a}){let o=re(),s=ne({queryKey:ee.platforms.targets(),queryFn:()=>Ce()}),c=s.data??[],[l,d]=(0,F.useState)(``),[f,g]=(0,F.useState)(`opcua`),[C,Le]=(0,F.useState)(`litmus-edge`),[Re,O]=(0,F.useState)(!1),[k,A]=(0,F.useState)(!1),[j,M]=(0,F.useState)(S.id),[N,P]=(0,F.useState)({label:``,hostname:``,apiToken:``,sourceHostname:``}),[ze,L]=(0,F.useState)(!1),[Ue,R]=(0,F.useState)(!1),{testing:Ye,runTest:z,cancelInFlight:Xe}=Se(),[B,V]=(0,F.useState)(!1),[H,U]=(0,F.useState)(I),[W,Ze]=(0,F.useState)(!1),Qe=(0,F.useId)();(0,F.useEffect)(()=>{k&&(M(S.id),P({label:``,hostname:``,apiToken:``,sourceHostname:``}),L(!1))},[k]);let G=j===S.id&&N.hostname.trim().length>0&&N.sourceHostname.trim().length>0&&N.apiToken.trim().length>0,K=c.find(e=>e.id===l),$e=(0,F.useCallback)(n=>{O(!1),l&&(e===`model`?a.startApply({targetId:l,model:t,protocol:f,scope:n.scope,deviceName:n.deviceName,ifUnmanaged:n.ifUnmanaged}):a.startApply({targetId:l,template:t,scope:n.scope,ifUnmanaged:n.ifUnmanaged}))},[l,t,e,f,a]),et=(0,F.useCallback)(async()=>{if(j!==S.id){m.error(`${qe(j)} target setup is coming soon.`);return}if(!N.label||!N.hostname||!N.sourceHostname){m.error(`Label, hostname, and source host are required.`);return}if(!N.apiToken){m.error(`API token is required for new targets.`);return}R(!0);try{await Ke({create:()=>be({...N,platformId:j}),onCreated:e=>{o.setQueryData(ee.platforms.targets(),t=>Ge(t,e)),d(e.id),A(!1),m.success(`Target added.`)},refresh:async()=>{let e=await s.refetch();if(e.error)throw e.error},onRefreshFailed:e=>{m.error(`Target added, but target list refresh failed.`,{description:`${E(e,`Target list refresh failed.`)} Reload targets before retrying another add.`})}})}catch(e){m.error(E(e,`Failed to add target.`))}finally{R(!1)}},[j,N,s,o]),tt=(0,F.useCallback)(()=>{G&&z({hostname:N.hostname.trim(),sourceHostname:N.sourceHostname.trim(),apiToken:N.apiToken.trim()})},[G,N,z]),q=C===`source-yaml`,J=C===`litmus-edge`||q,Y=(0,F.useCallback)(async n=>{if(q){try{let t=await te(r,e===`model`?u.catalogModelYaml:u.catalogTemplateYaml),n=new Blob([t],{type:`text/yaml`}),a=URL.createObjectURL(n),o=document.createElement(`a`);o.href=a,o.download=i,o.click(),URL.revokeObjectURL(a),m.success(`Exported ${i}`)}catch{m.error(`Failed to export YAML`)}return}if(C===`litmus-edge`)try{if(e===`model`){let e=await Ve(t),n=new Blob([e],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${t}.le-dt.json`,i.click(),URL.revokeObjectURL(r),m.success(`Exported ${t}.le-dt.json`)}else{let e=n?.templateHost?.trim()??``,r=e.length>0?e:I,i=`${t}.le-template.json`,a=await He(t,{host:r,protocol:f}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=i,s.click(),URL.revokeObjectURL(o),m.success(`Exported ${i}`)}}catch{m.error(`Failed to export platform format`)}},[C,q,e,t,r,i,f]),nt=(0,F.useCallback)(()=>{if(J){if(C===`litmus-edge`&&e===`template`){U(I),V(!0);return}Y()}},[J,C,e,Y]),rt=(0,F.useCallback)(async()=>{Ze(!0);try{await Y({templateHost:H}),V(!1)}finally{Ze(!1)}},[H,Y]),X=a.status===`running`,Z=a.cancelRequested,Q=!!l&&!X,it=!!a.operation||X,$=it?Te(a):null;return(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 px-1 py-2`,children:[(0,D.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,D.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Deploy`}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(T,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Target`}),s.isError&&s.data===void 0&&(0,D.jsx)(ie,{message:E(s.error,`Failed to load targets.`),onRetry:()=>void s.refetch(),isRetrying:s.isFetching&&!s.isPending}),(0,D.jsx)(ge,{targets:c,value:l,onValueChange:d,size:`sm`,className:`min-w-0 w-full border-border/65 bg-background/55 text-xs text-foreground`,onAddNew:()=>A(!0)})]}),e===`model`&&c.length>0&&(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(T,{id:Qe,className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Protocol binding`}),(0,D.jsx)(Be,{value:f,onValueChange:g,labelledBy:Qe})]}),c.length>0&&(0,D.jsxs)(`button`,{type:`button`,disabled:!Q,onClick:()=>O(!0),className:_(`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`,Q?[`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,D.jsxs)(`span`,{className:`relative flex w-18 shrink-0 items-center justify-center bg-transparent`,"aria-hidden":!0,children:[(0,D.jsx)(`span`,{className:_(`absolute inset-y-2 -right-px w-px bg-linear-to-b from-transparent via-primary/30 to-transparent opacity-70`,!Q&&`via-border/80`)}),(0,D.jsx)(Fe,{className:_(`relative size-5`,Q?`text-primary`:`text-foreground/75`)})]}),(0,D.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,D.jsx)(`span`,{className:_(`font-heading text-[11px] font-semibold uppercase tracking-[0.16em]`,Q?`text-primary`:`text-foreground/78`),children:Q?`Commit deploy`:X?`Deploy in progress…`:`Awaiting target`}),(0,D.jsx)(`span`,{className:_(`truncate font-mono text-[13px] leading-tight tracking-tight`,Q?`text-foreground`:`text-foreground/80`),children:K?.label??`Select a target above`})]}),(0,D.jsx)(`span`,{className:_(`flex shrink-0 items-center pr-2.5 sm:pr-3`,Q&&`pl-1`),children:(0,D.jsx)(`span`,{className:_(`flex size-9 items-center justify-center rounded-[var(--miravo-radius-stadium-sm)] border bg-transparent transition-[border-color,color] duration-200`,Q?`border-primary/40 text-primary group-hover:border-primary/55`:`border-border/75 text-foreground/75`),"aria-hidden":!0,children:(0,D.jsx)(je,{className:`size-4`,strokeWidth:2.25})})})]})]})}),(0,D.jsx)(ae,{children:it&&$?(0,D.jsx)(xe,{title:$.title,subtitle:$.subtitle,footerAction:X&&a.operation?.operationId?(0,D.jsx)(h,{variant:`outline`,size:`sm`,disabled:Z,"aria-busy":Z,className:_(`ml-auto group h-8 gap-1.5 px-3 text-xs`,Z?`cursor-not-allowed`:`hover:bg-destructive/12 hover:text-destructive hover:border-destructive/35`),onClick:()=>{a.cancel().catch(()=>{})},children:Z?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(w,{className:`size-3.5 shrink-0 animate-spin text-muted-foreground`,"aria-hidden":!0}),(0,D.jsx)(p.span,{animate:{opacity:[1,.72,1]},transition:{duration:1.25,repeat:1/0,ease:`easeInOut`},className:`font-medium text-foreground`,children:`Cancelling…`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(fe,{className:`size-3.5 shrink-0 text-foreground/65 group-hover:text-destructive`,"aria-hidden":!0}),(0,D.jsx)(p.span,{animate:{opacity:[1,.88,1]},transition:{duration:2.2,repeat:1/0,ease:`easeInOut`},children:`Cancel`})]})}):(0,D.jsx)(`div`,{className:`ml-auto shrink-0 flex items-center`,children:(0,D.jsx)(h,{type:`button`,variant:`secondary`,size:`xs`,className:`h-7 px-3 text-[10px] font-medium`,onClick:a.reset,children:`Close`})}),onDismiss:a.reset,children:a.operation?(0,D.jsx)(ve,{operation:a.operation,catalogTemplates:[{id:t,name:n}],logs:a.logs}):(0,D.jsxs)(`div`,{className:`flex flex-col gap-2 py-1`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(w,{className:`size-3.5 animate-spin text-primary`,"aria-hidden":!0}),(0,D.jsx)(`span`,{className:`text-xs text-foreground/88`,children:`Connecting to Litmus Edge…`})]}),(0,D.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-muted/40`,children:(0,D.jsx)(p.div,{className:`h-full w-2/5 rounded-full bg-primary`,animate:{x:[`-100%`,`250%`]},transition:{duration:1.2,repeat:1/0,ease:`easeInOut`}})})]})},`deploy-stream`):null}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border/40 pt-5`,children:[(0,D.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.2em] text-foreground`,children:`Export`}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(T,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.14em] text-foreground/78`,children:`Format`}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,D.jsxs)(Ae,{value:C,onValueChange:e=>{e&&Le(e)},children:[(0,D.jsx)(ke,{size:`sm`,className:`h-9! min-h-9 min-w-0 flex-1 border-border/65 bg-background/55 py-0 text-xs text-foreground`,children:(0,D.jsx)(Ee,{placeholder:`Select format`,children:t=>{if(t===`source-yaml`)return`Source YAML`;let n=x.find(e=>e.id===t);return n?.id===`litmus-edge`?Je(e):n?.exportLabel??`Select format`}})}),(0,D.jsxs)(De,{children:[(0,D.jsxs)(b,{children:[(0,D.jsx)(v,{children:`Platform`}),Ne.map(t=>(0,D.jsx)(y,{value:t.id,children:t.id===`litmus-edge`?Je(e):t.exportLabel},t.id)),Me.map(e=>(0,D.jsx)(y,{value:e.id,disabled:!0,children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.exportLabel,(0,D.jsx)(Ie,{variant:`outline`,className:`px-1 py-0 text-[10px] text-foreground/72`,children:`Coming Soon`})]})},e.id))]}),(0,D.jsx)(Oe,{}),(0,D.jsxs)(b,{children:[(0,D.jsx)(v,{children:`Source`}),(0,D.jsxs)(y,{value:`source-yaml`,children:[`Source YAML`,` `,(0,D.jsx)(`span`,{className:`text-foreground/72`,children:e===`model`?`.twin.yaml`:`.miravo.yaml`})]})]})]})]}),(0,D.jsxs)(h,{variant:`outline`,size:`sm`,className:`h-9 min-h-9 shrink-0 gap-1.5 border-border/70 bg-background/50 px-4 text-xs font-medium text-foreground sm:w-auto`,disabled:!J,onClick:nt,children:[(0,D.jsx)(Pe,{className:`size-3.5`}),`Download`]})]})]}),(0,D.jsx)(`p`,{className:`text-[11px] leading-snug text-foreground/70`,children:(0,D.jsx)(ye,{format:C,kind:e})})]}),K&&(0,D.jsx)(he,{open:Re,onOpenChange:O,type:`apply`,label:n,targetLabel:K.label,hostname:K.hostname,sourceHostname:K.sourceHostname,onConfirm:$e,defaultDeviceName:e===`model`?We(t):void 0}),(0,D.jsx)(_e,{open:k,editing:!1,platformId:j,form:N,showToken:ze,saving:Ue,testing:Ye,canTestConnection:G,onOpenChange:A,onPlatformChange:M,onFormChange:P,onShowTokenChange:L,onSave:()=>void et(),onTestConnection:tt,onCancelInFlight:Xe}),(0,D.jsx)(ce,{open:B,onOpenChange:e=>{V(e),e||U(I)},children:(0,D.jsxs)(ue,{className:`sm:max-w-md`,children:[(0,D.jsxs)(le,{children:[(0,D.jsx)(de,{children:`Download Litmus Edge Template`}),(0,D.jsx)(se,{children:we})]}),(0,D.jsxs)(`div`,{className:`space-y-2 py-1`,children:[(0,D.jsx)(T,{htmlFor:`deploy-export-source-host`,children:me}),(0,D.jsx)(pe,{id:`deploy-export-source-host`,value:H,onChange:e=>U(e.target.value),placeholder:I,autoComplete:`off`,className:`font-mono text-sm`}),(0,D.jsxs)(`p`,{className:`text-[11px] leading-snug text-muted-foreground`,children:[`Use an IP or hostname reachable from Litmus Edge (e.g.`,` `,(0,D.jsx)(`span`,{className:`font-mono`,children:I}),` for Docker bridge).`]})]}),(0,D.jsxs)(oe,{className:`gap-2 sm:gap-0`,children:[(0,D.jsx)(h,{type:`button`,variant:`outline`,onClick:()=>V(!1),disabled:W,children:`Cancel`}),(0,D.jsxs)(h,{type:`button`,className:`gap-1.5`,onClick:()=>void rt(),disabled:W,"aria-busy":W,children:[W?(0,D.jsx)(w,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,D.jsx)(Pe,{className:`size-3.5`,"aria-hidden":!0}),`Download`]})]})]})})]})}var Ye={builtin:`Built-in`,personal:`Personal`,community:`Community`},z=`border-border/60 bg-muted/40 text-muted-foreground`,Xe={builtin:z,personal:`border-primary/40 bg-primary/10 text-primary`,community:`border-accent/40 bg-accent/10 text-accent`};function B(e){return e===`cwd`||e===`namespace`?`personal`:e}function V(e){return Ye[B(e)]??e}function H(e){return Xe[B(e)]??z}export{O as a,M as c,Le as d,R as i,N as l,V as n,j as o,B as r,P as s,H as t,Re as u};
@@ -1 +0,0 @@
1
- import{t as e}from"./control-Doh5s9U2.js";export{e as ControlPage};
@@ -1 +0,0 @@
1
- import{t as e}from"./events-DAKmlfl3.js";export{e as EventsPage};
@@ -1 +0,0 @@
1
- import{t as e}from"./fleet-jLriF31S.js";export{e as FleetPage};