@synnaxlabs/pluto 0.39.1 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Provider-CCZPt2M5.js → Provider-CvqYCQ-c.js} +1 -1
- package/dist/{Provider-YIru1nvE.cjs → Provider-DdzMK2ly.cjs} +1 -1
- package/dist/{Text-B3pNXYhh.js → Text-BBAivtcq.js} +1 -1
- package/dist/{Text-DrXyKZwR.cjs → Text-BpgvgYm9.cjs} +1 -1
- package/dist/{Text-DT2rIwXL.js → Text-DKpfyuCy.js} +4 -4
- package/dist/{Text-Hnsb1fus.cjs → Text-Kq93-h4G.cjs} +1 -1
- package/dist/{aggregator-5XpEdQtr.js → aggregator-Bo5bXe2h.js} +1 -1
- package/dist/{aggregator-BAdXZfPY.cjs → aggregator-Dd6-VUPG.cjs} +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/{eraser-DKQ5u3sz.js → eraser-B8b1ORvV.js} +1 -1
- package/dist/{eraser-CnbMvm7W.cjs → eraser-BsY8Ilvt.cjs} +1 -1
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +7 -7
- package/dist/{external-CNyc2Q9k.cjs → external-BCMlN9UI.cjs} +1 -1
- package/dist/{external-CL_RlqOT.cjs → external-BmbDPHD3.cjs} +1 -1
- package/dist/{external-C710XUvC.js → external-BtHnb3Sp.js} +5 -5
- package/dist/{external-BhaLdMzY.js → external-CGxC3uw1.js} +2 -2
- package/dist/{external-Vjn4WKwt.cjs → external-CKvBpFrE.cjs} +1 -1
- package/dist/{external-DYUmsMj8.cjs → external-CSKJSiQJ.cjs} +1 -1
- package/dist/{external-DYn3iC-U.js → external-CqR7Yk0z.js} +2 -2
- package/dist/{external-vVwTqni5.cjs → external-D3IjVlS7.cjs} +1 -1
- package/dist/{external-CjZqwgDh.js → external-DNUUgDyq.js} +3 -3
- package/dist/{external-BOOtUi1D.js → external-cFoSk0PK.js} +3 -3
- package/dist/{font-CD9W5Tsh.js → font-BBeEt9tk.js} +2 -2
- package/dist/{font-MRTGIokZ.cjs → font-DshP3AG2.cjs} +1 -1
- package/dist/{fontString-MM82zgKY.cjs → fontString-CWcKYJNb.cjs} +1 -1
- package/dist/{fontString-p8gMjlA1.js → fontString-DKZUOJ6f.js} +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +179 -162
- 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/{provider-D3MPSb7n.cjs → provider-BaehOXWw.cjs} +3 -3
- package/dist/{provider-DfVWtUxZ.js → provider-BsPH6eua.js} +26 -25
- package/dist/src/hardware/device/Select.d.ts +6 -2
- package/dist/src/hardware/device/Select.d.ts.map +1 -1
- 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/{value-DbcZ1sQB.js → value-C9u1Km9t.js} +4 -4
- package/dist/{value-DQqKhQvt.cjs → value-C_xE_NRc.cjs} +1 -1
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var uf=Object.defineProperty;var df=(e,t,n)=>t in e?uf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var et=(e,t,n)=>df(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-UYeBbnYT.cjs"),g=require("react"),Z=require("./Divider-MIbyu5ZH.cjs"),u=require("./css-CU7tous7.cjs"),Jn=require("./external-BQtPGUNg.cjs"),le=require("./state-BKyv_jWZ.cjs"),xf=require("./Pack-BbwDtaE6.cjs"),je=require("./external-Vjn4WKwt.cjs"),oe=require("./Space-NNqCWFbg.cjs"),Ie=require("./hooks-BKLtEDxx.cjs"),pf=require("./useVirtualCursorDragWebKit-BLtwRQY7.cjs"),Q=require("./Provider-YIru1nvE.cjs"),mf=require("./external-BTGfIw_K.cjs"),Ne=require("./external-DrwngojV.cjs"),jl=require("./external-AOOzgEKd.cjs"),vs=require("./WithIcon-CJvuPkSy.cjs"),_e=require("./toArray-DRKOku1s.cjs"),ff=require("./external-CRbERCqd.cjs"),Nn=require("./external-CNyc2Q9k.cjs"),he=require("./Toggle-BzORI5sE.cjs"),ut=require("./Text-DrXyKZwR.cjs"),io=require("./aggregator-BAdXZfPY.cjs"),Re=require("./Text-Hnsb1fus.cjs"),qt=require("./provider-D3MPSb7n.cjs"),I=require("./value-DQqKhQvt.cjs"),xe=require("./Haul-CoG7Jmz6.cjs"),Te=require("./useMemoCompare-ONEAVO05.cjs"),qr=require("./dimensions-IEzi7AOM.cjs"),qo=require("./font-MRTGIokZ.cjs"),Ye=require("./Dropdown-DurKTABg.cjs"),Be=require("./deep-BjupBYvk.cjs"),ce=require("zod"),We=require("./external-DYUmsMj8.cjs"),ks=require("./Pack-CzZzxA2R.cjs"),Ct=require("./ContextMenu-BWGS1vXl.cjs"),hf=require("./Text-D1GKnp9s.cjs"),El=require("./external-BJulb-Hm.cjs");require("./Item-Dj7cQJ8t.cjs");const Xo=require("react-dom"),bt=require("./external-vVwTqni5.cjs"),yl=require("./units-CvIf5nF_.cjs"),Sl=require("./useClickOutside-EJHWO4Q9.cjs"),Uo=require("./useDebouncedCallback-CVLx7N1s.cjs"),gf=require("./external-DhX0dZoF.cjs"),Xr=require("./eraser-CnbMvm7W.cjs"),wo=require("./DateTime-DUuYjZr8.cjs"),jf=require("./external-CL_RlqOT.cjs"),Ef=require("./Video-BJudMCoc.cjs"),yf=(e,t,n=150)=>{const[s,r]=g.useState(e);return g.useEffect(()=>{const i=setTimeout(()=>r(t),n);return()=>clearTimeout(i)},[t,n]),s},Sf=Object.freeze(Object.defineProperty({__proto__:null,Config:he.Config,Dialog:he.Dialog,chooseLocation:he.chooseLocation,formatTip:he.formatTip,useConfig:he.useConfig,wrap:he.wrap},Symbol.toStringTag,{value:"Module"})),Jo=({ref:e,location:t,style:n,size:s,className:r,children:i,onDragStart:l,sizeUnits:c="px",showHandle:a=!0,...d})=>{const x=u.K.construct(t),p=u.K.direction(x),m=u.g.dimension(p);return o.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.B("resize"),u.CSS.loc(x),u.CSS.dir(p),r),style:{[m]:`${s}${c}`,...n},ref:e,...d,children:[i,a&&o.jsxRuntimeExports.jsx("div",{draggable:!0,className:u.CSS(u.CSS.BE("resize","handle"),u.CSS.bordered(u.K.swap(x))),onDragStart:l,onDrag:je.preventDefault,onDragEnd:je.preventDefault})]})},Qo=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:r="x"})=>{const i=g.useRef(null),[l,c]=g.useState({sizeDistribution:Rf(n,t),root:null}),a=g.useCallback((p,m,f)=>{if(i.current==null)return;const h=u.Mo.dim(u.Mo.construct(i.current),r);c(j=>co(j,h,p,s,m,f))},[s,c,r]);g.useEffect(()=>e==null?void 0:e(l.sizeDistribution),[l.sizeDistribution,e]);const d=g.useCallback((p,m)=>{p.preventDefault();const f=r==="x"?"clientX":"clientY",h=S=>a(m,S[f]),j=()=>{c(S=>({...S,root:null})),document.removeEventListener("mousemove",h)};c(S=>({...S,root:p[f]})),document.addEventListener("mousemove",h),document.addEventListener("mouseup",j,{once:!0})},[c,r,co]);return{setSize:g.useCallback((p,m)=>a(p,void 0,m),[co]),props:{direction:r,sizeDistribution:l.sizeDistribution,onDragHandle:d,ref:i}}},er=({ref:e,direction:t="x",children:n,sizeDistribution:s,onDragHandle:r,className:i,...l})=>{const c=u.g.construct(t),a=g.Children.toArray(n);return s=Cf(s),o.jsxRuntimeExports.jsx(oe.Space,{...l,ref:e,direction:c,className:u.CSS(u.CSS.B("resize-multiple"),i),empty:!0,grow:!0,children:a.map((d,x)=>o.jsxRuntimeExports.jsx(Jo,{onDragStart:p=>r(p,x),location:u.g.location(c),size:s[x]*100,sizeUnits:"%",showHandle:x!==a.length-1,children:d},x))})},Rf=(e,t)=>{const n=e.reduce((r,i)=>r+i,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(r=>r/n);if(e.every(r=>r<=1)){const r=1-n;return[...e,...Array(s).fill(r/s)]}return e.map(()=>1/t)},lo=.001,Cf=e=>e.every(t=>u.G$1.closeTo(t,1/e.length),lo)?e.map((t,n)=>n%2===0?t+lo:n===e.length-1?t:t-lo):e,co=(e,t,n,s,r,i)=>{const l=Rl(e,t,n,r,i),[c,a]=bf(e.sizeDistribution,n,l,s/t),d=a?r??null:e.root;return{...e,sizeDistribution:c,root:d}},Rl=(e,t,n,s,r)=>{let i;if(r!=null)r>1&&(r/=t),i=r-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},bf=(e,t,n,s)=>{let r=t;for(;r>0&&e[r]+n<=s;)r--;const i=e[r]+n,l=wf(r,e,s,n),c=e[l]-n;return i<s||c<s?[e,!1]:[e.map((a,d)=>d===r?i:d===l?c:a),!0]},wf=(e,t,n,s)=>(e===t.length-1?kf:vf)(e,t,n,s),vf=(e,t,n,s)=>{let r=e+1;for(;r<t.length-1&&t[r]-s<=n;)r++;return r},kf=(e,t,n,s)=>{let r=e-1;for(;r>0&&t[r]-s<=n;)r--;return r},ao=2,Cl=({onCollapse:e,onResize:t,location:n="left",minSize:s=100,maxSize:r=1/0,initialSize:i=200,collapseThreshold:l=1/0,className:c,...a})=>{const[d,x]=g.useState(u.Y(i,s,r)),p=g.useRef(null),m=u.K.construct(n),f=g.useCallback(E=>{if(p.current===null)return 0;const C=u.Mo.dim(E,u.K.direction(m),!0)*(1-2*Number(["bottom","right"].includes(m))),P=p.current+C,N=u.Y(P,s,r);return(N-P)/s>l?ao:N},[m,s,r,l]),h=g.useRef(null),j=g.useCallback(E=>{const C=f(E);x(C),h.current!=null&&(t==null||t(C,u.Mo.construct(h.current)))},[t,f]),S=g.useCallback(()=>x(E=>(p.current=E,E)),[x]),R=g.useCallback(E=>f(E)===ao&&(e==null?void 0:e()),[e,f]);g.useEffect(()=>x(E=>{const C=u.Y(E,s,r);return p.current=C,C}),[s,r]);const w=We.useCursorDrag({onMove:j,onStart:S,onEnd:R});return o.jsxRuntimeExports.jsx(Jo,{ref:h,location:m,size:d,onDragStart:w,className:u.clsx(c,u.CSS.expanded(d!==ao)),...a})},Mf=Object.freeze(Object.defineProperty({__proto__:null,Core:Jo,Multiple:er,Single:Cl,calculateDiffPercentage:Rl,useMultiple:Qo},Symbol.toStringTag,{value:"Module"})),Qn="y",Ur=28,_f=32,Pf=40,Lf=.5,Nf=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:r,...i}}=Qo({direction:Qn,count:e.length,minSize:Ur}),l=c=>{if(r.current==null)return;const a=u.Mo.dim(u.Mo.construct(r.current),Qn);s[c]<Pf/a?n(c,e[c].initialSize??Lf):n(c,Ur+1)};return o.jsxRuntimeExports.jsx(er,{empty:!0,className:u.CSS.B("accordion"),sizeDistribution:s,ref:r,...t,...i,children:e.map((c,a)=>g.createElement(If,{...c,key:c.key,index:a,direction:Qn,onExpand:l,parent:r,size:s[a]}))})},Tf=o.jsxRuntimeExports.jsx(Z.E4.Caret.Down,{"aria-label":"contract"}),Af=o.jsxRuntimeExports.jsx(Z.E4.Caret.Right,{"aria-label":"expand"}),If=({index:e,name:t,content:n,actions:s,size:r,parent:i,onExpand:l})=>{let c=!0;if(i.current!=null){const d=u.Mo.dim(u.Mo.construct(i.current),Qn);c=r*d>_f}const a=c?Tf:Af;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(Jn.Header,{level:"p",className:u.CSS.expanded(c),empty:!0,children:[o.jsxRuntimeExports.jsx(Jn.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&o.jsxRuntimeExports.jsx(Jn.Actions,{children:s})]}),n]})},zf=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Nf},Symbol.toStringTag,{value:"Module"})),$f=(e,t)=>_e.A(e).map(s=>typeof s=="string"?s.split(t).map(r=>({label:r})):s).flat(),bl=({segments:e,shade:t,level:n,weight:s,separator:r,transform:i})=>{let c=$f(e,r);return i!=null&&(c=c.map(i)),c.map(({label:a,icon:d,href:x,...p},m)=>{const f=[o.jsxRuntimeExports.jsx(Z.E4.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:u.CSS.shade(t)}},`${a}-${m}`)];if(d!=null){const j=Ne.resolve(d);j!=null&&f.push(j)}const h={weight:s,shade:t,level:n,style:{marginLeft:d!=null?"0.5rem":"0"},children:a,...p};return x!=null?f.push(o.jsxRuntimeExports.jsx(jl.Link,{...h,href:x},a)):f.push(o.jsxRuntimeExports.jsx(Z.Text,{...h},a)),f}).flat()},wl=({children:e,icon:t,shade:n=7,weight:s,size:r=.5,url:i,level:l="p",separator:c=".",className:a,hideFirst:d=!0,...x})=>{i!=null&&(e=i);const p=bl({segments:e,separator:c,shade:n,level:l,weight:s});return d&&p.shift(),o.jsxRuntimeExports.jsxs(vs.WithIcon,{className:u.CSS(a,u.CSS.B("breadcrumb"),d&&u.CSS.M("hide-first")),level:l,shade:n,weight:s,size:r,direction:"x",...x,children:[Ne.resolve(t),...p]})},Df=({url:e,className:t,level:n="p",separator:s="/",weight:r,shade:i=7})=>{const l=bl({segments:e,separator:s,shade:i,level:n,weight:r,transform:(c,a)=>({...c,label:c.label.split("-").map(d=>u.d.capitalize(d)).join(" "),href:`/${e.split(s).slice(0,a+1).join("/")}`})});return o.jsxRuntimeExports.jsx(oe.Space,{className:u.CSS(t,u.CSS.B("breadcrumb"),u.CSS.BM("breadcrumb","url")),direction:"x",size:"small",align:"center",children:l})},Bf=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:wl,URL:Df},Symbol.toStringTag,{value:"Module"})),vl=({variant:e="info",...t})=>o.jsxRuntimeExports.jsx(Z.E4.Circle,{color:Re.variantColors[e],...t}),Of=({action:e})=>g.isValidElement(e)?e:g.createElement(he.Button,{...e,key:e.key}),Vf=({status:{key:e,time:t,count:n,message:s,description:r,variant:i},silence:l,actions:c,className:a,children:d,...x})=>o.jsxRuntimeExports.jsxs(oe.Space,{className:u.CSS(u.CSS.B("notification"),a),direction:"y",empty:!0,...x,children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",size:"small",children:[o.jsxRuntimeExports.jsx(vl,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),o.jsxRuntimeExports.jsx(Z.Text,{level:"small",shade:7,children:`x${n}`}),o.jsxRuntimeExports.jsx(wo.DateTime,{className:u.CSS(u.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),o.jsxRuntimeExports.jsx(he.Icon,{className:u.CSS(u.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:o.jsxRuntimeExports.jsx(Z.E4.Close,{})})]}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",align:"start",className:u.CSS(u.CSS.BE("notification","content")),size:"small",children:[d??o.jsxRuntimeExports.jsx(Z.Text,{className:u.CSS(u.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),r!=null&&o.jsxRuntimeExports.jsx(Z.Text,{className:u.CSS(u.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),c!=null&&o.jsxRuntimeExports.jsx(oe.Space,{direction:"x",align:"center",justify:"end",className:u.CSS(u.CSS.BE("notification","actions")),children:_e.A(c).map(p=>o.jsxRuntimeExports.jsx(Of,{action:p},p.key))})]},t.toString()),Ff=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:Re.Aggregator,Circle:vl,Notification:Vf,Text:Re.Text,VARIANTS:io.VARIANTS,specZ:io.specZ,useAdder:Re.useAdder,useErrorHandler:Re.useErrorHandler,useNotifications:Re.useNotifications,variantColors:Re.variantColors,variantZ:io.variantZ},Symbol.toStringTag,{value:"Module"})),tr=({aetherKey:e})=>{const[,{region:t},n]=Q.use$1({aetherKey:e,type:Xr.Eraser.TYPE,schema:Xr.eraserStateZ,initialState:{region:u.Mo.ZERO,enabled:!0}}),s=Z.useSyncedRef(t),r=g.useCallback(l=>{u.Mo.equals(l,s.current)||n(c=>({...c,region:l}))},[n]);return{setEnabled:g.useCallback(l=>n(c=>({...c,enabled:l})),[n]),erase:r}},Hf=({aetherKey:e,children:t})=>{const{erase:n}=tr({aetherKey:e}),s=Ye.useResize(n);return o.jsxRuntimeExports.jsx("div",{ref:s,className:u.CSS(u.CSS.inheritDims()),children:t})},Zf=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Hf,use:tr},Symbol.toStringTag,{value:"Module"})),Gf=({items:e,initialKey:t})=>{const[n,s]=g.useState(t),r=l=>s(l===n?void 0:l),i=e.find(l=>l.key===n);return{onSelect:r,activeItem:i}},Yf=({activeItem:e,children:t,onSelect:n,location:s="left",collapseThreshold:r=.65,className:i,onResize:l,...c})=>{const a=u.K.direction(s),d=g.useCallback(()=>e!=null&&(n==null?void 0:n(e.key)),[n,e==null?void 0:e.key]),{erase:x,setEnabled:p}=tr({}),m=g.useCallback((w,E)=>{l==null||l(w,E),x(E)},[l,x]);if(g.useLayoutEffect(()=>{p(e!=null)},[e,p]),e==null)return null;const{content:f,key:h,minSize:j,maxSize:S,initialSize:R}=e;return o.jsxRuntimeExports.jsx(Cl,{className:u.CSS(u.CSS.BE("navdrawer","content"),u.CSS.dir(a),i),collapseThreshold:r,onCollapse:d,location:s,onResize:m,minSize:j,maxSize:S,initialSize:R,...c,children:f},h)},Wf=Object.freeze(Object.defineProperty({__proto__:null,Bar:je.Bar,Drawer:Yf,useDrawer:Gf},Symbol.toStringTag,{value:"Module"})),kl=g.createContext(I.ZERO_CONTEXT_VALUE),Ml=()=>g.use(kl),Ke=()=>Ml().synnax,Kf=()=>Ml().state,Jr={connected:"success",connecting:"info",disconnected:"info",failed:"error"},_l="serverVersionMismatch",qf=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Pl=({children:e,connParams:t})=>{const[n,s,r]=Z.useCombinedStateAndRef(I.ZERO_CONTEXT_VALUE),[{path:i},,l]=Q.use$1({type:I.Provider.TYPE,schema:I.Provider.stateZ,initialState:{props:t??null,state:null}}),c=Re.useAdder(),a=g.useCallback(d=>{r.current.state.status!==d.status&&c({variant:Jr[d.status],message:d.message??u.d.capitalize(d.status)}),s(x=>({...x,state:d}))},[c]);return Q.useAsyncEffect(async()=>{if(n.synnax!=null&&n.synnax.close(),t==null)return s(I.ZERO_CONTEXT_VALUE);const d=new qt.bg({...t,connectivityPollFrequency:qt.S.seconds(5)});s({synnax:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(s({synnax:d,state:x}),c({variant:Jr[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||le.oe.semVerOlder(x.nodeVersion,x.clientVersion),m=qf(p,x.clientVersion,x.nodeVersion);c({variant:"warning",message:"Incompatible cluster version",description:m,data:{type:_l,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(a),l({props:t,state:x}),()=>{d.close(),s(I.ZERO_CONTEXT_VALUE),l({props:null,state:null})}},[t,a]),o.jsxRuntimeExports.jsx(kl,{value:n,children:o.jsxRuntimeExports.jsx(Q.Composite,{path:i,children:e})})},Xf=Object.freeze(Object.defineProperty({__proto__:null,Provider:Pl,SERVER_VERSION_MISMATCH:_l,use:Ke,useConnectionState:Kf},Symbol.toStringTag,{value:"Module"})),Ll=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),on=()=>g.use(Ll),Nl=e=>on().aliases[e]??null,Ms=()=>on().aliases,_s=(e,t="")=>{const{getName:n}=on(),[s,r]=g.useState(t);return Q.useAsyncEffect(async()=>{const i=await n(e);r(i)},[e,n]),s??t},nr=()=>on().activeRange??void 0,Tl=({activeRange:e,children:t})=>{const n=Ke(),[s,r]=g.useState({}),i=g.useCallback(a=>{r(d=>{const x={...d};return a.forEach(({variant:p,key:m,value:f})=>{const h=Number(m.split("---")[1]);p==="delete"?delete x[h]:x[f.channel]=f.alias}),x})},[r]),l=g.useCallback(async(a,d)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(a,d)},[n,e]),c=g.useCallback(async a=>{if(n==null||a===0)return;const d=s[a];return d??(await n.channels.retrieve(a)).name},[s,n]);return Q.useAsyncEffect(async()=>{if(n==null||e==null){r({});return}const a=await n.ranges.retrieve(e),d=await a.listAliases();r(d);const x=await a.openAliasTracker(),p=x.onChange(i);return()=>{p(),x.close()}},[n,e]),o.jsxRuntimeExports.jsx(Ll,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},Uf=({channelKey:e,value:t,shadow:n,className:s,...r})=>{const[i,l]=g.useState(!1),{setAlias:c}=on(),a=Nl(e),d=_s(e);let x=o.jsxRuntimeExports.jsx(Z.E4.Rename,{});i?x=o.jsxRuntimeExports.jsx(Z.E4.Loading,{}):a===t&&(x=o.jsxRuntimeExports.jsx(Z.E4.Check,{}));const p=c!=null&&!i&&a!==t&&e!==0,m=Re.useErrorHandler(),f=()=>{p&&m(async()=>{l(!0),await c(e,t),l(!1)},"Failed to set channel alias")},h=()=>{var S;a!=null&&((S=r.onChange)==null||S.call(r,a))},j=()=>e===0?o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Alias synced with this label"}):o.jsxRuntimeExports.jsxs(Z.Text,{level:"small",children:["Sync alias for ",d," with this label"]});return o.jsxRuntimeExports.jsxs(ut.Text,{value:t,...r,children:[p&&o.jsxRuntimeExports.jsx(he.Icon,{onClick:h,tooltip:o.jsxRuntimeExports.jsxs(Z.Text,{level:"small",children:["Set ",d," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:o.jsxRuntimeExports.jsx(Z.E4.Sync,{})}),o.jsxRuntimeExports.jsx(he.Icon,{onClick:f,disabled:!p,tooltip:o.jsxRuntimeExports.jsx(j,{}),tooltipLocation:{y:"top"},variant:"outlined",children:x})]})},tt="channel";var Qr=180/Math.PI,vo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Al(e,t,n,s,r,i){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:r,translateY:i,rotate:Math.atan2(t,e)*Qr,skewX:Math.atan(a)*Qr,scaleX:l,scaleY:c}}var Fn;function Jf(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?vo:Al(t.a,t.b,t.c,t.d,t.e,t.f)}function Qf(e){return e==null||(Fn||(Fn=document.createElementNS("http://www.w3.org/2000/svg","g")),Fn.setAttribute("transform",e),!(e=Fn.transform.baseVal.consolidate()))?vo:(e=e.matrix,Al(e.a,e.b,e.c,e.d,e.e,e.f))}function Il(e,t,n,s){function r(d){return d.length?d.pop()+" ":""}function i(d,x,p,m,f,h){if(d!==p||x!==m){var j=f.push("translate(",null,t,null,n);h.push({i:j-4,x:I.interpolateNumber(d,p)},{i:j-2,x:I.interpolateNumber(x,m)})}else(p||m)&&f.push("translate("+p+t+m+n)}function l(d,x,p,m){d!==x?(d-x>180?x+=360:x-d>180&&(d+=360),m.push({i:p.push(r(p)+"rotate(",null,s)-2,x:I.interpolateNumber(d,x)})):x&&p.push(r(p)+"rotate("+x+s)}function c(d,x,p,m){d!==x?m.push({i:p.push(r(p)+"skewX(",null,s)-2,x:I.interpolateNumber(d,x)}):x&&p.push(r(p)+"skewX("+x+s)}function a(d,x,p,m,f,h){if(d!==p||x!==m){var j=f.push(r(f)+"scale(",null,",",null,")");h.push({i:j-4,x:I.interpolateNumber(d,p)},{i:j-2,x:I.interpolateNumber(x,m)})}else(p!==1||m!==1)&&f.push(r(f)+"scale("+p+","+m+")")}return function(d,x){var p=[],m=[];return d=e(d),x=e(x),i(d.translateX,d.translateY,x.translateX,x.translateY,p,m),l(d.rotate,x.rotate,p,m),c(d.skewX,x.skewX,p,m),a(d.scaleX,d.scaleY,x.scaleX,x.scaleY,p,m),d=x=null,function(f){for(var h=-1,j=m.length,S;++h<j;)p[(S=m[h]).i]=S.x(f);return p.join("")}}}var eh=Il(Jf,"px, ","px)","deg)"),th=Il(Qf,", ",")",")"),nh=1e-12;function ei(e){return((e=Math.exp(e))+1/e)/2}function sh(e){return((e=Math.exp(e))-1/e)/2}function oh(e){return((e=Math.exp(2*e))-1)/(e+1)}const rh=function e(t,n,s){function r(i,l){var c=i[0],a=i[1],d=i[2],x=l[0],p=l[1],m=l[2],f=x-c,h=p-a,j=f*f+h*h,S,R;if(j<nh)R=Math.log(m/d)/t,S=function(_){return[c+_*f,a+_*h,d*Math.exp(t*_*R)]};else{var w=Math.sqrt(j),E=(m*m-d*d+s*j)/(2*d*n*w),C=(m*m-d*d-s*j)/(2*m*n*w),P=Math.log(Math.sqrt(E*E+1)-E),N=Math.log(Math.sqrt(C*C+1)-C);R=(N-P)/t,S=function(_){var $=_*R,D=ei(P),B=d/(n*w)*(D*oh(t*$+P)-sh(P));return[c+B*f,a+B*h,d*D/ei(t*$+P)]}}return S.duration=R*1e3*t/Math.SQRT2,S}return r.rho=function(i){var l=Math.max(.001,+i),c=l*l,a=c*c;return e(l,c,a)},r}(Math.SQRT2,2,4),ih=Object.freeze(Object.defineProperty({__proto__:null,Canvas:I.Canvas,axisStateZ:I.axisStateZ,newTickFactory:I.newTickFactory,tickFactoryProps:I.tickFactoryProps,tickType:I.tickType},Symbol.toStringTag,{value:"Module"})),lh={region:u.Mo.ZERO,dpr:1,os:le.S.getOS()},ch={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},ah=({children:e,resizeDebounce:t=100,className:n,...s})=>{const[{path:r},{bootstrapped:i,dpr:l},c]=Q.use$1({type:I.Canvas$1.TYPE,schema:I.canvasStateZ,initialState:lh}),a=g.useRef({...ch}),d=g.useRef(!1),x=g.useCallback(j=>{a.current.bootstrapped&&(c(()=>({bootstrapped:!0,region:j,dpr:window.devicePixelRatio,os:le.S.getOS({default:"Windows"})})),d.current=!0)},[c]),p=g.useRef(null),m=Ye.useResize(x,{debounce:t}),f=Z.useCombinedRefs(p,m);g.useEffect(()=>{const j=()=>{window.devicePixelRatio===l||!a.current.bootstrapped||p.current==null||c(S=>({...S,region:u.Mo.construct(p.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",j,{once:!0})},[l]),g.useEffect(()=>{const j=()=>{!a.current.bootstrapped||p.current==null||c(S=>({...S,region:u.Mo.construct(p.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",j),window.addEventListener("blur",j)},[c]);const h=g.useCallback(j=>{if(j==null)return;j.className.includes("gl")?a.current.gl=j:j.className.includes("upper2d")?a.current.upper2d=j:a.current.lower2d=j;const{gl:S,lower2d:R,upper2d:w,bootstrapped:E}=a.current;if(S==null||R==null||w==null||E)return;a.current.bootstrapped=!0;const C=S.transferControlToOffscreen(),P=w.transferControlToOffscreen(),N=R.transferControlToOffscreen();c({glCanvas:C,upper2dCanvas:P,lower2dCanvas:N,bootstrap:!0,bootstrapped:!1,region:u.Mo.construct(S),dpr:window.devicePixelRatio,os:le.S.getOS({default:"Windows"})},[C,P,N])},[c]);return o.jsxRuntimeExports.jsxs("div",{ref:f,className:u.CSS(u.CSS.B("canvas-container"),n),...s,children:[o.jsxRuntimeExports.jsx("canvas",{ref:h,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","lower2d"))}),o.jsxRuntimeExports.jsx("canvas",{ref:h,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","gl"))}),o.jsxRuntimeExports.jsx("canvas",{ref:h,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","upper2d"))}),o.jsxRuntimeExports.jsx(Q.Composite,{path:r,children:i&&e})]})},Tn=(e,t)=>Ye.useResize(g.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(u.b.XY.translate(u.G.scale(u.Mo.topLeft(r),-1)).box(n),s)},[e]),t),uh=Object.freeze(Object.defineProperty({__proto__:null,Canvas:ah,useRegion:Tn},Symbol.toStringTag,{value:"Module"})),zl=g.createContext(null),nt=e=>{const t=g.use(zl);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},$l=e=>{const t=nt("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},An=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=nt(t),{key:r}=e;return Q.useEffectCompare(()=>{u.K.outer.parse(e.loc),n(e)},([c],[a])=>Be.I.equal(c,a),[e]),g.useEffect(()=>()=>s(r),[]),{gridArea:u.g.swap(u.K.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},Dl=({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=u.G.ZERO,children:r,hold:i=!1,onHold:l,visible:c,...a})=>{const[d,x]=g.useState([]),p=Te.useMemoDeepEqualProps({clearOverScan:s,hold:i,visible:c}),[{path:m},{grid:f},h]=Q.use$1({aetherKey:e,type:I.LinePlot.TYPE,schema:I.linePlotStateZ,initialState:{container:u.Mo.ZERO,viewport:u.Mo.DECIMAL,grid:{},...p}});g.useEffect(()=>h(O=>({...O,...p})),[p]);const j=g.useRef(new Map),S=g.useCallback(O=>(j.current.set(O,null),()=>j.current.delete(O)),[j]),R=g.useCallback(O=>{const{mode:M,box:y,stage:k}=O;(M==="pan"&&k!=="start"||M==="zoom"||M==="zoomReset"&&k==="start")&&h(b=>({...b,viewport:y})),j.current.forEach((b,L)=>L(O))},[h]),w=g.useCallback(O=>h(M=>({...M,container:O})),[h]),E=Tn(w,{debounce:n}),C=g.useCallback(O=>h(M=>({...M,grid:{...M.grid,[O.key]:O}})),[h]),P=g.useCallback(O=>h(M=>{const{[O]:y,...k}=M.grid;return{...M,grid:k}}),[h]),N=g.useCallback(O=>{x(M=>[...M.filter(({key:y})=>y!==O.key),O])},[x,R]),_=g.useCallback(O=>x(M=>M.filter(({key:y})=>y!==O)),[N]),$=g.useMemo(()=>dh(f),[f]),D=g.useCallback(O=>{h(M=>({...M,hold:O})),l==null||l(O)},[h,l]),B=`line-plot-${e}`,F=g.useMemo(()=>({lines:d,setGridEntry:C,removeGridEntry:P,setLine:N,removeLine:_,setViewport:R,addViewportHandler:S,setHold:D,id:B}),[B,d,C,P,N,_,R,S,D]);return o.jsxRuntimeExports.jsx("div",{id:B,className:u.CSS.B("line-plot"),style:{...t,...$},ref:E,...a,children:o.jsxRuntimeExports.jsx(zl,{value:F,children:o.jsxRuntimeExports.jsx(Q.Composite,{path:m,children:r})})})},dh=e=>{const t=u.CSS.newGridBuilder();return I.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)"),I.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),I.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)"),I.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},sr=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?I.XAxis.TYPE:I.YAxis.TYPE,s=`${e}-axis`,r=({aetherKey:i,children:l,location:c=t,label:a="",labelLevel:d="small",labelDirection:x=e,onLabelChange:p,color:m,labelSize:f,showGrid:h,type:j,bounds:S,className:R,tickSpacing:w,autoBounds:E,autoBoundUpdateInterval:C,onAutoBoundsChange:P,style:N,..._})=>{const $=((a==null?void 0:a.length)??0)>0,D=Q.useUniqueKey(i),B=Te.useMemoDeepEqualProps({location:c,showGrid:h,type:j,bounds:S,label:a,labelDirection:x,tickSpacing:w,autoBounds:E,autoBoundUpdateInterval:C}),[{path:F},{size:O,labelSize:M,...y},k]=Q.use$1({aetherKey:D,type:n,schema:I.coreAxisStateZ,initialState:B});g.useEffect(()=>k(T=>({...T,...B})),[B]),g.useEffect(()=>{const{lower:T,upper:V}=I.parseAutoBounds(y.autoBounds);y.bounds!=null&&(T&&(S==null?void 0:S.lower)!==y.bounds.lower||V&&(S==null?void 0:S.upper)!==y.bounds.upper)&&(P==null||P(y.bounds))},[y.autoBounds,y.bounds]);const b=An({loc:c,key:`${n}-${D}`,size:O+M,order:1},`${e.toUpperCase()}Axis`),L=qo.useTypography(d).toString(),A=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(a==null)return;let V=qr.dimensions(a,L)[u.g.dimension(u.g.construct(x))];V>0&&(V+=9),k(H=>({...H,labelSize:V}))}else{let V=qr.dimensions(a,L).height*1.3;V>0&&(V+=12);const H=A.current;I.withinSizeThreshold(H,V)||(A.current=V,k(G=>({...G,labelSize:V})))}},[a,x,L]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(oe.Space,{className:u.CSS(R,u.CSS.B("axis"),u.CSS.B(s),u.CSS.loc(c)),style:{...N,...b},align:"center",justify:c!=="left"?"end":"start",direction:u.g.swap(e),..._,children:$&&o.jsxRuntimeExports.jsx(Z.MaybeEditable,{className:u.CSS(u.CSS.BE("axis","label"),u.CSS.dir(x)),value:a,onChange:p,level:d})}),o.jsxRuntimeExports.jsx(Q.Composite,{path:F,children:l})]})};return r.displayName=`${e.toUpperCase()}Axis`,r},Bl=sr("x"),Ol=sr("y"),Vl=u.G.xy.extend({root:u.K.corner,units:ce.z.object({x:ce.z.enum(["px","decimal"]),y:ce.z.enum(["px","decimal"])})}),xh=Vl.partial({root:!0,units:!0}),ph=e=>{var n,s,r,i;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[((r=e.root)==null?void 0:r.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},mh=(e,t)=>{var i,l,c,a,d,x;const n={x:e.x,y:e.y};if(t.current==null)return n;const s=u.Mo.construct(t.current),r=u.Mo.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.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+u.Mo.width(s))/u.Mo.width(r):n.x/=u.Mo.width(r),((a=e.units)==null?void 0:a.y)==="decimal"?((d=e.root)==null?void 0:d.y)==="bottom"&&(n.y=1-e.y):((x=e.root)==null?void 0:x.y)==="bottom"?n.y=1-(e.y+u.Mo.height(s))/u.Mo.height(r):n.y/=u.Mo.height(r),n},Fl=(e,t)=>{if(t.current==null)return null;const n=u.Mo.construct(t.current.parentElement),s=u.Mo.construct(t.current),r={x:e.x,y:e.y,root:{...u.K.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*u.Mo.width(n)-u.Mo.width(s),r.root.x="right"):e.x<.2?r.x=e.x*u.Mo.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*u.Mo.height(n)-u.Mo.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*u.Mo.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...u.G.truncate(r,3)}},ti=u.Mo.reRoot(u.Mo.DECIMAL,u.K.TOP_LEFT),or=g.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,...i})=>{const[l,c]=le.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:u.K.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),a=g.useRef(l),d=Z.useSyncedRef(r===!1),x=g.useRef(null);l!==null&&(s={...s,...ph(l)});const p=g.useCallback(f=>{var C;if(((C=x.current)==null?void 0:C.parentElement)==null)return a.current;const h=u.Mo.construct(x.current.parentElement),j=u.b.XY.scale(h).scale(ti),S=j.box(u.Mo.construct(x.current)),R=u.b.XY.clamp(u.Mo.construct(u.Mo.topLeft(ti),{width:1-u.Mo.width(S),height:1-u.Mo.height(S)})),w=u.G.translate(u.G.construct(a.current),u.Mo.signedDims(j.box(f))),E=R.pos(w);return Fl(E,x)},[]),m=We.useCursorDrag({onStart:g.useCallback(()=>{a.current=mh(a.current,x)},[]),onMove:g.useCallback(f=>{if(d.current)return;const h=p(f);h!==null&&c(h)},[]),onEnd:g.useCallback(f=>{if(d.current)return;const h=p(f);h!==null&&(a.current=h)},[])});return o.jsxRuntimeExports.jsx(oe.Space,{className:u.CSS(e,u.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:m,draggable:r,ref:x,...i,onDrag:je.preventDefault,onDragEnd:je.preventDefault,empty:!0})});or.displayName="Legend.Container";const rr=(e,t,n)=>e.sort((s,r)=>s.label.localeCompare(r.label)).map(({key:s,color:r,label:i})=>o.jsxRuntimeExports.jsxs(oe.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[o.jsxRuntimeExports.jsx(We.Swatch,{value:r,onChange:l=>t==null?void 0:t({key:s,color:l,label:i}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"tiny"}),o.jsxRuntimeExports.jsx(Z.MaybeEditable,{level:"small",value:i,onChange:l=>t==null?void 0:t({key:s,color:r,label:l}),noWrap:!0})]},s)),ir=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...r})=>{const[i,l]=g.useState(!1);return e.length===0?null:o.jsxRuntimeExports.jsx(or,{...r,draggable:!i,value:n,onChange:s,children:rr(e,t,l)})},fh=Object.freeze(Object.defineProperty({__proto__:null,Container:or,Simple:ir,calcStickyPos:Fl,completeStickyXYz:Vl,legendSwatches:rr,stickyXYz:xh},Symbol.toStringTag,{value:"Module"})),lr=g.memo(({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=nt("Legend");return nt("Legend"),o.jsxRuntimeExports.jsx(ir,{data:r,onEntryChange:n,...s})});lr.displayName="FloatingLegend";const hh=({onLineChange:e})=>{const{lines:t}=nt("Legend"),n=Q.useUniqueKey(),s=An({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return o.jsxRuntimeExports.jsx(oe.Space,{className:u.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:rr(t,e)})},Hl=({variant:e="floating",...t})=>e==="floating"?o.jsxRuntimeExports.jsx(lr,{...t}):o.jsxRuntimeExports.jsx(hh,{...t}),cr=g.memo(({aetherKey:e,...t})=>(Q.useUnidirectional({aetherKey:e,type:I.Line.TYPE,schema:I.stateZ,state:t}),null));cr.displayName="Line";const gh=Object.freeze(Object.defineProperty({__proto__:null,Line:cr},Symbol.toStringTag,{value:"Module"})),ar=({aetherKey:e,color:t,label:n="",...s})=>{const r=Q.useUniqueKey(e),{setLine:i,removeLine:l}=nt("Line");return g.useEffect(()=>(i({key:r,color:t,label:n}),()=>l(r)),[n,t]),o.jsxRuntimeExports.jsx(cr,{aetherKey:r,color:t,label:n,...s})},Zl=({level:e="h2",...t})=>{const n=Q.useUniqueKey(),s=qo.useTypography(e),r=An({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return o.jsxRuntimeExports.jsx(oe.Space,{justify:"center",align:"center",style:r,children:o.jsxRuntimeExports.jsx(Z.MaybeEditable,{...t,level:e})})},Gl=({aetherKey:e,...t})=>{const n=Q.useUniqueKey(e),[,,s]=Q.use$1({aetherKey:n,type:I.Tooltip.TYPE,schema:I.tooltipStateZ,initialState:{position:null,...t}}),r=g.useRef(null),i=g.useCallback(c=>{const a=document.querySelector(".pluto-canvas-container");if(a==null)return;const d=u.Mo.topLeft(a);s({position:u.G.translation(d,u.G.construct(c))})},[s]),l=g.useCallback(()=>s({position:null}),[s]);return g.useEffect(()=>{if(r.current===null)return;const c=r.current.parentElement;if(c!=null)return c.addEventListener("mousemove",i),c.addEventListener("mouseleave",l),()=>{c.removeEventListener("mousemove",i),c.removeEventListener("mouseleave",l)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:r})},jh=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Gl},Symbol.toStringTag,{value:"Module"})),Eh={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Yl=({className:e,mode:t,maskBox:n,children:s,style:r,...i})=>o.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.noSelect,u.CSS.BE("viewport-mask","container"),e),style:{cursor:Eh[t],...r},...i,children:[o.jsxRuntimeExports.jsx("div",{style:{...u.Mo.css(n),display:u.Mo.areaIsZero(n)?"none":"block"},className:u.CSS.BE("viewport-mask","selection")}),s]}),yh=[],ur=({data:e,emptyContent:t,value:n,onChange:s,allowMultiple:r,allowNone:i,hideColumnHeader:l=!1,columns:c=yh,visible:a,itemHeight:d=Re.Column.itemHeight,listItem:x=he.componentRenderProp(Re.Column.Item),replaceOnSingle:p,omit:m,autoSelectOnNone:f,trigger:h,extraDialogContent:j,variant:S="connected",...R})=>{let w=o.jsxRuntimeExports.jsxs(Re.Hover,{disabled:!a,children:[j,o.jsxRuntimeExports.jsx(Re.Column.Header,{hide:l||x!=null,columns:c,children:o.jsxRuntimeExports.jsx(Re.Core.Virtual,{itemHeight:d,children:x})})]});return S!=="connected"&&(w=o.jsxRuntimeExports.jsx(ks.Pack,{direction:"y",borderShade:4,className:u.CSS.B("select-dialog-content"),children:w})),o.jsxRuntimeExports.jsx(Re.List,{data:e,emptyContent:t,omit:m,children:o.jsxRuntimeExports.jsx(Re.Selector,{value:n,onChange:s,allowMultiple:r,allowNone:i,replaceOnSingle:p,autoSelectOnNone:f,children:o.jsxRuntimeExports.jsxs(Ye.Dialog,{visible:a,className:u.CSS.B("select"),keepMounted:!1,variant:S,...R,children:[h,w]})})})},ot=({children:e=Sh,value:t,onChange:n,entryRenderKey:s="key",allowNone:r=!1,allowMultiple:i=!1,data:l,replaceOnSingle:c,className:a,size:d="small",actions:x,pack:p=!0,variant:m,...f})=>{const{onSelect:h}=Re.useSelect({allowMultiple:i,allowNone:r,replaceOnSingle:c,data:l,value:t,onChange:n}),j=R=>{m!=="preview"&&h(R)},S=l==null?void 0:l.map(R=>e({key:R.key,onClick:()=>j(R.key),size:d,selected:R.key===t,entry:R,title:R[s]}));return p?o.jsxRuntimeExports.jsxs(ks.Pack,{borderShade:4,className:u.CSS(u.CSS.B("select-button"),a),size:d,...f,children:[S,x]}):o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:S})},Sh=({key:e,onClick:t,selected:n,title:s})=>o.jsxRuntimeExports.jsx(he.Button,{onClick:t,variant:n?"filled":"outlined",size:"small",children:s},e),Wl=({selected:e,renderKey:t,toggle:n,visible:s,children:r,...i})=>o.jsxRuntimeExports.jsx(he.Button,{className:u.CSS.B("select-dropdown-button"),onClick:n,variant:"outlined",endIcon:o.jsxRuntimeExports.jsx(Nn.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:s}),...i,children:r??(e==null?void 0:e[t])}),Kl=he.componentRenderProp(Wl),Ps=({data:e,value:t,columns:n=[],children:s=Kl,entryRenderKey:r="key",allowNone:i=!1,onChange:l,disabled:c,hideColumnHeader:a=!0,variant:d,dropdownVariant:x,...p})=>{const{close:m,visible:f,toggle:h}=Ye.use(),[j,S]=g.useState((e==null?void 0:e.find(E=>E.key===t))??null);g.useEffect(()=>{S((e==null?void 0:e.find(E=>E.key===t))??null)},[e,t]);const R=g.useCallback((E,C)=>{if(!(Array.isArray(E)||E===null)){if(m(),E==null)return S(null),l(t);S(C.entries[0]),l(E)}},[l,t,m,S]),w={selected:j,renderKey:r,toggle:h,visible:f,disabled:c};return d!=null&&(w.variant=d),o.jsxRuntimeExports.jsx(ur,{close:m,data:e,visible:f,value:t,onChange:R,allowMultiple:!1,allowNone:i,columns:n,hideColumnHeader:a,variant:x,trigger:o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:s(w)}),...p})},Rh=[{key:"start",icon:o.jsxRuntimeExports.jsx(Z.E4.TextAlign.Left,{})},{key:"center",icon:o.jsxRuntimeExports.jsx(Z.E4.TextAlign.Center,{})},{key:"end",icon:o.jsxRuntimeExports.jsx(Z.E4.TextAlign.Right,{})}],Ch=({key:e,entry:t,onClick:n,selected:s})=>o.jsxRuntimeExports.jsx(he.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),Ls=({children:e=Ch,...t})=>o.jsxRuntimeExports.jsx(ot,{...t,allowMultiple:!1,data:Rh,children:e}),bh=[{key:"large",label:"L"},{key:"medium",label:"M"},{key:"small",label:"S"}],ql=e=>o.jsxRuntimeExports.jsx(ot,{...e,data:bh,entryRenderKey:"label"}),wh=new Set([le.g$1.UUID,le.g$1.JSON]),Xl=le.g$1.ALL.filter(e=>e!==le.g$1.UNKNOWN).map(e=>({key:e.toString(),name:wh.has(e)?e.toString().toUpperCase():u.d.capitalize(e.toString())})),vh=Xl.filter(e=>!new le.g$1(e.key).isVariable),kh=[{key:"name",name:"Name"}],Mh=({hideVariableDensity:e=!1,...t})=>o.jsxRuntimeExports.jsx(Ps,{...t,data:e?vh:Xl,columns:kh,entryRenderKey:"name"}),_h=[{key:"x",icon:o.jsxRuntimeExports.jsx(Z.E4.Arrow.Right,{})},{key:"y",icon:o.jsxRuntimeExports.jsx(Z.E4.Arrow.Up,{})}],Ph=[{key:"x",icon:o.jsxRuntimeExports.jsx(Z.E4.Arrow.Right,{})},{key:"y",icon:o.jsxRuntimeExports.jsx(Z.E4.Arrow.Down,{})}],Lh=({key:e,entry:t,onClick:n,selected:s})=>o.jsxRuntimeExports.jsx(he.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),Ul=({children:e=Lh,yDirection:t="up",...n})=>o.jsxRuntimeExports.jsx(ot,{...n,allowMultiple:!1,data:t==="up"?_h:Ph,children:e}),Jl=e=>o.jsxRuntimeExports.jsx(he.Icon,{className:u.CSS.BE("select","clear"),variant:"outlined",...e,children:o.jsxRuntimeExports.jsx(Z.E4.Close,{"aria-label":"clear"})}),dt=({onChange:e,value:t,entryRenderKey:n="key",data:s,inputProps:r,allowNone:i=!0,searcher:l,className:c,variant:a="button",hideColumnHeader:d=!1,disabled:x,children:p,dropdownVariant:m="connected",placeholder:f=Ns,inputPlaceholder:h=f,triggerTooltip:j,dropdownZIndex:S,filter:R,actions:w,...E})=>{const{visible:C,open:P,close:N,toggle:_}=Ye.use(),[$,D]=g.useState(null),B=l!=null;Q.useAsyncEffect(async()=>{if(Re.selectValueIsZero(t))return D(null);if(($==null?void 0:$.key)===t)return;let k=null;if(B)try{[k]=await l.retrieve([t])}finally{k??(k=null)}else s!=null&&(k=s.find(b=>b.key===t)??null);D(k)},[l,t,s]);const F=g.useCallback((k,b)=>{Array.isArray(k)||(D(k==null?null:b.entries[0]),N(),e(k,b))},[e,i]),O=g.useMemo(()=>B?bt.Search:bt.Filter,[B]),M=o.jsxRuntimeExports.jsx(O,{searcher:l,filter:R,children:({onChange:k})=>o.jsxRuntimeExports.jsx(Nh,{...r,autoFocus:m==="modal",variant:a,onChange:k,onFocus:P,selected:$,entryRenderKey:n,visible:C,allowNone:i,className:c,dropdownVariant:m,disabled:x,placeholder:h,children:w})}),y=o.jsxRuntimeExports.jsx(he.Button,{tooltip:j,variant:"outlined",onClick:_,disabled:x,children:$!=null?Ql(n,$):f});return o.jsxRuntimeExports.jsx(ur,{close:N,zIndex:S,data:s,allowMultiple:!1,visible:C,value:t,hideColumnHeader:d,onChange:F,allowNone:i,listItem:p,variant:m,trigger:m!=="modal"?M:y,extraDialogContent:m==="modal"?M:void 0,keepMounted:!1,...E})},Ns="Select",Ql=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Nh=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:r,allowNone:i=!0,placeholder:l=Ns,className:c,disabled:a,dropdownVariant:d,children:x,...p})=>{const{clear:m}=Re.useSelectionUtils(),[f,h]=g.useState("");g.useEffect(()=>{if(!n){if(le.w(t==null?void 0:t.key))return h("");t!=null&&h(Ql(e,t))}},[t,n,e]);const j=C=>{s(C),h(C)},S=()=>{f===""&&s(""),h(""),r==null||r()},R=C=>{n||(C.preventDefault(),r==null||r())},w=()=>{h(""),m==null||m()};let E;return d!=="modal"&&(E=o.jsxRuntimeExports.jsx(Nn.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n})),o.jsxRuntimeExports.jsxs(ut.Text,{className:u.CSS(u.CSS.BE("select","input"),c),value:f,onChange:j,onFocus:S,onKeyDown:Ie.matchCallback([["Enter"]],C=>{C.preventDefault(),!n&&(r==null||r())}),endContent:E,style:{flexGrow:1},onClick:R,placeholder:l,disabled:a,...p,children:[x,i&&o.jsxRuntimeExports.jsx(Jl,{onClick:w,disabled:a})]})},Rn=({children:e="",size:t="medium",color:n,icon:s,onClose:r,className:i,onDragStart:l,...c})=>{const a=u.cssString(n);s==null&&n!=null&&(s=o.jsxRuntimeExports.jsx(Z.E4.Circle,{fill:a}));const d=r==null?void 0:o.jsxRuntimeExports.jsx(he.Icon,{"aria-label":"close",size:"small",className:u.CSS.BE("tag","close"),onClick:x=>{x.stopPropagation(),r()},children:o.jsxRuntimeExports.jsx(Z.E4.Close,{})});return o.jsxRuntimeExports.jsx(vs.WithIcon,{startIcon:s,endIcon:d,className:u.CSS(i,u.CSS.B("tag"),r!=null&&u.CSS.BM("tag","closeable")),level:le.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:l,...c,children:e})},Th=Object.freeze(Object.defineProperty({__proto__:null,Tag:Rn},Symbol.toStringTag,{value:"Module"})),dr=({entryKey:e,entryRenderKey:t,entry:n,loading:s,...r})=>{let i=e;return n!=null&&(i=typeof t=="function"?t(n):n[t]),g.createElement(Rn,{size:"small",variant:"outlined",className:u.CSS(n==null&&!s&&u.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},le.ne(i))},Ah=he.componentRenderProp(dr),rn=({onChange:e,value:t,className:n,data:s,columns:r=[],entryRenderKey:i="key",emptyContent:l,searcher:c,renderTag:a=Ah,placeholder:d,onTagDragStart:x,allowMultiple:p,allowNone:m,replaceOnSingle:f,onTagDragEnd:h,style:j,addPlaceholder:S="Add",children:R,dropdownVariant:w="connected",actions:E,...C})=>{const{visible:P,open:N,close:_}=Ye.use(),[$,D]=g.useState([]),[B,F]=g.useState(!1),O=c!=null;Q.useAsyncEffect(async()=>{F(!0),Re.selectValueIsZero(t)&&D([]);const L=$.map(V=>V.key),A=_e.A(t);if(le.F.unorderedPrimitiveArrays(L,A)===le.F.EQUAL)return;let T=[];if(O)try{T=await c.retrieve(A)}finally{F(!1)}else s!=null&&(T=s.filter(V=>A.includes(V.key)));D(T)},[c,O,t,s]);const M=g.useCallback((L,A)=>{L!=null&&(D(A.entries),e(_e.A(L),A))},[e]),y=g.useMemo(()=>O?bt.Search:bt.Filter,[O]);let k,b;if(w==="connected")b=o.jsxRuntimeExports.jsx(y,{searcher:c,children:({onChange:L,value:A})=>o.jsxRuntimeExports.jsx(Ih,{dropdownVariant:w,value:A,selectedKeys:t,className:n,onChange:L,loading:B,selected:$,onFocus:N,entryRenderKey:i,visible:P,renderTag:a,placeholder:d,onTagDragStart:x,onTagDragEnd:h,style:j,children:E})});else{const L=_e.A(t);b=o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",grow:!0,style:j,size:"small",children:[L.map(A=>{const T=$.find(V=>V.key===A);return a({key:A,entryKey:A,entryRenderKey:i,loading:B,entry:T,onClose:()=>{const V=L.filter(H=>H!==A);e(V,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:V=>x==null?void 0:x(V,A),onDragEnd:V=>h==null?void 0:h(V,A)})}),L.length>0?o.jsxRuntimeExports.jsx(he.Icon,{onClick:N,children:o.jsxRuntimeExports.jsx(Z.E4.Add,{style:{color:"var(--pluto-gray-l7)"}})}):o.jsxRuntimeExports.jsx(he.Button,{onClick:N,shade:7,startIcon:o.jsxRuntimeExports.jsx(Z.E4.Add,{}),variant:"text",children:S})]}),k=o.jsxRuntimeExports.jsx(y,{searcher:c,children:A=>o.jsxRuntimeExports.jsx(ut.Text,{autoFocus:!0,placeholder:"Search",...A,children:E})})}return o.jsxRuntimeExports.jsx(ur,{close:_,data:s,emptyContent:l,visible:P,value:t,onChange:M,allowNone:m,replaceOnSingle:f,columns:r,allowMultiple:!0,listItem:R,trigger:b,extraDialogContent:k,variant:w,...C})},Ih=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:r,visible:i,entryRenderKey:l,renderTag:c,placeholder:a=Ns,onTagDragStart:d,onTagDragEnd:x,value:p,className:m,children:f,dropdownVariant:h,...j})=>{const{onSelect:S,clear:R}=Re.useSelectionUtils(),w=g.useRef(null);g.useLayoutEffect(()=>{var _;i&&((_=w.current)==null||_.focus())},[i,n]);const E=()=>{i||s(""),r==null||r()},C=()=>{i||r==null||r()},P=()=>{i||s("")};let N;return h!=="modal"&&(N=o.jsxRuntimeExports.jsx(Nn.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:i})),o.jsxRuntimeExports.jsxs(ut.Text,{ref:w,className:u.CSS(u.CSS.BE("select-multiple","input"),u.CSS.visible(i),m),onBlur:P,placeholder:a,value:p,onChange:s,onFocus:E,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:C,endContent:N,variant:"button",...j,children:[o.jsxRuntimeExports.jsx(oe.Space,{direction:"x",className:u.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:_e.A(e).map(_=>{const $=n.find(D=>D.key===_);return c({key:_,entryKey:_,entryRenderKey:l,loading:t,entry:$,onClose:()=>S==null?void 0:S(_),onDragStart:D=>d==null?void 0:d(D,_),onDragEnd:D=>x==null?void 0:x(D,_)})})}),f,o.jsxRuntimeExports.jsx(Jl,{onClick:R})]})},zh=[{key:"h2",label:"XL"},{key:"h3",label:"L"},{key:"h4",label:"M"},{key:"h5",label:"S"},{key:"small",label:"XS"}],ln=e=>o.jsxRuntimeExports.jsx(ot,{...e,data:zh,entryRenderKey:"label"}),$h=[{key:600,label:"Bold"},{key:500,label:"Medium"},{key:400,label:"Normal"},{key:250,label:"Light"}],ec=e=>o.jsxRuntimeExports.jsx(ot,{...e,data:$h,entryRenderKey:"label"}),Dh=Object.freeze(Object.defineProperty({__proto__:null,Level:ln,Weight:ec},Symbol.toStringTag,{value:"Module"})),Bh=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Wl,Button:ot,ComponentSize:ql,DEFAULT_PLACEHOLDER:Ns,DataType:Mh,Direction:Ul,DropdownButton:Ps,Multiple:rn,MultipleTag:dr,Single:dt,Text:Dh,TextAlignment:Ls,defaultButton:Kl},Symbol.toStringTag,{value:"Module"})),es=6,Oh=2,ni=5,Vh=e=>u.Mo.width(e)<ni&&u.Mo.height(e)<ni,Fh=["zoom","pan","select","zoomReset"],jn=[...Fh,"click"],Hh=ce.z.enum(jn),tc=["zoom","select"],ts={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},nc={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},sc={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},xr={zoom:ts,pan:nc,select:sc,zoomReset:ts,click:ts},Zh=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},Gh=u.Mo.construct(0,0,1,1,u.K.TOP_LEFT),Yh={width:30,height:50},oc=({onChange:e,triggers:t,initial:n=Gh,threshold:s=Yh,ref:r})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[l,c]=g.useState(u.Mo.ZERO),[a,d]=g.useState(i),[x,p]=Z.useStateRef(n),m=g.useRef(u.G.ZERO),f=g.useRef(null),h=u._.construct(s);g.useEffect(()=>p(()=>u.Mo.truncate(n,es)),[n]),g.useEffect(()=>d(i),[i]);const[j,S,R,w]=Te.useMemoCompare(()=>{const $={...xr[i],...t},D=Ie.flattenConfig($),B=Zh($);return[$,D,B,Ie.flattenConfig(B)]},Ie.compareModeConfigs,[t]),E=g.useCallback(({box:$,triggers:D,stage:B,cursor:F})=>{if(f.current==null)return;const O=Ie.determineMode(j,D),M=u.Mo.construct(f.current);if(O==null)return;if(O==="zoomReset")return c(u.Mo.ZERO),e==null||e({box:u.Mo.DECIMAL,mode:O,stage:B,cursor:F}),p(u.Mo.DECIMAL);const y=Vh($);if(B==="end"){if(y){O==="zoom"&&c(u.Mo.ZERO),e==null||e({box:x.current,mode:"click",stage:B,cursor:F});return}return p(b=>{if(O==="pan"){const A=si($,b,M);return A===null||u.Mo.equals(A,b)?b:(e==null||e({box:A,mode:O,stage:B,cursor:F}),A)}const L=C($,b,M);return L===null?b:(e==null||e({box:L,mode:O,stage:B,cursor:F}),O==="zoom"?(c(u.Mo.ZERO),L):u.Mo.truncate(b,es))})}if(tc.includes(O))return y?void 0:c(u.b.XY.scale(M).clamp(M).translate({x:-u.Mo.left(M),y:-u.Mo.top(M)}).box(oi(h,$,M)));if(c(b=>u.Mo.areaIsZero(b)?b:u.Mo.ZERO),u.G.distance(F,m.current)<Oh)return;m.current=F;const k=si($,x.current,M);e==null||e({box:k,mode:O,stage:B,cursor:F})},[c,d,e,j,s.height,s.width,p,f]);g.useImperativeHandle(r,()=>({reset:()=>{c(u.Mo.ZERO),p(u.Mo.DECIMAL),e==null||e({box:u.Mo.DECIMAL,mode:"zoomReset",stage:"start",cursor:u.G.ZERO})}}),[e]);const C=g.useCallback(($,D,B)=>u.Mo.truncate(ko(D,B).box(oi(h,$,B)),es),[s]),P=Ie.useHeldRef({triggers:[["Control"]]}),N=Ie.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const $=D=>{if(f.current==null)return;let B=1;D.deltaY<0?B-=.035:B+=.035;const F=u.Mo.construct(f.current),O=u.G.construct(D);if(Array.from(f.current.children).push(f.current),!u.Mo.contains(F,O)||f.current!==D.target&&Ye.findParent(D.target,A=>A===f.current)==null)return;const k=ko(x.current,u.Mo.construct(f.current)).pos(u.G.construct(D));let L=u.b.XY.magnify({x:P.current.held?1:B,y:N.current.held?1:B}).box(x.current);L=u.Mo.translate(L,{x:P.current.held?0:k.x*(1-B),y:N.current.held?0:k.y*(1-B)}),p(L),e==null||e({stage:"end",box:L,cursor:u.G.construct(D),mode:"zoom"})};return window.addEventListener("wheel",$),()=>window.removeEventListener("wheel",$)},[p,e]),El.useDrag({bound:f,onDrag:E,triggers:S,loose:!0});const _=g.useCallback(({triggers:$,stage:D})=>{if(D==="end")return d(i);const B=Ie.determineMode(R,$);B!=null&&d(B)},[R,i,e]);return Ie.use({triggers:w,callback:_,region:f}),{maskBox:l,ref:f,mode:a}},ko=(e,t)=>u.b.XY.scale(t).clamp(t).scale(e),si=(e,t,n)=>{let s=u.Mo.signedDims(ko(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},u.Mo.truncate(u.b.XY.translate(u.G.construct(s)).box(t),es)},oi=(e,t,n)=>u.Mo.height(t)<=e.height?u.Mo.construct(u.Mo.left(t),u.Mo.top(n),u.Mo.width(t),u.Mo.height(n)):u.Mo.width(t)<=e.width?u.Mo.construct(u.Mo.left(n),u.Mo.top(t),u.Mo.width(n),u.Mo.height(t)):t,Wh=({mode:e,triggers:t})=>o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",children:[o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:u.d.capitalize(e)}),o.jsxRuntimeExports.jsx(oe.Space,{empty:!0,direction:"x",align:"center",children:o.jsxRuntimeExports.jsx(hf.Text,{trigger:t[0],level:"small"})})]}),Kh={zoom:o.jsxRuntimeExports.jsx(Z.E4.Zoom,{}),pan:o.jsxRuntimeExports.jsx(Z.E4.Pan,{}),select:o.jsxRuntimeExports.jsx(Z.E4.Selection,{}),zoomReset:o.jsxRuntimeExports.jsx(Z.E4.Expand,{}),click:o.jsxRuntimeExports.jsx(Z.E4.Bolt,{})},qh=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([r])=>!t.includes(r)&&jn.includes(r)).map(([r,i])=>({key:r,icon:Kh[r],tooltip:o.jsxRuntimeExports.jsx(Wh,{mode:r,triggers:i})})).sort((r,i)=>jn.indexOf(r.key)-jn.indexOf(i.key));return o.jsxRuntimeExports.jsx(ot,{...n,data:s,entryRenderKey:"icon",children:({title:r,entry:i,...l})=>g.createElement(he.Icon,{...l,key:i.key,variant:l.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},Xh=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:xr,MASK_MODES:tc,MODES:jn,Mask:Yl,PAN_DEFAULT_TRIGGERS:nc,SELECT_DEFAULT_TRIGGERS:sc,SelectMode:qh,ZOOM_DEFAULT_TRIGGERS:ts,modeZ:Hh,use:oc},Symbol.toStringTag,{value:"Module"})),Uh=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,rc=({ref:e,children:t,initial:n=u.Mo.DECIMAL,onChange:s,...r})=>{const{setViewport:i}=nt("Viewport");g.useLayoutEffect(()=>{i({box:n,mode:"zoom",cursor:u.G.ZERO,stage:"start"})},[i,n]);const l=g.useCallback(a=>{i(a),s==null||s(a)},[s,i]),c=oc({onChange:l,initial:n,ref:e,...r});return o.jsxRuntimeExports.jsx(Yl,{className:u.CSS.BE("line-plot","viewport"),...c,children:t})},Jh=Object.freeze(Object.defineProperty({__proto__:null,Floating:lr,Legend:Hl,Line:ar,LinePlot:Dl,Title:Zl,Tooltip:jh,Viewport:rc,XAxis:Bl,YAxis:Ol,axisFactory:sr,selectViewportEl:Uh,useContext:nt,useGridEntry:An,useViewport:$l},Symbol.toStringTag,{value:"Module"})),Qh=({aetherKey:e,...t})=>(Q.use$1({aetherKey:e,type:I.Annotation.TYPE,schema:I.annotationStateZ,initialState:t}),null),ic=({aetherKey:e,menu:t,...n})=>{const s=Q.useUniqueKey(e),{setViewport:r,setHold:i}=nt("Range.Provider"),[,{hovered:l,count:c},a]=Q.use$1({aetherKey:s,type:I.Provider$1.TYPE,schema:I.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),d=An({key:s,loc:"top",size:c>0?32:0,order:3},"Annotation.Provider"),x=Ct.useContextMenu(),p=Z.useSyncedRef(x.visible),m=g.useCallback(f=>{const h=S=>{a(R=>({...R,cursor:{x:S.clientX,y:S.clientY}}))},j=f.currentTarget;j.addEventListener("mousemove",h),j.addEventListener("mouseleave",()=>{j.removeEventListener("mousemove",h),p.current||a(S=>({...S,cursor:null}))},{once:!0})},[a]);return o.jsxRuntimeExports.jsx(Ct.ContextMenu,{style:{...d,cursor:l!=null?"pointer":"default"},...x,menu:()=>t==null||l==null?null:t(l),children:o.jsxRuntimeExports.jsx(oe.Space,{style:{width:"100%",height:"100%"},onClick:()=>{l!=null&&(r({box:u.Mo.construct({x:l.viewport.lower,y:0},{x:l.viewport.upper,y:1}),mode:"zoom",cursor:u.G.ZERO,stage:"start"}),i(!0))},onMouseEnter:m})})},eg=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Qh,Provider:ic},Symbol.toStringTag,{value:"Module"})),lc={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},tg=Ie.flattenConfig(lc),cc=({aetherKey:e})=>{const t=Q.useUniqueKey(e),[,,n]=Q.use$1({aetherKey:t,type:I.Measure.TYPE,schema:I.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=g.useRef(null),r=Ie.useHeldRef({triggers:tg,loose:!0}),i=g.useCallback(({mode:a,cursor:d})=>{if(a==="click"){const x=Ie.determineMode(lc,r.current.triggers,{loose:!0});if(["one","two"].includes(x))return n(p=>({...p,[x]:d}));n(x==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??d,two:p.one!==null?d:p.two}))}},[n,r]);$l(i);const l=g.useCallback(a=>n(d=>({...d,hover:u.G.construct(a)})),[n]),c=g.useCallback(()=>{n(a=>({...a,hover:null}))},[n]);return g.useEffect(()=>{if(s.current===null)return;const a=s.current.parentElement;if(a!=null)return a.addEventListener("mousemove",l),a.addEventListener("mouseleave",c),()=>{a.removeEventListener("mousemove",l),a.removeEventListener("mouseleave",c)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:s})},ng=Object.freeze(Object.defineProperty({__proto__:null,Measure:cc},Symbol.toStringTag,{value:"Module"})),pr=({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:r,onUnitsChange:i,units:l="",color:c,lineWidth:a,lineDash:d,className:x,onSelect:p,style:m,...f})=>{const[h,j]=le.usePurePassthrough({value:t,onChange:s,initial:""}),S=Z.useSyncedRef(r),[,{pixelPosition:R},w]=Q.use$1({aetherKey:e,type:I.Rule.TYPE,schema:I.ruleStateZ,initialState:{color:c,dragging:!1,position:n,lineWidth:a,lineDash:d},onAetherChange:g.useCallback(({position:M})=>{var y;M!=null&&((y=S.current)==null||y.call(S,M))},[S])}),E=g.useRef(R);R!==E.current&&(E.current=R);const{id:C}=nt("Rule"),P=document.getElementById(C),N=P==null?void 0:P.querySelector(".pluto-line-plot__viewport"),_=g.useRef(R);g.useEffect(()=>{w(M=>({...M,position:n,color:c,lineWidth:a,lineDash:d}))},[n,c,a,d]);const $=We.useCursorDrag({onStart:g.useCallback(()=>{p==null||p(),w(M=>({...M,dragging:!0})),_.current=E.current},[]),onMove:M=>{w(y=>({...y,pixelPosition:(_.current??0)+u.Mo.signedHeight(M)}))},onEnd:g.useCallback(()=>{w(M=>({...M,dragging:!1})),_.current=R},[])}),D=g.useRef(null);if(n==null||R==null)return null;const F=new u.Color(c).pickByContrast("#000000","#ffffff"),O=o.jsxRuntimeExports.jsxs("div",{ref:D,className:u.CSS.B("rule"),style:{top:`calc(${R}px - 0.5rem)`},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("rule","drag-handle"),onDragStart:$,draggable:!0}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",className:u.CSS(x,u.CSS.BE("rule","tag")),bordered:!0,onClick:p,size:1,rounded:!0,style:{borderColor:u.cssString(c),backgroundColor:new u.Color(c).setAlpha(.7).hex,...m},...f,children:[o.jsxRuntimeExports.jsx(Z.Editable,{className:u.CSS.B("label"),level:"small",value:h,onChange:j,color:F}),o.jsxRuntimeExports.jsx(vs.Divider,{direction:"y",style:{borderColor:u.cssString(c)}}),o.jsxRuntimeExports.jsxs(oe.Space,{size:"small",direction:"x",align:"center",children:[o.jsxRuntimeExports.jsx(Z.Editable,{value:n.toFixed(2),onChange:M=>{const y=Number(M);isFinite(y)&&(r==null||r(y))},level:"small",color:F}),o.jsxRuntimeExports.jsx(Z.MaybeEditable,{level:"small",color:F,value:l,onChange:i})]})]})]});return N==null?O:Xo.createPortal(O,N)},sg=Object.freeze(Object.defineProperty({__proto__:null,Rule:pr},Symbol.toStringTag,{value:"Module"})),ac=xe.canDropOfType(tt),og=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:r,showLegend:i=!0,legendPosition:l,onLegendPositionChange:c,titleLevel:a="h4",onLineChange:d,onRuleChange:x,onAxisChannelDrop:p,onAxisChange:m,rules:f,enableTooltip:h=!0,enableMeasure:j=!1,initialViewport:S=u.Mo.DECIMAL,legendVariant:R,onViewportChange:w,viewportTriggers:E,annotationProvider:C,onSelectRule:P,...N})=>{var F;const _=t.filter(({location:O})=>u.K.isY(O)),$=g.useRef(null),D=Z.usePrevious(e.length),B=Z.usePrevious(N.hold);return(D===0&&e.length!==0||B===!0&&N.hold===!1)&&((F=$.current)==null||F.reset()),o.jsxRuntimeExports.jsxs(Dl,{...N,children:[_.map((O,M)=>{const y=e.filter(L=>L.axes.x===O.key),k=t.filter(({location:L})=>u.K.isX(L)),b=f==null?void 0:f.filter(L=>[...k.map(({key:A})=>A),O.key].includes(L.axis));return o.jsxRuntimeExports.jsx(rg,{axis:O,index:M,lines:y,yAxes:k,rules:b,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:C,onRuleChange:x,onSelectRule:P},O.key)}),i&&o.jsxRuntimeExports.jsx(Hl,{onLineChange:d,position:l,onPositionChange:c,variant:R}),n&&o.jsxRuntimeExports.jsx(Zl,{value:s,onChange:r,level:a}),o.jsxRuntimeExports.jsxs(rc,{initial:S,onChange:w,triggers:E,ref:$,children:[h&&o.jsxRuntimeExports.jsx(Gl,{}),j&&o.jsxRuntimeExports.jsx(cc,{})]})]})},rg=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:r,onSelectRule:i,onAxisChannelDrop:l,onAxisChange:c,axis:{location:a,key:d,showGrid:x,...p},annotationProvider:m})=>{const f=xe.useDrop({type:"Channel.LinePlot.XAxis",canDrop:ac,onDrop:g.useCallback(({items:S})=>{const R=xe.filterByType(tt,S);return l==null||l(d,R.map(({key:w})=>w)),R},[d,l])}),h=s==null?void 0:s.filter(S=>S.axis===d),j=xe.useDraggingState();return o.jsxRuntimeExports.jsxs(Bl,{...p,...f,location:a,showGrid:x??n===0,className:u.CSS(u.CSS.dropRegion(xe.canDropOfType(tt)(j))),onAutoBoundsChange:S=>c==null?void 0:c({key:d,bounds:S}),children:[e.map((S,R)=>{const w=t.filter(C=>C.axes.y===S.key),E=s==null?void 0:s.filter(C=>C.axis===S.key);return o.jsxRuntimeExports.jsx(lg,{axis:{...S,showGrid:x??(n===0&&R===0)},lines:w,rules:E,onRuleChange:r,onAxisChannelDrop:l,onAxisChange:c,onSelectRule:i},S.key)}),h==null?void 0:h.map(S=>g.createElement(pr,{aetherKey:S.key,...S,key:S.key,onLabelChange:R=>r==null?void 0:r({key:S.key,label:R}),onPositionChange:R=>r==null?void 0:r({key:S.key,position:R}),onUnitsChange:R=>r==null?void 0:r({key:S.key,units:R}),onSelect:()=>i==null?void 0:i(S.key)})),o.jsxRuntimeExports.jsx(ic,{...m})]})},ig=({channels:{x:e,y:t}})=>`${e??0}-${t}`,lg=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:i,location:l,...c},onSelectRule:a})=>{const d=xe.useDrop({type:"Channel.LinePlot.YAxis",canDrop:ac,onDrop:g.useCallback(({items:p})=>{const m=xe.filterByType(tt,p);return s==null||s(i,m.map(({key:f})=>f)),m},[i,s])}),x=xe.useDraggingState();return o.jsxRuntimeExports.jsxs(Ol,{...c,...d,location:l,className:u.CSS(u.CSS.dropRegion(xe.canDropOfType(tt)(x))),onAutoBoundsChange:p=>r==null?void 0:r({key:i,bounds:p}),children:[e.map(p=>o.jsxRuntimeExports.jsx(cg,{line:p},ig(p))),t==null?void 0:t.map(p=>g.createElement(pr,{aetherKey:p.key,...p,key:p.key,onLabelChange:m=>n==null?void 0:n({key:p.key,label:m}),onPositionChange:m=>n==null?void 0:n({key:p.key,position:m}),onUnitsChange:m=>n==null?void 0:n({key:p.key,units:m}),onClick:()=>a==null?void 0:a(p.key)}))]})},cg=({line:e})=>e.variant==="static"?o.jsxRuntimeExports.jsx(ug,{line:e}):o.jsxRuntimeExports.jsx(ag,{line:e}),ag=({line:{key:e,timeSpan:t,channels:{x:n,y:s},axes:r,...i}})=>{const{xTelem:l,yTelem:c}=g.useMemo(()=>{const a=Number(t.valueOf())*3,d=I.streamChannelData({timeSpan:t,channel:s,keepFor:a}),x=n!=null&&n!==0;return{xTelem:I.streamChannelData({timeSpan:t,channel:x?n:s,useIndexOfChannel:!x,keepFor:a}),yTelem:d}},[t.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(ar,{aetherKey:e,y:c,x:l,...i})},ug=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const{xTelem:i,yTelem:l}=g.useMemo(()=>{const c=I.channelData({timeRange:e,channel:s}),a=n!=null&&n!==0;return{xTelem:I.channelData({timeRange:e,channel:a?n:s,useIndexOfChannel:!a}),yTelem:c}},[e.start.valueOf(),e.end.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(ar,{aetherKey:t,y:l,x:i,...r})},ri=[{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"}],ls=({items:e},t)=>{const n=xe.filterByType(tt,e);return n.length>0&&!n.every(s=>t.includes(s.key))},uc=["name","alias"],dc=e=>{const t=Ms();return g.useMemo(()=>e.length===0?ri:ri.filter(n=>e.includes(n.key)),[e,t])},xc=e=>{if(e==null)return o.jsxRuntimeExports.jsx(Z.E4.Channel,{});if(qt.Jg.isCalculated(e))return o.jsxRuntimeExports.jsx(Z.E4.Calculation,{});if(e.isIndex)return o.jsxRuntimeExports.jsx(Z.E4.Index,{});const t=new le.g$1(e.dataType);return t.isInteger?o.jsxRuntimeExports.jsx(Z.E4.Binary,{}):t.isFloat?o.jsxRuntimeExports.jsx(Z.E4.Decimal,{}):t.equals(le.g$1.STRING)?o.jsxRuntimeExports.jsx(Z.E4.String,{}):t.equals(le.g$1.JSON)?o.jsxRuntimeExports.jsx(Z.E4.JSON,{}):o.jsxRuntimeExports.jsx(Z.E4.Channel,{})},dg=({key:e,...t})=>o.jsxRuntimeExports.jsx(dr,{icon:xc(t.entry),...t},e),xg=({columns:e=uc,onChange:t,className:n,value:s,searchOptions:r,...i})=>{const l=Ke(),c=Ms(),a=dc(e),d=nr(),x=Te.useMemoDeepEqualProps(r),p=g.useMemo(()=>l==null?void 0:l.channels.newSearcherWithOptions({rangeKey:d,internal:!1,...x}),[l,d,x]),m=l!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:f,onDragEnd:h,...j}=xe.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(C=>ls(C,_e.A(s)),[s]),onDrop:g.useCallback(({items:C})=>{const P=xe.filterByType(tt,C);if(P.length===0)return[];const N=le.c$1.unique([..._e.A(s),...P.map(_=>_.key)]);return t(N,{clickedIndex:null,clicked:null,entries:[]}),P},[t,s])}),S=xe.useDraggingState(),R=g.useCallback(({dropped:C})=>{t(_e.A(s).filter(P=>!C.some(N=>N.key===P)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),w=g.useCallback((C,P)=>f([{key:P,type:tt}],R),[f,R]),E=g.useCallback(C=>c[C.key]??C.name,[c]);return o.jsxRuntimeExports.jsx(rn,{className:u.CSS(n,u.CSS.dropRegion(ls(S,_e.A(s)))),value:s,onTagDragStart:w,onTagDragEnd:h,searcher:p,onChange:t,columns:a,emptyContent:m,entryRenderKey:E,renderTag:dg,...j,...i})},zt=({columns:e=uc,onChange:t,value:n,className:s,data:r,searchOptions:i,...l})=>{const c=Ke(),a=Ms(),d=dc(e),x=nr(),p=Te.useMemoDeepEqualProps(i),m=g.useMemo(()=>{if(!(r!=null&&r.length>0))return c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:x,internal:!1,...p})},[c,x,r==null?void 0:r.length,p]),f=c!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),j=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:S,onDragEnd:R,...w}=xe.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(N=>ls(N,_e.o(n)),[n]),onDrop:g.useCallback(({items:N})=>{const _=xe.filterByType(tt,N);return _.length===0?[]:(t(_[0].key,{clickedIndex:null,clicked:null,entries:[]}),_)},[j,t])}),E=xe.useDraggingState(),C=g.useCallback(()=>n!=null&&S([{type:tt,key:n}]),[S,n]),P=g.useCallback(N=>a[N.key]??N.name,[a]);return o.jsxRuntimeExports.jsx(dt,{data:r,className:u.CSS(s,u.CSS.dropRegion(ls(E,_e.o(n)))),value:n,onDragStart:C,onDragEnd:R,onChange:t,searcher:m,columns:d,emptyContent:f,entryRenderKey:P,...w,...l})},pg=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Uf,AliasProvider:Tl,LinePlot:og,SelectMultiple:xg,SelectSingle:zt,resolveIcon:xc,useActiveRange:nr,useAlias:Nl,useAliases:Ms,useContext:on,useName:_s},Symbol.toStringTag,{value:"Module"})),wt=({path:e,optional:t=!1,onChange:n})=>{const s=xt(),{get:r,bind:i,set:l,setStatus:c}=s,[a,d]=g.useState(r(e,{optional:t}));g.useEffect(()=>(d(r(e,{optional:t})),i({path:e,onChange:d,listenToChildren:!1})),[e,n,i,r]);const x=g.useCallback(f=>{n==null||n(f,{...s,path:e}),l(e,f)},[e,l,n]),p=g.useCallback(f=>c(e,f),[e,c]);if(a==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let m;return s.mode==="preview"&&(m="preview"),{onChange:x,setStatus:p,variant:m,...a}},pc=(e,t=!1,n)=>{const{get:s,bind:r}=xt(n),[,i]=g.useState(0);return g.useEffect(()=>(i(l=>l+1),r({path:e,onChange:()=>i(l=>l+1)})),[e,r]),s(e,{optional:t})??null},mc=(e,t=!1,n)=>{var l;const{get:s,bind:r}=xt(n),[,i]=g.useState(0);return g.useEffect(()=>(i(c=>c+1),r({path:e,onChange:()=>i(c=>c+1)})),[e,r]),((l=s(e,{optional:t}))==null?void 0:l.value)??null},mg=e=>{var t,n;return((n=(t=pc(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},fg=({path:e,ctx:t,onChange:n})=>{const s=xt(t);g.useEffect(()=>s.bind({path:e,onChange:r=>n(r,s),listenToChildren:!1}),[e,s])},hg=({path:e,optional:t=!1})=>{const{bind:n,get:s}=xt(),[r,i]=g.useState(s(e,{optional:t}));if(g.useEffect(()=>(i(s(e,{optional:t})),n({path:e,onChange:l=>i({...l,value:le.se(l.value)}),listenToChildren:!0})),[e,n,s]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},fc=(e,t)=>({add:(n,s)=>{const r=le.se(e.get(t).value);r.splice(s,0,..._e.A(n)),e.set(t,r,{validateChildren:!1})},push:(n,s)=>{const r=le.se(e.get(t).value);r.push(..._e.A(n)),s!=null&&r.sort(s),e.set(t,r,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,r=new Set(_e.A(n));e.set(t,s.filter((i,l)=>!r.has(l)))},keepOnly:n=>{const s=e.get(t).value,r=new Set(_e.A(n));e.set(t,s.filter((i,l)=>r.has(l)))},set:n=>e.set(t,le.executeSetter(n,e.get(t).value)),sort:n=>{const s=le.se(e.get(t).value);s.sort(n),e.set(t,s)}}),gg=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=xt(n),{bind:r,get:i}=s,[l,c]=g.useState(i(e).value);return g.useEffect(()=>(c(i(e).value),r({path:e,onChange:a=>{c(le.se(a.value))},listenToChildren:t})),[e,r,i,c]),g.useMemo(()=>({value:l,...fc(s,e)}),[l,s,e])},hc=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:()=>{},setCurrentStateAsInitialValues:()=>{}}),xt=e=>{const t=g.use(hc);return e??t},ii=e=>({key:e,variant:"success",message:""}),jg=e=>e.code===ce.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",gc=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r,onHasTouched:i})=>{const l=Z.useInitializerRef(()=>({state:Be.I.copy(e),statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map})),c=Z.useSyncedRef(n),a=Z.useSyncedRef(r),d=Z.useSyncedRef(e),x=Z.useSyncedRef(i),p=Re.useErrorHandler(),m=g.useCallback(()=>{d.current=Be.I.copy(l.current.state),R()},[]),f=g.useCallback(({path:M,onChange:y,listenToChildren:k=!1})=>{var T;const{parentListeners:b,listeners:L}=l.current,A=k?b:L;return A.has(M)||A.set(M,new Set),(T=A.get(M))==null||T.add(y),()=>{var V;return(V=A.get(M))==null?void 0:V.delete(y)}},[]),h=g.useCallback((M,{optional:y}={optional:!1})=>{const{state:k,statuses:b,touched:L}=l.current,A=Be.I.get(k,M,{optional:y});if(A==null)return null;const T={value:A,status:b.get(M)??ii(M),touched:L.has(M),required:!1};if(c.current==null)return T;const V=c.current,H=le.L.getFieldSchema(V,M,{optional:!0});return H==null||(T.required=!H.isOptional()),T},[]),j=g.useCallback(M=>{var L;const{touched:y}=l.current,k=y.size===0;y.add(M);const b=y.size===0;k!==b&&((L=x.current)==null||L.call(x,!b))},[]),S=g.useCallback(M=>{var L;const{touched:y}=l.current,k=y.size===0;y.delete(M);const b=y.size===0;k!==b&&((L=x.current)==null||L.call(x,!b))},[]),R=g.useCallback(()=>{var b;const{touched:M}=l.current,y=M.size===0;M.clear();const k=M.size===0;y!==k&&((b=x.current)==null||b.call(x,!k))},[]),w=g.useCallback(M=>{const{state:y,statuses:k,listeners:b,parentListeners:L}=l.current;Be.I.remove(y,M),k.delete(M),S(M),b.delete(M),L.delete(M)},[]),E=g.useCallback(M=>{const{statuses:y}=l.current;l.current.state=M??Be.I.copy(d.current),P(""),y.clear(),R()},[]),C=g.useCallback(M=>{var b;const{listeners:y}=l.current,k=h(M,{optional:!0});k!=null&&((b=y.get(M))==null||b.forEach(L=>L(k)))},[]),P=g.useCallback(M=>{const{listeners:y,parentListeners:k}=l.current,b=y.get(M);if(M==""&&([...y.keys()].forEach(T=>{var H;const V=h(T,{optional:!0});V!=null&&((H=y.get(T))==null||H.forEach(G=>{G(V)}))}),[...k.keys()].forEach(T=>{var H;const V=h(T,{optional:!0});V!=null&&((H=k.get(T))==null||H.forEach(G=>{G(V)}))})),b!=null){const L=h(M,{optional:!0});L!=null&&b.forEach(A=>{A(L)})}k.forEach((L,A)=>{if(Be.I.pathsMatch(M,A)){const V=h(A,{optional:!0});V!=null&&L.forEach(H=>{H(V)})}})},[]),N=g.useCallback((M,y="",k=!0)=>{const{statuses:b,listeners:L}=l.current;if(M.success){const H=[...b.keys()];return b.clear(),H.forEach(G=>C(G)),!0}let A=!0;const T=new Set(M.error.issues.map(H=>H.path.join(".")));let V=(H,G)=>H===G;return k&&(V=(H,G)=>Be.I.pathsMatch(H,G)),M.error.issues.forEach(H=>{var se;const{message:G}=H,ee=H.path.join(".");if(!V(ee,y))return;const te=jg(H);te!=="warning"&&(A=!1),b.set(ee,{key:ee,variant:te,message:G}),j(ee);let ne=h(ee,{optional:!0});ne??(ne={value:void 0,status:b.get(ee)??ii(ee),touched:!1,required:!1}),(se=L.get(ee))==null||se.forEach(J=>J(ne))}),b.forEach((H,G)=>{T.has(G)||(b.delete(G),C(G))}),A},[]),_=g.useCallback((M,y)=>{if(c.current==null)return!0;const{state:k}=l.current,b=c.current.safeParse(k);return N(b,M,y)},[N]),$=g.useCallback(async(M,y)=>{if(c.current==null)return!0;const{state:k}=l.current,b=await c.current.safeParseAsync(k);return N(b,M,y)},[N]),D=g.useCallback((M,y,k={})=>{const b=Be.I.get(l.current.state,M,{optional:!0}),{validateChildren:L=!0}=k,{state:A}=l.current,T=Be.I.get(d.current,M,{optional:!0});Be.I.equal(T,y)?S(M):j(M),M.length===0?l.current.state=y:Be.I.set(A,M,y),P(M),p(async()=>{var G;let H;try{H=_(M,L)}catch{H=await $(M,L)}(G=a.current)==null||G.call(a,{values:l.current.state,path:M,prev:b,valid:H})},"Failed to validate form")},[]),B=g.useCallback(M=>Be.I.has(l.current.state,M),[]),F=g.useCallback((M,y)=>{l.current.statuses.set(M,y),j(M),C(M)},[]),O=g.useCallback(()=>{const{statuses:M}=l.current;M.clear(),M.forEach((y,k)=>C(k))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:M}=l.current;l.current.state=e,M.forEach((y,k)=>{const b=h(k,{optional:!0});b!=null&&y.forEach(L=>L(b))})},[t,e]),g.useMemo(()=>({bind:f,set:D,get:h,mode:s,validate:_,validateAsync:$,value:()=>l.current.state,has:B,remove:w,setStatus:F,clearStatuses:O,reset:E,setCurrentStateAsInitialValues:m}),[f,D,h,_,$,B,w,F,O,E,s,m])},Eg=({children:e,...t})=>o.jsxRuntimeExports.jsx(hc,{value:t,children:e}),yg=he.componentRenderProp(ut.Text),Ce=({path:e,children:t=yg,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:i=!1,optional:l,onChange:c,className:a,...d})=>{const x=wt({path:e,optional:l??i,onChange:c}),p=xt();if(x==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??(n=u.d.capitalize(Be.I.element(e,-1))),r=typeof r=="function"?r(x,p):r,!r)return null;const m=x.status.message,{onChange:f,value:h}=x,j={onChange:f,value:h};return x.variant!=null&&(j.variant=x.variant),o.jsxRuntimeExports.jsx(je.Item,{padHelpText:s,helpText:m,helpTextVariant:x.status.variant,label:n,required:x.required,className:u.CSS(a,u.CSS.BE("field",e.split(".").join("-")),u.CSS.M(x.status.variant)),...d,children:t(j)})},vt=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:i,path:l,fieldKey:c=t,...a})=>o.jsxRuntimeExports.jsx(Ce,{...n,...a,path:c?`${l}.${c}`:l,children:d=>o.jsxRuntimeExports.jsx(e,{...d,...s,...i})});return r.displayName=e.displayName,r},jc=vt(je.Numeric),Xt=jc({}),Ec=vt(ut.Text),mr=Ec({}),yc=vt(Q.Switch$1),Ts=yc({}),Sg=vt(dt),Rg=vt(rn),Cg=vt(Ps),bg=vt(ot),fr=({key:e,open:t,onChange:n})=>{const s=Te.useMemoPrimitiveArray(e);Q.useAsyncEffect(async()=>{if(t==null)return;const r=await t();if(r==null)return;const i=r.onChange(n);return async()=>{i(),await r.close()}},[t==null,s])},wg=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return Q.useAsyncEffect(async()=>{s(await e())},[e]),fr({...t,onChange:s}),n},vg=Object.freeze(Object.defineProperty({__proto__:null,useListener:fr,useState:wg},Symbol.toStringTag,{value:"Module"})),kg=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:i,applyObservable:l,...c})=>{const a=Ke(),d=Re.useErrorHandler(),x=Te.useMemoPrimitiveArray(e),p=gc({values:s,...c,sync:!1,onChange:h=>{a!=null&&d(async()=>{await(i==null?void 0:i({...h,client:a}))},`Failed to apply changes for ${t}`)}});Q.useAsyncEffect(async()=>{if(a!=null)try{const h=await n({client:a});p.set("",h)}catch(h){d(h,`Failed to retrieve ${t}`)}},[x,a==null?void 0:a.key]);const m=g.useCallback(async()=>{if(a!=null)return await(r==null?void 0:r(a))},[x,a==null?void 0:a.key]),f=g.useCallback(h=>l==null?void 0:l({changes:h,ctx:p}),[x,l]);return fr({key:x,open:m,onChange:f}),p},Mg=Object.freeze(Object.defineProperty({__proto__:null,Field:Ce,Form:Eg,NumericField:Xt,SwitchField:Ts,TextField:mr,buildButtonSelectField:bg,buildDropdownButtonSelectField:Cg,buildNumericField:jc,buildSelectMultiField:Rg,buildSelectSingleField:Sg,buildSwitchField:yc,buildTextField:Ec,fieldArrayUtils:fc,fieldBuilder:vt,use:gc,useChildFieldValues:hg,useContext:xt,useField:wt,useFieldArray:gg,useFieldListener:fg,useFieldState:pc,useFieldValid:mg,useFieldValue:mc,useSynced:kg},Symbol.toStringTag,{value:"Module"})),_g=[{key:"name",name:"Name"},{key:"location",name:"Location",render:({entry:e})=>o.jsxRuntimeExports.jsx(wl,{level:"small",shade:7,weight:500,style:{marginTop:"0.25rem"},children:e.location})}],Pg=({searchOptions:e,...t})=>{const n=Ke();let s=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(s=n.hardware.devices.newSearcherWithOptions(e)),o.jsxRuntimeExports.jsx(dt,{columns:_g,searcher:s,entryRenderKey:"name",...t})},Lg=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Pg},Symbol.toStringTag,{value:"Module"})),Ng=[{key:"name",name:"Name"},{key:"location",name:"Location"}],Tg=e=>{const t=Ke();return o.jsxRuntimeExports.jsx(dt,{columns:Ng,searcher:t==null?void 0:t.hardware.racks,entryRenderKey:"name",...e})},Ag=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Tg},Symbol.toStringTag,{value:"Module"})),Ut="label",hr=[{key:"color",name:"Color",render:({entry:e})=>o.jsxRuntimeExports.jsx(Z.E4.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],cs=({items:e},t)=>{const n=xe.filterByType(Ut,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Ig=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...r})=>o.jsxRuntimeExports.jsx(Rn,{color:e==null?void 0:e.color,...r,children:e==null?void 0:e.name}),zg=he.componentRenderProp(Ig),$g=({onChange:e,className:t,value:n,...s})=>{const r=Ke(),i=r!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=xe.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(m=>cs(m,_e.A(n)),[n]),onDrop:g.useCallback(({items:m})=>{const f=xe.filterByType(Ut,m);if(f.length===0)return[];const h=le.c$1.unique([..._e.A(n),...f.map(j=>j.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),d=xe.useDraggingState(),x=g.useCallback(({dropped:m})=>{e(_e.A(n).filter(f=>!m.some(h=>h.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=g.useCallback((m,f)=>l([{key:f,type:Ut}],x),[l,x]);return o.jsxRuntimeExports.jsx(rn,{className:u.CSS(t,u.CSS.dropRegion(cs(d,_e.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.labels,onChange:e,columns:hr,emptyContent:i,renderTag:zg,addPlaceholder:"Label",...a,...s})},Sc=({value:e,onChange:t})=>{const n=Ke(),s=n!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=g.useId(),i=g.useMemo(()=>({key:r,type:"Label.SelectMultiple"}),[r]),l=xe.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(d=>cs(d,_e.o(e)),[e]),onDrop:g.useCallback(({items:d})=>{const x=xe.filterByType(Ut,d);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[i,t])}),c=xe.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:Ut,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},Dg=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:i,...l}=Sc({value:t,onChange:e});return o.jsxRuntimeExports.jsx(dt,{data:s,className:u.CSS(n,u.CSS.dropRegion(cs(i,_e.o(t)))),value:t,onChange:e,columns:hr,entryRenderKey:"name",...l,...r})},Bg=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...i}=Sc({value:t,onChange:n});return o.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:hr,entryRenderKey:"name",...i,...s})},Og=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Ut,SelectButton:Bg,SelectMultiple:$g,SelectSingle:Dg},Symbol.toStringTag,{value:"Module"})),Rc=({children:e,centered:t,visible:n,enabled:s=!0,close:r,style:i,...l})=>{const c=g.useRef(null),a=g.useRef(n);Sl.useClickOutside({ref:c,exclude:x=>Ye.findParent(x.target,m=>m.getAttribute("role")==="dialog")!=null,onClickOutside:r});const d=g.useCallback(x=>{var m;if(!a.current||x.stage!=="start")return;const p=(m=c.current)==null?void 0:m.querySelectorAll(`.${u.CSS.visible(!0)}`);p&&p.length>0||r()},[r]);return Ie.use({triggers:[["Escape"]],callback:d,loose:!0}),o.jsxRuntimeExports.jsx(oe.Space,{className:u.CSS(u.CSS.BE("modal","bg"),u.CSS.visible(n),s&&u.CSS.M("enabled-modal")),empty:!0,align:"center",children:o.jsxRuntimeExports.jsx(oe.Space,{className:u.CSS(u.CSS.BE("modal","dialog"),t&&u.CSS.M("centered")),role:"dialog",empty:!0,ref:c,...l,style:{zIndex:s?11:void 0,...i},children:o.jsxRuntimeExports.jsx(oe.Space,{className:u.CSS(u.CSS.BE("modal","content")),empty:!0,children:e})})})},Vg=({root:e,...t})=>Xo.createPortal(o.jsxRuntimeExports.jsx(Rc,{...t}),Ye.getRootElement(e)),Fg=Object.freeze(Object.defineProperty({__proto__:null,Dialog:Rc,Modal:Vg},Symbol.toStringTag,{value:"Module"})),As=new Error("Tab not found"),Hg=new Error("Invalid Mosaic"),as=(e,t,n="center",s)=>{var p;if(e=pt(e),s===void 0)return Mo(e,t);const r=_o(e,s);if(n==="center")return(p=r.tabs)==null||p.push(t),r.selected=t.tabKey,e;const i=r.key*2,l=r.key*2+1,c=n==="top"||n==="left"?i:l;if(_o(e,c).key!==r.key)return as(e,t,"center",c);if(r.tabs==null||r.tabs.length===0)return as(e,t,"center",s);const[a,d,x]=qg(n);if(r.direction=x,r[a]={key:0,tabs:[t],selected:t.tabKey},r[d]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw Hg;return r.first.key=i,r.last.key=l,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},Zg=(e,t,n)=>{var i;e=pt(e);const[s,r]=$t(e,t);if(s==null||r==null)throw As;return r.tabs=(i=r.tabs)==null?void 0:i.map(l=>l.tabKey===t?n(l):l),e},Mo=(e,t)=>(e=pt(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=Mo(e.first,t):e.last!=null&&(e.last=Mo(e.last,t)),e)),us=e=>{e=pt(e);const t=[];if(e.tabs!=null&&(e.selected=Ne.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=us(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=us(e.last);e.last=n,t.push(...s)}return[e,t]},gr=(e,t)=>{var r;e=pt(e);const[,n]=$t(e,t);if(n==null)return[e,null];n.tabs=(r=n.tabs)==null?void 0:r.filter(i=>i.tabKey!==t),n.selected=Ne.resetSelection(n.selected,n.tabs),e=Kg(e);const s=n.selected??ds(e);return[e,s]},ds=e=>e.selected!=null?e.selected:e.first!=null?ds(e.first):e.last!=null?ds(e.last):null,Cc=(e,t)=>{e=pt(e);const[n,s]=$t(e,t);if(n==null||s==null)throw As;return s.selected=t,e},bc=(e,t,n,s)=>{e=pt(e);const[r,i]=$t(e,t);if(r==null||i==null)throw As;const[l,c]=gr(e,t);return[as(l,r,n,s),c]},Cn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=Cn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=Cn(e.last,t);if(n!=null)return n}},wc=(e,t,n)=>{const s=xs(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},Gg=(e,t,n)=>{e=pt(e);const s=Cn(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 r=s.tabs.findIndex(x=>x.tabKey===t);if(r===-1)throw new Error("Tab not found in node");const i=s.tabs[r];s.tabs=s.tabs.filter(x=>x.tabKey!==t);const l=s.key*2,a={key:s.key*2+1,tabs:[i],selected:i.tabKey},d={key:l,tabs:s.tabs,selected:s.selected};return d.selected=Ne.resetSelection(d.selected,d.tabs),s.direction=n,s.first=d,s.last=a,s.tabs=void 0,s.selected=void 0,e},Yg=(e,t)=>{const n=Cn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},vc=(e,t,n)=>{e=pt(e);const[,s]=$t(e,t);if((s==null?void 0:s.tabs)==null)throw As;return s.tabs=Ne.rename(t,n,(s==null?void 0:s.tabs)??[]),e},Wg=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,_o=(e,t)=>{const n=xs(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:_o(e,s)},Kg=e=>{let t=!0;for(;t;)[e,t]=Po(e);return e.first==null&&e.last==null&&(e.key=1),e},Po=e=>{if(e.first==null||e.last==null)return[e,!1];if(ci(e.first))return[li(e.last,!0),!0];if(ci(e.last))return[li(e.first,!1),!0];let t,n;return[e.first,t]=Po(e.first),[e.last,n]=Po(e.last),[e,t||n]},li=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),ci=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),$t=(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]=$t(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,i]=$t(e.last,t);return[r,i]},xs=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=xs(e.first,t);return n??xs(e.last,t)},qg=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")}},pt=e=>Be.I.copy(e),ps=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&ps(e.first,t,n),e.last!=null&&ps(e.last,t,n),n),Lo=(e,t)=>{t(e),e.first!=null&&Lo(e.first,t),e.last!=null&&Lo(e.last,t)};class kc{constructor(t={}){et(this,"parent");et(this,"stub");et(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 Xg=({node:e})=>{const t=g.createRef(),n=g.useRef(e);return g.useEffect(()=>{const s=t.current;if(s==null)return;const r=s.parentNode;if(r!=null)return e.mount(r,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 r=s.parentNode;r!=null&&e.mount(r,s)},[e]),o.jsxRuntimeExports.jsx("div",{ref:t})},Mc=({node:e,children:t})=>Xo.createPortal(t,e.el),Ug=Object.freeze(Object.defineProperty({__proto__:null,In:Mc,Node:kc,Out:Xg},Symbol.toStringTag,{value:"Module"})),ms=g.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:s,direction:r,first:i,last:l,key:c,size:a},emptyContent:d,...x}=n,p=g.useCallback(([h])=>t(c,h),[t]),{props:m}=Qo({direction:r,onResize:p,count:2,initialSizes:a!=null?[a]:void 0});let f;return s!==void 0?f=o.jsxRuntimeExports.jsx(_c,{emptyContent:d,...n}):i!=null&&l!=null?f=o.jsxRuntimeExports.jsxs(er,{id:`mosaic-${c}`,align:"stretch",className:u.CSS.BE("mosaic","resize"),...m,children:[o.jsxRuntimeExports.jsx(ms,{...x,root:i,onResize:t},i.key),o.jsxRuntimeExports.jsx(ms,{...x,root:l,onResize:t},l.key)]}):(f=null,console.warn("Mosaic tree is malformed")),c===1?o.jsxRuntimeExports.jsx(xe.Provider,{children:f}):f});ms.displayName="Mosaic";const fs="pluto-mosaic-tab-drop",jr="pluto-mosaic-tab-create",Jg=(e,t,n)=>{if(xe.filterByType(xe.FILE_TYPE,t).length>0&&n)return!0;const r=xe.filterByType(fs,t).map(c=>c.key),i=e.filter(c=>!r.includes(c.tabKey)).length>0;return xe.filterByType(jr,t).length>0||r.length>0&&(i||e.length===0)},_c=g.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:r,onFileDrop:i,...l})=>{const{key:c,tabs:a}=e,[d,x]=g.useState(null),p=i!=null,m=g.useCallback(({items:P})=>Jg(a,P,p),[a,p]),f=g.useCallback(({items:P,event:N})=>{if(N==null)return[];x(null);const _=xe.filterByType(xe.FILE_TYPE,P).length>0,$=a.length===0?"center":ui(ai(N));if(_)return i==null||i(c,$,N),P;const D=xe.filterByType(fs,P);if(D.length>0){const F=D.map(({key:O})=>O)[0];t(c,F,$)}const B=xe.filterByType(jr,P);if(B.length>0){const F=B.map(({key:O})=>O);n==null||n(c,$,F)}return D},[t,a.length]),h=g.useCallback(({event:P})=>{if(P==null)return;const N=a.length===0?"center":ui(ai(P));x(N)},[a.length]),{startDrag:j,...S}=xe.useDragAndDrop({type:"Mosaic",canDrop:m,onDrop:f,onDragOver:h}),R=m(xe.useDraggingState()),w=g.useCallback(()=>x(null),[]),E=g.useCallback((P,{tabKey:N})=>{j([{key:N,type:fs,elementID:P.currentTarget.id}])},[j]),C=g.useCallback(()=>n==null?void 0:n(c,"center"),[c]);return o.jsxRuntimeExports.jsxs("div",{id:`mosaic-${c}`,className:u.CSS.BE("mosaic","leaf"),children:[o.jsxRuntimeExports.jsxs(Ne.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:w,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:E,onCreate:C,...l,...S,children:[e.selected!=null&&r(a.find(P=>P.tabKey===e.selected)),R&&o.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),d!=null&&o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("mosaic","mask"),style:Qg[d]})]})});_c.displayName="MosaicTabLeaf";const Qg={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%"}},ai=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}},e1=e=>e,t1=e=>1-e,ui=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[e1(e),t1(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")},n1=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),r=new Set,i=ps(e,l=>{var c;return(c=l.tabs)==null?void 0:c.map(a=>{let d=s.current.get(a.tabKey);return a==null?null:(d==null&&(d=new kc({style:"width: 100%; height: 100%; position: relative;"}),d.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,d)),r.add(a.tabKey),o.jsxRuntimeExports.jsx(Mc,{node:d,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})}).flat().filter(l=>l!=null);return s.current.forEach((l,c)=>!r.has(c)&&s.current.delete(c)),[s,i]},s1=ce.z.object({key:ce.z.number(),tabs:ce.z.array(Ne.tabZ).optional(),selected:ce.z.string().optional(),direction:u.g.direction.optional(),size:ce.z.number().optional()}),No=s1.extend({first:ce.z.lazy(()=>No).optional(),last:ce.z.lazy(()=>No).optional()}),o1=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(us(t)[0]),[t]),{root:n,onDrop:(d,x,p)=>s(m=>bc(m,x,p,d)[0]),onClose:d=>s(x=>gr(x,d)[0]),onSelect:d=>s(x=>Cc(x,d)),onResize:(d,x)=>s(p=>wc(p,d,x)),onRename:e?(d,x)=>s(p=>vc(p,d,x)):void 0}},r1=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:jr,HAUL_DROP_TYPE:fs,Mosaic:ms,autoSelectTabs:us,canSplit:Yg,findSelected:ds,findTabNode:Cn,forEachNode:Lo,insertTab:as,isEmpty:Wg,mapNodes:ps,moveTab:bc,nodeZ:No,removeTab:gr,renameTab:vc,resizeNode:wc,selectTab:Cc,split:Gg,updateTab:Zg,use:o1,usePortal:n1},Symbol.toStringTag,{value:"Module"})),i1=({variant:e,className:t,...n})=>o.jsxRuntimeExports.jsx(oe.Space,{className:u.CSS(t,u.CSS.B("note"),u.CSS.M(e)),align:"stretch",empty:!0,...n}),l1=Object.freeze(Object.defineProperty({__proto__:null,Note:i1},Symbol.toStringTag,{value:"Module"})),uo={Close:o.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:o.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:o.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.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"}),o.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"})]})},c1=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:i,onClose:l,...c})=>o.jsxRuntimeExports.jsxs(oe.Space,{size:1.5,direction:"x",className:u.CSS(u.CSS.B("macos-controls"),!n&&u.CSS.BM("macos-controls","blurred"),t),...c,children:[o.jsxRuntimeExports.jsx(xo,{onClick:l,className:u.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:uo.Close}),o.jsxRuntimeExports.jsx(xo,{onClick:s,className:u.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:uo.Minimize}),o.jsxRuntimeExports.jsx(xo,{onClick:i,className:u.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:uo.Maximize})]}),xo=({className:e,disabled:t,color:n,...s})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("macos-control"),u.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),a1=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:i,...l})=>o.jsxRuntimeExports.jsxs(ks.Pack,{...l,children:[o.jsxRuntimeExports.jsx(po,{className:u.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:o.jsxRuntimeExports.jsx(Z.E4.Subtract,{})}),o.jsxRuntimeExports.jsx(po,{className:u.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:o.jsxRuntimeExports.jsx(Z.E4.Box,{})}),o.jsxRuntimeExports.jsx(po,{onClick:s,className:u.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:o.jsxRuntimeExports.jsx(Z.E4.Close,{})})]}),po=({disabled:e=!1,className:t,...n})=>e?null:o.jsxRuntimeExports.jsx(he.Icon,{className:u.CSS(u.CSS.B("windows-control"),t),tabIndex:-1,...n}),Pc=le.S.getOS,u1="Windows",d1=({forceOS:e,visibleIfOS:t,...n})=>{const s=Pc({force:e,default:u1});if(t!=null&&t!==s)return null;const r=s==="macOS"?c1:a1;return o.jsxRuntimeExports.jsx(r,{...n})},x1=Object.freeze(Object.defineProperty({__proto__:null,Controls:d1,use:Pc},Symbol.toStringTag,{value:"Module"})),p1=(e,t)=>{const n=s=>o.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},m1=Object.freeze(Object.defineProperty({__proto__:null,createComponent:p1},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:qt.B.NOOP});const f1=({children:e,...t})=>{const{path:n}=Q.useUnidirectional({type:I.Provider$2.TYPE,schema:I.providerStateZ$1,state:t});return o.jsxRuntimeExports.jsx(Q.Composite,{path:n,children:e})},h1="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjUgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Lc=({children:e})=>{const[{path:t}]=Q.use$1({type:I.BaseProvider.TYPE,schema:I.providerStateZ$2,initialState:{}});return o.jsxRuntimeExports.jsx(Q.Composite,{path:t,children:e})},g1=Object.freeze(Object.defineProperty({__proto__:null,Provider:Lc},Symbol.toStringTag,{value:"Module"})),j1=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:I.AcquireChannelControl,AuthoritySource:I.AuthoritySource,Chip:I.Chip,Controller:I.Controller$1,Indicator:I.Indicator,Legend:I.Legend,REGISTRY:I.REGISTRY$15,STATUSES:I.STATUSES,SetChannelValue:I.SetChannelValue,StateProvider:I.StateProvider,acquireChannelControl:I.acquireChannelControl,acquireChannelControlPropsZ:I.acquireChannelControlPropsZ,authoritySource:I.authoritySource,authoritySourceProps:I.authoritySourceProps,chipStateZ:I.chipStateZ,controllerStateZ:I.controllerStateZ,indicatorStateZ:I.indicatorStateZ,legendStateZ:I.legendStateZ,setChannelValue:I.setChannelValue,setChannelValuePropsZ:I.setChannelValuePropsZ,stateProviderStateZ:I.stateProviderStateZ,statusZ:I.statusZ,sugaredStateZ:I.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),E1=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)===qt.im.Authority.ABSOLUTE?{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)"}}},Nc=({source:e,sink:t,className:n,...s})=>{const r=Te.useMemoDeepEqualProps({source:e,sink:t}),[,{status:i},l]=Q.use$1({type:I.Chip.TYPE,schema:I.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:le.m.now()}}});g.useEffect(()=>{l(m=>({...m,...r}))},[r,l]);const c=g.useCallback(()=>l(m=>({...m,triggered:!m.triggered})),[l]),{message:a,chipColor:d,buttonStyle:x,disabled:p}=E1(i);return o.jsxRuntimeExports.jsx(he.Icon,{variant:"text",className:u.CSS(u.CSS.B("control-chip"),n),disabled:p,onClick:c,tooltip:o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:a}),style:x,...s,children:o.jsxRuntimeExports.jsx(Z.E4.Circle,{color:d})})},Tc=g.createContext({needsControlOf:[]}),Ac=()=>g.use(Tc),y1=({children:e,onStatusChange:t,...n})=>{const s=Te.useMemoDeepEqualProps(n),[{path:r},{status:i,needsControlOf:l},c]=Q.use$1({type:I.Controller$1.TYPE,schema:I.controllerStateZ,initialState:s});return g.useEffect(()=>{i!=null&&(t==null||t(i))},[i,t]),g.useEffect(()=>{c(a=>({...a,...s}))},[s,c]),g.useEffect(()=>()=>t==null?void 0:t("released"),[]),o.jsxRuntimeExports.jsxs(Tc,{value:{needsControlOf:l},children:[o.jsxRuntimeExports.jsx(Q.Composite,{path:r,children:e}),";"]})},Ic=({colorSource:e,statusSource:t})=>{var c;const n=Te.useMemoDeepEqualProps({colorSource:e,statusSource:t}),[,{color:s,status:r},i]=Q.use$1({type:I.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:le.m.now()}},schema:I.indicatorStateZ});g.useEffect(()=>{i(a=>({...a,...n}))},[n,i]);let l;return((c=r.data)==null?void 0:c.color)!=null?l=u.Color.z.parse(r.data.color):s!=null&&!s.isZero?l=s:l="var(--pluto-gray-l8)",o.jsxRuntimeExports.jsxs(he.Dialog,{location:{x:"center",y:"bottom"},children:[o.jsxRuntimeExports.jsx(Z.Text,{level:"p",children:r.message}),o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("indicator"),style:{backgroundColor:u.cssString(l),flexGrow:1}})]})},S1=e=>{const{needsControlOf:t}=Ac(),[,{states:n},s]=Q.use$1({type:I.Legend.TYPE,schema:I.legendStateZ,initialState:{states:[],needsControlOf:t}});g.useEffect(()=>{s(l=>({...l,needsControlOf:t}))},[t]);const i=le.c$1.unique(n.map(l=>l.subject.key)).map(l=>{const c=n.find(a=>a.subject.key===l);if(c==null)throw new qt.Me("Legend subject not found");return{key:c.subject.key,label:c.subject.name,color:c.subjectColor}});return o.jsxRuntimeExports.jsx(ir,{data:i,...e})},zc=({children:e})=>{const[{path:t}]=Q.use$1({type:I.StateProvider.TYPE,schema:I.stateProviderStateZ,initialState:{}});return o.jsxRuntimeExports.jsx(Q.Composite,{path:t,children:e})},R1=Object.freeze(Object.defineProperty({__proto__:null,Chip:Nc,Controller:y1,Indicator:Ic,Legend:S1,StateProvider:zc,useContext:Ac},Symbol.toStringTag,{value:"Module"})),$c=e=>{const t=({disabled:n=!1,...s})=>n?s.children:o.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},C1=$c(Lc),b1=$c(Q.Provider$2),w1=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:r,tooltip:i,triggers:l,alamos:c,haul:a,channelAlias:d,telem:x,color:p})=>o.jsxRuntimeExports.jsx(Ie.Provider,{...l,children:o.jsxRuntimeExports.jsx(he.Config,{...i,children:o.jsxRuntimeExports.jsx(xe.Provider,{...a,children:o.jsxRuntimeExports.jsx(Q.Provider$1,{url:s??h1,enabled:n,children:o.jsxRuntimeExports.jsx(b1,{workerKey:"vis",children:o.jsxRuntimeExports.jsx(f1,{...c,children:o.jsxRuntimeExports.jsx(Re.Aggregator,{children:o.jsxRuntimeExports.jsx(Pl,{connParams:t,children:o.jsxRuntimeExports.jsx(Tl,{...d,children:o.jsxRuntimeExports.jsx(We.Provider,{...p,children:o.jsxRuntimeExports.jsx(Q.Provider,{...r,children:o.jsxRuntimeExports.jsx(C1,{...x,children:o.jsxRuntimeExports.jsx(zc,{children:e})})})})})})})})})})})})}),v1=Object.freeze(Object.defineProperty({__proto__:null,Provider:w1},Symbol.toStringTag,{value:"Module"})),k1=({value:e})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress"),children:o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress-bar"),style:{width:`${e}%`}})}),M1=Object.freeze(Object.defineProperty({__proto__:null,Progress:k1},Symbol.toStringTag,{value:"Module"})),bn="range",Er=[{key:"name",name:"Name"}],hs=({items:e},t)=>{const n=xe.filterByType(bn,e);return n.length>0&&!n.every(s=>t.includes(s.key))},_1=({onChange:e,className:t,value:n,...s})=>{const r=Ke(),i=r!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=xe.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(m=>hs(m,_e.A(n)),[n]),onDrop:g.useCallback(({items:m})=>{const f=xe.filterByType(bn,m);if(f.length===0)return[];const h=le.c$1.unique([..._e.A(n),...f.map(j=>j.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),d=xe.useDraggingState(),x=g.useCallback(({dropped:m})=>{e(_e.A(n).filter(f=>!m.some(h=>h.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=g.useCallback((m,f)=>l([{key:f,type:bn}],x),[l,x]);return o.jsxRuntimeExports.jsx(rn,{className:u.CSS(t,u.CSS.dropRegion(hs(d,_e.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.ranges,onChange:e,columns:Er,emptyContent:i,entryRenderKey:"name",...a,...s})},Dc=({value:e,onChange:t})=>{const n=Ke(),s=n!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=g.useId(),i=g.useMemo(()=>({key:r,type:"Ranger.SelectMultiple"}),[r]),{startDrag:l,...c}=xe.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(x=>hs(x,_e.o(e)),[e]),onDrop:g.useCallback(({items:x})=>{const p=xe.filterByType(bn,x);return p.length===0?[]:(t(p[0].key,{clickedIndex:null,clicked:null,entries:[]}),p)},[i,t])}),a=xe.useDraggingState(),d=g.useCallback(()=>e!=null&&l([{type:bn,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:d,searcher:n==null?void 0:n.ranges}},P1=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:i,...l}=Dc({value:t,onChange:e});return o.jsxRuntimeExports.jsx(dt,{data:s,className:u.CSS(n,u.CSS.dropRegion(hs(i,_e.o(t)))),value:t,onChange:e,columns:Er,entryRenderKey:"name",...l,...r})},L1=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...i}=Dc({value:t,onChange:n});return o.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:Er,entryRenderKey:"name",...i,...s})},N1=[{key:"color",name:"Color",width:50,render:e=>o.jsxRuntimeExports.jsx(Z.E4.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],T1=e=>{const t=Ke();return o.jsxRuntimeExports.jsx(rn,{...e,searcher:t==null?void 0:t.labels,columns:N1,renderTag:n=>n.entry==null?o.jsxRuntimeExports.jsx(Rn,{color:"gray",children:n.entryKey}):o.jsxRuntimeExports.jsx(Rn,{color:n.entry.color,children:n.entry.name})})},A1=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...r})=>{const i=new le.m(e.start),l=i.isToday?"time":"dateTime",c=new le.m(e.end),a=c.equals(le.m.MAX),d=c.span(i)<le.y$1.DAY?"time":"dateTime",x=i.span(c);return o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",size:"small",className:u.CSS(u.CSS.B("time-range-chip")),align:"center",...r,children:[i.isToday&&o.jsxRuntimeExports.jsx(Z.Text,{level:t,shade:n,weight:450,children:"Today"}),o.jsxRuntimeExports.jsx(wo.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:i}),o.jsxRuntimeExports.jsx(Z.E4.Arrow.Right,{color:"var(--pluto-text-color)"}),a?o.jsxRuntimeExports.jsx(Z.Text,{level:t,children:"Now"}):o.jsxRuntimeExports.jsx(wo.DateTime,{level:t,displayTZ:"local",format:d,shade:n,weight:450,children:c}),!x.isZero&&s&&o.jsxRuntimeExports.jsxs(Z.Text,{level:t,shade:n,weight:450,children:["(",i.span(c).truncate(le.y$1.MILLISECOND).toString(),")"]})]})},I1=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:L1,SelectLabels:T1,SelectMultiple:_1,SelectSingle:P1,TimeRangeChip:A1},Symbol.toStringTag,{value:"Module"})),z1=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(i=>i.key===t);return o.jsxRuntimeExports.jsx(oe.Space,{direction:"x",align:"center",className:u.CSS.B("steps"),...s,children:e.map((i,l)=>o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsxs(he.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>r,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&o.jsxRuntimeExports.jsx(Z.E4.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},$1=Object.freeze(Object.defineProperty({__proto__:null,Steps:z1},Symbol.toStringTag,{value:"Module"})),D1=({children:e,className:t,visible:n,...s})=>{const[{path:r},,i]=Q.use$1({type:I.Table.TYPE,schema:I.Table.stateZ,initialState:{region:u.Mo.ZERO,visible:n}});g.useEffect(()=>{i(c=>({...c,visible:n}))},[n]);const l=Tn(c=>i(a=>({...a,region:c})));return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{ref:l,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),o.jsxRuntimeExports.jsx("table",{className:u.CSS(u.CSS.B("table"),t),...s,children:o.jsxRuntimeExports.jsx("tbody",{children:o.jsxRuntimeExports.jsx(Q.Composite,{path:r,children:e})})})]})},B1=({children:e,className:t,size:n,index:s,onResize:r,onSelect:i,position:l,...c})=>o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),t),...c,children:[r!=null&&o.jsxRuntimeExports.jsx(Oc,{onSelect:i,index:s,value:n,onChange:r,position:l,direction:"y"}),e]}),yr=({ref:e,children:t,className:n,selected:s=!1,...r})=>o.jsxRuntimeExports.jsx("td",{ref:e,...r,className:u.CSS(u.CSS.BE("table","cell"),u.CSS.selected(s),n),children:t}),Bc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",O1=e=>Bc[e],Oc=({value:e,selected:t=!1,index:n,onChange:s,position:r,direction:i="x",onSelect:l})=>{const c=Z.useSyncedRef(e),a=g.useRef(e),d=We.useCursorDrag({onStart:g.useCallback(()=>{a.current=c.current},[]),onMove:g.useCallback(x=>s(a.current+u.Mo.dim(x,i,!0),n),[s,n])});return o.jsxRuntimeExports.jsxs("td",{id:`resizer-${i}-${n}`,className:u.CSS(u.CSS.BE("table","resizer"),u.CSS.dir(i),u.CSS.selected(t),Ct.CONTEXT_TARGET,t&&Ct.CONTEXT_SELECTED),style:{[u.g.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[o.jsxRuntimeExports.jsx(Z.Text,{level:"p",shade:7,style:{width:"100%",textAlign:"center"},children:i==="x"?Bc[n]:n+1}),o.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[u.g.location(i)]:r+e},onDragStart:d,draggable:!0})]})},V1=({selected:e,onSelect:t,columns:n,onResize:s})=>{let r=15;return o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),u.CSS.BE("table","col-resizer")),children:[o.jsxRuntimeExports.jsx("td",{}),n.map((i,l)=>{const c=r;return r+=i,o.jsxRuntimeExports.jsx(Oc,{onSelect:t,position:c,selected:e.includes(l),index:l,value:i,onChange:a=>s(a,l),direction:"x"},l)})]})},F1=Object.freeze(Object.defineProperty({__proto__:null,Cell:yr,ColumnIndicators:V1,Row:B1,Table:D1,getCellColumn:O1},Symbol.toStringTag,{value:"Module"})),H1=[{key:"standard",name:"Standard"},{key:"scientific",name:"Scientific"},{key:"engineering",name:"Engineering"}],Z1=e=>o.jsxRuntimeExports.jsx(ot,{...e,entryRenderKey:"name",data:H1}),Vc=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Sr=({path:e})=>{var f;const{value:t,onChange:n}=wt({path:e}),s=I.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),r=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=I.stringifyNumberProps.parse(s.segments.stringifier.props),l=I.rollingAverageProps.parse(s.segments.rollingAverage.props),c=h=>{const j=I.sourcePipeline("string",{connections:Vc,segments:{valueStream:I.streamChannelValue({channel:r.channel}),stringifier:I.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:I.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:j})},a=h=>c({valueStream:I.streamChannelValue({channel:h??0})}),d=h=>c({stringifier:I.stringifyNumber({...i,notation:h})}),x=h=>c({stringifier:I.stringifyNumber({...i,precision:h})}),p=h=>c({rollingAverage:I.rollingAverage({windowSize:h})}),m=_s(r.channel);return g.useEffect(()=>n({...t,tooltip:[m]}),[m]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:r.channel,onChange:a})}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Notation",children:o.jsxRuntimeExports.jsx(Z1,{value:i.notation,onChange:d})}),o.jsxRuntimeExports.jsx(je.Item,{label:"Precision",align:"start",children:o.jsxRuntimeExports.jsx(je.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),o.jsxRuntimeExports.jsx(je.Item,{label:"Averaging Window",align:"start",children:o.jsxRuntimeExports.jsx(je.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})]})},G1=I.Value.z.partial({color:!0}).extend({level:le.levelZ.optional()}),Rr=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:i,level:l="small",backgroundTelem:c,notation:a,location:d})=>{const x=Te.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:r,level:l,minWidth:i,notation:a,backgroundTelem:c,location:d}),[,p,m]=Q.use$1({aetherKey:e,type:I.Value.TYPE,schema:I.Value.z,initialState:x});return g.useEffect(()=>m(f=>({...f,...x})),[x]),{width:p.width??p.minWidth}},Y1=Object.freeze(Object.defineProperty({__proto__:null,TelemForm:Sr,VALUE_CONNECTIONS:Vc,corePropsZ:G1,use:Rr},Symbol.toStringTag,{value:"Module"})),W1=ce.z.object({value:ce.z.string(),level:le.levelZ,weight:le.weightZ,align:u.K.x.or(u.K.center),backgroundColor:u.crudeZ}),K1=({cellKey:e,onChange:t,value:n,selected:s,onSelect:r,align:i,level:l,weight:c,backgroundColor:a})=>{const d=p=>r(e,p),x=p=>t({level:l,value:p,weight:c,align:i,backgroundColor:a});return o.jsxRuntimeExports.jsx(yr,{id:e,className:u.CSS(Ct.CONTEXT_TARGET,s&&Ct.CONTEXT_SELECTED,u.CSS.BEM("table","cell","text")),selected:s,onClick:d,onContextMenu:d,style:{backgroundColor:u.cssString(a)},children:o.jsxRuntimeExports.jsx(Z.Editable,{level:l,value:n,weight:c,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},q1=ce.z.object({telem:I.stringSourceSpecZ,redline:ce.z.object({bounds:u.H.bounds,gradient:u.gradientZ}),level:le.levelZ,color:ce.z.string(),units:ce.z.string()}),X1=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:r,bounds:i},selected:l,box:c,onSelect:a})=>{const{width:d}=Rr({aetherKey:e,box:c,telem:t,level:n,color:s,backgroundTelem:I.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:I.scaleNumber({scale:u.b.Scale.scale(i).scale(0,1).transform}),gradient:I.colorGradient({gradient:r})},outlet:"gradient"}),location:{x:"center",y:"center"}}),x=p=>a(e,p);return o.jsxRuntimeExports.jsx(yr,{id:e,selected:l,onClick:x,onContextMenu:x,style:{height:"5rem",width:d},className:u.CSS(Ct.CONTEXT_TARGET,l&&Ct.CONTEXT_SELECTED,u.CSS.BEM("table","cell","value"))})},U1=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return o.jsxRuntimeExports.jsx(oe.Space,{direction:"y",style:{padding:"2rem"},children:o.jsxRuntimeExports.jsx(Sr,{path:""})});case"redline":return o.jsxRuntimeExports.jsx(oe.Space,{direction:"y",style:{padding:"2rem"},children:o.jsxRuntimeExports.jsx(J1,{})});default:return o.jsxRuntimeExports.jsx(oe.Space,{direction:"y",grow:!0,empty:!0,style:{padding:"2rem"},children:o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Fc,{onChange:e,value:"value"})}),o.jsxRuntimeExports.jsx(Ce,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:r,onChange:i,variant:l,...c})=>o.jsxRuntimeExports.jsx(We.Swatch,{value:r??u.ZERO.setAlpha(1).rgba255,onChange:a=>i(a.rgba255),...c,bordered:!0})}),o.jsxRuntimeExports.jsx(Ce,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:r=>o.jsxRuntimeExports.jsx(ln,{...r})})]})})}},[]),n=Ne.useStatic({tabs:[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],content:t});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...n})},J1=()=>{const{set:e,get:t}=xt(),n=mc("redline.bounds"),s=u.b.Scale.scale(0,1).scale(n);return o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(Xt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Lower",path:"redline.bounds.lower"}),o.jsxRuntimeExports.jsx(Ce,{path:"redline.gradient",label:"Gradient",align:"start",padHelpText:!1,children:({value:r,onChange:i})=>o.jsxRuntimeExports.jsx(We.GradientPicker,{value:Be.I.copy(r),scale:s,onChange:l=>{const a={...t("redline.bounds").value},d=l.map(j=>j.position),x=s.pos(Math.max(...d)),p=s.pos(Math.min(...d)),m=x>a.upper,f=p<a.lower;m&&(l[l.length-1].position=1,a.upper=x),f&&(l[0].position=0,a.lower=p);const h=l.map(j=>({...j,color:new u.Color(j.color).hex}));m||f?e("redline",{bounds:a,gradient:h}):i(l.map(j=>({...j,color:new u.Color(j.color).hex})))}})}),o.jsxRuntimeExports.jsx(Xt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Upper",path:"redline.bounds.upper"})]})},Q1=({onVariantChange:e})=>o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",grow:!0,style:{padding:"2rem"},children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Fc,{onChange:e,value:"text"})}),o.jsxRuntimeExports.jsx(mr,{path:"value",label:"Text"}),o.jsxRuntimeExports.jsx(Ce,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ln,{...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"weight",label:"Weight",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ec,{...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"align",label:"Alignment",hideIfNull:!0,children:t=>o.jsxRuntimeExports.jsx(Ls,{...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(We.Swatch,{value:t,onChange:n})})]}),e0=[{key:"text",name:"Text"},{key:"value",name:"Value"}],Fc=e=>o.jsxRuntimeExports.jsx(ot,{...e,data:e0,allowMultiple:!1,entryRenderKey:"name"}),t0=["text","value"],n0=ce.z.enum(t0),s0={key:"value",name:"Value",Form:U1,Cell:X1,defaultProps:e=>({telem:I.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:I.streamChannelValue({channel:0}),rollingAverage:I.rollingAverage({windowSize:1}),stringifier:I.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"}),redline:{bounds:{lower:0,upper:1},gradient:[]},color:e.colors.gray.l8.hex,level:"h5",units:""}),schema:q1},o0={key:"text",name:"Text",Form:Q1,Cell:K1,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:W1},r0={text:o0,value:s0},i0=Object.freeze(Object.defineProperty({__proto__:null,CELLS:r0,variantZ:n0},Symbol.toStringTag,{value:"Module"})),di=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=Lt(e,...n);return u.G.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},xi=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:i})=>{if(!l0({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=u.g.construct(t),c=u.g.swap(l);let a=At(c,s[c]-e[c]);const d=u.Mo.loc(n,a);if(u.K.swap(t)===r){const x=u.Mo.loc(i,u.K.swap(a));Math.abs(d-x)<Fe&&(a=u.K.swap(a))}return{direction:c,length:d-e[c]+Dt(a,Fe)}},To=ce.z.object({direction:u.g.direction,length:ce.z.number()}),Lt=(e,...t)=>{let n=e;for(const s of t)n=u.G.translate(n,s.direction,s.length);return n},Hc=(e,t,n,s)=>{try{let r=e;const i=[e,...t.map(f=>(r=u.G.translate(r,f.direction,f.length),r))];if(!s)return i;const l=t[0],c=At(l.direction,l.length),a=pi(c),d=4*(2-n**.5);i[0]=u.G.translate(i[0],{[l.direction]:-1*a*d,[u.g.swap(l.direction)]:0});const x=t[t.length-1],p=At(x.direction,x.length),m=pi(p);return i[i.length-1]=u.G.translate(i[i.length-1],{[x.direction]:m*d,[u.g.swap(x.direction)]:0}),i}catch{return[]}},Fe=10,pi=e=>e==="top"||e==="left"?-1:1,Dt=(e,t)=>e==="top"||e==="left"?-t:t,At=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",Et=e=>At(e.direction,e.length),l0=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=u.g.construct(n),r=t[s]-e[s];return Dt(n,r)<0},Hn=e=>({direction:u.g.construct(e),length:Dt(e,Fe)}),mi={top:Hn("top"),bottom:Hn("bottom"),left:Hn("left"),right:Hn("right")},c0=4,a0=.25,Is=e=>Ao(u0(Ao(e))),u0=e=>{const t=[...e],n=e.findIndex((s,r)=>{const i=Math.abs(s.length);if(i<c0){if(r===0||r===e.length-1)return!1;if(i<a0)return!0;if(e.length<=3)return!1;if(r+2<e.length){const l=t[r+2];if(l.direction!==s.direction)return!1;t[r+2]={...l,length:l.length+s.length}}else{const l=t[r-2];if(l.direction!==s.direction)return!1;t[r-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},Ao=e=>{const t=[...e];return e.findIndex((s,r)=>{const i=t[r-1];if(r===0||s.direction!==i.direction)return!1;if(r===1){const l=r-1,c=r,a=Et(i),d=Et(s);if(a===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(i.length)===Fe)return!1;const x=Dt(a,Fe),p=t[l].length-x,m=t[c].length+p;return Math.abs(m)<Fe?!1:(t[l]={...t[l],length:x},t[c]={...t[c],length:m},!0)}if(r===e.length-1){const l=r,c=r-1,a=Et(s),d=Et(i);if(a===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(s.length)===Fe)return!1;const x=Dt(a,Fe),p=t[l].length-x,m=t[c].length+p;return Math.abs(m)<Fe?!1:(t[l]={...t[l],length:x},t[c]={...t[c],length:m},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?Ao(t):t},Gt=e=>Is(d0(e)),d0=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:i})=>{let l=i,c=r,a={...mi[i]},d=Lt(n,a);const x={...mi[r]};let p=Lt(s,x);const m=Math.abs(d.x-p.x),f=Math.abs(d.y-p.y);m<2*Fe&&f<10&&(a.length-=m/2,x.length+=m/2,d=Lt(n,a),p=Lt(s,x));const h=[a],j=xi({sourceStumpTip:d,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});j!=null&&(h.push(j),d=Lt(d,j),l=Et(j),a=j);const S=xi({sourceStumpTip:p,sourceOrientation:c,sourceBox:t,targetStumpTip:d,targetOrientation:l,targetBox:e});S!=null&&(p=Lt(p,S),c=At(S.direction,S.length));const R=()=>{S!=null&&(S.length*=-1,h.push(S)),x.length*=-1,h.push(x)};if(u.K.swap(l)===r){const _=u.g.construct(l),$=(p[_]-d[_])/2;h.push({direction:_,length:$});const D=u.g.swap(_);return h.push({direction:D,length:p[D]-d[D]}),h.push({direction:_,length:$}),R(),h}const w=p[a.direction]-d[a.direction];let E=u.g.swap(a.direction);const C=d[E]-p[E];let P;At(a.direction,w)===l&&At(E,C)===c?P={direction:a.direction,length:w}:(P={direction:E,length:p[E]-d[E]},E=u.g.swap(E)),h.push(P);const N={direction:E,length:p[E]-d[E]};return h.push(N),R(),h},x0=e=>Is(p0(e)),p0=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],i=u.g.swap(r.direction),l=Et(r);if(t===0){s.unshift({direction:i,length:n});const c=Dt(l,Fe);s.unshift({direction:r.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:i,length:-n});const c=Dt(l,Fe);s.push({direction:r.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},m0=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},f0=(e,t,n=!1,...s)=>{const r=(i,l)=>!s.includes(l)&&t(i,l);return n?m0(e,r):e.findIndex(r)},h0=({delta:e,segments:t})=>Is(Zc(e,t,!1)),g0=({delta:e,segments:t})=>Is(Zc(e,t,!0)),Zc=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=hi("x",e,s,n)),e.y!==0&&(s=hi("y",e,s,n)),s},fi=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=Et(t),i=Et(s),l=Math.abs(s.length),c=Math.abs(t.length);return(l>c||l>Fe)&&r===i},hi=(e,t,n,s)=>{const r=u.g.swap(e),i=s?n.length-1:0,l=n[i];if(fi(e,l,t)){const p=n[n.length-1];return p.direction===e&&Math.abs(l.length)<Fe?(n[n.length-1]={...p,length:p.length-t[e]},n):(n[i]={...l,length:l.length-t[e]},n)}const c=s?0:n.length-1,d=f0(n,p=>p.direction===e,s,i);if(d===c){const p=n[c];return fi(e,p,t)?(n[c]={...p,length:p.length-t[e]},n):(l.direction===e&&Math.abs(l.length)>p.length?n[i]={...l,length:l.length-t[e]}:n[c]={...p,length:p.length-t[e]},n)}if(d===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:r,length:n[0].length/2},{direction:e,length:-t[e]},{direction:r,length:n[0].length/2}]:l.direction===e?(n[i]={...l,length:l.length-t[e]},n):[{direction:r,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const x=n[d];return n[d]={...x,length:x.length-t[e]},n},j0=ce.z.object({position:u.G.xy,zoom:ce.z.number()}),Gc=ce.z.object({color:u.crudeZ,variant:ce.z.string().optional(),segments:ce.z.array(To)}),E0=Gc.extend({key:ce.z.string(),source:ce.z.string(),target:ce.z.string(),segments:ce.z.array(To),color:u.crudeZ,id:ce.z.string(),data:ce.z.object({segments:ce.z.array(To),color:u.crudeZ,variant:ce.z.string().optional()}).optional(),selected:ce.z.boolean(),sourceHandle:ce.z.string().nullable().optional(),targetHandle:ce.z.string().nullable().optional()}),y0=ce.z.object({key:ce.z.string(),position:u.G.xy,selected:ce.z.boolean().optional(),zIndex:ce.z.number().optional(),type:ce.z.string().optional(),data:ce.z.record(ce.z.unknown()).optional(),measured:ce.z.object({width:ce.z.number().optional(),height:ce.z.number().optional()}).optional()}),Cr=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),br=e=>e.map(({segments:t,color:n,variant:s,...r})=>({...r,id:r.key,data:{segments:t,color:n,variant:s}})),Yc=e=>e.map(t=>({key:t.id,...t})),Wc=(e,t)=>e.map(n=>{var s,r,i;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:((r=n.data)==null?void 0:r.color)??t,variant:((i=n.data)==null?void 0:i.variant)??"pipe",...n}}),Kc=e=>({...e.position,zoom:e.zoom}),qc=e=>({position:u.G.construct(e),zoom:e.zoom}),Xc=(e,t)=>Yc(t(Cr(e))),ns=(e,t,n)=>Wc(t(br(e)),n),S0=(e,t="x")=>{if(e.length===0)return[];const n=u.K.construct(t),s=u.K.swap(n);return e.sort((r,i)=>u.Mo.loc(r.box,n)-u.Mo.loc(i.box,n)),e.forEach((r,i)=>{if(i===0)return;const c=e[i-1].handles.find(f=>f.orientation===s),a=r.handles.find(f=>f.orientation===n);if(c==null||a==null)return;const d=c.absolutePosition,x=a.absolutePosition,p=u.G.set(u.G.translation(x,d),t,0),m=u.G.translate(u.Mo.topLeft(r.box),p);r.box=u.Mo.construct(m,u.Mo.dims(r.box))}),e};function ze(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=ze(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var R0={value:()=>{}};function zs(){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 ss(n)}function ss(e){this._=e}function C0(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}ss.prototype=zs.prototype={constructor:ss,on:function(e,t){var n=this._,s=C0(e+"",n),r,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((r=(e=s[i]).type)&&(r=b0(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(r=(e=s[i]).type)n[r]=gi(n[r],e.name,t);else if(t==null)for(r in n)n[r]=gi(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ss(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[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],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function b0(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function gi(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=R0,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Io="http://www.w3.org/1999/xhtml";const ji={svg:"http://www.w3.org/2000/svg",xhtml:Io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $s(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ji.hasOwnProperty(t)?{space:ji[t],local:e}:e}function w0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Io&&t.documentElement.namespaceURI===Io?t.createElement(e):t.createElementNS(n,e)}}function v0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Uc(e){var t=$s(e);return(t.local?v0:w0)(t)}function k0(){}function wr(e){return e==null?k0:function(){return this.querySelector(e)}}function M0(e){typeof e!="function"&&(e=wr(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=new Array(l),a,d,x=0;x<l;++x)(a=i[x])&&(d=e.call(a,a.__data__,x,i))&&("__data__"in a&&(d.__data__=a.__data__),c[x]=d);return new Ze(s,this._parents)}function _0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function P0(){return[]}function Jc(e){return e==null?P0:function(){return this.querySelectorAll(e)}}function L0(e){return function(){return _0(e.apply(this,arguments))}}function N0(e){typeof e=="function"?e=L0(e):e=Jc(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var l=t[i],c=l.length,a,d=0;d<c;++d)(a=l[d])&&(s.push(e.call(a,a.__data__,d,l)),r.push(a));return new Ze(s,r)}function Qc(e){return function(){return this.matches(e)}}function ea(e){return function(t){return t.matches(e)}}var T0=Array.prototype.find;function A0(e){return function(){return T0.call(this.children,e)}}function I0(){return this.firstElementChild}function z0(e){return this.select(e==null?I0:A0(typeof e=="function"?e:ea(e)))}var $0=Array.prototype.filter;function D0(){return Array.from(this.children)}function B0(e){return function(){return $0.call(this.children,e)}}function O0(e){return this.selectAll(e==null?D0:B0(typeof e=="function"?e:ea(e)))}function V0(e){typeof e!="function"&&(e=Qc(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=[],a,d=0;d<l;++d)(a=i[d])&&e.call(a,a.__data__,d,i)&&c.push(a);return new Ze(s,this._parents)}function ta(e){return new Array(e.length)}function F0(){return new Ze(this._enter||this._groups.map(ta),this._parents)}function gs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}gs.prototype={constructor:gs,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 H0(e){return function(){return e}}function Z0(e,t,n,s,r,i){for(var l=0,c,a=t.length,d=i.length;l<d;++l)(c=t[l])?(c.__data__=i[l],s[l]=c):n[l]=new gs(e,i[l]);for(;l<a;++l)(c=t[l])&&(r[l]=c)}function G0(e,t,n,s,r,i,l){var c,a,d=new Map,x=t.length,p=i.length,m=new Array(x),f;for(c=0;c<x;++c)(a=t[c])&&(m[c]=f=l.call(a,a.__data__,c,t)+"",d.has(f)?r[c]=a:d.set(f,a));for(c=0;c<p;++c)f=l.call(e,i[c],c,i)+"",(a=d.get(f))?(s[c]=a,a.__data__=i[c],d.delete(f)):n[c]=new gs(e,i[c]);for(c=0;c<x;++c)(a=t[c])&&d.get(m[c])===a&&(r[c]=a)}function Y0(e){return e.__data__}function W0(e,t){if(!arguments.length)return Array.from(this,Y0);var n=t?G0:Z0,s=this._parents,r=this._groups;typeof e!="function"&&(e=H0(e));for(var i=r.length,l=new Array(i),c=new Array(i),a=new Array(i),d=0;d<i;++d){var x=s[d],p=r[d],m=p.length,f=K0(e.call(x,x&&x.__data__,d,s)),h=f.length,j=c[d]=new Array(h),S=l[d]=new Array(h),R=a[d]=new Array(m);n(x,p,j,S,R,f,t);for(var w=0,E=0,C,P;w<h;++w)if(C=j[w]){for(w>=E&&(E=w+1);!(P=S[E])&&++E<h;);C._next=P||null}}return l=new Ze(l,s),l._enter=c,l._exit=a,l}function K0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function q0(){return new Ze(this._exit||this._groups.map(ta),this._parents)}function X0(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function U0(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,l=Math.min(r,i),c=new Array(r),a=0;a<l;++a)for(var d=n[a],x=s[a],p=d.length,m=c[a]=new Array(p),f,h=0;h<p;++h)(f=d[h]||x[h])&&(m[h]=f);for(;a<r;++a)c[a]=n[a];return new Ze(c,this._parents)}function J0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],l;--r>=0;)(l=s[r])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function Q0(e){e||(e=ej);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var l=n[i],c=l.length,a=r[i]=new Array(c),d,x=0;x<c;++x)(d=l[x])&&(a[x]=d);a.sort(t)}return new Ze(r,this._parents).order()}function ej(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function tj(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function nj(){return Array.from(this)}function sj(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var l=s[r];if(l)return l}return null}function oj(){let e=0;for(const t of this)++e;return e}function rj(){return!this.node()}function ij(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,l=r.length,c;i<l;++i)(c=r[i])&&e.call(c,c.__data__,i,r);return this}function lj(e){return function(){this.removeAttribute(e)}}function cj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function aj(e,t){return function(){this.setAttribute(e,t)}}function uj(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function dj(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function xj(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 pj(e,t){var n=$s(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?cj:lj:typeof t=="function"?n.local?xj:dj:n.local?uj:aj)(n,t))}function na(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function mj(e){return function(){this.style.removeProperty(e)}}function fj(e,t,n){return function(){this.style.setProperty(e,t,n)}}function hj(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function gj(e,t,n){return arguments.length>1?this.each((t==null?mj:typeof t=="function"?hj:fj)(e,t,n??"")):Jt(this.node(),e)}function Jt(e,t){return e.style.getPropertyValue(t)||na(e).getComputedStyle(e,null).getPropertyValue(t)}function jj(e){return function(){delete this[e]}}function Ej(e,t){return function(){this[e]=t}}function yj(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Sj(e,t){return arguments.length>1?this.each((t==null?jj:typeof t=="function"?yj:Ej)(e,t)):this.node()[e]}function sa(e){return e.trim().split(/^|\s+/)}function vr(e){return e.classList||new oa(e)}function oa(e){this._node=e,this._names=sa(e.getAttribute("class")||"")}oa.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 ra(e,t){for(var n=vr(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function ia(e,t){for(var n=vr(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function Rj(e){return function(){ra(this,e)}}function Cj(e){return function(){ia(this,e)}}function bj(e,t){return function(){(t.apply(this,arguments)?ra:ia)(this,e)}}function wj(e,t){var n=sa(e+"");if(arguments.length<2){for(var s=vr(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?bj:t?Rj:Cj)(n,t))}function vj(){this.textContent=""}function kj(e){return function(){this.textContent=e}}function Mj(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function _j(e){return arguments.length?this.each(e==null?vj:(typeof e=="function"?Mj:kj)(e)):this.node().textContent}function Pj(){this.innerHTML=""}function Lj(e){return function(){this.innerHTML=e}}function Nj(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Tj(e){return arguments.length?this.each(e==null?Pj:(typeof e=="function"?Nj:Lj)(e)):this.node().innerHTML}function Aj(){this.nextSibling&&this.parentNode.appendChild(this)}function Ij(){return this.each(Aj)}function zj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $j(){return this.each(zj)}function Dj(e){var t=typeof e=="function"?e:Uc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Bj(){return null}function Oj(e,t){var n=typeof e=="function"?e:Uc(e),s=t==null?Bj:typeof t=="function"?t:wr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function Vj(){var e=this.parentNode;e&&e.removeChild(this)}function Fj(){return this.each(Vj)}function Hj(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Zj(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gj(e){return this.select(e?Zj:Hj)}function Yj(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Wj(e){return function(t){e.call(this,t,this.__data__)}}function Kj(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 qj(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function Xj(e,t,n){return function(){var s=this.__on,r,i=Wj(t);if(s){for(var l=0,c=s.length;l<c;++l)if((r=s[l]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function Uj(e,t,n){var s=Kj(e+""),r,i=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var a=0,d=c.length,x;a<d;++a)for(r=0,x=c[a];r<i;++r)if((l=s[r]).type===x.type&&l.name===x.name)return x.value}return}for(c=t?Xj:qj,r=0;r<i;++r)this.each(c(s[r],t,n));return this}function la(e,t,n){var s=na(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Jj(e,t){return function(){return la(this,e,t)}}function Qj(e,t){return function(){return la(this,e,t.apply(this,arguments))}}function e2(e,t){return this.each((typeof t=="function"?Qj:Jj)(e,t))}function*t2(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,l;r<i;++r)(l=s[r])&&(yield l)}var ca=[null];function Ze(e,t){this._groups=e,this._parents=t}function In(){return new Ze([[document.documentElement]],ca)}function n2(){return this}Ze.prototype=In.prototype={constructor:Ze,select:M0,selectAll:N0,selectChild:z0,selectChildren:O0,filter:V0,data:W0,enter:F0,exit:q0,join:X0,merge:U0,selection:n2,order:J0,sort:Q0,call:tj,nodes:nj,node:sj,size:oj,empty:rj,each:ij,attr:pj,style:gj,property:Sj,classed:wj,text:_j,html:Tj,raise:Ij,lower:$j,append:Dj,insert:Oj,remove:Fj,clone:Gj,datum:Yj,on:Uj,dispatch:e2,[Symbol.iterator]:t2};function He(e){return typeof e=="string"?new Ze([[document.querySelector(e)]],[document.documentElement]):new Ze([[e]],ca)}function s2(e){let t;for(;t=e.sourceEvent;)e=t;return e}function qe(e,t){if(e=s2(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 r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const o2={passive:!1},wn={capture:!0,passive:!1};function mo(e){e.stopImmediatePropagation()}function Kt(e){e.preventDefault(),e.stopImmediatePropagation()}function aa(e){var t=e.document.documentElement,n=He(e).on("dragstart.drag",Kt,wn);"onselectstart"in t?n.on("selectstart.drag",Kt,wn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ua(e,t){var n=e.document.documentElement,s=He(e).on("dragstart.drag",null);t&&(s.on("click.drag",Kt,wn),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 Zn=e=>()=>e;function zo(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:l,y:c,dx:a,dy:d,dispatch:x}){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:r,enumerable:!0,configurable:!0},active:{value:i,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:d,enumerable:!0,configurable:!0},_:{value:x}})}zo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function r2(e){return!e.ctrlKey&&!e.button}function i2(){return this.parentNode}function l2(e,t){return t??{x:e.x,y:e.y}}function c2(){return navigator.maxTouchPoints||"ontouchstart"in this}function da(){var e=r2,t=i2,n=l2,s=c2,r={},i=zs("start","drag","end"),l=0,c,a,d,x,p=0;function m(C){C.on("mousedown.drag",f).filter(s).on("touchstart.drag",S).on("touchmove.drag",R,o2).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(C,P){if(!(x||!e.call(this,C,P))){var N=E(this,t.call(this,C,P),C,P,"mouse");N&&(He(C.view).on("mousemove.drag",h,wn).on("mouseup.drag",j,wn),aa(C.view),mo(C),d=!1,c=C.clientX,a=C.clientY,N("start",C))}}function h(C){if(Kt(C),!d){var P=C.clientX-c,N=C.clientY-a;d=P*P+N*N>p}r.mouse("drag",C)}function j(C){He(C.view).on("mousemove.drag mouseup.drag",null),ua(C.view,d),Kt(C),r.mouse("end",C)}function S(C,P){if(e.call(this,C,P)){var N=C.changedTouches,_=t.call(this,C,P),$=N.length,D,B;for(D=0;D<$;++D)(B=E(this,_,C,P,N[D].identifier,N[D]))&&(mo(C),B("start",C,N[D]))}}function R(C){var P=C.changedTouches,N=P.length,_,$;for(_=0;_<N;++_)($=r[P[_].identifier])&&(Kt(C),$("drag",C,P[_]))}function w(C){var P=C.changedTouches,N=P.length,_,$;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),_=0;_<N;++_)($=r[P[_].identifier])&&(mo(C),$("end",C,P[_]))}function E(C,P,N,_,$,D){var B=i.copy(),F=qe(D||N,P),O,M,y;if((y=n.call(C,new zo("beforestart",{sourceEvent:N,target:m,identifier:$,active:l,x:F[0],y:F[1],dx:0,dy:0,dispatch:B}),_))!=null)return O=y.x-F[0]||0,M=y.y-F[1]||0,function k(b,L,A){var T=F,V;switch(b){case"start":r[$]=k,V=l++;break;case"end":delete r[$],--l;case"drag":F=qe(A||L,P),V=l;break}B.call(b,C,new zo(b,{sourceEvent:L,subject:y,target:m,identifier:$,active:V,x:F[0]+O,y:F[1]+M,dx:F[0]-T[0],dy:F[1]-T[1],dispatch:B}),_)}}return m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Zn(!!C),m):e},m.container=function(C){return arguments.length?(t=typeof C=="function"?C:Zn(C),m):t},m.subject=function(C){return arguments.length?(n=typeof C=="function"?C:Zn(C),m):n},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:Zn(!!C),m):s},m.on=function(){var C=i.on.apply(i,arguments);return C===i?m:C},m.clickDistance=function(C){return arguments.length?(p=(C=+C)*C,m):Math.sqrt(p)},m}var Qt=0,hn=0,mn=0,xa=1e3,js,gn,Es=0,Bt=0,Ds=0,vn=typeof performance=="object"&&performance.now?performance:Date,pa=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kr(){return Bt||(pa(a2),Bt=vn.now()+Ds)}function a2(){Bt=0}function ys(){this._call=this._time=this._next=null}ys.prototype=ma.prototype={constructor:ys,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?kr():+n)+(t==null?0:+t),!this._next&&gn!==this&&(gn?gn._next=this:js=this,gn=this),this._call=e,this._time=n,$o()},stop:function(){this._call&&(this._call=null,this._time=1/0,$o())}};function ma(e,t,n){var s=new ys;return s.restart(e,t,n),s}function u2(){kr(),++Qt;for(var e=js,t;e;)(t=Bt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qt}function Ei(){Bt=(Es=vn.now())+Ds,Qt=hn=0;try{u2()}finally{Qt=0,x2(),Bt=0}}function d2(){var e=vn.now(),t=e-Es;t>xa&&(Ds-=t,Es=e)}function x2(){for(var e,t=js,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:js=n);gn=e,$o(s)}function $o(e){if(!Qt){hn&&(hn=clearTimeout(hn));var t=e-Bt;t>24?(e<1/0&&(hn=setTimeout(Ei,e-vn.now()-Ds)),mn&&(mn=clearInterval(mn))):(mn||(Es=vn.now(),mn=setInterval(d2,xa)),Qt=1,pa(Ei))}}function yi(e,t,n){var s=new ys;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var p2=zs("start","end","cancel","interrupt"),m2=[],fa=0,Si=1,Do=2,os=3,Ri=4,Bo=5,rs=6;function Bs(e,t,n,s,r,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;f2(e,n,{name:t,index:s,group:r,on:p2,tween:m2,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:fa})}function Mr(e,t){var n=Je(e,t);if(n.state>fa)throw new Error("too late; already scheduled");return n}function rt(e,t){var n=Je(e,t);if(n.state>os)throw new Error("too late; already running");return n}function Je(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function f2(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=ma(i,0,n.time);function i(d){n.state=Si,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var x,p,m,f;if(n.state!==Si)return a();for(x in s)if(f=s[x],f.name===n.name){if(f.state===os)return yi(l);f.state===Ri?(f.state=rs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete s[x]):+x<t&&(f.state=rs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete s[x])}if(yi(function(){n.state===os&&(n.state=Ri,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=Do,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Do){for(n.state=os,r=new Array(m=n.tween.length),x=0,p=-1;x<m;++x)(f=n.tween[x].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=f);r.length=p+1}}function c(d){for(var x=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(a),n.state=Bo,1),p=-1,m=r.length;++p<m;)r[p].call(e,x);n.state===Bo&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=rs,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function is(e,t){var n=e.__transition,s,r,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){i=!1;continue}r=s.state>Do&&s.state<Bo,s.state=rs,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function h2(e){return this.each(function(){is(this,e)})}function g2(e,t){var n,s;return function(){var r=rt(this,e),i=r.tween;if(i!==n){s=n=i;for(var l=0,c=s.length;l<c;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}r.tween=s}}function j2(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=rt(this,e),l=i.tween;if(l!==s){r=(s=l).slice();for(var c={name:t,value:n},a=0,d=r.length;a<d;++a)if(r[a].name===t){r[a]=c;break}a===d&&r.push(c)}i.tween=r}}function E2(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Je(this.node(),n).tween,r=0,i=s.length,l;r<i;++r)if((l=s[r]).name===e)return l.value;return null}return this.each((t==null?g2:j2)(n,e,t))}function _r(e,t,n){var s=e._id;return e.each(function(){var r=rt(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Je(r,s).value[t]}}function ha(e,t){var n;return(typeof t=="number"?I.interpolateNumber:t instanceof I.color?I.interpolateRgb:(n=I.color(t))?(t=n,I.interpolateRgb):I.interpolateString)(e,t)}function y2(e){return function(){this.removeAttribute(e)}}function S2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function R2(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttribute(e);return l===r?null:l===s?i:i=t(s=l,n)}}function C2(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===r?null:l===s?i:i=t(s=l,n)}}function b2(e,t,n){var s,r,i;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===r?i:(r=a,i=t(s=l,c)))}}function w2(e,t,n){var s,r,i;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===r?i:(r=a,i=t(s=l,c)))}}function v2(e,t){var n=$s(e),s=n==="transform"?th:ha;return this.attrTween(e,typeof t=="function"?(n.local?w2:b2)(n,s,_r(this,"attr."+e,t)):t==null?(n.local?S2:y2)(n):(n.local?C2:R2)(n,s,t))}function k2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function M2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function _2(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&M2(e,i)),n}return r._value=t,r}function P2(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&k2(e,i)),n}return r._value=t,r}function L2(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=$s(e);return this.tween(n,(s.local?_2:P2)(s,t))}function N2(e,t){return function(){Mr(this,e).delay=+t.apply(this,arguments)}}function T2(e,t){return t=+t,function(){Mr(this,e).delay=t}}function A2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?N2:T2)(t,e)):Je(this.node(),t).delay}function I2(e,t){return function(){rt(this,e).duration=+t.apply(this,arguments)}}function z2(e,t){return t=+t,function(){rt(this,e).duration=t}}function $2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?I2:z2)(t,e)):Je(this.node(),t).duration}function D2(e,t){if(typeof t!="function")throw new Error;return function(){rt(this,e).ease=t}}function B2(e){var t=this._id;return arguments.length?this.each(D2(t,e)):Je(this.node(),t).ease}function O2(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;rt(this,e).ease=n}}function V2(e){if(typeof e!="function")throw new Error;return this.each(O2(this._id,e))}function F2(e){typeof e!="function"&&(e=Qc(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=[],a,d=0;d<l;++d)(a=i[d])&&e.call(a,a.__data__,d,i)&&c.push(a);return new at(s,this._parents,this._name,this._id)}function H2(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),l=new Array(s),c=0;c<i;++c)for(var a=t[c],d=n[c],x=a.length,p=l[c]=new Array(x),m,f=0;f<x;++f)(m=a[f]||d[f])&&(p[f]=m);for(;c<s;++c)l[c]=t[c];return new at(l,this._parents,this._name,this._id)}function Z2(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 G2(e,t,n){var s,r,i=Z2(t)?Mr:rt;return function(){var l=i(this,e),c=l.on;c!==s&&(r=(s=c).copy()).on(t,n),l.on=r}}function Y2(e,t){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(e):this.each(G2(n,e,t))}function W2(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function K2(){return this.on("end.remove",W2(this._id))}function q2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wr(e));for(var s=this._groups,r=s.length,i=new Array(r),l=0;l<r;++l)for(var c=s[l],a=c.length,d=i[l]=new Array(a),x,p,m=0;m<a;++m)(x=c[m])&&(p=e.call(x,x.__data__,m,c))&&("__data__"in x&&(p.__data__=x.__data__),d[m]=p,Bs(d[m],t,n,m,d,Je(x,n)));return new at(i,this._parents,t,n)}function X2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jc(e));for(var s=this._groups,r=s.length,i=[],l=[],c=0;c<r;++c)for(var a=s[c],d=a.length,x,p=0;p<d;++p)if(x=a[p]){for(var m=e.call(x,x.__data__,p,a),f,h=Je(x,n),j=0,S=m.length;j<S;++j)(f=m[j])&&Bs(f,t,n,j,m,h);i.push(m),l.push(x)}return new at(i,l,t,n)}var U2=In.prototype.constructor;function J2(){return new U2(this._groups,this._parents)}function Q2(e,t){var n,s,r;return function(){var i=Jt(this,e),l=(this.style.removeProperty(e),Jt(this,e));return i===l?null:i===n&&l===s?r:r=t(n=i,s=l)}}function ga(e){return function(){this.style.removeProperty(e)}}function e3(e,t,n){var s,r=n+"",i;return function(){var l=Jt(this,e);return l===r?null:l===s?i:i=t(s=l,n)}}function t3(e,t,n){var s,r,i;return function(){var l=Jt(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),Jt(this,e))),l===a?null:l===s&&a===r?i:(r=a,i=t(s=l,c))}}function n3(e,t){var n,s,r,i="style."+t,l="end."+i,c;return function(){var a=rt(this,e),d=a.on,x=a.value[i]==null?c||(c=ga(t)):void 0;(d!==n||r!==x)&&(s=(n=d).copy()).on(l,r=x),a.on=s}}function s3(e,t,n){var s=(e+="")=="transform"?eh:ha;return t==null?this.styleTween(e,Q2(e,s)).on("end.style."+e,ga(e)):typeof t=="function"?this.styleTween(e,t3(e,s,_r(this,"style."+e,t))).each(n3(this._id,e)):this.styleTween(e,e3(e,s,t),n).on("end.style."+e,null)}function o3(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function r3(e,t,n){var s,r;function i(){var l=t.apply(this,arguments);return l!==r&&(s=(r=l)&&o3(e,l,n)),s}return i._value=t,i}function i3(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,r3(e,t,n??""))}function l3(e){return function(){this.textContent=e}}function c3(e){return function(){var t=e(this);this.textContent=t??""}}function a3(e){return this.tween("text",typeof e=="function"?c3(_r(this,"text",e)):l3(e==null?"":e+""))}function u3(e){return function(t){this.textContent=e.call(this,t)}}function d3(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&u3(r)),t}return s._value=e,s}function x3(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,d3(e))}function p3(){for(var e=this._name,t=this._id,n=ja(),s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],c=l.length,a,d=0;d<c;++d)if(a=l[d]){var x=Je(a,t);Bs(a,e,n,d,l,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new at(s,this._parents,e,n)}function m3(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,l){var c={value:l},a={value:function(){--r===0&&i()}};n.each(function(){var d=rt(this,s),x=d.on;x!==e&&(t=(e=x).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(a)),d.on=t}),r===0&&i()})}var f3=0;function at(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function ja(){return++f3}var it=In.prototype;at.prototype={constructor:at,select:q2,selectAll:X2,selectChild:it.selectChild,selectChildren:it.selectChildren,filter:F2,merge:H2,selection:J2,transition:p3,call:it.call,nodes:it.nodes,node:it.node,size:it.size,empty:it.empty,each:it.each,on:Y2,attr:v2,attrTween:L2,style:s3,styleTween:i3,text:a3,textTween:x3,remove:K2,tween:E2,delay:A2,duration:$2,ease:B2,easeVarying:V2,end:m3,[Symbol.iterator]:it[Symbol.iterator]};function h3(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var g3={time:null,delay:0,duration:250,ease:h3};function j3(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 E3(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=ja(),(n=g3).time=kr(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],c=l.length,a,d=0;d<c;++d)(a=l[d])&&Bs(a,e,t,d,l,n||j3(a,t));return new at(s,this._parents,e,t)}In.prototype.interrupt=h2;In.prototype.transition=E3;const Gn=e=>()=>e;function y3(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){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:r}})}function lt(e,t,n){this.k=e,this.x=t,this.y=n}lt.prototype={constructor:lt,scale:function(e){return e===1?this:new lt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new lt(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 Os=new lt(1,0,0);Ea.prototype=lt.prototype;function Ea(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Os;return e.__zoom}function fo(e){e.stopImmediatePropagation()}function fn(e){e.preventDefault(),e.stopImmediatePropagation()}function S3(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function R3(){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 Ci(){return this.__zoom||Os}function C3(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function b3(){return navigator.maxTouchPoints||"ontouchstart"in this}function w3(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function ya(){var e=S3,t=R3,n=w3,s=C3,r=b3,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=rh,d=zs("start","zoom","end"),x,p,m,f=500,h=150,j=0,S=10;function R(y){y.property("__zoom",Ci).on("wheel.zoom",$,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",B).filter(r).on("touchstart.zoom",F).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}R.transform=function(y,k,b,L){var A=y.selection?y.selection():y;A.property("__zoom",Ci),y!==A?P(y,k,b,L):A.interrupt().each(function(){N(this,arguments).event(L).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},R.scaleBy=function(y,k,b,L){R.scaleTo(y,function(){var A=this.__zoom.k,T=typeof k=="function"?k.apply(this,arguments):k;return A*T},b,L)},R.scaleTo=function(y,k,b,L){R.transform(y,function(){var A=t.apply(this,arguments),T=this.__zoom,V=b==null?C(A):typeof b=="function"?b.apply(this,arguments):b,H=T.invert(V),G=typeof k=="function"?k.apply(this,arguments):k;return n(E(w(T,G),V,H),A,l)},b,L)},R.translateBy=function(y,k,b,L){R.transform(y,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof b=="function"?b.apply(this,arguments):b),t.apply(this,arguments),l)},null,L)},R.translateTo=function(y,k,b,L,A){R.transform(y,function(){var T=t.apply(this,arguments),V=this.__zoom,H=L==null?C(T):typeof L=="function"?L.apply(this,arguments):L;return n(Os.translate(H[0],H[1]).scale(V.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof b=="function"?-b.apply(this,arguments):-b),T,l)},L,A)};function w(y,k){return k=Math.max(i[0],Math.min(i[1],k)),k===y.k?y:new lt(k,y.x,y.y)}function E(y,k,b){var L=k[0]-b[0]*y.k,A=k[1]-b[1]*y.k;return L===y.x&&A===y.y?y:new lt(y.k,L,A)}function C(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}function P(y,k,b,L){y.on("start.zoom",function(){N(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(L).end()}).tween("zoom",function(){var A=this,T=arguments,V=N(A,T).event(L),H=t.apply(A,T),G=b==null?C(H):typeof b=="function"?b.apply(A,T):b,ee=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),te=A.__zoom,ne=typeof k=="function"?k.apply(A,T):k,se=a(te.invert(G).concat(ee/te.k),ne.invert(G).concat(ee/ne.k));return function(J){if(J===1)J=ne;else{var ie=se(J),fe=ee/ie[2];J=new lt(fe,G[0]-ie[0]*fe,G[1]-ie[1]*fe)}V.zoom(null,J)}})}function N(y,k,b){return!b&&y.__zooming||new _(y,k)}function _(y,k){this.that=y,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(y,k),this.taps=0}_.prototype={event:function(y){return y&&(this.sourceEvent=y),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(y,k){return this.mouse&&y!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&y!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&y!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(y){var k=He(this.that).datum();d.call(y,this.that,new y3(y,{sourceEvent:this.sourceEvent,target:R,transform:this.that.__zoom,dispatch:d}),k)}};function $(y,...k){if(!e.apply(this,arguments))return;var b=N(this,k).event(y),L=this.__zoom,A=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,s.apply(this,arguments)))),T=qe(y);if(b.wheel)(b.mouse[0][0]!==T[0]||b.mouse[0][1]!==T[1])&&(b.mouse[1]=L.invert(b.mouse[0]=T)),clearTimeout(b.wheel);else{if(L.k===A)return;b.mouse=[T,L.invert(T)],is(this),b.start()}fn(y),b.wheel=setTimeout(V,h),b.zoom("mouse",n(E(w(L,A),b.mouse[0],b.mouse[1]),b.extent,l));function V(){b.wheel=null,b.end()}}function D(y,...k){if(m||!e.apply(this,arguments))return;var b=y.currentTarget,L=N(this,k,!0).event(y),A=He(y.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",ee,!0),T=qe(y,b),V=y.clientX,H=y.clientY;aa(y.view),fo(y),L.mouse=[T,this.__zoom.invert(T)],is(this),L.start();function G(te){if(fn(te),!L.moved){var ne=te.clientX-V,se=te.clientY-H;L.moved=ne*ne+se*se>j}L.event(te).zoom("mouse",n(E(L.that.__zoom,L.mouse[0]=qe(te,b),L.mouse[1]),L.extent,l))}function ee(te){A.on("mousemove.zoom mouseup.zoom",null),ua(te.view,L.moved),fn(te),L.event(te).end()}}function B(y,...k){if(e.apply(this,arguments)){var b=this.__zoom,L=qe(y.changedTouches?y.changedTouches[0]:y,this),A=b.invert(L),T=b.k*(y.shiftKey?.5:2),V=n(E(w(b,T),L,A),t.apply(this,k),l);fn(y),c>0?He(this).transition().duration(c).call(P,V,L,y):He(this).call(R.transform,V,L,y)}}function F(y,...k){if(e.apply(this,arguments)){var b=y.touches,L=b.length,A=N(this,k,y.changedTouches.length===L).event(y),T,V,H,G;for(fo(y),V=0;V<L;++V)H=b[V],G=qe(H,this),G=[G,this.__zoom.invert(G),H.identifier],A.touch0?!A.touch1&&A.touch0[2]!==G[2]&&(A.touch1=G,A.taps=0):(A.touch0=G,T=!0,A.taps=1+!!x);x&&(x=clearTimeout(x)),T&&(A.taps<2&&(p=G[0],x=setTimeout(function(){x=null},f)),is(this),A.start())}}function O(y,...k){if(this.__zooming){var b=N(this,k).event(y),L=y.changedTouches,A=L.length,T,V,H,G;for(fn(y),T=0;T<A;++T)V=L[T],H=qe(V,this),b.touch0&&b.touch0[2]===V.identifier?b.touch0[0]=H:b.touch1&&b.touch1[2]===V.identifier&&(b.touch1[0]=H);if(V=b.that.__zoom,b.touch1){var ee=b.touch0[0],te=b.touch0[1],ne=b.touch1[0],se=b.touch1[1],J=(J=ne[0]-ee[0])*J+(J=ne[1]-ee[1])*J,ie=(ie=se[0]-te[0])*ie+(ie=se[1]-te[1])*ie;V=w(V,Math.sqrt(J/ie)),H=[(ee[0]+ne[0])/2,(ee[1]+ne[1])/2],G=[(te[0]+se[0])/2,(te[1]+se[1])/2]}else if(b.touch0)H=b.touch0[0],G=b.touch0[1];else return;b.zoom("touch",n(E(V,H,G),b.extent,l))}}function M(y,...k){if(this.__zooming){var b=N(this,k).event(y),L=y.changedTouches,A=L.length,T,V;for(fo(y),m&&clearTimeout(m),m=setTimeout(function(){m=null},f),T=0;T<A;++T)V=L[T],b.touch0&&b.touch0[2]===V.identifier?delete b.touch0:b.touch1&&b.touch1[2]===V.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(V=qe(V,this),Math.hypot(p[0]-V[0],p[1]-V[1])<S)){var H=He(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return R.wheelDelta=function(y){return arguments.length?(s=typeof y=="function"?y:Gn(+y),R):s},R.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Gn(!!y),R):e},R.touchable=function(y){return arguments.length?(r=typeof y=="function"?y:Gn(!!y),R):r},R.extent=function(y){return arguments.length?(t=typeof y=="function"?y:Gn([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),R):t},R.scaleExtent=function(y){return arguments.length?(i[0]=+y[0],i[1]=+y[1],R):[i[0],i[1]]},R.translateExtent=function(y){return arguments.length?(l[0][0]=+y[0][0],l[1][0]=+y[1][0],l[0][1]=+y[0][1],l[1][1]=+y[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(y){return arguments.length?(n=y,R):n},R.duration=function(y){return arguments.length?(c=+y,R):c},R.interpolate=function(y){return arguments.length?(a=y,R):a},R.on=function(){var y=d.on.apply(d,arguments);return y===d?R:y},R.clickDistance=function(y){return arguments.length?(j=(y=+y)*y,R):Math.sqrt(j)},R.tapDistance=function(y){return arguments.length?(S=+y,R):S},R}const Oe={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.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},kn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Sa=["Enter"," ","Escape"];var Ot;(function(e){e.Strict="strict",e.Loose="loose"})(Ot||(Ot={}));var It;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(It||(It={}));var en;(function(e){e.Partial="partial",e.Full="full"})(en||(en={}));const Ra={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var jt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(jt||(jt={}));var Ss;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ss||(Ss={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const bi={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Ca(e){return e===null?null:e?"valid":"invalid"}const ba=e=>"id"in e&&"source"in e&&"target"in e,v3=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Pr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),zn=(e,t=[0,0])=>{const{width:n,height:s}=mt(e),r=e.origin??t,i=n*r[0],l=s*r[1];return{x:e.position.x-i,y:e.position.y-l}},k3=(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,r)=>{const i=typeof r=="string";let l=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(r):Pr(r)?r:t.nodeLookup.get(r.id));const c=l?Rs(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 Fs(n)},$n=(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 r=Rs(s);n=Vs(n,r)}}),Fs(n)},wa=(e,t,[n,s,r]=[0,0,1],i=!1,l=!1)=>{const c={...Dn(t,[n,s,r]),width:t.width/r,height:t.height/r},a=[];for(const d of e.values()){const{measured:x,selectable:p=!0,hidden:m=!1}=d;if(l&&!p||m)continue;const f=x.width??d.width??d.initialWidth??null,h=x.height??d.height??d.initialHeight??null,j=Mn(c,nn(d)),S=(f??0)*(h??0),R=i&&j>0;(!d.internals.handleBounds||R||j>=S||d.dragging)&&a.push(d)}return a},M3=(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 Oo(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function Vo({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},l){if(e.size===0)return Promise.resolve(!1);const c=$n(e),a=Lr(c,t,n,(l==null?void 0:l.minZoom)??r,(l==null?void 0:l.maxZoom)??i,(l==null?void 0:l.padding)??.1);return await s.setViewport(a,{duration:l==null?void 0:l.duration}),Promise.resolve(!0)}function va({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:a,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},x=l.origin??s;let p=r;if(l.extent==="parent"&&!l.expandParent)if(!c)i==null||i("005",Oe.error005());else{const f=c.measured.width,h=c.measured.height;f&&h&&(p=[[a,d],[a+f,d+h]])}else c&&sn(l.extent)&&(p=[[l.extent[0][0]+a,l.extent[0][1]+d],[l.extent[1][0]+a,l.extent[1][1]+d]]);const m=sn(p)?Vt(t,p,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(i==null||i("015",Oe.error015())),{position:{x:m.x-a+(l.measured.width??0)*x[0],y:m.y-d+(l.measured.height??0)*x[1]},positionAbsolute:m}}async function _3({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(m=>m.id)),l=[];for(const m of n){if(m.deletable===!1)continue;const f=i.has(m.id),h=!f&&m.parentId&&l.find(j=>j.id===m.parentId);(f||h)&&l.push(m)}const c=new Set(t.map(m=>m.id)),a=s.filter(m=>m.deletable!==!1),x=M3(l,a);for(const m of a)c.has(m.id)&&!x.find(h=>h.id===m.id)&&x.push(m);if(!r)return{edges:x,nodes:l};const p=await r({nodes:l,edges:x});return typeof p=="boolean"?p?{edges:x,nodes:l}:{edges:[],nodes:[]}:p}const tn=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Vt=(e={x:0,y:0},t,n)=>({x:tn(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:tn(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function ka(e,t,n){const{width:s,height:r}=mt(n),{x:i,y:l}=n.internals.positionAbsolute;return Vt(e,[[i,l],[i+s,l+r]],t)}const wi=(e,t,n)=>e<t?tn(Math.abs(e-t),1,t)/t:e>n?-tn(Math.abs(e-n),1,t)/t:0,Ma=(e,t,n=15,s=40)=>{const r=wi(e.x,s,t.width-s)*n,i=wi(e.y,s,t.height-s)*n;return[r,i]},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)}),Fo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Fs=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),nn=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=Pr(e)?e.internals.positionAbsolute:zn(e,t);return{x:n,y:s,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Rs=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=Pr(e)?e.internals.positionAbsolute:zn(e,t);return{x:n,y:s,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:s+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},_a=(e,t)=>Fs(Vs(Fo(e),Fo(t))),Mn=(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)},vi=e=>Xe(e.width)&&Xe(e.height)&&Xe(e.x)&&Xe(e.y),Xe=e=>!isNaN(e)&&isFinite(e),Cs=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},Hs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Dn=({x:e,y:t},[n,s,r],i=!1,l=[1,1])=>{const c={x:(e-n)/r,y:(t-s)/r};return i?Hs(c,l):c},Pa=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s}),Lr=(e,t,n,s,r,i)=>{const l=t/(e.width*(1+i)),c=n/(e.height*(1+i)),a=Math.min(l,c),d=tn(a,s,r),x=e.x+e.width/2,p=e.y+e.height/2,m=t/2-x*d,f=n/2-p*d;return{x:m,y:f,zoom:d}},bs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function sn(e){return e!==void 0&&e!=="parent"}function mt(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 La(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 Na(e,t={width:0,height:0},n,s,r){const i={...e},l=s.get(n);if(l){const c=l.origin||r;i.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],i.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return i}function ki(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function En(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:l}=ct(e),c=Dn({x:i-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)},s),{x:a,y:d}=n?Hs(c,t):c;return{xSnapped:a,ySnapped:d,...c}}const Zs=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ta=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},P3=["INPUT","SELECT","TEXTAREA"];function Ho(e){var s,r;const t=((r=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:P3.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Aa=e=>"clientX"in e,ct=(e,t)=>{var i,l;const n=Aa(e),s=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,r=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},Mi=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:r,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/s,y:(c.top-n.top)/s,...Zs(l)}})};function Ia({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:l,targetControlY:c}){const a=e*.125+r*.375+l*.375+n*.125,d=t*.125+i*.375+c*.375+s*.125,x=Math.abs(a-e),p=Math.abs(d-t);return[a,d,x,p]}function Yn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function _i({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case X.Left:return[t-Yn(t-s,i),n];case X.Right:return[t+Yn(s-t,i),n];case X.Top:return[t,n-Yn(n-r,i)];case X.Bottom:return[t,n+Yn(r-n,i)]}}function za({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top,curvature:l=.25}){const[c,a]=_i({pos:n,x1:e,y1:t,x2:s,y2:r,c:l}),[d,x]=_i({pos:i,x1:s,y1:r,x2:e,y2:t,c:l}),[p,m,f,h]=Ia({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:c,sourceControlY:a,targetControlX:d,targetControlY:x});return[`M${e},${t} C${c},${a} ${d},${x} ${s},${r}`,p,m,f,h]}function $a({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,l=Math.abs(s-t)/2,c=s<t?s+l:s-l;return[i,c,r,l]}function L3({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:r=!1}){if(!r)return s;const i=n||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return s+(i?l:0)}function N3({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=Vs(Rs(e),Rs(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return Mn(l,Fs(i))>0}const Da=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,T3=(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)),Ba=(e,t)=>{if(!e.source||!e.target)return Cs("006",Oe.error006()),t;let n;return ba(e)?n={...e}:n={...e,id:Da(e)},T3(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},A3=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...i}=e;if(!t.source||!t.target)return Cs("006",Oe.error006()),n;if(!n.find(a=>a.id===e.id))return Cs("007",Oe.error007(r)),n;const c={...i,id:s.shouldReplaceId?Da(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==r).concat(c)};function Oa({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,l,c]=$a({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,l,c]}const Pi={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},I3=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},Li=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function z3({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:s=X.Top,center:r,offset:i}){const l=Pi[t],c=Pi[s],a={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},x=I3({source:a,sourcePosition:t,target:d}),p=x.x!==0?"x":"y",m=x[p];let f=[],h,j;const S={x:0,y:0},R={x:0,y:0},[w,E,C,P]=$a({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*c[p]===-1){h=r.x??w,j=r.y??E;const _=[{x:h,y:a.y},{x:h,y:d.y}],$=[{x:a.x,y:j},{x:d.x,y:j}];l[p]===m?f=p==="x"?_:$:f=p==="x"?$:_}else{const _=[{x:a.x,y:d.y}],$=[{x:d.x,y:a.y}];if(p==="x"?f=l.x===m?$:_:f=l.y===m?_:$,t===s){const M=Math.abs(e[p]-n[p]);if(M<=i){const y=Math.min(i-1,i-M);l[p]===m?S[p]=(a[p]>e[p]?-1:1)*y:R[p]=(d[p]>n[p]?-1:1)*y}}if(t!==s){const M=p==="x"?"y":"x",y=l[p]===c[M],k=a[M]>d[M],b=a[M]<d[M];(l[p]===1&&(!y&&k||y&&b)||l[p]!==1&&(!y&&b||y&&k))&&(f=p==="x"?_:$)}const D={x:a.x+S.x,y:a.y+S.y},B={x:d.x+R.x,y:d.y+R.y},F=Math.max(Math.abs(D.x-f[0].x),Math.abs(B.x-f[0].x)),O=Math.max(Math.abs(D.y-f[0].y),Math.abs(B.y-f[0].y));F>=O?(h=(D.x+B.x)/2,j=f[0].y):(h=f[0].x,j=(D.y+B.y)/2)}return[[e,{x:a.x+S.x,y:a.y+S.y},...f,{x:d.x+R.x,y:d.y+R.y},n],h,j,C,P]}function $3(e,t,n,s){const r=Math.min(Li(e,t)/2,Li(t,n)/2,s),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const d=e.x<n.x?-1:1,x=e.y<n.y?1:-1;return`L ${i+r*d},${l}Q ${i},${l} ${i},${l+r*x}`}const c=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${l+r*a}Q ${i},${l} ${i+r*c},${l}`}function Zo({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top,borderRadius:l=5,centerX:c,centerY:a,offset:d=20}){const[x,p,m,f,h]=z3({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:c,y:a},offset:d});return[x.reduce((S,R,w)=>{let E="";return w>0&&w<x.length-1?E=$3(x[w-1],R,x[w+1],l):E=`${w===0?"M":"L"}${R.x} ${R.y}`,S+=E,S},""),p,m,f,h]}function Ni(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function D3(e){var p;const{sourceNode:t,targetNode:n}=e;if(!Ni(t)||!Ni(n))return null;const s=t.internals.handleBounds||Ti(t.handles),r=n.internals.handleBounds||Ti(n.handles),i=Ai((s==null?void 0:s.source)??[],e.sourceHandle),l=Ai(e.connectionMode===Ot.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!i||!l)return(p=e.onError)==null||p.call(e,"008",Oe.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(i==null?void 0:i.position)||X.Bottom,a=(l==null?void 0:l.position)||X.Top,d=_n(t,i,c),x=_n(n,l,a);return{sourceX:d.x,sourceY:d.y,targetX:x.x,targetY:x.y,sourcePosition:c,targetPosition:a}}function Ti(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 _n(e,t,n=X.Left,s=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??mt(e);if(s)return{x:r+l/2,y:i+c/2};switch((t==null?void 0:t.position)??n){case X.Top:return{x:r+l/2,y:i};case X.Right:return{x:r+l,y:i+c/2};case X.Bottom:return{x:r+l/2,y:i+c};case X.Left:return{x:r,y:i+c/2}}}function Ai(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Go(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function B3(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((l,c)=>([c.markerStart||s,c.markerEnd||r].forEach(a=>{if(a&&typeof a=="object"){const d=Go(a,t);i.has(d)||(l.push({id:d,color:a.color||n,...a}),i.add(d))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const Nr={nodeOrigin:[0,0],nodeExtent:kn,elevateNodesOnSelect:!0,defaults:{}},O3={...Nr,checkEquality:!0};function Tr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function V3(e,t,n){const s=Tr(Nr,n);for(const r of e.values())if(r.parentId)Ar(r,e,t,s);else{const i=zn(r,s.nodeOrigin),l=sn(r.extent)?r.extent:s.nodeExtent,c=Vt(i,l,mt(r));r.internals.positionAbsolute=c}}function Yo(e,t,n,s){var c,a;const r=Tr(O3,s),i=new Map(t),l=r!=null&&r.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const d of e){let x=i.get(d.id);if(r.checkEquality&&d===(x==null?void 0:x.internals.userNode))t.set(d.id,x);else{const p=zn(d,r.nodeOrigin),m=sn(d.extent)?d.extent:r.nodeExtent,f=Vt(p,m,mt(d));x={...r.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(a=d.measured)==null?void 0:a.height},internals:{positionAbsolute:f,handleBounds:d.measured?x==null?void 0:x.internals.handleBounds:void 0,z:Va(d,l),userNode:d}},t.set(d.id,x)}d.parentId&&Ar(x,t,n,s)}}function F3(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 Ar(e,t,n,s){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:l}=Tr(Nr,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}F3(e,n);const d=r?1e3:0,{x,y:p,z:m}=H3(e,a,i,l,d),{positionAbsolute:f}=e.internals,h=x!==f.x||p!==f.y;(h||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x,y:p}:f,z:m}})}function Va(e,t){return(Xe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function H3(e,t,n,s,r){const{x:i,y:l}=t.internals.positionAbsolute,c=mt(e),a=zn(e,n),d=sn(e.extent)?Vt(a,e.extent,c):a;let x=Vt({x:i+d.x,y:l+d.y},s,c);e.extent==="parent"&&(x=ka(x,c,t));const p=Va(e,r),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>p?m:p}}function Ir(e,t,n,s=[0,0]){var l;const r=[],i=new Map;for(const c of e){const a=t.get(c.parentId);if(!a)continue;const d=((l=i.get(c.parentId))==null?void 0:l.expandedRect)??nn(a),x=_a(d,c.rect);i.set(c.parentId,{expandedRect:x,parent:a})}return i.size>0&&i.forEach(({expandedRect:c,parent:a},d)=>{var E;const x=a.internals.positionAbsolute,p=mt(a),m=a.origin??s,f=c.x<x.x?Math.round(Math.abs(x.x-c.x)):0,h=c.y<x.y?Math.round(Math.abs(x.y-c.y)):0,j=Math.max(p.width,Math.round(c.width)),S=Math.max(p.height,Math.round(c.height)),R=(j-p.width)*m[0],w=(S-p.height)*m[1];(f>0||h>0||R||w)&&(r.push({id:d,type:"position",position:{x:a.position.x-f+R,y:a.position.y-h+w}}),(E=n.get(d))==null||E.forEach(C=>{e.some(P=>P.id===C.id)||r.push({id:C.id,type:"position",position:{x:C.position.x+f,y:C.position.y+h}})})),(p.width<c.width||p.height<c.height||f||h)&&r.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:j+(f?m[0]*f-R:0),height:S+(h?m[1]*h-w:0)}})}),r}function Z3(e,t,n,s,r,i){const l=s==null?void 0:s.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const a=[],d=window.getComputedStyle(l),{m22:x}=new window.DOMMatrixReadOnly(d.transform),p=[];for(const m of e.values()){const f=t.get(m.id);if(!f)continue;if(f.hidden){t.set(f.id,{...f,internals:{...f.internals,handleBounds:void 0}}),c=!0;continue}const h=Zs(m.nodeElement),j=f.measured.width!==h.width||f.measured.height!==h.height;if(!!(h.width&&h.height&&(j||!f.internals.handleBounds||m.force))){const R=m.nodeElement.getBoundingClientRect(),w=sn(f.extent)?f.extent:i;let{positionAbsolute:E}=f.internals;f.parentId&&f.extent==="parent"?E=ka(E,h,t.get(f.parentId)):w&&(E=Vt(E,w,h));const C={...f,measured:h,internals:{...f.internals,positionAbsolute:E,handleBounds:{source:Mi("source",m.nodeElement,R,x,f.id),target:Mi("target",m.nodeElement,R,x,f.id)}}};t.set(f.id,C),f.parentId&&Ar(C,t,n,{nodeOrigin:r}),c=!0,j&&(a.push({id:f.id,type:"dimensions",dimensions:h}),f.expandParent&&f.parentId&&p.push({id:f.id,parentId:f.parentId,rect:nn(C,r)}))}}if(p.length>0){const m=Ir(p,t,n,r);a.push(...m)}return{changes:a,updatedInternals:c}}async function G3({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){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],[r,i]],s),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function Ii(e,t,n,s,r,i){let l=r;const c=s.get(l)||new Map;s.set(l,c.set(n,t)),l=`${r}-${e}`;const a=s.get(l)||new Map;if(s.set(l,a.set(n,t)),i){l=`${r}-${e}-${i}`;const d=s.get(l)||new Map;s.set(l,d.set(n,t))}}function Fa(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:l=null,targetHandle:c=null}=s,a={edgeId:s.id,source:r,target:i,sourceHandle:l,targetHandle:c},d=`${r}-${l}--${i}-${c}`,x=`${i}-${c}--${r}-${l}`;Ii("source",a,x,e,r,l),Ii("target",a,d,e,i,c),t.set(s.id,s)}}function Ha(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Ha(n,t):!1}function zi(e,t,n){var r;let s=e;do{if((r=s==null?void 0:s.matches)!=null&&r.call(s,t))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function Y3(e,t,n,s){const r=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!Ha(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(i);c&&r.set(i,{id:i,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 r}function ho({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var l,c,a;const r=[];for(const[d,x]of t){const p=(l=n.get(d))==null?void 0:l.internals.userNode;p&&r.push({...p,position:x.position,dragging:s})}if(!e)return[r[0],r];const i=(c=n.get(e))==null?void 0:c.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:s}:r[0],r]}function W3({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},l=0,c=new Map,a=!1,d={x:0,y:0},x=null,p=!1,m=null,f=!1;function h({noDragClassName:S,handleSelector:R,domNode:w,isSelectable:E,nodeId:C,nodeClickDistance:P=0}){m=He(w);function N({x:B,y:F},O){const{nodeLookup:M,nodeExtent:y,snapGrid:k,snapToGrid:b,nodeOrigin:L,onNodeDrag:A,onSelectionDrag:T,onError:V,updateNodePositions:H}=t();i={x:B,y:F};let G=!1,ee={x:0,y:0,x2:0,y2:0};if(c.size>1&&y){const te=$n(c);ee=Fo(te)}for(const[te,ne]of c){if(!M.has(te))continue;let se={x:B-ne.distance.x,y:F-ne.distance.y};b&&(se=Hs(se,k));let J=[[y[0][0],y[0][1]],[y[1][0],y[1][1]]];if(c.size>1&&y&&!ne.extent){const{positionAbsolute:Me}=ne.internals,de=Me.x-ee.x+y[0][0],Y=Me.x+ne.measured.width-ee.x2+y[1][0],re=Me.y-ee.y+y[0][1],pe=Me.y+ne.measured.height-ee.y2+y[1][1];J=[[de,re],[Y,pe]]}const{position:ie,positionAbsolute:fe}=va({nodeId:te,nextPosition:se,nodeLookup:M,nodeExtent:J,nodeOrigin:L,onError:V});G=G||ne.position.x!==ie.x||ne.position.y!==ie.y,ne.position=ie,ne.internals.positionAbsolute=fe}if(G&&(H(c,!0),O&&(s||A||!C&&T))){const[te,ne]=ho({nodeId:C,dragItems:c,nodeLookup:M});s==null||s(O,c,te,ne),A==null||A(O,te,ne),C||T==null||T(O,ne)}}async function _(){if(!x)return;const{transform:B,panBy:F,autoPanSpeed:O,autoPanOnNodeDrag:M}=t();if(!M){a=!1,cancelAnimationFrame(l);return}const[y,k]=Ma(d,x,O);(y!==0||k!==0)&&(i.x=(i.x??0)-y/B[2],i.y=(i.y??0)-k/B[2],await F({x:y,y:k})&&N(i,null)),l=requestAnimationFrame(_)}function $(B){var G;const{nodeLookup:F,multiSelectionActive:O,nodesDraggable:M,transform:y,snapGrid:k,snapToGrid:b,selectNodesOnDrag:L,onNodeDragStart:A,onSelectionDragStart:T,unselectNodesAndEdges:V}=t();p=!0,(!L||!E)&&!O&&C&&((G=F.get(C))!=null&&G.selected||V()),E&&L&&C&&(e==null||e(C));const H=En(B.sourceEvent,{transform:y,snapGrid:k,snapToGrid:b,containerBounds:x});if(i=H,c=Y3(F,M,H,C),c.size>0&&(n||A||!C&&T)){const[ee,te]=ho({nodeId:C,dragItems:c,nodeLookup:F});n==null||n(B.sourceEvent,c,ee,te),A==null||A(B.sourceEvent,ee,te),C||T==null||T(B.sourceEvent,te)}}const D=da().clickDistance(P).on("start",B=>{const{domNode:F,nodeDragThreshold:O,transform:M,snapGrid:y,snapToGrid:k}=t();x=(F==null?void 0:F.getBoundingClientRect())||null,f=!1,O===0&&$(B),i=En(B.sourceEvent,{transform:M,snapGrid:y,snapToGrid:k,containerBounds:x}),d=ct(B.sourceEvent,x)}).on("drag",B=>{const{autoPanOnNodeDrag:F,transform:O,snapGrid:M,snapToGrid:y,nodeDragThreshold:k,nodeLookup:b}=t(),L=En(B.sourceEvent,{transform:O,snapGrid:M,snapToGrid:y,containerBounds:x});if((B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||C&&!b.has(C))&&(f=!0),!f){if(!a&&F&&p&&(a=!0,_()),!p){const A=L.xSnapped-(i.x??0),T=L.ySnapped-(i.y??0);Math.sqrt(A*A+T*T)>k&&$(B)}(i.x!==L.xSnapped||i.y!==L.ySnapped)&&c&&p&&(d=ct(B.sourceEvent,x),N(L,B.sourceEvent))}}).on("end",B=>{if(!(!p||f)&&(a=!1,p=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:F,updateNodePositions:O,onNodeDragStop:M,onSelectionDragStop:y}=t();if(O(c,!1),r||M||!C&&y){const[k,b]=ho({nodeId:C,dragItems:c,nodeLookup:F,dragging:!1});r==null||r(B.sourceEvent,c,k,b),M==null||M(B.sourceEvent,k,b),C||y==null||y(B.sourceEvent,b)}}}).filter(B=>{const F=B.target;return!B.button&&(!S||!zi(F,`.${S}`,w))&&(!R||zi(F,R,w))});m.call(D)}function j(){m==null||m.on(".drag",null)}return{update:h,destroy:j}}function K3(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Mn(r,nn(i))>0&&s.push(i);return s}const q3=250;function X3(e,t,n,s){var c,a;let r=[],i=1/0;const l=K3(e,n,t+q3);for(const d of l){const x=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((a=d.internals.handleBounds)==null?void 0:a.target)??[]];for(const p of x){if(s.nodeId===p.nodeId&&s.type===p.type&&s.id===p.id)continue;const{x:m,y:f}=_n(d,p,p.position,!0),h=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(f-e.y,2));h>t||(h<i?(r=[{...p,x:m,y:f}],i=h):h===i&&r.push({...p,x:m,y:f}))}}if(!r.length)return null;if(r.length>1){const d=s.type==="source"?"target":"source";return r.find(x=>x.type===d)??r[0]}return r[0]}function Za(e,t,n,s,r,i=!1){var d,x,p;const l=s.get(e);if(!l)return null;const c=r==="strict"?(d=l.internals.handleBounds)==null?void 0:d[t]:[...((x=l.internals.handleBounds)==null?void 0:x.source)??[],...((p=l.internals.handleBounds)==null?void 0:p.target)??[]],a=(n?c==null?void 0:c.find(m=>m.id===n):c==null?void 0:c[0])??null;return a&&i?{...a,..._n(l,a,a.position,!0)}:a}function Ga(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function U3(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ya=()=>!0;function J3(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:l,domNode:c,nodeLookup:a,lib:d,autoPanOnConnect:x,flowId:p,panBy:m,cancelConnection:f,onConnectStart:h,onConnect:j,onConnectEnd:S,isValidConnection:R=Ya,onReconnectEnd:w,updateConnection:E,getTransform:C,getFromHandle:P,autoPanSpeed:N}){const _=Ta(e.target);let $=0,D;const{x:B,y:F}=ct(e),O=_==null?void 0:_.elementFromPoint(B,F),M=Ga(i,O),y=c==null?void 0:c.getBoundingClientRect();if(!y||!M)return;const k=Za(r,M,s,a,t);if(!k)return;let b=ct(e,y),L=!1,A=null,T=!1,V=null;function H(){if(!x||!y)return;const[fe,Me]=Ma(b,y,N);m({x:fe,y:Me}),$=requestAnimationFrame(H)}const G={...k,nodeId:r,type:M,position:k.position},ee=a.get(r),ne={inProgress:!0,isValid:null,from:_n(ee,G,X.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:ee,to:b,toHandle:null,toPosition:bi[G.position],toNode:null};E(ne);let se=ne;h==null||h(e,{nodeId:r,handleId:s,handleType:M});function J(fe){if(!P()||!G){ie(fe);return}const Me=C();b=ct(fe,y),D=X3(Dn(b,Me,!1,[1,1]),n,a,G),L||(H(),L=!0);const de=Wa(fe,{handle:D,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:l?"target":"source",isValidConnection:R,doc:_,lib:d,flowId:p,nodeLookup:a});V=de.handleDomNode,A=de.connection,T=U3(!!D,de.isValid);const Y={...se,isValid:T,to:D&&T?Pa({x:D.x,y:D.y},Me):b,toHandle:de.toHandle,toPosition:T&&de.toHandle?de.toHandle.position:bi[G.position],toNode:de.toHandle?a.get(de.toHandle.nodeId):null};T&&D&&se.toHandle&&Y.toHandle&&se.toHandle.type===Y.toHandle.type&&se.toHandle.nodeId===Y.toHandle.nodeId&&se.toHandle.id===Y.toHandle.id&&se.to.x===Y.to.x&&se.to.y===Y.to.y||(E(Y),se=Y)}function ie(fe){(D||V)&&A&&T&&(j==null||j(A));const{inProgress:Me,...de}=se,Y={...de,toPosition:se.toHandle?se.toPosition:null};S==null||S(fe,Y),i&&(w==null||w(fe,Y)),f(),cancelAnimationFrame($),L=!1,T=!1,A=null,V=null,_.removeEventListener("mousemove",J),_.removeEventListener("mouseup",ie),_.removeEventListener("touchmove",J),_.removeEventListener("touchend",ie)}_.addEventListener("mousemove",J),_.addEventListener("mouseup",ie),_.addEventListener("touchmove",J),_.addEventListener("touchend",ie)}function Wa(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:l,lib:c,flowId:a,isValidConnection:d=Ya,nodeLookup:x}){const p=i==="target",m=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:f,y:h}=ct(e),j=l.elementFromPoint(f,h),S=j!=null&&j.classList.contains(`${c}-flow__handle`)?j:m,R={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const w=Ga(void 0,S),E=S.getAttribute("data-nodeid"),C=S.getAttribute("data-handleid"),P=S.classList.contains("connectable"),N=S.classList.contains("connectableend");if(!E||!w)return R;const _={source:p?E:s,sourceHandle:p?C:r,target:p?s:E,targetHandle:p?r:C};R.connection=_;const D=P&&N&&(n===Ot.Strict?p&&w==="source"||!p&&w==="target":E!==s||C!==r);R.isValid=D&&d(_),R.toHandle=Za(E,w,C,x,n,!1)}return R}const Wo={onPointerDown:J3,isValid:Wa};function Q3({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=He(e);function i({translateExtent:c,width:a,height:d,zoomStep:x=10,pannable:p=!0,zoomable:m=!0,inversePan:f=!1}){const h=E=>{const C=n();if(E.sourceEvent.type!=="wheel"||!t)return;const P=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*x,N=C[2]*Math.pow(2,P);t.scaleTo(N)};let j=[0,0];const S=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(j=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},R=E=>{const C=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const P=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],N=[P[0]-j[0],P[1]-j[1]];j=P;const _=s()*Math.max(C[2],Math.log(C[2]))*(f?-1:1),$={x:C[0]-N[0]*_,y:C[1]-N[1]*_},D=[[0,0],[a,d]];t.setViewportConstrained({x:$.x,y:$.y,zoom:C[2]},D,c)},w=ya().on("start",S).on("zoom",p?R:null).on("zoom.wheel",m?h:null);r.call(w,{})}function l(){r.on("zoom",null)}return{update:i,destroy:l,pointer:qe}}const e5=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Gs=e=>({x:e.x,y:e.y,zoom:e.k}),go=({x:e,y:t,zoom:n})=>Os.translate(e,t).scale(n),Yt=(e,t)=>e.target.closest(`.${t}`),Ka=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),jo=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},qa=e=>{const t=e.ctrlKey&&bs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function t5({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:d}){return x=>{if(Yt(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const S=qe(x),R=qa(x),w=p*Math.pow(2,R);s.scaleTo(n,w,S,x);return}const m=x.deltaMode===1?20:1;let f=r===It.Vertical?0:x.deltaX*m,h=r===It.Horizontal?0:x.deltaY*m;!bs()&&x.shiftKey&&r!==It.Vertical&&(f=x.deltaY*m,h=0),s.translateBy(n,-(f/p)*i,-(h/p)*i,{internal:!0});const j=Gs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(x,j)),e.isPanScrolling&&(a==null||a(x,j),e.panScrollTimeout=setTimeout(()=>{d==null||d(x,j),e.isPanScrolling=!1},150))}}function n5({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){if(!t&&s.type==="wheel"&&!s.ctrlKey||Yt(s,e))return null;s.preventDefault(),n.call(this,s,r)}}function s5({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var i,l,c;if((i=s.sourceEvent)!=null&&i.internal)return;const r=Gs(s.transform);e.mouseButton=((l=s.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((c=s.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,r))}}function o5({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{var l,c;e.usedRightMouseButton=!!(n&&Ka(t,e.mouseButton??0)),(l=i.sourceEvent)!=null&&l.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!((c=i.sourceEvent)!=null&&c.internal)&&(r==null||r(i.sourceEvent,Gs(i.transform)))}}function r5({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,i&&Ka(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),r&&e5(e.prevViewport,l.transform))){const a=Gs(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(l.sourceEvent,a)},n?150:0)}}}function i5({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:c,noPanClassName:a,lib:d}){return x=>{var h;const p=e||t,m=n&&x.ctrlKey;if(x.button===1&&x.type==="mousedown"&&(Yt(x,`${d}-flow__node`)||Yt(x,`${d}-flow__edge`)))return!0;if(!s&&!p&&!r&&!i&&!n||l||Yt(x,c)&&x.type==="wheel"||Yt(x,a)&&(x.type!=="wheel"||r&&x.type==="wheel"&&!e)||!n&&x.ctrlKey&&x.type==="wheel")return!1;if(!n&&x.type==="touchstart"&&((h=x.touches)==null?void 0:h.length)>1)return x.preventDefault(),!1;if(!p&&!r&&!m&&x.type==="wheel"||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const f=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||x.type==="wheel")&&f}}function l5({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:r,viewport:i,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:a,onDraggingChange:d}){const x={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),m=ya().clickDistance(!Xe(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(r),f=He(e).call(m);E({x:i.x,y:i.y,zoom:tn(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const h=f.on("wheel.zoom"),j=f.on("dblclick.zoom");m.wheelDelta(qa);function S(O,M){return f?new Promise(y=>{m==null||m.transform(jo(f,M==null?void 0:M.duration,()=>y(!0)),O)}):Promise.resolve(!1)}function R({noWheelClassName:O,noPanClassName:M,onPaneContextMenu:y,userSelectionActive:k,panOnScroll:b,panOnDrag:L,panOnScrollMode:A,panOnScrollSpeed:T,preventScrolling:V,zoomOnPinch:H,zoomOnScroll:G,zoomOnDoubleClick:ee,zoomActivationKeyPressed:te,lib:ne,onTransformChange:se}){k&&!x.isZoomingOrPanning&&w();const ie=b&&!te&&!k?t5({zoomPanValues:x,noWheelClassName:O,d3Selection:f,d3Zoom:m,panOnScrollMode:A,panOnScrollSpeed:T,zoomOnPinch:H,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):n5({noWheelClassName:O,preventScrolling:V,d3ZoomHandler:h});if(f.on("wheel.zoom",ie,{passive:!1}),!k){const Me=s5({zoomPanValues:x,onDraggingChange:d,onPanZoomStart:c});m.on("start",Me);const de=o5({zoomPanValues:x,panOnDrag:L,onPaneContextMenu:!!y,onPanZoom:l,onTransformChange:se});m.on("zoom",de);const Y=r5({zoomPanValues:x,panOnDrag:L,panOnScroll:b,onPaneContextMenu:y,onPanZoomEnd:a,onDraggingChange:d});m.on("end",Y)}const fe=i5({zoomActivationKeyPressed:te,panOnDrag:L,zoomOnScroll:G,panOnScroll:b,zoomOnDoubleClick:ee,zoomOnPinch:H,userSelectionActive:k,noPanClassName:M,noWheelClassName:O,lib:ne});m.filter(fe),ee?f.on("dblclick.zoom",j):f.on("dblclick.zoom",null)}function w(){m.on("zoom",null)}async function E(O,M,y){const k=go(O),b=m==null?void 0:m.constrain()(k,M,y);return b&&await S(b),new Promise(L=>L(b))}async function C(O,M){const y=go(O);return await S(y,M),new Promise(k=>k(y))}function P(O){if(f){const M=go(O),y=f.property("__zoom");(y.k!==O.zoom||y.x!==O.x||y.y!==O.y)&&(m==null||m.transform(f,M,null,{sync:!0}))}}function N(){const O=f?Ea(f.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}function _(O,M){return f?new Promise(y=>{m==null||m.scaleTo(jo(f,M==null?void 0:M.duration,()=>y(!0)),O)}):Promise.resolve(!1)}function $(O,M){return f?new Promise(y=>{m==null||m.scaleBy(jo(f,M==null?void 0:M.duration,()=>y(!0)),O)}):Promise.resolve(!1)}function D(O){m==null||m.scaleExtent(O)}function B(O){m==null||m.translateExtent(O)}function F(O){const M=!Xe(O)||O<0?0:O;m==null||m.clickDistance(M)}return{update:R,destroy:w,setViewport:C,setViewportConstrained:E,getViewport:N,scaleTo:_,scaleBy:$,setScaleExtent:D,setTranslateExtent:B,syncViewport:P,setClickDistance:F}}var yn;(function(e){e.Line="line",e.Handle="handle"})(yn||(yn={}));function c5({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const l=e-t,c=n-s,a=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&r&&(a[0]=a[0]*-1),c&&i&&(a[1]=a[1]*-1),a}function a5(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function ht(e,t){return Math.max(0,t-e)}function gt(e,t){return Math.max(0,e-t)}function Wn(e,t,n){return Math.max(0,t-e,e-n)}function $i(e,t){return e?!t:t}function u5(e,t,n,s,r,i,l,c){let{affectsX:a,affectsY:d}=t;const{isHorizontal:x,isVertical:p}=t,m=x&&p,{xSnapped:f,ySnapped:h}=n,{minWidth:j,maxWidth:S,minHeight:R,maxHeight:w}=s,{x:E,y:C,width:P,height:N,aspectRatio:_}=e;let $=Math.floor(x?f-e.pointerX:0),D=Math.floor(p?h-e.pointerY:0);const B=P+(a?-$:$),F=N+(d?-D:D),O=-i[0]*P,M=-i[1]*N;let y=Wn(B,j,S),k=Wn(F,R,w);if(l){let A=0,T=0;a&&$<0?A=ht(E+$+O,l[0][0]):!a&&$>0&&(A=gt(E+B+O,l[1][0])),d&&D<0?T=ht(C+D+M,l[0][1]):!d&&D>0&&(T=gt(C+F+M,l[1][1])),y=Math.max(y,A),k=Math.max(k,T)}if(c){let A=0,T=0;a&&$>0?A=gt(E+$,c[0][0]):!a&&$<0&&(A=ht(E+B,c[1][0])),d&&D>0?T=gt(C+D,c[0][1]):!d&&D<0&&(T=ht(C+F,c[1][1])),y=Math.max(y,A),k=Math.max(k,T)}if(r){if(x){const A=Wn(B/_,R,w)*_;if(y=Math.max(y,A),l){let T=0;!a&&!d||a&&!d&&m?T=gt(C+M+B/_,l[1][1])*_:T=ht(C+M+(a?$:-$)/_,l[0][1])*_,y=Math.max(y,T)}if(c){let T=0;!a&&!d||a&&!d&&m?T=ht(C+B/_,c[1][1])*_:T=gt(C+(a?$:-$)/_,c[0][1])*_,y=Math.max(y,T)}}if(p){const A=Wn(F*_,j,S)/_;if(k=Math.max(k,A),l){let T=0;!a&&!d||d&&!a&&m?T=gt(E+F*_+O,l[1][0])/_:T=ht(E+(d?D:-D)*_+O,l[0][0])/_,k=Math.max(k,T)}if(c){let T=0;!a&&!d||d&&!a&&m?T=ht(E+F*_,c[1][0])/_:T=gt(E+(d?D:-D)*_,c[0][0])/_,k=Math.max(k,T)}}}D=D+(D<0?k:-k),$=$+($<0?y:-y),r&&(m?B>F*_?D=($i(a,d)?-$:$)/_:$=($i(a,d)?-D:D)*_:x?(D=$/_,d=a):($=D*_,a=d));const b=a?E+$:E,L=d?C+D:C;return{width:P+(a?-$:$),height:N+(d?-D:D),x:i[0]*$*(a?-1:1)+b,y:i[1]*D*(d?-1:1)+L}}const Xa={width:0,height:0,x:0,y:0},d5={...Xa,pointerX:0,pointerY:0,aspectRatio:1};function x5(e){return[[0,0],[e.measured.width,e.measured.height]]}function p5(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,c=n[0]*i,a=n[1]*l;return[[s-c,r-a],[s+i-c,r+l-a]]}function m5({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=He(e);function l({controlPosition:a,boundaries:d,keepAspectRatio:x,onResizeStart:p,onResize:m,onResizeEnd:f,shouldResize:h}){let j={...Xa},S={...d5};const R=a5(a);let w,E=null,C=[],P,N,_;const $=da().on("start",D=>{const{nodeLookup:B,transform:F,snapGrid:O,snapToGrid:M,nodeOrigin:y,paneDomNode:k}=n();if(w=B.get(t),!w)return;E=(k==null?void 0:k.getBoundingClientRect())??null;const{xSnapped:b,ySnapped:L}=En(D.sourceEvent,{transform:F,snapGrid:O,snapToGrid:M,containerBounds:E});j={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},S={...j,pointerX:b,pointerY:L,aspectRatio:j.width/j.height},P=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(P=B.get(w.parentId),N=P&&w.extent==="parent"?x5(P):void 0),C=[],_=void 0;for(const[A,T]of B)if(T.parentId===t&&(C.push({id:A,position:{...T.position},extent:T.extent}),T.extent==="parent"||T.expandParent)){const V=p5(T,w,T.origin??y);_?_=[[Math.min(V[0][0],_[0][0]),Math.min(V[0][1],_[0][1])],[Math.max(V[1][0],_[1][0]),Math.max(V[1][1],_[1][1])]]:_=V}p==null||p(D,{...j})}).on("drag",D=>{const{transform:B,snapGrid:F,snapToGrid:O,nodeOrigin:M}=n(),y=En(D.sourceEvent,{transform:B,snapGrid:F,snapToGrid:O,containerBounds:E}),k=[];if(!w)return;const{x:b,y:L,width:A,height:T}=j,V={},H=w.origin??M,{width:G,height:ee,x:te,y:ne}=u5(S,R,y,d,x,H,N,_),se=G!==A,J=ee!==T,ie=te!==b&&se,fe=ne!==L&&J;if(!ie&&!fe&&!se&&!J)return;if((ie||fe||H[0]===1||H[1]===1)&&(V.x=ie?te:j.x,V.y=fe?ne:j.y,j.x=V.x,j.y=V.y,C.length>0)){const re=te-b,pe=ne-L;for(const Pe of C)Pe.position={x:Pe.position.x-re+H[0]*(G-A),y:Pe.position.y-pe+H[1]*(ee-T)},k.push(Pe)}if((se||J)&&(V.width=se?G:j.width,V.height=J?ee:j.height,j.width=V.width,j.height=V.height),P&&w.expandParent){const re=H[0]*(V.width??0);V.x&&V.x<re&&(j.x=re,S.x=S.x-(V.x-re));const pe=H[1]*(V.height??0);V.y&&V.y<pe&&(j.y=pe,S.y=S.y-(V.y-pe))}const Me=c5({width:j.width,prevWidth:A,height:j.height,prevHeight:T,affectsX:R.affectsX,affectsY:R.affectsY}),de={...j,direction:Me};(h==null?void 0:h(D,de))!==!1&&(m==null||m(D,de),s(V,k))}).on("end",D=>{f==null||f(D,{...j}),r==null||r()});i.call($)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var Kn={exports:{}},Eo={},qn={exports:{}},yo={};/**
|
|
1
|
+
"use strict";var uf=Object.defineProperty;var df=(e,t,n)=>t in e?uf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var et=(e,t,n)=>df(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-UYeBbnYT.cjs"),g=require("react"),Z=require("./Divider-MIbyu5ZH.cjs"),d=require("./css-CU7tous7.cjs"),Jn=require("./external-BQtPGUNg.cjs"),le=require("./state-BKyv_jWZ.cjs"),xf=require("./Pack-BbwDtaE6.cjs"),je=require("./external-CKvBpFrE.cjs"),oe=require("./Space-NNqCWFbg.cjs"),Ie=require("./hooks-BKLtEDxx.cjs"),pf=require("./useVirtualCursorDragWebKit-BLtwRQY7.cjs"),Q=require("./Provider-DdzMK2ly.cjs"),mf=require("./external-BTGfIw_K.cjs"),Ne=require("./external-DrwngojV.cjs"),jl=require("./external-AOOzgEKd.cjs"),vs=require("./WithIcon-CJvuPkSy.cjs"),_e=require("./toArray-DRKOku1s.cjs"),ff=require("./external-CRbERCqd.cjs"),Nn=require("./external-BCMlN9UI.cjs"),he=require("./Toggle-BzORI5sE.cjs"),ut=require("./Text-BpgvgYm9.cjs"),io=require("./aggregator-Dd6-VUPG.cjs"),Re=require("./Text-Kq93-h4G.cjs"),qt=require("./provider-BaehOXWw.cjs"),I=require("./value-C_xE_NRc.cjs"),xe=require("./Haul-CoG7Jmz6.cjs"),Te=require("./useMemoCompare-ONEAVO05.cjs"),qr=require("./dimensions-IEzi7AOM.cjs"),qo=require("./font-DshP3AG2.cjs"),Ye=require("./Dropdown-DurKTABg.cjs"),Be=require("./deep-BjupBYvk.cjs"),ce=require("zod"),We=require("./external-CSKJSiQJ.cjs"),ks=require("./Pack-CzZzxA2R.cjs"),Ct=require("./ContextMenu-BWGS1vXl.cjs"),hf=require("./Text-D1GKnp9s.cjs"),El=require("./external-BJulb-Hm.cjs");require("./Item-Dj7cQJ8t.cjs");const Xo=require("react-dom"),bt=require("./external-D3IjVlS7.cjs"),yl=require("./units-CvIf5nF_.cjs"),Sl=require("./useClickOutside-EJHWO4Q9.cjs"),Uo=require("./useDebouncedCallback-CVLx7N1s.cjs"),gf=require("./external-DhX0dZoF.cjs"),Xr=require("./eraser-BsY8Ilvt.cjs"),wo=require("./DateTime-DUuYjZr8.cjs"),jf=require("./external-BmbDPHD3.cjs"),Ef=require("./Video-BJudMCoc.cjs"),yf=(e,t,n=150)=>{const[s,r]=g.useState(e);return g.useEffect(()=>{const i=setTimeout(()=>r(t),n);return()=>clearTimeout(i)},[t,n]),s},Sf=Object.freeze(Object.defineProperty({__proto__:null,Config:he.Config,Dialog:he.Dialog,chooseLocation:he.chooseLocation,formatTip:he.formatTip,useConfig:he.useConfig,wrap:he.wrap},Symbol.toStringTag,{value:"Module"})),Jo=({ref:e,location:t,style:n,size:s,className:r,children:i,onDragStart:l,sizeUnits:c="px",showHandle:a=!0,...u})=>{const x=d.K.construct(t),p=d.K.direction(x),m=d.g.dimension(p);return o.jsxRuntimeExports.jsxs("div",{className:d.CSS(d.CSS.B("resize"),d.CSS.loc(x),d.CSS.dir(p),r),style:{[m]:`${s}${c}`,...n},ref:e,...u,children:[i,a&&o.jsxRuntimeExports.jsx("div",{draggable:!0,className:d.CSS(d.CSS.BE("resize","handle"),d.CSS.bordered(d.K.swap(x))),onDragStart:l,onDrag:je.preventDefault,onDragEnd:je.preventDefault})]})},Qo=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:r="x"})=>{const i=g.useRef(null),[l,c]=g.useState({sizeDistribution:Rf(n,t),root:null}),a=g.useCallback((p,m,f)=>{if(i.current==null)return;const h=d.Mo.dim(d.Mo.construct(i.current),r);c(j=>co(j,h,p,s,m,f))},[s,c,r]);g.useEffect(()=>e==null?void 0:e(l.sizeDistribution),[l.sizeDistribution,e]);const u=g.useCallback((p,m)=>{p.preventDefault();const f=r==="x"?"clientX":"clientY",h=S=>a(m,S[f]),j=()=>{c(S=>({...S,root:null})),document.removeEventListener("mousemove",h)};c(S=>({...S,root:p[f]})),document.addEventListener("mousemove",h),document.addEventListener("mouseup",j,{once:!0})},[c,r,co]);return{setSize:g.useCallback((p,m)=>a(p,void 0,m),[co]),props:{direction:r,sizeDistribution:l.sizeDistribution,onDragHandle:u,ref:i}}},er=({ref:e,direction:t="x",children:n,sizeDistribution:s,onDragHandle:r,className:i,...l})=>{const c=d.g.construct(t),a=g.Children.toArray(n);return s=Cf(s),o.jsxRuntimeExports.jsx(oe.Space,{...l,ref:e,direction:c,className:d.CSS(d.CSS.B("resize-multiple"),i),empty:!0,grow:!0,children:a.map((u,x)=>o.jsxRuntimeExports.jsx(Jo,{onDragStart:p=>r(p,x),location:d.g.location(c),size:s[x]*100,sizeUnits:"%",showHandle:x!==a.length-1,children:u},x))})},Rf=(e,t)=>{const n=e.reduce((r,i)=>r+i,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(r=>r/n);if(e.every(r=>r<=1)){const r=1-n;return[...e,...Array(s).fill(r/s)]}return e.map(()=>1/t)},lo=.001,Cf=e=>e.every(t=>d.G$1.closeTo(t,1/e.length),lo)?e.map((t,n)=>n%2===0?t+lo:n===e.length-1?t:t-lo):e,co=(e,t,n,s,r,i)=>{const l=Rl(e,t,n,r,i),[c,a]=bf(e.sizeDistribution,n,l,s/t),u=a?r??null:e.root;return{...e,sizeDistribution:c,root:u}},Rl=(e,t,n,s,r)=>{let i;if(r!=null)r>1&&(r/=t),i=r-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},bf=(e,t,n,s)=>{let r=t;for(;r>0&&e[r]+n<=s;)r--;const i=e[r]+n,l=wf(r,e,s,n),c=e[l]-n;return i<s||c<s?[e,!1]:[e.map((a,u)=>u===r?i:u===l?c:a),!0]},wf=(e,t,n,s)=>(e===t.length-1?kf:vf)(e,t,n,s),vf=(e,t,n,s)=>{let r=e+1;for(;r<t.length-1&&t[r]-s<=n;)r++;return r},kf=(e,t,n,s)=>{let r=e-1;for(;r>0&&t[r]-s<=n;)r--;return r},ao=2,Cl=({onCollapse:e,onResize:t,location:n="left",minSize:s=100,maxSize:r=1/0,initialSize:i=200,collapseThreshold:l=1/0,className:c,...a})=>{const[u,x]=g.useState(d.Y(i,s,r)),p=g.useRef(null),m=d.K.construct(n),f=g.useCallback(E=>{if(p.current===null)return 0;const C=d.Mo.dim(E,d.K.direction(m),!0)*(1-2*Number(["bottom","right"].includes(m))),P=p.current+C,N=d.Y(P,s,r);return(N-P)/s>l?ao:N},[m,s,r,l]),h=g.useRef(null),j=g.useCallback(E=>{const C=f(E);x(C),h.current!=null&&(t==null||t(C,d.Mo.construct(h.current)))},[t,f]),S=g.useCallback(()=>x(E=>(p.current=E,E)),[x]),R=g.useCallback(E=>f(E)===ao&&(e==null?void 0:e()),[e,f]);g.useEffect(()=>x(E=>{const C=d.Y(E,s,r);return p.current=C,C}),[s,r]);const w=We.useCursorDrag({onMove:j,onStart:S,onEnd:R});return o.jsxRuntimeExports.jsx(Jo,{ref:h,location:m,size:u,onDragStart:w,className:d.clsx(c,d.CSS.expanded(u!==ao)),...a})},Mf=Object.freeze(Object.defineProperty({__proto__:null,Core:Jo,Multiple:er,Single:Cl,calculateDiffPercentage:Rl,useMultiple:Qo},Symbol.toStringTag,{value:"Module"})),Qn="y",Ur=28,_f=32,Pf=40,Lf=.5,Nf=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:r,...i}}=Qo({direction:Qn,count:e.length,minSize:Ur}),l=c=>{if(r.current==null)return;const a=d.Mo.dim(d.Mo.construct(r.current),Qn);s[c]<Pf/a?n(c,e[c].initialSize??Lf):n(c,Ur+1)};return o.jsxRuntimeExports.jsx(er,{empty:!0,className:d.CSS.B("accordion"),sizeDistribution:s,ref:r,...t,...i,children:e.map((c,a)=>g.createElement(If,{...c,key:c.key,index:a,direction:Qn,onExpand:l,parent:r,size:s[a]}))})},Tf=o.jsxRuntimeExports.jsx(Z.E4.Caret.Down,{"aria-label":"contract"}),Af=o.jsxRuntimeExports.jsx(Z.E4.Caret.Right,{"aria-label":"expand"}),If=({index:e,name:t,content:n,actions:s,size:r,parent:i,onExpand:l})=>{let c=!0;if(i.current!=null){const u=d.Mo.dim(d.Mo.construct(i.current),Qn);c=r*u>_f}const a=c?Tf:Af;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(Jn.Header,{level:"p",className:d.CSS.expanded(c),empty:!0,children:[o.jsxRuntimeExports.jsx(Jn.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&o.jsxRuntimeExports.jsx(Jn.Actions,{children:s})]}),n]})},zf=Object.freeze(Object.defineProperty({__proto__:null,Accordion:Nf},Symbol.toStringTag,{value:"Module"})),$f=(e,t)=>_e.A(e).map(s=>typeof s=="string"?s.split(t).map(r=>({label:r})):s).flat(),bl=({segments:e,shade:t,level:n,weight:s,separator:r,transform:i})=>{let c=$f(e,r);return i!=null&&(c=c.map(i)),c.map(({label:a,icon:u,href:x,...p},m)=>{const f=[o.jsxRuntimeExports.jsx(Z.E4.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:d.CSS.shade(t)}},`${a}-${m}`)];if(u!=null){const j=Ne.resolve(u);j!=null&&f.push(j)}const h={weight:s,shade:t,level:n,style:{marginLeft:u!=null?"0.5rem":"0"},children:a,...p};return x!=null?f.push(o.jsxRuntimeExports.jsx(jl.Link,{...h,href:x},a)):f.push(o.jsxRuntimeExports.jsx(Z.Text,{...h},a)),f}).flat()},wl=({children:e,icon:t,shade:n=7,weight:s,size:r=.5,url:i,level:l="p",separator:c=".",className:a,hideFirst:u=!0,...x})=>{i!=null&&(e=i);const p=bl({segments:e,separator:c,shade:n,level:l,weight:s});return u&&p.shift(),o.jsxRuntimeExports.jsxs(vs.WithIcon,{className:d.CSS(a,d.CSS.B("breadcrumb"),u&&d.CSS.M("hide-first")),level:l,shade:n,weight:s,size:r,direction:"x",...x,children:[Ne.resolve(t),...p]})},Df=({url:e,className:t,level:n="p",separator:s="/",weight:r,shade:i=7})=>{const l=bl({segments:e,separator:s,shade:i,level:n,weight:r,transform:(c,a)=>({...c,label:c.label.split("-").map(u=>d.d.capitalize(u)).join(" "),href:`/${e.split(s).slice(0,a+1).join("/")}`})});return o.jsxRuntimeExports.jsx(oe.Space,{className:d.CSS(t,d.CSS.B("breadcrumb"),d.CSS.BM("breadcrumb","url")),direction:"x",size:"small",align:"center",children:l})},Bf=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:wl,URL:Df},Symbol.toStringTag,{value:"Module"})),vl=({variant:e="info",...t})=>o.jsxRuntimeExports.jsx(Z.E4.Circle,{color:Re.variantColors[e],...t}),Of=({action:e})=>g.isValidElement(e)?e:g.createElement(he.Button,{...e,key:e.key}),Vf=({status:{key:e,time:t,count:n,message:s,description:r,variant:i},silence:l,actions:c,className:a,children:u,...x})=>o.jsxRuntimeExports.jsxs(oe.Space,{className:d.CSS(d.CSS.B("notification"),a),direction:"y",empty:!0,...x,children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",size:"small",children:[o.jsxRuntimeExports.jsx(vl,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),o.jsxRuntimeExports.jsx(Z.Text,{level:"small",shade:7,children:`x${n}`}),o.jsxRuntimeExports.jsx(wo.DateTime,{className:d.CSS(d.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),o.jsxRuntimeExports.jsx(he.Icon,{className:d.CSS(d.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:o.jsxRuntimeExports.jsx(Z.E4.Close,{})})]}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",align:"start",className:d.CSS(d.CSS.BE("notification","content")),size:"small",children:[u??o.jsxRuntimeExports.jsx(Z.Text,{className:d.CSS(d.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),r!=null&&o.jsxRuntimeExports.jsx(Z.Text,{className:d.CSS(d.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),c!=null&&o.jsxRuntimeExports.jsx(oe.Space,{direction:"x",align:"center",justify:"end",className:d.CSS(d.CSS.BE("notification","actions")),children:_e.A(c).map(p=>o.jsxRuntimeExports.jsx(Of,{action:p},p.key))})]},t.toString()),Ff=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:Re.Aggregator,Circle:vl,Notification:Vf,Text:Re.Text,VARIANTS:io.VARIANTS,specZ:io.specZ,useAdder:Re.useAdder,useErrorHandler:Re.useErrorHandler,useNotifications:Re.useNotifications,variantColors:Re.variantColors,variantZ:io.variantZ},Symbol.toStringTag,{value:"Module"})),tr=({aetherKey:e})=>{const[,{region:t},n]=Q.use$1({aetherKey:e,type:Xr.Eraser.TYPE,schema:Xr.eraserStateZ,initialState:{region:d.Mo.ZERO,enabled:!0}}),s=Z.useSyncedRef(t),r=g.useCallback(l=>{d.Mo.equals(l,s.current)||n(c=>({...c,region:l}))},[n]);return{setEnabled:g.useCallback(l=>n(c=>({...c,enabled:l})),[n]),erase:r}},Hf=({aetherKey:e,children:t})=>{const{erase:n}=tr({aetherKey:e}),s=Ye.useResize(n);return o.jsxRuntimeExports.jsx("div",{ref:s,className:d.CSS(d.CSS.inheritDims()),children:t})},Zf=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Hf,use:tr},Symbol.toStringTag,{value:"Module"})),Gf=({items:e,initialKey:t})=>{const[n,s]=g.useState(t),r=l=>s(l===n?void 0:l),i=e.find(l=>l.key===n);return{onSelect:r,activeItem:i}},Yf=({activeItem:e,children:t,onSelect:n,location:s="left",collapseThreshold:r=.65,className:i,onResize:l,...c})=>{const a=d.K.direction(s),u=g.useCallback(()=>e!=null&&(n==null?void 0:n(e.key)),[n,e==null?void 0:e.key]),{erase:x,setEnabled:p}=tr({}),m=g.useCallback((w,E)=>{l==null||l(w,E),x(E)},[l,x]);if(g.useLayoutEffect(()=>{p(e!=null)},[e,p]),e==null)return null;const{content:f,key:h,minSize:j,maxSize:S,initialSize:R}=e;return o.jsxRuntimeExports.jsx(Cl,{className:d.CSS(d.CSS.BE("navdrawer","content"),d.CSS.dir(a),i),collapseThreshold:r,onCollapse:u,location:s,onResize:m,minSize:j,maxSize:S,initialSize:R,...c,children:f},h)},Wf=Object.freeze(Object.defineProperty({__proto__:null,Bar:je.Bar,Drawer:Yf,useDrawer:Gf},Symbol.toStringTag,{value:"Module"})),kl=g.createContext(I.ZERO_CONTEXT_VALUE),Ml=()=>g.use(kl),Ke=()=>Ml().synnax,Kf=()=>Ml().state,Jr={connected:"success",connecting:"info",disconnected:"info",failed:"error"},_l="serverVersionMismatch",qf=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Pl=({children:e,connParams:t})=>{const[n,s,r]=Z.useCombinedStateAndRef(I.ZERO_CONTEXT_VALUE),[{path:i},,l]=Q.use$1({type:I.Provider.TYPE,schema:I.Provider.stateZ,initialState:{props:t??null,state:null}}),c=Re.useAdder(),a=g.useCallback(u=>{r.current.state.status!==u.status&&c({variant:Jr[u.status],message:u.message??d.d.capitalize(u.status)}),s(x=>({...x,state:u}))},[c]);return Q.useAsyncEffect(async()=>{if(n.synnax!=null&&n.synnax.close(),t==null)return s(I.ZERO_CONTEXT_VALUE);const u=new qt.bg({...t,connectivityPollFrequency:qt.S.seconds(5)});s({synnax:u,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:u.clientVersion}});const x=await u.connectivity.check();if(s({synnax:u,state:x}),c({variant:Jr[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||le.oe.semVerOlder(x.nodeVersion,x.clientVersion),m=qf(p,x.clientVersion,x.nodeVersion);c({variant:"warning",message:"Incompatible cluster version",description:m,data:{type:_l,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return u.connectivity.onChange(a),l({props:t,state:x}),()=>{u.close(),s(I.ZERO_CONTEXT_VALUE),l({props:null,state:null})}},[t,a]),o.jsxRuntimeExports.jsx(kl,{value:n,children:o.jsxRuntimeExports.jsx(Q.Composite,{path:i,children:e})})},Xf=Object.freeze(Object.defineProperty({__proto__:null,Provider:Pl,SERVER_VERSION_MISMATCH:_l,use:Ke,useConnectionState:Kf},Symbol.toStringTag,{value:"Module"})),Ll=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),on=()=>g.use(Ll),Nl=e=>on().aliases[e]??null,Ms=()=>on().aliases,_s=(e,t="")=>{const{getName:n}=on(),[s,r]=g.useState(t);return Q.useAsyncEffect(async()=>{const i=await n(e);r(i)},[e,n]),s??t},nr=()=>on().activeRange??void 0,Tl=({activeRange:e,children:t})=>{const n=Ke(),[s,r]=g.useState({}),i=g.useCallback(a=>{r(u=>{const x={...u};return a.forEach(({variant:p,key:m,value:f})=>{const h=Number(m.split("---")[1]);p==="delete"?delete x[h]:x[f.channel]=f.alias}),x})},[r]),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 Q.useAsyncEffect(async()=>{if(n==null||e==null){r({});return}const a=await n.ranges.retrieve(e),u=await a.listAliases();r(u);const x=await a.openAliasTracker(),p=x.onChange(i);return()=>{p(),x.close()}},[n,e]),o.jsxRuntimeExports.jsx(Ll,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},Uf=({channelKey:e,value:t,shadow:n,className:s,...r})=>{const[i,l]=g.useState(!1),{setAlias:c}=on(),a=Nl(e),u=_s(e);let x=o.jsxRuntimeExports.jsx(Z.E4.Rename,{});i?x=o.jsxRuntimeExports.jsx(Z.E4.Loading,{}):a===t&&(x=o.jsxRuntimeExports.jsx(Z.E4.Check,{}));const p=c!=null&&!i&&a!==t&&e!==0,m=Re.useErrorHandler(),f=()=>{p&&m(async()=>{l(!0),await c(e,t),l(!1)},"Failed to set channel alias")},h=()=>{var S;a!=null&&((S=r.onChange)==null||S.call(r,a))},j=()=>e===0?o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Alias synced with this label"}):o.jsxRuntimeExports.jsxs(Z.Text,{level:"small",children:["Sync alias for ",u," with this label"]});return o.jsxRuntimeExports.jsxs(ut.Text,{value:t,...r,children:[p&&o.jsxRuntimeExports.jsx(he.Icon,{onClick:h,tooltip:o.jsxRuntimeExports.jsxs(Z.Text,{level:"small",children:["Set ",u," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:o.jsxRuntimeExports.jsx(Z.E4.Sync,{})}),o.jsxRuntimeExports.jsx(he.Icon,{onClick:f,disabled:!p,tooltip:o.jsxRuntimeExports.jsx(j,{}),tooltipLocation:{y:"top"},variant:"outlined",children:x})]})},tt="channel";var Qr=180/Math.PI,vo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Al(e,t,n,s,r,i){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:r,translateY:i,rotate:Math.atan2(t,e)*Qr,skewX:Math.atan(a)*Qr,scaleX:l,scaleY:c}}var Fn;function Jf(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?vo:Al(t.a,t.b,t.c,t.d,t.e,t.f)}function Qf(e){return e==null||(Fn||(Fn=document.createElementNS("http://www.w3.org/2000/svg","g")),Fn.setAttribute("transform",e),!(e=Fn.transform.baseVal.consolidate()))?vo:(e=e.matrix,Al(e.a,e.b,e.c,e.d,e.e,e.f))}function Il(e,t,n,s){function r(u){return u.length?u.pop()+" ":""}function i(u,x,p,m,f,h){if(u!==p||x!==m){var j=f.push("translate(",null,t,null,n);h.push({i:j-4,x:I.interpolateNumber(u,p)},{i:j-2,x:I.interpolateNumber(x,m)})}else(p||m)&&f.push("translate("+p+t+m+n)}function l(u,x,p,m){u!==x?(u-x>180?x+=360:x-u>180&&(u+=360),m.push({i:p.push(r(p)+"rotate(",null,s)-2,x:I.interpolateNumber(u,x)})):x&&p.push(r(p)+"rotate("+x+s)}function c(u,x,p,m){u!==x?m.push({i:p.push(r(p)+"skewX(",null,s)-2,x:I.interpolateNumber(u,x)}):x&&p.push(r(p)+"skewX("+x+s)}function a(u,x,p,m,f,h){if(u!==p||x!==m){var j=f.push(r(f)+"scale(",null,",",null,")");h.push({i:j-4,x:I.interpolateNumber(u,p)},{i:j-2,x:I.interpolateNumber(x,m)})}else(p!==1||m!==1)&&f.push(r(f)+"scale("+p+","+m+")")}return function(u,x){var p=[],m=[];return u=e(u),x=e(x),i(u.translateX,u.translateY,x.translateX,x.translateY,p,m),l(u.rotate,x.rotate,p,m),c(u.skewX,x.skewX,p,m),a(u.scaleX,u.scaleY,x.scaleX,x.scaleY,p,m),u=x=null,function(f){for(var h=-1,j=m.length,S;++h<j;)p[(S=m[h]).i]=S.x(f);return p.join("")}}}var eh=Il(Jf,"px, ","px)","deg)"),th=Il(Qf,", ",")",")"),nh=1e-12;function ei(e){return((e=Math.exp(e))+1/e)/2}function sh(e){return((e=Math.exp(e))-1/e)/2}function oh(e){return((e=Math.exp(2*e))-1)/(e+1)}const rh=function e(t,n,s){function r(i,l){var c=i[0],a=i[1],u=i[2],x=l[0],p=l[1],m=l[2],f=x-c,h=p-a,j=f*f+h*h,S,R;if(j<nh)R=Math.log(m/u)/t,S=function(_){return[c+_*f,a+_*h,u*Math.exp(t*_*R)]};else{var w=Math.sqrt(j),E=(m*m-u*u+s*j)/(2*u*n*w),C=(m*m-u*u-s*j)/(2*m*n*w),P=Math.log(Math.sqrt(E*E+1)-E),N=Math.log(Math.sqrt(C*C+1)-C);R=(N-P)/t,S=function(_){var $=_*R,D=ei(P),B=u/(n*w)*(D*oh(t*$+P)-sh(P));return[c+B*f,a+B*h,u*D/ei(t*$+P)]}}return S.duration=R*1e3*t/Math.SQRT2,S}return r.rho=function(i){var l=Math.max(.001,+i),c=l*l,a=c*c;return e(l,c,a)},r}(Math.SQRT2,2,4),ih=Object.freeze(Object.defineProperty({__proto__:null,Canvas:I.Canvas,axisStateZ:I.axisStateZ,newTickFactory:I.newTickFactory,tickFactoryProps:I.tickFactoryProps,tickType:I.tickType},Symbol.toStringTag,{value:"Module"})),lh={region:d.Mo.ZERO,dpr:1,os:le.S.getOS()},ch={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},ah=({children:e,resizeDebounce:t=100,className:n,...s})=>{const[{path:r},{bootstrapped:i,dpr:l},c]=Q.use$1({type:I.Canvas$1.TYPE,schema:I.canvasStateZ,initialState:lh}),a=g.useRef({...ch}),u=g.useRef(!1),x=g.useCallback(j=>{a.current.bootstrapped&&(c(()=>({bootstrapped:!0,region:j,dpr:window.devicePixelRatio,os:le.S.getOS({default:"Windows"})})),u.current=!0)},[c]),p=g.useRef(null),m=Ye.useResize(x,{debounce:t}),f=Z.useCombinedRefs(p,m);g.useEffect(()=>{const j=()=>{window.devicePixelRatio===l||!a.current.bootstrapped||p.current==null||c(S=>({...S,region:d.Mo.construct(p.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",j,{once:!0})},[l]),g.useEffect(()=>{const j=()=>{!a.current.bootstrapped||p.current==null||c(S=>({...S,region:d.Mo.construct(p.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",j),window.addEventListener("blur",j)},[c]);const h=g.useCallback(j=>{if(j==null)return;j.className.includes("gl")?a.current.gl=j:j.className.includes("upper2d")?a.current.upper2d=j:a.current.lower2d=j;const{gl:S,lower2d:R,upper2d:w,bootstrapped:E}=a.current;if(S==null||R==null||w==null||E)return;a.current.bootstrapped=!0;const C=S.transferControlToOffscreen(),P=w.transferControlToOffscreen(),N=R.transferControlToOffscreen();c({glCanvas:C,upper2dCanvas:P,lower2dCanvas:N,bootstrap:!0,bootstrapped:!1,region:d.Mo.construct(S),dpr:window.devicePixelRatio,os:le.S.getOS({default:"Windows"})},[C,P,N])},[c]);return o.jsxRuntimeExports.jsxs("div",{ref:f,className:d.CSS(d.CSS.B("canvas-container"),n),...s,children:[o.jsxRuntimeExports.jsx("canvas",{ref:h,className:d.CSS(d.CSS.B("canvas"),d.CSS.BM("canvas","lower2d"))}),o.jsxRuntimeExports.jsx("canvas",{ref:h,className:d.CSS(d.CSS.B("canvas"),d.CSS.BM("canvas","gl"))}),o.jsxRuntimeExports.jsx("canvas",{ref:h,className:d.CSS(d.CSS.B("canvas"),d.CSS.BM("canvas","upper2d"))}),o.jsxRuntimeExports.jsx(Q.Composite,{path:r,children:i&&e})]})},Tn=(e,t)=>Ye.useResize(g.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(d.b.XY.translate(d.G.scale(d.Mo.topLeft(r),-1)).box(n),s)},[e]),t),uh=Object.freeze(Object.defineProperty({__proto__:null,Canvas:ah,useRegion:Tn},Symbol.toStringTag,{value:"Module"})),zl=g.createContext(null),nt=e=>{const t=g.use(zl);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},$l=e=>{const t=nt("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},An=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=nt(t),{key:r}=e;return Q.useEffectCompare(()=>{d.K.outer.parse(e.loc),n(e)},([c],[a])=>Be.I.equal(c,a),[e]),g.useEffect(()=>()=>s(r),[]),{gridArea:d.g.swap(d.K.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},Dl=({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=d.G.ZERO,children:r,hold:i=!1,onHold:l,visible:c,...a})=>{const[u,x]=g.useState([]),p=Te.useMemoDeepEqualProps({clearOverScan:s,hold:i,visible:c}),[{path:m},{grid:f},h]=Q.use$1({aetherKey:e,type:I.LinePlot.TYPE,schema:I.linePlotStateZ,initialState:{container:d.Mo.ZERO,viewport:d.Mo.DECIMAL,grid:{},...p}});g.useEffect(()=>h(O=>({...O,...p})),[p]);const j=g.useRef(new Map),S=g.useCallback(O=>(j.current.set(O,null),()=>j.current.delete(O)),[j]),R=g.useCallback(O=>{const{mode:M,box:y,stage:k}=O;(M==="pan"&&k!=="start"||M==="zoom"||M==="zoomReset"&&k==="start")&&h(b=>({...b,viewport:y})),j.current.forEach((b,L)=>L(O))},[h]),w=g.useCallback(O=>h(M=>({...M,container:O})),[h]),E=Tn(w,{debounce:n}),C=g.useCallback(O=>h(M=>({...M,grid:{...M.grid,[O.key]:O}})),[h]),P=g.useCallback(O=>h(M=>{const{[O]:y,...k}=M.grid;return{...M,grid:k}}),[h]),N=g.useCallback(O=>{x(M=>[...M.filter(({key:y})=>y!==O.key),O])},[x,R]),_=g.useCallback(O=>x(M=>M.filter(({key:y})=>y!==O)),[N]),$=g.useMemo(()=>dh(f),[f]),D=g.useCallback(O=>{h(M=>({...M,hold:O})),l==null||l(O)},[h,l]),B=`line-plot-${e}`,F=g.useMemo(()=>({lines:u,setGridEntry:C,removeGridEntry:P,setLine:N,removeLine:_,setViewport:R,addViewportHandler:S,setHold:D,id:B}),[B,u,C,P,N,_,R,S,D]);return o.jsxRuntimeExports.jsx("div",{id:B,className:d.CSS.B("line-plot"),style:{...t,...$},ref:E,...a,children:o.jsxRuntimeExports.jsx(zl,{value:F,children:o.jsxRuntimeExports.jsx(Q.Composite,{path:m,children:r})})})},dh=e=>{const t=d.CSS.newGridBuilder();return I.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)"),I.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),I.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)"),I.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},sr=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?I.XAxis.TYPE:I.YAxis.TYPE,s=`${e}-axis`,r=({aetherKey:i,children:l,location:c=t,label:a="",labelLevel:u="small",labelDirection:x=e,onLabelChange:p,color:m,labelSize:f,showGrid:h,type:j,bounds:S,className:R,tickSpacing:w,autoBounds:E,autoBoundUpdateInterval:C,onAutoBoundsChange:P,style:N,..._})=>{const $=((a==null?void 0:a.length)??0)>0,D=Q.useUniqueKey(i),B=Te.useMemoDeepEqualProps({location:c,showGrid:h,type:j,bounds:S,label:a,labelDirection:x,tickSpacing:w,autoBounds:E,autoBoundUpdateInterval:C}),[{path:F},{size:O,labelSize:M,...y},k]=Q.use$1({aetherKey:D,type:n,schema:I.coreAxisStateZ,initialState:B});g.useEffect(()=>k(T=>({...T,...B})),[B]),g.useEffect(()=>{const{lower:T,upper:V}=I.parseAutoBounds(y.autoBounds);y.bounds!=null&&(T&&(S==null?void 0:S.lower)!==y.bounds.lower||V&&(S==null?void 0:S.upper)!==y.bounds.upper)&&(P==null||P(y.bounds))},[y.autoBounds,y.bounds]);const b=An({loc:c,key:`${n}-${D}`,size:O+M,order:1},`${e.toUpperCase()}Axis`),L=qo.useTypography(u).toString(),A=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(a==null)return;let V=qr.dimensions(a,L)[d.g.dimension(d.g.construct(x))];V>0&&(V+=9),k(H=>({...H,labelSize:V}))}else{let V=qr.dimensions(a,L).height*1.3;V>0&&(V+=12);const H=A.current;I.withinSizeThreshold(H,V)||(A.current=V,k(G=>({...G,labelSize:V})))}},[a,x,L]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(oe.Space,{className:d.CSS(R,d.CSS.B("axis"),d.CSS.B(s),d.CSS.loc(c)),style:{...N,...b},align:"center",justify:c!=="left"?"end":"start",direction:d.g.swap(e),..._,children:$&&o.jsxRuntimeExports.jsx(Z.MaybeEditable,{className:d.CSS(d.CSS.BE("axis","label"),d.CSS.dir(x)),value:a,onChange:p,level:u})}),o.jsxRuntimeExports.jsx(Q.Composite,{path:F,children:l})]})};return r.displayName=`${e.toUpperCase()}Axis`,r},Bl=sr("x"),Ol=sr("y"),Vl=d.G.xy.extend({root:d.K.corner,units:ce.z.object({x:ce.z.enum(["px","decimal"]),y:ce.z.enum(["px","decimal"])})}),xh=Vl.partial({root:!0,units:!0}),ph=e=>{var n,s,r,i;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[((r=e.root)==null?void 0:r.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},mh=(e,t)=>{var i,l,c,a,u,x;const n={x:e.x,y:e.y};if(t.current==null)return n;const s=d.Mo.construct(t.current),r=d.Mo.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.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+d.Mo.width(s))/d.Mo.width(r):n.x/=d.Mo.width(r),((a=e.units)==null?void 0:a.y)==="decimal"?((u=e.root)==null?void 0:u.y)==="bottom"&&(n.y=1-e.y):((x=e.root)==null?void 0:x.y)==="bottom"?n.y=1-(e.y+d.Mo.height(s))/d.Mo.height(r):n.y/=d.Mo.height(r),n},Fl=(e,t)=>{if(t.current==null)return null;const n=d.Mo.construct(t.current.parentElement),s=d.Mo.construct(t.current),r={x:e.x,y:e.y,root:{...d.K.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*d.Mo.width(n)-d.Mo.width(s),r.root.x="right"):e.x<.2?r.x=e.x*d.Mo.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*d.Mo.height(n)-d.Mo.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*d.Mo.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...d.G.truncate(r,3)}},ti=d.Mo.reRoot(d.Mo.DECIMAL,d.K.TOP_LEFT),or=g.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,...i})=>{const[l,c]=le.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:d.K.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),a=g.useRef(l),u=Z.useSyncedRef(r===!1),x=g.useRef(null);l!==null&&(s={...s,...ph(l)});const p=g.useCallback(f=>{var C;if(((C=x.current)==null?void 0:C.parentElement)==null)return a.current;const h=d.Mo.construct(x.current.parentElement),j=d.b.XY.scale(h).scale(ti),S=j.box(d.Mo.construct(x.current)),R=d.b.XY.clamp(d.Mo.construct(d.Mo.topLeft(ti),{width:1-d.Mo.width(S),height:1-d.Mo.height(S)})),w=d.G.translate(d.G.construct(a.current),d.Mo.signedDims(j.box(f))),E=R.pos(w);return Fl(E,x)},[]),m=We.useCursorDrag({onStart:g.useCallback(()=>{a.current=mh(a.current,x)},[]),onMove:g.useCallback(f=>{if(u.current)return;const h=p(f);h!==null&&c(h)},[]),onEnd:g.useCallback(f=>{if(u.current)return;const h=p(f);h!==null&&(a.current=h)},[])});return o.jsxRuntimeExports.jsx(oe.Space,{className:d.CSS(e,d.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:m,draggable:r,ref:x,...i,onDrag:je.preventDefault,onDragEnd:je.preventDefault,empty:!0})});or.displayName="Legend.Container";const rr=(e,t,n)=>e.sort((s,r)=>s.label.localeCompare(r.label)).map(({key:s,color:r,label:i})=>o.jsxRuntimeExports.jsxs(oe.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[o.jsxRuntimeExports.jsx(We.Swatch,{value:r,onChange:l=>t==null?void 0:t({key:s,color:l,label:i}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"tiny"}),o.jsxRuntimeExports.jsx(Z.MaybeEditable,{level:"small",value:i,onChange:l=>t==null?void 0:t({key:s,color:r,label:l}),noWrap:!0})]},s)),ir=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...r})=>{const[i,l]=g.useState(!1);return e.length===0?null:o.jsxRuntimeExports.jsx(or,{...r,draggable:!i,value:n,onChange:s,children:rr(e,t,l)})},fh=Object.freeze(Object.defineProperty({__proto__:null,Container:or,Simple:ir,calcStickyPos:Fl,completeStickyXYz:Vl,legendSwatches:rr,stickyXYz:xh},Symbol.toStringTag,{value:"Module"})),lr=g.memo(({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=nt("Legend");return nt("Legend"),o.jsxRuntimeExports.jsx(ir,{data:r,onEntryChange:n,...s})});lr.displayName="FloatingLegend";const hh=({onLineChange:e})=>{const{lines:t}=nt("Legend"),n=Q.useUniqueKey(),s=An({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return o.jsxRuntimeExports.jsx(oe.Space,{className:d.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:rr(t,e)})},Hl=({variant:e="floating",...t})=>e==="floating"?o.jsxRuntimeExports.jsx(lr,{...t}):o.jsxRuntimeExports.jsx(hh,{...t}),cr=g.memo(({aetherKey:e,...t})=>(Q.useUnidirectional({aetherKey:e,type:I.Line.TYPE,schema:I.stateZ,state:t}),null));cr.displayName="Line";const gh=Object.freeze(Object.defineProperty({__proto__:null,Line:cr},Symbol.toStringTag,{value:"Module"})),ar=({aetherKey:e,color:t,label:n="",...s})=>{const r=Q.useUniqueKey(e),{setLine:i,removeLine:l}=nt("Line");return g.useEffect(()=>(i({key:r,color:t,label:n}),()=>l(r)),[n,t]),o.jsxRuntimeExports.jsx(cr,{aetherKey:r,color:t,label:n,...s})},Zl=({level:e="h2",...t})=>{const n=Q.useUniqueKey(),s=qo.useTypography(e),r=An({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return o.jsxRuntimeExports.jsx(oe.Space,{justify:"center",align:"center",style:r,children:o.jsxRuntimeExports.jsx(Z.MaybeEditable,{...t,level:e})})},Gl=({aetherKey:e,...t})=>{const n=Q.useUniqueKey(e),[,,s]=Q.use$1({aetherKey:n,type:I.Tooltip.TYPE,schema:I.tooltipStateZ,initialState:{position:null,...t}}),r=g.useRef(null),i=g.useCallback(c=>{const a=document.querySelector(".pluto-canvas-container");if(a==null)return;const u=d.Mo.topLeft(a);s({position:d.G.translation(u,d.G.construct(c))})},[s]),l=g.useCallback(()=>s({position:null}),[s]);return g.useEffect(()=>{if(r.current===null)return;const c=r.current.parentElement;if(c!=null)return c.addEventListener("mousemove",i),c.addEventListener("mouseleave",l),()=>{c.removeEventListener("mousemove",i),c.removeEventListener("mouseleave",l)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:r})},jh=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Gl},Symbol.toStringTag,{value:"Module"})),Eh={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Yl=({className:e,mode:t,maskBox:n,children:s,style:r,...i})=>o.jsxRuntimeExports.jsxs("div",{className:d.CSS(d.CSS.noSelect,d.CSS.BE("viewport-mask","container"),e),style:{cursor:Eh[t],...r},...i,children:[o.jsxRuntimeExports.jsx("div",{style:{...d.Mo.css(n),display:d.Mo.areaIsZero(n)?"none":"block"},className:d.CSS.BE("viewport-mask","selection")}),s]}),yh=[],ur=({data:e,emptyContent:t,value:n,onChange:s,allowMultiple:r,allowNone:i,hideColumnHeader:l=!1,columns:c=yh,visible:a,itemHeight:u=Re.Column.itemHeight,listItem:x=he.componentRenderProp(Re.Column.Item),replaceOnSingle:p,omit:m,autoSelectOnNone:f,trigger:h,extraDialogContent:j,variant:S="connected",...R})=>{let w=o.jsxRuntimeExports.jsxs(Re.Hover,{disabled:!a,children:[j,o.jsxRuntimeExports.jsx(Re.Column.Header,{hide:l||x!=null,columns:c,children:o.jsxRuntimeExports.jsx(Re.Core.Virtual,{itemHeight:u,children:x})})]});return S!=="connected"&&(w=o.jsxRuntimeExports.jsx(ks.Pack,{direction:"y",borderShade:4,className:d.CSS.B("select-dialog-content"),children:w})),o.jsxRuntimeExports.jsx(Re.List,{data:e,emptyContent:t,omit:m,children:o.jsxRuntimeExports.jsx(Re.Selector,{value:n,onChange:s,allowMultiple:r,allowNone:i,replaceOnSingle:p,autoSelectOnNone:f,children:o.jsxRuntimeExports.jsxs(Ye.Dialog,{visible:a,className:d.CSS.B("select"),keepMounted:!1,variant:S,...R,children:[h,w]})})})},ot=({children:e=Sh,value:t,onChange:n,entryRenderKey:s="key",allowNone:r=!1,allowMultiple:i=!1,data:l,replaceOnSingle:c,className:a,size:u="small",actions:x,pack:p=!0,variant:m,...f})=>{const{onSelect:h}=Re.useSelect({allowMultiple:i,allowNone:r,replaceOnSingle:c,data:l,value:t,onChange:n}),j=R=>{m!=="preview"&&h(R)},S=l==null?void 0:l.map(R=>e({key:R.key,onClick:()=>j(R.key),size:u,selected:R.key===t,entry:R,title:R[s]}));return p?o.jsxRuntimeExports.jsxs(ks.Pack,{borderShade:4,className:d.CSS(d.CSS.B("select-button"),a),size:u,...f,children:[S,x]}):o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:S})},Sh=({key:e,onClick:t,selected:n,title:s})=>o.jsxRuntimeExports.jsx(he.Button,{onClick:t,variant:n?"filled":"outlined",size:"small",children:s},e),Wl=({selected:e,renderKey:t,toggle:n,visible:s,children:r,...i})=>o.jsxRuntimeExports.jsx(he.Button,{className:d.CSS.B("select-dropdown-button"),onClick:n,variant:"outlined",endIcon:o.jsxRuntimeExports.jsx(Nn.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:s}),...i,children:r??(e==null?void 0:e[t])}),Kl=he.componentRenderProp(Wl),Ps=({data:e,value:t,columns:n=[],children:s=Kl,entryRenderKey:r="key",allowNone:i=!1,onChange:l,disabled:c,hideColumnHeader:a=!0,variant:u,dropdownVariant:x,...p})=>{const{close:m,visible:f,toggle:h}=Ye.use(),[j,S]=g.useState((e==null?void 0:e.find(E=>E.key===t))??null);g.useEffect(()=>{S((e==null?void 0:e.find(E=>E.key===t))??null)},[e,t]);const R=g.useCallback((E,C)=>{if(!(Array.isArray(E)||E===null)){if(m(),E==null)return S(null),l(t);S(C.entries[0]),l(E)}},[l,t,m,S]),w={selected:j,renderKey:r,toggle:h,visible:f,disabled:c};return u!=null&&(w.variant=u),o.jsxRuntimeExports.jsx(ur,{close:m,data:e,visible:f,value:t,onChange:R,allowMultiple:!1,allowNone:i,columns:n,hideColumnHeader:a,variant:x,trigger:o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:s(w)}),...p})},Rh=[{key:"start",icon:o.jsxRuntimeExports.jsx(Z.E4.TextAlign.Left,{})},{key:"center",icon:o.jsxRuntimeExports.jsx(Z.E4.TextAlign.Center,{})},{key:"end",icon:o.jsxRuntimeExports.jsx(Z.E4.TextAlign.Right,{})}],Ch=({key:e,entry:t,onClick:n,selected:s})=>o.jsxRuntimeExports.jsx(he.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),Ls=({children:e=Ch,...t})=>o.jsxRuntimeExports.jsx(ot,{...t,allowMultiple:!1,data:Rh,children:e}),bh=[{key:"large",label:"L"},{key:"medium",label:"M"},{key:"small",label:"S"}],ql=e=>o.jsxRuntimeExports.jsx(ot,{...e,data:bh,entryRenderKey:"label"}),wh=new Set([le.g$1.UUID,le.g$1.JSON]),Xl=le.g$1.ALL.filter(e=>e!==le.g$1.UNKNOWN).map(e=>({key:e.toString(),name:wh.has(e)?e.toString().toUpperCase():d.d.capitalize(e.toString())})),vh=Xl.filter(e=>!new le.g$1(e.key).isVariable),kh=[{key:"name",name:"Name"}],Mh=({hideVariableDensity:e=!1,...t})=>o.jsxRuntimeExports.jsx(Ps,{...t,data:e?vh:Xl,columns:kh,entryRenderKey:"name"}),_h=[{key:"x",icon:o.jsxRuntimeExports.jsx(Z.E4.Arrow.Right,{})},{key:"y",icon:o.jsxRuntimeExports.jsx(Z.E4.Arrow.Up,{})}],Ph=[{key:"x",icon:o.jsxRuntimeExports.jsx(Z.E4.Arrow.Right,{})},{key:"y",icon:o.jsxRuntimeExports.jsx(Z.E4.Arrow.Down,{})}],Lh=({key:e,entry:t,onClick:n,selected:s})=>o.jsxRuntimeExports.jsx(he.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),Ul=({children:e=Lh,yDirection:t="up",...n})=>o.jsxRuntimeExports.jsx(ot,{...n,allowMultiple:!1,data:t==="up"?_h:Ph,children:e}),Jl=e=>o.jsxRuntimeExports.jsx(he.Icon,{className:d.CSS.BE("select","clear"),variant:"outlined",...e,children:o.jsxRuntimeExports.jsx(Z.E4.Close,{"aria-label":"clear"})}),dt=({onChange:e,value:t,entryRenderKey:n="key",data:s,inputProps:r,allowNone:i=!0,searcher:l,className:c,variant:a="button",hideColumnHeader:u=!1,disabled:x,children:p,dropdownVariant:m="connected",placeholder:f=Ns,inputPlaceholder:h=f,triggerTooltip:j,dropdownZIndex:S,filter:R,actions:w,...E})=>{const{visible:C,open:P,close:N,toggle:_}=Ye.use(),[$,D]=g.useState(null),B=l!=null;Q.useAsyncEffect(async()=>{if(Re.selectValueIsZero(t))return D(null);if(($==null?void 0:$.key)===t)return;let k=null;if(B)try{[k]=await l.retrieve([t])}finally{k??(k=null)}else s!=null&&(k=s.find(b=>b.key===t)??null);D(k)},[l,t,s]);const F=g.useCallback((k,b)=>{Array.isArray(k)||(D(k==null?null:b.entries[0]),N(),e(k,b))},[e,i]),O=g.useMemo(()=>B?bt.Search:bt.Filter,[B]),M=o.jsxRuntimeExports.jsx(O,{searcher:l,filter:R,children:({onChange:k})=>o.jsxRuntimeExports.jsx(Nh,{...r,autoFocus:m==="modal",variant:a,onChange:k,onFocus:P,selected:$,entryRenderKey:n,visible:C,allowNone:i,className:c,dropdownVariant:m,disabled:x,placeholder:h,children:w})}),y=o.jsxRuntimeExports.jsx(he.Button,{tooltip:j,variant:"outlined",onClick:_,disabled:x,children:$!=null?Ql(n,$):f});return o.jsxRuntimeExports.jsx(ur,{close:N,zIndex:S,data:s,allowMultiple:!1,visible:C,value:t,hideColumnHeader:u,onChange:F,allowNone:i,listItem:p,variant:m,trigger:m!=="modal"?M:y,extraDialogContent:m==="modal"?M:void 0,keepMounted:!1,...E})},Ns="Select",Ql=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Nh=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:r,allowNone:i=!0,placeholder:l=Ns,className:c,disabled:a,dropdownVariant:u,children:x,...p})=>{const{clear:m}=Re.useSelectionUtils(),[f,h]=g.useState("");g.useEffect(()=>{if(!n){if(le.w(t==null?void 0:t.key))return h("");t!=null&&h(Ql(e,t))}},[t,n,e]);const j=C=>{s(C),h(C)},S=()=>{f===""&&s(""),h(""),r==null||r()},R=C=>{n||(C.preventDefault(),r==null||r())},w=()=>{h(""),m==null||m()};let E;return u!=="modal"&&(E=o.jsxRuntimeExports.jsx(Nn.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n})),o.jsxRuntimeExports.jsxs(ut.Text,{className:d.CSS(d.CSS.BE("select","input"),c),value:f,onChange:j,onFocus:S,onKeyDown:Ie.matchCallback([["Enter"]],C=>{C.preventDefault(),!n&&(r==null||r())}),endContent:E,style:{flexGrow:1},onClick:R,placeholder:l,disabled:a,...p,children:[x,i&&o.jsxRuntimeExports.jsx(Jl,{onClick:w,disabled:a})]})},Rn=({children:e="",size:t="medium",color:n,icon:s,onClose:r,className:i,onDragStart:l,...c})=>{const a=d.cssString(n);s==null&&n!=null&&(s=o.jsxRuntimeExports.jsx(Z.E4.Circle,{fill:a}));const u=r==null?void 0:o.jsxRuntimeExports.jsx(he.Icon,{"aria-label":"close",size:"small",className:d.CSS.BE("tag","close"),onClick:x=>{x.stopPropagation(),r()},children:o.jsxRuntimeExports.jsx(Z.E4.Close,{})});return o.jsxRuntimeExports.jsx(vs.WithIcon,{startIcon:s,endIcon:u,className:d.CSS(i,d.CSS.B("tag"),r!=null&&d.CSS.BM("tag","closeable")),level:le.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:l,...c,children:e})},Th=Object.freeze(Object.defineProperty({__proto__:null,Tag:Rn},Symbol.toStringTag,{value:"Module"})),dr=({entryKey:e,entryRenderKey:t,entry:n,loading:s,...r})=>{let i=e;return n!=null&&(i=typeof t=="function"?t(n):n[t]),g.createElement(Rn,{size:"small",variant:"outlined",className:d.CSS(n==null&&!s&&d.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},le.ne(i))},Ah=he.componentRenderProp(dr),rn=({onChange:e,value:t,className:n,data:s,columns:r=[],entryRenderKey:i="key",emptyContent:l,searcher:c,renderTag:a=Ah,placeholder:u,onTagDragStart:x,allowMultiple:p,allowNone:m,replaceOnSingle:f,onTagDragEnd:h,style:j,addPlaceholder:S="Add",children:R,dropdownVariant:w="connected",actions:E,...C})=>{const{visible:P,open:N,close:_}=Ye.use(),[$,D]=g.useState([]),[B,F]=g.useState(!1),O=c!=null;Q.useAsyncEffect(async()=>{F(!0),Re.selectValueIsZero(t)&&D([]);const L=$.map(V=>V.key),A=_e.A(t);if(le.F.unorderedPrimitiveArrays(L,A)===le.F.EQUAL)return;let T=[];if(O)try{T=await c.retrieve(A)}finally{F(!1)}else s!=null&&(T=s.filter(V=>A.includes(V.key)));D(T)},[c,O,t,s]);const M=g.useCallback((L,A)=>{L!=null&&(D(A.entries),e(_e.A(L),A))},[e]),y=g.useMemo(()=>O?bt.Search:bt.Filter,[O]);let k,b;if(w==="connected")b=o.jsxRuntimeExports.jsx(y,{searcher:c,children:({onChange:L,value:A})=>o.jsxRuntimeExports.jsx(Ih,{dropdownVariant:w,value:A,selectedKeys:t,className:n,onChange:L,loading:B,selected:$,onFocus:N,entryRenderKey:i,visible:P,renderTag:a,placeholder:u,onTagDragStart:x,onTagDragEnd:h,style:j,children:E})});else{const L=_e.A(t);b=o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",grow:!0,style:j,size:"small",children:[L.map(A=>{const T=$.find(V=>V.key===A);return a({key:A,entryKey:A,entryRenderKey:i,loading:B,entry:T,onClose:()=>{const V=L.filter(H=>H!==A);e(V,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:V=>x==null?void 0:x(V,A),onDragEnd:V=>h==null?void 0:h(V,A)})}),L.length>0?o.jsxRuntimeExports.jsx(he.Icon,{onClick:N,children:o.jsxRuntimeExports.jsx(Z.E4.Add,{style:{color:"var(--pluto-gray-l7)"}})}):o.jsxRuntimeExports.jsx(he.Button,{onClick:N,shade:7,startIcon:o.jsxRuntimeExports.jsx(Z.E4.Add,{}),variant:"text",children:S})]}),k=o.jsxRuntimeExports.jsx(y,{searcher:c,children:A=>o.jsxRuntimeExports.jsx(ut.Text,{autoFocus:!0,placeholder:"Search",...A,children:E})})}return o.jsxRuntimeExports.jsx(ur,{close:_,data:s,emptyContent:l,visible:P,value:t,onChange:M,allowNone:m,replaceOnSingle:f,columns:r,allowMultiple:!0,listItem:R,trigger:b,extraDialogContent:k,variant:w,...C})},Ih=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:r,visible:i,entryRenderKey:l,renderTag:c,placeholder:a=Ns,onTagDragStart:u,onTagDragEnd:x,value:p,className:m,children:f,dropdownVariant:h,...j})=>{const{onSelect:S,clear:R}=Re.useSelectionUtils(),w=g.useRef(null);g.useLayoutEffect(()=>{var _;i&&((_=w.current)==null||_.focus())},[i,n]);const E=()=>{i||s(""),r==null||r()},C=()=>{i||r==null||r()},P=()=>{i||s("")};let N;return h!=="modal"&&(N=o.jsxRuntimeExports.jsx(Nn.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:i})),o.jsxRuntimeExports.jsxs(ut.Text,{ref:w,className:d.CSS(d.CSS.BE("select-multiple","input"),d.CSS.visible(i),m),onBlur:P,placeholder:a,value:p,onChange:s,onFocus:E,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:C,endContent:N,variant:"button",...j,children:[o.jsxRuntimeExports.jsx(oe.Space,{direction:"x",className:d.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:_e.A(e).map(_=>{const $=n.find(D=>D.key===_);return c({key:_,entryKey:_,entryRenderKey:l,loading:t,entry:$,onClose:()=>S==null?void 0:S(_),onDragStart:D=>u==null?void 0:u(D,_),onDragEnd:D=>x==null?void 0:x(D,_)})})}),f,o.jsxRuntimeExports.jsx(Jl,{onClick:R})]})},zh=[{key:"h2",label:"XL"},{key:"h3",label:"L"},{key:"h4",label:"M"},{key:"h5",label:"S"},{key:"small",label:"XS"}],ln=e=>o.jsxRuntimeExports.jsx(ot,{...e,data:zh,entryRenderKey:"label"}),$h=[{key:600,label:"Bold"},{key:500,label:"Medium"},{key:400,label:"Normal"},{key:250,label:"Light"}],ec=e=>o.jsxRuntimeExports.jsx(ot,{...e,data:$h,entryRenderKey:"label"}),Dh=Object.freeze(Object.defineProperty({__proto__:null,Level:ln,Weight:ec},Symbol.toStringTag,{value:"Module"})),Bh=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Wl,Button:ot,ComponentSize:ql,DEFAULT_PLACEHOLDER:Ns,DataType:Mh,Direction:Ul,DropdownButton:Ps,Multiple:rn,MultipleTag:dr,Single:dt,Text:Dh,TextAlignment:Ls,defaultButton:Kl},Symbol.toStringTag,{value:"Module"})),es=6,Oh=2,ni=5,Vh=e=>d.Mo.width(e)<ni&&d.Mo.height(e)<ni,Fh=["zoom","pan","select","zoomReset"],jn=[...Fh,"click"],Hh=ce.z.enum(jn),tc=["zoom","select"],ts={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},nc={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},sc={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},xr={zoom:ts,pan:nc,select:sc,zoomReset:ts,click:ts},Zh=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},Gh=d.Mo.construct(0,0,1,1,d.K.TOP_LEFT),Yh={width:30,height:50},oc=({onChange:e,triggers:t,initial:n=Gh,threshold:s=Yh,ref:r})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[l,c]=g.useState(d.Mo.ZERO),[a,u]=g.useState(i),[x,p]=Z.useStateRef(n),m=g.useRef(d.G.ZERO),f=g.useRef(null),h=d._.construct(s);g.useEffect(()=>p(()=>d.Mo.truncate(n,es)),[n]),g.useEffect(()=>u(i),[i]);const[j,S,R,w]=Te.useMemoCompare(()=>{const $={...xr[i],...t},D=Ie.flattenConfig($),B=Zh($);return[$,D,B,Ie.flattenConfig(B)]},Ie.compareModeConfigs,[t]),E=g.useCallback(({box:$,triggers:D,stage:B,cursor:F})=>{if(f.current==null)return;const O=Ie.determineMode(j,D),M=d.Mo.construct(f.current);if(O==null)return;if(O==="zoomReset")return c(d.Mo.ZERO),e==null||e({box:d.Mo.DECIMAL,mode:O,stage:B,cursor:F}),p(d.Mo.DECIMAL);const y=Vh($);if(B==="end"){if(y){O==="zoom"&&c(d.Mo.ZERO),e==null||e({box:x.current,mode:"click",stage:B,cursor:F});return}return p(b=>{if(O==="pan"){const A=si($,b,M);return A===null||d.Mo.equals(A,b)?b:(e==null||e({box:A,mode:O,stage:B,cursor:F}),A)}const L=C($,b,M);return L===null?b:(e==null||e({box:L,mode:O,stage:B,cursor:F}),O==="zoom"?(c(d.Mo.ZERO),L):d.Mo.truncate(b,es))})}if(tc.includes(O))return y?void 0:c(d.b.XY.scale(M).clamp(M).translate({x:-d.Mo.left(M),y:-d.Mo.top(M)}).box(oi(h,$,M)));if(c(b=>d.Mo.areaIsZero(b)?b:d.Mo.ZERO),d.G.distance(F,m.current)<Oh)return;m.current=F;const k=si($,x.current,M);e==null||e({box:k,mode:O,stage:B,cursor:F})},[c,u,e,j,s.height,s.width,p,f]);g.useImperativeHandle(r,()=>({reset:()=>{c(d.Mo.ZERO),p(d.Mo.DECIMAL),e==null||e({box:d.Mo.DECIMAL,mode:"zoomReset",stage:"start",cursor:d.G.ZERO})}}),[e]);const C=g.useCallback(($,D,B)=>d.Mo.truncate(ko(D,B).box(oi(h,$,B)),es),[s]),P=Ie.useHeldRef({triggers:[["Control"]]}),N=Ie.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const $=D=>{if(f.current==null)return;let B=1;D.deltaY<0?B-=.035:B+=.035;const F=d.Mo.construct(f.current),O=d.G.construct(D);if(Array.from(f.current.children).push(f.current),!d.Mo.contains(F,O)||f.current!==D.target&&Ye.findParent(D.target,A=>A===f.current)==null)return;const k=ko(x.current,d.Mo.construct(f.current)).pos(d.G.construct(D));let L=d.b.XY.magnify({x:P.current.held?1:B,y:N.current.held?1:B}).box(x.current);L=d.Mo.translate(L,{x:P.current.held?0:k.x*(1-B),y:N.current.held?0:k.y*(1-B)}),p(L),e==null||e({stage:"end",box:L,cursor:d.G.construct(D),mode:"zoom"})};return window.addEventListener("wheel",$),()=>window.removeEventListener("wheel",$)},[p,e]),El.useDrag({bound:f,onDrag:E,triggers:S,loose:!0});const _=g.useCallback(({triggers:$,stage:D})=>{if(D==="end")return u(i);const B=Ie.determineMode(R,$);B!=null&&u(B)},[R,i,e]);return Ie.use({triggers:w,callback:_,region:f}),{maskBox:l,ref:f,mode:a}},ko=(e,t)=>d.b.XY.scale(t).clamp(t).scale(e),si=(e,t,n)=>{let s=d.Mo.signedDims(ko(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},d.Mo.truncate(d.b.XY.translate(d.G.construct(s)).box(t),es)},oi=(e,t,n)=>d.Mo.height(t)<=e.height?d.Mo.construct(d.Mo.left(t),d.Mo.top(n),d.Mo.width(t),d.Mo.height(n)):d.Mo.width(t)<=e.width?d.Mo.construct(d.Mo.left(n),d.Mo.top(t),d.Mo.width(n),d.Mo.height(t)):t,Wh=({mode:e,triggers:t})=>o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",children:[o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:d.d.capitalize(e)}),o.jsxRuntimeExports.jsx(oe.Space,{empty:!0,direction:"x",align:"center",children:o.jsxRuntimeExports.jsx(hf.Text,{trigger:t[0],level:"small"})})]}),Kh={zoom:o.jsxRuntimeExports.jsx(Z.E4.Zoom,{}),pan:o.jsxRuntimeExports.jsx(Z.E4.Pan,{}),select:o.jsxRuntimeExports.jsx(Z.E4.Selection,{}),zoomReset:o.jsxRuntimeExports.jsx(Z.E4.Expand,{}),click:o.jsxRuntimeExports.jsx(Z.E4.Bolt,{})},qh=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([r])=>!t.includes(r)&&jn.includes(r)).map(([r,i])=>({key:r,icon:Kh[r],tooltip:o.jsxRuntimeExports.jsx(Wh,{mode:r,triggers:i})})).sort((r,i)=>jn.indexOf(r.key)-jn.indexOf(i.key));return o.jsxRuntimeExports.jsx(ot,{...n,data:s,entryRenderKey:"icon",children:({title:r,entry:i,...l})=>g.createElement(he.Icon,{...l,key:i.key,variant:l.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},Xh=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:xr,MASK_MODES:tc,MODES:jn,Mask:Yl,PAN_DEFAULT_TRIGGERS:nc,SELECT_DEFAULT_TRIGGERS:sc,SelectMode:qh,ZOOM_DEFAULT_TRIGGERS:ts,modeZ:Hh,use:oc},Symbol.toStringTag,{value:"Module"})),Uh=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,rc=({ref:e,children:t,initial:n=d.Mo.DECIMAL,onChange:s,...r})=>{const{setViewport:i}=nt("Viewport");g.useLayoutEffect(()=>{i({box:n,mode:"zoom",cursor:d.G.ZERO,stage:"start"})},[i,n]);const l=g.useCallback(a=>{i(a),s==null||s(a)},[s,i]),c=oc({onChange:l,initial:n,ref:e,...r});return o.jsxRuntimeExports.jsx(Yl,{className:d.CSS.BE("line-plot","viewport"),...c,children:t})},Jh=Object.freeze(Object.defineProperty({__proto__:null,Floating:lr,Legend:Hl,Line:ar,LinePlot:Dl,Title:Zl,Tooltip:jh,Viewport:rc,XAxis:Bl,YAxis:Ol,axisFactory:sr,selectViewportEl:Uh,useContext:nt,useGridEntry:An,useViewport:$l},Symbol.toStringTag,{value:"Module"})),Qh=({aetherKey:e,...t})=>(Q.use$1({aetherKey:e,type:I.Annotation.TYPE,schema:I.annotationStateZ,initialState:t}),null),ic=({aetherKey:e,menu:t,...n})=>{const s=Q.useUniqueKey(e),{setViewport:r,setHold:i}=nt("Range.Provider"),[,{hovered:l,count:c},a]=Q.use$1({aetherKey:s,type:I.Provider$1.TYPE,schema:I.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),u=An({key:s,loc:"top",size:c>0?32:0,order:3},"Annotation.Provider"),x=Ct.useContextMenu(),p=Z.useSyncedRef(x.visible),m=g.useCallback(f=>{const h=S=>{a(R=>({...R,cursor:{x:S.clientX,y:S.clientY}}))},j=f.currentTarget;j.addEventListener("mousemove",h),j.addEventListener("mouseleave",()=>{j.removeEventListener("mousemove",h),p.current||a(S=>({...S,cursor:null}))},{once:!0})},[a]);return o.jsxRuntimeExports.jsx(Ct.ContextMenu,{style:{...u,cursor:l!=null?"pointer":"default"},...x,menu:()=>t==null||l==null?null:t(l),children:o.jsxRuntimeExports.jsx(oe.Space,{style:{width:"100%",height:"100%"},onClick:()=>{l!=null&&(r({box:d.Mo.construct({x:l.viewport.lower,y:0},{x:l.viewport.upper,y:1}),mode:"zoom",cursor:d.G.ZERO,stage:"start"}),i(!0))},onMouseEnter:m})})},eg=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Qh,Provider:ic},Symbol.toStringTag,{value:"Module"})),lc={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},tg=Ie.flattenConfig(lc),cc=({aetherKey:e})=>{const t=Q.useUniqueKey(e),[,,n]=Q.use$1({aetherKey:t,type:I.Measure.TYPE,schema:I.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=g.useRef(null),r=Ie.useHeldRef({triggers:tg,loose:!0}),i=g.useCallback(({mode:a,cursor:u})=>{if(a==="click"){const x=Ie.determineMode(lc,r.current.triggers,{loose:!0});if(["one","two"].includes(x))return n(p=>({...p,[x]:u}));n(x==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??u,two:p.one!==null?u:p.two}))}},[n,r]);$l(i);const l=g.useCallback(a=>n(u=>({...u,hover:d.G.construct(a)})),[n]),c=g.useCallback(()=>{n(a=>({...a,hover:null}))},[n]);return g.useEffect(()=>{if(s.current===null)return;const a=s.current.parentElement;if(a!=null)return a.addEventListener("mousemove",l),a.addEventListener("mouseleave",c),()=>{a.removeEventListener("mousemove",l),a.removeEventListener("mouseleave",c)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:s})},ng=Object.freeze(Object.defineProperty({__proto__:null,Measure:cc},Symbol.toStringTag,{value:"Module"})),pr=({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:r,onUnitsChange:i,units:l="",color:c,lineWidth:a,lineDash:u,className:x,onSelect:p,style:m,...f})=>{const[h,j]=le.usePurePassthrough({value:t,onChange:s,initial:""}),S=Z.useSyncedRef(r),[,{pixelPosition:R},w]=Q.use$1({aetherKey:e,type:I.Rule.TYPE,schema:I.ruleStateZ,initialState:{color:c,dragging:!1,position:n,lineWidth:a,lineDash:u},onAetherChange:g.useCallback(({position:M})=>{var y;M!=null&&((y=S.current)==null||y.call(S,M))},[S])}),E=g.useRef(R);R!==E.current&&(E.current=R);const{id:C}=nt("Rule"),P=document.getElementById(C),N=P==null?void 0:P.querySelector(".pluto-line-plot__viewport"),_=g.useRef(R);g.useEffect(()=>{w(M=>({...M,position:n,color:c,lineWidth:a,lineDash:u}))},[n,c,a,u]);const $=We.useCursorDrag({onStart:g.useCallback(()=>{p==null||p(),w(M=>({...M,dragging:!0})),_.current=E.current},[]),onMove:M=>{w(y=>({...y,pixelPosition:(_.current??0)+d.Mo.signedHeight(M)}))},onEnd:g.useCallback(()=>{w(M=>({...M,dragging:!1})),_.current=R},[])}),D=g.useRef(null);if(n==null||R==null)return null;const F=new d.Color(c).pickByContrast("#000000","#ffffff"),O=o.jsxRuntimeExports.jsxs("div",{ref:D,className:d.CSS.B("rule"),style:{top:`calc(${R}px - 0.5rem)`},children:[o.jsxRuntimeExports.jsx("div",{className:d.CSS.BE("rule","drag-handle"),onDragStart:$,draggable:!0}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",className:d.CSS(x,d.CSS.BE("rule","tag")),bordered:!0,onClick:p,size:1,rounded:!0,style:{borderColor:d.cssString(c),backgroundColor:new d.Color(c).setAlpha(.7).hex,...m},...f,children:[o.jsxRuntimeExports.jsx(Z.Editable,{className:d.CSS.B("label"),level:"small",value:h,onChange:j,color:F}),o.jsxRuntimeExports.jsx(vs.Divider,{direction:"y",style:{borderColor:d.cssString(c)}}),o.jsxRuntimeExports.jsxs(oe.Space,{size:"small",direction:"x",align:"center",children:[o.jsxRuntimeExports.jsx(Z.Editable,{value:n.toFixed(2),onChange:M=>{const y=Number(M);isFinite(y)&&(r==null||r(y))},level:"small",color:F}),o.jsxRuntimeExports.jsx(Z.MaybeEditable,{level:"small",color:F,value:l,onChange:i})]})]})]});return N==null?O:Xo.createPortal(O,N)},sg=Object.freeze(Object.defineProperty({__proto__:null,Rule:pr},Symbol.toStringTag,{value:"Module"})),ac=xe.canDropOfType(tt),og=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:r,showLegend:i=!0,legendPosition:l,onLegendPositionChange:c,titleLevel:a="h4",onLineChange:u,onRuleChange:x,onAxisChannelDrop:p,onAxisChange:m,rules:f,enableTooltip:h=!0,enableMeasure:j=!1,initialViewport:S=d.Mo.DECIMAL,legendVariant:R,onViewportChange:w,viewportTriggers:E,annotationProvider:C,onSelectRule:P,...N})=>{var F;const _=t.filter(({location:O})=>d.K.isY(O)),$=g.useRef(null),D=Z.usePrevious(e.length),B=Z.usePrevious(N.hold);return(D===0&&e.length!==0||B===!0&&N.hold===!1)&&((F=$.current)==null||F.reset()),o.jsxRuntimeExports.jsxs(Dl,{...N,children:[_.map((O,M)=>{const y=e.filter(L=>L.axes.x===O.key),k=t.filter(({location:L})=>d.K.isX(L)),b=f==null?void 0:f.filter(L=>[...k.map(({key:A})=>A),O.key].includes(L.axis));return o.jsxRuntimeExports.jsx(rg,{axis:O,index:M,lines:y,yAxes:k,rules:b,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:C,onRuleChange:x,onSelectRule:P},O.key)}),i&&o.jsxRuntimeExports.jsx(Hl,{onLineChange:u,position:l,onPositionChange:c,variant:R}),n&&o.jsxRuntimeExports.jsx(Zl,{value:s,onChange:r,level:a}),o.jsxRuntimeExports.jsxs(rc,{initial:S,onChange:w,triggers:E,ref:$,children:[h&&o.jsxRuntimeExports.jsx(Gl,{}),j&&o.jsxRuntimeExports.jsx(cc,{})]})]})},rg=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:r,onSelectRule:i,onAxisChannelDrop:l,onAxisChange:c,axis:{location:a,key:u,showGrid:x,...p},annotationProvider:m})=>{const f=xe.useDrop({type:"Channel.LinePlot.XAxis",canDrop:ac,onDrop:g.useCallback(({items:S})=>{const R=xe.filterByType(tt,S);return l==null||l(u,R.map(({key:w})=>w)),R},[u,l])}),h=s==null?void 0:s.filter(S=>S.axis===u),j=xe.useDraggingState();return o.jsxRuntimeExports.jsxs(Bl,{...p,...f,location:a,showGrid:x??n===0,className:d.CSS(d.CSS.dropRegion(xe.canDropOfType(tt)(j))),onAutoBoundsChange:S=>c==null?void 0:c({key:u,bounds:S}),children:[e.map((S,R)=>{const w=t.filter(C=>C.axes.y===S.key),E=s==null?void 0:s.filter(C=>C.axis===S.key);return o.jsxRuntimeExports.jsx(lg,{axis:{...S,showGrid:x??(n===0&&R===0)},lines:w,rules:E,onRuleChange:r,onAxisChannelDrop:l,onAxisChange:c,onSelectRule:i},S.key)}),h==null?void 0:h.map(S=>g.createElement(pr,{aetherKey:S.key,...S,key:S.key,onLabelChange:R=>r==null?void 0:r({key:S.key,label:R}),onPositionChange:R=>r==null?void 0:r({key:S.key,position:R}),onUnitsChange:R=>r==null?void 0:r({key:S.key,units:R}),onSelect:()=>i==null?void 0:i(S.key)})),o.jsxRuntimeExports.jsx(ic,{...m})]})},ig=({channels:{x:e,y:t}})=>`${e??0}-${t}`,lg=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:i,location:l,...c},onSelectRule:a})=>{const u=xe.useDrop({type:"Channel.LinePlot.YAxis",canDrop:ac,onDrop:g.useCallback(({items:p})=>{const m=xe.filterByType(tt,p);return s==null||s(i,m.map(({key:f})=>f)),m},[i,s])}),x=xe.useDraggingState();return o.jsxRuntimeExports.jsxs(Ol,{...c,...u,location:l,className:d.CSS(d.CSS.dropRegion(xe.canDropOfType(tt)(x))),onAutoBoundsChange:p=>r==null?void 0:r({key:i,bounds:p}),children:[e.map(p=>o.jsxRuntimeExports.jsx(cg,{line:p},ig(p))),t==null?void 0:t.map(p=>g.createElement(pr,{aetherKey:p.key,...p,key:p.key,onLabelChange:m=>n==null?void 0:n({key:p.key,label:m}),onPositionChange:m=>n==null?void 0:n({key:p.key,position:m}),onUnitsChange:m=>n==null?void 0:n({key:p.key,units:m}),onClick:()=>a==null?void 0:a(p.key)}))]})},cg=({line:e})=>e.variant==="static"?o.jsxRuntimeExports.jsx(ug,{line:e}):o.jsxRuntimeExports.jsx(ag,{line:e}),ag=({line:{key:e,timeSpan:t,channels:{x:n,y:s},axes:r,...i}})=>{const{xTelem:l,yTelem:c}=g.useMemo(()=>{const a=Number(t.valueOf())*3,u=I.streamChannelData({timeSpan:t,channel:s,keepFor:a}),x=n!=null&&n!==0;return{xTelem:I.streamChannelData({timeSpan:t,channel:x?n:s,useIndexOfChannel:!x,keepFor:a}),yTelem:u}},[t.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(ar,{aetherKey:e,y:c,x:l,...i})},ug=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const{xTelem:i,yTelem:l}=g.useMemo(()=>{const c=I.channelData({timeRange:e,channel:s}),a=n!=null&&n!==0;return{xTelem:I.channelData({timeRange:e,channel:a?n:s,useIndexOfChannel:!a}),yTelem:c}},[e.start.valueOf(),e.end.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(ar,{aetherKey:t,y:l,x:i,...r})},ri=[{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"}],ls=({items:e},t)=>{const n=xe.filterByType(tt,e);return n.length>0&&!n.every(s=>t.includes(s.key))},uc=["name","alias"],dc=e=>{const t=Ms();return g.useMemo(()=>e.length===0?ri:ri.filter(n=>e.includes(n.key)),[e,t])},xc=e=>{if(e==null)return o.jsxRuntimeExports.jsx(Z.E4.Channel,{});if(qt.Jg.isCalculated(e))return o.jsxRuntimeExports.jsx(Z.E4.Calculation,{});if(e.isIndex)return o.jsxRuntimeExports.jsx(Z.E4.Index,{});const t=new le.g$1(e.dataType);return t.isInteger?o.jsxRuntimeExports.jsx(Z.E4.Binary,{}):t.isFloat?o.jsxRuntimeExports.jsx(Z.E4.Decimal,{}):t.equals(le.g$1.STRING)?o.jsxRuntimeExports.jsx(Z.E4.String,{}):t.equals(le.g$1.JSON)?o.jsxRuntimeExports.jsx(Z.E4.JSON,{}):o.jsxRuntimeExports.jsx(Z.E4.Channel,{})},dg=({key:e,...t})=>o.jsxRuntimeExports.jsx(dr,{icon:xc(t.entry),...t},e),xg=({columns:e=uc,onChange:t,className:n,value:s,searchOptions:r,...i})=>{const l=Ke(),c=Ms(),a=dc(e),u=nr(),x=Te.useMemoDeepEqualProps(r),p=g.useMemo(()=>l==null?void 0:l.channels.newSearcherWithOptions({rangeKey:u,internal:!1,...x}),[l,u,x]),m=l!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:f,onDragEnd:h,...j}=xe.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(C=>ls(C,_e.A(s)),[s]),onDrop:g.useCallback(({items:C})=>{const P=xe.filterByType(tt,C);if(P.length===0)return[];const N=le.c$1.unique([..._e.A(s),...P.map(_=>_.key)]);return t(N,{clickedIndex:null,clicked:null,entries:[]}),P},[t,s])}),S=xe.useDraggingState(),R=g.useCallback(({dropped:C})=>{t(_e.A(s).filter(P=>!C.some(N=>N.key===P)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),w=g.useCallback((C,P)=>f([{key:P,type:tt}],R),[f,R]),E=g.useCallback(C=>c[C.key]??C.name,[c]);return o.jsxRuntimeExports.jsx(rn,{className:d.CSS(n,d.CSS.dropRegion(ls(S,_e.A(s)))),value:s,onTagDragStart:w,onTagDragEnd:h,searcher:p,onChange:t,columns:a,emptyContent:m,entryRenderKey:E,renderTag:dg,...j,...i})},zt=({columns:e=uc,onChange:t,value:n,className:s,data:r,searchOptions:i,...l})=>{const c=Ke(),a=Ms(),u=dc(e),x=nr(),p=Te.useMemoDeepEqualProps(i),m=g.useMemo(()=>{if(!(r!=null&&r.length>0))return c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:x,internal:!1,...p})},[c,x,r==null?void 0:r.length,p]),f=c!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),j=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:S,onDragEnd:R,...w}=xe.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(N=>ls(N,_e.o(n)),[n]),onDrop:g.useCallback(({items:N})=>{const _=xe.filterByType(tt,N);return _.length===0?[]:(t(_[0].key,{clickedIndex:null,clicked:null,entries:[]}),_)},[j,t])}),E=xe.useDraggingState(),C=g.useCallback(()=>n!=null&&S([{type:tt,key:n}]),[S,n]),P=g.useCallback(N=>a[N.key]??N.name,[a]);return o.jsxRuntimeExports.jsx(dt,{data:r,className:d.CSS(s,d.CSS.dropRegion(ls(E,_e.o(n)))),value:n,onDragStart:C,onDragEnd:R,onChange:t,searcher:m,columns:u,emptyContent:f,entryRenderKey:P,...w,...l})},pg=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Uf,AliasProvider:Tl,LinePlot:og,SelectMultiple:xg,SelectSingle:zt,resolveIcon:xc,useActiveRange:nr,useAlias:Nl,useAliases:Ms,useContext:on,useName:_s},Symbol.toStringTag,{value:"Module"})),wt=({path:e,optional:t=!1,onChange:n})=>{const s=xt(),{get:r,bind:i,set:l,setStatus:c}=s,[a,u]=g.useState(r(e,{optional:t}));g.useEffect(()=>(u(r(e,{optional:t})),i({path:e,onChange:u,listenToChildren:!1})),[e,n,i,r]);const x=g.useCallback(f=>{n==null||n(f,{...s,path:e}),l(e,f)},[e,l,n]),p=g.useCallback(f=>c(e,f),[e,c]);if(a==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let m;return s.mode==="preview"&&(m="preview"),{onChange:x,setStatus:p,variant:m,...a}},pc=(e,t=!1,n)=>{const{get:s,bind:r}=xt(n),[,i]=g.useState(0);return g.useEffect(()=>(i(l=>l+1),r({path:e,onChange:()=>i(l=>l+1)})),[e,r]),s(e,{optional:t})??null},mc=(e,t=!1,n)=>{var l;const{get:s,bind:r}=xt(n),[,i]=g.useState(0);return g.useEffect(()=>(i(c=>c+1),r({path:e,onChange:()=>i(c=>c+1)})),[e,r]),((l=s(e,{optional:t}))==null?void 0:l.value)??null},mg=e=>{var t,n;return((n=(t=pc(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},fg=({path:e,ctx:t,onChange:n})=>{const s=xt(t);g.useEffect(()=>s.bind({path:e,onChange:r=>n(r,s),listenToChildren:!1}),[e,s])},hg=({path:e,optional:t=!1})=>{const{bind:n,get:s}=xt(),[r,i]=g.useState(s(e,{optional:t}));if(g.useEffect(()=>(i(s(e,{optional:t})),n({path:e,onChange:l=>i({...l,value:le.se(l.value)}),listenToChildren:!0})),[e,n,s]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},fc=(e,t)=>({add:(n,s)=>{const r=le.se(e.get(t).value);r.splice(s,0,..._e.A(n)),e.set(t,r,{validateChildren:!1})},push:(n,s)=>{const r=le.se(e.get(t).value);r.push(..._e.A(n)),s!=null&&r.sort(s),e.set(t,r,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,r=new Set(_e.A(n));e.set(t,s.filter((i,l)=>!r.has(l)))},keepOnly:n=>{const s=e.get(t).value,r=new Set(_e.A(n));e.set(t,s.filter((i,l)=>r.has(l)))},set:n=>e.set(t,le.executeSetter(n,e.get(t).value)),sort:n=>{const s=le.se(e.get(t).value);s.sort(n),e.set(t,s)}}),gg=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=xt(n),{bind:r,get:i}=s,[l,c]=g.useState(i(e).value);return g.useEffect(()=>(c(i(e).value),r({path:e,onChange:a=>{c(le.se(a.value))},listenToChildren:t})),[e,r,i,c]),g.useMemo(()=>({value:l,...fc(s,e)}),[l,s,e])},hc=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:()=>{},setCurrentStateAsInitialValues:()=>{}}),xt=e=>{const t=g.use(hc);return e??t},ii=e=>({key:e,variant:"success",message:""}),jg=e=>e.code===ce.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",gc=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r,onHasTouched:i})=>{const l=Z.useInitializerRef(()=>({state:Be.I.copy(e),statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map})),c=Z.useSyncedRef(n),a=Z.useSyncedRef(r),u=Z.useSyncedRef(e),x=Z.useSyncedRef(i),p=Re.useErrorHandler(),m=g.useCallback(()=>{u.current=Be.I.copy(l.current.state),R()},[]),f=g.useCallback(({path:M,onChange:y,listenToChildren:k=!1})=>{var T;const{parentListeners:b,listeners:L}=l.current,A=k?b:L;return A.has(M)||A.set(M,new Set),(T=A.get(M))==null||T.add(y),()=>{var V;return(V=A.get(M))==null?void 0:V.delete(y)}},[]),h=g.useCallback((M,{optional:y}={optional:!1})=>{const{state:k,statuses:b,touched:L}=l.current,A=Be.I.get(k,M,{optional:y});if(A==null)return null;const T={value:A,status:b.get(M)??ii(M),touched:L.has(M),required:!1};if(c.current==null)return T;const V=c.current,H=le.L.getFieldSchema(V,M,{optional:!0});return H==null||(T.required=!H.isOptional()),T},[]),j=g.useCallback(M=>{var L;const{touched:y}=l.current,k=y.size===0;y.add(M);const b=y.size===0;k!==b&&((L=x.current)==null||L.call(x,!b))},[]),S=g.useCallback(M=>{var L;const{touched:y}=l.current,k=y.size===0;y.delete(M);const b=y.size===0;k!==b&&((L=x.current)==null||L.call(x,!b))},[]),R=g.useCallback(()=>{var b;const{touched:M}=l.current,y=M.size===0;M.clear();const k=M.size===0;y!==k&&((b=x.current)==null||b.call(x,!k))},[]),w=g.useCallback(M=>{const{state:y,statuses:k,listeners:b,parentListeners:L}=l.current;Be.I.remove(y,M),k.delete(M),S(M),b.delete(M),L.delete(M)},[]),E=g.useCallback(M=>{const{statuses:y}=l.current;l.current.state=M??Be.I.copy(u.current),P(""),y.clear(),R()},[]),C=g.useCallback(M=>{var b;const{listeners:y}=l.current,k=h(M,{optional:!0});k!=null&&((b=y.get(M))==null||b.forEach(L=>L(k)))},[]),P=g.useCallback(M=>{const{listeners:y,parentListeners:k}=l.current,b=y.get(M);if(M==""&&([...y.keys()].forEach(T=>{var H;const V=h(T,{optional:!0});V!=null&&((H=y.get(T))==null||H.forEach(G=>{G(V)}))}),[...k.keys()].forEach(T=>{var H;const V=h(T,{optional:!0});V!=null&&((H=k.get(T))==null||H.forEach(G=>{G(V)}))})),b!=null){const L=h(M,{optional:!0});L!=null&&b.forEach(A=>{A(L)})}k.forEach((L,A)=>{if(Be.I.pathsMatch(M,A)){const V=h(A,{optional:!0});V!=null&&L.forEach(H=>{H(V)})}})},[]),N=g.useCallback((M,y="",k=!0)=>{const{statuses:b,listeners:L}=l.current;if(M.success){const H=[...b.keys()];return b.clear(),H.forEach(G=>C(G)),!0}let A=!0;const T=new Set(M.error.issues.map(H=>H.path.join(".")));let V=(H,G)=>H===G;return k&&(V=(H,G)=>Be.I.pathsMatch(H,G)),M.error.issues.forEach(H=>{var se;const{message:G}=H,ee=H.path.join(".");if(!V(ee,y))return;const te=jg(H);te!=="warning"&&(A=!1),b.set(ee,{key:ee,variant:te,message:G}),j(ee);let ne=h(ee,{optional:!0});ne??(ne={value:void 0,status:b.get(ee)??ii(ee),touched:!1,required:!1}),(se=L.get(ee))==null||se.forEach(J=>J(ne))}),b.forEach((H,G)=>{T.has(G)||(b.delete(G),C(G))}),A},[]),_=g.useCallback((M,y)=>{if(c.current==null)return!0;const{state:k}=l.current,b=c.current.safeParse(k);return N(b,M,y)},[N]),$=g.useCallback(async(M,y)=>{if(c.current==null)return!0;const{state:k}=l.current,b=await c.current.safeParseAsync(k);return N(b,M,y)},[N]),D=g.useCallback((M,y,k={})=>{const b=Be.I.get(l.current.state,M,{optional:!0}),{validateChildren:L=!0}=k,{state:A}=l.current,T=Be.I.get(u.current,M,{optional:!0});Be.I.equal(T,y)?S(M):j(M),M.length===0?l.current.state=y:Be.I.set(A,M,y),P(M),p(async()=>{var G;let H;try{H=_(M,L)}catch{H=await $(M,L)}(G=a.current)==null||G.call(a,{values:l.current.state,path:M,prev:b,valid:H})},"Failed to validate form")},[]),B=g.useCallback(M=>Be.I.has(l.current.state,M),[]),F=g.useCallback((M,y)=>{l.current.statuses.set(M,y),j(M),C(M)},[]),O=g.useCallback(()=>{const{statuses:M}=l.current;M.clear(),M.forEach((y,k)=>C(k))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:M}=l.current;l.current.state=e,M.forEach((y,k)=>{const b=h(k,{optional:!0});b!=null&&y.forEach(L=>L(b))})},[t,e]),g.useMemo(()=>({bind:f,set:D,get:h,mode:s,validate:_,validateAsync:$,value:()=>l.current.state,has:B,remove:w,setStatus:F,clearStatuses:O,reset:E,setCurrentStateAsInitialValues:m}),[f,D,h,_,$,B,w,F,O,E,s,m])},Eg=({children:e,...t})=>o.jsxRuntimeExports.jsx(hc,{value:t,children:e}),yg=he.componentRenderProp(ut.Text),Ce=({path:e,children:t=yg,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:i=!1,optional:l,onChange:c,className:a,...u})=>{const x=wt({path:e,optional:l??i,onChange:c}),p=xt();if(x==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??(n=d.d.capitalize(Be.I.element(e,-1))),r=typeof r=="function"?r(x,p):r,!r)return null;const m=x.status.message,{onChange:f,value:h}=x,j={onChange:f,value:h};return x.variant!=null&&(j.variant=x.variant),o.jsxRuntimeExports.jsx(je.Item,{padHelpText:s,helpText:m,helpTextVariant:x.status.variant,label:n,required:x.required,className:d.CSS(a,d.CSS.BE("field",e.split(".").join("-")),d.CSS.M(x.status.variant)),...u,children:t(j)})},vt=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:i,path:l,fieldKey:c=t,...a})=>o.jsxRuntimeExports.jsx(Ce,{...n,...a,path:c?`${l}.${c}`:l,children:u=>o.jsxRuntimeExports.jsx(e,{...u,...s,...i})});return r.displayName=e.displayName,r},jc=vt(je.Numeric),Xt=jc({}),Ec=vt(ut.Text),mr=Ec({}),yc=vt(Q.Switch$1),Ts=yc({}),Sg=vt(dt),Rg=vt(rn),Cg=vt(Ps),bg=vt(ot),fr=({key:e,open:t,onChange:n})=>{const s=Te.useMemoPrimitiveArray(e);Q.useAsyncEffect(async()=>{if(t==null)return;const r=await t();if(r==null)return;const i=r.onChange(n);return async()=>{i(),await r.close()}},[t==null,s])},wg=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return Q.useAsyncEffect(async()=>{s(await e())},[e]),fr({...t,onChange:s}),n},vg=Object.freeze(Object.defineProperty({__proto__:null,useListener:fr,useState:wg},Symbol.toStringTag,{value:"Module"})),kg=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:i,applyObservable:l,...c})=>{const a=Ke(),u=Re.useErrorHandler(),x=Te.useMemoPrimitiveArray(e),p=gc({values:s,...c,sync:!1,onChange:h=>{a!=null&&u(async()=>{await(i==null?void 0:i({...h,client:a}))},`Failed to apply changes for ${t}`)}});Q.useAsyncEffect(async()=>{if(a!=null)try{const h=await n({client:a});p.set("",h)}catch(h){u(h,`Failed to retrieve ${t}`)}},[x,a==null?void 0:a.key]);const m=g.useCallback(async()=>{if(a!=null)return await(r==null?void 0:r(a))},[x,a==null?void 0:a.key]),f=g.useCallback(h=>l==null?void 0:l({changes:h,ctx:p}),[x,l]);return fr({key:x,open:m,onChange:f}),p},Mg=Object.freeze(Object.defineProperty({__proto__:null,Field:Ce,Form:Eg,NumericField:Xt,SwitchField:Ts,TextField:mr,buildButtonSelectField:bg,buildDropdownButtonSelectField:Cg,buildNumericField:jc,buildSelectMultiField:Rg,buildSelectSingleField:Sg,buildSwitchField:yc,buildTextField:Ec,fieldArrayUtils:fc,fieldBuilder:vt,use:gc,useChildFieldValues:hg,useContext:xt,useField:wt,useFieldArray:gg,useFieldListener:fg,useFieldState:pc,useFieldValid:mg,useFieldValue:mc,useSynced:kg},Symbol.toStringTag,{value:"Module"})),_g=[{key:"name",name:"Name"},{key:"location",name:"Location",render:({entry:{location:e,rackName:t}})=>o.jsxRuntimeExports.jsx(wl,{level:"small",shade:7,weight:500,style:{marginTop:"0.25rem"},children:t?`${t}.${e}`:e})}],Pg=({searchOptions:e,filter:t,...n})=>{const s=Ke();let r=s==null?void 0:s.hardware.devices;e!=null&&s!=null&&(r=s.hardware.devices.newSearcherWithOptions(e));const[i,l]=g.useState(new Map),c=g.useCallback(a=>((t==null?void 0:t(a))??a).map(x=>({...x,rackName:i.get(x.rack)})),[t,i]);return Q.useAsyncEffect(async()=>{if(s==null){l(new Map);return}const a=await s.hardware.racks.retrieve([]);l(new Map(a.map(({key:u,name:x})=>[u,x])))},[s==null?void 0:s.key]),o.jsxRuntimeExports.jsx(dt,{columns:_g,searcher:r,entryRenderKey:"name",filter:c,...n})},Lg=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Pg},Symbol.toStringTag,{value:"Module"})),Ng=[{key:"name",name:"Name"},{key:"location",name:"Location"}],Tg=e=>{const t=Ke();return o.jsxRuntimeExports.jsx(dt,{columns:Ng,searcher:t==null?void 0:t.hardware.racks,entryRenderKey:"name",...e})},Ag=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Tg},Symbol.toStringTag,{value:"Module"})),Ut="label",hr=[{key:"color",name:"Color",render:({entry:e})=>o.jsxRuntimeExports.jsx(Z.E4.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],cs=({items:e},t)=>{const n=xe.filterByType(Ut,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Ig=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...r})=>o.jsxRuntimeExports.jsx(Rn,{color:e==null?void 0:e.color,...r,children:e==null?void 0:e.name}),zg=he.componentRenderProp(Ig),$g=({onChange:e,className:t,value:n,...s})=>{const r=Ke(),i=r!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=xe.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(m=>cs(m,_e.A(n)),[n]),onDrop:g.useCallback(({items:m})=>{const f=xe.filterByType(Ut,m);if(f.length===0)return[];const h=le.c$1.unique([..._e.A(n),...f.map(j=>j.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),u=xe.useDraggingState(),x=g.useCallback(({dropped:m})=>{e(_e.A(n).filter(f=>!m.some(h=>h.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=g.useCallback((m,f)=>l([{key:f,type:Ut}],x),[l,x]);return o.jsxRuntimeExports.jsx(rn,{className:d.CSS(t,d.CSS.dropRegion(cs(u,_e.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.labels,onChange:e,columns:hr,emptyContent:i,renderTag:zg,addPlaceholder:"Label",...a,...s})},Sc=({value:e,onChange:t})=>{const n=Ke(),s=n!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=g.useId(),i=g.useMemo(()=>({key:r,type:"Label.SelectMultiple"}),[r]),l=xe.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(u=>cs(u,_e.o(e)),[e]),onDrop:g.useCallback(({items:u})=>{const x=xe.filterByType(Ut,u);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[i,t])}),c=xe.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:Ut,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},Dg=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:i,...l}=Sc({value:t,onChange:e});return o.jsxRuntimeExports.jsx(dt,{data:s,className:d.CSS(n,d.CSS.dropRegion(cs(i,_e.o(t)))),value:t,onChange:e,columns:hr,entryRenderKey:"name",...l,...r})},Bg=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...i}=Sc({value:t,onChange:n});return o.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:hr,entryRenderKey:"name",...i,...s})},Og=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Ut,SelectButton:Bg,SelectMultiple:$g,SelectSingle:Dg},Symbol.toStringTag,{value:"Module"})),Rc=({children:e,centered:t,visible:n,enabled:s=!0,close:r,style:i,...l})=>{const c=g.useRef(null),a=g.useRef(n);Sl.useClickOutside({ref:c,exclude:x=>Ye.findParent(x.target,m=>m.getAttribute("role")==="dialog")!=null,onClickOutside:r});const u=g.useCallback(x=>{var m;if(!a.current||x.stage!=="start")return;const p=(m=c.current)==null?void 0:m.querySelectorAll(`.${d.CSS.visible(!0)}`);p&&p.length>0||r()},[r]);return Ie.use({triggers:[["Escape"]],callback:u,loose:!0}),o.jsxRuntimeExports.jsx(oe.Space,{className:d.CSS(d.CSS.BE("modal","bg"),d.CSS.visible(n),s&&d.CSS.M("enabled-modal")),empty:!0,align:"center",children:o.jsxRuntimeExports.jsx(oe.Space,{className:d.CSS(d.CSS.BE("modal","dialog"),t&&d.CSS.M("centered")),role:"dialog",empty:!0,ref:c,...l,style:{zIndex:s?11:void 0,...i},children:o.jsxRuntimeExports.jsx(oe.Space,{className:d.CSS(d.CSS.BE("modal","content")),empty:!0,children:e})})})},Vg=({root:e,...t})=>Xo.createPortal(o.jsxRuntimeExports.jsx(Rc,{...t}),Ye.getRootElement(e)),Fg=Object.freeze(Object.defineProperty({__proto__:null,Dialog:Rc,Modal:Vg},Symbol.toStringTag,{value:"Module"})),As=new Error("Tab not found"),Hg=new Error("Invalid Mosaic"),as=(e,t,n="center",s)=>{var p;if(e=pt(e),s===void 0)return Mo(e,t);const r=_o(e,s);if(n==="center")return(p=r.tabs)==null||p.push(t),r.selected=t.tabKey,e;const i=r.key*2,l=r.key*2+1,c=n==="top"||n==="left"?i:l;if(_o(e,c).key!==r.key)return as(e,t,"center",c);if(r.tabs==null||r.tabs.length===0)return as(e,t,"center",s);const[a,u,x]=qg(n);if(r.direction=x,r[a]={key:0,tabs:[t],selected:t.tabKey},r[u]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw Hg;return r.first.key=i,r.last.key=l,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},Zg=(e,t,n)=>{var i;e=pt(e);const[s,r]=$t(e,t);if(s==null||r==null)throw As;return r.tabs=(i=r.tabs)==null?void 0:i.map(l=>l.tabKey===t?n(l):l),e},Mo=(e,t)=>(e=pt(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=Mo(e.first,t):e.last!=null&&(e.last=Mo(e.last,t)),e)),us=e=>{e=pt(e);const t=[];if(e.tabs!=null&&(e.selected=Ne.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=us(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=us(e.last);e.last=n,t.push(...s)}return[e,t]},gr=(e,t)=>{var r;e=pt(e);const[,n]=$t(e,t);if(n==null)return[e,null];n.tabs=(r=n.tabs)==null?void 0:r.filter(i=>i.tabKey!==t),n.selected=Ne.resetSelection(n.selected,n.tabs),e=Kg(e);const s=n.selected??ds(e);return[e,s]},ds=e=>e.selected!=null?e.selected:e.first!=null?ds(e.first):e.last!=null?ds(e.last):null,Cc=(e,t)=>{e=pt(e);const[n,s]=$t(e,t);if(n==null||s==null)throw As;return s.selected=t,e},bc=(e,t,n,s)=>{e=pt(e);const[r,i]=$t(e,t);if(r==null||i==null)throw As;const[l,c]=gr(e,t);return[as(l,r,n,s),c]},Cn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=Cn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=Cn(e.last,t);if(n!=null)return n}},wc=(e,t,n)=>{const s=xs(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},Gg=(e,t,n)=>{e=pt(e);const s=Cn(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 r=s.tabs.findIndex(x=>x.tabKey===t);if(r===-1)throw new Error("Tab not found in node");const i=s.tabs[r];s.tabs=s.tabs.filter(x=>x.tabKey!==t);const l=s.key*2,a={key:s.key*2+1,tabs:[i],selected:i.tabKey},u={key:l,tabs:s.tabs,selected:s.selected};return u.selected=Ne.resetSelection(u.selected,u.tabs),s.direction=n,s.first=u,s.last=a,s.tabs=void 0,s.selected=void 0,e},Yg=(e,t)=>{const n=Cn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},vc=(e,t,n)=>{e=pt(e);const[,s]=$t(e,t);if((s==null?void 0:s.tabs)==null)throw As;return s.tabs=Ne.rename(t,n,(s==null?void 0:s.tabs)??[]),e},Wg=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,_o=(e,t)=>{const n=xs(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:_o(e,s)},Kg=e=>{let t=!0;for(;t;)[e,t]=Po(e);return e.first==null&&e.last==null&&(e.key=1),e},Po=e=>{if(e.first==null||e.last==null)return[e,!1];if(ci(e.first))return[li(e.last,!0),!0];if(ci(e.last))return[li(e.first,!1),!0];let t,n;return[e.first,t]=Po(e.first),[e.last,n]=Po(e.last),[e,t||n]},li=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),ci=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),$t=(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]=$t(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,i]=$t(e.last,t);return[r,i]},xs=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=xs(e.first,t);return n??xs(e.last,t)},qg=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")}},pt=e=>Be.I.copy(e),ps=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&ps(e.first,t,n),e.last!=null&&ps(e.last,t,n),n),Lo=(e,t)=>{t(e),e.first!=null&&Lo(e.first,t),e.last!=null&&Lo(e.last,t)};class kc{constructor(t={}){et(this,"parent");et(this,"stub");et(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 Xg=({node:e})=>{const t=g.createRef(),n=g.useRef(e);return g.useEffect(()=>{const s=t.current;if(s==null)return;const r=s.parentNode;if(r!=null)return e.mount(r,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 r=s.parentNode;r!=null&&e.mount(r,s)},[e]),o.jsxRuntimeExports.jsx("div",{ref:t})},Mc=({node:e,children:t})=>Xo.createPortal(t,e.el),Ug=Object.freeze(Object.defineProperty({__proto__:null,In:Mc,Node:kc,Out:Xg},Symbol.toStringTag,{value:"Module"})),ms=g.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:s,direction:r,first:i,last:l,key:c,size:a},emptyContent:u,...x}=n,p=g.useCallback(([h])=>t(c,h),[t]),{props:m}=Qo({direction:r,onResize:p,count:2,initialSizes:a!=null?[a]:void 0});let f;return s!==void 0?f=o.jsxRuntimeExports.jsx(_c,{emptyContent:u,...n}):i!=null&&l!=null?f=o.jsxRuntimeExports.jsxs(er,{id:`mosaic-${c}`,align:"stretch",className:d.CSS.BE("mosaic","resize"),...m,children:[o.jsxRuntimeExports.jsx(ms,{...x,root:i,onResize:t},i.key),o.jsxRuntimeExports.jsx(ms,{...x,root:l,onResize:t},l.key)]}):(f=null,console.warn("Mosaic tree is malformed")),c===1?o.jsxRuntimeExports.jsx(xe.Provider,{children:f}):f});ms.displayName="Mosaic";const fs="pluto-mosaic-tab-drop",jr="pluto-mosaic-tab-create",Jg=(e,t,n)=>{if(xe.filterByType(xe.FILE_TYPE,t).length>0&&n)return!0;const r=xe.filterByType(fs,t).map(c=>c.key),i=e.filter(c=>!r.includes(c.tabKey)).length>0;return xe.filterByType(jr,t).length>0||r.length>0&&(i||e.length===0)},_c=g.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:r,onFileDrop:i,...l})=>{const{key:c,tabs:a}=e,[u,x]=g.useState(null),p=i!=null,m=g.useCallback(({items:P})=>Jg(a,P,p),[a,p]),f=g.useCallback(({items:P,event:N})=>{if(N==null)return[];x(null);const _=xe.filterByType(xe.FILE_TYPE,P).length>0,$=a.length===0?"center":ui(ai(N));if(_)return i==null||i(c,$,N),P;const D=xe.filterByType(fs,P);if(D.length>0){const F=D.map(({key:O})=>O)[0];t(c,F,$)}const B=xe.filterByType(jr,P);if(B.length>0){const F=B.map(({key:O})=>O);n==null||n(c,$,F)}return D},[t,a.length]),h=g.useCallback(({event:P})=>{if(P==null)return;const N=a.length===0?"center":ui(ai(P));x(N)},[a.length]),{startDrag:j,...S}=xe.useDragAndDrop({type:"Mosaic",canDrop:m,onDrop:f,onDragOver:h}),R=m(xe.useDraggingState()),w=g.useCallback(()=>x(null),[]),E=g.useCallback((P,{tabKey:N})=>{j([{key:N,type:fs,elementID:P.currentTarget.id}])},[j]),C=g.useCallback(()=>n==null?void 0:n(c,"center"),[c]);return o.jsxRuntimeExports.jsxs("div",{id:`mosaic-${c}`,className:d.CSS.BE("mosaic","leaf"),children:[o.jsxRuntimeExports.jsxs(Ne.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:w,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:E,onCreate:C,...l,...S,children:[e.selected!=null&&r(a.find(P=>P.tabKey===e.selected)),R&&o.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),u!=null&&o.jsxRuntimeExports.jsx("div",{className:d.CSS.BE("mosaic","mask"),style:Qg[u]})]})});_c.displayName="MosaicTabLeaf";const Qg={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%"}},ai=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}},e1=e=>e,t1=e=>1-e,ui=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[e1(e),t1(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")},n1=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),r=new Set,i=ps(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 kc({style:"width: 100%; height: 100%; position: relative;"}),u.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,u)),r.add(a.tabKey),o.jsxRuntimeExports.jsx(Mc,{node:u,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})}).flat().filter(l=>l!=null);return s.current.forEach((l,c)=>!r.has(c)&&s.current.delete(c)),[s,i]},s1=ce.z.object({key:ce.z.number(),tabs:ce.z.array(Ne.tabZ).optional(),selected:ce.z.string().optional(),direction:d.g.direction.optional(),size:ce.z.number().optional()}),No=s1.extend({first:ce.z.lazy(()=>No).optional(),last:ce.z.lazy(()=>No).optional()}),o1=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(us(t)[0]),[t]),{root:n,onDrop:(u,x,p)=>s(m=>bc(m,x,p,u)[0]),onClose:u=>s(x=>gr(x,u)[0]),onSelect:u=>s(x=>Cc(x,u)),onResize:(u,x)=>s(p=>wc(p,u,x)),onRename:e?(u,x)=>s(p=>vc(p,u,x)):void 0}},r1=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:jr,HAUL_DROP_TYPE:fs,Mosaic:ms,autoSelectTabs:us,canSplit:Yg,findSelected:ds,findTabNode:Cn,forEachNode:Lo,insertTab:as,isEmpty:Wg,mapNodes:ps,moveTab:bc,nodeZ:No,removeTab:gr,renameTab:vc,resizeNode:wc,selectTab:Cc,split:Gg,updateTab:Zg,use:o1,usePortal:n1},Symbol.toStringTag,{value:"Module"})),i1=({variant:e,className:t,...n})=>o.jsxRuntimeExports.jsx(oe.Space,{className:d.CSS(t,d.CSS.B("note"),d.CSS.M(e)),align:"stretch",empty:!0,...n}),l1=Object.freeze(Object.defineProperty({__proto__:null,Note:i1},Symbol.toStringTag,{value:"Module"})),uo={Close:o.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:o.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:o.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.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"}),o.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"})]})},c1=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:i,onClose:l,...c})=>o.jsxRuntimeExports.jsxs(oe.Space,{size:1.5,direction:"x",className:d.CSS(d.CSS.B("macos-controls"),!n&&d.CSS.BM("macos-controls","blurred"),t),...c,children:[o.jsxRuntimeExports.jsx(xo,{onClick:l,className:d.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:uo.Close}),o.jsxRuntimeExports.jsx(xo,{onClick:s,className:d.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:uo.Minimize}),o.jsxRuntimeExports.jsx(xo,{onClick:i,className:d.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:uo.Maximize})]}),xo=({className:e,disabled:t,color:n,...s})=>o.jsxRuntimeExports.jsx("button",{className:d.CSS(d.CSS.B("macos-control"),d.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),a1=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:i,...l})=>o.jsxRuntimeExports.jsxs(ks.Pack,{...l,children:[o.jsxRuntimeExports.jsx(po,{className:d.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:o.jsxRuntimeExports.jsx(Z.E4.Subtract,{})}),o.jsxRuntimeExports.jsx(po,{className:d.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:o.jsxRuntimeExports.jsx(Z.E4.Box,{})}),o.jsxRuntimeExports.jsx(po,{onClick:s,className:d.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:o.jsxRuntimeExports.jsx(Z.E4.Close,{})})]}),po=({disabled:e=!1,className:t,...n})=>e?null:o.jsxRuntimeExports.jsx(he.Icon,{className:d.CSS(d.CSS.B("windows-control"),t),tabIndex:-1,...n}),Pc=le.S.getOS,u1="Windows",d1=({forceOS:e,visibleIfOS:t,...n})=>{const s=Pc({force:e,default:u1});if(t!=null&&t!==s)return null;const r=s==="macOS"?c1:a1;return o.jsxRuntimeExports.jsx(r,{...n})},x1=Object.freeze(Object.defineProperty({__proto__:null,Controls:d1,use:Pc},Symbol.toStringTag,{value:"Module"})),p1=(e,t)=>{const n=s=>o.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},m1=Object.freeze(Object.defineProperty({__proto__:null,createComponent:p1},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:qt.B.NOOP});const f1=({children:e,...t})=>{const{path:n}=Q.useUnidirectional({type:I.Provider$2.TYPE,schema:I.providerStateZ$1,state:t});return o.jsxRuntimeExports.jsx(Q.Composite,{path:n,children:e})},h1="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjUgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Lc=({children:e})=>{const[{path:t}]=Q.use$1({type:I.BaseProvider.TYPE,schema:I.providerStateZ$2,initialState:{}});return o.jsxRuntimeExports.jsx(Q.Composite,{path:t,children:e})},g1=Object.freeze(Object.defineProperty({__proto__:null,Provider:Lc},Symbol.toStringTag,{value:"Module"})),j1=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:I.AcquireChannelControl,AuthoritySource:I.AuthoritySource,Chip:I.Chip,Controller:I.Controller$1,Indicator:I.Indicator,Legend:I.Legend,REGISTRY:I.REGISTRY$15,STATUSES:I.STATUSES,SetChannelValue:I.SetChannelValue,StateProvider:I.StateProvider,acquireChannelControl:I.acquireChannelControl,acquireChannelControlPropsZ:I.acquireChannelControlPropsZ,authoritySource:I.authoritySource,authoritySourceProps:I.authoritySourceProps,chipStateZ:I.chipStateZ,controllerStateZ:I.controllerStateZ,indicatorStateZ:I.indicatorStateZ,legendStateZ:I.legendStateZ,setChannelValue:I.setChannelValue,setChannelValuePropsZ:I.setChannelValuePropsZ,stateProviderStateZ:I.stateProviderStateZ,statusZ:I.statusZ,sugaredStateZ:I.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),E1=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)===qt.im.Authority.ABSOLUTE?{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)"}}},Nc=({source:e,sink:t,className:n,...s})=>{const r=Te.useMemoDeepEqualProps({source:e,sink:t}),[,{status:i},l]=Q.use$1({type:I.Chip.TYPE,schema:I.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:le.m.now()}}});g.useEffect(()=>{l(m=>({...m,...r}))},[r,l]);const c=g.useCallback(()=>l(m=>({...m,triggered:!m.triggered})),[l]),{message:a,chipColor:u,buttonStyle:x,disabled:p}=E1(i);return o.jsxRuntimeExports.jsx(he.Icon,{variant:"text",className:d.CSS(d.CSS.B("control-chip"),n),disabled:p,onClick:c,tooltip:o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:a}),style:x,...s,children:o.jsxRuntimeExports.jsx(Z.E4.Circle,{color:u})})},Tc=g.createContext({needsControlOf:[]}),Ac=()=>g.use(Tc),y1=({children:e,onStatusChange:t,...n})=>{const s=Te.useMemoDeepEqualProps(n),[{path:r},{status:i,needsControlOf:l},c]=Q.use$1({type:I.Controller$1.TYPE,schema:I.controllerStateZ,initialState:s});return g.useEffect(()=>{i!=null&&(t==null||t(i))},[i,t]),g.useEffect(()=>{c(a=>({...a,...s}))},[s,c]),g.useEffect(()=>()=>t==null?void 0:t("released"),[]),o.jsxRuntimeExports.jsxs(Tc,{value:{needsControlOf:l},children:[o.jsxRuntimeExports.jsx(Q.Composite,{path:r,children:e}),";"]})},Ic=({colorSource:e,statusSource:t})=>{var c;const n=Te.useMemoDeepEqualProps({colorSource:e,statusSource:t}),[,{color:s,status:r},i]=Q.use$1({type:I.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:le.m.now()}},schema:I.indicatorStateZ});g.useEffect(()=>{i(a=>({...a,...n}))},[n,i]);let l;return((c=r.data)==null?void 0:c.color)!=null?l=d.Color.z.parse(r.data.color):s!=null&&!s.isZero?l=s:l="var(--pluto-gray-l8)",o.jsxRuntimeExports.jsxs(he.Dialog,{location:{x:"center",y:"bottom"},children:[o.jsxRuntimeExports.jsx(Z.Text,{level:"p",children:r.message}),o.jsxRuntimeExports.jsx("div",{className:d.CSS.B("indicator"),style:{backgroundColor:d.cssString(l),flexGrow:1}})]})},S1=e=>{const{needsControlOf:t}=Ac(),[,{states:n},s]=Q.use$1({type:I.Legend.TYPE,schema:I.legendStateZ,initialState:{states:[],needsControlOf:t}});g.useEffect(()=>{s(l=>({...l,needsControlOf:t}))},[t]);const i=le.c$1.unique(n.map(l=>l.subject.key)).map(l=>{const c=n.find(a=>a.subject.key===l);if(c==null)throw new qt.Me("Legend subject not found");return{key:c.subject.key,label:c.subject.name,color:c.subjectColor}});return o.jsxRuntimeExports.jsx(ir,{data:i,...e})},zc=({children:e})=>{const[{path:t}]=Q.use$1({type:I.StateProvider.TYPE,schema:I.stateProviderStateZ,initialState:{}});return o.jsxRuntimeExports.jsx(Q.Composite,{path:t,children:e})},R1=Object.freeze(Object.defineProperty({__proto__:null,Chip:Nc,Controller:y1,Indicator:Ic,Legend:S1,StateProvider:zc,useContext:Ac},Symbol.toStringTag,{value:"Module"})),$c=e=>{const t=({disabled:n=!1,...s})=>n?s.children:o.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},C1=$c(Lc),b1=$c(Q.Provider$2),w1=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:r,tooltip:i,triggers:l,alamos:c,haul:a,channelAlias:u,telem:x,color:p})=>o.jsxRuntimeExports.jsx(Ie.Provider,{...l,children:o.jsxRuntimeExports.jsx(he.Config,{...i,children:o.jsxRuntimeExports.jsx(xe.Provider,{...a,children:o.jsxRuntimeExports.jsx(Q.Provider$1,{url:s??h1,enabled:n,children:o.jsxRuntimeExports.jsx(b1,{workerKey:"vis",children:o.jsxRuntimeExports.jsx(f1,{...c,children:o.jsxRuntimeExports.jsx(Re.Aggregator,{children:o.jsxRuntimeExports.jsx(Pl,{connParams:t,children:o.jsxRuntimeExports.jsx(Tl,{...u,children:o.jsxRuntimeExports.jsx(We.Provider,{...p,children:o.jsxRuntimeExports.jsx(Q.Provider,{...r,children:o.jsxRuntimeExports.jsx(C1,{...x,children:o.jsxRuntimeExports.jsx(zc,{children:e})})})})})})})})})})})})}),v1=Object.freeze(Object.defineProperty({__proto__:null,Provider:w1},Symbol.toStringTag,{value:"Module"})),k1=({value:e})=>o.jsxRuntimeExports.jsx("div",{className:d.CSS.B("progress"),children:o.jsxRuntimeExports.jsx("div",{className:d.CSS.B("progress-bar"),style:{width:`${e}%`}})}),M1=Object.freeze(Object.defineProperty({__proto__:null,Progress:k1},Symbol.toStringTag,{value:"Module"})),bn="range",Er=[{key:"name",name:"Name"}],hs=({items:e},t)=>{const n=xe.filterByType(bn,e);return n.length>0&&!n.every(s=>t.includes(s.key))},_1=({onChange:e,className:t,value:n,...s})=>{const r=Ke(),i=r!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=xe.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(m=>hs(m,_e.A(n)),[n]),onDrop:g.useCallback(({items:m})=>{const f=xe.filterByType(bn,m);if(f.length===0)return[];const h=le.c$1.unique([..._e.A(n),...f.map(j=>j.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),u=xe.useDraggingState(),x=g.useCallback(({dropped:m})=>{e(_e.A(n).filter(f=>!m.some(h=>h.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=g.useCallback((m,f)=>l([{key:f,type:bn}],x),[l,x]);return o.jsxRuntimeExports.jsx(rn,{className:d.CSS(t,d.CSS.dropRegion(hs(u,_e.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.ranges,onChange:e,columns:Er,emptyContent:i,entryRenderKey:"name",...a,...s})},Dc=({value:e,onChange:t})=>{const n=Ke(),s=n!=null?void 0:o.jsxRuntimeExports.jsx(Re.Text.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=g.useId(),i=g.useMemo(()=>({key:r,type:"Ranger.SelectMultiple"}),[r]),{startDrag:l,...c}=xe.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(x=>hs(x,_e.o(e)),[e]),onDrop:g.useCallback(({items:x})=>{const p=xe.filterByType(bn,x);return p.length===0?[]:(t(p[0].key,{clickedIndex:null,clicked:null,entries:[]}),p)},[i,t])}),a=xe.useDraggingState(),u=g.useCallback(()=>e!=null&&l([{type:bn,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:u,searcher:n==null?void 0:n.ranges}},P1=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:i,...l}=Dc({value:t,onChange:e});return o.jsxRuntimeExports.jsx(dt,{data:s,className:d.CSS(n,d.CSS.dropRegion(hs(i,_e.o(t)))),value:t,onChange:e,columns:Er,entryRenderKey:"name",...l,...r})},L1=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...i}=Dc({value:t,onChange:n});return o.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:Er,entryRenderKey:"name",...i,...s})},N1=[{key:"color",name:"Color",width:50,render:e=>o.jsxRuntimeExports.jsx(Z.E4.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],T1=e=>{const t=Ke();return o.jsxRuntimeExports.jsx(rn,{...e,searcher:t==null?void 0:t.labels,columns:N1,renderTag:n=>n.entry==null?o.jsxRuntimeExports.jsx(Rn,{color:"gray",children:n.entryKey}):o.jsxRuntimeExports.jsx(Rn,{color:n.entry.color,children:n.entry.name})})},A1=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...r})=>{const i=new le.m(e.start),l=i.isToday?"time":"dateTime",c=new le.m(e.end),a=c.equals(le.m.MAX),u=c.span(i)<le.y$1.DAY?"time":"dateTime",x=i.span(c);return o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",size:"small",className:d.CSS(d.CSS.B("time-range-chip")),align:"center",...r,children:[i.isToday&&o.jsxRuntimeExports.jsx(Z.Text,{level:t,shade:n,weight:450,children:"Today"}),o.jsxRuntimeExports.jsx(wo.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:i}),o.jsxRuntimeExports.jsx(Z.E4.Arrow.Right,{color:"var(--pluto-text-color)"}),a?o.jsxRuntimeExports.jsx(Z.Text,{level:t,children:"Now"}):o.jsxRuntimeExports.jsx(wo.DateTime,{level:t,displayTZ:"local",format:u,shade:n,weight:450,children:c}),!x.isZero&&s&&o.jsxRuntimeExports.jsxs(Z.Text,{level:t,shade:n,weight:450,children:["(",i.span(c).truncate(le.y$1.MILLISECOND).toString(),")"]})]})},I1=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:L1,SelectLabels:T1,SelectMultiple:_1,SelectSingle:P1,TimeRangeChip:A1},Symbol.toStringTag,{value:"Module"})),z1=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(i=>i.key===t);return o.jsxRuntimeExports.jsx(oe.Space,{direction:"x",align:"center",className:d.CSS.B("steps"),...s,children:e.map((i,l)=>o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsxs(he.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>r,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&o.jsxRuntimeExports.jsx(Z.E4.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},$1=Object.freeze(Object.defineProperty({__proto__:null,Steps:z1},Symbol.toStringTag,{value:"Module"})),D1=({children:e,className:t,visible:n,...s})=>{const[{path:r},,i]=Q.use$1({type:I.Table.TYPE,schema:I.Table.stateZ,initialState:{region:d.Mo.ZERO,visible:n}});g.useEffect(()=>{i(c=>({...c,visible:n}))},[n]);const l=Tn(c=>i(a=>({...a,region:c})));return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{ref:l,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),o.jsxRuntimeExports.jsx("table",{className:d.CSS(d.CSS.B("table"),t),...s,children:o.jsxRuntimeExports.jsx("tbody",{children:o.jsxRuntimeExports.jsx(Q.Composite,{path:r,children:e})})})]})},B1=({children:e,className:t,size:n,index:s,onResize:r,onSelect:i,position:l,...c})=>o.jsxRuntimeExports.jsxs("tr",{className:d.CSS(d.CSS.BE("table","row"),t),...c,children:[r!=null&&o.jsxRuntimeExports.jsx(Oc,{onSelect:i,index:s,value:n,onChange:r,position:l,direction:"y"}),e]}),yr=({ref:e,children:t,className:n,selected:s=!1,...r})=>o.jsxRuntimeExports.jsx("td",{ref:e,...r,className:d.CSS(d.CSS.BE("table","cell"),d.CSS.selected(s),n),children:t}),Bc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",O1=e=>Bc[e],Oc=({value:e,selected:t=!1,index:n,onChange:s,position:r,direction:i="x",onSelect:l})=>{const c=Z.useSyncedRef(e),a=g.useRef(e),u=We.useCursorDrag({onStart:g.useCallback(()=>{a.current=c.current},[]),onMove:g.useCallback(x=>s(a.current+d.Mo.dim(x,i,!0),n),[s,n])});return o.jsxRuntimeExports.jsxs("td",{id:`resizer-${i}-${n}`,className:d.CSS(d.CSS.BE("table","resizer"),d.CSS.dir(i),d.CSS.selected(t),Ct.CONTEXT_TARGET,t&&Ct.CONTEXT_SELECTED),style:{[d.g.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[o.jsxRuntimeExports.jsx(Z.Text,{level:"p",shade:7,style:{width:"100%",textAlign:"center"},children:i==="x"?Bc[n]:n+1}),o.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[d.g.location(i)]:r+e},onDragStart:u,draggable:!0})]})},V1=({selected:e,onSelect:t,columns:n,onResize:s})=>{let r=15;return o.jsxRuntimeExports.jsxs("tr",{className:d.CSS(d.CSS.BE("table","row"),d.CSS.BE("table","col-resizer")),children:[o.jsxRuntimeExports.jsx("td",{}),n.map((i,l)=>{const c=r;return r+=i,o.jsxRuntimeExports.jsx(Oc,{onSelect:t,position:c,selected:e.includes(l),index:l,value:i,onChange:a=>s(a,l),direction:"x"},l)})]})},F1=Object.freeze(Object.defineProperty({__proto__:null,Cell:yr,ColumnIndicators:V1,Row:B1,Table:D1,getCellColumn:O1},Symbol.toStringTag,{value:"Module"})),H1=[{key:"standard",name:"Standard"},{key:"scientific",name:"Scientific"},{key:"engineering",name:"Engineering"}],Z1=e=>o.jsxRuntimeExports.jsx(ot,{...e,entryRenderKey:"name",data:H1}),Vc=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Sr=({path:e})=>{var f;const{value:t,onChange:n}=wt({path:e}),s=I.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),r=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=I.stringifyNumberProps.parse(s.segments.stringifier.props),l=I.rollingAverageProps.parse(s.segments.rollingAverage.props),c=h=>{const j=I.sourcePipeline("string",{connections:Vc,segments:{valueStream:I.streamChannelValue({channel:r.channel}),stringifier:I.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:I.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:j})},a=h=>c({valueStream:I.streamChannelValue({channel:h??0})}),u=h=>c({stringifier:I.stringifyNumber({...i,notation:h})}),x=h=>c({stringifier:I.stringifyNumber({...i,precision:h})}),p=h=>c({rollingAverage:I.rollingAverage({windowSize:h})}),m=_s(r.channel);return g.useEffect(()=>n({...t,tooltip:[m]}),[m]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:r.channel,onChange:a})}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Notation",children:o.jsxRuntimeExports.jsx(Z1,{value:i.notation,onChange:u})}),o.jsxRuntimeExports.jsx(je.Item,{label:"Precision",align:"start",children:o.jsxRuntimeExports.jsx(je.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),o.jsxRuntimeExports.jsx(je.Item,{label:"Averaging Window",align:"start",children:o.jsxRuntimeExports.jsx(je.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})]})},G1=I.Value.z.partial({color:!0}).extend({level:le.levelZ.optional()}),Rr=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:i,level:l="small",backgroundTelem:c,notation:a,location:u})=>{const x=Te.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:r,level:l,minWidth:i,notation:a,backgroundTelem:c,location:u}),[,p,m]=Q.use$1({aetherKey:e,type:I.Value.TYPE,schema:I.Value.z,initialState:x});return g.useEffect(()=>m(f=>({...f,...x})),[x]),{width:p.width??p.minWidth}},Y1=Object.freeze(Object.defineProperty({__proto__:null,TelemForm:Sr,VALUE_CONNECTIONS:Vc,corePropsZ:G1,use:Rr},Symbol.toStringTag,{value:"Module"})),W1=ce.z.object({value:ce.z.string(),level:le.levelZ,weight:le.weightZ,align:d.K.x.or(d.K.center),backgroundColor:d.crudeZ}),K1=({cellKey:e,onChange:t,value:n,selected:s,onSelect:r,align:i,level:l,weight:c,backgroundColor:a})=>{const u=p=>r(e,p),x=p=>t({level:l,value:p,weight:c,align:i,backgroundColor:a});return o.jsxRuntimeExports.jsx(yr,{id:e,className:d.CSS(Ct.CONTEXT_TARGET,s&&Ct.CONTEXT_SELECTED,d.CSS.BEM("table","cell","text")),selected:s,onClick:u,onContextMenu:u,style:{backgroundColor:d.cssString(a)},children:o.jsxRuntimeExports.jsx(Z.Editable,{level:l,value:n,weight:c,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},q1=ce.z.object({telem:I.stringSourceSpecZ,redline:ce.z.object({bounds:d.H.bounds,gradient:d.gradientZ}),level:le.levelZ,color:ce.z.string(),units:ce.z.string()}),X1=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:r,bounds:i},selected:l,box:c,onSelect:a})=>{const{width:u}=Rr({aetherKey:e,box:c,telem:t,level:n,color:s,backgroundTelem:I.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:I.scaleNumber({scale:d.b.Scale.scale(i).scale(0,1).transform}),gradient:I.colorGradient({gradient:r})},outlet:"gradient"}),location:{x:"center",y:"center"}}),x=p=>a(e,p);return o.jsxRuntimeExports.jsx(yr,{id:e,selected:l,onClick:x,onContextMenu:x,style:{height:"5rem",width:u},className:d.CSS(Ct.CONTEXT_TARGET,l&&Ct.CONTEXT_SELECTED,d.CSS.BEM("table","cell","value"))})},U1=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return o.jsxRuntimeExports.jsx(oe.Space,{direction:"y",style:{padding:"2rem"},children:o.jsxRuntimeExports.jsx(Sr,{path:""})});case"redline":return o.jsxRuntimeExports.jsx(oe.Space,{direction:"y",style:{padding:"2rem"},children:o.jsxRuntimeExports.jsx(J1,{})});default:return o.jsxRuntimeExports.jsx(oe.Space,{direction:"y",grow:!0,empty:!0,style:{padding:"2rem"},children:o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Fc,{onChange:e,value:"value"})}),o.jsxRuntimeExports.jsx(Ce,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:r,onChange:i,variant:l,...c})=>o.jsxRuntimeExports.jsx(We.Swatch,{value:r??d.ZERO.setAlpha(1).rgba255,onChange:a=>i(a.rgba255),...c,bordered:!0})}),o.jsxRuntimeExports.jsx(Ce,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:r=>o.jsxRuntimeExports.jsx(ln,{...r})})]})})}},[]),n=Ne.useStatic({tabs:[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],content:t});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...n})},J1=()=>{const{set:e,get:t}=xt(),n=mc("redline.bounds"),s=d.b.Scale.scale(0,1).scale(n);return o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(Xt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Lower",path:"redline.bounds.lower"}),o.jsxRuntimeExports.jsx(Ce,{path:"redline.gradient",label:"Gradient",align:"start",padHelpText:!1,children:({value:r,onChange:i})=>o.jsxRuntimeExports.jsx(We.GradientPicker,{value:Be.I.copy(r),scale:s,onChange:l=>{const a={...t("redline.bounds").value},u=l.map(j=>j.position),x=s.pos(Math.max(...u)),p=s.pos(Math.min(...u)),m=x>a.upper,f=p<a.lower;m&&(l[l.length-1].position=1,a.upper=x),f&&(l[0].position=0,a.lower=p);const h=l.map(j=>({...j,color:new d.Color(j.color).hex}));m||f?e("redline",{bounds:a,gradient:h}):i(l.map(j=>({...j,color:new d.Color(j.color).hex})))}})}),o.jsxRuntimeExports.jsx(Xt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Upper",path:"redline.bounds.upper"})]})},Q1=({onVariantChange:e})=>o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",grow:!0,style:{padding:"2rem"},children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Fc,{onChange:e,value:"text"})}),o.jsxRuntimeExports.jsx(mr,{path:"value",label:"Text"}),o.jsxRuntimeExports.jsx(Ce,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ln,{...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"weight",label:"Weight",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ec,{...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"align",label:"Alignment",hideIfNull:!0,children:t=>o.jsxRuntimeExports.jsx(Ls,{...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(We.Swatch,{value:t,onChange:n})})]}),e0=[{key:"text",name:"Text"},{key:"value",name:"Value"}],Fc=e=>o.jsxRuntimeExports.jsx(ot,{...e,data:e0,allowMultiple:!1,entryRenderKey:"name"}),t0=["text","value"],n0=ce.z.enum(t0),s0={key:"value",name:"Value",Form:U1,Cell:X1,defaultProps:e=>({telem:I.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:I.streamChannelValue({channel:0}),rollingAverage:I.rollingAverage({windowSize:1}),stringifier:I.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"}),redline:{bounds:{lower:0,upper:1},gradient:[]},color:e.colors.gray.l8.hex,level:"h5",units:""}),schema:q1},o0={key:"text",name:"Text",Form:Q1,Cell:K1,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:W1},r0={text:o0,value:s0},i0=Object.freeze(Object.defineProperty({__proto__:null,CELLS:r0,variantZ:n0},Symbol.toStringTag,{value:"Module"})),di=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=Lt(e,...n);return d.G.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},xi=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:i})=>{if(!l0({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=d.g.construct(t),c=d.g.swap(l);let a=At(c,s[c]-e[c]);const u=d.Mo.loc(n,a);if(d.K.swap(t)===r){const x=d.Mo.loc(i,d.K.swap(a));Math.abs(u-x)<Fe&&(a=d.K.swap(a))}return{direction:c,length:u-e[c]+Dt(a,Fe)}},To=ce.z.object({direction:d.g.direction,length:ce.z.number()}),Lt=(e,...t)=>{let n=e;for(const s of t)n=d.G.translate(n,s.direction,s.length);return n},Hc=(e,t,n,s)=>{try{let r=e;const i=[e,...t.map(f=>(r=d.G.translate(r,f.direction,f.length),r))];if(!s)return i;const l=t[0],c=At(l.direction,l.length),a=pi(c),u=4*(2-n**.5);i[0]=d.G.translate(i[0],{[l.direction]:-1*a*u,[d.g.swap(l.direction)]:0});const x=t[t.length-1],p=At(x.direction,x.length),m=pi(p);return i[i.length-1]=d.G.translate(i[i.length-1],{[x.direction]:m*u,[d.g.swap(x.direction)]:0}),i}catch{return[]}},Fe=10,pi=e=>e==="top"||e==="left"?-1:1,Dt=(e,t)=>e==="top"||e==="left"?-t:t,At=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",Et=e=>At(e.direction,e.length),l0=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=d.g.construct(n),r=t[s]-e[s];return Dt(n,r)<0},Hn=e=>({direction:d.g.construct(e),length:Dt(e,Fe)}),mi={top:Hn("top"),bottom:Hn("bottom"),left:Hn("left"),right:Hn("right")},c0=4,a0=.25,Is=e=>Ao(u0(Ao(e))),u0=e=>{const t=[...e],n=e.findIndex((s,r)=>{const i=Math.abs(s.length);if(i<c0){if(r===0||r===e.length-1)return!1;if(i<a0)return!0;if(e.length<=3)return!1;if(r+2<e.length){const l=t[r+2];if(l.direction!==s.direction)return!1;t[r+2]={...l,length:l.length+s.length}}else{const l=t[r-2];if(l.direction!==s.direction)return!1;t[r-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},Ao=e=>{const t=[...e];return e.findIndex((s,r)=>{const i=t[r-1];if(r===0||s.direction!==i.direction)return!1;if(r===1){const l=r-1,c=r,a=Et(i),u=Et(s);if(a===u)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(i.length)===Fe)return!1;const x=Dt(a,Fe),p=t[l].length-x,m=t[c].length+p;return Math.abs(m)<Fe?!1:(t[l]={...t[l],length:x},t[c]={...t[c],length:m},!0)}if(r===e.length-1){const l=r,c=r-1,a=Et(s),u=Et(i);if(a===u)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(s.length)===Fe)return!1;const x=Dt(a,Fe),p=t[l].length-x,m=t[c].length+p;return Math.abs(m)<Fe?!1:(t[l]={...t[l],length:x},t[c]={...t[c],length:m},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?Ao(t):t},Gt=e=>Is(d0(e)),d0=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:i})=>{let l=i,c=r,a={...mi[i]},u=Lt(n,a);const x={...mi[r]};let p=Lt(s,x);const m=Math.abs(u.x-p.x),f=Math.abs(u.y-p.y);m<2*Fe&&f<10&&(a.length-=m/2,x.length+=m/2,u=Lt(n,a),p=Lt(s,x));const h=[a],j=xi({sourceStumpTip:u,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});j!=null&&(h.push(j),u=Lt(u,j),l=Et(j),a=j);const S=xi({sourceStumpTip:p,sourceOrientation:c,sourceBox:t,targetStumpTip:u,targetOrientation:l,targetBox:e});S!=null&&(p=Lt(p,S),c=At(S.direction,S.length));const R=()=>{S!=null&&(S.length*=-1,h.push(S)),x.length*=-1,h.push(x)};if(d.K.swap(l)===r){const _=d.g.construct(l),$=(p[_]-u[_])/2;h.push({direction:_,length:$});const D=d.g.swap(_);return h.push({direction:D,length:p[D]-u[D]}),h.push({direction:_,length:$}),R(),h}const w=p[a.direction]-u[a.direction];let E=d.g.swap(a.direction);const C=u[E]-p[E];let P;At(a.direction,w)===l&&At(E,C)===c?P={direction:a.direction,length:w}:(P={direction:E,length:p[E]-u[E]},E=d.g.swap(E)),h.push(P);const N={direction:E,length:p[E]-u[E]};return h.push(N),R(),h},x0=e=>Is(p0(e)),p0=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],i=d.g.swap(r.direction),l=Et(r);if(t===0){s.unshift({direction:i,length:n});const c=Dt(l,Fe);s.unshift({direction:r.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:i,length:-n});const c=Dt(l,Fe);s.push({direction:r.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},m0=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},f0=(e,t,n=!1,...s)=>{const r=(i,l)=>!s.includes(l)&&t(i,l);return n?m0(e,r):e.findIndex(r)},h0=({delta:e,segments:t})=>Is(Zc(e,t,!1)),g0=({delta:e,segments:t})=>Is(Zc(e,t,!0)),Zc=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=hi("x",e,s,n)),e.y!==0&&(s=hi("y",e,s,n)),s},fi=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=Et(t),i=Et(s),l=Math.abs(s.length),c=Math.abs(t.length);return(l>c||l>Fe)&&r===i},hi=(e,t,n,s)=>{const r=d.g.swap(e),i=s?n.length-1:0,l=n[i];if(fi(e,l,t)){const p=n[n.length-1];return p.direction===e&&Math.abs(l.length)<Fe?(n[n.length-1]={...p,length:p.length-t[e]},n):(n[i]={...l,length:l.length-t[e]},n)}const c=s?0:n.length-1,u=f0(n,p=>p.direction===e,s,i);if(u===c){const p=n[c];return fi(e,p,t)?(n[c]={...p,length:p.length-t[e]},n):(l.direction===e&&Math.abs(l.length)>p.length?n[i]={...l,length:l.length-t[e]}:n[c]={...p,length:p.length-t[e]},n)}if(u===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:r,length:n[0].length/2},{direction:e,length:-t[e]},{direction:r,length:n[0].length/2}]:l.direction===e?(n[i]={...l,length:l.length-t[e]},n):[{direction:r,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const x=n[u];return n[u]={...x,length:x.length-t[e]},n},j0=ce.z.object({position:d.G.xy,zoom:ce.z.number()}),Gc=ce.z.object({color:d.crudeZ,variant:ce.z.string().optional(),segments:ce.z.array(To)}),E0=Gc.extend({key:ce.z.string(),source:ce.z.string(),target:ce.z.string(),segments:ce.z.array(To),color:d.crudeZ,id:ce.z.string(),data:ce.z.object({segments:ce.z.array(To),color:d.crudeZ,variant:ce.z.string().optional()}).optional(),selected:ce.z.boolean(),sourceHandle:ce.z.string().nullable().optional(),targetHandle:ce.z.string().nullable().optional()}),y0=ce.z.object({key:ce.z.string(),position:d.G.xy,selected:ce.z.boolean().optional(),zIndex:ce.z.number().optional(),type:ce.z.string().optional(),data:ce.z.record(ce.z.unknown()).optional(),measured:ce.z.object({width:ce.z.number().optional(),height:ce.z.number().optional()}).optional()}),Cr=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),br=e=>e.map(({segments:t,color:n,variant:s,...r})=>({...r,id:r.key,data:{segments:t,color:n,variant:s}})),Yc=e=>e.map(t=>({key:t.id,...t})),Wc=(e,t)=>e.map(n=>{var s,r,i;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:((r=n.data)==null?void 0:r.color)??t,variant:((i=n.data)==null?void 0:i.variant)??"pipe",...n}}),Kc=e=>({...e.position,zoom:e.zoom}),qc=e=>({position:d.G.construct(e),zoom:e.zoom}),Xc=(e,t)=>Yc(t(Cr(e))),ns=(e,t,n)=>Wc(t(br(e)),n),S0=(e,t="x")=>{if(e.length===0)return[];const n=d.K.construct(t),s=d.K.swap(n);return e.sort((r,i)=>d.Mo.loc(r.box,n)-d.Mo.loc(i.box,n)),e.forEach((r,i)=>{if(i===0)return;const c=e[i-1].handles.find(f=>f.orientation===s),a=r.handles.find(f=>f.orientation===n);if(c==null||a==null)return;const u=c.absolutePosition,x=a.absolutePosition,p=d.G.set(d.G.translation(x,u),t,0),m=d.G.translate(d.Mo.topLeft(r.box),p);r.box=d.Mo.construct(m,d.Mo.dims(r.box))}),e};function ze(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=ze(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var R0={value:()=>{}};function zs(){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 ss(n)}function ss(e){this._=e}function C0(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}ss.prototype=zs.prototype={constructor:ss,on:function(e,t){var n=this._,s=C0(e+"",n),r,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((r=(e=s[i]).type)&&(r=b0(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(r=(e=s[i]).type)n[r]=gi(n[r],e.name,t);else if(t==null)for(r in n)n[r]=gi(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ss(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[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],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function b0(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function gi(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=R0,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Io="http://www.w3.org/1999/xhtml";const ji={svg:"http://www.w3.org/2000/svg",xhtml:Io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $s(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ji.hasOwnProperty(t)?{space:ji[t],local:e}:e}function w0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Io&&t.documentElement.namespaceURI===Io?t.createElement(e):t.createElementNS(n,e)}}function v0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Uc(e){var t=$s(e);return(t.local?v0:w0)(t)}function k0(){}function wr(e){return e==null?k0:function(){return this.querySelector(e)}}function M0(e){typeof e!="function"&&(e=wr(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=new Array(l),a,u,x=0;x<l;++x)(a=i[x])&&(u=e.call(a,a.__data__,x,i))&&("__data__"in a&&(u.__data__=a.__data__),c[x]=u);return new Ze(s,this._parents)}function _0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function P0(){return[]}function Jc(e){return e==null?P0:function(){return this.querySelectorAll(e)}}function L0(e){return function(){return _0(e.apply(this,arguments))}}function N0(e){typeof e=="function"?e=L0(e):e=Jc(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var l=t[i],c=l.length,a,u=0;u<c;++u)(a=l[u])&&(s.push(e.call(a,a.__data__,u,l)),r.push(a));return new Ze(s,r)}function Qc(e){return function(){return this.matches(e)}}function ea(e){return function(t){return t.matches(e)}}var T0=Array.prototype.find;function A0(e){return function(){return T0.call(this.children,e)}}function I0(){return this.firstElementChild}function z0(e){return this.select(e==null?I0:A0(typeof e=="function"?e:ea(e)))}var $0=Array.prototype.filter;function D0(){return Array.from(this.children)}function B0(e){return function(){return $0.call(this.children,e)}}function O0(e){return this.selectAll(e==null?D0:B0(typeof e=="function"?e:ea(e)))}function V0(e){typeof e!="function"&&(e=Qc(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=[],a,u=0;u<l;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&c.push(a);return new Ze(s,this._parents)}function ta(e){return new Array(e.length)}function F0(){return new Ze(this._enter||this._groups.map(ta),this._parents)}function gs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}gs.prototype={constructor:gs,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 H0(e){return function(){return e}}function Z0(e,t,n,s,r,i){for(var l=0,c,a=t.length,u=i.length;l<u;++l)(c=t[l])?(c.__data__=i[l],s[l]=c):n[l]=new gs(e,i[l]);for(;l<a;++l)(c=t[l])&&(r[l]=c)}function G0(e,t,n,s,r,i,l){var c,a,u=new Map,x=t.length,p=i.length,m=new Array(x),f;for(c=0;c<x;++c)(a=t[c])&&(m[c]=f=l.call(a,a.__data__,c,t)+"",u.has(f)?r[c]=a:u.set(f,a));for(c=0;c<p;++c)f=l.call(e,i[c],c,i)+"",(a=u.get(f))?(s[c]=a,a.__data__=i[c],u.delete(f)):n[c]=new gs(e,i[c]);for(c=0;c<x;++c)(a=t[c])&&u.get(m[c])===a&&(r[c]=a)}function Y0(e){return e.__data__}function W0(e,t){if(!arguments.length)return Array.from(this,Y0);var n=t?G0:Z0,s=this._parents,r=this._groups;typeof e!="function"&&(e=H0(e));for(var i=r.length,l=new Array(i),c=new Array(i),a=new Array(i),u=0;u<i;++u){var x=s[u],p=r[u],m=p.length,f=K0(e.call(x,x&&x.__data__,u,s)),h=f.length,j=c[u]=new Array(h),S=l[u]=new Array(h),R=a[u]=new Array(m);n(x,p,j,S,R,f,t);for(var w=0,E=0,C,P;w<h;++w)if(C=j[w]){for(w>=E&&(E=w+1);!(P=S[E])&&++E<h;);C._next=P||null}}return l=new Ze(l,s),l._enter=c,l._exit=a,l}function K0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function q0(){return new Ze(this._exit||this._groups.map(ta),this._parents)}function X0(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function U0(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,l=Math.min(r,i),c=new Array(r),a=0;a<l;++a)for(var u=n[a],x=s[a],p=u.length,m=c[a]=new Array(p),f,h=0;h<p;++h)(f=u[h]||x[h])&&(m[h]=f);for(;a<r;++a)c[a]=n[a];return new Ze(c,this._parents)}function J0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],l;--r>=0;)(l=s[r])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function Q0(e){e||(e=ej);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var l=n[i],c=l.length,a=r[i]=new Array(c),u,x=0;x<c;++x)(u=l[x])&&(a[x]=u);a.sort(t)}return new Ze(r,this._parents).order()}function ej(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function tj(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function nj(){return Array.from(this)}function sj(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var l=s[r];if(l)return l}return null}function oj(){let e=0;for(const t of this)++e;return e}function rj(){return!this.node()}function ij(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,l=r.length,c;i<l;++i)(c=r[i])&&e.call(c,c.__data__,i,r);return this}function lj(e){return function(){this.removeAttribute(e)}}function cj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function aj(e,t){return function(){this.setAttribute(e,t)}}function uj(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function dj(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function xj(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 pj(e,t){var n=$s(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?cj:lj:typeof t=="function"?n.local?xj:dj:n.local?uj:aj)(n,t))}function na(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function mj(e){return function(){this.style.removeProperty(e)}}function fj(e,t,n){return function(){this.style.setProperty(e,t,n)}}function hj(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function gj(e,t,n){return arguments.length>1?this.each((t==null?mj:typeof t=="function"?hj:fj)(e,t,n??"")):Jt(this.node(),e)}function Jt(e,t){return e.style.getPropertyValue(t)||na(e).getComputedStyle(e,null).getPropertyValue(t)}function jj(e){return function(){delete this[e]}}function Ej(e,t){return function(){this[e]=t}}function yj(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Sj(e,t){return arguments.length>1?this.each((t==null?jj:typeof t=="function"?yj:Ej)(e,t)):this.node()[e]}function sa(e){return e.trim().split(/^|\s+/)}function vr(e){return e.classList||new oa(e)}function oa(e){this._node=e,this._names=sa(e.getAttribute("class")||"")}oa.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 ra(e,t){for(var n=vr(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function ia(e,t){for(var n=vr(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function Rj(e){return function(){ra(this,e)}}function Cj(e){return function(){ia(this,e)}}function bj(e,t){return function(){(t.apply(this,arguments)?ra:ia)(this,e)}}function wj(e,t){var n=sa(e+"");if(arguments.length<2){for(var s=vr(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?bj:t?Rj:Cj)(n,t))}function vj(){this.textContent=""}function kj(e){return function(){this.textContent=e}}function Mj(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function _j(e){return arguments.length?this.each(e==null?vj:(typeof e=="function"?Mj:kj)(e)):this.node().textContent}function Pj(){this.innerHTML=""}function Lj(e){return function(){this.innerHTML=e}}function Nj(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Tj(e){return arguments.length?this.each(e==null?Pj:(typeof e=="function"?Nj:Lj)(e)):this.node().innerHTML}function Aj(){this.nextSibling&&this.parentNode.appendChild(this)}function Ij(){return this.each(Aj)}function zj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $j(){return this.each(zj)}function Dj(e){var t=typeof e=="function"?e:Uc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Bj(){return null}function Oj(e,t){var n=typeof e=="function"?e:Uc(e),s=t==null?Bj:typeof t=="function"?t:wr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function Vj(){var e=this.parentNode;e&&e.removeChild(this)}function Fj(){return this.each(Vj)}function Hj(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Zj(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gj(e){return this.select(e?Zj:Hj)}function Yj(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Wj(e){return function(t){e.call(this,t,this.__data__)}}function Kj(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 qj(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function Xj(e,t,n){return function(){var s=this.__on,r,i=Wj(t);if(s){for(var l=0,c=s.length;l<c;++l)if((r=s[l]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function Uj(e,t,n){var s=Kj(e+""),r,i=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var a=0,u=c.length,x;a<u;++a)for(r=0,x=c[a];r<i;++r)if((l=s[r]).type===x.type&&l.name===x.name)return x.value}return}for(c=t?Xj:qj,r=0;r<i;++r)this.each(c(s[r],t,n));return this}function la(e,t,n){var s=na(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Jj(e,t){return function(){return la(this,e,t)}}function Qj(e,t){return function(){return la(this,e,t.apply(this,arguments))}}function e2(e,t){return this.each((typeof t=="function"?Qj:Jj)(e,t))}function*t2(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,l;r<i;++r)(l=s[r])&&(yield l)}var ca=[null];function Ze(e,t){this._groups=e,this._parents=t}function In(){return new Ze([[document.documentElement]],ca)}function n2(){return this}Ze.prototype=In.prototype={constructor:Ze,select:M0,selectAll:N0,selectChild:z0,selectChildren:O0,filter:V0,data:W0,enter:F0,exit:q0,join:X0,merge:U0,selection:n2,order:J0,sort:Q0,call:tj,nodes:nj,node:sj,size:oj,empty:rj,each:ij,attr:pj,style:gj,property:Sj,classed:wj,text:_j,html:Tj,raise:Ij,lower:$j,append:Dj,insert:Oj,remove:Fj,clone:Gj,datum:Yj,on:Uj,dispatch:e2,[Symbol.iterator]:t2};function He(e){return typeof e=="string"?new Ze([[document.querySelector(e)]],[document.documentElement]):new Ze([[e]],ca)}function s2(e){let t;for(;t=e.sourceEvent;)e=t;return e}function qe(e,t){if(e=s2(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 r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const o2={passive:!1},wn={capture:!0,passive:!1};function mo(e){e.stopImmediatePropagation()}function Kt(e){e.preventDefault(),e.stopImmediatePropagation()}function aa(e){var t=e.document.documentElement,n=He(e).on("dragstart.drag",Kt,wn);"onselectstart"in t?n.on("selectstart.drag",Kt,wn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ua(e,t){var n=e.document.documentElement,s=He(e).on("dragstart.drag",null);t&&(s.on("click.drag",Kt,wn),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 Zn=e=>()=>e;function zo(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:l,y:c,dx:a,dy:u,dispatch:x}){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:r,enumerable:!0,configurable:!0},active:{value:i,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:x}})}zo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function r2(e){return!e.ctrlKey&&!e.button}function i2(){return this.parentNode}function l2(e,t){return t??{x:e.x,y:e.y}}function c2(){return navigator.maxTouchPoints||"ontouchstart"in this}function da(){var e=r2,t=i2,n=l2,s=c2,r={},i=zs("start","drag","end"),l=0,c,a,u,x,p=0;function m(C){C.on("mousedown.drag",f).filter(s).on("touchstart.drag",S).on("touchmove.drag",R,o2).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(C,P){if(!(x||!e.call(this,C,P))){var N=E(this,t.call(this,C,P),C,P,"mouse");N&&(He(C.view).on("mousemove.drag",h,wn).on("mouseup.drag",j,wn),aa(C.view),mo(C),u=!1,c=C.clientX,a=C.clientY,N("start",C))}}function h(C){if(Kt(C),!u){var P=C.clientX-c,N=C.clientY-a;u=P*P+N*N>p}r.mouse("drag",C)}function j(C){He(C.view).on("mousemove.drag mouseup.drag",null),ua(C.view,u),Kt(C),r.mouse("end",C)}function S(C,P){if(e.call(this,C,P)){var N=C.changedTouches,_=t.call(this,C,P),$=N.length,D,B;for(D=0;D<$;++D)(B=E(this,_,C,P,N[D].identifier,N[D]))&&(mo(C),B("start",C,N[D]))}}function R(C){var P=C.changedTouches,N=P.length,_,$;for(_=0;_<N;++_)($=r[P[_].identifier])&&(Kt(C),$("drag",C,P[_]))}function w(C){var P=C.changedTouches,N=P.length,_,$;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),_=0;_<N;++_)($=r[P[_].identifier])&&(mo(C),$("end",C,P[_]))}function E(C,P,N,_,$,D){var B=i.copy(),F=qe(D||N,P),O,M,y;if((y=n.call(C,new zo("beforestart",{sourceEvent:N,target:m,identifier:$,active:l,x:F[0],y:F[1],dx:0,dy:0,dispatch:B}),_))!=null)return O=y.x-F[0]||0,M=y.y-F[1]||0,function k(b,L,A){var T=F,V;switch(b){case"start":r[$]=k,V=l++;break;case"end":delete r[$],--l;case"drag":F=qe(A||L,P),V=l;break}B.call(b,C,new zo(b,{sourceEvent:L,subject:y,target:m,identifier:$,active:V,x:F[0]+O,y:F[1]+M,dx:F[0]-T[0],dy:F[1]-T[1],dispatch:B}),_)}}return m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Zn(!!C),m):e},m.container=function(C){return arguments.length?(t=typeof C=="function"?C:Zn(C),m):t},m.subject=function(C){return arguments.length?(n=typeof C=="function"?C:Zn(C),m):n},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:Zn(!!C),m):s},m.on=function(){var C=i.on.apply(i,arguments);return C===i?m:C},m.clickDistance=function(C){return arguments.length?(p=(C=+C)*C,m):Math.sqrt(p)},m}var Qt=0,hn=0,mn=0,xa=1e3,js,gn,Es=0,Bt=0,Ds=0,vn=typeof performance=="object"&&performance.now?performance:Date,pa=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kr(){return Bt||(pa(a2),Bt=vn.now()+Ds)}function a2(){Bt=0}function ys(){this._call=this._time=this._next=null}ys.prototype=ma.prototype={constructor:ys,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?kr():+n)+(t==null?0:+t),!this._next&&gn!==this&&(gn?gn._next=this:js=this,gn=this),this._call=e,this._time=n,$o()},stop:function(){this._call&&(this._call=null,this._time=1/0,$o())}};function ma(e,t,n){var s=new ys;return s.restart(e,t,n),s}function u2(){kr(),++Qt;for(var e=js,t;e;)(t=Bt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qt}function Ei(){Bt=(Es=vn.now())+Ds,Qt=hn=0;try{u2()}finally{Qt=0,x2(),Bt=0}}function d2(){var e=vn.now(),t=e-Es;t>xa&&(Ds-=t,Es=e)}function x2(){for(var e,t=js,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:js=n);gn=e,$o(s)}function $o(e){if(!Qt){hn&&(hn=clearTimeout(hn));var t=e-Bt;t>24?(e<1/0&&(hn=setTimeout(Ei,e-vn.now()-Ds)),mn&&(mn=clearInterval(mn))):(mn||(Es=vn.now(),mn=setInterval(d2,xa)),Qt=1,pa(Ei))}}function yi(e,t,n){var s=new ys;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var p2=zs("start","end","cancel","interrupt"),m2=[],fa=0,Si=1,Do=2,os=3,Ri=4,Bo=5,rs=6;function Bs(e,t,n,s,r,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;f2(e,n,{name:t,index:s,group:r,on:p2,tween:m2,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:fa})}function Mr(e,t){var n=Je(e,t);if(n.state>fa)throw new Error("too late; already scheduled");return n}function rt(e,t){var n=Je(e,t);if(n.state>os)throw new Error("too late; already running");return n}function Je(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function f2(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=ma(i,0,n.time);function i(u){n.state=Si,n.timer.restart(l,n.delay,n.time),n.delay<=u&&l(u-n.delay)}function l(u){var x,p,m,f;if(n.state!==Si)return a();for(x in s)if(f=s[x],f.name===n.name){if(f.state===os)return yi(l);f.state===Ri?(f.state=rs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete s[x]):+x<t&&(f.state=rs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete s[x])}if(yi(function(){n.state===os&&(n.state=Ri,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=Do,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Do){for(n.state=os,r=new Array(m=n.tween.length),x=0,p=-1;x<m;++x)(f=n.tween[x].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=f);r.length=p+1}}function c(u){for(var x=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Bo,1),p=-1,m=r.length;++p<m;)r[p].call(e,x);n.state===Bo&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=rs,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function is(e,t){var n=e.__transition,s,r,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){i=!1;continue}r=s.state>Do&&s.state<Bo,s.state=rs,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function h2(e){return this.each(function(){is(this,e)})}function g2(e,t){var n,s;return function(){var r=rt(this,e),i=r.tween;if(i!==n){s=n=i;for(var l=0,c=s.length;l<c;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}r.tween=s}}function j2(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=rt(this,e),l=i.tween;if(l!==s){r=(s=l).slice();for(var c={name:t,value:n},a=0,u=r.length;a<u;++a)if(r[a].name===t){r[a]=c;break}a===u&&r.push(c)}i.tween=r}}function E2(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Je(this.node(),n).tween,r=0,i=s.length,l;r<i;++r)if((l=s[r]).name===e)return l.value;return null}return this.each((t==null?g2:j2)(n,e,t))}function _r(e,t,n){var s=e._id;return e.each(function(){var r=rt(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Je(r,s).value[t]}}function ha(e,t){var n;return(typeof t=="number"?I.interpolateNumber:t instanceof I.color?I.interpolateRgb:(n=I.color(t))?(t=n,I.interpolateRgb):I.interpolateString)(e,t)}function y2(e){return function(){this.removeAttribute(e)}}function S2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function R2(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttribute(e);return l===r?null:l===s?i:i=t(s=l,n)}}function C2(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===r?null:l===s?i:i=t(s=l,n)}}function b2(e,t,n){var s,r,i;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===r?i:(r=a,i=t(s=l,c)))}}function w2(e,t,n){var s,r,i;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===r?i:(r=a,i=t(s=l,c)))}}function v2(e,t){var n=$s(e),s=n==="transform"?th:ha;return this.attrTween(e,typeof t=="function"?(n.local?w2:b2)(n,s,_r(this,"attr."+e,t)):t==null?(n.local?S2:y2)(n):(n.local?C2:R2)(n,s,t))}function k2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function M2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function _2(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&M2(e,i)),n}return r._value=t,r}function P2(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&k2(e,i)),n}return r._value=t,r}function L2(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=$s(e);return this.tween(n,(s.local?_2:P2)(s,t))}function N2(e,t){return function(){Mr(this,e).delay=+t.apply(this,arguments)}}function T2(e,t){return t=+t,function(){Mr(this,e).delay=t}}function A2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?N2:T2)(t,e)):Je(this.node(),t).delay}function I2(e,t){return function(){rt(this,e).duration=+t.apply(this,arguments)}}function z2(e,t){return t=+t,function(){rt(this,e).duration=t}}function $2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?I2:z2)(t,e)):Je(this.node(),t).duration}function D2(e,t){if(typeof t!="function")throw new Error;return function(){rt(this,e).ease=t}}function B2(e){var t=this._id;return arguments.length?this.each(D2(t,e)):Je(this.node(),t).ease}function O2(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;rt(this,e).ease=n}}function V2(e){if(typeof e!="function")throw new Error;return this.each(O2(this._id,e))}function F2(e){typeof e!="function"&&(e=Qc(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=[],a,u=0;u<l;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&c.push(a);return new at(s,this._parents,this._name,this._id)}function H2(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),l=new Array(s),c=0;c<i;++c)for(var a=t[c],u=n[c],x=a.length,p=l[c]=new Array(x),m,f=0;f<x;++f)(m=a[f]||u[f])&&(p[f]=m);for(;c<s;++c)l[c]=t[c];return new at(l,this._parents,this._name,this._id)}function Z2(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 G2(e,t,n){var s,r,i=Z2(t)?Mr:rt;return function(){var l=i(this,e),c=l.on;c!==s&&(r=(s=c).copy()).on(t,n),l.on=r}}function Y2(e,t){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(e):this.each(G2(n,e,t))}function W2(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function K2(){return this.on("end.remove",W2(this._id))}function q2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wr(e));for(var s=this._groups,r=s.length,i=new Array(r),l=0;l<r;++l)for(var c=s[l],a=c.length,u=i[l]=new Array(a),x,p,m=0;m<a;++m)(x=c[m])&&(p=e.call(x,x.__data__,m,c))&&("__data__"in x&&(p.__data__=x.__data__),u[m]=p,Bs(u[m],t,n,m,u,Je(x,n)));return new at(i,this._parents,t,n)}function X2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jc(e));for(var s=this._groups,r=s.length,i=[],l=[],c=0;c<r;++c)for(var a=s[c],u=a.length,x,p=0;p<u;++p)if(x=a[p]){for(var m=e.call(x,x.__data__,p,a),f,h=Je(x,n),j=0,S=m.length;j<S;++j)(f=m[j])&&Bs(f,t,n,j,m,h);i.push(m),l.push(x)}return new at(i,l,t,n)}var U2=In.prototype.constructor;function J2(){return new U2(this._groups,this._parents)}function Q2(e,t){var n,s,r;return function(){var i=Jt(this,e),l=(this.style.removeProperty(e),Jt(this,e));return i===l?null:i===n&&l===s?r:r=t(n=i,s=l)}}function ga(e){return function(){this.style.removeProperty(e)}}function e3(e,t,n){var s,r=n+"",i;return function(){var l=Jt(this,e);return l===r?null:l===s?i:i=t(s=l,n)}}function t3(e,t,n){var s,r,i;return function(){var l=Jt(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),Jt(this,e))),l===a?null:l===s&&a===r?i:(r=a,i=t(s=l,c))}}function n3(e,t){var n,s,r,i="style."+t,l="end."+i,c;return function(){var a=rt(this,e),u=a.on,x=a.value[i]==null?c||(c=ga(t)):void 0;(u!==n||r!==x)&&(s=(n=u).copy()).on(l,r=x),a.on=s}}function s3(e,t,n){var s=(e+="")=="transform"?eh:ha;return t==null?this.styleTween(e,Q2(e,s)).on("end.style."+e,ga(e)):typeof t=="function"?this.styleTween(e,t3(e,s,_r(this,"style."+e,t))).each(n3(this._id,e)):this.styleTween(e,e3(e,s,t),n).on("end.style."+e,null)}function o3(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function r3(e,t,n){var s,r;function i(){var l=t.apply(this,arguments);return l!==r&&(s=(r=l)&&o3(e,l,n)),s}return i._value=t,i}function i3(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,r3(e,t,n??""))}function l3(e){return function(){this.textContent=e}}function c3(e){return function(){var t=e(this);this.textContent=t??""}}function a3(e){return this.tween("text",typeof e=="function"?c3(_r(this,"text",e)):l3(e==null?"":e+""))}function u3(e){return function(t){this.textContent=e.call(this,t)}}function d3(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&u3(r)),t}return s._value=e,s}function x3(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,d3(e))}function p3(){for(var e=this._name,t=this._id,n=ja(),s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],c=l.length,a,u=0;u<c;++u)if(a=l[u]){var x=Je(a,t);Bs(a,e,n,u,l,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new at(s,this._parents,e,n)}function m3(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,l){var c={value:l},a={value:function(){--r===0&&i()}};n.each(function(){var u=rt(this,s),x=u.on;x!==e&&(t=(e=x).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(a)),u.on=t}),r===0&&i()})}var f3=0;function at(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function ja(){return++f3}var it=In.prototype;at.prototype={constructor:at,select:q2,selectAll:X2,selectChild:it.selectChild,selectChildren:it.selectChildren,filter:F2,merge:H2,selection:J2,transition:p3,call:it.call,nodes:it.nodes,node:it.node,size:it.size,empty:it.empty,each:it.each,on:Y2,attr:v2,attrTween:L2,style:s3,styleTween:i3,text:a3,textTween:x3,remove:K2,tween:E2,delay:A2,duration:$2,ease:B2,easeVarying:V2,end:m3,[Symbol.iterator]:it[Symbol.iterator]};function h3(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var g3={time:null,delay:0,duration:250,ease:h3};function j3(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 E3(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=ja(),(n=g3).time=kr(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],c=l.length,a,u=0;u<c;++u)(a=l[u])&&Bs(a,e,t,u,l,n||j3(a,t));return new at(s,this._parents,e,t)}In.prototype.interrupt=h2;In.prototype.transition=E3;const Gn=e=>()=>e;function y3(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){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:r}})}function lt(e,t,n){this.k=e,this.x=t,this.y=n}lt.prototype={constructor:lt,scale:function(e){return e===1?this:new lt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new lt(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 Os=new lt(1,0,0);Ea.prototype=lt.prototype;function Ea(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Os;return e.__zoom}function fo(e){e.stopImmediatePropagation()}function fn(e){e.preventDefault(),e.stopImmediatePropagation()}function S3(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function R3(){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 Ci(){return this.__zoom||Os}function C3(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function b3(){return navigator.maxTouchPoints||"ontouchstart"in this}function w3(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function ya(){var e=S3,t=R3,n=w3,s=C3,r=b3,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=rh,u=zs("start","zoom","end"),x,p,m,f=500,h=150,j=0,S=10;function R(y){y.property("__zoom",Ci).on("wheel.zoom",$,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",B).filter(r).on("touchstart.zoom",F).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}R.transform=function(y,k,b,L){var A=y.selection?y.selection():y;A.property("__zoom",Ci),y!==A?P(y,k,b,L):A.interrupt().each(function(){N(this,arguments).event(L).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},R.scaleBy=function(y,k,b,L){R.scaleTo(y,function(){var A=this.__zoom.k,T=typeof k=="function"?k.apply(this,arguments):k;return A*T},b,L)},R.scaleTo=function(y,k,b,L){R.transform(y,function(){var A=t.apply(this,arguments),T=this.__zoom,V=b==null?C(A):typeof b=="function"?b.apply(this,arguments):b,H=T.invert(V),G=typeof k=="function"?k.apply(this,arguments):k;return n(E(w(T,G),V,H),A,l)},b,L)},R.translateBy=function(y,k,b,L){R.transform(y,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof b=="function"?b.apply(this,arguments):b),t.apply(this,arguments),l)},null,L)},R.translateTo=function(y,k,b,L,A){R.transform(y,function(){var T=t.apply(this,arguments),V=this.__zoom,H=L==null?C(T):typeof L=="function"?L.apply(this,arguments):L;return n(Os.translate(H[0],H[1]).scale(V.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof b=="function"?-b.apply(this,arguments):-b),T,l)},L,A)};function w(y,k){return k=Math.max(i[0],Math.min(i[1],k)),k===y.k?y:new lt(k,y.x,y.y)}function E(y,k,b){var L=k[0]-b[0]*y.k,A=k[1]-b[1]*y.k;return L===y.x&&A===y.y?y:new lt(y.k,L,A)}function C(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}function P(y,k,b,L){y.on("start.zoom",function(){N(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(L).end()}).tween("zoom",function(){var A=this,T=arguments,V=N(A,T).event(L),H=t.apply(A,T),G=b==null?C(H):typeof b=="function"?b.apply(A,T):b,ee=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),te=A.__zoom,ne=typeof k=="function"?k.apply(A,T):k,se=a(te.invert(G).concat(ee/te.k),ne.invert(G).concat(ee/ne.k));return function(J){if(J===1)J=ne;else{var ie=se(J),fe=ee/ie[2];J=new lt(fe,G[0]-ie[0]*fe,G[1]-ie[1]*fe)}V.zoom(null,J)}})}function N(y,k,b){return!b&&y.__zooming||new _(y,k)}function _(y,k){this.that=y,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(y,k),this.taps=0}_.prototype={event:function(y){return y&&(this.sourceEvent=y),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(y,k){return this.mouse&&y!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&y!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&y!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(y){var k=He(this.that).datum();u.call(y,this.that,new y3(y,{sourceEvent:this.sourceEvent,target:R,transform:this.that.__zoom,dispatch:u}),k)}};function $(y,...k){if(!e.apply(this,arguments))return;var b=N(this,k).event(y),L=this.__zoom,A=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,s.apply(this,arguments)))),T=qe(y);if(b.wheel)(b.mouse[0][0]!==T[0]||b.mouse[0][1]!==T[1])&&(b.mouse[1]=L.invert(b.mouse[0]=T)),clearTimeout(b.wheel);else{if(L.k===A)return;b.mouse=[T,L.invert(T)],is(this),b.start()}fn(y),b.wheel=setTimeout(V,h),b.zoom("mouse",n(E(w(L,A),b.mouse[0],b.mouse[1]),b.extent,l));function V(){b.wheel=null,b.end()}}function D(y,...k){if(m||!e.apply(this,arguments))return;var b=y.currentTarget,L=N(this,k,!0).event(y),A=He(y.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",ee,!0),T=qe(y,b),V=y.clientX,H=y.clientY;aa(y.view),fo(y),L.mouse=[T,this.__zoom.invert(T)],is(this),L.start();function G(te){if(fn(te),!L.moved){var ne=te.clientX-V,se=te.clientY-H;L.moved=ne*ne+se*se>j}L.event(te).zoom("mouse",n(E(L.that.__zoom,L.mouse[0]=qe(te,b),L.mouse[1]),L.extent,l))}function ee(te){A.on("mousemove.zoom mouseup.zoom",null),ua(te.view,L.moved),fn(te),L.event(te).end()}}function B(y,...k){if(e.apply(this,arguments)){var b=this.__zoom,L=qe(y.changedTouches?y.changedTouches[0]:y,this),A=b.invert(L),T=b.k*(y.shiftKey?.5:2),V=n(E(w(b,T),L,A),t.apply(this,k),l);fn(y),c>0?He(this).transition().duration(c).call(P,V,L,y):He(this).call(R.transform,V,L,y)}}function F(y,...k){if(e.apply(this,arguments)){var b=y.touches,L=b.length,A=N(this,k,y.changedTouches.length===L).event(y),T,V,H,G;for(fo(y),V=0;V<L;++V)H=b[V],G=qe(H,this),G=[G,this.__zoom.invert(G),H.identifier],A.touch0?!A.touch1&&A.touch0[2]!==G[2]&&(A.touch1=G,A.taps=0):(A.touch0=G,T=!0,A.taps=1+!!x);x&&(x=clearTimeout(x)),T&&(A.taps<2&&(p=G[0],x=setTimeout(function(){x=null},f)),is(this),A.start())}}function O(y,...k){if(this.__zooming){var b=N(this,k).event(y),L=y.changedTouches,A=L.length,T,V,H,G;for(fn(y),T=0;T<A;++T)V=L[T],H=qe(V,this),b.touch0&&b.touch0[2]===V.identifier?b.touch0[0]=H:b.touch1&&b.touch1[2]===V.identifier&&(b.touch1[0]=H);if(V=b.that.__zoom,b.touch1){var ee=b.touch0[0],te=b.touch0[1],ne=b.touch1[0],se=b.touch1[1],J=(J=ne[0]-ee[0])*J+(J=ne[1]-ee[1])*J,ie=(ie=se[0]-te[0])*ie+(ie=se[1]-te[1])*ie;V=w(V,Math.sqrt(J/ie)),H=[(ee[0]+ne[0])/2,(ee[1]+ne[1])/2],G=[(te[0]+se[0])/2,(te[1]+se[1])/2]}else if(b.touch0)H=b.touch0[0],G=b.touch0[1];else return;b.zoom("touch",n(E(V,H,G),b.extent,l))}}function M(y,...k){if(this.__zooming){var b=N(this,k).event(y),L=y.changedTouches,A=L.length,T,V;for(fo(y),m&&clearTimeout(m),m=setTimeout(function(){m=null},f),T=0;T<A;++T)V=L[T],b.touch0&&b.touch0[2]===V.identifier?delete b.touch0:b.touch1&&b.touch1[2]===V.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(V=qe(V,this),Math.hypot(p[0]-V[0],p[1]-V[1])<S)){var H=He(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return R.wheelDelta=function(y){return arguments.length?(s=typeof y=="function"?y:Gn(+y),R):s},R.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Gn(!!y),R):e},R.touchable=function(y){return arguments.length?(r=typeof y=="function"?y:Gn(!!y),R):r},R.extent=function(y){return arguments.length?(t=typeof y=="function"?y:Gn([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),R):t},R.scaleExtent=function(y){return arguments.length?(i[0]=+y[0],i[1]=+y[1],R):[i[0],i[1]]},R.translateExtent=function(y){return arguments.length?(l[0][0]=+y[0][0],l[1][0]=+y[1][0],l[0][1]=+y[0][1],l[1][1]=+y[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(y){return arguments.length?(n=y,R):n},R.duration=function(y){return arguments.length?(c=+y,R):c},R.interpolate=function(y){return arguments.length?(a=y,R):a},R.on=function(){var y=u.on.apply(u,arguments);return y===u?R:y},R.clickDistance=function(y){return arguments.length?(j=(y=+y)*y,R):Math.sqrt(j)},R.tapDistance=function(y){return arguments.length?(S=+y,R):S},R}const Oe={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.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},kn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Sa=["Enter"," ","Escape"];var Ot;(function(e){e.Strict="strict",e.Loose="loose"})(Ot||(Ot={}));var It;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(It||(It={}));var en;(function(e){e.Partial="partial",e.Full="full"})(en||(en={}));const Ra={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var jt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(jt||(jt={}));var Ss;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ss||(Ss={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const bi={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Ca(e){return e===null?null:e?"valid":"invalid"}const ba=e=>"id"in e&&"source"in e&&"target"in e,v3=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Pr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),zn=(e,t=[0,0])=>{const{width:n,height:s}=mt(e),r=e.origin??t,i=n*r[0],l=s*r[1];return{x:e.position.x-i,y:e.position.y-l}},k3=(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,r)=>{const i=typeof r=="string";let l=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(r):Pr(r)?r:t.nodeLookup.get(r.id));const c=l?Rs(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 Fs(n)},$n=(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 r=Rs(s);n=Vs(n,r)}}),Fs(n)},wa=(e,t,[n,s,r]=[0,0,1],i=!1,l=!1)=>{const c={...Dn(t,[n,s,r]),width:t.width/r,height:t.height/r},a=[];for(const u of e.values()){const{measured:x,selectable:p=!0,hidden:m=!1}=u;if(l&&!p||m)continue;const f=x.width??u.width??u.initialWidth??null,h=x.height??u.height??u.initialHeight??null,j=Mn(c,nn(u)),S=(f??0)*(h??0),R=i&&j>0;(!u.internals.handleBounds||R||j>=S||u.dragging)&&a.push(u)}return a},M3=(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 Oo(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function Vo({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},l){if(e.size===0)return Promise.resolve(!1);const c=$n(e),a=Lr(c,t,n,(l==null?void 0:l.minZoom)??r,(l==null?void 0:l.maxZoom)??i,(l==null?void 0:l.padding)??.1);return await s.setViewport(a,{duration:l==null?void 0:l.duration}),Promise.resolve(!0)}function va({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){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},x=l.origin??s;let p=r;if(l.extent==="parent"&&!l.expandParent)if(!c)i==null||i("005",Oe.error005());else{const f=c.measured.width,h=c.measured.height;f&&h&&(p=[[a,u],[a+f,u+h]])}else c&&sn(l.extent)&&(p=[[l.extent[0][0]+a,l.extent[0][1]+u],[l.extent[1][0]+a,l.extent[1][1]+u]]);const m=sn(p)?Vt(t,p,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(i==null||i("015",Oe.error015())),{position:{x:m.x-a+(l.measured.width??0)*x[0],y:m.y-u+(l.measured.height??0)*x[1]},positionAbsolute:m}}async function _3({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(m=>m.id)),l=[];for(const m of n){if(m.deletable===!1)continue;const f=i.has(m.id),h=!f&&m.parentId&&l.find(j=>j.id===m.parentId);(f||h)&&l.push(m)}const c=new Set(t.map(m=>m.id)),a=s.filter(m=>m.deletable!==!1),x=M3(l,a);for(const m of a)c.has(m.id)&&!x.find(h=>h.id===m.id)&&x.push(m);if(!r)return{edges:x,nodes:l};const p=await r({nodes:l,edges:x});return typeof p=="boolean"?p?{edges:x,nodes:l}:{edges:[],nodes:[]}:p}const tn=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Vt=(e={x:0,y:0},t,n)=>({x:tn(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:tn(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function ka(e,t,n){const{width:s,height:r}=mt(n),{x:i,y:l}=n.internals.positionAbsolute;return Vt(e,[[i,l],[i+s,l+r]],t)}const wi=(e,t,n)=>e<t?tn(Math.abs(e-t),1,t)/t:e>n?-tn(Math.abs(e-n),1,t)/t:0,Ma=(e,t,n=15,s=40)=>{const r=wi(e.x,s,t.width-s)*n,i=wi(e.y,s,t.height-s)*n;return[r,i]},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)}),Fo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Fs=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),nn=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=Pr(e)?e.internals.positionAbsolute:zn(e,t);return{x:n,y:s,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Rs=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=Pr(e)?e.internals.positionAbsolute:zn(e,t);return{x:n,y:s,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:s+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},_a=(e,t)=>Fs(Vs(Fo(e),Fo(t))),Mn=(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)},vi=e=>Xe(e.width)&&Xe(e.height)&&Xe(e.x)&&Xe(e.y),Xe=e=>!isNaN(e)&&isFinite(e),Cs=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},Hs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Dn=({x:e,y:t},[n,s,r],i=!1,l=[1,1])=>{const c={x:(e-n)/r,y:(t-s)/r};return i?Hs(c,l):c},Pa=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s}),Lr=(e,t,n,s,r,i)=>{const l=t/(e.width*(1+i)),c=n/(e.height*(1+i)),a=Math.min(l,c),u=tn(a,s,r),x=e.x+e.width/2,p=e.y+e.height/2,m=t/2-x*u,f=n/2-p*u;return{x:m,y:f,zoom:u}},bs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function sn(e){return e!==void 0&&e!=="parent"}function mt(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 La(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 Na(e,t={width:0,height:0},n,s,r){const i={...e},l=s.get(n);if(l){const c=l.origin||r;i.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],i.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return i}function ki(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function En(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:l}=ct(e),c=Dn({x:i-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)},s),{x:a,y:u}=n?Hs(c,t):c;return{xSnapped:a,ySnapped:u,...c}}const Zs=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ta=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},P3=["INPUT","SELECT","TEXTAREA"];function Ho(e){var s,r;const t=((r=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:r[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:P3.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Aa=e=>"clientX"in e,ct=(e,t)=>{var i,l;const n=Aa(e),s=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,r=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},Mi=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:r,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/s,y:(c.top-n.top)/s,...Zs(l)}})};function Ia({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:l,targetControlY:c}){const a=e*.125+r*.375+l*.375+n*.125,u=t*.125+i*.375+c*.375+s*.125,x=Math.abs(a-e),p=Math.abs(u-t);return[a,u,x,p]}function Yn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function _i({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case X.Left:return[t-Yn(t-s,i),n];case X.Right:return[t+Yn(s-t,i),n];case X.Top:return[t,n-Yn(n-r,i)];case X.Bottom:return[t,n+Yn(r-n,i)]}}function za({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top,curvature:l=.25}){const[c,a]=_i({pos:n,x1:e,y1:t,x2:s,y2:r,c:l}),[u,x]=_i({pos:i,x1:s,y1:r,x2:e,y2:t,c:l}),[p,m,f,h]=Ia({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:c,sourceControlY:a,targetControlX:u,targetControlY:x});return[`M${e},${t} C${c},${a} ${u},${x} ${s},${r}`,p,m,f,h]}function $a({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,l=Math.abs(s-t)/2,c=s<t?s+l:s-l;return[i,c,r,l]}function L3({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:r=!1}){if(!r)return s;const i=n||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return s+(i?l:0)}function N3({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=Vs(Rs(e),Rs(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return Mn(l,Fs(i))>0}const Da=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,T3=(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)),Ba=(e,t)=>{if(!e.source||!e.target)return Cs("006",Oe.error006()),t;let n;return ba(e)?n={...e}:n={...e,id:Da(e)},T3(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},A3=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...i}=e;if(!t.source||!t.target)return Cs("006",Oe.error006()),n;if(!n.find(a=>a.id===e.id))return Cs("007",Oe.error007(r)),n;const c={...i,id:s.shouldReplaceId?Da(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==r).concat(c)};function Oa({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,l,c]=$a({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,l,c]}const Pi={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},I3=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},Li=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function z3({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:s=X.Top,center:r,offset:i}){const l=Pi[t],c=Pi[s],a={x:e.x+l.x*i,y:e.y+l.y*i},u={x:n.x+c.x*i,y:n.y+c.y*i},x=I3({source:a,sourcePosition:t,target:u}),p=x.x!==0?"x":"y",m=x[p];let f=[],h,j;const S={x:0,y:0},R={x:0,y:0},[w,E,C,P]=$a({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*c[p]===-1){h=r.x??w,j=r.y??E;const _=[{x:h,y:a.y},{x:h,y:u.y}],$=[{x:a.x,y:j},{x:u.x,y:j}];l[p]===m?f=p==="x"?_:$:f=p==="x"?$:_}else{const _=[{x:a.x,y:u.y}],$=[{x:u.x,y:a.y}];if(p==="x"?f=l.x===m?$:_:f=l.y===m?_:$,t===s){const M=Math.abs(e[p]-n[p]);if(M<=i){const y=Math.min(i-1,i-M);l[p]===m?S[p]=(a[p]>e[p]?-1:1)*y:R[p]=(u[p]>n[p]?-1:1)*y}}if(t!==s){const M=p==="x"?"y":"x",y=l[p]===c[M],k=a[M]>u[M],b=a[M]<u[M];(l[p]===1&&(!y&&k||y&&b)||l[p]!==1&&(!y&&b||y&&k))&&(f=p==="x"?_:$)}const D={x:a.x+S.x,y:a.y+S.y},B={x:u.x+R.x,y:u.y+R.y},F=Math.max(Math.abs(D.x-f[0].x),Math.abs(B.x-f[0].x)),O=Math.max(Math.abs(D.y-f[0].y),Math.abs(B.y-f[0].y));F>=O?(h=(D.x+B.x)/2,j=f[0].y):(h=f[0].x,j=(D.y+B.y)/2)}return[[e,{x:a.x+S.x,y:a.y+S.y},...f,{x:u.x+R.x,y:u.y+R.y},n],h,j,C,P]}function $3(e,t,n,s){const r=Math.min(Li(e,t)/2,Li(t,n)/2,s),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const u=e.x<n.x?-1:1,x=e.y<n.y?1:-1;return`L ${i+r*u},${l}Q ${i},${l} ${i},${l+r*x}`}const c=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${l+r*a}Q ${i},${l} ${i+r*c},${l}`}function Zo({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top,borderRadius:l=5,centerX:c,centerY:a,offset:u=20}){const[x,p,m,f,h]=z3({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:c,y:a},offset:u});return[x.reduce((S,R,w)=>{let E="";return w>0&&w<x.length-1?E=$3(x[w-1],R,x[w+1],l):E=`${w===0?"M":"L"}${R.x} ${R.y}`,S+=E,S},""),p,m,f,h]}function Ni(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function D3(e){var p;const{sourceNode:t,targetNode:n}=e;if(!Ni(t)||!Ni(n))return null;const s=t.internals.handleBounds||Ti(t.handles),r=n.internals.handleBounds||Ti(n.handles),i=Ai((s==null?void 0:s.source)??[],e.sourceHandle),l=Ai(e.connectionMode===Ot.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!i||!l)return(p=e.onError)==null||p.call(e,"008",Oe.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(i==null?void 0:i.position)||X.Bottom,a=(l==null?void 0:l.position)||X.Top,u=_n(t,i,c),x=_n(n,l,a);return{sourceX:u.x,sourceY:u.y,targetX:x.x,targetY:x.y,sourcePosition:c,targetPosition:a}}function Ti(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 _n(e,t,n=X.Left,s=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??mt(e);if(s)return{x:r+l/2,y:i+c/2};switch((t==null?void 0:t.position)??n){case X.Top:return{x:r+l/2,y:i};case X.Right:return{x:r+l,y:i+c/2};case X.Bottom:return{x:r+l/2,y:i+c};case X.Left:return{x:r,y:i+c/2}}}function Ai(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Go(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function B3(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((l,c)=>([c.markerStart||s,c.markerEnd||r].forEach(a=>{if(a&&typeof a=="object"){const u=Go(a,t);i.has(u)||(l.push({id:u,color:a.color||n,...a}),i.add(u))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const Nr={nodeOrigin:[0,0],nodeExtent:kn,elevateNodesOnSelect:!0,defaults:{}},O3={...Nr,checkEquality:!0};function Tr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function V3(e,t,n){const s=Tr(Nr,n);for(const r of e.values())if(r.parentId)Ar(r,e,t,s);else{const i=zn(r,s.nodeOrigin),l=sn(r.extent)?r.extent:s.nodeExtent,c=Vt(i,l,mt(r));r.internals.positionAbsolute=c}}function Yo(e,t,n,s){var c,a;const r=Tr(O3,s),i=new Map(t),l=r!=null&&r.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let x=i.get(u.id);if(r.checkEquality&&u===(x==null?void 0:x.internals.userNode))t.set(u.id,x);else{const p=zn(u,r.nodeOrigin),m=sn(u.extent)?u.extent:r.nodeExtent,f=Vt(p,m,mt(u));x={...r.defaults,...u,measured:{width:(c=u.measured)==null?void 0:c.width,height:(a=u.measured)==null?void 0:a.height},internals:{positionAbsolute:f,handleBounds:u.measured?x==null?void 0:x.internals.handleBounds:void 0,z:Va(u,l),userNode:u}},t.set(u.id,x)}u.parentId&&Ar(x,t,n,s)}}function F3(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 Ar(e,t,n,s){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:l}=Tr(Nr,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}F3(e,n);const u=r?1e3:0,{x,y:p,z:m}=H3(e,a,i,l,u),{positionAbsolute:f}=e.internals,h=x!==f.x||p!==f.y;(h||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x,y:p}:f,z:m}})}function Va(e,t){return(Xe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function H3(e,t,n,s,r){const{x:i,y:l}=t.internals.positionAbsolute,c=mt(e),a=zn(e,n),u=sn(e.extent)?Vt(a,e.extent,c):a;let x=Vt({x:i+u.x,y:l+u.y},s,c);e.extent==="parent"&&(x=ka(x,c,t));const p=Va(e,r),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>p?m:p}}function Ir(e,t,n,s=[0,0]){var l;const r=[],i=new Map;for(const c of e){const a=t.get(c.parentId);if(!a)continue;const u=((l=i.get(c.parentId))==null?void 0:l.expandedRect)??nn(a),x=_a(u,c.rect);i.set(c.parentId,{expandedRect:x,parent:a})}return i.size>0&&i.forEach(({expandedRect:c,parent:a},u)=>{var E;const x=a.internals.positionAbsolute,p=mt(a),m=a.origin??s,f=c.x<x.x?Math.round(Math.abs(x.x-c.x)):0,h=c.y<x.y?Math.round(Math.abs(x.y-c.y)):0,j=Math.max(p.width,Math.round(c.width)),S=Math.max(p.height,Math.round(c.height)),R=(j-p.width)*m[0],w=(S-p.height)*m[1];(f>0||h>0||R||w)&&(r.push({id:u,type:"position",position:{x:a.position.x-f+R,y:a.position.y-h+w}}),(E=n.get(u))==null||E.forEach(C=>{e.some(P=>P.id===C.id)||r.push({id:C.id,type:"position",position:{x:C.position.x+f,y:C.position.y+h}})})),(p.width<c.width||p.height<c.height||f||h)&&r.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:j+(f?m[0]*f-R:0),height:S+(h?m[1]*h-w:0)}})}),r}function Z3(e,t,n,s,r,i){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:x}=new window.DOMMatrixReadOnly(u.transform),p=[];for(const m of e.values()){const f=t.get(m.id);if(!f)continue;if(f.hidden){t.set(f.id,{...f,internals:{...f.internals,handleBounds:void 0}}),c=!0;continue}const h=Zs(m.nodeElement),j=f.measured.width!==h.width||f.measured.height!==h.height;if(!!(h.width&&h.height&&(j||!f.internals.handleBounds||m.force))){const R=m.nodeElement.getBoundingClientRect(),w=sn(f.extent)?f.extent:i;let{positionAbsolute:E}=f.internals;f.parentId&&f.extent==="parent"?E=ka(E,h,t.get(f.parentId)):w&&(E=Vt(E,w,h));const C={...f,measured:h,internals:{...f.internals,positionAbsolute:E,handleBounds:{source:Mi("source",m.nodeElement,R,x,f.id),target:Mi("target",m.nodeElement,R,x,f.id)}}};t.set(f.id,C),f.parentId&&Ar(C,t,n,{nodeOrigin:r}),c=!0,j&&(a.push({id:f.id,type:"dimensions",dimensions:h}),f.expandParent&&f.parentId&&p.push({id:f.id,parentId:f.parentId,rect:nn(C,r)}))}}if(p.length>0){const m=Ir(p,t,n,r);a.push(...m)}return{changes:a,updatedInternals:c}}async function G3({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){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],[r,i]],s),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function Ii(e,t,n,s,r,i){let l=r;const c=s.get(l)||new Map;s.set(l,c.set(n,t)),l=`${r}-${e}`;const a=s.get(l)||new Map;if(s.set(l,a.set(n,t)),i){l=`${r}-${e}-${i}`;const u=s.get(l)||new Map;s.set(l,u.set(n,t))}}function Fa(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:l=null,targetHandle:c=null}=s,a={edgeId:s.id,source:r,target:i,sourceHandle:l,targetHandle:c},u=`${r}-${l}--${i}-${c}`,x=`${i}-${c}--${r}-${l}`;Ii("source",a,x,e,r,l),Ii("target",a,u,e,i,c),t.set(s.id,s)}}function Ha(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Ha(n,t):!1}function zi(e,t,n){var r;let s=e;do{if((r=s==null?void 0:s.matches)!=null&&r.call(s,t))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function Y3(e,t,n,s){const r=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!Ha(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(i);c&&r.set(i,{id:i,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 r}function ho({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var l,c,a;const r=[];for(const[u,x]of t){const p=(l=n.get(u))==null?void 0:l.internals.userNode;p&&r.push({...p,position:x.position,dragging:s})}if(!e)return[r[0],r];const i=(c=n.get(e))==null?void 0:c.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:s}:r[0],r]}function W3({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},l=0,c=new Map,a=!1,u={x:0,y:0},x=null,p=!1,m=null,f=!1;function h({noDragClassName:S,handleSelector:R,domNode:w,isSelectable:E,nodeId:C,nodeClickDistance:P=0}){m=He(w);function N({x:B,y:F},O){const{nodeLookup:M,nodeExtent:y,snapGrid:k,snapToGrid:b,nodeOrigin:L,onNodeDrag:A,onSelectionDrag:T,onError:V,updateNodePositions:H}=t();i={x:B,y:F};let G=!1,ee={x:0,y:0,x2:0,y2:0};if(c.size>1&&y){const te=$n(c);ee=Fo(te)}for(const[te,ne]of c){if(!M.has(te))continue;let se={x:B-ne.distance.x,y:F-ne.distance.y};b&&(se=Hs(se,k));let J=[[y[0][0],y[0][1]],[y[1][0],y[1][1]]];if(c.size>1&&y&&!ne.extent){const{positionAbsolute:Me}=ne.internals,de=Me.x-ee.x+y[0][0],Y=Me.x+ne.measured.width-ee.x2+y[1][0],re=Me.y-ee.y+y[0][1],pe=Me.y+ne.measured.height-ee.y2+y[1][1];J=[[de,re],[Y,pe]]}const{position:ie,positionAbsolute:fe}=va({nodeId:te,nextPosition:se,nodeLookup:M,nodeExtent:J,nodeOrigin:L,onError:V});G=G||ne.position.x!==ie.x||ne.position.y!==ie.y,ne.position=ie,ne.internals.positionAbsolute=fe}if(G&&(H(c,!0),O&&(s||A||!C&&T))){const[te,ne]=ho({nodeId:C,dragItems:c,nodeLookup:M});s==null||s(O,c,te,ne),A==null||A(O,te,ne),C||T==null||T(O,ne)}}async function _(){if(!x)return;const{transform:B,panBy:F,autoPanSpeed:O,autoPanOnNodeDrag:M}=t();if(!M){a=!1,cancelAnimationFrame(l);return}const[y,k]=Ma(u,x,O);(y!==0||k!==0)&&(i.x=(i.x??0)-y/B[2],i.y=(i.y??0)-k/B[2],await F({x:y,y:k})&&N(i,null)),l=requestAnimationFrame(_)}function $(B){var G;const{nodeLookup:F,multiSelectionActive:O,nodesDraggable:M,transform:y,snapGrid:k,snapToGrid:b,selectNodesOnDrag:L,onNodeDragStart:A,onSelectionDragStart:T,unselectNodesAndEdges:V}=t();p=!0,(!L||!E)&&!O&&C&&((G=F.get(C))!=null&&G.selected||V()),E&&L&&C&&(e==null||e(C));const H=En(B.sourceEvent,{transform:y,snapGrid:k,snapToGrid:b,containerBounds:x});if(i=H,c=Y3(F,M,H,C),c.size>0&&(n||A||!C&&T)){const[ee,te]=ho({nodeId:C,dragItems:c,nodeLookup:F});n==null||n(B.sourceEvent,c,ee,te),A==null||A(B.sourceEvent,ee,te),C||T==null||T(B.sourceEvent,te)}}const D=da().clickDistance(P).on("start",B=>{const{domNode:F,nodeDragThreshold:O,transform:M,snapGrid:y,snapToGrid:k}=t();x=(F==null?void 0:F.getBoundingClientRect())||null,f=!1,O===0&&$(B),i=En(B.sourceEvent,{transform:M,snapGrid:y,snapToGrid:k,containerBounds:x}),u=ct(B.sourceEvent,x)}).on("drag",B=>{const{autoPanOnNodeDrag:F,transform:O,snapGrid:M,snapToGrid:y,nodeDragThreshold:k,nodeLookup:b}=t(),L=En(B.sourceEvent,{transform:O,snapGrid:M,snapToGrid:y,containerBounds:x});if((B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||C&&!b.has(C))&&(f=!0),!f){if(!a&&F&&p&&(a=!0,_()),!p){const A=L.xSnapped-(i.x??0),T=L.ySnapped-(i.y??0);Math.sqrt(A*A+T*T)>k&&$(B)}(i.x!==L.xSnapped||i.y!==L.ySnapped)&&c&&p&&(u=ct(B.sourceEvent,x),N(L,B.sourceEvent))}}).on("end",B=>{if(!(!p||f)&&(a=!1,p=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:F,updateNodePositions:O,onNodeDragStop:M,onSelectionDragStop:y}=t();if(O(c,!1),r||M||!C&&y){const[k,b]=ho({nodeId:C,dragItems:c,nodeLookup:F,dragging:!1});r==null||r(B.sourceEvent,c,k,b),M==null||M(B.sourceEvent,k,b),C||y==null||y(B.sourceEvent,b)}}}).filter(B=>{const F=B.target;return!B.button&&(!S||!zi(F,`.${S}`,w))&&(!R||zi(F,R,w))});m.call(D)}function j(){m==null||m.on(".drag",null)}return{update:h,destroy:j}}function K3(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Mn(r,nn(i))>0&&s.push(i);return s}const q3=250;function X3(e,t,n,s){var c,a;let r=[],i=1/0;const l=K3(e,n,t+q3);for(const u of l){const x=[...((c=u.internals.handleBounds)==null?void 0:c.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const p of x){if(s.nodeId===p.nodeId&&s.type===p.type&&s.id===p.id)continue;const{x:m,y:f}=_n(u,p,p.position,!0),h=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(f-e.y,2));h>t||(h<i?(r=[{...p,x:m,y:f}],i=h):h===i&&r.push({...p,x:m,y:f}))}}if(!r.length)return null;if(r.length>1){const u=s.type==="source"?"target":"source";return r.find(x=>x.type===u)??r[0]}return r[0]}function Za(e,t,n,s,r,i=!1){var u,x,p;const l=s.get(e);if(!l)return null;const c=r==="strict"?(u=l.internals.handleBounds)==null?void 0:u[t]:[...((x=l.internals.handleBounds)==null?void 0:x.source)??[],...((p=l.internals.handleBounds)==null?void 0:p.target)??[]],a=(n?c==null?void 0:c.find(m=>m.id===n):c==null?void 0:c[0])??null;return a&&i?{...a,..._n(l,a,a.position,!0)}:a}function Ga(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function U3(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ya=()=>!0;function J3(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:l,domNode:c,nodeLookup:a,lib:u,autoPanOnConnect:x,flowId:p,panBy:m,cancelConnection:f,onConnectStart:h,onConnect:j,onConnectEnd:S,isValidConnection:R=Ya,onReconnectEnd:w,updateConnection:E,getTransform:C,getFromHandle:P,autoPanSpeed:N}){const _=Ta(e.target);let $=0,D;const{x:B,y:F}=ct(e),O=_==null?void 0:_.elementFromPoint(B,F),M=Ga(i,O),y=c==null?void 0:c.getBoundingClientRect();if(!y||!M)return;const k=Za(r,M,s,a,t);if(!k)return;let b=ct(e,y),L=!1,A=null,T=!1,V=null;function H(){if(!x||!y)return;const[fe,Me]=Ma(b,y,N);m({x:fe,y:Me}),$=requestAnimationFrame(H)}const G={...k,nodeId:r,type:M,position:k.position},ee=a.get(r),ne={inProgress:!0,isValid:null,from:_n(ee,G,X.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:ee,to:b,toHandle:null,toPosition:bi[G.position],toNode:null};E(ne);let se=ne;h==null||h(e,{nodeId:r,handleId:s,handleType:M});function J(fe){if(!P()||!G){ie(fe);return}const Me=C();b=ct(fe,y),D=X3(Dn(b,Me,!1,[1,1]),n,a,G),L||(H(),L=!0);const de=Wa(fe,{handle:D,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:l?"target":"source",isValidConnection:R,doc:_,lib:u,flowId:p,nodeLookup:a});V=de.handleDomNode,A=de.connection,T=U3(!!D,de.isValid);const Y={...se,isValid:T,to:D&&T?Pa({x:D.x,y:D.y},Me):b,toHandle:de.toHandle,toPosition:T&&de.toHandle?de.toHandle.position:bi[G.position],toNode:de.toHandle?a.get(de.toHandle.nodeId):null};T&&D&&se.toHandle&&Y.toHandle&&se.toHandle.type===Y.toHandle.type&&se.toHandle.nodeId===Y.toHandle.nodeId&&se.toHandle.id===Y.toHandle.id&&se.to.x===Y.to.x&&se.to.y===Y.to.y||(E(Y),se=Y)}function ie(fe){(D||V)&&A&&T&&(j==null||j(A));const{inProgress:Me,...de}=se,Y={...de,toPosition:se.toHandle?se.toPosition:null};S==null||S(fe,Y),i&&(w==null||w(fe,Y)),f(),cancelAnimationFrame($),L=!1,T=!1,A=null,V=null,_.removeEventListener("mousemove",J),_.removeEventListener("mouseup",ie),_.removeEventListener("touchmove",J),_.removeEventListener("touchend",ie)}_.addEventListener("mousemove",J),_.addEventListener("mouseup",ie),_.addEventListener("touchmove",J),_.addEventListener("touchend",ie)}function Wa(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:l,lib:c,flowId:a,isValidConnection:u=Ya,nodeLookup:x}){const p=i==="target",m=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:f,y:h}=ct(e),j=l.elementFromPoint(f,h),S=j!=null&&j.classList.contains(`${c}-flow__handle`)?j:m,R={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const w=Ga(void 0,S),E=S.getAttribute("data-nodeid"),C=S.getAttribute("data-handleid"),P=S.classList.contains("connectable"),N=S.classList.contains("connectableend");if(!E||!w)return R;const _={source:p?E:s,sourceHandle:p?C:r,target:p?s:E,targetHandle:p?r:C};R.connection=_;const D=P&&N&&(n===Ot.Strict?p&&w==="source"||!p&&w==="target":E!==s||C!==r);R.isValid=D&&u(_),R.toHandle=Za(E,w,C,x,n,!1)}return R}const Wo={onPointerDown:J3,isValid:Wa};function Q3({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=He(e);function i({translateExtent:c,width:a,height:u,zoomStep:x=10,pannable:p=!0,zoomable:m=!0,inversePan:f=!1}){const h=E=>{const C=n();if(E.sourceEvent.type!=="wheel"||!t)return;const P=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*x,N=C[2]*Math.pow(2,P);t.scaleTo(N)};let j=[0,0];const S=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(j=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},R=E=>{const C=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const P=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],N=[P[0]-j[0],P[1]-j[1]];j=P;const _=s()*Math.max(C[2],Math.log(C[2]))*(f?-1:1),$={x:C[0]-N[0]*_,y:C[1]-N[1]*_},D=[[0,0],[a,u]];t.setViewportConstrained({x:$.x,y:$.y,zoom:C[2]},D,c)},w=ya().on("start",S).on("zoom",p?R:null).on("zoom.wheel",m?h:null);r.call(w,{})}function l(){r.on("zoom",null)}return{update:i,destroy:l,pointer:qe}}const e5=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Gs=e=>({x:e.x,y:e.y,zoom:e.k}),go=({x:e,y:t,zoom:n})=>Os.translate(e,t).scale(n),Yt=(e,t)=>e.target.closest(`.${t}`),Ka=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),jo=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},qa=e=>{const t=e.ctrlKey&&bs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function t5({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:u}){return x=>{if(Yt(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const S=qe(x),R=qa(x),w=p*Math.pow(2,R);s.scaleTo(n,w,S,x);return}const m=x.deltaMode===1?20:1;let f=r===It.Vertical?0:x.deltaX*m,h=r===It.Horizontal?0:x.deltaY*m;!bs()&&x.shiftKey&&r!==It.Vertical&&(f=x.deltaY*m,h=0),s.translateBy(n,-(f/p)*i,-(h/p)*i,{internal:!0});const j=Gs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(x,j)),e.isPanScrolling&&(a==null||a(x,j),e.panScrollTimeout=setTimeout(()=>{u==null||u(x,j),e.isPanScrolling=!1},150))}}function n5({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){if(!t&&s.type==="wheel"&&!s.ctrlKey||Yt(s,e))return null;s.preventDefault(),n.call(this,s,r)}}function s5({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var i,l,c;if((i=s.sourceEvent)!=null&&i.internal)return;const r=Gs(s.transform);e.mouseButton=((l=s.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((c=s.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,r))}}function o5({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{var l,c;e.usedRightMouseButton=!!(n&&Ka(t,e.mouseButton??0)),(l=i.sourceEvent)!=null&&l.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!((c=i.sourceEvent)!=null&&c.internal)&&(r==null||r(i.sourceEvent,Gs(i.transform)))}}function r5({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,i&&Ka(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),r&&e5(e.prevViewport,l.transform))){const a=Gs(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(l.sourceEvent,a)},n?150:0)}}}function i5({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:c,noPanClassName:a,lib:u}){return x=>{var h;const p=e||t,m=n&&x.ctrlKey;if(x.button===1&&x.type==="mousedown"&&(Yt(x,`${u}-flow__node`)||Yt(x,`${u}-flow__edge`)))return!0;if(!s&&!p&&!r&&!i&&!n||l||Yt(x,c)&&x.type==="wheel"||Yt(x,a)&&(x.type!=="wheel"||r&&x.type==="wheel"&&!e)||!n&&x.ctrlKey&&x.type==="wheel")return!1;if(!n&&x.type==="touchstart"&&((h=x.touches)==null?void 0:h.length)>1)return x.preventDefault(),!1;if(!p&&!r&&!m&&x.type==="wheel"||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const f=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||x.type==="wheel")&&f}}function l5({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:r,viewport:i,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:a,onDraggingChange:u}){const x={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),m=ya().clickDistance(!Xe(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(r),f=He(e).call(m);E({x:i.x,y:i.y,zoom:tn(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const h=f.on("wheel.zoom"),j=f.on("dblclick.zoom");m.wheelDelta(qa);function S(O,M){return f?new Promise(y=>{m==null||m.transform(jo(f,M==null?void 0:M.duration,()=>y(!0)),O)}):Promise.resolve(!1)}function R({noWheelClassName:O,noPanClassName:M,onPaneContextMenu:y,userSelectionActive:k,panOnScroll:b,panOnDrag:L,panOnScrollMode:A,panOnScrollSpeed:T,preventScrolling:V,zoomOnPinch:H,zoomOnScroll:G,zoomOnDoubleClick:ee,zoomActivationKeyPressed:te,lib:ne,onTransformChange:se}){k&&!x.isZoomingOrPanning&&w();const ie=b&&!te&&!k?t5({zoomPanValues:x,noWheelClassName:O,d3Selection:f,d3Zoom:m,panOnScrollMode:A,panOnScrollSpeed:T,zoomOnPinch:H,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):n5({noWheelClassName:O,preventScrolling:V,d3ZoomHandler:h});if(f.on("wheel.zoom",ie,{passive:!1}),!k){const Me=s5({zoomPanValues:x,onDraggingChange:u,onPanZoomStart:c});m.on("start",Me);const de=o5({zoomPanValues:x,panOnDrag:L,onPaneContextMenu:!!y,onPanZoom:l,onTransformChange:se});m.on("zoom",de);const Y=r5({zoomPanValues:x,panOnDrag:L,panOnScroll:b,onPaneContextMenu:y,onPanZoomEnd:a,onDraggingChange:u});m.on("end",Y)}const fe=i5({zoomActivationKeyPressed:te,panOnDrag:L,zoomOnScroll:G,panOnScroll:b,zoomOnDoubleClick:ee,zoomOnPinch:H,userSelectionActive:k,noPanClassName:M,noWheelClassName:O,lib:ne});m.filter(fe),ee?f.on("dblclick.zoom",j):f.on("dblclick.zoom",null)}function w(){m.on("zoom",null)}async function E(O,M,y){const k=go(O),b=m==null?void 0:m.constrain()(k,M,y);return b&&await S(b),new Promise(L=>L(b))}async function C(O,M){const y=go(O);return await S(y,M),new Promise(k=>k(y))}function P(O){if(f){const M=go(O),y=f.property("__zoom");(y.k!==O.zoom||y.x!==O.x||y.y!==O.y)&&(m==null||m.transform(f,M,null,{sync:!0}))}}function N(){const O=f?Ea(f.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}function _(O,M){return f?new Promise(y=>{m==null||m.scaleTo(jo(f,M==null?void 0:M.duration,()=>y(!0)),O)}):Promise.resolve(!1)}function $(O,M){return f?new Promise(y=>{m==null||m.scaleBy(jo(f,M==null?void 0:M.duration,()=>y(!0)),O)}):Promise.resolve(!1)}function D(O){m==null||m.scaleExtent(O)}function B(O){m==null||m.translateExtent(O)}function F(O){const M=!Xe(O)||O<0?0:O;m==null||m.clickDistance(M)}return{update:R,destroy:w,setViewport:C,setViewportConstrained:E,getViewport:N,scaleTo:_,scaleBy:$,setScaleExtent:D,setTranslateExtent:B,syncViewport:P,setClickDistance:F}}var yn;(function(e){e.Line="line",e.Handle="handle"})(yn||(yn={}));function c5({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const l=e-t,c=n-s,a=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&r&&(a[0]=a[0]*-1),c&&i&&(a[1]=a[1]*-1),a}function a5(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function ht(e,t){return Math.max(0,t-e)}function gt(e,t){return Math.max(0,e-t)}function Wn(e,t,n){return Math.max(0,t-e,e-n)}function $i(e,t){return e?!t:t}function u5(e,t,n,s,r,i,l,c){let{affectsX:a,affectsY:u}=t;const{isHorizontal:x,isVertical:p}=t,m=x&&p,{xSnapped:f,ySnapped:h}=n,{minWidth:j,maxWidth:S,minHeight:R,maxHeight:w}=s,{x:E,y:C,width:P,height:N,aspectRatio:_}=e;let $=Math.floor(x?f-e.pointerX:0),D=Math.floor(p?h-e.pointerY:0);const B=P+(a?-$:$),F=N+(u?-D:D),O=-i[0]*P,M=-i[1]*N;let y=Wn(B,j,S),k=Wn(F,R,w);if(l){let A=0,T=0;a&&$<0?A=ht(E+$+O,l[0][0]):!a&&$>0&&(A=gt(E+B+O,l[1][0])),u&&D<0?T=ht(C+D+M,l[0][1]):!u&&D>0&&(T=gt(C+F+M,l[1][1])),y=Math.max(y,A),k=Math.max(k,T)}if(c){let A=0,T=0;a&&$>0?A=gt(E+$,c[0][0]):!a&&$<0&&(A=ht(E+B,c[1][0])),u&&D>0?T=gt(C+D,c[0][1]):!u&&D<0&&(T=ht(C+F,c[1][1])),y=Math.max(y,A),k=Math.max(k,T)}if(r){if(x){const A=Wn(B/_,R,w)*_;if(y=Math.max(y,A),l){let T=0;!a&&!u||a&&!u&&m?T=gt(C+M+B/_,l[1][1])*_:T=ht(C+M+(a?$:-$)/_,l[0][1])*_,y=Math.max(y,T)}if(c){let T=0;!a&&!u||a&&!u&&m?T=ht(C+B/_,c[1][1])*_:T=gt(C+(a?$:-$)/_,c[0][1])*_,y=Math.max(y,T)}}if(p){const A=Wn(F*_,j,S)/_;if(k=Math.max(k,A),l){let T=0;!a&&!u||u&&!a&&m?T=gt(E+F*_+O,l[1][0])/_:T=ht(E+(u?D:-D)*_+O,l[0][0])/_,k=Math.max(k,T)}if(c){let T=0;!a&&!u||u&&!a&&m?T=ht(E+F*_,c[1][0])/_:T=gt(E+(u?D:-D)*_,c[0][0])/_,k=Math.max(k,T)}}}D=D+(D<0?k:-k),$=$+($<0?y:-y),r&&(m?B>F*_?D=($i(a,u)?-$:$)/_:$=($i(a,u)?-D:D)*_:x?(D=$/_,u=a):($=D*_,a=u));const b=a?E+$:E,L=u?C+D:C;return{width:P+(a?-$:$),height:N+(u?-D:D),x:i[0]*$*(a?-1:1)+b,y:i[1]*D*(u?-1:1)+L}}const Xa={width:0,height:0,x:0,y:0},d5={...Xa,pointerX:0,pointerY:0,aspectRatio:1};function x5(e){return[[0,0],[e.measured.width,e.measured.height]]}function p5(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,c=n[0]*i,a=n[1]*l;return[[s-c,r-a],[s+i-c,r+l-a]]}function m5({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=He(e);function l({controlPosition:a,boundaries:u,keepAspectRatio:x,onResizeStart:p,onResize:m,onResizeEnd:f,shouldResize:h}){let j={...Xa},S={...d5};const R=a5(a);let w,E=null,C=[],P,N,_;const $=da().on("start",D=>{const{nodeLookup:B,transform:F,snapGrid:O,snapToGrid:M,nodeOrigin:y,paneDomNode:k}=n();if(w=B.get(t),!w)return;E=(k==null?void 0:k.getBoundingClientRect())??null;const{xSnapped:b,ySnapped:L}=En(D.sourceEvent,{transform:F,snapGrid:O,snapToGrid:M,containerBounds:E});j={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},S={...j,pointerX:b,pointerY:L,aspectRatio:j.width/j.height},P=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(P=B.get(w.parentId),N=P&&w.extent==="parent"?x5(P):void 0),C=[],_=void 0;for(const[A,T]of B)if(T.parentId===t&&(C.push({id:A,position:{...T.position},extent:T.extent}),T.extent==="parent"||T.expandParent)){const V=p5(T,w,T.origin??y);_?_=[[Math.min(V[0][0],_[0][0]),Math.min(V[0][1],_[0][1])],[Math.max(V[1][0],_[1][0]),Math.max(V[1][1],_[1][1])]]:_=V}p==null||p(D,{...j})}).on("drag",D=>{const{transform:B,snapGrid:F,snapToGrid:O,nodeOrigin:M}=n(),y=En(D.sourceEvent,{transform:B,snapGrid:F,snapToGrid:O,containerBounds:E}),k=[];if(!w)return;const{x:b,y:L,width:A,height:T}=j,V={},H=w.origin??M,{width:G,height:ee,x:te,y:ne}=u5(S,R,y,u,x,H,N,_),se=G!==A,J=ee!==T,ie=te!==b&&se,fe=ne!==L&&J;if(!ie&&!fe&&!se&&!J)return;if((ie||fe||H[0]===1||H[1]===1)&&(V.x=ie?te:j.x,V.y=fe?ne:j.y,j.x=V.x,j.y=V.y,C.length>0)){const re=te-b,pe=ne-L;for(const Pe of C)Pe.position={x:Pe.position.x-re+H[0]*(G-A),y:Pe.position.y-pe+H[1]*(ee-T)},k.push(Pe)}if((se||J)&&(V.width=se?G:j.width,V.height=J?ee:j.height,j.width=V.width,j.height=V.height),P&&w.expandParent){const re=H[0]*(V.width??0);V.x&&V.x<re&&(j.x=re,S.x=S.x-(V.x-re));const pe=H[1]*(V.height??0);V.y&&V.y<pe&&(j.y=pe,S.y=S.y-(V.y-pe))}const Me=c5({width:j.width,prevWidth:A,height:j.height,prevHeight:T,affectsX:R.affectsX,affectsY:R.affectsY}),de={...j,direction:Me};(h==null?void 0:h(D,de))!==!1&&(m==null||m(D,de),s(V,k))}).on("end",D=>{f==null||f(D,{...j}),r==null||r()});i.call($)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var Kn={exports:{}},Eo={},qn={exports:{}},yo={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.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 Di;function f5(){if(Di)return yo;Di=1;var e=g;function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function c(p,m){var f=m(),h=s({inst:{value:f,getSnapshot:m}}),j=h[0].inst,S=h[1];return i(function(){j.value=f,j.getSnapshot=m,a(j)&&S({inst:j})},[p,f,m]),r(function(){return a(j)&&S({inst:j}),p(function(){a(j)&&S({inst:j})})},[p]),l(f),f}function a(p){var m=p.getSnapshot;p=p.value;try{var f=m();return!n(p,f)}catch{return!0}}function
|
|
9
|
+
*/var Di;function f5(){if(Di)return yo;Di=1;var e=g;function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function c(p,m){var f=m(),h=s({inst:{value:f,getSnapshot:m}}),j=h[0].inst,S=h[1];return i(function(){j.value=f,j.getSnapshot=m,a(j)&&S({inst:j})},[p,f,m]),r(function(){return a(j)&&S({inst:j}),p(function(){a(j)&&S({inst:j})})},[p]),l(f),f}function a(p){var m=p.getSnapshot;p=p.value;try{var f=m();return!n(p,f)}catch{return!0}}function u(p,m){return m()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:c;return yo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,yo}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 Bi;function h5(){return Bi||(Bi=1,process.env.NODE_ENV!=="production"&&function(){function e(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}function t(f,h){x||r.startTransition===void 0||(x=!0,console.error("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 j=h();if(!p){var S=h();i(j,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}S=l({inst:{value:j,getSnapshot:h}});var R=S[0].inst,w=S[1];return a(function(){R.value=j,R.getSnapshot=h,n(R)&&w({inst:R})},[f,j,h]),c(function(){return n(R)&&w({inst:R}),f(function(){n(R)&&w({inst:R})})},[f]),
|
|
17
|
+
*/var Bi;function h5(){return Bi||(Bi=1,process.env.NODE_ENV!=="production"&&function(){function e(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}function t(f,h){x||r.startTransition===void 0||(x=!0,console.error("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 j=h();if(!p){var S=h();i(j,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}S=l({inst:{value:j,getSnapshot:h}});var R=S[0].inst,w=S[1];return a(function(){R.value=j,R.getSnapshot=h,n(R)&&w({inst:R})},[f,j,h]),c(function(){return n(R)&&w({inst:R}),f(function(){n(R)&&w({inst:R})})},[f]),u(j),j}function n(f){var h=f.getSnapshot;f=f.value;try{var j=h();return!i(f,j)}catch{return!0}}function s(f,h){return h()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=g,i=typeof Object.is=="function"?Object.is:e,l=r.useState,c=r.useEffect,a=r.useLayoutEffect,u=r.useDebugValue,x=!1,p=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;So.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),So}var Oi;function Ua(){return Oi||(Oi=1,process.env.NODE_ENV==="production"?qn.exports=f5():qn.exports=h5()),qn.exports}/**
|
|
18
18
|
* @license React
|
|
19
19
|
* use-sync-external-store-shim/with-selector.production.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 Vi;function g5(){if(Vi)return Eo;Vi=1;var e=g,t=Ua();function n(
|
|
25
|
+
*/var Vi;function g5(){if(Vi)return Eo;Vi=1;var e=g,t=Ua();function n(u,x){return u===x&&(u!==0||1/u===1/x)||u!==u&&x!==x}var s=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,c=e.useMemo,a=e.useDebugValue;return Eo.useSyncExternalStoreWithSelector=function(u,x,p,m,f){var h=i(null);if(h.current===null){var j={hasValue:!1,value:null};h.current=j}else j=h.current;h=c(function(){function R(N){if(!w){if(w=!0,E=N,N=m(N),f!==void 0&&j.hasValue){var _=j.value;if(f(_,N))return C=_}return C=N}if(_=C,s(E,N))return _;var $=m(N);return f!==void 0&&f(_,$)?(E=N,_):(E=N,C=$)}var w=!1,E,C,P=p===void 0?null:p;return[function(){return R(x())},P===null?void 0:function(){return R(P())}]},[x,p,m,f]);var S=r(u,h[0],h[1]);return l(function(){j.hasValue=!0,j.value=S},[S]),a(S),S},Eo}var Ro={};/**
|
|
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 Fi;function j5(){return Fi||(Fi=1,process.env.NODE_ENV!=="production"&&function(){function e(
|
|
33
|
+
*/var Fi;function j5(){return Fi||(Fi=1,process.env.NODE_ENV!=="production"&&function(){function e(u,x){return u===x&&(u!==0||1/u===1/x)||u!==u&&x!==x}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,n=Ua(),s=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,i=t.useRef,l=t.useEffect,c=t.useMemo,a=t.useDebugValue;Ro.useSyncExternalStoreWithSelector=function(u,x,p,m,f){var h=i(null);if(h.current===null){var j={hasValue:!1,value:null};h.current=j}else j=h.current;h=c(function(){function R(N){if(!w){if(w=!0,E=N,N=m(N),f!==void 0&&j.hasValue){var _=j.value;if(f(_,N))return C=_}return C=N}if(_=C,s(E,N))return _;var $=m(N);return f!==void 0&&f(_,$)?(E=N,_):(E=N,C=$)}var w=!1,E,C,P=p===void 0?null:p;return[function(){return R(x())},P===null?void 0:function(){return R(P())}]},[x,p,m,f]);var S=r(u,h[0],h[1]);return l(function(){j.hasValue=!0,j.value=S},[S]),a(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ro}var Hi;function E5(){return Hi||(Hi=1,process.env.NODE_ENV==="production"?Kn.exports=g5():Kn.exports=j5()),Kn.exports}var y5=E5();const S5=pf.getDefaultExportFromCjs(y5),R5={},Zi=e=>{let t;const n=new Set,s=(x,p)=>{const m=typeof x=="function"?x(t):x;if(!Object.is(m,t)){const f=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(h=>h(t,f))}},r=()=>t,a={setState:s,getState:r,getInitialState:()=>u,subscribe:x=>(n.add(x),()=>n.delete(x)),destroy:()=>{(R5?"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,r,a);return a},C5=e=>e?Zi(e):Zi,{useDebugValue:b5}=g,{useSyncExternalStoreWithSelector:w5}=S5,v5=e=>e;function Ja(e,t=v5,n){const s=w5(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return b5(s),s}const Gi=(e,t)=>{const n=C5(e),s=(r,i=t)=>Ja(n,r,i);return Object.assign(s,n),s},k5=(e,t)=>e?Gi(e,t):Gi;function Ae(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,r]of e)if(!Object.is(r,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 Ys=g.createContext(null),M5=Ys.Provider,Qa=Oe.error001();function Se(e,t){const n=g.useContext(Ys);if(n===null)throw new Error(Qa);return Ja(n,e,t)}function Le(){const e=g.useContext(Ys);if(e===null)throw new Error(Qa);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Yi={display:"none"},_5={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},eu="react-flow__node-desc",tu="react-flow__edge-desc",P5="react-flow__aria-live",L5=e=>e.ariaLiveMessage;function N5({rfId:e}){const t=Se(L5);return o.jsxRuntimeExports.jsx("div",{id:`${P5}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:_5,children:t})}function T5({rfId:e,disableKeyboardA11y:t}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{id:`${eu}-${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."," "]}),o.jsxRuntimeExports.jsx("div",{id:`${tu}-${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&&o.jsxRuntimeExports.jsx(N5,{rfId:e})]})}const A5=e=>e.userSelectionActive?"none":"all",Ws=g.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const l=Se(A5),c=`${e}`.split("-");return o.jsxRuntimeExports.jsx("div",{className:ze(["react-flow__panel",n,...c]),style:{...s,pointerEvents:l},ref:i,...r,children:t})});Ws.displayName="Panel";function I5({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsxRuntimeExports.jsx(Ws,{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:o.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const z5=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}},Xn=e=>e.id;function $5(e,t){return Ae(e.selectedNodes.map(Xn),t.selectedNodes.map(Xn))&&Ae(e.selectedEdges.map(Xn),t.selectedEdges.map(Xn))}function D5({onSelectionChange:e}){const t=Le(),{selectedNodes:n,selectedEdges:s}=Se(z5,$5);return g.useEffect(()=>{const r={nodes:n,edges:s};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const B5=e=>!!e.onSelectionChangeHandlers;function O5({onSelectionChange:e}){const t=Se(B5);return e||t?o.jsxRuntimeExports.jsx(D5,{onSelectionChange:e}):null}const nu=[0,0],V5={x:0,y:0,zoom:1},F5=["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"],Wi=[...F5,"rfId"],H5=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}),Ki={translateExtent:kn,nodeOrigin:nu,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Z5(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:a,setPaneClickDistance:u}=Se(H5,Ae),x=Le();g.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{p.current=Ki,c()}),[]);const p=g.useRef(Ki);return g.useEffect(()=>{for(const m of Wi){const f=e[m],h=p.current[m];f!==h&&(typeof e[m]>"u"||(m==="nodes"?t(f):m==="edges"?n(f):m==="minZoom"?s(f):m==="maxZoom"?r(f):m==="translateExtent"?i(f):m==="nodeExtent"?l(f):m==="paneClickDistance"?u(f):m==="fitView"?x.setState({fitViewOnInit:f}):m==="fitViewOptions"?x.setState({fitViewOnInitOptions:f}):x.setState({[m]:f})))}p.current=e},Wi.map(m=>e[m])),null}function qi(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function G5(e){var s;const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const r=qi(),i=()=>n(r!=null&&r.matches?"dark":"light");return i(),r==null||r.addEventListener("change",i),()=>{r==null||r.removeEventListener("change",i)}},[e]),t!==null?t:(s=qi())!=null&&s.matches?"dark":"light"}const Xi=typeof document<"u"?document:null;function Pn(e=null,t={target:Xi,actInsideInputWithModifier:!0}){const[n,s]=g.useState(!1),r=g.useRef(!1),i=g.useRef(new Set([])),[l,c]=g.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
|
|
34
34
|
`).replace(`
|
|
35
35
|
|
|
36
36
|
`,`
|
|
37
37
|
+`).split(`
|
|
38
|
-
`)),x=d.reduce((p,m)=>p.concat(...m),[]);return[d,x]}return[[],[]]},[e]);return g.useEffect(()=>{const a=(t==null?void 0:t.target)||Xi;if(e!==null){const d=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!t.actInsideInputWithModifier)&&Ho(m))return!1;const h=Ji(m.code,c);i.current.add(m[h]),Ui(l,i.current,!1)&&(m.preventDefault(),s(!0))},x=m=>{if((!r.current||r.current&&!t.actInsideInputWithModifier)&&Ho(m))return!1;const h=Ji(m.code,c);Ui(l,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(m[h]),m.key==="Meta"&&i.current.clear(),r.current=!1},p=()=>{i.current.clear(),s(!1)};return a==null||a.addEventListener("keydown",d),a==null||a.addEventListener("keyup",x),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{a==null||a.removeEventListener("keydown",d),a==null||a.removeEventListener("keyup",x),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,s]),n}function Ui(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function Ji(e,t){return t.includes(e)?"code":"key"}const Y5=()=>{const e=Le();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,r,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},{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:r,panZoom:i,domNode:l}=e.getState();if(!i||!l)return Promise.resolve(!1);const c=Oo(n,t),{width:a,height:d}=Zs(l);return Vo({nodes:c,width:a,height:d,minZoom:s,maxZoom:r,panZoom:i},t)},setCenter:async(t,n,s)=>{const{width:r,height:i,maxZoom:l,panZoom:c}=e.getState(),a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:l,d=r/2-t*a,x=i/2-n*a;return c?(await c.setViewport({x:d,y:x,zoom:a},{duration:s==null?void 0:s.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:l,panZoom:c}=e.getState(),a=Lr(t,s,r,i,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={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:l}=e.getState();if(!l)return t;const{x:c,y:a}=l.getBoundingClientRect(),d={x:t.x-c,y:t.y-a},x=n.snapGrid??r,p=n.snapToGrid??i;return Dn(d,s,p,x)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),l=Pa(t,n);return{x:l.x+r,y:l.y+i}}}),[])};function su(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const l=s.get(i.id);l?l.push(i):s.set(i.id,[i])}for(const i of t){const l=s.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...i};for(const a of l)W5(a,c);n.push(c)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function W5(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 ou(e,t){return su(e,t)}function ru(e,t){return su(e,t)}function Nt(e,t){return{id:e,type:"select",selected:t}}function Wt(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const l=t.has(r);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),s.push(Nt(i.id,l)))}return s}function Qi({items:e=[],lookup:t}){var r;const n=[],s=new Map(e.map(i=>[i.id,i]));for(const[i,l]of e.entries()){const c=t.get(l.id),a=((r=c==null?void 0:c.internals)==null?void 0:r.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:i})}for(const[i]of t)s.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function el(e){return{id:e.id,type:"remove"}}const tl=e=>v3(e),K5=e=>ba(e);function iu(e){return g.forwardRef(e)}const q5=typeof window<"u"?g.useLayoutEffect:g.useEffect;function nl(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>X5(()=>n(r=>r+BigInt(1))));return q5(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function X5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const lu=g.createContext(null);function U5({children:e}){const t=Le(),n=g.useCallback(c=>{const{nodes:a=[],setNodes:d,hasDefaultNodes:x,onNodesChange:p,nodeLookup:m}=t.getState();let f=a;for(const h of c)f=typeof h=="function"?h(f):h;x?d(f):p&&p(Qi({items:f,lookup:m}))},[]),s=nl(n),r=g.useCallback(c=>{const{edges:a=[],setEdges:d,hasDefaultEdges:x,onEdgesChange:p,edgeLookup:m}=t.getState();let f=a;for(const h of c)f=typeof h=="function"?h(f):h;x?d(f):p&&p(Qi({items:f,lookup:m}))},[]),i=nl(r),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsxRuntimeExports.jsx(lu.Provider,{value:l,children:e})}function J5(){const e=g.useContext(lu);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Q5=e=>!!e.panZoom;function Ft(){const e=Y5(),t=Le(),n=J5(),s=Se(Q5),r=g.useMemo(()=>{const i=p=>t.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},a=p=>{var R,w;const{nodeLookup:m,nodeOrigin:f}=t.getState(),h=tl(p)?p:m.get(p.id),j=h.parentId?Na(h.position,h.measured,h.parentId,m,f):h.position,S={...h,position:j,width:((R=h.measured)==null?void 0:R.width)??h.width,height:((w=h.measured)==null?void 0:w.height)??h.height};return nn(S)},d=(p,m,f={replace:!1})=>{l(h=>h.map(j=>{if(j.id===p){const S=typeof m=="function"?m(j):m;return f.replace&&tl(S)?S:{...j,...S}}return j}))},x=(p,m,f={replace:!1})=>{c(h=>h.map(j=>{if(j.id===p){const S=typeof m=="function"?m(j):m;return f.replace&&K5(S)?S:{...j,...S}}return j}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var m;return(m=i(p))==null?void 0:m.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(m=>({...m}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:l,setEdges:c,addNodes:p=>{const m=Array.isArray(p)?p:[p];n.nodeQueue.push(f=>[...f,...m])},addEdges:p=>{const m=Array.isArray(p)?p:[p];n.edgeQueue.push(f=>[...f,...m])},toObject:()=>{const{nodes:p=[],edges:m=[],transform:f}=t.getState(),[h,j,S]=f;return{nodes:p.map(R=>({...R})),edges:m.map(R=>({...R})),viewport:{x:h,y:j,zoom:S}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:f,edges:h,onNodesDelete:j,onEdgesDelete:S,triggerNodeChanges:R,triggerEdgeChanges:w,onDelete:E,onBeforeDelete:C}=t.getState(),{nodes:P,edges:N}=await _3({nodesToRemove:p,edgesToRemove:m,nodes:f,edges:h,onBeforeDelete:C}),_=N.length>0,$=P.length>0;if(_){const D=N.map(el);S==null||S(N),w(D)}if($){const D=P.map(el);j==null||j(P),R(D)}return($||_)&&(E==null||E({nodes:P,edges:N})),{deletedNodes:P,deletedEdges:N}},getIntersectingNodes:(p,m=!0,f)=>{const h=vi(p),j=h?p:a(p),S=f!==void 0;return j?(f||t.getState().nodes).filter(R=>{const w=t.getState().nodeLookup.get(R.id);if(w&&!h&&(R.id===p.id||!w.internals.positionAbsolute))return!1;const E=nn(S?R:w),C=Mn(E,j);return m&&C>0||C>=j.width*j.height}):[]},isNodeIntersecting:(p,m,f=!0)=>{const j=vi(p)?p:a(p);if(!j)return!1;const S=Mn(j,m);return f&&S>0||S>=j.width*j.height},updateNode:d,updateNodeData:(p,m,f={replace:!1})=>{d(p,h=>{const j=typeof m=="function"?m(h):m;return f.replace?{...h,data:j}:{...h,data:{...h.data,...j}}},f)},updateEdge:x,updateEdgeData:(p,m,f={replace:!1})=>{x(p,h=>{const j=typeof m=="function"?m(h):m;return f.replace?{...h,data:j}:{...h,data:{...h.data,...j}}},f)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:f}=t.getState();return k3(p,{nodeLookup:m,nodeOrigin:f})},getHandleConnections:({type:p,id:m,nodeId:f})=>{var h;return Array.from(((h=t.getState().connectionLookup.get(`${f}-${p}${m?`-${m}`:""}`))==null?void 0:h.values())??[])},getNodeConnections:({type:p,handleId:m,nodeId:f})=>{var h;return Array.from(((h=t.getState().connectionLookup.get(`${f}${p?m?`-${p}-${m}`:`-${p}`:""}`))==null?void 0:h.values())??[])}}},[]);return g.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const sl=e=>e.selected,eE={actInsideInputWithModifier:!1},tE=typeof window<"u"?window:void 0;function nE({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Le(),{deleteElements:s}=Ft(),r=Pn(e,eE),i=Pn(t,{target:tE});g.useEffect(()=>{if(r){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(sl),edges:l.filter(sl)}),n.setState({nodesSelectionActive:!1})}},[r]),g.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function sE(e){const t=Le();g.useEffect(()=>{const n=()=>{var r,i;if(!e.current)return!1;const s=Zs(e.current);(s.height===0||s.width===0)&&((i=(r=t.getState()).onError)==null||i.call(r,"004",Oe.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 Ks={position:"absolute",width:"100%",height:"100%",top:0,left:0},oE=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function rE({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=It.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:d,minZoom:x,maxZoom:p,zoomActivationKeyCode:m,preventScrolling:f=!0,children:h,noWheelClassName:j,noPanClassName:S,onViewportChange:R,isControlledViewport:w,paneClickDistance:E}){const C=Le(),P=g.useRef(null),{userSelectionActive:N,lib:_}=Se(oE,Ae),$=Pn(m),D=g.useRef();sE(P);const B=g.useCallback(F=>{R==null||R({x:F[0],y:F[1],zoom:F[2]}),w||C.setState({transform:F})},[R,w]);return g.useEffect(()=>{if(P.current){D.current=l5({domNode:P.current,minZoom:x,maxZoom:p,translateExtent:d,viewport:a,paneClickDistance:E,onDraggingChange:y=>C.setState({paneDragging:y}),onPanZoomStart:(y,k)=>{const{onViewportChangeStart:b,onMoveStart:L}=C.getState();L==null||L(y,k),b==null||b(k)},onPanZoom:(y,k)=>{const{onViewportChange:b,onMove:L}=C.getState();L==null||L(y,k),b==null||b(k)},onPanZoomEnd:(y,k)=>{const{onViewportChangeEnd:b,onMoveEnd:L}=C.getState();L==null||L(y,k),b==null||b(k)}});const{x:F,y:O,zoom:M}=D.current.getViewport();return C.setState({panZoom:D.current,transform:[F,O,M],domNode:P.current.closest(".react-flow")}),()=>{var y;(y=D.current)==null||y.destroy()}}},[]),g.useEffect(()=>{var F;(F=D.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:$,preventScrolling:f,noPanClassName:S,userSelectionActive:N,noWheelClassName:j,lib:_,onTransformChange:B})},[e,t,n,s,r,i,l,c,$,f,S,N,j,_,B]),o.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:P,style:Ks,children:h})}const iE=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function lE(){const{userSelectionActive:e,userSelectionRect:t}=Se(iE,Ae);return e&&t?o.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 Co=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},cE=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function aE({isSelecting:e,selectionKeyPressed:t,selectionMode:n=en.Full,panOnDrag:s,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:a,onPaneScroll:d,onPaneMouseEnter:x,onPaneMouseMove:p,onPaneMouseLeave:m,children:f}){const h=Le(),{userSelectionActive:j,elementsSelectable:S,dragging:R}=Se(cE,Ae),w=S&&(e||j),E=g.useRef(null),C=g.useRef(),P=g.useRef(new Set),N=g.useRef(new Set),_=g.useRef(!1),$=g.useRef(!1),D=b=>{if(_.current){_.current=!1;return}c==null||c(b),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},B=b=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){b.preventDefault();return}a==null||a(b)},F=d?b=>d(b):void 0,O=b=>{var H,G;const{resetSelectedElements:L,domNode:A}=h.getState();if(C.current=A==null?void 0:A.getBoundingClientRect(),!S||!e||b.button!==0||b.target!==E.current||!C.current)return;(G=(H=b.target)==null?void 0:H.setPointerCapture)==null||G.call(H,b.pointerId),$.current=!0,_.current=!1;const{x:T,y:V}=ct(b.nativeEvent,C.current);L(),h.setState({userSelectionRect:{width:0,height:0,startX:T,startY:V,x:T,y:V}}),i==null||i(b)},M=b=>{const{userSelectionRect:L,transform:A,nodeLookup:T,edgeLookup:V,connectionLookup:H,triggerNodeChanges:G,triggerEdgeChanges:ee,defaultEdgeOptions:te}=h.getState();if(!C.current||!L)return;_.current=!0;const{x:ne,y:se}=ct(b.nativeEvent,C.current),{startX:J,startY:ie}=L,fe={startX:J,startY:ie,x:ne<J?ne:J,y:se<ie?se:ie,width:Math.abs(ne-J),height:Math.abs(se-ie)},Me=P.current,de=N.current;P.current=new Set(wa(T,fe,A,n===en.Partial,!0).map(re=>re.id)),N.current=new Set;const Y=(te==null?void 0:te.selectable)??!0;for(const re of P.current){const pe=H.get(re);if(pe)for(const{edgeId:Pe}of pe.values()){const $e=V.get(Pe);$e&&($e.selectable??Y)&&N.current.add(Pe)}}if(!ki(Me,P.current)){const re=Wt(T,P.current,!0);G(re)}if(!ki(de,N.current)){const re=Wt(V,N.current);ee(re)}h.setState({userSelectionRect:fe,userSelectionActive:!0,nodesSelectionActive:!1})},y=b=>{var A,T;if(b.button!==0||!$.current)return;(T=(A=b.target)==null?void 0:A.releasePointerCapture)==null||T.call(A,b.pointerId);const{userSelectionRect:L}=h.getState();!j&&L&&b.target===E.current&&(D==null||D(b)),h.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:P.current.size>0}),l==null||l(b),(t||r)&&(_.current=!1),$.current=!1},k=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxRuntimeExports.jsxs("div",{className:ze(["react-flow__pane",{draggable:k,dragging:R,selection:e}]),onClick:w?void 0:Co(D,E),onContextMenu:Co(B,E),onWheel:Co(F,E),onPointerEnter:w?void 0:x,onPointerDown:w?O:p,onPointerMove:w?M:p,onPointerUp:w?y:void 0,onPointerLeave:m,ref:E,style:Ks,children:[f,o.jsxRuntimeExports.jsx(lE,{})]})}function Ko({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:c,onError:a}=t.getState(),d=c.get(e);if(!d){a==null||a("012",Oe.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var x;return(x=s==null?void 0:s.current)==null?void 0:x.blur()})):r([e])}function cu({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:l}){const c=Le(),[a,d]=g.useState(!1),x=g.useRef();return g.useEffect(()=>{x.current=W3({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{Ko({id:p,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),g.useEffect(()=>{var p,m;if(t)(p=x.current)==null||p.destroy();else if(e.current)return(m=x.current)==null||m.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:l}),()=>{var f;(f=x.current)==null||f.destroy()}},[n,s,t,i,e,r]),a}const uE=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function au(){const e=Le();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:l,onError:c,updateNodePositions:a,nodeLookup:d,nodeOrigin:x}=e.getState(),p=new Map,m=uE(l),f=r?i[0]:5,h=r?i[1]:5,j=n.direction.x*f*n.factor,S=n.direction.y*h*n.factor;for(const[,R]of d){if(!m(R))continue;let w={x:R.internals.positionAbsolute.x+j,y:R.internals.positionAbsolute.y+S};r&&(w=Hs(w,i));const{position:E,positionAbsolute:C}=va({nodeId:R.id,nextPosition:w,nodeLookup:d,nodeExtent:s,nodeOrigin:x,onError:c});R.position=E,R.internals.positionAbsolute=C,p.set(R.id,R)}a(p)},[])}const zr=g.createContext(null),dE=zr.Provider;zr.Consumer;const uu=()=>g.useContext(zr),xE=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),pE=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:l}=s,{fromHandle:c,toHandle:a,isValid:d}=l,x=(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:x,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:i===Ot.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!r,valid:x&&d}};function mE({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:l,onConnect:c,children:a,className:d,onMouseDown:x,onTouchStart:p,...m},f){var k,b;const h=l||null,j=e==="target",S=Le(),R=uu(),{connectOnClick:w,noPanClassName:E,rfId:C}=Se(xE,Ae),{connectingFrom:P,connectingTo:N,clickConnecting:_,isPossibleEndHandle:$,connectionInProcess:D,clickConnectionInProcess:B,valid:F}=Se(pE(R,h,e),Ae);R||(b=(k=S.getState()).onError)==null||b.call(k,"010",Oe.error010());const O=L=>{const{defaultEdgeOptions:A,onConnect:T,hasDefaultEdges:V}=S.getState(),H={...A,...L};if(V){const{edges:G,setEdges:ee}=S.getState();ee(Ba(H,G))}T==null||T(H),c==null||c(H)},M=L=>{if(!R)return;const A=Aa(L.nativeEvent);if(r&&(A&&L.button===0||!A)){const T=S.getState();Wo.onPointerDown(L.nativeEvent,{autoPanOnConnect:T.autoPanOnConnect,connectionMode:T.connectionMode,connectionRadius:T.connectionRadius,domNode:T.domNode,nodeLookup:T.nodeLookup,lib:T.lib,isTarget:j,handleId:h,nodeId:R,flowId:T.rfId,panBy:T.panBy,cancelConnection:T.cancelConnection,onConnectStart:T.onConnectStart,onConnectEnd:T.onConnectEnd,updateConnection:T.updateConnection,onConnect:O,isValidConnection:n||T.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:T.autoPanSpeed})}A?x==null||x(L):p==null||p(L)},y=L=>{const{onClickConnectStart:A,onClickConnectEnd:T,connectionClickStartHandle:V,connectionMode:H,isValidConnection:G,lib:ee,rfId:te,nodeLookup:ne,connection:se}=S.getState();if(!R||!V&&!r)return;if(!V){A==null||A(L.nativeEvent,{nodeId:R,handleId:h,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:R,type:e,id:h}});return}const J=Ta(L.target),ie=n||G,{connection:fe,isValid:Me}=Wo.isValid(L.nativeEvent,{handle:{nodeId:R,id:h,type:e},connectionMode:H,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:ie,flowId:te,doc:J,lib:ee,nodeLookup:ne});Me&&fe&&O(fe);const de=structuredClone(se);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,T==null||T(L,de),S.setState({connectionClickStartHandle:null})};return o.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":R,"data-handlepos":t,"data-id":`${C}-${R}-${h}-${e}`,className:ze(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,d,{source:!j,target:j,connectable:s,connectablestart:r,connectableend:i,clickconnecting:_,connectingfrom:P,connectingto:N,valid:F,connectionindicator:s&&(!D||$)&&(D||B?i:r)}]),onMouseDown:M,onTouchStart:M,onClick:w?y:void 0,ref:f,...m,children:a})}const Ln=g.memo(iu(mE));function fE({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e==null?void 0:e.label,o.jsxRuntimeExports.jsx(Ln,{type:"source",position:n,isConnectable:t})]})}function hE({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:s=X.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ln,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsxRuntimeExports.jsx(Ln,{type:"source",position:s,isConnectable:t})]})}function gE(){return null}function jE({data:e,isConnectable:t,targetPosition:n=X.Top}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ln,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ws={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ol={input:fE,default:hE,output:jE,group:gE};function EE(e){var t,n,s,r;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??((r=e.style)==null?void 0:r.height)}}const yE=e=>{const{width:t,height:n,x:s,y:r}=$n(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xe(t)?t:null,height:Xe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function SE({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=Le(),{width:r,height:i,transformString:l,userSelectionActive:c}=Se(yE,Ae),a=au(),d=g.useRef(null);if(g.useEffect(()=>{var m;n||(m=d.current)==null||m.focus({preventScroll:!0})},[n]),cu({nodeRef:d}),c||!r||!i)return null;const x=e?m=>{const f=s.getState().nodes.filter(h=>h.selected);e(m,f)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(ws,m.key)&&(m.preventDefault(),a({direction:ws[m.key],factor:m.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:ze(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:o.jsxRuntimeExports.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:r,height:i}})})}const rl=typeof window<"u"?window:void 0,RE=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function du({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:a,selectionKeyCode:d,selectionOnDrag:x,selectionMode:p,onSelectionStart:m,onSelectionEnd:f,multiSelectionKeyCode:h,panActivationKeyCode:j,zoomActivationKeyCode:S,elementsSelectable:R,zoomOnScroll:w,zoomOnPinch:E,panOnScroll:C,panOnScrollSpeed:P,panOnScrollMode:N,zoomOnDoubleClick:_,panOnDrag:$,defaultViewport:D,translateExtent:B,minZoom:F,maxZoom:O,preventScrolling:M,onSelectionContextMenu:y,noWheelClassName:k,noPanClassName:b,disableKeyboardA11y:L,onViewportChange:A,isControlledViewport:T}){const{nodesSelectionActive:V,userSelectionActive:H}=Se(RE),G=Pn(d,{target:rl}),ee=Pn(j,{target:rl}),te=ee||$,ne=ee||C,se=x&&te!==!0,J=G||H||se;return nE({deleteKeyCode:a,multiSelectionKeyCode:h}),o.jsxRuntimeExports.jsx(rE,{onPaneContextMenu:i,elementsSelectable:R,zoomOnScroll:w,zoomOnPinch:E,panOnScroll:ne,panOnScrollSpeed:P,panOnScrollMode:N,zoomOnDoubleClick:_,panOnDrag:!G&&te,defaultViewport:D,translateExtent:B,minZoom:F,maxZoom:O,zoomActivationKeyCode:S,preventScrolling:M,noWheelClassName:k,noPanClassName:b,onViewportChange:A,isControlledViewport:T,paneClickDistance:c,children:o.jsxRuntimeExports.jsxs(aE,{onSelectionStart:m,onSelectionEnd:f,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:te,isSelecting:!!J,selectionMode:p,selectionKeyPressed:G,selectionOnDrag:se,children:[e,V&&o.jsxRuntimeExports.jsx(SE,{onSelectionContextMenu:y,noPanClassName:b,disableKeyboardA11y:L})]})})}du.displayName="FlowRenderer";const CE=g.memo(du),bE=e=>t=>e?wa(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 wE(e){return Se(g.useCallback(bE(e),[e]),Ae)}const vE=e=>e.updateNodeInternals;function kE(){const e=Se(vE),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function ME({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=Le(),i=g.useRef(null),l=g.useRef(null),c=g.useRef(e.sourcePosition),a=g.useRef(e.targetPosition),d=g.useRef(t),x=n&&!!e.internals.handleBounds;return g.useEffect(()=>{i.current&&!e.hidden&&(!x||l.current!==i.current)&&(l.current&&(s==null||s.unobserve(l.current)),s==null||s.observe(i.current),l.current=i.current)},[x,e.hidden]),g.useEffect(()=>()=>{l.current&&(s==null||s.unobserve(l.current),l.current=null)},[]),g.useEffect(()=>{if(i.current){const p=d.current!==t,m=c.current!==e.sourcePosition,f=a.current!==e.targetPosition;(p||m||f)&&(d.current=t,c.current=e.sourcePosition,a.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function _E({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:l,nodesDraggable:c,elementsSelectable:a,nodesConnectable:d,nodesFocusable:x,resizeObserver:p,noDragClassName:m,noPanClassName:f,disableKeyboardA11y:h,rfId:j,nodeTypes:S,nodeClickDistance:R,onError:w}){const{node:E,internals:C,isParent:P}=Se(J=>{const ie=J.nodeLookup.get(e),fe=J.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:fe}},Ae);let N=E.type||"default",_=(S==null?void 0:S[N])||ol[N];_===void 0&&(w==null||w("003",Oe.error003(N)),N="default",_=ol.default);const $=!!(E.draggable||c&&typeof E.draggable>"u"),D=!!(E.selectable||a&&typeof E.selectable>"u"),B=!!(E.connectable||d&&typeof E.connectable>"u"),F=!!(E.focusable||x&&typeof E.focusable>"u"),O=Le(),M=La(E),y=ME({node:E,nodeType:N,hasDimensions:M,resizeObserver:p}),k=cu({nodeRef:y,disabled:E.hidden||!$,noDragClassName:m,handleSelector:E.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:R}),b=au();if(E.hidden)return null;const L=mt(E),A=EE(E),T=D||$||t||n||s||r,V=n?J=>n(J,{...C.userNode}):void 0,H=s?J=>s(J,{...C.userNode}):void 0,G=r?J=>r(J,{...C.userNode}):void 0,ee=i?J=>i(J,{...C.userNode}):void 0,te=l?J=>l(J,{...C.userNode}):void 0,ne=J=>{const{selectNodesOnDrag:ie,nodeDragThreshold:fe}=O.getState();D&&(!ie||!$||fe>0)&&Ko({id:e,store:O,nodeRef:y}),t&&t(J,{...C.userNode})},se=J=>{if(!(Ho(J.nativeEvent)||h))if(Sa.includes(J.key)&&D){const ie=J.key==="Escape";Ko({id:e,store:O,unselect:ie,nodeRef:y})}else $&&E.selected&&Object.prototype.hasOwnProperty.call(ws,J.key)&&(J.preventDefault(),O.setState({ariaLiveMessage:`Moved selected node ${J.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~C.positionAbsolute.x}, y: ${~~C.positionAbsolute.y}`}),b({direction:ws[J.key],factor:J.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:ze(["react-flow__node",`react-flow__node-${N}`,{[f]:$},E.className,{selected:E.selected,selectable:D,parent:P,draggable:$,dragging:k}]),ref:y,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:T?"all":"none",visibility:M?"visible":"hidden",...E.style,...A},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:V,onMouseMove:H,onMouseLeave:G,onContextMenu:ee,onClick:ne,onDoubleClick:te,onKeyDown:F?se:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":h?void 0:`${eu}-${j}`,"aria-label":E.ariaLabel,children:o.jsxRuntimeExports.jsx(dE,{value:e,children:o.jsxRuntimeExports.jsx(_,{id:e,data:E.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:E.selected??!1,selectable:D,draggable:$,deletable:E.deletable??!0,isConnectable:B,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:k,dragHandle:E.dragHandle,zIndex:C.z,parentId:E.parentId,...L})})})}const PE=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function xu(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=Se(PE,Ae),l=wE(e.onlyRenderVisibleElements),c=kE();return o.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ks,children:l.map(a=>o.jsxRuntimeExports.jsx(_E,{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:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}xu.displayName="NodeRenderer";const LE=g.memo(xu);function NE(e){return Se(g.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);i&&l&&N3({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),Ae)}const TE=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),AE=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),il={[Ss.Arrow]:TE,[Ss.ArrowClosed]:AE};function IE(e){const t=Le();return g.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call(il,e)?il[e]:((i=(r=t.getState()).onError)==null||i.call(r,"009",Oe.error009(e)),null)},[e])}const zE=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const a=IE(t);return a?o.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:c,refX:"0",refY:"0",children:o.jsxRuntimeExports.jsx(a,{color:n,strokeWidth:l})}):null},pu=({defaultColor:e,rfId:t})=>{const n=Se(i=>i.edges),s=Se(i=>i.defaultEdgeOptions),r=g.useMemo(()=>B3(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return r.length?o.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker",children:o.jsxRuntimeExports.jsx("defs",{children:r.map(i=>o.jsxRuntimeExports.jsx(zE,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};pu.displayName="MarkerDefinitions";var $E=g.memo(pu);function mu({x:e,y:t,label:n,labelStyle:s={},labelShowBg:r=!0,labelBgStyle:i={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:a,className:d,...x}){const[p,m]=g.useState({x:1,y:0,width:0,height:0}),f=ze(["react-flow__edge-textwrapper",d]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const j=h.current.getBBox();m({x:j.x,y:j.y,width:j.width,height:j.height})}},[n]),typeof n>"u"||!n?null:o.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:f,visibility:p.width?"visible":"hidden",...x,children:[r&&o.jsxRuntimeExports.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:c,ry:c}),o.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:h,style:s,children:n}),a]})}mu.displayName="EdgeText";const DE=g.memo(mu);function Ue({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a,interactionWidth:d=20,...x}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{...x,d:e,fill:"none",className:ze(["react-flow__edge-path",x.className])}),d&&o.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),s&&Xe(t)&&Xe(n)?o.jsxRuntimeExports.jsx(DE,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a}):null]})}function ll({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===X.Left||e===X.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function fu({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top}){const[l,c]=ll({pos:n,x1:e,y1:t,x2:s,y2:r}),[a,d]=ll({pos:i,x1:s,y1:r,x2:e,y2:t}),[x,p,m,f]=Ia({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:a,targetControlY:d});return[`M${e},${t} C${l},${c} ${a},${d} ${s},${r}`,x,p,m,f]}function hu(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=X.Bottom,targetPosition:c=X.Top,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:S,interactionWidth:R})=>{const[w,E,C]=fu({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:c}),P=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:P,path:w,labelX:E,labelY:C,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:S,interactionWidth:R})})}const BE=hu({isInternal:!1}),gu=hu({isInternal:!0});BE.displayName="SimpleBezierEdge";gu.displayName="SimpleBezierEdgeInternal";function ju(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,sourcePosition:f=X.Bottom,targetPosition:h=X.Top,markerEnd:j,markerStart:S,pathOptions:R,interactionWidth:w})=>{const[E,C,P]=Zo({sourceX:n,sourceY:s,sourcePosition:f,targetX:r,targetY:i,targetPosition:h,borderRadius:R==null?void 0:R.borderRadius,offset:R==null?void 0:R.offset}),N=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:N,path:E,labelX:C,labelY:P,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:j,markerStart:S,interactionWidth:w})})}const Eu=ju({isInternal:!1}),yu=ju({isInternal:!0});Eu.displayName="SmoothStepEdge";yu.displayName="SmoothStepEdgeInternal";function Su(e){return g.memo(({id:t,...n})=>{var r;const s=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Eu,{...n,id:s,pathOptions:g.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const OE=Su({isInternal:!1}),Ru=Su({isInternal:!0});OE.displayName="StepEdge";Ru.displayName="StepEdgeInternal";function Cu(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:f,markerStart:h,interactionWidth:j})=>{const[S,R,w]=Oa({sourceX:n,sourceY:s,targetX:r,targetY:i}),E=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:E,path:S,labelX:R,labelY:w,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:f,markerStart:h,interactionWidth:j})})}const VE=Cu({isInternal:!1}),bu=Cu({isInternal:!0});VE.displayName="StraightEdge";bu.displayName="StraightEdgeInternal";function wu(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=X.Bottom,targetPosition:c=X.Top,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:S,pathOptions:R,interactionWidth:w})=>{const[E,C,P]=za({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:c,curvature:R==null?void 0:R.curvature}),N=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:N,path:E,labelX:C,labelY:P,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:S,interactionWidth:w})})}const FE=wu({isInternal:!1}),vu=wu({isInternal:!0});FE.displayName="BezierEdge";vu.displayName="BezierEdgeInternal";const cl={default:vu,straight:bu,step:Ru,smoothstep:yu,simplebezier:gu},al={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},HE=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,ZE=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,ul="react-flow__edgeupdater";function dl({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:l,type:c}){return o.jsxRuntimeExports.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:l,className:ze([ul,`${ul}-${c}`]),cx:HE(t,s,e),cy:ZE(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function GE({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:l,sourcePosition:c,targetPosition:a,onReconnect:d,onReconnectStart:x,onReconnectEnd:p,setReconnecting:m,setUpdateHover:f}){const h=Le(),j=(C,P)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:_,isValidConnection:$,connectionMode:D,connectionRadius:B,lib:F,onConnectStart:O,onConnectEnd:M,cancelConnection:y,nodeLookup:k,rfId:b,panBy:L,updateConnection:A}=h.getState(),T=P.type==="target";m(!0),x==null||x(C,n,P.type);const V=(G,ee)=>{m(!1),p==null||p(G,n,P.type,ee)},H=G=>d==null?void 0:d(n,G);Wo.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:D,connectionRadius:B,domNode:_,handleId:P.id,nodeId:P.nodeId,nodeLookup:k,isTarget:T,edgeUpdaterType:P.type,lib:F,flowId:b,cancelConnection:y,panBy:L,isValidConnection:$,onConnect:H,onConnectStart:O,onConnectEnd:M,onReconnectEnd:V,updateConnection:A,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle})},S=C=>j(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),R=C=>j(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>f(!0),E=()=>f(!1);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&o.jsxRuntimeExports.jsx(dl,{position:c,centerX:s,centerY:r,radius:t,onMouseDown:S,onMouseEnter:w,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&o.jsxRuntimeExports.jsx(dl,{position:a,centerX:i,centerY:l,radius:t,onMouseDown:R,onMouseEnter:w,onMouseOut:E,type:"target"})]})}function YE({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:d,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:f,rfId:h,edgeTypes:j,noPanClassName:S,onError:R,disableKeyboardA11y:w}){let E=Se(Y=>Y.edgeLookup.get(e));const C=Se(Y=>Y.defaultEdgeOptions);E=C?{...C,...E}:E;let P=E.type||"default",N=(j==null?void 0:j[P])||cl[P];N===void 0&&(R==null||R("011",Oe.error011(P)),P="default",N=cl.default);const _=!!(E.focusable||t&&typeof E.focusable>"u"),$=typeof p<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),D=!!(E.selectable||s&&typeof E.selectable>"u"),B=g.useRef(null),[F,O]=g.useState(!1),[M,y]=g.useState(!1),k=Le(),{zIndex:b,sourceX:L,sourceY:A,targetX:T,targetY:V,sourcePosition:H,targetPosition:G}=Se(g.useCallback(Y=>{const re=Y.nodeLookup.get(E.source),pe=Y.nodeLookup.get(E.target);if(!re||!pe)return{zIndex:E.zIndex,...al};const Pe=D3({id:e,sourceNode:re,targetNode:pe,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:Y.connectionMode,onError:R});return{zIndex:L3({selected:E.selected,zIndex:E.zIndex,sourceNode:re,targetNode:pe,elevateOnSelect:Y.elevateEdgesOnSelect}),...Pe||al}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),Ae),ee=g.useMemo(()=>E.markerStart?`url('#${Go(E.markerStart,h)}')`:void 0,[E.markerStart,h]),te=g.useMemo(()=>E.markerEnd?`url('#${Go(E.markerEnd,h)}')`:void 0,[E.markerEnd,h]);if(E.hidden||L===null||A===null||T===null||V===null)return null;const ne=Y=>{var $e;const{addSelectedEdges:re,unselectNodesAndEdges:pe,multiSelectionActive:Pe}=k.getState();D&&(k.setState({nodesSelectionActive:!1}),E.selected&&Pe?(pe({nodes:[],edges:[E]}),($e=B.current)==null||$e.blur()):re([e])),r&&r(Y,E)},se=i?Y=>{i(Y,{...E})}:void 0,J=l?Y=>{l(Y,{...E})}:void 0,ie=c?Y=>{c(Y,{...E})}:void 0,fe=a?Y=>{a(Y,{...E})}:void 0,Me=d?Y=>{d(Y,{...E})}:void 0,de=Y=>{var re;if(!w&&Sa.includes(Y.key)&&D){const{unselectNodesAndEdges:pe,addSelectedEdges:Pe}=k.getState();Y.key==="Escape"?((re=B.current)==null||re.blur(),pe({edges:[E]})):Pe([e])}};return o.jsxRuntimeExports.jsx("svg",{style:{zIndex:b},children:o.jsxRuntimeExports.jsxs("g",{className:ze(["react-flow__edge",`react-flow__edge-${P}`,E.className,S,{selected:E.selected,animated:E.animated,inactive:!D&&!r,updating:F,selectable:D}]),onClick:ne,onDoubleClick:se,onContextMenu:J,onMouseEnter:ie,onMouseMove:fe,onMouseLeave:Me,onKeyDown:_?de:void 0,tabIndex:_?0:void 0,role:_?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":_?`${tu}-${h}`:void 0,ref:B,children:[!M&&o.jsxRuntimeExports.jsx(N,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:D,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:L,sourceY:A,targetX:T,targetY:V,sourcePosition:H,targetPosition:G,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:ee,markerEnd:te,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),$&&o.jsxRuntimeExports.jsx(GE,{edge:E,isReconnectable:$,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:f,sourceX:L,sourceY:A,targetX:T,targetY:V,sourcePosition:H,targetPosition:G,setUpdateHover:O,setReconnecting:y})]})})}const WE=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ku({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:a,onEdgeMouseLeave:d,onEdgeClick:x,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:f,onReconnectEnd:h,disableKeyboardA11y:j}){const{edgesFocusable:S,edgesReconnectable:R,elementsSelectable:w,onError:E}=Se(WE,Ae),C=NE(t);return o.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[o.jsxRuntimeExports.jsx($E,{defaultColor:e,rfId:n}),C.map(P=>o.jsxRuntimeExports.jsx(YE,{id:P,edgesFocusable:S,edgesReconnectable:R,elementsSelectable:w,noPanClassName:r,onReconnect:i,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:d,onClick:x,reconnectRadius:p,onDoubleClick:m,onReconnectStart:f,onReconnectEnd:h,rfId:n,onError:E,edgeTypes:s,disableKeyboardA11y:j},P))]})}ku.displayName="EdgeRenderer";const KE=g.memo(ku),qE=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function XE({children:e}){const t=Se(qE);return o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function UE(e){const t=Ft(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const JE=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function QE(e){const t=Se(JE),n=Le();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function ey(e){return e.connection.inProgress?{...e.connection,to:Dn(e.connection.to,e.transform)}:{...e.connection}}function ty(e){return ey}function ny(e){const t=ty();return Se(t,Ae)}const sy=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function oy({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:l,isValid:c,inProgress:a}=Se(sy,Ae);return!(i&&r&&a)?null:o.jsxRuntimeExports.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:o.jsxRuntimeExports.jsx("g",{className:ze(["react-flow__connection",Ca(c)]),children:o.jsxRuntimeExports.jsx(Mu,{style:t,type:n,CustomComponent:s,isValid:c})})})}const Mu=({style:e,type:t=jt.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:l,fromHandle:c,fromPosition:a,to:d,toNode:x,toHandle:p,toPosition:m}=ny();if(!r)return;if(n)return o.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:a,toPosition:m,connectionStatus:Ca(s),toNode:x,toHandle:p});let f="";const h={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:d.x,targetY:d.y,targetPosition:m};switch(t){case jt.Bezier:[f]=za(h);break;case jt.SimpleBezier:[f]=fu(h);break;case jt.Step:[f]=Zo({...h,borderRadius:0});break;case jt.SmoothStep:[f]=Zo(h);break;default:[f]=Oa(h)}return o.jsxRuntimeExports.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:e})};Mu.displayName="ConnectionLine";const ry={};function xl(e=ry){const t=g.useRef(e),n=Le();g.useEffect(()=>{var s,r;if(process.env.NODE_ENV==="development"){const i=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const l of i)if(t.current[l]!==e[l]){(r=(s=n.getState()).onError)==null||r.call(s,"002",Oe.error002());break}t.current=e}},[e])}function iy(){const e=Le(),t=g.useRef(!1);g.useEffect(()=>{var n,s;if(process.env.NODE_ENV==="development"&&!t.current){const r=document.querySelector(".react-flow__pane");r&&window.getComputedStyle(r).zIndex!=="1"&&((s=(n=e.getState()).onError)==null||s.call(n,"013",Oe.error013("react"))),t.current=!0}},[])}function _u({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:d,onNodeContextMenu:x,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:f,connectionLineType:h,connectionLineStyle:j,connectionLineComponent:S,connectionLineContainerStyle:R,selectionKeyCode:w,selectionOnDrag:E,selectionMode:C,multiSelectionKeyCode:P,panActivationKeyCode:N,zoomActivationKeyCode:_,deleteKeyCode:$,onlyRenderVisibleElements:D,elementsSelectable:B,defaultViewport:F,translateExtent:O,minZoom:M,maxZoom:y,preventScrolling:k,defaultMarkerColor:b,zoomOnScroll:L,zoomOnPinch:A,panOnScroll:T,panOnScrollSpeed:V,panOnScrollMode:H,zoomOnDoubleClick:G,panOnDrag:ee,onPaneClick:te,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:J,onPaneScroll:ie,onPaneContextMenu:fe,paneClickDistance:Me,nodeClickDistance:de,onEdgeContextMenu:Y,onEdgeMouseEnter:re,onEdgeMouseMove:pe,onEdgeMouseLeave:Pe,reconnectRadius:$e,onReconnect:Qs,onReconnectStart:eo,onReconnectEnd:to,noDragClassName:an,noWheelClassName:no,noPanClassName:un,disableKeyboardA11y:dn,nodeExtent:so,rfId:xn,viewport:pn,onViewportChange:On}){return xl(e),xl(t),iy(),UE(n),QE(pn),o.jsxRuntimeExports.jsx(CE,{onPaneClick:te,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:J,onPaneContextMenu:fe,onPaneScroll:ie,paneClickDistance:Me,deleteKeyCode:$,selectionKeyCode:w,selectionOnDrag:E,selectionMode:C,onSelectionStart:m,onSelectionEnd:f,multiSelectionKeyCode:P,panActivationKeyCode:N,zoomActivationKeyCode:_,elementsSelectable:B,zoomOnScroll:L,zoomOnPinch:A,zoomOnDoubleClick:G,panOnScroll:T,panOnScrollSpeed:V,panOnScrollMode:H,panOnDrag:ee,defaultViewport:F,translateExtent:O,minZoom:M,maxZoom:y,onSelectionContextMenu:p,preventScrolling:k,noDragClassName:an,noWheelClassName:no,noPanClassName:un,disableKeyboardA11y:dn,onViewportChange:On,isControlledViewport:!!pn,children:o.jsxRuntimeExports.jsxs(XE,{children:[o.jsxRuntimeExports.jsx(KE,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:Qs,onReconnectStart:eo,onReconnectEnd:to,onlyRenderVisibleElements:D,onEdgeContextMenu:Y,onEdgeMouseEnter:re,onEdgeMouseMove:pe,onEdgeMouseLeave:Pe,reconnectRadius:$e,defaultMarkerColor:b,noPanClassName:un,disableKeyboardA11y:dn,rfId:xn}),o.jsxRuntimeExports.jsx(oy,{style:j,type:h,component:S,containerStyle:R}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsxRuntimeExports.jsx(LE,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:d,onNodeContextMenu:x,nodeClickDistance:de,onlyRenderVisibleElements:D,noPanClassName:un,noDragClassName:an,disableKeyboardA11y:dn,nodeExtent:so,rfId:xn}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}_u.displayName="GraphView";const ly=g.memo(_u),pl=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a}={})=>{const d=new Map,x=new Map,p=new Map,m=new Map,f=s??t??[],h=n??e??[],j=c??[0,0],S=a??kn;Fa(p,m,f),Yo(h,d,x,{nodeOrigin:j,nodeExtent:S,elevateNodesOnSelect:!1});let R=[0,0,1];if(l&&r&&i){const w=$n(d,{filter:N=>!!((N.width||N.initialWidth)&&(N.height||N.initialHeight))}),{x:E,y:C,zoom:P}=Lr(w,r,i,.5,2,.1);R=[E,C,P]}return{rfId:"1",width:0,height:0,transform:R,nodes:h,nodeLookup:d,parentLookup:x,edges:f,edgeLookup:m,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:kn,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ot.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:j,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:{...Ra},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:Cs,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},cy=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a})=>k5((d,x)=>({...pl({nodes:e,edges:t,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a,defaultNodes:n,defaultEdges:s}),setNodes:p=>{const{nodeLookup:m,parentLookup:f,nodeOrigin:h,elevateNodesOnSelect:j}=x();Yo(p,m,f,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:j,checkEquality:!0}),d({nodes:p})},setEdges:p=>{const{connectionLookup:m,edgeLookup:f}=x();Fa(m,f,p),d({edges:p})},setDefaultNodesAndEdges:(p,m)=>{if(p){const{setNodes:f}=x();f(p),d({hasDefaultNodes:!0})}if(m){const{setEdges:f}=x();f(m),d({hasDefaultEdges:!0})}},updateNodeInternals:(p,m={triggerFitView:!0})=>{const{triggerNodeChanges:f,nodeLookup:h,parentLookup:j,fitViewOnInit:S,fitViewDone:R,fitViewOnInitOptions:w,domNode:E,nodeOrigin:C,nodeExtent:P,debug:N,fitViewSync:_}=x(),{changes:$,updatedInternals:D}=Z3(p,h,j,E,C,P);if(D){if(V3(h,j,{nodeOrigin:C,nodeExtent:P}),m.triggerFitView){let B=R;!R&&S&&(B=_({...w,nodes:w==null?void 0:w.nodes})),d({fitViewDone:B})}else d({});($==null?void 0:$.length)>0&&(N&&console.log("React Flow: trigger node changes",$),f==null||f($))}},updateNodePositions:(p,m=!1)=>{const f=[],h=[],{nodeLookup:j,triggerNodeChanges:S}=x();for(const[R,w]of p){const E=j.get(R),C=!!(E!=null&&E.expandParent&&(E!=null&&E.parentId)&&(w!=null&&w.position)),P={id:R,type:"position",position:C?{x:Math.max(0,w.position.x),y:Math.max(0,w.position.y)}:w.position,dragging:m};C&&E.parentId&&f.push({id:R,parentId:E.parentId,rect:{...w.internals.positionAbsolute,width:w.measured.width??0,height:w.measured.height??0}}),h.push(P)}if(f.length>0){const{parentLookup:R,nodeOrigin:w}=x(),E=Ir(f,j,R,w);h.push(...E)}S(h)},triggerNodeChanges:p=>{const{onNodesChange:m,setNodes:f,nodes:h,hasDefaultNodes:j,debug:S}=x();if(p!=null&&p.length){if(j){const R=ou(p,h);f(R)}S&&console.log("React Flow: trigger node changes",p),m==null||m(p)}},triggerEdgeChanges:p=>{const{onEdgesChange:m,setEdges:f,edges:h,hasDefaultEdges:j,debug:S}=x();if(p!=null&&p.length){if(j){const R=ru(p,h);f(R)}S&&console.log("React Flow: trigger edge changes",p),m==null||m(p)}},addSelectedNodes:p=>{const{multiSelectionActive:m,edgeLookup:f,nodeLookup:h,triggerNodeChanges:j,triggerEdgeChanges:S}=x();if(m){const R=p.map(w=>Nt(w,!0));j(R);return}j(Wt(h,new Set([...p]),!0)),S(Wt(f))},addSelectedEdges:p=>{const{multiSelectionActive:m,edgeLookup:f,nodeLookup:h,triggerNodeChanges:j,triggerEdgeChanges:S}=x();if(m){const R=p.map(w=>Nt(w,!0));S(R);return}S(Wt(f,new Set([...p]))),j(Wt(h,new Set,!0))},unselectNodesAndEdges:({nodes:p,edges:m}={})=>{const{edges:f,nodes:h,nodeLookup:j,triggerNodeChanges:S,triggerEdgeChanges:R}=x(),w=p||h,E=m||f,C=w.map(N=>{const _=j.get(N.id);return _&&(_.selected=!1),Nt(N.id,!1)}),P=E.map(N=>Nt(N.id,!1));S(C),R(P)},setMinZoom:p=>{const{panZoom:m,maxZoom:f}=x();m==null||m.setScaleExtent([p,f]),d({minZoom:p})},setMaxZoom:p=>{const{panZoom:m,minZoom:f}=x();m==null||m.setScaleExtent([f,p]),d({maxZoom:p})},setTranslateExtent:p=>{var m;(m=x().panZoom)==null||m.setTranslateExtent(p),d({translateExtent:p})},setPaneClickDistance:p=>{var m;(m=x().panZoom)==null||m.setClickDistance(p)},resetSelectedElements:()=>{const{edges:p,nodes:m,triggerNodeChanges:f,triggerEdgeChanges:h}=x(),j=m.reduce((R,w)=>w.selected?[...R,Nt(w.id,!1)]:R,[]),S=p.reduce((R,w)=>w.selected?[...R,Nt(w.id,!1)]:R,[]);f(j),h(S)},setNodeExtent:p=>{const{nodes:m,nodeLookup:f,parentLookup:h,nodeOrigin:j,elevateNodesOnSelect:S,nodeExtent:R}=x();p[0][0]===R[0][0]&&p[0][1]===R[0][1]&&p[1][0]===R[1][0]&&p[1][1]===R[1][1]||(Yo(m,f,h,{nodeOrigin:j,nodeExtent:p,elevateNodesOnSelect:S,checkEquality:!1}),d({nodeExtent:p}))},panBy:p=>{const{transform:m,width:f,height:h,panZoom:j,translateExtent:S}=x();return G3({delta:p,panZoom:j,transform:m,translateExtent:S,width:f,height:h})},fitView:p=>{const{panZoom:m,width:f,height:h,minZoom:j,maxZoom:S,nodeLookup:R}=x();if(!m)return Promise.resolve(!1);const w=Oo(R,p);return Vo({nodes:w,width:f,height:h,panZoom:m,minZoom:j,maxZoom:S},p)},fitViewSync:p=>{const{panZoom:m,width:f,height:h,minZoom:j,maxZoom:S,nodeLookup:R}=x();if(!m)return!1;const w=Oo(R,p);return Vo({nodes:w,width:f,height:h,panZoom:m,minZoom:j,maxZoom:S},p),w.size>0},cancelConnection:()=>{d({connection:{...Ra}})},updateConnection:p=>{d({connection:p})},reset:()=>d({...pl()})}),Object.is);function Pu({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,fitView:l,nodeOrigin:c,nodeExtent:a,children:d}){const[x]=g.useState(()=>cy({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a}));return o.jsxRuntimeExports.jsx(M5,{value:x,children:o.jsxRuntimeExports.jsx(U5,{children:d})})}function ay({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:l,fitView:c,nodeOrigin:a,nodeExtent:d}){return g.useContext(Ys)?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):o.jsxRuntimeExports.jsx(Pu,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:d,children:e})}const uy={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function dy({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:l,onNodeClick:c,onEdgeClick:a,onInit:d,onMove:x,onMoveStart:p,onMoveEnd:m,onConnect:f,onConnectStart:h,onConnectEnd:j,onClickConnectStart:S,onClickConnectEnd:R,onNodeMouseEnter:w,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:P,onNodeDoubleClick:N,onNodeDragStart:_,onNodeDrag:$,onNodeDragStop:D,onNodesDelete:B,onEdgesDelete:F,onDelete:O,onSelectionChange:M,onSelectionDragStart:y,onSelectionDrag:k,onSelectionDragStop:b,onSelectionContextMenu:L,onSelectionStart:A,onSelectionEnd:T,onBeforeDelete:V,connectionMode:H,connectionLineType:G=jt.Bezier,connectionLineStyle:ee,connectionLineComponent:te,connectionLineContainerStyle:ne,deleteKeyCode:se="Backspace",selectionKeyCode:J="Shift",selectionOnDrag:ie=!1,selectionMode:fe=en.Full,panActivationKeyCode:Me="Space",multiSelectionKeyCode:de=bs()?"Meta":"Control",zoomActivationKeyCode:Y=bs()?"Meta":"Control",snapToGrid:re,snapGrid:pe,onlyRenderVisibleElements:Pe=!1,selectNodesOnDrag:$e,nodesDraggable:Qs,nodesConnectable:eo,nodesFocusable:to,nodeOrigin:an=nu,edgesFocusable:no,edgesReconnectable:un,elementsSelectable:dn=!0,defaultViewport:so=V5,minZoom:xn=.5,maxZoom:pn=2,translateExtent:On=kn,preventScrolling:cm=!0,nodeExtent:oo,defaultMarkerColor:am="#b1b1b7",zoomOnScroll:um=!0,zoomOnPinch:dm=!0,panOnScroll:xm=!1,panOnScrollSpeed:pm=.5,panOnScrollMode:mm=It.Free,zoomOnDoubleClick:fm=!0,panOnDrag:hm=!0,onPaneClick:gm,onPaneMouseEnter:jm,onPaneMouseMove:Em,onPaneMouseLeave:ym,onPaneScroll:Sm,onPaneContextMenu:Rm,paneClickDistance:Hr=0,nodeClickDistance:Cm=0,children:bm,onReconnect:wm,onReconnectStart:vm,onReconnectEnd:km,onEdgeContextMenu:Mm,onEdgeDoubleClick:_m,onEdgeMouseEnter:Pm,onEdgeMouseMove:Lm,onEdgeMouseLeave:Nm,reconnectRadius:Tm=10,onNodesChange:Am,onEdgesChange:Im,noDragClassName:zm="nodrag",noWheelClassName:$m="nowheel",noPanClassName:Zr="nopan",fitView:Gr,fitViewOptions:Dm,connectOnClick:Bm,attributionPosition:Om,proOptions:Vm,defaultEdgeOptions:Fm,elevateNodesOnSelect:Hm,elevateEdgesOnSelect:Zm,disableKeyboardA11y:Yr=!1,autoPanOnConnect:Gm,autoPanOnNodeDrag:Ym,autoPanSpeed:Wm,connectionRadius:Km,isValidConnection:qm,onError:Xm,style:Um,id:Wr,nodeDragThreshold:Jm,viewport:Qm,onViewportChange:ef,width:tf,height:nf,colorMode:sf="light",debug:of,onScroll:Vn,...rf},lf){const ro=Wr||"1",cf=G5(sf),af=g.useCallback(Kr=>{Kr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Vn==null||Vn(Kr)},[Vn]);return o.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...rf,onScroll:af,style:{...Um,...uy},ref:lf,className:ze(["react-flow",r,cf]),id:Wr,children:o.jsxRuntimeExports.jsxs(ay,{nodes:e,edges:t,width:tf,height:nf,fitView:Gr,nodeOrigin:an,nodeExtent:oo,children:[o.jsxRuntimeExports.jsx(ly,{onInit:d,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:w,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:P,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:l,connectionLineType:G,connectionLineStyle:ee,connectionLineComponent:te,connectionLineContainerStyle:ne,selectionKeyCode:J,selectionOnDrag:ie,selectionMode:fe,deleteKeyCode:se,multiSelectionKeyCode:de,panActivationKeyCode:Me,zoomActivationKeyCode:Y,onlyRenderVisibleElements:Pe,defaultViewport:so,translateExtent:On,minZoom:xn,maxZoom:pn,preventScrolling:cm,zoomOnScroll:um,zoomOnPinch:dm,zoomOnDoubleClick:fm,panOnScroll:xm,panOnScrollSpeed:pm,panOnScrollMode:mm,panOnDrag:hm,onPaneClick:gm,onPaneMouseEnter:jm,onPaneMouseMove:Em,onPaneMouseLeave:ym,onPaneScroll:Sm,onPaneContextMenu:Rm,paneClickDistance:Hr,nodeClickDistance:Cm,onSelectionContextMenu:L,onSelectionStart:A,onSelectionEnd:T,onReconnect:wm,onReconnectStart:vm,onReconnectEnd:km,onEdgeContextMenu:Mm,onEdgeDoubleClick:_m,onEdgeMouseEnter:Pm,onEdgeMouseMove:Lm,onEdgeMouseLeave:Nm,reconnectRadius:Tm,defaultMarkerColor:am,noDragClassName:zm,noWheelClassName:$m,noPanClassName:Zr,rfId:ro,disableKeyboardA11y:Yr,nodeExtent:oo,viewport:Qm,onViewportChange:ef}),o.jsxRuntimeExports.jsx(Z5,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:f,onConnectStart:h,onConnectEnd:j,onClickConnectStart:S,onClickConnectEnd:R,nodesDraggable:Qs,nodesConnectable:eo,nodesFocusable:to,edgesFocusable:no,edgesReconnectable:un,elementsSelectable:dn,elevateNodesOnSelect:Hm,elevateEdgesOnSelect:Zm,minZoom:xn,maxZoom:pn,nodeExtent:oo,onNodesChange:Am,onEdgesChange:Im,snapToGrid:re,snapGrid:pe,connectionMode:H,translateExtent:On,connectOnClick:Bm,defaultEdgeOptions:Fm,fitView:Gr,fitViewOptions:Dm,onNodesDelete:B,onEdgesDelete:F,onDelete:O,onNodeDragStart:_,onNodeDrag:$,onNodeDragStop:D,onSelectionDrag:k,onSelectionDragStart:y,onSelectionDragStop:b,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:Zr,nodeOrigin:an,rfId:ro,autoPanOnConnect:Gm,autoPanOnNodeDrag:Ym,autoPanSpeed:Wm,onError:Xm,connectionRadius:Km,isValidConnection:qm,selectNodesOnDrag:$e,nodeDragThreshold:Jm,onBeforeDelete:V,paneClickDistance:Hr,debug:of}),o.jsxRuntimeExports.jsx(O5,{onSelectionChange:M}),bm,o.jsxRuntimeExports.jsx(I5,{proOptions:Vm,position:Om}),o.jsxRuntimeExports.jsx(T5,{rfId:ro,disableKeyboardA11y:Yr})]})})}var xy=iu(dy);function py(){const e=Le();return g.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),r=Array.isArray(t)?t:[t],i=new Map;r.forEach(l=>{const c=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${l}"]`);c&&i.set(l,{id:l,nodeElement:c,force:!0})}),requestAnimationFrame(()=>s(i,{triggerFitView:!1}))},[])}function my({onStart:e,onChange:t,onEnd:n}){const s=Le();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function fy({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ze(["react-flow__background-pattern",n,s])})}function hy({radius:e,className:t}){return o.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:ze(["react-flow__background-pattern","dots",t])})}var St;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(St||(St={}));const gy={[St.Dots]:1,[St.Lines]:1,[St.Cross]:6},jy=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Lu({id:e,variant:t=St.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:l,bgColor:c,style:a,className:d,patternClassName:x}){const p=g.useRef(null),{transform:m,patternId:f}=Se(jy,Ae),h=s||gy[t],j=t===St.Dots,S=t===St.Cross,R=Array.isArray(n)?n:[n,n],w=[R[0]*m[2]||1,R[1]*m[2]||1],E=h*m[2],C=Array.isArray(i)?i:[i,i],P=S?[E,E]:w,N=[C[0]*m[2]||1+P[0]/2,C[1]*m[2]||1+P[1]/2],_=`${f}${e||""}`;return o.jsxRuntimeExports.jsxs("svg",{className:ze(["react-flow__background",d]),style:{...a,...Ks,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[o.jsxRuntimeExports.jsx("pattern",{id:_,x:m[0]%w[0],y:m[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:j?o.jsxRuntimeExports.jsx(hy,{radius:E/2,className:x}):o.jsxRuntimeExports.jsx(fy,{dimensions:P,lineWidth:r,variant:t,className:x})}),o.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}Lu.displayName="Background";const Ey=g.memo(Lu);function yy(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Sy(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Ry(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.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 Cy(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 by(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Un({children:e,className:t,...n}){return o.jsxRuntimeExports.jsx("button",{type:"button",className:ze(["react-flow__controls-button",t]),...n,children:e})}const wy=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Nu({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:l,onFitView:c,onInteractiveChange:a,className:d,children:x,position:p="bottom-left",orientation:m="vertical","aria-label":f="React Flow controls"}){const h=Le(),{isInteractive:j,minZoomReached:S,maxZoomReached:R}=Se(wy,Ae),{zoomIn:w,zoomOut:E,fitView:C}=Ft(),P=()=>{w(),i==null||i()},N=()=>{E(),l==null||l()},_=()=>{C(r),c==null||c()},$=()=>{h.setState({nodesDraggable:!j,nodesConnectable:!j,elementsSelectable:!j}),a==null||a(!j)},D=m==="horizontal"?"horizontal":"vertical";return o.jsxRuntimeExports.jsxs(Ws,{className:ze(["react-flow__controls",D,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":f,children:[t&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Un,{onClick:P,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:R,children:o.jsxRuntimeExports.jsx(yy,{})}),o.jsxRuntimeExports.jsx(Un,{onClick:N,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S,children:o.jsxRuntimeExports.jsx(Sy,{})})]}),n&&o.jsxRuntimeExports.jsx(Un,{className:"react-flow__controls-fitview",onClick:_,title:"fit view","aria-label":"fit view",children:o.jsxRuntimeExports.jsx(Ry,{})}),s&&o.jsxRuntimeExports.jsx(Un,{className:"react-flow__controls-interactive",onClick:$,title:"toggle interactivity","aria-label":"toggle interactivity",children:j?o.jsxRuntimeExports.jsx(by,{}):o.jsxRuntimeExports.jsx(Cy,{})}),x]})}Nu.displayName="Controls";g.memo(Nu);function vy({id:e,x:t,y:n,width:s,height:r,style:i,color:l,strokeColor:c,strokeWidth:a,className:d,borderRadius:x,shapeRendering:p,selected:m,onClick:f}){const{background:h,backgroundColor:j}=i||{},S=l||h||j;return o.jsxRuntimeExports.jsx("rect",{className:ze(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:x,ry:x,width:s,height:r,style:{fill:S,stroke:c,strokeWidth:a},shapeRendering:p,onClick:f?R=>f(R,e):void 0})}const ky=g.memo(vy),My=e=>e.nodes.map(t=>t.id),bo=e=>e instanceof Function?e:()=>e;function _y({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=ky,onClick:l}){const c=Se(My,Ae),a=bo(t),d=bo(e),x=bo(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:c.map(m=>o.jsxRuntimeExports.jsx(Ly,{id:m,nodeColorFunc:a,nodeStrokeColorFunc:d,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function Py({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:c,onClick:a}){const{node:d,x,y:p,width:m,height:f}=Se(h=>{const j=h.nodeLookup.get(e),{x:S,y:R}=j.internals.positionAbsolute,{width:w,height:E}=mt(j);return{node:j,x:S,y:R,width:w,height:E}},Ae);return!d||d.hidden||!La(d)?null:o.jsxRuntimeExports.jsx(c,{x,y:p,width:m,height:f,style:d.style,selected:!!d.selected,className:s(d),color:t(d),borderRadius:r,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:a,id:d.id})}const Ly=g.memo(Py);var Ny=g.memo(_y);const Ty=200,Ay=150,Iy=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?_a($n(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},zy="react-flow__minimap-desc";function Tu({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:a,maskColor:d,maskStrokeColor:x,maskStrokeWidth:p,position:m="bottom-right",onClick:f,onNodeClick:h,pannable:j=!1,zoomable:S=!1,ariaLabel:R="React Flow mini map",inversePan:w,zoomStep:E=10,offsetScale:C=5}){const P=Le(),N=g.useRef(null),{boundingRect:_,viewBB:$,rfId:D,panZoom:B,translateExtent:F,flowWidth:O,flowHeight:M}=Se(Iy,Ae),y=(e==null?void 0:e.width)??Ty,k=(e==null?void 0:e.height)??Ay,b=_.width/y,L=_.height/k,A=Math.max(b,L),T=A*y,V=A*k,H=C*A,G=_.x-(T-_.width)/2-H,ee=_.y-(V-_.height)/2-H,te=T+H*2,ne=V+H*2,se=`${zy}-${D}`,J=g.useRef(0),ie=g.useRef();J.current=A,g.useEffect(()=>{if(N.current&&B)return ie.current=Q3({domNode:N.current,panZoom:B,getTransform:()=>P.getState().transform,getViewScale:()=>J.current}),()=>{var de;(de=ie.current)==null||de.destroy()}},[B]),g.useEffect(()=>{var de;(de=ie.current)==null||de.update({translateExtent:F,width:O,height:M,inversePan:w,pannable:j,zoomStep:E,zoomable:S})},[j,S,w,E,F,O,M]);const fe=f?de=>{var pe;const[Y,re]=((pe=ie.current)==null?void 0:pe.pointer(de))||[0,0];f(de,{x:Y,y:re})}:void 0,Me=h?g.useCallback((de,Y)=>{const re=P.getState().nodeLookup.get(Y);h(de,re)},[]):void 0;return o.jsxRuntimeExports.jsx(Ws,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof x=="string"?x:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*A: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:ze(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxRuntimeExports.jsxs("svg",{width:y,height:k,viewBox:`${G} ${ee} ${te} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:N,onClick:fe,children:[R&&o.jsxRuntimeExports.jsx("title",{id:se,children:R}),o.jsxRuntimeExports.jsx(Ny,{onClick:Me,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:c}),o.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${G-H},${ee-H}h${te+H*2}v${ne+H*2}h${-te-H*2}z
|
|
39
|
-
M${$.x},${$.y}h${$.width}v${$.height}h${-$.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Tu.displayName="MiniMap";g.memo(Tu);function $y({nodeId:e,position:t,variant:n=yn.Handle,className:s,style:r={},children:i,color:l,minWidth:c=10,minHeight:a=10,maxWidth:d=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:p=!1,shouldResize:m,onResizeStart:f,onResize:h,onResizeEnd:j}){const S=uu(),R=typeof e=="string"?e:S,w=Le(),E=g.useRef(null),C=n===yn.Line?"right":"bottom-right",P=t??C,N=g.useRef(null);g.useEffect(()=>{if(!(!E.current||!R))return N.current||(N.current=m5({domNode:E.current,nodeId:R,getStoreItems:()=>{const{nodeLookup:B,transform:F,snapGrid:O,snapToGrid:M,nodeOrigin:y,domNode:k}=w.getState();return{nodeLookup:B,transform:F,snapGrid:O,snapToGrid:M,nodeOrigin:y,paneDomNode:k}},onChange:(B,F)=>{const{triggerNodeChanges:O,nodeLookup:M,parentLookup:y,nodeOrigin:k}=w.getState(),b=[],L={x:B.x,y:B.y},A=M.get(R);if(A&&A.expandParent&&A.parentId){const T=A.origin??k,V=B.width??A.measured.width??0,H=B.height??A.measured.height??0,G={id:A.id,parentId:A.parentId,rect:{width:V,height:H,...Na({x:B.x??A.position.x,y:B.y??A.position.y},{width:V,height:H},A.parentId,M,T)}},ee=Ir([G],M,y,k);b.push(...ee),L.x=B.x?Math.max(T[0]*V,B.x):void 0,L.y=B.y?Math.max(T[1]*H,B.y):void 0}if(L.x!==void 0&&L.y!==void 0){const T={id:R,type:"position",position:{...L}};b.push(T)}if(B.width!==void 0&&B.height!==void 0){const T={id:R,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:B.width,height:B.height}};b.push(T)}for(const T of F){const V={...T,type:"position"};b.push(V)}O(b)},onEnd:()=>{const B={id:R,type:"dimensions",resizing:!1};w.getState().triggerNodeChanges([B])}})),N.current.update({controlPosition:P,boundaries:{minWidth:c,minHeight:a,maxWidth:d,maxHeight:x},keepAspectRatio:p,onResizeStart:f,onResize:h,onResizeEnd:j,shouldResize:m}),()=>{var B;(B=N.current)==null||B.destroy()}},[P,c,a,d,x,p,f,h,j,m]);const _=P.split("-"),$=n===yn.Line?"borderColor":"backgroundColor",D=l?{...r,[$]:l}:r;return o.jsxRuntimeExports.jsx("div",{className:ze(["react-flow__resize-control","nodrag",..._,n,s]),ref:E,style:D,children:i})}g.memo($y);const Dy=(e,t)=>e.map((n,s)=>u.G.translate(n,t[s])),Au=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:Rt(e),style:{stroke:u.cssString(t)},...n}),By=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:Rt(e),style:{stroke:u.cssString(t),strokeDasharray:"12,4"},...n}),Oy=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:Rt(e),style:{stroke:u.cssString(t),strokeDasharray:"12,4,4"},...n}),Vy=({points:e,color:t,...n})=>{const s=u.G.calculateMiters(e,6),r=e.map((a,d)=>u.G.translate(a,s[d])),i=e.map((a,d)=>u.G.translate(a,u.G.scale(s[d],-1))),l=u.cssString(t),c=.7;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ue,{path:Rt(r),style:{stroke:l,opacity:c},...n}),o.jsxRuntimeExports.jsx(Ue,{path:Rt(e),style:{stroke:l},...n}),o.jsxRuntimeExports.jsx(Ue,{path:Rt(i),style:{stroke:l,opacity:c},...n})]})},ml=5,Fy=(e,t)=>{const n=[],s=[];for(let c=0;c<e.length-1;c++){const a=u.G.distance(e[c],e[c+1]);s.push(a)}const r=t;let i=0,l=r;for(let c=0;c<s.length;c++){const a=s[c],d=e[c],x=e[c+1];for(;i+a>=l;){const p=(l-i)/a,m={x:d.x+p*(x.x-d.x),y:d.y+p*(x.y-d.y)};let f="x";Math.abs(x.x-d.x)<1&&(f="y"),l+=r,!(u.G.distance(m,x)<ml||u.G.distance(m,d)<ml)&&n.push({position:m,direction:f})}i+=a}return n},Hy=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},Zy=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10";n==="x"?t.y+=10/3:t.x-=10/3;let i=u.G.translateX(t,-10),l=45;return n==="y"&&(i=u.G.translateY(t,-10),l+=90),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${i.x},${i.y}) rotate(${l})`,strokeLinecap:"round"})]})},Gy=({color:e,position:t})=>o.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:u.cssString(e),strokeWidth:2}),$r=e=>{const t=({points:n,color:s,...r})=>{const i=Rt(n),l=Fy(n,40);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ue,{path:i,...r,style:{stroke:u.cssString(s)}}),l.map(({position:c,direction:a},d)=>o.jsxRuntimeExports.jsx(e,{position:c,direction:a,color:s},d))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},Yy=$r(Hy),Wy=$r(Zy),Ky=$r(Gy),Rt=e=>{let t="";const s=e.length+-1;for(let r=0;r<s;r++){const i=e[r%e.length],l=e[(r+1)%e.length],c=Math.min(6/Math.hypot(l.x-i.x,l.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-c)+l.x*c},${i.y*(1-c)+l.y*c}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-c)+l.x*c},${i.y*(1-c)+l.y*c}`),r===s-1?t+=`L${l.x},${l.y}`:r<s-1&&(t+=`L${i.x*c+l.x*(1-c)},${i.y*c+l.y*(1-c)}`)}return t},Iu={pipe:Au,electric:By,secondary:Oy,jacketed:Vy,hydraulic:Yy,pneumatic:Wy,data:Ky},zu=Au,$u=[{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"}],qy=e=>o.jsxRuntimeExports.jsx(Ps,{columns:[{key:"name",name:"Type"}],data:$u,style:{width:200},entryRenderKey:"name",...e}),qs=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Ve=(e,t)=>{const n=qs(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return u.Mo.construct(s.position,u._.scale(u.Mo.dims(u.Mo.construct(n)),1/e.getZoom()))},Xy=(e,t)=>Xs.fromFlow(e,t);class Du{constructor(t,n){et(this,"node_",null);et(this,"position");et(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 u.G.translate(u.Mo.topLeft(this.node.box),this.position)}}class Xs{constructor(t,n,s){et(this,"key");et(this,"box");et(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Ve(n,t),r=qs(t),i=r.getElementsByClassName("react-flow__handle"),l=u.Mo.construct(r),c=Array.from(i).map(a=>{const d=u.Mo.center(u.Mo.construct(a)),x=u.G.translation(u.Mo.topLeft(l),d),p=a.className.match(/react-flow__handle-(\w+)/);if(p==null)throw new Error("[schematic] - cannot find handle orientation");const m=u.K.construct(p[0]);return new Du(x,m)});return new Xs(t,s,c)}}const Uy=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:r,toPosition:i,fromNode:l,connectionLineStyle:c,connectionStatus:a})=>{const d=document.querySelector(".react-flow__handle-connecting"),x=d==null?void 0:d.className.match(/react-flow__handle-(\w+)/);if(x!=null){const h=u.K.outer.safeParse(x[1]);h.success&&(i=h.data)}const p=Ft(),m=Gt({sourcePos:u.G.construct(e,t),targetPos:u.G.construct(n,s),sourceOrientation:r,targetOrientation:i,sourceBox:Ve(p,(l==null?void 0:l.id)??""),targetBox:Ve(p,(l==null?void 0:l.id)??"")}),f=Hc(u.G.construct(e,t),m,p.getZoom(),!1);return o.jsxRuntimeExports.jsx(zu,{points:f,style:{...c,stroke:u.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},Jy=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:r,targetPosition:i,style:l,segments:c=[],onSegmentsChange:a,color:d="var(--pluto-gray-l9)",selected:x=!1,variant:p="pipe",...m})=>{const f=u.G.construct(m.sourceX,m.sourceY),h=g.useRef(f),j=u.G.equals(f,h.current),S=u.G.construct(m.targetX,m.targetY),R=g.useRef(S),w=u.G.equals(S,R.current),E=Ft(),[C,P,N]=Z.useCombinedStateAndRef(()=>c.length>0?c:Gt({sourcePos:f,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ve(E,t),targetBox:Ve(E,n)})),_=g.useRef(i),$=g.useRef(s),D=Uo.useDebouncedCallback(a,100,[a]);if(!j||!w){let y=C;const k=u.G.translation(h.current,f),b=u.G.translation(S,R.current);u.G.equals(k,u.G.scale(b,-1),.001)?(h.current=f,R.current=S):(j?w||(y=g0({delta:b,segments:y}),_.current!==i&&(_.current=i,y=Gt({sourcePos:f,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ve(E,t),targetBox:Ve(E,n)})),di({sourcePos:f,targetPos:S,next:y,prev:C})||(y=Gt({sourcePos:f,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ve(E,t),targetBox:Ve(E,n)})),R.current=S):(y=h0({delta:k,segments:y}),$.current!==s&&($.current=s,y=Gt({sourcePos:f,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ve(E,t),targetBox:Ve(E,n)})),di({sourcePos:f,targetPos:S,next:y,prev:C})||(y=Gt({sourcePos:f,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ve(E,t),targetBox:Ve(E,n)})),h.current=f),D(y),P(y))}const B=g.useRef(null),F=We.useCursorDrag({onStart:g.useCallback((y,k,b)=>{B.current={index:Number(b.currentTarget.id.split("-")[1]),segments:[...N.current]}},[]),onMove:g.useCallback(y=>{if(B.current==null)return;const k=x0({segments:B.current.segments,index:B.current.index,magnitude:u.Mo.dim(y,u.g.swap(B.current.segments[B.current.index].direction),!0)/E.getZoom()});P(k)},[]),onEnd:g.useCallback(()=>a(N.current),[a])}),O=Hc(f,C,E.getZoom(),!0),M=Iu[p];return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(M,{points:O,color:d}),x&&Qy(O).map((y,k)=>{const b=C[k].direction,L=u.g.swap(b),A={[u.g.dimension(b)]:"18px",[u.g.dimension(L)]:"4px"},T={[b]:y[b]-9,[L]:y[L]-2};return o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsx("rect",{className:u.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...A,...T,rx:"2px",ry:"2px"}),o.jsxRuntimeExports.jsx("foreignObject",{x:y.x-9,y:y.y-9,width:"18px",height:"18px",children:o.jsxRuntimeExports.jsx("div",{id:`handle-${k}`,className:u.CSS(u.CSS.BE("diagram-edge-handle","dragger"),u.CSS.dir(b)),draggable:!0,onDragStart:F})})]},k)})]})},Qy=e=>e.slice(1).map((t,n)=>{const s=e[n];return u.G.construct((t.x+s.x)/2,(t.y+s.y)/2)}),e4=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:u.G.ZERO,zoom:1}})=>{const[r,i]=g.useState(n),[l,c]=g.useState(e),[a,d]=g.useState(t),[x,p]=g.useState(s),[m,f]=g.useState(!1);return{viewport:x,onViewportChange:p,edges:a,nodes:l,onNodesChange:c,onEdgesChange:d,editable:r,onEditableChange:i,fitViewOnResize:m,setFitViewOnResize:f}},t4=()=>!0,n4={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},s4={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},Bu={maxZoom:1,minZoom:.5},o4={hideAttribution:!0},Ou=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Bn=()=>g.use(Ou),Vu=g.memo(({children:e})=>{const{registerNodeRenderer:t}=Bn();return g.useEffect(()=>t(e),[t,e]),null});Vu.displayName="NodeRenderer";const r4=["Backspace","Delete"],i4=({aetherKey:e,onNodesChange:t,onEdgesChange:n,nodes:s,edges:r,onEditableChange:i,editable:l,viewport:c,triggers:a,onViewportChange:d,fitViewOnResize:x,setFitViewOnResize:p,visible:m,...f})=>{const h=Te.useMemoDeepEqualProps({visible:m}),[{path:j},,S]=Q.use$1({aetherKey:e,type:I.Diagram$1.TYPE,schema:I.diagramStateZ,initialState:{position:c.position,region:u.Mo.ZERO,zoom:c.zoom,...h}});g.useEffect(()=>S(Y=>({...Y,...h})),[h]);const R=Q.use().colors.gray.l9.hex,w=Te.useMemoCompare(()=>a??xr.zoom,Ie.compareModeConfigs,[a]),{fitView:E}=Ft(),C=Uo.useDebouncedCallback(Y=>void E(Y),50,[E]),P=Tn(g.useCallback(Y=>{x&&C({maxZoom:1}),S(re=>({...re,region:Y}))},[S,C,x])),N=g.useRef(null),_=g.useCallback(Y=>{const re=N.current;re!=null&&re.x===Y.x&&re.y===Y.y&&re.zoom===Y.zoom||(N.current=Y,!(isNaN(Y.x)||isNaN(Y.y)||isNaN(Y.zoom))&&(S(pe=>({...pe,position:Y,zoom:Y.zoom})),d(qc(Y))))},[S,d]);my({onStart:_,onChange:_,onEnd:_});const[$,D]=g.useState(()=>()=>null),B=g.useCallback(Y=>D(()=>Y),[]),F=g.useMemo(()=>({custom:({id:Y,positionAbsoluteX:re,positionAbsoluteY:pe,selected:Pe=!1,draggable:$e=!0})=>$({symbolKey:Y,position:{x:re,y:pe},selected:Pe,draggable:$e})}),[$]),O=g.useRef(r),M=g.useMemo(()=>(O.current=r,br(r)),[r]),y=g.useRef(s),k=g.useMemo(()=>(y.current=s,Cr(s)),[s]),b=g.useCallback(Y=>t(Xc(y.current,re=>ou(Y,re)),Y),[t]),L=g.useCallback(Y=>n(ns(O.current,re=>ru(Y,re),R)),[n,R]),A=g.useCallback((Y,re)=>n(ns(O.current,pe=>A3(Y,re,pe),R)),[]),T=g.useCallback(Y=>n(ns(O.current,re=>Ba(Y,re),R)),[n,R]),V=g.useCallback((Y,re)=>{const pe=[...O.current],Pe=pe.findIndex($e=>$e.key===Y);Pe!==-1&&(pe[Pe]={...pe[Pe],segments:re},O.current=pe,n(pe))},[n]),H=l?n4:s4,G=Z.useSyncedRef(V),ee=g.useMemo(()=>({default:Y=>{var re,pe,Pe;return o.jsxRuntimeExports.jsx(Jy,{...Y,segments:((re=Y.data)==null?void 0:re.segments)??[],color:(pe=Y.data)==null?void 0:pe.color,variant:(Pe=Y.data)==null?void 0:Pe.variant,onSegmentsChange:g.useCallback($e=>G.current(Y.id,$e),[Y.id])},Y.id)}}),[]),te=Ie.useHeld({triggers:[["Q"]],loose:!0}),ne=g.useRef(null);Ie.use({triggers:w.zoomReset,callback:g.useCallback(({stage:Y,cursor:re})=>{const pe=ne.current;pe==null||Y!=="start"||!u.Mo.contains(pe,re)||E()},[E])});const se=Ie.purgeMouse(w.select)[0]??null,J=Ie.purgeMouse(w.pan)[0]??null,ie=Ie.purgeMouse(w.zoom)[0]??null,fe={selectionOnDrag:se==null,panOnDrag:J==null,selectionKeyCode:se,panActivationKeyCode:J,zoomActivationKeyCode:ie},Me=Z.useCombinedRefs(ne,P),de=g.useMemo(()=>({visible:m,editable:l,onEditableChange:i,registerNodeRenderer:B,fitViewOnResize:x,setFitViewOnResize:p}),[l,m,i,B,x]);return o.jsxRuntimeExports.jsx(Ou,{value:de,children:o.jsxRuntimeExports.jsx(Q.Composite,{path:j,children:m&&o.jsxRuntimeExports.jsx(xy,{...fe,className:u.CSS(u.CSS.B("diagram"),u.CSS.editable(l),u.CSS.BE("symbol","container")),nodes:k,edges:M,nodeTypes:F,edgeTypes:ee,ref:Me,fitView:!0,onNodesChange:b,onEdgesChange:L,onConnect:T,onReconnect:A,defaultViewport:Kc(c),connectionLineComponent:Uy,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:t4,connectionMode:Ot.Loose,fitViewOptions:Bu,selectionMode:en.Partial,proOptions:o4,deleteKeyCode:r4,...f,style:{[u.CSS.var("diagram-zoom")]:c.zoom,...f.style},...H,nodesDraggable:l&&!te.held})})})},l4=()=>{const{editable:e}=Bn();return e?o.jsxRuntimeExports.jsx(Ey,{}):null},c4=e=>o.jsxRuntimeExports.jsx(ks.Pack,{direction:"y",borderShade:4,className:u.CSS.BE("diagram","controls"),...e}),a4=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=Bn();return o.jsxRuntimeExports.jsx(he.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:u.K.RIGHT_CENTER,tooltip:n?o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Disable edit mode"}):o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?o.jsxRuntimeExports.jsx(Z.E4.EditOff,{}):o.jsxRuntimeExports.jsx(Z.E4.Edit,{})})},u4=({onClick:e,...t})=>{const{fitView:n}=Ft(),{fitViewOnResize:s,setFitViewOnResize:r}=Bn();return o.jsxRuntimeExports.jsx(he.ToggleIcon,{onClick:i=>{n(Bu),e==null||e(i)},value:s,onChange:i=>r(i),rightClickToggle:!0,tooltip:o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:u.K.RIGHT_CENTER,variant:"outlined",...t,children:o.jsxRuntimeExports.jsx(Z.E4.Expand,{})})},d4=e=>o.jsxRuntimeExports.jsx(Pu,{children:o.jsxRuntimeExports.jsx(i4,{...e})}),x4=Object.freeze(Object.defineProperty({__proto__:null,Background:l4,Controls:c4,DefaultPath:zu,Diagram:d4,FitViewControl:u4,HandleLayout:Du,NodeLayout:Xs,NodeRenderer:Vu,PATHS:Iu,PATH_TYPES:$u,SelectPathType:qy,ToggleEditControl:a4,alignNodes:S0,calcPath:Rt,edgeConverter:ns,edgeZ:E0,nodeConverter:Xc,nodeZ:y0,offsetPath:Dy,rfEdgeDataZ:Gc,selectNode:qs,selectNodeBox:Ve,selectNodeLayout:Xy,translateEdgesBackward:Wc,translateEdgesForward:br,translateNodesBackward:Yc,translateNodesForward:Cr,translateViewportBackward:qc,translateViewportForward:Kc,use:e4,useContext:Bn,viewportZ:j0},Symbol.toStringTag,{value:"Module"})),p4=({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=o.jsxRuntimeExports.jsx(Re.Text.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:l,...c})=>{const a=Te.useMemoDeepEqualProps({font:t,color:i,telem:l,visible:s}),[,{scrolling:d,empty:x},p]=Q.use$1({type:I.Log.TYPE,schema:I.logState,initialState:{empty:!0,region:u.Mo.ZERO,scrolling:!1,wheelPos:0,...a}});g.useEffect(()=>{p(f=>({...f,...a}))},[a,p]);const m=Tn(g.useCallback(f=>p(h=>({...h,region:f})),[p]));return o.jsxRuntimeExports.jsx("div",{ref:m,className:u.CSS(u.CSS.B("log"),n),onWheel:f=>{p(h=>({...h,wheelPos:h.wheelPos-f.deltaY,scrolling:h.scrolling?h.scrolling:f.deltaY<0}))},...c,children:x?r:o.jsxRuntimeExports.jsx(he.Icon,{className:u.CSS(u.CSS.BE("log","live"),d&&u.CSS.M("active")),variant:"outlined",onClick:()=>p(f=>({...f,scrolling:!f.scrolling})),tooltip:d?"Resume Scrolling":"Pause Scrolling",children:o.jsxRuntimeExports.jsx(Z.E4.Dynamic,{})})})},m4=Object.freeze(Object.defineProperty({__proto__:null,Log:p4},Symbol.toStringTag,{value:"Module"})),kt=(e,t)=>{const n={};t.forEach(r=>n[r]=void 0);const s=r=>{const{...i}={...r,...n};return o.jsxRuntimeExports.jsx(e,{...i})};return s.displayName=`RemoveProps(${e.displayName})`,s},f4=({value:e,hideOuter:t=!1,hideInner:n,onChange:s})=>{const{outer:r}=e,i=l=>()=>s({...e,...l});return t?o.jsxRuntimeExports.jsx(fl,{className:u.CSS.B("orientation-control"),value:e,onChange:s}):o.jsxRuntimeExports.jsxs(oe.Space,{className:u.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[o.jsxRuntimeExports.jsx(yt,{selected:r==="top",onClick:i({outer:"top"})}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[o.jsxRuntimeExports.jsx(yt,{selected:r==="left",onClick:i({outer:"left"})}),o.jsxRuntimeExports.jsx(fl,{hideInner:n,value:e,onChange:s}),o.jsxRuntimeExports.jsx(yt,{selected:r==="right",onClick:i({outer:"right"})})]}),o.jsxRuntimeExports.jsx(yt,{selected:r==="bottom",onClick:i({outer:"bottom"})})]})},fl=({value:e,onChange:t,className:n,hideInner:s=!1,...r})=>{const{inner:i}=e,l=a=>()=>t({...e,...a});let c={};return s&&(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),o.jsxRuntimeExports.jsxs(oe.Space,{className:u.CSS(n,u.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...r,children:[o.jsxRuntimeExports.jsx(yt,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:i==="top",onClick:l({inner:"top"})}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",justify:"center",children:[o.jsxRuntimeExports.jsx(yt,{style:c,disabled:s,selected:i==="left",onClick:l({inner:"left"})}),o.jsxRuntimeExports.jsx(yt,{style:c,disabled:s,selected:i==="right",onClick:l({inner:"right"})})]}),o.jsxRuntimeExports.jsx(yt,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:i==="bottom",onClick:l({inner:"bottom"})})]})},yt=({selected:e,className:t,...n})=>o.jsxRuntimeExports.jsx(he.Icon,{variant:"text",className:u.CSS(t,u.CSS.selected(e)),...n,children:o.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Ge=({className:e,direction:t,...n})=>o.jsxRuntimeExports.jsx(oe.Space,{direction:t,align:"stretch",className:u.CSS(u.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),Mt=({hideOuter:e,hideInner:t,...n})=>t&&e?null:o.jsxRuntimeExports.jsx(Ce,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:r})=>{var i;return o.jsxRuntimeExports.jsx(f4,{value:{inner:s.orientation??"top",outer:((i=s.label)==null?void 0:i.orientation)??"top"},hideInner:t,hideOuter:e,onChange:l=>r({...s,orientation:l.inner,label:{...s.label,orientation:l.outer}})})}}),Ht=({path:e,omit:t=[]})=>o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(Ce,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>o.jsxRuntimeExports.jsx(ut.Text,{selectOnFocus:!0,...n})}),o.jsxRuntimeExports.jsx(Xt,{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}),o.jsxRuntimeExports.jsx(Ce,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>o.jsxRuntimeExports.jsx(ln,{...n})}),o.jsxRuntimeExports.jsx(Ce,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>o.jsxRuntimeExports.jsx(Ls,{...n})}),o.jsxRuntimeExports.jsx(Ce,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:n=>o.jsxRuntimeExports.jsx(Ul,{...n,yDirection:"down"})})]}),st=e=>o.jsxRuntimeExports.jsx(Ce,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(We.Swatch,{value:t??u.ZERO.setAlpha(1).rgba255,onChange:i=>n(i.rgba255),...r,bordered:!0})}),Fu=e=>o.jsxRuntimeExports.jsx(Ce,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(je.Numeric,{dragScale:{x:.75,y:.5},bounds:{lower:50,upper:1e3},endContent:"%",value:Math.round(t*100),onChange:s=>n(parseFloat((s/100).toFixed(2)))})}),ge=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{omit:e,path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(st,{path:"color",optional:!0}),o.jsxRuntimeExports.jsx(Ce,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:s=>o.jsxRuntimeExports.jsx(Q.Switch$1,{...s})}),o.jsxRuntimeExports.jsx(Fu,{path:"scale"})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideInner:t,hideOuter:n})]}),h4=({path:e})=>{var d,x;const{value:t,onChange:n}=wt({path:e}),s=I.sourcePipelinePropsZ.parse((d=t.source)==null?void 0:d.props),r=I.sinkPipelinePropsZ.parse((x=t.sink)==null?void 0:x.props),i=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=I.setChannelValuePropsZ.parse(r.segments.setter.props),c=p=>{p??(p=0);const m=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:p}),threshold:I.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:m})},a=p=>{p??(p=0);const m=I.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:I.setChannelValue({channel:p}),setpoint:I.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),f=I.authoritySource({channel:p}),h=I.acquireChannelControl({channel:p,authority:255});n({...t,sink:m,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:h,source:f},indicator:{statusSource:f}}})};return o.jsxRuntimeExports.jsxs(Ge,{direction:"x",grow:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(je.Item,{label:"State Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:i.channel,onChange:c})}),o.jsxRuntimeExports.jsx(je.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:l.channel,onChange:a})}),o.jsxRuntimeExports.jsx(Ts,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},Dr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],we=({hideInnerOrientation:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"control":return o.jsxRuntimeExports.jsx(h4,{path:""});default:return o.jsxRuntimeExports.jsx(ge,{hideInnerOrientation:e})}},[e]),n=Ne.useStatic({tabs:Dr,content:t});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...n})},Tt={y:2,x:.25},Sn={lower:0,upper:2e3},hl={lower:0,upper:51},Hu=({includeBorderRadius:e=!1})=>o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(st,{path:"color"}),o.jsxRuntimeExports.jsx(st,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(Ce,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:t=>o.jsxRuntimeExports.jsx(je.Numeric,{dragScale:Tt,bounds:hl,endContent:"%",...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:t=>o.jsxRuntimeExports.jsx(je.Numeric,{dragScale:Tt,bounds:hl,endContent:"%",...t})}),e&&o.jsxRuntimeExports.jsx(Ce,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:t=>o.jsxRuntimeExports.jsx(je.Numeric,{dragScale:Tt,bounds:Sn,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(je.Numeric,{value:t??200,dragScale:Tt,bounds:Sn,endContent:"px",...n})}),o.jsxRuntimeExports.jsx(Ce,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(je.Numeric,{value:t??200,dragScale:Tt,bounds:Sn,endContent:"px",...n})})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideInner:!0})]}),Zu=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],g4=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsxs(Ge,{direction:"y",empty:!0,children:[o.jsxRuntimeExports.jsx(Sr,{path:""}),";"]});default:return o.jsxRuntimeExports.jsxs(Ge,{direction:"x",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(st,{path:"color"}),o.jsxRuntimeExports.jsx(Ce,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(ut.Text,{...s})}),o.jsxRuntimeExports.jsx(Xt,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),o.jsxRuntimeExports.jsx(Ce,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(ln,{...s})})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideInner:!0})]})}},[]),t=Ne.useStatic({tabs:Zu,content:e});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...t})},j4=({path:e})=>{var d;const{value:t,onChange:n}=wt({path:e}),s=I.sourcePipelinePropsZ.parse((d=t.source)==null?void 0:d.props),r=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=I.withinBoundsProps.parse(s.segments.threshold.props),l=x=>{x??(x=0);const p=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:x}),threshold:I.withinBounds({trueBound:{lower:i.trueBound.lower??.9,upper:i.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:p})},c=x=>{const p=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:r.channel}),threshold:I.withinBounds({trueBound:x})},outlet:"threshold"});n({...t,source:p})},a=_s(r.channel);return g.useEffect(()=>n({...t}),[a]),o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:r.channel,onChange:l})}),o.jsxRuntimeExports.jsx(je.Item,{label:"Lower Threshold",children:o.jsxRuntimeExports.jsx(je.Numeric,{value:i.trueBound.lower??.9,onChange:x=>c({...i.trueBound,lower:x})})}),o.jsxRuntimeExports.jsx(je.Item,{label:"Upper Threshold",children:o.jsxRuntimeExports.jsx(je.Numeric,{value:i.trueBound.upper??1.1,onChange:x=>c({...i.trueBound,upper:x})})})]})},E4=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsx(j4,{path:""});default:return o.jsxRuntimeExports.jsx(ge,{})}},[]),t=Ne.useStatic({tabs:Zu,content:e});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...t})},y4=({path:e})=>{var l;const{value:t,onChange:n}=wt({path:e}),s=I.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),r=I.setChannelValuePropsZ.parse(s.segments.setter.props),i=c=>{c??(c=0);const a=I.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:I.setChannelValue({channel:c}),setpoint:I.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),d=I.authoritySource({channel:c}),x=I.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:x,source:d},showIndicator:!0,indicator:{statusSource:d}}})};return o.jsxRuntimeExports.jsxs(Ge,{direction:"x",children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Output Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:r.channel,onChange:i})}),o.jsxRuntimeExports.jsx(Xt,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),o.jsxRuntimeExports.jsx(Ts,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},S4=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(y4,{path:""});default:return o.jsxRuntimeExports.jsx(ge,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=Ne.useStatic({tabs:Dr,content:e});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...t})},R4=({path:e})=>{var l;const{value:t,onChange:n}=wt({path:e}),s=I.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),r=I.setChannelValuePropsZ.parse(s.segments.setter.props),i=c=>{c??(c=0);const a=I.sinkPipeline("number",{connections:[],segments:{setter:I.setChannelValue({channel:c})},inlet:"setter"}),d=I.authoritySource({channel:c}),x=I.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:x,source:d},showIndicator:!0,indicator:{statusSource:d}},disabled:c==0})};return o.jsxRuntimeExports.jsx(Ge,{direction:"x",grow:!0,align:"stretch",children:o.jsxRuntimeExports.jsx(je.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:r.channel,onChange:i})})})},C4=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(R4,{path:""});default:return o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",align:"stretch",grow:!0,size:"small",children:[o.jsxRuntimeExports.jsx(Ht,{path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(mr,{path:"units",label:"Units",align:"start",padHelpText:!1}),o.jsxRuntimeExports.jsx(Ce,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(ql,{...s})}),o.jsxRuntimeExports.jsx(st,{path:"color"})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideInner:!0})]})}},[]),t=Ne.useStatic({tabs:Dr,content:e});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...t})},b4=()=>{const e=wt({path:"autoFit",optional:!0});return o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",grow:!0,children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(Ce,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>o.jsxRuntimeExports.jsx(ut.Text,{...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"level",label:"Text Size",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ln,{...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>o.jsxRuntimeExports.jsx(Ls,{...t})})]}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(st,{path:"color"}),o.jsxRuntimeExports.jsx(Ce,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(je.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:o.jsxRuntimeExports.jsx(he.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:o.jsxRuntimeExports.jsx(Z.E4.AutoFitWidth,{})})})})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:""})]})},w4=()=>o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{path:"label",omit:["maxInlineSize","align","direction"]}),o.jsxRuntimeExports.jsx(st,{path:"color"})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideOuter:!0})]}),v4=()=>o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(st,{path:"color"}),o.jsxRuntimeExports.jsx(st,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(Ce,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(je.Numeric,{value:e??200,dragScale:Tt,bounds:Sn,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(je.Numeric,{value:e??200,dragScale:Tt,bounds:Sn,endContent:"px",...t})})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideInner:!0})]}),_t=()=>o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(st,{path:"color"}),o.jsxRuntimeExports.jsx(Fu,{path:"scale"}),o.jsxRuntimeExports.jsx(Ts,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:""})]}),k4=()=>o.jsxRuntimeExports.jsx(Hu,{includeBorderRadius:!0}),M4=()=>o.jsxRuntimeExports.jsx(we,{hideInnerOrientation:!0}),z=e=>o.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),be=e=>o.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),De=e=>o.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),Ee=e=>o.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),_4={left:{left:X.Left,right:X.Right,top:X.Top,bottom:X.Bottom},right:{left:X.Right,right:X.Left,top:X.Bottom,bottom:X.Top},top:{left:X.Bottom,right:X.Top,top:X.Left,bottom:X.Right},bottom:{left:X.Top,right:X.Bottom,top:X.Right,bottom:X.Left}},P4=(e,t)=>_4[t][e],L4=(e,t=!1)=>{if(t)return e;switch(e){case X.Left:return X.Right;case X.Right:return X.Left;case X.Top:return X.Bottom;case X.Bottom:return X.Top;default:return X.Top}},N4=(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},K=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=py()}catch{return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})}const r=g.useRef(null),i=g.useRef(!0);return g.useEffect(()=>{if(r.current==null)return;if(i.current){i.current=!1;return}const l=r.current.closest(".react-flow__node"),c=l==null?void 0:l.getAttribute("data-id");c!=null&&(s==null||s(c))},[t,n]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("span",{ref:r}),e]})},v=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:r,top:i,style:l,...c})=>{const a=N4(i,s,t,n);return o.jsxRuntimeExports.jsx(Ln,{position:L4(P4(e,t),!r),...c,type:"source",onClick:d=>d.stopPropagation(),className:(u.CSS.B("handle"),u.CSS.BE("handle",c.id)),style:{left:`${a.left}%`,top:`${a.top}%`,...l}})},ye=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:r,...i})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("symbol-primitive"),u.CSS.B("symbol-primitive-toggle"),s!=null&&u.CSS.loc(s),t&&u.CSS.M("enabled"),n&&u.CSS.M("triggered"),e),color:u.cssString(r),...i}),ae=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.B("symbol-primitive"),e),...t}),T4=.8,U=({dimensions:e,orientation:t="left",children:n,className:s,color:r,style:i={},scale:l=1,...c})=>{e=u.g.construct(t)==="y"?u._.swap(e):e;const d=u.cssString(r),x=Q.use();return r!=null&&(i[u.CSS.var("symbol-color")]=new u.Color(r).rgbString,i[u.CSS.var("symbol-color-contrast")]=new u.Color(r).pickByContrast(x.colors.gray.l0,x.colors.gray.l10).rgbString),o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u._.svgViewBox(e),className:u.CSS(u.CSS.loc(t),s),fill:d,stroke:d,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:u._.scale(e,l*T4).width,...i},children:o.jsxRuntimeExports.jsx("g",{children:n})})},Gu=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,orientation:t,className:u.CSS(u.CSS.B("four-way-valve"),e),children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:87},color:s,scale:n,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Yu=({color:e,orientation:t="left",scale:n,...s})=>o.jsxRuntimeExports.jsxs(ye,{...s,className:u.CSS(u.CSS.B("three-way-valve")),orientation:t,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Wu=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(ye,{...s,children:[o.jsxRuntimeExports.jsxs(K,{orientation:e,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:o.jsxRuntimeExports.jsx(z,{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"})})]}),Ku=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ye,{className:u.CSS(u.CSS.B("solenoid-valve"),s&&u.CSS.M("normally-open"),e),...i,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(z,{className:u.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"}),o.jsxRuntimeExports.jsx(Ee,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),o.jsxRuntimeExports.jsx(be,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),qu=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{className:u.CSS(u.CSS.B("relief-valve"),e),enabled:r,...i,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Xu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{orientation:t,className:u.CSS(u.CSS.B("check-valve"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Ee,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Uu=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.cssString(n);return o.jsxRuntimeExports.jsxs(ae,{...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"7",cy:"7",r:"4",fill:i}),o.jsxRuntimeExports.jsx(z,{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,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,orientation:n,className:u.CSS(u.CSS.B("angled-valve"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Qu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:u.CSS(u.CSS.B("ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"43.5978",cy:"20.972",r:"19"}),o.jsxRuntimeExports.jsx(z,{d:"M26.5 12.8472L6.35452 2.17563C4.35901 1.16585 2 2.61598 2 4.85243V37.0918C2 39.3283 4.35901 40.7784 6.35453 39.7686L26.5 29.3472"}),o.jsxRuntimeExports.jsx(z,{d:"M60.5 28.8486L80.6455 39.5202C82.641 40.5299 85 39.0798 85 36.8434V4.60396C85 2.36751 82.641 0.917381 80.6455 1.92716L60.5 12.3486"})]})]}),ed=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:u.CSS(u.CSS.B("three-way-ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.8,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"43.5978",cy:"21.722",r:"19"}),o.jsxRuntimeExports.jsx(z,{d:"M26.5 13.5972L6.35452 2.92563C4.35901 1.91585 2 3.36598 2 5.60243V37.8418C2 40.0783 4.35901 41.5284 6.35453 40.5186L26.5 30.0972"}),o.jsxRuntimeExports.jsx(z,{d:"M60.5 29.5986L80.6455 40.2702C82.641 41.2799 85 39.8298 85 37.5934V5.35396C85 3.11751 82.641 1.66738 80.6455 2.67716L60.5 13.0986"}),o.jsxRuntimeExports.jsx(z,{d:"M35.3737 38.7499L24.7021 58.8954C23.6923 60.8909 25.1425 63.2499 27.3789 63.2499H59.6183C61.8548 63.2499 63.3049 60.8909 62.2951 58.8954L51.8737 38.7499"})]})]}),td=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:u.CSS(u.CSS.B("gate-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 2 L43.5 39.7965"})]})]}),nd=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-one"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 2V40"}),o.jsxRuntimeExports.jsx(De,{cx:"43.5",cy:"21",r:"10",fill:u.cssString(e)})]})]}),sd=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-two"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"43.5",cy:"21",r:"10",fill:u.cssString(e)}),o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),o.jsxRuntimeExports.jsx(z,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),od=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:u.CSS(u.CSS.B("breather-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:8.081,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:91.919,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"91",cy:"49.5",r:"6",fill:u.cssString(e)}),o.jsxRuntimeExports.jsx(De,{cx:"8",cy:"7.5",r:"6",fill:u.cssString(e)}),o.jsxRuntimeExports.jsx(z,{d:"M49.5 28.5L12.3545 9.70349C10.359 8.69372 8 10.1438 8 12.3803V44.6197C8 46.8562 10.359 48.3063 12.3545 47.2965L49.5 28.5ZM49.5 28.5L86.6455 9.70349C88.641 8.69372 91 10.1438 91 12.3803V44.6197C91 46.8562 88.641 48.3063 86.6455 47.2965L49.5 28.5Z"})]})]}),rd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)})]})]}),id=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const i=u.cssString(t);return o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(K,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:5,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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:i}),o.jsxRuntimeExports.jsx(z,{d:"M33 24H2",strokeLinecap:"round"})]})]})},ld=({className:e,color:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(K,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),cd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(K,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(U,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(z,{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"})})]}),ad=({className:e,orientation:t="left",color:n,scale:s=1,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(K,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:50,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(U,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:o.jsxRuntimeExports.jsx(z,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),ud=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:t,className:u.CSS(u.CSS.B("manual-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Ee,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),o.jsxRuntimeExports.jsx(z,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),dd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("orifice_plate"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{color:n,dimensions:{width:96,height:48},orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"3",y:"3",width:"90",height:"42",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(Ee,{x1:"33",y1:"3",x2:"33",y2:"21",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"33",y1:"27",x2:"33",y2:"45",strokeLinecap:"round"})]})]}),gl=(e,t)=>e/t*100,xd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:o.jsxRuntimeExports.jsx(z,{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"})})]}),pd=e=>typeof e=="number"?{topLeft:u.G.construct(e),topRight:u.G.construct(e),bottomLeft:u.G.construct(e),bottomRight:u.G.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:u.G.construct(e.topLeft),topRight:u.G.construct(e.topRight),bottomLeft:u.G.construct(e.bottomLeft),bottomRight:u.G.construct(e.bottomRight)}:e,A4=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:r}=e;return`${t.x}% ${n.x}% ${r.x}% ${s.x}% / ${t.y}% ${n.y}% ${r.y}% ${s.y}%`},md={width:40,height:80},Br={x:50,y:10},Us=({className:e,dimensions:t=md,borderRadius:n=Br,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const c=pd(n),a=s==null,d=Q.use(),{width:x,height:p}=t,m=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,p,x]),f=gl(1,x),h=100-f,j=gl(1,p),S=100-j;return o.jsxRuntimeExports.jsx(ae,{className:u.CSS(e,u.CSS.B("tank")),style:{...t,borderRadius:s??A4(c),borderColor:u.cssString(r??d.colors.gray.l9),backgroundColor:u.cssString(i)},...l,children:o.jsxRuntimeExports.jsxs(K,{refreshDeps:m,orientation:"left",children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:j,id:"1"}),a&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:f,top:c.topLeft.y,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:h,top:c.topRight.y,id:"3"})]}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:S,id:"4"}),a&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:f,top:100-c.bottomLeft.y,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:h,top:100-c.bottomRight.y,id:"6"})]}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:f,top:50,id:"7"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:h,top:50,id:"8"})]})})},fd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(Ee,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),hd=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("orifice"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[o.jsxRuntimeExports.jsx(z,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),gd=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:t,className:u.CSS(u.CSS.B("needle-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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:u.cssString(n)}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),jd=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:u.CSS(u.CSS.B("angled-relief-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[o.jsxRuntimeExports.jsx(Ee,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Ed=({className:e,color:t,dimensions:n,orientation:s="left",units:r="psi",unitsLevel:i="small",children:l,inlineSize:c=80,...a})=>{const d=u.cssString(t),x=Q.use(),p=t==null?"var(--pluto-gray-l0)":u.cssString(new u.Color(t).pickByContrast(x.colors.gray.l0,x.colors.gray.l9));return o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("value"),e),...a,style:{borderColor:d,height:n==null?void 0:n.height,width:"100%"},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:c},children:l}),o.jsxRuntimeExports.jsxs(K,{orientation:s,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.BE("value","units"),u.CSS.M(i)),style:{background:d},children:o.jsxRuntimeExports.jsx(Z.Text,{level:i,color:p,children:r})})]})},yd=({enabled:e=!1,onClick:t,orientation:n="left"})=>o.jsxRuntimeExports.jsxs(ae,{orientation:n,children:[o.jsxRuntimeExports.jsx(Q.Switch$1,{value:e,onClick:t,onChange:()=>{}}),o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Sd=({onClick:e,orientation:t="left",label:n="",color:s,size:r,level:i,onClickDelay:l})=>o.jsxRuntimeExports.jsxs(ae,{orientation:t,children:[o.jsxRuntimeExports.jsx(he.Button,{onClick:e,color:s,size:r,level:i,onClickDelay:l,children:n}),o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:0,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),Rd=({className:e,orientation:t="left",text:n="",width:s,color:r="var(--pluto-gray-l9)",level:i,autoFit:l,align:c="center"})=>{const a={textAlign:c};return u.g.construct(t)==="y"?a.height=l?"fit-content":s:a.width=l?"fit-content":s,o.jsxRuntimeExports.jsx(ae,{style:a,orientation:t,className:u.CSS(u.CSS.B("text-box"),u.CSS.loc(t),e),children:o.jsxRuntimeExports.jsx(Z.Text,{color:u.cssString(r),level:i,children:n})})},Cd=({orientation:e="left",className:t,onClick:n,children:s,value:r,units:i,color:l,onChange:c,size:a="small",disabled:d,...x})=>{const[p,m]=g.useState(r);return o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("setpoint"),t),orientation:e,...x,children:[o.jsxRuntimeExports.jsxs(K,{orientation:e,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:e,left:.5,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:e,left:100,top:50,id:"2",style:{zIndex:5}}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:e,left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx(je.Numeric,{size:a,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,outlineColor:l,borderWidth:1,disabled:d,children:o.jsxRuntimeExports.jsx(he.Button,{size:a,variant:"filled",onClick:()=>c(p),color:l,children:"Set"})})]})},bd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("screw-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(z,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(z,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),wd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("vacuum-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"})})]}),vd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("cavity-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(z,{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:u.CSS(u.CSS.M("detail"),t)})]})]}),kd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("piston-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(z,{d:"M 23 32, h 16, m 0 -8, v 16",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Md=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("static-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),_d=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("rotary-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Pd=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,orientation:n,className:u.CSS(u.CSS.B("light"),s&&u.CSS.M("enabled"),e),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:o.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"})})]}),Ld=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:21.5909,top:25,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:12.5,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:70/88*100,top:20/80*100,id:"5"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(be,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(Ee,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Nd=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M43 1L45 65"})]})]}),Td=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50.5814,top:200/e,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),Ad=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(be,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Id=({height:e=86,className:t,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:e},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(be,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),o.jsxRuntimeExports.jsx(Ee,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"49",x2:"43",y2:"83",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),zd=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(be,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),$d=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Ee,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Dd=({id:e,className:t,orientation:n="right",label:s="text",color:r="black",level:i="p",onLabelChange:l,...c})=>{const a=document.querySelector(`[data-id="${e}"]`);a&&a.classList.add(n);const d=u.g.construct(n)==="y";return o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("arrow"),u.CSS.loc(n),t),orientation:n,...c,children:[o.jsxRuntimeExports.jsx("div",{className:"wrapper",children:o.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:u.cssString(r)},children:o.jsxRuntimeExports.jsx("div",{className:"bg",children:o.jsxRuntimeExports.jsx(Z.MaybeEditable,{value:s,onChange:l,level:i,className:u.CSS.BE("symbol","label")})})})}),o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:d,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:d,id:"2"})]}),o.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:o.jsxRuntimeExports.jsx("defs",{children:o.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[o.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),o.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"}),o.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},Bd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("vent"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(U,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(z,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),Od=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("iso-filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(Ee,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),Vd=({className:e,dimensions:t=md,borderRadius:n=Br,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const c=pd(n),a=Q.use(),d=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]),x=u.cssString(r??a.colors.gray.l9),p=i==null?void 0:u.cssString(i),m=t.width/66,f=t.height/180,h=`scale(${m},${f})`;return o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(e,u.CSS.B("cylinder")),style:{...t},...l,children:[o.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:o.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:x,transform:h,fill:p})}),o.jsxRuntimeExports.jsxs(K,{refreshDeps:d,orientation:"left",children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:2,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:35,top:10,id:"9"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:65,top:10,id:"10"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:40,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:40,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:60,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:60,id:"6"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:80,id:"7"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},Fd=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.cssString(n);return o.jsxRuntimeExports.jsxs(ye,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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}),o.jsxRuntimeExports.jsx(z,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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}),o.jsxRuntimeExports.jsx(De,{cx:"44",cy:"55",r:"4",fill:l}),o.jsxRuntimeExports.jsx(z,{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})]})]})},Hd=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.cssString(n);return o.jsxRuntimeExports.jsxs(ye,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(De,{cx:"21",cy:"56.0737",r:"4",fill:l}),o.jsxRuntimeExports.jsx(z,{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"})]})]})},Zd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:1.6667,top:20,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:98.3333,top:20,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:95,id:"3"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:36,height:18},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(z,{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:u.cssString(n),stroke:"none"})})]}),Gd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:5,top:49,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95,top:49,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:95,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:5,id:"4"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:36,height:36},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(z,{d:"M21 34C21 35.1046 20.1046 36 19 36H17C15.8954 36 15 35.1046 15 34V23C15 21.8954 14.1046 21 13 21H2C0.895432 21 0 20.1046 0 19V17C0 15.8954 0.895432 15 2 15H13C14.1046 15 15 14.1046 15 13V2C15 0.895432 15.8954 0 17 0H19C20.1046 0 21 0.895432 21 2V13C21 14.1046 21.8954 15 23 15H34C35.1046 15 36 15.8954 36 17V19C36 20.1046 35.1046 21 34 21H23C21.8954 21 21 21.8954 21 23V34Z",fill:u.cssString(n),stroke:"none"})})]}),Qe=({position:e,color:t})=>o.jsxRuntimeExports.jsx("text",{x:(e==null?void 0:e.x)??57,y:(e==null?void 0:e.y)??27,style:{fill:u.cssString(t),fontWeight:450},stroke:"none",children:"F"}),Yd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-general"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Qe,{position:{x:56,y:25},color:s})]})]}),Wd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Electromagnetic"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M47.5 17.5H55.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M15.5 17.5H23.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M23.5 17.5C23.5 16.9747 23.6035 16.4546 23.8045 15.9693C24.0055 15.484 24.3001 15.043 24.6716 14.6716C25.043 14.3001 25.484 14.0055 25.9693 13.8045C26.4546 13.6035 26.9747 13.5 27.5 13.5C28.0253 13.5 28.5454 13.6035 29.0307 13.8045C29.516 14.0055 29.957 14.3001 30.3284 14.6716C30.6999 15.043 30.9945 15.484 31.1955 15.9693C31.3965 16.4546 31.5 16.9747 31.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M31.5 17.5C31.5 16.9747 31.6035 16.4546 31.8045 15.9693C32.0055 15.484 32.3001 15.043 32.6716 14.6716C33.043 14.3001 33.484 14.0055 33.9693 13.8045C34.4546 13.6035 34.9747 13.5 35.5 13.5C36.0253 13.5 36.5454 13.6035 37.0307 13.8045C37.516 14.0055 37.957 14.3001 38.3284 14.6716C38.6999 15.043 38.9945 15.484 39.1955 15.9693C39.3965 16.4546 39.5 16.9747 39.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M39.5 17.5C39.5 16.9747 39.6035 16.4546 39.8045 15.9693C40.0055 15.484 40.3001 15.043 40.6716 14.6716C41.043 14.3001 41.484 14.0055 41.9693 13.8045C42.4546 13.6035 42.9747 13.5 43.5 13.5C44.0253 13.5 44.5454 13.6035 45.0307 13.8045C45.516 14.0055 45.957 14.3001 46.3284 14.6716C46.6999 15.043 46.9945 15.484 47.1955 15.9693C47.3965 16.4546 47.5 16.9747 47.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Qe,{position:{x:58,y:29},color:s})]})]}),Kd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-VariableArea"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M46 10V25"}),o.jsxRuntimeExports.jsx(z,{d:"M23 13V22"}),o.jsxRuntimeExports.jsx(z,{d:"M23 13L46 10"}),o.jsxRuntimeExports.jsx(z,{d:"M23 22L46 25"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),qd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Coriolis"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M2 17.6024H28.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M28.5 17.6024L34.6834 14.0324",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M34.8 14L45.9058 20.9666",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M51.5 17.6024L46.0141 20.8987",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M20.5 17.6024L26.6574 14.0474",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M26.75 14.1024L37.788 21.0265",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 17.6024L37.8427 21.0017",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 17.6024H69",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Qe,{position:{x:58,y:29},color:s})]})]}),Xd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Nozzle"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M24 2V7V12",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M24 12H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M24 23H29H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M24 33V23",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),Ud=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Venturi"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M8 33L26.5329 22.3",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M8 2L26.5329 12.7",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M56 33L26.5876 22.2948",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M56 2L26.5876 12.7052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Qe,{position:{x:56,y:29},color:s})]})]}),Jd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-RingPiston"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(De,{cx:"36.5",cy:"17.5",r:"10.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(De,{cx:"36.5",cy:"21.5",r:"6.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Qe,{position:{x:56,y:29},color:s})]})]}),Qd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-PositiveDisplacement"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M41 13C41 15.4853 38.9853 17.5 36.5 17.5C34.0147 17.5 32 15.4853 32 13C32 10.5147 34.0147 8.5 36.5 8.5C38.9853 8.5 41 10.5147 41 13Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M41 22C41 24.4853 38.9853 26.5 36.5 26.5C34.0147 26.5 32 24.4853 32 22C32 19.5147 34.0147 17.5 36.5 17.5C38.9853 17.5 41 19.5147 41 22Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),ex=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Turbine"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M16.5 17.5H54.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M32.5 9L35.4756 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M38.5 26L35.5244 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M32.5 26L35.4756 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M38.5 9L35.5244 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M32.5 9C32.5 8.20435 32.8161 7.44129 33.3787 6.87868C33.9413 6.31607 34.7044 6 35.5 6C36.2956 6 37.0587 6.31607 37.6213 6.87868C38.1839 7.44129 38.5 8.20435 38.5 9",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M38.5 26C38.5 26.7956 38.1839 27.5587 37.6213 28.1213C37.0587 28.6839 36.2956 29 35.5 29C34.7044 29 33.9413 28.6839 33.3787 28.1213C32.8161 27.5587 32.5 26.7956 32.5 26",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),tx=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-Pulse"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M31 13.5H39",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M23 21.5H31",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M39 21.5H47",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M39 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),nx=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("flowmeter-FloatSensor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M25 8H46",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31 27H40",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31 27L25.046 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M40 27L45.954 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),sx=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("heat-exchanger-general"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.545,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.454,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.454,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(z,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),o.jsxRuntimeExports.jsx(z,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"})]})]}),ox=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:89,top:27.27,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:89,top:72.73,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.455,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.545,top:50,id:"5"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(z,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),rx=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:9,top:6.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:24,top:93.75,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:76,top:6.25,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:91,top:93.75,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.508,top:50,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.492,top:50,id:"6"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:199,height:48},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"3",y:"3",width:"193",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(be,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(be,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24",strokeWidth:"2"})]})]}),ix=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31 62C29.2204 62 27.3855 61.332 25.5927 59.9086C23.791 58.4782 22.0952 56.3316 20.6377 53.5381C19.1829 50.7496 18.0147 47.4106 17.214 43.7054C16.4137 40.0021 16 36.0237 16 32C16 27.9763 16.4137 23.9979 17.214 20.2946C18.0147 16.5895 19.1829 13.2504 20.6377 10.4619C22.0952 7.66841 23.791 5.52179 25.5927 4.09136C27.3855 2.66801 29.2204 2 31 2",strokeWidth:"2"})]})]}),lx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M50.3827 20.3601C47.1902 21.7605 43.4002 22.8046 39.2752 23.4077C35.1519 24.0105 30.8103 24.1557 26.5584 23.8319C22.3057 23.508 18.2597 22.7238 14.7044 21.5418C11.1449 20.3584 8.19358 18.8149 6.03181 17.0454M6.02374 46.9613C8.18198 45.1925 11.129 43.6491 14.6841 42.465C18.2349 41.2824 22.2765 40.4968 26.5256 40.1707C30.774 39.8447 35.113 39.9871 39.2353 40.5866C43.3592 41.1864 47.15 42.2268 50.3455 43.6237",strokeLinecap:"round"})]})]}),cx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("compressor"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z",strokeLinecap:"round"})})]}),ax=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(De,{cx:"33",cy:"33",r:"14.5"})]})]}),ux=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M35 12.4V20.4"}),o.jsxRuntimeExports.jsx(z,{d:"M3 33H16"}),o.jsxRuntimeExports.jsx(z,{d:"M35 53.6V45.6"})]})]}),dx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M39 33C39 33.7879 38.8448 34.5681 38.5433 35.2961C38.2417 36.0241 37.7998 36.6855 37.2426 37.2426C36.6855 37.7998 36.0241 38.2417 35.2961 38.5433C34.5681 38.8448 33.7879 39 33 39C32.2121 39 31.4319 38.8448 30.7039 38.5433C29.9759 38.2417 29.3145 37.7998 28.7574 37.2426C28.2002 36.6855 27.7583 36.0241 27.4567 35.2961C27.1552 34.5681 27 33.7879 27 33C27 32.2121 27.1552 31.4319 27.4567 30.7039C27.7583 29.9759 28.2002 29.3145 28.7574 28.7574C29.3145 28.2002 29.9759 27.7583 30.7039 27.4567C31.4319 27.1552 32.2121 27 33 27C33.7879 27 34.5681 27.1552 35.2961 27.4567C36.0241 27.7583 36.6855 28.2002 37.2426 28.7574C37.7998 29.3145 38.2417 29.9759 38.5433 30.7039C38.8448 31.4319 39 32.2121 39 33L39 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M39 33H47"}),o.jsxRuntimeExports.jsx(z,{d:"M27 33H19"}),o.jsxRuntimeExports.jsx(z,{d:"M36 27.804L40 20.8758"}),o.jsxRuntimeExports.jsx(z,{d:"M30 27.804L26 20.8758"}),o.jsxRuntimeExports.jsx(z,{d:"M30 38.196L26 45.1242"}),o.jsxRuntimeExports.jsx(z,{d:"M36 38.196L40 45.1242"})]})]}),xx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M49.1214 16.2515C43.5325 21.3055 36.2463 24.0711 28.7115 23.9986C21.1766 23.9262 13.945 21.0209 8.45428 15.8604M8.4838 50.112C13.9718 44.968 21.1918 42.0733 28.7133 42.0014C36.2348 41.9295 43.5089 44.6858 49.0942 49.7239"})]})]}),px=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M3 33H63"})]})]}),mx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:7.575,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:92.425,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(z,{d:"M16.5 2.5L16.5 66.5M2.5 34.5H30.5M2.5 18.9848H30.5M2.5 50.0152H30.5M5.3 66.5H27.7C29.2464 66.5 30.5 65.1976 30.5 63.5909V5.40909C30.5 3.80244 29.2464 2.5 27.7 2.5H5.3C3.7536 2.5 2.5 3.80245 2.5 5.40909V63.5909C2.5 65.1976 3.7536 66.5 5.3 66.5Z",strokeLinecap:"round"})})]}),fx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(z,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(z,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(z,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(z,{d:"M29.12 65.62L61 34.5"})]})]}),hx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(z,{d:"M30 2.5L30 66.5"}),o.jsxRuntimeExports.jsx(z,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(z,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 50H30"})]})]}),gx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(z,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(z,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(z,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5",strokeLinecap:"square"}),o.jsxRuntimeExports.jsx(Ee,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(Ee,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),jx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(z,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(z,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(z,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(z,{d:"M29.12 65.62L61 34.5"}),o.jsxRuntimeExports.jsx(z,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5"}),o.jsxRuntimeExports.jsx(Ee,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(Ee,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Ex=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("thruster"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:25.3,top:4.76,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:25.3,top:95.24,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),o.jsxRuntimeExports.jsx(z,{d:"M78.5 37.5117V4.51172"}),o.jsxRuntimeExports.jsx(z,{d:"M40.5 11.5L76.0072 2.6232"}),o.jsxRuntimeExports.jsx(z,{d:"M40.5 30.5L76.0072 39.3768"}),o.jsxRuntimeExports.jsx(z,{d:"M75.6192 2.71597C75.9231 2.56695 76.2597 2.49745 76.5977 2.51399C76.9357 2.53052 77.264 2.63256 77.5518 2.81053C77.8397 2.98851 78.0776 3.23661 78.2435 3.53161C78.4093 3.82661 78.4975 4.15886 78.4999 4.49726"}),o.jsxRuntimeExports.jsx(z,{d:"M78.4994 37.5101C78.4914 37.8382 78.4028 38.1592 78.2414 38.445C78.0801 38.7307 77.8509 38.9723 77.574 39.1486C77.2972 39.3248 76.9813 39.4302 76.6541 39.4555C76.3269 39.4808 75.9986 39.4252 75.698 39.2936"})]})]}),yx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(z,{d:"M2.293 2.29297L29.9383 66.7986",strokeDasharray:"6 6"})]})]}),Sx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(z,{d:"M31 34.5L2.30611 2.33992",strokeDasharray:"6 6"}),o.jsxRuntimeExports.jsx(z,{d:"M31 34.5L2.30611 66.6601",strokeDasharray:"6 6"})]})]}),I4=({aetherKey:e,sink:t})=>{const n=Te.useMemoDeepEqualProps({sink:t}),[,,s]=Q.use$1({aetherKey:e,type:I.Button.TYPE,schema:I.buttonStateZ,initialState:{trigger:0,sink:t}});return g.useEffect(()=>{s(i=>({...i,...n}))},[n]),{click:g.useCallback(()=>{s(i=>({...i,trigger:i.trigger+1}))},[s])}},z4=({aetherKey:e,source:t})=>{const n=Te.useMemoDeepEqualProps({source:t}),[,{enabled:s},r]=Q.use$1({aetherKey:e,type:I.Light.TYPE,schema:I.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>r(i=>({...i,...n})),[n,r]),{enabled:s}},$4="Schematic.Grid",D4=e=>{const n=qs(e).closest(".react-flow__pane");n!=null&&Z.triggerReflow(n)},Js=e=>{const t=({symbolKey:s,items:r,onLocationChange:i})=>{const l=`${s}.${$4}`,[c,a]=g.useState(!1),d=g.useCallback(({items:S})=>S.every(R=>R.type===l),[l]),x=Z.useSyncedRef(i),{startDrag:p,onDragEnd:m,...f}=xe.useDragAndDrop({type:l,canDrop:d,onDrop:g.useCallback(({items:S})=>S,[]),onDragOver:g.useCallback(S=>{a(d(S)),S.items.forEach(({key:R})=>x.current(R,e))},[])}),h=r.filter(S=>S.location===e),j=g.useCallback((S,R)=>p([{key:R,type:l}]),[p,l]);return o.jsxRuntimeExports.jsx(oe.Space,{direction:u.K.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e),u.CSS.dropRegion(!0),c&&u.CSS.B("dragging-over")),onDragLeave:()=>a(!1),empty:!0,...f,children:h.map(({element:S,key:R})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(S,{draggable:!0,onDragStart:w=>j(w,R),onDragEnd:m,style:{...S.props.style,cursor:"grab"}})},R))})};return({symbolKey:s,...r})=>{const{editable:i,items:l}=r,c=g.useRef(i);if(i!==c.current&&e==="top"&&(D4(s),c.current=i),i)return o.jsxRuntimeExports.jsx(t,{symbolKey:s,...r});const a=l.filter(d=>d.location===e);return a.length===0?null:o.jsxRuntimeExports.jsx(oe.Space,{direction:u.K.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e)),empty:!0,children:a.map(({element:d,key:x})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:d},x))})}},B4=Js("top"),O4=Js("left"),V4=Js("right"),F4=Js("bottom"),Zt=({editable:e,onRotate:t,children:n,...s})=>o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(B4,{editable:e,...s}),o.jsxRuntimeExports.jsx(O4,{editable:e,...s}),o.jsxRuntimeExports.jsx(V4,{editable:e,...s}),o.jsxRuntimeExports.jsx(F4,{editable:e,...s}),e&&o.jsxRuntimeExports.jsx(he.Icon,{className:u.CSS.BE("grid","rotate"),size:"small",variant:"filled",onClick:t,children:o.jsxRuntimeExports.jsx(Z.E4.Rotate,{})}),n]}),H4=({aetherKey:e,source:t,sink:n})=>{const s=Te.useMemoDeepEqualProps({source:t,sink:n}),[,{value:r},i]=Q.use$1({aetherKey:e,type:I.Setpoint.TYPE,schema:I.setpointStateZ,initialState:{trigger:0,value:0,...s}});return g.useEffect(()=>{i(c=>({...c,...s}))},[s,i]),{set:g.useCallback(c=>i(a=>({...a,trigger:a.trigger+1,command:c})),[i]),value:r}},Z4=({aetherKey:e,source:t,sink:n})=>{const s=Te.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:r,enabled:i},l]=Q.use$1({aetherKey:e,type:I.Toggle.TYPE,schema:I.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:r,enabled:i}},cn=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:r="top",direction:i,align:l,maxInlineSize:c}=e;return n==null||n.length===0?null:{key:"label",element:o.jsxRuntimeExports.jsx(Z.Editable,{className:u.CSS(u.CSS.BE("symbol","label"),u.CSS.dir(i)),level:s,value:n,onChange:a=>t==null?void 0:t({label:{...e,label:a}}),allowEmpty:!0,style:{textAlign:l,maxInlineSize:c}}),location:r}},Or=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:r,indicator:i,orientation:l="bottom"}=e;return{key:"control",element:o.jsxRuntimeExports.jsxs(oe.Space,{direction:u.g.swap(l),align:"center",className:u.CSS(u.CSS.B("control-state")),size:"small",children:[t&&n&&o.jsxRuntimeExports.jsx(Nc,{size:"small",...r}),t&&s&&o.jsxRuntimeExports.jsx(Ic,{...i})]}),location:l}},ve=e=>{const t=({symbolKey:n,control:s,source:r,sink:i,label:l,onChange:c,draggable:a,selected:d,orientation:x="left",...p})=>{const{enabled:m,triggered:f,toggle:h}=Z4({aetherKey:n,source:r,sink:i}),j=[],S=cn(l,c);S!=null&&j.push(S);const R=Or(s);return R!=null&&j.push(R),o.jsxRuntimeExports.jsx(Zt,{editable:d&&!a,symbolKey:n,items:j,onRotate:()=>c({orientation:u.K.rotate90(x)}),onLocationChange:(w,E)=>{w==="label"&&c({label:{...l,orientation:E}}),w==="control"&&c({control:{...s,orientation:E}})},children:o.jsxRuntimeExports.jsx(e,{enabled:m,triggered:f,onClick:h,orientation:x,...p})})};return t.displayName=e.displayName,t},me=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,draggable:l,position:c,orientation:a="left",...d})=>{const x=[],p=cn(s,r);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Zt,{items:x,editable:i&&!l,symbolKey:n,onRotate:()=>r({orientation:u.K.rotate90(a)}),onLocationChange:(m,f)=>{m==="label"&&r({label:{...s,orientation:f}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,...d})})};return t.displayName=e.displayName,t},ft=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,draggable:l,position:c,orientation:a="left",enabled:d=!1,clickable:x=!1,...p})=>{const m=[],f=cn(s,r);f!=null&&m.push(f);const h=()=>{x&&r({enabled:!d})};return o.jsxRuntimeExports.jsx(Zt,{items:m,editable:i&&!l,symbolKey:n,onRotate:()=>r({orientation:u.K.rotate90(a)}),onLocationChange:(j,S)=>{j==="label"&&r({label:{...s,orientation:S}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,enabled:d,onClick:h,...p})})};return t.displayName=e.displayName,t},Rx=ve(Yu),Cx=ve(Wu),bx=ve(Ku),wx=ve(Gu),vx=ve(Ju),kx=ve(rd),Mx=ve(ix),_x=ve(lx),Px=ve(wd),Lx=ve(vd),Nx=ve(kd),Tx=ve(_d),Ax=ve(Nd),Ix=ve(Td),zx=ve(Ad),$x=ve(Id),Dx=ve(zd),Bx=ve($d),Ox=ve(bd),Vx=ve(cx),Fx=ve(ax),Hx=ve(ux),Zx=ve(dx),Gx=ve(xx),Yx=ve(px),Wx=ve(nd),Kx=ve(Qu),qx=ve(ed),Xx=ve(td),Ux=me(fd),Jx=me(Ld),Qx=me(id),ep=me(cd),tp=me(ad),np=me(xd),sp=me(Xu),op=me(Uu),rp=me(hd),ip=ve(yd),lp=me(Bd),cp=me(dd),ap=me(Od),up=me(ld),dp=me(Zd),xp=me(Gd),pp=me(Md),mp=me(Yd),fp=me(Wd),hp=me(Kd),gp=me(qd),jp=me(Xd),Ep=me(Ud),yp=me(Jd),Sp=me(Qd),Rp=me(ex),Cp=me(tx),bp=me(nx),wp=me(sx),vp=me(ox),kp=me(rx),Mp=me(mx),_p=me(hx),Pp=me(fx),Lp=me(gx),Np=me(jx),Tp=me(Ex),Ap=me(yx),Ip=me(Sx),zp=ft(gd),$p=ft(qu),Dp=ft(Fd),Bp=ft(Hd),Op=ft(ud),Vp=ft(jd),Fp=ft(sd),Hp=ft(od),Zp=me(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Us,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),Gp=e=>o.jsxRuntimeExports.jsx(Us,{...e,dimensions:{width:25,height:50}}),Yp=me(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:r,dimensions:i})=>o.jsxRuntimeExports.jsx(Us,{onResize:l=>n({dimensions:l}),orientation:s,color:r,dimensions:i,boxBorderRadius:t,backgroundColor:e})),Wp=e=>o.jsxRuntimeExports.jsx(Us,{...e,dimensions:{width:25,height:50},borderRadius:0}),Kp=({label:e,symbolKey:t,orientation:n="left",control:s,units:r,source:i,sink:l,color:c,onChange:a,selected:d,draggable:x,size:p,disabled:m})=>{const{value:f,set:h}=H4({aetherKey:t,source:i,sink:l}),j=[],S=Or(s);S!=null&&j.push(S);const R=cn(e,a);return R!=null&&j.push(R),o.jsxRuntimeExports.jsx(Zt,{symbolKey:t,editable:d&&!x,onRotate:()=>a({orientation:u.K.rotate90(n)}),items:j,onLocationChange:(w,E)=>{w==="label"&&a({label:{...e,orientation:E}})},children:o.jsxRuntimeExports.jsx(Cd,{value:f,onChange:h,units:r,color:c,orientation:n,disabled:m,size:p})})},qp=({className:e,...t})=>o.jsxRuntimeExports.jsx(Cd,{value:12,onChange:()=>{},units:"mV",style:{width:120,transform:"scale(0.95)"},className:u.CSS(u.CSS.BM("setpoint","preview"),e),disabled:!0,...t,children:o.jsxRuntimeExports.jsx(Z.Text,{level:"p",children:"10.0"})}),Xp=({symbolKey:e,label:t,level:n="p",position:s,textColor:r,color:i,telem:l,units:c,onChange:a,inlineSize:d=70,selected:x,draggable:p,notation:m})=>{const f=qo.useTypography(n),h=(f.lineHeight+.5)*f.baseSize+2,{width:j}=Rr({aetherKey:e,color:r,level:n,box:u.Mo.construct(u.G.translateY({...s},1),{height:h,width:d}),telem:l,minWidth:d,notation:m}),S=[],R=cn(t,a);return R!=null&&S.push(R),o.jsxRuntimeExports.jsx(Zt,{editable:x&&!p,symbolKey:e,items:S,onLocationChange:(w,E)=>{w==="label"&&a({label:{...t,orientation:E}})},children:o.jsxRuntimeExports.jsx(Ed,{color:i,dimensions:{height:h,width:j},inlineSize:d,units:c,unitsLevel:le.downLevel(n)})})},Up=({color:e})=>o.jsxRuntimeExports.jsx(Ed,{color:e,dimensions:{width:60,height:25},units:"psi",children:o.jsxRuntimeExports.jsx(Z.Text,{level:"p",children:"50.00"})}),Jp=({symbolKey:e,label:t,orientation:n="left",sink:s,control:r,selected:i,draggable:l,onChange:c,...a})=>{const{click:d}=I4({aetherKey:e,sink:s}),x=[],p=Or(r);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Zt,{onRotate:()=>c({orientation:u.K.rotate90(n)}),editable:i&&!l,symbolKey:e,items:x,onLocationChange:(m,f)=>{m==="label"&&c({label:{...t,orientation:f}})},children:o.jsxRuntimeExports.jsx(Sd,{...t,onClick:d,orientation:n,...a})})},Qp=({label:e,...t})=>o.jsxRuntimeExports.jsx(Sd,{label:"Button",...t}),em=({symbolKey:e,label:t,source:n,onChange:s,selected:r,draggable:i,...l})=>{const{enabled:c}=z4({aetherKey:e,source:n}),a=[],d=cn(t,s);return d!=null&&a.push(d),o.jsxRuntimeExports.jsx(Zt,{items:a,editable:r&&!i,symbolKey:e,onLocationChange:(x,p)=>{x==="label"&&s({label:{...t,orientation:p}})},children:o.jsxRuntimeExports.jsx(Pd,{enabled:c,...l})})},tm=e=>o.jsxRuntimeExports.jsx(Rd,{...e,autoFit:!0,text:"Text Box"}),nm=({label:{label:e,level:t},orientation:n,color:s,onChange:r})=>o.jsxRuntimeExports.jsx(Dd,{onLabelChange:i=>r({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),sm=({label:e,...t})=>o.jsxRuntimeExports.jsx(Dd,{label:"Off Page",...t,orientation:"right"}),om=me(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Vd,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),rm=e=>o.jsxRuntimeExports.jsx(Vd,{...e,dimensions:{width:25,height:50}}),q=4,Vr=2,G4=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","ballValve","threeWayBallValve","gateValve","butterflyValveOne","butterflyValveTwo","breatherValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","flowmeterGeneral","flowmeterElectromagnetic","flowmeterVariableArea","flowmeterCoriolis","flowmeterNozzle","flowmeterVenturi","flowmeterRingPiston","flowmeterPositiveDisplacement","flowmeterTurbine","flowmeterPulse","flowmeterFloatSensor","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","crossJunction","heatExchangerGeneral","heatExchangerM","heatExchangerStraightTube","diaphragmPump","ejectionPump","compressor","turboCompressor","rollerVaneCompressor","liquidRingCompressor","ejectorCompressor","centrifugalCompressor","flameArrestor","flameArrestorDetonation","flameArrestorExplosion","flameArrestorFireRes","flameArrestorFireResDetonation","thruster","strainer","strainerCone"],Y4=ce.z.enum(G4),ue={orientation:"left",scale:1},W4={source:I.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:I.streamChannelValue({channel:0}),rollingAverage:I.rollingAverage({windowSize:1}),stringifier:I.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},K4={...ue,source:I.sourcePipeline("number",{connections:[],segments:{valueStream:I.streamChannelValue({channel:0})},outlet:"valueStream"})},q4={...ue,sink:I.sinkPipeline("number",{connections:[],segments:{setter:I.setChannelValue({channel:0})},inlet:"setter"})},im={...ue,source:I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:0}),threshold:I.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},lm={...ue,control:{show:!0},sink:I.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:I.setChannelValue({channel:0}),setpoint:I.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},ke={...im,...lm},Pt={...ue,enabled:!1,clickable:!1},W=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),X4={width:125,height:200},Fr={dimensions:X4},U4=3,J4={name:"Three Way Valve",key:"threeWayValve",Form:we,Symbol:Rx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Three Way Valve"),...ke}),Preview:Yu,zIndex:q},Q4={name:"Valve",key:"valve",Form:we,Symbol:Cx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Valve"),...ke}),Preview:Wu,zIndex:q},eS={name:"Solenoid Valve",key:"solenoidValve",Form:we,Symbol:bx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Solenoid Valve"),normallyOpen:!1,...ke}),Preview:Ku,zIndex:q},tS={name:"Four Way Valve",key:"fourWayValve",Form:we,Symbol:wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Four Way Valve"),...ke}),Preview:Gu,zIndex:q},nS={name:"Angled Valve",key:"angledValve",Form:we,Symbol:vx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Angled Valve"),...ke}),Preview:Ju,zIndex:q},sS={name:"Ball Valve",key:"ballValve",Form:we,Symbol:Kx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Ball Valve"),...ke}),Preview:Qu,zIndex:q},oS={name:"Three-Way Ball Valve",key:"threeWayBallValve",Form:we,Symbol:qx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Three-Way Ball Valve"),...ke}),Preview:ed,zIndex:q},rS={name:"Gate Valve",key:"gateValve",Form:we,Symbol:Xx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Gate Valve"),...ke}),Preview:td,zIndex:q},iS={name:"Butterfly Valve (Remote)",key:"butterflyValveOne",Form:we,Symbol:Wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Butterfly Valve (Remote)"),...ke}),Preview:nd,zIndex:q},lS={name:"Butterfly Valve (Manual)",key:"butterflyValveTwo",Form:_t,Symbol:Fp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Butterfly Valve (Manual)"),...Pt}),Preview:kt(sd,["clickable"]),zIndex:q},cS={name:"Breather Valve",key:"breatherValve",Form:_t,Symbol:Hp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Breather Valve"),...Pt}),Preview:kt(od,["clickable"]),zIndex:q},aS={name:"Pump",key:"pump",Form:we,Symbol:kx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Pump"),...ke}),Preview:rd,zIndex:q},uS={name:"Screw Pump",key:"screwPump",Form:we,Symbol:Ox,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Screw Pump"),...ke}),Preview:bd,zIndex:q},dS={name:"Tank",key:"tank",Form:Hu,Symbol:Zp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...W("Tank"),borderRadius:Br,...Fr,...ue}),Preview:Gp,zIndex:Vr},xS={name:"Cylinder",key:"cylinder",Form:v4,Symbol:om,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...W("cylinder"),dimensions:{width:66,height:181},...ue}),Preview:rm,zIndex:Vr},pS={name:"Box",key:"box",Form:k4,Symbol:Yp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...W("Box"),borderRadius:U4,...Fr,...ue}),Preview:Wp,zIndex:Vr},mS={name:"Relief Valve",key:"reliefValve",Form:_t,Symbol:$p,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Relief Valve"),...Pt}),Preview:kt(qu,["clickable"]),zIndex:q},fS={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:_t,Symbol:Dp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Spring Loaded Relief Valve"),...Pt}),Preview:kt(Fd,["clickable"]),zIndex:q},hS={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:_t,Symbol:Bp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Angled Spring Loaded Relief Valve"),...Pt}),Preview:kt(Hd,["clickable"]),zIndex:q},gS={name:"Regulator",key:"regulator",Form:ge,Symbol:Ux,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Regulator"),...ue}),Preview:fd,zIndex:q},jS={name:"Electric Regulator",key:"electricRegulator",Form:ge,Symbol:Jx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Electric Regulator"),...ue}),Preview:Ld,zIndex:q},ES={name:"Burst Disc",key:"burstDisc",Form:ge,Symbol:Qx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Burst Disc"),...ue}),Preview:id,zIndex:q},yS={name:"ISO Burst Disc",key:"isoBurstDisc",Form:ge,Symbol:up,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("ISO Burst Disc"),...ue}),Preview:ld,zIndex:q},SS={name:"Cap",key:"cap",Form:ge,Symbol:ep,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Cap"),...ue}),Preview:cd,zIndex:q},RS={name:"ISO Cap",key:"isoCap",Form:ge,Symbol:tp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("ISO Cap"),...ue}),Preview:ad,zIndex:q},CS={name:"Manual Valve",key:"manualValve",Form:_t,Symbol:Op,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Manual Valve"),...Pt}),Preview:kt(ud,["clickable"]),zIndex:q},bS={name:"Orifice Plate",key:"orificePlate",Form:ge,Symbol:cp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Orifice Plate"),...ue}),Preview:dd,zIndex:q},wS={name:"ISO Filter",key:"isoFilter",Form:ge,Symbol:ap,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("ISO Filter"),...ue}),Preview:Od,zIndex:q},vS={name:"Filter",key:"filter",Form:ge,Symbol:np,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Filter"),...ue}),Preview:xd,zIndex:q},kS={name:"Needle Valve",key:"needleValve",Form:_t,Symbol:zp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Needle Valve"),...Pt}),Preview:kt(gd,["clickable"]),zIndex:q},MS={name:"Check Valve",key:"checkValve",Form:ge,Symbol:sp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Check Valve"),...ue}),Preview:Xu,zIndex:q},_S={name:"Orifice",key:"orifice",Form:ge,Symbol:rp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Orifice"),...ue}),Preview:hd,zIndex:q},PS={name:"Angled Relief Valve",key:"angledReliefValve",Form:_t,Symbol:Vp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Angled Relief Valve"),...Pt}),Preview:kt(jd,["clickable"]),zIndex:q},LS={name:"Value",key:"value",Form:g4,Symbol:Xp,Preview:Up,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...W("Value"),...ue,telem:W4.source}),zIndex:q},NS={name:"Button",key:"button",Symbol:Jp,Form:S4,Preview:Qp,defaultProps:e=>({color:e.colors.primary.z.rgba255,...W("Button"),...lm,onClickDelay:0,scale:null}),zIndex:q},TS={name:"Switch",key:"switch",Symbol:ip,Form:M4,defaultProps:()=>({...W("Switch"),...ke,scale:null}),Preview:yd,zIndex:q},AS={name:"Vacuum Pump",key:"vacuumPump",Symbol:Px,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Vacuum Pump"),...ke}),Preview:wd,zIndex:q},IS={name:"Compressor",key:"compressor",Symbol:Vx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Compressor"),...ke}),Preview:cx,zIndex:q},zS={name:"Cavity Pump",key:"cavityPump",Symbol:Lx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Cavity Pump"),...ke}),Preview:vd,zIndex:q},$S={name:"Piston Pump",key:"pistonPump",Symbol:Nx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Piston Pump"),...ke}),Preview:kd,zIndex:q},DS={name:"Static Mixer",key:"staticMixer",Symbol:pp,Form:ge,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Static Mixer"),...ue}),Preview:Md,zIndex:q},BS={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Tx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Rotary Mixer"),...ke}),Preview:_d,zIndex:q},OS={name:"Light",key:"light",Symbol:em,Form:E4,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Light"),...im}),Preview:Pd,zIndex:q},VS={name:"Setpoint",key:"setpoint",Symbol:Kp,Form:C4,defaultProps:e=>({units:"mV",color:e.colors.gray.l9.rgba255,size:"small",...W("Setpoint"),...K4,...q4}),Preview:qp,zIndex:q},FS={name:"Agitator",key:"agitator",Symbol:Ax,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Agitator"),...ke}),Preview:Nd,zIndex:q},HS={name:"Propeller Agitator",key:"propellerAgitator",Symbol:Ix,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Propeller Agitator"),...ke}),Preview:Td,zIndex:q},ZS={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:zx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flat Blade Agitator"),...ke}),Preview:Ad,zIndex:q},GS={name:"Paddle Agitator",key:"paddleAgitator",Symbol:$x,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Paddle Agitator"),...ke}),Preview:Id,zIndex:q},YS={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Dx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Cross Beam Agitator"),...ke}),Preview:zd,zIndex:q},WS={name:"Helical Agitator",key:"helicalAgitator",Symbol:Bx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Helical Agitator"),...ke}),Preview:$d,zIndex:q},KS={name:"Text Box",key:"textBox",Symbol:Rd,Form:b4,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...W("Text Box"),...ue,...Fr,level:"p",text:"Text Box",width:75}),Preview:tm,zIndex:q},qS={name:"Off Page Reference",key:"offPageReference",Form:w4,Symbol:nm,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...W("Off Page Reference")}),Preview:sm,zIndex:q},XS={name:"ISO Check Valve",key:"isoCheckValve",Form:ge,Symbol:op,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("ISO Check Valve"),...ue}),Preview:Uu,zIndex:q},US={name:"Vent",key:"vent",Form:ge,Symbol:lp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Vent"),...ue}),Preview:Bd,zIndex:q},JS={name:"T Junction",key:"tJunction",Form:ge,Symbol:dp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W(""),...ue}),Preview:Zd,zIndex:q+20},QS={name:"Cross Junction",key:"crossJunction",Form:ge,Symbol:xp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W(""),...ue}),Preview:Gd,zIndex:q+20},eR={name:"Flowmeter General",key:"flowmeterGeneral",Form:ge,Symbol:mp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("General Flowmeter"),...ue}),Preview:Yd,zIndex:q},tR={name:"Flowmeter Electromagnetic",key:"flowmeterElectromagnetic",Form:ge,Symbol:fp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Electromagnetic Flowmeter"),...ue}),Preview:Wd,zIndex:q},nR={name:"Flowmeter Variable Area",key:"flowmeterVariableArea",Form:ge,Symbol:hp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Variable Area Flowmeter"),...ue}),Preview:Kd,zIndex:q},sR={name:"Flowmeter Coriolis",key:"flowmeterCoriolis",Form:ge,Symbol:gp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Coriolis Flowmeter"),...ue}),Preview:qd,zIndex:q},oR={name:"Flowmeter Nozzle",key:"flowmeterNozzle",Form:ge,Symbol:jp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Nozzle Flowmeter"),...ue}),Preview:Xd,zIndex:q},rR={name:"Flowmeter Venturi",key:"flowmeterVenturi",Form:ge,Symbol:Ep,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Venturi Flowmeter"),...ue}),Preview:Ud,zIndex:q},iR={name:"Flowmeter Ring Piston",key:"flowmeterRingPiston",Form:ge,Symbol:yp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Ring Piston Flowmeter"),...ue}),Preview:Jd,zIndex:q},lR={name:"Flowmeter Positive Displacement",key:"flowmeterPositiveDisplacement",Form:ge,Symbol:Sp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Positive Displacement Flowmeter"),...ue}),Preview:Qd,zIndex:q},cR={name:"Flowmeter Turbine",key:"flowmeterTurbine",Form:ge,Symbol:Rp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Turbine Flowmeter"),...ue}),Preview:ex,zIndex:q},aR={name:"Flowmeter Pulse",key:"flowmeterPulse",Form:ge,Symbol:Cp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Pulse Flowmeter"),...ue}),Preview:tx,zIndex:q},uR={name:"Flowmeter Float Sensor",key:"flowmeterFloatSensor",Form:ge,Symbol:bp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Float Sensor Flowmeter"),...ue}),Preview:nx,zIndex:q},dR={name:"Heat Exchanger General",key:"heatExchangerGeneral",Form:ge,Symbol:wp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("General Heat Exchanger"),...ue}),Preview:sx,zIndex:q},xR={name:"Heat Exchanger M",key:"heatExchangerM",Form:ge,Symbol:vp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("M Heat Exchanger"),...ue}),Preview:ox,zIndex:q},pR={name:"Heat Exchanger Straight Tube",key:"heatExchangerStraightTube",Form:ge,Symbol:kp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Straight Tube Heat Exchanger"),...ue}),Preview:rx,zIndex:q},mR={name:"Turbo Compressor",key:"turboCompressor",Form:we,Symbol:Fx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Turbo Compressor"),...ke}),Preview:ax,zIndex:q},fR={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:we,Symbol:Hx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Roller Vane Compressor"),...ke}),Preview:ux,zIndex:q},hR={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:we,Symbol:Zx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Liquid Ring Compressor"),...ke}),Preview:dx,zIndex:q},gR={name:"Ejector Compressor",key:"ejectorCompressor",Form:we,Symbol:Gx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Ejector Compressor"),...ke}),Preview:xx,zIndex:q},jR={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:we,Symbol:Yx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Centrifugal Compressor"),...ke}),Preview:px,zIndex:q},ER={name:"Diaphragm Pump",key:"diaphragmPump",Form:we,Symbol:Mx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Diaphragm Pump"),...ke}),Preview:ix,zIndex:q},yR={name:"Ejection Pump",key:"ejectionPump",Form:we,Symbol:_x,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Ejection Pump"),...ke}),Preview:lx,zIndex:q},SR={name:"Flame Arrestor",key:"flameArrestor",Form:ge,Symbol:Mp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flame Arrestor"),...ue}),Preview:mx,zIndex:q},RR={name:"Flame Arrestor (Explosion-Proof)",key:"flameArrestorExplosion",Form:ge,Symbol:_p,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flame Arrestor (Explosion-Proof)"),...ue}),Preview:hx,zIndex:q},CR={name:"Flame Arrestor (Detonation-Proof)",key:"flameArrestorDetonation",Form:ge,Symbol:Pp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flame Arrestor (Detonation-Proof)"),...ue}),Preview:fx,zIndex:q},bR={name:"Flame Arrestor (Fire Resistant)",key:"flameArrestorFireRes",Form:ge,Symbol:Lp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flame Arrestor (Fire Resistant)"),...ue}),Preview:gx,zIndex:q},wR={name:"Flame Arrestor (Fire Resistant and Detonation-Proof)",key:"flameArrestorFireResDetonation",Form:ge,Symbol:Np,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...ue}),Preview:jx,zIndex:q},vR={name:"Thruster",key:"thruster",Form:we,Symbol:Tp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Thruster"),...ke}),Preview:Ex,zIndex:q},kR={name:"Strainer",key:"strainer",Form:ge,Symbol:Ap,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Strainer"),...ue}),Preview:yx,zIndex:q},MR={name:"Strainer Cone",key:"strainerCone",Form:ge,Symbol:Ip,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Strainer Cone"),...ue}),Preview:Sx,zIndex:q},_R={value:LS,button:NS,tank:dS,tJunction:JS,crossJunction:QS,switch:TS,offPageReference:qS,light:OS,setpoint:VS,box:pS,textBox:KS,valve:Q4,solenoidValve:eS,threeWayValve:J4,fourWayValve:tS,angledValve:nS,ballValve:sS,threeWayBallValve:oS,gateValve:rS,butterflyValveOne:iS,butterflyValveTwo:lS,breatherValve:cS,manualValve:CS,needleValve:kS,reliefValve:mS,angledReliefValve:PS,checkValve:MS,regulator:gS,electricRegulator:jS,springLoadedReliefValve:fS,angledSpringLoadedReliefValve:hS,pump:aS,pistonPump:$S,screwPump:uS,cavityPump:zS,diaphragmPump:ER,ejectionPump:yR,vacuumPump:AS,compressor:IS,turboCompressor:mR,rollerVaneCompressor:fR,liquidRingCompressor:hR,ejectorCompressor:gR,centrifugalCompressor:jR,staticMixer:DS,rotaryMixer:BS,burstDisc:ES,isoBurstDisc:yS,cap:SS,isoCap:RS,filter:vS,isoFilter:wS,orifice:_S,orificePlate:bS,agitator:FS,propellerAgitator:HS,flatBladeAgitator:ZS,paddleAgitator:GS,crossBeamAgitator:YS,helicalAgitator:WS,isoCheckValve:XS,vent:US,cylinder:xS,flowmeterGeneral:eR,flowmeterElectromagnetic:tR,flowmeterVariableArea:nR,flowmeterCoriolis:sR,flowmeterNozzle:oR,flowmeterVenturi:rR,flowmeterRingPiston:iR,flowmeterPositiveDisplacement:lR,flowmeterTurbine:cR,flowmeterPulse:aR,flowmeterFloatSensor:uR,heatExchangerGeneral:dR,heatExchangerM:xR,heatExchangerStraightTube:pR,flameArrestor:SR,flameArrestorExplosion:RR,flameArrestorDetonation:CR,flameArrestorFireRes:bR,flameArrestorFireResDetonation:wR,thruster:vR,strainer:kR,strainerCone:MR},PR=Object.freeze(Object.defineProperty({__proto__:null,Agitator:Ax,AngledReliefValve:Vp,AngledSpringLoadedReliefValve:Bp,AngledValve:vx,BallValve:Kx,Box:Yp,BoxPreview:Wp,BreatherValve:Hp,BurstDisc:Qx,ButterflyValveOne:Wx,ButterflyValveTwo:Fp,Button:Jp,ButtonPreview:Qp,Cap:ep,CavityPump:Lx,CentrifugalCompressor:Yx,CheckValve:sp,Compressor:Vx,CrossBeamAgitator:Dx,CrossJunction:xp,Cylinder:om,CylinderPreview:rm,DiaphragmPump:Mx,EjectionPump:_x,EjectorCompressor:Gx,ElectricRegulator:Jx,Filter:np,FlameArrestor:Mp,FlameArrestorDetonation:Pp,FlameArrestorExplosion:_p,FlameArrestorFireRes:Lp,FlameArrestorFireResDetonation:Np,FlatBladeAgitator:zx,FlowmeterCoriolis:gp,FlowmeterElectromagnetic:fp,FlowmeterFloatSensor:bp,FlowmeterGeneral:mp,FlowmeterNozzle:jp,FlowmeterPositiveDisplacement:Sp,FlowmeterPulse:Cp,FlowmeterRingPiston:yp,FlowmeterTurbine:Rp,FlowmeterVariableArea:hp,FlowmeterVenturi:Ep,FourWayValve:wx,GateValve:Xx,HeatExchangerGeneral:wp,HeatExchangerM:vp,HeatExchangerStraightTube:kp,HelicalAgitator:Bx,ISOBurstDisc:up,ISOCap:tp,ISOCheckValve:op,ISOFilter:ap,Light:em,LiquidRingCompressor:Zx,ManualValve:Op,NeedleValve:zp,OffPageReference:nm,OffPageReferencePreview:sm,Orifice:rp,OrificePlate:cp,PaddleAgitator:$x,PistonPump:Nx,PropellerAgitator:Ix,Pump:kx,Regulator:Ux,ReliefValve:$p,RollerVaneCompressor:Hx,RotaryMixer:Tx,SYMBOLS:_R,ScrewPump:Ox,Setpoint:Kp,SetpointPreview:qp,SolenoidValve:bx,SpringLoadedReliefValve:Dp,StaticMixer:pp,Strainer:Ap,StrainerCone:Ip,Switch:ip,TJunction:dp,Tank:Zp,TankPreview:Gp,TextBoxPreview:tm,ThreeWayBallValve:qx,ThreeWayValve:Rx,Thruster:Tp,TurboCompressor:Fx,VacuumPump:Px,Value:Xp,ValuePreview:Up,Valve:Cx,Vent:lp,createDummyToggle:ft,createLabeled:me,createToggle:ve,variantZ:Y4},Symbol.toStringTag,{value:"Module"}));exports.useCombinedRefs=Z.useCombinedRefs;exports.useCombinedStateAndRef=Z.useCombinedStateAndRef;exports.useInitializerRef=Z.useInitializerRef;exports.usePrevious=Z.usePrevious;exports.useStateRef=Z.useStateRef;exports.useSyncedRef=Z.useSyncedRef;exports.CSS=u.CSS;exports.newBEM=u.newBEM;exports.Header=Jn.external;exports.DataType=le.g$1;exports.Density=le.b;exports.MultiSeries=le.Lt;exports.Rate=le.$;exports.Series=le.Z;exports.TimeRange=le.U;exports.TimeSpan=le.y$1;exports.TimeStamp=le.m;exports.state=le.state;exports.Generic=xf.Generic;exports.Input=je.external;exports.preventDefault=je.preventDefault;exports.stopPropagation=je.stopPropagation;exports.Aether=Q.main;exports.Worker=Q.Context;exports.useAsyncEffect=Q.useAsyncEffect;exports.useEffectCompare=Q.useEffectCompare;exports.Align=mf.external;exports.Icon=Ne.Icon;exports.Tabs=Ne.external;exports.Text=jl.external;exports.Divider=vs.Divider$1;exports.Button=ff.external;exports.Caret=Nn.Animated$1;exports.Tree=Nn.external;exports.componentRenderProp=he.componentRenderProp;exports.isRenderProp=he.isRenderProp;exports.useTransforms=Re.useTransforms;exports.telem=I.external;exports.Haul=xe.Haul;exports.compareArrayDeps=Te.compareArrayDeps;exports.useMemoCompare=Te.useMemoCompare;exports.useMemoDeepEqualProps=Te.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=Te.useMemoPrimitiveArray;exports.Dialog=Ye.use$1;exports.Dropdown=Ye.Dropdown;exports.useResize=Ye.useResize;exports.Color=We.external;exports.Triggers=El.external;exports.List=bt.external;exports.createFilterTransform=bt.createFilterTransform;exports.fuseFilter=bt.fuseFilter;exports.proxyMemo=bt.proxyMemo;exports.createHexOpacityVariants=yl.createHexOpacityVariants;exports.unitProperty=yl.unitProperty;exports.useClickOutside=Sl.useClickOutside;exports.useDebouncedCallback=Uo.useDebouncedCallback;exports.Menu=gf.external;exports.Theming=jf.external;exports.Video=Ef.Video;exports.Accordion=zf;exports.Breadcrumb=Bf;exports.Canvas=uh;exports.Channel=pg;exports.Control=R1;exports.Device=Lg;exports.Diagram=x4;exports.Eraser=Zf;exports.Form=Mg;exports.Label=Og;exports.Legend=fh;exports.Line=gh;exports.LinePlot=Jh;exports.Log=m4;exports.Measure=ng;exports.Modal=Fg;exports.Mosaic=r1;exports.Nav=Wf;exports.Note=l1;exports.OS=x1;exports.Observe=vg;exports.Override=m1;exports.Pluto=v1;exports.Portal=Ug;exports.Progress=M1;exports.Rack=Ag;exports.Range=eg;exports.Ranger=I1;exports.Resize=Mf;exports.Rule=sg;exports.Schematic=PR;exports.Select=Bh;exports.Status=Ff;exports.Steps=$1;exports.Synnax=Xf;exports.Table=F1;exports.TableCells=i0;exports.Tag=Th;exports.Telem=g1;exports.Tooltip=Sf;exports.Value=Y1;exports.Viewport=Xh;exports.axis=ih;exports.control=j1;exports.useDelayedState=yf;
|
|
38
|
+
`)),x=u.reduce((p,m)=>p.concat(...m),[]);return[u,x]}return[[],[]]},[e]);return g.useEffect(()=>{const a=(t==null?void 0:t.target)||Xi;if(e!==null){const u=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!t.actInsideInputWithModifier)&&Ho(m))return!1;const h=Ji(m.code,c);i.current.add(m[h]),Ui(l,i.current,!1)&&(m.preventDefault(),s(!0))},x=m=>{if((!r.current||r.current&&!t.actInsideInputWithModifier)&&Ho(m))return!1;const h=Ji(m.code,c);Ui(l,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(m[h]),m.key==="Meta"&&i.current.clear(),r.current=!1},p=()=>{i.current.clear(),s(!1)};return a==null||a.addEventListener("keydown",u),a==null||a.addEventListener("keyup",x),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{a==null||a.removeEventListener("keydown",u),a==null||a.removeEventListener("keyup",x),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,s]),n}function Ui(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function Ji(e,t){return t.includes(e)?"code":"key"}const Y5=()=>{const e=Le();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,r,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},{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:r,panZoom:i,domNode:l}=e.getState();if(!i||!l)return Promise.resolve(!1);const c=Oo(n,t),{width:a,height:u}=Zs(l);return Vo({nodes:c,width:a,height:u,minZoom:s,maxZoom:r,panZoom:i},t)},setCenter:async(t,n,s)=>{const{width:r,height:i,maxZoom:l,panZoom:c}=e.getState(),a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:l,u=r/2-t*a,x=i/2-n*a;return c?(await c.setViewport({x:u,y:x,zoom:a},{duration:s==null?void 0:s.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:l,panZoom:c}=e.getState(),a=Lr(t,s,r,i,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={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:l}=e.getState();if(!l)return t;const{x:c,y:a}=l.getBoundingClientRect(),u={x:t.x-c,y:t.y-a},x=n.snapGrid??r,p=n.snapToGrid??i;return Dn(u,s,p,x)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),l=Pa(t,n);return{x:l.x+r,y:l.y+i}}}),[])};function su(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const l=s.get(i.id);l?l.push(i):s.set(i.id,[i])}for(const i of t){const l=s.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...i};for(const a of l)W5(a,c);n.push(c)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function W5(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 ou(e,t){return su(e,t)}function ru(e,t){return su(e,t)}function Nt(e,t){return{id:e,type:"select",selected:t}}function Wt(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const l=t.has(r);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),s.push(Nt(i.id,l)))}return s}function Qi({items:e=[],lookup:t}){var r;const n=[],s=new Map(e.map(i=>[i.id,i]));for(const[i,l]of e.entries()){const c=t.get(l.id),a=((r=c==null?void 0:c.internals)==null?void 0:r.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:i})}for(const[i]of t)s.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function el(e){return{id:e.id,type:"remove"}}const tl=e=>v3(e),K5=e=>ba(e);function iu(e){return g.forwardRef(e)}const q5=typeof window<"u"?g.useLayoutEffect:g.useEffect;function nl(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>X5(()=>n(r=>r+BigInt(1))));return q5(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function X5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const lu=g.createContext(null);function U5({children:e}){const t=Le(),n=g.useCallback(c=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:x,onNodesChange:p,nodeLookup:m}=t.getState();let f=a;for(const h of c)f=typeof h=="function"?h(f):h;x?u(f):p&&p(Qi({items:f,lookup:m}))},[]),s=nl(n),r=g.useCallback(c=>{const{edges:a=[],setEdges:u,hasDefaultEdges:x,onEdgesChange:p,edgeLookup:m}=t.getState();let f=a;for(const h of c)f=typeof h=="function"?h(f):h;x?u(f):p&&p(Qi({items:f,lookup:m}))},[]),i=nl(r),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsxRuntimeExports.jsx(lu.Provider,{value:l,children:e})}function J5(){const e=g.useContext(lu);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Q5=e=>!!e.panZoom;function Ft(){const e=Y5(),t=Le(),n=J5(),s=Se(Q5),r=g.useMemo(()=>{const i=p=>t.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},a=p=>{var R,w;const{nodeLookup:m,nodeOrigin:f}=t.getState(),h=tl(p)?p:m.get(p.id),j=h.parentId?Na(h.position,h.measured,h.parentId,m,f):h.position,S={...h,position:j,width:((R=h.measured)==null?void 0:R.width)??h.width,height:((w=h.measured)==null?void 0:w.height)??h.height};return nn(S)},u=(p,m,f={replace:!1})=>{l(h=>h.map(j=>{if(j.id===p){const S=typeof m=="function"?m(j):m;return f.replace&&tl(S)?S:{...j,...S}}return j}))},x=(p,m,f={replace:!1})=>{c(h=>h.map(j=>{if(j.id===p){const S=typeof m=="function"?m(j):m;return f.replace&&K5(S)?S:{...j,...S}}return j}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var m;return(m=i(p))==null?void 0:m.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(m=>({...m}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:l,setEdges:c,addNodes:p=>{const m=Array.isArray(p)?p:[p];n.nodeQueue.push(f=>[...f,...m])},addEdges:p=>{const m=Array.isArray(p)?p:[p];n.edgeQueue.push(f=>[...f,...m])},toObject:()=>{const{nodes:p=[],edges:m=[],transform:f}=t.getState(),[h,j,S]=f;return{nodes:p.map(R=>({...R})),edges:m.map(R=>({...R})),viewport:{x:h,y:j,zoom:S}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:f,edges:h,onNodesDelete:j,onEdgesDelete:S,triggerNodeChanges:R,triggerEdgeChanges:w,onDelete:E,onBeforeDelete:C}=t.getState(),{nodes:P,edges:N}=await _3({nodesToRemove:p,edgesToRemove:m,nodes:f,edges:h,onBeforeDelete:C}),_=N.length>0,$=P.length>0;if(_){const D=N.map(el);S==null||S(N),w(D)}if($){const D=P.map(el);j==null||j(P),R(D)}return($||_)&&(E==null||E({nodes:P,edges:N})),{deletedNodes:P,deletedEdges:N}},getIntersectingNodes:(p,m=!0,f)=>{const h=vi(p),j=h?p:a(p),S=f!==void 0;return j?(f||t.getState().nodes).filter(R=>{const w=t.getState().nodeLookup.get(R.id);if(w&&!h&&(R.id===p.id||!w.internals.positionAbsolute))return!1;const E=nn(S?R:w),C=Mn(E,j);return m&&C>0||C>=j.width*j.height}):[]},isNodeIntersecting:(p,m,f=!0)=>{const j=vi(p)?p:a(p);if(!j)return!1;const S=Mn(j,m);return f&&S>0||S>=j.width*j.height},updateNode:u,updateNodeData:(p,m,f={replace:!1})=>{u(p,h=>{const j=typeof m=="function"?m(h):m;return f.replace?{...h,data:j}:{...h,data:{...h.data,...j}}},f)},updateEdge:x,updateEdgeData:(p,m,f={replace:!1})=>{x(p,h=>{const j=typeof m=="function"?m(h):m;return f.replace?{...h,data:j}:{...h,data:{...h.data,...j}}},f)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:f}=t.getState();return k3(p,{nodeLookup:m,nodeOrigin:f})},getHandleConnections:({type:p,id:m,nodeId:f})=>{var h;return Array.from(((h=t.getState().connectionLookup.get(`${f}-${p}${m?`-${m}`:""}`))==null?void 0:h.values())??[])},getNodeConnections:({type:p,handleId:m,nodeId:f})=>{var h;return Array.from(((h=t.getState().connectionLookup.get(`${f}${p?m?`-${p}-${m}`:`-${p}`:""}`))==null?void 0:h.values())??[])}}},[]);return g.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const sl=e=>e.selected,eE={actInsideInputWithModifier:!1},tE=typeof window<"u"?window:void 0;function nE({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Le(),{deleteElements:s}=Ft(),r=Pn(e,eE),i=Pn(t,{target:tE});g.useEffect(()=>{if(r){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(sl),edges:l.filter(sl)}),n.setState({nodesSelectionActive:!1})}},[r]),g.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function sE(e){const t=Le();g.useEffect(()=>{const n=()=>{var r,i;if(!e.current)return!1;const s=Zs(e.current);(s.height===0||s.width===0)&&((i=(r=t.getState()).onError)==null||i.call(r,"004",Oe.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 Ks={position:"absolute",width:"100%",height:"100%",top:0,left:0},oE=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function rE({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=It.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:u,minZoom:x,maxZoom:p,zoomActivationKeyCode:m,preventScrolling:f=!0,children:h,noWheelClassName:j,noPanClassName:S,onViewportChange:R,isControlledViewport:w,paneClickDistance:E}){const C=Le(),P=g.useRef(null),{userSelectionActive:N,lib:_}=Se(oE,Ae),$=Pn(m),D=g.useRef();sE(P);const B=g.useCallback(F=>{R==null||R({x:F[0],y:F[1],zoom:F[2]}),w||C.setState({transform:F})},[R,w]);return g.useEffect(()=>{if(P.current){D.current=l5({domNode:P.current,minZoom:x,maxZoom:p,translateExtent:u,viewport:a,paneClickDistance:E,onDraggingChange:y=>C.setState({paneDragging:y}),onPanZoomStart:(y,k)=>{const{onViewportChangeStart:b,onMoveStart:L}=C.getState();L==null||L(y,k),b==null||b(k)},onPanZoom:(y,k)=>{const{onViewportChange:b,onMove:L}=C.getState();L==null||L(y,k),b==null||b(k)},onPanZoomEnd:(y,k)=>{const{onViewportChangeEnd:b,onMoveEnd:L}=C.getState();L==null||L(y,k),b==null||b(k)}});const{x:F,y:O,zoom:M}=D.current.getViewport();return C.setState({panZoom:D.current,transform:[F,O,M],domNode:P.current.closest(".react-flow")}),()=>{var y;(y=D.current)==null||y.destroy()}}},[]),g.useEffect(()=>{var F;(F=D.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:$,preventScrolling:f,noPanClassName:S,userSelectionActive:N,noWheelClassName:j,lib:_,onTransformChange:B})},[e,t,n,s,r,i,l,c,$,f,S,N,j,_,B]),o.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:P,style:Ks,children:h})}const iE=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function lE(){const{userSelectionActive:e,userSelectionRect:t}=Se(iE,Ae);return e&&t?o.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 Co=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},cE=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function aE({isSelecting:e,selectionKeyPressed:t,selectionMode:n=en.Full,panOnDrag:s,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:a,onPaneScroll:u,onPaneMouseEnter:x,onPaneMouseMove:p,onPaneMouseLeave:m,children:f}){const h=Le(),{userSelectionActive:j,elementsSelectable:S,dragging:R}=Se(cE,Ae),w=S&&(e||j),E=g.useRef(null),C=g.useRef(),P=g.useRef(new Set),N=g.useRef(new Set),_=g.useRef(!1),$=g.useRef(!1),D=b=>{if(_.current){_.current=!1;return}c==null||c(b),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},B=b=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){b.preventDefault();return}a==null||a(b)},F=u?b=>u(b):void 0,O=b=>{var H,G;const{resetSelectedElements:L,domNode:A}=h.getState();if(C.current=A==null?void 0:A.getBoundingClientRect(),!S||!e||b.button!==0||b.target!==E.current||!C.current)return;(G=(H=b.target)==null?void 0:H.setPointerCapture)==null||G.call(H,b.pointerId),$.current=!0,_.current=!1;const{x:T,y:V}=ct(b.nativeEvent,C.current);L(),h.setState({userSelectionRect:{width:0,height:0,startX:T,startY:V,x:T,y:V}}),i==null||i(b)},M=b=>{const{userSelectionRect:L,transform:A,nodeLookup:T,edgeLookup:V,connectionLookup:H,triggerNodeChanges:G,triggerEdgeChanges:ee,defaultEdgeOptions:te}=h.getState();if(!C.current||!L)return;_.current=!0;const{x:ne,y:se}=ct(b.nativeEvent,C.current),{startX:J,startY:ie}=L,fe={startX:J,startY:ie,x:ne<J?ne:J,y:se<ie?se:ie,width:Math.abs(ne-J),height:Math.abs(se-ie)},Me=P.current,de=N.current;P.current=new Set(wa(T,fe,A,n===en.Partial,!0).map(re=>re.id)),N.current=new Set;const Y=(te==null?void 0:te.selectable)??!0;for(const re of P.current){const pe=H.get(re);if(pe)for(const{edgeId:Pe}of pe.values()){const $e=V.get(Pe);$e&&($e.selectable??Y)&&N.current.add(Pe)}}if(!ki(Me,P.current)){const re=Wt(T,P.current,!0);G(re)}if(!ki(de,N.current)){const re=Wt(V,N.current);ee(re)}h.setState({userSelectionRect:fe,userSelectionActive:!0,nodesSelectionActive:!1})},y=b=>{var A,T;if(b.button!==0||!$.current)return;(T=(A=b.target)==null?void 0:A.releasePointerCapture)==null||T.call(A,b.pointerId);const{userSelectionRect:L}=h.getState();!j&&L&&b.target===E.current&&(D==null||D(b)),h.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:P.current.size>0}),l==null||l(b),(t||r)&&(_.current=!1),$.current=!1},k=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxRuntimeExports.jsxs("div",{className:ze(["react-flow__pane",{draggable:k,dragging:R,selection:e}]),onClick:w?void 0:Co(D,E),onContextMenu:Co(B,E),onWheel:Co(F,E),onPointerEnter:w?void 0:x,onPointerDown:w?O:p,onPointerMove:w?M:p,onPointerUp:w?y:void 0,onPointerLeave:m,ref:E,style:Ks,children:[f,o.jsxRuntimeExports.jsx(lE,{})]})}function Ko({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:c,onError:a}=t.getState(),u=c.get(e);if(!u){a==null||a("012",Oe.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&l)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var x;return(x=s==null?void 0:s.current)==null?void 0:x.blur()})):r([e])}function cu({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:l}){const c=Le(),[a,u]=g.useState(!1),x=g.useRef();return g.useEffect(()=>{x.current=W3({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{Ko({id:p,store:c,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),g.useEffect(()=>{var p,m;if(t)(p=x.current)==null||p.destroy();else if(e.current)return(m=x.current)==null||m.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:l}),()=>{var f;(f=x.current)==null||f.destroy()}},[n,s,t,i,e,r]),a}const uE=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function au(){const e=Le();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:l,onError:c,updateNodePositions:a,nodeLookup:u,nodeOrigin:x}=e.getState(),p=new Map,m=uE(l),f=r?i[0]:5,h=r?i[1]:5,j=n.direction.x*f*n.factor,S=n.direction.y*h*n.factor;for(const[,R]of u){if(!m(R))continue;let w={x:R.internals.positionAbsolute.x+j,y:R.internals.positionAbsolute.y+S};r&&(w=Hs(w,i));const{position:E,positionAbsolute:C}=va({nodeId:R.id,nextPosition:w,nodeLookup:u,nodeExtent:s,nodeOrigin:x,onError:c});R.position=E,R.internals.positionAbsolute=C,p.set(R.id,R)}a(p)},[])}const zr=g.createContext(null),dE=zr.Provider;zr.Consumer;const uu=()=>g.useContext(zr),xE=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),pE=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:l}=s,{fromHandle:c,toHandle:a,isValid:u}=l,x=(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:x,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:i===Ot.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!r,valid:x&&u}};function mE({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:l,onConnect:c,children:a,className:u,onMouseDown:x,onTouchStart:p,...m},f){var k,b;const h=l||null,j=e==="target",S=Le(),R=uu(),{connectOnClick:w,noPanClassName:E,rfId:C}=Se(xE,Ae),{connectingFrom:P,connectingTo:N,clickConnecting:_,isPossibleEndHandle:$,connectionInProcess:D,clickConnectionInProcess:B,valid:F}=Se(pE(R,h,e),Ae);R||(b=(k=S.getState()).onError)==null||b.call(k,"010",Oe.error010());const O=L=>{const{defaultEdgeOptions:A,onConnect:T,hasDefaultEdges:V}=S.getState(),H={...A,...L};if(V){const{edges:G,setEdges:ee}=S.getState();ee(Ba(H,G))}T==null||T(H),c==null||c(H)},M=L=>{if(!R)return;const A=Aa(L.nativeEvent);if(r&&(A&&L.button===0||!A)){const T=S.getState();Wo.onPointerDown(L.nativeEvent,{autoPanOnConnect:T.autoPanOnConnect,connectionMode:T.connectionMode,connectionRadius:T.connectionRadius,domNode:T.domNode,nodeLookup:T.nodeLookup,lib:T.lib,isTarget:j,handleId:h,nodeId:R,flowId:T.rfId,panBy:T.panBy,cancelConnection:T.cancelConnection,onConnectStart:T.onConnectStart,onConnectEnd:T.onConnectEnd,updateConnection:T.updateConnection,onConnect:O,isValidConnection:n||T.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:T.autoPanSpeed})}A?x==null||x(L):p==null||p(L)},y=L=>{const{onClickConnectStart:A,onClickConnectEnd:T,connectionClickStartHandle:V,connectionMode:H,isValidConnection:G,lib:ee,rfId:te,nodeLookup:ne,connection:se}=S.getState();if(!R||!V&&!r)return;if(!V){A==null||A(L.nativeEvent,{nodeId:R,handleId:h,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:R,type:e,id:h}});return}const J=Ta(L.target),ie=n||G,{connection:fe,isValid:Me}=Wo.isValid(L.nativeEvent,{handle:{nodeId:R,id:h,type:e},connectionMode:H,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:ie,flowId:te,doc:J,lib:ee,nodeLookup:ne});Me&&fe&&O(fe);const de=structuredClone(se);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,T==null||T(L,de),S.setState({connectionClickStartHandle:null})};return o.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":R,"data-handlepos":t,"data-id":`${C}-${R}-${h}-${e}`,className:ze(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,u,{source:!j,target:j,connectable:s,connectablestart:r,connectableend:i,clickconnecting:_,connectingfrom:P,connectingto:N,valid:F,connectionindicator:s&&(!D||$)&&(D||B?i:r)}]),onMouseDown:M,onTouchStart:M,onClick:w?y:void 0,ref:f,...m,children:a})}const Ln=g.memo(iu(mE));function fE({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e==null?void 0:e.label,o.jsxRuntimeExports.jsx(Ln,{type:"source",position:n,isConnectable:t})]})}function hE({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:s=X.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ln,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsxRuntimeExports.jsx(Ln,{type:"source",position:s,isConnectable:t})]})}function gE(){return null}function jE({data:e,isConnectable:t,targetPosition:n=X.Top}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ln,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ws={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ol={input:fE,default:hE,output:jE,group:gE};function EE(e){var t,n,s,r;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??((r=e.style)==null?void 0:r.height)}}const yE=e=>{const{width:t,height:n,x:s,y:r}=$n(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xe(t)?t:null,height:Xe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function SE({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=Le(),{width:r,height:i,transformString:l,userSelectionActive:c}=Se(yE,Ae),a=au(),u=g.useRef(null);if(g.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]),cu({nodeRef:u}),c||!r||!i)return null;const x=e?m=>{const f=s.getState().nodes.filter(h=>h.selected);e(m,f)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(ws,m.key)&&(m.preventDefault(),a({direction:ws[m.key],factor:m.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:ze(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:o.jsxRuntimeExports.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:r,height:i}})})}const rl=typeof window<"u"?window:void 0,RE=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function du({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:x,selectionMode:p,onSelectionStart:m,onSelectionEnd:f,multiSelectionKeyCode:h,panActivationKeyCode:j,zoomActivationKeyCode:S,elementsSelectable:R,zoomOnScroll:w,zoomOnPinch:E,panOnScroll:C,panOnScrollSpeed:P,panOnScrollMode:N,zoomOnDoubleClick:_,panOnDrag:$,defaultViewport:D,translateExtent:B,minZoom:F,maxZoom:O,preventScrolling:M,onSelectionContextMenu:y,noWheelClassName:k,noPanClassName:b,disableKeyboardA11y:L,onViewportChange:A,isControlledViewport:T}){const{nodesSelectionActive:V,userSelectionActive:H}=Se(RE),G=Pn(u,{target:rl}),ee=Pn(j,{target:rl}),te=ee||$,ne=ee||C,se=x&&te!==!0,J=G||H||se;return nE({deleteKeyCode:a,multiSelectionKeyCode:h}),o.jsxRuntimeExports.jsx(rE,{onPaneContextMenu:i,elementsSelectable:R,zoomOnScroll:w,zoomOnPinch:E,panOnScroll:ne,panOnScrollSpeed:P,panOnScrollMode:N,zoomOnDoubleClick:_,panOnDrag:!G&&te,defaultViewport:D,translateExtent:B,minZoom:F,maxZoom:O,zoomActivationKeyCode:S,preventScrolling:M,noWheelClassName:k,noPanClassName:b,onViewportChange:A,isControlledViewport:T,paneClickDistance:c,children:o.jsxRuntimeExports.jsxs(aE,{onSelectionStart:m,onSelectionEnd:f,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:te,isSelecting:!!J,selectionMode:p,selectionKeyPressed:G,selectionOnDrag:se,children:[e,V&&o.jsxRuntimeExports.jsx(SE,{onSelectionContextMenu:y,noPanClassName:b,disableKeyboardA11y:L})]})})}du.displayName="FlowRenderer";const CE=g.memo(du),bE=e=>t=>e?wa(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 wE(e){return Se(g.useCallback(bE(e),[e]),Ae)}const vE=e=>e.updateNodeInternals;function kE(){const e=Se(vE),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function ME({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=Le(),i=g.useRef(null),l=g.useRef(null),c=g.useRef(e.sourcePosition),a=g.useRef(e.targetPosition),u=g.useRef(t),x=n&&!!e.internals.handleBounds;return g.useEffect(()=>{i.current&&!e.hidden&&(!x||l.current!==i.current)&&(l.current&&(s==null||s.unobserve(l.current)),s==null||s.observe(i.current),l.current=i.current)},[x,e.hidden]),g.useEffect(()=>()=>{l.current&&(s==null||s.unobserve(l.current),l.current=null)},[]),g.useEffect(()=>{if(i.current){const p=u.current!==t,m=c.current!==e.sourcePosition,f=a.current!==e.targetPosition;(p||m||f)&&(u.current=t,c.current=e.sourcePosition,a.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function _E({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:l,nodesDraggable:c,elementsSelectable:a,nodesConnectable:u,nodesFocusable:x,resizeObserver:p,noDragClassName:m,noPanClassName:f,disableKeyboardA11y:h,rfId:j,nodeTypes:S,nodeClickDistance:R,onError:w}){const{node:E,internals:C,isParent:P}=Se(J=>{const ie=J.nodeLookup.get(e),fe=J.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:fe}},Ae);let N=E.type||"default",_=(S==null?void 0:S[N])||ol[N];_===void 0&&(w==null||w("003",Oe.error003(N)),N="default",_=ol.default);const $=!!(E.draggable||c&&typeof E.draggable>"u"),D=!!(E.selectable||a&&typeof E.selectable>"u"),B=!!(E.connectable||u&&typeof E.connectable>"u"),F=!!(E.focusable||x&&typeof E.focusable>"u"),O=Le(),M=La(E),y=ME({node:E,nodeType:N,hasDimensions:M,resizeObserver:p}),k=cu({nodeRef:y,disabled:E.hidden||!$,noDragClassName:m,handleSelector:E.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:R}),b=au();if(E.hidden)return null;const L=mt(E),A=EE(E),T=D||$||t||n||s||r,V=n?J=>n(J,{...C.userNode}):void 0,H=s?J=>s(J,{...C.userNode}):void 0,G=r?J=>r(J,{...C.userNode}):void 0,ee=i?J=>i(J,{...C.userNode}):void 0,te=l?J=>l(J,{...C.userNode}):void 0,ne=J=>{const{selectNodesOnDrag:ie,nodeDragThreshold:fe}=O.getState();D&&(!ie||!$||fe>0)&&Ko({id:e,store:O,nodeRef:y}),t&&t(J,{...C.userNode})},se=J=>{if(!(Ho(J.nativeEvent)||h))if(Sa.includes(J.key)&&D){const ie=J.key==="Escape";Ko({id:e,store:O,unselect:ie,nodeRef:y})}else $&&E.selected&&Object.prototype.hasOwnProperty.call(ws,J.key)&&(J.preventDefault(),O.setState({ariaLiveMessage:`Moved selected node ${J.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~C.positionAbsolute.x}, y: ${~~C.positionAbsolute.y}`}),b({direction:ws[J.key],factor:J.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:ze(["react-flow__node",`react-flow__node-${N}`,{[f]:$},E.className,{selected:E.selected,selectable:D,parent:P,draggable:$,dragging:k}]),ref:y,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:T?"all":"none",visibility:M?"visible":"hidden",...E.style,...A},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:V,onMouseMove:H,onMouseLeave:G,onContextMenu:ee,onClick:ne,onDoubleClick:te,onKeyDown:F?se:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":h?void 0:`${eu}-${j}`,"aria-label":E.ariaLabel,children:o.jsxRuntimeExports.jsx(dE,{value:e,children:o.jsxRuntimeExports.jsx(_,{id:e,data:E.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:E.selected??!1,selectable:D,draggable:$,deletable:E.deletable??!0,isConnectable:B,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:k,dragHandle:E.dragHandle,zIndex:C.z,parentId:E.parentId,...L})})})}const PE=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function xu(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=Se(PE,Ae),l=wE(e.onlyRenderVisibleElements),c=kE();return o.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ks,children:l.map(a=>o.jsxRuntimeExports.jsx(_E,{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:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}xu.displayName="NodeRenderer";const LE=g.memo(xu);function NE(e){return Se(g.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);i&&l&&N3({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),Ae)}const TE=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),AE=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),il={[Ss.Arrow]:TE,[Ss.ArrowClosed]:AE};function IE(e){const t=Le();return g.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call(il,e)?il[e]:((i=(r=t.getState()).onError)==null||i.call(r,"009",Oe.error009(e)),null)},[e])}const zE=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const a=IE(t);return a?o.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:c,refX:"0",refY:"0",children:o.jsxRuntimeExports.jsx(a,{color:n,strokeWidth:l})}):null},pu=({defaultColor:e,rfId:t})=>{const n=Se(i=>i.edges),s=Se(i=>i.defaultEdgeOptions),r=g.useMemo(()=>B3(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return r.length?o.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker",children:o.jsxRuntimeExports.jsx("defs",{children:r.map(i=>o.jsxRuntimeExports.jsx(zE,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};pu.displayName="MarkerDefinitions";var $E=g.memo(pu);function mu({x:e,y:t,label:n,labelStyle:s={},labelShowBg:r=!0,labelBgStyle:i={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:a,className:u,...x}){const[p,m]=g.useState({x:1,y:0,width:0,height:0}),f=ze(["react-flow__edge-textwrapper",u]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const j=h.current.getBBox();m({x:j.x,y:j.y,width:j.width,height:j.height})}},[n]),typeof n>"u"||!n?null:o.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:f,visibility:p.width?"visible":"hidden",...x,children:[r&&o.jsxRuntimeExports.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:c,ry:c}),o.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:h,style:s,children:n}),a]})}mu.displayName="EdgeText";const DE=g.memo(mu);function Ue({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a,interactionWidth:u=20,...x}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{...x,d:e,fill:"none",className:ze(["react-flow__edge-path",x.className])}),u&&o.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}),s&&Xe(t)&&Xe(n)?o.jsxRuntimeExports.jsx(DE,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a}):null]})}function ll({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===X.Left||e===X.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function fu({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top}){const[l,c]=ll({pos:n,x1:e,y1:t,x2:s,y2:r}),[a,u]=ll({pos:i,x1:s,y1:r,x2:e,y2:t}),[x,p,m,f]=Ia({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:a,targetControlY:u});return[`M${e},${t} C${l},${c} ${a},${u} ${s},${r}`,x,p,m,f]}function hu(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=X.Bottom,targetPosition:c=X.Top,label:a,labelStyle:u,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:S,interactionWidth:R})=>{const[w,E,C]=fu({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:c}),P=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:P,path:w,labelX:E,labelY:C,label:a,labelStyle:u,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:S,interactionWidth:R})})}const BE=hu({isInternal:!1}),gu=hu({isInternal:!0});BE.displayName="SimpleBezierEdge";gu.displayName="SimpleBezierEdgeInternal";function ju(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:x,labelBgBorderRadius:p,style:m,sourcePosition:f=X.Bottom,targetPosition:h=X.Top,markerEnd:j,markerStart:S,pathOptions:R,interactionWidth:w})=>{const[E,C,P]=Zo({sourceX:n,sourceY:s,sourcePosition:f,targetX:r,targetY:i,targetPosition:h,borderRadius:R==null?void 0:R.borderRadius,offset:R==null?void 0:R.offset}),N=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:N,path:E,labelX:C,labelY:P,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:j,markerStart:S,interactionWidth:w})})}const Eu=ju({isInternal:!1}),yu=ju({isInternal:!0});Eu.displayName="SmoothStepEdge";yu.displayName="SmoothStepEdgeInternal";function Su(e){return g.memo(({id:t,...n})=>{var r;const s=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Eu,{...n,id:s,pathOptions:g.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const OE=Su({isInternal:!1}),Ru=Su({isInternal:!0});OE.displayName="StepEdge";Ru.displayName="StepEdgeInternal";function Cu(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:f,markerStart:h,interactionWidth:j})=>{const[S,R,w]=Oa({sourceX:n,sourceY:s,targetX:r,targetY:i}),E=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:E,path:S,labelX:R,labelY:w,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:f,markerStart:h,interactionWidth:j})})}const VE=Cu({isInternal:!1}),bu=Cu({isInternal:!0});VE.displayName="StraightEdge";bu.displayName="StraightEdgeInternal";function wu(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=X.Bottom,targetPosition:c=X.Top,label:a,labelStyle:u,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:S,pathOptions:R,interactionWidth:w})=>{const[E,C,P]=za({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:c,curvature:R==null?void 0:R.curvature}),N=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:N,path:E,labelX:C,labelY:P,label:a,labelStyle:u,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:S,interactionWidth:w})})}const FE=wu({isInternal:!1}),vu=wu({isInternal:!0});FE.displayName="BezierEdge";vu.displayName="BezierEdgeInternal";const cl={default:vu,straight:bu,step:Ru,smoothstep:yu,simplebezier:gu},al={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},HE=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,ZE=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,ul="react-flow__edgeupdater";function dl({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:l,type:c}){return o.jsxRuntimeExports.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:l,className:ze([ul,`${ul}-${c}`]),cx:HE(t,s,e),cy:ZE(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function GE({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:l,sourcePosition:c,targetPosition:a,onReconnect:u,onReconnectStart:x,onReconnectEnd:p,setReconnecting:m,setUpdateHover:f}){const h=Le(),j=(C,P)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:_,isValidConnection:$,connectionMode:D,connectionRadius:B,lib:F,onConnectStart:O,onConnectEnd:M,cancelConnection:y,nodeLookup:k,rfId:b,panBy:L,updateConnection:A}=h.getState(),T=P.type==="target";m(!0),x==null||x(C,n,P.type);const V=(G,ee)=>{m(!1),p==null||p(G,n,P.type,ee)},H=G=>u==null?void 0:u(n,G);Wo.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:D,connectionRadius:B,domNode:_,handleId:P.id,nodeId:P.nodeId,nodeLookup:k,isTarget:T,edgeUpdaterType:P.type,lib:F,flowId:b,cancelConnection:y,panBy:L,isValidConnection:$,onConnect:H,onConnectStart:O,onConnectEnd:M,onReconnectEnd:V,updateConnection:A,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle})},S=C=>j(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),R=C=>j(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>f(!0),E=()=>f(!1);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&o.jsxRuntimeExports.jsx(dl,{position:c,centerX:s,centerY:r,radius:t,onMouseDown:S,onMouseEnter:w,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&o.jsxRuntimeExports.jsx(dl,{position:a,centerX:i,centerY:l,radius:t,onMouseDown:R,onMouseEnter:w,onMouseOut:E,type:"target"})]})}function YE({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:u,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:f,rfId:h,edgeTypes:j,noPanClassName:S,onError:R,disableKeyboardA11y:w}){let E=Se(Y=>Y.edgeLookup.get(e));const C=Se(Y=>Y.defaultEdgeOptions);E=C?{...C,...E}:E;let P=E.type||"default",N=(j==null?void 0:j[P])||cl[P];N===void 0&&(R==null||R("011",Oe.error011(P)),P="default",N=cl.default);const _=!!(E.focusable||t&&typeof E.focusable>"u"),$=typeof p<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),D=!!(E.selectable||s&&typeof E.selectable>"u"),B=g.useRef(null),[F,O]=g.useState(!1),[M,y]=g.useState(!1),k=Le(),{zIndex:b,sourceX:L,sourceY:A,targetX:T,targetY:V,sourcePosition:H,targetPosition:G}=Se(g.useCallback(Y=>{const re=Y.nodeLookup.get(E.source),pe=Y.nodeLookup.get(E.target);if(!re||!pe)return{zIndex:E.zIndex,...al};const Pe=D3({id:e,sourceNode:re,targetNode:pe,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:Y.connectionMode,onError:R});return{zIndex:L3({selected:E.selected,zIndex:E.zIndex,sourceNode:re,targetNode:pe,elevateOnSelect:Y.elevateEdgesOnSelect}),...Pe||al}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),Ae),ee=g.useMemo(()=>E.markerStart?`url('#${Go(E.markerStart,h)}')`:void 0,[E.markerStart,h]),te=g.useMemo(()=>E.markerEnd?`url('#${Go(E.markerEnd,h)}')`:void 0,[E.markerEnd,h]);if(E.hidden||L===null||A===null||T===null||V===null)return null;const ne=Y=>{var $e;const{addSelectedEdges:re,unselectNodesAndEdges:pe,multiSelectionActive:Pe}=k.getState();D&&(k.setState({nodesSelectionActive:!1}),E.selected&&Pe?(pe({nodes:[],edges:[E]}),($e=B.current)==null||$e.blur()):re([e])),r&&r(Y,E)},se=i?Y=>{i(Y,{...E})}:void 0,J=l?Y=>{l(Y,{...E})}:void 0,ie=c?Y=>{c(Y,{...E})}:void 0,fe=a?Y=>{a(Y,{...E})}:void 0,Me=u?Y=>{u(Y,{...E})}:void 0,de=Y=>{var re;if(!w&&Sa.includes(Y.key)&&D){const{unselectNodesAndEdges:pe,addSelectedEdges:Pe}=k.getState();Y.key==="Escape"?((re=B.current)==null||re.blur(),pe({edges:[E]})):Pe([e])}};return o.jsxRuntimeExports.jsx("svg",{style:{zIndex:b},children:o.jsxRuntimeExports.jsxs("g",{className:ze(["react-flow__edge",`react-flow__edge-${P}`,E.className,S,{selected:E.selected,animated:E.animated,inactive:!D&&!r,updating:F,selectable:D}]),onClick:ne,onDoubleClick:se,onContextMenu:J,onMouseEnter:ie,onMouseMove:fe,onMouseLeave:Me,onKeyDown:_?de:void 0,tabIndex:_?0:void 0,role:_?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":_?`${tu}-${h}`:void 0,ref:B,children:[!M&&o.jsxRuntimeExports.jsx(N,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:D,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:L,sourceY:A,targetX:T,targetY:V,sourcePosition:H,targetPosition:G,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:ee,markerEnd:te,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),$&&o.jsxRuntimeExports.jsx(GE,{edge:E,isReconnectable:$,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:f,sourceX:L,sourceY:A,targetX:T,targetY:V,sourcePosition:H,targetPosition:G,setUpdateHover:O,setReconnecting:y})]})})}const WE=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ku({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:x,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:f,onReconnectEnd:h,disableKeyboardA11y:j}){const{edgesFocusable:S,edgesReconnectable:R,elementsSelectable:w,onError:E}=Se(WE,Ae),C=NE(t);return o.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[o.jsxRuntimeExports.jsx($E,{defaultColor:e,rfId:n}),C.map(P=>o.jsxRuntimeExports.jsx(YE,{id:P,edgesFocusable:S,edgesReconnectable:R,elementsSelectable:w,noPanClassName:r,onReconnect:i,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:u,onClick:x,reconnectRadius:p,onDoubleClick:m,onReconnectStart:f,onReconnectEnd:h,rfId:n,onError:E,edgeTypes:s,disableKeyboardA11y:j},P))]})}ku.displayName="EdgeRenderer";const KE=g.memo(ku),qE=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function XE({children:e}){const t=Se(qE);return o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function UE(e){const t=Ft(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const JE=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function QE(e){const t=Se(JE),n=Le();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function ey(e){return e.connection.inProgress?{...e.connection,to:Dn(e.connection.to,e.transform)}:{...e.connection}}function ty(e){return ey}function ny(e){const t=ty();return Se(t,Ae)}const sy=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function oy({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:l,isValid:c,inProgress:a}=Se(sy,Ae);return!(i&&r&&a)?null:o.jsxRuntimeExports.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:o.jsxRuntimeExports.jsx("g",{className:ze(["react-flow__connection",Ca(c)]),children:o.jsxRuntimeExports.jsx(Mu,{style:t,type:n,CustomComponent:s,isValid:c})})})}const Mu=({style:e,type:t=jt.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:l,fromHandle:c,fromPosition:a,to:u,toNode:x,toHandle:p,toPosition:m}=ny();if(!r)return;if(n)return o.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:m,connectionStatus:Ca(s),toNode:x,toHandle:p});let f="";const h={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:m};switch(t){case jt.Bezier:[f]=za(h);break;case jt.SimpleBezier:[f]=fu(h);break;case jt.Step:[f]=Zo({...h,borderRadius:0});break;case jt.SmoothStep:[f]=Zo(h);break;default:[f]=Oa(h)}return o.jsxRuntimeExports.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:e})};Mu.displayName="ConnectionLine";const ry={};function xl(e=ry){const t=g.useRef(e),n=Le();g.useEffect(()=>{var s,r;if(process.env.NODE_ENV==="development"){const i=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const l of i)if(t.current[l]!==e[l]){(r=(s=n.getState()).onError)==null||r.call(s,"002",Oe.error002());break}t.current=e}},[e])}function iy(){const e=Le(),t=g.useRef(!1);g.useEffect(()=>{var n,s;if(process.env.NODE_ENV==="development"&&!t.current){const r=document.querySelector(".react-flow__pane");r&&window.getComputedStyle(r).zIndex!=="1"&&((s=(n=e.getState()).onError)==null||s.call(n,"013",Oe.error013("react"))),t.current=!0}},[])}function _u({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:x,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:f,connectionLineType:h,connectionLineStyle:j,connectionLineComponent:S,connectionLineContainerStyle:R,selectionKeyCode:w,selectionOnDrag:E,selectionMode:C,multiSelectionKeyCode:P,panActivationKeyCode:N,zoomActivationKeyCode:_,deleteKeyCode:$,onlyRenderVisibleElements:D,elementsSelectable:B,defaultViewport:F,translateExtent:O,minZoom:M,maxZoom:y,preventScrolling:k,defaultMarkerColor:b,zoomOnScroll:L,zoomOnPinch:A,panOnScroll:T,panOnScrollSpeed:V,panOnScrollMode:H,zoomOnDoubleClick:G,panOnDrag:ee,onPaneClick:te,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:J,onPaneScroll:ie,onPaneContextMenu:fe,paneClickDistance:Me,nodeClickDistance:de,onEdgeContextMenu:Y,onEdgeMouseEnter:re,onEdgeMouseMove:pe,onEdgeMouseLeave:Pe,reconnectRadius:$e,onReconnect:Qs,onReconnectStart:eo,onReconnectEnd:to,noDragClassName:an,noWheelClassName:no,noPanClassName:un,disableKeyboardA11y:dn,nodeExtent:so,rfId:xn,viewport:pn,onViewportChange:On}){return xl(e),xl(t),iy(),UE(n),QE(pn),o.jsxRuntimeExports.jsx(CE,{onPaneClick:te,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:J,onPaneContextMenu:fe,onPaneScroll:ie,paneClickDistance:Me,deleteKeyCode:$,selectionKeyCode:w,selectionOnDrag:E,selectionMode:C,onSelectionStart:m,onSelectionEnd:f,multiSelectionKeyCode:P,panActivationKeyCode:N,zoomActivationKeyCode:_,elementsSelectable:B,zoomOnScroll:L,zoomOnPinch:A,zoomOnDoubleClick:G,panOnScroll:T,panOnScrollSpeed:V,panOnScrollMode:H,panOnDrag:ee,defaultViewport:F,translateExtent:O,minZoom:M,maxZoom:y,onSelectionContextMenu:p,preventScrolling:k,noDragClassName:an,noWheelClassName:no,noPanClassName:un,disableKeyboardA11y:dn,onViewportChange:On,isControlledViewport:!!pn,children:o.jsxRuntimeExports.jsxs(XE,{children:[o.jsxRuntimeExports.jsx(KE,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:Qs,onReconnectStart:eo,onReconnectEnd:to,onlyRenderVisibleElements:D,onEdgeContextMenu:Y,onEdgeMouseEnter:re,onEdgeMouseMove:pe,onEdgeMouseLeave:Pe,reconnectRadius:$e,defaultMarkerColor:b,noPanClassName:un,disableKeyboardA11y:dn,rfId:xn}),o.jsxRuntimeExports.jsx(oy,{style:j,type:h,component:S,containerStyle:R}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsxRuntimeExports.jsx(LE,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:x,nodeClickDistance:de,onlyRenderVisibleElements:D,noPanClassName:un,noDragClassName:an,disableKeyboardA11y:dn,nodeExtent:so,rfId:xn}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}_u.displayName="GraphView";const ly=g.memo(_u),pl=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a}={})=>{const u=new Map,x=new Map,p=new Map,m=new Map,f=s??t??[],h=n??e??[],j=c??[0,0],S=a??kn;Fa(p,m,f),Yo(h,u,x,{nodeOrigin:j,nodeExtent:S,elevateNodesOnSelect:!1});let R=[0,0,1];if(l&&r&&i){const w=$n(u,{filter:N=>!!((N.width||N.initialWidth)&&(N.height||N.initialHeight))}),{x:E,y:C,zoom:P}=Lr(w,r,i,.5,2,.1);R=[E,C,P]}return{rfId:"1",width:0,height:0,transform:R,nodes:h,nodeLookup:u,parentLookup:x,edges:f,edgeLookup:m,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:kn,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ot.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:j,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:{...Ra},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:Cs,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},cy=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a})=>k5((u,x)=>({...pl({nodes:e,edges:t,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a,defaultNodes:n,defaultEdges:s}),setNodes:p=>{const{nodeLookup:m,parentLookup:f,nodeOrigin:h,elevateNodesOnSelect:j}=x();Yo(p,m,f,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:j,checkEquality:!0}),u({nodes:p})},setEdges:p=>{const{connectionLookup:m,edgeLookup:f}=x();Fa(m,f,p),u({edges:p})},setDefaultNodesAndEdges:(p,m)=>{if(p){const{setNodes:f}=x();f(p),u({hasDefaultNodes:!0})}if(m){const{setEdges:f}=x();f(m),u({hasDefaultEdges:!0})}},updateNodeInternals:(p,m={triggerFitView:!0})=>{const{triggerNodeChanges:f,nodeLookup:h,parentLookup:j,fitViewOnInit:S,fitViewDone:R,fitViewOnInitOptions:w,domNode:E,nodeOrigin:C,nodeExtent:P,debug:N,fitViewSync:_}=x(),{changes:$,updatedInternals:D}=Z3(p,h,j,E,C,P);if(D){if(V3(h,j,{nodeOrigin:C,nodeExtent:P}),m.triggerFitView){let B=R;!R&&S&&(B=_({...w,nodes:w==null?void 0:w.nodes})),u({fitViewDone:B})}else u({});($==null?void 0:$.length)>0&&(N&&console.log("React Flow: trigger node changes",$),f==null||f($))}},updateNodePositions:(p,m=!1)=>{const f=[],h=[],{nodeLookup:j,triggerNodeChanges:S}=x();for(const[R,w]of p){const E=j.get(R),C=!!(E!=null&&E.expandParent&&(E!=null&&E.parentId)&&(w!=null&&w.position)),P={id:R,type:"position",position:C?{x:Math.max(0,w.position.x),y:Math.max(0,w.position.y)}:w.position,dragging:m};C&&E.parentId&&f.push({id:R,parentId:E.parentId,rect:{...w.internals.positionAbsolute,width:w.measured.width??0,height:w.measured.height??0}}),h.push(P)}if(f.length>0){const{parentLookup:R,nodeOrigin:w}=x(),E=Ir(f,j,R,w);h.push(...E)}S(h)},triggerNodeChanges:p=>{const{onNodesChange:m,setNodes:f,nodes:h,hasDefaultNodes:j,debug:S}=x();if(p!=null&&p.length){if(j){const R=ou(p,h);f(R)}S&&console.log("React Flow: trigger node changes",p),m==null||m(p)}},triggerEdgeChanges:p=>{const{onEdgesChange:m,setEdges:f,edges:h,hasDefaultEdges:j,debug:S}=x();if(p!=null&&p.length){if(j){const R=ru(p,h);f(R)}S&&console.log("React Flow: trigger edge changes",p),m==null||m(p)}},addSelectedNodes:p=>{const{multiSelectionActive:m,edgeLookup:f,nodeLookup:h,triggerNodeChanges:j,triggerEdgeChanges:S}=x();if(m){const R=p.map(w=>Nt(w,!0));j(R);return}j(Wt(h,new Set([...p]),!0)),S(Wt(f))},addSelectedEdges:p=>{const{multiSelectionActive:m,edgeLookup:f,nodeLookup:h,triggerNodeChanges:j,triggerEdgeChanges:S}=x();if(m){const R=p.map(w=>Nt(w,!0));S(R);return}S(Wt(f,new Set([...p]))),j(Wt(h,new Set,!0))},unselectNodesAndEdges:({nodes:p,edges:m}={})=>{const{edges:f,nodes:h,nodeLookup:j,triggerNodeChanges:S,triggerEdgeChanges:R}=x(),w=p||h,E=m||f,C=w.map(N=>{const _=j.get(N.id);return _&&(_.selected=!1),Nt(N.id,!1)}),P=E.map(N=>Nt(N.id,!1));S(C),R(P)},setMinZoom:p=>{const{panZoom:m,maxZoom:f}=x();m==null||m.setScaleExtent([p,f]),u({minZoom:p})},setMaxZoom:p=>{const{panZoom:m,minZoom:f}=x();m==null||m.setScaleExtent([f,p]),u({maxZoom:p})},setTranslateExtent:p=>{var m;(m=x().panZoom)==null||m.setTranslateExtent(p),u({translateExtent:p})},setPaneClickDistance:p=>{var m;(m=x().panZoom)==null||m.setClickDistance(p)},resetSelectedElements:()=>{const{edges:p,nodes:m,triggerNodeChanges:f,triggerEdgeChanges:h}=x(),j=m.reduce((R,w)=>w.selected?[...R,Nt(w.id,!1)]:R,[]),S=p.reduce((R,w)=>w.selected?[...R,Nt(w.id,!1)]:R,[]);f(j),h(S)},setNodeExtent:p=>{const{nodes:m,nodeLookup:f,parentLookup:h,nodeOrigin:j,elevateNodesOnSelect:S,nodeExtent:R}=x();p[0][0]===R[0][0]&&p[0][1]===R[0][1]&&p[1][0]===R[1][0]&&p[1][1]===R[1][1]||(Yo(m,f,h,{nodeOrigin:j,nodeExtent:p,elevateNodesOnSelect:S,checkEquality:!1}),u({nodeExtent:p}))},panBy:p=>{const{transform:m,width:f,height:h,panZoom:j,translateExtent:S}=x();return G3({delta:p,panZoom:j,transform:m,translateExtent:S,width:f,height:h})},fitView:p=>{const{panZoom:m,width:f,height:h,minZoom:j,maxZoom:S,nodeLookup:R}=x();if(!m)return Promise.resolve(!1);const w=Oo(R,p);return Vo({nodes:w,width:f,height:h,panZoom:m,minZoom:j,maxZoom:S},p)},fitViewSync:p=>{const{panZoom:m,width:f,height:h,minZoom:j,maxZoom:S,nodeLookup:R}=x();if(!m)return!1;const w=Oo(R,p);return Vo({nodes:w,width:f,height:h,panZoom:m,minZoom:j,maxZoom:S},p),w.size>0},cancelConnection:()=>{u({connection:{...Ra}})},updateConnection:p=>{u({connection:p})},reset:()=>u({...pl()})}),Object.is);function Pu({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,fitView:l,nodeOrigin:c,nodeExtent:a,children:u}){const[x]=g.useState(()=>cy({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a}));return o.jsxRuntimeExports.jsx(M5,{value:x,children:o.jsxRuntimeExports.jsx(U5,{children:u})})}function ay({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:l,fitView:c,nodeOrigin:a,nodeExtent:u}){return g.useContext(Ys)?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):o.jsxRuntimeExports.jsx(Pu,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:u,children:e})}const uy={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function dy({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:l,onNodeClick:c,onEdgeClick:a,onInit:u,onMove:x,onMoveStart:p,onMoveEnd:m,onConnect:f,onConnectStart:h,onConnectEnd:j,onClickConnectStart:S,onClickConnectEnd:R,onNodeMouseEnter:w,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:P,onNodeDoubleClick:N,onNodeDragStart:_,onNodeDrag:$,onNodeDragStop:D,onNodesDelete:B,onEdgesDelete:F,onDelete:O,onSelectionChange:M,onSelectionDragStart:y,onSelectionDrag:k,onSelectionDragStop:b,onSelectionContextMenu:L,onSelectionStart:A,onSelectionEnd:T,onBeforeDelete:V,connectionMode:H,connectionLineType:G=jt.Bezier,connectionLineStyle:ee,connectionLineComponent:te,connectionLineContainerStyle:ne,deleteKeyCode:se="Backspace",selectionKeyCode:J="Shift",selectionOnDrag:ie=!1,selectionMode:fe=en.Full,panActivationKeyCode:Me="Space",multiSelectionKeyCode:de=bs()?"Meta":"Control",zoomActivationKeyCode:Y=bs()?"Meta":"Control",snapToGrid:re,snapGrid:pe,onlyRenderVisibleElements:Pe=!1,selectNodesOnDrag:$e,nodesDraggable:Qs,nodesConnectable:eo,nodesFocusable:to,nodeOrigin:an=nu,edgesFocusable:no,edgesReconnectable:un,elementsSelectable:dn=!0,defaultViewport:so=V5,minZoom:xn=.5,maxZoom:pn=2,translateExtent:On=kn,preventScrolling:cm=!0,nodeExtent:oo,defaultMarkerColor:am="#b1b1b7",zoomOnScroll:um=!0,zoomOnPinch:dm=!0,panOnScroll:xm=!1,panOnScrollSpeed:pm=.5,panOnScrollMode:mm=It.Free,zoomOnDoubleClick:fm=!0,panOnDrag:hm=!0,onPaneClick:gm,onPaneMouseEnter:jm,onPaneMouseMove:Em,onPaneMouseLeave:ym,onPaneScroll:Sm,onPaneContextMenu:Rm,paneClickDistance:Hr=0,nodeClickDistance:Cm=0,children:bm,onReconnect:wm,onReconnectStart:vm,onReconnectEnd:km,onEdgeContextMenu:Mm,onEdgeDoubleClick:_m,onEdgeMouseEnter:Pm,onEdgeMouseMove:Lm,onEdgeMouseLeave:Nm,reconnectRadius:Tm=10,onNodesChange:Am,onEdgesChange:Im,noDragClassName:zm="nodrag",noWheelClassName:$m="nowheel",noPanClassName:Zr="nopan",fitView:Gr,fitViewOptions:Dm,connectOnClick:Bm,attributionPosition:Om,proOptions:Vm,defaultEdgeOptions:Fm,elevateNodesOnSelect:Hm,elevateEdgesOnSelect:Zm,disableKeyboardA11y:Yr=!1,autoPanOnConnect:Gm,autoPanOnNodeDrag:Ym,autoPanSpeed:Wm,connectionRadius:Km,isValidConnection:qm,onError:Xm,style:Um,id:Wr,nodeDragThreshold:Jm,viewport:Qm,onViewportChange:ef,width:tf,height:nf,colorMode:sf="light",debug:of,onScroll:Vn,...rf},lf){const ro=Wr||"1",cf=G5(sf),af=g.useCallback(Kr=>{Kr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Vn==null||Vn(Kr)},[Vn]);return o.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...rf,onScroll:af,style:{...Um,...uy},ref:lf,className:ze(["react-flow",r,cf]),id:Wr,children:o.jsxRuntimeExports.jsxs(ay,{nodes:e,edges:t,width:tf,height:nf,fitView:Gr,nodeOrigin:an,nodeExtent:oo,children:[o.jsxRuntimeExports.jsx(ly,{onInit:u,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:w,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:P,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:l,connectionLineType:G,connectionLineStyle:ee,connectionLineComponent:te,connectionLineContainerStyle:ne,selectionKeyCode:J,selectionOnDrag:ie,selectionMode:fe,deleteKeyCode:se,multiSelectionKeyCode:de,panActivationKeyCode:Me,zoomActivationKeyCode:Y,onlyRenderVisibleElements:Pe,defaultViewport:so,translateExtent:On,minZoom:xn,maxZoom:pn,preventScrolling:cm,zoomOnScroll:um,zoomOnPinch:dm,zoomOnDoubleClick:fm,panOnScroll:xm,panOnScrollSpeed:pm,panOnScrollMode:mm,panOnDrag:hm,onPaneClick:gm,onPaneMouseEnter:jm,onPaneMouseMove:Em,onPaneMouseLeave:ym,onPaneScroll:Sm,onPaneContextMenu:Rm,paneClickDistance:Hr,nodeClickDistance:Cm,onSelectionContextMenu:L,onSelectionStart:A,onSelectionEnd:T,onReconnect:wm,onReconnectStart:vm,onReconnectEnd:km,onEdgeContextMenu:Mm,onEdgeDoubleClick:_m,onEdgeMouseEnter:Pm,onEdgeMouseMove:Lm,onEdgeMouseLeave:Nm,reconnectRadius:Tm,defaultMarkerColor:am,noDragClassName:zm,noWheelClassName:$m,noPanClassName:Zr,rfId:ro,disableKeyboardA11y:Yr,nodeExtent:oo,viewport:Qm,onViewportChange:ef}),o.jsxRuntimeExports.jsx(Z5,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:f,onConnectStart:h,onConnectEnd:j,onClickConnectStart:S,onClickConnectEnd:R,nodesDraggable:Qs,nodesConnectable:eo,nodesFocusable:to,edgesFocusable:no,edgesReconnectable:un,elementsSelectable:dn,elevateNodesOnSelect:Hm,elevateEdgesOnSelect:Zm,minZoom:xn,maxZoom:pn,nodeExtent:oo,onNodesChange:Am,onEdgesChange:Im,snapToGrid:re,snapGrid:pe,connectionMode:H,translateExtent:On,connectOnClick:Bm,defaultEdgeOptions:Fm,fitView:Gr,fitViewOptions:Dm,onNodesDelete:B,onEdgesDelete:F,onDelete:O,onNodeDragStart:_,onNodeDrag:$,onNodeDragStop:D,onSelectionDrag:k,onSelectionDragStart:y,onSelectionDragStop:b,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:Zr,nodeOrigin:an,rfId:ro,autoPanOnConnect:Gm,autoPanOnNodeDrag:Ym,autoPanSpeed:Wm,onError:Xm,connectionRadius:Km,isValidConnection:qm,selectNodesOnDrag:$e,nodeDragThreshold:Jm,onBeforeDelete:V,paneClickDistance:Hr,debug:of}),o.jsxRuntimeExports.jsx(O5,{onSelectionChange:M}),bm,o.jsxRuntimeExports.jsx(I5,{proOptions:Vm,position:Om}),o.jsxRuntimeExports.jsx(T5,{rfId:ro,disableKeyboardA11y:Yr})]})})}var xy=iu(dy);function py(){const e=Le();return g.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),r=Array.isArray(t)?t:[t],i=new Map;r.forEach(l=>{const c=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${l}"]`);c&&i.set(l,{id:l,nodeElement:c,force:!0})}),requestAnimationFrame(()=>s(i,{triggerFitView:!1}))},[])}function my({onStart:e,onChange:t,onEnd:n}){const s=Le();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function fy({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ze(["react-flow__background-pattern",n,s])})}function hy({radius:e,className:t}){return o.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:ze(["react-flow__background-pattern","dots",t])})}var St;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(St||(St={}));const gy={[St.Dots]:1,[St.Lines]:1,[St.Cross]:6},jy=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Lu({id:e,variant:t=St.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:l,bgColor:c,style:a,className:u,patternClassName:x}){const p=g.useRef(null),{transform:m,patternId:f}=Se(jy,Ae),h=s||gy[t],j=t===St.Dots,S=t===St.Cross,R=Array.isArray(n)?n:[n,n],w=[R[0]*m[2]||1,R[1]*m[2]||1],E=h*m[2],C=Array.isArray(i)?i:[i,i],P=S?[E,E]:w,N=[C[0]*m[2]||1+P[0]/2,C[1]*m[2]||1+P[1]/2],_=`${f}${e||""}`;return o.jsxRuntimeExports.jsxs("svg",{className:ze(["react-flow__background",u]),style:{...a,...Ks,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[o.jsxRuntimeExports.jsx("pattern",{id:_,x:m[0]%w[0],y:m[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:j?o.jsxRuntimeExports.jsx(hy,{radius:E/2,className:x}):o.jsxRuntimeExports.jsx(fy,{dimensions:P,lineWidth:r,variant:t,className:x})}),o.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}Lu.displayName="Background";const Ey=g.memo(Lu);function yy(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Sy(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Ry(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.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 Cy(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 by(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.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 Un({children:e,className:t,...n}){return o.jsxRuntimeExports.jsx("button",{type:"button",className:ze(["react-flow__controls-button",t]),...n,children:e})}const wy=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Nu({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:l,onFitView:c,onInteractiveChange:a,className:u,children:x,position:p="bottom-left",orientation:m="vertical","aria-label":f="React Flow controls"}){const h=Le(),{isInteractive:j,minZoomReached:S,maxZoomReached:R}=Se(wy,Ae),{zoomIn:w,zoomOut:E,fitView:C}=Ft(),P=()=>{w(),i==null||i()},N=()=>{E(),l==null||l()},_=()=>{C(r),c==null||c()},$=()=>{h.setState({nodesDraggable:!j,nodesConnectable:!j,elementsSelectable:!j}),a==null||a(!j)},D=m==="horizontal"?"horizontal":"vertical";return o.jsxRuntimeExports.jsxs(Ws,{className:ze(["react-flow__controls",D,u]),position:p,style:e,"data-testid":"rf__controls","aria-label":f,children:[t&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Un,{onClick:P,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:R,children:o.jsxRuntimeExports.jsx(yy,{})}),o.jsxRuntimeExports.jsx(Un,{onClick:N,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S,children:o.jsxRuntimeExports.jsx(Sy,{})})]}),n&&o.jsxRuntimeExports.jsx(Un,{className:"react-flow__controls-fitview",onClick:_,title:"fit view","aria-label":"fit view",children:o.jsxRuntimeExports.jsx(Ry,{})}),s&&o.jsxRuntimeExports.jsx(Un,{className:"react-flow__controls-interactive",onClick:$,title:"toggle interactivity","aria-label":"toggle interactivity",children:j?o.jsxRuntimeExports.jsx(by,{}):o.jsxRuntimeExports.jsx(Cy,{})}),x]})}Nu.displayName="Controls";g.memo(Nu);function vy({id:e,x:t,y:n,width:s,height:r,style:i,color:l,strokeColor:c,strokeWidth:a,className:u,borderRadius:x,shapeRendering:p,selected:m,onClick:f}){const{background:h,backgroundColor:j}=i||{},S=l||h||j;return o.jsxRuntimeExports.jsx("rect",{className:ze(["react-flow__minimap-node",{selected:m},u]),x:t,y:n,rx:x,ry:x,width:s,height:r,style:{fill:S,stroke:c,strokeWidth:a},shapeRendering:p,onClick:f?R=>f(R,e):void 0})}const ky=g.memo(vy),My=e=>e.nodes.map(t=>t.id),bo=e=>e instanceof Function?e:()=>e;function _y({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=ky,onClick:l}){const c=Se(My,Ae),a=bo(t),u=bo(e),x=bo(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:c.map(m=>o.jsxRuntimeExports.jsx(Ly,{id:m,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function Py({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:c,onClick:a}){const{node:u,x,y:p,width:m,height:f}=Se(h=>{const j=h.nodeLookup.get(e),{x:S,y:R}=j.internals.positionAbsolute,{width:w,height:E}=mt(j);return{node:j,x:S,y:R,width:w,height:E}},Ae);return!u||u.hidden||!La(u)?null:o.jsxRuntimeExports.jsx(c,{x,y:p,width:m,height:f,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:i,shapeRendering:l,onClick:a,id:u.id})}const Ly=g.memo(Py);var Ny=g.memo(_y);const Ty=200,Ay=150,Iy=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?_a($n(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},zy="react-flow__minimap-desc";function Tu({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:a,maskColor:u,maskStrokeColor:x,maskStrokeWidth:p,position:m="bottom-right",onClick:f,onNodeClick:h,pannable:j=!1,zoomable:S=!1,ariaLabel:R="React Flow mini map",inversePan:w,zoomStep:E=10,offsetScale:C=5}){const P=Le(),N=g.useRef(null),{boundingRect:_,viewBB:$,rfId:D,panZoom:B,translateExtent:F,flowWidth:O,flowHeight:M}=Se(Iy,Ae),y=(e==null?void 0:e.width)??Ty,k=(e==null?void 0:e.height)??Ay,b=_.width/y,L=_.height/k,A=Math.max(b,L),T=A*y,V=A*k,H=C*A,G=_.x-(T-_.width)/2-H,ee=_.y-(V-_.height)/2-H,te=T+H*2,ne=V+H*2,se=`${zy}-${D}`,J=g.useRef(0),ie=g.useRef();J.current=A,g.useEffect(()=>{if(N.current&&B)return ie.current=Q3({domNode:N.current,panZoom:B,getTransform:()=>P.getState().transform,getViewScale:()=>J.current}),()=>{var de;(de=ie.current)==null||de.destroy()}},[B]),g.useEffect(()=>{var de;(de=ie.current)==null||de.update({translateExtent:F,width:O,height:M,inversePan:w,pannable:j,zoomStep:E,zoomable:S})},[j,S,w,E,F,O,M]);const fe=f?de=>{var pe;const[Y,re]=((pe=ie.current)==null?void 0:pe.pointer(de))||[0,0];f(de,{x:Y,y:re})}:void 0,Me=h?g.useCallback((de,Y)=>{const re=P.getState().nodeLookup.get(Y);h(de,re)},[]):void 0;return o.jsxRuntimeExports.jsx(Ws,{position:m,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 x=="string"?x:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*A: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:ze(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxRuntimeExports.jsxs("svg",{width:y,height:k,viewBox:`${G} ${ee} ${te} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:N,onClick:fe,children:[R&&o.jsxRuntimeExports.jsx("title",{id:se,children:R}),o.jsxRuntimeExports.jsx(Ny,{onClick:Me,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:c}),o.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${G-H},${ee-H}h${te+H*2}v${ne+H*2}h${-te-H*2}z
|
|
39
|
+
M${$.x},${$.y}h${$.width}v${$.height}h${-$.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Tu.displayName="MiniMap";g.memo(Tu);function $y({nodeId:e,position:t,variant:n=yn.Handle,className:s,style:r={},children:i,color:l,minWidth:c=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:p=!1,shouldResize:m,onResizeStart:f,onResize:h,onResizeEnd:j}){const S=uu(),R=typeof e=="string"?e:S,w=Le(),E=g.useRef(null),C=n===yn.Line?"right":"bottom-right",P=t??C,N=g.useRef(null);g.useEffect(()=>{if(!(!E.current||!R))return N.current||(N.current=m5({domNode:E.current,nodeId:R,getStoreItems:()=>{const{nodeLookup:B,transform:F,snapGrid:O,snapToGrid:M,nodeOrigin:y,domNode:k}=w.getState();return{nodeLookup:B,transform:F,snapGrid:O,snapToGrid:M,nodeOrigin:y,paneDomNode:k}},onChange:(B,F)=>{const{triggerNodeChanges:O,nodeLookup:M,parentLookup:y,nodeOrigin:k}=w.getState(),b=[],L={x:B.x,y:B.y},A=M.get(R);if(A&&A.expandParent&&A.parentId){const T=A.origin??k,V=B.width??A.measured.width??0,H=B.height??A.measured.height??0,G={id:A.id,parentId:A.parentId,rect:{width:V,height:H,...Na({x:B.x??A.position.x,y:B.y??A.position.y},{width:V,height:H},A.parentId,M,T)}},ee=Ir([G],M,y,k);b.push(...ee),L.x=B.x?Math.max(T[0]*V,B.x):void 0,L.y=B.y?Math.max(T[1]*H,B.y):void 0}if(L.x!==void 0&&L.y!==void 0){const T={id:R,type:"position",position:{...L}};b.push(T)}if(B.width!==void 0&&B.height!==void 0){const T={id:R,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:B.width,height:B.height}};b.push(T)}for(const T of F){const V={...T,type:"position"};b.push(V)}O(b)},onEnd:()=>{const B={id:R,type:"dimensions",resizing:!1};w.getState().triggerNodeChanges([B])}})),N.current.update({controlPosition:P,boundaries:{minWidth:c,minHeight:a,maxWidth:u,maxHeight:x},keepAspectRatio:p,onResizeStart:f,onResize:h,onResizeEnd:j,shouldResize:m}),()=>{var B;(B=N.current)==null||B.destroy()}},[P,c,a,u,x,p,f,h,j,m]);const _=P.split("-"),$=n===yn.Line?"borderColor":"backgroundColor",D=l?{...r,[$]:l}:r;return o.jsxRuntimeExports.jsx("div",{className:ze(["react-flow__resize-control","nodrag",..._,n,s]),ref:E,style:D,children:i})}g.memo($y);const Dy=(e,t)=>e.map((n,s)=>d.G.translate(n,t[s])),Au=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:Rt(e),style:{stroke:d.cssString(t)},...n}),By=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:Rt(e),style:{stroke:d.cssString(t),strokeDasharray:"12,4"},...n}),Oy=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:Rt(e),style:{stroke:d.cssString(t),strokeDasharray:"12,4,4"},...n}),Vy=({points:e,color:t,...n})=>{const s=d.G.calculateMiters(e,6),r=e.map((a,u)=>d.G.translate(a,s[u])),i=e.map((a,u)=>d.G.translate(a,d.G.scale(s[u],-1))),l=d.cssString(t),c=.7;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ue,{path:Rt(r),style:{stroke:l,opacity:c},...n}),o.jsxRuntimeExports.jsx(Ue,{path:Rt(e),style:{stroke:l},...n}),o.jsxRuntimeExports.jsx(Ue,{path:Rt(i),style:{stroke:l,opacity:c},...n})]})},ml=5,Fy=(e,t)=>{const n=[],s=[];for(let c=0;c<e.length-1;c++){const a=d.G.distance(e[c],e[c+1]);s.push(a)}const r=t;let i=0,l=r;for(let c=0;c<s.length;c++){const a=s[c],u=e[c],x=e[c+1];for(;i+a>=l;){const p=(l-i)/a,m={x:u.x+p*(x.x-u.x),y:u.y+p*(x.y-u.y)};let f="x";Math.abs(x.x-u.x)<1&&(f="y"),l+=r,!(d.G.distance(m,x)<ml||d.G.distance(m,u)<ml)&&n.push({position:m,direction:f})}i+=a}return n},Hy=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,o.jsxRuntimeExports.jsx("path",{d:r,stroke:d.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},Zy=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10";n==="x"?t.y+=10/3:t.x-=10/3;let i=d.G.translateX(t,-10),l=45;return n==="y"&&(i=d.G.translateY(t,-10),l+=90),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{d:r,stroke:d.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx("path",{d:r,stroke:d.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${i.x},${i.y}) rotate(${l})`,strokeLinecap:"round"})]})},Gy=({color:e,position:t})=>o.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:d.cssString(e),strokeWidth:2}),$r=e=>{const t=({points:n,color:s,...r})=>{const i=Rt(n),l=Fy(n,40);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ue,{path:i,...r,style:{stroke:d.cssString(s)}}),l.map(({position:c,direction:a},u)=>o.jsxRuntimeExports.jsx(e,{position:c,direction:a,color:s},u))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},Yy=$r(Hy),Wy=$r(Zy),Ky=$r(Gy),Rt=e=>{let t="";const s=e.length+-1;for(let r=0;r<s;r++){const i=e[r%e.length],l=e[(r+1)%e.length],c=Math.min(6/Math.hypot(l.x-i.x,l.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-c)+l.x*c},${i.y*(1-c)+l.y*c}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-c)+l.x*c},${i.y*(1-c)+l.y*c}`),r===s-1?t+=`L${l.x},${l.y}`:r<s-1&&(t+=`L${i.x*c+l.x*(1-c)},${i.y*c+l.y*(1-c)}`)}return t},Iu={pipe:Au,electric:By,secondary:Oy,jacketed:Vy,hydraulic:Yy,pneumatic:Wy,data:Ky},zu=Au,$u=[{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"}],qy=e=>o.jsxRuntimeExports.jsx(Ps,{columns:[{key:"name",name:"Type"}],data:$u,style:{width:200},entryRenderKey:"name",...e}),qs=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Ve=(e,t)=>{const n=qs(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return d.Mo.construct(s.position,d._.scale(d.Mo.dims(d.Mo.construct(n)),1/e.getZoom()))},Xy=(e,t)=>Xs.fromFlow(e,t);class Du{constructor(t,n){et(this,"node_",null);et(this,"position");et(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 d.G.translate(d.Mo.topLeft(this.node.box),this.position)}}class Xs{constructor(t,n,s){et(this,"key");et(this,"box");et(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Ve(n,t),r=qs(t),i=r.getElementsByClassName("react-flow__handle"),l=d.Mo.construct(r),c=Array.from(i).map(a=>{const u=d.Mo.center(d.Mo.construct(a)),x=d.G.translation(d.Mo.topLeft(l),u),p=a.className.match(/react-flow__handle-(\w+)/);if(p==null)throw new Error("[schematic] - cannot find handle orientation");const m=d.K.construct(p[0]);return new Du(x,m)});return new Xs(t,s,c)}}const Uy=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:r,toPosition:i,fromNode:l,connectionLineStyle:c,connectionStatus:a})=>{const u=document.querySelector(".react-flow__handle-connecting"),x=u==null?void 0:u.className.match(/react-flow__handle-(\w+)/);if(x!=null){const h=d.K.outer.safeParse(x[1]);h.success&&(i=h.data)}const p=Ft(),m=Gt({sourcePos:d.G.construct(e,t),targetPos:d.G.construct(n,s),sourceOrientation:r,targetOrientation:i,sourceBox:Ve(p,(l==null?void 0:l.id)??""),targetBox:Ve(p,(l==null?void 0:l.id)??"")}),f=Hc(d.G.construct(e,t),m,p.getZoom(),!1);return o.jsxRuntimeExports.jsx(zu,{points:f,style:{...c,stroke:d.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},Jy=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:r,targetPosition:i,style:l,segments:c=[],onSegmentsChange:a,color:u="var(--pluto-gray-l9)",selected:x=!1,variant:p="pipe",...m})=>{const f=d.G.construct(m.sourceX,m.sourceY),h=g.useRef(f),j=d.G.equals(f,h.current),S=d.G.construct(m.targetX,m.targetY),R=g.useRef(S),w=d.G.equals(S,R.current),E=Ft(),[C,P,N]=Z.useCombinedStateAndRef(()=>c.length>0?c:Gt({sourcePos:f,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ve(E,t),targetBox:Ve(E,n)})),_=g.useRef(i),$=g.useRef(s),D=Uo.useDebouncedCallback(a,100,[a]);if(!j||!w){let y=C;const k=d.G.translation(h.current,f),b=d.G.translation(S,R.current);d.G.equals(k,d.G.scale(b,-1),.001)?(h.current=f,R.current=S):(j?w||(y=g0({delta:b,segments:y}),_.current!==i&&(_.current=i,y=Gt({sourcePos:f,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ve(E,t),targetBox:Ve(E,n)})),di({sourcePos:f,targetPos:S,next:y,prev:C})||(y=Gt({sourcePos:f,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ve(E,t),targetBox:Ve(E,n)})),R.current=S):(y=h0({delta:k,segments:y}),$.current!==s&&($.current=s,y=Gt({sourcePos:f,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ve(E,t),targetBox:Ve(E,n)})),di({sourcePos:f,targetPos:S,next:y,prev:C})||(y=Gt({sourcePos:f,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ve(E,t),targetBox:Ve(E,n)})),h.current=f),D(y),P(y))}const B=g.useRef(null),F=We.useCursorDrag({onStart:g.useCallback((y,k,b)=>{B.current={index:Number(b.currentTarget.id.split("-")[1]),segments:[...N.current]}},[]),onMove:g.useCallback(y=>{if(B.current==null)return;const k=x0({segments:B.current.segments,index:B.current.index,magnitude:d.Mo.dim(y,d.g.swap(B.current.segments[B.current.index].direction),!0)/E.getZoom()});P(k)},[]),onEnd:g.useCallback(()=>a(N.current),[a])}),O=Hc(f,C,E.getZoom(),!0),M=Iu[p];return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(M,{points:O,color:u}),x&&Qy(O).map((y,k)=>{const b=C[k].direction,L=d.g.swap(b),A={[d.g.dimension(b)]:"18px",[d.g.dimension(L)]:"4px"},T={[b]:y[b]-9,[L]:y[L]-2};return o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsx("rect",{className:d.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...A,...T,rx:"2px",ry:"2px"}),o.jsxRuntimeExports.jsx("foreignObject",{x:y.x-9,y:y.y-9,width:"18px",height:"18px",children:o.jsxRuntimeExports.jsx("div",{id:`handle-${k}`,className:d.CSS(d.CSS.BE("diagram-edge-handle","dragger"),d.CSS.dir(b)),draggable:!0,onDragStart:F})})]},k)})]})},Qy=e=>e.slice(1).map((t,n)=>{const s=e[n];return d.G.construct((t.x+s.x)/2,(t.y+s.y)/2)}),e4=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:d.G.ZERO,zoom:1}})=>{const[r,i]=g.useState(n),[l,c]=g.useState(e),[a,u]=g.useState(t),[x,p]=g.useState(s),[m,f]=g.useState(!1);return{viewport:x,onViewportChange:p,edges:a,nodes:l,onNodesChange:c,onEdgesChange:u,editable:r,onEditableChange:i,fitViewOnResize:m,setFitViewOnResize:f}},t4=()=>!0,n4={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},s4={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},Bu={maxZoom:1,minZoom:.5},o4={hideAttribution:!0},Ou=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Bn=()=>g.use(Ou),Vu=g.memo(({children:e})=>{const{registerNodeRenderer:t}=Bn();return g.useEffect(()=>t(e),[t,e]),null});Vu.displayName="NodeRenderer";const r4=["Backspace","Delete"],i4=({aetherKey:e,onNodesChange:t,onEdgesChange:n,nodes:s,edges:r,onEditableChange:i,editable:l,viewport:c,triggers:a,onViewportChange:u,fitViewOnResize:x,setFitViewOnResize:p,visible:m,...f})=>{const h=Te.useMemoDeepEqualProps({visible:m}),[{path:j},,S]=Q.use$1({aetherKey:e,type:I.Diagram$1.TYPE,schema:I.diagramStateZ,initialState:{position:c.position,region:d.Mo.ZERO,zoom:c.zoom,...h}});g.useEffect(()=>S(Y=>({...Y,...h})),[h]);const R=Q.use().colors.gray.l9.hex,w=Te.useMemoCompare(()=>a??xr.zoom,Ie.compareModeConfigs,[a]),{fitView:E}=Ft(),C=Uo.useDebouncedCallback(Y=>void E(Y),50,[E]),P=Tn(g.useCallback(Y=>{x&&C({maxZoom:1}),S(re=>({...re,region:Y}))},[S,C,x])),N=g.useRef(null),_=g.useCallback(Y=>{const re=N.current;re!=null&&re.x===Y.x&&re.y===Y.y&&re.zoom===Y.zoom||(N.current=Y,!(isNaN(Y.x)||isNaN(Y.y)||isNaN(Y.zoom))&&(S(pe=>({...pe,position:Y,zoom:Y.zoom})),u(qc(Y))))},[S,u]);my({onStart:_,onChange:_,onEnd:_});const[$,D]=g.useState(()=>()=>null),B=g.useCallback(Y=>D(()=>Y),[]),F=g.useMemo(()=>({custom:({id:Y,positionAbsoluteX:re,positionAbsoluteY:pe,selected:Pe=!1,draggable:$e=!0})=>$({symbolKey:Y,position:{x:re,y:pe},selected:Pe,draggable:$e})}),[$]),O=g.useRef(r),M=g.useMemo(()=>(O.current=r,br(r)),[r]),y=g.useRef(s),k=g.useMemo(()=>(y.current=s,Cr(s)),[s]),b=g.useCallback(Y=>t(Xc(y.current,re=>ou(Y,re)),Y),[t]),L=g.useCallback(Y=>n(ns(O.current,re=>ru(Y,re),R)),[n,R]),A=g.useCallback((Y,re)=>n(ns(O.current,pe=>A3(Y,re,pe),R)),[]),T=g.useCallback(Y=>n(ns(O.current,re=>Ba(Y,re),R)),[n,R]),V=g.useCallback((Y,re)=>{const pe=[...O.current],Pe=pe.findIndex($e=>$e.key===Y);Pe!==-1&&(pe[Pe]={...pe[Pe],segments:re},O.current=pe,n(pe))},[n]),H=l?n4:s4,G=Z.useSyncedRef(V),ee=g.useMemo(()=>({default:Y=>{var re,pe,Pe;return o.jsxRuntimeExports.jsx(Jy,{...Y,segments:((re=Y.data)==null?void 0:re.segments)??[],color:(pe=Y.data)==null?void 0:pe.color,variant:(Pe=Y.data)==null?void 0:Pe.variant,onSegmentsChange:g.useCallback($e=>G.current(Y.id,$e),[Y.id])},Y.id)}}),[]),te=Ie.useHeld({triggers:[["Q"]],loose:!0}),ne=g.useRef(null);Ie.use({triggers:w.zoomReset,callback:g.useCallback(({stage:Y,cursor:re})=>{const pe=ne.current;pe==null||Y!=="start"||!d.Mo.contains(pe,re)||E()},[E])});const se=Ie.purgeMouse(w.select)[0]??null,J=Ie.purgeMouse(w.pan)[0]??null,ie=Ie.purgeMouse(w.zoom)[0]??null,fe={selectionOnDrag:se==null,panOnDrag:J==null,selectionKeyCode:se,panActivationKeyCode:J,zoomActivationKeyCode:ie},Me=Z.useCombinedRefs(ne,P),de=g.useMemo(()=>({visible:m,editable:l,onEditableChange:i,registerNodeRenderer:B,fitViewOnResize:x,setFitViewOnResize:p}),[l,m,i,B,x]);return o.jsxRuntimeExports.jsx(Ou,{value:de,children:o.jsxRuntimeExports.jsx(Q.Composite,{path:j,children:m&&o.jsxRuntimeExports.jsx(xy,{...fe,className:d.CSS(d.CSS.B("diagram"),d.CSS.editable(l),d.CSS.BE("symbol","container")),nodes:k,edges:M,nodeTypes:F,edgeTypes:ee,ref:Me,fitView:!0,onNodesChange:b,onEdgesChange:L,onConnect:T,onReconnect:A,defaultViewport:Kc(c),connectionLineComponent:Uy,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:t4,connectionMode:Ot.Loose,fitViewOptions:Bu,selectionMode:en.Partial,proOptions:o4,deleteKeyCode:r4,...f,style:{[d.CSS.var("diagram-zoom")]:c.zoom,...f.style},...H,nodesDraggable:l&&!te.held})})})},l4=()=>{const{editable:e}=Bn();return e?o.jsxRuntimeExports.jsx(Ey,{}):null},c4=e=>o.jsxRuntimeExports.jsx(ks.Pack,{direction:"y",borderShade:4,className:d.CSS.BE("diagram","controls"),...e}),a4=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=Bn();return o.jsxRuntimeExports.jsx(he.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:d.K.RIGHT_CENTER,tooltip:n?o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Disable edit mode"}):o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Enable edit mode"}),...t,children:n?o.jsxRuntimeExports.jsx(Z.E4.EditOff,{}):o.jsxRuntimeExports.jsx(Z.E4.Edit,{})})},u4=({onClick:e,...t})=>{const{fitView:n}=Ft(),{fitViewOnResize:s,setFitViewOnResize:r}=Bn();return o.jsxRuntimeExports.jsx(he.ToggleIcon,{onClick:i=>{n(Bu),e==null||e(i)},value:s,onChange:i=>r(i),rightClickToggle:!0,tooltip:o.jsxRuntimeExports.jsx(Z.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:d.K.RIGHT_CENTER,variant:"outlined",...t,children:o.jsxRuntimeExports.jsx(Z.E4.Expand,{})})},d4=e=>o.jsxRuntimeExports.jsx(Pu,{children:o.jsxRuntimeExports.jsx(i4,{...e})}),x4=Object.freeze(Object.defineProperty({__proto__:null,Background:l4,Controls:c4,DefaultPath:zu,Diagram:d4,FitViewControl:u4,HandleLayout:Du,NodeLayout:Xs,NodeRenderer:Vu,PATHS:Iu,PATH_TYPES:$u,SelectPathType:qy,ToggleEditControl:a4,alignNodes:S0,calcPath:Rt,edgeConverter:ns,edgeZ:E0,nodeConverter:Xc,nodeZ:y0,offsetPath:Dy,rfEdgeDataZ:Gc,selectNode:qs,selectNodeBox:Ve,selectNodeLayout:Xy,translateEdgesBackward:Wc,translateEdgesForward:br,translateNodesBackward:Yc,translateNodesForward:Cr,translateViewportBackward:qc,translateViewportForward:Kc,use:e4,useContext:Bn,viewportZ:j0},Symbol.toStringTag,{value:"Module"})),p4=({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=o.jsxRuntimeExports.jsx(Re.Text.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:l,...c})=>{const a=Te.useMemoDeepEqualProps({font:t,color:i,telem:l,visible:s}),[,{scrolling:u,empty:x},p]=Q.use$1({type:I.Log.TYPE,schema:I.logState,initialState:{empty:!0,region:d.Mo.ZERO,scrolling:!1,wheelPos:0,...a}});g.useEffect(()=>{p(f=>({...f,...a}))},[a,p]);const m=Tn(g.useCallback(f=>p(h=>({...h,region:f})),[p]));return o.jsxRuntimeExports.jsx("div",{ref:m,className:d.CSS(d.CSS.B("log"),n),onWheel:f=>{p(h=>({...h,wheelPos:h.wheelPos-f.deltaY,scrolling:h.scrolling?h.scrolling:f.deltaY<0}))},...c,children:x?r:o.jsxRuntimeExports.jsx(he.Icon,{className:d.CSS(d.CSS.BE("log","live"),u&&d.CSS.M("active")),variant:"outlined",onClick:()=>p(f=>({...f,scrolling:!f.scrolling})),tooltip:u?"Resume Scrolling":"Pause Scrolling",children:o.jsxRuntimeExports.jsx(Z.E4.Dynamic,{})})})},m4=Object.freeze(Object.defineProperty({__proto__:null,Log:p4},Symbol.toStringTag,{value:"Module"})),kt=(e,t)=>{const n={};t.forEach(r=>n[r]=void 0);const s=r=>{const{...i}={...r,...n};return o.jsxRuntimeExports.jsx(e,{...i})};return s.displayName=`RemoveProps(${e.displayName})`,s},f4=({value:e,hideOuter:t=!1,hideInner:n,onChange:s})=>{const{outer:r}=e,i=l=>()=>s({...e,...l});return t?o.jsxRuntimeExports.jsx(fl,{className:d.CSS.B("orientation-control"),value:e,onChange:s}):o.jsxRuntimeExports.jsxs(oe.Space,{className:d.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[o.jsxRuntimeExports.jsx(yt,{selected:r==="top",onClick:i({outer:"top"})}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[o.jsxRuntimeExports.jsx(yt,{selected:r==="left",onClick:i({outer:"left"})}),o.jsxRuntimeExports.jsx(fl,{hideInner:n,value:e,onChange:s}),o.jsxRuntimeExports.jsx(yt,{selected:r==="right",onClick:i({outer:"right"})})]}),o.jsxRuntimeExports.jsx(yt,{selected:r==="bottom",onClick:i({outer:"bottom"})})]})},fl=({value:e,onChange:t,className:n,hideInner:s=!1,...r})=>{const{inner:i}=e,l=a=>()=>t({...e,...a});let c={};return s&&(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),o.jsxRuntimeExports.jsxs(oe.Space,{className:d.CSS(n,d.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...r,children:[o.jsxRuntimeExports.jsx(yt,{style:c,disabled:s,className:d.CSS(d.CSS.dir("y")),selected:i==="top",onClick:l({inner:"top"})}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"center",justify:"center",children:[o.jsxRuntimeExports.jsx(yt,{style:c,disabled:s,selected:i==="left",onClick:l({inner:"left"})}),o.jsxRuntimeExports.jsx(yt,{style:c,disabled:s,selected:i==="right",onClick:l({inner:"right"})})]}),o.jsxRuntimeExports.jsx(yt,{style:c,disabled:s,className:d.CSS(d.CSS.dir("y")),selected:i==="bottom",onClick:l({inner:"bottom"})})]})},yt=({selected:e,className:t,...n})=>o.jsxRuntimeExports.jsx(he.Icon,{variant:"text",className:d.CSS(t,d.CSS.selected(e)),...n,children:o.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Ge=({className:e,direction:t,...n})=>o.jsxRuntimeExports.jsx(oe.Space,{direction:t,align:"stretch",className:d.CSS(d.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),Mt=({hideOuter:e,hideInner:t,...n})=>t&&e?null:o.jsxRuntimeExports.jsx(Ce,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:r})=>{var i;return o.jsxRuntimeExports.jsx(f4,{value:{inner:s.orientation??"top",outer:((i=s.label)==null?void 0:i.orientation)??"top"},hideInner:t,hideOuter:e,onChange:l=>r({...s,orientation:l.inner,label:{...s.label,orientation:l.outer}})})}}),Ht=({path:e,omit:t=[]})=>o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(Ce,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>o.jsxRuntimeExports.jsx(ut.Text,{selectOnFocus:!0,...n})}),o.jsxRuntimeExports.jsx(Xt,{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}),o.jsxRuntimeExports.jsx(Ce,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>o.jsxRuntimeExports.jsx(ln,{...n})}),o.jsxRuntimeExports.jsx(Ce,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>o.jsxRuntimeExports.jsx(Ls,{...n})}),o.jsxRuntimeExports.jsx(Ce,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:n=>o.jsxRuntimeExports.jsx(Ul,{...n,yDirection:"down"})})]}),st=e=>o.jsxRuntimeExports.jsx(Ce,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(We.Swatch,{value:t??d.ZERO.setAlpha(1).rgba255,onChange:i=>n(i.rgba255),...r,bordered:!0})}),Fu=e=>o.jsxRuntimeExports.jsx(Ce,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(je.Numeric,{dragScale:{x:.75,y:.5},bounds:{lower:50,upper:1e3},endContent:"%",value:Math.round(t*100),onChange:s=>n(parseFloat((s/100).toFixed(2)))})}),ge=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{omit:e,path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(st,{path:"color",optional:!0}),o.jsxRuntimeExports.jsx(Ce,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:s=>o.jsxRuntimeExports.jsx(Q.Switch$1,{...s})}),o.jsxRuntimeExports.jsx(Fu,{path:"scale"})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideInner:t,hideOuter:n})]}),h4=({path:e})=>{var u,x;const{value:t,onChange:n}=wt({path:e}),s=I.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),r=I.sinkPipelinePropsZ.parse((x=t.sink)==null?void 0:x.props),i=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=I.setChannelValuePropsZ.parse(r.segments.setter.props),c=p=>{p??(p=0);const m=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:p}),threshold:I.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:m})},a=p=>{p??(p=0);const m=I.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:I.setChannelValue({channel:p}),setpoint:I.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),f=I.authoritySource({channel:p}),h=I.acquireChannelControl({channel:p,authority:255});n({...t,sink:m,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:h,source:f},indicator:{statusSource:f}}})};return o.jsxRuntimeExports.jsxs(Ge,{direction:"x",grow:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(je.Item,{label:"State Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:i.channel,onChange:c})}),o.jsxRuntimeExports.jsx(je.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:l.channel,onChange:a})}),o.jsxRuntimeExports.jsx(Ts,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},Dr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],we=({hideInnerOrientation:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"control":return o.jsxRuntimeExports.jsx(h4,{path:""});default:return o.jsxRuntimeExports.jsx(ge,{hideInnerOrientation:e})}},[e]),n=Ne.useStatic({tabs:Dr,content:t});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...n})},Tt={y:2,x:.25},Sn={lower:0,upper:2e3},hl={lower:0,upper:51},Hu=({includeBorderRadius:e=!1})=>o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(st,{path:"color"}),o.jsxRuntimeExports.jsx(st,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(Ce,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:t=>o.jsxRuntimeExports.jsx(je.Numeric,{dragScale:Tt,bounds:hl,endContent:"%",...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:t=>o.jsxRuntimeExports.jsx(je.Numeric,{dragScale:Tt,bounds:hl,endContent:"%",...t})}),e&&o.jsxRuntimeExports.jsx(Ce,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:t=>o.jsxRuntimeExports.jsx(je.Numeric,{dragScale:Tt,bounds:Sn,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(je.Numeric,{value:t??200,dragScale:Tt,bounds:Sn,endContent:"px",...n})}),o.jsxRuntimeExports.jsx(Ce,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(je.Numeric,{value:t??200,dragScale:Tt,bounds:Sn,endContent:"px",...n})})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideInner:!0})]}),Zu=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],g4=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsxs(Ge,{direction:"y",empty:!0,children:[o.jsxRuntimeExports.jsx(Sr,{path:""}),";"]});default:return o.jsxRuntimeExports.jsxs(Ge,{direction:"x",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(st,{path:"color"}),o.jsxRuntimeExports.jsx(Ce,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(ut.Text,{...s})}),o.jsxRuntimeExports.jsx(Xt,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),o.jsxRuntimeExports.jsx(Ce,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(ln,{...s})})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideInner:!0})]})}},[]),t=Ne.useStatic({tabs:Zu,content:e});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...t})},j4=({path:e})=>{var u;const{value:t,onChange:n}=wt({path:e}),s=I.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),r=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=I.withinBoundsProps.parse(s.segments.threshold.props),l=x=>{x??(x=0);const p=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:x}),threshold:I.withinBounds({trueBound:{lower:i.trueBound.lower??.9,upper:i.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:p})},c=x=>{const p=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:r.channel}),threshold:I.withinBounds({trueBound:x})},outlet:"threshold"});n({...t,source:p})},a=_s(r.channel);return g.useEffect(()=>n({...t}),[a]),o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:r.channel,onChange:l})}),o.jsxRuntimeExports.jsx(je.Item,{label:"Lower Threshold",children:o.jsxRuntimeExports.jsx(je.Numeric,{value:i.trueBound.lower??.9,onChange:x=>c({...i.trueBound,lower:x})})}),o.jsxRuntimeExports.jsx(je.Item,{label:"Upper Threshold",children:o.jsxRuntimeExports.jsx(je.Numeric,{value:i.trueBound.upper??1.1,onChange:x=>c({...i.trueBound,upper:x})})})]})},E4=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsx(j4,{path:""});default:return o.jsxRuntimeExports.jsx(ge,{})}},[]),t=Ne.useStatic({tabs:Zu,content:e});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...t})},y4=({path:e})=>{var l;const{value:t,onChange:n}=wt({path:e}),s=I.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),r=I.setChannelValuePropsZ.parse(s.segments.setter.props),i=c=>{c??(c=0);const a=I.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:I.setChannelValue({channel:c}),setpoint:I.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),u=I.authoritySource({channel:c}),x=I.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:x,source:u},showIndicator:!0,indicator:{statusSource:u}}})};return o.jsxRuntimeExports.jsxs(Ge,{direction:"x",children:[o.jsxRuntimeExports.jsx(je.Item,{label:"Output Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:r.channel,onChange:i})}),o.jsxRuntimeExports.jsx(Xt,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),o.jsxRuntimeExports.jsx(Ts,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},S4=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(y4,{path:""});default:return o.jsxRuntimeExports.jsx(ge,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=Ne.useStatic({tabs:Dr,content:e});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...t})},R4=({path:e})=>{var l;const{value:t,onChange:n}=wt({path:e}),s=I.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),r=I.setChannelValuePropsZ.parse(s.segments.setter.props),i=c=>{c??(c=0);const a=I.sinkPipeline("number",{connections:[],segments:{setter:I.setChannelValue({channel:c})},inlet:"setter"}),u=I.authoritySource({channel:c}),x=I.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:x,source:u},showIndicator:!0,indicator:{statusSource:u}},disabled:c==0})};return o.jsxRuntimeExports.jsx(Ge,{direction:"x",grow:!0,align:"stretch",children:o.jsxRuntimeExports.jsx(je.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(zt,{value:r.channel,onChange:i})})})},C4=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(R4,{path:""});default:return o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",align:"stretch",grow:!0,size:"small",children:[o.jsxRuntimeExports.jsx(Ht,{path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(mr,{path:"units",label:"Units",align:"start",padHelpText:!1}),o.jsxRuntimeExports.jsx(Ce,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(ql,{...s})}),o.jsxRuntimeExports.jsx(st,{path:"color"})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideInner:!0})]})}},[]),t=Ne.useStatic({tabs:Dr,content:e});return o.jsxRuntimeExports.jsx(Ne.Tabs,{...t})},b4=()=>{const e=wt({path:"autoFit",optional:!0});return o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",grow:!0,children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(Ce,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>o.jsxRuntimeExports.jsx(ut.Text,{...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"level",label:"Text Size",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ln,{...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>o.jsxRuntimeExports.jsx(Ls,{...t})})]}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(st,{path:"color"}),o.jsxRuntimeExports.jsx(Ce,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(je.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:o.jsxRuntimeExports.jsx(he.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:o.jsxRuntimeExports.jsx(Z.E4.AutoFitWidth,{})})})})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:""})]})},w4=()=>o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{path:"label",omit:["maxInlineSize","align","direction"]}),o.jsxRuntimeExports.jsx(st,{path:"color"})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideOuter:!0})]}),v4=()=>o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(st,{path:"color"}),o.jsxRuntimeExports.jsx(st,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(Ce,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(je.Numeric,{value:e??200,dragScale:Tt,bounds:Sn,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(Ce,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(je.Numeric,{value:e??200,dragScale:Tt,bounds:Sn,endContent:"px",...t})})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:"",hideInner:!0})]}),_t=()=>o.jsxRuntimeExports.jsxs(Ge,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(oe.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Ht,{path:"label"}),o.jsxRuntimeExports.jsxs(oe.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(st,{path:"color"}),o.jsxRuntimeExports.jsx(Fu,{path:"scale"}),o.jsxRuntimeExports.jsx(Ts,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),o.jsxRuntimeExports.jsx(Mt,{path:""})]}),k4=()=>o.jsxRuntimeExports.jsx(Hu,{includeBorderRadius:!0}),M4=()=>o.jsxRuntimeExports.jsx(we,{hideInnerOrientation:!0}),z=e=>o.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),be=e=>o.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),De=e=>o.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),Ee=e=>o.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),_4={left:{left:X.Left,right:X.Right,top:X.Top,bottom:X.Bottom},right:{left:X.Right,right:X.Left,top:X.Bottom,bottom:X.Top},top:{left:X.Bottom,right:X.Top,top:X.Left,bottom:X.Right},bottom:{left:X.Top,right:X.Bottom,top:X.Right,bottom:X.Left}},P4=(e,t)=>_4[t][e],L4=(e,t=!1)=>{if(t)return e;switch(e){case X.Left:return X.Right;case X.Right:return X.Left;case X.Top:return X.Bottom;case X.Bottom:return X.Top;default:return X.Top}},N4=(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},K=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=py()}catch{return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})}const r=g.useRef(null),i=g.useRef(!0);return g.useEffect(()=>{if(r.current==null)return;if(i.current){i.current=!1;return}const l=r.current.closest(".react-flow__node"),c=l==null?void 0:l.getAttribute("data-id");c!=null&&(s==null||s(c))},[t,n]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("span",{ref:r}),e]})},v=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:r,top:i,style:l,...c})=>{const a=N4(i,s,t,n);return o.jsxRuntimeExports.jsx(Ln,{position:L4(P4(e,t),!r),...c,type:"source",onClick:u=>u.stopPropagation(),className:(d.CSS.B("handle"),d.CSS.BE("handle",c.id)),style:{left:`${a.left}%`,top:`${a.top}%`,...l}})},ye=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:r,...i})=>o.jsxRuntimeExports.jsx("button",{className:d.CSS(d.CSS.B("symbol-primitive"),d.CSS.B("symbol-primitive-toggle"),s!=null&&d.CSS.loc(s),t&&d.CSS.M("enabled"),n&&d.CSS.M("triggered"),e),color:d.cssString(r),...i}),ae=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:d.CSS(d.CSS.B("symbol-primitive"),e),...t}),T4=.8,U=({dimensions:e,orientation:t="left",children:n,className:s,color:r,style:i={},scale:l=1,...c})=>{e=d.g.construct(t)==="y"?d._.swap(e):e;const u=d.cssString(r),x=Q.use();return r!=null&&(i[d.CSS.var("symbol-color")]=new d.Color(r).rgbString,i[d.CSS.var("symbol-color-contrast")]=new d.Color(r).pickByContrast(x.colors.gray.l0,x.colors.gray.l10).rgbString),o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:d._.svgViewBox(e),className:d.CSS(d.CSS.loc(t),s),fill:u,stroke:u,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:d._.scale(e,l*T4).width,...i},children:o.jsxRuntimeExports.jsx("g",{children:n})})},Gu=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,orientation:t,className:d.CSS(d.CSS.B("four-way-valve"),e),children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:87},color:s,scale:n,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Yu=({color:e,orientation:t="left",scale:n,...s})=>o.jsxRuntimeExports.jsxs(ye,{...s,className:d.CSS(d.CSS.B("three-way-valve")),orientation:t,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Wu=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(ye,{...s,children:[o.jsxRuntimeExports.jsxs(K,{orientation:e,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:o.jsxRuntimeExports.jsx(z,{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"})})]}),Ku=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ye,{className:d.CSS(d.CSS.B("solenoid-valve"),s&&d.CSS.M("normally-open"),e),...i,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(z,{className:d.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"}),o.jsxRuntimeExports.jsx(Ee,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),o.jsxRuntimeExports.jsx(be,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),qu=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{className:d.CSS(d.CSS.B("relief-valve"),e),enabled:r,...i,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),Xu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{orientation:t,className:d.CSS(d.CSS.B("check-valve"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Ee,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Uu=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=d.cssString(n);return o.jsxRuntimeExports.jsxs(ae,{...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"7",cy:"7",r:"4",fill:i}),o.jsxRuntimeExports.jsx(z,{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,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,orientation:n,className:d.CSS(d.CSS.B("angled-valve"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Qu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:d.CSS(d.CSS.B("ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"43.5978",cy:"20.972",r:"19"}),o.jsxRuntimeExports.jsx(z,{d:"M26.5 12.8472L6.35452 2.17563C4.35901 1.16585 2 2.61598 2 4.85243V37.0918C2 39.3283 4.35901 40.7784 6.35453 39.7686L26.5 29.3472"}),o.jsxRuntimeExports.jsx(z,{d:"M60.5 28.8486L80.6455 39.5202C82.641 40.5299 85 39.0798 85 36.8434V4.60396C85 2.36751 82.641 0.917381 80.6455 1.92716L60.5 12.3486"})]})]}),ed=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:d.CSS(d.CSS.B("three-way-ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.8,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"43.5978",cy:"21.722",r:"19"}),o.jsxRuntimeExports.jsx(z,{d:"M26.5 13.5972L6.35452 2.92563C4.35901 1.91585 2 3.36598 2 5.60243V37.8418C2 40.0783 4.35901 41.5284 6.35453 40.5186L26.5 30.0972"}),o.jsxRuntimeExports.jsx(z,{d:"M60.5 29.5986L80.6455 40.2702C82.641 41.2799 85 39.8298 85 37.5934V5.35396C85 3.11751 82.641 1.66738 80.6455 2.67716L60.5 13.0986"}),o.jsxRuntimeExports.jsx(z,{d:"M35.3737 38.7499L24.7021 58.8954C23.6923 60.8909 25.1425 63.2499 27.3789 63.2499H59.6183C61.8548 63.2499 63.3049 60.8909 62.2951 58.8954L51.8737 38.7499"})]})]}),td=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:d.CSS(d.CSS.B("gate-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 2 L43.5 39.7965"})]})]}),nd=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:d.CSS(d.CSS.B("butterfly-valve-one"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 2V40"}),o.jsxRuntimeExports.jsx(De,{cx:"43.5",cy:"21",r:"10",fill:d.cssString(e)})]})]}),sd=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:d.CSS(d.CSS.B("butterfly-valve-two"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"43.5",cy:"21",r:"10",fill:d.cssString(e)}),o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),o.jsxRuntimeExports.jsx(z,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),od=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:d.CSS(d.CSS.B("breather-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:8.081,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:91.919,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"91",cy:"49.5",r:"6",fill:d.cssString(e)}),o.jsxRuntimeExports.jsx(De,{cx:"8",cy:"7.5",r:"6",fill:d.cssString(e)}),o.jsxRuntimeExports.jsx(z,{d:"M49.5 28.5L12.3545 9.70349C10.359 8.69372 8 10.1438 8 12.3803V44.6197C8 46.8562 10.359 48.3063 12.3545 47.2965L49.5 28.5ZM49.5 28.5L86.6455 9.70349C88.641 8.69372 91 10.1438 91 12.3803V44.6197C91 46.8562 88.641 48.3063 86.6455 47.2965L49.5 28.5Z"})]})]}),rd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"2",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"62",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)})]})]}),id=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const i=d.cssString(t);return o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(K,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:5,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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:i}),o.jsxRuntimeExports.jsx(z,{d:"M33 24H2",strokeLinecap:"round"})]})]})},ld=({className:e,color:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(K,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),cd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(K,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(U,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(z,{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"})})]}),ad=({className:e,orientation:t="left",color:n,scale:s=1,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(K,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:50,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(U,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:o.jsxRuntimeExports.jsx(z,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),ud=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:t,className:d.CSS(d.CSS.B("manual-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Ee,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),o.jsxRuntimeExports.jsx(z,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),dd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("orifice_plate"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{color:n,dimensions:{width:96,height:48},orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"3",y:"3",width:"90",height:"42",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(Ee,{x1:"33",y1:"3",x2:"33",y2:"21",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"33",y1:"27",x2:"33",y2:"45",strokeLinecap:"round"})]})]}),gl=(e,t)=>e/t*100,xd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:o.jsxRuntimeExports.jsx(z,{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"})})]}),pd=e=>typeof e=="number"?{topLeft:d.G.construct(e),topRight:d.G.construct(e),bottomLeft:d.G.construct(e),bottomRight:d.G.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:d.G.construct(e.topLeft),topRight:d.G.construct(e.topRight),bottomLeft:d.G.construct(e.bottomLeft),bottomRight:d.G.construct(e.bottomRight)}:e,A4=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:r}=e;return`${t.x}% ${n.x}% ${r.x}% ${s.x}% / ${t.y}% ${n.y}% ${r.y}% ${s.y}%`},md={width:40,height:80},Br={x:50,y:10},Us=({className:e,dimensions:t=md,borderRadius:n=Br,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const c=pd(n),a=s==null,u=Q.use(),{width:x,height:p}=t,m=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,p,x]),f=gl(1,x),h=100-f,j=gl(1,p),S=100-j;return o.jsxRuntimeExports.jsx(ae,{className:d.CSS(e,d.CSS.B("tank")),style:{...t,borderRadius:s??A4(c),borderColor:d.cssString(r??u.colors.gray.l9),backgroundColor:d.cssString(i)},...l,children:o.jsxRuntimeExports.jsxs(K,{refreshDeps:m,orientation:"left",children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:j,id:"1"}),a&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:f,top:c.topLeft.y,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:h,top:c.topRight.y,id:"3"})]}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:S,id:"4"}),a&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:f,top:100-c.bottomLeft.y,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:h,top:100-c.bottomRight.y,id:"6"})]}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:f,top:50,id:"7"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:h,top:50,id:"8"})]})})},fd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(e,d.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(Ee,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),hd=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("orifice"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[o.jsxRuntimeExports.jsx(z,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),gd=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:t,className:d.CSS(d.CSS.B("needle-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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:d.cssString(n)}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),jd=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,orientation:n,className:d.CSS(d.CSS.B("angled-relief-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[o.jsxRuntimeExports.jsx(Ee,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Ed=({className:e,color:t,dimensions:n,orientation:s="left",units:r="psi",unitsLevel:i="small",children:l,inlineSize:c=80,...a})=>{const u=d.cssString(t),x=Q.use(),p=t==null?"var(--pluto-gray-l0)":d.cssString(new d.Color(t).pickByContrast(x.colors.gray.l0,x.colors.gray.l9));return o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("value"),e),...a,style:{borderColor:u,height:n==null?void 0:n.height,width:"100%"},children:[o.jsxRuntimeExports.jsx("div",{className:d.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:c},children:l}),o.jsxRuntimeExports.jsxs(K,{orientation:s,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx("div",{className:d.CSS(d.CSS.BE("value","units"),d.CSS.M(i)),style:{background:u},children:o.jsxRuntimeExports.jsx(Z.Text,{level:i,color:p,children:r})})]})},yd=({enabled:e=!1,onClick:t,orientation:n="left"})=>o.jsxRuntimeExports.jsxs(ae,{orientation:n,children:[o.jsxRuntimeExports.jsx(Q.Switch$1,{value:e,onClick:t,onChange:()=>{}}),o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Sd=({onClick:e,orientation:t="left",label:n="",color:s,size:r,level:i,onClickDelay:l})=>o.jsxRuntimeExports.jsxs(ae,{orientation:t,children:[o.jsxRuntimeExports.jsx(he.Button,{onClick:e,color:s,size:r,level:i,onClickDelay:l,children:n}),o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:0,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),Rd=({className:e,orientation:t="left",text:n="",width:s,color:r="var(--pluto-gray-l9)",level:i,autoFit:l,align:c="center"})=>{const a={textAlign:c};return d.g.construct(t)==="y"?a.height=l?"fit-content":s:a.width=l?"fit-content":s,o.jsxRuntimeExports.jsx(ae,{style:a,orientation:t,className:d.CSS(d.CSS.B("text-box"),d.CSS.loc(t),e),children:o.jsxRuntimeExports.jsx(Z.Text,{color:d.cssString(r),level:i,children:n})})},Cd=({orientation:e="left",className:t,onClick:n,children:s,value:r,units:i,color:l,onChange:c,size:a="small",disabled:u,...x})=>{const[p,m]=g.useState(r);return o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("setpoint"),t),orientation:e,...x,children:[o.jsxRuntimeExports.jsxs(K,{orientation:e,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:e,left:.5,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:e,left:100,top:50,id:"2",style:{zIndex:5}}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:e,left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx(je.Numeric,{size:a,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,outlineColor:l,borderWidth:1,disabled:u,children:o.jsxRuntimeExports.jsx(he.Button,{size:a,variant:"filled",onClick:()=>c(p),color:l,children:"Set"})})]})},bd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("screw-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"2",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"62",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(z,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(z,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:d.CSS(d.CSS.M("detail"),t)})]})]}),wd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("vacuum-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"})})]}),vd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("cavity-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"2",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"62",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(z,{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:d.CSS(d.CSS.M("detail"),t)})]})]}),kd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("piston-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"2",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"62",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(z,{d:"M 23 32, h 16, m 0 -8, v 16",className:d.CSS(d.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Md=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("static-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),_d=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("rotary-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(Ee,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:d.CSS(d.CSS.M("detail"),t)})]})]}),Pd=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,orientation:n,className:d.CSS(d.CSS.B("light"),s&&d.CSS.M("enabled"),e),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:o.jsxRuntimeExports.jsx(De,{cx:"32",cy:"32",r:"30"})})]}),Ld=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(e,d.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:21.5909,top:25,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:12.5,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:70/88*100,top:20/80*100,id:"5"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(be,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(Ee,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Nd=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M43 1L45 65"})]})]}),Td=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50.5814,top:200/e,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),Ad=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(be,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Id=({height:e=86,className:t,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:e},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(be,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),o.jsxRuntimeExports.jsx(Ee,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:d.CSS(d.CSS.M("detail"),t),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"49",x2:"43",y2:"83",className:d.CSS(d.CSS.M("detail"),t),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:d.CSS(d.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),zd=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(be,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),$d=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(ye,{...i,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(K,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Ee,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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"})]})]}),Dd=({id:e,className:t,orientation:n="right",label:s="text",color:r="black",level:i="p",onLabelChange:l,...c})=>{const a=document.querySelector(`[data-id="${e}"]`);a&&a.classList.add(n);const u=d.g.construct(n)==="y";return o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("arrow"),d.CSS.loc(n),t),orientation:n,...c,children:[o.jsxRuntimeExports.jsx("div",{className:"wrapper",children:o.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:d.cssString(r)},children:o.jsxRuntimeExports.jsx("div",{className:"bg",children:o.jsxRuntimeExports.jsx(Z.MaybeEditable,{value:s,onChange:l,level:i,className:d.CSS.BE("symbol","label")})})})}),o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:u,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:u,id:"2"})]}),o.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:o.jsxRuntimeExports.jsx("defs",{children:o.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[o.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),o.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"}),o.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},Bd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("vent"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(U,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(z,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),Od=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("iso-filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(Ee,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ee,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),Vd=({className:e,dimensions:t=md,borderRadius:n=Br,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const c=pd(n),a=Q.use(),u=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]),x=d.cssString(r??a.colors.gray.l9),p=i==null?void 0:d.cssString(i),m=t.width/66,f=t.height/180,h=`scale(${m},${f})`;return o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(e,d.CSS.B("cylinder")),style:{...t},...l,children:[o.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:o.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:x,transform:h,fill:p})}),o.jsxRuntimeExports.jsxs(K,{refreshDeps:u,orientation:"left",children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:2,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:35,top:10,id:"9"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:65,top:10,id:"10"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:40,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:40,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:60,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:60,id:"6"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:80,id:"7"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},Fd=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=d.cssString(n);return o.jsxRuntimeExports.jsxs(ye,{...i,orientation:t,className:d.CSS(d.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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}),o.jsxRuntimeExports.jsx(z,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{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}),o.jsxRuntimeExports.jsx(De,{cx:"44",cy:"55",r:"4",fill:l}),o.jsxRuntimeExports.jsx(z,{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})]})]})},Hd=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=d.cssString(n);return o.jsxRuntimeExports.jsxs(ye,{...i,orientation:t,className:d.CSS(d.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(z,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),o.jsxRuntimeExports.jsx(z,{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"}),o.jsxRuntimeExports.jsx(De,{cx:"21",cy:"56.0737",r:"4",fill:l}),o.jsxRuntimeExports.jsx(z,{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"})]})]})},Zd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:1.6667,top:20,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:98.3333,top:20,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:95,id:"3"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:36,height:18},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(z,{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:d.cssString(n),stroke:"none"})})]}),Gd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{className:d.CSS(d.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(K,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:5,top:49,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95,top:49,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:95,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:5,id:"4"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:36,height:36},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(z,{d:"M21 34C21 35.1046 20.1046 36 19 36H17C15.8954 36 15 35.1046 15 34V23C15 21.8954 14.1046 21 13 21H2C0.895432 21 0 20.1046 0 19V17C0 15.8954 0.895432 15 2 15H13C14.1046 15 15 14.1046 15 13V2C15 0.895432 15.8954 0 17 0H19C20.1046 0 21 0.895432 21 2V13C21 14.1046 21.8954 15 23 15H34C35.1046 15 36 15.8954 36 17V19C36 20.1046 35.1046 21 34 21H23C21.8954 21 21 21.8954 21 23V34Z",fill:d.cssString(n),stroke:"none"})})]}),Qe=({position:e,color:t})=>o.jsxRuntimeExports.jsx("text",{x:(e==null?void 0:e.x)??57,y:(e==null?void 0:e.y)??27,style:{fill:d.cssString(t),fontWeight:450},stroke:"none",children:"F"}),Yd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-general"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Qe,{position:{x:56,y:25},color:s})]})]}),Wd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-Electromagnetic"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M47.5 17.5H55.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M15.5 17.5H23.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M23.5 17.5C23.5 16.9747 23.6035 16.4546 23.8045 15.9693C24.0055 15.484 24.3001 15.043 24.6716 14.6716C25.043 14.3001 25.484 14.0055 25.9693 13.8045C26.4546 13.6035 26.9747 13.5 27.5 13.5C28.0253 13.5 28.5454 13.6035 29.0307 13.8045C29.516 14.0055 29.957 14.3001 30.3284 14.6716C30.6999 15.043 30.9945 15.484 31.1955 15.9693C31.3965 16.4546 31.5 16.9747 31.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M31.5 17.5C31.5 16.9747 31.6035 16.4546 31.8045 15.9693C32.0055 15.484 32.3001 15.043 32.6716 14.6716C33.043 14.3001 33.484 14.0055 33.9693 13.8045C34.4546 13.6035 34.9747 13.5 35.5 13.5C36.0253 13.5 36.5454 13.6035 37.0307 13.8045C37.516 14.0055 37.957 14.3001 38.3284 14.6716C38.6999 15.043 38.9945 15.484 39.1955 15.9693C39.3965 16.4546 39.5 16.9747 39.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M39.5 17.5C39.5 16.9747 39.6035 16.4546 39.8045 15.9693C40.0055 15.484 40.3001 15.043 40.6716 14.6716C41.043 14.3001 41.484 14.0055 41.9693 13.8045C42.4546 13.6035 42.9747 13.5 43.5 13.5C44.0253 13.5 44.5454 13.6035 45.0307 13.8045C45.516 14.0055 45.957 14.3001 46.3284 14.6716C46.6999 15.043 46.9945 15.484 47.1955 15.9693C47.3965 16.4546 47.5 16.9747 47.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Qe,{position:{x:58,y:29},color:s})]})]}),Kd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-VariableArea"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M46 10V25"}),o.jsxRuntimeExports.jsx(z,{d:"M23 13V22"}),o.jsxRuntimeExports.jsx(z,{d:"M23 13L46 10"}),o.jsxRuntimeExports.jsx(z,{d:"M23 22L46 25"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),qd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-Coriolis"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M2 17.6024H28.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M28.5 17.6024L34.6834 14.0324",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M34.8 14L45.9058 20.9666",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M51.5 17.6024L46.0141 20.8987",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M20.5 17.6024L26.6574 14.0474",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M26.75 14.1024L37.788 21.0265",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 17.6024L37.8427 21.0017",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M43.5 17.6024H69",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Qe,{position:{x:58,y:29},color:s})]})]}),Xd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-Nozzle"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M24 2V7V12",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M24 12H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M24 23H29H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M24 33V23",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),Ud=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-Venturi"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M8 33L26.5329 22.3",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M8 2L26.5329 12.7",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M56 33L26.5876 22.2948",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M56 2L26.5876 12.7052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Qe,{position:{x:56,y:29},color:s})]})]}),Jd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-RingPiston"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(De,{cx:"36.5",cy:"17.5",r:"10.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(De,{cx:"36.5",cy:"21.5",r:"6.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Qe,{position:{x:56,y:29},color:s})]})]}),Qd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-PositiveDisplacement"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M41 13C41 15.4853 38.9853 17.5 36.5 17.5C34.0147 17.5 32 15.4853 32 13C32 10.5147 34.0147 8.5 36.5 8.5C38.9853 8.5 41 10.5147 41 13Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M41 22C41 24.4853 38.9853 26.5 36.5 26.5C34.0147 26.5 32 24.4853 32 22C32 19.5147 34.0147 17.5 36.5 17.5C38.9853 17.5 41 19.5147 41 22Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),ex=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-Turbine"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M16.5 17.5H54.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M32.5 9L35.4756 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M38.5 26L35.5244 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M32.5 26L35.4756 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M38.5 9L35.5244 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M32.5 9C32.5 8.20435 32.8161 7.44129 33.3787 6.87868C33.9413 6.31607 34.7044 6 35.5 6C36.2956 6 37.0587 6.31607 37.6213 6.87868C38.1839 7.44129 38.5 8.20435 38.5 9",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M38.5 26C38.5 26.7956 38.1839 27.5587 37.6213 28.1213C37.0587 28.6839 36.2956 29 35.5 29C34.7044 29 33.9413 28.6839 33.3787 28.1213C32.8161 27.5587 32.5 26.7956 32.5 26",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),tx=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-Pulse"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M31 13.5H39",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M23 21.5H31",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M39 21.5H47",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M39 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),nx=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("flowmeter-FloatSensor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(z,{d:"M25 8H46",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31 27H40",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31 27L25.046 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M40 27L45.954 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Qe,{color:s})]})]}),sx=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("heat-exchanger-general"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.545,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.454,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.454,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(z,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),o.jsxRuntimeExports.jsx(z,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"})]})]}),ox=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:89,top:27.27,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:89,top:72.73,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.455,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.545,top:50,id:"5"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(z,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),rx=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(ae,{...i,className:d.CSS(d.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:9,top:6.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:24,top:93.75,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:76,top:6.25,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:91,top:93.75,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.508,top:50,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.492,top:50,id:"6"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:199,height:48},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(be,{x:"3",y:"3",width:"193",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(be,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(be,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ee,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24",strokeWidth:"2"})]})]}),ix=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M31 62C29.2204 62 27.3855 61.332 25.5927 59.9086C23.791 58.4782 22.0952 56.3316 20.6377 53.5381C19.1829 50.7496 18.0147 47.4106 17.214 43.7054C16.4137 40.0021 16 36.0237 16 32C16 27.9763 16.4137 23.9979 17.214 20.2946C18.0147 16.5895 19.1829 13.2504 20.6377 10.4619C22.0952 7.66841 23.791 5.52179 25.5927 4.09136C27.3855 2.66801 29.2204 2 31 2",strokeWidth:"2"})]})]}),lx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(z,{d:"M50.3827 20.3601C47.1902 21.7605 43.4002 22.8046 39.2752 23.4077C35.1519 24.0105 30.8103 24.1557 26.5584 23.8319C22.3057 23.508 18.2597 22.7238 14.7044 21.5418C11.1449 20.3584 8.19358 18.8149 6.03181 17.0454M6.02374 46.9613C8.18198 45.1925 11.129 43.6491 14.6841 42.465C18.2349 41.2824 22.2765 40.4968 26.5256 40.1707C30.774 39.8447 35.113 39.9871 39.2353 40.5866C43.3592 41.1864 47.15 42.2268 50.3455 43.6237",strokeLinecap:"round"})]})]}),cx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("compressor"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z",strokeLinecap:"round"})})]}),ax=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(De,{cx:"33",cy:"33",r:"14.5"})]})]}),ux=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M35 12.4V20.4"}),o.jsxRuntimeExports.jsx(z,{d:"M3 33H16"}),o.jsxRuntimeExports.jsx(z,{d:"M35 53.6V45.6"})]})]}),dx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M39 33C39 33.7879 38.8448 34.5681 38.5433 35.2961C38.2417 36.0241 37.7998 36.6855 37.2426 37.2426C36.6855 37.7998 36.0241 38.2417 35.2961 38.5433C34.5681 38.8448 33.7879 39 33 39C32.2121 39 31.4319 38.8448 30.7039 38.5433C29.9759 38.2417 29.3145 37.7998 28.7574 37.2426C28.2002 36.6855 27.7583 36.0241 27.4567 35.2961C27.1552 34.5681 27 33.7879 27 33C27 32.2121 27.1552 31.4319 27.4567 30.7039C27.7583 29.9759 28.2002 29.3145 28.7574 28.7574C29.3145 28.2002 29.9759 27.7583 30.7039 27.4567C31.4319 27.1552 32.2121 27 33 27C33.7879 27 34.5681 27.1552 35.2961 27.4567C36.0241 27.7583 36.6855 28.2002 37.2426 28.7574C37.7998 29.3145 38.2417 29.9759 38.5433 30.7039C38.8448 31.4319 39 32.2121 39 33L39 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M39 33H47"}),o.jsxRuntimeExports.jsx(z,{d:"M27 33H19"}),o.jsxRuntimeExports.jsx(z,{d:"M36 27.804L40 20.8758"}),o.jsxRuntimeExports.jsx(z,{d:"M30 27.804L26 20.8758"}),o.jsxRuntimeExports.jsx(z,{d:"M30 38.196L26 45.1242"}),o.jsxRuntimeExports.jsx(z,{d:"M36 38.196L40 45.1242"})]})]}),xx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M49.1214 16.2515C43.5325 21.3055 36.2463 24.0711 28.7115 23.9986C21.1766 23.9262 13.945 21.0209 8.45428 15.8604M8.4838 50.112C13.9718 44.968 21.1918 42.0733 28.7133 42.0014C36.2348 41.9295 43.5089 44.6858 49.0942 49.7239"})]})]}),px=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ye,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(z,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(z,{d:"M3 33H63"})]})]}),mx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:7.575,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:92.425,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(U,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(z,{d:"M16.5 2.5L16.5 66.5M2.5 34.5H30.5M2.5 18.9848H30.5M2.5 50.0152H30.5M5.3 66.5H27.7C29.2464 66.5 30.5 65.1976 30.5 63.5909V5.40909C30.5 3.80244 29.2464 2.5 27.7 2.5H5.3C3.7536 2.5 2.5 3.80245 2.5 5.40909V63.5909C2.5 65.1976 3.7536 66.5 5.3 66.5Z",strokeLinecap:"round"})})]}),fx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(z,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(z,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(z,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(z,{d:"M29.12 65.62L61 34.5"})]})]}),hx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(z,{d:"M30 2.5L30 66.5"}),o.jsxRuntimeExports.jsx(z,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(z,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 50H30"})]})]}),gx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(z,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(z,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(z,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5",strokeLinecap:"square"}),o.jsxRuntimeExports.jsx(Ee,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(Ee,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),jx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(z,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(z,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(z,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(z,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(z,{d:"M29.12 65.62L61 34.5"}),o.jsxRuntimeExports.jsx(z,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5"}),o.jsxRuntimeExports.jsx(Ee,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(Ee,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Ex=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("thruster"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:25.3,top:4.76,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:25.3,top:95.24,id:"4"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),o.jsxRuntimeExports.jsx(z,{d:"M78.5 37.5117V4.51172"}),o.jsxRuntimeExports.jsx(z,{d:"M40.5 11.5L76.0072 2.6232"}),o.jsxRuntimeExports.jsx(z,{d:"M40.5 30.5L76.0072 39.3768"}),o.jsxRuntimeExports.jsx(z,{d:"M75.6192 2.71597C75.9231 2.56695 76.2597 2.49745 76.5977 2.51399C76.9357 2.53052 77.264 2.63256 77.5518 2.81053C77.8397 2.98851 78.0776 3.23661 78.2435 3.53161C78.4093 3.82661 78.4975 4.15886 78.4999 4.49726"}),o.jsxRuntimeExports.jsx(z,{d:"M78.4994 37.5101C78.4914 37.8382 78.4028 38.1592 78.2414 38.445C78.0801 38.7307 77.8509 38.9723 77.574 39.1486C77.2972 39.3248 76.9813 39.4302 76.6541 39.4555C76.3269 39.4808 75.9986 39.4252 75.698 39.2936"})]})]}),yx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(z,{d:"M2.293 2.29297L29.9383 66.7986",strokeDasharray:"6 6"})]})]}),Sx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(ae,{...r,className:d.CSS(d.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(K,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(U,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(be,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(z,{d:"M31 34.5L2.30611 2.33992",strokeDasharray:"6 6"}),o.jsxRuntimeExports.jsx(z,{d:"M31 34.5L2.30611 66.6601",strokeDasharray:"6 6"})]})]}),I4=({aetherKey:e,sink:t})=>{const n=Te.useMemoDeepEqualProps({sink:t}),[,,s]=Q.use$1({aetherKey:e,type:I.Button.TYPE,schema:I.buttonStateZ,initialState:{trigger:0,sink:t}});return g.useEffect(()=>{s(i=>({...i,...n}))},[n]),{click:g.useCallback(()=>{s(i=>({...i,trigger:i.trigger+1}))},[s])}},z4=({aetherKey:e,source:t})=>{const n=Te.useMemoDeepEqualProps({source:t}),[,{enabled:s},r]=Q.use$1({aetherKey:e,type:I.Light.TYPE,schema:I.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>r(i=>({...i,...n})),[n,r]),{enabled:s}},$4="Schematic.Grid",D4=e=>{const n=qs(e).closest(".react-flow__pane");n!=null&&Z.triggerReflow(n)},Js=e=>{const t=({symbolKey:s,items:r,onLocationChange:i})=>{const l=`${s}.${$4}`,[c,a]=g.useState(!1),u=g.useCallback(({items:S})=>S.every(R=>R.type===l),[l]),x=Z.useSyncedRef(i),{startDrag:p,onDragEnd:m,...f}=xe.useDragAndDrop({type:l,canDrop:u,onDrop:g.useCallback(({items:S})=>S,[]),onDragOver:g.useCallback(S=>{a(u(S)),S.items.forEach(({key:R})=>x.current(R,e))},[])}),h=r.filter(S=>S.location===e),j=g.useCallback((S,R)=>p([{key:R,type:l}]),[p,l]);return o.jsxRuntimeExports.jsx(oe.Space,{direction:d.K.direction(e),className:d.CSS(d.CSS.BE("grid","item"),d.CSS.loc(e),d.CSS.dropRegion(!0),c&&d.CSS.B("dragging-over")),onDragLeave:()=>a(!1),empty:!0,...f,children:h.map(({element:S,key:R})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(S,{draggable:!0,onDragStart:w=>j(w,R),onDragEnd:m,style:{...S.props.style,cursor:"grab"}})},R))})};return({symbolKey:s,...r})=>{const{editable:i,items:l}=r,c=g.useRef(i);if(i!==c.current&&e==="top"&&(D4(s),c.current=i),i)return o.jsxRuntimeExports.jsx(t,{symbolKey:s,...r});const a=l.filter(u=>u.location===e);return a.length===0?null:o.jsxRuntimeExports.jsx(oe.Space,{direction:d.K.direction(e),className:d.CSS(d.CSS.BE("grid","item"),d.CSS.loc(e)),empty:!0,children:a.map(({element:u,key:x})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:u},x))})}},B4=Js("top"),O4=Js("left"),V4=Js("right"),F4=Js("bottom"),Zt=({editable:e,onRotate:t,children:n,...s})=>o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(B4,{editable:e,...s}),o.jsxRuntimeExports.jsx(O4,{editable:e,...s}),o.jsxRuntimeExports.jsx(V4,{editable:e,...s}),o.jsxRuntimeExports.jsx(F4,{editable:e,...s}),e&&o.jsxRuntimeExports.jsx(he.Icon,{className:d.CSS.BE("grid","rotate"),size:"small",variant:"filled",onClick:t,children:o.jsxRuntimeExports.jsx(Z.E4.Rotate,{})}),n]}),H4=({aetherKey:e,source:t,sink:n})=>{const s=Te.useMemoDeepEqualProps({source:t,sink:n}),[,{value:r},i]=Q.use$1({aetherKey:e,type:I.Setpoint.TYPE,schema:I.setpointStateZ,initialState:{trigger:0,value:0,...s}});return g.useEffect(()=>{i(c=>({...c,...s}))},[s,i]),{set:g.useCallback(c=>i(a=>({...a,trigger:a.trigger+1,command:c})),[i]),value:r}},Z4=({aetherKey:e,source:t,sink:n})=>{const s=Te.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:r,enabled:i},l]=Q.use$1({aetherKey:e,type:I.Toggle.TYPE,schema:I.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:r,enabled:i}},cn=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:r="top",direction:i,align:l,maxInlineSize:c}=e;return n==null||n.length===0?null:{key:"label",element:o.jsxRuntimeExports.jsx(Z.Editable,{className:d.CSS(d.CSS.BE("symbol","label"),d.CSS.dir(i)),level:s,value:n,onChange:a=>t==null?void 0:t({label:{...e,label:a}}),allowEmpty:!0,style:{textAlign:l,maxInlineSize:c}}),location:r}},Or=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:r,indicator:i,orientation:l="bottom"}=e;return{key:"control",element:o.jsxRuntimeExports.jsxs(oe.Space,{direction:d.g.swap(l),align:"center",className:d.CSS(d.CSS.B("control-state")),size:"small",children:[t&&n&&o.jsxRuntimeExports.jsx(Nc,{size:"small",...r}),t&&s&&o.jsxRuntimeExports.jsx(Ic,{...i})]}),location:l}},ve=e=>{const t=({symbolKey:n,control:s,source:r,sink:i,label:l,onChange:c,draggable:a,selected:u,orientation:x="left",...p})=>{const{enabled:m,triggered:f,toggle:h}=Z4({aetherKey:n,source:r,sink:i}),j=[],S=cn(l,c);S!=null&&j.push(S);const R=Or(s);return R!=null&&j.push(R),o.jsxRuntimeExports.jsx(Zt,{editable:u&&!a,symbolKey:n,items:j,onRotate:()=>c({orientation:d.K.rotate90(x)}),onLocationChange:(w,E)=>{w==="label"&&c({label:{...l,orientation:E}}),w==="control"&&c({control:{...s,orientation:E}})},children:o.jsxRuntimeExports.jsx(e,{enabled:m,triggered:f,onClick:h,orientation:x,...p})})};return t.displayName=e.displayName,t},me=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,draggable:l,position:c,orientation:a="left",...u})=>{const x=[],p=cn(s,r);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Zt,{items:x,editable:i&&!l,symbolKey:n,onRotate:()=>r({orientation:d.K.rotate90(a)}),onLocationChange:(m,f)=>{m==="label"&&r({label:{...s,orientation:f}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,...u})})};return t.displayName=e.displayName,t},ft=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,draggable:l,position:c,orientation:a="left",enabled:u=!1,clickable:x=!1,...p})=>{const m=[],f=cn(s,r);f!=null&&m.push(f);const h=()=>{x&&r({enabled:!u})};return o.jsxRuntimeExports.jsx(Zt,{items:m,editable:i&&!l,symbolKey:n,onRotate:()=>r({orientation:d.K.rotate90(a)}),onLocationChange:(j,S)=>{j==="label"&&r({label:{...s,orientation:S}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,enabled:u,onClick:h,...p})})};return t.displayName=e.displayName,t},Rx=ve(Yu),Cx=ve(Wu),bx=ve(Ku),wx=ve(Gu),vx=ve(Ju),kx=ve(rd),Mx=ve(ix),_x=ve(lx),Px=ve(wd),Lx=ve(vd),Nx=ve(kd),Tx=ve(_d),Ax=ve(Nd),Ix=ve(Td),zx=ve(Ad),$x=ve(Id),Dx=ve(zd),Bx=ve($d),Ox=ve(bd),Vx=ve(cx),Fx=ve(ax),Hx=ve(ux),Zx=ve(dx),Gx=ve(xx),Yx=ve(px),Wx=ve(nd),Kx=ve(Qu),qx=ve(ed),Xx=ve(td),Ux=me(fd),Jx=me(Ld),Qx=me(id),ep=me(cd),tp=me(ad),np=me(xd),sp=me(Xu),op=me(Uu),rp=me(hd),ip=ve(yd),lp=me(Bd),cp=me(dd),ap=me(Od),up=me(ld),dp=me(Zd),xp=me(Gd),pp=me(Md),mp=me(Yd),fp=me(Wd),hp=me(Kd),gp=me(qd),jp=me(Xd),Ep=me(Ud),yp=me(Jd),Sp=me(Qd),Rp=me(ex),Cp=me(tx),bp=me(nx),wp=me(sx),vp=me(ox),kp=me(rx),Mp=me(mx),_p=me(hx),Pp=me(fx),Lp=me(gx),Np=me(jx),Tp=me(Ex),Ap=me(yx),Ip=me(Sx),zp=ft(gd),$p=ft(qu),Dp=ft(Fd),Bp=ft(Hd),Op=ft(ud),Vp=ft(jd),Fp=ft(sd),Hp=ft(od),Zp=me(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Us,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),Gp=e=>o.jsxRuntimeExports.jsx(Us,{...e,dimensions:{width:25,height:50}}),Yp=me(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:r,dimensions:i})=>o.jsxRuntimeExports.jsx(Us,{onResize:l=>n({dimensions:l}),orientation:s,color:r,dimensions:i,boxBorderRadius:t,backgroundColor:e})),Wp=e=>o.jsxRuntimeExports.jsx(Us,{...e,dimensions:{width:25,height:50},borderRadius:0}),Kp=({label:e,symbolKey:t,orientation:n="left",control:s,units:r,source:i,sink:l,color:c,onChange:a,selected:u,draggable:x,size:p,disabled:m})=>{const{value:f,set:h}=H4({aetherKey:t,source:i,sink:l}),j=[],S=Or(s);S!=null&&j.push(S);const R=cn(e,a);return R!=null&&j.push(R),o.jsxRuntimeExports.jsx(Zt,{symbolKey:t,editable:u&&!x,onRotate:()=>a({orientation:d.K.rotate90(n)}),items:j,onLocationChange:(w,E)=>{w==="label"&&a({label:{...e,orientation:E}})},children:o.jsxRuntimeExports.jsx(Cd,{value:f,onChange:h,units:r,color:c,orientation:n,disabled:m,size:p})})},qp=({className:e,...t})=>o.jsxRuntimeExports.jsx(Cd,{value:12,onChange:()=>{},units:"mV",style:{width:120,transform:"scale(0.95)"},className:d.CSS(d.CSS.BM("setpoint","preview"),e),disabled:!0,...t,children:o.jsxRuntimeExports.jsx(Z.Text,{level:"p",children:"10.0"})}),Xp=({symbolKey:e,label:t,level:n="p",position:s,textColor:r,color:i,telem:l,units:c,onChange:a,inlineSize:u=70,selected:x,draggable:p,notation:m})=>{const f=qo.useTypography(n),h=(f.lineHeight+.5)*f.baseSize+2,{width:j}=Rr({aetherKey:e,color:r,level:n,box:d.Mo.construct(d.G.translateY({...s},1),{height:h,width:u}),telem:l,minWidth:u,notation:m}),S=[],R=cn(t,a);return R!=null&&S.push(R),o.jsxRuntimeExports.jsx(Zt,{editable:x&&!p,symbolKey:e,items:S,onLocationChange:(w,E)=>{w==="label"&&a({label:{...t,orientation:E}})},children:o.jsxRuntimeExports.jsx(Ed,{color:i,dimensions:{height:h,width:j},inlineSize:u,units:c,unitsLevel:le.downLevel(n)})})},Up=({color:e})=>o.jsxRuntimeExports.jsx(Ed,{color:e,dimensions:{width:60,height:25},units:"psi",children:o.jsxRuntimeExports.jsx(Z.Text,{level:"p",children:"50.00"})}),Jp=({symbolKey:e,label:t,orientation:n="left",sink:s,control:r,selected:i,draggable:l,onChange:c,...a})=>{const{click:u}=I4({aetherKey:e,sink:s}),x=[],p=Or(r);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Zt,{onRotate:()=>c({orientation:d.K.rotate90(n)}),editable:i&&!l,symbolKey:e,items:x,onLocationChange:(m,f)=>{m==="label"&&c({label:{...t,orientation:f}})},children:o.jsxRuntimeExports.jsx(Sd,{...t,onClick:u,orientation:n,...a})})},Qp=({label:e,...t})=>o.jsxRuntimeExports.jsx(Sd,{label:"Button",...t}),em=({symbolKey:e,label:t,source:n,onChange:s,selected:r,draggable:i,...l})=>{const{enabled:c}=z4({aetherKey:e,source:n}),a=[],u=cn(t,s);return u!=null&&a.push(u),o.jsxRuntimeExports.jsx(Zt,{items:a,editable:r&&!i,symbolKey:e,onLocationChange:(x,p)=>{x==="label"&&s({label:{...t,orientation:p}})},children:o.jsxRuntimeExports.jsx(Pd,{enabled:c,...l})})},tm=e=>o.jsxRuntimeExports.jsx(Rd,{...e,autoFit:!0,text:"Text Box"}),nm=({label:{label:e,level:t},orientation:n,color:s,onChange:r})=>o.jsxRuntimeExports.jsx(Dd,{onLabelChange:i=>r({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),sm=({label:e,...t})=>o.jsxRuntimeExports.jsx(Dd,{label:"Off Page",...t,orientation:"right"}),om=me(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Vd,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),rm=e=>o.jsxRuntimeExports.jsx(Vd,{...e,dimensions:{width:25,height:50}}),q=4,Vr=2,G4=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","ballValve","threeWayBallValve","gateValve","butterflyValveOne","butterflyValveTwo","breatherValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","flowmeterGeneral","flowmeterElectromagnetic","flowmeterVariableArea","flowmeterCoriolis","flowmeterNozzle","flowmeterVenturi","flowmeterRingPiston","flowmeterPositiveDisplacement","flowmeterTurbine","flowmeterPulse","flowmeterFloatSensor","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","crossJunction","heatExchangerGeneral","heatExchangerM","heatExchangerStraightTube","diaphragmPump","ejectionPump","compressor","turboCompressor","rollerVaneCompressor","liquidRingCompressor","ejectorCompressor","centrifugalCompressor","flameArrestor","flameArrestorDetonation","flameArrestorExplosion","flameArrestorFireRes","flameArrestorFireResDetonation","thruster","strainer","strainerCone"],Y4=ce.z.enum(G4),ue={orientation:"left",scale:1},W4={source:I.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:I.streamChannelValue({channel:0}),rollingAverage:I.rollingAverage({windowSize:1}),stringifier:I.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},K4={...ue,source:I.sourcePipeline("number",{connections:[],segments:{valueStream:I.streamChannelValue({channel:0})},outlet:"valueStream"})},q4={...ue,sink:I.sinkPipeline("number",{connections:[],segments:{setter:I.setChannelValue({channel:0})},inlet:"setter"})},im={...ue,source:I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:0}),threshold:I.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},lm={...ue,control:{show:!0},sink:I.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:I.setChannelValue({channel:0}),setpoint:I.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},ke={...im,...lm},Pt={...ue,enabled:!1,clickable:!1},W=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),X4={width:125,height:200},Fr={dimensions:X4},U4=3,J4={name:"Three Way Valve",key:"threeWayValve",Form:we,Symbol:Rx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Three Way Valve"),...ke}),Preview:Yu,zIndex:q},Q4={name:"Valve",key:"valve",Form:we,Symbol:Cx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Valve"),...ke}),Preview:Wu,zIndex:q},eS={name:"Solenoid Valve",key:"solenoidValve",Form:we,Symbol:bx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Solenoid Valve"),normallyOpen:!1,...ke}),Preview:Ku,zIndex:q},tS={name:"Four Way Valve",key:"fourWayValve",Form:we,Symbol:wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Four Way Valve"),...ke}),Preview:Gu,zIndex:q},nS={name:"Angled Valve",key:"angledValve",Form:we,Symbol:vx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Angled Valve"),...ke}),Preview:Ju,zIndex:q},sS={name:"Ball Valve",key:"ballValve",Form:we,Symbol:Kx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Ball Valve"),...ke}),Preview:Qu,zIndex:q},oS={name:"Three-Way Ball Valve",key:"threeWayBallValve",Form:we,Symbol:qx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Three-Way Ball Valve"),...ke}),Preview:ed,zIndex:q},rS={name:"Gate Valve",key:"gateValve",Form:we,Symbol:Xx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Gate Valve"),...ke}),Preview:td,zIndex:q},iS={name:"Butterfly Valve (Remote)",key:"butterflyValveOne",Form:we,Symbol:Wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Butterfly Valve (Remote)"),...ke}),Preview:nd,zIndex:q},lS={name:"Butterfly Valve (Manual)",key:"butterflyValveTwo",Form:_t,Symbol:Fp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Butterfly Valve (Manual)"),...Pt}),Preview:kt(sd,["clickable"]),zIndex:q},cS={name:"Breather Valve",key:"breatherValve",Form:_t,Symbol:Hp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Breather Valve"),...Pt}),Preview:kt(od,["clickable"]),zIndex:q},aS={name:"Pump",key:"pump",Form:we,Symbol:kx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Pump"),...ke}),Preview:rd,zIndex:q},uS={name:"Screw Pump",key:"screwPump",Form:we,Symbol:Ox,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Screw Pump"),...ke}),Preview:bd,zIndex:q},dS={name:"Tank",key:"tank",Form:Hu,Symbol:Zp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...W("Tank"),borderRadius:Br,...Fr,...ue}),Preview:Gp,zIndex:Vr},xS={name:"Cylinder",key:"cylinder",Form:v4,Symbol:om,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...W("cylinder"),dimensions:{width:66,height:181},...ue}),Preview:rm,zIndex:Vr},pS={name:"Box",key:"box",Form:k4,Symbol:Yp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...W("Box"),borderRadius:U4,...Fr,...ue}),Preview:Wp,zIndex:Vr},mS={name:"Relief Valve",key:"reliefValve",Form:_t,Symbol:$p,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Relief Valve"),...Pt}),Preview:kt(qu,["clickable"]),zIndex:q},fS={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:_t,Symbol:Dp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Spring Loaded Relief Valve"),...Pt}),Preview:kt(Fd,["clickable"]),zIndex:q},hS={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:_t,Symbol:Bp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Angled Spring Loaded Relief Valve"),...Pt}),Preview:kt(Hd,["clickable"]),zIndex:q},gS={name:"Regulator",key:"regulator",Form:ge,Symbol:Ux,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Regulator"),...ue}),Preview:fd,zIndex:q},jS={name:"Electric Regulator",key:"electricRegulator",Form:ge,Symbol:Jx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Electric Regulator"),...ue}),Preview:Ld,zIndex:q},ES={name:"Burst Disc",key:"burstDisc",Form:ge,Symbol:Qx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Burst Disc"),...ue}),Preview:id,zIndex:q},yS={name:"ISO Burst Disc",key:"isoBurstDisc",Form:ge,Symbol:up,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("ISO Burst Disc"),...ue}),Preview:ld,zIndex:q},SS={name:"Cap",key:"cap",Form:ge,Symbol:ep,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Cap"),...ue}),Preview:cd,zIndex:q},RS={name:"ISO Cap",key:"isoCap",Form:ge,Symbol:tp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("ISO Cap"),...ue}),Preview:ad,zIndex:q},CS={name:"Manual Valve",key:"manualValve",Form:_t,Symbol:Op,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Manual Valve"),...Pt}),Preview:kt(ud,["clickable"]),zIndex:q},bS={name:"Orifice Plate",key:"orificePlate",Form:ge,Symbol:cp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Orifice Plate"),...ue}),Preview:dd,zIndex:q},wS={name:"ISO Filter",key:"isoFilter",Form:ge,Symbol:ap,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("ISO Filter"),...ue}),Preview:Od,zIndex:q},vS={name:"Filter",key:"filter",Form:ge,Symbol:np,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Filter"),...ue}),Preview:xd,zIndex:q},kS={name:"Needle Valve",key:"needleValve",Form:_t,Symbol:zp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Needle Valve"),...Pt}),Preview:kt(gd,["clickable"]),zIndex:q},MS={name:"Check Valve",key:"checkValve",Form:ge,Symbol:sp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Check Valve"),...ue}),Preview:Xu,zIndex:q},_S={name:"Orifice",key:"orifice",Form:ge,Symbol:rp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Orifice"),...ue}),Preview:hd,zIndex:q},PS={name:"Angled Relief Valve",key:"angledReliefValve",Form:_t,Symbol:Vp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Angled Relief Valve"),...Pt}),Preview:kt(jd,["clickable"]),zIndex:q},LS={name:"Value",key:"value",Form:g4,Symbol:Xp,Preview:Up,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...W("Value"),...ue,telem:W4.source}),zIndex:q},NS={name:"Button",key:"button",Symbol:Jp,Form:S4,Preview:Qp,defaultProps:e=>({color:e.colors.primary.z.rgba255,...W("Button"),...lm,onClickDelay:0,scale:null}),zIndex:q},TS={name:"Switch",key:"switch",Symbol:ip,Form:M4,defaultProps:()=>({...W("Switch"),...ke,scale:null}),Preview:yd,zIndex:q},AS={name:"Vacuum Pump",key:"vacuumPump",Symbol:Px,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Vacuum Pump"),...ke}),Preview:wd,zIndex:q},IS={name:"Compressor",key:"compressor",Symbol:Vx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Compressor"),...ke}),Preview:cx,zIndex:q},zS={name:"Cavity Pump",key:"cavityPump",Symbol:Lx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Cavity Pump"),...ke}),Preview:vd,zIndex:q},$S={name:"Piston Pump",key:"pistonPump",Symbol:Nx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Piston Pump"),...ke}),Preview:kd,zIndex:q},DS={name:"Static Mixer",key:"staticMixer",Symbol:pp,Form:ge,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Static Mixer"),...ue}),Preview:Md,zIndex:q},BS={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Tx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Rotary Mixer"),...ke}),Preview:_d,zIndex:q},OS={name:"Light",key:"light",Symbol:em,Form:E4,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Light"),...im}),Preview:Pd,zIndex:q},VS={name:"Setpoint",key:"setpoint",Symbol:Kp,Form:C4,defaultProps:e=>({units:"mV",color:e.colors.gray.l9.rgba255,size:"small",...W("Setpoint"),...K4,...q4}),Preview:qp,zIndex:q},FS={name:"Agitator",key:"agitator",Symbol:Ax,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Agitator"),...ke}),Preview:Nd,zIndex:q},HS={name:"Propeller Agitator",key:"propellerAgitator",Symbol:Ix,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Propeller Agitator"),...ke}),Preview:Td,zIndex:q},ZS={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:zx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flat Blade Agitator"),...ke}),Preview:Ad,zIndex:q},GS={name:"Paddle Agitator",key:"paddleAgitator",Symbol:$x,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Paddle Agitator"),...ke}),Preview:Id,zIndex:q},YS={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Dx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Cross Beam Agitator"),...ke}),Preview:zd,zIndex:q},WS={name:"Helical Agitator",key:"helicalAgitator",Symbol:Bx,Form:we,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Helical Agitator"),...ke}),Preview:$d,zIndex:q},KS={name:"Text Box",key:"textBox",Symbol:Rd,Form:b4,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...W("Text Box"),...ue,...Fr,level:"p",text:"Text Box",width:75}),Preview:tm,zIndex:q},qS={name:"Off Page Reference",key:"offPageReference",Form:w4,Symbol:nm,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...W("Off Page Reference")}),Preview:sm,zIndex:q},XS={name:"ISO Check Valve",key:"isoCheckValve",Form:ge,Symbol:op,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("ISO Check Valve"),...ue}),Preview:Uu,zIndex:q},US={name:"Vent",key:"vent",Form:ge,Symbol:lp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Vent"),...ue}),Preview:Bd,zIndex:q},JS={name:"T Junction",key:"tJunction",Form:ge,Symbol:dp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W(""),...ue}),Preview:Zd,zIndex:q+20},QS={name:"Cross Junction",key:"crossJunction",Form:ge,Symbol:xp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W(""),...ue}),Preview:Gd,zIndex:q+20},eR={name:"Flowmeter General",key:"flowmeterGeneral",Form:ge,Symbol:mp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("General Flowmeter"),...ue}),Preview:Yd,zIndex:q},tR={name:"Flowmeter Electromagnetic",key:"flowmeterElectromagnetic",Form:ge,Symbol:fp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Electromagnetic Flowmeter"),...ue}),Preview:Wd,zIndex:q},nR={name:"Flowmeter Variable Area",key:"flowmeterVariableArea",Form:ge,Symbol:hp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Variable Area Flowmeter"),...ue}),Preview:Kd,zIndex:q},sR={name:"Flowmeter Coriolis",key:"flowmeterCoriolis",Form:ge,Symbol:gp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Coriolis Flowmeter"),...ue}),Preview:qd,zIndex:q},oR={name:"Flowmeter Nozzle",key:"flowmeterNozzle",Form:ge,Symbol:jp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Nozzle Flowmeter"),...ue}),Preview:Xd,zIndex:q},rR={name:"Flowmeter Venturi",key:"flowmeterVenturi",Form:ge,Symbol:Ep,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Venturi Flowmeter"),...ue}),Preview:Ud,zIndex:q},iR={name:"Flowmeter Ring Piston",key:"flowmeterRingPiston",Form:ge,Symbol:yp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Ring Piston Flowmeter"),...ue}),Preview:Jd,zIndex:q},lR={name:"Flowmeter Positive Displacement",key:"flowmeterPositiveDisplacement",Form:ge,Symbol:Sp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Positive Displacement Flowmeter"),...ue}),Preview:Qd,zIndex:q},cR={name:"Flowmeter Turbine",key:"flowmeterTurbine",Form:ge,Symbol:Rp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Turbine Flowmeter"),...ue}),Preview:ex,zIndex:q},aR={name:"Flowmeter Pulse",key:"flowmeterPulse",Form:ge,Symbol:Cp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Pulse Flowmeter"),...ue}),Preview:tx,zIndex:q},uR={name:"Flowmeter Float Sensor",key:"flowmeterFloatSensor",Form:ge,Symbol:bp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Float Sensor Flowmeter"),...ue}),Preview:nx,zIndex:q},dR={name:"Heat Exchanger General",key:"heatExchangerGeneral",Form:ge,Symbol:wp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("General Heat Exchanger"),...ue}),Preview:sx,zIndex:q},xR={name:"Heat Exchanger M",key:"heatExchangerM",Form:ge,Symbol:vp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("M Heat Exchanger"),...ue}),Preview:ox,zIndex:q},pR={name:"Heat Exchanger Straight Tube",key:"heatExchangerStraightTube",Form:ge,Symbol:kp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Straight Tube Heat Exchanger"),...ue}),Preview:rx,zIndex:q},mR={name:"Turbo Compressor",key:"turboCompressor",Form:we,Symbol:Fx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Turbo Compressor"),...ke}),Preview:ax,zIndex:q},fR={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:we,Symbol:Hx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Roller Vane Compressor"),...ke}),Preview:ux,zIndex:q},hR={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:we,Symbol:Zx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Liquid Ring Compressor"),...ke}),Preview:dx,zIndex:q},gR={name:"Ejector Compressor",key:"ejectorCompressor",Form:we,Symbol:Gx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Ejector Compressor"),...ke}),Preview:xx,zIndex:q},jR={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:we,Symbol:Yx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Centrifugal Compressor"),...ke}),Preview:px,zIndex:q},ER={name:"Diaphragm Pump",key:"diaphragmPump",Form:we,Symbol:Mx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Diaphragm Pump"),...ke}),Preview:ix,zIndex:q},yR={name:"Ejection Pump",key:"ejectionPump",Form:we,Symbol:_x,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Ejection Pump"),...ke}),Preview:lx,zIndex:q},SR={name:"Flame Arrestor",key:"flameArrestor",Form:ge,Symbol:Mp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flame Arrestor"),...ue}),Preview:mx,zIndex:q},RR={name:"Flame Arrestor (Explosion-Proof)",key:"flameArrestorExplosion",Form:ge,Symbol:_p,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flame Arrestor (Explosion-Proof)"),...ue}),Preview:hx,zIndex:q},CR={name:"Flame Arrestor (Detonation-Proof)",key:"flameArrestorDetonation",Form:ge,Symbol:Pp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flame Arrestor (Detonation-Proof)"),...ue}),Preview:fx,zIndex:q},bR={name:"Flame Arrestor (Fire Resistant)",key:"flameArrestorFireRes",Form:ge,Symbol:Lp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flame Arrestor (Fire Resistant)"),...ue}),Preview:gx,zIndex:q},wR={name:"Flame Arrestor (Fire Resistant and Detonation-Proof)",key:"flameArrestorFireResDetonation",Form:ge,Symbol:Np,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...ue}),Preview:jx,zIndex:q},vR={name:"Thruster",key:"thruster",Form:we,Symbol:Tp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Thruster"),...ke}),Preview:Ex,zIndex:q},kR={name:"Strainer",key:"strainer",Form:ge,Symbol:Ap,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Strainer"),...ue}),Preview:yx,zIndex:q},MR={name:"Strainer Cone",key:"strainerCone",Form:ge,Symbol:Ip,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...W("Strainer Cone"),...ue}),Preview:Sx,zIndex:q},_R={value:LS,button:NS,tank:dS,tJunction:JS,crossJunction:QS,switch:TS,offPageReference:qS,light:OS,setpoint:VS,box:pS,textBox:KS,valve:Q4,solenoidValve:eS,threeWayValve:J4,fourWayValve:tS,angledValve:nS,ballValve:sS,threeWayBallValve:oS,gateValve:rS,butterflyValveOne:iS,butterflyValveTwo:lS,breatherValve:cS,manualValve:CS,needleValve:kS,reliefValve:mS,angledReliefValve:PS,checkValve:MS,regulator:gS,electricRegulator:jS,springLoadedReliefValve:fS,angledSpringLoadedReliefValve:hS,pump:aS,pistonPump:$S,screwPump:uS,cavityPump:zS,diaphragmPump:ER,ejectionPump:yR,vacuumPump:AS,compressor:IS,turboCompressor:mR,rollerVaneCompressor:fR,liquidRingCompressor:hR,ejectorCompressor:gR,centrifugalCompressor:jR,staticMixer:DS,rotaryMixer:BS,burstDisc:ES,isoBurstDisc:yS,cap:SS,isoCap:RS,filter:vS,isoFilter:wS,orifice:_S,orificePlate:bS,agitator:FS,propellerAgitator:HS,flatBladeAgitator:ZS,paddleAgitator:GS,crossBeamAgitator:YS,helicalAgitator:WS,isoCheckValve:XS,vent:US,cylinder:xS,flowmeterGeneral:eR,flowmeterElectromagnetic:tR,flowmeterVariableArea:nR,flowmeterCoriolis:sR,flowmeterNozzle:oR,flowmeterVenturi:rR,flowmeterRingPiston:iR,flowmeterPositiveDisplacement:lR,flowmeterTurbine:cR,flowmeterPulse:aR,flowmeterFloatSensor:uR,heatExchangerGeneral:dR,heatExchangerM:xR,heatExchangerStraightTube:pR,flameArrestor:SR,flameArrestorExplosion:RR,flameArrestorDetonation:CR,flameArrestorFireRes:bR,flameArrestorFireResDetonation:wR,thruster:vR,strainer:kR,strainerCone:MR},PR=Object.freeze(Object.defineProperty({__proto__:null,Agitator:Ax,AngledReliefValve:Vp,AngledSpringLoadedReliefValve:Bp,AngledValve:vx,BallValve:Kx,Box:Yp,BoxPreview:Wp,BreatherValve:Hp,BurstDisc:Qx,ButterflyValveOne:Wx,ButterflyValveTwo:Fp,Button:Jp,ButtonPreview:Qp,Cap:ep,CavityPump:Lx,CentrifugalCompressor:Yx,CheckValve:sp,Compressor:Vx,CrossBeamAgitator:Dx,CrossJunction:xp,Cylinder:om,CylinderPreview:rm,DiaphragmPump:Mx,EjectionPump:_x,EjectorCompressor:Gx,ElectricRegulator:Jx,Filter:np,FlameArrestor:Mp,FlameArrestorDetonation:Pp,FlameArrestorExplosion:_p,FlameArrestorFireRes:Lp,FlameArrestorFireResDetonation:Np,FlatBladeAgitator:zx,FlowmeterCoriolis:gp,FlowmeterElectromagnetic:fp,FlowmeterFloatSensor:bp,FlowmeterGeneral:mp,FlowmeterNozzle:jp,FlowmeterPositiveDisplacement:Sp,FlowmeterPulse:Cp,FlowmeterRingPiston:yp,FlowmeterTurbine:Rp,FlowmeterVariableArea:hp,FlowmeterVenturi:Ep,FourWayValve:wx,GateValve:Xx,HeatExchangerGeneral:wp,HeatExchangerM:vp,HeatExchangerStraightTube:kp,HelicalAgitator:Bx,ISOBurstDisc:up,ISOCap:tp,ISOCheckValve:op,ISOFilter:ap,Light:em,LiquidRingCompressor:Zx,ManualValve:Op,NeedleValve:zp,OffPageReference:nm,OffPageReferencePreview:sm,Orifice:rp,OrificePlate:cp,PaddleAgitator:$x,PistonPump:Nx,PropellerAgitator:Ix,Pump:kx,Regulator:Ux,ReliefValve:$p,RollerVaneCompressor:Hx,RotaryMixer:Tx,SYMBOLS:_R,ScrewPump:Ox,Setpoint:Kp,SetpointPreview:qp,SolenoidValve:bx,SpringLoadedReliefValve:Dp,StaticMixer:pp,Strainer:Ap,StrainerCone:Ip,Switch:ip,TJunction:dp,Tank:Zp,TankPreview:Gp,TextBoxPreview:tm,ThreeWayBallValve:qx,ThreeWayValve:Rx,Thruster:Tp,TurboCompressor:Fx,VacuumPump:Px,Value:Xp,ValuePreview:Up,Valve:Cx,Vent:lp,createDummyToggle:ft,createLabeled:me,createToggle:ve,variantZ:Y4},Symbol.toStringTag,{value:"Module"}));exports.useCombinedRefs=Z.useCombinedRefs;exports.useCombinedStateAndRef=Z.useCombinedStateAndRef;exports.useInitializerRef=Z.useInitializerRef;exports.usePrevious=Z.usePrevious;exports.useStateRef=Z.useStateRef;exports.useSyncedRef=Z.useSyncedRef;exports.CSS=d.CSS;exports.newBEM=d.newBEM;exports.Header=Jn.external;exports.DataType=le.g$1;exports.Density=le.b;exports.MultiSeries=le.Lt;exports.Rate=le.$;exports.Series=le.Z;exports.TimeRange=le.U;exports.TimeSpan=le.y$1;exports.TimeStamp=le.m;exports.state=le.state;exports.Generic=xf.Generic;exports.Input=je.external;exports.preventDefault=je.preventDefault;exports.stopPropagation=je.stopPropagation;exports.Aether=Q.main;exports.Worker=Q.Context;exports.useAsyncEffect=Q.useAsyncEffect;exports.useEffectCompare=Q.useEffectCompare;exports.Align=mf.external;exports.Icon=Ne.Icon;exports.Tabs=Ne.external;exports.Text=jl.external;exports.Divider=vs.Divider$1;exports.Button=ff.external;exports.Caret=Nn.Animated$1;exports.Tree=Nn.external;exports.componentRenderProp=he.componentRenderProp;exports.isRenderProp=he.isRenderProp;exports.useTransforms=Re.useTransforms;exports.telem=I.external;exports.Haul=xe.Haul;exports.compareArrayDeps=Te.compareArrayDeps;exports.useMemoCompare=Te.useMemoCompare;exports.useMemoDeepEqualProps=Te.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=Te.useMemoPrimitiveArray;exports.Dialog=Ye.use$1;exports.Dropdown=Ye.Dropdown;exports.useResize=Ye.useResize;exports.Color=We.external;exports.Triggers=El.external;exports.List=bt.external;exports.createFilterTransform=bt.createFilterTransform;exports.fuseFilter=bt.fuseFilter;exports.proxyMemo=bt.proxyMemo;exports.createHexOpacityVariants=yl.createHexOpacityVariants;exports.unitProperty=yl.unitProperty;exports.useClickOutside=Sl.useClickOutside;exports.useDebouncedCallback=Uo.useDebouncedCallback;exports.Menu=gf.external;exports.Theming=jf.external;exports.Video=Ef.Video;exports.Accordion=zf;exports.Breadcrumb=Bf;exports.Canvas=uh;exports.Channel=pg;exports.Control=R1;exports.Device=Lg;exports.Diagram=x4;exports.Eraser=Zf;exports.Form=Mg;exports.Label=Og;exports.Legend=fh;exports.Line=gh;exports.LinePlot=Jh;exports.Log=m4;exports.Measure=ng;exports.Modal=Fg;exports.Mosaic=r1;exports.Nav=Wf;exports.Note=l1;exports.OS=x1;exports.Observe=vg;exports.Override=m1;exports.Pluto=v1;exports.Portal=Ug;exports.Progress=M1;exports.Rack=Ag;exports.Range=eg;exports.Ranger=I1;exports.Resize=Mf;exports.Rule=sg;exports.Schematic=PR;exports.Select=Bh;exports.Status=Ff;exports.Steps=$1;exports.Synnax=Xf;exports.Table=F1;exports.TableCells=i0;exports.Tag=Th;exports.Telem=g1;exports.Tooltip=Sf;exports.Value=Y1;exports.Viewport=Xh;exports.axis=ih;exports.control=j1;exports.useDelayedState=yf;
|