miravo 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +199 -0
- package/README.md +29 -59
- package/bin/miravo.js +84 -0
- package/package.json +21 -37
- package/console-dist/assets/activity-DsWeRq4h.js +0 -1
- package/console-dist/assets/api-4AqKvsm9.js +0 -1
- package/console-dist/assets/arrow-right-Ea_UhTNi.js +0 -1
- package/console-dist/assets/arrow-up-down-DFSjzzl2.js +0 -1
- package/console-dist/assets/blueprint-card-classes-DBFCDy0M.js +0 -1
- package/console-dist/assets/box-C1WaoOMF.js +0 -1
- package/console-dist/assets/card-BjeP32PN.js +0 -1
- package/console-dist/assets/catalog-BJzyzbLR.js +0 -1
- package/console-dist/assets/catalog-DKjEm-c4.js +0 -1
- package/console-dist/assets/catalog-template-icons-BrUeHaCY.js +0 -1
- package/console-dist/assets/checkbox-DZlJXTE4.js +0 -1
- package/console-dist/assets/chunk-OE4NN4TA-CEjpfhS6.js +0 -3
- package/console-dist/assets/combobox-BGnuCYxO.js +0 -1
- package/console-dist/assets/control-CPhvwx9o.js +0 -1
- package/console-dist/assets/control-Cg2up9NA.js +0 -1
- package/console-dist/assets/copy-button-WkbNkMcd.js +0 -1
- package/console-dist/assets/createLucideIcon-Bwxw859K.js +0 -1
- package/console-dist/assets/deploy-tab-JeWDwPoZ.js +0 -1
- package/console-dist/assets/dist-BhbDML0a.js +0 -1
- package/console-dist/assets/dist-Cy8XTNFT.js +0 -2
- package/console-dist/assets/download-DQ6NH16U.js +0 -1
- package/console-dist/assets/engine-store-CrLnz692.js +0 -1
- package/console-dist/assets/events-CXm29Ok4.js +0 -1
- package/console-dist/assets/events-D01IxhnP.js +0 -1
- package/console-dist/assets/fira-code-cyrillic-ext-wght-normal-DhYMMuQd.woff2 +0 -0
- package/console-dist/assets/fira-code-cyrillic-wght-normal-Y3u8pIsh.woff2 +0 -0
- package/console-dist/assets/fira-code-greek-ext-wght-normal-wWus70Ix.woff2 +0 -0
- package/console-dist/assets/fira-code-greek-wght-normal-B2SviObF.woff2 +0 -0
- package/console-dist/assets/fira-code-latin-ext-wght-normal-Dvfvaomy.woff2 +0 -0
- package/console-dist/assets/fira-code-latin-wght-normal-CHoedHDv.woff2 +0 -0
- package/console-dist/assets/fira-code-symbols2-wght-normal-CE6EOz_n.woff2 +0 -0
- package/console-dist/assets/fleet-CfxbKXt9.js +0 -1
- package/console-dist/assets/fleet-lotMGVqe.js +0 -1
- package/console-dist/assets/format-kXTonpDJ.js +0 -1
- package/console-dist/assets/gauge-Ci8zNZlk.js +0 -1
- package/console-dist/assets/get-error-message-3Q5Q-2G5.js +0 -1
- package/console-dist/assets/index-CVPKSDvJ.js +0 -12
- package/console-dist/assets/index-DJkgDeun.css +0 -2
- package/console-dist/assets/input-BWEQFptx.js +0 -1
- package/console-dist/assets/instance-detail-C5IVwuh3.js +0 -1
- package/console-dist/assets/karla-latin-ext-wght-normal-Dq0rrjgs.woff2 +0 -0
- package/console-dist/assets/karla-latin-wght-normal-C3-ma4ov.woff2 +0 -0
- package/console-dist/assets/label-uephX5ZG.js +0 -1
- package/console-dist/assets/layers-CUsLQ1fq.js +0 -1
- package/console-dist/assets/login-C3RJli0m.js +0 -126
- package/console-dist/assets/models-B_UioWQ5.js +0 -1
- package/console-dist/assets/models-_IPlPiZ7.js +0 -1
- package/console-dist/assets/not-found-B8gAm08S.js +0 -1
- package/console-dist/assets/platform-targets-R3T-4eJ7.js +0 -1
- package/console-dist/assets/platforms-BWh0BQ3Y.js +0 -1
- package/console-dist/assets/platforms-DStNbtVc.js +0 -1
- package/console-dist/assets/proxy-CsnYqnPp.js +0 -9
- package/console-dist/assets/query-keys-BvtE7BMs.js +0 -1
- package/console-dist/assets/radio-CoHegOv5.js +0 -1
- package/console-dist/assets/rolldown-runtime-COnpUsM8.js +0 -1
- package/console-dist/assets/schibsted-grotesk-latin-ext-wght-normal-hsMS0n0O.woff2 +0 -0
- package/console-dist/assets/schibsted-grotesk-latin-wght-normal-Bb8VGrTG.woff2 +0 -0
- package/console-dist/assets/select-CeO4vP0G.js +0 -1
- package/console-dist/assets/select-display-items-CIzY8953.js +0 -1
- package/console-dist/assets/server-D9Kfn8fQ.js +0 -1
- package/console-dist/assets/shallow-6lGjQhtJ.js +0 -1
- package/console-dist/assets/tags-CiXOIHtY.js +0 -4
- package/console-dist/assets/tags-FQCXIxrP.js +0 -1
- package/console-dist/assets/tooltip-HGLF366Q.js +0 -1
- package/console-dist/assets/transition-nav-link-Df4Rk6vV.js +0 -1
- package/console-dist/assets/transition-types-CPlGtM8w.js +0 -1
- package/console-dist/assets/triangle-alert-adNk_sea.js +0 -1
- package/console-dist/assets/use-platform-stream-DGbK1k2L.js +0 -2
- package/console-dist/assets/use-transition-navigate-CCpcWXB0.js +0 -2
- package/console-dist/assets/validation-Blvud9_O.js +0 -1
- package/console-dist/assets/vendor-charts-CAZdaPlq.js +0 -60
- package/console-dist/assets/vendor-table-wd8JuMmT.js +0 -4
- package/console-dist/assets/vendor-ui-ByahnaY0.js +0 -1
- package/console-dist/favicon.svg +0 -37
- package/console-dist/index.html +0 -82
- package/console-dist/miravo-logo.png +0 -0
- package/src/__tests__/integration/executable-methods-runner.ts +0 -262
- package/src/__tests__/integration/executable-methods.integration.ts +0 -2348
- package/src/__tests__/integration/opcua-concurrent-clients.integration.ts +0 -314
- package/src/commands/adapter.ts +0 -249
- package/src/commands/apply.test.ts +0 -62
- package/src/commands/apply.ts +0 -216
- package/src/commands/cleanup.test.ts +0 -34
- package/src/commands/cleanup.ts +0 -201
- package/src/commands/cli-test-setup.ts +0 -91
- package/src/commands/export.test.ts +0 -51
- package/src/commands/export.ts +0 -404
- package/src/commands/fork.ts +0 -219
- package/src/commands/inject.test.ts +0 -57
- package/src/commands/inject.ts +0 -212
- package/src/commands/load.ts +0 -167
- package/src/commands/logs.ts +0 -173
- package/src/commands/models.test.ts +0 -162
- package/src/commands/models.ts +0 -338
- package/src/commands/pause.ts +0 -67
- package/src/commands/platforms.test.ts +0 -186
- package/src/commands/platforms.ts +0 -371
- package/src/commands/ps.ts +0 -116
- package/src/commands/remove.ts +0 -38
- package/src/commands/reset.ts +0 -44
- package/src/commands/rm.ts +0 -97
- package/src/commands/spawn.ts +0 -45
- package/src/commands/speed.ts +0 -40
- package/src/commands/start/adapter-config.ts +0 -157
- package/src/commands/start/catalog-le-dt.test.ts +0 -50
- package/src/commands/start/catalog-le-dt.ts +0 -187
- package/src/commands/start/catalog-model-schema.ts +0 -89
- package/src/commands/start/catalog-template-detail.ts +0 -54
- package/src/commands/start/daemon.ts +0 -255
- package/src/commands/start/display.ts +0 -150
- package/src/commands/start/engine-setup.ts +0 -247
- package/src/commands/start/events.ts +0 -126
- package/src/commands/start/index.ts +0 -897
- package/src/commands/start/protocol-plans.ts +0 -239
- package/src/commands/start/template-loader.ts +0 -197
- package/src/commands/start/template-resolver.ts +0 -185
- package/src/commands/start/types.ts +0 -73
- package/src/commands/start.test.ts +0 -480
- package/src/commands/status.test.ts +0 -20
- package/src/commands/status.ts +0 -470
- package/src/commands/stop.test.ts +0 -84
- package/src/commands/stop.ts +0 -169
- package/src/commands/templates.test.ts +0 -58
- package/src/commands/templates.ts +0 -277
- package/src/index.ts +0 -166
- package/src/lib/admin-auth.ts +0 -157
- package/src/lib/admin-client.test.ts +0 -51
- package/src/lib/admin-client.ts +0 -326
- package/src/lib/admin-platform-routes.ts +0 -1017
- package/src/lib/admin-platform-stream.test.ts +0 -434
- package/src/lib/admin-platform-stream.ts +0 -788
- package/src/lib/admin-responses.ts +0 -211
- package/src/lib/admin-server.test.ts +0 -781
- package/src/lib/admin-server.ts +0 -797
- package/src/lib/auth-store.ts +0 -87
- package/src/lib/daemon-registry.test.ts +0 -429
- package/src/lib/daemon-registry.ts +0 -343
- package/src/lib/le/le-apply.test.ts +0 -591
- package/src/lib/le/le-apply.ts +0 -832
- package/src/lib/le/le-auth.ts +0 -89
- package/src/lib/le/le-cleanup.test.ts +0 -168
- package/src/lib/le/le-cleanup.ts +0 -399
- package/src/lib/le/le-cli-helpers.ts +0 -77
- package/src/lib/le/le-client.ts +0 -184
- package/src/lib/le/le-concurrency.test.ts +0 -157
- package/src/lib/le/le-concurrency.ts +0 -78
- package/src/lib/le/le-connection-test.ts +0 -42
- package/src/lib/le/le-devicehub-properties.test.ts +0 -53
- package/src/lib/le/le-devicehub-properties.ts +0 -33
- package/src/lib/le/le-devicehub.ts +0 -213
- package/src/lib/le/le-digital-twins.ts +0 -285
- package/src/lib/le/le-drivers.ts +0 -23
- package/src/lib/le/le-endpoint.ts +0 -40
- package/src/lib/le/le-environments.test.ts +0 -73
- package/src/lib/le/le-environments.ts +0 -156
- package/src/lib/le/le-markers.ts +0 -87
- package/src/lib/le/le-plan.test.ts +0 -26
- package/src/lib/le/le-plan.ts +0 -109
- package/src/lib/le/le-platform-operations.test.ts +0 -198
- package/src/lib/le/le-platform-operations.ts +0 -340
- package/src/lib/le/le-static-model-schema.ts +0 -78
- package/src/lib/le/le-static-planner.test.ts +0 -255
- package/src/lib/le/le-static-planner.ts +0 -442
- package/src/lib/le/le-template-exporter.test.ts +0 -527
- package/src/lib/le/le-template-exporter.ts +0 -459
- package/src/lib/le/le-value-types.ts +0 -23
- package/src/lib/mqtt-client.ts +0 -115
- package/src/lib/parse.test.ts +0 -123
- package/src/lib/parse.ts +0 -87
- package/src/lib/resolve-simulation.test.ts +0 -118
- package/src/lib/resolve-simulation.ts +0 -181
- package/src/lib/session-store.ts +0 -110
- package/src/lib/shutdown.test.ts +0 -562
- package/src/lib/shutdown.ts +0 -621
- package/src/lib/template-category.test.ts +0 -71
- package/src/lib/template-category.ts +0 -72
- package/src/lib/template-locator.ts +0 -55
- package/src/lib/template-utils.ts +0 -45
- package/src/lib/ws-hub.ts +0 -281
- package/src/logger.test.ts +0 -172
- package/src/logger.ts +0 -402
- package/src/output.test.ts +0 -64
- package/src/output.ts +0 -160
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-ByahnaY0.js";import{_ as r,g as i}from"./api-4AqKvsm9.js";import{t as a}from"./createLucideIcon-Bwxw859K.js";import{t as o}from"./arrow-right-Ea_UhTNi.js";import{i as s,n as c,t as l}from"./input-BWEQFptx.js";import{c as u,i as d,l as f,n as p,s as m,t as h,u as g}from"./select-CeO4vP0G.js";import{n as _,r as v,t as y}from"./copy-button-WkbNkMcd.js";import{i as b,n as x,r as S,t as ee}from"./checkbox-DZlJXTE4.js";import{t as te}from"./layers-CUsLQ1fq.js";import{c as ne,n as C,s as w}from"./blueprint-card-classes-DBFCDy0M.js";import{t as T}from"./radio-CoHegOv5.js";import{t as E}from"./server-D9Kfn8fQ.js";import{t as D}from"./triangle-alert-adNk_sea.js";import{t as O}from"./shallow-6lGjQhtJ.js";import{n as k,t as A}from"./proxy-CsnYqnPp.js";import{a as j,i as re,n as ie,r as ae,s as M,t as N}from"./validation-Blvud9_O.js";import{i as oe,n as se,t as ce}from"./tooltip-HGLF366Q.js";import{i as P}from"./engine-store-CrLnz692.js";import{a as le,i as ue,n as de,o as fe,r as pe,s as me,t as F}from"./label-uephX5ZG.js";import{t as I}from"./transition-nav-link-Df4Rk6vV.js";import{i as L,u as R}from"./format-kXTonpDJ.js";import{i as z,n as B,r as V,t as H}from"./card-BjeP32PN.js";import{a as U,i as W,n as G,r as K,t as q}from"./combobox-BGnuCYxO.js";var he=a(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),ge=a(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),J=a(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),_e=a(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ve=a(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),ye=a(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),be=a(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),xe=a(`trash`,[[`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`}]]),Y=e(t(),1),X=n(),Se={mqtt:T,opcua:E,modbus:ge},Ce={mqtt:`MQTT`,opcua:`OPC UA`,modbus:`Modbus TCP`},we={mqtt:i,opcua:r,modbus:502};function Te({adapter:e}){let t=e.pending?`pending`:e.enabled?`enabled`:`disabled`;return(0,X.jsx)(k,{mode:`wait`,initial:!1,children:(0,X.jsx)(A.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:500,damping:30},children:e.pending?(0,X.jsxs)(R,{className:`gap-1 bg-blue-600/20 text-blue-400 hover:bg-blue-600/20`,children:[(0,X.jsx)(S,{className:`size-3 animate-spin`}),e.enabled?`Disabling...`:`Enabling...`]}):e.enabled?(0,X.jsxs)(R,{className:`gap-1 bg-emerald-600/20 text-emerald-400 hover:bg-emerald-600/20`,children:[(0,X.jsx)(v,{className:`size-3`}),`Enabled`]}):(0,X.jsxs)(R,{variant:`outline`,className:`gap-1 text-muted-foreground`,children:[(0,X.jsx)(he,{className:`size-2`}),`Disabled`]})},t)})}function Ee({metrics:e}){return e?e.connected?null:(0,X.jsxs)(R,{variant:`destructive`,className:`gap-1`,children:[(0,X.jsx)(_,{className:`size-3`}),`Disconnected`]}):null}function De({health:e}){return e?(0,X.jsx)(R,{className:`gap-1 ${{healthy:`bg-emerald-600/20 text-emerald-400 hover:bg-emerald-600/20`,busy:`bg-yellow-600/20 text-yellow-400 hover:bg-yellow-600/20`,saturated:`bg-red-600/20 text-red-400 hover:bg-red-600/20`}[e.state]??``}`,children:e.state}):null}function Z({label:e,value:t,valueClassName:n}){return(0,X.jsxs)(`div`,{className:`flex min-h-[3.35rem] flex-col justify-center rounded-md border border-border/55 px-3 py-2 transition-colors hover:border-muted-foreground/25`,children:[(0,X.jsx)(`span`,{className:`blueprint-title text-[9px] leading-tight text-muted-foreground`,children:e}),(0,X.jsx)(`span`,{className:s(`mt-1.5 font-mono text-[13px] leading-none tabular-nums tracking-tight text-foreground`,n),children:t})]})}function Oe({metrics:e}){return(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:[(0,X.jsx)(Z,{label:`Messages sent`,value:e.messagesPublished.toLocaleString()}),(0,X.jsx)(Z,{label:`Attempted`,value:e.messagesAttempted.toLocaleString()}),(0,X.jsx)(Z,{label:`Skipped (unchanged)`,value:e.messagesFiltered.toLocaleString()}),(0,X.jsx)(Z,{label:`Errors`,value:e.errorsCount.toLocaleString(),valueClassName:e.errorsCount>0?`text-red-400`:void 0}),(0,X.jsx)(Z,{label:`Publish latency`,value:`${e.lastPublishMs.toFixed(1)} ms`}),e.health?(0,X.jsx)(Z,{label:`Queued messages`,value:String(e.health.pendingWorkCount)}):null]})}function ke({port:e}){return(0,X.jsxs)(`div`,{className:`flex gap-2 rounded-md border border-yellow-600/30 bg-yellow-600/10 p-3 text-sm text-yellow-300`,children:[(0,X.jsx)(D,{className:`mt-0.5 size-4 shrink-0`}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`font-medium`,children:`Before enabling`}),(0,X.jsxs)(`p`,{className:`mt-1 text-yellow-200`,children:[`Ensure port `,(0,X.jsx)(`code`,{className:`font-mono font-bold`,children:e}),` is available on the host.`]}),(0,X.jsxs)(`ul`,{className:`mt-1 list-inside list-disc space-y-0.5 text-yellow-200`,children:[(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`strong`,{children:`Docker:`}),` Restart with`,` `,(0,X.jsxs)(`code`,{className:`font-mono`,children:[`-p `,e,`:`,e]}),` `,`to expose the port.`]}),(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`strong`,{children:`Bare metal:`}),` Run `,(0,X.jsxs)(`code`,{className:`font-mono`,children:[`lsof -i :`,e]}),` to check availability.`]})]})]})]})}function Ae({adapter:e,metrics:t}){let[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(``),[s,u]=(0,Y.useState)(!1),d=w(),f=Se[e.name]??E,p=Ce[e.name]??e.name,m=we[e.name]??0,h=s||e.pending===!0,_=(0,Y.useMemo)(()=>{let t=e.config?.port;return typeof t==`number`?t:m},[e.config,m]);return(0,X.jsxs)(`div`,{className:`protocol-card-art group min-w-0 border`,children:[(0,X.jsx)(`span`,{className:`protocol-card-art-bracket-br`,"aria-hidden":!0}),(0,X.jsxs)(`div`,{className:`relative z-[2]`,children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":n,className:`flex w-full min-w-0 cursor-pointer gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/35`,onClick:()=>r(!n),children:[(0,X.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-muted-foreground transition-[transform,color] duration-500 ease-[cubic-bezier(0.34,1.3,0.64,1)] group-hover:-rotate-[7deg] group-hover:text-primary motion-reduce:transition-none motion-reduce:group-hover:rotate-0`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:(0,X.jsxs)(`div`,{className:`flex w-full min-w-0 flex-wrap items-start justify-between gap-x-3 gap-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[e.enabled&&!e.pending&&(0,X.jsx)(`span`,{className:`protocol-card-live-dot`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`whitespace-nowrap font-medium tracking-tight`,children:p}),(0,X.jsx)(Te,{adapter:e}),e.enabled&&!e.pending&&t&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ee,{metrics:t}),t.health?(0,X.jsx)(De,{health:t.health}):(0,X.jsx)(R,{className:`gap-1 bg-emerald-600/20 text-emerald-400 hover:bg-emerald-600/20`,children:`healthy`})]})]}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[e.enabled&&t&&!e.pending&&(0,X.jsxs)(`span`,{className:`protocol-card-metric-readout text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`text-[9px] font-normal uppercase tracking-[0.12em] text-muted-foreground`,children:`out`}),` `,(0,X.jsx)(`span`,{className:`text-foreground`,children:t.messagesPublished.toLocaleString()}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:` msgs`}),t.errorsCount>0&&(0,X.jsxs)(`span`,{className:`ml-1.5 text-red-400`,children:[t.errorsCount,` err`]})]}),(0,X.jsx)(g,{className:`size-4 shrink-0 text-muted-foreground transition-transform duration-300 ease-out group-hover:text-primary motion-reduce:transition-none ${n?`rotate-180`:``}`})]})]})})]}),e.enabled&&!e.pending&&e.endpoint&&(0,X.jsxs)(`div`,{className:`protocol-card-endpoint flex min-w-0 items-center gap-1 rounded-r-md px-4 pb-2 pl-[2.75rem]`,children:[(0,X.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:e.endpoint}),(0,X.jsx)(y,{value:e.endpoint,label:`Copy endpoint URL`})]})]}),(0,X.jsx)(k,{initial:!1,children:n&&(0,X.jsx)(A.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:(0,X.jsx)(`div`,{className:`protocol-card-art-body border-t`,children:e.enabled&&t?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`section`,{className:`px-4 pb-4 pt-4`,"aria-labelledby":`protocol-telemetry-${e.name}`,children:[(0,X.jsxs)(`div`,{className:`mb-3 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-3`,children:[(0,X.jsx)(`h4`,{id:`protocol-telemetry-${e.name}`,className:`blueprint-title shrink-0 text-muted-foreground`,children:`Telemetry`}),(0,X.jsxs)(I,{to:`/tags?protocol=${e.name}`,className:`group/footer-link inline-flex w-full min-h-[2rem] min-w-0 max-w-full shrink-0 items-center justify-start gap-1.5 rounded-md border border-primary/25 bg-primary/5 px-2.5 py-1.5 text-xs font-medium leading-tight text-primary transition-colors hover:border-primary/40 hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background sm:w-fit`,children:[(0,X.jsx)(`span`,{className:`whitespace-nowrap`,children:`Browse Tags`}),(0,X.jsx)(o,{className:`size-3 shrink-0 text-primary transition-transform group-hover/footer-link:translate-x-0.5`})]})]}),(0,X.jsx)(Oe,{metrics:t})]}),(0,X.jsx)(`footer`,{className:`protocol-card-art-footer flex flex-col gap-4 border-t border-border/80 px-4 pb-4 pt-4`,children:(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,X.jsxs)(c,{variant:`destructive`,size:`sm`,className:`gap-1.5`,disabled:h,onClick:async()=>{u(!0);try{await d.mutateAsync({type:`disableAdapter`,adapter:e.name})}catch{}finally{u(!1)}},children:[h?(0,X.jsx)(S,{className:`size-3.5 animate-spin`}):(0,X.jsx)(_e,{className:`size-3.5`}),h?`Disabling...`:`Disable ${p}`]}),!h&&(0,X.jsx)(`span`,{className:`text-xs leading-snug text-muted-foreground`,children:`Active connections will be dropped.`})]})})]}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 px-4 py-4`,children:[!h&&(0,X.jsx)(ke,{port:i&&Number(i)||_}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,X.jsx)(F,{htmlFor:`port-${e.name}`,className:`text-xs`,children:`Port`}),(0,X.jsx)(l,{id:`port-${e.name}`,type:`number`,placeholder:String(_),value:i,onChange:e=>a(e.target.value),className:`w-28`,disabled:h})]}),(0,X.jsxs)(c,{size:`sm`,className:`gap-1.5`,disabled:h,onClick:async()=>{u(!0);try{let t=i?Number(i):void 0,n={};t&&Number.isFinite(t)&&(n.port=t),await d.mutateAsync({type:`enableAdapter`,adapter:e.name,...Object.keys(n).length>0?{config:n}:{}})}catch{}finally{u(!1)}},children:[h?(0,X.jsx)(S,{className:`size-3.5 animate-spin`}):(0,X.jsx)(ve,{className:`size-3.5`}),h?`Enabling...`:`Enable ${p}`]})]})]})})},`panel`)})]})}function je(){let{instances:e,models:t,templateRuns:n}=P(O(e=>({instances:e.instances,models:e.models,templateRuns:e.templateRuns}))),r=w(),[i,a]=(0,Y.useState)(``),[o,s]=(0,Y.useState)(`1`),[u,d]=(0,Y.useState)(``),p=(0,Y.useMemo)(()=>u?t.filter(e=>e.name.toLowerCase().includes(u.toLowerCase())):t,[t,u]);return(0,X.jsxs)(H,{className:`min-w-0`,children:[(0,X.jsx)(V,{className:`pb-3`,children:(0,X.jsxs)(z,{className:`flex items-center gap-2 text-xs font-medium uppercase tracking-wider`,children:[(0,X.jsx)(te,{className:`size-3.5 text-primary`}),`Fleet Management`]})}),(0,X.jsxs)(B,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Spawn Instances`}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,X.jsx)(`div`,{className:`min-w-0 w-full sm:min-w-0 sm:flex-1`,children:(0,X.jsxs)(q,{value:i||null,onValueChange:e=>a(e??``),onInputValueChange:d,children:[(0,X.jsx)(K,{placeholder:`Select model`,className:`h-8 w-full min-w-0 text-xs`,showClear:!!i}),(0,X.jsx)(G,{children:(0,X.jsxs)(U,{children:[p.map(e=>(0,X.jsx)(W,{value:e.name,children:e.name},e.name)),p.length===0&&(0,X.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No models found`})]})})]})}),(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,X.jsx)(l,{type:`number`,value:o,onChange:e=>s(e.target.value),className:`h-8 w-16 text-xs`,min:`1`,"aria-label":`Number of instances to spawn`}),(0,X.jsx)(c,{size:`sm`,className:`h-8`,onClick:()=>{let e=j(re,{model:i,count:Number(o)});e&&r.mutate({type:`spawn`,...e})},children:`Spawn`})]})]}),(0,X.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[t.length,` models · `,e.length,` running`]})]}),n.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(M,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Template Runs`}),(0,X.jsx)(k,{initial:!1,children:n.map(e=>(0,X.jsx)(A.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4,transition:{duration:.12}},transition:{type:`spring`,stiffness:400,damping:30},children:(0,X.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border px-2.5 py-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 overflow-hidden`,children:[(0,X.jsx)(`span`,{className:`truncate text-xs font-medium`,children:L(e.templateName)}),(0,X.jsxs)(R,{variant:`secondary`,className:`shrink-0 text-[10px]`,children:[e.instanceIds.length,` inst`]})]}),(0,X.jsx)(c,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-1.5 text-destructive hover:text-destructive`,"aria-label":`Unload template run`,onClick:()=>r.mutate({type:`unloadTemplateRun`,templateRunId:e.templateRunId}),children:(0,X.jsx)(f,{className:`size-3`})})]})},e.templateRunId))})]})]})]})]})}function Me(){let{instances:e,models:t}=P(O(e=>({instances:e.instances,models:e.models}))),n=w(),[r,i]=(0,Y.useState)(``),[a,o]=(0,Y.useState)(``),[s,l]=(0,Y.useState)(``),f=(0,Y.useMemo)(()=>s?e.filter(e=>e.id.toLowerCase().includes(s.toLowerCase())):e,[e,s]),g=(0,Y.useMemo)(()=>{let n=e.find(e=>e.id===r);return n?t.find(e=>e.name===n.model)?.faultNames??[]:[]},[r,e,t]),_=(0,Y.useMemo)(()=>e.filter(e=>e.activeFaults.length>0),[e]),y=_.reduce((e,t)=>e+t.activeFaults.length,0);return(0,X.jsxs)(H,{className:`min-w-0`,children:[(0,X.jsx)(V,{className:`pb-3`,children:(0,X.jsxs)(z,{className:`flex items-center gap-2 text-xs font-medium uppercase tracking-wider`,children:[(0,X.jsx)(D,{className:`size-3.5 ${y>0?`text-destructive`:`text-muted-foreground`}`}),`Fault Lab`,(0,X.jsx)(k,{children:y>0&&(0,X.jsx)(A.div,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{type:`spring`,stiffness:500,damping:30},children:(0,X.jsxs)(R,{variant:`destructive`,className:`text-[10px]`,children:[y,` active`]})},`fault-count`)})]})}),(0,X.jsxs)(B,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,X.jsxs)(q,{value:r||null,onValueChange:e=>{i(e??``),o(``)},onInputValueChange:l,children:[(0,X.jsx)(K,{placeholder:`Select instance`,className:`h-8 w-full min-w-0 text-xs`,showClear:!!r}),(0,X.jsx)(G,{children:(0,X.jsxs)(U,{children:[f.map(e=>(0,X.jsxs)(W,{value:e.id,children:[(0,X.jsx)(`span`,{className:`font-mono`,children:e.id}),e.activeFaults.length>0&&(0,X.jsx)(R,{variant:`destructive`,className:`ml-auto text-[10px]`,children:e.activeFaults.length})]},e.id)),f.length===0&&(0,X.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No instances found`})]})})]}),(0,X.jsxs)(h,{value:a,onValueChange:e=>o(e??``),children:[(0,X.jsx)(m,{className:`h-8 w-full text-xs`,"aria-label":`Fault type`,children:(0,X.jsx)(u,{placeholder:r?`Select fault`:`Pick instance first`})}),(0,X.jsx)(p,{alignItemWithTrigger:!1,align:`start`,children:g.map(e=>(0,X.jsx)(d,{value:e,children:e},e))})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(c,{variant:`destructive`,size:`sm`,className:`h-7 text-xs`,disabled:!r||!a,onClick:()=>{let e=j(N,{instanceId:r,fault:a});e&&n.mutate({type:`triggerFault`,...e})},children:`Trigger`}),(0,X.jsx)(c,{variant:`secondary`,size:`sm`,className:`h-7 text-xs`,disabled:!r||!a,onClick:()=>{let e=j(N,{instanceId:r,fault:a});e&&n.mutate({type:`clearFault`,...e})},children:`Clear`})]}),(0,X.jsx)(M,{}),(0,X.jsx)(k,{mode:`wait`,initial:!1,children:_.length>0?(0,X.jsxs)(A.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Faulted Instances`}),(0,X.jsx)(k,{initial:!1,children:_.map(e=>(0,X.jsx)(A.div,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:6,transition:{duration:.1}},transition:{type:`spring`,stiffness:400,damping:35},children:(0,X.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between rounded-md border border-destructive/20 bg-destructive/5 px-2.5 py-1.5 text-left transition-colors hover:bg-destructive/10`,onClick:()=>{i(e.id),o(``)},children:[(0,X.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.id}),(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-destructive`,children:e.activeFaults.join(`, `)})]})},e.id))})]},`faulted`):(0,X.jsxs)(A.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`flex items-center gap-2 py-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(v,{className:`size-3.5 text-success`}),`All clear — no active faults`]},`all-clear`)})]})]})}function Ne(){let e=P(e=>e.instances),t=w(),[n,r]=(0,Y.useState)(``),[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(``),l=(0,Y.useMemo)(()=>o?e.filter(e=>e.id.toLowerCase().includes(o.toLowerCase())):e,[e,o]),u=(0,Y.useMemo)(()=>e.filter(e=>e.isQuarantined),[e]),d=(0,Y.useMemo)(()=>e.filter(e=>!e.isQuarantined&&e.activeFaults.length===0).length,[e]),f=(0,Y.useMemo)(()=>e.filter(e=>!e.isQuarantined&&e.activeFaults.length>0).length,[e]);return(0,X.jsxs)(H,{className:`min-w-0`,children:[(0,X.jsx)(V,{className:`pb-3`,children:(0,X.jsxs)(z,{className:`flex items-center gap-2 text-xs font-medium uppercase tracking-wider`,children:[(0,X.jsx)(ye,{className:`size-3.5 text-muted-foreground`}),`Instance Actions`]})}),(0,X.jsxs)(B,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Remove Instance`}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:items-start`,children:[(0,X.jsx)(`div`,{className:`min-w-0 w-full sm:min-w-0 sm:flex-1`,children:(0,X.jsxs)(q,{value:n||null,onValueChange:e=>{r(e??``),a(!1)},onInputValueChange:s,children:[(0,X.jsx)(K,{placeholder:`Select instance`,className:`h-8 w-full min-w-0 text-xs`,showClear:!!n}),(0,X.jsx)(G,{children:(0,X.jsxs)(U,{children:[l.map(e=>(0,X.jsx)(W,{value:e.id,children:(0,X.jsx)(`span`,{className:`font-mono`,children:e.id})},e.id)),l.length===0&&(0,X.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No instances found`})]})})]})}),i&&n?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 sm:shrink-0`,children:[(0,X.jsx)(`span`,{className:`text-[10px] text-destructive`,children:`Remove?`}),(0,X.jsx)(c,{size:`sm`,variant:`destructive`,className:`h-7 text-xs`,onClick:()=>{t.mutate({type:`removeInstance`,instanceId:n}),a(!1),r(``)},children:`Confirm`}),(0,X.jsx)(c,{size:`sm`,variant:`ghost`,className:`h-7 text-xs`,onClick:()=>a(!1),children:`Cancel`})]}):(0,X.jsxs)(c,{className:`h-8 w-full shrink-0 gap-1.5 sm:w-auto`,variant:`destructive`,size:`sm`,disabled:!n,onClick:()=>{j(ie,{instanceId:n})&&a(!0)},children:[(0,X.jsx)(xe,{className:`size-3`}),`Remove`]})]})]}),(0,X.jsx)(M,{}),(0,X.jsx)(k,{mode:`wait`,initial:!1,children:u.length>0?(0,X.jsxs)(A.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`flex flex-col gap-2`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wider text-warning`,children:[`Quarantined`,(0,X.jsx)(R,{variant:`secondary`,className:`text-[10px] text-warning`,children:u.length})]}),(0,X.jsx)(k,{initial:!1,children:u.map(e=>(0,X.jsx)(A.div,{initial:{opacity:0,x:-6},animate:{opacity:1,x:0},exit:{opacity:0,transition:{duration:.1}},transition:{type:`spring`,stiffness:400,damping:35},children:(0,X.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-warning/20 bg-warning/5 px-2.5 py-1.5`,children:[(0,X.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.id}),(0,X.jsx)(c,{size:`sm`,variant:`outline`,className:`h-6 shrink-0 text-[10px]`,onClick:()=>t.mutate({type:`unquarantine`,instanceId:e.id}),children:`Unquarantine`})]})},e.id))})]},`quarantined`):(0,X.jsxs)(A.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Fleet Health`}),(0,X.jsx)(`div`,{className:`flex items-center gap-4 text-xs`,children:e.length>0?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`size-2 rounded-full bg-success`}),(0,X.jsx)(`span`,{className:`font-mono tabular-nums`,children:d}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`healthy`})]}),f>0&&(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`size-2 rounded-full bg-warning`}),(0,X.jsx)(`span`,{className:`font-mono tabular-nums`,children:f}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`faulted`})]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(be,{className:`size-3 text-success`}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`0 quarantined`})]})]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`No instances running`})})]},`fleet-health`)})]})]})}function Pe(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function Fe(e){if(!Number.isFinite(e)||e<=0)return`0s`;if(e<60)return`${e.toFixed(1)}s`;let t=Math.floor(e),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?r>0?`${n}d ${r}h`:i>0?`${n}d ${i}m`:`${n}d`:r>0?`${r}h ${i}m`:i>0?`${i}m ${a}s`:`${a}s`}function Q({data:e}){let t=(0,Y.useMemo)(()=>{if(e.length<2)return null;let t=e.map(e=>e.tps),n=Math.max(...t,.1),r=Math.min(...t,0),i=n-r||1;return{points:t.map((e,n)=>{let a=n/(t.length-1)*200,o=2+(1-(e-r)/i)*28;return`${n===0?`M`:`L`}${a.toFixed(1)},${o.toFixed(1)}`}).join(` `),min:r,max:n}},[e]);return t?(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(`svg`,{viewBox:`0 0 200 32`,className:`h-8 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":`TPS trend sparkline`,children:[(0,X.jsx)(`line`,{x1:`0`,y1:`10.7`,x2:`200`,y2:`10.7`,stroke:`currentColor`,strokeWidth:`0.5`,strokeDasharray:`3,2`,className:`text-border`}),(0,X.jsx)(`line`,{x1:`0`,y1:`21.3`,x2:`200`,y2:`21.3`,stroke:`currentColor`,strokeWidth:`0.5`,strokeDasharray:`3,2`,className:`text-border`}),(0,X.jsx)(`path`,{d:t.points,fill:`none`,stroke:`var(--miravo-primary)`,strokeWidth:`1.5`})]}),(0,X.jsxs)(`div`,{className:`flex justify-between text-[9px] text-muted-foreground`,children:[(0,X.jsxs)(`span`,{children:[`60s ago · `,t.min.toFixed(1)]}),(0,X.jsxs)(`span`,{children:[t.max.toFixed(1),` · now`]})]})]}):(0,X.jsx)(`div`,{className:`flex h-8 items-center text-[10px] text-muted-foreground`,children:`Collecting...`})}var Ie={running:`bg-success`,paused:`bg-warning`,idle:`bg-muted-foreground`,stopped:`bg-destructive`};function Le({state:e}){let t=Ie[e]??`bg-muted-foreground`,n=e===`running`;return(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsxs)(`div`,{className:`relative flex items-center justify-center`,children:[(0,X.jsx)(`span`,{className:`size-2.5 rounded-full ${t}`}),n&&(0,X.jsx)(`span`,{className:`absolute size-2.5 animate-ping rounded-full ${t} opacity-40`})]}),(0,X.jsx)(k,{mode:`wait`,initial:!1,children:(0,X.jsx)(A.span,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},transition:{type:`spring`,stiffness:500,damping:30},className:`font-mono text-lg font-bold uppercase tracking-wider`,children:e},e)})]})}function $({label:e,tooltip:t,tooltipClassName:n}){return(0,X.jsxs)(`div`,{className:`flex w-fit min-w-0 max-w-full items-center gap-0.5`,children:[(0,X.jsx)(`span`,{className:`blueprint-title min-w-0 text-muted-foreground`,children:e}),(0,X.jsxs)(ce,{children:[(0,X.jsx)(oe,{className:`flex size-4 shrink-0 items-center justify-center rounded-sm border-0 bg-transparent p-0 text-muted-foreground shadow-none outline-none hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring`,render:(0,X.jsx)(`button`,{type:`button`}),"aria-label":`About ${e}`,children:(0,X.jsx)(b,{className:`size-3`,"aria-hidden":!0})}),(0,X.jsx)(se,{side:`top`,className:s(`max-w-xs`,n),children:t})]})]})}function Re(){let{engineState:e,connectionState:t}=P(O(e=>({engineState:e.engineState,connectionState:e.connectionState}))),n=w();return(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)($,{label:`Run state`,tooltip:(0,X.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Whether the scheduler is running, paused, idle, or stopped. Pause freezes simulated time; resume continues from the same tick.`})}),(0,X.jsx)(Le,{state:e}),t===`live`&&(e===`running`||e===`paused`)&&(0,X.jsx)(`div`,{className:`mt-1 flex items-center gap-2`,children:(0,X.jsxs)(c,{type:`button`,size:`sm`,variant:e===`paused`?`default`:`outline`,className:s(`h-8 w-fit gap-1.5 px-3 text-xs`,e===`running`&&`border-warning/40 bg-warning/10 text-warning hover:bg-warning/20 hover:text-warning focus-visible:border-warning/50 focus-visible:ring-warning/25 dark:border-warning/35`),onClick:()=>n.mutate({type:e===`paused`?`resume`:`pause`}),children:[e===`paused`?(0,X.jsx)(ne,{className:`size-3`}):(0,X.jsx)(J,{className:`size-3`}),e===`paused`?`Resume`:`Pause`]})})]})}function ze(){let{speedMultiplier:e,connectionState:t}=P(O(e=>({speedMultiplier:e.speedMultiplier,connectionState:e.connectionState}))),n=w(),[r,i]=(0,Y.useState)(String(e)),a=t===`live`;return(0,Y.useEffect)(()=>{i(String(e))},[e]),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)($,{label:`Speed`,tooltip:(0,X.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Runs the simulation at this multiple of real time. 1× is real time; higher values speed up the model. Change it with the field and Set.`})}),(0,X.jsxs)(`span`,{className:`w-fit font-mono text-lg font-bold tabular-nums`,children:[e,`x`]}),(0,X.jsxs)(`div`,{className:`mt-1 flex items-center gap-2`,children:[(0,X.jsx)(F,{htmlFor:`speed-multiplier`,className:`sr-only`,children:`Speed multiplier`}),(0,X.jsx)(l,{id:`speed-multiplier`,type:`number`,value:r,onChange:e=>i(e.target.value),className:`h-8 w-[4.75rem] font-mono text-xs tabular-nums`,min:`1`,max:`1000`,disabled:!a}),(0,X.jsx)(c,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 px-3 text-xs`,disabled:!a,onClick:()=>{let e=j(ae,{multiplier:Number(r)});e&&n.mutate({type:`setSpeed`,multiplier:e.multiplier})},children:`Set`})]})]})}function Be(){let{tick:e,simulationTime:t,tps:n,tpsHistory:r,uptimeMs:i,instanceCount:a,memberValueCount:o}=P(O(e=>({tick:e.tick,simulationTime:e.simulationTime,tps:e.tps,tpsHistory:e.tpsHistory,uptimeMs:e.uptimeMs,instanceCount:e.instanceCount,memberValueCount:e.memberValueCount})));return(0,X.jsxs)(`div`,{className:s(C,`px-4 py-3`),children:[(0,X.jsxs)(`header`,{className:`mb-3 border-b border-border/60 pb-2`,children:[(0,X.jsx)(`h3`,{className:`font-heading text-sm font-semibold tracking-tight text-foreground`,children:`Engine vitals`}),(0,X.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Scheduler, speed, cycle count, and throughput for this session.`})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-6`,children:[(0,X.jsx)(Re,{}),(0,X.jsx)(ze,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)($,{label:`Cycle`,tooltipClassName:`flex flex-col items-start gap-2 text-left`,tooltip:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`Cycle`}),` compares simulated progress with wall time: how many steps ran, how much model time advanced, and how long this session has been open.`]}),(0,X.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[`The number is `,(0,X.jsx)(`span`,{className:`font-medium`,children:`tick`}),` count — completed scheduler steps since this run. Each tick refreshes the plant model and live tags.`]}),(0,X.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`Sim`}),` is simulated elapsed time. Each tick adds (tick interval × speed) to this clock. Generators, lifecycle, and in-model timestamps use Sim, not your system clock. It stops advancing while paused.`]}),(0,X.jsxs)(`p`,{className:`text-[11px] leading-snug`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`Real`}),` is wall-clock uptime since the run started (real time).`]})]})}),(0,X.jsx)(`span`,{className:`w-fit font-mono text-lg font-bold tabular-nums`,children:e.toLocaleString()}),(0,X.jsxs)(`div`,{className:`mt-1 flex w-full min-w-0 flex-col gap-0.5 leading-tight`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`w-10 shrink-0 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Sim`}),(0,X.jsx)(`span`,{className:`min-w-0 font-mono text-[10px] tabular-nums text-muted-foreground`,children:Fe(t)})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,X.jsx)(`span`,{className:`w-10 shrink-0 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Real`}),(0,X.jsx)(`span`,{className:`min-w-0 font-mono text-[10px] tabular-nums text-muted-foreground`,children:Pe(i)})]})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)($,{label:`Throughput`,tooltip:(0,X.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Ticks per second: how fast the engine is stepping. Rises and falls with workload, speed setting, and CPU headroom.`})}),(0,X.jsxs)(`span`,{className:`w-fit font-mono text-lg font-bold tabular-nums`,children:[n.toFixed(1),` tps`]}),(0,X.jsxs)(`span`,{className:`mt-1 text-[10px] text-muted-foreground`,children:[a,` inst · `,o.toLocaleString(),` tags`]})]}),(0,X.jsxs)(`div`,{className:`col-span-2 flex flex-col gap-2`,children:[(0,X.jsx)($,{label:`TPS Trend`,tooltip:(0,X.jsx)(`p`,{className:`text-[11px] leading-snug`,children:`Recent ticks-per-second samples over about the last minute. Flat or noisy lines usually mean load or speed changes.`})}),(0,X.jsx)(Q,{data:r})]})]})]})}function Ve(){let{availableAdapters:e,adapterMetrics:t}=P(O(e=>({availableAdapters:e.availableAdapters,adapterMetrics:e.adapterMetrics}))),n=e.filter(e=>e.enabled).length;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`h3`,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:`Protocol Gateway`}),(0,X.jsxs)(R,{variant:`secondary`,className:`font-mono text-[10px]`,children:[n,`/`,e.length]})]}),e.length>0&&(0,X.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,X.jsx)(k,{children:e.map((e,n)=>{let r=t.find(t=>t.name===e.name)?.metrics;return(0,X.jsx)(A.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0},transition:{type:`spring`,stiffness:380,damping:30,delay:n*.05},children:(0,X.jsx)(Ae,{adapter:e,metrics:r})},e.name)})})}),(0,X.jsxs)(`div`,{className:s(C,`protocol-gateway-soon relative flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 overflow-hidden px-4 py-3`),children:[(0,X.jsx)(x,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,X.jsxs)(`p`,{className:`min-w-0 text-xs leading-snug text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`blueprint-title text-primary`,children:`Roadmap`}),` `,(0,X.jsx)(`span`,{className:`text-foreground`,children:`MQTT Sparkplug B, EtherNet/IP, Siemens S7, and more`}),` — `,(0,X.jsx)(`span`,{className:`font-medium text-primary`,children:`coming soon`})]})]})]})}function He(){let e=P(e=>e.instances),t=w(),[n,r]=(0,Y.useState)(!1),[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(!1);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(H,{className:`min-w-0`,children:[(0,X.jsx)(V,{className:`pb-3`,children:(0,X.jsx)(z,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:`Danger Zone`})}),(0,X.jsx)(B,{children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border border-dashed border-border p-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,X.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Reset simulation`}),(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Removes `,e.length,` running instance`,e.length===1?``:`s`,` and all loaded templates.`]})]}),(0,X.jsx)(c,{className:`w-full shrink-0 sm:w-auto`,variant:`destructive`,size:`sm`,onClick:()=>r(!0),children:`Reset`})]})})]}),(0,X.jsx)(de,{open:n,onOpenChange:e=>{r(e),e||a(!1)},children:(0,X.jsxs)(pe,{children:[(0,X.jsxs)(fe,{children:[(0,X.jsx)(me,{children:`Reset Simulation`}),(0,X.jsx)(ue,{children:`Removes all running instances and loaded templates.`})]}),(0,X.jsx)(`div`,{className:`space-y-3 text-sm`,children:(0,X.jsx)(`div`,{className:`rounded-lg border p-3`,children:(0,X.jsxs)(F,{htmlFor:`clear-persisted-state`,className:`items-start`,children:[(0,X.jsx)(ee,{id:`clear-persisted-state`,checked:i,onCheckedChange:e=>a(e===!0)}),(0,X.jsxs)(`span`,{className:`space-y-1`,children:[(0,X.jsx)(`span`,{className:`block font-medium text-foreground`,children:`Also clear persisted state`}),(0,X.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`Start empty on the next restart.`})]})]})})}),(0,X.jsxs)(le,{children:[(0,X.jsx)(c,{variant:`outline`,onClick:()=>{r(!1),a(!1)},disabled:o,children:`Cancel`}),(0,X.jsx)(c,{variant:`destructive`,disabled:o,onClick:async()=>{s(!0);try{await t.mutateAsync({type:`resetSimulation`,...i?{clearPersistence:!0}:{}}),r(!1),a(!1)}catch{}finally{s(!1)}},children:o?`Resetting...`:`Confirm Reset`})]})]})})]})}function Ue(){return(0,X.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsx)(`h2`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Mission Control`}),(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Engine telemetry, protocol management, and fleet operations.`})]}),(0,X.jsx)(Be,{}),(0,X.jsx)(Ve,{}),(0,X.jsxs)(`div`,{className:`grid min-w-0 grid-cols-1 gap-4 lg:grid-cols-3`,children:[(0,X.jsx)(je,{}),(0,X.jsx)(Me,{}),(0,X.jsx)(Ne,{})]}),(0,X.jsx)(He,{})]})}export{J as n,Ue as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./control-CPhvwx9o.js";export{e as ControlPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-ByahnaY0.js";import{t as r}from"./createLucideIcon-Bwxw859K.js";import{i,o as a}from"./input-BWEQFptx.js";import{n as o,r as s}from"./dist-BhbDML0a.js";import{i as c,n as l,t as u}from"./tooltip-HGLF366Q.js";var d=r(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),f=r(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),p=e(t(),1),m=n();function h({value:e,label:t=`Copy`,className:n}){let[r,d]=(0,p.useState)(!1),f=(0,p.useRef)(void 0),h=(0,p.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e),d(!0),o.success(`Copied to clipboard`),clearTimeout(f.current),f.current=setTimeout(()=>d(!1),1500)},[e]);return(0,m.jsxs)(u,{children:[(0,m.jsx)(c,{className:i(`inline-flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,n),onClick:h,closeOnClick:!1,"aria-label":t,children:r?(0,m.jsx)(a,{className:`size-3 text-success`}):(0,m.jsx)(s,{className:`size-3`})}),(0,m.jsx)(l,{side:`right`,children:r?`Copied!`:t})]})}export{f as n,d as r,h as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";var n=e(t()),r=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),i=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},c=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},l=(0,n.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:o=``,children:l,iconNode:u,...d},f)=>(0,n.createElement)(`svg`,{ref:f,...s,width:t,height:t,stroke:e,strokeWidth:a?Number(i)*24/Number(t):i,className:r(`lucide`,o),...!l&&!c(d)&&{"aria-hidden":`true`},...d},[...u.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(l)?l:[l]])),u=(e,t)=>{let a=(0,n.forwardRef)(({className:a,...s},c)=>(0,n.createElement)(l,{ref:c,iconNode:t,className:r(`lucide-${i(o(e))}`,`lucide-${e}`,a),...s}));return a.displayName=o(e),a};export{u as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.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-ByahnaY0.js";import{a as u,i as d,o as f}from"./api-4AqKvsm9.js";import{r as ee,t as p}from"./query-keys-BvtE7BMs.js";import{t as m}from"./createLucideIcon-Bwxw859K.js";import{_ as te,c as ne,d as re,f as ie,g as ae,h as oe,l as se,m as ce,s as le,u as ue,v as de,x as fe,y as h}from"./use-platform-stream-DGbK1k2L.js";import{t as pe}from"./box-C1WaoOMF.js";import{i as g,n as _,t as v}from"./input-BWEQFptx.js";import{a as y,c as b,i as x,l as S,n as me,o as he,r as C,s as ge,t as _e}from"./select-CeO4vP0G.js";import{a as ve,i as ye,n as be,r as w,t as xe}from"./platform-targets-R3T-4eJ7.js";import{n as T}from"./dist-BhbDML0a.js";import{t as E}from"./download-DQ6NH16U.js";import{n as Se,r as D}from"./checkbox-DZlJXTE4.js";import{t as Ce}from"./layers-CUsLQ1fq.js";import{t as O}from"./radio-CoHegOv5.js";import{n as we,t as k}from"./proxy-CsnYqnPp.js";import{a as A,i as j,n as M,o as N,r as Te,s as Ee,t as P}from"./label-uephX5ZG.js";import{u as De}from"./format-kXTonpDJ.js";var Oe=m(`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`}]]),F=m(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ke=m(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),I=m(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),L=m(`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`}]]),R=c();function z({...e}){return(0,R.jsx)(r,{"data-slot":`sheet`,...e})}function B({...e}){return(0,R.jsx)(o,{"data-slot":`sheet-portal`,...e})}function V({className:e,...t}){return(0,R.jsx)(n,{"data-slot":`sheet-overlay`,className:g(`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 H({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...o}){return(0,R.jsxs)(B,{children:[(0,R.jsx)(V,{}),(0,R.jsxs)(a,{"data-slot":`sheet-content`,"data-side":n,className:g(`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,R.jsxs)(i,{"data-slot":`sheet-close`,render:(0,R.jsx)(_,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`}),children:[(0,R.jsx)(S,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function U({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`sheet-header`,className:g(`flex flex-col gap-0.5 p-2`,e),...t})}function Ae({className:e,...t}){return(0,R.jsx)(l,{"data-slot":`sheet-title`,className:g(`text-base font-medium text-foreground`,e),...t})}function W({className:e,...t}){return(0,R.jsx)(s,{"data-slot":`sheet-description`,className:g(`text-sm text-muted-foreground`,e),...t})}var G=e(t(),1);function K(e){return ye.find(t=>t.id===e)?.label??e}function je({open:e,onOpenChange:t,onCreated:n}){let[r,i]=(0,G.useState)(w.id),[a,o]=(0,G.useState)({label:``,hostname:``,apiToken:``,sourceHostname:``}),[s,c]=(0,G.useState)(!1),{testing:l,runTest:u,cancelInFlight:d}=oe(),f=r===w.id&&a.hostname.trim().length>0&&a.sourceHostname.trim().length>0&&a.apiToken.trim().length>0;(0,G.useEffect)(()=>{e&&i(w.id)},[e]);let ee=async()=>{if(r!==w.id){T.error(`${K(r)} environment setup is coming soon.`);return}if(!a.label||!a.hostname||!a.apiToken||!a.sourceHostname){T.error(`All fields are required.`);return}c(!0);try{await h({...a,platformId:r}),T.success(`Environment added.`),t(!1),o({label:``,hostname:``,apiToken:``,sourceHostname:``}),n()}catch(e){T.error(e instanceof Error?e.message:`Failed to add environment.`)}finally{c(!1)}},p=()=>{f&&u({hostname:a.hostname.trim(),sourceHostname:a.sourceHostname.trim(),apiToken:a.apiToken.trim()})};return(0,R.jsx)(M,{open:e,onOpenChange:e=>{e||d(),t(e)},children:(0,R.jsxs)(Te,{children:[(0,R.jsxs)(N,{children:[(0,R.jsx)(Ee,{children:`Add Environment`}),(0,R.jsx)(j,{children:`Credentials are stored securely on the server.`})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(P,{className:`text-xs`,children:`Platform`}),(0,R.jsxs)(_e,{value:r,onValueChange:e=>{e&&i(e)},children:[(0,R.jsx)(ge,{className:`w-full`,children:(0,R.jsx)(b,{placeholder:`Select platform`,children:e=>de(e)})}),(0,R.jsxs)(me,{children:[(0,R.jsxs)(C,{children:[(0,R.jsx)(y,{children:`Available`}),xe.map(e=>(0,R.jsx)(x,{value:e.id,children:e.label},e.id))]}),(0,R.jsx)(he,{}),(0,R.jsxs)(C,{children:[(0,R.jsx)(y,{children:`Coming soon`}),be.map(e=>(0,R.jsxs)(x,{value:e.id,children:[(0,R.jsx)(`span`,{children:e.label}),(0,R.jsx)(De,{variant:`outline`,className:`ml-auto text-[9px]`,children:`Soon`})]},e.id))]})]})]})]}),r===w.id?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(P,{htmlFor:`add-env-label`,className:`text-xs`,children:`Label`}),(0,R.jsx)(v,{id:`add-env-label`,placeholder:`Production`,value:a.label,onChange:e=>o({...a,label:e.currentTarget.value})})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(P,{htmlFor:`add-env-host`,className:`text-xs`,children:`Hostname`}),(0,R.jsx)(v,{id:`add-env-host`,placeholder:`10.0.1.100`,value:a.hostname,onChange:e=>o({...a,hostname:e.currentTarget.value})})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(P,{htmlFor:`add-env-token`,className:`text-xs`,children:`API Token`}),(0,R.jsx)(v,{id:`add-env-token`,type:`password`,placeholder:`Enter API token`,value:a.apiToken,onChange:e=>o({...a,apiToken:e.currentTarget.value})})]}),(0,R.jsxs)(`div`,{className:`space-y-1`,children:[(0,R.jsx)(P,{htmlFor:`add-env-source`,className:`text-xs`,children:te}),(0,R.jsx)(v,{id:`add-env-source`,placeholder:`host.docker.internal`,value:a.sourceHostname,onChange:e=>o({...a,sourceHostname:e.currentTarget.value})}),(0,R.jsx)(`p`,{className:`text-[11px] leading-snug text-muted-foreground`,children:ae})]})]}):(0,R.jsxs)(`div`,{className:`rounded-md border border-dashed border-border/70 bg-muted/20 px-3 py-2 text-xs text-muted-foreground`,children:[K(r),` environment setup is coming soon.`]})]}),l&&r===w.id?(0,R.jsx)(`p`,{className:`border-t border-border/40 pt-3 text-xs text-muted-foreground`,role:`status`,"aria-live":`polite`,children:`Checking connection to Litmus Edge…`}):null,(0,R.jsxs)(A,{children:[(0,R.jsx)(_,{type:`button`,variant:`outline`,className:`mr-auto gap-2`,disabled:s||l||!f,"aria-busy":l,onClick:()=>void p(),children:l?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(D,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}),`Testing connection`]}):`Test connection`}),(0,R.jsx)(_,{variant:`outline`,onClick:()=>{d(),t(!1)},disabled:s,children:`Cancel`}),(0,R.jsx)(_,{onClick:()=>void ee(),disabled:s||r!==w.id,children:s?`Saving...`:`Add`})]})]})})}var Me=[{value:`opcua`,label:`OPC UA`},{value:`mqtt`,label:`MQTT`},{value:`modbus`,label:`Modbus`}];function Ne({value:e,onValueChange:t,labelledBy:n}){return(0,R.jsx)(`fieldset`,{"aria-labelledby":n,className:`min-w-0 border-0 p-0`,children:(0,R.jsx)(`div`,{className:`flex gap-1.5`,children:Me.map(n=>{let r=e===n.value;return(0,R.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>t(n.value),className:g(`flex flex-1 items-center justify-center rounded-lg border py-1.5 text-center transition-all 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,R.jsxs)(`span`,{className:`inline-flex items-center justify-center gap-1.5 font-mono text-[11px] font-medium leading-none tracking-wide`,children:[(0,R.jsx)(O,{className:`size-2.5 shrink-0 -translate-y-px opacity-80`,"aria-hidden":!0}),(0,R.jsx)(`span`,{children:n.label})]})},n.value)})})})}var q=`172.17.0.1`;async function Pe(e){let t=await u(`/catalog/models/${encodeURIComponent(e)}/le-dt.json`);return JSON.stringify(t,null,2)}async function Fe(e,t={}){return d(`/catalog/templates/${encodeURIComponent(e)}/le-template.json${J(t)}`)}function J(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 Y(e){let t=e.split(/[-_]/).filter(e=>e.length>0);return t[t.length-1]??e}function Ie(e){return`${Y(e)}-001`}function Le(e){return e===`template`?`Litmus Edge Template`:`Litmus Edge Digital Twin`}function X({kind:e,id:t,displayName:n,yamlPath:r,yamlFilename:i,stream:a}){let o=ee({queryKey:p.platforms.environments(),queryFn:()=>fe()}),s=o.data??[],[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(`opcua`),[m,oe]=(0,G.useState)(`litmus-edge`),[de,h]=(0,G.useState)(!1),[w,O]=(0,G.useState)(!1),[Oe,F]=(0,G.useState)(!1),[I,L]=(0,G.useState)(q),[z,B]=(0,G.useState)(!1),[V,H]=(0,G.useState)(!1),U=(0,G.useId)(),Ae=a.operation?.operationId;(0,G.useEffect)(()=>{H(!1)},[Ae]);let W=s.find(e=>e.id===c),K=(0,G.useCallback)(n=>{h(!1),c&&(e===`model`?a.startApply({environmentId:c,model:t,protocol:u,scope:n.scope,deviceName:n.deviceName,ifUnmanaged:n.ifUnmanaged}):a.startApply({environmentId:c,template:t,scope:n.scope,ifUnmanaged:n.ifUnmanaged}))},[c,t,e,u,a]),J=m===`source-yaml`,Y=m===`litmus-edge`||J,X=(0,G.useCallback)(async n=>{if(J){try{let e=await f(r),t=new Blob([e],{type:`text/yaml`}),n=URL.createObjectURL(t),a=document.createElement(`a`);a.href=n,a.download=i,a.click(),URL.revokeObjectURL(n),T.success(`Exported ${i}`)}catch{T.error(`Failed to export YAML`)}return}if(m===`litmus-edge`)try{if(e===`model`){let e=await Pe(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),T.success(`Exported ${t}.le-dt.json`)}else{let e=n?.templateHost?.trim()??``,r=e.length>0?e:void 0,i=`${t}.le-template.json`,a=await Fe(t,{protocol:u,...r?{host:r}:{}}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=i,s.click(),URL.revokeObjectURL(o),T.success(`Exported ${i}`)}}catch{T.error(`Failed to export platform format`)}},[m,J,e,t,r,i,u]),Re=(0,G.useCallback)(()=>{if(Y){if(m===`litmus-edge`&&e===`template`){L(q),F(!0);return}X()}},[Y,m,e,X]),ze=(0,G.useCallback)(async()=>{B(!0);try{await X({templateHost:I}),F(!1)}finally{B(!1)}},[I,X]),Z=a.status===`running`,Q=!!c&&!Z,Be=e===`template`?`Provisions devices, tags, and Digital Twin models from this template on the target edge.`:`Pushes one Digital Twin model, ${Me.find(e=>e.value===u)?.label??`protocol`} tags, and a live instance to DeviceHub.`,Ve=!!a.operation||Z,$=Ve?le(a):null;return(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4`,children:[(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pr-2`,children:(0,R.jsx)(ue,{children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-border/40 pb-3`,children:[(0,R.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg border border-primary/25 bg-primary/9 shadow-[inset_0_1px_0_0_rgba(255,255,255,0.06)]`,children:(0,R.jsx)(Ce,{className:`size-4 text-primary`,"aria-hidden":!0})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.12em] text-foreground`,children:`Litmus Edge`}),(0,R.jsxs)(`p`,{className:`mt-0.5 text-xs leading-snug text-foreground/88`,children:[`Digital Twins — push this `,e===`template`?`template`:`model`,` to a live edge environment.`]})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(P,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.12em] text-foreground/92`,children:`Target environment`}),(0,R.jsx)(se,{environments:s,value:c,onValueChange:l,size:`sm`,className:`min-w-0 w-full border-border/65 bg-background/55 text-xs text-foreground`,onAddNew:()=>O(!0)})]}),e===`model`&&(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(P,{id:U,className:`font-heading text-[11px] font-medium uppercase tracking-[0.12em] text-foreground/92`,children:`Protocol binding`}),(0,R.jsx)(Ne,{value:u,onValueChange:d,labelledBy:U})]}),s.length===0?(0,R.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border/55 bg-muted/15 px-3 py-4 text-center`,children:[(0,R.jsx)(pe,{className:`mx-auto size-8 text-foreground/70`,"aria-hidden":!0}),(0,R.jsx)(`p`,{className:`mt-2 font-heading text-xs font-medium text-foreground`,children:`No edge environments yet`}),(0,R.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-foreground/88`,children:`Add a Litmus Edge host above to enable live deploy. Credentials stay on the server.`})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`button`,{type:`button`,disabled:!Q,onClick:()=>h(!0),className:g(`group flex w-full min-h-14 items-stretch overflow-hidden rounded-xl 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.05)]`,`hover:border-primary/56 hover:shadow-[inset_0_1px_0_0_rgba(255,255,255,0.05),0_0_24px_-6px_color-mix(in_srgb,var(--primary)_32%,transparent),0_0_40px_-12px_color-mix(in_srgb,var(--primary)_14%,transparent)]`]:[`border border-dashed border-border/65 bg-muted/15`,`hover:bg-muted/22`]),children:[(0,R.jsxs)(`span`,{className:`relative flex w-18 shrink-0 items-center justify-center bg-transparent`,"aria-hidden":!0,children:[(0,R.jsx)(`span`,{className:g(`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,R.jsx)(Se,{className:g(`relative size-5`,Q?`text-primary`:`text-foreground/75`)})]}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-0.5 px-3 py-2.5 sm:px-4`,children:[(0,R.jsx)(`span`,{className:g(`font-heading text-[11px] font-semibold uppercase tracking-[0.16em]`,Q?`text-primary`:`text-foreground/78`),children:Q?`Commit deploy`:Z?`Deploy in progress…`:`Awaiting target`}),(0,R.jsx)(`span`,{className:g(`truncate font-mono text-[13px] leading-tight tracking-tight`,Q?`text-foreground`:`text-foreground/80`),children:W?.label??`Select an environment above`})]}),(0,R.jsx)(`span`,{className:g(`flex shrink-0 items-center pr-2.5 sm:pr-3`,Q&&`pl-1`),children:(0,R.jsx)(`span`,{className:g(`flex size-9 items-center justify-center rounded-lg 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,R.jsx)(ve,{className:`size-4`,strokeWidth:2.25})})})]}),(0,R.jsx)(`p`,{className:`border-t border-border/35 pt-3 text-[10px] leading-snug text-foreground/86`,children:Be})]})]})})}),(0,R.jsx)(we,{children:Ve&&$?(0,R.jsx)(ne,{title:$.title,subtitle:$.subtitle,footerAction:Z&&a.operation?.operationId?(0,R.jsx)(_,{variant:`outline`,size:`sm`,disabled:V,"aria-busy":V,className:g(`ml-auto group h-8 gap-1.5 px-3 text-xs`,V?`cursor-not-allowed`:`hover:bg-destructive/12 hover:text-destructive hover:border-destructive/35`),onClick:async()=>{H(!0);try{await a.cancel()}catch{H(!1)}},children:V?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(D,{className:`size-3.5 shrink-0 animate-spin text-muted-foreground`,"aria-hidden":!0}),(0,R.jsx)(k.span,{animate:{opacity:[1,.72,1]},transition:{duration:1.25,repeat:1/0,ease:`easeInOut`},className:`font-medium text-foreground`,children:`Cancelling…`})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(S,{className:`size-3.5 shrink-0 text-foreground/65 group-hover:text-destructive`,"aria-hidden":!0}),(0,R.jsx)(k.span,{animate:{opacity:[1,.88,1]},transition:{duration:2.2,repeat:1/0,ease:`easeInOut`},children:`Cancel`})]})}):(0,R.jsx)(`div`,{className:`ml-auto shrink-0 flex items-center`,children:(0,R.jsx)(_,{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,R.jsx)(ie,{operation:a.operation,catalogTemplates:[{id:t,name:n}]}):(0,R.jsxs)(`div`,{className:`flex flex-col gap-2 py-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(D,{className:`size-3.5 animate-spin text-primary`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`text-xs text-foreground/88`,children:`Connecting to Litmus Edge…`})]}),(0,R.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-muted/40`,children:(0,R.jsx)(k.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,R.jsx)(ue,{children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-border/40 pb-3`,children:[(0,R.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg border border-primary/25 bg-primary/9 shadow-[inset_0_1px_0_0_rgba(255,255,255,0.06)]`,children:(0,R.jsx)(ke,{className:`size-4 text-primary`,"aria-hidden":!0})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`font-heading text-[11px] font-semibold uppercase tracking-[0.12em] text-foreground`,children:`Offline export`}),(0,R.jsx)(`p`,{className:`mt-0.5 text-xs leading-snug text-foreground/88`,children:`Download for CLI, review, or manual import.`})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(P,{className:`font-heading text-[11px] font-medium uppercase tracking-[0.12em] text-foreground/92`,children:`Format`}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,R.jsxs)(_e,{value:m,onValueChange:e=>{e&&oe(e)},children:[(0,R.jsx)(ge,{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,R.jsx)(b,{placeholder:`Select format`,children:t=>{if(t===`source-yaml`)return`Source YAML`;let n=ye.find(e=>e.id===t);return n?.id===`litmus-edge`?Le(e):n?.exportLabel??`Select format`}})}),(0,R.jsxs)(me,{children:[(0,R.jsxs)(C,{children:[(0,R.jsx)(y,{children:`Platform`}),xe.map(t=>(0,R.jsx)(x,{value:t.id,children:t.id===`litmus-edge`?Le(e):t.exportLabel},t.id)),be.map(e=>(0,R.jsx)(x,{value:e.id,disabled:!0,children:(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.exportLabel,(0,R.jsx)(De,{variant:`outline`,className:`px-1 py-0 text-[10px] text-foreground/72`,children:`Coming Soon`})]})},e.id))]}),(0,R.jsx)(he,{}),(0,R.jsxs)(C,{children:[(0,R.jsx)(y,{children:`Source`}),(0,R.jsxs)(x,{value:`source-yaml`,children:[`Source YAML`,` `,(0,R.jsx)(`span`,{className:`text-foreground/72`,children:e===`model`?`.twin.yaml`:`.miravo.yaml`})]})]})]})]}),(0,R.jsxs)(_,{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:!Y,onClick:Re,children:[(0,R.jsx)(E,{className:`size-3.5`}),`Download`]})]})]}),(0,R.jsx)(`div`,{className:`border-t border-border/35 pt-3`,children:(0,R.jsx)(`p`,{className:`text-[10px] leading-snug text-foreground/86`,children:(0,R.jsx)(re,{format:m,kind:e})})})]})}),W&&(0,R.jsx)(ce,{open:de,onOpenChange:h,type:`apply`,label:n,environmentLabel:W.label,hostname:W.hostname,sourceHostname:W.sourceHostname,onConfirm:K,defaultDeviceName:e===`model`?Ie(t):void 0}),(0,R.jsx)(je,{open:w,onOpenChange:O,onCreated:()=>void o.refetch()}),(0,R.jsx)(M,{open:Oe,onOpenChange:e=>{F(e),e||L(q)},children:(0,R.jsxs)(Te,{className:`sm:max-w-md`,children:[(0,R.jsxs)(N,{children:[(0,R.jsx)(Ee,{children:`Download Litmus Edge Template`}),(0,R.jsx)(j,{children:ae})]}),(0,R.jsxs)(`div`,{className:`space-y-2 py-1`,children:[(0,R.jsx)(P,{htmlFor:`deploy-export-source-host`,children:te}),(0,R.jsx)(v,{id:`deploy-export-source-host`,value:I,onChange:e=>L(e.target.value),placeholder:q,autoComplete:`off`,className:`font-mono text-sm`}),(0,R.jsxs)(`p`,{className:`text-[11px] leading-snug text-muted-foreground`,children:[`Use an IP or hostname reachable from Litmus Edge (e.g.`,` `,(0,R.jsx)(`span`,{className:`font-mono`,children:q}),` for Docker bridge).`]})]}),(0,R.jsxs)(A,{className:`gap-2 sm:gap-0`,children:[(0,R.jsx)(_,{type:`button`,variant:`outline`,onClick:()=>F(!1),disabled:z,children:`Cancel`}),(0,R.jsxs)(_,{type:`button`,className:`gap-1.5`,onClick:()=>void ze(),disabled:z,"aria-busy":z,children:[z?(0,R.jsx)(D,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):(0,R.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),`Download`]})]})]})})]})}export{U as a,I as c,W as i,F as l,z as n,Ae as o,H as r,L as s,X as t,Oe as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{ot as n}from"./vendor-ui-ByahnaY0.js";import{t as r}from"./createLucideIcon-Bwxw859K.js";var i=r(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),a=e(t(),1),o=e(n(),1);function s(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var c=e=>{switch(e){case`success`:return d;case`info`:return p;case`warning`:return f;case`error`:return m;default:return null}},l=Array(12).fill(0),u=({visible:e,className:t})=>a.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},a.createElement(`div`,{className:`sonner-spinner`},l.map((e,t)=>a.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),d=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),f=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),p=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),m=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ee=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},a.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),a.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),te=()=>{let[e,t]=a.useState(document.hidden);return a.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},h=1,g=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:h++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,o,s=r.then(async e=>{if(o=[`resolve`,e],a.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(v(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,o=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:o,...s})}}).catch(async e=>{if(o=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>o[0]===`reject`?t(o[1]):e(o[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||h++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},_=(e,t)=>{let n=t?.id||h++;return g.addToast({title:e,...t,id:n}),n},v=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,y=Object.assign(_,{success:g.success,info:g.info,warning:g.warning,error:g.error,custom:g.custom,message:g.message,promise:g.promise,dismiss:g.dismiss,loading:g.loading},{getHistory:()=>g.toasts,getToasts:()=>g.getActiveToasts()});s(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function b(e){return e.label!==void 0}var ne=3,x=`24px`,S=`16px`,C=4e3,w=356,re=14,T=45,ie=200;function E(...e){return e.filter(Boolean).join(` `)}function ae(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var D=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:o,visibleToasts:s,heights:l,index:d,toasts:f,expanded:p,removeToast:m,defaultRichColors:h,closeButton:g,style:_,cancelButtonStyle:v,actionButtonStyle:y,className:ne=``,descriptionClassName:x=``,duration:S,position:w,gap:re,expandByDefault:D,classNames:O,icons:k,closeButtonAriaLabel:A=`Close toast`}=e,[j,M]=a.useState(null),[N,oe]=a.useState(null),[P,F]=a.useState(!1),[I,L]=a.useState(!1),[R,z]=a.useState(!1),[B,se]=a.useState(!1),[ce,V]=a.useState(!1),[le,H]=a.useState(0),[ue,U]=a.useState(0),W=a.useRef(n.duration||S||C),de=a.useRef(null),G=a.useRef(null),fe=d===0,pe=d+1<=s,K=n.type,q=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,J=a.useMemo(()=>l.findIndex(e=>e.toastId===n.id)||0,[l,n.id]),ge=a.useMemo(()=>n.closeButton??g,[n.closeButton,g]),_e=a.useMemo(()=>n.duration||S||C,[n.duration,S]),Y=a.useRef(0),X=a.useRef(0),ve=a.useRef(0),Z=a.useRef(null),[ye,be]=w.split(`-`),xe=a.useMemo(()=>l.reduce((e,t,n)=>n>=J?e:e+t.height,0),[l,J]),Se=te(),Ce=n.invert||t,Q=K===`loading`;X.current=a.useMemo(()=>J*re+xe,[J,xe]),a.useEffect(()=>{W.current=_e},[_e]),a.useEffect(()=>{F(!0)},[]),a.useEffect(()=>{let e=G.current;if(e){let t=e.getBoundingClientRect().height;return U(t),o(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>o(e=>e.filter(e=>e.toastId!==n.id))}},[o,n.id]),a.useLayoutEffect(()=>{if(!P)return;let e=G.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,U(r),o(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[P,n.title,n.description,o,n.id,n.jsx,n.action,n.cancel]);let $=a.useCallback(()=>{L(!0),H(X.current),o(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{m(n)},ie)},[n,m,o,X]);a.useEffect(()=>{if(n.promise&&K===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return p||i||Se?(()=>{if(ve.current<Y.current){let e=new Date().getTime()-Y.current;W.current-=e}ve.current=new Date().getTime()})():W.current!==1/0&&(Y.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),$()},W.current)),()=>clearTimeout(e)},[p,i,n,K,Se,$]),a.useEffect(()=>{n.delete&&($(),n.onDismiss==null||n.onDismiss.call(n,n))},[$,n.delete]);function we(){return k?.loading?a.createElement(`div`,{className:E(O?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":K===`loading`},k.loading):a.createElement(u,{className:E(O?.loader,n?.classNames?.loader),visible:K===`loading`})}let Te=n.icon||k?.[K]||c(K);return a.createElement(`li`,{tabIndex:0,ref:G,className:E(ne,me,O?.toast,n?.classNames?.toast,O?.default,O?.[K],n?.classNames?.[K]),"data-sonner-toast":``,"data-rich-colors":n.richColors??h,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":P,"data-promise":!!n.promise,"data-swiped":ce,"data-removed":I,"data-visible":pe,"data-y-position":ye,"data-x-position":be,"data-index":d,"data-front":fe,"data-swiping":R,"data-dismissible":q,"data-type":K,"data-invert":Ce,"data-swipe-out":B,"data-swipe-direction":N,"data-expanded":!!(p||D&&P),"data-testid":n.testId,style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${I?le:X.current}px`,"--initial-height":D?`auto`:`${ue}px`,..._,...n.style},onDragEnd:()=>{z(!1),M(null),Z.current=null},onPointerDown:e=>{e.button!==2&&(Q||!q||(de.current=new Date,H(X.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(z(!0),Z.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(B||!q)return;Z.current=null;let e=Number(G.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(G.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=j===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=T||a>.11){H(X.current),n.onDismiss==null||n.onDismiss.call(n,n),oe(j===`x`?e>0?`right`:`left`:t>0?`down`:`up`),$(),se(!0);return}else{var o,s;(o=G.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=G.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}V(!1),z(!1),M(null)},onPointerMove:t=>{var n,r;if(!Z.current||!q||window.getSelection()?.toString().length>0)return;let i=t.clientY-Z.current.y,a=t.clientX-Z.current.x,o=e.swipeDirections??ae(w);!j&&(Math.abs(a)>1||Math.abs(i)>1)&&M(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(j===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(j===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&V(!0),(n=G.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=G.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ge&&!n.jsx&&K!==`loading`?a.createElement(`button`,{"aria-label":A,"data-disabled":Q,"data-close-button":!0,onClick:Q||!q?()=>{}:()=>{$(),n.onDismiss==null||n.onDismiss.call(n,n)},className:E(O?.closeButton,n?.classNames?.closeButton)},k?.close??ee):null,(K||n.icon||n.promise)&&n.icon!==null&&(k?.[K]!==null||n.icon)?a.createElement(`div`,{"data-icon":``,className:E(O?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,a.createElement(`div`,{"data-content":``,className:E(O?.content,n?.classNames?.content)},a.createElement(`div`,{"data-title":``,className:E(O?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?a.createElement(`div`,{"data-description":``,className:E(x,he,O?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),a.isValidElement(n.cancel)?n.cancel:n.cancel&&b(n.cancel)?a.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||v,onClick:e=>{b(n.cancel)&&q&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),$())},className:E(O?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,a.isValidElement(n.action)?n.action:n.action&&b(n.action)?a.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||y,onClick:e=>{b(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&$())},className:E(O?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function O(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function k(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?S:x;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var A=a.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:s=[`altKey`,`KeyT`],expand:c,closeButton:l,className:u,offset:d,mobileOffset:f,theme:p=`light`,richColors:m,duration:ee,style:te,visibleToasts:h=ne,toastOptions:_,dir:v=O(),gap:y=re,icons:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=a.useState([]),T=a.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),ie=a.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[E,ae]=a.useState([]),[A,j]=a.useState(!1),[M,N]=a.useState(!1),[oe,P]=a.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),F=a.useRef(null),I=s.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=a.useRef(null),R=a.useRef(!1),z=a.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||g.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return a.useEffect(()=>g.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{o.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),a.useEffect(()=>{if(p!==`system`){P(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),a.useEffect(()=>{S.length<=1&&j(!1)},[S]),a.useEffect(()=>{let e=e=>{if(s.every(t=>e[t]||e.code===t)){var t;j(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&j(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]),a.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),a.createElement(`section`,{ref:t,"aria-label":`${x} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},ie.map((t,n)=>{let[i,o]=t.split(`-`);return T.length?a.createElement(`ol`,{key:t,dir:v===`auto`?O():v,tabIndex:-1,ref:F,className:u,"data-sonner-toaster":!0,"data-sonner-theme":oe,"data-y-position":i,"data-x-position":o,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${w}px`,"--gap":`${y}px`,...te,...k(d,f)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{M||j(!1)},onDragEnd:()=>j(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||N(!0)},onPointerUp:()=>N(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>a.createElement(D,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:m,duration:_?.duration??ee,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:r,visibleToasts:h,closeButton:_?.closeButton??l,interacting:M,position:t,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,closeButtonAriaLabel:_?.closeButtonAriaLabel,removeToast:z,toasts:T.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:ae,expandByDefault:c,gap:y,expanded:A,swipeDirections:e.swipeDirections}))):null}))});export{y as n,i as r,A as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";var n=e(t(),1),r=s();function i(e,...t){if(!r)return;let n=o(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function a(e,...t){r&&console.warn(e,...t)}function o(e,...t){return e.replace(/%[sfdO]/g,e=>{let n=t.shift();return e===`%O`&&n?JSON.stringify(n).replace(/"([^"]+)":/g,`$1:`):String(n)})}function s(){if(typeof window>`u`)return({}.DEBUG||``).includes(`nuqs`);try{let e=`nuqs-localStorage-test`;if(typeof localStorage>`u`)return!1;localStorage.setItem(e,e);let t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem(`debug`)||``).includes(`nuqs`)}catch{return!1}}var c={303:`Multiple adapter contexts detected. This might happen in monorepos.`,404:`nuqs requires an adapter to work with your framework.`,409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:`Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.`,422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:`Empty search params cache. Search params can't be accessed in Layouts.`,501:"Search params cache already populated. Have you called `parse` twice?"};function l(e){return`[nuqs] ${c[e]}
|
|
2
|
-
See https://nuqs.dev/NUQS-${e}`}function u(e){if(e.size===0)return``;let t=[];for(let[n,r]of e.entries()){let e=n.replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/\+/g,`%2B`).replace(/=/g,`%3D`).replace(/\?/g,`%3F`);t.push(`${e}=${d(r)}`)}return`?`+t.join(`&`)}function d(e){return e.replace(/%/g,`%25`).replace(/\+/g,`%2B`).replace(/ /g,`+`).replace(/#/g,`%23`).replace(/&/g,`%26`).replace(/"/g,`%22`).replace(/'/g,`%27`).replace(/`/g,`%60`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}var f=(0,n.createContext)({useAdapter(){throw Error(l(404))}});f.displayName=`NuqsAdapterContext`,r&&typeof window<`u`&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==f&&console.error(l(303)),window.__NuqsAdapterContext=f);function p(e){return({children:t,defaultOptions:r,processUrlSearchParams:i,...a})=>(0,n.createElement)(f.Provider,{...a,value:{useAdapter:e,defaultOptions:r,processUrlSearchParams:i}},t)}function m(e){let t=(0,n.useContext)(f);if(!(`useAdapter`in t))throw Error(l(404));return t.useAdapter(e)}var h=()=>(0,n.useContext)(f).defaultOptions,g=()=>(0,n.useContext)(f).processUrlSearchParams;function _(){if(typeof window>`u`||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}function v(e){return{method:`throttle`,timeMs:e}}var y=v(_());function b(e){return e===null||Array.isArray(e)&&e.length===0}function x(e,t,n){if(typeof e==`string`)n.set(t,e);else{n.delete(t);for(let r of e)n.append(t,r);n.has(t)||n.set(t,``)}return n}function S(){let e=new Map;return{on(t,n){let r=e.get(t)||[];return r.push(n),e.set(t,r),()=>this.off(t,n)},off(t,n){let r=e.get(t);r&&e.set(t,r.filter(e=>e!==n))},emit(t,n){e.get(t)?.forEach(e=>e(n))}}}function C(e,t,n){function r(){e(),n.removeEventListener(`abort`,a)}let i=setTimeout(r,t);function a(){clearTimeout(i),n.removeEventListener(`abort`,a)}n.addEventListener(`abort`,a)}function w(){let e=Promise;if(Promise.hasOwnProperty(`withResolvers`))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((e,r)=>{t=e,n=r}),resolve:t,reject:n}}function T(e,t){let n=t;for(let t=e.length-1;t>=0;t--){let r=e[t];if(!r)continue;let i=n;n=()=>r(i)}n()}function E(){return new URLSearchParams(location.search)}var D=class{updateMap=new Map;options={history:`replace`,scroll:!1,shallow:!0};timeMs=y.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;resetQueueOnNextPush=!1;push({key:e,query:t,options:n},r=y.timeMs){this.resetQueueOnNextPush&&=(this.reset(),!1),i(`[nuqs gtq] Enqueueing %s=%s %O`,e,t,n),this.updateMap.set(e,t),n.history===`push`&&(this.options.history=`push`),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||r>this.timeMs)&&(this.timeMs=r)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=E}){return this.resolvers?.promise??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=E,rateLimitFactor:t=1,...n},r){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return i(`[nuqs gtq] Skipping flush due to throttleMs=Infinity`),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=w();let a=()=>{this.lastFlushedAt=performance.now();let[t,i]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},r);i===null?(this.resolvers.resolve(t),this.resetQueueOnNextPush=!0):this.resolvers.reject(t),this.resolvers=null};return C(()=>{let e=performance.now()-this.lastFlushedAt,n=this.timeMs,r=t*Math.max(0,n-e);i(`[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)`,r,n,t),r===0?a():C(a,r,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){let e=Array.from(this.updateMap.keys());return i(`[nuqs gtq] Resetting queue %s`,JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:`replace`,scroll:!1,shallow:!0},this.timeMs=y.timeMs,e}applyPendingUpdates(e,t){let{updateUrl:n,getSearchParamsSnapshot:r}=e,a=r();if(i(`[nuqs gtq] Applying %d pending update(s) on top of %s`,this.updateMap.size,a.toString()),this.updateMap.size===0)return[a,null];let o=Array.from(this.updateMap.entries()),s={...this.options},c=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),i(`[nuqs gtq] Flushing queue %O with options %O`,o,s);for(let[e,t]of o)t===null?a.delete(e):a=x(t,e,a);t&&(a=t(a));try{return T(c,()=>{n(a,s)}),[a,null]}catch(e){return console.error(l(429),o.map(([e])=>e).join(),e),[a,e]}}},O=new D;function k(e,t,r){let i=(0,n.useCallback)(()=>{let t=Object.fromEntries(e.map(e=>[e,r(e)]));return[JSON.stringify(t),t]},[e.join(`,`),r]),a=(0,n.useRef)(null);return a.current===null&&(a.current=i()),(0,n.useSyncExternalStore)((0,n.useCallback)(n=>{let r=e.map(e=>t(e,n));return()=>r.forEach(e=>e())},[e.join(`,`),t]),()=>{let[e,t]=i();return a.current[0]===e?a.current[1]:(a.current=[e,t],t)},()=>a.current[1])}var A=class{callback;resolvers=w();controller=new AbortController;queuedValue=void 0;constructor(e){this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,C(()=>{let t=this.resolvers;try{i(`[nuqs dq] Flushing debounce queue`,e);let n=this.callback(e);i(`[nuqs dq] Reset debounce queue %O`,this.queuedValue),this.queuedValue=void 0,this.resolvers=w(),n.then(e=>t.resolve(e)).catch(e=>t.reject(e))}catch(e){this.queuedValue=void 0,t.reject(e)}},t,this.controller.signal),this.resolvers.promise}},j=new class{throttleQueue;queues=new Map;queuedQuerySync=S();constructor(e=new D){this.throttleQueue=e}useQueuedQueries(e){return k(e,(e,t)=>this.queuedQuerySync.on(e,t),e=>this.getQueuedQuery(e))}push(e,t,n,r){if(!Number.isFinite(t)){let e=n.getSearchParamsSnapshot??E;return Promise.resolve(e())}let a=e.key;if(!this.queues.has(a)){i("[nuqs dqc] Creating debounce queue for `%s`",a);let e=new A(e=>(this.throttleQueue.push(e),this.throttleQueue.flush(n,r).finally(()=>{this.queues.get(e.key)?.queuedValue===void 0&&(i("[nuqs dqc] Cleaning up empty queue for `%s`",e.key),this.queues.delete(e.key)),this.queuedQuerySync.emit(e.key)})));this.queues.set(a,e)}i(`[nuqs dqc] Enqueueing debounce update %O`,e);let o=this.queues.get(a).push(e,t);return this.queuedQuerySync.emit(a),o}abort(e){let t=this.queues.get(e);return t?(i(`[nuqs dqc] Aborting debounce queue %s=%s`,e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),e=>(e.then(t.resolvers.resolve,t.resolvers.reject),e)):e=>e}abortAll(){for(let[e,t]of this.queues.entries())i(`[nuqs dqc] Aborting debounce queue %s=%s`,e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){let t=this.queues.get(e)?.queuedValue?.query;return t===void 0?this.throttleQueue.getQueuedQuery(e):t}}(O);function M(e,t){return e===t?!0:e===null||t===null||typeof e==`string`||typeof t==`string`||e.length!==t.length?!1:e.every((e,n)=>e===t[n])}function N(e,t,n){try{return e(t)}catch(e){return a("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":``),t,e,n),null}}function P(e){function t(t){if(t===void 0)return null;let n=``;if(Array.isArray(t)){if(t[0]===void 0)return null;n=t[0]}return typeof t==`string`&&(n=t),N(e.parse,n)}return{type:`single`,eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide(n){return t(n)??e}}},withOptions(e){return{...this,...e}}}}var F=P({parse:e=>e,serialize:String}),I=P({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>``+Math.round(e)});P({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>``+Math.round(e+1)}),P({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(t.length&1?`0`:``)+t}}),P({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String}),P({parse:e=>e.toLowerCase()===`true`,serialize:String});function L(e,t){return e.valueOf()===t.valueOf()}P({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>``+e.valueOf(),eq:L}),P({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:L}),P({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:L});function R(e){return P({parse:t=>{let n=t;return e.includes(n)?n:null},serialize:String})}var z=S(),B={};function V(e,t={}){let r=(0,n.useId)(),a=h(),o=g(),{history:s=`replace`,scroll:c=a?.scroll??!1,shallow:u=a?.shallow??!0,throttleMs:d=y.timeMs,limitUrlUpdates:f=a?.limitUrlUpdates,clearOnDefault:p=a?.clearOnDefault??!0,startTransition:_,urlKeys:v=B}=t,b=Object.keys(e).join(`,`),x=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,v[e]??e])),[b,JSON.stringify(v)]),S=m(Object.values(x)),C=S.searchParams,w=(0,n.useRef)({}),T=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(`,`)]),E=j.useQueuedQueries(Object.values(x)),[D,k]=(0,n.useState)(()=>H(e,v,C??new URLSearchParams,E).state),A=(0,n.useRef)(D);if(i("[nuq+ %s `%s`] render - state: %O, iSP: %s",r,b,D,C),Object.keys(w.current).join(`&`)!==Object.values(x).join(`&`)){let{state:t,hasChanged:n}=H(e,v,C,E,w.current,A.current);n&&(i("[nuq+ %s `%s`] State changed: %O",r,b,{state:t,initialSearchParams:C,queuedQueries:E,queryRef:w.current,stateRef:A.current}),A.current=t,k(t)),w.current=Object.fromEntries(Object.entries(x).map(([t,n])=>[n,e[t]?.type===`multi`?C?.getAll(n):C?.get(n)??null]))}(0,n.useEffect)(()=>{let{state:t,hasChanged:n}=H(e,v,C,E,w.current,A.current);n&&(i("[nuq+ %s `%s`] State changed: %O",r,b,{state:t,initialSearchParams:C,queuedQueries:E,queryRef:w.current,stateRef:A.current}),A.current=t,k(t))},[Object.values(x).map(e=>`${e}=${C?.getAll(e)}`).join(`&`),JSON.stringify(E)]),(0,n.useEffect)(()=>{let t=Object.keys(e).reduce((t,n)=>(t[n]=({state:t,query:a})=>{k(o=>{let{defaultValue:s}=e[n],c=x[n],l=t??s??null,u=o[n]??s??null;return Object.is(u,l)?(i("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",r,b,c,t,s,A.current),o):(A.current={...A.current,[n]:l},w.current[c]=a,i("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",r,b,c,t,s,A.current),A.current)})},t),{});for(let n of Object.keys(e)){let e=x[n];i("[nuq+ %s `%s`] Subscribing to sync for `%s`",r,e,b),z.on(e,t[n])}return()=>{for(let n of Object.keys(e)){let e=x[n];i("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",r,e,b),z.off(e,t[n])}}},[b,x]);let M=(0,n.useCallback)((t,n={})=>{let a=Object.fromEntries(Object.keys(e).map(e=>[e,null])),m=typeof t==`function`?t(U(A.current,T))??a:t??a;i("[nuq+ %s `%s`] setState: %O",r,b,m);let h,g=0,v=!1,C=[];for(let[t,r]of Object.entries(m)){let i=e[t],a=x[t];if(!i||r===void 0)continue;(n.clearOnDefault??i.clearOnDefault??p)&&r!==null&&i.defaultValue!==void 0&&(i.eq??((e,t)=>e===t))(r,i.defaultValue)&&(r=null);let m=r===null?null:(i.serialize??String)(r);z.emit(a,{state:r,query:m});let b={key:a,query:m,options:{history:n.history??i.history??s,shallow:n.shallow??i.shallow??u,scroll:n.scroll??i.scroll??c,startTransition:n.startTransition??i.startTransition??_}};if(n?.limitUrlUpdates?.method===`debounce`||f?.method===`debounce`||i.limitUrlUpdates?.method===`debounce`){b.options.shallow===!0&&console.warn(l(422));let e=n?.limitUrlUpdates?.timeMs??f?.timeMs??i.limitUrlUpdates?.timeMs??y.timeMs,t=j.push(b,e,S,o);g<e&&(h=t,g=e)}else{let e=n?.limitUrlUpdates?.timeMs??i?.limitUrlUpdates?.timeMs??f?.timeMs??n.throttleMs??i.throttleMs??d;C.push(j.abort(a)),O.push(b,e),v=!0}}let w=C.reduce((e,t)=>t(e),v?O.flush(S,o):O.getPendingPromise(S));return h??w},[b,s,u,c,d,f?.method,f?.timeMs,_,x,S.updateUrl,S.getSearchParamsSnapshot,S.rateLimitFactor,o,T]);return[(0,n.useMemo)(()=>U(D,T),[D,T]),M]}function H(e,t,n,r,i,a){let o=!1,s=Object.entries(e).reduce((e,[s,c])=>{let l=t?.[s]??s,u=r[l],d=c.type===`multi`?[]:null,f=u===void 0?(c.type===`multi`?n?.getAll(l):n?.get(l))??d:u;return i&&a&&M(i[l]??d,f)?(e[s]=a[s]??null,e):(o=!0,e[s]=(b(f)?null:N(c.parse,f,l))??null,i&&(i[l]=f),e)},{});if(!o){let t=Object.keys(e),n=Object.keys(a??{});o=t.length!==n.length||t.some(e=>!n.includes(e))}return{state:s,hasChanged:o}}function U(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}function W(e,t={}){let{parse:r,type:i,serialize:a,eq:o,defaultValue:s,...c}=t,[{[e]:l},u]=V({[e]:{parse:r??(e=>e),type:i,serialize:a,eq:o,defaultValue:s}},c);return[l,(0,n.useCallback)((t,n={})=>u(n=>({[e]:typeof t==`function`?t(n[e]):t}),n),[e,u])]}export{M as a,O as c,l as d,u as f,W as i,p as l,F as n,S as o,R as r,j as s,I as t,i as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-Bwxw859K.js";var t=e(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";var n=e(t(),1),r=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},i=(e=>e?r(e):r),a=e=>e;function o(e,t=a){let r=n.useSyncExternalStore(e.subscribe,n.useCallback(()=>t(e.getState()),[e,t]),n.useCallback(()=>t(e.getInitialState()),[e,t]));return n.useDebugValue(r),r}var s=e=>{let t=i(e),n=e=>o(t,e);return Object.assign(n,t),n},c=(e=>e?s(e):s),l=200,u=`miravo:runtime-snapshot`;function d(e){try{sessionStorage.setItem(u,JSON.stringify(e))}catch{}}function f(){try{sessionStorage.removeItem(u)}catch{}}function p(e){if(typeof e!=`object`||!e)return!1;let t=e;if(typeof t.revision!=`number`||typeof t.state!=`object`||t.state===null||typeof t.metrics!=`object`||t.metrics===null)return!1;let n=t.metrics;return typeof n.core!=`object`||n.core===null?!1:Array.isArray(t.runningTemplates)}function m(){try{let e=sessionStorage.getItem(u);if(!e)return null;let t=JSON.parse(e);return p(t)?t:(f(),null)}catch{return f(),null}}function h(e){let t=e.metrics.core.tickCount,n=e.metrics.core.actualTicksPerSecond;return{connectionState:`live`,fatalError:null,lastRevision:e.revision,simulationName:e.state.simulationName??e.metrics.simulationName??``,engineState:e.metrics.core.state,tick:t,simulationTime:e.metrics.core.simulationTimeSeconds,instanceCount:e.metrics.core.instanceCount,memberValueCount:e.metrics.core.memberValueCount,tps:n,uptimeMs:e.metrics.core.uptimeMs,speedMultiplier:e.state.config.timeMultiplier,instances:[...e.state.instances],models:[...e.state.models],tpsHistory:[{tick:t,tps:n}],templateRuns:[...e.runningTemplates],availableAdapters:e.state.availableAdapters??[],adapterMetrics:e.metrics.adapters??[],memberValues:new Map,events:[]}}var g=c((e,t)=>({connectionState:`booting`,fatalError:null,lastRevision:0,simulationName:``,engineState:`idle`,tick:0,simulationTime:0,instanceCount:0,memberValueCount:0,tps:0,uptimeMs:0,speedMultiplier:1,instances:[],models:[],tpsHistory:[],templateRuns:[],availableAdapters:[],adapterMetrics:[],memberValues:new Map,events:[],hydrate:t=>{e(h(t)),d(t)},replaceRuntime:t=>{e(h(t)),d(t)},applyTick:n=>{let r=t(),i=n.delta??[],a=n.tick??r.tick,o=n.simulationTime??r.simulationTime,s=n.instanceCount??r.instanceCount;if(i.length===0&&a===r.tick&&o===r.simulationTime&&s===r.instanceCount)return;let c={tick:a,simulationTime:o,instanceCount:s,lastRevision:n.revision};if(i.length>0){let e=new Map(r.memberValues),t=new Set;for(let n of i){if(!t.has(n.instanceId)){let r=e.get(n.instanceId);e.set(n.instanceId,new Map(r)),t.add(n.instanceId)}e.get(n.instanceId)?.set(n.memberName,{value:n.value,quality:n.quality})}c.memberValues=e}e(c)},applyEvent:(n,r)=>{let i={events:[n,...t().events].slice(0,l),lastRevision:r};if(n.kind===`instance:removed`){let r=new Map(t().memberValues);r.delete(n.id),e({...i,memberValues:r});return}if(n.kind===`fault:triggered`||n.kind===`fault:cleared`){let r=t().instances.map(e=>{if(e.id!==n.instanceId)return e;let t=n.kind===`fault:triggered`?[...e.activeFaults,n.fault]:e.activeFaults.filter(e=>e!==n.fault);return{...e,activeFaults:t}});e({...i,instances:r});return}if(n.kind===`engine:state`){e({...i,engineState:n.to});return}e(i)},markConnection:t=>{e({connectionState:t})},markFatal:t=>{e({connectionState:`fatal`,fatalError:t})},markUnauthenticated:()=>{e({connectionState:`unauthenticated`})}}));function _(){let e=m();e&&g.getState().hydrate(e)}export{c as a,g as i,_ as n,m as r,f as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./events-D01IxhnP.js";export{e as EventsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-ByahnaY0.js";import{a as r}from"./api-4AqKvsm9.js";import{o as i,r as ee,t as a}from"./query-keys-BvtE7BMs.js";import{n as o}from"./input-BWEQFptx.js";import{c as s,i as c,n as te,s as ne,t as re}from"./select-CeO4vP0G.js";import{u as l}from"./chunk-OE4NN4TA-CEjpfhS6.js";import{n as u,t as d}from"./proxy-CsnYqnPp.js";import{n as ie,t as ae}from"./use-transition-navigate-CCpcWXB0.js";import{n as oe}from"./transition-types-CPlGtM8w.js";import{i as f}from"./engine-store-CrLnz692.js";import{c as p,u as se}from"./format-kXTonpDJ.js";import{n as m,t as h}from"./get-error-message-3Q5Q-2G5.js";import{n as g,t as ce}from"./card-BjeP32PN.js";import{a as le,i as ue,n as de,r as _,t as v}from"./combobox-BGnuCYxO.js";import{a as y,c as b,i as fe,o as x,r as pe,s as me,t as he}from"./select-display-items-CIzY8953.js";var S=e(t(),1),C=n(),ge=1500,w=[`row-1`,`row-2`,`row-3`,`row-4`,`row-5`,`row-6`];function _e(e){return e.includes(`triggered`)?`destructive`:e.includes(`cleared`)||e.includes(`created`)?`default`:e.includes(`removed`)||e.includes(`lifecycle`)?`secondary`:(e.includes(`state-changed`),`outline`)}function ve(e){return e.includes(`state-changed`)?`border-blue-600/30 bg-blue-600/20 text-blue-400 hover:bg-blue-600/20`:e===`platform:operation`?`border-violet-600/30 bg-violet-600/20 text-violet-400 hover:bg-violet-600/20`:e===`platform:resource`?`border-violet-600/30 bg-violet-600/15 text-violet-300 hover:bg-violet-600/15`:``}function T(e){if(e.type===`platform:operation`){let t=e.operationType===`apply`?`Apply`:`Cleanup`,n=e.applied,r=e.operationType===`apply`?`applied`:`deleted`,i=e.failed>0?`, ${e.failed} failed`:``;return`${t} ${e.templateId} \u2192 ${e.environmentLabel} (${n} ${r}${i})`}return e.type===`platform:resource`?`${e.status===`success`?`✓`:`✗`} ${e.action} ${e.resourceType} ${e.resourceName}`:``}function E(e,t){let n=new Date(e);return n.toDateString()===t.toDateString()?n.toLocaleTimeString():n.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function D(e){if(`instanceId`in e&&typeof e.instanceId==`string`)return e.instanceId}function O(e){return e.type===`platform:operation`||e.type===`platform:resource`?e.environmentLabel:D(e)}function k(e){return`fault`in e?p(e.fault):e.type===`platform:operation`||e.type===`platform:resource`?T(e):`from`in e&&`to`in e?`${p(e.from)} \u2192 ${p(e.to)}`:``}function A(e,t,n){let r=new URLSearchParams;return r.set(`limit`,`50`),e!==`all`&&r.set(`type`,e),t&&r.set(`instanceId`,t),n!==null&&r.set(`cursor`,String(n)),`/events?${r.toString()}`}function j(){let e=i(),[t]=l(),[n,p]=(0,S.useState)(t.get(`type`)??`all`),[T,j]=(0,S.useState)(t.get(`instanceId`)??``),[M,N]=(0,S.useState)(!0),P=f(e=>e.events.length),F=f(e=>e.instances),ye=ae(),I=ee({queryKey:a.events(n,T),queryFn:()=>r(A(n,T,null)),refetchInterval:M?ge:!1,staleTime:5e3}),[be,L]=(0,S.useState)([]),[xe,R]=(0,S.useState)(!1),[Se,z]=(0,S.useState)(null),B=`${n}::${T}`,V=(0,S.useRef)(B);(0,S.useEffect)(()=>{B!==V.current&&(V.current=B,L([]),z(null),U(!1))},[B]);let[H,U]=(0,S.useState)(()=>(I.data?.events.length??0)>0),W=I.data?[I.data,...be]:[],G=W.flatMap(e=>e.events),K=W[W.length-1],Ce=K?.hasMore??!1;(0,S.useEffect)(()=>{G.length>0&&!H&&U(!0)},[G.length,H]);let q=(0,S.useRef)(P);(0,S.useEffect)(()=>{P!==q.current&&(q.current=P,M&&e.invalidateQueries({queryKey:a.events(n,T)}))},[P,M,e,n,T]);let[J,we]=(0,S.useState)(``),Y=(0,S.useMemo)(()=>J?F.filter(e=>e.id.toLowerCase().includes(J.toLowerCase())):F,[F,J]),X=I.isPending&&!I.data&&!I.isError,Z=M&&!X&&!H&&G.length===0,Q=I.error??Se,Te=I.isError&&!I.data,$=(0,S.useCallback)(()=>{I.refetch()},[I]),Ee=async()=>{if(K?.nextCursor){R(!0),z(null);try{let e=await r(A(n,T,K.nextCursor));L(t=>[...t,e])}catch(e){z(e instanceof Error?e:Error(String(e)))}finally{R(!1)}}};if(Te)return(0,C.jsx)(`div`,{className:`flex min-h-[40vh] flex-col items-center justify-center p-6 sm:p-12`,children:(0,C.jsx)(`div`,{className:`w-full max-w-md`,children:(0,C.jsx)(m,{message:h(Q,`Failed to fetch events.`),onRetry:$,isRetrying:I.isFetching})})});let De=new Date;return(0,C.jsxs)(`div`,{className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[Q&&G.length>0?(0,C.jsx)(m,{message:`${h(Q,`Failed to fetch events.`)} Showing cached events.`,onRetry:$,isRetrying:I.isFetching}):null,(0,C.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 lg:flex-row lg:items-center lg:justify-between lg:gap-4`,children:[(0,C.jsxs)(`div`,{className:`min-w-0 flex flex-col gap-1`,children:[(0,C.jsx)(`h2`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Event Log`}),(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Real-time event stream from the engine.`})]}),(0,C.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2 sm:flex-row sm:flex-nowrap sm:items-center sm:gap-2 lg:w-auto lg:max-w-full`,children:[(0,C.jsx)(`button`,{type:`button`,onClick:()=>N(e=>!e),className:`flex h-7 shrink-0 items-center self-start overflow-hidden rounded-md border border-border/40 px-2 py-1 text-xs transition-colors hover:bg-muted sm:self-auto`,children:(0,C.jsx)(u,{mode:`wait`,initial:!1,children:M?(0,C.jsxs)(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:`flex items-center gap-1.5`,children:[(0,C.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-success`}),(0,C.jsx)(`span`,{className:`font-medium text-success`,children:`LIVE`})]},`live`):(0,C.jsxs)(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:`flex items-center gap-1.5`,children:[(0,C.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground`}),(0,C.jsx)(`span`,{className:`text-muted-foreground`,children:`Paused`})]},`paused`)})}),(0,C.jsx)(`div`,{className:`min-w-0 flex-1 lg:w-48 lg:flex-none`,children:(0,C.jsxs)(v,{value:T||null,onValueChange:e=>{j(e??``)},onInputValueChange:we,children:[(0,C.jsx)(_,{placeholder:`All instances`,className:`h-8 w-full min-w-0 text-xs`,showClear:!!T}),(0,C.jsx)(de,{children:(0,C.jsxs)(le,{children:[Y.map(e=>(0,C.jsx)(ue,{value:e.id,className:`text-xs`,children:(0,C.jsx)(`span`,{className:`font-mono`,children:e.id})},e.id)),Y.length===0&&(0,C.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No instances found`})]})})]})}),(0,C.jsx)(`div`,{className:`min-w-0 flex-1 lg:w-48 lg:flex-none`,children:(0,C.jsxs)(re,{value:n,onValueChange:e=>{p(e??`all`)},items:he,children:[(0,C.jsx)(ne,{className:`w-full min-w-0 lg:w-48`,"aria-label":`Event type filter`,children:(0,C.jsx)(s,{placeholder:`Filter by type`})}),(0,C.jsxs)(te,{alignItemWithTrigger:!1,align:`start`,children:[(0,C.jsx)(c,{value:`all`,children:`All events`}),(0,C.jsx)(c,{value:`fault:triggered`,children:`Fault Triggered`}),(0,C.jsx)(c,{value:`fault:cleared`,children:`Fault Cleared`}),(0,C.jsx)(c,{value:`lifecycle:changed`,children:`Lifecycle Changed`}),(0,C.jsx)(c,{value:`instance:created`,children:`Instance Created`}),(0,C.jsx)(c,{value:`instance:removed`,children:`Instance Removed`}),(0,C.jsx)(c,{value:`engine:state-changed`,children:`Engine State`}),(0,C.jsx)(c,{value:`platform:resource`,children:`Platform Resource`}),(0,C.jsx)(c,{value:`platform:operation`,children:`Platform Operation`})]})]})})]})]}),(0,C.jsx)(ce,{className:`min-w-0 py-0`,children:(0,C.jsx)(g,{className:`p-0`,children:(0,C.jsxs)(pe,{children:[(0,C.jsx)(me,{children:(0,C.jsxs)(b,{children:[(0,C.jsx)(x,{className:`hidden w-12 sm:table-cell`,children:`#`}),(0,C.jsx)(x,{children:`Type`}),(0,C.jsx)(x,{children:`Context`}),(0,C.jsx)(x,{children:`Details`}),(0,C.jsx)(x,{className:`hidden text-right md:table-cell`,children:`Cycle #`}),(0,C.jsx)(x,{className:`hidden text-right sm:table-cell`,children:`Wall Clock`})]})}),(0,C.jsxs)(fe,{children:[X&&w.map(e=>(0,C.jsxs)(b,{children:[(0,C.jsx)(y,{className:`hidden sm:table-cell`,children:(0,C.jsx)(`div`,{className:`h-4 w-8 animate-pulse rounded bg-muted/40`})}),(0,C.jsx)(y,{children:(0,C.jsx)(`div`,{className:`h-5 w-28 animate-pulse rounded bg-muted/40`})}),(0,C.jsx)(y,{children:(0,C.jsx)(`div`,{className:`h-4 w-36 animate-pulse rounded bg-muted/30`})}),(0,C.jsx)(y,{children:(0,C.jsx)(`div`,{className:`h-4 w-56 animate-pulse rounded bg-muted/30`})}),(0,C.jsx)(y,{className:`hidden md:table-cell`,children:(0,C.jsx)(`div`,{className:`ml-auto h-4 w-16 animate-pulse rounded bg-muted/30`})}),(0,C.jsx)(y,{className:`hidden sm:table-cell`,children:(0,C.jsx)(`div`,{className:`ml-auto h-4 w-20 animate-pulse rounded bg-muted/30`})})]},e)),G.map(e=>{let t=D(e),n=O(e),r=e.type===`platform:resource`||e.type===`platform:operation`;return(0,C.jsxs)(b,{className:t?`cursor-pointer transition-colors hover:bg-muted/50`:``,onMouseEnter:t?()=>ie(`/instance/${t}`):void 0,onClick:t?()=>ye(`/instance/${t}`,{transitionType:oe}):void 0,children:[(0,C.jsx)(y,{className:`hidden font-mono text-xs text-muted-foreground sm:table-cell`,children:e.id}),(0,C.jsx)(y,{children:(0,C.jsx)(se,{variant:_e(e.type),className:`text-xs ${ve(e.type)}`,children:r?e.type===`platform:operation`?`platform:${e.operationType}`:`${e.action}:${e.resourceType}`:e.type})}),(0,C.jsx)(y,{className:`font-mono text-xs`,children:n??`—`}),(0,C.jsx)(y,{className:`max-w-xs truncate font-mono text-xs`,children:k(e)||(0,C.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})}),(0,C.jsx)(y,{className:`hidden text-right font-mono text-xs md:table-cell`,children:e.tick}),(0,C.jsx)(y,{className:`hidden text-right text-xs text-muted-foreground sm:table-cell`,children:E(e.timestamp,De)})]},e.id)}),Z&&w.map(e=>(0,C.jsxs)(b,{children:[(0,C.jsx)(y,{className:`hidden sm:table-cell`,children:(0,C.jsx)(`div`,{className:`h-4 w-8 animate-pulse rounded bg-muted/30`})}),(0,C.jsx)(y,{children:(0,C.jsx)(`div`,{className:`h-5 w-28 animate-pulse rounded bg-muted/30`})}),(0,C.jsx)(y,{children:(0,C.jsx)(`div`,{className:`h-4 w-36 animate-pulse rounded bg-muted/20`})}),(0,C.jsx)(y,{children:(0,C.jsx)(`div`,{className:`h-4 w-56 animate-pulse rounded bg-muted/20`})}),(0,C.jsx)(y,{className:`hidden md:table-cell`,children:(0,C.jsx)(`div`,{className:`ml-auto h-4 w-16 animate-pulse rounded bg-muted/20`})}),(0,C.jsx)(y,{className:`hidden sm:table-cell`,children:(0,C.jsx)(`div`,{className:`ml-auto h-4 w-20 animate-pulse rounded bg-muted/20`})})]},`warmup-${e}`)),!X&&!Z&&G.length===0&&(0,C.jsx)(b,{children:(0,C.jsx)(y,{colSpan:6,className:`py-8 text-center text-muted-foreground`,children:`No events`})})]})]})})}),Ce&&(0,C.jsx)(`div`,{className:`flex justify-center border-t border-border/40 pt-4`,children:(0,C.jsx)(o,{variant:`outline`,size:`sm`,onClick:()=>void Ee(),disabled:xe,children:`Load older events`})})]})}export{j as t};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-ByahnaY0.js";import{t as r}from"./createLucideIcon-Bwxw859K.js";import{t as i}from"./activity-DsWeRq4h.js";import{t as a}from"./arrow-right-Ea_UhTNi.js";import{t as o}from"./arrow-up-down-DFSjzzl2.js";import{t as s}from"./box-C1WaoOMF.js";import{i as c,t as l}from"./input-BWEQFptx.js";import{c as u,i as d,l as f,n as p,s as m,t as h}from"./select-CeO4vP0G.js";import{t as g}from"./layers-CUsLQ1fq.js";import{t as _}from"./radio-CoHegOv5.js";import{c as v,u as y}from"./chunk-OE4NN4TA-CEjpfhS6.js";import{t as b}from"./shallow-6lGjQhtJ.js";import{i as x,n as S,t as C}from"./tooltip-HGLF366Q.js";import{n as w}from"./use-transition-navigate-CCpcWXB0.js";import{n as T}from"./transition-types-CPlGtM8w.js";import{i as E}from"./engine-store-CrLnz692.js";import{t as D}from"./transition-nav-link-Df4Rk6vV.js";import{c as O,o as ee,u as k}from"./format-kXTonpDJ.js";import{n as te,t as ne}from"./card-BjeP32PN.js";import{a as re,i as ie,n as A,r as j,t as M}from"./combobox-BGnuCYxO.js";import{a as N,c as P,i as F,n as I,o as L,r as R,s as z}from"./select-display-items-CIzY8953.js";var B=r(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),V=r(`radio-tower`,[[`path`,{d:`M4.9 16.1C1 12.2 1 5.8 4.9 1.9`,key:`s0qx1y`}],[`path`,{d:`M7.8 4.7a6.14 6.14 0 0 0-.8 7.5`,key:`1idnkw`}],[`circle`,{cx:`12`,cy:`9`,r:`2`,key:`1092wv`}],[`path`,{d:`M16.2 4.8c2 2 2.26 5.11.8 7.47`,key:`ojru2q`}],[`path`,{d:`M19.1 1.9a9.96 9.96 0 0 1 0 14.1`,key:`rhi7fg`}],[`path`,{d:`M9.5 18h5`,key:`mfy3pd`}],[`path`,{d:`m8 22 4-11 4 11`,key:`25yftu`}]]),H=r(`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(t(),1),W=n(),G=[{label:`Platforms`,Icon:B,href:`/platforms`},{label:`Control`,Icon:H,href:`/control`},{label:`Events`,Icon:i,href:`/events`},{label:`Tags`,Icon:V,href:`/tags`},{label:`Catalog`,Icon:g,href:`/catalog`},{label:`Models`,Icon:s,href:`/models`}];function ae(){return(0,W.jsx)(`div`,{className:`relative overflow-hidden rounded-xl border border-border`,children:(0,W.jsx)(`div`,{className:`grid grid-cols-3 sm:grid-cols-6`,children:G.map(({label:e,Icon:t,href:n},r)=>(0,W.jsx)(`div`,{className:c(`min-h-0 min-w-0`,r%3!=0&&`border-border/55 max-sm:border-l max-sm:border-solid`,r>=3&&`max-sm:border-t max-sm:border-solid max-sm:border-border/55`,`sm:border-solid sm:border-border/55`,r!==0&&`sm:border-l`),children:(0,W.jsx)(D,{to:n,className:({isActive:e})=>c(`group relative flex min-h-[4.25rem] flex-col items-center justify-center gap-1.5 px-2 py-3 text-center outline-none`,`transition-[color,background-color,box-shadow] duration-150 ease-out`,`hover:bg-muted/35 focus-visible:z-[2] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,e&&[`bg-primary/[0.07]`,`shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--primary)_22%,transparent)]`]),children:({isActive:n})=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(t,{className:c(`size-[18px] shrink-0 transition-colors duration-150 ease-out sm:size-5`,n?`text-primary`:`text-primary/75 group-hover:text-primary`)}),(0,W.jsx)(`span`,{className:c(`font-heading text-[10px] font-semibold uppercase leading-tight tracking-[0.14em] sm:text-[11px]`,n?`text-foreground`:`text-muted-foreground`),children:e})]})})},n))})})}function oe({onStatusFilter:e}){let{instances:t,tps:n,instanceCount:r,memberValueCount:i}=E(b(e=>({instances:e.instances,tps:e.tps,instanceCount:e.instanceCount,memberValueCount:e.memberValueCount}))),{healthy:a,faulted:o,quarantined:s,total:c,pct:l,activeFaultCount:u,modelCount:d,affectedCount:f}=(0,U.useMemo)(()=>{let e=t.filter(e=>!e.isQuarantined&&e.activeFaults.length===0).length,n=t.filter(e=>!e.isQuarantined&&e.activeFaults.length>0).length,r=t.filter(e=>e.isQuarantined).length,i=t.length;return{healthy:e,faulted:n,quarantined:r,total:i,pct:i>0?Math.round(e/i*100):100,activeFaultCount:t.reduce((e,t)=>e+t.activeFaults.length,0),modelCount:new Set(t.map(e=>e.model)).size,affectedCount:new Set(t.filter(e=>e.activeFaults.length>0).map(e=>e.id)).size}},[t]),p=u>0;return(0,W.jsxs)(`div`,{className:`flex min-w-0 w-full max-w-full flex-col divide-y divide-border/40 overflow-hidden rounded-lg border sm:flex-row sm:divide-x sm:divide-y-0`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 flex-col gap-1 overflow-hidden px-4 py-3 text-left transition-colors hover:bg-muted hover:text-foreground dark:hover:bg-muted/50`,onClick:()=>e(p?`faulted`:`healthy`),children:[(0,W.jsx)(`span`,{className:`truncate text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Health`}),(0,W.jsx)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:(0,W.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-2xl font-bold tabular-nums leading-none transition-colors duration-300 ${p?`text-destructive`:`text-success`}`,children:[l,`%`]})}),(0,W.jsxs)(`span`,{className:`min-w-0 truncate text-[10px] text-muted-foreground`,children:[a>0&&`${a} ok`,o>0&&` · ${o} faulted`,s>0&&` · ${s} qrtn`,c===0&&`No instances`]})]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1 overflow-hidden px-4 py-3`,children:[(0,W.jsx)(`span`,{className:`truncate text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Faults`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xl font-bold tabular-nums leading-none transition-colors duration-300 ${p?`text-destructive`:`text-foreground`}`,children:u}),(0,W.jsx)(`span`,{className:`min-w-0 truncate text-[10px] text-muted-foreground`,children:p?`${f} affected`:`all clear`})]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1 overflow-hidden px-4 py-3`,children:[(0,W.jsx)(`span`,{className:`truncate text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Instances`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xl font-bold tabular-nums leading-none`,children:r}),(0,W.jsxs)(`span`,{className:`min-w-0 truncate text-[10px] text-muted-foreground`,children:[d,` models`]})]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1 overflow-hidden px-4 py-3`,children:[(0,W.jsx)(`span`,{className:`truncate text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Tags`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xl font-bold tabular-nums leading-none`,children:i.toLocaleString()}),(0,W.jsxs)(`span`,{className:`min-w-0 truncate text-[10px] text-muted-foreground`,children:[n.toFixed(1),` tps`]})]})]})}function se(e,t,n){let r=n===`asc`?1:-1;return[...e].sort((e,n)=>{switch(t){case`id`:return e.id.localeCompare(n.id)*r;case`model`:return e.model.localeCompare(n.model)*r;case`lifecycle`:return e.lifecycleStage.localeCompare(n.lifecycleStage)*r;case`hours`:return(e.operatingHours-n.operatingHours)*r;case`faults`:return(e.activeFaults.length-n.activeFaults.length)*r;case`status`:{let t=e=>e.isQuarantined?2:+(e.activeFaults.length>0);return(t(e)-t(n))*r}default:return 0}})}var K={mqtt:`MQTT`,opcua:`OPC UA`,modbus:`Modbus`};function q({value:e}){let[t,n]=(0,U.useState)(!1),r=(0,U.useRef)(e);return(0,U.useEffect)(()=>{if(e!==r.current){r.current=e,n(!0);let t=setTimeout(()=>n(!1),600);return()=>clearTimeout(t)}},[e]),(0,W.jsx)(`span`,{className:c(`font-mono tabular-nums transition-colors duration-500`,t?`text-primary`:`text-muted-foreground`),children:e.toLocaleString()})}function ce(){let{availableAdapters:e,adapterMetrics:t}=E(b(e=>({availableAdapters:e.availableAdapters,adapterMetrics:e.adapterMetrics}))),n=e.filter(e=>e.enabled);return n.length===0?null:(0,W.jsxs)(`div`,{className:`flex items-center gap-4 text-[10px] text-muted-foreground`,children:[(0,W.jsx)(_,{className:`size-3 animate-pulse text-muted-foreground`,"aria-hidden":!0}),n.map(e=>{let n=t.find(t=>t.name===e.name)?.metrics,r=K[e.name]??e.name;return(0,W.jsxs)(C,{children:[(0,W.jsxs)(x,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`}),(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:r}),n&&(0,W.jsx)(q,{value:n.messagesPublished})]}),(0,W.jsx)(S,{side:`top`,children:n?(0,W.jsxs)(`span`,{children:[n.messagesPublished.toLocaleString(),` messages published`,n.errorsCount>0&&` · ${n.errorsCount} errors`]}):(0,W.jsx)(`span`,{children:`Enabled — no metrics yet`})})]},e.name)})]})}function J({label:e,sortKey:t,subtitle:n,current:r,onSort:i,className:a}){return(0,W.jsx)(L,{className:a,children:(0,W.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 whitespace-nowrap text-left`,onClick:()=>i(t),children:[(0,W.jsxs)(`span`,{className:`inline-flex items-baseline gap-1`,children:[(0,W.jsx)(`span`,{children:e}),n&&(0,W.jsx)(`span`,{className:`text-[10px] font-normal text-muted-foreground`,children:n})]}),(0,W.jsx)(o,{className:`size-3 ${r===t?`text-foreground`:`text-muted-foreground`}`})]})})}function Y(){let{instances:e,simulationName:t,connectionState:n}=E(b(e=>({instances:e.instances,simulationName:e.simulationName,connectionState:e.connectionState}))),[r]=y(),[i,o]=(0,U.useState)(r.get(`model`)??``),s=(0,U.useRef)(null),[c,g]=(0,U.useState)(``),[_,x]=(0,U.useState)(``),[S,C]=(0,U.useState)(``),[D,B]=(0,U.useState)(`id`),[V,H]=(0,U.useState)(`asc`),G=v(),[K,q]=(0,U.useState)(``);(0,U.useEffect)(()=>{let e=r.get(`model`);e&&x(e)},[r]),(0,U.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(),s.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Y=(0,U.useCallback)(e=>{e===D?H(e=>e===`asc`?`desc`:`asc`):(B(e),H(`asc`))},[D]),le=(0,U.useCallback)(e=>{g(t=>t===e?``:e)},[]),X=(0,U.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.model,(t.get(n.model)??0)+1);return[...t.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[e]),Z=(0,U.useMemo)(()=>[...new Set(e.map(e=>e.lifecycleStage))].sort(),[e]),ue=(0,U.useMemo)(()=>[{value:`all`,label:`All stages`},...Z.map(e=>({value:e,label:O(e)}))],[Z]),Q=(0,U.useMemo)(()=>K?X.filter(([e])=>e.toLowerCase().includes(K.toLowerCase())):X,[X,K]),$=(0,U.useMemo)(()=>{let t=e;return _&&(t=t.filter(e=>e.model===_)),S&&(t=t.filter(e=>e.lifecycleStage===S)),i&&(t=t.filter(e=>e.id.toLowerCase().includes(i.toLowerCase())||e.model.toLowerCase().includes(i.toLowerCase()))),c===`faulted`&&(t=t.filter(e=>e.activeFaults.length>0)),c===`quarantined`&&(t=t.filter(e=>e.isQuarantined)),c===`healthy`&&(t=t.filter(e=>e.activeFaults.length===0&&!e.isQuarantined)),se(t,D,V)},[e,i,c,_,S,D,V]),de=c!==``||_!==``||S!==``||i!==``,fe=(0,U.useCallback)(()=>{o(``),g(``),x(``),C(``)},[]);return(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-screen-2xl flex-col gap-5 p-4 sm:gap-6 sm:p-6`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`h2`,{className:`font-heading text-2xl font-semibold tracking-tight`,children:`Fleet Overview`}),t&&(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]}),(0,W.jsx)(oe,{onStatusFilter:le}),(0,W.jsx)(ae,{}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsxs)(M,{value:_||null,onValueChange:e=>x(e??``),onInputValueChange:q,children:[(0,W.jsx)(j,{placeholder:`All models`,className:`h-8 w-48 text-xs`,showClear:!!_}),(0,W.jsx)(A,{children:(0,W.jsxs)(re,{children:[Q.map(([e,t])=>(0,W.jsxs)(ie,{value:e,className:`text-xs`,children:[(0,W.jsx)(`span`,{className:`font-mono`,children:e}),(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,t,`)`]})]},e)),Q.length===0&&(0,W.jsx)(`p`,{className:`py-2 text-center text-xs text-muted-foreground`,children:`No models found`})]})})]}),Z.length>1&&(0,W.jsxs)(h,{value:S||`all`,onValueChange:e=>C(!e||e===`all`?``:e),items:ue,children:[(0,W.jsx)(m,{className:`h-8 w-36 text-xs`,"aria-label":`Lifecycle stage`,children:(0,W.jsx)(u,{placeholder:`All stages`})}),(0,W.jsxs)(p,{alignItemWithTrigger:!1,align:`start`,children:[(0,W.jsx)(d,{value:`all`,children:`All stages`}),Z.map(e=>(0,W.jsx)(d,{value:e,children:O(e)},e))]})]}),(0,W.jsxs)(h,{value:c||`all`,onValueChange:e=>g(!e||e===`all`?``:e),items:I,children:[(0,W.jsx)(m,{className:`h-8 w-32 text-xs`,"aria-label":`Status filter`,children:(0,W.jsx)(u,{placeholder:`All status`})}),(0,W.jsxs)(p,{alignItemWithTrigger:!1,align:`start`,children:[(0,W.jsx)(d,{value:`all`,children:`All status`}),(0,W.jsx)(d,{value:`healthy`,children:`Healthy`}),(0,W.jsx)(d,{value:`faulted`,children:`Faulted`}),(0,W.jsx)(d,{value:`quarantined`,children:`Quarantined`})]})]}),(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(l,{ref:s,placeholder:`Search...`,value:i,onChange:e=>o(e.target.value),className:`h-8 w-40 pr-7 text-xs`}),!i&&(0,W.jsx)(`kbd`,{className:`pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded border border-border bg-muted px-1 font-mono text-[10px] text-muted-foreground`,children:`/`})]}),de&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{type:`button`,onClick:fe,className:`flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,W.jsx)(f,{className:`size-3`}),`Clear`]}),(0,W.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[$.length,` of `,e.length]})]})]}),(0,W.jsx)(ne,{className:`py-0`,children:(0,W.jsx)(te,{className:`p-0 [&_thead_tr_th:last-child]:w-6 [&_thead_tr_th:last-child]:px-1 sm:[&_thead_tr_th:last-child]:w-8 sm:[&_thead_tr_th:last-child]:px-2 [&_tbody_tr_td:last-child]:px-1 sm:[&_tbody_tr_td:last-child]:px-2`,children:(0,W.jsxs)(R,{children:[(0,W.jsx)(z,{children:(0,W.jsxs)(P,{children:[(0,W.jsx)(J,{label:`Instance`,sortKey:`id`,current:D,onSort:Y}),(0,W.jsx)(J,{label:`Model`,sortKey:`model`,current:D,onSort:Y,className:`hidden sm:table-cell`}),(0,W.jsx)(J,{label:`Lifecycle`,sortKey:`lifecycle`,current:D,onSort:Y}),(0,W.jsx)(J,{label:`Operation hours`,sortKey:`hours`,current:D,onSort:Y,className:`hidden text-right md:table-cell`}),(0,W.jsx)(J,{label:`Faults`,sortKey:`faults`,current:D,onSort:Y}),(0,W.jsx)(J,{label:`Status`,sortKey:`status`,current:D,onSort:Y}),(0,W.jsx)(L,{children:(0,W.jsx)(`span`,{className:`sr-only`,children:`Navigate to instance`})})]})}),(0,W.jsxs)(F,{children:[$.map(e=>(0,W.jsxs)(P,{className:`group cursor-pointer transition-colors hover:bg-muted/50`,onMouseEnter:()=>w(`/instance/${e.id}`),onClick:()=>{(0,U.startTransition)(()=>{(0,U.addTransitionType)(T),G(`/instance/${e.id}`)})},children:[(0,W.jsx)(N,{className:`font-mono text-sm`,children:(0,W.jsx)(U.ViewTransition,{name:`instance-${e.id}`,default:`none`,children:(0,W.jsx)(`span`,{children:e.id})})}),(0,W.jsx)(N,{className:`hidden text-sm sm:table-cell`,children:e.model}),(0,W.jsx)(N,{children:(0,W.jsx)(k,{variant:`secondary`,className:`text-xs`,children:e.lifecycleStage})}),(0,W.jsx)(N,{className:`hidden font-mono text-sm md:table-cell`,children:ee(e.operatingHours)}),(0,W.jsx)(N,{children:e.activeFaults.length>0?(0,W.jsx)(k,{variant:`destructive`,className:`text-xs`,children:e.activeFaults.length}):(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})}),(0,W.jsx)(N,{children:e.isQuarantined?(0,W.jsx)(k,{variant:`destructive`,className:`text-xs`,children:`quarantined`}):e.activeFaults.length>0?(0,W.jsx)(k,{variant:`outline`,className:`text-xs text-warning`,children:`faulted`}):(0,W.jsx)(k,{variant:`outline`,className:`text-xs text-success`,children:`healthy`})}),(0,W.jsx)(N,{children:(0,W.jsx)(a,{className:`size-3.5 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100`})})]},e.id)),$.length===0&&(0,W.jsx)(P,{children:(0,W.jsx)(N,{colSpan:7,className:`py-8 text-center text-muted-foreground`,children:e.length===0?n===`live`?`No instances running`:`Loading instances...`:`No matches`})})]})]})})}),(0,W.jsx)(`div`,{className:`flex justify-end`,children:(0,W.jsx)(ce,{})})]})}export{B as i,H as n,V as r,Y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./fleet-CfxbKXt9.js";export{e as FleetPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{it as e,rt as t}from"./vendor-ui-ByahnaY0.js";import{a as n,i as r}from"./input-BWEQFptx.js";var i=n(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function a({className:n,variant:a=`default`,render:o,...s}){return t({defaultTagName:`span`,props:e({className:r(i({variant:a}),n)},s),render:o,state:{slot:`badge`,variant:a}})}function o(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function s(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}var c={degC:`°C`,"m3/h":`m³/h`,"mm/s":`mm/s`,pu:`pu`,"%":`%`};function l(e){return e?c[e]??e:``}function u(e){return Number.isInteger(e)?Math.abs(e)>=1e4?e.toLocaleString(`en-US`):String(e):Math.abs(e)>=100?e.toFixed(1):Math.abs(e)>=1?e.toFixed(2):e.toFixed(3)}function d(e){let t=e.match(/^(.+)-(\d{3,})$/);if(!t)return o(e);let[,n,r]=t;return n?`${o(n)} ${r}`:o(e)}function f(e){return e.join(`/`)}function p(e,t){return`${f(e)}/${t}`}function m(e){let t=Number.isFinite(e)&&e>=0?e:0,n=Math.floor(t),r=Math.round((t-n)*60);return r>=60?`${n+1}h 0m`:r===0?`${n}h`:`${n}h ${r}m`}function h(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);if(r<24)return`${r}h ago`;let i=Math.floor(r/24);return i<30?`${i}d ago`:new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}export{u as a,s as c,i as d,o as i,l,f as n,m as o,d as r,h as s,p as t,a as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-Bwxw859K.js";var t=e(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{at as e}from"./vendor-ui-ByahnaY0.js";import{n as t}from"./query-keys-BvtE7BMs.js";import{i as n,n as r}from"./input-BWEQFptx.js";var i=e();function a({role:e=`status`,"aria-live":t=`polite`,"aria-atomic":a=!0,className:o,eyebrow:s,stamp:c,title:l,children:u,detailLabel:d=`Technical detail`,detail:f,primaryLabel:p,onPrimary:m,primaryIcon:h,primaryDisabled:g,primaryBusy:_,secondaryLabel:v,onSecondary:y}){return(0,i.jsxs)(`div`,{role:e,"aria-live":t,"aria-atomic":a,className:n(`relative overflow-hidden rounded-2xl border border-primary/15 bg-[linear-gradient(180deg,rgba(24,24,27,0.55),rgba(10,10,11,0.85))] shadow-[0_0_0_1px_rgba(229,162,24,0.06),0_16px_48px_rgba(0,0,0,0.35)]`,o),children:[(0,i.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 bg-[linear-gradient(rgba(63,63,70,0.2)_1px,transparent_1px),linear-gradient(90deg,rgba(63,63,70,0.2)_1px,transparent_1px)] bg-size-[24px_24px] opacity-35`}),(0,i.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-0 right-0 w-2/3 max-w-sm bg-[radial-gradient(circle_at_80%_20%,rgba(229,162,24,0.12),transparent_55%)]`}),(0,i.jsx)(`div`,{className:`blueprint-card relative border border-primary/20 bg-[linear-gradient(135deg,rgba(24,24,27,0.88),rgba(39,39,42,0.82))] p-5 shadow-[inset_0_1px_0_rgba(255,255,255,0.04)] sm:p-6`,children:(0,i.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[(0,i.jsxs)(`div`,{className:`space-y-3`,children:[(0,i.jsx)(`p`,{className:`font-mono text-[0.65rem] uppercase tracking-[0.38em] text-muted-foreground`,children:s}),(0,i.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,i.jsx)(`span`,{className:`font-heading text-3xl font-black leading-none tracking-[-0.06em] text-transparent [-webkit-text-stroke:1px_rgba(229,162,24,0.5)] sm:text-4xl`,"aria-hidden":!0,children:c}),(0,i.jsx)(`div`,{className:`mb-1.5 h-px min-w-8 flex-1 bg-linear-to-r from-primary/55 to-transparent`})]}),(0,i.jsx)(`h2`,{className:`text-lg font-semibold tracking-[-0.03em] text-foreground sm:text-xl`,children:l}),u?(0,i.jsx)(`div`,{className:`space-y-2 text-sm leading-relaxed text-muted-foreground`,children:u}):null]}),(0,i.jsxs)(`div`,{className:`rounded-xl border border-border/80 bg-black/35 p-4 backdrop-blur-sm`,children:[(0,i.jsx)(`div`,{className:`mb-2 font-mono text-[0.65rem] uppercase tracking-[0.28em] text-muted-foreground`,children:d}),(0,i.jsx)(`p`,{className:`wrap-break-word font-mono text-sm leading-relaxed text-primary`,children:f})]}),(0,i.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[(0,i.jsxs)(r,{type:`button`,onClick:m,disabled:!!(g||_),"aria-busy":_,className:n(`inline-flex w-full items-center justify-center gap-2 rounded-xl border border-primary/35 bg-primary px-4 py-2.5 font-medium text-primary-foreground shadow-none transition hover:brightness-110 sm:w-auto`,_&&`pointer-events-none opacity-90`),children:[h,p]}),v&&y?(0,i.jsx)(r,{type:`button`,variant:`ghost`,size:`sm`,className:`sm:self-center`,onClick:y,children:v}):null]})]})})]})}function o({message:e,onRetry:r,isRetrying:o}){return(0,i.jsxs)(a,{role:`alert`,eyebrow:`Data link fault`,stamp:`ERR`,title:`Couldn't reach Miravo`,detail:e,primaryLabel:`Retry request`,onPrimary:r,primaryBusy:!!o,primaryIcon:(0,i.jsx)(t,{className:n(`size-4 shrink-0`,o&&`animate-spin`),"aria-hidden":!0}),children:[(0,i.jsxs)(`p`,{children:[(0,i.jsx)(`span`,{className:`text-foreground`,children:`Most often:`}),` the Miravo admin server isn't running, or this browser can't reach it (wrong host, port, or firewall).`]}),(0,i.jsx)(`p`,{children:`Start or restart Miravo if needed, use the correct link to the Miravo Console, then try again.`})]})}function s(e,t){return e instanceof Error&&e.message.trim().length>0?e.message:typeof e==`string`&&e.trim().length>0?e:t}export{o as n,a as r,s as t};
|