@synnaxlabs/pluto 0.36.0 → 0.37.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.
Files changed (141) hide show
  1. package/dist/{Animated-BAoBw9cC.cjs → Animated-BOjwPkTJ.cjs} +1 -1
  2. package/dist/{Animated-DkZIfEYP.js → Animated-ByIJT_wA.js} +2 -2
  3. package/dist/{Item-BjErngVu.cjs → Item-Bamd13Tl.cjs} +1 -1
  4. package/dist/{Item-C7Q_zqsK.js → Item-CQ2ZuDfi.js} +8 -8
  5. package/dist/{LinePlot-rWkRDg70.js → LinePlot-Ci-61YDW.js} +116 -122
  6. package/dist/LinePlot-D4V1ltNT.cjs +24 -0
  7. package/dist/{Link-DIP4E5h4.cjs → Link-Cm6yn4zC.cjs} +1 -1
  8. package/dist/{Link-DkPbZ9Vw.js → Link-ZlOdu4jA.js} +1 -1
  9. package/dist/{Pack-ClLR2ywa.cjs → Pack-CyaEXvnu.cjs} +1 -1
  10. package/dist/{Pack-D8EcIVa2.js → Pack-DNCFnyuR.js} +1 -1
  11. package/dist/{Toggle-CZlnDV1Y.js → Toggle-DlYB4nmh.js} +10838 -10799
  12. package/dist/{Toggle-Dwz8HiqJ.cjs → Toggle-vgmhy8wZ.cjs} +56 -56
  13. package/dist/{Video-xr1Ey5qV.cjs → Video-g30B90s-.cjs} +1 -1
  14. package/dist/{Video-CI9sBV9l.js → Video-jaT7Y97L.js} +1 -1
  15. package/dist/{aggregator-D6gAHK4j.js → aggregator-CWsCIyed.js} +1276 -1258
  16. package/dist/aggregator-DX8ts24k.cjs +77 -0
  17. package/dist/align.cjs +1 -1
  18. package/dist/align.js +1 -1
  19. package/dist/button.cjs +1 -1
  20. package/dist/button.js +1 -1
  21. package/dist/color.cjs +1 -1
  22. package/dist/color.js +1 -1
  23. package/dist/css-Bo-hsQHb.cjs +1 -0
  24. package/dist/{css-DnIb4t_E.js → css-Csw1Dn4s.js} +449 -446
  25. package/dist/css.cjs +1 -1
  26. package/dist/css.js +2 -2
  27. package/dist/dropdown.cjs +1 -1
  28. package/dist/dropdown.js +1 -1
  29. package/dist/ether.cjs +1 -1
  30. package/dist/ether.js +5 -5
  31. package/dist/{external-CetHCRLx.js → external-2PznkZYs.js} +36 -36
  32. package/dist/{external-BxiJID8F.js → external-4ikhWnyq.js} +2 -2
  33. package/dist/{external-CIm5lpCQ.cjs → external-BS9Bfsj3.cjs} +1 -1
  34. package/dist/{external-wgG3P6Dp.js → external-BTnFzhMM.js} +1 -1
  35. package/dist/{external-BeoanEV1.js → external-BpeQ9rNJ.js} +144 -133
  36. package/dist/external-Bt_kX5KM.cjs +1 -0
  37. package/dist/{external-C-tizEE4.js → external-CEcxrva2.js} +5 -5
  38. package/dist/{external-AQutxNrw.cjs → external-CMEDU76u.cjs} +1 -1
  39. package/dist/{external-Lmd8cJhx.cjs → external-CWincA61.cjs} +1 -1
  40. package/dist/{external-Czhk9fZS.cjs → external-C_th4MW9.cjs} +1 -1
  41. package/dist/{external-BX17kwZc.cjs → external-CyPQsB1T.cjs} +1 -1
  42. package/dist/{external-BpqHq8f8.js → external-CyYaJ5TW.js} +4 -4
  43. package/dist/{external-6FH5NjXf.js → external-DIwKYTmY.js} +2 -2
  44. package/dist/{external-feiUnuJI.js → external-DXD4PtTK.js} +2 -2
  45. package/dist/{external-xPdBJlsz.js → external-Dn4tpDVi.js} +2 -2
  46. package/dist/{external-CXQMoMS3.cjs → external-DsJYjdNk.cjs} +1 -1
  47. package/dist/{external-bByVUOOg.cjs → external-Dtr4ZxR6.cjs} +1 -1
  48. package/dist/{external-8w5Eg-ce.cjs → external-IztUjYjX.cjs} +1 -1
  49. package/dist/{external-DAn-_GLc.cjs → external-VEFOprRU.cjs} +1 -1
  50. package/dist/{external-CFaZ_vCi.js → external-WZW4OBZx.js} +4 -4
  51. package/dist/{external-Cy8UF9vk.cjs → external-kAduhcvp.cjs} +1 -1
  52. package/dist/{external-BDzzt6lF.js → external-rGv5AzBK.js} +12 -12
  53. package/dist/{external-DlCfhkx8.cjs → external-vMTeF1dc.cjs} +1 -1
  54. package/dist/{external-Ckaptp3S.js → external-vYsKqfFS.js} +4 -4
  55. package/dist/header.cjs +1 -1
  56. package/dist/header.js +1 -1
  57. package/dist/index.cjs +7 -7
  58. package/dist/index.js +9819 -7530
  59. package/dist/input.cjs +1 -1
  60. package/dist/input.js +1 -1
  61. package/dist/list.cjs +1 -1
  62. package/dist/list.js +1 -1
  63. package/dist/menu.cjs +1 -1
  64. package/dist/menu.js +1 -1
  65. package/dist/pluto.css +1 -1
  66. package/dist/src/breadcrumb/Breadcrumb.d.ts +2 -1
  67. package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
  68. package/dist/src/breadcrumb/Breadcrumb.spec.d.ts +2 -0
  69. package/dist/src/breadcrumb/Breadcrumb.spec.d.ts.map +1 -0
  70. package/dist/src/color/core/color.d.ts +4 -0
  71. package/dist/src/color/core/color.d.ts.map +1 -1
  72. package/dist/src/haul/Haul.d.ts.map +1 -1
  73. package/dist/src/index.d.ts +1 -0
  74. package/dist/src/index.d.ts.map +1 -1
  75. package/dist/src/input/DateTime.d.ts.map +1 -1
  76. package/dist/src/input/Numeric.d.ts.map +1 -1
  77. package/dist/src/input/Text.d.ts +1 -0
  78. package/dist/src/input/Text.d.ts.map +1 -1
  79. package/dist/src/modal/Modal.d.ts.map +1 -1
  80. package/dist/src/pluto/Pluto.d.ts +1 -4
  81. package/dist/src/pluto/Pluto.d.ts.map +1 -1
  82. package/dist/src/select/ComponentSize.d.ts +12 -0
  83. package/dist/src/select/ComponentSize.d.ts.map +1 -0
  84. package/dist/src/select/DataType.d.ts +3 -2
  85. package/dist/src/select/DataType.d.ts.map +1 -1
  86. package/dist/src/select/external.d.ts +1 -0
  87. package/dist/src/select/external.d.ts.map +1 -1
  88. package/dist/src/table/aether/Table.d.ts.map +1 -1
  89. package/dist/src/table/cells/Cells.d.ts.map +1 -1
  90. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  91. package/dist/src/text/Editable.d.ts +2 -1
  92. package/dist/src/text/Editable.d.ts.map +1 -1
  93. package/dist/src/text/Keyboard.d.ts.map +1 -1
  94. package/dist/src/theming/Provider.d.ts.map +1 -1
  95. package/dist/src/tree/Tree.d.ts +2 -2
  96. package/dist/src/tree/Tree.d.ts.map +1 -1
  97. package/dist/src/tree/core.d.ts +5 -2
  98. package/dist/src/tree/core.d.ts.map +1 -1
  99. package/dist/src/util/canDisable.d.ts +10 -0
  100. package/dist/src/util/canDisable.d.ts.map +1 -0
  101. package/dist/src/util/removeProps.d.ts +26 -0
  102. package/dist/src/util/removeProps.d.ts.map +1 -0
  103. package/dist/src/util/removeProps.spec.d.ts +2 -0
  104. package/dist/src/util/removeProps.spec.d.ts.map +1 -0
  105. package/dist/src/vis/canvas/aether/canvas.d.ts +4 -4
  106. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  107. package/dist/src/vis/rule/Rule.d.ts +1 -0
  108. package/dist/src/vis/rule/Rule.d.ts.map +1 -1
  109. package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
  110. package/dist/src/vis/schematic/Forms.d.ts +9 -2
  111. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  112. package/dist/src/vis/schematic/SelectOrientation.d.ts +3 -3
  113. package/dist/src/vis/schematic/SelectOrientation.d.ts.map +1 -1
  114. package/dist/src/vis/schematic/Symbols.d.ts +183 -3
  115. package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
  116. package/dist/src/vis/schematic/primitives/Primitives.d.ts +115 -6
  117. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  118. package/dist/src/vis/schematic/registry.d.ts +1 -1
  119. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  120. package/dist/src/vis/setpoint/aether/setpoint.d.ts +1 -1
  121. package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -1
  122. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  123. package/dist/tabs.cjs +1 -1
  124. package/dist/tabs.js +1 -1
  125. package/dist/text.cjs +1 -1
  126. package/dist/text.js +2 -2
  127. package/dist/theming.cjs +1 -1
  128. package/dist/theming.js +2 -2
  129. package/dist/tree.cjs +1 -1
  130. package/dist/tree.js +1 -1
  131. package/dist/triggers.cjs +1 -1
  132. package/dist/triggers.js +1 -1
  133. package/dist/{units-CKQQRvyD.js → units-CJ76Jzvw.js} +1 -1
  134. package/dist/{units-YvMXZR11.cjs → units-CXFC0OLO.cjs} +1 -1
  135. package/dist/video.cjs +1 -1
  136. package/dist/video.js +1 -1
  137. package/package.json +14 -14
  138. package/dist/LinePlot-CQN3l2Pu.cjs +0 -24
  139. package/dist/aggregator-q3hNa4qv.cjs +0 -77
  140. package/dist/css-C3zWKgOb.cjs +0 -1
  141. package/dist/external-DtsEr2ls.cjs +0 -1
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Kx=Object.defineProperty;var qx=(e,t,n)=>t in e?Kx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fe=(e,t,n)=>qx(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./jsx-runtime-DGh1k5sI.cjs"),g=require("react"),j=require("./Toggle-Dwz8HiqJ.cjs"),p=require("./css-C3zWKgOb.cjs"),$n=require("./external-Czhk9fZS.cjs"),H=require("./aggregator-q3hNa4qv.cjs"),J=require("./Pack-ClLR2ywa.cjs"),Ux=require("./external-Lmd8cJhx.cjs"),Ee=require("./external-8w5Eg-ce.cjs"),Qx=require("./external-DlCfhkx8.cjs"),$i=require("./Animated-BAoBw9cC.cjs"),I=require("./LinePlot-CQN3l2Pu.cjs"),re=require("zod"),Re=require("./external-bByVUOOg.cjs"),Ii=require("./external-BX17kwZc.cjs");require("./Item-BjErngVu.cjs");const wo=require("react-dom"),Vt=require("./external-AQutxNrw.cjs"),Jx=require("./external-CIm5lpCQ.cjs"),Di=require("./units-YvMXZR11.cjs"),Me=require("./external-Cy8UF9vk.cjs"),ep=require("./external-CXQMoMS3.cjs"),tp=require("./external-DAn-_GLc.cjs"),np=require("./external-DtsEr2ls.cjs"),sp=require("./Video-xr1Ey5qV.cjs"),op=(e,t,n=150)=>{const[s,o]=g.useState(e);return g.useEffect(()=>{const r=setTimeout(()=>o(t),n);return()=>clearTimeout(r)},[t,n]),s},rp=Object.freeze(Object.defineProperty({__proto__:null,Core:j.Core$1,Multiple:j.Multiple,Single:j.Single,calculateDiffPercentage:j.calculateDiffPercentage,useMultiple:j.useMultiple},Symbol.toStringTag,{value:"Module"})),ip=Object.freeze(Object.defineProperty({__proto__:null,Bar:j.Bar,Drawer:j.Drawer,useDrawer:j.useDrawer},Symbol.toStringTag,{value:"Module"})),Oi=({variant:e="info",...t})=>i.jsxRuntimeExports.jsx(j.xt.Circle,{color:j.variantColors[e],...t}),lp=({status:{key:e,time:t,count:n,message:s,description:o,variant:r},silence:l,actions:c,className:a,children:u,...d})=>i.jsxRuntimeExports.jsxs(J.Space,{className:p.CSS(p.CSS.B("notification"),a),direction:"y",empty:!0,...d,children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(Oi,{style:{height:"2.25rem",width:"2.5rem"},variant:r}),i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",shade:7,children:`x${n}`}),i.jsxRuntimeExports.jsx(j.DateTime,{className:p.CSS(p.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),i.jsxRuntimeExports.jsx(j.Icon,{className:p.CSS(p.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:i.jsxRuntimeExports.jsx(j.xt.Close,{})})]}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",align:"start",className:p.CSS(p.CSS.BE("notification","content")),size:"small",children:[u??i.jsxRuntimeExports.jsx(j.Text$1,{className:p.CSS(p.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),o!=null&&i.jsxRuntimeExports.jsx(j.Text$1,{className:p.CSS(p.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),c!=null&&i.jsxRuntimeExports.jsx(J.Space,{direction:"x",align:"center",justify:"end",className:p.CSS(p.CSS.BE("notification","actions")),children:H.A(c).map(x=>i.jsxRuntimeExports.jsx(cp,{action:x},x.key))})]},t.toString()),cp=({action:e})=>{if(!g.isValidElement(e)){const t=e;return i.jsxRuntimeExports.jsx(j.Button,{...t})}return e},ap=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:j.Aggregator,Circle:Oi,Notification:lp,Text:j.Text$3,VARIANTS:H.VARIANTS,specZ:H.specZ$1,useAggregator:j.useAggregator,useContext:j.useContext$3,useNotifications:j.useNotifications,variantZ:H.variantZ},Symbol.toStringTag,{value:"Module"})),up=Object.freeze(Object.defineProperty({__proto__:null,Config:j.Config,Context:j.Context,Dialog:j.Dialog$1,chooseLocation:j.chooseLocation,formatTip:j.formatTip,useConfig:j.useConfig,wrap:j.wrap},Symbol.toStringTag,{value:"Module"})),In="y",gr=28,dp=32,xp=40,pp=.5,fp=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:o,...r}}=j.useMultiple({direction:In,count:e.length,minSize:gr}),l=c=>{if(o.current==null)return;const a=p.Eo.dim(p.Eo.construct(o.current),In);s[c]<xp/a?n(c,e[c].initialSize??pp):n(c,gr+1)};return i.jsxRuntimeExports.jsx(j.Multiple,{empty:!0,className:p.CSS.B("accordion"),sizeDistribution:s,ref:o,...t,...r,children:e.map((c,a)=>g.createElement(gp,{...c,key:c.key,index:a,direction:In,onExpand:l,parent:o,size:s[a]}))})},mp=i.jsxRuntimeExports.jsx(j.xt.Caret.Down,{"aria-label":"contract"}),hp=i.jsxRuntimeExports.jsx(j.xt.Caret.Right,{"aria-label":"expand"}),gp=({index:e,name:t,content:n,actions:s,size:o,parent:r,onExpand:l})=>{let c=!0;if(r.current!=null){const u=p.Eo.dim(p.Eo.construct(r.current),In);c=o*u>dp}const a=c?mp:hp;return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs($n.Header,{level:"p",className:p.CSS.expanded(c),empty:!0,children:[i.jsxRuntimeExports.jsx($n.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&i.jsxRuntimeExports.jsx($n.Actions,{children:s})]}),n]})},jp=Object.freeze(Object.defineProperty({__proto__:null,Accordion:fp},Symbol.toStringTag,{value:"Module"})),yp=(e,t)=>H.A(e).map(s=>typeof s=="string"?s.split(t).map(o=>({label:o})):s).flat(),zi=({segments:e,shade:t,level:n,weight:s,separator:o,transform:r})=>{let c=yp(e,o);return r!=null&&(c=c.map(r)),c.map((a,u)=>{const d=[i.jsxRuntimeExports.jsx(j.xt.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:p.CSS.shade(t)}},`${a}-${u}`)];if(a.icon!=null){const x=Ee.resolve(a.icon);x!=null&&d.push(x)}return d.push(i.jsxRuntimeExports.jsx(j.Text$1,{style:{marginLeft:a.icon!=null?"0.5rem":"0"},weight:s,shade:t,level:n,...a,children:a.label},a.label)),d}).flat()},Ep=({children:e,icon:t,shade:n=7,weight:s,size:o=.5,url:r,level:l="p",separator:c=".",className:a,hideFirst:u=!0,...d})=>{r!=null&&(e=r);const x=zi({segments:e,separator:c,shade:n,level:l,weight:s});return u&&x.shift(),i.jsxRuntimeExports.jsxs(j.WithIcon,{className:p.CSS(a,p.CSS.B("breadcrumb"),u&&p.CSS.M("hide-first")),level:l,shade:n,weight:s,size:o,direction:"x",...d,children:[Ee.resolve(t),...x]})},Sp=({url:e,className:t,level:n="p",separator:s="/",weight:o,shade:r=7})=>{const l=zi({segments:e,separator:s,shade:r,level:n,weight:o,transform:c=>({...c,label:c.label.split("-").map(a=>p._$1.capitalize(a)).join(" ")})});return i.jsxRuntimeExports.jsx(J.Space,{className:p.CSS(t,p.CSS.B("breadcrumb")),direction:"x",size:"small",align:"center",children:l})},Rp=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Ep,URL:Sp},Symbol.toStringTag,{value:"Module"})),bo=g.createContext(I.ZERO_CONTEXT_VALUE),Be=()=>g.useContext(bo).synnax,Cp=()=>g.useContext(bo).state,jr={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Bi="serverVersionMismatch",wp=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Vi=j.wrap$1(I.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[s,o,r]=j.useCombinedStateAndRef(I.ZERO_CONTEXT_VALUE),[{path:l},,c]=j.use$3({aetherKey:e,type:I.Provider.TYPE,schema:I.Provider.stateZ,initialState:{props:t??null,state:null}}),a=j.useAggregator(),u=g.useCallback(d=>{r.current.state.status!==d.status&&a({variant:jr[d.status],message:d.message??p._$1.capitalize(d.status)}),o(x=>({...x,state:d}))},[a]);return j.useAsyncEffect(async()=>{if(s.synnax!=null&&s.synnax.close(),t==null)return o(I.ZERO_CONTEXT_VALUE);const d=new H.lg({...t,connectivityPollFrequency:H.S.seconds(5)});o({synnax:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(o({synnax:d,state:x}),a({variant:jr[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const f=x.nodeVersion==null||H.K.semVerOlder(x.nodeVersion,x.clientVersion),m=wp(f,x.clientVersion,x.nodeVersion);a({variant:"warning",message:"Incompatible cluster version",description:m,data:{type:Bi,oldServer:f,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(u),c({props:t,state:x}),()=>{d.close(),o(I.ZERO_CONTEXT_VALUE),c({props:null,state:null})}},[t,u]),i.jsxRuntimeExports.jsx(bo.Provider,{value:s,children:i.jsxRuntimeExports.jsx(j.Composite,{path:l,children:n})})}),bp=Object.freeze(Object.defineProperty({__proto__:null,Provider:Vi,SERVER_VERSION_MISMATCH:Bi,use:Be,useConnectionState:Cp},Symbol.toStringTag,{value:"Module"})),Ft=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),Fi=()=>g.useContext(Ft),Hi=e=>{const{aliases:t}=g.useContext(Ft);return t[e]??null},as=()=>{const{aliases:e}=g.useContext(Ft);return e},us=(e,t="")=>{const{getName:n}=g.useContext(Ft),[s,o]=g.useState(t);return j.useAsyncEffect(async()=>{const r=await n(e);o(r)},[e,n]),s??t},vo=()=>{const{activeRange:e}=g.useContext(Ft);return e??void 0},Zi=({activeRange:e,children:t})=>{const n=Be(),[s,o]=g.useState({}),r=g.useCallback(a=>{o(u=>{const d={...u};return a.forEach(({variant:x,key:f,value:m})=>{const h=Number(f.split("---")[1]);x==="delete"?delete d[h]:d[m.channel]=m.alias}),d})},[o]),l=g.useCallback(async(a,u)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(a,u)},[n,e]),c=g.useCallback(async a=>{if(n==null||a===0)return;const u=s[a];return u??(await n.channels.retrieve(a)).name},[s,n]);return j.useAsyncEffect(async()=>{if(n==null||e==null){o({});return}const a=await n.ranges.retrieve(e),u=await a.listAliases();o(u);const d=await a.openAliasTracker(),x=d.onChange(r);return()=>{x(),d.close()}},[n,e]),i.jsxRuntimeExports.jsx(Ft.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},vp=({channelKey:e,value:t,shadow:n,className:s,...o})=>{const[r,l]=g.useState(!1),{setAlias:c}=Fi(),a=Hi(e),u=us(e);let d=i.jsxRuntimeExports.jsx(j.xt.Rename,{});r?d=i.jsxRuntimeExports.jsx(j.xt.Loading,{}):a===t&&(d=i.jsxRuntimeExports.jsx(j.xt.Check,{}));const x=c!=null&&!r&&a!==t&&e!==0,f=()=>{x&&(async()=>(l(!0),await c(e,t),l(!1)))()},m=()=>{var y;a!=null&&((y=o.onChange)==null||y.call(o,a))},h=()=>e===0?i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Alias synced with this label"}):i.jsxRuntimeExports.jsxs(j.Text$1,{level:"small",children:["Sync alias for ",u," with this label"]});return i.jsxRuntimeExports.jsxs(j.Text$2,{value:t,...o,children:[x&&i.jsxRuntimeExports.jsx(j.Icon,{onClick:m,tooltip:i.jsxRuntimeExports.jsxs(j.Text$1,{level:"small",children:["Set ",u," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:i.jsxRuntimeExports.jsx(j.xt.Sync,{})}),i.jsxRuntimeExports.jsx(j.Icon,{onClick:f,disabled:!x,tooltip:i.jsxRuntimeExports.jsx(h,{}),tooltipLocation:{y:"top"},variant:"outlined",children:d})]})},He="channel";var yr=180/Math.PI,eo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gi(e,t,n,s,o,r){var l,c,a;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(a=e*n+t*s)&&(n-=e*a,s-=t*a),(c=Math.sqrt(n*n+s*s))&&(n/=c,s/=c,a/=c),e*s<t*n&&(e=-e,t=-t,a=-a,l=-l),{translateX:o,translateY:r,rotate:Math.atan2(t,e)*yr,skewX:Math.atan(a)*yr,scaleX:l,scaleY:c}}var bn;function _p(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?eo:Gi(t.a,t.b,t.c,t.d,t.e,t.f)}function kp(e){return e==null||(bn||(bn=document.createElementNS("http://www.w3.org/2000/svg","g")),bn.setAttribute("transform",e),!(e=bn.transform.baseVal.consolidate()))?eo:(e=e.matrix,Gi(e.a,e.b,e.c,e.d,e.e,e.f))}function Yi(e,t,n,s){function o(u){return u.length?u.pop()+" ":""}function r(u,d,x,f,m,h){if(u!==x||d!==f){var y=m.push("translate(",null,t,null,n);h.push({i:y-4,x:I.interpolateNumber(u,x)},{i:y-2,x:I.interpolateNumber(d,f)})}else(x||f)&&m.push("translate("+x+t+f+n)}function l(u,d,x,f){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),f.push({i:x.push(o(x)+"rotate(",null,s)-2,x:I.interpolateNumber(u,d)})):d&&x.push(o(x)+"rotate("+d+s)}function c(u,d,x,f){u!==d?f.push({i:x.push(o(x)+"skewX(",null,s)-2,x:I.interpolateNumber(u,d)}):d&&x.push(o(x)+"skewX("+d+s)}function a(u,d,x,f,m,h){if(u!==x||d!==f){var y=m.push(o(m)+"scale(",null,",",null,")");h.push({i:y-4,x:I.interpolateNumber(u,x)},{i:y-2,x:I.interpolateNumber(d,f)})}else(x!==1||f!==1)&&m.push(o(m)+"scale("+x+","+f+")")}return function(u,d){var x=[],f=[];return u=e(u),d=e(d),r(u.translateX,u.translateY,d.translateX,d.translateY,x,f),l(u.rotate,d.rotate,x,f),c(u.skewX,d.skewX,x,f),a(u.scaleX,u.scaleY,d.scaleX,d.scaleY,x,f),u=d=null,function(m){for(var h=-1,y=f.length,E;++h<y;)x[(E=f[h]).i]=E.x(m);return x.join("")}}}var Pp=Yi(_p,"px, ","px)","deg)"),Mp=Yi(kp,", ",")",")"),Np=1e-12;function Er(e){return((e=Math.exp(e))+1/e)/2}function Lp(e){return((e=Math.exp(e))-1/e)/2}function Tp(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ap=function e(t,n,s){function o(r,l){var c=r[0],a=r[1],u=r[2],d=l[0],x=l[1],f=l[2],m=d-c,h=x-a,y=m*m+h*h,E,R;if(y<Np)R=Math.log(f/u)/t,E=function(v){return[c+v*m,a+v*h,u*Math.exp(t*v*R)]};else{var _=Math.sqrt(y),w=(f*f-u*u+s*y)/(2*u*n*_),S=(f*f-u*u-s*y)/(2*f*n*_),b=Math.log(Math.sqrt(w*w+1)-w),P=Math.log(Math.sqrt(S*S+1)-S);R=(P-b)/t,E=function(v){var L=v*R,T=Er(b),A=u/(n*_)*(T*Tp(t*L+b)-Lp(b));return[c+A*m,a+A*h,u*T/Er(t*L+b)]}}return E.duration=R*1e3*t/Math.SQRT2,E}return o.rho=function(r){var l=Math.max(.001,+r),c=l*l,a=c*c;return e(l,c,a)},o}(Math.SQRT2,2,4),$p=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"})),Ip=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$3,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"})),Dp={region:p.Eo.ZERO,dpr:1,os:H.w.getOS()},Op={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},zp=j.wrap$1(I.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:s,...o})=>{const[{path:r},{bootstrapped:l,dpr:c},a]=j.use$3({aetherKey:n,type:I.Canvas$1.TYPE,schema:I.canvasStateZ,initialState:Dp}),u=g.useRef({...Op}),d=g.useRef(!1),x=g.useCallback(E=>{u.current.bootstrapped&&(a(()=>({bootstrapped:!0,region:E,dpr:window.devicePixelRatio,os:H.w.getOS({default:"Windows"})})),d.current=!0)},[a]),f=g.useRef(null),m=j.useResize(x,{debounce:t}),h=j.useCombinedRefs(f,m);g.useEffect(()=>{const E=()=>{window.devicePixelRatio===c||!u.current.bootstrapped||f.current==null||a(R=>({...R,region:p.Eo.construct(f.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",E,{once:!0})},[c]),g.useEffect(()=>{const E=()=>{!u.current.bootstrapped||f.current==null||a(R=>({...R,region:p.Eo.construct(f.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",E),window.addEventListener("blur",E)},[a]);const y=g.useCallback(E=>{if(E==null)return;E.className.includes("gl")?u.current.gl=E:E.className.includes("upper2d")?u.current.upper2d=E:u.current.lower2d=E;const{gl:R,lower2d:_,upper2d:w,bootstrapped:S}=u.current;if(R==null||_==null||w==null||S)return;u.current.bootstrapped=!0;const b=R.transferControlToOffscreen(),P=w.transferControlToOffscreen(),v=_.transferControlToOffscreen();a({glCanvas:b,upper2dCanvas:P,lower2dCanvas:v,bootstrap:!0,bootstrapped:!1,region:p.Eo.construct(R),dpr:window.devicePixelRatio,os:H.w.getOS({default:"Windows"})},[b,P,v])},[a]);return i.jsxRuntimeExports.jsxs("div",{ref:h,className:p.CSS(p.CSS.B("canvas-container"),s),...o,children:[i.jsxRuntimeExports.jsx("canvas",{ref:y,className:p.CSS(p.CSS.B("canvas"),p.CSS.BM("canvas","lower2d"))}),i.jsxRuntimeExports.jsx("canvas",{ref:y,className:p.CSS(p.CSS.B("canvas"),p.CSS.BM("canvas","gl"))}),i.jsxRuntimeExports.jsx("canvas",{ref:y,className:p.CSS(p.CSS.B("canvas"),p.CSS.BM("canvas","upper2d"))}),i.jsxRuntimeExports.jsx(j.Composite,{path:r,children:l&&e})]})}),gn=(e,t)=>j.useResize(g.useCallback((n,s)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(p.b.XY.translate(p.G.scale(p.Eo.topLeft(o),-1)).box(n),s)},[e]),t),Bp=Object.freeze(Object.defineProperty({__proto__:null,Canvas:zp,useRegion:gn},Symbol.toStringTag,{value:"Module"})),Wi=g.createContext(null),Ze=e=>{const t=g.useContext(Wi);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Xi=e=>{const t=Ze("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},jn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=Ze(t),{key:o}=e;return j.useEffectCompare(()=>{p.K.outer.parse(e.loc),n(e)},([c],[a])=>H._.equal(c,a),[e]),g.useEffect(()=>()=>s(o),[]),{gridArea:p.g.swap(p.K.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},Ki=j.wrap$1("LinePlot",({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=p.G.ZERO,children:o,hold:r=!1,onHold:l,visible:c,...a})=>{const[u,d]=g.useState([]),x=j.useMemoDeepEqualProps({clearOverScan:s,hold:r,visible:c}),[{path:f},{grid:m},h]=j.use$3({aetherKey:e,type:I.LinePlot.TYPE,schema:I.linePlotStateZ,initialState:{container:p.Eo.ZERO,viewport:p.Eo.DECIMAL,grid:{},...x}});g.useEffect(()=>h(N=>({...N,...x})),[x]);const y=g.useRef(new Map),E=g.useCallback(N=>(y.current.set(N,null),()=>y.current.delete(N)),[y]),R=g.useCallback(N=>{const{mode:O,box:C,stage:$}=N;(O==="pan"&&$!=="start"||O==="zoom"||O==="zoomReset"&&$==="start")&&h(k=>({...k,viewport:C})),y.current.forEach((k,D)=>D(N))},[h]),_=g.useCallback(N=>h(O=>({...O,container:N})),[h]),w=gn(_,{debounce:n}),S=g.useCallback(N=>h(O=>({...O,grid:{...O.grid,[N.key]:N}})),[h]),b=g.useCallback(N=>h(O=>{const{[N]:C,...$}=O.grid;return{...O,grid:$}}),[h]),P=g.useCallback(N=>{d(O=>[...O.filter(({key:C})=>C!==N.key),N])},[d,R]),v=g.useCallback(N=>d(O=>O.filter(({key:C})=>C!==N)),[P]),L=g.useMemo(()=>Vp(m),[m]),T=g.useCallback(N=>{h(O=>({...O,hold:N})),l==null||l(N)},[h,l]),A=`line-plot-${e}`,B=g.useMemo(()=>({lines:u,setGridEntry:S,removeGridEntry:b,setLine:P,removeLine:v,setViewport:R,addViewportHandler:E,setHold:T,id:A}),[A,u,S,b,P,v,R,E,T]);return i.jsxRuntimeExports.jsx("div",{id:A,className:p.CSS.B("line-plot"),style:{...t,...L},ref:w,...a,children:i.jsxRuntimeExports.jsx(Wi.Provider,{value:B,children:i.jsxRuntimeExports.jsx(j.Composite,{path:f,children:o})})})}),Vp=e=>{const t=p.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()},_o=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?I.XAxis.TYPE:I.YAxis.TYPE,s=`${e}-axis`;return j.wrap$1(n,({aetherKey:o,children:r,location:l=t,label:c="",labelLevel:a="small",labelDirection:u=e,onLabelChange:d,color:x,labelSize:f,showGrid:m,type:h,bounds:y,className:E,tickSpacing:R,autoBounds:_,autoBoundUpdateInterval:w,onAutoBoundsChange:S,style:b,...P})=>{const v=((c==null?void 0:c.length)??0)>0,L=j.useMemoDeepEqualProps({location:l,showGrid:m,type:h,bounds:y,label:c,labelDirection:u,tickSpacing:R,autoBounds:_,autoBoundUpdateInterval:w}),[{path:T},{size:A,labelSize:B,...N},O]=j.use$3({aetherKey:o,type:n,schema:I.coreAxisStateZ,initialState:L});g.useEffect(()=>O(D=>({...D,...L})),[L]),g.useEffect(()=>{const{lower:D,upper:M}=I.parseAutoBounds(N.autoBounds);N.bounds!=null&&(D&&(y==null?void 0:y.lower)!==N.bounds.lower||M&&(y==null?void 0:y.upper)!==N.bounds.upper)&&(S==null||S(N.bounds))},[N.autoBounds,N.bounds]);const C=jn({loc:l,key:`${n}-${o}`,size:A+B,order:1},`${e.toUpperCase()}Axis`),$=j.useTypography(a).toString(),k=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(c==null)return;let M=H.dimensions(c,$)[p.g.dimension(p.g.construct(u))];M>0&&(M+=9),O(z=>({...z,labelSize:M}))}else{let M=H.dimensions(c,$).height*1.3;M>0&&(M+=12);const z=k.current;I.withinSizeThreshold(z,M)||(k.current=M,O(V=>({...V,labelSize:M})))}},[c,u,$]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(J.Space,{className:p.CSS(E,p.CSS.B("axis"),p.CSS.B(s),p.CSS.loc(l)),style:{...b,...C},align:"center",justify:l!=="left"?"end":"start",direction:p.g.swap(e),...P,children:v&&i.jsxRuntimeExports.jsx(j.MaybeEditable,{className:p.CSS(p.CSS.BE("axis","label"),p.CSS.dir(u)),value:c,onChange:d,level:a})}),i.jsxRuntimeExports.jsx(j.Composite,{path:T,children:r})]})})},qi=_o("x"),Ui=_o("y"),Qi=p.G.xy.extend({root:p.K.corner,units:re.z.object({x:re.z.enum(["px","decimal"]),y:re.z.enum(["px","decimal"])})}),Fp=Qi.partial({root:!0,units:!0}),Hp=e=>{var n,s,o,r;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((s=e==null?void 0:e.units)==null?void 0:s.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((o=e.root)==null?void 0:o.y)??"top"]=((r=e==null?void 0:e.units)==null?void 0:r.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},Zp=(e,t)=>{var r,l,c,a,u,d;const n={x:e.x,y:e.y};if(t.current==null)return n;const s=p.Eo.construct(t.current),o=p.Eo.construct(t.current.parentElement);return((r=e.units)==null?void 0:r.x)==="decimal"?((l=e.root)==null?void 0:l.x)==="right"&&(n.x=1-e.x):((c=e.root)==null?void 0:c.x)==="right"?n.x=1-(e.x+p.Eo.width(s))/p.Eo.width(o):n.x/=p.Eo.width(o),((a=e.units)==null?void 0:a.y)==="decimal"?((u=e.root)==null?void 0:u.y)==="bottom"&&(n.y=1-e.y):((d=e.root)==null?void 0:d.y)==="bottom"?n.y=1-(e.y+p.Eo.height(s))/p.Eo.height(o):n.y/=p.Eo.height(o),n},Ji=(e,t)=>{if(t.current==null)return null;const n=p.Eo.construct(t.current.parentElement),s=p.Eo.construct(t.current),o={x:e.x,y:e.y,root:{...p.K.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*p.Eo.width(n)-p.Eo.width(s),o.root.x="right"):e.x<.2?o.x=e.x*p.Eo.width(n):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*p.Eo.height(n)-p.Eo.height(s),o.root.y="bottom"):e.y<.2?o.y=e.y*p.Eo.height(n):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...p.G.truncate(o,3)}},Sr=p.Eo.reRoot(p.Eo.DECIMAL,p.K.TOP_LEFT),ko=g.memo(({className:e,value:t,onChange:n,style:s,draggable:o=!0,...r})=>{const[l,c]=H.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:p.K.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),a=g.useRef(l),u=j.useSyncedRef(o===!1),d=g.useRef(null);l!==null&&(s={...s,...Hp(l)});const x=g.useCallback(m=>{var S;if(((S=d.current)==null?void 0:S.parentElement)==null)return a.current;const h=p.Eo.construct(d.current.parentElement),y=p.b.XY.scale(h).scale(Sr),E=y.box(p.Eo.construct(d.current)),R=p.b.XY.clamp(p.Eo.construct(p.Eo.topLeft(Sr),{width:1-p.Eo.width(E),height:1-p.Eo.height(E)})),_=p.G.translate(p.G.construct(a.current),p.Eo.signedDims(y.box(m))),w=R.pos(_);return Ji(w,d)},[]),f=j.useCursorDrag({onStart:g.useCallback(()=>{a.current=Zp(a.current,d)},[]),onMove:g.useCallback(m=>{if(u.current)return;const h=x(m);h!==null&&c(h)},[]),onEnd:g.useCallback(m=>{if(u.current)return;const h=x(m);h!==null&&(a.current=h)},[])});return i.jsxRuntimeExports.jsx(J.Space,{className:p.CSS(e,p.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:f,draggable:o,ref:d,...r,onDrag:j.preventDefault,onDragEnd:j.preventDefault,empty:!0})});ko.displayName="Legend.Container";const Po=(e,t,n)=>e.sort((s,o)=>s.label.localeCompare(o.label)).map(({key:s,color:o,label:r})=>i.jsxRuntimeExports.jsxs(J.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[i.jsxRuntimeExports.jsx(j.Swatch,{value:o,onChange:l=>t==null?void 0:t({key:s,color:l,label:r}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"small"}),i.jsxRuntimeExports.jsx(j.MaybeEditable,{level:"small",value:r,onChange:l=>t==null?void 0:t({key:s,color:o,label:l}),noWrap:!0})]},s)),Mo=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...o})=>{const[r,l]=g.useState(!1);return e.length===0?null:i.jsxRuntimeExports.jsx(ko,{...o,draggable:!r,value:n,onChange:s,children:Po(e,t,l)})},Gp=Object.freeze(Object.defineProperty({__proto__:null,Container:ko,Simple:Mo,calcStickyPos:Ji,completeStickyXYz:Qi,legendSwatches:Po,stickyXYz:Fp},Symbol.toStringTag,{value:"Module"})),el=({className:e,style:t,onLineChange:n,...s})=>{const{lines:o}=Ze("Legend");return Ze("Legend"),i.jsxRuntimeExports.jsx(Mo,{data:o,onEntryChange:n,...s})},Yp=({onLineChange:e})=>{const{lines:t}=Ze("Legend"),n=j.useUniqueKey(),s=jn({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return i.jsxRuntimeExports.jsx(J.Space,{className:p.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:Po(t,e)})},tl=({variant:e="floating",...t})=>e==="floating"?i.jsxRuntimeExports.jsx(el,{...t}):i.jsxRuntimeExports.jsx(Yp,{...t}),nl=j.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=j.use$3({aetherKey:e,type:I.Line.TYPE,schema:I.stateZ,initialState:t}),s=j.useMemoDeepEqualProps(t);return g.useLayoutEffect(()=>n(s),[s]),null}),Wp=Object.freeze(Object.defineProperty({__proto__:null,Line:nl},Symbol.toStringTag,{value:"Module"})),No=j.wrap$1("Line",({aetherKey:e,color:t,label:n="",...s})=>{const{setLine:o,removeLine:r}=Ze("Line");return g.useEffect(()=>(o({key:e,color:t,label:n}),()=>r(e)),[n,t]),i.jsxRuntimeExports.jsx(nl,{aetherKey:e,color:t,label:n,...s})}),sl=({level:e="h2",...t})=>{const n=j.useUniqueKey(),s=j.useTypography(e),o=jn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return i.jsxRuntimeExports.jsx(J.Space,{justify:"center",align:"center",style:o,children:i.jsxRuntimeExports.jsx(j.MaybeEditable,{...t,level:e})})},ol=j.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=j.use$3({aetherKey:e,type:I.Tooltip.TYPE,schema:I.tooltipStateZ,initialState:{position:null}}),n=g.useRef(null),s=g.useCallback(r=>{const l=document.querySelector(".pluto-canvas-container");if(l==null)return;const c=p.Eo.topLeft(l);t({position:p.G.translation(c,p.G.construct(r))})},[t]),o=g.useCallback(()=>t({position:null}),[t]);return g.useEffect(()=>{if(n.current===null)return;const r=n.current.parentElement;if(r!=null)return r.addEventListener("mousemove",s),r.addEventListener("mouseleave",o),()=>{r.removeEventListener("mousemove",s),r.removeEventListener("mouseleave",o)}},[s]),i.jsxRuntimeExports.jsx("span",{ref:n})}),Xp=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:ol},Symbol.toStringTag,{value:"Module"})),Kp={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Lo=g.forwardRef(({className:e,mode:t,maskBox:n,children:s,style:o,...r},l)=>i.jsxRuntimeExports.jsxs("div",{ref:l,className:p.CSS(p.CSS.noSelect,p.CSS.BE("viewport-mask","container"),e),style:{cursor:Kp[t],...o},...r,children:[i.jsxRuntimeExports.jsx("div",{style:{...p.Eo.css(n),display:p.Eo.areaIsZero(n)?"none":"block"},className:p.CSS.BE("viewport-mask","selection")}),s]}));Lo.displayName="ZoomPanMask";const qp=[{key:"start",icon:i.jsxRuntimeExports.jsx(j.xt.TextAlign.Left,{})},{key:"center",icon:i.jsxRuntimeExports.jsx(j.xt.TextAlign.Center,{})},{key:"end",icon:i.jsxRuntimeExports.jsx(j.xt.TextAlign.Right,{})}],Up=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(j.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),ds=({children:e=Up,...t})=>i.jsxRuntimeExports.jsx(Re.Button,{...t,allowMultiple:!1,data:qp,children:e}),Qp=new Set([H.g.UUID,H.g.JSON]),Jp=H.g.ALL.filter(e=>e!==H.g.UNKNOWN).map(e=>({key:e.toString(),name:Qp.has(e)?e.toString().toUpperCase():p._$1.capitalize(e.toString())})),ef=[{key:"name",name:"Name"}],tf=e=>i.jsxRuntimeExports.jsx(Re.DropdownButton,{...e,data:Jp,columns:ef,entryRenderKey:"name"}),nf=[{key:"x",icon:i.jsxRuntimeExports.jsx(j.xt.Arrow.Right,{})},{key:"y",icon:i.jsxRuntimeExports.jsx(j.xt.Arrow.Up,{})}],sf=[{key:"x",icon:i.jsxRuntimeExports.jsx(j.xt.Arrow.Right,{})},{key:"y",icon:i.jsxRuntimeExports.jsx(j.xt.Arrow.Down,{})}],of=({key:e,entry:t,onClick:n,selected:s})=>i.jsxRuntimeExports.jsx(j.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),rl=({children:e=of,yDirection:t="up",...n})=>i.jsxRuntimeExports.jsx(Re.Button,{...n,allowMultiple:!1,data:t==="up"?nf:sf,children:e}),il=e=>i.jsxRuntimeExports.jsx(j.Icon,{className:p.CSS.BE("select","clear"),variant:"outlined",...e,children:i.jsxRuntimeExports.jsx(j.xt.Close,{"aria-label":"clear"})}),dt=({onChange:e,value:t,entryRenderKey:n="key",columns:s,data:o,emptyContent:r,inputProps:l,allowNone:c=!0,searcher:a,className:u,variant:d="button",hideColumnHeader:x=!1,disabled:f,omit:m,children:h,dropdownVariant:y="connected",placeholder:E=xs,inputPlaceholder:R=E,triggerTooltip:_,dropdownZIndex:w,filter:S,actions:b,...P})=>{const{visible:v,open:L,close:T,toggle:A}=j.use$2(),[B,N]=g.useState(null),O=a!=null;j.useAsyncEffect(async()=>{if(j.selectValueIsZero(t))return N(null);if((B==null?void 0:B.key)===t)return;let M=null;if(O)try{[M]=await a.retrieve([t])}finally{M??(M=null)}else o!=null&&(M=o.find(z=>z.key===t)??null);N(M)},[a,t,o]);const C=g.useCallback((M,z)=>{Array.isArray(M)||(N(M==null?null:z.entries[0]),T(),e(M,z))},[e,c]),$=g.useMemo(()=>O?j.Search:Vt.Filter,[O]),k=i.jsxRuntimeExports.jsx($,{searcher:a,filter:S,children:({onChange:M})=>i.jsxRuntimeExports.jsx(rf,{...l,autoFocus:y==="modal",variant:d,onChange:M,onFocus:L,selected:B,entryRenderKey:n,visible:v,allowNone:c,className:u,dropdownVariant:y,disabled:f,placeholder:R,children:b})}),D=i.jsxRuntimeExports.jsx(j.Button,{tooltip:_,variant:"outlined",onClick:A,disabled:f,children:B!=null?ll(n,B):E});return i.jsxRuntimeExports.jsx(Re.Core,{close:T,zIndex:w,open:L,data:o,omit:m,emptyContent:r,allowMultiple:!1,visible:v,value:t,hideColumnHeader:x,onChange:C,allowNone:c,columns:s,listItem:h,variant:y,trigger:y!=="modal"?k:D,extraDialogContent:y==="modal"?k:void 0,keepMounted:!1,...P})},xs="Select",ll=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),rf=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:o,allowNone:r=!0,placeholder:l=xs,className:c,disabled:a,dropdownVariant:u,children:d,...x})=>{const{clear:f}=j.useSelectionUtils(),[m,h]=g.useState("");g.useEffect(()=>{if(!n){if(H.w$2(t==null?void 0:t.key))return h("");t!=null&&h(ll(e,t))}},[t,n,e]);const y=S=>{s(S),h(S)},E=()=>{m===""&&s(""),h(""),o==null||o()},R=S=>{n||(S.preventDefault(),o==null||o())},_=()=>{h(""),f==null||f()};let w;return u!=="modal"&&(w=i.jsxRuntimeExports.jsx($i.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n})),i.jsxRuntimeExports.jsxs(j.Text$2,{className:p.CSS(p.CSS.BE("select","input"),c),value:m,onChange:y,onFocus:E,onKeyDown:j.matchCallback([["Enter"]],S=>{S.preventDefault(),!n&&(o==null||o())}),endContent:w,style:{flexGrow:1},onClick:R,placeholder:l,disabled:a,...x,children:[d,r&&i.jsxRuntimeExports.jsx(il,{onClick:_,disabled:a})]})},ln=({children:e="",size:t="medium",color:n,icon:s,onClose:o,className:r,onDragStart:l,...c})=>{const a=p.cssString(n);s==null&&n!=null&&(s=i.jsxRuntimeExports.jsx(j.xt.Circle,{fill:a}));const u=o==null?void 0:i.jsxRuntimeExports.jsx(j.Icon,{"aria-label":"close",size:"small",className:p.CSS.BE("tag","close"),onClick:d=>{d.stopPropagation(),o()},children:i.jsxRuntimeExports.jsx(j.xt.Close,{})});return i.jsxRuntimeExports.jsx(j.WithIcon,{startIcon:s,endIcon:u,className:p.CSS(r,p.CSS.B("tag"),o!=null&&p.CSS.BM("tag","closeable")),level:H.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:l,...c,children:e})},lf=Object.freeze(Object.defineProperty({__proto__:null,Tag:ln},Symbol.toStringTag,{value:"Module"})),Ht=({onChange:e,value:t,className:n,data:s,columns:o=[],entryRenderKey:r="key",emptyContent:l,searcher:c,renderTag:a=j.componentRenderProp(cl),placeholder:u,onTagDragStart:d,allowMultiple:x,allowNone:f,replaceOnSingle:m,onTagDragEnd:h,style:y,addPlaceholder:E="Add",children:R,dropdownVariant:_="connected",actions:w,...S})=>{const{visible:b,open:P,close:v}=j.use$2(),[L,T]=g.useState([]),[A,B]=g.useState(!1),N=c!=null;j.useAsyncEffect(async()=>{B(!0),j.selectValueIsZero(t)&&T([]);const D=L.map(V=>V.key),M=H.A(t);if(H.F.unorderedPrimitiveArrays(D,M)===H.F.EQUAL)return;let z=[];if(N)try{z=await c.retrieve(M)}finally{B(!1)}else s!=null&&(z=s.filter(V=>M.includes(V.key)));T(z)},[c,N,t,s]);const O=g.useCallback((D,M)=>{D!=null&&(T(M.entries),e(H.A(D),M))},[e]),C=g.useMemo(()=>N?j.Search:Vt.Filter,[N]);let $,k;if(_==="connected")k=i.jsxRuntimeExports.jsx(C,{searcher:c,children:({onChange:D,value:M})=>i.jsxRuntimeExports.jsx(cf,{value:M,selectedKeys:t,className:n,onChange:D,loading:A,selected:L,onFocus:P,entryRenderKey:r,visible:b,renderTag:a,placeholder:u,onTagDragStart:d,onTagDragEnd:h,style:y,children:w})});else{const D=H.A(t);k=i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",grow:!0,style:y,size:"small",children:[D.map(M=>{const z=L.find(V=>V.key===M);return a({key:M,entryKey:M,entryRenderKey:r,loading:A,entry:z,onClose:()=>{const V=D.filter(Z=>Z!==M);e(V,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:V=>d==null?void 0:d(V,M),onDragEnd:V=>h==null?void 0:h(V,M)})}),D.length>0?i.jsxRuntimeExports.jsx(j.Icon,{onClick:P,children:i.jsxRuntimeExports.jsx(j.xt.Add,{style:{color:"var(--pluto-gray-l7)"}})}):i.jsxRuntimeExports.jsx(j.Button,{onClick:P,shade:7,startIcon:i.jsxRuntimeExports.jsx(j.xt.Add,{}),variant:"text",children:E})]}),$=i.jsxRuntimeExports.jsx(C,{searcher:c,children:M=>i.jsxRuntimeExports.jsx(j.Text$2,{autoFocus:!0,placeholder:"Search",...M,children:w})})}return i.jsxRuntimeExports.jsx(Re.Core,{close:v,open:P,data:s,emptyContent:l,visible:b,value:t,onChange:O,allowNone:f,replaceOnSingle:m,columns:o,allowMultiple:!0,listItem:R,trigger:k,extraDialogContent:$,variant:_,...S})},cf=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:o,visible:r,entryRenderKey:l,renderTag:c,placeholder:a=xs,onTagDragStart:u,onTagDragEnd:d,value:x,className:f,children:m,...h})=>{const{onSelect:y,clear:E}=j.useSelectionUtils(),R=g.useRef(null);g.useLayoutEffect(()=>{var b;r&&((b=R.current)==null||b.focus())},[r,n]);const _=()=>{r||s(""),o==null||o()},w=()=>{r||o==null||o()},S=()=>{r||s("")};return i.jsxRuntimeExports.jsxs(j.Text$2,{ref:R,className:p.CSS(p.CSS.BE("select-multiple","input"),p.CSS.visible(r),f),onBlur:S,placeholder:a,value:x,onChange:s,onFocus:_,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:w,variant:"button",...h,children:[i.jsxRuntimeExports.jsx(J.Space,{direction:"x",className:p.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:H.A(e).map(b=>{const P=n.find(v=>v.key===b);return c({key:b,entryKey:b,entryRenderKey:l,loading:t,entry:P,onClose:()=>y==null?void 0:y(b),onDragStart:v=>u==null?void 0:u(v,b),onDragEnd:v=>d==null?void 0:d(v,b)})})}),m,i.jsxRuntimeExports.jsx(il,{onClick:E})]})},cl=({entryKey:e,entryRenderKey:t,entry:n,loading:s,...o})=>{let r=e;return n!=null&&(r=typeof t=="function"?t(n):n[t]),g.createElement(ln,{size:"small",variant:"outlined",className:p.CSS(n==null&&!s&&p.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...o,key:e.toString()},H.X(r))},af=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:Re.BaseButton,Button:Re.Button,DEFAULT_PLACEHOLDER:xs,DataType:tf,Direction:rl,DropdownButton:Re.DropdownButton,Multiple:Ht,MultipleTag:cl,Single:dt,TextAlignment:ds,defaultButton:Re.defaultButton},Symbol.toStringTag,{value:"Module"})),Dn=6,uf=2,Rr=5,df=e=>p.Eo.width(e)<Rr&&p.Eo.height(e)<Rr,xf=["zoom","pan","select","zoomReset"],nn=[...xf,"click"],pf=re.z.enum(nn),al=["zoom","select"],On={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},ul={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},dl={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},To={zoom:On,pan:ul,select:dl,zoomReset:On,click:On},ff=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(o=>o.filter(r=>r!=="MouseLeft")).filter(o=>o.length>0)]))},mf=p.Eo.construct(0,0,1,1,p.K.TOP_LEFT),hf={width:30,height:50},xl=({onChange:e,triggers:t,initial:n=mf,threshold:s=hf,ref:o})=>{const r=(t==null?void 0:t.defaultMode)??"zoom",[l,c]=g.useState(p.Eo.ZERO),[a,u]=g.useState(r),[d,x]=j.useStateRef(n),f=g.useRef(p.G.ZERO),m=g.useRef(null),h=p._.construct(s);g.useEffect(()=>x(()=>p.Eo.truncate(n,Dn)),[n]),g.useEffect(()=>u(r),[r]);const[y,E,R,_]=j.useMemoCompare(()=>{const L={...To[r],...t},T=j.flattenConfig(L),A=ff(L);return[L,T,A,j.flattenConfig(A)]},j.compareModeConfigs,[t]),w=g.useCallback(({box:L,triggers:T,stage:A,cursor:B})=>{if(m.current==null)return;const N=j.determineMode(y,T),O=p.Eo.construct(m.current);if(N==null)return;if(N==="zoomReset")return c(p.Eo.ZERO),e==null||e({box:p.Eo.DECIMAL,mode:N,stage:A,cursor:B}),x(p.Eo.DECIMAL);const C=df(L);if(A==="end"){if(C){N==="zoom"&&c(p.Eo.ZERO),e==null||e({box:d.current,mode:"click",stage:A,cursor:B});return}return x(k=>{if(N==="pan"){const M=Cr(L,k,O);return M===null||p.Eo.equals(M,k)?k:(e==null||e({box:M,mode:N,stage:A,cursor:B}),M)}const D=S(L,k,O);return D===null?k:(e==null||e({box:D,mode:N,stage:A,cursor:B}),N==="zoom"?(c(p.Eo.ZERO),D):p.Eo.truncate(k,Dn))})}if(al.includes(N))return C?void 0:c(p.b.XY.scale(O).clamp(O).translate({x:-p.Eo.left(O),y:-p.Eo.top(O)}).box(wr(h,L,O)));if(c(k=>p.Eo.areaIsZero(k)?k:p.Eo.ZERO),p.G.distance(B,f.current)<uf)return;f.current=B;const $=Cr(L,d.current,O);e==null||e({box:$,mode:N,stage:A,cursor:B})},[c,u,e,y,s.height,s.width,x,m]);g.useImperativeHandle(o,()=>({reset:()=>{c(p.Eo.ZERO),x(p.Eo.DECIMAL),e==null||e({box:p.Eo.DECIMAL,mode:"zoomReset",stage:"start",cursor:p.G.ZERO})}}),[e]);const S=g.useCallback((L,T,A)=>p.Eo.truncate(to(T,A).box(wr(h,L,A)),Dn),[s]),b=j.useHeldRef({triggers:[["Control"]]}),P=j.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const L=T=>{if(m.current==null)return;let A=1;T.deltaY<0?A-=.035:A+=.035;const B=p.Eo.construct(m.current),N=p.G.construct(T);if(Array.from(m.current.children).push(m.current),!p.Eo.contains(B,N)||m.current!==T.target&&j.findParent(T.target,M=>M===m.current)==null)return;const $=to(d.current,p.Eo.construct(m.current)).pos(p.G.construct(T));let D=p.b.XY.magnify({x:b.current.held?1:A,y:P.current.held?1:A}).box(d.current);D=p.Eo.translate(D,{x:b.current.held?0:$.x*(1-A),y:P.current.held?0:$.y*(1-A)}),x(D),e==null||e({stage:"end",box:D,cursor:p.G.construct(T),mode:"zoom"})};return window.addEventListener("wheel",L),()=>window.removeEventListener("wheel",L)},[x,e]),Ii.useDrag({bound:m,onDrag:w,triggers:E,loose:!0});const v=g.useCallback(({triggers:L,stage:T})=>{if(T==="end")return u(r);const A=j.determineMode(R,L);A!=null&&u(A)},[R,r,e]);return j.use$1({triggers:_,callback:v,region:m}),{maskBox:l,ref:m,mode:a}},to=(e,t)=>p.b.XY.scale(t).clamp(t).scale(e),Cr=(e,t,n)=>{let s=p.Eo.signedDims(to(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},p.Eo.truncate(p.b.XY.translate(p.G.construct(s)).box(t),Dn)},wr=(e,t,n)=>p.Eo.height(t)<=e.height?p.Eo.construct(p.Eo.left(t),p.Eo.top(n),p.Eo.width(t),p.Eo.height(n)):p.Eo.width(t)<=e.width?p.Eo.construct(p.Eo.left(n),p.Eo.top(t),p.Eo.width(n),p.Eo.height(t)):t,gf=({mode:e,triggers:t})=>i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",children:[i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:p._$1.capitalize(e)}),i.jsxRuntimeExports.jsx(J.Space,{empty:!0,direction:"x",align:"center",children:i.jsxRuntimeExports.jsx(j.Text,{trigger:t[0],level:"small"})})]}),jf={zoom:i.jsxRuntimeExports.jsx(j.xt.Zoom,{}),pan:i.jsxRuntimeExports.jsx(j.xt.Pan,{}),select:i.jsxRuntimeExports.jsx(j.xt.Selection,{}),zoomReset:i.jsxRuntimeExports.jsx(j.xt.Expand,{}),click:i.jsxRuntimeExports.jsx(j.xt.Bolt,{})},yf=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([o])=>!t.includes(o)&&nn.includes(o)).map(([o,r])=>({key:o,icon:jf[o],tooltip:i.jsxRuntimeExports.jsx(gf,{mode:o,triggers:r})})).sort((o,r)=>nn.indexOf(o.key)-nn.indexOf(r.key));return i.jsxRuntimeExports.jsx(Re.Button,{...n,data:s,entryRenderKey:"icon",children:({title:o,entry:r,...l})=>g.createElement(j.Icon,{...l,key:r.key,variant:l.selected?"filled":"text",size:"medium",tooltip:r.tooltip,tooltipLocation:{x:"right",y:"top"}},r.icon)})},Ef=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:To,MASK_MODES:al,MODES:nn,Mask:Lo,PAN_DEFAULT_TRIGGERS:ul,SELECT_DEFAULT_TRIGGERS:dl,SelectMode:yf,ZOOM_DEFAULT_TRIGGERS:On,modeZ:pf,use:xl},Symbol.toStringTag,{value:"Module"})),Sf=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,Ao=g.forwardRef(({children:e,initial:t=p.Eo.DECIMAL,onChange:n,...s},o)=>{const{setViewport:r}=Ze("Viewport");g.useLayoutEffect(()=>{r({box:t,mode:"zoom",cursor:p.G.ZERO,stage:"start"})},[r,t]);const l=g.useCallback(a=>{r(a),n==null||n(a)},[n,r]),c=xl({onChange:l,initial:t,ref:o,...s});return i.jsxRuntimeExports.jsx(Lo,{className:p.CSS.BE("line-plot","viewport"),...c,children:e})});Ao.displayName="Viewport";const Rf=Object.freeze(Object.defineProperty({__proto__:null,Floating:el,Legend:tl,Line:No,LinePlot:Ki,Title:sl,Tooltip:Xp,Viewport:Ao,XAxis:qi,YAxis:Ui,axisFactory:_o,selectViewportEl:Sf,useContext:Ze,useGridEntry:jn,useViewport:Xi},Symbol.toStringTag,{value:"Module"})),Cf=j.wrap$1("Tooltip",({aetherKey:e,...t})=>(j.use$3({aetherKey:e,type:I.Annotation.TYPE,schema:I.annotationStateZ,initialState:t}),null)),pl=j.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:s,setHold:o}=Ze("Range.Provider"),[,{hovered:r,count:l},c]=j.use$3({aetherKey:e,type:I.Provider$1.TYPE,schema:I.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),a=jn({key:e,loc:"top",size:l>0?32:0,order:3},"Annotation.Provider"),u=j.useContextMenu(),d=j.useSyncedRef(u.visible),x=g.useCallback(f=>{const m=y=>{c(E=>({...E,cursor:{x:y.clientX,y:y.clientY}}))},h=f.currentTarget;h.addEventListener("mousemove",m),h.addEventListener("mouseleave",()=>{h.removeEventListener("mousemove",m),d.current||c(y=>({...y,cursor:null}))},{once:!0})},[c]);return i.jsxRuntimeExports.jsx(j.ContextMenu,{style:{...a,cursor:r!=null?"pointer":"default"},...u,menu:()=>t==null||r==null?null:t(r),children:i.jsxRuntimeExports.jsx(J.Space,{style:{width:"100%",height:"100%"},onClick:()=>{r!=null&&(s({box:p.Eo.construct({x:r.viewport.lower,y:0},{x:r.viewport.upper,y:1}),mode:"zoom",cursor:p.G.ZERO,stage:"start"}),o(!0))},onMouseEnter:x})})}),wf=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Cf,Provider:pl},Symbol.toStringTag,{value:"Module"})),fl={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},bf=j.flattenConfig(fl),ml=j.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=j.use$3({aetherKey:e,type:I.Measure.TYPE,schema:I.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=g.useRef(null),s=j.useHeldRef({triggers:bf,loose:!0}),o=g.useCallback(({mode:c,cursor:a})=>{if(c==="click"){const u=j.determineMode(fl,s.current.triggers,{loose:!0});if(["one","two"].includes(u))return t(d=>({...d,[u]:a}));t(u==="clear"?d=>({...d,one:null,two:null}):d=>({...d,one:d.one??a,two:d.one!==null?a:d.two}))}},[t,s]);Xi(o);const r=g.useCallback(c=>t(a=>({...a,hover:p.G.construct(c)})),[t]),l=g.useCallback(()=>{t(c=>({...c,hover:null}))},[t]);return g.useEffect(()=>{if(n.current===null)return;const c=n.current.parentElement;if(c!=null)return c.addEventListener("mousemove",r),c.addEventListener("mouseleave",l),()=>{c.removeEventListener("mousemove",r),c.removeEventListener("mouseleave",l)}},[o]),i.jsxRuntimeExports.jsx("span",{ref:n})}),vf=Object.freeze(Object.defineProperty({__proto__:null,Measure:ml},Symbol.toStringTag,{value:"Module"})),$o=j.wrap$1("Rule",({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:o,units:r="",color:l,lineWidth:c,lineDash:a,className:u,onSelect:d,style:x,...f})=>{const[m,h]=H.usePurePassthrough({value:t,onChange:s,initial:""}),y=j.useSyncedRef(o),[,{pixelPosition:E},R]=j.use$3({aetherKey:e,type:I.Rule.TYPE,schema:I.ruleStateZ,initialState:{color:l,dragging:!1,position:n,lineWidth:c,lineDash:a},onAetherChange:g.useCallback(({position:N})=>{var O;N!=null&&((O=y.current)==null||O.call(y,N))},[y])}),_=g.useRef(E);E!==_.current&&(_.current=E);const{id:w}=Ze("Rule"),S=document.getElementById(w),b=S==null?void 0:S.querySelector(".pluto-line-plot__viewport"),P=g.useRef(E);g.useEffect(()=>{R(N=>({...N,position:n,color:l,lineWidth:c,lineDash:a}))},[n,l,c,a]);const v=j.useCursorDrag({onStart:g.useCallback(()=>{d==null||d(),R(N=>({...N,dragging:!0})),P.current=_.current},[]),onMove:N=>{R(O=>({...O,pixelPosition:(P.current??0)+p.Eo.signedHeight(N)}))},onEnd:g.useCallback(()=>{R(N=>({...N,dragging:!1})),P.current=E},[])}),L=g.useRef(null);if(n==null||E==null)return null;const A=new p.Color(l).pickByContrast("#000000","#ffffff"),B=i.jsxRuntimeExports.jsxs("div",{ref:L,className:p.CSS.B("rule"),style:{top:`calc(${E}px - 0.5rem)`},children:[i.jsxRuntimeExports.jsx("div",{className:p.CSS.BE("rule","drag-handle"),onDragStart:v,draggable:!0}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",className:p.CSS(u,p.CSS.BE("rule","label")),bordered:!0,onClick:d,size:1,rounded:!0,style:{borderColor:p.cssString(l),backgroundColor:new p.Color(l).setAlpha(.7).hex,...x},...f,children:[i.jsxRuntimeExports.jsx(j.Editable,{level:"small",value:m,onChange:h,color:A}),i.jsxRuntimeExports.jsx(j.Divider,{direction:"y",style:{borderColor:p.cssString(l)}}),i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",color:A,children:`${n.toFixed(2)} ${r}`})]})]});return b==null?B:wo.createPortal(B,b)}),_f=Object.freeze(Object.defineProperty({__proto__:null,Rule:$o},Symbol.toStringTag,{value:"Module"})),hl=j.canDropOfType(He),kf=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:o,showLegend:r=!0,legendPosition:l,onLegendPositionChange:c,titleLevel:a="h4",onLineChange:u,onRuleChange:d,onAxisChannelDrop:x,onAxisChange:f,rules:m,enableTooltip:h=!0,enableMeasure:y=!1,initialViewport:E=p.Eo.DECIMAL,legendVariant:R,onViewportChange:_,viewportTriggers:w,annotationProvider:S,onSelectRule:b,...P})=>{var B;const v=t.filter(({location:N})=>p.K.isY(N)),L=g.useRef(null),T=j.usePrevious(e.length),A=j.usePrevious(P.hold);return(T===0&&e.length!==0||A===!0&&P.hold===!1)&&((B=L.current)==null||B.reset()),i.jsxRuntimeExports.jsxs(Ki,{...P,children:[v.map((N,O)=>{const C=e.filter(D=>D.axes.x===N.key),$=t.filter(({location:D})=>p.K.isX(D)),k=m==null?void 0:m.filter(D=>[...$.map(({key:M})=>M),N.key].includes(D.axis));return i.jsxRuntimeExports.jsx(Pf,{axis:N,index:O,lines:C,yAxes:$,rules:k,onAxisChannelDrop:x,onAxisChange:f,annotationProvider:S,onRuleChange:d,onSelectRule:b},N.key)}),r&&i.jsxRuntimeExports.jsx(tl,{onLineChange:u,position:l,onPositionChange:c,variant:R}),n&&i.jsxRuntimeExports.jsx(sl,{value:s,onChange:o,level:a}),i.jsxRuntimeExports.jsxs(Ao,{initial:E,onChange:_,triggers:w,ref:L,children:[h&&i.jsxRuntimeExports.jsx(ol,{}),y&&i.jsxRuntimeExports.jsx(ml,{})]})]})},Pf=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:o,onSelectRule:r,onAxisChannelDrop:l,onAxisChange:c,axis:{location:a,key:u,showGrid:d,...x},annotationProvider:f})=>{const m=j.useDrop({type:"Channel.LinePlot.XAxis",canDrop:hl,onDrop:g.useCallback(({items:E})=>{const R=j.filterByType(He,E);return l==null||l(u,R.map(({key:_})=>_)),R},[u,l])}),h=s==null?void 0:s.filter(E=>E.axis===u),y=j.useDraggingState();return i.jsxRuntimeExports.jsxs(qi,{...x,...m,location:a,showGrid:d??n===0,className:p.CSS(p.CSS.dropRegion(j.canDropOfType(He)(y))),onAutoBoundsChange:E=>c==null?void 0:c({key:u,bounds:E}),children:[e.map((E,R)=>{const _=t.filter(S=>S.axes.y===E.key),w=s==null?void 0:s.filter(S=>S.axis===E.key);return i.jsxRuntimeExports.jsx(Nf,{axis:{...E,showGrid:d??(n===0&&R===0)},lines:_,rules:w,onRuleChange:o,onAxisChannelDrop:l,onAxisChange:c,onSelectRule:r},E.key)}),h==null?void 0:h.map(E=>g.createElement($o,{aetherKey:E.key,...E,key:E.key,onLabelChange:R=>o==null?void 0:o({key:E.key,label:R}),onPositionChange:R=>o==null?void 0:o({key:E.key,position:R}),onSelect:()=>r==null?void 0:r(E.key)})),i.jsxRuntimeExports.jsx(pl,{...f})]})},Mf=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Nf=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:o,axis:{key:r,location:l,...c},onSelectRule:a})=>{const u=j.useDrop({type:"Channel.LinePlot.YAxis",canDrop:hl,onDrop:g.useCallback(({items:x})=>{const f=j.filterByType(He,x);return s==null||s(r,f.map(({key:m})=>m)),f},[r,s])}),d=j.useDraggingState();return i.jsxRuntimeExports.jsxs(Ui,{...c,...u,location:l,className:p.CSS(p.CSS.dropRegion(j.canDropOfType(He)(d))),onAutoBoundsChange:x=>o==null?void 0:o({key:r,bounds:x}),children:[e.map(x=>i.jsxRuntimeExports.jsx(Lf,{line:x},Mf(x))),t==null?void 0:t.map(x=>g.createElement($o,{aetherKey:x.key,...x,key:x.key,onLabelChange:f=>n==null?void 0:n({key:x.key,label:f}),onPositionChange:f=>n==null?void 0:n({key:x.key,position:f}),onClick:()=>a==null?void 0:a(x.key)}))]})},Lf=({line:e})=>e.variant==="static"?i.jsxRuntimeExports.jsx(Af,{line:e}):i.jsxRuntimeExports.jsx(Tf,{line:e}),Tf=({line:{key:e,timeSpan:t,channels:{x:n,y:s},...o}})=>{const r=Number(t.valueOf())*3,l=I.streamChannelData({timeSpan:t,channel:s,keepFor:r}),c=n!=null&&n!==0,a=I.streamChannelData({timeSpan:t,channel:c?n:s,useIndexOfChannel:!c,keepFor:r});return i.jsxRuntimeExports.jsx(No,{aetherKey:e,y:l,x:a,...o})},Af=({line:{timeRange:e,key:t,channels:{x:n,y:s},...o}})=>{const r=I.channelData({timeRange:e,channel:s}),l=n!=null&&n!==0,c=I.channelData({timeRange:e,channel:l?n:s,useIndexOfChannel:!l});return i.jsxRuntimeExports.jsx(No,{aetherKey:t,y:r,x:c,...o})},br=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Zn=({items:e},t)=>{const n=j.filterByType(He,e);return n.length>0&&!n.every(s=>t.includes(s.key))},gl=["name","alias"],jl=e=>{const t=as();return g.useMemo(()=>e.length===0?br:br.filter(n=>e.includes(n.key)),[e,t])},$f=({columns:e=gl,onChange:t,className:n,value:s,searchOptions:o,...r})=>{const l=Be(),c=as(),a=jl(e),u=vo(),d=j.useMemoDeepEqualProps(o),x=g.useMemo(()=>l==null?void 0:l.channels.newSearcherWithOptions({rangeKey:u,internal:!1,...d}),[l,u,d]),f=l!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:m,onDragEnd:h,...y}=j.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(S=>Zn(S,H.A(s)),[s]),onDrop:g.useCallback(({items:S})=>{const b=j.filterByType(He,S);if(b.length===0)return[];const P=H.n([...H.A(s),...b.map(v=>v.key)]);return t(P,{clickedIndex:null,clicked:null,entries:[]}),b},[t,s])}),E=j.useDraggingState(),R=g.useCallback(({dropped:S})=>{t(H.A(s).filter(b=>!S.some(P=>P.key===b)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),_=g.useCallback((S,b)=>m([{key:b,type:He}],R),[m,R]),w=g.useCallback(S=>c[S.key]??S.name,[c]);return i.jsxRuntimeExports.jsx(Ht,{className:p.CSS(n,p.CSS.dropRegion(Zn(E,H.A(s)))),value:s,onTagDragStart:_,onTagDragEnd:h,searcher:x,onChange:t,columns:a,emptyContent:f,entryRenderKey:w,...y,...r})},ut=({columns:e=gl,onChange:t,value:n,className:s,data:o,searchOptions:r,...l})=>{const c=Be(),a=as(),u=jl(e),d=vo(),x=j.useMemoDeepEqualProps(r),f=g.useMemo(()=>{if(!(o!=null&&o.length>0))return c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:d,internal:!1,...x})},[c,d,o==null?void 0:o.length,x]),m=c!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),y=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:E,onDragEnd:R,..._}=j.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(P=>Zn(P,H.o$1(n)),[n]),onDrop:g.useCallback(({items:P})=>{const v=j.filterByType(He,P);return v.length===0?[]:(t(v[0].key,{clickedIndex:null,clicked:null,entries:[]}),v)},[y,t])}),w=j.useDraggingState(),S=g.useCallback(()=>n!=null&&E([{type:He,key:n}]),[E,n]),b=g.useCallback(P=>a[P.key]??P.name,[a]);return i.jsxRuntimeExports.jsx(dt,{data:o,className:p.CSS(s,p.CSS.dropRegion(Zn(w,H.o$1(n)))),value:n,onDragStart:S,onDragEnd:R,onChange:t,searcher:f,columns:u,emptyContent:m,entryRenderKey:b,..._,...l})},If=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:vp,AliasProvider:Zi,LinePlot:kf,SelectMultiple:$f,SelectSingle:ut,useActiveRange:vo,useAlias:Hi,useAliases:as,useContext:Fi,useName:us},Symbol.toStringTag,{value:"Module"})),xt=({path:e,optional:t=!1,onChange:n})=>{const s=Je(),{get:o,bind:r,set:l,setStatus:c}=s,[a,u]=g.useState(o(e,{optional:t}));g.useEffect(()=>(u(o(e,{optional:t})),r({path:e,onChange:u,listenToChildren:!1})),[e,n,r,o]);const d=g.useCallback(m=>{n==null||n(m,{...s,path:e}),l(e,m)},[e,l,n]),x=g.useCallback(m=>c(e,m),[e,c]);if(a==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let f;return s.mode==="preview"&&(f="preview"),{onChange:d,setStatus:x,variant:f,...a}},yl=(e,t=!1,n)=>{const{get:s,bind:o}=Je(n),[,r]=g.useState(0);return g.useEffect(()=>(r(l=>l+1),o({path:e,onChange:()=>r(l=>l+1)})),[e,o]),s(e,{optional:t})??null},El=(e,t=!1,n)=>{var l;const{get:s,bind:o}=Je(n),[,r]=g.useState(0);return g.useEffect(()=>(r(c=>c+1),o({path:e,onChange:()=>r(c=>c+1)})),[e,o]),((l=s(e,{optional:t}))==null?void 0:l.value)??null},Df=e=>{var t,n;return((n=(t=yl(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},Of=({path:e,ctx:t,onChange:n})=>{const s=Je(t);g.useEffect(()=>s.bind({path:e,onChange:o=>n(o,s),listenToChildren:!1}),[e,s])},zf=({path:e,optional:t=!1})=>{const{bind:n,get:s}=Je(),[o,r]=g.useState(s(e,{optional:t}));if(g.useEffect(()=>(r(s(e,{optional:t})),n({path:e,onChange:l=>r({...l,value:H.Y(l.value)}),listenToChildren:!0})),[e,n,s]),o==null&&!t)throw new Error("Field state is null");return(o==null?void 0:o.value)??null},Sl=(e,t)=>({add:(n,s)=>{const o=H.Y(e.get(t).value);o.splice(s,0,...H.A(n)),e.set(t,o,{validateChildren:!1})},push:(n,s)=>{const o=H.Y(e.get(t).value);o.push(...H.A(n)),s!=null&&o.sort(s),e.set(t,o,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,o=new Set(H.A(n));e.set(t,s.filter((r,l)=>!o.has(l)))},keepOnly:n=>{const s=e.get(t).value,o=new Set(H.A(n));e.set(t,s.filter((r,l)=>o.has(l)))},set:n=>e.set(t,H.executeSetter(n,e.get(t).value)),sort:n=>{const s=H.Y(e.get(t).value);s.sort(n),e.set(t,s)}}),Bf=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=Je(n),{bind:o,get:r}=s,[l,c]=g.useState(r(e).value);return g.useEffect(()=>(c(r(e).value),o({path:e,onChange:a=>{c(H.Y(a.value))},listenToChildren:t})),[e,o,r,c]),g.useMemo(()=>({value:l,...Sl(s,e)}),[l,s,e])},Io=g.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),Je=e=>{const t=g.useContext(Io);return e??t},vr=e=>({key:e,variant:"success",message:""}),Vf=e=>e.code===re.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",Rl=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:o})=>{const r=g.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),l=j.useSyncedRef(n),c=j.useSyncedRef(o),a=g.useCallback(({path:b,onChange:P,listenToChildren:v=!1})=>{var B;const{parentListeners:L,listeners:T}=r.current,A=v?L:T;return A.has(b)||A.set(b,new Set),(B=A.get(b))==null||B.add(P),()=>{var N;return(N=A.get(b))==null?void 0:N.delete(P)}},[]),u=g.useCallback((b,{optional:P}={optional:!1})=>{const{state:v,statuses:L,touched:T}=r.current,A=H._.get(v,b,{optional:P});if(A==null)return null;const B={value:A,status:L.get(b)??vr(b),touched:T.has(b),required:!1};if(l.current==null)return B;const N=l.current,O=H.N.getFieldSchema(N,b,{optional:!0});return O==null||(B.required=!O.isOptional()),B},[]),d=g.useCallback(b=>{const{state:P,statuses:v,touched:L,listeners:T,parentListeners:A}=r.current;H._.remove(P,b),v.delete(b),L.delete(b),T.delete(b),A.delete(b)},[]),x=g.useCallback(b=>{const{statuses:P,touched:v}=r.current;r.current.state=b,m(""),P.clear(),v.clear()},[]),f=g.useCallback(b=>{var L;const{listeners:P}=r.current,v=u(b,{optional:!0});v!=null&&((L=P.get(b))==null||L.forEach(T=>T(v)))},[]),m=g.useCallback(b=>{const{listeners:P,parentListeners:v}=r.current,L=P.get(b);if(b==""&&([...P.keys()].forEach(B=>{var O;const N=u(B,{optional:!0});N!=null&&((O=P.get(B))==null||O.forEach(C=>{C(N)}))}),[...v.keys()].forEach(B=>{var O;const N=u(B,{optional:!0});N!=null&&((O=v.get(B))==null||O.forEach(C=>{C(N)}))})),L!=null){const T=u(b,{optional:!0});T!=null&&L.forEach(A=>{A(T)})}v.forEach((T,A)=>{if(H._.pathsMatch(b,A)){const N=u(A,{optional:!0});N!=null&&T.forEach(O=>{O(N)})}})},[]),h=g.useCallback((b,P="",v=!0)=>{const{statuses:L,listeners:T,touched:A}=r.current;if(b.success){const C=[...L.keys()];return L.clear(),C.forEach($=>f($)),!0}let B=!0;const N=new Set(b.error.issues.map(C=>C.path.join(".")));let O=(C,$)=>C===$;return v&&(O=(C,$)=>H._.pathsMatch(C,$)),b.error.issues.forEach(C=>{var z;const{message:$}=C,k=C.path.join(".");if(!O(k,P))return;const D=Vf(C);D!=="warning"&&(B=!1),L.set(k,{key:k,variant:D,message:$}),A.add(k);let M=u(k,{optional:!0});M??(M={value:void 0,status:L.get(k)??vr(k),touched:!1,required:!1}),(z=T.get(k))==null||z.forEach(V=>V(M))}),L.forEach((C,$)=>{N.has($)||(L.delete($),f($))}),B},[]),y=g.useCallback((b,P)=>{if(l.current==null)return!0;const{state:v}=r.current,L=l.current.safeParse(v);return h(L,b,P)},[h]),E=g.useCallback(async(b,P)=>{if(l.current==null)return!0;const{state:v}=r.current,L=await l.current.safeParseAsync(v);return h(L,b,P)},[h]),R=g.useCallback((b,P,v={})=>{const L=H._.get(r.current.state,b,{optional:!0}),{validateChildren:T=!0}=v,{state:A,touched:B}=r.current;B.add(b),b.length===0?r.current.state=P:H._.set(A,b,P),m(b),(async()=>{var O;let N;try{N=y(b,T)}catch{N=await E(b,T)}(O=c.current)==null||O.call(c,{values:r.current.state,path:b,prev:L,valid:N})})()},[]),_=g.useCallback(b=>H._.has(r.current.state,b),[]),w=g.useCallback((b,P)=>{r.current.statuses.set(b,P),r.current.touched.add(b),f(b)},[]),S=g.useCallback(()=>{const{statuses:b}=r.current;b.clear(),b.forEach((P,v)=>f(v))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:b}=r.current;r.current.state=e,b.forEach((P,v)=>{const L=u(v,{optional:!0});L!=null&&P.forEach(T=>T(L))})},[t,e]),g.useMemo(()=>({bind:a,set:R,get:u,mode:s,validate:y,validateAsync:E,value:()=>r.current.state,has:_,remove:d,setStatus:w,clearStatuses:S,reset:x}),[a,R,u,y,E,_,d,w,S,x,s])},Ff=e=>i.jsxRuntimeExports.jsx(Io.Provider,{value:e,children:e.children}),Hf=j.componentRenderProp(j.Text$2),me=({path:e,children:t=Hf,label:n,padHelpText:s=!0,visible:o=!0,hideIfNull:r=!1,optional:l,onChange:c,className:a,...u})=>{const d=xt({path:e,optional:l??r,onChange:c}),x=Je();if(d==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??(n=p._$1.capitalize(H._.element(e,-1))),o=typeof o=="function"?o(d,x):o,!o)return null;const f=d.status.message,{onChange:m,value:h}=d,y={onChange:m,value:h};return d.variant!=null&&(y.variant=d.variant),i.jsxRuntimeExports.jsx(Me.Item,{padHelpText:s,helpText:f,helpTextVariant:d.status.variant,label:n,required:d.required,className:p.CSS(a,p.CSS.BE("field",e.split(".").join("-")),p.CSS.M(d.status.variant)),...u,children:t(y)})},wt=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const o=({inputProps:r,path:l,fieldKey:c=t,...a})=>i.jsxRuntimeExports.jsx(me,{...n,...a,path:c?`${l}.${c}`:l,children:u=>i.jsxRuntimeExports.jsx(e,{...u,...s,...r})});return o.displayName=e.displayName,o},Cl=wt(j.Numeric),Tt=Cl({}),wl=wt(j.Text$2),Do=wl({}),bl=wt(j.Switch$1),ps=bl({}),Zf=wt(dt),Gf=wt(Ht),Yf=wt(Re.DropdownButton),Oo=({key:e,open:t,onChange:n})=>{const s=j.useMemoPrimitiveArray(e);j.useAsyncEffect(async()=>{if(t==null)return;const o=await t();if(o!=null)return o.onChange(n),async()=>await o.close()},[t==null,s])},Wf=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return j.useAsyncEffect(async()=>{s(await e())},[e]),Oo({...t,onChange:s}),n},Xf=Object.freeze(Object.defineProperty({__proto__:null,useListener:Oo,useState:Wf},Symbol.toStringTag,{value:"Module"})),Kf=({key:e,name:t,queryFn:n,values:s,openObservable:o,applyChanges:r,applyObservable:l,...c})=>{const a=Be(),u=j.useAggregator(),d=j.useMemoPrimitiveArray(e),x=Rl({values:s,...c,sync:!1,onChange:h=>{a!=null&&(async()=>{try{await(r==null?void 0:r({...h,client:a}))}catch(y){u({variant:"error",message:`Failed to save ${t}`,description:y.message})}})()}});j.useAsyncEffect(async()=>{if(a!=null)try{const h=await n({client:a});x.set("",h)}catch(h){u({variant:"error",message:`Failed to retrieve ${t}`,description:h.message})}},[d,a==null?void 0:a.key]);const f=g.useCallback(async()=>{if(a!=null)return await(o==null?void 0:o(a))},[d,a==null?void 0:a.key]),m=g.useCallback(h=>l==null?void 0:l({changes:h,ctx:x}),[d,l]);return Oo({key:d,open:f,onChange:m}),x},qf=Object.freeze(Object.defineProperty({__proto__:null,Context:Io,Field:me,Form:Ff,NumericField:Tt,SwitchField:ps,TextField:Do,buildDropdownButtonSelectField:Yf,buildNumericField:Cl,buildSelectMultiField:Gf,buildSelectSingleField:Zf,buildSwitchField:bl,buildTextField:wl,fieldArrayUtils:Sl,fieldBuilder:wt,use:Rl,useChildFieldValues:zf,useContext:Je,useField:xt,useFieldArray:Bf,useFieldListener:Of,useFieldState:yl,useFieldValid:Df,useFieldValue:El,useSynced:Kf},Symbol.toStringTag,{value:"Module"})),Uf=[{key:"name",name:"Name"},{key:"location",name:"Location"}],Qf=({searchOptions:e,...t})=>{const n=Be();let s=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(s=n.hardware.devices.newSearcherWithOptions(e)),i.jsxRuntimeExports.jsx(dt,{columns:Uf,searcher:s,entryRenderKey:"name",...t})},Jf=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Qf},Symbol.toStringTag,{value:"Module"})),At="label",zo=[{key:"color",name:"Color",render:({entry:e})=>i.jsxRuntimeExports.jsx(j.xt.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Gn=({items:e},t)=>{const n=j.filterByType(At,e);return n.length>0&&!n.every(s=>t.includes(s.key))},em=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...o})=>i.jsxRuntimeExports.jsx(ln,{color:e==null?void 0:e.color,...o,children:e==null?void 0:e.name}),tm=j.componentRenderProp(em),nm=({onChange:e,className:t,value:n,...s})=>{const o=Be(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=j.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(f=>Gn(f,H.A(n)),[n]),onDrop:g.useCallback(({items:f})=>{const m=j.filterByType(At,f);if(m.length===0)return[];const h=H.n([...H.A(n),...m.map(y=>y.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=j.useDraggingState(),d=g.useCallback(({dropped:f})=>{e(H.A(n).filter(m=>!f.some(h=>h.key===m)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),x=g.useCallback((f,m)=>l([{key:m,type:At}],d),[l,d]);return i.jsxRuntimeExports.jsx(Ht,{className:p.CSS(t,p.CSS.dropRegion(Gn(u,H.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.labels,onChange:e,columns:zo,emptyContent:r,renderTag:tm,addPlaceholder:"Label",...a,...s})},vl=({value:e,onChange:t})=>{const n=Be(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=g.useId(),r=g.useMemo(()=>({key:o,type:"Label.SelectMultiple"}),[o]),l=j.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(u=>Gn(u,H.o$1(e)),[e]),onDrop:g.useCallback(({items:u})=>{const d=j.filterByType(At,u);return d.length===0?[]:(t(d[0].key,{clickedIndex:null,clicked:null,entries:[]}),d)},[r,t])}),c=j.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:At,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},sm=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=vl({value:t,onChange:e});return i.jsxRuntimeExports.jsx(dt,{data:s,className:p.CSS(n,p.CSS.dropRegion(Gn(r,H.o$1(t)))),value:t,onChange:e,columns:zo,entryRenderKey:"name",...l,...o})},om=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=vl({value:t,onChange:n});return i.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:zo,entryRenderKey:"name",...r,...s})},rm=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:At,SelectButton:om,SelectMultiple:nm,SelectSingle:sm},Symbol.toStringTag,{value:"Module"})),_l=({children:e,centered:t,visible:n,enabled:s=!0,close:o,style:r,...l})=>{const c=g.useRef(null),a=g.useRef(n);j.useClickOutside({ref:c,exclude:d=>j.findParent(d.target,f=>f.getAttribute("role")==="dialog")!=null,onClickOutside:o});const u=g.useCallback(d=>{var f;if(!a.current||d.stage!=="start")return;const x=(f=c.current)==null?void 0:f.querySelectorAll(`.${p.CSS.visible(!0)}`);x&&x.length>0||o()},[o]);return j.use$1({triggers:[["Escape"]],callback:u,loose:!0}),i.jsxRuntimeExports.jsx(J.Space,{className:p.CSS(p.CSS.BE("modal","bg"),p.CSS.visible(n),s&&p.CSS.M("enabled-modal")),empty:!0,align:"center",children:i.jsxRuntimeExports.jsx(J.Space,{className:p.CSS(p.CSS.BE("modal","dialog"),t&&p.CSS.M("centered")),role:"dialog",empty:!0,ref:c,...l,style:{zIndex:s?11:void 0,...r},children:i.jsxRuntimeExports.jsx(J.Space,{className:p.CSS(p.CSS.BE("modal","content")),empty:!0,children:e})})})},im=({root:e,...t})=>wo.createPortal(i.jsxRuntimeExports.jsx(_l,{...t}),j.getRootElement(e)),lm=Object.freeze(Object.defineProperty({__proto__:null,Dialog:_l,Modal:im},Symbol.toStringTag,{value:"Module"})),fs=new Error("Tab not found"),cm=new Error("Invalid Mosaic"),Yn=(e,t,n="center",s)=>{var x;if(e=et(e),s===void 0)return no(e,t);const o=so(e,s);if(n==="center")return(x=o.tabs)==null||x.push(t),o.selected=t.tabKey,e;const r=o.key*2,l=o.key*2+1,c=n==="top"||n==="left"?r:l;if(so(e,c).key!==o.key)return Yn(e,t,"center",c);if(o.tabs==null||o.tabs.length===0)return Yn(e,t,"center",s);const[a,u,d]=fm(n);if(o.direction=d,o[a]={key:0,tabs:[t],selected:t.tabKey},o[u]={key:0,tabs:o.tabs,selected:o.selected},o.first==null||o.last==null)throw cm;return o.first.key=r,o.last.key=l,o.tabs=void 0,o.size=void 0,o.selected=void 0,e},am=(e,t,n)=>{var r;e=et(e);const[s,o]=yt(e,t);if(s==null||o==null)throw fs;return o.tabs=(r=o.tabs)==null?void 0:r.map(l=>l.tabKey===t?n(l):l),e},no=(e,t)=>(e=et(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=no(e.first,t):e.last!=null&&(e.last=no(e.last,t)),e)),Wn=e=>{e=et(e);const t=[];if(e.tabs!=null&&(e.selected=Ee.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=Wn(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=Wn(e.last);e.last=n,t.push(...s)}return[e,t]},Bo=(e,t)=>{var o;e=et(e);const[,n]=yt(e,t);if(n==null)return[e,null];n.tabs=(o=n.tabs)==null?void 0:o.filter(r=>r.tabKey!==t),n.selected=Ee.resetSelection(n.selected,n.tabs),e=pm(e);const s=n.selected??Xn(e);return[e,s]},Xn=e=>e.selected!=null?e.selected:e.first!=null?Xn(e.first):e.last!=null?Xn(e.last):null,kl=(e,t)=>{e=et(e);const[n,s]=yt(e,t);if(n==null||s==null)throw fs;return s.selected=t,e},Pl=(e,t,n,s)=>{e=et(e);const[o,r]=yt(e,t);if(o==null||r==null)throw fs;const[l,c]=Bo(e,t);return[Yn(l,o,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}},Ml=(e,t,n)=>{const s=Kn(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},um=(e,t,n)=>{e=et(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 o=s.tabs.findIndex(d=>d.tabKey===t);if(o===-1)throw new Error("Tab not found in node");const r=s.tabs[o];s.tabs=s.tabs.filter(d=>d.tabKey!==t);const l=s.key*2,a={key:s.key*2+1,tabs:[r],selected:r.tabKey},u={key:l,tabs:s.tabs,selected:s.selected};return u.selected=Ee.resetSelection(u.selected,u.tabs),s.direction=n,s.first=u,s.last=a,s.tabs=void 0,s.selected=void 0,e},dm=(e,t)=>{const n=cn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Nl=(e,t,n)=>{e=et(e);const[,s]=yt(e,t);if((s==null?void 0:s.tabs)==null)throw fs;return s.tabs=Ee.rename(t,n,(s==null?void 0:s.tabs)??[]),e},xm=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,so=(e,t)=>{const n=Kn(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:so(e,s)},pm=e=>{let t=!0;for(;t;)[e,t]=oo(e);return e.first==null&&e.last==null&&(e.key=1),e},oo=e=>{if(e.first==null||e.last==null)return[e,!1];if(kr(e.first))return[_r(e.last,!0),!0];if(kr(e.last))return[_r(e.first,!1),!0];let t,n;return[e.first,t]=oo(e.first),[e.last,n]=oo(e.last),[e,t||n]},_r=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),kr=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),yt=(e,t)=>{if(e.tabs!=null){const l=e.tabs.find(c=>c.tabKey===t);if(l!=null)return[l,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=yt(e.first,t);if(n!=null&&s!=null)return[n,s];const[o,r]=yt(e.last,t);return[o,r]},Kn=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=Kn(e.first,t);return n??Kn(e.last,t)},fm=e=>{switch(e){case"top":return["first","last","y"];case"left":return["first","last","x"];case"bottom":return["last","first","y"];case"right":return["last","first","x"];case"center":throw new Error("cannot split a center placed tab")}},et=e=>H._.copy(e),qn=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&qn(e.first,t,n),e.last!=null&&qn(e.last,t,n),n),ro=(e,t)=>{t(e),e.first!=null&&ro(e.first,t),e.last!=null&&ro(e.last,t)};class Ll{constructor(t={}){Fe(this,"parent");Fe(this,"stub");Fe(this,"el");this.el=document.createElement("div"),Object.entries(t).forEach(([n,s])=>this.el.setAttribute(n,s))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}unmount(t){t!=null&&t!==this.stub||this.parent==null||this.stub==null||(this.parent.replaceChild(this.stub,this.el),this.parent=void 0,this.stub=void 0)}}const mm=({node:e})=>{const t=g.createRef(),n=g.useRef(e);return g.useEffect(()=>{const s=t.current;if(s==null)return;const o=s.parentNode;if(o!=null)return e.mount(o,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),g.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const s=t.current;if(s==null)return;const o=s.parentNode;o!=null&&e.mount(o,s)},[e]),i.jsxRuntimeExports.jsx("div",{ref:t})},Tl=({node:e,children:t})=>wo.createPortal(t,e.el),hm=Object.freeze(Object.defineProperty({__proto__:null,In:Tl,Node:Ll,Out:mm},Symbol.toStringTag,{value:"Module"})),Un=g.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:s,direction:o,first:r,last:l,key:c,size:a},emptyContent:u,...d}=n,x=g.useCallback(([h])=>t(c,h),[t]),{props:f}=j.useMultiple({direction:o,onResize:x,count:2,initialSizes:a!=null?[a]:void 0});let m;return s!==void 0?m=i.jsxRuntimeExports.jsx(Al,{emptyContent:u,...n}):r!=null&&l!=null?m=i.jsxRuntimeExports.jsxs(j.Multiple,{id:`mosaic-${c}`,align:"stretch",className:p.CSS.BE("mosaic","resize"),...f,children:[i.jsxRuntimeExports.jsx(Un,{...d,root:r,onResize:t},r.key),i.jsxRuntimeExports.jsx(Un,{...d,root:l,onResize:t},l.key)]}):(m=null,console.warn("Mosaic tree is malformed")),c===1?i.jsxRuntimeExports.jsx(j.Provider$3,{children:m}):m});Un.displayName="Mosaic";const Qn="pluto-mosaic-tab-drop",Vo="pluto-mosaic-tab-create",gm=(e,t,n)=>{if(j.filterByType(j.FILE_TYPE,t).length>0&&n)return!0;const o=j.filterByType(Qn,t).map(c=>c.key),r=e.filter(c=>!o.includes(c.tabKey)).length>0;return j.filterByType(Vo,t).length>0||o.length>0&&(r||e.length===0)},Al=g.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:o,onFileDrop:r,...l})=>{const{key:c,tabs:a}=e,[u,d]=g.useState(null),x=r!=null,f=g.useCallback(({items:b})=>gm(a,b,x),[a,x]),m=g.useCallback(({items:b,event:P})=>{if(P==null)return[];d(null);const v=j.filterByType(j.FILE_TYPE,b).length>0,L=a.length===0?"center":Mr(Pr(P));if(v)return r==null||r(c,L,P),b;const T=j.filterByType(Qn,b);if(T.length>0){const B=T.map(({key:N})=>N)[0];t(c,B,L)}const A=j.filterByType(Vo,b);if(A.length>0){const B=A.map(({key:N})=>N);n==null||n(c,L,B)}return T},[t,a.length]),h=g.useCallback(({event:b})=>{if(b==null)return;const P=a.length===0?"center":Mr(Pr(b));d(P)},[a.length]),{startDrag:y,...E}=j.useDragAndDrop({type:"Mosaic",canDrop:f,onDrop:m,onDragOver:h}),R=f(j.useDraggingState()),_=g.useCallback(()=>d(null),[]),w=g.useCallback((b,{tabKey:P})=>{y([{key:P,type:Qn,elementID:b.currentTarget.id}])},[y]),S=g.useCallback(()=>n==null?void 0:n(c,"center"),[c]);return i.jsxRuntimeExports.jsxs("div",{id:`mosaic-${c}`,className:p.CSS.BE("mosaic","leaf"),children:[i.jsxRuntimeExports.jsxs(Ee.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:_,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:w,onCreate:S,...l,...E,children:[e.selected!=null&&o(a.find(b=>b.tabKey===e.selected)),R&&i.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),u!=null&&i.jsxRuntimeExports.jsx("div",{className:p.CSS.BE("mosaic","mask"),style:jm[u]})]})});Al.displayName="MosaicTabLeaf";const jm={top:{left:"0%",top:"0%",width:"100%",height:"50%"},bottom:{left:"0%",top:"50%",width:"100%",height:"50%"},left:{left:"0%",top:"0%",width:"50%",height:"100%"},right:{left:"50%",top:"0%",width:"50%",height:"100%"},center:{left:"0%",top:"0%",width:"100%",height:"100%"}},Pr=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{px:.5,py:.5}:{px:n/t.width,py:s/t.height}},ym=e=>e,Em=e=>1-e,Mr=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[ym(e),Em(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")},Sm=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),o=new Set,r=qn(e,l=>{var c;return(c=l.tabs)==null?void 0:c.map(a=>{let u=s.current.get(a.tabKey);return a==null?null:(u==null&&(u=new Ll({style:"width: 100%; height: 100%; position: relative;"}),u.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,u)),o.add(a.tabKey),i.jsxRuntimeExports.jsx(Tl,{node:u,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})}).flat().filter(l=>l!=null);return s.current.forEach((l,c)=>!o.has(c)&&s.current.delete(c)),[s,r]},Rm=re.z.object({key:re.z.number(),tabs:re.z.array(Ee.tabZ).optional(),selected:re.z.string().optional(),direction:p.g.direction.optional(),size:re.z.number().optional()}),io=Rm.extend({first:re.z.lazy(()=>io).optional(),last:re.z.lazy(()=>io).optional()}),Cm=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(Wn(t)[0]),[t]),{root:n,onDrop:(u,d,x)=>s(f=>Pl(f,d,x,u)[0]),onClose:u=>s(d=>Bo(d,u)[0]),onSelect:u=>s(d=>kl(d,u)),onResize:(u,d)=>s(x=>Ml(x,u,d)),onRename:e?(u,d)=>s(x=>Nl(x,u,d)):void 0}},wm=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Vo,HAUL_DROP_TYPE:Qn,Mosaic:Un,autoSelectTabs:Wn,canSplit:dm,findSelected:Xn,findTabNode:cn,forEachNode:ro,insertTab:Yn,isEmpty:xm,mapNodes:qn,moveTab:Pl,nodeZ:io,removeTab:Bo,renameTab:Nl,resizeNode:Ml,selectTab:kl,split:um,updateTab:am,use:Cm,usePortal:Sm},Symbol.toStringTag,{value:"Module"})),bm=({variant:e,className:t,children:n,...s})=>i.jsxRuntimeExports.jsx(J.Space,{className:p.CSS(t,p.CSS.B("note"),p.CSS.M(e)),align:"stretch",empty:!0,...s,children:n}),vm=Object.freeze(Object.defineProperty({__proto__:null,Note:bm},Symbol.toStringTag,{value:"Module"})),zs={Close:i.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),i.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:i.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:i.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),i.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},_m=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:o,onFullscreen:r,onClose:l,...c})=>i.jsxRuntimeExports.jsxs(J.Space,{size:1.5,direction:"x",className:p.CSS(p.CSS.B("macos-controls"),!n&&p.CSS.BM("macos-controls","blurred"),t),...c,children:[i.jsxRuntimeExports.jsx(Bs,{onClick:l,className:p.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:zs.Close}),i.jsxRuntimeExports.jsx(Bs,{onClick:s,className:p.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:zs.Minimize}),i.jsxRuntimeExports.jsx(Bs,{onClick:r,className:p.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:zs.Maximize})]}),Bs=({className:e,disabled:t,color:n,...s})=>i.jsxRuntimeExports.jsx("button",{className:p.CSS(p.CSS.B("macos-control"),p.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),Vs=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:o,focused:r,...l})=>i.jsxRuntimeExports.jsxs(J.Pack,{...l,children:[i.jsxRuntimeExports.jsx(Fs,{className:p.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:i.jsxRuntimeExports.jsx(j.xt.Subtract,{})}),i.jsxRuntimeExports.jsx(Fs,{className:p.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:i.jsxRuntimeExports.jsx(j.xt.Box,{})}),i.jsxRuntimeExports.jsx(Fs,{onClick:s,className:p.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:i.jsxRuntimeExports.jsx(j.xt.Close,{})})]}),Fs=({disabled:e=!1,className:t,...n})=>e?null:i.jsxRuntimeExports.jsx(j.Icon,{className:p.CSS(p.CSS.B("windows-control"),t),tabIndex:-1,...n}),$l=e=>H.w.getOS(e),km={MacOS:_m,Windows:Vs,Linux:Vs,Docker:Vs},Pm="Windows",Mm=({forceOS:e,visibleIfOS:t,...n})=>{const s=$l({force:e,default:Pm}),o=km[s];return t!=null&&t!==s?null:i.jsxRuntimeExports.jsx(o,{...n})},Nm=Object.freeze(Object.defineProperty({__proto__:null,Controls:Mm,use:$l},Symbol.toStringTag,{value:"Module"})),Lm=(e,t)=>{const n=s=>i.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},Tm=Object.freeze(Object.defineProperty({__proto__:null,createComponent:Lm},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:H.B.NOOP});const Am=j.wrap$1(I.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const s=j.useMemoDeepEqualProps(n),[{path:o},,r]=j.use$3({aetherKey:e,type:I.Provider$2.TYPE,schema:I.providerStateZ$1,initialState:s});return g.useEffect(()=>{r(s)},[s,r]),i.jsxRuntimeExports.jsx(j.Composite,{path:o,children:t})}),$m="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Il=j.wrap$1(I.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=j.use$3({aetherKey:t,type:I.BaseProvider.TYPE,schema:I.providerStateZ$2,initialState:{}});return i.jsxRuntimeExports.jsx(j.Composite,{path:n,children:e})}),Im=Object.freeze(Object.defineProperty({__proto__:null,Provider:Il},Symbol.toStringTag,{value:"Module"})),Dm=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===H.Fg.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Dl=j.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:s,...o})=>{const r=j.useMemoDeepEqualProps({source:t,sink:n}),[,{status:l},c]=j.use$3({aetherKey:e,type:I.Chip.TYPE,schema:I.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:H.m.now()}}});g.useEffect(()=>{c(m=>({...m,...r}))},[r,c]);const a=g.useCallback(()=>c(m=>({...m,triggered:!m.triggered})),[c]),{message:u,chipColor:d,buttonStyle:x,disabled:f}=Dm(l);return i.jsxRuntimeExports.jsx(j.Icon,{variant:"text",className:p.CSS(p.CSS.B("control-chip"),s),disabled:f,onClick:a,tooltip:i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:u}),style:x,...o,children:i.jsxRuntimeExports.jsx(j.xt.Circle,{color:d})})}),Ol=g.createContext({needsControlOf:[]}),zl=()=>g.useContext(Ol),Om=j.wrap$1(I.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...s})=>{const o=j.useMemoDeepEqualProps(s),[{path:r},{status:l,needsControlOf:c},a]=j.use$3({aetherKey:e,type:I.Controller$1.TYPE,schema:I.controllerStateZ,initialState:o});return g.useEffect(()=>{l!=null&&(n==null||n(l))},[l,n]),g.useEffect(()=>{a(u=>({...u,...o}))},[o,a]),g.useEffect(()=>()=>n==null?void 0:n("released"),[]),i.jsxRuntimeExports.jsxs(Ol.Provider,{value:{needsControlOf:c},children:[i.jsxRuntimeExports.jsx(j.Composite,{path:r,children:t}),";"]})}),Bl=j.wrap$1(I.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var a;const s=j.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:o,status:r},l]=j.use$3({aetherKey:e,type:I.Indicator.TYPE,initialState:{...s,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:H.m.now()}},schema:I.indicatorStateZ});g.useEffect(()=>{l(u=>({...u,...s}))},[s,l]);let c;return((a=r.data)==null?void 0:a.color)!=null?c=p.Color.z.parse(r.data.color):o!=null&&!o.isZero?c=o:c="var(--pluto-gray-l8)",i.jsxRuntimeExports.jsxs(j.Dialog$1,{location:{x:"center",y:"bottom"},children:[i.jsxRuntimeExports.jsx(j.Text$1,{level:"p",children:r.message}),i.jsxRuntimeExports.jsx("div",{className:p.CSS.B("indicator"),style:{backgroundColor:p.cssString(c),flexGrow:1}})]})}),zm=j.wrap$1(I.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=zl(),[,{states:s},o]=j.use$3({aetherKey:e,type:I.Legend.TYPE,schema:I.legendStateZ,initialState:{states:[],needsControlOf:n}});g.useEffect(()=>{o(c=>({...c,needsControlOf:n}))},[n]);const l=H.n(s.map(c=>c.subject.key)).map(c=>{const a=s.find(u=>u.subject.key===c);if(a==null)throw new H.Re("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return i.jsxRuntimeExports.jsx(Mo,{data:l,...t})}),Vl=j.wrap$1(I.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=j.use$3({aetherKey:e,type:I.StateProvider.TYPE,schema:I.stateProviderStateZ,initialState:{}});return i.jsxRuntimeExports.jsx(j.Composite,{path:n,children:t})}),Bm=Object.freeze(Object.defineProperty({__proto__:null,Chip:Dl,Controller:Om,Indicator:Bl,Legend:zm,StateProvider:Vl,useContext:zl},Symbol.toStringTag,{value:"Module"})),Fl=e=>{const t=({disabled:n=!1,...s})=>n?s.children:i.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},Vm=Fl(Il),Fm=Fl(j.Provider$4),Hm=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:o,tooltip:r,triggers:l,alamos:c,haul:a,channelAlias:u,telem:d,color:x})=>i.jsxRuntimeExports.jsx(j.Provider$2,{...l,children:i.jsxRuntimeExports.jsx(j.Config,{...r,children:i.jsxRuntimeExports.jsx(j.Provider$3,{...a,children:i.jsxRuntimeExports.jsx(j.Provider$5,{url:s??$m,enabled:n,children:i.jsxRuntimeExports.jsx(Fm,{workerKey:"vis",children:i.jsxRuntimeExports.jsx(Am,{...c,children:i.jsxRuntimeExports.jsx(j.Aggregator,{children:i.jsxRuntimeExports.jsx(Vi,{connParams:t,children:i.jsxRuntimeExports.jsx(Zi,{...u,children:i.jsxRuntimeExports.jsx(Vm,{...d,children:i.jsxRuntimeExports.jsx(j.Provider$1,{...x,children:i.jsxRuntimeExports.jsx(j.Provider,{...o,children:i.jsxRuntimeExports.jsx(Vl,{children:e})})})})})})})})})})})})}),Zm=Object.freeze(Object.defineProperty({__proto__:null,Provider:Hm},Symbol.toStringTag,{value:"Module"})),Gm=({value:e})=>i.jsxRuntimeExports.jsx("div",{className:p.CSS.B("progress"),children:i.jsxRuntimeExports.jsx("div",{className:p.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Ym=Object.freeze(Object.defineProperty({__proto__:null,Progress:Gm},Symbol.toStringTag,{value:"Module"})),an="range",Fo=[{key:"name",name:"Name"}],Jn=({items:e},t)=>{const n=j.filterByType(an,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Wm=({onChange:e,className:t,value:n,...s})=>{const o=Be(),r=o!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=j.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(f=>Jn(f,H.A(n)),[n]),onDrop:g.useCallback(({items:f})=>{const m=j.filterByType(an,f);if(m.length===0)return[];const h=H.n([...H.A(n),...m.map(y=>y.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),m},[e,n])}),u=j.useDraggingState(),d=g.useCallback(({dropped:f})=>{e(H.A(n).filter(m=>!f.some(h=>h.key===m)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),x=g.useCallback((f,m)=>l([{key:m,type:an}],d),[l,d]);return i.jsxRuntimeExports.jsx(Ht,{className:p.CSS(t,p.CSS.dropRegion(Jn(u,H.A(n)))),value:n,onTagDragStart:x,onTagDragEnd:c,searcher:o==null?void 0:o.ranges,onChange:e,columns:Fo,emptyContent:r,entryRenderKey:"name",...a,...s})},Hl=({value:e,onChange:t})=>{const n=Be(),s=n!=null?void 0:i.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),o=g.useId(),r=g.useMemo(()=>({key:o,type:"Ranger.SelectMultiple"}),[o]),{startDrag:l,...c}=j.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(d=>Jn(d,H.o$1(e)),[e]),onDrop:g.useCallback(({items:d})=>{const x=j.filterByType(an,d);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[r,t])}),a=j.useDraggingState(),u=g.useCallback(()=>e!=null&&l([{type:an,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:u,searcher:n==null?void 0:n.ranges}},Xm=({onChange:e,value:t,className:n,data:s,...o})=>{const{dragging:r,...l}=Hl({value:t,onChange:e});return i.jsxRuntimeExports.jsx(dt,{data:s,className:p.CSS(n,p.CSS.dropRegion(Jn(r,H.o$1(t)))),value:t,onChange:e,columns:Fo,entryRenderKey:"name",...l,...o})},Km=({data:e,value:t,onChange:n,...s})=>{const{dragging:o,...r}=Hl({value:t,onChange:n});return i.jsxRuntimeExports.jsx(dt,{data:e,value:t,onChange:n,columns:Fo,entryRenderKey:"name",...r,...s})},qm=[{key:"color",name:"Color",width:50,render:e=>i.jsxRuntimeExports.jsx(j.xt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Um=e=>{const t=Be();return i.jsxRuntimeExports.jsx(Ht,{...e,searcher:t==null?void 0:t.labels,columns:qm,renderTag:n=>n.entry==null?i.jsxRuntimeExports.jsx(ln,{color:"gray",children:n.entryKey}):i.jsxRuntimeExports.jsx(ln,{color:n.entry.color,children:n.entry.name})})},Qm=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...o})=>{const r=new H.m(e.start),l=r.isToday?"time":"dateTime",c=new H.m(e.end),a=c.equals(H.m.MAX),u=c.span(r)<H.w$1.DAY?"time":"dateTime",d=r.span(c);return i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",size:"small",className:p.CSS(p.CSS.B("time-range-chip")),align:"center",...o,children:[r.isToday&&i.jsxRuntimeExports.jsx(j.Text$1,{level:t,shade:n,weight:450,children:"Today"}),i.jsxRuntimeExports.jsx(j.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:r}),i.jsxRuntimeExports.jsx(j.xt.Arrow.Right,{color:"var(--pluto-text-color)"}),a?i.jsxRuntimeExports.jsx(j.Text$1,{level:t,children:"Now"}):i.jsxRuntimeExports.jsx(j.DateTime,{level:t,displayTZ:"local",format:u,shade:n,weight:450,children:c}),!d.isZero&&s&&i.jsxRuntimeExports.jsxs(j.Text$1,{level:t,shade:n,weight:450,children:["(",r.span(c).truncate(H.w$1.MILLISECOND).toString(),")"]})]})},Jm=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Km,SelectLabels:Um,SelectMultiple:Wm,SelectSingle:Xm,TimeRangeChip:Qm},Symbol.toStringTag,{value:"Module"})),eh=({steps:e,value:t,onChange:n,...s})=>{const o=e.findIndex(r=>r.key===t);return i.jsxRuntimeExports.jsx(J.Space,{direction:"x",align:"center",className:p.CSS.B("steps"),...s,children:e.map((r,l)=>i.jsxRuntimeExports.jsxs(g.Fragment,{children:[i.jsxRuntimeExports.jsxs(j.Button,{onClick:()=>n(r.key),variant:"outlined",disabled:l>o,children:[l+1,". ",r.title]},r.key),l!==e.length-1&&i.jsxRuntimeExports.jsx(j.xt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},r.key))})},th=Object.freeze(Object.defineProperty({__proto__:null,Steps:eh},Symbol.toStringTag,{value:"Module"})),nh=j.wrap$1("Table",({aetherKey:e,children:t,className:n,visible:s,...o})=>{const[{path:r},,l]=j.use$3({aetherKey:e,type:I.Table.TYPE,schema:I.Table.stateZ,initialState:{region:p.Eo.ZERO,visible:s}});g.useEffect(()=>{l(a=>({...a,visible:s}))},[s]);const c=gn(a=>l(u=>({...u,region:a})));return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("div",{ref:c,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),i.jsxRuntimeExports.jsx("table",{className:p.CSS(p.CSS.B("table"),n),...o,children:i.jsxRuntimeExports.jsx("tbody",{children:i.jsxRuntimeExports.jsx(j.Composite,{path:r,children:t})})})]})}),sh=({children:e,className:t,size:n,index:s,onResize:o,onSelect:r,position:l,...c})=>i.jsxRuntimeExports.jsxs("tr",{className:p.CSS(p.CSS.BE("table","row"),t),...c,children:[o!=null&&i.jsxRuntimeExports.jsx(Gl,{onSelect:r,index:s,value:n,onChange:o,position:l,direction:"y"}),e]}),ms=g.forwardRef(({children:e,className:t,selected:n=!1,...s},o)=>i.jsxRuntimeExports.jsx("td",{ref:o,...s,className:p.CSS(p.CSS.BE("table","cell"),p.CSS.selected(n),t),children:e}));ms.displayName="Cell";const Zl="ABCDEFGHIJKLMNOPQRSTUVWXYZ",oh=e=>Zl[e],Gl=({value:e,selected:t=!1,index:n,onChange:s,position:o,direction:r="x",onSelect:l})=>{const c=j.useSyncedRef(e),a=g.useRef(e),u=j.useCursorDrag({onStart:g.useCallback(()=>{a.current=c.current},[]),onMove:g.useCallback(d=>s(a.current+p.Eo.dim(d,r,!0),n),[s,n])});return i.jsxRuntimeExports.jsxs("td",{id:`resizer-${r}-${n}`,className:p.CSS(p.CSS.BE("table","resizer"),p.CSS.dir(r),p.CSS.selected(t),j.CONTEXT_TARGET,t&&j.CONTEXT_SELECTED),style:{[p.g.dimension(r)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[i.jsxRuntimeExports.jsx(j.Text$1,{level:"p",shade:7,style:{width:"100%",textAlign:"center"},children:r==="x"?Zl[n]:n+1}),i.jsxRuntimeExports.jsx("button",{onClick:d=>d.stopPropagation(),style:{[p.g.location(r)]:o+e},onDragStart:u,draggable:!0})]})},rh=({selected:e,onSelect:t,columns:n,onResize:s})=>{let o=15;return i.jsxRuntimeExports.jsxs("tr",{className:p.CSS(p.CSS.BE("table","row"),p.CSS.BE("table","col-resizer")),children:[i.jsxRuntimeExports.jsx("td",{}),n.map((r,l)=>{const c=o;return o+=r,i.jsxRuntimeExports.jsx(Gl,{onSelect:t,position:c,selected:e.includes(l),index:l,value:r,onChange:a=>s(a,l),direction:"x"},l)})]})},ih=Object.freeze(Object.defineProperty({__proto__:null,Cell:ms,ColumnIndicators:rh,Row:sh,Table:nh,getCellColumn:oh},Symbol.toStringTag,{value:"Module"})),lh=[{key:"standard",name:"Standard"},{key:"scientific",name:"Scientific"},{key:"engineering",name:"Engineering"}],ch=({...e})=>i.jsxRuntimeExports.jsx(Re.Button,{...e,entryRenderKey:"name",data:lh}),Yl=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Ho=({path:e})=>{var m;const{value:t,onChange:n}=xt({path:e}),s=I.sourcePipelinePropsZ.parse((m=t.telem)==null?void 0:m.props),o=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),r=I.stringifyNumberProps.parse(s.segments.stringifier.props),l=I.rollingAverageProps.parse(s.segments.rollingAverage.props),c=h=>{const y=I.sourcePipeline("string",{connections:Yl,segments:{valueStream:I.streamChannelValue({channel:o.channel}),stringifier:I.stringifyNumber({precision:r.precision??2,notation:r.notation}),rollingAverage:I.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:y})},a=h=>c({valueStream:I.streamChannelValue({channel:h??0})}),u=h=>c({stringifier:I.stringifyNumber({...r,notation:h})}),d=h=>c({stringifier:I.stringifyNumber({...r,precision:h})}),x=h=>c({rollingAverage:I.rollingAverage({windowSize:h})}),f=us(o.channel);return g.useEffect(()=>n({...t,tooltip:[f]}),[f]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Me.Item,{label:"Input Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:o.channel,onChange:a})}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Me.Item,{label:"Notation",children:i.jsxRuntimeExports.jsx(ch,{value:r.notation,onChange:u})}),i.jsxRuntimeExports.jsx(Me.Item,{label:"Precision",align:"start",children:i.jsxRuntimeExports.jsx(j.Numeric,{value:r.precision??2,bounds:{lower:0,upper:10},onChange:d})}),i.jsxRuntimeExports.jsx(Me.Item,{label:"Averaging Window",align:"start",children:i.jsxRuntimeExports.jsx(j.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:x})})]})]})},ah=I.Value.z.partial({color:!0}).extend({level:H.levelZ.optional()}),Zo=({aetherKey:e,box:t,telem:n,color:s,precision:o,minWidth:r,level:l="small",backgroundTelem:c,notation:a,location:u})=>{const d=j.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:o,level:l,minWidth:r,notation:a,backgroundTelem:c,location:u}),[,x,f]=j.use$3({aetherKey:e,type:I.Value.TYPE,schema:I.Value.z,initialState:d});return g.useEffect(()=>f(m=>({...m,...d})),[d]),{width:x.width??x.minWidth}},uh=Object.freeze(Object.defineProperty({__proto__:null,TelemForm:Ho,VALUE_CONNECTIONS:Yl,corePropsZ:ah,use:Zo},Symbol.toStringTag,{value:"Module"})),dh=re.z.object({value:re.z.string(),level:H.levelZ,weight:H.weightZ,align:p.K.x.or(p.K.center),backgroundColor:p.crudeZ}),xh=({cellKey:e,onChange:t,value:n,selected:s,onSelect:o,align:r,level:l,weight:c,backgroundColor:a})=>{const u=x=>o(e,x),d=x=>t({level:l,value:x,weight:c,align:r,backgroundColor:a});return i.jsxRuntimeExports.jsx(ms,{id:e,className:p.CSS(j.CONTEXT_TARGET,s&&j.CONTEXT_SELECTED,p.CSS.BEM("table","cell","text")),selected:s,onClick:u,onContextMenu:u,style:{backgroundColor:p.cssString(a)},children:i.jsxRuntimeExports.jsx(j.Editable,{level:l,value:n,weight:c,onChange:d,style:{justifyContent:r},allowEmpty:!0})})},ph=re.z.object({telem:I.stringSourceSpecZ,redline:re.z.object({bounds:p.H.bounds,gradient:p.gradientZ}),level:H.levelZ,color:re.z.string(),units:re.z.string()}),fh=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:o,bounds:r},selected:l,box:c,onSelect:a})=>{const{width:u}=Zo({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:p.b.Scale.scale(r).scale(0,1).transform}),gradient:I.colorGradient({gradient:o})},outlet:"gradient"}),location:{x:"center",y:"center"}}),d=x=>a(e,x);return i.jsxRuntimeExports.jsx(ms,{id:e,selected:l,onClick:d,onContextMenu:d,style:{height:"5rem",width:u},className:p.CSS(j.CONTEXT_TARGET,l&&j.CONTEXT_SELECTED,p.CSS.BEM("table","cell","value"))})},mh=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return i.jsxRuntimeExports.jsx(J.Space,{direction:"y",style:{padding:"2rem"},children:i.jsxRuntimeExports.jsx(Ho,{path:""})});case"redline":return i.jsxRuntimeExports.jsx(J.Space,{direction:"y",style:{padding:"2rem"},children:i.jsxRuntimeExports.jsx(hh,{})});default:return i.jsxRuntimeExports.jsx(J.Space,{direction:"y",grow:!0,empty:!0,style:{padding:"2rem"},children:i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Me.Item,{label:"Variant",padHelpText:!1,children:i.jsxRuntimeExports.jsx(Wl,{onChange:e,value:"value"})}),i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:o,onChange:r,variant:l,...c})=>i.jsxRuntimeExports.jsx(j.Swatch,{value:o??p.ZERO.setAlpha(1).rgba255,onChange:a=>r(a.rgba255),...c,bordered:!0})}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:o=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...o})})]})})}},[]),n=Ee.useStatic({tabs:[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],content:t});return i.jsxRuntimeExports.jsx(Ee.Tabs,{...n})},hh=()=>{const{set:e,get:t}=Je(),n=El("redline.bounds"),s=p.b.Scale.scale(0,1).scale(n);return i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Tt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Lower",path:"redline.bounds.lower"}),i.jsxRuntimeExports.jsx(me,{path:"redline.gradient",label:"Gradient",align:"start",padHelpText:!1,children:({value:o,onChange:r})=>i.jsxRuntimeExports.jsx(j.GradientPicker,{value:H._.copy(o),scale:s,onChange:l=>{const a={...t("redline.bounds").value},u=l.map(y=>y.position),d=s.pos(Math.max(...u)),x=s.pos(Math.min(...u)),f=d>a.upper,m=x<a.lower;f&&(l[l.length-1].position=1,a.upper=d),m&&(l[0].position=0,a.lower=x);const h=l.map(y=>({...y,color:new p.Color(y.color).hex}));f||m?e("redline",{bounds:a,gradient:h}):r(l.map(y=>({...y,color:new p.Color(y.color).hex})))}})}),i.jsxRuntimeExports.jsx(Tt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Upper",path:"redline.bounds.upper"})]})},gh=({onVariantChange:e})=>i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",grow:!0,style:{padding:"2rem"},children:[i.jsxRuntimeExports.jsx(Me.Item,{label:"Variant",padHelpText:!1,children:i.jsxRuntimeExports.jsx(Wl,{onChange:e,value:"text"})}),i.jsxRuntimeExports.jsx(Do,{path:"value",label:"Text"}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"weight",label:"Weight",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Re.SelectWeight,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"align",label:"Alignment",hideIfNull:!0,children:t=>i.jsxRuntimeExports.jsx(ds,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>i.jsxRuntimeExports.jsx(j.Swatch,{value:t,onChange:n})})]}),jh=[{key:"text",name:"Text"},{key:"value",name:"Value"}],Wl=({onChange:e,value:t})=>i.jsxRuntimeExports.jsx(Re.Button,{value:t,onChange:e,data:jh,allowMultiple:!1,entryRenderKey:"name"}),yh=["text","value"],Eh=re.z.enum(yh),Sh={key:"value",name:"Value",Form:mh,Cell:fh,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:ph},Rh={key:"text",name:"Text",Form:gh,Cell:xh,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:dh},Ch={text:Rh,value:Sh},wh=Object.freeze(Object.defineProperty({__proto__:null,CELLS:Ch,variantZ:Eh},Symbol.toStringTag,{value:"Module"})),Nr=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const o=ft(e,...n);return p.G.distance(o,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",o),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Lr=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:o,targetBox:r})=>{if(!bh({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=p.g.construct(t),c=p.g.swap(l);let a=gt(c,s[c]-e[c]);const u=p.Eo.loc(n,a);if(p.K.swap(t)===o){const d=p.Eo.loc(r,p.K.swap(a));Math.abs(u-d)<Le&&(a=p.K.swap(a))}return{direction:c,length:u-e[c]+Et(a,Le)}},lo=re.z.object({direction:p.g.direction,length:re.z.number()}),ft=(e,...t)=>{let n=e;for(const s of t)n=p.G.translate(n,s.direction,s.length);return n},Xl=(e,t,n,s)=>{try{let o=e;const r=[e,...t.map(m=>(o=p.G.translate(o,m.direction,m.length),o))];if(!s)return r;const l=t[0],c=gt(l.direction,l.length),a=Tr(c),u=4*(2-n**.5);r[0]=p.G.translate(r[0],{[l.direction]:-1*a*u,[p.g.swap(l.direction)]:0});const d=t[t.length-1],x=gt(d.direction,d.length),f=Tr(x);return r[r.length-1]=p.G.translate(r[r.length-1],{[d.direction]:f*u,[p.g.swap(d.direction)]:0}),r}catch{return[]}},Le=10,Tr=e=>e==="top"||e==="left"?-1:1,Et=(e,t)=>e==="top"||e==="left"?-t:t,gt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",it=e=>gt(e.direction,e.length),bh=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=p.g.construct(n),o=t[s]-e[s];return Et(n,o)<0},vn=e=>({direction:p.g.construct(e),length:Et(e,Le)}),Ar={top:vn("top"),bottom:vn("bottom"),left:vn("left"),right:vn("right")},vh=4,_h=.25,hs=e=>co(kh(co(e))),kh=e=>{const t=[...e],n=e.findIndex((s,o)=>{const r=Math.abs(s.length);if(r<vh){if(o===0||o===e.length-1)return!1;if(r<_h)return!0;if(e.length<=3)return!1;if(o+2<e.length){const l=t[o+2];if(l.direction!==s.direction)return!1;t[o+2]={...l,length:l.length+s.length}}else{const l=t[o-2];if(l.direction!==s.direction)return!1;t[o-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},co=e=>{const t=[...e];return e.findIndex((s,o)=>{const r=t[o-1];if(o===0||s.direction!==r.direction)return!1;if(o===1){const l=o-1,c=o,a=it(r),u=it(s);if(a===u)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(r.length)===Le)return!1;const d=Et(a,Le),x=t[l].length-d,f=t[c].length+x;return Math.abs(f)<Le?!1:(t[l]={...t[l],length:d},t[c]={...t[c],length:f},!0)}if(o===e.length-1){const l=o,c=o-1,a=it(s),u=it(r);if(a===u)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(s.length)===Le)return!1;const d=Et(a,Le),x=t[l].length-d,f=t[c].length+x;return Math.abs(f)<Le?!1:(t[l]={...t[l],length:d},t[c]={...t[c],length:f},!0)}return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0})!==-1?co(t):t},Pt=e=>hs(Ph(e)),Ph=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:o,sourceOrientation:r})=>{let l=r,c=o,a={...Ar[r]},u=ft(n,a);const d={...Ar[o]};let x=ft(s,d);const f=Math.abs(u.x-x.x),m=Math.abs(u.y-x.y);f<2*Le&&m<10&&(a.length-=f/2,d.length+=f/2,u=ft(n,a),x=ft(s,d));const h=[a],y=Lr({sourceStumpTip:u,sourceOrientation:r,sourceBox:e,targetStumpTip:x,targetOrientation:o,targetBox:t});y!=null&&(h.push(y),u=ft(u,y),l=it(y),a=y);const E=Lr({sourceStumpTip:x,sourceOrientation:c,sourceBox:t,targetStumpTip:u,targetOrientation:l,targetBox:e});E!=null&&(x=ft(x,E),c=gt(E.direction,E.length));const R=()=>{E!=null&&(E.length*=-1,h.push(E)),d.length*=-1,h.push(d)};if(p.K.swap(l)===o){const v=p.g.construct(l),L=(x[v]-u[v])/2;h.push({direction:v,length:L});const T=p.g.swap(v);return h.push({direction:T,length:x[T]-u[T]}),h.push({direction:v,length:L}),R(),h}const _=x[a.direction]-u[a.direction];let w=p.g.swap(a.direction);const S=u[w]-x[w];let b;gt(a.direction,_)===l&&gt(w,S)===c?b={direction:a.direction,length:_}:(b={direction:w,length:x[w]-u[w]},w=p.g.swap(w)),h.push(b);const P={direction:w,length:x[w]-u[w]};return h.push(P),R(),h},Mh=e=>hs(Nh(e)),Nh=({segments:e,index:t,magnitude:n})=>{const s=[...e],o=s[t],r=p.g.swap(o.direction),l=it(o);if(t===0){s.unshift({direction:r,length:n});const c=Et(l,Le);s.unshift({direction:o.direction,length:c}),t+=2,s[t]={...s[t],length:s[t].length-c}}else s[t-1]={direction:s[t-1].direction,length:s[t-1].length+n};if(t===s.length-1){s.push({direction:r,length:-n});const c=Et(l,Le);s.push({direction:o.direction,length:c}),s[t]={...s[t],length:s[t].length-c}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},Lh=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},Th=(e,t,n=!1,...s)=>{const o=(r,l)=>!s.includes(l)&&t(r,l);return n?Lh(e,o):e.findIndex(o)},Ah=({delta:e,segments:t})=>hs(Kl(e,t,!1)),$h=({delta:e,segments:t})=>hs(Kl(e,t,!0)),Kl=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Ir("x",e,s,n)),e.y!==0&&(s=Ir("y",e,s,n)),s},$r=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},o=it(t),r=it(s),l=Math.abs(s.length),c=Math.abs(t.length);return(l>c||l>Le)&&o===r},Ir=(e,t,n,s)=>{const o=p.g.swap(e),r=s?n.length-1:0,l=n[r];if($r(e,l,t)){const x=n[n.length-1];return x.direction===e&&Math.abs(l.length)<Le?(n[n.length-1]={...x,length:x.length-t[e]},n):(n[r]={...l,length:l.length-t[e]},n)}const c=s?0:n.length-1,u=Th(n,x=>x.direction===e,s,r);if(u===c){const x=n[c];return $r(e,x,t)?(n[c]={...x,length:x.length-t[e]},n):(l.direction===e&&Math.abs(l.length)>x.length?n[r]={...l,length:l.length-t[e]}:n[c]={...x,length:x.length-t[e]},n)}if(u===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:o,length:n[0].length/2},{direction:e,length:-t[e]},{direction:o,length:n[0].length/2}]:l.direction===e?(n[r]={...l,length:l.length-t[e]},n):[{direction:o,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const d=n[u];return n[u]={...d,length:d.length-t[e]},n},Ih=re.z.object({position:p.G.xy,zoom:re.z.number()}),ql=re.z.object({color:p.crudeZ,variant:re.z.string().optional(),segments:re.z.array(lo)}),Dh=ql.extend({key:re.z.string(),source:re.z.string(),target:re.z.string(),segments:re.z.array(lo),color:p.crudeZ,id:re.z.string(),data:re.z.object({segments:re.z.array(lo),color:p.crudeZ,variant:re.z.string().optional()}).optional(),selected:re.z.boolean(),sourceHandle:re.z.string().nullable().optional(),targetHandle:re.z.string().nullable().optional()}),Oh=re.z.object({key:re.z.string(),position:p.G.xy,selected:re.z.boolean().optional(),zIndex:re.z.number().optional(),type:re.z.string().optional(),data:re.z.record(re.z.unknown()).optional(),measured:re.z.object({width:re.z.number().optional(),height:re.z.number().optional()}).optional()}),Go=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),Yo=e=>e.map(({segments:t,color:n,variant:s,...o})=>({...o,id:o.key,data:{segments:t,color:n,variant:s}})),Ul=e=>e.map(t=>({key:t.id,...t})),Ql=(e,t)=>e.map(n=>{var s,o,r;return n.data??(n.data={segments:[],color:t,variant:"pipe"}),{key:n.id,segments:((s=n.data)==null?void 0:s.segments)??[],selected:n.selected??!1,color:((o=n.data)==null?void 0:o.color)??t,variant:((r=n.data)==null?void 0:r.variant)??"pipe",...n}}),Jl=e=>({...e.position,zoom:e.zoom}),ec=e=>({position:p.G.construct(e),zoom:e.zoom}),tc=(e,t)=>Ul(t(Go(e))),zn=(e,t,n)=>Ql(t(Yo(e)),n),zh=(e,t="x")=>{if(e.length===0)return[];const n=p.K.construct(t),s=p.K.swap(n);return e.sort((o,r)=>p.Eo.loc(o.box,n)-p.Eo.loc(r.box,n)),e.forEach((o,r)=>{if(r===0)return;const c=e[r-1].handles.find(m=>m.orientation===s),a=o.handles.find(m=>m.orientation===n);if(c==null||a==null)return;const u=c.absolutePosition,d=a.absolutePosition,x=p.G.set(p.G.translation(d,u),t,0),f=p.G.translate(p.Eo.topLeft(o.box),x);o.box=p.Eo.construct(f,p.Eo.dims(o.box))}),e};function Ce(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=Ce(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Bh={value:()=>{}};function gs(){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 Bn(n)}function Bn(e){this._=e}function Vh(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",o=n.indexOf(".");if(o>=0&&(s=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Bn.prototype=gs.prototype={constructor:Bn,on:function(e,t){var n=this._,s=Vh(e+"",n),o,r=-1,l=s.length;if(arguments.length<2){for(;++r<l;)if((o=(e=s[r]).type)&&(o=Fh(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<l;)if(o=(e=s[r]).type)n[o]=Dr(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Dr(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Bn(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),s=0,o,r;s<o;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,r=s.length;o<r;++o)s[o].value.apply(t,n)}};function Fh(e,t){for(var n=0,s=e.length,o;n<s;++n)if((o=e[n]).name===t)return o.value}function Dr(e,t,n){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=Bh,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var ao="http://www.w3.org/1999/xhtml";const Or={svg:"http://www.w3.org/2000/svg",xhtml:ao,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function js(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Or.hasOwnProperty(t)?{space:Or[t],local:e}:e}function Hh(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ao&&t.documentElement.namespaceURI===ao?t.createElement(e):t.createElementNS(n,e)}}function Zh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function nc(e){var t=js(e);return(t.local?Zh:Hh)(t)}function Gh(){}function Wo(e){return e==null?Gh:function(){return this.querySelector(e)}}function Yh(e){typeof e!="function"&&(e=Wo(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=new Array(l),a,u,d=0;d<l;++d)(a=r[d])&&(u=e.call(a,a.__data__,d,r))&&("__data__"in a&&(u.__data__=a.__data__),c[d]=u);return new $e(s,this._parents)}function Wh(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Xh(){return[]}function sc(e){return e==null?Xh:function(){return this.querySelectorAll(e)}}function Kh(e){return function(){return Wh(e.apply(this,arguments))}}function qh(e){typeof e=="function"?e=Kh(e):e=sc(e);for(var t=this._groups,n=t.length,s=[],o=[],r=0;r<n;++r)for(var l=t[r],c=l.length,a,u=0;u<c;++u)(a=l[u])&&(s.push(e.call(a,a.__data__,u,l)),o.push(a));return new $e(s,o)}function oc(e){return function(){return this.matches(e)}}function rc(e){return function(t){return t.matches(e)}}var Uh=Array.prototype.find;function Qh(e){return function(){return Uh.call(this.children,e)}}function Jh(){return this.firstElementChild}function eg(e){return this.select(e==null?Jh:Qh(typeof e=="function"?e:rc(e)))}var tg=Array.prototype.filter;function ng(){return Array.from(this.children)}function sg(e){return function(){return tg.call(this.children,e)}}function og(e){return this.selectAll(e==null?ng:sg(typeof e=="function"?e:rc(e)))}function rg(e){typeof e!="function"&&(e=oc(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=[],a,u=0;u<l;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&c.push(a);return new $e(s,this._parents)}function ic(e){return new Array(e.length)}function ig(){return new $e(this._enter||this._groups.map(ic),this._parents)}function es(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}es.prototype={constructor:es,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function lg(e){return function(){return e}}function cg(e,t,n,s,o,r){for(var l=0,c,a=t.length,u=r.length;l<u;++l)(c=t[l])?(c.__data__=r[l],s[l]=c):n[l]=new es(e,r[l]);for(;l<a;++l)(c=t[l])&&(o[l]=c)}function ag(e,t,n,s,o,r,l){var c,a,u=new Map,d=t.length,x=r.length,f=new Array(d),m;for(c=0;c<d;++c)(a=t[c])&&(f[c]=m=l.call(a,a.__data__,c,t)+"",u.has(m)?o[c]=a:u.set(m,a));for(c=0;c<x;++c)m=l.call(e,r[c],c,r)+"",(a=u.get(m))?(s[c]=a,a.__data__=r[c],u.delete(m)):n[c]=new es(e,r[c]);for(c=0;c<d;++c)(a=t[c])&&u.get(f[c])===a&&(o[c]=a)}function ug(e){return e.__data__}function dg(e,t){if(!arguments.length)return Array.from(this,ug);var n=t?ag:cg,s=this._parents,o=this._groups;typeof e!="function"&&(e=lg(e));for(var r=o.length,l=new Array(r),c=new Array(r),a=new Array(r),u=0;u<r;++u){var d=s[u],x=o[u],f=x.length,m=xg(e.call(d,d&&d.__data__,u,s)),h=m.length,y=c[u]=new Array(h),E=l[u]=new Array(h),R=a[u]=new Array(f);n(d,x,y,E,R,m,t);for(var _=0,w=0,S,b;_<h;++_)if(S=y[_]){for(_>=w&&(w=_+1);!(b=E[w])&&++w<h;);S._next=b||null}}return l=new $e(l,s),l._enter=c,l._exit=a,l}function xg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pg(){return new $e(this._exit||this._groups.map(ic),this._parents)}function fg(e,t,n){var s=this.enter(),o=this,r=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?r.remove():n(r),s&&o?s.merge(o).order():o}function mg(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,o=n.length,r=s.length,l=Math.min(o,r),c=new Array(o),a=0;a<l;++a)for(var u=n[a],d=s[a],x=u.length,f=c[a]=new Array(x),m,h=0;h<x;++h)(m=u[h]||d[h])&&(f[h]=m);for(;a<o;++a)c[a]=n[a];return new $e(c,this._parents)}function hg(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],o=s.length-1,r=s[o],l;--o>=0;)(l=s[o])&&(r&&l.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(l,r),r=l);return this}function gg(e){e||(e=jg);function t(x,f){return x&&f?e(x.__data__,f.__data__):!x-!f}for(var n=this._groups,s=n.length,o=new Array(s),r=0;r<s;++r){for(var l=n[r],c=l.length,a=o[r]=new Array(c),u,d=0;d<c;++d)(u=l[d])&&(a[d]=u);a.sort(t)}return new $e(o,this._parents).order()}function jg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function yg(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Eg(){return Array.from(this)}function Sg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,r=s.length;o<r;++o){var l=s[o];if(l)return l}return null}function Rg(){let e=0;for(const t of this)++e;return e}function Cg(){return!this.node()}function wg(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var o=t[n],r=0,l=o.length,c;r<l;++r)(c=o[r])&&e.call(c,c.__data__,r,o);return this}function bg(e){return function(){this.removeAttribute(e)}}function vg(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _g(e,t){return function(){this.setAttribute(e,t)}}function kg(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Pg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Mg(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 Ng(e,t){var n=js(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?vg:bg:typeof t=="function"?n.local?Mg:Pg:n.local?kg:_g)(n,t))}function lc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Lg(e){return function(){this.style.removeProperty(e)}}function Tg(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ag(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function $g(e,t,n){return arguments.length>1?this.each((t==null?Lg:typeof t=="function"?Ag:Tg)(e,t,n??"")):$t(this.node(),e)}function $t(e,t){return e.style.getPropertyValue(t)||lc(e).getComputedStyle(e,null).getPropertyValue(t)}function Ig(e){return function(){delete this[e]}}function Dg(e,t){return function(){this[e]=t}}function Og(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function zg(e,t){return arguments.length>1?this.each((t==null?Ig:typeof t=="function"?Og:Dg)(e,t)):this.node()[e]}function cc(e){return e.trim().split(/^|\s+/)}function Xo(e){return e.classList||new ac(e)}function ac(e){this._node=e,this._names=cc(e.getAttribute("class")||"")}ac.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 uc(e,t){for(var n=Xo(e),s=-1,o=t.length;++s<o;)n.add(t[s])}function dc(e,t){for(var n=Xo(e),s=-1,o=t.length;++s<o;)n.remove(t[s])}function Bg(e){return function(){uc(this,e)}}function Vg(e){return function(){dc(this,e)}}function Fg(e,t){return function(){(t.apply(this,arguments)?uc:dc)(this,e)}}function Hg(e,t){var n=cc(e+"");if(arguments.length<2){for(var s=Xo(this.node()),o=-1,r=n.length;++o<r;)if(!s.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?Fg:t?Bg:Vg)(n,t))}function Zg(){this.textContent=""}function Gg(e){return function(){this.textContent=e}}function Yg(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Wg(e){return arguments.length?this.each(e==null?Zg:(typeof e=="function"?Yg:Gg)(e)):this.node().textContent}function Xg(){this.innerHTML=""}function Kg(e){return function(){this.innerHTML=e}}function qg(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Ug(e){return arguments.length?this.each(e==null?Xg:(typeof e=="function"?qg:Kg)(e)):this.node().innerHTML}function Qg(){this.nextSibling&&this.parentNode.appendChild(this)}function Jg(){return this.each(Qg)}function ej(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function tj(){return this.each(ej)}function nj(e){var t=typeof e=="function"?e:nc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function sj(){return null}function oj(e,t){var n=typeof e=="function"?e:nc(e),s=t==null?sj:typeof t=="function"?t:Wo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function rj(){var e=this.parentNode;e&&e.removeChild(this)}function ij(){return this.each(rj)}function lj(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function cj(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function aj(e){return this.select(e?cj:lj)}function uj(e){return arguments.length?this.property("__data__",e):this.node().__data__}function dj(e){return function(t){e.call(this,t,this.__data__)}}function xj(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 pj(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,o=t.length,r;n<o;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++s]=r;++s?t.length=s:delete this.__on}}}function fj(e,t,n){return function(){var s=this.__on,o,r=dj(t);if(s){for(var l=0,c=s.length;l<c;++l)if((o=s[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=r,o.options=n),o.value=t;return}}this.addEventListener(e.type,r,n),o={type:e.type,name:e.name,value:t,listener:r,options:n},s?s.push(o):this.__on=[o]}}function mj(e,t,n){var s=xj(e+""),o,r=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var a=0,u=c.length,d;a<u;++a)for(o=0,d=c[a];o<r;++o)if((l=s[o]).type===d.type&&l.name===d.name)return d.value}return}for(c=t?fj:pj,o=0;o<r;++o)this.each(c(s[o],t,n));return this}function xc(e,t,n){var s=lc(e),o=s.CustomEvent;typeof o=="function"?o=new o(t,n):(o=s.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function hj(e,t){return function(){return xc(this,e,t)}}function gj(e,t){return function(){return xc(this,e,t.apply(this,arguments))}}function jj(e,t){return this.each((typeof t=="function"?gj:hj)(e,t))}function*yj(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,r=s.length,l;o<r;++o)(l=s[o])&&(yield l)}var pc=[null];function $e(e,t){this._groups=e,this._parents=t}function yn(){return new $e([[document.documentElement]],pc)}function Ej(){return this}$e.prototype=yn.prototype={constructor:$e,select:Yh,selectAll:qh,selectChild:eg,selectChildren:og,filter:rg,data:dg,enter:ig,exit:pg,join:fg,merge:mg,selection:Ej,order:hg,sort:gg,call:yg,nodes:Eg,node:Sg,size:Rg,empty:Cg,each:wg,attr:Ng,style:$g,property:zg,classed:Hg,text:Wg,html:Ug,raise:Jg,lower:tj,append:nj,insert:oj,remove:ij,clone:aj,datum:uj,on:mj,dispatch:jj,[Symbol.iterator]:yj};function Ae(e){return typeof e=="string"?new $e([[document.querySelector(e)]],[document.documentElement]):new $e([[e]],pc)}function Sj(e){let t;for(;t=e.sourceEvent;)e=t;return e}function De(e,t){if(e=Sj(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const Rj={passive:!1},un={capture:!0,passive:!1};function Hs(e){e.stopImmediatePropagation()}function Lt(e){e.preventDefault(),e.stopImmediatePropagation()}function fc(e){var t=e.document.documentElement,n=Ae(e).on("dragstart.drag",Lt,un);"onselectstart"in t?n.on("selectstart.drag",Lt,un):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function mc(e,t){var n=e.document.documentElement,s=Ae(e).on("dragstart.drag",null);t&&(s.on("click.drag",Lt,un),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 _n=e=>()=>e;function uo(e,{sourceEvent:t,subject:n,target:s,identifier:o,active:r,x:l,y:c,dx:a,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}uo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Cj(e){return!e.ctrlKey&&!e.button}function wj(){return this.parentNode}function bj(e,t){return t??{x:e.x,y:e.y}}function vj(){return navigator.maxTouchPoints||"ontouchstart"in this}function hc(){var e=Cj,t=wj,n=bj,s=vj,o={},r=gs("start","drag","end"),l=0,c,a,u,d,x=0;function f(S){S.on("mousedown.drag",m).filter(s).on("touchstart.drag",E).on("touchmove.drag",R,Rj).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(S,b){if(!(d||!e.call(this,S,b))){var P=w(this,t.call(this,S,b),S,b,"mouse");P&&(Ae(S.view).on("mousemove.drag",h,un).on("mouseup.drag",y,un),fc(S.view),Hs(S),u=!1,c=S.clientX,a=S.clientY,P("start",S))}}function h(S){if(Lt(S),!u){var b=S.clientX-c,P=S.clientY-a;u=b*b+P*P>x}o.mouse("drag",S)}function y(S){Ae(S.view).on("mousemove.drag mouseup.drag",null),mc(S.view,u),Lt(S),o.mouse("end",S)}function E(S,b){if(e.call(this,S,b)){var P=S.changedTouches,v=t.call(this,S,b),L=P.length,T,A;for(T=0;T<L;++T)(A=w(this,v,S,b,P[T].identifier,P[T]))&&(Hs(S),A("start",S,P[T]))}}function R(S){var b=S.changedTouches,P=b.length,v,L;for(v=0;v<P;++v)(L=o[b[v].identifier])&&(Lt(S),L("drag",S,b[v]))}function _(S){var b=S.changedTouches,P=b.length,v,L;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),v=0;v<P;++v)(L=o[b[v].identifier])&&(Hs(S),L("end",S,b[v]))}function w(S,b,P,v,L,T){var A=r.copy(),B=De(T||P,b),N,O,C;if((C=n.call(S,new uo("beforestart",{sourceEvent:P,target:f,identifier:L,active:l,x:B[0],y:B[1],dx:0,dy:0,dispatch:A}),v))!=null)return N=C.x-B[0]||0,O=C.y-B[1]||0,function $(k,D,M){var z=B,V;switch(k){case"start":o[L]=$,V=l++;break;case"end":delete o[L],--l;case"drag":B=De(M||D,b),V=l;break}A.call(k,S,new uo(k,{sourceEvent:D,subject:C,target:f,identifier:L,active:V,x:B[0]+N,y:B[1]+O,dx:B[0]-z[0],dy:B[1]-z[1],dispatch:A}),v)}}return f.filter=function(S){return arguments.length?(e=typeof S=="function"?S:_n(!!S),f):e},f.container=function(S){return arguments.length?(t=typeof S=="function"?S:_n(S),f):t},f.subject=function(S){return arguments.length?(n=typeof S=="function"?S:_n(S),f):n},f.touchable=function(S){return arguments.length?(s=typeof S=="function"?S:_n(!!S),f):s},f.on=function(){var S=r.on.apply(r,arguments);return S===r?f:S},f.clickDistance=function(S){return arguments.length?(x=(S=+S)*S,f):Math.sqrt(x)},f}var It=0,en=0,Qt=0,gc=1e3,ts,tn,ns=0,St=0,ys=0,dn=typeof performance=="object"&&performance.now?performance:Date,jc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ko(){return St||(jc(_j),St=dn.now()+ys)}function _j(){St=0}function ss(){this._call=this._time=this._next=null}ss.prototype=yc.prototype={constructor:ss,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ko():+n)+(t==null?0:+t),!this._next&&tn!==this&&(tn?tn._next=this:ts=this,tn=this),this._call=e,this._time=n,xo()},stop:function(){this._call&&(this._call=null,this._time=1/0,xo())}};function yc(e,t,n){var s=new ss;return s.restart(e,t,n),s}function kj(){Ko(),++It;for(var e=ts,t;e;)(t=St-e._time)>=0&&e._call.call(void 0,t),e=e._next;--It}function zr(){St=(ns=dn.now())+ys,It=en=0;try{kj()}finally{It=0,Mj(),St=0}}function Pj(){var e=dn.now(),t=e-ns;t>gc&&(ys-=t,ns=e)}function Mj(){for(var e,t=ts,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ts=n);tn=e,xo(s)}function xo(e){if(!It){en&&(en=clearTimeout(en));var t=e-St;t>24?(e<1/0&&(en=setTimeout(zr,e-dn.now()-ys)),Qt&&(Qt=clearInterval(Qt))):(Qt||(ns=dn.now(),Qt=setInterval(Pj,gc)),It=1,jc(zr))}}function Br(e,t,n){var s=new ss;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,n),s}var Nj=gs("start","end","cancel","interrupt"),Lj=[],Ec=0,Vr=1,po=2,Vn=3,Fr=4,fo=5,Fn=6;function Es(e,t,n,s,o,r){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;Tj(e,n,{name:t,index:s,group:o,on:Nj,tween:Lj,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ec})}function qo(e,t){var n=Ve(e,t);if(n.state>Ec)throw new Error("too late; already scheduled");return n}function Ye(e,t){var n=Ve(e,t);if(n.state>Vn)throw new Error("too late; already running");return n}function Ve(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Tj(e,t,n){var s=e.__transition,o;s[t]=n,n.timer=yc(r,0,n.time);function r(u){n.state=Vr,n.timer.restart(l,n.delay,n.time),n.delay<=u&&l(u-n.delay)}function l(u){var d,x,f,m;if(n.state!==Vr)return a();for(d in s)if(m=s[d],m.name===n.name){if(m.state===Vn)return Br(l);m.state===Fr?(m.state=Fn,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete s[d]):+d<t&&(m.state=Fn,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete s[d])}if(Br(function(){n.state===Vn&&(n.state=Fr,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=po,n.on.call("start",e,e.__data__,n.index,n.group),n.state===po){for(n.state=Vn,o=new Array(f=n.tween.length),d=0,x=-1;d<f;++d)(m=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++x]=m);o.length=x+1}}function c(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=fo,1),x=-1,f=o.length;++x<f;)o[x].call(e,d);n.state===fo&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Fn,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function Hn(e,t){var n=e.__transition,s,o,r=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){r=!1;continue}o=s.state>po&&s.state<fo,s.state=Fn,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}r&&delete e.__transition}}function Aj(e){return this.each(function(){Hn(this,e)})}function $j(e,t){var n,s;return function(){var o=Ye(this,e),r=o.tween;if(r!==n){s=n=r;for(var l=0,c=s.length;l<c;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}o.tween=s}}function Ij(e,t,n){var s,o;if(typeof n!="function")throw new Error;return function(){var r=Ye(this,e),l=r.tween;if(l!==s){o=(s=l).slice();for(var c={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=c;break}a===u&&o.push(c)}r.tween=o}}function Dj(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Ve(this.node(),n).tween,o=0,r=s.length,l;o<r;++o)if((l=s[o]).name===e)return l.value;return null}return this.each((t==null?$j:Ij)(n,e,t))}function Uo(e,t,n){var s=e._id;return e.each(function(){var o=Ye(this,s);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Ve(o,s).value[t]}}function Sc(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 Oj(e){return function(){this.removeAttribute(e)}}function zj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Bj(e,t,n){var s,o=n+"",r;return function(){var l=this.getAttribute(e);return l===o?null:l===s?r:r=t(s=l,n)}}function Vj(e,t,n){var s,o=n+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===s?r:r=t(s=l,n)}}function Fj(e,t,n){var s,o,r;return function(){var l,c=n(this),a;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),a=c+"",l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c)))}}function Hj(e,t,n){var s,o,r;return function(){var l,c=n(this),a;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),a=c+"",l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c)))}}function Zj(e,t){var n=js(e),s=n==="transform"?Mp:Sc;return this.attrTween(e,typeof t=="function"?(n.local?Hj:Fj)(n,s,Uo(this,"attr."+e,t)):t==null?(n.local?zj:Oj)(n):(n.local?Vj:Bj)(n,s,t))}function Gj(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Yj(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Wj(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&Yj(e,r)),n}return o._value=t,o}function Xj(e,t){var n,s;function o(){var r=t.apply(this,arguments);return r!==s&&(n=(s=r)&&Gj(e,r)),n}return o._value=t,o}function Kj(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=js(e);return this.tween(n,(s.local?Wj:Xj)(s,t))}function qj(e,t){return function(){qo(this,e).delay=+t.apply(this,arguments)}}function Uj(e,t){return t=+t,function(){qo(this,e).delay=t}}function Qj(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qj:Uj)(t,e)):Ve(this.node(),t).delay}function Jj(e,t){return function(){Ye(this,e).duration=+t.apply(this,arguments)}}function ey(e,t){return t=+t,function(){Ye(this,e).duration=t}}function ty(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Jj:ey)(t,e)):Ve(this.node(),t).duration}function ny(e,t){if(typeof t!="function")throw new Error;return function(){Ye(this,e).ease=t}}function sy(e){var t=this._id;return arguments.length?this.each(ny(t,e)):Ve(this.node(),t).ease}function oy(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ye(this,e).ease=n}}function ry(e){if(typeof e!="function")throw new Error;return this.each(oy(this._id,e))}function iy(e){typeof e!="function"&&(e=oc(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var r=t[o],l=r.length,c=s[o]=[],a,u=0;u<l;++u)(a=r[u])&&e.call(a,a.__data__,u,r)&&c.push(a);return new Qe(s,this._parents,this._name,this._id)}function ly(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,o=n.length,r=Math.min(s,o),l=new Array(s),c=0;c<r;++c)for(var a=t[c],u=n[c],d=a.length,x=l[c]=new Array(d),f,m=0;m<d;++m)(f=a[m]||u[m])&&(x[m]=f);for(;c<s;++c)l[c]=t[c];return new Qe(l,this._parents,this._name,this._id)}function cy(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 ay(e,t,n){var s,o,r=cy(t)?qo:Ye;return function(){var l=r(this,e),c=l.on;c!==s&&(o=(s=c).copy()).on(t,n),l.on=o}}function uy(e,t){var n=this._id;return arguments.length<2?Ve(this.node(),n).on.on(e):this.each(ay(n,e,t))}function dy(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function xy(){return this.on("end.remove",dy(this._id))}function py(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wo(e));for(var s=this._groups,o=s.length,r=new Array(o),l=0;l<o;++l)for(var c=s[l],a=c.length,u=r[l]=new Array(a),d,x,f=0;f<a;++f)(d=c[f])&&(x=e.call(d,d.__data__,f,c))&&("__data__"in d&&(x.__data__=d.__data__),u[f]=x,Es(u[f],t,n,f,u,Ve(d,n)));return new Qe(r,this._parents,t,n)}function fy(e){var t=this._name,n=this._id;typeof e!="function"&&(e=sc(e));for(var s=this._groups,o=s.length,r=[],l=[],c=0;c<o;++c)for(var a=s[c],u=a.length,d,x=0;x<u;++x)if(d=a[x]){for(var f=e.call(d,d.__data__,x,a),m,h=Ve(d,n),y=0,E=f.length;y<E;++y)(m=f[y])&&Es(m,t,n,y,f,h);r.push(f),l.push(d)}return new Qe(r,l,t,n)}var my=yn.prototype.constructor;function hy(){return new my(this._groups,this._parents)}function gy(e,t){var n,s,o;return function(){var r=$t(this,e),l=(this.style.removeProperty(e),$t(this,e));return r===l?null:r===n&&l===s?o:o=t(n=r,s=l)}}function Rc(e){return function(){this.style.removeProperty(e)}}function jy(e,t,n){var s,o=n+"",r;return function(){var l=$t(this,e);return l===o?null:l===s?r:r=t(s=l,n)}}function yy(e,t,n){var s,o,r;return function(){var l=$t(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),$t(this,e))),l===a?null:l===s&&a===o?r:(o=a,r=t(s=l,c))}}function Ey(e,t){var n,s,o,r="style."+t,l="end."+r,c;return function(){var a=Ye(this,e),u=a.on,d=a.value[r]==null?c||(c=Rc(t)):void 0;(u!==n||o!==d)&&(s=(n=u).copy()).on(l,o=d),a.on=s}}function Sy(e,t,n){var s=(e+="")=="transform"?Pp:Sc;return t==null?this.styleTween(e,gy(e,s)).on("end.style."+e,Rc(e)):typeof t=="function"?this.styleTween(e,yy(e,s,Uo(this,"style."+e,t))).each(Ey(this._id,e)):this.styleTween(e,jy(e,s,t),n).on("end.style."+e,null)}function Ry(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function Cy(e,t,n){var s,o;function r(){var l=t.apply(this,arguments);return l!==o&&(s=(o=l)&&Ry(e,l,n)),s}return r._value=t,r}function wy(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,Cy(e,t,n??""))}function by(e){return function(){this.textContent=e}}function vy(e){return function(){var t=e(this);this.textContent=t??""}}function _y(e){return this.tween("text",typeof e=="function"?vy(Uo(this,"text",e)):by(e==null?"":e+""))}function ky(e){return function(t){this.textContent=e.call(this,t)}}function Py(e){var t,n;function s(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&ky(o)),t}return s._value=e,s}function My(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,Py(e))}function Ny(){for(var e=this._name,t=this._id,n=Cc(),s=this._groups,o=s.length,r=0;r<o;++r)for(var l=s[r],c=l.length,a,u=0;u<c;++u)if(a=l[u]){var d=Ve(a,t);Es(a,e,n,u,l,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Qe(s,this._parents,e,n)}function Ly(){var e,t,n=this,s=n._id,o=n.size();return new Promise(function(r,l){var c={value:l},a={value:function(){--o===0&&r()}};n.each(function(){var u=Ye(this,s),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(a)),u.on=t}),o===0&&r()})}var Ty=0;function Qe(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Cc(){return++Ty}var Ke=yn.prototype;Qe.prototype={constructor:Qe,select:py,selectAll:fy,selectChild:Ke.selectChild,selectChildren:Ke.selectChildren,filter:iy,merge:ly,selection:hy,transition:Ny,call:Ke.call,nodes:Ke.nodes,node:Ke.node,size:Ke.size,empty:Ke.empty,each:Ke.each,on:uy,attr:Zj,attrTween:Kj,style:Sy,styleTween:wy,text:_y,textTween:My,remove:xy,tween:Dj,delay:Qj,duration:ty,ease:sy,easeVarying:ry,end:Ly,[Symbol.iterator]:Ke[Symbol.iterator]};function Ay(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $y={time:null,delay:0,duration:250,ease:Ay};function Iy(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Dy(e){var t,n;e instanceof Qe?(t=e._id,e=e._name):(t=Cc(),(n=$y).time=Ko(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,r=0;r<o;++r)for(var l=s[r],c=l.length,a,u=0;u<c;++u)(a=l[u])&&Es(a,e,t,u,l,n||Iy(a,t));return new Qe(s,this._parents,e,t)}yn.prototype.interrupt=Aj;yn.prototype.transition=Dy;const kn=e=>()=>e;function Oy(e,{sourceEvent:t,target:n,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function qe(e,t,n){this.k=e,this.x=t,this.y=n}qe.prototype={constructor:qe,scale:function(e){return e===1?this:new qe(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qe(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 Ss=new qe(1,0,0);wc.prototype=qe.prototype;function wc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ss;return e.__zoom}function Zs(e){e.stopImmediatePropagation()}function Jt(e){e.preventDefault(),e.stopImmediatePropagation()}function zy(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function By(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Hr(){return this.__zoom||Ss}function Vy(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Fy(){return navigator.maxTouchPoints||"ontouchstart"in this}function Hy(e,t,n){var s=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),l>r?(r+l)/2:Math.min(0,r)||Math.max(0,l))}function bc(){var e=zy,t=By,n=Hy,s=Vy,o=Fy,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=Ap,u=gs("start","zoom","end"),d,x,f,m=500,h=150,y=0,E=10;function R(C){C.property("__zoom",Hr).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",A).filter(o).on("touchstart.zoom",B).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}R.transform=function(C,$,k,D){var M=C.selection?C.selection():C;M.property("__zoom",Hr),C!==M?b(C,$,k,D):M.interrupt().each(function(){P(this,arguments).event(D).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},R.scaleBy=function(C,$,k,D){R.scaleTo(C,function(){var M=this.__zoom.k,z=typeof $=="function"?$.apply(this,arguments):$;return M*z},k,D)},R.scaleTo=function(C,$,k,D){R.transform(C,function(){var M=t.apply(this,arguments),z=this.__zoom,V=k==null?S(M):typeof k=="function"?k.apply(this,arguments):k,Z=z.invert(V),Y=typeof $=="function"?$.apply(this,arguments):$;return n(w(_(z,Y),V,Z),M,l)},k,D)},R.translateBy=function(C,$,k,D){R.transform(C,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),l)},null,D)},R.translateTo=function(C,$,k,D,M){R.transform(C,function(){var z=t.apply(this,arguments),V=this.__zoom,Z=D==null?S(z):typeof D=="function"?D.apply(this,arguments):D;return n(Ss.translate(Z[0],Z[1]).scale(V.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof k=="function"?-k.apply(this,arguments):-k),z,l)},D,M)};function _(C,$){return $=Math.max(r[0],Math.min(r[1],$)),$===C.k?C:new qe($,C.x,C.y)}function w(C,$,k){var D=$[0]-k[0]*C.k,M=$[1]-k[1]*C.k;return D===C.x&&M===C.y?C:new qe(C.k,D,M)}function S(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function b(C,$,k,D){C.on("start.zoom",function(){P(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(D).end()}).tween("zoom",function(){var M=this,z=arguments,V=P(M,z).event(D),Z=t.apply(M,z),Y=k==null?S(Z):typeof k=="function"?k.apply(M,z):k,ee=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),K=M.__zoom,U=typeof $=="function"?$.apply(M,z):$,Q=a(K.invert(Y).concat(ee/K.k),U.invert(Y).concat(ee/U.k));return function(ne){if(ne===1)ne=U;else{var W=Q(ne),ie=ee/W[2];ne=new qe(ie,Y[0]-W[0]*ie,Y[1]-W[1]*ie)}V.zoom(null,ne)}})}function P(C,$,k){return!k&&C.__zooming||new v(C,$)}function v(C,$){this.that=C,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,$),this.taps=0}v.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,$){return this.mouse&&C!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var $=Ae(this.that).datum();u.call(C,this.that,new Oy(C,{sourceEvent:this.sourceEvent,target:R,type:C,transform:this.that.__zoom,dispatch:u}),$)}};function L(C,...$){if(!e.apply(this,arguments))return;var k=P(this,$).event(C),D=this.__zoom,M=Math.max(r[0],Math.min(r[1],D.k*Math.pow(2,s.apply(this,arguments)))),z=De(C);if(k.wheel)(k.mouse[0][0]!==z[0]||k.mouse[0][1]!==z[1])&&(k.mouse[1]=D.invert(k.mouse[0]=z)),clearTimeout(k.wheel);else{if(D.k===M)return;k.mouse=[z,D.invert(z)],Hn(this),k.start()}Jt(C),k.wheel=setTimeout(V,h),k.zoom("mouse",n(w(_(D,M),k.mouse[0],k.mouse[1]),k.extent,l));function V(){k.wheel=null,k.end()}}function T(C,...$){if(f||!e.apply(this,arguments))return;var k=C.currentTarget,D=P(this,$,!0).event(C),M=Ae(C.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",ee,!0),z=De(C,k),V=C.clientX,Z=C.clientY;fc(C.view),Zs(C),D.mouse=[z,this.__zoom.invert(z)],Hn(this),D.start();function Y(K){if(Jt(K),!D.moved){var U=K.clientX-V,Q=K.clientY-Z;D.moved=U*U+Q*Q>y}D.event(K).zoom("mouse",n(w(D.that.__zoom,D.mouse[0]=De(K,k),D.mouse[1]),D.extent,l))}function ee(K){M.on("mousemove.zoom mouseup.zoom",null),mc(K.view,D.moved),Jt(K),D.event(K).end()}}function A(C,...$){if(e.apply(this,arguments)){var k=this.__zoom,D=De(C.changedTouches?C.changedTouches[0]:C,this),M=k.invert(D),z=k.k*(C.shiftKey?.5:2),V=n(w(_(k,z),D,M),t.apply(this,$),l);Jt(C),c>0?Ae(this).transition().duration(c).call(b,V,D,C):Ae(this).call(R.transform,V,D,C)}}function B(C,...$){if(e.apply(this,arguments)){var k=C.touches,D=k.length,M=P(this,$,C.changedTouches.length===D).event(C),z,V,Z,Y;for(Zs(C),V=0;V<D;++V)Z=k[V],Y=De(Z,this),Y=[Y,this.__zoom.invert(Y),Z.identifier],M.touch0?!M.touch1&&M.touch0[2]!==Y[2]&&(M.touch1=Y,M.taps=0):(M.touch0=Y,z=!0,M.taps=1+!!d);d&&(d=clearTimeout(d)),z&&(M.taps<2&&(x=Y[0],d=setTimeout(function(){d=null},m)),Hn(this),M.start())}}function N(C,...$){if(this.__zooming){var k=P(this,$).event(C),D=C.changedTouches,M=D.length,z,V,Z,Y;for(Jt(C),z=0;z<M;++z)V=D[z],Z=De(V,this),k.touch0&&k.touch0[2]===V.identifier?k.touch0[0]=Z:k.touch1&&k.touch1[2]===V.identifier&&(k.touch1[0]=Z);if(V=k.that.__zoom,k.touch1){var ee=k.touch0[0],K=k.touch0[1],U=k.touch1[0],Q=k.touch1[1],ne=(ne=U[0]-ee[0])*ne+(ne=U[1]-ee[1])*ne,W=(W=Q[0]-K[0])*W+(W=Q[1]-K[1])*W;V=_(V,Math.sqrt(ne/W)),Z=[(ee[0]+U[0])/2,(ee[1]+U[1])/2],Y=[(K[0]+Q[0])/2,(K[1]+Q[1])/2]}else if(k.touch0)Z=k.touch0[0],Y=k.touch0[1];else return;k.zoom("touch",n(w(V,Z,Y),k.extent,l))}}function O(C,...$){if(this.__zooming){var k=P(this,$).event(C),D=C.changedTouches,M=D.length,z,V;for(Zs(C),f&&clearTimeout(f),f=setTimeout(function(){f=null},m),z=0;z<M;++z)V=D[z],k.touch0&&k.touch0[2]===V.identifier?delete k.touch0:k.touch1&&k.touch1[2]===V.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(V=De(V,this),Math.hypot(x[0]-V[0],x[1]-V[1])<E)){var Z=Ae(this).on("dblclick.zoom");Z&&Z.apply(this,arguments)}}}return R.wheelDelta=function(C){return arguments.length?(s=typeof C=="function"?C:kn(+C),R):s},R.filter=function(C){return arguments.length?(e=typeof C=="function"?C:kn(!!C),R):e},R.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:kn(!!C),R):o},R.extent=function(C){return arguments.length?(t=typeof C=="function"?C:kn([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),R):t},R.scaleExtent=function(C){return arguments.length?(r[0]=+C[0],r[1]=+C[1],R):[r[0],r[1]]},R.translateExtent=function(C){return arguments.length?(l[0][0]=+C[0][0],l[1][0]=+C[1][0],l[0][1]=+C[0][1],l[1][1]=+C[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(C){return arguments.length?(n=C,R):n},R.duration=function(C){return arguments.length?(c=+C,R):c},R.interpolate=function(C){return arguments.length?(a=C,R):a},R.on=function(){var C=u.on.apply(u,arguments);return C===u?R:C},R.clickDistance=function(C){return arguments.length?(y=(C=+C)*C,R):Math.sqrt(y)},R.tapDistance=function(C){return arguments.length?(E=+C,R):E},R}const Te={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},xn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],vc=["Enter"," ","Escape"];var Rt;(function(e){e.Strict="strict",e.Loose="loose"})(Rt||(Rt={}));var jt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(jt||(jt={}));var Dt;(function(e){e.Partial="partial",e.Full="full"})(Dt||(Dt={}));const _c={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var rt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(rt||(rt={}));var os;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(os||(os={}));var G;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(G||(G={}));const Zr={[G.Left]:G.Right,[G.Right]:G.Left,[G.Top]:G.Bottom,[G.Bottom]:G.Top};function kc(e){return e===null?null:e?"valid":"invalid"}const Pc=e=>"id"in e&&"source"in e&&"target"in e,Zy=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Qo=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),En=(e,t=[0,0])=>{const{width:n,height:s}=tt(e),o=e.origin??t,r=n*o[0],l=s*o[1];return{x:e.position.x-r,y:e.position.y-l}},Gy=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,o)=>{const r=typeof o=="string";let l=!t.nodeLookup&&!r?o:void 0;t.nodeLookup&&(l=r?t.nodeLookup.get(o):Qo(o)?o:t.nodeLookup.get(o.id));const c=l?rs(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Rs(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Cs(n)},Sn=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(s=>{if(t.filter===void 0||t.filter(s)){const o=rs(s);n=Rs(n,o)}}),Cs(n)},Mc=(e,t,[n,s,o]=[0,0,1],r=!1,l=!1)=>{const c={...Rn(t,[n,s,o]),width:t.width/o,height:t.height/o},a=[];for(const u of e.values()){const{measured:d,selectable:x=!0,hidden:f=!1}=u;if(l&&!x||f)continue;const m=d.width??u.width??u.initialWidth??null,h=d.height??u.height??u.initialHeight??null,y=pn(c,zt(u)),E=(m??0)*(h??0),R=r&&y>0;(!u.internals.handleBounds||R||y>=E||u.dragging)&&a.push(u)}return a},Yy=(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 mo(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!s||s.has(o.id))&&n.set(o.id,o)}),n}async function ho({nodes:e,width:t,height:n,panZoom:s,minZoom:o,maxZoom:r},l){if(e.size===0)return Promise.resolve(!1);const c=Sn(e),a=Jo(c,t,n,(l==null?void 0:l.minZoom)??o,(l==null?void 0:l.maxZoom)??r,(l==null?void 0:l.padding)??.1);return await s.setViewport(a,{duration:l==null?void 0:l.duration}),Promise.resolve(!0)}function Nc({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:o,onError:r}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:a,y:u}=c?c.internals.positionAbsolute:{x:0,y:0},d=l.origin??s;let x=o;if(l.extent==="parent"&&!l.expandParent)if(!c)r==null||r("005",Te.error005());else{const m=c.measured.width,h=c.measured.height;m&&h&&(x=[[a,u],[a+m,u+h]])}else c&&Bt(l.extent)&&(x=[[l.extent[0][0]+a,l.extent[0][1]+u],[l.extent[1][0]+a,l.extent[1][1]+u]]);const f=Bt(x)?Ct(t,x,l.measured):t;return{position:{x:f.x-a+l.measured.width*d[0],y:f.y-u+l.measured.height*d[1]},positionAbsolute:f}}async function Wy({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:o}){const r=new Set(e.map(f=>f.id)),l=[];for(const f of n){if(f.deletable===!1)continue;const m=r.has(f.id),h=!m&&f.parentId&&l.find(y=>y.id===f.parentId);(m||h)&&l.push(f)}const c=new Set(t.map(f=>f.id)),a=s.filter(f=>f.deletable!==!1),d=Yy(l,a);for(const f of a)c.has(f.id)&&!d.find(h=>h.id===f.id)&&d.push(f);if(!o)return{edges:d,nodes:l};const x=await o({nodes:l,edges:d});return typeof x=="boolean"?x?{edges:d,nodes:l}:{edges:[],nodes:[]}:x}const Ot=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ct=(e={x:0,y:0},t,n)=>({x:Ot(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ot(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Lc(e,t,n){const{width:s,height:o}=tt(n),{x:r,y:l}=n.internals.positionAbsolute;return Ct(e,[[r,l],[r+s,l+o]],t)}const Gr=(e,t,n)=>e<t?Ot(Math.abs(e-t),1,t)/t:e>n?-Ot(Math.abs(e-n),1,t)/t:0,Tc=(e,t,n=15,s=40)=>{const o=Gr(e.x,s,t.width-s)*n,r=Gr(e.y,s,t.height-s)*n;return[o,r]},Rs=(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)}),go=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Cs=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),zt=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=Qo(e)?e.internals.positionAbsolute:En(e,t);return{x:n,y:s,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}},rs=(e,t=[0,0])=>{var o,r;const{x:n,y:s}=Qo(e)?e.internals.positionAbsolute:En(e,t);return{x:n,y:s,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:s+(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0)}},Ac=(e,t)=>Cs(Rs(go(e),go(t))),pn=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},Yr=e=>Oe(e.width)&&Oe(e.height)&&Oe(e.x)&&Oe(e.y),Oe=e=>!isNaN(e)&&isFinite(e),is=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},ws=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Rn=({x:e,y:t},[n,s,o],r=!1,l=[1,1])=>{const c={x:(e-n)/o,y:(t-s)/o};return r?ws(c,l):c},$c=({x:e,y:t},[n,s,o])=>({x:e*o+n,y:t*o+s}),Jo=(e,t,n,s,o,r)=>{const l=t/(e.width*(1+r)),c=n/(e.height*(1+r)),a=Math.min(l,c),u=Ot(a,s,o),d=e.x+e.width/2,x=e.y+e.height/2,f=t/2-d*u,m=n/2-x*u;return{x:f,y:m,zoom:u}},ls=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Bt(e){return e!==void 0&&e!=="parent"}function tt(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Ic(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 Dc(e,t={width:0,height:0},n,s,o){const r={...e},l=s.get(n);if(l){const c=l.origin||o;r.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],r.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return r}function sn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:o}){const{x:r,y:l}=Ue(e),c=Rn({x:r-((o==null?void 0:o.left)??0),y:l-((o==null?void 0:o.top)??0)},s),{x:a,y:u}=n?ws(c,t):c;return{xSnapped:a,ySnapped:u,...c}}const bs=e=>({width:e.offsetWidth,height:e.offsetHeight}),Oc=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Xy=["INPUT","SELECT","TEXTAREA"];function jo(e){var s,o,r;const t=((o=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:o[0])||e.target;return Xy.includes(t==null?void 0:t.nodeName)||((r=t==null?void 0:t.hasAttribute)==null?void 0:r.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const zc=e=>"clientX"in e,Ue=(e,t)=>{var r,l;const n=zc(e),s=n?e.clientX:(r=e.touches)==null?void 0:r[0].clientX,o=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Wr=(e,t,n,s,o)=>{const r=t.querySelectorAll(`.${e}`);return!r||!r.length?null:Array.from(r).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:o,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/s,y:(c.top-n.top)/s,...bs(l)}})};function Bc({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:o,sourceControlY:r,targetControlX:l,targetControlY:c}){const a=e*.125+o*.375+l*.375+n*.125,u=t*.125+r*.375+c*.375+s*.125,d=Math.abs(a-e),x=Math.abs(u-t);return[a,u,d,x]}function Pn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Xr({pos:e,x1:t,y1:n,x2:s,y2:o,c:r}){switch(e){case G.Left:return[t-Pn(t-s,r),n];case G.Right:return[t+Pn(s-t,r),n];case G.Top:return[t,n-Pn(n-o,r)];case G.Bottom:return[t,n+Pn(o-n,r)]}}function Vc({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:s,targetY:o,targetPosition:r=G.Top,curvature:l=.25}){const[c,a]=Xr({pos:n,x1:e,y1:t,x2:s,y2:o,c:l}),[u,d]=Xr({pos:r,x1:s,y1:o,x2:e,y2:t,c:l}),[x,f,m,h]=Bc({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:c,sourceControlY:a,targetControlX:u,targetControlY:d});return[`M${e},${t} C${c},${a} ${u},${d} ${s},${o}`,x,f,m,h]}function Fc({sourceX:e,sourceY:t,targetX:n,targetY:s}){const o=Math.abs(n-e)/2,r=n<e?n+o:n-o,l=Math.abs(s-t)/2,c=s<t?s+l:s-l;return[r,c,o,l]}function Ky({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:o=!1}){if(!o)return s;const r=n||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return s+(r?l:0)}function qy({sourceNode:e,targetNode:t,width:n,height:s,transform:o}){const r=Rs(rs(e),rs(t));r.x===r.x2&&(r.x2+=1),r.y===r.y2&&(r.y2+=1);const l={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:s/o[2]};return pn(l,Cs(r))>0}const Hc=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,Uy=(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)),Zc=(e,t)=>{if(!e.source||!e.target)return is("006",Te.error006()),t;let n;return Pc(e)?n={...e}:n={...e,id:Hc(e)},Uy(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},Qy=(e,t,n,s={shouldReplaceId:!0})=>{const{id:o,...r}=e;if(!t.source||!t.target)return is("006",Te.error006()),n;if(!n.find(a=>a.id===e.id))return is("007",Te.error007(o)),n;const c={...r,id:s.shouldReplaceId?Hc(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==o).concat(c)};function Gc({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[o,r,l,c]=Fc({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,o,r,l,c]}const Kr={[G.Left]:{x:-1,y:0},[G.Right]:{x:1,y:0},[G.Top]:{x:0,y:-1},[G.Bottom]:{x:0,y:1}},Jy=({source:e,sourcePosition:t=G.Bottom,target:n})=>t===G.Left||t===G.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},qr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function eE({source:e,sourcePosition:t=G.Bottom,target:n,targetPosition:s=G.Top,center:o,offset:r}){const l=Kr[t],c=Kr[s],a={x:e.x+l.x*r,y:e.y+l.y*r},u={x:n.x+c.x*r,y:n.y+c.y*r},d=Jy({source:a,sourcePosition:t,target:u}),x=d.x!==0?"x":"y",f=d[x];let m=[],h,y;const E={x:0,y:0},R={x:0,y:0},[_,w,S,b]=Fc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[x]*c[x]===-1){h=o.x??_,y=o.y??w;const v=[{x:h,y:a.y},{x:h,y:u.y}],L=[{x:a.x,y},{x:u.x,y}];l[x]===f?m=x==="x"?v:L:m=x==="x"?L:v}else{const v=[{x:a.x,y:u.y}],L=[{x:u.x,y:a.y}];if(x==="x"?m=l.x===f?L:v:m=l.y===f?v:L,t===s){const O=Math.abs(e[x]-n[x]);if(O<=r){const C=Math.min(r-1,r-O);l[x]===f?E[x]=(a[x]>e[x]?-1:1)*C:R[x]=(u[x]>n[x]?-1:1)*C}}if(t!==s){const O=x==="x"?"y":"x",C=l[x]===c[O],$=a[O]>u[O],k=a[O]<u[O];(l[x]===1&&(!C&&$||C&&k)||l[x]!==1&&(!C&&k||C&&$))&&(m=x==="x"?v:L)}const T={x:a.x+E.x,y:a.y+E.y},A={x:u.x+R.x,y:u.y+R.y},B=Math.max(Math.abs(T.x-m[0].x),Math.abs(A.x-m[0].x)),N=Math.max(Math.abs(T.y-m[0].y),Math.abs(A.y-m[0].y));B>=N?(h=(T.x+A.x)/2,y=m[0].y):(h=m[0].x,y=(T.y+A.y)/2)}return[[e,{x:a.x+E.x,y:a.y+E.y},...m,{x:u.x+R.x,y:u.y+R.y},n],h,y,S,b]}function tE(e,t,n,s){const o=Math.min(qr(e,t)/2,qr(t,n)/2,s),{x:r,y:l}=t;if(e.x===r&&r===n.x||e.y===l&&l===n.y)return`L${r} ${l}`;if(e.y===l){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${r+o*u},${l}Q ${r},${l} ${r},${l+o*d}`}const c=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${r},${l+o*a}Q ${r},${l} ${r+o*c},${l}`}function yo({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:s,targetY:o,targetPosition:r=G.Top,borderRadius:l=5,centerX:c,centerY:a,offset:u=20}){const[d,x,f,m,h]=eE({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:o},targetPosition:r,center:{x:c,y:a},offset:u});return[d.reduce((E,R,_)=>{let w="";return _>0&&_<d.length-1?w=tE(d[_-1],R,d[_+1],l):w=`${_===0?"M":"L"}${R.x} ${R.y}`,E+=w,E},""),x,f,m,h]}function Ur(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function nE(e){var x;const{sourceNode:t,targetNode:n}=e;if(!Ur(t)||!Ur(n))return null;const s=t.internals.handleBounds||Qr(t.handles),o=n.internals.handleBounds||Qr(n.handles),r=Jr((s==null?void 0:s.source)??[],e.sourceHandle),l=Jr(e.connectionMode===Rt.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!r||!l)return(x=e.onError)==null||x.call(e,"008",Te.error008(r?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(r==null?void 0:r.position)||G.Bottom,a=(l==null?void 0:l.position)||G.Top,u=fn(t,r,c),d=fn(n,l,a);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:a}}function Qr(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function fn(e,t,n=G.Left,s=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,r=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??tt(e);if(s)return{x:o+l/2,y:r+c/2};switch((t==null?void 0:t.position)??n){case G.Top:return{x:o+l/2,y:r};case G.Right:return{x:o+l,y:r+c/2};case G.Bottom:return{x:o+l/2,y:r+c};case G.Left:return{x:o,y:r+c/2}}}function Jr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Eo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function sE(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:o}){const r=new Set;return e.reduce((l,c)=>([c.markerStart||s,c.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=Eo(a,t);r.has(u)||(l.push({id:u,color:a.color||n,...a}),r.add(u))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const er={nodeOrigin:[0,0],nodeExtent:xn,elevateNodesOnSelect:!0,defaults:{}},oE={...er,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 rE(e,t,n){const s=tr(er,n);for(const o of e.values())if(o.parentId)nr(o,e,t,s);else{const r=En(o,s.nodeOrigin),l=Bt(o.extent)?o.extent:s.nodeExtent,c=Ct(r,l,tt(o));o.internals.positionAbsolute=c}}function So(e,t,n,s){var c,a;const o=tr(oE,s),r=new Map(t),l=o!=null&&o.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const u of e){let d=r.get(u.id);if(o.checkEquality&&u===(d==null?void 0:d.internals.userNode))t.set(u.id,d);else{const x=En(u,o.nodeOrigin),f=Bt(u.extent)?u.extent:o.nodeExtent,m=Ct(x,f,tt(u));d={...o.defaults,...u,measured:{width:(c=u.measured)==null?void 0:c.width,height:(a=u.measured)==null?void 0:a.height},internals:{positionAbsolute:m,handleBounds:u.measured?d==null?void 0:d.internals.handleBounds:void 0,z:Yc(u,l),userNode:u}},t.set(u.id,d)}u.parentId&&nr(d,t,n,s)}}function iE(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 nr(e,t,n,s){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:l}=tr(er,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}iE(e,n);const u=o?1e3:0,{x:d,y:x,z:f}=lE(e,a,r,l,u),{positionAbsolute:m}=e.internals,h=d!==m.x||x!==m.y;(h||f!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:h?{x:d,y:x}:m,z:f})}function Yc(e,t){return(Oe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function lE(e,t,n,s,o){const{x:r,y:l}=t.internals.positionAbsolute,c=tt(e),a=En(e,n),u=Bt(e.extent)?Ct(a,e.extent,c):a;let d=Ct({x:r+u.x,y:l+u.y},s,c);e.extent==="parent"&&(d=Lc(d,c,t));const x=Yc(e,o),f=t.internals.z??0;return{x:d.x,y:d.y,z:f>x?f:x}}function sr(e,t,n,s=[0,0]){var l;const o=[],r=new Map;for(const c of e){const a=t.get(c.parentId);if(!a)continue;const u=((l=r.get(c.parentId))==null?void 0:l.expandedRect)??zt(a),d=Ac(u,c.rect);r.set(c.parentId,{expandedRect:d,parent:a})}return r.size>0&&r.forEach(({expandedRect:c,parent:a},u)=>{var w;const d=a.internals.positionAbsolute,x=tt(a),f=a.origin??s,m=c.x<d.x?Math.round(Math.abs(d.x-c.x)):0,h=c.y<d.y?Math.round(Math.abs(d.y-c.y)):0,y=Math.max(x.width,Math.round(c.width)),E=Math.max(x.height,Math.round(c.height)),R=(y-x.width)*f[0],_=(E-x.height)*f[1];(m>0||h>0||R||_)&&(o.push({id:u,type:"position",position:{x:a.position.x-m+R,y:a.position.y-h+_}}),(w=n.get(u))==null||w.forEach(S=>{e.some(b=>b.id===S.id)||o.push({id:S.id,type:"position",position:{x:S.position.x+m,y:S.position.y+h}})})),(x.width<c.width||x.height<c.height||m||h)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:y+(m?f[0]*m-R:0),height:E+(h?f[1]*h-_:0)}})}),o}function cE(e,t,n,s,o,r){const l=s==null?void 0:s.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const a=[],u=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(u.transform),x=[];for(const f of e.values()){const m=t.get(f.id);if(m)if(m.hidden)m.internals={...m.internals,handleBounds:void 0},c=!0;else{const h=bs(f.nodeElement),y=m.measured.width!==h.width||m.measured.height!==h.height;if(!!(h.width&&h.height&&(y||!m.internals.handleBounds||f.force))){const R=f.nodeElement.getBoundingClientRect(),_=Bt(m.extent)?m.extent:r;let{positionAbsolute:w}=m.internals;m.parentId&&m.extent==="parent"?w=Lc(w,h,t.get(m.parentId)):_&&(w=Ct(w,_,h)),m.measured=h,m.internals={...m.internals,positionAbsolute:w,handleBounds:{source:Wr("source",f.nodeElement,R,d,m.id),target:Wr("target",f.nodeElement,R,d,m.id)}},m.parentId&&nr(m,t,n,{nodeOrigin:o}),c=!0,y&&(a.push({id:m.id,type:"dimensions",dimensions:h}),m.expandParent&&m.parentId&&x.push({id:m.id,parentId:m.parentId,rect:zt(m,o)}))}}}if(x.length>0){const f=sr(x,t,n,o);a.push(...f)}return{changes:a,updatedInternals:c}}async function aE({delta:e,panZoom:t,transform:n,translateExtent:s,width:o,height:r}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,r]],s),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function Wc(e,t,n){e.clear(),t.clear();for(const s of n){const{source:o,target:r,sourceHandle:l=null,targetHandle:c=null}=s,a=`${o}-source-${l}`,u=`${r}-target-${c}`,d=e.get(a)||new Map,x=e.get(u)||new Map,f={edgeId:s.id,source:o,target:r,sourceHandle:l,targetHandle:c};t.set(s.id,s),e.set(a,d.set(`${r}-${c}`,f)),e.set(u,x.set(`${o}-${l}`,f))}}function Xc(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Xc(n,t):!1}function ei(e,t,n){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===n)return!1;s=s.parentElement}while(s);return!1}function uE(e,t,n,s){const o=new Map;for(const[r,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!Xc(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(r);c&&o.set(r,{id:r,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return o}function Gs({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var l,c,a;const o=[];for(const[u,d]of t){const x=(l=n.get(u))==null?void 0:l.internals.userNode;x&&o.push({...x,position:d.position,dragging:s})}if(!e)return[o[0],o];const r=(c=n.get(e))==null?void 0:c.internals.userNode;return[r?{...r,position:((a=t.get(e))==null?void 0:a.position)||r.position,dragging:s}:o[0],o]}function dE({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:o}){let r={x:null,y:null},l=0,c=new Map,a=!1,u={x:0,y:0},d=null,x=!1,f=null,m=!1;function h({noDragClassName:E,handleSelector:R,domNode:_,isSelectable:w,nodeId:S,nodeClickDistance:b=0}){f=Ae(_);function P({x:A,y:B},N){const{nodeLookup:O,nodeExtent:C,snapGrid:$,snapToGrid:k,nodeOrigin:D,onNodeDrag:M,onSelectionDrag:z,onError:V,updateNodePositions:Z}=t();r={x:A,y:B};let Y=!1,ee={x:0,y:0,x2:0,y2:0};if(c.size>1&&C){const K=Sn(c);ee=go(K)}for(const[K,U]of c){if(!O.has(K))continue;let Q={x:A-U.distance.x,y:B-U.distance.y};k&&(Q=ws(Q,$));let ne=[[C[0][0],C[0][1]],[C[1][0],C[1][1]]];if(c.size>1&&C&&!U.extent){const{positionAbsolute:de}=U.internals,ae=de.x-ee.x+C[0][0],te=de.x+U.measured.width-ee.x2+C[1][0],X=de.y-ee.y+C[0][1],se=de.y+U.measured.height-ee.y2+C[1][1];ne=[[ae,X],[te,se]]}const{position:W,positionAbsolute:ie}=Nc({nodeId:K,nextPosition:Q,nodeLookup:O,nodeExtent:ne,nodeOrigin:D,onError:V});Y=Y||U.position.x!==W.x||U.position.y!==W.y,U.position=W,U.internals.positionAbsolute=ie}if(Y&&(Z(c,!0),N&&(s||M||!S&&z))){const[K,U]=Gs({nodeId:S,dragItems:c,nodeLookup:O});s==null||s(N,c,K,U),M==null||M(N,K,U),S||z==null||z(N,U)}}async function v(){if(!d)return;const{transform:A,panBy:B,autoPanSpeed:N}=t(),[O,C]=Tc(u,d,N);(O!==0||C!==0)&&(r.x=(r.x??0)-O/A[2],r.y=(r.y??0)-C/A[2],await B({x:O,y:C})&&P(r,null)),l=requestAnimationFrame(v)}function L(A){var Y;const{nodeLookup:B,multiSelectionActive:N,nodesDraggable:O,transform:C,snapGrid:$,snapToGrid:k,selectNodesOnDrag:D,onNodeDragStart:M,onSelectionDragStart:z,unselectNodesAndEdges:V}=t();x=!0,(!D||!w)&&!N&&S&&((Y=B.get(S))!=null&&Y.selected||V()),w&&D&&S&&(e==null||e(S));const Z=sn(A.sourceEvent,{transform:C,snapGrid:$,snapToGrid:k,containerBounds:d});if(r=Z,c=uE(B,O,Z,S),c.size>0&&(n||M||!S&&z)){const[ee,K]=Gs({nodeId:S,dragItems:c,nodeLookup:B});n==null||n(A.sourceEvent,c,ee,K),M==null||M(A.sourceEvent,ee,K),S||z==null||z(A.sourceEvent,K)}}const T=hc().clickDistance(b).on("start",A=>{const{domNode:B,nodeDragThreshold:N,transform:O,snapGrid:C,snapToGrid:$}=t();d=(B==null?void 0:B.getBoundingClientRect())||null,m=!1,N===0&&L(A),r=sn(A.sourceEvent,{transform:O,snapGrid:C,snapToGrid:$,containerBounds:d}),u=Ue(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:B,transform:N,snapGrid:O,snapToGrid:C,nodeDragThreshold:$,nodeLookup:k}=t(),D=sn(A.sourceEvent,{transform:N,snapGrid:O,snapToGrid:C,containerBounds:d});if((A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||S&&!k.has(S))&&(m=!0),!m){if(!a&&B&&x&&(a=!0,v()),!x){const M=D.xSnapped-(r.x??0),z=D.ySnapped-(r.y??0);Math.sqrt(M*M+z*z)>$&&L(A)}(r.x!==D.xSnapped||r.y!==D.ySnapped)&&c&&x&&(u=Ue(A.sourceEvent,d),P(D,A.sourceEvent))}}).on("end",A=>{if(!(!x||m)&&(a=!1,x=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:B,updateNodePositions:N,onNodeDragStop:O,onSelectionDragStop:C}=t();if(N(c,!1),o||O||!S&&C){const[$,k]=Gs({nodeId:S,dragItems:c,nodeLookup:B,dragging:!1});o==null||o(A.sourceEvent,c,$,k),O==null||O(A.sourceEvent,$,k),S||C==null||C(A.sourceEvent,k)}}}).filter(A=>{const B=A.target;return!A.button&&(!E||!ei(B,`.${E}`,_))&&(!R||ei(B,R,_))});f.call(T)}function y(){f==null||f.on(".drag",null)}return{update:h,destroy:y}}function xE(e,t,n){const s=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())pn(o,zt(r))>0&&s.push(r);return s}const pE=250;function fE(e,t,n,s){var c,a;let o=[],r=1/0;const l=xE(e,n,t+pE);for(const u of l){const d=[...((c=u.internals.handleBounds)==null?void 0:c.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const x of d){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:f,y:m}=fn(u,x,x.position,!0),h=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(m-e.y,2));h>t||(h<r?(o=[{...x,x:f,y:m}],r=h):h===r&&o.push({...x,x:f,y:m}))}}if(!o.length)return null;if(o.length>1){const u=s.type==="source"?"target":"source";return o.find(d=>d.type===u)??o[0]}return o[0]}function Kc(e,t,n,s,o,r=!1){var u,d,x;const l=s.get(e);if(!l)return null;const c=o==="strict"?(u=l.internals.handleBounds)==null?void 0:u[t]:[...((d=l.internals.handleBounds)==null?void 0:d.source)??[],...((x=l.internals.handleBounds)==null?void 0:x.target)??[]],a=(n?c==null?void 0:c.find(f=>f.id===n):c==null?void 0:c[0])??null;return a&&r?{...a,...fn(l,a,a.position,!0)}:a}function qc(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function mE(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Uc=()=>!0;function hE(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:o,edgeUpdaterType:r,isTarget:l,domNode:c,nodeLookup:a,lib:u,autoPanOnConnect:d,flowId:x,panBy:f,cancelConnection:m,onConnectStart:h,onConnect:y,onConnectEnd:E,isValidConnection:R=Uc,onReconnectEnd:_,updateConnection:w,getTransform:S,getFromHandle:b,autoPanSpeed:P}){const v=Oc(e.target);let L=0,T;const{x:A,y:B}=Ue(e),N=v==null?void 0:v.elementFromPoint(A,B),O=qc(r,N),C=c==null?void 0:c.getBoundingClientRect();if(!C||!O)return;const $=Kc(o,O,s,a,t);if(!$)return;let k=Ue(e,C),D=!1,M=null,z=!1,V=null;function Z(){if(!d||!C)return;const[ie,de]=Tc(k,C,P);f({x:ie,y:de}),L=requestAnimationFrame(Z)}const Y={...$,nodeId:o,type:O,position:$.position},ee=a.get(o),U={inProgress:!0,isValid:null,from:fn(ee,Y,G.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:ee,to:k,toHandle:null,toPosition:Zr[Y.position],toNode:null};w(U);let Q=U;h==null||h(e,{nodeId:o,handleId:s,handleType:O});function ne(ie){if(!b()||!Y){W(ie);return}const de=S();k=Ue(ie,C),T=fE(Rn(k,de,!1,[1,1]),n,a,Y),D||(Z(),D=!0);const ae=Qc(ie,{handle:T,connectionMode:t,fromNodeId:o,fromHandleId:s,fromType:l?"target":"source",isValidConnection:R,doc:v,lib:u,flowId:x,nodeLookup:a});V=ae.handleDomNode,M=ae.connection,z=mE(!!T,ae.isValid);const te={...Q,isValid:z,to:T&&z?$c({x:T.x,y:T.y},de):k,toHandle:ae.toHandle,toPosition:z&&ae.toHandle?ae.toHandle.position:Zr[Y.position],toNode:ae.toHandle?a.get(ae.toHandle.nodeId):null};z&&T&&Q.toHandle&&te.toHandle&&Q.toHandle.type===te.toHandle.type&&Q.toHandle.nodeId===te.toHandle.nodeId&&Q.toHandle.id===te.toHandle.id&&Q.to.x===te.to.x&&Q.to.y===te.to.y||(w(te),Q=te)}function W(ie){(T||V)&&M&&z&&(y==null||y(M));const{inProgress:de,...ae}=Q,te={...ae,toPosition:Q.toHandle?Q.toPosition:null};E==null||E(ie,te),r&&(_==null||_(ie,te)),m(),cancelAnimationFrame(L),D=!1,z=!1,M=null,V=null,v.removeEventListener("mousemove",ne),v.removeEventListener("mouseup",W),v.removeEventListener("touchmove",ne),v.removeEventListener("touchend",W)}v.addEventListener("mousemove",ne),v.addEventListener("mouseup",W),v.addEventListener("touchmove",ne),v.addEventListener("touchend",W)}function Qc(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:r,doc:l,lib:c,flowId:a,isValidConnection:u=Uc,nodeLookup:d}){const x=r==="target",f=t?l.querySelector(`.${c}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:h}=Ue(e),y=l.elementFromPoint(m,h),E=y!=null&&y.classList.contains(`${c}-flow__handle`)?y:f,R={handleDomNode:E,isValid:!1,connection:null,toHandle:null};if(E){const _=qc(void 0,E),w=E.getAttribute("data-nodeid"),S=E.getAttribute("data-handleid"),b=E.classList.contains("connectable"),P=E.classList.contains("connectableend");if(!w||!_)return R;const v={source:x?w:s,sourceHandle:x?S:o,target:x?s:w,targetHandle:x?o:S};R.connection=v;const T=b&&P&&(n===Rt.Strict?x&&_==="source"||!x&&_==="target":w!==s||S!==o);R.isValid=T&&u(v),R.toHandle=Kc(w,_,S,d,n,!1)}return R}const Ro={onPointerDown:hE,isValid:Qc};function gE({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const o=Ae(e);function r({translateExtent:c,width:a,height:u,zoomStep:d=10,pannable:x=!0,zoomable:f=!0,inversePan:m=!1}){const h=w=>{const S=n();if(w.sourceEvent.type!=="wheel"||!t)return;const b=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*d,P=S[2]*Math.pow(2,b);t.scaleTo(P)};let y=[0,0];const E=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(y=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},R=w=>{const S=n();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!t)return;const b=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],P=[b[0]-y[0],b[1]-y[1]];y=b;const v=s()*Math.max(S[2],Math.log(S[2]))*(m?-1:1),L={x:S[0]-P[0]*v,y:S[1]-P[1]*v},T=[[0,0],[a,u]];t.setViewportConstrained({x:L.x,y:L.y,zoom:S[2]},T,c)},_=bc().on("start",E).on("zoom",x?R:null).on("zoom.wheel",f?h:null);o.call(_,{})}function l(){o.on("zoom",null)}return{update:r,destroy:l,pointer:De}}const jE=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,vs=e=>({x:e.x,y:e.y,zoom:e.k}),Ys=({x:e,y:t,zoom:n})=>Ss.translate(e,t).scale(n),Mt=(e,t)=>e.target.closest(`.${t}`),Jc=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ws=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},ea=e=>{const t=e.ctrlKey&&ls()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function yE({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:r,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:u}){return d=>{if(Mt(d,t))return!1;d.preventDefault(),d.stopImmediatePropagation();const x=n.property("__zoom").k||1;if(d.ctrlKey&&l){const E=De(d),R=ea(d),_=x*Math.pow(2,R);s.scaleTo(n,_,E,d);return}const f=d.deltaMode===1?20:1;let m=o===jt.Vertical?0:d.deltaX*f,h=o===jt.Horizontal?0:d.deltaY*f;!ls()&&d.shiftKey&&o!==jt.Vertical&&(m=d.deltaY*f,h=0),s.translateBy(n,-(m/x)*r,-(h/x)*r,{internal:!0});const y=vs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(d,y)),e.isPanScrolling&&(a==null||a(d,y),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,y),e.isPanScrolling=!1},150))}}function EE({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,o){if(!t&&s.type==="wheel"&&!s.ctrlKey||Mt(s,e))return null;s.preventDefault(),n.call(this,s,o)}}function SE({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var r,l,c;if((r=s.sourceEvent)!=null&&r.internal)return;const o=vs(s.transform);e.mouseButton=((l=s.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((c=s.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,o))}}function RE({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:o}){return r=>{var l,c;e.usedRightMouseButton=!!(n&&Jc(t,e.mouseButton??0)),(l=r.sourceEvent)!=null&&l.sync||s([r.transform.x,r.transform.y,r.transform.k]),o&&!((c=r.sourceEvent)!=null&&c.internal)&&(o==null||o(r.sourceEvent,vs(r.transform)))}}function CE({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:r}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,r&&Jc(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&r(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),o&&jE(e.prevViewport,l.transform))){const a=vs(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(l.sourceEvent,a)},n?150:0)}}}function wE({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:r,userSelectionActive:l,noWheelClassName:c,noPanClassName:a,lib:u}){return d=>{var h;const x=e||t,f=n&&d.ctrlKey;if(d.button===1&&d.type==="mousedown"&&(Mt(d,`${u}-flow__node`)||Mt(d,`${u}-flow__edge`)))return!0;if(!s&&!x&&!o&&!r&&!n||l||Mt(d,c)&&d.type==="wheel"||Mt(d,a)&&(d.type!=="wheel"||o&&d.type==="wheel"&&!e)||!n&&d.ctrlKey&&d.type==="wheel")return!1;if(!n&&d.type==="touchstart"&&((h=d.touches)==null?void 0:h.length)>1)return d.preventDefault(),!1;if(!x&&!o&&!f&&d.type==="wheel"||!s&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(s)&&!s.includes(d.button)&&d.type==="mousedown")return!1;const m=Array.isArray(s)&&s.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||d.type==="wheel")&&m}}function bE({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:o,viewport:r,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:a,onDraggingChange:u}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},x=e.getBoundingClientRect(),f=bc().clickDistance(!Oe(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(o),m=Ae(e).call(f);w({x:r.x,y:r.y,zoom:Ot(r.zoom,t,n)},[[0,0],[x.width,x.height]],o);const h=m.on("wheel.zoom"),y=m.on("dblclick.zoom");f.wheelDelta(ea);function E(N,O){return m?new Promise(C=>{f==null||f.transform(Ws(m,O==null?void 0:O.duration,()=>C(!0)),N)}):Promise.resolve(!1)}function R({noWheelClassName:N,noPanClassName:O,onPaneContextMenu:C,userSelectionActive:$,panOnScroll:k,panOnDrag:D,panOnScrollMode:M,panOnScrollSpeed:z,preventScrolling:V,zoomOnPinch:Z,zoomOnScroll:Y,zoomOnDoubleClick:ee,zoomActivationKeyPressed:K,lib:U,onTransformChange:Q}){$&&!d.isZoomingOrPanning&&_();const W=k&&!K&&!$?yE({zoomPanValues:d,noWheelClassName:N,d3Selection:m,d3Zoom:f,panOnScrollMode:M,panOnScrollSpeed:z,zoomOnPinch:Z,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):EE({noWheelClassName:N,preventScrolling:V,d3ZoomHandler:h});if(m.on("wheel.zoom",W,{passive:!1}),!$){const de=SE({zoomPanValues:d,onDraggingChange:u,onPanZoomStart:c});f.on("start",de);const ae=RE({zoomPanValues:d,panOnDrag:D,onPaneContextMenu:!!C,onPanZoom:l,onTransformChange:Q});f.on("zoom",ae);const te=CE({zoomPanValues:d,panOnDrag:D,panOnScroll:k,onPaneContextMenu:C,onPanZoomEnd:a,onDraggingChange:u});f.on("end",te)}const ie=wE({zoomActivationKeyPressed:K,panOnDrag:D,zoomOnScroll:Y,panOnScroll:k,zoomOnDoubleClick:ee,zoomOnPinch:Z,userSelectionActive:$,noPanClassName:O,noWheelClassName:N,lib:U});f.filter(ie),ee?m.on("dblclick.zoom",y):m.on("dblclick.zoom",null)}function _(){f.on("zoom",null)}async function w(N,O,C){const $=Ys(N),k=f==null?void 0:f.constrain()($,O,C);return k&&await E(k),new Promise(D=>D(k))}async function S(N,O){const C=Ys(N);return await E(C,O),new Promise($=>$(C))}function b(N){if(m){const O=Ys(N),C=m.property("__zoom");(C.k!==N.zoom||C.x!==N.x||C.y!==N.y)&&(f==null||f.transform(m,O,null,{sync:!0}))}}function P(){const N=m?wc(m.node()):{x:0,y:0,k:1};return{x:N.x,y:N.y,zoom:N.k}}function v(N,O){return m?new Promise(C=>{f==null||f.scaleTo(Ws(m,O==null?void 0:O.duration,()=>C(!0)),N)}):Promise.resolve(!1)}function L(N,O){return m?new Promise(C=>{f==null||f.scaleBy(Ws(m,O==null?void 0:O.duration,()=>C(!0)),N)}):Promise.resolve(!1)}function T(N){f==null||f.scaleExtent(N)}function A(N){f==null||f.translateExtent(N)}function B(N){const O=!Oe(N)||N<0?0:N;f==null||f.clickDistance(O)}return{update:R,destroy:_,setViewport:S,setViewportConstrained:w,getViewport:P,scaleTo:v,scaleBy:L,setScaleExtent:T,setTranslateExtent:A,syncViewport:b,setClickDistance:B}}var on;(function(e){e.Line="line",e.Handle="handle"})(on||(on={}));function vE({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:o,affectsY:r}){const l=e-t,c=n-s,a=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&o&&(a[0]=a[0]*-1),c&&r&&(a[1]=a[1]*-1),a}function _E(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:o}}function st(e,t){return Math.max(0,t-e)}function ot(e,t){return Math.max(0,e-t)}function Mn(e,t,n){return Math.max(0,t-e,e-n)}function ti(e,t){return e?!t:t}function kE(e,t,n,s,o,r,l,c){let{affectsX:a,affectsY:u}=t;const{isHorizontal:d,isVertical:x}=t,f=d&&x,{xSnapped:m,ySnapped:h}=n,{minWidth:y,maxWidth:E,minHeight:R,maxHeight:_}=s,{x:w,y:S,width:b,height:P,aspectRatio:v}=e;let L=Math.floor(d?m-e.pointerX:0),T=Math.floor(x?h-e.pointerY:0);const A=b+(a?-L:L),B=P+(u?-T:T),N=-r[0]*b,O=-r[1]*P;let C=Mn(A,y,E),$=Mn(B,R,_);if(l){let M=0,z=0;a&&L<0?M=st(w+L+N,l[0][0]):!a&&L>0&&(M=ot(w+A+N,l[1][0])),u&&T<0?z=st(S+T+O,l[0][1]):!u&&T>0&&(z=ot(S+B+O,l[1][1])),C=Math.max(C,M),$=Math.max($,z)}if(c){let M=0,z=0;a&&L>0?M=ot(w+L,c[0][0]):!a&&L<0&&(M=st(w+A,c[1][0])),u&&T>0?z=ot(S+T,c[0][1]):!u&&T<0&&(z=st(S+B,c[1][1])),C=Math.max(C,M),$=Math.max($,z)}if(o){if(d){const M=Mn(A/v,R,_)*v;if(C=Math.max(C,M),l){let z=0;!a&&!u||a&&!u&&f?z=ot(S+O+A/v,l[1][1])*v:z=st(S+O+(a?L:-L)/v,l[0][1])*v,C=Math.max(C,z)}if(c){let z=0;!a&&!u||a&&!u&&f?z=st(S+A/v,c[1][1])*v:z=ot(S+(a?L:-L)/v,c[0][1])*v,C=Math.max(C,z)}}if(x){const M=Mn(B*v,y,E)/v;if($=Math.max($,M),l){let z=0;!a&&!u||u&&!a&&f?z=ot(w+B*v+N,l[1][0])/v:z=st(w+(u?T:-T)*v+N,l[0][0])/v,$=Math.max($,z)}if(c){let z=0;!a&&!u||u&&!a&&f?z=st(w+B*v,c[1][0])/v:z=ot(w+(u?T:-T)*v,c[0][0])/v,$=Math.max($,z)}}}T=T+(T<0?$:-$),L=L+(L<0?C:-C),o&&(f?A>B*v?T=(ti(a,u)?-L:L)/v:L=(ti(a,u)?-T:T)*v:d?(T=L/v,u=a):(L=T*v,a=u));const k=a?w+L:w,D=u?S+T:S;return{width:b+(a?-L:L),height:P+(u?-T:T),x:r[0]*L*(a?-1:1)+k,y:r[1]*T*(u?-1:1)+D}}const ta={width:0,height:0,x:0,y:0},PE={...ta,pointerX:0,pointerY:0,aspectRatio:1};function ME(e){return[[0,0],[e.measured.width,e.measured.height]]}function NE(e,t,n){const s=t.position.x+e.position.x,o=t.position.y+e.position.y,r=e.measured.width??0,l=e.measured.height??0,c=n[0]*r,a=n[1]*l;return[[s-c,o-a],[s+r-c,o+l-a]]}function LE({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:o}){const r=Ae(e);function l({controlPosition:a,boundaries:u,keepAspectRatio:d,onResizeStart:x,onResize:f,onResizeEnd:m,shouldResize:h}){let y={...ta},E={...PE};const R=_E(a);let _,w=null,S=[],b,P,v;const L=hc().on("start",T=>{const{nodeLookup:A,transform:B,snapGrid:N,snapToGrid:O,nodeOrigin:C,paneDomNode:$}=n();if(_=A.get(t),!_)return;w=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:k,ySnapped:D}=sn(T.sourceEvent,{transform:B,snapGrid:N,snapToGrid:O,containerBounds:w});y={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},E={...y,pointerX:k,pointerY:D,aspectRatio:y.width/y.height},b=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(b=A.get(_.parentId),P=b&&_.extent==="parent"?ME(b):void 0),S=[],v=void 0;for(const[M,z]of A)if(z.parentId===t&&(S.push({id:M,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const V=NE(z,_,z.origin??C);v?v=[[Math.min(V[0][0],v[0][0]),Math.min(V[0][1],v[0][1])],[Math.max(V[1][0],v[1][0]),Math.max(V[1][1],v[1][1])]]:v=V}x==null||x(T,{...y})}).on("drag",T=>{const{transform:A,snapGrid:B,snapToGrid:N,nodeOrigin:O}=n(),C=sn(T.sourceEvent,{transform:A,snapGrid:B,snapToGrid:N,containerBounds:w}),$=[];if(!_)return;const{x:k,y:D,width:M,height:z}=y,V={},Z=_.origin??O,{width:Y,height:ee,x:K,y:U}=kE(E,R,C,u,d,Z,P,v),Q=Y!==M,ne=ee!==z,W=K!==k&&Q,ie=U!==D&&ne;if(!W&&!ie&&!Q&&!ne)return;if((W||ie||Z[0]===1||Z[1]===1)&&(V.x=W?K:y.x,V.y=ie?U:y.y,y.x=V.x,y.y=V.y,S.length>0)){const X=K-k,se=U-D;for(const pe of S)pe.position={x:pe.position.x-X+Z[0]*(Y-M),y:pe.position.y-se+Z[1]*(ee-z)},$.push(pe)}if((Q||ne)&&(V.width=Q?Y:y.width,V.height=ne?ee:y.height,y.width=V.width,y.height=V.height),b&&_.expandParent){const X=Z[0]*(V.width??0);V.x&&V.x<X&&(y.x=X,E.x=E.x-(V.x-X));const se=Z[1]*(V.height??0);V.y&&V.y<se&&(y.y=se,E.y=E.y-(V.y-se))}const de=vE({width:y.width,prevWidth:M,height:y.height,prevHeight:z,affectsX:R.affectsX,affectsY:R.affectsY}),ae={...y,direction:de};(h==null?void 0:h(T,ae))!==!1&&(f==null||f(T,ae),s(V,$))}).on("end",T=>{m==null||m(T,{...y}),o==null||o()});r.call(L)}function c(){r.on(".drag",null)}return{update:l,destroy:c}}var Nn={exports:{}},Xs={},Ln={exports:{}},Ks={};/**
1
+ "use strict";var jm=Object.defineProperty;var Em=(e,t,n)=>t in e?jm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ge=(e,t,n)=>Em(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-DGh1k5sI.cjs"),g=require("react"),j=require("./Toggle-vgmhy8wZ.cjs"),d=require("./css-Bo-hsQHb.cjs"),zn=require("./external-C_th4MW9.cjs"),Z=require("./aggregator-DX8ts24k.cjs"),te=require("./Pack-CyaEXvnu.cjs"),ym=require("./external-CWincA61.cjs"),ke=require("./external-IztUjYjX.cjs"),Sm=require("./external-vMTeF1dc.cjs"),Bi=require("./Animated-BOjwPkTJ.cjs"),z=require("./LinePlot-D4V1ltNT.cjs"),ce=require("zod"),ve=require("./external-Dtr4ZxR6.cjs"),Di=require("./external-CyPQsB1T.cjs");require("./Item-Bamd13Tl.cjs");const vo=require("react-dom"),Zt=require("./external-CMEDU76u.cjs"),Rm=require("./external-BS9Bfsj3.cjs"),Oi=require("./units-CXFC0OLO.cjs"),Ne=require("./external-kAduhcvp.cjs"),Cm=require("./external-DsJYjdNk.cjs"),wm=require("./external-VEFOprRU.cjs"),bm=require("./external-Bt_kX5KM.cjs"),vm=require("./Video-g30B90s-.cjs"),km=(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},_m=Object.freeze(Object.defineProperty({__proto__:null,Core:j.Core$1,Multiple:j.Multiple,Single:j.Single,calculateDiffPercentage:j.calculateDiffPercentage,useMultiple:j.useMultiple},Symbol.toStringTag,{value:"Module"})),Mm=Object.freeze(Object.defineProperty({__proto__:null,Bar:j.Bar,Drawer:j.Drawer,useDrawer:j.useDrawer},Symbol.toStringTag,{value:"Module"})),Vi=({variant:e="info",...t})=>o.jsxRuntimeExports.jsx(j.wt.Circle,{color:j.variantColors[e],...t}),Pm=({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(te.Space,{className:d.CSS(d.CSS.B("notification"),a),direction:"y",empty:!0,...x,children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",size:"small",children:[o.jsxRuntimeExports.jsx(Vi,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",shade:7,children:`x${n}`}),o.jsxRuntimeExports.jsx(j.DateTime,{className:d.CSS(d.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),o.jsxRuntimeExports.jsx(j.Icon,{className:d.CSS(d.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:o.jsxRuntimeExports.jsx(j.wt.Close,{})})]}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",align:"start",className:d.CSS(d.CSS.BE("notification","content")),size:"small",children:[u??o.jsxRuntimeExports.jsx(j.Text$1,{className:d.CSS(d.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),r!=null&&o.jsxRuntimeExports.jsx(j.Text$1,{className:d.CSS(d.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),c!=null&&o.jsxRuntimeExports.jsx(te.Space,{direction:"x",align:"center",justify:"end",className:d.CSS(d.CSS.BE("notification","actions")),children:Z.A(c).map(p=>o.jsxRuntimeExports.jsx(Lm,{action:p},p.key))})]},t.toString()),Lm=({action:e})=>{if(!g.isValidElement(e)){const t=e;return o.jsxRuntimeExports.jsx(j.Button,{...t})}return e},Nm=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:j.Aggregator,Circle:Vi,Notification:Pm,Text:j.Text$3,VARIANTS:Z.VARIANTS,specZ:Z.specZ$1,useAggregator:j.useAggregator,useContext:j.useContext$3,useNotifications:j.useNotifications,variantZ:Z.variantZ},Symbol.toStringTag,{value:"Module"})),Tm=Object.freeze(Object.defineProperty({__proto__:null,Config:j.Config,Context:j.Context,Dialog:j.Dialog$1,chooseLocation:j.chooseLocation,formatTip:j.formatTip,useConfig:j.useConfig,wrap:j.wrap},Symbol.toStringTag,{value:"Module"})),Bn="y",Er=28,Am=32,Im=40,$m=.5,zm=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:r,...i}}=j.useMultiple({direction:Bn,count:e.length,minSize:Er}),l=c=>{if(r.current==null)return;const a=d.Eo.dim(d.Eo.construct(r.current),Bn);s[c]<Im/a?n(c,e[c].initialSize??$m):n(c,Er+1)};return o.jsxRuntimeExports.jsx(j.Multiple,{empty:!0,className:d.CSS.B("accordion"),sizeDistribution:s,ref:r,...t,...i,children:e.map((c,a)=>g.createElement(Om,{...c,key:c.key,index:a,direction:Bn,onExpand:l,parent:r,size:s[a]}))})},Bm=o.jsxRuntimeExports.jsx(j.wt.Caret.Down,{"aria-label":"contract"}),Dm=o.jsxRuntimeExports.jsx(j.wt.Caret.Right,{"aria-label":"expand"}),Om=({index:e,name:t,content:n,actions:s,size:r,parent:i,onExpand:l})=>{let c=!0;if(i.current!=null){const u=d.Eo.dim(d.Eo.construct(i.current),Bn);c=r*u>Am}const a=c?Bm:Dm;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(zn.Header,{level:"p",className:d.CSS.expanded(c),empty:!0,children:[o.jsxRuntimeExports.jsx(zn.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&o.jsxRuntimeExports.jsx(zn.Actions,{children:s})]}),n]})},Vm=Object.freeze(Object.defineProperty({__proto__:null,Accordion:zm},Symbol.toStringTag,{value:"Module"})),Fm=(e,t)=>Z.A(e).map(s=>typeof s=="string"?s.split(t).map(r=>({label:r})):s).flat(),Fi=({segments:e,shade:t,level:n,weight:s,separator:r,transform:i})=>{let c=Fm(e,r);return i!=null&&(c=c.map(i)),c.map(({label:a,icon:u,href:x,...p},m)=>{const f=[o.jsxRuntimeExports.jsx(j.wt.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:d.CSS.shade(t)}},`${a}-${m}`)];if(u!=null){const E=ke.resolve(u);E!=null&&f.push(E)}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(j.Link,{...h,href:x},a)):f.push(o.jsxRuntimeExports.jsx(j.Text$1,{...h},a)),f}).flat()},Hm=({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=Fi({segments:e,separator:c,shade:n,level:l,weight:s});return u&&p.shift(),o.jsxRuntimeExports.jsxs(j.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:[ke.resolve(t),...p]})},Zm=({url:e,className:t,level:n="p",separator:s="/",weight:r,shade:i=7})=>{const l=Fi({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(te.Space,{className:d.CSS(t,d.CSS.B("breadcrumb"),d.CSS.BM("breadcrumb","url")),direction:"x",size:"small",align:"center",children:l})},Gm=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:Hm,URL:Zm},Symbol.toStringTag,{value:"Module"})),ko=g.createContext(z.ZERO_CONTEXT_VALUE),Fe=()=>g.useContext(ko).synnax,Ym=()=>g.useContext(ko).state,yr={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Hi="serverVersionMismatch",Wm=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Zi=j.wrap$1(z.Provider.TYPE,({aetherKey:e,connParams:t,children:n})=>{const[s,r,i]=j.useCombinedStateAndRef(z.ZERO_CONTEXT_VALUE),[{path:l},,c]=j.use$3({aetherKey:e,type:z.Provider.TYPE,schema:z.Provider.stateZ,initialState:{props:t??null,state:null}}),a=j.useAggregator(),u=g.useCallback(x=>{i.current.state.status!==x.status&&a({variant:yr[x.status],message:x.message??d.d.capitalize(x.status)}),r(p=>({...p,state:x}))},[a]);return j.useAsyncEffect(async()=>{if(s.synnax!=null&&s.synnax.close(),t==null)return r(z.ZERO_CONTEXT_VALUE);const x=new Z.fg({...t,connectivityPollFrequency:Z.S$1.seconds(5)});r({synnax:x,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:x.clientVersion}});const p=await x.connectivity.check();if(r({synnax:x,state:p}),a({variant:yr[p.status],message:p.message??p.status.toUpperCase()}),p.status==="connected"&&!p.clientServerCompatible){const m=p.nodeVersion==null||Z.X.semVerOlder(p.nodeVersion,p.clientVersion),f=Wm(m,p.clientVersion,p.nodeVersion);a({variant:"warning",message:"Incompatible cluster version",description:f,data:{type:Hi,oldServer:m,nodeVersion:p.nodeVersion,clientVersion:p.clientVersion}})}return x.connectivity.onChange(u),c({props:t,state:p}),()=>{x.close(),r(z.ZERO_CONTEXT_VALUE),c({props:null,state:null})}},[t,u]),o.jsxRuntimeExports.jsx(ko.Provider,{value:s,children:o.jsxRuntimeExports.jsx(j.Composite,{path:l,children:n})})}),Xm=Object.freeze(Object.defineProperty({__proto__:null,Provider:Zi,SERVER_VERSION_MISMATCH:Hi,use:Fe,useConnectionState:Ym},Symbol.toStringTag,{value:"Module"})),Gt=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),Gi=()=>g.useContext(Gt),Yi=e=>{const{aliases:t}=g.useContext(Gt);return t[e]??null},ds=()=>{const{aliases:e}=g.useContext(Gt);return e},xs=(e,t="")=>{const{getName:n}=g.useContext(Gt),[s,r]=g.useState(t);return j.useAsyncEffect(async()=>{const i=await n(e);r(i)},[e,n]),s??t},_o=()=>{const{activeRange:e}=g.useContext(Gt);return e??void 0},Wi=({activeRange:e,children:t})=>{const n=Fe(),[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 j.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(Gt.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},Km=({channelKey:e,value:t,shadow:n,className:s,...r})=>{const[i,l]=g.useState(!1),{setAlias:c}=Gi(),a=Yi(e),u=xs(e);let x=o.jsxRuntimeExports.jsx(j.wt.Rename,{});i?x=o.jsxRuntimeExports.jsx(j.wt.Loading,{}):a===t&&(x=o.jsxRuntimeExports.jsx(j.wt.Check,{}));const p=c!=null&&!i&&a!==t&&e!==0,m=()=>{p&&(async()=>(l(!0),await c(e,t),l(!1)))()},f=()=>{var E;a!=null&&((E=r.onChange)==null||E.call(r,a))},h=()=>e===0?o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Alias synced with this label"}):o.jsxRuntimeExports.jsxs(j.Text$1,{level:"small",children:["Sync alias for ",u," with this label"]});return o.jsxRuntimeExports.jsxs(j.Text$2,{value:t,...r,children:[p&&o.jsxRuntimeExports.jsx(j.Icon,{onClick:f,tooltip:o.jsxRuntimeExports.jsxs(j.Text$1,{level:"small",children:["Set ",u," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:o.jsxRuntimeExports.jsx(j.wt.Sync,{})}),o.jsxRuntimeExports.jsx(j.Icon,{onClick:m,disabled:!p,tooltip:o.jsxRuntimeExports.jsx(h,{}),tooltipLocation:{y:"top"},variant:"outlined",children:x})]})},Ye="channel";var Sr=180/Math.PI,no={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xi(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)*Sr,skewX:Math.atan(a)*Sr,scaleX:l,scaleY:c}}var kn;function qm(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?no:Xi(t.a,t.b,t.c,t.d,t.e,t.f)}function Um(e){return e==null||(kn||(kn=document.createElementNS("http://www.w3.org/2000/svg","g")),kn.setAttribute("transform",e),!(e=kn.transform.baseVal.consolidate()))?no:(e=e.matrix,Xi(e.a,e.b,e.c,e.d,e.e,e.f))}function Ki(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 E=f.push("translate(",null,t,null,n);h.push({i:E-4,x:z.interpolateNumber(u,p)},{i:E-2,x:z.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:z.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:z.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 E=f.push(r(f)+"scale(",null,",",null,")");h.push({i:E-4,x:z.interpolateNumber(u,p)},{i:E-2,x:z.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,E=m.length,y;++h<E;)p[(y=m[h]).i]=y.x(f);return p.join("")}}}var Jm=Ki(qm,"px, ","px)","deg)"),Qm=Ki(Um,", ",")",")"),ef=1e-12;function Rr(e){return((e=Math.exp(e))+1/e)/2}function tf(e){return((e=Math.exp(e))-1/e)/2}function nf(e){return((e=Math.exp(2*e))-1)/(e+1)}const sf=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,E=f*f+h*h,y,S;if(E<ef)S=Math.log(m/u)/t,y=function(k){return[c+k*f,a+k*h,u*Math.exp(t*k*S)]};else{var _=Math.sqrt(E),w=(m*m-u*u+s*E)/(2*u*n*_),R=(m*m-u*u-s*E)/(2*m*n*_),b=Math.log(Math.sqrt(w*w+1)-w),P=Math.log(Math.sqrt(R*R+1)-R);S=(P-b)/t,y=function(k){var N=k*S,T=Rr(b),I=u/(n*_)*(T*nf(t*N+b)-tf(b));return[c+I*f,a+I*h,u*T/Rr(t*N+b)]}}return y.duration=S*1e3*t/Math.SQRT2,y}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),of=Object.freeze(Object.defineProperty({__proto__:null,Canvas:z.Canvas,axisStateZ:z.axisStateZ,newTickFactory:z.newTickFactory,tickFactoryProps:z.tickFactoryProps,tickType:z.tickType},Symbol.toStringTag,{value:"Module"})),rf=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:z.AcquireChannelControl,AuthoritySource:z.AuthoritySource,Chip:z.Chip,Controller:z.Controller$1,Indicator:z.Indicator,Legend:z.Legend,REGISTRY:z.REGISTRY$3,STATUSES:z.STATUSES,SetChannelValue:z.SetChannelValue,StateProvider:z.StateProvider,acquireChannelControl:z.acquireChannelControl,acquireChannelControlPropsZ:z.acquireChannelControlPropsZ,authoritySource:z.authoritySource,authoritySourceProps:z.authoritySourceProps,chipStateZ:z.chipStateZ,controllerStateZ:z.controllerStateZ,indicatorStateZ:z.indicatorStateZ,legendStateZ:z.legendStateZ,setChannelValue:z.setChannelValue,setChannelValuePropsZ:z.setChannelValuePropsZ,stateProviderStateZ:z.stateProviderStateZ,statusZ:z.statusZ,sugaredStateZ:z.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),lf={region:d.Eo.ZERO,dpr:1,os:Z.S.getOS()},cf={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},af=j.wrap$1(z.Canvas$1.TYPE,({children:e,resizeDebounce:t=100,aetherKey:n,className:s,...r})=>{const[{path:i},{bootstrapped:l,dpr:c},a]=j.use$3({aetherKey:n,type:z.Canvas$1.TYPE,schema:z.canvasStateZ,initialState:lf}),u=g.useRef({...cf}),x=g.useRef(!1),p=g.useCallback(y=>{u.current.bootstrapped&&(a(()=>({bootstrapped:!0,region:y,dpr:window.devicePixelRatio,os:Z.S.getOS({default:"Windows"})})),x.current=!0)},[a]),m=g.useRef(null),f=j.useResize(p,{debounce:t}),h=j.useCombinedRefs(m,f);g.useEffect(()=>{const y=()=>{window.devicePixelRatio===c||!u.current.bootstrapped||m.current==null||a(S=>({...S,region:d.Eo.construct(m.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",y,{once:!0})},[c]),g.useEffect(()=>{const y=()=>{!u.current.bootstrapped||m.current==null||a(S=>({...S,region:d.Eo.construct(m.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",y),window.addEventListener("blur",y)},[a]);const E=g.useCallback(y=>{if(y==null)return;y.className.includes("gl")?u.current.gl=y:y.className.includes("upper2d")?u.current.upper2d=y:u.current.lower2d=y;const{gl:S,lower2d:_,upper2d:w,bootstrapped:R}=u.current;if(S==null||_==null||w==null||R)return;u.current.bootstrapped=!0;const b=S.transferControlToOffscreen(),P=w.transferControlToOffscreen(),k=_.transferControlToOffscreen();a({glCanvas:b,upper2dCanvas:P,lower2dCanvas:k,bootstrap:!0,bootstrapped:!1,region:d.Eo.construct(S),dpr:window.devicePixelRatio,os:Z.S.getOS({default:"Windows"})},[b,P,k])},[a]);return o.jsxRuntimeExports.jsxs("div",{ref:h,className:d.CSS(d.CSS.B("canvas-container"),s),...r,children:[o.jsxRuntimeExports.jsx("canvas",{ref:E,className:d.CSS(d.CSS.B("canvas"),d.CSS.BM("canvas","lower2d"))}),o.jsxRuntimeExports.jsx("canvas",{ref:E,className:d.CSS(d.CSS.B("canvas"),d.CSS.BM("canvas","gl"))}),o.jsxRuntimeExports.jsx("canvas",{ref:E,className:d.CSS(d.CSS.B("canvas"),d.CSS.BM("canvas","upper2d"))}),o.jsxRuntimeExports.jsx(j.Composite,{path:i,children:l&&e})]})}),En=(e,t)=>j.useResize(g.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(d.b.XY.translate(d.G.scale(d.Eo.topLeft(r),-1)).box(n),s)},[e]),t),uf=Object.freeze(Object.defineProperty({__proto__:null,Canvas:af,useRegion:En},Symbol.toStringTag,{value:"Module"})),qi=g.createContext(null),We=e=>{const t=g.useContext(qi);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},Ui=e=>{const t=We("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},yn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=We(t),{key:r}=e;return j.useEffectCompare(()=>{d.K.outer.parse(e.loc),n(e)},([c],[a])=>Z._.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}`}},Ji=j.wrap$1("LinePlot",({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=j.useMemoDeepEqualProps({clearOverScan:s,hold:i,visible:c}),[{path:m},{grid:f},h]=j.use$3({aetherKey:e,type:z.LinePlot.TYPE,schema:z.linePlotStateZ,initialState:{container:d.Eo.ZERO,viewport:d.Eo.DECIMAL,grid:{},...p}});g.useEffect(()=>h($=>({...$,...p})),[p]);const E=g.useRef(new Map),y=g.useCallback($=>(E.current.set($,null),()=>E.current.delete($)),[E]),S=g.useCallback($=>{const{mode:B,box:C,stage:A}=$;(B==="pan"&&A!=="start"||B==="zoom"||B==="zoomReset"&&A==="start")&&h(M=>({...M,viewport:C})),E.current.forEach((M,D)=>D($))},[h]),_=g.useCallback($=>h(B=>({...B,container:$})),[h]),w=En(_,{debounce:n}),R=g.useCallback($=>h(B=>({...B,grid:{...B.grid,[$.key]:$}})),[h]),b=g.useCallback($=>h(B=>{const{[$]:C,...A}=B.grid;return{...B,grid:A}}),[h]),P=g.useCallback($=>{x(B=>[...B.filter(({key:C})=>C!==$.key),$])},[x,S]),k=g.useCallback($=>x(B=>B.filter(({key:C})=>C!==$)),[P]),N=g.useMemo(()=>df(f),[f]),T=g.useCallback($=>{h(B=>({...B,hold:$})),l==null||l($)},[h,l]),I=`line-plot-${e}`,F=g.useMemo(()=>({lines:u,setGridEntry:R,removeGridEntry:b,setLine:P,removeLine:k,setViewport:S,addViewportHandler:y,setHold:T,id:I}),[I,u,R,b,P,k,S,y,T]);return o.jsxRuntimeExports.jsx("div",{id:I,className:d.CSS.B("line-plot"),style:{...t,...N},ref:w,...a,children:o.jsxRuntimeExports.jsx(qi.Provider,{value:F,children:o.jsxRuntimeExports.jsx(j.Composite,{path:m,children:r})})})}),df=e=>{const t=d.CSS.newGridBuilder();return z.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)"),z.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),z.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)"),z.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},Mo=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?z.XAxis.TYPE:z.YAxis.TYPE,s=`${e}-axis`;return j.wrap$1(n,({aetherKey:r,children:i,location:l=t,label:c="",labelLevel:a="small",labelDirection:u=e,onLabelChange:x,color:p,labelSize:m,showGrid:f,type:h,bounds:E,className:y,tickSpacing:S,autoBounds:_,autoBoundUpdateInterval:w,onAutoBoundsChange:R,style:b,...P})=>{const k=((c==null?void 0:c.length)??0)>0,N=j.useMemoDeepEqualProps({location:l,showGrid:f,type:h,bounds:E,label:c,labelDirection:u,tickSpacing:S,autoBounds:_,autoBoundUpdateInterval:w}),[{path:T},{size:I,labelSize:F,...$},B]=j.use$3({aetherKey:r,type:n,schema:z.coreAxisStateZ,initialState:N});g.useEffect(()=>B(D=>({...D,...N})),[N]),g.useEffect(()=>{const{lower:D,upper:L}=z.parseAutoBounds($.autoBounds);$.bounds!=null&&(D&&(E==null?void 0:E.lower)!==$.bounds.lower||L&&(E==null?void 0:E.upper)!==$.bounds.upper)&&(R==null||R($.bounds))},[$.autoBounds,$.bounds]);const C=yn({loc:l,key:`${n}-${r}`,size:I+F,order:1},`${e.toUpperCase()}Axis`),A=j.useTypography(a).toString(),M=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(c==null)return;let L=Z.dimensions(c,A)[d.g.dimension(d.g.construct(u))];L>0&&(L+=9),B(V=>({...V,labelSize:L}))}else{let L=Z.dimensions(c,A).height*1.3;L>0&&(L+=12);const V=M.current;z.withinSizeThreshold(V,L)||(M.current=L,B(H=>({...H,labelSize:L})))}},[c,u,A]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(te.Space,{className:d.CSS(y,d.CSS.B("axis"),d.CSS.B(s),d.CSS.loc(l)),style:{...b,...C},align:"center",justify:l!=="left"?"end":"start",direction:d.g.swap(e),...P,children:k&&o.jsxRuntimeExports.jsx(j.MaybeEditable,{className:d.CSS(d.CSS.BE("axis","label"),d.CSS.dir(u)),value:c,onChange:x,level:a})}),o.jsxRuntimeExports.jsx(j.Composite,{path:T,children:i})]})})},Qi=Mo("x"),el=Mo("y"),tl=d.G.xy.extend({root:d.K.corner,units:ce.z.object({x:ce.z.enum(["px","decimal"]),y:ce.z.enum(["px","decimal"])})}),xf=tl.partial({root:!0,units:!0}),pf=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},mf=(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.Eo.construct(t.current),r=d.Eo.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.Eo.width(s))/d.Eo.width(r):n.x/=d.Eo.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.Eo.height(s))/d.Eo.height(r):n.y/=d.Eo.height(r),n},nl=(e,t)=>{if(t.current==null)return null;const n=d.Eo.construct(t.current.parentElement),s=d.Eo.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.Eo.width(n)-d.Eo.width(s),r.root.x="right"):e.x<.2?r.x=e.x*d.Eo.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*d.Eo.height(n)-d.Eo.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*d.Eo.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...d.G.truncate(r,3)}},Cr=d.Eo.reRoot(d.Eo.DECIMAL,d.K.TOP_LEFT),Po=g.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,...i})=>{const[l,c]=Z.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=j.useSyncedRef(r===!1),x=g.useRef(null);l!==null&&(s={...s,...pf(l)});const p=g.useCallback(f=>{var R;if(((R=x.current)==null?void 0:R.parentElement)==null)return a.current;const h=d.Eo.construct(x.current.parentElement),E=d.b.XY.scale(h).scale(Cr),y=E.box(d.Eo.construct(x.current)),S=d.b.XY.clamp(d.Eo.construct(d.Eo.topLeft(Cr),{width:1-d.Eo.width(y),height:1-d.Eo.height(y)})),_=d.G.translate(d.G.construct(a.current),d.Eo.signedDims(E.box(f))),w=S.pos(_);return nl(w,x)},[]),m=j.useCursorDrag({onStart:g.useCallback(()=>{a.current=mf(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(te.Space,{className:d.CSS(e,d.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:m,draggable:r,ref:x,...i,onDrag:j.preventDefault,onDragEnd:j.preventDefault,empty:!0})});Po.displayName="Legend.Container";const Lo=(e,t,n)=>e.sort((s,r)=>s.label.localeCompare(r.label)).map(({key:s,color:r,label:i})=>o.jsxRuntimeExports.jsxs(te.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[o.jsxRuntimeExports.jsx(j.Swatch,{value:r,onChange:l=>t==null?void 0:t({key:s,color:l,label:i}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"small"}),o.jsxRuntimeExports.jsx(j.MaybeEditable,{level:"small",value:i,onChange:l=>t==null?void 0:t({key:s,color:r,label:l}),noWrap:!0})]},s)),No=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...r})=>{const[i,l]=g.useState(!1);return e.length===0?null:o.jsxRuntimeExports.jsx(Po,{...r,draggable:!i,value:n,onChange:s,children:Lo(e,t,l)})},ff=Object.freeze(Object.defineProperty({__proto__:null,Container:Po,Simple:No,calcStickyPos:nl,completeStickyXYz:tl,legendSwatches:Lo,stickyXYz:xf},Symbol.toStringTag,{value:"Module"})),sl=({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=We("Legend");return We("Legend"),o.jsxRuntimeExports.jsx(No,{data:r,onEntryChange:n,...s})},hf=({onLineChange:e})=>{const{lines:t}=We("Legend"),n=j.useUniqueKey(),s=yn({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return o.jsxRuntimeExports.jsx(te.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:Lo(t,e)})},ol=({variant:e="floating",...t})=>e==="floating"?o.jsxRuntimeExports.jsx(sl,{...t}):o.jsxRuntimeExports.jsx(hf,{...t}),rl=j.wrap$1("Line",({aetherKey:e,...t})=>{const[,,n]=j.use$3({aetherKey:e,type:z.Line.TYPE,schema:z.stateZ,initialState:t}),s=j.useMemoDeepEqualProps(t);return g.useLayoutEffect(()=>n(s),[s]),null}),gf=Object.freeze(Object.defineProperty({__proto__:null,Line:rl},Symbol.toStringTag,{value:"Module"})),To=j.wrap$1("Line",({aetherKey:e,color:t,label:n="",...s})=>{const{setLine:r,removeLine:i}=We("Line");return g.useEffect(()=>(r({key:e,color:t,label:n}),()=>i(e)),[n,t]),o.jsxRuntimeExports.jsx(rl,{aetherKey:e,color:t,label:n,...s})}),il=({level:e="h2",...t})=>{const n=j.useUniqueKey(),s=j.useTypography(e),r=yn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return o.jsxRuntimeExports.jsx(te.Space,{justify:"center",align:"center",style:r,children:o.jsxRuntimeExports.jsx(j.MaybeEditable,{...t,level:e})})},ll=j.wrap$1("Tooltip",({aetherKey:e})=>{const[,,t]=j.use$3({aetherKey:e,type:z.Tooltip.TYPE,schema:z.tooltipStateZ,initialState:{position:null}}),n=g.useRef(null),s=g.useCallback(i=>{const l=document.querySelector(".pluto-canvas-container");if(l==null)return;const c=d.Eo.topLeft(l);t({position:d.G.translation(c,d.G.construct(i))})},[t]),r=g.useCallback(()=>t({position:null}),[t]);return g.useEffect(()=>{if(n.current===null)return;const i=n.current.parentElement;if(i!=null)return i.addEventListener("mousemove",s),i.addEventListener("mouseleave",r),()=>{i.removeEventListener("mousemove",s),i.removeEventListener("mouseleave",r)}},[s]),o.jsxRuntimeExports.jsx("span",{ref:n})}),jf=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:ll},Symbol.toStringTag,{value:"Module"})),Ef={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},Ao=g.forwardRef(({className:e,mode:t,maskBox:n,children:s,style:r,...i},l)=>o.jsxRuntimeExports.jsxs("div",{ref:l,className:d.CSS(d.CSS.noSelect,d.CSS.BE("viewport-mask","container"),e),style:{cursor:Ef[t],...r},...i,children:[o.jsxRuntimeExports.jsx("div",{style:{...d.Eo.css(n),display:d.Eo.areaIsZero(n)?"none":"block"},className:d.CSS.BE("viewport-mask","selection")}),s]}));Ao.displayName="ZoomPanMask";const yf=[{key:"start",icon:o.jsxRuntimeExports.jsx(j.wt.TextAlign.Left,{})},{key:"center",icon:o.jsxRuntimeExports.jsx(j.wt.TextAlign.Center,{})},{key:"end",icon:o.jsxRuntimeExports.jsx(j.wt.TextAlign.Right,{})}],Sf=({key:e,entry:t,onClick:n,selected:s})=>o.jsxRuntimeExports.jsx(j.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),ps=({children:e=Sf,...t})=>o.jsxRuntimeExports.jsx(ve.Button,{...t,allowMultiple:!1,data:yf,children:e}),Rf=new Set([Z.g.UUID,Z.g.JSON]),cl=Z.g.ALL.filter(e=>e!==Z.g.UNKNOWN).map(e=>({key:e.toString(),name:Rf.has(e)?e.toString().toUpperCase():d.d.capitalize(e.toString())})),Cf=cl.filter(e=>!new Z.g(e.key).isVariable),wf=[{key:"name",name:"Name"}],bf=({hideVariableDensity:e=!1,...t})=>o.jsxRuntimeExports.jsx(ve.DropdownButton,{...t,data:e?Cf:cl,columns:wf,entryRenderKey:"name"}),vf=[{key:"x",icon:o.jsxRuntimeExports.jsx(j.wt.Arrow.Right,{})},{key:"y",icon:o.jsxRuntimeExports.jsx(j.wt.Arrow.Up,{})}],kf=[{key:"x",icon:o.jsxRuntimeExports.jsx(j.wt.Arrow.Right,{})},{key:"y",icon:o.jsxRuntimeExports.jsx(j.wt.Arrow.Down,{})}],_f=({key:e,entry:t,onClick:n,selected:s})=>o.jsxRuntimeExports.jsx(j.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),al=({children:e=_f,yDirection:t="up",...n})=>o.jsxRuntimeExports.jsx(ve.Button,{...n,allowMultiple:!1,data:t==="up"?vf:kf,children:e}),ul=e=>o.jsxRuntimeExports.jsx(j.Icon,{className:d.CSS.BE("select","clear"),variant:"outlined",...e,children:o.jsxRuntimeExports.jsx(j.wt.Close,{"aria-label":"clear"})}),xt=({onChange:e,value:t,entryRenderKey:n="key",columns:s,data:r,emptyContent:i,inputProps:l,allowNone:c=!0,searcher:a,className:u,variant:x="button",hideColumnHeader:p=!1,disabled:m,omit:f,children:h,dropdownVariant:E="connected",placeholder:y=ms,inputPlaceholder:S=y,triggerTooltip:_,dropdownZIndex:w,filter:R,actions:b,...P})=>{const{visible:k,open:N,close:T,toggle:I}=j.use$2(),[F,$]=g.useState(null),B=a!=null;j.useAsyncEffect(async()=>{if(j.selectValueIsZero(t))return $(null);if((F==null?void 0:F.key)===t)return;let L=null;if(B)try{[L]=await a.retrieve([t])}finally{L??(L=null)}else r!=null&&(L=r.find(V=>V.key===t)??null);$(L)},[a,t,r]);const C=g.useCallback((L,V)=>{Array.isArray(L)||($(L==null?null:V.entries[0]),T(),e(L,V))},[e,c]),A=g.useMemo(()=>B?j.Search:Zt.Filter,[B]),M=o.jsxRuntimeExports.jsx(A,{searcher:a,filter:R,children:({onChange:L})=>o.jsxRuntimeExports.jsx(Mf,{...l,autoFocus:E==="modal",variant:x,onChange:L,onFocus:N,selected:F,entryRenderKey:n,visible:k,allowNone:c,className:u,dropdownVariant:E,disabled:m,placeholder:S,children:b})}),D=o.jsxRuntimeExports.jsx(j.Button,{tooltip:_,variant:"outlined",onClick:I,disabled:m,children:F!=null?dl(n,F):y});return o.jsxRuntimeExports.jsx(ve.Core,{close:T,zIndex:w,open:N,data:r,omit:f,emptyContent:i,allowMultiple:!1,visible:k,value:t,hideColumnHeader:p,onChange:C,allowNone:c,columns:s,listItem:h,variant:E,trigger:E!=="modal"?M:D,extraDialogContent:E==="modal"?M:void 0,keepMounted:!1,...P})},ms="Select",dl=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Mf=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:r,allowNone:i=!0,placeholder:l=ms,className:c,disabled:a,dropdownVariant:u,children:x,...p})=>{const{clear:m}=j.useSelectionUtils(),[f,h]=g.useState("");g.useEffect(()=>{if(!n){if(Z.w$1(t==null?void 0:t.key))return h("");t!=null&&h(dl(e,t))}},[t,n,e]);const E=R=>{s(R),h(R)},y=()=>{f===""&&s(""),h(""),r==null||r()},S=R=>{n||(R.preventDefault(),r==null||r())},_=()=>{h(""),m==null||m()};let w;return u!=="modal"&&(w=o.jsxRuntimeExports.jsx(Bi.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n})),o.jsxRuntimeExports.jsxs(j.Text$2,{className:d.CSS(d.CSS.BE("select","input"),c),value:f,onChange:E,onFocus:y,onKeyDown:j.matchCallback([["Enter"]],R=>{R.preventDefault(),!n&&(r==null||r())}),endContent:w,style:{flexGrow:1},onClick:S,placeholder:l,disabled:a,...p,children:[x,i&&o.jsxRuntimeExports.jsx(ul,{onClick:_,disabled:a})]})},an=({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(j.wt.Circle,{fill:a}));const u=r==null?void 0:o.jsxRuntimeExports.jsx(j.Icon,{"aria-label":"close",size:"small",className:d.CSS.BE("tag","close"),onClick:x=>{x.stopPropagation(),r()},children:o.jsxRuntimeExports.jsx(j.wt.Close,{})});return o.jsxRuntimeExports.jsx(j.WithIcon,{startIcon:s,endIcon:u,className:d.CSS(i,d.CSS.B("tag"),r!=null&&d.CSS.BM("tag","closeable")),level:Z.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:l,...c,children:e})},Pf=Object.freeze(Object.defineProperty({__proto__:null,Tag:an},Symbol.toStringTag,{value:"Module"})),Yt=({onChange:e,value:t,className:n,data:s,columns:r=[],entryRenderKey:i="key",emptyContent:l,searcher:c,renderTag:a=j.componentRenderProp(xl),placeholder:u,onTagDragStart:x,allowMultiple:p,allowNone:m,replaceOnSingle:f,onTagDragEnd:h,style:E,addPlaceholder:y="Add",children:S,dropdownVariant:_="connected",actions:w,...R})=>{const{visible:b,open:P,close:k}=j.use$2(),[N,T]=g.useState([]),[I,F]=g.useState(!1),$=c!=null;j.useAsyncEffect(async()=>{F(!0),j.selectValueIsZero(t)&&T([]);const D=N.map(H=>H.key),L=Z.A(t);if(Z.F.unorderedPrimitiveArrays(D,L)===Z.F.EQUAL)return;let V=[];if($)try{V=await c.retrieve(L)}finally{F(!1)}else s!=null&&(V=s.filter(H=>L.includes(H.key)));T(V)},[c,$,t,s]);const B=g.useCallback((D,L)=>{D!=null&&(T(L.entries),e(Z.A(D),L))},[e]),C=g.useMemo(()=>$?j.Search:Zt.Filter,[$]);let A,M;if(_==="connected")M=o.jsxRuntimeExports.jsx(C,{searcher:c,children:({onChange:D,value:L})=>o.jsxRuntimeExports.jsx(Lf,{value:L,selectedKeys:t,className:n,onChange:D,loading:I,selected:N,onFocus:P,entryRenderKey:i,visible:b,renderTag:a,placeholder:u,onTagDragStart:x,onTagDragEnd:h,style:E,children:w})});else{const D=Z.A(t);M=o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",grow:!0,style:E,size:"small",children:[D.map(L=>{const V=N.find(H=>H.key===L);return a({key:L,entryKey:L,entryRenderKey:i,loading:I,entry:V,onClose:()=>{const H=D.filter(G=>G!==L);e(H,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:H=>x==null?void 0:x(H,L),onDragEnd:H=>h==null?void 0:h(H,L)})}),D.length>0?o.jsxRuntimeExports.jsx(j.Icon,{onClick:P,children:o.jsxRuntimeExports.jsx(j.wt.Add,{style:{color:"var(--pluto-gray-l7)"}})}):o.jsxRuntimeExports.jsx(j.Button,{onClick:P,shade:7,startIcon:o.jsxRuntimeExports.jsx(j.wt.Add,{}),variant:"text",children:y})]}),A=o.jsxRuntimeExports.jsx(C,{searcher:c,children:L=>o.jsxRuntimeExports.jsx(j.Text$2,{autoFocus:!0,placeholder:"Search",...L,children:w})})}return o.jsxRuntimeExports.jsx(ve.Core,{close:k,open:P,data:s,emptyContent:l,visible:b,value:t,onChange:B,allowNone:m,replaceOnSingle:f,columns:r,allowMultiple:!0,listItem:S,trigger:M,extraDialogContent:A,variant:_,...R})},Lf=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:r,visible:i,entryRenderKey:l,renderTag:c,placeholder:a=ms,onTagDragStart:u,onTagDragEnd:x,value:p,className:m,children:f,...h})=>{const{onSelect:E,clear:y}=j.useSelectionUtils(),S=g.useRef(null);g.useLayoutEffect(()=>{var b;i&&((b=S.current)==null||b.focus())},[i,n]);const _=()=>{i||s(""),r==null||r()},w=()=>{i||r==null||r()},R=()=>{i||s("")};return o.jsxRuntimeExports.jsxs(j.Text$2,{ref:S,className:d.CSS(d.CSS.BE("select-multiple","input"),d.CSS.visible(i),m),onBlur:R,placeholder:a,value:p,onChange:s,onFocus:_,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:w,variant:"button",...h,children:[o.jsxRuntimeExports.jsx(te.Space,{direction:"x",className:d.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:Z.A(e).map(b=>{const P=n.find(k=>k.key===b);return c({key:b,entryKey:b,entryRenderKey:l,loading:t,entry:P,onClose:()=>E==null?void 0:E(b),onDragStart:k=>u==null?void 0:u(k,b),onDragEnd:k=>x==null?void 0:x(k,b)})})}),f,o.jsxRuntimeExports.jsx(ul,{onClick:y})]})},xl=({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(an,{size:"small",variant:"outlined",className:d.CSS(n==null&&!s&&d.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},Z.Y(i))},Nf=[{key:"large",label:"L"},{key:"medium",label:"M"},{key:"small",label:"S"}],pl=({children:e,...t})=>o.jsxRuntimeExports.jsx(ve.Button,{...t,data:Nf,entryRenderKey:"label",children:e}),Tf=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:ve.BaseButton,Button:ve.Button,ComponentSize:pl,DEFAULT_PLACEHOLDER:ms,DataType:bf,Direction:al,DropdownButton:ve.DropdownButton,Multiple:Yt,MultipleTag:xl,Single:xt,TextAlignment:ps,defaultButton:ve.defaultButton},Symbol.toStringTag,{value:"Module"})),Dn=6,Af=2,wr=5,If=e=>d.Eo.width(e)<wr&&d.Eo.height(e)<wr,$f=["zoom","pan","select","zoomReset"],on=[...$f,"click"],zf=ce.z.enum(on),ml=["zoom","select"],On={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},fl={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},hl={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Io={zoom:On,pan:fl,select:hl,zoomReset:On,click:On},Bf=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)]))},Df=d.Eo.construct(0,0,1,1,d.K.TOP_LEFT),Of={width:30,height:50},gl=({onChange:e,triggers:t,initial:n=Df,threshold:s=Of,ref:r})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[l,c]=g.useState(d.Eo.ZERO),[a,u]=g.useState(i),[x,p]=j.useStateRef(n),m=g.useRef(d.G.ZERO),f=g.useRef(null),h=d._.construct(s);g.useEffect(()=>p(()=>d.Eo.truncate(n,Dn)),[n]),g.useEffect(()=>u(i),[i]);const[E,y,S,_]=j.useMemoCompare(()=>{const N={...Io[i],...t},T=j.flattenConfig(N),I=Bf(N);return[N,T,I,j.flattenConfig(I)]},j.compareModeConfigs,[t]),w=g.useCallback(({box:N,triggers:T,stage:I,cursor:F})=>{if(f.current==null)return;const $=j.determineMode(E,T),B=d.Eo.construct(f.current);if($==null)return;if($==="zoomReset")return c(d.Eo.ZERO),e==null||e({box:d.Eo.DECIMAL,mode:$,stage:I,cursor:F}),p(d.Eo.DECIMAL);const C=If(N);if(I==="end"){if(C){$==="zoom"&&c(d.Eo.ZERO),e==null||e({box:x.current,mode:"click",stage:I,cursor:F});return}return p(M=>{if($==="pan"){const L=br(N,M,B);return L===null||d.Eo.equals(L,M)?M:(e==null||e({box:L,mode:$,stage:I,cursor:F}),L)}const D=R(N,M,B);return D===null?M:(e==null||e({box:D,mode:$,stage:I,cursor:F}),$==="zoom"?(c(d.Eo.ZERO),D):d.Eo.truncate(M,Dn))})}if(ml.includes($))return C?void 0:c(d.b.XY.scale(B).clamp(B).translate({x:-d.Eo.left(B),y:-d.Eo.top(B)}).box(vr(h,N,B)));if(c(M=>d.Eo.areaIsZero(M)?M:d.Eo.ZERO),d.G.distance(F,m.current)<Af)return;m.current=F;const A=br(N,x.current,B);e==null||e({box:A,mode:$,stage:I,cursor:F})},[c,u,e,E,s.height,s.width,p,f]);g.useImperativeHandle(r,()=>({reset:()=>{c(d.Eo.ZERO),p(d.Eo.DECIMAL),e==null||e({box:d.Eo.DECIMAL,mode:"zoomReset",stage:"start",cursor:d.G.ZERO})}}),[e]);const R=g.useCallback((N,T,I)=>d.Eo.truncate(so(T,I).box(vr(h,N,I)),Dn),[s]),b=j.useHeldRef({triggers:[["Control"]]}),P=j.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const N=T=>{if(f.current==null)return;let I=1;T.deltaY<0?I-=.035:I+=.035;const F=d.Eo.construct(f.current),$=d.G.construct(T);if(Array.from(f.current.children).push(f.current),!d.Eo.contains(F,$)||f.current!==T.target&&j.findParent(T.target,L=>L===f.current)==null)return;const A=so(x.current,d.Eo.construct(f.current)).pos(d.G.construct(T));let D=d.b.XY.magnify({x:b.current.held?1:I,y:P.current.held?1:I}).box(x.current);D=d.Eo.translate(D,{x:b.current.held?0:A.x*(1-I),y:P.current.held?0:A.y*(1-I)}),p(D),e==null||e({stage:"end",box:D,cursor:d.G.construct(T),mode:"zoom"})};return window.addEventListener("wheel",N),()=>window.removeEventListener("wheel",N)},[p,e]),Di.useDrag({bound:f,onDrag:w,triggers:y,loose:!0});const k=g.useCallback(({triggers:N,stage:T})=>{if(T==="end")return u(i);const I=j.determineMode(S,N);I!=null&&u(I)},[S,i,e]);return j.use$1({triggers:_,callback:k,region:f}),{maskBox:l,ref:f,mode:a}},so=(e,t)=>d.b.XY.scale(t).clamp(t).scale(e),br=(e,t,n)=>{let s=d.Eo.signedDims(so(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},d.Eo.truncate(d.b.XY.translate(d.G.construct(s)).box(t),Dn)},vr=(e,t,n)=>d.Eo.height(t)<=e.height?d.Eo.construct(d.Eo.left(t),d.Eo.top(n),d.Eo.width(t),d.Eo.height(n)):d.Eo.width(t)<=e.width?d.Eo.construct(d.Eo.left(n),d.Eo.top(t),d.Eo.width(n),d.Eo.height(t)):t,Vf=({mode:e,triggers:t})=>o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",children:[o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:d.d.capitalize(e)}),o.jsxRuntimeExports.jsx(te.Space,{empty:!0,direction:"x",align:"center",children:o.jsxRuntimeExports.jsx(j.Text,{trigger:t[0],level:"small"})})]}),Ff={zoom:o.jsxRuntimeExports.jsx(j.wt.Zoom,{}),pan:o.jsxRuntimeExports.jsx(j.wt.Pan,{}),select:o.jsxRuntimeExports.jsx(j.wt.Selection,{}),zoomReset:o.jsxRuntimeExports.jsx(j.wt.Expand,{}),click:o.jsxRuntimeExports.jsx(j.wt.Bolt,{})},Hf=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([r])=>!t.includes(r)&&on.includes(r)).map(([r,i])=>({key:r,icon:Ff[r],tooltip:o.jsxRuntimeExports.jsx(Vf,{mode:r,triggers:i})})).sort((r,i)=>on.indexOf(r.key)-on.indexOf(i.key));return o.jsxRuntimeExports.jsx(ve.Button,{...n,data:s,entryRenderKey:"icon",children:({title:r,entry:i,...l})=>g.createElement(j.Icon,{...l,key:i.key,variant:l.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},Zf=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Io,MASK_MODES:ml,MODES:on,Mask:Ao,PAN_DEFAULT_TRIGGERS:fl,SELECT_DEFAULT_TRIGGERS:hl,SelectMode:Hf,ZOOM_DEFAULT_TRIGGERS:On,modeZ:zf,use:gl},Symbol.toStringTag,{value:"Module"})),Gf=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,$o=g.forwardRef(({children:e,initial:t=d.Eo.DECIMAL,onChange:n,...s},r)=>{const{setViewport:i}=We("Viewport");g.useLayoutEffect(()=>{i({box:t,mode:"zoom",cursor:d.G.ZERO,stage:"start"})},[i,t]);const l=g.useCallback(a=>{i(a),n==null||n(a)},[n,i]),c=gl({onChange:l,initial:t,ref:r,...s});return o.jsxRuntimeExports.jsx(Ao,{className:d.CSS.BE("line-plot","viewport"),...c,children:e})});$o.displayName="Viewport";const Yf=Object.freeze(Object.defineProperty({__proto__:null,Floating:sl,Legend:ol,Line:To,LinePlot:Ji,Title:il,Tooltip:jf,Viewport:$o,XAxis:Qi,YAxis:el,axisFactory:Mo,selectViewportEl:Gf,useContext:We,useGridEntry:yn,useViewport:Ui},Symbol.toStringTag,{value:"Module"})),Wf=j.wrap$1("Tooltip",({aetherKey:e,...t})=>(j.use$3({aetherKey:e,type:z.Annotation.TYPE,schema:z.annotationStateZ,initialState:t}),null)),jl=j.wrap$1("Annotation.Provider",({aetherKey:e,menu:t,...n})=>{const{setViewport:s,setHold:r}=We("Range.Provider"),[,{hovered:i,count:l},c]=j.use$3({aetherKey:e,type:z.Provider$1.TYPE,schema:z.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),a=yn({key:e,loc:"top",size:l>0?32:0,order:3},"Annotation.Provider"),u=j.useContextMenu(),x=j.useSyncedRef(u.visible),p=g.useCallback(m=>{const f=E=>{c(y=>({...y,cursor:{x:E.clientX,y:E.clientY}}))},h=m.currentTarget;h.addEventListener("mousemove",f),h.addEventListener("mouseleave",()=>{h.removeEventListener("mousemove",f),x.current||c(E=>({...E,cursor:null}))},{once:!0})},[c]);return o.jsxRuntimeExports.jsx(j.ContextMenu,{style:{...a,cursor:i!=null?"pointer":"default"},...u,menu:()=>t==null||i==null?null:t(i),children:o.jsxRuntimeExports.jsx(te.Space,{style:{width:"100%",height:"100%"},onClick:()=>{i!=null&&(s({box:d.Eo.construct({x:i.viewport.lower,y:0},{x:i.viewport.upper,y:1}),mode:"zoom",cursor:d.G.ZERO,stage:"start"}),r(!0))},onMouseEnter:p})})}),Xf=Object.freeze(Object.defineProperty({__proto__:null,Annotation:Wf,Provider:jl},Symbol.toStringTag,{value:"Module"})),El={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},Kf=j.flattenConfig(El),yl=j.wrap$1("Measure",({aetherKey:e})=>{const[,,t]=j.use$3({aetherKey:e,type:z.Measure.TYPE,schema:z.measureStateZ,initialState:{hover:null,one:null,two:null}}),n=g.useRef(null),s=j.useHeldRef({triggers:Kf,loose:!0}),r=g.useCallback(({mode:c,cursor:a})=>{if(c==="click"){const u=j.determineMode(El,s.current.triggers,{loose:!0});if(["one","two"].includes(u))return t(x=>({...x,[u]:a}));t(u==="clear"?x=>({...x,one:null,two:null}):x=>({...x,one:x.one??a,two:x.one!==null?a:x.two}))}},[t,s]);Ui(r);const i=g.useCallback(c=>t(a=>({...a,hover:d.G.construct(c)})),[t]),l=g.useCallback(()=>{t(c=>({...c,hover:null}))},[t]);return g.useEffect(()=>{if(n.current===null)return;const c=n.current.parentElement;if(c!=null)return c.addEventListener("mousemove",i),c.addEventListener("mouseleave",l),()=>{c.removeEventListener("mousemove",i),c.removeEventListener("mouseleave",l)}},[r]),o.jsxRuntimeExports.jsx("span",{ref:n})}),qf=Object.freeze(Object.defineProperty({__proto__:null,Measure:yl},Symbol.toStringTag,{value:"Module"})),zo=j.wrap$1("Rule",({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,E]=Z.usePurePassthrough({value:t,onChange:s,initial:""}),y=j.useSyncedRef(r),[,{pixelPosition:S},_]=j.use$3({aetherKey:e,type:z.Rule.TYPE,schema:z.ruleStateZ,initialState:{color:c,dragging:!1,position:n,lineWidth:a,lineDash:u},onAetherChange:g.useCallback(({position:B})=>{var C;B!=null&&((C=y.current)==null||C.call(y,B))},[y])}),w=g.useRef(S);S!==w.current&&(w.current=S);const{id:R}=We("Rule"),b=document.getElementById(R),P=b==null?void 0:b.querySelector(".pluto-line-plot__viewport"),k=g.useRef(S);g.useEffect(()=>{_(B=>({...B,position:n,color:c,lineWidth:a,lineDash:u}))},[n,c,a,u]);const N=j.useCursorDrag({onStart:g.useCallback(()=>{p==null||p(),_(B=>({...B,dragging:!0})),k.current=w.current},[]),onMove:B=>{_(C=>({...C,pixelPosition:(k.current??0)+d.Eo.signedHeight(B)}))},onEnd:g.useCallback(()=>{_(B=>({...B,dragging:!1})),k.current=S},[])}),T=g.useRef(null);if(n==null||S==null)return null;const F=new d.Color(c).pickByContrast("#000000","#ffffff"),$=o.jsxRuntimeExports.jsxs("div",{ref:T,className:d.CSS.B("rule"),style:{top:`calc(${S}px - 0.5rem)`},children:[o.jsxRuntimeExports.jsx("div",{className:d.CSS.BE("rule","drag-handle"),onDragStart:N,draggable:!0}),o.jsxRuntimeExports.jsxs(te.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(j.Editable,{className:d.CSS.B("label"),level:"small",value:h,onChange:E,color:F}),o.jsxRuntimeExports.jsx(j.Divider,{direction:"y",style:{borderColor:d.cssString(c)}}),o.jsxRuntimeExports.jsxs(te.Space,{size:"small",direction:"x",align:"center",children:[o.jsxRuntimeExports.jsx(j.Editable,{value:n.toFixed(2),onChange:B=>{const C=Number(B);isFinite(C)&&(r==null||r(C))},level:"small",color:F}),o.jsxRuntimeExports.jsx(j.MaybeEditable,{level:"small",color:F,value:l,onChange:i})]})]})]});return P==null?$:vo.createPortal($,P)}),Uf=Object.freeze(Object.defineProperty({__proto__:null,Rule:zo},Symbol.toStringTag,{value:"Module"})),Sl=j.canDropOfType(Ye),Jf=({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:E=!1,initialViewport:y=d.Eo.DECIMAL,legendVariant:S,onViewportChange:_,viewportTriggers:w,annotationProvider:R,onSelectRule:b,...P})=>{var F;const k=t.filter(({location:$})=>d.K.isY($)),N=g.useRef(null),T=j.usePrevious(e.length),I=j.usePrevious(P.hold);return(T===0&&e.length!==0||I===!0&&P.hold===!1)&&((F=N.current)==null||F.reset()),o.jsxRuntimeExports.jsxs(Ji,{...P,children:[k.map(($,B)=>{const C=e.filter(D=>D.axes.x===$.key),A=t.filter(({location:D})=>d.K.isX(D)),M=f==null?void 0:f.filter(D=>[...A.map(({key:L})=>L),$.key].includes(D.axis));return o.jsxRuntimeExports.jsx(Qf,{axis:$,index:B,lines:C,yAxes:A,rules:M,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:R,onRuleChange:x,onSelectRule:b},$.key)}),i&&o.jsxRuntimeExports.jsx(ol,{onLineChange:u,position:l,onPositionChange:c,variant:S}),n&&o.jsxRuntimeExports.jsx(il,{value:s,onChange:r,level:a}),o.jsxRuntimeExports.jsxs($o,{initial:y,onChange:_,triggers:w,ref:N,children:[h&&o.jsxRuntimeExports.jsx(ll,{}),E&&o.jsxRuntimeExports.jsx(yl,{})]})]})},Qf=({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=j.useDrop({type:"Channel.LinePlot.XAxis",canDrop:Sl,onDrop:g.useCallback(({items:y})=>{const S=j.filterByType(Ye,y);return l==null||l(u,S.map(({key:_})=>_)),S},[u,l])}),h=s==null?void 0:s.filter(y=>y.axis===u),E=j.useDraggingState();return o.jsxRuntimeExports.jsxs(Qi,{...p,...f,location:a,showGrid:x??n===0,className:d.CSS(d.CSS.dropRegion(j.canDropOfType(Ye)(E))),onAutoBoundsChange:y=>c==null?void 0:c({key:u,bounds:y}),children:[e.map((y,S)=>{const _=t.filter(R=>R.axes.y===y.key),w=s==null?void 0:s.filter(R=>R.axis===y.key);return o.jsxRuntimeExports.jsx(th,{axis:{...y,showGrid:x??(n===0&&S===0)},lines:_,rules:w,onRuleChange:r,onAxisChannelDrop:l,onAxisChange:c,onSelectRule:i},y.key)}),h==null?void 0:h.map(y=>g.createElement(zo,{aetherKey:y.key,...y,key:y.key,onLabelChange:S=>r==null?void 0:r({key:y.key,label:S}),onPositionChange:S=>r==null?void 0:r({key:y.key,position:S}),onUnitsChange:S=>r==null?void 0:r({key:y.key,units:S}),onSelect:()=>i==null?void 0:i(y.key)})),o.jsxRuntimeExports.jsx(jl,{...m})]})},eh=({channels:{x:e,y:t}})=>`${e??0}-${t}`,th=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:i,location:l,...c},onSelectRule:a})=>{const u=j.useDrop({type:"Channel.LinePlot.YAxis",canDrop:Sl,onDrop:g.useCallback(({items:p})=>{const m=j.filterByType(Ye,p);return s==null||s(i,m.map(({key:f})=>f)),m},[i,s])}),x=j.useDraggingState();return o.jsxRuntimeExports.jsxs(el,{...c,...u,location:l,className:d.CSS(d.CSS.dropRegion(j.canDropOfType(Ye)(x))),onAutoBoundsChange:p=>r==null?void 0:r({key:i,bounds:p}),children:[e.map(p=>o.jsxRuntimeExports.jsx(nh,{line:p},eh(p))),t==null?void 0:t.map(p=>g.createElement(zo,{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)}))]})},nh=({line:e})=>e.variant==="static"?o.jsxRuntimeExports.jsx(oh,{line:e}):o.jsxRuntimeExports.jsx(sh,{line:e}),sh=({line:{key:e,timeSpan:t,channels:{x:n,y:s},...r}})=>{const i=Number(t.valueOf())*3,l=z.streamChannelData({timeSpan:t,channel:s,keepFor:i}),c=n!=null&&n!==0,a=z.streamChannelData({timeSpan:t,channel:c?n:s,useIndexOfChannel:!c,keepFor:i});return o.jsxRuntimeExports.jsx(To,{aetherKey:e,y:l,x:a,...r})},oh=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const i=z.channelData({timeRange:e,channel:s}),l=n!=null&&n!==0,c=z.channelData({timeRange:e,channel:l?n:s,useIndexOfChannel:!l});return o.jsxRuntimeExports.jsx(To,{aetherKey:t,y:i,x:c,...r})},kr=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Yn=({items:e},t)=>{const n=j.filterByType(Ye,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Rl=["name","alias"],Cl=e=>{const t=ds();return g.useMemo(()=>e.length===0?kr:kr.filter(n=>e.includes(n.key)),[e,t])},rh=({columns:e=Rl,onChange:t,className:n,value:s,searchOptions:r,...i})=>{const l=Fe(),c=ds(),a=Cl(e),u=_o(),x=j.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(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:f,onDragEnd:h,...E}=j.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(R=>Yn(R,Z.A(s)),[s]),onDrop:g.useCallback(({items:R})=>{const b=j.filterByType(Ye,R);if(b.length===0)return[];const P=Z.n([...Z.A(s),...b.map(k=>k.key)]);return t(P,{clickedIndex:null,clicked:null,entries:[]}),b},[t,s])}),y=j.useDraggingState(),S=g.useCallback(({dropped:R})=>{t(Z.A(s).filter(b=>!R.some(P=>P.key===b)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),_=g.useCallback((R,b)=>f([{key:b,type:Ye}],S),[f,S]),w=g.useCallback(R=>c[R.key]??R.name,[c]);return o.jsxRuntimeExports.jsx(Yt,{className:d.CSS(n,d.CSS.dropRegion(Yn(y,Z.A(s)))),value:s,onTagDragStart:_,onTagDragEnd:h,searcher:p,onChange:t,columns:a,emptyContent:m,entryRenderKey:w,...E,...i})},Rt=({columns:e=Rl,onChange:t,value:n,className:s,data:r,searchOptions:i,...l})=>{const c=Fe(),a=ds(),u=Cl(e),x=_o(),p=j.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(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),E=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:y,onDragEnd:S,..._}=j.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(P=>Yn(P,Z.o$1(n)),[n]),onDrop:g.useCallback(({items:P})=>{const k=j.filterByType(Ye,P);return k.length===0?[]:(t(k[0].key,{clickedIndex:null,clicked:null,entries:[]}),k)},[E,t])}),w=j.useDraggingState(),R=g.useCallback(()=>n!=null&&y([{type:Ye,key:n}]),[y,n]),b=g.useCallback(P=>a[P.key]??P.name,[a]);return o.jsxRuntimeExports.jsx(xt,{data:r,className:d.CSS(s,d.CSS.dropRegion(Yn(w,Z.o$1(n)))),value:n,onDragStart:R,onDragEnd:S,onChange:t,searcher:m,columns:u,emptyContent:f,entryRenderKey:b,..._,...l})},ih=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Km,AliasProvider:Wi,LinePlot:Jf,SelectMultiple:rh,SelectSingle:Rt,useActiveRange:_o,useAlias:Yi,useAliases:ds,useContext:Gi,useName:xs},Symbol.toStringTag,{value:"Module"})),pt=({path:e,optional:t=!1,onChange:n})=>{const s=tt(),{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}},wl=(e,t=!1,n)=>{const{get:s,bind:r}=tt(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},bl=(e,t=!1,n)=>{var l;const{get:s,bind:r}=tt(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},lh=e=>{var t,n;return((n=(t=wl(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},ch=({path:e,ctx:t,onChange:n})=>{const s=tt(t);g.useEffect(()=>s.bind({path:e,onChange:r=>n(r,s),listenToChildren:!1}),[e,s])},ah=({path:e,optional:t=!1})=>{const{bind:n,get:s}=tt(),[r,i]=g.useState(s(e,{optional:t}));if(g.useEffect(()=>(i(s(e,{optional:t})),n({path:e,onChange:l=>i({...l,value:Z.ee(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},vl=(e,t)=>({add:(n,s)=>{const r=Z.ee(e.get(t).value);r.splice(s,0,...Z.A(n)),e.set(t,r,{validateChildren:!1})},push:(n,s)=>{const r=Z.ee(e.get(t).value);r.push(...Z.A(n)),s!=null&&r.sort(s),e.set(t,r,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,r=new Set(Z.A(n));e.set(t,s.filter((i,l)=>!r.has(l)))},keepOnly:n=>{const s=e.get(t).value,r=new Set(Z.A(n));e.set(t,s.filter((i,l)=>r.has(l)))},set:n=>e.set(t,Z.executeSetter(n,e.get(t).value)),sort:n=>{const s=Z.ee(e.get(t).value);s.sort(n),e.set(t,s)}}),uh=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=tt(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(Z.ee(a.value))},listenToChildren:t})),[e,r,i,c]),g.useMemo(()=>({value:l,...vl(s,e)}),[l,s,e])},Bo=g.createContext({mode:"normal",bind:()=>()=>{},set:()=>{},reset:()=>{},remove:()=>{},get:()=>({value:void 0,status:{key:"",variant:"success",message:""},touched:!1,required:!1}),validate:()=>!1,validateAsync:()=>Promise.resolve(!1),value:()=>({}),has:()=>!1,setStatus:()=>{},clearStatuses:()=>{}}),tt=e=>{const t=g.useContext(Bo);return e??t},_r=e=>({key:e,variant:"success",message:""}),dh=e=>e.code===ce.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",kl=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r})=>{const i=g.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),l=j.useSyncedRef(n),c=j.useSyncedRef(r),a=g.useCallback(({path:b,onChange:P,listenToChildren:k=!1})=>{var F;const{parentListeners:N,listeners:T}=i.current,I=k?N:T;return I.has(b)||I.set(b,new Set),(F=I.get(b))==null||F.add(P),()=>{var $;return($=I.get(b))==null?void 0:$.delete(P)}},[]),u=g.useCallback((b,{optional:P}={optional:!1})=>{const{state:k,statuses:N,touched:T}=i.current,I=Z._.get(k,b,{optional:P});if(I==null)return null;const F={value:I,status:N.get(b)??_r(b),touched:T.has(b),required:!1};if(l.current==null)return F;const $=l.current,B=Z.N.getFieldSchema($,b,{optional:!0});return B==null||(F.required=!B.isOptional()),F},[]),x=g.useCallback(b=>{const{state:P,statuses:k,touched:N,listeners:T,parentListeners:I}=i.current;Z._.remove(P,b),k.delete(b),N.delete(b),T.delete(b),I.delete(b)},[]),p=g.useCallback(b=>{const{statuses:P,touched:k}=i.current;i.current.state=b,f(""),P.clear(),k.clear()},[]),m=g.useCallback(b=>{var N;const{listeners:P}=i.current,k=u(b,{optional:!0});k!=null&&((N=P.get(b))==null||N.forEach(T=>T(k)))},[]),f=g.useCallback(b=>{const{listeners:P,parentListeners:k}=i.current,N=P.get(b);if(b==""&&([...P.keys()].forEach(F=>{var B;const $=u(F,{optional:!0});$!=null&&((B=P.get(F))==null||B.forEach(C=>{C($)}))}),[...k.keys()].forEach(F=>{var B;const $=u(F,{optional:!0});$!=null&&((B=k.get(F))==null||B.forEach(C=>{C($)}))})),N!=null){const T=u(b,{optional:!0});T!=null&&N.forEach(I=>{I(T)})}k.forEach((T,I)=>{if(Z._.pathsMatch(b,I)){const $=u(I,{optional:!0});$!=null&&T.forEach(B=>{B($)})}})},[]),h=g.useCallback((b,P="",k=!0)=>{const{statuses:N,listeners:T,touched:I}=i.current;if(b.success){const C=[...N.keys()];return N.clear(),C.forEach(A=>m(A)),!0}let F=!0;const $=new Set(b.error.issues.map(C=>C.path.join(".")));let B=(C,A)=>C===A;return k&&(B=(C,A)=>Z._.pathsMatch(C,A)),b.error.issues.forEach(C=>{var V;const{message:A}=C,M=C.path.join(".");if(!B(M,P))return;const D=dh(C);D!=="warning"&&(F=!1),N.set(M,{key:M,variant:D,message:A}),I.add(M);let L=u(M,{optional:!0});L??(L={value:void 0,status:N.get(M)??_r(M),touched:!1,required:!1}),(V=T.get(M))==null||V.forEach(H=>H(L))}),N.forEach((C,A)=>{$.has(A)||(N.delete(A),m(A))}),F},[]),E=g.useCallback((b,P)=>{if(l.current==null)return!0;const{state:k}=i.current,N=l.current.safeParse(k);return h(N,b,P)},[h]),y=g.useCallback(async(b,P)=>{if(l.current==null)return!0;const{state:k}=i.current,N=await l.current.safeParseAsync(k);return h(N,b,P)},[h]),S=g.useCallback((b,P,k={})=>{const N=Z._.get(i.current.state,b,{optional:!0}),{validateChildren:T=!0}=k,{state:I,touched:F}=i.current;F.add(b),b.length===0?i.current.state=P:Z._.set(I,b,P),f(b),(async()=>{var B;let $;try{$=E(b,T)}catch{$=await y(b,T)}(B=c.current)==null||B.call(c,{values:i.current.state,path:b,prev:N,valid:$})})()},[]),_=g.useCallback(b=>Z._.has(i.current.state,b),[]),w=g.useCallback((b,P)=>{i.current.statuses.set(b,P),i.current.touched.add(b),m(b)},[]),R=g.useCallback(()=>{const{statuses:b}=i.current;b.clear(),b.forEach((P,k)=>m(k))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:b}=i.current;i.current.state=e,b.forEach((P,k)=>{const N=u(k,{optional:!0});N!=null&&P.forEach(T=>T(N))})},[t,e]),g.useMemo(()=>({bind:a,set:S,get:u,mode:s,validate:E,validateAsync:y,value:()=>i.current.state,has:_,remove:x,setStatus:w,clearStatuses:R,reset:p}),[a,S,u,E,y,_,x,w,R,p,s])},xh=e=>o.jsxRuntimeExports.jsx(Bo.Provider,{value:e,children:e.children}),ph=j.componentRenderProp(j.Text$2),ye=({path:e,children:t=ph,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:i=!1,optional:l,onChange:c,className:a,...u})=>{const x=pt({path:e,optional:l??i,onChange:c}),p=tt();if(x==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??(n=d.d.capitalize(Z._.element(e,-1))),r=typeof r=="function"?r(x,p):r,!r)return null;const m=x.status.message,{onChange:f,value:h}=x,E={onChange:f,value:h};return x.variant!=null&&(E.variant=x.variant),o.jsxRuntimeExports.jsx(Ne.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(E)})},_t=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:i,path:l,fieldKey:c=t,...a})=>o.jsxRuntimeExports.jsx(ye,{...n,...a,path:c?`${l}.${c}`:l,children:u=>o.jsxRuntimeExports.jsx(e,{...u,...s,...i})});return r.displayName=e.displayName,r},_l=_t(j.Numeric),$t=_l({}),Ml=_t(j.Text$2),Do=Ml({}),Pl=_t(j.Switch$1),fs=Pl({}),mh=_t(xt),fh=_t(Yt),hh=_t(ve.DropdownButton),Oo=({key:e,open:t,onChange:n})=>{const s=j.useMemoPrimitiveArray(e);j.useAsyncEffect(async()=>{if(t==null)return;const r=await t();if(r!=null)return r.onChange(n),async()=>await r.close()},[t==null,s])},gh=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return j.useAsyncEffect(async()=>{s(await e())},[e]),Oo({...t,onChange:s}),n},jh=Object.freeze(Object.defineProperty({__proto__:null,useListener:Oo,useState:gh},Symbol.toStringTag,{value:"Module"})),Eh=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:i,applyObservable:l,...c})=>{const a=Fe(),u=j.useAggregator(),x=j.useMemoPrimitiveArray(e),p=kl({values:s,...c,sync:!1,onChange:h=>{a!=null&&(async()=>{try{await(i==null?void 0:i({...h,client:a}))}catch(E){u({variant:"error",message:`Failed to save ${t}`,description:E.message})}})()}});j.useAsyncEffect(async()=>{if(a!=null)try{const h=await n({client:a});p.set("",h)}catch(h){u({variant:"error",message:`Failed to retrieve ${t}`,description:h.message})}},[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 Oo({key:x,open:m,onChange:f}),p},yh=Object.freeze(Object.defineProperty({__proto__:null,Context:Bo,Field:ye,Form:xh,NumericField:$t,SwitchField:fs,TextField:Do,buildDropdownButtonSelectField:hh,buildNumericField:_l,buildSelectMultiField:fh,buildSelectSingleField:mh,buildSwitchField:Pl,buildTextField:Ml,fieldArrayUtils:vl,fieldBuilder:_t,use:kl,useChildFieldValues:ah,useContext:tt,useField:pt,useFieldArray:uh,useFieldListener:ch,useFieldState:wl,useFieldValid:lh,useFieldValue:bl,useSynced:Eh},Symbol.toStringTag,{value:"Module"})),Sh=[{key:"name",name:"Name"},{key:"location",name:"Location"}],Rh=({searchOptions:e,...t})=>{const n=Fe();let s=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(s=n.hardware.devices.newSearcherWithOptions(e)),o.jsxRuntimeExports.jsx(xt,{columns:Sh,searcher:s,entryRenderKey:"name",...t})},Ch=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Rh},Symbol.toStringTag,{value:"Module"})),zt="label",Vo=[{key:"color",name:"Color",render:({entry:e})=>o.jsxRuntimeExports.jsx(j.wt.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Wn=({items:e},t)=>{const n=j.filterByType(zt,e);return n.length>0&&!n.every(s=>t.includes(s.key))},wh=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...r})=>o.jsxRuntimeExports.jsx(an,{color:e==null?void 0:e.color,...r,children:e==null?void 0:e.name}),bh=j.componentRenderProp(wh),vh=({onChange:e,className:t,value:n,...s})=>{const r=Fe(),i=r!=null?void 0:o.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=j.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(m=>Wn(m,Z.A(n)),[n]),onDrop:g.useCallback(({items:m})=>{const f=j.filterByType(zt,m);if(f.length===0)return[];const h=Z.n([...Z.A(n),...f.map(E=>E.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),u=j.useDraggingState(),x=g.useCallback(({dropped:m})=>{e(Z.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:zt}],x),[l,x]);return o.jsxRuntimeExports.jsx(Yt,{className:d.CSS(t,d.CSS.dropRegion(Wn(u,Z.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.labels,onChange:e,columns:Vo,emptyContent:i,renderTag:bh,addPlaceholder:"Label",...a,...s})},Ll=({value:e,onChange:t})=>{const n=Fe(),s=n!=null?void 0:o.jsxRuntimeExports.jsx(j.Text$3.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=j.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(u=>Wn(u,Z.o$1(e)),[e]),onDrop:g.useCallback(({items:u})=>{const x=j.filterByType(zt,u);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[i,t])}),c=j.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:zt,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},kh=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:i,...l}=Ll({value:t,onChange:e});return o.jsxRuntimeExports.jsx(xt,{data:s,className:d.CSS(n,d.CSS.dropRegion(Wn(i,Z.o$1(t)))),value:t,onChange:e,columns:Vo,entryRenderKey:"name",...l,...r})},_h=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...i}=Ll({value:t,onChange:n});return o.jsxRuntimeExports.jsx(xt,{data:e,value:t,onChange:n,columns:Vo,entryRenderKey:"name",...i,...s})},Mh=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:zt,SelectButton:_h,SelectMultiple:vh,SelectSingle:kh},Symbol.toStringTag,{value:"Module"})),Nl=({children:e,centered:t,visible:n,enabled:s=!0,close:r,style:i,...l})=>{const c=g.useRef(null),a=g.useRef(n);j.useClickOutside({ref:c,exclude:x=>j.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 j.use$1({triggers:[["Escape"]],callback:u,loose:!0}),o.jsxRuntimeExports.jsx(te.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(te.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(te.Space,{className:d.CSS(d.CSS.BE("modal","content")),empty:!0,children:e})})})},Ph=({root:e,...t})=>vo.createPortal(o.jsxRuntimeExports.jsx(Nl,{...t}),j.getRootElement(e)),Lh=Object.freeze(Object.defineProperty({__proto__:null,Dialog:Nl,Modal:Ph},Symbol.toStringTag,{value:"Module"})),hs=new Error("Tab not found"),Nh=new Error("Invalid Mosaic"),Xn=(e,t,n="center",s)=>{var p;if(e=nt(e),s===void 0)return oo(e,t);const r=ro(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(ro(e,c).key!==r.key)return Xn(e,t,"center",c);if(r.tabs==null||r.tabs.length===0)return Xn(e,t,"center",s);const[a,u,x]=Bh(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 Nh;return r.first.key=i,r.last.key=l,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},Th=(e,t,n)=>{var i;e=nt(e);const[s,r]=Ct(e,t);if(s==null||r==null)throw hs;return r.tabs=(i=r.tabs)==null?void 0:i.map(l=>l.tabKey===t?n(l):l),e},oo=(e,t)=>(e=nt(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=oo(e.first,t):e.last!=null&&(e.last=oo(e.last,t)),e)),Kn=e=>{e=nt(e);const t=[];if(e.tabs!=null&&(e.selected=ke.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=Kn(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=Kn(e.last);e.last=n,t.push(...s)}return[e,t]},Fo=(e,t)=>{var r;e=nt(e);const[,n]=Ct(e,t);if(n==null)return[e,null];n.tabs=(r=n.tabs)==null?void 0:r.filter(i=>i.tabKey!==t),n.selected=ke.resetSelection(n.selected,n.tabs),e=zh(e);const s=n.selected??qn(e);return[e,s]},qn=e=>e.selected!=null?e.selected:e.first!=null?qn(e.first):e.last!=null?qn(e.last):null,Tl=(e,t)=>{e=nt(e);const[n,s]=Ct(e,t);if(n==null||s==null)throw hs;return s.selected=t,e},Al=(e,t,n,s)=>{e=nt(e);const[r,i]=Ct(e,t);if(r==null||i==null)throw hs;const[l,c]=Fo(e,t);return[Xn(l,r,n,s),c]},un=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=un(e.first,t);if(n!=null)return n}if(e.last!=null){const n=un(e.last,t);if(n!=null)return n}},Il=(e,t,n)=>{const s=Un(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},Ah=(e,t,n)=>{e=nt(e);const s=un(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=ke.resetSelection(u.selected,u.tabs),s.direction=n,s.first=u,s.last=a,s.tabs=void 0,s.selected=void 0,e},Ih=(e,t)=>{const n=un(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},$l=(e,t,n)=>{e=nt(e);const[,s]=Ct(e,t);if((s==null?void 0:s.tabs)==null)throw hs;return s.tabs=ke.rename(t,n,(s==null?void 0:s.tabs)??[]),e},$h=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,ro=(e,t)=>{const n=Un(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:ro(e,s)},zh=e=>{let t=!0;for(;t;)[e,t]=io(e);return e.first==null&&e.last==null&&(e.key=1),e},io=e=>{if(e.first==null||e.last==null)return[e,!1];if(Pr(e.first))return[Mr(e.last,!0),!0];if(Pr(e.last))return[Mr(e.first,!1),!0];let t,n;return[e.first,t]=io(e.first),[e.last,n]=io(e.last),[e,t||n]},Mr=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Pr=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Ct=(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]=Ct(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,i]=Ct(e.last,t);return[r,i]},Un=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=Un(e.first,t);return n??Un(e.last,t)},Bh=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")}},nt=e=>Z._.copy(e),Jn=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&Jn(e.first,t,n),e.last!=null&&Jn(e.last,t,n),n),lo=(e,t)=>{t(e),e.first!=null&&lo(e.first,t),e.last!=null&&lo(e.last,t)};class zl{constructor(t={}){Ge(this,"parent");Ge(this,"stub");Ge(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 Dh=({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})},Bl=({node:e,children:t})=>vo.createPortal(t,e.el),Oh=Object.freeze(Object.defineProperty({__proto__:null,In:Bl,Node:zl,Out:Dh},Symbol.toStringTag,{value:"Module"})),Qn=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}=j.useMultiple({direction:r,onResize:p,count:2,initialSizes:a!=null?[a]:void 0});let f;return s!==void 0?f=o.jsxRuntimeExports.jsx(Dl,{emptyContent:u,...n}):i!=null&&l!=null?f=o.jsxRuntimeExports.jsxs(j.Multiple,{id:`mosaic-${c}`,align:"stretch",className:d.CSS.BE("mosaic","resize"),...m,children:[o.jsxRuntimeExports.jsx(Qn,{...x,root:i,onResize:t},i.key),o.jsxRuntimeExports.jsx(Qn,{...x,root:l,onResize:t},l.key)]}):(f=null,console.warn("Mosaic tree is malformed")),c===1?o.jsxRuntimeExports.jsx(j.Provider$3,{children:f}):f});Qn.displayName="Mosaic";const es="pluto-mosaic-tab-drop",Ho="pluto-mosaic-tab-create",Vh=(e,t,n)=>{if(j.filterByType(j.FILE_TYPE,t).length>0&&n)return!0;const r=j.filterByType(es,t).map(c=>c.key),i=e.filter(c=>!r.includes(c.tabKey)).length>0;return j.filterByType(Ho,t).length>0||r.length>0&&(i||e.length===0)},Dl=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:b})=>Vh(a,b,p),[a,p]),f=g.useCallback(({items:b,event:P})=>{if(P==null)return[];x(null);const k=j.filterByType(j.FILE_TYPE,b).length>0,N=a.length===0?"center":Nr(Lr(P));if(k)return i==null||i(c,N,P),b;const T=j.filterByType(es,b);if(T.length>0){const F=T.map(({key:$})=>$)[0];t(c,F,N)}const I=j.filterByType(Ho,b);if(I.length>0){const F=I.map(({key:$})=>$);n==null||n(c,N,F)}return T},[t,a.length]),h=g.useCallback(({event:b})=>{if(b==null)return;const P=a.length===0?"center":Nr(Lr(b));x(P)},[a.length]),{startDrag:E,...y}=j.useDragAndDrop({type:"Mosaic",canDrop:m,onDrop:f,onDragOver:h}),S=m(j.useDraggingState()),_=g.useCallback(()=>x(null),[]),w=g.useCallback((b,{tabKey:P})=>{E([{key:P,type:es,elementID:b.currentTarget.id}])},[E]),R=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(ke.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:_,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:w,onCreate:R,...l,...y,children:[e.selected!=null&&r(a.find(b=>b.tabKey===e.selected)),S&&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:Fh[u]})]})});Dl.displayName="MosaicTabLeaf";const Fh={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%"}},Lr=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}},Hh=e=>e,Zh=e=>1-e,Nr=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[Hh(e),Zh(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")},Gh=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),r=new Set,i=Jn(e,l=>{var c;return(c=l.tabs)==null?void 0:c.map(a=>{let u=s.current.get(a.tabKey);return a==null?null:(u==null&&(u=new zl({style:"width: 100%; height: 100%; position: relative;"}),u.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,u)),r.add(a.tabKey),o.jsxRuntimeExports.jsx(Bl,{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]},Yh=ce.z.object({key:ce.z.number(),tabs:ce.z.array(ke.tabZ).optional(),selected:ce.z.string().optional(),direction:d.g.direction.optional(),size:ce.z.number().optional()}),co=Yh.extend({first:ce.z.lazy(()=>co).optional(),last:ce.z.lazy(()=>co).optional()}),Wh=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(Kn(t)[0]),[t]),{root:n,onDrop:(u,x,p)=>s(m=>Al(m,x,p,u)[0]),onClose:u=>s(x=>Fo(x,u)[0]),onSelect:u=>s(x=>Tl(x,u)),onResize:(u,x)=>s(p=>Il(p,u,x)),onRename:e?(u,x)=>s(p=>$l(p,u,x)):void 0}},Xh=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Ho,HAUL_DROP_TYPE:es,Mosaic:Qn,autoSelectTabs:Kn,canSplit:Ih,findSelected:qn,findTabNode:un,forEachNode:lo,insertTab:Xn,isEmpty:$h,mapNodes:Jn,moveTab:Al,nodeZ:co,removeTab:Fo,renameTab:$l,resizeNode:Il,selectTab:Tl,split:Ah,updateTab:Th,use:Wh,usePortal:Gh},Symbol.toStringTag,{value:"Module"})),Kh=({variant:e,className:t,children:n,...s})=>o.jsxRuntimeExports.jsx(te.Space,{className:d.CSS(t,d.CSS.B("note"),d.CSS.M(e)),align:"stretch",empty:!0,...s,children:n}),qh=Object.freeze(Object.defineProperty({__proto__:null,Note:Kh},Symbol.toStringTag,{value:"Module"})),Vs={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"})]})},Uh=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:i,onClose:l,...c})=>o.jsxRuntimeExports.jsxs(te.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(Fs,{onClick:l,className:d.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Vs.Close}),o.jsxRuntimeExports.jsx(Fs,{onClick:s,className:d.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Vs.Minimize}),o.jsxRuntimeExports.jsx(Fs,{onClick:i,className:d.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Vs.Maximize})]}),Fs=({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}),Hs=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:i,...l})=>o.jsxRuntimeExports.jsxs(te.Pack,{...l,children:[o.jsxRuntimeExports.jsx(Zs,{className:d.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:o.jsxRuntimeExports.jsx(j.wt.Subtract,{})}),o.jsxRuntimeExports.jsx(Zs,{className:d.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:o.jsxRuntimeExports.jsx(j.wt.Box,{})}),o.jsxRuntimeExports.jsx(Zs,{onClick:s,className:d.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:o.jsxRuntimeExports.jsx(j.wt.Close,{})})]}),Zs=({disabled:e=!1,className:t,...n})=>e?null:o.jsxRuntimeExports.jsx(j.Icon,{className:d.CSS(d.CSS.B("windows-control"),t),tabIndex:-1,...n}),Ol=e=>Z.S.getOS(e),Jh={MacOS:Uh,Windows:Hs,Linux:Hs,Docker:Hs},Qh="Windows",eg=({forceOS:e,visibleIfOS:t,...n})=>{const s=Ol({force:e,default:Qh}),r=Jh[s];return t!=null&&t!==s?null:o.jsxRuntimeExports.jsx(r,{...n})},tg=Object.freeze(Object.defineProperty({__proto__:null,Controls:eg,use:Ol},Symbol.toStringTag,{value:"Module"})),ng=(e,t)=>{const n=s=>o.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},sg=Object.freeze(Object.defineProperty({__proto__:null,createComponent:ng},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:Z.B.NOOP});const og=j.wrap$1(z.Provider$2.TYPE,({aetherKey:e,children:t,...n})=>{const s=j.useMemoDeepEqualProps(n),[{path:r},,i]=j.use$3({aetherKey:e,type:z.Provider$2.TYPE,schema:z.providerStateZ$1,initialState:s});return g.useEffect(()=>{i(s)},[s,i]),o.jsxRuntimeExports.jsx(j.Composite,{path:r,children:t})}),rg="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Vl=j.wrap$1(z.BaseProvider.TYPE,({children:e,aetherKey:t})=>{const[{path:n}]=j.use$3({aetherKey:t,type:z.BaseProvider.TYPE,schema:z.providerStateZ$2,initialState:{}});return o.jsxRuntimeExports.jsx(j.Composite,{path:n,children:e})}),ig=Object.freeze(Object.defineProperty({__proto__:null,Provider:Vl},Symbol.toStringTag,{value:"Module"})),lg=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===Z.Xg.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Fl=j.wrap$1("Chip",({aetherKey:e,source:t,sink:n,className:s,...r})=>{const i=j.useMemoDeepEqualProps({source:t,sink:n}),[,{status:l},c]=j.use$3({aetherKey:e,type:z.Chip.TYPE,schema:z.chipStateZ,initialState:{triggered:!1,...i,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:Z.m.now()}}});g.useEffect(()=>{c(f=>({...f,...i}))},[i,c]);const a=g.useCallback(()=>c(f=>({...f,triggered:!f.triggered})),[c]),{message:u,chipColor:x,buttonStyle:p,disabled:m}=lg(l);return o.jsxRuntimeExports.jsx(j.Icon,{variant:"text",className:d.CSS(d.CSS.B("control-chip"),s),disabled:m,onClick:a,tooltip:o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:u}),style:p,...r,children:o.jsxRuntimeExports.jsx(j.wt.Circle,{color:x})})}),Hl=g.createContext({needsControlOf:[]}),Zl=()=>g.useContext(Hl),cg=j.wrap$1(z.Controller$1.TYPE,({aetherKey:e,children:t,onStatusChange:n,...s})=>{const r=j.useMemoDeepEqualProps(s),[{path:i},{status:l,needsControlOf:c},a]=j.use$3({aetherKey:e,type:z.Controller$1.TYPE,schema:z.controllerStateZ,initialState:r});return g.useEffect(()=>{l!=null&&(n==null||n(l))},[l,n]),g.useEffect(()=>{a(u=>({...u,...r}))},[r,a]),g.useEffect(()=>()=>n==null?void 0:n("released"),[]),o.jsxRuntimeExports.jsxs(Hl.Provider,{value:{needsControlOf:c},children:[o.jsxRuntimeExports.jsx(j.Composite,{path:i,children:t}),";"]})}),Gl=j.wrap$1(z.Indicator.TYPE,({aetherKey:e,colorSource:t,statusSource:n})=>{var a;const s=j.useMemoDeepEqualProps({colorSource:t,statusSource:n}),[,{color:r,status:i},l]=j.use$3({aetherKey:e,type:z.Indicator.TYPE,initialState:{...s,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:Z.m.now()}},schema:z.indicatorStateZ});g.useEffect(()=>{l(u=>({...u,...s}))},[s,l]);let c;return((a=i.data)==null?void 0:a.color)!=null?c=d.Color.z.parse(i.data.color):r!=null&&!r.isZero?c=r:c="var(--pluto-gray-l8)",o.jsxRuntimeExports.jsxs(j.Dialog$1,{location:{x:"center",y:"bottom"},children:[o.jsxRuntimeExports.jsx(j.Text$1,{level:"p",children:i.message}),o.jsxRuntimeExports.jsx("div",{className:d.CSS.B("indicator"),style:{backgroundColor:d.cssString(c),flexGrow:1}})]})}),ag=j.wrap$1(z.Legend.TYPE,({aetherKey:e,...t})=>{const{needsControlOf:n}=Zl(),[,{states:s},r]=j.use$3({aetherKey:e,type:z.Legend.TYPE,schema:z.legendStateZ,initialState:{states:[],needsControlOf:n}});g.useEffect(()=>{r(c=>({...c,needsControlOf:n}))},[n]);const l=Z.n(s.map(c=>c.subject.key)).map(c=>{const a=s.find(u=>u.subject.key===c);if(a==null)throw new Z.Re("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return o.jsxRuntimeExports.jsx(No,{data:l,...t})}),Yl=j.wrap$1(z.StateProvider.TYPE,({aetherKey:e,children:t})=>{const[{path:n}]=j.use$3({aetherKey:e,type:z.StateProvider.TYPE,schema:z.stateProviderStateZ,initialState:{}});return o.jsxRuntimeExports.jsx(j.Composite,{path:n,children:t})}),ug=Object.freeze(Object.defineProperty({__proto__:null,Chip:Fl,Controller:cg,Indicator:Gl,Legend:ag,StateProvider:Yl,useContext:Zl},Symbol.toStringTag,{value:"Module"})),Wl=e=>{const t=({disabled:n=!1,...s})=>n?s.children:o.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},dg=Wl(Vl),xg=Wl(j.Provider$4),pg=({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(j.Provider$2,{...l,children:o.jsxRuntimeExports.jsx(j.Config,{...i,children:o.jsxRuntimeExports.jsx(j.Provider$3,{...a,children:o.jsxRuntimeExports.jsx(j.Provider$5,{url:s??rg,enabled:n,children:o.jsxRuntimeExports.jsx(xg,{workerKey:"vis",children:o.jsxRuntimeExports.jsx(og,{...c,children:o.jsxRuntimeExports.jsx(j.Aggregator,{children:o.jsxRuntimeExports.jsx(Zi,{connParams:t,children:o.jsxRuntimeExports.jsx(Wi,{...u,children:o.jsxRuntimeExports.jsx(dg,{...x,children:o.jsxRuntimeExports.jsx(j.Provider$1,{...p,children:o.jsxRuntimeExports.jsx(j.Provider,{...r,children:o.jsxRuntimeExports.jsx(Yl,{children:e})})})})})})})})})})})})}),mg=Object.freeze(Object.defineProperty({__proto__:null,Provider:pg},Symbol.toStringTag,{value:"Module"})),fg=({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}%`}})}),hg=Object.freeze(Object.defineProperty({__proto__:null,Progress:fg},Symbol.toStringTag,{value:"Module"})),dn="range",Zo=[{key:"name",name:"Name"}],ts=({items:e},t)=>{const n=j.filterByType(dn,e);return n.length>0&&!n.every(s=>t.includes(s.key))},gg=({onChange:e,className:t,value:n,...s})=>{const r=Fe(),i=r!=null?void 0:o.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=j.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(m=>ts(m,Z.A(n)),[n]),onDrop:g.useCallback(({items:m})=>{const f=j.filterByType(dn,m);if(f.length===0)return[];const h=Z.n([...Z.A(n),...f.map(E=>E.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),u=j.useDraggingState(),x=g.useCallback(({dropped:m})=>{e(Z.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:dn}],x),[l,x]);return o.jsxRuntimeExports.jsx(Yt,{className:d.CSS(t,d.CSS.dropRegion(ts(u,Z.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.ranges,onChange:e,columns:Zo,emptyContent:i,entryRenderKey:"name",...a,...s})},Xl=({value:e,onChange:t})=>{const n=Fe(),s=n!=null?void 0:o.jsxRuntimeExports.jsx(j.Text$3.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}=j.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(x=>ts(x,Z.o$1(e)),[e]),onDrop:g.useCallback(({items:x})=>{const p=j.filterByType(dn,x);return p.length===0?[]:(t(p[0].key,{clickedIndex:null,clicked:null,entries:[]}),p)},[i,t])}),a=j.useDraggingState(),u=g.useCallback(()=>e!=null&&l([{type:dn,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:u,searcher:n==null?void 0:n.ranges}},jg=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:i,...l}=Xl({value:t,onChange:e});return o.jsxRuntimeExports.jsx(xt,{data:s,className:d.CSS(n,d.CSS.dropRegion(ts(i,Z.o$1(t)))),value:t,onChange:e,columns:Zo,entryRenderKey:"name",...l,...r})},Eg=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...i}=Xl({value:t,onChange:n});return o.jsxRuntimeExports.jsx(xt,{data:e,value:t,onChange:n,columns:Zo,entryRenderKey:"name",...i,...s})},yg=[{key:"color",name:"Color",width:50,render:e=>o.jsxRuntimeExports.jsx(j.wt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Sg=e=>{const t=Fe();return o.jsxRuntimeExports.jsx(Yt,{...e,searcher:t==null?void 0:t.labels,columns:yg,renderTag:n=>n.entry==null?o.jsxRuntimeExports.jsx(an,{color:"gray",children:n.entryKey}):o.jsxRuntimeExports.jsx(an,{color:n.entry.color,children:n.entry.name})})},Rg=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...r})=>{const i=new Z.m(e.start),l=i.isToday?"time":"dateTime",c=new Z.m(e.end),a=c.equals(Z.m.MAX),u=c.span(i)<Z.w.DAY?"time":"dateTime",x=i.span(c);return o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",size:"small",className:d.CSS(d.CSS.B("time-range-chip")),align:"center",...r,children:[i.isToday&&o.jsxRuntimeExports.jsx(j.Text$1,{level:t,shade:n,weight:450,children:"Today"}),o.jsxRuntimeExports.jsx(j.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:i}),o.jsxRuntimeExports.jsx(j.wt.Arrow.Right,{color:"var(--pluto-text-color)"}),a?o.jsxRuntimeExports.jsx(j.Text$1,{level:t,children:"Now"}):o.jsxRuntimeExports.jsx(j.DateTime,{level:t,displayTZ:"local",format:u,shade:n,weight:450,children:c}),!x.isZero&&s&&o.jsxRuntimeExports.jsxs(j.Text$1,{level:t,shade:n,weight:450,children:["(",i.span(c).truncate(Z.w.MILLISECOND).toString(),")"]})]})},Cg=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Eg,SelectLabels:Sg,SelectMultiple:gg,SelectSingle:jg,TimeRangeChip:Rg},Symbol.toStringTag,{value:"Module"})),wg=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(i=>i.key===t);return o.jsxRuntimeExports.jsx(te.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(j.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>r,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&o.jsxRuntimeExports.jsx(j.wt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},bg=Object.freeze(Object.defineProperty({__proto__:null,Steps:wg},Symbol.toStringTag,{value:"Module"})),vg=j.wrap$1("Table",({aetherKey:e,children:t,className:n,visible:s,...r})=>{const[{path:i},,l]=j.use$3({aetherKey:e,type:z.Table.TYPE,schema:z.Table.stateZ,initialState:{region:d.Eo.ZERO,visible:s}});g.useEffect(()=>{l(a=>({...a,visible:s}))},[s]);const c=En(a=>l(u=>({...u,region:a})));return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{ref:c,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),o.jsxRuntimeExports.jsx("table",{className:d.CSS(d.CSS.B("table"),n),...r,children:o.jsxRuntimeExports.jsx("tbody",{children:o.jsxRuntimeExports.jsx(j.Composite,{path:i,children:t})})})]})}),kg=({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(ql,{onSelect:i,index:s,value:n,onChange:r,position:l,direction:"y"}),e]}),gs=g.forwardRef(({children:e,className:t,selected:n=!1,...s},r)=>o.jsxRuntimeExports.jsx("td",{ref:r,...s,className:d.CSS(d.CSS.BE("table","cell"),d.CSS.selected(n),t),children:e}));gs.displayName="Cell";const Kl="ABCDEFGHIJKLMNOPQRSTUVWXYZ",_g=e=>Kl[e],ql=({value:e,selected:t=!1,index:n,onChange:s,position:r,direction:i="x",onSelect:l})=>{const c=j.useSyncedRef(e),a=g.useRef(e),u=j.useCursorDrag({onStart:g.useCallback(()=>{a.current=c.current},[]),onMove:g.useCallback(x=>s(a.current+d.Eo.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),j.CONTEXT_TARGET,t&&j.CONTEXT_SELECTED),style:{[d.g.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[o.jsxRuntimeExports.jsx(j.Text$1,{level:"p",shade:7,style:{width:"100%",textAlign:"center"},children:i==="x"?Kl[n]:n+1}),o.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[d.g.location(i)]:r+e},onDragStart:u,draggable:!0})]})},Mg=({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(ql,{onSelect:t,position:c,selected:e.includes(l),index:l,value:i,onChange:a=>s(a,l),direction:"x"},l)})]})},Pg=Object.freeze(Object.defineProperty({__proto__:null,Cell:gs,ColumnIndicators:Mg,Row:kg,Table:vg,getCellColumn:_g},Symbol.toStringTag,{value:"Module"})),Lg=[{key:"standard",name:"Standard"},{key:"scientific",name:"Scientific"},{key:"engineering",name:"Engineering"}],Ng=({...e})=>o.jsxRuntimeExports.jsx(ve.Button,{...e,entryRenderKey:"name",data:Lg}),Ul=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Go=({path:e})=>{var f;const{value:t,onChange:n}=pt({path:e}),s=z.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),r=z.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=z.stringifyNumberProps.parse(s.segments.stringifier.props),l=z.rollingAverageProps.parse(s.segments.rollingAverage.props),c=h=>{const E=z.sourcePipeline("string",{connections:Ul,segments:{valueStream:z.streamChannelValue({channel:r.channel}),stringifier:z.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:z.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:E})},a=h=>c({valueStream:z.streamChannelValue({channel:h??0})}),u=h=>c({stringifier:z.stringifyNumber({...i,notation:h})}),x=h=>c({stringifier:z.stringifyNumber({...i,precision:h})}),p=h=>c({rollingAverage:z.rollingAverage({windowSize:h})}),m=xs(r.channel);return g.useEffect(()=>n({...t,tooltip:[m]}),[m]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Rt,{value:r.channel,onChange:a})}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Notation",children:o.jsxRuntimeExports.jsx(Ng,{value:i.notation,onChange:u})}),o.jsxRuntimeExports.jsx(Ne.Item,{label:"Precision",align:"start",children:o.jsxRuntimeExports.jsx(j.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),o.jsxRuntimeExports.jsx(Ne.Item,{label:"Averaging Window",align:"start",children:o.jsxRuntimeExports.jsx(j.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})]})},Tg=z.Value.z.partial({color:!0}).extend({level:Z.levelZ.optional()}),Yo=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:i,level:l="small",backgroundTelem:c,notation:a,location:u})=>{const x=j.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:r,level:l,minWidth:i,notation:a,backgroundTelem:c,location:u}),[,p,m]=j.use$3({aetherKey:e,type:z.Value.TYPE,schema:z.Value.z,initialState:x});return g.useEffect(()=>m(f=>({...f,...x})),[x]),{width:p.width??p.minWidth}},Ag=Object.freeze(Object.defineProperty({__proto__:null,TelemForm:Go,VALUE_CONNECTIONS:Ul,corePropsZ:Tg,use:Yo},Symbol.toStringTag,{value:"Module"})),Ig=ce.z.object({value:ce.z.string(),level:Z.levelZ,weight:Z.weightZ,align:d.K.x.or(d.K.center),backgroundColor:d.crudeZ}),$g=({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(gs,{id:e,className:d.CSS(j.CONTEXT_TARGET,s&&j.CONTEXT_SELECTED,d.CSS.BEM("table","cell","text")),selected:s,onClick:u,onContextMenu:u,style:{backgroundColor:d.cssString(a)},children:o.jsxRuntimeExports.jsx(j.Editable,{level:l,value:n,weight:c,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},zg=ce.z.object({telem:z.stringSourceSpecZ,redline:ce.z.object({bounds:d.H.bounds,gradient:d.gradientZ}),level:Z.levelZ,color:ce.z.string(),units:ce.z.string()}),Bg=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:r,bounds:i},selected:l,box:c,onSelect:a})=>{const{width:u}=Yo({aetherKey:e,box:c,telem:t,level:n,color:s,backgroundTelem:z.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:z.scaleNumber({scale:d.b.Scale.scale(i).scale(0,1).transform}),gradient:z.colorGradient({gradient:r})},outlet:"gradient"}),location:{x:"center",y:"center"}}),x=p=>a(e,p);return o.jsxRuntimeExports.jsx(gs,{id:e,selected:l,onClick:x,onContextMenu:x,style:{height:"5rem",width:u},className:d.CSS(j.CONTEXT_TARGET,l&&j.CONTEXT_SELECTED,d.CSS.BEM("table","cell","value"))})},Dg=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return o.jsxRuntimeExports.jsx(te.Space,{direction:"y",style:{padding:"2rem"},children:o.jsxRuntimeExports.jsx(Go,{path:""})});case"redline":return o.jsxRuntimeExports.jsx(te.Space,{direction:"y",style:{padding:"2rem"},children:o.jsxRuntimeExports.jsx(Og,{})});default:return o.jsxRuntimeExports.jsx(te.Space,{direction:"y",grow:!0,empty:!0,style:{padding:"2rem"},children:o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Jl,{onChange:e,value:"value"})}),o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:r,onChange:i,variant:l,...c})=>o.jsxRuntimeExports.jsx(j.Swatch,{value:r??d.ZERO.setAlpha(1).rgba255,onChange:a=>i(a.rgba255),...c,bordered:!0})}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:r=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...r})})]})})}},[]),n=ke.useStatic({tabs:[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],content:t});return o.jsxRuntimeExports.jsx(ke.Tabs,{...n})},Og=()=>{const{set:e,get:t}=tt(),n=bl("redline.bounds"),s=d.b.Scale.scale(0,1).scale(n);return o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx($t,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Lower",path:"redline.bounds.lower"}),o.jsxRuntimeExports.jsx(ye,{path:"redline.gradient",label:"Gradient",align:"start",padHelpText:!1,children:({value:r,onChange:i})=>o.jsxRuntimeExports.jsx(j.GradientPicker,{value:Z._.copy(r),scale:s,onChange:l=>{const a={...t("redline.bounds").value},u=l.map(E=>E.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(E=>({...E,color:new d.Color(E.color).hex}));m||f?e("redline",{bounds:a,gradient:h}):i(l.map(E=>({...E,color:new d.Color(E.color).hex})))}})}),o.jsxRuntimeExports.jsx($t,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Upper",path:"redline.bounds.upper"})]})},Vg=({onVariantChange:e})=>o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,style:{padding:"2rem"},children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Jl,{onChange:e,value:"text"})}),o.jsxRuntimeExports.jsx(Do,{path:"value",label:"Text"}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"weight",label:"Weight",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ve.SelectWeight,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"align",label:"Alignment",hideIfNull:!0,children:t=>o.jsxRuntimeExports.jsx(ps,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(j.Swatch,{value:t,onChange:n})})]}),Fg=[{key:"text",name:"Text"},{key:"value",name:"Value"}],Jl=({onChange:e,value:t})=>o.jsxRuntimeExports.jsx(ve.Button,{value:t,onChange:e,data:Fg,allowMultiple:!1,entryRenderKey:"name"}),Hg=["text","value"],Zg=ce.z.enum(Hg),Gg={key:"value",name:"Value",Form:Dg,Cell:Bg,defaultProps:e=>({telem:z.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:z.streamChannelValue({channel:0}),rollingAverage:z.rollingAverage({windowSize:1}),stringifier:z.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"}),redline:{bounds:{lower:0,upper:1},gradient:[]},color:e.colors.gray.l8.hex,level:"h5",units:""}),schema:zg},Yg={key:"text",name:"Text",Form:Vg,Cell:$g,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:Ig},Wg={text:Yg,value:Gg},Xg=Object.freeze(Object.defineProperty({__proto__:null,CELLS:Wg,variantZ:Zg},Symbol.toStringTag,{value:"Module"})),Tr=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=gt(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)},Ar=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:i})=>{if(!Kg({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=d.g.construct(t),c=d.g.swap(l);let a=yt(c,s[c]-e[c]);const u=d.Eo.loc(n,a);if(d.K.swap(t)===r){const x=d.Eo.loc(i,d.K.swap(a));Math.abs(u-x)<Ae&&(a=d.K.swap(a))}return{direction:c,length:u-e[c]+wt(a,Ae)}},ao=ce.z.object({direction:d.g.direction,length:ce.z.number()}),gt=(e,...t)=>{let n=e;for(const s of t)n=d.G.translate(n,s.direction,s.length);return n},Ql=(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=yt(l.direction,l.length),a=Ir(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=yt(x.direction,x.length),m=Ir(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[]}},Ae=10,Ir=e=>e==="top"||e==="left"?-1:1,wt=(e,t)=>e==="top"||e==="left"?-t:t,yt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ct=e=>yt(e.direction,e.length),Kg=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=d.g.construct(n),r=t[s]-e[s];return wt(n,r)<0},_n=e=>({direction:d.g.construct(e),length:wt(e,Ae)}),$r={top:_n("top"),bottom:_n("bottom"),left:_n("left"),right:_n("right")},qg=4,Ug=.25,js=e=>uo(Jg(uo(e))),Jg=e=>{const t=[...e],n=e.findIndex((s,r)=>{const i=Math.abs(s.length);if(i<qg){if(r===0||r===e.length-1)return!1;if(i<Ug)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},uo=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=ct(i),u=ct(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)===Ae)return!1;const x=wt(a,Ae),p=t[l].length-x,m=t[c].length+p;return Math.abs(m)<Ae?!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=ct(s),u=ct(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)===Ae)return!1;const x=wt(a,Ae),p=t[l].length-x,m=t[c].length+p;return Math.abs(m)<Ae?!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?uo(t):t},Nt=e=>js(Qg(e)),Qg=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:i})=>{let l=i,c=r,a={...$r[i]},u=gt(n,a);const x={...$r[r]};let p=gt(s,x);const m=Math.abs(u.x-p.x),f=Math.abs(u.y-p.y);m<2*Ae&&f<10&&(a.length-=m/2,x.length+=m/2,u=gt(n,a),p=gt(s,x));const h=[a],E=Ar({sourceStumpTip:u,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});E!=null&&(h.push(E),u=gt(u,E),l=ct(E),a=E);const y=Ar({sourceStumpTip:p,sourceOrientation:c,sourceBox:t,targetStumpTip:u,targetOrientation:l,targetBox:e});y!=null&&(p=gt(p,y),c=yt(y.direction,y.length));const S=()=>{y!=null&&(y.length*=-1,h.push(y)),x.length*=-1,h.push(x)};if(d.K.swap(l)===r){const k=d.g.construct(l),N=(p[k]-u[k])/2;h.push({direction:k,length:N});const T=d.g.swap(k);return h.push({direction:T,length:p[T]-u[T]}),h.push({direction:k,length:N}),S(),h}const _=p[a.direction]-u[a.direction];let w=d.g.swap(a.direction);const R=u[w]-p[w];let b;yt(a.direction,_)===l&&yt(w,R)===c?b={direction:a.direction,length:_}:(b={direction:w,length:p[w]-u[w]},w=d.g.swap(w)),h.push(b);const P={direction:w,length:p[w]-u[w]};return h.push(P),S(),h},e1=e=>js(t1(e)),t1=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],i=d.g.swap(r.direction),l=ct(r);if(t===0){s.unshift({direction:i,length:n});const c=wt(l,Ae);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=wt(l,Ae);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},n1=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},s1=(e,t,n=!1,...s)=>{const r=(i,l)=>!s.includes(l)&&t(i,l);return n?n1(e,r):e.findIndex(r)},o1=({delta:e,segments:t})=>js(ec(e,t,!1)),r1=({delta:e,segments:t})=>js(ec(e,t,!0)),ec=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Br("x",e,s,n)),e.y!==0&&(s=Br("y",e,s,n)),s},zr=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=ct(t),i=ct(s),l=Math.abs(s.length),c=Math.abs(t.length);return(l>c||l>Ae)&&r===i},Br=(e,t,n,s)=>{const r=d.g.swap(e),i=s?n.length-1:0,l=n[i];if(zr(e,l,t)){const p=n[n.length-1];return p.direction===e&&Math.abs(l.length)<Ae?(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=s1(n,p=>p.direction===e,s,i);if(u===c){const p=n[c];return zr(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},i1=ce.z.object({position:d.G.xy,zoom:ce.z.number()}),tc=ce.z.object({color:d.crudeZ,variant:ce.z.string().optional(),segments:ce.z.array(ao)}),l1=tc.extend({key:ce.z.string(),source:ce.z.string(),target:ce.z.string(),segments:ce.z.array(ao),color:d.crudeZ,id:ce.z.string(),data:ce.z.object({segments:ce.z.array(ao),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()}),c1=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()}),Wo=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),Xo=e=>e.map(({segments:t,color:n,variant:s,...r})=>({...r,id:r.key,data:{segments:t,color:n,variant:s}})),nc=e=>e.map(t=>({key:t.id,...t})),sc=(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}}),oc=e=>({...e.position,zoom:e.zoom}),rc=e=>({position:d.G.construct(e),zoom:e.zoom}),ic=(e,t)=>nc(t(Wo(e))),Vn=(e,t,n)=>sc(t(Xo(e)),n),a1=(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.Eo.loc(r.box,n)-d.Eo.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.Eo.topLeft(r.box),p);r.box=d.Eo.construct(m,d.Eo.dims(r.box))}),e};function Me(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=Me(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var u1={value:()=>{}};function Es(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new Fn(n)}function Fn(e){this._=e}function d1(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}})}Fn.prototype=Es.prototype={constructor:Fn,on:function(e,t){var n=this._,s=d1(e+"",n),r,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((r=(e=s[i]).type)&&(r=x1(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]=Dr(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Dr(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 Fn(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 x1(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function Dr(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=u1,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var xo="http://www.w3.org/1999/xhtml";const Or={svg:"http://www.w3.org/2000/svg",xhtml:xo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ys(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Or.hasOwnProperty(t)?{space:Or[t],local:e}:e}function p1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===xo&&t.documentElement.namespaceURI===xo?t.createElement(e):t.createElementNS(n,e)}}function m1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function lc(e){var t=ys(e);return(t.local?m1:p1)(t)}function f1(){}function Ko(e){return e==null?f1:function(){return this.querySelector(e)}}function h1(e){typeof e!="function"&&(e=Ko(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 g1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function j1(){return[]}function cc(e){return e==null?j1:function(){return this.querySelectorAll(e)}}function E1(e){return function(){return g1(e.apply(this,arguments))}}function y1(e){typeof e=="function"?e=E1(e):e=cc(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 ac(e){return function(){return this.matches(e)}}function uc(e){return function(t){return t.matches(e)}}var S1=Array.prototype.find;function R1(e){return function(){return S1.call(this.children,e)}}function C1(){return this.firstElementChild}function w1(e){return this.select(e==null?C1:R1(typeof e=="function"?e:uc(e)))}var b1=Array.prototype.filter;function v1(){return Array.from(this.children)}function k1(e){return function(){return b1.call(this.children,e)}}function _1(e){return this.selectAll(e==null?v1:k1(typeof e=="function"?e:uc(e)))}function M1(e){typeof e!="function"&&(e=ac(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 dc(e){return new Array(e.length)}function P1(){return new ze(this._enter||this._groups.map(dc),this._parents)}function ns(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ns.prototype={constructor:ns,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function L1(e){return function(){return e}}function N1(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 ns(e,i[l]);for(;l<a;++l)(c=t[l])&&(r[l]=c)}function T1(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 ns(e,i[c]);for(c=0;c<x;++c)(a=t[c])&&u.get(m[c])===a&&(r[c]=a)}function A1(e){return e.__data__}function I1(e,t){if(!arguments.length)return Array.from(this,A1);var n=t?T1:N1,s=this._parents,r=this._groups;typeof e!="function"&&(e=L1(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=$1(e.call(x,x&&x.__data__,u,s)),h=f.length,E=c[u]=new Array(h),y=l[u]=new Array(h),S=a[u]=new Array(m);n(x,p,E,y,S,f,t);for(var _=0,w=0,R,b;_<h;++_)if(R=E[_]){for(_>=w&&(w=_+1);!(b=y[w])&&++w<h;);R._next=b||null}}return l=new ze(l,s),l._enter=c,l._exit=a,l}function $1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function z1(){return new ze(this._exit||this._groups.map(dc),this._parents)}function B1(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 D1(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 O1(){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 V1(e){e||(e=F1);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 F1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function H1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Z1(){return Array.from(this)}function G1(){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 Y1(){let e=0;for(const t of this)++e;return e}function W1(){return!this.node()}function X1(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 K1(e){return function(){this.removeAttribute(e)}}function q1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function U1(e,t){return function(){this.setAttribute(e,t)}}function J1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Q1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function e0(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 t0(e,t){var n=ys(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?q1:K1:typeof t=="function"?n.local?e0:Q1:n.local?J1:U1)(n,t))}function xc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function n0(e){return function(){this.style.removeProperty(e)}}function s0(e,t,n){return function(){this.style.setProperty(e,t,n)}}function o0(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function r0(e,t,n){return arguments.length>1?this.each((t==null?n0:typeof t=="function"?o0:s0)(e,t,n??"")):Bt(this.node(),e)}function Bt(e,t){return e.style.getPropertyValue(t)||xc(e).getComputedStyle(e,null).getPropertyValue(t)}function i0(e){return function(){delete this[e]}}function l0(e,t){return function(){this[e]=t}}function c0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function a0(e,t){return arguments.length>1?this.each((t==null?i0:typeof t=="function"?c0:l0)(e,t)):this.node()[e]}function pc(e){return e.trim().split(/^|\s+/)}function qo(e){return e.classList||new mc(e)}function mc(e){this._node=e,this._names=pc(e.getAttribute("class")||"")}mc.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 fc(e,t){for(var n=qo(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function hc(e,t){for(var n=qo(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function u0(e){return function(){fc(this,e)}}function d0(e){return function(){hc(this,e)}}function x0(e,t){return function(){(t.apply(this,arguments)?fc:hc)(this,e)}}function p0(e,t){var n=pc(e+"");if(arguments.length<2){for(var s=qo(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?x0:t?u0:d0)(n,t))}function m0(){this.textContent=""}function f0(e){return function(){this.textContent=e}}function h0(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function g0(e){return arguments.length?this.each(e==null?m0:(typeof e=="function"?h0:f0)(e)):this.node().textContent}function j0(){this.innerHTML=""}function E0(e){return function(){this.innerHTML=e}}function y0(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function S0(e){return arguments.length?this.each(e==null?j0:(typeof e=="function"?y0:E0)(e)):this.node().innerHTML}function R0(){this.nextSibling&&this.parentNode.appendChild(this)}function C0(){return this.each(R0)}function w0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function b0(){return this.each(w0)}function v0(e){var t=typeof e=="function"?e:lc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function k0(){return null}function _0(e,t){var n=typeof e=="function"?e:lc(e),s=t==null?k0:typeof t=="function"?t:Ko(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function M0(){var e=this.parentNode;e&&e.removeChild(this)}function P0(){return this.each(M0)}function L0(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function N0(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function T0(e){return this.select(e?N0:L0)}function A0(e){return arguments.length?this.property("__data__",e):this.node().__data__}function I0(e){return function(t){e.call(this,t,this.__data__)}}function $0(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 z0(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 B0(e,t,n){return function(){var s=this.__on,r,i=I0(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 D0(e,t,n){var s=$0(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?B0:z0,r=0;r<i;++r)this.each(c(s[r],t,n));return this}function gc(e,t,n){var s=xc(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 O0(e,t){return function(){return gc(this,e,t)}}function V0(e,t){return function(){return gc(this,e,t.apply(this,arguments))}}function F0(e,t){return this.each((typeof t=="function"?V0:O0)(e,t))}function*H0(){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 jc=[null];function ze(e,t){this._groups=e,this._parents=t}function Sn(){return new ze([[document.documentElement]],jc)}function Z0(){return this}ze.prototype=Sn.prototype={constructor:ze,select:h1,selectAll:y1,selectChild:w1,selectChildren:_1,filter:M1,data:I1,enter:P1,exit:z1,join:B1,merge:D1,selection:Z0,order:O1,sort:V1,call:H1,nodes:Z1,node:G1,size:Y1,empty:W1,each:X1,attr:t0,style:r0,property:a0,classed:p0,text:g0,html:S0,raise:C0,lower:b0,append:v0,insert:_0,remove:P0,clone:T0,datum:A0,on:D0,dispatch:F0,[Symbol.iterator]:H0};function $e(e){return typeof e=="string"?new ze([[document.querySelector(e)]],[document.documentElement]):new ze([[e]],jc)}function G0(e){let t;for(;t=e.sourceEvent;)e=t;return e}function De(e,t){if(e=G0(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 Y0={passive:!1},xn={capture:!0,passive:!1};function Gs(e){e.stopImmediatePropagation()}function It(e){e.preventDefault(),e.stopImmediatePropagation()}function Ec(e){var t=e.document.documentElement,n=$e(e).on("dragstart.drag",It,xn);"onselectstart"in t?n.on("selectstart.drag",It,xn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function yc(e,t){var n=e.document.documentElement,s=$e(e).on("dragstart.drag",null);t&&(s.on("click.drag",It,xn),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Mn=e=>()=>e;function po(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}})}po.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function W0(e){return!e.ctrlKey&&!e.button}function X0(){return this.parentNode}function K0(e,t){return t??{x:e.x,y:e.y}}function q0(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sc(){var e=W0,t=X0,n=K0,s=q0,r={},i=Es("start","drag","end"),l=0,c,a,u,x,p=0;function m(R){R.on("mousedown.drag",f).filter(s).on("touchstart.drag",y).on("touchmove.drag",S,Y0).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(R,b){if(!(x||!e.call(this,R,b))){var P=w(this,t.call(this,R,b),R,b,"mouse");P&&($e(R.view).on("mousemove.drag",h,xn).on("mouseup.drag",E,xn),Ec(R.view),Gs(R),u=!1,c=R.clientX,a=R.clientY,P("start",R))}}function h(R){if(It(R),!u){var b=R.clientX-c,P=R.clientY-a;u=b*b+P*P>p}r.mouse("drag",R)}function E(R){$e(R.view).on("mousemove.drag mouseup.drag",null),yc(R.view,u),It(R),r.mouse("end",R)}function y(R,b){if(e.call(this,R,b)){var P=R.changedTouches,k=t.call(this,R,b),N=P.length,T,I;for(T=0;T<N;++T)(I=w(this,k,R,b,P[T].identifier,P[T]))&&(Gs(R),I("start",R,P[T]))}}function S(R){var b=R.changedTouches,P=b.length,k,N;for(k=0;k<P;++k)(N=r[b[k].identifier])&&(It(R),N("drag",R,b[k]))}function _(R){var b=R.changedTouches,P=b.length,k,N;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),k=0;k<P;++k)(N=r[b[k].identifier])&&(Gs(R),N("end",R,b[k]))}function w(R,b,P,k,N,T){var I=i.copy(),F=De(T||P,b),$,B,C;if((C=n.call(R,new po("beforestart",{sourceEvent:P,target:m,identifier:N,active:l,x:F[0],y:F[1],dx:0,dy:0,dispatch:I}),k))!=null)return $=C.x-F[0]||0,B=C.y-F[1]||0,function A(M,D,L){var V=F,H;switch(M){case"start":r[N]=A,H=l++;break;case"end":delete r[N],--l;case"drag":F=De(L||D,b),H=l;break}I.call(M,R,new po(M,{sourceEvent:D,subject:C,target:m,identifier:N,active:H,x:F[0]+$,y:F[1]+B,dx:F[0]-V[0],dy:F[1]-V[1],dispatch:I}),k)}}return m.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Mn(!!R),m):e},m.container=function(R){return arguments.length?(t=typeof R=="function"?R:Mn(R),m):t},m.subject=function(R){return arguments.length?(n=typeof R=="function"?R:Mn(R),m):n},m.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Mn(!!R),m):s},m.on=function(){var R=i.on.apply(i,arguments);return R===i?m:R},m.clickDistance=function(R){return arguments.length?(p=(R=+R)*R,m):Math.sqrt(p)},m}var Dt=0,nn=0,en=0,Rc=1e3,ss,sn,os=0,bt=0,Ss=0,pn=typeof performance=="object"&&performance.now?performance:Date,Cc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Uo(){return bt||(Cc(U0),bt=pn.now()+Ss)}function U0(){bt=0}function rs(){this._call=this._time=this._next=null}rs.prototype=wc.prototype={constructor:rs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Uo():+n)+(t==null?0:+t),!this._next&&sn!==this&&(sn?sn._next=this:ss=this,sn=this),this._call=e,this._time=n,mo()},stop:function(){this._call&&(this._call=null,this._time=1/0,mo())}};function wc(e,t,n){var s=new rs;return s.restart(e,t,n),s}function J0(){Uo(),++Dt;for(var e=ss,t;e;)(t=bt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Dt}function Vr(){bt=(os=pn.now())+Ss,Dt=nn=0;try{J0()}finally{Dt=0,e2(),bt=0}}function Q0(){var e=pn.now(),t=e-os;t>Rc&&(Ss-=t,os=e)}function e2(){for(var e,t=ss,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ss=n);sn=e,mo(s)}function mo(e){if(!Dt){nn&&(nn=clearTimeout(nn));var t=e-bt;t>24?(e<1/0&&(nn=setTimeout(Vr,e-pn.now()-Ss)),en&&(en=clearInterval(en))):(en||(os=pn.now(),en=setInterval(Q0,Rc)),Dt=1,Cc(Vr))}}function Fr(e,t,n){var s=new rs;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var t2=Es("start","end","cancel","interrupt"),n2=[],bc=0,Hr=1,fo=2,Hn=3,Zr=4,ho=5,Zn=6;function Rs(e,t,n,s,r,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;s2(e,n,{name:t,index:s,group:r,on:t2,tween:n2,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:bc})}function Jo(e,t){var n=He(e,t);if(n.state>bc)throw new Error("too late; already scheduled");return n}function Ke(e,t){var n=He(e,t);if(n.state>Hn)throw new Error("too late; already running");return n}function He(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function s2(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=wc(i,0,n.time);function i(u){n.state=Hr,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!==Hr)return a();for(x in s)if(f=s[x],f.name===n.name){if(f.state===Hn)return Fr(l);f.state===Zr?(f.state=Zn,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete s[x]):+x<t&&(f.state=Zn,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete s[x])}if(Fr(function(){n.state===Hn&&(n.state=Zr,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=fo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===fo){for(n.state=Hn,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=ho,1),p=-1,m=r.length;++p<m;)r[p].call(e,x);n.state===ho&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Zn,n.timer.stop(),delete s[t];for(var u in s)return;delete e.__transition}}function Gn(e,t){var n=e.__transition,s,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>fo&&s.state<ho,s.state=Zn,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function o2(e){return this.each(function(){Gn(this,e)})}function r2(e,t){var n,s;return function(){var r=Ke(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 i2(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=Ke(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 l2(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=He(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?r2:i2)(n,e,t))}function Qo(e,t,n){var s=e._id;return e.each(function(){var r=Ke(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return He(r,s).value[t]}}function vc(e,t){var n;return(typeof t=="number"?z.interpolateNumber:t instanceof z.color?z.interpolateRgb:(n=z.color(t))?(t=n,z.interpolateRgb):z.interpolateString)(e,t)}function c2(e){return function(){this.removeAttribute(e)}}function a2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function u2(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 d2(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 x2(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 p2(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 m2(e,t){var n=ys(e),s=n==="transform"?Qm:vc;return this.attrTween(e,typeof t=="function"?(n.local?p2:x2)(n,s,Qo(this,"attr."+e,t)):t==null?(n.local?a2:c2)(n):(n.local?d2:u2)(n,s,t))}function f2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function h2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function g2(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&h2(e,i)),n}return r._value=t,r}function j2(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&f2(e,i)),n}return r._value=t,r}function E2(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=ys(e);return this.tween(n,(s.local?g2:j2)(s,t))}function y2(e,t){return function(){Jo(this,e).delay=+t.apply(this,arguments)}}function S2(e,t){return t=+t,function(){Jo(this,e).delay=t}}function R2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?y2:S2)(t,e)):He(this.node(),t).delay}function C2(e,t){return function(){Ke(this,e).duration=+t.apply(this,arguments)}}function w2(e,t){return t=+t,function(){Ke(this,e).duration=t}}function b2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?C2:w2)(t,e)):He(this.node(),t).duration}function v2(e,t){if(typeof t!="function")throw new Error;return function(){Ke(this,e).ease=t}}function k2(e){var t=this._id;return arguments.length?this.each(v2(t,e)):He(this.node(),t).ease}function _2(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ke(this,e).ease=n}}function M2(e){if(typeof e!="function")throw new Error;return this.each(_2(this._id,e))}function P2(e){typeof e!="function"&&(e=ac(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 et(s,this._parents,this._name,this._id)}function L2(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 et(l,this._parents,this._name,this._id)}function N2(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 T2(e,t,n){var s,r,i=N2(t)?Jo:Ke;return function(){var l=i(this,e),c=l.on;c!==s&&(r=(s=c).copy()).on(t,n),l.on=r}}function A2(e,t){var n=this._id;return arguments.length<2?He(this.node(),n).on.on(e):this.each(T2(n,e,t))}function I2(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $2(){return this.on("end.remove",I2(this._id))}function z2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ko(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,Rs(u[m],t,n,m,u,He(x,n)));return new et(i,this._parents,t,n)}function B2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=cc(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=He(x,n),E=0,y=m.length;E<y;++E)(f=m[E])&&Rs(f,t,n,E,m,h);i.push(m),l.push(x)}return new et(i,l,t,n)}var D2=Sn.prototype.constructor;function O2(){return new D2(this._groups,this._parents)}function V2(e,t){var n,s,r;return function(){var i=Bt(this,e),l=(this.style.removeProperty(e),Bt(this,e));return i===l?null:i===n&&l===s?r:r=t(n=i,s=l)}}function kc(e){return function(){this.style.removeProperty(e)}}function F2(e,t,n){var s,r=n+"",i;return function(){var l=Bt(this,e);return l===r?null:l===s?i:i=t(s=l,n)}}function H2(e,t,n){var s,r,i;return function(){var l=Bt(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),Bt(this,e))),l===a?null:l===s&&a===r?i:(r=a,i=t(s=l,c))}}function Z2(e,t){var n,s,r,i="style."+t,l="end."+i,c;return function(){var a=Ke(this,e),u=a.on,x=a.value[i]==null?c||(c=kc(t)):void 0;(u!==n||r!==x)&&(s=(n=u).copy()).on(l,r=x),a.on=s}}function G2(e,t,n){var s=(e+="")=="transform"?Jm:vc;return t==null?this.styleTween(e,V2(e,s)).on("end.style."+e,kc(e)):typeof t=="function"?this.styleTween(e,H2(e,s,Qo(this,"style."+e,t))).each(Z2(this._id,e)):this.styleTween(e,F2(e,s,t),n).on("end.style."+e,null)}function Y2(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function W2(e,t,n){var s,r;function i(){var l=t.apply(this,arguments);return l!==r&&(s=(r=l)&&Y2(e,l,n)),s}return i._value=t,i}function X2(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,W2(e,t,n??""))}function K2(e){return function(){this.textContent=e}}function q2(e){return function(){var t=e(this);this.textContent=t??""}}function U2(e){return this.tween("text",typeof e=="function"?q2(Qo(this,"text",e)):K2(e==null?"":e+""))}function J2(e){return function(t){this.textContent=e.call(this,t)}}function Q2(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&J2(r)),t}return s._value=e,s}function ej(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Q2(e))}function tj(){for(var e=this._name,t=this._id,n=_c(),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=He(a,t);Rs(a,e,n,u,l,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new et(s,this._parents,e,n)}function nj(){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=Ke(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 sj=0;function et(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function _c(){return++sj}var Ue=Sn.prototype;et.prototype={constructor:et,select:z2,selectAll:B2,selectChild:Ue.selectChild,selectChildren:Ue.selectChildren,filter:P2,merge:L2,selection:O2,transition:tj,call:Ue.call,nodes:Ue.nodes,node:Ue.node,size:Ue.size,empty:Ue.empty,each:Ue.each,on:A2,attr:m2,attrTween:E2,style:G2,styleTween:X2,text:U2,textTween:ej,remove:$2,tween:l2,delay:R2,duration:b2,ease:k2,easeVarying:M2,end:nj,[Symbol.iterator]:Ue[Symbol.iterator]};function oj(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var rj={time:null,delay:0,duration:250,ease:oj};function ij(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function lj(e){var t,n;e instanceof et?(t=e._id,e=e._name):(t=_c(),(n=rj).time=Uo(),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])&&Rs(a,e,t,u,l,n||ij(a,t));return new et(s,this._parents,e,t)}Sn.prototype.interrupt=o2;Sn.prototype.transition=lj;const Pn=e=>()=>e;function cj(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 Je(e,t,n){this.k=e,this.x=t,this.y=n}Je.prototype={constructor:Je,scale:function(e){return e===1?this:new Je(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Je(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 Cs=new Je(1,0,0);Mc.prototype=Je.prototype;function Mc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Cs;return e.__zoom}function Ys(e){e.stopImmediatePropagation()}function tn(e){e.preventDefault(),e.stopImmediatePropagation()}function aj(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uj(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Gr(){return this.__zoom||Cs}function dj(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function xj(){return navigator.maxTouchPoints||"ontouchstart"in this}function pj(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 Pc(){var e=aj,t=uj,n=pj,s=dj,r=xj,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=sf,u=Es("start","zoom","end"),x,p,m,f=500,h=150,E=0,y=10;function S(C){C.property("__zoom",Gr).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",I).filter(r).on("touchstart.zoom",F).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(C,A,M,D){var L=C.selection?C.selection():C;L.property("__zoom",Gr),C!==L?b(C,A,M,D):L.interrupt().each(function(){P(this,arguments).event(D).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},S.scaleBy=function(C,A,M,D){S.scaleTo(C,function(){var L=this.__zoom.k,V=typeof A=="function"?A.apply(this,arguments):A;return L*V},M,D)},S.scaleTo=function(C,A,M,D){S.transform(C,function(){var L=t.apply(this,arguments),V=this.__zoom,H=M==null?R(L):typeof M=="function"?M.apply(this,arguments):M,G=V.invert(H),q=typeof A=="function"?A.apply(this,arguments):A;return n(w(_(V,q),H,G),L,l)},M,D)},S.translateBy=function(C,A,M,D){S.transform(C,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),l)},null,D)},S.translateTo=function(C,A,M,D,L){S.transform(C,function(){var V=t.apply(this,arguments),H=this.__zoom,G=D==null?R(V):typeof D=="function"?D.apply(this,arguments):D;return n(Cs.translate(G[0],G[1]).scale(H.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof M=="function"?-M.apply(this,arguments):-M),V,l)},D,L)};function _(C,A){return A=Math.max(i[0],Math.min(i[1],A)),A===C.k?C:new Je(A,C.x,C.y)}function w(C,A,M){var D=A[0]-M[0]*C.k,L=A[1]-M[1]*C.k;return D===C.x&&L===C.y?C:new Je(C.k,D,L)}function R(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function b(C,A,M,D){C.on("start.zoom",function(){P(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(D).end()}).tween("zoom",function(){var L=this,V=arguments,H=P(L,V).event(D),G=t.apply(L,V),q=M==null?R(G):typeof M=="function"?M.apply(L,V):M,oe=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),ee=L.__zoom,ne=typeof A=="function"?A.apply(L,V):A,se=a(ee.invert(q).concat(oe/ee.k),ne.invert(q).concat(oe/ne.k));return function(ie){if(ie===1)ie=ne;else{var U=se(ie),ue=oe/U[2];ie=new Je(ue,q[0]-U[0]*ue,q[1]-U[1]*ue)}H.zoom(null,ie)}})}function P(C,A,M){return!M&&C.__zooming||new k(C,A)}function k(C,A){this.that=C,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,A),this.taps=0}k.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,A){return this.mouse&&C!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var A=$e(this.that).datum();u.call(C,this.that,new cj(C,{sourceEvent:this.sourceEvent,target:S,type:C,transform:this.that.__zoom,dispatch:u}),A)}};function N(C,...A){if(!e.apply(this,arguments))return;var M=P(this,A).event(C),D=this.__zoom,L=Math.max(i[0],Math.min(i[1],D.k*Math.pow(2,s.apply(this,arguments)))),V=De(C);if(M.wheel)(M.mouse[0][0]!==V[0]||M.mouse[0][1]!==V[1])&&(M.mouse[1]=D.invert(M.mouse[0]=V)),clearTimeout(M.wheel);else{if(D.k===L)return;M.mouse=[V,D.invert(V)],Gn(this),M.start()}tn(C),M.wheel=setTimeout(H,h),M.zoom("mouse",n(w(_(D,L),M.mouse[0],M.mouse[1]),M.extent,l));function H(){M.wheel=null,M.end()}}function T(C,...A){if(m||!e.apply(this,arguments))return;var M=C.currentTarget,D=P(this,A,!0).event(C),L=$e(C.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",oe,!0),V=De(C,M),H=C.clientX,G=C.clientY;Ec(C.view),Ys(C),D.mouse=[V,this.__zoom.invert(V)],Gn(this),D.start();function q(ee){if(tn(ee),!D.moved){var ne=ee.clientX-H,se=ee.clientY-G;D.moved=ne*ne+se*se>E}D.event(ee).zoom("mouse",n(w(D.that.__zoom,D.mouse[0]=De(ee,M),D.mouse[1]),D.extent,l))}function oe(ee){L.on("mousemove.zoom mouseup.zoom",null),yc(ee.view,D.moved),tn(ee),D.event(ee).end()}}function I(C,...A){if(e.apply(this,arguments)){var M=this.__zoom,D=De(C.changedTouches?C.changedTouches[0]:C,this),L=M.invert(D),V=M.k*(C.shiftKey?.5:2),H=n(w(_(M,V),D,L),t.apply(this,A),l);tn(C),c>0?$e(this).transition().duration(c).call(b,H,D,C):$e(this).call(S.transform,H,D,C)}}function F(C,...A){if(e.apply(this,arguments)){var M=C.touches,D=M.length,L=P(this,A,C.changedTouches.length===D).event(C),V,H,G,q;for(Ys(C),H=0;H<D;++H)G=M[H],q=De(G,this),q=[q,this.__zoom.invert(q),G.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,V=!0,L.taps=1+!!x);x&&(x=clearTimeout(x)),V&&(L.taps<2&&(p=q[0],x=setTimeout(function(){x=null},f)),Gn(this),L.start())}}function $(C,...A){if(this.__zooming){var M=P(this,A).event(C),D=C.changedTouches,L=D.length,V,H,G,q;for(tn(C),V=0;V<L;++V)H=D[V],G=De(H,this),M.touch0&&M.touch0[2]===H.identifier?M.touch0[0]=G:M.touch1&&M.touch1[2]===H.identifier&&(M.touch1[0]=G);if(H=M.that.__zoom,M.touch1){var oe=M.touch0[0],ee=M.touch0[1],ne=M.touch1[0],se=M.touch1[1],ie=(ie=ne[0]-oe[0])*ie+(ie=ne[1]-oe[1])*ie,U=(U=se[0]-ee[0])*U+(U=se[1]-ee[1])*U;H=_(H,Math.sqrt(ie/U)),G=[(oe[0]+ne[0])/2,(oe[1]+ne[1])/2],q=[(ee[0]+se[0])/2,(ee[1]+se[1])/2]}else if(M.touch0)G=M.touch0[0],q=M.touch0[1];else return;M.zoom("touch",n(w(H,G,q),M.extent,l))}}function B(C,...A){if(this.__zooming){var M=P(this,A).event(C),D=C.changedTouches,L=D.length,V,H;for(Ys(C),m&&clearTimeout(m),m=setTimeout(function(){m=null},f),V=0;V<L;++V)H=D[V],M.touch0&&M.touch0[2]===H.identifier?delete M.touch0:M.touch1&&M.touch1[2]===H.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(H=De(H,this),Math.hypot(p[0]-H[0],p[1]-H[1])<y)){var G=$e(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return S.wheelDelta=function(C){return arguments.length?(s=typeof C=="function"?C:Pn(+C),S):s},S.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Pn(!!C),S):e},S.touchable=function(C){return arguments.length?(r=typeof C=="function"?C:Pn(!!C),S):r},S.extent=function(C){return arguments.length?(t=typeof C=="function"?C:Pn([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),S):t},S.scaleExtent=function(C){return arguments.length?(i[0]=+C[0],i[1]=+C[1],S):[i[0],i[1]]},S.translateExtent=function(C){return arguments.length?(l[0][0]=+C[0][0],l[1][0]=+C[1][0],l[0][1]=+C[0][1],l[1][1]=+C[1][1],S):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},S.constrain=function(C){return arguments.length?(n=C,S):n},S.duration=function(C){return arguments.length?(c=+C,S):c},S.interpolate=function(C){return arguments.length?(a=C,S):a},S.on=function(){var C=u.on.apply(u,arguments);return C===u?S:C},S.clickDistance=function(C){return arguments.length?(E=(C=+C)*C,S):Math.sqrt(E)},S.tapDistance=function(C){return arguments.length?(y=+C,S):y},S}const Ie={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.`},mn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Lc=["Enter"," ","Escape"];var vt;(function(e){e.Strict="strict",e.Loose="loose"})(vt||(vt={}));var St;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(St||(St={}));var Ot;(function(e){e.Partial="partial",e.Full="full"})(Ot||(Ot={}));const Nc={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var lt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(lt||(lt={}));var is;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(is||(is={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));const Yr={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top};function Tc(e){return e===null?null:e?"valid":"invalid"}const Ac=e=>"id"in e&&"source"in e&&"target"in e,mj=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),er=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Rn=(e,t=[0,0])=>{const{width:n,height:s}=st(e),r=e.origin??t,i=n*r[0],l=s*r[1];return{x:e.position.x-i,y:e.position.y-l}},fj=(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):er(r)?r:t.nodeLookup.get(r.id));const c=l?ls(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ws(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return bs(n)},Cn=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(s=>{if(t.filter===void 0||t.filter(s)){const r=ls(s);n=ws(n,r)}}),bs(n)},Ic=(e,t,[n,s,r]=[0,0,1],i=!1,l=!1)=>{const c={...wn(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,E=fn(c,Ft(u)),y=(f??0)*(h??0),S=i&&E>0;(!u.internals.handleBounds||S||E>=y||u.dragging)&&a.push(u)}return a},hj=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function go(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(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 jo({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},l){if(e.size===0)return Promise.resolve(!1);const c=Cn(e),a=tr(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 $c({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",Ie.error005());else{const f=c.measured.width,h=c.measured.height;f&&h&&(p=[[a,u],[a+f,u+h]])}else c&&Ht(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=Ht(p)?kt(t,p,l.measured):t;return{position:{x:m.x-a+l.measured.width*x[0],y:m.y-u+l.measured.height*x[1]},positionAbsolute:m}}async function gj({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(E=>E.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=hj(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 Vt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),kt=(e={x:0,y:0},t,n)=>({x:Vt(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Vt(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function zc(e,t,n){const{width:s,height:r}=st(n),{x:i,y:l}=n.internals.positionAbsolute;return kt(e,[[i,l],[i+s,l+r]],t)}const Wr=(e,t,n)=>e<t?Vt(Math.abs(e-t),1,t)/t:e>n?-Vt(Math.abs(e-n),1,t)/t:0,Bc=(e,t,n=15,s=40)=>{const r=Wr(e.x,s,t.width-s)*n,i=Wr(e.y,s,t.height-s)*n;return[r,i]},ws=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Eo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),bs=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Ft=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=er(e)?e.internals.positionAbsolute:Rn(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}},ls=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=er(e)?e.internals.positionAbsolute:Rn(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)}},Dc=(e,t)=>bs(ws(Eo(e),Eo(t))),fn=(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)},Xr=e=>Oe(e.width)&&Oe(e.height)&&Oe(e.x)&&Oe(e.y),Oe=e=>!isNaN(e)&&isFinite(e),cs=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},vs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),wn=({x:e,y:t},[n,s,r],i=!1,l=[1,1])=>{const c={x:(e-n)/r,y:(t-s)/r};return i?vs(c,l):c},Oc=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s}),tr=(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=Vt(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}},as=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ht(e){return e!==void 0&&e!=="parent"}function st(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 Vc(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 Fc(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 rn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:l}=Qe(e),c=wn({x:i-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)},s),{x:a,y:u}=n?vs(c,t):c;return{xSnapped:a,ySnapped:u,...c}}const ks=e=>({width:e.offsetWidth,height:e.offsetHeight}),Hc=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},jj=["INPUT","SELECT","TEXTAREA"];function yo(e){var s,r,i;const t=((r=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:r[0])||e.target;return jj.includes(t==null?void 0:t.nodeName)||((i=t==null?void 0:t.hasAttribute)==null?void 0:i.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const Zc=e=>"clientX"in e,Qe=(e,t)=>{var i,l;const n=Zc(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)}},Kr=(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,...ks(l)}})};function Gc({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 Ln(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function qr({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case K.Left:return[t-Ln(t-s,i),n];case K.Right:return[t+Ln(s-t,i),n];case K.Top:return[t,n-Ln(n-r,i)];case K.Bottom:return[t,n+Ln(r-n,i)]}}function Yc({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:s,targetY:r,targetPosition:i=K.Top,curvature:l=.25}){const[c,a]=qr({pos:n,x1:e,y1:t,x2:s,y2:r,c:l}),[u,x]=qr({pos:i,x1:s,y1:r,x2:e,y2:t,c:l}),[p,m,f,h]=Gc({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 Wc({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 Ej({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 yj({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=ws(ls(e),ls(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 fn(l,bs(i))>0}const Xc=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,Sj=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Kc=(e,t)=>{if(!e.source||!e.target)return cs("006",Ie.error006()),t;let n;return Ac(e)?n={...e}:n={...e,id:Xc(e)},Sj(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},Rj=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...i}=e;if(!t.source||!t.target)return cs("006",Ie.error006()),n;if(!n.find(a=>a.id===e.id))return cs("007",Ie.error007(r)),n;const c={...i,id:s.shouldReplaceId?Xc(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==r).concat(c)};function qc({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,l,c]=Wc({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,l,c]}const Ur={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},Cj=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.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},Jr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wj({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:s=K.Top,center:r,offset:i}){const l=Ur[t],c=Ur[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=Cj({source:a,sourcePosition:t,target:u}),p=x.x!==0?"x":"y",m=x[p];let f=[],h,E;const y={x:0,y:0},S={x:0,y:0},[_,w,R,b]=Wc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*c[p]===-1){h=r.x??_,E=r.y??w;const k=[{x:h,y:a.y},{x:h,y:u.y}],N=[{x:a.x,y:E},{x:u.x,y:E}];l[p]===m?f=p==="x"?k:N:f=p==="x"?N:k}else{const k=[{x:a.x,y:u.y}],N=[{x:u.x,y:a.y}];if(p==="x"?f=l.x===m?N:k:f=l.y===m?k:N,t===s){const B=Math.abs(e[p]-n[p]);if(B<=i){const C=Math.min(i-1,i-B);l[p]===m?y[p]=(a[p]>e[p]?-1:1)*C:S[p]=(u[p]>n[p]?-1:1)*C}}if(t!==s){const B=p==="x"?"y":"x",C=l[p]===c[B],A=a[B]>u[B],M=a[B]<u[B];(l[p]===1&&(!C&&A||C&&M)||l[p]!==1&&(!C&&M||C&&A))&&(f=p==="x"?k:N)}const T={x:a.x+y.x,y:a.y+y.y},I={x:u.x+S.x,y:u.y+S.y},F=Math.max(Math.abs(T.x-f[0].x),Math.abs(I.x-f[0].x)),$=Math.max(Math.abs(T.y-f[0].y),Math.abs(I.y-f[0].y));F>=$?(h=(T.x+I.x)/2,E=f[0].y):(h=f[0].x,E=(T.y+I.y)/2)}return[[e,{x:a.x+y.x,y:a.y+y.y},...f,{x:u.x+S.x,y:u.y+S.y},n],h,E,R,b]}function bj(e,t,n,s){const r=Math.min(Jr(e,t)/2,Jr(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 So({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:s,targetY:r,targetPosition:i=K.Top,borderRadius:l=5,centerX:c,centerY:a,offset:u=20}){const[x,p,m,f,h]=wj({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:c,y:a},offset:u});return[x.reduce((y,S,_)=>{let w="";return _>0&&_<x.length-1?w=bj(x[_-1],S,x[_+1],l):w=`${_===0?"M":"L"}${S.x} ${S.y}`,y+=w,y},""),p,m,f,h]}function Qr(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function vj(e){var p;const{sourceNode:t,targetNode:n}=e;if(!Qr(t)||!Qr(n))return null;const s=t.internals.handleBounds||ei(t.handles),r=n.internals.handleBounds||ei(n.handles),i=ti((s==null?void 0:s.source)??[],e.sourceHandle),l=ti(e.connectionMode===vt.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",Ie.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(i==null?void 0:i.position)||K.Bottom,a=(l==null?void 0:l.position)||K.Top,u=hn(t,i,c),x=hn(n,l,a);return{sourceX:u.x,sourceY:u.y,targetX:x.x,targetY:x.y,sourcePosition:c,targetPosition:a}}function ei(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 hn(e,t,n=K.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??st(e);if(s)return{x:r+l/2,y:i+c/2};switch((t==null?void 0:t.position)??n){case K.Top:return{x:r+l/2,y:i};case K.Right:return{x:r+l,y:i+c/2};case K.Bottom:return{x:r+l/2,y:i+c};case K.Left:return{x:r,y:i+c/2}}}function ti(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Ro(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function kj(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=Ro(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:mn,elevateNodesOnSelect:!0,defaults:{}},_j={...nr,checkEquality:!0};function sr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Mj(e,t,n){const s=sr(nr,n);for(const r of e.values())if(r.parentId)or(r,e,t,s);else{const i=Rn(r,s.nodeOrigin),l=Ht(r.extent)?r.extent:s.nodeExtent,c=kt(i,l,st(r));r.internals.positionAbsolute=c}}function Co(e,t,n,s){var c,a;const r=sr(_j,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=Rn(u,r.nodeOrigin),m=Ht(u.extent)?u.extent:r.nodeExtent,f=kt(p,m,st(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:Uc(u,l),userNode:u}},t.set(u.id,x)}u.parentId&&or(x,t,n,s)}}function Pj(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function or(e,t,n,s){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:l}=sr(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}Pj(e,n);const u=r?1e3:0,{x,y:p,z:m}=Lj(e,a,i,l,u),{positionAbsolute:f}=e.internals,h=x!==f.x||p!==f.y;(h||m!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:h?{x,y:p}:f,z:m})}function Uc(e,t){return(Oe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Lj(e,t,n,s,r){const{x:i,y:l}=t.internals.positionAbsolute,c=st(e),a=Rn(e,n),u=Ht(e.extent)?kt(a,e.extent,c):a;let x=kt({x:i+u.x,y:l+u.y},s,c);e.extent==="parent"&&(x=zc(x,c,t));const p=Uc(e,r),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>p?m:p}}function rr(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)??Ft(a),x=Dc(u,c.rect);i.set(c.parentId,{expandedRect:x,parent:a})}return i.size>0&&i.forEach(({expandedRect:c,parent:a},u)=>{var w;const x=a.internals.positionAbsolute,p=st(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,E=Math.max(p.width,Math.round(c.width)),y=Math.max(p.height,Math.round(c.height)),S=(E-p.width)*m[0],_=(y-p.height)*m[1];(f>0||h>0||S||_)&&(r.push({id:u,type:"position",position:{x:a.position.x-f+S,y:a.position.y-h+_}}),(w=n.get(u))==null||w.forEach(R=>{e.some(b=>b.id===R.id)||r.push({id:R.id,type:"position",position:{x:R.position.x+f,y:R.position.y+h}})})),(p.width<c.width||p.height<c.height||f||h)&&r.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:E+(f?m[0]*f-S:0),height:y+(h?m[1]*h-_:0)}})}),r}function Nj(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)if(f.hidden)f.internals={...f.internals,handleBounds:void 0},c=!0;else{const h=ks(m.nodeElement),E=f.measured.width!==h.width||f.measured.height!==h.height;if(!!(h.width&&h.height&&(E||!f.internals.handleBounds||m.force))){const S=m.nodeElement.getBoundingClientRect(),_=Ht(f.extent)?f.extent:i;let{positionAbsolute:w}=f.internals;f.parentId&&f.extent==="parent"?w=zc(w,h,t.get(f.parentId)):_&&(w=kt(w,_,h)),f.measured=h,f.internals={...f.internals,positionAbsolute:w,handleBounds:{source:Kr("source",m.nodeElement,S,x,f.id),target:Kr("target",m.nodeElement,S,x,f.id)}},f.parentId&&or(f,t,n,{nodeOrigin:r}),c=!0,E&&(a.push({id:f.id,type:"dimensions",dimensions:h}),f.expandParent&&f.parentId&&p.push({id:f.id,parentId:f.parentId,rect:Ft(f,r)}))}}}if(p.length>0){const m=rr(p,t,n,r);a.push(...m)}return{changes:a,updatedInternals:c}}async function Tj({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 Jc(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=`${r}-source-${l}`,u=`${i}-target-${c}`,x=e.get(a)||new Map,p=e.get(u)||new Map,m={edgeId:s.id,source:r,target:i,sourceHandle:l,targetHandle:c};t.set(s.id,s),e.set(a,x.set(`${i}-${c}`,m)),e.set(u,p.set(`${r}-${l}`,m))}}function Qc(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Qc(n,t):!1}function ni(e,t,n){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===n)return!1;s=s.parentElement}while(s);return!1}function Aj(e,t,n,s){const r=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!Qc(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 Ws({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 Ij({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:y,handleSelector:S,domNode:_,isSelectable:w,nodeId:R,nodeClickDistance:b=0}){m=$e(_);function P({x:I,y:F},$){const{nodeLookup:B,nodeExtent:C,snapGrid:A,snapToGrid:M,nodeOrigin:D,onNodeDrag:L,onSelectionDrag:V,onError:H,updateNodePositions:G}=t();i={x:I,y:F};let q=!1,oe={x:0,y:0,x2:0,y2:0};if(c.size>1&&C){const ee=Cn(c);oe=Eo(ee)}for(const[ee,ne]of c){if(!B.has(ee))continue;let se={x:I-ne.distance.x,y:F-ne.distance.y};M&&(se=vs(se,A));let ie=[[C[0][0],C[0][1]],[C[1][0],C[1][1]]];if(c.size>1&&C&&!ne.extent){const{positionAbsolute:ge}=ne.internals,pe=ge.x-oe.x+C[0][0],re=ge.x+ne.measured.width-oe.x2+C[1][0],Q=ge.y-oe.y+C[0][1],le=ge.y+ne.measured.height-oe.y2+C[1][1];ie=[[pe,Q],[re,le]]}const{position:U,positionAbsolute:ue}=$c({nodeId:ee,nextPosition:se,nodeLookup:B,nodeExtent:ie,nodeOrigin:D,onError:H});q=q||ne.position.x!==U.x||ne.position.y!==U.y,ne.position=U,ne.internals.positionAbsolute=ue}if(q&&(G(c,!0),$&&(s||L||!R&&V))){const[ee,ne]=Ws({nodeId:R,dragItems:c,nodeLookup:B});s==null||s($,c,ee,ne),L==null||L($,ee,ne),R||V==null||V($,ne)}}async function k(){if(!x)return;const{transform:I,panBy:F,autoPanSpeed:$}=t(),[B,C]=Bc(u,x,$);(B!==0||C!==0)&&(i.x=(i.x??0)-B/I[2],i.y=(i.y??0)-C/I[2],await F({x:B,y:C})&&P(i,null)),l=requestAnimationFrame(k)}function N(I){var q;const{nodeLookup:F,multiSelectionActive:$,nodesDraggable:B,transform:C,snapGrid:A,snapToGrid:M,selectNodesOnDrag:D,onNodeDragStart:L,onSelectionDragStart:V,unselectNodesAndEdges:H}=t();p=!0,(!D||!w)&&!$&&R&&((q=F.get(R))!=null&&q.selected||H()),w&&D&&R&&(e==null||e(R));const G=rn(I.sourceEvent,{transform:C,snapGrid:A,snapToGrid:M,containerBounds:x});if(i=G,c=Aj(F,B,G,R),c.size>0&&(n||L||!R&&V)){const[oe,ee]=Ws({nodeId:R,dragItems:c,nodeLookup:F});n==null||n(I.sourceEvent,c,oe,ee),L==null||L(I.sourceEvent,oe,ee),R||V==null||V(I.sourceEvent,ee)}}const T=Sc().clickDistance(b).on("start",I=>{const{domNode:F,nodeDragThreshold:$,transform:B,snapGrid:C,snapToGrid:A}=t();x=(F==null?void 0:F.getBoundingClientRect())||null,f=!1,$===0&&N(I),i=rn(I.sourceEvent,{transform:B,snapGrid:C,snapToGrid:A,containerBounds:x}),u=Qe(I.sourceEvent,x)}).on("drag",I=>{const{autoPanOnNodeDrag:F,transform:$,snapGrid:B,snapToGrid:C,nodeDragThreshold:A,nodeLookup:M}=t(),D=rn(I.sourceEvent,{transform:$,snapGrid:B,snapToGrid:C,containerBounds:x});if((I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||R&&!M.has(R))&&(f=!0),!f){if(!a&&F&&p&&(a=!0,k()),!p){const L=D.xSnapped-(i.x??0),V=D.ySnapped-(i.y??0);Math.sqrt(L*L+V*V)>A&&N(I)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&c&&p&&(u=Qe(I.sourceEvent,x),P(D,I.sourceEvent))}}).on("end",I=>{if(!(!p||f)&&(a=!1,p=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:F,updateNodePositions:$,onNodeDragStop:B,onSelectionDragStop:C}=t();if($(c,!1),r||B||!R&&C){const[A,M]=Ws({nodeId:R,dragItems:c,nodeLookup:F,dragging:!1});r==null||r(I.sourceEvent,c,A,M),B==null||B(I.sourceEvent,A,M),R||C==null||C(I.sourceEvent,M)}}}).filter(I=>{const F=I.target;return!I.button&&(!y||!ni(F,`.${y}`,_))&&(!S||ni(F,S,_))});m.call(T)}function E(){m==null||m.on(".drag",null)}return{update:h,destroy:E}}function $j(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())fn(r,Ft(i))>0&&s.push(i);return s}const zj=250;function Bj(e,t,n,s){var c,a;let r=[],i=1/0;const l=$j(e,n,t+zj);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}=hn(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 ea(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,...hn(l,a,a.position,!0)}:a}function ta(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Dj(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const na=()=>!0;function Oj(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:E,onConnectEnd:y,isValidConnection:S=na,onReconnectEnd:_,updateConnection:w,getTransform:R,getFromHandle:b,autoPanSpeed:P}){const k=Hc(e.target);let N=0,T;const{x:I,y:F}=Qe(e),$=k==null?void 0:k.elementFromPoint(I,F),B=ta(i,$),C=c==null?void 0:c.getBoundingClientRect();if(!C||!B)return;const A=ea(r,B,s,a,t);if(!A)return;let M=Qe(e,C),D=!1,L=null,V=!1,H=null;function G(){if(!x||!C)return;const[ue,ge]=Bc(M,C,P);m({x:ue,y:ge}),N=requestAnimationFrame(G)}const q={...A,nodeId:r,type:B,position:A.position},oe=a.get(r),ne={inProgress:!0,isValid:null,from:hn(oe,q,K.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:oe,to:M,toHandle:null,toPosition:Yr[q.position],toNode:null};w(ne);let se=ne;h==null||h(e,{nodeId:r,handleId:s,handleType:B});function ie(ue){if(!b()||!q){U(ue);return}const ge=R();M=Qe(ue,C),T=Bj(wn(M,ge,!1,[1,1]),n,a,q),D||(G(),D=!0);const pe=sa(ue,{handle:T,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:l?"target":"source",isValidConnection:S,doc:k,lib:u,flowId:p,nodeLookup:a});H=pe.handleDomNode,L=pe.connection,V=Dj(!!T,pe.isValid);const re={...se,isValid:V,to:T&&V?Oc({x:T.x,y:T.y},ge):M,toHandle:pe.toHandle,toPosition:V&&pe.toHandle?pe.toHandle.position:Yr[q.position],toNode:pe.toHandle?a.get(pe.toHandle.nodeId):null};V&&T&&se.toHandle&&re.toHandle&&se.toHandle.type===re.toHandle.type&&se.toHandle.nodeId===re.toHandle.nodeId&&se.toHandle.id===re.toHandle.id&&se.to.x===re.to.x&&se.to.y===re.to.y||(w(re),se=re)}function U(ue){(T||H)&&L&&V&&(E==null||E(L));const{inProgress:ge,...pe}=se,re={...pe,toPosition:se.toHandle?se.toPosition:null};y==null||y(ue,re),i&&(_==null||_(ue,re)),f(),cancelAnimationFrame(N),D=!1,V=!1,L=null,H=null,k.removeEventListener("mousemove",ie),k.removeEventListener("mouseup",U),k.removeEventListener("touchmove",ie),k.removeEventListener("touchend",U)}k.addEventListener("mousemove",ie),k.addEventListener("mouseup",U),k.addEventListener("touchmove",ie),k.addEventListener("touchend",U)}function sa(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:l,lib:c,flowId:a,isValidConnection:u=na,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}=Qe(e),E=l.elementFromPoint(f,h),y=E!=null&&E.classList.contains(`${c}-flow__handle`)?E:m,S={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const _=ta(void 0,y),w=y.getAttribute("data-nodeid"),R=y.getAttribute("data-handleid"),b=y.classList.contains("connectable"),P=y.classList.contains("connectableend");if(!w||!_)return S;const k={source:p?w:s,sourceHandle:p?R:r,target:p?s:w,targetHandle:p?r:R};S.connection=k;const T=b&&P&&(n===vt.Strict?p&&_==="source"||!p&&_==="target":w!==s||R!==r);S.isValid=T&&u(k),S.toHandle=ea(w,_,R,x,n,!1)}return S}const wo={onPointerDown:Oj,isValid:sa};function Vj({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=$e(e);function i({translateExtent:c,width:a,height:u,zoomStep:x=10,pannable:p=!0,zoomable:m=!0,inversePan:f=!1}){const h=w=>{const R=n();if(w.sourceEvent.type!=="wheel"||!t)return;const b=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*x,P=R[2]*Math.pow(2,b);t.scaleTo(P)};let E=[0,0];const y=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(E=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},S=w=>{const R=n();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!t)return;const b=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],P=[b[0]-E[0],b[1]-E[1]];E=b;const k=s()*Math.max(R[2],Math.log(R[2]))*(f?-1:1),N={x:R[0]-P[0]*k,y:R[1]-P[1]*k},T=[[0,0],[a,u]];t.setViewportConstrained({x:N.x,y:N.y,zoom:R[2]},T,c)},_=Pc().on("start",y).on("zoom",p?S:null).on("zoom.wheel",m?h:null);r.call(_,{})}function l(){r.on("zoom",null)}return{update:i,destroy:l,pointer:De}}const Fj=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,_s=e=>({x:e.x,y:e.y,zoom:e.k}),Xs=({x:e,y:t,zoom:n})=>Cs.translate(e,t).scale(n),Tt=(e,t)=>e.target.closest(`.${t}`),oa=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Ks=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},ra=e=>{const t=e.ctrlKey&&as()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Hj({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:u}){return x=>{if(Tt(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const y=De(x),S=ra(x),_=p*Math.pow(2,S);s.scaleTo(n,_,y,x);return}const m=x.deltaMode===1?20:1;let f=r===St.Vertical?0:x.deltaX*m,h=r===St.Horizontal?0:x.deltaY*m;!as()&&x.shiftKey&&r!==St.Vertical&&(f=x.deltaY*m,h=0),s.translateBy(n,-(f/p)*i,-(h/p)*i,{internal:!0});const E=_s(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(x,E)),e.isPanScrolling&&(a==null||a(x,E),e.panScrollTimeout=setTimeout(()=>{u==null||u(x,E),e.isPanScrolling=!1},150))}}function Zj({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){if(!t&&s.type==="wheel"&&!s.ctrlKey||Tt(s,e))return null;s.preventDefault(),n.call(this,s,r)}}function Gj({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var i,l,c;if((i=s.sourceEvent)!=null&&i.internal)return;const r=_s(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 Yj({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{var l,c;e.usedRightMouseButton=!!(n&&oa(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,_s(i.transform)))}}function Wj({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&&oa(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),r&&Fj(e.prevViewport,l.transform))){const a=_s(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(l.sourceEvent,a)},n?150:0)}}}function Xj({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"&&(Tt(x,`${u}-flow__node`)||Tt(x,`${u}-flow__edge`)))return!0;if(!s&&!p&&!r&&!i&&!n||l||Tt(x,c)&&x.type==="wheel"||Tt(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 Kj({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=Pc().clickDistance(!Oe(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(r),f=$e(e).call(m);w({x:i.x,y:i.y,zoom:Vt(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const h=f.on("wheel.zoom"),E=f.on("dblclick.zoom");m.wheelDelta(ra);function y($,B){return f?new Promise(C=>{m==null||m.transform(Ks(f,B==null?void 0:B.duration,()=>C(!0)),$)}):Promise.resolve(!1)}function S({noWheelClassName:$,noPanClassName:B,onPaneContextMenu:C,userSelectionActive:A,panOnScroll:M,panOnDrag:D,panOnScrollMode:L,panOnScrollSpeed:V,preventScrolling:H,zoomOnPinch:G,zoomOnScroll:q,zoomOnDoubleClick:oe,zoomActivationKeyPressed:ee,lib:ne,onTransformChange:se}){A&&!x.isZoomingOrPanning&&_();const U=M&&!ee&&!A?Hj({zoomPanValues:x,noWheelClassName:$,d3Selection:f,d3Zoom:m,panOnScrollMode:L,panOnScrollSpeed:V,zoomOnPinch:G,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):Zj({noWheelClassName:$,preventScrolling:H,d3ZoomHandler:h});if(f.on("wheel.zoom",U,{passive:!1}),!A){const ge=Gj({zoomPanValues:x,onDraggingChange:u,onPanZoomStart:c});m.on("start",ge);const pe=Yj({zoomPanValues:x,panOnDrag:D,onPaneContextMenu:!!C,onPanZoom:l,onTransformChange:se});m.on("zoom",pe);const re=Wj({zoomPanValues:x,panOnDrag:D,panOnScroll:M,onPaneContextMenu:C,onPanZoomEnd:a,onDraggingChange:u});m.on("end",re)}const ue=Xj({zoomActivationKeyPressed:ee,panOnDrag:D,zoomOnScroll:q,panOnScroll:M,zoomOnDoubleClick:oe,zoomOnPinch:G,userSelectionActive:A,noPanClassName:B,noWheelClassName:$,lib:ne});m.filter(ue),oe?f.on("dblclick.zoom",E):f.on("dblclick.zoom",null)}function _(){m.on("zoom",null)}async function w($,B,C){const A=Xs($),M=m==null?void 0:m.constrain()(A,B,C);return M&&await y(M),new Promise(D=>D(M))}async function R($,B){const C=Xs($);return await y(C,B),new Promise(A=>A(C))}function b($){if(f){const B=Xs($),C=f.property("__zoom");(C.k!==$.zoom||C.x!==$.x||C.y!==$.y)&&(m==null||m.transform(f,B,null,{sync:!0}))}}function P(){const $=f?Mc(f.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function k($,B){return f?new Promise(C=>{m==null||m.scaleTo(Ks(f,B==null?void 0:B.duration,()=>C(!0)),$)}):Promise.resolve(!1)}function N($,B){return f?new Promise(C=>{m==null||m.scaleBy(Ks(f,B==null?void 0:B.duration,()=>C(!0)),$)}):Promise.resolve(!1)}function T($){m==null||m.scaleExtent($)}function I($){m==null||m.translateExtent($)}function F($){const B=!Oe($)||$<0?0:$;m==null||m.clickDistance(B)}return{update:S,destroy:_,setViewport:R,setViewportConstrained:w,getViewport:P,scaleTo:k,scaleBy:N,setScaleExtent:T,setTranslateExtent:I,syncViewport:b,setClickDistance:F}}var ln;(function(e){e.Line="line",e.Handle="handle"})(ln||(ln={}));function qj({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 Uj(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 rt(e,t){return Math.max(0,t-e)}function it(e,t){return Math.max(0,e-t)}function Nn(e,t,n){return Math.max(0,t-e,e-n)}function si(e,t){return e?!t:t}function Jj(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:E,maxWidth:y,minHeight:S,maxHeight:_}=s,{x:w,y:R,width:b,height:P,aspectRatio:k}=e;let N=Math.floor(x?f-e.pointerX:0),T=Math.floor(p?h-e.pointerY:0);const I=b+(a?-N:N),F=P+(u?-T:T),$=-i[0]*b,B=-i[1]*P;let C=Nn(I,E,y),A=Nn(F,S,_);if(l){let L=0,V=0;a&&N<0?L=rt(w+N+$,l[0][0]):!a&&N>0&&(L=it(w+I+$,l[1][0])),u&&T<0?V=rt(R+T+B,l[0][1]):!u&&T>0&&(V=it(R+F+B,l[1][1])),C=Math.max(C,L),A=Math.max(A,V)}if(c){let L=0,V=0;a&&N>0?L=it(w+N,c[0][0]):!a&&N<0&&(L=rt(w+I,c[1][0])),u&&T>0?V=it(R+T,c[0][1]):!u&&T<0&&(V=rt(R+F,c[1][1])),C=Math.max(C,L),A=Math.max(A,V)}if(r){if(x){const L=Nn(I/k,S,_)*k;if(C=Math.max(C,L),l){let V=0;!a&&!u||a&&!u&&m?V=it(R+B+I/k,l[1][1])*k:V=rt(R+B+(a?N:-N)/k,l[0][1])*k,C=Math.max(C,V)}if(c){let V=0;!a&&!u||a&&!u&&m?V=rt(R+I/k,c[1][1])*k:V=it(R+(a?N:-N)/k,c[0][1])*k,C=Math.max(C,V)}}if(p){const L=Nn(F*k,E,y)/k;if(A=Math.max(A,L),l){let V=0;!a&&!u||u&&!a&&m?V=it(w+F*k+$,l[1][0])/k:V=rt(w+(u?T:-T)*k+$,l[0][0])/k,A=Math.max(A,V)}if(c){let V=0;!a&&!u||u&&!a&&m?V=rt(w+F*k,c[1][0])/k:V=it(w+(u?T:-T)*k,c[0][0])/k,A=Math.max(A,V)}}}T=T+(T<0?A:-A),N=N+(N<0?C:-C),r&&(m?I>F*k?T=(si(a,u)?-N:N)/k:N=(si(a,u)?-T:T)*k:x?(T=N/k,u=a):(N=T*k,a=u));const M=a?w+N:w,D=u?R+T:R;return{width:b+(a?-N:N),height:P+(u?-T:T),x:i[0]*N*(a?-1:1)+M,y:i[1]*T*(u?-1:1)+D}}const ia={width:0,height:0,x:0,y:0},Qj={...ia,pointerX:0,pointerY:0,aspectRatio:1};function e3(e){return[[0,0],[e.measured.width,e.measured.height]]}function t3(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 n3({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=$e(e);function l({controlPosition:a,boundaries:u,keepAspectRatio:x,onResizeStart:p,onResize:m,onResizeEnd:f,shouldResize:h}){let E={...ia},y={...Qj};const S=Uj(a);let _,w=null,R=[],b,P,k;const N=Sc().on("start",T=>{const{nodeLookup:I,transform:F,snapGrid:$,snapToGrid:B,nodeOrigin:C,paneDomNode:A}=n();if(_=I.get(t),!_)return;w=(A==null?void 0:A.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:D}=rn(T.sourceEvent,{transform:F,snapGrid:$,snapToGrid:B,containerBounds:w});E={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},y={...E,pointerX:M,pointerY:D,aspectRatio:E.width/E.height},b=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(b=I.get(_.parentId),P=b&&_.extent==="parent"?e3(b):void 0),R=[],k=void 0;for(const[L,V]of I)if(V.parentId===t&&(R.push({id:L,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const H=t3(V,_,V.origin??C);k?k=[[Math.min(H[0][0],k[0][0]),Math.min(H[0][1],k[0][1])],[Math.max(H[1][0],k[1][0]),Math.max(H[1][1],k[1][1])]]:k=H}p==null||p(T,{...E})}).on("drag",T=>{const{transform:I,snapGrid:F,snapToGrid:$,nodeOrigin:B}=n(),C=rn(T.sourceEvent,{transform:I,snapGrid:F,snapToGrid:$,containerBounds:w}),A=[];if(!_)return;const{x:M,y:D,width:L,height:V}=E,H={},G=_.origin??B,{width:q,height:oe,x:ee,y:ne}=Jj(y,S,C,u,x,G,P,k),se=q!==L,ie=oe!==V,U=ee!==M&&se,ue=ne!==D&&ie;if(!U&&!ue&&!se&&!ie)return;if((U||ue||G[0]===1||G[1]===1)&&(H.x=U?ee:E.x,H.y=ue?ne:E.y,E.x=H.x,E.y=H.y,R.length>0)){const Q=ee-M,le=ne-D;for(const je of R)je.position={x:je.position.x-Q+G[0]*(q-L),y:je.position.y-le+G[1]*(oe-V)},A.push(je)}if((se||ie)&&(H.width=se?q:E.width,H.height=ie?oe:E.height,E.width=H.width,E.height=H.height),b&&_.expandParent){const Q=G[0]*(H.width??0);H.x&&H.x<Q&&(E.x=Q,y.x=y.x-(H.x-Q));const le=G[1]*(H.height??0);H.y&&H.y<le&&(E.y=le,y.y=y.y-(H.y-le))}const ge=qj({width:E.width,prevWidth:L,height:E.height,prevHeight:V,affectsX:S.affectsX,affectsY:S.affectsY}),pe={...E,direction:ge};(h==null?void 0:h(T,pe))!==!1&&(m==null||m(T,pe),s(H,A))}).on("end",T=>{f==null||f(T,{...E}),r==null||r()});i.call(N)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var Tn={exports:{}},qs={},An={exports:{}},Us={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ni;function TE(){if(ni)return Ks;ni=1;var e=g;function t(x,f){return x===f&&(x!==0||1/x===1/f)||x!==x&&f!==f}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,r=e.useLayoutEffect,l=e.useDebugValue;function c(x,f){var m=f(),h=s({inst:{value:m,getSnapshot:f}}),y=h[0].inst,E=h[1];return r(function(){y.value=m,y.getSnapshot=f,a(y)&&E({inst:y})},[x,m,f]),o(function(){return a(y)&&E({inst:y}),x(function(){a(y)&&E({inst:y})})},[x]),l(m),m}function a(x){var f=x.getSnapshot;x=x.value;try{var m=f();return!n(x,m)}catch{return!0}}function u(x,f){return f()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:c;return Ks.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Ks}var qs={};/**
9
+ */var oi;function s3(){if(oi)return Us;oi=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}}),E=h[0].inst,y=h[1];return i(function(){E.value=f,E.getSnapshot=m,a(E)&&y({inst:E})},[p,f,m]),r(function(){return a(E)&&y({inst:E}),p(function(){a(E)&&y({inst:E})})},[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 Us.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,Us}var Js={};/**
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 si;function AE(){return si||(si=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=g,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var S=arguments.length,b=new Array(S>1?S-1:0),P=1;P<S;P++)b[P-1]=arguments[P];s("error",w,b)}}function s(w,S,b){{var P=t.ReactDebugCurrentFrame,v=P.getStackAddendum();v!==""&&(S+="%s",b=b.concat([v]));var L=b.map(function(T){return String(T)});L.unshift("Warning: "+S),Function.prototype.apply.call(console[w],console,L)}}function o(w,S){return w===S&&(w!==0||1/w===1/S)||w!==w&&S!==S}var r=typeof Object.is=="function"?Object.is:o,l=e.useState,c=e.useEffect,a=e.useLayoutEffect,u=e.useDebugValue,d=!1,x=!1;function f(w,S,b){d||e.startTransition!==void 0&&(d=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var P=S();if(!x){var v=S();r(P,v)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),x=!0)}var L=l({inst:{value:P,getSnapshot:S}}),T=L[0].inst,A=L[1];return a(function(){T.value=P,T.getSnapshot=S,m(T)&&A({inst:T})},[w,P,S]),c(function(){m(T)&&A({inst:T});var B=function(){m(T)&&A({inst:T})};return w(B)},[w]),u(P),P}function m(w){var S=w.getSnapshot,b=w.value;try{var P=S();return!r(b,P)}catch{return!0}}function h(w,S,b){return S()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",E=!y,R=E?h:f,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:R;qs.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),qs}var oi;function na(){return oi||(oi=1,process.env.NODE_ENV==="production"?Ln.exports=TE():Ln.exports=AE()),Ln.exports}/**
17
+ */var ri;function o3(){return ri||(ri=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=g,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var R=arguments.length,b=new Array(R>1?R-1:0),P=1;P<R;P++)b[P-1]=arguments[P];s("error",w,b)}}function s(w,R,b){{var P=t.ReactDebugCurrentFrame,k=P.getStackAddendum();k!==""&&(R+="%s",b=b.concat([k]));var N=b.map(function(T){return String(T)});N.unshift("Warning: "+R),Function.prototype.apply.call(console[w],console,N)}}function r(w,R){return w===R&&(w!==0||1/w===1/R)||w!==w&&R!==R}var i=typeof Object.is=="function"?Object.is:r,l=e.useState,c=e.useEffect,a=e.useLayoutEffect,u=e.useDebugValue,x=!1,p=!1;function m(w,R,b){x||e.startTransition!==void 0&&(x=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var P=R();if(!p){var k=R();i(P,k)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}var N=l({inst:{value:P,getSnapshot:R}}),T=N[0].inst,I=N[1];return a(function(){T.value=P,T.getSnapshot=R,f(T)&&I({inst:T})},[w,P,R]),c(function(){f(T)&&I({inst:T});var F=function(){f(T)&&I({inst:T})};return w(F)},[w]),u(P),P}function f(w){var R=w.getSnapshot,b=w.value;try{var P=R();return!i(b,P)}catch{return!0}}function h(w,R,b){return R()}var E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!E,S=y?h:m,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:S;Js.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Js}var ii;function la(){return ii||(ii=1,process.env.NODE_ENV==="production"?An.exports=s3():An.exports=o3()),An.exports}/**
18
18
  * @license React
19
19
  * use-sync-external-store-shim/with-selector.production.min.js
20
20
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var ri;function $E(){if(ri)return Xs;ri=1;var e=g,t=na();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,r=e.useRef,l=e.useEffect,c=e.useMemo,a=e.useDebugValue;return Xs.useSyncExternalStoreWithSelector=function(u,d,x,f,m){var h=r(null);if(h.current===null){var y={hasValue:!1,value:null};h.current=y}else y=h.current;h=c(function(){function R(P){if(!_){if(_=!0,w=P,P=f(P),m!==void 0&&y.hasValue){var v=y.value;if(m(v,P))return S=v}return S=P}if(v=S,s(w,P))return v;var L=f(P);return m!==void 0&&m(v,L)?v:(w=P,S=L)}var _=!1,w,S,b=x===void 0?null:x;return[function(){return R(d())},b===null?void 0:function(){return R(b())}]},[d,x,f,m]);var E=o(u,h[0],h[1]);return l(function(){y.hasValue=!0,y.value=E},[E]),a(E),E},Xs}var Us={};/**
25
+ */var li;function r3(){if(li)return qs;li=1;var e=g,t=la();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 qs.useSyncExternalStoreWithSelector=function(u,x,p,m,f){var h=i(null);if(h.current===null){var E={hasValue:!1,value:null};h.current=E}else E=h.current;h=c(function(){function S(P){if(!_){if(_=!0,w=P,P=m(P),f!==void 0&&E.hasValue){var k=E.value;if(f(k,P))return R=k}return R=P}if(k=R,s(w,P))return k;var N=m(P);return f!==void 0&&f(k,N)?k:(w=P,R=N)}var _=!1,w,R,b=p===void 0?null:p;return[function(){return S(x())},b===null?void 0:function(){return S(b())}]},[x,p,m,f]);var y=r(u,h[0],h[1]);return l(function(){E.hasValue=!0,E.value=y},[y]),a(y),y},qs}var Qs={};/**
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 ii;function IE(){return ii||(ii=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=g,t=na();function n(d,x){return d===x&&(d!==0||1/d===1/x)||d!==d&&x!==x}var s=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,r=e.useRef,l=e.useEffect,c=e.useMemo,a=e.useDebugValue;function u(d,x,f,m,h){var y=r(null),E;y.current===null?(E={hasValue:!1,value:null},y.current=E):E=y.current;var R=c(function(){var b=!1,P,v,L=function(N){if(!b){b=!0,P=N;var O=m(N);if(h!==void 0&&E.hasValue){var C=E.value;if(h(C,O))return v=C,C}return v=O,O}var $=P,k=v;if(s($,N))return k;var D=m(N);return h!==void 0&&h(k,D)?k:(P=N,v=D,D)},T=f===void 0?null:f,A=function(){return L(x())},B=T===null?void 0:function(){return L(T())};return[A,B]},[x,f,m,h]),_=R[0],w=R[1],S=o(d,_,w);return l(function(){E.hasValue=!0,E.value=S},[S]),a(S),S}Us.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Us}var li;function DE(){return li||(li=1,process.env.NODE_ENV==="production"?Nn.exports=$E():Nn.exports=IE()),Nn.exports}var OE=DE();const zE=j.getDefaultExportFromCjs(OE),BE={BASE_URL:"/pluto/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},ci=e=>{let t;const n=new Set,s=(d,x)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const m=t;t=x??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(h=>h(t,m))}},o=()=>t,a={setState:s,getState:o,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(BE?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(s,o,a);return a},VE=e=>e?ci(e):ci,{useDebugValue:FE}=g,{useSyncExternalStoreWithSelector:HE}=zE,ZE=e=>e;function sa(e,t=ZE,n){const s=HE(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return FE(s),s}const ai=(e,t)=>{const n=VE(e),s=(o,r=t)=>sa(n,o,r);return Object.assign(s,n),s},GE=(e,t)=>e?ai(e,t):ai;function Se(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e)if(!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const _s=g.createContext(null),YE=_s.Provider,oa=Te.error001();function fe(e,t){const n=g.useContext(_s);if(n===null)throw new Error(oa);return sa(n,e,t)}function he(){const e=g.useContext(_s);if(e===null)throw new Error(oa);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ui={display:"none"},WE={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ra="react-flow__node-desc",ia="react-flow__edge-desc",XE="react-flow__aria-live",KE=e=>e.ariaLiveMessage;function qE({rfId:e}){const t=fe(KE);return i.jsxRuntimeExports.jsx("div",{id:`${XE}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:WE,children:t})}function UE({rfId:e,disableKeyboardA11y:t}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs("div",{id:`${ra}-${e}`,style:ui,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),i.jsxRuntimeExports.jsx("div",{id:`${ia}-${e}`,style:ui,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&i.jsxRuntimeExports.jsx(qE,{rfId:e})]})}const QE=e=>e.userSelectionActive?"none":"all",or=g.forwardRef(({position:e="top-left",children:t,className:n,style:s,...o},r)=>{const l=fe(QE),c=`${e}`.split("-");return i.jsxRuntimeExports.jsx("div",{className:Ce(["react-flow__panel",n,...c]),style:{...s,pointerEvents:l},ref:r,...o,children:t})});function JE({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:i.jsxRuntimeExports.jsx(or,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:i.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const e0=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}},Tn=e=>e.id;function t0(e,t){return Se(e.selectedNodes.map(Tn),t.selectedNodes.map(Tn))&&Se(e.selectedEdges.map(Tn),t.selectedEdges.map(Tn))}function n0({onSelectionChange:e}){const t=he(),{selectedNodes:n,selectedEdges:s}=fe(e0,t0);return g.useEffect(()=>{const o={nodes:n,edges:s};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(r=>r(o))},[n,s,e]),null}const s0=e=>!!e.onSelectionChangeHandlers;function o0({onSelectionChange:e}){const t=fe(s0);return e||t?i.jsxRuntimeExports.jsx(n0,{onSelectionChange:e}):null}const la=[0,0],r0={x:0,y:0,zoom:1},i0=["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"],di=[...i0,"rfId"],l0=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}),xi={translateExtent:xn,nodeOrigin:la,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function c0(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:o,setTranslateExtent:r,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:a,setPaneClickDistance:u}=fe(l0,Se),d=he();g.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{x.current=xi,c()}),[]);const x=g.useRef(xi);return g.useEffect(()=>{for(const f of di){const m=e[f],h=x.current[f];m!==h&&(typeof e[f]>"u"||(f==="nodes"?t(m):f==="edges"?n(m):f==="minZoom"?s(m):f==="maxZoom"?o(m):f==="translateExtent"?r(m):f==="nodeExtent"?l(m):f==="paneClickDistance"?u(m):f==="fitView"?d.setState({fitViewOnInit:m}):f==="fitViewOptions"?d.setState({fitViewOnInitOptions:m}):d.setState({[f]:m})))}x.current=e},di.map(f=>e[f])),null}function pi(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function a0(e){var s;const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const o=pi(),r=()=>n(o!=null&&o.matches?"dark":"light");return r(),o==null||o.addEventListener("change",r),()=>{o==null||o.removeEventListener("change",r)}},[e]),t!==null?t:(s=pi())!=null&&s.matches?"dark":"light"}const fi=typeof document<"u"?document:null;function mn(e=null,t={target:fi,actInsideInputWithModifier:!0}){const[n,s]=g.useState(!1),o=g.useRef(!1),r=g.useRef(new Set([])),[l,c]=g.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
33
+ */var ci;function i3(){return ci||(ci=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=g,t=la();function n(x,p){return x===p&&(x!==0||1/x===1/p)||x!==x&&p!==p}var s=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,c=e.useMemo,a=e.useDebugValue;function u(x,p,m,f,h){var E=i(null),y;E.current===null?(y={hasValue:!1,value:null},E.current=y):y=E.current;var S=c(function(){var b=!1,P,k,N=function($){if(!b){b=!0,P=$;var B=f($);if(h!==void 0&&y.hasValue){var C=y.value;if(h(C,B))return k=C,C}return k=B,B}var A=P,M=k;if(s(A,$))return M;var D=f($);return h!==void 0&&h(M,D)?M:(P=$,k=D,D)},T=m===void 0?null:m,I=function(){return N(p())},F=T===null?void 0:function(){return N(T())};return[I,F]},[p,m,f,h]),_=S[0],w=S[1],R=r(x,_,w);return l(function(){y.hasValue=!0,y.value=R},[R]),a(R),R}Qs.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Qs}var ai;function l3(){return ai||(ai=1,process.env.NODE_ENV==="production"?Tn.exports=r3():Tn.exports=i3()),Tn.exports}var c3=l3();const a3=j.getDefaultExportFromCjs(c3),u3={BASE_URL:"/pluto/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},ui=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:()=>{(u3?"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},d3=e=>e?ui(e):ui,{useDebugValue:x3}=g,{useSyncExternalStoreWithSelector:p3}=a3,m3=e=>e;function ca(e,t=m3,n){const s=p3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return x3(s),s}const di=(e,t)=>{const n=d3(e),s=(r,i=t)=>ca(n,r,i);return Object.assign(s,n),s},f3=(e,t)=>e?di(e,t):di;function _e(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 Ms=g.createContext(null),h3=Ms.Provider,aa=Ie.error001();function Ee(e,t){const n=g.useContext(Ms);if(n===null)throw new Error(aa);return ca(n,e,t)}function be(){const e=g.useContext(Ms);if(e===null)throw new Error(aa);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const xi={display:"none"},g3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ua="react-flow__node-desc",da="react-flow__edge-desc",j3="react-flow__aria-live",E3=e=>e.ariaLiveMessage;function y3({rfId:e}){const t=Ee(E3);return o.jsxRuntimeExports.jsx("div",{id:`${j3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:g3,children:t})}function S3({rfId:e,disableKeyboardA11y:t}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{id:`${ua}-${e}`,style:xi,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:`${da}-${e}`,style:xi,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(y3,{rfId:e})]})}const R3=e=>e.userSelectionActive?"none":"all",ir=g.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const l=Ee(R3),c=`${e}`.split("-");return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__panel",n,...c]),style:{...s,pointerEvents:l},ref:i,...r,children:t})});function C3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsxRuntimeExports.jsx(ir,{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 w3=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}},In=e=>e.id;function b3(e,t){return _e(e.selectedNodes.map(In),t.selectedNodes.map(In))&&_e(e.selectedEdges.map(In),t.selectedEdges.map(In))}function v3({onSelectionChange:e}){const t=be(),{selectedNodes:n,selectedEdges:s}=Ee(w3,b3);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 k3=e=>!!e.onSelectionChangeHandlers;function _3({onSelectionChange:e}){const t=Ee(k3);return e||t?o.jsxRuntimeExports.jsx(v3,{onSelectionChange:e}):null}const xa=[0,0],M3={x:0,y:0,zoom:1},P3=["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"],pi=[...P3,"rfId"],L3=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}),mi={translateExtent:mn,nodeOrigin:xa,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function N3(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:a,setPaneClickDistance:u}=Ee(L3,_e),x=be();g.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{p.current=mi,c()}),[]);const p=g.useRef(mi);return g.useEffect(()=>{for(const m of pi){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},pi.map(m=>e[m])),null}function fi(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function T3(e){var s;const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const r=fi(),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=fi())!=null&&s.matches?"dark":"light"}const hi=typeof document<"u"?document:null;function gn(e=null,t={target:hi,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
- `)),d=u.reduce((x,f)=>x.concat(...f),[]);return[u,d]}return[[],[]]},[e]);return g.useEffect(()=>{const a=(t==null?void 0:t.target)||fi;if(e!==null){const u=f=>{if(o.current=f.ctrlKey||f.metaKey||f.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&jo(f))return!1;const h=hi(f.code,c);r.current.add(f[h]),mi(l,r.current,!1)&&(f.preventDefault(),s(!0))},d=f=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&jo(f))return!1;const h=hi(f.code,c);mi(l,r.current,!0)?(s(!1),r.current.clear()):r.current.delete(f[h]),f.key==="Meta"&&r.current.clear(),o.current=!1},x=()=>{r.current.clear(),s(!1)};return a==null||a.addEventListener("keydown",u),a==null||a.addEventListener("keyup",d),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{a==null||a.removeEventListener("keydown",u),a==null||a.removeEventListener("keyup",d),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,s]),n}function mi(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function hi(e,t){return t.includes(e)?"code":"key"}const u0=()=>{const e=he();return g.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,o,r],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??o,zoom:t.zoom??r},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},fitView:t=>{const{nodeLookup:n,minZoom:s,maxZoom:o,panZoom:r,domNode:l}=e.getState();if(!r||!l)return Promise.resolve(!1);const c=mo(n,t),{width:a,height:u}=bs(l);return ho({nodes:c,width:a,height:u,minZoom:s,maxZoom:o,panZoom:r},t)},setCenter:async(t,n,s)=>{const{width:o,height:r,maxZoom:l,panZoom:c}=e.getState(),a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:l,u=o/2-t*a,d=r/2-n*a;return c?(await c.setViewport({x:u,y:d,zoom:a},{duration:s==null?void 0:s.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:s,height:o,minZoom:r,maxZoom:l,panZoom:c}=e.getState(),a=Jo(t,s,o,r,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(a,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:s,snapGrid:o,domNode:r}=e.getState();if(!r)return t;const{x:l,y:c}=r.getBoundingClientRect(),a={x:t.x-l,y:t.y-c};return Rn(a,s,n.snapToGrid,o)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:o,y:r}=s.getBoundingClientRect(),l=$c(t,n);return{x:l.x+o,y:l.y+r}}}),[])};function ca(e,t){const n=[],s=new Map,o=[];for(const r of e)if(r.type==="add"){o.push(r);continue}else if(r.type==="remove"||r.type==="replace")s.set(r.id,[r]);else{const l=s.get(r.id);l?l.push(r):s.set(r.id,[r])}for(const r of t){const l=s.get(r.id);if(!l){n.push(r);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...r};for(const a of l)d0(a,c);n.push(c)}return o.length&&o.forEach(r=>{r.index!==void 0?n.splice(r.index,0,{...r.item}):n.push({...r.item})}),n}function d0(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 aa(e,t){return ca(e,t)}function ua(e,t){return ca(e,t)}function mt(e,t){return{id:e,type:"select",selected:t}}function Nt(e,t=new Set,n=!1){const s=[];for(const[o,r]of e){const l=t.has(o);!(r.selected===void 0&&!l)&&r.selected!==l&&(n&&(r.selected=l),s.push(mt(r.id,l)))}return s}function gi({items:e=[],lookup:t}){var o;const n=[],s=new Map(e.map(r=>[r.id,r]));for(const[r,l]of e.entries()){const c=t.get(l.id),a=((o=c==null?void 0:c.internals)==null?void 0:o.userNode)??c;a!==void 0&&a!==l&&n.push({id:l.id,item:l,type:"replace"}),a===void 0&&n.push({item:l,type:"add",index:r})}for(const[r]of t)s.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function ji(e){return{id:e.id,type:"remove"}}const yi=e=>Zy(e),x0=e=>Pc(e);function da(e){return g.forwardRef(e)}const p0=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Ei(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>f0(()=>n(o=>o+BigInt(1))));return p0(()=>{const o=s.get();o.length&&(e(o),s.reset())},[t]),s}function f0(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const xa=g.createContext(null);function m0({children:e}){const t=he(),n=g.useCallback(c=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:d,onNodesChange:x,nodeLookup:f}=t.getState();let m=a;for(const h of c)m=typeof h=="function"?h(m):h;d?u(m):x&&x(gi({items:m,lookup:f}))},[]),s=Ei(n),o=g.useCallback(c=>{const{edges:a=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:x,edgeLookup:f}=t.getState();let m=a;for(const h of c)m=typeof h=="function"?h(m):h;d?u(m):x&&x(gi({items:m,lookup:f}))},[]),r=Ei(o),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:r}),[]);return i.jsxRuntimeExports.jsx(xa.Provider,{value:l,children:e})}function h0(){const e=g.useContext(xa);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const g0=e=>!!e.panZoom;function bt(){const e=u0(),t=he(),n=h0(),s=fe(g0),o=g.useMemo(()=>{const r=x=>t.getState().nodeLookup.get(x),l=x=>{n.nodeQueue.push(x)},c=x=>{n.edgeQueue.push(x)},a=x=>{var R,_;const{nodeLookup:f,nodeOrigin:m}=t.getState(),h=yi(x)?x:f.get(x.id),y=h.parentId?Dc(h.position,h.measured,h.parentId,f,m):h.position,E={...h,position:y,width:((R=h.measured)==null?void 0:R.width)??h.width,height:((_=h.measured)==null?void 0:_.height)??h.height};return zt(E)},u=(x,f,m={replace:!1})=>{l(h=>h.map(y=>{if(y.id===x){const E=typeof f=="function"?f(y):f;return m.replace&&yi(E)?E:{...y,...E}}return y}))},d=(x,f,m={replace:!1})=>{c(h=>h.map(y=>{if(y.id===x){const E=typeof f=="function"?f(y):f;return m.replace&&x0(E)?E:{...y,...E}}return y}))};return{getNodes:()=>t.getState().nodes.map(x=>({...x})),getNode:x=>{var f;return(f=r(x))==null?void 0:f.internals.userNode},getInternalNode:r,getEdges:()=>{const{edges:x=[]}=t.getState();return x.map(f=>({...f}))},getEdge:x=>t.getState().edgeLookup.get(x),setNodes:l,setEdges:c,addNodes:x=>{const f=Array.isArray(x)?x:[x];n.nodeQueue.push(m=>[...m,...f])},addEdges:x=>{const f=Array.isArray(x)?x:[x];n.edgeQueue.push(m=>[...m,...f])},toObject:()=>{const{nodes:x=[],edges:f=[],transform:m}=t.getState(),[h,y,E]=m;return{nodes:x.map(R=>({...R})),edges:f.map(R=>({...R})),viewport:{x:h,y,zoom:E}}},deleteElements:async({nodes:x=[],edges:f=[]})=>{const{nodes:m,edges:h,onNodesDelete:y,onEdgesDelete:E,triggerNodeChanges:R,triggerEdgeChanges:_,onDelete:w,onBeforeDelete:S}=t.getState(),{nodes:b,edges:P}=await Wy({nodesToRemove:x,edgesToRemove:f,nodes:m,edges:h,onBeforeDelete:S}),v=P.length>0,L=b.length>0;if(v){const T=P.map(ji);E==null||E(P),_(T)}if(L){const T=b.map(ji);y==null||y(b),R(T)}return(L||v)&&(w==null||w({nodes:b,edges:P})),{deletedNodes:b,deletedEdges:P}},getIntersectingNodes:(x,f=!0,m)=>{const h=Yr(x),y=h?x:a(x),E=m!==void 0;return y?(m||t.getState().nodes).filter(R=>{const _=t.getState().nodeLookup.get(R.id);if(_&&!h&&(R.id===x.id||!_.internals.positionAbsolute))return!1;const w=zt(E?R:_),S=pn(w,y);return f&&S>0||S>=y.width*y.height}):[]},isNodeIntersecting:(x,f,m=!0)=>{const y=Yr(x)?x:a(x);if(!y)return!1;const E=pn(y,f);return m&&E>0||E>=y.width*y.height},updateNode:u,updateNodeData:(x,f,m={replace:!1})=>{u(x,h=>{const y=typeof f=="function"?f(h):f;return m.replace?{...h,data:y}:{...h,data:{...h.data,...y}}},m)},updateEdge:d,updateEdgeData:(x,f,m={replace:!1})=>{d(x,h=>{const y=typeof f=="function"?f(h):f;return m.replace?{...h,data:y}:{...h,data:{...h.data,...y}}},m)},getNodesBounds:x=>{const{nodeLookup:f,nodeOrigin:m}=t.getState();return Gy(x,{nodeLookup:f,nodeOrigin:m})},getHandleConnections:({type:x,id:f,nodeId:m})=>{var h;return Array.from(((h=t.getState().connectionLookup.get(`${m}-${x}-${f??null}`))==null?void 0:h.values())??[])}}},[]);return g.useMemo(()=>({...o,...e,viewportInitialized:s}),[s])}const Si=e=>e.selected,j0={actInsideInputWithModifier:!1},y0=typeof window<"u"?window:void 0;function E0({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=he(),{deleteElements:s}=bt(),o=mn(e,j0),r=mn(t,{target:y0});g.useEffect(()=>{if(o){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(Si),edges:l.filter(Si)}),n.setState({nodesSelectionActive:!1})}},[o]),g.useEffect(()=>{n.setState({multiSelectionActive:r})},[r])}function S0(e){const t=he();g.useEffect(()=>{const n=()=>{var o,r;if(!e.current)return!1;const s=bs(e.current);(s.height===0||s.width===0)&&((r=(o=t.getState()).onError)==null||r.call(o,"004",Te.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const ks={position:"absolute",width:"100%",height:"100%",top:0,left:0},R0=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function C0({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.5,panOnScrollMode:r=jt.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:u,minZoom:d,maxZoom:x,zoomActivationKeyCode:f,preventScrolling:m=!0,children:h,noWheelClassName:y,noPanClassName:E,onViewportChange:R,isControlledViewport:_,paneClickDistance:w}){const S=he(),b=g.useRef(null),{userSelectionActive:P,lib:v}=fe(R0,Se),L=mn(f),T=g.useRef();S0(b);const A=g.useCallback(B=>{R==null||R({x:B[0],y:B[1],zoom:B[2]}),_||S.setState({transform:B})},[R,_]);return g.useEffect(()=>{if(b.current){T.current=bE({domNode:b.current,minZoom:d,maxZoom:x,translateExtent:u,viewport:a,paneClickDistance:w,onDraggingChange:C=>S.setState({paneDragging:C}),onPanZoomStart:(C,$)=>{const{onViewportChangeStart:k,onMoveStart:D}=S.getState();D==null||D(C,$),k==null||k($)},onPanZoom:(C,$)=>{const{onViewportChange:k,onMove:D}=S.getState();D==null||D(C,$),k==null||k($)},onPanZoomEnd:(C,$)=>{const{onViewportChangeEnd:k,onMoveEnd:D}=S.getState();D==null||D(C,$),k==null||k($)}});const{x:B,y:N,zoom:O}=T.current.getViewport();return S.setState({panZoom:T.current,transform:[B,N,O],domNode:b.current.closest(".react-flow")}),()=>{var C;(C=T.current)==null||C.destroy()}}},[]),g.useEffect(()=>{var B;(B=T.current)==null||B.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:o,panOnScrollMode:r,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:L,preventScrolling:m,noPanClassName:E,userSelectionActive:P,noWheelClassName:y,lib:v,onTransformChange:A})},[e,t,n,s,o,r,l,c,L,m,E,P,y,v,A]),i.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:b,style:ks,children:h})}const w0=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function b0(){const{userSelectionActive:e,userSelectionRect:t}=fe(w0,Se);return e&&t?i.jsxRuntimeExports.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Qs=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},v0=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function _0({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Dt.Full,panOnDrag:s,selectionOnDrag:o,onSelectionStart:r,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:a,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:x,onPaneMouseLeave:f,children:m}){const h=g.useRef(null),y=he(),E=g.useRef(0),R=g.useRef(0),_=g.useRef(),w=g.useRef(new Map),{userSelectionActive:S,elementsSelectable:b,dragging:P}=fe(v0,Se),v=b&&(e||S),L=g.useRef(!1),T=g.useRef(!1),A=()=>{y.setState({userSelectionActive:!1,userSelectionRect:null}),E.current=0,R.current=0},B=M=>{if(L.current){L.current=!1;return}c==null||c(M),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},N=M=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){M.preventDefault();return}a==null||a(M)},O=u?M=>u(M):void 0,C=M=>{var K,U,Q,ne;const{resetSelectedElements:z,domNode:V,edgeLookup:Z}=y.getState();if(_.current=V==null?void 0:V.getBoundingClientRect(),!b||!e||M.button!==0||M.target!==h.current||!_.current)return;(U=(K=M.target)==null?void 0:K.setPointerCapture)==null||U.call(K,M.pointerId),T.current=!0,L.current=!1,w.current=new Map;for(const[W,ie]of Z)w.current.set(ie.source,((Q=w.current.get(ie.source))==null?void 0:Q.add(W))||new Set([W])),w.current.set(ie.target,((ne=w.current.get(ie.target))==null?void 0:ne.add(W))||new Set([W]));const{x:Y,y:ee}=Ue(M.nativeEvent,_.current);z(),y.setState({userSelectionRect:{width:0,height:0,startX:Y,startY:ee,x:Y,y:ee}}),r==null||r(M)},$=M=>{const{userSelectionRect:z,edgeLookup:V,transform:Z,nodeLookup:Y,triggerNodeChanges:ee,triggerEdgeChanges:K}=y.getState();if(!_.current||!z)return;L.current=!0;const{x:U,y:Q}=Ue(M.nativeEvent,_.current),{startX:ne,startY:W}=z,ie={startX:ne,startY:W,x:U<ne?U:ne,y:Q<W?Q:W,width:Math.abs(U-ne),height:Math.abs(Q-W)},de=Mc(Y,ie,Z,n===Dt.Partial,!0),ae=new Set,te=new Set;for(const X of de){te.add(X.id);const se=w.current.get(X.id);if(se)for(const pe of se)ae.add(pe)}if(E.current!==te.size){E.current=te.size;const X=Nt(Y,te,!0);ee(X)}if(R.current!==ae.size){R.current=ae.size;const X=Nt(V,ae);K(X)}y.setState({userSelectionRect:ie,userSelectionActive:!0,nodesSelectionActive:!1})},k=M=>{var V,Z;if(M.button!==0||!T.current)return;(Z=(V=M.target)==null?void 0:V.releasePointerCapture)==null||Z.call(V,M.pointerId);const{userSelectionRect:z}=y.getState();!S&&z&&M.target===h.current&&(B==null||B(M)),E.current>0&&y.setState({nodesSelectionActive:!0}),A(),l==null||l(M),(t||o)&&(L.current=!1),T.current=!1},D=s===!0||Array.isArray(s)&&s.includes(0);return i.jsxRuntimeExports.jsxs("div",{className:Ce(["react-flow__pane",{draggable:D,dragging:P,selection:e}]),onClick:v?void 0:Qs(B,h),onContextMenu:Qs(N,h),onWheel:Qs(O,h),onPointerEnter:v?void 0:d,onPointerDown:v?C:x,onPointerMove:v?$:x,onPointerUp:v?k:void 0,onPointerLeave:f,ref:h,style:ks,children:[m,i.jsxRuntimeExports.jsx(b0,{})]})}function Co({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:r,multiSelectionActive:l,nodeLookup:c,onError:a}=t.getState(),u=c.get(e);if(!u){a==null||a("012",Te.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&l)&&(r({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=s==null?void 0:s.current)==null?void 0:d.blur()})):o([e])}function pa({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:o,isSelectable:r,nodeClickDistance:l}){const c=he(),[a,u]=g.useState(!1),d=g.useRef();return g.useEffect(()=>{d.current=dE({getStoreItems:()=>c.getState(),onNodeMouseDown:x=>{Co({id:x,store:c,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),g.useEffect(()=>{var x,f;if(t)(x=d.current)==null||x.destroy();else if(e.current)return(f=d.current)==null||f.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:r,nodeId:o,nodeClickDistance:l}),()=>{var m;(m=d.current)==null||m.destroy()}},[n,s,t,r,e,o]),a}const k0=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function fa(){const e=he();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:o,snapGrid:r,nodesDraggable:l,onError:c,updateNodePositions:a,nodeLookup:u,nodeOrigin:d}=e.getState(),x=new Map,f=k0(l),m=o?r[0]:5,h=o?r[1]:5,y=n.direction.x*m*n.factor,E=n.direction.y*h*n.factor;for(const[,R]of u){if(!f(R))continue;let _={x:R.internals.positionAbsolute.x+y,y:R.internals.positionAbsolute.y+E};o&&(_=ws(_,r));const{position:w,positionAbsolute:S}=Nc({nodeId:R.id,nextPosition:_,nodeLookup:u,nodeExtent:s,nodeOrigin:d,onError:c});R.position=w,R.internals.positionAbsolute=S,x.set(R.id,R)}a(x)},[])}const rr=g.createContext(null),P0=rr.Provider;rr.Consumer;const ma=()=>g.useContext(rr),M0=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),N0=(e,t,n)=>s=>{const{connectionClickStartHandle:o,connectionMode:r,connection:l}=s,{fromHandle:c,toHandle:a,isValid:u}=l,d=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:d,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:r===Rt.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,valid:d&&u}};function L0({type:e="source",position:t=G.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:r=!0,id:l,onConnect:c,children:a,className:u,onMouseDown:d,onTouchStart:x,...f},m){var C,$;const h=l||null,y=e==="target",E=he(),R=ma(),{connectOnClick:_,noPanClassName:w,rfId:S}=fe(M0,Se),{connectingFrom:b,connectingTo:P,clickConnecting:v,isPossibleEndHandle:L,connectionInProcess:T,valid:A}=fe(N0(R,h,e),Se);R||($=(C=E.getState()).onError)==null||$.call(C,"010",Te.error010());const B=k=>{const{defaultEdgeOptions:D,onConnect:M,hasDefaultEdges:z}=E.getState(),V={...D,...k};if(z){const{edges:Z,setEdges:Y}=E.getState();Y(Zc(V,Z))}M==null||M(V),c==null||c(V)},N=k=>{if(!R)return;const D=zc(k.nativeEvent);if(o&&(D&&k.button===0||!D)){const M=E.getState();Ro.onPointerDown(k.nativeEvent,{autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:y,handleId:h,nodeId:R,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:M.onConnectEnd,updateConnection:M.updateConnection,onConnect:B,isValidConnection:n||M.isValidConnection,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed})}D?d==null||d(k):x==null||x(k)},O=k=>{const{onClickConnectStart:D,onClickConnectEnd:M,connectionClickStartHandle:z,connectionMode:V,isValidConnection:Z,lib:Y,rfId:ee,nodeLookup:K,connection:U}=E.getState();if(!R||!z&&!o)return;if(!z){D==null||D(k.nativeEvent,{nodeId:R,handleId:h,handleType:e}),E.setState({connectionClickStartHandle:{nodeId:R,type:e,id:h}});return}const Q=Oc(k.target),ne=n||Z,{connection:W,isValid:ie}=Ro.isValid(k.nativeEvent,{handle:{nodeId:R,id:h,type:e},connectionMode:V,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:ne,flowId:ee,doc:Q,lib:Y,nodeLookup:K});ie&&W&&B(W);const de=structuredClone(U);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,M==null||M(k,de),E.setState({connectionClickStartHandle:null})};return i.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":R,"data-handlepos":t,"data-id":`${S}-${R}-${h}-${e}`,className:Ce(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,u,{source:!y,target:y,connectable:s,connectablestart:o,connectableend:r,clickconnecting:v,connectingfrom:b,connectingto:P,valid:A,connectionindicator:s&&(!T||L)&&(T?r:o)}]),onMouseDown:N,onTouchStart:N,onClick:_?O:void 0,ref:m,...f,children:a})}const hn=g.memo(da(L0));function T0({data:e,isConnectable:t,sourcePosition:n=G.Bottom}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[e==null?void 0:e.label,i.jsxRuntimeExports.jsx(hn,{type:"source",position:n,isConnectable:t})]})}function A0({data:e,isConnectable:t,targetPosition:n=G.Top,sourcePosition:s=G.Bottom}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(hn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,i.jsxRuntimeExports.jsx(hn,{type:"source",position:s,isConnectable:t})]})}function $0(){return null}function I0({data:e,isConnectable:t,targetPosition:n=G.Top}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(hn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const cs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ri={input:T0,default:A0,output:I0,group:$0};function D0(e){var t,n,s,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const O0=e=>{const{width:t,height:n,x:s,y:o}=Sn(e.nodeLookup,{filter:r=>!!r.selected});return{width:Oe(t)?t:null,height:Oe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${o}px)`}};function z0({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=he(),{width:o,height:r,transformString:l,userSelectionActive:c}=fe(O0,Se),a=fa(),u=g.useRef(null);if(g.useEffect(()=>{var f;n||(f=u.current)==null||f.focus({preventScroll:!0})},[n]),pa({nodeRef:u}),c||!o||!r)return null;const d=e?f=>{const m=s.getState().nodes.filter(h=>h.selected);e(f,m)}:void 0,x=f=>{Object.prototype.hasOwnProperty.call(cs,f.key)&&(f.preventDefault(),a({direction:cs[f.key],factor:f.shiftKey?4:1}))};return i.jsxRuntimeExports.jsx("div",{className:Ce(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:i.jsxRuntimeExports.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:o,height:r}})})}const Ci=typeof window<"u"?window:void 0,B0=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ha({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:d,selectionMode:x,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:h,panActivationKeyCode:y,zoomActivationKeyCode:E,elementsSelectable:R,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:S,panOnScrollSpeed:b,panOnScrollMode:P,zoomOnDoubleClick:v,panOnDrag:L,defaultViewport:T,translateExtent:A,minZoom:B,maxZoom:N,preventScrolling:O,onSelectionContextMenu:C,noWheelClassName:$,noPanClassName:k,disableKeyboardA11y:D,onViewportChange:M,isControlledViewport:z}){const{nodesSelectionActive:V,userSelectionActive:Z}=fe(B0),Y=mn(u,{target:Ci}),ee=mn(y,{target:Ci}),K=ee||L,U=ee||S,Q=d&&K!==!0,ne=Y||Z||Q;return E0({deleteKeyCode:a,multiSelectionKeyCode:h}),i.jsxRuntimeExports.jsx(C0,{onPaneContextMenu:r,elementsSelectable:R,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:U,panOnScrollSpeed:b,panOnScrollMode:P,zoomOnDoubleClick:v,panOnDrag:!Y&&K,defaultViewport:T,translateExtent:A,minZoom:B,maxZoom:N,zoomActivationKeyCode:E,preventScrolling:O,noWheelClassName:$,noPanClassName:k,onViewportChange:M,isControlledViewport:z,paneClickDistance:c,children:i.jsxRuntimeExports.jsxs(_0,{onSelectionStart:f,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:r,onPaneScroll:l,panOnDrag:K,isSelecting:!!ne,selectionMode:x,selectionKeyPressed:Y,selectionOnDrag:Q,children:[e,V&&i.jsxRuntimeExports.jsx(z0,{onSelectionContextMenu:C,noPanClassName:k,disableKeyboardA11y:D})]})})}ha.displayName="FlowRenderer";const V0=g.memo(ha),F0=e=>t=>e?Mc(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function H0(e){return fe(g.useCallback(F0(e),[e]),Se)}const Z0=e=>e.updateNodeInternals;function G0(){const e=fe(Z0),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(o=>{const r=o.target.getAttribute("data-id");s.set(r,{id:r,nodeElement:o.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Y0({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const o=he(),r=g.useRef(null),l=g.useRef(null),c=g.useRef(e.sourcePosition),a=g.useRef(e.targetPosition),u=g.useRef(t),d=n&&!!e.internals.handleBounds;return g.useEffect(()=>{r.current&&!e.hidden&&(!d||l.current!==r.current)&&(l.current&&(s==null||s.unobserve(l.current)),s==null||s.observe(r.current),l.current=r.current)},[d,e.hidden]),g.useEffect(()=>()=>{l.current&&(s==null||s.unobserve(l.current),l.current=null)},[]),g.useEffect(()=>{if(r.current){const x=u.current!==t,f=c.current!==e.sourcePosition,m=a.current!==e.targetPosition;(x||f||m)&&(u.current=t,c.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:r.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),r}function W0({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:o,onContextMenu:r,onDoubleClick:l,nodesDraggable:c,elementsSelectable:a,nodesConnectable:u,nodesFocusable:d,resizeObserver:x,noDragClassName:f,noPanClassName:m,disableKeyboardA11y:h,rfId:y,nodeTypes:E,nodeExtent:R,nodeClickDistance:_,onError:w}){const{node:S,internals:b,isParent:P}=fe(W=>{const ie=W.nodeLookup.get(e),de=W.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:de}},Se);let v=S.type||"default",L=(E==null?void 0:E[v])||Ri[v];L===void 0&&(w==null||w("003",Te.error003(v)),v="default",L=Ri.default);const T=!!(S.draggable||c&&typeof S.draggable>"u"),A=!!(S.selectable||a&&typeof S.selectable>"u"),B=!!(S.connectable||u&&typeof S.connectable>"u"),N=!!(S.focusable||d&&typeof S.focusable>"u"),O=he(),C=Ic(S),$=Y0({node:S,nodeType:v,hasDimensions:C,resizeObserver:x}),k=pa({nodeRef:$,disabled:S.hidden||!T,noDragClassName:f,handleSelector:S.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:_}),D=fa();if(S.hidden)return null;const M=tt(S),z=D0(S),V=A||T||t||n||s||o,Z=n?W=>n(W,{...b.userNode}):void 0,Y=s?W=>s(W,{...b.userNode}):void 0,ee=o?W=>o(W,{...b.userNode}):void 0,K=r?W=>r(W,{...b.userNode}):void 0,U=l?W=>l(W,{...b.userNode}):void 0,Q=W=>{const{selectNodesOnDrag:ie,nodeDragThreshold:de}=O.getState();A&&(!ie||!T||de>0)&&Co({id:e,store:O,nodeRef:$}),t&&t(W,{...b.userNode})},ne=W=>{if(!(jo(W.nativeEvent)||h))if(vc.includes(W.key)&&A){const ie=W.key==="Escape";Co({id:e,store:O,unselect:ie,nodeRef:$})}else T&&S.selected&&Object.prototype.hasOwnProperty.call(cs,W.key)&&(W.preventDefault(),O.setState({ariaLiveMessage:`Moved selected node ${W.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~b.positionAbsolute.x}, y: ${~~b.positionAbsolute.y}`}),D({direction:cs[W.key],factor:W.shiftKey?4:1}))};return i.jsxRuntimeExports.jsx("div",{className:Ce(["react-flow__node",`react-flow__node-${v}`,{[m]:T},S.className,{selected:S.selected,selectable:A,parent:P,draggable:T,dragging:k}]),ref:$,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:C?"visible":"hidden",...S.style,...z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Z,onMouseMove:Y,onMouseLeave:ee,onContextMenu:K,onClick:Q,onDoubleClick:U,onKeyDown:N?ne:void 0,tabIndex:N?0:void 0,role:N?"button":void 0,"aria-describedby":h?void 0:`${ra}-${y}`,"aria-label":S.ariaLabel,children:i.jsxRuntimeExports.jsx(P0,{value:e,children:i.jsxRuntimeExports.jsx(L,{id:e,data:S.data,type:v,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:S.selected,selectable:A,draggable:T,deletable:S.deletable??!0,isConnectable:B,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:k,dragHandle:S.dragHandle,zIndex:b.z,parentId:S.parentId,...M})})})}const X0=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ga(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,onError:r}=fe(X0,Se),l=H0(e.onlyRenderVisibleElements),c=G0();return i.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:ks,children:l.map(a=>i.jsxRuntimeExports.jsx(W0,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:r},a))})}ga.displayName="NodeRenderer";const K0=g.memo(ga);function q0(e){return fe(g.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const s=[];if(n.width&&n.height)for(const o of n.edges){const r=n.nodeLookup.get(o.source),l=n.nodeLookup.get(o.target);r&&l&&qy({sourceNode:r,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(o.id)}return s},[e]),Se)}const U0=({color:e="none",strokeWidth:t=1})=>i.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),Q0=({color:e="none",strokeWidth:t=1})=>i.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),wi={[os.Arrow]:U0,[os.ArrowClosed]:Q0};function J0(e){const t=he();return g.useMemo(()=>{var o,r;return Object.prototype.hasOwnProperty.call(wi,e)?wi[e]:((r=(o=t.getState()).onError)==null||r.call(o,"009",Te.error009(e)),null)},[e])}const eS=({id:e,type:t,color:n,width:s=12.5,height:o=12.5,markerUnits:r="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const a=J0(t);return a?i.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:r,orient:c,refX:"0",refY:"0",children:i.jsxRuntimeExports.jsx(a,{color:n,strokeWidth:l})}):null},ja=({defaultColor:e,rfId:t})=>{const n=fe(r=>r.edges),s=fe(r=>r.defaultEdgeOptions),o=g.useMemo(()=>sE(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return o.length?i.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker",children:i.jsxRuntimeExports.jsx("defs",{children:o.map(r=>i.jsxRuntimeExports.jsx(eS,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})}):null};ja.displayName="MarkerDefinitions";var tS=g.memo(ja);function ya({x:e,y:t,label:n,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:r={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:a,className:u,...d}){const[x,f]=g.useState({x:1,y:0,width:0,height:0}),m=Ce(["react-flow__edge-textwrapper",u]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const y=h.current.getBBox();f({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),typeof n>"u"||!n?null:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-x.width/2} ${t-x.height/2})`,className:m,visibility:x.width?"visible":"hidden",...d,children:[o&&i.jsxRuntimeExports.jsx("rect",{width:x.width+2*l[0],x:-l[0],y:-l[1],height:x.height+2*l[1],className:"react-flow__edge-textbg",style:r,rx:c,ry:c}),i.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:h,style:s,children:n}),a]})}ya.displayName="EdgeText";const nS=g.memo(ya);function ze({path:e,labelX:t,labelY:n,label:s,labelStyle:o,labelShowBg:r,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a,interactionWidth:u=20,...d}){return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("path",{...d,d:e,fill:"none",className:Ce(["react-flow__edge-path",d.className])}),u&&i.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}),s&&Oe(t)&&Oe(n)?i.jsxRuntimeExports.jsx(nS,{x:t,y:n,label:s,labelStyle:o,labelShowBg:r,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a}):null]})}function bi({pos:e,x1:t,y1:n,x2:s,y2:o}){return e===G.Left||e===G.Right?[.5*(t+s),n]:[t,.5*(n+o)]}function Ea({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:s,targetY:o,targetPosition:r=G.Top}){const[l,c]=bi({pos:n,x1:e,y1:t,x2:s,y2:o}),[a,u]=bi({pos:r,x1:s,y1:o,x2:e,y2:t}),[d,x,f,m]=Bc({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:a,targetControlY:u});return[`M${e},${t} C${l},${c} ${a},${u} ${s},${o}`,d,x,f,m]}function Sa(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,sourcePosition:l=G.Bottom,targetPosition:c=G.Top,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:y,markerStart:E,interactionWidth:R})=>{const[_,w,S]=Ea({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:r,targetPosition:c}),b=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:b,path:_,labelX:w,labelY:S,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:y,markerStart:E,interactionWidth:R})})}const sS=Sa({isInternal:!1}),Ra=Sa({isInternal:!0});sS.displayName="SimpleBezierEdge";Ra.displayName="SimpleBezierEdgeInternal";function Ca(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:f,sourcePosition:m=G.Bottom,targetPosition:h=G.Top,markerEnd:y,markerStart:E,pathOptions:R,interactionWidth:_})=>{const[w,S,b]=yo({sourceX:n,sourceY:s,sourcePosition:m,targetX:o,targetY:r,targetPosition:h,borderRadius:R==null?void 0:R.borderRadius,offset:R==null?void 0:R.offset}),P=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:P,path:w,labelX:S,labelY:b,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:f,markerEnd:y,markerStart:E,interactionWidth:_})})}const wa=Ca({isInternal:!1}),ba=Ca({isInternal:!0});wa.displayName="SmoothStepEdge";ba.displayName="SmoothStepEdgeInternal";function va(e){return g.memo(({id:t,...n})=>{var o;const s=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(wa,{...n,id:s,pathOptions:g.useMemo(()=>{var r;return{borderRadius:0,offset:(r=n.pathOptions)==null?void 0:r.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const oS=va({isInternal:!1}),_a=va({isInternal:!0});oS.displayName="StepEdge";_a.displayName="StepEdgeInternal";function ka(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:f,markerEnd:m,markerStart:h,interactionWidth:y})=>{const[E,R,_]=Gc({sourceX:n,sourceY:s,targetX:o,targetY:r}),w=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:w,path:E,labelX:R,labelY:_,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:x,style:f,markerEnd:m,markerStart:h,interactionWidth:y})})}const rS=ka({isInternal:!1}),Pa=ka({isInternal:!0});rS.displayName="StraightEdge";Pa.displayName="StraightEdgeInternal";function Ma(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:r,sourcePosition:l=G.Bottom,targetPosition:c=G.Top,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:y,markerStart:E,pathOptions:R,interactionWidth:_})=>{const[w,S,b]=Vc({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:r,targetPosition:c,curvature:R==null?void 0:R.curvature}),P=e.isInternal?void 0:t;return i.jsxRuntimeExports.jsx(ze,{id:P,path:w,labelX:S,labelY:b,label:a,labelStyle:u,labelShowBg:d,labelBgStyle:x,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:y,markerStart:E,interactionWidth:_})})}const iS=Ma({isInternal:!1}),Na=Ma({isInternal:!0});iS.displayName="BezierEdge";Na.displayName="BezierEdgeInternal";const vi={default:Na,straight:Pa,step:_a,smoothstep:ba,simplebezier:Ra},_i={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},lS=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,cS=(e,t,n)=>n===G.Top?e-t:n===G.Bottom?e+t:e,ki="react-flow__edgeupdater";function Pi({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:o,onMouseEnter:r,onMouseOut:l,type:c}){return i.jsxRuntimeExports.jsx("circle",{onMouseDown:o,onMouseEnter:r,onMouseOut:l,className:Ce([ki,`${ki}-${c}`]),cx:lS(t,s,e),cy:cS(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function aS({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:o,targetX:r,targetY:l,sourcePosition:c,targetPosition:a,onReconnect:u,onReconnectStart:d,onReconnectEnd:x,setReconnecting:f,setUpdateHover:m}){const h=he(),y=(S,b)=>{if(S.button!==0)return;const{autoPanOnConnect:P,domNode:v,isValidConnection:L,connectionMode:T,connectionRadius:A,lib:B,onConnectStart:N,onConnectEnd:O,cancelConnection:C,nodeLookup:$,rfId:k,panBy:D,updateConnection:M}=h.getState(),z=b.type==="target";f(!0),d==null||d(S,n,b.type);const V=(Y,ee)=>{f(!1),x==null||x(Y,n,b.type,ee)},Z=Y=>u==null?void 0:u(n,Y);Ro.onPointerDown(S.nativeEvent,{autoPanOnConnect:P,connectionMode:T,connectionRadius:A,domNode:v,handleId:b.id,nodeId:b.nodeId,nodeLookup:$,isTarget:z,edgeUpdaterType:b.type,lib:B,flowId:k,cancelConnection:C,panBy:D,isValidConnection:L,onConnect:Z,onConnectStart:N,onConnectEnd:O,onReconnectEnd:V,updateConnection:M,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle})},E=S=>y(S,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),R=S=>y(S,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>m(!0),w=()=>m(!1);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&i.jsxRuntimeExports.jsx(Pi,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:E,onMouseEnter:_,onMouseOut:w,type:"source"}),(e===!0||e==="target")&&i.jsxRuntimeExports.jsx(Pi,{position:a,centerX:r,centerY:l,radius:t,onMouseDown:R,onMouseEnter:_,onMouseOut:w,type:"target"})]})}function uS({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:o,onDoubleClick:r,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:u,reconnectRadius:d,onReconnect:x,onReconnectStart:f,onReconnectEnd:m,rfId:h,edgeTypes:y,noPanClassName:E,onError:R,disableKeyboardA11y:_}){let w=fe(te=>te.edgeLookup.get(e));const S=fe(te=>te.defaultEdgeOptions);w=S?{...S,...w}:w;let b=w.type||"default",P=(y==null?void 0:y[b])||vi[b];P===void 0&&(R==null||R("011",Te.error011(b)),b="default",P=vi.default);const v=!!(w.focusable||t&&typeof w.focusable>"u"),L=typeof x<"u"&&(w.reconnectable||n&&typeof w.reconnectable>"u"),T=!!(w.selectable||s&&typeof w.selectable>"u"),A=g.useRef(null),[B,N]=g.useState(!1),[O,C]=g.useState(!1),$=he(),{zIndex:k,sourceX:D,sourceY:M,targetX:z,targetY:V,sourcePosition:Z,targetPosition:Y}=fe(g.useCallback(te=>{const X=te.nodeLookup.get(w.source),se=te.nodeLookup.get(w.target);if(!X||!se)return{zIndex:w.zIndex,..._i};const pe=nE({id:e,sourceNode:X,targetNode:se,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:te.connectionMode,onError:R});return{zIndex:Ky({selected:w.selected,zIndex:w.zIndex,sourceNode:X,targetNode:se,elevateOnSelect:te.elevateEdgesOnSelect}),...pe||_i}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),Se),ee=g.useMemo(()=>w.markerStart?`url('#${Eo(w.markerStart,h)}')`:void 0,[w.markerStart,h]),K=g.useMemo(()=>w.markerEnd?`url('#${Eo(w.markerEnd,h)}')`:void 0,[w.markerEnd,h]);if(w.hidden||D===null||M===null||z===null||V===null)return null;const U=te=>{var Pe;const{addSelectedEdges:X,unselectNodesAndEdges:se,multiSelectionActive:pe}=$.getState();T&&($.setState({nodesSelectionActive:!1}),w.selected&&pe?(se({nodes:[],edges:[w]}),(Pe=A.current)==null||Pe.blur()):X([e])),o&&o(te,w)},Q=r?te=>{r(te,{...w})}:void 0,ne=l?te=>{l(te,{...w})}:void 0,W=c?te=>{c(te,{...w})}:void 0,ie=a?te=>{a(te,{...w})}:void 0,de=u?te=>{u(te,{...w})}:void 0,ae=te=>{var X;if(!_&&vc.includes(te.key)&&T){const{unselectNodesAndEdges:se,addSelectedEdges:pe}=$.getState();te.key==="Escape"?((X=A.current)==null||X.blur(),se({edges:[w]})):pe([e])}};return i.jsxRuntimeExports.jsx("svg",{style:{zIndex:k},children:i.jsxRuntimeExports.jsxs("g",{className:Ce(["react-flow__edge",`react-flow__edge-${b}`,w.className,E,{selected:w.selected,animated:w.animated,inactive:!T&&!o,updating:B,selectable:T}]),onClick:U,onDoubleClick:Q,onContextMenu:ne,onMouseEnter:W,onMouseMove:ie,onMouseLeave:de,onKeyDown:v?ae:void 0,tabIndex:v?0:void 0,role:v?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":v?`${ia}-${h}`:void 0,ref:A,children:[!O&&i.jsxRuntimeExports.jsx(P,{id:e,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:T,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:D,sourceY:M,targetX:z,targetY:V,sourcePosition:Z,targetPosition:Y,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:ee,markerEnd:K,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),L&&i.jsxRuntimeExports.jsx(aS,{edge:w,isReconnectable:L,reconnectRadius:d,onReconnect:x,onReconnectStart:f,onReconnectEnd:m,sourceX:D,sourceY:M,targetX:z,targetY:V,sourcePosition:Z,targetPosition:Y,setUpdateHover:N,setReconnecting:C})]})})}const dS=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function La({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:o,onReconnect:r,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:x,onEdgeDoubleClick:f,onReconnectStart:m,onReconnectEnd:h,disableKeyboardA11y:y}){const{edgesFocusable:E,edgesReconnectable:R,elementsSelectable:_,onError:w}=fe(dS,Se),S=q0(t);return i.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[i.jsxRuntimeExports.jsx(tS,{defaultColor:e,rfId:n}),S.map(b=>i.jsxRuntimeExports.jsx(uS,{id:b,edgesFocusable:E,edgesReconnectable:R,elementsSelectable:_,noPanClassName:o,onReconnect:r,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:u,onClick:d,reconnectRadius:x,onDoubleClick:f,onReconnectStart:m,onReconnectEnd:h,rfId:n,onError:w,edgeTypes:s,disableKeyboardA11y:y},b))]})}La.displayName="EdgeRenderer";const xS=g.memo(La),pS=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function fS({children:e}){const t=fe(pS);return i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function mS(e){const t=bt(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const hS=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function gS(e){const t=fe(hS),n=he();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function jS(e){return e.connection.inProgress?{...e.connection,to:Rn(e.connection.to,e.transform)}:{...e.connection}}function yS(e){return jS}function ES(e){const t=yS();return fe(t,Se)}const SS=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function RS({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:o,width:r,height:l,isValid:c,inProgress:a}=fe(SS,Se);return!(r&&o&&a)?null:i.jsxRuntimeExports.jsx("svg",{style:e,width:r,height:l,className:"react-flow__connectionline react-flow__container",children:i.jsxRuntimeExports.jsx("g",{className:Ce(["react-flow__connection",kc(c)]),children:i.jsxRuntimeExports.jsx(Ta,{style:t,type:n,CustomComponent:s,isValid:c})})})}const Ta=({style:e,type:t=rt.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:o,from:r,fromNode:l,fromHandle:c,fromPosition:a,to:u,toNode:d,toHandle:x,toPosition:f}=ES();if(!o)return;if(n)return i.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:r.x,fromY:r.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:f,connectionStatus:kc(s),toNode:d,toHandle:x});let m="";const h={sourceX:r.x,sourceY:r.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case rt.Bezier:[m]=Vc(h);break;case rt.SimpleBezier:[m]=Ea(h);break;case rt.Step:[m]=yo({...h,borderRadius:0});break;case rt.SmoothStep:[m]=yo(h);break;default:[m]=Gc(h)}return i.jsxRuntimeExports.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};Ta.displayName="ConnectionLine";const CS={};function Mi(e=CS){const t=g.useRef(e),n=he();g.useEffect(()=>{var s,o;if(process.env.NODE_ENV==="development"){const r=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const l of r)if(t.current[l]!==e[l]){(o=(s=n.getState()).onError)==null||o.call(s,"002",Te.error002());break}t.current=e}},[e])}function wS(){const e=he(),t=g.useRef(!1);g.useEffect(()=>{var n,s;if(process.env.NODE_ENV==="development"&&!t.current){const o=document.querySelector(".react-flow__pane");o&&window.getComputedStyle(o).zIndex!=="1"&&((s=(n=e.getState()).onError)==null||s.call(n,"013",Te.error013("react"))),t.current=!0}},[])}function Aa({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:o,onNodeDoubleClick:r,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:x,onSelectionStart:f,onSelectionEnd:m,connectionLineType:h,connectionLineStyle:y,connectionLineComponent:E,connectionLineContainerStyle:R,selectionKeyCode:_,selectionOnDrag:w,selectionMode:S,multiSelectionKeyCode:b,panActivationKeyCode:P,zoomActivationKeyCode:v,deleteKeyCode:L,onlyRenderVisibleElements:T,elementsSelectable:A,defaultViewport:B,translateExtent:N,minZoom:O,maxZoom:C,preventScrolling:$,defaultMarkerColor:k,zoomOnScroll:D,zoomOnPinch:M,panOnScroll:z,panOnScrollSpeed:V,panOnScrollMode:Z,zoomOnDoubleClick:Y,panOnDrag:ee,onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:Q,onPaneMouseLeave:ne,onPaneScroll:W,onPaneContextMenu:ie,paneClickDistance:de,nodeClickDistance:ae,onEdgeContextMenu:te,onEdgeMouseEnter:X,onEdgeMouseMove:se,onEdgeMouseLeave:pe,reconnectRadius:Pe,onReconnect:Xe,onReconnectStart:Ts,onReconnectEnd:As,noDragClassName:Wt,noWheelClassName:$s,noPanClassName:Xt,disableKeyboardA11y:Kt,nodeExtent:Is,rfId:qt,viewport:Ut,onViewportChange:wn}){return Mi(e),Mi(t),wS(),mS(n),gS(Ut),i.jsxRuntimeExports.jsx(V0,{onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:Q,onPaneMouseLeave:ne,onPaneContextMenu:ie,onPaneScroll:W,paneClickDistance:de,deleteKeyCode:L,selectionKeyCode:_,selectionOnDrag:w,selectionMode:S,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:b,panActivationKeyCode:P,zoomActivationKeyCode:v,elementsSelectable:A,zoomOnScroll:D,zoomOnPinch:M,zoomOnDoubleClick:Y,panOnScroll:z,panOnScrollSpeed:V,panOnScrollMode:Z,panOnDrag:ee,defaultViewport:B,translateExtent:N,minZoom:O,maxZoom:C,onSelectionContextMenu:x,preventScrolling:$,noDragClassName:Wt,noWheelClassName:$s,noPanClassName:Xt,disableKeyboardA11y:Kt,onViewportChange:wn,isControlledViewport:!!Ut,children:i.jsxRuntimeExports.jsxs(fS,{children:[i.jsxRuntimeExports.jsx(xS,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:Xe,onReconnectStart:Ts,onReconnectEnd:As,onlyRenderVisibleElements:T,onEdgeContextMenu:te,onEdgeMouseEnter:X,onEdgeMouseMove:se,onEdgeMouseLeave:pe,reconnectRadius:Pe,defaultMarkerColor:k,noPanClassName:Xt,disableKeyboardA11y:Kt,rfId:qt}),i.jsxRuntimeExports.jsx(RS,{style:y,type:h,component:E,containerStyle:R}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),i.jsxRuntimeExports.jsx(K0,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:r,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ae,onlyRenderVisibleElements:T,noPanClassName:Xt,noDragClassName:Wt,disableKeyboardA11y:Kt,nodeExtent:Is,rfId:qt}),i.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Aa.displayName="GraphView";const bS=g.memo(Aa),Ni=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a}={})=>{const u=new Map,d=new Map,x=new Map,f=new Map,m=s??t??[],h=n??e??[],y=c??[0,0],E=a??xn;Wc(x,f,m),So(h,u,d,{nodeOrigin:y,nodeExtent:E,elevateNodesOnSelect:!1});let R=[0,0,1];if(l&&o&&r){const _=Sn(u,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:w,y:S,zoom:b}=Jo(_,o,r,.5,2,.1);R=[w,S,b]}return{rfId:"1",width:0,height:0,transform:R,nodes:h,nodeLookup:u,parentLookup:d,edges:m,edgeLookup:f,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:xn,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Rt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{..._c},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:is,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},vS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a})=>GE((u,d)=>({...Ni({nodes:e,edges:t,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a,defaultNodes:n,defaultEdges:s}),setNodes:x=>{const{nodeLookup:f,parentLookup:m,nodeOrigin:h,elevateNodesOnSelect:y}=d();So(x,f,m,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:y,checkEquality:!0}),u({nodes:x})},setEdges:x=>{const{connectionLookup:f,edgeLookup:m}=d();Wc(f,m,x),u({edges:x})},setDefaultNodesAndEdges:(x,f)=>{if(x){const{setNodes:m}=d();m(x),u({hasDefaultNodes:!0})}if(f){const{setEdges:m}=d();m(f),u({hasDefaultEdges:!0})}},updateNodeInternals:(x,f={triggerFitView:!0})=>{const{triggerNodeChanges:m,nodeLookup:h,parentLookup:y,fitViewOnInit:E,fitViewDone:R,fitViewOnInitOptions:_,domNode:w,nodeOrigin:S,nodeExtent:b,debug:P,fitViewSync:v}=d(),{changes:L,updatedInternals:T}=cE(x,h,y,w,S,b);if(T){if(rE(h,y,{nodeOrigin:S,nodeExtent:b}),f.triggerFitView){let A=R;!R&&E&&(A=v({..._,nodes:_==null?void 0:_.nodes})),u({fitViewDone:A})}else u({});(L==null?void 0:L.length)>0&&(P&&console.log("React Flow: trigger node changes",L),m==null||m(L))}},updateNodePositions:(x,f=!1)=>{const m=[],h=[];for(const[y,E]of x){const R=!!(E!=null&&E.expandParent&&(E!=null&&E.parentId)&&(E!=null&&E.position)),_={id:y,type:"position",position:R?{x:Math.max(0,E.position.x),y:Math.max(0,E.position.y)}:E.position,dragging:f};R&&m.push({id:y,parentId:E.parentId,rect:{...E.internals.positionAbsolute,width:E.measured.width,height:E.measured.height}}),h.push(_)}if(m.length>0){const{nodeLookup:y,parentLookup:E,nodeOrigin:R}=d(),_=sr(m,y,E,R);h.push(..._)}d().triggerNodeChanges(h)},triggerNodeChanges:x=>{const{onNodesChange:f,setNodes:m,nodes:h,hasDefaultNodes:y,debug:E}=d();if(x!=null&&x.length){if(y){const R=aa(x,h);m(R)}E&&console.log("React Flow: trigger node changes",x),f==null||f(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:f,setEdges:m,edges:h,hasDefaultEdges:y,debug:E}=d();if(x!=null&&x.length){if(y){const R=ua(x,h);m(R)}E&&console.log("React Flow: trigger edge changes",x),f==null||f(x)}},addSelectedNodes:x=>{const{multiSelectionActive:f,edgeLookup:m,nodeLookup:h,triggerNodeChanges:y,triggerEdgeChanges:E}=d();if(f){const R=x.map(_=>mt(_,!0));y(R);return}y(Nt(h,new Set([...x]),!0)),E(Nt(m))},addSelectedEdges:x=>{const{multiSelectionActive:f,edgeLookup:m,nodeLookup:h,triggerNodeChanges:y,triggerEdgeChanges:E}=d();if(f){const R=x.map(_=>mt(_,!0));E(R);return}E(Nt(m,new Set([...x]))),y(Nt(h,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:f}={})=>{const{edges:m,nodes:h,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:R}=d(),_=x||h,w=f||m,S=_.map(P=>{const v=y.get(P.id);return v&&(v.selected=!1),mt(P.id,!1)}),b=w.map(P=>mt(P.id,!1));E(S),R(b)},setMinZoom:x=>{const{panZoom:f,maxZoom:m}=d();f==null||f.setScaleExtent([x,m]),u({minZoom:x})},setMaxZoom:x=>{const{panZoom:f,minZoom:m}=d();f==null||f.setScaleExtent([m,x]),u({maxZoom:x})},setTranslateExtent:x=>{var f;(f=d().panZoom)==null||f.setTranslateExtent(x),u({translateExtent:x})},setPaneClickDistance:x=>{var f;(f=d().panZoom)==null||f.setClickDistance(x)},resetSelectedElements:()=>{const{edges:x,nodes:f,triggerNodeChanges:m,triggerEdgeChanges:h}=d(),y=f.reduce((R,_)=>_.selected?[...R,mt(_.id,!1)]:R,[]),E=x.reduce((R,_)=>_.selected?[...R,mt(_.id,!1)]:R,[]);m(y),h(E)},setNodeExtent:x=>{const{nodes:f,nodeLookup:m,parentLookup:h,nodeOrigin:y,elevateNodesOnSelect:E,nodeExtent:R}=d();x[0][0]===R[0][0]&&x[0][1]===R[0][1]&&x[1][0]===R[1][0]&&x[1][1]===R[1][1]||(So(f,m,h,{nodeOrigin:y,nodeExtent:x,elevateNodesOnSelect:E,checkEquality:!1}),u({nodeExtent:x}))},panBy:x=>{const{transform:f,width:m,height:h,panZoom:y,translateExtent:E}=d();return aE({delta:x,panZoom:y,transform:f,translateExtent:E,width:m,height:h})},fitView:x=>{const{panZoom:f,width:m,height:h,minZoom:y,maxZoom:E,nodeLookup:R}=d();if(!f)return Promise.resolve(!1);const _=mo(R,x);return ho({nodes:_,width:m,height:h,panZoom:f,minZoom:y,maxZoom:E},x)},fitViewSync:x=>{const{panZoom:f,width:m,height:h,minZoom:y,maxZoom:E,nodeLookup:R}=d();if(!f)return!1;const _=mo(R,x);return ho({nodes:_,width:m,height:h,panZoom:f,minZoom:y,maxZoom:E},x),_.size>0},cancelConnection:()=>{u({connection:{..._c}})},updateConnection:x=>{u({connection:x})},reset:()=>u({...Ni()})}),Object.is);function $a({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:o,initialHeight:r,fitView:l,nodeOrigin:c,nodeExtent:a,children:u}){const[d]=g.useState(()=>vS({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:r,fitView:l,nodeOrigin:c,nodeExtent:a}));return i.jsxRuntimeExports.jsx(YE,{value:d,children:i.jsxRuntimeExports.jsx(m0,{children:u})})}function _S({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:o,width:r,height:l,fitView:c,nodeOrigin:a,nodeExtent:u}){return g.useContext(_s)?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:e}):i.jsxRuntimeExports.jsx($a,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:o,initialWidth:r,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:u,children:e})}const kS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function PS({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:o,nodeTypes:r,edgeTypes:l,onNodeClick:c,onEdgeClick:a,onInit:u,onMove:d,onMoveStart:x,onMoveEnd:f,onConnect:m,onConnectStart:h,onConnectEnd:y,onClickConnectStart:E,onClickConnectEnd:R,onNodeMouseEnter:_,onNodeMouseMove:w,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:P,onNodeDragStart:v,onNodeDrag:L,onNodeDragStop:T,onNodesDelete:A,onEdgesDelete:B,onDelete:N,onSelectionChange:O,onSelectionDragStart:C,onSelectionDrag:$,onSelectionDragStop:k,onSelectionContextMenu:D,onSelectionStart:M,onSelectionEnd:z,onBeforeDelete:V,connectionMode:Z,connectionLineType:Y=rt.Bezier,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:U,deleteKeyCode:Q="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:ie=Dt.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:ae=ls()?"Meta":"Control",zoomActivationKeyCode:te=ls()?"Meta":"Control",snapToGrid:X,snapGrid:se,onlyRenderVisibleElements:pe=!1,selectNodesOnDrag:Pe,nodesDraggable:Xe,nodesConnectable:Ts,nodesFocusable:As,nodeOrigin:Wt=la,edgesFocusable:$s,edgesReconnectable:Xt,elementsSelectable:Kt=!0,defaultViewport:Is=r0,minZoom:qt=.5,maxZoom:Ut=2,translateExtent:wn=xn,preventScrolling:Kd=!0,nodeExtent:Ds,defaultMarkerColor:qd="#b1b1b7",zoomOnScroll:Ud=!0,zoomOnPinch:Qd=!0,panOnScroll:Jd=!1,panOnScrollSpeed:ex=.5,panOnScrollMode:tx=jt.Free,zoomOnDoubleClick:nx=!0,panOnDrag:sx=!0,onPaneClick:ox,onPaneMouseEnter:rx,onPaneMouseMove:ix,onPaneMouseLeave:lx,onPaneScroll:cx,onPaneContextMenu:ax,paneClickDistance:xr=0,nodeClickDistance:ux=0,children:dx,onReconnect:xx,onReconnectStart:px,onReconnectEnd:fx,onEdgeContextMenu:mx,onEdgeDoubleClick:hx,onEdgeMouseEnter:gx,onEdgeMouseMove:jx,onEdgeMouseLeave:yx,reconnectRadius:Ex=10,onNodesChange:Sx,onEdgesChange:Rx,noDragClassName:Cx="nodrag",noWheelClassName:wx="nowheel",noPanClassName:pr="nopan",fitView:fr,fitViewOptions:bx,connectOnClick:vx,attributionPosition:_x,proOptions:kx,defaultEdgeOptions:Px,elevateNodesOnSelect:Mx,elevateEdgesOnSelect:Nx,disableKeyboardA11y:mr=!1,autoPanOnConnect:Lx,autoPanOnNodeDrag:Tx,autoPanSpeed:Ax,connectionRadius:$x,isValidConnection:Ix,onError:Dx,style:Ox,id:hr,nodeDragThreshold:zx,viewport:Bx,onViewportChange:Vx,width:Fx,height:Hx,colorMode:Zx="light",debug:Gx,...Yx},Wx){const Os=hr||"1",Xx=a0(Zx);return i.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...Yx,style:{...Ox,...kS},ref:Wx,className:Ce(["react-flow",o,Xx]),id:hr,children:i.jsxRuntimeExports.jsxs(_S,{nodes:e,edges:t,width:Fx,height:Hx,fitView:fr,nodeOrigin:Wt,nodeExtent:Ds,children:[i.jsxRuntimeExports.jsx(bS,{onInit:u,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:_,onNodeMouseMove:w,onNodeMouseLeave:S,onNodeContextMenu:b,onNodeDoubleClick:P,nodeTypes:r,edgeTypes:l,connectionLineType:Y,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:U,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:ie,deleteKeyCode:Q,multiSelectionKeyCode:ae,panActivationKeyCode:de,zoomActivationKeyCode:te,onlyRenderVisibleElements:pe,defaultViewport:Is,translateExtent:wn,minZoom:qt,maxZoom:Ut,preventScrolling:Kd,zoomOnScroll:Ud,zoomOnPinch:Qd,zoomOnDoubleClick:nx,panOnScroll:Jd,panOnScrollSpeed:ex,panOnScrollMode:tx,panOnDrag:sx,onPaneClick:ox,onPaneMouseEnter:rx,onPaneMouseMove:ix,onPaneMouseLeave:lx,onPaneScroll:cx,onPaneContextMenu:ax,paneClickDistance:xr,nodeClickDistance:ux,onSelectionContextMenu:D,onSelectionStart:M,onSelectionEnd:z,onReconnect:xx,onReconnectStart:px,onReconnectEnd:fx,onEdgeContextMenu:mx,onEdgeDoubleClick:hx,onEdgeMouseEnter:gx,onEdgeMouseMove:jx,onEdgeMouseLeave:yx,reconnectRadius:Ex,defaultMarkerColor:qd,noDragClassName:Cx,noWheelClassName:wx,noPanClassName:pr,rfId:Os,disableKeyboardA11y:mr,nodeExtent:Ds,viewport:Bx,onViewportChange:Vx}),i.jsxRuntimeExports.jsx(c0,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:m,onConnectStart:h,onConnectEnd:y,onClickConnectStart:E,onClickConnectEnd:R,nodesDraggable:Xe,nodesConnectable:Ts,nodesFocusable:As,edgesFocusable:$s,edgesReconnectable:Xt,elementsSelectable:Kt,elevateNodesOnSelect:Mx,elevateEdgesOnSelect:Nx,minZoom:qt,maxZoom:Ut,nodeExtent:Ds,onNodesChange:Sx,onEdgesChange:Rx,snapToGrid:X,snapGrid:se,connectionMode:Z,translateExtent:wn,connectOnClick:vx,defaultEdgeOptions:Px,fitView:fr,fitViewOptions:bx,onNodesDelete:A,onEdgesDelete:B,onDelete:N,onNodeDragStart:v,onNodeDrag:L,onNodeDragStop:T,onSelectionDrag:$,onSelectionDragStart:C,onSelectionDragStop:k,onMove:d,onMoveStart:x,onMoveEnd:f,noPanClassName:pr,nodeOrigin:Wt,rfId:Os,autoPanOnConnect:Lx,autoPanOnNodeDrag:Tx,autoPanSpeed:Ax,onError:Dx,connectionRadius:$x,isValidConnection:Ix,selectNodesOnDrag:Pe,nodeDragThreshold:zx,onBeforeDelete:V,paneClickDistance:xr,debug:Gx}),i.jsxRuntimeExports.jsx(o0,{onSelectionChange:O}),dx,i.jsxRuntimeExports.jsx(JE,{proOptions:kx,position:_x}),i.jsxRuntimeExports.jsx(UE,{rfId:Os,disableKeyboardA11y:mr})]})})}var MS=da(PS);function NS(){const e=he();return g.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),o=Array.isArray(t)?t:[t],r=new Map;o.forEach(l=>{const c=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${l}"]`);c&&r.set(l,{id:l,nodeElement:c,force:!0})}),requestAnimationFrame(()=>s(r,{triggerFitView:!1}))},[])}function LS({onStart:e,onChange:t,onEnd:n}){const s=he();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function TS({dimensions:e,lineWidth:t,variant:n,className:s}){return i.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ce(["react-flow__background-pattern",n,s])})}function AS({radius:e,className:t}){return i.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Ce(["react-flow__background-pattern","dots",t])})}var ct;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ct||(ct={}));const $S={[ct.Dots]:1,[ct.Lines]:1,[ct.Cross]:6},IS=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ia({id:e,variant:t=ct.Dots,gap:n=20,size:s,lineWidth:o=1,offset:r=0,color:l,bgColor:c,style:a,className:u,patternClassName:d}){const x=g.useRef(null),{transform:f,patternId:m}=fe(IS,Se),h=s||$S[t],y=t===ct.Dots,E=t===ct.Cross,R=Array.isArray(n)?n:[n,n],_=[R[0]*f[2]||1,R[1]*f[2]||1],w=h*f[2],S=Array.isArray(r)?r:[r,r],b=E?[w,w]:_,P=[S[0]*f[2]||1+b[0]/2,S[1]*f[2]||1+b[1]/2],v=`${m}${e||""}`;return i.jsxRuntimeExports.jsxs("svg",{className:Ce(["react-flow__background",u]),style:{...a,...ks,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:x,"data-testid":"rf__background",children:[i.jsxRuntimeExports.jsx("pattern",{id:v,x:f[0]%_[0],y:f[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`,children:y?i.jsxRuntimeExports.jsx(AS,{radius:w/2,className:d}):i.jsxRuntimeExports.jsx(TS,{dimensions:b,lineWidth:o,variant:t,className:d})}),i.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${v})`})]})}Ia.displayName="Background";const DS=g.memo(Ia);function OS(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:i.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function zS(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:i.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function BS(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:i.jsxRuntimeExports.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function VS(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function FS(){return i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:i.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function An({children:e,className:t,...n}){return i.jsxRuntimeExports.jsx("button",{type:"button",className:Ce(["react-flow__controls-button",t]),...n,children:e})}const HS=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Da({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:r,onZoomOut:l,onFitView:c,onInteractiveChange:a,className:u,children:d,position:x="bottom-left",orientation:f="vertical","aria-label":m="React Flow controls"}){const h=he(),{isInteractive:y,minZoomReached:E,maxZoomReached:R}=fe(HS,Se),{zoomIn:_,zoomOut:w,fitView:S}=bt(),b=()=>{_(),r==null||r()},P=()=>{w(),l==null||l()},v=()=>{S(o),c==null||c()},L=()=>{h.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),a==null||a(!y)},T=f==="horizontal"?"horizontal":"vertical";return i.jsxRuntimeExports.jsxs(or,{className:Ce(["react-flow__controls",T,u]),position:x,style:e,"data-testid":"rf__controls","aria-label":m,children:[t&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(An,{onClick:b,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:R,children:i.jsxRuntimeExports.jsx(OS,{})}),i.jsxRuntimeExports.jsx(An,{onClick:P,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:E,children:i.jsxRuntimeExports.jsx(zS,{})})]}),n&&i.jsxRuntimeExports.jsx(An,{className:"react-flow__controls-fitview",onClick:v,title:"fit view","aria-label":"fit view",children:i.jsxRuntimeExports.jsx(BS,{})}),s&&i.jsxRuntimeExports.jsx(An,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity",children:y?i.jsxRuntimeExports.jsx(FS,{}):i.jsxRuntimeExports.jsx(VS,{})}),d]})}Da.displayName="Controls";g.memo(Da);function ZS({id:e,x:t,y:n,width:s,height:o,style:r,color:l,strokeColor:c,strokeWidth:a,className:u,borderRadius:d,shapeRendering:x,selected:f,onClick:m}){const{background:h,backgroundColor:y}=r||{},E=l||h||y;return i.jsxRuntimeExports.jsx("rect",{className:Ce(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:d,ry:d,width:s,height:o,style:{fill:E,stroke:c,strokeWidth:a},shapeRendering:x,onClick:m?R=>m(R,e):void 0})}const GS=g.memo(ZS),YS=e=>e.nodes.map(t=>t.id),Js=e=>e instanceof Function?e:()=>e;function WS({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:r=GS,onClick:l}){const c=fe(YS,Se),a=Js(t),u=Js(e),d=Js(n),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:c.map(f=>i.jsxRuntimeExports.jsx(KS,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:r,onClick:l,shapeRendering:x},f))})}function XS({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:o,nodeStrokeWidth:r,shapeRendering:l,NodeComponent:c,onClick:a}){const{node:u,x:d,y:x,width:f,height:m}=fe(h=>{const y=h.nodeLookup.get(e),{x:E,y:R}=y.internals.positionAbsolute,{width:_,height:w}=tt(y);return{node:y,x:E,y:R,width:_,height:w}},Se);return!u||u.hidden||!Ic(u)?null:i.jsxRuntimeExports.jsx(c,{x:d,y:x,width:f,height:m,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:r,shapeRendering:l,onClick:a,id:u.id})}const KS=g.memo(XS);var qS=g.memo(WS);const US=200,QS=150,JS=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?Ac(Sn(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},e1="react-flow__minimap-desc";function Oa({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:o="",nodeBorderRadius:r=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:a,maskColor:u,maskStrokeColor:d,maskStrokeWidth:x,position:f="bottom-right",onClick:m,onNodeClick:h,pannable:y=!1,zoomable:E=!1,ariaLabel:R="React Flow mini map",inversePan:_,zoomStep:w=10,offsetScale:S=5}){const b=he(),P=g.useRef(null),{boundingRect:v,viewBB:L,rfId:T,panZoom:A,translateExtent:B,flowWidth:N,flowHeight:O}=fe(JS,Se),C=(e==null?void 0:e.width)??US,$=(e==null?void 0:e.height)??QS,k=v.width/C,D=v.height/$,M=Math.max(k,D),z=M*C,V=M*$,Z=S*M,Y=v.x-(z-v.width)/2-Z,ee=v.y-(V-v.height)/2-Z,K=z+Z*2,U=V+Z*2,Q=`${e1}-${T}`,ne=g.useRef(0),W=g.useRef();ne.current=M,g.useEffect(()=>{if(P.current&&A)return W.current=gE({domNode:P.current,panZoom:A,getTransform:()=>b.getState().transform,getViewScale:()=>ne.current}),()=>{var ae;(ae=W.current)==null||ae.destroy()}},[A]),g.useEffect(()=>{var ae;(ae=W.current)==null||ae.update({translateExtent:B,width:N,height:O,inversePan:_,pannable:y,zoomStep:w,zoomable:E})},[y,E,_,w,B,N,O]);const ie=m?ae=>{var se;const[te,X]=((se=W.current)==null?void 0:se.pointer(ae))||[0,0];m(ae,{x:te,y:X})}:void 0,de=h?g.useCallback((ae,te)=>{const X=b.getState().nodeLookup.get(te);h(ae,X)},[]):void 0;return i.jsxRuntimeExports.jsx(or,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*M:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="string"?l:void 0},className:Ce(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:i.jsxRuntimeExports.jsxs("svg",{width:C,height:$,viewBox:`${Y} ${ee} ${K} ${U}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Q,ref:P,onClick:ie,children:[R&&i.jsxRuntimeExports.jsx("title",{id:Q,children:R}),i.jsxRuntimeExports.jsx(qS,{onClick:de,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:r,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),i.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${Y-Z},${ee-Z}h${K+Z*2}v${U+Z*2}h${-K-Z*2}z
39
- M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Oa.displayName="MiniMap";g.memo(Oa);function t1({nodeId:e,position:t,variant:n=on.Handle,className:s,style:o={},children:r,color:l,minWidth:c=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:x=!1,shouldResize:f,onResizeStart:m,onResize:h,onResizeEnd:y}){const E=ma(),R=typeof e=="string"?e:E,_=he(),w=g.useRef(null),S=n===on.Line?"right":"bottom-right",b=t??S,P=g.useRef(null);g.useEffect(()=>{if(!(!w.current||!R))return P.current||(P.current=LE({domNode:w.current,nodeId:R,getStoreItems:()=>{const{nodeLookup:A,transform:B,snapGrid:N,snapToGrid:O,nodeOrigin:C,domNode:$}=_.getState();return{nodeLookup:A,transform:B,snapGrid:N,snapToGrid:O,nodeOrigin:C,paneDomNode:$}},onChange:(A,B)=>{const{triggerNodeChanges:N,nodeLookup:O,parentLookup:C,nodeOrigin:$}=_.getState(),k=[],D={x:A.x,y:A.y},M=O.get(R);if(M&&M.expandParent&&M.parentId){const z=M.origin??$,V=A.width??M.measured.width,Z=A.height??M.measured.height,Y={id:M.id,parentId:M.parentId,rect:{width:V,height:Z,...Dc({x:A.x??M.position.x,y:A.y??M.position.y},{width:V,height:Z},M.parentId,O,z)}},ee=sr([Y],O,C,$);k.push(...ee),D.x=A.x?Math.max(z[0]*V,A.x):void 0,D.y=A.y?Math.max(z[1]*Z,A.y):void 0}if(D.x!==void 0&&D.y!==void 0){const z={id:R,type:"position",position:{...D}};k.push(z)}if(A.width!==void 0&&A.height!==void 0){const z={id:R,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:A.width,height:A.height}};k.push(z)}for(const z of B){const V={...z,type:"position"};k.push(V)}N(k)},onEnd:()=>{const A={id:R,type:"dimensions",resizing:!1};_.getState().triggerNodeChanges([A])}})),P.current.update({controlPosition:b,boundaries:{minWidth:c,minHeight:a,maxWidth:u,maxHeight:d},keepAspectRatio:x,onResizeStart:m,onResize:h,onResizeEnd:y,shouldResize:f}),()=>{var A;(A=P.current)==null||A.destroy()}},[b,c,a,u,d,x,m,h,y,f]);const v=b.split("-"),L=n===on.Line?"borderColor":"backgroundColor",T=l?{...o,[L]:l}:o;return i.jsxRuntimeExports.jsx("div",{className:Ce(["react-flow__resize-control","nodrag",...v,n,s]),ref:w,style:T,children:r})}g.memo(t1);const n1=(e,t)=>e.map((n,s)=>p.G.translate(n,t[s])),za=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:p.cssString(t)},...n}),s1=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:p.cssString(t),strokeDasharray:"12,4"},...n}),o1=({points:e,color:t,...n})=>i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:p.cssString(t),strokeDasharray:"12,4,4"},...n}),r1=({points:e,color:t,...n})=>{const s=p.G.calculateMiters(e,6),o=e.map((a,u)=>p.G.translate(a,s[u])),r=e.map((a,u)=>p.G.translate(a,p.G.scale(s[u],-1))),l=p.cssString(t),c=.7;return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(ze,{path:at(o),style:{stroke:l,opacity:c},...n}),i.jsxRuntimeExports.jsx(ze,{path:at(e),style:{stroke:l},...n}),i.jsxRuntimeExports.jsx(ze,{path:at(r),style:{stroke:l,opacity:c},...n})]})},Li=15,i1=(e,t)=>{const n=[],s=[];for(let c=0;c<e.length-1;c++){const a=p.G.distance(e[c],e[c+1]);s.push(a)}const o=t;let r=0,l=o;for(let c=0;c<s.length;c++){const a=s[c],u=e[c],d=e[c+1];for(;r+a>=l;){const x=(l-r)/a,f={x:u.x+x*(d.x-u.x),y:u.y+x*(d.y-u.y)};let m="x";Math.abs(d.x-u.x)<1&&(m="y"),l+=o,!(p.G.distance(f,d)<Li||p.G.distance(f,u)<Li)&&n.push({position:f,direction:m})}r+=a}return n},l1=({color:e,position:t,direction:n})=>{const o="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,i.jsxRuntimeExports.jsx("path",{d:o,stroke:p.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},c1=({color:e,position:t,direction:n})=>{const o="M0,0 L0,-10";n==="x"?t.y+=10/3:t.x-=10/3;let r=p.G.translateX(t,-10),l=45;return n==="y"&&(r=p.G.translateY(t,-10),l+=90),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("path",{d:o,stroke:p.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx("path",{d:o,stroke:p.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${r.x},${r.y}) rotate(${l})`,strokeLinecap:"round"})]})},a1=({color:e,position:t})=>i.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:p.cssString(e),strokeWidth:2}),ir=e=>{const t=({points:n,color:s,...o})=>{const r=at(n),l=i1(n,40);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(ze,{path:r,...o,color:p.cssString(s)}),l.map(({position:c,direction:a},u)=>i.jsxRuntimeExports.jsx(e,{position:c,direction:a,color:s},u))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},u1=ir(l1),d1=ir(c1),x1=ir(a1),at=e=>{let t="";const s=e.length+-1;for(let o=0;o<s;o++){const r=e[o%e.length],l=e[(o+1)%e.length],c=Math.min(6/Math.hypot(l.x-r.x,l.y-r.y),.5);o>0&&(t+=`Q${r.x},${r.y} ${r.x*(1-c)+l.x*c},${r.y*(1-c)+l.y*c}`),o===0?t+=`M${r.x},${r.y}`:o===0&&(t+=`M${r.x*(1-c)+l.x*c},${r.y*(1-c)+l.y*c}`),o===s-1?t+=`L${l.x},${l.y}`:o<s-1&&(t+=`L${r.x*c+l.x*(1-c)},${r.y*c+l.y*(1-c)}`)}return t},Ba={pipe:za,electric:s1,secondary:o1,jacketed:r1,hydraulic:u1,pneumatic:d1,data:x1},Va=za,Fa=[{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"}],p1=e=>i.jsxRuntimeExports.jsx(Re.DropdownButton,{columns:[{key:"name",name:"Type"}],data:Fa,style:{width:200},entryRenderKey:"name",...e}),Ps=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Ne=(e,t)=>{const n=Ps(t),s=e.getNodes().find(o=>o.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return p.Eo.construct(s.position,p._.scale(p.Eo.dims(p.Eo.construct(n)),1/e.getZoom()))},f1=(e,t)=>Ms.fromFlow(e,t);class Ha{constructor(t,n){Fe(this,"node_",null);Fe(this,"position");Fe(this,"orientation");this.position=t,this.orientation=n}set node(t){this.node_=t}get node(){if(this.node_==null)throw new Error("[schematic] - handle has no node");return this.node_}get absolutePosition(){return p.G.translate(p.Eo.topLeft(this.node.box),this.position)}}class Ms{constructor(t,n,s){Fe(this,"key");Fe(this,"box");Fe(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(o=>o.node=this)}static fromFlow(t,n){const s=Ne(n,t),o=Ps(t),r=o.getElementsByClassName("react-flow__handle"),l=p.Eo.construct(o),c=Array.from(r).map(a=>{const u=p.Eo.center(p.Eo.construct(a)),d=p.G.translation(p.Eo.topLeft(l),u),x=a.className.match(/react-flow__handle-(\w+)/);if(x==null)throw new Error("[schematic] - cannot find handle orientation");const f=p.K.construct(x[0]);return new Ha(d,f)});return new Ms(t,s,c)}}const m1=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:o,toPosition:r,fromNode:l,connectionLineStyle:c,connectionStatus:a})=>{const u=document.querySelector(".react-flow__handle-connecting"),d=u==null?void 0:u.className.match(/react-flow__handle-(\w+)/);if(d!=null){const h=p.K.outer.safeParse(d[1]);h.success&&(r=h.data)}const x=bt(),f=Pt({sourcePos:p.G.construct(e,t),targetPos:p.G.construct(n,s),sourceOrientation:o,targetOrientation:r,sourceBox:Ne(x,(l==null?void 0:l.id)??""),targetBox:Ne(x,(l==null?void 0:l.id)??"")}),m=Xl(p.G.construct(e,t),f,x.getZoom(),!1);return i.jsxRuntimeExports.jsx(Va,{points:m,style:{...c,stroke:p.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},h1=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:o,targetPosition:r,style:l,segments:c=[],onSegmentsChange:a,color:u="var(--pluto-gray-l9)",selected:d=!1,variant:x="pipe",...f})=>{const m=p.G.construct(f.sourceX,f.sourceY),h=g.useRef(m),y=p.G.equals(m,h.current),E=p.G.construct(f.targetX,f.targetY),R=g.useRef(E),_=p.G.equals(E,R.current),w=bt(),[S,b,P]=j.useCombinedStateAndRef(()=>c.length>0?c:Pt({sourcePos:m,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(w,t),targetBox:Ne(w,n)})),v=g.useRef(r),L=g.useRef(s),T=j.useDebouncedCallback(a,100,[a]);if(!y||!_){let C=S;const $=p.G.translation(h.current,m),k=p.G.translation(E,R.current);p.G.equals($,p.G.scale(k,-1),.001)?(h.current=m,R.current=E):(y?_||(C=$h({delta:k,segments:C}),v.current!==r&&(v.current=r,C=Pt({sourcePos:m,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(w,t),targetBox:Ne(w,n)})),Nr({sourcePos:m,targetPos:E,next:C,prev:S})||(C=Pt({sourcePos:m,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(w,t),targetBox:Ne(w,n)})),R.current=E):(C=Ah({delta:$,segments:C}),L.current!==s&&(L.current=s,C=Pt({sourcePos:m,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(w,t),targetBox:Ne(w,n)})),Nr({sourcePos:m,targetPos:E,next:C,prev:S})||(C=Pt({sourcePos:m,targetPos:E,sourceOrientation:s,targetOrientation:r,sourceBox:Ne(w,t),targetBox:Ne(w,n)})),h.current=m),T(C),b(C))}const A=g.useRef(null),B=j.useCursorDrag({onStart:g.useCallback((C,$,k)=>{A.current={index:Number(k.currentTarget.id.split("-")[1]),segments:[...P.current]}},[]),onMove:g.useCallback(C=>{if(A.current==null)return;const $=Mh({segments:A.current.segments,index:A.current.index,magnitude:p.Eo.dim(C,p.g.swap(A.current.segments[A.current.index].direction),!0)/w.getZoom()});b($)},[]),onEnd:g.useCallback(()=>a(P.current),[a])}),N=Xl(m,S,w.getZoom(),!0),O=Ba[x];return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(O,{points:N,color:u}),d&&g1(N).map((C,$)=>{const k=S[$].direction,D=p.g.swap(k),M={[p.g.dimension(k)]:"18px",[p.g.dimension(D)]:"4px"},z={[k]:C[k]-9,[D]:C[D]-2};return i.jsxRuntimeExports.jsxs(g.Fragment,{children:[i.jsxRuntimeExports.jsx("rect",{className:p.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...M,...z,rx:"2px",ry:"2px"}),i.jsxRuntimeExports.jsx("foreignObject",{x:C.x-9,y:C.y-9,width:"18px",height:"18px",children:i.jsxRuntimeExports.jsx("div",{id:`handle-${$}`,className:p.CSS(p.CSS.BE("diagram-edge-handle","dragger"),p.CSS.dir(k)),draggable:!0,onDragStart:B})})]},$)})]})},g1=e=>e.slice(1).map((t,n)=>{const s=e[n];return p.G.construct((t.x+s.x)/2,(t.y+s.y)/2)}),j1=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:p.G.ZERO,zoom:1}})=>{const[o,r]=g.useState(n),[l,c]=g.useState(e),[a,u]=g.useState(t),[d,x]=g.useState(s),[f,m]=g.useState(!1);return{viewport:d,onViewportChange:x,edges:a,nodes:l,onNodesChange:c,onEdgesChange:u,editable:o,onEditableChange:r,fitViewOnResize:f,setFitViewOnResize:m}},y1=()=>!0,E1={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},S1={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},Za={maxZoom:1,minZoom:.5},R1={hideAttribution:!0},Ga=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),Cn=()=>g.useContext(Ga),Ya=g.memo(({children:e})=>{const{registerNodeRenderer:t}=Cn();return g.useEffect(()=>t(e),[t,e]),null});Ya.displayName="NodeRenderer";const C1=["Backspace","Delete"],w1=j.wrap$1(I.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:s,nodes:o,edges:r,onEditableChange:l,editable:c,viewport:a,triggers:u,onViewportChange:d,fitViewOnResize:x,setFitViewOnResize:f,visible:m,...h})=>{const y=j.useMemoDeepEqualProps({visible:m}),[{path:E},,R]=j.use$3({aetherKey:e,type:I.Diagram$1.TYPE,schema:I.diagramStateZ,initialState:{position:a.position,region:p.Eo.ZERO,zoom:a.zoom,...y}});g.useEffect(()=>R(X=>({...X,...y})),[y]);const _=j.use().colors.gray.l9.hex,w=j.useMemoCompare(()=>u??To.zoom,j.compareModeConfigs,[u]),{fitView:S}=bt(),b=j.useDebouncedCallback(X=>S(X),50,[S]),P=gn(g.useCallback(X=>{x&&b({maxZoom:1}),R(se=>({...se,region:X}))},[R,b,x])),v=g.useRef(null),L=g.useCallback(X=>{const se=v.current;se!=null&&se.x===X.x&&se.y===X.y&&se.zoom===X.zoom||(v.current=X,!(isNaN(X.x)||isNaN(X.y)||isNaN(X.zoom))&&(R(pe=>({...pe,position:X,zoom:X.zoom})),d(ec(X))))},[R,d]);LS({onStart:L,onChange:L,onEnd:L});const[T,A]=g.useState(()=>()=>null),B=g.useCallback(X=>A(()=>X),[]),N=g.useMemo(()=>({custom:({id:X,positionAbsoluteX:se,positionAbsoluteY:pe,selected:Pe=!1,draggable:Xe=!0})=>T({symbolKey:X,position:{x:se,y:pe},selected:Pe,draggable:Xe})}),[T]),O=g.useRef(r),C=g.useMemo(()=>(O.current=r,Yo(r)),[r]),$=g.useRef(o),k=g.useMemo(()=>($.current=o,Go(o)),[o]),D=g.useCallback(X=>n(tc($.current,se=>aa(X,se)),X),[n]),M=g.useCallback(X=>s(zn(O.current,se=>ua(X,se),_)),[s,_]),z=g.useCallback((X,se)=>s(zn(O.current,pe=>Qy(X,se,pe),_)),[]),V=g.useCallback(X=>s(zn(O.current,se=>Zc(X,se),_)),[s,_]),Z=g.useCallback((X,se)=>{const pe=[...O.current],Pe=pe.findIndex(Xe=>Xe.key===X);Pe!==-1&&(pe[Pe]={...pe[Pe],segments:se},O.current=pe,s(pe))},[s]),Y=c?E1:S1,ee=j.useSyncedRef(Z),K=g.useMemo(()=>({default:X=>{var se,pe,Pe;return i.jsxRuntimeExports.jsx(h1,{...X,segments:((se=X.data)==null?void 0:se.segments)??[],color:(pe=X.data)==null?void 0:pe.color,variant:(Pe=X.data)==null?void 0:Pe.variant,onSegmentsChange:g.useCallback(Xe=>ee.current(X.id,Xe),[X.id])},X.id)}}),[]),U=j.useHeld({triggers:[["Q"]],loose:!0}),Q=g.useRef(null);j.use$1({triggers:w.zoomReset,callback:g.useCallback(({stage:X,cursor:se})=>{const pe=Q.current;pe==null||X!=="start"||!p.Eo.contains(pe,se)||S()},[S])});const ne=j.purgeMouse(w.select)[0]??null,W=j.purgeMouse(w.pan)[0]??null,ie=j.purgeMouse(w.zoom)[0]??null,de={selectionOnDrag:ne==null,panOnDrag:W==null,selectionKeyCode:ne,panActivationKeyCode:W,zoomActivationKeyCode:ie},ae=j.useCombinedRefs(Q,P),te=g.useMemo(()=>({visible:m,editable:c,onEditableChange:l,registerNodeRenderer:B,fitViewOnResize:x,setFitViewOnResize:f}),[c,m,l,B,x]);return i.jsxRuntimeExports.jsx(Ga.Provider,{value:te,children:i.jsxRuntimeExports.jsx(j.Composite,{path:E,children:m&&i.jsxRuntimeExports.jsx(MS,{...de,className:p.CSS(p.CSS.B("diagram"),p.CSS.editable(c)),nodes:k,edges:C,nodeTypes:N,edgeTypes:K,ref:ae,fitView:!0,onNodesChange:D,onEdgesChange:M,onConnect:V,onReconnect:z,defaultViewport:Jl(a),connectionLineComponent:m1,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:y1,connectionMode:Rt.Loose,fitViewOptions:Za,selectionMode:Dt.Partial,proOptions:R1,deleteKeyCode:C1,...h,style:{[p.CSS.var("diagram-zoom")]:a.zoom,...h.style},...Y,nodesDraggable:c&&!U.held,children:t})})})}),b1=()=>{const{editable:e}=Cn();return e?i.jsxRuntimeExports.jsx(DS,{}):null},v1=({children:e,...t})=>i.jsxRuntimeExports.jsx(J.Pack,{direction:"y",borderShade:4,className:p.CSS.BE("diagram","controls"),...t,children:e}),_1=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=Cn();return i.jsxRuntimeExports.jsx(j.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:p.K.RIGHT_CENTER,tooltip:n?i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Disable edit mode"}):i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Enable edit mode"}),...t,children:n?i.jsxRuntimeExports.jsx(j.xt.EditOff,{}):i.jsxRuntimeExports.jsx(j.xt.Edit,{})})},k1=({onClick:e,...t})=>{const{fitView:n}=bt(),{fitViewOnResize:s,setFitViewOnResize:o}=Cn();return i.jsxRuntimeExports.jsx(j.ToggleIcon,{onClick:r=>{n(Za),e==null||e(r)},value:s,onChange:r=>o(r),rightClickToggle:!0,tooltip:i.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Fit view to contents"}),tooltipLocation:p.K.RIGHT_CENTER,variant:"outlined",...t,children:i.jsxRuntimeExports.jsx(j.xt.Expand,{})})},P1=e=>i.jsxRuntimeExports.jsx($a,{children:i.jsxRuntimeExports.jsx(w1,{...e})}),M1=Object.freeze(Object.defineProperty({__proto__:null,Background:b1,Controls:v1,DefaultPath:Va,Diagram:P1,FitViewControl:k1,HandleLayout:Ha,NodeLayout:Ms,NodeRenderer:Ya,PATHS:Ba,PATH_TYPES:Fa,SelectPathType:p1,ToggleEditControl:_1,alignNodes:zh,calcPath:at,edgeConverter:zn,edgeZ:Dh,nodeConverter:tc,nodeZ:Oh,offsetPath:n1,rfEdgeDataZ:ql,selectNode:Ps,selectNodeBox:Ne,selectNodeLayout:f1,translateEdgesBackward:Ql,translateEdgesForward:Yo,translateNodesBackward:Ul,translateNodesForward:Go,translateViewportBackward:ec,translateViewportForward:Jl,use:j1,useContext:Cn,viewportZ:Ih},Symbol.toStringTag,{value:"Module"})),N1=j.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:o=i.jsxRuntimeExports.jsx(j.Text$3.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:r,telem:l,...c})=>{const a=j.useMemoDeepEqualProps({font:t,color:r,telem:l,visible:s}),[,{scrolling:u,empty:d},x]=j.use$3({aetherKey:e,type:I.Log.TYPE,schema:I.logState,initialState:{empty:!0,region:p.Eo.ZERO,scrolling:!1,wheelPos:0,...a}});g.useEffect(()=>{x(m=>({...m,...a}))},[a,x]);const f=gn(g.useCallback(m=>x(h=>({...h,region:m})),[x]));return i.jsxRuntimeExports.jsx("div",{ref:f,className:p.CSS(p.CSS.B("log"),n),onWheel:m=>{x(h=>({...h,wheelPos:h.wheelPos-m.deltaY,scrolling:h.scrolling?h.scrolling:m.deltaY<0}))},...c,children:d?o:i.jsxRuntimeExports.jsx(j.Icon,{className:p.CSS(p.CSS.BE("log","live"),u&&p.CSS.M("active")),variant:"outlined",onClick:()=>x(m=>({...m,scrolling:!m.scrolling})),tooltip:u?"Resume Scrolling":"Pause Scrolling",children:i.jsxRuntimeExports.jsx(j.xt.Dynamic,{})})})}),L1=Object.freeze(Object.defineProperty({__proto__:null,Log:N1},Symbol.toStringTag,{value:"Module"})),T1=({value:e,showOuter:t=!0,showInner:n,onChange:s})=>{const{outer:o}=e,r=l=>()=>s({...e,...l});return t?i.jsxRuntimeExports.jsxs(J.Space,{className:p.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(lt,{selected:o==="top",onClick:r({outer:"top"})}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[i.jsxRuntimeExports.jsx(lt,{selected:o==="left",onClick:r({outer:"left"})}),i.jsxRuntimeExports.jsx(Ti,{showInner:n,value:e,onChange:s}),i.jsxRuntimeExports.jsx(lt,{selected:o==="right",onClick:r({outer:"right"})})]}),i.jsxRuntimeExports.jsx(lt,{selected:o==="bottom",onClick:r({outer:"bottom"})})]}):i.jsxRuntimeExports.jsx(Ti,{className:p.CSS.B("orientation-control"),value:e,onChange:s})},Ti=({value:e,onChange:t,className:n,showInner:s=!0,...o})=>{const{inner:r}=e,l=a=>()=>t({...e,...a});let c={};return s||(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),i.jsxRuntimeExports.jsxs(J.Space,{className:p.CSS(n,p.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...o,children:[i.jsxRuntimeExports.jsx(lt,{style:c,disabled:!s,className:p.CSS(p.CSS.dir("y")),selected:r==="top",onClick:l({inner:"top"})}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"center",justify:"center",children:[i.jsxRuntimeExports.jsx(lt,{style:c,disabled:!s,selected:r==="left",onClick:l({inner:"left"})}),i.jsxRuntimeExports.jsx(lt,{style:c,disabled:!s,selected:r==="right",onClick:l({inner:"right"})})]}),i.jsxRuntimeExports.jsx(lt,{style:c,disabled:!s,className:p.CSS(p.CSS.dir("y")),selected:r==="bottom",onClick:l({inner:"bottom"})})]})},lt=({selected:e,className:t,...n})=>i.jsxRuntimeExports.jsx(j.Icon,{variant:"text",className:p.CSS(t,p.CSS.selected(e)),...n,children:i.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Ie=({className:e,direction:t,...n})=>i.jsxRuntimeExports.jsx(J.Space,{direction:t,align:"stretch",className:p.CSS(p.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),pt=({showOuter:e,showInner:t,...n})=>i.jsxRuntimeExports.jsx(me,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:o})=>{var r;return i.jsxRuntimeExports.jsx(T1,{value:{inner:s.orientation??"top",outer:((r=s.label)==null?void 0:r.orientation)??"top"},showInner:t,showOuter:e,onChange:l=>o({...s,orientation:l.inner,label:{...s.label,orientation:l.outer}})})}}),vt=({path:e,omit:t=[]})=>i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(me,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>i.jsxRuntimeExports.jsx(j.Text$2,{selectOnFocus:!0,...n})}),i.jsxRuntimeExports.jsx(Tt,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px",dragScale:{x:1,y:.5}},padHelpText:!1}),i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...n})}),i.jsxRuntimeExports.jsx(me,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>i.jsxRuntimeExports.jsx(ds,{...n})}),i.jsxRuntimeExports.jsx(me,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:n=>i.jsxRuntimeExports.jsx(rl,{...n,yDirection:"down"})})]}),Ge=e=>i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...o})=>i.jsxRuntimeExports.jsx(j.Swatch,{value:t??p.ZERO.setAlpha(1).rgba255,onChange:r=>n(r.rgba255),...o,bordered:!0})}),Wa=e=>i.jsxRuntimeExports.jsx(me,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>i.jsxRuntimeExports.jsx(j.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)))})}),ke=({omit:e})=>i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{omit:e,path:"label"}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Ge,{path:"color",optional:!0}),i.jsxRuntimeExports.jsx(me,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:t=>i.jsxRuntimeExports.jsx(j.Switch$1,{...t})}),i.jsxRuntimeExports.jsx(Wa,{path:"scale"})]})]}),i.jsxRuntimeExports.jsx(pt,{path:""})]}),A1=({path:e})=>{var u,d;const{value:t,onChange:n}=xt({path:e}),s=I.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=I.sinkPipelinePropsZ.parse((d=t.sink)==null?void 0:d.props),r=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=I.setChannelValuePropsZ.parse(o.segments.setter.props),c=x=>{x??(x=0);const f=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:x}),threshold:I.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:f})},a=x=>{x??(x=0);const f=I.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:I.setChannelValue({channel:x}),setpoint:I.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),m=I.authoritySource({channel:x}),h=I.acquireChannelControl({channel:x,authority:255});n({...t,sink:f,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:h,source:m},indicator:{statusSource:m}}})};return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",grow:!0,align:"stretch",children:[i.jsxRuntimeExports.jsx(Me.Item,{label:"State Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:r.channel,onChange:c})}),i.jsxRuntimeExports.jsx(Me.Item,{label:"Command Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:l.channel,onChange:a})}),i.jsxRuntimeExports.jsx(ps,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},lr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],be=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(A1,{path:""});default:return i.jsxRuntimeExports.jsx(ke,{})}},[]),t=Ee.useStatic({tabs:lr,content:e});return i.jsxRuntimeExports.jsx(Ee.Tabs,{...t})},ht={y:2,x:.25},rn={lower:0,upper:2e3},Ai={lower:0,upper:51},Xa=({includeBorderRadius:e=!1})=>i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ge,{path:"color"}),i.jsxRuntimeExports.jsx(Ge,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(me,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:ht,bounds:Ai,endContent:"%",...n})}),i.jsxRuntimeExports.jsx(me,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:ht,bounds:Ai,endContent:"%",...n})}),e&&i.jsxRuntimeExports.jsx(me,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:ht,bounds:rn,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:t??200,dragScale:ht,bounds:rn,endContent:"px",...n})}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:t??200,dragScale:ht,bounds:rn,endContent:"px",...n})})]})]}),i.jsxRuntimeExports.jsx(pt,{path:"",showInner:!1})]}),Ka=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],$1=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsxs(Ie,{direction:"y",empty:!0,children:[i.jsxRuntimeExports.jsx(Ho,{path:""}),";"]});default:return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ge,{path:"color"}),i.jsxRuntimeExports.jsx(me,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(j.Text$2,{...s})}),i.jsxRuntimeExports.jsx(Tt,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...s})})]})]}),i.jsxRuntimeExports.jsx(pt,{path:"",showInner:!1})]})}},[]),t=Ee.useStatic({tabs:Ka,content:e});return i.jsxRuntimeExports.jsx(Ee.Tabs,{...t})},I1=({path:e})=>{var u;const{value:t,onChange:n}=xt({path:e}),s=I.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),r=I.withinBoundsProps.parse(s.segments.threshold.props),l=d=>{d??(d=0);const x=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:d}),threshold:I.withinBounds({trueBound:{lower:r.trueBound.lower??.9,upper:r.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:x})},c=d=>{const x=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:o.channel}),threshold:I.withinBounds({trueBound:d})},outlet:"threshold"});n({...t,source:x})},a=us(o.channel);return g.useEffect(()=>n({...t}),[a]),i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(Me.Item,{label:"Input Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:o.channel,onChange:l})}),i.jsxRuntimeExports.jsx(Me.Item,{label:"Lower Threshold",children:i.jsxRuntimeExports.jsx(j.Numeric,{value:r.trueBound.lower??.9,onChange:d=>c({...r.trueBound,lower:d})})}),i.jsxRuntimeExports.jsx(Me.Item,{label:"Upper Threshold",children:i.jsxRuntimeExports.jsx(j.Numeric,{value:r.trueBound.upper??1.1,onChange:d=>c({...r.trueBound,upper:d})})})]})},D1=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return i.jsxRuntimeExports.jsx(I1,{path:""});default:return i.jsxRuntimeExports.jsx(ke,{})}},[]),t=Ee.useStatic({tabs:Ka,content:e});return i.jsxRuntimeExports.jsx(Ee.Tabs,{...t})},O1=({path:e})=>{var l;const{value:t,onChange:n}=xt({path:e}),s=I.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),o=I.setChannelValuePropsZ.parse(s.segments.setter.props),r=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}),d=I.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:u},showIndicator:!0,indicator:{statusSource:u}}})};return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",children:[i.jsxRuntimeExports.jsx(Me.Item,{label:"Output Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:o.channel,onChange:r})}),i.jsxRuntimeExports.jsx(Tt,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),i.jsxRuntimeExports.jsx(ps,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},z1=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(O1,{path:""});default:return i.jsxRuntimeExports.jsx(ke,{omit:["align","maxInlineSize"]})}},[]),t=Ee.useStatic({tabs:lr,content:e});return i.jsxRuntimeExports.jsx(Ee.Tabs,{...t})},B1=({path:e})=>{var u,d;const{value:t,onChange:n}=xt({path:e}),s=I.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),o=I.sinkPipelinePropsZ.parse((d=t.sink)==null?void 0:d.props),r=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=I.setChannelValuePropsZ.parse(o.segments.setter.props),c=x=>{x??(x=0);const f=I.sourcePipeline("number",{connections:[],segments:{valueStream:I.streamChannelValue({channel:x})},outlet:"valueStream"});n({...t,source:f})},a=x=>{x??(x=0);const f=I.sinkPipeline("number",{connections:[],segments:{setter:I.setChannelValue({channel:x})},inlet:"setter"}),m=I.authoritySource({channel:x}),h=I.acquireChannelControl({channel:x,authority:255});n({...t,sink:f,control:{...t.control,showChip:!0,chip:{sink:h,source:m},showIndicator:!0,indicator:{statusSource:m}}})};return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",grow:!0,align:"stretch",children:[i.jsxRuntimeExports.jsx(Me.Item,{label:"State Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:r.channel,onChange:c})}),i.jsxRuntimeExports.jsx(Me.Item,{label:"Command Channel",grow:!0,children:i.jsxRuntimeExports.jsx(ut,{value:l.channel,onChange:a})})]})},V1=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return i.jsxRuntimeExports.jsx(B1,{path:""});default:return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsx(Do,{path:"units",label:"Units",align:"start",padHelpText:!1}),i.jsxRuntimeExports.jsx(Ge,{path:"color"})]}),i.jsxRuntimeExports.jsx(pt,{path:""})]})}},[]),t=Ee.useStatic({tabs:lr,content:e});return i.jsxRuntimeExports.jsx(Ee.Tabs,{...t})},F1=()=>{const e=xt({path:"autoFit",optional:!0});return i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",grow:!0,children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsx(me,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>i.jsxRuntimeExports.jsx(j.Text$2,{selectOnFocus:!0,...t})}),i.jsxRuntimeExports.jsx(me,{path:"level",label:"Text Size",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(Re.SelectLevel,{...t})}),i.jsxRuntimeExports.jsx(me,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>i.jsxRuntimeExports.jsx(ds,{...t})})]}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ge,{path:"color"}),i.jsxRuntimeExports.jsx(me,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>i.jsxRuntimeExports.jsx(j.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:i.jsxRuntimeExports.jsx(j.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:i.jsxRuntimeExports.jsx(j.xt.AutoFitWidth,{})})})})]})]}),i.jsxRuntimeExports.jsx(pt,{path:""})]})},H1=()=>i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label",omit:["maxInlineSize","align","direction"]}),i.jsxRuntimeExports.jsx(Ge,{path:"color"})]}),i.jsxRuntimeExports.jsx(pt,{path:"",showOuter:!1})]}),Z1=()=>i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",children:[i.jsxRuntimeExports.jsx(Ge,{path:"color"}),i.jsxRuntimeExports.jsx(Ge,{path:"backgroundColor",label:"Background Color"}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:e??200,dragScale:ht,bounds:rn,endContent:"px",...t})}),i.jsxRuntimeExports.jsx(me,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>i.jsxRuntimeExports.jsx(j.Numeric,{value:e??200,dragScale:ht,bounds:rn,endContent:"px",...t})})]})]}),i.jsxRuntimeExports.jsx(pt,{path:"",showInner:!1})]}),Zt=()=>i.jsxRuntimeExports.jsxs(Ie,{direction:"x",align:"stretch",children:[i.jsxRuntimeExports.jsxs(J.Space,{direction:"y",grow:!0,children:[i.jsxRuntimeExports.jsx(vt,{path:"label"}),i.jsxRuntimeExports.jsxs(J.Space,{direction:"x",grow:!0,children:[i.jsxRuntimeExports.jsx(Ge,{path:"color"}),i.jsxRuntimeExports.jsx(Wa,{path:"scale"}),i.jsxRuntimeExports.jsx(ps,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),i.jsxRuntimeExports.jsx(pt,{path:""})]}),q=e=>i.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),nt=e=>i.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),We=e=>i.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),xe=e=>i.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),G1={left:{left:G.Left,right:G.Right,top:G.Top,bottom:G.Bottom},right:{left:G.Right,right:G.Left,top:G.Bottom,bottom:G.Top},top:{left:G.Bottom,right:G.Top,top:G.Left,bottom:G.Right},bottom:{left:G.Top,right:G.Bottom,top:G.Right,bottom:G.Left}},Y1=(e,t)=>G1[t][e],W1=(e,t=!1)=>{if(t)return e;switch(e){case G.Left:return G.Right;case G.Right:return G.Left;case G.Top:return G.Bottom;case G.Bottom:return G.Top;default:return G.Top}},X1=(e,t,n,s=!1)=>s?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},le=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=NS()}catch{return i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{})}const o=g.useRef(null),r=g.useRef(!0);return g.useEffect(()=>{if(o.current==null)return;if(r.current){r.current=!1;return}const l=o.current.closest(".react-flow__node"),c=l==null?void 0:l.getAttribute("data-id");c!=null&&(s==null||s(c))},[t,n]),i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("span",{ref:o}),e]})},F=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:o,top:r,...l})=>{const c=X1(r,s,t,n);return i.jsxRuntimeExports.jsx(hn,{position:W1(Y1(e,t),!o),...l,type:"source",onClick:a=>a.stopPropagation(),className:(p.CSS.B("handle"),p.CSS.BE("handle",l.id)),style:{left:`${c.left}%`,top:`${c.top}%`}})},je=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:o,...r})=>i.jsxRuntimeExports.jsx("button",{className:p.CSS(p.CSS.B("symbol-primitive"),p.CSS.B("symbol-primitive-toggle"),s!=null&&p.CSS.loc(s),t&&p.CSS.M("enabled"),n&&p.CSS.M("triggered"),e),color:p.cssString(o),...r}),ye=({className:e,...t})=>i.jsxRuntimeExports.jsx("div",{className:p.CSS(p.CSS.B("symbol-primitive"),e),...t}),K1=.8,ue=({dimensions:e,orientation:t="left",children:n,className:s,color:o,style:r={},scale:l=1,...c})=>{e=p.g.construct(t)==="y"?p._.swap(e):e;const u=p.cssString(o),d=j.use();return o!=null&&(r[p.CSS.var("symbol-color")]=new p.Color(o).rgbString,r[p.CSS.var("symbol-color-contrast")]=new p.Color(o).pickByContrast(d.colors.gray.l0,d.colors.gray.l10).rgbString),i.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:p._.svgViewBox(e),className:p.CSS(p.CSS.loc(t),s),fill:u,stroke:u,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:p._.scale(e,l*K1).width,...r},children:i.jsxRuntimeExports.jsx("g",{children:n})})},qa=({className:e,orientation:t="left",scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,orientation:t,className:p.CSS(p.CSS.B("four-way-valve"),e),children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:87},color:s,scale:n,children:[i.jsxRuntimeExports.jsx(q,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),i.jsxRuntimeExports.jsx(q,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),Ua=({color:e,orientation:t="left",scale:n,...s})=>i.jsxRuntimeExports.jsxs(je,{...s,className:p.CSS(p.CSS.B("three-way-valve")),orientation:t,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[i.jsxRuntimeExports.jsx(q,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),i.jsxRuntimeExports.jsx(q,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),Qa=({orientation:e="left",color:t,scale:n,...s})=>i.jsxRuntimeExports.jsxs(je,{...s,children:[i.jsxRuntimeExports.jsxs(le,{orientation:e,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(ue,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:i.jsxRuntimeExports.jsx(q,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),Ja=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:o,...r})=>i.jsxRuntimeExports.jsxs(je,{className:p.CSS(p.CSS.B("solenoid-valve"),s&&p.CSS.M("normally-open"),e),...r,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:69},color:t,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(q,{className:p.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),i.jsxRuntimeExports.jsx(xe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),i.jsxRuntimeExports.jsx(nt,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),eu=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(je,{className:p.CSS(p.CSS.B("relief-valve"),e),enabled:o,...r,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),i.jsxRuntimeExports.jsx(q,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),tu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{orientation:t,className:p.CSS(p.CSS.B("check-valve"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(xe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),nu=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const r=p.cssString(n);return i.jsxRuntimeExports.jsxs(ye,{...o,orientation:t,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(We,{cx:"7",cy:"7",r:"4",fill:r}),i.jsxRuntimeExports.jsx(q,{d:"M7 39.5V11.5941C7 9.42886 9.22384 7.97669 11.2063 8.84738L76.7937 37.6526C78.7762 38.5233 81 37.0711 81 34.9059V6",strokeLinecap:"round"})]})]})},su=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,orientation:n,className:p.CSS(p.CSS.B("angled-valve"),t),children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),i.jsxRuntimeExports.jsx(q,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"})]})]}),ou=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,className:p.CSS(p.CSS.B("pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(We,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"2",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"62",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)})]})]}),ru=({className:e,color:t,orientation:n="left",scale:s,...o})=>{const r=p.cssString(t);return i.jsxRuntimeExports.jsxs(ye,{...o,className:p.CSS(p.CSS.B("symbol"),e),children:[i.jsxRuntimeExports.jsx(le,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:5,top:50,id:"1"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),i.jsxRuntimeExports.jsx(q,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:r}),i.jsxRuntimeExports.jsx(q,{d:"M33 24H2",strokeLinecap:"round"})]})]})},iu=({className:e,color:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{...o,className:p.CSS(p.CSS.B("symbol"),e),children:[i.jsxRuntimeExports.jsx(le,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(nt,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),i.jsxRuntimeExports.jsx(q,{d:"M13 68V47C13 46.4477 13.4489 45.9892 13.9928 45.8933C16.1351 45.5152 21 43.7981 21 36C21 28.2019 16.1351 26.4848 13.9928 26.1068C13.4489 26.0108 13 25.5523 13 25V4",strokeWidth:"2"})]})]}),lu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("cap"),e),...o,children:[i.jsxRuntimeExports.jsx(le,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),i.jsxRuntimeExports.jsx(ue,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(q,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),cu=({className:e,orientation:t="left",color:n,scale:s=1,...o})=>i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("cap"),e),...o,children:[i.jsxRuntimeExports.jsx(le,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:50,top:50,id:"1"})}),i.jsxRuntimeExports.jsx(ue,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:i.jsxRuntimeExports.jsx(q,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),au=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(je,{...r,orientation:t,className:p.CSS(p.CSS.B("manual-valve"),e),enabled:o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(xe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),i.jsxRuntimeExports.jsx(q,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),uu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("orifice_plate"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{color:n,dimensions:{width:96,height:48},orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(nt,{x:"3",y:"3",width:"90",height:"42",rx:"2",ry:"2"}),i.jsxRuntimeExports.jsx(xe,{x1:"33",y1:"3",x2:"33",y2:"21",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"33",y1:"27",x2:"33",y2:"45",strokeLinecap:"round"})]})]}),du=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("filter"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(ue,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:i.jsxRuntimeExports.jsx(q,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17"})})]}),xu=e=>typeof e=="number"?{topLeft:p.G.construct(e),topRight:p.G.construct(e),bottomLeft:p.G.construct(e),bottomRight:p.G.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:p.G.construct(e.topLeft),topRight:p.G.construct(e.topRight),bottomLeft:p.G.construct(e.bottomLeft),bottomRight:p.G.construct(e.bottomRight)}:e,q1=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:o}=e;return`${t.x}% ${n.x}% ${o.x}% ${s.x}% / ${t.y}% ${n.y}% ${o.y}% ${s.y}%`},pu={width:40,height:80},cr={x:50,y:10},Ns=({className:e,dimensions:t=pu,borderRadius:n=cr,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=xu(n),a=s==null,u=j.use(),d=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]);return i.jsxRuntimeExports.jsx(ye,{className:p.CSS(e,p.CSS.B("tank")),style:{...t,borderRadius:s??q1(c),borderColor:p.cssString(o??u.colors.gray.l9),backgroundColor:r==null?void 0:p.cssString(r)},...l,children:i.jsxRuntimeExports.jsxs(le,{refreshDeps:d,orientation:"left",children:[i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:0,id:"1"}),a&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:-.5,top:c.topLeft.y-1,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:101,top:c.topRight.y-1,id:"3"})]}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:100,id:"4"}),a&&i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:-.5,top:100-c.bottomLeft.y+1,id:"5"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:101,top:100-c.bottomRight.y+1,id:"6"})]}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:-.5,top:50,id:"7"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:101,top:50,id:"8"})]})})},fu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(e,p.CSS.B("regulator")),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),i.jsxRuntimeExports.jsx(q,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),i.jsxRuntimeExports.jsx(xe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),mu=({className:e,orientation:t="left",scale:n,color:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("orifice"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[i.jsxRuntimeExports.jsx(q,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),hu=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(je,{...r,orientation:t,className:p.CSS(p.CSS.B("needle-valve"),e),enabled:o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:p.cssString(n)}),i.jsxRuntimeExports.jsx(q,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),gu=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...r})=>i.jsxRuntimeExports.jsxs(je,{...r,orientation:n,className:p.CSS(p.CSS.B("angled-relief-valve"),t),enabled:o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[i.jsxRuntimeExports.jsx(xe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),i.jsxRuntimeExports.jsx(q,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),ju=({className:e,color:t,dimensions:n,orientation:s="left",units:o="psi",unitsLevel:r="small",children:l,inlineSize:c=80,...a})=>{const u=p.cssString(t),d=j.use(),x=t==null?"var(--pluto-gray-l0)":p.cssString(new p.Color(t).pickByContrast(d.colors.gray.l0,d.colors.gray.l9)),f=2.5*((n==null?void 0:n.width)??0)/500;return i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("value"),e),...a,style:{borderColor:u,height:n==null?void 0:n.height,width:"100%"},children:[i.jsxRuntimeExports.jsx("div",{className:p.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:c},children:l}),i.jsxRuntimeExports.jsxs(le,{orientation:s,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:-2+f,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:102-f,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),i.jsxRuntimeExports.jsx("div",{className:p.CSS(p.CSS.BE("value","units"),p.CSS.M(r)),style:{background:u},children:i.jsxRuntimeExports.jsx(j.Text$1,{level:r,color:x,children:o})})]})},yu=({enabled:e=!1,onClick:t,orientation:n="left"})=>i.jsxRuntimeExports.jsxs(ye,{orientation:n,children:[i.jsxRuntimeExports.jsx(j.Switch$1,{value:e,onClick:t,onChange:()=>{}}),i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Eu=({onClick:e,orientation:t="left",label:n="",color:s,size:o,level:r,onClickDelay:l})=>i.jsxRuntimeExports.jsxs(ye,{orientation:t,children:[i.jsxRuntimeExports.jsx(j.Button,{onClick:e,color:s,size:o,level:r,onClickDelay:l,children:n}),i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:0,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:100,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:0,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),Su=({className:e,orientation:t="left",text:n="",width:s,color:o="var(--pluto-gray-l9)",level:r,autoFit:l,align:c="center"})=>{const a={textAlign:c};return p.g.construct(t)==="y"?a.height=l?"fit-content":s:a.width=l?"fit-content":s,i.jsxRuntimeExports.jsx(ye,{style:a,orientation:t,className:p.CSS(p.CSS.B("text-box"),p.CSS.loc(t),e),children:i.jsxRuntimeExports.jsx(j.Text$1,{color:p.cssString(o),level:r,children:n})})},Ru=({orientation:e="left",className:t,onClick:n,children:s,value:o,units:r,color:l,onChange:c,...a})=>{const[u,d]=g.useState(o);return i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("setpoint"),t),orientation:e,...a,children:[i.jsxRuntimeExports.jsxs(le,{orientation:e,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:e,left:1,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:e,left:100,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:e,left:50,top:-2,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),i.jsxRuntimeExports.jsx(j.Numeric,{size:"small",value:u,onChange:d,showDragHandle:!1,selectOnFocus:!0,endContent:r,color:l,style:{[p.CSS.var("pack-border-shade")]:p.cssString(l)},borderWidth:2,children:i.jsxRuntimeExports.jsx(j.Button,{variant:"outlined",size:"small",onClick:()=>c(u),color:l,children:"Set"})})]})},Cu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,className:p.CSS(p.CSS.B("screw-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(We,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"2",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"62",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(q,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(q,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:p.CSS(p.CSS.M("detail"),t)})]})]}),wu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,className:p.CSS(p.CSS.B("vacuum-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(We,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(xe,{x1:"17",y1:"6.0192",x2:"57.9808",y2:"17",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"17",y1:"57.9808",x2:"57.9808",y2:"47",className:p.CSS(p.CSS.M("detail"),t)})]})]}),bu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,className:p.CSS(p.CSS.B("cavity-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(We,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"2",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"62",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(q,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:p.CSS(p.CSS.M("detail"),t)})]})]}),vu=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,className:p.CSS(p.CSS.B("piston-pump"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(We,{cx:"32",cy:"32",r:"30"}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"2",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"62",x2:"62",y2:"32",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(q,{d:"M 23 32, h 16, m 0 -8, v 16",className:p.CSS(p.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),_u=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{...o,className:p.CSS(p.CSS.B("static-mixer"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(nt,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),i.jsxRuntimeExports.jsx(q,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),ku=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,className:p.CSS(p.CSS.B("rotary-mixer"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:p.CSS(p.CSS.M("detail"),t)}),i.jsxRuntimeExports.jsx(xe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:p.CSS(p.CSS.M("detail"),t)})]})]}),Pu=({className:e,color:t,orientation:n="left",enabled:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(ye,{...r,orientation:n,className:p.CSS(p.CSS.B("light"),s&&p.CSS.M("enabled"),e),children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),i.jsxRuntimeExports.jsx(ue,{dimensions:{width:64,height:64},color:t,orientation:n,scale:o,children:i.jsxRuntimeExports.jsx(We,{cx:"32",cy:"32",r:"30"})})]}),Mu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(e,p.CSS.B("regulator")),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:21.5909,top:25,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:12.5,id:"4"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:70/88*100,top:20/80*100,id:"5"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),i.jsxRuntimeExports.jsx(nt,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),i.jsxRuntimeExports.jsx(xe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M44.5 10V8C44.5 6.34315 45.3431 5 47 5H80C81.6569 5 83 6.34315 83 8V24.4281C83 25.4126 82.517 26.3344 81.7076 26.8947L44.5 53"})]})]}),Nu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:100/e,id:"1"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M43 1L43 65",strokeLinecap:"round"})]})]}),Lu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50.5814,top:200/e,id:"4"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),i.jsxRuntimeExports.jsx(q,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),Tu=({height:e=86,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:t,children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(nt,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Au=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(je,{...r,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(nt,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),i.jsxRuntimeExports.jsx(xe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:p.CSS(p.CSS.M("detail"),e),strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"49",x2:"43",y2:"83",className:p.CSS(p.CSS.M("detail"),e),strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:p.CSS(p.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),$u=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(je,{...r,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(nt,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),Iu=({className:e,height:t=86,orientation:n="left",color:s,scale:o,...r})=>i.jsxRuntimeExports.jsxs(je,{...r,className:p.CSS(p.CSS.B("agitator")),children:[i.jsxRuntimeExports.jsx(le,{orientation:n,children:i.jsxRuntimeExports.jsx(F,{location:"top",left:50,top:100/t,id:"4",orientation:n})}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:86,height:t},color:s,orientation:n,scale:o,children:[i.jsxRuntimeExports.jsx(xe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M5.375 36L70.8204 48.7138C74.0584 49.3428 74.0573 53.9765 70.8189 54.6039L14.7952 65.4584C11.5729 66.0827 11.5494 70.6856 14.7651 71.3429L81.5208 84.9873",strokeLinecap:"round"})]})]}),Du=({color:e,className:t,orientation:n="left",scale:s,...o})=>i.jsxRuntimeExports.jsxs(je,{...o,className:p.CSS(p.CSS.B("compressor"),t),orientation:n,children:[i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,left:1.5,top:41,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:n,left:95,top:3,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:68,height:61},color:e,orientation:n,scale:s,children:[i.jsxRuntimeExports.jsx(We,{cx:"35",cy:"25",r:"23"}),i.jsxRuntimeExports.jsx(q,{d:"M50 41.5L56.7186 50.8314C57.6711 52.1544 56.7257 54 55.0955 54H14.9045C13.2743 54 12.3289 52.1544 13.2814 50.8314L20 41.5"}),i.jsxRuntimeExports.jsx(xe,{x1:"35",y1:"2",x2:"65.0167",y2:"2"}),i.jsxRuntimeExports.jsx(xe,{x1:"1",y1:"25",x2:"35",y2:"25"})]})]}),Ou=({id:e,className:t,orientation:n="right",label:s="text",color:o="black",level:r="p",onLabelChange:l,...c})=>{const a=document.querySelector(`[data-id="${e}"]`);a&&a.classList.add(n);const u=p.g.construct(n)==="y";return i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("arrow"),p.CSS.loc(n),t),orientation:n,...c,children:[i.jsxRuntimeExports.jsx("div",{className:"wrapper",children:i.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:p.cssString(o)},children:i.jsxRuntimeExports.jsx("div",{className:"bg",children:i.jsxRuntimeExports.jsx(j.MaybeEditable,{value:s,onChange:l,level:r,className:p.CSS.BE("symbol","label")})})})}),i.jsxRuntimeExports.jsxs(le,{orientation:n,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:u,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:u,id:"2"})]}),i.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[i.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),i.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),i.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},zu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("vent"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),i.jsxRuntimeExports.jsx(ue,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(q,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),Bu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("iso-filter"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:95,top:50,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(nt,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),i.jsxRuntimeExports.jsx(xe,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(xe,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),Vu=({className:e,dimensions:t=pu,borderRadius:n=cr,boxBorderRadius:s,color:o,backgroundColor:r,...l})=>{const c=xu(n),a=j.use(),u=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]),d=p.cssString(o??a.colors.gray.l9),x=r==null?void 0:p.cssString(r),f=t.width/66,m=t.height/180,h=`scale(${f},${m})`;return i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(e,p.CSS.B("cylinder")),style:{...t},...l,children:[i.jsxRuntimeExports.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:h,children:i.jsxRuntimeExports.jsx("path",{d:"M23 33.6712C11.9844 36.0332 3 42.4382 3 52.8862V174.568C3 176.225 4.34315 177.568 6 177.568H60C61.6569 177.568 63 176.225 63 174.568V52.8862C63 36.3342 40.4511 29.9292 23 33.6712ZM23 33.6712V13.3181C23 0.318109 42.9975 0.318123 42.9975 13.3181V33.6712",vectorEffect:"non-scaling-stroke",strokeWidth:"2",stroke:d,transform:h,fill:x})}),i.jsxRuntimeExports.jsxs(le,{refreshDeps:u,orientation:"left",children:[i.jsxRuntimeExports.jsx(F,{location:"top",orientation:"left",left:50,top:2,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:35,top:10,id:"9"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:65,top:10,id:"10"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:4,top:40,id:"3"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:96,top:40,id:"4"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:4,top:60,id:"5"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:96,top:60,id:"6"}),i.jsxRuntimeExports.jsx(F,{location:"left",orientation:"left",left:4,top:80,id:"7"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},Fu=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>{const l=p.cssString(n);return i.jsxRuntimeExports.jsxs(je,{...r,orientation:t,className:p.CSS(p.CSS.B("spring-loaded-relief-valve"),e),enabled:o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M46.3625 54.1079C45.6312 54.4779 45.6311 55.5223 46.3624 55.8924L81.7435 73.7989C83.7389 74.8088 86.098 73.3588 86.0982 71.1224L86.1002 38.883C86.1003 36.6465 83.7414 35.1962 81.7458 36.2059L46.3625 54.1079Z",stroke:l}),i.jsxRuntimeExports.jsx(q,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),i.jsxRuntimeExports.jsx(q,{d:"M41.6389 55.8923C42.3702 55.5222 42.3702 54.4778 41.6389 54.1077L6.2567 36.2035C4.26118 35.1937 1.90217 36.6438 1.90217 38.8803L1.90217 71.1197C1.90217 73.3562 4.26119 74.8063 6.2567 73.7965L41.6389 55.8923Z",stroke:l}),i.jsxRuntimeExports.jsx(We,{cx:"44",cy:"55",r:"4",fill:l}),i.jsxRuntimeExports.jsx(q,{d:"M45 4C45 3.44772 44.5523 3 44 3C43.4477 3 43 3.44772 43 4H45ZM37.5777 24.7889L38.0249 23.8944L37.5777 24.7889ZM37.5777 21.2111L38.0249 22.1056L37.5777 21.2111ZM50.4223 31.2111L49.9751 32.1056L50.4223 31.2111ZM37.5777 44.7889L37.1305 45.6833L37.5777 44.7889ZM37.5777 41.2111L37.1305 40.3167L37.5777 41.2111ZM42.8944 47.4472L42.4472 48.3416L42.8944 47.4472ZM45 52V49.2361H43V52H45ZM43.3416 46.5528L38.0249 43.8944L37.1305 45.6833L42.4472 48.3416L43.3416 46.5528ZM38.0249 42.1056L50.8695 35.6833L49.9751 33.8944L37.1305 40.3167L38.0249 42.1056ZM50.8695 30.3167L38.0249 23.8944L37.1305 25.6833L49.9751 32.1056L50.8695 30.3167ZM38.0249 22.1056L50.8695 15.6833L49.9751 13.8944L37.1305 20.3167L38.0249 22.1056ZM50.8695 10.3167L45.5528 7.65836L44.6584 9.44721L49.9751 12.1056L50.8695 10.3167ZM45 6.76393V4H43V6.76393H45ZM45.5528 7.65836C45.214 7.48897 45 7.1427 45 6.76393H43C43 7.90025 43.642 8.93904 44.6584 9.44721L45.5528 7.65836ZM50.8695 15.6833C53.0806 14.5777 53.0807 11.4223 50.8695 10.3167L49.9751 12.1056C50.7121 12.4741 50.7121 13.5259 49.9751 13.8944L50.8695 15.6833ZM38.0249 23.8944C37.2879 23.5259 37.2879 22.4741 38.0249 22.1056L37.1305 20.3167C34.9193 21.4223 34.9194 24.5777 37.1305 25.6833L38.0249 23.8944ZM50.8695 35.6833C53.0806 34.5777 53.0807 31.4223 50.8695 30.3167L49.9751 32.1056C50.7121 32.4741 50.7121 33.5259 49.9751 33.8944L50.8695 35.6833ZM38.0249 43.8944C37.2879 43.5259 37.2879 42.4741 38.0249 42.1056L37.1305 40.3167C34.9193 41.4223 34.9194 44.5777 37.1305 45.6833L38.0249 43.8944ZM45 49.2361C45 48.0998 44.358 47.061 43.3416 46.5528L42.4472 48.3416C42.786 48.511 43 48.8573 43 49.2361H45Z",fill:l,strokeWidth:1})]})]})},Hu=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...r})=>{const l=p.cssString(n);return i.jsxRuntimeExports.jsxs(je,{...r,orientation:t,className:p.CSS(p.CSS.B("spring-loaded-relief-valve"),e),enabled:o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),i.jsxRuntimeExports.jsxs(ue,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[i.jsxRuntimeExports.jsx(q,{d:"M23.3625 55.6237C22.6312 55.9937 22.6311 57.0381 23.3624 57.4082L58.7435 75.3147C60.7389 76.3246 63.098 74.8747 63.0981 72.6382L63.1001 40.3988C63.1003 38.1624 60.7414 36.7121 58.7458 37.7217L23.3625 55.6237Z"}),i.jsxRuntimeExports.jsx(q,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),i.jsxRuntimeExports.jsx(q,{d:"M21.8923 58.4348C21.5222 57.7035 20.4778 57.7035 20.1077 58.4348L2.20349 93.817C1.19372 95.8125 2.64384 98.1715 4.8803 98.1715H37.1197C39.3562 98.1715 40.8063 95.8125 39.7965 93.817L21.8923 58.4348Z"}),i.jsxRuntimeExports.jsx(We,{cx:"21",cy:"56.0737",r:"4",fill:l}),i.jsxRuntimeExports.jsx(q,{d:"M21 53.0105V50.0225C21 49.3397 20.6516 48.704 20.0759 48.3366L15.6419 45.507C14.4098 44.7207 14.4098 42.9214 15.6419 42.1351L26.3581 35.2965C27.5902 34.5102 27.5902 32.7109 26.3581 31.9246L15.6419 25.0859C14.4098 24.2997 14.4098 22.5003 15.6419 21.714L26.3581 14.8754C27.5902 14.0891 27.5902 12.2898 26.3581 11.5035L21.9241 8.67393C21.3484 8.30656 21 7.67087 21 6.98798V4",stroke:l,strokeLinecap:"round"})]})]})},Zu=({className:e,orientation:t="left",color:n,scale:s,...o})=>i.jsxRuntimeExports.jsxs(ye,{className:p.CSS(p.CSS.B("t-junction"),e),...o,children:[i.jsxRuntimeExports.jsxs(le,{orientation:t,children:[i.jsxRuntimeExports.jsx(F,{location:"left",orientation:t,left:1.6667,top:20,id:"1"}),i.jsxRuntimeExports.jsx(F,{location:"right",orientation:t,left:98.3333,top:20,id:"2"}),i.jsxRuntimeExports.jsx(F,{location:"bottom",orientation:t,left:50,top:95,id:"3"})]}),i.jsxRuntimeExports.jsx(ue,{dimensions:{width:36,height:18},color:n,orientation:t,scale:s,children:i.jsxRuntimeExports.jsx(q,{d:"M0 4V2C0 0.895431 0.895431 0 2 0H34C35.1046 0 36 0.89543 36 2V4C36 5.10457 35.1046 6 34 6H23C21.8954 6 21 6.89543 21 8V16C21 17.1046 20.1046 18 19 18H17C15.8954 18 15 17.1046 15 16V8C15 6.89543 14.1046 6 13 6H2C0.895431 6 0 5.10457 0 4Z",fill:p.cssString(n),stroke:"none"})})]}),U1=({aetherKey:e,sink:t})=>{const n=j.useMemoDeepEqualProps({sink:t}),[,,s]=j.use$3({aetherKey:e,type:I.Button.TYPE,schema:I.buttonStateZ,initialState:{trigger:0,sink:t}});return g.useEffect(()=>{s(r=>({...r,...n}))},[n]),{click:g.useCallback(()=>{s(r=>({...r,trigger:r.trigger+1}))},[s])}},Q1=({aetherKey:e,source:t})=>{const n=j.useMemoDeepEqualProps({source:t}),[,{enabled:s},o]=j.use$3({aetherKey:e,type:I.Light.TYPE,schema:I.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>o(r=>({...r,...n})),[n,o]),{enabled:s}},J1="Schematic.Grid",eR=e=>{const n=Ps(e).closest(".react-flow__pane");n!=null&&j.triggerReflow(n)},Ls=e=>{const t=({symbolKey:s,items:o,onLocationChange:r})=>{const l=`${s}.${J1}`,[c,a]=g.useState(!1),u=g.useCallback(({items:E})=>E.every(R=>R.type===l),[l]),d=j.useSyncedRef(r),{startDrag:x,onDragEnd:f,...m}=j.useDragAndDrop({type:l,canDrop:u,onDrop:g.useCallback(({items:E})=>E,[]),onDragOver:g.useCallback(E=>{a(u(E)),E.items.forEach(({key:R})=>d.current(R,e))},[])}),h=o.filter(E=>E.location===e),y=g.useCallback((E,R)=>x([{key:R,type:l}]),[x,l]);return i.jsxRuntimeExports.jsx(J.Space,{direction:p.K.direction(e),className:p.CSS(p.CSS.BE("grid","item"),p.CSS.loc(e),p.CSS.dropRegion(!0),c&&p.CSS.B("dragging-over")),onDragLeave:()=>a(!1),empty:!0,...m,children:h.map(({element:E,key:R})=>i.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(E,{draggable:!0,onDragStart:_=>y(_,R),onDragEnd:f,style:{...E.props.style,cursor:"grab"}})},R))})};return({symbolKey:s,...o})=>{const{editable:r,items:l}=o,c=g.useRef(r);if(r!==c.current&&e==="top"&&(eR(s),c.current=r),r)return i.jsxRuntimeExports.jsx(t,{symbolKey:s,...o});const a=l.filter(u=>u.location===e);return a.length===0?null:i.jsxRuntimeExports.jsx(J.Space,{direction:p.K.direction(e),className:p.CSS(p.CSS.BE("grid","item"),p.CSS.loc(e)),empty:!0,children:a.map(({element:u,key:d})=>i.jsxRuntimeExports.jsx(g.Fragment,{children:u},d))})}},tR=Ls("top"),nR=Ls("left"),sR=Ls("right"),oR=Ls("bottom"),_t=({editable:e,onRotate:t,children:n,...s})=>i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(tR,{editable:e,...s}),i.jsxRuntimeExports.jsx(nR,{editable:e,...s}),i.jsxRuntimeExports.jsx(sR,{editable:e,...s}),i.jsxRuntimeExports.jsx(oR,{editable:e,...s}),e&&i.jsxRuntimeExports.jsx(j.Icon,{className:p.CSS.BE("grid","rotate"),size:"small",variant:"filled",onClick:t,children:i.jsxRuntimeExports.jsx(j.xt.Rotate,{})}),n]}),rR=({aetherKey:e,source:t,sink:n})=>{const s=j.useMemoDeepEqualProps({source:t,sink:n}),[,{value:o},r]=j.use$3({aetherKey:e,type:I.Setpoint.TYPE,schema:I.setpointStateZ,initialState:{trigger:0,value:0,...s}});return g.useEffect(()=>{r(c=>({...c,...s}))},[s,r]),{set:g.useCallback(c=>r(a=>({...a,trigger:a.trigger+1,command:c})),[r]),value:o}},iR=({aetherKey:e,source:t,sink:n})=>{const s=j.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:o,enabled:r},l]=j.use$3({aetherKey:e,type: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:o,enabled:r}},Gt=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:o="top",direction:r,align:l,maxInlineSize:c}=e;return n==null||n.length===0?null:{key:"label",element:i.jsxRuntimeExports.jsx(j.Editable,{className:p.CSS(p.CSS.BE("symbol","label"),p.CSS.dir(r)),level:s,value:n,onChange:a=>t==null?void 0:t({label:{...e,label:a}}),allowEmpty:!0,style:{textAlign:l,maxInlineSize:c}}),location:o}},ar=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:o,indicator:r,orientation:l="bottom"}=e;return{key:"control",element:i.jsxRuntimeExports.jsxs(J.Space,{direction:p.g.swap(l),align:"center",className:p.CSS(p.CSS.B("control-state")),size:"small",children:[t&&n&&i.jsxRuntimeExports.jsx(Dl,{size:"small",...o}),t&&s&&i.jsxRuntimeExports.jsx(Bl,{...r})]}),location:l}},we=e=>{const t=({symbolKey:n,control:s,source:o,sink:r,label:l,onChange:c,draggable:a,selected:u,orientation:d="left",...x})=>{const{enabled:f,triggered:m,toggle:h}=iR({aetherKey:n,source:o,sink:r}),y=[],E=Gt(l,c);E!=null&&y.push(E);const R=ar(s);return R!=null&&y.push(R),i.jsxRuntimeExports.jsx(_t,{editable:u&&!a,symbolKey:n,items:y,onRotate:()=>c({orientation:p.K.rotate90(d)}),onLocationChange:(_,w)=>{_==="label"&&c({label:{...l,orientation:w}}),_==="control"&&c({control:{...s,orientation:w}})},children:i.jsxRuntimeExports.jsx(e,{enabled:f,triggered:m,onClick:h,orientation:d,...x})})};return t.displayName=e.displayName,t},ve=e=>{const t=({symbolKey:n,label:s,onChange:o,selected:r,draggable:l,position:c,orientation:a="left",...u})=>{const d=[],x=Gt(s,o);return x!=null&&d.push(x),i.jsxRuntimeExports.jsx(_t,{items:d,editable:r&&!l,symbolKey:n,onRotate:()=>o({orientation:p.K.rotate90(a)}),onLocationChange:(f,m)=>{f==="label"&&o({label:{...s,orientation:m}})},children:i.jsxRuntimeExports.jsx(e,{orientation:a,...u})})};return t.displayName=e.displayName,t},kt=e=>{const t=({symbolKey:n,label:s,onChange:o,selected:r,draggable:l,position:c,orientation:a="left",enabled:u=!1,clickable:d=!1,...x})=>{const f=[],m=Gt(s,o);m!=null&&f.push(m);const h=()=>{d&&o({enabled:!u})};return i.jsxRuntimeExports.jsx(_t,{items:f,editable:r&&!l,symbolKey:n,onRotate:()=>o({orientation:p.K.rotate90(a)}),onLocationChange:(y,E)=>{y==="label"&&o({label:{...s,orientation:E}})},children:i.jsxRuntimeExports.jsx(e,{orientation:a,enabled:u,onClick:h,...x})})};return t.displayName=e.displayName,t},Gu=we(Ua),Yu=we(Qa),Wu=we(Ja),Xu=we(qa),Ku=we(su),qu=we(ou),Uu=we(wu),Qu=we(bu),Ju=we(vu),ed=we(ku),td=we(Nu),nd=we(Lu),sd=we(Tu),od=we(Au),rd=we($u),id=we(Iu),ld=we(Cu),cd=we(Du),ad=ve(fu),ud=ve(Mu),dd=ve(ru),xd=ve(lu),pd=ve(cu),fd=ve(du),md=ve(tu),hd=ve(nu),gd=ve(mu),jd=we(yu),yd=ve(zu),Ed=ve(uu),Sd=ve(Bu),Rd=ve(iu),Cd=ve(Zu),wd=ve(_u),bd=kt(hu),vd=kt(eu),_d=kt(Fu),kd=kt(Hu),Pd=kt(au),Md=kt(gu),Nd=ve(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:r})=>i.jsxRuntimeExports.jsx(Ns,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:r,backgroundColor:e})),Ld=e=>i.jsxRuntimeExports.jsx(Ns,{...e,dimensions:{width:25,height:50}}),Td=ve(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:o,dimensions:r})=>i.jsxRuntimeExports.jsx(Ns,{onResize:l=>n({dimensions:l}),orientation:s,color:o,dimensions:r,boxBorderRadius:t,backgroundColor:e})),Ad=e=>i.jsxRuntimeExports.jsx(Ns,{...e,dimensions:{width:25,height:50},borderRadius:0}),$d=({label:e,symbolKey:t,orientation:n="left",control:s,units:o,source:r,sink:l,color:c,onChange:a,selected:u,draggable:d})=>{const{value:x,set:f}=rR({aetherKey:t,source:r,sink:l}),m=[],h=ar(s);h!=null&&m.push(h);const y=Gt(e,a);return y!=null&&m.push(y),i.jsxRuntimeExports.jsx(_t,{symbolKey:t,editable:u&&!d,onRotate:()=>a({orientation:p.K.rotate90(n)}),items:m,onLocationChange:(E,R)=>{E==="label"&&a({label:{...e,orientation:R}})},children:i.jsxRuntimeExports.jsx(Ru,{value:x,onChange:f,units:o,color:c,orientation:n})})},Id=e=>i.jsxRuntimeExports.jsx(Ru,{value:12,onChange:()=>{},units:"mV",...e,children:i.jsxRuntimeExports.jsx(j.Text$1,{level:"p",children:"10.0"})}),Dd=({symbolKey:e,label:t,level:n="p",position:s,textColor:o,color:r,telem:l,units:c,onChange:a,inlineSize:u=70,selected:d,draggable:x,notation:f})=>{const m=j.useTypography(n),h=(m.lineHeight+.5)*m.baseSize+2,{width:y}=Zo({aetherKey:e,color:o,level:n,box:p.Eo.construct(p.G.translateY({...s},1),{height:h,width:u}),telem:l,minWidth:u,notation:f}),E=[],R=Gt(t,a);return R!=null&&E.push(R),i.jsxRuntimeExports.jsx(_t,{editable:d&&!x,symbolKey:e,items:E,onLocationChange:(_,w)=>{_==="label"&&a({label:{...t,orientation:w}})},children:i.jsxRuntimeExports.jsx(ju,{color:r,dimensions:{height:h,width:y},inlineSize:u,units:c,unitsLevel:H.downLevel(n)})})},Od=({color:e})=>i.jsxRuntimeExports.jsx(ju,{color:e,dimensions:{width:60,height:25},units:"psi",children:i.jsxRuntimeExports.jsx(j.Text$1,{level:"p",children:"50.00"})}),zd=({symbolKey:e,label:t,orientation:n="left",sink:s,control:o,selected:r,draggable:l,onChange:c,...a})=>{const{click:u}=U1({aetherKey:e,sink:s}),d=[],x=ar(o);return x!=null&&d.push(x),i.jsxRuntimeExports.jsx(_t,{onRotate:()=>c({orientation:p.K.rotate90(n)}),editable:r&&!l,symbolKey:e,items:d,onLocationChange:(f,m)=>{f==="label"&&c({label:{...t,orientation:m}})},children:i.jsxRuntimeExports.jsx(Eu,{...t,onClick:u,orientation:n,...a})})},Bd=({label:e,...t})=>i.jsxRuntimeExports.jsx(Eu,{label:"Button",...t}),Vd=({symbolKey:e,label:t,source:n,onChange:s,selected:o,draggable:r,...l})=>{const{enabled:c}=Q1({aetherKey:e,source:n}),a=[],u=Gt(t,s);return u!=null&&a.push(u),i.jsxRuntimeExports.jsx(_t,{items:a,editable:o&&!r,symbolKey:e,onLocationChange:(d,x)=>{d==="label"&&s({label:{...t,orientation:x}})},children:i.jsxRuntimeExports.jsx(Pu,{enabled:c,...l})})},Fd=({level:e="p",width:t=100})=>i.jsxRuntimeExports.jsx(Su,{level:e,width:t,text:"Text Box"}),Hd=({label:{label:e,level:t},orientation:n,color:s,onChange:o})=>i.jsxRuntimeExports.jsx(Ou,{onLabelChange:r=>o({label:{label:r,level:t}}),label:e,level:t,orientation:n,color:s}),Zd=({label:e,...t})=>i.jsxRuntimeExports.jsx(Ou,{label:"Off Page",...t,orientation:"right"}),Gd=ve(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:r})=>i.jsxRuntimeExports.jsx(Vu,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:r,backgroundColor:e})),Yd=e=>i.jsxRuntimeExports.jsx(Vu,{...e,dimensions:{width:25,height:50}}),ce=4,ur=2,lR=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","compressor","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","fourWayValve","helicalAgitator","isoCap","isoCheckValve","isoFilter","light","manualValve","needleValve","orifice","orificePlate","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","springLoadedReliefValve","staticMixer","switch","tank","textBox","threeWayValve","vacuumPump","value","valve","vent","tJunction"],cR=re.z.enum(lR),ge={orientation:"left",scale:1},aR={...ge,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"})},uR={...ge,source:I.sourcePipeline("number",{connections:[],segments:{valueStream:I.streamChannelValue({channel:0})},outlet:"valueStream"})},dR={...ge,sink:I.sinkPipeline("number",{connections:[],segments:{setter:I.setChannelValue({channel:0})},inlet:"setter"})},Wd={...ge,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"})},Xd={...ge,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"})},_e={...Wd,...Xd},Yt={...ge,enabled:!1,clickable:!1},oe=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),xR={width:125,height:200},dr={dimensions:xR},pR=3,fR={name:"Three Way Valve",key:"threeWayValve",Form:be,Symbol:Gu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Three Way Valve"),..._e}),Preview:Ua,zIndex:ce},mR={name:"Valve",key:"valve",Form:be,Symbol:Yu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Valve"),..._e}),Preview:Qa,zIndex:ce},hR={name:"Solenoid Valve",key:"solenoidValve",Form:be,Symbol:Wu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Solenoid Valve"),normallyOpen:!1,..._e}),Preview:Ja,zIndex:ce},gR={name:"Four Way Valve",key:"fourWayValve",Form:be,Symbol:Xu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Four Way Valve"),..._e}),Preview:qa,zIndex:ce},jR={name:"Angled Valve",key:"angledValve",Form:be,Symbol:Ku,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Valve"),..._e}),Preview:su,zIndex:ce},yR={name:"Pump",key:"pump",Form:be,Symbol:qu,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Pump"),..._e}),Preview:ou,zIndex:ce},ER={name:"Screw Pump",key:"screwPump",Form:be,Symbol:ld,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Screw Pump"),..._e}),Preview:Cu,zIndex:ce},SR={name:"Tank",key:"tank",Form:Xa,Symbol:Nd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("Tank"),borderRadius:cr,...dr,...ge}),Preview:Ld,zIndex:ur},RR={name:"Cylinder",key:"cylinder",Form:Z1,Symbol:Gd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("cylinder"),dimensions:{width:66,height:181},...ge}),Preview:Yd,zIndex:ur},CR={name:"Box",key:"box",Form:()=>Xa({includeBorderRadius:!0}),Symbol:Td,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...oe("Box"),borderRadius:pR,...dr,...ge}),Preview:Ad,zIndex:ur},wR={name:"Relief Valve",key:"reliefValve",Form:Zt,Symbol:vd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Relief Valve"),...Yt}),Preview:({clickable:e,...t})=>eu(t),zIndex:ce},bR={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:Zt,Symbol:_d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Spring Loaded Relief Valve"),...Yt}),Preview:({clickable:e,...t})=>Fu(t),zIndex:ce},vR={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:Zt,Symbol:kd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Spring Loaded Relief Valve"),...Yt}),Preview:({clickable:e,...t})=>Hu(t),zIndex:ce},_R={name:"Regulator",key:"regulator",Form:ke,Symbol:ad,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Regulator"),...ge}),Preview:fu,zIndex:ce},kR={name:"Electric Regulator",key:"electricRegulator",Form:ke,Symbol:ud,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Electric Regulator"),...ge}),Preview:Mu,zIndex:ce},PR={name:"Burst Disc",key:"burstDisc",Form:ke,Symbol:dd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Burst Disc"),...ge}),Preview:ru,zIndex:ce},MR={name:"ISO Burst Disc",key:"isoBurstDisc",Form:ke,Symbol:Rd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Burst Disc"),...ge}),Preview:iu,zIndex:ce},NR={name:"Cap",key:"cap",Form:ke,Symbol:xd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cap"),...ge}),Preview:lu,zIndex:ce},LR={name:"ISO Cap",key:"isoCap",Form:ke,Symbol:pd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Cap"),...ge}),Preview:cu,zIndex:ce},TR={name:"Manual Valve",key:"manualValve",Form:Zt,Symbol:Pd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Manual Valve"),...Yt}),Preview:({clickable:e,...t})=>au(t),zIndex:ce},AR={name:"Orifice Plate",key:"orificePlate",Form:ke,Symbol:Ed,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Orifice Plate"),...ge}),Preview:uu,zIndex:ce},$R={name:"ISO Filter",key:"isoFilter",Form:ke,Symbol:Sd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Filter"),...ge}),Preview:Bu,zIndex:ce},IR={name:"Filter",key:"filter",Form:ke,Symbol:fd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Filter"),...ge}),Preview:du,zIndex:ce},DR={name:"Needle Valve",key:"needleValve",Form:Zt,Symbol:bd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Needle Valve"),...Yt}),Preview:({clickable:e,...t})=>hu(t),zIndex:ce},OR={name:"Check Valve",key:"checkValve",Form:ke,Symbol:md,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Check Valve"),...ge}),Preview:tu,zIndex:ce},zR={name:"Orifice",key:"orifice",Form:ke,Symbol:gd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Orifice"),...ge}),Preview:mu,zIndex:ce},BR={name:"Angled Relief Valve",key:"angledReliefValve",Form:Zt,Symbol:Md,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Angled Relief Valve"),...Yt}),Preview:({clickable:e,...t})=>gu(t),zIndex:ce},VR={name:"Value",key:"value",Form:$1,Symbol:Dd,Preview:Od,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...oe("Value"),...ge,telem:aR.source}),zIndex:ce},FR={name:"Button",key:"button",Symbol:zd,Form:z1,Preview:Bd,defaultProps:e=>({color:e.colors.primary.z.rgba255,...oe("Button"),...Xd,onClickDelay:0,scale:null}),zIndex:ce},HR={name:"Switch",key:"switch",Symbol:jd,Form:be,defaultProps:()=>({...oe("Switch"),..._e,scale:null}),Preview:yu,zIndex:ce},ZR={name:"Vacuum Pump",key:"vacuumPump",Symbol:Uu,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Vacuum Pump"),..._e}),Preview:wu,zIndex:ce},GR={name:"Cavity Pump",key:"cavityPump",Symbol:Qu,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cavity Pump"),..._e}),Preview:bu,zIndex:ce},YR={name:"Piston Pump",key:"pistonPump",Symbol:Ju,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Piston Pump"),..._e}),Preview:vu,zIndex:ce},WR={name:"Static Mixer",key:"staticMixer",Symbol:wd,Form:ke,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Static Mixer"),...ge}),Preview:_u,zIndex:ce},XR={name:"Rotary Mixer",key:"rotaryMixer",Symbol:ed,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Rotary Mixer"),..._e}),Preview:ku,zIndex:ce},KR={name:"Light",key:"light",Symbol:Vd,Form:D1,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Light"),...Wd}),Preview:Pu,zIndex:ce},qR={name:"Setpoint",key:"setpoint",Symbol:$d,Form:V1,defaultProps:e=>({units:"mV",color:e.colors.gray.l4.rgba255,...oe("Setpoint"),...uR,...dR}),Preview:Id,zIndex:ce},UR={name:"Agitator",key:"agitator",Symbol:td,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Agitator"),..._e}),Preview:Nu,zIndex:ce},QR={name:"Propeller Agitator",key:"propellerAgitator",Symbol:nd,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Propeller Agitator"),..._e}),Preview:Lu,zIndex:ce},JR={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:sd,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Flat Blade Agitator"),..._e}),Preview:Tu,zIndex:ce},e2={name:"Paddle Agitator",key:"paddleAgitator",Symbol:od,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Paddle Agitator"),..._e}),Preview:Au,zIndex:ce},t2={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:rd,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Cross Beam Agitator"),..._e}),Preview:$u,zIndex:ce},n2={name:"Helical Agitator",key:"helicalAgitator",Symbol:id,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Helical Agitator"),..._e}),Preview:Iu,zIndex:ce},s2={name:"Compressor",key:"compressor",Symbol:cd,Form:be,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Compressor"),..._e}),Preview:Du,zIndex:ce},o2={name:"Text Box",key:"textBox",Symbol:Su,Form:F1,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...oe("Text Box"),...ge,...dr,level:"p",text:"Text Box",width:75}),Preview:Fd,zIndex:ce},r2={name:"Off Page Reference",key:"offPageReference",Form:H1,Symbol:Hd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...oe("Off Page Reference")}),Preview:Zd,zIndex:ce},i2={name:"ISO Check Valve",key:"isoCheckValve",Form:ke,Symbol:hd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("ISO Check Valve"),...ge}),Preview:nu,zIndex:ce},l2={name:"Vent",key:"vent",Form:ke,Symbol:yd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe("Vent"),...ge}),Preview:zu,zIndex:ce},c2={name:"T Junction",key:"tJunction",Form:ke,Symbol:Cd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...oe(""),...ge}),Preview:Zu,zIndex:ce+20},a2={value:VR,button:FR,tank:SR,tJunction:c2,switch:HR,offPageReference:r2,light:KR,setpoint:qR,box:CR,textBox:o2,valve:mR,solenoidValve:hR,threeWayValve:fR,fourWayValve:gR,angledValve:jR,manualValve:TR,needleValve:DR,reliefValve:wR,angledReliefValve:BR,checkValve:OR,regulator:_R,electricRegulator:kR,pump:yR,pistonPump:YR,screwPump:ER,cavityPump:GR,vacuumPump:ZR,staticMixer:WR,rotaryMixer:XR,burstDisc:PR,isoBurstDisc:MR,cap:NR,isoCap:LR,filter:IR,isoFilter:$R,orifice:zR,orificePlate:AR,agitator:UR,propellerAgitator:QR,flatBladeAgitator:JR,paddleAgitator:e2,crossBeamAgitator:t2,helicalAgitator:n2,compressor:s2,isoCheckValve:i2,vent:l2,cylinder:RR,springLoadedReliefValve:bR,angledSpringLoadedReliefValve:vR},u2=Object.freeze(Object.defineProperty({__proto__:null,Agitator:td,AngledReliefValve:Md,AngledSpringLoadedReliefValve:kd,AngledValve:Ku,Box:Td,BoxPreview:Ad,BurstDisc:dd,Button:zd,ButtonPreview:Bd,Cap:xd,CavityPump:Qu,CheckValve:md,Compressor:cd,CrossBeamAgitator:rd,Cylinder:Gd,CylinderPreview:Yd,ElectricRegulator:ud,Filter:fd,FlatBladeAgitator:sd,FourWayValve:Xu,HelicalAgitator:id,ISOBurstDisc:Rd,ISOCap:pd,ISOCheckValve:hd,ISOFilter:Sd,Light:Vd,ManualValve:Pd,NeedleValve:bd,OffPageReference:Hd,OffPageReferencePreview:Zd,Orifice:gd,OrificePlate:Ed,PaddleAgitator:od,PistonPump:Ju,PropellerAgitator:nd,Pump:qu,Regulator:ad,ReliefValve:vd,RotaryMixer:ed,SYMBOLS:a2,ScrewPump:ld,Setpoint:$d,SetpointPreview:Id,SolenoidValve:Wu,SpringLoadedReliefValve:_d,StaticMixer:wd,Switch:jd,TJunction:Cd,Tank:Nd,TankPreview:Ld,TextBoxPreview:Fd,ThreeWayValve:Gu,VacuumPump:Uu,Value:Dd,ValuePreview:Od,Valve:Yu,Vent:yd,createDummyToggle:kt,createLabeled:ve,createToggle:we,variantZ:cR},Symbol.toStringTag,{value:"Module"}));exports.Aether=j.main;exports.Dialog=j.use$4;exports.Divider=j.Divider$1;exports.Dropdown=j.Dropdown;exports.Eraser=j.use$5;exports.Haul=j.Haul;exports.Worker=j.Context$1;exports.compareArrayDeps=j.compareArrayDeps;exports.componentRenderProp=j.componentRenderProp;exports.isRenderProp=j.isRenderProp;exports.useAsyncEffect=j.useAsyncEffect;exports.useClickOutside=j.useClickOutside;exports.useCombinedRefs=j.useCombinedRefs;exports.useCombinedStateAndRef=j.useCombinedStateAndRef;exports.useDebouncedCallback=j.useDebouncedCallback;exports.useEffectCompare=j.useEffectCompare;exports.useMemoCompare=j.useMemoCompare;exports.useMemoDeepEqualProps=j.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=j.useMemoPrimitiveArray;exports.usePrevious=j.usePrevious;exports.useResize=j.useResize;exports.useStateRef=j.useStateRef;exports.useSyncedRef=j.useSyncedRef;exports.useTransforms=j.useTransforms;exports.CSS=p.CSS;exports.newBEM=p.newBEM;exports.Header=$n.external;exports.DataType=H.g;exports.Density=H.b;exports.MultiSeries=H.Dt;exports.Rate=H.F$1;exports.Series=H.V;exports.TimeRange=H.E;exports.TimeSpan=H.w$1;exports.TimeStamp=H.m;exports.state=H.state;exports.Generic=J.Generic;exports.Align=Ux.external;exports.Icon=Ee.Icon;exports.Tabs=Ee.external;exports.Button=Qx.external;exports.Caret=$i.Animated$1;exports.telem=I.external;exports.Text=Re.external;exports.Triggers=Ii.external;exports.List=Vt.external;exports.createFilterTransform=Vt.createFilterTransform;exports.fuseFilter=Vt.fuseFilter;exports.proxyMemo=Vt.proxyMemo;exports.Color=Jx.external;exports.createHexOpacityVariants=Di.createHexOpacityVariants;exports.unitProperty=Di.unitProperty;exports.Input=Me.external;exports.Menu=ep.external;exports.Theming=tp.external;exports.Tree=np.external;exports.Video=sp.Video;exports.Accordion=jp;exports.Breadcrumb=Rp;exports.Canvas=Bp;exports.Channel=If;exports.Control=Bm;exports.Device=Jf;exports.Diagram=M1;exports.Form=qf;exports.Label=rm;exports.Legend=Gp;exports.Line=Wp;exports.LinePlot=Rf;exports.Log=L1;exports.Measure=vf;exports.Modal=lm;exports.Mosaic=wm;exports.Nav=ip;exports.Note=vm;exports.OS=Nm;exports.Observe=Xf;exports.Override=Tm;exports.Pluto=Zm;exports.Portal=hm;exports.Progress=Ym;exports.Range=wf;exports.Ranger=Jm;exports.Resize=rp;exports.Rule=_f;exports.Schematic=u2;exports.Select=af;exports.Status=ap;exports.Steps=th;exports.Synnax=bp;exports.Table=ih;exports.TableCells=wh;exports.Tag=lf;exports.Telem=Im;exports.Tooltip=up;exports.Value=uh;exports.Viewport=Ef;exports.axis=$p;exports.control=Ip;exports.useDelayedState=op;
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)||hi;if(e!==null){const u=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!t.actInsideInputWithModifier)&&yo(m))return!1;const h=ji(m.code,c);i.current.add(m[h]),gi(l,i.current,!1)&&(m.preventDefault(),s(!0))},x=m=>{if((!r.current||r.current&&!t.actInsideInputWithModifier)&&yo(m))return!1;const h=ji(m.code,c);gi(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 gi(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 A3=()=>{const e=be();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=go(n,t),{width:a,height:u}=ks(l);return jo({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=tr(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={snapToGrid:!0})=>{const{transform:s,snapGrid:r,domNode:i}=e.getState();if(!i)return t;const{x:l,y:c}=i.getBoundingClientRect(),a={x:t.x-l,y:t.y-c};return wn(a,s,n.snapToGrid,r)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),l=Oc(t,n);return{x:l.x+r,y:l.y+i}}}),[])};function pa(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)I3(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 I3(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 ma(e,t){return pa(e,t)}function fa(e,t){return pa(e,t)}function jt(e,t){return{id:e,type:"select",selected:t}}function At(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(jt(i.id,l)))}return s}function Ei({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 yi(e){return{id:e.id,type:"remove"}}const Si=e=>mj(e),$3=e=>Ac(e);function ha(e){return g.forwardRef(e)}const z3=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Ri(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>B3(()=>n(r=>r+BigInt(1))));return z3(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function B3(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const ga=g.createContext(null);function D3({children:e}){const t=be(),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(Ei({items:f,lookup:m}))},[]),s=Ri(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(Ei({items:f,lookup:m}))},[]),i=Ri(r),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsxRuntimeExports.jsx(ga.Provider,{value:l,children:e})}function O3(){const e=g.useContext(ga);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const V3=e=>!!e.panZoom;function Mt(){const e=A3(),t=be(),n=O3(),s=Ee(V3),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 S,_;const{nodeLookup:m,nodeOrigin:f}=t.getState(),h=Si(p)?p:m.get(p.id),E=h.parentId?Fc(h.position,h.measured,h.parentId,m,f):h.position,y={...h,position:E,width:((S=h.measured)==null?void 0:S.width)??h.width,height:((_=h.measured)==null?void 0:_.height)??h.height};return Ft(y)},u=(p,m,f={replace:!1})=>{l(h=>h.map(E=>{if(E.id===p){const y=typeof m=="function"?m(E):m;return f.replace&&Si(y)?y:{...E,...y}}return E}))},x=(p,m,f={replace:!1})=>{c(h=>h.map(E=>{if(E.id===p){const y=typeof m=="function"?m(E):m;return f.replace&&$3(y)?y:{...E,...y}}return E}))};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,E,y]=f;return{nodes:p.map(S=>({...S})),edges:m.map(S=>({...S})),viewport:{x:h,y:E,zoom:y}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:f,edges:h,onNodesDelete:E,onEdgesDelete:y,triggerNodeChanges:S,triggerEdgeChanges:_,onDelete:w,onBeforeDelete:R}=t.getState(),{nodes:b,edges:P}=await gj({nodesToRemove:p,edgesToRemove:m,nodes:f,edges:h,onBeforeDelete:R}),k=P.length>0,N=b.length>0;if(k){const T=P.map(yi);y==null||y(P),_(T)}if(N){const T=b.map(yi);E==null||E(b),S(T)}return(N||k)&&(w==null||w({nodes:b,edges:P})),{deletedNodes:b,deletedEdges:P}},getIntersectingNodes:(p,m=!0,f)=>{const h=Xr(p),E=h?p:a(p),y=f!==void 0;return E?(f||t.getState().nodes).filter(S=>{const _=t.getState().nodeLookup.get(S.id);if(_&&!h&&(S.id===p.id||!_.internals.positionAbsolute))return!1;const w=Ft(y?S:_),R=fn(w,E);return m&&R>0||R>=E.width*E.height}):[]},isNodeIntersecting:(p,m,f=!0)=>{const E=Xr(p)?p:a(p);if(!E)return!1;const y=fn(E,m);return f&&y>0||y>=E.width*E.height},updateNode:u,updateNodeData:(p,m,f={replace:!1})=>{u(p,h=>{const E=typeof m=="function"?m(h):m;return f.replace?{...h,data:E}:{...h,data:{...h.data,...E}}},f)},updateEdge:x,updateEdgeData:(p,m,f={replace:!1})=>{x(p,h=>{const E=typeof m=="function"?m(h):m;return f.replace?{...h,data:E}:{...h,data:{...h.data,...E}}},f)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:f}=t.getState();return fj(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??null}`))==null?void 0:h.values())??[])}}},[]);return g.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const Ci=e=>e.selected,F3={actInsideInputWithModifier:!1},H3=typeof window<"u"?window:void 0;function Z3({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=be(),{deleteElements:s}=Mt(),r=gn(e,F3),i=gn(t,{target:H3});g.useEffect(()=>{if(r){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(Ci),edges:l.filter(Ci)}),n.setState({nodesSelectionActive:!1})}},[r]),g.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function G3(e){const t=be();g.useEffect(()=>{const n=()=>{var r,i;if(!e.current)return!1;const s=ks(e.current);(s.height===0||s.width===0)&&((i=(r=t.getState()).onError)==null||i.call(r,"004",Ie.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 Ps={position:"absolute",width:"100%",height:"100%",top:0,left:0},Y3=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function W3({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=St.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:u,minZoom:x,maxZoom:p,zoomActivationKeyCode:m,preventScrolling:f=!0,children:h,noWheelClassName:E,noPanClassName:y,onViewportChange:S,isControlledViewport:_,paneClickDistance:w}){const R=be(),b=g.useRef(null),{userSelectionActive:P,lib:k}=Ee(Y3,_e),N=gn(m),T=g.useRef();G3(b);const I=g.useCallback(F=>{S==null||S({x:F[0],y:F[1],zoom:F[2]}),_||R.setState({transform:F})},[S,_]);return g.useEffect(()=>{if(b.current){T.current=Kj({domNode:b.current,minZoom:x,maxZoom:p,translateExtent:u,viewport:a,paneClickDistance:w,onDraggingChange:C=>R.setState({paneDragging:C}),onPanZoomStart:(C,A)=>{const{onViewportChangeStart:M,onMoveStart:D}=R.getState();D==null||D(C,A),M==null||M(A)},onPanZoom:(C,A)=>{const{onViewportChange:M,onMove:D}=R.getState();D==null||D(C,A),M==null||M(A)},onPanZoomEnd:(C,A)=>{const{onViewportChangeEnd:M,onMoveEnd:D}=R.getState();D==null||D(C,A),M==null||M(A)}});const{x:F,y:$,zoom:B}=T.current.getViewport();return R.setState({panZoom:T.current,transform:[F,$,B],domNode:b.current.closest(".react-flow")}),()=>{var C;(C=T.current)==null||C.destroy()}}},[]),g.useEffect(()=>{var F;(F=T.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:N,preventScrolling:f,noPanClassName:y,userSelectionActive:P,noWheelClassName:E,lib:k,onTransformChange:I})},[e,t,n,s,r,i,l,c,N,f,y,P,E,k,I]),o.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:b,style:Ps,children:h})}const X3=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function K3(){const{userSelectionActive:e,userSelectionRect:t}=Ee(X3,_e);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 eo=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},q3=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function U3({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ot.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=g.useRef(null),E=be(),y=g.useRef(0),S=g.useRef(0),_=g.useRef(),w=g.useRef(new Map),{userSelectionActive:R,elementsSelectable:b,dragging:P}=Ee(q3,_e),k=b&&(e||R),N=g.useRef(!1),T=g.useRef(!1),I=()=>{E.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,S.current=0},F=L=>{if(N.current){N.current=!1;return}c==null||c(L),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},$=L=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){L.preventDefault();return}a==null||a(L)},B=u?L=>u(L):void 0,C=L=>{var ee,ne,se,ie;const{resetSelectedElements:V,domNode:H,edgeLookup:G}=E.getState();if(_.current=H==null?void 0:H.getBoundingClientRect(),!b||!e||L.button!==0||L.target!==h.current||!_.current)return;(ne=(ee=L.target)==null?void 0:ee.setPointerCapture)==null||ne.call(ee,L.pointerId),T.current=!0,N.current=!1,w.current=new Map;for(const[U,ue]of G)w.current.set(ue.source,((se=w.current.get(ue.source))==null?void 0:se.add(U))||new Set([U])),w.current.set(ue.target,((ie=w.current.get(ue.target))==null?void 0:ie.add(U))||new Set([U]));const{x:q,y:oe}=Qe(L.nativeEvent,_.current);V(),E.setState({userSelectionRect:{width:0,height:0,startX:q,startY:oe,x:q,y:oe}}),i==null||i(L)},A=L=>{const{userSelectionRect:V,edgeLookup:H,transform:G,nodeLookup:q,triggerNodeChanges:oe,triggerEdgeChanges:ee}=E.getState();if(!_.current||!V)return;N.current=!0;const{x:ne,y:se}=Qe(L.nativeEvent,_.current),{startX:ie,startY:U}=V,ue={startX:ie,startY:U,x:ne<ie?ne:ie,y:se<U?se:U,width:Math.abs(ne-ie),height:Math.abs(se-U)},ge=Ic(q,ue,G,n===Ot.Partial,!0),pe=new Set,re=new Set;for(const Q of ge){re.add(Q.id);const le=w.current.get(Q.id);if(le)for(const je of le)pe.add(je)}if(y.current!==re.size){y.current=re.size;const Q=At(q,re,!0);oe(Q)}if(S.current!==pe.size){S.current=pe.size;const Q=At(H,pe);ee(Q)}E.setState({userSelectionRect:ue,userSelectionActive:!0,nodesSelectionActive:!1})},M=L=>{var H,G;if(L.button!==0||!T.current)return;(G=(H=L.target)==null?void 0:H.releasePointerCapture)==null||G.call(H,L.pointerId);const{userSelectionRect:V}=E.getState();!R&&V&&L.target===h.current&&(F==null||F(L)),y.current>0&&E.setState({nodesSelectionActive:!0}),I(),l==null||l(L),(t||r)&&(N.current=!1),T.current=!1},D=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxRuntimeExports.jsxs("div",{className:Me(["react-flow__pane",{draggable:D,dragging:P,selection:e}]),onClick:k?void 0:eo(F,h),onContextMenu:eo($,h),onWheel:eo(B,h),onPointerEnter:k?void 0:x,onPointerDown:k?C:p,onPointerMove:k?A:p,onPointerUp:k?M:void 0,onPointerLeave:m,ref:h,style:Ps,children:[f,o.jsxRuntimeExports.jsx(K3,{})]})}function bo({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",Ie.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 ja({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:l}){const c=be(),[a,u]=g.useState(!1),x=g.useRef();return g.useEffect(()=>{x.current=Ij({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{bo({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 J3=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Ea(){const e=be();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=J3(l),f=r?i[0]:5,h=r?i[1]:5,E=n.direction.x*f*n.factor,y=n.direction.y*h*n.factor;for(const[,S]of u){if(!m(S))continue;let _={x:S.internals.positionAbsolute.x+E,y:S.internals.positionAbsolute.y+y};r&&(_=vs(_,i));const{position:w,positionAbsolute:R}=$c({nodeId:S.id,nextPosition:_,nodeLookup:u,nodeExtent:s,nodeOrigin:x,onError:c});S.position=w,S.internals.positionAbsolute=R,p.set(S.id,S)}a(p)},[])}const lr=g.createContext(null),Q3=lr.Provider;lr.Consumer;const ya=()=>g.useContext(lr),e5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),t5=(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===vt.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,valid:x&&u}};function n5({type:e="source",position:t=K.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 C,A;const h=l||null,E=e==="target",y=be(),S=ya(),{connectOnClick:_,noPanClassName:w,rfId:R}=Ee(e5,_e),{connectingFrom:b,connectingTo:P,clickConnecting:k,isPossibleEndHandle:N,connectionInProcess:T,valid:I}=Ee(t5(S,h,e),_e);S||(A=(C=y.getState()).onError)==null||A.call(C,"010",Ie.error010());const F=M=>{const{defaultEdgeOptions:D,onConnect:L,hasDefaultEdges:V}=y.getState(),H={...D,...M};if(V){const{edges:G,setEdges:q}=y.getState();q(Kc(H,G))}L==null||L(H),c==null||c(H)},$=M=>{if(!S)return;const D=Zc(M.nativeEvent);if(r&&(D&&M.button===0||!D)){const L=y.getState();wo.onPointerDown(M.nativeEvent,{autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:E,handleId:h,nodeId:S,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:L.onConnectEnd,updateConnection:L.updateConnection,onConnect:F,isValidConnection:n||L.isValidConnection,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed})}D?x==null||x(M):p==null||p(M)},B=M=>{const{onClickConnectStart:D,onClickConnectEnd:L,connectionClickStartHandle:V,connectionMode:H,isValidConnection:G,lib:q,rfId:oe,nodeLookup:ee,connection:ne}=y.getState();if(!S||!V&&!r)return;if(!V){D==null||D(M.nativeEvent,{nodeId:S,handleId:h,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:S,type:e,id:h}});return}const se=Hc(M.target),ie=n||G,{connection:U,isValid:ue}=wo.isValid(M.nativeEvent,{handle:{nodeId:S,id:h,type:e},connectionMode:H,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:ie,flowId:oe,doc:se,lib:q,nodeLookup:ee});ue&&U&&F(U);const ge=structuredClone(ne);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,L==null||L(M,ge),y.setState({connectionClickStartHandle:null})};return o.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":S,"data-handlepos":t,"data-id":`${R}-${S}-${h}-${e}`,className:Me(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,u,{source:!E,target:E,connectable:s,connectablestart:r,connectableend:i,clickconnecting:k,connectingfrom:b,connectingto:P,valid:I,connectionindicator:s&&(!T||N)&&(T?i:r)}]),onMouseDown:$,onTouchStart:$,onClick:_?B:void 0,ref:f,...m,children:a})}const jn=g.memo(ha(n5));function s5({data:e,isConnectable:t,sourcePosition:n=K.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e==null?void 0:e.label,o.jsxRuntimeExports.jsx(jn,{type:"source",position:n,isConnectable:t})]})}function o5({data:e,isConnectable:t,targetPosition:n=K.Top,sourcePosition:s=K.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(jn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsxRuntimeExports.jsx(jn,{type:"source",position:s,isConnectable:t})]})}function r5(){return null}function i5({data:e,isConnectable:t,targetPosition:n=K.Top}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(jn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const us={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},wi={input:s5,default:o5,output:i5,group:r5};function l5(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 c5=e=>{const{width:t,height:n,x:s,y:r}=Cn(e.nodeLookup,{filter:i=>!!i.selected});return{width:Oe(t)?t:null,height:Oe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function a5({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=be(),{width:r,height:i,transformString:l,userSelectionActive:c}=Ee(c5,_e),a=Ea(),u=g.useRef(null);if(g.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]),ja({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(us,m.key)&&(m.preventDefault(),a({direction:us[m.key],factor:m.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:Me(["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 bi=typeof window<"u"?window:void 0,u5=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Sa({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:E,zoomActivationKeyCode:y,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:R,panOnScrollSpeed:b,panOnScrollMode:P,zoomOnDoubleClick:k,panOnDrag:N,defaultViewport:T,translateExtent:I,minZoom:F,maxZoom:$,preventScrolling:B,onSelectionContextMenu:C,noWheelClassName:A,noPanClassName:M,disableKeyboardA11y:D,onViewportChange:L,isControlledViewport:V}){const{nodesSelectionActive:H,userSelectionActive:G}=Ee(u5),q=gn(u,{target:bi}),oe=gn(E,{target:bi}),ee=oe||N,ne=oe||R,se=x&&ee!==!0,ie=q||G||se;return Z3({deleteKeyCode:a,multiSelectionKeyCode:h}),o.jsxRuntimeExports.jsx(W3,{onPaneContextMenu:i,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:ne,panOnScrollSpeed:b,panOnScrollMode:P,zoomOnDoubleClick:k,panOnDrag:!q&&ee,defaultViewport:T,translateExtent:I,minZoom:F,maxZoom:$,zoomActivationKeyCode:y,preventScrolling:B,noWheelClassName:A,noPanClassName:M,onViewportChange:L,isControlledViewport:V,paneClickDistance:c,children:o.jsxRuntimeExports.jsxs(U3,{onSelectionStart:m,onSelectionEnd:f,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:ee,isSelecting:!!ie,selectionMode:p,selectionKeyPressed:q,selectionOnDrag:se,children:[e,H&&o.jsxRuntimeExports.jsx(a5,{onSelectionContextMenu:C,noPanClassName:M,disableKeyboardA11y:D})]})})}Sa.displayName="FlowRenderer";const d5=g.memo(Sa),x5=e=>t=>e?Ic(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 p5(e){return Ee(g.useCallback(x5(e),[e]),_e)}const m5=e=>e.updateNodeInternals;function f5(){const e=Ee(m5),[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 h5({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=be(),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 g5({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:E,nodeTypes:y,nodeExtent:S,nodeClickDistance:_,onError:w}){const{node:R,internals:b,isParent:P}=Ee(U=>{const ue=U.nodeLookup.get(e),ge=U.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:ge}},_e);let k=R.type||"default",N=(y==null?void 0:y[k])||wi[k];N===void 0&&(w==null||w("003",Ie.error003(k)),k="default",N=wi.default);const T=!!(R.draggable||c&&typeof R.draggable>"u"),I=!!(R.selectable||a&&typeof R.selectable>"u"),F=!!(R.connectable||u&&typeof R.connectable>"u"),$=!!(R.focusable||x&&typeof R.focusable>"u"),B=be(),C=Vc(R),A=h5({node:R,nodeType:k,hasDimensions:C,resizeObserver:p}),M=ja({nodeRef:A,disabled:R.hidden||!T,noDragClassName:m,handleSelector:R.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:_}),D=Ea();if(R.hidden)return null;const L=st(R),V=l5(R),H=I||T||t||n||s||r,G=n?U=>n(U,{...b.userNode}):void 0,q=s?U=>s(U,{...b.userNode}):void 0,oe=r?U=>r(U,{...b.userNode}):void 0,ee=i?U=>i(U,{...b.userNode}):void 0,ne=l?U=>l(U,{...b.userNode}):void 0,se=U=>{const{selectNodesOnDrag:ue,nodeDragThreshold:ge}=B.getState();I&&(!ue||!T||ge>0)&&bo({id:e,store:B,nodeRef:A}),t&&t(U,{...b.userNode})},ie=U=>{if(!(yo(U.nativeEvent)||h))if(Lc.includes(U.key)&&I){const ue=U.key==="Escape";bo({id:e,store:B,unselect:ue,nodeRef:A})}else T&&R.selected&&Object.prototype.hasOwnProperty.call(us,U.key)&&(U.preventDefault(),B.setState({ariaLiveMessage:`Moved selected node ${U.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~b.positionAbsolute.x}, y: ${~~b.positionAbsolute.y}`}),D({direction:us[U.key],factor:U.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__node",`react-flow__node-${k}`,{[f]:T},R.className,{selected:R.selected,selectable:I,parent:P,draggable:T,dragging:M}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:C?"visible":"hidden",...R.style,...V},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:G,onMouseMove:q,onMouseLeave:oe,onContextMenu:ee,onClick:se,onDoubleClick:ne,onKeyDown:$?ie:void 0,tabIndex:$?0:void 0,role:$?"button":void 0,"aria-describedby":h?void 0:`${ua}-${E}`,"aria-label":R.ariaLabel,children:o.jsxRuntimeExports.jsx(Q3,{value:e,children:o.jsxRuntimeExports.jsx(N,{id:e,data:R.data,type:k,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:R.selected,selectable:I,draggable:T,deletable:R.deletable??!0,isConnectable:F,sourcePosition:R.sourcePosition,targetPosition:R.targetPosition,dragging:M,dragHandle:R.dragHandle,zIndex:b.z,parentId:R.parentId,...L})})})}const j5=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Ra(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=Ee(j5,_e),l=p5(e.onlyRenderVisibleElements),c=f5();return o.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ps,children:l.map(a=>o.jsxRuntimeExports.jsx(g5,{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))})}Ra.displayName="NodeRenderer";const E5=g.memo(Ra);function y5(e){return Ee(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&&yj({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),_e)}const S5=({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"}),R5=({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"}),vi={[is.Arrow]:S5,[is.ArrowClosed]:R5};function C5(e){const t=be();return g.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call(vi,e)?vi[e]:((i=(r=t.getState()).onError)==null||i.call(r,"009",Ie.error009(e)),null)},[e])}const w5=({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=C5(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},Ca=({defaultColor:e,rfId:t})=>{const n=Ee(i=>i.edges),s=Ee(i=>i.defaultEdgeOptions),r=g.useMemo(()=>kj(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(w5,{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};Ca.displayName="MarkerDefinitions";var b5=g.memo(Ca);function wa({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=Me(["react-flow__edge-textwrapper",u]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const E=h.current.getBBox();m({x:E.x,y:E.y,width:E.width,height:E.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]})}wa.displayName="EdgeText";const v5=g.memo(wa);function Ve({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:Me(["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&&Oe(t)&&Oe(n)?o.jsxRuntimeExports.jsx(v5,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a}):null]})}function ki({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===K.Left||e===K.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function ba({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:s,targetY:r,targetPosition:i=K.Top}){const[l,c]=ki({pos:n,x1:e,y1:t,x2:s,y2:r}),[a,u]=ki({pos:i,x1:s,y1:r,x2:e,y2:t}),[x,p,m,f]=Gc({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 va(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=K.Bottom,targetPosition:c=K.Top,label:a,labelStyle:u,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:E,markerStart:y,interactionWidth:S})=>{const[_,w,R]=ba({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:c}),b=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:b,path:_,labelX:w,labelY:R,label:a,labelStyle:u,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:E,markerStart:y,interactionWidth:S})})}const k5=va({isInternal:!1}),ka=va({isInternal:!0});k5.displayName="SimpleBezierEdge";ka.displayName="SimpleBezierEdgeInternal";function _a(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=K.Bottom,targetPosition:h=K.Top,markerEnd:E,markerStart:y,pathOptions:S,interactionWidth:_})=>{const[w,R,b]=So({sourceX:n,sourceY:s,sourcePosition:f,targetX:r,targetY:i,targetPosition:h,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset}),P=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:P,path:w,labelX:R,labelY:b,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:E,markerStart:y,interactionWidth:_})})}const Ma=_a({isInternal:!1}),Pa=_a({isInternal:!0});Ma.displayName="SmoothStepEdge";Pa.displayName="SmoothStepEdgeInternal";function La(e){return g.memo(({id:t,...n})=>{var r;const s=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ma,{...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 _5=La({isInternal:!1}),Na=La({isInternal:!0});_5.displayName="StepEdge";Na.displayName="StepEdgeInternal";function Ta(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:E})=>{const[y,S,_]=qc({sourceX:n,sourceY:s,targetX:r,targetY:i}),w=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:w,path:y,labelX:S,labelY:_,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:u,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:f,markerStart:h,interactionWidth:E})})}const M5=Ta({isInternal:!1}),Aa=Ta({isInternal:!0});M5.displayName="StraightEdge";Aa.displayName="StraightEdgeInternal";function Ia(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=K.Bottom,targetPosition:c=K.Top,label:a,labelStyle:u,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:E,markerStart:y,pathOptions:S,interactionWidth:_})=>{const[w,R,b]=Yc({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:c,curvature:S==null?void 0:S.curvature}),P=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:P,path:w,labelX:R,labelY:b,label:a,labelStyle:u,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:E,markerStart:y,interactionWidth:_})})}const P5=Ia({isInternal:!1}),$a=Ia({isInternal:!0});P5.displayName="BezierEdge";$a.displayName="BezierEdgeInternal";const _i={default:$a,straight:Aa,step:Na,smoothstep:Pa,simplebezier:ka},Mi={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},L5=(e,t,n)=>n===K.Left?e-t:n===K.Right?e+t:e,N5=(e,t,n)=>n===K.Top?e-t:n===K.Bottom?e+t:e,Pi="react-flow__edgeupdater";function Li({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:Me([Pi,`${Pi}-${c}`]),cx:L5(t,s,e),cy:N5(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function T5({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=be(),E=(R,b)=>{if(R.button!==0)return;const{autoPanOnConnect:P,domNode:k,isValidConnection:N,connectionMode:T,connectionRadius:I,lib:F,onConnectStart:$,onConnectEnd:B,cancelConnection:C,nodeLookup:A,rfId:M,panBy:D,updateConnection:L}=h.getState(),V=b.type==="target";m(!0),x==null||x(R,n,b.type);const H=(q,oe)=>{m(!1),p==null||p(q,n,b.type,oe)},G=q=>u==null?void 0:u(n,q);wo.onPointerDown(R.nativeEvent,{autoPanOnConnect:P,connectionMode:T,connectionRadius:I,domNode:k,handleId:b.id,nodeId:b.nodeId,nodeLookup:A,isTarget:V,edgeUpdaterType:b.type,lib:F,flowId:M,cancelConnection:C,panBy:D,isValidConnection:N,onConnect:G,onConnectStart:$,onConnectEnd:B,onReconnectEnd:H,updateConnection:L,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle})},y=R=>E(R,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=R=>E(R,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>f(!0),w=()=>f(!1);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&o.jsxRuntimeExports.jsx(Li,{position:c,centerX:s,centerY:r,radius:t,onMouseDown:y,onMouseEnter:_,onMouseOut:w,type:"source"}),(e===!0||e==="target")&&o.jsxRuntimeExports.jsx(Li,{position:a,centerX:i,centerY:l,radius:t,onMouseDown:S,onMouseEnter:_,onMouseOut:w,type:"target"})]})}function A5({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:E,noPanClassName:y,onError:S,disableKeyboardA11y:_}){let w=Ee(re=>re.edgeLookup.get(e));const R=Ee(re=>re.defaultEdgeOptions);w=R?{...R,...w}:w;let b=w.type||"default",P=(E==null?void 0:E[b])||_i[b];P===void 0&&(S==null||S("011",Ie.error011(b)),b="default",P=_i.default);const k=!!(w.focusable||t&&typeof w.focusable>"u"),N=typeof p<"u"&&(w.reconnectable||n&&typeof w.reconnectable>"u"),T=!!(w.selectable||s&&typeof w.selectable>"u"),I=g.useRef(null),[F,$]=g.useState(!1),[B,C]=g.useState(!1),A=be(),{zIndex:M,sourceX:D,sourceY:L,targetX:V,targetY:H,sourcePosition:G,targetPosition:q}=Ee(g.useCallback(re=>{const Q=re.nodeLookup.get(w.source),le=re.nodeLookup.get(w.target);if(!Q||!le)return{zIndex:w.zIndex,...Mi};const je=vj({id:e,sourceNode:Q,targetNode:le,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:re.connectionMode,onError:S});return{zIndex:Ej({selected:w.selected,zIndex:w.zIndex,sourceNode:Q,targetNode:le,elevateOnSelect:re.elevateEdgesOnSelect}),...je||Mi}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),_e),oe=g.useMemo(()=>w.markerStart?`url('#${Ro(w.markerStart,h)}')`:void 0,[w.markerStart,h]),ee=g.useMemo(()=>w.markerEnd?`url('#${Ro(w.markerEnd,h)}')`:void 0,[w.markerEnd,h]);if(w.hidden||D===null||L===null||V===null||H===null)return null;const ne=re=>{var Pe;const{addSelectedEdges:Q,unselectNodesAndEdges:le,multiSelectionActive:je}=A.getState();T&&(A.setState({nodesSelectionActive:!1}),w.selected&&je?(le({nodes:[],edges:[w]}),(Pe=I.current)==null||Pe.blur()):Q([e])),r&&r(re,w)},se=i?re=>{i(re,{...w})}:void 0,ie=l?re=>{l(re,{...w})}:void 0,U=c?re=>{c(re,{...w})}:void 0,ue=a?re=>{a(re,{...w})}:void 0,ge=u?re=>{u(re,{...w})}:void 0,pe=re=>{var Q;if(!_&&Lc.includes(re.key)&&T){const{unselectNodesAndEdges:le,addSelectedEdges:je}=A.getState();re.key==="Escape"?((Q=I.current)==null||Q.blur(),le({edges:[w]})):je([e])}};return o.jsxRuntimeExports.jsx("svg",{style:{zIndex:M},children:o.jsxRuntimeExports.jsxs("g",{className:Me(["react-flow__edge",`react-flow__edge-${b}`,w.className,y,{selected:w.selected,animated:w.animated,inactive:!T&&!r,updating:F,selectable:T}]),onClick:ne,onDoubleClick:se,onContextMenu:ie,onMouseEnter:U,onMouseMove:ue,onMouseLeave:ge,onKeyDown:k?pe:void 0,tabIndex:k?0:void 0,role:k?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":k?`${da}-${h}`:void 0,ref:I,children:[!B&&o.jsxRuntimeExports.jsx(P,{id:e,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:T,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:D,sourceY:L,targetX:V,targetY:H,sourcePosition:G,targetPosition:q,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:oe,markerEnd:ee,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),N&&o.jsxRuntimeExports.jsx(T5,{edge:w,isReconnectable:N,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:f,sourceX:D,sourceY:L,targetX:V,targetY:H,sourcePosition:G,targetPosition:q,setUpdateHover:$,setReconnecting:C})]})})}const I5=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function za({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:E}){const{edgesFocusable:y,edgesReconnectable:S,elementsSelectable:_,onError:w}=Ee(I5,_e),R=y5(t);return o.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[o.jsxRuntimeExports.jsx(b5,{defaultColor:e,rfId:n}),R.map(b=>o.jsxRuntimeExports.jsx(A5,{id:b,edgesFocusable:y,edgesReconnectable:S,elementsSelectable:_,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:w,edgeTypes:s,disableKeyboardA11y:E},b))]})}za.displayName="EdgeRenderer";const $5=g.memo(za),z5=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function B5({children:e}){const t=Ee(z5);return o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function D5(e){const t=Mt(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const O5=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function V5(e){const t=Ee(O5),n=be();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function F5(e){return e.connection.inProgress?{...e.connection,to:wn(e.connection.to,e.transform)}:{...e.connection}}function H5(e){return F5}function Z5(e){const t=H5();return Ee(t,_e)}const G5=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Y5({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:l,isValid:c,inProgress:a}=Ee(G5,_e);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:Me(["react-flow__connection",Tc(c)]),children:o.jsxRuntimeExports.jsx(Ba,{style:t,type:n,CustomComponent:s,isValid:c})})})}const Ba=({style:e,type:t=lt.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:l,fromHandle:c,fromPosition:a,to:u,toNode:x,toHandle:p,toPosition:m}=Z5();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:Tc(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 lt.Bezier:[f]=Yc(h);break;case lt.SimpleBezier:[f]=ba(h);break;case lt.Step:[f]=So({...h,borderRadius:0});break;case lt.SmoothStep:[f]=So(h);break;default:[f]=qc(h)}return o.jsxRuntimeExports.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:e})};Ba.displayName="ConnectionLine";const W5={};function Ni(e=W5){const t=g.useRef(e),n=be();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",Ie.error002());break}t.current=e}},[e])}function X5(){const e=be(),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",Ie.error013("react"))),t.current=!0}},[])}function Da({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:E,connectionLineComponent:y,connectionLineContainerStyle:S,selectionKeyCode:_,selectionOnDrag:w,selectionMode:R,multiSelectionKeyCode:b,panActivationKeyCode:P,zoomActivationKeyCode:k,deleteKeyCode:N,onlyRenderVisibleElements:T,elementsSelectable:I,defaultViewport:F,translateExtent:$,minZoom:B,maxZoom:C,preventScrolling:A,defaultMarkerColor:M,zoomOnScroll:D,zoomOnPinch:L,panOnScroll:V,panOnScrollSpeed:H,panOnScrollMode:G,zoomOnDoubleClick:q,panOnDrag:oe,onPaneClick:ee,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:ie,onPaneScroll:U,onPaneContextMenu:ue,paneClickDistance:ge,nodeClickDistance:pe,onEdgeContextMenu:re,onEdgeMouseEnter:Q,onEdgeMouseMove:le,onEdgeMouseLeave:je,reconnectRadius:Pe,onReconnect:qe,onReconnectStart:Is,onReconnectEnd:$s,noDragClassName:Kt,noWheelClassName:zs,noPanClassName:qt,disableKeyboardA11y:Ut,nodeExtent:Bs,rfId:Jt,viewport:Qt,onViewportChange:vn}){return Ni(e),Ni(t),X5(),D5(n),V5(Qt),o.jsxRuntimeExports.jsx(d5,{onPaneClick:ee,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:ie,onPaneContextMenu:ue,onPaneScroll:U,paneClickDistance:ge,deleteKeyCode:N,selectionKeyCode:_,selectionOnDrag:w,selectionMode:R,onSelectionStart:m,onSelectionEnd:f,multiSelectionKeyCode:b,panActivationKeyCode:P,zoomActivationKeyCode:k,elementsSelectable:I,zoomOnScroll:D,zoomOnPinch:L,zoomOnDoubleClick:q,panOnScroll:V,panOnScrollSpeed:H,panOnScrollMode:G,panOnDrag:oe,defaultViewport:F,translateExtent:$,minZoom:B,maxZoom:C,onSelectionContextMenu:p,preventScrolling:A,noDragClassName:Kt,noWheelClassName:zs,noPanClassName:qt,disableKeyboardA11y:Ut,onViewportChange:vn,isControlledViewport:!!Qt,children:o.jsxRuntimeExports.jsxs(B5,{children:[o.jsxRuntimeExports.jsx($5,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:qe,onReconnectStart:Is,onReconnectEnd:$s,onlyRenderVisibleElements:T,onEdgeContextMenu:re,onEdgeMouseEnter:Q,onEdgeMouseMove:le,onEdgeMouseLeave:je,reconnectRadius:Pe,defaultMarkerColor:M,noPanClassName:qt,disableKeyboardA11y:Ut,rfId:Jt}),o.jsxRuntimeExports.jsx(Y5,{style:E,type:h,component:y,containerStyle:S}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsxRuntimeExports.jsx(E5,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:x,nodeClickDistance:pe,onlyRenderVisibleElements:T,noPanClassName:qt,noDragClassName:Kt,disableKeyboardA11y:Ut,nodeExtent:Bs,rfId:Jt}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Da.displayName="GraphView";const K5=g.memo(Da),Ti=({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??[],E=c??[0,0],y=a??mn;Jc(p,m,f),Co(h,u,x,{nodeOrigin:E,nodeExtent:y,elevateNodesOnSelect:!1});let S=[0,0,1];if(l&&r&&i){const _=Cn(u,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:w,y:R,zoom:b}=tr(_,r,i,.5,2,.1);S=[w,R,b]}return{rfId:"1",width:0,height:0,transform:S,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:mn,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:vt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...Nc},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:cs,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},q5=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a})=>f3((u,x)=>({...Ti({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:E}=x();Co(p,m,f,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:E,checkEquality:!0}),u({nodes:p})},setEdges:p=>{const{connectionLookup:m,edgeLookup:f}=x();Jc(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:E,fitViewOnInit:y,fitViewDone:S,fitViewOnInitOptions:_,domNode:w,nodeOrigin:R,nodeExtent:b,debug:P,fitViewSync:k}=x(),{changes:N,updatedInternals:T}=Nj(p,h,E,w,R,b);if(T){if(Mj(h,E,{nodeOrigin:R,nodeExtent:b}),m.triggerFitView){let I=S;!S&&y&&(I=k({..._,nodes:_==null?void 0:_.nodes})),u({fitViewDone:I})}else u({});(N==null?void 0:N.length)>0&&(P&&console.log("React Flow: trigger node changes",N),f==null||f(N))}},updateNodePositions:(p,m=!1)=>{const f=[],h=[];for(const[E,y]of p){const S=!!(y!=null&&y.expandParent&&(y!=null&&y.parentId)&&(y!=null&&y.position)),_={id:E,type:"position",position:S?{x:Math.max(0,y.position.x),y:Math.max(0,y.position.y)}:y.position,dragging:m};S&&f.push({id:E,parentId:y.parentId,rect:{...y.internals.positionAbsolute,width:y.measured.width,height:y.measured.height}}),h.push(_)}if(f.length>0){const{nodeLookup:E,parentLookup:y,nodeOrigin:S}=x(),_=rr(f,E,y,S);h.push(..._)}x().triggerNodeChanges(h)},triggerNodeChanges:p=>{const{onNodesChange:m,setNodes:f,nodes:h,hasDefaultNodes:E,debug:y}=x();if(p!=null&&p.length){if(E){const S=ma(p,h);f(S)}y&&console.log("React Flow: trigger node changes",p),m==null||m(p)}},triggerEdgeChanges:p=>{const{onEdgesChange:m,setEdges:f,edges:h,hasDefaultEdges:E,debug:y}=x();if(p!=null&&p.length){if(E){const S=fa(p,h);f(S)}y&&console.log("React Flow: trigger edge changes",p),m==null||m(p)}},addSelectedNodes:p=>{const{multiSelectionActive:m,edgeLookup:f,nodeLookup:h,triggerNodeChanges:E,triggerEdgeChanges:y}=x();if(m){const S=p.map(_=>jt(_,!0));E(S);return}E(At(h,new Set([...p]),!0)),y(At(f))},addSelectedEdges:p=>{const{multiSelectionActive:m,edgeLookup:f,nodeLookup:h,triggerNodeChanges:E,triggerEdgeChanges:y}=x();if(m){const S=p.map(_=>jt(_,!0));y(S);return}y(At(f,new Set([...p]))),E(At(h,new Set,!0))},unselectNodesAndEdges:({nodes:p,edges:m}={})=>{const{edges:f,nodes:h,nodeLookup:E,triggerNodeChanges:y,triggerEdgeChanges:S}=x(),_=p||h,w=m||f,R=_.map(P=>{const k=E.get(P.id);return k&&(k.selected=!1),jt(P.id,!1)}),b=w.map(P=>jt(P.id,!1));y(R),S(b)},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(),E=m.reduce((S,_)=>_.selected?[...S,jt(_.id,!1)]:S,[]),y=p.reduce((S,_)=>_.selected?[...S,jt(_.id,!1)]:S,[]);f(E),h(y)},setNodeExtent:p=>{const{nodes:m,nodeLookup:f,parentLookup:h,nodeOrigin:E,elevateNodesOnSelect:y,nodeExtent:S}=x();p[0][0]===S[0][0]&&p[0][1]===S[0][1]&&p[1][0]===S[1][0]&&p[1][1]===S[1][1]||(Co(m,f,h,{nodeOrigin:E,nodeExtent:p,elevateNodesOnSelect:y,checkEquality:!1}),u({nodeExtent:p}))},panBy:p=>{const{transform:m,width:f,height:h,panZoom:E,translateExtent:y}=x();return Tj({delta:p,panZoom:E,transform:m,translateExtent:y,width:f,height:h})},fitView:p=>{const{panZoom:m,width:f,height:h,minZoom:E,maxZoom:y,nodeLookup:S}=x();if(!m)return Promise.resolve(!1);const _=go(S,p);return jo({nodes:_,width:f,height:h,panZoom:m,minZoom:E,maxZoom:y},p)},fitViewSync:p=>{const{panZoom:m,width:f,height:h,minZoom:E,maxZoom:y,nodeLookup:S}=x();if(!m)return!1;const _=go(S,p);return jo({nodes:_,width:f,height:h,panZoom:m,minZoom:E,maxZoom:y},p),_.size>0},cancelConnection:()=>{u({connection:{...Nc}})},updateConnection:p=>{u({connection:p})},reset:()=>u({...Ti()})}),Object.is);function Oa({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,fitView:l,nodeOrigin:c,nodeExtent:a,children:u}){const[x]=g.useState(()=>q5({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a}));return o.jsxRuntimeExports.jsx(h3,{value:x,children:o.jsxRuntimeExports.jsx(D3,{children:u})})}function U5({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:l,fitView:c,nodeOrigin:a,nodeExtent:u}){return g.useContext(Ms)?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):o.jsxRuntimeExports.jsx(Oa,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:u,children:e})}const J5={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Q5({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:E,onClickConnectStart:y,onClickConnectEnd:S,onNodeMouseEnter:_,onNodeMouseMove:w,onNodeMouseLeave:R,onNodeContextMenu:b,onNodeDoubleClick:P,onNodeDragStart:k,onNodeDrag:N,onNodeDragStop:T,onNodesDelete:I,onEdgesDelete:F,onDelete:$,onSelectionChange:B,onSelectionDragStart:C,onSelectionDrag:A,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:V,onBeforeDelete:H,connectionMode:G,connectionLineType:q=lt.Bezier,connectionLineStyle:oe,connectionLineComponent:ee,connectionLineContainerStyle:ne,deleteKeyCode:se="Backspace",selectionKeyCode:ie="Shift",selectionOnDrag:U=!1,selectionMode:ue=Ot.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:pe=as()?"Meta":"Control",zoomActivationKeyCode:re=as()?"Meta":"Control",snapToGrid:Q,snapGrid:le,onlyRenderVisibleElements:je=!1,selectNodesOnDrag:Pe,nodesDraggable:qe,nodesConnectable:Is,nodesFocusable:$s,nodeOrigin:Kt=xa,edgesFocusable:zs,edgesReconnectable:qt,elementsSelectable:Ut=!0,defaultViewport:Bs=M3,minZoom:Jt=.5,maxZoom:Qt=2,translateExtent:vn=mn,preventScrolling:jp=!0,nodeExtent:Ds,defaultMarkerColor:Ep="#b1b1b7",zoomOnScroll:yp=!0,zoomOnPinch:Sp=!0,panOnScroll:Rp=!1,panOnScrollSpeed:Cp=.5,panOnScrollMode:wp=St.Free,zoomOnDoubleClick:bp=!0,panOnDrag:vp=!0,onPaneClick:kp,onPaneMouseEnter:_p,onPaneMouseMove:Mp,onPaneMouseLeave:Pp,onPaneScroll:Lp,onPaneContextMenu:Np,paneClickDistance:mr=0,nodeClickDistance:Tp=0,children:Ap,onReconnect:Ip,onReconnectStart:$p,onReconnectEnd:zp,onEdgeContextMenu:Bp,onEdgeDoubleClick:Dp,onEdgeMouseEnter:Op,onEdgeMouseMove:Vp,onEdgeMouseLeave:Fp,reconnectRadius:Hp=10,onNodesChange:Zp,onEdgesChange:Gp,noDragClassName:Yp="nodrag",noWheelClassName:Wp="nowheel",noPanClassName:fr="nopan",fitView:hr,fitViewOptions:Xp,connectOnClick:Kp,attributionPosition:qp,proOptions:Up,defaultEdgeOptions:Jp,elevateNodesOnSelect:Qp,elevateEdgesOnSelect:em,disableKeyboardA11y:gr=!1,autoPanOnConnect:tm,autoPanOnNodeDrag:nm,autoPanSpeed:sm,connectionRadius:om,isValidConnection:rm,onError:im,style:lm,id:jr,nodeDragThreshold:cm,viewport:am,onViewportChange:um,width:dm,height:xm,colorMode:pm="light",debug:mm,...fm},hm){const Os=jr||"1",gm=T3(pm);return o.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...fm,style:{...lm,...J5},ref:hm,className:Me(["react-flow",r,gm]),id:jr,children:o.jsxRuntimeExports.jsxs(U5,{nodes:e,edges:t,width:dm,height:xm,fitView:hr,nodeOrigin:Kt,nodeExtent:Ds,children:[o.jsxRuntimeExports.jsx(K5,{onInit:u,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:_,onNodeMouseMove:w,onNodeMouseLeave:R,onNodeContextMenu:b,onNodeDoubleClick:P,nodeTypes:i,edgeTypes:l,connectionLineType:q,connectionLineStyle:oe,connectionLineComponent:ee,connectionLineContainerStyle:ne,selectionKeyCode:ie,selectionOnDrag:U,selectionMode:ue,deleteKeyCode:se,multiSelectionKeyCode:pe,panActivationKeyCode:ge,zoomActivationKeyCode:re,onlyRenderVisibleElements:je,defaultViewport:Bs,translateExtent:vn,minZoom:Jt,maxZoom:Qt,preventScrolling:jp,zoomOnScroll:yp,zoomOnPinch:Sp,zoomOnDoubleClick:bp,panOnScroll:Rp,panOnScrollSpeed:Cp,panOnScrollMode:wp,panOnDrag:vp,onPaneClick:kp,onPaneMouseEnter:_p,onPaneMouseMove:Mp,onPaneMouseLeave:Pp,onPaneScroll:Lp,onPaneContextMenu:Np,paneClickDistance:mr,nodeClickDistance:Tp,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:V,onReconnect:Ip,onReconnectStart:$p,onReconnectEnd:zp,onEdgeContextMenu:Bp,onEdgeDoubleClick:Dp,onEdgeMouseEnter:Op,onEdgeMouseMove:Vp,onEdgeMouseLeave:Fp,reconnectRadius:Hp,defaultMarkerColor:Ep,noDragClassName:Yp,noWheelClassName:Wp,noPanClassName:fr,rfId:Os,disableKeyboardA11y:gr,nodeExtent:Ds,viewport:am,onViewportChange:um}),o.jsxRuntimeExports.jsx(N3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:f,onConnectStart:h,onConnectEnd:E,onClickConnectStart:y,onClickConnectEnd:S,nodesDraggable:qe,nodesConnectable:Is,nodesFocusable:$s,edgesFocusable:zs,edgesReconnectable:qt,elementsSelectable:Ut,elevateNodesOnSelect:Qp,elevateEdgesOnSelect:em,minZoom:Jt,maxZoom:Qt,nodeExtent:Ds,onNodesChange:Zp,onEdgesChange:Gp,snapToGrid:Q,snapGrid:le,connectionMode:G,translateExtent:vn,connectOnClick:Kp,defaultEdgeOptions:Jp,fitView:hr,fitViewOptions:Xp,onNodesDelete:I,onEdgesDelete:F,onDelete:$,onNodeDragStart:k,onNodeDrag:N,onNodeDragStop:T,onSelectionDrag:A,onSelectionDragStart:C,onSelectionDragStop:M,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:fr,nodeOrigin:Kt,rfId:Os,autoPanOnConnect:tm,autoPanOnNodeDrag:nm,autoPanSpeed:sm,onError:im,connectionRadius:om,isValidConnection:rm,selectNodesOnDrag:Pe,nodeDragThreshold:cm,onBeforeDelete:H,paneClickDistance:mr,debug:mm}),o.jsxRuntimeExports.jsx(_3,{onSelectionChange:B}),Ap,o.jsxRuntimeExports.jsx(C3,{proOptions:Up,position:qp}),o.jsxRuntimeExports.jsx(S3,{rfId:Os,disableKeyboardA11y:gr})]})})}var eE=ha(Q5);function tE(){const e=be();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 nE({onStart:e,onChange:t,onEnd:n}){const s=be();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function sE({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:Me(["react-flow__background-pattern",n,s])})}function oE({radius:e,className:t}){return o.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Me(["react-flow__background-pattern","dots",t])})}var ut;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ut||(ut={}));const rE={[ut.Dots]:1,[ut.Lines]:1,[ut.Cross]:6},iE=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Va({id:e,variant:t=ut.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}=Ee(iE,_e),h=s||rE[t],E=t===ut.Dots,y=t===ut.Cross,S=Array.isArray(n)?n:[n,n],_=[S[0]*m[2]||1,S[1]*m[2]||1],w=h*m[2],R=Array.isArray(i)?i:[i,i],b=y?[w,w]:_,P=[R[0]*m[2]||1+b[0]/2,R[1]*m[2]||1+b[1]/2],k=`${f}${e||""}`;return o.jsxRuntimeExports.jsxs("svg",{className:Me(["react-flow__background",u]),style:{...a,...Ps,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[o.jsxRuntimeExports.jsx("pattern",{id:k,x:m[0]%_[0],y:m[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`,children:E?o.jsxRuntimeExports.jsx(oE,{radius:w/2,className:x}):o.jsxRuntimeExports.jsx(sE,{dimensions:b,lineWidth:r,variant:t,className:x})}),o.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}Va.displayName="Background";const lE=g.memo(Va);function cE(){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 aE(){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 uE(){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 dE(){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 xE(){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 $n({children:e,className:t,...n}){return o.jsxRuntimeExports.jsx("button",{type:"button",className:Me(["react-flow__controls-button",t]),...n,children:e})}const pE=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Fa({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=be(),{isInteractive:E,minZoomReached:y,maxZoomReached:S}=Ee(pE,_e),{zoomIn:_,zoomOut:w,fitView:R}=Mt(),b=()=>{_(),i==null||i()},P=()=>{w(),l==null||l()},k=()=>{R(r),c==null||c()},N=()=>{h.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),a==null||a(!E)},T=m==="horizontal"?"horizontal":"vertical";return o.jsxRuntimeExports.jsxs(ir,{className:Me(["react-flow__controls",T,u]),position:p,style:e,"data-testid":"rf__controls","aria-label":f,children:[t&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx($n,{onClick:b,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:S,children:o.jsxRuntimeExports.jsx(cE,{})}),o.jsxRuntimeExports.jsx($n,{onClick:P,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:y,children:o.jsxRuntimeExports.jsx(aE,{})})]}),n&&o.jsxRuntimeExports.jsx($n,{className:"react-flow__controls-fitview",onClick:k,title:"fit view","aria-label":"fit view",children:o.jsxRuntimeExports.jsx(uE,{})}),s&&o.jsxRuntimeExports.jsx($n,{className:"react-flow__controls-interactive",onClick:N,title:"toggle interactivity","aria-label":"toggle interactivity",children:E?o.jsxRuntimeExports.jsx(xE,{}):o.jsxRuntimeExports.jsx(dE,{})}),x]})}Fa.displayName="Controls";g.memo(Fa);function mE({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:E}=i||{},y=l||h||E;return o.jsxRuntimeExports.jsx("rect",{className:Me(["react-flow__minimap-node",{selected:m},u]),x:t,y:n,rx:x,ry:x,width:s,height:r,style:{fill:y,stroke:c,strokeWidth:a},shapeRendering:p,onClick:f?S=>f(S,e):void 0})}const fE=g.memo(mE),hE=e=>e.nodes.map(t=>t.id),to=e=>e instanceof Function?e:()=>e;function gE({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=fE,onClick:l}){const c=Ee(hE,_e),a=to(t),u=to(e),x=to(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:c.map(m=>o.jsxRuntimeExports.jsx(EE,{id:m,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function jE({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}=Ee(h=>{const E=h.nodeLookup.get(e),{x:y,y:S}=E.internals.positionAbsolute,{width:_,height:w}=st(E);return{node:E,x:y,y:S,width:_,height:w}},_e);return!u||u.hidden||!Vc(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 EE=g.memo(jE);var yE=g.memo(gE);const SE=200,RE=150,CE=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?Dc(Cn(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},wE="react-flow__minimap-desc";function Ha({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:E=!1,zoomable:y=!1,ariaLabel:S="React Flow mini map",inversePan:_,zoomStep:w=10,offsetScale:R=5}){const b=be(),P=g.useRef(null),{boundingRect:k,viewBB:N,rfId:T,panZoom:I,translateExtent:F,flowWidth:$,flowHeight:B}=Ee(CE,_e),C=(e==null?void 0:e.width)??SE,A=(e==null?void 0:e.height)??RE,M=k.width/C,D=k.height/A,L=Math.max(M,D),V=L*C,H=L*A,G=R*L,q=k.x-(V-k.width)/2-G,oe=k.y-(H-k.height)/2-G,ee=V+G*2,ne=H+G*2,se=`${wE}-${T}`,ie=g.useRef(0),U=g.useRef();ie.current=L,g.useEffect(()=>{if(P.current&&I)return U.current=Vj({domNode:P.current,panZoom:I,getTransform:()=>b.getState().transform,getViewScale:()=>ie.current}),()=>{var pe;(pe=U.current)==null||pe.destroy()}},[I]),g.useEffect(()=>{var pe;(pe=U.current)==null||pe.update({translateExtent:F,width:$,height:B,inversePan:_,pannable:E,zoomStep:w,zoomable:y})},[E,y,_,w,F,$,B]);const ue=f?pe=>{var le;const[re,Q]=((le=U.current)==null?void 0:le.pointer(pe))||[0,0];f(pe,{x:re,y:Q})}:void 0,ge=h?g.useCallback((pe,re)=>{const Q=b.getState().nodeLookup.get(re);h(pe,Q)},[]):void 0;return o.jsxRuntimeExports.jsx(ir,{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*L: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:Me(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxRuntimeExports.jsxs("svg",{width:C,height:A,viewBox:`${q} ${oe} ${ee} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:P,onClick:ue,children:[S&&o.jsxRuntimeExports.jsx("title",{id:se,children:S}),o.jsxRuntimeExports.jsx(yE,{onClick:ge,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:c}),o.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${q-G},${oe-G}h${ee+G*2}v${ne+G*2}h${-ee-G*2}z
39
+ M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Ha.displayName="MiniMap";g.memo(Ha);function bE({nodeId:e,position:t,variant:n=ln.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:E}){const y=ya(),S=typeof e=="string"?e:y,_=be(),w=g.useRef(null),R=n===ln.Line?"right":"bottom-right",b=t??R,P=g.useRef(null);g.useEffect(()=>{if(!(!w.current||!S))return P.current||(P.current=n3({domNode:w.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:I,transform:F,snapGrid:$,snapToGrid:B,nodeOrigin:C,domNode:A}=_.getState();return{nodeLookup:I,transform:F,snapGrid:$,snapToGrid:B,nodeOrigin:C,paneDomNode:A}},onChange:(I,F)=>{const{triggerNodeChanges:$,nodeLookup:B,parentLookup:C,nodeOrigin:A}=_.getState(),M=[],D={x:I.x,y:I.y},L=B.get(S);if(L&&L.expandParent&&L.parentId){const V=L.origin??A,H=I.width??L.measured.width,G=I.height??L.measured.height,q={id:L.id,parentId:L.parentId,rect:{width:H,height:G,...Fc({x:I.x??L.position.x,y:I.y??L.position.y},{width:H,height:G},L.parentId,B,V)}},oe=rr([q],B,C,A);M.push(...oe),D.x=I.x?Math.max(V[0]*H,I.x):void 0,D.y=I.y?Math.max(V[1]*G,I.y):void 0}if(D.x!==void 0&&D.y!==void 0){const V={id:S,type:"position",position:{...D}};M.push(V)}if(I.width!==void 0&&I.height!==void 0){const V={id:S,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:I.width,height:I.height}};M.push(V)}for(const V of F){const H={...V,type:"position"};M.push(H)}$(M)},onEnd:()=>{const I={id:S,type:"dimensions",resizing:!1};_.getState().triggerNodeChanges([I])}})),P.current.update({controlPosition:b,boundaries:{minWidth:c,minHeight:a,maxWidth:u,maxHeight:x},keepAspectRatio:p,onResizeStart:f,onResize:h,onResizeEnd:E,shouldResize:m}),()=>{var I;(I=P.current)==null||I.destroy()}},[b,c,a,u,x,p,f,h,E,m]);const k=b.split("-"),N=n===ln.Line?"borderColor":"backgroundColor",T=l?{...r,[N]:l}:r;return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__resize-control","nodrag",...k,n,s]),ref:w,style:T,children:i})}g.memo(bE);const vE=(e,t)=>e.map((n,s)=>d.G.translate(n,t[s])),Za=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:d.cssString(t)},...n}),kE=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:d.cssString(t),strokeDasharray:"12,4"},...n}),_E=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:d.cssString(t),strokeDasharray:"12,4,4"},...n}),ME=({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(Ve,{path:dt(r),style:{stroke:l,opacity:c},...n}),o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:l},...n}),o.jsxRuntimeExports.jsx(Ve,{path:dt(i),style:{stroke:l,opacity:c},...n})]})},Ai=5,PE=(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)<Ai||d.G.distance(m,u)<Ai)&&n.push({position:m,direction:f})}i+=a}return n},LE=({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"})},NE=({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"})]})},TE=({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}),cr=e=>{const t=({points:n,color:s,...r})=>{const i=dt(n),l=PE(n,40);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ve,{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},AE=cr(LE),IE=cr(NE),$E=cr(TE),dt=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},Ga={pipe:Za,electric:kE,secondary:_E,jacketed:ME,hydraulic:AE,pneumatic:IE,data:$E},Ya=Za,Wa=[{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"}],zE=e=>o.jsxRuntimeExports.jsx(ve.DropdownButton,{columns:[{key:"name",name:"Type"}],data:Wa,style:{width:200},entryRenderKey:"name",...e}),Ls=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Te=(e,t)=>{const n=Ls(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return d.Eo.construct(s.position,d._.scale(d.Eo.dims(d.Eo.construct(n)),1/e.getZoom()))},BE=(e,t)=>Ns.fromFlow(e,t);class Xa{constructor(t,n){Ge(this,"node_",null);Ge(this,"position");Ge(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.Eo.topLeft(this.node.box),this.position)}}class Ns{constructor(t,n,s){Ge(this,"key");Ge(this,"box");Ge(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Te(n,t),r=Ls(t),i=r.getElementsByClassName("react-flow__handle"),l=d.Eo.construct(r),c=Array.from(i).map(a=>{const u=d.Eo.center(d.Eo.construct(a)),x=d.G.translation(d.Eo.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 Xa(x,m)});return new Ns(t,s,c)}}const DE=({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=Mt(),m=Nt({sourcePos:d.G.construct(e,t),targetPos:d.G.construct(n,s),sourceOrientation:r,targetOrientation:i,sourceBox:Te(p,(l==null?void 0:l.id)??""),targetBox:Te(p,(l==null?void 0:l.id)??"")}),f=Ql(d.G.construct(e,t),m,p.getZoom(),!1);return o.jsxRuntimeExports.jsx(Ya,{points:f,style:{...c,stroke:d.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},OE=({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),E=d.G.equals(f,h.current),y=d.G.construct(m.targetX,m.targetY),S=g.useRef(y),_=d.G.equals(y,S.current),w=Mt(),[R,b,P]=j.useCombinedStateAndRef(()=>c.length>0?c:Nt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Te(w,t),targetBox:Te(w,n)})),k=g.useRef(i),N=g.useRef(s),T=j.useDebouncedCallback(a,100,[a]);if(!E||!_){let C=R;const A=d.G.translation(h.current,f),M=d.G.translation(y,S.current);d.G.equals(A,d.G.scale(M,-1),.001)?(h.current=f,S.current=y):(E?_||(C=r1({delta:M,segments:C}),k.current!==i&&(k.current=i,C=Nt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Te(w,t),targetBox:Te(w,n)})),Tr({sourcePos:f,targetPos:y,next:C,prev:R})||(C=Nt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Te(w,t),targetBox:Te(w,n)})),S.current=y):(C=o1({delta:A,segments:C}),N.current!==s&&(N.current=s,C=Nt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Te(w,t),targetBox:Te(w,n)})),Tr({sourcePos:f,targetPos:y,next:C,prev:R})||(C=Nt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Te(w,t),targetBox:Te(w,n)})),h.current=f),T(C),b(C))}const I=g.useRef(null),F=j.useCursorDrag({onStart:g.useCallback((C,A,M)=>{I.current={index:Number(M.currentTarget.id.split("-")[1]),segments:[...P.current]}},[]),onMove:g.useCallback(C=>{if(I.current==null)return;const A=e1({segments:I.current.segments,index:I.current.index,magnitude:d.Eo.dim(C,d.g.swap(I.current.segments[I.current.index].direction),!0)/w.getZoom()});b(A)},[]),onEnd:g.useCallback(()=>a(P.current),[a])}),$=Ql(f,R,w.getZoom(),!0),B=Ga[p];return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(B,{points:$,color:u}),x&&VE($).map((C,A)=>{const M=R[A].direction,D=d.g.swap(M),L={[d.g.dimension(M)]:"18px",[d.g.dimension(D)]:"4px"},V={[M]:C[M]-9,[D]:C[D]-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)",...L,...V,rx:"2px",ry:"2px"}),o.jsxRuntimeExports.jsx("foreignObject",{x:C.x-9,y:C.y-9,width:"18px",height:"18px",children:o.jsxRuntimeExports.jsx("div",{id:`handle-${A}`,className:d.CSS(d.CSS.BE("diagram-edge-handle","dragger"),d.CSS.dir(M)),draggable:!0,onDragStart:F})})]},A)})]})},VE=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)}),FE=({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}},HE=()=>!0,ZE={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},GE={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},Ka={maxZoom:1,minZoom:.5},YE={hideAttribution:!0},qa=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),bn=()=>g.useContext(qa),Ua=g.memo(({children:e})=>{const{registerNodeRenderer:t}=bn();return g.useEffect(()=>t(e),[t,e]),null});Ua.displayName="NodeRenderer";const WE=["Backspace","Delete"],XE=j.wrap$1(z.Diagram$1.TYPE,({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:s,nodes:r,edges:i,onEditableChange:l,editable:c,viewport:a,triggers:u,onViewportChange:x,fitViewOnResize:p,setFitViewOnResize:m,visible:f,...h})=>{const E=j.useMemoDeepEqualProps({visible:f}),[{path:y},,S]=j.use$3({aetherKey:e,type:z.Diagram$1.TYPE,schema:z.diagramStateZ,initialState:{position:a.position,region:d.Eo.ZERO,zoom:a.zoom,...E}});g.useEffect(()=>S(Q=>({...Q,...E})),[E]);const _=j.use().colors.gray.l9.hex,w=j.useMemoCompare(()=>u??Io.zoom,j.compareModeConfigs,[u]),{fitView:R}=Mt(),b=j.useDebouncedCallback(Q=>R(Q),50,[R]),P=En(g.useCallback(Q=>{p&&b({maxZoom:1}),S(le=>({...le,region:Q}))},[S,b,p])),k=g.useRef(null),N=g.useCallback(Q=>{const le=k.current;le!=null&&le.x===Q.x&&le.y===Q.y&&le.zoom===Q.zoom||(k.current=Q,!(isNaN(Q.x)||isNaN(Q.y)||isNaN(Q.zoom))&&(S(je=>({...je,position:Q,zoom:Q.zoom})),x(rc(Q))))},[S,x]);nE({onStart:N,onChange:N,onEnd:N});const[T,I]=g.useState(()=>()=>null),F=g.useCallback(Q=>I(()=>Q),[]),$=g.useMemo(()=>({custom:({id:Q,positionAbsoluteX:le,positionAbsoluteY:je,selected:Pe=!1,draggable:qe=!0})=>T({symbolKey:Q,position:{x:le,y:je},selected:Pe,draggable:qe})}),[T]),B=g.useRef(i),C=g.useMemo(()=>(B.current=i,Xo(i)),[i]),A=g.useRef(r),M=g.useMemo(()=>(A.current=r,Wo(r)),[r]),D=g.useCallback(Q=>n(ic(A.current,le=>ma(Q,le)),Q),[n]),L=g.useCallback(Q=>s(Vn(B.current,le=>fa(Q,le),_)),[s,_]),V=g.useCallback((Q,le)=>s(Vn(B.current,je=>Rj(Q,le,je),_)),[]),H=g.useCallback(Q=>s(Vn(B.current,le=>Kc(Q,le),_)),[s,_]),G=g.useCallback((Q,le)=>{const je=[...B.current],Pe=je.findIndex(qe=>qe.key===Q);Pe!==-1&&(je[Pe]={...je[Pe],segments:le},B.current=je,s(je))},[s]),q=c?ZE:GE,oe=j.useSyncedRef(G),ee=g.useMemo(()=>({default:Q=>{var le,je,Pe;return o.jsxRuntimeExports.jsx(OE,{...Q,segments:((le=Q.data)==null?void 0:le.segments)??[],color:(je=Q.data)==null?void 0:je.color,variant:(Pe=Q.data)==null?void 0:Pe.variant,onSegmentsChange:g.useCallback(qe=>oe.current(Q.id,qe),[Q.id])},Q.id)}}),[]),ne=j.useHeld({triggers:[["Q"]],loose:!0}),se=g.useRef(null);j.use$1({triggers:w.zoomReset,callback:g.useCallback(({stage:Q,cursor:le})=>{const je=se.current;je==null||Q!=="start"||!d.Eo.contains(je,le)||R()},[R])});const ie=j.purgeMouse(w.select)[0]??null,U=j.purgeMouse(w.pan)[0]??null,ue=j.purgeMouse(w.zoom)[0]??null,ge={selectionOnDrag:ie==null,panOnDrag:U==null,selectionKeyCode:ie,panActivationKeyCode:U,zoomActivationKeyCode:ue},pe=j.useCombinedRefs(se,P),re=g.useMemo(()=>({visible:f,editable:c,onEditableChange:l,registerNodeRenderer:F,fitViewOnResize:p,setFitViewOnResize:m}),[c,f,l,F,p]);return o.jsxRuntimeExports.jsx(qa.Provider,{value:re,children:o.jsxRuntimeExports.jsx(j.Composite,{path:y,children:f&&o.jsxRuntimeExports.jsx(eE,{...ge,className:d.CSS(d.CSS.B("diagram"),d.CSS.editable(c)),nodes:M,edges:C,nodeTypes:$,edgeTypes:ee,ref:pe,fitView:!0,onNodesChange:D,onEdgesChange:L,onConnect:H,onReconnect:V,defaultViewport:oc(a),connectionLineComponent:DE,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:HE,connectionMode:vt.Loose,fitViewOptions:Ka,selectionMode:Ot.Partial,proOptions:YE,deleteKeyCode:WE,...h,style:{[d.CSS.var("diagram-zoom")]:a.zoom,...h.style},...q,nodesDraggable:c&&!ne.held,children:t})})})}),KE=()=>{const{editable:e}=bn();return e?o.jsxRuntimeExports.jsx(lE,{}):null},qE=({children:e,...t})=>o.jsxRuntimeExports.jsx(te.Pack,{direction:"y",borderShade:4,className:d.CSS.BE("diagram","controls"),...t,children:e}),UE=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=bn();return o.jsxRuntimeExports.jsx(j.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:d.K.RIGHT_CENTER,tooltip:n?o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Disable edit mode"}):o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Enable edit mode"}),...t,children:n?o.jsxRuntimeExports.jsx(j.wt.EditOff,{}):o.jsxRuntimeExports.jsx(j.wt.Edit,{})})},JE=({onClick:e,...t})=>{const{fitView:n}=Mt(),{fitViewOnResize:s,setFitViewOnResize:r}=bn();return o.jsxRuntimeExports.jsx(j.ToggleIcon,{onClick:i=>{n(Ka),e==null||e(i)},value:s,onChange:i=>r(i),rightClickToggle:!0,tooltip:o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Fit view to contents"}),tooltipLocation:d.K.RIGHT_CENTER,variant:"outlined",...t,children:o.jsxRuntimeExports.jsx(j.wt.Expand,{})})},QE=e=>o.jsxRuntimeExports.jsx(Oa,{children:o.jsxRuntimeExports.jsx(XE,{...e})}),ey=Object.freeze(Object.defineProperty({__proto__:null,Background:KE,Controls:qE,DefaultPath:Ya,Diagram:QE,FitViewControl:JE,HandleLayout:Xa,NodeLayout:Ns,NodeRenderer:Ua,PATHS:Ga,PATH_TYPES:Wa,SelectPathType:zE,ToggleEditControl:UE,alignNodes:a1,calcPath:dt,edgeConverter:Vn,edgeZ:l1,nodeConverter:ic,nodeZ:c1,offsetPath:vE,rfEdgeDataZ:tc,selectNode:Ls,selectNodeBox:Te,selectNodeLayout:BE,translateEdgesBackward:sc,translateEdgesForward:Xo,translateNodesBackward:nc,translateNodesForward:Wo,translateViewportBackward:rc,translateViewportForward:oc,use:FE,useContext:bn,viewportZ:i1},Symbol.toStringTag,{value:"Module"})),ty=j.wrap$1("Log",({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=o.jsxRuntimeExports.jsx(j.Text$3.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:l,...c})=>{const a=j.useMemoDeepEqualProps({font:t,color:i,telem:l,visible:s}),[,{scrolling:u,empty:x},p]=j.use$3({aetherKey:e,type:z.Log.TYPE,schema:z.logState,initialState:{empty:!0,region:d.Eo.ZERO,scrolling:!1,wheelPos:0,...a}});g.useEffect(()=>{p(f=>({...f,...a}))},[a,p]);const m=En(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(j.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(j.wt.Dynamic,{})})})}),ny=Object.freeze(Object.defineProperty({__proto__:null,Log:ty},Symbol.toStringTag,{value:"Module"})),Wt=(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},sy=({value:e,hideOuter:t=!1,hideInner:n,onChange:s})=>{const{outer:r}=e,i=l=>()=>s({...e,...l});return t?o.jsxRuntimeExports.jsx(Ii,{className:d.CSS.B("orientation-control"),value:e,onChange:s}):o.jsxRuntimeExports.jsxs(te.Space,{className:d.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[o.jsxRuntimeExports.jsx(at,{selected:r==="top",onClick:i({outer:"top"})}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[o.jsxRuntimeExports.jsx(at,{selected:r==="left",onClick:i({outer:"left"})}),o.jsxRuntimeExports.jsx(Ii,{hideInner:n,value:e,onChange:s}),o.jsxRuntimeExports.jsx(at,{selected:r==="right",onClick:i({outer:"right"})})]}),o.jsxRuntimeExports.jsx(at,{selected:r==="bottom",onClick:i({outer:"bottom"})})]})},Ii=({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(te.Space,{className:d.CSS(n,d.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...r,children:[o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,className:d.CSS(d.CSS.dir("y")),selected:i==="top",onClick:l({inner:"top"})}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",justify:"center",children:[o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,selected:i==="left",onClick:l({inner:"left"})}),o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,selected:i==="right",onClick:l({inner:"right"})})]}),o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,className:d.CSS(d.CSS.dir("y")),selected:i==="bottom",onClick:l({inner:"bottom"})})]})},at=({selected:e,className:t,...n})=>o.jsxRuntimeExports.jsx(j.Icon,{variant:"text",className:d.CSS(t,d.CSS.selected(e)),...n,children:o.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Be=({className:e,direction:t,...n})=>o.jsxRuntimeExports.jsx(te.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(ye,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:r})=>{var i;return o.jsxRuntimeExports.jsx(sy,{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}})})}}),Pt=({path:e,omit:t=[]})=>o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(ye,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>o.jsxRuntimeExports.jsx(j.Text$2,{selectOnFocus:!0,...n})}),o.jsxRuntimeExports.jsx($t,{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(ye,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...n})}),o.jsxRuntimeExports.jsx(ye,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>o.jsxRuntimeExports.jsx(ps,{...n})}),o.jsxRuntimeExports.jsx(ye,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:n=>o.jsxRuntimeExports.jsx(al,{...n,yDirection:"down"})})]}),Xe=e=>o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(j.Swatch,{value:t??d.ZERO.setAlpha(1).rgba255,onChange:i=>n(i.rgba255),...r,bordered:!0})}),Ja=e=>o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(j.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)))})}),me=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{omit:e,path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(Xe,{path:"color",optional:!0}),o.jsxRuntimeExports.jsx(ye,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:s=>o.jsxRuntimeExports.jsx(j.Switch$1,{...s})}),o.jsxRuntimeExports.jsx(Ja,{path:"scale"})]})]}),o.jsxRuntimeExports.jsx(mt,{path:"",hideInner:t,hideOuter:n})]}),oy=({path:e})=>{var u,x;const{value:t,onChange:n}=pt({path:e}),s=z.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),r=z.sinkPipelinePropsZ.parse((x=t.sink)==null?void 0:x.props),i=z.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=z.setChannelValuePropsZ.parse(r.segments.setter.props),c=p=>{p??(p=0);const m=z.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:z.streamChannelValue({channel:p}),threshold:z.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:m})},a=p=>{p??(p=0);const m=z.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:z.setChannelValue({channel:p}),setpoint:z.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),f=z.authoritySource({channel:p}),h=z.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(Be,{direction:"x",grow:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"State Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Rt,{value:i.channel,onChange:c})}),o.jsxRuntimeExports.jsx(Ne.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Rt,{value:l.channel,onChange:a})}),o.jsxRuntimeExports.jsx(fs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},ar=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],Re=({hideInnerOrientation:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"control":return o.jsxRuntimeExports.jsx(oy,{path:""});default:return o.jsxRuntimeExports.jsx(me,{hideInnerOrientation:e})}},[e]),n=ke.useStatic({tabs:ar,content:t});return o.jsxRuntimeExports.jsx(ke.Tabs,{...n})},Et={y:2,x:.25},cn={lower:0,upper:2e3},$i={lower:0,upper:51},Qa=({includeBorderRadius:e=!1})=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Xe,{path:"color"}),o.jsxRuntimeExports.jsx(Xe,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(ye,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:Et,bounds:$i,endContent:"%",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:Et,bounds:$i,endContent:"%",...n})}),e&&o.jsxRuntimeExports.jsx(ye,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:Et,bounds:cn,endContent:"px",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:t??200,dragScale:Et,bounds:cn,endContent:"px",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:t??200,dragScale:Et,bounds:cn,endContent:"px",...n})})]})]}),o.jsxRuntimeExports.jsx(mt,{path:"",hideInner:!0})]}),eu=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],ry=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsxs(Be,{direction:"y",empty:!0,children:[o.jsxRuntimeExports.jsx(Go,{path:""}),";"]});default:return o.jsxRuntimeExports.jsxs(Be,{direction:"x",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Xe,{path:"color"}),o.jsxRuntimeExports.jsx(ye,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(j.Text$2,{...s})}),o.jsxRuntimeExports.jsx($t,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...s})})]})]}),o.jsxRuntimeExports.jsx(mt,{path:"",hideInner:!0})]})}},[]),t=ke.useStatic({tabs:eu,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},iy=({path:e})=>{var u;const{value:t,onChange:n}=pt({path:e}),s=z.sourcePipelinePropsZ.parse((u=t.source)==null?void 0:u.props),r=z.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=z.withinBoundsProps.parse(s.segments.threshold.props),l=x=>{x??(x=0);const p=z.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:z.streamChannelValue({channel:x}),threshold:z.withinBounds({trueBound:{lower:i.trueBound.lower??.9,upper:i.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:p})},c=x=>{const p=z.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:z.streamChannelValue({channel:r.channel}),threshold:z.withinBounds({trueBound:x})},outlet:"threshold"});n({...t,source:p})},a=xs(r.channel);return g.useEffect(()=>n({...t}),[a]),o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Rt,{value:r.channel,onChange:l})}),o.jsxRuntimeExports.jsx(Ne.Item,{label:"Lower Threshold",children:o.jsxRuntimeExports.jsx(j.Numeric,{value:i.trueBound.lower??.9,onChange:x=>c({...i.trueBound,lower:x})})}),o.jsxRuntimeExports.jsx(Ne.Item,{label:"Upper Threshold",children:o.jsxRuntimeExports.jsx(j.Numeric,{value:i.trueBound.upper??1.1,onChange:x=>c({...i.trueBound,upper:x})})})]})},ly=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsx(iy,{path:""});default:return o.jsxRuntimeExports.jsx(me,{})}},[]),t=ke.useStatic({tabs:eu,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},cy=({path:e})=>{var l;const{value:t,onChange:n}=pt({path:e}),s=z.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),r=z.setChannelValuePropsZ.parse(s.segments.setter.props),i=c=>{c??(c=0);const a=z.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:z.setChannelValue({channel:c}),setpoint:z.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),u=z.authoritySource({channel:c}),x=z.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(Be,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Output Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Rt,{value:r.channel,onChange:i})}),o.jsxRuntimeExports.jsx($t,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),o.jsxRuntimeExports.jsx(fs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},ay=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(cy,{path:""});default:return o.jsxRuntimeExports.jsx(me,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=ke.useStatic({tabs:ar,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},uy=({path:e})=>{var l;const{value:t,onChange:n}=pt({path:e}),s=z.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),r=z.setChannelValuePropsZ.parse(s.segments.setter.props),i=c=>{c??(c=0);const a=z.sinkPipeline("number",{connections:[],segments:{setter:z.setChannelValue({channel:c})},inlet:"setter"}),u=z.authoritySource({channel:c}),x=z.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(Be,{direction:"x",grow:!0,align:"stretch",children:o.jsxRuntimeExports.jsx(Ne.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Rt,{value:r.channel,onChange:i})})})},dy=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(uy,{path:""});default:return o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",align:"stretch",grow:!0,size:"small",children:[o.jsxRuntimeExports.jsx(Pt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Do,{path:"units",label:"Units",align:"start",padHelpText:!1}),o.jsxRuntimeExports.jsx(ye,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(pl,{...s})}),o.jsxRuntimeExports.jsx(Xe,{path:"color"})]})]}),o.jsxRuntimeExports.jsx(mt,{path:"",hideInner:!0})]})}},[]),t=ke.useStatic({tabs:ar,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},xy=()=>{const e=pt({path:"autoFit",optional:!0});return o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",grow:!0,children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(ye,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>o.jsxRuntimeExports.jsx(j.Text$2,{selectOnFocus:!0,...t})}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Text Size",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>o.jsxRuntimeExports.jsx(ps,{...t})})]}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Xe,{path:"color"}),o.jsxRuntimeExports.jsx(ye,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(j.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:o.jsxRuntimeExports.jsx(j.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:o.jsxRuntimeExports.jsx(j.wt.AutoFitWidth,{})})})})]})]}),o.jsxRuntimeExports.jsx(mt,{path:""})]})},py=()=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{path:"label",omit:["maxInlineSize","align","direction"]}),o.jsxRuntimeExports.jsx(Xe,{path:"color"})]}),o.jsxRuntimeExports.jsx(mt,{path:"",hideOuter:!0})]}),my=()=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Xe,{path:"color"}),o.jsxRuntimeExports.jsx(Xe,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:e??200,dragScale:Et,bounds:cn,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:e??200,dragScale:Et,bounds:cn,endContent:"px",...t})})]})]}),o.jsxRuntimeExports.jsx(mt,{path:"",hideInner:!0})]}),ft=()=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(Xe,{path:"color"}),o.jsxRuntimeExports.jsx(Ja,{path:"scale"}),o.jsxRuntimeExports.jsx(fs,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),o.jsxRuntimeExports.jsx(mt,{path:""})]}),fy=()=>o.jsxRuntimeExports.jsx(Qa,{includeBorderRadius:!0}),hy=()=>o.jsxRuntimeExports.jsx(Re,{hideInnerOrientation:!0}),O=e=>o.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),Se=e=>o.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Le=e=>o.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),fe=e=>o.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),gy={left:{left:K.Left,right:K.Right,top:K.Top,bottom:K.Bottom},right:{left:K.Right,right:K.Left,top:K.Bottom,bottom:K.Top},top:{left:K.Bottom,right:K.Top,top:K.Left,bottom:K.Right},bottom:{left:K.Top,right:K.Bottom,top:K.Right,bottom:K.Left}},jy=(e,t)=>gy[t][e],Ey=(e,t=!1)=>{if(t)return e;switch(e){case K.Left:return K.Right;case K.Right:return K.Left;case K.Top:return K.Bottom;case K.Bottom:return K.Top;default:return K.Top}},yy=(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},W=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=tE()}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=yy(i,s,t,n);return o.jsxRuntimeExports.jsx(jn,{position:Ey(jy(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}})},he=({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}),de=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:d.CSS(d.CSS.B("symbol-primitive"),e),...t}),Sy=.8,J=({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=j.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*Sy).width,...i},children:o.jsxRuntimeExports.jsx("g",{children:n})})},tu=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,orientation:t,className:d.CSS(d.CSS.B("four-way-valve"),e),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:87},color:s,scale:n,children:[o.jsxRuntimeExports.jsx(O,{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(O,{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"})]})]}),nu=({color:e,orientation:t="left",scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:d.CSS(d.CSS.B("three-way-valve")),orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[o.jsxRuntimeExports.jsx(O,{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(O,{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"})]})]}),su=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),ou=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{className:d.CSS(d.CSS.B("solenoid-valve"),s&&d.CSS.M("normally-open"),e),...i,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(O,{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(fe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),o.jsxRuntimeExports.jsx(Se,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),ru=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{className:d.CSS(d.CSS.B("relief-valve"),e),enabled:r,...i,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),iu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{orientation:t,className:d.CSS(d.CSS.B("check-valve"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),lu=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=d.cssString(n);return o.jsxRuntimeExports.jsxs(de,{...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"7",cy:"7",r:"4",fill:i}),o.jsxRuntimeExports.jsx(O,{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"})]})]})},cu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,orientation:n,className:d.CSS(d.CSS.B("angled-valve"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{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"})]})]}),au=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:d.CSS(d.CSS.B("ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"43.5978",cy:"20.972",r:"19"}),o.jsxRuntimeExports.jsx(O,{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(O,{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"})]})]}),uu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:d.CSS(d.CSS.B("three-way-ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"43.5978",cy:"21.722",r:"19"}),o.jsxRuntimeExports.jsx(O,{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(O,{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(O,{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"})]})]}),du=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:d.CSS(d.CSS.B("gate-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{d:"M43.5 2 L43.5 39.7965"})]})]}),xu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:d.CSS(d.CSS.B("butterfly-valve-one"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{d:"M43.5 2V40"}),o.jsxRuntimeExports.jsx(Le,{cx:"43.5",cy:"21",r:"10",fill:d.cssString(e)})]})]}),pu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:d.CSS(d.CSS.B("butterfly-valve-two"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"43.5",cy:"21",r:"10",fill:d.cssString(e)}),o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),mu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:d.CSS(d.CSS.B("breather-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"91",cy:"49.5",r:"6",fill:d.cssString(e)}),o.jsxRuntimeExports.jsx(Le,{cx:"8",cy:"7.5",r:"6",fill:d.cssString(e)}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),fu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)})]})]}),hu=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const i=d.cssString(t);return o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:5,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{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(O,{d:"M33 24H2",strokeLinecap:"round"})]})]})},gu=({className:e,color:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M13 68V47C13 46.4477 13.4489 45.9892 13.9928 45.8933C16.1351 45.5152 21 43.7981 21 36C21 28.2019 16.1351 26.4848 13.9928 26.1068C13.4489 26.0108 13 25.5523 13 25V4",strokeWidth:"2"})]})]}),ju=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(d.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(J,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Eu=({className:e,orientation:t="left",color:n,scale:s=1,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(d.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:50,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(J,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:o.jsxRuntimeExports.jsx(O,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),yu=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:d.CSS(d.CSS.B("manual-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Su=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(d.CSS.B("orifice_plate"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{color:n,dimensions:{width:96,height:48},orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"3",y:"3",width:"90",height:"42",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(fe,{x1:"33",y1:"3",x2:"33",y2:"21",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"33",y1:"27",x2:"33",y2:"45",strokeLinecap:"round"})]})]}),zi=(e,t)=>e/t*100,Ru=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(d.CSS.B("filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Cu=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,Ry=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}%`},wu={width:40,height:80},ur={x:50,y:10},Ts=({className:e,dimensions:t=wu,borderRadius:n=ur,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const c=Cu(n),a=s==null,u=j.use(),{width:x,height:p}=t,m=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,p,x]),f=zi(1,x),h=100-f,E=zi(1,p),y=100-E;return o.jsxRuntimeExports.jsx(de,{className:d.CSS(e,d.CSS.B("tank")),style:{...t,borderRadius:s??Ry(c),borderColor:d.cssString(r??u.colors.gray.l9),backgroundColor:d.cssString(i)},...l,children:o.jsxRuntimeExports.jsxs(W,{refreshDeps:m,orientation:"left",children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:E,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:y,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"})]})})},bu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(e,d.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{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(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),vu=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(d.CSS.B("orifice"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[o.jsxRuntimeExports.jsx(O,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),ku=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:d.CSS(d.CSS.B("needle-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{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"})]})]}),_u=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:d.CSS(d.CSS.B("angled-relief-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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(O,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),Mu=({className:e,color:t,dimensions:n,orientation:s="left",units:r="psi",unitsLevel:i="small",children:l,inlineSize:c=80,...a})=>{const u=d.cssString(t),x=j.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(de,{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(W,{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(j.Text$1,{level:i,color:p,children:r})})]})},Pu=({enabled:e=!1,onClick:t,orientation:n="left"})=>o.jsxRuntimeExports.jsxs(de,{orientation:n,children:[o.jsxRuntimeExports.jsx(j.Switch$1,{value:e,onClick:t,onChange:()=>{}}),o.jsxRuntimeExports.jsxs(W,{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"})]})]}),Lu=({onClick:e,orientation:t="left",label:n="",color:s,size:r,level:i,onClickDelay:l})=>o.jsxRuntimeExports.jsxs(de,{orientation:t,children:[o.jsxRuntimeExports.jsx(j.Button,{onClick:e,color:s,size:r,level:i,onClickDelay:l,children:n}),o.jsxRuntimeExports.jsxs(W,{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"})]})]}),Nu=({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(de,{style:a,orientation:t,className:d.CSS(d.CSS.B("text-box"),d.CSS.loc(t),e),children:o.jsxRuntimeExports.jsx(j.Text$1,{color:d.cssString(r),level:i,children:n})})},Tu=({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(de,{className:d.CSS(d.CSS.B("setpoint"),t),orientation:e,...x,children:[o.jsxRuntimeExports.jsxs(W,{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(j.Numeric,{size:a,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,outlineColor:l,borderWidth:1,children:o.jsxRuntimeExports.jsx(j.Button,{size:a,variant:"filled",onClick:()=>c(p),color:l,children:"Set"})})]})},Au=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("screw-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{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(O,{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)})]})]}),Iu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("vacuum-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),$u=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("cavity-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{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)})]})]}),zu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("piston-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{d:"M 23 32, h 16, m 0 -8, v 16",className:d.CSS(d.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Bu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("static-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Du=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("rotary-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(fe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:d.CSS(d.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:d.CSS(d.CSS.M("detail"),t)})]})]}),Ou=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,orientation:n,className:d.CSS(d.CSS.B("light"),s&&d.CSS.M("enabled"),e),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:o.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"})})]}),Vu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(e,d.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(Se,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Fu=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{d:"M43 1L45 65"})]})]}),Hu=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50.5814,top:200/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),Zu=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(Se,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Gu=({height:e=86,className:t,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(Se,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:d.CSS(d.CSS.M("detail"),t),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",className:d.CSS(d.CSS.M("detail"),t),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:d.CSS(d.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Yu=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Se,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),Wu=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,className:d.CSS(d.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(fe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Xu=({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(de,{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(j.MaybeEditable,{value:s,onChange:l,level:i,className:d.CSS.BE("symbol","label")})})})}),o.jsxRuntimeExports.jsxs(W,{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"})]})})})]})},Ku=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(d.CSS.B("vent"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),qu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(d.CSS.B("iso-filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),Uu=({className:e,dimensions:t=wu,borderRadius:n=ur,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const c=Cu(n),a=j.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(de,{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(W,{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"})]})]})},Ju=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=d.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:d.CSS(d.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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(Le,{cx:"44",cy:"55",r:"4",fill:l}),o.jsxRuntimeExports.jsx(O,{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})]})]})},Qu=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=d.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:d.CSS(d.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),o.jsxRuntimeExports.jsx(O,{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(Le,{cx:"21",cy:"56.0737",r:"4",fill:l}),o.jsxRuntimeExports.jsx(O,{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"})]})]})},ed=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(d.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:36,height:18},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),td=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:d.CSS(d.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:36,height:36},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Ze=({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"}),nd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:25},color:s})]})]}),sd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-Electromagnetic"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M47.5 17.5H55.5","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M15.5 17.5H23.5","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{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","stroke-width":"2"}),o.jsxRuntimeExports.jsx(O,{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","stroke-width":"2"}),o.jsxRuntimeExports.jsx(O,{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","stroke-width":"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:58,y:29},color:s})]})]}),od=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-VariableArea"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M46 10V25"}),o.jsxRuntimeExports.jsx(O,{d:"M23 13V22"}),o.jsxRuntimeExports.jsx(O,{d:"M23 13L46 10"}),o.jsxRuntimeExports.jsx(O,{d:"M23 22L46 25"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),rd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-Coriolis"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M2 17.6024H28.5","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M28.5 17.6024L34.6834 14.0324","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M34.8 14L45.9058 20.9666","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M51.5 17.6024L46.0141 20.8987","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M20.5 17.6024L26.6574 14.0474","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M26.75 14.1024L37.788 21.0265","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 17.6024L37.8427 21.0017","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 17.6024H69","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:58,y:29},color:s})]})]}),id=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-Nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M24 2V7V12","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M24 12H34","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M24 23H29H34","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M24 33V23","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),ld=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-Venturi"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M8 33L26.5329 22.3","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M8 2L26.5329 12.7","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M56 33L26.5876 22.2948","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M56 2L26.5876 12.7052","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:29},color:s})]})]}),cd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-RingPiston"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Le,{cx:"36.5",cy:"17.5",r:"10.5","stroke-width":"2"}),o.jsxRuntimeExports.jsx(Le,{cx:"36.5",cy:"21.5",r:"6.5","stroke-width":"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:29},color:s})]})]}),ad=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-PositiveDisplacement"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{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","stroke-width":"2"}),o.jsxRuntimeExports.jsx(O,{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","stroke-width":"2"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),ud=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-Turbine"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M16.5 17.5H54.5","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M32.5 9L35.4756 17.1753","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M38.5 26L35.5244 17.8247","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M32.5 26L35.4756 17.8247","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M38.5 9L35.5244 17.1753","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{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","stroke-width":"2"}),o.jsxRuntimeExports.jsx(O,{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","stroke-width":"2"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),dd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-Pulse"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M31 13.5H39","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M23 21.5H31","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M39 21.5H47","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M39 13.5V21.5","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31 13.5V21.5","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),xd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("flowmeter-FloatSensor"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M25 8H46","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31 27H40","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31 27L25.046 8.11641","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{d:"M40 27L45.954 8.11641","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),pd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("heat-exchanger-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(O,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),md=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(O,{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(O,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),fd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:d.CSS(d.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:199,height:48},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"3",y:"3",width:"193",height:"42",rx:"1","stroke-width":"2"}),o.jsxRuntimeExports.jsx(Se,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1","stroke-width":"2"}),o.jsxRuntimeExports.jsx(Se,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1","stroke-width":"2"}),o.jsxRuntimeExports.jsx(fe,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24","stroke-width":"2"})]})]}),hd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{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","stroke-width":"2"})]})]}),gd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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","stroke-linecap":"round"}),o.jsxRuntimeExports.jsx(O,{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","stroke-linecap":"round"})]})]}),jd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("compressor"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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","stroke-linecap":"round"})})]}),Ed=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(Le,{cx:"33",cy:"33",r:"14.5"})]})]}),yd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{d:"M35 12.4V20.4"}),o.jsxRuntimeExports.jsx(O,{d:"M3 33H16"}),o.jsxRuntimeExports.jsx(O,{d:"M35 53.6V45.6"})]})]}),Sd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{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(O,{d:"M39 33H47"}),o.jsxRuntimeExports.jsx(O,{d:"M27 33H19"}),o.jsxRuntimeExports.jsx(O,{d:"M36 27.804L40 20.8758"}),o.jsxRuntimeExports.jsx(O,{d:"M30 27.804L26 20.8758"}),o.jsxRuntimeExports.jsx(O,{d:"M30 38.196L26 45.1242"}),o.jsxRuntimeExports.jsx(O,{d:"M36 38.196L40 45.1242"})]})]}),Rd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{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"})]})]}),Cd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:d.CSS(d.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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(O,{d:"M3 33H63"})]})]}),wd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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","stroke-linecap":"round"})})]}),bd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(O,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(O,{d:"M29.12 65.62L61 34.5"})]})]}),vd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M30 2.5L30 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"})]})]}),kd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(O,{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","stroke-linecap":"square"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),_d=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(O,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(O,{d:"M29.12 65.62L61 34.5"}),o.jsxRuntimeExports.jsx(O,{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(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Md=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("thruster"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M78.5 37.5117V4.51172"}),o.jsxRuntimeExports.jsx(O,{d:"M40.5 11.5L76.0072 2.6232"}),o.jsxRuntimeExports.jsx(O,{d:"M40.5 30.5L76.0072 39.3768"}),o.jsxRuntimeExports.jsx(O,{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(O,{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"})]})]}),Pd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M2.293 2.29297L29.9383 66.7986","stroke-dasharray":"6 6"})]})]}),Ld=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:d.CSS(d.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{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(J,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M31 34.5L2.30611 2.33992","stroke-dasharray":"6 6"}),o.jsxRuntimeExports.jsx(O,{d:"M31 34.5L2.30611 66.6601","stroke-dasharray":"6 6"})]})]}),Cy=({aetherKey:e,sink:t})=>{const n=j.useMemoDeepEqualProps({sink:t}),[,,s]=j.use$3({aetherKey:e,type:z.Button.TYPE,schema:z.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])}},wy=({aetherKey:e,source:t})=>{const n=j.useMemoDeepEqualProps({source:t}),[,{enabled:s},r]=j.use$3({aetherKey:e,type:z.Light.TYPE,schema:z.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>r(i=>({...i,...n})),[n,r]),{enabled:s}},by="Schematic.Grid",vy=e=>{const n=Ls(e).closest(".react-flow__pane");n!=null&&j.triggerReflow(n)},As=e=>{const t=({symbolKey:s,items:r,onLocationChange:i})=>{const l=`${s}.${by}`,[c,a]=g.useState(!1),u=g.useCallback(({items:y})=>y.every(S=>S.type===l),[l]),x=j.useSyncedRef(i),{startDrag:p,onDragEnd:m,...f}=j.useDragAndDrop({type:l,canDrop:u,onDrop:g.useCallback(({items:y})=>y,[]),onDragOver:g.useCallback(y=>{a(u(y)),y.items.forEach(({key:S})=>x.current(S,e))},[])}),h=r.filter(y=>y.location===e),E=g.useCallback((y,S)=>p([{key:S,type:l}]),[p,l]);return o.jsxRuntimeExports.jsx(te.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:y,key:S})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(y,{draggable:!0,onDragStart:_=>E(_,S),onDragEnd:m,style:{...y.props.style,cursor:"grab"}})},S))})};return({symbolKey:s,...r})=>{const{editable:i,items:l}=r,c=g.useRef(i);if(i!==c.current&&e==="top"&&(vy(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(te.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))})}},ky=As("top"),_y=As("left"),My=As("right"),Py=As("bottom"),Lt=({editable:e,onRotate:t,children:n,...s})=>o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(ky,{editable:e,...s}),o.jsxRuntimeExports.jsx(_y,{editable:e,...s}),o.jsxRuntimeExports.jsx(My,{editable:e,...s}),o.jsxRuntimeExports.jsx(Py,{editable:e,...s}),e&&o.jsxRuntimeExports.jsx(j.Icon,{className:d.CSS.BE("grid","rotate"),size:"small",variant:"filled",onClick:t,children:o.jsxRuntimeExports.jsx(j.wt.Rotate,{})}),n]}),Ly=({aetherKey:e,source:t,sink:n})=>{const s=j.useMemoDeepEqualProps({source:t,sink:n}),[,{value:r},i]=j.use$3({aetherKey:e,type:z.Setpoint.TYPE,schema:z.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}},Ny=({aetherKey:e,source:t,sink:n})=>{const s=j.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:r,enabled:i},l]=j.use$3({aetherKey:e,type:z.Toggle.TYPE,schema:z.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}},Xt=(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(j.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}},dr=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(te.Space,{direction:d.g.swap(l),align:"center",className:d.CSS(d.CSS.B("control-state")),size:"small",children:[t&&n&&o.jsxRuntimeExports.jsx(Fl,{size:"small",...r}),t&&s&&o.jsxRuntimeExports.jsx(Gl,{...i})]}),location:l}},Ce=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}=Ny({aetherKey:n,source:r,sink:i}),E=[],y=Xt(l,c);y!=null&&E.push(y);const S=dr(s);return S!=null&&E.push(S),o.jsxRuntimeExports.jsx(Lt,{editable:u&&!a,symbolKey:n,items:E,onRotate:()=>c({orientation:d.K.rotate90(x)}),onLocationChange:(_,w)=>{_==="label"&&c({label:{...l,orientation:w}}),_==="control"&&c({control:{...s,orientation:w}})},children:o.jsxRuntimeExports.jsx(e,{enabled:m,triggered:f,onClick:h,orientation:x,...p})})};return t.displayName=e.displayName,t},xe=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,draggable:l,position:c,orientation:a="left",...u})=>{const x=[],p=Xt(s,r);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Lt,{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},ot=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=Xt(s,r);f!=null&&m.push(f);const h=()=>{x&&r({enabled:!u})};return o.jsxRuntimeExports.jsx(Lt,{items:m,editable:i&&!l,symbolKey:n,onRotate:()=>r({orientation:d.K.rotate90(a)}),onLocationChange:(E,y)=>{E==="label"&&r({label:{...s,orientation:y}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,enabled:u,onClick:h,...p})})};return t.displayName=e.displayName,t},Nd=Ce(nu),Td=Ce(su),Ad=Ce(ou),Id=Ce(tu),$d=Ce(cu),zd=Ce(fu),Bd=Ce(hd),Dd=Ce(gd),Od=Ce(Iu),Vd=Ce($u),Fd=Ce(zu),Hd=Ce(Du),Zd=Ce(Fu),Gd=Ce(Hu),Yd=Ce(Zu),Wd=Ce(Gu),Xd=Ce(Yu),Kd=Ce(Wu),qd=Ce(Au),Ud=Ce(jd),Jd=Ce(Ed),Qd=Ce(yd),ex=Ce(Sd),tx=Ce(Rd),nx=Ce(Cd),sx=Ce(xu),ox=Ce(au),rx=Ce(uu),ix=Ce(du),lx=xe(bu),cx=xe(Vu),ax=xe(hu),ux=xe(ju),dx=xe(Eu),xx=xe(Ru),px=xe(iu),mx=xe(lu),fx=xe(vu),hx=Ce(Pu),gx=xe(Ku),jx=xe(Su),Ex=xe(qu),yx=xe(gu),Sx=xe(ed),Rx=xe(td),Cx=xe(Bu),wx=xe(nd),bx=xe(sd),vx=xe(od),kx=xe(rd),_x=xe(id),Mx=xe(ld),Px=xe(cd),Lx=xe(ad),Nx=xe(ud),Tx=xe(dd),Ax=xe(xd),Ix=xe(pd),$x=xe(md),zx=xe(fd),Bx=xe(wd),Dx=xe(vd),Ox=xe(bd),Vx=xe(kd),Fx=xe(_d),Hx=xe(Md),Zx=xe(Pd),Gx=xe(Ld),Yx=ot(ku),Wx=ot(ru),Xx=ot(Ju),Kx=ot(Qu),qx=ot(yu),Ux=ot(_u),Jx=ot(pu),Qx=ot(mu),ep=xe(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Ts,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),tp=e=>o.jsxRuntimeExports.jsx(Ts,{...e,dimensions:{width:25,height:50}}),np=xe(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:r,dimensions:i})=>o.jsxRuntimeExports.jsx(Ts,{onResize:l=>n({dimensions:l}),orientation:s,color:r,dimensions:i,boxBorderRadius:t,backgroundColor:e})),sp=e=>o.jsxRuntimeExports.jsx(Ts,{...e,dimensions:{width:25,height:50},borderRadius:0}),op=({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}=Ly({aetherKey:t,source:i,sink:l}),E=[],y=dr(s);y!=null&&E.push(y);const S=Xt(e,a);return S!=null&&E.push(S),o.jsxRuntimeExports.jsx(Lt,{symbolKey:t,editable:u&&!x,onRotate:()=>a({orientation:d.K.rotate90(n)}),items:E,onLocationChange:(_,w)=>{_==="label"&&a({label:{...e,orientation:w}})},children:o.jsxRuntimeExports.jsx(Tu,{value:f,onChange:h,units:r,color:c,orientation:n,disabled:m,size:p})})},rp=({className:e,...t})=>o.jsxRuntimeExports.jsx(Tu,{value:12,onChange:()=>{},units:"mV",style:{width:120,transform:"scale(0.95)"},className:d.CSS(d.CSS.BM("setpoint","preview"),e),...t,children:o.jsxRuntimeExports.jsx(j.Text$1,{level:"p",children:"10.0"})}),ip=({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=j.useTypography(n),h=(f.lineHeight+.5)*f.baseSize+2,{width:E}=Yo({aetherKey:e,color:r,level:n,box:d.Eo.construct(d.G.translateY({...s},1),{height:h,width:u}),telem:l,minWidth:u,notation:m}),y=[],S=Xt(t,a);return S!=null&&y.push(S),o.jsxRuntimeExports.jsx(Lt,{editable:x&&!p,symbolKey:e,items:y,onLocationChange:(_,w)=>{_==="label"&&a({label:{...t,orientation:w}})},children:o.jsxRuntimeExports.jsx(Mu,{color:i,dimensions:{height:h,width:E},inlineSize:u,units:c,unitsLevel:Z.downLevel(n)})})},lp=({color:e})=>o.jsxRuntimeExports.jsx(Mu,{color:e,dimensions:{width:60,height:25},units:"psi",children:o.jsxRuntimeExports.jsx(j.Text$1,{level:"p",children:"50.00"})}),cp=({symbolKey:e,label:t,orientation:n="left",sink:s,control:r,selected:i,draggable:l,onChange:c,...a})=>{const{click:u}=Cy({aetherKey:e,sink:s}),x=[],p=dr(r);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Lt,{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(Lu,{...t,onClick:u,orientation:n,...a})})},ap=({label:e,...t})=>o.jsxRuntimeExports.jsx(Lu,{label:"Button",...t}),up=({symbolKey:e,label:t,source:n,onChange:s,selected:r,draggable:i,...l})=>{const{enabled:c}=wy({aetherKey:e,source:n}),a=[],u=Xt(t,s);return u!=null&&a.push(u),o.jsxRuntimeExports.jsx(Lt,{items:a,editable:r&&!i,symbolKey:e,onLocationChange:(x,p)=>{x==="label"&&s({label:{...t,orientation:p}})},children:o.jsxRuntimeExports.jsx(Ou,{enabled:c,...l})})},dp=e=>o.jsxRuntimeExports.jsx(Nu,{...e,autoFit:!0,text:"Text Box"}),xp=({label:{label:e,level:t},orientation:n,color:s,onChange:r})=>o.jsxRuntimeExports.jsx(Xu,{onLabelChange:i=>r({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),pp=({label:e,...t})=>o.jsxRuntimeExports.jsx(Xu,{label:"Off Page",...t,orientation:"right"}),mp=xe(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Uu,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),fp=e=>o.jsxRuntimeExports.jsx(Uu,{...e,dimensions:{width:25,height:50}}),X=4,xr=2,Ty=["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"],Ay=ce.z.enum(Ty),ae={orientation:"left",scale:1},Iy={...ae,source:z.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:z.streamChannelValue({channel:0}),rollingAverage:z.rollingAverage({windowSize:1}),stringifier:z.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},$y={...ae,source:z.sourcePipeline("number",{connections:[],segments:{valueStream:z.streamChannelValue({channel:0})},outlet:"valueStream"})},zy={...ae,sink:z.sinkPipeline("number",{connections:[],segments:{setter:z.setChannelValue({channel:0})},inlet:"setter"})},hp={...ae,source:z.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:z.streamChannelValue({channel:0}),threshold:z.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},gp={...ae,control:{show:!0},sink:z.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:z.setChannelValue({channel:0}),setpoint:z.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},we={...hp,...gp},ht={...ae,enabled:!1,clickable:!1},Y=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),By={width:125,height:200},pr={dimensions:By},Dy=3,Oy={name:"Three Way Valve",key:"threeWayValve",Form:Re,Symbol:Nd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Three Way Valve"),...we}),Preview:nu,zIndex:X},Vy={name:"Valve",key:"valve",Form:Re,Symbol:Td,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Valve"),...we}),Preview:su,zIndex:X},Fy={name:"Solenoid Valve",key:"solenoidValve",Form:Re,Symbol:Ad,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Solenoid Valve"),normallyOpen:!1,...we}),Preview:ou,zIndex:X},Hy={name:"Four Way Valve",key:"fourWayValve",Form:Re,Symbol:Id,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Four Way Valve"),...we}),Preview:tu,zIndex:X},Zy={name:"Angled Valve",key:"angledValve",Form:Re,Symbol:$d,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Angled Valve"),...we}),Preview:cu,zIndex:X},Gy={name:"Ball Valve",key:"ballValve",Form:Re,Symbol:ox,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ball Valve"),...we}),Preview:au,zIndex:X},Yy={name:"Three-Way Ball Valve",key:"threeWayBallValve",Form:Re,Symbol:rx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Three-Way Ball Valve"),...we}),Preview:uu,zIndex:X},Wy={name:"Gate Valve",key:"gateValve",Form:Re,Symbol:ix,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Gate Valve"),...we}),Preview:du,zIndex:X},Xy={name:"Butterfly Valve (Remote)",key:"butterflyValveOne",Form:Re,Symbol:sx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Butterfly Valve (Remote)"),...we}),Preview:xu,zIndex:X},Ky={name:"Butterfly Valve (Manual)",key:"butterflyValveTwo",Form:ft,Symbol:Jx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Butterfly Valve (Manual)"),...ht}),Preview:({clickable:e,...t})=>pu(t),zIndex:X},qy={name:"Breather Valve",key:"breatherValve",Form:ft,Symbol:Qx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Breather Valve"),...ht}),Preview:mu,zIndex:X},Uy={name:"Pump",key:"pump",Form:Re,Symbol:zd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Pump"),...we}),Preview:fu,zIndex:X},Jy={name:"Screw Pump",key:"screwPump",Form:Re,Symbol:qd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Screw Pump"),...we}),Preview:Au,zIndex:X},Qy={name:"Tank",key:"tank",Form:Qa,Symbol:ep,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Y("Tank"),borderRadius:ur,...pr,...ae}),Preview:tp,zIndex:xr},e4={name:"Cylinder",key:"cylinder",Form:my,Symbol:mp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Y("cylinder"),dimensions:{width:66,height:181},...ae}),Preview:fp,zIndex:xr},t4={name:"Box",key:"box",Form:fy,Symbol:np,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Y("Box"),borderRadius:Dy,...pr,...ae}),Preview:sp,zIndex:xr},n4={name:"Relief Valve",key:"reliefValve",Form:ft,Symbol:Wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Relief Valve"),...ht}),Preview:Wt(ru,["clickable"]),zIndex:X},s4={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:ft,Symbol:Xx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Spring Loaded Relief Valve"),...ht}),Preview:Wt(Ju,["clickable"]),zIndex:X},o4={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:ft,Symbol:Kx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Angled Spring Loaded Relief Valve"),...ht}),Preview:Wt(Qu,["clickable"]),zIndex:X},r4={name:"Regulator",key:"regulator",Form:me,Symbol:lx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Regulator"),...ae}),Preview:bu,zIndex:X},i4={name:"Electric Regulator",key:"electricRegulator",Form:me,Symbol:cx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Electric Regulator"),...ae}),Preview:Vu,zIndex:X},l4={name:"Burst Disc",key:"burstDisc",Form:me,Symbol:ax,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Burst Disc"),...ae}),Preview:hu,zIndex:X},c4={name:"ISO Burst Disc",key:"isoBurstDisc",Form:me,Symbol:yx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Burst Disc"),...ae}),Preview:gu,zIndex:X},a4={name:"Cap",key:"cap",Form:me,Symbol:ux,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Cap"),...ae}),Preview:ju,zIndex:X},u4={name:"ISO Cap",key:"isoCap",Form:me,Symbol:dx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Cap"),...ae}),Preview:Eu,zIndex:X},d4={name:"Manual Valve",key:"manualValve",Form:ft,Symbol:qx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Manual Valve"),...ht}),Preview:Wt(yu,["clickable"]),zIndex:X},x4={name:"Orifice Plate",key:"orificePlate",Form:me,Symbol:jx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Orifice Plate"),...ae}),Preview:Su,zIndex:X},p4={name:"ISO Filter",key:"isoFilter",Form:me,Symbol:Ex,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Filter"),...ae}),Preview:qu,zIndex:X},m4={name:"Filter",key:"filter",Form:me,Symbol:xx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Filter"),...ae}),Preview:Ru,zIndex:X},f4={name:"Needle Valve",key:"needleValve",Form:ft,Symbol:Yx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Needle Valve"),...ht}),Preview:Wt(ku,["clickable"]),zIndex:X},h4={name:"Check Valve",key:"checkValve",Form:me,Symbol:px,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Check Valve"),...ae}),Preview:iu,zIndex:X},g4={name:"Orifice",key:"orifice",Form:me,Symbol:fx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Orifice"),...ae}),Preview:vu,zIndex:X},j4={name:"Angled Relief Valve",key:"angledReliefValve",Form:ft,Symbol:Ux,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Angled Relief Valve"),...ht}),Preview:Wt(_u,["clickable"]),zIndex:X},E4={name:"Value",key:"value",Form:ry,Symbol:ip,Preview:lp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...Y("Value"),...ae,telem:Iy.source}),zIndex:X},y4={name:"Button",key:"button",Symbol:cp,Form:ay,Preview:ap,defaultProps:e=>({color:e.colors.primary.z.rgba255,...Y("Button"),...gp,onClickDelay:0,scale:null}),zIndex:X},S4={name:"Switch",key:"switch",Symbol:hx,Form:hy,defaultProps:()=>({...Y("Switch"),...we,scale:null}),Preview:Pu,zIndex:X},R4={name:"Vacuum Pump",key:"vacuumPump",Symbol:Od,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Vacuum Pump"),...we}),Preview:Iu,zIndex:X},C4={name:"Compressor",key:"compressor",Symbol:Ud,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Compressor"),...we}),Preview:jd,zIndex:X},w4={name:"Cavity Pump",key:"cavityPump",Symbol:Vd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Cavity Pump"),...we}),Preview:$u,zIndex:X},b4={name:"Piston Pump",key:"pistonPump",Symbol:Fd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Piston Pump"),...we}),Preview:zu,zIndex:X},v4={name:"Static Mixer",key:"staticMixer",Symbol:Cx,Form:me,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Static Mixer"),...ae}),Preview:Bu,zIndex:X},k4={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Hd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Rotary Mixer"),...we}),Preview:Du,zIndex:X},_4={name:"Light",key:"light",Symbol:up,Form:ly,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Light"),...hp}),Preview:Ou,zIndex:X},M4={name:"Setpoint",key:"setpoint",Symbol:op,Form:dy,defaultProps:e=>({units:"mV",color:e.colors.gray.l9.rgba255,size:"small",...Y("Setpoint"),...$y,...zy}),Preview:rp,zIndex:X},P4={name:"Agitator",key:"agitator",Symbol:Zd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Agitator"),...we}),Preview:Fu,zIndex:X},L4={name:"Propeller Agitator",key:"propellerAgitator",Symbol:Gd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Propeller Agitator"),...we}),Preview:Hu,zIndex:X},N4={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:Yd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flat Blade Agitator"),...we}),Preview:Zu,zIndex:X},T4={name:"Paddle Agitator",key:"paddleAgitator",Symbol:Wd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Paddle Agitator"),...we}),Preview:Gu,zIndex:X},A4={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:Xd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Cross Beam Agitator"),...we}),Preview:Yu,zIndex:X},I4={name:"Helical Agitator",key:"helicalAgitator",Symbol:Kd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Helical Agitator"),...we}),Preview:Wu,zIndex:X},$4={name:"Text Box",key:"textBox",Symbol:Nu,Form:xy,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...Y("Text Box"),...ae,...pr,level:"p",text:"Text Box",width:75}),Preview:dp,zIndex:X},z4={name:"Off Page Reference",key:"offPageReference",Form:py,Symbol:xp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...Y("Off Page Reference")}),Preview:pp,zIndex:X},B4={name:"ISO Check Valve",key:"isoCheckValve",Form:me,Symbol:mx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Check Valve"),...ae}),Preview:lu,zIndex:X},D4={name:"Vent",key:"vent",Form:me,Symbol:gx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Vent"),...ae}),Preview:Ku,zIndex:X},O4={name:"T Junction",key:"tJunction",Form:me,Symbol:Sx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y(""),...ae}),Preview:ed,zIndex:X+20},V4={name:"Cross Junction",key:"crossJunction",Form:me,Symbol:Rx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y(""),...ae}),Preview:td,zIndex:X+20},F4={name:"Flowmeter General",key:"flowmeterGeneral",Form:me,Symbol:wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("General Flowmeter"),...ae}),Preview:nd,zIndex:X},H4={name:"Flowmeter Electromagnetic",key:"flowmeterElectromagnetic",Form:me,Symbol:bx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Electromagnetic Flowmeter"),...ae}),Preview:sd,zIndex:X},Z4={name:"Flowmeter Variable Area",key:"flowmeterVariableArea",Form:me,Symbol:vx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Variable Area Flowmeter"),...ae}),Preview:od,zIndex:X},G4={name:"Flowmeter Coriolis",key:"flowmeterCoriolis",Form:me,Symbol:kx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Coriolis Flowmeter"),...ae}),Preview:rd,zIndex:X},Y4={name:"Flowmeter Nozzle",key:"flowmeterNozzle",Form:me,Symbol:_x,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Nozzle Flowmeter"),...ae}),Preview:id,zIndex:X},W4={name:"Flowmeter Venturi",key:"flowmeterVenturi",Form:me,Symbol:Mx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Venturi Flowmeter"),...ae}),Preview:ld,zIndex:X},X4={name:"Flowmeter Ring Piston",key:"flowmeterRingPiston",Form:me,Symbol:Px,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ring Piston Flowmeter"),...ae}),Preview:cd,zIndex:X},K4={name:"Flowmeter Positive Displacement",key:"flowmeterPositiveDisplacement",Form:me,Symbol:Lx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Positive Displacement Flowmeter"),...ae}),Preview:ad,zIndex:X},q4={name:"Flowmeter Turbine",key:"flowmeterTurbine",Form:me,Symbol:Nx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Turbine Flowmeter"),...ae}),Preview:ud,zIndex:X},U4={name:"Flowmeter Pulse",key:"flowmeterPulse",Form:me,Symbol:Tx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Pulse Flowmeter"),...ae}),Preview:dd,zIndex:X},J4={name:"Flowmeter Float Sensor",key:"flowmeterFloatSensor",Form:me,Symbol:Ax,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Float Sensor Flowmeter"),...ae}),Preview:xd,zIndex:X},Q4={name:"Heat Exchanger General",key:"heatExchangerGeneral",Form:me,Symbol:Ix,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("General Heat Exchanger"),...ae}),Preview:pd,zIndex:X},eS={name:"Heat Exchanger M",key:"heatExchangerM",Form:me,Symbol:$x,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("M Heat Exchanger"),...ae}),Preview:md,zIndex:X},tS={name:"Heat Exchanger Straight Tube",key:"heatExchangerStraightTube",Form:me,Symbol:zx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Straight Tube Heat Exchanger"),...ae}),Preview:fd,zIndex:X},nS={name:"Turbo Compressor",key:"turboCompressor",Form:Re,Symbol:Jd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Turbo Compressor"),...we}),Preview:Ed,zIndex:X},sS={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:Re,Symbol:Qd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Roller Vane Compressor"),...we}),Preview:yd,zIndex:X},oS={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:Re,Symbol:ex,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Liquid Ring Compressor"),...we}),Preview:Sd,zIndex:X},rS={name:"Ejector Compressor",key:"ejectorCompressor",Form:Re,Symbol:tx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ejector Compressor"),...we}),Preview:Rd,zIndex:X},iS={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:Re,Symbol:nx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Centrifugal Compressor"),...we}),Preview:Cd,zIndex:X},lS={name:"Diaphragm Pump",key:"diaphragmPump",Form:Re,Symbol:Bd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Diaphragm Pump"),...we}),Preview:hd,zIndex:X},cS={name:"Ejection Pump",key:"ejectionPump",Form:Re,Symbol:Dd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ejection Pump"),...we}),Preview:gd,zIndex:X},aS={name:"Flame Arrestor",key:"flameArrestor",Form:me,Symbol:Bx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor"),...ae}),Preview:wd,zIndex:X},uS={name:"Flame Arrestor (Explosion-Proof)",key:"flameArrestorExplosion",Form:me,Symbol:Dx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Explosion-Proof)"),...ae}),Preview:vd,zIndex:X},dS={name:"Flame Arrestor (Detonation-Proof)",key:"flameArrestorDetonation",Form:me,Symbol:Ox,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Detonation-Proof)"),...ae}),Preview:bd,zIndex:X},xS={name:"Flame Arrestor (Fire Resistant)",key:"flameArrestorFireRes",Form:me,Symbol:Vx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Fire Resistant)"),...ae}),Preview:kd,zIndex:X},pS={name:"Flame Arrestor (Fire Resistant and Detonation-Proof)",key:"flameArrestorFireResDetonation",Form:me,Symbol:Fx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...ae}),Preview:_d,zIndex:X},mS={name:"Thruster",key:"thruster",Form:Re,Symbol:Hx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Thruster"),...we}),Preview:Md,zIndex:X},fS={name:"Strainer",key:"strainer",Form:me,Symbol:Zx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Strainer"),...ae}),Preview:Pd,zIndex:X},hS={name:"Strainer Cone",key:"strainerCone",Form:me,Symbol:Gx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Strainer Cone"),...ae}),Preview:Ld,zIndex:X},gS={value:E4,button:y4,tank:Qy,tJunction:O4,crossJunction:V4,switch:S4,offPageReference:z4,light:_4,setpoint:M4,box:t4,textBox:$4,valve:Vy,solenoidValve:Fy,threeWayValve:Oy,fourWayValve:Hy,angledValve:Zy,ballValve:Gy,threeWayBallValve:Yy,gateValve:Wy,butterflyValveOne:Xy,butterflyValveTwo:Ky,breatherValve:qy,manualValve:d4,needleValve:f4,reliefValve:n4,angledReliefValve:j4,checkValve:h4,regulator:r4,electricRegulator:i4,springLoadedReliefValve:s4,angledSpringLoadedReliefValve:o4,pump:Uy,pistonPump:b4,screwPump:Jy,cavityPump:w4,diaphragmPump:lS,ejectionPump:cS,vacuumPump:R4,compressor:C4,turboCompressor:nS,rollerVaneCompressor:sS,liquidRingCompressor:oS,ejectorCompressor:rS,centrifugalCompressor:iS,staticMixer:v4,rotaryMixer:k4,burstDisc:l4,isoBurstDisc:c4,cap:a4,isoCap:u4,filter:m4,isoFilter:p4,orifice:g4,orificePlate:x4,agitator:P4,propellerAgitator:L4,flatBladeAgitator:N4,paddleAgitator:T4,crossBeamAgitator:A4,helicalAgitator:I4,isoCheckValve:B4,vent:D4,cylinder:e4,flowmeterGeneral:F4,flowmeterElectromagnetic:H4,flowmeterVariableArea:Z4,flowmeterCoriolis:G4,flowmeterNozzle:Y4,flowmeterVenturi:W4,flowmeterRingPiston:X4,flowmeterPositiveDisplacement:K4,flowmeterTurbine:q4,flowmeterPulse:U4,flowmeterFloatSensor:J4,heatExchangerGeneral:Q4,heatExchangerM:eS,heatExchangerStraightTube:tS,flameArrestor:aS,flameArrestorExplosion:uS,flameArrestorDetonation:dS,flameArrestorFireRes:xS,flameArrestorFireResDetonation:pS,thruster:mS,strainer:fS,strainerCone:hS},jS=Object.freeze(Object.defineProperty({__proto__:null,Agitator:Zd,AngledReliefValve:Ux,AngledSpringLoadedReliefValve:Kx,AngledValve:$d,BallValve:ox,Box:np,BoxPreview:sp,BreatherValve:Qx,BurstDisc:ax,ButterflyValveOne:sx,ButterflyValveTwo:Jx,Button:cp,ButtonPreview:ap,Cap:ux,CavityPump:Vd,CentrifugalCompressor:nx,CheckValve:px,Compressor:Ud,CrossBeamAgitator:Xd,CrossJunction:Rx,Cylinder:mp,CylinderPreview:fp,DiaphragmPump:Bd,EjectionPump:Dd,EjectorCompressor:tx,ElectricRegulator:cx,Filter:xx,FlameArrestor:Bx,FlameArrestorDetonation:Ox,FlameArrestorExplosion:Dx,FlameArrestorFireRes:Vx,FlameArrestorFireResDetonation:Fx,FlatBladeAgitator:Yd,FlowmeterCoriolis:kx,FlowmeterElectromagnetic:bx,FlowmeterFloatSensor:Ax,FlowmeterGeneral:wx,FlowmeterNozzle:_x,FlowmeterPositiveDisplacement:Lx,FlowmeterPulse:Tx,FlowmeterRingPiston:Px,FlowmeterTurbine:Nx,FlowmeterVariableArea:vx,FlowmeterVenturi:Mx,FourWayValve:Id,GateValve:ix,HeatExchangerGeneral:Ix,HeatExchangerM:$x,HeatExchangerStraightTube:zx,HelicalAgitator:Kd,ISOBurstDisc:yx,ISOCap:dx,ISOCheckValve:mx,ISOFilter:Ex,Light:up,LiquidRingCompressor:ex,ManualValve:qx,NeedleValve:Yx,OffPageReference:xp,OffPageReferencePreview:pp,Orifice:fx,OrificePlate:jx,PaddleAgitator:Wd,PistonPump:Fd,PropellerAgitator:Gd,Pump:zd,Regulator:lx,ReliefValve:Wx,RollerVaneCompressor:Qd,RotaryMixer:Hd,SYMBOLS:gS,ScrewPump:qd,Setpoint:op,SetpointPreview:rp,SolenoidValve:Ad,SpringLoadedReliefValve:Xx,StaticMixer:Cx,Strainer:Zx,StrainerCone:Gx,Switch:hx,TJunction:Sx,Tank:ep,TankPreview:tp,TextBoxPreview:dp,ThreeWayBallValve:rx,ThreeWayValve:Nd,Thruster:Hx,TurboCompressor:Jd,VacuumPump:Od,Value:ip,ValuePreview:lp,Valve:Td,Vent:gx,createDummyToggle:ot,createLabeled:xe,createToggle:Ce,variantZ:Ay},Symbol.toStringTag,{value:"Module"}));exports.Aether=j.main;exports.Dialog=j.use$4;exports.Divider=j.Divider$1;exports.Dropdown=j.Dropdown;exports.Eraser=j.use$5;exports.Haul=j.Haul;exports.Worker=j.Context$1;exports.compareArrayDeps=j.compareArrayDeps;exports.componentRenderProp=j.componentRenderProp;exports.isRenderProp=j.isRenderProp;exports.useAsyncEffect=j.useAsyncEffect;exports.useClickOutside=j.useClickOutside;exports.useCombinedRefs=j.useCombinedRefs;exports.useCombinedStateAndRef=j.useCombinedStateAndRef;exports.useDebouncedCallback=j.useDebouncedCallback;exports.useEffectCompare=j.useEffectCompare;exports.useMemoCompare=j.useMemoCompare;exports.useMemoDeepEqualProps=j.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=j.useMemoPrimitiveArray;exports.usePrevious=j.usePrevious;exports.useResize=j.useResize;exports.useStateRef=j.useStateRef;exports.useSyncedRef=j.useSyncedRef;exports.useTransforms=j.useTransforms;exports.CSS=d.CSS;exports.newBEM=d.newBEM;exports.Header=zn.external;exports.DataType=Z.g;exports.Density=Z.b;exports.MultiSeries=Z.Dt;exports.Rate=Z.F$1;exports.Series=Z.V;exports.TimeRange=Z.E;exports.TimeSpan=Z.w;exports.TimeStamp=Z.m;exports.state=Z.state;exports.Generic=te.Generic;exports.Align=ym.external;exports.Icon=ke.Icon;exports.Tabs=ke.external;exports.Button=Sm.external;exports.Caret=Bi.Animated$1;exports.telem=z.external;exports.Text=ve.external;exports.Triggers=Di.external;exports.List=Zt.external;exports.createFilterTransform=Zt.createFilterTransform;exports.fuseFilter=Zt.fuseFilter;exports.proxyMemo=Zt.proxyMemo;exports.Color=Rm.external;exports.createHexOpacityVariants=Oi.createHexOpacityVariants;exports.unitProperty=Oi.unitProperty;exports.Input=Ne.external;exports.Menu=Cm.external;exports.Theming=wm.external;exports.Tree=bm.external;exports.Video=vm.Video;exports.Accordion=Vm;exports.Breadcrumb=Gm;exports.Canvas=uf;exports.Channel=ih;exports.Control=ug;exports.Device=Ch;exports.Diagram=ey;exports.Form=yh;exports.Label=Mh;exports.Legend=ff;exports.Line=gf;exports.LinePlot=Yf;exports.Log=ny;exports.Measure=qf;exports.Modal=Lh;exports.Mosaic=Xh;exports.Nav=Mm;exports.Note=qh;exports.OS=tg;exports.Observe=jh;exports.Override=sg;exports.Pluto=mg;exports.Portal=Oh;exports.Progress=hg;exports.Range=Xf;exports.Ranger=Cg;exports.Resize=_m;exports.Rule=Uf;exports.Schematic=jS;exports.Select=Tf;exports.Status=Nm;exports.Steps=bg;exports.Synnax=Xm;exports.Table=Pg;exports.TableCells=Xg;exports.Tag=Pf;exports.Telem=ig;exports.Tooltip=Tm;exports.Value=Ag;exports.Viewport=Zf;exports.axis=of;exports.control=rf;exports.useDelayedState=km;