@synnaxlabs/pluto 0.34.1 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Animated-CnvOerW9.js → Animated-C7JTBH0T.js} +6 -6
- package/dist/{Animated-Ck87AGOu.cjs → Animated-D4IT49PS.cjs} +1 -1
- package/dist/{Item--wCat2DH.js → Item-4yG7GmwK.js} +23 -23
- package/dist/{Item-DuNQFmgk.cjs → Item-DuYEON-n.cjs} +1 -1
- package/dist/{Keyboard-DPs95Etp.cjs → Keyboard-BPoxRive.cjs} +1 -1
- package/dist/{Keyboard-Dh_Fhwg4.js → Keyboard-Csje8Cyn.js} +2 -2
- package/dist/LinePlot-DbXPZbQH.cjs +34 -0
- package/dist/{LinePlot-DN8KOMtR.js → LinePlot-DqoSTxNs.js} +2630 -2365
- package/dist/{Link-BHtl4aby.cjs → Link-BRv9hhIc.cjs} +1 -1
- package/dist/{Link-CDG2-g6A.js → Link-Crud0q_J.js} +1 -1
- package/dist/{List-BjimX8fM.js → List-Cuz80sgI.js} +6 -6
- package/dist/{List-C8vXIE2j.cjs → List-Pyj0u9YT.cjs} +1 -1
- package/dist/{Pack-D6eMgf33.js → Pack-BzCJQZ58.js} +1 -1
- package/dist/{Pack-DijAGcm_.cjs → Pack-Dvf8sQVK.cjs} +1 -1
- package/dist/Text-BJ2Pml4B.cjs +1 -0
- package/dist/{Text-CzgVM_22.js → Text-DMMYBs-R.js} +12 -12
- package/dist/{Toggle-Cdu7WaiC.js → Toggle-CLkPIiQK.js} +10438 -10080
- package/dist/Toggle-DnW_7Wr_.cjs +143 -0
- package/dist/{Video-DYSz9XOF.js → Video-BGyV37o3.js} +1 -1
- package/dist/{Video-BgDjKMJx.cjs → Video-CGe5Hscl.cjs} +1 -1
- package/dist/{aggregator-DzdAnRwI.js → aggregator-23mu0FOF.js} +2322 -2177
- package/dist/aggregator-y-jNJhKX.cjs +67 -0
- package/dist/align.cjs +1 -1
- package/dist/align.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/css-BghghSL0.cjs +1 -0
- package/dist/css-DJCM-h5_.js +1178 -0
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +75 -62
- package/dist/{external-k3Jbrj0m.js → external-0a9KHHwz.js} +13 -13
- package/dist/external-3DAfrFCZ.cjs +1 -0
- package/dist/{external-eI1p10Vf.cjs → external-B7Vpq1ol.cjs} +1 -1
- package/dist/{external-DRHWURjA.cjs → external-BV_9eXZJ.cjs} +1 -1
- package/dist/{external-lgZ2Gmbx.js → external-BZwFy-XX.js} +16 -16
- package/dist/{external-CoQwrjWl.js → external-CIH3tMhP.js} +29 -29
- package/dist/{external-BOIjtEGO.js → external-Cf5a9Ia8.js} +2 -2
- package/dist/{external-FVIwMFDr.js → external-CgpiH-10.js} +102 -102
- package/dist/{external-B_-ZrYaG.js → external-Cgq0p0a8.js} +42 -42
- package/dist/{external-D9Q5Xjko.js → external-Ci-UP3Vu.js} +2 -2
- package/dist/external-CqLAQBcO.cjs +1 -0
- package/dist/{external-Cc9o20Al.cjs → external-Ctvxtwfh.cjs} +1 -1
- package/dist/{external-CAIE4G3V.cjs → external-D-PsJ1E5.cjs} +1 -1
- package/dist/external-D7FmaiqY.js +248 -0
- package/dist/{external-DvRQ7lJU.js → external-DAbicix6.js} +2 -2
- package/dist/external-DVF3ZJ4z.js +32 -0
- package/dist/external-De9tKPlO.js +76 -0
- package/dist/{external-CYsmC4uZ.cjs → external-Dk1cXh1i.cjs} +1 -1
- package/dist/{external-mtlL4Z3a.cjs → external-DtnrBHvV.cjs} +1 -1
- package/dist/{external-DVlGiTKE.cjs → external-ZxIaRZdb.cjs} +1 -1
- package/dist/{external-BbS4QDTb.cjs → external-iiNZw96o.cjs} +1 -1
- package/dist/{external-DsKRFJxV.cjs → external-t43feeRt.cjs} +1 -1
- package/dist/{external-mE-a2ecU.js → external-xhGCeglf.js} +1 -1
- package/dist/{external-CjmMj11F.cjs → external-xtDHiIUX.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +7345 -7029
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/src/breadcrumb/Breadcrumb.d.ts +10 -2
- package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/src/button/Button.d.ts +2 -0
- package/dist/src/button/Button.d.ts.map +1 -1
- package/dist/src/button/Icon.d.ts +2 -0
- package/dist/src/button/Icon.d.ts.map +1 -1
- package/dist/src/color/GradientPicker.d.ts +10 -0
- package/dist/src/color/GradientPicker.d.ts.map +1 -0
- package/dist/src/color/Picker.d.ts +9 -0
- package/dist/src/color/Picker.d.ts.map +1 -0
- package/dist/src/color/Provider.d.ts +139 -0
- package/dist/src/color/Provider.d.ts.map +1 -0
- package/dist/src/color/Swatch.d.ts +13 -0
- package/dist/src/color/Swatch.d.ts.map +1 -0
- package/dist/src/color/core/external.d.ts +4 -0
- package/dist/src/color/core/external.d.ts.map +1 -0
- package/dist/src/color/core/gradient.d.ts +58 -0
- package/dist/src/color/core/gradient.d.ts.map +1 -0
- package/dist/src/color/core/index.d.ts +1 -2
- package/dist/src/color/core/index.d.ts.map +1 -1
- package/dist/src/color/core/palette.d.ts +74 -0
- package/dist/src/color/core/palette.d.ts.map +1 -0
- package/dist/src/color/external.d.ts +4 -1
- package/dist/src/color/external.d.ts.map +1 -1
- package/dist/src/haul/Haul.d.ts +0 -1
- package/dist/src/haul/Haul.d.ts.map +1 -1
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/useDelayedState.d.ts +11 -0
- package/dist/src/hooks/useDelayedState.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/nav/Drawer.d.ts.map +1 -1
- package/dist/src/notation/Select.d.ts +8 -0
- package/dist/src/notation/Select.d.ts.map +1 -0
- package/dist/src/notation/external.d.ts +3 -0
- package/dist/src/notation/external.d.ts.map +1 -0
- package/dist/src/notation/index.d.ts +2 -0
- package/dist/src/notation/index.d.ts.map +1 -0
- package/dist/src/notation/notation.d.ts.map +1 -1
- package/dist/src/pluto/Pluto.d.ts +3 -1
- package/dist/src/pluto/Pluto.d.ts.map +1 -1
- package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
- package/dist/src/select/Button.d.ts +5 -3
- package/dist/src/select/Button.d.ts.map +1 -1
- package/dist/src/select/Direction.d.ts +2 -1
- package/dist/src/select/Direction.d.ts.map +1 -1
- package/dist/src/select/Single.d.ts +1 -1
- package/dist/src/select/Single.d.ts.map +1 -1
- package/dist/src/status/Circle.d.ts +1 -1
- package/dist/src/status/Circle.d.ts.map +1 -1
- package/dist/src/table/Table.d.ts +30 -0
- package/dist/src/table/Table.d.ts.map +1 -0
- package/dist/src/table/aether/Table.d.ts +493 -0
- package/dist/src/table/aether/Table.d.ts.map +1 -0
- package/dist/src/table/aether/index.d.ts +2 -0
- package/dist/src/table/aether/index.d.ts.map +1 -0
- package/dist/src/table/cells/Cells.d.ts +191 -0
- package/dist/src/table/cells/Cells.d.ts.map +1 -0
- package/dist/src/table/cells/Forms.d.ts +7 -0
- package/dist/src/table/cells/Forms.d.ts.map +1 -0
- package/dist/src/table/cells/index.d.ts +2 -0
- package/dist/src/table/cells/index.d.ts.map +1 -0
- package/dist/src/table/cells/registry.d.ts +17 -0
- package/dist/src/table/cells/registry.d.ts.map +1 -0
- package/dist/src/table/external.d.ts +2 -0
- package/dist/src/table/external.d.ts.map +1 -0
- package/dist/src/table/index.d.ts +2 -0
- package/dist/src/table/index.d.ts.map +1 -0
- package/dist/src/telem/aether/pipeline.d.ts +35 -24
- package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
- package/dist/src/telem/aether/provider.d.ts +7 -6
- package/dist/src/telem/aether/provider.d.ts.map +1 -1
- package/dist/src/telem/aether/static.d.ts +22 -1
- package/dist/src/telem/aether/static.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.d.ts +217 -2
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/text/Editable.d.ts +2 -1
- package/dist/src/text/Editable.d.ts.map +1 -1
- package/dist/src/text/Select.d.ts +19 -0
- package/dist/src/text/Select.d.ts.map +1 -0
- package/dist/src/text/core/types.d.ts +2 -1
- package/dist/src/text/core/types.d.ts.map +1 -1
- package/dist/src/text/external.d.ts +1 -1
- package/dist/src/text/external.d.ts.map +1 -1
- package/dist/src/theming/Provider.d.ts.map +1 -1
- package/dist/src/theming/aether/provider.d.ts +375 -0
- package/dist/src/theming/aether/provider.d.ts.map +1 -1
- package/dist/src/theming/core/theme.d.ts +127 -0
- package/dist/src/theming/core/theme.d.ts.map +1 -1
- package/dist/src/vis/axis/canvas.d.ts +11 -0
- package/dist/src/vis/axis/canvas.d.ts.map +1 -1
- package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts +2 -1
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/types.d.ts +17 -0
- package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/Edge.d.ts +3 -2
- package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/paths.d.ts +20 -0
- package/dist/src/vis/diagram/edge/paths.d.ts.map +1 -0
- package/dist/src/vis/diagram/external.d.ts +1 -0
- package/dist/src/vis/diagram/external.d.ts.map +1 -1
- package/dist/src/vis/draw2d/canvas.d.ts +19 -0
- package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
- package/dist/src/vis/legend/Container.d.ts.map +1 -1
- package/dist/src/vis/line/aether/line.d.ts.map +1 -1
- package/dist/src/vis/render/context.d.ts.map +1 -1
- package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
- package/dist/src/vis/schematic/Grid.d.ts +16 -0
- package/dist/src/vis/schematic/Grid.d.ts.map +1 -0
- package/dist/src/vis/schematic/Symbols.d.ts +247 -415
- package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
- package/dist/src/vis/schematic/primitives/Primitives.d.ts +4 -0
- package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
- package/dist/src/vis/schematic/registry.d.ts +2 -2
- package/dist/src/vis/schematic/registry.d.ts.map +1 -1
- package/dist/src/vis/value/Form.d.ts +9 -0
- package/dist/src/vis/value/Form.d.ts.map +1 -0
- package/dist/src/vis/value/aether/value.d.ts +167 -0
- package/dist/src/vis/value/aether/value.d.ts.map +1 -1
- package/dist/src/vis/value/external.d.ts +1 -0
- package/dist/src/vis/value/external.d.ts.map +1 -1
- package/dist/src/vis/value/use.d.ts +56 -1
- package/dist/src/vis/value/use.d.ts.map +1 -1
- package/dist/src/workMain.d.ts +2 -0
- package/dist/src/workMain.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/{units-CR-P9eLW.cjs → units-9h1yAbxY.cjs} +1 -1
- package/dist/{units-rb5QAWjs.js → units-D19WggGS.js} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +7 -6
- package/dist/LinePlot-44K5K51b.cjs +0 -34
- package/dist/Text-Cg0q7seY.cjs +0 -1
- package/dist/Toggle-CP9KtybX.cjs +0 -143
- package/dist/aggregator-C0Ab25_o.cjs +0 -67
- package/dist/css-B4FcyECk.js +0 -1112
- package/dist/css-Dh7n0EGs.cjs +0 -1
- package/dist/external-B72rRj4o.js +0 -76
- package/dist/external-CsqyDUsJ.js +0 -96
- package/dist/external-Dm2-owlq.cjs +0 -1
- package/dist/external-Yf8Lv9AU.js +0 -248
- package/dist/external-gz4sf3pG.cjs +0 -1
- package/dist/src/color/Picker/Picker.d.ts +0 -7
- package/dist/src/color/Picker/Picker.d.ts.map +0 -1
- package/dist/src/color/Picker/index.d.ts +0 -2
- package/dist/src/color/Picker/index.d.ts.map +0 -1
- package/dist/src/color/Swatch/Swatch.d.ts +0 -10
- package/dist/src/color/Swatch/Swatch.d.ts.map +0 -1
- package/dist/src/color/Swatch/index.d.ts +0 -2
- package/dist/src/color/Swatch/index.d.ts.map +0 -1
- package/dist/src/notation/SelectNotation.d.ts +0 -12
- package/dist/src/notation/SelectNotation.d.ts.map +0 -1
- package/dist/src/text/SelectLevel.d.ts +0 -12
- package/dist/src/text/SelectLevel.d.ts.map +0 -1
- package/dist/src/vis/schematic/Labeled.d.ts +0 -17
- package/dist/src/vis/schematic/Labeled.d.ts.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Af=Object.defineProperty;var $f=(e,t,n)=>t in e?Af(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>$f(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-Cek9Ww4S.cjs"),g=require("react"),j=require("./Toggle-CP9KtybX.cjs"),f=require("./css-Dh7n0EGs.cjs"),kn=require("./external-mtlL4Z3a.cjs"),Z=require("./aggregator-C0Ab25_o.cjs"),te=require("./Pack-DijAGcm_.cjs"),If=require("./external-CYsmC4uZ.cjs"),Ce=require("./external-CAIE4G3V.cjs"),Of=require("./external-DRHWURjA.cjs"),Ti=require("./Animated-Ck87AGOu.cjs"),$=require("./LinePlot-44K5K51b.cjs"),ue=require("zod"),wo=require("./external-gz4sf3pG.cjs"),Pe=require("./external-Dm2-owlq.cjs"),Bf=require("./Text-Cg0q7seY.cjs"),Ai=require("./external-eI1p10Vf.cjs");require("./Item-DuNQFmgk.cjs");const Co=require("react-dom"),$t=require("./external-Cc9o20Al.cjs"),$i=require("./units-CR-P9eLW.cjs"),$e=require("./external-DsKRFJxV.cjs"),Df=require("./external-BbS4QDTb.cjs"),zf=require("./external-CjmMj11F.cjs"),Vf=require("./external-DVlGiTKE.cjs"),Ff=require("./Video-BgDjKMJx.cjs"),Ii=({variant:e,...t})=>i.jsxRuntimeExports.jsx(j.Qt.Circle,{color:j.variantColors[e],style:{color:j.variantColors[e]},...t}),Hf=({status:{key:e,time:t,count:n,message:s,description:o,variant:r},silence:l,actions:c,className:a,children:u,...d})=>i.jsxRuntimeExports.jsxs(te.Space,{className:f.CSS(f.CSS.B("notification"),a),direction:"y",empty:!0,...d,children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(Ii,{style:{height:"2.25rem",width:"2.5rem"},variant:r}),i.jsxRuntimeExports.jsx(j.Text,{level:"small",shade:7,children:`x${n}`}),i.jsxRuntimeExports.jsx(j.DateTime,{className:f.CSS(f.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),i.jsxRuntimeExports.jsx(j.Icon,{className:f.CSS(f.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:i.jsxRuntimeExports.jsx(j.Qt.Close,{})})]}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",align:"start",className:f.CSS(f.CSS.BE("notification","content")),size:"small",children:[u??i.jsxRuntimeExports.jsx(j.Text,{className:f.CSS(f.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),o!=null&&i.jsxRuntimeExports.jsx(j.Text,{className:f.CSS(f.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),c!=null&&i.jsxRuntimeExports.jsx(te.Space,{direction:"x",align:"center",justify:"end",className:f.CSS(f.CSS.BE("notification","actions")),children:Z.A(c).map(x=>i.jsxRuntimeExports.jsx(Zf,{action:x},x.key))})]},t.toString()),Zf=({action:e})=>{if(!g.isValidElement(e)){const t=e;return i.jsxRuntimeExports.jsx(j.Button,{...t})}return e},Yf=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:j.Aggregator,Circle:Ii,Notification:Hf,Text:j.Text$2,VARIANTS:Z.VARIANTS,specZ:Z.specZ$1,useAggregator:j.useAggregator,useContext:j.useContext$2,useNotifications:j.useNotifications,variantZ:Z.variantZ},Symbol.toStringTag,{value:"Module"})),qf=Object.freeze(Object.defineProperty({__proto__:null,Config:j.Config,Context:j.Context,Dialog:j.Dialog$1,chooseLocation:j.chooseLocation,formatTip:j.formatTip,useConfig:j.useConfig,wrap:j.wrap},Symbol.toStringTag,{value:"Module"})),On=e=>e.preventDefault(),ss=g.forwardRef(({location:e,style:t,size:n,className:s,children:o,onDragStart:r,sizeUnits:l="px",showHandle:c=!0,...a},u)=>{const d=f.J.construct(e),x=f.J.direction(d),p=f.g.dimension(x);return i.jsxRuntimeExports.jsxs("div",{className:f.CSS(f.CSS.B("resize"),f.CSS.loc(d),f.CSS.dir(x),s),style:{[p]:`${n}${l}`,...t},ref:u,...a,children:[o,c&&i.jsxRuntimeExports.jsx("div",{draggable:!0,className:f.CSS(f.CSS.BE("resize","handle"),f.CSS.bordered(f.J.swap(d))),onDragStart:r,onDrag:On,onDragEnd:On})]})});ss.displayName="Resize.Core";const vo=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:o="x"})=>{const r=g.useRef(null),[l,c]=g.useState({sizeDistribution:Wf(n,t),root:null}),a=g.useCallback((x,p,m)=>{if(r.current==null)return;const h=f.Eo.dim(f.Eo.construct(r.current),o);c(E=>$s(E,h,x,s,p,m))},[s,c,o]);g.useEffect(()=>e==null?void 0:e(l.sizeDistribution),[l.sizeDistribution,e]);const u=g.useCallback((x,p)=>{x.preventDefault();const m=o==="x"?"clientX":"clientY",h=v=>a(p,v[m]),E=()=>{c(v=>({...v,root:null})),document.removeEventListener("mousemove",h)};c(v=>({...v,root:x[m]})),document.addEventListener("mousemove",h),document.addEventListener("mouseup",E,{once:!0})},[c,o,$s]);return{setSize:g.useCallback((x,p)=>a(x,void 0,p),[$s]),props:{direction:o,sizeDistribution:l.sizeDistribution,onDragHandle:u,ref:r}}},os=g.forwardRef(({direction:e="x",children:t,sizeDistribution:n,onDragHandle:s,className:o,...r},l)=>{const c=f.g.construct(e),a=g.Children.toArray(t);return n=Xf(n),i.jsxRuntimeExports.jsx(te.Space,{...r,ref:l,direction:c,className:f.CSS(f.CSS.B("resize-multiple"),o),empty:!0,grow:!0,children:a.map((u,d)=>i.jsxRuntimeExports.jsx(ss,{onDragStart:x=>s(x,d),location:f.g.location(c),size:n[d]*100,sizeUnits:"%",showHandle:d!==a.length-1,children:u},d))})});os.displayName="Resize.Multiple";const Wf=(e,t)=>{const n=e.reduce((o,r)=>o+r,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(o=>o/n);if(e.every(o=>o<=1)){const o=1-n;return[...e,...Array(s).fill(o/s)]}return e.map(()=>1/t)},As=.001,Xf=e=>e.every(t=>f.W.closeTo(t,1/e.length),As)?e.map((t,n)=>n%2===0?t+As:n===e.length-1?t:t-As):e,$s=(e,t,n,s,o,r)=>{const l=Oi(e,t,n,o,r),[c,a]=Kf(e.sizeDistribution,n,l,s/t),u=a?o??null:e.root;return{...e,sizeDistribution:c,root:u}},Oi=(e,t,n,s,o)=>{let r;if(o!=null)o>1&&(o/=t),r=o-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");r=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return r},Kf=(e,t,n,s)=>{let o=t;for(;o>0&&e[o]+n<=s;)o--;const r=e[o]+n,l=Gf(o,e,s,n),c=e[l]-n;return r<s||c<s?[e,!1]:[e.map((a,u)=>u===o?r:u===l?c:a),!0]},Gf=(e,t,n,s)=>(e===t.length-1?Qf:Uf)(e,t,n,s),Uf=(e,t,n,s)=>{let o=e+1;for(;o<t.length-1&&t[o]-s<=n;)o++;return o},Qf=(e,t,n,s)=>{let o=e-1;for(;o>0&&t[o]-s<=n;)o--;return o},rs=({onMove:e,onStart:t,onEnd:n})=>g.useCallback(s=>{s.preventDefault();const o=f.q.construct(s),r=j.mouseKey(s.button);t==null||t(o,r,s);const l=a=>{if(a.buttons===0)return c(a);const u=f.q.construct(a);e==null||e(f.Eo.construct(o,u),r,a)};window.addEventListener("mousemove",l);const c=a=>{window.removeEventListener("mousemove",l);const u=f.q.construct(a);n==null||n(f.Eo.construct(o,u),r,a)};window.addEventListener("mouseup",c,{once:!0})},[e,t,n]),Is=2,Bi=({onCollapse:e,onResize:t,location:n="left",minSize:s=100,maxSize:o=1/0,initialSize:r=200,collapseThreshold:l=1/0,className:c,...a})=>{const[u,d]=g.useState(f.j(r,s,o)),x=g.useRef(null),p=f.J.construct(n),m=g.useCallback(S=>{if(x.current===null)return 0;const y=f.Eo.dim(S,f.J.direction(p),!0)*(1-2*Number(["bottom","right"].includes(p))),C=x.current+y,P=f.j(C,s,o);return(P-C)/s>l?Is:P},[p,s,o,l]),h=g.useRef(null),E=g.useCallback(S=>{const y=m(S);d(y),h.current!=null&&(t==null||t(y,f.Eo.construct(h.current)))},[t,m]),v=g.useCallback(()=>d(S=>(x.current=S,S)),[d]),w=g.useCallback(S=>m(S)===Is&&(e==null?void 0:e()),[e,m]);g.useEffect(()=>d(S=>{const y=f.j(S,s,o);return x.current=y,y}),[s,o]);const _=rs({onMove:E,onStart:v,onEnd:w});return i.jsxRuntimeExports.jsx(ss,{ref:h,location:p,size:u,onDragStart:_,className:f.clsx(c,f.CSS.expanded(u!==Is)),...a})},Jf=Object.freeze(Object.defineProperty({__proto__:null,Core:ss,Multiple:os,Single:Bi,calculateDiffPercentage:Oi,useMultiple:vo},Symbol.toStringTag,{value:"Module"})),Pn="y",gr=28,ep=32,tp=40,np=.5,sp=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:o,...r}}=vo({direction:Pn,count:e.length,minSize:gr}),l=c=>{if(o.current==null)return;const a=f.Eo.dim(f.Eo.construct(o.current),Pn);s[c]<tp/a?n(c,e[c].initialSize??np):n(c,gr+1)};return i.jsxRuntimeExports.jsx(os,{empty:!0,className:f.CSS.B("accordion"),sizeDistribution:s,ref:o,...t,...r,children:e.map((c,a)=>g.createElement(ip,{...c,key:c.key,index:a,direction:Pn,onExpand:l,parent:o,size:s[a]}))})},op=i.jsxRuntimeExports.jsx(j.Qt.Caret.Down,{"aria-label":"contract"}),rp=i.jsxRuntimeExports.jsx(j.Qt.Caret.Right,{"aria-label":"expand"}),ip=({index:e,name:t,content:n,actions:s,size:o,parent:r,onExpand:l})=>{let c=!0;if(r.current!=null){const u=f.Eo.dim(f.Eo.construct(r.current),Pn);c=o*u>ep}const a=c?op:rp;return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs(kn.Header,{level:"p",className:f.CSS.expanded(c),empty:!0,children:[i.jsxRuntimeExports.jsx(kn.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&i.jsxRuntimeExports.jsx(kn.Actions,{children:s})]}),n]})},lp=Object.freeze(Object.defineProperty({__proto__:null,Accordion:sp},Symbol.toStringTag,{value:"Module"})),Di=(e,t,n)=>Z.A(e).map(r=>r.split(t)).flat().map((r,l)=>[i.jsxRuntimeExports.jsx(j.Qt.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:f.CSS.shade(n)}},`${r}-${l}`),r]).flat(),cp=({children:e,icon:t,shade:n=7,weight:s=450,size:o=.5,url:r,level:l="p",separator:c=".",className:a,hideFirst:u=!1,...d})=>{r!=null&&(e=r);const x=Di(e,c,n);return u&&x.shift(),i.jsxRuntimeExports.jsxs(j.WithIcon,{className:f.CSS(a,f.CSS.B("breadcrumb")),level:l,shade:n,weight:s,size:o,...d,children:[Ce.resolve(t),...x]})},ap=({url:e,className:t,level:n="p",separator:s=".",shade:o=7})=>{const r=Di(e,s,o);return i.jsxRuntimeExports.jsx(te.Space,{className:f.CSS(t,f.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:r.map((l,c)=>{if(j.isValidElement(l))return l;if(l==null)return null;const u=e.split(s).indexOf(l);let d=e.split(s).slice(0,u+1).join("/");return d=`/${d}`,i.jsxRuntimeExports.jsx(j.Link,{level:n,href:d,children:l.split("-").map(x=>f._$1.capitalize(x)).join(" ")},c)})})},up=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:cp,URL:ap},Symbol.toStringTag,{value:"Module"})),bo=g.createContext($.ZERO_CONTEXT_VALUE),De=()=>g.useContext(bo).synnax,dp=()=>g.useContext(bo).state,jr={connected:"success",connecting:"info",disconnected:"info",failed:"error"},zi="serverVersionMismatch",xp=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Vi=j.wrap$1($.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[s,o,r]=j.useCombinedStateAndRef($.ZERO_CONTEXT_VALUE),[{path:l},,c]=j.use$3({aetherKey:e,type:$.Provider.TYPE,schema:$.Provider.stateZ,initialState:{props:t??null,state:null}}),a=j.useAggregator(),u=g.useCallback(d=>{r.current.state.status!==d.status&&a({variant:jr[d.status],message:d.message??f._$1.capitalize(d.status)}),o(x=>({...x,state:d}))},[a]);return j.useAsyncEffect(async()=>{if(s.synnax!=null&&s.synnax.close(),t==null)return o($.ZERO_CONTEXT_VALUE);const d=new Z.Lf({...t,connectivityPollFrequency:Z.k.seconds(5)});o({synnax:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(o({synnax:d,state:x}),a({variant:jr[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||Z.H.semVerOlder(x.nodeVersion,x.clientVersion),m=xp(p,x.clientVersion,x.nodeVersion);a({variant:"warning",message:"Incompatible cluster version",description:m,data:{type:zi,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(u),c({props:t,state:x}),()=>{d.close(),o($.ZERO_CONTEXT_VALUE),c({props:null,state:null})}},[t,u]),i.jsxRuntimeExports.jsx(bo.Provider,{value:s,children:i.jsxRuntimeExports.jsx(j.Composite,{path:l,children:n})})}),fp=Object.freeze(Object.defineProperty({__proto__:null,Provider:Vi,SERVER_VERSION_MISMATCH:zi,use:De,useConnectionState:dp},Symbol.toStringTag,{value:"Module"})),It=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),Fi=()=>g.useContext(It),Hi=e=>{const{aliases:t}=g.useContext(It);return t[e]??null},is=()=>{const{aliases:e}=g.useContext(It);return e},ls=(e,t="")=>{const{getName:n}=g.useContext(It),[s,o]=g.useState(t);return j.useAsyncEffect(async()=>{const r=await n(e);r!=null&&o(r)},[e,n]),s??t},_o=()=>{const{activeRange:e}=g.useContext(It);return e??void 0},Zi=({activeRange:e,children:t})=>{const n=De(),[s,o]=g.useState({}),r=g.useCallback(a=>{o(u=>{const d={...u};return a.forEach(({variant:x,key:p,value:m})=>{const h=Number(p.split("---")[1]);x==="delete"?delete d[h]:d[m.channel]=m.alias}),d})},[o]),l=g.useCallback(async(a,u)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(a,u)},[n,e]),c=g.useCallback(async a=>{if(n==null||a===0)return;const u=s[a];return u??(await n.channels.retrieve(a)).name},[s,n]);return j.useAsyncEffect(async()=>{if(n==null||e==null){o({});return}const a=await n.ranges.retrieve(e),u=await a.listAliases();o(u);const d=await a.openAliasTracker(),x=d.onChange(r);return()=>{x(),d.close()}},[n,e]),i.jsxRuntimeExports.jsx(It.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},pp=({channelKey:e,value:t,shadow:n,className:s,...o})=>{const[r,l]=g.useState(!1),{setAlias:c}=Fi(),a=Hi(e),u=ls(e);let d=i.jsxRuntimeExports.jsx(j.Qt.Rename,{});r?d=i.jsxRuntimeExports.jsx(j.Qt.Loading,{}):a===t&&(d=i.jsxRuntimeExports.jsx(j.Qt.Check,{}));const x=c!=null&&!r&&a!==t&&e!==0,p=()=>{x&&(async()=>(l(!0),await c(e,t),l(!1)))()},m=()=>{var E;a!=null&&((E=o.onChange)==null||E.call(o,a))},h=()=>e===0?i.jsxRuntimeExports.jsx(j.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?i.jsxRuntimeExports.jsx(j.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?i.jsxRuntimeExports.jsx(j.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?i.jsxRuntimeExports.jsx(j.Text,{level:"small",children:"Alias synced with this label"}):i.jsxRuntimeExports.jsxs(j.Text,{level:"small",children:["Sync alias for ",u," with this label"]});return i.jsxRuntimeExports.jsxs(j.Text$1,{value:t,...o,children:[x&&i.jsxRuntimeExports.jsx(j.Icon,{onClick:m,tooltip:i.jsxRuntimeExports.jsxs(j.Text,{level:"small",children:["Set ",u," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:i.jsxRuntimeExports.jsx(j.Qt.Sync,{})}),i.jsxRuntimeExports.jsx(j.Icon,{onClick:p,disabled:!x,tooltip:i.jsxRuntimeExports.jsx(h,{}),tooltipLocation:{y:"top"},variant:"outlined",children:d})]})},He="channel";var Er=180/Math.PI,Qs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yi(e,t,n,s,o,r){var l,c,a;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(a=e*n+t*s)&&(n-=e*a,s-=t*a),(c=Math.sqrt(n*n+s*s))&&(n/=c,s/=c,a/=c),e*s<t*n&&(e=-e,t=-t,a=-a,l=-l),{translateX:o,translateY:r,rotate:Math.atan2(t,e)*Er,skewX:Math.atan(a)*Er,scaleX:l,scaleY:c}}var En;function mp(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qs:Yi(t.a,t.b,t.c,t.d,t.e,t.f)}function hp(e){return e==null||(En||(En=document.createElementNS("http://www.w3.org/2000/svg","g")),En.setAttribute("transform",e),!(e=En.transform.baseVal.consolidate()))?Qs:(e=e.matrix,Yi(e.a,e.b,e.c,e.d,e.e,e.f))}function qi(e,t,n,s){function o(u){return u.length?u.pop()+" ":""}function r(u,d,x,p,m,h){if(u!==x||d!==p){var E=m.push("translate(",null,t,null,n);h.push({i:E-4,x:$.interpolateNumber(u,x)},{i:E-2,x:$.interpolateNumber(d,p)})}else(x||p)&&m.push("translate("+x+t+p+n)}function l(u,d,x,p){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),p.push({i:x.push(o(x)+"rotate(",null,s)-2,x:$.interpolateNumber(u,d)})):d&&x.push(o(x)+"rotate("+d+s)}function c(u,d,x,p){u!==d?p.push({i:x.push(o(x)+"skewX(",null,s)-2,x:$.interpolateNumber(u,d)}):d&&x.push(o(x)+"skewX("+d+s)}function a(u,d,x,p,m,h){if(u!==x||d!==p){var E=m.push(o(m)+"scale(",null,",",null,")");h.push({i:E-4,x:$.interpolateNumber(u,x)},{i:E-2,x:$.interpolateNumber(d,p)})}else(x!==1||p!==1)&&m.push(o(m)+"scale("+x+","+p+")")}return function(u,d){var x=[],p=[];return u=e(u),d=e(d),r(u.translateX,u.translateY,d.translateX,d.translateY,x,p),l(u.rotate,d.rotate,x,p),c(u.skewX,d.skewX,x,p),a(u.scaleX,u.scaleY,d.scaleX,d.scaleY,x,p),u=d=null,function(m){for(var h=-1,E=p.length,v;++h<E;)x[(v=p[h]).i]=v.x(m);return x.join("")}}}var gp=qi(mp,"px, ","px)","deg)"),jp=qi(hp,", ",")",")"),Ep=1e-12;function yr(e){return((e=Math.exp(e))+1/e)/2}function yp(e){return((e=Math.exp(e))-1/e)/2}function Sp(e){return((e=Math.exp(2*e))-1)/(e+1)}const Rp=function e(t,n,s){function o(r,l){var c=r[0],a=r[1],u=r[2],d=l[0],x=l[1],p=l[2],m=d-c,h=x-a,E=m*m+h*h,v,w;if(E<Ep)w=Math.log(p/u)/t,v=function(b){return[c+b*m,a+b*h,u*Math.exp(t*b*w)]};else{var _=Math.sqrt(E),S=(p*p-u*u+s*E)/(2*u*n*_),y=(p*p-u*u-s*E)/(2*p*n*_),C=Math.log(Math.sqrt(S*S+1)-S),P=Math.log(Math.sqrt(y*y+1)-y);w=(P-C)/t,v=function(b){var T=b*w,N=yr(C),A=u/(n*_)*(N*Sp(t*T+C)-yp(C));return[c+A*m,a+A*h,u*N/yr(t*T+C)]}}return v.duration=w*1e3*t/Math.SQRT2,v}return o.rho=function(r){var l=Math.max(.001,+r),c=l*l,a=c*c;return e(l,c,a)},o}(Math.SQRT2,2,4),wp=Object.freeze(Object.defineProperty({__proto__:null,Canvas:$.Canvas,axisStateZ:$.axisStateZ,newTickFactory:$.newTickFactory,tickFactoryProps:$.tickFactoryProps,tickType:$.tickType},Symbol.toStringTag,{value:"Module"})),Cp=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:$.AcquireChannelControl,AuthoritySource:$.AuthoritySource,Chip:$.Chip,Controller:$.Controller$1,Indicator:$.Indicator,Legend:$.Legend,REGISTRY:$.REGISTRY$3,STATUSES:$.STATUSES,SetChannelValue:$.SetChannelValue,StateProvider:$.StateProvider,acquireChannelControl:$.acquireChannelControl,acquireChannelControlPropsZ:$.acquireChannelControlPropsZ,authoritySource:$.authoritySource,authoritySourceProps:$.authoritySourceProps,chipStateZ:$.chipStateZ,controllerStateZ:$.controllerStateZ,indicatorStateZ:$.indicatorStateZ,legendStateZ:$.legendStateZ,setChannelValue:$.setChannelValue,setChannelValuePropsZ:$.setChannelValuePropsZ,stateProviderStateZ:$.stateProviderStateZ,statusZ:$.statusZ,sugaredStateZ:$.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),vp={region:f.Eo.ZERO,dpr:1,os:Z.w.getOS()},bp={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},_p=j.wrap$1($.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:s,...o})=>{const[{path:r},{bootstrapped:l,dpr:c},a]=j.use$3({aetherKey:n,type:$.Canvas$1.TYPE,schema:$.canvasStateZ,initialState:vp}),u=g.useRef({...bp}),d=g.useCallback(m=>{u.current.bootstrapped&&a(()=>({bootstrapped:!0,region:m,dpr:window.devicePixelRatio,os:Z.w.getOS({default:"Windows"})}))},[a]),x=j.useResize(d,{debounce:t});g.useEffect(()=>{const m=()=>{window.devicePixelRatio!==c&&a(h=>({...h,dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",m,{once:!0})},[c]),g.useEffect(()=>{window.addEventListener("focus",()=>a(m=>({...m}))),window.addEventListener("blur",()=>a(m=>({...m})))},[a]);const p=g.useCallback(m=>{if(x(m),m==null)return;m.className.includes("gl")?u.current.gl=m:m.className.includes("upper2d")?u.current.upper2d=m:u.current.lower2d=m;const{gl:h,lower2d:E,upper2d:v,bootstrapped:w}=u.current;if(h==null||E==null||v==null||w)return;u.current.bootstrapped=!0;const _=h.transferControlToOffscreen(),S=v.transferControlToOffscreen(),y=E.transferControlToOffscreen();a({glCanvas:_,upper2dCanvas:S,lower2dCanvas:y,bootstrap:!0,bootstrapped:!1,region:f.Eo.construct(h),dpr:window.devicePixelRatio,os:Z.w.getOS({default:"Windows"})},[_,S,y])},[a]);return i.jsxRuntimeExports.jsxs("div",{className:f.CSS(f.CSS.B("canvas-container"),s),...o,children:[i.jsxRuntimeExports.jsx("canvas",{ref:p,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","lower2d"))}),i.jsxRuntimeExports.jsx("canvas",{ref:p,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","gl"))}),i.jsxRuntimeExports.jsx("canvas",{ref:p,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","upper2d"))}),i.jsxRuntimeExports.jsx(j.Composite,{path:r,children:l&&e})]})}),cs=(e,t)=>j.useResize(g.useCallback((n,s)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(f.k$2.XY.translate(f.q.scale(f.Eo.topLeft(o),-1)).box(n),s)},[e]),t),kp=Object.freeze(Object.defineProperty({__proto__:null,Canvas:_p,useRegion:cs},Symbol.toStringTag,{value:"Module"})),Wi=g.createContext(null),Ke=e=>{const t=g.useContext(Wi);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Xi=e=>{const t=Ke("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},dn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=Ke(t),{key:o}=e;return j.useEffectCompare(()=>{f.J.outer.parse(e.loc),n(e)},([c],[a])=>Z._.equal(c,a),[e]),g.useEffect(()=>()=>s(o),[]),{gridArea:f.g.swap(f.J.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},Ki=j.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=f.q.ZERO,children:o,hold:r=!1,onHold:l,visible:c,...a})=>{const[u,d]=g.useState([]),x=j.useMemoDeepEqualProps({clearOverScan:s,hold:r,visible:c}),[{path:p},{grid:m},h]=j.use$3({aetherKey:e,type:$.LinePlot.TYPE,schema:$.linePlotStateZ,initialState:{container:f.Eo.ZERO,viewport:f.Eo.DECIMAL,grid:{},...x}});g.useEffect(()=>h(O=>({...O,...x})),[x]);const E=g.useRef(new Map),v=g.useCallback(O=>(E.current.set(O,null),()=>E.current.delete(O)),[E]),w=g.useCallback(O=>{const{mode:L,box:D,stage:R}=O;(L==="pan"&&R!=="start"||L==="zoom"||L==="zoomReset"&&R==="start")&&h(I=>({...I,viewport:D})),E.current.forEach((I,k)=>k(O))},[h]),_=g.useCallback(O=>h(L=>({...L,container:O})),[h]),S=cs(_,{debounce:n}),y=g.useCallback(O=>h(L=>({...L,grid:{...L.grid,[O.key]:O}})),[h]),C=g.useCallback(O=>h(L=>{const{[O]:D,...R}=L.grid;return{...L,grid:R}}),[h]),P=g.useCallback(O=>{d(L=>[...L.filter(({key:D})=>D!==O.key),O])},[d,w]),b=g.useCallback(O=>d(L=>L.filter(({key:D})=>D!==O)),[P]),T=g.useMemo(()=>Pp(m),[m]),N=g.useCallback(O=>{h(L=>({...L,hold:O})),l==null||l(O)},[h,l]),A=g.useMemo(()=>({lines:u,setGridEntry:y,removeGridEntry:C,setLine:P,removeLine:b,setViewport:w,addViewportHandler:v,setHold:N}),[u,y,C,P,b,w,v,N]);return i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("line-plot"),style:{...t,...T},ref:S,...a,children:i.jsxRuntimeExports.jsx(Wi.Provider,{value:A,children:i.jsxRuntimeExports.jsx(j.Composite,{path:p,children:o})})})}),Pp=e=>{const t=f.CSS.newGridBuilder();return $.regions("top",e).forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),t.row("plot-start","plot-end","minmax(0, 1fr)"),$.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),$.regions("left",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.col("plot-start","plot-end","minmax(0, 1fr)"),$.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},ko=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?$.XAxis.TYPE:$.YAxis.TYPE,s=`${e}-axis`;return j.wrap$1(n,({aetherKey:o,children:r,location:l=t,label:c="",labelLevel:a="small",labelDirection:u=e,onLabelChange:d,color:x,labelSize:p,showGrid:m,type:h,bounds:E,className:v,tickSpacing:w,autoBounds:_,autoBoundUpdateInterval:S,onAutoBoundsChange:y,style:C,...P})=>{const b=((c==null?void 0:c.length)??0)>0,T=j.useMemoDeepEqualProps({location:l,showGrid:m,type:h,bounds:E,label:c,labelDirection:u,tickSpacing:w,autoBounds:_,autoBoundUpdateInterval:S}),[{path:N},{size:A,labelSize:O,...L},D]=j.use$3({aetherKey:o,type:n,schema:$.coreAxisStateZ,initialState:T});g.useEffect(()=>D(B=>({...B,...T})),[T]),g.useEffect(()=>{const{lower:B,upper:M}=$.parseAutoBounds(L.autoBounds);L.bounds!=null&&(B&&(E==null?void 0:E.lower)!==L.bounds.lower||M&&(E==null?void 0:E.upper)!==L.bounds.upper)&&(y==null||y(L.bounds))},[L.autoBounds,L.bounds]);const R=dn({loc:l,key:`${n}-${o}`,size:A+O,order:1},`${e.toUpperCase()}Axis`),I=j.useTypography(a).toString(),k=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(c==null)return;let M=Z.dimensions(c,I)[f.g.dimension(f.g.construct(u))];M>0&&(M+=9),D(z=>({...z,labelSize:M}))}else{let M=Z.dimensions(c,I).height*1.3;M>0&&(M+=12);const z=k.current;$.withinSizeThreshold(z,M)||(k.current=M,D(V=>({...V,labelSize:M})))}},[c,u,I]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(te.Space,{className:f.CSS(v,f.CSS.B("axis"),f.CSS.B(s),f.CSS.loc(l)),style:{...C,...R},align:"center",justify:l!=="left"?"end":"start",direction:f.g.swap(e),...P,children:b&&i.jsxRuntimeExports.jsx(j.MaybeEditable,{className:f.CSS(f.CSS.BE("axis","label"),f.CSS.dir(u)),value:c,onChange:d,level:a})}),i.jsxRuntimeExports.jsx(j.Composite,{path:N,children:r})]})})},Gi=ko("x"),Ui=ko("y"),Qi=f.q.xy.extend({root:f.J.corner,units:ue.z.object({x:ue.z.enum(["px","decimal"]),y:ue.z.enum(["px","decimal"])})}),Mp=Qi.partial({root:!0,units:!0}),Np=e=>{var n,s,o,r;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((s=e==null?void 0:e.units)==null?void 0:s.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((o=e.root)==null?void 0:o.y)??"top"]=((r=e==null?void 0:e.units)==null?void 0:r.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},Lp=(e,t)=>{var r,l,c,a,u,d;const n={x:e.x,y:e.y};if(t.current==null)return n;const s=f.Eo.construct(t.current),o=f.Eo.construct(t.current.parentElement);return((r=e.units)==null?void 0:r.x)==="decimal"?((l=e.root)==null?void 0:l.x)==="right"&&(n.x=1-e.x):((c=e.root)==null?void 0:c.x)==="right"?n.x=1-(e.x+f.Eo.width(s))/f.Eo.width(o):n.x/=f.Eo.width(o),((a=e.units)==null?void 0:a.y)==="decimal"?((u=e.root)==null?void 0:u.y)==="bottom"&&(n.y=1-e.y):((d=e.root)==null?void 0:d.y)==="bottom"?n.y=1-(e.y+f.Eo.height(s))/f.Eo.height(o):n.y/=f.Eo.height(o),n},Ji=(e,t)=>{if(t.current==null)return null;const n=f.Eo.construct(t.current.parentElement),s=f.Eo.construct(t.current),o={x:e.x,y:e.y,root:{...f.J.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*f.Eo.width(n)-f.Eo.width(s),o.root.x="right"):e.x<.2?o.x=e.x*f.Eo.width(n):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*f.Eo.height(n)-f.Eo.height(s),o.root.y="bottom"):e.y<.2?o.y=e.y*f.Eo.height(n):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...f.q.truncate(o,3)}},Sr=f.Eo.reRoot(f.Eo.DECIMAL,f.J.TOP_LEFT),Po=g.memo(({className:e,value:t,onChange:n,style:s,draggable:o=!0,...r})=>{const[l,c]=Z.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:f.J.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),a=g.useRef(l),u=j.useSyncedRef(o===!1),d=g.useRef(null);l!==null&&(s={...s,...Np(l)});const x=g.useCallback(m=>{var y;if(((y=d.current)==null?void 0:y.parentElement)==null)return a.current;const h=f.Eo.construct(d.current.parentElement),E=f.k$2.XY.scale(h).scale(Sr),v=E.box(f.Eo.construct(d.current)),w=f.k$2.XY.clamp(f.Eo.construct(f.Eo.topLeft(Sr),{width:1-f.Eo.width(v),height:1-f.Eo.height(v)})),_=f.q.translate(f.q.construct(a.current),f.Eo.signedDims(E.box(m))),S=w.pos(_);return Ji(S,d)},[]),p=rs({onStart:g.useCallback(()=>{a.current=Lp(a.current,d)},[]),onMove:g.useCallback(m=>{if(u.current)return;const h=x(m);h!==null&&c(h)},[]),onEnd:g.useCallback(m=>{if(u.current)return;const h=x(m);h!==null&&(a.current=h)},[])});return i.jsxRuntimeExports.jsx(te.Space,{className:f.CSS(e,f.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:p,draggable:o,ref:d,...r,onDrag:On,onDragEnd:On,empty:!0})});Po.displayName="Legend.Container";const Mo=(e,t,n)=>e.sort((s,o)=>s.label.localeCompare(o.label)).map(({key:s,color:o,label:r})=>i.jsxRuntimeExports.jsxs(te.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(wo.Swatch,{value:o,onChange:l=>t==null?void 0:t({key:s,color:l,label:r}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"small"}),i.jsxRuntimeExports.jsx(j.MaybeEditable,{level:"small",value:r,onChange:l=>t==null?void 0:t({key:s,color:o,label:l}),noWrap:!0})]},s)),No=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...o})=>{const[r,l]=g.useState(!1);return e.length===0?null:i.jsxRuntimeExports.jsx(Po,{...o,draggable:!r,value:n,onChange:s,children:Mo(e,t,l)})},Tp=Object.freeze(Object.defineProperty({__proto__:null,Container:Po,Simple:No,calcStickyPos:Ji,completeStickyXYz:Qi,legendSwatches:Mo,stickyXYz:Mp},Symbol.toStringTag,{value:"Module"})),el=({className:e,style:t,onLineChange:n,...s})=>{const{lines:o}=Ke("Legend");return Ke("Legend"),i.jsxRuntimeExports.jsx(No,{data:o,onEntryChange:n,...s})},Ap=({onLineChange:e})=>{const{lines:t}=Ke("Legend"),n=j.useUniqueKey(),s=dn({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return i.jsxRuntimeExports.jsx(te.Space,{className:f.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:Mo(t,e)})},tl=({variant:e="floating",...t})=>e==="floating"?i.jsxRuntimeExports.jsx(el,{...t}):i.jsxRuntimeExports.jsx(Ap,{...t}),nl=j.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=j.use$3({aetherKey:e,type:$.Line.TYPE,schema:$.stateZ,initialState:t}),s=j.useMemoDeepEqualProps(t);return g.useLayoutEffect(()=>n(s),[s]),null}),$p=Object.freeze(Object.defineProperty({__proto__:null,Line:nl},Symbol.toStringTag,{value:"Module"})),Lo=j.wrap$1("Line",({aetherKey:e,color:t,label:n="",...s})=>{const{setLine:o,removeLine:r}=Ke("Line");return g.useEffect(()=>(o({key:e,color:t,label:n}),()=>r(e)),[n,t]),i.jsxRuntimeExports.jsx(nl,{aetherKey:e,color:t,label:n,...s})}),sl=({level:e="h2",...t})=>{const n=j.useUniqueKey(),s=j.useTypography(e),o=dn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return i.jsxRuntimeExports.jsx(te.Space,{justify:"center",align:"center",style:o,children:i.jsxRuntimeExports.jsx(j.MaybeEditable,{...t,level:e})})},ol=j.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=j.use$3({aetherKey:e,type:$.Tooltip.TYPE,schema:$.tooltipStateZ,initialState:{position:null}}),n=g.useRef(null),s=g.useCallback(r=>{const l=document.querySelector(".pluto-canvas-container");if(l==null)return;const c=f.Eo.topLeft(l);t({position:f.q.translation(c,f.q.construct(r))})},[t]),o=g.useCallback(()=>t({position:null}),[t]);return g.useEffect(()=>{if(n.current===null)return;const r=n.current.parentElement;if(r!=null)return r.addEventListener("mousemove",s),r.addEventListener("mouseleave",o),()=>{r.removeEventListener("mousemove",s),r.removeEventListener("mouseleave",o)}},[s]),i.jsxRuntimeExports.jsx("span",{ref:n})}),Ip=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:ol},Symbol.toStringTag,{value:"Module"})),Op={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},To=g.forwardRef(({className:e,mode:t,maskBox:n,children:s,style:o,...r},l)=>i.jsxRuntimeExports.jsxs("div",{ref:l,className:f.CSS(f.CSS.noSelect,f.CSS.BE("viewport-mask","container"),e),style:{cursor:Op[t],...o},...r,children:[i.jsxRuntimeExports.jsx("div",{style:{...f.Eo.css(n),display:f.Eo.areaIsZero(n)?"none":"block"},className:f.CSS.BE("viewport-mask","selection")}),s]}));To.displayName="ZoomPanMask";const Bp=[{key:"start",icon:i.jsxRuntimeExports.jsx(j.Qt.TextAlign.Left,{})},{key:"center",icon:i.jsxRuntimeExports.jsx(j.Qt.TextAlign.Center,{})},{key:"end",icon:i.jsxRuntimeExports.jsx(j.Qt.TextAlign.Right,{})}],Dp=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(j.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),Ao=({children:e=Dp,...t})=>i.jsxRuntimeExports.jsx(Pe.Button,{...t,allowMultiple:!1,data:Bp,children:e}),zp=new Set([Z.g.UUID,Z.g.JSON]),Vp=Z.g.ALL.filter(e=>e!==Z.g.UNKNOWN).map(e=>({key:e.toString(),name:zp.has(e)?e.toString().toUpperCase():f._$1.capitalize(e.toString())})),Fp=[{key:"name",name:"Name"}],Hp=e=>i.jsxRuntimeExports.jsx(Pe.DropdownButton,{...e,data:Vp,columns:Fp,entryRenderKey:"name"}),Zp=[{key:"x",icon:i.jsxRuntimeExports.jsx(j.Qt.Arrow.Right,{})},{key:"y",icon:i.jsxRuntimeExports.jsx(j.Qt.Arrow.Up,{})}],Yp=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(j.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),qp=({children:e=Yp,...t})=>i.jsxRuntimeExports.jsx(Pe.Button,{...t,allowMultiple:!1,data:Zp,children:e}),rl=e=>i.jsxRuntimeExports.jsx(j.Icon,{className:f.CSS.BE("select","clear"),variant:"outlined",...e,children:i.jsxRuntimeExports.jsx(j.Qt.Close,{"aria-label":"clear"})}),ct=({onChange:e,value:t,entryRenderKey:n="key",columns:s,data:o,emptyContent:r,inputProps:l,allowNone:c=!0,searcher:a,className:u,variant:d="button",hideColumnHeader:x=!1,disabled:p,omit:m,children:h,dropdownVariant:E="connected",placeholder:v=as,inputPlaceholder:w=v,triggerTooltip:_,dropdownZIndex:S,filter:y,actions:C,...P})=>{const{visible:b,open:T,close:N,toggle:A}=j.use$2(),[O,L]=g.useState(null),D=a!=null;j.useAsyncEffect(async()=>{if(j.selectValueIsZero(t))return L(null);if((O==null?void 0:O.key)===t)return;let M=null;if(D)try{[M]=await a.retrieve([t])}finally{M??(M=null)}else o!=null&&(M=o.find(z=>z.key===t)??null);L(M)},[a,t,o]);const R=g.useCallback((M,z)=>{Array.isArray(M)||(L(M==null?null:z.entries[0]),N(),e(M,z))},[e,c]),I=g.useMemo(()=>D?j.Search:$t.Filter,[D]),k=i.jsxRuntimeExports.jsx(I,{searcher:a,filter:y,children:({onChange:M})=>i.jsxRuntimeExports.jsx(Wp,{autoFocus:E==="modal",variant:d,onChange:M,onFocus:T,selected:O,entryRenderKey:n,visible:b,allowNone:c,className:u,disabled:p,placeholder:w,children:C})}),B=i.jsxRuntimeExports.jsx(j.Button,{tooltip:_,variant:"outlined",onClick:A,disabled:p,children:O!=null?il(n,O):v});return i.jsxRuntimeExports.jsx(Pe.Core,{close:N,zIndex:S,open:T,data:o,omit:m,emptyContent:r,allowMultiple:!1,visible:b,value:t,hideColumnHeader:x,onChange:R,allowNone:c,columns:s,listItem:h,variant:E,trigger:E!=="modal"?k:B,extraDialogContent:E==="modal"?k:void 0,keepMounted:!1,...P})},as="Select",il=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Wp=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:o,allowNone:r=!0,placeholder:l=as,className:c,disabled:a,...u})=>{const{clear:d}=j.useSelectionUtils(),[x,p]=g.useState("");g.useEffect(()=>{if(!n){if(Z.w$1(t==null?void 0:t.key))return p("");t!=null&&p(il(e,t))}},[t,n,e]);const m=w=>{s(w),p(w)},h=()=>{x===""&&s(""),p(""),o==null||o()},E=w=>{n||(w.preventDefault(),o==null||o())},v=()=>{p(""),d==null||d()};return i.jsxRuntimeExports.jsx(j.Text$1,{className:f.CSS(f.CSS.BE("select","input"),c),value:x,onChange:m,onFocus:h,onKeyDown:j.matchCallback([["Enter"]],w=>{w.preventDefault(),!n&&(o==null||o())}),endContent:i.jsxRuntimeExports.jsx(Ti.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n}),style:{flexGrow:1},onClick:E,placeholder:l,disabled:a,...u,children:r&&i.jsxRuntimeExports.jsx(rl,{onClick:v,disabled:a})})},en=({children:e="",size:t="medium",color:n,icon:s,onClose:o,className:r,onDragStart:l,...c})=>{const a=f.cssString(n);s==null&&n!=null&&(s=i.jsxRuntimeExports.jsx(j.Qt.Circle,{fill:a}));const u=o==null?void 0:i.jsxRuntimeExports.jsx(j.Icon,{"aria-label":"close",size:"small",className:f.CSS.BE("tag","close"),onClick:d=>{d.stopPropagation(),o()},children:i.jsxRuntimeExports.jsx(j.Qt.Close,{})});return i.jsxRuntimeExports.jsx(j.WithIcon,{startIcon:s,endIcon:u,className:f.CSS(r,f.CSS.B("tag"),o!=null&&f.CSS.BM("tag","closeable")),level:Z.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:l,...c,children:e})},Xp=Object.freeze(Object.defineProperty({__proto__:null,Tag:en},Symbol.toStringTag,{value:"Module"})),Ot=({onChange:e,value:t,className:n,data:s,columns:o=[],entryRenderKey:r="key",emptyContent:l,searcher:c,renderTag:a=j.componentRenderProp(ll),placeholder:u,onTagDragStart:d,allowMultiple:x,allowNone:p,replaceOnSingle:m,onTagDragEnd:h,style:E,addPlaceholder:v="Add",children:w,dropdownVariant:_="connected",actions:S,...y})=>{const{visible:C,open:P,close:b}=j.use$2(),[T,N]=g.useState([]),[A,O]=g.useState(!1),L=c!=null;j.useAsyncEffect(async()=>{O(!0),j.selectValueIsZero(t)&&N([]);const B=T.map(V=>V.key),M=Z.A(t);if(Z.F.unorderedPrimitiveArrays(B,M)===Z.F.EQUAL)return;let z=[];if(L)try{z=await c.retrieve(M)}finally{O(!1)}else s!=null&&(z=s.filter(V=>M.includes(V.key)));N(z)},[c,L,t,s]);const D=g.useCallback((B,M)=>{B!=null&&(N(M.entries),e(Z.A(B),M))},[e]),R=g.useMemo(()=>L?j.Search:$t.Filter,[L]);let I,k;if(_==="connected")k=i.jsxRuntimeExports.jsx(R,{searcher:c,children:({onChange:B,value:M})=>i.jsxRuntimeExports.jsx(Kp,{value:M,selectedKeys:t,className:n,onChange:B,loading:A,selected:T,onFocus:P,entryRenderKey:r,visible:C,renderTag:a,placeholder:u,onTagDragStart:d,onTagDragEnd:h,style:E,children:S})});else{const B=Z.A(t);k=i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",grow:!0,style:E,size:"small",children:[B.map(M=>{const z=T.find(V=>V.key===M);return a({key:M,entryKey:M,entryRenderKey:r,loading:A,entry:z,onClose:()=>{const V=B.filter(Y=>Y!==M);e(V,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:V=>d==null?void 0:d(V,M),onDragEnd:V=>h==null?void 0:h(V,M)})}),B.length>0?i.jsxRuntimeExports.jsx(j.Icon,{onClick:P,children:i.jsxRuntimeExports.jsx(j.Qt.Add,{style:{color:"var(--pluto-gray-l7)"}})}):i.jsxRuntimeExports.jsx(j.Button,{onClick:P,shade:7,startIcon:i.jsxRuntimeExports.jsx(j.Qt.Add,{}),variant:"text",children:v})]}),I=i.jsxRuntimeExports.jsx(R,{searcher:c,children:M=>i.jsxRuntimeExports.jsx(j.Text$1,{autoFocus:!0,placeholder:"Search",...M,children:S})})}return i.jsxRuntimeExports.jsx(Pe.Core,{close:b,open:P,data:s,emptyContent:l,visible:C,value:t,onChange:D,allowNone:p,replaceOnSingle:m,columns:o,allowMultiple:!0,listItem:w,trigger:k,extraDialogContent:I,variant:_,...y})},Kp=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:o,visible:r,entryRenderKey:l,renderTag:c,placeholder:a=as,onTagDragStart:u,onTagDragEnd:d,value:x,className:p,children:m,...h})=>{const{onSelect:E,clear:v}=j.useSelectionUtils(),w=g.useRef(null);g.useLayoutEffect(()=>{var C;r&&((C=w.current)==null||C.focus())},[r,n]);const _=()=>{r||s(""),o==null||o()},S=()=>{r||o==null||o()},y=()=>{r||s("")};return i.jsxRuntimeExports.jsxs(j.Text$1,{ref:w,className:f.CSS(f.CSS.BE("select-multiple","input"),f.CSS.visible(r),p),onBlur:y,placeholder:a,value:x,onChange:s,onFocus:_,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:S,variant:"button",...h,children:[i.jsxRuntimeExports.jsx(te.Space,{direction:"x",className:f.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:Z.A(e).map(C=>{const P=n.find(b=>b.key===C);return c({key:C,entryKey:C,entryRenderKey:l,loading:t,entry:P,onClose:()=>E==null?void 0:E(C),onDragStart:b=>u==null?void 0:u(b,C),onDragEnd:b=>d==null?void 0:d(b,C)})})}),m,i.jsxRuntimeExports.jsx(rl,{onClick:v})]})},ll=({entryKey:e,entryRenderKey:t,entry:n,loading:s,...o})=>{let r=e;return n!=null&&(r=typeof t=="function"?t(n):n[t]),g.createElement(en,{size:"small",variant:"outlined",className:f.CSS(n==null&&!s&&f.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...o,key:e.toString()},Z.Q(r))},Gp=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Pe.BaseButton,Button:Pe.Button,DEFAULT_PLACEHOLDER:as,DataType:Hp,Direction:qp,DropdownButton:Pe.DropdownButton,Multiple:Ot,MultipleTag:ll,Single:ct,TextAlignment:Ao,defaultButton:Pe.defaultButton},Symbol.toStringTag,{value:"Module"})),Mn=6,Up=2,Rr=5,Qp=e=>f.Eo.width(e)<Rr&&f.Eo.height(e)<Rr,Jp=["zoom","pan","select","zoomReset"],Gt=[...Jp,"click"],em=ue.z.enum(Gt),cl=["zoom","select"],Nn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},al={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},ul={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},$o={zoom:Nn,pan:al,select:ul,zoomReset:Nn,click:Nn},tm=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(o=>o.filter(r=>r!=="MouseLeft")).filter(o=>o.length>0)]))},nm=f.Eo.construct(0,0,1,1,f.J.TOP_LEFT),sm={width:30,height:50},dl=({onChange:e,triggers:t,initial:n=nm,threshold:s=sm,ref:o})=>{const r=(t==null?void 0:t.defaultMode)??"zoom",[l,c]=g.useState(f.Eo.ZERO),[a,u]=g.useState(r),[d,x]=j.useStateRef(n),p=g.useRef(f.q.ZERO),m=g.useRef(null),h=f._.construct(s);g.useEffect(()=>x(()=>f.Eo.truncate(n,Mn)),[n]),g.useEffect(()=>u(r),[r]);const[E,v,w,_]=j.useMemoCompare(()=>{const T={...$o[r],...t},N=j.flattenConfig(T),A=tm(T);return[T,N,A,j.flattenConfig(A)]},j.compareModeConfigs,[t]),S=g.useCallback(({box:T,triggers:N,stage:A,cursor:O})=>{if(m.current==null)return;const L=j.determineMode(E,N),D=f.Eo.construct(m.current);if(L==null)return;if(L==="zoomReset")return c(f.Eo.ZERO),e==null||e({box:f.Eo.DECIMAL,mode:L,stage:A,cursor:O}),x(f.Eo.DECIMAL);const R=Qp(T);if(A==="end"){if(R){L==="zoom"&&c(f.Eo.ZERO),e==null||e({box:d.current,mode:"click",stage:A,cursor:O});return}return x(k=>{if(L==="pan"){const M=wr(T,k,D);return M===null||f.Eo.equals(M,k)?k:(e==null||e({box:M,mode:L,stage:A,cursor:O}),M)}const B=y(T,k,D);return B===null?k:(e==null||e({box:B,mode:L,stage:A,cursor:O}),L==="zoom"?(c(f.Eo.ZERO),B):f.Eo.truncate(k,Mn))})}if(cl.includes(L))return R?void 0:c(f.k$2.XY.scale(D).clamp(D).translate({x:-f.Eo.left(D),y:-f.Eo.top(D)}).box(Cr(h,T,D)));if(c(k=>f.Eo.areaIsZero(k)?k:f.Eo.ZERO),f.q.distance(O,p.current)<Up)return;p.current=O;const I=wr(T,d.current,D);e==null||e({box:I,mode:L,stage:A,cursor:O})},[c,u,e,E,s.height,s.width,x,m]);g.useImperativeHandle(o,()=>({reset:()=>{c(f.Eo.ZERO),x(f.Eo.DECIMAL),e==null||e({box:f.Eo.DECIMAL,mode:"zoomReset",stage:"start",cursor:f.q.ZERO})}}),[e]);const y=g.useCallback((T,N,A)=>f.Eo.truncate(Js(N,A).box(Cr(h,T,A)),Mn),[s]),C=j.useHeldRef({triggers:[["Control"]]}),P=j.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const T=N=>{if(m.current==null)return;let A=1;N.deltaY<0?A-=.035:A+=.035;const O=f.Eo.construct(m.current),L=f.q.construct(N);if(!f.Eo.contains(O,L)||N.target!==m.current)return;const R=Js(d.current,f.Eo.construct(m.current)).pos(f.q.construct(N));let k=f.k$2.XY.magnify({x:C.current.held?1:A,y:P.current.held?1:A}).box(d.current);k=f.Eo.translate(k,{x:C.current.held?0:R.x*(1-A),y:P.current.held?0:R.y*(1-A)}),x(k),e==null||e({stage:"end",box:k,cursor:f.q.construct(N),mode:"zoom"})};return window.addEventListener("wheel",T),()=>window.removeEventListener("wheel",T)},[x,e]),Ai.useDrag({bound:m,onDrag:S,triggers:v,loose:!0});const b=g.useCallback(({triggers:T,stage:N})=>{if(N==="end")return u(r);const A=j.determineMode(w,T);A!=null&&u(A)},[w,r,e]);return j.use$1({triggers:_,callback:b,region:m}),{maskBox:l,ref:m,mode:a}},Js=(e,t)=>f.k$2.XY.scale(t).clamp(t).scale(e),wr=(e,t,n)=>{let s=f.Eo.signedDims(Js(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},f.Eo.truncate(f.k$2.XY.translate(f.q.construct(s)).box(t),Mn)},Cr=(e,t,n)=>f.Eo.height(t)<=e.height?f.Eo.construct(f.Eo.left(t),f.Eo.top(n),f.Eo.width(t),f.Eo.height(n)):f.Eo.width(t)<=e.width?f.Eo.construct(f.Eo.left(n),f.Eo.top(t),f.Eo.width(n),f.Eo.height(t)):t,om=({mode:e,triggers:t})=>i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",children:[i.jsxRuntimeExports.jsx(j.Text,{level:"small",children:f._$1.capitalize(e)}),i.jsxRuntimeExports.jsx(Bf.Text,{trigger:t[0],level:"small"})]}),rm={zoom:i.jsxRuntimeExports.jsx(j.Qt.Zoom,{}),pan:i.jsxRuntimeExports.jsx(j.Qt.Pan,{}),select:i.jsxRuntimeExports.jsx(j.Qt.Selection,{}),zoomReset:i.jsxRuntimeExports.jsx(j.Qt.Expand,{}),click:i.jsxRuntimeExports.jsx(j.Qt.Bolt,{})},im=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([o])=>!t.includes(o)&&Gt.includes(o)).map(([o,r])=>({key:o,icon:rm[o],tooltip:i.jsxRuntimeExports.jsx(om,{mode:o,triggers:r})})).sort((o,r)=>Gt.indexOf(o.key)-Gt.indexOf(r.key));return i.jsxRuntimeExports.jsx(Pe.Button,{...n,data:s,entryRenderKey:"icon",children:({title:o,entry:r,...l})=>g.createElement(j.Icon,{...l,key:r.key,variant:l.selected?"filled":"text",size:"medium",tooltip:r.tooltip,tooltipLocation:{x:"right",y:"top"}},r.icon)})},lm=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:$o,MASK_MODES:cl,MODES:Gt,Mask:To,PAN_DEFAULT_TRIGGERS:al,SELECT_DEFAULT_TRIGGERS:ul,SelectMode:im,ZOOM_DEFAULT_TRIGGERS:Nn,modeZ:em,use:dl},Symbol.toStringTag,{value:"Module"})),xl=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Io=g.forwardRef(({children:e,initial:t=f.Eo.DECIMAL,onChange:n,...s},o)=>{const{setViewport:r}=Ke("Viewport");g.useLayoutEffect(()=>{r({box:t,mode:"zoom",cursor:f.q.ZERO,stage:"start"})},[r,t]);const l=g.useCallback(a=>{r(a),n==null||n(a)},[n,r]),c=dl({onChange:l,initial:t,ref:o,...s});return i.jsxRuntimeExports.jsx(To,{className:f.CSS.BE("line-plot","viewport"),...c,children:e})});Io.displayName="Viewport";const cm=Object.freeze(Object.defineProperty({__proto__:null,Floating:el,Legend:tl,Line:Lo,LinePlot:Ki,Title:sl,Tooltip:Ip,Viewport:Io,XAxis:Gi,YAxis:Ui,axisFactory:ko,selectViewportEl:xl,useContext:Ke,useGridEntry:dn,useViewport:Xi},Symbol.toStringTag,{value:"Module"})),am=j.wrap$1("Tooltip",({aetherKey:e,...t})=>(j.use$3({aetherKey:e,type:$.Annotation.TYPE,schema:$.annotationStateZ,initialState:t}),null)),fl=j.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:s,setHold:o}=Ke("Range.Provider"),[,{hovered:r,count:l},c]=j.use$3({aetherKey:e,type:$.Provider$1.TYPE,schema:$.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),a=dn({key:e,loc:"top",size:l>0?32:0,order:3},"Annotation.Provider"),u=j.useContextMenu(),d=j.useSyncedRef(u.visible),x=g.useCallback(p=>{const m=E=>{c(v=>({...v,cursor:{x:E.clientX,y:E.clientY}}))},h=p.currentTarget;h.addEventListener("mousemove",m),h.addEventListener("mouseleave",()=>{h.removeEventListener("mousemove",m),d.current||c(E=>({...E,cursor:null}))},{once:!0})},[c]);return i.jsxRuntimeExports.jsx(j.ContextMenu,{style:{...a,cursor:r!=null?"pointer":"default"},...u,menu:()=>t==null||r==null?null:t(r),children:i.jsxRuntimeExports.jsx(te.Space,{style:{width:"100%",height:"100%"},onClick:()=>{r!=null&&(s({box:f.Eo.construct({x:r.viewport.lower,y:0},{x:r.viewport.upper,y:1}),mode:"zoom",cursor:f.q.ZERO,stage:"start"}),o(!0))},onMouseEnter:x})})}),um=Object.freeze(Object.defineProperty({__proto__:null,Annotation:am,Provider:fl},Symbol.toStringTag,{value:"Module"})),pl={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},dm=j.flattenConfig(pl),ml=j.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=j.use$3({aetherKey:e,type:$.Measure.TYPE,schema:$.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=g.useRef(null),s=j.useHeldRef({triggers:dm,loose:!0}),o=g.useCallback(({mode:c,cursor:a})=>{if(c==="click"){const u=j.determineMode(pl,s.current.triggers,{loose:!0});if(["one","two"].includes(u))return t(d=>({...d,[u]:a}));t(u==="clear"?d=>({...d,one:null,two:null}):d=>({...d,one:d.one??a,two:d.one!==null?a:d.two}))}},[t,s]);Xi(o);const r=g.useCallback(c=>t(a=>({...a,hover:f.q.construct(c)})),[t]),l=g.useCallback(()=>{t(c=>({...c,hover:null}))},[t]);return g.useEffect(()=>{if(n.current===null)return;const c=n.current.parentElement;if(c!=null)return c.addEventListener("mousemove",r),c.addEventListener("mouseleave",l),()=>{c.removeEventListener("mousemove",r),c.removeEventListener("mouseleave",l)}},[o]),i.jsxRuntimeExports.jsx("span",{ref:n})}),xm=Object.freeze(Object.defineProperty({__proto__:null,Measure:ml},Symbol.toStringTag,{value:"Module"})),Oo=j.wrap$1("Rule",({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:o,units:r="",color:l,lineWidth:c,lineDash:a})=>{const[u,d]=Z.usePurePassthrough({value:t,onChange:s,initial:""}),[,{position:x,pixelPosition:p},m]=j.use$3({aetherKey:e,type:$.Rule.TYPE,schema:$.ruleStateZ,initialState:{color:l,dragging:!1,position:n,lineWidth:c,lineDash:a}});g.useEffect(()=>{if(x==null)return;if(n==null)return o==null?void 0:o(x);const y=f.G.construct(x+.01,x-.01);n!=null&&!f.G.contains(y,n)&&(o==null||o(Math.trunc(x*100)/100))},[x]);const h=g.useRef(p);p!==h.current&&(h.current=p);const E=g.useRef(p);g.useEffect(()=>{m(y=>({...y,position:n,color:l,lineWidth:c,lineDash:a}))},[n,l,c,a]);const v=rs({onStart:g.useCallback(()=>{m(y=>({...y,dragging:!0})),E.current=h.current},[]),onMove:y=>{m(C=>({...C,pixelPosition:(E.current??0)+f.Eo.signedHeight(y)}))},onEnd:g.useCallback(()=>{m(y=>({...y,dragging:!1})),E.current=p},[])}),w=g.useRef(null);if(x==null||p==null)return null;const _=xl(w==null?void 0:w.current),S=i.jsxRuntimeExports.jsxs("div",{ref:w,className:f.CSS.B("rule"),style:{top:`calc(${p}px - 0.5rem)`},children:[i.jsxRuntimeExports.jsx("div",{className:f.CSS.BE("rule","drag-handle"),onDragStart:v,draggable:!0}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[i.jsxRuntimeExports.jsx(j.Editable,{level:"p",value:u,onChange:d}),i.jsxRuntimeExports.jsx(j.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${x.toFixed(2)} ${r}`})]})]});return _==null?S:Co.createPortal(S,_)}),fm=Object.freeze(Object.defineProperty({__proto__:null,Rule:Oo},Symbol.toStringTag,{value:"Module"})),hl=j.canDropOfType(He),pm=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:o,showLegend:r=!0,legendPosition:l,onLegendPositionChange:c,titleLevel:a="h4",onLineChange:u,onRuleChange:d,onAxisChannelDrop:x,onAxisChange:p,rules:m,enableTooltip:h=!0,enableMeasure:E=!1,initialViewport:v=f.Eo.DECIMAL,legendVariant:w,onViewportChange:_,viewportTriggers:S,annotationProvider:y,...C})=>{var A;const P=t.filter(({location:O})=>f.J.isY(O)),b=g.useRef(),T=j.usePrevious(e.length),N=j.usePrevious(C.hold);return(T===0&&e.length!==0||N===!0&&C.hold===!1)&&((A=b.current)==null||A.reset()),i.jsxRuntimeExports.jsxs(Ki,{...C,children:[P.map((O,L)=>{const D=e.filter(k=>k.axes.x===O.key),R=t.filter(({location:k})=>f.J.isX(k)),I=m==null?void 0:m.filter(k=>[...R.map(({key:B})=>B),O.key].includes(k.axis));return i.jsxRuntimeExports.jsx(mm,{axis:O,index:L,lines:D,yAxes:R,rules:I,onAxisChannelDrop:x,onAxisChange:p,annotationProvider:y},O.key)}),r&&i.jsxRuntimeExports.jsx(tl,{onLineChange:u,position:l,onPositionChange:c,variant:w}),n&&i.jsxRuntimeExports.jsx(sl,{value:s,onChange:o,level:a}),i.jsxRuntimeExports.jsxs(Io,{initial:v,onChange:_,triggers:S,ref:b,children:[h&&i.jsxRuntimeExports.jsx(ol,{}),E&&i.jsxRuntimeExports.jsx(ml,{})]})]})},mm=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:o,onAxisChannelDrop:r,onAxisChange:l,axis:{location:c,key:a,showGrid:u,...d},annotationProvider:x})=>{const p=j.useDrop({type:"Channel.LinePlot.XAxis",canDrop:hl,onDrop:g.useCallback(({items:E})=>{const v=j.filterByType(He,E);return r==null||r(a,v.map(({key:w})=>w)),v},[a,r])}),m=s==null?void 0:s.filter(E=>E.axis===a),h=j.useDraggingState();return i.jsxRuntimeExports.jsxs(Gi,{...d,...p,location:c,showGrid:u??n===0,className:f.CSS(f.CSS.dropRegion(j.canDropOfType(He)(h))),onAutoBoundsChange:E=>l==null?void 0:l({key:a,bounds:E}),children:[e.map((E,v)=>{const w=t.filter(S=>S.axes.y===E.key),_=s==null?void 0:s.filter(S=>S.axis===E.key);return i.jsxRuntimeExports.jsx(gm,{axis:{...E,showGrid:u??(n===0&&v===0)},lines:w,rules:_,onRuleChange:o,onAxisChannelDrop:r,onAxisChange:l},E.key)}),m==null?void 0:m.map(E=>g.createElement(Oo,{aetherKey:E.key,...E,key:E.key,onLabelChange:v=>o==null?void 0:o({key:E.key,label:v}),onPositionChange:v=>o==null?void 0:o({key:E.key,position:v})})),i.jsxRuntimeExports.jsx(fl,{...x})]})},hm=({channels:{x:e,y:t}})=>`${e??0}-${t}`,gm=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:o,axis:{key:r,location:l,...c}})=>{const a=j.useDrop({type:"Channel.LinePlot.YAxis",canDrop:hl,onDrop:g.useCallback(({items:d})=>{const x=j.filterByType(He,d);return s==null||s(r,x.map(({key:p})=>p)),x},[r,s])}),u=j.useDraggingState();return i.jsxRuntimeExports.jsxs(Ui,{...c,...a,location:l,className:f.CSS(f.CSS.dropRegion(j.canDropOfType(He)(u))),onAutoBoundsChange:d=>o==null?void 0:o({key:r,bounds:d}),children:[e.map(d=>i.jsxRuntimeExports.jsx(jm,{line:d},hm(d))),t==null?void 0:t.map(d=>g.createElement(Oo,{aetherKey:d.key,...d,key:d.key,onLabelChange:x=>n==null?void 0:n({key:d.key,label:x}),onPositionChange:x=>n==null?void 0:n({key:d.key,position:x})}))]})},jm=({line:e})=>e.variant==="static"?i.jsxRuntimeExports.jsx(ym,{line:e}):i.jsxRuntimeExports.jsx(Em,{line:e}),Em=({line:{key:e,timeSpan:t,channels:{x:n,y:s},...o}})=>{const r=Number(t.valueOf())*3,l=$.streamChannelData({timeSpan:t,channel:s,keepFor:r}),c=n!=null&&n!==0,a=$.streamChannelData({timeSpan:t,channel:c?n:s,useIndexOfChannel:!c,keepFor:r});return i.jsxRuntimeExports.jsx(Lo,{aetherKey:e,y:l,x:a,...o})},ym=({line:{timeRange:e,key:t,channels:{x:n,y:s},...o}})=>{const r=$.channelData({timeRange:e,channel:s}),l=n!=null&&n!==0,c=$.channelData({timeRange:e,channel:l?n:s,useIndexOfChannel:!l});return i.jsxRuntimeExports.jsx(Lo,{aetherKey:t,y:r,x:c,...o})},vr=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Bn=({items:e},t)=>{const n=j.filterByType(He,e);return n.length>0&&!n.every(s=>t.includes(s.key))},gl=["name","alias"],jl=e=>{const t=is();return g.useMemo(()=>e.length===0?vr:vr.filter(n=>e.includes(n.key)),[e,t])},Sm=({columns:e=gl,onChange:t,className:n,value:s,searchOptions:o,...r})=>{const l=De(),c=is(),a=jl(e),u=_o(),d=j.useMemoDeepEqualProps(o),x=g.useMemo(()=>l==null?void 0:l.channels.newSearcherWithOptions({rangeKey:u,internal:!1,...d}),[l,u,d]),p=l!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:m,onDragEnd:h,...E}=j.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(y=>Bn(y,Z.A(s)),[s]),onDrop:g.useCallback(({items:y})=>{const C=j.filterByType(He,y);if(C.length===0)return[];const P=Z.n([...Z.A(s),...C.map(b=>b.key)]);return t(P,{clickedIndex:null,clicked:null,entries:[]}),C},[t,s])}),v=j.useDraggingState(),w=g.useCallback(({dropped:y})=>{t(Z.A(s).filter(C=>!y.some(P=>P.key===C)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),_=g.useCallback((y,C)=>m([{key:C,type:He}],w),[m,w]),S=g.useCallback(y=>c[y.key]??y.name,[c]);return i.jsxRuntimeExports.jsx(Ot,{className:f.CSS(n,f.CSS.dropRegion(Bn(v,Z.A(s)))),value:s,onTagDragStart:_,onTagDragEnd:h,searcher:x,onChange:t,columns:a,emptyContent:p,entryRenderKey:S,...E,...r})},lt=({columns:e=gl,onChange:t,value:n,className:s,data:o,searchOptions:r,...l})=>{const c=De(),a=is(),u=jl(e),d=_o(),x=j.useMemoDeepEqualProps(r),p=g.useMemo(()=>{if(!(o!=null&&o.length>0))return c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:d,internal:!1,...x})},[c,d,o==null?void 0:o.length,x]),m=c!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),E=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:v,onDragEnd:w,..._}=j.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(P=>Bn(P,Z.o$1(n)),[n]),onDrop:g.useCallback(({items:P})=>{const b=j.filterByType(He,P);return b.length===0?[]:(t(b[0].key,{clickedIndex:null,clicked:null,entries:[]}),b)},[E,t])}),S=j.useDraggingState(),y=g.useCallback(()=>n!=null&&v([{type:He,key:n}]),[v,n]),C=g.useCallback(P=>a[P.key]??P.name,[a]);return i.jsxRuntimeExports.jsx(ct,{data:o,className:f.CSS(s,f.CSS.dropRegion(Bn(S,Z.o$1(n)))),value:n,onDragStart:y,onDragEnd:w,onChange:t,searcher:p,columns:u,emptyContent:m,entryRenderKey:C,..._,...l})},Rm=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:pp,AliasProvider:Zi,LinePlot:pm,SelectMultiple:Sm,SelectSingle:lt,useActiveRange:_o,useAlias:Hi,useAliases:is,useContext:Fi,useName:ls},Symbol.toStringTag,{value:"Module"})),at=({path:e,optional:t=!1,onChange:n})=>{const s=ut(),{get:o,bind:r,set:l,setStatus:c}=s,[a,u]=g.useState(o(e,{optional:t}));g.useEffect(()=>(u(o(e,{optional:t})),r({path:e,onChange:u,listenToChildren:!1})),[e,n,r,o]);const d=g.useCallback(m=>{n==null||n(m,{...s,path:e}),l(e,m)},[e,l,n]),x=g.useCallback(m=>c(e,m),[e,c]);if(a==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let p;return s.mode==="preview"&&(p="preview"),{onChange:d,setStatus:x,variant:p,...a}},El=(e,t=!1,n)=>{const{get:s,bind:o}=ut(n),[,r]=g.useState(0);return g.useEffect(()=>(r(l=>l+1),o({path:e,onChange:()=>r(l=>l+1)})),[e,o]),s(e,{optional:t})??null},wm=(e,t=!1,n)=>{var l;const{get:s,bind:o}=ut(n),[,r]=g.useState(0);return g.useEffect(()=>(r(c=>c+1),o({path:e,onChange:()=>r(c=>c+1)})),[e,o]),((l=s(e,{optional:t}))==null?void 0:l.value)??null},Cm=e=>{var t,n;return((n=(t=El(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},vm=({path:e,ctx:t,onChange:n})=>{const s=ut(t);g.useEffect(()=>s.bind({path:e,onChange:o=>n(o,s),listenToChildren:!1}),[e,s])},bm=({path:e,optional:t=!1})=>{const{bind:n,get:s}=ut(),[o,r]=g.useState(s(e,{optional:t}));if(g.useEffect(()=>(r(s(e,{optional:t})),n({path:e,onChange:l=>r({...l,value:Z.U(l.value)}),listenToChildren:!0})),[e,n,s]),o==null&&!t)throw new Error("Field state is null");return(o==null?void 0:o.value)??null},yl=(e,t)=>({add:(n,s)=>{const o=Z.U(e.get(t).value);o.splice(s,0,...Z.A(n)),e.set(t,o,{validateChildren:!1})},push:(n,s)=>{const o=Z.U(e.get(t).value);o.push(...Z.A(n)),s!=null&&o.sort(s),e.set(t,o,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,o=new Set(Z.A(n));e.set(t,s.filter((r,l)=>!o.has(l)))},keepOnly:n=>{const s=e.get(t).value,o=new Set(Z.A(n));e.set(t,s.filter((r,l)=>o.has(l)))},set:n=>e.set(t,Z.executeSetter(n,e.get(t).value)),sort:n=>{const s=Z.U(e.get(t).value);s.sort(n),e.set(t,s)}}),_m=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=ut(n),{bind:o,get:r}=s,[l,c]=g.useState(r(e).value);return g.useEffect(()=>(c(r(e).value),o({path:e,onChange:a=>{c(Z.U(a.value))},listenToChildren:t})),[e,o,r,c]),g.useMemo(()=>({value:l,...yl(s,e)}),[l,s,e])},Bo=g.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),ut=e=>{const t=g.useContext(Bo);return e??t},br=e=>({key:e,variant:"success",message:""}),km=e=>e.code===ue.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",Sl=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:o})=>{const r=g.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),l=j.useSyncedRef(n),c=j.useSyncedRef(o),a=g.useCallback(({path:C,onChange:P,listenToChildren:b=!1})=>{var O;const{parentListeners:T,listeners:N}=r.current,A=b?T:N;return A.has(C)||A.set(C,new Set),(O=A.get(C))==null||O.add(P),()=>{var L;return(L=A.get(C))==null?void 0:L.delete(P)}},[]),u=g.useCallback((C,{optional:P}={optional:!1})=>{const{state:b,statuses:T,touched:N}=r.current,A=Z._.get(b,C,{optional:P});if(A==null)return null;const O={value:A,status:T.get(C)??br(C),touched:N.has(C),required:!1};if(l.current==null)return O;const L=l.current,D=Z.N.getFieldSchema(L,C,{optional:!0});return D==null||(O.required=!D.isOptional()),O},[]),d=g.useCallback(C=>{const{state:P,statuses:b,touched:T,listeners:N,parentListeners:A}=r.current;Z._.remove(P,C),b.delete(C),T.delete(C),N.delete(C),A.delete(C)},[]),x=g.useCallback(C=>{const{statuses:P,touched:b}=r.current;r.current.state=C,m(""),P.clear(),b.clear()},[]),p=g.useCallback(C=>{var T;const{listeners:P}=r.current,b=u(C,{optional:!0});b!=null&&((T=P.get(C))==null||T.forEach(N=>N(b)))},[]),m=g.useCallback(C=>{const{listeners:P,parentListeners:b}=r.current,T=P.get(C);if(C==""&&([...P.keys()].forEach(O=>{var D;const L=u(O,{optional:!0});L!=null&&((D=P.get(O))==null||D.forEach(R=>{R(L)}))}),[...b.keys()].forEach(O=>{var D;const L=u(O,{optional:!0});L!=null&&((D=b.get(O))==null||D.forEach(R=>{R(L)}))})),T!=null){const N=u(C,{optional:!0});N!=null&&T.forEach(A=>{A(N)})}b.forEach((N,A)=>{if(Z._.pathsMatch(C,A)){const L=u(A,{optional:!0});L!=null&&N.forEach(D=>{D(L)})}})},[]),h=g.useCallback((C,P="",b=!0)=>{const{statuses:T,listeners:N,touched:A}=r.current;if(C.success){const R=[...T.keys()];return T.clear(),R.forEach(I=>p(I)),!0}let O=!0;const L=new Set(C.error.issues.map(R=>R.path.join(".")));let D=(R,I)=>R===I;return b&&(D=(R,I)=>Z._.pathsMatch(R,I)),C.error.issues.forEach(R=>{var z;const{message:I}=R,k=R.path.join(".");if(!D(k,P))return;const B=km(R);B!=="warning"&&(O=!1),T.set(k,{key:k,variant:B,message:I}),A.add(k);let M=u(k,{optional:!0});M??(M={value:void 0,status:T.get(k)??br(k),touched:!1,required:!1}),(z=N.get(k))==null||z.forEach(V=>V(M))}),T.forEach((R,I)=>{L.has(I)||(T.delete(I),p(I))}),O},[]),E=g.useCallback((C,P)=>{if(l.current==null)return!0;const{state:b}=r.current,T=l.current.safeParse(b);return h(T,C,P)},[h]),v=g.useCallback(async(C,P)=>{if(l.current==null)return!0;const{state:b}=r.current,T=await l.current.safeParseAsync(b);return h(T,C,P)},[h]),w=g.useCallback((C,P,b={})=>{const T=Z._.get(r.current.state,C,{optional:!0}),{validateChildren:N=!0}=b,{state:A,touched:O}=r.current;O.add(C),C.length===0?r.current.state=P:Z._.set(A,C,P),m(C),(async()=>{var D;let L;try{L=E(C,N)}catch{L=await v(C,N)}(D=c.current)==null||D.call(c,{values:r.current.state,path:C,prev:T,valid:L})})()},[]),_=g.useCallback(C=>Z._.has(r.current.state,C),[]),S=g.useCallback((C,P)=>{r.current.statuses.set(C,P),r.current.touched.add(C),p(C)},[]),y=g.useCallback(()=>{const{statuses:C}=r.current;C.clear(),C.forEach((P,b)=>p(b))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:C}=r.current;r.current.state=e,C.forEach((P,b)=>{const T=u(b,{optional:!0});T!=null&&P.forEach(N=>N(T))})},[t,e]),g.useMemo(()=>({bind:a,set:w,get:u,mode:s,validate:E,validateAsync:v,value:()=>r.current.state,has:_,remove:d,setStatus:S,clearStatuses:y,reset:x}),[a,w,u,E,v,_,d,S,y,x,s])},Pm=e=>i.jsxRuntimeExports.jsx(Bo.Provider,{value:e,children:e.children}),Mm=j.componentRenderProp(j.Text$1),ye=({path:e,children:t=Mm,label:n,padHelpText:s=!0,visible:o=!0,hideIfNull:r=!1,optional:l,onChange:c,className:a,...u})=>{const d=at({path:e,optional:l??r,onChange:c}),x=ut();if(d==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??(n=f._$1.capitalize(Z._.element(e,-1))),o=typeof o=="function"?o(d,x):o,!o)return null;const p=d.status.message,{onChange:m,value:h}=d,E={onChange:m,value:h};return d.variant!=null&&(E.variant=d.variant),i.jsxRuntimeExports.jsx($e.Item,{padHelpText:s,helpText:p,helpTextVariant:d.status.variant,label:n,required:d.required,className:f.CSS(a,f.CSS.BE("field",e.split(".").join("-")),f.CSS.M(d.status.variant)),...u,children:t(E)})},Rt=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const o=({inputProps:r,path:l,fieldKey:c=t,...a})=>i.jsxRuntimeExports.jsx(ye,{...n,...a,path:c?`${l}.${c}`:l,children:u=>i.jsxRuntimeExports.jsx(e,{...u,...s,...r})});return o.displayName=e.displayName,o},Rl=Rt(j.Numeric),us=Rl({}),wl=Rt(j.Text$1),Cl=wl({}),vl=Rt(j.Switch$1),Do=vl({}),Nm=Rt(ct),Lm=Rt(Ot),Tm=Rt(Pe.DropdownButton),zo=({key:e,open:t,onChange:n})=>{const s=j.useMemoPrimitiveArray(e);j.useAsyncEffect(async()=>{if(t==null)return;const o=await t();if(o!=null)return o.onChange(n),async()=>await o.close()},[t==null,s])},Am=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return j.useAsyncEffect(async()=>{s(await e())},[e]),zo({...t,onChange:s}),n},$m=Object.freeze(Object.defineProperty({__proto__:null,useListener:zo,useState:Am},Symbol.toStringTag,{value:"Module"})),Im=({key:e,name:t,queryFn:n,values:s,openObservable:o,applyChanges:r,applyObservable:l,...c})=>{const a=De(),u=j.useAggregator(),d=j.useMemoPrimitiveArray(e),x=Sl({values:s,...c,sync:!1,onChange:h=>{a!=null&&(async()=>{try{await(r==null?void 0:r({...h,client:a}))}catch(E){u({variant:"error",message:`Failed to save ${t}`,description:E.message})}})()}});j.useAsyncEffect(async()=>{if(a!=null)try{const h=await n({client:a});x.set("",h)}catch(h){u({variant:"error",message:`Failed to retrieve ${t}`,description:h.message})}},[d,a==null?void 0:a.key]);const p=g.useCallback(async()=>{if(a!=null)return await(o==null?void 0:o(a))},[d,a==null?void 0:a.key]),m=g.useCallback(h=>l==null?void 0:l({changes:h,ctx:x}),[d,l]);return zo({key:d,open:p,onChange:m}),x},Om=Object.freeze(Object.defineProperty({__proto__:null,Context:Bo,Field:ye,Form:Pm,NumericField:us,SwitchField:Do,TextField:Cl,buildDropdownButtonSelectField:Tm,buildNumericField:Rl,buildSelectMultiField:Lm,buildSelectSingleField:Nm,buildSwitchField:vl,buildTextField:wl,fieldArrayUtils:yl,fieldBuilder:Rt,use:Sl,useChildFieldValues:bm,useContext:ut,useField:at,useFieldArray:_m,useFieldListener:vm,useFieldState:El,useFieldValid:Cm,useFieldValue:wm,useSynced:Im},Symbol.toStringTag,{value:"Module"})),Bm=[{key:"name",name:"Name"},{key:"location",name:"Location"}],Dm=({searchOptions:e,...t})=>{const n=De();let s=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(s=n.hardware.devices.newSearcherWithOptions(e)),i.jsxRuntimeExports.jsx(ct,{columns:Bm,searcher:s,entryRenderKey:"name",...t})},zm=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Dm},Symbol.toStringTag,{value:"Module"})),kt="label",Vo=[{key:"color",name:"Color",render:({entry:e})=>i.jsxRuntimeExports.jsx(j.Qt.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Dn=({items:e},t)=>{const n=j.filterByType(kt,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Vm=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...o})=>i.jsxRuntimeExports.jsx(en,{color:e==null?void 0:e.color,...o,children:e==null?void 0:e.name}),Fm=j.componentRenderProp(Vm),Hm=({onChange:e,className:t,value:n,...s})=>{const o=De(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=j.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(p=>Dn(p,Z.A(n)),[n]),onDrop:g.useCallback(({items:p})=>{const m=j.filterByType(kt,p);if(m.length===0)return[];const h=Z.n([...Z.A(n),...m.map(E=>E.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=j.useDraggingState(),d=g.useCallback(({dropped:p})=>{e(Z.A(n).filter(m=>!p.some(h=>h.key===m)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),x=g.useCallback((p,m)=>l([{key:m,type:kt}],d),[l,d]);return i.jsxRuntimeExports.jsx(Ot,{className:f.CSS(t,f.CSS.dropRegion(Dn(u,Z.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.labels,onChange:e,columns:Vo,emptyContent:r,renderTag:Fm,addPlaceholder:"Label",...a,...s})},bl=({value:e,onChange:t})=>{const n=De(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=g.useId(),r=g.useMemo(()=>({key:o,type:"Label.SelectMultiple"}),[o]),l=j.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(u=>Dn(u,Z.o$1(e)),[e]),onDrop:g.useCallback(({items:u})=>{const d=j.filterByType(kt,u);return d.length===0?[]:(t(d[0].key,{clickedIndex:null,clicked:null,entries:[]}),d)},[r,t])}),c=j.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:kt,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},Zm=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=bl({value:t,onChange:e});return i.jsxRuntimeExports.jsx(ct,{data:s,className:f.CSS(n,f.CSS.dropRegion(Dn(r,Z.o$1(t)))),value:t,onChange:e,columns:Vo,entryRenderKey:"name",...l,...o})},Ym=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=bl({value:t,onChange:n});return i.jsxRuntimeExports.jsx(ct,{data:e,value:t,onChange:n,columns:Vo,entryRenderKey:"name",...r,...s})},qm=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:kt,SelectButton:Ym,SelectMultiple:Hm,SelectSingle:Zm},Symbol.toStringTag,{value:"Module"})),_l=({children:e,centered:t,visible:n,enabled:s=!0,close:o,style:r,...l})=>{const c=g.useRef(null),a=g.useRef(n);j.useClickOutside({ref:c,exclude:d=>j.findParent(d.target,p=>p.getAttribute("role")==="dialog")!=null,onClickOutside:o});const u=g.useCallback(d=>{var p;if(!a.current||d.stage!=="start")return;const x=(p=c.current)==null?void 0:p.querySelectorAll(`.${f.CSS.visible(!0)}`);x&&x.length>0||o()},[o]);return j.use$1({triggers:[["Escape"]],callback:u,loose:!0}),i.jsxRuntimeExports.jsx(te.Space,{className:f.CSS(f.CSS.BE("modal","bg"),f.CSS.visible(n),s&&f.CSS.M("enabled-modal")),empty:!0,align:"center",children:i.jsxRuntimeExports.jsx(te.Space,{className:f.CSS(f.CSS.BE("modal","dialog"),t&&f.CSS.M("centered")),role:"dialog",empty:!0,ref:c,...l,style:{zIndex:s?11:void 0,...r},children:i.jsxRuntimeExports.jsx(te.Space,{className:f.CSS(f.CSS.BE("modal","content")),empty:!0,children:e})})})},Wm=({root:e,...t})=>Co.createPortal(i.jsxRuntimeExports.jsx(_l,{...t}),j.getRootElement(e)),Xm=Object.freeze(Object.defineProperty({__proto__:null,Dialog:_l,Modal:Wm},Symbol.toStringTag,{value:"Module"})),ds=new Error("Tab not found"),Km=new Error("Invalid Mosaic"),zn=(e,t,n="center",s)=>{var x;if(e=Qe(e),s===void 0)return eo(e,t);const o=to(e,s);if(n==="center")return(x=o.tabs)==null||x.push(t),o.selected=t.tabKey,e;const r=o.key*2,l=o.key*2+1,c=n==="top"||n==="left"?r:l;if(to(e,c).key!==o.key)return zn(e,t,"center",c);if(o.tabs==null||o.tabs.length===0)return zn(e,t,"center",s);const[a,u,d]=th(n);if(o.direction=d,o[a]={key:0,tabs:[t],selected:t.tabKey},o[u]={key:0,tabs:o.tabs,selected:o.selected},o.first==null||o.last==null)throw Km;return o.first.key=r,o.last.key=l,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},Gm=(e,t,n)=>{var r;e=Qe(e);const[s,o]=gt(e,t);if(s==null||o==null)throw ds;return o.tabs=(r=o.tabs)==null?void 0:r.map(l=>l.tabKey===t?n(l):l),e},eo=(e,t)=>(e=Qe(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=eo(e.first,t):e.last!=null&&(e.last=eo(e.last,t)),e)),Vn=e=>{e=Qe(e);const t=[];if(e.tabs!=null&&(e.selected=Ce.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=Vn(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=Vn(e.last);e.last=n,t.push(...s)}return[e,t]},Fo=(e,t)=>{var o;e=Qe(e);const[,n]=gt(e,t);if(n==null)return[e,null];n.tabs=(o=n.tabs)==null?void 0:o.filter(r=>r.tabKey!==t),n.selected=Ce.resetSelection(n.selected,n.tabs),e=eh(e);const s=n.selected??Fn(e);return[e,s]},Fn=e=>e.selected!=null?e.selected:e.first!=null?Fn(e.first):e.last!=null?Fn(e.last):null,kl=(e,t)=>{e=Qe(e);const[n,s]=gt(e,t);if(n==null||s==null)throw ds;return s.selected=t,e},Pl=(e,t,n,s)=>{e=Qe(e);const[o,r]=gt(e,t);if(o==null||r==null)throw ds;const[l,c]=Fo(e,t);return[zn(l,o,n,s),c]},tn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=tn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=tn(e.last,t);if(n!=null)return n}},Ml=(e,t,n)=>{const s=Hn(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},Um=(e,t,n)=>{e=Qe(e);const s=tn(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const o=s.tabs.findIndex(d=>d.tabKey===t);if(o===-1)throw new Error("Tab not found in node");const r=s.tabs[o];s.tabs=s.tabs.filter(d=>d.tabKey!==t);const l=s.key*2,a={key:s.key*2+1,tabs:[r],selected:r.tabKey},u={key:l,tabs:s.tabs,selected:s.selected};return u.selected=Ce.resetSelection(u.selected,u.tabs),s.direction=n,s.first=u,s.last=a,s.tabs=void 0,s.selected=void 0,e},Qm=(e,t)=>{const n=tn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Nl=(e,t,n)=>{e=Qe(e);const[,s]=gt(e,t);if((s==null?void 0:s.tabs)==null)throw ds;return s.tabs=Ce.rename(t,n,(s==null?void 0:s.tabs)??[]),e},Jm=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,to=(e,t)=>{const n=Hn(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:to(e,s)},eh=e=>{let t=!0;for(;t;)[e,t]=no(e);return e.first==null&&e.last==null&&(e.key=1),e},no=e=>{if(e.first==null||e.last==null)return[e,!1];if(kr(e.first))return[_r(e.last,!0),!0];if(kr(e.last))return[_r(e.first,!1),!0];let t,n;return[e.first,t]=no(e.first),[e.last,n]=no(e.last),[e,t||n]},_r=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),kr=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),gt=(e,t)=>{if(e.tabs!=null){const l=e.tabs.find(c=>c.tabKey===t);if(l!=null)return[l,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=gt(e.first,t);if(n!=null&&s!=null)return[n,s];const[o,r]=gt(e.last,t);return[o,r]},Hn=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=Hn(e.first,t);return n??Hn(e.last,t)},th=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},Qe=e=>Z._.copy(e),Zn=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&Zn(e.first,t,n),e.last!=null&&Zn(e.last,t,n),n),so=(e,t)=>{t(e),e.first!=null&&so(e.first,t),e.last!=null&&so(e.last,t)};class Ll{constructor(t={}){Fe(this,"parent");Fe(this,"stub");Fe(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([n,s])=>this.el.setAttribute(n,s))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const nh=({node:e})=>{const t=g.createRef(),n=g.useRef(e);return g.useEffect(()=>{const s=t.current;if(s==null)return;const o=s.parentNode;if(o!=null)return e.mount(o,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),g.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const s=t.current;if(s==null)return;const o=s.parentNode;o!=null&&e.mount(o,s)},[e]),i.jsxRuntimeExports.jsx("div",{ref:t})},Tl=({node:e,children:t})=>Co.createPortal(t,e.el),sh=Object.freeze(Object.defineProperty({__proto__:null,In:Tl,Node:Ll,Out:nh},Symbol.toStringTag,{value:"Module"})),Yn=g.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:s,direction:o,first:r,last:l,key:c,size:a},emptyContent:u,...d}=n,x=g.useCallback(([h])=>t(c,h),[t]),{props:p}=vo({direction:o,onResize:x,count:2,initialSizes:a!=null?[a]:void 0});let m;return s!==void 0?m=i.jsxRuntimeExports.jsx(Al,{emptyContent:u,...n}):r!=null&&l!=null?m=i.jsxRuntimeExports.jsxs(os,{id:`mosaic-${c}`,align:"stretch",className:f.CSS.BE("mosaic","resize"),...p,children:[i.jsxRuntimeExports.jsx(Yn,{...d,root:r,onResize:t},r.key),i.jsxRuntimeExports.jsx(Yn,{...d,root:l,onResize:t},l.key)]}):(m=null,console.warn("Mosaic tree is malformed")),c===1?i.jsxRuntimeExports.jsx(j.Provider$2,{children:m}):m});Yn.displayName="Mosaic";const qn="pluto-mosaic-tab-drop",Ho="pluto-mosaic-tab-create",oh=(e,t,n)=>{if(j.filterByType(j.FILE_TYPE,t).length>0&&n)return!0;const o=j.filterByType(qn,t).map(c=>c.key),r=e.filter(c=>!o.includes(c.tabKey)).length>0;return j.filterByType(Ho,t).length>0||o.length>0&&(r||e.length===0)},Al=g.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:o,onFileDrop:r,...l})=>{const{key:c,tabs:a}=e,[u,d]=g.useState(null),x=r!=null,p=g.useCallback(({items:C})=>oh(a,C,x),[a,x]),m=g.useCallback(({items:C,event:P})=>{if(P==null)return[];d(null);const b=j.filterByType(j.FILE_TYPE,C).length>0,T=a.length===0?"center":Mr(Pr(P));if(b)return r==null||r(c,T,P),C;const N=j.filterByType(qn,C);if(N.length>0){const O=N.map(({key:L})=>L)[0];t(c,O,T)}const A=j.filterByType(Ho,C);if(A.length>0){const O=A.map(({key:L})=>L);n==null||n(c,T,O)}return N},[t,a.length]),h=g.useCallback(({event:C})=>{if(C==null)return;const P=a.length===0?"center":Mr(Pr(C));d(P)},[a.length]),{startDrag:E,...v}=j.useDragAndDrop({type:"Mosaic",canDrop:p,onDrop:m,onDragOver:h}),w=p(j.useDraggingState()),_=g.useCallback(()=>d(null),[]),S=g.useCallback((C,{tabKey:P})=>{E([{key:P,type:qn,elementID:C.currentTarget.id}])},[E]),y=g.useCallback(()=>n==null?void 0:n(c,"center"),[c]);return i.jsxRuntimeExports.jsxs("div",{id:`mosaic-${c}`,className:f.CSS.BE("mosaic","leaf"),children:[i.jsxRuntimeExports.jsxs(Ce.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:_,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:S,onCreate:y,...l,...v,children:[e.selected!=null&&o(a.find(C=>C.tabKey===e.selected)),w&&i.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),u!=null&&i.jsxRuntimeExports.jsx("div",{className:f.CSS.BE("mosaic","mask"),style:rh[u]})]})});Al.displayName="MosaicTabLeaf";const rh={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},Pr=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{px:.5,py:.5}:{px:n/t.width,py:s/t.height}},ih=e=>e,lh=e=>1-e,Mr=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[ih(e),lh(e)];if(t>n&&t>s)return"bottom";if(t<n&&t<s)return"top";if(t>n&&t<s)return"left";if(t<n&&t>s)return"right";throw new Error("[bug] - invalid insert position")},ch=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),o=new Set,r=Zn(e,l=>{var c;return(c=l.tabs)==null?void 0:c.map(a=>{let u=s.current.get(a.tabKey);return a==null?null:(u==null&&(u=new Ll({style:"width: 100%; height: 100%; position: relative;"}),u.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,u)),o.add(a.tabKey),i.jsxRuntimeExports.jsx(Tl,{node:u,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})}).flat().filter(l=>l!=null);return s.current.forEach((l,c)=>!o.has(c)&&s.current.delete(c)),[s,r]},ah=ue.z.object({key:ue.z.number(),tabs:ue.z.array(Ce.tabZ).optional(),selected:ue.z.string().optional(),direction:f.g.direction.optional(),size:ue.z.number().optional()}),oo=ah.extend({first:ue.z.lazy(()=>oo).optional(),last:ue.z.lazy(()=>oo).optional()}),uh=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(Vn(t)[0]),[t]),{root:n,onDrop:(u,d,x)=>s(p=>Pl(p,d,x,u)[0]),onClose:u=>s(d=>Fo(d,u)[0]),onSelect:u=>s(d=>kl(d,u)),onResize:(u,d)=>s(x=>Ml(x,u,d)),onRename:e?(u,d)=>s(x=>Nl(x,u,d)):void 0}},dh=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Ho,HAUL_DROP_TYPE:qn,Mosaic:Yn,autoSelectTabs:Vn,canSplit:Qm,findSelected:Fn,findTabNode:tn,forEachNode:so,insertTab:zn,isEmpty:Jm,mapNodes:Zn,moveTab:Pl,nodeZ:oo,removeTab:Fo,renameTab:Nl,resizeNode:Ml,selectTab:kl,split:Um,updateTab:Gm,use:uh,usePortal:ch},Symbol.toStringTag,{value:"Module"})),xh=({location:e="left",size:t="9rem",className:n,style:s,...o})=>{const r=f.J.construct(e),l=f.J.direction(r),c=f.g.swap(l);return i.jsxRuntimeExports.jsx(te.Space,{className:f.CSS(f.CSS.B("navbar"),f.CSS.bordered(f.J.swap(r)),f.CSS.dir(c),f.CSS.loc(r),n),direction:c,style:{[f.g.dimension(l)]:t,...s},align:"center",empty:!0,...o})},xn=e=>({bordered:t=!1,className:n,...s})=>i.jsxRuntimeExports.jsx(te.Space,{className:f.CSS(f.CSS.BE("navbar","content"),e==="absolute-center"?f.CSS.M(e):f.CSS.align(e),e!==""&&t&&f.CSS.bordered(e),n),align:"center",...s}),$l=xn("start");$l.displayName="NavbarStart";const Il=xn("end");Il.displayName="NavbarEnd";const Ol=xn("center");Ol.displayName="NavbarCenter";const Bl=xn("");Bl.displayName="NavbarContent";const Dl=xn("absolute-center");Dl.displayName="NavbarAbsoluteCenter";const Bt=xh;Bt.Start=$l;Bt.Center=Ol;Bt.End=Il;Bt.AbsoluteCenter=Dl;Bt.Content=Bl;const Zo=({aetherKey:e})=>{const[,{region:t},n]=j.use$3({aetherKey:e,type:$.Eraser$1.TYPE,schema:$.eraserStateZ,initialState:{region:f.Eo.ZERO,enabled:!0}}),s=j.useSyncedRef(t),o=g.useCallback(l=>{f.Eo.equals(l,s.current)||n(c=>({...c,region:l}))},[n]);return{setEnabled:g.useCallback(l=>n(c=>({...c,enabled:l})),[n]),erase:o}},fh=j.wrap$1($.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:n}=Zo({aetherKey:e}),s=j.useResize(n);return i.jsxRuntimeExports.jsx("div",{ref:s,className:f.CSS(f.CSS.inheritDims()),children:t})}),ph=Object.freeze(Object.defineProperty({__proto__:null,Eraser:fh,use:Zo},Symbol.toStringTag,{value:"Module"})),mh=({items:e,initialKey:t})=>{const[n,s]=g.useState(t),o=l=>s(l===n?void 0:l),r=e.find(l=>l.key===n);return{onSelect:o,activeItem:r}},hh=j.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:n,onSelect:s,location:o="left",collapseThreshold:r=.65,className:l,onResize:c,...a})=>{const u=f.J.direction(o),d=g.useCallback(()=>t!=null&&(s==null?void 0:s(t.key)),[s,t==null?void 0:t.key]),{erase:x,setEnabled:p}=Zo({aetherKey:e}),m=g.useCallback((w,_)=>{c==null||c(w,_),x(_)},[c,x]);if(g.useLayoutEffect(()=>{p(t!=null)},[t,p]),t==null)return null;const{content:h,key:E,...v}=t;return i.jsxRuntimeExports.jsx(Bi,{className:f.CSS(f.CSS.BE("navdrawer","content"),f.CSS.dir(u),l),collapseThreshold:r,onCollapse:d,location:o,onResize:m,...v,...a,children:t.content},E)}),gh=Object.freeze(Object.defineProperty({__proto__:null,Bar:Bt,Drawer:hh,useDrawer:mh},Symbol.toStringTag,{value:"Module"})),jh=({variant:e,className:t,children:n,...s})=>i.jsxRuntimeExports.jsx(te.Space,{className:f.CSS(t,f.CSS.B("note"),f.CSS.M(e)),align:"stretch",empty:!0,...s,children:n}),Eh=Object.freeze(Object.defineProperty({__proto__:null,Note:jh},Symbol.toStringTag,{value:"Module"})),Os={Close:i.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),i.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:i.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:i.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),i.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},yh=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:o,onFullscreen:r,onClose:l,...c})=>i.jsxRuntimeExports.jsxs(te.Space,{size:1.5,direction:"x",className:f.CSS(f.CSS.B("macos-controls"),!n&&f.CSS.BM("macos-controls","blurred"),t),...c,children:[i.jsxRuntimeExports.jsx(Bs,{onClick:l,className:f.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Os.Close}),i.jsxRuntimeExports.jsx(Bs,{onClick:s,className:f.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Os.Minimize}),i.jsxRuntimeExports.jsx(Bs,{onClick:r,className:f.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Os.Maximize})]}),Bs=({className:e,disabled:t,color:n,...s})=>i.jsxRuntimeExports.jsx("button",{className:f.CSS(f.CSS.B("macos-control"),f.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),Ds=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:o,focused:r,...l})=>i.jsxRuntimeExports.jsxs(te.Pack,{...l,children:[i.jsxRuntimeExports.jsx(zs,{className:f.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:i.jsxRuntimeExports.jsx(j.Qt.Subtract,{})}),i.jsxRuntimeExports.jsx(zs,{className:f.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:i.jsxRuntimeExports.jsx(j.Qt.Box,{})}),i.jsxRuntimeExports.jsx(zs,{onClick:s,className:f.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:i.jsxRuntimeExports.jsx(j.Qt.Close,{})})]}),zs=({disabled:e=!1,className:t,...n})=>e?null:i.jsxRuntimeExports.jsx(j.Icon,{className:f.CSS(f.CSS.B("windows-control"),t),tabIndex:-1,...n}),zl=e=>Z.w.getOS(e),Sh={MacOS:yh,Windows:Ds,Linux:Ds,Docker:Ds},Rh="Windows",wh=({forceOS:e,visibleIfOS:t,...n})=>{const s=zl({force:e,default:Rh}),o=Sh[s];return t!=null&&t!==s?null:i.jsxRuntimeExports.jsx(o,{...n})},Ch=Object.freeze(Object.defineProperty({__proto__:null,Controls:wh,use:zl},Symbol.toStringTag,{value:"Module"})),vh=(e,t)=>{const n=s=>i.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},bh=Object.freeze(Object.defineProperty({__proto__:null,createComponent:vh},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:Z.B$1.NOOP});const _h=j.wrap$1($.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const s=j.useMemoDeepEqualProps(n),[{path:o},,r]=j.use$3({aetherKey:e,type:$.Provider$2.TYPE,schema:$.providerStateZ$1,initialState:s});return g.useEffect(()=>{r(s)},[s,r]),i.jsxRuntimeExports.jsx(j.Composite,{path:o,children:t})}),kh="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Vl=j.wrap$1($.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=j.use$3({aetherKey:t,type:$.BaseProvider.TYPE,schema:$.providerStateZ$2,initialState:{}});return i.jsxRuntimeExports.jsx(j.Composite,{path:n,children:e})}),Ph=Object.freeze(Object.defineProperty({__proto__:null,Provider:Vl},Symbol.toStringTag,{value:"Module"})),Mh=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===Z.Og.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Fl=j.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:s,...o})=>{const r=j.useMemoDeepEqualProps({source:t,sink:n}),[,{status:l},c]=j.use$3({aetherKey:e,type:$.Chip.TYPE,schema:$.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:Z.m.now()}}});g.useEffect(()=>{c(m=>({...m,...r}))},[r,c]);const a=g.useCallback(()=>c(m=>({...m,triggered:!m.triggered})),[c]),{message:u,chipColor:d,buttonStyle:x,disabled:p}=Mh(l);return i.jsxRuntimeExports.jsx(j.Icon,{variant:"text",className:f.CSS(f.CSS.B("control-chip"),s),disabled:p,onClick:a,tooltip:i.jsxRuntimeExports.jsx(j.Text,{level:"small",children:u}),style:x,...o,children:i.jsxRuntimeExports.jsx(j.Qt.Circle,{color:d})})}),Hl=g.createContext({needsControlOf:[]}),Zl=()=>g.useContext(Hl),Nh=j.wrap$1($.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...s})=>{const o=j.useMemoDeepEqualProps(s),[{path:r},{status:l,needsControlOf:c},a]=j.use$3({aetherKey:e,type:$.Controller$1.TYPE,schema:$.controllerStateZ,initialState:o});return g.useEffect(()=>{l!=null&&(n==null||n(l))},[l,n]),g.useEffect(()=>{a(u=>({...u,...o}))},[o,a]),g.useEffect(()=>()=>n==null?void 0:n("released"),[]),i.jsxRuntimeExports.jsxs(Hl.Provider,{value:{needsControlOf:c},children:[i.jsxRuntimeExports.jsx(j.Composite,{path:r,children:t}),";"]})}),Yl=j.wrap$1($.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var a;const s=j.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:o,status:r},l]=j.use$3({aetherKey:e,type:$.Indicator.TYPE,initialState:{...s,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:Z.m.now()}},schema:$.indicatorStateZ});g.useEffect(()=>{l(u=>({...u,...s}))},[s,l]);let c;return((a=r.data)==null?void 0:a.color)!=null?c=f.Color.z.parse(r.data.color):o!=null&&!o.isZero?c=o:c="var(--pluto-gray-l8)",i.jsxRuntimeExports.jsxs(j.Dialog$1,{location:{x:"center",y:"bottom"},children:[i.jsxRuntimeExports.jsx(j.Text,{level:"p",children:r.message}),i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("indicator"),style:{backgroundColor:f.cssString(c),flexGrow:1}})]})}),Lh=j.wrap$1($.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=Zl(),[,{states:s},o]=j.use$3({aetherKey:e,type:$.Legend.TYPE,schema:$.legendStateZ,initialState:{states:[],needsControlOf:n}});g.useEffect(()=>{o(c=>({...c,needsControlOf:n}))},[n]);const l=Z.n(s.map(c=>c.subject.key)).map(c=>{const a=s.find(u=>u.subject.key===c);if(a==null)throw new Z.Ce("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return i.jsxRuntimeExports.jsx(No,{data:l,...t})}),ql=j.wrap$1($.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=j.use$3({aetherKey:e,type:$.StateProvider.TYPE,schema:$.stateProviderStateZ,initialState:{}});return i.jsxRuntimeExports.jsx(j.Composite,{path:n,children:t})}),Th=Object.freeze(Object.defineProperty({__proto__:null,Chip:Fl,Controller:Nh,Indicator:Yl,Legend:Lh,StateProvider:ql,useContext:Zl},Symbol.toStringTag,{value:"Module"})),Wl=e=>{const t=({disabled:n=!1,...s})=>n?s.children:i.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},Ah=Wl(Vl),$h=Wl(j.Provider$3),Ih=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:o,tooltip:r,triggers:l,alamos:c,haul:a,channelAlias:u,telem:d})=>i.jsxRuntimeExports.jsx(j.Provider$1,{...l,children:i.jsxRuntimeExports.jsx(j.Config,{...r,children:i.jsxRuntimeExports.jsx(j.Provider$2,{...a,children:i.jsxRuntimeExports.jsx(j.Provider$4,{url:s??kh,enabled:n,children:i.jsxRuntimeExports.jsx($h,{workerKey:"vis",children:i.jsxRuntimeExports.jsx(_h,{...c,children:i.jsxRuntimeExports.jsx(j.Aggregator,{children:i.jsxRuntimeExports.jsx(Vi,{connParams:t,children:i.jsxRuntimeExports.jsx(Zi,{...u,children:i.jsxRuntimeExports.jsx(Ah,{...d,children:i.jsxRuntimeExports.jsx(j.Provider,{...o,children:i.jsxRuntimeExports.jsx(ql,{children:e})})})})})})})})})})})}),Oh=Object.freeze(Object.defineProperty({__proto__:null,Provider:Ih},Symbol.toStringTag,{value:"Module"})),Bh=({value:e})=>i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("progress"),children:i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Dh=Object.freeze(Object.defineProperty({__proto__:null,Progress:Bh},Symbol.toStringTag,{value:"Module"})),nn="range",Yo=[{key:"name",name:"Name"}],Wn=({items:e},t)=>{const n=j.filterByType(nn,e);return n.length>0&&!n.every(s=>t.includes(s.key))},zh=({onChange:e,className:t,value:n,...s})=>{const o=De(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=j.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(p=>Wn(p,Z.A(n)),[n]),onDrop:g.useCallback(({items:p})=>{const m=j.filterByType(nn,p);if(m.length===0)return[];const h=Z.n([...Z.A(n),...m.map(E=>E.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=j.useDraggingState(),d=g.useCallback(({dropped:p})=>{e(Z.A(n).filter(m=>!p.some(h=>h.key===m)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),x=g.useCallback((p,m)=>l([{key:m,type:nn}],d),[l,d]);return i.jsxRuntimeExports.jsx(Ot,{className:f.CSS(t,f.CSS.dropRegion(Wn(u,Z.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.ranges,onChange:e,columns:Yo,emptyContent:r,entryRenderKey:"name",...a,...s})},Xl=({value:e,onChange:t})=>{const n=De(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=g.useId(),r=g.useMemo(()=>({key:o,type:"Ranger.SelectMultiple"}),[o]),{startDrag:l,...c}=j.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(d=>Wn(d,Z.o$1(e)),[e]),onDrop:g.useCallback(({items:d})=>{const x=j.filterByType(nn,d);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[r,t])}),a=j.useDraggingState(),u=g.useCallback(()=>e!=null&&l([{type:nn,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:u,searcher:n==null?void 0:n.ranges}},Vh=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=Xl({value:t,onChange:e});return i.jsxRuntimeExports.jsx(ct,{data:s,className:f.CSS(n,f.CSS.dropRegion(Wn(r,Z.o$1(t)))),value:t,onChange:e,columns:Yo,entryRenderKey:"name",...l,...o})},Fh=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=Xl({value:t,onChange:n});return i.jsxRuntimeExports.jsx(ct,{data:e,value:t,onChange:n,columns:Yo,entryRenderKey:"name",...r,...s})},Hh=[{key:"color",name:"Color",width:50,render:e=>i.jsxRuntimeExports.jsx(j.Qt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Zh=e=>{const t=De();return i.jsxRuntimeExports.jsx(Ot,{...e,searcher:t==null?void 0:t.labels,columns:Hh,renderTag:n=>n.entry==null?i.jsxRuntimeExports.jsx(en,{color:"gray",children:n.entryKey}):i.jsxRuntimeExports.jsx(en,{color:n.entry.color,children:n.entry.name})})},Yh=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...o})=>{const r=new Z.m(e.start),l=r.isToday?"time":"dateTime",c=new Z.m(e.end),a=c.equals(Z.m.MAX),u=c.span(r)<Z.y.DAY?"time":"dateTime",d=r.span(c);return i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",size:"small",className:f.CSS(f.CSS.B("time-range-chip")),align:"center",...o,children:[r.isToday&&i.jsxRuntimeExports.jsx(j.Text,{level:t,shade:n,weight:450,children:"Today"}),i.jsxRuntimeExports.jsx(j.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:r}),i.jsxRuntimeExports.jsx(j.Qt.Arrow.Right,{color:"var(--pluto-text-color)"}),a?i.jsxRuntimeExports.jsx(j.Text,{level:t,children:"Now"}):i.jsxRuntimeExports.jsx(j.DateTime,{level:t,displayTZ:"local",format:u,shade:n,weight:450,children:c}),!d.isZero&&s&&i.jsxRuntimeExports.jsxs(j.Text,{level:t,shade:n,weight:450,children:["(",r.span(c).truncate(Z.y.MILLISECOND).toString(),")"]})]})},qh=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Fh,SelectLabels:Zh,SelectMultiple:zh,SelectSingle:Vh,TimeRangeChip:Yh},Symbol.toStringTag,{value:"Module"})),Wh=({steps:e,value:t,onChange:n,...s})=>{const o=e.findIndex(r=>r.key===t);return i.jsxRuntimeExports.jsx(te.Space,{direction:"x",align:"center",className:f.CSS.B("steps"),...s,children:e.map((r,l)=>i.jsxRuntimeExports.jsxs(g.Fragment,{children:[i.jsxRuntimeExports.jsxs(j.Button,{onClick:()=>n(r.key),variant:"outlined",disabled:l>o,children:[l+1,". ",r.title]},r.key),l!==e.length-1&&i.jsxRuntimeExports.jsx(j.Qt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},r.key))})},Xh=Object.freeze(Object.defineProperty({__proto__:null,Steps:Wh},Symbol.toStringTag,{value:"Module"})),Nr=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const o=xt(e,...n);return f.q.distance(o,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",o),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Lr=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:o,targetBox:r})=>{if(!Kh({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=f.g.construct(t),c=f.g.swap(l);let a=mt(c,s[c]-e[c]);const u=f.Eo.loc(n,a);if(f.J.swap(t)===o){const d=f.Eo.loc(r,f.J.swap(a));Math.abs(u-d)<Ne&&(a=f.J.swap(a))}return{direction:c,length:u-e[c]+jt(a,Ne)}},ro=ue.z.object({direction:f.g.direction,length:ue.z.number()}),xt=(e,...t)=>{let n=e;for(const s of t)n=f.q.translate(n,s.direction,s.length);return n},Kl=(e,t,n,s)=>{try{let o=e;const r=[e,...t.map(m=>(o=f.q.translate(o,m.direction,m.length),o))];if(!s)return r;const l=t[0],c=mt(l.direction,l.length),a=Tr(c),u=4*(2-n**.5);r[0]=f.q.translate(r[0],{[l.direction]:-1*a*u,[f.g.swap(l.direction)]:0});const d=t[t.length-1],x=mt(d.direction,d.length),p=Tr(x);return r[r.length-1]=f.q.translate(r[r.length-1],{[d.direction]:p*u,[f.g.swap(d.direction)]:0}),r}catch{return[]}},Ne=10,Tr=e=>e==="top"||e==="left"?-1:1,jt=(e,t)=>e==="top"||e==="left"?-t:t,mt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ot=e=>mt(e.direction,e.length),Kh=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=f.g.construct(n),o=t[s]-e[s];return jt(n,o)<0},yn=e=>({direction:f.g.construct(e),length:jt(e,Ne)}),Ar={top:yn("top"),bottom:yn("bottom"),left:yn("left"),right:yn("right")},Gh=4,Uh=.25,xs=e=>io(Qh(io(e))),Qh=e=>{const t=[...e],n=e.findIndex((s,o)=>{const r=Math.abs(s.length);if(r<Gh){if(o===0||o===e.length-1)return!1;if(r<Uh)return!0;if(e.length<=3)return!1;if(o+2<e.length){const l=t[o+2];if(l.direction!==s.direction)return!1;t[o+2]={...l,length:l.length+s.length}}else{const l=t[o-2];if(l.direction!==s.direction)return!1;t[o-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},io=e=>{const t=[...e];return e.findIndex((s,o)=>{const r=t[o-1];if(o===0||s.direction!==r.direction)return!1;if(o===1){const l=o-1,c=o,a=ot(r),u=ot(s);if(a===u)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(r.length)===Ne)return!1;const d=jt(a,Ne),x=t[l].length-d,p=t[c].length+x;return Math.abs(p)<Ne?!1:(t[l]={...t[l],length:d},t[c]={...t[c],length:p},!0)}if(o===e.length-1){const l=o,c=o-1,a=ot(s),u=ot(r);if(a===u)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(s.length)===Ne)return!1;const d=jt(a,Ne),x=t[l].length-d,p=t[c].length+x;return Math.abs(p)<Ne?!1:(t[l]={...t[l],length:d},t[c]={...t[c],length:p},!0)}return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0})!==-1?io(t):t},Ct=e=>xs(Jh(e)),Jh=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:o,sourceOrientation:r})=>{let l=r,c=o,a={...Ar[r]},u=xt(n,a);const d={...Ar[o]};let x=xt(s,d);const p=Math.abs(u.x-x.x),m=Math.abs(u.y-x.y);p<2*Ne&&m<10&&(a.length-=p/2,d.length+=p/2,u=xt(n,a),x=xt(s,d));const h=[a],E=Lr({sourceStumpTip:u,sourceOrientation:r,sourceBox:e,targetStumpTip:x,targetOrientation:o,targetBox:t});E!=null&&(h.push(E),u=xt(u,E),l=ot(E),a=E);const v=Lr({sourceStumpTip:x,sourceOrientation:c,sourceBox:t,targetStumpTip:u,targetOrientation:l,targetBox:e});v!=null&&(x=xt(x,v),c=mt(v.direction,v.length));const w=()=>{v!=null&&(v.length*=-1,h.push(v)),d.length*=-1,h.push(d)};if(f.J.swap(l)===o){const b=f.g.construct(l),T=(x[b]-u[b])/2;h.push({direction:b,length:T});const N=f.g.swap(b);return h.push({direction:N,length:x[N]-u[N]}),h.push({direction:b,length:T}),w(),h}const _=x[a.direction]-u[a.direction];let S=f.g.swap(a.direction);const y=u[S]-x[S];let C;mt(a.direction,_)===l&&mt(S,y)===c?C={direction:a.direction,length:_}:(C={direction:S,length:x[S]-u[S]},S=f.g.swap(S)),h.push(C);const P={direction:S,length:x[S]-u[S]};return h.push(P),w(),h},eg=e=>xs(tg(e)),tg=({segments:e,index:t,magnitude:n})=>{const s=[...e],o=s[t],r=f.g.swap(o.direction),l=ot(o);if(t===0){s.unshift({direction:r,length:n});const c=jt(l,Ne);s.unshift({direction:o.direction,length:c}),t+=2,s[t]={...s[t],length:s[t].length-c}}else s[t-1]={direction:s[t-1].direction,length:s[t-1].length+n};if(t===s.length-1){s.push({direction:r,length:-n});const c=jt(l,Ne);s.push({direction:o.direction,length:c}),s[t]={...s[t],length:s[t].length-c}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},ng=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},sg=(e,t,n=!1,...s)=>{const o=(r,l)=>!s.includes(l)&&t(r,l);return n?ng(e,o):e.findIndex(o)},og=({delta:e,segments:t})=>xs(Gl(e,t,!1)),rg=({delta:e,segments:t})=>xs(Gl(e,t,!0)),Gl=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Ir("x",e,s,n)),e.y!==0&&(s=Ir("y",e,s,n)),s},$r=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},o=ot(t),r=ot(s),l=Math.abs(s.length),c=Math.abs(t.length);return(l>c||l>Ne)&&o===r},Ir=(e,t,n,s)=>{const o=f.g.swap(e),r=s?n.length-1:0,l=n[r];if($r(e,l,t)){const x=n[n.length-1];return x.direction===e&&Math.abs(l.length)<Ne?(n[n.length-1]={...x,length:x.length-t[e]},n):(n[r]={...l,length:l.length-t[e]},n)}const c=s?0:n.length-1,u=sg(n,x=>x.direction===e,s,r);if(u===c){const x=n[c];return $r(e,x,t)?(n[c]={...x,length:x.length-t[e]},n):(l.direction===e&&Math.abs(l.length)>x.length?n[r]={...l,length:l.length-t[e]}:n[c]={...x,length:x.length-t[e]},n)}if(u===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:o,length:n[0].length/2},{direction:e,length:-t[e]},{direction:o,length:n[0].length/2}]:l.direction===e?(n[r]={...l,length:l.length-t[e]},n):[{direction:o,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const d=n[u];return n[u]={...d,length:d.length-t[e]},n},ig=ue.z.object({position:f.q.xy,zoom:ue.z.number()}),Ul=ue.z.object({color:f.crudeZ,segments:ue.z.array(ro)}),lg=Ul.extend({key:ue.z.string(),source:ue.z.string(),target:ue.z.string(),segments:ue.z.array(ro),color:f.crudeZ,id:ue.z.string(),data:ue.z.object({segments:ue.z.array(ro),color:f.crudeZ}).optional(),selected:ue.z.boolean(),sourceHandle:ue.z.string().nullable().optional(),targetHandle:ue.z.string().nullable().optional()}),cg=ue.z.object({key:ue.z.string(),position:f.q.xy,selected:ue.z.boolean().optional(),zIndex:ue.z.number().optional(),type:ue.z.string().optional(),data:ue.z.record(ue.z.unknown()).optional(),measured:ue.z.object({width:ue.z.number().optional(),height:ue.z.number().optional()}).optional()}),qo=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),Wo=e=>e.map(({segments:t,color:n,...s})=>({...s,id:s.key,data:{segments:t,color:n}})),Ql=e=>e.map(t=>({key:t.id,selected:t.selected,...t})),Jl=(e,t)=>e.map(n=>{var s,o;return n.data??(n.data={segments:[],color:t}),{key:n.id,segments:((s=n.data)==null?void 0:s.segments)??[],selected:n.selected??!1,color:((o=n.data)==null?void 0:o.color)??t,...n}}),ec=e=>({...e.position,zoom:e.zoom}),tc=e=>({position:f.q.construct(e),zoom:e.zoom}),nc=(e,t)=>Ql(t(qo(e))),Ln=(e,t,n)=>Jl(t(Wo(e)),n),ag=(e,t="x")=>{if(e.length===0)return[];const n=f.J.construct(t),s=f.J.swap(n);return e.sort((o,r)=>f.Eo.loc(o.box,n)-f.Eo.loc(r.box,n)),e.forEach((o,r)=>{if(r===0)return;const c=e[r-1].handles.find(m=>m.orientation===s),a=o.handles.find(m=>m.orientation===n);if(c==null||a==null)return;const u=c.absolutePosition,d=a.absolutePosition,x=f.q.set(f.q.translation(d,u),t,0),p=f.q.translate(f.Eo.topLeft(o.box),x);o.box=f.Eo.construct(p,f.Eo.dims(o.box))}),e};function we(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=we(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ug={value:()=>{}};function fs(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new Tn(n)}function Tn(e){this._=e}function dg(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",o=n.indexOf(".");if(o>=0&&(s=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Tn.prototype=fs.prototype={constructor:Tn,on:function(e,t){var n=this._,s=dg(e+"",n),o,r=-1,l=s.length;if(arguments.length<2){for(;++r<l;)if((o=(e=s[r]).type)&&(o=xg(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<l;)if(o=(e=s[r]).type)n[o]=Or(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Or(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Tn(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),s=0,o,r;s<o;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,r=s.length;o<r;++o)s[o].value.apply(t,n)}};function xg(e,t){for(var n=0,s=e.length,o;n<s;++n)if((o=e[n]).name===t)return o.value}function Or(e,t,n){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=ug,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var lo="http://www.w3.org/1999/xhtml";const Br={svg:"http://www.w3.org/2000/svg",xhtml:lo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ps(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Br.hasOwnProperty(t)?{space:Br[t],local:e}:e}function fg(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===lo&&t.documentElement.namespaceURI===lo?t.createElement(e):t.createElementNS(n,e)}}function pg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function sc(e){var t=ps(e);return(t.local?pg:fg)(t)}function mg(){}function Xo(e){return e==null?mg:function(){return this.querySelector(e)}}function hg(e){typeof e!="function"&&(e=Xo(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=new Array(l),a,u,d=0;d<l;++d)(a=r[d])&&(u=e.call(a,a.__data__,d,r))&&("__data__"in a&&(u.__data__=a.__data__),c[d]=u);return new Ae(s,this._parents)}function gg(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function jg(){return[]}function oc(e){return e==null?jg:function(){return this.querySelectorAll(e)}}function Eg(e){return function(){return gg(e.apply(this,arguments))}}function yg(e){typeof e=="function"?e=Eg(e):e=oc(e);for(var t=this._groups,n=t.length,s=[],o=[],r=0;r<n;++r)for(var l=t[r],c=l.length,a,u=0;u<c;++u)(a=l[u])&&(s.push(e.call(a,a.__data__,u,l)),o.push(a));return new Ae(s,o)}function rc(e){return function(){return this.matches(e)}}function ic(e){return function(t){return t.matches(e)}}var Sg=Array.prototype.find;function Rg(e){return function(){return Sg.call(this.children,e)}}function wg(){return this.firstElementChild}function Cg(e){return this.select(e==null?wg:Rg(typeof e=="function"?e:ic(e)))}var vg=Array.prototype.filter;function bg(){return Array.from(this.children)}function _g(e){return function(){return vg.call(this.children,e)}}function kg(e){return this.selectAll(e==null?bg:_g(typeof e=="function"?e:ic(e)))}function Pg(e){typeof e!="function"&&(e=rc(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=[],a,u=0;u<l;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&c.push(a);return new Ae(s,this._parents)}function lc(e){return new Array(e.length)}function Mg(){return new Ae(this._enter||this._groups.map(lc),this._parents)}function Xn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Xn.prototype={constructor:Xn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ng(e){return function(){return e}}function Lg(e,t,n,s,o,r){for(var l=0,c,a=t.length,u=r.length;l<u;++l)(c=t[l])?(c.__data__=r[l],s[l]=c):n[l]=new Xn(e,r[l]);for(;l<a;++l)(c=t[l])&&(o[l]=c)}function Tg(e,t,n,s,o,r,l){var c,a,u=new Map,d=t.length,x=r.length,p=new Array(d),m;for(c=0;c<d;++c)(a=t[c])&&(p[c]=m=l.call(a,a.__data__,c,t)+"",u.has(m)?o[c]=a:u.set(m,a));for(c=0;c<x;++c)m=l.call(e,r[c],c,r)+"",(a=u.get(m))?(s[c]=a,a.__data__=r[c],u.delete(m)):n[c]=new Xn(e,r[c]);for(c=0;c<d;++c)(a=t[c])&&u.get(p[c])===a&&(o[c]=a)}function Ag(e){return e.__data__}function $g(e,t){if(!arguments.length)return Array.from(this,Ag);var n=t?Tg:Lg,s=this._parents,o=this._groups;typeof e!="function"&&(e=Ng(e));for(var r=o.length,l=new Array(r),c=new Array(r),a=new Array(r),u=0;u<r;++u){var d=s[u],x=o[u],p=x.length,m=Ig(e.call(d,d&&d.__data__,u,s)),h=m.length,E=c[u]=new Array(h),v=l[u]=new Array(h),w=a[u]=new Array(p);n(d,x,E,v,w,m,t);for(var _=0,S=0,y,C;_<h;++_)if(y=E[_]){for(_>=S&&(S=_+1);!(C=v[S])&&++S<h;);y._next=C||null}}return l=new Ae(l,s),l._enter=c,l._exit=a,l}function Ig(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Og(){return new Ae(this._exit||this._groups.map(lc),this._parents)}function Bg(e,t,n){var s=this.enter(),o=this,r=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?r.remove():n(r),s&&o?s.merge(o).order():o}function Dg(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,o=n.length,r=s.length,l=Math.min(o,r),c=new Array(o),a=0;a<l;++a)for(var u=n[a],d=s[a],x=u.length,p=c[a]=new Array(x),m,h=0;h<x;++h)(m=u[h]||d[h])&&(p[h]=m);for(;a<o;++a)c[a]=n[a];return new Ae(c,this._parents)}function zg(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],o=s.length-1,r=s[o],l;--o>=0;)(l=s[o])&&(r&&l.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(l,r),r=l);return this}function Vg(e){e||(e=Fg);function t(x,p){return x&&p?e(x.__data__,p.__data__):!x-!p}for(var n=this._groups,s=n.length,o=new Array(s),r=0;r<s;++r){for(var l=n[r],c=l.length,a=o[r]=new Array(c),u,d=0;d<c;++d)(u=l[d])&&(a[d]=u);a.sort(t)}return new Ae(o,this._parents).order()}function Fg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Hg(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Zg(){return Array.from(this)}function Yg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,r=s.length;o<r;++o){var l=s[o];if(l)return l}return null}function qg(){let e=0;for(const t of this)++e;return e}function Wg(){return!this.node()}function Xg(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var o=t[n],r=0,l=o.length,c;r<l;++r)(c=o[r])&&e.call(c,c.__data__,r,o);return this}function Kg(e){return function(){this.removeAttribute(e)}}function Gg(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ug(e,t){return function(){this.setAttribute(e,t)}}function Qg(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Jg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ej(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function tj(e,t){var n=ps(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?Gg:Kg:typeof t=="function"?n.local?ej:Jg:n.local?Qg:Ug)(n,t))}function cc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function nj(e){return function(){this.style.removeProperty(e)}}function sj(e,t,n){return function(){this.style.setProperty(e,t,n)}}function oj(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function rj(e,t,n){return arguments.length>1?this.each((t==null?nj:typeof t=="function"?oj:sj)(e,t,n??"")):Pt(this.node(),e)}function Pt(e,t){return e.style.getPropertyValue(t)||cc(e).getComputedStyle(e,null).getPropertyValue(t)}function ij(e){return function(){delete this[e]}}function lj(e,t){return function(){this[e]=t}}function cj(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function aj(e,t){return arguments.length>1?this.each((t==null?ij:typeof t=="function"?cj:lj)(e,t)):this.node()[e]}function ac(e){return e.trim().split(/^|\s+/)}function Ko(e){return e.classList||new uc(e)}function uc(e){this._node=e,this._names=ac(e.getAttribute("class")||"")}uc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function dc(e,t){for(var n=Ko(e),s=-1,o=t.length;++s<o;)n.add(t[s])}function xc(e,t){for(var n=Ko(e),s=-1,o=t.length;++s<o;)n.remove(t[s])}function uj(e){return function(){dc(this,e)}}function dj(e){return function(){xc(this,e)}}function xj(e,t){return function(){(t.apply(this,arguments)?dc:xc)(this,e)}}function fj(e,t){var n=ac(e+"");if(arguments.length<2){for(var s=Ko(this.node()),o=-1,r=n.length;++o<r;)if(!s.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?xj:t?uj:dj)(n,t))}function pj(){this.textContent=""}function mj(e){return function(){this.textContent=e}}function hj(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function gj(e){return arguments.length?this.each(e==null?pj:(typeof e=="function"?hj:mj)(e)):this.node().textContent}function jj(){this.innerHTML=""}function Ej(e){return function(){this.innerHTML=e}}function yj(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Sj(e){return arguments.length?this.each(e==null?jj:(typeof e=="function"?yj:Ej)(e)):this.node().innerHTML}function Rj(){this.nextSibling&&this.parentNode.appendChild(this)}function wj(){return this.each(Rj)}function Cj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vj(){return this.each(Cj)}function bj(e){var t=typeof e=="function"?e:sc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _j(){return null}function kj(e,t){var n=typeof e=="function"?e:sc(e),s=t==null?_j:typeof t=="function"?t:Xo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function Pj(){var e=this.parentNode;e&&e.removeChild(this)}function Mj(){return this.each(Pj)}function Nj(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Lj(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Tj(e){return this.select(e?Lj:Nj)}function Aj(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $j(e){return function(t){e.call(this,t,this.__data__)}}function Ij(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function Oj(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,o=t.length,r;n<o;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++s]=r;++s?t.length=s:delete this.__on}}}function Bj(e,t,n){return function(){var s=this.__on,o,r=$j(t);if(s){for(var l=0,c=s.length;l<c;++l)if((o=s[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=r,o.options=n),o.value=t;return}}this.addEventListener(e.type,r,n),o={type:e.type,name:e.name,value:t,listener:r,options:n},s?s.push(o):this.__on=[o]}}function Dj(e,t,n){var s=Ij(e+""),o,r=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var a=0,u=c.length,d;a<u;++a)for(o=0,d=c[a];o<r;++o)if((l=s[o]).type===d.type&&l.name===d.name)return d.value}return}for(c=t?Bj:Oj,o=0;o<r;++o)this.each(c(s[o],t,n));return this}function fc(e,t,n){var s=cc(e),o=s.CustomEvent;typeof o=="function"?o=new o(t,n):(o=s.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function zj(e,t){return function(){return fc(this,e,t)}}function Vj(e,t){return function(){return fc(this,e,t.apply(this,arguments))}}function Fj(e,t){return this.each((typeof t=="function"?Vj:zj)(e,t))}function*Hj(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,r=s.length,l;o<r;++o)(l=s[o])&&(yield l)}var pc=[null];function Ae(e,t){this._groups=e,this._parents=t}function fn(){return new Ae([[document.documentElement]],pc)}function Zj(){return this}Ae.prototype=fn.prototype={constructor:Ae,select:hg,selectAll:yg,selectChild:Cg,selectChildren:kg,filter:Pg,data:$g,enter:Mg,exit:Og,join:Bg,merge:Dg,selection:Zj,order:zg,sort:Vg,call:Hg,nodes:Zg,node:Yg,size:qg,empty:Wg,each:Xg,attr:tj,style:rj,property:aj,classed:fj,text:gj,html:Sj,raise:wj,lower:vj,append:bj,insert:kj,remove:Mj,clone:Tj,datum:Aj,on:Dj,dispatch:Fj,[Symbol.iterator]:Hj};function Te(e){return typeof e=="string"?new Ae([[document.querySelector(e)]],[document.documentElement]):new Ae([[e]],pc)}function Yj(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Oe(e,t){if(e=Yj(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const qj={passive:!1},sn={capture:!0,passive:!1};function Vs(e){e.stopImmediatePropagation()}function _t(e){e.preventDefault(),e.stopImmediatePropagation()}function mc(e){var t=e.document.documentElement,n=Te(e).on("dragstart.drag",_t,sn);"onselectstart"in t?n.on("selectstart.drag",_t,sn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function hc(e,t){var n=e.document.documentElement,s=Te(e).on("dragstart.drag",null);t&&(s.on("click.drag",_t,sn),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Sn=e=>()=>e;function co(e,{sourceEvent:t,subject:n,target:s,identifier:o,active:r,x:l,y:c,dx:a,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}co.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Wj(e){return!e.ctrlKey&&!e.button}function Xj(){return this.parentNode}function Kj(e,t){return t??{x:e.x,y:e.y}}function Gj(){return navigator.maxTouchPoints||"ontouchstart"in this}function gc(){var e=Wj,t=Xj,n=Kj,s=Gj,o={},r=fs("start","drag","end"),l=0,c,a,u,d,x=0;function p(y){y.on("mousedown.drag",m).filter(s).on("touchstart.drag",v).on("touchmove.drag",w,qj).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(y,C){if(!(d||!e.call(this,y,C))){var P=S(this,t.call(this,y,C),y,C,"mouse");P&&(Te(y.view).on("mousemove.drag",h,sn).on("mouseup.drag",E,sn),mc(y.view),Vs(y),u=!1,c=y.clientX,a=y.clientY,P("start",y))}}function h(y){if(_t(y),!u){var C=y.clientX-c,P=y.clientY-a;u=C*C+P*P>x}o.mouse("drag",y)}function E(y){Te(y.view).on("mousemove.drag mouseup.drag",null),hc(y.view,u),_t(y),o.mouse("end",y)}function v(y,C){if(e.call(this,y,C)){var P=y.changedTouches,b=t.call(this,y,C),T=P.length,N,A;for(N=0;N<T;++N)(A=S(this,b,y,C,P[N].identifier,P[N]))&&(Vs(y),A("start",y,P[N]))}}function w(y){var C=y.changedTouches,P=C.length,b,T;for(b=0;b<P;++b)(T=o[C[b].identifier])&&(_t(y),T("drag",y,C[b]))}function _(y){var C=y.changedTouches,P=C.length,b,T;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),b=0;b<P;++b)(T=o[C[b].identifier])&&(Vs(y),T("end",y,C[b]))}function S(y,C,P,b,T,N){var A=r.copy(),O=Oe(N||P,C),L,D,R;if((R=n.call(y,new co("beforestart",{sourceEvent:P,target:p,identifier:T,active:l,x:O[0],y:O[1],dx:0,dy:0,dispatch:A}),b))!=null)return L=R.x-O[0]||0,D=R.y-O[1]||0,function I(k,B,M){var z=O,V;switch(k){case"start":o[T]=I,V=l++;break;case"end":delete o[T],--l;case"drag":O=Oe(M||B,C),V=l;break}A.call(k,y,new co(k,{sourceEvent:B,subject:R,target:p,identifier:T,active:V,x:O[0]+L,y:O[1]+D,dx:O[0]-z[0],dy:O[1]-z[1],dispatch:A}),b)}}return p.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Sn(!!y),p):e},p.container=function(y){return arguments.length?(t=typeof y=="function"?y:Sn(y),p):t},p.subject=function(y){return arguments.length?(n=typeof y=="function"?y:Sn(y),p):n},p.touchable=function(y){return arguments.length?(s=typeof y=="function"?y:Sn(!!y),p):s},p.on=function(){var y=r.on.apply(r,arguments);return y===r?p:y},p.clickDistance=function(y){return arguments.length?(x=(y=+y)*y,p):Math.sqrt(x)},p}var Mt=0,Xt=0,qt=0,jc=1e3,Kn,Kt,Gn=0,Et=0,ms=0,on=typeof performance=="object"&&performance.now?performance:Date,Ec=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Go(){return Et||(Ec(Uj),Et=on.now()+ms)}function Uj(){Et=0}function Un(){this._call=this._time=this._next=null}Un.prototype=yc.prototype={constructor:Un,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Go():+n)+(t==null?0:+t),!this._next&&Kt!==this&&(Kt?Kt._next=this:Kn=this,Kt=this),this._call=e,this._time=n,ao()},stop:function(){this._call&&(this._call=null,this._time=1/0,ao())}};function yc(e,t,n){var s=new Un;return s.restart(e,t,n),s}function Qj(){Go(),++Mt;for(var e=Kn,t;e;)(t=Et-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Mt}function Dr(){Et=(Gn=on.now())+ms,Mt=Xt=0;try{Qj()}finally{Mt=0,eE(),Et=0}}function Jj(){var e=on.now(),t=e-Gn;t>jc&&(ms-=t,Gn=e)}function eE(){for(var e,t=Kn,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Kn=n);Kt=e,ao(s)}function ao(e){if(!Mt){Xt&&(Xt=clearTimeout(Xt));var t=e-Et;t>24?(e<1/0&&(Xt=setTimeout(Dr,e-on.now()-ms)),qt&&(qt=clearInterval(qt))):(qt||(Gn=on.now(),qt=setInterval(Jj,jc)),Mt=1,Ec(Dr))}}function zr(e,t,n){var s=new Un;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,n),s}var tE=fs("start","end","cancel","interrupt"),nE=[],Sc=0,Vr=1,uo=2,An=3,Fr=4,xo=5,$n=6;function hs(e,t,n,s,o,r){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;sE(e,n,{name:t,index:s,group:o,on:tE,tween:nE,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Sc})}function Uo(e,t){var n=ze(e,t);if(n.state>Sc)throw new Error("too late; already scheduled");return n}function Ze(e,t){var n=ze(e,t);if(n.state>An)throw new Error("too late; already running");return n}function ze(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function sE(e,t,n){var s=e.__transition,o;s[t]=n,n.timer=yc(r,0,n.time);function r(u){n.state=Vr,n.timer.restart(l,n.delay,n.time),n.delay<=u&&l(u-n.delay)}function l(u){var d,x,p,m;if(n.state!==Vr)return a();for(d in s)if(m=s[d],m.name===n.name){if(m.state===An)return zr(l);m.state===Fr?(m.state=$n,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete s[d]):+d<t&&(m.state=$n,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete s[d])}if(zr(function(){n.state===An&&(n.state=Fr,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=uo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===uo){for(n.state=An,o=new Array(p=n.tween.length),d=0,x=-1;d<p;++d)(m=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++x]=m);o.length=x+1}}function c(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=xo,1),x=-1,p=o.length;++x<p;)o[x].call(e,d);n.state===xo&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=$n,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function In(e,t){var n=e.__transition,s,o,r=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){r=!1;continue}o=s.state>uo&&s.state<xo,s.state=$n,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}r&&delete e.__transition}}function oE(e){return this.each(function(){In(this,e)})}function rE(e,t){var n,s;return function(){var o=Ze(this,e),r=o.tween;if(r!==n){s=n=r;for(var l=0,c=s.length;l<c;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}o.tween=s}}function iE(e,t,n){var s,o;if(typeof n!="function")throw new Error;return function(){var r=Ze(this,e),l=r.tween;if(l!==s){o=(s=l).slice();for(var c={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=c;break}a===u&&o.push(c)}r.tween=o}}function lE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=ze(this.node(),n).tween,o=0,r=s.length,l;o<r;++o)if((l=s[o]).name===e)return l.value;return null}return this.each((t==null?rE:iE)(n,e,t))}function Qo(e,t,n){var s=e._id;return e.each(function(){var o=Ze(this,s);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return ze(o,s).value[t]}}function Rc(e,t){var n;return(typeof t=="number"?$.interpolateNumber:t instanceof $.color?$.interpolateRgb:(n=$.color(t))?(t=n,$.interpolateRgb):$.interpolateString)(e,t)}function cE(e){return function(){this.removeAttribute(e)}}function aE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function uE(e,t,n){var s,o=n+"",r;return function(){var l=this.getAttribute(e);return l===o?null:l===s?r:r=t(s=l,n)}}function dE(e,t,n){var s,o=n+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===s?r:r=t(s=l,n)}}function xE(e,t,n){var s,o,r;return function(){var l,c=n(this),a;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),a=c+"",l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c)))}}function fE(e,t,n){var s,o,r;return function(){var l,c=n(this),a;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),a=c+"",l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c)))}}function pE(e,t){var n=ps(e),s=n==="transform"?jp:Rc;return this.attrTween(e,typeof t=="function"?(n.local?fE:xE)(n,s,Qo(this,"attr."+e,t)):t==null?(n.local?aE:cE)(n):(n.local?dE:uE)(n,s,t))}function mE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function hE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function gE(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&hE(e,r)),n}return o._value=t,o}function jE(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&mE(e,r)),n}return o._value=t,o}function EE(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=ps(e);return this.tween(n,(s.local?gE:jE)(s,t))}function yE(e,t){return function(){Uo(this,e).delay=+t.apply(this,arguments)}}function SE(e,t){return t=+t,function(){Uo(this,e).delay=t}}function RE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yE:SE)(t,e)):ze(this.node(),t).delay}function wE(e,t){return function(){Ze(this,e).duration=+t.apply(this,arguments)}}function CE(e,t){return t=+t,function(){Ze(this,e).duration=t}}function vE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?wE:CE)(t,e)):ze(this.node(),t).duration}function bE(e,t){if(typeof t!="function")throw new Error;return function(){Ze(this,e).ease=t}}function _E(e){var t=this._id;return arguments.length?this.each(bE(t,e)):ze(this.node(),t).ease}function kE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ze(this,e).ease=n}}function PE(e){if(typeof e!="function")throw new Error;return this.each(kE(this._id,e))}function ME(e){typeof e!="function"&&(e=rc(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=[],a,u=0;u<l;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&c.push(a);return new Ge(s,this._parents,this._name,this._id)}function NE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,o=n.length,r=Math.min(s,o),l=new Array(s),c=0;c<r;++c)for(var a=t[c],u=n[c],d=a.length,x=l[c]=new Array(d),p,m=0;m<d;++m)(p=a[m]||u[m])&&(x[m]=p);for(;c<s;++c)l[c]=t[c];return new Ge(l,this._parents,this._name,this._id)}function LE(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function TE(e,t,n){var s,o,r=LE(t)?Uo:Ze;return function(){var l=r(this,e),c=l.on;c!==s&&(o=(s=c).copy()).on(t,n),l.on=o}}function AE(e,t){var n=this._id;return arguments.length<2?ze(this.node(),n).on.on(e):this.each(TE(n,e,t))}function $E(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function IE(){return this.on("end.remove",$E(this._id))}function OE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Xo(e));for(var s=this._groups,o=s.length,r=new Array(o),l=0;l<o;++l)for(var c=s[l],a=c.length,u=r[l]=new Array(a),d,x,p=0;p<a;++p)(d=c[p])&&(x=e.call(d,d.__data__,p,c))&&("__data__"in d&&(x.__data__=d.__data__),u[p]=x,hs(u[p],t,n,p,u,ze(d,n)));return new Ge(r,this._parents,t,n)}function BE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=oc(e));for(var s=this._groups,o=s.length,r=[],l=[],c=0;c<o;++c)for(var a=s[c],u=a.length,d,x=0;x<u;++x)if(d=a[x]){for(var p=e.call(d,d.__data__,x,a),m,h=ze(d,n),E=0,v=p.length;E<v;++E)(m=p[E])&&hs(m,t,n,E,p,h);r.push(p),l.push(d)}return new Ge(r,l,t,n)}var DE=fn.prototype.constructor;function zE(){return new DE(this._groups,this._parents)}function VE(e,t){var n,s,o;return function(){var r=Pt(this,e),l=(this.style.removeProperty(e),Pt(this,e));return r===l?null:r===n&&l===s?o:o=t(n=r,s=l)}}function wc(e){return function(){this.style.removeProperty(e)}}function FE(e,t,n){var s,o=n+"",r;return function(){var l=Pt(this,e);return l===o?null:l===s?r:r=t(s=l,n)}}function HE(e,t,n){var s,o,r;return function(){var l=Pt(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),Pt(this,e))),l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c))}}function ZE(e,t){var n,s,o,r="style."+t,l="end."+r,c;return function(){var a=Ze(this,e),u=a.on,d=a.value[r]==null?c||(c=wc(t)):void 0;(u!==n||o!==d)&&(s=(n=u).copy()).on(l,o=d),a.on=s}}function YE(e,t,n){var s=(e+="")=="transform"?gp:Rc;return t==null?this.styleTween(e,VE(e,s)).on("end.style."+e,wc(e)):typeof t=="function"?this.styleTween(e,HE(e,s,Qo(this,"style."+e,t))).each(ZE(this._id,e)):this.styleTween(e,FE(e,s,t),n).on("end.style."+e,null)}function qE(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function WE(e,t,n){var s,o;function r(){var l=t.apply(this,arguments);return l!==o&&(s=(o=l)&&qE(e,l,n)),s}return r._value=t,r}function XE(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,WE(e,t,n??""))}function KE(e){return function(){this.textContent=e}}function GE(e){return function(){var t=e(this);this.textContent=t??""}}function UE(e){return this.tween("text",typeof e=="function"?GE(Qo(this,"text",e)):KE(e==null?"":e+""))}function QE(e){return function(t){this.textContent=e.call(this,t)}}function JE(e){var t,n;function s(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&QE(o)),t}return s._value=e,s}function ey(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,JE(e))}function ty(){for(var e=this._name,t=this._id,n=Cc(),s=this._groups,o=s.length,r=0;r<o;++r)for(var l=s[r],c=l.length,a,u=0;u<c;++u)if(a=l[u]){var d=ze(a,t);hs(a,e,n,u,l,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Ge(s,this._parents,e,n)}function ny(){var e,t,n=this,s=n._id,o=n.size();return new Promise(function(r,l){var c={value:l},a={value:function(){--o===0&&r()}};n.each(function(){var u=Ze(this,s),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(a)),u.on=t}),o===0&&r()})}var sy=0;function Ge(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Cc(){return++sy}var qe=fn.prototype;Ge.prototype={constructor:Ge,select:OE,selectAll:BE,selectChild:qe.selectChild,selectChildren:qe.selectChildren,filter:ME,merge:NE,selection:zE,transition:ty,call:qe.call,nodes:qe.nodes,node:qe.node,size:qe.size,empty:qe.empty,each:qe.each,on:AE,attr:pE,attrTween:EE,style:YE,styleTween:XE,text:UE,textTween:ey,remove:IE,tween:lE,delay:RE,duration:vE,ease:_E,easeVarying:PE,end:ny,[Symbol.iterator]:qe[Symbol.iterator]};function oy(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ry={time:null,delay:0,duration:250,ease:oy};function iy(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function ly(e){var t,n;e instanceof Ge?(t=e._id,e=e._name):(t=Cc(),(n=ry).time=Go(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,r=0;r<o;++r)for(var l=s[r],c=l.length,a,u=0;u<c;++u)(a=l[u])&&hs(a,e,t,u,l,n||iy(a,t));return new Ge(s,this._parents,e,t)}fn.prototype.interrupt=oE;fn.prototype.transition=ly;const Rn=e=>()=>e;function cy(e,{sourceEvent:t,target:n,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function We(e,t,n){this.k=e,this.x=t,this.y=n}We.prototype={constructor:We,scale:function(e){return e===1?this:new We(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new We(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var gs=new We(1,0,0);vc.prototype=We.prototype;function vc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return gs;return e.__zoom}function Fs(e){e.stopImmediatePropagation()}function Wt(e){e.preventDefault(),e.stopImmediatePropagation()}function ay(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uy(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Hr(){return this.__zoom||gs}function dy(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function xy(){return navigator.maxTouchPoints||"ontouchstart"in this}function fy(e,t,n){var s=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),l>r?(r+l)/2:Math.min(0,r)||Math.max(0,l))}function bc(){var e=ay,t=uy,n=fy,s=dy,o=xy,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=Rp,u=fs("start","zoom","end"),d,x,p,m=500,h=150,E=0,v=10;function w(R){R.property("__zoom",Hr).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",A).filter(o).on("touchstart.zoom",O).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(R,I,k,B){var M=R.selection?R.selection():R;M.property("__zoom",Hr),R!==M?C(R,I,k,B):M.interrupt().each(function(){P(this,arguments).event(B).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},w.scaleBy=function(R,I,k,B){w.scaleTo(R,function(){var M=this.__zoom.k,z=typeof I=="function"?I.apply(this,arguments):I;return M*z},k,B)},w.scaleTo=function(R,I,k,B){w.transform(R,function(){var M=t.apply(this,arguments),z=this.__zoom,V=k==null?y(M):typeof k=="function"?k.apply(this,arguments):k,Y=z.invert(V),W=typeof I=="function"?I.apply(this,arguments):I;return n(S(_(z,W),V,Y),M,l)},k,B)},w.translateBy=function(R,I,k,B){w.transform(R,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),l)},null,B)},w.translateTo=function(R,I,k,B,M){w.transform(R,function(){var z=t.apply(this,arguments),V=this.__zoom,Y=B==null?y(z):typeof B=="function"?B.apply(this,arguments):B;return n(gs.translate(Y[0],Y[1]).scale(V.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof k=="function"?-k.apply(this,arguments):-k),z,l)},B,M)};function _(R,I){return I=Math.max(r[0],Math.min(r[1],I)),I===R.k?R:new We(I,R.x,R.y)}function S(R,I,k){var B=I[0]-k[0]*R.k,M=I[1]-k[1]*R.k;return B===R.x&&M===R.y?R:new We(R.k,B,M)}function y(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function C(R,I,k,B){R.on("start.zoom",function(){P(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(B).end()}).tween("zoom",function(){var M=this,z=arguments,V=P(M,z).event(B),Y=t.apply(M,z),W=k==null?y(Y):typeof k=="function"?k.apply(M,z):k,J=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),K=M.__zoom,G=typeof I=="function"?I.apply(M,z):I,Q=a(K.invert(W).concat(J/K.k),G.invert(W).concat(J/G.k));return function(ne){if(ne===1)ne=G;else{var X=Q(ne),oe=J/X[2];ne=new We(oe,W[0]-X[0]*oe,W[1]-X[1]*oe)}V.zoom(null,ne)}})}function P(R,I,k){return!k&&R.__zooming||new b(R,I)}function b(R,I){this.that=R,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,I),this.taps=0}b.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,I){return this.mouse&&R!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var I=Te(this.that).datum();u.call(R,this.that,new cy(R,{sourceEvent:this.sourceEvent,target:w,type:R,transform:this.that.__zoom,dispatch:u}),I)}};function T(R,...I){if(!e.apply(this,arguments))return;var k=P(this,I).event(R),B=this.__zoom,M=Math.max(r[0],Math.min(r[1],B.k*Math.pow(2,s.apply(this,arguments)))),z=Oe(R);if(k.wheel)(k.mouse[0][0]!==z[0]||k.mouse[0][1]!==z[1])&&(k.mouse[1]=B.invert(k.mouse[0]=z)),clearTimeout(k.wheel);else{if(B.k===M)return;k.mouse=[z,B.invert(z)],In(this),k.start()}Wt(R),k.wheel=setTimeout(V,h),k.zoom("mouse",n(S(_(B,M),k.mouse[0],k.mouse[1]),k.extent,l));function V(){k.wheel=null,k.end()}}function N(R,...I){if(p||!e.apply(this,arguments))return;var k=R.currentTarget,B=P(this,I,!0).event(R),M=Te(R.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",J,!0),z=Oe(R,k),V=R.clientX,Y=R.clientY;mc(R.view),Fs(R),B.mouse=[z,this.__zoom.invert(z)],In(this),B.start();function W(K){if(Wt(K),!B.moved){var G=K.clientX-V,Q=K.clientY-Y;B.moved=G*G+Q*Q>E}B.event(K).zoom("mouse",n(S(B.that.__zoom,B.mouse[0]=Oe(K,k),B.mouse[1]),B.extent,l))}function J(K){M.on("mousemove.zoom mouseup.zoom",null),hc(K.view,B.moved),Wt(K),B.event(K).end()}}function A(R,...I){if(e.apply(this,arguments)){var k=this.__zoom,B=Oe(R.changedTouches?R.changedTouches[0]:R,this),M=k.invert(B),z=k.k*(R.shiftKey?.5:2),V=n(S(_(k,z),B,M),t.apply(this,I),l);Wt(R),c>0?Te(this).transition().duration(c).call(C,V,B,R):Te(this).call(w.transform,V,B,R)}}function O(R,...I){if(e.apply(this,arguments)){var k=R.touches,B=k.length,M=P(this,I,R.changedTouches.length===B).event(R),z,V,Y,W;for(Fs(R),V=0;V<B;++V)Y=k[V],W=Oe(Y,this),W=[W,this.__zoom.invert(W),Y.identifier],M.touch0?!M.touch1&&M.touch0[2]!==W[2]&&(M.touch1=W,M.taps=0):(M.touch0=W,z=!0,M.taps=1+!!d);d&&(d=clearTimeout(d)),z&&(M.taps<2&&(x=W[0],d=setTimeout(function(){d=null},m)),In(this),M.start())}}function L(R,...I){if(this.__zooming){var k=P(this,I).event(R),B=R.changedTouches,M=B.length,z,V,Y,W;for(Wt(R),z=0;z<M;++z)V=B[z],Y=Oe(V,this),k.touch0&&k.touch0[2]===V.identifier?k.touch0[0]=Y:k.touch1&&k.touch1[2]===V.identifier&&(k.touch1[0]=Y);if(V=k.that.__zoom,k.touch1){var J=k.touch0[0],K=k.touch0[1],G=k.touch1[0],Q=k.touch1[1],ne=(ne=G[0]-J[0])*ne+(ne=G[1]-J[1])*ne,X=(X=Q[0]-K[0])*X+(X=Q[1]-K[1])*X;V=_(V,Math.sqrt(ne/X)),Y=[(J[0]+G[0])/2,(J[1]+G[1])/2],W=[(K[0]+Q[0])/2,(K[1]+Q[1])/2]}else if(k.touch0)Y=k.touch0[0],W=k.touch0[1];else return;k.zoom("touch",n(S(V,Y,W),k.extent,l))}}function D(R,...I){if(this.__zooming){var k=P(this,I).event(R),B=R.changedTouches,M=B.length,z,V;for(Fs(R),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),z=0;z<M;++z)V=B[z],k.touch0&&k.touch0[2]===V.identifier?delete k.touch0:k.touch1&&k.touch1[2]===V.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(V=Oe(V,this),Math.hypot(x[0]-V[0],x[1]-V[1])<v)){var Y=Te(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return w.wheelDelta=function(R){return arguments.length?(s=typeof R=="function"?R:Rn(+R),w):s},w.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Rn(!!R),w):e},w.touchable=function(R){return arguments.length?(o=typeof R=="function"?R:Rn(!!R),w):o},w.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Rn([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),w):t},w.scaleExtent=function(R){return arguments.length?(r[0]=+R[0],r[1]=+R[1],w):[r[0],r[1]]},w.translateExtent=function(R){return arguments.length?(l[0][0]=+R[0][0],l[1][0]=+R[1][0],l[0][1]=+R[0][1],l[1][1]=+R[1][1],w):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},w.constrain=function(R){return arguments.length?(n=R,w):n},w.duration=function(R){return arguments.length?(c=+R,w):c},w.interpolate=function(R){return arguments.length?(a=R,w):a},w.on=function(){var R=u.on.apply(u,arguments);return R===u?w:R},w.clickDistance=function(R){return arguments.length?(E=(R=+R)*R,w):Math.sqrt(E)},w.tapDistance=function(R){return arguments.length?(v=+R,w):v},w}const Le={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},rn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_c=["Enter"," ","Escape"];var yt;(function(e){e.Strict="strict",e.Loose="loose"})(yt||(yt={}));var ht;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ht||(ht={}));var Nt;(function(e){e.Partial="partial",e.Full="full"})(Nt||(Nt={}));const kc={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var st;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(st||(st={}));var Qn;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Qn||(Qn={}));var q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(q||(q={}));const Zr={[q.Left]:q.Right,[q.Right]:q.Left,[q.Top]:q.Bottom,[q.Bottom]:q.Top};function Pc(e){return e===null?null:e?"valid":"invalid"}const Mc=e=>"id"in e&&"source"in e&&"target"in e,py=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Jo=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pn=(e,t=[0,0])=>{const{width:n,height:s}=Je(e),o=e.origin??t,r=n*o[0],l=s*o[1];return{x:e.position.x-r,y:e.position.y-l}},my=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,o)=>{const r=typeof o=="string";let l=!t.nodeLookup&&!r?o:void 0;t.nodeLookup&&(l=r?t.nodeLookup.get(o):Jo(o)?o:t.nodeLookup.get(o.id));const c=l?Jn(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return js(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Es(n)},mn=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(s=>{if(t.filter===void 0||t.filter(s)){const o=Jn(s);n=js(n,o)}}),Es(n)},Nc=(e,t,[n,s,o]=[0,0,1],r=!1,l=!1)=>{const c={...hn(t,[n,s,o]),width:t.width/o,height:t.height/o},a=[];for(const u of e.values()){const{measured:d,selectable:x=!0,hidden:p=!1}=u;if(l&&!x||p)continue;const m=d.width??u.width??u.initialWidth??null,h=d.height??u.height??u.initialHeight??null,E=ln(c,Tt(u)),v=(m??0)*(h??0),w=r&&E>0;(!u.internals.handleBounds||w||E>=v||u.dragging)&&a.push(u)}return a},hy=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function fo(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!s||s.has(o.id))&&n.set(o.id,o)}),n}async function po({nodes:e,width:t,height:n,panZoom:s,minZoom:o,maxZoom:r},l){if(e.size===0)return Promise.resolve(!1);const c=mn(e),a=er(c,t,n,(l==null?void 0:l.minZoom)??o,(l==null?void 0:l.maxZoom)??r,(l==null?void 0:l.padding)??.1);return await s.setViewport(a,{duration:l==null?void 0:l.duration}),Promise.resolve(!0)}function Lc({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:o,onError:r}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:a,y:u}=c?c.internals.positionAbsolute:{x:0,y:0},d=l.origin??s;let x=o;if(l.extent==="parent"&&!l.expandParent)if(!c)r==null||r("005",Le.error005());else{const m=c.measured.width,h=c.measured.height;m&&h&&(x=[[a,u],[a+m,u+h]])}else c&&At(l.extent)&&(x=[[l.extent[0][0]+a,l.extent[0][1]+u],[l.extent[1][0]+a,l.extent[1][1]+u]]);const p=At(x)?St(t,x,l.measured):t;return{position:{x:p.x-a+l.measured.width*d[0],y:p.y-u+l.measured.height*d[1]},positionAbsolute:p}}async function gy({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:o}){const r=new Set(e.map(p=>p.id)),l=[];for(const p of n){if(p.deletable===!1)continue;const m=r.has(p.id),h=!m&&p.parentId&&l.find(E=>E.id===p.parentId);(m||h)&&l.push(p)}const c=new Set(t.map(p=>p.id)),a=s.filter(p=>p.deletable!==!1),d=hy(l,a);for(const p of a)c.has(p.id)&&!d.find(h=>h.id===p.id)&&d.push(p);if(!o)return{edges:d,nodes:l};const x=await o({nodes:l,edges:d});return typeof x=="boolean"?x?{edges:d,nodes:l}:{edges:[],nodes:[]}:x}const Lt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),St=(e={x:0,y:0},t,n)=>({x:Lt(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Lt(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Tc(e,t,n){const{width:s,height:o}=Je(n),{x:r,y:l}=n.internals.positionAbsolute;return St(e,[[r,l],[r+s,l+o]],t)}const Yr=(e,t,n)=>e<t?Lt(Math.abs(e-t),1,t)/t:e>n?-Lt(Math.abs(e-n),1,t)/t:0,Ac=(e,t,n=15,s=40)=>{const o=Yr(e.x,s,t.width-s)*n,r=Yr(e.y,s,t.height-s)*n;return[o,r]},js=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),mo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Es=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Tt=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=Jo(e)?e.internals.positionAbsolute:pn(e,t);return{x:n,y:s,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}},Jn=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=Jo(e)?e.internals.positionAbsolute:pn(e,t);return{x:n,y:s,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:s+(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0)}},$c=(e,t)=>Es(js(mo(e),mo(t))),ln=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},qr=e=>Be(e.width)&&Be(e.height)&&Be(e.x)&&Be(e.y),Be=e=>!isNaN(e)&&isFinite(e),es=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},ys=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),hn=({x:e,y:t},[n,s,o],r=!1,l=[1,1])=>{const c={x:(e-n)/o,y:(t-s)/o};return r?ys(c,l):c},Ic=({x:e,y:t},[n,s,o])=>({x:e*o+n,y:t*o+s}),er=(e,t,n,s,o,r)=>{const l=t/(e.width*(1+r)),c=n/(e.height*(1+r)),a=Math.min(l,c),u=Lt(a,s,o),d=e.x+e.width/2,x=e.y+e.height/2,p=t/2-d*u,m=n/2-x*u;return{x:p,y:m,zoom:u}},ts=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function At(e){return e!==void 0&&e!=="parent"}function Je(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Oc(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Bc(e,t={width:0,height:0},n,s,o){const r={...e},l=s.get(n);if(l){const c=l.origin||o;r.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],r.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return r}function Ut(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:o}){const{x:r,y:l}=Xe(e),c=hn({x:r-((o==null?void 0:o.left)??0),y:l-((o==null?void 0:o.top)??0)},s),{x:a,y:u}=n?ys(c,t):c;return{xSnapped:a,ySnapped:u,...c}}const Ss=e=>({width:e.offsetWidth,height:e.offsetHeight}),Dc=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},jy=["INPUT","SELECT","TEXTAREA"];function ho(e){var s,o;const t=((o=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:o[0])||e.target;return jy.includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const zc=e=>"clientX"in e,Xe=(e,t)=>{var r,l;const n=zc(e),s=n?e.clientX:(r=e.touches)==null?void 0:r[0].clientX,o=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Wr=(e,t,n,s,o)=>{const r=t.querySelectorAll(`.${e}`);return!r||!r.length?null:Array.from(r).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:o,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/s,y:(c.top-n.top)/s,...Ss(l)}})};function Vc({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:o,sourceControlY:r,targetControlX:l,targetControlY:c}){const a=e*.125+o*.375+l*.375+n*.125,u=t*.125+r*.375+c*.375+s*.125,d=Math.abs(a-e),x=Math.abs(u-t);return[a,u,d,x]}function wn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Xr({pos:e,x1:t,y1:n,x2:s,y2:o,c:r}){switch(e){case q.Left:return[t-wn(t-s,r),n];case q.Right:return[t+wn(s-t,r),n];case q.Top:return[t,n-wn(n-o,r)];case q.Bottom:return[t,n+wn(o-n,r)]}}function Fc({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:s,targetY:o,targetPosition:r=q.Top,curvature:l=.25}){const[c,a]=Xr({pos:n,x1:e,y1:t,x2:s,y2:o,c:l}),[u,d]=Xr({pos:r,x1:s,y1:o,x2:e,y2:t,c:l}),[x,p,m,h]=Vc({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:c,sourceControlY:a,targetControlX:u,targetControlY:d});return[`M${e},${t} C${c},${a} ${u},${d} ${s},${o}`,x,p,m,h]}function Hc({sourceX:e,sourceY:t,targetX:n,targetY:s}){const o=Math.abs(n-e)/2,r=n<e?n+o:n-o,l=Math.abs(s-t)/2,c=s<t?s+l:s-l;return[r,c,o,l]}function Ey({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:o=!1}){if(!o)return s;const r=n||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return s+(r?l:0)}function yy({sourceNode:e,targetNode:t,width:n,height:s,transform:o}){const r=js(Jn(e),Jn(t));r.x===r.x2&&(r.x2+=1),r.y===r.y2&&(r.y2+=1);const l={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:s/o[2]};return ln(l,Es(r))>0}const Zc=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,Sy=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Yc=(e,t)=>{if(!e.source||!e.target)return es("006",Le.error006()),t;let n;return Mc(e)?n={...e}:n={...e,id:Zc(e)},Sy(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},Ry=(e,t,n,s={shouldReplaceId:!0})=>{const{id:o,...r}=e;if(!t.source||!t.target)return es("006",Le.error006()),n;if(!n.find(a=>a.id===e.id))return es("007",Le.error007(o)),n;const c={...r,id:s.shouldReplaceId?Zc(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==o).concat(c)};function qc({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[o,r,l,c]=Hc({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,o,r,l,c]}const Kr={[q.Left]:{x:-1,y:0},[q.Right]:{x:1,y:0},[q.Top]:{x:0,y:-1},[q.Bottom]:{x:0,y:1}},wy=({source:e,sourcePosition:t=q.Bottom,target:n})=>t===q.Left||t===q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Gr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Cy({source:e,sourcePosition:t=q.Bottom,target:n,targetPosition:s=q.Top,center:o,offset:r}){const l=Kr[t],c=Kr[s],a={x:e.x+l.x*r,y:e.y+l.y*r},u={x:n.x+c.x*r,y:n.y+c.y*r},d=wy({source:a,sourcePosition:t,target:u}),x=d.x!==0?"x":"y",p=d[x];let m=[],h,E;const v={x:0,y:0},w={x:0,y:0},[_,S,y,C]=Hc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[x]*c[x]===-1){h=o.x??_,E=o.y??S;const b=[{x:h,y:a.y},{x:h,y:u.y}],T=[{x:a.x,y:E},{x:u.x,y:E}];l[x]===p?m=x==="x"?b:T:m=x==="x"?T:b}else{const b=[{x:a.x,y:u.y}],T=[{x:u.x,y:a.y}];if(x==="x"?m=l.x===p?T:b:m=l.y===p?b:T,t===s){const D=Math.abs(e[x]-n[x]);if(D<=r){const R=Math.min(r-1,r-D);l[x]===p?v[x]=(a[x]>e[x]?-1:1)*R:w[x]=(u[x]>n[x]?-1:1)*R}}if(t!==s){const D=x==="x"?"y":"x",R=l[x]===c[D],I=a[D]>u[D],k=a[D]<u[D];(l[x]===1&&(!R&&I||R&&k)||l[x]!==1&&(!R&&k||R&&I))&&(m=x==="x"?b:T)}const N={x:a.x+v.x,y:a.y+v.y},A={x:u.x+w.x,y:u.y+w.y},O=Math.max(Math.abs(N.x-m[0].x),Math.abs(A.x-m[0].x)),L=Math.max(Math.abs(N.y-m[0].y),Math.abs(A.y-m[0].y));O>=L?(h=(N.x+A.x)/2,E=m[0].y):(h=m[0].x,E=(N.y+A.y)/2)}return[[e,{x:a.x+v.x,y:a.y+v.y},...m,{x:u.x+w.x,y:u.y+w.y},n],h,E,y,C]}function vy(e,t,n,s){const o=Math.min(Gr(e,t)/2,Gr(t,n)/2,s),{x:r,y:l}=t;if(e.x===r&&r===n.x||e.y===l&&l===n.y)return`L${r} ${l}`;if(e.y===l){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${r+o*u},${l}Q ${r},${l} ${r},${l+o*d}`}const c=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${r},${l+o*a}Q ${r},${l} ${r+o*c},${l}`}function go({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:s,targetY:o,targetPosition:r=q.Top,borderRadius:l=5,centerX:c,centerY:a,offset:u=20}){const[d,x,p,m,h]=Cy({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:o},targetPosition:r,center:{x:c,y:a},offset:u});return[d.reduce((v,w,_)=>{let S="";return _>0&&_<d.length-1?S=vy(d[_-1],w,d[_+1],l):S=`${_===0?"M":"L"}${w.x} ${w.y}`,v+=S,v},""),x,p,m,h]}function Ur(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function by(e){var x;const{sourceNode:t,targetNode:n}=e;if(!Ur(t)||!Ur(n))return null;const s=t.internals.handleBounds||Qr(t.handles),o=n.internals.handleBounds||Qr(n.handles),r=Jr((s==null?void 0:s.source)??[],e.sourceHandle),l=Jr(e.connectionMode===yt.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!r||!l)return(x=e.onError)==null||x.call(e,"008",Le.error008(r?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(r==null?void 0:r.position)||q.Bottom,a=(l==null?void 0:l.position)||q.Top,u=cn(t,r,c),d=cn(n,l,a);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:a}}function Qr(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function cn(e,t,n=q.Left,s=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,r=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??Je(e);if(s)return{x:o+l/2,y:r+c/2};switch((t==null?void 0:t.position)??n){case q.Top:return{x:o+l/2,y:r};case q.Right:return{x:o+l,y:r+c/2};case q.Bottom:return{x:o+l/2,y:r+c};case q.Left:return{x:o,y:r+c/2}}}function Jr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function jo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function _y(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:o}){const r=new Set;return e.reduce((l,c)=>([c.markerStart||s,c.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=jo(a,t);r.has(u)||(l.push({id:u,color:a.color||n,...a}),r.add(u))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const tr={nodeOrigin:[0,0],nodeExtent:rn,elevateNodesOnSelect:!0,defaults:{}},ky={...tr,checkEquality:!0};function nr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Py(e,t,n){const s=nr(tr,n);for(const o of e.values())if(o.parentId)sr(o,e,t,s);else{const r=pn(o,s.nodeOrigin),l=At(o.extent)?o.extent:s.nodeExtent,c=St(r,l,Je(o));o.internals.positionAbsolute=c}}function Eo(e,t,n,s){var c,a;const o=nr(ky,s),r=new Map(t),l=o!=null&&o.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let d=r.get(u.id);if(o.checkEquality&&u===(d==null?void 0:d.internals.userNode))t.set(u.id,d);else{const x=pn(u,o.nodeOrigin),p=At(u.extent)?u.extent:o.nodeExtent,m=St(x,p,Je(u));d={...o.defaults,...u,measured:{width:(c=u.measured)==null?void 0:c.width,height:(a=u.measured)==null?void 0:a.height},internals:{positionAbsolute:m,handleBounds:u.measured?d==null?void 0:d.internals.handleBounds:void 0,z:Wc(u,l),userNode:u}},t.set(u.id,d)}u.parentId&&sr(d,t,n,s)}}function My(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function sr(e,t,n,s){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:l}=nr(tr,s),c=e.parentId,a=t.get(c);if(!a){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}My(e,n);const u=o?1e3:0,{x:d,y:x,z:p}=Ny(e,a,r,l,u),{positionAbsolute:m}=e.internals,h=d!==m.x||x!==m.y;(h||p!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:h?{x:d,y:x}:m,z:p})}function Wc(e,t){return(Be(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Ny(e,t,n,s,o){const{x:r,y:l}=t.internals.positionAbsolute,c=Je(e),a=pn(e,n),u=At(e.extent)?St(a,e.extent,c):a;let d=St({x:r+u.x,y:l+u.y},s,c);e.extent==="parent"&&(d=Tc(d,c,t));const x=Wc(e,o),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>x?p:x}}function or(e,t,n,s=[0,0]){var l;const o=[],r=new Map;for(const c of e){const a=t.get(c.parentId);if(!a)continue;const u=((l=r.get(c.parentId))==null?void 0:l.expandedRect)??Tt(a),d=$c(u,c.rect);r.set(c.parentId,{expandedRect:d,parent:a})}return r.size>0&&r.forEach(({expandedRect:c,parent:a},u)=>{var S;const d=a.internals.positionAbsolute,x=Je(a),p=a.origin??s,m=c.x<d.x?Math.round(Math.abs(d.x-c.x)):0,h=c.y<d.y?Math.round(Math.abs(d.y-c.y)):0,E=Math.max(x.width,Math.round(c.width)),v=Math.max(x.height,Math.round(c.height)),w=(E-x.width)*p[0],_=(v-x.height)*p[1];(m>0||h>0||w||_)&&(o.push({id:u,type:"position",position:{x:a.position.x-m+w,y:a.position.y-h+_}}),(S=n.get(u))==null||S.forEach(y=>{e.some(C=>C.id===y.id)||o.push({id:y.id,type:"position",position:{x:y.position.x+m,y:y.position.y+h}})})),(x.width<c.width||x.height<c.height||m||h)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:E+(m?p[0]*m-w:0),height:v+(h?p[1]*h-_:0)}})}),o}function Ly(e,t,n,s,o,r){const l=s==null?void 0:s.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const a=[],u=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(u.transform),x=[];for(const p of e.values()){const m=t.get(p.id);if(m)if(m.hidden)m.internals={...m.internals,handleBounds:void 0},c=!0;else{const h=Ss(p.nodeElement),E=m.measured.width!==h.width||m.measured.height!==h.height;if(!!(h.width&&h.height&&(E||!m.internals.handleBounds||p.force))){const w=p.nodeElement.getBoundingClientRect(),_=At(m.extent)?m.extent:r;let{positionAbsolute:S}=m.internals;m.parentId&&m.extent==="parent"?S=Tc(S,h,t.get(m.parentId)):_&&(S=St(S,_,h)),m.measured=h,m.internals={...m.internals,positionAbsolute:S,handleBounds:{source:Wr("source",p.nodeElement,w,d,m.id),target:Wr("target",p.nodeElement,w,d,m.id)}},m.parentId&&sr(m,t,n,{nodeOrigin:o}),c=!0,E&&(a.push({id:m.id,type:"dimensions",dimensions:h}),m.expandParent&&m.parentId&&x.push({id:m.id,parentId:m.parentId,rect:Tt(m,o)}))}}}if(x.length>0){const p=or(x,t,n,o);a.push(...p)}return{changes:a,updatedInternals:c}}async function Ty({delta:e,panZoom:t,transform:n,translateExtent:s,width:o,height:r}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,r]],s),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function Xc(e,t,n){e.clear(),t.clear();for(const s of n){const{source:o,target:r,sourceHandle:l=null,targetHandle:c=null}=s,a=`${o}-source-${l}`,u=`${r}-target-${c}`,d=e.get(a)||new Map,x=e.get(u)||new Map,p={edgeId:s.id,source:o,target:r,sourceHandle:l,targetHandle:c};t.set(s.id,s),e.set(a,d.set(`${r}-${c}`,p)),e.set(u,x.set(`${o}-${l}`,p))}}function Kc(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Kc(n,t):!1}function ei(e,t,n){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===n)return!1;s=s.parentElement}while(s);return!1}function Ay(e,t,n,s){const o=new Map;for(const[r,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!Kc(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(r);c&&o.set(r,{id:r,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return o}function Hs({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var l,c,a;const o=[];for(const[u,d]of t){const x=(l=n.get(u))==null?void 0:l.internals.userNode;x&&o.push({...x,position:d.position,dragging:s})}if(!e)return[o[0],o];const r=(c=n.get(e))==null?void 0:c.internals.userNode;return[r?{...r,position:((a=t.get(e))==null?void 0:a.position)||r.position,dragging:s}:o[0],o]}function $y({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:o}){let r={x:null,y:null},l=0,c=new Map,a=!1,u={x:0,y:0},d=null,x=!1,p=null,m=!1;function h({noDragClassName:v,handleSelector:w,domNode:_,isSelectable:S,nodeId:y,nodeClickDistance:C=0}){p=Te(_);function P({x:A,y:O},L){const{nodeLookup:D,nodeExtent:R,snapGrid:I,snapToGrid:k,nodeOrigin:B,onNodeDrag:M,onSelectionDrag:z,onError:V,updateNodePositions:Y}=t();r={x:A,y:O};let W=!1,J={x:0,y:0,x2:0,y2:0};if(c.size>1&&R){const K=mn(c);J=mo(K)}for(const[K,G]of c){if(!D.has(K))continue;let Q={x:A-G.distance.x,y:O-G.distance.y};k&&(Q=ys(Q,I));let ne=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(c.size>1&&R&&!G.extent){const{positionAbsolute:xe}=G.internals,ae=xe.x-J.x+R[0][0],H=xe.x+G.measured.width-J.x2+R[1][0],ee=xe.y-J.y+R[0][1],ce=xe.y+G.measured.height-J.y2+R[1][1];ne=[[ae,ee],[H,ce]]}const{position:X,positionAbsolute:oe}=Lc({nodeId:K,nextPosition:Q,nodeLookup:D,nodeExtent:ne,nodeOrigin:B,onError:V});W=W||G.position.x!==X.x||G.position.y!==X.y,G.position=X,G.internals.positionAbsolute=oe}if(W&&(Y(c,!0),L&&(s||M||!y&&z))){const[K,G]=Hs({nodeId:y,dragItems:c,nodeLookup:D});s==null||s(L,c,K,G),M==null||M(L,K,G),y||z==null||z(L,G)}}async function b(){if(!d)return;const{transform:A,panBy:O,autoPanSpeed:L}=t(),[D,R]=Ac(u,d,L);(D!==0||R!==0)&&(r.x=(r.x??0)-D/A[2],r.y=(r.y??0)-R/A[2],await O({x:D,y:R})&&P(r,null)),l=requestAnimationFrame(b)}function T(A){var W;const{nodeLookup:O,multiSelectionActive:L,nodesDraggable:D,transform:R,snapGrid:I,snapToGrid:k,selectNodesOnDrag:B,onNodeDragStart:M,onSelectionDragStart:z,unselectNodesAndEdges:V}=t();x=!0,(!B||!S)&&!L&&y&&((W=O.get(y))!=null&&W.selected||V()),S&&B&&y&&(e==null||e(y));const Y=Ut(A.sourceEvent,{transform:R,snapGrid:I,snapToGrid:k,containerBounds:d});if(r=Y,c=Ay(O,D,Y,y),c.size>0&&(n||M||!y&&z)){const[J,K]=Hs({nodeId:y,dragItems:c,nodeLookup:O});n==null||n(A.sourceEvent,c,J,K),M==null||M(A.sourceEvent,J,K),y||z==null||z(A.sourceEvent,K)}}const N=gc().clickDistance(C).on("start",A=>{const{domNode:O,nodeDragThreshold:L,transform:D,snapGrid:R,snapToGrid:I}=t();d=(O==null?void 0:O.getBoundingClientRect())||null,m=!1,L===0&&T(A),r=Ut(A.sourceEvent,{transform:D,snapGrid:R,snapToGrid:I,containerBounds:d}),u=Xe(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:O,transform:L,snapGrid:D,snapToGrid:R,nodeDragThreshold:I,nodeLookup:k}=t(),B=Ut(A.sourceEvent,{transform:L,snapGrid:D,snapToGrid:R,containerBounds:d});if((A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||y&&!k.has(y))&&(m=!0),!m){if(!a&&O&&x&&(a=!0,b()),!x){const M=B.xSnapped-(r.x??0),z=B.ySnapped-(r.y??0);Math.sqrt(M*M+z*z)>I&&T(A)}(r.x!==B.xSnapped||r.y!==B.ySnapped)&&c&&x&&(u=Xe(A.sourceEvent,d),P(B,A.sourceEvent))}}).on("end",A=>{if(!(!x||m)&&(a=!1,x=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:O,updateNodePositions:L,onNodeDragStop:D,onSelectionDragStop:R}=t();if(L(c,!1),o||D||!y&&R){const[I,k]=Hs({nodeId:y,dragItems:c,nodeLookup:O,dragging:!1});o==null||o(A.sourceEvent,c,I,k),D==null||D(A.sourceEvent,I,k),y||R==null||R(A.sourceEvent,k)}}}).filter(A=>{const O=A.target;return!A.button&&(!v||!ei(O,`.${v}`,_))&&(!w||ei(O,w,_))});p.call(N)}function E(){p==null||p.on(".drag",null)}return{update:h,destroy:E}}function Iy(e,t,n){const s=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())ln(o,Tt(r))>0&&s.push(r);return s}const Oy=250;function By(e,t,n,s){var c,a;let o=[],r=1/0;const l=Iy(e,n,t+Oy);for(const u of l){const d=[...((c=u.internals.handleBounds)==null?void 0:c.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const x of d){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:p,y:m}=cn(u,x,x.position,!0),h=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));h>t||(h<r?(o=[{...x,x:p,y:m}],r=h):h===r&&o.push({...x,x:p,y:m}))}}if(!o.length)return null;if(o.length>1){const u=s.type==="source"?"target":"source";return o.find(d=>d.type===u)??o[0]}return o[0]}function Gc(e,t,n,s,o,r=!1){var u,d,x;const l=s.get(e);if(!l)return null;const c=o==="strict"?(u=l.internals.handleBounds)==null?void 0:u[t]:[...((d=l.internals.handleBounds)==null?void 0:d.source)??[],...((x=l.internals.handleBounds)==null?void 0:x.target)??[]],a=(n?c==null?void 0:c.find(p=>p.id===n):c==null?void 0:c[0])??null;return a&&r?{...a,...cn(l,a,a.position,!0)}:a}function Uc(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Dy(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Qc=()=>!0;function zy(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:o,edgeUpdaterType:r,isTarget:l,domNode:c,nodeLookup:a,lib:u,autoPanOnConnect:d,flowId:x,panBy:p,cancelConnection:m,onConnectStart:h,onConnect:E,onConnectEnd:v,isValidConnection:w=Qc,onReconnectEnd:_,updateConnection:S,getTransform:y,getFromHandle:C,autoPanSpeed:P}){const b=Dc(e.target);let T=0,N;const{x:A,y:O}=Xe(e),L=b==null?void 0:b.elementFromPoint(A,O),D=Uc(r,L),R=c==null?void 0:c.getBoundingClientRect();if(!R||!D)return;const I=Gc(o,D,s,a,t);if(!I)return;let k=Xe(e,R),B=!1,M=null,z=!1,V=null;function Y(){if(!d||!R)return;const[oe,xe]=Ac(k,R,P);p({x:oe,y:xe}),T=requestAnimationFrame(Y)}const W={...I,nodeId:o,type:D,position:I.position},J=a.get(o),G={inProgress:!0,isValid:null,from:cn(J,W,q.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:J,to:k,toHandle:null,toPosition:Zr[W.position],toNode:null};S(G);let Q=G;h==null||h(e,{nodeId:o,handleId:s,handleType:D});function ne(oe){if(!C()||!W){X(oe);return}const xe=y();k=Xe(oe,R),N=By(hn(k,xe,!1,[1,1]),n,a,W),B||(Y(),B=!0);const ae=Jc(oe,{handle:N,connectionMode:t,fromNodeId:o,fromHandleId:s,fromType:l?"target":"source",isValidConnection:w,doc:b,lib:u,flowId:x,nodeLookup:a});V=ae.handleDomNode,M=ae.connection,z=Dy(!!N,ae.isValid);const H={...Q,isValid:z,to:N&&z?Ic({x:N.x,y:N.y},xe):k,toHandle:ae.toHandle,toPosition:z&&ae.toHandle?ae.toHandle.position:Zr[W.position],toNode:ae.toHandle?a.get(ae.toHandle.nodeId):null};z&&N&&Q.toHandle&&H.toHandle&&Q.toHandle.type===H.toHandle.type&&Q.toHandle.nodeId===H.toHandle.nodeId&&Q.toHandle.id===H.toHandle.id&&Q.to.x===H.to.x&&Q.to.y===H.to.y||(S(H),Q=H)}function X(oe){(N||V)&&M&&z&&(E==null||E(M));const{inProgress:xe,...ae}=Q,H={...ae,toPosition:Q.toHandle?Q.toPosition:null};v==null||v(oe,H),r&&(_==null||_(oe,H)),m(),cancelAnimationFrame(T),B=!1,z=!1,M=null,V=null,b.removeEventListener("mousemove",ne),b.removeEventListener("mouseup",X),b.removeEventListener("touchmove",ne),b.removeEventListener("touchend",X)}b.addEventListener("mousemove",ne),b.addEventListener("mouseup",X),b.addEventListener("touchmove",ne),b.addEventListener("touchend",X)}function Jc(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:r,doc:l,lib:c,flowId:a,isValidConnection:u=Qc,nodeLookup:d}){const x=r==="target",p=t?l.querySelector(`.${c}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:h}=Xe(e),E=l.elementFromPoint(m,h),v=E!=null&&E.classList.contains(`${c}-flow__handle`)?E:p,w={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const _=Uc(void 0,v),S=v.getAttribute("data-nodeid"),y=v.getAttribute("data-handleid"),C=v.classList.contains("connectable"),P=v.classList.contains("connectableend");if(!S||!_)return w;const b={source:x?S:s,sourceHandle:x?y:o,target:x?s:S,targetHandle:x?o:y};w.connection=b;const N=C&&P&&(n===yt.Strict?x&&_==="source"||!x&&_==="target":S!==s||y!==o);w.isValid=N&&u(b),w.toHandle=Gc(S,_,y,d,n,!1)}return w}const yo={onPointerDown:zy,isValid:Jc};function Vy({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const o=Te(e);function r({translateExtent:c,width:a,height:u,zoomStep:d=10,pannable:x=!0,zoomable:p=!0,inversePan:m=!1}){const h=S=>{const y=n();if(S.sourceEvent.type!=="wheel"||!t)return;const C=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*d,P=y[2]*Math.pow(2,C);t.scaleTo(P)};let E=[0,0];const v=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(E=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},w=S=>{const y=n();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!t)return;const C=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],P=[C[0]-E[0],C[1]-E[1]];E=C;const b=s()*Math.max(y[2],Math.log(y[2]))*(m?-1:1),T={x:y[0]-P[0]*b,y:y[1]-P[1]*b},N=[[0,0],[a,u]];t.setViewportConstrained({x:T.x,y:T.y,zoom:y[2]},N,c)},_=bc().on("start",v).on("zoom",x?w:null).on("zoom.wheel",p?h:null);o.call(_,{})}function l(){o.on("zoom",null)}return{update:r,destroy:l,pointer:Oe}}const Fy=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Rs=e=>({x:e.x,y:e.y,zoom:e.k}),Zs=({x:e,y:t,zoom:n})=>gs.translate(e,t).scale(n),vt=(e,t)=>e.target.closest(`.${t}`),ea=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ys=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},ta=e=>{const t=e.ctrlKey&&ts()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Hy({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:r,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:u}){return d=>{if(vt(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const x=n.property("__zoom").k||1;if(d.ctrlKey&&l){const v=Oe(d),w=ta(d),_=x*Math.pow(2,w);s.scaleTo(n,_,v,d);return}const p=d.deltaMode===1?20:1;let m=o===ht.Vertical?0:d.deltaX*p,h=o===ht.Horizontal?0:d.deltaY*p;!ts()&&d.shiftKey&&o!==ht.Vertical&&(m=d.deltaY*p,h=0),s.translateBy(n,-(m/x)*r,-(h/x)*r,{internal:!0});const E=Rs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(d,E)),e.isPanScrolling&&(a==null||a(d,E),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,E),e.isPanScrolling=!1},150))}}function Zy({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,o){if(!t&&s.type==="wheel"&&!s.ctrlKey||vt(s,e))return null;s.preventDefault(),n.call(this,s,o)}}function Yy({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var r,l,c;if((r=s.sourceEvent)!=null&&r.internal)return;const o=Rs(s.transform);e.mouseButton=((l=s.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((c=s.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,o))}}function qy({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:o}){return r=>{var l,c;e.usedRightMouseButton=!!(n&&ea(t,e.mouseButton??0)),(l=r.sourceEvent)!=null&&l.sync||s([r.transform.x,r.transform.y,r.transform.k]),o&&!((c=r.sourceEvent)!=null&&c.internal)&&(o==null||o(r.sourceEvent,Rs(r.transform)))}}function Wy({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:r}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,r&&ea(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&r(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),o&&Fy(e.prevViewport,l.transform))){const a=Rs(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(l.sourceEvent,a)},n?150:0)}}}function Xy({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:r,userSelectionActive:l,noWheelClassName:c,noPanClassName:a,lib:u}){return d=>{var h;const x=e||t,p=n&&d.ctrlKey;if(d.button===1&&d.type==="mousedown"&&(vt(d,`${u}-flow__node`)||vt(d,`${u}-flow__edge`)))return!0;if(!s&&!x&&!o&&!r&&!n||l||vt(d,c)&&d.type==="wheel"||vt(d,a)&&(d.type!=="wheel"||o&&d.type==="wheel"&&!e)||!n&&d.ctrlKey&&d.type==="wheel")return!1;if(!n&&d.type==="touchstart"&&((h=d.touches)==null?void 0:h.length)>1)return d.preventDefault(),!1;if(!x&&!o&&!p&&d.type==="wheel"||!s&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(s)&&!s.includes(d.button)&&d.type==="mousedown")return!1;const m=Array.isArray(s)&&s.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||d.type==="wheel")&&m}}function Ky({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:o,viewport:r,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:a,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},x=e.getBoundingClientRect(),p=bc().clickDistance(!Be(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(o),m=Te(e).call(p);S({x:r.x,y:r.y,zoom:Lt(r.zoom,t,n)},[[0,0],[x.width,x.height]],o);const h=m.on("wheel.zoom"),E=m.on("dblclick.zoom");p.wheelDelta(ta);function v(L,D){return m?new Promise(R=>{p==null||p.transform(Ys(m,D==null?void 0:D.duration,()=>R(!0)),L)}):Promise.resolve(!1)}function w({noWheelClassName:L,noPanClassName:D,onPaneContextMenu:R,userSelectionActive:I,panOnScroll:k,panOnDrag:B,panOnScrollMode:M,panOnScrollSpeed:z,preventScrolling:V,zoomOnPinch:Y,zoomOnScroll:W,zoomOnDoubleClick:J,zoomActivationKeyPressed:K,lib:G,onTransformChange:Q}){I&&!d.isZoomingOrPanning&&_();const X=k&&!K&&!I?Hy({zoomPanValues:d,noWheelClassName:L,d3Selection:m,d3Zoom:p,panOnScrollMode:M,panOnScrollSpeed:z,zoomOnPinch:Y,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):Zy({noWheelClassName:L,preventScrolling:V,d3ZoomHandler:h});if(m.on("wheel.zoom",X,{passive:!1}),!I){const xe=Yy({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:c});p.on("start",xe);const ae=qy({zoomPanValues:d,panOnDrag:B,onPaneContextMenu:!!R,onPanZoom:l,onTransformChange:Q});p.on("zoom",ae);const H=Wy({zoomPanValues:d,panOnDrag:B,panOnScroll:k,onPaneContextMenu:R,onPanZoomEnd:a,onDraggingChange:u});p.on("end",H)}const oe=Xy({zoomActivationKeyPressed:K,panOnDrag:B,zoomOnScroll:W,panOnScroll:k,zoomOnDoubleClick:J,zoomOnPinch:Y,userSelectionActive:I,noPanClassName:D,noWheelClassName:L,lib:G});p.filter(oe),J?m.on("dblclick.zoom",E):m.on("dblclick.zoom",null)}function _(){p.on("zoom",null)}async function S(L,D,R){const I=Zs(L),k=p==null?void 0:p.constrain()(I,D,R);return k&&await v(k),new Promise(B=>B(k))}async function y(L,D){const R=Zs(L);return await v(R,D),new Promise(I=>I(R))}function C(L){if(m){const D=Zs(L),R=m.property("__zoom");(R.k!==L.zoom||R.x!==L.x||R.y!==L.y)&&(p==null||p.transform(m,D,null,{sync:!0}))}}function P(){const L=m?vc(m.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}function b(L,D){return m?new Promise(R=>{p==null||p.scaleTo(Ys(m,D==null?void 0:D.duration,()=>R(!0)),L)}):Promise.resolve(!1)}function T(L,D){return m?new Promise(R=>{p==null||p.scaleBy(Ys(m,D==null?void 0:D.duration,()=>R(!0)),L)}):Promise.resolve(!1)}function N(L){p==null||p.scaleExtent(L)}function A(L){p==null||p.translateExtent(L)}function O(L){const D=!Be(L)||L<0?0:L;p==null||p.clickDistance(D)}return{update:w,destroy:_,setViewport:y,setViewportConstrained:S,getViewport:P,scaleTo:b,scaleBy:T,setScaleExtent:N,setTranslateExtent:A,syncViewport:C,setClickDistance:O}}var Qt;(function(e){e.Line="line",e.Handle="handle"})(Qt||(Qt={}));function Gy({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:o,affectsY:r}){const l=e-t,c=n-s,a=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&o&&(a[0]=a[0]*-1),c&&r&&(a[1]=a[1]*-1),a}function Uy(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:o}}function tt(e,t){return Math.max(0,t-e)}function nt(e,t){return Math.max(0,e-t)}function Cn(e,t,n){return Math.max(0,t-e,e-n)}function ti(e,t){return e?!t:t}function Qy(e,t,n,s,o,r,l,c){let{affectsX:a,affectsY:u}=t;const{isHorizontal:d,isVertical:x}=t,p=d&&x,{xSnapped:m,ySnapped:h}=n,{minWidth:E,maxWidth:v,minHeight:w,maxHeight:_}=s,{x:S,y,width:C,height:P,aspectRatio:b}=e;let T=Math.floor(d?m-e.pointerX:0),N=Math.floor(x?h-e.pointerY:0);const A=C+(a?-T:T),O=P+(u?-N:N),L=-r[0]*C,D=-r[1]*P;let R=Cn(A,E,v),I=Cn(O,w,_);if(l){let M=0,z=0;a&&T<0?M=tt(S+T+L,l[0][0]):!a&&T>0&&(M=nt(S+A+L,l[1][0])),u&&N<0?z=tt(y+N+D,l[0][1]):!u&&N>0&&(z=nt(y+O+D,l[1][1])),R=Math.max(R,M),I=Math.max(I,z)}if(c){let M=0,z=0;a&&T>0?M=nt(S+T,c[0][0]):!a&&T<0&&(M=tt(S+A,c[1][0])),u&&N>0?z=nt(y+N,c[0][1]):!u&&N<0&&(z=tt(y+O,c[1][1])),R=Math.max(R,M),I=Math.max(I,z)}if(o){if(d){const M=Cn(A/b,w,_)*b;if(R=Math.max(R,M),l){let z=0;!a&&!u||a&&!u&&p?z=nt(y+D+A/b,l[1][1])*b:z=tt(y+D+(a?T:-T)/b,l[0][1])*b,R=Math.max(R,z)}if(c){let z=0;!a&&!u||a&&!u&&p?z=tt(y+A/b,c[1][1])*b:z=nt(y+(a?T:-T)/b,c[0][1])*b,R=Math.max(R,z)}}if(x){const M=Cn(O*b,E,v)/b;if(I=Math.max(I,M),l){let z=0;!a&&!u||u&&!a&&p?z=nt(S+O*b+L,l[1][0])/b:z=tt(S+(u?N:-N)*b+L,l[0][0])/b,I=Math.max(I,z)}if(c){let z=0;!a&&!u||u&&!a&&p?z=tt(S+O*b,c[1][0])/b:z=nt(S+(u?N:-N)*b,c[0][0])/b,I=Math.max(I,z)}}}N=N+(N<0?I:-I),T=T+(T<0?R:-R),o&&(p?A>O*b?N=(ti(a,u)?-T:T)/b:T=(ti(a,u)?-N:N)*b:d?(N=T/b,u=a):(T=N*b,a=u));const k=a?S+T:S,B=u?y+N:y;return{width:C+(a?-T:T),height:P+(u?-N:N),x:r[0]*T*(a?-1:1)+k,y:r[1]*N*(u?-1:1)+B}}const na={width:0,height:0,x:0,y:0},Jy={...na,pointerX:0,pointerY:0,aspectRatio:1};function e0(e){return[[0,0],[e.measured.width,e.measured.height]]}function t0(e,t,n){const s=t.position.x+e.position.x,o=t.position.y+e.position.y,r=e.measured.width??0,l=e.measured.height??0,c=n[0]*r,a=n[1]*l;return[[s-c,o-a],[s+r-c,o+l-a]]}function n0({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:o}){const r=Te(e);function l({controlPosition:a,boundaries:u,keepAspectRatio:d,onResizeStart:x,onResize:p,onResizeEnd:m,shouldResize:h}){let E={...na},v={...Jy};const w=Uy(a);let _,S=null,y=[],C,P,b;const T=gc().on("start",N=>{const{nodeLookup:A,transform:O,snapGrid:L,snapToGrid:D,nodeOrigin:R,paneDomNode:I}=n();if(_=A.get(t),!_)return;S=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:k,ySnapped:B}=Ut(N.sourceEvent,{transform:O,snapGrid:L,snapToGrid:D,containerBounds:S});E={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},v={...E,pointerX:k,pointerY:B,aspectRatio:E.width/E.height},C=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(C=A.get(_.parentId),P=C&&_.extent==="parent"?e0(C):void 0),y=[],b=void 0;for(const[M,z]of A)if(z.parentId===t&&(y.push({id:M,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const V=t0(z,_,z.origin??R);b?b=[[Math.min(V[0][0],b[0][0]),Math.min(V[0][1],b[0][1])],[Math.max(V[1][0],b[1][0]),Math.max(V[1][1],b[1][1])]]:b=V}x==null||x(N,{...E})}).on("drag",N=>{const{transform:A,snapGrid:O,snapToGrid:L,nodeOrigin:D}=n(),R=Ut(N.sourceEvent,{transform:A,snapGrid:O,snapToGrid:L,containerBounds:S}),I=[];if(!_)return;const{x:k,y:B,width:M,height:z}=E,V={},Y=_.origin??D,{width:W,height:J,x:K,y:G}=Qy(v,w,R,u,d,Y,P,b),Q=W!==M,ne=J!==z,X=K!==k&&Q,oe=G!==B&≠if(!X&&!oe&&!Q&&!ne)return;if((X||oe||Y[0]===1||Y[1]===1)&&(V.x=X?K:E.x,V.y=oe?G:E.y,E.x=V.x,E.y=V.y,y.length>0)){const ee=K-k,ce=G-B;for(const je of y)je.position={x:je.position.x-ee+Y[0]*(W-M),y:je.position.y-ce+Y[1]*(J-z)},I.push(je)}if((Q||ne)&&(V.width=Q?W:E.width,V.height=ne?J:E.height,E.width=V.width,E.height=V.height),C&&_.expandParent){const ee=Y[0]*(V.width??0);V.x&&V.x<ee&&(E.x=ee,v.x=v.x-(V.x-ee));const ce=Y[1]*(V.height??0);V.y&&V.y<ce&&(E.y=ce,v.y=v.y-(V.y-ce))}const xe=Gy({width:E.width,prevWidth:M,height:E.height,prevHeight:z,affectsX:w.affectsX,affectsY:w.affectsY}),ae={...E,direction:xe};(h==null?void 0:h(N,ae))!==!1&&(p==null||p(N,ae),s(V,I))}).on("end",N=>{m==null||m(N,{...E}),o==null||o()});r.call(T)}function c(){r.on(".drag",null)}return{update:l,destroy:c}}var So={exports:{}},qs={},vn={exports:{}},Ws={};/**
|
|
1
|
+
"use strict";var af=Object.defineProperty;var uf=(e,t,n)=>t in e?af(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>uf(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-Cek9Ww4S.cjs"),g=require("react"),y=require("./Toggle-DnW_7Wr_.cjs"),f=require("./css-BghghSL0.cjs"),An=require("./external-DtnrBHvV.cjs"),H=require("./aggregator-y-jNJhKX.cjs"),J=require("./Pack-Dvf8sQVK.cjs"),df=require("./external-Dk1cXh1i.cjs"),Se=require("./external-D-PsJ1E5.cjs"),xf=require("./external-BV_9eXZJ.cjs"),Vi=require("./Animated-D4IT49PS.cjs"),A=require("./LinePlot-DbXPZbQH.cjs"),re=require("zod"),Ce=require("./external-3DAfrFCZ.cjs"),ff=require("./Text-BJ2Pml4B.cjs"),Fi=require("./external-B7Vpq1ol.cjs");require("./Item-DuYEON-n.cjs");const _o=require("react-dom"),Ot=require("./external-Ctvxtwfh.cjs"),pf=require("./external-CqLAQBcO.cjs"),Hi=require("./units-9h1yAbxY.cjs"),Pe=require("./external-t43feeRt.cjs"),mf=require("./external-iiNZw96o.cjs"),hf=require("./external-xtDHiIUX.cjs"),gf=require("./external-ZxIaRZdb.cjs"),yf=require("./Video-CGe5Hscl.cjs"),Ef=(e,t,n=150)=>{const[s,o]=g.useState(e);return g.useEffect(()=>{const r=setTimeout(()=>o(t),n);return()=>clearTimeout(r)},[t,n]),s},Zi=({variant:e="info",...t})=>i.jsxRuntimeExports.jsx(y.e4.Circle,{color:y.variantColors[e],...t}),jf=({status:{key:e,time:t,count:n,message:s,description:o,variant:r},silence:l,actions:c,className:a,children:u,...d})=>i.jsxRuntimeExports.jsxs(J.Space,{className:f.CSS(f.CSS.B("notification"),a),direction:"y",empty:!0,...d,children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(Zi,{style:{height:"2.25rem",width:"2.5rem"},variant:r}),i.jsxRuntimeExports.jsx(y.Text,{level:"small",shade:7,children:`x${n}`}),i.jsxRuntimeExports.jsx(y.DateTime,{className:f.CSS(f.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),i.jsxRuntimeExports.jsx(y.Icon,{className:f.CSS(f.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:i.jsxRuntimeExports.jsx(y.e4.Close,{})})]}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",align:"start",className:f.CSS(f.CSS.BE("notification","content")),size:"small",children:[u??i.jsxRuntimeExports.jsx(y.Text,{className:f.CSS(f.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),o!=null&&i.jsxRuntimeExports.jsx(y.Text,{className:f.CSS(f.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),c!=null&&i.jsxRuntimeExports.jsx(J.Space,{direction:"x",align:"center",justify:"end",className:f.CSS(f.CSS.BE("notification","actions")),children:H.A(c).map(x=>i.jsxRuntimeExports.jsx(Sf,{action:x},x.key))})]},t.toString()),Sf=({action:e})=>{if(!g.isValidElement(e)){const t=e;return i.jsxRuntimeExports.jsx(y.Button,{...t})}return e},Rf=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:y.Aggregator,Circle:Zi,Notification:jf,Text:y.Text$2,VARIANTS:H.VARIANTS,specZ:H.specZ$1,useAggregator:y.useAggregator,useContext:y.useContext$3,useNotifications:y.useNotifications,variantZ:H.variantZ},Symbol.toStringTag,{value:"Module"})),Cf=Object.freeze(Object.defineProperty({__proto__:null,Config:y.Config,Context:y.Context,Dialog:y.Dialog$1,chooseLocation:y.chooseLocation,formatTip:y.formatTip,useConfig:y.useConfig,wrap:y.wrap},Symbol.toStringTag,{value:"Module"})),Hn=e=>e.preventDefault(),as=g.forwardRef(({location:e,style:t,size:n,className:s,children:o,onDragStart:r,sizeUnits:l="px",showHandle:c=!0,...a},u)=>{const d=f.K.construct(e),x=f.K.direction(d),p=f.g.dimension(x);return i.jsxRuntimeExports.jsxs("div",{className:f.CSS(f.CSS.B("resize"),f.CSS.loc(d),f.CSS.dir(x),s),style:{[p]:`${n}${l}`,...t},ref:u,...a,children:[o,c&&i.jsxRuntimeExports.jsx("div",{draggable:!0,className:f.CSS(f.CSS.BE("resize","handle"),f.CSS.bordered(f.K.swap(d))),onDragStart:r,onDrag:Hn,onDragEnd:Hn})]})});as.displayName="Resize.Core";const ko=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:o="x"})=>{const r=g.useRef(null),[l,c]=g.useState({sizeDistribution:wf(n,t),root:null}),a=g.useCallback((x,p,m)=>{if(r.current==null)return;const h=f.Eo.dim(f.Eo.construct(r.current),o);c(E=>zs(E,h,x,s,p,m))},[s,c,o]);g.useEffect(()=>e==null?void 0:e(l.sizeDistribution),[l.sizeDistribution,e]);const u=g.useCallback((x,p)=>{x.preventDefault();const m=o==="x"?"clientX":"clientY",h=w=>a(p,w[m]),E=()=>{c(w=>({...w,root:null})),document.removeEventListener("mousemove",h)};c(w=>({...w,root:x[m]})),document.addEventListener("mousemove",h),document.addEventListener("mouseup",E,{once:!0})},[c,o,zs]);return{setSize:g.useCallback((x,p)=>a(x,void 0,p),[zs]),props:{direction:o,sizeDistribution:l.sizeDistribution,onDragHandle:u,ref:r}}},us=g.forwardRef(({direction:e="x",children:t,sizeDistribution:n,onDragHandle:s,className:o,...r},l)=>{const c=f.g.construct(e),a=g.Children.toArray(t);return n=bf(n),i.jsxRuntimeExports.jsx(J.Space,{...r,ref:l,direction:c,className:f.CSS(f.CSS.B("resize-multiple"),o),empty:!0,grow:!0,children:a.map((u,d)=>i.jsxRuntimeExports.jsx(as,{onDragStart:x=>s(x,d),location:f.g.location(c),size:n[d]*100,sizeUnits:"%",showHandle:d!==a.length-1,children:u},d))})});us.displayName="Resize.Multiple";const wf=(e,t)=>{const n=e.reduce((o,r)=>o+r,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(o=>o/n);if(e.every(o=>o<=1)){const o=1-n;return[...e,...Array(s).fill(o/s)]}return e.map(()=>1/t)},Os=.001,bf=e=>e.every(t=>f.W.closeTo(t,1/e.length),Os)?e.map((t,n)=>n%2===0?t+Os:n===e.length-1?t:t-Os):e,zs=(e,t,n,s,o,r)=>{const l=Gi(e,t,n,o,r),[c,a]=vf(e.sizeDistribution,n,l,s/t),u=a?o??null:e.root;return{...e,sizeDistribution:c,root:u}},Gi=(e,t,n,s,o)=>{let r;if(o!=null)o>1&&(o/=t),r=o-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");r=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return r},vf=(e,t,n,s)=>{let o=t;for(;o>0&&e[o]+n<=s;)o--;const r=e[o]+n,l=_f(o,e,s,n),c=e[l]-n;return r<s||c<s?[e,!1]:[e.map((a,u)=>u===o?r:u===l?c:a),!0]},_f=(e,t,n,s)=>(e===t.length-1?Mf:kf)(e,t,n,s),kf=(e,t,n,s)=>{let o=e+1;for(;o<t.length-1&&t[o]-s<=n;)o++;return o},Mf=(e,t,n,s)=>{let o=e-1;for(;o>0&&t[o]-s<=n;)o--;return o},Bs=2,Yi=({onCollapse:e,onResize:t,location:n="left",minSize:s=100,maxSize:o=1/0,initialSize:r=200,collapseThreshold:l=1/0,className:c,...a})=>{const[u,d]=g.useState(f.Y(r,s,o)),x=g.useRef(null),p=f.K.construct(n),m=g.useCallback(S=>{if(x.current===null)return 0;const j=f.Eo.dim(S,f.K.direction(p),!0)*(1-2*Number(["bottom","right"].includes(p))),b=x.current+j,M=f.Y(b,s,o);return(M-b)/s>l?Bs:M},[p,s,o,l]),h=g.useRef(null),E=g.useCallback(S=>{const j=m(S);d(j),h.current!=null&&(t==null||t(j,f.Eo.construct(h.current)))},[t,m]),w=g.useCallback(()=>d(S=>(x.current=S,S)),[d]),R=g.useCallback(S=>m(S)===Bs&&(e==null?void 0:e()),[e,m]);g.useEffect(()=>d(S=>{const j=f.Y(S,s,o);return x.current=j,j}),[s,o]);const k=y.useCursorDrag({onMove:E,onStart:w,onEnd:R});return i.jsxRuntimeExports.jsx(as,{ref:h,location:p,size:u,onDragStart:k,className:f.clsx(c,f.CSS.expanded(u!==Bs)),...a})},Pf=Object.freeze(Object.defineProperty({__proto__:null,Core:as,Multiple:us,Single:Yi,calculateDiffPercentage:Gi,useMultiple:ko},Symbol.toStringTag,{value:"Module"})),In="y",wr=28,Nf=32,Lf=40,Tf=.5,Af=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:o,...r}}=ko({direction:In,count:e.length,minSize:wr}),l=c=>{if(o.current==null)return;const a=f.Eo.dim(f.Eo.construct(o.current),In);s[c]<Lf/a?n(c,e[c].initialSize??Tf):n(c,wr+1)};return i.jsxRuntimeExports.jsx(us,{empty:!0,className:f.CSS.B("accordion"),sizeDistribution:s,ref:o,...t,...r,children:e.map((c,a)=>g.createElement(Df,{...c,key:c.key,index:a,direction:In,onExpand:l,parent:o,size:s[a]}))})},If=i.jsxRuntimeExports.jsx(y.e4.Caret.Down,{"aria-label":"contract"}),$f=i.jsxRuntimeExports.jsx(y.e4.Caret.Right,{"aria-label":"expand"}),Df=({index:e,name:t,content:n,actions:s,size:o,parent:r,onExpand:l})=>{let c=!0;if(r.current!=null){const u=f.Eo.dim(f.Eo.construct(r.current),In);c=o*u>Nf}const a=c?If:$f;return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs(An.Header,{level:"p",className:f.CSS.expanded(c),empty:!0,children:[i.jsxRuntimeExports.jsx(An.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&i.jsxRuntimeExports.jsx(An.Actions,{children:s})]}),n]})},Of=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Af},Symbol.toStringTag,{value:"Module"})),zf=(e,t)=>H.A(e).map(s=>typeof s=="string"?s.split(t).map(o=>({label:o})):s).flat(),Wi=({segments:e,shade:t,level:n,weight:s,separator:o})=>zf(e,o).map((c,a)=>{const u=[i.jsxRuntimeExports.jsx(y.e4.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:f.CSS.shade(t)}},`${c}-${a}`)];if(c.icon!=null){const d=Se.resolve(c.icon);d!=null&&u.push(d)}return u.push(i.jsxRuntimeExports.jsx(y.Text,{style:{marginLeft:c.icon!=null?"0.5rem":"0"},weight:s,shade:t,level:n,...c,children:c.label},c.label)),u}).flat(),Bf=({children:e,icon:t,shade:n=7,weight:s,size:o=.5,url:r,level:l="p",separator:c=".",className:a,hideFirst:u=!0,...d})=>{r!=null&&(e=r);const x=Wi({segments:e,separator:c,shade:n,level:l,weight:s});return u&&x.shift(),i.jsxRuntimeExports.jsxs(y.WithIcon,{className:f.CSS(a,f.CSS.B("breadcrumb")),level:l,shade:n,weight:s,size:o,direction:"x",...d,children:[Se.resolve(t),...x]})},Vf=({url:e,className:t,level:n="p",separator:s=".",weight:o,shade:r=7})=>{const l=Wi({segments:e,separator:s,shade:r,level:n,weight:o});return i.jsxRuntimeExports.jsx(J.Space,{className:f.CSS(t,f.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:l.map((c,a)=>{if(y.isValidElement(c))return c;if(c==null)return null;const d=e.split(s).indexOf(c);let x=e.split(s).slice(0,d+1).join("/");return x=`/${x}`,i.jsxRuntimeExports.jsx(y.Link,{level:n,href:x,children:c.split("-").map(p=>f._$1.capitalize(p)).join(" ")},a)})})},Ff=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Bf,URL:Vf},Symbol.toStringTag,{value:"Module"})),Mo=g.createContext(A.ZERO_CONTEXT_VALUE),Be=()=>g.useContext(Mo).synnax,Hf=()=>g.useContext(Mo).state,br={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Xi="serverVersionMismatch",Zf=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Ki=y.wrap$1(A.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[s,o,r]=y.useCombinedStateAndRef(A.ZERO_CONTEXT_VALUE),[{path:l},,c]=y.use$3({aetherKey:e,type:A.Provider.TYPE,schema:A.Provider.stateZ,initialState:{props:t??null,state:null}}),a=y.useAggregator(),u=g.useCallback(d=>{r.current.state.status!==d.status&&a({variant:br[d.status],message:d.message??f._$1.capitalize(d.status)}),o(x=>({...x,state:d}))},[a]);return y.useAsyncEffect(async()=>{if(s.synnax!=null&&s.synnax.close(),t==null)return o(A.ZERO_CONTEXT_VALUE);const d=new H.ug({...t,connectivityPollFrequency:H.k.seconds(5)});o({synnax:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(o({synnax:d,state:x}),a({variant:br[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||H.H.semVerOlder(x.nodeVersion,x.clientVersion),m=Zf(p,x.clientVersion,x.nodeVersion);a({variant:"warning",message:"Incompatible cluster version",description:m,data:{type:Xi,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(u),c({props:t,state:x}),()=>{d.close(),o(A.ZERO_CONTEXT_VALUE),c({props:null,state:null})}},[t,u]),i.jsxRuntimeExports.jsx(Mo.Provider,{value:s,children:i.jsxRuntimeExports.jsx(y.Composite,{path:l,children:n})})}),Gf=Object.freeze(Object.defineProperty({__proto__:null,Provider:Ki,SERVER_VERSION_MISMATCH:Xi,use:Be,useConnectionState:Hf},Symbol.toStringTag,{value:"Module"})),zt=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),qi=()=>g.useContext(zt),Ui=e=>{const{aliases:t}=g.useContext(zt);return t[e]??null},ds=()=>{const{aliases:e}=g.useContext(zt);return e},xs=(e,t="")=>{const{getName:n}=g.useContext(zt),[s,o]=g.useState(t);return y.useAsyncEffect(async()=>{const r=await n(e);r!=null&&o(r)},[e,n]),s??t},Po=()=>{const{activeRange:e}=g.useContext(zt);return e??void 0},Qi=({activeRange:e,children:t})=>{const n=Be(),[s,o]=g.useState({}),r=g.useCallback(a=>{o(u=>{const d={...u};return a.forEach(({variant:x,key:p,value:m})=>{const h=Number(p.split("---")[1]);x==="delete"?delete d[h]:d[m.channel]=m.alias}),d})},[o]),l=g.useCallback(async(a,u)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(a,u)},[n,e]),c=g.useCallback(async a=>{if(n==null||a===0)return;const u=s[a];return u??(await n.channels.retrieve(a)).name},[s,n]);return y.useAsyncEffect(async()=>{if(n==null||e==null){o({});return}const a=await n.ranges.retrieve(e),u=await a.listAliases();o(u);const d=await a.openAliasTracker(),x=d.onChange(r);return()=>{x(),d.close()}},[n,e]),i.jsxRuntimeExports.jsx(zt.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},Yf=({channelKey:e,value:t,shadow:n,className:s,...o})=>{const[r,l]=g.useState(!1),{setAlias:c}=qi(),a=Ui(e),u=xs(e);let d=i.jsxRuntimeExports.jsx(y.e4.Rename,{});r?d=i.jsxRuntimeExports.jsx(y.e4.Loading,{}):a===t&&(d=i.jsxRuntimeExports.jsx(y.e4.Check,{}));const x=c!=null&&!r&&a!==t&&e!==0,p=()=>{x&&(async()=>(l(!0),await c(e,t),l(!1)))()},m=()=>{var E;a!=null&&((E=o.onChange)==null||E.call(o,a))},h=()=>e===0?i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Alias synced with this label"}):i.jsxRuntimeExports.jsxs(y.Text,{level:"small",children:["Sync alias for ",u," with this label"]});return i.jsxRuntimeExports.jsxs(y.Text$1,{value:t,...o,children:[x&&i.jsxRuntimeExports.jsx(y.Icon,{onClick:m,tooltip:i.jsxRuntimeExports.jsxs(y.Text,{level:"small",children:["Set ",u," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:i.jsxRuntimeExports.jsx(y.e4.Sync,{})}),i.jsxRuntimeExports.jsx(y.Icon,{onClick:p,disabled:!x,tooltip:i.jsxRuntimeExports.jsx(h,{}),tooltipLocation:{y:"top"},variant:"outlined",children:d})]})},He="channel";var vr=180/Math.PI,no={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ji(e,t,n,s,o,r){var l,c,a;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(a=e*n+t*s)&&(n-=e*a,s-=t*a),(c=Math.sqrt(n*n+s*s))&&(n/=c,s/=c,a/=c),e*s<t*n&&(e=-e,t=-t,a=-a,l=-l),{translateX:o,translateY:r,rotate:Math.atan2(t,e)*vr,skewX:Math.atan(a)*vr,scaleX:l,scaleY:c}}var wn;function Wf(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?no:Ji(t.a,t.b,t.c,t.d,t.e,t.f)}function Xf(e){return e==null||(wn||(wn=document.createElementNS("http://www.w3.org/2000/svg","g")),wn.setAttribute("transform",e),!(e=wn.transform.baseVal.consolidate()))?no:(e=e.matrix,Ji(e.a,e.b,e.c,e.d,e.e,e.f))}function el(e,t,n,s){function o(u){return u.length?u.pop()+" ":""}function r(u,d,x,p,m,h){if(u!==x||d!==p){var E=m.push("translate(",null,t,null,n);h.push({i:E-4,x:A.interpolateNumber(u,x)},{i:E-2,x:A.interpolateNumber(d,p)})}else(x||p)&&m.push("translate("+x+t+p+n)}function l(u,d,x,p){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),p.push({i:x.push(o(x)+"rotate(",null,s)-2,x:A.interpolateNumber(u,d)})):d&&x.push(o(x)+"rotate("+d+s)}function c(u,d,x,p){u!==d?p.push({i:x.push(o(x)+"skewX(",null,s)-2,x:A.interpolateNumber(u,d)}):d&&x.push(o(x)+"skewX("+d+s)}function a(u,d,x,p,m,h){if(u!==x||d!==p){var E=m.push(o(m)+"scale(",null,",",null,")");h.push({i:E-4,x:A.interpolateNumber(u,x)},{i:E-2,x:A.interpolateNumber(d,p)})}else(x!==1||p!==1)&&m.push(o(m)+"scale("+x+","+p+")")}return function(u,d){var x=[],p=[];return u=e(u),d=e(d),r(u.translateX,u.translateY,d.translateX,d.translateY,x,p),l(u.rotate,d.rotate,x,p),c(u.skewX,d.skewX,x,p),a(u.scaleX,u.scaleY,d.scaleX,d.scaleY,x,p),u=d=null,function(m){for(var h=-1,E=p.length,w;++h<E;)x[(w=p[h]).i]=w.x(m);return x.join("")}}}var Kf=el(Wf,"px, ","px)","deg)"),qf=el(Xf,", ",")",")"),Uf=1e-12;function _r(e){return((e=Math.exp(e))+1/e)/2}function Qf(e){return((e=Math.exp(e))-1/e)/2}function Jf(e){return((e=Math.exp(2*e))-1)/(e+1)}const ep=function e(t,n,s){function o(r,l){var c=r[0],a=r[1],u=r[2],d=l[0],x=l[1],p=l[2],m=d-c,h=x-a,E=m*m+h*h,w,R;if(E<Uf)R=Math.log(p/u)/t,w=function(v){return[c+v*m,a+v*h,u*Math.exp(t*v*R)]};else{var k=Math.sqrt(E),S=(p*p-u*u+s*E)/(2*u*n*k),j=(p*p-u*u-s*E)/(2*p*n*k),b=Math.log(Math.sqrt(S*S+1)-S),M=Math.log(Math.sqrt(j*j+1)-j);R=(M-b)/t,w=function(v){var N=v*R,L=_r(b),T=u/(n*k)*(L*Jf(t*N+b)-Qf(b));return[c+T*m,a+T*h,u*L/_r(t*N+b)]}}return w.duration=R*1e3*t/Math.SQRT2,w}return o.rho=function(r){var l=Math.max(.001,+r),c=l*l,a=c*c;return e(l,c,a)},o}(Math.SQRT2,2,4),tp=Object.freeze(Object.defineProperty({__proto__:null,Canvas:A.Canvas,axisStateZ:A.axisStateZ,newTickFactory:A.newTickFactory,tickFactoryProps:A.tickFactoryProps,tickType:A.tickType},Symbol.toStringTag,{value:"Module"})),np=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:A.AcquireChannelControl,AuthoritySource:A.AuthoritySource,Chip:A.Chip,Controller:A.Controller$1,Indicator:A.Indicator,Legend:A.Legend,REGISTRY:A.REGISTRY$3,STATUSES:A.STATUSES,SetChannelValue:A.SetChannelValue,StateProvider:A.StateProvider,acquireChannelControl:A.acquireChannelControl,acquireChannelControlPropsZ:A.acquireChannelControlPropsZ,authoritySource:A.authoritySource,authoritySourceProps:A.authoritySourceProps,chipStateZ:A.chipStateZ,controllerStateZ:A.controllerStateZ,indicatorStateZ:A.indicatorStateZ,legendStateZ:A.legendStateZ,setChannelValue:A.setChannelValue,setChannelValuePropsZ:A.setChannelValuePropsZ,stateProviderStateZ:A.stateProviderStateZ,statusZ:A.statusZ,sugaredStateZ:A.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),sp={region:f.Eo.ZERO,dpr:1,os:H.w.getOS()},op={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},rp=y.wrap$1(A.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:s,...o})=>{const[{path:r},{bootstrapped:l,dpr:c},a]=y.use$3({aetherKey:n,type:A.Canvas$1.TYPE,schema:A.canvasStateZ,initialState:sp}),u=g.useRef({...op}),d=g.useRef(!1),x=g.useCallback(w=>{u.current.bootstrapped&&(a(()=>({bootstrapped:!0,region:w,dpr:window.devicePixelRatio,os:H.w.getOS({default:"Windows"})})),d.current=!0)},[a]),p=g.useRef(null),m=y.useResize(x,{debounce:t}),h=y.useCombinedRefs(p,m);g.useEffect(()=>{const w=()=>{window.devicePixelRatio===c||!u.current.bootstrapped||p.current==null||a(R=>({...R,region:f.Eo.construct(p.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",w,{once:!0})},[c]),g.useEffect(()=>{const w=()=>{!u.current.bootstrapped||p.current==null||a(R=>({...R,region:f.Eo.construct(p.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",w),window.addEventListener("blur",w)},[a]);const E=g.useCallback(w=>{if(w==null)return;w.className.includes("gl")?u.current.gl=w:w.className.includes("upper2d")?u.current.upper2d=w:u.current.lower2d=w;const{gl:R,lower2d:k,upper2d:S,bootstrapped:j}=u.current;if(R==null||k==null||S==null||j)return;u.current.bootstrapped=!0;const b=R.transferControlToOffscreen(),M=S.transferControlToOffscreen(),v=k.transferControlToOffscreen();a({glCanvas:b,upper2dCanvas:M,lower2dCanvas:v,bootstrap:!0,bootstrapped:!1,region:f.Eo.construct(R),dpr:window.devicePixelRatio,os:H.w.getOS({default:"Windows"})},[b,M,v])},[a]);return i.jsxRuntimeExports.jsxs("div",{ref:h,className:f.CSS(f.CSS.B("canvas-container"),s),...o,children:[i.jsxRuntimeExports.jsx("canvas",{ref:E,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","lower2d"))}),i.jsxRuntimeExports.jsx("canvas",{ref:E,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","gl"))}),i.jsxRuntimeExports.jsx("canvas",{ref:E,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","upper2d"))}),i.jsxRuntimeExports.jsx(y.Composite,{path:r,children:l&&e})]})}),pn=(e,t)=>y.useResize(g.useCallback((n,s)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(f.b.XY.translate(f.G.scale(f.Eo.topLeft(o),-1)).box(n),s)},[e]),t),ip=Object.freeze(Object.defineProperty({__proto__:null,Canvas:rp,useRegion:pn},Symbol.toStringTag,{value:"Module"})),tl=g.createContext(null),qe=e=>{const t=g.useContext(tl);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},nl=e=>{const t=qe("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},mn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=qe(t),{key:o}=e;return y.useEffectCompare(()=>{f.K.outer.parse(e.loc),n(e)},([c],[a])=>H._.equal(c,a),[e]),g.useEffect(()=>()=>s(o),[]),{gridArea:f.g.swap(f.K.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},sl=y.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=f.G.ZERO,children:o,hold:r=!1,onHold:l,visible:c,...a})=>{const[u,d]=g.useState([]),x=y.useMemoDeepEqualProps({clearOverScan:s,hold:r,visible:c}),[{path:p},{grid:m},h]=y.use$3({aetherKey:e,type:A.LinePlot.TYPE,schema:A.linePlotStateZ,initialState:{container:f.Eo.ZERO,viewport:f.Eo.DECIMAL,grid:{},...x}});g.useEffect(()=>h(D=>({...D,...x})),[x]);const E=g.useRef(new Map),w=g.useCallback(D=>(E.current.set(D,null),()=>E.current.delete(D)),[E]),R=g.useCallback(D=>{const{mode:$,box:B,stage:C}=D;($==="pan"&&C!=="start"||$==="zoom"||$==="zoomReset"&&C==="start")&&h(I=>({...I,viewport:B})),E.current.forEach((I,_)=>_(D))},[h]),k=g.useCallback(D=>h($=>({...$,container:D})),[h]),S=pn(k,{debounce:n}),j=g.useCallback(D=>h($=>({...$,grid:{...$.grid,[D.key]:D}})),[h]),b=g.useCallback(D=>h($=>{const{[D]:B,...C}=$.grid;return{...$,grid:C}}),[h]),M=g.useCallback(D=>{d($=>[...$.filter(({key:B})=>B!==D.key),D])},[d,R]),v=g.useCallback(D=>d($=>$.filter(({key:B})=>B!==D)),[M]),N=g.useMemo(()=>lp(m),[m]),L=g.useCallback(D=>{h($=>({...$,hold:D})),l==null||l(D)},[h,l]),T=g.useMemo(()=>({lines:u,setGridEntry:j,removeGridEntry:b,setLine:M,removeLine:v,setViewport:R,addViewportHandler:w,setHold:L}),[u,j,b,M,v,R,w,L]);return i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("line-plot"),style:{...t,...N},ref:S,...a,children:i.jsxRuntimeExports.jsx(tl.Provider,{value:T,children:i.jsxRuntimeExports.jsx(y.Composite,{path:p,children:o})})})}),lp=e=>{const t=f.CSS.newGridBuilder();return A.regions("top",e).forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),t.row("plot-start","plot-end","minmax(0, 1fr)"),A.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),A.regions("left",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.col("plot-start","plot-end","minmax(0, 1fr)"),A.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},No=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?A.XAxis.TYPE:A.YAxis.TYPE,s=`${e}-axis`;return y.wrap$1(n,({aetherKey:o,children:r,location:l=t,label:c="",labelLevel:a="small",labelDirection:u=e,onLabelChange:d,color:x,labelSize:p,showGrid:m,type:h,bounds:E,className:w,tickSpacing:R,autoBounds:k,autoBoundUpdateInterval:S,onAutoBoundsChange:j,style:b,...M})=>{const v=((c==null?void 0:c.length)??0)>0,N=y.useMemoDeepEqualProps({location:l,showGrid:m,type:h,bounds:E,label:c,labelDirection:u,tickSpacing:R,autoBounds:k,autoBoundUpdateInterval:S}),[{path:L},{size:T,labelSize:D,...$},B]=y.use$3({aetherKey:o,type:n,schema:A.coreAxisStateZ,initialState:N});g.useEffect(()=>B(O=>({...O,...N})),[N]),g.useEffect(()=>{const{lower:O,upper:P}=A.parseAutoBounds($.autoBounds);$.bounds!=null&&(O&&(E==null?void 0:E.lower)!==$.bounds.lower||P&&(E==null?void 0:E.upper)!==$.bounds.upper)&&(j==null||j($.bounds))},[$.autoBounds,$.bounds]);const C=mn({loc:l,key:`${n}-${o}`,size:T+D,order:1},`${e.toUpperCase()}Axis`),I=y.useTypography(a).toString(),_=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(c==null)return;let P=H.dimensions(c,I)[f.g.dimension(f.g.construct(u))];P>0&&(P+=9),B(z=>({...z,labelSize:P}))}else{let P=H.dimensions(c,I).height*1.3;P>0&&(P+=12);const z=_.current;A.withinSizeThreshold(z,P)||(_.current=P,B(V=>({...V,labelSize:P})))}},[c,u,I]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(J.Space,{className:f.CSS(w,f.CSS.B("axis"),f.CSS.B(s),f.CSS.loc(l)),style:{...b,...C},align:"center",justify:l!=="left"?"end":"start",direction:f.g.swap(e),...M,children:v&&i.jsxRuntimeExports.jsx(y.MaybeEditable,{className:f.CSS(f.CSS.BE("axis","label"),f.CSS.dir(u)),value:c,onChange:d,level:a})}),i.jsxRuntimeExports.jsx(y.Composite,{path:L,children:r})]})})},ol=No("x"),rl=No("y"),il=f.G.xy.extend({root:f.K.corner,units:re.z.object({x:re.z.enum(["px","decimal"]),y:re.z.enum(["px","decimal"])})}),cp=il.partial({root:!0,units:!0}),ap=e=>{var n,s,o,r;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((s=e==null?void 0:e.units)==null?void 0:s.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((o=e.root)==null?void 0:o.y)??"top"]=((r=e==null?void 0:e.units)==null?void 0:r.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},up=(e,t)=>{var r,l,c,a,u,d;const n={x:e.x,y:e.y};if(t.current==null)return n;const s=f.Eo.construct(t.current),o=f.Eo.construct(t.current.parentElement);return((r=e.units)==null?void 0:r.x)==="decimal"?((l=e.root)==null?void 0:l.x)==="right"&&(n.x=1-e.x):((c=e.root)==null?void 0:c.x)==="right"?n.x=1-(e.x+f.Eo.width(s))/f.Eo.width(o):n.x/=f.Eo.width(o),((a=e.units)==null?void 0:a.y)==="decimal"?((u=e.root)==null?void 0:u.y)==="bottom"&&(n.y=1-e.y):((d=e.root)==null?void 0:d.y)==="bottom"?n.y=1-(e.y+f.Eo.height(s))/f.Eo.height(o):n.y/=f.Eo.height(o),n},ll=(e,t)=>{if(t.current==null)return null;const n=f.Eo.construct(t.current.parentElement),s=f.Eo.construct(t.current),o={x:e.x,y:e.y,root:{...f.K.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*f.Eo.width(n)-f.Eo.width(s),o.root.x="right"):e.x<.2?o.x=e.x*f.Eo.width(n):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*f.Eo.height(n)-f.Eo.height(s),o.root.y="bottom"):e.y<.2?o.y=e.y*f.Eo.height(n):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...f.G.truncate(o,3)}},kr=f.Eo.reRoot(f.Eo.DECIMAL,f.K.TOP_LEFT),Lo=g.memo(({className:e,value:t,onChange:n,style:s,draggable:o=!0,...r})=>{const[l,c]=H.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:f.K.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),a=g.useRef(l),u=y.useSyncedRef(o===!1),d=g.useRef(null);l!==null&&(s={...s,...ap(l)});const x=g.useCallback(m=>{var j;if(((j=d.current)==null?void 0:j.parentElement)==null)return a.current;const h=f.Eo.construct(d.current.parentElement),E=f.b.XY.scale(h).scale(kr),w=E.box(f.Eo.construct(d.current)),R=f.b.XY.clamp(f.Eo.construct(f.Eo.topLeft(kr),{width:1-f.Eo.width(w),height:1-f.Eo.height(w)})),k=f.G.translate(f.G.construct(a.current),f.Eo.signedDims(E.box(m))),S=R.pos(k);return ll(S,d)},[]),p=y.useCursorDrag({onStart:g.useCallback(()=>{a.current=up(a.current,d)},[]),onMove:g.useCallback(m=>{if(u.current)return;const h=x(m);h!==null&&c(h)},[]),onEnd:g.useCallback(m=>{if(u.current)return;const h=x(m);h!==null&&(a.current=h)},[])});return i.jsxRuntimeExports.jsx(J.Space,{className:f.CSS(e,f.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:p,draggable:o,ref:d,...r,onDrag:Hn,onDragEnd:Hn,empty:!0})});Lo.displayName="Legend.Container";const To=(e,t,n)=>e.sort((s,o)=>s.label.localeCompare(o.label)).map(({key:s,color:o,label:r})=>i.jsxRuntimeExports.jsxs(J.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(y.Swatch,{value:o,onChange:l=>t==null?void 0:t({key:s,color:l,label:r}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"small"}),i.jsxRuntimeExports.jsx(y.MaybeEditable,{level:"small",value:r,onChange:l=>t==null?void 0:t({key:s,color:o,label:l}),noWrap:!0})]},s)),Ao=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...o})=>{const[r,l]=g.useState(!1);return e.length===0?null:i.jsxRuntimeExports.jsx(Lo,{...o,draggable:!r,value:n,onChange:s,children:To(e,t,l)})},dp=Object.freeze(Object.defineProperty({__proto__:null,Container:Lo,Simple:Ao,calcStickyPos:ll,completeStickyXYz:il,legendSwatches:To,stickyXYz:cp},Symbol.toStringTag,{value:"Module"})),cl=({className:e,style:t,onLineChange:n,...s})=>{const{lines:o}=qe("Legend");return qe("Legend"),i.jsxRuntimeExports.jsx(Ao,{data:o,onEntryChange:n,...s})},xp=({onLineChange:e})=>{const{lines:t}=qe("Legend"),n=y.useUniqueKey(),s=mn({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return i.jsxRuntimeExports.jsx(J.Space,{className:f.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:To(t,e)})},al=({variant:e="floating",...t})=>e==="floating"?i.jsxRuntimeExports.jsx(cl,{...t}):i.jsxRuntimeExports.jsx(xp,{...t}),ul=y.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=y.use$3({aetherKey:e,type:A.Line.TYPE,schema:A.stateZ,initialState:t}),s=y.useMemoDeepEqualProps(t);return g.useLayoutEffect(()=>n(s),[s]),null}),fp=Object.freeze(Object.defineProperty({__proto__:null,Line:ul},Symbol.toStringTag,{value:"Module"})),Io=y.wrap$1("Line",({aetherKey:e,color:t,label:n="",...s})=>{const{setLine:o,removeLine:r}=qe("Line");return g.useEffect(()=>(o({key:e,color:t,label:n}),()=>r(e)),[n,t]),i.jsxRuntimeExports.jsx(ul,{aetherKey:e,color:t,label:n,...s})}),dl=({level:e="h2",...t})=>{const n=y.useUniqueKey(),s=y.useTypography(e),o=mn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return i.jsxRuntimeExports.jsx(J.Space,{justify:"center",align:"center",style:o,children:i.jsxRuntimeExports.jsx(y.MaybeEditable,{...t,level:e})})},xl=y.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=y.use$3({aetherKey:e,type:A.Tooltip.TYPE,schema:A.tooltipStateZ,initialState:{position:null}}),n=g.useRef(null),s=g.useCallback(r=>{const l=document.querySelector(".pluto-canvas-container");if(l==null)return;const c=f.Eo.topLeft(l);t({position:f.G.translation(c,f.G.construct(r))})},[t]),o=g.useCallback(()=>t({position:null}),[t]);return g.useEffect(()=>{if(n.current===null)return;const r=n.current.parentElement;if(r!=null)return r.addEventListener("mousemove",s),r.addEventListener("mouseleave",o),()=>{r.removeEventListener("mousemove",s),r.removeEventListener("mouseleave",o)}},[s]),i.jsxRuntimeExports.jsx("span",{ref:n})}),pp=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:xl},Symbol.toStringTag,{value:"Module"})),mp={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},$o=g.forwardRef(({className:e,mode:t,maskBox:n,children:s,style:o,...r},l)=>i.jsxRuntimeExports.jsxs("div",{ref:l,className:f.CSS(f.CSS.noSelect,f.CSS.BE("viewport-mask","container"),e),style:{cursor:mp[t],...o},...r,children:[i.jsxRuntimeExports.jsx("div",{style:{...f.Eo.css(n),display:f.Eo.areaIsZero(n)?"none":"block"},className:f.CSS.BE("viewport-mask","selection")}),s]}));$o.displayName="ZoomPanMask";const hp=[{key:"start",icon:i.jsxRuntimeExports.jsx(y.e4.TextAlign.Left,{})},{key:"center",icon:i.jsxRuntimeExports.jsx(y.e4.TextAlign.Center,{})},{key:"end",icon:i.jsxRuntimeExports.jsx(y.e4.TextAlign.Right,{})}],gp=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(y.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),fs=({children:e=gp,...t})=>i.jsxRuntimeExports.jsx(Ce.Button,{...t,allowMultiple:!1,data:hp,children:e}),yp=new Set([H.g.UUID,H.g.JSON]),Ep=H.g.ALL.filter(e=>e!==H.g.UNKNOWN).map(e=>({key:e.toString(),name:yp.has(e)?e.toString().toUpperCase():f._$1.capitalize(e.toString())})),jp=[{key:"name",name:"Name"}],Sp=e=>i.jsxRuntimeExports.jsx(Ce.DropdownButton,{...e,data:Ep,columns:jp,entryRenderKey:"name"}),Rp=[{key:"x",icon:i.jsxRuntimeExports.jsx(y.e4.Arrow.Right,{})},{key:"y",icon:i.jsxRuntimeExports.jsx(y.e4.Arrow.Up,{})}],Cp=[{key:"x",icon:i.jsxRuntimeExports.jsx(y.e4.Arrow.Right,{})},{key:"y",icon:i.jsxRuntimeExports.jsx(y.e4.Arrow.Down,{})}],wp=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(y.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),fl=({children:e=wp,yDirection:t="up",...n})=>i.jsxRuntimeExports.jsx(Ce.Button,{...n,allowMultiple:!1,data:t==="up"?Rp:Cp,children:e}),pl=e=>i.jsxRuntimeExports.jsx(y.Icon,{className:f.CSS.BE("select","clear"),variant:"outlined",...e,children:i.jsxRuntimeExports.jsx(y.e4.Close,{"aria-label":"clear"})}),dt=({onChange:e,value:t,entryRenderKey:n="key",columns:s,data:o,emptyContent:r,inputProps:l,allowNone:c=!0,searcher:a,className:u,variant:d="button",hideColumnHeader:x=!1,disabled:p,omit:m,children:h,dropdownVariant:E="connected",placeholder:w=ps,inputPlaceholder:R=w,triggerTooltip:k,dropdownZIndex:S,filter:j,actions:b,...M})=>{const{visible:v,open:N,close:L,toggle:T}=y.use$2(),[D,$]=g.useState(null),B=a!=null;y.useAsyncEffect(async()=>{if(y.selectValueIsZero(t))return $(null);if((D==null?void 0:D.key)===t)return;let P=null;if(B)try{[P]=await a.retrieve([t])}finally{P??(P=null)}else o!=null&&(P=o.find(z=>z.key===t)??null);$(P)},[a,t,o]);const C=g.useCallback((P,z)=>{Array.isArray(P)||($(P==null?null:z.entries[0]),L(),e(P,z))},[e,c]),I=g.useMemo(()=>B?y.Search:Ot.Filter,[B]),_=i.jsxRuntimeExports.jsx(I,{searcher:a,filter:j,children:({onChange:P})=>i.jsxRuntimeExports.jsx(bp,{...l,autoFocus:E==="modal",variant:d,onChange:P,onFocus:N,selected:D,entryRenderKey:n,visible:v,allowNone:c,className:u,disabled:p,placeholder:R,children:b})}),O=i.jsxRuntimeExports.jsx(y.Button,{tooltip:k,variant:"outlined",onClick:T,disabled:p,children:D!=null?ml(n,D):w});return i.jsxRuntimeExports.jsx(Ce.Core,{close:L,zIndex:S,open:N,data:o,omit:m,emptyContent:r,allowMultiple:!1,visible:v,value:t,hideColumnHeader:x,onChange:C,allowNone:c,columns:s,listItem:h,variant:E,trigger:E!=="modal"?_:O,extraDialogContent:E==="modal"?_:void 0,keepMounted:!1,...M})},ps="Select",ml=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),bp=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:o,allowNone:r=!0,placeholder:l=ps,className:c,disabled:a,...u})=>{const{clear:d}=y.useSelectionUtils(),[x,p]=g.useState("");g.useEffect(()=>{if(!n){if(H.w$1(t==null?void 0:t.key))return p("");t!=null&&p(ml(e,t))}},[t,n,e]);const m=R=>{s(R),p(R)},h=()=>{x===""&&s(""),p(""),o==null||o()},E=R=>{n||(R.preventDefault(),o==null||o())},w=()=>{p(""),d==null||d()};return i.jsxRuntimeExports.jsx(y.Text$1,{className:f.CSS(f.CSS.BE("select","input"),c),value:x,onChange:m,onFocus:h,onKeyDown:y.matchCallback([["Enter"]],R=>{R.preventDefault(),!n&&(o==null||o())}),endContent:i.jsxRuntimeExports.jsx(Vi.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n}),style:{flexGrow:1},onClick:E,placeholder:l,disabled:a,...u,children:r&&i.jsxRuntimeExports.jsx(pl,{onClick:w,disabled:a})})},sn=({children:e="",size:t="medium",color:n,icon:s,onClose:o,className:r,onDragStart:l,...c})=>{const a=f.cssString(n);s==null&&n!=null&&(s=i.jsxRuntimeExports.jsx(y.e4.Circle,{fill:a}));const u=o==null?void 0:i.jsxRuntimeExports.jsx(y.Icon,{"aria-label":"close",size:"small",className:f.CSS.BE("tag","close"),onClick:d=>{d.stopPropagation(),o()},children:i.jsxRuntimeExports.jsx(y.e4.Close,{})});return i.jsxRuntimeExports.jsx(y.WithIcon,{startIcon:s,endIcon:u,className:f.CSS(r,f.CSS.B("tag"),o!=null&&f.CSS.BM("tag","closeable")),level:H.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:l,...c,children:e})},vp=Object.freeze(Object.defineProperty({__proto__:null,Tag:sn},Symbol.toStringTag,{value:"Module"})),Bt=({onChange:e,value:t,className:n,data:s,columns:o=[],entryRenderKey:r="key",emptyContent:l,searcher:c,renderTag:a=y.componentRenderProp(hl),placeholder:u,onTagDragStart:d,allowMultiple:x,allowNone:p,replaceOnSingle:m,onTagDragEnd:h,style:E,addPlaceholder:w="Add",children:R,dropdownVariant:k="connected",actions:S,...j})=>{const{visible:b,open:M,close:v}=y.use$2(),[N,L]=g.useState([]),[T,D]=g.useState(!1),$=c!=null;y.useAsyncEffect(async()=>{D(!0),y.selectValueIsZero(t)&&L([]);const O=N.map(V=>V.key),P=H.A(t);if(H.F.unorderedPrimitiveArrays(O,P)===H.F.EQUAL)return;let z=[];if($)try{z=await c.retrieve(P)}finally{D(!1)}else s!=null&&(z=s.filter(V=>P.includes(V.key)));L(z)},[c,$,t,s]);const B=g.useCallback((O,P)=>{O!=null&&(L(P.entries),e(H.A(O),P))},[e]),C=g.useMemo(()=>$?y.Search:Ot.Filter,[$]);let I,_;if(k==="connected")_=i.jsxRuntimeExports.jsx(C,{searcher:c,children:({onChange:O,value:P})=>i.jsxRuntimeExports.jsx(_p,{value:P,selectedKeys:t,className:n,onChange:O,loading:T,selected:N,onFocus:M,entryRenderKey:r,visible:b,renderTag:a,placeholder:u,onTagDragStart:d,onTagDragEnd:h,style:E,children:S})});else{const O=H.A(t);_=i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",grow:!0,style:E,size:"small",children:[O.map(P=>{const z=N.find(V=>V.key===P);return a({key:P,entryKey:P,entryRenderKey:r,loading:T,entry:z,onClose:()=>{const V=O.filter(Z=>Z!==P);e(V,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:V=>d==null?void 0:d(V,P),onDragEnd:V=>h==null?void 0:h(V,P)})}),O.length>0?i.jsxRuntimeExports.jsx(y.Icon,{onClick:M,children:i.jsxRuntimeExports.jsx(y.e4.Add,{style:{color:"var(--pluto-gray-l7)"}})}):i.jsxRuntimeExports.jsx(y.Button,{onClick:M,shade:7,startIcon:i.jsxRuntimeExports.jsx(y.e4.Add,{}),variant:"text",children:w})]}),I=i.jsxRuntimeExports.jsx(C,{searcher:c,children:P=>i.jsxRuntimeExports.jsx(y.Text$1,{autoFocus:!0,placeholder:"Search",...P,children:S})})}return i.jsxRuntimeExports.jsx(Ce.Core,{close:v,open:M,data:s,emptyContent:l,visible:b,value:t,onChange:B,allowNone:p,replaceOnSingle:m,columns:o,allowMultiple:!0,listItem:R,trigger:_,extraDialogContent:I,variant:k,...j})},_p=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:o,visible:r,entryRenderKey:l,renderTag:c,placeholder:a=ps,onTagDragStart:u,onTagDragEnd:d,value:x,className:p,children:m,...h})=>{const{onSelect:E,clear:w}=y.useSelectionUtils(),R=g.useRef(null);g.useLayoutEffect(()=>{var b;r&&((b=R.current)==null||b.focus())},[r,n]);const k=()=>{r||s(""),o==null||o()},S=()=>{r||o==null||o()},j=()=>{r||s("")};return i.jsxRuntimeExports.jsxs(y.Text$1,{ref:R,className:f.CSS(f.CSS.BE("select-multiple","input"),f.CSS.visible(r),p),onBlur:j,placeholder:a,value:x,onChange:s,onFocus:k,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:S,variant:"button",...h,children:[i.jsxRuntimeExports.jsx(J.Space,{direction:"x",className:f.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:H.A(e).map(b=>{const M=n.find(v=>v.key===b);return c({key:b,entryKey:b,entryRenderKey:l,loading:t,entry:M,onClose:()=>E==null?void 0:E(b),onDragStart:v=>u==null?void 0:u(v,b),onDragEnd:v=>d==null?void 0:d(v,b)})})}),m,i.jsxRuntimeExports.jsx(pl,{onClick:w})]})},hl=({entryKey:e,entryRenderKey:t,entry:n,loading:s,...o})=>{let r=e;return n!=null&&(r=typeof t=="function"?t(n):n[t]),g.createElement(sn,{size:"small",variant:"outlined",className:f.CSS(n==null&&!s&&f.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...o,key:e.toString()},H.Q(r))},kp=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Ce.BaseButton,Button:Ce.Button,DEFAULT_PLACEHOLDER:ps,DataType:Sp,Direction:fl,DropdownButton:Ce.DropdownButton,Multiple:Bt,MultipleTag:hl,Single:dt,TextAlignment:fs,defaultButton:Ce.defaultButton},Symbol.toStringTag,{value:"Module"})),$n=6,Mp=2,Mr=5,Pp=e=>f.Eo.width(e)<Mr&&f.Eo.height(e)<Mr,Np=["zoom","pan","select","zoomReset"],Jt=[...Np,"click"],Lp=re.z.enum(Jt),gl=["zoom","select"],Dn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},yl={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},El={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Do={zoom:Dn,pan:yl,select:El,zoomReset:Dn,click:Dn},Tp=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(o=>o.filter(r=>r!=="MouseLeft")).filter(o=>o.length>0)]))},Ap=f.Eo.construct(0,0,1,1,f.K.TOP_LEFT),Ip={width:30,height:50},jl=({onChange:e,triggers:t,initial:n=Ap,threshold:s=Ip,ref:o})=>{const r=(t==null?void 0:t.defaultMode)??"zoom",[l,c]=g.useState(f.Eo.ZERO),[a,u]=g.useState(r),[d,x]=y.useStateRef(n),p=g.useRef(f.G.ZERO),m=g.useRef(null),h=f._.construct(s);g.useEffect(()=>x(()=>f.Eo.truncate(n,$n)),[n]),g.useEffect(()=>u(r),[r]);const[E,w,R,k]=y.useMemoCompare(()=>{const N={...Do[r],...t},L=y.flattenConfig(N),T=Tp(N);return[N,L,T,y.flattenConfig(T)]},y.compareModeConfigs,[t]),S=g.useCallback(({box:N,triggers:L,stage:T,cursor:D})=>{if(m.current==null)return;const $=y.determineMode(E,L),B=f.Eo.construct(m.current);if($==null)return;if($==="zoomReset")return c(f.Eo.ZERO),e==null||e({box:f.Eo.DECIMAL,mode:$,stage:T,cursor:D}),x(f.Eo.DECIMAL);const C=Pp(N);if(T==="end"){if(C){$==="zoom"&&c(f.Eo.ZERO),e==null||e({box:d.current,mode:"click",stage:T,cursor:D});return}return x(_=>{if($==="pan"){const P=Pr(N,_,B);return P===null||f.Eo.equals(P,_)?_:(e==null||e({box:P,mode:$,stage:T,cursor:D}),P)}const O=j(N,_,B);return O===null?_:(e==null||e({box:O,mode:$,stage:T,cursor:D}),$==="zoom"?(c(f.Eo.ZERO),O):f.Eo.truncate(_,$n))})}if(gl.includes($))return C?void 0:c(f.b.XY.scale(B).clamp(B).translate({x:-f.Eo.left(B),y:-f.Eo.top(B)}).box(Nr(h,N,B)));if(c(_=>f.Eo.areaIsZero(_)?_:f.Eo.ZERO),f.G.distance(D,p.current)<Mp)return;p.current=D;const I=Pr(N,d.current,B);e==null||e({box:I,mode:$,stage:T,cursor:D})},[c,u,e,E,s.height,s.width,x,m]);g.useImperativeHandle(o,()=>({reset:()=>{c(f.Eo.ZERO),x(f.Eo.DECIMAL),e==null||e({box:f.Eo.DECIMAL,mode:"zoomReset",stage:"start",cursor:f.G.ZERO})}}),[e]);const j=g.useCallback((N,L,T)=>f.Eo.truncate(so(L,T).box(Nr(h,N,T)),$n),[s]),b=y.useHeldRef({triggers:[["Control"]]}),M=y.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const N=L=>{if(m.current==null)return;let T=1;L.deltaY<0?T-=.035:T+=.035;const D=f.Eo.construct(m.current),$=f.G.construct(L);if(!f.Eo.contains(D,$)||L.target!==m.current)return;const C=so(d.current,f.Eo.construct(m.current)).pos(f.G.construct(L));let _=f.b.XY.magnify({x:b.current.held?1:T,y:M.current.held?1:T}).box(d.current);_=f.Eo.translate(_,{x:b.current.held?0:C.x*(1-T),y:M.current.held?0:C.y*(1-T)}),x(_),e==null||e({stage:"end",box:_,cursor:f.G.construct(L),mode:"zoom"})};return window.addEventListener("wheel",N),()=>window.removeEventListener("wheel",N)},[x,e]),Fi.useDrag({bound:m,onDrag:S,triggers:w,loose:!0});const v=g.useCallback(({triggers:N,stage:L})=>{if(L==="end")return u(r);const T=y.determineMode(R,N);T!=null&&u(T)},[R,r,e]);return y.use$1({triggers:k,callback:v,region:m}),{maskBox:l,ref:m,mode:a}},so=(e,t)=>f.b.XY.scale(t).clamp(t).scale(e),Pr=(e,t,n)=>{let s=f.Eo.signedDims(so(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},f.Eo.truncate(f.b.XY.translate(f.G.construct(s)).box(t),$n)},Nr=(e,t,n)=>f.Eo.height(t)<=e.height?f.Eo.construct(f.Eo.left(t),f.Eo.top(n),f.Eo.width(t),f.Eo.height(n)):f.Eo.width(t)<=e.width?f.Eo.construct(f.Eo.left(n),f.Eo.top(t),f.Eo.width(n),f.Eo.height(t)):t,$p=({mode:e,triggers:t})=>i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",children:[i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:f._$1.capitalize(e)}),i.jsxRuntimeExports.jsx(ff.Text,{trigger:t[0],level:"small"})]}),Dp={zoom:i.jsxRuntimeExports.jsx(y.e4.Zoom,{}),pan:i.jsxRuntimeExports.jsx(y.e4.Pan,{}),select:i.jsxRuntimeExports.jsx(y.e4.Selection,{}),zoomReset:i.jsxRuntimeExports.jsx(y.e4.Expand,{}),click:i.jsxRuntimeExports.jsx(y.e4.Bolt,{})},Op=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([o])=>!t.includes(o)&&Jt.includes(o)).map(([o,r])=>({key:o,icon:Dp[o],tooltip:i.jsxRuntimeExports.jsx($p,{mode:o,triggers:r})})).sort((o,r)=>Jt.indexOf(o.key)-Jt.indexOf(r.key));return i.jsxRuntimeExports.jsx(Ce.Button,{...n,data:s,entryRenderKey:"icon",children:({title:o,entry:r,...l})=>g.createElement(y.Icon,{...l,key:r.key,variant:l.selected?"filled":"text",size:"medium",tooltip:r.tooltip,tooltipLocation:{x:"right",y:"top"}},r.icon)})},zp=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Do,MASK_MODES:gl,MODES:Jt,Mask:$o,PAN_DEFAULT_TRIGGERS:yl,SELECT_DEFAULT_TRIGGERS:El,SelectMode:Op,ZOOM_DEFAULT_TRIGGERS:Dn,modeZ:Lp,use:jl},Symbol.toStringTag,{value:"Module"})),Sl=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Oo=g.forwardRef(({children:e,initial:t=f.Eo.DECIMAL,onChange:n,...s},o)=>{const{setViewport:r}=qe("Viewport");g.useLayoutEffect(()=>{r({box:t,mode:"zoom",cursor:f.G.ZERO,stage:"start"})},[r,t]);const l=g.useCallback(a=>{r(a),n==null||n(a)},[n,r]),c=jl({onChange:l,initial:t,ref:o,...s});return i.jsxRuntimeExports.jsx($o,{className:f.CSS.BE("line-plot","viewport"),...c,children:e})});Oo.displayName="Viewport";const Bp=Object.freeze(Object.defineProperty({__proto__:null,Floating:cl,Legend:al,Line:Io,LinePlot:sl,Title:dl,Tooltip:pp,Viewport:Oo,XAxis:ol,YAxis:rl,axisFactory:No,selectViewportEl:Sl,useContext:qe,useGridEntry:mn,useViewport:nl},Symbol.toStringTag,{value:"Module"})),Vp=y.wrap$1("Tooltip",({aetherKey:e,...t})=>(y.use$3({aetherKey:e,type:A.Annotation.TYPE,schema:A.annotationStateZ,initialState:t}),null)),Rl=y.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:s,setHold:o}=qe("Range.Provider"),[,{hovered:r,count:l},c]=y.use$3({aetherKey:e,type:A.Provider$1.TYPE,schema:A.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),a=mn({key:e,loc:"top",size:l>0?32:0,order:3},"Annotation.Provider"),u=y.useContextMenu(),d=y.useSyncedRef(u.visible),x=g.useCallback(p=>{const m=E=>{c(w=>({...w,cursor:{x:E.clientX,y:E.clientY}}))},h=p.currentTarget;h.addEventListener("mousemove",m),h.addEventListener("mouseleave",()=>{h.removeEventListener("mousemove",m),d.current||c(E=>({...E,cursor:null}))},{once:!0})},[c]);return i.jsxRuntimeExports.jsx(y.ContextMenu,{style:{...a,cursor:r!=null?"pointer":"default"},...u,menu:()=>t==null||r==null?null:t(r),children:i.jsxRuntimeExports.jsx(J.Space,{style:{width:"100%",height:"100%"},onClick:()=>{r!=null&&(s({box:f.Eo.construct({x:r.viewport.lower,y:0},{x:r.viewport.upper,y:1}),mode:"zoom",cursor:f.G.ZERO,stage:"start"}),o(!0))},onMouseEnter:x})})}),Fp=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Vp,Provider:Rl},Symbol.toStringTag,{value:"Module"})),Cl={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Hp=y.flattenConfig(Cl),wl=y.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=y.use$3({aetherKey:e,type:A.Measure.TYPE,schema:A.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=g.useRef(null),s=y.useHeldRef({triggers:Hp,loose:!0}),o=g.useCallback(({mode:c,cursor:a})=>{if(c==="click"){const u=y.determineMode(Cl,s.current.triggers,{loose:!0});if(["one","two"].includes(u))return t(d=>({...d,[u]:a}));t(u==="clear"?d=>({...d,one:null,two:null}):d=>({...d,one:d.one??a,two:d.one!==null?a:d.two}))}},[t,s]);nl(o);const r=g.useCallback(c=>t(a=>({...a,hover:f.G.construct(c)})),[t]),l=g.useCallback(()=>{t(c=>({...c,hover:null}))},[t]);return g.useEffect(()=>{if(n.current===null)return;const c=n.current.parentElement;if(c!=null)return c.addEventListener("mousemove",r),c.addEventListener("mouseleave",l),()=>{c.removeEventListener("mousemove",r),c.removeEventListener("mouseleave",l)}},[o]),i.jsxRuntimeExports.jsx("span",{ref:n})}),Zp=Object.freeze(Object.defineProperty({__proto__:null,Measure:wl},Symbol.toStringTag,{value:"Module"})),zo=y.wrap$1("Rule",({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:o,units:r="",color:l,lineWidth:c,lineDash:a})=>{const[u,d]=H.usePurePassthrough({value:t,onChange:s,initial:""}),[,{position:x,pixelPosition:p},m]=y.use$3({aetherKey:e,type:A.Rule.TYPE,schema:A.ruleStateZ,initialState:{color:l,dragging:!1,position:n,lineWidth:c,lineDash:a}});g.useEffect(()=>{if(x==null)return;if(n==null)return o==null?void 0:o(x);const j=f.G$1.construct(x+.01,x-.01);n!=null&&!f.G$1.contains(j,n)&&(o==null||o(Math.trunc(x*100)/100))},[x]);const h=g.useRef(p);p!==h.current&&(h.current=p);const E=g.useRef(p);g.useEffect(()=>{m(j=>({...j,position:n,color:l,lineWidth:c,lineDash:a}))},[n,l,c,a]);const w=y.useCursorDrag({onStart:g.useCallback(()=>{m(j=>({...j,dragging:!0})),E.current=h.current},[]),onMove:j=>{m(b=>({...b,pixelPosition:(E.current??0)+f.Eo.signedHeight(j)}))},onEnd:g.useCallback(()=>{m(j=>({...j,dragging:!1})),E.current=p},[])}),R=g.useRef(null);if(x==null||p==null)return null;const k=Sl(R==null?void 0:R.current),S=i.jsxRuntimeExports.jsxs("div",{ref:R,className:f.CSS.B("rule"),style:{top:`calc(${p}px - 0.5rem)`},children:[i.jsxRuntimeExports.jsx("div",{className:f.CSS.BE("rule","drag-handle"),onDragStart:w,draggable:!0}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[i.jsxRuntimeExports.jsx(y.Editable,{level:"p",value:u,onChange:d}),i.jsxRuntimeExports.jsx(y.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${x.toFixed(2)} ${r}`})]})]});return k==null?S:_o.createPortal(S,k)}),Gp=Object.freeze(Object.defineProperty({__proto__:null,Rule:zo},Symbol.toStringTag,{value:"Module"})),bl=y.canDropOfType(He),Yp=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:o,showLegend:r=!0,legendPosition:l,onLegendPositionChange:c,titleLevel:a="h4",onLineChange:u,onRuleChange:d,onAxisChannelDrop:x,onAxisChange:p,rules:m,enableTooltip:h=!0,enableMeasure:E=!1,initialViewport:w=f.Eo.DECIMAL,legendVariant:R,onViewportChange:k,viewportTriggers:S,annotationProvider:j,...b})=>{var T;const M=t.filter(({location:D})=>f.K.isY(D)),v=g.useRef(),N=y.usePrevious(e.length),L=y.usePrevious(b.hold);return(N===0&&e.length!==0||L===!0&&b.hold===!1)&&((T=v.current)==null||T.reset()),i.jsxRuntimeExports.jsxs(sl,{...b,children:[M.map((D,$)=>{const B=e.filter(_=>_.axes.x===D.key),C=t.filter(({location:_})=>f.K.isX(_)),I=m==null?void 0:m.filter(_=>[...C.map(({key:O})=>O),D.key].includes(_.axis));return i.jsxRuntimeExports.jsx(Wp,{axis:D,index:$,lines:B,yAxes:C,rules:I,onAxisChannelDrop:x,onAxisChange:p,annotationProvider:j},D.key)}),r&&i.jsxRuntimeExports.jsx(al,{onLineChange:u,position:l,onPositionChange:c,variant:R}),n&&i.jsxRuntimeExports.jsx(dl,{value:s,onChange:o,level:a}),i.jsxRuntimeExports.jsxs(Oo,{initial:w,onChange:k,triggers:S,ref:v,children:[h&&i.jsxRuntimeExports.jsx(xl,{}),E&&i.jsxRuntimeExports.jsx(wl,{})]})]})},Wp=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:o,onAxisChannelDrop:r,onAxisChange:l,axis:{location:c,key:a,showGrid:u,...d},annotationProvider:x})=>{const p=y.useDrop({type:"Channel.LinePlot.XAxis",canDrop:bl,onDrop:g.useCallback(({items:E})=>{const w=y.filterByType(He,E);return r==null||r(a,w.map(({key:R})=>R)),w},[a,r])}),m=s==null?void 0:s.filter(E=>E.axis===a),h=y.useDraggingState();return i.jsxRuntimeExports.jsxs(ol,{...d,...p,location:c,showGrid:u??n===0,className:f.CSS(f.CSS.dropRegion(y.canDropOfType(He)(h))),onAutoBoundsChange:E=>l==null?void 0:l({key:a,bounds:E}),children:[e.map((E,w)=>{const R=t.filter(S=>S.axes.y===E.key),k=s==null?void 0:s.filter(S=>S.axis===E.key);return i.jsxRuntimeExports.jsx(Kp,{axis:{...E,showGrid:u??(n===0&&w===0)},lines:R,rules:k,onRuleChange:o,onAxisChannelDrop:r,onAxisChange:l},E.key)}),m==null?void 0:m.map(E=>g.createElement(zo,{aetherKey:E.key,...E,key:E.key,onLabelChange:w=>o==null?void 0:o({key:E.key,label:w}),onPositionChange:w=>o==null?void 0:o({key:E.key,position:w})})),i.jsxRuntimeExports.jsx(Rl,{...x})]})},Xp=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Kp=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:o,axis:{key:r,location:l,...c}})=>{const a=y.useDrop({type:"Channel.LinePlot.YAxis",canDrop:bl,onDrop:g.useCallback(({items:d})=>{const x=y.filterByType(He,d);return s==null||s(r,x.map(({key:p})=>p)),x},[r,s])}),u=y.useDraggingState();return i.jsxRuntimeExports.jsxs(rl,{...c,...a,location:l,className:f.CSS(f.CSS.dropRegion(y.canDropOfType(He)(u))),onAutoBoundsChange:d=>o==null?void 0:o({key:r,bounds:d}),children:[e.map(d=>i.jsxRuntimeExports.jsx(qp,{line:d},Xp(d))),t==null?void 0:t.map(d=>g.createElement(zo,{aetherKey:d.key,...d,key:d.key,onLabelChange:x=>n==null?void 0:n({key:d.key,label:x}),onPositionChange:x=>n==null?void 0:n({key:d.key,position:x})}))]})},qp=({line:e})=>e.variant==="static"?i.jsxRuntimeExports.jsx(Qp,{line:e}):i.jsxRuntimeExports.jsx(Up,{line:e}),Up=({line:{key:e,timeSpan:t,channels:{x:n,y:s},...o}})=>{const r=Number(t.valueOf())*3,l=A.streamChannelData({timeSpan:t,channel:s,keepFor:r}),c=n!=null&&n!==0,a=A.streamChannelData({timeSpan:t,channel:c?n:s,useIndexOfChannel:!c,keepFor:r});return i.jsxRuntimeExports.jsx(Io,{aetherKey:e,y:l,x:a,...o})},Qp=({line:{timeRange:e,key:t,channels:{x:n,y:s},...o}})=>{const r=A.channelData({timeRange:e,channel:s}),l=n!=null&&n!==0,c=A.channelData({timeRange:e,channel:l?n:s,useIndexOfChannel:!l});return i.jsxRuntimeExports.jsx(Io,{aetherKey:t,y:r,x:c,...o})},Lr=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Zn=({items:e},t)=>{const n=y.filterByType(He,e);return n.length>0&&!n.every(s=>t.includes(s.key))},vl=["name","alias"],_l=e=>{const t=ds();return g.useMemo(()=>e.length===0?Lr:Lr.filter(n=>e.includes(n.key)),[e,t])},Jp=({columns:e=vl,onChange:t,className:n,value:s,searchOptions:o,...r})=>{const l=Be(),c=ds(),a=_l(e),u=Po(),d=y.useMemoDeepEqualProps(o),x=g.useMemo(()=>l==null?void 0:l.channels.newSearcherWithOptions({rangeKey:u,internal:!1,...d}),[l,u,d]),p=l!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:m,onDragEnd:h,...E}=y.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(j=>Zn(j,H.A(s)),[s]),onDrop:g.useCallback(({items:j})=>{const b=y.filterByType(He,j);if(b.length===0)return[];const M=H.n([...H.A(s),...b.map(v=>v.key)]);return t(M,{clickedIndex:null,clicked:null,entries:[]}),b},[t,s])}),w=y.useDraggingState(),R=g.useCallback(({dropped:j})=>{t(H.A(s).filter(b=>!j.some(M=>M.key===b)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),k=g.useCallback((j,b)=>m([{key:b,type:He}],R),[m,R]),S=g.useCallback(j=>c[j.key]??j.name,[c]);return i.jsxRuntimeExports.jsx(Bt,{className:f.CSS(n,f.CSS.dropRegion(Zn(w,H.A(s)))),value:s,onTagDragStart:k,onTagDragEnd:h,searcher:x,onChange:t,columns:a,emptyContent:p,entryRenderKey:S,...E,...r})},ut=({columns:e=vl,onChange:t,value:n,className:s,data:o,searchOptions:r,...l})=>{const c=Be(),a=ds(),u=_l(e),d=Po(),x=y.useMemoDeepEqualProps(r),p=g.useMemo(()=>{if(!(o!=null&&o.length>0))return c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:d,internal:!1,...x})},[c,d,o==null?void 0:o.length,x]),m=c!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),E=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:w,onDragEnd:R,...k}=y.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(M=>Zn(M,H.o$1(n)),[n]),onDrop:g.useCallback(({items:M})=>{const v=y.filterByType(He,M);return v.length===0?[]:(t(v[0].key,{clickedIndex:null,clicked:null,entries:[]}),v)},[E,t])}),S=y.useDraggingState(),j=g.useCallback(()=>n!=null&&w([{type:He,key:n}]),[w,n]),b=g.useCallback(M=>a[M.key]??M.name,[a]);return i.jsxRuntimeExports.jsx(dt,{data:o,className:f.CSS(s,f.CSS.dropRegion(Zn(S,H.o$1(n)))),value:n,onDragStart:j,onDragEnd:R,onChange:t,searcher:p,columns:u,emptyContent:m,entryRenderKey:b,...k,...l})},em=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Yf,AliasProvider:Qi,LinePlot:Yp,SelectMultiple:Jp,SelectSingle:ut,useActiveRange:Po,useAlias:Ui,useAliases:ds,useContext:qi,useName:xs},Symbol.toStringTag,{value:"Module"})),xt=({path:e,optional:t=!1,onChange:n})=>{const s=Je(),{get:o,bind:r,set:l,setStatus:c}=s,[a,u]=g.useState(o(e,{optional:t}));g.useEffect(()=>(u(o(e,{optional:t})),r({path:e,onChange:u,listenToChildren:!1})),[e,n,r,o]);const d=g.useCallback(m=>{n==null||n(m,{...s,path:e}),l(e,m)},[e,l,n]),x=g.useCallback(m=>c(e,m),[e,c]);if(a==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let p;return s.mode==="preview"&&(p="preview"),{onChange:d,setStatus:x,variant:p,...a}},kl=(e,t=!1,n)=>{const{get:s,bind:o}=Je(n),[,r]=g.useState(0);return g.useEffect(()=>(r(l=>l+1),o({path:e,onChange:()=>r(l=>l+1)})),[e,o]),s(e,{optional:t})??null},Ml=(e,t=!1,n)=>{var l;const{get:s,bind:o}=Je(n),[,r]=g.useState(0);return g.useEffect(()=>(r(c=>c+1),o({path:e,onChange:()=>r(c=>c+1)})),[e,o]),((l=s(e,{optional:t}))==null?void 0:l.value)??null},tm=e=>{var t,n;return((n=(t=kl(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},nm=({path:e,ctx:t,onChange:n})=>{const s=Je(t);g.useEffect(()=>s.bind({path:e,onChange:o=>n(o,s),listenToChildren:!1}),[e,s])},sm=({path:e,optional:t=!1})=>{const{bind:n,get:s}=Je(),[o,r]=g.useState(s(e,{optional:t}));if(g.useEffect(()=>(r(s(e,{optional:t})),n({path:e,onChange:l=>r({...l,value:H.U(l.value)}),listenToChildren:!0})),[e,n,s]),o==null&&!t)throw new Error("Field state is null");return(o==null?void 0:o.value)??null},Pl=(e,t)=>({add:(n,s)=>{const o=H.U(e.get(t).value);o.splice(s,0,...H.A(n)),e.set(t,o,{validateChildren:!1})},push:(n,s)=>{const o=H.U(e.get(t).value);o.push(...H.A(n)),s!=null&&o.sort(s),e.set(t,o,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,o=new Set(H.A(n));e.set(t,s.filter((r,l)=>!o.has(l)))},keepOnly:n=>{const s=e.get(t).value,o=new Set(H.A(n));e.set(t,s.filter((r,l)=>o.has(l)))},set:n=>e.set(t,H.executeSetter(n,e.get(t).value)),sort:n=>{const s=H.U(e.get(t).value);s.sort(n),e.set(t,s)}}),om=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=Je(n),{bind:o,get:r}=s,[l,c]=g.useState(r(e).value);return g.useEffect(()=>(c(r(e).value),o({path:e,onChange:a=>{c(H.U(a.value))},listenToChildren:t})),[e,o,r,c]),g.useMemo(()=>({value:l,...Pl(s,e)}),[l,s,e])},Bo=g.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),Je=e=>{const t=g.useContext(Bo);return e??t},Tr=e=>({key:e,variant:"success",message:""}),rm=e=>e.code===re.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",Nl=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:o})=>{const r=g.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),l=y.useSyncedRef(n),c=y.useSyncedRef(o),a=g.useCallback(({path:b,onChange:M,listenToChildren:v=!1})=>{var D;const{parentListeners:N,listeners:L}=r.current,T=v?N:L;return T.has(b)||T.set(b,new Set),(D=T.get(b))==null||D.add(M),()=>{var $;return($=T.get(b))==null?void 0:$.delete(M)}},[]),u=g.useCallback((b,{optional:M}={optional:!1})=>{const{state:v,statuses:N,touched:L}=r.current,T=H._.get(v,b,{optional:M});if(T==null)return null;const D={value:T,status:N.get(b)??Tr(b),touched:L.has(b),required:!1};if(l.current==null)return D;const $=l.current,B=H.N.getFieldSchema($,b,{optional:!0});return B==null||(D.required=!B.isOptional()),D},[]),d=g.useCallback(b=>{const{state:M,statuses:v,touched:N,listeners:L,parentListeners:T}=r.current;H._.remove(M,b),v.delete(b),N.delete(b),L.delete(b),T.delete(b)},[]),x=g.useCallback(b=>{const{statuses:M,touched:v}=r.current;r.current.state=b,m(""),M.clear(),v.clear()},[]),p=g.useCallback(b=>{var N;const{listeners:M}=r.current,v=u(b,{optional:!0});v!=null&&((N=M.get(b))==null||N.forEach(L=>L(v)))},[]),m=g.useCallback(b=>{const{listeners:M,parentListeners:v}=r.current,N=M.get(b);if(b==""&&([...M.keys()].forEach(D=>{var B;const $=u(D,{optional:!0});$!=null&&((B=M.get(D))==null||B.forEach(C=>{C($)}))}),[...v.keys()].forEach(D=>{var B;const $=u(D,{optional:!0});$!=null&&((B=v.get(D))==null||B.forEach(C=>{C($)}))})),N!=null){const L=u(b,{optional:!0});L!=null&&N.forEach(T=>{T(L)})}v.forEach((L,T)=>{if(H._.pathsMatch(b,T)){const $=u(T,{optional:!0});$!=null&&L.forEach(B=>{B($)})}})},[]),h=g.useCallback((b,M="",v=!0)=>{const{statuses:N,listeners:L,touched:T}=r.current;if(b.success){const C=[...N.keys()];return N.clear(),C.forEach(I=>p(I)),!0}let D=!0;const $=new Set(b.error.issues.map(C=>C.path.join(".")));let B=(C,I)=>C===I;return v&&(B=(C,I)=>H._.pathsMatch(C,I)),b.error.issues.forEach(C=>{var z;const{message:I}=C,_=C.path.join(".");if(!B(_,M))return;const O=rm(C);O!=="warning"&&(D=!1),N.set(_,{key:_,variant:O,message:I}),T.add(_);let P=u(_,{optional:!0});P??(P={value:void 0,status:N.get(_)??Tr(_),touched:!1,required:!1}),(z=L.get(_))==null||z.forEach(V=>V(P))}),N.forEach((C,I)=>{$.has(I)||(N.delete(I),p(I))}),D},[]),E=g.useCallback((b,M)=>{if(l.current==null)return!0;const{state:v}=r.current,N=l.current.safeParse(v);return h(N,b,M)},[h]),w=g.useCallback(async(b,M)=>{if(l.current==null)return!0;const{state:v}=r.current,N=await l.current.safeParseAsync(v);return h(N,b,M)},[h]),R=g.useCallback((b,M,v={})=>{const N=H._.get(r.current.state,b,{optional:!0}),{validateChildren:L=!0}=v,{state:T,touched:D}=r.current;D.add(b),b.length===0?r.current.state=M:H._.set(T,b,M),m(b),(async()=>{var B;let $;try{$=E(b,L)}catch{$=await w(b,L)}(B=c.current)==null||B.call(c,{values:r.current.state,path:b,prev:N,valid:$})})()},[]),k=g.useCallback(b=>H._.has(r.current.state,b),[]),S=g.useCallback((b,M)=>{r.current.statuses.set(b,M),r.current.touched.add(b),p(b)},[]),j=g.useCallback(()=>{const{statuses:b}=r.current;b.clear(),b.forEach((M,v)=>p(v))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:b}=r.current;r.current.state=e,b.forEach((M,v)=>{const N=u(v,{optional:!0});N!=null&&M.forEach(L=>L(N))})},[t,e]),g.useMemo(()=>({bind:a,set:R,get:u,mode:s,validate:E,validateAsync:w,value:()=>r.current.state,has:k,remove:d,setStatus:S,clearStatuses:j,reset:x}),[a,R,u,E,w,k,d,S,j,x,s])},im=e=>i.jsxRuntimeExports.jsx(Bo.Provider,{value:e,children:e.children}),lm=y.componentRenderProp(y.Text$1),he=({path:e,children:t=lm,label:n,padHelpText:s=!0,visible:o=!0,hideIfNull:r=!1,optional:l,onChange:c,className:a,...u})=>{const d=xt({path:e,optional:l??r,onChange:c}),x=Je();if(d==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??(n=f._$1.capitalize(H._.element(e,-1))),o=typeof o=="function"?o(d,x):o,!o)return null;const p=d.status.message,{onChange:m,value:h}=d,E={onChange:m,value:h};return d.variant!=null&&(E.variant=d.variant),i.jsxRuntimeExports.jsx(Pe.Item,{padHelpText:s,helpText:p,helpTextVariant:d.status.variant,label:n,required:d.required,className:f.CSS(a,f.CSS.BE("field",e.split(".").join("-")),f.CSS.M(d.status.variant)),...u,children:t(E)})},Ct=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const o=({inputProps:r,path:l,fieldKey:c=t,...a})=>i.jsxRuntimeExports.jsx(he,{...n,...a,path:c?`${l}.${c}`:l,children:u=>i.jsxRuntimeExports.jsx(e,{...u,...s,...r})});return o.displayName=e.displayName,o},Ll=Ct(y.Numeric),Pt=Ll({}),Tl=Ct(y.Text$1),Vo=Tl({}),Al=Ct(y.Switch$1),Fo=Al({}),cm=Ct(dt),am=Ct(Bt),um=Ct(Ce.DropdownButton),Ho=({key:e,open:t,onChange:n})=>{const s=y.useMemoPrimitiveArray(e);y.useAsyncEffect(async()=>{if(t==null)return;const o=await t();if(o!=null)return o.onChange(n),async()=>await o.close()},[t==null,s])},dm=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return y.useAsyncEffect(async()=>{s(await e())},[e]),Ho({...t,onChange:s}),n},xm=Object.freeze(Object.defineProperty({__proto__:null,useListener:Ho,useState:dm},Symbol.toStringTag,{value:"Module"})),fm=({key:e,name:t,queryFn:n,values:s,openObservable:o,applyChanges:r,applyObservable:l,...c})=>{const a=Be(),u=y.useAggregator(),d=y.useMemoPrimitiveArray(e),x=Nl({values:s,...c,sync:!1,onChange:h=>{a!=null&&(async()=>{try{await(r==null?void 0:r({...h,client:a}))}catch(E){u({variant:"error",message:`Failed to save ${t}`,description:E.message})}})()}});y.useAsyncEffect(async()=>{if(a!=null)try{const h=await n({client:a});x.set("",h)}catch(h){u({variant:"error",message:`Failed to retrieve ${t}`,description:h.message})}},[d,a==null?void 0:a.key]);const p=g.useCallback(async()=>{if(a!=null)return await(o==null?void 0:o(a))},[d,a==null?void 0:a.key]),m=g.useCallback(h=>l==null?void 0:l({changes:h,ctx:x}),[d,l]);return Ho({key:d,open:p,onChange:m}),x},pm=Object.freeze(Object.defineProperty({__proto__:null,Context:Bo,Field:he,Form:im,NumericField:Pt,SwitchField:Fo,TextField:Vo,buildDropdownButtonSelectField:um,buildNumericField:Ll,buildSelectMultiField:am,buildSelectSingleField:cm,buildSwitchField:Al,buildTextField:Tl,fieldArrayUtils:Pl,fieldBuilder:Ct,use:Nl,useChildFieldValues:sm,useContext:Je,useField:xt,useFieldArray:om,useFieldListener:nm,useFieldState:kl,useFieldValid:tm,useFieldValue:Ml,useSynced:fm},Symbol.toStringTag,{value:"Module"})),mm=[{key:"name",name:"Name"},{key:"location",name:"Location"}],hm=({searchOptions:e,...t})=>{const n=Be();let s=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(s=n.hardware.devices.newSearcherWithOptions(e)),i.jsxRuntimeExports.jsx(dt,{columns:mm,searcher:s,entryRenderKey:"name",...t})},gm=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:hm},Symbol.toStringTag,{value:"Module"})),Nt="label",Zo=[{key:"color",name:"Color",render:({entry:e})=>i.jsxRuntimeExports.jsx(y.e4.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Gn=({items:e},t)=>{const n=y.filterByType(Nt,e);return n.length>0&&!n.every(s=>t.includes(s.key))},ym=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...o})=>i.jsxRuntimeExports.jsx(sn,{color:e==null?void 0:e.color,...o,children:e==null?void 0:e.name}),Em=y.componentRenderProp(ym),jm=({onChange:e,className:t,value:n,...s})=>{const o=Be(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=y.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(p=>Gn(p,H.A(n)),[n]),onDrop:g.useCallback(({items:p})=>{const m=y.filterByType(Nt,p);if(m.length===0)return[];const h=H.n([...H.A(n),...m.map(E=>E.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=y.useDraggingState(),d=g.useCallback(({dropped:p})=>{e(H.A(n).filter(m=>!p.some(h=>h.key===m)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),x=g.useCallback((p,m)=>l([{key:m,type:Nt}],d),[l,d]);return i.jsxRuntimeExports.jsx(Bt,{className:f.CSS(t,f.CSS.dropRegion(Gn(u,H.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.labels,onChange:e,columns:Zo,emptyContent:r,renderTag:Em,addPlaceholder:"Label",...a,...s})},Il=({value:e,onChange:t})=>{const n=Be(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=g.useId(),r=g.useMemo(()=>({key:o,type:"Label.SelectMultiple"}),[o]),l=y.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(u=>Gn(u,H.o$1(e)),[e]),onDrop:g.useCallback(({items:u})=>{const d=y.filterByType(Nt,u);return d.length===0?[]:(t(d[0].key,{clickedIndex:null,clicked:null,entries:[]}),d)},[r,t])}),c=y.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:Nt,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},Sm=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=Il({value:t,onChange:e});return i.jsxRuntimeExports.jsx(dt,{data:s,className:f.CSS(n,f.CSS.dropRegion(Gn(r,H.o$1(t)))),value:t,onChange:e,columns:Zo,entryRenderKey:"name",...l,...o})},Rm=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=Il({value:t,onChange:n});return i.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:Zo,entryRenderKey:"name",...r,...s})},Cm=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Nt,SelectButton:Rm,SelectMultiple:jm,SelectSingle:Sm},Symbol.toStringTag,{value:"Module"})),$l=({children:e,centered:t,visible:n,enabled:s=!0,close:o,style:r,...l})=>{const c=g.useRef(null),a=g.useRef(n);y.useClickOutside({ref:c,exclude:d=>y.findParent(d.target,p=>p.getAttribute("role")==="dialog")!=null,onClickOutside:o});const u=g.useCallback(d=>{var p;if(!a.current||d.stage!=="start")return;const x=(p=c.current)==null?void 0:p.querySelectorAll(`.${f.CSS.visible(!0)}`);x&&x.length>0||o()},[o]);return y.use$1({triggers:[["Escape"]],callback:u,loose:!0}),i.jsxRuntimeExports.jsx(J.Space,{className:f.CSS(f.CSS.BE("modal","bg"),f.CSS.visible(n),s&&f.CSS.M("enabled-modal")),empty:!0,align:"center",children:i.jsxRuntimeExports.jsx(J.Space,{className:f.CSS(f.CSS.BE("modal","dialog"),t&&f.CSS.M("centered")),role:"dialog",empty:!0,ref:c,...l,style:{zIndex:s?11:void 0,...r},children:i.jsxRuntimeExports.jsx(J.Space,{className:f.CSS(f.CSS.BE("modal","content")),empty:!0,children:e})})})},wm=({root:e,...t})=>_o.createPortal(i.jsxRuntimeExports.jsx($l,{...t}),y.getRootElement(e)),bm=Object.freeze(Object.defineProperty({__proto__:null,Dialog:$l,Modal:wm},Symbol.toStringTag,{value:"Module"})),ms=new Error("Tab not found"),vm=new Error("Invalid Mosaic"),Yn=(e,t,n="center",s)=>{var x;if(e=et(e),s===void 0)return oo(e,t);const o=ro(e,s);if(n==="center")return(x=o.tabs)==null||x.push(t),o.selected=t.tabKey,e;const r=o.key*2,l=o.key*2+1,c=n==="top"||n==="left"?r:l;if(ro(e,c).key!==o.key)return Yn(e,t,"center",c);if(o.tabs==null||o.tabs.length===0)return Yn(e,t,"center",s);const[a,u,d]=Lm(n);if(o.direction=d,o[a]={key:0,tabs:[t],selected:t.tabKey},o[u]={key:0,tabs:o.tabs,selected:o.selected},o.first==null||o.last==null)throw vm;return o.first.key=r,o.last.key=l,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},_m=(e,t,n)=>{var r;e=et(e);const[s,o]=yt(e,t);if(s==null||o==null)throw ms;return o.tabs=(r=o.tabs)==null?void 0:r.map(l=>l.tabKey===t?n(l):l),e},oo=(e,t)=>(e=et(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=oo(e.first,t):e.last!=null&&(e.last=oo(e.last,t)),e)),Wn=e=>{e=et(e);const t=[];if(e.tabs!=null&&(e.selected=Se.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=Wn(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=Wn(e.last);e.last=n,t.push(...s)}return[e,t]},Go=(e,t)=>{var o;e=et(e);const[,n]=yt(e,t);if(n==null)return[e,null];n.tabs=(o=n.tabs)==null?void 0:o.filter(r=>r.tabKey!==t),n.selected=Se.resetSelection(n.selected,n.tabs),e=Nm(e);const s=n.selected??Xn(e);return[e,s]},Xn=e=>e.selected!=null?e.selected:e.first!=null?Xn(e.first):e.last!=null?Xn(e.last):null,Dl=(e,t)=>{e=et(e);const[n,s]=yt(e,t);if(n==null||s==null)throw ms;return s.selected=t,e},Ol=(e,t,n,s)=>{e=et(e);const[o,r]=yt(e,t);if(o==null||r==null)throw ms;const[l,c]=Go(e,t);return[Yn(l,o,n,s),c]},on=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=on(e.first,t);if(n!=null)return n}if(e.last!=null){const n=on(e.last,t);if(n!=null)return n}},zl=(e,t,n)=>{const s=Kn(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},km=(e,t,n)=>{e=et(e);const s=on(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const o=s.tabs.findIndex(d=>d.tabKey===t);if(o===-1)throw new Error("Tab not found in node");const r=s.tabs[o];s.tabs=s.tabs.filter(d=>d.tabKey!==t);const l=s.key*2,a={key:s.key*2+1,tabs:[r],selected:r.tabKey},u={key:l,tabs:s.tabs,selected:s.selected};return u.selected=Se.resetSelection(u.selected,u.tabs),s.direction=n,s.first=u,s.last=a,s.tabs=void 0,s.selected=void 0,e},Mm=(e,t)=>{const n=on(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Bl=(e,t,n)=>{e=et(e);const[,s]=yt(e,t);if((s==null?void 0:s.tabs)==null)throw ms;return s.tabs=Se.rename(t,n,(s==null?void 0:s.tabs)??[]),e},Pm=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,ro=(e,t)=>{const n=Kn(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:ro(e,s)},Nm=e=>{let t=!0;for(;t;)[e,t]=io(e);return e.first==null&&e.last==null&&(e.key=1),e},io=e=>{if(e.first==null||e.last==null)return[e,!1];if(Ir(e.first))return[Ar(e.last,!0),!0];if(Ir(e.last))return[Ar(e.first,!1),!0];let t,n;return[e.first,t]=io(e.first),[e.last,n]=io(e.last),[e,t||n]},Ar=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Ir=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),yt=(e,t)=>{if(e.tabs!=null){const l=e.tabs.find(c=>c.tabKey===t);if(l!=null)return[l,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=yt(e.first,t);if(n!=null&&s!=null)return[n,s];const[o,r]=yt(e.last,t);return[o,r]},Kn=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=Kn(e.first,t);return n??Kn(e.last,t)},Lm=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},et=e=>H._.copy(e),qn=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&qn(e.first,t,n),e.last!=null&&qn(e.last,t,n),n),lo=(e,t)=>{t(e),e.first!=null&&lo(e.first,t),e.last!=null&&lo(e.last,t)};class Vl{constructor(t={}){Fe(this,"parent");Fe(this,"stub");Fe(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([n,s])=>this.el.setAttribute(n,s))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const Tm=({node:e})=>{const t=g.createRef(),n=g.useRef(e);return g.useEffect(()=>{const s=t.current;if(s==null)return;const o=s.parentNode;if(o!=null)return e.mount(o,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),g.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const s=t.current;if(s==null)return;const o=s.parentNode;o!=null&&e.mount(o,s)},[e]),i.jsxRuntimeExports.jsx("div",{ref:t})},Fl=({node:e,children:t})=>_o.createPortal(t,e.el),Am=Object.freeze(Object.defineProperty({__proto__:null,In:Fl,Node:Vl,Out:Tm},Symbol.toStringTag,{value:"Module"})),Un=g.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:s,direction:o,first:r,last:l,key:c,size:a},emptyContent:u,...d}=n,x=g.useCallback(([h])=>t(c,h),[t]),{props:p}=ko({direction:o,onResize:x,count:2,initialSizes:a!=null?[a]:void 0});let m;return s!==void 0?m=i.jsxRuntimeExports.jsx(Hl,{emptyContent:u,...n}):r!=null&&l!=null?m=i.jsxRuntimeExports.jsxs(us,{id:`mosaic-${c}`,align:"stretch",className:f.CSS.BE("mosaic","resize"),...p,children:[i.jsxRuntimeExports.jsx(Un,{...d,root:r,onResize:t},r.key),i.jsxRuntimeExports.jsx(Un,{...d,root:l,onResize:t},l.key)]}):(m=null,console.warn("Mosaic tree is malformed")),c===1?i.jsxRuntimeExports.jsx(y.Provider$3,{children:m}):m});Un.displayName="Mosaic";const Qn="pluto-mosaic-tab-drop",Yo="pluto-mosaic-tab-create",Im=(e,t,n)=>{if(y.filterByType(y.FILE_TYPE,t).length>0&&n)return!0;const o=y.filterByType(Qn,t).map(c=>c.key),r=e.filter(c=>!o.includes(c.tabKey)).length>0;return y.filterByType(Yo,t).length>0||o.length>0&&(r||e.length===0)},Hl=g.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:o,onFileDrop:r,...l})=>{const{key:c,tabs:a}=e,[u,d]=g.useState(null),x=r!=null,p=g.useCallback(({items:b})=>Im(a,b,x),[a,x]),m=g.useCallback(({items:b,event:M})=>{if(M==null)return[];d(null);const v=y.filterByType(y.FILE_TYPE,b).length>0,N=a.length===0?"center":Dr($r(M));if(v)return r==null||r(c,N,M),b;const L=y.filterByType(Qn,b);if(L.length>0){const D=L.map(({key:$})=>$)[0];t(c,D,N)}const T=y.filterByType(Yo,b);if(T.length>0){const D=T.map(({key:$})=>$);n==null||n(c,N,D)}return L},[t,a.length]),h=g.useCallback(({event:b})=>{if(b==null)return;const M=a.length===0?"center":Dr($r(b));d(M)},[a.length]),{startDrag:E,...w}=y.useDragAndDrop({type:"Mosaic",canDrop:p,onDrop:m,onDragOver:h}),R=p(y.useDraggingState()),k=g.useCallback(()=>d(null),[]),S=g.useCallback((b,{tabKey:M})=>{E([{key:M,type:Qn,elementID:b.currentTarget.id}])},[E]),j=g.useCallback(()=>n==null?void 0:n(c,"center"),[c]);return i.jsxRuntimeExports.jsxs("div",{id:`mosaic-${c}`,className:f.CSS.BE("mosaic","leaf"),children:[i.jsxRuntimeExports.jsxs(Se.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:k,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:S,onCreate:j,...l,...w,children:[e.selected!=null&&o(a.find(b=>b.tabKey===e.selected)),R&&i.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),u!=null&&i.jsxRuntimeExports.jsx("div",{className:f.CSS.BE("mosaic","mask"),style:$m[u]})]})});Hl.displayName="MosaicTabLeaf";const $m={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},$r=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{px:.5,py:.5}:{px:n/t.width,py:s/t.height}},Dm=e=>e,Om=e=>1-e,Dr=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[Dm(e),Om(e)];if(t>n&&t>s)return"bottom";if(t<n&&t<s)return"top";if(t>n&&t<s)return"left";if(t<n&&t>s)return"right";throw new Error("[bug] - invalid insert position")},zm=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),o=new Set,r=qn(e,l=>{var c;return(c=l.tabs)==null?void 0:c.map(a=>{let u=s.current.get(a.tabKey);return a==null?null:(u==null&&(u=new Vl({style:"width: 100%; height: 100%; position: relative;"}),u.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,u)),o.add(a.tabKey),i.jsxRuntimeExports.jsx(Fl,{node:u,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})}).flat().filter(l=>l!=null);return s.current.forEach((l,c)=>!o.has(c)&&s.current.delete(c)),[s,r]},Bm=re.z.object({key:re.z.number(),tabs:re.z.array(Se.tabZ).optional(),selected:re.z.string().optional(),direction:f.g.direction.optional(),size:re.z.number().optional()}),co=Bm.extend({first:re.z.lazy(()=>co).optional(),last:re.z.lazy(()=>co).optional()}),Vm=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(Wn(t)[0]),[t]),{root:n,onDrop:(u,d,x)=>s(p=>Ol(p,d,x,u)[0]),onClose:u=>s(d=>Go(d,u)[0]),onSelect:u=>s(d=>Dl(d,u)),onResize:(u,d)=>s(x=>zl(x,u,d)),onRename:e?(u,d)=>s(x=>Bl(x,u,d)):void 0}},Fm=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Yo,HAUL_DROP_TYPE:Qn,Mosaic:Un,autoSelectTabs:Wn,canSplit:Mm,findSelected:Xn,findTabNode:on,forEachNode:lo,insertTab:Yn,isEmpty:Pm,mapNodes:qn,moveTab:Ol,nodeZ:co,removeTab:Go,renameTab:Bl,resizeNode:zl,selectTab:Dl,split:km,updateTab:_m,use:Vm,usePortal:zm},Symbol.toStringTag,{value:"Module"})),Hm=({location:e="left",size:t="9rem",className:n,style:s,...o})=>{const r=f.K.construct(e),l=f.K.direction(r),c=f.g.swap(l);return i.jsxRuntimeExports.jsx(J.Space,{className:f.CSS(f.CSS.B("navbar"),f.CSS.bordered(f.K.swap(r)),f.CSS.dir(c),f.CSS.loc(r),n),direction:c,style:{[f.g.dimension(l)]:t,...s},align:"center",empty:!0,...o})},hn=e=>({bordered:t=!1,className:n,...s})=>i.jsxRuntimeExports.jsx(J.Space,{className:f.CSS(f.CSS.BE("navbar","content"),e==="absolute-center"?f.CSS.M(e):f.CSS.align(e),e!==""&&t&&f.CSS.bordered(e),n),align:"center",...s}),Zl=hn("start");Zl.displayName="NavbarStart";const Gl=hn("end");Gl.displayName="NavbarEnd";const Yl=hn("center");Yl.displayName="NavbarCenter";const Wl=hn("");Wl.displayName="NavbarContent";const Xl=hn("absolute-center");Xl.displayName="NavbarAbsoluteCenter";const Vt=Hm;Vt.Start=Zl;Vt.Center=Yl;Vt.End=Gl;Vt.AbsoluteCenter=Xl;Vt.Content=Wl;const Wo=({aetherKey:e})=>{const[,{region:t},n]=y.use$3({aetherKey:e,type:A.Eraser$1.TYPE,schema:A.eraserStateZ,initialState:{region:f.Eo.ZERO,enabled:!0}}),s=y.useSyncedRef(t),o=g.useCallback(l=>{f.Eo.equals(l,s.current)||n(c=>({...c,region:l}))},[n]);return{setEnabled:g.useCallback(l=>n(c=>({...c,enabled:l})),[n]),erase:o}},Zm=y.wrap$1(A.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:n}=Wo({aetherKey:e}),s=y.useResize(n);return i.jsxRuntimeExports.jsx("div",{ref:s,className:f.CSS(f.CSS.inheritDims()),children:t})}),Gm=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Zm,use:Wo},Symbol.toStringTag,{value:"Module"})),Ym=({items:e,initialKey:t})=>{const[n,s]=g.useState(t),o=l=>s(l===n?void 0:l),r=e.find(l=>l.key===n);return{onSelect:o,activeItem:r}},Wm=y.wrap$1("Nav.Drawer",({aetherKey:e,activeItem:t,children:n,onSelect:s,location:o="left",collapseThreshold:r=.65,className:l,onResize:c,...a})=>{const u=f.K.direction(o),d=g.useCallback(()=>t!=null&&(s==null?void 0:s(t.key)),[s,t==null?void 0:t.key]),{erase:x,setEnabled:p}=Wo({aetherKey:e}),m=g.useCallback((S,j)=>{c==null||c(S,j),x(j)},[c,x]);if(g.useLayoutEffect(()=>{p(t!=null)},[t,p]),t==null)return null;const{content:h,key:E,minSize:w,maxSize:R,initialSize:k}=t;return i.jsxRuntimeExports.jsx(Yi,{className:f.CSS(f.CSS.BE("navdrawer","content"),f.CSS.dir(u),l),collapseThreshold:r,onCollapse:d,location:o,onResize:m,minSize:w,maxSize:R,initialSize:k,...a,children:h},E)}),Xm=Object.freeze(Object.defineProperty({__proto__:null,Bar:Vt,Drawer:Wm,useDrawer:Ym},Symbol.toStringTag,{value:"Module"})),Km=({variant:e,className:t,children:n,...s})=>i.jsxRuntimeExports.jsx(J.Space,{className:f.CSS(t,f.CSS.B("note"),f.CSS.M(e)),align:"stretch",empty:!0,...s,children:n}),qm=Object.freeze(Object.defineProperty({__proto__:null,Note:Km},Symbol.toStringTag,{value:"Module"})),Vs={Close:i.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),i.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:i.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:i.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),i.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},Um=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:o,onFullscreen:r,onClose:l,...c})=>i.jsxRuntimeExports.jsxs(J.Space,{size:1.5,direction:"x",className:f.CSS(f.CSS.B("macos-controls"),!n&&f.CSS.BM("macos-controls","blurred"),t),...c,children:[i.jsxRuntimeExports.jsx(Fs,{onClick:l,className:f.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Vs.Close}),i.jsxRuntimeExports.jsx(Fs,{onClick:s,className:f.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Vs.Minimize}),i.jsxRuntimeExports.jsx(Fs,{onClick:r,className:f.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Vs.Maximize})]}),Fs=({className:e,disabled:t,color:n,...s})=>i.jsxRuntimeExports.jsx("button",{className:f.CSS(f.CSS.B("macos-control"),f.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),Hs=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:o,focused:r,...l})=>i.jsxRuntimeExports.jsxs(J.Pack,{...l,children:[i.jsxRuntimeExports.jsx(Zs,{className:f.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:i.jsxRuntimeExports.jsx(y.e4.Subtract,{})}),i.jsxRuntimeExports.jsx(Zs,{className:f.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:i.jsxRuntimeExports.jsx(y.e4.Box,{})}),i.jsxRuntimeExports.jsx(Zs,{onClick:s,className:f.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:i.jsxRuntimeExports.jsx(y.e4.Close,{})})]}),Zs=({disabled:e=!1,className:t,...n})=>e?null:i.jsxRuntimeExports.jsx(y.Icon,{className:f.CSS(f.CSS.B("windows-control"),t),tabIndex:-1,...n}),Kl=e=>H.w.getOS(e),Qm={MacOS:Um,Windows:Hs,Linux:Hs,Docker:Hs},Jm="Windows",eh=({forceOS:e,visibleIfOS:t,...n})=>{const s=Kl({force:e,default:Jm}),o=Qm[s];return t!=null&&t!==s?null:i.jsxRuntimeExports.jsx(o,{...n})},th=Object.freeze(Object.defineProperty({__proto__:null,Controls:eh,use:Kl},Symbol.toStringTag,{value:"Module"})),nh=(e,t)=>{const n=s=>i.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},sh=Object.freeze(Object.defineProperty({__proto__:null,createComponent:nh},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:H.B$1.NOOP});const oh=y.wrap$1(A.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const s=y.useMemoDeepEqualProps(n),[{path:o},,r]=y.use$3({aetherKey:e,type:A.Provider$2.TYPE,schema:A.providerStateZ$1,initialState:s});return g.useEffect(()=>{r(s)},[s,r]),i.jsxRuntimeExports.jsx(y.Composite,{path:o,children:t})}),rh="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",ql=y.wrap$1(A.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=y.use$3({aetherKey:t,type:A.BaseProvider.TYPE,schema:A.providerStateZ$2,initialState:{}});return i.jsxRuntimeExports.jsx(y.Composite,{path:n,children:e})}),ih=Object.freeze(Object.defineProperty({__proto__:null,Provider:ql},Symbol.toStringTag,{value:"Module"})),lh=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===H.Gg.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Ul=y.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:s,...o})=>{const r=y.useMemoDeepEqualProps({source:t,sink:n}),[,{status:l},c]=y.use$3({aetherKey:e,type:A.Chip.TYPE,schema:A.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:H.m.now()}}});g.useEffect(()=>{c(m=>({...m,...r}))},[r,c]);const a=g.useCallback(()=>c(m=>({...m,triggered:!m.triggered})),[c]),{message:u,chipColor:d,buttonStyle:x,disabled:p}=lh(l);return i.jsxRuntimeExports.jsx(y.Icon,{variant:"text",className:f.CSS(f.CSS.B("control-chip"),s),disabled:p,onClick:a,tooltip:i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:u}),style:x,...o,children:i.jsxRuntimeExports.jsx(y.e4.Circle,{color:d})})}),Ql=g.createContext({needsControlOf:[]}),Jl=()=>g.useContext(Ql),ch=y.wrap$1(A.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...s})=>{const o=y.useMemoDeepEqualProps(s),[{path:r},{status:l,needsControlOf:c},a]=y.use$3({aetherKey:e,type:A.Controller$1.TYPE,schema:A.controllerStateZ,initialState:o});return g.useEffect(()=>{l!=null&&(n==null||n(l))},[l,n]),g.useEffect(()=>{a(u=>({...u,...o}))},[o,a]),g.useEffect(()=>()=>n==null?void 0:n("released"),[]),i.jsxRuntimeExports.jsxs(Ql.Provider,{value:{needsControlOf:c},children:[i.jsxRuntimeExports.jsx(y.Composite,{path:r,children:t}),";"]})}),ec=y.wrap$1(A.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var a;const s=y.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:o,status:r},l]=y.use$3({aetherKey:e,type:A.Indicator.TYPE,initialState:{...s,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:H.m.now()}},schema:A.indicatorStateZ});g.useEffect(()=>{l(u=>({...u,...s}))},[s,l]);let c;return((a=r.data)==null?void 0:a.color)!=null?c=f.Color.z.parse(r.data.color):o!=null&&!o.isZero?c=o:c="var(--pluto-gray-l8)",i.jsxRuntimeExports.jsxs(y.Dialog$1,{location:{x:"center",y:"bottom"},children:[i.jsxRuntimeExports.jsx(y.Text,{level:"p",children:r.message}),i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("indicator"),style:{backgroundColor:f.cssString(c),flexGrow:1}})]})}),ah=y.wrap$1(A.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=Jl(),[,{states:s},o]=y.use$3({aetherKey:e,type:A.Legend.TYPE,schema:A.legendStateZ,initialState:{states:[],needsControlOf:n}});g.useEffect(()=>{o(c=>({...c,needsControlOf:n}))},[n]);const l=H.n(s.map(c=>c.subject.key)).map(c=>{const a=s.find(u=>u.subject.key===c);if(a==null)throw new H.Ce("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return i.jsxRuntimeExports.jsx(Ao,{data:l,...t})}),tc=y.wrap$1(A.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=y.use$3({aetherKey:e,type:A.StateProvider.TYPE,schema:A.stateProviderStateZ,initialState:{}});return i.jsxRuntimeExports.jsx(y.Composite,{path:n,children:t})}),uh=Object.freeze(Object.defineProperty({__proto__:null,Chip:Ul,Controller:ch,Indicator:ec,Legend:ah,StateProvider:tc,useContext:Jl},Symbol.toStringTag,{value:"Module"})),nc=e=>{const t=({disabled:n=!1,...s})=>n?s.children:i.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},dh=nc(ql),xh=nc(y.Provider$4),fh=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:o,tooltip:r,triggers:l,alamos:c,haul:a,channelAlias:u,telem:d,color:x})=>i.jsxRuntimeExports.jsx(y.Provider$2,{...l,children:i.jsxRuntimeExports.jsx(y.Config,{...r,children:i.jsxRuntimeExports.jsx(y.Provider$3,{...a,children:i.jsxRuntimeExports.jsx(y.Provider$5,{url:s??rh,enabled:n,children:i.jsxRuntimeExports.jsx(xh,{workerKey:"vis",children:i.jsxRuntimeExports.jsx(oh,{...c,children:i.jsxRuntimeExports.jsx(y.Aggregator,{children:i.jsxRuntimeExports.jsx(Ki,{connParams:t,children:i.jsxRuntimeExports.jsx(Qi,{...u,children:i.jsxRuntimeExports.jsx(dh,{...d,children:i.jsxRuntimeExports.jsx(y.Provider$1,{...x,children:i.jsxRuntimeExports.jsx(y.Provider,{...o,children:i.jsxRuntimeExports.jsx(tc,{children:e})})})})})})})})})})})})}),ph=Object.freeze(Object.defineProperty({__proto__:null,Provider:fh},Symbol.toStringTag,{value:"Module"})),mh=({value:e})=>i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("progress"),children:i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("progress-bar"),style:{width:`${e}%`}})}),hh=Object.freeze(Object.defineProperty({__proto__:null,Progress:mh},Symbol.toStringTag,{value:"Module"})),rn="range",Xo=[{key:"name",name:"Name"}],Jn=({items:e},t)=>{const n=y.filterByType(rn,e);return n.length>0&&!n.every(s=>t.includes(s.key))},gh=({onChange:e,className:t,value:n,...s})=>{const o=Be(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=y.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(p=>Jn(p,H.A(n)),[n]),onDrop:g.useCallback(({items:p})=>{const m=y.filterByType(rn,p);if(m.length===0)return[];const h=H.n([...H.A(n),...m.map(E=>E.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=y.useDraggingState(),d=g.useCallback(({dropped:p})=>{e(H.A(n).filter(m=>!p.some(h=>h.key===m)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),x=g.useCallback((p,m)=>l([{key:m,type:rn}],d),[l,d]);return i.jsxRuntimeExports.jsx(Bt,{className:f.CSS(t,f.CSS.dropRegion(Jn(u,H.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.ranges,onChange:e,columns:Xo,emptyContent:r,entryRenderKey:"name",...a,...s})},sc=({value:e,onChange:t})=>{const n=Be(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(y.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=g.useId(),r=g.useMemo(()=>({key:o,type:"Ranger.SelectMultiple"}),[o]),{startDrag:l,...c}=y.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(d=>Jn(d,H.o$1(e)),[e]),onDrop:g.useCallback(({items:d})=>{const x=y.filterByType(rn,d);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[r,t])}),a=y.useDraggingState(),u=g.useCallback(()=>e!=null&&l([{type:rn,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:u,searcher:n==null?void 0:n.ranges}},yh=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=sc({value:t,onChange:e});return i.jsxRuntimeExports.jsx(dt,{data:s,className:f.CSS(n,f.CSS.dropRegion(Jn(r,H.o$1(t)))),value:t,onChange:e,columns:Xo,entryRenderKey:"name",...l,...o})},Eh=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=sc({value:t,onChange:n});return i.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:Xo,entryRenderKey:"name",...r,...s})},jh=[{key:"color",name:"Color",width:50,render:e=>i.jsxRuntimeExports.jsx(y.e4.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Sh=e=>{const t=Be();return i.jsxRuntimeExports.jsx(Bt,{...e,searcher:t==null?void 0:t.labels,columns:jh,renderTag:n=>n.entry==null?i.jsxRuntimeExports.jsx(sn,{color:"gray",children:n.entryKey}):i.jsxRuntimeExports.jsx(sn,{color:n.entry.color,children:n.entry.name})})},Rh=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...o})=>{const r=new H.m(e.start),l=r.isToday?"time":"dateTime",c=new H.m(e.end),a=c.equals(H.m.MAX),u=c.span(r)<H.y.DAY?"time":"dateTime",d=r.span(c);return i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",size:"small",className:f.CSS(f.CSS.B("time-range-chip")),align:"center",...o,children:[r.isToday&&i.jsxRuntimeExports.jsx(y.Text,{level:t,shade:n,weight:450,children:"Today"}),i.jsxRuntimeExports.jsx(y.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:r}),i.jsxRuntimeExports.jsx(y.e4.Arrow.Right,{color:"var(--pluto-text-color)"}),a?i.jsxRuntimeExports.jsx(y.Text,{level:t,children:"Now"}):i.jsxRuntimeExports.jsx(y.DateTime,{level:t,displayTZ:"local",format:u,shade:n,weight:450,children:c}),!d.isZero&&s&&i.jsxRuntimeExports.jsxs(y.Text,{level:t,shade:n,weight:450,children:["(",r.span(c).truncate(H.y.MILLISECOND).toString(),")"]})]})},Ch=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Eh,SelectLabels:Sh,SelectMultiple:gh,SelectSingle:yh,TimeRangeChip:Rh},Symbol.toStringTag,{value:"Module"})),wh=({steps:e,value:t,onChange:n,...s})=>{const o=e.findIndex(r=>r.key===t);return i.jsxRuntimeExports.jsx(J.Space,{direction:"x",align:"center",className:f.CSS.B("steps"),...s,children:e.map((r,l)=>i.jsxRuntimeExports.jsxs(g.Fragment,{children:[i.jsxRuntimeExports.jsxs(y.Button,{onClick:()=>n(r.key),variant:"outlined",disabled:l>o,children:[l+1,". ",r.title]},r.key),l!==e.length-1&&i.jsxRuntimeExports.jsx(y.e4.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},r.key))})},bh=Object.freeze(Object.defineProperty({__proto__:null,Steps:wh},Symbol.toStringTag,{value:"Module"})),vh=y.wrap$1("Table",({aetherKey:e,children:t,className:n,visible:s,...o})=>{const[{path:r},,l]=y.use$3({aetherKey:e,type:A.Table.TYPE,schema:A.Table.stateZ,initialState:{region:f.Eo.ZERO,visible:s}});g.useEffect(()=>{l(a=>({...a,visible:s}))},[s]);const c=pn(a=>l(u=>({...u,region:a})));return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("div",{ref:c,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),i.jsxRuntimeExports.jsx("table",{className:f.CSS(f.CSS.B("table"),n),...o,children:i.jsxRuntimeExports.jsx("tbody",{children:i.jsxRuntimeExports.jsx(y.Composite,{path:r,children:t})})})]})}),_h=({children:e,className:t,size:n,index:s,onResize:o,onSelect:r,position:l,...c})=>i.jsxRuntimeExports.jsxs("tr",{className:f.CSS(f.CSS.BE("table","row"),t),...c,children:[o!=null&&i.jsxRuntimeExports.jsx(rc,{onSelect:r,index:s,value:n,onChange:o,position:l,direction:"y"}),e]}),hs=g.forwardRef(({children:e,className:t,selected:n=!1,...s},o)=>i.jsxRuntimeExports.jsx("td",{ref:o,...s,className:f.CSS(f.CSS.BE("table","cell"),f.CSS.selected(n),t),children:e}));hs.displayName="Cell";const oc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",kh=e=>oc[e],rc=({value:e,selected:t=!1,index:n,onChange:s,position:o,direction:r="x",onSelect:l})=>{const c=y.useSyncedRef(e),a=g.useRef(e),u=y.useCursorDrag({onStart:g.useCallback(()=>{a.current=c.current},[]),onMove:g.useCallback(d=>s(a.current+f.Eo.dim(d,r,!0),n),[s,n])});return i.jsxRuntimeExports.jsxs("td",{id:`resizer-${r}-${n}`,className:f.CSS(f.CSS.BE("table","resizer"),f.CSS.dir(r),f.CSS.selected(t),y.CONTEXT_TARGET,t&&y.CONTEXT_SELECTED),style:{[f.g.dimension(r)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[i.jsxRuntimeExports.jsx(y.Text,{level:"p",shade:7,style:{width:"100%",textAlign:"center"},children:r==="x"?oc[n]:n+1}),i.jsxRuntimeExports.jsx("button",{onClick:d=>d.stopPropagation(),style:{[f.g.location(r)]:o+e},onDragStart:u,draggable:!0})]})},Mh=({selected:e,onSelect:t,columns:n,onResize:s})=>{let o=15;return i.jsxRuntimeExports.jsxs("tr",{className:f.CSS(f.CSS.BE("table","row"),f.CSS.BE("table","col-resizer")),children:[i.jsxRuntimeExports.jsx("td",{}),n.map((r,l)=>{const c=o;return o+=r,i.jsxRuntimeExports.jsx(rc,{onSelect:t,position:c,selected:e.includes(l),index:l,value:r,onChange:a=>s(a,l),direction:"x"},l)})]})},Ph=Object.freeze(Object.defineProperty({__proto__:null,Cell:hs,ColumnIndicators:Mh,Row:_h,Table:vh,getCellColumn:kh},Symbol.toStringTag,{value:"Module"})),Nh=[{key:"standard",name:"Standard"},{key:"scientific",name:"Scientific"},{key:"engineering",name:"Engineering"}],Lh=({...e})=>i.jsxRuntimeExports.jsx(Ce.Button,{...e,entryRenderKey:"name",data:Nh}),ic=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Ko=({path:e})=>{var m;const{value:t,onChange:n}=xt({path:e}),s=A.sourcePipelinePropsZ.parse((m=t.telem)==null?void 0:m.props),o=A.streamChannelValuePropsZ.parse(s.segments.valueStream.props),r=A.stringifyNumberProps.parse(s.segments.stringifier.props),l=A.rollingAverageProps.parse(s.segments.rollingAverage.props),c=h=>{const E=A.sourcePipeline("string",{connections:ic,segments:{valueStream:A.streamChannelValue({channel:o.channel}),stringifier:A.stringifyNumber({precision:r.precision??2,notation:r.notation}),rollingAverage:A.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:E})},a=h=>c({valueStream:A.streamChannelValue({channel:h??0})}),u=h=>c({stringifier:A.stringifyNumber({...r,notation:h})}),d=h=>c({stringifier:A.stringifyNumber({...r,precision:h})}),x=h=>c({rollingAverage:A.rollingAverage({windowSize:h})}),p=xs(o.channel);return g.useEffect(()=>n({...t,tooltip:[p]}),[p]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Input Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:o.channel,onChange:a})}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Notation",children:i.jsxRuntimeExports.jsx(Lh,{value:r.notation,onChange:u})}),i.jsxRuntimeExports.jsx(Pe.Item,{label:"Precision",align:"start",children:i.jsxRuntimeExports.jsx(y.Numeric,{value:r.precision??2,bounds:{lower:0,upper:10},onChange:d})}),i.jsxRuntimeExports.jsx(Pe.Item,{label:"Averaging Window",align:"start",children:i.jsxRuntimeExports.jsx(y.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:x})})]})]})},Th=A.Value.z.partial({color:!0}).extend({level:H.levelZ.optional()}),qo=({aetherKey:e,box:t,telem:n,color:s,precision:o,minWidth:r,level:l="small",backgroundTelem:c,notation:a,location:u})=>{const d=y.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:o,level:l,minWidth:r,notation:a,backgroundTelem:c,location:u}),[,x,p]=y.use$3({aetherKey:e,type:A.Value.TYPE,schema:A.Value.z,initialState:d});return g.useEffect(()=>p(m=>({...m,...d})),[d]),{width:x.width??x.minWidth}},Ah=Object.freeze(Object.defineProperty({__proto__:null,TelemForm:Ko,VALUE_CONNECTIONS:ic,corePropsZ:Th,use:qo},Symbol.toStringTag,{value:"Module"})),Ih=re.z.object({value:re.z.string(),level:H.levelZ,weight:H.weightZ,align:f.K.x.or(f.K.center),backgroundColor:f.crudeZ}),$h=({cellKey:e,onChange:t,value:n,selected:s,onSelect:o,align:r,level:l,weight:c,backgroundColor:a})=>{const u=x=>o(e,x),d=x=>t({level:l,value:x,weight:c,align:r,backgroundColor:a});return i.jsxRuntimeExports.jsx(hs,{id:e,className:f.CSS(y.CONTEXT_TARGET,s&&y.CONTEXT_SELECTED,f.CSS.BEM("table","cell","text")),selected:s,onClick:u,onContextMenu:u,style:{backgroundColor:f.cssString(a)},children:i.jsxRuntimeExports.jsx(y.Editable,{level:l,value:n,weight:c,onChange:d,style:{justifyContent:r},allowEmpty:!0})})},Dh=re.z.object({telem:A.stringSourceSpecZ,redline:re.z.object({bounds:f.G$1.bounds,gradient:f.gradientZ}),level:H.levelZ,color:re.z.string(),units:re.z.string()}),Oh=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:o,bounds:r},selected:l,box:c,onSelect:a})=>{const{width:u}=qo({aetherKey:e,box:c,telem:t,level:n,color:s,backgroundTelem:A.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:A.scaleNumber({scale:f.b.Scale.scale(r).scale(0,1).transform}),gradient:A.colorGradient({gradient:o})},outlet:"gradient"}),location:{x:"center",y:"center"}}),d=x=>a(e,x);return i.jsxRuntimeExports.jsx(hs,{id:e,selected:l,onClick:d,onContextMenu:d,style:{height:"5rem",width:u},className:f.CSS(y.CONTEXT_TARGET,l&&y.CONTEXT_SELECTED,f.CSS.BEM("table","cell","value"))})},zh=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return i.jsxRuntimeExports.jsx(J.Space,{direction:"y",style:{padding:"2rem"},children:i.jsxRuntimeExports.jsx(Ko,{path:""})});case"redline":return i.jsxRuntimeExports.jsx(J.Space,{direction:"y",style:{padding:"2rem"},children:i.jsxRuntimeExports.jsx(Bh,{})});default:return i.jsxRuntimeExports.jsx(J.Space,{direction:"y",grow:!0,empty:!0,style:{padding:"2rem"},children:i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Variant",padHelpText:!1,children:i.jsxRuntimeExports.jsx(lc,{onChange:e,value:"value"})}),i.jsxRuntimeExports.jsx(he,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:o,onChange:r,variant:l,...c})=>i.jsxRuntimeExports.jsx(y.Swatch,{value:o??f.ZERO.setAlpha(1).rgba255,onChange:a=>r(a.rgba255),...c,bordered:!0})}),i.jsxRuntimeExports.jsx(he,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:o=>i.jsxRuntimeExports.jsx(Ce.SelectLevel,{...o})})]})})}},[]),n=Se.useStatic({tabs:[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],content:t});return i.jsxRuntimeExports.jsx(Se.Tabs,{...n})},Bh=()=>{const{set:e,get:t}=Je(),n=Ml("redline.bounds"),s=f.b.Scale.scale(0,1).scale(n);return i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Pt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Lower",path:"redline.bounds.lower"}),i.jsxRuntimeExports.jsx(he,{path:"redline.gradient",label:"Gradient",align:"start",padHelpText:!1,children:({value:o,onChange:r})=>i.jsxRuntimeExports.jsx(y.GradientPicker,{value:H._.copy(o),scale:s,onChange:l=>{const a={...t("redline.bounds").value},u=l.map(E=>E.position),d=s.pos(Math.max(...u)),x=s.pos(Math.min(...u)),p=d>a.upper,m=x<a.lower;p&&(l[l.length-1].position=1,a.upper=d),m&&(l[0].position=0,a.lower=x);const h=l.map(E=>({...E,color:new f.Color(E.color).hex}));p||m?e("redline",{bounds:a,gradient:h}):r(l.map(E=>({...E,color:new f.Color(E.color).hex})))}})}),i.jsxRuntimeExports.jsx(Pt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Upper",path:"redline.bounds.upper"})]})},Vh=({onVariantChange:e})=>i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",grow:!0,style:{padding:"2rem"},children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Variant",padHelpText:!1,children:i.jsxRuntimeExports.jsx(lc,{onChange:e,value:"text"})}),i.jsxRuntimeExports.jsx(Vo,{path:"value",label:"Text"}),i.jsxRuntimeExports.jsx(he,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Ce.SelectLevel,{...t})}),i.jsxRuntimeExports.jsx(he,{path:"weight",label:"Weight",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Ce.SelectWeight,{...t})}),i.jsxRuntimeExports.jsx(he,{path:"align",label:"Alignment",hideIfNull:!0,children:t=>i.jsxRuntimeExports.jsx(fs,{...t})}),i.jsxRuntimeExports.jsx(he,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>i.jsxRuntimeExports.jsx(y.Swatch,{value:t,onChange:n})})]}),Fh=[{key:"text",name:"Text"},{key:"value",name:"Value"}],lc=({onChange:e,value:t})=>i.jsxRuntimeExports.jsx(Ce.Button,{value:t,onChange:e,data:Fh,allowMultiple:!1,entryRenderKey:"name"}),Hh=["text","value"],Zh=re.z.enum(Hh),Gh={key:"value",name:"Value",Form:zh,Cell:Oh,defaultProps:e=>({telem:A.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:A.streamChannelValue({channel:0}),rollingAverage:A.rollingAverage({windowSize:1}),stringifier:A.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"}),redline:{bounds:{lower:0,upper:1},gradient:[]},color:e.colors.gray.l8.hex,level:"h5",units:""}),schema:Dh},Yh={key:"text",name:"Text",Form:Vh,Cell:$h,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:Ih},Wh={text:Yh,value:Gh},Xh=Object.freeze(Object.defineProperty({__proto__:null,CELLS:Wh,variantZ:Zh},Symbol.toStringTag,{value:"Module"})),Or=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const o=ft(e,...n);return f.G.distance(o,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",o),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},zr=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:o,targetBox:r})=>{if(!Kh({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=f.g.construct(t),c=f.g.swap(l);let a=ht(c,s[c]-e[c]);const u=f.Eo.loc(n,a);if(f.K.swap(t)===o){const d=f.Eo.loc(r,f.K.swap(a));Math.abs(u-d)<Le&&(a=f.K.swap(a))}return{direction:c,length:u-e[c]+Et(a,Le)}},ao=re.z.object({direction:f.g.direction,length:re.z.number()}),ft=(e,...t)=>{let n=e;for(const s of t)n=f.G.translate(n,s.direction,s.length);return n},cc=(e,t,n,s)=>{try{let o=e;const r=[e,...t.map(m=>(o=f.G.translate(o,m.direction,m.length),o))];if(!s)return r;const l=t[0],c=ht(l.direction,l.length),a=Br(c),u=4*(2-n**.5);r[0]=f.G.translate(r[0],{[l.direction]:-1*a*u,[f.g.swap(l.direction)]:0});const d=t[t.length-1],x=ht(d.direction,d.length),p=Br(x);return r[r.length-1]=f.G.translate(r[r.length-1],{[d.direction]:p*u,[f.g.swap(d.direction)]:0}),r}catch{return[]}},Le=10,Br=e=>e==="top"||e==="left"?-1:1,Et=(e,t)=>e==="top"||e==="left"?-t:t,ht=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",it=e=>ht(e.direction,e.length),Kh=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=f.g.construct(n),o=t[s]-e[s];return Et(n,o)<0},bn=e=>({direction:f.g.construct(e),length:Et(e,Le)}),Vr={top:bn("top"),bottom:bn("bottom"),left:bn("left"),right:bn("right")},qh=4,Uh=.25,gs=e=>uo(Qh(uo(e))),Qh=e=>{const t=[...e],n=e.findIndex((s,o)=>{const r=Math.abs(s.length);if(r<qh){if(o===0||o===e.length-1)return!1;if(r<Uh)return!0;if(e.length<=3)return!1;if(o+2<e.length){const l=t[o+2];if(l.direction!==s.direction)return!1;t[o+2]={...l,length:l.length+s.length}}else{const l=t[o-2];if(l.direction!==s.direction)return!1;t[o-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},uo=e=>{const t=[...e];return e.findIndex((s,o)=>{const r=t[o-1];if(o===0||s.direction!==r.direction)return!1;if(o===1){const l=o-1,c=o,a=it(r),u=it(s);if(a===u)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(r.length)===Le)return!1;const d=Et(a,Le),x=t[l].length-d,p=t[c].length+x;return Math.abs(p)<Le?!1:(t[l]={...t[l],length:d},t[c]={...t[c],length:p},!0)}if(o===e.length-1){const l=o,c=o-1,a=it(s),u=it(r);if(a===u)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(s.length)===Le)return!1;const d=Et(a,Le),x=t[l].length-d,p=t[c].length+x;return Math.abs(p)<Le?!1:(t[l]={...t[l],length:d},t[c]={...t[c],length:p},!0)}return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0})!==-1?uo(t):t},vt=e=>gs(Jh(e)),Jh=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:o,sourceOrientation:r})=>{let l=r,c=o,a={...Vr[r]},u=ft(n,a);const d={...Vr[o]};let x=ft(s,d);const p=Math.abs(u.x-x.x),m=Math.abs(u.y-x.y);p<2*Le&&m<10&&(a.length-=p/2,d.length+=p/2,u=ft(n,a),x=ft(s,d));const h=[a],E=zr({sourceStumpTip:u,sourceOrientation:r,sourceBox:e,targetStumpTip:x,targetOrientation:o,targetBox:t});E!=null&&(h.push(E),u=ft(u,E),l=it(E),a=E);const w=zr({sourceStumpTip:x,sourceOrientation:c,sourceBox:t,targetStumpTip:u,targetOrientation:l,targetBox:e});w!=null&&(x=ft(x,w),c=ht(w.direction,w.length));const R=()=>{w!=null&&(w.length*=-1,h.push(w)),d.length*=-1,h.push(d)};if(f.K.swap(l)===o){const v=f.g.construct(l),N=(x[v]-u[v])/2;h.push({direction:v,length:N});const L=f.g.swap(v);return h.push({direction:L,length:x[L]-u[L]}),h.push({direction:v,length:N}),R(),h}const k=x[a.direction]-u[a.direction];let S=f.g.swap(a.direction);const j=u[S]-x[S];let b;ht(a.direction,k)===l&&ht(S,j)===c?b={direction:a.direction,length:k}:(b={direction:S,length:x[S]-u[S]},S=f.g.swap(S)),h.push(b);const M={direction:S,length:x[S]-u[S]};return h.push(M),R(),h},eg=e=>gs(tg(e)),tg=({segments:e,index:t,magnitude:n})=>{const s=[...e],o=s[t],r=f.g.swap(o.direction),l=it(o);if(t===0){s.unshift({direction:r,length:n});const c=Et(l,Le);s.unshift({direction:o.direction,length:c}),t+=2,s[t]={...s[t],length:s[t].length-c}}else s[t-1]={direction:s[t-1].direction,length:s[t-1].length+n};if(t===s.length-1){s.push({direction:r,length:-n});const c=Et(l,Le);s.push({direction:o.direction,length:c}),s[t]={...s[t],length:s[t].length-c}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},ng=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},sg=(e,t,n=!1,...s)=>{const o=(r,l)=>!s.includes(l)&&t(r,l);return n?ng(e,o):e.findIndex(o)},og=({delta:e,segments:t})=>gs(ac(e,t,!1)),rg=({delta:e,segments:t})=>gs(ac(e,t,!0)),ac=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Hr("x",e,s,n)),e.y!==0&&(s=Hr("y",e,s,n)),s},Fr=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},o=it(t),r=it(s),l=Math.abs(s.length),c=Math.abs(t.length);return(l>c||l>Le)&&o===r},Hr=(e,t,n,s)=>{const o=f.g.swap(e),r=s?n.length-1:0,l=n[r];if(Fr(e,l,t)){const x=n[n.length-1];return x.direction===e&&Math.abs(l.length)<Le?(n[n.length-1]={...x,length:x.length-t[e]},n):(n[r]={...l,length:l.length-t[e]},n)}const c=s?0:n.length-1,u=sg(n,x=>x.direction===e,s,r);if(u===c){const x=n[c];return Fr(e,x,t)?(n[c]={...x,length:x.length-t[e]},n):(l.direction===e&&Math.abs(l.length)>x.length?n[r]={...l,length:l.length-t[e]}:n[c]={...x,length:x.length-t[e]},n)}if(u===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:o,length:n[0].length/2},{direction:e,length:-t[e]},{direction:o,length:n[0].length/2}]:l.direction===e?(n[r]={...l,length:l.length-t[e]},n):[{direction:o,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const d=n[u];return n[u]={...d,length:d.length-t[e]},n},ig=re.z.object({position:f.G.xy,zoom:re.z.number()}),uc=re.z.object({color:f.crudeZ,variant:re.z.string().optional(),segments:re.z.array(ao)}),lg=uc.extend({key:re.z.string(),source:re.z.string(),target:re.z.string(),segments:re.z.array(ao),color:f.crudeZ,id:re.z.string(),data:re.z.object({segments:re.z.array(ao),color:f.crudeZ,variant:re.z.string().optional()}).optional(),selected:re.z.boolean(),sourceHandle:re.z.string().nullable().optional(),targetHandle:re.z.string().nullable().optional()}),cg=re.z.object({key:re.z.string(),position:f.G.xy,selected:re.z.boolean().optional(),zIndex:re.z.number().optional(),type:re.z.string().optional(),data:re.z.record(re.z.unknown()).optional(),measured:re.z.object({width:re.z.number().optional(),height:re.z.number().optional()}).optional()}),Uo=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),Qo=e=>e.map(({segments:t,color:n,variant:s,...o})=>({...o,id:o.key,data:{segments:t,color:n,variant:s}})),dc=e=>e.map(t=>({key:t.id,selected:t.selected,...t})),xc=(e,t)=>e.map(n=>{var s,o,r;return n.data??(n.data={segments:[],color:t,variant:"pipe"}),{key:n.id,segments:((s=n.data)==null?void 0:s.segments)??[],selected:n.selected??!1,color:((o=n.data)==null?void 0:o.color)??t,variant:((r=n.data)==null?void 0:r.variant)??"pipe",...n}}),fc=e=>({...e.position,zoom:e.zoom}),pc=e=>({position:f.G.construct(e),zoom:e.zoom}),mc=(e,t)=>dc(t(Uo(e))),On=(e,t,n)=>xc(t(Qo(e)),n),ag=(e,t="x")=>{if(e.length===0)return[];const n=f.K.construct(t),s=f.K.swap(n);return e.sort((o,r)=>f.Eo.loc(o.box,n)-f.Eo.loc(r.box,n)),e.forEach((o,r)=>{if(r===0)return;const c=e[r-1].handles.find(m=>m.orientation===s),a=o.handles.find(m=>m.orientation===n);if(c==null||a==null)return;const u=c.absolutePosition,d=a.absolutePosition,x=f.G.set(f.G.translation(d,u),t,0),p=f.G.translate(f.Eo.topLeft(o.box),x);o.box=f.Eo.construct(p,f.Eo.dims(o.box))}),e};function we(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=we(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ug={value:()=>{}};function ys(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new zn(n)}function zn(e){this._=e}function dg(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",o=n.indexOf(".");if(o>=0&&(s=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}zn.prototype=ys.prototype={constructor:zn,on:function(e,t){var n=this._,s=dg(e+"",n),o,r=-1,l=s.length;if(arguments.length<2){for(;++r<l;)if((o=(e=s[r]).type)&&(o=xg(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<l;)if(o=(e=s[r]).type)n[o]=Zr(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Zr(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new zn(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),s=0,o,r;s<o;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,r=s.length;o<r;++o)s[o].value.apply(t,n)}};function xg(e,t){for(var n=0,s=e.length,o;n<s;++n)if((o=e[n]).name===t)return o.value}function Zr(e,t,n){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=ug,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var xo="http://www.w3.org/1999/xhtml";const Gr={svg:"http://www.w3.org/2000/svg",xhtml:xo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Es(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Gr.hasOwnProperty(t)?{space:Gr[t],local:e}:e}function fg(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===xo&&t.documentElement.namespaceURI===xo?t.createElement(e):t.createElementNS(n,e)}}function pg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hc(e){var t=Es(e);return(t.local?pg:fg)(t)}function mg(){}function Jo(e){return e==null?mg:function(){return this.querySelector(e)}}function hg(e){typeof e!="function"&&(e=Jo(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=new Array(l),a,u,d=0;d<l;++d)(a=r[d])&&(u=e.call(a,a.__data__,d,r))&&("__data__"in a&&(u.__data__=a.__data__),c[d]=u);return new Ie(s,this._parents)}function gg(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yg(){return[]}function gc(e){return e==null?yg:function(){return this.querySelectorAll(e)}}function Eg(e){return function(){return gg(e.apply(this,arguments))}}function jg(e){typeof e=="function"?e=Eg(e):e=gc(e);for(var t=this._groups,n=t.length,s=[],o=[],r=0;r<n;++r)for(var l=t[r],c=l.length,a,u=0;u<c;++u)(a=l[u])&&(s.push(e.call(a,a.__data__,u,l)),o.push(a));return new Ie(s,o)}function yc(e){return function(){return this.matches(e)}}function Ec(e){return function(t){return t.matches(e)}}var Sg=Array.prototype.find;function Rg(e){return function(){return Sg.call(this.children,e)}}function Cg(){return this.firstElementChild}function wg(e){return this.select(e==null?Cg:Rg(typeof e=="function"?e:Ec(e)))}var bg=Array.prototype.filter;function vg(){return Array.from(this.children)}function _g(e){return function(){return bg.call(this.children,e)}}function kg(e){return this.selectAll(e==null?vg:_g(typeof e=="function"?e:Ec(e)))}function Mg(e){typeof e!="function"&&(e=yc(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=[],a,u=0;u<l;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&c.push(a);return new Ie(s,this._parents)}function jc(e){return new Array(e.length)}function Pg(){return new Ie(this._enter||this._groups.map(jc),this._parents)}function es(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}es.prototype={constructor:es,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ng(e){return function(){return e}}function Lg(e,t,n,s,o,r){for(var l=0,c,a=t.length,u=r.length;l<u;++l)(c=t[l])?(c.__data__=r[l],s[l]=c):n[l]=new es(e,r[l]);for(;l<a;++l)(c=t[l])&&(o[l]=c)}function Tg(e,t,n,s,o,r,l){var c,a,u=new Map,d=t.length,x=r.length,p=new Array(d),m;for(c=0;c<d;++c)(a=t[c])&&(p[c]=m=l.call(a,a.__data__,c,t)+"",u.has(m)?o[c]=a:u.set(m,a));for(c=0;c<x;++c)m=l.call(e,r[c],c,r)+"",(a=u.get(m))?(s[c]=a,a.__data__=r[c],u.delete(m)):n[c]=new es(e,r[c]);for(c=0;c<d;++c)(a=t[c])&&u.get(p[c])===a&&(o[c]=a)}function Ag(e){return e.__data__}function Ig(e,t){if(!arguments.length)return Array.from(this,Ag);var n=t?Tg:Lg,s=this._parents,o=this._groups;typeof e!="function"&&(e=Ng(e));for(var r=o.length,l=new Array(r),c=new Array(r),a=new Array(r),u=0;u<r;++u){var d=s[u],x=o[u],p=x.length,m=$g(e.call(d,d&&d.__data__,u,s)),h=m.length,E=c[u]=new Array(h),w=l[u]=new Array(h),R=a[u]=new Array(p);n(d,x,E,w,R,m,t);for(var k=0,S=0,j,b;k<h;++k)if(j=E[k]){for(k>=S&&(S=k+1);!(b=w[S])&&++S<h;);j._next=b||null}}return l=new Ie(l,s),l._enter=c,l._exit=a,l}function $g(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Dg(){return new Ie(this._exit||this._groups.map(jc),this._parents)}function Og(e,t,n){var s=this.enter(),o=this,r=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?r.remove():n(r),s&&o?s.merge(o).order():o}function zg(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,o=n.length,r=s.length,l=Math.min(o,r),c=new Array(o),a=0;a<l;++a)for(var u=n[a],d=s[a],x=u.length,p=c[a]=new Array(x),m,h=0;h<x;++h)(m=u[h]||d[h])&&(p[h]=m);for(;a<o;++a)c[a]=n[a];return new Ie(c,this._parents)}function Bg(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],o=s.length-1,r=s[o],l;--o>=0;)(l=s[o])&&(r&&l.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(l,r),r=l);return this}function Vg(e){e||(e=Fg);function t(x,p){return x&&p?e(x.__data__,p.__data__):!x-!p}for(var n=this._groups,s=n.length,o=new Array(s),r=0;r<s;++r){for(var l=n[r],c=l.length,a=o[r]=new Array(c),u,d=0;d<c;++d)(u=l[d])&&(a[d]=u);a.sort(t)}return new Ie(o,this._parents).order()}function Fg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Hg(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Zg(){return Array.from(this)}function Gg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,r=s.length;o<r;++o){var l=s[o];if(l)return l}return null}function Yg(){let e=0;for(const t of this)++e;return e}function Wg(){return!this.node()}function Xg(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var o=t[n],r=0,l=o.length,c;r<l;++r)(c=o[r])&&e.call(c,c.__data__,r,o);return this}function Kg(e){return function(){this.removeAttribute(e)}}function qg(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ug(e,t){return function(){this.setAttribute(e,t)}}function Qg(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Jg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ey(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function ty(e,t){var n=Es(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?qg:Kg:typeof t=="function"?n.local?ey:Jg:n.local?Qg:Ug)(n,t))}function Sc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ny(e){return function(){this.style.removeProperty(e)}}function sy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function oy(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function ry(e,t,n){return arguments.length>1?this.each((t==null?ny:typeof t=="function"?oy:sy)(e,t,n??"")):Lt(this.node(),e)}function Lt(e,t){return e.style.getPropertyValue(t)||Sc(e).getComputedStyle(e,null).getPropertyValue(t)}function iy(e){return function(){delete this[e]}}function ly(e,t){return function(){this[e]=t}}function cy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ay(e,t){return arguments.length>1?this.each((t==null?iy:typeof t=="function"?cy:ly)(e,t)):this.node()[e]}function Rc(e){return e.trim().split(/^|\s+/)}function er(e){return e.classList||new Cc(e)}function Cc(e){this._node=e,this._names=Rc(e.getAttribute("class")||"")}Cc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function wc(e,t){for(var n=er(e),s=-1,o=t.length;++s<o;)n.add(t[s])}function bc(e,t){for(var n=er(e),s=-1,o=t.length;++s<o;)n.remove(t[s])}function uy(e){return function(){wc(this,e)}}function dy(e){return function(){bc(this,e)}}function xy(e,t){return function(){(t.apply(this,arguments)?wc:bc)(this,e)}}function fy(e,t){var n=Rc(e+"");if(arguments.length<2){for(var s=er(this.node()),o=-1,r=n.length;++o<r;)if(!s.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?xy:t?uy:dy)(n,t))}function py(){this.textContent=""}function my(e){return function(){this.textContent=e}}function hy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function gy(e){return arguments.length?this.each(e==null?py:(typeof e=="function"?hy:my)(e)):this.node().textContent}function yy(){this.innerHTML=""}function Ey(e){return function(){this.innerHTML=e}}function jy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Sy(e){return arguments.length?this.each(e==null?yy:(typeof e=="function"?jy:Ey)(e)):this.node().innerHTML}function Ry(){this.nextSibling&&this.parentNode.appendChild(this)}function Cy(){return this.each(Ry)}function wy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function by(){return this.each(wy)}function vy(e){var t=typeof e=="function"?e:hc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _y(){return null}function ky(e,t){var n=typeof e=="function"?e:hc(e),s=t==null?_y:typeof t=="function"?t:Jo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function My(){var e=this.parentNode;e&&e.removeChild(this)}function Py(){return this.each(My)}function Ny(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ly(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ty(e){return this.select(e?Ly:Ny)}function Ay(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Iy(e){return function(t){e.call(this,t,this.__data__)}}function $y(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function Dy(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,o=t.length,r;n<o;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++s]=r;++s?t.length=s:delete this.__on}}}function Oy(e,t,n){return function(){var s=this.__on,o,r=Iy(t);if(s){for(var l=0,c=s.length;l<c;++l)if((o=s[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=r,o.options=n),o.value=t;return}}this.addEventListener(e.type,r,n),o={type:e.type,name:e.name,value:t,listener:r,options:n},s?s.push(o):this.__on=[o]}}function zy(e,t,n){var s=$y(e+""),o,r=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var a=0,u=c.length,d;a<u;++a)for(o=0,d=c[a];o<r;++o)if((l=s[o]).type===d.type&&l.name===d.name)return d.value}return}for(c=t?Oy:Dy,o=0;o<r;++o)this.each(c(s[o],t,n));return this}function vc(e,t,n){var s=Sc(e),o=s.CustomEvent;typeof o=="function"?o=new o(t,n):(o=s.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function By(e,t){return function(){return vc(this,e,t)}}function Vy(e,t){return function(){return vc(this,e,t.apply(this,arguments))}}function Fy(e,t){return this.each((typeof t=="function"?Vy:By)(e,t))}function*Hy(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,r=s.length,l;o<r;++o)(l=s[o])&&(yield l)}var _c=[null];function Ie(e,t){this._groups=e,this._parents=t}function gn(){return new Ie([[document.documentElement]],_c)}function Zy(){return this}Ie.prototype=gn.prototype={constructor:Ie,select:hg,selectAll:jg,selectChild:wg,selectChildren:kg,filter:Mg,data:Ig,enter:Pg,exit:Dg,join:Og,merge:zg,selection:Zy,order:Bg,sort:Vg,call:Hg,nodes:Zg,node:Gg,size:Yg,empty:Wg,each:Xg,attr:ty,style:ry,property:ay,classed:fy,text:gy,html:Sy,raise:Cy,lower:by,append:vy,insert:ky,remove:Py,clone:Ty,datum:Ay,on:zy,dispatch:Fy,[Symbol.iterator]:Hy};function Ae(e){return typeof e=="string"?new Ie([[document.querySelector(e)]],[document.documentElement]):new Ie([[e]],_c)}function Gy(e){let t;for(;t=e.sourceEvent;)e=t;return e}function De(e,t){if(e=Gy(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const Yy={passive:!1},ln={capture:!0,passive:!1};function Gs(e){e.stopImmediatePropagation()}function Mt(e){e.preventDefault(),e.stopImmediatePropagation()}function kc(e){var t=e.document.documentElement,n=Ae(e).on("dragstart.drag",Mt,ln);"onselectstart"in t?n.on("selectstart.drag",Mt,ln):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Mc(e,t){var n=e.document.documentElement,s=Ae(e).on("dragstart.drag",null);t&&(s.on("click.drag",Mt,ln),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const vn=e=>()=>e;function fo(e,{sourceEvent:t,subject:n,target:s,identifier:o,active:r,x:l,y:c,dx:a,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}fo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Wy(e){return!e.ctrlKey&&!e.button}function Xy(){return this.parentNode}function Ky(e,t){return t??{x:e.x,y:e.y}}function qy(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pc(){var e=Wy,t=Xy,n=Ky,s=qy,o={},r=ys("start","drag","end"),l=0,c,a,u,d,x=0;function p(j){j.on("mousedown.drag",m).filter(s).on("touchstart.drag",w).on("touchmove.drag",R,Yy).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(j,b){if(!(d||!e.call(this,j,b))){var M=S(this,t.call(this,j,b),j,b,"mouse");M&&(Ae(j.view).on("mousemove.drag",h,ln).on("mouseup.drag",E,ln),kc(j.view),Gs(j),u=!1,c=j.clientX,a=j.clientY,M("start",j))}}function h(j){if(Mt(j),!u){var b=j.clientX-c,M=j.clientY-a;u=b*b+M*M>x}o.mouse("drag",j)}function E(j){Ae(j.view).on("mousemove.drag mouseup.drag",null),Mc(j.view,u),Mt(j),o.mouse("end",j)}function w(j,b){if(e.call(this,j,b)){var M=j.changedTouches,v=t.call(this,j,b),N=M.length,L,T;for(L=0;L<N;++L)(T=S(this,v,j,b,M[L].identifier,M[L]))&&(Gs(j),T("start",j,M[L]))}}function R(j){var b=j.changedTouches,M=b.length,v,N;for(v=0;v<M;++v)(N=o[b[v].identifier])&&(Mt(j),N("drag",j,b[v]))}function k(j){var b=j.changedTouches,M=b.length,v,N;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),v=0;v<M;++v)(N=o[b[v].identifier])&&(Gs(j),N("end",j,b[v]))}function S(j,b,M,v,N,L){var T=r.copy(),D=De(L||M,b),$,B,C;if((C=n.call(j,new fo("beforestart",{sourceEvent:M,target:p,identifier:N,active:l,x:D[0],y:D[1],dx:0,dy:0,dispatch:T}),v))!=null)return $=C.x-D[0]||0,B=C.y-D[1]||0,function I(_,O,P){var z=D,V;switch(_){case"start":o[N]=I,V=l++;break;case"end":delete o[N],--l;case"drag":D=De(P||O,b),V=l;break}T.call(_,j,new fo(_,{sourceEvent:O,subject:C,target:p,identifier:N,active:V,x:D[0]+$,y:D[1]+B,dx:D[0]-z[0],dy:D[1]-z[1],dispatch:T}),v)}}return p.filter=function(j){return arguments.length?(e=typeof j=="function"?j:vn(!!j),p):e},p.container=function(j){return arguments.length?(t=typeof j=="function"?j:vn(j),p):t},p.subject=function(j){return arguments.length?(n=typeof j=="function"?j:vn(j),p):n},p.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:vn(!!j),p):s},p.on=function(){var j=r.on.apply(r,arguments);return j===r?p:j},p.clickDistance=function(j){return arguments.length?(x=(j=+j)*j,p):Math.sqrt(x)},p}var Tt=0,Ut=0,Kt=0,Nc=1e3,ts,Qt,ns=0,jt=0,js=0,cn=typeof performance=="object"&&performance.now?performance:Date,Lc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function tr(){return jt||(Lc(Uy),jt=cn.now()+js)}function Uy(){jt=0}function ss(){this._call=this._time=this._next=null}ss.prototype=Tc.prototype={constructor:ss,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?tr():+n)+(t==null?0:+t),!this._next&&Qt!==this&&(Qt?Qt._next=this:ts=this,Qt=this),this._call=e,this._time=n,po()},stop:function(){this._call&&(this._call=null,this._time=1/0,po())}};function Tc(e,t,n){var s=new ss;return s.restart(e,t,n),s}function Qy(){tr(),++Tt;for(var e=ts,t;e;)(t=jt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tt}function Yr(){jt=(ns=cn.now())+js,Tt=Ut=0;try{Qy()}finally{Tt=0,eE(),jt=0}}function Jy(){var e=cn.now(),t=e-ns;t>Nc&&(js-=t,ns=e)}function eE(){for(var e,t=ts,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ts=n);Qt=e,po(s)}function po(e){if(!Tt){Ut&&(Ut=clearTimeout(Ut));var t=e-jt;t>24?(e<1/0&&(Ut=setTimeout(Yr,e-cn.now()-js)),Kt&&(Kt=clearInterval(Kt))):(Kt||(ns=cn.now(),Kt=setInterval(Jy,Nc)),Tt=1,Lc(Yr))}}function Wr(e,t,n){var s=new ss;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,n),s}var tE=ys("start","end","cancel","interrupt"),nE=[],Ac=0,Xr=1,mo=2,Bn=3,Kr=4,ho=5,Vn=6;function Ss(e,t,n,s,o,r){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;sE(e,n,{name:t,index:s,group:o,on:tE,tween:nE,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ac})}function nr(e,t){var n=Ve(e,t);if(n.state>Ac)throw new Error("too late; already scheduled");return n}function Ze(e,t){var n=Ve(e,t);if(n.state>Bn)throw new Error("too late; already running");return n}function Ve(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function sE(e,t,n){var s=e.__transition,o;s[t]=n,n.timer=Tc(r,0,n.time);function r(u){n.state=Xr,n.timer.restart(l,n.delay,n.time),n.delay<=u&&l(u-n.delay)}function l(u){var d,x,p,m;if(n.state!==Xr)return a();for(d in s)if(m=s[d],m.name===n.name){if(m.state===Bn)return Wr(l);m.state===Kr?(m.state=Vn,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete s[d]):+d<t&&(m.state=Vn,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete s[d])}if(Wr(function(){n.state===Bn&&(n.state=Kr,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=mo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===mo){for(n.state=Bn,o=new Array(p=n.tween.length),d=0,x=-1;d<p;++d)(m=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++x]=m);o.length=x+1}}function c(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=ho,1),x=-1,p=o.length;++x<p;)o[x].call(e,d);n.state===ho&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Vn,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function Fn(e,t){var n=e.__transition,s,o,r=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){r=!1;continue}o=s.state>mo&&s.state<ho,s.state=Vn,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}r&&delete e.__transition}}function oE(e){return this.each(function(){Fn(this,e)})}function rE(e,t){var n,s;return function(){var o=Ze(this,e),r=o.tween;if(r!==n){s=n=r;for(var l=0,c=s.length;l<c;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}o.tween=s}}function iE(e,t,n){var s,o;if(typeof n!="function")throw new Error;return function(){var r=Ze(this,e),l=r.tween;if(l!==s){o=(s=l).slice();for(var c={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=c;break}a===u&&o.push(c)}r.tween=o}}function lE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Ve(this.node(),n).tween,o=0,r=s.length,l;o<r;++o)if((l=s[o]).name===e)return l.value;return null}return this.each((t==null?rE:iE)(n,e,t))}function sr(e,t,n){var s=e._id;return e.each(function(){var o=Ze(this,s);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Ve(o,s).value[t]}}function Ic(e,t){var n;return(typeof t=="number"?A.interpolateNumber:t instanceof A.color?A.interpolateRgb:(n=A.color(t))?(t=n,A.interpolateRgb):A.interpolateString)(e,t)}function cE(e){return function(){this.removeAttribute(e)}}function aE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function uE(e,t,n){var s,o=n+"",r;return function(){var l=this.getAttribute(e);return l===o?null:l===s?r:r=t(s=l,n)}}function dE(e,t,n){var s,o=n+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===s?r:r=t(s=l,n)}}function xE(e,t,n){var s,o,r;return function(){var l,c=n(this),a;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),a=c+"",l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c)))}}function fE(e,t,n){var s,o,r;return function(){var l,c=n(this),a;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),a=c+"",l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c)))}}function pE(e,t){var n=Es(e),s=n==="transform"?qf:Ic;return this.attrTween(e,typeof t=="function"?(n.local?fE:xE)(n,s,sr(this,"attr."+e,t)):t==null?(n.local?aE:cE)(n):(n.local?dE:uE)(n,s,t))}function mE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function hE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function gE(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&hE(e,r)),n}return o._value=t,o}function yE(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&mE(e,r)),n}return o._value=t,o}function EE(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=Es(e);return this.tween(n,(s.local?gE:yE)(s,t))}function jE(e,t){return function(){nr(this,e).delay=+t.apply(this,arguments)}}function SE(e,t){return t=+t,function(){nr(this,e).delay=t}}function RE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?jE:SE)(t,e)):Ve(this.node(),t).delay}function CE(e,t){return function(){Ze(this,e).duration=+t.apply(this,arguments)}}function wE(e,t){return t=+t,function(){Ze(this,e).duration=t}}function bE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?CE:wE)(t,e)):Ve(this.node(),t).duration}function vE(e,t){if(typeof t!="function")throw new Error;return function(){Ze(this,e).ease=t}}function _E(e){var t=this._id;return arguments.length?this.each(vE(t,e)):Ve(this.node(),t).ease}function kE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ze(this,e).ease=n}}function ME(e){if(typeof e!="function")throw new Error;return this.each(kE(this._id,e))}function PE(e){typeof e!="function"&&(e=yc(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=[],a,u=0;u<l;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&c.push(a);return new Ue(s,this._parents,this._name,this._id)}function NE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,o=n.length,r=Math.min(s,o),l=new Array(s),c=0;c<r;++c)for(var a=t[c],u=n[c],d=a.length,x=l[c]=new Array(d),p,m=0;m<d;++m)(p=a[m]||u[m])&&(x[m]=p);for(;c<s;++c)l[c]=t[c];return new Ue(l,this._parents,this._name,this._id)}function LE(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function TE(e,t,n){var s,o,r=LE(t)?nr:Ze;return function(){var l=r(this,e),c=l.on;c!==s&&(o=(s=c).copy()).on(t,n),l.on=o}}function AE(e,t){var n=this._id;return arguments.length<2?Ve(this.node(),n).on.on(e):this.each(TE(n,e,t))}function IE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $E(){return this.on("end.remove",IE(this._id))}function DE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jo(e));for(var s=this._groups,o=s.length,r=new Array(o),l=0;l<o;++l)for(var c=s[l],a=c.length,u=r[l]=new Array(a),d,x,p=0;p<a;++p)(d=c[p])&&(x=e.call(d,d.__data__,p,c))&&("__data__"in d&&(x.__data__=d.__data__),u[p]=x,Ss(u[p],t,n,p,u,Ve(d,n)));return new Ue(r,this._parents,t,n)}function OE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gc(e));for(var s=this._groups,o=s.length,r=[],l=[],c=0;c<o;++c)for(var a=s[c],u=a.length,d,x=0;x<u;++x)if(d=a[x]){for(var p=e.call(d,d.__data__,x,a),m,h=Ve(d,n),E=0,w=p.length;E<w;++E)(m=p[E])&&Ss(m,t,n,E,p,h);r.push(p),l.push(d)}return new Ue(r,l,t,n)}var zE=gn.prototype.constructor;function BE(){return new zE(this._groups,this._parents)}function VE(e,t){var n,s,o;return function(){var r=Lt(this,e),l=(this.style.removeProperty(e),Lt(this,e));return r===l?null:r===n&&l===s?o:o=t(n=r,s=l)}}function $c(e){return function(){this.style.removeProperty(e)}}function FE(e,t,n){var s,o=n+"",r;return function(){var l=Lt(this,e);return l===o?null:l===s?r:r=t(s=l,n)}}function HE(e,t,n){var s,o,r;return function(){var l=Lt(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),Lt(this,e))),l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c))}}function ZE(e,t){var n,s,o,r="style."+t,l="end."+r,c;return function(){var a=Ze(this,e),u=a.on,d=a.value[r]==null?c||(c=$c(t)):void 0;(u!==n||o!==d)&&(s=(n=u).copy()).on(l,o=d),a.on=s}}function GE(e,t,n){var s=(e+="")=="transform"?Kf:Ic;return t==null?this.styleTween(e,VE(e,s)).on("end.style."+e,$c(e)):typeof t=="function"?this.styleTween(e,HE(e,s,sr(this,"style."+e,t))).each(ZE(this._id,e)):this.styleTween(e,FE(e,s,t),n).on("end.style."+e,null)}function YE(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function WE(e,t,n){var s,o;function r(){var l=t.apply(this,arguments);return l!==o&&(s=(o=l)&&YE(e,l,n)),s}return r._value=t,r}function XE(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,WE(e,t,n??""))}function KE(e){return function(){this.textContent=e}}function qE(e){return function(){var t=e(this);this.textContent=t??""}}function UE(e){return this.tween("text",typeof e=="function"?qE(sr(this,"text",e)):KE(e==null?"":e+""))}function QE(e){return function(t){this.textContent=e.call(this,t)}}function JE(e){var t,n;function s(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&QE(o)),t}return s._value=e,s}function ej(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,JE(e))}function tj(){for(var e=this._name,t=this._id,n=Dc(),s=this._groups,o=s.length,r=0;r<o;++r)for(var l=s[r],c=l.length,a,u=0;u<c;++u)if(a=l[u]){var d=Ve(a,t);Ss(a,e,n,u,l,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Ue(s,this._parents,e,n)}function nj(){var e,t,n=this,s=n._id,o=n.size();return new Promise(function(r,l){var c={value:l},a={value:function(){--o===0&&r()}};n.each(function(){var u=Ze(this,s),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(a)),u.on=t}),o===0&&r()})}var sj=0;function Ue(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Dc(){return++sj}var We=gn.prototype;Ue.prototype={constructor:Ue,select:DE,selectAll:OE,selectChild:We.selectChild,selectChildren:We.selectChildren,filter:PE,merge:NE,selection:BE,transition:tj,call:We.call,nodes:We.nodes,node:We.node,size:We.size,empty:We.empty,each:We.each,on:AE,attr:pE,attrTween:EE,style:GE,styleTween:XE,text:UE,textTween:ej,remove:$E,tween:lE,delay:RE,duration:bE,ease:_E,easeVarying:ME,end:nj,[Symbol.iterator]:We[Symbol.iterator]};function oj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var rj={time:null,delay:0,duration:250,ease:oj};function ij(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function lj(e){var t,n;e instanceof Ue?(t=e._id,e=e._name):(t=Dc(),(n=rj).time=tr(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,r=0;r<o;++r)for(var l=s[r],c=l.length,a,u=0;u<c;++u)(a=l[u])&&Ss(a,e,t,u,l,n||ij(a,t));return new Ue(s,this._parents,e,t)}gn.prototype.interrupt=oE;gn.prototype.transition=lj;const _n=e=>()=>e;function cj(e,{sourceEvent:t,target:n,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Xe(e,t,n){this.k=e,this.x=t,this.y=n}Xe.prototype={constructor:Xe,scale:function(e){return e===1?this:new Xe(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xe(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Rs=new Xe(1,0,0);Oc.prototype=Xe.prototype;function Oc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Rs;return e.__zoom}function Ys(e){e.stopImmediatePropagation()}function qt(e){e.preventDefault(),e.stopImmediatePropagation()}function aj(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uj(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function qr(){return this.__zoom||Rs}function dj(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function xj(){return navigator.maxTouchPoints||"ontouchstart"in this}function fj(e,t,n){var s=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),l>r?(r+l)/2:Math.min(0,r)||Math.max(0,l))}function zc(){var e=aj,t=uj,n=fj,s=dj,o=xj,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=ep,u=ys("start","zoom","end"),d,x,p,m=500,h=150,E=0,w=10;function R(C){C.property("__zoom",qr).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",T).filter(o).on("touchstart.zoom",D).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}R.transform=function(C,I,_,O){var P=C.selection?C.selection():C;P.property("__zoom",qr),C!==P?b(C,I,_,O):P.interrupt().each(function(){M(this,arguments).event(O).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},R.scaleBy=function(C,I,_,O){R.scaleTo(C,function(){var P=this.__zoom.k,z=typeof I=="function"?I.apply(this,arguments):I;return P*z},_,O)},R.scaleTo=function(C,I,_,O){R.transform(C,function(){var P=t.apply(this,arguments),z=this.__zoom,V=_==null?j(P):typeof _=="function"?_.apply(this,arguments):_,Z=z.invert(V),Y=typeof I=="function"?I.apply(this,arguments):I;return n(S(k(z,Y),V,Z),P,l)},_,O)},R.translateBy=function(C,I,_,O){R.transform(C,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),l)},null,O)},R.translateTo=function(C,I,_,O,P){R.transform(C,function(){var z=t.apply(this,arguments),V=this.__zoom,Z=O==null?j(z):typeof O=="function"?O.apply(this,arguments):O;return n(Rs.translate(Z[0],Z[1]).scale(V.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof _=="function"?-_.apply(this,arguments):-_),z,l)},O,P)};function k(C,I){return I=Math.max(r[0],Math.min(r[1],I)),I===C.k?C:new Xe(I,C.x,C.y)}function S(C,I,_){var O=I[0]-_[0]*C.k,P=I[1]-_[1]*C.k;return O===C.x&&P===C.y?C:new Xe(C.k,O,P)}function j(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function b(C,I,_,O){C.on("start.zoom",function(){M(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(O).end()}).tween("zoom",function(){var P=this,z=arguments,V=M(P,z).event(O),Z=t.apply(P,z),Y=_==null?j(Z):typeof _=="function"?_.apply(P,z):_,ee=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),K=P.__zoom,U=typeof I=="function"?I.apply(P,z):I,Q=a(K.invert(Y).concat(ee/K.k),U.invert(Y).concat(ee/U.k));return function(ne){if(ne===1)ne=U;else{var W=Q(ne),ie=ee/W[2];ne=new Xe(ie,Y[0]-W[0]*ie,Y[1]-W[1]*ie)}V.zoom(null,ne)}})}function M(C,I,_){return!_&&C.__zooming||new v(C,I)}function v(C,I){this.that=C,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,I),this.taps=0}v.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,I){return this.mouse&&C!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var I=Ae(this.that).datum();u.call(C,this.that,new cj(C,{sourceEvent:this.sourceEvent,target:R,type:C,transform:this.that.__zoom,dispatch:u}),I)}};function N(C,...I){if(!e.apply(this,arguments))return;var _=M(this,I).event(C),O=this.__zoom,P=Math.max(r[0],Math.min(r[1],O.k*Math.pow(2,s.apply(this,arguments)))),z=De(C);if(_.wheel)(_.mouse[0][0]!==z[0]||_.mouse[0][1]!==z[1])&&(_.mouse[1]=O.invert(_.mouse[0]=z)),clearTimeout(_.wheel);else{if(O.k===P)return;_.mouse=[z,O.invert(z)],Fn(this),_.start()}qt(C),_.wheel=setTimeout(V,h),_.zoom("mouse",n(S(k(O,P),_.mouse[0],_.mouse[1]),_.extent,l));function V(){_.wheel=null,_.end()}}function L(C,...I){if(p||!e.apply(this,arguments))return;var _=C.currentTarget,O=M(this,I,!0).event(C),P=Ae(C.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",ee,!0),z=De(C,_),V=C.clientX,Z=C.clientY;kc(C.view),Ys(C),O.mouse=[z,this.__zoom.invert(z)],Fn(this),O.start();function Y(K){if(qt(K),!O.moved){var U=K.clientX-V,Q=K.clientY-Z;O.moved=U*U+Q*Q>E}O.event(K).zoom("mouse",n(S(O.that.__zoom,O.mouse[0]=De(K,_),O.mouse[1]),O.extent,l))}function ee(K){P.on("mousemove.zoom mouseup.zoom",null),Mc(K.view,O.moved),qt(K),O.event(K).end()}}function T(C,...I){if(e.apply(this,arguments)){var _=this.__zoom,O=De(C.changedTouches?C.changedTouches[0]:C,this),P=_.invert(O),z=_.k*(C.shiftKey?.5:2),V=n(S(k(_,z),O,P),t.apply(this,I),l);qt(C),c>0?Ae(this).transition().duration(c).call(b,V,O,C):Ae(this).call(R.transform,V,O,C)}}function D(C,...I){if(e.apply(this,arguments)){var _=C.touches,O=_.length,P=M(this,I,C.changedTouches.length===O).event(C),z,V,Z,Y;for(Ys(C),V=0;V<O;++V)Z=_[V],Y=De(Z,this),Y=[Y,this.__zoom.invert(Y),Z.identifier],P.touch0?!P.touch1&&P.touch0[2]!==Y[2]&&(P.touch1=Y,P.taps=0):(P.touch0=Y,z=!0,P.taps=1+!!d);d&&(d=clearTimeout(d)),z&&(P.taps<2&&(x=Y[0],d=setTimeout(function(){d=null},m)),Fn(this),P.start())}}function $(C,...I){if(this.__zooming){var _=M(this,I).event(C),O=C.changedTouches,P=O.length,z,V,Z,Y;for(qt(C),z=0;z<P;++z)V=O[z],Z=De(V,this),_.touch0&&_.touch0[2]===V.identifier?_.touch0[0]=Z:_.touch1&&_.touch1[2]===V.identifier&&(_.touch1[0]=Z);if(V=_.that.__zoom,_.touch1){var ee=_.touch0[0],K=_.touch0[1],U=_.touch1[0],Q=_.touch1[1],ne=(ne=U[0]-ee[0])*ne+(ne=U[1]-ee[1])*ne,W=(W=Q[0]-K[0])*W+(W=Q[1]-K[1])*W;V=k(V,Math.sqrt(ne/W)),Z=[(ee[0]+U[0])/2,(ee[1]+U[1])/2],Y=[(K[0]+Q[0])/2,(K[1]+Q[1])/2]}else if(_.touch0)Z=_.touch0[0],Y=_.touch0[1];else return;_.zoom("touch",n(S(V,Z,Y),_.extent,l))}}function B(C,...I){if(this.__zooming){var _=M(this,I).event(C),O=C.changedTouches,P=O.length,z,V;for(Ys(C),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),z=0;z<P;++z)V=O[z],_.touch0&&_.touch0[2]===V.identifier?delete _.touch0:_.touch1&&_.touch1[2]===V.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(V=De(V,this),Math.hypot(x[0]-V[0],x[1]-V[1])<w)){var Z=Ae(this).on("dblclick.zoom");Z&&Z.apply(this,arguments)}}}return R.wheelDelta=function(C){return arguments.length?(s=typeof C=="function"?C:_n(+C),R):s},R.filter=function(C){return arguments.length?(e=typeof C=="function"?C:_n(!!C),R):e},R.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:_n(!!C),R):o},R.extent=function(C){return arguments.length?(t=typeof C=="function"?C:_n([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),R):t},R.scaleExtent=function(C){return arguments.length?(r[0]=+C[0],r[1]=+C[1],R):[r[0],r[1]]},R.translateExtent=function(C){return arguments.length?(l[0][0]=+C[0][0],l[1][0]=+C[1][0],l[0][1]=+C[0][1],l[1][1]=+C[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(C){return arguments.length?(n=C,R):n},R.duration=function(C){return arguments.length?(c=+C,R):c},R.interpolate=function(C){return arguments.length?(a=C,R):a},R.on=function(){var C=u.on.apply(u,arguments);return C===u?R:C},R.clickDistance=function(C){return arguments.length?(E=(C=+C)*C,R):Math.sqrt(E)},R.tapDistance=function(C){return arguments.length?(w=+C,R):w},R}const Te={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},an=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Bc=["Enter"," ","Escape"];var St;(function(e){e.Strict="strict",e.Loose="loose"})(St||(St={}));var gt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(gt||(gt={}));var At;(function(e){e.Partial="partial",e.Full="full"})(At||(At={}));const Vc={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var rt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(rt||(rt={}));var os;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(os||(os={}));var G;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(G||(G={}));const Ur={[G.Left]:G.Right,[G.Right]:G.Left,[G.Top]:G.Bottom,[G.Bottom]:G.Top};function Fc(e){return e===null?null:e?"valid":"invalid"}const Hc=e=>"id"in e&&"source"in e&&"target"in e,pj=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),or=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),yn=(e,t=[0,0])=>{const{width:n,height:s}=tt(e),o=e.origin??t,r=n*o[0],l=s*o[1];return{x:e.position.x-r,y:e.position.y-l}},mj=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,o)=>{const r=typeof o=="string";let l=!t.nodeLookup&&!r?o:void 0;t.nodeLookup&&(l=r?t.nodeLookup.get(o):or(o)?o:t.nodeLookup.get(o.id));const c=l?rs(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Cs(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ws(n)},En=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(s=>{if(t.filter===void 0||t.filter(s)){const o=rs(s);n=Cs(n,o)}}),ws(n)},Zc=(e,t,[n,s,o]=[0,0,1],r=!1,l=!1)=>{const c={...jn(t,[n,s,o]),width:t.width/o,height:t.height/o},a=[];for(const u of e.values()){const{measured:d,selectable:x=!0,hidden:p=!1}=u;if(l&&!x||p)continue;const m=d.width??u.width??u.initialWidth??null,h=d.height??u.height??u.initialHeight??null,E=un(c,$t(u)),w=(m??0)*(h??0),R=r&&E>0;(!u.internals.handleBounds||R||E>=w||u.dragging)&&a.push(u)}return a},hj=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function go(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!s||s.has(o.id))&&n.set(o.id,o)}),n}async function yo({nodes:e,width:t,height:n,panZoom:s,minZoom:o,maxZoom:r},l){if(e.size===0)return Promise.resolve(!1);const c=En(e),a=rr(c,t,n,(l==null?void 0:l.minZoom)??o,(l==null?void 0:l.maxZoom)??r,(l==null?void 0:l.padding)??.1);return await s.setViewport(a,{duration:l==null?void 0:l.duration}),Promise.resolve(!0)}function Gc({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:o,onError:r}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:a,y:u}=c?c.internals.positionAbsolute:{x:0,y:0},d=l.origin??s;let x=o;if(l.extent==="parent"&&!l.expandParent)if(!c)r==null||r("005",Te.error005());else{const m=c.measured.width,h=c.measured.height;m&&h&&(x=[[a,u],[a+m,u+h]])}else c&&Dt(l.extent)&&(x=[[l.extent[0][0]+a,l.extent[0][1]+u],[l.extent[1][0]+a,l.extent[1][1]+u]]);const p=Dt(x)?Rt(t,x,l.measured):t;return{position:{x:p.x-a+l.measured.width*d[0],y:p.y-u+l.measured.height*d[1]},positionAbsolute:p}}async function gj({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:o}){const r=new Set(e.map(p=>p.id)),l=[];for(const p of n){if(p.deletable===!1)continue;const m=r.has(p.id),h=!m&&p.parentId&&l.find(E=>E.id===p.parentId);(m||h)&&l.push(p)}const c=new Set(t.map(p=>p.id)),a=s.filter(p=>p.deletable!==!1),d=hj(l,a);for(const p of a)c.has(p.id)&&!d.find(h=>h.id===p.id)&&d.push(p);if(!o)return{edges:d,nodes:l};const x=await o({nodes:l,edges:d});return typeof x=="boolean"?x?{edges:d,nodes:l}:{edges:[],nodes:[]}:x}const It=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Rt=(e={x:0,y:0},t,n)=>({x:It(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:It(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Yc(e,t,n){const{width:s,height:o}=tt(n),{x:r,y:l}=n.internals.positionAbsolute;return Rt(e,[[r,l],[r+s,l+o]],t)}const Qr=(e,t,n)=>e<t?It(Math.abs(e-t),1,t)/t:e>n?-It(Math.abs(e-n),1,t)/t:0,Wc=(e,t,n=15,s=40)=>{const o=Qr(e.x,s,t.width-s)*n,r=Qr(e.y,s,t.height-s)*n;return[o,r]},Cs=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Eo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),ws=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),$t=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=or(e)?e.internals.positionAbsolute:yn(e,t);return{x:n,y:s,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}},rs=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=or(e)?e.internals.positionAbsolute:yn(e,t);return{x:n,y:s,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:s+(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0)}},Xc=(e,t)=>ws(Cs(Eo(e),Eo(t))),un=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},Jr=e=>Oe(e.width)&&Oe(e.height)&&Oe(e.x)&&Oe(e.y),Oe=e=>!isNaN(e)&&isFinite(e),is=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},bs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),jn=({x:e,y:t},[n,s,o],r=!1,l=[1,1])=>{const c={x:(e-n)/o,y:(t-s)/o};return r?bs(c,l):c},Kc=({x:e,y:t},[n,s,o])=>({x:e*o+n,y:t*o+s}),rr=(e,t,n,s,o,r)=>{const l=t/(e.width*(1+r)),c=n/(e.height*(1+r)),a=Math.min(l,c),u=It(a,s,o),d=e.x+e.width/2,x=e.y+e.height/2,p=t/2-d*u,m=n/2-x*u;return{x:p,y:m,zoom:u}},ls=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Dt(e){return e!==void 0&&e!=="parent"}function tt(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function qc(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Uc(e,t={width:0,height:0},n,s,o){const r={...e},l=s.get(n);if(l){const c=l.origin||o;r.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],r.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return r}function en(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:o}){const{x:r,y:l}=Ke(e),c=jn({x:r-((o==null?void 0:o.left)??0),y:l-((o==null?void 0:o.top)??0)},s),{x:a,y:u}=n?bs(c,t):c;return{xSnapped:a,ySnapped:u,...c}}const vs=e=>({width:e.offsetWidth,height:e.offsetHeight}),Qc=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},yj=["INPUT","SELECT","TEXTAREA"];function jo(e){var s,o;const t=((o=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:o[0])||e.target;return yj.includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const Jc=e=>"clientX"in e,Ke=(e,t)=>{var r,l;const n=Jc(e),s=n?e.clientX:(r=e.touches)==null?void 0:r[0].clientX,o=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},ei=(e,t,n,s,o)=>{const r=t.querySelectorAll(`.${e}`);return!r||!r.length?null:Array.from(r).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:o,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/s,y:(c.top-n.top)/s,...vs(l)}})};function ea({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:o,sourceControlY:r,targetControlX:l,targetControlY:c}){const a=e*.125+o*.375+l*.375+n*.125,u=t*.125+r*.375+c*.375+s*.125,d=Math.abs(a-e),x=Math.abs(u-t);return[a,u,d,x]}function kn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ti({pos:e,x1:t,y1:n,x2:s,y2:o,c:r}){switch(e){case G.Left:return[t-kn(t-s,r),n];case G.Right:return[t+kn(s-t,r),n];case G.Top:return[t,n-kn(n-o,r)];case G.Bottom:return[t,n+kn(o-n,r)]}}function ta({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:s,targetY:o,targetPosition:r=G.Top,curvature:l=.25}){const[c,a]=ti({pos:n,x1:e,y1:t,x2:s,y2:o,c:l}),[u,d]=ti({pos:r,x1:s,y1:o,x2:e,y2:t,c:l}),[x,p,m,h]=ea({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:c,sourceControlY:a,targetControlX:u,targetControlY:d});return[`M${e},${t} C${c},${a} ${u},${d} ${s},${o}`,x,p,m,h]}function na({sourceX:e,sourceY:t,targetX:n,targetY:s}){const o=Math.abs(n-e)/2,r=n<e?n+o:n-o,l=Math.abs(s-t)/2,c=s<t?s+l:s-l;return[r,c,o,l]}function Ej({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:o=!1}){if(!o)return s;const r=n||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return s+(r?l:0)}function jj({sourceNode:e,targetNode:t,width:n,height:s,transform:o}){const r=Cs(rs(e),rs(t));r.x===r.x2&&(r.x2+=1),r.y===r.y2&&(r.y2+=1);const l={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:s/o[2]};return un(l,ws(r))>0}const sa=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,Sj=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),oa=(e,t)=>{if(!e.source||!e.target)return is("006",Te.error006()),t;let n;return Hc(e)?n={...e}:n={...e,id:sa(e)},Sj(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},Rj=(e,t,n,s={shouldReplaceId:!0})=>{const{id:o,...r}=e;if(!t.source||!t.target)return is("006",Te.error006()),n;if(!n.find(a=>a.id===e.id))return is("007",Te.error007(o)),n;const c={...r,id:s.shouldReplaceId?sa(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==o).concat(c)};function ra({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[o,r,l,c]=na({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,o,r,l,c]}const ni={[G.Left]:{x:-1,y:0},[G.Right]:{x:1,y:0},[G.Top]:{x:0,y:-1},[G.Bottom]:{x:0,y:1}},Cj=({source:e,sourcePosition:t=G.Bottom,target:n})=>t===G.Left||t===G.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},si=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wj({source:e,sourcePosition:t=G.Bottom,target:n,targetPosition:s=G.Top,center:o,offset:r}){const l=ni[t],c=ni[s],a={x:e.x+l.x*r,y:e.y+l.y*r},u={x:n.x+c.x*r,y:n.y+c.y*r},d=Cj({source:a,sourcePosition:t,target:u}),x=d.x!==0?"x":"y",p=d[x];let m=[],h,E;const w={x:0,y:0},R={x:0,y:0},[k,S,j,b]=na({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[x]*c[x]===-1){h=o.x??k,E=o.y??S;const v=[{x:h,y:a.y},{x:h,y:u.y}],N=[{x:a.x,y:E},{x:u.x,y:E}];l[x]===p?m=x==="x"?v:N:m=x==="x"?N:v}else{const v=[{x:a.x,y:u.y}],N=[{x:u.x,y:a.y}];if(x==="x"?m=l.x===p?N:v:m=l.y===p?v:N,t===s){const B=Math.abs(e[x]-n[x]);if(B<=r){const C=Math.min(r-1,r-B);l[x]===p?w[x]=(a[x]>e[x]?-1:1)*C:R[x]=(u[x]>n[x]?-1:1)*C}}if(t!==s){const B=x==="x"?"y":"x",C=l[x]===c[B],I=a[B]>u[B],_=a[B]<u[B];(l[x]===1&&(!C&&I||C&&_)||l[x]!==1&&(!C&&_||C&&I))&&(m=x==="x"?v:N)}const L={x:a.x+w.x,y:a.y+w.y},T={x:u.x+R.x,y:u.y+R.y},D=Math.max(Math.abs(L.x-m[0].x),Math.abs(T.x-m[0].x)),$=Math.max(Math.abs(L.y-m[0].y),Math.abs(T.y-m[0].y));D>=$?(h=(L.x+T.x)/2,E=m[0].y):(h=m[0].x,E=(L.y+T.y)/2)}return[[e,{x:a.x+w.x,y:a.y+w.y},...m,{x:u.x+R.x,y:u.y+R.y},n],h,E,j,b]}function bj(e,t,n,s){const o=Math.min(si(e,t)/2,si(t,n)/2,s),{x:r,y:l}=t;if(e.x===r&&r===n.x||e.y===l&&l===n.y)return`L${r} ${l}`;if(e.y===l){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${r+o*u},${l}Q ${r},${l} ${r},${l+o*d}`}const c=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${r},${l+o*a}Q ${r},${l} ${r+o*c},${l}`}function So({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:s,targetY:o,targetPosition:r=G.Top,borderRadius:l=5,centerX:c,centerY:a,offset:u=20}){const[d,x,p,m,h]=wj({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:o},targetPosition:r,center:{x:c,y:a},offset:u});return[d.reduce((w,R,k)=>{let S="";return k>0&&k<d.length-1?S=bj(d[k-1],R,d[k+1],l):S=`${k===0?"M":"L"}${R.x} ${R.y}`,w+=S,w},""),x,p,m,h]}function oi(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function vj(e){var x;const{sourceNode:t,targetNode:n}=e;if(!oi(t)||!oi(n))return null;const s=t.internals.handleBounds||ri(t.handles),o=n.internals.handleBounds||ri(n.handles),r=ii((s==null?void 0:s.source)??[],e.sourceHandle),l=ii(e.connectionMode===St.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!r||!l)return(x=e.onError)==null||x.call(e,"008",Te.error008(r?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(r==null?void 0:r.position)||G.Bottom,a=(l==null?void 0:l.position)||G.Top,u=dn(t,r,c),d=dn(n,l,a);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:a}}function ri(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function dn(e,t,n=G.Left,s=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,r=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??tt(e);if(s)return{x:o+l/2,y:r+c/2};switch((t==null?void 0:t.position)??n){case G.Top:return{x:o+l/2,y:r};case G.Right:return{x:o+l,y:r+c/2};case G.Bottom:return{x:o+l/2,y:r+c};case G.Left:return{x:o,y:r+c/2}}}function ii(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Ro(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function _j(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:o}){const r=new Set;return e.reduce((l,c)=>([c.markerStart||s,c.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=Ro(a,t);r.has(u)||(l.push({id:u,color:a.color||n,...a}),r.add(u))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const ir={nodeOrigin:[0,0],nodeExtent:an,elevateNodesOnSelect:!0,defaults:{}},kj={...ir,checkEquality:!0};function lr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Mj(e,t,n){const s=lr(ir,n);for(const o of e.values())if(o.parentId)cr(o,e,t,s);else{const r=yn(o,s.nodeOrigin),l=Dt(o.extent)?o.extent:s.nodeExtent,c=Rt(r,l,tt(o));o.internals.positionAbsolute=c}}function Co(e,t,n,s){var c,a;const o=lr(kj,s),r=new Map(t),l=o!=null&&o.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let d=r.get(u.id);if(o.checkEquality&&u===(d==null?void 0:d.internals.userNode))t.set(u.id,d);else{const x=yn(u,o.nodeOrigin),p=Dt(u.extent)?u.extent:o.nodeExtent,m=Rt(x,p,tt(u));d={...o.defaults,...u,measured:{width:(c=u.measured)==null?void 0:c.width,height:(a=u.measured)==null?void 0:a.height},internals:{positionAbsolute:m,handleBounds:u.measured?d==null?void 0:d.internals.handleBounds:void 0,z:ia(u,l),userNode:u}},t.set(u.id,d)}u.parentId&&cr(d,t,n,s)}}function Pj(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function cr(e,t,n,s){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:l}=lr(ir,s),c=e.parentId,a=t.get(c);if(!a){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Pj(e,n);const u=o?1e3:0,{x:d,y:x,z:p}=Nj(e,a,r,l,u),{positionAbsolute:m}=e.internals,h=d!==m.x||x!==m.y;(h||p!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:h?{x:d,y:x}:m,z:p})}function ia(e,t){return(Oe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Nj(e,t,n,s,o){const{x:r,y:l}=t.internals.positionAbsolute,c=tt(e),a=yn(e,n),u=Dt(e.extent)?Rt(a,e.extent,c):a;let d=Rt({x:r+u.x,y:l+u.y},s,c);e.extent==="parent"&&(d=Yc(d,c,t));const x=ia(e,o),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>x?p:x}}function ar(e,t,n,s=[0,0]){var l;const o=[],r=new Map;for(const c of e){const a=t.get(c.parentId);if(!a)continue;const u=((l=r.get(c.parentId))==null?void 0:l.expandedRect)??$t(a),d=Xc(u,c.rect);r.set(c.parentId,{expandedRect:d,parent:a})}return r.size>0&&r.forEach(({expandedRect:c,parent:a},u)=>{var S;const d=a.internals.positionAbsolute,x=tt(a),p=a.origin??s,m=c.x<d.x?Math.round(Math.abs(d.x-c.x)):0,h=c.y<d.y?Math.round(Math.abs(d.y-c.y)):0,E=Math.max(x.width,Math.round(c.width)),w=Math.max(x.height,Math.round(c.height)),R=(E-x.width)*p[0],k=(w-x.height)*p[1];(m>0||h>0||R||k)&&(o.push({id:u,type:"position",position:{x:a.position.x-m+R,y:a.position.y-h+k}}),(S=n.get(u))==null||S.forEach(j=>{e.some(b=>b.id===j.id)||o.push({id:j.id,type:"position",position:{x:j.position.x+m,y:j.position.y+h}})})),(x.width<c.width||x.height<c.height||m||h)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:E+(m?p[0]*m-R:0),height:w+(h?p[1]*h-k:0)}})}),o}function Lj(e,t,n,s,o,r){const l=s==null?void 0:s.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const a=[],u=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(u.transform),x=[];for(const p of e.values()){const m=t.get(p.id);if(m)if(m.hidden)m.internals={...m.internals,handleBounds:void 0},c=!0;else{const h=vs(p.nodeElement),E=m.measured.width!==h.width||m.measured.height!==h.height;if(!!(h.width&&h.height&&(E||!m.internals.handleBounds||p.force))){const R=p.nodeElement.getBoundingClientRect(),k=Dt(m.extent)?m.extent:r;let{positionAbsolute:S}=m.internals;m.parentId&&m.extent==="parent"?S=Yc(S,h,t.get(m.parentId)):k&&(S=Rt(S,k,h)),m.measured=h,m.internals={...m.internals,positionAbsolute:S,handleBounds:{source:ei("source",p.nodeElement,R,d,m.id),target:ei("target",p.nodeElement,R,d,m.id)}},m.parentId&&cr(m,t,n,{nodeOrigin:o}),c=!0,E&&(a.push({id:m.id,type:"dimensions",dimensions:h}),m.expandParent&&m.parentId&&x.push({id:m.id,parentId:m.parentId,rect:$t(m,o)}))}}}if(x.length>0){const p=ar(x,t,n,o);a.push(...p)}return{changes:a,updatedInternals:c}}async function Tj({delta:e,panZoom:t,transform:n,translateExtent:s,width:o,height:r}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,r]],s),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function la(e,t,n){e.clear(),t.clear();for(const s of n){const{source:o,target:r,sourceHandle:l=null,targetHandle:c=null}=s,a=`${o}-source-${l}`,u=`${r}-target-${c}`,d=e.get(a)||new Map,x=e.get(u)||new Map,p={edgeId:s.id,source:o,target:r,sourceHandle:l,targetHandle:c};t.set(s.id,s),e.set(a,d.set(`${r}-${c}`,p)),e.set(u,x.set(`${o}-${l}`,p))}}function ca(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:ca(n,t):!1}function li(e,t,n){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===n)return!1;s=s.parentElement}while(s);return!1}function Aj(e,t,n,s){const o=new Map;for(const[r,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!ca(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(r);c&&o.set(r,{id:r,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return o}function Ws({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var l,c,a;const o=[];for(const[u,d]of t){const x=(l=n.get(u))==null?void 0:l.internals.userNode;x&&o.push({...x,position:d.position,dragging:s})}if(!e)return[o[0],o];const r=(c=n.get(e))==null?void 0:c.internals.userNode;return[r?{...r,position:((a=t.get(e))==null?void 0:a.position)||r.position,dragging:s}:o[0],o]}function Ij({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:o}){let r={x:null,y:null},l=0,c=new Map,a=!1,u={x:0,y:0},d=null,x=!1,p=null,m=!1;function h({noDragClassName:w,handleSelector:R,domNode:k,isSelectable:S,nodeId:j,nodeClickDistance:b=0}){p=Ae(k);function M({x:T,y:D},$){const{nodeLookup:B,nodeExtent:C,snapGrid:I,snapToGrid:_,nodeOrigin:O,onNodeDrag:P,onSelectionDrag:z,onError:V,updateNodePositions:Z}=t();r={x:T,y:D};let Y=!1,ee={x:0,y:0,x2:0,y2:0};if(c.size>1&&C){const K=En(c);ee=Eo(K)}for(const[K,U]of c){if(!B.has(K))continue;let Q={x:T-U.distance.x,y:D-U.distance.y};_&&(Q=bs(Q,I));let ne=[[C[0][0],C[0][1]],[C[1][0],C[1][1]]];if(c.size>1&&C&&!U.extent){const{positionAbsolute:de}=U.internals,ae=de.x-ee.x+C[0][0],te=de.x+U.measured.width-ee.x2+C[1][0],X=de.y-ee.y+C[0][1],se=de.y+U.measured.height-ee.y2+C[1][1];ne=[[ae,X],[te,se]]}const{position:W,positionAbsolute:ie}=Gc({nodeId:K,nextPosition:Q,nodeLookup:B,nodeExtent:ne,nodeOrigin:O,onError:V});Y=Y||U.position.x!==W.x||U.position.y!==W.y,U.position=W,U.internals.positionAbsolute=ie}if(Y&&(Z(c,!0),$&&(s||P||!j&&z))){const[K,U]=Ws({nodeId:j,dragItems:c,nodeLookup:B});s==null||s($,c,K,U),P==null||P($,K,U),j||z==null||z($,U)}}async function v(){if(!d)return;const{transform:T,panBy:D,autoPanSpeed:$}=t(),[B,C]=Wc(u,d,$);(B!==0||C!==0)&&(r.x=(r.x??0)-B/T[2],r.y=(r.y??0)-C/T[2],await D({x:B,y:C})&&M(r,null)),l=requestAnimationFrame(v)}function N(T){var Y;const{nodeLookup:D,multiSelectionActive:$,nodesDraggable:B,transform:C,snapGrid:I,snapToGrid:_,selectNodesOnDrag:O,onNodeDragStart:P,onSelectionDragStart:z,unselectNodesAndEdges:V}=t();x=!0,(!O||!S)&&!$&&j&&((Y=D.get(j))!=null&&Y.selected||V()),S&&O&&j&&(e==null||e(j));const Z=en(T.sourceEvent,{transform:C,snapGrid:I,snapToGrid:_,containerBounds:d});if(r=Z,c=Aj(D,B,Z,j),c.size>0&&(n||P||!j&&z)){const[ee,K]=Ws({nodeId:j,dragItems:c,nodeLookup:D});n==null||n(T.sourceEvent,c,ee,K),P==null||P(T.sourceEvent,ee,K),j||z==null||z(T.sourceEvent,K)}}const L=Pc().clickDistance(b).on("start",T=>{const{domNode:D,nodeDragThreshold:$,transform:B,snapGrid:C,snapToGrid:I}=t();d=(D==null?void 0:D.getBoundingClientRect())||null,m=!1,$===0&&N(T),r=en(T.sourceEvent,{transform:B,snapGrid:C,snapToGrid:I,containerBounds:d}),u=Ke(T.sourceEvent,d)}).on("drag",T=>{const{autoPanOnNodeDrag:D,transform:$,snapGrid:B,snapToGrid:C,nodeDragThreshold:I,nodeLookup:_}=t(),O=en(T.sourceEvent,{transform:$,snapGrid:B,snapToGrid:C,containerBounds:d});if((T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||j&&!_.has(j))&&(m=!0),!m){if(!a&&D&&x&&(a=!0,v()),!x){const P=O.xSnapped-(r.x??0),z=O.ySnapped-(r.y??0);Math.sqrt(P*P+z*z)>I&&N(T)}(r.x!==O.xSnapped||r.y!==O.ySnapped)&&c&&x&&(u=Ke(T.sourceEvent,d),M(O,T.sourceEvent))}}).on("end",T=>{if(!(!x||m)&&(a=!1,x=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:D,updateNodePositions:$,onNodeDragStop:B,onSelectionDragStop:C}=t();if($(c,!1),o||B||!j&&C){const[I,_]=Ws({nodeId:j,dragItems:c,nodeLookup:D,dragging:!1});o==null||o(T.sourceEvent,c,I,_),B==null||B(T.sourceEvent,I,_),j||C==null||C(T.sourceEvent,_)}}}).filter(T=>{const D=T.target;return!T.button&&(!w||!li(D,`.${w}`,k))&&(!R||li(D,R,k))});p.call(L)}function E(){p==null||p.on(".drag",null)}return{update:h,destroy:E}}function $j(e,t,n){const s=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())un(o,$t(r))>0&&s.push(r);return s}const Dj=250;function Oj(e,t,n,s){var c,a;let o=[],r=1/0;const l=$j(e,n,t+Dj);for(const u of l){const d=[...((c=u.internals.handleBounds)==null?void 0:c.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const x of d){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:p,y:m}=dn(u,x,x.position,!0),h=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));h>t||(h<r?(o=[{...x,x:p,y:m}],r=h):h===r&&o.push({...x,x:p,y:m}))}}if(!o.length)return null;if(o.length>1){const u=s.type==="source"?"target":"source";return o.find(d=>d.type===u)??o[0]}return o[0]}function aa(e,t,n,s,o,r=!1){var u,d,x;const l=s.get(e);if(!l)return null;const c=o==="strict"?(u=l.internals.handleBounds)==null?void 0:u[t]:[...((d=l.internals.handleBounds)==null?void 0:d.source)??[],...((x=l.internals.handleBounds)==null?void 0:x.target)??[]],a=(n?c==null?void 0:c.find(p=>p.id===n):c==null?void 0:c[0])??null;return a&&r?{...a,...dn(l,a,a.position,!0)}:a}function ua(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function zj(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const da=()=>!0;function Bj(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:o,edgeUpdaterType:r,isTarget:l,domNode:c,nodeLookup:a,lib:u,autoPanOnConnect:d,flowId:x,panBy:p,cancelConnection:m,onConnectStart:h,onConnect:E,onConnectEnd:w,isValidConnection:R=da,onReconnectEnd:k,updateConnection:S,getTransform:j,getFromHandle:b,autoPanSpeed:M}){const v=Qc(e.target);let N=0,L;const{x:T,y:D}=Ke(e),$=v==null?void 0:v.elementFromPoint(T,D),B=ua(r,$),C=c==null?void 0:c.getBoundingClientRect();if(!C||!B)return;const I=aa(o,B,s,a,t);if(!I)return;let _=Ke(e,C),O=!1,P=null,z=!1,V=null;function Z(){if(!d||!C)return;const[ie,de]=Wc(_,C,M);p({x:ie,y:de}),N=requestAnimationFrame(Z)}const Y={...I,nodeId:o,type:B,position:I.position},ee=a.get(o),U={inProgress:!0,isValid:null,from:dn(ee,Y,G.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:ee,to:_,toHandle:null,toPosition:Ur[Y.position],toNode:null};S(U);let Q=U;h==null||h(e,{nodeId:o,handleId:s,handleType:B});function ne(ie){if(!b()||!Y){W(ie);return}const de=j();_=Ke(ie,C),L=Oj(jn(_,de,!1,[1,1]),n,a,Y),O||(Z(),O=!0);const ae=xa(ie,{handle:L,connectionMode:t,fromNodeId:o,fromHandleId:s,fromType:l?"target":"source",isValidConnection:R,doc:v,lib:u,flowId:x,nodeLookup:a});V=ae.handleDomNode,P=ae.connection,z=zj(!!L,ae.isValid);const te={...Q,isValid:z,to:L&&z?Kc({x:L.x,y:L.y},de):_,toHandle:ae.toHandle,toPosition:z&&ae.toHandle?ae.toHandle.position:Ur[Y.position],toNode:ae.toHandle?a.get(ae.toHandle.nodeId):null};z&&L&&Q.toHandle&&te.toHandle&&Q.toHandle.type===te.toHandle.type&&Q.toHandle.nodeId===te.toHandle.nodeId&&Q.toHandle.id===te.toHandle.id&&Q.to.x===te.to.x&&Q.to.y===te.to.y||(S(te),Q=te)}function W(ie){(L||V)&&P&&z&&(E==null||E(P));const{inProgress:de,...ae}=Q,te={...ae,toPosition:Q.toHandle?Q.toPosition:null};w==null||w(ie,te),r&&(k==null||k(ie,te)),m(),cancelAnimationFrame(N),O=!1,z=!1,P=null,V=null,v.removeEventListener("mousemove",ne),v.removeEventListener("mouseup",W),v.removeEventListener("touchmove",ne),v.removeEventListener("touchend",W)}v.addEventListener("mousemove",ne),v.addEventListener("mouseup",W),v.addEventListener("touchmove",ne),v.addEventListener("touchend",W)}function xa(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:r,doc:l,lib:c,flowId:a,isValidConnection:u=da,nodeLookup:d}){const x=r==="target",p=t?l.querySelector(`.${c}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:h}=Ke(e),E=l.elementFromPoint(m,h),w=E!=null&&E.classList.contains(`${c}-flow__handle`)?E:p,R={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const k=ua(void 0,w),S=w.getAttribute("data-nodeid"),j=w.getAttribute("data-handleid"),b=w.classList.contains("connectable"),M=w.classList.contains("connectableend");if(!S||!k)return R;const v={source:x?S:s,sourceHandle:x?j:o,target:x?s:S,targetHandle:x?o:j};R.connection=v;const L=b&&M&&(n===St.Strict?x&&k==="source"||!x&&k==="target":S!==s||j!==o);R.isValid=L&&u(v),R.toHandle=aa(S,k,j,d,n,!1)}return R}const wo={onPointerDown:Bj,isValid:xa};function Vj({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const o=Ae(e);function r({translateExtent:c,width:a,height:u,zoomStep:d=10,pannable:x=!0,zoomable:p=!0,inversePan:m=!1}){const h=S=>{const j=n();if(S.sourceEvent.type!=="wheel"||!t)return;const b=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*d,M=j[2]*Math.pow(2,b);t.scaleTo(M)};let E=[0,0];const w=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(E=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},R=S=>{const j=n();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!t)return;const b=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],M=[b[0]-E[0],b[1]-E[1]];E=b;const v=s()*Math.max(j[2],Math.log(j[2]))*(m?-1:1),N={x:j[0]-M[0]*v,y:j[1]-M[1]*v},L=[[0,0],[a,u]];t.setViewportConstrained({x:N.x,y:N.y,zoom:j[2]},L,c)},k=zc().on("start",w).on("zoom",x?R:null).on("zoom.wheel",p?h:null);o.call(k,{})}function l(){o.on("zoom",null)}return{update:r,destroy:l,pointer:De}}const Fj=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,_s=e=>({x:e.x,y:e.y,zoom:e.k}),Xs=({x:e,y:t,zoom:n})=>Rs.translate(e,t).scale(n),_t=(e,t)=>e.target.closest(`.${t}`),fa=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ks=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},pa=e=>{const t=e.ctrlKey&&ls()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Hj({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:r,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:u}){return d=>{if(_t(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const x=n.property("__zoom").k||1;if(d.ctrlKey&&l){const w=De(d),R=pa(d),k=x*Math.pow(2,R);s.scaleTo(n,k,w,d);return}const p=d.deltaMode===1?20:1;let m=o===gt.Vertical?0:d.deltaX*p,h=o===gt.Horizontal?0:d.deltaY*p;!ls()&&d.shiftKey&&o!==gt.Vertical&&(m=d.deltaY*p,h=0),s.translateBy(n,-(m/x)*r,-(h/x)*r,{internal:!0});const E=_s(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(d,E)),e.isPanScrolling&&(a==null||a(d,E),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,E),e.isPanScrolling=!1},150))}}function Zj({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,o){if(!t&&s.type==="wheel"&&!s.ctrlKey||_t(s,e))return null;s.preventDefault(),n.call(this,s,o)}}function Gj({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var r,l,c;if((r=s.sourceEvent)!=null&&r.internal)return;const o=_s(s.transform);e.mouseButton=((l=s.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((c=s.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,o))}}function Yj({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:o}){return r=>{var l,c;e.usedRightMouseButton=!!(n&&fa(t,e.mouseButton??0)),(l=r.sourceEvent)!=null&&l.sync||s([r.transform.x,r.transform.y,r.transform.k]),o&&!((c=r.sourceEvent)!=null&&c.internal)&&(o==null||o(r.sourceEvent,_s(r.transform)))}}function Wj({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:r}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,r&&fa(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&r(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),o&&Fj(e.prevViewport,l.transform))){const a=_s(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(l.sourceEvent,a)},n?150:0)}}}function Xj({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:r,userSelectionActive:l,noWheelClassName:c,noPanClassName:a,lib:u}){return d=>{var h;const x=e||t,p=n&&d.ctrlKey;if(d.button===1&&d.type==="mousedown"&&(_t(d,`${u}-flow__node`)||_t(d,`${u}-flow__edge`)))return!0;if(!s&&!x&&!o&&!r&&!n||l||_t(d,c)&&d.type==="wheel"||_t(d,a)&&(d.type!=="wheel"||o&&d.type==="wheel"&&!e)||!n&&d.ctrlKey&&d.type==="wheel")return!1;if(!n&&d.type==="touchstart"&&((h=d.touches)==null?void 0:h.length)>1)return d.preventDefault(),!1;if(!x&&!o&&!p&&d.type==="wheel"||!s&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(s)&&!s.includes(d.button)&&d.type==="mousedown")return!1;const m=Array.isArray(s)&&s.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||d.type==="wheel")&&m}}function Kj({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:o,viewport:r,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:a,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},x=e.getBoundingClientRect(),p=zc().clickDistance(!Oe(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(o),m=Ae(e).call(p);S({x:r.x,y:r.y,zoom:It(r.zoom,t,n)},[[0,0],[x.width,x.height]],o);const h=m.on("wheel.zoom"),E=m.on("dblclick.zoom");p.wheelDelta(pa);function w($,B){return m?new Promise(C=>{p==null||p.transform(Ks(m,B==null?void 0:B.duration,()=>C(!0)),$)}):Promise.resolve(!1)}function R({noWheelClassName:$,noPanClassName:B,onPaneContextMenu:C,userSelectionActive:I,panOnScroll:_,panOnDrag:O,panOnScrollMode:P,panOnScrollSpeed:z,preventScrolling:V,zoomOnPinch:Z,zoomOnScroll:Y,zoomOnDoubleClick:ee,zoomActivationKeyPressed:K,lib:U,onTransformChange:Q}){I&&!d.isZoomingOrPanning&&k();const W=_&&!K&&!I?Hj({zoomPanValues:d,noWheelClassName:$,d3Selection:m,d3Zoom:p,panOnScrollMode:P,panOnScrollSpeed:z,zoomOnPinch:Z,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):Zj({noWheelClassName:$,preventScrolling:V,d3ZoomHandler:h});if(m.on("wheel.zoom",W,{passive:!1}),!I){const de=Gj({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:c});p.on("start",de);const ae=Yj({zoomPanValues:d,panOnDrag:O,onPaneContextMenu:!!C,onPanZoom:l,onTransformChange:Q});p.on("zoom",ae);const te=Wj({zoomPanValues:d,panOnDrag:O,panOnScroll:_,onPaneContextMenu:C,onPanZoomEnd:a,onDraggingChange:u});p.on("end",te)}const ie=Xj({zoomActivationKeyPressed:K,panOnDrag:O,zoomOnScroll:Y,panOnScroll:_,zoomOnDoubleClick:ee,zoomOnPinch:Z,userSelectionActive:I,noPanClassName:B,noWheelClassName:$,lib:U});p.filter(ie),ee?m.on("dblclick.zoom",E):m.on("dblclick.zoom",null)}function k(){p.on("zoom",null)}async function S($,B,C){const I=Xs($),_=p==null?void 0:p.constrain()(I,B,C);return _&&await w(_),new Promise(O=>O(_))}async function j($,B){const C=Xs($);return await w(C,B),new Promise(I=>I(C))}function b($){if(m){const B=Xs($),C=m.property("__zoom");(C.k!==$.zoom||C.x!==$.x||C.y!==$.y)&&(p==null||p.transform(m,B,null,{sync:!0}))}}function M(){const $=m?Oc(m.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function v($,B){return m?new Promise(C=>{p==null||p.scaleTo(Ks(m,B==null?void 0:B.duration,()=>C(!0)),$)}):Promise.resolve(!1)}function N($,B){return m?new Promise(C=>{p==null||p.scaleBy(Ks(m,B==null?void 0:B.duration,()=>C(!0)),$)}):Promise.resolve(!1)}function L($){p==null||p.scaleExtent($)}function T($){p==null||p.translateExtent($)}function D($){const B=!Oe($)||$<0?0:$;p==null||p.clickDistance(B)}return{update:R,destroy:k,setViewport:j,setViewportConstrained:S,getViewport:M,scaleTo:v,scaleBy:N,setScaleExtent:L,setTranslateExtent:T,syncViewport:b,setClickDistance:D}}var tn;(function(e){e.Line="line",e.Handle="handle"})(tn||(tn={}));function qj({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:o,affectsY:r}){const l=e-t,c=n-s,a=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&o&&(a[0]=a[0]*-1),c&&r&&(a[1]=a[1]*-1),a}function Uj(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:o}}function st(e,t){return Math.max(0,t-e)}function ot(e,t){return Math.max(0,e-t)}function Mn(e,t,n){return Math.max(0,t-e,e-n)}function ci(e,t){return e?!t:t}function Qj(e,t,n,s,o,r,l,c){let{affectsX:a,affectsY:u}=t;const{isHorizontal:d,isVertical:x}=t,p=d&&x,{xSnapped:m,ySnapped:h}=n,{minWidth:E,maxWidth:w,minHeight:R,maxHeight:k}=s,{x:S,y:j,width:b,height:M,aspectRatio:v}=e;let N=Math.floor(d?m-e.pointerX:0),L=Math.floor(x?h-e.pointerY:0);const T=b+(a?-N:N),D=M+(u?-L:L),$=-r[0]*b,B=-r[1]*M;let C=Mn(T,E,w),I=Mn(D,R,k);if(l){let P=0,z=0;a&&N<0?P=st(S+N+$,l[0][0]):!a&&N>0&&(P=ot(S+T+$,l[1][0])),u&&L<0?z=st(j+L+B,l[0][1]):!u&&L>0&&(z=ot(j+D+B,l[1][1])),C=Math.max(C,P),I=Math.max(I,z)}if(c){let P=0,z=0;a&&N>0?P=ot(S+N,c[0][0]):!a&&N<0&&(P=st(S+T,c[1][0])),u&&L>0?z=ot(j+L,c[0][1]):!u&&L<0&&(z=st(j+D,c[1][1])),C=Math.max(C,P),I=Math.max(I,z)}if(o){if(d){const P=Mn(T/v,R,k)*v;if(C=Math.max(C,P),l){let z=0;!a&&!u||a&&!u&&p?z=ot(j+B+T/v,l[1][1])*v:z=st(j+B+(a?N:-N)/v,l[0][1])*v,C=Math.max(C,z)}if(c){let z=0;!a&&!u||a&&!u&&p?z=st(j+T/v,c[1][1])*v:z=ot(j+(a?N:-N)/v,c[0][1])*v,C=Math.max(C,z)}}if(x){const P=Mn(D*v,E,w)/v;if(I=Math.max(I,P),l){let z=0;!a&&!u||u&&!a&&p?z=ot(S+D*v+$,l[1][0])/v:z=st(S+(u?L:-L)*v+$,l[0][0])/v,I=Math.max(I,z)}if(c){let z=0;!a&&!u||u&&!a&&p?z=st(S+D*v,c[1][0])/v:z=ot(S+(u?L:-L)*v,c[0][0])/v,I=Math.max(I,z)}}}L=L+(L<0?I:-I),N=N+(N<0?C:-C),o&&(p?T>D*v?L=(ci(a,u)?-N:N)/v:N=(ci(a,u)?-L:L)*v:d?(L=N/v,u=a):(N=L*v,a=u));const _=a?S+N:S,O=u?j+L:j;return{width:b+(a?-N:N),height:M+(u?-L:L),x:r[0]*N*(a?-1:1)+_,y:r[1]*L*(u?-1:1)+O}}const ma={width:0,height:0,x:0,y:0},Jj={...ma,pointerX:0,pointerY:0,aspectRatio:1};function eS(e){return[[0,0],[e.measured.width,e.measured.height]]}function tS(e,t,n){const s=t.position.x+e.position.x,o=t.position.y+e.position.y,r=e.measured.width??0,l=e.measured.height??0,c=n[0]*r,a=n[1]*l;return[[s-c,o-a],[s+r-c,o+l-a]]}function nS({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:o}){const r=Ae(e);function l({controlPosition:a,boundaries:u,keepAspectRatio:d,onResizeStart:x,onResize:p,onResizeEnd:m,shouldResize:h}){let E={...ma},w={...Jj};const R=Uj(a);let k,S=null,j=[],b,M,v;const N=Pc().on("start",L=>{const{nodeLookup:T,transform:D,snapGrid:$,snapToGrid:B,nodeOrigin:C,paneDomNode:I}=n();if(k=T.get(t),!k)return;S=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:_,ySnapped:O}=en(L.sourceEvent,{transform:D,snapGrid:$,snapToGrid:B,containerBounds:S});E={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},w={...E,pointerX:_,pointerY:O,aspectRatio:E.width/E.height},b=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(b=T.get(k.parentId),M=b&&k.extent==="parent"?eS(b):void 0),j=[],v=void 0;for(const[P,z]of T)if(z.parentId===t&&(j.push({id:P,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const V=tS(z,k,z.origin??C);v?v=[[Math.min(V[0][0],v[0][0]),Math.min(V[0][1],v[0][1])],[Math.max(V[1][0],v[1][0]),Math.max(V[1][1],v[1][1])]]:v=V}x==null||x(L,{...E})}).on("drag",L=>{const{transform:T,snapGrid:D,snapToGrid:$,nodeOrigin:B}=n(),C=en(L.sourceEvent,{transform:T,snapGrid:D,snapToGrid:$,containerBounds:S}),I=[];if(!k)return;const{x:_,y:O,width:P,height:z}=E,V={},Z=k.origin??B,{width:Y,height:ee,x:K,y:U}=Qj(w,R,C,u,d,Z,M,v),Q=Y!==P,ne=ee!==z,W=K!==_&&Q,ie=U!==O&≠if(!W&&!ie&&!Q&&!ne)return;if((W||ie||Z[0]===1||Z[1]===1)&&(V.x=W?K:E.x,V.y=ie?U:E.y,E.x=V.x,E.y=V.y,j.length>0)){const X=K-_,se=U-O;for(const fe of j)fe.position={x:fe.position.x-X+Z[0]*(Y-P),y:fe.position.y-se+Z[1]*(ee-z)},I.push(fe)}if((Q||ne)&&(V.width=Q?Y:E.width,V.height=ne?ee:E.height,E.width=V.width,E.height=V.height),b&&k.expandParent){const X=Z[0]*(V.width??0);V.x&&V.x<X&&(E.x=X,w.x=w.x-(V.x-X));const se=Z[1]*(V.height??0);V.y&&V.y<se&&(E.y=se,w.y=w.y-(V.y-se))}const de=qj({width:E.width,prevWidth:P,height:E.height,prevHeight:z,affectsX:R.affectsX,affectsY:R.affectsY}),ae={...E,direction:de};(h==null?void 0:h(L,ae))!==!1&&(p==null||p(L,ae),s(V,I))}).on("end",L=>{m==null||m(L,{...E}),o==null||o()});r.call(N)}function c(){r.on(".drag",null)}return{update:l,destroy:c}}var bo={exports:{}},qs={},Pn={exports:{}},Us={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var ai;function sS(){if(ai)return Us;ai=1;var e=g;function t(x,p){return x===p&&(x!==0||1/x===1/p)||x!==x&&p!==p}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,r=e.useLayoutEffect,l=e.useDebugValue;function c(x,p){var m=p(),h=s({inst:{value:m,getSnapshot:p}}),E=h[0].inst,w=h[1];return r(function(){E.value=m,E.getSnapshot=p,a(E)&&w({inst:E})},[x,m,p]),o(function(){return a(E)&&w({inst:E}),x(function(){a(E)&&w({inst:E})})},[x]),l(m),m}function a(x){var p=x.getSnapshot;x=x.value;try{var m=p();return!n(x,m)}catch{return!0}}function u(x,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:c;return Us.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Us}var Qs={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* use-sync-external-store-shim.development.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var ui;function oS(){return ui||(ui=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=g,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var j=arguments.length,b=new Array(j>1?j-1:0),M=1;M<j;M++)b[M-1]=arguments[M];s("error",S,b)}}function s(S,j,b){{var M=t.ReactDebugCurrentFrame,v=M.getStackAddendum();v!==""&&(j+="%s",b=b.concat([v]));var N=b.map(function(L){return String(L)});N.unshift("Warning: "+j),Function.prototype.apply.call(console[S],console,N)}}function o(S,j){return S===j&&(S!==0||1/S===1/j)||S!==S&&j!==j}var r=typeof Object.is=="function"?Object.is:o,l=e.useState,c=e.useEffect,a=e.useLayoutEffect,u=e.useDebugValue,d=!1,x=!1;function p(S,j,b){d||e.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var M=j();if(!x){var v=j();r(M,v)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),x=!0)}var N=l({inst:{value:M,getSnapshot:j}}),L=N[0].inst,T=N[1];return a(function(){L.value=M,L.getSnapshot=j,m(L)&&T({inst:L})},[S,M,j]),c(function(){m(L)&&T({inst:L});var D=function(){m(L)&&T({inst:L})};return S(D)},[S]),u(M),M}function m(S){var j=S.getSnapshot,b=S.value;try{var M=j();return!r(b,M)}catch{return!0}}function h(S,j,b){return j()}var E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",w=!E,R=w?h:p,k=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:R;Qs.useSyncExternalStore=k,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Qs}var di;function ha(){return di||(di=1,process.env.NODE_ENV==="production"?Pn.exports=sS():Pn.exports=oS()),Pn.exports}/**
|
|
18
18
|
* @license React
|
|
19
19
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var
|
|
25
|
+
*/var xi;function rS(){if(xi)return qs;xi=1;var e=g,t=ha();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,r=e.useRef,l=e.useEffect,c=e.useMemo,a=e.useDebugValue;return qs.useSyncExternalStoreWithSelector=function(u,d,x,p,m){var h=r(null);if(h.current===null){var E={hasValue:!1,value:null};h.current=E}else E=h.current;h=c(function(){function R(M){if(!k){if(k=!0,S=M,M=p(M),m!==void 0&&E.hasValue){var v=E.value;if(m(v,M))return j=v}return j=M}if(v=j,s(S,M))return v;var N=p(M);return m!==void 0&&m(v,N)?v:(S=M,j=N)}var k=!1,S,j,b=x===void 0?null:x;return[function(){return R(d())},b===null?void 0:function(){return R(b())}]},[d,x,p,m]);var w=o(u,h[0],h[1]);return l(function(){E.hasValue=!0,E.value=w},[w]),a(w),w},qs}var Js={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* use-sync-external-store-shim/with-selector.development.js
|
|
28
28
|
*
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var fi;function iS(){return fi||(fi=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=g,t=ha();function n(d,x){return d===x&&(d!==0||1/d===1/x)||d!==d&&x!==x}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,r=e.useRef,l=e.useEffect,c=e.useMemo,a=e.useDebugValue;function u(d,x,p,m,h){var E=r(null),w;E.current===null?(w={hasValue:!1,value:null},E.current=w):w=E.current;var R=c(function(){var b=!1,M,v,N=function($){if(!b){b=!0,M=$;var B=m($);if(h!==void 0&&w.hasValue){var C=w.value;if(h(C,B))return v=C,C}return v=B,B}var I=M,_=v;if(s(I,$))return _;var O=m($);return h!==void 0&&h(_,O)?_:(M=$,v=O,O)},L=p===void 0?null:p,T=function(){return N(x())},D=L===null?void 0:function(){return N(L())};return[T,D]},[x,p,m,h]),k=R[0],S=R[1],j=o(d,k,S);return l(function(){w.hasValue=!0,w.value=j},[j]),a(j),j}Js.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Js}process.env.NODE_ENV==="production"?bo.exports=rS():bo.exports=iS();var lS=bo.exports;const cS=y.getDefaultExportFromCjs(lS),aS={BASE_URL:"/pluto/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},pi=e=>{let t;const n=new Set,s=(d,x)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const m=t;t=x??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(h=>h(t,m))}},o=()=>t,a={setState:s,getState:o,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(aS?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(s,o,a);return a},uS=e=>e?pi(e):pi,{useDebugValue:dS}=g,{useSyncExternalStoreWithSelector:xS}=cS,fS=e=>e;function ga(e,t=fS,n){const s=xS(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return dS(s),s}const mi=(e,t)=>{const n=uS(e),s=(o,r=t)=>ga(n,o,r);return Object.assign(s,n),s},pS=(e,t)=>e?mi(e,t):mi;function Re(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e)if(!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const ks=g.createContext(null),mS=ks.Provider,ya=Te.error001();function pe(e,t){const n=g.useContext(ks);if(n===null)throw new Error(ya);return ga(n,e,t)}function ye(){const e=g.useContext(ks);if(e===null)throw new Error(ya);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const hi={display:"none"},hS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ea="react-flow__node-desc",ja="react-flow__edge-desc",gS="react-flow__aria-live",yS=e=>e.ariaLiveMessage;function ES({rfId:e}){const t=pe(yS);return i.jsxRuntimeExports.jsx("div",{id:`${gS}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:hS,children:t})}function jS({rfId:e,disableKeyboardA11y:t}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs("div",{id:`${Ea}-${e}`,style:hi,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),i.jsxRuntimeExports.jsx("div",{id:`${ja}-${e}`,style:hi,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&i.jsxRuntimeExports.jsx(ES,{rfId:e})]})}const SS=e=>e.userSelectionActive?"none":"all";function ur({position:e="top-left",children:t,className:n,style:s,...o}){const r=pe(SS),l=`${e}`.split("-");return i.jsxRuntimeExports.jsx("div",{className:we(["react-flow__panel",n,...l]),style:{...s,pointerEvents:r},...o,children:t})}function RS({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:i.jsxRuntimeExports.jsx(ur,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:i.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const CS=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},Nn=e=>e.id;function wS(e,t){return Re(e.selectedNodes.map(Nn),t.selectedNodes.map(Nn))&&Re(e.selectedEdges.map(Nn),t.selectedEdges.map(Nn))}function bS({onSelectionChange:e}){const t=ye(),{selectedNodes:n,selectedEdges:s}=pe(CS,wS);return g.useEffect(()=>{const o={nodes:n,edges:s};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(r=>r(o))},[n,s,e]),null}const vS=e=>!!e.onSelectionChangeHandlers;function _S({onSelectionChange:e}){const t=pe(vS);return e||t?i.jsxRuntimeExports.jsx(bS,{onSelectionChange:e}):null}const Sa=[0,0],kS={x:0,y:0,zoom:1},MS=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],gi=[...MS,"rfId"],PS=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),yi={translateExtent:an,nodeOrigin:Sa,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function NS(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:o,setTranslateExtent:r,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:a,setPaneClickDistance:u}=pe(PS,Re),d=ye();g.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{x.current=yi,c()}),[]);const x=g.useRef(yi);return g.useEffect(()=>{for(const p of gi){const m=e[p],h=x.current[p];m!==h&&(typeof e[p]>"u"||(p==="nodes"?t(m):p==="edges"?n(m):p==="minZoom"?s(m):p==="maxZoom"?o(m):p==="translateExtent"?r(m):p==="nodeExtent"?l(m):p==="paneClickDistance"?u(m):p==="fitView"?d.setState({fitViewOnInit:m}):p==="fitViewOptions"?d.setState({fitViewOnInitOptions:m}):d.setState({[p]:m})))}x.current=e},gi.map(p=>e[p])),null}function Ei(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function LS(e){var s;const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const o=Ei(),r=()=>n(o!=null&&o.matches?"dark":"light");return r(),o==null||o.addEventListener("change",r),()=>{o==null||o.removeEventListener("change",r)}},[e]),t!==null?t:(s=Ei())!=null&&s.matches?"dark":"light"}const ji=typeof document<"u"?document:null;function xn(e=null,t={target:ji,actInsideInputWithModifier:!0}){const[n,s]=g.useState(!1),o=g.useRef(!1),r=g.useRef(new Set([])),[l,c]=g.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
|
|
34
34
|
`).replace(`
|
|
35
35
|
|
|
36
36
|
`,`
|
|
37
37
|
+`).split(`
|
|
38
|
-
`)),d=u.reduce((x,p)=>x.concat(...p),[]);return[u,d]}return[[],[]]},[e]);return g.useEffect(()=>{const a=(t==null?void 0:t.target)||fi;if(e!==null){const u=p=>{if(o.current=p.ctrlKey||p.metaKey||p.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&ho(p))return!1;const h=mi(p.code,c);r.current.add(p[h]),pi(l,r.current,!1)&&(p.preventDefault(),s(!0))},d=p=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&ho(p))return!1;const h=mi(p.code,c);pi(l,r.current,!0)?(s(!1),r.current.clear()):r.current.delete(p[h]),p.key==="Meta"&&r.current.clear(),o.current=!1},x=()=>{r.current.clear(),s(!1)};return a==null||a.addEventListener("keydown",u),a==null||a.addEventListener("keyup",d),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{a==null||a.removeEventListener("keydown",u),a==null||a.removeEventListener("keyup",d),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,s]),n}function pi(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function mi(e,t){return t.includes(e)?"code":"key"}const T0=()=>{const e=ge();return g.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,o,r],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??o,zoom:t.zoom??r},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},fitView:t=>{const{nodeLookup:n,minZoom:s,maxZoom:o,panZoom:r,domNode:l}=e.getState();if(!r||!l)return Promise.resolve(!1);const c=fo(n,t),{width:a,height:u}=Ss(l);return po({nodes:c,width:a,height:u,minZoom:s,maxZoom:o,panZoom:r},t)},setCenter:async(t,n,s)=>{const{width:o,height:r,maxZoom:l,panZoom:c}=e.getState(),a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:l,u=o/2-t*a,d=r/2-n*a;return c?(await c.setViewport({x:u,y:d,zoom:a},{duration:s==null?void 0:s.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:s,height:o,minZoom:r,maxZoom:l,panZoom:c}=e.getState(),a=er(t,s,o,r,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(a,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:s,snapGrid:o,domNode:r}=e.getState();if(!r)return t;const{x:l,y:c}=r.getBoundingClientRect(),a={x:t.x-l,y:t.y-c};return hn(a,s,n.snapToGrid,o)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:o,y:r}=s.getBoundingClientRect(),l=Ic(t,n);return{x:l.x+o,y:l.y+r}}}),[])};function aa(e,t){const n=[],s=new Map,o=[];for(const r of e)if(r.type==="add"){o.push(r);continue}else if(r.type==="remove"||r.type==="replace")s.set(r.id,[r]);else{const l=s.get(r.id);l?l.push(r):s.set(r.id,[r])}for(const r of t){const l=s.get(r.id);if(!l){n.push(r);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...r};for(const a of l)A0(a,c);n.push(c)}return o.length&&o.forEach(r=>{r.index!==void 0?n.splice(r.index,0,{...r.item}):n.push({...r.item})}),n}function A0(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function ua(e,t){return aa(e,t)}function da(e,t){return aa(e,t)}function ft(e,t){return{id:e,type:"select",selected:t}}function bt(e,t=new Set,n=!1){const s=[];for(const[o,r]of e){const l=t.has(o);!(r.selected===void 0&&!l)&&r.selected!==l&&(n&&(r.selected=l),s.push(ft(r.id,l)))}return s}function hi({items:e=[],lookup:t}){var o;const n=[],s=new Map(e.map(r=>[r.id,r]));for(const[r,l]of e.entries()){const c=t.get(l.id),a=((o=c==null?void 0:c.internals)==null?void 0:o.userNode)??c;a!==void 0&&a!==l&&n.push({id:l.id,item:l,type:"replace"}),a===void 0&&n.push({item:l,type:"add",index:r})}for(const[r]of t)s.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function gi(e){return{id:e.id,type:"remove"}}const ji=e=>py(e),$0=e=>Mc(e);function xa(e){return g.forwardRef(e)}const I0=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Ei(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>O0(()=>n(o=>o+BigInt(1))));return I0(()=>{const o=s.get();o.length&&(e(o),s.reset())},[t]),s}function O0(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const fa=g.createContext(null);function B0({children:e}){const t=ge(),n=g.useCallback(c=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:d,onNodesChange:x,nodeLookup:p}=t.getState();let m=a;for(const h of c)m=typeof h=="function"?h(m):h;d?u(m):x&&x(hi({items:m,lookup:p}))},[]),s=Ei(n),o=g.useCallback(c=>{const{edges:a=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:x,edgeLookup:p}=t.getState();let m=a;for(const h of c)m=typeof h=="function"?h(m):h;d?u(m):x&&x(hi({items:m,lookup:p}))},[]),r=Ei(o),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:r}),[]);return i.jsxRuntimeExports.jsx(fa.Provider,{value:l,children:e})}function D0(){const e=g.useContext(fa);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const z0=e=>!!e.panZoom;function dt(){const e=T0(),t=ge(),n=D0(),s=pe(z0),o=g.useMemo(()=>{const r=x=>t.getState().nodeLookup.get(x),l=x=>{n.nodeQueue.push(x)},c=x=>{n.edgeQueue.push(x)},a=x=>{var w,_;const{nodeLookup:p,nodeOrigin:m}=t.getState(),h=ji(x)?x:p.get(x.id),E=h.parentId?Bc(h.position,h.measured,h.parentId,p,m):h.position,v={id:h.id,position:E,width:((w=h.measured)==null?void 0:w.width)??h.width,height:((_=h.measured)==null?void 0:_.height)??h.height,data:h.data};return Tt(v)},u=(x,p,m={replace:!1})=>{l(h=>h.map(E=>{if(E.id===x){const v=typeof p=="function"?p(E):p;return m.replace&&ji(v)?v:{...E,...v}}return E}))},d=(x,p,m={replace:!1})=>{c(h=>h.map(E=>{if(E.id===x){const v=typeof p=="function"?p(E):p;return m.replace&&$0(v)?v:{...E,...v}}return E}))};return{getNodes:()=>t.getState().nodes.map(x=>({...x})),getNode:x=>{var p;return(p=r(x))==null?void 0:p.internals.userNode},getInternalNode:r,getEdges:()=>{const{edges:x=[]}=t.getState();return x.map(p=>({...p}))},getEdge:x=>t.getState().edgeLookup.get(x),setNodes:l,setEdges:c,addNodes:x=>{const p=Array.isArray(x)?x:[x];n.nodeQueue.push(m=>[...m,...p])},addEdges:x=>{const p=Array.isArray(x)?x:[x];n.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:x=[],edges:p=[],transform:m}=t.getState(),[h,E,v]=m;return{nodes:x.map(w=>({...w})),edges:p.map(w=>({...w})),viewport:{x:h,y:E,zoom:v}}},deleteElements:async({nodes:x=[],edges:p=[]})=>{const{nodes:m,edges:h,onNodesDelete:E,onEdgesDelete:v,triggerNodeChanges:w,triggerEdgeChanges:_,onDelete:S,onBeforeDelete:y}=t.getState(),{nodes:C,edges:P}=await gy({nodesToRemove:x,edgesToRemove:p,nodes:m,edges:h,onBeforeDelete:y}),b=P.length>0,T=C.length>0;if(b){const N=P.map(gi);v==null||v(P),_(N)}if(T){const N=C.map(gi);E==null||E(C),w(N)}return(T||b)&&(S==null||S({nodes:C,edges:P})),{deletedNodes:C,deletedEdges:P}},getIntersectingNodes:(x,p=!0,m)=>{const h=qr(x),E=h?x:a(x),v=m!==void 0;return E?(m||t.getState().nodes).filter(w=>{const _=t.getState().nodeLookup.get(w.id);if(_&&!h&&(w.id===x.id||!_.internals.positionAbsolute))return!1;const S=Tt(v?w:_),y=ln(S,E);return p&&y>0||y>=E.width*E.height}):[]},isNodeIntersecting:(x,p,m=!0)=>{const E=qr(x)?x:a(x);if(!E)return!1;const v=ln(E,p);return m&&v>0||v>=E.width*E.height},updateNode:u,updateNodeData:(x,p,m={replace:!1})=>{u(x,h=>{const E=typeof p=="function"?p(h):p;return m.replace?{...h,data:E}:{...h,data:{...h.data,...E}}},m)},updateEdge:d,updateEdgeData:(x,p,m={replace:!1})=>{d(x,h=>{const E=typeof p=="function"?p(h):p;return m.replace?{...h,data:E}:{...h,data:{...h.data,...E}}},m)},getNodesBounds:x=>{const{nodeLookup:p,nodeOrigin:m}=t.getState();return my(x,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:x,id:p,nodeId:m})=>{var h;return Array.from(((h=t.getState().connectionLookup.get(`${m}-${x}-${p??null}`))==null?void 0:h.values())??[])}}},[]);return g.useMemo(()=>({...o,...e,viewportInitialized:s}),[s])}const yi=e=>e.selected,V0={actInsideInputWithModifier:!1},F0=typeof window<"u"?window:void 0;function H0({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ge(),{deleteElements:s}=dt(),o=an(e,V0),r=an(t,{target:F0});g.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(yi),edges:l.filter(yi)}),n.setState({nodesSelectionActive:!1})}},[o]),g.useEffect(()=>{n.setState({multiSelectionActive:r})},[r])}function Z0(e){const t=ge();g.useEffect(()=>{const n=()=>{var o,r;if(!e.current)return!1;const s=Ss(e.current);(s.height===0||s.width===0)&&((r=(o=t.getState()).onError)==null||r.call(o,"004",Le.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Cs={position:"absolute",width:"100%",height:"100%",top:0,left:0},Y0=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function q0({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.5,panOnScrollMode:r=ht.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:u,minZoom:d,maxZoom:x,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:E,noPanClassName:v,onViewportChange:w,isControlledViewport:_,paneClickDistance:S}){const y=ge(),C=g.useRef(null),{userSelectionActive:P,lib:b}=pe(Y0,Se),T=an(p),N=g.useRef();Z0(C);const A=g.useCallback(O=>{w==null||w({x:O[0],y:O[1],zoom:O[2]}),_||y.setState({transform:O})},[w,_]);return g.useEffect(()=>{if(C.current){N.current=Ky({domNode:C.current,minZoom:d,maxZoom:x,translateExtent:u,viewport:a,paneClickDistance:S,onDraggingChange:R=>y.setState({paneDragging:R}),onPanZoomStart:(R,I)=>{const{onViewportChangeStart:k,onMoveStart:B}=y.getState();B==null||B(R,I),k==null||k(I)},onPanZoom:(R,I)=>{const{onViewportChange:k,onMove:B}=y.getState();B==null||B(R,I),k==null||k(I)},onPanZoomEnd:(R,I)=>{const{onViewportChangeEnd:k,onMoveEnd:B}=y.getState();B==null||B(R,I),k==null||k(I)}});const{x:O,y:L,zoom:D}=N.current.getViewport();return y.setState({panZoom:N.current,transform:[O,L,D],domNode:C.current.closest(".react-flow")}),()=>{var R;(R=N.current)==null||R.destroy()}}},[]),g.useEffect(()=>{var O;(O=N.current)==null||O.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:o,panOnScrollMode:r,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:v,userSelectionActive:P,noWheelClassName:E,lib:b,onTransformChange:A})},[e,t,n,s,o,r,l,c,T,m,v,P,E,b,A]),i.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:C,style:Cs,children:h})}const W0=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function X0(){const{userSelectionActive:e,userSelectionRect:t}=pe(W0,Se);return e&&t?i.jsxRuntimeExports.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Gs=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},K0=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function G0({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Nt.Full,panOnDrag:s,selectionOnDrag:o,onSelectionStart:r,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:a,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:x,onPaneMouseLeave:p,children:m}){const h=g.useRef(null),E=ge(),v=g.useRef(0),w=g.useRef(0),_=g.useRef(),S=g.useRef(new Map),{userSelectionActive:y,elementsSelectable:C,dragging:P}=pe(K0,Se),b=C&&(e||y),T=g.useRef(!1),N=g.useRef(!1),A=()=>{E.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,w.current=0},O=M=>{if(T.current){T.current=!1;return}c==null||c(M),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},L=M=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){M.preventDefault();return}a==null||a(M)},D=u?M=>u(M):void 0,R=M=>{var K,G,Q,ne;const{resetSelectedElements:z,domNode:V,edgeLookup:Y}=E.getState();if(_.current=V==null?void 0:V.getBoundingClientRect(),!C||!e||M.button!==0||M.target!==h.current||!_.current)return;(G=(K=M.target)==null?void 0:K.setPointerCapture)==null||G.call(K,M.pointerId),N.current=!0,T.current=!1,S.current=new Map;for(const[X,oe]of Y)S.current.set(oe.source,((Q=S.current.get(oe.source))==null?void 0:Q.add(X))||new Set([X])),S.current.set(oe.target,((ne=S.current.get(oe.target))==null?void 0:ne.add(X))||new Set([X]));const{x:W,y:J}=Xe(M.nativeEvent,_.current);z(),E.setState({userSelectionRect:{width:0,height:0,startX:W,startY:J,x:W,y:J}}),r==null||r(M)},I=M=>{const{userSelectionRect:z,edgeLookup:V,transform:Y,nodeLookup:W,triggerNodeChanges:J,triggerEdgeChanges:K}=E.getState();if(!_.current||!z)return;T.current=!0;const{x:G,y:Q}=Xe(M.nativeEvent,_.current),{startX:ne,startY:X}=z,oe={startX:ne,startY:X,x:G<ne?G:ne,y:Q<X?Q:X,width:Math.abs(G-ne),height:Math.abs(Q-X)},xe=Nc(W,oe,Y,n===Nt.Partial,!0),ae=new Set,H=new Set;for(const ee of xe){H.add(ee.id);const ce=S.current.get(ee.id);if(ce)for(const je of ce)ae.add(je)}if(v.current!==H.size){v.current=H.size;const ee=bt(W,H,!0);J(ee)}if(w.current!==ae.size){w.current=ae.size;const ee=bt(V,ae);K(ee)}E.setState({userSelectionRect:oe,userSelectionActive:!0,nodesSelectionActive:!1})},k=M=>{var V,Y;if(M.button!==0||!N.current)return;(Y=(V=M.target)==null?void 0:V.releasePointerCapture)==null||Y.call(V,M.pointerId);const{userSelectionRect:z}=E.getState();!y&&z&&M.target===h.current&&(O==null||O(M)),v.current>0&&E.setState({nodesSelectionActive:!0}),A(),l==null||l(M),(t||o)&&(T.current=!1),N.current=!1},B=s===!0||Array.isArray(s)&&s.includes(0);return i.jsxRuntimeExports.jsxs("div",{className:we(["react-flow__pane",{draggable:B,dragging:P,selection:e}]),onClick:b?void 0:Gs(O,h),onContextMenu:Gs(L,h),onWheel:Gs(D,h),onPointerEnter:b?void 0:d,onPointerDown:b?R:x,onPointerMove:b?I:x,onPointerUp:b?k:void 0,onPointerLeave:p,ref:h,style:Cs,children:[m,i.jsxRuntimeExports.jsx(X0,{})]})}function Ro({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:r,multiSelectionActive:l,nodeLookup:c,onError:a}=t.getState(),u=c.get(e);if(!u){a==null||a("012",Le.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&l)&&(r({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=s==null?void 0:s.current)==null?void 0:d.blur()})):o([e])}function pa({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:o,isSelectable:r,nodeClickDistance:l}){const c=ge(),[a,u]=g.useState(!1),d=g.useRef();return g.useEffect(()=>{d.current=$y({getStoreItems:()=>c.getState(),onNodeMouseDown:x=>{Ro({id:x,store:c,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),g.useEffect(()=>{var x,p;if(t)(x=d.current)==null||x.destroy();else if(e.current)return(p=d.current)==null||p.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:r,nodeId:o,nodeClickDistance:l}),()=>{var m;(m=d.current)==null||m.destroy()}},[n,s,t,r,e,o]),a}const U0=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ma(){const e=ge();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:o,snapGrid:r,nodesDraggable:l,onError:c,updateNodePositions:a,nodeLookup:u,nodeOrigin:d}=e.getState(),x=new Map,p=U0(l),m=o?r[0]:5,h=o?r[1]:5,E=n.direction.x*m*n.factor,v=n.direction.y*h*n.factor;for(const[,w]of u){if(!p(w))continue;let _={x:w.internals.positionAbsolute.x+E,y:w.internals.positionAbsolute.y+v};o&&(_=ys(_,r));const{position:S,positionAbsolute:y}=Lc({nodeId:w.id,nextPosition:_,nodeLookup:u,nodeExtent:s,nodeOrigin:d,onError:c});w.position=S,w.internals.positionAbsolute=y,x.set(w.id,w)}a(x)},[])}const ir=g.createContext(null),Q0=ir.Provider;ir.Consumer;const ha=()=>g.useContext(ir),J0=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),eS=(e,t,n)=>s=>{const{connectionClickStartHandle:o,connectionMode:r,connection:l}=s,{fromHandle:c,toHandle:a,isValid:u}=l,d=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:d,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:r===yt.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,valid:d&&u}};function tS({type:e="source",position:t=q.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:r=!0,id:l,onConnect:c,children:a,className:u,onMouseDown:d,onTouchStart:x,...p},m){var R,I;const h=l||null,E=e==="target",v=ge(),w=ha(),{connectOnClick:_,noPanClassName:S,rfId:y}=pe(J0,Se),{connectingFrom:C,connectingTo:P,clickConnecting:b,isPossibleEndHandle:T,connectionInProcess:N,valid:A}=pe(eS(w,h,e),Se);w||(I=(R=v.getState()).onError)==null||I.call(R,"010",Le.error010());const O=k=>{const{defaultEdgeOptions:B,onConnect:M,hasDefaultEdges:z}=v.getState(),V={...B,...k};if(z){const{edges:Y,setEdges:W}=v.getState();W(Yc(V,Y))}M==null||M(V),c==null||c(V)},L=k=>{if(!w)return;const B=zc(k.nativeEvent);if(o&&(B&&k.button===0||!B)){const M=v.getState();yo.onPointerDown(k.nativeEvent,{autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:E,handleId:h,nodeId:w,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:M.onConnectEnd,updateConnection:M.updateConnection,onConnect:O,isValidConnection:n||M.isValidConnection,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed})}B?d==null||d(k):x==null||x(k)},D=k=>{const{onClickConnectStart:B,onClickConnectEnd:M,connectionClickStartHandle:z,connectionMode:V,isValidConnection:Y,lib:W,rfId:J,nodeLookup:K,connection:G}=v.getState();if(!w||!z&&!o)return;if(!z){B==null||B(k.nativeEvent,{nodeId:w,handleId:h,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:w,type:e,id:h}});return}const Q=Dc(k.target),ne=n||Y,{connection:X,isValid:oe}=yo.isValid(k.nativeEvent,{handle:{nodeId:w,id:h,type:e},connectionMode:V,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:ne,flowId:J,doc:Q,lib:W,nodeLookup:K});oe&&X&&O(X);const xe=structuredClone(G);delete xe.inProgress,xe.toPosition=xe.toHandle?xe.toHandle.position:null,M==null||M(k,xe),v.setState({connectionClickStartHandle:null})};return i.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":w,"data-handlepos":t,"data-id":`${y}-${w}-${h}-${e}`,className:we(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,u,{source:!E,target:E,connectable:s,connectablestart:o,connectableend:r,clickconnecting:b,connectingfrom:C,connectingto:P,valid:A,connectionindicator:s&&(!N||T)&&(N?r:o)}]),onMouseDown:L,onTouchStart:L,onClick:_?D:void 0,ref:m,...p,children:a})}const un=g.memo(xa(tS));function nS({data:e,isConnectable:t,sourcePosition:n=q.Bottom}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[e==null?void 0:e.label,i.jsxRuntimeExports.jsx(un,{type:"source",position:n,isConnectable:t})]})}function sS({data:e,isConnectable:t,targetPosition:n=q.Top,sourcePosition:s=q.Bottom}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(un,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,i.jsxRuntimeExports.jsx(un,{type:"source",position:s,isConnectable:t})]})}function oS(){return null}function rS({data:e,isConnectable:t,targetPosition:n=q.Top}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(un,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ns={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Si={input:nS,default:sS,output:rS,group:oS};function iS(e){var t,n,s,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const lS=e=>{const{width:t,height:n,x:s,y:o}=mn(e.nodeLookup,{filter:r=>!!r.selected});return{width:Be(t)?t:null,height:Be(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${o}px)`}};function cS({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=ge(),{width:o,height:r,transformString:l,userSelectionActive:c}=pe(lS,Se),a=ma(),u=g.useRef(null);if(g.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]),pa({nodeRef:u}),c||!o||!r)return null;const d=e?p=>{const m=s.getState().nodes.filter(h=>h.selected);e(p,m)}:void 0,x=p=>{Object.prototype.hasOwnProperty.call(ns,p.key)&&a({direction:ns[p.key],factor:p.shiftKey?4:1})};return i.jsxRuntimeExports.jsx("div",{className:we(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:i.jsxRuntimeExports.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:o,height:r}})})}const Ri=typeof window<"u"?window:void 0,aS=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ga({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:d,selectionMode:x,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:h,panActivationKeyCode:E,zoomActivationKeyCode:v,elementsSelectable:w,zoomOnScroll:_,zoomOnPinch:S,panOnScroll:y,panOnScrollSpeed:C,panOnScrollMode:P,zoomOnDoubleClick:b,panOnDrag:T,defaultViewport:N,translateExtent:A,minZoom:O,maxZoom:L,preventScrolling:D,onSelectionContextMenu:R,noWheelClassName:I,noPanClassName:k,disableKeyboardA11y:B,onViewportChange:M,isControlledViewport:z}){const{nodesSelectionActive:V,userSelectionActive:Y}=pe(aS),W=an(u,{target:Ri}),J=an(E,{target:Ri}),K=J||T,G=J||y,Q=d&&K!==!0,ne=W||Y||Q;return H0({deleteKeyCode:a,multiSelectionKeyCode:h}),i.jsxRuntimeExports.jsx(q0,{onPaneContextMenu:r,elementsSelectable:w,zoomOnScroll:_,zoomOnPinch:S,panOnScroll:G,panOnScrollSpeed:C,panOnScrollMode:P,zoomOnDoubleClick:b,panOnDrag:!W&&K,defaultViewport:N,translateExtent:A,minZoom:O,maxZoom:L,zoomActivationKeyCode:v,preventScrolling:D,noWheelClassName:I,noPanClassName:k,onViewportChange:M,isControlledViewport:z,paneClickDistance:c,children:i.jsxRuntimeExports.jsxs(G0,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:l,panOnDrag:K,isSelecting:!!ne,selectionMode:x,selectionKeyPressed:W,selectionOnDrag:Q,children:[e,V&&i.jsxRuntimeExports.jsx(cS,{onSelectionContextMenu:R,noPanClassName:k,disableKeyboardA11y:B})]})})}ga.displayName="FlowRenderer";const uS=g.memo(ga),dS=e=>t=>e?Nc(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function xS(e){return pe(g.useCallback(dS(e),[e]),Se)}const fS=e=>e.updateNodeInternals;function pS(){const e=pe(fS),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(o=>{const r=o.target.getAttribute("data-id");s.set(r,{id:r,nodeElement:o.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function mS({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const o=ge(),r=g.useRef(null),l=g.useRef(null),c=g.useRef(e.sourcePosition),a=g.useRef(e.targetPosition),u=g.useRef(t),d=n&&!!e.internals.handleBounds;return g.useEffect(()=>{r.current&&!e.hidden&&(!d||l.current!==r.current)&&(l.current&&(s==null||s.unobserve(l.current)),s==null||s.observe(r.current),l.current=r.current)},[d,e.hidden]),g.useEffect(()=>()=>{l.current&&(s==null||s.unobserve(l.current),l.current=null)},[]),g.useEffect(()=>{if(r.current){const x=u.current!==t,p=c.current!==e.sourcePosition,m=a.current!==e.targetPosition;(x||p||m)&&(u.current=t,c.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:r.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),r}function hS({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:o,onContextMenu:r,onDoubleClick:l,nodesDraggable:c,elementsSelectable:a,nodesConnectable:u,nodesFocusable:d,resizeObserver:x,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:h,rfId:E,nodeTypes:v,nodeExtent:w,nodeClickDistance:_,onError:S}){const{node:y,internals:C,isParent:P}=pe(X=>{const oe=X.nodeLookup.get(e),xe=X.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:xe}},Se);let b=y.type||"default",T=(v==null?void 0:v[b])||Si[b];T===void 0&&(S==null||S("003",Le.error003(b)),b="default",T=Si.default);const N=!!(y.draggable||c&&typeof y.draggable>"u"),A=!!(y.selectable||a&&typeof y.selectable>"u"),O=!!(y.connectable||u&&typeof y.connectable>"u"),L=!!(y.focusable||d&&typeof y.focusable>"u"),D=ge(),R=Oc(y),I=mS({node:y,nodeType:b,hasDimensions:R,resizeObserver:x}),k=pa({nodeRef:I,disabled:y.hidden||!N,noDragClassName:p,handleSelector:y.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:_}),B=ma();if(y.hidden)return null;const M=Je(y),z=iS(y),V=A||N||t||n||s||o,Y=n?X=>n(X,{...C.userNode}):void 0,W=s?X=>s(X,{...C.userNode}):void 0,J=o?X=>o(X,{...C.userNode}):void 0,K=r?X=>r(X,{...C.userNode}):void 0,G=l?X=>l(X,{...C.userNode}):void 0,Q=X=>{const{selectNodesOnDrag:oe,nodeDragThreshold:xe}=D.getState();A&&(!oe||!N||xe>0)&&Ro({id:e,store:D,nodeRef:I}),t&&t(X,{...C.userNode})},ne=X=>{if(!(ho(X.nativeEvent)||h))if(_c.includes(X.key)&&A){const oe=X.key==="Escape";Ro({id:e,store:D,unselect:oe,nodeRef:I})}else N&&y.selected&&Object.prototype.hasOwnProperty.call(ns,X.key)&&(D.setState({ariaLiveMessage:`Moved selected node ${X.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~C.positionAbsolute.x}, y: ${~~C.positionAbsolute.y}`}),B({direction:ns[X.key],factor:X.shiftKey?4:1}))};return i.jsxRuntimeExports.jsx("div",{className:we(["react-flow__node",`react-flow__node-${b}`,{[m]:N},y.className,{selected:y.selected,selectable:A,parent:P,draggable:N,dragging:k}]),ref:I,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:R?"visible":"hidden",...y.style,...z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Y,onMouseMove:W,onMouseLeave:J,onContextMenu:K,onClick:Q,onDoubleClick:G,onKeyDown:L?ne:void 0,tabIndex:L?0:void 0,role:L?"button":void 0,"aria-describedby":h?void 0:`${ia}-${E}`,"aria-label":y.ariaLabel,children:i.jsxRuntimeExports.jsx(Q0,{value:e,children:i.jsxRuntimeExports.jsx(T,{id:e,data:y.data,type:b,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected,selectable:A,draggable:N,deletable:y.deletable??!0,isConnectable:O,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:k,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...M})})})}const gS=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ja(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,onError:r}=pe(gS,Se),l=xS(e.onlyRenderVisibleElements),c=pS();return i.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Cs,children:l.map(a=>i.jsxRuntimeExports.jsx(hS,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:r},a))})}ja.displayName="NodeRenderer";const jS=g.memo(ja);function ES(e){return pe(g.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const s=[];if(n.width&&n.height)for(const o of n.edges){const r=n.nodeLookup.get(o.source),l=n.nodeLookup.get(o.target);r&&l&&yy({sourceNode:r,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(o.id)}return s},[e]),Se)}const yS=({color:e="none",strokeWidth:t=1})=>i.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),SS=({color:e="none",strokeWidth:t=1})=>i.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),wi={[Qn.Arrow]:yS,[Qn.ArrowClosed]:SS};function RS(e){const t=ge();return g.useMemo(()=>{var o,r;return Object.prototype.hasOwnProperty.call(wi,e)?wi[e]:((r=(o=t.getState()).onError)==null||r.call(o,"009",Le.error009(e)),null)},[e])}const wS=({id:e,type:t,color:n,width:s=12.5,height:o=12.5,markerUnits:r="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const a=RS(t);return a?i.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:r,orient:c,refX:"0",refY:"0",children:i.jsxRuntimeExports.jsx(a,{color:n,strokeWidth:l})}):null},Ea=({defaultColor:e,rfId:t})=>{const n=pe(r=>r.edges),s=pe(r=>r.defaultEdgeOptions),o=g.useMemo(()=>_y(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return o.length?i.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker",children:i.jsxRuntimeExports.jsx("defs",{children:o.map(r=>i.jsxRuntimeExports.jsx(wS,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})}):null};Ea.displayName="MarkerDefinitions";var CS=g.memo(Ea);function ya({x:e,y:t,label:n,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:r={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:a,className:u,...d}){const[x,p]=g.useState({x:1,y:0,width:0,height:0}),m=we(["react-flow__edge-textwrapper",u]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const E=h.current.getBBox();p({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),typeof n>"u"||!n?null:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-x.width/2} ${t-x.height/2})`,className:m,visibility:x.width?"visible":"hidden",...d,children:[o&&i.jsxRuntimeExports.jsx("rect",{width:x.width+2*l[0],x:-l[0],y:-l[1],height:x.height+2*l[1],className:"react-flow__edge-textbg",style:r,rx:c,ry:c}),i.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:h,style:s,children:n}),a]})}ya.displayName="EdgeText";const vS=g.memo(ya);function Dt({id:e,path:t,labelX:n,labelY:s,label:o,labelStyle:r,labelShowBg:l,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:u,style:d,markerEnd:x,markerStart:p,className:m,interactionWidth:h=20}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("path",{id:e,style:d,d:t,fill:"none",className:we(["react-flow__edge-path",m]),markerEnd:x,markerStart:p}),h&&i.jsxRuntimeExports.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&Be(n)&&Be(s)?i.jsxRuntimeExports.jsx(vS,{x:n,y:s,label:o,labelStyle:r,labelShowBg:l,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:u}):null]})}function Ci({pos:e,x1:t,y1:n,x2:s,y2:o}){return e===q.Left||e===q.Right?[.5*(t+s),n]:[t,.5*(n+o)]}function Sa({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:s,targetY:o,targetPosition:r=q.Top}){const[l,c]=Ci({pos:n,x1:e,y1:t,x2:s,y2:o}),[a,u]=Ci({pos:r,x1:s,y1:o,x2:e,y2:t}),[d,x,p,m]=Vc({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:a,targetControlY:u});return[`M${e},${t} C${l},${c} ${a},${u} ${s},${o}`,d,x,p,m]}function Ra(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,sourcePosition:l=q.Bottom,targetPosition:c=q.Top,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:v,interactionWidth:w})=>{const[_,S,y]=Sa({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:r,targetPosition:c}),C=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(Dt,{id:C,path:_,labelX:S,labelY:y,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:v,interactionWidth:w})})}const bS=Ra({isInternal:!1}),wa=Ra({isInternal:!0});bS.displayName="SimpleBezierEdge";wa.displayName="SimpleBezierEdgeInternal";function Ca(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,sourcePosition:m=q.Bottom,targetPosition:h=q.Top,markerEnd:E,markerStart:v,pathOptions:w,interactionWidth:_})=>{const[S,y,C]=go({sourceX:n,sourceY:s,sourcePosition:m,targetX:o,targetY:r,targetPosition:h,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset}),P=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(Dt,{id:P,path:S,labelX:y,labelY:C,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,markerEnd:E,markerStart:v,interactionWidth:_})})}const va=Ca({isInternal:!1}),ba=Ca({isInternal:!0});va.displayName="SmoothStepEdge";ba.displayName="SmoothStepEdgeInternal";function _a(e){return g.memo(({id:t,...n})=>{var o;const s=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(va,{...n,id:s,pathOptions:g.useMemo(()=>{var r;return{borderRadius:0,offset:(r=n.pathOptions)==null?void 0:r.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const _S=_a({isInternal:!1}),ka=_a({isInternal:!0});_S.displayName="StepEdge";ka.displayName="StepEdgeInternal";function Pa(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,markerEnd:m,markerStart:h,interactionWidth:E})=>{const[v,w,_]=qc({sourceX:n,sourceY:s,targetX:o,targetY:r}),S=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(Dt,{id:S,path:v,labelX:w,labelY:_,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,markerEnd:m,markerStart:h,interactionWidth:E})})}const kS=Pa({isInternal:!1}),Ma=Pa({isInternal:!0});kS.displayName="StraightEdge";Ma.displayName="StraightEdgeInternal";function Na(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,sourcePosition:l=q.Bottom,targetPosition:c=q.Top,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:v,pathOptions:w,interactionWidth:_})=>{const[S,y,C]=Fc({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:r,targetPosition:c,curvature:w==null?void 0:w.curvature}),P=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(Dt,{id:P,path:S,labelX:y,labelY:C,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:v,interactionWidth:_})})}const PS=Na({isInternal:!1}),La=Na({isInternal:!0});PS.displayName="BezierEdge";La.displayName="BezierEdgeInternal";const vi={default:La,straight:Ma,step:ka,smoothstep:ba,simplebezier:wa},bi={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},MS=(e,t,n)=>n===q.Left?e-t:n===q.Right?e+t:e,NS=(e,t,n)=>n===q.Top?e-t:n===q.Bottom?e+t:e,_i="react-flow__edgeupdater";function ki({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:o,onMouseEnter:r,onMouseOut:l,type:c}){return i.jsxRuntimeExports.jsx("circle",{onMouseDown:o,onMouseEnter:r,onMouseOut:l,className:we([_i,`${_i}-${c}`]),cx:MS(t,s,e),cy:NS(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function LS({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:o,targetX:r,targetY:l,sourcePosition:c,targetPosition:a,onReconnect:u,onReconnectStart:d,onReconnectEnd:x,setReconnecting:p,setUpdateHover:m}){const h=ge(),E=(y,C)=>{if(y.button!==0)return;const{autoPanOnConnect:P,domNode:b,isValidConnection:T,connectionMode:N,connectionRadius:A,lib:O,onConnectStart:L,onConnectEnd:D,cancelConnection:R,nodeLookup:I,rfId:k,panBy:B,updateConnection:M}=h.getState(),z=C.type==="target";p(!0),d==null||d(y,n,C.type);const V=(W,J)=>{p(!1),x==null||x(W,n,C.type,J)},Y=W=>u==null?void 0:u(n,W);yo.onPointerDown(y.nativeEvent,{autoPanOnConnect:P,connectionMode:N,connectionRadius:A,domNode:b,handleId:C.id,nodeId:C.nodeId,nodeLookup:I,isTarget:z,edgeUpdaterType:C.type,lib:O,flowId:k,cancelConnection:R,panBy:B,isValidConnection:T,onConnect:Y,onConnectStart:L,onConnectEnd:D,onReconnectEnd:V,updateConnection:M,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle})},v=y=>E(y,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=y=>E(y,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>m(!0),S=()=>m(!1);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&i.jsxRuntimeExports.jsx(ki,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:v,onMouseEnter:_,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&i.jsxRuntimeExports.jsx(ki,{position:a,centerX:r,centerY:l,radius:t,onMouseDown:w,onMouseEnter:_,onMouseOut:S,type:"target"})]})}function TS({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:o,onDoubleClick:r,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:u,reconnectRadius:d,onReconnect:x,onReconnectStart:p,onReconnectEnd:m,rfId:h,edgeTypes:E,noPanClassName:v,onError:w,disableKeyboardA11y:_}){let S=pe(H=>H.edgeLookup.get(e));const y=pe(H=>H.defaultEdgeOptions);S=y?{...y,...S}:S;let C=S.type||"default",P=(E==null?void 0:E[C])||vi[C];P===void 0&&(w==null||w("011",Le.error011(C)),C="default",P=vi.default);const b=!!(S.focusable||t&&typeof S.focusable>"u"),T=typeof x<"u"&&(S.reconnectable||n&&typeof S.reconnectable>"u"),N=!!(S.selectable||s&&typeof S.selectable>"u"),A=g.useRef(null),[O,L]=g.useState(!1),[D,R]=g.useState(!1),I=ge(),{zIndex:k,sourceX:B,sourceY:M,targetX:z,targetY:V,sourcePosition:Y,targetPosition:W}=pe(g.useCallback(H=>{const ee=H.nodeLookup.get(S.source),ce=H.nodeLookup.get(S.target);if(!ee||!ce)return{zIndex:S.zIndex,...bi};const je=by({id:e,sourceNode:ee,targetNode:ce,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:H.connectionMode,onError:w});return{zIndex:Ey({selected:S.selected,zIndex:S.zIndex,sourceNode:ee,targetNode:ce,elevateOnSelect:H.elevateEdgesOnSelect}),...je||bi}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),Se),J=g.useMemo(()=>S.markerStart?`url('#${jo(S.markerStart,h)}')`:void 0,[S.markerStart,h]),K=g.useMemo(()=>S.markerEnd?`url('#${jo(S.markerEnd,h)}')`:void 0,[S.markerEnd,h]);if(S.hidden||B===null||M===null||z===null||V===null)return null;const G=H=>{var Ve;const{addSelectedEdges:ee,unselectNodesAndEdges:ce,multiSelectionActive:je}=I.getState();N&&(I.setState({nodesSelectionActive:!1}),S.selected&&je?(ce({nodes:[],edges:[S]}),(Ve=A.current)==null||Ve.blur()):ee([e])),o&&o(H,S)},Q=r?H=>{r(H,{...S})}:void 0,ne=l?H=>{l(H,{...S})}:void 0,X=c?H=>{c(H,{...S})}:void 0,oe=a?H=>{a(H,{...S})}:void 0,xe=u?H=>{u(H,{...S})}:void 0,ae=H=>{var ee;if(!_&&_c.includes(H.key)&&N){const{unselectNodesAndEdges:ce,addSelectedEdges:je}=I.getState();H.key==="Escape"?((ee=A.current)==null||ee.blur(),ce({edges:[S]})):je([e])}};return i.jsxRuntimeExports.jsx("svg",{style:{zIndex:k},children:i.jsxRuntimeExports.jsxs("g",{className:we(["react-flow__edge",`react-flow__edge-${C}`,S.className,v,{selected:S.selected,animated:S.animated,inactive:!N&&!o,updating:O,selectable:N}]),onClick:G,onDoubleClick:Q,onContextMenu:ne,onMouseEnter:X,onMouseMove:oe,onMouseLeave:xe,onKeyDown:b?ae:void 0,tabIndex:b?0:void 0,role:b?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":b?`${la}-${h}`:void 0,ref:A,children:[!D&&i.jsxRuntimeExports.jsx(P,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:N,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:B,sourceY:M,targetX:z,targetY:V,sourcePosition:Y,targetPosition:W,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:J,markerEnd:K,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),T&&i.jsxRuntimeExports.jsx(LS,{edge:S,isReconnectable:T,reconnectRadius:d,onReconnect:x,onReconnectStart:p,onReconnectEnd:m,sourceX:B,sourceY:M,targetX:z,targetY:V,sourcePosition:Y,targetPosition:W,setUpdateHover:L,setReconnecting:R})]})})}const AS=e=>({width:e.width,height:e.height,edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ta({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:o,onReconnect:r,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:x,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:h,disableKeyboardA11y:E}){const{edgesFocusable:v,edgesReconnectable:w,elementsSelectable:_,onError:S}=pe(AS,Se),y=ES(t);return i.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[i.jsxRuntimeExports.jsx(CS,{defaultColor:e,rfId:n}),y.map(C=>i.jsxRuntimeExports.jsx(TS,{id:C,edgesFocusable:v,edgesReconnectable:w,elementsSelectable:_,noPanClassName:o,onReconnect:r,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:u,onClick:d,reconnectRadius:x,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:h,rfId:n,onError:S,edgeTypes:s,disableKeyboardA11y:E},C))]})}Ta.displayName="EdgeRenderer";const $S=g.memo(Ta),IS=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function OS({children:e}){const t=pe(IS);return i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function BS(e){const t=dt(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const DS=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function zS(e){const t=pe(DS),n=ge();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function VS(e){return e.connection.inProgress?{...e.connection,to:hn(e.connection.to,e.transform)}:{...e.connection}}function FS(e){return VS}function HS(e){const t=FS();return pe(t,Se)}const ZS=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function YS({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:o,width:r,height:l,isValid:c,inProgress:a}=pe(ZS,Se);return!(r&&o&&a)?null:i.jsxRuntimeExports.jsx("svg",{style:e,width:r,height:l,className:"react-flow__connectionline react-flow__container",children:i.jsxRuntimeExports.jsx("g",{className:we(["react-flow__connection",Pc(c)]),children:i.jsxRuntimeExports.jsx(Aa,{style:t,type:n,CustomComponent:s,isValid:c})})})}const Aa=({style:e,type:t=st.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:o,from:r,fromNode:l,fromHandle:c,fromPosition:a,to:u,toNode:d,toHandle:x,toPosition:p}=HS();if(!o)return;if(n)return i.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:r.x,fromY:r.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:p,connectionStatus:Pc(s),toNode:d,toHandle:x});let m="";const h={sourceX:r.x,sourceY:r.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:p};switch(t){case st.Bezier:[m]=Fc(h);break;case st.SimpleBezier:[m]=Sa(h);break;case st.Step:[m]=go({...h,borderRadius:0});break;case st.SmoothStep:[m]=go(h);break;default:[m]=qc(h)}return i.jsxRuntimeExports.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};Aa.displayName="ConnectionLine";const qS={};function Pi(e=qS){const t=g.useRef(e),n=ge();g.useEffect(()=>{var s,o;if(process.env.NODE_ENV==="development"){const r=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const l of r)if(t.current[l]!==e[l]){(o=(s=n.getState()).onError)==null||o.call(s,"002",Le.error002());break}t.current=e}},[e])}function WS(){const e=ge(),t=g.useRef(!1);g.useEffect(()=>{var n,s;if(process.env.NODE_ENV==="development"&&!t.current){const o=document.querySelector(".react-flow__pane");o&&window.getComputedStyle(o).zIndex!=="1"&&((s=(n=e.getState()).onError)==null||s.call(n,"013",Le.error013("react"))),t.current=!0}},[])}function $a({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:o,onNodeDoubleClick:r,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:x,onSelectionStart:p,onSelectionEnd:m,connectionLineType:h,connectionLineStyle:E,connectionLineComponent:v,connectionLineContainerStyle:w,selectionKeyCode:_,selectionOnDrag:S,selectionMode:y,multiSelectionKeyCode:C,panActivationKeyCode:P,zoomActivationKeyCode:b,deleteKeyCode:T,onlyRenderVisibleElements:N,elementsSelectable:A,defaultViewport:O,translateExtent:L,minZoom:D,maxZoom:R,preventScrolling:I,defaultMarkerColor:k,zoomOnScroll:B,zoomOnPinch:M,panOnScroll:z,panOnScrollSpeed:V,panOnScrollMode:Y,zoomOnDoubleClick:W,panOnDrag:J,onPaneClick:K,onPaneMouseEnter:G,onPaneMouseMove:Q,onPaneMouseLeave:ne,onPaneScroll:X,onPaneContextMenu:oe,paneClickDistance:xe,nodeClickDistance:ae,onEdgeContextMenu:H,onEdgeMouseEnter:ee,onEdgeMouseMove:ce,onEdgeMouseLeave:je,reconnectRadius:Ve,onReconnect:_s,onReconnectStart:ks,onReconnectEnd:Ps,noDragClassName:Vt,noWheelClassName:Ms,noPanClassName:Ft,disableKeyboardA11y:Ht,nodeExtent:Ns,rfId:Zt,viewport:Yt,onViewportChange:jn}){return Pi(e),Pi(t),WS(),BS(n),zS(Yt),i.jsxRuntimeExports.jsx(uS,{onPaneClick:K,onPaneMouseEnter:G,onPaneMouseMove:Q,onPaneMouseLeave:ne,onPaneContextMenu:oe,onPaneScroll:X,paneClickDistance:xe,deleteKeyCode:T,selectionKeyCode:_,selectionOnDrag:S,selectionMode:y,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:C,panActivationKeyCode:P,zoomActivationKeyCode:b,elementsSelectable:A,zoomOnScroll:B,zoomOnPinch:M,zoomOnDoubleClick:W,panOnScroll:z,panOnScrollSpeed:V,panOnScrollMode:Y,panOnDrag:J,defaultViewport:O,translateExtent:L,minZoom:D,maxZoom:R,onSelectionContextMenu:x,preventScrolling:I,noDragClassName:Vt,noWheelClassName:Ms,noPanClassName:Ft,disableKeyboardA11y:Ht,onViewportChange:jn,isControlledViewport:!!Yt,children:i.jsxRuntimeExports.jsxs(OS,{children:[i.jsxRuntimeExports.jsx($S,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:_s,onReconnectStart:ks,onReconnectEnd:Ps,onlyRenderVisibleElements:N,onEdgeContextMenu:H,onEdgeMouseEnter:ee,onEdgeMouseMove:ce,onEdgeMouseLeave:je,reconnectRadius:Ve,defaultMarkerColor:k,noPanClassName:Ft,disableKeyboardA11y:Ht,rfId:Zt}),i.jsxRuntimeExports.jsx(YS,{style:E,type:h,component:v,containerStyle:w}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),i.jsxRuntimeExports.jsx(jS,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:r,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ae,onlyRenderVisibleElements:N,noPanClassName:Ft,noDragClassName:Vt,disableKeyboardA11y:Ht,nodeExtent:Ns,rfId:Zt}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}$a.displayName="GraphView";const XS=g.memo($a),Mi=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a}={})=>{const u=new Map,d=new Map,x=new Map,p=new Map,m=s??t??[],h=n??e??[],E=c??[0,0],v=a??rn;Xc(x,p,m),Eo(h,u,d,{nodeOrigin:E,nodeExtent:v,elevateNodesOnSelect:!1});let w=[0,0,1];if(l&&o&&r){const _=mn(u,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:S,y,zoom:C}=er(_,o,r,.5,2,.1);w=[S,y,C]}return{rfId:"1",width:0,height:0,transform:w,nodes:h,nodeLookup:u,parentLookup:d,edges:m,edgeLookup:p,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:rn,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:yt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...kc},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:es,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},KS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a})=>p0((u,d)=>({...Mi({nodes:e,edges:t,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a,defaultNodes:n,defaultEdges:s}),setNodes:x=>{const{nodeLookup:p,parentLookup:m,nodeOrigin:h,elevateNodesOnSelect:E}=d();Eo(x,p,m,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:E,checkEquality:!0}),u({nodes:x})},setEdges:x=>{const{connectionLookup:p,edgeLookup:m}=d();Xc(p,m,x),u({edges:x})},setDefaultNodesAndEdges:(x,p)=>{if(x){const{setNodes:m}=d();m(x),u({hasDefaultNodes:!0})}if(p){const{setEdges:m}=d();m(p),u({hasDefaultEdges:!0})}},updateNodeInternals:(x,p={triggerFitView:!0})=>{const{triggerNodeChanges:m,nodeLookup:h,parentLookup:E,fitViewOnInit:v,fitViewDone:w,fitViewOnInitOptions:_,domNode:S,nodeOrigin:y,nodeExtent:C,debug:P,fitViewSync:b}=d(),{changes:T,updatedInternals:N}=Ly(x,h,E,S,y,C);if(N){if(Py(h,E,{nodeOrigin:y,nodeExtent:C}),p.triggerFitView){let A=w;!w&&v&&(A=b({..._,nodes:_==null?void 0:_.nodes})),u({fitViewDone:A})}else u({});(T==null?void 0:T.length)>0&&(P&&console.log("React Flow: trigger node changes",T),m==null||m(T))}},updateNodePositions:(x,p=!1)=>{const m=[],h=[];for(const[E,v]of x){const w={id:E,type:"position",position:v.position,dragging:p};v!=null&&v.expandParent&&(v!=null&&v.parentId)&&w.position&&(m.push({id:E,parentId:v.parentId,rect:{...v.internals.positionAbsolute,width:v.measured.width,height:v.measured.height}}),w.position.x=Math.max(0,w.position.x),w.position.y=Math.max(0,w.position.y)),h.push(w)}if(m.length>0){const{nodeLookup:E,parentLookup:v,nodeOrigin:w}=d(),_=or(m,E,v,w);h.push(..._)}d().triggerNodeChanges(h)},triggerNodeChanges:x=>{const{onNodesChange:p,setNodes:m,nodes:h,hasDefaultNodes:E,debug:v}=d();if(x!=null&&x.length){if(E){const w=ua(x,h);m(w)}v&&console.log("React Flow: trigger node changes",x),p==null||p(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:p,setEdges:m,edges:h,hasDefaultEdges:E,debug:v}=d();if(x!=null&&x.length){if(E){const w=da(x,h);m(w)}v&&console.log("React Flow: trigger edge changes",x),p==null||p(x)}},addSelectedNodes:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:E,triggerEdgeChanges:v}=d();if(p){const w=x.map(_=>ft(_,!0));E(w);return}E(bt(h,new Set([...x]),!0)),v(bt(m))},addSelectedEdges:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:E,triggerEdgeChanges:v}=d();if(p){const w=x.map(_=>ft(_,!0));v(w);return}v(bt(m,new Set([...x]))),E(bt(h,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:p}={})=>{const{edges:m,nodes:h,nodeLookup:E,triggerNodeChanges:v,triggerEdgeChanges:w}=d(),_=x||h,S=p||m,y=_.map(P=>{const b=E.get(P.id);return b&&(b.selected=!1),ft(P.id,!1)}),C=S.map(P=>ft(P.id,!1));v(y),w(C)},setMinZoom:x=>{const{panZoom:p,maxZoom:m}=d();p==null||p.setScaleExtent([x,m]),u({minZoom:x})},setMaxZoom:x=>{const{panZoom:p,minZoom:m}=d();p==null||p.setScaleExtent([m,x]),u({maxZoom:x})},setTranslateExtent:x=>{var p;(p=d().panZoom)==null||p.setTranslateExtent(x),u({translateExtent:x})},setPaneClickDistance:x=>{var p;(p=d().panZoom)==null||p.setClickDistance(x)},resetSelectedElements:()=>{const{edges:x,nodes:p,triggerNodeChanges:m,triggerEdgeChanges:h}=d(),E=p.reduce((w,_)=>_.selected?[...w,ft(_.id,!1)]:w,[]),v=x.reduce((w,_)=>_.selected?[...w,ft(_.id,!1)]:w,[]);m(E),h(v)},setNodeExtent:x=>{const{nodes:p,nodeLookup:m,parentLookup:h,nodeOrigin:E,elevateNodesOnSelect:v,nodeExtent:w}=d();x[0][0]===w[0][0]&&x[0][1]===w[0][1]&&x[1][0]===w[1][0]&&x[1][1]===w[1][1]||(Eo(p,m,h,{nodeOrigin:E,nodeExtent:x,elevateNodesOnSelect:v,checkEquality:!1}),u({nodeExtent:x}))},panBy:x=>{const{transform:p,width:m,height:h,panZoom:E,translateExtent:v}=d();return Ty({delta:x,panZoom:E,transform:p,translateExtent:v,width:m,height:h})},fitView:x=>{const{panZoom:p,width:m,height:h,minZoom:E,maxZoom:v,nodeLookup:w}=d();if(!p)return Promise.resolve(!1);const _=fo(w,x);return po({nodes:_,width:m,height:h,panZoom:p,minZoom:E,maxZoom:v},x)},fitViewSync:x=>{const{panZoom:p,width:m,height:h,minZoom:E,maxZoom:v,nodeLookup:w}=d();if(!p)return!1;const _=fo(w,x);return po({nodes:_,width:m,height:h,panZoom:p,minZoom:E,maxZoom:v},x),_.size>0},cancelConnection:()=>{u({connection:{...kc}})},updateConnection:x=>{u({connection:x})},reset:()=>u({...Mi()})}),Object.is);function Ia({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:o,initialHeight:r,fitView:l,nodeOrigin:c,nodeExtent:a,children:u}){const[d]=g.useState(()=>KS({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a}));return i.jsxRuntimeExports.jsx(m0,{value:d,children:i.jsxRuntimeExports.jsx(B0,{children:u})})}function GS({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:o,width:r,height:l,fitView:c,nodeOrigin:a,nodeExtent:u}){return g.useContext(ws)?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:e}):i.jsxRuntimeExports.jsx(Ia,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:o,initialWidth:r,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:u,children:e})}const US={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function QS({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:o,nodeTypes:r,edgeTypes:l,onNodeClick:c,onEdgeClick:a,onInit:u,onMove:d,onMoveStart:x,onMoveEnd:p,onConnect:m,onConnectStart:h,onConnectEnd:E,onClickConnectStart:v,onClickConnectEnd:w,onNodeMouseEnter:_,onNodeMouseMove:S,onNodeMouseLeave:y,onNodeContextMenu:C,onNodeDoubleClick:P,onNodeDragStart:b,onNodeDrag:T,onNodeDragStop:N,onNodesDelete:A,onEdgesDelete:O,onDelete:L,onSelectionChange:D,onSelectionDragStart:R,onSelectionDrag:I,onSelectionDragStop:k,onSelectionContextMenu:B,onSelectionStart:M,onSelectionEnd:z,onBeforeDelete:V,connectionMode:Y,connectionLineType:W=st.Bezier,connectionLineStyle:J,connectionLineComponent:K,connectionLineContainerStyle:G,deleteKeyCode:Q="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:X=!1,selectionMode:oe=Nt.Full,panActivationKeyCode:xe="Space",multiSelectionKeyCode:ae=ts()?"Meta":"Control",zoomActivationKeyCode:H=ts()?"Meta":"Control",snapToGrid:ee,snapGrid:ce,onlyRenderVisibleElements:je=!1,selectNodesOnDrag:Ve,nodesDraggable:_s,nodesConnectable:ks,nodesFocusable:Ps,nodeOrigin:Vt=ca,edgesFocusable:Ms,edgesReconnectable:Ft,elementsSelectable:Ht=!0,defaultViewport:Ns=k0,minZoom:Zt=.5,maxZoom:Yt=2,translateExtent:jn=rn,preventScrolling:Tx=!0,nodeExtent:Ls,defaultMarkerColor:Ax="#b1b1b7",zoomOnScroll:$x=!0,zoomOnPinch:Ix=!0,panOnScroll:Ox=!1,panOnScrollSpeed:Bx=.5,panOnScrollMode:Dx=ht.Free,zoomOnDoubleClick:zx=!0,panOnDrag:Vx=!0,onPaneClick:Fx,onPaneMouseEnter:Hx,onPaneMouseMove:Zx,onPaneMouseLeave:Yx,onPaneScroll:qx,onPaneContextMenu:Wx,paneClickDistance:xr=0,nodeClickDistance:Xx=0,children:Kx,onReconnect:Gx,onReconnectStart:Ux,onReconnectEnd:Qx,onEdgeContextMenu:Jx,onEdgeDoubleClick:ef,onEdgeMouseEnter:tf,onEdgeMouseMove:nf,onEdgeMouseLeave:sf,reconnectRadius:of=10,onNodesChange:rf,onEdgesChange:lf,noDragClassName:cf="nodrag",noWheelClassName:af="nowheel",noPanClassName:fr="nopan",fitView:pr,fitViewOptions:uf,connectOnClick:df,attributionPosition:xf,proOptions:ff,defaultEdgeOptions:pf,elevateNodesOnSelect:mf,elevateEdgesOnSelect:hf,disableKeyboardA11y:mr=!1,autoPanOnConnect:gf,autoPanOnNodeDrag:jf,autoPanSpeed:Ef,connectionRadius:yf,isValidConnection:Sf,onError:Rf,style:wf,id:hr,nodeDragThreshold:Cf,viewport:vf,onViewportChange:bf,width:_f,height:kf,colorMode:Pf="light",debug:Mf,...Nf},Lf){const Ts=hr||"1",Tf=L0(Pf);return i.jsxRuntimeExports.jsx("div",{...Nf,style:{...wf,...US},ref:Lf,className:we(["react-flow",o,Tf]),"data-testid":"rf__wrapper",id:hr,children:i.jsxRuntimeExports.jsxs(GS,{nodes:e,edges:t,width:_f,height:kf,fitView:pr,nodeOrigin:Vt,nodeExtent:Ls,children:[i.jsxRuntimeExports.jsx(XS,{onInit:u,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:_,onNodeMouseMove:S,onNodeMouseLeave:y,onNodeContextMenu:C,onNodeDoubleClick:P,nodeTypes:r,edgeTypes:l,connectionLineType:W,connectionLineStyle:J,connectionLineComponent:K,connectionLineContainerStyle:G,selectionKeyCode:ne,selectionOnDrag:X,selectionMode:oe,deleteKeyCode:Q,multiSelectionKeyCode:ae,panActivationKeyCode:xe,zoomActivationKeyCode:H,onlyRenderVisibleElements:je,defaultViewport:Ns,translateExtent:jn,minZoom:Zt,maxZoom:Yt,preventScrolling:Tx,zoomOnScroll:$x,zoomOnPinch:Ix,zoomOnDoubleClick:zx,panOnScroll:Ox,panOnScrollSpeed:Bx,panOnScrollMode:Dx,panOnDrag:Vx,onPaneClick:Fx,onPaneMouseEnter:Hx,onPaneMouseMove:Zx,onPaneMouseLeave:Yx,onPaneScroll:qx,onPaneContextMenu:Wx,paneClickDistance:xr,nodeClickDistance:Xx,onSelectionContextMenu:B,onSelectionStart:M,onSelectionEnd:z,onReconnect:Gx,onReconnectStart:Ux,onReconnectEnd:Qx,onEdgeContextMenu:Jx,onEdgeDoubleClick:ef,onEdgeMouseEnter:tf,onEdgeMouseMove:nf,onEdgeMouseLeave:sf,reconnectRadius:of,defaultMarkerColor:Ax,noDragClassName:cf,noWheelClassName:af,noPanClassName:fr,rfId:Ts,disableKeyboardA11y:mr,nodeExtent:Ls,viewport:vf,onViewportChange:bf}),i.jsxRuntimeExports.jsx(N0,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:m,onConnectStart:h,onConnectEnd:E,onClickConnectStart:v,onClickConnectEnd:w,nodesDraggable:_s,nodesConnectable:ks,nodesFocusable:Ps,edgesFocusable:Ms,edgesReconnectable:Ft,elementsSelectable:Ht,elevateNodesOnSelect:mf,elevateEdgesOnSelect:hf,minZoom:Zt,maxZoom:Yt,nodeExtent:Ls,onNodesChange:rf,onEdgesChange:lf,snapToGrid:ee,snapGrid:ce,connectionMode:Y,translateExtent:jn,connectOnClick:df,defaultEdgeOptions:pf,fitView:pr,fitViewOptions:uf,onNodesDelete:A,onEdgesDelete:O,onDelete:L,onNodeDragStart:b,onNodeDrag:T,onNodeDragStop:N,onSelectionDrag:I,onSelectionDragStart:R,onSelectionDragStop:k,onMove:d,onMoveStart:x,onMoveEnd:p,noPanClassName:fr,nodeOrigin:Vt,rfId:Ts,autoPanOnConnect:gf,autoPanOnNodeDrag:jf,autoPanSpeed:Ef,onError:Rf,connectionRadius:yf,isValidConnection:Sf,selectNodesOnDrag:Ve,nodeDragThreshold:Cf,onBeforeDelete:V,paneClickDistance:xr,debug:Mf}),i.jsxRuntimeExports.jsx(_0,{onSelectionChange:D}),Kx,i.jsxRuntimeExports.jsx(R0,{proOptions:ff,position:xf}),i.jsxRuntimeExports.jsx(y0,{rfId:Ts,disableKeyboardA11y:mr})]})})}var JS=xa(QS);function e1(){const e=ge();return g.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),o=Array.isArray(t)?t:[t],r=new Map;o.forEach(l=>{const c=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${l}"]`);c&&r.set(l,{id:l,nodeElement:c,force:!0})}),requestAnimationFrame(()=>s(r,{triggerFitView:!1}))},[])}function t1({onStart:e,onChange:t,onEnd:n}){const s=ge();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function n1({dimensions:e,lineWidth:t,variant:n,className:s}){return i.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:we(["react-flow__background-pattern",n,s])})}function s1({radius:e,className:t}){return i.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:we(["react-flow__background-pattern","dots",t])})}var it;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(it||(it={}));const o1={[it.Dots]:1,[it.Lines]:1,[it.Cross]:6},r1=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Oa({id:e,variant:t=it.Dots,gap:n=20,size:s,lineWidth:o=1,offset:r=0,color:l,bgColor:c,style:a,className:u,patternClassName:d}){const x=g.useRef(null),{transform:p,patternId:m}=pe(r1,Se),h=s||o1[t],E=t===it.Dots,v=t===it.Cross,w=Array.isArray(n)?n:[n,n],_=[w[0]*p[2]||1,w[1]*p[2]||1],S=h*p[2],y=Array.isArray(r)?r:[r,r],C=v?[S,S]:_,P=[y[0]*p[2]||1+C[0]/2,y[1]*p[2]||1+C[1]/2],b=`${m}${e||""}`;return i.jsxRuntimeExports.jsxs("svg",{className:we(["react-flow__background",u]),style:{...a,...Cs,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:x,"data-testid":"rf__background",children:[i.jsxRuntimeExports.jsx("pattern",{id:b,x:p[0]%_[0],y:p[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`,children:E?i.jsxRuntimeExports.jsx(s1,{radius:S/2,className:d}):i.jsxRuntimeExports.jsx(n1,{dimensions:C,lineWidth:o,variant:t,className:d})}),i.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${b})`})]})}Oa.displayName="Background";const i1=g.memo(Oa);function l1(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:i.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function c1(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:i.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function a1(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:i.jsxRuntimeExports.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function u1(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function d1(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _n({children:e,className:t,...n}){return i.jsxRuntimeExports.jsx("button",{type:"button",className:we(["react-flow__controls-button",t]),...n,children:e})}const x1=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Ba({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:r,onZoomOut:l,onFitView:c,onInteractiveChange:a,className:u,children:d,position:x="bottom-left",orientation:p="vertical","aria-label":m="React Flow controls"}){const h=ge(),{isInteractive:E,minZoomReached:v,maxZoomReached:w}=pe(x1,Se),{zoomIn:_,zoomOut:S,fitView:y}=dt(),C=()=>{_(),r==null||r()},P=()=>{S(),l==null||l()},b=()=>{y(o),c==null||c()},T=()=>{h.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),a==null||a(!E)},N=p==="horizontal"?"horizontal":"vertical";return i.jsxRuntimeExports.jsxs(rr,{className:we(["react-flow__controls",N,u]),position:x,style:e,"data-testid":"rf__controls","aria-label":m,children:[t&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(_n,{onClick:C,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:w,children:i.jsxRuntimeExports.jsx(l1,{})}),i.jsxRuntimeExports.jsx(_n,{onClick:P,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:v,children:i.jsxRuntimeExports.jsx(c1,{})})]}),n&&i.jsxRuntimeExports.jsx(_n,{className:"react-flow__controls-fitview",onClick:b,title:"fit view","aria-label":"fit view",children:i.jsxRuntimeExports.jsx(a1,{})}),s&&i.jsxRuntimeExports.jsx(_n,{className:"react-flow__controls-interactive",onClick:T,title:"toggle interactivity","aria-label":"toggle interactivity",children:E?i.jsxRuntimeExports.jsx(d1,{}):i.jsxRuntimeExports.jsx(u1,{})}),d]})}Ba.displayName="Controls";g.memo(Ba);function f1({id:e,x:t,y:n,width:s,height:o,style:r,color:l,strokeColor:c,strokeWidth:a,className:u,borderRadius:d,shapeRendering:x,selected:p,onClick:m}){const{background:h,backgroundColor:E}=r||{},v=l||h||E;return i.jsxRuntimeExports.jsx("rect",{className:we(["react-flow__minimap-node",{selected:p},u]),x:t,y:n,rx:d,ry:d,width:s,height:o,style:{fill:v,stroke:c,strokeWidth:a},shapeRendering:x,onClick:m?w=>m(w,e):void 0})}const p1=g.memo(f1),m1=e=>e.nodes.map(t=>t.id),Us=e=>e instanceof Function?e:()=>e;function h1({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:r=p1,onClick:l}){const c=pe(m1,Se),a=Us(t),u=Us(e),d=Us(n),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:c.map(p=>i.jsxRuntimeExports.jsx(j1,{id:p,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:r,onClick:l,shapeRendering:x},p))})}function g1({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:o,nodeStrokeWidth:r,shapeRendering:l,NodeComponent:c,onClick:a}){const{node:u,x:d,y:x,width:p,height:m}=pe(h=>{const E=h.nodeLookup.get(e),{x:v,y:w}=E.internals.positionAbsolute,{width:_,height:S}=Je(E);return{node:E,x:v,y:w,width:_,height:S}},Se);return!u||u.hidden||!Oc(u)?null:i.jsxRuntimeExports.jsx(c,{x:d,y:x,width:p,height:m,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:r,shapeRendering:l,onClick:a,id:u.id})}const j1=g.memo(g1);var E1=g.memo(h1);const y1=200,S1=150,R1=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?$c(mn(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},w1="react-flow__minimap-desc";function Da({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:o="",nodeBorderRadius:r=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:a,maskColor:u,maskStrokeColor:d,maskStrokeWidth:x,position:p="bottom-right",onClick:m,onNodeClick:h,pannable:E=!1,zoomable:v=!1,ariaLabel:w="React Flow mini map",inversePan:_,zoomStep:S=10,offsetScale:y=5}){const C=ge(),P=g.useRef(null),{boundingRect:b,viewBB:T,rfId:N,panZoom:A,translateExtent:O,flowWidth:L,flowHeight:D}=pe(R1,Se),R=(e==null?void 0:e.width)??y1,I=(e==null?void 0:e.height)??S1,k=b.width/R,B=b.height/I,M=Math.max(k,B),z=M*R,V=M*I,Y=y*M,W=b.x-(z-b.width)/2-Y,J=b.y-(V-b.height)/2-Y,K=z+Y*2,G=V+Y*2,Q=`${w1}-${N}`,ne=g.useRef(0),X=g.useRef();ne.current=M,g.useEffect(()=>{if(P.current&&A)return X.current=Vy({domNode:P.current,panZoom:A,getTransform:()=>C.getState().transform,getViewScale:()=>ne.current}),()=>{var ae;(ae=X.current)==null||ae.destroy()}},[A]),g.useEffect(()=>{var ae;(ae=X.current)==null||ae.update({translateExtent:O,width:L,height:D,inversePan:_,pannable:E,zoomStep:S,zoomable:v})},[E,v,_,S,O,L,D]);const oe=m?ae=>{var ce;const[H,ee]=((ce=X.current)==null?void 0:ce.pointer(ae))||[0,0];m(ae,{x:H,y:ee})}:void 0,xe=h?g.useCallback((ae,H)=>{const ee=C.getState().nodeLookup.get(H);h(ae,ee)},[]):void 0;return i.jsxRuntimeExports.jsx(rr,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*M:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="string"?l:void 0},className:we(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:i.jsxRuntimeExports.jsxs("svg",{width:R,height:I,viewBox:`${W} ${J} ${K} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Q,ref:P,onClick:oe,children:[w&&i.jsxRuntimeExports.jsx("title",{id:Q,children:w}),i.jsxRuntimeExports.jsx(E1,{onClick:xe,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:r,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),i.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-Y},${J-Y}h${K+Y*2}v${G+Y*2}h${-K-Y*2}z
|
|
39
|
-
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Da.displayName="MiniMap";g.memo(Da);function C1({nodeId:e,position:t,variant:n=Qt.Handle,className:s,style:o={},children:r,color:l,minWidth:c=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:x=!1,shouldResize:p,onResizeStart:m,onResize:h,onResizeEnd:E}){const v=ha(),w=typeof e=="string"?e:v,_=ge(),S=g.useRef(null),y=n===Qt.Line?"right":"bottom-right",C=t??y,P=g.useRef(null);g.useEffect(()=>{if(!(!S.current||!w))return P.current||(P.current=n0({domNode:S.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:A,transform:O,snapGrid:L,snapToGrid:D,nodeOrigin:R,domNode:I}=_.getState();return{nodeLookup:A,transform:O,snapGrid:L,snapToGrid:D,nodeOrigin:R,paneDomNode:I}},onChange:(A,O)=>{const{triggerNodeChanges:L,nodeLookup:D,parentLookup:R,nodeOrigin:I}=_.getState(),k=[],B={x:A.x,y:A.y},M=D.get(w);if(M&&M.expandParent&&M.parentId){const z=M.origin??I,V=A.width??M.measured.width,Y=A.height??M.measured.height,W={id:M.id,parentId:M.parentId,rect:{width:V,height:Y,...Bc({x:A.x??M.position.x,y:A.y??M.position.y},{width:V,height:Y},M.parentId,D,z)}},J=or([W],D,R,I);k.push(...J),B.x=A.x?Math.max(z[0]*V,A.x):void 0,B.y=A.y?Math.max(z[1]*Y,A.y):void 0}if(B.x!==void 0&&B.y!==void 0){const z={id:w,type:"position",position:{...B}};k.push(z)}if(A.width!==void 0&&A.height!==void 0){const z={id:w,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:A.width,height:A.height}};k.push(z)}for(const z of O){const V={...z,type:"position"};k.push(V)}L(k)},onEnd:()=>{const A={id:w,type:"dimensions",resizing:!1};_.getState().triggerNodeChanges([A])}})),P.current.update({controlPosition:C,boundaries:{minWidth:c,minHeight:a,maxWidth:u,maxHeight:d},keepAspectRatio:x,onResizeStart:m,onResize:h,onResizeEnd:E,shouldResize:p}),()=>{var A;(A=P.current)==null||A.destroy()}},[C,c,a,u,d,x,m,h,E,p]);const b=C.split("-"),T=n===Qt.Line?"borderColor":"backgroundColor",N=l?{...o,[T]:l}:o;return i.jsxRuntimeExports.jsx("div",{className:we(["react-flow__resize-control","nodrag",...b,n,s]),ref:S,style:N,children:r})}g.memo(C1);const lr=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Me=(e,t)=>{const n=lr(t),s=e.getNodes().find(o=>o.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return f.Eo.construct(s.position,f._.scale(f.Eo.dims(f.Eo.construct(n)),1/e.getZoom()))},v1=(e,t)=>vs.fromFlow(e,t);class za{constructor(t,n){Fe(this,"node_",null);Fe(this,"position");Fe(this,"orientation");this.position=t,this.orientation=n}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return f.q.translate(f.Eo.topLeft(this.node.box),this.position)}}class vs{constructor(t,n,s){Fe(this,"key");Fe(this,"box");Fe(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(o=>o.node=this)}static fromFlow(t,n){const s=Me(n,t),o=lr(t),r=o.getElementsByClassName("react-flow__handle"),l=f.Eo.construct(o),c=Array.from(r).map(a=>{const u=f.Eo.center(f.Eo.construct(a)),d=f.q.translation(f.Eo.topLeft(l),u),x=a.className.match(/react-flow__handle-(\w+)/);if(x==null)throw new Error("[schematic] - cannot find handle orientation");const p=f.J.construct(x[0]);return new za(d,p)});return new vs(t,s,c)}}const b1=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:o,toPosition:r,fromNode:l,connectionLineStyle:c,connectionStatus:a})=>{const u=document.querySelector(".react-flow__handle-connecting"),d=u==null?void 0:u.className.match(/react-flow__handle-(\w+)/);if(d!=null){const h=f.J.outer.safeParse(d[1]);h.success&&(r=h.data)}const x=dt(),p=Ct({sourcePos:f.q.construct(e,t),targetPos:f.q.construct(n,s),sourceOrientation:o,targetOrientation:r,sourceBox:Me(x,(l==null?void 0:l.id)??""),targetBox:Me(x,(l==null?void 0:l.id)??"")}),m=Kl(f.q.construct(e,t),p,x.getZoom(),!1);return i.jsxRuntimeExports.jsx(Dt,{path:Va(m),style:{...c,stroke:f.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},_1=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:o,targetPosition:r,style:l,segments:c=[],onSegmentsChange:a,color:u="var(--pluto-gray-l9)",selected:d=!1,...x})=>{const p=f.q.construct(x.sourceX,x.sourceY),m=g.useRef(p),h=f.q.equals(p,m.current),E=f.q.construct(x.targetX,x.targetY),v=g.useRef(E),w=f.q.equals(E,v.current),_=dt(),[S,y,C]=j.useCombinedStateAndRef(()=>c.length>0?c:Ct({sourcePos:p,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Me(_,t),targetBox:Me(_,n)})),P=g.useRef(r),b=g.useRef(s),T=j.useDebouncedCallback(a,100,[a]);if(!h||!w){let L=S;const D=f.q.translation(m.current,p),R=f.q.translation(E,v.current);f.q.equals(D,f.q.scale(R,-1),.001)?(m.current=p,v.current=E):(h?w||(L=rg({delta:R,segments:L}),P.current!==r&&(P.current=r,L=Ct({sourcePos:p,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Me(_,t),targetBox:Me(_,n)})),Nr({sourcePos:p,targetPos:E,next:L,prev:S})||(L=Ct({sourcePos:p,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Me(_,t),targetBox:Me(_,n)})),v.current=E):(L=og({delta:D,segments:L}),b.current!==s&&(b.current=s,L=Ct({sourcePos:p,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Me(_,t),targetBox:Me(_,n)})),Nr({sourcePos:p,targetPos:E,next:L,prev:S})||(L=Ct({sourcePos:p,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Me(_,t),targetBox:Me(_,n)})),m.current=p),T(L),y(L))}const N=g.useRef(null),A=rs({onStart:g.useCallback((L,D,R)=>{N.current={index:Number(R.currentTarget.id.split("-")[1]),segments:[...C.current]}},[]),onMove:g.useCallback(L=>{if(N.current==null)return;const D=eg({segments:N.current.segments,index:N.current.index,magnitude:f.Eo.dim(L,f.g.swap(N.current.segments[N.current.index].direction),!0)/_.getZoom()});y(D)},[]),onEnd:g.useCallback(()=>a(C.current),[a])}),O=Kl(p,S,_.getZoom(),!0);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Dt,{path:Va(O),style:{...l,stroke:f.cssString(u)},...x}),d&&k1(O).map((L,D)=>{const R=S[D].direction,I=f.g.swap(R),k={[f.g.dimension(R)]:"18px",[f.g.dimension(I)]:"4px"},B={[R]:L[R]-9,[I]:L[I]-2};return i.jsxRuntimeExports.jsxs(g.Fragment,{children:[i.jsxRuntimeExports.jsx("rect",{className:f.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...k,...B,rx:"2px",ry:"2px"}),i.jsxRuntimeExports.jsx("foreignObject",{x:L.x-9,y:L.y-9,width:"18px",height:"18px",children:i.jsxRuntimeExports.jsx("div",{id:`handle-${D}`,className:f.CSS(f.CSS.BE("diagram-edge-handle","dragger"),f.CSS.dir(R)),draggable:!0,onDragStart:A})})]},D)})]})},Va=e=>{let t="";const s=e.length+-1;for(let o=0;o<s;o++){const r=e[o%e.length],l=e[(o+1)%e.length],c=Math.min(6/Math.hypot(l.x-r.x,l.y-r.y),.5);o>0&&(t+=`Q${r.x},${r.y} ${r.x*(1-c)+l.x*c},${r.y*(1-c)+l.y*c}`),o===0?t+=`M${r.x},${r.y}`:o===0&&(t+=`M${r.x*(1-c)+l.x*c},${r.y*(1-c)+l.y*c}`),o===s-1?t+=`L${l.x},${l.y}`:o<s-1&&(t+=`L${r.x*c+l.x*(1-c)},${r.y*c+l.y*(1-c)}`)}return t},k1=e=>e.slice(1).map((t,n)=>{const s=e[n];return f.q.construct((t.x+s.x)/2,(t.y+s.y)/2)}),P1=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:f.q.ZERO,zoom:1}})=>{const[o,r]=g.useState(n),[l,c]=g.useState(e),[a,u]=g.useState(t),[d,x]=g.useState(s),[p,m]=g.useState(!1);return{viewport:d,onViewportChange:x,edges:a,nodes:l,onNodesChange:c,onEdgesChange:u,editable:o,onEditableChange:r,fitViewOnResize:p,setFitViewOnResize:m}},M1=()=>!0,N1={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1},L1={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesReconnectable:!1,nodesFocusable:!1,reconnectRadius:0},Fa={maxZoom:1,minZoom:.5},T1={hideAttribution:!0},Ha=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),gn=()=>g.useContext(Ha),Za=g.memo(({children:e})=>{const{registerNodeRenderer:t}=gn();return g.useEffect(()=>t(e),[t,e]),null});Za.displayName="NodeRenderer";const A1=["Backspace","Delete"],$1=j.wrap$1($.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:s,nodes:o,edges:r,onEditableChange:l,editable:c,viewport:a,triggers:u,onViewportChange:d,fitViewOnResize:x,setFitViewOnResize:p,visible:m,...h})=>{const E=j.useMemoDeepEqualProps({visible:m}),[{path:v},,w]=j.use$3({aetherKey:e,type:$.Diagram$1.TYPE,schema:$.diagramStateZ,initialState:{position:a.position,region:f.Eo.ZERO,zoom:a.zoom,...E}});g.useEffect(()=>w(H=>({...H,...E})),[E]);const _=j.use().colors.gray.l9.hex,S=j.useMemoCompare(()=>u??$o.zoom,j.compareModeConfigs,[u]),{fitView:y}=dt(),C=j.useDebouncedCallback(H=>y(H),50,[y]),P=cs(g.useCallback(H=>{x&&C({maxZoom:1}),w(ee=>({...ee,region:H}))},[w,C,x])),b=g.useRef(null),T=g.useCallback(H=>{const ee=b.current;ee!=null&&ee.x===H.x&&ee.y===H.y&&ee.zoom===H.zoom||(b.current=H,!(isNaN(H.x)||isNaN(H.y)||isNaN(H.zoom))&&(w(ce=>({...ce,position:H,zoom:H.zoom})),d(tc(H))))},[w,d]);t1({onStart:T,onChange:T,onEnd:T});const[N,A]=g.useState(()=>()=>null),O=g.useCallback(H=>A(()=>H),[]),L=g.useMemo(()=>({custom:({id:H,positionAbsoluteX:ee,positionAbsoluteY:ce,selected:je=!1})=>N({symbolKey:H,position:{x:ee,y:ce},selected:je})}),[N]),D=g.useRef(r),R=g.useMemo(()=>(D.current=r,Wo(r)),[r]),I=g.useRef(o),k=g.useMemo(()=>(I.current=o,qo(o)),[o]),B=g.useCallback(H=>n(nc(I.current,ee=>ua(H,ee))),[n]),M=g.useCallback(H=>s(Ln(D.current,ee=>da(H,ee),_)),[s,_]),z=g.useCallback((H,ee)=>s(Ln(D.current,ce=>Ry(H,ee,ce),_)),[]),V=g.useCallback(H=>{s(Ln(D.current,ee=>Yc(H,ee),_))},[s,_]),Y=g.useCallback((H,ee)=>{const ce=[...D.current],je=ce.findIndex(Ve=>Ve.key===H);je!==-1&&(ce[je]={...ce[je],segments:ee},D.current=ce,s(ce))},[s]),W=c?N1:L1,J=j.useSyncedRef(Y),K=g.useMemo(()=>({default:H=>{var ee,ce;return i.jsxRuntimeExports.jsx(_1,{...H,segments:((ee=H.data)==null?void 0:ee.segments)??[],color:(ce=H.data)==null?void 0:ce.color,onSegmentsChange:g.useCallback(je=>J.current(H.id,je),[H.id])},H.id)}}),[]),G=g.useRef(null);j.use$1({triggers:S.zoomReset,callback:g.useCallback(({stage:H,cursor:ee})=>{const ce=G.current;ce==null||H!=="start"||!f.Eo.contains(ce,ee)||y()},[y])});const Q=j.purgeMouse(S.select)[0]??null,ne=j.purgeMouse(S.pan)[0]??null,X=j.purgeMouse(S.zoom)[0]??null,oe={selectionOnDrag:Q==null,panOnDrag:ne==null,selectionKeyCode:Q,panActivationKeyCode:ne,zoomActivationKeyCode:X},xe=j.useCombinedRefs(G,P),ae=g.useMemo(()=>({visible:m,editable:c,onEditableChange:l,registerNodeRenderer:O,fitViewOnResize:x,setFitViewOnResize:p}),[c,m,l,O,x]);return i.jsxRuntimeExports.jsx(Ha.Provider,{value:ae,children:i.jsxRuntimeExports.jsx(j.Composite,{path:v,children:m&&i.jsxRuntimeExports.jsx(JS,{...oe,className:f.CSS(f.CSS.B("diagram"),f.CSS.editable(c)),nodes:k,edges:R,nodeTypes:L,edgeTypes:K,ref:xe,fitView:!0,onNodesChange:B,onEdgesChange:M,onConnect:V,onReconnect:z,defaultViewport:ec(a),connectionLineComponent:b1,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:M1,connectionMode:yt.Loose,snapGrid:[3,3],fitViewOptions:Fa,selectionMode:Nt.Partial,proOptions:T1,deleteKeyCode:A1,...h,style:{[f.CSS.var("diagram-zoom")]:a.zoom,...h.style},...W,children:t})})})}),I1=()=>{const{editable:e}=gn();return e?i.jsxRuntimeExports.jsx(i1,{}):null},O1=({children:e,...t})=>i.jsxRuntimeExports.jsx(te.Pack,{direction:"y",borderShade:4,className:f.CSS.BE("diagram","controls"),...t,children:e}),B1=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=gn();return i.jsxRuntimeExports.jsx(j.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:f.J.RIGHT_CENTER,tooltip:n?i.jsxRuntimeExports.jsx(j.Text,{level:"small",children:"Disable edit mode"}):i.jsxRuntimeExports.jsx(j.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?i.jsxRuntimeExports.jsx(j.Qt.EditOff,{}):i.jsxRuntimeExports.jsx(j.Qt.Edit,{})})},D1=({onClick:e,...t})=>{const{fitView:n}=dt(),{fitViewOnResize:s,setFitViewOnResize:o}=gn();return i.jsxRuntimeExports.jsx(j.ToggleIcon,{onClick:r=>{n(Fa),e==null||e(r)},value:s,onChange:r=>o(r),rightClickToggle:!0,tooltip:i.jsxRuntimeExports.jsx(j.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:f.J.RIGHT_CENTER,variant:"outlined",...t,children:i.jsxRuntimeExports.jsx(j.Qt.Expand,{})})},z1=e=>i.jsxRuntimeExports.jsx(Ia,{children:i.jsxRuntimeExports.jsx($1,{...e})}),V1=Object.freeze(Object.defineProperty({__proto__:null,Background:I1,Controls:O1,Diagram:z1,FitViewControl:D1,HandleLayout:za,NodeLayout:vs,NodeRenderer:Za,ToggleEditControl:B1,alignNodes:ag,edgeConverter:Ln,edgeZ:lg,nodeConverter:nc,nodeZ:cg,rfEdgeDataZ:Ul,selectNode:lr,selectNodeBox:Me,selectNodeLayout:v1,translateEdgesBackward:Jl,translateEdgesForward:Wo,translateNodesBackward:Ql,translateNodesForward:qo,translateViewportBackward:tc,translateViewportForward:ec,use:P1,useContext:gn,viewportZ:ig},Symbol.toStringTag,{value:"Module"})),F1=j.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:o=i.jsxRuntimeExports.jsx(j.Text$2.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:r,telem:l,...c})=>{const a=j.useMemoDeepEqualProps({font:t,color:r,telem:l,visible:s}),[,{scrolling:u,empty:d},x]=j.use$3({aetherKey:e,type:$.Log.TYPE,schema:$.logState,initialState:{empty:!0,region:f.Eo.ZERO,scrolling:!1,wheelPos:0,...a}});g.useEffect(()=>{x(m=>({...m,...a}))},[a,x]);const p=cs(g.useCallback(m=>x(h=>({...h,region:m})),[x]));return i.jsxRuntimeExports.jsx("div",{ref:p,className:f.CSS(f.CSS.B("log"),n),onWheel:m=>{x(h=>({...h,wheelPos:h.wheelPos-m.deltaY,scrolling:h.scrolling?h.scrolling:m.deltaY<0}))},...c,children:d?o:i.jsxRuntimeExports.jsx(j.Icon,{className:f.CSS(f.CSS.BE("log","live"),u&&f.CSS.M("active")),variant:"outlined",onClick:()=>x(m=>({...m,scrolling:!m.scrolling})),tooltip:u?"Resume Scrolling":"Pause Scrolling",children:i.jsxRuntimeExports.jsx(j.Qt.Dynamic,{})})})}),H1=Object.freeze(Object.defineProperty({__proto__:null,Log:F1},Symbol.toStringTag,{value:"Module"})),Z1=[{key:"standard",label:"Standard"},{key:"scientific",label:"Scientific"},{key:"engineering",label:"Engineering"}],Y1=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(j.Button,{variant:s?"filled":"outlined",onClick:n,children:t.label},e),q1=({children:e=Y1,...t})=>i.jsxRuntimeExports.jsx(Pe.Button,{...t,data:Z1,children:e}),W1=({value:e,showOuter:t=!0,showInner:n,onChange:s})=>{const{outer:o}=e,r=l=>()=>s({...e,...l});return t?i.jsxRuntimeExports.jsxs(te.Space,{className:f.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(rt,{selected:o==="top",onClick:r({outer:"top"})}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(rt,{selected:o==="left",onClick:r({outer:"left"})}),i.jsxRuntimeExports.jsx(Ni,{showInner:n,value:e,onChange:s}),i.jsxRuntimeExports.jsx(rt,{selected:o==="right",onClick:r({outer:"right"})})]}),i.jsxRuntimeExports.jsx(rt,{selected:o==="bottom",onClick:r({outer:"bottom"})})]}):i.jsxRuntimeExports.jsx(Ni,{className:f.CSS.B("orientation-control"),value:e,onChange:s})},Ni=({value:e,onChange:t,className:n,showInner:s=!0,...o})=>{const{inner:r}=e,l=a=>()=>t({...e,...a});let c={};return s||(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),i.jsxRuntimeExports.jsxs(te.Space,{className:f.CSS(n,f.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...o,children:[i.jsxRuntimeExports.jsx(rt,{style:c,disabled:!s,className:f.CSS(f.CSS.dir("y")),selected:r==="top",onClick:l({inner:"top"})}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",justify:"center",children:[i.jsxRuntimeExports.jsx(rt,{style:c,disabled:!s,selected:r==="left",onClick:l({inner:"left"})}),i.jsxRuntimeExports.jsx(rt,{style:c,disabled:!s,selected:r==="right",onClick:l({inner:"right"})})]}),i.jsxRuntimeExports.jsx(rt,{style:c,disabled:!s,className:f.CSS(f.CSS.dir("y")),selected:r==="bottom",onClick:l({inner:"bottom"})})]})},rt=({selected:e,className:t,...n})=>i.jsxRuntimeExports.jsx(j.Icon,{variant:"text",className:f.CSS(t,f.CSS.selected(e)),...n,children:i.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Ie=({className:e,direction:t,...n})=>i.jsxRuntimeExports.jsx(te.Space,{direction:t,align:"stretch",className:f.CSS(f.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),wt=({showOuter:e,showInner:t,...n})=>i.jsxRuntimeExports.jsx(ye,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:o})=>{var r;return i.jsxRuntimeExports.jsx(W1,{value:{inner:s.orientation??"top",outer:((r=s.label)==null?void 0:r.orientation)??"top"},showInner:t,showOuter:e,onChange:l=>o({...s,orientation:l.inner,label:{...s.label,orientation:l.outer}})})}}),zt=({path:e,omit:t=[]})=>i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsx(ye,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>i.jsxRuntimeExports.jsx(j.Text$1,{selectOnFocus:!0,...n})}),i.jsxRuntimeExports.jsx(us,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px"}}),i.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>i.jsxRuntimeExports.jsx(Pe.SelectLevel,{...n})}),i.jsxRuntimeExports.jsx(ye,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>i.jsxRuntimeExports.jsx(Ao,{...n})})]}),Ue=e=>i.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...o})=>i.jsxRuntimeExports.jsx(wo.Swatch,{value:t??f.ZERO.setAlpha(1).rgba255,onChange:r=>n(r.rgba255),...o,bordered:!0})}),X1=e=>i.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:t=>i.jsxRuntimeExports.jsx(j.Numeric,{dragScale:1,bounds:{lower:.5,upper:15},...t})}),Ee=({omit:e})=>i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,empty:!0,children:[i.jsxRuntimeExports.jsx(zt,{omit:e,path:"label"}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Ue,{path:"color",optional:!0}),i.jsxRuntimeExports.jsx(ye,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:t=>i.jsxRuntimeExports.jsx(j.Switch$1,{...t})}),i.jsxRuntimeExports.jsx(X1,{path:"scale"})]})]}),i.jsxRuntimeExports.jsx(wt,{path:""})]}),K1=({path:e})=>{var u,d;const{value:t,onChange:n}=at({path:e}),s=$.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=$.sinkPipelinePropsZ.parse((d=t.sink)==null?void 0:d.props),r=$.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=$.setChannelValuePropsZ.parse(o.segments.setter.props),c=x=>{x??(x=0);const p=$.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:$.streamChannelValue({channel:x}),threshold:$.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:p})},a=x=>{x??(x=0);const p=$.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:$.setChannelValue({channel:x}),setpoint:$.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),m=$.authoritySource({channel:x}),h=$.acquireChannelControl({channel:x,authority:255});n({...t,sink:p,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:h,source:m},indicator:{statusSource:m}}})};return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",grow:!0,align:"stretch",children:[i.jsxRuntimeExports.jsx($e.Item,{label:"State Channel",grow:!0,children:i.jsxRuntimeExports.jsx(lt,{value:r.channel,onChange:c})}),i.jsxRuntimeExports.jsx($e.Item,{label:"Command Channel",grow:!0,children:i.jsxRuntimeExports.jsx(lt,{value:l.channel,onChange:a})}),i.jsxRuntimeExports.jsx(Do,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},cr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ve=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(K1,{path:""});default:return i.jsxRuntimeExports.jsx(Ee,{})}},[]),t=Ce.useStatic({tabs:cr,content:e});return i.jsxRuntimeExports.jsx(Ce.Tabs,{...t})},pt={y:2,x:.25},Jt={lower:0,upper:2e3},Li={lower:0,upper:51},Ya=({includeBorderRadius:e=!1})=>i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,empty:!0,children:[i.jsxRuntimeExports.jsx(zt,{path:"label"}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ue,{path:"color"}),i.jsxRuntimeExports.jsx(Ue,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(ye,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:pt,bounds:Li,endContent:"%",...n})}),i.jsxRuntimeExports.jsx(ye,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:pt,bounds:Li,endContent:"%",...n})}),e&&i.jsxRuntimeExports.jsx(ye,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:pt,bounds:Jt,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(ye,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:t??200,dragScale:pt,bounds:Jt,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(ye,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:t??200,dragScale:pt,bounds:Jt,endContent:"px",...n})})]})]}),i.jsxRuntimeExports.jsx(wt,{path:"",showInner:!1})]}),qa=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],G1=({path:e})=>{var p;const{value:t,onChange:n}=at({path:e}),s=$.sourcePipelinePropsZ.parse((p=t.telem)==null?void 0:p.props),o=$.streamChannelValuePropsZ.parse(s.segments.valueStream.props),r=$.stringifyNumberProps.parse(s.segments.stringifier.props),l=$.rollingAverageProps.parse(s.segments.rollingAverage.props),c=m=>{const h=$.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:$.streamChannelValue({channel:m??0}),stringifier:$.stringifyNumber({precision:r.precision??2,notation:r.notation}),rollingAverage:$.rollingAverage({windowSize:l.windowSize??1})},outlet:"stringifier"});n({...t,telem:h})},a=m=>{const h=$.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:$.streamChannelValue(o),stringifier:$.stringifyNumber({...r,notation:m}),rollingAverage:$.rollingAverage(l)},outlet:"stringifier"});n({...t,telem:h})},u=m=>{const h=$.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:$.streamChannelValue({channel:o.channel}),stringifier:$.stringifyNumber({...r,precision:m}),rollingAverage:$.rollingAverage({windowSize:l.windowSize})},outlet:"stringifier"});n({...t,telem:h})},d=m=>{const h=$.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{stringifier:$.stringifyNumber({...r,precision:r.precision??2}),valueStream:$.streamChannelValue({channel:o.channel}),rollingAverage:$.rollingAverage({windowSize:m})},outlet:"stringifier"});n({...t,telem:h})},x=ls(o.channel);return g.useEffect(()=>n({...t,tooltip:[x]}),[x]),i.jsxRuntimeExports.jsxs(Ie,{direction:"y",align:"stretch",children:[i.jsxRuntimeExports.jsx($e.Item,{label:"Input Channel",grow:!0,children:i.jsxRuntimeExports.jsx(lt,{value:o.channel,onChange:c})}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx($e.Item,{label:"Notation",children:i.jsxRuntimeExports.jsx(q1,{value:r.notation,onChange:a})}),i.jsxRuntimeExports.jsx($e.Item,{label:"Precision",align:"start",children:i.jsxRuntimeExports.jsx(j.Numeric,{value:r.precision??2,bounds:{lower:0,upper:10},onChange:u})}),i.jsxRuntimeExports.jsx($e.Item,{label:"Averaging Window",align:"start",children:i.jsxRuntimeExports.jsx(j.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:d})})]})]})},U1=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsx(G1,{path:""});default:return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,empty:!0,children:[i.jsxRuntimeExports.jsx(zt,{path:"label"}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ue,{path:"color"}),i.jsxRuntimeExports.jsx(ye,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(j.Text$1,{...s})}),i.jsxRuntimeExports.jsx(us,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),i.jsxRuntimeExports.jsx(ye,{path:"level",label:"Value Size",hideIfNull:!0,padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(Pe.SelectLevel,{...s})})]})]}),i.jsxRuntimeExports.jsx(wt,{path:"",showInner:!1})]})}},[]),t=Ce.useStatic({tabs:qa,content:e});return i.jsxRuntimeExports.jsx(Ce.Tabs,{...t})},Q1=({path:e})=>{var c;const{value:t,onChange:n}=at({path:e}),s=$.sourcePipelinePropsZ.parse((c=t.source)==null?void 0:c.props),o=$.streamChannelValuePropsZ.parse(s.segments.valueStream.props),r=a=>{a??(a=0);const u=$.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:$.streamChannelValue({channel:a}),threshold:$.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:u})},l=ls(o.channel);return g.useEffect(()=>n({...t}),[l]),i.jsxRuntimeExports.jsx(Ie,{direction:"x",align:"stretch",children:i.jsxRuntimeExports.jsx($e.Item,{label:"Input Channel",grow:!0,children:i.jsxRuntimeExports.jsx(lt,{value:o.channel,onChange:r})})})},J1=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsx(Q1,{path:""});default:return i.jsxRuntimeExports.jsx(Ee,{})}},[]),t=Ce.useStatic({tabs:qa,content:e});return i.jsxRuntimeExports.jsx(Ce.Tabs,{...t})},eR=({path:e})=>{var l;const{value:t,onChange:n}=at({path:e}),s=$.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),o=$.setChannelValuePropsZ.parse(s.segments.setter.props),r=c=>{c??(c=0);const a=$.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:$.setChannelValue({channel:c}),setpoint:$.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),u=$.authoritySource({channel:c}),d=$.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:u},showIndicator:!0,indicator:{statusSource:u}}})};return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",children:[i.jsxRuntimeExports.jsx($e.Item,{label:"Output Channel",grow:!0,children:i.jsxRuntimeExports.jsx(lt,{value:o.channel,onChange:r})}),i.jsxRuntimeExports.jsx(us,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),i.jsxRuntimeExports.jsx(Do,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},tR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(eR,{path:""});default:return i.jsxRuntimeExports.jsx(Ee,{omit:["align","maxInlineSize"]})}},[]),t=Ce.useStatic({tabs:cr,content:e});return i.jsxRuntimeExports.jsx(Ce.Tabs,{...t})},nR=({path:e})=>{var u,d;const{value:t,onChange:n}=at({path:e}),s=$.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=$.sinkPipelinePropsZ.parse((d=t.sink)==null?void 0:d.props),r=$.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=$.setChannelValuePropsZ.parse(o.segments.setter.props),c=x=>{x??(x=0);const p=$.sourcePipeline("number",{connections:[],segments:{valueStream:$.streamChannelValue({channel:x})},outlet:"valueStream"});n({...t,source:p})},a=x=>{x??(x=0);const p=$.sinkPipeline("number",{connections:[],segments:{setter:$.setChannelValue({channel:x})},inlet:"setter"}),m=$.authoritySource({channel:x}),h=$.acquireChannelControl({channel:x,authority:255});n({...t,sink:p,control:{...t.control,showChip:!0,chip:{sink:h,source:m},showIndicator:!0,indicator:{statusSource:m}}})};return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",grow:!0,align:"stretch",children:[i.jsxRuntimeExports.jsx($e.Item,{label:"State Channel",grow:!0,children:i.jsxRuntimeExports.jsx(lt,{value:r.channel,onChange:c})}),i.jsxRuntimeExports.jsx($e.Item,{label:"Command Channel",grow:!0,children:i.jsxRuntimeExports.jsx(lt,{value:l.channel,onChange:a})})]})},sR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(nR,{path:""});default:return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsx(zt,{path:"label"}),i.jsxRuntimeExports.jsx(Cl,{path:"units",label:"Units",align:"start",padHelpText:!1}),i.jsxRuntimeExports.jsx(Ue,{path:"color"})]}),i.jsxRuntimeExports.jsx(wt,{path:""})]})}},[]),t=Ce.useStatic({tabs:cr,content:e});return i.jsxRuntimeExports.jsx(Ce.Tabs,{...t})},oR=()=>{const e=at({path:"autoFit",optional:!0});return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(ye,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>i.jsxRuntimeExports.jsx(j.Text$1,{selectOnFocus:!0,...t})}),i.jsxRuntimeExports.jsx(ye,{path:"level",label:"Text Size",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Pe.SelectLevel,{...t})}),i.jsxRuntimeExports.jsx(ye,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>i.jsxRuntimeExports.jsx(Ao,{...t})})]}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ue,{path:"color"}),i.jsxRuntimeExports.jsx(ye,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(j.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:i.jsxRuntimeExports.jsx(j.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:i.jsxRuntimeExports.jsx(j.Qt.AutoFitWidth,{})})})})]})]}),i.jsxRuntimeExports.jsx(wt,{path:""})]})},rR=()=>i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(zt,{path:"label",omit:["maxInlineSize","align"]}),i.jsxRuntimeExports.jsx(Ue,{path:"color"})]}),i.jsxRuntimeExports.jsx(wt,{path:"",showOuter:!1})]}),iR=()=>i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,empty:!0,children:[i.jsxRuntimeExports.jsx(zt,{path:"label"}),i.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ue,{path:"color"}),i.jsxRuntimeExports.jsx(Ue,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(ye,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:e??200,dragScale:pt,bounds:Jt,endContent:"px",...t})}),i.jsxRuntimeExports.jsx(ye,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:e??200,dragScale:pt,bounds:Jt,endContent:"px",...t})})]})]}),i.jsxRuntimeExports.jsx(wt,{path:"",showInner:!1})]}),U=e=>i.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),et=e=>i.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Ye=e=>i.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),fe=e=>i.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),lR={left:{left:q.Left,right:q.Right,top:q.Top,bottom:q.Bottom},right:{left:q.Right,right:q.Left,top:q.Bottom,bottom:q.Top},top:{left:q.Bottom,right:q.Top,top:q.Left,bottom:q.Right},bottom:{left:q.Top,right:q.Bottom,top:q.Right,bottom:q.Left}},cR=(e,t)=>lR[t][e],aR=(e,t=!1)=>{if(t)return e;switch(e){case q.Left:return q.Right;case q.Right:return q.Left;case q.Top:return q.Bottom;case q.Bottom:return q.Top;default:return q.Top}},uR=(e,t,n,s=!1)=>s?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},re=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=e1()}catch{return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{})}const o=g.useRef(null),r=g.useRef(!0);return g.useEffect(()=>{if(o.current==null)return;if(r.current){r.current=!1;return}const l=o.current.closest(".react-flow__node"),c=l==null?void 0:l.getAttribute("data-id");c!=null&&(s==null||s(c))},[t,n]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{ref:o}),e]})},F=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:o,top:r,...l})=>{const c=uR(r,s,t,n);return i.jsxRuntimeExports.jsx(un,{position:aR(cR(e,t),!o),...l,type:"source",onClick:a=>a.stopPropagation(),className:(f.CSS.B("handle"),f.CSS.BE("handle",l.id)),style:{left:`${c.left}%`,top:`${c.top}%`}})},ke=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:o,...r})=>i.jsxRuntimeExports.jsx("button",{className:f.CSS(f.CSS.B("symbol-primitive"),f.CSS.B("symbol-primitive-toggle"),s!=null&&f.CSS.loc(s),t&&f.CSS.M("enabled"),n&&f.CSS.M("triggered"),e),color:f.cssString(o),...r}),he=({className:e,...t})=>i.jsxRuntimeExports.jsx("div",{className:f.CSS(f.CSS.B("symbol-primitive"),e),...t}),dR=.8,de=({dimensions:e,orientation:t="left",children:n,className:s,color:o,style:r={},scale:l=1,...c})=>{e=f.g.construct(t)==="y"?f._.swap(e):e;const u=f.cssString(o),d=j.use();return o!=null&&(r[f.CSS.var("symbol-color")]=new f.Color(o).rgbString,r[f.CSS.var("symbol-color-contrast")]=new f.Color(o).pickByContrast(d.colors.gray.l0,d.colors.gray.l10).rgbString),i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:f._.svgViewBox(e),className:f.CSS(f.CSS.loc(t),s),fill:u,stroke:u,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:f._.scale(e,l*dR).width,...r},children:i.jsxRuntimeExports.jsx("g",{children:n})})},Wa=({className:e,orientation:t,scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,orientation:t,className:f.CSS(f.CSS.B("four-way-valve"),e),children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:87,height:87},color:s,scale:n,children:[i.jsxRuntimeExports.jsx(U,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),i.jsxRuntimeExports.jsx(U,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),Xa=({color:e,orientation:t="left",scale:n,...s})=>i.jsxRuntimeExports.jsxs(ke,{...s,className:f.CSS(f.CSS.B("three-way-valve")),orientation:t,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[i.jsxRuntimeExports.jsx(U,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),i.jsxRuntimeExports.jsx(U,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),Ka=({orientation:e="left",color:t,scale:n,...s})=>i.jsxRuntimeExports.jsxs(ke,{...s,children:[i.jsxRuntimeExports.jsxs(re,{orientation:e,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(de,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:i.jsxRuntimeExports.jsx(U,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),Ga=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ke,{className:f.CSS(f.CSS.B("solenoid-valve"),s&&f.CSS.M("normally-open"),e),...r,children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:87,height:69},color:t,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(U,{className:f.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),i.jsxRuntimeExports.jsx(fe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),i.jsxRuntimeExports.jsx(et,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),Ua=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{orientation:t,className:f.CSS(f.CSS.B("relief-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),i.jsxRuntimeExports.jsx(U,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Qa=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{orientation:t,className:f.CSS(f.CSS.B("check-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(fe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),Ja=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const r=f.cssString(n);return i.jsxRuntimeExports.jsxs(he,{...o,orientation:t,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(Ye,{cx:"7",cy:"7",r:"4",fill:r}),i.jsxRuntimeExports.jsx(U,{d:"M7 39.5V11.5941C7 9.42886 9.22384 7.97669 11.2063 8.84738L76.7937 37.6526C78.7762 38.5233 81 37.0711 81 34.9059V6",strokeLinecap:"round"})]})]})},eu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,orientation:n,className:f.CSS(f.CSS.B("angled-valve"),t),children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),i.jsxRuntimeExports.jsx(U,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"})]})]}),tu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ye,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)})]})]}),nu=({className:e,color:t,orientation:n="left",scale:s,...o})=>{const r=f.cssString(t);return i.jsxRuntimeExports.jsxs(he,{...o,className:f.CSS(f.CSS.B("symbol"),e),children:[i.jsxRuntimeExports.jsx(re,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:5,top:50,id:"1"})}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),i.jsxRuntimeExports.jsx(U,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:r}),i.jsxRuntimeExports.jsx(U,{d:"M33 24H2",strokeLinecap:"round"})]})]})},su=({className:e,color:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{...o,className:f.CSS(f.CSS.B("symbol"),e),children:[i.jsxRuntimeExports.jsx(re,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(et,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),i.jsxRuntimeExports.jsx(U,{d:"M13 68V47C13 46.4477 13.4489 45.9892 13.9928 45.8933C16.1351 45.5152 21 43.7981 21 36C21 28.2019 16.1351 26.4848 13.9928 26.1068C13.4489 26.0108 13 25.5523 13 25V4",strokeWidth:"2"})]})]}),ou=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("cap"),e),...o,children:[i.jsxRuntimeExports.jsx(re,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),i.jsxRuntimeExports.jsx(de,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(U,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),ru=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("cap"),e),...o,children:[i.jsxRuntimeExports.jsx(re,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:50,top:50,id:"1"})}),i.jsxRuntimeExports.jsx(de,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(U,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),iu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("manual-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),i.jsxRuntimeExports.jsx(U,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),lu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("orifice_plate"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{color:n,dimensions:{width:96,height:48},orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(et,{x:"3",y:"3",width:"90",height:"42",rx:"2",ry:"2"}),i.jsxRuntimeExports.jsx(fe,{x1:"33",y1:"3",x2:"33",y2:"21",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"33",y1:"27",x2:"33",y2:"45",strokeLinecap:"round"})]})]}),cu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("filter"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(de,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:i.jsxRuntimeExports.jsx(U,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17"})})]}),au=e=>typeof e=="number"?{topLeft:f.q.construct(e),topRight:f.q.construct(e),bottomLeft:f.q.construct(e),bottomRight:f.q.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:f.q.construct(e.topLeft),topRight:f.q.construct(e.topRight),bottomLeft:f.q.construct(e.bottomLeft),bottomRight:f.q.construct(e.bottomRight)}:e,xR=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:o}=e;return`${t.x}% ${n.x}% ${o.x}% ${s.x}% / ${t.y}% ${n.y}% ${o.y}% ${s.y}%`},uu={width:40,height:80},ar={x:50,y:10},bs=({className:e,dimensions:t=uu,borderRadius:n=ar,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=au(n),a=s==null,u=j.use(),d=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]);return i.jsxRuntimeExports.jsx(he,{className:f.CSS(e,f.CSS.B("tank")),style:{...t,borderRadius:s??xR(c),borderColor:f.cssString(o??u.colors.gray.l9),backgroundColor:r==null?void 0:f.cssString(r)},...l,children:i.jsxRuntimeExports.jsxs(re,{refreshDeps:d,children:[i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:0,id:"1"}),a&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:-.5,top:c.topLeft.y-1,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:101,top:c.topRight.y-1,id:"3"})]}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),a&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:-.5,top:100-c.bottomLeft.y+1,id:"5"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:101,top:100-c.bottomRight.y+1,id:"6"})]}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},du=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(e,f.CSS.B("regulator")),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),i.jsxRuntimeExports.jsx(U,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),i.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),xu=({className:e,orientation:t="left",scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("orifice"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[i.jsxRuntimeExports.jsx(U,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),fu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("needle-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:f.cssString(n)}),i.jsxRuntimeExports.jsx(U,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),pu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{orientation:t,className:f.CSS(f.CSS.B("angled-relief-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:32.8125,top:97.5922,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.0278,top:45.5639,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:64,height:79},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(fe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),i.jsxRuntimeExports.jsx(U,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),mu=({className:e,color:t,dimensions:n,orientation:s,units:o="psi",unitsLevel:r="small",children:l,inlineSize:c=80,...a})=>{const u=f.cssString(t),d=j.use(),x=t==null?"var(--pluto-gray-l0)":f.cssString(new f.Color(t).pickByContrast(d.colors.gray.l0,d.colors.gray.l9)),p=2.5*((n==null?void 0:n.width)??0)/500;return i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("value"),e),...a,style:{borderColor:u,height:n==null?void 0:n.height,width:"100%"},children:[i.jsxRuntimeExports.jsx("div",{className:f.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:c},children:l}),i.jsxRuntimeExports.jsxs(re,{orientation:s,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:-2+p,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:102-p,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),i.jsxRuntimeExports.jsx("div",{className:f.CSS(f.CSS.BE("value","units"),f.CSS.M(r)),style:{background:u},children:i.jsxRuntimeExports.jsx(j.Text,{level:r,color:x,children:o})})]})},hu=({enabled:e=!1,onClick:t,orientation:n="left"})=>i.jsxRuntimeExports.jsxs(he,{orientation:n,children:[i.jsxRuntimeExports.jsx(j.Switch$1,{value:e,onClick:t,onChange:()=>{}}),i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),gu=({onClick:e,orientation:t="left",label:n="",color:s,size:o,level:r,onClickDelay:l})=>i.jsxRuntimeExports.jsxs(he,{orientation:t,children:[i.jsxRuntimeExports.jsx(j.Button,{onClick:e,color:s,size:o,level:r,onClickDelay:l,children:n}),i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:100,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:0,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),ju=({className:e,orientation:t="left",text:n="",width:s,color:o,level:r,autoFit:l,align:c="center"})=>{const a=j.use(),u=f.cssString(o??a.colors.gray.l0),d={borderColor:u,textAlign:c};return f.g.construct(t)==="y"?d.height=l?"fit-content":s:d.width=l?"fit-content":s,i.jsxRuntimeExports.jsx(he,{style:d,orientation:t,className:f.CSS(f.CSS.B("text-box"),f.CSS.loc(t),e),children:i.jsxRuntimeExports.jsx(j.Text,{color:u,level:r,children:n})})},Eu=({orientation:e="left",className:t,onClick:n,children:s,value:o,units:r,color:l,onChange:c,...a})=>{const[u,d]=g.useState(o);return i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("setpoint"),t),orientation:e,...a,children:[i.jsxRuntimeExports.jsxs(re,{orientation:e,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:e,left:1,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:e,left:100,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:e,left:50,top:-2,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),i.jsxRuntimeExports.jsx(j.Numeric,{size:"small",value:u,onChange:d,showDragHandle:!1,selectOnFocus:!0,endContent:r,color:l,style:{[f.CSS.var("pack-border-shade")]:f.cssString(l)},borderWidth:2,children:i.jsxRuntimeExports.jsx(j.Button,{variant:"outlined",size:"small",onClick:()=>c(u),color:l,children:"Set"})})]})},yu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("screw-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ye,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(U,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(U,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:f.CSS(f.CSS.M("detail"),t)})]})]}),Su=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("vacuum-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ye,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(fe,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:f.CSS(f.CSS.M("detail"),t)})]})]}),Ru=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("cavity-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ye,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(U,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:f.CSS(f.CSS.M("detail"),t)})]})]}),wu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("piston-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ye,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(U,{d:"M 23 32, h 16, m 0 -8, v 16",className:f.CSS(f.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Cu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{...o,className:f.CSS(f.CSS.B("static-mixer"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(et,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),i.jsxRuntimeExports.jsx(U,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),vu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("rotary-mixer"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:f.CSS(f.CSS.M("detail"),t)})]})]}),bu=({className:e,color:t,orientation:n="left",enabled:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(he,{...r,orientation:n,className:f.CSS(f.CSS.B("light"),s&&f.CSS.M("enabled"),e),children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),i.jsxRuntimeExports.jsx(de,{dimensions:{width:64,height:64},color:t,orientation:n,scale:o,children:i.jsxRuntimeExports.jsx(Ye,{cx:"32",cy:"32",r:"30"})})]}),_u=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(e,f.CSS.B("regulator")),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:21.5909,top:25,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:12.5,id:"4"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:70/88*100,top:20/80*100,id:"5"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),i.jsxRuntimeExports.jsx(et,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),i.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),ku=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(re,{children:i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:50,top:100,id:"1"})}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M43 1L43 65",strokeLinecap:"round"})]})]}),Pu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(re,{children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:51,top:2,id:"4"})}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),i.jsxRuntimeExports.jsx(U,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),Mu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(re,{children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:2,id:"4"})}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(et,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Nu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ke,{...r,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(re,{children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:2,id:"4"})}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(et,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),i.jsxRuntimeExports.jsx(fe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:f.CSS(f.CSS.M("detail"),e),strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",className:f.CSS(f.CSS.M("detail"),e),strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:f.CSS(f.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),Lu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ke,{...r,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(re,{children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:2,id:"4"})}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(et,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),Tu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ke,{...r,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(re,{children:i.jsxRuntimeExports.jsx(F,{location:"top",left:50,top:2,id:"4",orientation:n})}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(fe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M5.375 36L70.8204 48.7138C74.0584 49.3428 74.0573 53.9765 70.8189 54.6039L14.7952 65.4584C11.5729 66.0827 11.5494 70.6856 14.7651 71.3429L81.5208 84.9873",strokeLinecap:"round"})]})]}),Au=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("compressor"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:1.5,top:41,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:95,top:3,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:68,height:61},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ye,{cx:"35",cy:"25",r:"23"}),i.jsxRuntimeExports.jsx(U,{d:"M50 41.5L56.7186 50.8314C57.6711 52.1544 56.7257 54 55.0955 54H14.9045C13.2743 54 12.3289 52.1544 13.2814 50.8314L20 41.5"}),i.jsxRuntimeExports.jsx(fe,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),i.jsxRuntimeExports.jsx(fe,{x1:"1",y1:"25",x2:"35",y2:"25"})]})]}),$u=({id:e,className:t,orientation:n="right",label:s="text",color:o="black",level:r="p",...l})=>{const c=document.querySelector(`[data-id="${e}"]`);c&&c.classList.add(n);const a=f.g.construct(n)==="y";return i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("arrow"),f.CSS.loc(n),t),orientation:n,...l,children:[i.jsxRuntimeExports.jsx("div",{className:"wrapper",children:i.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:f.cssString(o)},children:i.jsxRuntimeExports.jsx("div",{className:"bg",children:i.jsxRuntimeExports.jsx(j.Text,{level:r,className:f.CSS.BE("symbol","label"),children:s})})})}),i.jsxRuntimeExports.jsxs(re,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:a,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:a,id:"2"})]}),i.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[i.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),i.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),i.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},Iu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("vent"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:64.5833,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:91.6667,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(de,{color:n,dimensions:{width:48,height:32},orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(U,{d:"M31 3 L43 14 Q 45 16 43 18 L31 29",strokeLinecap:"round"})})]}),Ou=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(he,{className:f.CSS(f.CSS.B("iso-filter"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:95,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(et,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),i.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),Bu=({className:e,dimensions:t=uu,borderRadius:n=ar,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=au(n),a=j.use(),u=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]),d=f.cssString(o??a.colors.gray.l9),x=r==null?void 0:f.cssString(r),p=t.width/66,m=t.height/180,h=`scale(${p},${m})`;return i.jsxRuntimeExports.jsxs(he,{className:f.CSS(e,f.CSS.B("cylinder")),style:{...t},...l,children:[i.jsxRuntimeExports.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:h,children:i.jsxRuntimeExports.jsx("path",{d:"M23 33.6712C11.9844 36.0332 3 42.4382 3 52.8862V174.568C3 176.225 4.34315 177.568 6 177.568H60C61.6569 177.568 63 176.225 63 174.568V52.8862C63 36.3342 40.4511 29.9292 23 33.6712ZM23 33.6712V13.3181C23 0.318109 42.9975 0.318123 42.9975 13.3181V33.6712",vectorEffect:"non-scaling-stroke",strokeWidth:"2",stroke:d,transform:h,fill:x})}),i.jsxRuntimeExports.jsxs(re,{refreshDeps:u,children:[i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:2,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"})]})]})},Du=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const r=f.cssString(n);return i.jsxRuntimeExports.jsxs(he,{orientation:t,className:f.CSS(f.CSS.B("spring-loaded-relief-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M46.3625 54.1079C45.6312 54.4779 45.6311 55.5223 46.3624 55.8924L81.7435 73.7989C83.7389 74.8088 86.098 73.3588 86.0982 71.1224L86.1002 38.883C86.1003 36.6465 83.7414 35.1962 81.7458 36.2059L46.3625 54.1079Z",stroke:r}),i.jsxRuntimeExports.jsx(U,{d:"M71 38.0014V72.0014",stroke:r,strokeWidth:4,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(U,{d:"M41.6389 55.8923C42.3702 55.5222 42.3702 54.4778 41.6389 54.1077L6.2567 36.2035C4.26118 35.1937 1.90217 36.6438 1.90217 38.8803L1.90217 71.1197C1.90217 73.3562 4.26119 74.8063 6.2567 73.7965L41.6389 55.8923Z",stroke:r}),i.jsxRuntimeExports.jsx(Ye,{cx:"44",cy:"55",r:"4",fill:r}),i.jsxRuntimeExports.jsx(U,{d:"M45 4C45 3.44772 44.5523 3 44 3C43.4477 3 43 3.44772 43 4H45ZM37.5777 24.7889L38.0249 23.8944L37.5777 24.7889ZM37.5777 21.2111L38.0249 22.1056L37.5777 21.2111ZM50.4223 31.2111L49.9751 32.1056L50.4223 31.2111ZM37.5777 44.7889L37.1305 45.6833L37.5777 44.7889ZM37.5777 41.2111L37.1305 40.3167L37.5777 41.2111ZM42.8944 47.4472L42.4472 48.3416L42.8944 47.4472ZM45 52V49.2361H43V52H45ZM43.3416 46.5528L38.0249 43.8944L37.1305 45.6833L42.4472 48.3416L43.3416 46.5528ZM38.0249 42.1056L50.8695 35.6833L49.9751 33.8944L37.1305 40.3167L38.0249 42.1056ZM50.8695 30.3167L38.0249 23.8944L37.1305 25.6833L49.9751 32.1056L50.8695 30.3167ZM38.0249 22.1056L50.8695 15.6833L49.9751 13.8944L37.1305 20.3167L38.0249 22.1056ZM50.8695 10.3167L45.5528 7.65836L44.6584 9.44721L49.9751 12.1056L50.8695 10.3167ZM45 6.76393V4H43V6.76393H45ZM45.5528 7.65836C45.214 7.48897 45 7.1427 45 6.76393H43C43 7.90025 43.642 8.93904 44.6584 9.44721L45.5528 7.65836ZM50.8695 15.6833C53.0806 14.5777 53.0807 11.4223 50.8695 10.3167L49.9751 12.1056C50.7121 12.4741 50.7121 13.5259 49.9751 13.8944L50.8695 15.6833ZM38.0249 23.8944C37.2879 23.5259 37.2879 22.4741 38.0249 22.1056L37.1305 20.3167C34.9193 21.4223 34.9194 24.5777 37.1305 25.6833L38.0249 23.8944ZM50.8695 35.6833C53.0806 34.5777 53.0807 31.4223 50.8695 30.3167L49.9751 32.1056C50.7121 32.4741 50.7121 33.5259 49.9751 33.8944L50.8695 35.6833ZM38.0249 43.8944C37.2879 43.5259 37.2879 42.4741 38.0249 42.1056L37.1305 40.3167C34.9193 41.4223 34.9194 44.5777 37.1305 45.6833L38.0249 43.8944ZM45 49.2361C45 48.0998 44.358 47.061 43.3416 46.5528L42.4472 48.3416C42.786 48.511 43 48.8573 43 49.2361H45Z",fill:r,strokeWidth:1})]})]})},zu=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const r=f.cssString(n);return i.jsxRuntimeExports.jsxs(he,{orientation:t,className:f.CSS(f.CSS.B("spring-loaded-relief-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(re,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),i.jsxRuntimeExports.jsxs(de,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(U,{d:"M23.3625 55.6237C22.6312 55.9937 22.6311 57.0381 23.3624 57.4082L58.7435 75.3147C60.7389 76.3246 63.098 74.8747 63.0981 72.6382L63.1001 40.3988C63.1003 38.1624 60.7414 36.7121 58.7458 37.7217L23.3625 55.6237Z"}),i.jsxRuntimeExports.jsx(U,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),i.jsxRuntimeExports.jsx(U,{d:"M21.8923 58.4348C21.5222 57.7035 20.4778 57.7035 20.1077 58.4348L2.20349 93.817C1.19372 95.8125 2.64384 98.1715 4.8803 98.1715H37.1197C39.3562 98.1715 40.8063 95.8125 39.7965 93.817L21.8923 58.4348Z"}),i.jsxRuntimeExports.jsx(Ye,{cx:"21",cy:"56.0737",r:"4",fill:r}),i.jsxRuntimeExports.jsx(U,{d:"M21 53.0105V50.0225C21 49.3397 20.6516 48.704 20.0759 48.3366L15.6419 45.507C14.4098 44.7207 14.4098 42.9214 15.6419 42.1351L26.3581 35.2965C27.5902 34.5102 27.5902 32.7109 26.3581 31.9246L15.6419 25.0859C14.4098 24.2997 14.4098 22.5003 15.6419 21.714L26.3581 14.8754C27.5902 14.0891 27.5902 12.2898 26.3581 11.5035L21.9241 8.67393C21.3484 8.30656 21 7.67087 21 6.98798V4",stroke:r,"stroke-linecap":"round"})]})]})},fR=({aetherKey:e,sink:t})=>{const n=j.useMemoDeepEqualProps({sink:t}),[,,s]=j.use$3({aetherKey:e,type:$.Button.TYPE,schema:$.buttonStateZ,initialState:{trigger:0,sink:t}});return g.useEffect(()=>{s(r=>({...r,...n}))},[n]),{click:g.useCallback(()=>{s(r=>({...r,trigger:r.trigger+1}))},[s])}},pR=({aetherKey:e,source:t})=>{const n=j.useMemoDeepEqualProps({source:t}),[,{enabled:s},o]=j.use$3({aetherKey:e,type:$.Light.TYPE,schema:$.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>o(r=>({...r,...n})),[n,o]),{enabled:s}},ie=g.forwardRef(({label:e="",onChange:t,level:n="p",children:s,orientation:o="top",style:r,className:l,maxInlineSize:c=150,...a},u)=>i.jsxRuntimeExports.jsxs(te.Space,{style:{marginRight:o==="right"?1:0,marginTop:o==="top"?1:0,...r},size:2/3,direction:o,ref:u,className:f.CSS(f.CSS.B("symbol"),l),align:"center",justify:"center",...a,children:[e.length>0&&i.jsxRuntimeExports.jsx(j.Editable,{className:f.CSS.BE("symbol","label"),value:e,style:{maxInlineSize:c},onChange:g.useCallback(d=>t({label:{label:d,level:n,orientation:o}}),[t,n]),level:n}),s]}));ie.displayName="Labeled";const mR=({aetherKey:e,source:t,sink:n})=>{const s=j.useMemoDeepEqualProps({source:t,sink:n}),[,{value:o},r]=j.use$3({aetherKey:e,type:$.Setpoint.TYPE,schema:$.setpointStateZ,initialState:{trigger:0,value:0,...s}});return g.useEffect(()=>{r(c=>({...c,...s}))},[s,r]),{set:g.useCallback(c=>r(a=>({...a,trigger:a.trigger+1,command:c})),[r]),value:o}},be=({aetherKey:e,source:t,sink:n})=>{const s=j.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:o,enabled:r},l]=j.use$3({aetherKey:e,type:$.Toggle.TYPE,schema:$.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return g.useEffect(()=>{l(a=>({...a,...s}))},[s,l]),{toggle:g.useCallback(()=>l(a=>({...a,triggered:!a.triggered})),[l]),triggered:o,enabled:r}},hR=$.Value.z.partial({color:!0}).extend({level:Z.levelZ.optional()}),Vu=({aetherKey:e,box:t,telem:n,color:s,precision:o,minWidth:r,level:l="small",notation:c})=>{const a=j.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:o,level:l,minWidth:r,notation:c}),[,u,d]=j.use$3({aetherKey:e,type:$.Value.TYPE,schema:$.Value.z,initialState:a});return g.useEffect(()=>d(x=>({...x,...a})),[a]),{width:u.width??u.minWidth}},gR=Object.freeze(Object.defineProperty({__proto__:null,corePropsZ:hR,use:Vu},Symbol.toStringTag,{value:"Module"})),Fu=e=>f.g.construct(e)==="x"?f.J.swap(e):e,jR=e=>f.g.construct(e)==="y"?f.J.swap(e):e,Re=({showChip:e=!0,showIndicator:t=!0,indicator:n,orientation:s="left",chip:o,children:r,show:l=!0,...c})=>i.jsxRuntimeExports.jsxs(te.Space,{direction:f.J.rotate90(s),align:"center",justify:"center",empty:!0,...c,children:[i.jsxRuntimeExports.jsxs(te.Space,{direction:f.g.construct(s),align:"center",className:f.CSS(f.CSS.B("control-state")),size:"small",children:[l&&e&&i.jsxRuntimeExports.jsx(Fl,{size:"small",...o}),l&&t&&i.jsxRuntimeExports.jsx(Yl,{...n})]}),r]}),Hu=j.wrap$1("ThreeWayValve",({aetherKey:e,label:t,onChange:n,control:s,source:o,sink:r,orientation:l="left",...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:o,sink:r});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:n,children:i.jsxRuntimeExports.jsx(Re,{...s,orientation:Fu(l),children:i.jsxRuntimeExports.jsx(Xa,{enabled:a,triggered:u,onClick:d,orientation:l,...c})})})}),Zu=e=>i.jsxRuntimeExports.jsx(Xa,{...e}),Yu=j.wrap$1("Valve",({control:e,aetherKey:t,label:n,onChange:s,source:o,sink:r,orientation:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:t,source:o,sink:r});return i.jsxRuntimeExports.jsx(ie,{...n,onChange:s,children:i.jsxRuntimeExports.jsx(Re,{...e,orientation:l,children:i.jsxRuntimeExports.jsx(Ka,{enabled:a,triggered:u,onClick:d,orientation:l,...c})})})}),qu=e=>i.jsxRuntimeExports.jsx(Ka,{...e}),Wu=j.wrap$1("SolenoidValve",({aetherKey:e,label:t,onChange:n,orientation:s="left",normallyOpen:o,source:r,sink:l,control:c,...a})=>{const{enabled:u,triggered:d,toggle:x}=be({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:n,children:i.jsxRuntimeExports.jsx(Re,{...c,orientation:jR(s),children:i.jsxRuntimeExports.jsx(Ga,{enabled:u,triggered:d,onClick:x,orientation:s,normallyOpen:o,...a})})})}),Xu=e=>i.jsxRuntimeExports.jsx(Ga,{...e}),Ku=j.wrap$1("FourWayValve",({aetherKey:e,control:t,label:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...n,onChange:s,children:i.jsxRuntimeExports.jsx(Re,{...t,orientation:o,children:i.jsxRuntimeExports.jsx(Wa,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Gu=e=>i.jsxRuntimeExports.jsx(Wa,{...e}),Uu=j.wrap$1("AngleValve",({aetherKey:e,label:t,control:n,onChange:s,orientation:o="left",source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(Re,{...n,orientation:Fu(o),children:i.jsxRuntimeExports.jsx(eu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Qu=e=>i.jsxRuntimeExports.jsx(eu,{...e}),Ju=j.wrap$1("Pump",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(Re,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(tu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),ed=e=>i.jsxRuntimeExports.jsx(tu,{...e}),td=({backgroundColor:e,label:t,onChange:n,orientation:s,color:o,dimensions:r,borderRadius:l})=>i.jsxRuntimeExports.jsx(ie,{...t,onChange:n,children:i.jsxRuntimeExports.jsx(bs,{onResize:c=>n({dimensions:c}),orientation:s,color:o,dimensions:r,borderRadius:l,backgroundColor:e})}),nd=e=>i.jsxRuntimeExports.jsx(bs,{...e,dimensions:{width:25,height:50}}),sd=({backgroundColor:e,borderRadius:t,label:n,onChange:s,orientation:o,color:r,dimensions:l})=>i.jsxRuntimeExports.jsx(ie,{...n,onChange:s,children:i.jsxRuntimeExports.jsx(bs,{onResize:c=>s({dimensions:c}),orientation:o,color:r,dimensions:l,boxBorderRadius:t,backgroundColor:e})}),od=e=>i.jsxRuntimeExports.jsx(bs,{...e,dimensions:{width:25,height:50},borderRadius:0}),rd=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(Ua,{...s})}),id=e=>i.jsxRuntimeExports.jsx(Ua,{...e}),ld=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(Du,{...s})}),cd=e=>i.jsxRuntimeExports.jsx(Du,{...e}),ad=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(zu,{...s})}),ud=e=>i.jsxRuntimeExports.jsx(zu,{...e}),dd=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(du,{...s})}),xd=e=>i.jsxRuntimeExports.jsx(du,{...e}),fd=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(_u,{...s})}),pd=e=>i.jsxRuntimeExports.jsx(_u,{...e}),md=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(nu,{...s})}),hd=e=>i.jsxRuntimeExports.jsx(nu,{...e}),gd=({label:e,aetherKey:t,onChange:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:n,children:i.jsxRuntimeExports.jsx(ou,{...s})}),jd=e=>i.jsxRuntimeExports.jsx(ou,{...e}),Ed=({label:e,aetherKey:t,onChange:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:n,children:i.jsxRuntimeExports.jsx(ru,{...s})}),yd=e=>i.jsxRuntimeExports.jsx(ru,{...e}),Sd=({label:e,aetherKey:t,onChange:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:n,children:i.jsxRuntimeExports.jsx(iu,{...s})}),Rd=e=>i.jsxRuntimeExports.jsx(iu,{...e}),wd=j.wrap$1("Setpoint",({label:e,aetherKey:t,orientation:n,control:s,units:o,source:r,sink:l,color:c,onChange:a})=>{const{value:u,set:d}=mR({aetherKey:t,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...e,onChange:a,children:i.jsxRuntimeExports.jsx(Re,{...s,className:f.CSS.B("symbol"),orientation:n,children:i.jsxRuntimeExports.jsx(Eu,{value:u,onChange:d,units:o,color:c,orientation:n})})})}),Cd=e=>i.jsxRuntimeExports.jsx(Eu,{value:12,onChange:()=>{},units:"mV",...e,children:i.jsxRuntimeExports.jsx(j.Text,{level:"p",children:"10.0"})}),vd=({label:e,aetherKey:t,onChange:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:n,children:i.jsxRuntimeExports.jsx(cu,{...s})}),bd=e=>i.jsxRuntimeExports.jsx(cu,{...e}),_d=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(fu,{...s})}),kd=e=>i.jsxRuntimeExports.jsx(fu,{...e}),Pd=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(Qa,{...s})}),Md=e=>i.jsxRuntimeExports.jsx(Qa,{...e}),Nd=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(Ja,{...s})}),Ld=e=>i.jsxRuntimeExports.jsx(Ja,{...e}),Td=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(xu,{...s})}),Ad=e=>i.jsxRuntimeExports.jsx(xu,{...e}),$d=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(pu,{...s})}),Id=e=>i.jsxRuntimeExports.jsx(pu,{...e}),Od=j.wrap$1("Value",({aetherKey:e,label:t,level:n="p",position:s,className:o,textColor:r,color:l,telem:c,units:a,onChange:u,tooltip:d,inlineSize:x,notation:p})=>{const m=j.useTypography(n),[h,E]=g.useState({outerBox:f.Eo.ZERO,labelDims:f._.ZERO}),v=dt(),w=(m.lineHeight+.5)*m.baseSize+2,_=j.useResize(g.useCallback(C=>{const P=document.querySelector(`.react-flow__node[data-id="${e}"] .pluto-symbol__label`);if(P==null)return;const b=f._.scale(f.Eo.dims(f.Eo.construct(P)),1/(ER*v.getZoom()));E({outerBox:C,labelDims:b})},[]),{}),S=yR({labelOrientation:(t==null?void 0:t.orientation)??"top",hasLabel:(t==null?void 0:t.label)!=null&&(t==null?void 0:t.label.length)>0,valueBoxHeight:w,position:s,...h}),{width:y}=Vu({aetherKey:e,color:r,level:n,box:S,telem:c,minWidth:x,notation:p});return i.jsxRuntimeExports.jsxs(j.Dialog$1,{location:{y:"top"},hide:d==null||d.length===0,children:[i.jsxRuntimeExports.jsx(te.Space,{direction:"y",children:d==null?void 0:d.map((C,P)=>i.jsxRuntimeExports.jsx(j.Text,{level:"small",children:C},P))}),i.jsxRuntimeExports.jsx(ie,{className:f.CSS(o,f.CSS.B("value-labeled")),ref:_,onChange:u,...t,children:i.jsxRuntimeExports.jsx(mu,{color:l,dimensions:{height:w,width:y},inlineSize:x,units:a,unitsLevel:Z.downLevel(n)})})]})}),ER=.9,yR=({labelOrientation:e,outerBox:t,labelDims:n,valueBoxHeight:s,position:o,hasLabel:r})=>(f.g.construct(e)==="x"&&(o=f.q.translate(o,"y",Math.max((n.height-s)/2-1,1))),r&&e==="left"?o=f.q.translate(o,{x:n.width+6,y:0}):r&&e==="top"&&(o=f.q.translate(o,"y",n.height+6)),f.Eo.construct(o.x,o.y,f.Eo.width(t),s)),Bd=({color:e})=>i.jsxRuntimeExports.jsx(mu,{color:e,dimensions:{width:60,height:25},units:"psi",children:i.jsxRuntimeExports.jsx(j.Text,{level:"p",children:"50.00"})}),Dd=j.wrap$1("Switch",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(Re,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(hu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),zd=e=>i.jsxRuntimeExports.jsx(hu,{...e}),Vd=j.wrap$1("Button",({aetherKey:e,label:t,orientation:n,sink:s,control:o,...r})=>{const{click:l}=fR({aetherKey:e,sink:s});return i.jsxRuntimeExports.jsx(Re,{...o,className:f.CSS.B("symbol"),orientation:n,children:i.jsxRuntimeExports.jsx(gu,{...t,onClick:l,...r})})}),Fd=({label:e,...t})=>i.jsxRuntimeExports.jsx(gu,{label:"Button",...t}),Hd=j.wrap$1("screwPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(Re,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(yu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Zd=e=>i.jsxRuntimeExports.jsx(yu,{...e}),Yd=j.wrap$1("vacuumPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(Re,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(Su,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),qd=e=>i.jsxRuntimeExports.jsx(Su,{...e}),Wd=j.wrap$1("progressiveCavityPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(Re,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(Ru,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Xd=e=>i.jsxRuntimeExports.jsx(Ru,{...e}),Kd=j.wrap$1("pistonPump",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(Re,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(wu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),Gd=e=>i.jsxRuntimeExports.jsx(wu,{...e}),Ud=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(Cu,{...s})}),Qd=e=>i.jsxRuntimeExports.jsx(Cu,{...e}),Jd=j.wrap$1("rotaryMixer",({aetherKey:e,label:t,control:n,onChange:s,orientation:o,source:r,sink:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:r,sink:l});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(Re,{...n,orientation:o,children:i.jsxRuntimeExports.jsx(vu,{enabled:a,triggered:u,onClick:d,orientation:o,...c})})})}),ex=e=>i.jsxRuntimeExports.jsx(vu,{...e}),tx=j.wrap$1("light",({aetherKey:e,label:t,source:n,onChange:s,...o})=>{const{enabled:r}=pR({aetherKey:e,source:n});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:s,children:i.jsxRuntimeExports.jsx(bu,{enabled:r,...o})})}),nx=e=>i.jsxRuntimeExports.jsx(bu,{...e}),sx=j.wrap$1("agitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(Re,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(ku,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),ox=e=>i.jsxRuntimeExports.jsx(ku,{...e}),rx=j.wrap$1("propellerAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(Re,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(Pu,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),ix=e=>i.jsxRuntimeExports.jsx(Pu,{...e}),lx=j.wrap$1("flatBladeAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(Re,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(Mu,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),cx=e=>i.jsxRuntimeExports.jsx(Mu,{...e}),ax=j.wrap$1("paddleAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(Re,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(Nu,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),ux=e=>i.jsxRuntimeExports.jsx(Nu,{...e}),dx=j.wrap$1("crossBeamAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(Re,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(Lu,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),xx=e=>i.jsxRuntimeExports.jsx(Lu,{...e}),fx=j.wrap$1("helicalAgitator",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(Re,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(Tu,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),px=e=>i.jsxRuntimeExports.jsx(Tu,{...e}),mx=j.wrap$1("compressor",({aetherKey:e,label:t,orientation:n="left",source:s,sink:o,onChange:r,control:l,...c})=>{const{enabled:a,triggered:u,toggle:d}=be({aetherKey:e,source:s,sink:o});return i.jsxRuntimeExports.jsx(ie,{...t,onChange:r,children:i.jsxRuntimeExports.jsx(Re,{orientation:n,...l,children:i.jsxRuntimeExports.jsx(Au,{enabled:a,orientation:n,triggered:u,onClick:d,...c})})})}),hx=e=>i.jsxRuntimeExports.jsx(Au,{...e}),gx=e=>i.jsxRuntimeExports.jsx(ju,{...e}),jx=({level:e="p",width:t=100,...n})=>i.jsxRuntimeExports.jsx(ju,{className:f.CSS.B("symbol"),level:e,width:t,...n}),Ex=({label:e,aetherKey:t,onChange:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:n,children:i.jsxRuntimeExports.jsx(Iu,{...s})}),yx=e=>i.jsxRuntimeExports.jsx(Iu,{...e}),Sx=({label:{label:e,level:t},aetherKey:n,position:s,...o})=>i.jsxRuntimeExports.jsx($u,{label:e,level:t,...o,className:f.CSS.B("symbol")}),Rx=({label:e,...t})=>i.jsxRuntimeExports.jsx($u,{label:"Off Page",...t,orientation:"right"}),wx=({label:e,aetherKey:t,onChange:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:n,children:i.jsxRuntimeExports.jsx(lu,{...s})}),Cx=e=>i.jsxRuntimeExports.jsx(lu,{...e}),vx=({label:e,aetherKey:t,onChange:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:n,children:i.jsxRuntimeExports.jsx(Ou,{...s})}),bx=e=>i.jsxRuntimeExports.jsx(Ou,{...e}),_x=({backgroundColor:e,label:t,onChange:n,orientation:s,color:o,dimensions:r,borderRadius:l})=>i.jsxRuntimeExports.jsx(ie,{...t,onChange:n,children:i.jsxRuntimeExports.jsx(Bu,{onResize:c=>n({dimensions:c}),orientation:s,color:o,dimensions:r,borderRadius:l,backgroundColor:e})}),kx=e=>i.jsxRuntimeExports.jsx(Bu,{...e,dimensions:{width:25,height:50}}),Px=({label:e,onChange:t,aetherKey:n,...s})=>i.jsxRuntimeExports.jsx(ie,{...e,onChange:t,children:i.jsxRuntimeExports.jsx(su,{...s})}),Mx=e=>i.jsxRuntimeExports.jsx(su,{...e}),le=4,ur=2,SR=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","compressor","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","fourWayValve","helicalAgitator","isoCap","isoCheckValve","isoFilter","light","manualValve","needleValve","orifice","orificePlate","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","springLoadedReliefValve","staticMixer","switch","tank","textBox","threeWayValve","vacuumPump","value","valve","vent"],RR=ue.z.enum(SR),me={orientation:"left",scale:1},wR={...me,source:$.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:$.streamChannelValue({channel:0}),rollingAverage:$.rollingAverage({windowSize:1}),stringifier:$.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},CR={...me,source:$.sourcePipeline("number",{connections:[],segments:{valueStream:$.streamChannelValue({channel:0})},outlet:"valueStream"})},vR={...me,sink:$.sinkPipeline("number",{connections:[],segments:{setter:$.setChannelValue({channel:0})},inlet:"setter"})},Nx={...me,source:$.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:$.streamChannelValue({channel:0}),threshold:$.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},Lx={...me,control:{show:!0},sink:$.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:$.setChannelValue({channel:0}),setpoint:$.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},_e={...Nx,...Lx},se=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center"}}),bR={width:125,height:200},dr={dimensions:bR},_R=3,kR={name:"Three Way Valve",key:"threeWayValve",Form:ve,Symbol:Hu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Three Way Valve"),..._e}),Preview:Zu,zIndex:le},PR={name:"Valve",key:"valve",Form:ve,Symbol:Yu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Valve"),..._e}),Preview:qu,zIndex:le},MR={name:"Solenoid Valve",key:"solenoidValve",Form:ve,Symbol:Wu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Solenoid Valve"),normallyOpen:!1,..._e}),Preview:Xu,zIndex:le},NR={name:"Four Way Valve",key:"fourWayValve",Form:ve,Symbol:Ku,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Four Way Valve"),..._e}),Preview:Gu,zIndex:le},LR={name:"Angled Valve",key:"angledValve",Form:ve,Symbol:Uu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Angled Valve"),..._e}),Preview:Qu,zIndex:le},TR={name:"Pump",key:"pump",Form:ve,Symbol:Ju,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Pump"),..._e}),Preview:ed,zIndex:le},AR={name:"Screw Pump",key:"screwPump",Form:ve,Symbol:Hd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Screw Pump"),..._e}),Preview:Zd,zIndex:le},$R={name:"Tank",key:"tank",Form:Ya,Symbol:td,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...se("Tank"),borderRadius:ar,...dr,...me}),Preview:nd,zIndex:ur},IR={name:"Cylinder",key:"cylinder",Form:iR,Symbol:_x,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...se("cylinder"),dimensions:{width:66,height:181},...me}),Preview:kx,zIndex:ur},OR={name:"Box",key:"box",Form:()=>Ya({includeBorderRadius:!0}),Symbol:sd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...se("Box"),borderRadius:_R,...dr,...me}),Preview:od,zIndex:ur},BR={name:"Relief Valve",key:"reliefValve",Form:Ee,Symbol:rd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Relief Valve"),...me}),Preview:id,zIndex:le},DR={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:Ee,Symbol:ld,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Spring Loaded Relief Valve"),...me}),Preview:cd,zIndex:le},zR={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:Ee,Symbol:ad,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Angled Spring Loaded Relief Valve"),...me}),Preview:ud,zIndex:le},VR={name:"Regulator",key:"regulator",Form:Ee,Symbol:dd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Regulator"),...me}),Preview:xd,zIndex:le},FR={name:"Electric Regulator",key:"electricRegulator",Form:Ee,Symbol:fd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Electric Regulator"),...me}),Preview:pd,zIndex:le},HR={name:"Burst Disc",key:"burstDisc",Form:Ee,Symbol:md,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Burst Disc"),...me}),Preview:hd,zIndex:le},ZR={name:"ISO Burst Disc",key:"isoBurstDisc",Form:Ee,Symbol:Px,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("ISO Burst Disc"),...me}),Preview:Mx,zIndex:le},YR={name:"Cap",key:"cap",Form:Ee,Symbol:gd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Cap"),...me}),Preview:jd,zIndex:le},qR={name:"ISO Cap",key:"isoCap",Form:Ee,Symbol:Ed,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("ISO Cap"),...me}),Preview:yd,zIndex:le},WR={name:"Manual Valve",key:"manualValve",Form:Ee,Symbol:Sd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Manual Valve"),...me}),Preview:Rd,zIndex:le},XR={name:"Orifice Plate",key:"orificePlate",Form:Ee,Symbol:wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Orifice Plate"),...me}),Preview:Cx,zIndex:le},KR={name:"ISO Filter",key:"isoFilter",Form:Ee,Symbol:vx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("ISO Filter"),...me}),Preview:bx,zIndex:le},GR={name:"Filter",key:"filter",Form:Ee,Symbol:vd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Filter"),...me}),Preview:bd,zIndex:le},UR={name:"Needle Valve",key:"needleValve",Form:Ee,Symbol:_d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Needle Valve"),...me}),Preview:kd,zIndex:le},QR={name:"Check Valve",key:"checkValve",Form:Ee,Symbol:Pd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Check Valve"),...me}),Preview:Md,zIndex:le},JR={name:"Orifice",key:"orifice",Form:Ee,Symbol:Td,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Orifice"),...me}),Preview:Ad,zIndex:le},e2={name:"Angled Relief Valve",key:"angledReliefValve",Form:Ee,Symbol:$d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Angled Relief Valve"),...me}),Preview:Id,zIndex:le},t2={name:"Value",key:"value",Form:U1,Symbol:Od,Preview:Bd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...se("Value"),...me,telem:wR.source}),zIndex:le},n2={name:"Button",key:"button",Symbol:Vd,Form:tR,Preview:Fd,defaultProps:e=>({color:e.colors.primary.z.rgba255,...se("Button"),...Lx,onClickDelay:0,scale:null}),zIndex:le},s2={name:"Switch",key:"switch",Symbol:Dd,Preview:zd,Form:ve,defaultProps:()=>({...se("Switch"),..._e,scale:null}),zIndex:le},o2={name:"Vacuum Pump",key:"vacuumPump",Symbol:Yd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Vacuum Pump"),..._e}),Preview:qd,zIndex:le},r2={name:"Cavity Pump",key:"cavityPump",Symbol:Wd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Cavity Pump"),..._e}),Preview:Xd,zIndex:le},i2={name:"Piston Pump",key:"pistonPump",Symbol:Kd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Piston Pump"),..._e}),Preview:Gd,zIndex:le},l2={name:"Static Mixer",key:"staticMixer",Symbol:Ud,Form:Ee,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Static Mixer"),...me}),Preview:Qd,zIndex:le},c2={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Jd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Rotary Mixer"),..._e}),Preview:ex,zIndex:le},a2={name:"Light",key:"light",Symbol:tx,Form:J1,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Light"),...Nx}),Preview:nx,zIndex:le},u2={name:"Setpoint",key:"setpoint",Symbol:wd,Form:sR,defaultProps:e=>({units:"mV",color:e.colors.gray.l4.rgba255,...se("Setpoint"),...CR,...vR}),Preview:Cd,zIndex:le},d2={name:"Agitator",key:"agitator",Symbol:sx,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Agitator"),..._e}),Preview:ox,zIndex:le},x2={name:"Propeller Agitator",key:"propellerAgitator",Symbol:rx,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Propeller Agitator"),..._e}),Preview:ix,zIndex:le},f2={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:lx,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Flat Blade Agitator"),..._e}),Preview:cx,zIndex:le},p2={name:"Paddle Agitator",key:"paddleAgitator",Symbol:ax,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Paddle Agitator"),..._e}),Preview:ux,zIndex:le},m2={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:dx,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Cross Beam Agitator"),..._e}),Preview:xx,zIndex:le},h2={name:"Helical Agitator",key:"helicalAgitator",Symbol:fx,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Helical Agitator"),..._e}),Preview:px,zIndex:le},g2={name:"Compressor",key:"compressor",Symbol:mx,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Compressor"),..._e}),Preview:hx,zIndex:le},j2={name:"Text Box",key:"textBox",Symbol:gx,Form:oR,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...se("Text Box"),...me,...dr,level:"p",text:"Text Box",width:75}),Preview:jx,zIndex:le},E2={name:"Off Page Reference",key:"offPageReference",Form:rR,Symbol:Sx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...se("Off Page Reference")}),Preview:Rx,zIndex:le},y2={name:"ISO Check Valve",key:"isoCheckValve",Form:Ee,Symbol:Nd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("ISO Check Valve"),...me}),Preview:Ld,zIndex:le},S2={name:"Vent",key:"vent",Form:Ee,Symbol:Ex,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...se("Vent"),...me}),Preview:yx,zIndex:le},R2={value:t2,button:n2,tank:$R,switch:s2,offPageReference:E2,light:a2,setpoint:u2,box:OR,textBox:j2,valve:PR,solenoidValve:MR,threeWayValve:kR,fourWayValve:NR,angledValve:LR,manualValve:WR,needleValve:UR,reliefValve:BR,angledReliefValve:e2,checkValve:QR,regulator:VR,electricRegulator:FR,pump:TR,pistonPump:i2,screwPump:AR,cavityPump:r2,vacuumPump:o2,staticMixer:l2,rotaryMixer:c2,burstDisc:HR,isoBurstDisc:ZR,cap:YR,isoCap:qR,filter:GR,isoFilter:KR,orifice:JR,orificePlate:XR,agitator:d2,propellerAgitator:x2,flatBladeAgitator:f2,paddleAgitator:p2,crossBeamAgitator:m2,helicalAgitator:h2,compressor:g2,isoCheckValve:y2,vent:S2,cylinder:IR,springLoadedReliefValve:DR,angledSpringLoadedReliefValve:zR},w2=Object.freeze(Object.defineProperty({__proto__:null,Agitator:sx,AgitatorPreview:ox,AngledReliefValve:$d,AngledReliefValvePreview:Id,AngledSpringLoadedReliefValve:ad,AngledSpringLoadedReliefValvePreview:ud,AngledValve:Uu,AngledValvePreview:Qu,Box:sd,BoxPreview:od,BurstDisc:md,BurstDiscPreview:hd,Button:Vd,ButtonPreview:Fd,Cap:gd,CapPreview:jd,CavityPump:Wd,CavityPumpPreview:Xd,CheckValve:Pd,CheckValvePreview:Md,Compressor:mx,CompressorPreview:hx,CrossBeamAgitator:dx,CrossBeamAgitatorPreview:xx,Cylinder:_x,CylinderPreview:kx,ElectricRegulator:fd,ElectricRegulatorPreview:pd,Filter:vd,FilterPreview:bd,FlatBladeAgitator:lx,FlatBladeAgitatorPreview:cx,FourWayValve:Ku,FourWayValvePreview:Gu,HelicalAgitator:fx,HelicalAgitatorPreview:px,ISOBurstDisc:Px,ISOBurstDiscPreview:Mx,ISOCap:Ed,ISOCapPreview:yd,ISOCheckValve:Nd,ISOCheckValvePreview:Ld,ISOFilter:vx,ISOFilterPreview:bx,Light:tx,LightPreview:nx,ManualValve:Sd,ManualValvePreview:Rd,NeedleValve:_d,NeedleValvePreview:kd,OffPageReference:Sx,OffPageReferencePreview:Rx,Orifice:Td,OrificePlate:wx,OrificePlatePreview:Cx,OrificePreview:Ad,PaddleAgitator:ax,PaddleAgitatorPreview:ux,PistonPump:Kd,PistonPumpPreview:Gd,PropellerAgitator:rx,PropellerAgitatorPreview:ix,Pump:Ju,PumpPreview:ed,Regulator:dd,RegulatorPreview:xd,ReliefValve:rd,ReliefValvePreview:id,RotaryMixer:Jd,RotaryMixerPreview:ex,SYMBOLS:R2,ScrewPump:Hd,ScrewPumpPreview:Zd,Setpoint:wd,SetpointPreview:Cd,SolenoidValve:Wu,SolenoidValvePreview:Xu,SpringLoadedReliefValve:ld,SpringLoadedReliefValvePreview:cd,StaticMixer:Ud,StaticMixerPreview:Qd,Switch:Dd,SwitchPreview:zd,Tank:td,TankPreview:nd,TextBox:gx,TextBoxPreview:jx,ThreeWayValve:Hu,ThreeWayValvePreview:Zu,VacuumPump:Yd,VacuumPumpPreview:qd,Value:Od,ValuePreview:Bd,Valve:Yu,ValvePreview:qu,Vent:Ex,VentPreview:yx,typeZ:RR},Symbol.toStringTag,{value:"Module"}));exports.Aether=j.main;exports.Dialog=j.use$4;exports.Divider=j.Divider$1;exports.Dropdown=j.Dropdown;exports.Haul=j.Haul;exports.Worker=j.Context$1;exports.compareArrayDeps=j.compareArrayDeps;exports.componentRenderProp=j.componentRenderProp;exports.isRenderProp=j.isRenderProp;exports.useAsyncEffect=j.useAsyncEffect;exports.useClickOutside=j.useClickOutside;exports.useCombinedRefs=j.useCombinedRefs;exports.useCombinedStateAndRef=j.useCombinedStateAndRef;exports.useDebouncedCallback=j.useDebouncedCallback;exports.useEffectCompare=j.useEffectCompare;exports.useMemoCompare=j.useMemoCompare;exports.useMemoDeepEqualProps=j.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=j.useMemoPrimitiveArray;exports.usePrevious=j.usePrevious;exports.useResize=j.useResize;exports.useStateRef=j.useStateRef;exports.useSyncedRef=j.useSyncedRef;exports.useTransforms=j.useTransforms;exports.CSS=f.CSS;exports.newBEM=f.newBEM;exports.Header=kn.external;exports.DataType=Z.g;exports.Density=Z.b;exports.MultiSeries=Z.Ct;exports.Rate=Z.P;exports.Series=Z.V;exports.TimeRange=Z.E;exports.TimeSpan=Z.y;exports.TimeStamp=Z.m;exports.state=Z.state;exports.Generic=te.Generic;exports.Align=If.external;exports.Icon=Ce.Icon;exports.Tabs=Ce.external;exports.Button=Of.external;exports.Caret=Ti.Animated$1;exports.telem=$.external;exports.Color=wo.external;exports.Text=Pe.external;exports.Triggers=Ai.external;exports.List=$t.external;exports.createFilterTransform=$t.createFilterTransform;exports.fuseFilter=$t.fuseFilter;exports.proxyMemo=$t.proxyMemo;exports.createHexOpacityVariants=$i.createHexOpacityVariants;exports.unitProperty=$i.unitProperty;exports.Input=$e.external;exports.Menu=Df.external;exports.Theming=zf.external;exports.Tree=Vf.external;exports.Video=Ff.Video;exports.Accordion=lp;exports.Breadcrumb=up;exports.Canvas=kp;exports.Channel=Rm;exports.Control=Th;exports.Device=zm;exports.Diagram=V1;exports.Eraser=ph;exports.Form=Om;exports.Label=qm;exports.Legend=Tp;exports.Line=$p;exports.LinePlot=cm;exports.Log=H1;exports.Measure=xm;exports.Modal=Xm;exports.Mosaic=dh;exports.Nav=gh;exports.Note=Eh;exports.OS=Ch;exports.Observe=$m;exports.Override=bh;exports.Pluto=Oh;exports.Portal=sh;exports.Progress=Dh;exports.Range=um;exports.Ranger=qh;exports.Resize=Jf;exports.Rule=fm;exports.Schematic=w2;exports.Select=Gp;exports.Status=Yf;exports.Steps=Xh;exports.Synnax=fp;exports.Tag=Xp;exports.Telem=Ph;exports.Tooltip=qf;exports.Value=gR;exports.Viewport=lm;exports.axis=wp;exports.control=Cp;
|
|
38
|
+
`)),d=u.reduce((x,p)=>x.concat(...p),[]);return[u,d]}return[[],[]]},[e]);return g.useEffect(()=>{const a=(t==null?void 0:t.target)||ji;if(e!==null){const u=p=>{if(o.current=p.ctrlKey||p.metaKey||p.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&jo(p))return!1;const h=Ri(p.code,c);r.current.add(p[h]),Si(l,r.current,!1)&&(p.preventDefault(),s(!0))},d=p=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&jo(p))return!1;const h=Ri(p.code,c);Si(l,r.current,!0)?(s(!1),r.current.clear()):r.current.delete(p[h]),p.key==="Meta"&&r.current.clear(),o.current=!1},x=()=>{r.current.clear(),s(!1)};return a==null||a.addEventListener("keydown",u),a==null||a.addEventListener("keyup",d),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{a==null||a.removeEventListener("keydown",u),a==null||a.removeEventListener("keyup",d),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,s]),n}function Si(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function Ri(e,t){return t.includes(e)?"code":"key"}const TS=()=>{const e=ye();return g.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,o,r],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??o,zoom:t.zoom??r},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},fitView:t=>{const{nodeLookup:n,minZoom:s,maxZoom:o,panZoom:r,domNode:l}=e.getState();if(!r||!l)return Promise.resolve(!1);const c=go(n,t),{width:a,height:u}=vs(l);return yo({nodes:c,width:a,height:u,minZoom:s,maxZoom:o,panZoom:r},t)},setCenter:async(t,n,s)=>{const{width:o,height:r,maxZoom:l,panZoom:c}=e.getState(),a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:l,u=o/2-t*a,d=r/2-n*a;return c?(await c.setViewport({x:u,y:d,zoom:a},{duration:s==null?void 0:s.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:s,height:o,minZoom:r,maxZoom:l,panZoom:c}=e.getState(),a=rr(t,s,o,r,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(a,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:s,snapGrid:o,domNode:r}=e.getState();if(!r)return t;const{x:l,y:c}=r.getBoundingClientRect(),a={x:t.x-l,y:t.y-c};return jn(a,s,n.snapToGrid,o)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:o,y:r}=s.getBoundingClientRect(),l=Kc(t,n);return{x:l.x+o,y:l.y+r}}}),[])};function Ra(e,t){const n=[],s=new Map,o=[];for(const r of e)if(r.type==="add"){o.push(r);continue}else if(r.type==="remove"||r.type==="replace")s.set(r.id,[r]);else{const l=s.get(r.id);l?l.push(r):s.set(r.id,[r])}for(const r of t){const l=s.get(r.id);if(!l){n.push(r);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...r};for(const a of l)AS(a,c);n.push(c)}return o.length&&o.forEach(r=>{r.index!==void 0?n.splice(r.index,0,{...r.item}):n.push({...r.item})}),n}function AS(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Ca(e,t){return Ra(e,t)}function wa(e,t){return Ra(e,t)}function pt(e,t){return{id:e,type:"select",selected:t}}function kt(e,t=new Set,n=!1){const s=[];for(const[o,r]of e){const l=t.has(o);!(r.selected===void 0&&!l)&&r.selected!==l&&(n&&(r.selected=l),s.push(pt(r.id,l)))}return s}function Ci({items:e=[],lookup:t}){var o;const n=[],s=new Map(e.map(r=>[r.id,r]));for(const[r,l]of e.entries()){const c=t.get(l.id),a=((o=c==null?void 0:c.internals)==null?void 0:o.userNode)??c;a!==void 0&&a!==l&&n.push({id:l.id,item:l,type:"replace"}),a===void 0&&n.push({item:l,type:"add",index:r})}for(const[r]of t)s.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function wi(e){return{id:e.id,type:"remove"}}const bi=e=>pj(e),IS=e=>Hc(e);function ba(e){return g.forwardRef(e)}const $S=typeof window<"u"?g.useLayoutEffect:g.useEffect;function vi(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>DS(()=>n(o=>o+BigInt(1))));return $S(()=>{const o=s.get();o.length&&(e(o),s.reset())},[t]),s}function DS(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const va=g.createContext(null);function OS({children:e}){const t=ye(),n=g.useCallback(c=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:d,onNodesChange:x,nodeLookup:p}=t.getState();let m=a;for(const h of c)m=typeof h=="function"?h(m):h;d?u(m):x&&x(Ci({items:m,lookup:p}))},[]),s=vi(n),o=g.useCallback(c=>{const{edges:a=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:x,edgeLookup:p}=t.getState();let m=a;for(const h of c)m=typeof h=="function"?h(m):h;d?u(m):x&&x(Ci({items:m,lookup:p}))},[]),r=vi(o),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:r}),[]);return i.jsxRuntimeExports.jsx(va.Provider,{value:l,children:e})}function zS(){const e=g.useContext(va);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const BS=e=>!!e.panZoom;function wt(){const e=TS(),t=ye(),n=zS(),s=pe(BS),o=g.useMemo(()=>{const r=x=>t.getState().nodeLookup.get(x),l=x=>{n.nodeQueue.push(x)},c=x=>{n.edgeQueue.push(x)},a=x=>{var R,k;const{nodeLookup:p,nodeOrigin:m}=t.getState(),h=bi(x)?x:p.get(x.id),E=h.parentId?Uc(h.position,h.measured,h.parentId,p,m):h.position,w={id:h.id,position:E,width:((R=h.measured)==null?void 0:R.width)??h.width,height:((k=h.measured)==null?void 0:k.height)??h.height,data:h.data};return $t(w)},u=(x,p,m={replace:!1})=>{l(h=>h.map(E=>{if(E.id===x){const w=typeof p=="function"?p(E):p;return m.replace&&bi(w)?w:{...E,...w}}return E}))},d=(x,p,m={replace:!1})=>{c(h=>h.map(E=>{if(E.id===x){const w=typeof p=="function"?p(E):p;return m.replace&&IS(w)?w:{...E,...w}}return E}))};return{getNodes:()=>t.getState().nodes.map(x=>({...x})),getNode:x=>{var p;return(p=r(x))==null?void 0:p.internals.userNode},getInternalNode:r,getEdges:()=>{const{edges:x=[]}=t.getState();return x.map(p=>({...p}))},getEdge:x=>t.getState().edgeLookup.get(x),setNodes:l,setEdges:c,addNodes:x=>{const p=Array.isArray(x)?x:[x];n.nodeQueue.push(m=>[...m,...p])},addEdges:x=>{const p=Array.isArray(x)?x:[x];n.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:x=[],edges:p=[],transform:m}=t.getState(),[h,E,w]=m;return{nodes:x.map(R=>({...R})),edges:p.map(R=>({...R})),viewport:{x:h,y:E,zoom:w}}},deleteElements:async({nodes:x=[],edges:p=[]})=>{const{nodes:m,edges:h,onNodesDelete:E,onEdgesDelete:w,triggerNodeChanges:R,triggerEdgeChanges:k,onDelete:S,onBeforeDelete:j}=t.getState(),{nodes:b,edges:M}=await gj({nodesToRemove:x,edgesToRemove:p,nodes:m,edges:h,onBeforeDelete:j}),v=M.length>0,N=b.length>0;if(v){const L=M.map(wi);w==null||w(M),k(L)}if(N){const L=b.map(wi);E==null||E(b),R(L)}return(N||v)&&(S==null||S({nodes:b,edges:M})),{deletedNodes:b,deletedEdges:M}},getIntersectingNodes:(x,p=!0,m)=>{const h=Jr(x),E=h?x:a(x),w=m!==void 0;return E?(m||t.getState().nodes).filter(R=>{const k=t.getState().nodeLookup.get(R.id);if(k&&!h&&(R.id===x.id||!k.internals.positionAbsolute))return!1;const S=$t(w?R:k),j=un(S,E);return p&&j>0||j>=E.width*E.height}):[]},isNodeIntersecting:(x,p,m=!0)=>{const E=Jr(x)?x:a(x);if(!E)return!1;const w=un(E,p);return m&&w>0||w>=E.width*E.height},updateNode:u,updateNodeData:(x,p,m={replace:!1})=>{u(x,h=>{const E=typeof p=="function"?p(h):p;return m.replace?{...h,data:E}:{...h,data:{...h.data,...E}}},m)},updateEdge:d,updateEdgeData:(x,p,m={replace:!1})=>{d(x,h=>{const E=typeof p=="function"?p(h):p;return m.replace?{...h,data:E}:{...h,data:{...h.data,...E}}},m)},getNodesBounds:x=>{const{nodeLookup:p,nodeOrigin:m}=t.getState();return mj(x,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:x,id:p,nodeId:m})=>{var h;return Array.from(((h=t.getState().connectionLookup.get(`${m}-${x}-${p??null}`))==null?void 0:h.values())??[])}}},[]);return g.useMemo(()=>({...o,...e,viewportInitialized:s}),[s])}const _i=e=>e.selected,VS={actInsideInputWithModifier:!1},FS=typeof window<"u"?window:void 0;function HS({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ye(),{deleteElements:s}=wt(),o=xn(e,VS),r=xn(t,{target:FS});g.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(_i),edges:l.filter(_i)}),n.setState({nodesSelectionActive:!1})}},[o]),g.useEffect(()=>{n.setState({multiSelectionActive:r})},[r])}function ZS(e){const t=ye();g.useEffect(()=>{const n=()=>{var o,r;if(!e.current)return!1;const s=vs(e.current);(s.height===0||s.width===0)&&((r=(o=t.getState()).onError)==null||r.call(o,"004",Te.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Ms={position:"absolute",width:"100%",height:"100%",top:0,left:0},GS=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function YS({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.5,panOnScrollMode:r=gt.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:u,minZoom:d,maxZoom:x,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:E,noPanClassName:w,onViewportChange:R,isControlledViewport:k,paneClickDistance:S}){const j=ye(),b=g.useRef(null),{userSelectionActive:M,lib:v}=pe(GS,Re),N=xn(p),L=g.useRef();ZS(b);const T=g.useCallback(D=>{R==null||R({x:D[0],y:D[1],zoom:D[2]}),k||j.setState({transform:D})},[R,k]);return g.useEffect(()=>{if(b.current){L.current=Kj({domNode:b.current,minZoom:d,maxZoom:x,translateExtent:u,viewport:a,paneClickDistance:S,onDraggingChange:C=>j.setState({paneDragging:C}),onPanZoomStart:(C,I)=>{const{onViewportChangeStart:_,onMoveStart:O}=j.getState();O==null||O(C,I),_==null||_(I)},onPanZoom:(C,I)=>{const{onViewportChange:_,onMove:O}=j.getState();O==null||O(C,I),_==null||_(I)},onPanZoomEnd:(C,I)=>{const{onViewportChangeEnd:_,onMoveEnd:O}=j.getState();O==null||O(C,I),_==null||_(I)}});const{x:D,y:$,zoom:B}=L.current.getViewport();return j.setState({panZoom:L.current,transform:[D,$,B],domNode:b.current.closest(".react-flow")}),()=>{var C;(C=L.current)==null||C.destroy()}}},[]),g.useEffect(()=>{var D;(D=L.current)==null||D.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:o,panOnScrollMode:r,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:N,preventScrolling:m,noPanClassName:w,userSelectionActive:M,noWheelClassName:E,lib:v,onTransformChange:T})},[e,t,n,s,o,r,l,c,N,m,w,M,E,v,T]),i.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:b,style:Ms,children:h})}const WS=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function XS(){const{userSelectionActive:e,userSelectionRect:t}=pe(WS,Re);return e&&t?i.jsxRuntimeExports.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const eo=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},KS=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function qS({isSelecting:e,selectionKeyPressed:t,selectionMode:n=At.Full,panOnDrag:s,selectionOnDrag:o,onSelectionStart:r,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:a,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:x,onPaneMouseLeave:p,children:m}){const h=g.useRef(null),E=ye(),w=g.useRef(0),R=g.useRef(0),k=g.useRef(),S=g.useRef(new Map),{userSelectionActive:j,elementsSelectable:b,dragging:M}=pe(KS,Re),v=b&&(e||j),N=g.useRef(!1),L=g.useRef(!1),T=()=>{E.setState({userSelectionActive:!1,userSelectionRect:null}),w.current=0,R.current=0},D=P=>{if(N.current){N.current=!1;return}c==null||c(P),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},$=P=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){P.preventDefault();return}a==null||a(P)},B=u?P=>u(P):void 0,C=P=>{var K,U,Q,ne;const{resetSelectedElements:z,domNode:V,edgeLookup:Z}=E.getState();if(k.current=V==null?void 0:V.getBoundingClientRect(),!b||!e||P.button!==0||P.target!==h.current||!k.current)return;(U=(K=P.target)==null?void 0:K.setPointerCapture)==null||U.call(K,P.pointerId),L.current=!0,N.current=!1,S.current=new Map;for(const[W,ie]of Z)S.current.set(ie.source,((Q=S.current.get(ie.source))==null?void 0:Q.add(W))||new Set([W])),S.current.set(ie.target,((ne=S.current.get(ie.target))==null?void 0:ne.add(W))||new Set([W]));const{x:Y,y:ee}=Ke(P.nativeEvent,k.current);z(),E.setState({userSelectionRect:{width:0,height:0,startX:Y,startY:ee,x:Y,y:ee}}),r==null||r(P)},I=P=>{const{userSelectionRect:z,edgeLookup:V,transform:Z,nodeLookup:Y,triggerNodeChanges:ee,triggerEdgeChanges:K}=E.getState();if(!k.current||!z)return;N.current=!0;const{x:U,y:Q}=Ke(P.nativeEvent,k.current),{startX:ne,startY:W}=z,ie={startX:ne,startY:W,x:U<ne?U:ne,y:Q<W?Q:W,width:Math.abs(U-ne),height:Math.abs(Q-W)},de=Zc(Y,ie,Z,n===At.Partial,!0),ae=new Set,te=new Set;for(const X of de){te.add(X.id);const se=S.current.get(X.id);if(se)for(const fe of se)ae.add(fe)}if(w.current!==te.size){w.current=te.size;const X=kt(Y,te,!0);ee(X)}if(R.current!==ae.size){R.current=ae.size;const X=kt(V,ae);K(X)}E.setState({userSelectionRect:ie,userSelectionActive:!0,nodesSelectionActive:!1})},_=P=>{var V,Z;if(P.button!==0||!L.current)return;(Z=(V=P.target)==null?void 0:V.releasePointerCapture)==null||Z.call(V,P.pointerId);const{userSelectionRect:z}=E.getState();!j&&z&&P.target===h.current&&(D==null||D(P)),w.current>0&&E.setState({nodesSelectionActive:!0}),T(),l==null||l(P),(t||o)&&(N.current=!1),L.current=!1},O=s===!0||Array.isArray(s)&&s.includes(0);return i.jsxRuntimeExports.jsxs("div",{className:we(["react-flow__pane",{draggable:O,dragging:M,selection:e}]),onClick:v?void 0:eo(D,h),onContextMenu:eo($,h),onWheel:eo(B,h),onPointerEnter:v?void 0:d,onPointerDown:v?C:x,onPointerMove:v?I:x,onPointerUp:v?_:void 0,onPointerLeave:p,ref:h,style:Ms,children:[m,i.jsxRuntimeExports.jsx(XS,{})]})}function vo({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:r,multiSelectionActive:l,nodeLookup:c,onError:a}=t.getState(),u=c.get(e);if(!u){a==null||a("012",Te.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&l)&&(r({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=s==null?void 0:s.current)==null?void 0:d.blur()})):o([e])}function _a({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:o,isSelectable:r,nodeClickDistance:l}){const c=ye(),[a,u]=g.useState(!1),d=g.useRef();return g.useEffect(()=>{d.current=Ij({getStoreItems:()=>c.getState(),onNodeMouseDown:x=>{vo({id:x,store:c,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),g.useEffect(()=>{var x,p;if(t)(x=d.current)==null||x.destroy();else if(e.current)return(p=d.current)==null||p.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:r,nodeId:o,nodeClickDistance:l}),()=>{var m;(m=d.current)==null||m.destroy()}},[n,s,t,r,e,o]),a}const US=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ka(){const e=ye();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:o,snapGrid:r,nodesDraggable:l,onError:c,updateNodePositions:a,nodeLookup:u,nodeOrigin:d}=e.getState(),x=new Map,p=US(l),m=o?r[0]:5,h=o?r[1]:5,E=n.direction.x*m*n.factor,w=n.direction.y*h*n.factor;for(const[,R]of u){if(!p(R))continue;let k={x:R.internals.positionAbsolute.x+E,y:R.internals.positionAbsolute.y+w};o&&(k=bs(k,r));const{position:S,positionAbsolute:j}=Gc({nodeId:R.id,nextPosition:k,nodeLookup:u,nodeExtent:s,nodeOrigin:d,onError:c});R.position=S,R.internals.positionAbsolute=j,x.set(R.id,R)}a(x)},[])}const dr=g.createContext(null),QS=dr.Provider;dr.Consumer;const Ma=()=>g.useContext(dr),JS=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),e0=(e,t,n)=>s=>{const{connectionClickStartHandle:o,connectionMode:r,connection:l}=s,{fromHandle:c,toHandle:a,isValid:u}=l,d=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:d,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:r===St.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,valid:d&&u}};function t0({type:e="source",position:t=G.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:r=!0,id:l,onConnect:c,children:a,className:u,onMouseDown:d,onTouchStart:x,...p},m){var C,I;const h=l||null,E=e==="target",w=ye(),R=Ma(),{connectOnClick:k,noPanClassName:S,rfId:j}=pe(JS,Re),{connectingFrom:b,connectingTo:M,clickConnecting:v,isPossibleEndHandle:N,connectionInProcess:L,valid:T}=pe(e0(R,h,e),Re);R||(I=(C=w.getState()).onError)==null||I.call(C,"010",Te.error010());const D=_=>{const{defaultEdgeOptions:O,onConnect:P,hasDefaultEdges:z}=w.getState(),V={...O,..._};if(z){const{edges:Z,setEdges:Y}=w.getState();Y(oa(V,Z))}P==null||P(V),c==null||c(V)},$=_=>{if(!R)return;const O=Jc(_.nativeEvent);if(o&&(O&&_.button===0||!O)){const P=w.getState();wo.onPointerDown(_.nativeEvent,{autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:E,handleId:h,nodeId:R,flowId:P.rfId,panBy:P.panBy,cancelConnection:P.cancelConnection,onConnectStart:P.onConnectStart,onConnectEnd:P.onConnectEnd,updateConnection:P.updateConnection,onConnect:D,isValidConnection:n||P.isValidConnection,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed})}O?d==null||d(_):x==null||x(_)},B=_=>{const{onClickConnectStart:O,onClickConnectEnd:P,connectionClickStartHandle:z,connectionMode:V,isValidConnection:Z,lib:Y,rfId:ee,nodeLookup:K,connection:U}=w.getState();if(!R||!z&&!o)return;if(!z){O==null||O(_.nativeEvent,{nodeId:R,handleId:h,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:R,type:e,id:h}});return}const Q=Qc(_.target),ne=n||Z,{connection:W,isValid:ie}=wo.isValid(_.nativeEvent,{handle:{nodeId:R,id:h,type:e},connectionMode:V,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:ne,flowId:ee,doc:Q,lib:Y,nodeLookup:K});ie&&W&&D(W);const de=structuredClone(U);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,P==null||P(_,de),w.setState({connectionClickStartHandle:null})};return i.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":R,"data-handlepos":t,"data-id":`${j}-${R}-${h}-${e}`,className:we(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,u,{source:!E,target:E,connectable:s,connectablestart:o,connectableend:r,clickconnecting:v,connectingfrom:b,connectingto:M,valid:T,connectionindicator:s&&(!L||N)&&(L?r:o)}]),onMouseDown:$,onTouchStart:$,onClick:k?B:void 0,ref:m,...p,children:a})}const fn=g.memo(ba(t0));function n0({data:e,isConnectable:t,sourcePosition:n=G.Bottom}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[e==null?void 0:e.label,i.jsxRuntimeExports.jsx(fn,{type:"source",position:n,isConnectable:t})]})}function s0({data:e,isConnectable:t,targetPosition:n=G.Top,sourcePosition:s=G.Bottom}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(fn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,i.jsxRuntimeExports.jsx(fn,{type:"source",position:s,isConnectable:t})]})}function o0(){return null}function r0({data:e,isConnectable:t,targetPosition:n=G.Top}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(fn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const cs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ki={input:n0,default:s0,output:r0,group:o0};function i0(e){var t,n,s,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const l0=e=>{const{width:t,height:n,x:s,y:o}=En(e.nodeLookup,{filter:r=>!!r.selected});return{width:Oe(t)?t:null,height:Oe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${o}px)`}};function c0({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=ye(),{width:o,height:r,transformString:l,userSelectionActive:c}=pe(l0,Re),a=ka(),u=g.useRef(null);if(g.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]),_a({nodeRef:u}),c||!o||!r)return null;const d=e?p=>{const m=s.getState().nodes.filter(h=>h.selected);e(p,m)}:void 0,x=p=>{Object.prototype.hasOwnProperty.call(cs,p.key)&&a({direction:cs[p.key],factor:p.shiftKey?4:1})};return i.jsxRuntimeExports.jsx("div",{className:we(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:i.jsxRuntimeExports.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:o,height:r}})})}const Mi=typeof window<"u"?window:void 0,a0=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Pa({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:d,selectionMode:x,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:h,panActivationKeyCode:E,zoomActivationKeyCode:w,elementsSelectable:R,zoomOnScroll:k,zoomOnPinch:S,panOnScroll:j,panOnScrollSpeed:b,panOnScrollMode:M,zoomOnDoubleClick:v,panOnDrag:N,defaultViewport:L,translateExtent:T,minZoom:D,maxZoom:$,preventScrolling:B,onSelectionContextMenu:C,noWheelClassName:I,noPanClassName:_,disableKeyboardA11y:O,onViewportChange:P,isControlledViewport:z}){const{nodesSelectionActive:V,userSelectionActive:Z}=pe(a0),Y=xn(u,{target:Mi}),ee=xn(E,{target:Mi}),K=ee||N,U=ee||j,Q=d&&K!==!0,ne=Y||Z||Q;return HS({deleteKeyCode:a,multiSelectionKeyCode:h}),i.jsxRuntimeExports.jsx(YS,{onPaneContextMenu:r,elementsSelectable:R,zoomOnScroll:k,zoomOnPinch:S,panOnScroll:U,panOnScrollSpeed:b,panOnScrollMode:M,zoomOnDoubleClick:v,panOnDrag:!Y&&K,defaultViewport:L,translateExtent:T,minZoom:D,maxZoom:$,zoomActivationKeyCode:w,preventScrolling:B,noWheelClassName:I,noPanClassName:_,onViewportChange:P,isControlledViewport:z,paneClickDistance:c,children:i.jsxRuntimeExports.jsxs(qS,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:l,panOnDrag:K,isSelecting:!!ne,selectionMode:x,selectionKeyPressed:Y,selectionOnDrag:Q,children:[e,V&&i.jsxRuntimeExports.jsx(c0,{onSelectionContextMenu:C,noPanClassName:_,disableKeyboardA11y:O})]})})}Pa.displayName="FlowRenderer";const u0=g.memo(Pa),d0=e=>t=>e?Zc(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function x0(e){return pe(g.useCallback(d0(e),[e]),Re)}const f0=e=>e.updateNodeInternals;function p0(){const e=pe(f0),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(o=>{const r=o.target.getAttribute("data-id");s.set(r,{id:r,nodeElement:o.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function m0({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const o=ye(),r=g.useRef(null),l=g.useRef(null),c=g.useRef(e.sourcePosition),a=g.useRef(e.targetPosition),u=g.useRef(t),d=n&&!!e.internals.handleBounds;return g.useEffect(()=>{r.current&&!e.hidden&&(!d||l.current!==r.current)&&(l.current&&(s==null||s.unobserve(l.current)),s==null||s.observe(r.current),l.current=r.current)},[d,e.hidden]),g.useEffect(()=>()=>{l.current&&(s==null||s.unobserve(l.current),l.current=null)},[]),g.useEffect(()=>{if(r.current){const x=u.current!==t,p=c.current!==e.sourcePosition,m=a.current!==e.targetPosition;(x||p||m)&&(u.current=t,c.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:r.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),r}function h0({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:o,onContextMenu:r,onDoubleClick:l,nodesDraggable:c,elementsSelectable:a,nodesConnectable:u,nodesFocusable:d,resizeObserver:x,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:h,rfId:E,nodeTypes:w,nodeExtent:R,nodeClickDistance:k,onError:S}){const{node:j,internals:b,isParent:M}=pe(W=>{const ie=W.nodeLookup.get(e),de=W.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:de}},Re);let v=j.type||"default",N=(w==null?void 0:w[v])||ki[v];N===void 0&&(S==null||S("003",Te.error003(v)),v="default",N=ki.default);const L=!!(j.draggable||c&&typeof j.draggable>"u"),T=!!(j.selectable||a&&typeof j.selectable>"u"),D=!!(j.connectable||u&&typeof j.connectable>"u"),$=!!(j.focusable||d&&typeof j.focusable>"u"),B=ye(),C=qc(j),I=m0({node:j,nodeType:v,hasDimensions:C,resizeObserver:x}),_=_a({nodeRef:I,disabled:j.hidden||!L,noDragClassName:p,handleSelector:j.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:k}),O=ka();if(j.hidden)return null;const P=tt(j),z=i0(j),V=T||L||t||n||s||o,Z=n?W=>n(W,{...b.userNode}):void 0,Y=s?W=>s(W,{...b.userNode}):void 0,ee=o?W=>o(W,{...b.userNode}):void 0,K=r?W=>r(W,{...b.userNode}):void 0,U=l?W=>l(W,{...b.userNode}):void 0,Q=W=>{const{selectNodesOnDrag:ie,nodeDragThreshold:de}=B.getState();T&&(!ie||!L||de>0)&&vo({id:e,store:B,nodeRef:I}),t&&t(W,{...b.userNode})},ne=W=>{if(!(jo(W.nativeEvent)||h))if(Bc.includes(W.key)&&T){const ie=W.key==="Escape";vo({id:e,store:B,unselect:ie,nodeRef:I})}else L&&j.selected&&Object.prototype.hasOwnProperty.call(cs,W.key)&&(B.setState({ariaLiveMessage:`Moved selected node ${W.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~b.positionAbsolute.x}, y: ${~~b.positionAbsolute.y}`}),O({direction:cs[W.key],factor:W.shiftKey?4:1}))};return i.jsxRuntimeExports.jsx("div",{className:we(["react-flow__node",`react-flow__node-${v}`,{[m]:L},j.className,{selected:j.selected,selectable:T,parent:M,draggable:L,dragging:_}]),ref:I,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:C?"visible":"hidden",...j.style,...z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Z,onMouseMove:Y,onMouseLeave:ee,onContextMenu:K,onClick:Q,onDoubleClick:U,onKeyDown:$?ne:void 0,tabIndex:$?0:void 0,role:$?"button":void 0,"aria-describedby":h?void 0:`${Ea}-${E}`,"aria-label":j.ariaLabel,children:i.jsxRuntimeExports.jsx(QS,{value:e,children:i.jsxRuntimeExports.jsx(N,{id:e,data:j.data,type:v,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:j.selected,selectable:T,draggable:L,deletable:j.deletable??!0,isConnectable:D,sourcePosition:j.sourcePosition,targetPosition:j.targetPosition,dragging:_,dragHandle:j.dragHandle,zIndex:b.z,parentId:j.parentId,...P})})})}const g0=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Na(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,onError:r}=pe(g0,Re),l=x0(e.onlyRenderVisibleElements),c=p0();return i.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ms,children:l.map(a=>i.jsxRuntimeExports.jsx(h0,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:r},a))})}Na.displayName="NodeRenderer";const y0=g.memo(Na);function E0(e){return pe(g.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const s=[];if(n.width&&n.height)for(const o of n.edges){const r=n.nodeLookup.get(o.source),l=n.nodeLookup.get(o.target);r&&l&&jj({sourceNode:r,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(o.id)}return s},[e]),Re)}const j0=({color:e="none",strokeWidth:t=1})=>i.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),S0=({color:e="none",strokeWidth:t=1})=>i.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Pi={[os.Arrow]:j0,[os.ArrowClosed]:S0};function R0(e){const t=ye();return g.useMemo(()=>{var o,r;return Object.prototype.hasOwnProperty.call(Pi,e)?Pi[e]:((r=(o=t.getState()).onError)==null||r.call(o,"009",Te.error009(e)),null)},[e])}const C0=({id:e,type:t,color:n,width:s=12.5,height:o=12.5,markerUnits:r="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const a=R0(t);return a?i.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:r,orient:c,refX:"0",refY:"0",children:i.jsxRuntimeExports.jsx(a,{color:n,strokeWidth:l})}):null},La=({defaultColor:e,rfId:t})=>{const n=pe(r=>r.edges),s=pe(r=>r.defaultEdgeOptions),o=g.useMemo(()=>_j(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return o.length?i.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker",children:i.jsxRuntimeExports.jsx("defs",{children:o.map(r=>i.jsxRuntimeExports.jsx(C0,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})}):null};La.displayName="MarkerDefinitions";var w0=g.memo(La);function Ta({x:e,y:t,label:n,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:r={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:a,className:u,...d}){const[x,p]=g.useState({x:1,y:0,width:0,height:0}),m=we(["react-flow__edge-textwrapper",u]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const E=h.current.getBBox();p({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),typeof n>"u"||!n?null:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-x.width/2} ${t-x.height/2})`,className:m,visibility:x.width?"visible":"hidden",...d,children:[o&&i.jsxRuntimeExports.jsx("rect",{width:x.width+2*l[0],x:-l[0],y:-l[1],height:x.height+2*l[1],className:"react-flow__edge-textbg",style:r,rx:c,ry:c}),i.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:h,style:s,children:n}),a]})}Ta.displayName="EdgeText";const b0=g.memo(Ta);function ze({id:e,path:t,labelX:n,labelY:s,label:o,labelStyle:r,labelShowBg:l,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:u,style:d,markerEnd:x,markerStart:p,className:m,interactionWidth:h=20}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("path",{id:e,style:d,d:t,fill:"none",className:we(["react-flow__edge-path",m]),markerEnd:x,markerStart:p}),h&&i.jsxRuntimeExports.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&Oe(n)&&Oe(s)?i.jsxRuntimeExports.jsx(b0,{x:n,y:s,label:o,labelStyle:r,labelShowBg:l,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:u}):null]})}function Ni({pos:e,x1:t,y1:n,x2:s,y2:o}){return e===G.Left||e===G.Right?[.5*(t+s),n]:[t,.5*(n+o)]}function Aa({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:s,targetY:o,targetPosition:r=G.Top}){const[l,c]=Ni({pos:n,x1:e,y1:t,x2:s,y2:o}),[a,u]=Ni({pos:r,x1:s,y1:o,x2:e,y2:t}),[d,x,p,m]=ea({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:a,targetControlY:u});return[`M${e},${t} C${l},${c} ${a},${u} ${s},${o}`,d,x,p,m]}function Ia(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,sourcePosition:l=G.Bottom,targetPosition:c=G.Top,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:w,interactionWidth:R})=>{const[k,S,j]=Aa({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:r,targetPosition:c}),b=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:b,path:k,labelX:S,labelY:j,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:w,interactionWidth:R})})}const v0=Ia({isInternal:!1}),$a=Ia({isInternal:!0});v0.displayName="SimpleBezierEdge";$a.displayName="SimpleBezierEdgeInternal";function Da(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,sourcePosition:m=G.Bottom,targetPosition:h=G.Top,markerEnd:E,markerStart:w,pathOptions:R,interactionWidth:k})=>{const[S,j,b]=So({sourceX:n,sourceY:s,sourcePosition:m,targetX:o,targetY:r,targetPosition:h,borderRadius:R==null?void 0:R.borderRadius,offset:R==null?void 0:R.offset}),M=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:M,path:S,labelX:j,labelY:b,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,markerEnd:E,markerStart:w,interactionWidth:k})})}const Oa=Da({isInternal:!1}),za=Da({isInternal:!0});Oa.displayName="SmoothStepEdge";za.displayName="SmoothStepEdgeInternal";function Ba(e){return g.memo(({id:t,...n})=>{var o;const s=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(Oa,{...n,id:s,pathOptions:g.useMemo(()=>{var r;return{borderRadius:0,offset:(r=n.pathOptions)==null?void 0:r.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const _0=Ba({isInternal:!1}),Va=Ba({isInternal:!0});_0.displayName="StepEdge";Va.displayName="StepEdgeInternal";function Fa(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,markerEnd:m,markerStart:h,interactionWidth:E})=>{const[w,R,k]=ra({sourceX:n,sourceY:s,targetX:o,targetY:r}),S=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:S,path:w,labelX:R,labelY:k,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,markerEnd:m,markerStart:h,interactionWidth:E})})}const k0=Fa({isInternal:!1}),Ha=Fa({isInternal:!0});k0.displayName="StraightEdge";Ha.displayName="StraightEdgeInternal";function Za(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,sourcePosition:l=G.Bottom,targetPosition:c=G.Top,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:w,pathOptions:R,interactionWidth:k})=>{const[S,j,b]=ta({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:r,targetPosition:c,curvature:R==null?void 0:R.curvature}),M=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:M,path:S,labelX:j,labelY:b,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:E,markerStart:w,interactionWidth:k})})}const M0=Za({isInternal:!1}),Ga=Za({isInternal:!0});M0.displayName="BezierEdge";Ga.displayName="BezierEdgeInternal";const Li={default:Ga,straight:Ha,step:Va,smoothstep:za,simplebezier:$a},Ti={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},P0=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,N0=(e,t,n)=>n===G.Top?e-t:n===G.Bottom?e+t:e,Ai="react-flow__edgeupdater";function Ii({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:o,onMouseEnter:r,onMouseOut:l,type:c}){return i.jsxRuntimeExports.jsx("circle",{onMouseDown:o,onMouseEnter:r,onMouseOut:l,className:we([Ai,`${Ai}-${c}`]),cx:P0(t,s,e),cy:N0(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function L0({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:o,targetX:r,targetY:l,sourcePosition:c,targetPosition:a,onReconnect:u,onReconnectStart:d,onReconnectEnd:x,setReconnecting:p,setUpdateHover:m}){const h=ye(),E=(j,b)=>{if(j.button!==0)return;const{autoPanOnConnect:M,domNode:v,isValidConnection:N,connectionMode:L,connectionRadius:T,lib:D,onConnectStart:$,onConnectEnd:B,cancelConnection:C,nodeLookup:I,rfId:_,panBy:O,updateConnection:P}=h.getState(),z=b.type==="target";p(!0),d==null||d(j,n,b.type);const V=(Y,ee)=>{p(!1),x==null||x(Y,n,b.type,ee)},Z=Y=>u==null?void 0:u(n,Y);wo.onPointerDown(j.nativeEvent,{autoPanOnConnect:M,connectionMode:L,connectionRadius:T,domNode:v,handleId:b.id,nodeId:b.nodeId,nodeLookup:I,isTarget:z,edgeUpdaterType:b.type,lib:D,flowId:_,cancelConnection:C,panBy:O,isValidConnection:N,onConnect:Z,onConnectStart:$,onConnectEnd:B,onReconnectEnd:V,updateConnection:P,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle})},w=j=>E(j,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),R=j=>E(j,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),k=()=>m(!0),S=()=>m(!1);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&i.jsxRuntimeExports.jsx(Ii,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:w,onMouseEnter:k,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&i.jsxRuntimeExports.jsx(Ii,{position:a,centerX:r,centerY:l,radius:t,onMouseDown:R,onMouseEnter:k,onMouseOut:S,type:"target"})]})}function T0({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:o,onDoubleClick:r,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:u,reconnectRadius:d,onReconnect:x,onReconnectStart:p,onReconnectEnd:m,rfId:h,edgeTypes:E,noPanClassName:w,onError:R,disableKeyboardA11y:k}){let S=pe(te=>te.edgeLookup.get(e));const j=pe(te=>te.defaultEdgeOptions);S=j?{...j,...S}:S;let b=S.type||"default",M=(E==null?void 0:E[b])||Li[b];M===void 0&&(R==null||R("011",Te.error011(b)),b="default",M=Li.default);const v=!!(S.focusable||t&&typeof S.focusable>"u"),N=typeof x<"u"&&(S.reconnectable||n&&typeof S.reconnectable>"u"),L=!!(S.selectable||s&&typeof S.selectable>"u"),T=g.useRef(null),[D,$]=g.useState(!1),[B,C]=g.useState(!1),I=ye(),{zIndex:_,sourceX:O,sourceY:P,targetX:z,targetY:V,sourcePosition:Z,targetPosition:Y}=pe(g.useCallback(te=>{const X=te.nodeLookup.get(S.source),se=te.nodeLookup.get(S.target);if(!X||!se)return{zIndex:S.zIndex,...Ti};const fe=vj({id:e,sourceNode:X,targetNode:se,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:te.connectionMode,onError:R});return{zIndex:Ej({selected:S.selected,zIndex:S.zIndex,sourceNode:X,targetNode:se,elevateOnSelect:te.elevateEdgesOnSelect}),...fe||Ti}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),Re),ee=g.useMemo(()=>S.markerStart?`url('#${Ro(S.markerStart,h)}')`:void 0,[S.markerStart,h]),K=g.useMemo(()=>S.markerEnd?`url('#${Ro(S.markerEnd,h)}')`:void 0,[S.markerEnd,h]);if(S.hidden||O===null||P===null||z===null||V===null)return null;const U=te=>{var Me;const{addSelectedEdges:X,unselectNodesAndEdges:se,multiSelectionActive:fe}=I.getState();L&&(I.setState({nodesSelectionActive:!1}),S.selected&&fe?(se({nodes:[],edges:[S]}),(Me=T.current)==null||Me.blur()):X([e])),o&&o(te,S)},Q=r?te=>{r(te,{...S})}:void 0,ne=l?te=>{l(te,{...S})}:void 0,W=c?te=>{c(te,{...S})}:void 0,ie=a?te=>{a(te,{...S})}:void 0,de=u?te=>{u(te,{...S})}:void 0,ae=te=>{var X;if(!k&&Bc.includes(te.key)&&L){const{unselectNodesAndEdges:se,addSelectedEdges:fe}=I.getState();te.key==="Escape"?((X=T.current)==null||X.blur(),se({edges:[S]})):fe([e])}};return i.jsxRuntimeExports.jsx("svg",{style:{zIndex:_},children:i.jsxRuntimeExports.jsxs("g",{className:we(["react-flow__edge",`react-flow__edge-${b}`,S.className,w,{selected:S.selected,animated:S.animated,inactive:!L&&!o,updating:D,selectable:L}]),onClick:U,onDoubleClick:Q,onContextMenu:ne,onMouseEnter:W,onMouseMove:ie,onMouseLeave:de,onKeyDown:v?ae:void 0,tabIndex:v?0:void 0,role:v?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":v?`${ja}-${h}`:void 0,ref:T,children:[!B&&i.jsxRuntimeExports.jsx(M,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:L,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:O,sourceY:P,targetX:z,targetY:V,sourcePosition:Z,targetPosition:Y,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:ee,markerEnd:K,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),N&&i.jsxRuntimeExports.jsx(L0,{edge:S,isReconnectable:N,reconnectRadius:d,onReconnect:x,onReconnectStart:p,onReconnectEnd:m,sourceX:O,sourceY:P,targetX:z,targetY:V,sourcePosition:Z,targetPosition:Y,setUpdateHover:$,setReconnecting:C})]})})}const A0=e=>({width:e.width,height:e.height,edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ya({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:o,onReconnect:r,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:x,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:h,disableKeyboardA11y:E}){const{edgesFocusable:w,edgesReconnectable:R,elementsSelectable:k,onError:S}=pe(A0,Re),j=E0(t);return i.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[i.jsxRuntimeExports.jsx(w0,{defaultColor:e,rfId:n}),j.map(b=>i.jsxRuntimeExports.jsx(T0,{id:b,edgesFocusable:w,edgesReconnectable:R,elementsSelectable:k,noPanClassName:o,onReconnect:r,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:u,onClick:d,reconnectRadius:x,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:h,rfId:n,onError:S,edgeTypes:s,disableKeyboardA11y:E},b))]})}Ya.displayName="EdgeRenderer";const I0=g.memo(Ya),$0=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function D0({children:e}){const t=pe($0);return i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function O0(e){const t=wt(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const z0=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function B0(e){const t=pe(z0),n=ye();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function V0(e){return e.connection.inProgress?{...e.connection,to:jn(e.connection.to,e.transform)}:{...e.connection}}function F0(e){return V0}function H0(e){const t=F0();return pe(t,Re)}const Z0=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function G0({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:o,width:r,height:l,isValid:c,inProgress:a}=pe(Z0,Re);return!(r&&o&&a)?null:i.jsxRuntimeExports.jsx("svg",{style:e,width:r,height:l,className:"react-flow__connectionline react-flow__container",children:i.jsxRuntimeExports.jsx("g",{className:we(["react-flow__connection",Fc(c)]),children:i.jsxRuntimeExports.jsx(Wa,{style:t,type:n,CustomComponent:s,isValid:c})})})}const Wa=({style:e,type:t=rt.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:o,from:r,fromNode:l,fromHandle:c,fromPosition:a,to:u,toNode:d,toHandle:x,toPosition:p}=H0();if(!o)return;if(n)return i.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:r.x,fromY:r.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:p,connectionStatus:Fc(s),toNode:d,toHandle:x});let m="";const h={sourceX:r.x,sourceY:r.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:p};switch(t){case rt.Bezier:[m]=ta(h);break;case rt.SimpleBezier:[m]=Aa(h);break;case rt.Step:[m]=So({...h,borderRadius:0});break;case rt.SmoothStep:[m]=So(h);break;default:[m]=ra(h)}return i.jsxRuntimeExports.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};Wa.displayName="ConnectionLine";const Y0={};function $i(e=Y0){const t=g.useRef(e),n=ye();g.useEffect(()=>{var s,o;if(process.env.NODE_ENV==="development"){const r=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const l of r)if(t.current[l]!==e[l]){(o=(s=n.getState()).onError)==null||o.call(s,"002",Te.error002());break}t.current=e}},[e])}function W0(){const e=ye(),t=g.useRef(!1);g.useEffect(()=>{var n,s;if(process.env.NODE_ENV==="development"&&!t.current){const o=document.querySelector(".react-flow__pane");o&&window.getComputedStyle(o).zIndex!=="1"&&((s=(n=e.getState()).onError)==null||s.call(n,"013",Te.error013("react"))),t.current=!0}},[])}function Xa({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:o,onNodeDoubleClick:r,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:x,onSelectionStart:p,onSelectionEnd:m,connectionLineType:h,connectionLineStyle:E,connectionLineComponent:w,connectionLineContainerStyle:R,selectionKeyCode:k,selectionOnDrag:S,selectionMode:j,multiSelectionKeyCode:b,panActivationKeyCode:M,zoomActivationKeyCode:v,deleteKeyCode:N,onlyRenderVisibleElements:L,elementsSelectable:T,defaultViewport:D,translateExtent:$,minZoom:B,maxZoom:C,preventScrolling:I,defaultMarkerColor:_,zoomOnScroll:O,zoomOnPinch:P,panOnScroll:z,panOnScrollSpeed:V,panOnScrollMode:Z,zoomOnDoubleClick:Y,panOnDrag:ee,onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:Q,onPaneMouseLeave:ne,onPaneScroll:W,onPaneContextMenu:ie,paneClickDistance:de,nodeClickDistance:ae,onEdgeContextMenu:te,onEdgeMouseEnter:X,onEdgeMouseMove:se,onEdgeMouseLeave:fe,reconnectRadius:Me,onReconnect:Ye,onReconnectStart:Ls,onReconnectEnd:Ts,noDragClassName:Zt,noWheelClassName:As,noPanClassName:Gt,disableKeyboardA11y:Yt,nodeExtent:Is,rfId:Wt,viewport:Xt,onViewportChange:Cn}){return $i(e),$i(t),W0(),O0(n),B0(Xt),i.jsxRuntimeExports.jsx(u0,{onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:Q,onPaneMouseLeave:ne,onPaneContextMenu:ie,onPaneScroll:W,paneClickDistance:de,deleteKeyCode:N,selectionKeyCode:k,selectionOnDrag:S,selectionMode:j,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:b,panActivationKeyCode:M,zoomActivationKeyCode:v,elementsSelectable:T,zoomOnScroll:O,zoomOnPinch:P,zoomOnDoubleClick:Y,panOnScroll:z,panOnScrollSpeed:V,panOnScrollMode:Z,panOnDrag:ee,defaultViewport:D,translateExtent:$,minZoom:B,maxZoom:C,onSelectionContextMenu:x,preventScrolling:I,noDragClassName:Zt,noWheelClassName:As,noPanClassName:Gt,disableKeyboardA11y:Yt,onViewportChange:Cn,isControlledViewport:!!Xt,children:i.jsxRuntimeExports.jsxs(D0,{children:[i.jsxRuntimeExports.jsx(I0,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:Ye,onReconnectStart:Ls,onReconnectEnd:Ts,onlyRenderVisibleElements:L,onEdgeContextMenu:te,onEdgeMouseEnter:X,onEdgeMouseMove:se,onEdgeMouseLeave:fe,reconnectRadius:Me,defaultMarkerColor:_,noPanClassName:Gt,disableKeyboardA11y:Yt,rfId:Wt}),i.jsxRuntimeExports.jsx(G0,{style:E,type:h,component:w,containerStyle:R}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),i.jsxRuntimeExports.jsx(y0,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:r,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ae,onlyRenderVisibleElements:L,noPanClassName:Gt,noDragClassName:Zt,disableKeyboardA11y:Yt,nodeExtent:Is,rfId:Wt}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Xa.displayName="GraphView";const X0=g.memo(Xa),Di=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a}={})=>{const u=new Map,d=new Map,x=new Map,p=new Map,m=s??t??[],h=n??e??[],E=c??[0,0],w=a??an;la(x,p,m),Co(h,u,d,{nodeOrigin:E,nodeExtent:w,elevateNodesOnSelect:!1});let R=[0,0,1];if(l&&o&&r){const k=En(u,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:S,y:j,zoom:b}=rr(k,o,r,.5,2,.1);R=[S,j,b]}return{rfId:"1",width:0,height:0,transform:R,nodes:h,nodeLookup:u,parentLookup:d,edges:m,edgeLookup:p,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:an,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:St.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...Vc},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:is,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},K0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a})=>pS((u,d)=>({...Di({nodes:e,edges:t,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a,defaultNodes:n,defaultEdges:s}),setNodes:x=>{const{nodeLookup:p,parentLookup:m,nodeOrigin:h,elevateNodesOnSelect:E}=d();Co(x,p,m,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:E,checkEquality:!0}),u({nodes:x})},setEdges:x=>{const{connectionLookup:p,edgeLookup:m}=d();la(p,m,x),u({edges:x})},setDefaultNodesAndEdges:(x,p)=>{if(x){const{setNodes:m}=d();m(x),u({hasDefaultNodes:!0})}if(p){const{setEdges:m}=d();m(p),u({hasDefaultEdges:!0})}},updateNodeInternals:(x,p={triggerFitView:!0})=>{const{triggerNodeChanges:m,nodeLookup:h,parentLookup:E,fitViewOnInit:w,fitViewDone:R,fitViewOnInitOptions:k,domNode:S,nodeOrigin:j,nodeExtent:b,debug:M,fitViewSync:v}=d(),{changes:N,updatedInternals:L}=Lj(x,h,E,S,j,b);if(L){if(Mj(h,E,{nodeOrigin:j,nodeExtent:b}),p.triggerFitView){let T=R;!R&&w&&(T=v({...k,nodes:k==null?void 0:k.nodes})),u({fitViewDone:T})}else u({});(N==null?void 0:N.length)>0&&(M&&console.log("React Flow: trigger node changes",N),m==null||m(N))}},updateNodePositions:(x,p=!1)=>{const m=[],h=[];for(const[E,w]of x){const R={id:E,type:"position",position:w.position,dragging:p};w!=null&&w.expandParent&&(w!=null&&w.parentId)&&R.position&&(m.push({id:E,parentId:w.parentId,rect:{...w.internals.positionAbsolute,width:w.measured.width,height:w.measured.height}}),R.position.x=Math.max(0,R.position.x),R.position.y=Math.max(0,R.position.y)),h.push(R)}if(m.length>0){const{nodeLookup:E,parentLookup:w,nodeOrigin:R}=d(),k=ar(m,E,w,R);h.push(...k)}d().triggerNodeChanges(h)},triggerNodeChanges:x=>{const{onNodesChange:p,setNodes:m,nodes:h,hasDefaultNodes:E,debug:w}=d();if(x!=null&&x.length){if(E){const R=Ca(x,h);m(R)}w&&console.log("React Flow: trigger node changes",x),p==null||p(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:p,setEdges:m,edges:h,hasDefaultEdges:E,debug:w}=d();if(x!=null&&x.length){if(E){const R=wa(x,h);m(R)}w&&console.log("React Flow: trigger edge changes",x),p==null||p(x)}},addSelectedNodes:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:E,triggerEdgeChanges:w}=d();if(p){const R=x.map(k=>pt(k,!0));E(R);return}E(kt(h,new Set([...x]),!0)),w(kt(m))},addSelectedEdges:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:E,triggerEdgeChanges:w}=d();if(p){const R=x.map(k=>pt(k,!0));w(R);return}w(kt(m,new Set([...x]))),E(kt(h,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:p}={})=>{const{edges:m,nodes:h,nodeLookup:E,triggerNodeChanges:w,triggerEdgeChanges:R}=d(),k=x||h,S=p||m,j=k.map(M=>{const v=E.get(M.id);return v&&(v.selected=!1),pt(M.id,!1)}),b=S.map(M=>pt(M.id,!1));w(j),R(b)},setMinZoom:x=>{const{panZoom:p,maxZoom:m}=d();p==null||p.setScaleExtent([x,m]),u({minZoom:x})},setMaxZoom:x=>{const{panZoom:p,minZoom:m}=d();p==null||p.setScaleExtent([m,x]),u({maxZoom:x})},setTranslateExtent:x=>{var p;(p=d().panZoom)==null||p.setTranslateExtent(x),u({translateExtent:x})},setPaneClickDistance:x=>{var p;(p=d().panZoom)==null||p.setClickDistance(x)},resetSelectedElements:()=>{const{edges:x,nodes:p,triggerNodeChanges:m,triggerEdgeChanges:h}=d(),E=p.reduce((R,k)=>k.selected?[...R,pt(k.id,!1)]:R,[]),w=x.reduce((R,k)=>k.selected?[...R,pt(k.id,!1)]:R,[]);m(E),h(w)},setNodeExtent:x=>{const{nodes:p,nodeLookup:m,parentLookup:h,nodeOrigin:E,elevateNodesOnSelect:w,nodeExtent:R}=d();x[0][0]===R[0][0]&&x[0][1]===R[0][1]&&x[1][0]===R[1][0]&&x[1][1]===R[1][1]||(Co(p,m,h,{nodeOrigin:E,nodeExtent:x,elevateNodesOnSelect:w,checkEquality:!1}),u({nodeExtent:x}))},panBy:x=>{const{transform:p,width:m,height:h,panZoom:E,translateExtent:w}=d();return Tj({delta:x,panZoom:E,transform:p,translateExtent:w,width:m,height:h})},fitView:x=>{const{panZoom:p,width:m,height:h,minZoom:E,maxZoom:w,nodeLookup:R}=d();if(!p)return Promise.resolve(!1);const k=go(R,x);return yo({nodes:k,width:m,height:h,panZoom:p,minZoom:E,maxZoom:w},x)},fitViewSync:x=>{const{panZoom:p,width:m,height:h,minZoom:E,maxZoom:w,nodeLookup:R}=d();if(!p)return!1;const k=go(R,x);return yo({nodes:k,width:m,height:h,panZoom:p,minZoom:E,maxZoom:w},x),k.size>0},cancelConnection:()=>{u({connection:{...Vc}})},updateConnection:x=>{u({connection:x})},reset:()=>u({...Di()})}),Object.is);function Ka({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:o,initialHeight:r,fitView:l,nodeOrigin:c,nodeExtent:a,children:u}){const[d]=g.useState(()=>K0({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a}));return i.jsxRuntimeExports.jsx(mS,{value:d,children:i.jsxRuntimeExports.jsx(OS,{children:u})})}function q0({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:o,width:r,height:l,fitView:c,nodeOrigin:a,nodeExtent:u}){return g.useContext(ks)?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:e}):i.jsxRuntimeExports.jsx(Ka,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:o,initialWidth:r,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:u,children:e})}const U0={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Q0({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:o,nodeTypes:r,edgeTypes:l,onNodeClick:c,onEdgeClick:a,onInit:u,onMove:d,onMoveStart:x,onMoveEnd:p,onConnect:m,onConnectStart:h,onConnectEnd:E,onClickConnectStart:w,onClickConnectEnd:R,onNodeMouseEnter:k,onNodeMouseMove:S,onNodeMouseLeave:j,onNodeContextMenu:b,onNodeDoubleClick:M,onNodeDragStart:v,onNodeDrag:N,onNodeDragStop:L,onNodesDelete:T,onEdgesDelete:D,onDelete:$,onSelectionChange:B,onSelectionDragStart:C,onSelectionDrag:I,onSelectionDragStop:_,onSelectionContextMenu:O,onSelectionStart:P,onSelectionEnd:z,onBeforeDelete:V,connectionMode:Z,connectionLineType:Y=rt.Bezier,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:U,deleteKeyCode:Q="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:ie=At.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:ae=ls()?"Meta":"Control",zoomActivationKeyCode:te=ls()?"Meta":"Control",snapToGrid:X,snapGrid:se,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:Me,nodesDraggable:Ye,nodesConnectable:Ls,nodesFocusable:Ts,nodeOrigin:Zt=Sa,edgesFocusable:As,edgesReconnectable:Gt,elementsSelectable:Yt=!0,defaultViewport:Is=kS,minZoom:Wt=.5,maxZoom:Xt=2,translateExtent:Cn=an,preventScrolling:cx=!0,nodeExtent:$s,defaultMarkerColor:ax="#b1b1b7",zoomOnScroll:ux=!0,zoomOnPinch:dx=!0,panOnScroll:xx=!1,panOnScrollSpeed:fx=.5,panOnScrollMode:px=gt.Free,zoomOnDoubleClick:mx=!0,panOnDrag:hx=!0,onPaneClick:gx,onPaneMouseEnter:yx,onPaneMouseMove:Ex,onPaneMouseLeave:jx,onPaneScroll:Sx,onPaneContextMenu:Rx,paneClickDistance:Er=0,nodeClickDistance:Cx=0,children:wx,onReconnect:bx,onReconnectStart:vx,onReconnectEnd:_x,onEdgeContextMenu:kx,onEdgeDoubleClick:Mx,onEdgeMouseEnter:Px,onEdgeMouseMove:Nx,onEdgeMouseLeave:Lx,reconnectRadius:Tx=10,onNodesChange:Ax,onEdgesChange:Ix,noDragClassName:$x="nodrag",noWheelClassName:Dx="nowheel",noPanClassName:jr="nopan",fitView:Sr,fitViewOptions:Ox,connectOnClick:zx,attributionPosition:Bx,proOptions:Vx,defaultEdgeOptions:Fx,elevateNodesOnSelect:Hx,elevateEdgesOnSelect:Zx,disableKeyboardA11y:Rr=!1,autoPanOnConnect:Gx,autoPanOnNodeDrag:Yx,autoPanSpeed:Wx,connectionRadius:Xx,isValidConnection:Kx,onError:qx,style:Ux,id:Cr,nodeDragThreshold:Qx,viewport:Jx,onViewportChange:ef,width:tf,height:nf,colorMode:sf="light",debug:of,...rf},lf){const Ds=Cr||"1",cf=LS(sf);return i.jsxRuntimeExports.jsx("div",{...rf,style:{...Ux,...U0},ref:lf,className:we(["react-flow",o,cf]),"data-testid":"rf__wrapper",id:Cr,children:i.jsxRuntimeExports.jsxs(q0,{nodes:e,edges:t,width:tf,height:nf,fitView:Sr,nodeOrigin:Zt,nodeExtent:$s,children:[i.jsxRuntimeExports.jsx(X0,{onInit:u,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:k,onNodeMouseMove:S,onNodeMouseLeave:j,onNodeContextMenu:b,onNodeDoubleClick:M,nodeTypes:r,edgeTypes:l,connectionLineType:Y,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:U,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:ie,deleteKeyCode:Q,multiSelectionKeyCode:ae,panActivationKeyCode:de,zoomActivationKeyCode:te,onlyRenderVisibleElements:fe,defaultViewport:Is,translateExtent:Cn,minZoom:Wt,maxZoom:Xt,preventScrolling:cx,zoomOnScroll:ux,zoomOnPinch:dx,zoomOnDoubleClick:mx,panOnScroll:xx,panOnScrollSpeed:fx,panOnScrollMode:px,panOnDrag:hx,onPaneClick:gx,onPaneMouseEnter:yx,onPaneMouseMove:Ex,onPaneMouseLeave:jx,onPaneScroll:Sx,onPaneContextMenu:Rx,paneClickDistance:Er,nodeClickDistance:Cx,onSelectionContextMenu:O,onSelectionStart:P,onSelectionEnd:z,onReconnect:bx,onReconnectStart:vx,onReconnectEnd:_x,onEdgeContextMenu:kx,onEdgeDoubleClick:Mx,onEdgeMouseEnter:Px,onEdgeMouseMove:Nx,onEdgeMouseLeave:Lx,reconnectRadius:Tx,defaultMarkerColor:ax,noDragClassName:$x,noWheelClassName:Dx,noPanClassName:jr,rfId:Ds,disableKeyboardA11y:Rr,nodeExtent:$s,viewport:Jx,onViewportChange:ef}),i.jsxRuntimeExports.jsx(NS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:m,onConnectStart:h,onConnectEnd:E,onClickConnectStart:w,onClickConnectEnd:R,nodesDraggable:Ye,nodesConnectable:Ls,nodesFocusable:Ts,edgesFocusable:As,edgesReconnectable:Gt,elementsSelectable:Yt,elevateNodesOnSelect:Hx,elevateEdgesOnSelect:Zx,minZoom:Wt,maxZoom:Xt,nodeExtent:$s,onNodesChange:Ax,onEdgesChange:Ix,snapToGrid:X,snapGrid:se,connectionMode:Z,translateExtent:Cn,connectOnClick:zx,defaultEdgeOptions:Fx,fitView:Sr,fitViewOptions:Ox,onNodesDelete:T,onEdgesDelete:D,onDelete:$,onNodeDragStart:v,onNodeDrag:N,onNodeDragStop:L,onSelectionDrag:I,onSelectionDragStart:C,onSelectionDragStop:_,onMove:d,onMoveStart:x,onMoveEnd:p,noPanClassName:jr,nodeOrigin:Zt,rfId:Ds,autoPanOnConnect:Gx,autoPanOnNodeDrag:Yx,autoPanSpeed:Wx,onError:qx,connectionRadius:Xx,isValidConnection:Kx,selectNodesOnDrag:Me,nodeDragThreshold:Qx,onBeforeDelete:V,paneClickDistance:Er,debug:of}),i.jsxRuntimeExports.jsx(_S,{onSelectionChange:B}),wx,i.jsxRuntimeExports.jsx(RS,{proOptions:Vx,position:Bx}),i.jsxRuntimeExports.jsx(jS,{rfId:Ds,disableKeyboardA11y:Rr})]})})}var J0=ba(Q0);function e1(){const e=ye();return g.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),o=Array.isArray(t)?t:[t],r=new Map;o.forEach(l=>{const c=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${l}"]`);c&&r.set(l,{id:l,nodeElement:c,force:!0})}),requestAnimationFrame(()=>s(r,{triggerFitView:!1}))},[])}function t1({onStart:e,onChange:t,onEnd:n}){const s=ye();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function n1({dimensions:e,lineWidth:t,variant:n,className:s}){return i.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:we(["react-flow__background-pattern",n,s])})}function s1({radius:e,className:t}){return i.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:we(["react-flow__background-pattern","dots",t])})}var ct;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ct||(ct={}));const o1={[ct.Dots]:1,[ct.Lines]:1,[ct.Cross]:6},r1=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function qa({id:e,variant:t=ct.Dots,gap:n=20,size:s,lineWidth:o=1,offset:r=0,color:l,bgColor:c,style:a,className:u,patternClassName:d}){const x=g.useRef(null),{transform:p,patternId:m}=pe(r1,Re),h=s||o1[t],E=t===ct.Dots,w=t===ct.Cross,R=Array.isArray(n)?n:[n,n],k=[R[0]*p[2]||1,R[1]*p[2]||1],S=h*p[2],j=Array.isArray(r)?r:[r,r],b=w?[S,S]:k,M=[j[0]*p[2]||1+b[0]/2,j[1]*p[2]||1+b[1]/2],v=`${m}${e||""}`;return i.jsxRuntimeExports.jsxs("svg",{className:we(["react-flow__background",u]),style:{...a,...Ms,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:x,"data-testid":"rf__background",children:[i.jsxRuntimeExports.jsx("pattern",{id:v,x:p[0]%k[0],y:p[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:E?i.jsxRuntimeExports.jsx(s1,{radius:S/2,className:d}):i.jsxRuntimeExports.jsx(n1,{dimensions:b,lineWidth:o,variant:t,className:d})}),i.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${v})`})]})}qa.displayName="Background";const i1=g.memo(qa);function l1(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:i.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function c1(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:i.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function a1(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:i.jsxRuntimeExports.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function u1(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function d1(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Ln({children:e,className:t,...n}){return i.jsxRuntimeExports.jsx("button",{type:"button",className:we(["react-flow__controls-button",t]),...n,children:e})}const x1=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Ua({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:r,onZoomOut:l,onFitView:c,onInteractiveChange:a,className:u,children:d,position:x="bottom-left",orientation:p="vertical","aria-label":m="React Flow controls"}){const h=ye(),{isInteractive:E,minZoomReached:w,maxZoomReached:R}=pe(x1,Re),{zoomIn:k,zoomOut:S,fitView:j}=wt(),b=()=>{k(),r==null||r()},M=()=>{S(),l==null||l()},v=()=>{j(o),c==null||c()},N=()=>{h.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),a==null||a(!E)},L=p==="horizontal"?"horizontal":"vertical";return i.jsxRuntimeExports.jsxs(ur,{className:we(["react-flow__controls",L,u]),position:x,style:e,"data-testid":"rf__controls","aria-label":m,children:[t&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Ln,{onClick:b,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:R,children:i.jsxRuntimeExports.jsx(l1,{})}),i.jsxRuntimeExports.jsx(Ln,{onClick:M,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:w,children:i.jsxRuntimeExports.jsx(c1,{})})]}),n&&i.jsxRuntimeExports.jsx(Ln,{className:"react-flow__controls-fitview",onClick:v,title:"fit view","aria-label":"fit view",children:i.jsxRuntimeExports.jsx(a1,{})}),s&&i.jsxRuntimeExports.jsx(Ln,{className:"react-flow__controls-interactive",onClick:N,title:"toggle interactivity","aria-label":"toggle interactivity",children:E?i.jsxRuntimeExports.jsx(d1,{}):i.jsxRuntimeExports.jsx(u1,{})}),d]})}Ua.displayName="Controls";g.memo(Ua);function f1({id:e,x:t,y:n,width:s,height:o,style:r,color:l,strokeColor:c,strokeWidth:a,className:u,borderRadius:d,shapeRendering:x,selected:p,onClick:m}){const{background:h,backgroundColor:E}=r||{},w=l||h||E;return i.jsxRuntimeExports.jsx("rect",{className:we(["react-flow__minimap-node",{selected:p},u]),x:t,y:n,rx:d,ry:d,width:s,height:o,style:{fill:w,stroke:c,strokeWidth:a},shapeRendering:x,onClick:m?R=>m(R,e):void 0})}const p1=g.memo(f1),m1=e=>e.nodes.map(t=>t.id),to=e=>e instanceof Function?e:()=>e;function h1({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:r=p1,onClick:l}){const c=pe(m1,Re),a=to(t),u=to(e),d=to(n),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:c.map(p=>i.jsxRuntimeExports.jsx(y1,{id:p,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:r,onClick:l,shapeRendering:x},p))})}function g1({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:o,nodeStrokeWidth:r,shapeRendering:l,NodeComponent:c,onClick:a}){const{node:u,x:d,y:x,width:p,height:m}=pe(h=>{const E=h.nodeLookup.get(e),{x:w,y:R}=E.internals.positionAbsolute,{width:k,height:S}=tt(E);return{node:E,x:w,y:R,width:k,height:S}},Re);return!u||u.hidden||!qc(u)?null:i.jsxRuntimeExports.jsx(c,{x:d,y:x,width:p,height:m,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:r,shapeRendering:l,onClick:a,id:u.id})}const y1=g.memo(g1);var E1=g.memo(h1);const j1=200,S1=150,R1=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Xc(En(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},C1="react-flow__minimap-desc";function Qa({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:o="",nodeBorderRadius:r=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:a,maskColor:u,maskStrokeColor:d,maskStrokeWidth:x,position:p="bottom-right",onClick:m,onNodeClick:h,pannable:E=!1,zoomable:w=!1,ariaLabel:R="React Flow mini map",inversePan:k,zoomStep:S=10,offsetScale:j=5}){const b=ye(),M=g.useRef(null),{boundingRect:v,viewBB:N,rfId:L,panZoom:T,translateExtent:D,flowWidth:$,flowHeight:B}=pe(R1,Re),C=(e==null?void 0:e.width)??j1,I=(e==null?void 0:e.height)??S1,_=v.width/C,O=v.height/I,P=Math.max(_,O),z=P*C,V=P*I,Z=j*P,Y=v.x-(z-v.width)/2-Z,ee=v.y-(V-v.height)/2-Z,K=z+Z*2,U=V+Z*2,Q=`${C1}-${L}`,ne=g.useRef(0),W=g.useRef();ne.current=P,g.useEffect(()=>{if(M.current&&T)return W.current=Vj({domNode:M.current,panZoom:T,getTransform:()=>b.getState().transform,getViewScale:()=>ne.current}),()=>{var ae;(ae=W.current)==null||ae.destroy()}},[T]),g.useEffect(()=>{var ae;(ae=W.current)==null||ae.update({translateExtent:D,width:$,height:B,inversePan:k,pannable:E,zoomStep:S,zoomable:w})},[E,w,k,S,D,$,B]);const ie=m?ae=>{var se;const[te,X]=((se=W.current)==null?void 0:se.pointer(ae))||[0,0];m(ae,{x:te,y:X})}:void 0,de=h?g.useCallback((ae,te)=>{const X=b.getState().nodeLookup.get(te);h(ae,X)},[]):void 0;return i.jsxRuntimeExports.jsx(ur,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*P:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="string"?l:void 0},className:we(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:i.jsxRuntimeExports.jsxs("svg",{width:C,height:I,viewBox:`${Y} ${ee} ${K} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Q,ref:M,onClick:ie,children:[R&&i.jsxRuntimeExports.jsx("title",{id:Q,children:R}),i.jsxRuntimeExports.jsx(E1,{onClick:de,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:r,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),i.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${Y-Z},${ee-Z}h${K+Z*2}v${U+Z*2}h${-K-Z*2}z
|
|
39
|
+
M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Qa.displayName="MiniMap";g.memo(Qa);function w1({nodeId:e,position:t,variant:n=tn.Handle,className:s,style:o={},children:r,color:l,minWidth:c=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:x=!1,shouldResize:p,onResizeStart:m,onResize:h,onResizeEnd:E}){const w=Ma(),R=typeof e=="string"?e:w,k=ye(),S=g.useRef(null),j=n===tn.Line?"right":"bottom-right",b=t??j,M=g.useRef(null);g.useEffect(()=>{if(!(!S.current||!R))return M.current||(M.current=nS({domNode:S.current,nodeId:R,getStoreItems:()=>{const{nodeLookup:T,transform:D,snapGrid:$,snapToGrid:B,nodeOrigin:C,domNode:I}=k.getState();return{nodeLookup:T,transform:D,snapGrid:$,snapToGrid:B,nodeOrigin:C,paneDomNode:I}},onChange:(T,D)=>{const{triggerNodeChanges:$,nodeLookup:B,parentLookup:C,nodeOrigin:I}=k.getState(),_=[],O={x:T.x,y:T.y},P=B.get(R);if(P&&P.expandParent&&P.parentId){const z=P.origin??I,V=T.width??P.measured.width,Z=T.height??P.measured.height,Y={id:P.id,parentId:P.parentId,rect:{width:V,height:Z,...Uc({x:T.x??P.position.x,y:T.y??P.position.y},{width:V,height:Z},P.parentId,B,z)}},ee=ar([Y],B,C,I);_.push(...ee),O.x=T.x?Math.max(z[0]*V,T.x):void 0,O.y=T.y?Math.max(z[1]*Z,T.y):void 0}if(O.x!==void 0&&O.y!==void 0){const z={id:R,type:"position",position:{...O}};_.push(z)}if(T.width!==void 0&&T.height!==void 0){const z={id:R,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:T.width,height:T.height}};_.push(z)}for(const z of D){const V={...z,type:"position"};_.push(V)}$(_)},onEnd:()=>{const T={id:R,type:"dimensions",resizing:!1};k.getState().triggerNodeChanges([T])}})),M.current.update({controlPosition:b,boundaries:{minWidth:c,minHeight:a,maxWidth:u,maxHeight:d},keepAspectRatio:x,onResizeStart:m,onResize:h,onResizeEnd:E,shouldResize:p}),()=>{var T;(T=M.current)==null||T.destroy()}},[b,c,a,u,d,x,m,h,E,p]);const v=b.split("-"),N=n===tn.Line?"borderColor":"backgroundColor",L=l?{...o,[N]:l}:o;return i.jsxRuntimeExports.jsx("div",{className:we(["react-flow__resize-control","nodrag",...v,n,s]),ref:S,style:L,children:r})}g.memo(w1);const b1=(e,t)=>e.map((n,s)=>f.G.translate(n,t[s])),Ja=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:f.cssString(t)},...n}),v1=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:f.cssString(t),strokeDasharray:"12,4"},...n}),_1=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:f.cssString(t),strokeDasharray:"12,4,4"},...n}),k1=({points:e,color:t,...n})=>{const s=f.G.calculateMiters(e,6),o=e.map((a,u)=>f.G.translate(a,s[u])),r=e.map((a,u)=>f.G.translate(a,f.G.scale(s[u],-1))),l=f.cssString(t),c=.7;return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(ze,{path:at(o),style:{stroke:l,opacity:c},...n}),i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:l},...n}),i.jsxRuntimeExports.jsx(ze,{path:at(r),style:{stroke:l,opacity:c},...n})]})},Oi=15,M1=(e,t)=>{const n=[],s=[];for(let c=0;c<e.length-1;c++){const a=f.G.distance(e[c],e[c+1]);s.push(a)}const o=t;let r=0,l=o;for(let c=0;c<s.length;c++){const a=s[c],u=e[c],d=e[c+1];for(;r+a>=l;){const x=(l-r)/a,p={x:u.x+x*(d.x-u.x),y:u.y+x*(d.y-u.y)};let m="x";Math.abs(d.x-u.x)<1&&(m="y"),l+=o,!(f.G.distance(p,d)<Oi||f.G.distance(p,u)<Oi)&&n.push({position:p,direction:m})}r+=a}return n},P1=({color:e,position:t,direction:n})=>{const o="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,i.jsxRuntimeExports.jsx("path",{d:o,stroke:f.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},N1=({color:e,position:t,direction:n})=>{const o="M0,0 L0,-10";n==="x"?t.y+=10/3:t.x-=10/3;let r=f.G.translateX(t,-10),l=45;return n==="y"&&(r=f.G.translateY(t,-10),l+=90),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("path",{d:o,stroke:f.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx("path",{d:o,stroke:f.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${r.x},${r.y}) rotate(${l})`,strokeLinecap:"round"})]})},L1=({color:e,position:t})=>i.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:f.cssString(e),strokeWidth:2}),xr=(e,t={})=>{const n=({points:s,color:o,...r})=>{const l=at(s),c=M1(s,40);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(ze,{path:l,style:{stroke:f.cssString(o)},...r,...t}),c.map(({position:a,direction:u},d)=>i.jsxRuntimeExports.jsx(e,{position:a,direction:u,color:o},d))]})};return n.displayName=`SymbolLine(${e.displayName})`,n},T1=xr(P1),A1=xr(N1),I1=xr(L1),at=e=>{let t="";const s=e.length+-1;for(let o=0;o<s;o++){const r=e[o%e.length],l=e[(o+1)%e.length],c=Math.min(6/Math.hypot(l.x-r.x,l.y-r.y),.5);o>0&&(t+=`Q${r.x},${r.y} ${r.x*(1-c)+l.x*c},${r.y*(1-c)+l.y*c}`),o===0?t+=`M${r.x},${r.y}`:o===0&&(t+=`M${r.x*(1-c)+l.x*c},${r.y*(1-c)+l.y*c}`),o===s-1?t+=`L${l.x},${l.y}`:o<s-1&&(t+=`L${r.x*c+l.x*(1-c)},${r.y*c+l.y*(1-c)}`)}return t},eu={pipe:Ja,electric:v1,secondary:_1,jacketed:k1,hydraulic:T1,pneumatic:A1,data:I1},tu=Ja,nu=[{key:"pipe",name:"Pipe"},{key:"electric",name:"Electric Signal"},{key:"secondary",name:"Secondary"},{key:"jacketed",name:"Jacketed"},{key:"hydraulic",name:"Hydraulic"},{key:"pneumatic",name:"Pneumatic"},{key:"data",name:"Data"}],$1=e=>i.jsxRuntimeExports.jsx(Ce.DropdownButton,{columns:[{key:"name",name:"Type"}],data:nu,style:{width:200},entryRenderKey:"name",...e}),fr=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Ne=(e,t)=>{const n=fr(t),s=e.getNodes().find(o=>o.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return f.Eo.construct(s.position,f._.scale(f.Eo.dims(f.Eo.construct(n)),1/e.getZoom()))},D1=(e,t)=>Ps.fromFlow(e,t);class su{constructor(t,n){Fe(this,"node_",null);Fe(this,"position");Fe(this,"orientation");this.position=t,this.orientation=n}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return f.G.translate(f.Eo.topLeft(this.node.box),this.position)}}class Ps{constructor(t,n,s){Fe(this,"key");Fe(this,"box");Fe(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(o=>o.node=this)}static fromFlow(t,n){const s=Ne(n,t),o=fr(t),r=o.getElementsByClassName("react-flow__handle"),l=f.Eo.construct(o),c=Array.from(r).map(a=>{const u=f.Eo.center(f.Eo.construct(a)),d=f.G.translation(f.Eo.topLeft(l),u),x=a.className.match(/react-flow__handle-(\w+)/);if(x==null)throw new Error("[schematic] - cannot find handle orientation");const p=f.K.construct(x[0]);return new su(d,p)});return new Ps(t,s,c)}}const O1=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:o,toPosition:r,fromNode:l,connectionLineStyle:c,connectionStatus:a})=>{const u=document.querySelector(".react-flow__handle-connecting"),d=u==null?void 0:u.className.match(/react-flow__handle-(\w+)/);if(d!=null){const h=f.K.outer.safeParse(d[1]);h.success&&(r=h.data)}const x=wt(),p=vt({sourcePos:f.G.construct(e,t),targetPos:f.G.construct(n,s),sourceOrientation:o,targetOrientation:r,sourceBox:Ne(x,(l==null?void 0:l.id)??""),targetBox:Ne(x,(l==null?void 0:l.id)??"")}),m=cc(f.G.construct(e,t),p,x.getZoom(),!1);return i.jsxRuntimeExports.jsx(tu,{points:m,style:{...c,stroke:f.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},z1=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:o,targetPosition:r,style:l,segments:c=[],onSegmentsChange:a,color:u="var(--pluto-gray-l9)",selected:d=!1,variant:x="pipe",...p})=>{const m=f.G.construct(p.sourceX,p.sourceY),h=g.useRef(m),E=f.G.equals(m,h.current),w=f.G.construct(p.targetX,p.targetY),R=g.useRef(w),k=f.G.equals(w,R.current),S=wt(),[j,b,M]=y.useCombinedStateAndRef(()=>c.length>0?c:vt({sourcePos:m,targetPos:w,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),v=g.useRef(r),N=g.useRef(s),L=y.useDebouncedCallback(a,100,[a]);if(!E||!k){let C=j;const I=f.G.translation(h.current,m),_=f.G.translation(w,R.current);f.G.equals(I,f.G.scale(_,-1),.001)?(h.current=m,R.current=w):(E?k||(C=rg({delta:_,segments:C}),v.current!==r&&(v.current=r,C=vt({sourcePos:m,targetPos:w,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),Or({sourcePos:m,targetPos:w,next:C,prev:j})||(C=vt({sourcePos:m,targetPos:w,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),R.current=w):(C=og({delta:I,segments:C}),N.current!==s&&(N.current=s,C=vt({sourcePos:m,targetPos:w,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),Or({sourcePos:m,targetPos:w,next:C,prev:j})||(C=vt({sourcePos:m,targetPos:w,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),h.current=m),L(C),b(C))}const T=g.useRef(null),D=y.useCursorDrag({onStart:g.useCallback((C,I,_)=>{T.current={index:Number(_.currentTarget.id.split("-")[1]),segments:[...M.current]}},[]),onMove:g.useCallback(C=>{if(T.current==null)return;const I=eg({segments:T.current.segments,index:T.current.index,magnitude:f.Eo.dim(C,f.g.swap(T.current.segments[T.current.index].direction),!0)/S.getZoom()});b(I)},[]),onEnd:g.useCallback(()=>a(M.current),[a])}),$=cc(m,j,S.getZoom(),!0),B=eu[x];return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(B,{points:$,color:u}),d&&B1($).map((C,I)=>{const _=j[I].direction,O=f.g.swap(_),P={[f.g.dimension(_)]:"18px",[f.g.dimension(O)]:"4px"},z={[_]:C[_]-9,[O]:C[O]-2};return i.jsxRuntimeExports.jsxs(g.Fragment,{children:[i.jsxRuntimeExports.jsx("rect",{className:f.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...P,...z,rx:"2px",ry:"2px"}),i.jsxRuntimeExports.jsx("foreignObject",{x:C.x-9,y:C.y-9,width:"18px",height:"18px",children:i.jsxRuntimeExports.jsx("div",{id:`handle-${I}`,className:f.CSS(f.CSS.BE("diagram-edge-handle","dragger"),f.CSS.dir(_)),draggable:!0,onDragStart:D})})]},I)})]})},B1=e=>e.slice(1).map((t,n)=>{const s=e[n];return f.G.construct((t.x+s.x)/2,(t.y+s.y)/2)}),V1=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:f.G.ZERO,zoom:1}})=>{const[o,r]=g.useState(n),[l,c]=g.useState(e),[a,u]=g.useState(t),[d,x]=g.useState(s),[p,m]=g.useState(!1);return{viewport:d,onViewportChange:x,edges:a,nodes:l,onNodesChange:c,onEdgesChange:u,editable:o,onEditableChange:r,fitViewOnResize:p,setFitViewOnResize:m}},F1=()=>!0,H1={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},Z1={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesReconnectable:!1,nodesFocusable:!1,reconnectRadius:0},ou={maxZoom:1,minZoom:.5},G1={hideAttribution:!0},ru=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Sn=()=>g.useContext(ru),iu=g.memo(({children:e})=>{const{registerNodeRenderer:t}=Sn();return g.useEffect(()=>t(e),[t,e]),null});iu.displayName="NodeRenderer";const Y1=["Backspace","Delete"],W1=y.wrap$1(A.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:s,nodes:o,edges:r,onEditableChange:l,editable:c,viewport:a,triggers:u,onViewportChange:d,fitViewOnResize:x,setFitViewOnResize:p,visible:m,...h})=>{const E=y.useMemoDeepEqualProps({visible:m}),[{path:w},,R]=y.use$3({aetherKey:e,type:A.Diagram$1.TYPE,schema:A.diagramStateZ,initialState:{position:a.position,region:f.Eo.ZERO,zoom:a.zoom,...E}});g.useEffect(()=>R(X=>({...X,...E})),[E]);const k=y.use().colors.gray.l9.hex,S=y.useMemoCompare(()=>u??Do.zoom,y.compareModeConfigs,[u]),{fitView:j}=wt(),b=y.useDebouncedCallback(X=>j(X),50,[j]),M=pn(g.useCallback(X=>{x&&b({maxZoom:1}),R(se=>({...se,region:X}))},[R,b,x])),v=g.useRef(null),N=g.useCallback(X=>{const se=v.current;se!=null&&se.x===X.x&&se.y===X.y&&se.zoom===X.zoom||(v.current=X,!(isNaN(X.x)||isNaN(X.y)||isNaN(X.zoom))&&(R(fe=>({...fe,position:X,zoom:X.zoom})),d(pc(X))))},[R,d]);t1({onStart:N,onChange:N,onEnd:N});const[L,T]=g.useState(()=>()=>null),D=g.useCallback(X=>T(()=>X),[]),$=g.useMemo(()=>({custom:({id:X,positionAbsoluteX:se,positionAbsoluteY:fe,selected:Me=!1,draggable:Ye=!0})=>L({symbolKey:X,position:{x:se,y:fe},selected:Me,draggable:Ye})}),[L]),B=g.useRef(r),C=g.useMemo(()=>(B.current=r,Qo(r)),[r]),I=g.useRef(o),_=g.useMemo(()=>(I.current=o,Uo(o)),[o]),O=g.useCallback(X=>n(mc(I.current,se=>Ca(X,se))),[n]),P=g.useCallback(X=>s(On(B.current,se=>wa(X,se),k)),[s,k]),z=g.useCallback((X,se)=>s(On(B.current,fe=>Rj(X,se,fe),k)),[]),V=g.useCallback(X=>{s(On(B.current,se=>oa(X,se),k))},[s,k]),Z=g.useCallback((X,se)=>{const fe=[...B.current],Me=fe.findIndex(Ye=>Ye.key===X);Me!==-1&&(fe[Me]={...fe[Me],segments:se},B.current=fe,s(fe))},[s]),Y=c?H1:Z1,ee=y.useSyncedRef(Z),K=g.useMemo(()=>({default:X=>{var se,fe,Me;return i.jsxRuntimeExports.jsx(z1,{...X,segments:((se=X.data)==null?void 0:se.segments)??[],color:(fe=X.data)==null?void 0:fe.color,variant:(Me=X.data)==null?void 0:Me.variant,onSegmentsChange:g.useCallback(Ye=>ee.current(X.id,Ye),[X.id])},X.id)}}),[]),U=y.useHeld({triggers:[["Q"]],loose:!0}),Q=g.useRef(null);y.use$1({triggers:S.zoomReset,callback:g.useCallback(({stage:X,cursor:se})=>{const fe=Q.current;fe==null||X!=="start"||!f.Eo.contains(fe,se)||j()},[j])});const ne=y.purgeMouse(S.select)[0]??null,W=y.purgeMouse(S.pan)[0]??null,ie=y.purgeMouse(S.zoom)[0]??null,de={selectionOnDrag:ne==null,panOnDrag:W==null,selectionKeyCode:ne,panActivationKeyCode:W,zoomActivationKeyCode:ie},ae=y.useCombinedRefs(Q,M),te=g.useMemo(()=>({visible:m,editable:c,onEditableChange:l,registerNodeRenderer:D,fitViewOnResize:x,setFitViewOnResize:p}),[c,m,l,D,x]);return i.jsxRuntimeExports.jsx(ru.Provider,{value:te,children:i.jsxRuntimeExports.jsx(y.Composite,{path:w,children:m&&i.jsxRuntimeExports.jsx(J0,{...de,className:f.CSS(f.CSS.B("diagram"),f.CSS.editable(c)),nodes:_,edges:C,nodeTypes:$,edgeTypes:K,ref:ae,fitView:!0,onNodesChange:O,onEdgesChange:P,onConnect:V,onReconnect:z,defaultViewport:fc(a),connectionLineComponent:O1,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:F1,connectionMode:St.Loose,snapGrid:[2,2],snapToGrid:!0,fitViewOptions:ou,selectionMode:At.Partial,proOptions:G1,deleteKeyCode:Y1,...h,style:{[f.CSS.var("diagram-zoom")]:a.zoom,...h.style},...Y,nodesDraggable:c&&!U.held,children:t})})})}),X1=()=>{const{editable:e}=Sn();return e?i.jsxRuntimeExports.jsx(i1,{}):null},K1=({children:e,...t})=>i.jsxRuntimeExports.jsx(J.Pack,{direction:"y",borderShade:4,className:f.CSS.BE("diagram","controls"),...t,children:e}),q1=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=Sn();return i.jsxRuntimeExports.jsx(y.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:f.K.RIGHT_CENTER,tooltip:n?i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Disable edit mode"}):i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?i.jsxRuntimeExports.jsx(y.e4.EditOff,{}):i.jsxRuntimeExports.jsx(y.e4.Edit,{})})},U1=({onClick:e,...t})=>{const{fitView:n}=wt(),{fitViewOnResize:s,setFitViewOnResize:o}=Sn();return i.jsxRuntimeExports.jsx(y.ToggleIcon,{onClick:r=>{n(ou),e==null||e(r)},value:s,onChange:r=>o(r),rightClickToggle:!0,tooltip:i.jsxRuntimeExports.jsx(y.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:f.K.RIGHT_CENTER,variant:"outlined",...t,children:i.jsxRuntimeExports.jsx(y.e4.Expand,{})})},Q1=e=>i.jsxRuntimeExports.jsx(Ka,{children:i.jsxRuntimeExports.jsx(W1,{...e})}),J1=Object.freeze(Object.defineProperty({__proto__:null,Background:X1,Controls:K1,DefaultPath:tu,Diagram:Q1,FitViewControl:U1,HandleLayout:su,NodeLayout:Ps,NodeRenderer:iu,PATHS:eu,PATH_TYPES:nu,SelectPathType:$1,ToggleEditControl:q1,alignNodes:ag,calcPath:at,edgeConverter:On,edgeZ:lg,nodeConverter:mc,nodeZ:cg,offsetPath:b1,rfEdgeDataZ:uc,selectNode:fr,selectNodeBox:Ne,selectNodeLayout:D1,translateEdgesBackward:xc,translateEdgesForward:Qo,translateNodesBackward:dc,translateNodesForward:Uo,translateViewportBackward:pc,translateViewportForward:fc,use:V1,useContext:Sn,viewportZ:ig},Symbol.toStringTag,{value:"Module"})),eR=y.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:o=i.jsxRuntimeExports.jsx(y.Text$2.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:r,telem:l,...c})=>{const a=y.useMemoDeepEqualProps({font:t,color:r,telem:l,visible:s}),[,{scrolling:u,empty:d},x]=y.use$3({aetherKey:e,type:A.Log.TYPE,schema:A.logState,initialState:{empty:!0,region:f.Eo.ZERO,scrolling:!1,wheelPos:0,...a}});g.useEffect(()=>{x(m=>({...m,...a}))},[a,x]);const p=pn(g.useCallback(m=>x(h=>({...h,region:m})),[x]));return i.jsxRuntimeExports.jsx("div",{ref:p,className:f.CSS(f.CSS.B("log"),n),onWheel:m=>{x(h=>({...h,wheelPos:h.wheelPos-m.deltaY,scrolling:h.scrolling?h.scrolling:m.deltaY<0}))},...c,children:d?o:i.jsxRuntimeExports.jsx(y.Icon,{className:f.CSS(f.CSS.BE("log","live"),u&&f.CSS.M("active")),variant:"outlined",onClick:()=>x(m=>({...m,scrolling:!m.scrolling})),tooltip:u?"Resume Scrolling":"Pause Scrolling",children:i.jsxRuntimeExports.jsx(y.e4.Dynamic,{})})})}),tR=Object.freeze(Object.defineProperty({__proto__:null,Log:eR},Symbol.toStringTag,{value:"Module"})),nR=({value:e,showOuter:t=!0,showInner:n,onChange:s})=>{const{outer:o}=e,r=l=>()=>s({...e,...l});return t?i.jsxRuntimeExports.jsxs(J.Space,{className:f.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(lt,{selected:o==="top",onClick:r({outer:"top"})}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(lt,{selected:o==="left",onClick:r({outer:"left"})}),i.jsxRuntimeExports.jsx(zi,{showInner:n,value:e,onChange:s}),i.jsxRuntimeExports.jsx(lt,{selected:o==="right",onClick:r({outer:"right"})})]}),i.jsxRuntimeExports.jsx(lt,{selected:o==="bottom",onClick:r({outer:"bottom"})})]}):i.jsxRuntimeExports.jsx(zi,{className:f.CSS.B("orientation-control"),value:e,onChange:s})},zi=({value:e,onChange:t,className:n,showInner:s=!0,...o})=>{const{inner:r}=e,l=a=>()=>t({...e,...a});let c={};return s||(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),i.jsxRuntimeExports.jsxs(J.Space,{className:f.CSS(n,f.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...o,children:[i.jsxRuntimeExports.jsx(lt,{style:c,disabled:!s,className:f.CSS(f.CSS.dir("y")),selected:r==="top",onClick:l({inner:"top"})}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",justify:"center",children:[i.jsxRuntimeExports.jsx(lt,{style:c,disabled:!s,selected:r==="left",onClick:l({inner:"left"})}),i.jsxRuntimeExports.jsx(lt,{style:c,disabled:!s,selected:r==="right",onClick:l({inner:"right"})})]}),i.jsxRuntimeExports.jsx(lt,{style:c,disabled:!s,className:f.CSS(f.CSS.dir("y")),selected:r==="bottom",onClick:l({inner:"bottom"})})]})},lt=({selected:e,className:t,...n})=>i.jsxRuntimeExports.jsx(y.Icon,{variant:"text",className:f.CSS(t,f.CSS.selected(e)),...n,children:i.jsxRuntimeExports.jsx("div",{className:"symbol"})}),$e=({className:e,direction:t,...n})=>i.jsxRuntimeExports.jsx(J.Space,{direction:t,align:"stretch",className:f.CSS(f.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),bt=({showOuter:e,showInner:t,...n})=>i.jsxRuntimeExports.jsx(he,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:o})=>{var r;return i.jsxRuntimeExports.jsx(nR,{value:{inner:s.orientation??"top",outer:((r=s.label)==null?void 0:r.orientation)??"top"},showInner:t,showOuter:e,onChange:l=>o({...s,orientation:l.inner,label:{...s.label,orientation:l.outer}})})}}),Ft=({path:e,omit:t=[]})=>i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(he,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>i.jsxRuntimeExports.jsx(y.Text$1,{selectOnFocus:!0,...n})}),i.jsxRuntimeExports.jsx(Pt,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px"},padHelpText:!1}),i.jsxRuntimeExports.jsx(he,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>i.jsxRuntimeExports.jsx(Ce.SelectLevel,{...n})}),i.jsxRuntimeExports.jsx(he,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>i.jsxRuntimeExports.jsx(fs,{...n})}),i.jsxRuntimeExports.jsx(he,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:n=>i.jsxRuntimeExports.jsx(fl,{...n,yDirection:"down"})})]}),Qe=e=>i.jsxRuntimeExports.jsx(he,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...o})=>i.jsxRuntimeExports.jsx(y.Swatch,{value:t??f.ZERO.setAlpha(1).rgba255,onChange:r=>n(r.rgba255),...o,bordered:!0})}),sR=e=>i.jsxRuntimeExports.jsx(he,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:t=>i.jsxRuntimeExports.jsx(y.Numeric,{dragScale:1,bounds:{lower:.5,upper:15},...t})}),je=({omit:e})=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(Ft,{omit:e,path:"label"}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Qe,{path:"color",optional:!0}),i.jsxRuntimeExports.jsx(he,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:t=>i.jsxRuntimeExports.jsx(y.Switch$1,{...t})}),i.jsxRuntimeExports.jsx(sR,{path:"scale"})]})]}),i.jsxRuntimeExports.jsx(bt,{path:""})]}),oR=({path:e})=>{var u,d;const{value:t,onChange:n}=xt({path:e}),s=A.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=A.sinkPipelinePropsZ.parse((d=t.sink)==null?void 0:d.props),r=A.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=A.setChannelValuePropsZ.parse(o.segments.setter.props),c=x=>{x??(x=0);const p=A.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:A.streamChannelValue({channel:x}),threshold:A.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:p})},a=x=>{x??(x=0);const p=A.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:A.setChannelValue({channel:x}),setpoint:A.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),m=A.authoritySource({channel:x}),h=A.acquireChannelControl({channel:x,authority:255});n({...t,sink:p,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:h,source:m},indicator:{statusSource:m}}})};return i.jsxRuntimeExports.jsxs($e,{direction:"x",grow:!0,align:"stretch",children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"State Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:r.channel,onChange:c})}),i.jsxRuntimeExports.jsx(Pe.Item,{label:"Command Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:l.channel,onChange:a})}),i.jsxRuntimeExports.jsx(Fo,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},pr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ve=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(oR,{path:""});default:return i.jsxRuntimeExports.jsx(je,{})}},[]),t=Se.useStatic({tabs:pr,content:e});return i.jsxRuntimeExports.jsx(Se.Tabs,{...t})},mt={y:2,x:.25},nn={lower:0,upper:2e3},Bi={lower:0,upper:51},lu=({includeBorderRadius:e=!1})=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",children:[i.jsxRuntimeExports.jsx(Ft,{path:"label"}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Qe,{path:"color"}),i.jsxRuntimeExports.jsx(Qe,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(he,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:t,dragScale:mt,bounds:Bi,endContent:"%",...n})}),i.jsxRuntimeExports.jsx(he,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:t,dragScale:mt,bounds:Bi,endContent:"%",...n})}),e&&i.jsxRuntimeExports.jsx(he,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:t,dragScale:mt,bounds:nn,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(he,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:t??200,dragScale:mt,bounds:nn,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(he,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:t??200,dragScale:mt,bounds:nn,endContent:"px",...n})})]})]}),i.jsxRuntimeExports.jsx(bt,{path:"",showInner:!1})]}),cu=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],rR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsxs($e,{direction:"y",empty:!0,children:[i.jsxRuntimeExports.jsx(Ko,{path:""}),";"]});default:return i.jsxRuntimeExports.jsxs($e,{direction:"x",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(Ft,{path:"label"}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Qe,{path:"color"}),i.jsxRuntimeExports.jsx(he,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(y.Text$1,{...s})}),i.jsxRuntimeExports.jsx(Pt,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),i.jsxRuntimeExports.jsx(he,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(Ce.SelectLevel,{...s})})]})]}),i.jsxRuntimeExports.jsx(bt,{path:"",showInner:!1})]})}},[]),t=Se.useStatic({tabs:cu,content:e});return i.jsxRuntimeExports.jsx(Se.Tabs,{...t})},iR=({path:e})=>{var u;const{value:t,onChange:n}=xt({path:e}),s=A.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=A.streamChannelValuePropsZ.parse(s.segments.valueStream.props),r=A.withinBoundsProps.parse(s.segments.threshold.props),l=d=>{d??(d=0);const x=A.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:A.streamChannelValue({channel:d}),threshold:A.withinBounds({trueBound:{lower:r.trueBound.lower??.9,upper:r.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:x})},c=d=>{const x=A.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:A.streamChannelValue({channel:o.channel}),threshold:A.withinBounds({trueBound:d})},outlet:"threshold"});n({...t,source:x})},a=xs(o.channel);return g.useEffect(()=>n({...t}),[a]),i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Input Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:o.channel,onChange:l})}),i.jsxRuntimeExports.jsx(Pe.Item,{label:"Lower Threshold",children:i.jsxRuntimeExports.jsx(y.Numeric,{value:r.trueBound.lower??.9,onChange:d=>c({...r.trueBound,lower:d})})}),i.jsxRuntimeExports.jsx(Pe.Item,{label:"Upper Threshold",children:i.jsxRuntimeExports.jsx(y.Numeric,{value:r.trueBound.upper??1.1,onChange:d=>c({...r.trueBound,upper:d})})})]})},lR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsx(iR,{path:""});default:return i.jsxRuntimeExports.jsx(je,{})}},[]),t=Se.useStatic({tabs:cu,content:e});return i.jsxRuntimeExports.jsx(Se.Tabs,{...t})},cR=({path:e})=>{var l;const{value:t,onChange:n}=xt({path:e}),s=A.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),o=A.setChannelValuePropsZ.parse(s.segments.setter.props),r=c=>{c??(c=0);const a=A.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:A.setChannelValue({channel:c}),setpoint:A.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),u=A.authoritySource({channel:c}),d=A.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:u},showIndicator:!0,indicator:{statusSource:u}}})};return i.jsxRuntimeExports.jsxs($e,{direction:"x",children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Output Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:o.channel,onChange:r})}),i.jsxRuntimeExports.jsx(Pt,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),i.jsxRuntimeExports.jsx(Fo,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},aR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(cR,{path:""});default:return i.jsxRuntimeExports.jsx(je,{omit:["align","maxInlineSize"]})}},[]),t=Se.useStatic({tabs:pr,content:e});return i.jsxRuntimeExports.jsx(Se.Tabs,{...t})},uR=({path:e})=>{var u,d;const{value:t,onChange:n}=xt({path:e}),s=A.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=A.sinkPipelinePropsZ.parse((d=t.sink)==null?void 0:d.props),r=A.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=A.setChannelValuePropsZ.parse(o.segments.setter.props),c=x=>{x??(x=0);const p=A.sourcePipeline("number",{connections:[],segments:{valueStream:A.streamChannelValue({channel:x})},outlet:"valueStream"});n({...t,source:p})},a=x=>{x??(x=0);const p=A.sinkPipeline("number",{connections:[],segments:{setter:A.setChannelValue({channel:x})},inlet:"setter"}),m=A.authoritySource({channel:x}),h=A.acquireChannelControl({channel:x,authority:255});n({...t,sink:p,control:{...t.control,showChip:!0,chip:{sink:h,source:m},showIndicator:!0,indicator:{statusSource:m}}})};return i.jsxRuntimeExports.jsxs($e,{direction:"x",grow:!0,align:"stretch",children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"State Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:r.channel,onChange:c})}),i.jsxRuntimeExports.jsx(Pe.Item,{label:"Command Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:l.channel,onChange:a})})]})},dR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(uR,{path:""});default:return i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsx(Ft,{path:"label"}),i.jsxRuntimeExports.jsx(Vo,{path:"units",label:"Units",align:"start",padHelpText:!1}),i.jsxRuntimeExports.jsx(Qe,{path:"color"})]}),i.jsxRuntimeExports.jsx(bt,{path:""})]})}},[]),t=Se.useStatic({tabs:pr,content:e});return i.jsxRuntimeExports.jsx(Se.Tabs,{...t})},xR=()=>{const e=xt({path:"autoFit",optional:!0});return i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(he,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>i.jsxRuntimeExports.jsx(y.Text$1,{selectOnFocus:!0,...t})}),i.jsxRuntimeExports.jsx(he,{path:"level",label:"Text Size",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Ce.SelectLevel,{...t})}),i.jsxRuntimeExports.jsx(he,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>i.jsxRuntimeExports.jsx(fs,{...t})})]}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Qe,{path:"color"}),i.jsxRuntimeExports.jsx(he,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(y.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:i.jsxRuntimeExports.jsx(y.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:i.jsxRuntimeExports.jsx(y.e4.AutoFitWidth,{})})})})]})]}),i.jsxRuntimeExports.jsx(bt,{path:""})]})},fR=()=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(Ft,{path:"label",omit:["maxInlineSize","align"]}),i.jsxRuntimeExports.jsx(Qe,{path:"color"})]}),i.jsxRuntimeExports.jsx(bt,{path:"",showOuter:!1})]}),pR=()=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,empty:!0,children:[i.jsxRuntimeExports.jsx(Ft,{path:"label"}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Qe,{path:"color"}),i.jsxRuntimeExports.jsx(Qe,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(he,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:e??200,dragScale:mt,bounds:nn,endContent:"px",...t})}),i.jsxRuntimeExports.jsx(he,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>i.jsxRuntimeExports.jsx(y.Numeric,{value:e??200,dragScale:mt,bounds:nn,endContent:"px",...t})})]})]}),i.jsxRuntimeExports.jsx(bt,{path:"",showInner:!1})]}),q=e=>i.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),nt=e=>i.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Ge=e=>i.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),xe=e=>i.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),mR={left:{left:G.Left,right:G.Right,top:G.Top,bottom:G.Bottom},right:{left:G.Right,right:G.Left,top:G.Bottom,bottom:G.Top},top:{left:G.Bottom,right:G.Top,top:G.Left,bottom:G.Right},bottom:{left:G.Top,right:G.Bottom,top:G.Right,bottom:G.Left}},hR=(e,t)=>mR[t][e],gR=(e,t=!1)=>{if(t)return e;switch(e){case G.Left:return G.Right;case G.Right:return G.Left;case G.Top:return G.Bottom;case G.Bottom:return G.Top;default:return G.Top}},yR=(e,t,n,s=!1)=>s?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},le=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=e1()}catch{return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{})}const o=g.useRef(null),r=g.useRef(!0);return g.useEffect(()=>{if(o.current==null)return;if(r.current){r.current=!1;return}const l=o.current.closest(".react-flow__node"),c=l==null?void 0:l.getAttribute("data-id");c!=null&&(s==null||s(c))},[t,n]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{ref:o}),e]})},F=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:o,top:r,...l})=>{const c=yR(r,s,t,n);return i.jsxRuntimeExports.jsx(fn,{position:gR(hR(e,t),!o),...l,type:"source",onClick:a=>a.stopPropagation(),className:(f.CSS.B("handle"),f.CSS.BE("handle",l.id)),style:{left:`${c.left}%`,top:`${c.top}%`}})},ke=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:o,...r})=>i.jsxRuntimeExports.jsx("button",{className:f.CSS(f.CSS.B("symbol-primitive"),f.CSS.B("symbol-primitive-toggle"),s!=null&&f.CSS.loc(s),t&&f.CSS.M("enabled"),n&&f.CSS.M("triggered"),e),color:f.cssString(o),...r}),ge=({className:e,...t})=>i.jsxRuntimeExports.jsx("div",{className:f.CSS(f.CSS.B("symbol-primitive"),e),...t}),ER=.8,ue=({dimensions:e,orientation:t="left",children:n,className:s,color:o,style:r={},scale:l=1,...c})=>{e=f.g.construct(t)==="y"?f._.swap(e):e;const u=f.cssString(o),d=y.use();return o!=null&&(r[f.CSS.var("symbol-color")]=new f.Color(o).rgbString,r[f.CSS.var("symbol-color-contrast")]=new f.Color(o).pickByContrast(d.colors.gray.l0,d.colors.gray.l10).rgbString),i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:f._.svgViewBox(e),className:f.CSS(f.CSS.loc(t),s),fill:u,stroke:u,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:f._.scale(e,l*ER).width,...r},children:i.jsxRuntimeExports.jsx("g",{children:n})})},au=({className:e,orientation:t="left",scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,orientation:t,className:f.CSS(f.CSS.B("four-way-valve"),e),children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:87},color:s,scale:n,children:[i.jsxRuntimeExports.jsx(q,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),i.jsxRuntimeExports.jsx(q,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),uu=({color:e,orientation:t="left",scale:n,...s})=>i.jsxRuntimeExports.jsxs(ke,{...s,className:f.CSS(f.CSS.B("three-way-valve")),orientation:t,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[i.jsxRuntimeExports.jsx(q,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),i.jsxRuntimeExports.jsx(q,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),du=({orientation:e="left",color:t,scale:n,...s})=>i.jsxRuntimeExports.jsxs(ke,{...s,children:[i.jsxRuntimeExports.jsxs(le,{orientation:e,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(ue,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:i.jsxRuntimeExports.jsx(q,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),xu=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ke,{className:f.CSS(f.CSS.B("solenoid-valve"),s&&f.CSS.M("normally-open"),e),...r,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:69},color:t,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(q,{className:f.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),i.jsxRuntimeExports.jsx(xe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),i.jsxRuntimeExports.jsx(nt,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),fu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{orientation:t,className:f.CSS(f.CSS.B("relief-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),i.jsxRuntimeExports.jsx(q,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),pu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{orientation:t,className:f.CSS(f.CSS.B("check-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(xe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),mu=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const r=f.cssString(n);return i.jsxRuntimeExports.jsxs(ge,{...o,orientation:t,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(Ge,{cx:"7",cy:"7",r:"4",fill:r}),i.jsxRuntimeExports.jsx(q,{d:"M7 39.5V11.5941C7 9.42886 9.22384 7.97669 11.2063 8.84738L76.7937 37.6526C78.7762 38.5233 81 37.0711 81 34.9059V6",strokeLinecap:"round"})]})]})},hu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,orientation:n,className:f.CSS(f.CSS.B("angled-valve"),t),children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),i.jsxRuntimeExports.jsx(q,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"})]})]}),gu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ge,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"2",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"62",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)})]})]}),yu=({className:e,color:t,orientation:n="left",scale:s,...o})=>{const r=f.cssString(t);return i.jsxRuntimeExports.jsxs(ge,{...o,className:f.CSS(f.CSS.B("symbol"),e),children:[i.jsxRuntimeExports.jsx(le,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:5,top:50,id:"1"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),i.jsxRuntimeExports.jsx(q,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:r}),i.jsxRuntimeExports.jsx(q,{d:"M33 24H2",strokeLinecap:"round"})]})]})},Eu=({className:e,color:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{...o,className:f.CSS(f.CSS.B("symbol"),e),children:[i.jsxRuntimeExports.jsx(le,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(nt,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),i.jsxRuntimeExports.jsx(q,{d:"M13 68V47C13 46.4477 13.4489 45.9892 13.9928 45.8933C16.1351 45.5152 21 43.7981 21 36C21 28.2019 16.1351 26.4848 13.9928 26.1068C13.4489 26.0108 13 25.5523 13 25V4",strokeWidth:"2"})]})]}),ju=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("cap"),e),...o,children:[i.jsxRuntimeExports.jsx(le,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),i.jsxRuntimeExports.jsx(ue,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(q,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),Su=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("cap"),e),...o,children:[i.jsxRuntimeExports.jsx(le,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:50,top:50,id:"1"})}),i.jsxRuntimeExports.jsx(ue,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(q,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),Ru=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("manual-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(xe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),i.jsxRuntimeExports.jsx(q,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),Cu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("orifice_plate"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{color:n,dimensions:{width:96,height:48},orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(nt,{x:"3",y:"3",width:"90",height:"42",rx:"2",ry:"2"}),i.jsxRuntimeExports.jsx(xe,{x1:"33",y1:"3",x2:"33",y2:"21",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"33",y1:"27",x2:"33",y2:"45",strokeLinecap:"round"})]})]}),wu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("filter"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(ue,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:i.jsxRuntimeExports.jsx(q,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17"})})]}),bu=e=>typeof e=="number"?{topLeft:f.G.construct(e),topRight:f.G.construct(e),bottomLeft:f.G.construct(e),bottomRight:f.G.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:f.G.construct(e.topLeft),topRight:f.G.construct(e.topRight),bottomLeft:f.G.construct(e.bottomLeft),bottomRight:f.G.construct(e.bottomRight)}:e,jR=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:o}=e;return`${t.x}% ${n.x}% ${o.x}% ${s.x}% / ${t.y}% ${n.y}% ${o.y}% ${s.y}%`},vu={width:40,height:80},mr={x:50,y:10},Ns=({className:e,dimensions:t=vu,borderRadius:n=mr,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=bu(n),a=s==null,u=y.use(),d=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]);return i.jsxRuntimeExports.jsx(ge,{className:f.CSS(e,f.CSS.B("tank")),style:{...t,borderRadius:s??jR(c),borderColor:f.cssString(o??u.colors.gray.l9),backgroundColor:r==null?void 0:f.cssString(r)},...l,children:i.jsxRuntimeExports.jsxs(le,{refreshDeps:d,orientation:"left",children:[i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:0,id:"1"}),a&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:-.5,top:c.topLeft.y-1,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:101,top:c.topRight.y-1,id:"3"})]}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),a&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:-.5,top:100-c.bottomLeft.y+1,id:"5"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:101,top:100-c.bottomRight.y+1,id:"6"})]}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},_u=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(e,f.CSS.B("regulator")),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),i.jsxRuntimeExports.jsx(q,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),i.jsxRuntimeExports.jsx(xe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),ku=({className:e,orientation:t="left",scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("orifice"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[i.jsxRuntimeExports.jsx(q,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Mu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("needle-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:f.cssString(n)}),i.jsxRuntimeExports.jsx(q,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),Pu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{orientation:t,className:f.CSS(f.CSS.B("angled-relief-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:32.8125,top:97.5922,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.0278,top:45.5639,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:79},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(xe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),i.jsxRuntimeExports.jsx(q,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),Nu=({className:e,color:t,dimensions:n,orientation:s="left",units:o="psi",unitsLevel:r="small",children:l,inlineSize:c=80,...a})=>{const u=f.cssString(t),d=y.use(),x=t==null?"var(--pluto-gray-l0)":f.cssString(new f.Color(t).pickByContrast(d.colors.gray.l0,d.colors.gray.l9)),p=2.5*((n==null?void 0:n.width)??0)/500;return i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("value"),e),...a,style:{borderColor:u,height:n==null?void 0:n.height,width:"100%"},children:[i.jsxRuntimeExports.jsx("div",{className:f.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:c},children:l}),i.jsxRuntimeExports.jsxs(le,{orientation:s,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:-2+p,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:102-p,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),i.jsxRuntimeExports.jsx("div",{className:f.CSS(f.CSS.BE("value","units"),f.CSS.M(r)),style:{background:u},children:i.jsxRuntimeExports.jsx(y.Text,{level:r,color:x,children:o})})]})},Lu=({enabled:e=!1,onClick:t,orientation:n="left"})=>i.jsxRuntimeExports.jsxs(ge,{orientation:n,children:[i.jsxRuntimeExports.jsx(y.Switch$1,{value:e,onClick:t,onChange:()=>{}}),i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Tu=({onClick:e,orientation:t="left",label:n="",color:s,size:o,level:r,onClickDelay:l})=>i.jsxRuntimeExports.jsxs(ge,{orientation:t,children:[i.jsxRuntimeExports.jsx(y.Button,{onClick:e,color:s,size:o,level:r,onClickDelay:l,children:n}),i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:100,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:0,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),Au=({className:e,orientation:t="left",text:n="",width:s,color:o="var(--pluto-gray-l9)",level:r,autoFit:l,align:c="center"})=>{const a={textAlign:c};return f.g.construct(t)==="y"?a.height=l?"fit-content":s:a.width=l?"fit-content":s,i.jsxRuntimeExports.jsx(ge,{style:a,orientation:t,className:f.CSS(f.CSS.B("text-box"),f.CSS.loc(t),e),children:i.jsxRuntimeExports.jsx(y.Text,{color:f.cssString(o),level:r,children:n})})},Iu=({orientation:e="left",className:t,onClick:n,children:s,value:o,units:r,color:l,onChange:c,...a})=>{const[u,d]=g.useState(o);return i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("setpoint"),t),orientation:e,...a,children:[i.jsxRuntimeExports.jsxs(le,{orientation:e,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:e,left:1,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:e,left:100,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:e,left:50,top:-2,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),i.jsxRuntimeExports.jsx(y.Numeric,{size:"small",value:u,onChange:d,showDragHandle:!1,selectOnFocus:!0,endContent:r,color:l,style:{[f.CSS.var("pack-border-shade")]:f.cssString(l)},borderWidth:2,children:i.jsxRuntimeExports.jsx(y.Button,{variant:"outlined",size:"small",onClick:()=>c(u),color:l,children:"Set"})})]})},$u=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("screw-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ge,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"2",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"62",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(q,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(q,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:f.CSS(f.CSS.M("detail"),t)})]})]}),Du=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("vacuum-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ge,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(xe,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:f.CSS(f.CSS.M("detail"),t)})]})]}),Ou=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("cavity-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ge,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"2",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"62",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(q,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:f.CSS(f.CSS.M("detail"),t)})]})]}),zu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("piston-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ge,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"2",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"62",x2:"62",y2:"32",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(q,{d:"M 23 32, h 16, m 0 -8, v 16",className:f.CSS(f.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Bu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{...o,className:f.CSS(f.CSS.B("static-mixer"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(nt,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),i.jsxRuntimeExports.jsx(q,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Vu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("rotary-mixer"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:f.CSS(f.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:f.CSS(f.CSS.M("detail"),t)})]})]}),Fu=({className:e,color:t,orientation:n="left",enabled:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ge,{...r,orientation:n,className:f.CSS(f.CSS.B("light"),s&&f.CSS.M("enabled"),e),children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),i.jsxRuntimeExports.jsx(ue,{dimensions:{width:64,height:64},color:t,orientation:n,scale:o,children:i.jsxRuntimeExports.jsx(Ge,{cx:"32",cy:"32",r:"30"})})]}),Hu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(e,f.CSS.B("regulator")),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:21.5909,top:25,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:12.5,id:"4"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:70/88*100,top:20/80*100,id:"5"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),i.jsxRuntimeExports.jsx(nt,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),i.jsxRuntimeExports.jsx(xe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),Zu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:100/e,id:"1"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M43 1L43 65",strokeLinecap:"round"})]})]}),Gu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50.5814,top:200/e,id:"4"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),i.jsxRuntimeExports.jsx(q,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),Yu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(nt,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Wu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ke,{...r,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(nt,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),i.jsxRuntimeExports.jsx(xe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:f.CSS(f.CSS.M("detail"),e),strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"49",x2:"43",y2:"83",className:f.CSS(f.CSS.M("detail"),e),strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:f.CSS(f.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),Xu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ke,{...r,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(nt,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),Ku=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ke,{...r,className:f.CSS(f.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"top",left:50,top:100/t,id:"4",orientation:n})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(xe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M5.375 36L70.8204 48.7138C74.0584 49.3428 74.0573 53.9765 70.8189 54.6039L14.7952 65.4584C11.5729 66.0827 11.5494 70.6856 14.7651 71.3429L81.5208 84.9873",strokeLinecap:"round"})]})]}),qu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ke,{...o,className:f.CSS(f.CSS.B("compressor"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:1.5,top:41,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:95,top:3,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:68,height:61},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(Ge,{cx:"35",cy:"25",r:"23"}),i.jsxRuntimeExports.jsx(q,{d:"M50 41.5L56.7186 50.8314C57.6711 52.1544 56.7257 54 55.0955 54H14.9045C13.2743 54 12.3289 52.1544 13.2814 50.8314L20 41.5"}),i.jsxRuntimeExports.jsx(xe,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),i.jsxRuntimeExports.jsx(xe,{x1:"1",y1:"25",x2:"35",y2:"25"})]})]}),Uu=({id:e,className:t,orientation:n="right",label:s="text",color:o="black",level:r="p",onLabelChange:l,...c})=>{const a=document.querySelector(`[data-id="${e}"]`);a&&a.classList.add(n);const u=f.g.construct(n)==="y";return i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("arrow"),f.CSS.loc(n),t),orientation:n,...c,children:[i.jsxRuntimeExports.jsx("div",{className:"wrapper",children:i.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:f.cssString(o)},children:i.jsxRuntimeExports.jsx("div",{className:"bg",children:i.jsxRuntimeExports.jsx(y.MaybeEditable,{value:s,onChange:l,level:r,className:f.CSS.BE("symbol","label")})})})}),i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:u,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:u,id:"2"})]}),i.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[i.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),i.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),i.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},Qu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("vent"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(ue,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(q,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),Ju=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("iso-filter"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:95,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(nt,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),i.jsxRuntimeExports.jsx(xe,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),ed=({className:e,dimensions:t=vu,borderRadius:n=mr,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=bu(n),a=y.use(),u=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]),d=f.cssString(o??a.colors.gray.l9),x=r==null?void 0:f.cssString(r),p=t.width/66,m=t.height/180,h=`scale(${p},${m})`;return i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(e,f.CSS.B("cylinder")),style:{...t},...l,children:[i.jsxRuntimeExports.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:h,children:i.jsxRuntimeExports.jsx("path",{d:"M23 33.6712C11.9844 36.0332 3 42.4382 3 52.8862V174.568C3 176.225 4.34315 177.568 6 177.568H60C61.6569 177.568 63 176.225 63 174.568V52.8862C63 36.3342 40.4511 29.9292 23 33.6712ZM23 33.6712V13.3181C23 0.318109 42.9975 0.318123 42.9975 13.3181V33.6712",vectorEffect:"non-scaling-stroke",strokeWidth:"2",stroke:d,transform:h,fill:x})}),i.jsxRuntimeExports.jsxs(le,{refreshDeps:u,orientation:"left",children:[i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:2,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"})]})]})},td=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const r=f.cssString(n);return i.jsxRuntimeExports.jsxs(ge,{orientation:t,className:f.CSS(f.CSS.B("spring-loaded-relief-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M46.3625 54.1079C45.6312 54.4779 45.6311 55.5223 46.3624 55.8924L81.7435 73.7989C83.7389 74.8088 86.098 73.3588 86.0982 71.1224L86.1002 38.883C86.1003 36.6465 83.7414 35.1962 81.7458 36.2059L46.3625 54.1079Z",stroke:r}),i.jsxRuntimeExports.jsx(q,{d:"M71 38.0014V72.0014",stroke:r,strokeWidth:4,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M41.6389 55.8923C42.3702 55.5222 42.3702 54.4778 41.6389 54.1077L6.2567 36.2035C4.26118 35.1937 1.90217 36.6438 1.90217 38.8803L1.90217 71.1197C1.90217 73.3562 4.26119 74.8063 6.2567 73.7965L41.6389 55.8923Z",stroke:r}),i.jsxRuntimeExports.jsx(Ge,{cx:"44",cy:"55",r:"4",fill:r}),i.jsxRuntimeExports.jsx(q,{d:"M45 4C45 3.44772 44.5523 3 44 3C43.4477 3 43 3.44772 43 4H45ZM37.5777 24.7889L38.0249 23.8944L37.5777 24.7889ZM37.5777 21.2111L38.0249 22.1056L37.5777 21.2111ZM50.4223 31.2111L49.9751 32.1056L50.4223 31.2111ZM37.5777 44.7889L37.1305 45.6833L37.5777 44.7889ZM37.5777 41.2111L37.1305 40.3167L37.5777 41.2111ZM42.8944 47.4472L42.4472 48.3416L42.8944 47.4472ZM45 52V49.2361H43V52H45ZM43.3416 46.5528L38.0249 43.8944L37.1305 45.6833L42.4472 48.3416L43.3416 46.5528ZM38.0249 42.1056L50.8695 35.6833L49.9751 33.8944L37.1305 40.3167L38.0249 42.1056ZM50.8695 30.3167L38.0249 23.8944L37.1305 25.6833L49.9751 32.1056L50.8695 30.3167ZM38.0249 22.1056L50.8695 15.6833L49.9751 13.8944L37.1305 20.3167L38.0249 22.1056ZM50.8695 10.3167L45.5528 7.65836L44.6584 9.44721L49.9751 12.1056L50.8695 10.3167ZM45 6.76393V4H43V6.76393H45ZM45.5528 7.65836C45.214 7.48897 45 7.1427 45 6.76393H43C43 7.90025 43.642 8.93904 44.6584 9.44721L45.5528 7.65836ZM50.8695 15.6833C53.0806 14.5777 53.0807 11.4223 50.8695 10.3167L49.9751 12.1056C50.7121 12.4741 50.7121 13.5259 49.9751 13.8944L50.8695 15.6833ZM38.0249 23.8944C37.2879 23.5259 37.2879 22.4741 38.0249 22.1056L37.1305 20.3167C34.9193 21.4223 34.9194 24.5777 37.1305 25.6833L38.0249 23.8944ZM50.8695 35.6833C53.0806 34.5777 53.0807 31.4223 50.8695 30.3167L49.9751 32.1056C50.7121 32.4741 50.7121 33.5259 49.9751 33.8944L50.8695 35.6833ZM38.0249 43.8944C37.2879 43.5259 37.2879 42.4741 38.0249 42.1056L37.1305 40.3167C34.9193 41.4223 34.9194 44.5777 37.1305 45.6833L38.0249 43.8944ZM45 49.2361C45 48.0998 44.358 47.061 43.3416 46.5528L42.4472 48.3416C42.786 48.511 43 48.8573 43 49.2361H45Z",fill:r,strokeWidth:1})]})]})},nd=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const r=f.cssString(n);return i.jsxRuntimeExports.jsxs(ge,{orientation:t,className:f.CSS(f.CSS.B("spring-loaded-relief-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M23.3625 55.6237C22.6312 55.9937 22.6311 57.0381 23.3624 57.4082L58.7435 75.3147C60.7389 76.3246 63.098 74.8747 63.0981 72.6382L63.1001 40.3988C63.1003 38.1624 60.7414 36.7121 58.7458 37.7217L23.3625 55.6237Z"}),i.jsxRuntimeExports.jsx(q,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),i.jsxRuntimeExports.jsx(q,{d:"M21.8923 58.4348C21.5222 57.7035 20.4778 57.7035 20.1077 58.4348L2.20349 93.817C1.19372 95.8125 2.64384 98.1715 4.8803 98.1715H37.1197C39.3562 98.1715 40.8063 95.8125 39.7965 93.817L21.8923 58.4348Z"}),i.jsxRuntimeExports.jsx(Ge,{cx:"21",cy:"56.0737",r:"4",fill:r}),i.jsxRuntimeExports.jsx(q,{d:"M21 53.0105V50.0225C21 49.3397 20.6516 48.704 20.0759 48.3366L15.6419 45.507C14.4098 44.7207 14.4098 42.9214 15.6419 42.1351L26.3581 35.2965C27.5902 34.5102 27.5902 32.7109 26.3581 31.9246L15.6419 25.0859C14.4098 24.2997 14.4098 22.5003 15.6419 21.714L26.3581 14.8754C27.5902 14.0891 27.5902 12.2898 26.3581 11.5035L21.9241 8.67393C21.3484 8.30656 21 7.67087 21 6.98798V4",stroke:r,strokeLinecap:"round"})]})]})},sd=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ge,{className:f.CSS(f.CSS.B("t-junction"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:1.6667,top:20,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:98.3333,top:20,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:50,top:95,id:"3"})]}),i.jsxRuntimeExports.jsx(ue,{dimensions:{width:36,height:18},color:n,orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(q,{d:"M0 4V2C0 0.895431 0.895431 0 2 0H34C35.1046 0 36 0.89543 36 2V4C36 5.10457 35.1046 6 34 6H23C21.8954 6 21 6.89543 21 8V16C21 17.1046 20.1046 18 19 18H17C15.8954 18 15 17.1046 15 16V8C15 6.89543 14.1046 6 13 6H2C0.895431 6 0 5.10457 0 4Z",fill:f.cssString(n),stroke:"none"})})]}),SR=({aetherKey:e,sink:t})=>{const n=y.useMemoDeepEqualProps({sink:t}),[,,s]=y.use$3({aetherKey:e,type:A.Button.TYPE,schema:A.buttonStateZ,initialState:{trigger:0,sink:t}});return g.useEffect(()=>{s(r=>({...r,...n}))},[n]),{click:g.useCallback(()=>{s(r=>({...r,trigger:r.trigger+1}))},[s])}},RR=({aetherKey:e,source:t})=>{const n=y.useMemoDeepEqualProps({source:t}),[,{enabled:s},o]=y.use$3({aetherKey:e,type:A.Light.TYPE,schema:A.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>o(r=>({...r,...n})),[n,o]),{enabled:s}},CR="Schematic.Grid",wR=({symbolKey:e,items:t,loc:n,onLocationChange:s})=>{const o=`${e}.${CR}`,[r,l]=g.useState(!1),c=g.useCallback(({items:h})=>h.every(E=>E.type===o),[o]),a=y.useSyncedRef(s),{startDrag:u,onDragEnd:d,...x}=y.useDragAndDrop({type:o,canDrop:c,onDrop:g.useCallback(({items:h})=>h,[]),onDragOver:g.useCallback(h=>{l(c(h)),h.items.forEach(({key:E})=>a.current(E,n))},[])}),p=t.filter(h=>h.location===n),m=g.useCallback((h,E)=>u([{key:E,type:o}]),[u,o]);return i.jsxRuntimeExports.jsx(J.Space,{direction:f.K.direction(n),className:f.CSS(f.CSS.BE("grid","item"),f.CSS.loc(n),f.CSS.dropRegion(!0),r&&f.CSS.B("dragging-over")),onDragLeave:()=>l(!1),empty:!0,...x,children:p.map(({element:h,key:E})=>i.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(h,{draggable:!0,onDragStart:w=>m(w,E),onDragEnd:d,style:{cursor:"grab"}})},E))})},Tn=e=>{const{editable:t,items:n,loc:s}=e;if(t)return i.jsxRuntimeExports.jsx(wR,{...e});const o=n.filter(r=>r.location===s);return o.length===0?null:i.jsxRuntimeExports.jsx(J.Space,{direction:f.K.direction(s),className:f.CSS(f.CSS.BE("grid","item"),f.CSS.loc(s)),empty:!0,children:o.map(({element:r,key:l})=>i.jsxRuntimeExports.jsx(g.Fragment,{children:r},l))})},Ht=({symbolKey:e,editable:t,children:n,items:s,onLocationChange:o,onRotate:r})=>i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Tn,{editable:t,items:s,loc:"top",onLocationChange:o,symbolKey:e}),i.jsxRuntimeExports.jsx(Tn,{editable:t,items:s,loc:"left",onLocationChange:o,symbolKey:e}),i.jsxRuntimeExports.jsx(Tn,{editable:t,items:s,loc:"right",onLocationChange:o,symbolKey:e}),i.jsxRuntimeExports.jsx(Tn,{editable:t,items:s,loc:"bottom",onLocationChange:o,symbolKey:e}),t&&i.jsxRuntimeExports.jsx(y.Icon,{className:f.CSS.BE("grid","rotate"),size:"small",variant:"filled",onClick:r,children:i.jsxRuntimeExports.jsx(y.e4.Rotate,{})}),n]}),bR=({aetherKey:e,source:t,sink:n})=>{const s=y.useMemoDeepEqualProps({source:t,sink:n}),[,{value:o},r]=y.use$3({aetherKey:e,type:A.Setpoint.TYPE,schema:A.setpointStateZ,initialState:{trigger:0,value:0,...s}});return g.useEffect(()=>{r(c=>({...c,...s}))},[s,r]),{set:g.useCallback(c=>r(a=>({...a,trigger:a.trigger+1,command:c})),[r]),value:o}},vR=({aetherKey:e,source:t,sink:n})=>{const s=y.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:o,enabled:r},l]=y.use$3({aetherKey:e,type:A.Toggle.TYPE,schema:A.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return g.useEffect(()=>{l(a=>({...a,...s}))},[s,l]),{toggle:g.useCallback(()=>l(a=>({...a,triggered:!a.triggered})),[l]),triggered:o,enabled:r}},Rn=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:o="top",direction:r,align:l,maxInlineSize:c}=e;return n==null||n.length===0?null:{key:"label",element:i.jsxRuntimeExports.jsx(y.Editable,{className:f.CSS(f.CSS.BE("symbol","label"),f.CSS.dir(r)),level:s,value:n,onChange:a=>t==null?void 0:t({label:{...e,label:a}}),allowEmpty:!0,style:{maxInlineSize:c,textAlign:l}}),location:o}},hr=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:o,indicator:r,orientation:l="bottom"}=e;return{key:"control",element:i.jsxRuntimeExports.jsxs(J.Space,{direction:f.g.swap(l),align:"center",className:f.CSS(f.CSS.B("control-state")),size:"small",children:[t&&n&&i.jsxRuntimeExports.jsx(Ul,{size:"small",...o}),t&&s&&i.jsxRuntimeExports.jsx(ec,{...r})]}),location:l}},be=e=>{const t=({symbolKey:n,control:s,source:o,sink:r,label:l,onChange:c,draggable:a,selected:u,orientation:d="left",...x})=>{const{enabled:p,triggered:m,toggle:h}=vR({aetherKey:n,source:o,sink:r}),E=[],w=Rn(l,c);w!=null&&E.push(w);const R=hr(s);return R!=null&&E.push(R),i.jsxRuntimeExports.jsx(Ht,{editable:u&&!a,symbolKey:n,items:E,onRotate:()=>c({orientation:f.K.rotate90(d)}),onLocationChange:(k,S)=>{k==="label"&&c({label:{...l,orientation:S}}),k==="control"&&c({control:{...s,orientation:S}})},children:i.jsxRuntimeExports.jsx(e,{enabled:p,triggered:m,onClick:h,orientation:d,...x})})};return t.displayName=e.displayName,t},Ee=e=>{const t=({symbolKey:n,label:s,onChange:o,selected:r,draggable:l,position:c,orientation:a="left",...u})=>{const d=[],x=Rn(s,o);return x!=null&&d.push(x),i.jsxRuntimeExports.jsx(Ht,{items:d,editable:r&&!l,symbolKey:n,onRotate:()=>o({orientation:f.K.rotate90(a)}),onLocationChange:(p,m)=>{p==="label"&&o({label:{...s,orientation:m}})},children:i.jsxRuntimeExports.jsx(e,{orientation:a,...u})})};return t.displayName=e.displayName,t},od=be(uu),rd=be(du),id=be(xu),ld=be(au),cd=be(hu),ad=be(gu),ud=be(Du),dd=be(Ou),xd=be(zu),fd=be(Vu),pd=be(Zu),md=be(Gu),hd=be(Yu),gd=be(Wu),yd=be(Xu),Ed=be(Ku),jd=be($u),Sd=be(qu),Rd=Ee(fu),Cd=Ee(td),wd=Ee(nd),bd=Ee(_u),vd=Ee(Hu),_d=Ee(yu),kd=Ee(ju),Md=Ee(Su),Pd=Ee(Ru),Nd=Ee(wu),Ld=Ee(Mu),Td=Ee(pu),Ad=Ee(mu),Id=Ee(ku),$d=be(Lu),Dd=Ee(Pu),Od=Ee(Qu),zd=Ee(Cu),Bd=Ee(Ju),Vd=Ee(Eu),Fd=Ee(sd),Hd=Ee(Bu),Zd=Ee(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:r})=>i.jsxRuntimeExports.jsx(Ns,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:r,backgroundColor:e})),Gd=e=>i.jsxRuntimeExports.jsx(Ns,{...e,dimensions:{width:25,height:50}}),Yd=Ee(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:o,dimensions:r})=>i.jsxRuntimeExports.jsx(Ns,{onResize:l=>n({dimensions:l}),orientation:s,color:o,dimensions:r,boxBorderRadius:t,backgroundColor:e})),Wd=e=>i.jsxRuntimeExports.jsx(Ns,{...e,dimensions:{width:25,height:50},borderRadius:0}),Xd=({label:e,symbolKey:t,orientation:n="left",control:s,units:o,source:r,sink:l,color:c,onChange:a,selected:u,draggable:d})=>{const{value:x,set:p}=bR({aetherKey:t,source:r,sink:l}),m=[],h=hr(s);h!=null&&m.push(h);const E=Rn(e,a);return E!=null&&m.push(E),i.jsxRuntimeExports.jsx(Ht,{symbolKey:t,editable:u&&!d,onRotate:()=>a({orientation:f.K.rotate90(n)}),items:m,onLocationChange:(w,R)=>{w==="label"&&a({label:{...e,orientation:R}})},children:i.jsxRuntimeExports.jsx(Iu,{value:x,onChange:p,units:o,color:c,orientation:n})})},Kd=e=>i.jsxRuntimeExports.jsx(Iu,{value:12,onChange:()=>{},units:"mV",...e,children:i.jsxRuntimeExports.jsx(y.Text,{level:"p",children:"10.0"})}),qd=({symbolKey:e,label:t,level:n="p",position:s,textColor:o,color:r,telem:l,units:c,onChange:a,inlineSize:u=70,selected:d,draggable:x,notation:p})=>{const m=y.useTypography(n),h=(m.lineHeight+.5)*m.baseSize+2,{width:E}=qo({aetherKey:e,color:o,level:n,box:f.Eo.construct(f.G.translateY({...s},1),{height:h,width:u}),telem:l,minWidth:u,notation:p}),w=[],R=Rn(t,a);return R!=null&&w.push(R),i.jsxRuntimeExports.jsx(Ht,{editable:d&&!x,symbolKey:e,items:w,onLocationChange:(k,S)=>{k==="label"&&a({label:{...t,orientation:S}})},children:i.jsxRuntimeExports.jsx(Nu,{color:r,dimensions:{height:h,width:E},inlineSize:u,units:c,unitsLevel:H.downLevel(n)})})},Ud=({color:e})=>i.jsxRuntimeExports.jsx(Nu,{color:e,dimensions:{width:60,height:25},units:"psi",children:i.jsxRuntimeExports.jsx(y.Text,{level:"p",children:"50.00"})}),Qd=({symbolKey:e,label:t,orientation:n="left",sink:s,control:o,selected:r,draggable:l,onChange:c,...a})=>{const{click:u}=SR({aetherKey:e,sink:s}),d=[],x=hr(o);return x!=null&&d.push(x),i.jsxRuntimeExports.jsx(Ht,{onRotate:()=>c({orientation:f.K.rotate90(n)}),editable:r&&!l,symbolKey:e,items:d,onLocationChange:(p,m)=>{p==="label"&&c({label:{...t,orientation:m}})},children:i.jsxRuntimeExports.jsx(Tu,{...t,onClick:u,orientation:n,...a})})},Jd=({label:e,...t})=>i.jsxRuntimeExports.jsx(Tu,{label:"Button",...t}),ex=({symbolKey:e,label:t,source:n,onChange:s,selected:o,draggable:r,...l})=>{const{enabled:c}=RR({aetherKey:e,source:n}),a=[],u=Rn(t,s);return u!=null&&a.push(u),i.jsxRuntimeExports.jsx(Ht,{items:a,editable:o&&!r,symbolKey:e,onLocationChange:(d,x)=>{d==="label"&&s({label:{...t,orientation:x}})},children:i.jsxRuntimeExports.jsx(Fu,{enabled:c,...l})})},tx=({level:e="p",width:t=100})=>i.jsxRuntimeExports.jsx(Au,{level:e,width:t,text:"Text Box"}),nx=({label:{label:e,level:t},orientation:n,color:s,onChange:o})=>i.jsxRuntimeExports.jsx(Uu,{onLabelChange:r=>o({label:{label:r,level:t}}),label:e,level:t,orientation:n,color:s}),sx=({label:e,...t})=>i.jsxRuntimeExports.jsx(Uu,{label:"Off Page",...t,orientation:"right"}),ox=Ee(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:r})=>i.jsxRuntimeExports.jsx(ed,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:r,backgroundColor:e})),rx=e=>i.jsxRuntimeExports.jsx(ed,{...e,dimensions:{width:25,height:50}}),ce=4,gr=2,_R=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","compressor","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","fourWayValve","helicalAgitator","isoCap","isoCheckValve","isoFilter","light","manualValve","needleValve","orifice","orificePlate","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","springLoadedReliefValve","staticMixer","switch","tank","textBox","threeWayValve","vacuumPump","value","valve","vent","tJunction"],kR=re.z.enum(_R),me={orientation:"left",scale:1},MR={...me,source:A.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:A.streamChannelValue({channel:0}),rollingAverage:A.rollingAverage({windowSize:1}),stringifier:A.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},PR={...me,source:A.sourcePipeline("number",{connections:[],segments:{valueStream:A.streamChannelValue({channel:0})},outlet:"valueStream"})},NR={...me,sink:A.sinkPipeline("number",{connections:[],segments:{setter:A.setChannelValue({channel:0})},inlet:"setter"})},ix={...me,source:A.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:A.streamChannelValue({channel:0}),threshold:A.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},lx={...me,control:{show:!0},sink:A.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:A.setChannelValue({channel:0}),setpoint:A.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},_e={...ix,...lx},oe=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),LR={width:125,height:200},yr={dimensions:LR},TR=3,AR={name:"Three Way Valve",key:"threeWayValve",Form:ve,Symbol:od,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Three Way Valve"),..._e}),Preview:uu,zIndex:ce},IR={name:"Valve",key:"valve",Form:ve,Symbol:rd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Valve"),..._e}),Preview:du,zIndex:ce},$R={name:"Solenoid Valve",key:"solenoidValve",Form:ve,Symbol:id,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Solenoid Valve"),normallyOpen:!1,..._e}),Preview:xu,zIndex:ce},DR={name:"Four Way Valve",key:"fourWayValve",Form:ve,Symbol:ld,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Four Way Valve"),..._e}),Preview:au,zIndex:ce},OR={name:"Angled Valve",key:"angledValve",Form:ve,Symbol:cd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Valve"),..._e}),Preview:hu,zIndex:ce},zR={name:"Pump",key:"pump",Form:ve,Symbol:ad,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Pump"),..._e}),Preview:gu,zIndex:ce},BR={name:"Screw Pump",key:"screwPump",Form:ve,Symbol:jd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Screw Pump"),..._e}),Preview:$u,zIndex:ce},VR={name:"Tank",key:"tank",Form:lu,Symbol:Zd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("Tank"),borderRadius:mr,...yr,...me}),Preview:Gd,zIndex:gr},FR={name:"Cylinder",key:"cylinder",Form:pR,Symbol:ox,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("cylinder"),dimensions:{width:66,height:181},...me}),Preview:rx,zIndex:gr},HR={name:"Box",key:"box",Form:()=>lu({includeBorderRadius:!0}),Symbol:Yd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("Box"),borderRadius:TR,...yr,...me}),Preview:Wd,zIndex:gr},ZR={name:"Relief Valve",key:"reliefValve",Form:je,Symbol:Rd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Relief Valve"),...me}),Preview:fu,zIndex:ce},GR={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:je,Symbol:Cd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Spring Loaded Relief Valve"),...me}),Preview:td,zIndex:ce},YR={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:je,Symbol:wd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Spring Loaded Relief Valve"),...me}),Preview:nd,zIndex:ce},WR={name:"Regulator",key:"regulator",Form:je,Symbol:bd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Regulator"),...me}),Preview:_u,zIndex:ce},XR={name:"Electric Regulator",key:"electricRegulator",Form:je,Symbol:vd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Electric Regulator"),...me}),Preview:Hu,zIndex:ce},KR={name:"Burst Disc",key:"burstDisc",Form:je,Symbol:_d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Burst Disc"),...me}),Preview:yu,zIndex:ce},qR={name:"ISO Burst Disc",key:"isoBurstDisc",Form:je,Symbol:Vd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Burst Disc"),...me}),Preview:Eu,zIndex:ce},UR={name:"Cap",key:"cap",Form:je,Symbol:kd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cap"),...me}),Preview:ju,zIndex:ce},QR={name:"ISO Cap",key:"isoCap",Form:je,Symbol:Md,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Cap"),...me}),Preview:Su,zIndex:ce},JR={name:"Manual Valve",key:"manualValve",Form:je,Symbol:Pd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Manual Valve"),...me}),Preview:Ru,zIndex:ce},e2={name:"Orifice Plate",key:"orificePlate",Form:je,Symbol:zd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Orifice Plate"),...me}),Preview:Cu,zIndex:ce},t2={name:"ISO Filter",key:"isoFilter",Form:je,Symbol:Bd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Filter"),...me}),Preview:Ju,zIndex:ce},n2={name:"Filter",key:"filter",Form:je,Symbol:Nd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Filter"),...me}),Preview:wu,zIndex:ce},s2={name:"Needle Valve",key:"needleValve",Form:je,Symbol:Ld,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Needle Valve"),...me}),Preview:Mu,zIndex:ce},o2={name:"Check Valve",key:"checkValve",Form:je,Symbol:Td,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Check Valve"),...me}),Preview:pu,zIndex:ce},r2={name:"Orifice",key:"orifice",Form:je,Symbol:Id,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Orifice"),...me}),Preview:ku,zIndex:ce},i2={name:"Angled Relief Valve",key:"angledReliefValve",Form:je,Symbol:Dd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Relief Valve"),...me}),Preview:Pu,zIndex:ce},l2={name:"Value",key:"value",Form:rR,Symbol:qd,Preview:Ud,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...oe("Value"),...me,telem:MR.source}),zIndex:ce},c2={name:"Button",key:"button",Symbol:Qd,Form:aR,Preview:Jd,defaultProps:e=>({color:e.colors.primary.z.rgba255,...oe("Button"),...lx,onClickDelay:0,scale:null}),zIndex:ce},a2={name:"Switch",key:"switch",Symbol:$d,Form:ve,defaultProps:()=>({...oe("Switch"),..._e,scale:null}),Preview:Lu,zIndex:ce},u2={name:"Vacuum Pump",key:"vacuumPump",Symbol:ud,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Vacuum Pump"),..._e}),Preview:Du,zIndex:ce},d2={name:"Cavity Pump",key:"cavityPump",Symbol:dd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cavity Pump"),..._e}),Preview:Ou,zIndex:ce},x2={name:"Piston Pump",key:"pistonPump",Symbol:xd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Piston Pump"),..._e}),Preview:zu,zIndex:ce},f2={name:"Static Mixer",key:"staticMixer",Symbol:Hd,Form:je,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Static Mixer"),...me}),Preview:Bu,zIndex:ce},p2={name:"Rotary Mixer",key:"rotaryMixer",Symbol:fd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Rotary Mixer"),..._e}),Preview:Vu,zIndex:ce},m2={name:"Light",key:"light",Symbol:ex,Form:lR,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Light"),...ix}),Preview:Fu,zIndex:ce},h2={name:"Setpoint",key:"setpoint",Symbol:Xd,Form:dR,defaultProps:e=>({units:"mV",color:e.colors.gray.l4.rgba255,...oe("Setpoint"),...PR,...NR}),Preview:Kd,zIndex:ce},g2={name:"Agitator",key:"agitator",Symbol:pd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Agitator"),..._e}),Preview:Zu,zIndex:ce},y2={name:"Propeller Agitator",key:"propellerAgitator",Symbol:md,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Propeller Agitator"),..._e}),Preview:Gu,zIndex:ce},E2={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:hd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Flat Blade Agitator"),..._e}),Preview:Yu,zIndex:ce},j2={name:"Paddle Agitator",key:"paddleAgitator",Symbol:gd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Paddle Agitator"),..._e}),Preview:Wu,zIndex:ce},S2={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:yd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cross Beam Agitator"),..._e}),Preview:Xu,zIndex:ce},R2={name:"Helical Agitator",key:"helicalAgitator",Symbol:Ed,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Helical Agitator"),..._e}),Preview:Ku,zIndex:ce},C2={name:"Compressor",key:"compressor",Symbol:Sd,Form:ve,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Compressor"),..._e}),Preview:qu,zIndex:ce},w2={name:"Text Box",key:"textBox",Symbol:Au,Form:xR,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...oe("Text Box"),...me,...yr,level:"p",text:"Text Box",width:75}),Preview:tx,zIndex:ce},b2={name:"Off Page Reference",key:"offPageReference",Form:fR,Symbol:nx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...oe("Off Page Reference")}),Preview:sx,zIndex:ce},v2={name:"ISO Check Valve",key:"isoCheckValve",Form:je,Symbol:Ad,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Check Valve"),...me}),Preview:mu,zIndex:ce},_2={name:"Vent",key:"vent",Form:je,Symbol:Od,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Vent"),...me}),Preview:Qu,zIndex:ce},k2={name:"T Junction",key:"tJunction",Form:je,Symbol:Fd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe(""),...me}),Preview:sd,zIndex:ce+20},M2={value:l2,button:c2,tank:VR,tJunction:k2,switch:a2,offPageReference:b2,light:m2,setpoint:h2,box:HR,textBox:w2,valve:IR,solenoidValve:$R,threeWayValve:AR,fourWayValve:DR,angledValve:OR,manualValve:JR,needleValve:s2,reliefValve:ZR,angledReliefValve:i2,checkValve:o2,regulator:WR,electricRegulator:XR,pump:zR,pistonPump:x2,screwPump:BR,cavityPump:d2,vacuumPump:u2,staticMixer:f2,rotaryMixer:p2,burstDisc:KR,isoBurstDisc:qR,cap:UR,isoCap:QR,filter:n2,isoFilter:t2,orifice:r2,orificePlate:e2,agitator:g2,propellerAgitator:y2,flatBladeAgitator:E2,paddleAgitator:j2,crossBeamAgitator:S2,helicalAgitator:R2,compressor:C2,isoCheckValve:v2,vent:_2,cylinder:FR,springLoadedReliefValve:GR,angledSpringLoadedReliefValve:YR},P2=Object.freeze(Object.defineProperty({__proto__:null,Agitator:pd,AngledReliefValve:Dd,AngledSpringLoadedReliefValve:wd,AngledValve:cd,Box:Yd,BoxPreview:Wd,BurstDisc:_d,Button:Qd,ButtonPreview:Jd,Cap:kd,CavityPump:dd,CheckValve:Td,Compressor:Sd,CrossBeamAgitator:yd,Cylinder:ox,CylinderPreview:rx,ElectricRegulator:vd,Filter:Nd,FlatBladeAgitator:hd,FourWayValve:ld,HelicalAgitator:Ed,ISOBurstDisc:Vd,ISOCap:Md,ISOCheckValve:Ad,ISOFilter:Bd,Light:ex,ManualValve:Pd,NeedleValve:Ld,OffPageReference:nx,OffPageReferencePreview:sx,Orifice:Id,OrificePlate:zd,PaddleAgitator:gd,PistonPump:xd,PropellerAgitator:md,Pump:ad,Regulator:bd,ReliefValve:Rd,RotaryMixer:fd,SYMBOLS:M2,ScrewPump:jd,Setpoint:Xd,SetpointPreview:Kd,SolenoidValve:id,SpringLoadedReliefValve:Cd,StaticMixer:Hd,Switch:$d,TJunction:Fd,Tank:Zd,TankPreview:Gd,TextBoxPreview:tx,ThreeWayValve:od,VacuumPump:ud,Value:qd,ValuePreview:Ud,Valve:rd,Vent:Od,createLabeled:Ee,createToggle:be,variantZ:kR},Symbol.toStringTag,{value:"Module"}));exports.Aether=y.main;exports.Dialog=y.use$4;exports.Divider=y.Divider$1;exports.Dropdown=y.Dropdown;exports.Haul=y.Haul;exports.Worker=y.Context$1;exports.compareArrayDeps=y.compareArrayDeps;exports.componentRenderProp=y.componentRenderProp;exports.isRenderProp=y.isRenderProp;exports.useAsyncEffect=y.useAsyncEffect;exports.useClickOutside=y.useClickOutside;exports.useCombinedRefs=y.useCombinedRefs;exports.useCombinedStateAndRef=y.useCombinedStateAndRef;exports.useDebouncedCallback=y.useDebouncedCallback;exports.useEffectCompare=y.useEffectCompare;exports.useMemoCompare=y.useMemoCompare;exports.useMemoDeepEqualProps=y.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=y.useMemoPrimitiveArray;exports.usePrevious=y.usePrevious;exports.useResize=y.useResize;exports.useStateRef=y.useStateRef;exports.useSyncedRef=y.useSyncedRef;exports.useTransforms=y.useTransforms;exports.CSS=f.CSS;exports.newBEM=f.newBEM;exports.Header=An.external;exports.DataType=H.g;exports.Density=H.b;exports.MultiSeries=H.Ct;exports.Rate=H.P;exports.Series=H.V;exports.TimeRange=H.E;exports.TimeSpan=H.y;exports.TimeStamp=H.m;exports.state=H.state;exports.Generic=J.Generic;exports.Align=df.external;exports.Icon=Se.Icon;exports.Tabs=Se.external;exports.Button=xf.external;exports.Caret=Vi.Animated$1;exports.telem=A.external;exports.Text=Ce.external;exports.Triggers=Fi.external;exports.List=Ot.external;exports.createFilterTransform=Ot.createFilterTransform;exports.fuseFilter=Ot.fuseFilter;exports.proxyMemo=Ot.proxyMemo;exports.Color=pf.external;exports.createHexOpacityVariants=Hi.createHexOpacityVariants;exports.unitProperty=Hi.unitProperty;exports.Input=Pe.external;exports.Menu=mf.external;exports.Theming=hf.external;exports.Tree=gf.external;exports.Video=yf.Video;exports.Accordion=Of;exports.Breadcrumb=Ff;exports.Canvas=ip;exports.Channel=em;exports.Control=uh;exports.Device=gm;exports.Diagram=J1;exports.Eraser=Gm;exports.Form=pm;exports.Label=Cm;exports.Legend=dp;exports.Line=fp;exports.LinePlot=Bp;exports.Log=tR;exports.Measure=Zp;exports.Modal=bm;exports.Mosaic=Fm;exports.Nav=Xm;exports.Note=qm;exports.OS=th;exports.Observe=xm;exports.Override=sh;exports.Pluto=ph;exports.Portal=Am;exports.Progress=hh;exports.Range=Fp;exports.Ranger=Ch;exports.Resize=Pf;exports.Rule=Gp;exports.Schematic=P2;exports.Select=kp;exports.Status=Rf;exports.Steps=bh;exports.Synnax=Gf;exports.Table=Ph;exports.TableCells=Xh;exports.Tag=vp;exports.Telem=ih;exports.Tooltip=Cf;exports.Value=Ah;exports.Viewport=zp;exports.axis=tp;exports.control=np;exports.useDelayedState=Ef;
|