@synnaxlabs/pluto 0.35.1 → 0.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Animated-D4IT49PS.cjs → Animated-B3meZ8Go.cjs} +1 -1
- package/dist/{Animated-C7JTBH0T.js → Animated-BMxljHxY.js} +1 -1
- package/dist/{Item-4yG7GmwK.js → Item-C3mh5Jo-.js} +3 -3
- package/dist/{Item-DuYEON-n.cjs → Item-DsAGorI8.cjs} +1 -1
- package/dist/{Keyboard-BPoxRive.cjs → Keyboard-D-76mv1a.cjs} +1 -1
- package/dist/{Keyboard-Csje8Cyn.js → Keyboard-DbyeBAzq.js} +1 -1
- package/dist/{Link-Crud0q_J.js → Link-By1w1FIv.js} +1 -1
- package/dist/{Link-BRv9hhIc.cjs → Link-C-KaB73i.cjs} +1 -1
- package/dist/{List-Pyj0u9YT.cjs → List-CZxRbYfm.cjs} +1 -1
- package/dist/{List-Cuz80sgI.js → List-S1wnpuEv.js} +1 -1
- package/dist/{Text-BJ2Pml4B.cjs → Text-Bq9B_1wQ.cjs} +1 -1
- package/dist/{Text-DMMYBs-R.js → Text-tqSP4klc.js} +2 -2
- package/dist/{Toggle-CLkPIiQK.js → Toggle-DcPmH9Uq.js} +4364 -4357
- package/dist/{Toggle-DnW_7Wr_.cjs → Toggle-DrfPMqBr.cjs} +30 -30
- 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/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/{external-BV_9eXZJ.cjs → external-1M4_dCzb.cjs} +1 -1
- package/dist/{external-CqLAQBcO.cjs → external-8wTAbTHd.cjs} +1 -1
- package/dist/{external-iiNZw96o.cjs → external-BEwtU2Lv.cjs} +1 -1
- package/dist/{external-Ctvxtwfh.cjs → external-BFHPc8Ng.cjs} +1 -1
- package/dist/{external-CgpiH-10.js → external-BRbXi-YB.js} +2 -2
- package/dist/{external-Cgq0p0a8.js → external-BeFZRZSq.js} +4 -4
- package/dist/{external-ZxIaRZdb.cjs → external-Brk-4hys.cjs} +1 -1
- package/dist/{external-D-PsJ1E5.cjs → external-Bwu7ljGW.cjs} +1 -1
- package/dist/{external-DAbicix6.js → external-BzRCbp_C.js} +1 -1
- package/dist/{external-Ci-UP3Vu.js → external-CDXLxcOI.js} +2 -2
- package/dist/{external-BZwFy-XX.js → external-CDYYyyoJ.js} +1 -1
- package/dist/{external-Cf5a9Ia8.js → external-CTvBPOgF.js} +2 -2
- package/dist/{external-De9tKPlO.js → external-CY1bjqlD.js} +2 -2
- package/dist/{external-t43feeRt.cjs → external-CxBbtPtX.cjs} +1 -1
- package/dist/{external-DVF3ZJ4z.js → external-D08DFJfB.js} +1 -1
- package/dist/{external-3DAfrFCZ.cjs → external-DOQ51UTh.cjs} +1 -1
- package/dist/{external-0a9KHHwz.js → external-DRBGP7qn.js} +2 -2
- package/dist/{external-xtDHiIUX.cjs → external-DaWss0D_.cjs} +1 -1
- package/dist/{external-CIH3tMhP.js → external-DcKg8NOr.js} +1 -1
- package/dist/{external-B7Vpq1ol.cjs → external-bMSKTtt-.cjs} +1 -1
- package/dist/{external-D7FmaiqY.js → external-fvuMSTBJ.js} +4 -4
- package/dist/{external-DtnrBHvV.cjs → external-k9_z2UE6.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 +2748 -2786
- 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.map +1 -1
- package/dist/src/text/Editable.d.ts +1 -1
- package/dist/src/text/Editable.d.ts.map +1 -1
- package/dist/src/util/reflow.d.ts +2 -0
- package/dist/src/util/reflow.d.ts.map +1 -0
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/schematic/Grid.d.ts +1 -1
- package/dist/src/vis/schematic/Grid.d.ts.map +1 -1
- 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/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var ff=Object.defineProperty;var pf=(e,t,n)=>t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>pf(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-Cek9Ww4S.cjs"),g=require("react"),E=require("./Toggle-DnW_7Wr_.cjs"),f=require("./css-BghghSL0.cjs"),Dn=require("./external-DtnrBHvV.cjs"),H=require("./aggregator-y-jNJhKX.cjs"),U=require("./Pack-Dvf8sQVK.cjs"),mf=require("./external-Dk1cXh1i.cjs"),je=require("./external-D-PsJ1E5.cjs"),hf=require("./external-BV_9eXZJ.cjs"),Zi=require("./Animated-D4IT49PS.cjs"),A=require("./LinePlot-DbXPZbQH.cjs"),re=require("zod"),Re=require("./external-3DAfrFCZ.cjs"),gf=require("./Text-BJ2Pml4B.cjs"),Gi=require("./external-B7Vpq1ol.cjs");require("./Item-DuYEON-n.cjs");const No=require("react-dom"),Vt=require("./external-Ctvxtwfh.cjs"),Ef=require("./external-CqLAQBcO.cjs"),Yi=require("./units-9h1yAbxY.cjs"),Pe=require("./external-t43feeRt.cjs"),yf=require("./external-iiNZw96o.cjs"),jf=require("./external-xtDHiIUX.cjs"),Sf=require("./external-ZxIaRZdb.cjs"),Rf=require("./Video-CGe5Hscl.cjs"),Cf=(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},Wi=({variant:e="info",...t})=>i.jsxRuntimeExports.jsx(E.e4.Circle,{color:E.variantColors[e],...t}),bf=({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(U.Space,{className:f.CSS(f.CSS.B("notification"),a),direction:"y",empty:!0,...d,children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(Wi,{style:{height:"2.25rem",width:"2.5rem"},variant:r}),i.jsxRuntimeExports.jsx(E.Text,{level:"small",shade:7,children:`x${n}`}),i.jsxRuntimeExports.jsx(E.DateTime,{className:f.CSS(f.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),i.jsxRuntimeExports.jsx(E.Icon,{className:f.CSS(f.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:i.jsxRuntimeExports.jsx(E.e4.Close,{})})]}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",align:"start",className:f.CSS(f.CSS.BE("notification","content")),size:"small",children:[u??i.jsxRuntimeExports.jsx(E.Text,{className:f.CSS(f.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),o!=null&&i.jsxRuntimeExports.jsx(E.Text,{className:f.CSS(f.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),c!=null&&i.jsxRuntimeExports.jsx(U.Space,{direction:"x",align:"center",justify:"end",className:f.CSS(f.CSS.BE("notification","actions")),children:H.A(c).map(x=>i.jsxRuntimeExports.jsx(wf,{action:x},x.key))})]},t.toString()),wf=({action:e})=>{if(!g.isValidElement(e)){const t=e;return i.jsxRuntimeExports.jsx(E.Button,{...t})}return e},vf=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:E.Aggregator,Circle:Wi,Notification:bf,Text:E.Text$2,VARIANTS:H.VARIANTS,specZ:H.specZ$1,useAggregator:E.useAggregator,useContext:E.useContext$3,useNotifications:E.useNotifications,variantZ:H.variantZ},Symbol.toStringTag,{value:"Module"})),_f=Object.freeze(Object.defineProperty({__proto__:null,Config:E.Config,Context:E.Context,Dialog:E.Dialog$1,chooseLocation:E.chooseLocation,formatTip:E.formatTip,useConfig:E.useConfig,wrap:E.wrap},Symbol.toStringTag,{value:"Module"})),Yn=e=>e.preventDefault(),xs=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:Yn,onDragEnd:Yn})]})});xs.displayName="Resize.Core";const Lo=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:o="x"})=>{const r=g.useRef(null),[l,c]=g.useState({sizeDistribution:kf(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(y=>Hs(y,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=b=>a(p,b[m]),y=()=>{c(b=>({...b,root:null})),document.removeEventListener("mousemove",h)};c(b=>({...b,root:x[m]})),document.addEventListener("mousemove",h),document.addEventListener("mouseup",y,{once:!0})},[c,o,Hs]);return{setSize:g.useCallback((x,p)=>a(x,void 0,p),[Hs]),props:{direction:o,sizeDistribution:l.sizeDistribution,onDragHandle:u,ref:r}}},fs=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=Mf(n),i.jsxRuntimeExports.jsx(U.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(xs,{onDragStart:x=>s(x,d),location:f.g.location(c),size:n[d]*100,sizeUnits:"%",showHandle:d!==a.length-1,children:u},d))})});fs.displayName="Resize.Multiple";const kf=(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)},Fs=.001,Mf=e=>e.every(t=>f.W.closeTo(t,1/e.length),Fs)?e.map((t,n)=>n%2===0?t+Fs:n===e.length-1?t:t-Fs):e,Hs=(e,t,n,s,o,r)=>{const l=Xi(e,t,n,o,r),[c,a]=Pf(e.sizeDistribution,n,l,s/t),u=a?o??null:e.root;return{...e,sizeDistribution:c,root:u}},Xi=(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},Pf=(e,t,n,s)=>{let o=t;for(;o>0&&e[o]+n<=s;)o--;const r=e[o]+n,l=Nf(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]},Nf=(e,t,n,s)=>(e===t.length-1?Tf:Lf)(e,t,n,s),Lf=(e,t,n,s)=>{let o=e+1;for(;o<t.length-1&&t[o]-s<=n;)o++;return o},Tf=(e,t,n,s)=>{let o=e-1;for(;o>0&&t[o]-s<=n;)o--;return o},Zs=2,Ki=({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))),w=x.current+j,M=f.Y(w,s,o);return(M-w)/s>l?Zs:M},[p,s,o,l]),h=g.useRef(null),y=g.useCallback(S=>{const j=m(S);d(j),h.current!=null&&(t==null||t(j,f.Eo.construct(h.current)))},[t,m]),b=g.useCallback(()=>d(S=>(x.current=S,S)),[d]),R=g.useCallback(S=>m(S)===Zs&&(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=E.useCursorDrag({onMove:y,onStart:b,onEnd:R});return i.jsxRuntimeExports.jsx(xs,{ref:h,location:p,size:u,onDragStart:k,className:f.clsx(c,f.CSS.expanded(u!==Zs)),...a})},Af=Object.freeze(Object.defineProperty({__proto__:null,Core:xs,Multiple:fs,Single:Ki,calculateDiffPercentage:Xi,useMultiple:Lo},Symbol.toStringTag,{value:"Module"})),On="y",_r=28,If=32,$f=40,Df=.5,Of=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:o,...r}}=Lo({direction:On,count:e.length,minSize:_r}),l=c=>{if(o.current==null)return;const a=f.Eo.dim(f.Eo.construct(o.current),On);s[c]<$f/a?n(c,e[c].initialSize??Df):n(c,_r+1)};return i.jsxRuntimeExports.jsx(fs,{empty:!0,className:f.CSS.B("accordion"),sizeDistribution:s,ref:o,...t,...r,children:e.map((c,a)=>g.createElement(Vf,{...c,key:c.key,index:a,direction:On,onExpand:l,parent:o,size:s[a]}))})},zf=i.jsxRuntimeExports.jsx(E.e4.Caret.Down,{"aria-label":"contract"}),Bf=i.jsxRuntimeExports.jsx(E.e4.Caret.Right,{"aria-label":"expand"}),Vf=({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),On);c=o*u>If}const a=c?zf:Bf;return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs(Dn.Header,{level:"p",className:f.CSS.expanded(c),empty:!0,children:[i.jsxRuntimeExports.jsx(Dn.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&i.jsxRuntimeExports.jsx(Dn.Actions,{children:s})]}),n]})},Ff=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Of},Symbol.toStringTag,{value:"Module"})),Hf=(e,t)=>H.A(e).map(s=>typeof s=="string"?s.split(t).map(o=>({label:o})):s).flat(),qi=({segments:e,shade:t,level:n,weight:s,separator:o,capitalized:r=!1})=>Hf(e,o).map((a,u)=>{const d=[i.jsxRuntimeExports.jsx(E.e4.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:f.CSS.shade(t)}},`${a}-${u}`)];if(a.icon!=null){const x=je.resolve(a.icon);x!=null&&d.push(x)}return d.push(i.jsxRuntimeExports.jsx(E.Text,{style:{marginLeft:a.icon!=null?"0.5rem":"0"},weight:s,shade:t,level:n,...a,children:r?f._$1.capitalize(a.label):a.label},a.label)),d}).flat(),Zf=({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=qi({segments:e,separator:c,shade:n,level:l,weight:s});return u&&x.shift(),i.jsxRuntimeExports.jsxs(E.WithIcon,{className:f.CSS(a,f.CSS.B("breadcrumb")),level:l,shade:n,weight:s,size:o,direction:"x",...d,children:[je.resolve(t),...x]})},Gf=({url:e,className:t,level:n="p",separator:s=".",weight:o,shade:r=7})=>{const l=qi({segments:e,separator:s,shade:r,level:n,weight:o,capitalized:!0});return i.jsxRuntimeExports.jsx(U.Space,{className:f.CSS(t,f.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:l.map((c,a)=>{if(E.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(E.Link,{level:n,href:x,children:c.split("-").map(p=>f._$1.capitalize(p)).join(" ")},a)})})},Yf=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Zf,URL:Gf},Symbol.toStringTag,{value:"Module"})),To=g.createContext(A.ZERO_CONTEXT_VALUE),Be=()=>g.useContext(To).synnax,Wf=()=>g.useContext(To).state,kr={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Ui="serverVersionMismatch",Xf=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Qi=E.wrap$1(A.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[s,o,r]=E.useCombinedStateAndRef(A.ZERO_CONTEXT_VALUE),[{path:l},,c]=E.use$3({aetherKey:e,type:A.Provider.TYPE,schema:A.Provider.stateZ,initialState:{props:t??null,state:null}}),a=E.useAggregator(),u=g.useCallback(d=>{r.current.state.status!==d.status&&a({variant:kr[d.status],message:d.message??f._$1.capitalize(d.status)}),o(x=>({...x,state:d}))},[a]);return E.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:kr[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=Xf(p,x.clientVersion,x.nodeVersion);a({variant:"warning",message:"Incompatible cluster version",description:m,data:{type:Ui,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(To.Provider,{value:s,children:i.jsxRuntimeExports.jsx(E.Composite,{path:l,children:n})})}),Kf=Object.freeze(Object.defineProperty({__proto__:null,Provider:Qi,SERVER_VERSION_MISMATCH:Ui,use:Be,useConnectionState:Wf},Symbol.toStringTag,{value:"Module"})),Ft=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),Ji=()=>g.useContext(Ft),el=e=>{const{aliases:t}=g.useContext(Ft);return t[e]??null},ps=()=>{const{aliases:e}=g.useContext(Ft);return e},ms=(e,t="")=>{const{getName:n}=g.useContext(Ft),[s,o]=g.useState(t);return E.useAsyncEffect(async()=>{const r=await n(e);r!=null&&o(r)},[e,n]),s??t},Ao=()=>{const{activeRange:e}=g.useContext(Ft);return e??void 0},tl=({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 E.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(Ft.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},qf=({channelKey:e,value:t,shadow:n,className:s,...o})=>{const[r,l]=g.useState(!1),{setAlias:c}=Ji(),a=el(e),u=ms(e);let d=i.jsxRuntimeExports.jsx(E.e4.Rename,{});r?d=i.jsxRuntimeExports.jsx(E.e4.Loading,{}):a===t&&(d=i.jsxRuntimeExports.jsx(E.e4.Check,{}));const x=c!=null&&!r&&a!==t&&e!==0,p=()=>{x&&(async()=>(l(!0),await c(e,t),l(!1)))()},m=()=>{var y;a!=null&&((y=o.onChange)==null||y.call(o,a))},h=()=>e===0?i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Alias synced with this label"}):i.jsxRuntimeExports.jsxs(E.Text,{level:"small",children:["Sync alias for ",u," with this label"]});return i.jsxRuntimeExports.jsxs(E.Text$1,{value:t,...o,children:[x&&i.jsxRuntimeExports.jsx(E.Icon,{onClick:m,tooltip:i.jsxRuntimeExports.jsxs(E.Text,{level:"small",children:["Set ",u," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:i.jsxRuntimeExports.jsx(E.e4.Sync,{})}),i.jsxRuntimeExports.jsx(E.Icon,{onClick:p,disabled:!x,tooltip:i.jsxRuntimeExports.jsx(h,{}),tooltipLocation:{y:"top"},variant:"outlined",children:d})]})},He="channel";var Mr=180/Math.PI,io={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nl(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)*Mr,skewX:Math.atan(a)*Mr,scaleX:l,scaleY:c}}var _n;function Uf(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?io:nl(t.a,t.b,t.c,t.d,t.e,t.f)}function Qf(e){return e==null||(_n||(_n=document.createElementNS("http://www.w3.org/2000/svg","g")),_n.setAttribute("transform",e),!(e=_n.transform.baseVal.consolidate()))?io:(e=e.matrix,nl(e.a,e.b,e.c,e.d,e.e,e.f))}function sl(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 y=m.push("translate(",null,t,null,n);h.push({i:y-4,x:A.interpolateNumber(u,x)},{i:y-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 y=m.push(o(m)+"scale(",null,",",null,")");h.push({i:y-4,x:A.interpolateNumber(u,x)},{i:y-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,y=p.length,b;++h<y;)x[(b=p[h]).i]=b.x(m);return x.join("")}}}var Jf=sl(Uf,"px, ","px)","deg)"),ep=sl(Qf,", ",")",")"),tp=1e-12;function Pr(e){return((e=Math.exp(e))+1/e)/2}function np(e){return((e=Math.exp(e))-1/e)/2}function sp(e){return((e=Math.exp(2*e))-1)/(e+1)}const op=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,y=m*m+h*h,b,R;if(y<tp)R=Math.log(p/u)/t,b=function(v){return[c+v*m,a+v*h,u*Math.exp(t*v*R)]};else{var k=Math.sqrt(y),S=(p*p-u*u+s*y)/(2*u*n*k),j=(p*p-u*u-s*y)/(2*p*n*k),w=Math.log(Math.sqrt(S*S+1)-S),M=Math.log(Math.sqrt(j*j+1)-j);R=(M-w)/t,b=function(v){var N=v*R,L=Pr(w),T=u/(n*k)*(L*sp(t*N+w)-np(w));return[c+T*m,a+T*h,u*L/Pr(t*N+w)]}}return b.duration=R*1e3*t/Math.SQRT2,b}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),rp=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"})),ip=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"})),lp={region:f.Eo.ZERO,dpr:1,os:H.w.getOS()},cp={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},ap=E.wrap$1(A.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:s,...o})=>{const[{path:r},{bootstrapped:l,dpr:c},a]=E.use$3({aetherKey:n,type:A.Canvas$1.TYPE,schema:A.canvasStateZ,initialState:lp}),u=g.useRef({...cp}),d=g.useRef(!1),x=g.useCallback(b=>{u.current.bootstrapped&&(a(()=>({bootstrapped:!0,region:b,dpr:window.devicePixelRatio,os:H.w.getOS({default:"Windows"})})),d.current=!0)},[a]),p=g.useRef(null),m=E.useResize(x,{debounce:t}),h=E.useCombinedRefs(p,m);g.useEffect(()=>{const b=()=>{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",b,{once:!0})},[c]),g.useEffect(()=>{const b=()=>{!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",b),window.addEventListener("blur",b)},[a]);const y=g.useCallback(b=>{if(b==null)return;b.className.includes("gl")?u.current.gl=b:b.className.includes("upper2d")?u.current.upper2d=b:u.current.lower2d=b;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 w=R.transferControlToOffscreen(),M=S.transferControlToOffscreen(),v=k.transferControlToOffscreen();a({glCanvas:w,upper2dCanvas:M,lower2dCanvas:v,bootstrap:!0,bootstrapped:!1,region:f.Eo.construct(R),dpr:window.devicePixelRatio,os:H.w.getOS({default:"Windows"})},[w,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:y,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","lower2d"))}),i.jsxRuntimeExports.jsx("canvas",{ref:y,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","gl"))}),i.jsxRuntimeExports.jsx("canvas",{ref:y,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","upper2d"))}),i.jsxRuntimeExports.jsx(E.Composite,{path:r,children:l&&e})]})}),En=(e,t)=>E.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),up=Object.freeze(Object.defineProperty({__proto__:null,Canvas:ap,useRegion:En},Symbol.toStringTag,{value:"Module"})),ol=g.createContext(null),Ue=e=>{const t=g.useContext(ol);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},rl=e=>{const t=Ue("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},yn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=Ue(t),{key:o}=e;return E.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}`}},il=E.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=E.useMemoDeepEqualProps({clearOverScan:s,hold:r,visible:c}),[{path:p},{grid:m},h]=E.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 y=g.useRef(new Map),b=g.useCallback(D=>(y.current.set(D,null),()=>y.current.delete(D)),[y]),R=g.useCallback(D=>{const{mode:$,box:B,stage:C}=D;($==="pan"&&C!=="start"||$==="zoom"||$==="zoomReset"&&C==="start")&&h(I=>({...I,viewport:B})),y.current.forEach((I,_)=>_(D))},[h]),k=g.useCallback(D=>h($=>({...$,container:D})),[h]),S=En(k,{debounce:n}),j=g.useCallback(D=>h($=>({...$,grid:{...$.grid,[D.key]:D}})),[h]),w=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(()=>dp(m),[m]),L=g.useCallback(D=>{h($=>({...$,hold:D})),l==null||l(D)},[h,l]),T=g.useMemo(()=>({lines:u,setGridEntry:j,removeGridEntry:w,setLine:M,removeLine:v,setViewport:R,addViewportHandler:b,setHold:L}),[u,j,w,M,v,R,b,L]);return i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("line-plot"),style:{...t,...N},ref:S,...a,children:i.jsxRuntimeExports.jsx(ol.Provider,{value:T,children:i.jsxRuntimeExports.jsx(E.Composite,{path:p,children:o})})})}),dp=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()},Io=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?A.XAxis.TYPE:A.YAxis.TYPE,s=`${e}-axis`;return E.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:y,className:b,tickSpacing:R,autoBounds:k,autoBoundUpdateInterval:S,onAutoBoundsChange:j,style:w,...M})=>{const v=((c==null?void 0:c.length)??0)>0,N=E.useMemoDeepEqualProps({location:l,showGrid:m,type:h,bounds:y,label:c,labelDirection:u,tickSpacing:R,autoBounds:k,autoBoundUpdateInterval:S}),[{path:L},{size:T,labelSize:D,...$},B]=E.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&&(y==null?void 0:y.lower)!==$.bounds.lower||P&&(y==null?void 0:y.upper)!==$.bounds.upper)&&(j==null||j($.bounds))},[$.autoBounds,$.bounds]);const C=yn({loc:l,key:`${n}-${o}`,size:T+D,order:1},`${e.toUpperCase()}Axis`),I=E.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(U.Space,{className:f.CSS(b,f.CSS.B("axis"),f.CSS.B(s),f.CSS.loc(l)),style:{...w,...C},align:"center",justify:l!=="left"?"end":"start",direction:f.g.swap(e),...M,children:v&&i.jsxRuntimeExports.jsx(E.MaybeEditable,{className:f.CSS(f.CSS.BE("axis","label"),f.CSS.dir(u)),value:c,onChange:d,level:a})}),i.jsxRuntimeExports.jsx(E.Composite,{path:L,children:r})]})})},ll=Io("x"),cl=Io("y"),al=f.G.xy.extend({root:f.K.corner,units:re.z.object({x:re.z.enum(["px","decimal"]),y:re.z.enum(["px","decimal"])})}),xp=al.partial({root:!0,units:!0}),fp=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},pp=(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},ul=(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)}},Nr=f.Eo.reRoot(f.Eo.DECIMAL,f.K.TOP_LEFT),$o=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=E.useSyncedRef(o===!1),d=g.useRef(null);l!==null&&(s={...s,...fp(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),y=f.b.XY.scale(h).scale(Nr),b=y.box(f.Eo.construct(d.current)),R=f.b.XY.clamp(f.Eo.construct(f.Eo.topLeft(Nr),{width:1-f.Eo.width(b),height:1-f.Eo.height(b)})),k=f.G.translate(f.G.construct(a.current),f.Eo.signedDims(y.box(m))),S=R.pos(k);return ul(S,d)},[]),p=E.useCursorDrag({onStart:g.useCallback(()=>{a.current=pp(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(U.Space,{className:f.CSS(e,f.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:p,draggable:o,ref:d,...r,onDrag:Yn,onDragEnd:Yn,empty:!0})});$o.displayName="Legend.Container";const Do=(e,t,n)=>e.sort((s,o)=>s.label.localeCompare(o.label)).map(({key:s,color:o,label:r})=>i.jsxRuntimeExports.jsxs(U.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(E.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(E.MaybeEditable,{level:"small",value:r,onChange:l=>t==null?void 0:t({key:s,color:o,label:l}),noWrap:!0})]},s)),Oo=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...o})=>{const[r,l]=g.useState(!1);return e.length===0?null:i.jsxRuntimeExports.jsx($o,{...o,draggable:!r,value:n,onChange:s,children:Do(e,t,l)})},mp=Object.freeze(Object.defineProperty({__proto__:null,Container:$o,Simple:Oo,calcStickyPos:ul,completeStickyXYz:al,legendSwatches:Do,stickyXYz:xp},Symbol.toStringTag,{value:"Module"})),dl=({className:e,style:t,onLineChange:n,...s})=>{const{lines:o}=Ue("Legend");return Ue("Legend"),i.jsxRuntimeExports.jsx(Oo,{data:o,onEntryChange:n,...s})},hp=({onLineChange:e})=>{const{lines:t}=Ue("Legend"),n=E.useUniqueKey(),s=yn({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return i.jsxRuntimeExports.jsx(U.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:Do(t,e)})},xl=({variant:e="floating",...t})=>e==="floating"?i.jsxRuntimeExports.jsx(dl,{...t}):i.jsxRuntimeExports.jsx(hp,{...t}),fl=E.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=E.use$3({aetherKey:e,type:A.Line.TYPE,schema:A.stateZ,initialState:t}),s=E.useMemoDeepEqualProps(t);return g.useLayoutEffect(()=>n(s),[s]),null}),gp=Object.freeze(Object.defineProperty({__proto__:null,Line:fl},Symbol.toStringTag,{value:"Module"})),zo=E.wrap$1("Line",({aetherKey:e,color:t,label:n="",...s})=>{const{setLine:o,removeLine:r}=Ue("Line");return g.useEffect(()=>(o({key:e,color:t,label:n}),()=>r(e)),[n,t]),i.jsxRuntimeExports.jsx(fl,{aetherKey:e,color:t,label:n,...s})}),pl=({level:e="h2",...t})=>{const n=E.useUniqueKey(),s=E.useTypography(e),o=yn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return i.jsxRuntimeExports.jsx(U.Space,{justify:"center",align:"center",style:o,children:i.jsxRuntimeExports.jsx(E.MaybeEditable,{...t,level:e})})},ml=E.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=E.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})}),Ep=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:ml},Symbol.toStringTag,{value:"Module"})),yp={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Bo=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:yp[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]}));Bo.displayName="ZoomPanMask";const jp=[{key:"start",icon:i.jsxRuntimeExports.jsx(E.e4.TextAlign.Left,{})},{key:"center",icon:i.jsxRuntimeExports.jsx(E.e4.TextAlign.Center,{})},{key:"end",icon:i.jsxRuntimeExports.jsx(E.e4.TextAlign.Right,{})}],Sp=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(E.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),hs=({children:e=Sp,...t})=>i.jsxRuntimeExports.jsx(Re.Button,{...t,allowMultiple:!1,data:jp,children:e}),Rp=new Set([H.g.UUID,H.g.JSON]),Cp=H.g.ALL.filter(e=>e!==H.g.UNKNOWN).map(e=>({key:e.toString(),name:Rp.has(e)?e.toString().toUpperCase():f._$1.capitalize(e.toString())})),bp=[{key:"name",name:"Name"}],wp=e=>i.jsxRuntimeExports.jsx(Re.DropdownButton,{...e,data:Cp,columns:bp,entryRenderKey:"name"}),vp=[{key:"x",icon:i.jsxRuntimeExports.jsx(E.e4.Arrow.Right,{})},{key:"y",icon:i.jsxRuntimeExports.jsx(E.e4.Arrow.Up,{})}],_p=[{key:"x",icon:i.jsxRuntimeExports.jsx(E.e4.Arrow.Right,{})},{key:"y",icon:i.jsxRuntimeExports.jsx(E.e4.Arrow.Down,{})}],kp=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(E.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),hl=({children:e=kp,yDirection:t="up",...n})=>i.jsxRuntimeExports.jsx(Re.Button,{...n,allowMultiple:!1,data:t==="up"?vp:_p,children:e}),gl=e=>i.jsxRuntimeExports.jsx(E.Icon,{className:f.CSS.BE("select","clear"),variant:"outlined",...e,children:i.jsxRuntimeExports.jsx(E.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:y="connected",placeholder:b=gs,inputPlaceholder:R=b,triggerTooltip:k,dropdownZIndex:S,filter:j,actions:w,...M})=>{const{visible:v,open:N,close:L,toggle:T}=E.use$2(),[D,$]=g.useState(null),B=a!=null;E.useAsyncEffect(async()=>{if(E.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?E.Search:Vt.Filter,[B]),_=i.jsxRuntimeExports.jsx(I,{searcher:a,filter:j,children:({onChange:P})=>i.jsxRuntimeExports.jsx(Mp,{...l,autoFocus:y==="modal",variant:d,onChange:P,onFocus:N,selected:D,entryRenderKey:n,visible:v,allowNone:c,className:u,disabled:p,placeholder:R,children:w})}),O=i.jsxRuntimeExports.jsx(E.Button,{tooltip:k,variant:"outlined",onClick:T,disabled:p,children:D!=null?El(n,D):b});return i.jsxRuntimeExports.jsx(Re.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:y,trigger:y!=="modal"?_:O,extraDialogContent:y==="modal"?_:void 0,keepMounted:!1,...M})},gs="Select",El=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Mp=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:o,allowNone:r=!0,placeholder:l=gs,className:c,disabled:a,...u})=>{const{clear:d}=E.useSelectionUtils(),[x,p]=g.useState("");g.useEffect(()=>{if(!n){if(H.w$1(t==null?void 0:t.key))return p("");t!=null&&p(El(e,t))}},[t,n,e]);const m=R=>{s(R),p(R)},h=()=>{x===""&&s(""),p(""),o==null||o()},y=R=>{n||(R.preventDefault(),o==null||o())},b=()=>{p(""),d==null||d()};return i.jsxRuntimeExports.jsx(E.Text$1,{className:f.CSS(f.CSS.BE("select","input"),c),value:x,onChange:m,onFocus:h,onKeyDown:E.matchCallback([["Enter"]],R=>{R.preventDefault(),!n&&(o==null||o())}),endContent:i.jsxRuntimeExports.jsx(Zi.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n}),style:{flexGrow:1},onClick:y,placeholder:l,disabled:a,...u,children:r&&i.jsxRuntimeExports.jsx(gl,{onClick:b,disabled:a})})},cn=({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(E.e4.Circle,{fill:a}));const u=o==null?void 0:i.jsxRuntimeExports.jsx(E.Icon,{"aria-label":"close",size:"small",className:f.CSS.BE("tag","close"),onClick:d=>{d.stopPropagation(),o()},children:i.jsxRuntimeExports.jsx(E.e4.Close,{})});return i.jsxRuntimeExports.jsx(E.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})},Pp=Object.freeze(Object.defineProperty({__proto__:null,Tag:cn},Symbol.toStringTag,{value:"Module"})),Ht=({onChange:e,value:t,className:n,data:s,columns:o=[],entryRenderKey:r="key",emptyContent:l,searcher:c,renderTag:a=E.componentRenderProp(yl),placeholder:u,onTagDragStart:d,allowMultiple:x,allowNone:p,replaceOnSingle:m,onTagDragEnd:h,style:y,addPlaceholder:b="Add",children:R,dropdownVariant:k="connected",actions:S,...j})=>{const{visible:w,open:M,close:v}=E.use$2(),[N,L]=g.useState([]),[T,D]=g.useState(!1),$=c!=null;E.useAsyncEffect(async()=>{D(!0),E.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(()=>$?E.Search:Vt.Filter,[$]);let I,_;if(k==="connected")_=i.jsxRuntimeExports.jsx(C,{searcher:c,children:({onChange:O,value:P})=>i.jsxRuntimeExports.jsx(Np,{value:P,selectedKeys:t,className:n,onChange:O,loading:T,selected:N,onFocus:M,entryRenderKey:r,visible:w,renderTag:a,placeholder:u,onTagDragStart:d,onTagDragEnd:h,style:y,children:S})});else{const O=H.A(t);_=i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"center",grow:!0,style:y,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(E.Icon,{onClick:M,children:i.jsxRuntimeExports.jsx(E.e4.Add,{style:{color:"var(--pluto-gray-l7)"}})}):i.jsxRuntimeExports.jsx(E.Button,{onClick:M,shade:7,startIcon:i.jsxRuntimeExports.jsx(E.e4.Add,{}),variant:"text",children:b})]}),I=i.jsxRuntimeExports.jsx(C,{searcher:c,children:P=>i.jsxRuntimeExports.jsx(E.Text$1,{autoFocus:!0,placeholder:"Search",...P,children:S})})}return i.jsxRuntimeExports.jsx(Re.Core,{close:v,open:M,data:s,emptyContent:l,visible:w,value:t,onChange:B,allowNone:p,replaceOnSingle:m,columns:o,allowMultiple:!0,listItem:R,trigger:_,extraDialogContent:I,variant:k,...j})},Np=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:o,visible:r,entryRenderKey:l,renderTag:c,placeholder:a=gs,onTagDragStart:u,onTagDragEnd:d,value:x,className:p,children:m,...h})=>{const{onSelect:y,clear:b}=E.useSelectionUtils(),R=g.useRef(null);g.useLayoutEffect(()=>{var w;r&&((w=R.current)==null||w.focus())},[r,n]);const k=()=>{r||s(""),o==null||o()},S=()=>{r||o==null||o()},j=()=>{r||s("")};return i.jsxRuntimeExports.jsxs(E.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(U.Space,{direction:"x",className:f.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:H.A(e).map(w=>{const M=n.find(v=>v.key===w);return c({key:w,entryKey:w,entryRenderKey:l,loading:t,entry:M,onClose:()=>y==null?void 0:y(w),onDragStart:v=>u==null?void 0:u(v,w),onDragEnd:v=>d==null?void 0:d(v,w)})})}),m,i.jsxRuntimeExports.jsx(gl,{onClick:b})]})},yl=({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(cn,{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))},Lp=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Re.BaseButton,Button:Re.Button,DEFAULT_PLACEHOLDER:gs,DataType:wp,Direction:hl,DropdownButton:Re.DropdownButton,Multiple:Ht,MultipleTag:yl,Single:dt,TextAlignment:hs,defaultButton:Re.defaultButton},Symbol.toStringTag,{value:"Module"})),zn=6,Tp=2,Lr=5,Ap=e=>f.Eo.width(e)<Lr&&f.Eo.height(e)<Lr,Ip=["zoom","pan","select","zoomReset"],sn=[...Ip,"click"],$p=re.z.enum(sn),jl=["zoom","select"],Bn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Sl={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},Rl={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Vo={zoom:Bn,pan:Sl,select:Rl,zoomReset:Bn,click:Bn},Dp=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)]))},Op=f.Eo.construct(0,0,1,1,f.K.TOP_LEFT),zp={width:30,height:50},Cl=({onChange:e,triggers:t,initial:n=Op,threshold:s=zp,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]=E.useStateRef(n),p=g.useRef(f.G.ZERO),m=g.useRef(null),h=f._.construct(s);g.useEffect(()=>x(()=>f.Eo.truncate(n,zn)),[n]),g.useEffect(()=>u(r),[r]);const[y,b,R,k]=E.useMemoCompare(()=>{const N={...Vo[r],...t},L=E.flattenConfig(N),T=Dp(N);return[N,L,T,E.flattenConfig(T)]},E.compareModeConfigs,[t]),S=g.useCallback(({box:N,triggers:L,stage:T,cursor:D})=>{if(m.current==null)return;const $=E.determineMode(y,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=Ap(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=Tr(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(_,zn))})}if(jl.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(Ar(h,N,B)));if(c(_=>f.Eo.areaIsZero(_)?_:f.Eo.ZERO),f.G.distance(D,p.current)<Tp)return;p.current=D;const I=Tr(N,d.current,B);e==null||e({box:I,mode:$,stage:T,cursor:D})},[c,u,e,y,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(lo(L,T).box(Ar(h,N,T)),zn),[s]),w=E.useHeldRef({triggers:[["Control"]]}),M=E.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=lo(d.current,f.Eo.construct(m.current)).pos(f.G.construct(L));let _=f.b.XY.magnify({x:w.current.held?1:T,y:M.current.held?1:T}).box(d.current);_=f.Eo.translate(_,{x:w.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]),Gi.useDrag({bound:m,onDrag:S,triggers:b,loose:!0});const v=g.useCallback(({triggers:N,stage:L})=>{if(L==="end")return u(r);const T=E.determineMode(R,N);T!=null&&u(T)},[R,r,e]);return E.use$1({triggers:k,callback:v,region:m}),{maskBox:l,ref:m,mode:a}},lo=(e,t)=>f.b.XY.scale(t).clamp(t).scale(e),Tr=(e,t,n)=>{let s=f.Eo.signedDims(lo(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),zn)},Ar=(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,Bp=({mode:e,triggers:t})=>i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"center",children:[i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:f._$1.capitalize(e)}),i.jsxRuntimeExports.jsx(gf.Text,{trigger:t[0],level:"small"})]}),Vp={zoom:i.jsxRuntimeExports.jsx(E.e4.Zoom,{}),pan:i.jsxRuntimeExports.jsx(E.e4.Pan,{}),select:i.jsxRuntimeExports.jsx(E.e4.Selection,{}),zoomReset:i.jsxRuntimeExports.jsx(E.e4.Expand,{}),click:i.jsxRuntimeExports.jsx(E.e4.Bolt,{})},Fp=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([o])=>!t.includes(o)&&sn.includes(o)).map(([o,r])=>({key:o,icon:Vp[o],tooltip:i.jsxRuntimeExports.jsx(Bp,{mode:o,triggers:r})})).sort((o,r)=>sn.indexOf(o.key)-sn.indexOf(r.key));return i.jsxRuntimeExports.jsx(Re.Button,{...n,data:s,entryRenderKey:"icon",children:({title:o,entry:r,...l})=>g.createElement(E.Icon,{...l,key:r.key,variant:l.selected?"filled":"text",size:"medium",tooltip:r.tooltip,tooltipLocation:{x:"right",y:"top"}},r.icon)})},Hp=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Vo,MASK_MODES:jl,MODES:sn,Mask:Bo,PAN_DEFAULT_TRIGGERS:Sl,SELECT_DEFAULT_TRIGGERS:Rl,SelectMode:Fp,ZOOM_DEFAULT_TRIGGERS:Bn,modeZ:$p,use:Cl},Symbol.toStringTag,{value:"Module"})),bl=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Fo=g.forwardRef(({children:e,initial:t=f.Eo.DECIMAL,onChange:n,...s},o)=>{const{setViewport:r}=Ue("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=Cl({onChange:l,initial:t,ref:o,...s});return i.jsxRuntimeExports.jsx(Bo,{className:f.CSS.BE("line-plot","viewport"),...c,children:e})});Fo.displayName="Viewport";const Zp=Object.freeze(Object.defineProperty({__proto__:null,Floating:dl,Legend:xl,Line:zo,LinePlot:il,Title:pl,Tooltip:Ep,Viewport:Fo,XAxis:ll,YAxis:cl,axisFactory:Io,selectViewportEl:bl,useContext:Ue,useGridEntry:yn,useViewport:rl},Symbol.toStringTag,{value:"Module"})),Gp=E.wrap$1("Tooltip",({aetherKey:e,...t})=>(E.use$3({aetherKey:e,type:A.Annotation.TYPE,schema:A.annotationStateZ,initialState:t}),null)),wl=E.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:s,setHold:o}=Ue("Range.Provider"),[,{hovered:r,count:l},c]=E.use$3({aetherKey:e,type:A.Provider$1.TYPE,schema:A.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),a=yn({key:e,loc:"top",size:l>0?32:0,order:3},"Annotation.Provider"),u=E.useContextMenu(),d=E.useSyncedRef(u.visible),x=g.useCallback(p=>{const m=y=>{c(b=>({...b,cursor:{x:y.clientX,y:y.clientY}}))},h=p.currentTarget;h.addEventListener("mousemove",m),h.addEventListener("mouseleave",()=>{h.removeEventListener("mousemove",m),d.current||c(y=>({...y,cursor:null}))},{once:!0})},[c]);return i.jsxRuntimeExports.jsx(E.ContextMenu,{style:{...a,cursor:r!=null?"pointer":"default"},...u,menu:()=>t==null||r==null?null:t(r),children:i.jsxRuntimeExports.jsx(U.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})})}),Yp=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Gp,Provider:wl},Symbol.toStringTag,{value:"Module"})),vl={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Wp=E.flattenConfig(vl),_l=E.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=E.use$3({aetherKey:e,type:A.Measure.TYPE,schema:A.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=g.useRef(null),s=E.useHeldRef({triggers:Wp,loose:!0}),o=g.useCallback(({mode:c,cursor:a})=>{if(c==="click"){const u=E.determineMode(vl,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]);rl(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})}),Xp=Object.freeze(Object.defineProperty({__proto__:null,Measure:_l},Symbol.toStringTag,{value:"Module"})),Ho=E.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]=E.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 y=g.useRef(p);g.useEffect(()=>{m(j=>({...j,position:n,color:l,lineWidth:c,lineDash:a}))},[n,l,c,a]);const b=E.useCursorDrag({onStart:g.useCallback(()=>{m(j=>({...j,dragging:!0})),y.current=h.current},[]),onMove:j=>{m(w=>({...w,pixelPosition:(y.current??0)+f.Eo.signedHeight(j)}))},onEnd:g.useCallback(()=>{m(j=>({...j,dragging:!1})),y.current=p},[])}),R=g.useRef(null);if(x==null||p==null)return null;const k=bl(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:b,draggable:!0}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[i.jsxRuntimeExports.jsx(E.Editable,{level:"p",value:u,onChange:d}),i.jsxRuntimeExports.jsx(E.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${x.toFixed(2)} ${r}`})]})]});return k==null?S:No.createPortal(S,k)}),Kp=Object.freeze(Object.defineProperty({__proto__:null,Rule:Ho},Symbol.toStringTag,{value:"Module"})),kl=E.canDropOfType(He),qp=({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:y=!1,initialViewport:b=f.Eo.DECIMAL,legendVariant:R,onViewportChange:k,viewportTriggers:S,annotationProvider:j,...w})=>{var T;const M=t.filter(({location:D})=>f.K.isY(D)),v=g.useRef(),N=E.usePrevious(e.length),L=E.usePrevious(w.hold);return(N===0&&e.length!==0||L===!0&&w.hold===!1)&&((T=v.current)==null||T.reset()),i.jsxRuntimeExports.jsxs(il,{...w,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(Up,{axis:D,index:$,lines:B,yAxes:C,rules:I,onAxisChannelDrop:x,onAxisChange:p,annotationProvider:j},D.key)}),r&&i.jsxRuntimeExports.jsx(xl,{onLineChange:u,position:l,onPositionChange:c,variant:R}),n&&i.jsxRuntimeExports.jsx(pl,{value:s,onChange:o,level:a}),i.jsxRuntimeExports.jsxs(Fo,{initial:b,onChange:k,triggers:S,ref:v,children:[h&&i.jsxRuntimeExports.jsx(ml,{}),y&&i.jsxRuntimeExports.jsx(_l,{})]})]})},Up=({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=E.useDrop({type:"Channel.LinePlot.XAxis",canDrop:kl,onDrop:g.useCallback(({items:y})=>{const b=E.filterByType(He,y);return r==null||r(a,b.map(({key:R})=>R)),b},[a,r])}),m=s==null?void 0:s.filter(y=>y.axis===a),h=E.useDraggingState();return i.jsxRuntimeExports.jsxs(ll,{...d,...p,location:c,showGrid:u??n===0,className:f.CSS(f.CSS.dropRegion(E.canDropOfType(He)(h))),onAutoBoundsChange:y=>l==null?void 0:l({key:a,bounds:y}),children:[e.map((y,b)=>{const R=t.filter(S=>S.axes.y===y.key),k=s==null?void 0:s.filter(S=>S.axis===y.key);return i.jsxRuntimeExports.jsx(Jp,{axis:{...y,showGrid:u??(n===0&&b===0)},lines:R,rules:k,onRuleChange:o,onAxisChannelDrop:r,onAxisChange:l},y.key)}),m==null?void 0:m.map(y=>g.createElement(Ho,{aetherKey:y.key,...y,key:y.key,onLabelChange:b=>o==null?void 0:o({key:y.key,label:b}),onPositionChange:b=>o==null?void 0:o({key:y.key,position:b})})),i.jsxRuntimeExports.jsx(wl,{...x})]})},Qp=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Jp=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:o,axis:{key:r,location:l,...c}})=>{const a=E.useDrop({type:"Channel.LinePlot.YAxis",canDrop:kl,onDrop:g.useCallback(({items:d})=>{const x=E.filterByType(He,d);return s==null||s(r,x.map(({key:p})=>p)),x},[r,s])}),u=E.useDraggingState();return i.jsxRuntimeExports.jsxs(cl,{...c,...a,location:l,className:f.CSS(f.CSS.dropRegion(E.canDropOfType(He)(u))),onAutoBoundsChange:d=>o==null?void 0:o({key:r,bounds:d}),children:[e.map(d=>i.jsxRuntimeExports.jsx(em,{line:d},Qp(d))),t==null?void 0:t.map(d=>g.createElement(Ho,{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})}))]})},em=({line:e})=>e.variant==="static"?i.jsxRuntimeExports.jsx(nm,{line:e}):i.jsxRuntimeExports.jsx(tm,{line:e}),tm=({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(zo,{aetherKey:e,y:l,x:a,...o})},nm=({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(zo,{aetherKey:t,y:r,x:c,...o})},Ir=[{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"}],Wn=({items:e},t)=>{const n=E.filterByType(He,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Ml=["name","alias"],Pl=e=>{const t=ps();return g.useMemo(()=>e.length===0?Ir:Ir.filter(n=>e.includes(n.key)),[e,t])},sm=({columns:e=Ml,onChange:t,className:n,value:s,searchOptions:o,...r})=>{const l=Be(),c=ps(),a=Pl(e),u=Ao(),d=E.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(E.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:m,onDragEnd:h,...y}=E.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(j=>Wn(j,H.A(s)),[s]),onDrop:g.useCallback(({items:j})=>{const w=E.filterByType(He,j);if(w.length===0)return[];const M=H.n([...H.A(s),...w.map(v=>v.key)]);return t(M,{clickedIndex:null,clicked:null,entries:[]}),w},[t,s])}),b=E.useDraggingState(),R=g.useCallback(({dropped:j})=>{t(H.A(s).filter(w=>!j.some(M=>M.key===w)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),k=g.useCallback((j,w)=>m([{key:w,type:He}],R),[m,R]),S=g.useCallback(j=>c[j.key]??j.name,[c]);return i.jsxRuntimeExports.jsx(Ht,{className:f.CSS(n,f.CSS.dropRegion(Wn(b,H.A(s)))),value:s,onTagDragStart:k,onTagDragEnd:h,searcher:x,onChange:t,columns:a,emptyContent:p,entryRenderKey:S,...y,...r})},ut=({columns:e=Ml,onChange:t,value:n,className:s,data:o,searchOptions:r,...l})=>{const c=Be(),a=ps(),u=Pl(e),d=Ao(),x=E.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(E.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),y=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:b,onDragEnd:R,...k}=E.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(M=>Wn(M,H.o$1(n)),[n]),onDrop:g.useCallback(({items:M})=>{const v=E.filterByType(He,M);return v.length===0?[]:(t(v[0].key,{clickedIndex:null,clicked:null,entries:[]}),v)},[y,t])}),S=E.useDraggingState(),j=g.useCallback(()=>n!=null&&b([{type:He,key:n}]),[b,n]),w=g.useCallback(M=>a[M.key]??M.name,[a]);return i.jsxRuntimeExports.jsx(dt,{data:o,className:f.CSS(s,f.CSS.dropRegion(Wn(S,H.o$1(n)))),value:n,onDragStart:j,onDragEnd:R,onChange:t,searcher:p,columns:u,emptyContent:m,entryRenderKey:w,...k,...l})},om=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:qf,AliasProvider:tl,LinePlot:qp,SelectMultiple:sm,SelectSingle:ut,useActiveRange:Ao,useAlias:el,useAliases:ps,useContext:Ji,useName:ms},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}},Nl=(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},Ll=(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},rm=e=>{var t,n;return((n=(t=Nl(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},im=({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])},lm=({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},Tl=(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)}}),cm=({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,...Tl(s,e)}),[l,s,e])},Zo=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(Zo);return e??t},$r=e=>({key:e,variant:"success",message:""}),am=e=>e.code===re.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",Al=({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=E.useSyncedRef(n),c=E.useSyncedRef(o),a=g.useCallback(({path:w,onChange:M,listenToChildren:v=!1})=>{var D;const{parentListeners:N,listeners:L}=r.current,T=v?N:L;return T.has(w)||T.set(w,new Set),(D=T.get(w))==null||D.add(M),()=>{var $;return($=T.get(w))==null?void 0:$.delete(M)}},[]),u=g.useCallback((w,{optional:M}={optional:!1})=>{const{state:v,statuses:N,touched:L}=r.current,T=H._.get(v,w,{optional:M});if(T==null)return null;const D={value:T,status:N.get(w)??$r(w),touched:L.has(w),required:!1};if(l.current==null)return D;const $=l.current,B=H.N.getFieldSchema($,w,{optional:!0});return B==null||(D.required=!B.isOptional()),D},[]),d=g.useCallback(w=>{const{state:M,statuses:v,touched:N,listeners:L,parentListeners:T}=r.current;H._.remove(M,w),v.delete(w),N.delete(w),L.delete(w),T.delete(w)},[]),x=g.useCallback(w=>{const{statuses:M,touched:v}=r.current;r.current.state=w,m(""),M.clear(),v.clear()},[]),p=g.useCallback(w=>{var N;const{listeners:M}=r.current,v=u(w,{optional:!0});v!=null&&((N=M.get(w))==null||N.forEach(L=>L(v)))},[]),m=g.useCallback(w=>{const{listeners:M,parentListeners:v}=r.current,N=M.get(w);if(w==""&&([...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(w,{optional:!0});L!=null&&N.forEach(T=>{T(L)})}v.forEach((L,T)=>{if(H._.pathsMatch(w,T)){const $=u(T,{optional:!0});$!=null&&L.forEach(B=>{B($)})}})},[]),h=g.useCallback((w,M="",v=!0)=>{const{statuses:N,listeners:L,touched:T}=r.current;if(w.success){const C=[...N.keys()];return N.clear(),C.forEach(I=>p(I)),!0}let D=!0;const $=new Set(w.error.issues.map(C=>C.path.join(".")));let B=(C,I)=>C===I;return v&&(B=(C,I)=>H._.pathsMatch(C,I)),w.error.issues.forEach(C=>{var z;const{message:I}=C,_=C.path.join(".");if(!B(_,M))return;const O=am(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(_)??$r(_),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},[]),y=g.useCallback((w,M)=>{if(l.current==null)return!0;const{state:v}=r.current,N=l.current.safeParse(v);return h(N,w,M)},[h]),b=g.useCallback(async(w,M)=>{if(l.current==null)return!0;const{state:v}=r.current,N=await l.current.safeParseAsync(v);return h(N,w,M)},[h]),R=g.useCallback((w,M,v={})=>{const N=H._.get(r.current.state,w,{optional:!0}),{validateChildren:L=!0}=v,{state:T,touched:D}=r.current;D.add(w),w.length===0?r.current.state=M:H._.set(T,w,M),m(w),(async()=>{var B;let $;try{$=y(w,L)}catch{$=await b(w,L)}(B=c.current)==null||B.call(c,{values:r.current.state,path:w,prev:N,valid:$})})()},[]),k=g.useCallback(w=>H._.has(r.current.state,w),[]),S=g.useCallback((w,M)=>{r.current.statuses.set(w,M),r.current.touched.add(w),p(w)},[]),j=g.useCallback(()=>{const{statuses:w}=r.current;w.clear(),w.forEach((M,v)=>p(v))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:w}=r.current;r.current.state=e,w.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:y,validateAsync:b,value:()=>r.current.state,has:k,remove:d,setStatus:S,clearStatuses:j,reset:x}),[a,R,u,y,b,k,d,S,j,x,s])},um=e=>i.jsxRuntimeExports.jsx(Zo.Provider,{value:e,children:e.children}),dm=E.componentRenderProp(E.Text$1),me=({path:e,children:t=dm,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,y={onChange:m,value:h};return d.variant!=null&&(y.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(y)})},bt=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const o=({inputProps:r,path:l,fieldKey:c=t,...a})=>i.jsxRuntimeExports.jsx(me,{...n,...a,path:c?`${l}.${c}`:l,children:u=>i.jsxRuntimeExports.jsx(e,{...u,...s,...r})});return o.displayName=e.displayName,o},Il=bt(E.Numeric),Tt=Il({}),$l=bt(E.Text$1),Go=$l({}),Dl=bt(E.Switch$1),Es=Dl({}),xm=bt(dt),fm=bt(Ht),pm=bt(Re.DropdownButton),Yo=({key:e,open:t,onChange:n})=>{const s=E.useMemoPrimitiveArray(e);E.useAsyncEffect(async()=>{if(t==null)return;const o=await t();if(o!=null)return o.onChange(n),async()=>await o.close()},[t==null,s])},mm=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return E.useAsyncEffect(async()=>{s(await e())},[e]),Yo({...t,onChange:s}),n},hm=Object.freeze(Object.defineProperty({__proto__:null,useListener:Yo,useState:mm},Symbol.toStringTag,{value:"Module"})),gm=({key:e,name:t,queryFn:n,values:s,openObservable:o,applyChanges:r,applyObservable:l,...c})=>{const a=Be(),u=E.useAggregator(),d=E.useMemoPrimitiveArray(e),x=Al({values:s,...c,sync:!1,onChange:h=>{a!=null&&(async()=>{try{await(r==null?void 0:r({...h,client:a}))}catch(y){u({variant:"error",message:`Failed to save ${t}`,description:y.message})}})()}});E.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 Yo({key:d,open:p,onChange:m}),x},Em=Object.freeze(Object.defineProperty({__proto__:null,Context:Zo,Field:me,Form:um,NumericField:Tt,SwitchField:Es,TextField:Go,buildDropdownButtonSelectField:pm,buildNumericField:Il,buildSelectMultiField:fm,buildSelectSingleField:xm,buildSwitchField:Dl,buildTextField:$l,fieldArrayUtils:Tl,fieldBuilder:bt,use:Al,useChildFieldValues:lm,useContext:Je,useField:xt,useFieldArray:cm,useFieldListener:im,useFieldState:Nl,useFieldValid:rm,useFieldValue:Ll,useSynced:gm},Symbol.toStringTag,{value:"Module"})),ym=[{key:"name",name:"Name"},{key:"location",name:"Location"}],jm=({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:ym,searcher:s,entryRenderKey:"name",...t})},Sm=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:jm},Symbol.toStringTag,{value:"Module"})),At="label",Wo=[{key:"color",name:"Color",render:({entry:e})=>i.jsxRuntimeExports.jsx(E.e4.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Xn=({items:e},t)=>{const n=E.filterByType(At,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Rm=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...o})=>i.jsxRuntimeExports.jsx(cn,{color:e==null?void 0:e.color,...o,children:e==null?void 0:e.name}),Cm=E.componentRenderProp(Rm),bm=({onChange:e,className:t,value:n,...s})=>{const o=Be(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(E.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=E.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(p=>Xn(p,H.A(n)),[n]),onDrop:g.useCallback(({items:p})=>{const m=E.filterByType(At,p);if(m.length===0)return[];const h=H.n([...H.A(n),...m.map(y=>y.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=E.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:At}],d),[l,d]);return i.jsxRuntimeExports.jsx(Ht,{className:f.CSS(t,f.CSS.dropRegion(Xn(u,H.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.labels,onChange:e,columns:Wo,emptyContent:r,renderTag:Cm,addPlaceholder:"Label",...a,...s})},Ol=({value:e,onChange:t})=>{const n=Be(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(E.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=E.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(u=>Xn(u,H.o$1(e)),[e]),onDrop:g.useCallback(({items:u})=>{const d=E.filterByType(At,u);return d.length===0?[]:(t(d[0].key,{clickedIndex:null,clicked:null,entries:[]}),d)},[r,t])}),c=E.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:At,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},wm=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=Ol({value:t,onChange:e});return i.jsxRuntimeExports.jsx(dt,{data:s,className:f.CSS(n,f.CSS.dropRegion(Xn(r,H.o$1(t)))),value:t,onChange:e,columns:Wo,entryRenderKey:"name",...l,...o})},vm=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=Ol({value:t,onChange:n});return i.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:Wo,entryRenderKey:"name",...r,...s})},_m=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:At,SelectButton:vm,SelectMultiple:bm,SelectSingle:wm},Symbol.toStringTag,{value:"Module"})),zl=({children:e,centered:t,visible:n,enabled:s=!0,close:o,style:r,...l})=>{const c=g.useRef(null),a=g.useRef(n);E.useClickOutside({ref:c,exclude:d=>E.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 E.use$1({triggers:[["Escape"]],callback:u,loose:!0}),i.jsxRuntimeExports.jsx(U.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(U.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(U.Space,{className:f.CSS(f.CSS.BE("modal","content")),empty:!0,children:e})})})},km=({root:e,...t})=>No.createPortal(i.jsxRuntimeExports.jsx(zl,{...t}),E.getRootElement(e)),Mm=Object.freeze(Object.defineProperty({__proto__:null,Dialog:zl,Modal:km},Symbol.toStringTag,{value:"Module"})),ys=new Error("Tab not found"),Pm=new Error("Invalid Mosaic"),Kn=(e,t,n="center",s)=>{var x;if(e=et(e),s===void 0)return co(e,t);const o=ao(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(ao(e,c).key!==o.key)return Kn(e,t,"center",c);if(o.tabs==null||o.tabs.length===0)return Kn(e,t,"center",s);const[a,u,d]=$m(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 Pm;return o.first.key=r,o.last.key=l,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},Nm=(e,t,n)=>{var r;e=et(e);const[s,o]=yt(e,t);if(s==null||o==null)throw ys;return o.tabs=(r=o.tabs)==null?void 0:r.map(l=>l.tabKey===t?n(l):l),e},co=(e,t)=>(e=et(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=co(e.first,t):e.last!=null&&(e.last=co(e.last,t)),e)),qn=e=>{e=et(e);const t=[];if(e.tabs!=null&&(e.selected=je.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=qn(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=qn(e.last);e.last=n,t.push(...s)}return[e,t]},Xo=(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=je.resetSelection(n.selected,n.tabs),e=Im(e);const s=n.selected??Un(e);return[e,s]},Un=e=>e.selected!=null?e.selected:e.first!=null?Un(e.first):e.last!=null?Un(e.last):null,Bl=(e,t)=>{e=et(e);const[n,s]=yt(e,t);if(n==null||s==null)throw ys;return s.selected=t,e},Vl=(e,t,n,s)=>{e=et(e);const[o,r]=yt(e,t);if(o==null||r==null)throw ys;const[l,c]=Xo(e,t);return[Kn(l,o,n,s),c]},an=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=an(e.first,t);if(n!=null)return n}if(e.last!=null){const n=an(e.last,t);if(n!=null)return n}},Fl=(e,t,n)=>{const s=Qn(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},Lm=(e,t,n)=>{e=et(e);const s=an(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=je.resetSelection(u.selected,u.tabs),s.direction=n,s.first=u,s.last=a,s.tabs=void 0,s.selected=void 0,e},Tm=(e,t)=>{const n=an(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Hl=(e,t,n)=>{e=et(e);const[,s]=yt(e,t);if((s==null?void 0:s.tabs)==null)throw ys;return s.tabs=je.rename(t,n,(s==null?void 0:s.tabs)??[]),e},Am=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,ao=(e,t)=>{const n=Qn(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:ao(e,s)},Im=e=>{let t=!0;for(;t;)[e,t]=uo(e);return e.first==null&&e.last==null&&(e.key=1),e},uo=e=>{if(e.first==null||e.last==null)return[e,!1];if(Or(e.first))return[Dr(e.last,!0),!0];if(Or(e.last))return[Dr(e.first,!1),!0];let t,n;return[e.first,t]=uo(e.first),[e.last,n]=uo(e.last),[e,t||n]},Dr=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Or=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]},Qn=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=Qn(e.first,t);return n??Qn(e.last,t)},$m=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),Jn=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&Jn(e.first,t,n),e.last!=null&&Jn(e.last,t,n),n),xo=(e,t)=>{t(e),e.first!=null&&xo(e.first,t),e.last!=null&&xo(e.last,t)};class Zl{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 Dm=({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})},Gl=({node:e,children:t})=>No.createPortal(t,e.el),Om=Object.freeze(Object.defineProperty({__proto__:null,In:Gl,Node:Zl,Out:Dm},Symbol.toStringTag,{value:"Module"})),es=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}=Lo({direction:o,onResize:x,count:2,initialSizes:a!=null?[a]:void 0});let m;return s!==void 0?m=i.jsxRuntimeExports.jsx(Yl,{emptyContent:u,...n}):r!=null&&l!=null?m=i.jsxRuntimeExports.jsxs(fs,{id:`mosaic-${c}`,align:"stretch",className:f.CSS.BE("mosaic","resize"),...p,children:[i.jsxRuntimeExports.jsx(es,{...d,root:r,onResize:t},r.key),i.jsxRuntimeExports.jsx(es,{...d,root:l,onResize:t},l.key)]}):(m=null,console.warn("Mosaic tree is malformed")),c===1?i.jsxRuntimeExports.jsx(E.Provider$3,{children:m}):m});es.displayName="Mosaic";const ts="pluto-mosaic-tab-drop",Ko="pluto-mosaic-tab-create",zm=(e,t,n)=>{if(E.filterByType(E.FILE_TYPE,t).length>0&&n)return!0;const o=E.filterByType(ts,t).map(c=>c.key),r=e.filter(c=>!o.includes(c.tabKey)).length>0;return E.filterByType(Ko,t).length>0||o.length>0&&(r||e.length===0)},Yl=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:w})=>zm(a,w,x),[a,x]),m=g.useCallback(({items:w,event:M})=>{if(M==null)return[];d(null);const v=E.filterByType(E.FILE_TYPE,w).length>0,N=a.length===0?"center":Br(zr(M));if(v)return r==null||r(c,N,M),w;const L=E.filterByType(ts,w);if(L.length>0){const D=L.map(({key:$})=>$)[0];t(c,D,N)}const T=E.filterByType(Ko,w);if(T.length>0){const D=T.map(({key:$})=>$);n==null||n(c,N,D)}return L},[t,a.length]),h=g.useCallback(({event:w})=>{if(w==null)return;const M=a.length===0?"center":Br(zr(w));d(M)},[a.length]),{startDrag:y,...b}=E.useDragAndDrop({type:"Mosaic",canDrop:p,onDrop:m,onDragOver:h}),R=p(E.useDraggingState()),k=g.useCallback(()=>d(null),[]),S=g.useCallback((w,{tabKey:M})=>{y([{key:M,type:ts,elementID:w.currentTarget.id}])},[y]),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(je.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:k,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:S,onCreate:j,...l,...b,children:[e.selected!=null&&o(a.find(w=>w.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:Bm[u]})]})});Yl.displayName="MosaicTabLeaf";const Bm={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%"}},zr=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}},Vm=e=>e,Fm=e=>1-e,Br=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[Vm(e),Fm(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")},Hm=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),o=new Set,r=Jn(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 Zl({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(Gl,{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]},Zm=re.z.object({key:re.z.number(),tabs:re.z.array(je.tabZ).optional(),selected:re.z.string().optional(),direction:f.g.direction.optional(),size:re.z.number().optional()}),fo=Zm.extend({first:re.z.lazy(()=>fo).optional(),last:re.z.lazy(()=>fo).optional()}),Gm=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(qn(t)[0]),[t]),{root:n,onDrop:(u,d,x)=>s(p=>Vl(p,d,x,u)[0]),onClose:u=>s(d=>Xo(d,u)[0]),onSelect:u=>s(d=>Bl(d,u)),onResize:(u,d)=>s(x=>Fl(x,u,d)),onRename:e?(u,d)=>s(x=>Hl(x,u,d)):void 0}},Ym=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Ko,HAUL_DROP_TYPE:ts,Mosaic:es,autoSelectTabs:qn,canSplit:Tm,findSelected:Un,findTabNode:an,forEachNode:xo,insertTab:Kn,isEmpty:Am,mapNodes:Jn,moveTab:Vl,nodeZ:fo,removeTab:Xo,renameTab:Hl,resizeNode:Fl,selectTab:Bl,split:Lm,updateTab:Nm,use:Gm,usePortal:Hm},Symbol.toStringTag,{value:"Module"})),Wm=({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(U.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})},jn=e=>({bordered:t=!1,className:n,...s})=>i.jsxRuntimeExports.jsx(U.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}),Wl=jn("start");Wl.displayName="NavbarStart";const Xl=jn("end");Xl.displayName="NavbarEnd";const Kl=jn("center");Kl.displayName="NavbarCenter";const ql=jn("");ql.displayName="NavbarContent";const Ul=jn("absolute-center");Ul.displayName="NavbarAbsoluteCenter";const Zt=Wm;Zt.Start=Wl;Zt.Center=Kl;Zt.End=Xl;Zt.AbsoluteCenter=Ul;Zt.Content=ql;const qo=({aetherKey:e})=>{const[,{region:t},n]=E.use$3({aetherKey:e,type:A.Eraser$1.TYPE,schema:A.eraserStateZ,initialState:{region:f.Eo.ZERO,enabled:!0}}),s=E.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}},Xm=E.wrap$1(A.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:n}=qo({aetherKey:e}),s=E.useResize(n);return i.jsxRuntimeExports.jsx("div",{ref:s,className:f.CSS(f.CSS.inheritDims()),children:t})}),Km=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Xm,use:qo},Symbol.toStringTag,{value:"Module"})),qm=({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}},Um=E.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}=qo({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:y,minSize:b,maxSize:R,initialSize:k}=t;return i.jsxRuntimeExports.jsx(Ki,{className:f.CSS(f.CSS.BE("navdrawer","content"),f.CSS.dir(u),l),collapseThreshold:r,onCollapse:d,location:o,onResize:m,minSize:b,maxSize:R,initialSize:k,...a,children:h},y)}),Qm=Object.freeze(Object.defineProperty({__proto__:null,Bar:Zt,Drawer:Um,useDrawer:qm},Symbol.toStringTag,{value:"Module"})),Jm=({variant:e,className:t,children:n,...s})=>i.jsxRuntimeExports.jsx(U.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:Jm},Symbol.toStringTag,{value:"Module"})),Gs={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"})]})},th=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:o,onFullscreen:r,onClose:l,...c})=>i.jsxRuntimeExports.jsxs(U.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(Ys,{onClick:l,className:f.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Gs.Close}),i.jsxRuntimeExports.jsx(Ys,{onClick:s,className:f.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Gs.Minimize}),i.jsxRuntimeExports.jsx(Ys,{onClick:r,className:f.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Gs.Maximize})]}),Ys=({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}),Ws=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:o,focused:r,...l})=>i.jsxRuntimeExports.jsxs(U.Pack,{...l,children:[i.jsxRuntimeExports.jsx(Xs,{className:f.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:i.jsxRuntimeExports.jsx(E.e4.Subtract,{})}),i.jsxRuntimeExports.jsx(Xs,{className:f.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:i.jsxRuntimeExports.jsx(E.e4.Box,{})}),i.jsxRuntimeExports.jsx(Xs,{onClick:s,className:f.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:i.jsxRuntimeExports.jsx(E.e4.Close,{})})]}),Xs=({disabled:e=!1,className:t,...n})=>e?null:i.jsxRuntimeExports.jsx(E.Icon,{className:f.CSS(f.CSS.B("windows-control"),t),tabIndex:-1,...n}),Ql=e=>H.w.getOS(e),nh={MacOS:th,Windows:Ws,Linux:Ws,Docker:Ws},sh="Windows",oh=({forceOS:e,visibleIfOS:t,...n})=>{const s=Ql({force:e,default:sh}),o=nh[s];return t!=null&&t!==s?null:i.jsxRuntimeExports.jsx(o,{...n})},rh=Object.freeze(Object.defineProperty({__proto__:null,Controls:oh,use:Ql},Symbol.toStringTag,{value:"Module"})),ih=(e,t)=>{const n=s=>i.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},lh=Object.freeze(Object.defineProperty({__proto__:null,createComponent:ih},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:H.B$1.NOOP});const ch=E.wrap$1(A.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const s=E.useMemoDeepEqualProps(n),[{path:o},,r]=E.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(E.Composite,{path:o,children:t})}),ah="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Jl=E.wrap$1(A.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=E.use$3({aetherKey:t,type:A.BaseProvider.TYPE,schema:A.providerStateZ$2,initialState:{}});return i.jsxRuntimeExports.jsx(E.Composite,{path:n,children:e})}),uh=Object.freeze(Object.defineProperty({__proto__:null,Provider:Jl},Symbol.toStringTag,{value:"Module"})),dh=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)"}}},ec=E.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:s,...o})=>{const r=E.useMemoDeepEqualProps({source:t,sink:n}),[,{status:l},c]=E.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}=dh(l);return i.jsxRuntimeExports.jsx(E.Icon,{variant:"text",className:f.CSS(f.CSS.B("control-chip"),s),disabled:p,onClick:a,tooltip:i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:u}),style:x,...o,children:i.jsxRuntimeExports.jsx(E.e4.Circle,{color:d})})}),tc=g.createContext({needsControlOf:[]}),nc=()=>g.useContext(tc),xh=E.wrap$1(A.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...s})=>{const o=E.useMemoDeepEqualProps(s),[{path:r},{status:l,needsControlOf:c},a]=E.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(tc.Provider,{value:{needsControlOf:c},children:[i.jsxRuntimeExports.jsx(E.Composite,{path:r,children:t}),";"]})}),sc=E.wrap$1(A.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var a;const s=E.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:o,status:r},l]=E.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(E.Dialog$1,{location:{x:"center",y:"bottom"},children:[i.jsxRuntimeExports.jsx(E.Text,{level:"p",children:r.message}),i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("indicator"),style:{backgroundColor:f.cssString(c),flexGrow:1}})]})}),fh=E.wrap$1(A.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=nc(),[,{states:s},o]=E.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(Oo,{data:l,...t})}),oc=E.wrap$1(A.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=E.use$3({aetherKey:e,type:A.StateProvider.TYPE,schema:A.stateProviderStateZ,initialState:{}});return i.jsxRuntimeExports.jsx(E.Composite,{path:n,children:t})}),ph=Object.freeze(Object.defineProperty({__proto__:null,Chip:ec,Controller:xh,Indicator:sc,Legend:fh,StateProvider:oc,useContext:nc},Symbol.toStringTag,{value:"Module"})),rc=e=>{const t=({disabled:n=!1,...s})=>n?s.children:i.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},mh=rc(Jl),hh=rc(E.Provider$4),gh=({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(E.Provider$2,{...l,children:i.jsxRuntimeExports.jsx(E.Config,{...r,children:i.jsxRuntimeExports.jsx(E.Provider$3,{...a,children:i.jsxRuntimeExports.jsx(E.Provider$5,{url:s??ah,enabled:n,children:i.jsxRuntimeExports.jsx(hh,{workerKey:"vis",children:i.jsxRuntimeExports.jsx(ch,{...c,children:i.jsxRuntimeExports.jsx(E.Aggregator,{children:i.jsxRuntimeExports.jsx(Qi,{connParams:t,children:i.jsxRuntimeExports.jsx(tl,{...u,children:i.jsxRuntimeExports.jsx(mh,{...d,children:i.jsxRuntimeExports.jsx(E.Provider$1,{...x,children:i.jsxRuntimeExports.jsx(E.Provider,{...o,children:i.jsxRuntimeExports.jsx(oc,{children:e})})})})})})})})})})})})}),Eh=Object.freeze(Object.defineProperty({__proto__:null,Provider:gh},Symbol.toStringTag,{value:"Module"})),yh=({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}%`}})}),jh=Object.freeze(Object.defineProperty({__proto__:null,Progress:yh},Symbol.toStringTag,{value:"Module"})),un="range",Uo=[{key:"name",name:"Name"}],ns=({items:e},t)=>{const n=E.filterByType(un,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Sh=({onChange:e,className:t,value:n,...s})=>{const o=Be(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(E.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=E.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(p=>ns(p,H.A(n)),[n]),onDrop:g.useCallback(({items:p})=>{const m=E.filterByType(un,p);if(m.length===0)return[];const h=H.n([...H.A(n),...m.map(y=>y.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=E.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:un}],d),[l,d]);return i.jsxRuntimeExports.jsx(Ht,{className:f.CSS(t,f.CSS.dropRegion(ns(u,H.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.ranges,onChange:e,columns:Uo,emptyContent:r,entryRenderKey:"name",...a,...s})},ic=({value:e,onChange:t})=>{const n=Be(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(E.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}=E.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(d=>ns(d,H.o$1(e)),[e]),onDrop:g.useCallback(({items:d})=>{const x=E.filterByType(un,d);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[r,t])}),a=E.useDraggingState(),u=g.useCallback(()=>e!=null&&l([{type:un,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:u,searcher:n==null?void 0:n.ranges}},Rh=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=ic({value:t,onChange:e});return i.jsxRuntimeExports.jsx(dt,{data:s,className:f.CSS(n,f.CSS.dropRegion(ns(r,H.o$1(t)))),value:t,onChange:e,columns:Uo,entryRenderKey:"name",...l,...o})},Ch=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=ic({value:t,onChange:n});return i.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:Uo,entryRenderKey:"name",...r,...s})},bh=[{key:"color",name:"Color",width:50,render:e=>i.jsxRuntimeExports.jsx(E.e4.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],wh=e=>{const t=Be();return i.jsxRuntimeExports.jsx(Ht,{...e,searcher:t==null?void 0:t.labels,columns:bh,renderTag:n=>n.entry==null?i.jsxRuntimeExports.jsx(cn,{color:"gray",children:n.entryKey}):i.jsxRuntimeExports.jsx(cn,{color:n.entry.color,children:n.entry.name})})},vh=({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(U.Space,{direction:"x",size:"small",className:f.CSS(f.CSS.B("time-range-chip")),align:"center",...o,children:[r.isToday&&i.jsxRuntimeExports.jsx(E.Text,{level:t,shade:n,weight:450,children:"Today"}),i.jsxRuntimeExports.jsx(E.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:r}),i.jsxRuntimeExports.jsx(E.e4.Arrow.Right,{color:"var(--pluto-text-color)"}),a?i.jsxRuntimeExports.jsx(E.Text,{level:t,children:"Now"}):i.jsxRuntimeExports.jsx(E.DateTime,{level:t,displayTZ:"local",format:u,shade:n,weight:450,children:c}),!d.isZero&&s&&i.jsxRuntimeExports.jsxs(E.Text,{level:t,shade:n,weight:450,children:["(",r.span(c).truncate(H.y.MILLISECOND).toString(),")"]})]})},_h=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Ch,SelectLabels:wh,SelectMultiple:Sh,SelectSingle:Rh,TimeRangeChip:vh},Symbol.toStringTag,{value:"Module"})),kh=({steps:e,value:t,onChange:n,...s})=>{const o=e.findIndex(r=>r.key===t);return i.jsxRuntimeExports.jsx(U.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(E.Button,{onClick:()=>n(r.key),variant:"outlined",disabled:l>o,children:[l+1,". ",r.title]},r.key),l!==e.length-1&&i.jsxRuntimeExports.jsx(E.e4.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},r.key))})},Mh=Object.freeze(Object.defineProperty({__proto__:null,Steps:kh},Symbol.toStringTag,{value:"Module"})),Ph=E.wrap$1("Table",({aetherKey:e,children:t,className:n,visible:s,...o})=>{const[{path:r},,l]=E.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=En(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(E.Composite,{path:r,children:t})})})]})}),Nh=({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(cc,{onSelect:r,index:s,value:n,onChange:o,position:l,direction:"y"}),e]}),js=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}));js.displayName="Cell";const lc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Lh=e=>lc[e],cc=({value:e,selected:t=!1,index:n,onChange:s,position:o,direction:r="x",onSelect:l})=>{const c=E.useSyncedRef(e),a=g.useRef(e),u=E.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),E.CONTEXT_TARGET,t&&E.CONTEXT_SELECTED),style:{[f.g.dimension(r)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[i.jsxRuntimeExports.jsx(E.Text,{level:"p",shade:7,style:{width:"100%",textAlign:"center"},children:r==="x"?lc[n]:n+1}),i.jsxRuntimeExports.jsx("button",{onClick:d=>d.stopPropagation(),style:{[f.g.location(r)]:o+e},onDragStart:u,draggable:!0})]})},Th=({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(cc,{onSelect:t,position:c,selected:e.includes(l),index:l,value:r,onChange:a=>s(a,l),direction:"x"},l)})]})},Ah=Object.freeze(Object.defineProperty({__proto__:null,Cell:js,ColumnIndicators:Th,Row:Nh,Table:Ph,getCellColumn:Lh},Symbol.toStringTag,{value:"Module"})),Ih=[{key:"standard",name:"Standard"},{key:"scientific",name:"Scientific"},{key:"engineering",name:"Engineering"}],$h=({...e})=>i.jsxRuntimeExports.jsx(Re.Button,{...e,entryRenderKey:"name",data:Ih}),ac=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Qo=({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 y=A.sourcePipeline("string",{connections:ac,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:y})},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=ms(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(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Notation",children:i.jsxRuntimeExports.jsx($h,{value:r.notation,onChange:u})}),i.jsxRuntimeExports.jsx(Pe.Item,{label:"Precision",align:"start",children:i.jsxRuntimeExports.jsx(E.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(E.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:x})})]})]})},Dh=A.Value.z.partial({color:!0}).extend({level:H.levelZ.optional()}),Jo=({aetherKey:e,box:t,telem:n,color:s,precision:o,minWidth:r,level:l="small",backgroundTelem:c,notation:a,location:u})=>{const d=E.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:o,level:l,minWidth:r,notation:a,backgroundTelem:c,location:u}),[,x,p]=E.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}},Oh=Object.freeze(Object.defineProperty({__proto__:null,TelemForm:Qo,VALUE_CONNECTIONS:ac,corePropsZ:Dh,use:Jo},Symbol.toStringTag,{value:"Module"})),zh=re.z.object({value:re.z.string(),level:H.levelZ,weight:H.weightZ,align:f.K.x.or(f.K.center),backgroundColor:f.crudeZ}),Bh=({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(js,{id:e,className:f.CSS(E.CONTEXT_TARGET,s&&E.CONTEXT_SELECTED,f.CSS.BEM("table","cell","text")),selected:s,onClick:u,onContextMenu:u,style:{backgroundColor:f.cssString(a)},children:i.jsxRuntimeExports.jsx(E.Editable,{level:l,value:n,weight:c,onChange:d,style:{justifyContent:r},allowEmpty:!0})})},Vh=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()}),Fh=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:o,bounds:r},selected:l,box:c,onSelect:a})=>{const{width:u}=Jo({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(js,{id:e,selected:l,onClick:d,onContextMenu:d,style:{height:"5rem",width:u},className:f.CSS(E.CONTEXT_TARGET,l&&E.CONTEXT_SELECTED,f.CSS.BEM("table","cell","value"))})},Hh=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return i.jsxRuntimeExports.jsx(U.Space,{direction:"y",style:{padding:"2rem"},children:i.jsxRuntimeExports.jsx(Qo,{path:""})});case"redline":return i.jsxRuntimeExports.jsx(U.Space,{direction:"y",style:{padding:"2rem"},children:i.jsxRuntimeExports.jsx(Zh,{})});default:return i.jsxRuntimeExports.jsx(U.Space,{direction:"y",grow:!0,empty:!0,style:{padding:"2rem"},children:i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Variant",padHelpText:!1,children:i.jsxRuntimeExports.jsx(uc,{onChange:e,value:"value"})}),i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:o,onChange:r,variant:l,...c})=>i.jsxRuntimeExports.jsx(E.Swatch,{value:o??f.ZERO.setAlpha(1).rgba255,onChange:a=>r(a.rgba255),...c,bordered:!0})}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:o=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...o})})]})})}},[]),n=je.useStatic({tabs:[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],content:t});return i.jsxRuntimeExports.jsx(je.Tabs,{...n})},Zh=()=>{const{set:e,get:t}=Je(),n=Ll("redline.bounds"),s=f.b.Scale.scale(0,1).scale(n);return i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Tt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Lower",path:"redline.bounds.lower"}),i.jsxRuntimeExports.jsx(me,{path:"redline.gradient",label:"Gradient",align:"start",padHelpText:!1,children:({value:o,onChange:r})=>i.jsxRuntimeExports.jsx(E.GradientPicker,{value:H._.copy(o),scale:s,onChange:l=>{const a={...t("redline.bounds").value},u=l.map(y=>y.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(y=>({...y,color:new f.Color(y.color).hex}));p||m?e("redline",{bounds:a,gradient:h}):r(l.map(y=>({...y,color:new f.Color(y.color).hex})))}})}),i.jsxRuntimeExports.jsx(Tt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Upper",path:"redline.bounds.upper"})]})},Gh=({onVariantChange:e})=>i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",grow:!0,style:{padding:"2rem"},children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Variant",padHelpText:!1,children:i.jsxRuntimeExports.jsx(uc,{onChange:e,value:"text"})}),i.jsxRuntimeExports.jsx(Go,{path:"value",label:"Text"}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"weight",label:"Weight",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Re.SelectWeight,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"align",label:"Alignment",hideIfNull:!0,children:t=>i.jsxRuntimeExports.jsx(hs,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>i.jsxRuntimeExports.jsx(E.Swatch,{value:t,onChange:n})})]}),Yh=[{key:"text",name:"Text"},{key:"value",name:"Value"}],uc=({onChange:e,value:t})=>i.jsxRuntimeExports.jsx(Re.Button,{value:t,onChange:e,data:Yh,allowMultiple:!1,entryRenderKey:"name"}),Wh=["text","value"],Xh=re.z.enum(Wh),Kh={key:"value",name:"Value",Form:Hh,Cell:Fh,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:Vh},qh={key:"text",name:"Text",Form:Gh,Cell:Bh,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:zh},Uh={text:qh,value:Kh},Qh=Object.freeze(Object.defineProperty({__proto__:null,CELLS:Uh,variantZ:Xh},Symbol.toStringTag,{value:"Module"})),Vr=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const o=pt(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)},Fr=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:o,targetBox:r})=>{if(!Jh({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=f.g.construct(t),c=f.g.swap(l);let a=gt(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]+jt(a,Le)}},po=re.z.object({direction:f.g.direction,length:re.z.number()}),pt=(e,...t)=>{let n=e;for(const s of t)n=f.G.translate(n,s.direction,s.length);return n},dc=(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=gt(l.direction,l.length),a=Hr(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=gt(d.direction,d.length),p=Hr(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,Hr=e=>e==="top"||e==="left"?-1:1,jt=(e,t)=>e==="top"||e==="left"?-t:t,gt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",it=e=>gt(e.direction,e.length),Jh=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=f.g.construct(n),o=t[s]-e[s];return jt(n,o)<0},kn=e=>({direction:f.g.construct(e),length:jt(e,Le)}),Zr={top:kn("top"),bottom:kn("bottom"),left:kn("left"),right:kn("right")},eg=4,tg=.25,Ss=e=>mo(ng(mo(e))),ng=e=>{const t=[...e],n=e.findIndex((s,o)=>{const r=Math.abs(s.length);if(r<eg){if(o===0||o===e.length-1)return!1;if(r<tg)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},mo=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=jt(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=jt(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?mo(t):t},Mt=e=>Ss(sg(e)),sg=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:o,sourceOrientation:r})=>{let l=r,c=o,a={...Zr[r]},u=pt(n,a);const d={...Zr[o]};let x=pt(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=pt(n,a),x=pt(s,d));const h=[a],y=Fr({sourceStumpTip:u,sourceOrientation:r,sourceBox:e,targetStumpTip:x,targetOrientation:o,targetBox:t});y!=null&&(h.push(y),u=pt(u,y),l=it(y),a=y);const b=Fr({sourceStumpTip:x,sourceOrientation:c,sourceBox:t,targetStumpTip:u,targetOrientation:l,targetBox:e});b!=null&&(x=pt(x,b),c=gt(b.direction,b.length));const R=()=>{b!=null&&(b.length*=-1,h.push(b)),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 w;gt(a.direction,k)===l&>(S,j)===c?w={direction:a.direction,length:k}:(w={direction:S,length:x[S]-u[S]},S=f.g.swap(S)),h.push(w);const M={direction:S,length:x[S]-u[S]};return h.push(M),R(),h},og=e=>Ss(rg(e)),rg=({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=jt(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=jt(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},ig=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},lg=(e,t,n=!1,...s)=>{const o=(r,l)=>!s.includes(l)&&t(r,l);return n?ig(e,o):e.findIndex(o)},cg=({delta:e,segments:t})=>Ss(xc(e,t,!1)),ag=({delta:e,segments:t})=>Ss(xc(e,t,!0)),xc=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Yr("x",e,s,n)),e.y!==0&&(s=Yr("y",e,s,n)),s},Gr=(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},Yr=(e,t,n,s)=>{const o=f.g.swap(e),r=s?n.length-1:0,l=n[r];if(Gr(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=lg(n,x=>x.direction===e,s,r);if(u===c){const x=n[c];return Gr(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},ug=re.z.object({position:f.G.xy,zoom:re.z.number()}),fc=re.z.object({color:f.crudeZ,variant:re.z.string().optional(),segments:re.z.array(po)}),dg=fc.extend({key:re.z.string(),source:re.z.string(),target:re.z.string(),segments:re.z.array(po),color:f.crudeZ,id:re.z.string(),data:re.z.object({segments:re.z.array(po),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()}),xg=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()}),er=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),tr=e=>e.map(({segments:t,color:n,variant:s,...o})=>({...o,id:o.key,data:{segments:t,color:n,variant:s}})),pc=e=>e.map(t=>({key:t.id,selected:t.selected,...t})),mc=(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}}),hc=e=>({...e.position,zoom:e.zoom}),gc=e=>({position:f.G.construct(e),zoom:e.zoom}),Ec=(e,t)=>pc(t(er(e))),Vn=(e,t,n)=>mc(t(tr(e)),n),fg=(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 Ce(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=Ce(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var pg={value:()=>{}};function Rs(){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 Fn(n)}function Fn(e){this._=e}function mg(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}})}Fn.prototype=Rs.prototype={constructor:Fn,on:function(e,t){var n=this._,s=mg(e+"",n),o,r=-1,l=s.length;if(arguments.length<2){for(;++r<l;)if((o=(e=s[r]).type)&&(o=hg(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]=Wr(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Wr(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 Fn(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 hg(e,t){for(var n=0,s=e.length,o;n<s;++n)if((o=e[n]).name===t)return o.value}function Wr(e,t,n){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=pg,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var ho="http://www.w3.org/1999/xhtml";const Xr={svg:"http://www.w3.org/2000/svg",xhtml:ho,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Cs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Xr.hasOwnProperty(t)?{space:Xr[t],local:e}:e}function gg(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ho&&t.documentElement.namespaceURI===ho?t.createElement(e):t.createElementNS(n,e)}}function Eg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yc(e){var t=Cs(e);return(t.local?Eg:gg)(t)}function yg(){}function nr(e){return e==null?yg:function(){return this.querySelector(e)}}function jg(e){typeof e!="function"&&(e=nr(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 Sg(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Rg(){return[]}function jc(e){return e==null?Rg:function(){return this.querySelectorAll(e)}}function Cg(e){return function(){return Sg(e.apply(this,arguments))}}function bg(e){typeof e=="function"?e=Cg(e):e=jc(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 Sc(e){return function(){return this.matches(e)}}function Rc(e){return function(t){return t.matches(e)}}var wg=Array.prototype.find;function vg(e){return function(){return wg.call(this.children,e)}}function _g(){return this.firstElementChild}function kg(e){return this.select(e==null?_g:vg(typeof e=="function"?e:Rc(e)))}var Mg=Array.prototype.filter;function Pg(){return Array.from(this.children)}function Ng(e){return function(){return Mg.call(this.children,e)}}function Lg(e){return this.selectAll(e==null?Pg:Ng(typeof e=="function"?e:Rc(e)))}function Tg(e){typeof e!="function"&&(e=Sc(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 Cc(e){return new Array(e.length)}function Ag(){return new Ie(this._enter||this._groups.map(Cc),this._parents)}function ss(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ss.prototype={constructor:ss,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 Ig(e){return function(){return e}}function $g(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 ss(e,r[l]);for(;l<a;++l)(c=t[l])&&(o[l]=c)}function Dg(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 ss(e,r[c]);for(c=0;c<d;++c)(a=t[c])&&u.get(p[c])===a&&(o[c]=a)}function Og(e){return e.__data__}function zg(e,t){if(!arguments.length)return Array.from(this,Og);var n=t?Dg:$g,s=this._parents,o=this._groups;typeof e!="function"&&(e=Ig(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=Bg(e.call(d,d&&d.__data__,u,s)),h=m.length,y=c[u]=new Array(h),b=l[u]=new Array(h),R=a[u]=new Array(p);n(d,x,y,b,R,m,t);for(var k=0,S=0,j,w;k<h;++k)if(j=y[k]){for(k>=S&&(S=k+1);!(w=b[S])&&++S<h;);j._next=w||null}}return l=new Ie(l,s),l._enter=c,l._exit=a,l}function Bg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Vg(){return new Ie(this._exit||this._groups.map(Cc),this._parents)}function Fg(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 Hg(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 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 Gg(e){e||(e=Yg);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 Yg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Wg(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xg(){return Array.from(this)}function Kg(){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 Ug(){return!this.node()}function Qg(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 Jg(e){return function(){this.removeAttribute(e)}}function eE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tE(e,t){return function(){this.setAttribute(e,t)}}function nE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function sE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function oE(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 rE(e,t){var n=Cs(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?eE:Jg:typeof t=="function"?n.local?oE:sE:n.local?nE:tE)(n,t))}function bc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function iE(e){return function(){this.style.removeProperty(e)}}function lE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function cE(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function aE(e,t,n){return arguments.length>1?this.each((t==null?iE:typeof t=="function"?cE:lE)(e,t,n??"")):It(this.node(),e)}function It(e,t){return e.style.getPropertyValue(t)||bc(e).getComputedStyle(e,null).getPropertyValue(t)}function uE(e){return function(){delete this[e]}}function dE(e,t){return function(){this[e]=t}}function xE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function fE(e,t){return arguments.length>1?this.each((t==null?uE:typeof t=="function"?xE:dE)(e,t)):this.node()[e]}function wc(e){return e.trim().split(/^|\s+/)}function sr(e){return e.classList||new vc(e)}function vc(e){this._node=e,this._names=wc(e.getAttribute("class")||"")}vc.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 _c(e,t){for(var n=sr(e),s=-1,o=t.length;++s<o;)n.add(t[s])}function kc(e,t){for(var n=sr(e),s=-1,o=t.length;++s<o;)n.remove(t[s])}function pE(e){return function(){_c(this,e)}}function mE(e){return function(){kc(this,e)}}function hE(e,t){return function(){(t.apply(this,arguments)?_c:kc)(this,e)}}function gE(e,t){var n=wc(e+"");if(arguments.length<2){for(var s=sr(this.node()),o=-1,r=n.length;++o<r;)if(!s.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?hE:t?pE:mE)(n,t))}function EE(){this.textContent=""}function yE(e){return function(){this.textContent=e}}function jE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function SE(e){return arguments.length?this.each(e==null?EE:(typeof e=="function"?jE:yE)(e)):this.node().textContent}function RE(){this.innerHTML=""}function CE(e){return function(){this.innerHTML=e}}function bE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function wE(e){return arguments.length?this.each(e==null?RE:(typeof e=="function"?bE:CE)(e)):this.node().innerHTML}function vE(){this.nextSibling&&this.parentNode.appendChild(this)}function _E(){return this.each(vE)}function kE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ME(){return this.each(kE)}function PE(e){var t=typeof e=="function"?e:yc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function NE(){return null}function LE(e,t){var n=typeof e=="function"?e:yc(e),s=t==null?NE:typeof t=="function"?t:nr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function TE(){var e=this.parentNode;e&&e.removeChild(this)}function AE(){return this.each(TE)}function IE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $E(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function DE(e){return this.select(e?$E:IE)}function OE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function zE(e){return function(t){e.call(this,t,this.__data__)}}function BE(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 VE(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 FE(e,t,n){return function(){var s=this.__on,o,r=zE(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 HE(e,t,n){var s=BE(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?FE:VE,o=0;o<r;++o)this.each(c(s[o],t,n));return this}function Mc(e,t,n){var s=bc(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 ZE(e,t){return function(){return Mc(this,e,t)}}function GE(e,t){return function(){return Mc(this,e,t.apply(this,arguments))}}function YE(e,t){return this.each((typeof t=="function"?GE:ZE)(e,t))}function*WE(){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 Ie(e,t){this._groups=e,this._parents=t}function Sn(){return new Ie([[document.documentElement]],Pc)}function XE(){return this}Ie.prototype=Sn.prototype={constructor:Ie,select:jg,selectAll:bg,selectChild:kg,selectChildren:Lg,filter:Tg,data:zg,enter:Ag,exit:Vg,join:Fg,merge:Hg,selection:XE,order:Zg,sort:Gg,call:Wg,nodes:Xg,node:Kg,size:qg,empty:Ug,each:Qg,attr:rE,style:aE,property:fE,classed:gE,text:SE,html:wE,raise:_E,lower:ME,append:PE,insert:LE,remove:AE,clone:DE,datum:OE,on:HE,dispatch:YE,[Symbol.iterator]:WE};function Ae(e){return typeof e=="string"?new Ie([[document.querySelector(e)]],[document.documentElement]):new Ie([[e]],Pc)}function KE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function De(e,t){if(e=KE(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 qE={passive:!1},dn={capture:!0,passive:!1};function Ks(e){e.stopImmediatePropagation()}function Lt(e){e.preventDefault(),e.stopImmediatePropagation()}function Nc(e){var t=e.document.documentElement,n=Ae(e).on("dragstart.drag",Lt,dn);"onselectstart"in t?n.on("selectstart.drag",Lt,dn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Lc(e,t){var n=e.document.documentElement,s=Ae(e).on("dragstart.drag",null);t&&(s.on("click.drag",Lt,dn),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 Mn=e=>()=>e;function go(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}})}go.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function UE(e){return!e.ctrlKey&&!e.button}function QE(){return this.parentNode}function JE(e,t){return t??{x:e.x,y:e.y}}function ey(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tc(){var e=UE,t=QE,n=JE,s=ey,o={},r=Rs("start","drag","end"),l=0,c,a,u,d,x=0;function p(j){j.on("mousedown.drag",m).filter(s).on("touchstart.drag",b).on("touchmove.drag",R,qE).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(j,w){if(!(d||!e.call(this,j,w))){var M=S(this,t.call(this,j,w),j,w,"mouse");M&&(Ae(j.view).on("mousemove.drag",h,dn).on("mouseup.drag",y,dn),Nc(j.view),Ks(j),u=!1,c=j.clientX,a=j.clientY,M("start",j))}}function h(j){if(Lt(j),!u){var w=j.clientX-c,M=j.clientY-a;u=w*w+M*M>x}o.mouse("drag",j)}function y(j){Ae(j.view).on("mousemove.drag mouseup.drag",null),Lc(j.view,u),Lt(j),o.mouse("end",j)}function b(j,w){if(e.call(this,j,w)){var M=j.changedTouches,v=t.call(this,j,w),N=M.length,L,T;for(L=0;L<N;++L)(T=S(this,v,j,w,M[L].identifier,M[L]))&&(Ks(j),T("start",j,M[L]))}}function R(j){var w=j.changedTouches,M=w.length,v,N;for(v=0;v<M;++v)(N=o[w[v].identifier])&&(Lt(j),N("drag",j,w[v]))}function k(j){var w=j.changedTouches,M=w.length,v,N;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),v=0;v<M;++v)(N=o[w[v].identifier])&&(Ks(j),N("end",j,w[v]))}function S(j,w,M,v,N,L){var T=r.copy(),D=De(L||M,w),$,B,C;if((C=n.call(j,new go("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,w),V=l;break}T.call(_,j,new go(_,{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:Mn(!!j),p):e},p.container=function(j){return arguments.length?(t=typeof j=="function"?j:Mn(j),p):t},p.subject=function(j){return arguments.length?(n=typeof j=="function"?j:Mn(j),p):n},p.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:Mn(!!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 $t=0,tn=0,Jt=0,Ac=1e3,os,nn,rs=0,St=0,bs=0,xn=typeof performance=="object"&&performance.now?performance:Date,Ic=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function or(){return St||(Ic(ty),St=xn.now()+bs)}function ty(){St=0}function is(){this._call=this._time=this._next=null}is.prototype=$c.prototype={constructor:is,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?or():+n)+(t==null?0:+t),!this._next&&nn!==this&&(nn?nn._next=this:os=this,nn=this),this._call=e,this._time=n,Eo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Eo())}};function $c(e,t,n){var s=new is;return s.restart(e,t,n),s}function ny(){or(),++$t;for(var e=os,t;e;)(t=St-e._time)>=0&&e._call.call(void 0,t),e=e._next;--$t}function Kr(){St=(rs=xn.now())+bs,$t=tn=0;try{ny()}finally{$t=0,oy(),St=0}}function sy(){var e=xn.now(),t=e-rs;t>Ac&&(bs-=t,rs=e)}function oy(){for(var e,t=os,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:os=n);nn=e,Eo(s)}function Eo(e){if(!$t){tn&&(tn=clearTimeout(tn));var t=e-St;t>24?(e<1/0&&(tn=setTimeout(Kr,e-xn.now()-bs)),Jt&&(Jt=clearInterval(Jt))):(Jt||(rs=xn.now(),Jt=setInterval(sy,Ac)),$t=1,Ic(Kr))}}function qr(e,t,n){var s=new is;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,n),s}var ry=Rs("start","end","cancel","interrupt"),iy=[],Dc=0,Ur=1,yo=2,Hn=3,Qr=4,jo=5,Zn=6;function ws(e,t,n,s,o,r){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;ly(e,n,{name:t,index:s,group:o,on:ry,tween:iy,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Dc})}function rr(e,t){var n=Ve(e,t);if(n.state>Dc)throw new Error("too late; already scheduled");return n}function Ge(e,t){var n=Ve(e,t);if(n.state>Hn)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 ly(e,t,n){var s=e.__transition,o;s[t]=n,n.timer=$c(r,0,n.time);function r(u){n.state=Ur,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!==Ur)return a();for(d in s)if(m=s[d],m.name===n.name){if(m.state===Hn)return qr(l);m.state===Qr?(m.state=Zn,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete s[d]):+d<t&&(m.state=Zn,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete s[d])}if(qr(function(){n.state===Hn&&(n.state=Qr,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=yo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===yo){for(n.state=Hn,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=jo,1),x=-1,p=o.length;++x<p;)o[x].call(e,d);n.state===jo&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Zn,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function Gn(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>yo&&s.state<jo,s.state=Zn,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}r&&delete e.__transition}}function cy(e){return this.each(function(){Gn(this,e)})}function ay(e,t){var n,s;return function(){var o=Ge(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 uy(e,t,n){var s,o;if(typeof n!="function")throw new Error;return function(){var r=Ge(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 dy(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?ay:uy)(n,e,t))}function ir(e,t,n){var s=e._id;return e.each(function(){var o=Ge(this,s);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Ve(o,s).value[t]}}function Oc(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 xy(e){return function(){this.removeAttribute(e)}}function fy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function py(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 my(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 hy(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 gy(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 Ey(e,t){var n=Cs(e),s=n==="transform"?ep:Oc;return this.attrTween(e,typeof t=="function"?(n.local?gy:hy)(n,s,ir(this,"attr."+e,t)):t==null?(n.local?fy:xy)(n):(n.local?my:py)(n,s,t))}function yy(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function jy(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Sy(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&jy(e,r)),n}return o._value=t,o}function Ry(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&yy(e,r)),n}return o._value=t,o}function Cy(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=Cs(e);return this.tween(n,(s.local?Sy:Ry)(s,t))}function by(e,t){return function(){rr(this,e).delay=+t.apply(this,arguments)}}function wy(e,t){return t=+t,function(){rr(this,e).delay=t}}function vy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?by:wy)(t,e)):Ve(this.node(),t).delay}function _y(e,t){return function(){Ge(this,e).duration=+t.apply(this,arguments)}}function ky(e,t){return t=+t,function(){Ge(this,e).duration=t}}function My(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_y:ky)(t,e)):Ve(this.node(),t).duration}function Py(e,t){if(typeof t!="function")throw new Error;return function(){Ge(this,e).ease=t}}function Ny(e){var t=this._id;return arguments.length?this.each(Py(t,e)):Ve(this.node(),t).ease}function Ly(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ge(this,e).ease=n}}function Ty(e){if(typeof e!="function")throw new Error;return this.each(Ly(this._id,e))}function Ay(e){typeof e!="function"&&(e=Sc(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 Qe(s,this._parents,this._name,this._id)}function Iy(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 Qe(l,this._parents,this._name,this._id)}function $y(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 Dy(e,t,n){var s,o,r=$y(t)?rr:Ge;return function(){var l=r(this,e),c=l.on;c!==s&&(o=(s=c).copy()).on(t,n),l.on=o}}function Oy(e,t){var n=this._id;return arguments.length<2?Ve(this.node(),n).on.on(e):this.each(Dy(n,e,t))}function zy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function By(){return this.on("end.remove",zy(this._id))}function Vy(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nr(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,ws(u[p],t,n,p,u,Ve(d,n)));return new Qe(r,this._parents,t,n)}function Fy(e){var t=this._name,n=this._id;typeof e!="function"&&(e=jc(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),y=0,b=p.length;y<b;++y)(m=p[y])&&ws(m,t,n,y,p,h);r.push(p),l.push(d)}return new Qe(r,l,t,n)}var Hy=Sn.prototype.constructor;function Zy(){return new Hy(this._groups,this._parents)}function Gy(e,t){var n,s,o;return function(){var r=It(this,e),l=(this.style.removeProperty(e),It(this,e));return r===l?null:r===n&&l===s?o:o=t(n=r,s=l)}}function zc(e){return function(){this.style.removeProperty(e)}}function Yy(e,t,n){var s,o=n+"",r;return function(){var l=It(this,e);return l===o?null:l===s?r:r=t(s=l,n)}}function Wy(e,t,n){var s,o,r;return function(){var l=It(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),It(this,e))),l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c))}}function Xy(e,t){var n,s,o,r="style."+t,l="end."+r,c;return function(){var a=Ge(this,e),u=a.on,d=a.value[r]==null?c||(c=zc(t)):void 0;(u!==n||o!==d)&&(s=(n=u).copy()).on(l,o=d),a.on=s}}function Ky(e,t,n){var s=(e+="")=="transform"?Jf:Oc;return t==null?this.styleTween(e,Gy(e,s)).on("end.style."+e,zc(e)):typeof t=="function"?this.styleTween(e,Wy(e,s,ir(this,"style."+e,t))).each(Xy(this._id,e)):this.styleTween(e,Yy(e,s,t),n).on("end.style."+e,null)}function qy(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function Uy(e,t,n){var s,o;function r(){var l=t.apply(this,arguments);return l!==o&&(s=(o=l)&&qy(e,l,n)),s}return r._value=t,r}function Qy(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,Uy(e,t,n??""))}function Jy(e){return function(){this.textContent=e}}function ej(e){return function(){var t=e(this);this.textContent=t??""}}function tj(e){return this.tween("text",typeof e=="function"?ej(ir(this,"text",e)):Jy(e==null?"":e+""))}function nj(e){return function(t){this.textContent=e.call(this,t)}}function sj(e){var t,n;function s(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&nj(o)),t}return s._value=e,s}function oj(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,sj(e))}function rj(){for(var e=this._name,t=this._id,n=Bc(),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);ws(a,e,n,u,l,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Qe(s,this._parents,e,n)}function ij(){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=Ge(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 lj=0;function Qe(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Bc(){return++lj}var Xe=Sn.prototype;Qe.prototype={constructor:Qe,select:Vy,selectAll:Fy,selectChild:Xe.selectChild,selectChildren:Xe.selectChildren,filter:Ay,merge:Iy,selection:Zy,transition:rj,call:Xe.call,nodes:Xe.nodes,node:Xe.node,size:Xe.size,empty:Xe.empty,each:Xe.each,on:Oy,attr:Ey,attrTween:Cy,style:Ky,styleTween:Qy,text:tj,textTween:oj,remove:By,tween:dy,delay:vy,duration:My,ease:Ny,easeVarying:Ty,end:ij,[Symbol.iterator]:Xe[Symbol.iterator]};function cj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var aj={time:null,delay:0,duration:250,ease:cj};function uj(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 dj(e){var t,n;e instanceof Qe?(t=e._id,e=e._name):(t=Bc(),(n=aj).time=or(),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])&&ws(a,e,t,u,l,n||uj(a,t));return new Qe(s,this._parents,e,t)}Sn.prototype.interrupt=cy;Sn.prototype.transition=dj;const Pn=e=>()=>e;function xj(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 Ke(e,t,n){this.k=e,this.x=t,this.y=n}Ke.prototype={constructor:Ke,scale:function(e){return e===1?this:new Ke(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ke(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 vs=new Ke(1,0,0);Vc.prototype=Ke.prototype;function Vc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return vs;return e.__zoom}function qs(e){e.stopImmediatePropagation()}function en(e){e.preventDefault(),e.stopImmediatePropagation()}function fj(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function pj(){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 Jr(){return this.__zoom||vs}function mj(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function hj(){return navigator.maxTouchPoints||"ontouchstart"in this}function gj(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 Fc(){var e=fj,t=pj,n=gj,s=mj,o=hj,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=op,u=Rs("start","zoom","end"),d,x,p,m=500,h=150,y=0,b=10;function R(C){C.property("__zoom",Jr).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",Jr),C!==P?w(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(vs.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 Ke(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 Ke(C.k,O,P)}function j(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function w(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,Q=typeof I=="function"?I.apply(P,z):I,J=a(K.invert(Y).concat(ee/K.k),Q.invert(Y).concat(ee/Q.k));return function(ne){if(ne===1)ne=Q;else{var W=J(ne),ie=ee/W[2];ne=new Ke(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 xj(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)],Gn(this),_.start()}en(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;Nc(C.view),qs(C),O.mouse=[z,this.__zoom.invert(z)],Gn(this),O.start();function Y(K){if(en(K),!O.moved){var Q=K.clientX-V,J=K.clientY-Z;O.moved=Q*Q+J*J>y}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),Lc(K.view,O.moved),en(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);en(C),c>0?Ae(this).transition().duration(c).call(w,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(qs(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)),Gn(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(en(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],Q=_.touch1[0],J=_.touch1[1],ne=(ne=Q[0]-ee[0])*ne+(ne=Q[1]-ee[1])*ne,W=(W=J[0]-K[0])*W+(W=J[1]-K[1])*W;V=k(V,Math.sqrt(ne/W)),Z=[(ee[0]+Q[0])/2,(ee[1]+Q[1])/2],Y=[(K[0]+J[0])/2,(K[1]+J[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(qs(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])<b)){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:Pn(+C),R):s},R.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Pn(!!C),R):e},R.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:Pn(!!C),R):o},R.extent=function(C){return arguments.length?(t=typeof C=="function"?C:Pn([[+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?(y=(C=+C)*C,R):Math.sqrt(y)},R.tapDistance=function(C){return arguments.length?(b=+C,R):b},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.`},fn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Hc=["Enter"," ","Escape"];var Rt;(function(e){e.Strict="strict",e.Loose="loose"})(Rt||(Rt={}));var Et;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Et||(Et={}));var Dt;(function(e){e.Partial="partial",e.Full="full"})(Dt||(Dt={}));const Zc={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 ls;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ls||(ls={}));var G;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(G||(G={}));const ei={[G.Left]:G.Right,[G.Right]:G.Left,[G.Top]:G.Bottom,[G.Bottom]:G.Top};function Gc(e){return e===null?null:e?"valid":"invalid"}const Yc=e=>"id"in e&&"source"in e&&"target"in e,Ej=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),lr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Rn=(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}},yj=(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):lr(o)?o:t.nodeLookup.get(o.id));const c=l?cs(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return _s(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ks(n)},Cn=(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=cs(s);n=_s(n,o)}}),ks(n)},Wc=(e,t,[n,s,o]=[0,0,1],r=!1,l=!1)=>{const c={...bn(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,y=pn(c,zt(u)),b=(m??0)*(h??0),R=r&&y>0;(!u.internals.handleBounds||R||y>=b||u.dragging)&&a.push(u)}return a},jj=(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 So(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 Ro({nodes:e,width:t,height:n,panZoom:s,minZoom:o,maxZoom:r},l){if(e.size===0)return Promise.resolve(!1);const c=Cn(e),a=cr(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 Xc({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&&Bt(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=Bt(x)?Ct(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 Sj({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(y=>y.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=jj(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 Ot=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ct=(e={x:0,y:0},t,n)=>({x:Ot(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ot(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Kc(e,t,n){const{width:s,height:o}=tt(n),{x:r,y:l}=n.internals.positionAbsolute;return Ct(e,[[r,l],[r+s,l+o]],t)}const ti=(e,t,n)=>e<t?Ot(Math.abs(e-t),1,t)/t:e>n?-Ot(Math.abs(e-n),1,t)/t:0,qc=(e,t,n=15,s=40)=>{const o=ti(e.x,s,t.width-s)*n,r=ti(e.y,s,t.height-s)*n;return[o,r]},_s=(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)}),Co=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),ks=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),zt=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=lr(e)?e.internals.positionAbsolute:Rn(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}},cs=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=lr(e)?e.internals.positionAbsolute:Rn(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)}},Uc=(e,t)=>ks(_s(Co(e),Co(t))),pn=(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)},ni=e=>Oe(e.width)&&Oe(e.height)&&Oe(e.x)&&Oe(e.y),Oe=e=>!isNaN(e)&&isFinite(e),as=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},Ms=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bn=({x:e,y:t},[n,s,o],r=!1,l=[1,1])=>{const c={x:(e-n)/o,y:(t-s)/o};return r?Ms(c,l):c},Qc=({x:e,y:t},[n,s,o])=>({x:e*o+n,y:t*o+s}),cr=(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=Ot(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}},us=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Bt(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 Jc(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 ea(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 on(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:o}){const{x:r,y:l}=qe(e),c=bn({x:r-((o==null?void 0:o.left)??0),y:l-((o==null?void 0:o.top)??0)},s),{x:a,y:u}=n?Ms(c,t):c;return{xSnapped:a,ySnapped:u,...c}}const Ps=e=>({width:e.offsetWidth,height:e.offsetHeight}),ta=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Rj=["INPUT","SELECT","TEXTAREA"];function bo(e){var s,o;const t=((o=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:o[0])||e.target;return Rj.includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const na=e=>"clientX"in e,qe=(e,t)=>{var r,l;const n=na(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)}},si=(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,...Ps(l)}})};function sa({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 Nn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function oi({pos:e,x1:t,y1:n,x2:s,y2:o,c:r}){switch(e){case G.Left:return[t-Nn(t-s,r),n];case G.Right:return[t+Nn(s-t,r),n];case G.Top:return[t,n-Nn(n-o,r)];case G.Bottom:return[t,n+Nn(o-n,r)]}}function oa({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:s,targetY:o,targetPosition:r=G.Top,curvature:l=.25}){const[c,a]=oi({pos:n,x1:e,y1:t,x2:s,y2:o,c:l}),[u,d]=oi({pos:r,x1:s,y1:o,x2:e,y2:t,c:l}),[x,p,m,h]=sa({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 ra({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 Cj({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 bj({sourceNode:e,targetNode:t,width:n,height:s,transform:o}){const r=_s(cs(e),cs(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 pn(l,ks(r))>0}const ia=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,wj=(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)),la=(e,t)=>{if(!e.source||!e.target)return as("006",Te.error006()),t;let n;return Yc(e)?n={...e}:n={...e,id:ia(e)},wj(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},vj=(e,t,n,s={shouldReplaceId:!0})=>{const{id:o,...r}=e;if(!t.source||!t.target)return as("006",Te.error006()),n;if(!n.find(a=>a.id===e.id))return as("007",Te.error007(o)),n;const c={...r,id:s.shouldReplaceId?ia(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==o).concat(c)};function ca({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[o,r,l,c]=ra({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,o,r,l,c]}const ri={[G.Left]:{x:-1,y:0},[G.Right]:{x:1,y:0},[G.Top]:{x:0,y:-1},[G.Bottom]:{x:0,y:1}},_j=({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},ii=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function kj({source:e,sourcePosition:t=G.Bottom,target:n,targetPosition:s=G.Top,center:o,offset:r}){const l=ri[t],c=ri[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=_j({source:a,sourcePosition:t,target:u}),x=d.x!==0?"x":"y",p=d[x];let m=[],h,y;const b={x:0,y:0},R={x:0,y:0},[k,S,j,w]=ra({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[x]*c[x]===-1){h=o.x??k,y=o.y??S;const v=[{x:h,y:a.y},{x:h,y:u.y}],N=[{x:a.x,y},{x:u.x,y}];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?b[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+b.x,y:a.y+b.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,y=m[0].y):(h=m[0].x,y=(L.y+T.y)/2)}return[[e,{x:a.x+b.x,y:a.y+b.y},...m,{x:u.x+R.x,y:u.y+R.y},n],h,y,j,w]}function Mj(e,t,n,s){const o=Math.min(ii(e,t)/2,ii(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 wo({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]=kj({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:o},targetPosition:r,center:{x:c,y:a},offset:u});return[d.reduce((b,R,k)=>{let S="";return k>0&&k<d.length-1?S=Mj(d[k-1],R,d[k+1],l):S=`${k===0?"M":"L"}${R.x} ${R.y}`,b+=S,b},""),x,p,m,h]}function li(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Pj(e){var x;const{sourceNode:t,targetNode:n}=e;if(!li(t)||!li(n))return null;const s=t.internals.handleBounds||ci(t.handles),o=n.internals.handleBounds||ci(n.handles),r=ai((s==null?void 0:s.source)??[],e.sourceHandle),l=ai(e.connectionMode===Rt.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=mn(t,r,c),d=mn(n,l,a);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:a}}function ci(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 mn(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 ai(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function vo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function Nj(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=vo(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 ar={nodeOrigin:[0,0],nodeExtent:fn,elevateNodesOnSelect:!0,defaults:{}},Lj={...ar,checkEquality:!0};function ur(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Tj(e,t,n){const s=ur(ar,n);for(const o of e.values())if(o.parentId)dr(o,e,t,s);else{const r=Rn(o,s.nodeOrigin),l=Bt(o.extent)?o.extent:s.nodeExtent,c=Ct(r,l,tt(o));o.internals.positionAbsolute=c}}function _o(e,t,n,s){var c,a;const o=ur(Lj,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=Rn(u,o.nodeOrigin),p=Bt(u.extent)?u.extent:o.nodeExtent,m=Ct(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:aa(u,l),userNode:u}},t.set(u.id,d)}u.parentId&&dr(d,t,n,s)}}function Aj(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 dr(e,t,n,s){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:l}=ur(ar,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}Aj(e,n);const u=o?1e3:0,{x:d,y:x,z:p}=Ij(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 aa(e,t){return(Oe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Ij(e,t,n,s,o){const{x:r,y:l}=t.internals.positionAbsolute,c=tt(e),a=Rn(e,n),u=Bt(e.extent)?Ct(a,e.extent,c):a;let d=Ct({x:r+u.x,y:l+u.y},s,c);e.extent==="parent"&&(d=Kc(d,c,t));const x=aa(e,o),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>x?p:x}}function xr(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)??zt(a),d=Uc(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,y=Math.max(x.width,Math.round(c.width)),b=Math.max(x.height,Math.round(c.height)),R=(y-x.width)*p[0],k=(b-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(w=>w.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:y+(m?p[0]*m-R:0),height:b+(h?p[1]*h-k:0)}})}),o}function $j(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=Ps(p.nodeElement),y=m.measured.width!==h.width||m.measured.height!==h.height;if(!!(h.width&&h.height&&(y||!m.internals.handleBounds||p.force))){const R=p.nodeElement.getBoundingClientRect(),k=Bt(m.extent)?m.extent:r;let{positionAbsolute:S}=m.internals;m.parentId&&m.extent==="parent"?S=Kc(S,h,t.get(m.parentId)):k&&(S=Ct(S,k,h)),m.measured=h,m.internals={...m.internals,positionAbsolute:S,handleBounds:{source:si("source",p.nodeElement,R,d,m.id),target:si("target",p.nodeElement,R,d,m.id)}},m.parentId&&dr(m,t,n,{nodeOrigin:o}),c=!0,y&&(a.push({id:m.id,type:"dimensions",dimensions:h}),m.expandParent&&m.parentId&&x.push({id:m.id,parentId:m.parentId,rect:zt(m,o)}))}}}if(x.length>0){const p=xr(x,t,n,o);a.push(...p)}return{changes:a,updatedInternals:c}}async function Dj({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 ua(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 da(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:da(n,t):!1}function ui(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 Oj(e,t,n,s){const o=new Map;for(const[r,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!da(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 Us({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 zj({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:b,handleSelector:R,domNode:k,isSelectable:S,nodeId:j,nodeClickDistance:w=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=Cn(c);ee=Co(K)}for(const[K,Q]of c){if(!B.has(K))continue;let J={x:T-Q.distance.x,y:D-Q.distance.y};_&&(J=Ms(J,I));let ne=[[C[0][0],C[0][1]],[C[1][0],C[1][1]]];if(c.size>1&&C&&!Q.extent){const{positionAbsolute:de}=Q.internals,ae=de.x-ee.x+C[0][0],te=de.x+Q.measured.width-ee.x2+C[1][0],X=de.y-ee.y+C[0][1],se=de.y+Q.measured.height-ee.y2+C[1][1];ne=[[ae,X],[te,se]]}const{position:W,positionAbsolute:ie}=Xc({nodeId:K,nextPosition:J,nodeLookup:B,nodeExtent:ne,nodeOrigin:O,onError:V});Y=Y||Q.position.x!==W.x||Q.position.y!==W.y,Q.position=W,Q.internals.positionAbsolute=ie}if(Y&&(Z(c,!0),$&&(s||P||!j&&z))){const[K,Q]=Us({nodeId:j,dragItems:c,nodeLookup:B});s==null||s($,c,K,Q),P==null||P($,K,Q),j||z==null||z($,Q)}}async function v(){if(!d)return;const{transform:T,panBy:D,autoPanSpeed:$}=t(),[B,C]=qc(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=on(T.sourceEvent,{transform:C,snapGrid:I,snapToGrid:_,containerBounds:d});if(r=Z,c=Oj(D,B,Z,j),c.size>0&&(n||P||!j&&z)){const[ee,K]=Us({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=Tc().clickDistance(w).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=on(T.sourceEvent,{transform:B,snapGrid:C,snapToGrid:I,containerBounds:d}),u=qe(T.sourceEvent,d)}).on("drag",T=>{const{autoPanOnNodeDrag:D,transform:$,snapGrid:B,snapToGrid:C,nodeDragThreshold:I,nodeLookup:_}=t(),O=on(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=qe(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,_]=Us({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&&(!b||!ui(D,`.${b}`,k))&&(!R||ui(D,R,k))});p.call(L)}function y(){p==null||p.on(".drag",null)}return{update:h,destroy:y}}function Bj(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())pn(o,zt(r))>0&&s.push(r);return s}const Vj=250;function Fj(e,t,n,s){var c,a;let o=[],r=1/0;const l=Bj(e,n,t+Vj);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}=mn(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 xa(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,...mn(l,a,a.position,!0)}:a}function fa(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Hj(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const pa=()=>!0;function Zj(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:y,onConnectEnd:b,isValidConnection:R=pa,onReconnectEnd:k,updateConnection:S,getTransform:j,getFromHandle:w,autoPanSpeed:M}){const v=ta(e.target);let N=0,L;const{x:T,y:D}=qe(e),$=v==null?void 0:v.elementFromPoint(T,D),B=fa(r,$),C=c==null?void 0:c.getBoundingClientRect();if(!C||!B)return;const I=xa(o,B,s,a,t);if(!I)return;let _=qe(e,C),O=!1,P=null,z=!1,V=null;function Z(){if(!d||!C)return;const[ie,de]=qc(_,C,M);p({x:ie,y:de}),N=requestAnimationFrame(Z)}const Y={...I,nodeId:o,type:B,position:I.position},ee=a.get(o),Q={inProgress:!0,isValid:null,from:mn(ee,Y,G.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:ee,to:_,toHandle:null,toPosition:ei[Y.position],toNode:null};S(Q);let J=Q;h==null||h(e,{nodeId:o,handleId:s,handleType:B});function ne(ie){if(!w()||!Y){W(ie);return}const de=j();_=qe(ie,C),L=Fj(bn(_,de,!1,[1,1]),n,a,Y),O||(Z(),O=!0);const ae=ma(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=Hj(!!L,ae.isValid);const te={...J,isValid:z,to:L&&z?Qc({x:L.x,y:L.y},de):_,toHandle:ae.toHandle,toPosition:z&&ae.toHandle?ae.toHandle.position:ei[Y.position],toNode:ae.toHandle?a.get(ae.toHandle.nodeId):null};z&&L&&J.toHandle&&te.toHandle&&J.toHandle.type===te.toHandle.type&&J.toHandle.nodeId===te.toHandle.nodeId&&J.toHandle.id===te.toHandle.id&&J.to.x===te.to.x&&J.to.y===te.to.y||(S(te),J=te)}function W(ie){(L||V)&&P&&z&&(y==null||y(P));const{inProgress:de,...ae}=J,te={...ae,toPosition:J.toHandle?J.toPosition:null};b==null||b(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 ma(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:r,doc:l,lib:c,flowId:a,isValidConnection:u=pa,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}=qe(e),y=l.elementFromPoint(m,h),b=y!=null&&y.classList.contains(`${c}-flow__handle`)?y:p,R={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const k=fa(void 0,b),S=b.getAttribute("data-nodeid"),j=b.getAttribute("data-handleid"),w=b.classList.contains("connectable"),M=b.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=w&&M&&(n===Rt.Strict?x&&k==="source"||!x&&k==="target":S!==s||j!==o);R.isValid=L&&u(v),R.toHandle=xa(S,k,j,d,n,!1)}return R}const ko={onPointerDown:Zj,isValid:ma};function Gj({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 w=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*d,M=j[2]*Math.pow(2,w);t.scaleTo(M)};let y=[0,0];const b=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(y=[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 w=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],M=[w[0]-y[0],w[1]-y[1]];y=w;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=Fc().on("start",b).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 Yj=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ns=e=>({x:e.x,y:e.y,zoom:e.k}),Qs=({x:e,y:t,zoom:n})=>vs.translate(e,t).scale(n),Pt=(e,t)=>e.target.closest(`.${t}`),ha=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Js=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},ga=e=>{const t=e.ctrlKey&&us()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Wj({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:r,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:u}){return d=>{if(Pt(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const x=n.property("__zoom").k||1;if(d.ctrlKey&&l){const b=De(d),R=ga(d),k=x*Math.pow(2,R);s.scaleTo(n,k,b,d);return}const p=d.deltaMode===1?20:1;let m=o===Et.Vertical?0:d.deltaX*p,h=o===Et.Horizontal?0:d.deltaY*p;!us()&&d.shiftKey&&o!==Et.Vertical&&(m=d.deltaY*p,h=0),s.translateBy(n,-(m/x)*r,-(h/x)*r,{internal:!0});const y=Ns(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(d,y)),e.isPanScrolling&&(a==null||a(d,y),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,y),e.isPanScrolling=!1},150))}}function Xj({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,o){if(!t&&s.type==="wheel"&&!s.ctrlKey||Pt(s,e))return null;s.preventDefault(),n.call(this,s,o)}}function Kj({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var r,l,c;if((r=s.sourceEvent)!=null&&r.internal)return;const o=Ns(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 qj({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:o}){return r=>{var l,c;e.usedRightMouseButton=!!(n&&ha(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,Ns(r.transform)))}}function Uj({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&&ha(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&r(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),o&&Yj(e.prevViewport,l.transform))){const a=Ns(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(l.sourceEvent,a)},n?150:0)}}}function Qj({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"&&(Pt(d,`${u}-flow__node`)||Pt(d,`${u}-flow__edge`)))return!0;if(!s&&!x&&!o&&!r&&!n||l||Pt(d,c)&&d.type==="wheel"||Pt(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 Jj({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=Fc().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:Ot(r.zoom,t,n)},[[0,0],[x.width,x.height]],o);const h=m.on("wheel.zoom"),y=m.on("dblclick.zoom");p.wheelDelta(ga);function b($,B){return m?new Promise(C=>{p==null||p.transform(Js(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:Q,onTransformChange:J}){I&&!d.isZoomingOrPanning&&k();const W=_&&!K&&!I?Wj({zoomPanValues:d,noWheelClassName:$,d3Selection:m,d3Zoom:p,panOnScrollMode:P,panOnScrollSpeed:z,zoomOnPinch:Z,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):Xj({noWheelClassName:$,preventScrolling:V,d3ZoomHandler:h});if(m.on("wheel.zoom",W,{passive:!1}),!I){const de=Kj({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:c});p.on("start",de);const ae=qj({zoomPanValues:d,panOnDrag:O,onPaneContextMenu:!!C,onPanZoom:l,onTransformChange:J});p.on("zoom",ae);const te=Uj({zoomPanValues:d,panOnDrag:O,panOnScroll:_,onPaneContextMenu:C,onPanZoomEnd:a,onDraggingChange:u});p.on("end",te)}const ie=Qj({zoomActivationKeyPressed:K,panOnDrag:O,zoomOnScroll:Y,panOnScroll:_,zoomOnDoubleClick:ee,zoomOnPinch:Z,userSelectionActive:I,noPanClassName:B,noWheelClassName:$,lib:Q});p.filter(ie),ee?m.on("dblclick.zoom",y):m.on("dblclick.zoom",null)}function k(){p.on("zoom",null)}async function S($,B,C){const I=Qs($),_=p==null?void 0:p.constrain()(I,B,C);return _&&await b(_),new Promise(O=>O(_))}async function j($,B){const C=Qs($);return await b(C,B),new Promise(I=>I(C))}function w($){if(m){const B=Qs($),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?Vc(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(Js(m,B==null?void 0:B.duration,()=>C(!0)),$)}):Promise.resolve(!1)}function N($,B){return m?new Promise(C=>{p==null||p.scaleBy(Js(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:w,setClickDistance:D}}var rn;(function(e){e.Line="line",e.Handle="handle"})(rn||(rn={}));function eS({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 tS(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 Ln(e,t,n){return Math.max(0,t-e,e-n)}function di(e,t){return e?!t:t}function nS(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:y,maxWidth:b,minHeight:R,maxHeight:k}=s,{x:S,y:j,width:w,height:M,aspectRatio:v}=e;let N=Math.floor(d?m-e.pointerX:0),L=Math.floor(x?h-e.pointerY:0);const T=w+(a?-N:N),D=M+(u?-L:L),$=-r[0]*w,B=-r[1]*M;let C=Ln(T,y,b),I=Ln(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=Ln(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=Ln(D*v,y,b)/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=(di(a,u)?-N:N)/v:N=(di(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:w+(a?-N:N),height:M+(u?-L:L),x:r[0]*N*(a?-1:1)+_,y:r[1]*L*(u?-1:1)+O}}const Ea={width:0,height:0,x:0,y:0},sS={...Ea,pointerX:0,pointerY:0,aspectRatio:1};function oS(e){return[[0,0],[e.measured.width,e.measured.height]]}function rS(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 iS({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 y={...Ea},b={...sS};const R=tS(a);let k,S=null,j=[],w,M,v;const N=Tc().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}=on(L.sourceEvent,{transform:D,snapGrid:$,snapToGrid:B,containerBounds:S});y={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},b={...y,pointerX:_,pointerY:O,aspectRatio:y.width/y.height},w=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(w=T.get(k.parentId),M=w&&k.extent==="parent"?oS(w):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=rS(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,{...y})}).on("drag",L=>{const{transform:T,snapGrid:D,snapToGrid:$,nodeOrigin:B}=n(),C=on(L.sourceEvent,{transform:T,snapGrid:D,snapToGrid:$,containerBounds:S}),I=[];if(!k)return;const{x:_,y:O,width:P,height:z}=y,V={},Z=k.origin??B,{width:Y,height:ee,x:K,y:Q}=nS(b,R,C,u,d,Z,M,v),J=Y!==P,ne=ee!==z,W=K!==_&&J,ie=Q!==O&≠if(!W&&!ie&&!J&&!ne)return;if((W||ie||Z[0]===1||Z[1]===1)&&(V.x=W?K:y.x,V.y=ie?Q:y.y,y.x=V.x,y.y=V.y,j.length>0)){const X=K-_,se=Q-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((J||ne)&&(V.width=J?Y:y.width,V.height=ne?ee:y.height,y.width=V.width,y.height=V.height),w&&k.expandParent){const X=Z[0]*(V.width??0);V.x&&V.x<X&&(y.x=X,b.x=b.x-(V.x-X));const se=Z[1]*(V.height??0);V.y&&V.y<se&&(y.y=se,b.y=b.y-(V.y-se))}const de=eS({width:y.width,prevWidth:P,height:y.height,prevHeight:z,affectsX:R.affectsX,affectsY:R.affectsY}),ae={...y,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,{...y}),o==null||o()});r.call(N)}function c(){r.on(".drag",null)}return{update:l,destroy:c}}var Mo={exports:{}},eo={},Tn={exports:{}},to={};/**
|
|
1
|
+
"use strict";var ff=Object.defineProperty;var pf=(e,t,n)=>t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>pf(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-Cek9Ww4S.cjs"),g=require("react"),E=require("./Toggle-DrfPMqBr.cjs"),f=require("./css-BghghSL0.cjs"),$n=require("./external-k9_z2UE6.cjs"),H=require("./aggregator-y-jNJhKX.cjs"),U=require("./Pack-Dvf8sQVK.cjs"),mf=require("./external-Dk1cXh1i.cjs"),je=require("./external-Bwu7ljGW.cjs"),hf=require("./external-1M4_dCzb.cjs"),Zi=require("./Animated-B3meZ8Go.cjs"),A=require("./LinePlot-DbXPZbQH.cjs"),re=require("zod"),Re=require("./external-DOQ51UTh.cjs"),gf=require("./Text-Bq9B_1wQ.cjs"),Gi=require("./external-bMSKTtt-.cjs");require("./Item-DsAGorI8.cjs");const Lo=require("react-dom"),Vt=require("./external-BFHPc8Ng.cjs"),Ef=require("./external-8wTAbTHd.cjs"),Yi=require("./units-9h1yAbxY.cjs"),Pe=require("./external-CxBbtPtX.cjs"),yf=require("./external-BEwtU2Lv.cjs"),jf=require("./external-DaWss0D_.cjs"),Sf=require("./external-Brk-4hys.cjs"),Rf=require("./Video-CGe5Hscl.cjs"),Cf=(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},Wi=({variant:e="info",...t})=>i.jsxRuntimeExports.jsx(E.e4.Circle,{color:E.variantColors[e],...t}),bf=({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(U.Space,{className:f.CSS(f.CSS.B("notification"),a),direction:"y",empty:!0,...d,children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(Wi,{style:{height:"2.25rem",width:"2.5rem"},variant:r}),i.jsxRuntimeExports.jsx(E.Text,{level:"small",shade:7,children:`x${n}`}),i.jsxRuntimeExports.jsx(E.DateTime,{className:f.CSS(f.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),i.jsxRuntimeExports.jsx(E.Icon,{className:f.CSS(f.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:i.jsxRuntimeExports.jsx(E.e4.Close,{})})]}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",align:"start",className:f.CSS(f.CSS.BE("notification","content")),size:"small",children:[u??i.jsxRuntimeExports.jsx(E.Text,{className:f.CSS(f.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),o!=null&&i.jsxRuntimeExports.jsx(E.Text,{className:f.CSS(f.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),c!=null&&i.jsxRuntimeExports.jsx(U.Space,{direction:"x",align:"center",justify:"end",className:f.CSS(f.CSS.BE("notification","actions")),children:H.A(c).map(x=>i.jsxRuntimeExports.jsx(wf,{action:x},x.key))})]},t.toString()),wf=({action:e})=>{if(!g.isValidElement(e)){const t=e;return i.jsxRuntimeExports.jsx(E.Button,{...t})}return e},vf=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:E.Aggregator,Circle:Wi,Notification:bf,Text:E.Text$2,VARIANTS:H.VARIANTS,specZ:H.specZ$1,useAggregator:E.useAggregator,useContext:E.useContext$3,useNotifications:E.useNotifications,variantZ:H.variantZ},Symbol.toStringTag,{value:"Module"})),_f=Object.freeze(Object.defineProperty({__proto__:null,Config:E.Config,Context:E.Context,Dialog:E.Dialog$1,chooseLocation:E.chooseLocation,formatTip:E.formatTip,useConfig:E.useConfig,wrap:E.wrap},Symbol.toStringTag,{value:"Module"})),Gn=e=>e.preventDefault(),ds=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:Gn,onDragEnd:Gn})]})});ds.displayName="Resize.Core";const To=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:o="x"})=>{const r=g.useRef(null),[l,c]=g.useState({sizeDistribution:kf(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(y=>Zs(y,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=C=>a(p,C[m]),y=()=>{c(C=>({...C,root:null})),document.removeEventListener("mousemove",h)};c(C=>({...C,root:x[m]})),document.addEventListener("mousemove",h),document.addEventListener("mouseup",y,{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}}},xs=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=Mf(n),i.jsxRuntimeExports.jsx(U.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(ds,{onDragStart:x=>s(x,d),location:f.g.location(c),size:n[d]*100,sizeUnits:"%",showHandle:d!==a.length-1,children:u},d))})});xs.displayName="Resize.Multiple";const kf=(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)},Hs=.001,Mf=e=>e.every(t=>f.W.closeTo(t,1/e.length),Hs)?e.map((t,n)=>n%2===0?t+Hs:n===e.length-1?t:t-Hs):e,Zs=(e,t,n,s,o,r)=>{const l=Xi(e,t,n,o,r),[c,a]=Pf(e.sizeDistribution,n,l,s/t),u=a?o??null:e.root;return{...e,sizeDistribution:c,root:u}},Xi=(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},Pf=(e,t,n,s)=>{let o=t;for(;o>0&&e[o]+n<=s;)o--;const r=e[o]+n,l=Nf(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]},Nf=(e,t,n,s)=>(e===t.length-1?Tf:Lf)(e,t,n,s),Lf=(e,t,n,s)=>{let o=e+1;for(;o<t.length-1&&t[o]-s<=n;)o++;return o},Tf=(e,t,n,s)=>{let o=e-1;for(;o>0&&t[o]-s<=n;)o--;return o},Gs=2,Ki=({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))),w=x.current+j,M=f.Y(w,s,o);return(M-w)/s>l?Gs:M},[p,s,o,l]),h=g.useRef(null),y=g.useCallback(S=>{const j=m(S);d(j),h.current!=null&&(t==null||t(j,f.Eo.construct(h.current)))},[t,m]),C=g.useCallback(()=>d(S=>(x.current=S,S)),[d]),R=g.useCallback(S=>m(S)===Gs&&(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=E.useCursorDrag({onMove:y,onStart:C,onEnd:R});return i.jsxRuntimeExports.jsx(ds,{ref:h,location:p,size:u,onDragStart:k,className:f.clsx(c,f.CSS.expanded(u!==Gs)),...a})},Af=Object.freeze(Object.defineProperty({__proto__:null,Core:ds,Multiple:xs,Single:Ki,calculateDiffPercentage:Xi,useMultiple:To},Symbol.toStringTag,{value:"Module"})),Dn="y",_r=28,If=32,$f=40,Df=.5,Of=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:o,...r}}=To({direction:Dn,count:e.length,minSize:_r}),l=c=>{if(o.current==null)return;const a=f.Eo.dim(f.Eo.construct(o.current),Dn);s[c]<$f/a?n(c,e[c].initialSize??Df):n(c,_r+1)};return i.jsxRuntimeExports.jsx(xs,{empty:!0,className:f.CSS.B("accordion"),sizeDistribution:s,ref:o,...t,...r,children:e.map((c,a)=>g.createElement(Vf,{...c,key:c.key,index:a,direction:Dn,onExpand:l,parent:o,size:s[a]}))})},zf=i.jsxRuntimeExports.jsx(E.e4.Caret.Down,{"aria-label":"contract"}),Bf=i.jsxRuntimeExports.jsx(E.e4.Caret.Right,{"aria-label":"expand"}),Vf=({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),Dn);c=o*u>If}const a=c?zf:Bf;return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs($n.Header,{level:"p",className:f.CSS.expanded(c),empty:!0,children:[i.jsxRuntimeExports.jsx($n.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&i.jsxRuntimeExports.jsx($n.Actions,{children:s})]}),n]})},Ff=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Of},Symbol.toStringTag,{value:"Module"})),Hf=(e,t)=>H.A(e).map(s=>typeof s=="string"?s.split(t).map(o=>({label:o})):s).flat(),qi=({segments:e,shade:t,level:n,weight:s,separator:o,transform:r})=>{let c=Hf(e,o);return r!=null&&(c=c.map(r)),c.map((a,u)=>{const d=[i.jsxRuntimeExports.jsx(E.e4.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:f.CSS.shade(t)}},`${a}-${u}`)];if(a.icon!=null){const x=je.resolve(a.icon);x!=null&&d.push(x)}return d.push(i.jsxRuntimeExports.jsx(E.Text,{style:{marginLeft:a.icon!=null?"0.5rem":"0"},weight:s,shade:t,level:n,...a,children:a.label},a.label)),d}).flat()},Zf=({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=qi({segments:e,separator:c,shade:n,level:l,weight:s});return u&&x.shift(),i.jsxRuntimeExports.jsxs(E.WithIcon,{className:f.CSS(a,f.CSS.B("breadcrumb")),level:l,shade:n,weight:s,size:o,direction:"x",...d,children:[je.resolve(t),...x]})},Gf=({url:e,className:t,level:n="p",separator:s="/",weight:o,shade:r=7})=>{const l=qi({segments:e,separator:s,shade:r,level:n,weight:o,transform:c=>({...c,label:c.label.split("-").map(a=>f._$1.capitalize(a)).join(" ")})});return i.jsxRuntimeExports.jsx(U.Space,{className:f.CSS(t,f.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:l})},Yf=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Zf,URL:Gf},Symbol.toStringTag,{value:"Module"})),Ao=g.createContext(A.ZERO_CONTEXT_VALUE),Be=()=>g.useContext(Ao).synnax,Wf=()=>g.useContext(Ao).state,kr={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Ui="serverVersionMismatch",Xf=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Qi=E.wrap$1(A.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[s,o,r]=E.useCombinedStateAndRef(A.ZERO_CONTEXT_VALUE),[{path:l},,c]=E.use$3({aetherKey:e,type:A.Provider.TYPE,schema:A.Provider.stateZ,initialState:{props:t??null,state:null}}),a=E.useAggregator(),u=g.useCallback(d=>{r.current.state.status!==d.status&&a({variant:kr[d.status],message:d.message??f._$1.capitalize(d.status)}),o(x=>({...x,state:d}))},[a]);return E.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:kr[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=Xf(p,x.clientVersion,x.nodeVersion);a({variant:"warning",message:"Incompatible cluster version",description:m,data:{type:Ui,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(Ao.Provider,{value:s,children:i.jsxRuntimeExports.jsx(E.Composite,{path:l,children:n})})}),Kf=Object.freeze(Object.defineProperty({__proto__:null,Provider:Qi,SERVER_VERSION_MISMATCH:Ui,use:Be,useConnectionState:Wf},Symbol.toStringTag,{value:"Module"})),Ft=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),Ji=()=>g.useContext(Ft),el=e=>{const{aliases:t}=g.useContext(Ft);return t[e]??null},fs=()=>{const{aliases:e}=g.useContext(Ft);return e},ps=(e,t="")=>{const{getName:n}=g.useContext(Ft),[s,o]=g.useState(t);return E.useAsyncEffect(async()=>{const r=await n(e);r!=null&&o(r)},[e,n]),s??t},Io=()=>{const{activeRange:e}=g.useContext(Ft);return e??void 0},tl=({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 E.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(Ft.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},qf=({channelKey:e,value:t,shadow:n,className:s,...o})=>{const[r,l]=g.useState(!1),{setAlias:c}=Ji(),a=el(e),u=ps(e);let d=i.jsxRuntimeExports.jsx(E.e4.Rename,{});r?d=i.jsxRuntimeExports.jsx(E.e4.Loading,{}):a===t&&(d=i.jsxRuntimeExports.jsx(E.e4.Check,{}));const x=c!=null&&!r&&a!==t&&e!==0,p=()=>{x&&(async()=>(l(!0),await c(e,t),l(!1)))()},m=()=>{var y;a!=null&&((y=o.onChange)==null||y.call(o,a))},h=()=>e===0?i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Alias synced with this label"}):i.jsxRuntimeExports.jsxs(E.Text,{level:"small",children:["Sync alias for ",u," with this label"]});return i.jsxRuntimeExports.jsxs(E.Text$1,{value:t,...o,children:[x&&i.jsxRuntimeExports.jsx(E.Icon,{onClick:m,tooltip:i.jsxRuntimeExports.jsxs(E.Text,{level:"small",children:["Set ",u," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:i.jsxRuntimeExports.jsx(E.e4.Sync,{})}),i.jsxRuntimeExports.jsx(E.Icon,{onClick:p,disabled:!x,tooltip:i.jsxRuntimeExports.jsx(h,{}),tooltipLocation:{y:"top"},variant:"outlined",children:d})]})},He="channel";var Mr=180/Math.PI,lo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nl(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)*Mr,skewX:Math.atan(a)*Mr,scaleX:l,scaleY:c}}var _n;function Uf(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?lo:nl(t.a,t.b,t.c,t.d,t.e,t.f)}function Qf(e){return e==null||(_n||(_n=document.createElementNS("http://www.w3.org/2000/svg","g")),_n.setAttribute("transform",e),!(e=_n.transform.baseVal.consolidate()))?lo:(e=e.matrix,nl(e.a,e.b,e.c,e.d,e.e,e.f))}function sl(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 y=m.push("translate(",null,t,null,n);h.push({i:y-4,x:A.interpolateNumber(u,x)},{i:y-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 y=m.push(o(m)+"scale(",null,",",null,")");h.push({i:y-4,x:A.interpolateNumber(u,x)},{i:y-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,y=p.length,C;++h<y;)x[(C=p[h]).i]=C.x(m);return x.join("")}}}var Jf=sl(Uf,"px, ","px)","deg)"),ep=sl(Qf,", ",")",")"),tp=1e-12;function Pr(e){return((e=Math.exp(e))+1/e)/2}function np(e){return((e=Math.exp(e))-1/e)/2}function sp(e){return((e=Math.exp(2*e))-1)/(e+1)}const op=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,y=m*m+h*h,C,R;if(y<tp)R=Math.log(p/u)/t,C=function(v){return[c+v*m,a+v*h,u*Math.exp(t*v*R)]};else{var k=Math.sqrt(y),S=(p*p-u*u+s*y)/(2*u*n*k),j=(p*p-u*u-s*y)/(2*p*n*k),w=Math.log(Math.sqrt(S*S+1)-S),M=Math.log(Math.sqrt(j*j+1)-j);R=(M-w)/t,C=function(v){var N=v*R,L=Pr(w),T=u/(n*k)*(L*sp(t*N+w)-np(w));return[c+T*m,a+T*h,u*L/Pr(t*N+w)]}}return C.duration=R*1e3*t/Math.SQRT2,C}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),rp=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"})),ip=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"})),lp={region:f.Eo.ZERO,dpr:1,os:H.w.getOS()},cp={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},ap=E.wrap$1(A.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:s,...o})=>{const[{path:r},{bootstrapped:l,dpr:c},a]=E.use$3({aetherKey:n,type:A.Canvas$1.TYPE,schema:A.canvasStateZ,initialState:lp}),u=g.useRef({...cp}),d=g.useRef(!1),x=g.useCallback(C=>{u.current.bootstrapped&&(a(()=>({bootstrapped:!0,region:C,dpr:window.devicePixelRatio,os:H.w.getOS({default:"Windows"})})),d.current=!0)},[a]),p=g.useRef(null),m=E.useResize(x,{debounce:t}),h=E.useCombinedRefs(p,m);g.useEffect(()=>{const C=()=>{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",C,{once:!0})},[c]),g.useEffect(()=>{const C=()=>{!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",C),window.addEventListener("blur",C)},[a]);const y=g.useCallback(C=>{if(C==null)return;C.className.includes("gl")?u.current.gl=C:C.className.includes("upper2d")?u.current.upper2d=C:u.current.lower2d=C;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 w=R.transferControlToOffscreen(),M=S.transferControlToOffscreen(),v=k.transferControlToOffscreen();a({glCanvas:w,upper2dCanvas:M,lower2dCanvas:v,bootstrap:!0,bootstrapped:!1,region:f.Eo.construct(R),dpr:window.devicePixelRatio,os:H.w.getOS({default:"Windows"})},[w,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:y,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","lower2d"))}),i.jsxRuntimeExports.jsx("canvas",{ref:y,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","gl"))}),i.jsxRuntimeExports.jsx("canvas",{ref:y,className:f.CSS(f.CSS.B("canvas"),f.CSS.BM("canvas","upper2d"))}),i.jsxRuntimeExports.jsx(E.Composite,{path:r,children:l&&e})]})}),En=(e,t)=>E.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),up=Object.freeze(Object.defineProperty({__proto__:null,Canvas:ap,useRegion:En},Symbol.toStringTag,{value:"Module"})),ol=g.createContext(null),Ue=e=>{const t=g.useContext(ol);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},rl=e=>{const t=Ue("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},yn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=Ue(t),{key:o}=e;return E.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}`}},il=E.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=E.useMemoDeepEqualProps({clearOverScan:s,hold:r,visible:c}),[{path:p},{grid:m},h]=E.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 y=g.useRef(new Map),C=g.useCallback(D=>(y.current.set(D,null),()=>y.current.delete(D)),[y]),R=g.useCallback(D=>{const{mode:$,box:B,stage:b}=D;($==="pan"&&b!=="start"||$==="zoom"||$==="zoomReset"&&b==="start")&&h(I=>({...I,viewport:B})),y.current.forEach((I,_)=>_(D))},[h]),k=g.useCallback(D=>h($=>({...$,container:D})),[h]),S=En(k,{debounce:n}),j=g.useCallback(D=>h($=>({...$,grid:{...$.grid,[D.key]:D}})),[h]),w=g.useCallback(D=>h($=>{const{[D]:B,...b}=$.grid;return{...$,grid:b}}),[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(()=>dp(m),[m]),L=g.useCallback(D=>{h($=>({...$,hold:D})),l==null||l(D)},[h,l]),T=g.useMemo(()=>({lines:u,setGridEntry:j,removeGridEntry:w,setLine:M,removeLine:v,setViewport:R,addViewportHandler:C,setHold:L}),[u,j,w,M,v,R,C,L]);return i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("line-plot"),style:{...t,...N},ref:S,...a,children:i.jsxRuntimeExports.jsx(ol.Provider,{value:T,children:i.jsxRuntimeExports.jsx(E.Composite,{path:p,children:o})})})}),dp=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()},$o=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?A.XAxis.TYPE:A.YAxis.TYPE,s=`${e}-axis`;return E.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:y,className:C,tickSpacing:R,autoBounds:k,autoBoundUpdateInterval:S,onAutoBoundsChange:j,style:w,...M})=>{const v=((c==null?void 0:c.length)??0)>0,N=E.useMemoDeepEqualProps({location:l,showGrid:m,type:h,bounds:y,label:c,labelDirection:u,tickSpacing:R,autoBounds:k,autoBoundUpdateInterval:S}),[{path:L},{size:T,labelSize:D,...$},B]=E.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&&(y==null?void 0:y.lower)!==$.bounds.lower||P&&(y==null?void 0:y.upper)!==$.bounds.upper)&&(j==null||j($.bounds))},[$.autoBounds,$.bounds]);const b=yn({loc:l,key:`${n}-${o}`,size:T+D,order:1},`${e.toUpperCase()}Axis`),I=E.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(U.Space,{className:f.CSS(C,f.CSS.B("axis"),f.CSS.B(s),f.CSS.loc(l)),style:{...w,...b},align:"center",justify:l!=="left"?"end":"start",direction:f.g.swap(e),...M,children:v&&i.jsxRuntimeExports.jsx(E.MaybeEditable,{className:f.CSS(f.CSS.BE("axis","label"),f.CSS.dir(u)),value:c,onChange:d,level:a})}),i.jsxRuntimeExports.jsx(E.Composite,{path:L,children:r})]})})},ll=$o("x"),cl=$o("y"),al=f.G.xy.extend({root:f.K.corner,units:re.z.object({x:re.z.enum(["px","decimal"]),y:re.z.enum(["px","decimal"])})}),xp=al.partial({root:!0,units:!0}),fp=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},pp=(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},ul=(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)}},Nr=f.Eo.reRoot(f.Eo.DECIMAL,f.K.TOP_LEFT),Do=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=E.useSyncedRef(o===!1),d=g.useRef(null);l!==null&&(s={...s,...fp(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),y=f.b.XY.scale(h).scale(Nr),C=y.box(f.Eo.construct(d.current)),R=f.b.XY.clamp(f.Eo.construct(f.Eo.topLeft(Nr),{width:1-f.Eo.width(C),height:1-f.Eo.height(C)})),k=f.G.translate(f.G.construct(a.current),f.Eo.signedDims(y.box(m))),S=R.pos(k);return ul(S,d)},[]),p=E.useCursorDrag({onStart:g.useCallback(()=>{a.current=pp(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(U.Space,{className:f.CSS(e,f.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:p,draggable:o,ref:d,...r,onDrag:Gn,onDragEnd:Gn,empty:!0})});Do.displayName="Legend.Container";const Oo=(e,t,n)=>e.sort((s,o)=>s.label.localeCompare(o.label)).map(({key:s,color:o,label:r})=>i.jsxRuntimeExports.jsxs(U.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(E.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(E.MaybeEditable,{level:"small",value:r,onChange:l=>t==null?void 0:t({key:s,color:o,label:l}),noWrap:!0})]},s)),zo=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...o})=>{const[r,l]=g.useState(!1);return e.length===0?null:i.jsxRuntimeExports.jsx(Do,{...o,draggable:!r,value:n,onChange:s,children:Oo(e,t,l)})},mp=Object.freeze(Object.defineProperty({__proto__:null,Container:Do,Simple:zo,calcStickyPos:ul,completeStickyXYz:al,legendSwatches:Oo,stickyXYz:xp},Symbol.toStringTag,{value:"Module"})),dl=({className:e,style:t,onLineChange:n,...s})=>{const{lines:o}=Ue("Legend");return Ue("Legend"),i.jsxRuntimeExports.jsx(zo,{data:o,onEntryChange:n,...s})},hp=({onLineChange:e})=>{const{lines:t}=Ue("Legend"),n=E.useUniqueKey(),s=yn({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return i.jsxRuntimeExports.jsx(U.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:Oo(t,e)})},xl=({variant:e="floating",...t})=>e==="floating"?i.jsxRuntimeExports.jsx(dl,{...t}):i.jsxRuntimeExports.jsx(hp,{...t}),fl=E.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=E.use$3({aetherKey:e,type:A.Line.TYPE,schema:A.stateZ,initialState:t}),s=E.useMemoDeepEqualProps(t);return g.useLayoutEffect(()=>n(s),[s]),null}),gp=Object.freeze(Object.defineProperty({__proto__:null,Line:fl},Symbol.toStringTag,{value:"Module"})),Bo=E.wrap$1("Line",({aetherKey:e,color:t,label:n="",...s})=>{const{setLine:o,removeLine:r}=Ue("Line");return g.useEffect(()=>(o({key:e,color:t,label:n}),()=>r(e)),[n,t]),i.jsxRuntimeExports.jsx(fl,{aetherKey:e,color:t,label:n,...s})}),pl=({level:e="h2",...t})=>{const n=E.useUniqueKey(),s=E.useTypography(e),o=yn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return i.jsxRuntimeExports.jsx(U.Space,{justify:"center",align:"center",style:o,children:i.jsxRuntimeExports.jsx(E.MaybeEditable,{...t,level:e})})},ml=E.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=E.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})}),Ep=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:ml},Symbol.toStringTag,{value:"Module"})),yp={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Vo=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:yp[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]}));Vo.displayName="ZoomPanMask";const jp=[{key:"start",icon:i.jsxRuntimeExports.jsx(E.e4.TextAlign.Left,{})},{key:"center",icon:i.jsxRuntimeExports.jsx(E.e4.TextAlign.Center,{})},{key:"end",icon:i.jsxRuntimeExports.jsx(E.e4.TextAlign.Right,{})}],Sp=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(E.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),ms=({children:e=Sp,...t})=>i.jsxRuntimeExports.jsx(Re.Button,{...t,allowMultiple:!1,data:jp,children:e}),Rp=new Set([H.g.UUID,H.g.JSON]),Cp=H.g.ALL.filter(e=>e!==H.g.UNKNOWN).map(e=>({key:e.toString(),name:Rp.has(e)?e.toString().toUpperCase():f._$1.capitalize(e.toString())})),bp=[{key:"name",name:"Name"}],wp=e=>i.jsxRuntimeExports.jsx(Re.DropdownButton,{...e,data:Cp,columns:bp,entryRenderKey:"name"}),vp=[{key:"x",icon:i.jsxRuntimeExports.jsx(E.e4.Arrow.Right,{})},{key:"y",icon:i.jsxRuntimeExports.jsx(E.e4.Arrow.Up,{})}],_p=[{key:"x",icon:i.jsxRuntimeExports.jsx(E.e4.Arrow.Right,{})},{key:"y",icon:i.jsxRuntimeExports.jsx(E.e4.Arrow.Down,{})}],kp=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(E.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),hl=({children:e=kp,yDirection:t="up",...n})=>i.jsxRuntimeExports.jsx(Re.Button,{...n,allowMultiple:!1,data:t==="up"?vp:_p,children:e}),gl=e=>i.jsxRuntimeExports.jsx(E.Icon,{className:f.CSS.BE("select","clear"),variant:"outlined",...e,children:i.jsxRuntimeExports.jsx(E.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:y="connected",placeholder:C=hs,inputPlaceholder:R=C,triggerTooltip:k,dropdownZIndex:S,filter:j,actions:w,...M})=>{const{visible:v,open:N,close:L,toggle:T}=E.use$2(),[D,$]=g.useState(null),B=a!=null;E.useAsyncEffect(async()=>{if(E.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 b=g.useCallback((P,z)=>{Array.isArray(P)||($(P==null?null:z.entries[0]),L(),e(P,z))},[e,c]),I=g.useMemo(()=>B?E.Search:Vt.Filter,[B]),_=i.jsxRuntimeExports.jsx(I,{searcher:a,filter:j,children:({onChange:P})=>i.jsxRuntimeExports.jsx(Mp,{...l,autoFocus:y==="modal",variant:d,onChange:P,onFocus:N,selected:D,entryRenderKey:n,visible:v,allowNone:c,className:u,disabled:p,placeholder:R,children:w})}),O=i.jsxRuntimeExports.jsx(E.Button,{tooltip:k,variant:"outlined",onClick:T,disabled:p,children:D!=null?El(n,D):C});return i.jsxRuntimeExports.jsx(Re.Core,{close:L,zIndex:S,open:N,data:o,omit:m,emptyContent:r,allowMultiple:!1,visible:v,value:t,hideColumnHeader:x,onChange:b,allowNone:c,columns:s,listItem:h,variant:y,trigger:y!=="modal"?_:O,extraDialogContent:y==="modal"?_:void 0,keepMounted:!1,...M})},hs="Select",El=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Mp=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:o,allowNone:r=!0,placeholder:l=hs,className:c,disabled:a,...u})=>{const{clear:d}=E.useSelectionUtils(),[x,p]=g.useState("");g.useEffect(()=>{if(!n){if(H.w$1(t==null?void 0:t.key))return p("");t!=null&&p(El(e,t))}},[t,n,e]);const m=R=>{s(R),p(R)},h=()=>{x===""&&s(""),p(""),o==null||o()},y=R=>{n||(R.preventDefault(),o==null||o())},C=()=>{p(""),d==null||d()};return i.jsxRuntimeExports.jsx(E.Text$1,{className:f.CSS(f.CSS.BE("select","input"),c),value:x,onChange:m,onFocus:h,onKeyDown:E.matchCallback([["Enter"]],R=>{R.preventDefault(),!n&&(o==null||o())}),endContent:i.jsxRuntimeExports.jsx(Zi.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n}),style:{flexGrow:1},onClick:y,placeholder:l,disabled:a,...u,children:r&&i.jsxRuntimeExports.jsx(gl,{onClick:C,disabled:a})})},cn=({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(E.e4.Circle,{fill:a}));const u=o==null?void 0:i.jsxRuntimeExports.jsx(E.Icon,{"aria-label":"close",size:"small",className:f.CSS.BE("tag","close"),onClick:d=>{d.stopPropagation(),o()},children:i.jsxRuntimeExports.jsx(E.e4.Close,{})});return i.jsxRuntimeExports.jsx(E.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})},Pp=Object.freeze(Object.defineProperty({__proto__:null,Tag:cn},Symbol.toStringTag,{value:"Module"})),Ht=({onChange:e,value:t,className:n,data:s,columns:o=[],entryRenderKey:r="key",emptyContent:l,searcher:c,renderTag:a=E.componentRenderProp(yl),placeholder:u,onTagDragStart:d,allowMultiple:x,allowNone:p,replaceOnSingle:m,onTagDragEnd:h,style:y,addPlaceholder:C="Add",children:R,dropdownVariant:k="connected",actions:S,...j})=>{const{visible:w,open:M,close:v}=E.use$2(),[N,L]=g.useState([]),[T,D]=g.useState(!1),$=c!=null;E.useAsyncEffect(async()=>{D(!0),E.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]),b=g.useMemo(()=>$?E.Search:Vt.Filter,[$]);let I,_;if(k==="connected")_=i.jsxRuntimeExports.jsx(b,{searcher:c,children:({onChange:O,value:P})=>i.jsxRuntimeExports.jsx(Np,{value:P,selectedKeys:t,className:n,onChange:O,loading:T,selected:N,onFocus:M,entryRenderKey:r,visible:w,renderTag:a,placeholder:u,onTagDragStart:d,onTagDragEnd:h,style:y,children:S})});else{const O=H.A(t);_=i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"center",grow:!0,style:y,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(E.Icon,{onClick:M,children:i.jsxRuntimeExports.jsx(E.e4.Add,{style:{color:"var(--pluto-gray-l7)"}})}):i.jsxRuntimeExports.jsx(E.Button,{onClick:M,shade:7,startIcon:i.jsxRuntimeExports.jsx(E.e4.Add,{}),variant:"text",children:C})]}),I=i.jsxRuntimeExports.jsx(b,{searcher:c,children:P=>i.jsxRuntimeExports.jsx(E.Text$1,{autoFocus:!0,placeholder:"Search",...P,children:S})})}return i.jsxRuntimeExports.jsx(Re.Core,{close:v,open:M,data:s,emptyContent:l,visible:w,value:t,onChange:B,allowNone:p,replaceOnSingle:m,columns:o,allowMultiple:!0,listItem:R,trigger:_,extraDialogContent:I,variant:k,...j})},Np=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:o,visible:r,entryRenderKey:l,renderTag:c,placeholder:a=hs,onTagDragStart:u,onTagDragEnd:d,value:x,className:p,children:m,...h})=>{const{onSelect:y,clear:C}=E.useSelectionUtils(),R=g.useRef(null);g.useLayoutEffect(()=>{var w;r&&((w=R.current)==null||w.focus())},[r,n]);const k=()=>{r||s(""),o==null||o()},S=()=>{r||o==null||o()},j=()=>{r||s("")};return i.jsxRuntimeExports.jsxs(E.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(U.Space,{direction:"x",className:f.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:H.A(e).map(w=>{const M=n.find(v=>v.key===w);return c({key:w,entryKey:w,entryRenderKey:l,loading:t,entry:M,onClose:()=>y==null?void 0:y(w),onDragStart:v=>u==null?void 0:u(v,w),onDragEnd:v=>d==null?void 0:d(v,w)})})}),m,i.jsxRuntimeExports.jsx(gl,{onClick:C})]})},yl=({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(cn,{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))},Lp=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Re.BaseButton,Button:Re.Button,DEFAULT_PLACEHOLDER:hs,DataType:wp,Direction:hl,DropdownButton:Re.DropdownButton,Multiple:Ht,MultipleTag:yl,Single:dt,TextAlignment:ms,defaultButton:Re.defaultButton},Symbol.toStringTag,{value:"Module"})),On=6,Tp=2,Lr=5,Ap=e=>f.Eo.width(e)<Lr&&f.Eo.height(e)<Lr,Ip=["zoom","pan","select","zoomReset"],sn=[...Ip,"click"],$p=re.z.enum(sn),jl=["zoom","select"],zn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Sl={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},Rl={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Fo={zoom:zn,pan:Sl,select:Rl,zoomReset:zn,click:zn},Dp=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)]))},Op=f.Eo.construct(0,0,1,1,f.K.TOP_LEFT),zp={width:30,height:50},Cl=({onChange:e,triggers:t,initial:n=Op,threshold:s=zp,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]=E.useStateRef(n),p=g.useRef(f.G.ZERO),m=g.useRef(null),h=f._.construct(s);g.useEffect(()=>x(()=>f.Eo.truncate(n,On)),[n]),g.useEffect(()=>u(r),[r]);const[y,C,R,k]=E.useMemoCompare(()=>{const N={...Fo[r],...t},L=E.flattenConfig(N),T=Dp(N);return[N,L,T,E.flattenConfig(T)]},E.compareModeConfigs,[t]),S=g.useCallback(({box:N,triggers:L,stage:T,cursor:D})=>{if(m.current==null)return;const $=E.determineMode(y,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 b=Ap(N);if(T==="end"){if(b){$==="zoom"&&c(f.Eo.ZERO),e==null||e({box:d.current,mode:"click",stage:T,cursor:D});return}return x(_=>{if($==="pan"){const P=Tr(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(_,On))})}if(jl.includes($))return b?void 0:c(f.b.XY.scale(B).clamp(B).translate({x:-f.Eo.left(B),y:-f.Eo.top(B)}).box(Ar(h,N,B)));if(c(_=>f.Eo.areaIsZero(_)?_:f.Eo.ZERO),f.G.distance(D,p.current)<Tp)return;p.current=D;const I=Tr(N,d.current,B);e==null||e({box:I,mode:$,stage:T,cursor:D})},[c,u,e,y,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(co(L,T).box(Ar(h,N,T)),On),[s]),w=E.useHeldRef({triggers:[["Control"]]}),M=E.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 b=co(d.current,f.Eo.construct(m.current)).pos(f.G.construct(L));let _=f.b.XY.magnify({x:w.current.held?1:T,y:M.current.held?1:T}).box(d.current);_=f.Eo.translate(_,{x:w.current.held?0:b.x*(1-T),y:M.current.held?0:b.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]),Gi.useDrag({bound:m,onDrag:S,triggers:C,loose:!0});const v=g.useCallback(({triggers:N,stage:L})=>{if(L==="end")return u(r);const T=E.determineMode(R,N);T!=null&&u(T)},[R,r,e]);return E.use$1({triggers:k,callback:v,region:m}),{maskBox:l,ref:m,mode:a}},co=(e,t)=>f.b.XY.scale(t).clamp(t).scale(e),Tr=(e,t,n)=>{let s=f.Eo.signedDims(co(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),On)},Ar=(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,Bp=({mode:e,triggers:t})=>i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"center",children:[i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:f._$1.capitalize(e)}),i.jsxRuntimeExports.jsx(gf.Text,{trigger:t[0],level:"small"})]}),Vp={zoom:i.jsxRuntimeExports.jsx(E.e4.Zoom,{}),pan:i.jsxRuntimeExports.jsx(E.e4.Pan,{}),select:i.jsxRuntimeExports.jsx(E.e4.Selection,{}),zoomReset:i.jsxRuntimeExports.jsx(E.e4.Expand,{}),click:i.jsxRuntimeExports.jsx(E.e4.Bolt,{})},Fp=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([o])=>!t.includes(o)&&sn.includes(o)).map(([o,r])=>({key:o,icon:Vp[o],tooltip:i.jsxRuntimeExports.jsx(Bp,{mode:o,triggers:r})})).sort((o,r)=>sn.indexOf(o.key)-sn.indexOf(r.key));return i.jsxRuntimeExports.jsx(Re.Button,{...n,data:s,entryRenderKey:"icon",children:({title:o,entry:r,...l})=>g.createElement(E.Icon,{...l,key:r.key,variant:l.selected?"filled":"text",size:"medium",tooltip:r.tooltip,tooltipLocation:{x:"right",y:"top"}},r.icon)})},Hp=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Fo,MASK_MODES:jl,MODES:sn,Mask:Vo,PAN_DEFAULT_TRIGGERS:Sl,SELECT_DEFAULT_TRIGGERS:Rl,SelectMode:Fp,ZOOM_DEFAULT_TRIGGERS:zn,modeZ:$p,use:Cl},Symbol.toStringTag,{value:"Module"})),bl=e=>e==null?null:document.querySelectorAll(".pluto-line-plot__viewport")[0]??null,Ho=g.forwardRef(({children:e,initial:t=f.Eo.DECIMAL,onChange:n,...s},o)=>{const{setViewport:r}=Ue("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=Cl({onChange:l,initial:t,ref:o,...s});return i.jsxRuntimeExports.jsx(Vo,{className:f.CSS.BE("line-plot","viewport"),...c,children:e})});Ho.displayName="Viewport";const Zp=Object.freeze(Object.defineProperty({__proto__:null,Floating:dl,Legend:xl,Line:Bo,LinePlot:il,Title:pl,Tooltip:Ep,Viewport:Ho,XAxis:ll,YAxis:cl,axisFactory:$o,selectViewportEl:bl,useContext:Ue,useGridEntry:yn,useViewport:rl},Symbol.toStringTag,{value:"Module"})),Gp=E.wrap$1("Tooltip",({aetherKey:e,...t})=>(E.use$3({aetherKey:e,type:A.Annotation.TYPE,schema:A.annotationStateZ,initialState:t}),null)),wl=E.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:s,setHold:o}=Ue("Range.Provider"),[,{hovered:r,count:l},c]=E.use$3({aetherKey:e,type:A.Provider$1.TYPE,schema:A.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),a=yn({key:e,loc:"top",size:l>0?32:0,order:3},"Annotation.Provider"),u=E.useContextMenu(),d=E.useSyncedRef(u.visible),x=g.useCallback(p=>{const m=y=>{c(C=>({...C,cursor:{x:y.clientX,y:y.clientY}}))},h=p.currentTarget;h.addEventListener("mousemove",m),h.addEventListener("mouseleave",()=>{h.removeEventListener("mousemove",m),d.current||c(y=>({...y,cursor:null}))},{once:!0})},[c]);return i.jsxRuntimeExports.jsx(E.ContextMenu,{style:{...a,cursor:r!=null?"pointer":"default"},...u,menu:()=>t==null||r==null?null:t(r),children:i.jsxRuntimeExports.jsx(U.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})})}),Yp=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Gp,Provider:wl},Symbol.toStringTag,{value:"Module"})),vl={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Wp=E.flattenConfig(vl),_l=E.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=E.use$3({aetherKey:e,type:A.Measure.TYPE,schema:A.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=g.useRef(null),s=E.useHeldRef({triggers:Wp,loose:!0}),o=g.useCallback(({mode:c,cursor:a})=>{if(c==="click"){const u=E.determineMode(vl,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]);rl(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})}),Xp=Object.freeze(Object.defineProperty({__proto__:null,Measure:_l},Symbol.toStringTag,{value:"Module"})),Zo=E.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]=E.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 y=g.useRef(p);g.useEffect(()=>{m(j=>({...j,position:n,color:l,lineWidth:c,lineDash:a}))},[n,l,c,a]);const C=E.useCursorDrag({onStart:g.useCallback(()=>{m(j=>({...j,dragging:!0})),y.current=h.current},[]),onMove:j=>{m(w=>({...w,pixelPosition:(y.current??0)+f.Eo.signedHeight(j)}))},onEnd:g.useCallback(()=>{m(j=>({...j,dragging:!1})),y.current=p},[])}),R=g.useRef(null);if(x==null||p==null)return null;const k=bl(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:C,draggable:!0}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"center",style:{marginLeft:"2rem"},children:[i.jsxRuntimeExports.jsx(E.Editable,{level:"p",value:u,onChange:d}),i.jsxRuntimeExports.jsx(E.Text,{level:"p",style:{padding:"0.25rem 0",width:"fit-content"},children:`${x.toFixed(2)} ${r}`})]})]});return k==null?S:Lo.createPortal(S,k)}),Kp=Object.freeze(Object.defineProperty({__proto__:null,Rule:Zo},Symbol.toStringTag,{value:"Module"})),kl=E.canDropOfType(He),qp=({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:y=!1,initialViewport:C=f.Eo.DECIMAL,legendVariant:R,onViewportChange:k,viewportTriggers:S,annotationProvider:j,...w})=>{var T;const M=t.filter(({location:D})=>f.K.isY(D)),v=g.useRef(),N=E.usePrevious(e.length),L=E.usePrevious(w.hold);return(N===0&&e.length!==0||L===!0&&w.hold===!1)&&((T=v.current)==null||T.reset()),i.jsxRuntimeExports.jsxs(il,{...w,children:[M.map((D,$)=>{const B=e.filter(_=>_.axes.x===D.key),b=t.filter(({location:_})=>f.K.isX(_)),I=m==null?void 0:m.filter(_=>[...b.map(({key:O})=>O),D.key].includes(_.axis));return i.jsxRuntimeExports.jsx(Up,{axis:D,index:$,lines:B,yAxes:b,rules:I,onAxisChannelDrop:x,onAxisChange:p,annotationProvider:j},D.key)}),r&&i.jsxRuntimeExports.jsx(xl,{onLineChange:u,position:l,onPositionChange:c,variant:R}),n&&i.jsxRuntimeExports.jsx(pl,{value:s,onChange:o,level:a}),i.jsxRuntimeExports.jsxs(Ho,{initial:C,onChange:k,triggers:S,ref:v,children:[h&&i.jsxRuntimeExports.jsx(ml,{}),y&&i.jsxRuntimeExports.jsx(_l,{})]})]})},Up=({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=E.useDrop({type:"Channel.LinePlot.XAxis",canDrop:kl,onDrop:g.useCallback(({items:y})=>{const C=E.filterByType(He,y);return r==null||r(a,C.map(({key:R})=>R)),C},[a,r])}),m=s==null?void 0:s.filter(y=>y.axis===a),h=E.useDraggingState();return i.jsxRuntimeExports.jsxs(ll,{...d,...p,location:c,showGrid:u??n===0,className:f.CSS(f.CSS.dropRegion(E.canDropOfType(He)(h))),onAutoBoundsChange:y=>l==null?void 0:l({key:a,bounds:y}),children:[e.map((y,C)=>{const R=t.filter(S=>S.axes.y===y.key),k=s==null?void 0:s.filter(S=>S.axis===y.key);return i.jsxRuntimeExports.jsx(Jp,{axis:{...y,showGrid:u??(n===0&&C===0)},lines:R,rules:k,onRuleChange:o,onAxisChannelDrop:r,onAxisChange:l},y.key)}),m==null?void 0:m.map(y=>g.createElement(Zo,{aetherKey:y.key,...y,key:y.key,onLabelChange:C=>o==null?void 0:o({key:y.key,label:C}),onPositionChange:C=>o==null?void 0:o({key:y.key,position:C})})),i.jsxRuntimeExports.jsx(wl,{...x})]})},Qp=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Jp=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:o,axis:{key:r,location:l,...c}})=>{const a=E.useDrop({type:"Channel.LinePlot.YAxis",canDrop:kl,onDrop:g.useCallback(({items:d})=>{const x=E.filterByType(He,d);return s==null||s(r,x.map(({key:p})=>p)),x},[r,s])}),u=E.useDraggingState();return i.jsxRuntimeExports.jsxs(cl,{...c,...a,location:l,className:f.CSS(f.CSS.dropRegion(E.canDropOfType(He)(u))),onAutoBoundsChange:d=>o==null?void 0:o({key:r,bounds:d}),children:[e.map(d=>i.jsxRuntimeExports.jsx(em,{line:d},Qp(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})}))]})},em=({line:e})=>e.variant==="static"?i.jsxRuntimeExports.jsx(nm,{line:e}):i.jsxRuntimeExports.jsx(tm,{line:e}),tm=({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(Bo,{aetherKey:e,y:l,x:a,...o})},nm=({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(Bo,{aetherKey:t,y:r,x:c,...o})},Ir=[{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"}],Yn=({items:e},t)=>{const n=E.filterByType(He,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Ml=["name","alias"],Pl=e=>{const t=fs();return g.useMemo(()=>e.length===0?Ir:Ir.filter(n=>e.includes(n.key)),[e,t])},sm=({columns:e=Ml,onChange:t,className:n,value:s,searchOptions:o,...r})=>{const l=Be(),c=fs(),a=Pl(e),u=Io(),d=E.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(E.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:m,onDragEnd:h,...y}=E.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(j=>Yn(j,H.A(s)),[s]),onDrop:g.useCallback(({items:j})=>{const w=E.filterByType(He,j);if(w.length===0)return[];const M=H.n([...H.A(s),...w.map(v=>v.key)]);return t(M,{clickedIndex:null,clicked:null,entries:[]}),w},[t,s])}),C=E.useDraggingState(),R=g.useCallback(({dropped:j})=>{t(H.A(s).filter(w=>!j.some(M=>M.key===w)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),k=g.useCallback((j,w)=>m([{key:w,type:He}],R),[m,R]),S=g.useCallback(j=>c[j.key]??j.name,[c]);return i.jsxRuntimeExports.jsx(Ht,{className:f.CSS(n,f.CSS.dropRegion(Yn(C,H.A(s)))),value:s,onTagDragStart:k,onTagDragEnd:h,searcher:x,onChange:t,columns:a,emptyContent:p,entryRenderKey:S,...y,...r})},ut=({columns:e=Ml,onChange:t,value:n,className:s,data:o,searchOptions:r,...l})=>{const c=Be(),a=fs(),u=Pl(e),d=Io(),x=E.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(E.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),y=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:C,onDragEnd:R,...k}=E.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(M=>Yn(M,H.o$1(n)),[n]),onDrop:g.useCallback(({items:M})=>{const v=E.filterByType(He,M);return v.length===0?[]:(t(v[0].key,{clickedIndex:null,clicked:null,entries:[]}),v)},[y,t])}),S=E.useDraggingState(),j=g.useCallback(()=>n!=null&&C([{type:He,key:n}]),[C,n]),w=g.useCallback(M=>a[M.key]??M.name,[a]);return i.jsxRuntimeExports.jsx(dt,{data:o,className:f.CSS(s,f.CSS.dropRegion(Yn(S,H.o$1(n)))),value:n,onDragStart:j,onDragEnd:R,onChange:t,searcher:p,columns:u,emptyContent:m,entryRenderKey:w,...k,...l})},om=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:qf,AliasProvider:tl,LinePlot:qp,SelectMultiple:sm,SelectSingle:ut,useActiveRange:Io,useAlias:el,useAliases:fs,useContext:Ji,useName:ps},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}},Nl=(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},Ll=(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},rm=e=>{var t,n;return((n=(t=Nl(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},im=({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])},lm=({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},Tl=(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)}}),cm=({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,...Tl(s,e)}),[l,s,e])},Go=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(Go);return e??t},$r=e=>({key:e,variant:"success",message:""}),am=e=>e.code===re.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",Al=({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=E.useSyncedRef(n),c=E.useSyncedRef(o),a=g.useCallback(({path:w,onChange:M,listenToChildren:v=!1})=>{var D;const{parentListeners:N,listeners:L}=r.current,T=v?N:L;return T.has(w)||T.set(w,new Set),(D=T.get(w))==null||D.add(M),()=>{var $;return($=T.get(w))==null?void 0:$.delete(M)}},[]),u=g.useCallback((w,{optional:M}={optional:!1})=>{const{state:v,statuses:N,touched:L}=r.current,T=H._.get(v,w,{optional:M});if(T==null)return null;const D={value:T,status:N.get(w)??$r(w),touched:L.has(w),required:!1};if(l.current==null)return D;const $=l.current,B=H.N.getFieldSchema($,w,{optional:!0});return B==null||(D.required=!B.isOptional()),D},[]),d=g.useCallback(w=>{const{state:M,statuses:v,touched:N,listeners:L,parentListeners:T}=r.current;H._.remove(M,w),v.delete(w),N.delete(w),L.delete(w),T.delete(w)},[]),x=g.useCallback(w=>{const{statuses:M,touched:v}=r.current;r.current.state=w,m(""),M.clear(),v.clear()},[]),p=g.useCallback(w=>{var N;const{listeners:M}=r.current,v=u(w,{optional:!0});v!=null&&((N=M.get(w))==null||N.forEach(L=>L(v)))},[]),m=g.useCallback(w=>{const{listeners:M,parentListeners:v}=r.current,N=M.get(w);if(w==""&&([...M.keys()].forEach(D=>{var B;const $=u(D,{optional:!0});$!=null&&((B=M.get(D))==null||B.forEach(b=>{b($)}))}),[...v.keys()].forEach(D=>{var B;const $=u(D,{optional:!0});$!=null&&((B=v.get(D))==null||B.forEach(b=>{b($)}))})),N!=null){const L=u(w,{optional:!0});L!=null&&N.forEach(T=>{T(L)})}v.forEach((L,T)=>{if(H._.pathsMatch(w,T)){const $=u(T,{optional:!0});$!=null&&L.forEach(B=>{B($)})}})},[]),h=g.useCallback((w,M="",v=!0)=>{const{statuses:N,listeners:L,touched:T}=r.current;if(w.success){const b=[...N.keys()];return N.clear(),b.forEach(I=>p(I)),!0}let D=!0;const $=new Set(w.error.issues.map(b=>b.path.join(".")));let B=(b,I)=>b===I;return v&&(B=(b,I)=>H._.pathsMatch(b,I)),w.error.issues.forEach(b=>{var z;const{message:I}=b,_=b.path.join(".");if(!B(_,M))return;const O=am(b);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(_)??$r(_),touched:!1,required:!1}),(z=L.get(_))==null||z.forEach(V=>V(P))}),N.forEach((b,I)=>{$.has(I)||(N.delete(I),p(I))}),D},[]),y=g.useCallback((w,M)=>{if(l.current==null)return!0;const{state:v}=r.current,N=l.current.safeParse(v);return h(N,w,M)},[h]),C=g.useCallback(async(w,M)=>{if(l.current==null)return!0;const{state:v}=r.current,N=await l.current.safeParseAsync(v);return h(N,w,M)},[h]),R=g.useCallback((w,M,v={})=>{const N=H._.get(r.current.state,w,{optional:!0}),{validateChildren:L=!0}=v,{state:T,touched:D}=r.current;D.add(w),w.length===0?r.current.state=M:H._.set(T,w,M),m(w),(async()=>{var B;let $;try{$=y(w,L)}catch{$=await C(w,L)}(B=c.current)==null||B.call(c,{values:r.current.state,path:w,prev:N,valid:$})})()},[]),k=g.useCallback(w=>H._.has(r.current.state,w),[]),S=g.useCallback((w,M)=>{r.current.statuses.set(w,M),r.current.touched.add(w),p(w)},[]),j=g.useCallback(()=>{const{statuses:w}=r.current;w.clear(),w.forEach((M,v)=>p(v))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:w}=r.current;r.current.state=e,w.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:y,validateAsync:C,value:()=>r.current.state,has:k,remove:d,setStatus:S,clearStatuses:j,reset:x}),[a,R,u,y,C,k,d,S,j,x,s])},um=e=>i.jsxRuntimeExports.jsx(Go.Provider,{value:e,children:e.children}),dm=E.componentRenderProp(E.Text$1),me=({path:e,children:t=dm,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,y={onChange:m,value:h};return d.variant!=null&&(y.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(y)})},bt=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const o=({inputProps:r,path:l,fieldKey:c=t,...a})=>i.jsxRuntimeExports.jsx(me,{...n,...a,path:c?`${l}.${c}`:l,children:u=>i.jsxRuntimeExports.jsx(e,{...u,...s,...r})});return o.displayName=e.displayName,o},Il=bt(E.Numeric),Tt=Il({}),$l=bt(E.Text$1),Yo=$l({}),Dl=bt(E.Switch$1),gs=Dl({}),xm=bt(dt),fm=bt(Ht),pm=bt(Re.DropdownButton),Wo=({key:e,open:t,onChange:n})=>{const s=E.useMemoPrimitiveArray(e);E.useAsyncEffect(async()=>{if(t==null)return;const o=await t();if(o!=null)return o.onChange(n),async()=>await o.close()},[t==null,s])},mm=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return E.useAsyncEffect(async()=>{s(await e())},[e]),Wo({...t,onChange:s}),n},hm=Object.freeze(Object.defineProperty({__proto__:null,useListener:Wo,useState:mm},Symbol.toStringTag,{value:"Module"})),gm=({key:e,name:t,queryFn:n,values:s,openObservable:o,applyChanges:r,applyObservable:l,...c})=>{const a=Be(),u=E.useAggregator(),d=E.useMemoPrimitiveArray(e),x=Al({values:s,...c,sync:!1,onChange:h=>{a!=null&&(async()=>{try{await(r==null?void 0:r({...h,client:a}))}catch(y){u({variant:"error",message:`Failed to save ${t}`,description:y.message})}})()}});E.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 Wo({key:d,open:p,onChange:m}),x},Em=Object.freeze(Object.defineProperty({__proto__:null,Context:Go,Field:me,Form:um,NumericField:Tt,SwitchField:gs,TextField:Yo,buildDropdownButtonSelectField:pm,buildNumericField:Il,buildSelectMultiField:fm,buildSelectSingleField:xm,buildSwitchField:Dl,buildTextField:$l,fieldArrayUtils:Tl,fieldBuilder:bt,use:Al,useChildFieldValues:lm,useContext:Je,useField:xt,useFieldArray:cm,useFieldListener:im,useFieldState:Nl,useFieldValid:rm,useFieldValue:Ll,useSynced:gm},Symbol.toStringTag,{value:"Module"})),ym=[{key:"name",name:"Name"},{key:"location",name:"Location"}],jm=({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:ym,searcher:s,entryRenderKey:"name",...t})},Sm=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:jm},Symbol.toStringTag,{value:"Module"})),At="label",Xo=[{key:"color",name:"Color",render:({entry:e})=>i.jsxRuntimeExports.jsx(E.e4.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Wn=({items:e},t)=>{const n=E.filterByType(At,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Rm=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...o})=>i.jsxRuntimeExports.jsx(cn,{color:e==null?void 0:e.color,...o,children:e==null?void 0:e.name}),Cm=E.componentRenderProp(Rm),bm=({onChange:e,className:t,value:n,...s})=>{const o=Be(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(E.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=E.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(p=>Wn(p,H.A(n)),[n]),onDrop:g.useCallback(({items:p})=>{const m=E.filterByType(At,p);if(m.length===0)return[];const h=H.n([...H.A(n),...m.map(y=>y.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=E.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:At}],d),[l,d]);return i.jsxRuntimeExports.jsx(Ht,{className:f.CSS(t,f.CSS.dropRegion(Wn(u,H.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.labels,onChange:e,columns:Xo,emptyContent:r,renderTag:Cm,addPlaceholder:"Label",...a,...s})},Ol=({value:e,onChange:t})=>{const n=Be(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(E.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=E.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(u=>Wn(u,H.o$1(e)),[e]),onDrop:g.useCallback(({items:u})=>{const d=E.filterByType(At,u);return d.length===0?[]:(t(d[0].key,{clickedIndex:null,clicked:null,entries:[]}),d)},[r,t])}),c=E.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:At,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},wm=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=Ol({value:t,onChange:e});return i.jsxRuntimeExports.jsx(dt,{data:s,className:f.CSS(n,f.CSS.dropRegion(Wn(r,H.o$1(t)))),value:t,onChange:e,columns:Xo,entryRenderKey:"name",...l,...o})},vm=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=Ol({value:t,onChange:n});return i.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:Xo,entryRenderKey:"name",...r,...s})},_m=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:At,SelectButton:vm,SelectMultiple:bm,SelectSingle:wm},Symbol.toStringTag,{value:"Module"})),zl=({children:e,centered:t,visible:n,enabled:s=!0,close:o,style:r,...l})=>{const c=g.useRef(null),a=g.useRef(n);E.useClickOutside({ref:c,exclude:d=>E.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 E.use$1({triggers:[["Escape"]],callback:u,loose:!0}),i.jsxRuntimeExports.jsx(U.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(U.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(U.Space,{className:f.CSS(f.CSS.BE("modal","content")),empty:!0,children:e})})})},km=({root:e,...t})=>Lo.createPortal(i.jsxRuntimeExports.jsx(zl,{...t}),E.getRootElement(e)),Mm=Object.freeze(Object.defineProperty({__proto__:null,Dialog:zl,Modal:km},Symbol.toStringTag,{value:"Module"})),Es=new Error("Tab not found"),Pm=new Error("Invalid Mosaic"),Xn=(e,t,n="center",s)=>{var x;if(e=et(e),s===void 0)return ao(e,t);const o=uo(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(uo(e,c).key!==o.key)return Xn(e,t,"center",c);if(o.tabs==null||o.tabs.length===0)return Xn(e,t,"center",s);const[a,u,d]=$m(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 Pm;return o.first.key=r,o.last.key=l,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},Nm=(e,t,n)=>{var r;e=et(e);const[s,o]=yt(e,t);if(s==null||o==null)throw Es;return o.tabs=(r=o.tabs)==null?void 0:r.map(l=>l.tabKey===t?n(l):l),e},ao=(e,t)=>(e=et(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=ao(e.first,t):e.last!=null&&(e.last=ao(e.last,t)),e)),Kn=e=>{e=et(e);const t=[];if(e.tabs!=null&&(e.selected=je.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=Kn(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=Kn(e.last);e.last=n,t.push(...s)}return[e,t]},Ko=(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=je.resetSelection(n.selected,n.tabs),e=Im(e);const s=n.selected??qn(e);return[e,s]},qn=e=>e.selected!=null?e.selected:e.first!=null?qn(e.first):e.last!=null?qn(e.last):null,Bl=(e,t)=>{e=et(e);const[n,s]=yt(e,t);if(n==null||s==null)throw Es;return s.selected=t,e},Vl=(e,t,n,s)=>{e=et(e);const[o,r]=yt(e,t);if(o==null||r==null)throw Es;const[l,c]=Ko(e,t);return[Xn(l,o,n,s),c]},an=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=an(e.first,t);if(n!=null)return n}if(e.last!=null){const n=an(e.last,t);if(n!=null)return n}},Fl=(e,t,n)=>{const s=Un(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},Lm=(e,t,n)=>{e=et(e);const s=an(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=je.resetSelection(u.selected,u.tabs),s.direction=n,s.first=u,s.last=a,s.tabs=void 0,s.selected=void 0,e},Tm=(e,t)=>{const n=an(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Hl=(e,t,n)=>{e=et(e);const[,s]=yt(e,t);if((s==null?void 0:s.tabs)==null)throw Es;return s.tabs=je.rename(t,n,(s==null?void 0:s.tabs)??[]),e},Am=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,uo=(e,t)=>{const n=Un(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:uo(e,s)},Im=e=>{let t=!0;for(;t;)[e,t]=xo(e);return e.first==null&&e.last==null&&(e.key=1),e},xo=e=>{if(e.first==null||e.last==null)return[e,!1];if(Or(e.first))return[Dr(e.last,!0),!0];if(Or(e.last))return[Dr(e.first,!1),!0];let t,n;return[e.first,t]=xo(e.first),[e.last,n]=xo(e.last),[e,t||n]},Dr=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Or=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]},Un=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=Un(e.first,t);return n??Un(e.last,t)},$m=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),fo=(e,t)=>{t(e),e.first!=null&&fo(e.first,t),e.last!=null&&fo(e.last,t)};class Zl{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 Dm=({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})},Gl=({node:e,children:t})=>Lo.createPortal(t,e.el),Om=Object.freeze(Object.defineProperty({__proto__:null,In:Gl,Node:Zl,Out:Dm},Symbol.toStringTag,{value:"Module"})),Jn=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}=To({direction:o,onResize:x,count:2,initialSizes:a!=null?[a]:void 0});let m;return s!==void 0?m=i.jsxRuntimeExports.jsx(Yl,{emptyContent:u,...n}):r!=null&&l!=null?m=i.jsxRuntimeExports.jsxs(xs,{id:`mosaic-${c}`,align:"stretch",className:f.CSS.BE("mosaic","resize"),...p,children:[i.jsxRuntimeExports.jsx(Jn,{...d,root:r,onResize:t},r.key),i.jsxRuntimeExports.jsx(Jn,{...d,root:l,onResize:t},l.key)]}):(m=null,console.warn("Mosaic tree is malformed")),c===1?i.jsxRuntimeExports.jsx(E.Provider$3,{children:m}):m});Jn.displayName="Mosaic";const es="pluto-mosaic-tab-drop",qo="pluto-mosaic-tab-create",zm=(e,t,n)=>{if(E.filterByType(E.FILE_TYPE,t).length>0&&n)return!0;const o=E.filterByType(es,t).map(c=>c.key),r=e.filter(c=>!o.includes(c.tabKey)).length>0;return E.filterByType(qo,t).length>0||o.length>0&&(r||e.length===0)},Yl=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:w})=>zm(a,w,x),[a,x]),m=g.useCallback(({items:w,event:M})=>{if(M==null)return[];d(null);const v=E.filterByType(E.FILE_TYPE,w).length>0,N=a.length===0?"center":Br(zr(M));if(v)return r==null||r(c,N,M),w;const L=E.filterByType(es,w);if(L.length>0){const D=L.map(({key:$})=>$)[0];t(c,D,N)}const T=E.filterByType(qo,w);if(T.length>0){const D=T.map(({key:$})=>$);n==null||n(c,N,D)}return L},[t,a.length]),h=g.useCallback(({event:w})=>{if(w==null)return;const M=a.length===0?"center":Br(zr(w));d(M)},[a.length]),{startDrag:y,...C}=E.useDragAndDrop({type:"Mosaic",canDrop:p,onDrop:m,onDragOver:h}),R=p(E.useDraggingState()),k=g.useCallback(()=>d(null),[]),S=g.useCallback((w,{tabKey:M})=>{y([{key:M,type:es,elementID:w.currentTarget.id}])},[y]),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(je.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:k,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:S,onCreate:j,...l,...C,children:[e.selected!=null&&o(a.find(w=>w.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:Bm[u]})]})});Yl.displayName="MosaicTabLeaf";const Bm={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%"}},zr=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}},Vm=e=>e,Fm=e=>1-e,Br=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[Vm(e),Fm(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")},Hm=({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 Zl({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(Gl,{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]},Zm=re.z.object({key:re.z.number(),tabs:re.z.array(je.tabZ).optional(),selected:re.z.string().optional(),direction:f.g.direction.optional(),size:re.z.number().optional()}),po=Zm.extend({first:re.z.lazy(()=>po).optional(),last:re.z.lazy(()=>po).optional()}),Gm=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(Kn(t)[0]),[t]),{root:n,onDrop:(u,d,x)=>s(p=>Vl(p,d,x,u)[0]),onClose:u=>s(d=>Ko(d,u)[0]),onSelect:u=>s(d=>Bl(d,u)),onResize:(u,d)=>s(x=>Fl(x,u,d)),onRename:e?(u,d)=>s(x=>Hl(x,u,d)):void 0}},Ym=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:qo,HAUL_DROP_TYPE:es,Mosaic:Jn,autoSelectTabs:Kn,canSplit:Tm,findSelected:qn,findTabNode:an,forEachNode:fo,insertTab:Xn,isEmpty:Am,mapNodes:Qn,moveTab:Vl,nodeZ:po,removeTab:Ko,renameTab:Hl,resizeNode:Fl,selectTab:Bl,split:Lm,updateTab:Nm,use:Gm,usePortal:Hm},Symbol.toStringTag,{value:"Module"})),Wm=({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(U.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})},jn=e=>({bordered:t=!1,className:n,...s})=>i.jsxRuntimeExports.jsx(U.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}),Wl=jn("start");Wl.displayName="NavbarStart";const Xl=jn("end");Xl.displayName="NavbarEnd";const Kl=jn("center");Kl.displayName="NavbarCenter";const ql=jn("");ql.displayName="NavbarContent";const Ul=jn("absolute-center");Ul.displayName="NavbarAbsoluteCenter";const Zt=Wm;Zt.Start=Wl;Zt.Center=Kl;Zt.End=Xl;Zt.AbsoluteCenter=Ul;Zt.Content=ql;const Uo=({aetherKey:e})=>{const[,{region:t},n]=E.use$3({aetherKey:e,type:A.Eraser$1.TYPE,schema:A.eraserStateZ,initialState:{region:f.Eo.ZERO,enabled:!0}}),s=E.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}},Xm=E.wrap$1(A.Eraser$1.TYPE,({aetherKey:e,children:t})=>{const{erase:n}=Uo({aetherKey:e}),s=E.useResize(n);return i.jsxRuntimeExports.jsx("div",{ref:s,className:f.CSS(f.CSS.inheritDims()),children:t})}),Km=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Xm,use:Uo},Symbol.toStringTag,{value:"Module"})),qm=({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}},Um=E.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}=Uo({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:y,minSize:C,maxSize:R,initialSize:k}=t;return i.jsxRuntimeExports.jsx(Ki,{className:f.CSS(f.CSS.BE("navdrawer","content"),f.CSS.dir(u),l),collapseThreshold:r,onCollapse:d,location:o,onResize:m,minSize:C,maxSize:R,initialSize:k,...a,children:h},y)}),Qm=Object.freeze(Object.defineProperty({__proto__:null,Bar:Zt,Drawer:Um,useDrawer:qm},Symbol.toStringTag,{value:"Module"})),Jm=({variant:e,className:t,children:n,...s})=>i.jsxRuntimeExports.jsx(U.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:Jm},Symbol.toStringTag,{value:"Module"})),Ys={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"})]})},th=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:o,onFullscreen:r,onClose:l,...c})=>i.jsxRuntimeExports.jsxs(U.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(Ws,{onClick:l,className:f.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Ys.Close}),i.jsxRuntimeExports.jsx(Ws,{onClick:s,className:f.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Ys.Minimize}),i.jsxRuntimeExports.jsx(Ws,{onClick:r,className:f.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Ys.Maximize})]}),Ws=({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}),Xs=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:o,focused:r,...l})=>i.jsxRuntimeExports.jsxs(U.Pack,{...l,children:[i.jsxRuntimeExports.jsx(Ks,{className:f.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:i.jsxRuntimeExports.jsx(E.e4.Subtract,{})}),i.jsxRuntimeExports.jsx(Ks,{className:f.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:i.jsxRuntimeExports.jsx(E.e4.Box,{})}),i.jsxRuntimeExports.jsx(Ks,{onClick:s,className:f.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:i.jsxRuntimeExports.jsx(E.e4.Close,{})})]}),Ks=({disabled:e=!1,className:t,...n})=>e?null:i.jsxRuntimeExports.jsx(E.Icon,{className:f.CSS(f.CSS.B("windows-control"),t),tabIndex:-1,...n}),Ql=e=>H.w.getOS(e),nh={MacOS:th,Windows:Xs,Linux:Xs,Docker:Xs},sh="Windows",oh=({forceOS:e,visibleIfOS:t,...n})=>{const s=Ql({force:e,default:sh}),o=nh[s];return t!=null&&t!==s?null:i.jsxRuntimeExports.jsx(o,{...n})},rh=Object.freeze(Object.defineProperty({__proto__:null,Controls:oh,use:Ql},Symbol.toStringTag,{value:"Module"})),ih=(e,t)=>{const n=s=>i.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},lh=Object.freeze(Object.defineProperty({__proto__:null,createComponent:ih},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:H.B$1.NOOP});const ch=E.wrap$1(A.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const s=E.useMemoDeepEqualProps(n),[{path:o},,r]=E.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(E.Composite,{path:o,children:t})}),ah="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Jl=E.wrap$1(A.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=E.use$3({aetherKey:t,type:A.BaseProvider.TYPE,schema:A.providerStateZ$2,initialState:{}});return i.jsxRuntimeExports.jsx(E.Composite,{path:n,children:e})}),uh=Object.freeze(Object.defineProperty({__proto__:null,Provider:Jl},Symbol.toStringTag,{value:"Module"})),dh=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)"}}},ec=E.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:s,...o})=>{const r=E.useMemoDeepEqualProps({source:t,sink:n}),[,{status:l},c]=E.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}=dh(l);return i.jsxRuntimeExports.jsx(E.Icon,{variant:"text",className:f.CSS(f.CSS.B("control-chip"),s),disabled:p,onClick:a,tooltip:i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:u}),style:x,...o,children:i.jsxRuntimeExports.jsx(E.e4.Circle,{color:d})})}),tc=g.createContext({needsControlOf:[]}),nc=()=>g.useContext(tc),xh=E.wrap$1(A.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...s})=>{const o=E.useMemoDeepEqualProps(s),[{path:r},{status:l,needsControlOf:c},a]=E.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(tc.Provider,{value:{needsControlOf:c},children:[i.jsxRuntimeExports.jsx(E.Composite,{path:r,children:t}),";"]})}),sc=E.wrap$1(A.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var a;const s=E.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:o,status:r},l]=E.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(E.Dialog$1,{location:{x:"center",y:"bottom"},children:[i.jsxRuntimeExports.jsx(E.Text,{level:"p",children:r.message}),i.jsxRuntimeExports.jsx("div",{className:f.CSS.B("indicator"),style:{backgroundColor:f.cssString(c),flexGrow:1}})]})}),fh=E.wrap$1(A.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=nc(),[,{states:s},o]=E.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(zo,{data:l,...t})}),oc=E.wrap$1(A.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=E.use$3({aetherKey:e,type:A.StateProvider.TYPE,schema:A.stateProviderStateZ,initialState:{}});return i.jsxRuntimeExports.jsx(E.Composite,{path:n,children:t})}),ph=Object.freeze(Object.defineProperty({__proto__:null,Chip:ec,Controller:xh,Indicator:sc,Legend:fh,StateProvider:oc,useContext:nc},Symbol.toStringTag,{value:"Module"})),rc=e=>{const t=({disabled:n=!1,...s})=>n?s.children:i.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},mh=rc(Jl),hh=rc(E.Provider$4),gh=({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(E.Provider$2,{...l,children:i.jsxRuntimeExports.jsx(E.Config,{...r,children:i.jsxRuntimeExports.jsx(E.Provider$3,{...a,children:i.jsxRuntimeExports.jsx(E.Provider$5,{url:s??ah,enabled:n,children:i.jsxRuntimeExports.jsx(hh,{workerKey:"vis",children:i.jsxRuntimeExports.jsx(ch,{...c,children:i.jsxRuntimeExports.jsx(E.Aggregator,{children:i.jsxRuntimeExports.jsx(Qi,{connParams:t,children:i.jsxRuntimeExports.jsx(tl,{...u,children:i.jsxRuntimeExports.jsx(mh,{...d,children:i.jsxRuntimeExports.jsx(E.Provider$1,{...x,children:i.jsxRuntimeExports.jsx(E.Provider,{...o,children:i.jsxRuntimeExports.jsx(oc,{children:e})})})})})})})})})})})})}),Eh=Object.freeze(Object.defineProperty({__proto__:null,Provider:gh},Symbol.toStringTag,{value:"Module"})),yh=({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}%`}})}),jh=Object.freeze(Object.defineProperty({__proto__:null,Progress:yh},Symbol.toStringTag,{value:"Module"})),un="range",Qo=[{key:"name",name:"Name"}],ts=({items:e},t)=>{const n=E.filterByType(un,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Sh=({onChange:e,className:t,value:n,...s})=>{const o=Be(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(E.Text$2.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=E.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(p=>ts(p,H.A(n)),[n]),onDrop:g.useCallback(({items:p})=>{const m=E.filterByType(un,p);if(m.length===0)return[];const h=H.n([...H.A(n),...m.map(y=>y.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=E.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:un}],d),[l,d]);return i.jsxRuntimeExports.jsx(Ht,{className:f.CSS(t,f.CSS.dropRegion(ts(u,H.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.ranges,onChange:e,columns:Qo,emptyContent:r,entryRenderKey:"name",...a,...s})},ic=({value:e,onChange:t})=>{const n=Be(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(E.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}=E.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(d=>ts(d,H.o$1(e)),[e]),onDrop:g.useCallback(({items:d})=>{const x=E.filterByType(un,d);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[r,t])}),a=E.useDraggingState(),u=g.useCallback(()=>e!=null&&l([{type:un,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:u,searcher:n==null?void 0:n.ranges}},Rh=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=ic({value:t,onChange:e});return i.jsxRuntimeExports.jsx(dt,{data:s,className:f.CSS(n,f.CSS.dropRegion(ts(r,H.o$1(t)))),value:t,onChange:e,columns:Qo,entryRenderKey:"name",...l,...o})},Ch=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=ic({value:t,onChange:n});return i.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:Qo,entryRenderKey:"name",...r,...s})},bh=[{key:"color",name:"Color",width:50,render:e=>i.jsxRuntimeExports.jsx(E.e4.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],wh=e=>{const t=Be();return i.jsxRuntimeExports.jsx(Ht,{...e,searcher:t==null?void 0:t.labels,columns:bh,renderTag:n=>n.entry==null?i.jsxRuntimeExports.jsx(cn,{color:"gray",children:n.entryKey}):i.jsxRuntimeExports.jsx(cn,{color:n.entry.color,children:n.entry.name})})},vh=({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(U.Space,{direction:"x",size:"small",className:f.CSS(f.CSS.B("time-range-chip")),align:"center",...o,children:[r.isToday&&i.jsxRuntimeExports.jsx(E.Text,{level:t,shade:n,weight:450,children:"Today"}),i.jsxRuntimeExports.jsx(E.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:r}),i.jsxRuntimeExports.jsx(E.e4.Arrow.Right,{color:"var(--pluto-text-color)"}),a?i.jsxRuntimeExports.jsx(E.Text,{level:t,children:"Now"}):i.jsxRuntimeExports.jsx(E.DateTime,{level:t,displayTZ:"local",format:u,shade:n,weight:450,children:c}),!d.isZero&&s&&i.jsxRuntimeExports.jsxs(E.Text,{level:t,shade:n,weight:450,children:["(",r.span(c).truncate(H.y.MILLISECOND).toString(),")"]})]})},_h=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Ch,SelectLabels:wh,SelectMultiple:Sh,SelectSingle:Rh,TimeRangeChip:vh},Symbol.toStringTag,{value:"Module"})),kh=({steps:e,value:t,onChange:n,...s})=>{const o=e.findIndex(r=>r.key===t);return i.jsxRuntimeExports.jsx(U.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(E.Button,{onClick:()=>n(r.key),variant:"outlined",disabled:l>o,children:[l+1,". ",r.title]},r.key),l!==e.length-1&&i.jsxRuntimeExports.jsx(E.e4.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},r.key))})},Mh=Object.freeze(Object.defineProperty({__proto__:null,Steps:kh},Symbol.toStringTag,{value:"Module"})),Ph=E.wrap$1("Table",({aetherKey:e,children:t,className:n,visible:s,...o})=>{const[{path:r},,l]=E.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=En(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(E.Composite,{path:r,children:t})})})]})}),Nh=({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(cc,{onSelect:r,index:s,value:n,onChange:o,position:l,direction:"y"}),e]}),ys=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}));ys.displayName="Cell";const lc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Lh=e=>lc[e],cc=({value:e,selected:t=!1,index:n,onChange:s,position:o,direction:r="x",onSelect:l})=>{const c=E.useSyncedRef(e),a=g.useRef(e),u=E.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),E.CONTEXT_TARGET,t&&E.CONTEXT_SELECTED),style:{[f.g.dimension(r)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[i.jsxRuntimeExports.jsx(E.Text,{level:"p",shade:7,style:{width:"100%",textAlign:"center"},children:r==="x"?lc[n]:n+1}),i.jsxRuntimeExports.jsx("button",{onClick:d=>d.stopPropagation(),style:{[f.g.location(r)]:o+e},onDragStart:u,draggable:!0})]})},Th=({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(cc,{onSelect:t,position:c,selected:e.includes(l),index:l,value:r,onChange:a=>s(a,l),direction:"x"},l)})]})},Ah=Object.freeze(Object.defineProperty({__proto__:null,Cell:ys,ColumnIndicators:Th,Row:Nh,Table:Ph,getCellColumn:Lh},Symbol.toStringTag,{value:"Module"})),Ih=[{key:"standard",name:"Standard"},{key:"scientific",name:"Scientific"},{key:"engineering",name:"Engineering"}],$h=({...e})=>i.jsxRuntimeExports.jsx(Re.Button,{...e,entryRenderKey:"name",data:Ih}),ac=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Jo=({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 y=A.sourcePipeline("string",{connections:ac,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:y})},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=ps(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(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Notation",children:i.jsxRuntimeExports.jsx($h,{value:r.notation,onChange:u})}),i.jsxRuntimeExports.jsx(Pe.Item,{label:"Precision",align:"start",children:i.jsxRuntimeExports.jsx(E.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(E.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:x})})]})]})},Dh=A.Value.z.partial({color:!0}).extend({level:H.levelZ.optional()}),er=({aetherKey:e,box:t,telem:n,color:s,precision:o,minWidth:r,level:l="small",backgroundTelem:c,notation:a,location:u})=>{const d=E.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:o,level:l,minWidth:r,notation:a,backgroundTelem:c,location:u}),[,x,p]=E.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}},Oh=Object.freeze(Object.defineProperty({__proto__:null,TelemForm:Jo,VALUE_CONNECTIONS:ac,corePropsZ:Dh,use:er},Symbol.toStringTag,{value:"Module"})),zh=re.z.object({value:re.z.string(),level:H.levelZ,weight:H.weightZ,align:f.K.x.or(f.K.center),backgroundColor:f.crudeZ}),Bh=({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(ys,{id:e,className:f.CSS(E.CONTEXT_TARGET,s&&E.CONTEXT_SELECTED,f.CSS.BEM("table","cell","text")),selected:s,onClick:u,onContextMenu:u,style:{backgroundColor:f.cssString(a)},children:i.jsxRuntimeExports.jsx(E.Editable,{level:l,value:n,weight:c,onChange:d,style:{justifyContent:r},allowEmpty:!0})})},Vh=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()}),Fh=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:o,bounds:r},selected:l,box:c,onSelect:a})=>{const{width:u}=er({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(ys,{id:e,selected:l,onClick:d,onContextMenu:d,style:{height:"5rem",width:u},className:f.CSS(E.CONTEXT_TARGET,l&&E.CONTEXT_SELECTED,f.CSS.BEM("table","cell","value"))})},Hh=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return i.jsxRuntimeExports.jsx(U.Space,{direction:"y",style:{padding:"2rem"},children:i.jsxRuntimeExports.jsx(Jo,{path:""})});case"redline":return i.jsxRuntimeExports.jsx(U.Space,{direction:"y",style:{padding:"2rem"},children:i.jsxRuntimeExports.jsx(Zh,{})});default:return i.jsxRuntimeExports.jsx(U.Space,{direction:"y",grow:!0,empty:!0,style:{padding:"2rem"},children:i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Variant",padHelpText:!1,children:i.jsxRuntimeExports.jsx(uc,{onChange:e,value:"value"})}),i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:o,onChange:r,variant:l,...c})=>i.jsxRuntimeExports.jsx(E.Swatch,{value:o??f.ZERO.setAlpha(1).rgba255,onChange:a=>r(a.rgba255),...c,bordered:!0})}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:o=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...o})})]})})}},[]),n=je.useStatic({tabs:[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],content:t});return i.jsxRuntimeExports.jsx(je.Tabs,{...n})},Zh=()=>{const{set:e,get:t}=Je(),n=Ll("redline.bounds"),s=f.b.Scale.scale(0,1).scale(n);return i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Tt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Lower",path:"redline.bounds.lower"}),i.jsxRuntimeExports.jsx(me,{path:"redline.gradient",label:"Gradient",align:"start",padHelpText:!1,children:({value:o,onChange:r})=>i.jsxRuntimeExports.jsx(E.GradientPicker,{value:H._.copy(o),scale:s,onChange:l=>{const a={...t("redline.bounds").value},u=l.map(y=>y.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(y=>({...y,color:new f.Color(y.color).hex}));p||m?e("redline",{bounds:a,gradient:h}):r(l.map(y=>({...y,color:new f.Color(y.color).hex})))}})}),i.jsxRuntimeExports.jsx(Tt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Upper",path:"redline.bounds.upper"})]})},Gh=({onVariantChange:e})=>i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",grow:!0,style:{padding:"2rem"},children:[i.jsxRuntimeExports.jsx(Pe.Item,{label:"Variant",padHelpText:!1,children:i.jsxRuntimeExports.jsx(uc,{onChange:e,value:"text"})}),i.jsxRuntimeExports.jsx(Yo,{path:"value",label:"Text"}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"weight",label:"Weight",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Re.SelectWeight,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"align",label:"Alignment",hideIfNull:!0,children:t=>i.jsxRuntimeExports.jsx(ms,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>i.jsxRuntimeExports.jsx(E.Swatch,{value:t,onChange:n})})]}),Yh=[{key:"text",name:"Text"},{key:"value",name:"Value"}],uc=({onChange:e,value:t})=>i.jsxRuntimeExports.jsx(Re.Button,{value:t,onChange:e,data:Yh,allowMultiple:!1,entryRenderKey:"name"}),Wh=["text","value"],Xh=re.z.enum(Wh),Kh={key:"value",name:"Value",Form:Hh,Cell:Fh,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:Vh},qh={key:"text",name:"Text",Form:Gh,Cell:Bh,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:zh},Uh={text:qh,value:Kh},Qh=Object.freeze(Object.defineProperty({__proto__:null,CELLS:Uh,variantZ:Xh},Symbol.toStringTag,{value:"Module"})),Vr=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const o=pt(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)},Fr=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:o,targetBox:r})=>{if(!Jh({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=f.g.construct(t),c=f.g.swap(l);let a=gt(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]+jt(a,Le)}},mo=re.z.object({direction:f.g.direction,length:re.z.number()}),pt=(e,...t)=>{let n=e;for(const s of t)n=f.G.translate(n,s.direction,s.length);return n},dc=(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=gt(l.direction,l.length),a=Hr(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=gt(d.direction,d.length),p=Hr(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,Hr=e=>e==="top"||e==="left"?-1:1,jt=(e,t)=>e==="top"||e==="left"?-t:t,gt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",it=e=>gt(e.direction,e.length),Jh=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=f.g.construct(n),o=t[s]-e[s];return jt(n,o)<0},kn=e=>({direction:f.g.construct(e),length:jt(e,Le)}),Zr={top:kn("top"),bottom:kn("bottom"),left:kn("left"),right:kn("right")},eg=4,tg=.25,js=e=>ho(ng(ho(e))),ng=e=>{const t=[...e],n=e.findIndex((s,o)=>{const r=Math.abs(s.length);if(r<eg){if(o===0||o===e.length-1)return!1;if(r<tg)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},ho=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=jt(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=jt(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?ho(t):t},Mt=e=>js(sg(e)),sg=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:o,sourceOrientation:r})=>{let l=r,c=o,a={...Zr[r]},u=pt(n,a);const d={...Zr[o]};let x=pt(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=pt(n,a),x=pt(s,d));const h=[a],y=Fr({sourceStumpTip:u,sourceOrientation:r,sourceBox:e,targetStumpTip:x,targetOrientation:o,targetBox:t});y!=null&&(h.push(y),u=pt(u,y),l=it(y),a=y);const C=Fr({sourceStumpTip:x,sourceOrientation:c,sourceBox:t,targetStumpTip:u,targetOrientation:l,targetBox:e});C!=null&&(x=pt(x,C),c=gt(C.direction,C.length));const R=()=>{C!=null&&(C.length*=-1,h.push(C)),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 w;gt(a.direction,k)===l&>(S,j)===c?w={direction:a.direction,length:k}:(w={direction:S,length:x[S]-u[S]},S=f.g.swap(S)),h.push(w);const M={direction:S,length:x[S]-u[S]};return h.push(M),R(),h},og=e=>js(rg(e)),rg=({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=jt(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=jt(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},ig=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},lg=(e,t,n=!1,...s)=>{const o=(r,l)=>!s.includes(l)&&t(r,l);return n?ig(e,o):e.findIndex(o)},cg=({delta:e,segments:t})=>js(xc(e,t,!1)),ag=({delta:e,segments:t})=>js(xc(e,t,!0)),xc=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Yr("x",e,s,n)),e.y!==0&&(s=Yr("y",e,s,n)),s},Gr=(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},Yr=(e,t,n,s)=>{const o=f.g.swap(e),r=s?n.length-1:0,l=n[r];if(Gr(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=lg(n,x=>x.direction===e,s,r);if(u===c){const x=n[c];return Gr(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},ug=re.z.object({position:f.G.xy,zoom:re.z.number()}),fc=re.z.object({color:f.crudeZ,variant:re.z.string().optional(),segments:re.z.array(mo)}),dg=fc.extend({key:re.z.string(),source:re.z.string(),target:re.z.string(),segments:re.z.array(mo),color:f.crudeZ,id:re.z.string(),data:re.z.object({segments:re.z.array(mo),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()}),xg=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()}),tr=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),nr=e=>e.map(({segments:t,color:n,variant:s,...o})=>({...o,id:o.key,data:{segments:t,color:n,variant:s}})),pc=e=>e.map(t=>({key:t.id,selected:t.selected,...t})),mc=(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}}),hc=e=>({...e.position,zoom:e.zoom}),gc=e=>({position:f.G.construct(e),zoom:e.zoom}),Ec=(e,t)=>pc(t(tr(e))),Bn=(e,t,n)=>mc(t(nr(e)),n),fg=(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 Ce(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=Ce(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var pg={value:()=>{}};function Ss(){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 Vn(n)}function Vn(e){this._=e}function mg(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}})}Vn.prototype=Ss.prototype={constructor:Vn,on:function(e,t){var n=this._,s=mg(e+"",n),o,r=-1,l=s.length;if(arguments.length<2){for(;++r<l;)if((o=(e=s[r]).type)&&(o=hg(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]=Wr(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Wr(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 Vn(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 hg(e,t){for(var n=0,s=e.length,o;n<s;++n)if((o=e[n]).name===t)return o.value}function Wr(e,t,n){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=pg,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var go="http://www.w3.org/1999/xhtml";const Xr={svg:"http://www.w3.org/2000/svg",xhtml:go,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Rs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Xr.hasOwnProperty(t)?{space:Xr[t],local:e}:e}function gg(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===go&&t.documentElement.namespaceURI===go?t.createElement(e):t.createElementNS(n,e)}}function Eg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yc(e){var t=Rs(e);return(t.local?Eg:gg)(t)}function yg(){}function sr(e){return e==null?yg:function(){return this.querySelector(e)}}function jg(e){typeof e!="function"&&(e=sr(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 Sg(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Rg(){return[]}function jc(e){return e==null?Rg:function(){return this.querySelectorAll(e)}}function Cg(e){return function(){return Sg(e.apply(this,arguments))}}function bg(e){typeof e=="function"?e=Cg(e):e=jc(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 Sc(e){return function(){return this.matches(e)}}function Rc(e){return function(t){return t.matches(e)}}var wg=Array.prototype.find;function vg(e){return function(){return wg.call(this.children,e)}}function _g(){return this.firstElementChild}function kg(e){return this.select(e==null?_g:vg(typeof e=="function"?e:Rc(e)))}var Mg=Array.prototype.filter;function Pg(){return Array.from(this.children)}function Ng(e){return function(){return Mg.call(this.children,e)}}function Lg(e){return this.selectAll(e==null?Pg:Ng(typeof e=="function"?e:Rc(e)))}function Tg(e){typeof e!="function"&&(e=Sc(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 Cc(e){return new Array(e.length)}function Ag(){return new Ie(this._enter||this._groups.map(Cc),this._parents)}function ns(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ns.prototype={constructor:ns,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 Ig(e){return function(){return e}}function $g(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 ns(e,r[l]);for(;l<a;++l)(c=t[l])&&(o[l]=c)}function Dg(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 ns(e,r[c]);for(c=0;c<d;++c)(a=t[c])&&u.get(p[c])===a&&(o[c]=a)}function Og(e){return e.__data__}function zg(e,t){if(!arguments.length)return Array.from(this,Og);var n=t?Dg:$g,s=this._parents,o=this._groups;typeof e!="function"&&(e=Ig(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=Bg(e.call(d,d&&d.__data__,u,s)),h=m.length,y=c[u]=new Array(h),C=l[u]=new Array(h),R=a[u]=new Array(p);n(d,x,y,C,R,m,t);for(var k=0,S=0,j,w;k<h;++k)if(j=y[k]){for(k>=S&&(S=k+1);!(w=C[S])&&++S<h;);j._next=w||null}}return l=new Ie(l,s),l._enter=c,l._exit=a,l}function Bg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Vg(){return new Ie(this._exit||this._groups.map(Cc),this._parents)}function Fg(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 Hg(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 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 Gg(e){e||(e=Yg);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 Yg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Wg(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xg(){return Array.from(this)}function Kg(){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 Ug(){return!this.node()}function Qg(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 Jg(e){return function(){this.removeAttribute(e)}}function eE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tE(e,t){return function(){this.setAttribute(e,t)}}function nE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function sE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function oE(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 rE(e,t){var n=Rs(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?eE:Jg:typeof t=="function"?n.local?oE:sE:n.local?nE:tE)(n,t))}function bc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function iE(e){return function(){this.style.removeProperty(e)}}function lE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function cE(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function aE(e,t,n){return arguments.length>1?this.each((t==null?iE:typeof t=="function"?cE:lE)(e,t,n??"")):It(this.node(),e)}function It(e,t){return e.style.getPropertyValue(t)||bc(e).getComputedStyle(e,null).getPropertyValue(t)}function uE(e){return function(){delete this[e]}}function dE(e,t){return function(){this[e]=t}}function xE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function fE(e,t){return arguments.length>1?this.each((t==null?uE:typeof t=="function"?xE:dE)(e,t)):this.node()[e]}function wc(e){return e.trim().split(/^|\s+/)}function or(e){return e.classList||new vc(e)}function vc(e){this._node=e,this._names=wc(e.getAttribute("class")||"")}vc.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 _c(e,t){for(var n=or(e),s=-1,o=t.length;++s<o;)n.add(t[s])}function kc(e,t){for(var n=or(e),s=-1,o=t.length;++s<o;)n.remove(t[s])}function pE(e){return function(){_c(this,e)}}function mE(e){return function(){kc(this,e)}}function hE(e,t){return function(){(t.apply(this,arguments)?_c:kc)(this,e)}}function gE(e,t){var n=wc(e+"");if(arguments.length<2){for(var s=or(this.node()),o=-1,r=n.length;++o<r;)if(!s.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?hE:t?pE:mE)(n,t))}function EE(){this.textContent=""}function yE(e){return function(){this.textContent=e}}function jE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function SE(e){return arguments.length?this.each(e==null?EE:(typeof e=="function"?jE:yE)(e)):this.node().textContent}function RE(){this.innerHTML=""}function CE(e){return function(){this.innerHTML=e}}function bE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function wE(e){return arguments.length?this.each(e==null?RE:(typeof e=="function"?bE:CE)(e)):this.node().innerHTML}function vE(){this.nextSibling&&this.parentNode.appendChild(this)}function _E(){return this.each(vE)}function kE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ME(){return this.each(kE)}function PE(e){var t=typeof e=="function"?e:yc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function NE(){return null}function LE(e,t){var n=typeof e=="function"?e:yc(e),s=t==null?NE:typeof t=="function"?t:sr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function TE(){var e=this.parentNode;e&&e.removeChild(this)}function AE(){return this.each(TE)}function IE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $E(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function DE(e){return this.select(e?$E:IE)}function OE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function zE(e){return function(t){e.call(this,t,this.__data__)}}function BE(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 VE(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 FE(e,t,n){return function(){var s=this.__on,o,r=zE(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 HE(e,t,n){var s=BE(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?FE:VE,o=0;o<r;++o)this.each(c(s[o],t,n));return this}function Mc(e,t,n){var s=bc(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 ZE(e,t){return function(){return Mc(this,e,t)}}function GE(e,t){return function(){return Mc(this,e,t.apply(this,arguments))}}function YE(e,t){return this.each((typeof t=="function"?GE:ZE)(e,t))}function*WE(){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 Ie(e,t){this._groups=e,this._parents=t}function Sn(){return new Ie([[document.documentElement]],Pc)}function XE(){return this}Ie.prototype=Sn.prototype={constructor:Ie,select:jg,selectAll:bg,selectChild:kg,selectChildren:Lg,filter:Tg,data:zg,enter:Ag,exit:Vg,join:Fg,merge:Hg,selection:XE,order:Zg,sort:Gg,call:Wg,nodes:Xg,node:Kg,size:qg,empty:Ug,each:Qg,attr:rE,style:aE,property:fE,classed:gE,text:SE,html:wE,raise:_E,lower:ME,append:PE,insert:LE,remove:AE,clone:DE,datum:OE,on:HE,dispatch:YE,[Symbol.iterator]:WE};function Ae(e){return typeof e=="string"?new Ie([[document.querySelector(e)]],[document.documentElement]):new Ie([[e]],Pc)}function KE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function De(e,t){if(e=KE(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 qE={passive:!1},dn={capture:!0,passive:!1};function qs(e){e.stopImmediatePropagation()}function Lt(e){e.preventDefault(),e.stopImmediatePropagation()}function Nc(e){var t=e.document.documentElement,n=Ae(e).on("dragstart.drag",Lt,dn);"onselectstart"in t?n.on("selectstart.drag",Lt,dn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Lc(e,t){var n=e.document.documentElement,s=Ae(e).on("dragstart.drag",null);t&&(s.on("click.drag",Lt,dn),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 Mn=e=>()=>e;function Eo(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}})}Eo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function UE(e){return!e.ctrlKey&&!e.button}function QE(){return this.parentNode}function JE(e,t){return t??{x:e.x,y:e.y}}function ey(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tc(){var e=UE,t=QE,n=JE,s=ey,o={},r=Ss("start","drag","end"),l=0,c,a,u,d,x=0;function p(j){j.on("mousedown.drag",m).filter(s).on("touchstart.drag",C).on("touchmove.drag",R,qE).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(j,w){if(!(d||!e.call(this,j,w))){var M=S(this,t.call(this,j,w),j,w,"mouse");M&&(Ae(j.view).on("mousemove.drag",h,dn).on("mouseup.drag",y,dn),Nc(j.view),qs(j),u=!1,c=j.clientX,a=j.clientY,M("start",j))}}function h(j){if(Lt(j),!u){var w=j.clientX-c,M=j.clientY-a;u=w*w+M*M>x}o.mouse("drag",j)}function y(j){Ae(j.view).on("mousemove.drag mouseup.drag",null),Lc(j.view,u),Lt(j),o.mouse("end",j)}function C(j,w){if(e.call(this,j,w)){var M=j.changedTouches,v=t.call(this,j,w),N=M.length,L,T;for(L=0;L<N;++L)(T=S(this,v,j,w,M[L].identifier,M[L]))&&(qs(j),T("start",j,M[L]))}}function R(j){var w=j.changedTouches,M=w.length,v,N;for(v=0;v<M;++v)(N=o[w[v].identifier])&&(Lt(j),N("drag",j,w[v]))}function k(j){var w=j.changedTouches,M=w.length,v,N;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),v=0;v<M;++v)(N=o[w[v].identifier])&&(qs(j),N("end",j,w[v]))}function S(j,w,M,v,N,L){var T=r.copy(),D=De(L||M,w),$,B,b;if((b=n.call(j,new Eo("beforestart",{sourceEvent:M,target:p,identifier:N,active:l,x:D[0],y:D[1],dx:0,dy:0,dispatch:T}),v))!=null)return $=b.x-D[0]||0,B=b.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,w),V=l;break}T.call(_,j,new Eo(_,{sourceEvent:O,subject:b,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:Mn(!!j),p):e},p.container=function(j){return arguments.length?(t=typeof j=="function"?j:Mn(j),p):t},p.subject=function(j){return arguments.length?(n=typeof j=="function"?j:Mn(j),p):n},p.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:Mn(!!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 $t=0,tn=0,Jt=0,Ac=1e3,ss,nn,os=0,St=0,Cs=0,xn=typeof performance=="object"&&performance.now?performance:Date,Ic=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function rr(){return St||(Ic(ty),St=xn.now()+Cs)}function ty(){St=0}function rs(){this._call=this._time=this._next=null}rs.prototype=$c.prototype={constructor:rs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?rr():+n)+(t==null?0:+t),!this._next&&nn!==this&&(nn?nn._next=this:ss=this,nn=this),this._call=e,this._time=n,yo()},stop:function(){this._call&&(this._call=null,this._time=1/0,yo())}};function $c(e,t,n){var s=new rs;return s.restart(e,t,n),s}function ny(){rr(),++$t;for(var e=ss,t;e;)(t=St-e._time)>=0&&e._call.call(void 0,t),e=e._next;--$t}function Kr(){St=(os=xn.now())+Cs,$t=tn=0;try{ny()}finally{$t=0,oy(),St=0}}function sy(){var e=xn.now(),t=e-os;t>Ac&&(Cs-=t,os=e)}function oy(){for(var e,t=ss,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:ss=n);nn=e,yo(s)}function yo(e){if(!$t){tn&&(tn=clearTimeout(tn));var t=e-St;t>24?(e<1/0&&(tn=setTimeout(Kr,e-xn.now()-Cs)),Jt&&(Jt=clearInterval(Jt))):(Jt||(os=xn.now(),Jt=setInterval(sy,Ac)),$t=1,Ic(Kr))}}function qr(e,t,n){var s=new rs;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,n),s}var ry=Ss("start","end","cancel","interrupt"),iy=[],Dc=0,Ur=1,jo=2,Fn=3,Qr=4,So=5,Hn=6;function bs(e,t,n,s,o,r){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;ly(e,n,{name:t,index:s,group:o,on:ry,tween:iy,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Dc})}function ir(e,t){var n=Ve(e,t);if(n.state>Dc)throw new Error("too late; already scheduled");return n}function Ge(e,t){var n=Ve(e,t);if(n.state>Fn)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 ly(e,t,n){var s=e.__transition,o;s[t]=n,n.timer=$c(r,0,n.time);function r(u){n.state=Ur,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!==Ur)return a();for(d in s)if(m=s[d],m.name===n.name){if(m.state===Fn)return qr(l);m.state===Qr?(m.state=Hn,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete s[d]):+d<t&&(m.state=Hn,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete s[d])}if(qr(function(){n.state===Fn&&(n.state=Qr,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=jo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===jo){for(n.state=Fn,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=So,1),x=-1,p=o.length;++x<p;)o[x].call(e,d);n.state===So&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Hn,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function Zn(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>jo&&s.state<So,s.state=Hn,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}r&&delete e.__transition}}function cy(e){return this.each(function(){Zn(this,e)})}function ay(e,t){var n,s;return function(){var o=Ge(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 uy(e,t,n){var s,o;if(typeof n!="function")throw new Error;return function(){var r=Ge(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 dy(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?ay:uy)(n,e,t))}function lr(e,t,n){var s=e._id;return e.each(function(){var o=Ge(this,s);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Ve(o,s).value[t]}}function Oc(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 xy(e){return function(){this.removeAttribute(e)}}function fy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function py(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 my(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 hy(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 gy(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 Ey(e,t){var n=Rs(e),s=n==="transform"?ep:Oc;return this.attrTween(e,typeof t=="function"?(n.local?gy:hy)(n,s,lr(this,"attr."+e,t)):t==null?(n.local?fy:xy)(n):(n.local?my:py)(n,s,t))}function yy(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function jy(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Sy(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&jy(e,r)),n}return o._value=t,o}function Ry(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&yy(e,r)),n}return o._value=t,o}function Cy(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=Rs(e);return this.tween(n,(s.local?Sy:Ry)(s,t))}function by(e,t){return function(){ir(this,e).delay=+t.apply(this,arguments)}}function wy(e,t){return t=+t,function(){ir(this,e).delay=t}}function vy(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?by:wy)(t,e)):Ve(this.node(),t).delay}function _y(e,t){return function(){Ge(this,e).duration=+t.apply(this,arguments)}}function ky(e,t){return t=+t,function(){Ge(this,e).duration=t}}function My(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_y:ky)(t,e)):Ve(this.node(),t).duration}function Py(e,t){if(typeof t!="function")throw new Error;return function(){Ge(this,e).ease=t}}function Ny(e){var t=this._id;return arguments.length?this.each(Py(t,e)):Ve(this.node(),t).ease}function Ly(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ge(this,e).ease=n}}function Ty(e){if(typeof e!="function")throw new Error;return this.each(Ly(this._id,e))}function Ay(e){typeof e!="function"&&(e=Sc(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 Qe(s,this._parents,this._name,this._id)}function Iy(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 Qe(l,this._parents,this._name,this._id)}function $y(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 Dy(e,t,n){var s,o,r=$y(t)?ir:Ge;return function(){var l=r(this,e),c=l.on;c!==s&&(o=(s=c).copy()).on(t,n),l.on=o}}function Oy(e,t){var n=this._id;return arguments.length<2?Ve(this.node(),n).on.on(e):this.each(Dy(n,e,t))}function zy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function By(){return this.on("end.remove",zy(this._id))}function Vy(e){var t=this._name,n=this._id;typeof e!="function"&&(e=sr(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,bs(u[p],t,n,p,u,Ve(d,n)));return new Qe(r,this._parents,t,n)}function Fy(e){var t=this._name,n=this._id;typeof e!="function"&&(e=jc(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),y=0,C=p.length;y<C;++y)(m=p[y])&&bs(m,t,n,y,p,h);r.push(p),l.push(d)}return new Qe(r,l,t,n)}var Hy=Sn.prototype.constructor;function Zy(){return new Hy(this._groups,this._parents)}function Gy(e,t){var n,s,o;return function(){var r=It(this,e),l=(this.style.removeProperty(e),It(this,e));return r===l?null:r===n&&l===s?o:o=t(n=r,s=l)}}function zc(e){return function(){this.style.removeProperty(e)}}function Yy(e,t,n){var s,o=n+"",r;return function(){var l=It(this,e);return l===o?null:l===s?r:r=t(s=l,n)}}function Wy(e,t,n){var s,o,r;return function(){var l=It(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),It(this,e))),l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c))}}function Xy(e,t){var n,s,o,r="style."+t,l="end."+r,c;return function(){var a=Ge(this,e),u=a.on,d=a.value[r]==null?c||(c=zc(t)):void 0;(u!==n||o!==d)&&(s=(n=u).copy()).on(l,o=d),a.on=s}}function Ky(e,t,n){var s=(e+="")=="transform"?Jf:Oc;return t==null?this.styleTween(e,Gy(e,s)).on("end.style."+e,zc(e)):typeof t=="function"?this.styleTween(e,Wy(e,s,lr(this,"style."+e,t))).each(Xy(this._id,e)):this.styleTween(e,Yy(e,s,t),n).on("end.style."+e,null)}function qy(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function Uy(e,t,n){var s,o;function r(){var l=t.apply(this,arguments);return l!==o&&(s=(o=l)&&qy(e,l,n)),s}return r._value=t,r}function Qy(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,Uy(e,t,n??""))}function Jy(e){return function(){this.textContent=e}}function ej(e){return function(){var t=e(this);this.textContent=t??""}}function tj(e){return this.tween("text",typeof e=="function"?ej(lr(this,"text",e)):Jy(e==null?"":e+""))}function nj(e){return function(t){this.textContent=e.call(this,t)}}function sj(e){var t,n;function s(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&nj(o)),t}return s._value=e,s}function oj(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,sj(e))}function rj(){for(var e=this._name,t=this._id,n=Bc(),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);bs(a,e,n,u,l,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Qe(s,this._parents,e,n)}function ij(){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=Ge(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 lj=0;function Qe(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Bc(){return++lj}var Xe=Sn.prototype;Qe.prototype={constructor:Qe,select:Vy,selectAll:Fy,selectChild:Xe.selectChild,selectChildren:Xe.selectChildren,filter:Ay,merge:Iy,selection:Zy,transition:rj,call:Xe.call,nodes:Xe.nodes,node:Xe.node,size:Xe.size,empty:Xe.empty,each:Xe.each,on:Oy,attr:Ey,attrTween:Cy,style:Ky,styleTween:Qy,text:tj,textTween:oj,remove:By,tween:dy,delay:vy,duration:My,ease:Ny,easeVarying:Ty,end:ij,[Symbol.iterator]:Xe[Symbol.iterator]};function cj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var aj={time:null,delay:0,duration:250,ease:cj};function uj(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 dj(e){var t,n;e instanceof Qe?(t=e._id,e=e._name):(t=Bc(),(n=aj).time=rr(),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])&&bs(a,e,t,u,l,n||uj(a,t));return new Qe(s,this._parents,e,t)}Sn.prototype.interrupt=cy;Sn.prototype.transition=dj;const Pn=e=>()=>e;function xj(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 Ke(e,t,n){this.k=e,this.x=t,this.y=n}Ke.prototype={constructor:Ke,scale:function(e){return e===1?this:new Ke(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ke(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 ws=new Ke(1,0,0);Vc.prototype=Ke.prototype;function Vc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ws;return e.__zoom}function Us(e){e.stopImmediatePropagation()}function en(e){e.preventDefault(),e.stopImmediatePropagation()}function fj(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function pj(){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 Jr(){return this.__zoom||ws}function mj(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function hj(){return navigator.maxTouchPoints||"ontouchstart"in this}function gj(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 Fc(){var e=fj,t=pj,n=gj,s=mj,o=hj,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=op,u=Ss("start","zoom","end"),d,x,p,m=500,h=150,y=0,C=10;function R(b){b.property("__zoom",Jr).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(b,I,_,O){var P=b.selection?b.selection():b;P.property("__zoom",Jr),b!==P?w(b,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(b,I,_,O){R.scaleTo(b,function(){var P=this.__zoom.k,z=typeof I=="function"?I.apply(this,arguments):I;return P*z},_,O)},R.scaleTo=function(b,I,_,O){R.transform(b,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(b,I,_,O){R.transform(b,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(b,I,_,O,P){R.transform(b,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(ws.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(b,I){return I=Math.max(r[0],Math.min(r[1],I)),I===b.k?b:new Ke(I,b.x,b.y)}function S(b,I,_){var O=I[0]-_[0]*b.k,P=I[1]-_[1]*b.k;return O===b.x&&P===b.y?b:new Ke(b.k,O,P)}function j(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function w(b,I,_,O){b.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,Q=typeof I=="function"?I.apply(P,z):I,J=a(K.invert(Y).concat(ee/K.k),Q.invert(Y).concat(ee/Q.k));return function(ne){if(ne===1)ne=Q;else{var W=J(ne),ie=ee/W[2];ne=new Ke(ie,Y[0]-W[0]*ie,Y[1]-W[1]*ie)}V.zoom(null,ne)}})}function M(b,I,_){return!_&&b.__zooming||new v(b,I)}function v(b,I){this.that=b,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,I),this.taps=0}v.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,I){return this.mouse&&b!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&b!=="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(b){var I=Ae(this.that).datum();u.call(b,this.that,new xj(b,{sourceEvent:this.sourceEvent,target:R,type:b,transform:this.that.__zoom,dispatch:u}),I)}};function N(b,...I){if(!e.apply(this,arguments))return;var _=M(this,I).event(b),O=this.__zoom,P=Math.max(r[0],Math.min(r[1],O.k*Math.pow(2,s.apply(this,arguments)))),z=De(b);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)],Zn(this),_.start()}en(b),_.wheel=setTimeout(V,h),_.zoom("mouse",n(S(k(O,P),_.mouse[0],_.mouse[1]),_.extent,l));function V(){_.wheel=null,_.end()}}function L(b,...I){if(p||!e.apply(this,arguments))return;var _=b.currentTarget,O=M(this,I,!0).event(b),P=Ae(b.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",ee,!0),z=De(b,_),V=b.clientX,Z=b.clientY;Nc(b.view),Us(b),O.mouse=[z,this.__zoom.invert(z)],Zn(this),O.start();function Y(K){if(en(K),!O.moved){var Q=K.clientX-V,J=K.clientY-Z;O.moved=Q*Q+J*J>y}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),Lc(K.view,O.moved),en(K),O.event(K).end()}}function T(b,...I){if(e.apply(this,arguments)){var _=this.__zoom,O=De(b.changedTouches?b.changedTouches[0]:b,this),P=_.invert(O),z=_.k*(b.shiftKey?.5:2),V=n(S(k(_,z),O,P),t.apply(this,I),l);en(b),c>0?Ae(this).transition().duration(c).call(w,V,O,b):Ae(this).call(R.transform,V,O,b)}}function D(b,...I){if(e.apply(this,arguments)){var _=b.touches,O=_.length,P=M(this,I,b.changedTouches.length===O).event(b),z,V,Z,Y;for(Us(b),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)),Zn(this),P.start())}}function $(b,...I){if(this.__zooming){var _=M(this,I).event(b),O=b.changedTouches,P=O.length,z,V,Z,Y;for(en(b),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],Q=_.touch1[0],J=_.touch1[1],ne=(ne=Q[0]-ee[0])*ne+(ne=Q[1]-ee[1])*ne,W=(W=J[0]-K[0])*W+(W=J[1]-K[1])*W;V=k(V,Math.sqrt(ne/W)),Z=[(ee[0]+Q[0])/2,(ee[1]+Q[1])/2],Y=[(K[0]+J[0])/2,(K[1]+J[1])/2]}else if(_.touch0)Z=_.touch0[0],Y=_.touch0[1];else return;_.zoom("touch",n(S(V,Z,Y),_.extent,l))}}function B(b,...I){if(this.__zooming){var _=M(this,I).event(b),O=b.changedTouches,P=O.length,z,V;for(Us(b),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])<C)){var Z=Ae(this).on("dblclick.zoom");Z&&Z.apply(this,arguments)}}}return R.wheelDelta=function(b){return arguments.length?(s=typeof b=="function"?b:Pn(+b),R):s},R.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Pn(!!b),R):e},R.touchable=function(b){return arguments.length?(o=typeof b=="function"?b:Pn(!!b),R):o},R.extent=function(b){return arguments.length?(t=typeof b=="function"?b:Pn([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),R):t},R.scaleExtent=function(b){return arguments.length?(r[0]=+b[0],r[1]=+b[1],R):[r[0],r[1]]},R.translateExtent=function(b){return arguments.length?(l[0][0]=+b[0][0],l[1][0]=+b[1][0],l[0][1]=+b[0][1],l[1][1]=+b[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(b){return arguments.length?(n=b,R):n},R.duration=function(b){return arguments.length?(c=+b,R):c},R.interpolate=function(b){return arguments.length?(a=b,R):a},R.on=function(){var b=u.on.apply(u,arguments);return b===u?R:b},R.clickDistance=function(b){return arguments.length?(y=(b=+b)*b,R):Math.sqrt(y)},R.tapDistance=function(b){return arguments.length?(C=+b,R):C},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.`},fn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Hc=["Enter"," ","Escape"];var Rt;(function(e){e.Strict="strict",e.Loose="loose"})(Rt||(Rt={}));var Et;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Et||(Et={}));var Dt;(function(e){e.Partial="partial",e.Full="full"})(Dt||(Dt={}));const Zc={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 is;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(is||(is={}));var G;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(G||(G={}));const ei={[G.Left]:G.Right,[G.Right]:G.Left,[G.Top]:G.Bottom,[G.Bottom]:G.Top};function Gc(e){return e===null?null:e?"valid":"invalid"}const Yc=e=>"id"in e&&"source"in e&&"target"in e,Ej=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),cr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Rn=(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}},yj=(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):cr(o)?o:t.nodeLookup.get(o.id));const c=l?ls(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return vs(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _s(n)},Cn=(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=ls(s);n=vs(n,o)}}),_s(n)},Wc=(e,t,[n,s,o]=[0,0,1],r=!1,l=!1)=>{const c={...bn(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,y=pn(c,zt(u)),C=(m??0)*(h??0),R=r&&y>0;(!u.internals.handleBounds||R||y>=C||u.dragging)&&a.push(u)}return a},jj=(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 Ro(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 Co({nodes:e,width:t,height:n,panZoom:s,minZoom:o,maxZoom:r},l){if(e.size===0)return Promise.resolve(!1);const c=Cn(e),a=ar(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 Xc({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&&Bt(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=Bt(x)?Ct(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 Sj({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(y=>y.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=jj(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 Ot=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ct=(e={x:0,y:0},t,n)=>({x:Ot(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ot(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Kc(e,t,n){const{width:s,height:o}=tt(n),{x:r,y:l}=n.internals.positionAbsolute;return Ct(e,[[r,l],[r+s,l+o]],t)}const ti=(e,t,n)=>e<t?Ot(Math.abs(e-t),1,t)/t:e>n?-Ot(Math.abs(e-n),1,t)/t:0,qc=(e,t,n=15,s=40)=>{const o=ti(e.x,s,t.width-s)*n,r=ti(e.y,s,t.height-s)*n;return[o,r]},vs=(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)}),bo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),_s=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),zt=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=cr(e)?e.internals.positionAbsolute:Rn(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}},ls=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=cr(e)?e.internals.positionAbsolute:Rn(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)}},Uc=(e,t)=>_s(vs(bo(e),bo(t))),pn=(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)},ni=e=>Oe(e.width)&&Oe(e.height)&&Oe(e.x)&&Oe(e.y),Oe=e=>!isNaN(e)&&isFinite(e),cs=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},ks=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bn=({x:e,y:t},[n,s,o],r=!1,l=[1,1])=>{const c={x:(e-n)/o,y:(t-s)/o};return r?ks(c,l):c},Qc=({x:e,y:t},[n,s,o])=>({x:e*o+n,y:t*o+s}),ar=(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=Ot(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}},as=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Bt(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 Jc(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 ea(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 on(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:o}){const{x:r,y:l}=qe(e),c=bn({x:r-((o==null?void 0:o.left)??0),y:l-((o==null?void 0:o.top)??0)},s),{x:a,y:u}=n?ks(c,t):c;return{xSnapped:a,ySnapped:u,...c}}const Ms=e=>({width:e.offsetWidth,height:e.offsetHeight}),ta=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Rj=["INPUT","SELECT","TEXTAREA"];function wo(e){var s,o;const t=((o=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:o[0])||e.target;return Rj.includes(t==null?void 0:t.nodeName)||(t==null?void 0:t.hasAttribute("contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const na=e=>"clientX"in e,qe=(e,t)=>{var r,l;const n=na(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)}},si=(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,...Ms(l)}})};function sa({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 Nn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function oi({pos:e,x1:t,y1:n,x2:s,y2:o,c:r}){switch(e){case G.Left:return[t-Nn(t-s,r),n];case G.Right:return[t+Nn(s-t,r),n];case G.Top:return[t,n-Nn(n-o,r)];case G.Bottom:return[t,n+Nn(o-n,r)]}}function oa({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:s,targetY:o,targetPosition:r=G.Top,curvature:l=.25}){const[c,a]=oi({pos:n,x1:e,y1:t,x2:s,y2:o,c:l}),[u,d]=oi({pos:r,x1:s,y1:o,x2:e,y2:t,c:l}),[x,p,m,h]=sa({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 ra({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 Cj({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 bj({sourceNode:e,targetNode:t,width:n,height:s,transform:o}){const r=vs(ls(e),ls(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 pn(l,_s(r))>0}const ia=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,wj=(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)),la=(e,t)=>{if(!e.source||!e.target)return cs("006",Te.error006()),t;let n;return Yc(e)?n={...e}:n={...e,id:ia(e)},wj(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},vj=(e,t,n,s={shouldReplaceId:!0})=>{const{id:o,...r}=e;if(!t.source||!t.target)return cs("006",Te.error006()),n;if(!n.find(a=>a.id===e.id))return cs("007",Te.error007(o)),n;const c={...r,id:s.shouldReplaceId?ia(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==o).concat(c)};function ca({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[o,r,l,c]=ra({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,o,r,l,c]}const ri={[G.Left]:{x:-1,y:0},[G.Right]:{x:1,y:0},[G.Top]:{x:0,y:-1},[G.Bottom]:{x:0,y:1}},_j=({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},ii=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function kj({source:e,sourcePosition:t=G.Bottom,target:n,targetPosition:s=G.Top,center:o,offset:r}){const l=ri[t],c=ri[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=_j({source:a,sourcePosition:t,target:u}),x=d.x!==0?"x":"y",p=d[x];let m=[],h,y;const C={x:0,y:0},R={x:0,y:0},[k,S,j,w]=ra({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[x]*c[x]===-1){h=o.x??k,y=o.y??S;const v=[{x:h,y:a.y},{x:h,y:u.y}],N=[{x:a.x,y},{x:u.x,y}];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 b=Math.min(r-1,r-B);l[x]===p?C[x]=(a[x]>e[x]?-1:1)*b:R[x]=(u[x]>n[x]?-1:1)*b}}if(t!==s){const B=x==="x"?"y":"x",b=l[x]===c[B],I=a[B]>u[B],_=a[B]<u[B];(l[x]===1&&(!b&&I||b&&_)||l[x]!==1&&(!b&&_||b&&I))&&(m=x==="x"?v:N)}const L={x:a.x+C.x,y:a.y+C.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,y=m[0].y):(h=m[0].x,y=(L.y+T.y)/2)}return[[e,{x:a.x+C.x,y:a.y+C.y},...m,{x:u.x+R.x,y:u.y+R.y},n],h,y,j,w]}function Mj(e,t,n,s){const o=Math.min(ii(e,t)/2,ii(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 vo({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]=kj({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:o},targetPosition:r,center:{x:c,y:a},offset:u});return[d.reduce((C,R,k)=>{let S="";return k>0&&k<d.length-1?S=Mj(d[k-1],R,d[k+1],l):S=`${k===0?"M":"L"}${R.x} ${R.y}`,C+=S,C},""),x,p,m,h]}function li(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Pj(e){var x;const{sourceNode:t,targetNode:n}=e;if(!li(t)||!li(n))return null;const s=t.internals.handleBounds||ci(t.handles),o=n.internals.handleBounds||ci(n.handles),r=ai((s==null?void 0:s.source)??[],e.sourceHandle),l=ai(e.connectionMode===Rt.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=mn(t,r,c),d=mn(n,l,a);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:a}}function ci(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 mn(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 ai(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function _o(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function Nj(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=_o(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 ur={nodeOrigin:[0,0],nodeExtent:fn,elevateNodesOnSelect:!0,defaults:{}},Lj={...ur,checkEquality:!0};function dr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Tj(e,t,n){const s=dr(ur,n);for(const o of e.values())if(o.parentId)xr(o,e,t,s);else{const r=Rn(o,s.nodeOrigin),l=Bt(o.extent)?o.extent:s.nodeExtent,c=Ct(r,l,tt(o));o.internals.positionAbsolute=c}}function ko(e,t,n,s){var c,a;const o=dr(Lj,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=Rn(u,o.nodeOrigin),p=Bt(u.extent)?u.extent:o.nodeExtent,m=Ct(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:aa(u,l),userNode:u}},t.set(u.id,d)}u.parentId&&xr(d,t,n,s)}}function Aj(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 xr(e,t,n,s){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:l}=dr(ur,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}Aj(e,n);const u=o?1e3:0,{x:d,y:x,z:p}=Ij(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 aa(e,t){return(Oe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Ij(e,t,n,s,o){const{x:r,y:l}=t.internals.positionAbsolute,c=tt(e),a=Rn(e,n),u=Bt(e.extent)?Ct(a,e.extent,c):a;let d=Ct({x:r+u.x,y:l+u.y},s,c);e.extent==="parent"&&(d=Kc(d,c,t));const x=aa(e,o),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>x?p:x}}function fr(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)??zt(a),d=Uc(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,y=Math.max(x.width,Math.round(c.width)),C=Math.max(x.height,Math.round(c.height)),R=(y-x.width)*p[0],k=(C-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(w=>w.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:y+(m?p[0]*m-R:0),height:C+(h?p[1]*h-k:0)}})}),o}function $j(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=Ms(p.nodeElement),y=m.measured.width!==h.width||m.measured.height!==h.height;if(!!(h.width&&h.height&&(y||!m.internals.handleBounds||p.force))){const R=p.nodeElement.getBoundingClientRect(),k=Bt(m.extent)?m.extent:r;let{positionAbsolute:S}=m.internals;m.parentId&&m.extent==="parent"?S=Kc(S,h,t.get(m.parentId)):k&&(S=Ct(S,k,h)),m.measured=h,m.internals={...m.internals,positionAbsolute:S,handleBounds:{source:si("source",p.nodeElement,R,d,m.id),target:si("target",p.nodeElement,R,d,m.id)}},m.parentId&&xr(m,t,n,{nodeOrigin:o}),c=!0,y&&(a.push({id:m.id,type:"dimensions",dimensions:h}),m.expandParent&&m.parentId&&x.push({id:m.id,parentId:m.parentId,rect:zt(m,o)}))}}}if(x.length>0){const p=fr(x,t,n,o);a.push(...p)}return{changes:a,updatedInternals:c}}async function Dj({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 ua(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 da(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:da(n,t):!1}function ui(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 Oj(e,t,n,s){const o=new Map;for(const[r,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!da(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 Qs({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 zj({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:C,handleSelector:R,domNode:k,isSelectable:S,nodeId:j,nodeClickDistance:w=0}){p=Ae(k);function M({x:T,y:D},$){const{nodeLookup:B,nodeExtent:b,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&&b){const K=Cn(c);ee=bo(K)}for(const[K,Q]of c){if(!B.has(K))continue;let J={x:T-Q.distance.x,y:D-Q.distance.y};_&&(J=ks(J,I));let ne=[[b[0][0],b[0][1]],[b[1][0],b[1][1]]];if(c.size>1&&b&&!Q.extent){const{positionAbsolute:de}=Q.internals,ae=de.x-ee.x+b[0][0],te=de.x+Q.measured.width-ee.x2+b[1][0],X=de.y-ee.y+b[0][1],se=de.y+Q.measured.height-ee.y2+b[1][1];ne=[[ae,X],[te,se]]}const{position:W,positionAbsolute:ie}=Xc({nodeId:K,nextPosition:J,nodeLookup:B,nodeExtent:ne,nodeOrigin:O,onError:V});Y=Y||Q.position.x!==W.x||Q.position.y!==W.y,Q.position=W,Q.internals.positionAbsolute=ie}if(Y&&(Z(c,!0),$&&(s||P||!j&&z))){const[K,Q]=Qs({nodeId:j,dragItems:c,nodeLookup:B});s==null||s($,c,K,Q),P==null||P($,K,Q),j||z==null||z($,Q)}}async function v(){if(!d)return;const{transform:T,panBy:D,autoPanSpeed:$}=t(),[B,b]=qc(u,d,$);(B!==0||b!==0)&&(r.x=(r.x??0)-B/T[2],r.y=(r.y??0)-b/T[2],await D({x:B,y:b})&&M(r,null)),l=requestAnimationFrame(v)}function N(T){var Y;const{nodeLookup:D,multiSelectionActive:$,nodesDraggable:B,transform:b,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=on(T.sourceEvent,{transform:b,snapGrid:I,snapToGrid:_,containerBounds:d});if(r=Z,c=Oj(D,B,Z,j),c.size>0&&(n||P||!j&&z)){const[ee,K]=Qs({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=Tc().clickDistance(w).on("start",T=>{const{domNode:D,nodeDragThreshold:$,transform:B,snapGrid:b,snapToGrid:I}=t();d=(D==null?void 0:D.getBoundingClientRect())||null,m=!1,$===0&&N(T),r=on(T.sourceEvent,{transform:B,snapGrid:b,snapToGrid:I,containerBounds:d}),u=qe(T.sourceEvent,d)}).on("drag",T=>{const{autoPanOnNodeDrag:D,transform:$,snapGrid:B,snapToGrid:b,nodeDragThreshold:I,nodeLookup:_}=t(),O=on(T.sourceEvent,{transform:$,snapGrid:B,snapToGrid:b,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=qe(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:b}=t();if($(c,!1),o||B||!j&&b){const[I,_]=Qs({nodeId:j,dragItems:c,nodeLookup:D,dragging:!1});o==null||o(T.sourceEvent,c,I,_),B==null||B(T.sourceEvent,I,_),j||b==null||b(T.sourceEvent,_)}}}).filter(T=>{const D=T.target;return!T.button&&(!C||!ui(D,`.${C}`,k))&&(!R||ui(D,R,k))});p.call(L)}function y(){p==null||p.on(".drag",null)}return{update:h,destroy:y}}function Bj(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())pn(o,zt(r))>0&&s.push(r);return s}const Vj=250;function Fj(e,t,n,s){var c,a;let o=[],r=1/0;const l=Bj(e,n,t+Vj);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}=mn(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 xa(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,...mn(l,a,a.position,!0)}:a}function fa(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Hj(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const pa=()=>!0;function Zj(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:y,onConnectEnd:C,isValidConnection:R=pa,onReconnectEnd:k,updateConnection:S,getTransform:j,getFromHandle:w,autoPanSpeed:M}){const v=ta(e.target);let N=0,L;const{x:T,y:D}=qe(e),$=v==null?void 0:v.elementFromPoint(T,D),B=fa(r,$),b=c==null?void 0:c.getBoundingClientRect();if(!b||!B)return;const I=xa(o,B,s,a,t);if(!I)return;let _=qe(e,b),O=!1,P=null,z=!1,V=null;function Z(){if(!d||!b)return;const[ie,de]=qc(_,b,M);p({x:ie,y:de}),N=requestAnimationFrame(Z)}const Y={...I,nodeId:o,type:B,position:I.position},ee=a.get(o),Q={inProgress:!0,isValid:null,from:mn(ee,Y,G.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:ee,to:_,toHandle:null,toPosition:ei[Y.position],toNode:null};S(Q);let J=Q;h==null||h(e,{nodeId:o,handleId:s,handleType:B});function ne(ie){if(!w()||!Y){W(ie);return}const de=j();_=qe(ie,b),L=Fj(bn(_,de,!1,[1,1]),n,a,Y),O||(Z(),O=!0);const ae=ma(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=Hj(!!L,ae.isValid);const te={...J,isValid:z,to:L&&z?Qc({x:L.x,y:L.y},de):_,toHandle:ae.toHandle,toPosition:z&&ae.toHandle?ae.toHandle.position:ei[Y.position],toNode:ae.toHandle?a.get(ae.toHandle.nodeId):null};z&&L&&J.toHandle&&te.toHandle&&J.toHandle.type===te.toHandle.type&&J.toHandle.nodeId===te.toHandle.nodeId&&J.toHandle.id===te.toHandle.id&&J.to.x===te.to.x&&J.to.y===te.to.y||(S(te),J=te)}function W(ie){(L||V)&&P&&z&&(y==null||y(P));const{inProgress:de,...ae}=J,te={...ae,toPosition:J.toHandle?J.toPosition:null};C==null||C(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 ma(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:r,doc:l,lib:c,flowId:a,isValidConnection:u=pa,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}=qe(e),y=l.elementFromPoint(m,h),C=y!=null&&y.classList.contains(`${c}-flow__handle`)?y:p,R={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const k=fa(void 0,C),S=C.getAttribute("data-nodeid"),j=C.getAttribute("data-handleid"),w=C.classList.contains("connectable"),M=C.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=w&&M&&(n===Rt.Strict?x&&k==="source"||!x&&k==="target":S!==s||j!==o);R.isValid=L&&u(v),R.toHandle=xa(S,k,j,d,n,!1)}return R}const Mo={onPointerDown:Zj,isValid:ma};function Gj({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 w=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*d,M=j[2]*Math.pow(2,w);t.scaleTo(M)};let y=[0,0];const C=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(y=[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 w=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],M=[w[0]-y[0],w[1]-y[1]];y=w;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=Fc().on("start",C).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 Yj=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ps=e=>({x:e.x,y:e.y,zoom:e.k}),Js=({x:e,y:t,zoom:n})=>ws.translate(e,t).scale(n),Pt=(e,t)=>e.target.closest(`.${t}`),ha=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),eo=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},ga=e=>{const t=e.ctrlKey&&as()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Wj({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:r,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:u}){return d=>{if(Pt(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const x=n.property("__zoom").k||1;if(d.ctrlKey&&l){const C=De(d),R=ga(d),k=x*Math.pow(2,R);s.scaleTo(n,k,C,d);return}const p=d.deltaMode===1?20:1;let m=o===Et.Vertical?0:d.deltaX*p,h=o===Et.Horizontal?0:d.deltaY*p;!as()&&d.shiftKey&&o!==Et.Vertical&&(m=d.deltaY*p,h=0),s.translateBy(n,-(m/x)*r,-(h/x)*r,{internal:!0});const y=Ps(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(d,y)),e.isPanScrolling&&(a==null||a(d,y),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,y),e.isPanScrolling=!1},150))}}function Xj({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,o){if(!t&&s.type==="wheel"&&!s.ctrlKey||Pt(s,e))return null;s.preventDefault(),n.call(this,s,o)}}function Kj({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var r,l,c;if((r=s.sourceEvent)!=null&&r.internal)return;const o=Ps(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 qj({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:o}){return r=>{var l,c;e.usedRightMouseButton=!!(n&&ha(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,Ps(r.transform)))}}function Uj({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&&ha(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&r(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),o&&Yj(e.prevViewport,l.transform))){const a=Ps(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(l.sourceEvent,a)},n?150:0)}}}function Qj({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"&&(Pt(d,`${u}-flow__node`)||Pt(d,`${u}-flow__edge`)))return!0;if(!s&&!x&&!o&&!r&&!n||l||Pt(d,c)&&d.type==="wheel"||Pt(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 Jj({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=Fc().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:Ot(r.zoom,t,n)},[[0,0],[x.width,x.height]],o);const h=m.on("wheel.zoom"),y=m.on("dblclick.zoom");p.wheelDelta(ga);function C($,B){return m?new Promise(b=>{p==null||p.transform(eo(m,B==null?void 0:B.duration,()=>b(!0)),$)}):Promise.resolve(!1)}function R({noWheelClassName:$,noPanClassName:B,onPaneContextMenu:b,userSelectionActive:I,panOnScroll:_,panOnDrag:O,panOnScrollMode:P,panOnScrollSpeed:z,preventScrolling:V,zoomOnPinch:Z,zoomOnScroll:Y,zoomOnDoubleClick:ee,zoomActivationKeyPressed:K,lib:Q,onTransformChange:J}){I&&!d.isZoomingOrPanning&&k();const W=_&&!K&&!I?Wj({zoomPanValues:d,noWheelClassName:$,d3Selection:m,d3Zoom:p,panOnScrollMode:P,panOnScrollSpeed:z,zoomOnPinch:Z,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):Xj({noWheelClassName:$,preventScrolling:V,d3ZoomHandler:h});if(m.on("wheel.zoom",W,{passive:!1}),!I){const de=Kj({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:c});p.on("start",de);const ae=qj({zoomPanValues:d,panOnDrag:O,onPaneContextMenu:!!b,onPanZoom:l,onTransformChange:J});p.on("zoom",ae);const te=Uj({zoomPanValues:d,panOnDrag:O,panOnScroll:_,onPaneContextMenu:b,onPanZoomEnd:a,onDraggingChange:u});p.on("end",te)}const ie=Qj({zoomActivationKeyPressed:K,panOnDrag:O,zoomOnScroll:Y,panOnScroll:_,zoomOnDoubleClick:ee,zoomOnPinch:Z,userSelectionActive:I,noPanClassName:B,noWheelClassName:$,lib:Q});p.filter(ie),ee?m.on("dblclick.zoom",y):m.on("dblclick.zoom",null)}function k(){p.on("zoom",null)}async function S($,B,b){const I=Js($),_=p==null?void 0:p.constrain()(I,B,b);return _&&await C(_),new Promise(O=>O(_))}async function j($,B){const b=Js($);return await C(b,B),new Promise(I=>I(b))}function w($){if(m){const B=Js($),b=m.property("__zoom");(b.k!==$.zoom||b.x!==$.x||b.y!==$.y)&&(p==null||p.transform(m,B,null,{sync:!0}))}}function M(){const $=m?Vc(m.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function v($,B){return m?new Promise(b=>{p==null||p.scaleTo(eo(m,B==null?void 0:B.duration,()=>b(!0)),$)}):Promise.resolve(!1)}function N($,B){return m?new Promise(b=>{p==null||p.scaleBy(eo(m,B==null?void 0:B.duration,()=>b(!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:w,setClickDistance:D}}var rn;(function(e){e.Line="line",e.Handle="handle"})(rn||(rn={}));function eS({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 tS(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 Ln(e,t,n){return Math.max(0,t-e,e-n)}function di(e,t){return e?!t:t}function nS(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:y,maxWidth:C,minHeight:R,maxHeight:k}=s,{x:S,y:j,width:w,height:M,aspectRatio:v}=e;let N=Math.floor(d?m-e.pointerX:0),L=Math.floor(x?h-e.pointerY:0);const T=w+(a?-N:N),D=M+(u?-L:L),$=-r[0]*w,B=-r[1]*M;let b=Ln(T,y,C),I=Ln(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])),b=Math.max(b,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])),b=Math.max(b,P),I=Math.max(I,z)}if(o){if(d){const P=Ln(T/v,R,k)*v;if(b=Math.max(b,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,b=Math.max(b,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,b=Math.max(b,z)}}if(x){const P=Ln(D*v,y,C)/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?b:-b),o&&(p?T>D*v?L=(di(a,u)?-N:N)/v:N=(di(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:w+(a?-N:N),height:M+(u?-L:L),x:r[0]*N*(a?-1:1)+_,y:r[1]*L*(u?-1:1)+O}}const Ea={width:0,height:0,x:0,y:0},sS={...Ea,pointerX:0,pointerY:0,aspectRatio:1};function oS(e){return[[0,0],[e.measured.width,e.measured.height]]}function rS(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 iS({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 y={...Ea},C={...sS};const R=tS(a);let k,S=null,j=[],w,M,v;const N=Tc().on("start",L=>{const{nodeLookup:T,transform:D,snapGrid:$,snapToGrid:B,nodeOrigin:b,paneDomNode:I}=n();if(k=T.get(t),!k)return;S=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:_,ySnapped:O}=on(L.sourceEvent,{transform:D,snapGrid:$,snapToGrid:B,containerBounds:S});y={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},C={...y,pointerX:_,pointerY:O,aspectRatio:y.width/y.height},w=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(w=T.get(k.parentId),M=w&&k.extent==="parent"?oS(w):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=rS(z,k,z.origin??b);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,{...y})}).on("drag",L=>{const{transform:T,snapGrid:D,snapToGrid:$,nodeOrigin:B}=n(),b=on(L.sourceEvent,{transform:T,snapGrid:D,snapToGrid:$,containerBounds:S}),I=[];if(!k)return;const{x:_,y:O,width:P,height:z}=y,V={},Z=k.origin??B,{width:Y,height:ee,x:K,y:Q}=nS(C,R,b,u,d,Z,M,v),J=Y!==P,ne=ee!==z,W=K!==_&&J,ie=Q!==O&≠if(!W&&!ie&&!J&&!ne)return;if((W||ie||Z[0]===1||Z[1]===1)&&(V.x=W?K:y.x,V.y=ie?Q:y.y,y.x=V.x,y.y=V.y,j.length>0)){const X=K-_,se=Q-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((J||ne)&&(V.width=J?Y:y.width,V.height=ne?ee:y.height,y.width=V.width,y.height=V.height),w&&k.expandParent){const X=Z[0]*(V.width??0);V.x&&V.x<X&&(y.x=X,C.x=C.x-(V.x-X));const se=Z[1]*(V.height??0);V.y&&V.y<se&&(y.y=se,C.y=C.y-(V.y-se))}const de=eS({width:y.width,prevWidth:P,height:y.height,prevHeight:z,affectsX:R.affectsX,affectsY:R.affectsY}),ae={...y,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,{...y}),o==null||o()});r.call(N)}function c(){r.on(".drag",null)}return{update:l,destroy:c}}var Po={exports:{}},to={},Tn={exports:{}},no={};/**
|
|
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 xi;function lS(){if(xi)return
|
|
9
|
+
*/var xi;function lS(){if(xi)return no;xi=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}}),y=h[0].inst,C=h[1];return r(function(){y.value=m,y.getSnapshot=p,a(y)&&C({inst:y})},[x,m,p]),o(function(){return a(y)&&C({inst:y}),x(function(){a(y)&&C({inst:y})})},[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 no.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,no}var so={};/**
|
|
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 fi;function cS(){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=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var j=arguments.length,w=new Array(j>1?j-1:0),M=1;M<j;M++)w[M-1]=arguments[M];s("error",S,w)}}function s(S,j,w){{var M=t.ReactDebugCurrentFrame,v=M.getStackAddendum();v!==""&&(j+="%s",w=w.concat([v]));var N=w.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,w){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,w=S.value;try{var M=j();return!r(w,M)}catch{return!0}}function h(S,j,w){return j()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",
|
|
17
|
+
*/var fi;function cS(){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=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var j=arguments.length,w=new Array(j>1?j-1:0),M=1;M<j;M++)w[M-1]=arguments[M];s("error",S,w)}}function s(S,j,w){{var M=t.ReactDebugCurrentFrame,v=M.getStackAddendum();v!==""&&(j+="%s",w=w.concat([v]));var N=w.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,w){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,w=S.value;try{var M=j();return!r(w,M)}catch{return!0}}function h(S,j,w){return j()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",C=!y,R=C?h:p,k=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:R;so.useSyncExternalStore=k,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),so}var pi;function ya(){return pi||(pi=1,process.env.NODE_ENV==="production"?Tn.exports=lS():Tn.exports=cS()),Tn.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 mi;function aS(){if(mi)return
|
|
25
|
+
*/var mi;function aS(){if(mi)return to;mi=1;var e=g,t=ya();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 to.useSyncExternalStoreWithSelector=function(u,d,x,p,m){var h=r(null);if(h.current===null){var y={hasValue:!1,value:null};h.current=y}else y=h.current;h=c(function(){function R(M){if(!k){if(k=!0,S=M,M=p(M),m!==void 0&&y.hasValue){var v=y.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,w=x===void 0?null:x;return[function(){return R(d())},w===null?void 0:function(){return R(w())}]},[d,x,p,m]);var C=o(u,h[0],h[1]);return l(function(){y.hasValue=!0,y.value=C},[C]),a(C),C},to}var oo={};/**
|
|
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 hi;function uS(){return hi||(hi=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=ya();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 y=r(null),
|
|
33
|
+
*/var hi;function uS(){return hi||(hi=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=ya();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 y=r(null),C;y.current===null?(C={hasValue:!1,value:null},y.current=C):C=y.current;var R=c(function(){var w=!1,M,v,N=function($){if(!w){w=!0,M=$;var B=m($);if(h!==void 0&&C.hasValue){var b=C.value;if(h(b,B))return v=b,b}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(){C.hasValue=!0,C.value=j},[j]),a(j),j}oo.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),oo}process.env.NODE_ENV==="production"?Po.exports=aS():Po.exports=uS();var dS=Po.exports;const xS=E.getDefaultExportFromCjs(dS),fS={BASE_URL:"/pluto/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},gi=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:()=>{(fS?"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},pS=e=>e?gi(e):gi,{useDebugValue:mS}=g,{useSyncExternalStoreWithSelector:hS}=xS,gS=e=>e;function ja(e,t=gS,n){const s=hS(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return mS(s),s}const Ei=(e,t)=>{const n=pS(e),s=(o,r=t)=>ja(n,o,r);return Object.assign(s,n),s},ES=(e,t)=>e?Ei(e,t):Ei;function Se(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 Ns=g.createContext(null),yS=Ns.Provider,Sa=Te.error001();function pe(e,t){const n=g.useContext(Ns);if(n===null)throw new Error(Sa);return ja(n,e,t)}function he(){const e=g.useContext(Ns);if(e===null)throw new Error(Sa);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const yi={display:"none"},jS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ra="react-flow__node-desc",Ca="react-flow__edge-desc",SS="react-flow__aria-live",RS=e=>e.ariaLiveMessage;function CS({rfId:e}){const t=pe(RS);return i.jsxRuntimeExports.jsx("div",{id:`${SS}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:jS,children:t})}function bS({rfId:e,disableKeyboardA11y:t}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs("div",{id:`${Ra}-${e}`,style:yi,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:`${Ca}-${e}`,style:yi,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(CS,{rfId:e})]})}const wS=e=>e.userSelectionActive?"none":"all";function pr({position:e="top-left",children:t,className:n,style:s,...o}){const r=pe(wS),l=`${e}`.split("-");return i.jsxRuntimeExports.jsx("div",{className:Ce(["react-flow__panel",n,...l]),style:{...s,pointerEvents:r},...o,children:t})}function vS({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:i.jsxRuntimeExports.jsx(pr,{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 _S=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}},An=e=>e.id;function kS(e,t){return Se(e.selectedNodes.map(An),t.selectedNodes.map(An))&&Se(e.selectedEdges.map(An),t.selectedEdges.map(An))}function MS({onSelectionChange:e}){const t=he(),{selectedNodes:n,selectedEdges:s}=pe(_S,kS);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 PS=e=>!!e.onSelectionChangeHandlers;function NS({onSelectionChange:e}){const t=pe(PS);return e||t?i.jsxRuntimeExports.jsx(MS,{onSelectionChange:e}):null}const ba=[0,0],LS={x:0,y:0,zoom:1},TS=["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"],ji=[...TS,"rfId"],AS=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}),Si={translateExtent:fn,nodeOrigin:ba,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function IS(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:o,setTranslateExtent:r,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:a,setPaneClickDistance:u}=pe(AS,Se),d=he();g.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{x.current=Si,c()}),[]);const x=g.useRef(Si);return g.useEffect(()=>{for(const p of ji){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},ji.map(p=>e[p])),null}function Ri(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function $S(e){var s;const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const o=Ri(),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=Ri())!=null&&s.matches?"dark":"light"}const Ci=typeof document<"u"?document:null;function hn(e=null,t={target:Ci,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)||Ci;if(e!==null){const u=p=>{if(o.current=p.ctrlKey||p.metaKey||p.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&bo(p))return!1;const h=wi(p.code,c);r.current.add(p[h]),bi(l,r.current,!1)&&(p.preventDefault(),s(!0))},d=p=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&bo(p))return!1;const h=wi(p.code,c);bi(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 bi(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function wi(e,t){return t.includes(e)?"code":"key"}const DS=()=>{const e=he();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=So(n,t),{width:a,height:u}=Ps(l);return Ro({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=cr(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 bn(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=Qc(t,n);return{x:l.x+o,y:l.y+r}}}),[])};function wa(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)OS(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 OS(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 va(e,t){return wa(e,t)}function _a(e,t){return wa(e,t)}function mt(e,t){return{id:e,type:"select",selected:t}}function Nt(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(mt(r.id,l)))}return s}function vi({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 _i(e){return{id:e.id,type:"remove"}}const ki=e=>Ej(e),zS=e=>Yc(e);function ka(e){return g.forwardRef(e)}const BS=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Mi(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>VS(()=>n(o=>o+BigInt(1))));return BS(()=>{const o=s.get();o.length&&(e(o),s.reset())},[t]),s}function VS(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Ma=g.createContext(null);function FS({children:e}){const t=he(),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(vi({items:m,lookup:p}))},[]),s=Mi(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(vi({items:m,lookup:p}))},[]),r=Mi(o),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:r}),[]);return i.jsxRuntimeExports.jsx(Ma.Provider,{value:l,children:e})}function HS(){const e=g.useContext(Ma);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const ZS=e=>!!e.panZoom;function wt(){const e=DS(),t=he(),n=HS(),s=pe(ZS),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=ki(x)?x:p.get(x.id),y=h.parentId?ea(h.position,h.measured,h.parentId,p,m):h.position,b={id:h.id,position:y,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 zt(b)},u=(x,p,m={replace:!1})=>{l(h=>h.map(y=>{if(y.id===x){const b=typeof p=="function"?p(y):p;return m.replace&&ki(b)?b:{...y,...b}}return y}))},d=(x,p,m={replace:!1})=>{c(h=>h.map(y=>{if(y.id===x){const b=typeof p=="function"?p(y):p;return m.replace&&zS(b)?b:{...y,...b}}return y}))};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,y,b]=m;return{nodes:x.map(R=>({...R})),edges:p.map(R=>({...R})),viewport:{x:h,y,zoom:b}}},deleteElements:async({nodes:x=[],edges:p=[]})=>{const{nodes:m,edges:h,onNodesDelete:y,onEdgesDelete:b,triggerNodeChanges:R,triggerEdgeChanges:k,onDelete:S,onBeforeDelete:j}=t.getState(),{nodes:w,edges:M}=await Sj({nodesToRemove:x,edgesToRemove:p,nodes:m,edges:h,onBeforeDelete:j}),v=M.length>0,N=w.length>0;if(v){const L=M.map(_i);b==null||b(M),k(L)}if(N){const L=w.map(_i);y==null||y(w),R(L)}return(N||v)&&(S==null||S({nodes:w,edges:M})),{deletedNodes:w,deletedEdges:M}},getIntersectingNodes:(x,p=!0,m)=>{const h=ni(x),y=h?x:a(x),b=m!==void 0;return y?(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=zt(b?R:k),j=pn(S,y);return p&&j>0||j>=y.width*y.height}):[]},isNodeIntersecting:(x,p,m=!0)=>{const y=ni(x)?x:a(x);if(!y)return!1;const b=pn(y,p);return m&&b>0||b>=y.width*y.height},updateNode:u,updateNodeData:(x,p,m={replace:!1})=>{u(x,h=>{const y=typeof p=="function"?p(h):p;return m.replace?{...h,data:y}:{...h,data:{...h.data,...y}}},m)},updateEdge:d,updateEdgeData:(x,p,m={replace:!1})=>{d(x,h=>{const y=typeof p=="function"?p(h):p;return m.replace?{...h,data:y}:{...h,data:{...h.data,...y}}},m)},getNodesBounds:x=>{const{nodeLookup:p,nodeOrigin:m}=t.getState();return yj(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 Pi=e=>e.selected,GS={actInsideInputWithModifier:!1},YS=typeof window<"u"?window:void 0;function WS({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=he(),{deleteElements:s}=wt(),o=hn(e,GS),r=hn(t,{target:YS});g.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(Pi),edges:l.filter(Pi)}),n.setState({nodesSelectionActive:!1})}},[o]),g.useEffect(()=>{n.setState({multiSelectionActive:r})},[r])}function XS(e){const t=he();g.useEffect(()=>{const n=()=>{var o,r;if(!e.current)return!1;const s=Ps(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 Ts={position:"absolute",width:"100%",height:"100%",top:0,left:0},KS=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function qS({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.5,panOnScrollMode:r=Et.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:u,minZoom:d,maxZoom:x,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:y,noPanClassName:b,onViewportChange:R,isControlledViewport:k,paneClickDistance:S}){const j=he(),w=g.useRef(null),{userSelectionActive:M,lib:v}=pe(KS,Se),N=hn(p),L=g.useRef();XS(w);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(w.current){L.current=Jj({domNode:w.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:w.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:b,userSelectionActive:M,noWheelClassName:y,lib:v,onTransformChange:T})},[e,t,n,s,o,r,l,c,N,m,b,M,y,v,T]),i.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:w,style:Ts,children:h})}const US=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function QS(){const{userSelectionActive:e,userSelectionRect:t}=pe(US,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 oo=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},JS=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function e0({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Dt.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),y=he(),b=g.useRef(0),R=g.useRef(0),k=g.useRef(),S=g.useRef(new Map),{userSelectionActive:j,elementsSelectable:w,dragging:M}=pe(JS,Se),v=w&&(e||j),N=g.useRef(!1),L=g.useRef(!1),T=()=>{y.setState({userSelectionActive:!1,userSelectionRect:null}),b.current=0,R.current=0},D=P=>{if(N.current){N.current=!1;return}c==null||c(P),y.getState().resetSelectedElements(),y.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,Q,J,ne;const{resetSelectedElements:z,domNode:V,edgeLookup:Z}=y.getState();if(k.current=V==null?void 0:V.getBoundingClientRect(),!w||!e||P.button!==0||P.target!==h.current||!k.current)return;(Q=(K=P.target)==null?void 0:K.setPointerCapture)==null||Q.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,((J=S.current.get(ie.source))==null?void 0:J.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}=qe(P.nativeEvent,k.current);z(),y.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}=y.getState();if(!k.current||!z)return;N.current=!0;const{x:Q,y:J}=qe(P.nativeEvent,k.current),{startX:ne,startY:W}=z,ie={startX:ne,startY:W,x:Q<ne?Q:ne,y:J<W?J:W,width:Math.abs(Q-ne),height:Math.abs(J-W)},de=Wc(Y,ie,Z,n===Dt.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(b.current!==te.size){b.current=te.size;const X=Nt(Y,te,!0);ee(X)}if(R.current!==ae.size){R.current=ae.size;const X=Nt(V,ae);K(X)}y.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}=y.getState();!j&&z&&P.target===h.current&&(D==null||D(P)),b.current>0&&y.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:Ce(["react-flow__pane",{draggable:O,dragging:M,selection:e}]),onClick:v?void 0:oo(D,h),onContextMenu:oo($,h),onWheel:oo(B,h),onPointerEnter:v?void 0:d,onPointerDown:v?C:x,onPointerMove:v?I:x,onPointerUp:v?_:void 0,onPointerLeave:p,ref:h,style:Ts,children:[m,i.jsxRuntimeExports.jsx(QS,{})]})}function Po({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 Pa({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:o,isSelectable:r,nodeClickDistance:l}){const c=he(),[a,u]=g.useState(!1),d=g.useRef();return g.useEffect(()=>{d.current=zj({getStoreItems:()=>c.getState(),onNodeMouseDown:x=>{Po({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 t0=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Na(){const e=he();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=t0(l),m=o?r[0]:5,h=o?r[1]:5,y=n.direction.x*m*n.factor,b=n.direction.y*h*n.factor;for(const[,R]of u){if(!p(R))continue;let k={x:R.internals.positionAbsolute.x+y,y:R.internals.positionAbsolute.y+b};o&&(k=Ms(k,r));const{position:S,positionAbsolute:j}=Xc({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 pr=g.createContext(null),n0=pr.Provider;pr.Consumer;const La=()=>g.useContext(pr),s0=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),o0=(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===Rt.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 r0({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,y=e==="target",b=he(),R=La(),{connectOnClick:k,noPanClassName:S,rfId:j}=pe(s0,Se),{connectingFrom:w,connectingTo:M,clickConnecting:v,isPossibleEndHandle:N,connectionInProcess:L,valid:T}=pe(o0(R,h,e),Se);R||(I=(C=b.getState()).onError)==null||I.call(C,"010",Te.error010());const D=_=>{const{defaultEdgeOptions:O,onConnect:P,hasDefaultEdges:z}=b.getState(),V={...O,..._};if(z){const{edges:Z,setEdges:Y}=b.getState();Y(la(V,Z))}P==null||P(V),c==null||c(V)},$=_=>{if(!R)return;const O=na(_.nativeEvent);if(o&&(O&&_.button===0||!O)){const P=b.getState();ko.onPointerDown(_.nativeEvent,{autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:y,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:()=>b.getState().transform,getFromHandle:()=>b.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:Q}=b.getState();if(!R||!z&&!o)return;if(!z){O==null||O(_.nativeEvent,{nodeId:R,handleId:h,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:R,type:e,id:h}});return}const J=ta(_.target),ne=n||Z,{connection:W,isValid:ie}=ko.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:J,lib:Y,nodeLookup:K});ie&&W&&D(W);const de=structuredClone(Q);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,P==null||P(_,de),b.setState({connectionClickStartHandle:null})};return i.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":R,"data-handlepos":t,"data-id":`${j}-${R}-${h}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,u,{source:!y,target:y,connectable:s,connectablestart:o,connectableend:r,clickconnecting:v,connectingfrom:w,connectingto:M,valid:T,connectionindicator:s&&(!L||N)&&(L?r:o)}]),onMouseDown:$,onTouchStart:$,onClick:k?B:void 0,ref:m,...p,children:a})}const gn=g.memo(ka(r0));function i0({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(gn,{type:"source",position:n,isConnectable:t})]})}function l0({data:e,isConnectable:t,targetPosition:n=G.Top,sourcePosition:s=G.Bottom}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(gn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,i.jsxRuntimeExports.jsx(gn,{type:"source",position:s,isConnectable:t})]})}function c0(){return null}function a0({data:e,isConnectable:t,targetPosition:n=G.Top}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(gn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ds={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ni={input:i0,default:l0,output:a0,group:c0};function u0(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 d0=e=>{const{width:t,height:n,x:s,y:o}=Cn(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 x0({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=he(),{width:o,height:r,transformString:l,userSelectionActive:c}=pe(d0,Se),a=Na(),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(ds,p.key)&&a({direction:ds[p.key],factor:p.shiftKey?4:1})};return i.jsxRuntimeExports.jsx("div",{className:Ce(["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 Li=typeof window<"u"?window:void 0,f0=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Ta({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:y,zoomActivationKeyCode:b,elementsSelectable:R,zoomOnScroll:k,zoomOnPinch:S,panOnScroll:j,panOnScrollSpeed:w,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(f0),Y=hn(u,{target:Li}),ee=hn(y,{target:Li}),K=ee||N,Q=ee||j,J=d&&K!==!0,ne=Y||Z||J;return WS({deleteKeyCode:a,multiSelectionKeyCode:h}),i.jsxRuntimeExports.jsx(qS,{onPaneContextMenu:r,elementsSelectable:R,zoomOnScroll:k,zoomOnPinch:S,panOnScroll:Q,panOnScrollSpeed:w,panOnScrollMode:M,zoomOnDoubleClick:v,panOnDrag:!Y&&K,defaultViewport:L,translateExtent:T,minZoom:D,maxZoom:$,zoomActivationKeyCode:b,preventScrolling:B,noWheelClassName:I,noPanClassName:_,onViewportChange:P,isControlledViewport:z,paneClickDistance:c,children:i.jsxRuntimeExports.jsxs(e0,{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:J,children:[e,V&&i.jsxRuntimeExports.jsx(x0,{onSelectionContextMenu:C,noPanClassName:_,disableKeyboardA11y:O})]})})}Ta.displayName="FlowRenderer";const p0=g.memo(Ta),m0=e=>t=>e?Wc(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 h0(e){return pe(g.useCallback(m0(e),[e]),Se)}const g0=e=>e.updateNodeInternals;function E0(){const e=pe(g0),[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 y0({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const o=he(),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 j0({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:y,nodeTypes:b,nodeExtent:R,nodeClickDistance:k,onError:S}){const{node:j,internals:w,isParent:M}=pe(W=>{const ie=W.nodeLookup.get(e),de=W.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:de}},Se);let v=j.type||"default",N=(b==null?void 0:b[v])||Ni[v];N===void 0&&(S==null||S("003",Te.error003(v)),v="default",N=Ni.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=he(),C=Jc(j),I=y0({node:j,nodeType:v,hasDimensions:C,resizeObserver:x}),_=Pa({nodeRef:I,disabled:j.hidden||!L,noDragClassName:p,handleSelector:j.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:k}),O=Na();if(j.hidden)return null;const P=tt(j),z=u0(j),V=T||L||t||n||s||o,Z=n?W=>n(W,{...w.userNode}):void 0,Y=s?W=>s(W,{...w.userNode}):void 0,ee=o?W=>o(W,{...w.userNode}):void 0,K=r?W=>r(W,{...w.userNode}):void 0,Q=l?W=>l(W,{...w.userNode}):void 0,J=W=>{const{selectNodesOnDrag:ie,nodeDragThreshold:de}=B.getState();T&&(!ie||!L||de>0)&&Po({id:e,store:B,nodeRef:I}),t&&t(W,{...w.userNode})},ne=W=>{if(!(bo(W.nativeEvent)||h))if(Hc.includes(W.key)&&T){const ie=W.key==="Escape";Po({id:e,store:B,unselect:ie,nodeRef:I})}else L&&j.selected&&Object.prototype.hasOwnProperty.call(ds,W.key)&&(B.setState({ariaLiveMessage:`Moved selected node ${W.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~w.positionAbsolute.x}, y: ${~~w.positionAbsolute.y}`}),O({direction:ds[W.key],factor:W.shiftKey?4:1}))};return i.jsxRuntimeExports.jsx("div",{className:Ce(["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:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.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:J,onDoubleClick:Q,onKeyDown:$?ne:void 0,tabIndex:$?0:void 0,role:$?"button":void 0,"aria-describedby":h?void 0:`${Ra}-${y}`,"aria-label":j.ariaLabel,children:i.jsxRuntimeExports.jsx(n0,{value:e,children:i.jsxRuntimeExports.jsx(N,{id:e,data:j.data,type:v,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.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:w.z,parentId:j.parentId,...P})})})}const S0=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Aa(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,onError:r}=pe(S0,Se),l=h0(e.onlyRenderVisibleElements),c=E0();return i.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ts,children:l.map(a=>i.jsxRuntimeExports.jsx(j0,{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))})}Aa.displayName="NodeRenderer";const R0=g.memo(Aa);function C0(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&&bj({sourceNode:r,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(o.id)}return s},[e]),Se)}const b0=({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"}),w0=({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"}),Ti={[ls.Arrow]:b0,[ls.ArrowClosed]:w0};function v0(e){const t=he();return g.useMemo(()=>{var o,r;return Object.prototype.hasOwnProperty.call(Ti,e)?Ti[e]:((r=(o=t.getState()).onError)==null||r.call(o,"009",Te.error009(e)),null)},[e])}const _0=({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=v0(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},Ia=({defaultColor:e,rfId:t})=>{const n=pe(r=>r.edges),s=pe(r=>r.defaultEdgeOptions),o=g.useMemo(()=>Nj(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(_0,{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};Ia.displayName="MarkerDefinitions";var k0=g.memo(Ia);function $a({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=Ce(["react-flow__edge-textwrapper",u]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const y=h.current.getBBox();p({x:y.x,y:y.y,width:y.width,height:y.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]})}$a.displayName="EdgeText";const M0=g.memo($a);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:Ce(["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(M0,{x:n,y:s,label:o,labelStyle:r,labelShowBg:l,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:u}):null]})}function Ai({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 Da({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:s,targetY:o,targetPosition:r=G.Top}){const[l,c]=Ai({pos:n,x1:e,y1:t,x2:s,y2:o}),[a,u]=Ai({pos:r,x1:s,y1:o,x2:e,y2:t}),[d,x,p,m]=sa({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 Oa(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:y,markerStart:b,interactionWidth:R})=>{const[k,S,j]=Da({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:r,targetPosition:c}),w=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:w,path:k,labelX:S,labelY:j,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:y,markerStart:b,interactionWidth:R})})}const P0=Oa({isInternal:!1}),za=Oa({isInternal:!0});P0.displayName="SimpleBezierEdge";za.displayName="SimpleBezierEdgeInternal";function Ba(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:y,markerStart:b,pathOptions:R,interactionWidth:k})=>{const[S,j,w]=wo({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:w,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,markerEnd:y,markerStart:b,interactionWidth:k})})}const Va=Ba({isInternal:!1}),Fa=Ba({isInternal:!0});Va.displayName="SmoothStepEdge";Fa.displayName="SmoothStepEdgeInternal";function Ha(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 N0=Ha({isInternal:!1}),Za=Ha({isInternal:!0});N0.displayName="StepEdge";Za.displayName="StepEdgeInternal";function Ga(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:y})=>{const[b,R,k]=ca({sourceX:n,sourceY:s,targetX:o,targetY:r}),S=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:S,path:b,labelX:R,labelY:k,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,markerEnd:m,markerStart:h,interactionWidth:y})})}const L0=Ga({isInternal:!1}),Ya=Ga({isInternal:!0});L0.displayName="StraightEdge";Ya.displayName="StraightEdgeInternal";function Wa(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:y,markerStart:b,pathOptions:R,interactionWidth:k})=>{const[S,j,w]=oa({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:w,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:y,markerStart:b,interactionWidth:k})})}const T0=Wa({isInternal:!1}),Xa=Wa({isInternal:!0});T0.displayName="BezierEdge";Xa.displayName="BezierEdgeInternal";const Ii={default:Xa,straight:Ya,step:Za,smoothstep:Fa,simplebezier:za},$i={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},A0=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,I0=(e,t,n)=>n===G.Top?e-t:n===G.Bottom?e+t:e,Di="react-flow__edgeupdater";function Oi({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:Ce([Di,`${Di}-${c}`]),cx:A0(t,s,e),cy:I0(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function $0({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=he(),y=(j,w)=>{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=w.type==="target";p(!0),d==null||d(j,n,w.type);const V=(Y,ee)=>{p(!1),x==null||x(Y,n,w.type,ee)},Z=Y=>u==null?void 0:u(n,Y);ko.onPointerDown(j.nativeEvent,{autoPanOnConnect:M,connectionMode:L,connectionRadius:T,domNode:v,handleId:w.id,nodeId:w.nodeId,nodeLookup:I,isTarget:z,edgeUpdaterType:w.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})},b=j=>y(j,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),R=j=>y(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(Oi,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:b,onMouseEnter:k,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&i.jsxRuntimeExports.jsx(Oi,{position:a,centerX:r,centerY:l,radius:t,onMouseDown:R,onMouseEnter:k,onMouseOut:S,type:"target"})]})}function D0({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:y,noPanClassName:b,onError:R,disableKeyboardA11y:k}){let S=pe(te=>te.edgeLookup.get(e));const j=pe(te=>te.defaultEdgeOptions);S=j?{...j,...S}:S;let w=S.type||"default",M=(y==null?void 0:y[w])||Ii[w];M===void 0&&(R==null||R("011",Te.error011(w)),w="default",M=Ii.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=he(),{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,...$i};const fe=Pj({id:e,sourceNode:X,targetNode:se,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:te.connectionMode,onError:R});return{zIndex:Cj({selected:S.selected,zIndex:S.zIndex,sourceNode:X,targetNode:se,elevateOnSelect:te.elevateEdgesOnSelect}),...fe||$i}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),Se),ee=g.useMemo(()=>S.markerStart?`url('#${vo(S.markerStart,h)}')`:void 0,[S.markerStart,h]),K=g.useMemo(()=>S.markerEnd?`url('#${vo(S.markerEnd,h)}')`:void 0,[S.markerEnd,h]);if(S.hidden||O===null||P===null||z===null||V===null)return null;const Q=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)},J=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&&Hc.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:Ce(["react-flow__edge",`react-flow__edge-${w}`,S.className,b,{selected:S.selected,animated:S.animated,inactive:!L&&!o,updating:D,selectable:L}]),onClick:Q,onDoubleClick:J,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?`${Ca}-${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($0,{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 O0=e=>({width:e.width,height:e.height,edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ka({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:y}){const{edgesFocusable:b,edgesReconnectable:R,elementsSelectable:k,onError:S}=pe(O0,Se),j=C0(t);return i.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[i.jsxRuntimeExports.jsx(k0,{defaultColor:e,rfId:n}),j.map(w=>i.jsxRuntimeExports.jsx(D0,{id:w,edgesFocusable:b,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:y},w))]})}Ka.displayName="EdgeRenderer";const z0=g.memo(Ka),B0=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function V0({children:e}){const t=pe(B0);return i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function F0(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 H0=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Z0(e){const t=pe(H0),n=he();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function G0(e){return e.connection.inProgress?{...e.connection,to:bn(e.connection.to,e.transform)}:{...e.connection}}function Y0(e){return G0}function W0(e){const t=Y0();return pe(t,Se)}const X0=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function K0({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:o,width:r,height:l,isValid:c,inProgress:a}=pe(X0,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:Ce(["react-flow__connection",Gc(c)]),children:i.jsxRuntimeExports.jsx(qa,{style:t,type:n,CustomComponent:s,isValid:c})})})}const qa=({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}=W0();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:Gc(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]=oa(h);break;case rt.SimpleBezier:[m]=Da(h);break;case rt.Step:[m]=wo({...h,borderRadius:0});break;case rt.SmoothStep:[m]=wo(h);break;default:[m]=ca(h)}return i.jsxRuntimeExports.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};qa.displayName="ConnectionLine";const q0={};function zi(e=q0){const t=g.useRef(e),n=he();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 U0(){const e=he(),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 Ua({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:y,connectionLineComponent:b,connectionLineContainerStyle:R,selectionKeyCode:k,selectionOnDrag:S,selectionMode:j,multiSelectionKeyCode:w,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:Q,onPaneMouseMove:J,onPaneMouseLeave:ne,onPaneScroll:W,onPaneContextMenu:ie,paneClickDistance:de,nodeClickDistance:ae,onEdgeContextMenu:te,onEdgeMouseEnter:X,onEdgeMouseMove:se,onEdgeMouseLeave:fe,reconnectRadius:Me,onReconnect:We,onReconnectStart:$s,onReconnectEnd:Ds,noDragClassName:Xt,noWheelClassName:Os,noPanClassName:Kt,disableKeyboardA11y:qt,nodeExtent:zs,rfId:Ut,viewport:Qt,onViewportChange:vn}){return zi(e),zi(t),U0(),F0(n),Z0(Qt),i.jsxRuntimeExports.jsx(p0,{onPaneClick:K,onPaneMouseEnter:Q,onPaneMouseMove:J,onPaneMouseLeave:ne,onPaneContextMenu:ie,onPaneScroll:W,paneClickDistance:de,deleteKeyCode:N,selectionKeyCode:k,selectionOnDrag:S,selectionMode:j,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:w,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:Xt,noWheelClassName:Os,noPanClassName:Kt,disableKeyboardA11y:qt,onViewportChange:vn,isControlledViewport:!!Qt,children:i.jsxRuntimeExports.jsxs(V0,{children:[i.jsxRuntimeExports.jsx(z0,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:We,onReconnectStart:$s,onReconnectEnd:Ds,onlyRenderVisibleElements:L,onEdgeContextMenu:te,onEdgeMouseEnter:X,onEdgeMouseMove:se,onEdgeMouseLeave:fe,reconnectRadius:Me,defaultMarkerColor:_,noPanClassName:Kt,disableKeyboardA11y:qt,rfId:Ut}),i.jsxRuntimeExports.jsx(K0,{style:y,type:h,component:b,containerStyle:R}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),i.jsxRuntimeExports.jsx(R0,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:r,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ae,onlyRenderVisibleElements:L,noPanClassName:Kt,noDragClassName:Xt,disableKeyboardA11y:qt,nodeExtent:zs,rfId:Ut}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Ua.displayName="GraphView";const Q0=g.memo(Ua),Bi=({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??[],y=c??[0,0],b=a??fn;ua(x,p,m),_o(h,u,d,{nodeOrigin:y,nodeExtent:b,elevateNodesOnSelect:!1});let R=[0,0,1];if(l&&o&&r){const k=Cn(u,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:S,y:j,zoom:w}=cr(k,o,r,.5,2,.1);R=[S,j,w]}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:fn,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Rt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,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:{...Zc},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:as,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},J0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a})=>ES((u,d)=>({...Bi({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:y}=d();_o(x,p,m,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:y,checkEquality:!0}),u({nodes:x})},setEdges:x=>{const{connectionLookup:p,edgeLookup:m}=d();ua(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:y,fitViewOnInit:b,fitViewDone:R,fitViewOnInitOptions:k,domNode:S,nodeOrigin:j,nodeExtent:w,debug:M,fitViewSync:v}=d(),{changes:N,updatedInternals:L}=$j(x,h,y,S,j,w);if(L){if(Tj(h,y,{nodeOrigin:j,nodeExtent:w}),p.triggerFitView){let T=R;!R&&b&&(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[y,b]of x){const R={id:y,type:"position",position:b.position,dragging:p};b!=null&&b.expandParent&&(b!=null&&b.parentId)&&R.position&&(m.push({id:y,parentId:b.parentId,rect:{...b.internals.positionAbsolute,width:b.measured.width,height:b.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:y,parentLookup:b,nodeOrigin:R}=d(),k=xr(m,y,b,R);h.push(...k)}d().triggerNodeChanges(h)},triggerNodeChanges:x=>{const{onNodesChange:p,setNodes:m,nodes:h,hasDefaultNodes:y,debug:b}=d();if(x!=null&&x.length){if(y){const R=va(x,h);m(R)}b&&console.log("React Flow: trigger node changes",x),p==null||p(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:p,setEdges:m,edges:h,hasDefaultEdges:y,debug:b}=d();if(x!=null&&x.length){if(y){const R=_a(x,h);m(R)}b&&console.log("React Flow: trigger edge changes",x),p==null||p(x)}},addSelectedNodes:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:y,triggerEdgeChanges:b}=d();if(p){const R=x.map(k=>mt(k,!0));y(R);return}y(Nt(h,new Set([...x]),!0)),b(Nt(m))},addSelectedEdges:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:y,triggerEdgeChanges:b}=d();if(p){const R=x.map(k=>mt(k,!0));b(R);return}b(Nt(m,new Set([...x]))),y(Nt(h,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:p}={})=>{const{edges:m,nodes:h,nodeLookup:y,triggerNodeChanges:b,triggerEdgeChanges:R}=d(),k=x||h,S=p||m,j=k.map(M=>{const v=y.get(M.id);return v&&(v.selected=!1),mt(M.id,!1)}),w=S.map(M=>mt(M.id,!1));b(j),R(w)},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(),y=p.reduce((R,k)=>k.selected?[...R,mt(k.id,!1)]:R,[]),b=x.reduce((R,k)=>k.selected?[...R,mt(k.id,!1)]:R,[]);m(y),h(b)},setNodeExtent:x=>{const{nodes:p,nodeLookup:m,parentLookup:h,nodeOrigin:y,elevateNodesOnSelect:b,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]||(_o(p,m,h,{nodeOrigin:y,nodeExtent:x,elevateNodesOnSelect:b,checkEquality:!1}),u({nodeExtent:x}))},panBy:x=>{const{transform:p,width:m,height:h,panZoom:y,translateExtent:b}=d();return Dj({delta:x,panZoom:y,transform:p,translateExtent:b,width:m,height:h})},fitView:x=>{const{panZoom:p,width:m,height:h,minZoom:y,maxZoom:b,nodeLookup:R}=d();if(!p)return Promise.resolve(!1);const k=So(R,x);return Ro({nodes:k,width:m,height:h,panZoom:p,minZoom:y,maxZoom:b},x)},fitViewSync:x=>{const{panZoom:p,width:m,height:h,minZoom:y,maxZoom:b,nodeLookup:R}=d();if(!p)return!1;const k=So(R,x);return Ro({nodes:k,width:m,height:h,panZoom:p,minZoom:y,maxZoom:b},x),k.size>0},cancelConnection:()=>{u({connection:{...Zc}})},updateConnection:x=>{u({connection:x})},reset:()=>u({...Bi()})}),Object.is);function Qa({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:o,initialHeight:r,fitView:l,nodeOrigin:c,nodeExtent:a,children:u}){const[d]=g.useState(()=>J0({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a}));return i.jsxRuntimeExports.jsx(yS,{value:d,children:i.jsxRuntimeExports.jsx(FS,{children:u})})}function e1({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:o,width:r,height:l,fitView:c,nodeOrigin:a,nodeExtent:u}){return g.useContext(Ls)?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:e}):i.jsxRuntimeExports.jsx(Qa,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:o,initialWidth:r,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:u,children:e})}const t1={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function n1({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:y,onClickConnectStart:b,onClickConnectEnd:R,onNodeMouseEnter:k,onNodeMouseMove:S,onNodeMouseLeave:j,onNodeContextMenu:w,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:Q,deleteKeyCode:J="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:ie=Dt.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:ae=us()?"Meta":"Control",zoomActivationKeyCode:te=us()?"Meta":"Control",snapToGrid:X,snapGrid:se,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:Me,nodesDraggable:We,nodesConnectable:$s,nodesFocusable:Ds,nodeOrigin:Xt=ba,edgesFocusable:Os,edgesReconnectable:Kt,elementsSelectable:qt=!0,defaultViewport:zs=LS,minZoom:Ut=.5,maxZoom:Qt=2,translateExtent:vn=fn,preventScrolling:xx=!0,nodeExtent:Bs,defaultMarkerColor:fx="#b1b1b7",zoomOnScroll:px=!0,zoomOnPinch:mx=!0,panOnScroll:hx=!1,panOnScrollSpeed:gx=.5,panOnScrollMode:Ex=Et.Free,zoomOnDoubleClick:yx=!0,panOnDrag:jx=!0,onPaneClick:Sx,onPaneMouseEnter:Rx,onPaneMouseMove:Cx,onPaneMouseLeave:bx,onPaneScroll:wx,onPaneContextMenu:vx,paneClickDistance:Rr=0,nodeClickDistance:_x=0,children:kx,onReconnect:Mx,onReconnectStart:Px,onReconnectEnd:Nx,onEdgeContextMenu:Lx,onEdgeDoubleClick:Tx,onEdgeMouseEnter:Ax,onEdgeMouseMove:Ix,onEdgeMouseLeave:$x,reconnectRadius:Dx=10,onNodesChange:Ox,onEdgesChange:zx,noDragClassName:Bx="nodrag",noWheelClassName:Vx="nowheel",noPanClassName:Cr="nopan",fitView:br,fitViewOptions:Fx,connectOnClick:Hx,attributionPosition:Zx,proOptions:Gx,defaultEdgeOptions:Yx,elevateNodesOnSelect:Wx,elevateEdgesOnSelect:Xx,disableKeyboardA11y:wr=!1,autoPanOnConnect:Kx,autoPanOnNodeDrag:qx,autoPanSpeed:Ux,connectionRadius:Qx,isValidConnection:Jx,onError:ef,style:tf,id:vr,nodeDragThreshold:nf,viewport:sf,onViewportChange:of,width:rf,height:lf,colorMode:cf="light",debug:af,...uf},df){const Vs=vr||"1",xf=$S(cf);return i.jsxRuntimeExports.jsx("div",{...uf,style:{...tf,...t1},ref:df,className:Ce(["react-flow",o,xf]),"data-testid":"rf__wrapper",id:vr,children:i.jsxRuntimeExports.jsxs(e1,{nodes:e,edges:t,width:rf,height:lf,fitView:br,nodeOrigin:Xt,nodeExtent:Bs,children:[i.jsxRuntimeExports.jsx(Q0,{onInit:u,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:k,onNodeMouseMove:S,onNodeMouseLeave:j,onNodeContextMenu:w,onNodeDoubleClick:M,nodeTypes:r,edgeTypes:l,connectionLineType:Y,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:Q,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:ie,deleteKeyCode:J,multiSelectionKeyCode:ae,panActivationKeyCode:de,zoomActivationKeyCode:te,onlyRenderVisibleElements:fe,defaultViewport:zs,translateExtent:vn,minZoom:Ut,maxZoom:Qt,preventScrolling:xx,zoomOnScroll:px,zoomOnPinch:mx,zoomOnDoubleClick:yx,panOnScroll:hx,panOnScrollSpeed:gx,panOnScrollMode:Ex,panOnDrag:jx,onPaneClick:Sx,onPaneMouseEnter:Rx,onPaneMouseMove:Cx,onPaneMouseLeave:bx,onPaneScroll:wx,onPaneContextMenu:vx,paneClickDistance:Rr,nodeClickDistance:_x,onSelectionContextMenu:O,onSelectionStart:P,onSelectionEnd:z,onReconnect:Mx,onReconnectStart:Px,onReconnectEnd:Nx,onEdgeContextMenu:Lx,onEdgeDoubleClick:Tx,onEdgeMouseEnter:Ax,onEdgeMouseMove:Ix,onEdgeMouseLeave:$x,reconnectRadius:Dx,defaultMarkerColor:fx,noDragClassName:Bx,noWheelClassName:Vx,noPanClassName:Cr,rfId:Vs,disableKeyboardA11y:wr,nodeExtent:Bs,viewport:sf,onViewportChange:of}),i.jsxRuntimeExports.jsx(IS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:m,onConnectStart:h,onConnectEnd:y,onClickConnectStart:b,onClickConnectEnd:R,nodesDraggable:We,nodesConnectable:$s,nodesFocusable:Ds,edgesFocusable:Os,edgesReconnectable:Kt,elementsSelectable:qt,elevateNodesOnSelect:Wx,elevateEdgesOnSelect:Xx,minZoom:Ut,maxZoom:Qt,nodeExtent:Bs,onNodesChange:Ox,onEdgesChange:zx,snapToGrid:X,snapGrid:se,connectionMode:Z,translateExtent:vn,connectOnClick:Hx,defaultEdgeOptions:Yx,fitView:br,fitViewOptions:Fx,onNodesDelete:T,onEdgesDelete:D,onDelete:$,onNodeDragStart:v,onNodeDrag:N,onNodeDragStop:L,onSelectionDrag:I,onSelectionDragStart:C,onSelectionDragStop:_,onMove:d,onMoveStart:x,onMoveEnd:p,noPanClassName:Cr,nodeOrigin:Xt,rfId:Vs,autoPanOnConnect:Kx,autoPanOnNodeDrag:qx,autoPanSpeed:Ux,onError:ef,connectionRadius:Qx,isValidConnection:Jx,selectNodesOnDrag:Me,nodeDragThreshold:nf,onBeforeDelete:V,paneClickDistance:Rr,debug:af}),i.jsxRuntimeExports.jsx(NS,{onSelectionChange:B}),kx,i.jsxRuntimeExports.jsx(vS,{proOptions:Gx,position:Zx}),i.jsxRuntimeExports.jsx(bS,{rfId:Vs,disableKeyboardA11y:wr})]})})}var s1=ka(n1);function o1(){const e=he();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 r1({onStart:e,onChange:t,onEnd:n}){const s=he();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function i1({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:Ce(["react-flow__background-pattern",n,s])})}function l1({radius:e,className:t}){return i.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Ce(["react-flow__background-pattern","dots",t])})}var ct;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ct||(ct={}));const c1={[ct.Dots]:1,[ct.Lines]:1,[ct.Cross]:6},a1=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ja({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(a1,Se),h=s||c1[t],y=t===ct.Dots,b=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],w=b?[S,S]:k,M=[j[0]*p[2]||1+w[0]/2,j[1]*p[2]||1+w[1]/2],v=`${m}${e||""}`;return i.jsxRuntimeExports.jsxs("svg",{className:Ce(["react-flow__background",u]),style:{...a,...Ts,"--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:y?i.jsxRuntimeExports.jsx(l1,{radius:S/2,className:d}):i.jsxRuntimeExports.jsx(i1,{dimensions:w,lineWidth:o,variant:t,className:d})}),i.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${v})`})]})}Ja.displayName="Background";const u1=g.memo(Ja);function d1(){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 x1(){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 f1(){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 p1(){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 m1(){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 In({children:e,className:t,...n}){return i.jsxRuntimeExports.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const h1=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function eu({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=he(),{isInteractive:y,minZoomReached:b,maxZoomReached:R}=pe(h1,Se),{zoomIn:k,zoomOut:S,fitView:j}=wt(),w=()=>{k(),r==null||r()},M=()=>{S(),l==null||l()},v=()=>{j(o),c==null||c()},N=()=>{h.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),a==null||a(!y)},L=p==="horizontal"?"horizontal":"vertical";return i.jsxRuntimeExports.jsxs(fr,{className:Ce(["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(In,{onClick:w,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:R,children:i.jsxRuntimeExports.jsx(d1,{})}),i.jsxRuntimeExports.jsx(In,{onClick:M,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b,children:i.jsxRuntimeExports.jsx(x1,{})})]}),n&&i.jsxRuntimeExports.jsx(In,{className:"react-flow__controls-fitview",onClick:v,title:"fit view","aria-label":"fit view",children:i.jsxRuntimeExports.jsx(f1,{})}),s&&i.jsxRuntimeExports.jsx(In,{className:"react-flow__controls-interactive",onClick:N,title:"toggle interactivity","aria-label":"toggle interactivity",children:y?i.jsxRuntimeExports.jsx(m1,{}):i.jsxRuntimeExports.jsx(p1,{})}),d]})}eu.displayName="Controls";g.memo(eu);function g1({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:y}=r||{},b=l||h||y;return i.jsxRuntimeExports.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:p},u]),x:t,y:n,rx:d,ry:d,width:s,height:o,style:{fill:b,stroke:c,strokeWidth:a},shapeRendering:x,onClick:m?R=>m(R,e):void 0})}const E1=g.memo(g1),y1=e=>e.nodes.map(t=>t.id),ro=e=>e instanceof Function?e:()=>e;function j1({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:r=E1,onClick:l}){const c=pe(y1,Se),a=ro(t),u=ro(e),d=ro(n),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:c.map(p=>i.jsxRuntimeExports.jsx(R1,{id:p,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:r,onClick:l,shapeRendering:x},p))})}function S1({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 y=h.nodeLookup.get(e),{x:b,y:R}=y.internals.positionAbsolute,{width:k,height:S}=tt(y);return{node:y,x:b,y:R,width:k,height:S}},Se);return!u||u.hidden||!Jc(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 R1=g.memo(S1);var C1=g.memo(j1);const b1=200,w1=150,v1=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?Uc(Cn(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},_1="react-flow__minimap-desc";function tu({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:y=!1,zoomable:b=!1,ariaLabel:R="React Flow mini map",inversePan:k,zoomStep:S=10,offsetScale:j=5}){const w=he(),M=g.useRef(null),{boundingRect:v,viewBB:N,rfId:L,panZoom:T,translateExtent:D,flowWidth:$,flowHeight:B}=pe(v1,Se),C=(e==null?void 0:e.width)??b1,I=(e==null?void 0:e.height)??w1,_=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,Q=V+Z*2,J=`${_1}-${L}`,ne=g.useRef(0),W=g.useRef();ne.current=P,g.useEffect(()=>{if(M.current&&T)return W.current=Gj({domNode:M.current,panZoom:T,getTransform:()=>w.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:y,zoomStep:S,zoomable:b})},[y,b,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=w.getState().nodeLookup.get(te);h(ae,X)},[]):void 0;return i.jsxRuntimeExports.jsx(fr,{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:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:i.jsxRuntimeExports.jsxs("svg",{width:C,height:I,viewBox:`${Y} ${ee} ${K} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":J,ref:M,onClick:ie,children:[R&&i.jsxRuntimeExports.jsx("title",{id:J,children:R}),i.jsxRuntimeExports.jsx(C1,{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${Q+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"})]})})}tu.displayName="MiniMap";g.memo(tu);function k1({nodeId:e,position:t,variant:n=rn.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:y}){const b=La(),R=typeof e=="string"?e:b,k=he(),S=g.useRef(null),j=n===rn.Line?"right":"bottom-right",w=t??j,M=g.useRef(null);g.useEffect(()=>{if(!(!S.current||!R))return M.current||(M.current=iS({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,...ea({x:T.x??P.position.x,y:T.y??P.position.y},{width:V,height:Z},P.parentId,B,z)}},ee=xr([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:w,boundaries:{minWidth:c,minHeight:a,maxWidth:u,maxHeight:d},keepAspectRatio:x,onResizeStart:m,onResize:h,onResizeEnd:y,shouldResize:p}),()=>{var T;(T=M.current)==null||T.destroy()}},[w,c,a,u,d,x,m,h,y,p]);const v=w.split("-"),N=n===rn.Line?"borderColor":"backgroundColor",L=l?{...o,[N]:l}:o;return i.jsxRuntimeExports.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...v,n,s]),ref:S,style:L,children:r})}g.memo(k1);const M1=(e,t)=>e.map((n,s)=>f.G.translate(n,t[s])),nu=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:f.cssString(t)},...n}),P1=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:f.cssString(t),strokeDasharray:"12,4"},...n}),N1=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:f.cssString(t),strokeDasharray:"12,4,4"},...n}),L1=({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})]})},Vi=15,T1=(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)<Vi||f.G.distance(p,u)<Vi)&&n.push({position:p,direction:m})}r+=a}return n},A1=({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"})},I1=({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"})]})},$1=({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}),mr=(e,t={})=>{const n=({points:s,color:o,...r})=>{const l=at(s),c=T1(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},D1=mr(A1),O1=mr(I1),z1=mr($1),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},su={pipe:nu,electric:P1,secondary:N1,jacketed:L1,hydraulic:D1,pneumatic:O1,data:z1},ou=nu,ru=[{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"}],B1=e=>i.jsxRuntimeExports.jsx(Re.DropdownButton,{columns:[{key:"name",name:"Type"}],data:ru,style:{width:200},entryRenderKey:"name",...e}),hr=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=hr(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)=>As.fromFlow(e,t);class iu{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 As{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=hr(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 iu(d,p)});return new As(t,s,c)}}const F1=({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=Mt({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=dc(f.G.construct(e,t),p,x.getZoom(),!1);return i.jsxRuntimeExports.jsx(ou,{points:m,style:{...c,stroke:f.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},H1=({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),y=f.G.equals(m,h.current),b=f.G.construct(p.targetX,p.targetY),R=g.useRef(b),k=f.G.equals(b,R.current),S=wt(),[j,w,M]=E.useCombinedStateAndRef(()=>c.length>0?c:Mt({sourcePos:m,targetPos:b,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),v=g.useRef(r),N=g.useRef(s),L=E.useDebouncedCallback(a,100,[a]);if(!y||!k){let C=j;const I=f.G.translation(h.current,m),_=f.G.translation(b,R.current);f.G.equals(I,f.G.scale(_,-1),.001)?(h.current=m,R.current=b):(y?k||(C=ag({delta:_,segments:C}),v.current!==r&&(v.current=r,C=Mt({sourcePos:m,targetPos:b,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),Vr({sourcePos:m,targetPos:b,next:C,prev:j})||(C=Mt({sourcePos:m,targetPos:b,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),R.current=b):(C=cg({delta:I,segments:C}),N.current!==s&&(N.current=s,C=Mt({sourcePos:m,targetPos:b,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),Vr({sourcePos:m,targetPos:b,next:C,prev:j})||(C=Mt({sourcePos:m,targetPos:b,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),h.current=m),L(C),w(C))}const T=g.useRef(null),D=E.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=og({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()});w(I)},[]),onEnd:g.useCallback(()=>a(M.current),[a])}),$=dc(m,j,S.getZoom(),!0),B=su[x];return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(B,{points:$,color:u}),d&&Z1($).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)})]})},Z1=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)}),G1=({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}},Y1=()=>!0,W1={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},X1={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},lu={maxZoom:1,minZoom:.5},K1={hideAttribution:!0},cu=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),wn=()=>g.useContext(cu),au=g.memo(({children:e})=>{const{registerNodeRenderer:t}=wn();return g.useEffect(()=>t(e),[t,e]),null});au.displayName="NodeRenderer";const q1=["Backspace","Delete"],U1=E.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 y=E.useMemoDeepEqualProps({visible:m}),[{path:b},,R]=E.use$3({aetherKey:e,type:A.Diagram$1.TYPE,schema:A.diagramStateZ,initialState:{position:a.position,region:f.Eo.ZERO,zoom:a.zoom,...y}});g.useEffect(()=>R(X=>({...X,...y})),[y]);const k=E.use().colors.gray.l9.hex,S=E.useMemoCompare(()=>u??Vo.zoom,E.compareModeConfigs,[u]),{fitView:j}=wt(),w=E.useDebouncedCallback(X=>j(X),50,[j]),M=En(g.useCallback(X=>{x&&w({maxZoom:1}),R(se=>({...se,region:X}))},[R,w,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(gc(X))))},[R,d]);r1({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:We=!0})=>L({symbolKey:X,position:{x:se,y:fe},selected:Me,draggable:We})}),[L]),B=g.useRef(r),C=g.useMemo(()=>(B.current=r,tr(r)),[r]),I=g.useRef(o),_=g.useMemo(()=>(I.current=o,er(o)),[o]),O=g.useCallback(X=>n(Ec(I.current,se=>va(X,se))),[n]),P=g.useCallback(X=>s(Vn(B.current,se=>_a(X,se),k)),[s,k]),z=g.useCallback((X,se)=>s(Vn(B.current,fe=>vj(X,se,fe),k)),[]),V=g.useCallback(X=>{s(Vn(B.current,se=>la(X,se),k))},[s,k]),Z=g.useCallback((X,se)=>{const fe=[...B.current],Me=fe.findIndex(We=>We.key===X);Me!==-1&&(fe[Me]={...fe[Me],segments:se},B.current=fe,s(fe))},[s]),Y=c?W1:X1,ee=E.useSyncedRef(Z),K=g.useMemo(()=>({default:X=>{var se,fe,Me;return i.jsxRuntimeExports.jsx(H1,{...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(We=>ee.current(X.id,We),[X.id])},X.id)}}),[]),Q=E.useHeld({triggers:[["Q"]],loose:!0}),J=g.useRef(null);E.use$1({triggers:S.zoomReset,callback:g.useCallback(({stage:X,cursor:se})=>{const fe=J.current;fe==null||X!=="start"||!f.Eo.contains(fe,se)||j()},[j])});const ne=E.purgeMouse(S.select)[0]??null,W=E.purgeMouse(S.pan)[0]??null,ie=E.purgeMouse(S.zoom)[0]??null,de={selectionOnDrag:ne==null,panOnDrag:W==null,selectionKeyCode:ne,panActivationKeyCode:W,zoomActivationKeyCode:ie},ae=E.useCombinedRefs(J,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(cu.Provider,{value:te,children:i.jsxRuntimeExports.jsx(E.Composite,{path:b,children:m&&i.jsxRuntimeExports.jsx(s1,{...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:hc(a),connectionLineComponent:F1,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:Y1,connectionMode:Rt.Loose,snapGrid:[2,2],snapToGrid:!0,fitViewOptions:lu,selectionMode:Dt.Partial,proOptions:K1,deleteKeyCode:q1,...h,style:{[f.CSS.var("diagram-zoom")]:a.zoom,...h.style},...Y,nodesDraggable:c&&!Q.held,children:t})})})}),Q1=()=>{const{editable:e}=wn();return e?i.jsxRuntimeExports.jsx(u1,{}):null},J1=({children:e,...t})=>i.jsxRuntimeExports.jsx(U.Pack,{direction:"y",borderShade:4,className:f.CSS.BE("diagram","controls"),...t,children:e}),eR=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=wn();return i.jsxRuntimeExports.jsx(E.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:f.K.RIGHT_CENTER,tooltip:n?i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Disable edit mode"}):i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?i.jsxRuntimeExports.jsx(E.e4.EditOff,{}):i.jsxRuntimeExports.jsx(E.e4.Edit,{})})},tR=({onClick:e,...t})=>{const{fitView:n}=wt(),{fitViewOnResize:s,setFitViewOnResize:o}=wn();return i.jsxRuntimeExports.jsx(E.ToggleIcon,{onClick:r=>{n(lu),e==null||e(r)},value:s,onChange:r=>o(r),rightClickToggle:!0,tooltip:i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:f.K.RIGHT_CENTER,variant:"outlined",...t,children:i.jsxRuntimeExports.jsx(E.e4.Expand,{})})},nR=e=>i.jsxRuntimeExports.jsx(Qa,{children:i.jsxRuntimeExports.jsx(U1,{...e})}),sR=Object.freeze(Object.defineProperty({__proto__:null,Background:Q1,Controls:J1,DefaultPath:ou,Diagram:nR,FitViewControl:tR,HandleLayout:iu,NodeLayout:As,NodeRenderer:au,PATHS:su,PATH_TYPES:ru,SelectPathType:B1,ToggleEditControl:eR,alignNodes:fg,calcPath:at,edgeConverter:Vn,edgeZ:dg,nodeConverter:Ec,nodeZ:xg,offsetPath:M1,rfEdgeDataZ:fc,selectNode:hr,selectNodeBox:Ne,selectNodeLayout:V1,translateEdgesBackward:mc,translateEdgesForward:tr,translateNodesBackward:pc,translateNodesForward:er,translateViewportBackward:gc,translateViewportForward:hc,use:G1,useContext:wn,viewportZ:ug},Symbol.toStringTag,{value:"Module"})),oR=E.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:o=i.jsxRuntimeExports.jsx(E.Text$2.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:r,telem:l,...c})=>{const a=E.useMemoDeepEqualProps({font:t,color:r,telem:l,visible:s}),[,{scrolling:u,empty:d},x]=E.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=En(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(E.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(E.e4.Dynamic,{})})})}),rR=Object.freeze(Object.defineProperty({__proto__:null,Log:oR},Symbol.toStringTag,{value:"Module"})),iR=({value:e,showOuter:t=!0,showInner:n,onChange:s})=>{const{outer:o}=e,r=l=>()=>s({...e,...l});return t?i.jsxRuntimeExports.jsxs(U.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(U.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(lt,{selected:o==="left",onClick:r({outer:"left"})}),i.jsxRuntimeExports.jsx(Fi,{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(Fi,{className:f.CSS.B("orientation-control"),value:e,onChange:s})},Fi=({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(U.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(U.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(E.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(U.Space,{direction:t,align:"stretch",className:f.CSS(f.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),ft=({showOuter:e,showInner:t,...n})=>i.jsxRuntimeExports.jsx(me,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:o})=>{var r;return i.jsxRuntimeExports.jsx(iR,{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}})})}}),vt=({path:e,omit:t=[]})=>i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(me,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>i.jsxRuntimeExports.jsx(E.Text$1,{selectOnFocus:!0,...n})}),i.jsxRuntimeExports.jsx(Tt,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px"},padHelpText:!1}),i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...n})}),i.jsxRuntimeExports.jsx(me,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>i.jsxRuntimeExports.jsx(hs,{...n})}),i.jsxRuntimeExports.jsx(me,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:n=>i.jsxRuntimeExports.jsx(hl,{...n,yDirection:"down"})})]}),Ze=e=>i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...o})=>i.jsxRuntimeExports.jsx(E.Swatch,{value:t??f.ZERO.setAlpha(1).rgba255,onChange:r=>n(r.rgba255),...o,bordered:!0})}),uu=e=>i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:t=>i.jsxRuntimeExports.jsx(E.Numeric,{dragScale:1,bounds:{lower:.5,upper:15},...t})}),ke=({omit:e})=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{omit:e,path:"label"}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Ze,{path:"color",optional:!0}),i.jsxRuntimeExports.jsx(me,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:t=>i.jsxRuntimeExports.jsx(E.Switch$1,{...t})}),i.jsxRuntimeExports.jsx(uu,{path:"scale"})]})]}),i.jsxRuntimeExports.jsx(ft,{path:""})]}),lR=({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(Es,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},gr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],we=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(lR,{path:""});default:return i.jsxRuntimeExports.jsx(ke,{})}},[]),t=je.useStatic({tabs:gr,content:e});return i.jsxRuntimeExports.jsx(je.Tabs,{...t})},ht={y:2,x:.25},ln={lower:0,upper:2e3},Hi={lower:0,upper:51},du=({includeBorderRadius:e=!1})=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ze,{path:"color"}),i.jsxRuntimeExports.jsx(Ze,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(me,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:t,dragScale:ht,bounds:Hi,endContent:"%",...n})}),i.jsxRuntimeExports.jsx(me,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:t,dragScale:ht,bounds:Hi,endContent:"%",...n})}),e&&i.jsxRuntimeExports.jsx(me,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:t,dragScale:ht,bounds:ln,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:t??200,dragScale:ht,bounds:ln,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:t??200,dragScale:ht,bounds:ln,endContent:"px",...n})})]})]}),i.jsxRuntimeExports.jsx(ft,{path:"",showInner:!1})]}),xu=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],cR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsxs($e,{direction:"y",empty:!0,children:[i.jsxRuntimeExports.jsx(Qo,{path:""}),";"]});default:return i.jsxRuntimeExports.jsxs($e,{direction:"x",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ze,{path:"color"}),i.jsxRuntimeExports.jsx(me,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(E.Text$1,{...s})}),i.jsxRuntimeExports.jsx(Tt,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...s})})]})]}),i.jsxRuntimeExports.jsx(ft,{path:"",showInner:!1})]})}},[]),t=je.useStatic({tabs:xu,content:e});return i.jsxRuntimeExports.jsx(je.Tabs,{...t})},aR=({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=ms(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(E.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(E.Numeric,{value:r.trueBound.upper??1.1,onChange:d=>c({...r.trueBound,upper:d})})})]})},uR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsx(aR,{path:""});default:return i.jsxRuntimeExports.jsx(ke,{})}},[]),t=je.useStatic({tabs:xu,content:e});return i.jsxRuntimeExports.jsx(je.Tabs,{...t})},dR=({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(Tt,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),i.jsxRuntimeExports.jsx(Es,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},xR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(dR,{path:""});default:return i.jsxRuntimeExports.jsx(ke,{omit:["align","maxInlineSize"]})}},[]),t=je.useStatic({tabs:gr,content:e});return i.jsxRuntimeExports.jsx(je.Tabs,{...t})},fR=({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})})]})},pR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(fR,{path:""});default:return i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsx(Go,{path:"units",label:"Units",align:"start",padHelpText:!1}),i.jsxRuntimeExports.jsx(Ze,{path:"color"})]}),i.jsxRuntimeExports.jsx(ft,{path:""})]})}},[]),t=je.useStatic({tabs:gr,content:e});return i.jsxRuntimeExports.jsx(je.Tabs,{...t})},mR=()=>{const e=xt({path:"autoFit",optional:!0});return i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(me,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>i.jsxRuntimeExports.jsx(E.Text$1,{selectOnFocus:!0,...t})}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Text Size",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>i.jsxRuntimeExports.jsx(hs,{...t})})]}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ze,{path:"color"}),i.jsxRuntimeExports.jsx(me,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(E.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:i.jsxRuntimeExports.jsx(E.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(E.e4.AutoFitWidth,{})})})})]})]}),i.jsxRuntimeExports.jsx(ft,{path:""})]})},hR=()=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label",omit:["maxInlineSize","align"]}),i.jsxRuntimeExports.jsx(Ze,{path:"color"})]}),i.jsxRuntimeExports.jsx(ft,{path:"",showOuter:!1})]}),gR=()=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,empty:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ze,{path:"color"}),i.jsxRuntimeExports.jsx(Ze,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:e??200,dragScale:ht,bounds:ln,endContent:"px",...t})}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:e??200,dragScale:ht,bounds:ln,endContent:"px",...t})})]})]}),i.jsxRuntimeExports.jsx(ft,{path:"",showInner:!1})]}),Gt=()=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Ze,{path:"color"}),i.jsxRuntimeExports.jsx(uu,{path:"scale"}),i.jsxRuntimeExports.jsx(Es,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),i.jsxRuntimeExports.jsx(ft,{path:""})]}),q=e=>i.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),nt=e=>i.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Ye=e=>i.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),xe=e=>i.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),ER={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}},yR=(e,t)=>ER[t][e],jR=(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}},SR=(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=o1()}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=SR(r,s,t,n);return i.jsxRuntimeExports.jsx(gn,{position:jR(yR(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}%`}})},Ee=({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}),ye=({className:e,...t})=>i.jsxRuntimeExports.jsx("div",{className:f.CSS(f.CSS.B("symbol-primitive"),e),...t}),RR=.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=E.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*RR).width,...r},children:i.jsxRuntimeExports.jsx("g",{children:n})})},fu=({className:e,orientation:t="left",scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),pu=({color:e,orientation:t="left",scale:n,...s})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),mu=({orientation:e="left",color:t,scale:n,...s})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})})]}),hu=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:o,...r})=>i.jsxRuntimeExports.jsxs(Ee,{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"})]})]}),gu=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(Ee,{className:f.CSS(f.CSS.B("relief-valve"),e),enabled:o,...r,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"})]})]}),Eu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),yu=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const r=f.cssString(n);return i.jsxRuntimeExports.jsxs(ye,{...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(Ye,{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"})]})]})},ju=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),Su=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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)})]})]}),Ru=({className:e,color:t,orientation:n="left",scale:s,...o})=>{const r=f.cssString(t);return i.jsxRuntimeExports.jsxs(ye,{...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"})]})]})},Cu=({className:e,color:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{...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"})]})]}),bu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})})]}),wu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})})]}),vu=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...r,orientation:t,className:f.CSS(f.CSS.B("manual-valve"),e),enabled: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"})]})]}),_u=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),ku=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})})]}),Mu=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,CR=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}%`},Pu={width:40,height:80},Er={x:50,y:10},Is=({className:e,dimensions:t=Pu,borderRadius:n=Er,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=Mu(n),a=s==null,u=E.use(),d=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]);return i.jsxRuntimeExports.jsx(ye,{className:f.CSS(e,f.CSS.B("tank")),style:{...t,borderRadius:s??CR(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"})]})})},Nu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),Lu=({className:e,orientation:t="left",scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),Tu=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...r,orientation:t,className:f.CSS(f.CSS.B("needle-valve"),e),enabled: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"})]})]}),Au=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...r,orientation:n,className:f.CSS(f.CSS.B("angled-relief-valve"),t),enabled:o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:79},orientation:n,color:e,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"})]})]}),Iu=({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=E.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(ye,{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(E.Text,{level:r,color:x,children:o})})]})},$u=({enabled:e=!1,onClick:t,orientation:n="left"})=>i.jsxRuntimeExports.jsxs(ye,{orientation:n,children:[i.jsxRuntimeExports.jsx(E.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"})]})]}),Du=({onClick:e,orientation:t="left",label:n="",color:s,size:o,level:r,onClickDelay:l})=>i.jsxRuntimeExports.jsxs(ye,{orientation:t,children:[i.jsxRuntimeExports.jsx(E.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"})]})]}),Ou=({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(ye,{style:a,orientation:t,className:f.CSS(f.CSS.B("text-box"),f.CSS.loc(t),e),children:i.jsxRuntimeExports.jsx(E.Text,{color:f.cssString(o),level:r,children:n})})},zu=({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(ye,{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(E.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(E.Button,{variant:"outlined",size:"small",onClick:()=>c(u),color:l,children:"Set"})})]})},Bu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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)})]})]}),Vu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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)})]})]}),Fu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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)})]})]}),Hu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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"})]})]}),Zu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{...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"})]})]}),Gu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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)})]})]}),Yu=({className:e,color:t,orientation:n="left",enabled:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ye,{...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(Ye,{cx:"32",cy:"32",r:"30"})})]}),Wu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),Xu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),Ku=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),qu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),Uu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),Qu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...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})]})]}),Ju=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),ed=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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"})]})]}),td=({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(ye,{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(E.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"})]})})})]})},nd=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})})]}),sd=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),od=({className:e,dimensions:t=Pu,borderRadius:n=Er,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=Mu(n),a=E.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(ye,{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"})]})]})},rd=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>{const l=f.cssString(n);return i.jsxRuntimeExports.jsxs(Ee,{...r,orientation:t,className:f.CSS(f.CSS.B("spring-loaded-relief-valve"),e),enabled: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:l}),i.jsxRuntimeExports.jsx(q,{d:"M71 38.0014V72.0014",stroke:l,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:l}),i.jsxRuntimeExports.jsx(Ye,{cx:"44",cy:"55",r:"4",fill:l}),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:l,strokeWidth:1})]})]})},id=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>{const l=f.cssString(n);return i.jsxRuntimeExports.jsxs(Ee,{...r,orientation:t,className:f.CSS(f.CSS.B("spring-loaded-relief-valve"),e),enabled: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(Ye,{cx:"21",cy:"56.0737",r:"4",fill:l}),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:l,strokeLinecap:"round"})]})]})},ld=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})})]}),bR=({aetherKey:e,sink:t})=>{const n=E.useMemoDeepEqualProps({sink:t}),[,,s]=E.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])}},wR=({aetherKey:e,source:t})=>{const n=E.useMemoDeepEqualProps({source:t}),[,{enabled:s},o]=E.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}},vR="Schematic.Grid",_R=({symbolKey:e,items:t,loc:n,onLocationChange:s})=>{const o=`${e}.${vR}`,[r,l]=g.useState(!1),c=g.useCallback(({items:h})=>h.every(y=>y.type===o),[o]),a=E.useSyncedRef(s),{startDrag:u,onDragEnd:d,...x}=E.useDragAndDrop({type:o,canDrop:c,onDrop:g.useCallback(({items:h})=>h,[]),onDragOver:g.useCallback(h=>{l(c(h)),h.items.forEach(({key:y})=>a.current(y,n))},[])}),p=t.filter(h=>h.location===n),m=g.useCallback((h,y)=>u([{key:y,type:o}]),[u,o]);return i.jsxRuntimeExports.jsx(U.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:y})=>i.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(h,{draggable:!0,onDragStart:b=>m(b,y),onDragEnd:d,style:{cursor:"grab"}})},y))})},$n=e=>{const{editable:t,items:n,loc:s}=e;if(t)return i.jsxRuntimeExports.jsx(_R,{...e});const o=n.filter(r=>r.location===s);return o.length===0?null:i.jsxRuntimeExports.jsx(U.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))})},_t=({symbolKey:e,editable:t,children:n,items:s,onLocationChange:o,onRotate:r})=>i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx($n,{editable:t,items:s,loc:"top",onLocationChange:o,symbolKey:e}),i.jsxRuntimeExports.jsx($n,{editable:t,items:s,loc:"left",onLocationChange:o,symbolKey:e}),i.jsxRuntimeExports.jsx($n,{editable:t,items:s,loc:"right",onLocationChange:o,symbolKey:e}),i.jsxRuntimeExports.jsx($n,{editable:t,items:s,loc:"bottom",onLocationChange:o,symbolKey:e}),t&&i.jsxRuntimeExports.jsx(E.Icon,{className:f.CSS.BE("grid","rotate"),size:"small",variant:"filled",onClick:r,children:i.jsxRuntimeExports.jsx(E.e4.Rotate,{})}),n]}),kR=({aetherKey:e,source:t,sink:n})=>{const s=E.useMemoDeepEqualProps({source:t,sink:n}),[,{value:o},r]=E.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}},MR=({aetherKey:e,source:t,sink:n})=>{const s=E.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:o,enabled:r},l]=E.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}},Yt=(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(E.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:{textAlign:l,width:c}}),location:o}},yr=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(U.Space,{direction:f.g.swap(l),align:"center",className:f.CSS(f.CSS.B("control-state")),size:"small",children:[t&&n&&i.jsxRuntimeExports.jsx(ec,{size:"small",...o}),t&&s&&i.jsxRuntimeExports.jsx(sc,{...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}=MR({aetherKey:n,source:o,sink:r}),y=[],b=Yt(l,c);b!=null&&y.push(b);const R=yr(s);return R!=null&&y.push(R),i.jsxRuntimeExports.jsx(_t,{editable:u&&!a,symbolKey:n,items:y,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},ve=e=>{const t=({symbolKey:n,label:s,onChange:o,selected:r,draggable:l,position:c,orientation:a="left",...u})=>{const d=[],x=Yt(s,o);return x!=null&&d.push(x),i.jsxRuntimeExports.jsx(_t,{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},kt=e=>{const t=({symbolKey:n,label:s,onChange:o,selected:r,draggable:l,position:c,orientation:a="left",enabled:u=!1,clickable:d=!1,...x})=>{const p=[],m=Yt(s,o);m!=null&&p.push(m);const h=()=>{d&&o({enabled:!u})};return i.jsxRuntimeExports.jsx(_t,{items:p,editable:r&&!l,symbolKey:n,onRotate:()=>o({orientation:f.K.rotate90(a)}),onLocationChange:(y,b)=>{y==="label"&&o({label:{...s,orientation:b}})},children:i.jsxRuntimeExports.jsx(e,{orientation:a,enabled:u,onClick:h,...x})})};return t.displayName=e.displayName,t},cd=be(pu),ad=be(mu),ud=be(hu),dd=be(fu),xd=be(ju),fd=be(Su),pd=be(Vu),md=be(Fu),hd=be(Hu),gd=be(Gu),Ed=be(Xu),yd=be(Ku),jd=be(qu),Sd=be(Uu),Rd=be(Qu),Cd=be(Ju),bd=be(Bu),wd=be(ed),vd=ve(Nu),_d=ve(Wu),kd=ve(Ru),Md=ve(bu),Pd=ve(wu),Nd=ve(ku),Ld=ve(Eu),Td=ve(yu),Ad=ve(Lu),Id=be($u),$d=ve(nd),Dd=ve(_u),Od=ve(sd),zd=ve(Cu),Bd=ve(ld),Vd=ve(Zu),Fd=kt(Tu),Hd=kt(gu),Zd=kt(rd),Gd=kt(id),Yd=kt(vu),Wd=kt(Au),Xd=ve(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:r})=>i.jsxRuntimeExports.jsx(Is,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:r,backgroundColor:e})),Kd=e=>i.jsxRuntimeExports.jsx(Is,{...e,dimensions:{width:25,height:50}}),qd=ve(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:o,dimensions:r})=>i.jsxRuntimeExports.jsx(Is,{onResize:l=>n({dimensions:l}),orientation:s,color:o,dimensions:r,boxBorderRadius:t,backgroundColor:e})),Ud=e=>i.jsxRuntimeExports.jsx(Is,{...e,dimensions:{width:25,height:50},borderRadius:0}),Qd=({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}=kR({aetherKey:t,source:r,sink:l}),m=[],h=yr(s);h!=null&&m.push(h);const y=Yt(e,a);return y!=null&&m.push(y),i.jsxRuntimeExports.jsx(_t,{symbolKey:t,editable:u&&!d,onRotate:()=>a({orientation:f.K.rotate90(n)}),items:m,onLocationChange:(b,R)=>{b==="label"&&a({label:{...e,orientation:R}})},children:i.jsxRuntimeExports.jsx(zu,{value:x,onChange:p,units:o,color:c,orientation:n})})},Jd=e=>i.jsxRuntimeExports.jsx(zu,{value:12,onChange:()=>{},units:"mV",...e,children:i.jsxRuntimeExports.jsx(E.Text,{level:"p",children:"10.0"})}),ex=({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=E.useTypography(n),h=(m.lineHeight+.5)*m.baseSize+2,{width:y}=Jo({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}),b=[],R=Yt(t,a);return R!=null&&b.push(R),i.jsxRuntimeExports.jsx(_t,{editable:d&&!x,symbolKey:e,items:b,onLocationChange:(k,S)=>{k==="label"&&a({label:{...t,orientation:S}})},children:i.jsxRuntimeExports.jsx(Iu,{color:r,dimensions:{height:h,width:y},inlineSize:u,units:c,unitsLevel:H.downLevel(n)})})},tx=({color:e})=>i.jsxRuntimeExports.jsx(Iu,{color:e,dimensions:{width:60,height:25},units:"psi",children:i.jsxRuntimeExports.jsx(E.Text,{level:"p",children:"50.00"})}),nx=({symbolKey:e,label:t,orientation:n="left",sink:s,control:o,selected:r,draggable:l,onChange:c,...a})=>{const{click:u}=bR({aetherKey:e,sink:s}),d=[],x=yr(o);return x!=null&&d.push(x),i.jsxRuntimeExports.jsx(_t,{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(Du,{...t,onClick:u,orientation:n,...a})})},sx=({label:e,...t})=>i.jsxRuntimeExports.jsx(Du,{label:"Button",...t}),ox=({symbolKey:e,label:t,source:n,onChange:s,selected:o,draggable:r,...l})=>{const{enabled:c}=wR({aetherKey:e,source:n}),a=[],u=Yt(t,s);return u!=null&&a.push(u),i.jsxRuntimeExports.jsx(_t,{items:a,editable:o&&!r,symbolKey:e,onLocationChange:(d,x)=>{d==="label"&&s({label:{...t,orientation:x}})},children:i.jsxRuntimeExports.jsx(Yu,{enabled:c,...l})})},rx=({level:e="p",width:t=100})=>i.jsxRuntimeExports.jsx(Ou,{level:e,width:t,text:"Text Box"}),ix=({label:{label:e,level:t},orientation:n,color:s,onChange:o})=>i.jsxRuntimeExports.jsx(td,{onLabelChange:r=>o({label:{label:r,level:t}}),label:e,level:t,orientation:n,color:s}),lx=({label:e,...t})=>i.jsxRuntimeExports.jsx(td,{label:"Off Page",...t,orientation:"right"}),cx=ve(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:r})=>i.jsxRuntimeExports.jsx(od,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:r,backgroundColor:e})),ax=e=>i.jsxRuntimeExports.jsx(od,{...e,dimensions:{width:25,height:50}}),ce=4,jr=2,PR=["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"],NR=re.z.enum(PR),ge={orientation:"left",scale:1},LR={...ge,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"})},TR={...ge,source:A.sourcePipeline("number",{connections:[],segments:{valueStream:A.streamChannelValue({channel:0})},outlet:"valueStream"})},AR={...ge,sink:A.sinkPipeline("number",{connections:[],segments:{setter:A.setChannelValue({channel:0})},inlet:"setter"})},ux={...ge,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"})},dx={...ge,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={...ux,...dx},Wt={...ge,enabled:!1,clickable:!1},oe=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),IR={width:125,height:200},Sr={dimensions:IR},$R=3,DR={name:"Three Way Valve",key:"threeWayValve",Form:we,Symbol:cd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Three Way Valve"),..._e}),Preview:pu,zIndex:ce},OR={name:"Valve",key:"valve",Form:we,Symbol:ad,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Valve"),..._e}),Preview:mu,zIndex:ce},zR={name:"Solenoid Valve",key:"solenoidValve",Form:we,Symbol:ud,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Solenoid Valve"),normallyOpen:!1,..._e}),Preview:hu,zIndex:ce},BR={name:"Four Way Valve",key:"fourWayValve",Form:we,Symbol:dd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Four Way Valve"),..._e}),Preview:fu,zIndex:ce},VR={name:"Angled Valve",key:"angledValve",Form:we,Symbol:xd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Valve"),..._e}),Preview:ju,zIndex:ce},FR={name:"Pump",key:"pump",Form:we,Symbol:fd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Pump"),..._e}),Preview:Su,zIndex:ce},HR={name:"Screw Pump",key:"screwPump",Form:we,Symbol:bd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Screw Pump"),..._e}),Preview:Bu,zIndex:ce},ZR={name:"Tank",key:"tank",Form:du,Symbol:Xd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("Tank"),borderRadius:Er,...Sr,...ge}),Preview:Kd,zIndex:jr},GR={name:"Cylinder",key:"cylinder",Form:gR,Symbol:cx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("cylinder"),dimensions:{width:66,height:181},...ge}),Preview:ax,zIndex:jr},YR={name:"Box",key:"box",Form:()=>du({includeBorderRadius:!0}),Symbol:qd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("Box"),borderRadius:$R,...Sr,...ge}),Preview:Ud,zIndex:jr},WR={name:"Relief Valve",key:"reliefValve",Form:Gt,Symbol:Hd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Relief Valve"),...Wt}),Preview:gu,zIndex:ce},XR={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:Gt,Symbol:Zd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Spring Loaded Relief Valve"),...Wt}),Preview:rd,zIndex:ce},KR={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:Gt,Symbol:Gd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Spring Loaded Relief Valve"),...Wt}),Preview:id,zIndex:ce},qR={name:"Regulator",key:"regulator",Form:ke,Symbol:vd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Regulator"),...ge}),Preview:Nu,zIndex:ce},UR={name:"Electric Regulator",key:"electricRegulator",Form:ke,Symbol:_d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Electric Regulator"),...ge}),Preview:Wu,zIndex:ce},QR={name:"Burst Disc",key:"burstDisc",Form:ke,Symbol:kd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Burst Disc"),...ge}),Preview:Ru,zIndex:ce},JR={name:"ISO Burst Disc",key:"isoBurstDisc",Form:ke,Symbol:zd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Burst Disc"),...ge}),Preview:Cu,zIndex:ce},e2={name:"Cap",key:"cap",Form:ke,Symbol:Md,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cap"),...ge}),Preview:bu,zIndex:ce},t2={name:"ISO Cap",key:"isoCap",Form:ke,Symbol:Pd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Cap"),...ge}),Preview:wu,zIndex:ce},n2={name:"Manual Valve",key:"manualValve",Form:Gt,Symbol:Yd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Manual Valve"),...Wt}),Preview:vu,zIndex:ce},s2={name:"Orifice Plate",key:"orificePlate",Form:ke,Symbol:Dd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Orifice Plate"),...ge}),Preview:_u,zIndex:ce},o2={name:"ISO Filter",key:"isoFilter",Form:ke,Symbol:Od,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Filter"),...ge}),Preview:sd,zIndex:ce},r2={name:"Filter",key:"filter",Form:ke,Symbol:Nd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Filter"),...ge}),Preview:ku,zIndex:ce},i2={name:"Needle Valve",key:"needleValve",Form:Gt,Symbol:Fd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Needle Valve"),...Wt}),Preview:Tu,zIndex:ce},l2={name:"Check Valve",key:"checkValve",Form:ke,Symbol:Ld,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Check Valve"),...ge}),Preview:Eu,zIndex:ce},c2={name:"Orifice",key:"orifice",Form:ke,Symbol:Ad,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Orifice"),...ge}),Preview:Lu,zIndex:ce},a2={name:"Angled Relief Valve",key:"angledReliefValve",Form:Gt,Symbol:Wd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Relief Valve"),...Wt}),Preview:Au,zIndex:ce},u2={name:"Value",key:"value",Form:cR,Symbol:ex,Preview:tx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...oe("Value"),...ge,telem:LR.source}),zIndex:ce},d2={name:"Button",key:"button",Symbol:nx,Form:xR,Preview:sx,defaultProps:e=>({color:e.colors.primary.z.rgba255,...oe("Button"),...dx,onClickDelay:0,scale:null}),zIndex:ce},x2={name:"Switch",key:"switch",Symbol:Id,Form:we,defaultProps:()=>({...oe("Switch"),..._e,scale:null}),Preview:$u,zIndex:ce},f2={name:"Vacuum Pump",key:"vacuumPump",Symbol:pd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Vacuum Pump"),..._e}),Preview:Vu,zIndex:ce},p2={name:"Cavity Pump",key:"cavityPump",Symbol:md,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cavity Pump"),..._e}),Preview:Fu,zIndex:ce},m2={name:"Piston Pump",key:"pistonPump",Symbol:hd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Piston Pump"),..._e}),Preview:Hu,zIndex:ce},h2={name:"Static Mixer",key:"staticMixer",Symbol:Vd,Form:ke,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Static Mixer"),...ge}),Preview:Zu,zIndex:ce},g2={name:"Rotary Mixer",key:"rotaryMixer",Symbol:gd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Rotary Mixer"),..._e}),Preview:Gu,zIndex:ce},E2={name:"Light",key:"light",Symbol:ox,Form:uR,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Light"),...ux}),Preview:Yu,zIndex:ce},y2={name:"Setpoint",key:"setpoint",Symbol:Qd,Form:pR,defaultProps:e=>({units:"mV",color:e.colors.gray.l4.rgba255,...oe("Setpoint"),...TR,...AR}),Preview:Jd,zIndex:ce},j2={name:"Agitator",key:"agitator",Symbol:Ed,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Agitator"),..._e}),Preview:Xu,zIndex:ce},S2={name:"Propeller Agitator",key:"propellerAgitator",Symbol:yd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Propeller Agitator"),..._e}),Preview:Ku,zIndex:ce},R2={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:jd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Flat Blade Agitator"),..._e}),Preview:qu,zIndex:ce},C2={name:"Paddle Agitator",key:"paddleAgitator",Symbol:Sd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Paddle Agitator"),..._e}),Preview:Uu,zIndex:ce},b2={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Rd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cross Beam Agitator"),..._e}),Preview:Qu,zIndex:ce},w2={name:"Helical Agitator",key:"helicalAgitator",Symbol:Cd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Helical Agitator"),..._e}),Preview:Ju,zIndex:ce},v2={name:"Compressor",key:"compressor",Symbol:wd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Compressor"),..._e}),Preview:ed,zIndex:ce},_2={name:"Text Box",key:"textBox",Symbol:Ou,Form:mR,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...oe("Text Box"),...ge,...Sr,level:"p",text:"Text Box",width:75}),Preview:rx,zIndex:ce},k2={name:"Off Page Reference",key:"offPageReference",Form:hR,Symbol:ix,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...oe("Off Page Reference")}),Preview:lx,zIndex:ce},M2={name:"ISO Check Valve",key:"isoCheckValve",Form:ke,Symbol:Td,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Check Valve"),...ge}),Preview:yu,zIndex:ce},P2={name:"Vent",key:"vent",Form:ke,Symbol:$d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Vent"),...ge}),Preview:nd,zIndex:ce},N2={name:"T Junction",key:"tJunction",Form:ke,Symbol:Bd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe(""),...ge}),Preview:ld,zIndex:ce+20},L2={value:u2,button:d2,tank:ZR,tJunction:N2,switch:x2,offPageReference:k2,light:E2,setpoint:y2,box:YR,textBox:_2,valve:OR,solenoidValve:zR,threeWayValve:DR,fourWayValve:BR,angledValve:VR,manualValve:n2,needleValve:i2,reliefValve:WR,angledReliefValve:a2,checkValve:l2,regulator:qR,electricRegulator:UR,pump:FR,pistonPump:m2,screwPump:HR,cavityPump:p2,vacuumPump:f2,staticMixer:h2,rotaryMixer:g2,burstDisc:QR,isoBurstDisc:JR,cap:e2,isoCap:t2,filter:r2,isoFilter:o2,orifice:c2,orificePlate:s2,agitator:j2,propellerAgitator:S2,flatBladeAgitator:R2,paddleAgitator:C2,crossBeamAgitator:b2,helicalAgitator:w2,compressor:v2,isoCheckValve:M2,vent:P2,cylinder:GR,springLoadedReliefValve:XR,angledSpringLoadedReliefValve:KR},T2=Object.freeze(Object.defineProperty({__proto__:null,Agitator:Ed,AngledReliefValve:Wd,AngledSpringLoadedReliefValve:Gd,AngledValve:xd,Box:qd,BoxPreview:Ud,BurstDisc:kd,Button:nx,ButtonPreview:sx,Cap:Md,CavityPump:md,CheckValve:Ld,Compressor:wd,CrossBeamAgitator:Rd,Cylinder:cx,CylinderPreview:ax,ElectricRegulator:_d,Filter:Nd,FlatBladeAgitator:jd,FourWayValve:dd,HelicalAgitator:Cd,ISOBurstDisc:zd,ISOCap:Pd,ISOCheckValve:Td,ISOFilter:Od,Light:ox,ManualValve:Yd,NeedleValve:Fd,OffPageReference:ix,OffPageReferencePreview:lx,Orifice:Ad,OrificePlate:Dd,PaddleAgitator:Sd,PistonPump:hd,PropellerAgitator:yd,Pump:fd,Regulator:vd,ReliefValve:Hd,RotaryMixer:gd,SYMBOLS:L2,ScrewPump:bd,Setpoint:Qd,SetpointPreview:Jd,SolenoidValve:ud,SpringLoadedReliefValve:Zd,StaticMixer:Vd,Switch:Id,TJunction:Bd,Tank:Xd,TankPreview:Kd,TextBoxPreview:rx,ThreeWayValve:cd,VacuumPump:pd,Value:ex,ValuePreview:tx,Valve:ad,Vent:$d,createDummyToggle:kt,createLabeled:ve,createToggle:be,variantZ:NR},Symbol.toStringTag,{value:"Module"}));exports.Aether=E.main;exports.Dialog=E.use$4;exports.Divider=E.Divider$1;exports.Dropdown=E.Dropdown;exports.Haul=E.Haul;exports.Worker=E.Context$1;exports.compareArrayDeps=E.compareArrayDeps;exports.componentRenderProp=E.componentRenderProp;exports.isRenderProp=E.isRenderProp;exports.useAsyncEffect=E.useAsyncEffect;exports.useClickOutside=E.useClickOutside;exports.useCombinedRefs=E.useCombinedRefs;exports.useCombinedStateAndRef=E.useCombinedStateAndRef;exports.useDebouncedCallback=E.useDebouncedCallback;exports.useEffectCompare=E.useEffectCompare;exports.useMemoCompare=E.useMemoCompare;exports.useMemoDeepEqualProps=E.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=E.useMemoPrimitiveArray;exports.usePrevious=E.usePrevious;exports.useResize=E.useResize;exports.useStateRef=E.useStateRef;exports.useSyncedRef=E.useSyncedRef;exports.useTransforms=E.useTransforms;exports.CSS=f.CSS;exports.newBEM=f.newBEM;exports.Header=Dn.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=U.Generic;exports.Align=mf.external;exports.Icon=je.Icon;exports.Tabs=je.external;exports.Button=hf.external;exports.Caret=Zi.Animated$1;exports.telem=A.external;exports.Text=Re.external;exports.Triggers=Gi.external;exports.List=Vt.external;exports.createFilterTransform=Vt.createFilterTransform;exports.fuseFilter=Vt.fuseFilter;exports.proxyMemo=Vt.proxyMemo;exports.Color=Ef.external;exports.createHexOpacityVariants=Yi.createHexOpacityVariants;exports.unitProperty=Yi.unitProperty;exports.Input=Pe.external;exports.Menu=yf.external;exports.Theming=jf.external;exports.Tree=Sf.external;exports.Video=Rf.Video;exports.Accordion=Ff;exports.Breadcrumb=Yf;exports.Canvas=up;exports.Channel=om;exports.Control=ph;exports.Device=Sm;exports.Diagram=sR;exports.Eraser=Km;exports.Form=Em;exports.Label=_m;exports.Legend=mp;exports.Line=gp;exports.LinePlot=Zp;exports.Log=rR;exports.Measure=Xp;exports.Modal=Mm;exports.Mosaic=Ym;exports.Nav=Qm;exports.Note=eh;exports.OS=rh;exports.Observe=hm;exports.Override=lh;exports.Pluto=Eh;exports.Portal=Om;exports.Progress=jh;exports.Range=Yp;exports.Ranger=_h;exports.Resize=Af;exports.Rule=Kp;exports.Schematic=T2;exports.Select=Lp;exports.Status=vf;exports.Steps=Mh;exports.Synnax=Kf;exports.Table=Ah;exports.TableCells=Qh;exports.Tag=Pp;exports.Telem=uh;exports.Tooltip=_f;exports.Value=Oh;exports.Viewport=Hp;exports.axis=rp;exports.control=ip;exports.useDelayedState=Cf;
|
|
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)||Ci;if(e!==null){const u=p=>{if(o.current=p.ctrlKey||p.metaKey||p.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&wo(p))return!1;const h=wi(p.code,c);r.current.add(p[h]),bi(l,r.current,!1)&&(p.preventDefault(),s(!0))},d=p=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&wo(p))return!1;const h=wi(p.code,c);bi(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 bi(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function wi(e,t){return t.includes(e)?"code":"key"}const DS=()=>{const e=he();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=Ro(n,t),{width:a,height:u}=Ms(l);return Co({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=ar(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 bn(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=Qc(t,n);return{x:l.x+o,y:l.y+r}}}),[])};function wa(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)OS(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 OS(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 va(e,t){return wa(e,t)}function _a(e,t){return wa(e,t)}function mt(e,t){return{id:e,type:"select",selected:t}}function Nt(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(mt(r.id,l)))}return s}function vi({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 _i(e){return{id:e.id,type:"remove"}}const ki=e=>Ej(e),zS=e=>Yc(e);function ka(e){return g.forwardRef(e)}const BS=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Mi(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>VS(()=>n(o=>o+BigInt(1))));return BS(()=>{const o=s.get();o.length&&(e(o),s.reset())},[t]),s}function VS(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Ma=g.createContext(null);function FS({children:e}){const t=he(),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(vi({items:m,lookup:p}))},[]),s=Mi(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(vi({items:m,lookup:p}))},[]),r=Mi(o),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:r}),[]);return i.jsxRuntimeExports.jsx(Ma.Provider,{value:l,children:e})}function HS(){const e=g.useContext(Ma);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const ZS=e=>!!e.panZoom;function wt(){const e=DS(),t=he(),n=HS(),s=pe(ZS),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=ki(x)?x:p.get(x.id),y=h.parentId?ea(h.position,h.measured,h.parentId,p,m):h.position,C={id:h.id,position:y,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 zt(C)},u=(x,p,m={replace:!1})=>{l(h=>h.map(y=>{if(y.id===x){const C=typeof p=="function"?p(y):p;return m.replace&&ki(C)?C:{...y,...C}}return y}))},d=(x,p,m={replace:!1})=>{c(h=>h.map(y=>{if(y.id===x){const C=typeof p=="function"?p(y):p;return m.replace&&zS(C)?C:{...y,...C}}return y}))};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,y,C]=m;return{nodes:x.map(R=>({...R})),edges:p.map(R=>({...R})),viewport:{x:h,y,zoom:C}}},deleteElements:async({nodes:x=[],edges:p=[]})=>{const{nodes:m,edges:h,onNodesDelete:y,onEdgesDelete:C,triggerNodeChanges:R,triggerEdgeChanges:k,onDelete:S,onBeforeDelete:j}=t.getState(),{nodes:w,edges:M}=await Sj({nodesToRemove:x,edgesToRemove:p,nodes:m,edges:h,onBeforeDelete:j}),v=M.length>0,N=w.length>0;if(v){const L=M.map(_i);C==null||C(M),k(L)}if(N){const L=w.map(_i);y==null||y(w),R(L)}return(N||v)&&(S==null||S({nodes:w,edges:M})),{deletedNodes:w,deletedEdges:M}},getIntersectingNodes:(x,p=!0,m)=>{const h=ni(x),y=h?x:a(x),C=m!==void 0;return y?(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=zt(C?R:k),j=pn(S,y);return p&&j>0||j>=y.width*y.height}):[]},isNodeIntersecting:(x,p,m=!0)=>{const y=ni(x)?x:a(x);if(!y)return!1;const C=pn(y,p);return m&&C>0||C>=y.width*y.height},updateNode:u,updateNodeData:(x,p,m={replace:!1})=>{u(x,h=>{const y=typeof p=="function"?p(h):p;return m.replace?{...h,data:y}:{...h,data:{...h.data,...y}}},m)},updateEdge:d,updateEdgeData:(x,p,m={replace:!1})=>{d(x,h=>{const y=typeof p=="function"?p(h):p;return m.replace?{...h,data:y}:{...h,data:{...h.data,...y}}},m)},getNodesBounds:x=>{const{nodeLookup:p,nodeOrigin:m}=t.getState();return yj(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 Pi=e=>e.selected,GS={actInsideInputWithModifier:!1},YS=typeof window<"u"?window:void 0;function WS({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=he(),{deleteElements:s}=wt(),o=hn(e,GS),r=hn(t,{target:YS});g.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(Pi),edges:l.filter(Pi)}),n.setState({nodesSelectionActive:!1})}},[o]),g.useEffect(()=>{n.setState({multiSelectionActive:r})},[r])}function XS(e){const t=he();g.useEffect(()=>{const n=()=>{var o,r;if(!e.current)return!1;const s=Ms(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 Ls={position:"absolute",width:"100%",height:"100%",top:0,left:0},KS=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function qS({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.5,panOnScrollMode:r=Et.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:u,minZoom:d,maxZoom:x,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:y,noPanClassName:C,onViewportChange:R,isControlledViewport:k,paneClickDistance:S}){const j=he(),w=g.useRef(null),{userSelectionActive:M,lib:v}=pe(KS,Se),N=hn(p),L=g.useRef();XS(w);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(w.current){L.current=Jj({domNode:w.current,minZoom:d,maxZoom:x,translateExtent:u,viewport:a,paneClickDistance:S,onDraggingChange:b=>j.setState({paneDragging:b}),onPanZoomStart:(b,I)=>{const{onViewportChangeStart:_,onMoveStart:O}=j.getState();O==null||O(b,I),_==null||_(I)},onPanZoom:(b,I)=>{const{onViewportChange:_,onMove:O}=j.getState();O==null||O(b,I),_==null||_(I)},onPanZoomEnd:(b,I)=>{const{onViewportChangeEnd:_,onMoveEnd:O}=j.getState();O==null||O(b,I),_==null||_(I)}});const{x:D,y:$,zoom:B}=L.current.getViewport();return j.setState({panZoom:L.current,transform:[D,$,B],domNode:w.current.closest(".react-flow")}),()=>{var b;(b=L.current)==null||b.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:C,userSelectionActive:M,noWheelClassName:y,lib:v,onTransformChange:T})},[e,t,n,s,o,r,l,c,N,m,C,M,y,v,T]),i.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:w,style:Ls,children:h})}const US=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function QS(){const{userSelectionActive:e,userSelectionRect:t}=pe(US,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 ro=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},JS=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function e0({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Dt.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),y=he(),C=g.useRef(0),R=g.useRef(0),k=g.useRef(),S=g.useRef(new Map),{userSelectionActive:j,elementsSelectable:w,dragging:M}=pe(JS,Se),v=w&&(e||j),N=g.useRef(!1),L=g.useRef(!1),T=()=>{y.setState({userSelectionActive:!1,userSelectionRect:null}),C.current=0,R.current=0},D=P=>{if(N.current){N.current=!1;return}c==null||c(P),y.getState().resetSelectedElements(),y.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,b=P=>{var K,Q,J,ne;const{resetSelectedElements:z,domNode:V,edgeLookup:Z}=y.getState();if(k.current=V==null?void 0:V.getBoundingClientRect(),!w||!e||P.button!==0||P.target!==h.current||!k.current)return;(Q=(K=P.target)==null?void 0:K.setPointerCapture)==null||Q.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,((J=S.current.get(ie.source))==null?void 0:J.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}=qe(P.nativeEvent,k.current);z(),y.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}=y.getState();if(!k.current||!z)return;N.current=!0;const{x:Q,y:J}=qe(P.nativeEvent,k.current),{startX:ne,startY:W}=z,ie={startX:ne,startY:W,x:Q<ne?Q:ne,y:J<W?J:W,width:Math.abs(Q-ne),height:Math.abs(J-W)},de=Wc(Y,ie,Z,n===Dt.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(C.current!==te.size){C.current=te.size;const X=Nt(Y,te,!0);ee(X)}if(R.current!==ae.size){R.current=ae.size;const X=Nt(V,ae);K(X)}y.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}=y.getState();!j&&z&&P.target===h.current&&(D==null||D(P)),C.current>0&&y.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:Ce(["react-flow__pane",{draggable:O,dragging:M,selection:e}]),onClick:v?void 0:ro(D,h),onContextMenu:ro($,h),onWheel:ro(B,h),onPointerEnter:v?void 0:d,onPointerDown:v?b:x,onPointerMove:v?I:x,onPointerUp:v?_:void 0,onPointerLeave:p,ref:h,style:Ls,children:[m,i.jsxRuntimeExports.jsx(QS,{})]})}function No({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 Pa({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:o,isSelectable:r,nodeClickDistance:l}){const c=he(),[a,u]=g.useState(!1),d=g.useRef();return g.useEffect(()=>{d.current=zj({getStoreItems:()=>c.getState(),onNodeMouseDown:x=>{No({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 t0=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Na(){const e=he();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=t0(l),m=o?r[0]:5,h=o?r[1]:5,y=n.direction.x*m*n.factor,C=n.direction.y*h*n.factor;for(const[,R]of u){if(!p(R))continue;let k={x:R.internals.positionAbsolute.x+y,y:R.internals.positionAbsolute.y+C};o&&(k=ks(k,r));const{position:S,positionAbsolute:j}=Xc({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 mr=g.createContext(null),n0=mr.Provider;mr.Consumer;const La=()=>g.useContext(mr),s0=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),o0=(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===Rt.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 r0({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 b,I;const h=l||null,y=e==="target",C=he(),R=La(),{connectOnClick:k,noPanClassName:S,rfId:j}=pe(s0,Se),{connectingFrom:w,connectingTo:M,clickConnecting:v,isPossibleEndHandle:N,connectionInProcess:L,valid:T}=pe(o0(R,h,e),Se);R||(I=(b=C.getState()).onError)==null||I.call(b,"010",Te.error010());const D=_=>{const{defaultEdgeOptions:O,onConnect:P,hasDefaultEdges:z}=C.getState(),V={...O,..._};if(z){const{edges:Z,setEdges:Y}=C.getState();Y(la(V,Z))}P==null||P(V),c==null||c(V)},$=_=>{if(!R)return;const O=na(_.nativeEvent);if(o&&(O&&_.button===0||!O)){const P=C.getState();Mo.onPointerDown(_.nativeEvent,{autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:y,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:()=>C.getState().transform,getFromHandle:()=>C.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:Q}=C.getState();if(!R||!z&&!o)return;if(!z){O==null||O(_.nativeEvent,{nodeId:R,handleId:h,handleType:e}),C.setState({connectionClickStartHandle:{nodeId:R,type:e,id:h}});return}const J=ta(_.target),ne=n||Z,{connection:W,isValid:ie}=Mo.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:J,lib:Y,nodeLookup:K});ie&&W&&D(W);const de=structuredClone(Q);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,P==null||P(_,de),C.setState({connectionClickStartHandle:null})};return i.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":R,"data-handlepos":t,"data-id":`${j}-${R}-${h}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,u,{source:!y,target:y,connectable:s,connectablestart:o,connectableend:r,clickconnecting:v,connectingfrom:w,connectingto:M,valid:T,connectionindicator:s&&(!L||N)&&(L?r:o)}]),onMouseDown:$,onTouchStart:$,onClick:k?B:void 0,ref:m,...p,children:a})}const gn=g.memo(ka(r0));function i0({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(gn,{type:"source",position:n,isConnectable:t})]})}function l0({data:e,isConnectable:t,targetPosition:n=G.Top,sourcePosition:s=G.Bottom}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(gn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,i.jsxRuntimeExports.jsx(gn,{type:"source",position:s,isConnectable:t})]})}function c0(){return null}function a0({data:e,isConnectable:t,targetPosition:n=G.Top}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(gn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const us={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ni={input:i0,default:l0,output:a0,group:c0};function u0(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 d0=e=>{const{width:t,height:n,x:s,y:o}=Cn(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 x0({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=he(),{width:o,height:r,transformString:l,userSelectionActive:c}=pe(d0,Se),a=Na(),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(us,p.key)&&a({direction:us[p.key],factor:p.shiftKey?4:1})};return i.jsxRuntimeExports.jsx("div",{className:Ce(["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 Li=typeof window<"u"?window:void 0,f0=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Ta({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:y,zoomActivationKeyCode:C,elementsSelectable:R,zoomOnScroll:k,zoomOnPinch:S,panOnScroll:j,panOnScrollSpeed:w,panOnScrollMode:M,zoomOnDoubleClick:v,panOnDrag:N,defaultViewport:L,translateExtent:T,minZoom:D,maxZoom:$,preventScrolling:B,onSelectionContextMenu:b,noWheelClassName:I,noPanClassName:_,disableKeyboardA11y:O,onViewportChange:P,isControlledViewport:z}){const{nodesSelectionActive:V,userSelectionActive:Z}=pe(f0),Y=hn(u,{target:Li}),ee=hn(y,{target:Li}),K=ee||N,Q=ee||j,J=d&&K!==!0,ne=Y||Z||J;return WS({deleteKeyCode:a,multiSelectionKeyCode:h}),i.jsxRuntimeExports.jsx(qS,{onPaneContextMenu:r,elementsSelectable:R,zoomOnScroll:k,zoomOnPinch:S,panOnScroll:Q,panOnScrollSpeed:w,panOnScrollMode:M,zoomOnDoubleClick:v,panOnDrag:!Y&&K,defaultViewport:L,translateExtent:T,minZoom:D,maxZoom:$,zoomActivationKeyCode:C,preventScrolling:B,noWheelClassName:I,noPanClassName:_,onViewportChange:P,isControlledViewport:z,paneClickDistance:c,children:i.jsxRuntimeExports.jsxs(e0,{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:J,children:[e,V&&i.jsxRuntimeExports.jsx(x0,{onSelectionContextMenu:b,noPanClassName:_,disableKeyboardA11y:O})]})})}Ta.displayName="FlowRenderer";const p0=g.memo(Ta),m0=e=>t=>e?Wc(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 h0(e){return pe(g.useCallback(m0(e),[e]),Se)}const g0=e=>e.updateNodeInternals;function E0(){const e=pe(g0),[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 y0({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const o=he(),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 j0({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:y,nodeTypes:C,nodeExtent:R,nodeClickDistance:k,onError:S}){const{node:j,internals:w,isParent:M}=pe(W=>{const ie=W.nodeLookup.get(e),de=W.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:de}},Se);let v=j.type||"default",N=(C==null?void 0:C[v])||Ni[v];N===void 0&&(S==null||S("003",Te.error003(v)),v="default",N=Ni.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=he(),b=Jc(j),I=y0({node:j,nodeType:v,hasDimensions:b,resizeObserver:x}),_=Pa({nodeRef:I,disabled:j.hidden||!L,noDragClassName:p,handleSelector:j.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:k}),O=Na();if(j.hidden)return null;const P=tt(j),z=u0(j),V=T||L||t||n||s||o,Z=n?W=>n(W,{...w.userNode}):void 0,Y=s?W=>s(W,{...w.userNode}):void 0,ee=o?W=>o(W,{...w.userNode}):void 0,K=r?W=>r(W,{...w.userNode}):void 0,Q=l?W=>l(W,{...w.userNode}):void 0,J=W=>{const{selectNodesOnDrag:ie,nodeDragThreshold:de}=B.getState();T&&(!ie||!L||de>0)&&No({id:e,store:B,nodeRef:I}),t&&t(W,{...w.userNode})},ne=W=>{if(!(wo(W.nativeEvent)||h))if(Hc.includes(W.key)&&T){const ie=W.key==="Escape";No({id:e,store:B,unselect:ie,nodeRef:I})}else L&&j.selected&&Object.prototype.hasOwnProperty.call(us,W.key)&&(B.setState({ariaLiveMessage:`Moved selected node ${W.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~w.positionAbsolute.x}, y: ${~~w.positionAbsolute.y}`}),O({direction:us[W.key],factor:W.shiftKey?4:1}))};return i.jsxRuntimeExports.jsx("div",{className:Ce(["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:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:b?"visible":"hidden",...j.style,...z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Z,onMouseMove:Y,onMouseLeave:ee,onContextMenu:K,onClick:J,onDoubleClick:Q,onKeyDown:$?ne:void 0,tabIndex:$?0:void 0,role:$?"button":void 0,"aria-describedby":h?void 0:`${Ra}-${y}`,"aria-label":j.ariaLabel,children:i.jsxRuntimeExports.jsx(n0,{value:e,children:i.jsxRuntimeExports.jsx(N,{id:e,data:j.data,type:v,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.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:w.z,parentId:j.parentId,...P})})})}const S0=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Aa(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,onError:r}=pe(S0,Se),l=h0(e.onlyRenderVisibleElements),c=E0();return i.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ls,children:l.map(a=>i.jsxRuntimeExports.jsx(j0,{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))})}Aa.displayName="NodeRenderer";const R0=g.memo(Aa);function C0(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&&bj({sourceNode:r,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(o.id)}return s},[e]),Se)}const b0=({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"}),w0=({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"}),Ti={[is.Arrow]:b0,[is.ArrowClosed]:w0};function v0(e){const t=he();return g.useMemo(()=>{var o,r;return Object.prototype.hasOwnProperty.call(Ti,e)?Ti[e]:((r=(o=t.getState()).onError)==null||r.call(o,"009",Te.error009(e)),null)},[e])}const _0=({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=v0(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},Ia=({defaultColor:e,rfId:t})=>{const n=pe(r=>r.edges),s=pe(r=>r.defaultEdgeOptions),o=g.useMemo(()=>Nj(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(_0,{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};Ia.displayName="MarkerDefinitions";var k0=g.memo(Ia);function $a({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=Ce(["react-flow__edge-textwrapper",u]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const y=h.current.getBBox();p({x:y.x,y:y.y,width:y.width,height:y.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]})}$a.displayName="EdgeText";const M0=g.memo($a);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:Ce(["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(M0,{x:n,y:s,label:o,labelStyle:r,labelShowBg:l,labelBgStyle:c,labelBgPadding:a,labelBgBorderRadius:u}):null]})}function Ai({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 Da({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:s,targetY:o,targetPosition:r=G.Top}){const[l,c]=Ai({pos:n,x1:e,y1:t,x2:s,y2:o}),[a,u]=Ai({pos:r,x1:s,y1:o,x2:e,y2:t}),[d,x,p,m]=sa({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 Oa(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:y,markerStart:C,interactionWidth:R})=>{const[k,S,j]=Da({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:r,targetPosition:c}),w=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:w,path:k,labelX:S,labelY:j,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:y,markerStart:C,interactionWidth:R})})}const P0=Oa({isInternal:!1}),za=Oa({isInternal:!0});P0.displayName="SimpleBezierEdge";za.displayName="SimpleBezierEdgeInternal";function Ba(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:y,markerStart:C,pathOptions:R,interactionWidth:k})=>{const[S,j,w]=vo({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:w,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,markerEnd:y,markerStart:C,interactionWidth:k})})}const Va=Ba({isInternal:!1}),Fa=Ba({isInternal:!0});Va.displayName="SmoothStepEdge";Fa.displayName="SmoothStepEdgeInternal";function Ha(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 N0=Ha({isInternal:!1}),Za=Ha({isInternal:!0});N0.displayName="StepEdge";Za.displayName="StepEdgeInternal";function Ga(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:y})=>{const[C,R,k]=ca({sourceX:n,sourceY:s,targetX:o,targetY:r}),S=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:S,path:C,labelX:R,labelY:k,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:p,markerEnd:m,markerStart:h,interactionWidth:y})})}const L0=Ga({isInternal:!1}),Ya=Ga({isInternal:!0});L0.displayName="StraightEdge";Ya.displayName="StraightEdgeInternal";function Wa(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:y,markerStart:C,pathOptions:R,interactionWidth:k})=>{const[S,j,w]=oa({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:w,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:p,labelBgBorderRadius:m,style:h,markerEnd:y,markerStart:C,interactionWidth:k})})}const T0=Wa({isInternal:!1}),Xa=Wa({isInternal:!0});T0.displayName="BezierEdge";Xa.displayName="BezierEdgeInternal";const Ii={default:Xa,straight:Ya,step:Za,smoothstep:Fa,simplebezier:za},$i={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},A0=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,I0=(e,t,n)=>n===G.Top?e-t:n===G.Bottom?e+t:e,Di="react-flow__edgeupdater";function Oi({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:Ce([Di,`${Di}-${c}`]),cx:A0(t,s,e),cy:I0(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function $0({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=he(),y=(j,w)=>{if(j.button!==0)return;const{autoPanOnConnect:M,domNode:v,isValidConnection:N,connectionMode:L,connectionRadius:T,lib:D,onConnectStart:$,onConnectEnd:B,cancelConnection:b,nodeLookup:I,rfId:_,panBy:O,updateConnection:P}=h.getState(),z=w.type==="target";p(!0),d==null||d(j,n,w.type);const V=(Y,ee)=>{p(!1),x==null||x(Y,n,w.type,ee)},Z=Y=>u==null?void 0:u(n,Y);Mo.onPointerDown(j.nativeEvent,{autoPanOnConnect:M,connectionMode:L,connectionRadius:T,domNode:v,handleId:w.id,nodeId:w.nodeId,nodeLookup:I,isTarget:z,edgeUpdaterType:w.type,lib:D,flowId:_,cancelConnection:b,panBy:O,isValidConnection:N,onConnect:Z,onConnectStart:$,onConnectEnd:B,onReconnectEnd:V,updateConnection:P,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle})},C=j=>y(j,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),R=j=>y(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(Oi,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:C,onMouseEnter:k,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&i.jsxRuntimeExports.jsx(Oi,{position:a,centerX:r,centerY:l,radius:t,onMouseDown:R,onMouseEnter:k,onMouseOut:S,type:"target"})]})}function D0({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:y,noPanClassName:C,onError:R,disableKeyboardA11y:k}){let S=pe(te=>te.edgeLookup.get(e));const j=pe(te=>te.defaultEdgeOptions);S=j?{...j,...S}:S;let w=S.type||"default",M=(y==null?void 0:y[w])||Ii[w];M===void 0&&(R==null||R("011",Te.error011(w)),w="default",M=Ii.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,b]=g.useState(!1),I=he(),{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,...$i};const fe=Pj({id:e,sourceNode:X,targetNode:se,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:te.connectionMode,onError:R});return{zIndex:Cj({selected:S.selected,zIndex:S.zIndex,sourceNode:X,targetNode:se,elevateOnSelect:te.elevateEdgesOnSelect}),...fe||$i}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),Se),ee=g.useMemo(()=>S.markerStart?`url('#${_o(S.markerStart,h)}')`:void 0,[S.markerStart,h]),K=g.useMemo(()=>S.markerEnd?`url('#${_o(S.markerEnd,h)}')`:void 0,[S.markerEnd,h]);if(S.hidden||O===null||P===null||z===null||V===null)return null;const Q=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)},J=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&&Hc.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:Ce(["react-flow__edge",`react-flow__edge-${w}`,S.className,C,{selected:S.selected,animated:S.animated,inactive:!L&&!o,updating:D,selectable:L}]),onClick:Q,onDoubleClick:J,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?`${Ca}-${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($0,{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:b})]})})}const O0=e=>({width:e.width,height:e.height,edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ka({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:y}){const{edgesFocusable:C,edgesReconnectable:R,elementsSelectable:k,onError:S}=pe(O0,Se),j=C0(t);return i.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[i.jsxRuntimeExports.jsx(k0,{defaultColor:e,rfId:n}),j.map(w=>i.jsxRuntimeExports.jsx(D0,{id:w,edgesFocusable:C,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:y},w))]})}Ka.displayName="EdgeRenderer";const z0=g.memo(Ka),B0=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function V0({children:e}){const t=pe(B0);return i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function F0(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 H0=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Z0(e){const t=pe(H0),n=he();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function G0(e){return e.connection.inProgress?{...e.connection,to:bn(e.connection.to,e.transform)}:{...e.connection}}function Y0(e){return G0}function W0(e){const t=Y0();return pe(t,Se)}const X0=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function K0({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:o,width:r,height:l,isValid:c,inProgress:a}=pe(X0,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:Ce(["react-flow__connection",Gc(c)]),children:i.jsxRuntimeExports.jsx(qa,{style:t,type:n,CustomComponent:s,isValid:c})})})}const qa=({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}=W0();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:Gc(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]=oa(h);break;case rt.SimpleBezier:[m]=Da(h);break;case rt.Step:[m]=vo({...h,borderRadius:0});break;case rt.SmoothStep:[m]=vo(h);break;default:[m]=ca(h)}return i.jsxRuntimeExports.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};qa.displayName="ConnectionLine";const q0={};function zi(e=q0){const t=g.useRef(e),n=he();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 U0(){const e=he(),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 Ua({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:y,connectionLineComponent:C,connectionLineContainerStyle:R,selectionKeyCode:k,selectionOnDrag:S,selectionMode:j,multiSelectionKeyCode:w,panActivationKeyCode:M,zoomActivationKeyCode:v,deleteKeyCode:N,onlyRenderVisibleElements:L,elementsSelectable:T,defaultViewport:D,translateExtent:$,minZoom:B,maxZoom:b,preventScrolling:I,defaultMarkerColor:_,zoomOnScroll:O,zoomOnPinch:P,panOnScroll:z,panOnScrollSpeed:V,panOnScrollMode:Z,zoomOnDoubleClick:Y,panOnDrag:ee,onPaneClick:K,onPaneMouseEnter:Q,onPaneMouseMove:J,onPaneMouseLeave:ne,onPaneScroll:W,onPaneContextMenu:ie,paneClickDistance:de,nodeClickDistance:ae,onEdgeContextMenu:te,onEdgeMouseEnter:X,onEdgeMouseMove:se,onEdgeMouseLeave:fe,reconnectRadius:Me,onReconnect:We,onReconnectStart:Ds,onReconnectEnd:Os,noDragClassName:Xt,noWheelClassName:zs,noPanClassName:Kt,disableKeyboardA11y:qt,nodeExtent:Bs,rfId:Ut,viewport:Qt,onViewportChange:vn}){return zi(e),zi(t),U0(),F0(n),Z0(Qt),i.jsxRuntimeExports.jsx(p0,{onPaneClick:K,onPaneMouseEnter:Q,onPaneMouseMove:J,onPaneMouseLeave:ne,onPaneContextMenu:ie,onPaneScroll:W,paneClickDistance:de,deleteKeyCode:N,selectionKeyCode:k,selectionOnDrag:S,selectionMode:j,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:w,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:b,onSelectionContextMenu:x,preventScrolling:I,noDragClassName:Xt,noWheelClassName:zs,noPanClassName:Kt,disableKeyboardA11y:qt,onViewportChange:vn,isControlledViewport:!!Qt,children:i.jsxRuntimeExports.jsxs(V0,{children:[i.jsxRuntimeExports.jsx(z0,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:We,onReconnectStart:Ds,onReconnectEnd:Os,onlyRenderVisibleElements:L,onEdgeContextMenu:te,onEdgeMouseEnter:X,onEdgeMouseMove:se,onEdgeMouseLeave:fe,reconnectRadius:Me,defaultMarkerColor:_,noPanClassName:Kt,disableKeyboardA11y:qt,rfId:Ut}),i.jsxRuntimeExports.jsx(K0,{style:y,type:h,component:C,containerStyle:R}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),i.jsxRuntimeExports.jsx(R0,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:r,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ae,onlyRenderVisibleElements:L,noPanClassName:Kt,noDragClassName:Xt,disableKeyboardA11y:qt,nodeExtent:Bs,rfId:Ut}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Ua.displayName="GraphView";const Q0=g.memo(Ua),Bi=({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??[],y=c??[0,0],C=a??fn;ua(x,p,m),ko(h,u,d,{nodeOrigin:y,nodeExtent:C,elevateNodesOnSelect:!1});let R=[0,0,1];if(l&&o&&r){const k=Cn(u,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:S,y:j,zoom:w}=ar(k,o,r,.5,2,.1);R=[S,j,w]}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:fn,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Rt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,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:{...Zc},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:cs,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},J0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a})=>ES((u,d)=>({...Bi({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:y}=d();ko(x,p,m,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:y,checkEquality:!0}),u({nodes:x})},setEdges:x=>{const{connectionLookup:p,edgeLookup:m}=d();ua(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:y,fitViewOnInit:C,fitViewDone:R,fitViewOnInitOptions:k,domNode:S,nodeOrigin:j,nodeExtent:w,debug:M,fitViewSync:v}=d(),{changes:N,updatedInternals:L}=$j(x,h,y,S,j,w);if(L){if(Tj(h,y,{nodeOrigin:j,nodeExtent:w}),p.triggerFitView){let T=R;!R&&C&&(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[y,C]of x){const R={id:y,type:"position",position:C.position,dragging:p};C!=null&&C.expandParent&&(C!=null&&C.parentId)&&R.position&&(m.push({id:y,parentId:C.parentId,rect:{...C.internals.positionAbsolute,width:C.measured.width,height:C.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:y,parentLookup:C,nodeOrigin:R}=d(),k=fr(m,y,C,R);h.push(...k)}d().triggerNodeChanges(h)},triggerNodeChanges:x=>{const{onNodesChange:p,setNodes:m,nodes:h,hasDefaultNodes:y,debug:C}=d();if(x!=null&&x.length){if(y){const R=va(x,h);m(R)}C&&console.log("React Flow: trigger node changes",x),p==null||p(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:p,setEdges:m,edges:h,hasDefaultEdges:y,debug:C}=d();if(x!=null&&x.length){if(y){const R=_a(x,h);m(R)}C&&console.log("React Flow: trigger edge changes",x),p==null||p(x)}},addSelectedNodes:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:y,triggerEdgeChanges:C}=d();if(p){const R=x.map(k=>mt(k,!0));y(R);return}y(Nt(h,new Set([...x]),!0)),C(Nt(m))},addSelectedEdges:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:y,triggerEdgeChanges:C}=d();if(p){const R=x.map(k=>mt(k,!0));C(R);return}C(Nt(m,new Set([...x]))),y(Nt(h,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:p}={})=>{const{edges:m,nodes:h,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:R}=d(),k=x||h,S=p||m,j=k.map(M=>{const v=y.get(M.id);return v&&(v.selected=!1),mt(M.id,!1)}),w=S.map(M=>mt(M.id,!1));C(j),R(w)},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(),y=p.reduce((R,k)=>k.selected?[...R,mt(k.id,!1)]:R,[]),C=x.reduce((R,k)=>k.selected?[...R,mt(k.id,!1)]:R,[]);m(y),h(C)},setNodeExtent:x=>{const{nodes:p,nodeLookup:m,parentLookup:h,nodeOrigin:y,elevateNodesOnSelect:C,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]||(ko(p,m,h,{nodeOrigin:y,nodeExtent:x,elevateNodesOnSelect:C,checkEquality:!1}),u({nodeExtent:x}))},panBy:x=>{const{transform:p,width:m,height:h,panZoom:y,translateExtent:C}=d();return Dj({delta:x,panZoom:y,transform:p,translateExtent:C,width:m,height:h})},fitView:x=>{const{panZoom:p,width:m,height:h,minZoom:y,maxZoom:C,nodeLookup:R}=d();if(!p)return Promise.resolve(!1);const k=Ro(R,x);return Co({nodes:k,width:m,height:h,panZoom:p,minZoom:y,maxZoom:C},x)},fitViewSync:x=>{const{panZoom:p,width:m,height:h,minZoom:y,maxZoom:C,nodeLookup:R}=d();if(!p)return!1;const k=Ro(R,x);return Co({nodes:k,width:m,height:h,panZoom:p,minZoom:y,maxZoom:C},x),k.size>0},cancelConnection:()=>{u({connection:{...Zc}})},updateConnection:x=>{u({connection:x})},reset:()=>u({...Bi()})}),Object.is);function Qa({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:o,initialHeight:r,fitView:l,nodeOrigin:c,nodeExtent:a,children:u}){const[d]=g.useState(()=>J0({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a}));return i.jsxRuntimeExports.jsx(yS,{value:d,children:i.jsxRuntimeExports.jsx(FS,{children:u})})}function e1({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:o,width:r,height:l,fitView:c,nodeOrigin:a,nodeExtent:u}){return g.useContext(Ns)?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:e}):i.jsxRuntimeExports.jsx(Qa,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:o,initialWidth:r,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:u,children:e})}const t1={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function n1({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:y,onClickConnectStart:C,onClickConnectEnd:R,onNodeMouseEnter:k,onNodeMouseMove:S,onNodeMouseLeave:j,onNodeContextMenu:w,onNodeDoubleClick:M,onNodeDragStart:v,onNodeDrag:N,onNodeDragStop:L,onNodesDelete:T,onEdgesDelete:D,onDelete:$,onSelectionChange:B,onSelectionDragStart:b,onSelectionDrag:I,onSelectionDragStop:_,onSelectionContextMenu:O,onSelectionStart:P,onSelectionEnd:z,onBeforeDelete:V,connectionMode:Z,connectionLineType:Y=rt.Bezier,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:Q,deleteKeyCode:J="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:ie=Dt.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:ae=as()?"Meta":"Control",zoomActivationKeyCode:te=as()?"Meta":"Control",snapToGrid:X,snapGrid:se,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:Me,nodesDraggable:We,nodesConnectable:Ds,nodesFocusable:Os,nodeOrigin:Xt=ba,edgesFocusable:zs,edgesReconnectable:Kt,elementsSelectable:qt=!0,defaultViewport:Bs=LS,minZoom:Ut=.5,maxZoom:Qt=2,translateExtent:vn=fn,preventScrolling:xx=!0,nodeExtent:Vs,defaultMarkerColor:fx="#b1b1b7",zoomOnScroll:px=!0,zoomOnPinch:mx=!0,panOnScroll:hx=!1,panOnScrollSpeed:gx=.5,panOnScrollMode:Ex=Et.Free,zoomOnDoubleClick:yx=!0,panOnDrag:jx=!0,onPaneClick:Sx,onPaneMouseEnter:Rx,onPaneMouseMove:Cx,onPaneMouseLeave:bx,onPaneScroll:wx,onPaneContextMenu:vx,paneClickDistance:Rr=0,nodeClickDistance:_x=0,children:kx,onReconnect:Mx,onReconnectStart:Px,onReconnectEnd:Nx,onEdgeContextMenu:Lx,onEdgeDoubleClick:Tx,onEdgeMouseEnter:Ax,onEdgeMouseMove:Ix,onEdgeMouseLeave:$x,reconnectRadius:Dx=10,onNodesChange:Ox,onEdgesChange:zx,noDragClassName:Bx="nodrag",noWheelClassName:Vx="nowheel",noPanClassName:Cr="nopan",fitView:br,fitViewOptions:Fx,connectOnClick:Hx,attributionPosition:Zx,proOptions:Gx,defaultEdgeOptions:Yx,elevateNodesOnSelect:Wx,elevateEdgesOnSelect:Xx,disableKeyboardA11y:wr=!1,autoPanOnConnect:Kx,autoPanOnNodeDrag:qx,autoPanSpeed:Ux,connectionRadius:Qx,isValidConnection:Jx,onError:ef,style:tf,id:vr,nodeDragThreshold:nf,viewport:sf,onViewportChange:of,width:rf,height:lf,colorMode:cf="light",debug:af,...uf},df){const Fs=vr||"1",xf=$S(cf);return i.jsxRuntimeExports.jsx("div",{...uf,style:{...tf,...t1},ref:df,className:Ce(["react-flow",o,xf]),"data-testid":"rf__wrapper",id:vr,children:i.jsxRuntimeExports.jsxs(e1,{nodes:e,edges:t,width:rf,height:lf,fitView:br,nodeOrigin:Xt,nodeExtent:Vs,children:[i.jsxRuntimeExports.jsx(Q0,{onInit:u,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:k,onNodeMouseMove:S,onNodeMouseLeave:j,onNodeContextMenu:w,onNodeDoubleClick:M,nodeTypes:r,edgeTypes:l,connectionLineType:Y,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:Q,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:ie,deleteKeyCode:J,multiSelectionKeyCode:ae,panActivationKeyCode:de,zoomActivationKeyCode:te,onlyRenderVisibleElements:fe,defaultViewport:Bs,translateExtent:vn,minZoom:Ut,maxZoom:Qt,preventScrolling:xx,zoomOnScroll:px,zoomOnPinch:mx,zoomOnDoubleClick:yx,panOnScroll:hx,panOnScrollSpeed:gx,panOnScrollMode:Ex,panOnDrag:jx,onPaneClick:Sx,onPaneMouseEnter:Rx,onPaneMouseMove:Cx,onPaneMouseLeave:bx,onPaneScroll:wx,onPaneContextMenu:vx,paneClickDistance:Rr,nodeClickDistance:_x,onSelectionContextMenu:O,onSelectionStart:P,onSelectionEnd:z,onReconnect:Mx,onReconnectStart:Px,onReconnectEnd:Nx,onEdgeContextMenu:Lx,onEdgeDoubleClick:Tx,onEdgeMouseEnter:Ax,onEdgeMouseMove:Ix,onEdgeMouseLeave:$x,reconnectRadius:Dx,defaultMarkerColor:fx,noDragClassName:Bx,noWheelClassName:Vx,noPanClassName:Cr,rfId:Fs,disableKeyboardA11y:wr,nodeExtent:Vs,viewport:sf,onViewportChange:of}),i.jsxRuntimeExports.jsx(IS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:m,onConnectStart:h,onConnectEnd:y,onClickConnectStart:C,onClickConnectEnd:R,nodesDraggable:We,nodesConnectable:Ds,nodesFocusable:Os,edgesFocusable:zs,edgesReconnectable:Kt,elementsSelectable:qt,elevateNodesOnSelect:Wx,elevateEdgesOnSelect:Xx,minZoom:Ut,maxZoom:Qt,nodeExtent:Vs,onNodesChange:Ox,onEdgesChange:zx,snapToGrid:X,snapGrid:se,connectionMode:Z,translateExtent:vn,connectOnClick:Hx,defaultEdgeOptions:Yx,fitView:br,fitViewOptions:Fx,onNodesDelete:T,onEdgesDelete:D,onDelete:$,onNodeDragStart:v,onNodeDrag:N,onNodeDragStop:L,onSelectionDrag:I,onSelectionDragStart:b,onSelectionDragStop:_,onMove:d,onMoveStart:x,onMoveEnd:p,noPanClassName:Cr,nodeOrigin:Xt,rfId:Fs,autoPanOnConnect:Kx,autoPanOnNodeDrag:qx,autoPanSpeed:Ux,onError:ef,connectionRadius:Qx,isValidConnection:Jx,selectNodesOnDrag:Me,nodeDragThreshold:nf,onBeforeDelete:V,paneClickDistance:Rr,debug:af}),i.jsxRuntimeExports.jsx(NS,{onSelectionChange:B}),kx,i.jsxRuntimeExports.jsx(vS,{proOptions:Gx,position:Zx}),i.jsxRuntimeExports.jsx(bS,{rfId:Fs,disableKeyboardA11y:wr})]})})}var s1=ka(n1);function o1(){const e=he();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 r1({onStart:e,onChange:t,onEnd:n}){const s=he();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function i1({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:Ce(["react-flow__background-pattern",n,s])})}function l1({radius:e,className:t}){return i.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Ce(["react-flow__background-pattern","dots",t])})}var ct;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ct||(ct={}));const c1={[ct.Dots]:1,[ct.Lines]:1,[ct.Cross]:6},a1=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ja({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(a1,Se),h=s||c1[t],y=t===ct.Dots,C=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],w=C?[S,S]:k,M=[j[0]*p[2]||1+w[0]/2,j[1]*p[2]||1+w[1]/2],v=`${m}${e||""}`;return i.jsxRuntimeExports.jsxs("svg",{className:Ce(["react-flow__background",u]),style:{...a,...Ls,"--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:y?i.jsxRuntimeExports.jsx(l1,{radius:S/2,className:d}):i.jsxRuntimeExports.jsx(i1,{dimensions:w,lineWidth:o,variant:t,className:d})}),i.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${v})`})]})}Ja.displayName="Background";const u1=g.memo(Ja);function d1(){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 x1(){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 f1(){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 p1(){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 m1(){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 In({children:e,className:t,...n}){return i.jsxRuntimeExports.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const h1=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function eu({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=he(),{isInteractive:y,minZoomReached:C,maxZoomReached:R}=pe(h1,Se),{zoomIn:k,zoomOut:S,fitView:j}=wt(),w=()=>{k(),r==null||r()},M=()=>{S(),l==null||l()},v=()=>{j(o),c==null||c()},N=()=>{h.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),a==null||a(!y)},L=p==="horizontal"?"horizontal":"vertical";return i.jsxRuntimeExports.jsxs(pr,{className:Ce(["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(In,{onClick:w,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:R,children:i.jsxRuntimeExports.jsx(d1,{})}),i.jsxRuntimeExports.jsx(In,{onClick:M,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:C,children:i.jsxRuntimeExports.jsx(x1,{})})]}),n&&i.jsxRuntimeExports.jsx(In,{className:"react-flow__controls-fitview",onClick:v,title:"fit view","aria-label":"fit view",children:i.jsxRuntimeExports.jsx(f1,{})}),s&&i.jsxRuntimeExports.jsx(In,{className:"react-flow__controls-interactive",onClick:N,title:"toggle interactivity","aria-label":"toggle interactivity",children:y?i.jsxRuntimeExports.jsx(m1,{}):i.jsxRuntimeExports.jsx(p1,{})}),d]})}eu.displayName="Controls";g.memo(eu);function g1({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:y}=r||{},C=l||h||y;return i.jsxRuntimeExports.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:p},u]),x:t,y:n,rx:d,ry:d,width:s,height:o,style:{fill:C,stroke:c,strokeWidth:a},shapeRendering:x,onClick:m?R=>m(R,e):void 0})}const E1=g.memo(g1),y1=e=>e.nodes.map(t=>t.id),io=e=>e instanceof Function?e:()=>e;function j1({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:r=E1,onClick:l}){const c=pe(y1,Se),a=io(t),u=io(e),d=io(n),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:c.map(p=>i.jsxRuntimeExports.jsx(R1,{id:p,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:r,onClick:l,shapeRendering:x},p))})}function S1({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 y=h.nodeLookup.get(e),{x:C,y:R}=y.internals.positionAbsolute,{width:k,height:S}=tt(y);return{node:y,x:C,y:R,width:k,height:S}},Se);return!u||u.hidden||!Jc(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 R1=g.memo(S1);var C1=g.memo(j1);const b1=200,w1=150,v1=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?Uc(Cn(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},_1="react-flow__minimap-desc";function tu({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:y=!1,zoomable:C=!1,ariaLabel:R="React Flow mini map",inversePan:k,zoomStep:S=10,offsetScale:j=5}){const w=he(),M=g.useRef(null),{boundingRect:v,viewBB:N,rfId:L,panZoom:T,translateExtent:D,flowWidth:$,flowHeight:B}=pe(v1,Se),b=(e==null?void 0:e.width)??b1,I=(e==null?void 0:e.height)??w1,_=v.width/b,O=v.height/I,P=Math.max(_,O),z=P*b,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,Q=V+Z*2,J=`${_1}-${L}`,ne=g.useRef(0),W=g.useRef();ne.current=P,g.useEffect(()=>{if(M.current&&T)return W.current=Gj({domNode:M.current,panZoom:T,getTransform:()=>w.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:y,zoomStep:S,zoomable:C})},[y,C,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=w.getState().nodeLookup.get(te);h(ae,X)},[]):void 0;return i.jsxRuntimeExports.jsx(pr,{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:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:i.jsxRuntimeExports.jsxs("svg",{width:b,height:I,viewBox:`${Y} ${ee} ${K} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":J,ref:M,onClick:ie,children:[R&&i.jsxRuntimeExports.jsx("title",{id:J,children:R}),i.jsxRuntimeExports.jsx(C1,{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${Q+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"})]})})}tu.displayName="MiniMap";g.memo(tu);function k1({nodeId:e,position:t,variant:n=rn.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:y}){const C=La(),R=typeof e=="string"?e:C,k=he(),S=g.useRef(null),j=n===rn.Line?"right":"bottom-right",w=t??j,M=g.useRef(null);g.useEffect(()=>{if(!(!S.current||!R))return M.current||(M.current=iS({domNode:S.current,nodeId:R,getStoreItems:()=>{const{nodeLookup:T,transform:D,snapGrid:$,snapToGrid:B,nodeOrigin:b,domNode:I}=k.getState();return{nodeLookup:T,transform:D,snapGrid:$,snapToGrid:B,nodeOrigin:b,paneDomNode:I}},onChange:(T,D)=>{const{triggerNodeChanges:$,nodeLookup:B,parentLookup:b,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,...ea({x:T.x??P.position.x,y:T.y??P.position.y},{width:V,height:Z},P.parentId,B,z)}},ee=fr([Y],B,b,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:w,boundaries:{minWidth:c,minHeight:a,maxWidth:u,maxHeight:d},keepAspectRatio:x,onResizeStart:m,onResize:h,onResizeEnd:y,shouldResize:p}),()=>{var T;(T=M.current)==null||T.destroy()}},[w,c,a,u,d,x,m,h,y,p]);const v=w.split("-"),N=n===rn.Line?"borderColor":"backgroundColor",L=l?{...o,[N]:l}:o;return i.jsxRuntimeExports.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...v,n,s]),ref:S,style:L,children:r})}g.memo(k1);const M1=(e,t)=>e.map((n,s)=>f.G.translate(n,t[s])),nu=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:f.cssString(t)},...n}),P1=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:f.cssString(t),strokeDasharray:"12,4"},...n}),N1=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:f.cssString(t),strokeDasharray:"12,4,4"},...n}),L1=({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})]})},Vi=15,T1=(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)<Vi||f.G.distance(p,u)<Vi)&&n.push({position:p,direction:m})}r+=a}return n},A1=({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"})},I1=({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"})]})},$1=({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}),hr=(e,t={})=>{const n=({points:s,color:o,...r})=>{const l=at(s),c=T1(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},D1=hr(A1),O1=hr(I1),z1=hr($1),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},su={pipe:nu,electric:P1,secondary:N1,jacketed:L1,hydraulic:D1,pneumatic:O1,data:z1},ou=nu,ru=[{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"}],B1=e=>i.jsxRuntimeExports.jsx(Re.DropdownButton,{columns:[{key:"name",name:"Type"}],data:ru,style:{width:200},entryRenderKey:"name",...e}),Ts=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=Ts(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)=>As.fromFlow(e,t);class iu{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 As{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=Ts(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 iu(d,p)});return new As(t,s,c)}}const F1=({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=Mt({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=dc(f.G.construct(e,t),p,x.getZoom(),!1);return i.jsxRuntimeExports.jsx(ou,{points:m,style:{...c,stroke:f.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},H1=({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),y=f.G.equals(m,h.current),C=f.G.construct(p.targetX,p.targetY),R=g.useRef(C),k=f.G.equals(C,R.current),S=wt(),[j,w,M]=E.useCombinedStateAndRef(()=>c.length>0?c:Mt({sourcePos:m,targetPos:C,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),v=g.useRef(r),N=g.useRef(s),L=E.useDebouncedCallback(a,100,[a]);if(!y||!k){let b=j;const I=f.G.translation(h.current,m),_=f.G.translation(C,R.current);f.G.equals(I,f.G.scale(_,-1),.001)?(h.current=m,R.current=C):(y?k||(b=ag({delta:_,segments:b}),v.current!==r&&(v.current=r,b=Mt({sourcePos:m,targetPos:C,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),Vr({sourcePos:m,targetPos:C,next:b,prev:j})||(b=Mt({sourcePos:m,targetPos:C,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),R.current=C):(b=cg({delta:I,segments:b}),N.current!==s&&(N.current=s,b=Mt({sourcePos:m,targetPos:C,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),Vr({sourcePos:m,targetPos:C,next:b,prev:j})||(b=Mt({sourcePos:m,targetPos:C,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(S,t),targetBox:Ne(S,n)})),h.current=m),L(b),w(b))}const T=g.useRef(null),D=E.useCursorDrag({onStart:g.useCallback((b,I,_)=>{T.current={index:Number(_.currentTarget.id.split("-")[1]),segments:[...M.current]}},[]),onMove:g.useCallback(b=>{if(T.current==null)return;const I=og({segments:T.current.segments,index:T.current.index,magnitude:f.Eo.dim(b,f.g.swap(T.current.segments[T.current.index].direction),!0)/S.getZoom()});w(I)},[]),onEnd:g.useCallback(()=>a(M.current),[a])}),$=dc(m,j,S.getZoom(),!0),B=su[x];return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(B,{points:$,color:u}),d&&Z1($).map((b,I)=>{const _=j[I].direction,O=f.g.swap(_),P={[f.g.dimension(_)]:"18px",[f.g.dimension(O)]:"4px"},z={[_]:b[_]-9,[O]:b[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:b.x-9,y:b.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)})]})},Z1=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)}),G1=({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}},Y1=()=>!0,W1={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},X1={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},lu={maxZoom:1,minZoom:.5},K1={hideAttribution:!0},cu=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),wn=()=>g.useContext(cu),au=g.memo(({children:e})=>{const{registerNodeRenderer:t}=wn();return g.useEffect(()=>t(e),[t,e]),null});au.displayName="NodeRenderer";const q1=["Backspace","Delete"],U1=E.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 y=E.useMemoDeepEqualProps({visible:m}),[{path:C},,R]=E.use$3({aetherKey:e,type:A.Diagram$1.TYPE,schema:A.diagramStateZ,initialState:{position:a.position,region:f.Eo.ZERO,zoom:a.zoom,...y}});g.useEffect(()=>R(X=>({...X,...y})),[y]);const k=E.use().colors.gray.l9.hex,S=E.useMemoCompare(()=>u??Fo.zoom,E.compareModeConfigs,[u]),{fitView:j}=wt(),w=E.useDebouncedCallback(X=>j(X),50,[j]),M=En(g.useCallback(X=>{x&&w({maxZoom:1}),R(se=>({...se,region:X}))},[R,w,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(gc(X))))},[R,d]);r1({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:We=!0})=>L({symbolKey:X,position:{x:se,y:fe},selected:Me,draggable:We})}),[L]),B=g.useRef(r),b=g.useMemo(()=>(B.current=r,nr(r)),[r]),I=g.useRef(o),_=g.useMemo(()=>(I.current=o,tr(o)),[o]),O=g.useCallback(X=>n(Ec(I.current,se=>va(X,se))),[n]),P=g.useCallback(X=>s(Bn(B.current,se=>_a(X,se),k)),[s,k]),z=g.useCallback((X,se)=>s(Bn(B.current,fe=>vj(X,se,fe),k)),[]),V=g.useCallback(X=>{s(Bn(B.current,se=>la(X,se),k))},[s,k]),Z=g.useCallback((X,se)=>{const fe=[...B.current],Me=fe.findIndex(We=>We.key===X);Me!==-1&&(fe[Me]={...fe[Me],segments:se},B.current=fe,s(fe))},[s]),Y=c?W1:X1,ee=E.useSyncedRef(Z),K=g.useMemo(()=>({default:X=>{var se,fe,Me;return i.jsxRuntimeExports.jsx(H1,{...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(We=>ee.current(X.id,We),[X.id])},X.id)}}),[]),Q=E.useHeld({triggers:[["Q"]],loose:!0}),J=g.useRef(null);E.use$1({triggers:S.zoomReset,callback:g.useCallback(({stage:X,cursor:se})=>{const fe=J.current;fe==null||X!=="start"||!f.Eo.contains(fe,se)||j()},[j])});const ne=E.purgeMouse(S.select)[0]??null,W=E.purgeMouse(S.pan)[0]??null,ie=E.purgeMouse(S.zoom)[0]??null,de={selectionOnDrag:ne==null,panOnDrag:W==null,selectionKeyCode:ne,panActivationKeyCode:W,zoomActivationKeyCode:ie},ae=E.useCombinedRefs(J,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(cu.Provider,{value:te,children:i.jsxRuntimeExports.jsx(E.Composite,{path:C,children:m&&i.jsxRuntimeExports.jsx(s1,{...de,className:f.CSS(f.CSS.B("diagram"),f.CSS.editable(c)),nodes:_,edges:b,nodeTypes:$,edgeTypes:K,ref:ae,fitView:!0,onNodesChange:O,onEdgesChange:P,onConnect:V,onReconnect:z,defaultViewport:hc(a),connectionLineComponent:F1,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:Y1,connectionMode:Rt.Loose,fitViewOptions:lu,selectionMode:Dt.Partial,proOptions:K1,deleteKeyCode:q1,...h,style:{[f.CSS.var("diagram-zoom")]:a.zoom,...h.style},...Y,nodesDraggable:c&&!Q.held,children:t})})})}),Q1=()=>{const{editable:e}=wn();return e?i.jsxRuntimeExports.jsx(u1,{}):null},J1=({children:e,...t})=>i.jsxRuntimeExports.jsx(U.Pack,{direction:"y",borderShade:4,className:f.CSS.BE("diagram","controls"),...t,children:e}),eR=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=wn();return i.jsxRuntimeExports.jsx(E.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:f.K.RIGHT_CENTER,tooltip:n?i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Disable edit mode"}):i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?i.jsxRuntimeExports.jsx(E.e4.EditOff,{}):i.jsxRuntimeExports.jsx(E.e4.Edit,{})})},tR=({onClick:e,...t})=>{const{fitView:n}=wt(),{fitViewOnResize:s,setFitViewOnResize:o}=wn();return i.jsxRuntimeExports.jsx(E.ToggleIcon,{onClick:r=>{n(lu),e==null||e(r)},value:s,onChange:r=>o(r),rightClickToggle:!0,tooltip:i.jsxRuntimeExports.jsx(E.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:f.K.RIGHT_CENTER,variant:"outlined",...t,children:i.jsxRuntimeExports.jsx(E.e4.Expand,{})})},nR=e=>i.jsxRuntimeExports.jsx(Qa,{children:i.jsxRuntimeExports.jsx(U1,{...e})}),sR=Object.freeze(Object.defineProperty({__proto__:null,Background:Q1,Controls:J1,DefaultPath:ou,Diagram:nR,FitViewControl:tR,HandleLayout:iu,NodeLayout:As,NodeRenderer:au,PATHS:su,PATH_TYPES:ru,SelectPathType:B1,ToggleEditControl:eR,alignNodes:fg,calcPath:at,edgeConverter:Bn,edgeZ:dg,nodeConverter:Ec,nodeZ:xg,offsetPath:M1,rfEdgeDataZ:fc,selectNode:Ts,selectNodeBox:Ne,selectNodeLayout:V1,translateEdgesBackward:mc,translateEdgesForward:nr,translateNodesBackward:pc,translateNodesForward:tr,translateViewportBackward:gc,translateViewportForward:hc,use:G1,useContext:wn,viewportZ:ug},Symbol.toStringTag,{value:"Module"})),oR=E.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:o=i.jsxRuntimeExports.jsx(E.Text$2.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:r,telem:l,...c})=>{const a=E.useMemoDeepEqualProps({font:t,color:r,telem:l,visible:s}),[,{scrolling:u,empty:d},x]=E.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=En(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(E.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(E.e4.Dynamic,{})})})}),rR=Object.freeze(Object.defineProperty({__proto__:null,Log:oR},Symbol.toStringTag,{value:"Module"})),iR=({value:e,showOuter:t=!0,showInner:n,onChange:s})=>{const{outer:o}=e,r=l=>()=>s({...e,...l});return t?i.jsxRuntimeExports.jsxs(U.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(U.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(lt,{selected:o==="left",onClick:r({outer:"left"})}),i.jsxRuntimeExports.jsx(Fi,{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(Fi,{className:f.CSS.B("orientation-control"),value:e,onChange:s})},Fi=({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(U.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(U.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(E.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(U.Space,{direction:t,align:"stretch",className:f.CSS(f.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),ft=({showOuter:e,showInner:t,...n})=>i.jsxRuntimeExports.jsx(me,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:o})=>{var r;return i.jsxRuntimeExports.jsx(iR,{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}})})}}),vt=({path:e,omit:t=[]})=>i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(me,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>i.jsxRuntimeExports.jsx(E.Text$1,{selectOnFocus:!0,...n})}),i.jsxRuntimeExports.jsx(Tt,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px",dragScale:{x:1,y:.5}},padHelpText:!1}),i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...n})}),i.jsxRuntimeExports.jsx(me,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>i.jsxRuntimeExports.jsx(ms,{...n})}),i.jsxRuntimeExports.jsx(me,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:n=>i.jsxRuntimeExports.jsx(hl,{...n,yDirection:"down"})})]}),Ze=e=>i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...o})=>i.jsxRuntimeExports.jsx(E.Swatch,{value:t??f.ZERO.setAlpha(1).rgba255,onChange:r=>n(r.rgba255),...o,bordered:!0})}),uu=e=>i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:t=>i.jsxRuntimeExports.jsx(E.Numeric,{dragScale:1,bounds:{lower:.5,upper:15},...t})}),ke=({omit:e})=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{omit:e,path:"label"}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Ze,{path:"color",optional:!0}),i.jsxRuntimeExports.jsx(me,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:t=>i.jsxRuntimeExports.jsx(E.Switch$1,{...t})}),i.jsxRuntimeExports.jsx(uu,{path:"scale"})]})]}),i.jsxRuntimeExports.jsx(ft,{path:""})]}),lR=({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(gs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},gr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],we=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(lR,{path:""});default:return i.jsxRuntimeExports.jsx(ke,{})}},[]),t=je.useStatic({tabs:gr,content:e});return i.jsxRuntimeExports.jsx(je.Tabs,{...t})},ht={y:2,x:.25},ln={lower:0,upper:2e3},Hi={lower:0,upper:51},du=({includeBorderRadius:e=!1})=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ze,{path:"color"}),i.jsxRuntimeExports.jsx(Ze,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(me,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:t,dragScale:ht,bounds:Hi,endContent:"%",...n})}),i.jsxRuntimeExports.jsx(me,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:t,dragScale:ht,bounds:Hi,endContent:"%",...n})}),e&&i.jsxRuntimeExports.jsx(me,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:t,dragScale:ht,bounds:ln,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:t??200,dragScale:ht,bounds:ln,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:t??200,dragScale:ht,bounds:ln,endContent:"px",...n})})]})]}),i.jsxRuntimeExports.jsx(ft,{path:"",showInner:!1})]}),xu=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],cR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsxs($e,{direction:"y",empty:!0,children:[i.jsxRuntimeExports.jsx(Jo,{path:""}),";"]});default:return i.jsxRuntimeExports.jsxs($e,{direction:"x",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ze,{path:"color"}),i.jsxRuntimeExports.jsx(me,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(E.Text$1,{...s})}),i.jsxRuntimeExports.jsx(Tt,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...s})})]})]}),i.jsxRuntimeExports.jsx(ft,{path:"",showInner:!1})]})}},[]),t=je.useStatic({tabs:xu,content:e});return i.jsxRuntimeExports.jsx(je.Tabs,{...t})},aR=({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=ps(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(E.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(E.Numeric,{value:r.trueBound.upper??1.1,onChange:d=>c({...r.trueBound,upper:d})})})]})},uR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsx(aR,{path:""});default:return i.jsxRuntimeExports.jsx(ke,{})}},[]),t=je.useStatic({tabs:xu,content:e});return i.jsxRuntimeExports.jsx(je.Tabs,{...t})},dR=({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(Tt,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),i.jsxRuntimeExports.jsx(gs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},xR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(dR,{path:""});default:return i.jsxRuntimeExports.jsx(ke,{omit:["align","maxInlineSize"]})}},[]),t=je.useStatic({tabs:gr,content:e});return i.jsxRuntimeExports.jsx(je.Tabs,{...t})},fR=({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})})]})},pR=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(fR,{path:""});default:return i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsx(Yo,{path:"units",label:"Units",align:"start",padHelpText:!1}),i.jsxRuntimeExports.jsx(Ze,{path:"color"})]}),i.jsxRuntimeExports.jsx(ft,{path:""})]})}},[]),t=je.useStatic({tabs:gr,content:e});return i.jsxRuntimeExports.jsx(je.Tabs,{...t})},mR=()=>{const e=xt({path:"autoFit",optional:!0});return i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(me,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>i.jsxRuntimeExports.jsx(E.Text$1,{selectOnFocus:!0,...t})}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Text Size",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>i.jsxRuntimeExports.jsx(ms,{...t})})]}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ze,{path:"color"}),i.jsxRuntimeExports.jsx(me,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(E.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:i.jsxRuntimeExports.jsx(E.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(E.e4.AutoFitWidth,{})})})})]})]}),i.jsxRuntimeExports.jsx(ft,{path:""})]})},hR=()=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label",omit:["maxInlineSize","align"]}),i.jsxRuntimeExports.jsx(Ze,{path:"color"})]}),i.jsxRuntimeExports.jsx(ft,{path:"",showOuter:!1})]}),gR=()=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,empty:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ze,{path:"color"}),i.jsxRuntimeExports.jsx(Ze,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:e??200,dragScale:ht,bounds:ln,endContent:"px",...t})}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>i.jsxRuntimeExports.jsx(E.Numeric,{value:e??200,dragScale:ht,bounds:ln,endContent:"px",...t})})]})]}),i.jsxRuntimeExports.jsx(ft,{path:"",showInner:!1})]}),Gt=()=>i.jsxRuntimeExports.jsxs($e,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(U.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(U.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Ze,{path:"color"}),i.jsxRuntimeExports.jsx(uu,{path:"scale"}),i.jsxRuntimeExports.jsx(gs,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),i.jsxRuntimeExports.jsx(ft,{path:""})]}),q=e=>i.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),nt=e=>i.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Ye=e=>i.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),xe=e=>i.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),ER={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}},yR=(e,t)=>ER[t][e],jR=(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}},SR=(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=o1()}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=SR(r,s,t,n);return i.jsxRuntimeExports.jsx(gn,{position:jR(yR(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}%`}})},Ee=({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}),ye=({className:e,...t})=>i.jsxRuntimeExports.jsx("div",{className:f.CSS(f.CSS.B("symbol-primitive"),e),...t}),RR=.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=E.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*RR).width,...r},children:i.jsxRuntimeExports.jsx("g",{children:n})})},fu=({className:e,orientation:t="left",scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),pu=({color:e,orientation:t="left",scale:n,...s})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),mu=({orientation:e="left",color:t,scale:n,...s})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})})]}),hu=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:o,...r})=>i.jsxRuntimeExports.jsxs(Ee,{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"})]})]}),gu=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(Ee,{className:f.CSS(f.CSS.B("relief-valve"),e),enabled:o,...r,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"})]})]}),Eu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),yu=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const r=f.cssString(n);return i.jsxRuntimeExports.jsxs(ye,{...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(Ye,{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"})]})]})},ju=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),Su=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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)})]})]}),Ru=({className:e,color:t,orientation:n="left",scale:s,...o})=>{const r=f.cssString(t);return i.jsxRuntimeExports.jsxs(ye,{...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"})]})]})},Cu=({className:e,color:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{...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"})]})]}),bu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})})]}),wu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})})]}),vu=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...r,orientation:t,className:f.CSS(f.CSS.B("manual-valve"),e),enabled: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"})]})]}),_u=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),ku=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})})]}),Mu=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,CR=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}%`},Pu={width:40,height:80},Er={x:50,y:10},Is=({className:e,dimensions:t=Pu,borderRadius:n=Er,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=Mu(n),a=s==null,u=E.use(),d=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]);return i.jsxRuntimeExports.jsx(ye,{className:f.CSS(e,f.CSS.B("tank")),style:{...t,borderRadius:s??CR(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"})]})})},Nu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),Lu=({className:e,orientation:t="left",scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),Tu=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...r,orientation:t,className:f.CSS(f.CSS.B("needle-valve"),e),enabled: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"})]})]}),Au=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...r,orientation:n,className:f.CSS(f.CSS.B("angled-relief-valve"),t),enabled:o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:79},orientation:n,color:e,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"})]})]}),Iu=({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=E.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(ye,{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(E.Text,{level:r,color:x,children:o})})]})},$u=({enabled:e=!1,onClick:t,orientation:n="left"})=>i.jsxRuntimeExports.jsxs(ye,{orientation:n,children:[i.jsxRuntimeExports.jsx(E.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"})]})]}),Du=({onClick:e,orientation:t="left",label:n="",color:s,size:o,level:r,onClickDelay:l})=>i.jsxRuntimeExports.jsxs(ye,{orientation:t,children:[i.jsxRuntimeExports.jsx(E.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"})]})]}),Ou=({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(ye,{style:a,orientation:t,className:f.CSS(f.CSS.B("text-box"),f.CSS.loc(t),e),children:i.jsxRuntimeExports.jsx(E.Text,{color:f.cssString(o),level:r,children:n})})},zu=({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(ye,{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(E.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(E.Button,{variant:"outlined",size:"small",onClick:()=>c(u),color:l,children:"Set"})})]})},Bu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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)})]})]}),Vu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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)})]})]}),Fu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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)})]})]}),Hu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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"})]})]}),Zu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{...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"})]})]}),Gu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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)})]})]}),Yu=({className:e,color:t,orientation:n="left",enabled:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ye,{...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(Ye,{cx:"32",cy:"32",r:"30"})})]}),Wu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),Xu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),Ku=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),qu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),Uu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),Qu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...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})]})]}),Ju=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(Ee,{...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"})]})]}),ed=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(Ee,{...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(Ye,{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"})]})]}),td=({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(ye,{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(E.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"})]})})})]})},nd=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})})]}),sd=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})]})]}),od=({className:e,dimensions:t=Pu,borderRadius:n=Er,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=Mu(n),a=E.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(ye,{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"})]})]})},rd=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>{const l=f.cssString(n);return i.jsxRuntimeExports.jsxs(Ee,{...r,orientation:t,className:f.CSS(f.CSS.B("spring-loaded-relief-valve"),e),enabled: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:l}),i.jsxRuntimeExports.jsx(q,{d:"M71 38.0014V72.0014",stroke:l,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:l}),i.jsxRuntimeExports.jsx(Ye,{cx:"44",cy:"55",r:"4",fill:l}),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:l,strokeWidth:1})]})]})},id=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>{const l=f.cssString(n);return i.jsxRuntimeExports.jsxs(Ee,{...r,orientation:t,className:f.CSS(f.CSS.B("spring-loaded-relief-valve"),e),enabled: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(Ye,{cx:"21",cy:"56.0737",r:"4",fill:l}),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:l,strokeLinecap:"round"})]})]})},ld=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{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"})})]}),bR=({aetherKey:e,sink:t})=>{const n=E.useMemoDeepEqualProps({sink:t}),[,,s]=E.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])}},wR=({aetherKey:e,source:t})=>{const n=E.useMemoDeepEqualProps({source:t}),[,{enabled:s},o]=E.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}},vR="Schematic.Grid",_R=e=>{const n=Ts(e).closest(".react-flow__pane");n!=null&&E.triggerReflow(n)},$s=e=>{const t=({symbolKey:s,items:o,onLocationChange:r})=>{const l=`${s}.${vR}`,[c,a]=g.useState(!1),u=g.useCallback(({items:C})=>C.every(R=>R.type===l),[l]),d=E.useSyncedRef(r),{startDrag:x,onDragEnd:p,...m}=E.useDragAndDrop({type:l,canDrop:u,onDrop:g.useCallback(({items:C})=>C,[]),onDragOver:g.useCallback(C=>{a(u(C)),C.items.forEach(({key:R})=>d.current(R,e))},[])}),h=o.filter(C=>C.location===e),y=g.useCallback((C,R)=>x([{key:R,type:l}]),[x,l]);return i.jsxRuntimeExports.jsx(U.Space,{direction:f.K.direction(e),className:f.CSS(f.CSS.BE("grid","item"),f.CSS.loc(e),f.CSS.dropRegion(!0),c&&f.CSS.B("dragging-over")),onDragLeave:()=>a(!1),empty:!0,...m,children:h.map(({element:C,key:R})=>i.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(C,{draggable:!0,onDragStart:k=>y(k,R),onDragEnd:p,style:{...C.props.style,cursor:"grab"}})},R))})};return({symbolKey:s,...o})=>{const{editable:r,items:l}=o,c=g.useRef(r);if(r!==c.current&&e==="top"&&(_R(s),c.current=r),r)return i.jsxRuntimeExports.jsx(t,{symbolKey:s,...o});const a=l.filter(u=>u.location===e);return a.length===0?null:i.jsxRuntimeExports.jsx(U.Space,{direction:f.K.direction(e),className:f.CSS(f.CSS.BE("grid","item"),f.CSS.loc(e)),empty:!0,children:a.map(({element:u,key:d})=>i.jsxRuntimeExports.jsx(g.Fragment,{children:u},d))})}},kR=$s("top"),MR=$s("left"),PR=$s("right"),NR=$s("bottom"),_t=({editable:e,onRotate:t,children:n,...s})=>i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(kR,{editable:e,...s}),i.jsxRuntimeExports.jsx(MR,{editable:e,...s}),i.jsxRuntimeExports.jsx(PR,{editable:e,...s}),i.jsxRuntimeExports.jsx(NR,{editable:e,...s}),e&&i.jsxRuntimeExports.jsx(E.Icon,{className:f.CSS.BE("grid","rotate"),size:"small",variant:"filled",onClick:t,children:i.jsxRuntimeExports.jsx(E.e4.Rotate,{})}),n]}),LR=({aetherKey:e,source:t,sink:n})=>{const s=E.useMemoDeepEqualProps({source:t,sink:n}),[,{value:o},r]=E.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}},TR=({aetherKey:e,source:t,sink:n})=>{const s=E.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:o,enabled:r},l]=E.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}},Yt=(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(E.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:{textAlign:l,maxInlineSize:c}}),location:o}},yr=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(U.Space,{direction:f.g.swap(l),align:"center",className:f.CSS(f.CSS.B("control-state")),size:"small",children:[t&&n&&i.jsxRuntimeExports.jsx(ec,{size:"small",...o}),t&&s&&i.jsxRuntimeExports.jsx(sc,{...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}=TR({aetherKey:n,source:o,sink:r}),y=[],C=Yt(l,c);C!=null&&y.push(C);const R=yr(s);return R!=null&&y.push(R),i.jsxRuntimeExports.jsx(_t,{editable:u&&!a,symbolKey:n,items:y,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},ve=e=>{const t=({symbolKey:n,label:s,onChange:o,selected:r,draggable:l,position:c,orientation:a="left",...u})=>{const d=[],x=Yt(s,o);return x!=null&&d.push(x),i.jsxRuntimeExports.jsx(_t,{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},kt=e=>{const t=({symbolKey:n,label:s,onChange:o,selected:r,draggable:l,position:c,orientation:a="left",enabled:u=!1,clickable:d=!1,...x})=>{const p=[],m=Yt(s,o);m!=null&&p.push(m);const h=()=>{d&&o({enabled:!u})};return i.jsxRuntimeExports.jsx(_t,{items:p,editable:r&&!l,symbolKey:n,onRotate:()=>o({orientation:f.K.rotate90(a)}),onLocationChange:(y,C)=>{y==="label"&&o({label:{...s,orientation:C}})},children:i.jsxRuntimeExports.jsx(e,{orientation:a,enabled:u,onClick:h,...x})})};return t.displayName=e.displayName,t},cd=be(pu),ad=be(mu),ud=be(hu),dd=be(fu),xd=be(ju),fd=be(Su),pd=be(Vu),md=be(Fu),hd=be(Hu),gd=be(Gu),Ed=be(Xu),yd=be(Ku),jd=be(qu),Sd=be(Uu),Rd=be(Qu),Cd=be(Ju),bd=be(Bu),wd=be(ed),vd=ve(Nu),_d=ve(Wu),kd=ve(Ru),Md=ve(bu),Pd=ve(wu),Nd=ve(ku),Ld=ve(Eu),Td=ve(yu),Ad=ve(Lu),Id=be($u),$d=ve(nd),Dd=ve(_u),Od=ve(sd),zd=ve(Cu),Bd=ve(ld),Vd=ve(Zu),Fd=kt(Tu),Hd=kt(gu),Zd=kt(rd),Gd=kt(id),Yd=kt(vu),Wd=kt(Au),Xd=ve(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:r})=>i.jsxRuntimeExports.jsx(Is,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:r,backgroundColor:e})),Kd=e=>i.jsxRuntimeExports.jsx(Is,{...e,dimensions:{width:25,height:50}}),qd=ve(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:o,dimensions:r})=>i.jsxRuntimeExports.jsx(Is,{onResize:l=>n({dimensions:l}),orientation:s,color:o,dimensions:r,boxBorderRadius:t,backgroundColor:e})),Ud=e=>i.jsxRuntimeExports.jsx(Is,{...e,dimensions:{width:25,height:50},borderRadius:0}),Qd=({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}=LR({aetherKey:t,source:r,sink:l}),m=[],h=yr(s);h!=null&&m.push(h);const y=Yt(e,a);return y!=null&&m.push(y),i.jsxRuntimeExports.jsx(_t,{symbolKey:t,editable:u&&!d,onRotate:()=>a({orientation:f.K.rotate90(n)}),items:m,onLocationChange:(C,R)=>{C==="label"&&a({label:{...e,orientation:R}})},children:i.jsxRuntimeExports.jsx(zu,{value:x,onChange:p,units:o,color:c,orientation:n})})},Jd=e=>i.jsxRuntimeExports.jsx(zu,{value:12,onChange:()=>{},units:"mV",...e,children:i.jsxRuntimeExports.jsx(E.Text,{level:"p",children:"10.0"})}),ex=({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=E.useTypography(n),h=(m.lineHeight+.5)*m.baseSize+2,{width:y}=er({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}),C=[],R=Yt(t,a);return R!=null&&C.push(R),i.jsxRuntimeExports.jsx(_t,{editable:d&&!x,symbolKey:e,items:C,onLocationChange:(k,S)=>{k==="label"&&a({label:{...t,orientation:S}})},children:i.jsxRuntimeExports.jsx(Iu,{color:r,dimensions:{height:h,width:y},inlineSize:u,units:c,unitsLevel:H.downLevel(n)})})},tx=({color:e})=>i.jsxRuntimeExports.jsx(Iu,{color:e,dimensions:{width:60,height:25},units:"psi",children:i.jsxRuntimeExports.jsx(E.Text,{level:"p",children:"50.00"})}),nx=({symbolKey:e,label:t,orientation:n="left",sink:s,control:o,selected:r,draggable:l,onChange:c,...a})=>{const{click:u}=bR({aetherKey:e,sink:s}),d=[],x=yr(o);return x!=null&&d.push(x),i.jsxRuntimeExports.jsx(_t,{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(Du,{...t,onClick:u,orientation:n,...a})})},sx=({label:e,...t})=>i.jsxRuntimeExports.jsx(Du,{label:"Button",...t}),ox=({symbolKey:e,label:t,source:n,onChange:s,selected:o,draggable:r,...l})=>{const{enabled:c}=wR({aetherKey:e,source:n}),a=[],u=Yt(t,s);return u!=null&&a.push(u),i.jsxRuntimeExports.jsx(_t,{items:a,editable:o&&!r,symbolKey:e,onLocationChange:(d,x)=>{d==="label"&&s({label:{...t,orientation:x}})},children:i.jsxRuntimeExports.jsx(Yu,{enabled:c,...l})})},rx=({level:e="p",width:t=100})=>i.jsxRuntimeExports.jsx(Ou,{level:e,width:t,text:"Text Box"}),ix=({label:{label:e,level:t},orientation:n,color:s,onChange:o})=>i.jsxRuntimeExports.jsx(td,{onLabelChange:r=>o({label:{label:r,level:t}}),label:e,level:t,orientation:n,color:s}),lx=({label:e,...t})=>i.jsxRuntimeExports.jsx(td,{label:"Off Page",...t,orientation:"right"}),cx=ve(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:r})=>i.jsxRuntimeExports.jsx(od,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:r,backgroundColor:e})),ax=e=>i.jsxRuntimeExports.jsx(od,{...e,dimensions:{width:25,height:50}}),ce=4,jr=2,AR=["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"],IR=re.z.enum(AR),ge={orientation:"left",scale:1},$R={...ge,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"})},DR={...ge,source:A.sourcePipeline("number",{connections:[],segments:{valueStream:A.streamChannelValue({channel:0})},outlet:"valueStream"})},OR={...ge,sink:A.sinkPipeline("number",{connections:[],segments:{setter:A.setChannelValue({channel:0})},inlet:"setter"})},ux={...ge,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"})},dx={...ge,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={...ux,...dx},Wt={...ge,enabled:!1,clickable:!1},oe=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),zR={width:125,height:200},Sr={dimensions:zR},BR=3,VR={name:"Three Way Valve",key:"threeWayValve",Form:we,Symbol:cd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Three Way Valve"),..._e}),Preview:pu,zIndex:ce},FR={name:"Valve",key:"valve",Form:we,Symbol:ad,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Valve"),..._e}),Preview:mu,zIndex:ce},HR={name:"Solenoid Valve",key:"solenoidValve",Form:we,Symbol:ud,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Solenoid Valve"),normallyOpen:!1,..._e}),Preview:hu,zIndex:ce},ZR={name:"Four Way Valve",key:"fourWayValve",Form:we,Symbol:dd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Four Way Valve"),..._e}),Preview:fu,zIndex:ce},GR={name:"Angled Valve",key:"angledValve",Form:we,Symbol:xd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Valve"),..._e}),Preview:ju,zIndex:ce},YR={name:"Pump",key:"pump",Form:we,Symbol:fd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Pump"),..._e}),Preview:Su,zIndex:ce},WR={name:"Screw Pump",key:"screwPump",Form:we,Symbol:bd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Screw Pump"),..._e}),Preview:Bu,zIndex:ce},XR={name:"Tank",key:"tank",Form:du,Symbol:Xd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("Tank"),borderRadius:Er,...Sr,...ge}),Preview:Kd,zIndex:jr},KR={name:"Cylinder",key:"cylinder",Form:gR,Symbol:cx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("cylinder"),dimensions:{width:66,height:181},...ge}),Preview:ax,zIndex:jr},qR={name:"Box",key:"box",Form:()=>du({includeBorderRadius:!0}),Symbol:qd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("Box"),borderRadius:BR,...Sr,...ge}),Preview:Ud,zIndex:jr},UR={name:"Relief Valve",key:"reliefValve",Form:Gt,Symbol:Hd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Relief Valve"),...Wt}),Preview:({clickable:e,...t})=>gu(t),zIndex:ce},QR={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:Gt,Symbol:Zd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Spring Loaded Relief Valve"),...Wt}),Preview:({clickable:e,...t})=>rd(t),zIndex:ce},JR={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:Gt,Symbol:Gd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Spring Loaded Relief Valve"),...Wt}),Preview:({clickable:e,...t})=>id(t),zIndex:ce},e2={name:"Regulator",key:"regulator",Form:ke,Symbol:vd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Regulator"),...ge}),Preview:Nu,zIndex:ce},t2={name:"Electric Regulator",key:"electricRegulator",Form:ke,Symbol:_d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Electric Regulator"),...ge}),Preview:Wu,zIndex:ce},n2={name:"Burst Disc",key:"burstDisc",Form:ke,Symbol:kd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Burst Disc"),...ge}),Preview:Ru,zIndex:ce},s2={name:"ISO Burst Disc",key:"isoBurstDisc",Form:ke,Symbol:zd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Burst Disc"),...ge}),Preview:Cu,zIndex:ce},o2={name:"Cap",key:"cap",Form:ke,Symbol:Md,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cap"),...ge}),Preview:bu,zIndex:ce},r2={name:"ISO Cap",key:"isoCap",Form:ke,Symbol:Pd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Cap"),...ge}),Preview:wu,zIndex:ce},i2={name:"Manual Valve",key:"manualValve",Form:Gt,Symbol:Yd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Manual Valve"),...Wt}),Preview:({clickable:e,...t})=>vu(t),zIndex:ce},l2={name:"Orifice Plate",key:"orificePlate",Form:ke,Symbol:Dd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Orifice Plate"),...ge}),Preview:_u,zIndex:ce},c2={name:"ISO Filter",key:"isoFilter",Form:ke,Symbol:Od,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Filter"),...ge}),Preview:sd,zIndex:ce},a2={name:"Filter",key:"filter",Form:ke,Symbol:Nd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Filter"),...ge}),Preview:ku,zIndex:ce},u2={name:"Needle Valve",key:"needleValve",Form:Gt,Symbol:Fd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Needle Valve"),...Wt}),Preview:({clickable:e,...t})=>Tu(t),zIndex:ce},d2={name:"Check Valve",key:"checkValve",Form:ke,Symbol:Ld,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Check Valve"),...ge}),Preview:Eu,zIndex:ce},x2={name:"Orifice",key:"orifice",Form:ke,Symbol:Ad,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Orifice"),...ge}),Preview:Lu,zIndex:ce},f2={name:"Angled Relief Valve",key:"angledReliefValve",Form:Gt,Symbol:Wd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Relief Valve"),...Wt}),Preview:({clickable:e,...t})=>Au(t),zIndex:ce},p2={name:"Value",key:"value",Form:cR,Symbol:ex,Preview:tx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...oe("Value"),...ge,telem:$R.source}),zIndex:ce},m2={name:"Button",key:"button",Symbol:nx,Form:xR,Preview:sx,defaultProps:e=>({color:e.colors.primary.z.rgba255,...oe("Button"),...dx,onClickDelay:0,scale:null}),zIndex:ce},h2={name:"Switch",key:"switch",Symbol:Id,Form:we,defaultProps:()=>({...oe("Switch"),..._e,scale:null}),Preview:$u,zIndex:ce},g2={name:"Vacuum Pump",key:"vacuumPump",Symbol:pd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Vacuum Pump"),..._e}),Preview:Vu,zIndex:ce},E2={name:"Cavity Pump",key:"cavityPump",Symbol:md,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cavity Pump"),..._e}),Preview:Fu,zIndex:ce},y2={name:"Piston Pump",key:"pistonPump",Symbol:hd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Piston Pump"),..._e}),Preview:Hu,zIndex:ce},j2={name:"Static Mixer",key:"staticMixer",Symbol:Vd,Form:ke,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Static Mixer"),...ge}),Preview:Zu,zIndex:ce},S2={name:"Rotary Mixer",key:"rotaryMixer",Symbol:gd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Rotary Mixer"),..._e}),Preview:Gu,zIndex:ce},R2={name:"Light",key:"light",Symbol:ox,Form:uR,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Light"),...ux}),Preview:Yu,zIndex:ce},C2={name:"Setpoint",key:"setpoint",Symbol:Qd,Form:pR,defaultProps:e=>({units:"mV",color:e.colors.gray.l4.rgba255,...oe("Setpoint"),...DR,...OR}),Preview:Jd,zIndex:ce},b2={name:"Agitator",key:"agitator",Symbol:Ed,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Agitator"),..._e}),Preview:Xu,zIndex:ce},w2={name:"Propeller Agitator",key:"propellerAgitator",Symbol:yd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Propeller Agitator"),..._e}),Preview:Ku,zIndex:ce},v2={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:jd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Flat Blade Agitator"),..._e}),Preview:qu,zIndex:ce},_2={name:"Paddle Agitator",key:"paddleAgitator",Symbol:Sd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Paddle Agitator"),..._e}),Preview:Uu,zIndex:ce},k2={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Rd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cross Beam Agitator"),..._e}),Preview:Qu,zIndex:ce},M2={name:"Helical Agitator",key:"helicalAgitator",Symbol:Cd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Helical Agitator"),..._e}),Preview:Ju,zIndex:ce},P2={name:"Compressor",key:"compressor",Symbol:wd,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Compressor"),..._e}),Preview:ed,zIndex:ce},N2={name:"Text Box",key:"textBox",Symbol:Ou,Form:mR,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...oe("Text Box"),...ge,...Sr,level:"p",text:"Text Box",width:75}),Preview:rx,zIndex:ce},L2={name:"Off Page Reference",key:"offPageReference",Form:hR,Symbol:ix,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...oe("Off Page Reference")}),Preview:lx,zIndex:ce},T2={name:"ISO Check Valve",key:"isoCheckValve",Form:ke,Symbol:Td,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Check Valve"),...ge}),Preview:yu,zIndex:ce},A2={name:"Vent",key:"vent",Form:ke,Symbol:$d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Vent"),...ge}),Preview:nd,zIndex:ce},I2={name:"T Junction",key:"tJunction",Form:ke,Symbol:Bd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe(""),...ge}),Preview:ld,zIndex:ce+20},$2={value:p2,button:m2,tank:XR,tJunction:I2,switch:h2,offPageReference:L2,light:R2,setpoint:C2,box:qR,textBox:N2,valve:FR,solenoidValve:HR,threeWayValve:VR,fourWayValve:ZR,angledValve:GR,manualValve:i2,needleValve:u2,reliefValve:UR,angledReliefValve:f2,checkValve:d2,regulator:e2,electricRegulator:t2,pump:YR,pistonPump:y2,screwPump:WR,cavityPump:E2,vacuumPump:g2,staticMixer:j2,rotaryMixer:S2,burstDisc:n2,isoBurstDisc:s2,cap:o2,isoCap:r2,filter:a2,isoFilter:c2,orifice:x2,orificePlate:l2,agitator:b2,propellerAgitator:w2,flatBladeAgitator:v2,paddleAgitator:_2,crossBeamAgitator:k2,helicalAgitator:M2,compressor:P2,isoCheckValve:T2,vent:A2,cylinder:KR,springLoadedReliefValve:QR,angledSpringLoadedReliefValve:JR},D2=Object.freeze(Object.defineProperty({__proto__:null,Agitator:Ed,AngledReliefValve:Wd,AngledSpringLoadedReliefValve:Gd,AngledValve:xd,Box:qd,BoxPreview:Ud,BurstDisc:kd,Button:nx,ButtonPreview:sx,Cap:Md,CavityPump:md,CheckValve:Ld,Compressor:wd,CrossBeamAgitator:Rd,Cylinder:cx,CylinderPreview:ax,ElectricRegulator:_d,Filter:Nd,FlatBladeAgitator:jd,FourWayValve:dd,HelicalAgitator:Cd,ISOBurstDisc:zd,ISOCap:Pd,ISOCheckValve:Td,ISOFilter:Od,Light:ox,ManualValve:Yd,NeedleValve:Fd,OffPageReference:ix,OffPageReferencePreview:lx,Orifice:Ad,OrificePlate:Dd,PaddleAgitator:Sd,PistonPump:hd,PropellerAgitator:yd,Pump:fd,Regulator:vd,ReliefValve:Hd,RotaryMixer:gd,SYMBOLS:$2,ScrewPump:bd,Setpoint:Qd,SetpointPreview:Jd,SolenoidValve:ud,SpringLoadedReliefValve:Zd,StaticMixer:Vd,Switch:Id,TJunction:Bd,Tank:Xd,TankPreview:Kd,TextBoxPreview:rx,ThreeWayValve:cd,VacuumPump:pd,Value:ex,ValuePreview:tx,Valve:ad,Vent:$d,createDummyToggle:kt,createLabeled:ve,createToggle:be,variantZ:IR},Symbol.toStringTag,{value:"Module"}));exports.Aether=E.main;exports.Dialog=E.use$4;exports.Divider=E.Divider$1;exports.Dropdown=E.Dropdown;exports.Haul=E.Haul;exports.Worker=E.Context$1;exports.compareArrayDeps=E.compareArrayDeps;exports.componentRenderProp=E.componentRenderProp;exports.isRenderProp=E.isRenderProp;exports.useAsyncEffect=E.useAsyncEffect;exports.useClickOutside=E.useClickOutside;exports.useCombinedRefs=E.useCombinedRefs;exports.useCombinedStateAndRef=E.useCombinedStateAndRef;exports.useDebouncedCallback=E.useDebouncedCallback;exports.useEffectCompare=E.useEffectCompare;exports.useMemoCompare=E.useMemoCompare;exports.useMemoDeepEqualProps=E.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=E.useMemoPrimitiveArray;exports.usePrevious=E.usePrevious;exports.useResize=E.useResize;exports.useStateRef=E.useStateRef;exports.useSyncedRef=E.useSyncedRef;exports.useTransforms=E.useTransforms;exports.CSS=f.CSS;exports.newBEM=f.newBEM;exports.Header=$n.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=U.Generic;exports.Align=mf.external;exports.Icon=je.Icon;exports.Tabs=je.external;exports.Button=hf.external;exports.Caret=Zi.Animated$1;exports.telem=A.external;exports.Text=Re.external;exports.Triggers=Gi.external;exports.List=Vt.external;exports.createFilterTransform=Vt.createFilterTransform;exports.fuseFilter=Vt.fuseFilter;exports.proxyMemo=Vt.proxyMemo;exports.Color=Ef.external;exports.createHexOpacityVariants=Yi.createHexOpacityVariants;exports.unitProperty=Yi.unitProperty;exports.Input=Pe.external;exports.Menu=yf.external;exports.Theming=jf.external;exports.Tree=Sf.external;exports.Video=Rf.Video;exports.Accordion=Ff;exports.Breadcrumb=Yf;exports.Canvas=up;exports.Channel=om;exports.Control=ph;exports.Device=Sm;exports.Diagram=sR;exports.Eraser=Km;exports.Form=Em;exports.Label=_m;exports.Legend=mp;exports.Line=gp;exports.LinePlot=Zp;exports.Log=rR;exports.Measure=Xp;exports.Modal=Mm;exports.Mosaic=Ym;exports.Nav=Qm;exports.Note=eh;exports.OS=rh;exports.Observe=hm;exports.Override=lh;exports.Pluto=Eh;exports.Portal=Om;exports.Progress=jh;exports.Range=Yp;exports.Ranger=_h;exports.Resize=Af;exports.Rule=Kp;exports.Schematic=D2;exports.Select=Lp;exports.Status=vf;exports.Steps=Mh;exports.Synnax=Kf;exports.Table=Ah;exports.TableCells=Qh;exports.Tag=Pp;exports.Telem=uh;exports.Tooltip=_f;exports.Value=Oh;exports.Viewport=Hp;exports.axis=rp;exports.control=ip;exports.useDelayedState=Cf;
|