@decocms/mesh 2.15.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CIFhWg2i.js → AlertCircle-B2oZTglS.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D0vIuW0V.js → ArrowLeft-DNHIvCfQ.js} +1 -1
- package/dist/client/assets/{ArrowUp-MjJJcV-O.js → ArrowUp-B6oTANSV.js} +1 -1
- package/dist/client/assets/{Check-LvJ1lSFr.js → Check-BzuFSftX.js} +1 -1
- package/dist/client/assets/{ChevronDown-QF_Tgl2v.js → ChevronDown-BczYL0OZ.js} +1 -1
- package/dist/client/assets/{Code01-Du8Lx-Uw.js → Code01-DNXaHLqw.js} +1 -1
- package/dist/client/assets/{Copy01-CunLN8rc.js → Copy01-Biw66bGV.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-WE50knOB.js → DotsHorizontal-ZLYpFz0w.js} +1 -1
- package/dist/client/assets/{DotsVertical-CuQjcY-h.js → DotsVertical-cBsSXBlU.js} +1 -1
- package/dist/client/assets/{Download01-syi4c4iH.js → Download01-Cq2AKtAL.js} +1 -1
- package/dist/client/assets/{Edit01-DVUwOcf8.js → Edit01-BjOfQM8B.js} +1 -1
- package/dist/client/assets/{File06-BM3BX-NC.js → File06-BNhcqwLq.js} +1 -1
- package/dist/client/assets/{FilterLines-DS1pmySA.js → FilterLines-CoWRaycl.js} +1 -1
- package/dist/client/assets/{FlipBackward-BKppcJN9.js → FlipBackward-CuLGV5oo.js} +1 -1
- package/dist/client/assets/{GitBranch01-C3ShOPmQ.js → GitBranch01-DkToEQj6.js} +1 -1
- package/dist/client/assets/{Grid01-DwtrqYPx.js → Grid01-uV0oBuV3.js} +1 -1
- package/dist/client/assets/{Home02-DlsAgg82.js → Home02-B5sox49B.js} +1 -1
- package/dist/client/assets/{Image01-Bw2o5F05.js → Image01-DMLU_ak3.js} +1 -1
- package/dist/client/assets/{Inbox01-CSDhYGLL.js → Inbox01-BfxyUVOc.js} +1 -1
- package/dist/client/assets/{InfoCircle-xFKFZGrj.js → InfoCircle-D6SOLGfY.js} +1 -1
- package/dist/client/assets/{Key01-S9eZFu7R.js → Key01-DY1coeHQ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dbxh7ZV2.js → LinkExternal01-DMezlNGG.js} +1 -1
- package/dist/client/assets/{List-D2PJPXod.js → List-CVC8X3kY.js} +1 -1
- package/dist/client/assets/{Loading01-BhuF3K1g.js → Loading01-CvuvLhSA.js} +1 -1
- package/dist/client/assets/{Lock01-jUZQmYfl.js → Lock01-ByXncGT3.js} +1 -1
- package/dist/client/assets/MessageChatSquare-Dd7UGbcR.js +1 -0
- package/dist/client/assets/{Play-BxDRmyN-.js → Play-D53Ipg7b.js} +1 -1
- package/dist/client/assets/{Plus-DCVckKM0.js → Plus-emJv0cyE.js} +1 -1
- package/dist/client/assets/{SearchMd-tLR3QB8E.js → SearchMd-4bGqWhO7.js} +1 -1
- package/dist/client/assets/{Terminal-DwE3k3eb.js → Terminal-Dwvrrbxm.js} +1 -1
- package/dist/client/assets/{Trash01-Dg5Q9OUO.js → Trash01-C9fgHihQ.js} +1 -1
- package/dist/client/assets/{Upload01-BJUxi5ck.js → Upload01-CRvHyAuf.js} +1 -1
- package/dist/client/assets/{X-DKF1oh5v.js → X-DwZFSRlE.js} +1 -1
- package/dist/client/assets/{XClose-BACMQGhN.js → XClose-bVRJhtCU.js} +1 -1
- package/dist/client/assets/{alert-dialog-BryTAX-J.js → alert-dialog-NsN0mz0A.js} +1 -1
- package/dist/client/assets/{auth-catchall-B3H5JOvc.js → auth-catchall-CZQOowpQ.js} +1 -1
- package/dist/client/assets/{avatar-BtMYdv0U.js → avatar-Bim2Jxhy.js} +1 -1
- package/dist/client/assets/{badge-Do7WFlPI.js → badge-DbLa101x.js} +1 -1
- package/dist/client/assets/{binder-B3GXUIAu.js → binder-52kHlP5R.js} +1 -1
- package/dist/client/assets/button-CTJokKKi.js +1 -0
- package/dist/client/assets/{card-CwMKn79y.js → card-D3-N0Ziq.js} +1 -1
- package/dist/client/assets/{checkbox-C6hBycBx.js → checkbox-Bio0mokg.js} +1 -1
- package/dist/client/assets/{collection-detail-C-m2H10s.js → collection-detail-kd5gJHzz.js} +2 -2
- package/dist/client/assets/{collection-display-button-CdHXoeVD.js → collection-display-button-D4xA64Pp.js} +1 -1
- package/dist/client/assets/{collection-header-CeBQhXWy.js → collection-header-CDIKZA15.js} +1 -1
- package/dist/client/assets/{collection-page-pMUw63Yr.js → collection-page-DkTZhP29.js} +1 -1
- package/dist/client/assets/{collection-search-CF1o4yO7.js → collection-search-NLGzx5Aj.js} +1 -1
- package/dist/client/assets/{collection-tab-ChPNT80-.js → collection-tab-CHEJ77P0.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-jfSAC6dF.js → collection-table-wrapper-Cmwf3-Zd.js} +1 -1
- package/dist/client/assets/{connection-BcYehfdK.js → connection-CVA8jPCa.js} +1 -1
- package/dist/client/assets/{connection-card-DO3ahSdV.js → connection-card-DSQeBo5D.js} +1 -1
- package/dist/client/assets/connection-detail-BRtmbxOA.js +1 -0
- package/dist/client/assets/connections-BQG75-F0.js +1 -0
- package/dist/client/assets/constants-DDPe3rq3.js +1 -0
- package/dist/client/assets/{create-organization-dialog-BydMMM5g.js → create-organization-dialog-Bax-UsKr.js} +1 -1
- package/dist/client/assets/{dialog-Y0g8yyzz.js → dialog-Bn93qdaz.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C4Ypstre.js → dropdown-menu-BoZzHM67.js} +1 -1
- package/dist/client/assets/dynamic-plugin-layout-CQi3lnCP.js +1 -0
- package/dist/client/assets/{empty-state-Dx0NLAxy.js → empty-state-Bcd1wXFS.js} +1 -1
- package/dist/client/assets/{empty-state-C0gi-aAx.js → empty-state-Dm-ohURa.js} +1 -1
- package/dist/client/assets/{env-vars-editor-GTn7Eu5T.js → env-vars-editor-ckaYIpuZ.js} +1 -1
- package/dist/client/assets/{error-boundary-D2ZJQHnD.js → error-boundary-BoSqgCtj.js} +1 -1
- package/dist/client/assets/{extract-connection-data-nsOyk4eb.js → extract-connection-data-CxTJQ988.js} +1 -1
- package/dist/client/assets/{file-browser-s8pLbWaW.js → file-browser-Dn-I1IiE.js} +2 -2
- package/dist/client/assets/{form-DDdl0439.js → form-CG-hsJ5c.js} +1 -1
- package/dist/client/assets/gateway-detail-BQDBMjd9.js +1 -0
- package/dist/client/assets/{gateways-Bv1uyRdE.js → gateways-DSACPdOv.js} +1 -1
- package/dist/client/assets/{grid-view-DNPq1Y__.js → grid-view-hvwfrwye.js} +1 -1
- package/dist/client/assets/{home-9eTtEa0h.js → home-CeFBBPsp.js} +1 -1
- package/dist/client/assets/index-2KSfo6Ol.css +1 -0
- package/dist/client/assets/{index-DqVdeyIE.js → index-CRZ1ToW0.js} +1 -1
- package/dist/client/assets/index-CmErlMVO.js +1 -0
- package/dist/client/assets/{index-C5FDJtAp.js → index-CrProqmQ.js} +2 -2
- package/dist/client/assets/{index-Cbsnfme0.js → index-EGRg6aHg.js} +1 -1
- package/dist/client/assets/index-j6TJSjaV.js +107 -0
- package/dist/client/assets/{infiniteQueryObserver-BnxPLCEe.js → infiniteQueryObserver-lRzj3Gw2.js} +1 -1
- package/dist/client/assets/{input-BbWUShhD.js → input-DfBpU_ty.js} +1 -1
- package/dist/client/assets/layout-AUAvH2H1.js +1 -0
- package/dist/client/assets/{lazy-highlighter-BHJogLPz.js → lazy-highlighter-VlHU8Y-l.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BZEjwsD0.js → localstorage-keys-CRSC1wcG.js} +1 -1
- package/dist/client/assets/{login-DGLLQl3L.js → login-DuLQYRHx.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CkuEWYY4.js → mcp-oauth-BuyvGrP4.js} +1 -1
- package/dist/client/assets/{mcp-server-card-D4bCdTAY.js → mcp-server-card-CXVHhw09.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Cy2l0hPz.js → mcp-server-detail-DRgWtEnz.js} +1 -1
- package/dist/client/assets/members-D2GPpEvZ.js +3 -0
- package/dist/client/assets/{monaco-editor-BnXEGbzY.js → monaco-editor-Ch4QGmXS.js} +4 -4
- package/dist/client/assets/{monitoring-vPlAvNfN.js → monitoring-DvqA7AuH.js} +6 -6
- package/dist/client/assets/{oauth-callback-I_aRwsB5.js → oauth-callback-B2iJ-cIh.js} +1 -1
- package/dist/client/assets/page-CTarFbC4.js +35 -0
- package/dist/client/assets/page-CekK7zPt.js +1 -0
- package/dist/client/assets/{pin-to-sidebar-button-DTR_Oj1s.js → pin-to-sidebar-button-BsMAQ8Vt.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-RYQHQ0B6.js → plugin-empty-state-Dy73LUEA.js} +1 -1
- package/dist/client/assets/{plugin-header-BPW1tb_d.js → plugin-header-B_tffoXS.js} +1 -1
- package/dist/client/assets/plugins-CR5Q-iDa.js +1 -0
- package/dist/client/assets/{popover-DLFe45bO.js → popover-BZ-FzZWz.js} +1 -1
- package/dist/client/assets/{project-context-provider-DH0iqA5D.js → project-context-provider-DaHOfM4z.js} +1 -1
- package/dist/client/assets/{registry-utils-BPPApxjf.js → registry-utils-D0mO6LZ4.js} +1 -1
- package/dist/client/assets/{resizable-C6uSLZAk.js → resizable-BPD0-alN.js} +1 -1
- package/dist/client/assets/{resource-tabs-CKatVKnl.js → resource-tabs-JnmKNHPF.js} +1 -1
- package/dist/client/assets/select-IfWnHVgm.js +1 -0
- package/dist/client/assets/settings-DjC9FBse.js +1 -0
- package/dist/client/assets/shell-layout-Bd8yx5uJ.js +17 -0
- package/dist/client/assets/{spinner-CUAQv_4V.js → spinner-C88Uk3Mq.js} +1 -1
- package/dist/client/assets/{switch-ZAqg3LbP.js → switch-DoEPJ6LK.js} +1 -1
- package/dist/client/assets/{textarea-BDJhX5-9.js → textarea-BqnrlDDE.js} +1 -1
- package/dist/client/assets/{tool-set-selector-D26m7PpE.js → tool-set-selector-DRO7hzfM.js} +1 -1
- package/dist/client/assets/{tools-list-pl3Bsjpf.js → tools-list-CLVUgs1o.js} +1 -1
- package/dist/client/assets/{tooltip-DXYcokUT.js → tooltip-NmHBw1SB.js} +1 -1
- package/dist/client/assets/use-binding-BeRgkTto.js +23 -0
- package/dist/client/assets/{use-collections-DxMxR_jZ.js → use-collections-KXXQm2MI.js} +1 -1
- package/dist/client/assets/{use-connection-ClVfoZWG.js → use-connection-BpwLfga7.js} +1 -1
- package/dist/client/assets/{use-connection-resources-nXRlJNhx.js → use-connection-resources-LbJAvV0-.js} +1 -1
- package/dist/client/assets/{use-create-gateway-UkmAQbcu.js → use-create-gateway-CCdAKPuZ.js} +1 -1
- package/dist/client/assets/{use-gateway-D_zdUoI4.js → use-gateway-CvXTgd1x.js} +1 -1
- package/dist/client/assets/{use-gateway-system-prompt-CYi0Zo4K.js → use-gateway-system-prompt-DppzttmJ.js} +1 -1
- package/dist/client/assets/{use-list-state-G6sniPDx.js → use-list-state-lFbY6EbW.js} +1 -1
- package/dist/client/assets/{use-mcp-hlkUt7pz.js → use-mcp-Dd1lbCPb.js} +1 -1
- package/dist/client/assets/{use-members-3RqzErHO.js → use-members-BPs6PrLQ.js} +1 -1
- package/dist/client/assets/{use-mobile-DT1cwytU.js → use-mobile-C5bi3iKH.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D46q7SyU.js → use-organization-settings-D1QvFxpy.js} +1 -1
- package/dist/client/assets/{use-tool-call-BH-yOcTy.js → use-tool-call-VFE826W3.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DwjnurDK.js +1 -0
- package/dist/client/assets/{useMutation-DEocBykZ.js → useMutation-BTJq9RED.js} +1 -1
- package/dist/client/assets/useQuery-5B4EpEmL.js +1 -0
- package/dist/client/assets/{value-C9Bb1t7X.js → value-_xkD4VBb.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C5hz9T3M.js → view-mode-toggle-DcZ2e_Ag.js} +1 -1
- package/dist/client/assets/{well-known-mcp-D13f-8h2.js → well-known-mcp-DOEdYmKO.js} +1 -1
- package/dist/client/assets/{workflow-BJoyVBBY.js → workflow-B-4ovCZr.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +153 -153
- package/dist/server/migrate.js +189 -179
- package/dist/server/server.js +150 -150
- package/package.json +1 -1
- package/dist/client/assets/Clock-CiIkKpUg.js +0 -1
- package/dist/client/assets/button-ClkQLR3o.js +0 -1
- package/dist/client/assets/connection-detail-i_lj-oMr.js +0 -1
- package/dist/client/assets/connections-CMzrwOZS.js +0 -1
- package/dist/client/assets/constants-BIwbIZhE.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-Cds2rM_Z.js +0 -1
- package/dist/client/assets/gateway-detail-NHGkjgTy.js +0 -1
- package/dist/client/assets/index-D6aVJNvm.js +0 -1
- package/dist/client/assets/index-JAPwCHXJ.css +0 -1
- package/dist/client/assets/index-hEHbC4y4.js +0 -88
- package/dist/client/assets/layout-BnqnCJOk.js +0 -1
- package/dist/client/assets/members-CXuNIHGD.js +0 -3
- package/dist/client/assets/page-DPsdZaOi.js +0 -1
- package/dist/client/assets/page-fWJ76jbj.js +0 -35
- package/dist/client/assets/plugins-DN4-aMVD.js +0 -1
- package/dist/client/assets/select-CSzUpxmC.js +0 -1
- package/dist/client/assets/settings-Dk6-Mm8r.js +0 -1
- package/dist/client/assets/shell-layout-P7XxC3ZF.js +0 -3
- package/dist/client/assets/use-binding-Cmi2FEqF.js +0 -23
- package/dist/client/assets/use-model-state-Bc4MpPVu.js +0 -20
- package/dist/client/assets/useInfiniteQuery-Dl93eV8h.js +0 -1
- package/dist/client/assets/useQuery-Dakt0IBq.js +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{r as H,F as Zi,H as Wi,j as y,c as pe,f as jt,k as Gi,a as qi,t as Ui}from"./index-C5FDJtAp.js";import{e as Ki,a as Qn,b as Qi,d as Ji,C as ue,G as Jn,M as eo,U as ea,f as ta}from"./index-hEHbC4y4.js";import{D as na,u as oa,b as ra,a as sa,c as ia,N as aa,d as to,G as en,T as ca}from"./use-model-state-Bc4MpPVu.js";import{E as dn}from"./error-boundary-D2ZJQHnD.js";import{u as tr}from"./use-connection-ClVfoZWG.js";import{u as nr,i as la}from"./use-gateway-D_zdUoI4.js";import{u as no}from"./localstorage-keys-BZEjwsD0.js";import{u as En}from"./project-context-provider-DH0iqA5D.js";import{c as or,B as rr}from"./button-ClkQLR3o.js";import{V as ua}from"./view-mode-toggle-C5hz9T3M.js";import{i as da}from"./GitBranch01-C3ShOPmQ.js";import{s as fa}from"./Plus-DCVckKM0.js";import{c as ha}from"./connection-BcYehfdK.js";import{I as sr,n as ga}from"./empty-state-C0gi-aAx.js";import{u as pa}from"./use-tool-call-BH-yOcTy.js";import{i as $e,a as oo,b as ma,c as ro,d as tn,T as nn,e as ya}from"./value-C9Bb1t7X.js";import"./input-BbWUShhD.js";import"./popover-DLFe45bO.js";import"./tooltip-DXYcokUT.js";import"./Check-LvJ1lSFr.js";import"./SearchMd-tLR3QB8E.js";import"./use-create-gateway-UkmAQbcu.js";import"./AlertCircle-CIFhWg2i.js";import"./X-DKF1oh5v.js";import"./ArrowUp-MjJJcV-O.js";import"./textarea-BDJhX5-9.js";import"./useMutation-DEocBykZ.js";import"./Grid01-DwtrqYPx.js";import"./Copy01-CunLN8rc.js";import"./Terminal-DwE3k3eb.js";import"./monaco-editor-BnXEGbzY.js";import"./spinner-CUAQv_4V.js";import"./alert-dialog-BryTAX-J.js";import"./select-CSzUpxmC.js";import"./ChevronDown-QF_Tgl2v.js";import"./File06-BM3BX-NC.js";import"./Image01-Bw2o5F05.js";import"./use-collections-DxMxR_jZ.js";import"./use-binding-Cmi2FEqF.js";import"./binder-B3GXUIAu.js";import"./use-gateway-system-prompt-CYi0Zo4K.js";import"./Edit01-DVUwOcf8.js";import"./well-known-mcp-D13f-8h2.js";import"./generate-id-Dyweu44Y.js";import"./Clock-CiIkKpUg.js";import"./Trash01-Dg5Q9OUO.js";import"./useQuery-Dakt0IBq.js";const Cn=({size:e=24,color:t="currentColor",...n})=>H.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},H.createElement("path",{d:"m10 15-3.075 3.114c-.43.434-.644.651-.828.666a.5.5 0 0 1-.421-.172c-.12-.14-.12-.446-.12-1.056v-1.56c0-.548-.449-.944-.99-1.024v0a3 3 0 0 1-2.534-2.533C2 12.219 2 11.96 2 11.445V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h7.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C19 4.28 19 5.12 19 6.8V11m0 11-2.176-1.513c-.306-.213-.46-.32-.626-.395a2.002 2.002 0 0 0-.462-.145c-.18-.033-.367-.033-.74-.033H13.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C10 18.394 10 17.834 10 16.714V14.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C11.52 11 12.08 11 13.2 11h5.6c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 12.52 22 13.08 22 14.2v2.714c0 .932 0 1.398-.152 1.766a2 2 0 0 1-1.083 1.082c-.367.152-.833.152-1.765.152V22Z"}));Cn.displayName="MessageChatSquare";function ae(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=ae(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var xa={value:()=>{}};function Vt(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Ct(n)}function Ct(e){this._=e}function wa(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Ct.prototype=Vt.prototype={constructor:Ct,on:function(e,t){var n=this._,o=wa(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=va(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=so(n[r],e.name,t);else if(t==null)for(r in n)n[r]=so(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 Ct(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function va(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function so(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=xa,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var fn="http://www.w3.org/1999/xhtml";const io={svg:"http://www.w3.org/2000/svg",xhtml:fn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ot(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),io.hasOwnProperty(t)?{space:io[t],local:e}:e}function _a(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fn&&t.documentElement.namespaceURI===fn?t.createElement(e):t.createElementNS(n,e)}}function ba(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ir(e){var t=Ot(e);return(t.local?ba:_a)(t)}function Sa(){}function Nn(e){return e==null?Sa:function(){return this.querySelector(e)}}function Ea(e){typeof e!="function"&&(e=Nn(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new ge(o,this._parents)}function Ca(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Na(){return[]}function ar(e){return e==null?Na:function(){return this.querySelectorAll(e)}}function Ma(e){return function(){return Ca(e.apply(this,arguments))}}function Ia(e){typeof e=="function"?e=Ma(e):e=ar(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),r.push(l));return new ge(o,r)}function cr(e){return function(){return this.matches(e)}}function lr(e){return function(t){return t.matches(e)}}var ka=Array.prototype.find;function Aa(e){return function(){return ka.call(this.children,e)}}function Pa(){return this.firstElementChild}function Ta(e){return this.select(e==null?Pa:Aa(typeof e=="function"?e:lr(e)))}var Da=Array.prototype.filter;function $a(){return Array.from(this.children)}function za(e){return function(){return Da.call(this.children,e)}}function Ha(e){return this.selectAll(e==null?$a:za(typeof e=="function"?e:lr(e)))}function La(e){typeof e!="function"&&(e=cr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new ge(o,this._parents)}function ur(e){return new Array(e.length)}function Ra(){return new ge(this._enter||this._groups.map(ur),this._parents)}function At(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}At.prototype={constructor:At,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 ja(e){return function(){return e}}function Va(e,t,n,o,r,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new At(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function Oa(e,t,n,o,r,i,s){var a,l,c=new Map,u=t.length,f=i.length,d=new Array(u),h;for(a=0;a<u;++a)(l=t[a])&&(d[a]=h=s.call(l,l.__data__,a,t)+"",c.has(h)?r[a]=l:c.set(h,l));for(a=0;a<f;++a)h=s.call(e,i[a],a,i)+"",(l=c.get(h))?(o[a]=l,l.__data__=i[a],c.delete(h)):n[a]=new At(e,i[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(d[a])===l&&(r[a]=l)}function Ba(e){return e.__data__}function Fa(e,t){if(!arguments.length)return Array.from(this,Ba);var n=t?Oa:Va,o=this._parents,r=this._groups;typeof e!="function"&&(e=ja(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],f=r[c],d=f.length,h=Xa(e.call(u,u&&u.__data__,c,o)),g=h.length,v=a[c]=new Array(g),_=s[c]=new Array(g),x=l[c]=new Array(d);n(u,f,v,_,x,h,t);for(var b=0,p=0,m,C;b<g;++b)if(m=v[b]){for(b>=p&&(p=b+1);!(C=_[p])&&++p<g;);m._next=C||null}}return s=new ge(s,o),s._enter=a,s._exit=l,s}function Xa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ya(){return new ge(this._exit||this._groups.map(ur),this._parents)}function Za(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function Wa(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=o[l],f=c.length,d=a[l]=new Array(f),h,g=0;g<f;++g)(h=c[g]||u[g])&&(d[g]=h);for(;l<r;++l)a[l]=n[l];return new ge(a,this._parents)}function Ga(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function qa(e){e||(e=Ua);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new ge(r,this._parents).order()}function Ua(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ka(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Qa(){return Array.from(this)}function Ja(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function ec(){let e=0;for(const t of this)++e;return e}function tc(){return!this.node()}function nc(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function oc(e){return function(){this.removeAttribute(e)}}function rc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function sc(e,t){return function(){this.setAttribute(e,t)}}function ic(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ac(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function cc(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 lc(e,t){var n=Ot(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?rc:oc:typeof t=="function"?n.local?cc:ac:n.local?ic:sc)(n,t))}function dr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function uc(e){return function(){this.style.removeProperty(e)}}function dc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fc(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function hc(e,t,n){return arguments.length>1?this.each((t==null?uc:typeof t=="function"?fc:dc)(e,t,n??"")):Ye(this.node(),e)}function Ye(e,t){return e.style.getPropertyValue(t)||dr(e).getComputedStyle(e,null).getPropertyValue(t)}function gc(e){return function(){delete this[e]}}function pc(e,t){return function(){this[e]=t}}function mc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function yc(e,t){return arguments.length>1?this.each((t==null?gc:typeof t=="function"?mc:pc)(e,t)):this.node()[e]}function fr(e){return e.trim().split(/^|\s+/)}function Mn(e){return e.classList||new hr(e)}function hr(e){this._node=e,this._names=fr(e.getAttribute("class")||"")}hr.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 gr(e,t){for(var n=Mn(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function pr(e,t){for(var n=Mn(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function xc(e){return function(){gr(this,e)}}function wc(e){return function(){pr(this,e)}}function vc(e,t){return function(){(t.apply(this,arguments)?gr:pr)(this,e)}}function _c(e,t){var n=fr(e+"");if(arguments.length<2){for(var o=Mn(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?vc:t?xc:wc)(n,t))}function bc(){this.textContent=""}function Sc(e){return function(){this.textContent=e}}function Ec(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Cc(e){return arguments.length?this.each(e==null?bc:(typeof e=="function"?Ec:Sc)(e)):this.node().textContent}function Nc(){this.innerHTML=""}function Mc(e){return function(){this.innerHTML=e}}function Ic(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function kc(e){return arguments.length?this.each(e==null?Nc:(typeof e=="function"?Ic:Mc)(e)):this.node().innerHTML}function Ac(){this.nextSibling&&this.parentNode.appendChild(this)}function Pc(){return this.each(Ac)}function Tc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Dc(){return this.each(Tc)}function $c(e){var t=typeof e=="function"?e:ir(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function zc(){return null}function Hc(e,t){var n=typeof e=="function"?e:ir(e),o=t==null?zc:typeof t=="function"?t:Nn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Lc(){var e=this.parentNode;e&&e.removeChild(this)}function Rc(){return this.each(Lc)}function jc(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Oc(e){return this.select(e?Vc:jc)}function Bc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Fc(e){return function(t){e.call(this,t,this.__data__)}}function Xc(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Yc(e){return function(){var t=this.__on;if(t){for(var n=0,o=-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[++o]=i;++o?t.length=o:delete this.__on}}}function Zc(e,t,n){return function(){var o=this.__on,r,i=Fc(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).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},o?o.push(r):this.__on=[r]}}function Wc(e,t,n){var o=Xc(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?Zc:Yc,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function mr(e,t,n){var o=dr(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Gc(e,t){return function(){return mr(this,e,t)}}function qc(e,t){return function(){return mr(this,e,t.apply(this,arguments))}}function Uc(e,t){return this.each((typeof t=="function"?qc:Gc)(e,t))}function*Kc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var yr=[null];function ge(e,t){this._groups=e,this._parents=t}function ft(){return new ge([[document.documentElement]],yr)}function Qc(){return this}ge.prototype=ft.prototype={constructor:ge,select:Ea,selectAll:Ia,selectChild:Ta,selectChildren:Ha,filter:La,data:Fa,enter:Ra,exit:Ya,join:Za,merge:Wa,selection:Qc,order:Ga,sort:qa,call:Ka,nodes:Qa,node:Ja,size:ec,empty:tc,each:nc,attr:lc,style:hc,property:yc,classed:_c,text:Cc,html:kc,raise:Pc,lower:Dc,append:$c,insert:Hc,remove:Rc,clone:Oc,datum:Bc,on:Wc,dispatch:Uc,[Symbol.iterator]:Kc};function he(e){return typeof e=="string"?new ge([[document.querySelector(e)]],[document.documentElement]):new ge([[e]],yr)}function Jc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function me(e,t){if(e=Jc(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.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 el={passive:!1},st={capture:!0,passive:!1};function on(e){e.stopImmediatePropagation()}function Xe(e){e.preventDefault(),e.stopImmediatePropagation()}function xr(e){var t=e.document.documentElement,n=he(e).on("dragstart.drag",Xe,st);"onselectstart"in t?n.on("selectstart.drag",Xe,st):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function wr(e,t){var n=e.document.documentElement,o=he(e).on("dragstart.drag",null);t&&(o.on("click.drag",Xe,st),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const yt=e=>()=>e;function hn(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:c,dispatch:u}){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:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}hn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function tl(e){return!e.ctrlKey&&!e.button}function nl(){return this.parentNode}function ol(e,t){return t??{x:e.x,y:e.y}}function rl(){return navigator.maxTouchPoints||"ontouchstart"in this}function vr(){var e=tl,t=nl,n=ol,o=rl,r={},i=Vt("start","drag","end"),s=0,a,l,c,u,f=0;function d(m){m.on("mousedown.drag",h).filter(o).on("touchstart.drag",_).on("touchmove.drag",x,el).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(m,C){if(!(u||!e.call(this,m,C))){var S=p(this,t.call(this,m,C),m,C,"mouse");S&&(he(m.view).on("mousemove.drag",g,st).on("mouseup.drag",v,st),xr(m.view),on(m),c=!1,a=m.clientX,l=m.clientY,S("start",m))}}function g(m){if(Xe(m),!c){var C=m.clientX-a,S=m.clientY-l;c=C*C+S*S>f}r.mouse("drag",m)}function v(m){he(m.view).on("mousemove.drag mouseup.drag",null),wr(m.view,c),Xe(m),r.mouse("end",m)}function _(m,C){if(e.call(this,m,C)){var S=m.changedTouches,N=t.call(this,m,C),T=S.length,P,j;for(P=0;P<T;++P)(j=p(this,N,m,C,S[P].identifier,S[P]))&&(on(m),j("start",m,S[P]))}}function x(m){var C=m.changedTouches,S=C.length,N,T;for(N=0;N<S;++N)(T=r[C[N].identifier])&&(Xe(m),T("drag",m,C[N]))}function b(m){var C=m.changedTouches,S=C.length,N,T;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),N=0;N<S;++N)(T=r[C[N].identifier])&&(on(m),T("end",m,C[N]))}function p(m,C,S,N,T,P){var j=i.copy(),I=me(P||S,C),z,L,w;if((w=n.call(m,new hn("beforestart",{sourceEvent:S,target:d,identifier:T,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:j}),N))!=null)return z=w.x-I[0]||0,L=w.y-I[1]||0,function M(E,A,k){var D=I,$;switch(E){case"start":r[T]=M,$=s++;break;case"end":delete r[T],--s;case"drag":I=me(k||A,C),$=s;break}j.call(E,m,new hn(E,{sourceEvent:A,subject:w,target:d,identifier:T,active:$,x:I[0]+z,y:I[1]+L,dx:I[0]-D[0],dy:I[1]-D[1],dispatch:j}),N)}}return d.filter=function(m){return arguments.length?(e=typeof m=="function"?m:yt(!!m),d):e},d.container=function(m){return arguments.length?(t=typeof m=="function"?m:yt(m),d):t},d.subject=function(m){return arguments.length?(n=typeof m=="function"?m:yt(m),d):n},d.touchable=function(m){return arguments.length?(o=typeof m=="function"?m:yt(!!m),d):o},d.on=function(){var m=i.on.apply(i,arguments);return m===i?d:m},d.clickDistance=function(m){return arguments.length?(f=(m=+m)*m,d):Math.sqrt(f)},d}var ao=180/Math.PI,gn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function _r(e,t,n,o,r,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*ao,skewX:Math.atan(l)*ao,scaleX:s,scaleY:a}}var xt;function sl(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?gn:_r(t.a,t.b,t.c,t.d,t.e,t.f)}function il(e){return e==null||(xt||(xt=document.createElementNS("http://www.w3.org/2000/svg","g")),xt.setAttribute("transform",e),!(e=xt.transform.baseVal.consolidate()))?gn:(e=e.matrix,_r(e.a,e.b,e.c,e.d,e.e,e.f))}function br(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,f,d,h,g){if(c!==f||u!==d){var v=h.push("translate(",null,t,null,n);g.push({i:v-4,x:$e(c,f)},{i:v-2,x:$e(u,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(c,u,f,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(r(f)+"rotate(",null,o)-2,x:$e(c,u)})):u&&f.push(r(f)+"rotate("+u+o)}function a(c,u,f,d){c!==u?d.push({i:f.push(r(f)+"skewX(",null,o)-2,x:$e(c,u)}):u&&f.push(r(f)+"skewX("+u+o)}function l(c,u,f,d,h,g){if(c!==f||u!==d){var v=h.push(r(h)+"scale(",null,",",null,")");g.push({i:v-4,x:$e(c,f)},{i:v-2,x:$e(u,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,f,d),s(c.rotate,u.rotate,f,d),a(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var g=-1,v=d.length,_;++g<v;)f[(_=d[g]).i]=_.x(h);return f.join("")}}}var al=br(sl,"px, ","px)","deg)"),cl=br(il,", ",")",")"),ll=1e-12;function co(e){return((e=Math.exp(e))+1/e)/2}function ul(e){return((e=Math.exp(e))-1/e)/2}function dl(e){return((e=Math.exp(2*e))-1)/(e+1)}const Nt=(function e(t,n,o){function r(i,s){var a=i[0],l=i[1],c=i[2],u=s[0],f=s[1],d=s[2],h=u-a,g=f-l,v=h*h+g*g,_,x;if(v<ll)x=Math.log(d/c)/t,_=function(N){return[a+N*h,l+N*g,c*Math.exp(t*N*x)]};else{var b=Math.sqrt(v),p=(d*d-c*c+o*v)/(2*c*n*b),m=(d*d-c*c-o*v)/(2*d*n*b),C=Math.log(Math.sqrt(p*p+1)-p),S=Math.log(Math.sqrt(m*m+1)-m);x=(S-C)/t,_=function(N){var T=N*x,P=co(C),j=c/(n*b)*(P*dl(t*T+C)-ul(C));return[a+j*h,l+j*g,c*P/co(t*T+C)]}}return _.duration=x*1e3*t/Math.SQRT2,_}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},r})(Math.SQRT2,2,4);var Ze=0,tt=0,Je=0,Sr=1e3,Pt,nt,Tt=0,Le=0,Bt=0,it=typeof performance=="object"&&performance.now?performance:Date,Er=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function In(){return Le||(Er(fl),Le=it.now()+Bt)}function fl(){Le=0}function Dt(){this._call=this._time=this._next=null}Dt.prototype=Cr.prototype={constructor:Dt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?In():+n)+(t==null?0:+t),!this._next&&nt!==this&&(nt?nt._next=this:Pt=this,nt=this),this._call=e,this._time=n,pn()},stop:function(){this._call&&(this._call=null,this._time=1/0,pn())}};function Cr(e,t,n){var o=new Dt;return o.restart(e,t,n),o}function hl(){In(),++Ze;for(var e=Pt,t;e;)(t=Le-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ze}function lo(){Le=(Tt=it.now())+Bt,Ze=tt=0;try{hl()}finally{Ze=0,pl(),Le=0}}function gl(){var e=it.now(),t=e-Tt;t>Sr&&(Bt-=t,Tt=e)}function pl(){for(var e,t=Pt,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Pt=n);nt=e,pn(o)}function pn(e){if(!Ze){tt&&(tt=clearTimeout(tt));var t=e-Le;t>24?(e<1/0&&(tt=setTimeout(lo,e-it.now()-Bt)),Je&&(Je=clearInterval(Je))):(Je||(Tt=it.now(),Je=setInterval(gl,Sr)),Ze=1,Er(lo))}}function uo(e,t,n){var o=new Dt;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var ml=Vt("start","end","cancel","interrupt"),yl=[],Nr=0,fo=1,mn=2,Mt=3,ho=4,yn=5,It=6;function Ft(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;xl(e,n,{name:t,index:o,group:r,on:ml,tween:yl,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Nr})}function kn(e,t){var n=we(e,t);if(n.state>Nr)throw new Error("too late; already scheduled");return n}function Se(e,t){var n=we(e,t);if(n.state>Mt)throw new Error("too late; already running");return n}function we(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function xl(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Cr(i,0,n.time);function i(c){n.state=fo,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,f,d,h;if(n.state!==fo)return l();for(u in o)if(h=o[u],h.name===n.name){if(h.state===Mt)return uo(s);h.state===ho?(h.state=It,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[u]):+u<t&&(h.state=It,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[u])}if(uo(function(){n.state===Mt&&(n.state=ho,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=mn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===mn){for(n.state=Mt,r=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++f]=h);r.length=f+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=yn,1),f=-1,d=r.length;++f<d;)r[f].call(e,u);n.state===yn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=It,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function kt(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>mn&&o.state<yn,o.state=It,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function wl(e){return this.each(function(){kt(this,e)})}function vl(e,t){var n,o;return function(){var r=Se(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function _l(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=Se(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function bl(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=we(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?vl:_l)(n,e,t))}function An(e,t,n){var o=e._id;return e.each(function(){var r=Se(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return we(r,o).value[t]}}function Mr(e,t){var n;return(typeof t=="number"?$e:t instanceof ro?oo:(n=ro(t))?(t=n,oo):ma)(e,t)}function Sl(e){return function(){this.removeAttribute(e)}}function El(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Cl(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function Nl(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function Ml(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function Il(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function kl(e,t){var n=Ot(e),o=n==="transform"?cl:Mr;return this.attrTween(e,typeof t=="function"?(n.local?Il:Ml)(n,o,An(this,"attr."+e,t)):t==null?(n.local?El:Sl)(n):(n.local?Nl:Cl)(n,o,t))}function Al(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Pl(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Tl(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Pl(e,i)),n}return r._value=t,r}function Dl(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Al(e,i)),n}return r._value=t,r}function $l(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 o=Ot(e);return this.tween(n,(o.local?Tl:Dl)(o,t))}function zl(e,t){return function(){kn(this,e).delay=+t.apply(this,arguments)}}function Hl(e,t){return t=+t,function(){kn(this,e).delay=t}}function Ll(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?zl:Hl)(t,e)):we(this.node(),t).delay}function Rl(e,t){return function(){Se(this,e).duration=+t.apply(this,arguments)}}function jl(e,t){return t=+t,function(){Se(this,e).duration=t}}function Vl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Rl:jl)(t,e)):we(this.node(),t).duration}function Ol(e,t){if(typeof t!="function")throw new Error;return function(){Se(this,e).ease=t}}function Bl(e){var t=this._id;return arguments.length?this.each(Ol(t,e)):we(this.node(),t).ease}function Fl(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Se(this,e).ease=n}}function Xl(e){if(typeof e!="function")throw new Error;return this.each(Fl(this._id,e))}function Yl(e){typeof e!="function"&&(e=cr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Me(o,this._parents,this._name,this._id)}function Zl(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=t[a],c=n[a],u=l.length,f=s[a]=new Array(u),d,h=0;h<u;++h)(d=l[h]||c[h])&&(f[h]=d);for(;a<o;++a)s[a]=t[a];return new Me(s,this._parents,this._name,this._id)}function Wl(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 Gl(e,t,n){var o,r,i=Wl(t)?kn:Se;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function ql(e,t){var n=this._id;return arguments.length<2?we(this.node(),n).on.on(e):this.each(Gl(n,e,t))}function Ul(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Kl(){return this.on("end.remove",Ul(this._id))}function Ql(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Nn(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),u,f,d=0;d<l;++d)(u=a[d])&&(f=e.call(u,u.__data__,d,a))&&("__data__"in u&&(f.__data__=u.__data__),c[d]=f,Ft(c[d],t,n,d,c,we(u,n)));return new Me(i,this._parents,t,n)}function Jl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ar(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,u,f=0;f<c;++f)if(u=l[f]){for(var d=e.call(u,u.__data__,f,l),h,g=we(u,n),v=0,_=d.length;v<_;++v)(h=d[v])&&Ft(h,t,n,v,d,g);i.push(d),s.push(u)}return new Me(i,s,t,n)}var eu=ft.prototype.constructor;function tu(){return new eu(this._groups,this._parents)}function nu(e,t){var n,o,r;return function(){var i=Ye(this,e),s=(this.style.removeProperty(e),Ye(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function Ir(e){return function(){this.style.removeProperty(e)}}function ou(e,t,n){var o,r=n+"",i;return function(){var s=Ye(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function ru(e,t,n){var o,r,i;return function(){var s=Ye(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Ye(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function su(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=Se(this,e),c=l.on,u=l.value[i]==null?a||(a=Ir(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function iu(e,t,n){var o=(e+="")=="transform"?al:Mr;return t==null?this.styleTween(e,nu(e,o)).on("end.style."+e,Ir(e)):typeof t=="function"?this.styleTween(e,ru(e,o,An(this,"style."+e,t))).each(su(this._id,e)):this.styleTween(e,ou(e,o,t),n).on("end.style."+e,null)}function au(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function cu(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&au(e,s,n)),o}return i._value=t,i}function lu(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,cu(e,t,n??""))}function uu(e){return function(){this.textContent=e}}function du(e){return function(){var t=e(this);this.textContent=t??""}}function fu(e){return this.tween("text",typeof e=="function"?du(An(this,"text",e)):uu(e==null?"":e+""))}function hu(e){return function(t){this.textContent=e.call(this,t)}}function gu(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&hu(r)),t}return o._value=e,o}function pu(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,gu(e))}function mu(){for(var e=this._name,t=this._id,n=kr(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=we(l,t);Ft(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Me(o,this._parents,e,n)}function yu(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=Se(this,o),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),r===0&&i()})}var xu=0;function Me(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function kr(){return++xu}var Ce=ft.prototype;Me.prototype={constructor:Me,select:Ql,selectAll:Jl,selectChild:Ce.selectChild,selectChildren:Ce.selectChildren,filter:Yl,merge:Zl,selection:tu,transition:mu,call:Ce.call,nodes:Ce.nodes,node:Ce.node,size:Ce.size,empty:Ce.empty,each:Ce.each,on:ql,attr:kl,attrTween:$l,style:iu,styleTween:lu,text:fu,textTween:pu,remove:Kl,tween:bl,delay:Ll,duration:Vl,ease:Bl,easeVarying:Xl,end:yu,[Symbol.iterator]:Ce[Symbol.iterator]};function wu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var vu={time:null,delay:0,duration:250,ease:wu};function _u(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 bu(e){var t,n;e instanceof Me?(t=e._id,e=e._name):(t=kr(),(n=vu).time=In(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&Ft(l,e,t,c,s,n||_u(l,t));return new Me(o,this._parents,e,t)}ft.prototype.interrupt=wl;ft.prototype.transition=bu;const wt=e=>()=>e;function Su(e,{sourceEvent:t,target:n,transform:o,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:o,enumerable:!0,configurable:!0},_:{value:r}})}function Ne(e,t,n){this.k=e,this.x=t,this.y=n}Ne.prototype={constructor:Ne,scale:function(e){return e===1?this:new Ne(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ne(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 Xt=new Ne(1,0,0);Ar.prototype=Ne.prototype;function Ar(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Xt;return e.__zoom}function rn(e){e.stopImmediatePropagation()}function et(e){e.preventDefault(),e.stopImmediatePropagation()}function Eu(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Cu(){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 go(){return this.__zoom||Xt}function Nu(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Mu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Iu(e,t,n){var o=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],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Pr(){var e=Eu,t=Cu,n=Iu,o=Nu,r=Mu,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Nt,c=Vt("start","zoom","end"),u,f,d,h=500,g=150,v=0,_=10;function x(w){w.property("__zoom",go).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",j).filter(r).on("touchstart.zoom",I).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(w,M,E,A){var k=w.selection?w.selection():w;k.property("__zoom",go),w!==k?C(w,M,E,A):k.interrupt().each(function(){S(this,arguments).event(A).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},x.scaleBy=function(w,M,E,A){x.scaleTo(w,function(){var k=this.__zoom.k,D=typeof M=="function"?M.apply(this,arguments):M;return k*D},E,A)},x.scaleTo=function(w,M,E,A){x.transform(w,function(){var k=t.apply(this,arguments),D=this.__zoom,$=E==null?m(k):typeof E=="function"?E.apply(this,arguments):E,V=D.invert($),R=typeof M=="function"?M.apply(this,arguments):M;return n(p(b(D,R),$,V),k,s)},E,A)},x.translateBy=function(w,M,E,A){x.transform(w,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,A)},x.translateTo=function(w,M,E,A,k){x.transform(w,function(){var D=t.apply(this,arguments),$=this.__zoom,V=A==null?m(D):typeof A=="function"?A.apply(this,arguments):A;return n(Xt.translate(V[0],V[1]).scale($.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof E=="function"?-E.apply(this,arguments):-E),D,s)},A,k)};function b(w,M){return M=Math.max(i[0],Math.min(i[1],M)),M===w.k?w:new Ne(M,w.x,w.y)}function p(w,M,E){var A=M[0]-E[0]*w.k,k=M[1]-E[1]*w.k;return A===w.x&&k===w.y?w:new Ne(w.k,A,k)}function m(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function C(w,M,E,A){w.on("start.zoom",function(){S(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(A).end()}).tween("zoom",function(){var k=this,D=arguments,$=S(k,D).event(A),V=t.apply(k,D),R=E==null?m(V):typeof E=="function"?E.apply(k,D):E,F=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),B=k.__zoom,G=typeof M=="function"?M.apply(k,D):M,K=l(B.invert(R).concat(F/B.k),G.invert(R).concat(F/G.k));return function(Z){if(Z===1)Z=G;else{var O=K(Z),X=F/O[2];Z=new Ne(X,R[0]-O[0]*X,R[1]-O[1]*X)}$.zoom(null,Z)}})}function S(w,M,E){return!E&&w.__zooming||new N(w,M)}function N(w,M){this.that=w,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(w,M),this.taps=0}N.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,M){return this.mouse&&w!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var M=he(this.that).datum();c.call(w,this.that,new Su(w,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:c}),M)}};function T(w,...M){if(!e.apply(this,arguments))return;var E=S(this,M).event(w),A=this.__zoom,k=Math.max(i[0],Math.min(i[1],A.k*Math.pow(2,o.apply(this,arguments)))),D=me(w);if(E.wheel)(E.mouse[0][0]!==D[0]||E.mouse[0][1]!==D[1])&&(E.mouse[1]=A.invert(E.mouse[0]=D)),clearTimeout(E.wheel);else{if(A.k===k)return;E.mouse=[D,A.invert(D)],kt(this),E.start()}et(w),E.wheel=setTimeout($,g),E.zoom("mouse",n(p(b(A,k),E.mouse[0],E.mouse[1]),E.extent,s));function $(){E.wheel=null,E.end()}}function P(w,...M){if(d||!e.apply(this,arguments))return;var E=w.currentTarget,A=S(this,M,!0).event(w),k=he(w.view).on("mousemove.zoom",R,!0).on("mouseup.zoom",F,!0),D=me(w,E),$=w.clientX,V=w.clientY;xr(w.view),rn(w),A.mouse=[D,this.__zoom.invert(D)],kt(this),A.start();function R(B){if(et(B),!A.moved){var G=B.clientX-$,K=B.clientY-V;A.moved=G*G+K*K>v}A.event(B).zoom("mouse",n(p(A.that.__zoom,A.mouse[0]=me(B,E),A.mouse[1]),A.extent,s))}function F(B){k.on("mousemove.zoom mouseup.zoom",null),wr(B.view,A.moved),et(B),A.event(B).end()}}function j(w,...M){if(e.apply(this,arguments)){var E=this.__zoom,A=me(w.changedTouches?w.changedTouches[0]:w,this),k=E.invert(A),D=E.k*(w.shiftKey?.5:2),$=n(p(b(E,D),A,k),t.apply(this,M),s);et(w),a>0?he(this).transition().duration(a).call(C,$,A,w):he(this).call(x.transform,$,A,w)}}function I(w,...M){if(e.apply(this,arguments)){var E=w.touches,A=E.length,k=S(this,M,w.changedTouches.length===A).event(w),D,$,V,R;for(rn(w),$=0;$<A;++$)V=E[$],R=me(V,this),R=[R,this.__zoom.invert(R),V.identifier],k.touch0?!k.touch1&&k.touch0[2]!==R[2]&&(k.touch1=R,k.taps=0):(k.touch0=R,D=!0,k.taps=1+!!u);u&&(u=clearTimeout(u)),D&&(k.taps<2&&(f=R[0],u=setTimeout(function(){u=null},h)),kt(this),k.start())}}function z(w,...M){if(this.__zooming){var E=S(this,M).event(w),A=w.changedTouches,k=A.length,D,$,V,R;for(et(w),D=0;D<k;++D)$=A[D],V=me($,this),E.touch0&&E.touch0[2]===$.identifier?E.touch0[0]=V:E.touch1&&E.touch1[2]===$.identifier&&(E.touch1[0]=V);if($=E.that.__zoom,E.touch1){var F=E.touch0[0],B=E.touch0[1],G=E.touch1[0],K=E.touch1[1],Z=(Z=G[0]-F[0])*Z+(Z=G[1]-F[1])*Z,O=(O=K[0]-B[0])*O+(O=K[1]-B[1])*O;$=b($,Math.sqrt(Z/O)),V=[(F[0]+G[0])/2,(F[1]+G[1])/2],R=[(B[0]+K[0])/2,(B[1]+K[1])/2]}else if(E.touch0)V=E.touch0[0],R=E.touch0[1];else return;E.zoom("touch",n(p($,V,R),E.extent,s))}}function L(w,...M){if(this.__zooming){var E=S(this,M).event(w),A=w.changedTouches,k=A.length,D,$;for(rn(w),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),D=0;D<k;++D)$=A[D],E.touch0&&E.touch0[2]===$.identifier?delete E.touch0:E.touch1&&E.touch1[2]===$.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&($=me($,this),Math.hypot(f[0]-$[0],f[1]-$[1])<_)){var V=he(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return x.wheelDelta=function(w){return arguments.length?(o=typeof w=="function"?w:wt(+w),x):o},x.filter=function(w){return arguments.length?(e=typeof w=="function"?w:wt(!!w),x):e},x.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:wt(!!w),x):r},x.extent=function(w){return arguments.length?(t=typeof w=="function"?w:wt([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),x):t},x.scaleExtent=function(w){return arguments.length?(i[0]=+w[0],i[1]=+w[1],x):[i[0],i[1]]},x.translateExtent=function(w){return arguments.length?(s[0][0]=+w[0][0],s[1][0]=+w[1][0],s[0][1]=+w[0][1],s[1][1]=+w[1][1],x):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},x.constrain=function(w){return arguments.length?(n=w,x):n},x.duration=function(w){return arguments.length?(a=+w,x):a},x.interpolate=function(w){return arguments.length?(l=w,x):l},x.on=function(){var w=c.on.apply(c,arguments);return w===c?x:w},x.clickDistance=function(w){return arguments.length?(v=(w=+w)*w,x):Math.sqrt(v)},x.tapDistance=function(w){return arguments.length?(_=+w,x):_},x}const be={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:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},at=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Tr=["Enter"," ","Escape"],Dr={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var We;(function(e){e.Strict="strict",e.Loose="loose"})(We||(We={}));var He;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(He||(He={}));var ct;(function(e){e.Partial="partial",e.Full="full"})(ct||(ct={}));const $r={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Pe;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Pe||(Pe={}));var $t;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})($t||($t={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));const po={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top};function zr(e){return e===null?null:e?"valid":"invalid"}const Hr=e=>"id"in e&&"source"in e&&"target"in e,ku=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Pn=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ht=(e,t=[0,0])=>{const{width:n,height:o}=Ie(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Au=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const i=typeof r=="string";let s=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(r):Pn(r)?r:t.nodeLookup.get(r.id));const a=s?zt(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Yt(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Zt(n)},gt=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=Yt(n,zt(r)),o=!0)}),o?Zt(n):{x:0,y:0,width:0,height:0}},Tn=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...mt(t,[n,o,r]),width:t.width/r,height:t.height/r},l=[];for(const c of e.values()){const{measured:u,selectable:f=!0,hidden:d=!1}=c;if(s&&!f||d)continue;const h=u.width??c.width??c.initialWidth??null,g=u.height??c.height??c.initialHeight??null,v=lt(a,qe(c)),_=(h??0)*(g??0),x=i&&v>0;(!c.internals.handleBounds||x||v>=_||c.dragging)&&l.push(c)}return l},Pu=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function Tu(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function Du({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Tu(e,s),l=gt(a),c=Dn(l,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)}function Lr({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let f=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",be.error005());else{const h=a.measured.width,g=a.measured.height;h&&g&&(f=[[l,c],[l+h,c+g]])}else a&&Ue(s.extent)&&(f=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);const d=Ue(f)?Re(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",be.error015()),{position:{x:d.x-l+(s.measured.width??0)*u[0],y:d.y-c+(s.measured.height??0)*u[1]},positionAbsolute:d}}async function $u({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const h=i.has(d.id),g=!h&&d.parentId&&s.find(v=>v.id===d.parentId);(h||g)&&s.push(d)}const a=new Set(t.map(d=>d.id)),l=o.filter(d=>d.deletable!==!1),u=Pu(s,l);for(const d of l)a.has(d.id)&&!u.find(g=>g.id===d.id)&&u.push(d);if(!r)return{edges:u,nodes:s};const f=await r({nodes:s,edges:u});return typeof f=="boolean"?f?{edges:u,nodes:s}:{edges:[],nodes:[]}:f}const Ge=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Re=(e={x:0,y:0},t,n)=>({x:Ge(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Ge(e.y,t[0][1],t[1][1]-(n?.height??0))});function Rr(e,t,n){const{width:o,height:r}=Ie(n),{x:i,y:s}=n.internals.positionAbsolute;return Re(e,[[i,s],[i+o,s+r]],t)}const mo=(e,t,n)=>e<t?Ge(Math.abs(e-t),1,t)/t:e>n?-Ge(Math.abs(e-n),1,t)/t:0,jr=(e,t,n=15,o=40)=>{const r=mo(e.x,o,t.width-o)*n,i=mo(e.y,o,t.height-o)*n;return[r,i]},Yt=(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)}),xn=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Zt=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),qe=(e,t=[0,0])=>{const{x:n,y:o}=Pn(e)?e.internals.positionAbsolute:ht(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},zt=(e,t=[0,0])=>{const{x:n,y:o}=Pn(e)?e.internals.positionAbsolute:ht(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},Vr=(e,t)=>Zt(Yt(xn(e),xn(t))),lt=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},yo=e=>ye(e.width)&&ye(e.height)&&ye(e.x)&&ye(e.y),ye=e=>!isNaN(e)&&isFinite(e),zu=(e,t)=>{},pt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),mt=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?pt(a,s):a},Ht=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Oe(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Hu(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Oe(e,n),r=Oe(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Oe(e.top??e.y??0,n),r=Oe(e.bottom??e.y??0,n),i=Oe(e.left??e.x??0,t),s=Oe(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Lu(e,t,n,o,r,i){const{x:s,y:a}=Ht(e,[t,n,o]),{x:l,y:c}=Ht({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-l,f=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(f)}}const Dn=(e,t,n,o,r,i)=>{const s=Hu(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=Ge(c,o,r),f=e.x+e.width/2,d=e.y+e.height/2,h=t/2-f*u,g=n/2-d*u,v=Lu(e,h,g,u,t,n),_={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:h-_.left+_.right,y:g-_.top+_.bottom,zoom:u}},ut=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Ue(e){return e!=null&&e!=="parent"}function Ie(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Or(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Br(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function xo(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ru(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function ju(e){return{...Dr,...e||{}}}function ot(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=xe(e),a=mt({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:l,y:c}=n?pt(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const $n=e=>({width:e.offsetWidth,height:e.offsetHeight}),Fr=e=>e?.getRootNode?.()||window?.document,Vu=["INPUT","SELECT","TEXTAREA"];function Xr(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:Vu.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Yr=e=>"clientX"in e,xe=(e,t)=>{const n=Yr(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},wo=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...$n(s)}})};function Zr({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+o*.125,u=Math.abs(l-e),f=Math.abs(c-t);return[l,c,u,f]}function vt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function vo({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case Y.Left:return[t-vt(t-o,i),n];case Y.Right:return[t+vt(o-t,i),n];case Y.Top:return[t,n-vt(n-r,i)];case Y.Bottom:return[t,n+vt(r-n,i)]}}function Wr({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:o,targetY:r,targetPosition:i=Y.Top,curvature:s=.25}){const[a,l]=vo({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,u]=vo({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[f,d,h,g]=Zr({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${o},${r}`,f,d,h,g]}function Gr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function Ou({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const s=r&&n?o+1e3:o,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function Bu({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=Yt(zt(e),zt(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return lt(s,Zt(i))>0}const Fu=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,Xu=(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)),Yu=(e,t,n={})=>{if(!e.source||!e.target)return t;const o=n.getEdgeId||Fu;let r;return Hr(e)?r={...e}:r={...e,id:o(e)},Xu(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function qr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Gr({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const _o={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},Zu=({source:e,sourcePosition:t=Y.Bottom,target:n})=>t===Y.Left||t===Y.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},bo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Wu({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:o=Y.Top,center:r,offset:i,stepPosition:s}){const a=_o[t],l=_o[o],c={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},f=Zu({source:c,sourcePosition:t,target:u}),d=f.x!==0?"x":"y",h=f[d];let g=[],v,_;const x={x:0,y:0},b={x:0,y:0},[,,p,m]=Gr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*l[d]===-1){d==="x"?(v=r.x??c.x+(u.x-c.x)*s,_=r.y??(c.y+u.y)/2):(v=r.x??(c.x+u.x)/2,_=r.y??c.y+(u.y-c.y)*s);const S=[{x:v,y:c.y},{x:v,y:u.y}],N=[{x:c.x,y:_},{x:u.x,y:_}];a[d]===h?g=d==="x"?S:N:g=d==="x"?N:S}else{const S=[{x:c.x,y:u.y}],N=[{x:u.x,y:c.y}];if(d==="x"?g=a.x===h?N:S:g=a.y===h?S:N,t===o){const z=Math.abs(e[d]-n[d]);if(z<=i){const L=Math.min(i-1,i-z);a[d]===h?x[d]=(c[d]>e[d]?-1:1)*L:b[d]=(u[d]>n[d]?-1:1)*L}}if(t!==o){const z=d==="x"?"y":"x",L=a[d]===l[z],w=c[z]>u[z],M=c[z]<u[z];(a[d]===1&&(!L&&w||L&&M)||a[d]!==1&&(!L&&M||L&&w))&&(g=d==="x"?S:N)}const T={x:c.x+x.x,y:c.y+x.y},P={x:u.x+b.x,y:u.y+b.y},j=Math.max(Math.abs(T.x-g[0].x),Math.abs(P.x-g[0].x)),I=Math.max(Math.abs(T.y-g[0].y),Math.abs(P.y-g[0].y));j>=I?(v=(T.x+P.x)/2,_=g[0].y):(v=g[0].x,_=(T.y+P.y)/2)}return[[e,{x:c.x+x.x,y:c.y+x.y},...g,{x:u.x+b.x,y:u.y+b.y},n],v,_,p,m]}function Gu(e,t,n,o){const r=Math.min(bo(e,t)/2,bo(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*c},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+r*l}Q ${i},${s} ${i+r*a},${s}`}function wn({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:o,targetY:r,targetPosition:i=Y.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20,stepPosition:u=.5}){const[f,d,h,g,v]=Wu({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:l},offset:c,stepPosition:u});return[f.reduce((x,b,p)=>{let m="";return p>0&&p<f.length-1?m=Gu(f[p-1],b,f[p+1],s):m=`${p===0?"M":"L"}${b.x} ${b.y}`,x+=m,x},""),d,h,g,v]}function So(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function qu(e){const{sourceNode:t,targetNode:n}=e;if(!So(t)||!So(n))return null;const o=t.internals.handleBounds||Eo(t.handles),r=n.internals.handleBounds||Eo(n.handles),i=Co(o?.source??[],e.sourceHandle),s=Co(e.connectionMode===We.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",be.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Y.Bottom,l=s?.position||Y.Top,c=je(t,i,a),u=je(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function Eo(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function je(e,t,n=Y.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Ie(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case Y.Top:return{x:r+s/2,y:i};case Y.Right:return{x:r+s,y:i+a/2};case Y.Bottom:return{x:r+s/2,y:i+a};case Y.Left:return{x:r,y:i+a/2}}}function Co(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function vn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function Uu(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(l=>{if(l&&typeof l=="object"){const c=vn(l,t);i.has(c)||(s.push({id:c,color:l.color||n,...l}),i.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Ur=1e3,Ku=10,zn={nodeOrigin:[0,0],nodeExtent:at,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Qu={...zn,checkEquality:!0};function Hn(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function Ju(e,t,n){const o=Hn(zn,n);for(const r of e.values())if(r.parentId)Rn(r,e,t,o);else{const i=ht(r,o.nodeOrigin),s=Ue(r.extent)?r.extent:o.nodeExtent,a=Re(i,s,Ie(r));r.internals.positionAbsolute=a}}function ed(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function Ln(e){return e==="manual"}function _n(e,t,n,o={}){const r=Hn(Qu,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!Ln(r.zIndexMode)?Ur:0;let l=e.length>0;t.clear(),n.clear();for(const c of e){let u=s.get(c.id);if(r.checkEquality&&c===u?.internals.userNode)t.set(c.id,u);else{const f=ht(c,r.nodeOrigin),d=Ue(c.extent)?c.extent:r.nodeExtent,h=Re(f,d,Ie(c));u={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:h,handleBounds:ed(c,u),z:Kr(c,a,r.zIndexMode),userNode:c}},t.set(c.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(l=!1),c.parentId&&Rn(u,t,n,o,i)}return l}function td(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 Rn(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=Hn(zn,o),c=e.parentId,u=t.get(c);if(!u){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}td(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*Ku),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const f=i&&!Ln(l)?Ur:0,{x:d,y:h,z:g}=nd(e,u,s,a,f,l),{positionAbsolute:v}=e.internals,_=d!==v.x||h!==v.y;(_||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:_?{x:d,y:h}:v,z:g}})}function Kr(e,t,n){const o=ye(e.zIndex)?e.zIndex:0;return Ln(n)?o:o+(e.selected?t:0)}function nd(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,l=Ie(e),c=ht(e,n),u=Ue(e.extent)?Re(c,e.extent,l):c;let f=Re({x:s+u.x,y:a+u.y},o,l);e.extent==="parent"&&(f=Rr(f,l,t));const d=Kr(e,r,i),h=t.internals.z??0;return{x:f.x,y:f.y,z:h>=d?h+1:d}}function jn(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const l=i.get(s.parentId)?.expandedRect??qe(a),c=Vr(l,s.rect);i.set(s.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},l)=>{const c=a.internals.positionAbsolute,u=Ie(a),f=a.origin??o,d=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,h=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,g=Math.max(u.width,Math.round(s.width)),v=Math.max(u.height,Math.round(s.height)),_=(g-u.width)*f[0],x=(v-u.height)*f[1];(d>0||h>0||_||x)&&(r.push({id:l,type:"position",position:{x:a.position.x-d+_,y:a.position.y-h+x}}),n.get(l)?.forEach(b=>{e.some(p=>p.id===b.id)||r.push({id:b.id,type:"position",position:{x:b.position.x+d,y:b.position.y+h}})})),(u.width<s.width||u.height<s.height||d||h)&&r.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:g+(d?f[0]*d-_:0),height:v+(h?f[1]*h-x:0)}})}),r}function od(e,t,n,o,r,i,s){const a=o?.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(a),{m22:f}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const h of e.values()){const g=t.get(h.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),l=!0;continue}const v=$n(h.nodeElement),_=g.measured.width!==v.width||g.measured.height!==v.height;if(!!(v.width&&v.height&&(_||!g.internals.handleBounds||h.force))){const b=h.nodeElement.getBoundingClientRect(),p=Ue(g.extent)?g.extent:i;let{positionAbsolute:m}=g.internals;g.parentId&&g.extent==="parent"?m=Rr(m,v,t.get(g.parentId)):p&&(m=Re(m,p,v));const C={...g,measured:v,internals:{...g.internals,positionAbsolute:m,handleBounds:{source:wo("source",h.nodeElement,b,f,g.id),target:wo("target",h.nodeElement,b,f,g.id)}}};t.set(g.id,C),g.parentId&&Rn(C,t,n,{nodeOrigin:r,zIndexMode:s}),l=!0,_&&(c.push({id:g.id,type:"dimensions",dimensions:v}),g.expandParent&&g.parentId&&d.push({id:g.id,parentId:g.parentId,rect:qe(C,r)}))}}if(d.length>0){const h=jn(d,t,n,r);c.push(...h)}return{changes:c,updatedInternals:l}}async function rd({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function No(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),i){s=`${r}-${e}-${i}`;const c=o.get(s)||new Map;o.set(s,c.set(n,t))}}function Qr(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},c=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;No("source",l,u,e,r,s),No("target",l,c,e,i,a),t.set(o.id,o)}}function Jr(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Jr(n,t):!1}function Mo(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function sd(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!Jr(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function sn({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const l=n.get(s)?.internals.userNode;l&&r.push({...l,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function id({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=pt(i,t);return{x:s.x-i.x,y:s.y-i.y}}function ad({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,l=!1,c={x:0,y:0},u=null,f=!1,d=null,h=!1,g=!1,v=null;function _({noDragClassName:b,handleSelector:p,domNode:m,isSelectable:C,nodeId:S,nodeClickDistance:N=0}){d=he(m);function T({x:z,y:L}){const{nodeLookup:w,nodeExtent:M,snapGrid:E,snapToGrid:A,nodeOrigin:k,onNodeDrag:D,onSelectionDrag:$,onError:V,updateNodePositions:R}=t();i={x:z,y:L};let F=!1;const B=a.size>1,G=B&&M?xn(gt(a)):null,K=B&&A?id({dragItems:a,snapGrid:E,x:z,y:L}):null;for(const[Z,O]of a){if(!w.has(Z))continue;let X={x:z-O.distance.x,y:L-O.distance.y};A&&(X=K?{x:Math.round(X.x+K.x),y:Math.round(X.y+K.y)}:pt(X,E));let Q=null;if(B&&M&&!O.extent&&G){const{positionAbsolute:q}=O.internals,J=q.x-G.x+M[0][0],ne=q.x+O.measured.width-G.x2+M[1][0],te=q.y-G.y+M[0][1],se=q.y+O.measured.height-G.y2+M[1][1];Q=[[J,te],[ne,se]]}const{position:U,positionAbsolute:W}=Lr({nodeId:Z,nextPosition:X,nodeLookup:w,nodeExtent:Q||M,nodeOrigin:k,onError:V});F=F||O.position.x!==U.x||O.position.y!==U.y,O.position=U,O.internals.positionAbsolute=W}if(g=g||F,!!F&&(R(a,!0),v&&(o||D||!S&&$))){const[Z,O]=sn({nodeId:S,dragItems:a,nodeLookup:w});o?.(v,a,Z,O),D?.(v,Z,O),S||$?.(v,O)}}async function P(){if(!u)return;const{transform:z,panBy:L,autoPanSpeed:w,autoPanOnNodeDrag:M}=t();if(!M){l=!1,cancelAnimationFrame(s);return}const[E,A]=jr(c,u,w);(E!==0||A!==0)&&(i.x=(i.x??0)-E/z[2],i.y=(i.y??0)-A/z[2],await L({x:E,y:A})&&T(i)),s=requestAnimationFrame(P)}function j(z){const{nodeLookup:L,multiSelectionActive:w,nodesDraggable:M,transform:E,snapGrid:A,snapToGrid:k,selectNodesOnDrag:D,onNodeDragStart:$,onSelectionDragStart:V,unselectNodesAndEdges:R}=t();f=!0,(!D||!C)&&!w&&S&&(L.get(S)?.selected||R()),C&&D&&S&&e?.(S);const F=ot(z.sourceEvent,{transform:E,snapGrid:A,snapToGrid:k,containerBounds:u});if(i=F,a=sd(L,M,F,S),a.size>0&&(n||$||!S&&V)){const[B,G]=sn({nodeId:S,dragItems:a,nodeLookup:L});n?.(z.sourceEvent,a,B,G),$?.(z.sourceEvent,B,G),S||V?.(z.sourceEvent,G)}}const I=vr().clickDistance(N).on("start",z=>{const{domNode:L,nodeDragThreshold:w,transform:M,snapGrid:E,snapToGrid:A}=t();u=L?.getBoundingClientRect()||null,h=!1,g=!1,v=z.sourceEvent,w===0&&j(z),i=ot(z.sourceEvent,{transform:M,snapGrid:E,snapToGrid:A,containerBounds:u}),c=xe(z.sourceEvent,u)}).on("drag",z=>{const{autoPanOnNodeDrag:L,transform:w,snapGrid:M,snapToGrid:E,nodeDragThreshold:A,nodeLookup:k}=t(),D=ot(z.sourceEvent,{transform:w,snapGrid:M,snapToGrid:E,containerBounds:u});if(v=z.sourceEvent,(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||S&&!k.has(S))&&(h=!0),!h){if(!l&&L&&f&&(l=!0,P()),!f){const $=xe(z.sourceEvent,u),V=$.x-c.x,R=$.y-c.y;Math.sqrt(V*V+R*R)>A&&j(z)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&a&&f&&(c=xe(z.sourceEvent,u),T(D))}}).on("end",z=>{if(!(!f||h)&&(l=!1,f=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:L,updateNodePositions:w,onNodeDragStop:M,onSelectionDragStop:E}=t();if(g&&(w(a,!1),g=!1),r||M||!S&&E){const[A,k]=sn({nodeId:S,dragItems:a,nodeLookup:L,dragging:!1});r?.(z.sourceEvent,a,A,k),M?.(z.sourceEvent,A,k),S||E?.(z.sourceEvent,k)}}}).filter(z=>{const L=z.target;return!z.button&&(!b||!Mo(L,`.${b}`,m))&&(!p||Mo(L,p,m))});d.call(I)}function x(){d?.on(".drag",null)}return{update:_,destroy:x}}function cd(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())lt(r,qe(i))>0&&o.push(i);return o}const ld=250;function ud(e,t,n,o){let r=[],i=1/0;const s=cd(e,n,t+ld);for(const a of s){const l=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const c of l){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:u,y:f}=je(a,c,c.position,!0),d=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(f-e.y,2));d>t||(d<i?(r=[{...c,x:u,y:f}],i=d):d===i&&r.push({...c,x:u,y:f}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(l=>l.type===a)??r[0]}return r[0]}function es(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(n?a?.find(c=>c.id===n):a?.[0])??null;return l&&i?{...l,...je(s,l,l.position,!0)}:l}function ts(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function dd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const ns=()=>!0;function fd(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:f,panBy:d,cancelConnection:h,onConnectStart:g,onConnect:v,onConnectEnd:_,isValidConnection:x=ns,onReconnectEnd:b,updateConnection:p,getTransform:m,getFromHandle:C,autoPanSpeed:S,dragThreshold:N=1,handleDomNode:T}){const P=Fr(e.target);let j=0,I;const{x:z,y:L}=xe(e),w=ts(i,T),M=a?.getBoundingClientRect();let E=!1;if(!M||!w)return;const A=es(r,w,o,l,t);if(!A)return;let k=xe(e,M),D=!1,$=null,V=!1,R=null;function F(){if(!u||!M)return;const[U,W]=jr(k,M,S);d({x:U,y:W}),j=requestAnimationFrame(F)}const B={...A,nodeId:r,type:w,position:A.position},G=l.get(r);let Z={inProgress:!0,isValid:null,from:je(G,B,Y.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:G,to:k,toHandle:null,toPosition:po[B.position],toNode:null,pointer:k};function O(){E=!0,p(Z),g?.(e,{nodeId:r,handleId:o,handleType:w})}N===0&&O();function X(U){if(!E){const{x:se,y:le}=xe(U),ce=se-z,de=le-L;if(!(ce*ce+de*de>N*N))return;O()}if(!C()||!B){Q(U);return}const W=m();k=xe(U,M),I=ud(mt(k,W,!1,[1,1]),n,l,B),D||(F(),D=!0);const q=os(U,{handle:I,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:x,doc:P,lib:c,flowId:f,nodeLookup:l});R=q.handleDomNode,$=q.connection,V=dd(!!I,q.isValid);const J=l.get(r),ne=J?je(J,B,Y.Left,!0):Z.from,te={...Z,from:ne,isValid:V,to:q.toHandle&&V?Ht({x:q.toHandle.x,y:q.toHandle.y},W):k,toHandle:q.toHandle,toPosition:V&&q.toHandle?q.toHandle.position:po[B.position],toNode:q.toHandle?l.get(q.toHandle.nodeId):null,pointer:k};p(te),Z=te}function Q(U){if(!("touches"in U&&U.touches.length>0)){if(E){(I||R)&&$&&V&&v?.($);const{inProgress:W,...q}=Z,J={...q,toPosition:Z.toHandle?Z.toPosition:null};_?.(U,J),i&&b?.(U,J)}h(),cancelAnimationFrame(j),D=!1,V=!1,$=null,R=null,P.removeEventListener("mousemove",X),P.removeEventListener("mouseup",Q),P.removeEventListener("touchmove",X),P.removeEventListener("touchend",Q)}}P.addEventListener("mousemove",X),P.addEventListener("mouseup",Q),P.addEventListener("touchmove",X),P.addEventListener("touchend",Q)}function os(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=ns,nodeLookup:u}){const f=i==="target",d=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:g}=xe(e),v=s.elementFromPoint(h,g),_=v?.classList.contains(`${a}-flow__handle`)?v:d,x={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const b=ts(void 0,_),p=_.getAttribute("data-nodeid"),m=_.getAttribute("data-handleid"),C=_.classList.contains("connectable"),S=_.classList.contains("connectableend");if(!p||!b)return x;const N={source:f?p:o,sourceHandle:f?m:r,target:f?o:p,targetHandle:f?r:m};x.connection=N;const P=C&&S&&(n===We.Strict?f&&b==="source"||!f&&b==="target":p!==o||m!==r);x.isValid=P&&c(N),x.toHandle=es(p,b,m,u,n,!0)}return x}const bn={onPointerDown:fd,isValid:os};function hd({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=he(e);function i({translateExtent:a,width:l,height:c,zoomStep:u=1,pannable:f=!0,zoomable:d=!0,inversePan:h=!1}){const g=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const m=n(),C=p.sourceEvent.ctrlKey&&ut()?10:1,S=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*u,N=m[2]*Math.pow(2,S*C);t.scaleTo(N)};let v=[0,0];const _=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(v=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},x=p=>{const m=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const C=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],S=[C[0]-v[0],C[1]-v[1]];v=C;const N=o()*Math.max(m[2],Math.log(m[2]))*(h?-1:1),T={x:m[0]-S[0]*N,y:m[1]-S[1]*N},P=[[0,0],[l,c]];t.setViewportConstrained({x:T.x,y:T.y,zoom:m[2]},P,a)},b=Pr().on("start",_).on("zoom",f?x:null).on("zoom.wheel",d?g:null);r.call(b,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:me}}const Wt=e=>({x:e.x,y:e.y,zoom:e.k}),an=({x:e,y:t,zoom:n})=>Xt.translate(e,t).scale(n),Be=(e,t)=>e.target.closest(`.${t}`),rs=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),gd=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,cn=(e,t=0,n=gd,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},ss=e=>{const t=e.ctrlKey&&ut()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function pd({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(Be(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(u.ctrlKey&&s){const _=me(u),x=ss(u),b=f*Math.pow(2,x);o.scaleTo(n,b,_,u);return}const d=u.deltaMode===1?20:1;let h=r===He.Vertical?0:u.deltaX*d,g=r===He.Horizontal?0:u.deltaY*d;!ut()&&u.shiftKey&&r!==He.Vertical&&(h=u.deltaY*d,g=0),o.translateBy(n,-(h/f)*i,-(g/f)*i,{internal:!0});const v=Wt(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(u,v),e.panScrollTimeout=setTimeout(()=>{c?.(u,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a?.(u,v))}}function md({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=Be(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function yd({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=Wt(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function xd({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&rs(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,Wt(i.transform))}}function wd({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&rs(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=Wt(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function vd({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:l,lib:c,connectionInProgress:u}){return f=>{const d=e||t,h=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Be(f,`${c}-flow__node`)||Be(f,`${c}-flow__edge`)))return!0;if(!o&&!d&&!r&&!i&&!n||s||u&&!g||Be(f,a)&&g||Be(f,l)&&(!g||r&&g&&!e)||!n&&f.ctrlKey&&g)return!1;if(!n&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!d&&!r&&!h&&g||!o&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(o)&&!o.includes(f.button)&&f.type==="mousedown")return!1;const v=Array.isArray(o)&&o.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||g)&&v}}function _d({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),f=Pr().scaleExtent([t,n]).translateExtent(o),d=he(e).call(f);b({x:r.x,y:r.y,zoom:Ge(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const h=d.on("wheel.zoom"),g=d.on("dblclick.zoom");f.wheelDelta(ss);function v(I,z){return d?new Promise(L=>{f?.interpolate(z?.interpolate==="linear"?tn:Nt).transform(cn(d,z?.duration,z?.ease,()=>L(!0)),I)}):Promise.resolve(!1)}function _({noWheelClassName:I,noPanClassName:z,onPaneContextMenu:L,userSelectionActive:w,panOnScroll:M,panOnDrag:E,panOnScrollMode:A,panOnScrollSpeed:k,preventScrolling:D,zoomOnPinch:$,zoomOnScroll:V,zoomOnDoubleClick:R,zoomActivationKeyPressed:F,lib:B,onTransformChange:G,connectionInProgress:K,paneClickDistance:Z,selectionOnDrag:O}){w&&!c.isZoomingOrPanning&&x();const X=M&&!F&&!w;f.clickDistance(O?1/0:!ye(Z)||Z<0?0:Z);const Q=X?pd({zoomPanValues:c,noWheelClassName:I,d3Selection:d,d3Zoom:f,panOnScrollMode:A,panOnScrollSpeed:k,zoomOnPinch:$,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):md({noWheelClassName:I,preventScrolling:D,d3ZoomHandler:h});if(d.on("wheel.zoom",Q,{passive:!1}),!w){const W=yd({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});f.on("start",W);const q=xd({zoomPanValues:c,panOnDrag:E,onPaneContextMenu:!!L,onPanZoom:i,onTransformChange:G});f.on("zoom",q);const J=wd({zoomPanValues:c,panOnDrag:E,panOnScroll:M,onPaneContextMenu:L,onPanZoomEnd:a,onDraggingChange:l});f.on("end",J)}const U=vd({zoomActivationKeyPressed:F,panOnDrag:E,zoomOnScroll:V,panOnScroll:M,zoomOnDoubleClick:R,zoomOnPinch:$,userSelectionActive:w,noPanClassName:z,noWheelClassName:I,lib:B,connectionInProgress:K});f.filter(U),R?d.on("dblclick.zoom",g):d.on("dblclick.zoom",null)}function x(){f.on("zoom",null)}async function b(I,z,L){const w=an(I),M=f?.constrain()(w,z,L);return M&&await v(M),new Promise(E=>E(M))}async function p(I,z){const L=an(I);return await v(L,z),new Promise(w=>w(L))}function m(I){if(d){const z=an(I),L=d.property("__zoom");(L.k!==I.zoom||L.x!==I.x||L.y!==I.y)&&f?.transform(d,z,null,{sync:!0})}}function C(){const I=d?Ar(d.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function S(I,z){return d?new Promise(L=>{f?.interpolate(z?.interpolate==="linear"?tn:Nt).scaleTo(cn(d,z?.duration,z?.ease,()=>L(!0)),I)}):Promise.resolve(!1)}function N(I,z){return d?new Promise(L=>{f?.interpolate(z?.interpolate==="linear"?tn:Nt).scaleBy(cn(d,z?.duration,z?.ease,()=>L(!0)),I)}):Promise.resolve(!1)}function T(I){f?.scaleExtent(I)}function P(I){f?.translateExtent(I)}function j(I){const z=!ye(I)||I<0?0:I;f?.clickDistance(z)}return{update:_,destroy:x,setViewport:p,setViewportConstrained:b,getViewport:C,scaleTo:S,scaleBy:N,setScaleExtent:T,setTranslateExtent:P,syncViewport:m,setClickDistance:j}}var Ke;(function(e){e.Line="line",e.Handle="handle"})(Ke||(Ke={}));function bd({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(l[0]=l[0]*-1),a&&i&&(l[1]=l[1]*-1),l}function Io(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function ke(e,t){return Math.max(0,t-e)}function Ae(e,t){return Math.max(0,e-t)}function _t(e,t,n){return Math.max(0,t-e,e-n)}function ko(e,t){return e?!t:t}function Sd(e,t,n,o,r,i,s,a){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:f}=t,d=u&&f,{xSnapped:h,ySnapped:g}=n,{minWidth:v,maxWidth:_,minHeight:x,maxHeight:b}=o,{x:p,y:m,width:C,height:S,aspectRatio:N}=e;let T=Math.floor(u?h-e.pointerX:0),P=Math.floor(f?g-e.pointerY:0);const j=C+(l?-T:T),I=S+(c?-P:P),z=-i[0]*C,L=-i[1]*S;let w=_t(j,v,_),M=_t(I,x,b);if(s){let k=0,D=0;l&&T<0?k=ke(p+T+z,s[0][0]):!l&&T>0&&(k=Ae(p+j+z,s[1][0])),c&&P<0?D=ke(m+P+L,s[0][1]):!c&&P>0&&(D=Ae(m+I+L,s[1][1])),w=Math.max(w,k),M=Math.max(M,D)}if(a){let k=0,D=0;l&&T>0?k=Ae(p+T,a[0][0]):!l&&T<0&&(k=ke(p+j,a[1][0])),c&&P>0?D=Ae(m+P,a[0][1]):!c&&P<0&&(D=ke(m+I,a[1][1])),w=Math.max(w,k),M=Math.max(M,D)}if(r){if(u){const k=_t(j/N,x,b)*N;if(w=Math.max(w,k),s){let D=0;!l&&!c||l&&!c&&d?D=Ae(m+L+j/N,s[1][1])*N:D=ke(m+L+(l?T:-T)/N,s[0][1])*N,w=Math.max(w,D)}if(a){let D=0;!l&&!c||l&&!c&&d?D=ke(m+j/N,a[1][1])*N:D=Ae(m+(l?T:-T)/N,a[0][1])*N,w=Math.max(w,D)}}if(f){const k=_t(I*N,v,_)/N;if(M=Math.max(M,k),s){let D=0;!l&&!c||c&&!l&&d?D=Ae(p+I*N+z,s[1][0])/N:D=ke(p+(c?P:-P)*N+z,s[0][0])/N,M=Math.max(M,D)}if(a){let D=0;!l&&!c||c&&!l&&d?D=ke(p+I*N,a[1][0])/N:D=Ae(p+(c?P:-P)*N,a[0][0])/N,M=Math.max(M,D)}}}P=P+(P<0?M:-M),T=T+(T<0?w:-w),r&&(d?j>I*N?P=(ko(l,c)?-T:T)/N:T=(ko(l,c)?-P:P)*N:u?(P=T/N,c=l):(T=P*N,l=c));const E=l?p+T:p,A=c?m+P:m;return{width:C+(l?-T:T),height:S+(c?-P:P),x:i[0]*T*(l?-1:1)+E,y:i[1]*P*(c?-1:1)+A}}const is={width:0,height:0,x:0,y:0},Ed={...is,pointerX:0,pointerY:0,aspectRatio:1};function Cd(e){return[[0,0],[e.measured.width,e.measured.height]]}function Nd(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,l=n[1]*s;return[[o-a,r-l],[o+i-a,r+s-l]]}function Md({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=he(e);let s={controlDirection:Io("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:u,keepAspectRatio:f,resizeDirection:d,onResizeStart:h,onResize:g,onResizeEnd:v,shouldResize:_}){let x={...is},b={...Ed};s={boundaries:u,resizeDirection:d,keepAspectRatio:f,controlDirection:Io(c)};let p,m=null,C=[],S,N,T,P=!1;const j=vr().on("start",I=>{const{nodeLookup:z,transform:L,snapGrid:w,snapToGrid:M,nodeOrigin:E,paneDomNode:A}=n();if(p=z.get(t),!p)return;m=A?.getBoundingClientRect()??null;const{xSnapped:k,ySnapped:D}=ot(I.sourceEvent,{transform:L,snapGrid:w,snapToGrid:M,containerBounds:m});x={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},b={...x,pointerX:k,pointerY:D,aspectRatio:x.width/x.height},S=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(S=z.get(p.parentId),N=S&&p.extent==="parent"?Cd(S):void 0),C=[],T=void 0;for(const[$,V]of z)if(V.parentId===t&&(C.push({id:$,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const R=Nd(V,p,V.origin??E);T?T=[[Math.min(R[0][0],T[0][0]),Math.min(R[0][1],T[0][1])],[Math.max(R[1][0],T[1][0]),Math.max(R[1][1],T[1][1])]]:T=R}h?.(I,{...x})}).on("drag",I=>{const{transform:z,snapGrid:L,snapToGrid:w,nodeOrigin:M}=n(),E=ot(I.sourceEvent,{transform:z,snapGrid:L,snapToGrid:w,containerBounds:m}),A=[];if(!p)return;const{x:k,y:D,width:$,height:V}=x,R={},F=p.origin??M,{width:B,height:G,x:K,y:Z}=Sd(b,s.controlDirection,E,s.boundaries,s.keepAspectRatio,F,N,T),O=B!==$,X=G!==V,Q=K!==k&&O,U=Z!==D&&X;if(!Q&&!U&&!O&&!X)return;if((Q||U||F[0]===1||F[1]===1)&&(R.x=Q?K:x.x,R.y=U?Z:x.y,x.x=R.x,x.y=R.y,C.length>0)){const ne=K-k,te=Z-D;for(const se of C)se.position={x:se.position.x-ne+F[0]*(B-$),y:se.position.y-te+F[1]*(G-V)},A.push(se)}if((O||X)&&(R.width=O&&(!s.resizeDirection||s.resizeDirection==="horizontal")?B:x.width,R.height=X&&(!s.resizeDirection||s.resizeDirection==="vertical")?G:x.height,x.width=R.width,x.height=R.height),S&&p.expandParent){const ne=F[0]*(R.width??0);R.x&&R.x<ne&&(x.x=ne,b.x=b.x-(R.x-ne));const te=F[1]*(R.height??0);R.y&&R.y<te&&(x.y=te,b.y=b.y-(R.y-te))}const W=bd({width:x.width,prevWidth:$,height:x.height,prevHeight:V,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),q={...x,direction:W};_?.(I,q)!==!1&&(P=!0,g?.(I,q),o(R,A))}).on("end",I=>{P&&(v?.(I,{...x}),r?.({...x}),P=!1)});i.call(j)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}const Id={},Ao=e=>{let t;const n=new Set,o=(u,f)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const h=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(g=>g(t,h))}},r=()=>t,l={setState:o,getState:r,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(Id?"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()}},c=t=e(o,r,l);return l},kd=e=>e?Ao(e):Ao,{useDebugValue:Ad}=Wi,{useSyncExternalStoreWithSelector:Pd}=Zi,Td=e=>e;function as(e,t=Td,n){const o=Pd(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Ad(o),o}const Po=(e,t)=>{const n=kd(e),o=(r,i=t)=>as(n,r,i);return Object.assign(o,n),o},Dd=(e,t)=>e?Po(e,t):Po;function oe(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[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const Gt=H.createContext(null),$d=Gt.Provider,cs=be.error001();function ee(e,t){const n=H.useContext(Gt);if(n===null)throw new Error(cs);return as(n,e,t)}function re(){const e=H.useContext(Gt);if(e===null)throw new Error(cs);return H.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const To={display:"none"},zd={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ls="react-flow__node-desc",us="react-flow__edge-desc",Hd="react-flow__aria-live",Ld=e=>e.ariaLiveMessage,Rd=e=>e.ariaLabelConfig;function jd({rfId:e}){const t=ee(Ld);return y.jsx("div",{id:`${Hd}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:zd,children:t})}function Vd({rfId:e,disableKeyboardA11y:t}){const n=ee(Rd);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${ls}-${e}`,style:To,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${us}-${e}`,style:To,children:n["edge.a11yDescription.default"]}),!t&&y.jsx(jd,{rfId:e})]})}const qt=H.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return y.jsx("div",{className:ae(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});qt.displayName="Panel";function Od({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:y.jsx(qt,{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:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Bd=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},bt=e=>e.id;function Fd(e,t){return oe(e.selectedNodes.map(bt),t.selectedNodes.map(bt))&&oe(e.selectedEdges.map(bt),t.selectedEdges.map(bt))}function Xd({onSelectionChange:e}){const t=re(),{selectedNodes:n,selectedEdges:o}=ee(Bd,Fd);return H.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const Yd=e=>!!e.onSelectionChangeHandlers;function Zd({onSelectionChange:e}){const t=ee(Yd);return e||t?y.jsx(Xd,{onSelectionChange:e}):null}const ds=[0,0],Wd={x:0,y:0,zoom:1},Gd=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","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","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Do=[...Gd,"rfId"],qd=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}),$o={translateExtent:at,nodeOrigin:ds,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Ud(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=ee(qd,oe),c=re();H.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{u.current=$o,a()}),[]);const u=H.useRef($o);return H.useEffect(()=>{for(const f of Do){const d=e[f],h=u.current[f];d!==h&&(typeof e[f]>"u"||(f==="nodes"?t(d):f==="edges"?n(d):f==="minZoom"?o(d):f==="maxZoom"?r(d):f==="translateExtent"?i(d):f==="nodeExtent"?s(d):f==="ariaLabelConfig"?c.setState({ariaLabelConfig:ju(d)}):f==="fitView"?c.setState({fitViewQueued:d}):f==="fitViewOptions"?c.setState({fitViewOptions:d}):c.setState({[f]:d})))}u.current=e},Do.map(f=>e[f])),null}function zo(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Kd(e){const[t,n]=H.useState(e==="system"?null:e);return H.useEffect(()=>{if(e!=="system"){n(e);return}const o=zo(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:zo()?.matches?"dark":"light"}const Ho=typeof document<"u"?document:null;function dt(e=null,t={target:Ho,actInsideInputWithModifier:!0}){const[n,o]=H.useState(!1),r=H.useRef(!1),i=H.useRef(new Set([])),[s,a]=H.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
|
|
2
|
-
`).replace(`
|
|
3
|
-
|
|
4
|
-
`,`
|
|
5
|
-
+`).split(`
|
|
6
|
-
`)),u=c.reduce((f,d)=>f.concat(...d),[]);return[c,u]}return[[],[]]},[e]);return H.useEffect(()=>{const l=t?.target??Ho,c=t?.actInsideInputWithModifier??!0;if(e!==null){const u=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!c)&&Xr(h))return!1;const v=Ro(h.code,a);if(i.current.add(h[v]),Lo(s,i.current,!1)){const _=h.composedPath?.()?.[0]||h.target,x=_?.nodeName==="BUTTON"||_?.nodeName==="A";t.preventDefault!==!1&&(r.current||!x)&&h.preventDefault(),o(!0)}},f=h=>{const g=Ro(h.code,a);Lo(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),r.current=!1},d=()=>{i.current.clear(),o(!1)};return l?.addEventListener("keydown",u),l?.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{l?.removeEventListener("keydown",u),l?.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,o]),n}function Lo(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function Ro(e,t){return t.includes(e)?"code":"key"}const Qd=()=>{const e=re();return H.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),l=Dn(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),c={x:t.x-a,y:t.y-l},u=n.snapGrid??r,f=n.snapToGrid??i;return mt(c,o,f,u)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=Ht(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function fs(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const l of s)Jd(l,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Jd(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={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function ef(e,t){return fs(e,t)}function tf(e,t){return fs(e,t)}function ze(e,t){return{id:e,type:"select",selected:t}}function Fe(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(ze(i.id,s)))}return o}function jo({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function Vo(e){return{id:e.id,type:"remove"}}const Oo=e=>ku(e),nf=e=>Hr(e);function hs(e){return H.forwardRef(e)}const of=typeof window<"u"?H.useLayoutEffect:H.useEffect;function Bo(e){const[t,n]=H.useState(BigInt(0)),[o]=H.useState(()=>rf(()=>n(r=>r+BigInt(1))));return of(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function rf(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const gs=H.createContext(null);function sf({children:e}){const t=re(),n=H.useCallback(a=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:u,onNodesChange:f,nodeLookup:d,fitViewQueued:h,onNodesChangeMiddlewareMap:g}=t.getState();let v=l;for(const x of a)v=typeof x=="function"?x(v):x;let _=jo({items:v,lookup:d});for(const x of g.values())_=x(_);u&&c(v),_.length>0?f?.(_):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:x,nodes:b,setNodes:p}=t.getState();x&&p(b)})},[]),o=Bo(n),r=H.useCallback(a=>{const{edges:l=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:f,edgeLookup:d}=t.getState();let h=l;for(const g of a)h=typeof g=="function"?g(h):g;u?c(h):f&&f(jo({items:h,lookup:d}))},[]),i=Bo(r),s=H.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return y.jsx(gs.Provider,{value:s,children:e})}function af(){const e=H.useContext(gs);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const cf=e=>!!e.panZoom;function Vn(){const e=Qd(),t=re(),n=af(),o=ee(cf),r=H.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),s=f=>{n.nodeQueue.push(f)},a=f=>{n.edgeQueue.push(f)},l=f=>{const{nodeLookup:d,nodeOrigin:h}=t.getState(),g=Oo(f)?f:d.get(f.id),v=g.parentId?Br(g.position,g.measured,g.parentId,d,h):g.position,_={...g,position:v,width:g.measured?.width??g.width,height:g.measured?.height??g.height};return qe(_)},c=(f,d,h={replace:!1})=>{s(g=>g.map(v=>{if(v.id===f){const _=typeof d=="function"?d(v):d;return h.replace&&Oo(_)?_:{...v,..._}}return v}))},u=(f,d,h={replace:!1})=>{a(g=>g.map(v=>{if(v.id===f){const _=typeof d=="function"?d(v):d;return h.replace&&nf(_)?_:{...v,..._}}return v}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>i(f)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(d=>({...d}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:s,setEdges:a,addNodes:f=>{const d=Array.isArray(f)?f:[f];n.nodeQueue.push(h=>[...h,...d])},addEdges:f=>{const d=Array.isArray(f)?f:[f];n.edgeQueue.push(h=>[...h,...d])},toObject:()=>{const{nodes:f=[],edges:d=[],transform:h}=t.getState(),[g,v,_]=h;return{nodes:f.map(x=>({...x})),edges:d.map(x=>({...x})),viewport:{x:g,y:v,zoom:_}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:h,edges:g,onNodesDelete:v,onEdgesDelete:_,triggerNodeChanges:x,triggerEdgeChanges:b,onDelete:p,onBeforeDelete:m}=t.getState(),{nodes:C,edges:S}=await $u({nodesToRemove:f,edgesToRemove:d,nodes:h,edges:g,onBeforeDelete:m}),N=S.length>0,T=C.length>0;if(N){const P=S.map(Vo);_?.(S),b(P)}if(T){const P=C.map(Vo);v?.(C),x(P)}return(T||N)&&p?.({nodes:C,edges:S}),{deletedNodes:C,deletedEdges:S}},getIntersectingNodes:(f,d=!0,h)=>{const g=yo(f),v=g?f:l(f),_=h!==void 0;return v?(h||t.getState().nodes).filter(x=>{const b=t.getState().nodeLookup.get(x.id);if(b&&!g&&(x.id===f.id||!b.internals.positionAbsolute))return!1;const p=qe(_?x:b),m=lt(p,v);return d&&m>0||m>=p.width*p.height||m>=v.width*v.height}):[]},isNodeIntersecting:(f,d,h=!0)=>{const v=yo(f)?f:l(f);if(!v)return!1;const _=lt(v,d);return h&&_>0||_>=d.width*d.height||_>=v.width*v.height},updateNode:c,updateNodeData:(f,d,h={replace:!1})=>{c(f,g=>{const v=typeof d=="function"?d(g):d;return h.replace?{...g,data:v}:{...g,data:{...g.data,...v}}},h)},updateEdge:u,updateEdgeData:(f,d,h={replace:!1})=>{u(f,g=>{const v=typeof d=="function"?d(g):d;return h.replace?{...g,data:v}:{...g,data:{...g.data,...v}}},h)},getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:h}=t.getState();return Au(f,{nodeLookup:d,nodeOrigin:h})},getHandleConnections:({type:f,id:d,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${f}${d?`-${d}`:""}`)?.values()??[]),getNodeConnections:({type:f,handleId:d,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${f?d?`-${f}-${d}`:`-${f}`:""}`)?.values()??[]),fitView:async f=>{const d=t.getState().fitViewResolver??Ru();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:d}),n.nodeQueue.push(h=>[...h]),d.promise}}},[]);return H.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const Fo=e=>e.selected,lf=typeof window<"u"?window:void 0;function uf({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=re(),{deleteElements:o}=Vn(),r=dt(e,{actInsideInputWithModifier:!1}),i=dt(t,{target:lf});H.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(Fo),edges:s.filter(Fo)}),n.setState({nodesSelectionActive:!1})}},[r]),H.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function df(e){const t=re();H.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const o=$n(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",be.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const Ut={position:"absolute",width:"100%",height:"100%",top:0,left:0},ff=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function hf({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=He.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:c,minZoom:u,maxZoom:f,zoomActivationKeyCode:d,preventScrolling:h=!0,children:g,noWheelClassName:v,noPanClassName:_,onViewportChange:x,isControlledViewport:b,paneClickDistance:p,selectionOnDrag:m}){const C=re(),S=H.useRef(null),{userSelectionActive:N,lib:T,connectionInProgress:P}=ee(ff,oe),j=dt(d),I=H.useRef();df(S);const z=H.useCallback(L=>{x?.({x:L[0],y:L[1],zoom:L[2]}),b||C.setState({transform:L})},[x,b]);return H.useEffect(()=>{if(S.current){I.current=_d({domNode:S.current,minZoom:u,maxZoom:f,translateExtent:c,viewport:l,onDraggingChange:E=>C.setState({paneDragging:E}),onPanZoomStart:(E,A)=>{const{onViewportChangeStart:k,onMoveStart:D}=C.getState();D?.(E,A),k?.(A)},onPanZoom:(E,A)=>{const{onViewportChange:k,onMove:D}=C.getState();D?.(E,A),k?.(A)},onPanZoomEnd:(E,A)=>{const{onViewportChangeEnd:k,onMoveEnd:D}=C.getState();D?.(E,A),k?.(A)}});const{x:L,y:w,zoom:M}=I.current.getViewport();return C.setState({panZoom:I.current,transform:[L,w,M],domNode:S.current.closest(".react-flow")}),()=>{I.current?.destroy()}}},[]),H.useEffect(()=>{I.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:j,preventScrolling:h,noPanClassName:_,userSelectionActive:N,noWheelClassName:v,lib:T,onTransformChange:z,connectionInProgress:P,selectionOnDrag:m,paneClickDistance:p})},[e,t,n,o,r,i,s,a,j,h,_,N,v,T,z,P,m,p]),y.jsx("div",{className:"react-flow__renderer",ref:S,style:Ut,children:g})}const gf=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function pf(){const{userSelectionActive:e,userSelectionRect:t}=ee(gf,oe);return e&&t?y.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 ln=(e,t)=>n=>{n.target===t.current&&e?.(n)},mf=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function yf({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ct.Full,panOnDrag:o,paneClickDistance:r,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:u,onPaneMouseEnter:f,onPaneMouseMove:d,onPaneMouseLeave:h,children:g}){const v=re(),{userSelectionActive:_,elementsSelectable:x,dragging:b,connectionInProgress:p}=ee(mf,oe),m=x&&(e||_),C=H.useRef(null),S=H.useRef(),N=H.useRef(new Set),T=H.useRef(new Set),P=H.useRef(!1),j=k=>{if(P.current||p){P.current=!1;return}l?.(k),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},I=k=>{if(Array.isArray(o)&&o?.includes(2)){k.preventDefault();return}c?.(k)},z=u?k=>u(k):void 0,L=k=>{P.current&&(k.stopPropagation(),P.current=!1)},w=k=>{const{domNode:D}=v.getState();if(S.current=D?.getBoundingClientRect(),!S.current)return;const $=k.target===C.current;if(!$&&!!k.target.closest(".nokey")||!e||!(i&&$||t)||k.button!==0||!k.isPrimary)return;k.target?.setPointerCapture?.(k.pointerId),P.current=!1;const{x:F,y:B}=xe(k.nativeEvent,S.current);v.setState({userSelectionRect:{width:0,height:0,startX:F,startY:B,x:F,y:B}}),$||(k.stopPropagation(),k.preventDefault())},M=k=>{const{userSelectionRect:D,transform:$,nodeLookup:V,edgeLookup:R,connectionLookup:F,triggerNodeChanges:B,triggerEdgeChanges:G,defaultEdgeOptions:K,resetSelectedElements:Z}=v.getState();if(!S.current||!D)return;const{x:O,y:X}=xe(k.nativeEvent,S.current),{startX:Q,startY:U}=D;if(!P.current){const te=t?0:r;if(Math.hypot(O-Q,X-U)<=te)return;Z(),s?.(k)}P.current=!0;const W={startX:Q,startY:U,x:O<Q?O:Q,y:X<U?X:U,width:Math.abs(O-Q),height:Math.abs(X-U)},q=N.current,J=T.current;N.current=new Set(Tn(V,W,$,n===ct.Partial,!0).map(te=>te.id)),T.current=new Set;const ne=K?.selectable??!0;for(const te of N.current){const se=F.get(te);if(se)for(const{edgeId:le}of se.values()){const ce=R.get(le);ce&&(ce.selectable??ne)&&T.current.add(le)}}if(!xo(q,N.current)){const te=Fe(V,N.current,!0);B(te)}if(!xo(J,T.current)){const te=Fe(R,T.current);G(te)}v.setState({userSelectionRect:W,userSelectionActive:!0,nodesSelectionActive:!1})},E=k=>{k.button===0&&(k.target?.releasePointerCapture?.(k.pointerId),!_&&k.target===C.current&&v.getState().userSelectionRect&&j?.(k),v.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(a?.(k),v.setState({nodesSelectionActive:N.current.size>0})))},A=o===!0||Array.isArray(o)&&o.includes(0);return y.jsxs("div",{className:ae(["react-flow__pane",{draggable:A,dragging:b,selection:e}]),onClick:m?void 0:ln(j,C),onContextMenu:ln(I,C),onWheel:ln(z,C),onPointerEnter:m?void 0:f,onPointerMove:m?M:d,onPointerUp:m?E:void 0,onPointerDownCapture:m?w:void 0,onClickCapture:m?L:void 0,onPointerLeave:h,ref:C,style:Ut,children:[g,y.jsx(pf,{})]})}function Sn({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),c=a.get(e);if(!c){l?.("012",be.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function ps({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=re(),[l,c]=H.useState(!1),u=H.useRef();return H.useEffect(()=>{u.current=ad({getStoreItems:()=>a.getState(),onNodeMouseDown:f=>{Sn({id:f,store:a,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),H.useEffect(()=>{if(t)u.current?.destroy();else if(e.current)return u.current?.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:s}),()=>{u.current?.destroy()}},[n,o,t,i,e,r]),l}const xf=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ms(){const e=re();return H.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:c,nodeOrigin:u}=e.getState(),f=new Map,d=xf(s),h=r?i[0]:5,g=r?i[1]:5,v=n.direction.x*h*n.factor,_=n.direction.y*g*n.factor;for(const[,x]of c){if(!d(x))continue;let b={x:x.internals.positionAbsolute.x+v,y:x.internals.positionAbsolute.y+_};r&&(b=pt(b,i));const{position:p,positionAbsolute:m}=Lr({nodeId:x.id,nextPosition:b,nodeLookup:c,nodeExtent:o,nodeOrigin:u,onError:a});x.position=p,x.internals.positionAbsolute=m,f.set(x.id,x)}l(f)},[])}const On=H.createContext(null),wf=On.Provider;On.Consumer;const ys=()=>H.useContext(On),vf=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),_f=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:l,isValid:c}=s,u=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:u,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===We.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:u&&c}};function bf({type:e="source",position:t=Y.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:u,onTouchStart:f,...d},h){const g=s||null,v=e==="target",_=re(),x=ys(),{connectOnClick:b,noPanClassName:p,rfId:m}=ee(vf,oe),{connectingFrom:C,connectingTo:S,clickConnecting:N,isPossibleEndHandle:T,connectionInProcess:P,clickConnectionInProcess:j,valid:I}=ee(_f(x,g,e),oe);x||_.getState().onError?.("010",be.error010());const z=M=>{const{defaultEdgeOptions:E,onConnect:A,hasDefaultEdges:k}=_.getState(),D={...E,...M};if(k){const{edges:$,setEdges:V}=_.getState();V(Yu(D,$))}A?.(D),a?.(D)},L=M=>{if(!x)return;const E=Yr(M.nativeEvent);if(r&&(E&&M.button===0||!E)){const A=_.getState();bn.onPointerDown(M.nativeEvent,{handleDomNode:M.currentTarget,autoPanOnConnect:A.autoPanOnConnect,connectionMode:A.connectionMode,connectionRadius:A.connectionRadius,domNode:A.domNode,nodeLookup:A.nodeLookup,lib:A.lib,isTarget:v,handleId:g,nodeId:x,flowId:A.rfId,panBy:A.panBy,cancelConnection:A.cancelConnection,onConnectStart:A.onConnectStart,onConnectEnd:A.onConnectEnd,updateConnection:A.updateConnection,onConnect:z,isValidConnection:n||A.isValidConnection,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:A.autoPanSpeed,dragThreshold:A.connectionDragThreshold})}E?u?.(M):f?.(M)},w=M=>{const{onClickConnectStart:E,onClickConnectEnd:A,connectionClickStartHandle:k,connectionMode:D,isValidConnection:$,lib:V,rfId:R,nodeLookup:F,connection:B}=_.getState();if(!x||!k&&!r)return;if(!k){E?.(M.nativeEvent,{nodeId:x,handleId:g,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:x,type:e,id:g}});return}const G=Fr(M.target),K=n||$,{connection:Z,isValid:O}=bn.isValid(M.nativeEvent,{handle:{nodeId:x,id:g,type:e},connectionMode:D,fromNodeId:k.nodeId,fromHandleId:k.id||null,fromType:k.type,isValidConnection:K,flowId:R,doc:G,lib:V,nodeLookup:F});O&&Z&&z(Z);const X=structuredClone(B);delete X.inProgress,X.toPosition=X.toHandle?X.toHandle.position:null,A?.(M,X),_.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":g,"data-nodeid":x,"data-handlepos":t,"data-id":`${m}-${x}-${g}-${e}`,className:ae(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,c,{source:!v,target:v,connectable:o,connectablestart:r,connectableend:i,clickconnecting:N,connectingfrom:C,connectingto:S,valid:I,connectionindicator:o&&(!P||T)&&(P||j?i:r)}]),onMouseDown:L,onTouchStart:L,onClick:b?w:void 0,ref:h,...d,children:l})}const De=H.memo(hs(bf));function Sf({data:e,isConnectable:t,sourcePosition:n=Y.Bottom}){return y.jsxs(y.Fragment,{children:[e?.label,y.jsx(De,{type:"source",position:n,isConnectable:t})]})}function Ef({data:e,isConnectable:t,targetPosition:n=Y.Top,sourcePosition:o=Y.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(De,{type:"target",position:n,isConnectable:t}),e?.label,y.jsx(De,{type:"source",position:o,isConnectable:t})]})}function Cf(){return null}function Nf({data:e,isConnectable:t,targetPosition:n=Y.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(De,{type:"target",position:n,isConnectable:t}),e?.label]})}const Lt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Xo={input:Sf,default:Ef,output:Nf,group:Cf};function Mf(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const If=e=>{const{width:t,height:n,x:o,y:r}=gt(e.nodeLookup,{filter:i=>!!i.selected});return{width:ye(t)?t:null,height:ye(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function kf({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=re(),{width:r,height:i,transformString:s,userSelectionActive:a}=ee(If,oe),l=ms(),c=H.useRef(null);if(H.useEffect(()=>{n||c.current?.focus({preventScroll:!0})},[n]),ps({nodeRef:c}),a||!r||!i)return null;const u=e?d=>{const h=o.getState().nodes.filter(g=>g.selected);e(d,h)}:void 0,f=d=>{Object.prototype.hasOwnProperty.call(Lt,d.key)&&(d.preventDefault(),l({direction:Lt[d.key],factor:d.shiftKey?4:1}))};return y.jsx("div",{className:ae(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:y.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:r,height:i}})})}const Yo=typeof window<"u"?window:void 0,Af=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function xs({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:u,selectionMode:f,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:v,zoomActivationKeyCode:_,elementsSelectable:x,zoomOnScroll:b,zoomOnPinch:p,panOnScroll:m,panOnScrollSpeed:C,panOnScrollMode:S,zoomOnDoubleClick:N,panOnDrag:T,defaultViewport:P,translateExtent:j,minZoom:I,maxZoom:z,preventScrolling:L,onSelectionContextMenu:w,noWheelClassName:M,noPanClassName:E,disableKeyboardA11y:A,onViewportChange:k,isControlledViewport:D}){const{nodesSelectionActive:$,userSelectionActive:V}=ee(Af,oe),R=dt(c,{target:Yo}),F=dt(v,{target:Yo}),B=F||T,G=F||m,K=u&&B!==!0,Z=R||V||K;return uf({deleteKeyCode:l,multiSelectionKeyCode:g}),y.jsx(hf,{onPaneContextMenu:i,elementsSelectable:x,zoomOnScroll:b,zoomOnPinch:p,panOnScroll:G,panOnScrollSpeed:C,panOnScrollMode:S,zoomOnDoubleClick:N,panOnDrag:!R&&B,defaultViewport:P,translateExtent:j,minZoom:I,maxZoom:z,zoomActivationKeyCode:_,preventScrolling:L,noWheelClassName:M,noPanClassName:E,onViewportChange:k,isControlledViewport:D,paneClickDistance:a,selectionOnDrag:K,children:y.jsxs(yf,{onSelectionStart:d,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:B,isSelecting:!!Z,selectionMode:f,selectionKeyPressed:R,paneClickDistance:a,selectionOnDrag:K,children:[e,$&&y.jsx(kf,{onSelectionContextMenu:w,noPanClassName:E,disableKeyboardA11y:A})]})})}xs.displayName="FlowRenderer";const Pf=H.memo(xs),Tf=e=>t=>e?Tn(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 Df(e){return ee(H.useCallback(Tf(e),[e]),oe)}const $f=e=>e.updateNodeInternals;function zf(){const e=ee($f),[t]=H.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),e(o)}));return H.useEffect(()=>()=>{t?.disconnect()},[t]),t}function Hf({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=re(),i=H.useRef(null),s=H.useRef(null),a=H.useRef(e.sourcePosition),l=H.useRef(e.targetPosition),c=H.useRef(t),u=n&&!!e.internals.handleBounds;return H.useEffect(()=>{i.current&&!e.hidden&&(!u||s.current!==i.current)&&(s.current&&o?.unobserve(s.current),o?.observe(i.current),s.current=i.current)},[u,e.hidden]),H.useEffect(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),H.useEffect(()=>{if(i.current){const f=c.current!==t,d=a.current!==e.sourcePosition,h=l.current!==e.targetPosition;(f||d||h)&&(c.current=t,a.current=e.sourcePosition,l.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 Lf({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:c,nodesFocusable:u,resizeObserver:f,noDragClassName:d,noPanClassName:h,disableKeyboardA11y:g,rfId:v,nodeTypes:_,nodeClickDistance:x,onError:b}){const{node:p,internals:m,isParent:C}=ee(O=>{const X=O.nodeLookup.get(e),Q=O.parentLookup.has(e);return{node:X,internals:X.internals,isParent:Q}},oe);let S=p.type||"default",N=_?.[S]||Xo[S];N===void 0&&(b?.("003",be.error003(S)),S="default",N=_?.default||Xo.default);const T=!!(p.draggable||a&&typeof p.draggable>"u"),P=!!(p.selectable||l&&typeof p.selectable>"u"),j=!!(p.connectable||c&&typeof p.connectable>"u"),I=!!(p.focusable||u&&typeof p.focusable>"u"),z=re(),L=Or(p),w=Hf({node:p,nodeType:S,hasDimensions:L,resizeObserver:f}),M=ps({nodeRef:w,disabled:p.hidden||!T,noDragClassName:d,handleSelector:p.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:x}),E=ms();if(p.hidden)return null;const A=Ie(p),k=Mf(p),D=P||T||t||n||o||r,$=n?O=>n(O,{...m.userNode}):void 0,V=o?O=>o(O,{...m.userNode}):void 0,R=r?O=>r(O,{...m.userNode}):void 0,F=i?O=>i(O,{...m.userNode}):void 0,B=s?O=>s(O,{...m.userNode}):void 0,G=O=>{const{selectNodesOnDrag:X,nodeDragThreshold:Q}=z.getState();P&&(!X||!T||Q>0)&&Sn({id:e,store:z,nodeRef:w}),t&&t(O,{...m.userNode})},K=O=>{if(!(Xr(O.nativeEvent)||g)){if(Tr.includes(O.key)&&P){const X=O.key==="Escape";Sn({id:e,store:z,unselect:X,nodeRef:w})}else if(T&&p.selected&&Object.prototype.hasOwnProperty.call(Lt,O.key)){O.preventDefault();const{ariaLabelConfig:X}=z.getState();z.setState({ariaLiveMessage:X["node.a11yDescription.ariaLiveMessage"]({direction:O.key.replace("Arrow","").toLowerCase(),x:~~m.positionAbsolute.x,y:~~m.positionAbsolute.y})}),E({direction:Lt[O.key],factor:O.shiftKey?4:1})}}},Z=()=>{if(g||!w.current?.matches(":focus-visible"))return;const{transform:O,width:X,height:Q,autoPanOnNodeFocus:U,setCenter:W}=z.getState();if(!U)return;Tn(new Map([[e,p]]),{x:0,y:0,width:X,height:Q},O,!0).length>0||W(p.position.x+A.width/2,p.position.y+A.height/2,{zoom:O[2]})};return y.jsx("div",{className:ae(["react-flow__node",`react-flow__node-${S}`,{[h]:T},p.className,{selected:p.selected,selectable:P,parent:C,draggable:T,dragging:M}]),ref:w,style:{zIndex:m.z,transform:`translate(${m.positionAbsolute.x}px,${m.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:L?"visible":"hidden",...p.style,...k},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:$,onMouseMove:V,onMouseLeave:R,onContextMenu:F,onClick:G,onDoubleClick:B,onKeyDown:I?K:void 0,tabIndex:I?0:void 0,onFocus:I?Z:void 0,role:p.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${ls}-${v}`,"aria-label":p.ariaLabel,...p.domAttributes,children:y.jsx(wf,{value:e,children:y.jsx(N,{id:e,data:p.data,type:S,positionAbsoluteX:m.positionAbsolute.x,positionAbsoluteY:m.positionAbsolute.y,selected:p.selected??!1,selectable:P,draggable:T,deletable:p.deletable??!0,isConnectable:j,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:M,dragHandle:p.dragHandle,zIndex:m.z,parentId:p.parentId,...A})})})}var Rf=H.memo(Lf);const jf=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ws(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,onError:i}=ee(jf,oe),s=Df(e.onlyRenderVisibleElements),a=zf();return y.jsx("div",{className:"react-flow__nodes",style:Ut,children:s.map(l=>y.jsx(Rf,{id:l,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:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},l))})}ws.displayName="NodeRenderer";const Vf=H.memo(ws);function Of(e){return ee(H.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&Bu({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),oe)}const Bf=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return y.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Ff=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return y.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Zo={[$t.Arrow]:Bf,[$t.ArrowClosed]:Ff};function Xf(e){const t=re();return H.useMemo(()=>Object.prototype.hasOwnProperty.call(Zo,e)?Zo[e]:(t.getState().onError?.("009",be.error009(e)),null),[e])}const Yf=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=Xf(t);return l?y.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:y.jsx(l,{color:n,strokeWidth:s})}):null},vs=({defaultColor:e,rfId:t})=>{const n=ee(i=>i.edges),o=ee(i=>i.defaultEdgeOptions),r=H.useMemo(()=>Uu(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:r.map(i=>y.jsx(Yf,{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};vs.displayName="MarkerDefinitions";var Zf=H.memo(vs);function _s({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...u}){const[f,d]=H.useState({x:1,y:0,width:0,height:0}),h=ae(["react-flow__edge-textwrapper",c]),g=H.useRef(null);return H.useEffect(()=>{if(g.current){const v=g.current.getBBox();d({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?y.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:h,visibility:f.width?"visible":"hidden",...u,children:[r&&y.jsx("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),y.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:g,style:o,children:n}),l]}):null}_s.displayName="EdgeText";const Wf=H.memo(_s);function Kt({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:c=20,...u}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...u,d:e,fill:"none",className:ae(["react-flow__edge-path",u.className])}),c?y.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,o&&ye(t)&&ye(n)?y.jsx(Wf,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function Wo({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===Y.Left||e===Y.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function bs({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:o,targetY:r,targetPosition:i=Y.Top}){const[s,a]=Wo({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=Wo({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,f,d,h]=Zr({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${a} ${l},${c} ${o},${r}`,u,f,d,h]}function Ss(e){return H.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:_,interactionWidth:x})=>{const[b,p,m]=bs({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),C=e.isInternal?void 0:t;return y.jsx(Kt,{id:C,path:b,labelX:p,labelY:m,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:_,interactionWidth:x})})}const Gf=Ss({isInternal:!1}),Es=Ss({isInternal:!0});Gf.displayName="SimpleBezierEdge";Es.displayName="SimpleBezierEdgeInternal";function Cs(e){return H.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,sourcePosition:h=Y.Bottom,targetPosition:g=Y.Top,markerEnd:v,markerStart:_,pathOptions:x,interactionWidth:b})=>{const[p,m,C]=wn({sourceX:n,sourceY:o,sourcePosition:h,targetX:r,targetY:i,targetPosition:g,borderRadius:x?.borderRadius,offset:x?.offset,stepPosition:x?.stepPosition}),S=e.isInternal?void 0:t;return y.jsx(Kt,{id:S,path:p,labelX:m,labelY:C,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:v,markerStart:_,interactionWidth:b})})}const Ns=Cs({isInternal:!1}),Ms=Cs({isInternal:!0});Ns.displayName="SmoothStepEdge";Ms.displayName="SmoothStepEdgeInternal";function Is(e){return H.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return y.jsx(Ns,{...n,id:o,pathOptions:H.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const qf=Is({isInternal:!1}),ks=Is({isInternal:!0});qf.displayName="StepEdge";ks.displayName="StepEdgeInternal";function As(e){return H.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:g,interactionWidth:v})=>{const[_,x,b]=qr({sourceX:n,sourceY:o,targetX:r,targetY:i}),p=e.isInternal?void 0:t;return y.jsx(Kt,{id:p,path:_,labelX:x,labelY:b,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:g,interactionWidth:v})})}const Uf=As({isInternal:!1}),Ps=As({isInternal:!0});Uf.displayName="StraightEdge";Ps.displayName="StraightEdgeInternal";function Ts(e){return H.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=Y.Bottom,targetPosition:a=Y.Top,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:_,pathOptions:x,interactionWidth:b})=>{const[p,m,C]=Wr({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:x?.curvature}),S=e.isInternal?void 0:t;return y.jsx(Kt,{id:S,path:p,labelX:m,labelY:C,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:v,markerStart:_,interactionWidth:b})})}const Kf=Ts({isInternal:!1}),Ds=Ts({isInternal:!0});Kf.displayName="BezierEdge";Ds.displayName="BezierEdgeInternal";const Go={default:Ds,straight:Ps,step:ks,smoothstep:Ms,simplebezier:Es},qo={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Qf=(e,t,n)=>n===Y.Left?e-t:n===Y.Right?e+t:e,Jf=(e,t,n)=>n===Y.Top?e-t:n===Y.Bottom?e+t:e,Uo="react-flow__edgeupdater";function Ko({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return y.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:ae([Uo,`${Uo}-${a}`]),cx:Qf(t,o,e),cy:Jf(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function eh({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:c,onReconnectStart:u,onReconnectEnd:f,setReconnecting:d,setUpdateHover:h}){const g=re(),v=(m,C)=>{if(m.button!==0)return;const{autoPanOnConnect:S,domNode:N,isValidConnection:T,connectionMode:P,connectionRadius:j,lib:I,onConnectStart:z,onConnectEnd:L,cancelConnection:w,nodeLookup:M,rfId:E,panBy:A,updateConnection:k}=g.getState(),D=C.type==="target",$=(F,B)=>{d(!1),f?.(F,n,C.type,B)},V=F=>c?.(n,F),R=(F,B)=>{d(!0),u?.(m,n,C.type),z?.(F,B)};bn.onPointerDown(m.nativeEvent,{autoPanOnConnect:S,connectionMode:P,connectionRadius:j,domNode:N,handleId:C.id,nodeId:C.nodeId,nodeLookup:M,isTarget:D,edgeUpdaterType:C.type,lib:I,flowId:E,cancelConnection:w,panBy:A,isValidConnection:T,onConnect:V,onConnectStart:R,onConnectEnd:L,onReconnectEnd:$,updateConnection:k,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:m.currentTarget})},_=m=>v(m,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),x=m=>v(m,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>h(!0),p=()=>h(!1);return y.jsxs(y.Fragment,{children:[(e===!0||e==="source")&&y.jsx(Ko,{position:a,centerX:o,centerY:r,radius:t,onMouseDown:_,onMouseEnter:b,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&y.jsx(Ko,{position:l,centerX:i,centerY:s,radius:t,onMouseDown:x,onMouseEnter:b,onMouseOut:p,type:"target"})]})}function th({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,rfId:g,edgeTypes:v,noPanClassName:_,onError:x,disableKeyboardA11y:b}){let p=ee(W=>W.edgeLookup.get(e));const m=ee(W=>W.defaultEdgeOptions);p=m?{...m,...p}:p;let C=p.type||"default",S=v?.[C]||Go[C];S===void 0&&(x?.("011",be.error011(C)),C="default",S=v?.default||Go.default);const N=!!(p.focusable||t&&typeof p.focusable>"u"),T=typeof f<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),P=!!(p.selectable||o&&typeof p.selectable>"u"),j=H.useRef(null),[I,z]=H.useState(!1),[L,w]=H.useState(!1),M=re(),{zIndex:E,sourceX:A,sourceY:k,targetX:D,targetY:$,sourcePosition:V,targetPosition:R}=ee(H.useCallback(W=>{const q=W.nodeLookup.get(p.source),J=W.nodeLookup.get(p.target);if(!q||!J)return{zIndex:p.zIndex,...qo};const ne=qu({id:e,sourceNode:q,targetNode:J,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:W.connectionMode,onError:x});return{zIndex:Ou({selected:p.selected,zIndex:p.zIndex,sourceNode:q,targetNode:J,elevateOnSelect:W.elevateEdgesOnSelect,zIndexMode:W.zIndexMode}),...ne||qo}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),oe),F=H.useMemo(()=>p.markerStart?`url('#${vn(p.markerStart,g)}')`:void 0,[p.markerStart,g]),B=H.useMemo(()=>p.markerEnd?`url('#${vn(p.markerEnd,g)}')`:void 0,[p.markerEnd,g]);if(p.hidden||A===null||k===null||D===null||$===null)return null;const G=W=>{const{addSelectedEdges:q,unselectNodesAndEdges:J,multiSelectionActive:ne}=M.getState();P&&(M.setState({nodesSelectionActive:!1}),p.selected&&ne?(J({nodes:[],edges:[p]}),j.current?.blur()):q([e])),r&&r(W,p)},K=i?W=>{i(W,{...p})}:void 0,Z=s?W=>{s(W,{...p})}:void 0,O=a?W=>{a(W,{...p})}:void 0,X=l?W=>{l(W,{...p})}:void 0,Q=c?W=>{c(W,{...p})}:void 0,U=W=>{if(!b&&Tr.includes(W.key)&&P){const{unselectNodesAndEdges:q,addSelectedEdges:J}=M.getState();W.key==="Escape"?(j.current?.blur(),q({edges:[p]})):J([e])}};return y.jsx("svg",{style:{zIndex:E},children:y.jsxs("g",{className:ae(["react-flow__edge",`react-flow__edge-${C}`,p.className,_,{selected:p.selected,animated:p.animated,inactive:!P&&!r,updating:I,selectable:P}]),onClick:G,onDoubleClick:K,onContextMenu:Z,onMouseEnter:O,onMouseMove:X,onMouseLeave:Q,onKeyDown:N?U:void 0,tabIndex:N?0:void 0,role:p.ariaRole??(N?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":N?`${us}-${g}`:void 0,ref:j,...p.domAttributes,children:[!L&&y.jsx(S,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:P,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:A,sourceY:k,targetX:D,targetY:$,sourcePosition:V,targetPosition:R,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:F,markerEnd:B,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),T&&y.jsx(eh,{edge:p,isReconnectable:T,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,sourceX:A,sourceY:k,targetX:D,targetY:$,sourcePosition:V,targetPosition:R,setUpdateHover:z,setReconnecting:w})]})})}var nh=H.memo(th);const oh=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function $s({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:v}){const{edgesFocusable:_,edgesReconnectable:x,elementsSelectable:b,onError:p}=ee(oh,oe),m=Of(t);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(Zf,{defaultColor:e,rfId:n}),m.map(C=>y.jsx(nh,{id:C,edgesFocusable:_,edgesReconnectable:x,elementsSelectable:b,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:u,reconnectRadius:f,onDoubleClick:d,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:p,edgeTypes:o,disableKeyboardA11y:v},C))]})}$s.displayName="EdgeRenderer";const rh=H.memo($s),sh=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function ih({children:e}){const t=ee(sh);return y.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function ah(e){const t=Vn(),n=H.useRef(!1);H.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const ch=e=>e.panZoom?.syncViewport;function lh(e){const t=ee(ch),n=re();return H.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function uh(e){return e.connection.inProgress?{...e.connection,to:mt(e.connection.to,e.transform)}:{...e.connection}}function dh(e){return uh}function fh(e){const t=dh();return ee(t,oe)}const hh=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function gh({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:l}=ee(hh,oe);return!(i&&r&&l)?null:y.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:ae(["react-flow__connection",zr(a)]),children:y.jsx(zs,{style:t,type:n,CustomComponent:o,isValid:a})})})}const zs=({style:e,type:t=Pe.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:l,to:c,toNode:u,toHandle:f,toPosition:d,pointer:h}=fh();if(!r)return;if(n)return y.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:d,connectionStatus:zr(o),toNode:u,toHandle:f,pointer:h});let g="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:d};switch(t){case Pe.Bezier:[g]=Wr(v);break;case Pe.SimpleBezier:[g]=bs(v);break;case Pe.Step:[g]=wn({...v,borderRadius:0});break;case Pe.SmoothStep:[g]=wn(v);break;default:[g]=qr(v)}return y.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};zs.displayName="ConnectionLine";const ph={};function Qo(e=ph){H.useRef(e),re(),H.useEffect(()=>{},[e])}function mh(){re(),H.useRef(!1),H.useEffect(()=>{},[])}function Hs({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:v,connectionLineComponent:_,connectionLineContainerStyle:x,selectionKeyCode:b,selectionOnDrag:p,selectionMode:m,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:N,deleteKeyCode:T,onlyRenderVisibleElements:P,elementsSelectable:j,defaultViewport:I,translateExtent:z,minZoom:L,maxZoom:w,preventScrolling:M,defaultMarkerColor:E,zoomOnScroll:A,zoomOnPinch:k,panOnScroll:D,panOnScrollSpeed:$,panOnScrollMode:V,zoomOnDoubleClick:R,panOnDrag:F,onPaneClick:B,onPaneMouseEnter:G,onPaneMouseMove:K,onPaneMouseLeave:Z,onPaneScroll:O,onPaneContextMenu:X,paneClickDistance:Q,nodeClickDistance:U,onEdgeContextMenu:W,onEdgeMouseEnter:q,onEdgeMouseMove:J,onEdgeMouseLeave:ne,reconnectRadius:te,onReconnect:se,onReconnectStart:le,onReconnectEnd:ce,noDragClassName:de,noWheelClassName:ve,noPanClassName:ie,disableKeyboardA11y:fe,nodeExtent:_e,rfId:Ee,viewport:Ve,onViewportChange:Qe}){return Qo(e),Qo(t),mh(),ah(n),lh(Ve),y.jsx(Pf,{onPaneClick:B,onPaneMouseEnter:G,onPaneMouseMove:K,onPaneMouseLeave:Z,onPaneContextMenu:X,onPaneScroll:O,paneClickDistance:Q,deleteKeyCode:T,selectionKeyCode:b,selectionOnDrag:p,selectionMode:m,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:N,elementsSelectable:j,zoomOnScroll:A,zoomOnPinch:k,zoomOnDoubleClick:R,panOnScroll:D,panOnScrollSpeed:$,panOnScrollMode:V,panOnDrag:F,defaultViewport:I,translateExtent:z,minZoom:L,maxZoom:w,onSelectionContextMenu:f,preventScrolling:M,noDragClassName:de,noWheelClassName:ve,noPanClassName:ie,disableKeyboardA11y:fe,onViewportChange:Qe,isControlledViewport:!!Ve,children:y.jsxs(ih,{children:[y.jsx(rh,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:se,onReconnectStart:le,onReconnectEnd:ce,onlyRenderVisibleElements:P,onEdgeContextMenu:W,onEdgeMouseEnter:q,onEdgeMouseMove:J,onEdgeMouseLeave:ne,reconnectRadius:te,defaultMarkerColor:E,noPanClassName:ie,disableKeyboardA11y:fe,rfId:Ee}),y.jsx(gh,{style:v,type:g,component:_,containerStyle:x}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(Vf,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:U,onlyRenderVisibleElements:P,noPanClassName:ie,noDragClassName:de,disableKeyboardA11y:fe,nodeExtent:_e,rfId:Ee}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}Hs.displayName="GraphView";const yh=H.memo(Hs),Jo=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:f,zIndexMode:d="basic"}={})=>{const h=new Map,g=new Map,v=new Map,_=new Map,x=o??t??[],b=n??e??[],p=u??[0,0],m=f??at;Qr(v,_,x);const C=_n(b,h,g,{nodeOrigin:p,nodeExtent:m,zIndexMode:d});let S=[0,0,1];if(s&&r&&i){const N=gt(h,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:T,y:P,zoom:j}=Dn(N,r,i,l,c,a?.padding??.1);S=[T,P,j]}return{rfId:"1",width:r??0,height:i??0,transform:S,nodes:b,nodesInitialized:C,nodeLookup:h,parentLookup:g,edges:x,edgeLookup:_,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:at,nodeExtent:m,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:We.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:p,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...$r},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:zu,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Dr,zIndexMode:d,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},xh=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:f,zIndexMode:d})=>Dd((h,g)=>{async function v(){const{nodeLookup:_,panZoom:x,fitViewOptions:b,fitViewResolver:p,width:m,height:C,minZoom:S,maxZoom:N}=g();x&&(await Du({nodes:_,width:m,height:C,panZoom:x,minZoom:S,maxZoom:N},b),p?.resolve(!0),h({fitViewResolver:null}))}return{...Jo({nodes:e,edges:t,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:f,defaultNodes:n,defaultEdges:o,zIndexMode:d}),setNodes:_=>{const{nodeLookup:x,parentLookup:b,nodeOrigin:p,elevateNodesOnSelect:m,fitViewQueued:C,zIndexMode:S}=g(),N=_n(_,x,b,{nodeOrigin:p,nodeExtent:f,elevateNodesOnSelect:m,checkEquality:!0,zIndexMode:S});C&&N?(v(),h({nodes:_,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0})):h({nodes:_,nodesInitialized:N})},setEdges:_=>{const{connectionLookup:x,edgeLookup:b}=g();Qr(x,b,_),h({edges:_})},setDefaultNodesAndEdges:(_,x)=>{if(_){const{setNodes:b}=g();b(_),h({hasDefaultNodes:!0})}if(x){const{setEdges:b}=g();b(x),h({hasDefaultEdges:!0})}},updateNodeInternals:_=>{const{triggerNodeChanges:x,nodeLookup:b,parentLookup:p,domNode:m,nodeOrigin:C,nodeExtent:S,debug:N,fitViewQueued:T,zIndexMode:P}=g(),{changes:j,updatedInternals:I}=od(_,b,p,m,C,S,P);I&&(Ju(b,p,{nodeOrigin:C,nodeExtent:S,zIndexMode:P}),T?(v(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),j?.length>0&&(N&&console.log("React Flow: trigger node changes",j),x?.(j)))},updateNodePositions:(_,x=!1)=>{const b=[];let p=[];const{nodeLookup:m,triggerNodeChanges:C,connection:S,updateConnection:N,onNodesChangeMiddlewareMap:T}=g();for(const[P,j]of _){const I=m.get(P),z=!!(I?.expandParent&&I?.parentId&&j?.position),L={id:P,type:"position",position:z?{x:Math.max(0,j.position.x),y:Math.max(0,j.position.y)}:j.position,dragging:x};if(I&&S.inProgress&&S.fromNode.id===I.id){const w=je(I,S.fromHandle,Y.Left,!0);N({...S,from:w})}z&&I.parentId&&b.push({id:P,parentId:I.parentId,rect:{...j.internals.positionAbsolute,width:j.measured.width??0,height:j.measured.height??0}}),p.push(L)}if(b.length>0){const{parentLookup:P,nodeOrigin:j}=g(),I=jn(b,m,P,j);p.push(...I)}for(const P of T.values())p=P(p);C(p)},triggerNodeChanges:_=>{const{onNodesChange:x,setNodes:b,nodes:p,hasDefaultNodes:m,debug:C}=g();if(_?.length){if(m){const S=ef(_,p);b(S)}C&&console.log("React Flow: trigger node changes",_),x?.(_)}},triggerEdgeChanges:_=>{const{onEdgesChange:x,setEdges:b,edges:p,hasDefaultEdges:m,debug:C}=g();if(_?.length){if(m){const S=tf(_,p);b(S)}C&&console.log("React Flow: trigger edge changes",_),x?.(_)}},addSelectedNodes:_=>{const{multiSelectionActive:x,edgeLookup:b,nodeLookup:p,triggerNodeChanges:m,triggerEdgeChanges:C}=g();if(x){const S=_.map(N=>ze(N,!0));m(S);return}m(Fe(p,new Set([..._]),!0)),C(Fe(b))},addSelectedEdges:_=>{const{multiSelectionActive:x,edgeLookup:b,nodeLookup:p,triggerNodeChanges:m,triggerEdgeChanges:C}=g();if(x){const S=_.map(N=>ze(N,!0));C(S);return}C(Fe(b,new Set([..._]))),m(Fe(p,new Set,!0))},unselectNodesAndEdges:({nodes:_,edges:x}={})=>{const{edges:b,nodes:p,nodeLookup:m,triggerNodeChanges:C,triggerEdgeChanges:S}=g(),N=_||p,T=x||b,P=N.map(I=>{const z=m.get(I.id);return z&&(z.selected=!1),ze(I.id,!1)}),j=T.map(I=>ze(I.id,!1));C(P),S(j)},setMinZoom:_=>{const{panZoom:x,maxZoom:b}=g();x?.setScaleExtent([_,b]),h({minZoom:_})},setMaxZoom:_=>{const{panZoom:x,minZoom:b}=g();x?.setScaleExtent([b,_]),h({maxZoom:_})},setTranslateExtent:_=>{g().panZoom?.setTranslateExtent(_),h({translateExtent:_})},resetSelectedElements:()=>{const{edges:_,nodes:x,triggerNodeChanges:b,triggerEdgeChanges:p,elementsSelectable:m}=g();if(!m)return;const C=x.reduce((N,T)=>T.selected?[...N,ze(T.id,!1)]:N,[]),S=_.reduce((N,T)=>T.selected?[...N,ze(T.id,!1)]:N,[]);b(C),p(S)},setNodeExtent:_=>{const{nodes:x,nodeLookup:b,parentLookup:p,nodeOrigin:m,elevateNodesOnSelect:C,nodeExtent:S,zIndexMode:N}=g();_[0][0]===S[0][0]&&_[0][1]===S[0][1]&&_[1][0]===S[1][0]&&_[1][1]===S[1][1]||(_n(x,b,p,{nodeOrigin:m,nodeExtent:_,elevateNodesOnSelect:C,checkEquality:!1,zIndexMode:N}),h({nodeExtent:_}))},panBy:_=>{const{transform:x,width:b,height:p,panZoom:m,translateExtent:C}=g();return rd({delta:_,panZoom:m,transform:x,translateExtent:C,width:b,height:p})},setCenter:async(_,x,b)=>{const{width:p,height:m,maxZoom:C,panZoom:S}=g();if(!S)return Promise.resolve(!1);const N=typeof b?.zoom<"u"?b.zoom:C;return await S.setViewport({x:p/2-_*N,y:m/2-x*N,zoom:N},{duration:b?.duration,ease:b?.ease,interpolate:b?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...$r}})},updateConnection:_=>{h({connection:_})},reset:()=>h({...Jo()})}},Object.is);function wh({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:c,nodeOrigin:u,nodeExtent:f,zIndexMode:d,children:h}){const[g]=H.useState(()=>xh({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:c,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:u,nodeExtent:f,zIndexMode:d}));return y.jsx($d,{value:g,children:y.jsx(sf,{children:h})})}function vh({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:f,nodeExtent:d,zIndexMode:h}){return H.useContext(Gt)?y.jsx(y.Fragment,{children:e}):y.jsx(wh,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:f,nodeExtent:d,zIndexMode:h,children:e})}const _h={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function bh({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:f,onMoveEnd:d,onConnect:h,onConnectStart:g,onConnectEnd:v,onClickConnectStart:_,onClickConnectEnd:x,onNodeMouseEnter:b,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:C,onNodeDoubleClick:S,onNodeDragStart:N,onNodeDrag:T,onNodeDragStop:P,onNodesDelete:j,onEdgesDelete:I,onDelete:z,onSelectionChange:L,onSelectionDragStart:w,onSelectionDrag:M,onSelectionDragStop:E,onSelectionContextMenu:A,onSelectionStart:k,onSelectionEnd:D,onBeforeDelete:$,connectionMode:V,connectionLineType:R=Pe.Bezier,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:G,deleteKeyCode:K="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:O=!1,selectionMode:X=ct.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:U=ut()?"Meta":"Control",zoomActivationKeyCode:W=ut()?"Meta":"Control",snapToGrid:q,snapGrid:J,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:te,nodesDraggable:se,autoPanOnNodeFocus:le,nodesConnectable:ce,nodesFocusable:de,nodeOrigin:ve=ds,edgesFocusable:ie,edgesReconnectable:fe,elementsSelectable:_e=!0,defaultViewport:Ee=Wd,minZoom:Ve=.5,maxZoom:Qe=2,translateExtent:Fn=at,preventScrolling:Fs=!0,nodeExtent:Qt,defaultMarkerColor:Xs="#b1b1b7",zoomOnScroll:Ys=!0,zoomOnPinch:Zs=!0,panOnScroll:Ws=!1,panOnScrollSpeed:Gs=.5,panOnScrollMode:qs=He.Free,zoomOnDoubleClick:Us=!0,panOnDrag:Ks=!0,onPaneClick:Qs,onPaneMouseEnter:Js,onPaneMouseMove:ei,onPaneMouseLeave:ti,onPaneScroll:ni,onPaneContextMenu:oi,paneClickDistance:ri=1,nodeClickDistance:si=0,children:ii,onReconnect:ai,onReconnectStart:ci,onReconnectEnd:li,onEdgeContextMenu:ui,onEdgeDoubleClick:di,onEdgeMouseEnter:fi,onEdgeMouseMove:hi,onEdgeMouseLeave:gi,reconnectRadius:pi=10,onNodesChange:mi,onEdgesChange:yi,noDragClassName:xi="nodrag",noWheelClassName:wi="nowheel",noPanClassName:Xn="nopan",fitView:Yn,fitViewOptions:Zn,connectOnClick:vi,attributionPosition:_i,proOptions:bi,defaultEdgeOptions:Si,elevateNodesOnSelect:Ei=!0,elevateEdgesOnSelect:Ci=!1,disableKeyboardA11y:Wn=!1,autoPanOnConnect:Ni,autoPanOnNodeDrag:Mi,autoPanSpeed:Ii,connectionRadius:ki,isValidConnection:Ai,onError:Pi,style:Ti,id:Gn,nodeDragThreshold:Di,connectionDragThreshold:$i,viewport:zi,onViewportChange:Hi,width:Li,height:Ri,colorMode:ji="light",debug:Vi,onScroll:qn,ariaLabelConfig:Oi,zIndexMode:Un="basic",...Bi},Fi){const Jt=Gn||"1",Xi=Kd(ji),Yi=H.useCallback(Kn=>{Kn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),qn?.(Kn)},[qn]);return y.jsx("div",{"data-testid":"rf__wrapper",...Bi,onScroll:Yi,style:{...Ti,..._h},ref:Fi,className:ae(["react-flow",r,Xi]),id:Gn,role:"application",children:y.jsxs(vh,{nodes:e,edges:t,width:Li,height:Ri,fitView:Yn,fitViewOptions:Zn,minZoom:Ve,maxZoom:Qe,nodeOrigin:ve,nodeExtent:Qt,zIndexMode:Un,children:[y.jsx(yh,{onInit:c,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:b,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:C,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:s,connectionLineType:R,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:G,selectionKeyCode:Z,selectionOnDrag:O,selectionMode:X,deleteKeyCode:K,multiSelectionKeyCode:U,panActivationKeyCode:Q,zoomActivationKeyCode:W,onlyRenderVisibleElements:ne,defaultViewport:Ee,translateExtent:Fn,minZoom:Ve,maxZoom:Qe,preventScrolling:Fs,zoomOnScroll:Ys,zoomOnPinch:Zs,zoomOnDoubleClick:Us,panOnScroll:Ws,panOnScrollSpeed:Gs,panOnScrollMode:qs,panOnDrag:Ks,onPaneClick:Qs,onPaneMouseEnter:Js,onPaneMouseMove:ei,onPaneMouseLeave:ti,onPaneScroll:ni,onPaneContextMenu:oi,paneClickDistance:ri,nodeClickDistance:si,onSelectionContextMenu:A,onSelectionStart:k,onSelectionEnd:D,onReconnect:ai,onReconnectStart:ci,onReconnectEnd:li,onEdgeContextMenu:ui,onEdgeDoubleClick:di,onEdgeMouseEnter:fi,onEdgeMouseMove:hi,onEdgeMouseLeave:gi,reconnectRadius:pi,defaultMarkerColor:Xs,noDragClassName:xi,noWheelClassName:wi,noPanClassName:Xn,rfId:Jt,disableKeyboardA11y:Wn,nodeExtent:Qt,viewport:zi,onViewportChange:Hi}),y.jsx(Ud,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:h,onConnectStart:g,onConnectEnd:v,onClickConnectStart:_,onClickConnectEnd:x,nodesDraggable:se,autoPanOnNodeFocus:le,nodesConnectable:ce,nodesFocusable:de,edgesFocusable:ie,edgesReconnectable:fe,elementsSelectable:_e,elevateNodesOnSelect:Ei,elevateEdgesOnSelect:Ci,minZoom:Ve,maxZoom:Qe,nodeExtent:Qt,onNodesChange:mi,onEdgesChange:yi,snapToGrid:q,snapGrid:J,connectionMode:V,translateExtent:Fn,connectOnClick:vi,defaultEdgeOptions:Si,fitView:Yn,fitViewOptions:Zn,onNodesDelete:j,onEdgesDelete:I,onDelete:z,onNodeDragStart:N,onNodeDrag:T,onNodeDragStop:P,onSelectionDrag:M,onSelectionDragStart:w,onSelectionDragStop:E,onMove:u,onMoveStart:f,onMoveEnd:d,noPanClassName:Xn,nodeOrigin:ve,rfId:Jt,autoPanOnConnect:Ni,autoPanOnNodeDrag:Mi,autoPanSpeed:Ii,onError:Pi,connectionRadius:ki,isValidConnection:Ai,selectNodesOnDrag:te,nodeDragThreshold:Di,connectionDragThreshold:$i,onBeforeDelete:$,debug:Vi,ariaLabelConfig:Oi,zIndexMode:Un}),y.jsx(Zd,{onSelectionChange:L}),ii,y.jsx(Od,{proOptions:bi,position:_i}),y.jsx(Vd,{rfId:Jt,disableKeyboardA11y:Wn})]})})}var Sh=hs(bh);function Eh({dimensions:e,lineWidth:t,variant:n,className:o}){return y.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ae(["react-flow__background-pattern",n,o])})}function Ch({radius:e,className:t}){return y.jsx("circle",{cx:e,cy:e,r:e,className:ae(["react-flow__background-pattern","dots",t])})}var Te;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Te||(Te={}));const Nh={[Te.Dots]:1,[Te.Lines]:1,[Te.Cross]:6},Mh=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ls({id:e,variant:t=Te.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:l,className:c,patternClassName:u}){const f=H.useRef(null),{transform:d,patternId:h}=ee(Mh,oe),g=o||Nh[t],v=t===Te.Dots,_=t===Te.Cross,x=Array.isArray(n)?n:[n,n],b=[x[0]*d[2]||1,x[1]*d[2]||1],p=g*d[2],m=Array.isArray(i)?i:[i,i],C=_?[p,p]:b,S=[m[0]*d[2]||1+C[0]/2,m[1]*d[2]||1+C[1]/2],N=`${h}${e||""}`;return y.jsxs("svg",{className:ae(["react-flow__background",c]),style:{...l,...Ut,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:f,"data-testid":"rf__background",children:[y.jsx("pattern",{id:N,x:d[0]%b[0],y:d[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:v?y.jsx(Ch,{radius:p/2,className:u}):y.jsx(Eh,{dimensions:C,lineWidth:r,variant:t,className:u})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}Ls.displayName="Background";H.memo(Ls);function Ih(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function kh(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Ah(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.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 Ph(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.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 Th(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.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 St({children:e,className:t,...n}){return y.jsx("button",{type:"button",className:ae(["react-flow__controls-button",t]),...n,children:e})}const Dh=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Rs({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:u,position:f="bottom-left",orientation:d="vertical","aria-label":h}){const g=re(),{isInteractive:v,minZoomReached:_,maxZoomReached:x,ariaLabelConfig:b}=ee(Dh,oe),{zoomIn:p,zoomOut:m,fitView:C}=Vn(),S=()=>{p(),i?.()},N=()=>{m(),s?.()},T=()=>{C(r),a?.()},P=()=>{g.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l?.(!v)},j=d==="horizontal"?"horizontal":"vertical";return y.jsxs(qt,{className:ae(["react-flow__controls",j,c]),position:f,style:e,"data-testid":"rf__controls","aria-label":h??b["controls.ariaLabel"],children:[t&&y.jsxs(y.Fragment,{children:[y.jsx(St,{onClick:S,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:x,children:y.jsx(Ih,{})}),y.jsx(St,{onClick:N,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:_,children:y.jsx(kh,{})})]}),n&&y.jsx(St,{className:"react-flow__controls-fitview",onClick:T,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:y.jsx(Ah,{})}),o&&y.jsx(St,{className:"react-flow__controls-interactive",onClick:P,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:v?y.jsx(Th,{}):y.jsx(Ph,{})}),u]})}Rs.displayName="Controls";H.memo(Rs);function $h({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:l,className:c,borderRadius:u,shapeRendering:f,selected:d,onClick:h}){const{background:g,backgroundColor:v}=i||{},_=s||g||v;return y.jsx("rect",{className:ae(["react-flow__minimap-node",{selected:d},c]),x:t,y:n,rx:u,ry:u,width:o,height:r,style:{fill:_,stroke:a,strokeWidth:l},shapeRendering:f,onClick:h?x=>h(x,e):void 0})}const zh=H.memo($h),Hh=e=>e.nodes.map(t=>t.id),un=e=>e instanceof Function?e:()=>e;function Lh({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=zh,onClick:s}){const a=ee(Hh,oe),l=un(t),c=un(e),u=un(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:a.map(d=>y.jsx(jh,{id:d,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:f},d))})}function Rh({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:c,x:u,y:f,width:d,height:h}=ee(g=>{const{internals:v}=g.nodeLookup.get(e),_=v.userNode,{x,y:b}=v.positionAbsolute,{width:p,height:m}=Ie(_);return{node:_,x,y:b,width:p,height:m}},oe);return!c||c.hidden||!Or(c)?null:y.jsx(a,{x:u,y:f,width:d,height:h,style:c.style,selected:!!c.selected,className:o(c),color:t(c),borderRadius:r,strokeColor:n(c),strokeWidth:i,shapeRendering:s,onClick:l,id:c.id})}const jh=H.memo(Rh);var Vh=H.memo(Lh);const Oh=200,Bh=150,Fh=e=>!e.hidden,Xh=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?Vr(gt(e.nodeLookup,{filter:Fh}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Yh="react-flow__minimap-desc";function js({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:c,maskStrokeColor:u,maskStrokeWidth:f,position:d="bottom-right",onClick:h,onNodeClick:g,pannable:v=!1,zoomable:_=!1,ariaLabel:x,inversePan:b,zoomStep:p=1,offsetScale:m=5}){const C=re(),S=H.useRef(null),{boundingRect:N,viewBB:T,rfId:P,panZoom:j,translateExtent:I,flowWidth:z,flowHeight:L,ariaLabelConfig:w}=ee(Xh,oe),M=e?.width??Oh,E=e?.height??Bh,A=N.width/M,k=N.height/E,D=Math.max(A,k),$=D*M,V=D*E,R=m*D,F=N.x-($-N.width)/2-R,B=N.y-(V-N.height)/2-R,G=$+R*2,K=V+R*2,Z=`${Yh}-${P}`,O=H.useRef(0),X=H.useRef();O.current=D,H.useEffect(()=>{if(S.current&&j)return X.current=hd({domNode:S.current,panZoom:j,getTransform:()=>C.getState().transform,getViewScale:()=>O.current}),()=>{X.current?.destroy()}},[j]),H.useEffect(()=>{X.current?.update({translateExtent:I,width:z,height:L,inversePan:b,pannable:v,zoomStep:p,zoomable:_})},[v,_,b,p,I,z,L]);const Q=h?q=>{const[J,ne]=X.current?.pointer(q)||[0,0];h(q,{x:J,y:ne})}:void 0,U=g?H.useCallback((q,J)=>{const ne=C.getState().nodeLookup.get(J).internals.userNode;g(q,ne)},[]):void 0,W=x??w["minimap.ariaLabel"];return y.jsx(qt,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*D:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:ae(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:M,height:E,viewBox:`${F} ${B} ${G} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Z,ref:S,onClick:Q,children:[W&&y.jsx("title",{id:Z,children:W}),y.jsx(Vh,{onClick:U,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-R},${B-R}h${G+R*2}v${K+R*2}h${-G-R*2}z
|
|
7
|
-
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}js.displayName="MiniMap";H.memo(js);const Zh=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Wh={[Ke.Line]:"right",[Ke.Handle]:"bottom-right"};function Gh({nodeId:e,position:t,variant:n=Ke.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:d,autoScale:h=!0,shouldResize:g,onResizeStart:v,onResize:_,onResizeEnd:x}){const b=ys(),p=typeof e=="string"?e:b,m=re(),C=H.useRef(null),S=n===Ke.Handle,N=ee(H.useCallback(Zh(S&&h),[S,h]),oe),T=H.useRef(null),P=t??Wh[n];H.useEffect(()=>{if(!(!C.current||!p))return T.current||(T.current=Md({domNode:C.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:I,transform:z,snapGrid:L,snapToGrid:w,nodeOrigin:M,domNode:E}=m.getState();return{nodeLookup:I,transform:z,snapGrid:L,snapToGrid:w,nodeOrigin:M,paneDomNode:E}},onChange:(I,z)=>{const{triggerNodeChanges:L,nodeLookup:w,parentLookup:M,nodeOrigin:E}=m.getState(),A=[],k={x:I.x,y:I.y},D=w.get(p);if(D&&D.expandParent&&D.parentId){const $=D.origin??E,V=I.width??D.measured.width??0,R=I.height??D.measured.height??0,F={id:D.id,parentId:D.parentId,rect:{width:V,height:R,...Br({x:I.x??D.position.x,y:I.y??D.position.y},{width:V,height:R},D.parentId,w,$)}},B=jn([F],w,M,E);A.push(...B),k.x=I.x?Math.max($[0]*V,I.x):void 0,k.y=I.y?Math.max($[1]*R,I.y):void 0}if(k.x!==void 0&&k.y!==void 0){const $={id:p,type:"position",position:{...k}};A.push($)}if(I.width!==void 0&&I.height!==void 0){const V={id:p,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};A.push(V)}for(const $ of z){const V={...$,type:"position"};A.push(V)}L(A)},onEnd:({width:I,height:z})=>{const L={id:p,type:"dimensions",resizing:!1,dimensions:{width:I,height:z}};m.getState().triggerNodeChanges([L])}})),T.current.update({controlPosition:P,boundaries:{minWidth:a,minHeight:l,maxWidth:c,maxHeight:u},keepAspectRatio:f,resizeDirection:d,onResizeStart:v,onResize:_,onResizeEnd:x,shouldResize:g}),()=>{T.current?.destroy()}},[P,a,l,c,u,f,v,_,x,g]);const j=P.split("-");return y.jsx("div",{className:ae(["react-flow__resize-control","nodrag",...j,n,o]),ref:C,style:{...r,scale:N,...s&&{[S?"backgroundColor":"borderColor"]:s}},children:i})}H.memo(Gh);const Vs=H.createContext(void 0);function Os(){const e=H.useContext(Vs);if(!e)throw new Error("useMetricsMode must be used within MetricsModeProvider");return e}function qh(e){const t=pe.c(5),{children:n}=e,[o,r]=H.useState("requests");let i;t[0]!==o?(i={metricsMode:o,setMetricsMode:r},t[0]=o,t[1]=i):i=t[1];let s;return t[2]!==n||t[3]!==i?(s=y.jsx(Vs.Provider,{value:i,children:n}),t[2]=n,t[3]=i,t[4]=s):s=t[4],s}const er=10,Rt=56,Bn=220,rt=56,Uh={requests:{edgeColor:"var(--chart-1)",textClass:"text-chart-1"},errors:{edgeColor:"var(--chart-3)",textClass:"text-chart-3"},latency:{edgeColor:"var(--chart-4)",textClass:"text-chart-4"}};function Kh(){const e=Date.now(),t=300*1e3,n=Math.floor(e/t)*t,o=new Date(n);return{startDate:new Date(n-1440*60*1e3).toISOString(),endDate:o.toISOString()}}function Qh(e){const t=new Map,n=new Map;for(const i of e){const s=i.connectionId;if(s){const l=n.get(s)??{requests:0,errors:0,totalLatency:0};n.set(s,{requests:l.requests+1,errors:l.errors+(i.isError?1:0),totalLatency:l.totalLatency+i.durationMs})}const a=i.gatewayId;if(a){const l=t.get(a)??{requests:0,errors:0,totalLatency:0};t.set(a,{requests:l.requests+1,errors:l.errors+(i.isError?1:0),totalLatency:l.totalLatency+i.durationMs})}}const o=new Map;for(const[i,s]of t)o.set(i,{requests:s.requests,errors:s.errors,errorRate:s.requests>0?s.errors/s.requests*100:0,avgLatencyMs:s.requests>0?s.totalLatency/s.requests:0});const r=new Map;for(const[i,s]of n)r.set(i,{requests:s.requests,errors:s.errors,errorRate:s.requests>0?s.errors/s.requests*100:0,avgLatencyMs:s.requests>0?s.totalLatency/s.requests:0});return{gateways:o,connections:r}}function Bs(e,t){if(!e)return"—";switch(t){case"requests":return e.requests===0?"—":e.requests.toLocaleString();case"errors":return e.errorRate===0?"—":`${e.errorRate.toFixed(1)}%`;case"latency":return e.avgLatencyMs===0?"—":`${Math.round(e.avgLatencyMs)}ms`}}function Et(e,t){if(!e)return 0;switch(t){case"requests":return e.requests;case"errors":return e.errorRate;case"latency":return e.avgLatencyMs}}function Jh(){const e=pe.c(9),{locator:t}=En();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=ha(),e[0]=n):n=e[0];const o=n;let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=Kh(),e[1]=r):r=e[1];const i=r;let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s={...i,limit:1e3,offset:0},e[2]=s):s=e[2];let a;e[3]!==t?(a={toolCaller:o,toolName:"MONITORING_LOGS_LIST",toolInputParams:s,scope:t,staleTime:3e4},e[3]=t,e[4]=a):a=e[4];const{data:l}=pa(a);let c;e[5]!==l?.logs?(c=l?.logs??[],e[5]=l?.logs,e[6]=c):c=e[6];const u=c;let f;return e[7]!==u?(f=Qh(u),e[7]=u,e[8]=f):f=e[8],f}function eg(e){const t=pe.c(29),{data:n}=e,o=jt();let r;t[0]!==n.metric||t[1]!==n.metricsMode?(r=Bs(n.metric,n.metricsMode),t[0]=n.metric,t[1]=n.metricsMode,t[2]=r):r=t[2];const i=r;let s;t[3]!==n.gateway.id||t[4]!==n.org||t[5]!==o?(s=()=>{o({to:"/$org/gateways/$gatewayId",params:{org:n.org,gatewayId:n.gateway.id}})},t[3]=n.gateway.id,t[4]=n.org,t[5]=o,t[6]=s):s=t[6];const a=s;let l;t[7]===Symbol.for("react.memo_cache_sentinel")?(l={height:Rt,width:Bn},t[7]=l):l=t[7];let c;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(la,{}),t[8]=c):c=t[8];let u;t[9]!==n.gateway.icon||t[10]!==n.gateway.title?(u=y.jsx(sr,{icon:n.gateway.icon,name:n.gateway.title,size:"md",fallbackIcon:c,className:"relative z-10"}),t[9]=n.gateway.icon,t[10]=n.gateway.title,t[11]=u):u=t[11];let f;t[12]!==n.gateway.title?(f=y.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.gateway.title}),t[12]=n.gateway.title,t[13]=f):f=t[13];let d;t[14]!==n.colorScheme.textClass?(d=or("text-base leading-none font-semibold tabular-nums",n.colorScheme.textClass),t[14]=n.colorScheme.textClass,t[15]=d):d=t[15];let h;t[16]!==i||t[17]!==d?(h=y.jsx("span",{className:d,children:i}),t[16]=i,t[17]=d,t[18]=h):h=t[18];let g;t[19]!==f||t[20]!==h?(g=y.jsxs("div",{className:"relative z-10 flex flex-col min-w-0 flex-1",children:[f,h]}),t[19]=f,t[20]=h,t[21]=g):g=t[21];let v;t[22]!==n.colorScheme.edgeColor?(v=y.jsx(De,{type:"source",position:Y.Right,style:{width:"8px",height:"8px",background:n.colorScheme.edgeColor,border:"none"}}),t[22]=n.colorScheme.edgeColor,t[23]=v):v=t[23];let _;return t[24]!==a||t[25]!==v||t[26]!==u||t[27]!==g?(_=y.jsxs("div",{className:"relative flex shrink-0 items-center gap-2 pl-1.5 pr-3 bg-background rounded-lg border-shadow nodrag nopan cursor-pointer pointer-events-auto before:absolute before:inset-0 before:rounded-lg before:bg-accent/25 before:opacity-0 hover:before:opacity-100 before:transition-opacity before:duration-800 before:pointer-events-none",style:l,onClick:a,children:[u,g,v]}),t[24]=a,t[25]=v,t[26]=u,t[27]=g,t[28]=_):_=t[28],_}function tg(e){const t=pe.c(29),{data:n}=e,o=jt();let r;t[0]!==n.metric||t[1]!==n.metricsMode?(r=Bs(n.metric,n.metricsMode),t[0]=n.metric,t[1]=n.metricsMode,t[2]=r):r=t[2];const i=r;let s;t[3]!==n.connection.id||t[4]!==n.org||t[5]!==o?(s=()=>{o({to:"/$org/mcps/$connectionId",params:{org:n.org,connectionId:n.connection.id}})},t[3]=n.connection.id,t[4]=n.org,t[5]=o,t[6]=s):s=t[6];const a=s;let l;t[7]===Symbol.for("react.memo_cache_sentinel")?(l={height:Rt,width:Bn},t[7]=l):l=t[7];const c=`1px solid ${n.colorScheme.edgeColor}`;let u;t[8]!==c?(u=y.jsx(De,{type:"target",position:Y.Left,style:{width:"8px",height:"8px",background:"var(--background)",border:c,pointerEvents:"none",cursor:"default"}}),t[8]=c,t[9]=u):u=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(ga,{}),t[10]=f):f=t[10];let d;t[11]!==n.connection.icon||t[12]!==n.connection.title?(d=y.jsx(sr,{icon:n.connection.icon,name:n.connection.title,size:"md",fallbackIcon:f,className:"relative z-10"}),t[11]=n.connection.icon,t[12]=n.connection.title,t[13]=d):d=t[13];let h;t[14]!==n.connection.title?(h=y.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.connection.title}),t[14]=n.connection.title,t[15]=h):h=t[15];let g;t[16]!==n.colorScheme.textClass?(g=or("text-base leading-[1.35] font-semibold tabular-nums",n.colorScheme.textClass),t[16]=n.colorScheme.textClass,t[17]=g):g=t[17];let v;t[18]!==i||t[19]!==g?(v=y.jsx("span",{className:g,children:i}),t[18]=i,t[19]=g,t[20]=v):v=t[20];let _;t[21]!==v||t[22]!==h?(_=y.jsxs("div",{className:"relative z-10 flex flex-col min-w-0 flex-1",children:[h,v]}),t[21]=v,t[22]=h,t[23]=_):_=t[23];let x;return t[24]!==a||t[25]!==_||t[26]!==u||t[27]!==d?(x=y.jsxs("div",{className:"relative flex shrink-0 items-center gap-2 pl-1.5 pr-3 bg-background rounded-lg border-shadow nodrag nopan cursor-pointer pointer-events-auto before:absolute before:inset-0 before:rounded-lg before:bg-accent/25 before:opacity-0 hover:before:opacity-100 before:transition-opacity before:duration-800 before:pointer-events-none",style:l,onClick:a,children:[u,d,_]}),t[24]=a,t[25]=_,t[26]=u,t[27]=d,t[28]=x):x=t[28],x}function ng(e){const t=pe.c(9),{data:n}=e,o=jt();let r;t[0]!==n.org||t[1]!==o?(r=()=>{o({to:"/$org/store",params:{org:n.org}})},t[0]=n.org,t[1]=o,t[2]=r):r=t[2];const i=r;let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s={height:rt,width:rt},t[3]=s):s=t[3];let a,l;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(De,{type:"target",position:Y.Left,style:{opacity:0,pointerEvents:"none"}}),l=y.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-8 w-8"}),t[4]=a,t[5]=l):(a=t[4],l=t[5]);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=y.jsx(De,{type:"source",position:Y.Right,style:{opacity:0,pointerEvents:"none"}}),t[6]=c):c=t[6];let u;return t[7]!==i?(u=y.jsxs("div",{className:"flex items-center justify-center p-2 bg-primary border border-primary-foreground/50 rounded-lg shadow-sm cursor-pointer pointer-events-auto",style:s,onClick:i,children:[a,l,c]}),t[7]=i,t[8]=u):u=t[8],u}const og={gateway:eg,server:tg,mesh:ng};function rg(){const e=pe.c(8),{metricsMode:t,setMetricsMode:n}=Os();let o;e[0]!==n?(o=l=>l&&n(l),e[0]=n,e[1]=o):o=e[1];let r,i,s;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=y.jsx(nn,{value:"requests",className:"text-xs px-3 cursor-pointer",children:"Tool Calls"}),i=y.jsx(nn,{value:"errors",className:"text-xs px-3 cursor-pointer",children:"Errors"}),s=y.jsx(nn,{value:"latency",className:"text-xs px-3 cursor-pointer",children:"Latency"}),e[2]=r,e[3]=i,e[4]=s):(r=e[2],i=e[3],s=e[4]);let a;return e[5]!==t||e[6]!==o?(a=y.jsxs(ya,{type:"single",value:t,onValueChange:o,variant:"outline",size:"sm",className:"bg-background/80 backdrop-blur-sm",children:[r,i,s]}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function sg(){const e=pe.c(36),{metricsMode:t}=Os(),{org:n}=En();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:er},e[0]=o):o=e[0];const r=nr(o);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={pageSize:er},e[1]=i):i=e[1];const s=tr(i),a=Jh();let l,c,u,f,d;if(e[2]!==t||e[3]!==a||e[4]!==s||e[5]!==r){let I;e[11]!==t||e[12]!==a?(I=(L,w)=>Et(a.gateways.get(w.id),t)-Et(a.gateways.get(L.id),t),e[11]=t,e[12]=a,e[13]=I):I=e[13],d=[...r].sort(I);let z;e[14]!==t||e[15]!==a?(z=(L,w)=>Et(a.connections.get(w.id),t)-Et(a.connections.get(L.id),t),e[14]=t,e[15]=a,e[16]=z):z=e[16],f=[...s].sort(z),l=Uh[t],u=new Map,d.forEach((L,w)=>u.set(L.id,w)),c=new Map,f.forEach((L,w)=>c.set(L.id,w)),e[2]=t,e[3]=a,e[4]=s,e[5]=r,e[6]=l,e[7]=c,e[8]=u,e[9]=f,e[10]=d}else l=e[6],c=e[7],u=e[8],f=e[9],d=e[10];const h=-rt/2,g=rt/2,v=h-100-Bn,_=g+100,x=d.length,b=f.length;let p,m;if(e[17]!==l||e[18]!==c||e[19]!==u||e[20]!==x||e[21]!==t||e[22]!==a||e[23]!==n.slug||e[24]!==s||e[25]!==r||e[26]!==b){const I={stroke:l.edgeColor,strokeWidth:1.25,strokeDasharray:"8 6",strokeLinecap:"square"};m=[],p=[],m.push({id:"mesh",type:"mesh",position:{x:h,y:-rt/2},data:{org:n.slug,colorScheme:l},draggable:!1,selectable:!1}),[...r].sort(ag).forEach(w=>{const A=((u.get(w.id)??0)-(x-1)/2)*70-Rt/2;m.push({id:`gateway-${w.id}`,type:"gateway",position:{x:v,y:A},data:{gateway:w,metricsMode:t,metric:a.gateways.get(w.id),colorScheme:l,org:n.slug},draggable:!1,selectable:!1}),p.push({id:`e-gw-${w.id}`,source:`gateway-${w.id}`,target:"mesh",type:"smoothstep",animated:!0,style:I})}),[...s].sort(ig).forEach(w=>{const A=((c.get(w.id)??0)-(b-1)/2)*70-Rt/2;m.push({id:`server-${w.id}`,type:"server",position:{x:_,y:A},data:{connection:w,metricsMode:t,metric:a.connections.get(w.id),colorScheme:l,org:n.slug},draggable:!1,selectable:!1}),p.push({id:`e-srv-${w.id}`,source:"mesh",target:`server-${w.id}`,type:"smoothstep",animated:!0,style:I})}),e[17]=l,e[18]=c,e[19]=u,e[20]=x,e[21]=t,e[22]=a,e[23]=n.slug,e[24]=s,e[25]=r,e[26]=b,e[27]=p,e[28]=m}else p=e[27],m=e[28];let C;e[29]===Symbol.for("react.memo_cache_sentinel")?(C={backgroundImage:"radial-gradient(circle, var(--border) 1px, transparent 1.5px)",backgroundSize:"32px 32px"},e[29]=C):C=e[29];const S=C;let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx("style",{children:`
|
|
8
|
-
.mesh-minimap .react-flow__node { transition: transform 300ms ease-out; }
|
|
9
|
-
.mesh-minimap .react-flow__edge path { transition: d 300ms ease-out; }
|
|
10
|
-
.mesh-minimap .react-flow__edge.animated path {
|
|
11
|
-
animation: dashdraw 0.8s linear infinite;
|
|
12
|
-
}
|
|
13
|
-
@keyframes dashdraw {
|
|
14
|
-
from {
|
|
15
|
-
stroke-dashoffset: 0;
|
|
16
|
-
}
|
|
17
|
-
to {
|
|
18
|
-
stroke-dashoffset: -14;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`}),e[30]=N):N=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T={padding:.3},e[31]=T):T=e[31];let P;e[32]===Symbol.for("react.memo_cache_sentinel")?(P={hideAttribution:!0},e[32]=P):P=e[32];let j;return e[33]!==p||e[34]!==m?(j=y.jsxs("div",{className:"w-full h-full min-h-[420px] relative mesh-minimap bg-background",style:S,children:[N,y.jsx(Sh,{nodes:m,edges:p,nodeTypes:og,fitView:!0,fitViewOptions:T,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnDrag:!0,preventScrolling:!0,proOptions:P,className:"bg-transparent"})]}),e[33]=p,e[34]=m,e[35]=j):j=e[35],j}function ig(e,t){return e.id.localeCompare(t.id)}function ag(e,t){return e.id.localeCompare(t.id)}function cg(){const e=pe.c(3);let t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=y.jsx("div",{className:"flex flex-col gap-3",children:[1,2,3,4,5].map(ug)}),n=y.jsx("div",{className:"h-14 w-28 bg-muted animate-pulse rounded-xl"}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let o;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsx("div",{className:"bg-background p-5 h-full min-h-[420px] flex items-center justify-center",children:y.jsxs("div",{className:"flex items-center gap-16",children:[t,n,y.jsx("div",{className:"flex flex-col gap-3",children:[1,2,3,4,5].map(lg)})]})}),e[2]=o):o=e[2],o}function lg(e){return y.jsx("div",{className:"h-14 w-[220px] bg-muted animate-pulse rounded-lg"},e)}function ug(e){return y.jsx("div",{className:"h-14 w-[220px] bg-muted animate-pulse rounded-lg"},e)}function dg(){const e=new Date().getHours();return e>=5&&e<12?"Morning":e>=12&&e<17?"Afternoon":e>=17&&e<22?"Evening":"Night"}function fg(e){const t=pe.c(12),{text:n,className:o,speed:r}=e,i=o===void 0?"":o,s=r===void 0?30:r,a=n.length/s*1e3,l=n.length,c=`${n.length}ch`,u=`${a}ms`;let f;t[0]!==c||t[1]!==l||t[2]!==u?(f={"--typewriter-duration":u,"--typewriter-steps":l,"--typewriter-max-width":c},t[0]=c,t[1]=l,t[2]=u,t[3]=f):f=t[3];const d=f;let h;t[4]!==n?(h=y.jsx("span",{className:"typewriter-text",children:n}),t[4]=n,t[5]=h):h=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=y.jsx("style",{children:`
|
|
22
|
-
.typewriter-text {
|
|
23
|
-
display: inline-block;
|
|
24
|
-
width: 0;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
white-space: nowrap;
|
|
27
|
-
animation: typewriter var(--typewriter-duration) steps(var(--typewriter-steps)) forwards;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@keyframes typewriter {
|
|
31
|
-
to {
|
|
32
|
-
width: var(--typewriter-max-width);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`}),t[6]=g):g=t[6];let v;return t[7]!==i||t[8]!==d||t[9]!==h||t[10]!==n?(v=y.jsxs("span",{className:i,style:d,children:[h,g]},n),t[7]=i,t[8]=d,t[9]=h,t[10]=n,t[11]=v):v=t[11],v}function hg(){const e=pe.c(91),{org:t,locator:n}=En(),{data:o}=qi.useSession(),r=o?.user,i=jt(),{inputValue:s,setInputValue:a,createThread:l,activeThreadId:c,setActiveThreadId:u,hideThread:f}=Qn(),{threads:d,refetch:h}=Qi(),[g,v]=no(`${n}:home-view-mode`,"chat"),_=nr(),x=tr(),b=Ji(),p=b.length>0,[m,C]=oa(n,b),[S,N]=no(`${n}:selected-gateway-id`,null);let T;e[0]!==_||e[1]!==S?(T=S?_.find(ie=>ie.id===S)??null:null,e[0]=_,e[1]=S,e[2]=T):T=e[2];const P=T,j=P?.id??null,I=!j;let z;e[3]!==C?(z=ie=>{C(ie)},e[3]=C,e[4]=z):z=e[4];const L=z;let w;e[5]!==N?(w=ie=>{N(ie)},e[5]=N,e[6]=w):w=e[6];const M=w,E=ra(),A=sa(j),k=j??void 0;let D;e[7]!==c||e[8]!==A||e[9]!==E||e[10]!==k?(D={threadId:c,gatewayId:k,systemPrompt:A,onToolCall:E},e[7]=c,e[8]=A,e[9]=E,e[10]=k,e[11]=D):D=e[11];const $=ia(D),{branchContext:V,clearBranch:R}=Qn();let F;e[12]!==c||e[13]!==$||e[14]!==R||e[15]!==j||e[16]!==m||e[17]!==a||e[18]!==r?.image||e[19]!==r?.name?(F=async ie=>{if(!m){Ui.error("No model configured");return}a(""),R();const fe={created_at:new Date().toISOString(),thread_id:c,model:{id:m.id,connectionId:m.connectionId,provider:m.provider??void 0,limits:m.limits??void 0},gateway:{id:j},user:{avatar:r?.image??void 0,name:r?.name??"you"}};await $.sendMessage(ie,fe)},e[12]=c,e[13]=$,e[14]=R,e[15]=j,e[16]=m,e[17]=a,e[18]=r?.image,e[19]=r?.name,e[20]=F):F=e[20];const B=F;let G;e[21]!==r?.name?(G=r?.name?.split(" ")[0]||"there",e[21]=r?.name,e[22]=G):G=e[22];const K=G;let Z;e[23]===Symbol.for("react.memo_cache_sentinel")?(Z=dg(),e[23]=Z):Z=e[23];const O=Z;let X;e[24]!==c||e[25]!==d?(X=d?.find(ie=>ie.id===c),e[24]=c,e[25]=d,e[26]=X):X=e[26];const Q=X,U=$.status==="submitted"||$.status==="streaming";if(!p){const ie=r?.id||"";let fe;e[27]!==x?(fe=x??[],e[27]=x,e[28]=fe):fe=e[28];let _e;e[29]!==i||e[30]!==t.slug?(_e=()=>{i({to:"/$org/mcps",params:{org:t.slug},search:{action:"create"}})},e[29]=i,e[30]=t.slug,e[31]=_e):_e=e[31];let Ee;return e[32]!==t.id||e[33]!==t.slug||e[34]!==fe||e[35]!==_e||e[36]!==ie?(Ee=y.jsx("div",{className:"flex flex-col size-full bg-background items-center justify-center",children:y.jsx(aa,{orgSlug:t.slug,orgId:t.id,userId:ie,allConnections:fe,onInstallMcpServer:_e})}),e[32]=t.id,e[33]=t.slug,e[34]=fe,e[35]=_e,e[36]=ie,e[37]=Ee):Ee=e[37],Ee}let W;e[38]!==Q||e[39]!==$.isEmpty||e[40]!==g?(W=y.jsx(ue.Header.Left,{children:g==="graph"?y.jsx("span",{className:"text-sm font-medium text-foreground",children:"Summary"}):!$.isEmpty&&Q?.title?y.jsx(fg,{text:Q.title,className:"text-sm font-medium text-foreground"}):y.jsx("span",{className:"text-sm font-medium text-foreground",children:"Chat"})}),e[38]=Q,e[39]=$.isEmpty,e[40]=g,e[41]=W):W=e[41];let q;e[42]!==g?(q=g==="graph"&&y.jsx(rg,{}),e[42]=g,e[43]=q):q=e[43];let J;e[44]!==c||e[45]!==l||e[46]!==f||e[47]!==h||e[48]!==u||e[49]!==d||e[50]!==g?(J=g!=="graph"&&y.jsxs(y.Fragment,{children:[y.jsx(rr,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:()=>l(),"aria-label":"New chat",children:y.jsx(fa,{size:16})}),y.jsx(ca,{threads:d,activeThreadId:c,onSelectThread:u,onRemoveThread:f,onOpen:()=>h(),variant:"outline"})]}),e[44]=c,e[45]=l,e[46]=f,e[47]=h,e[48]=u,e[49]=d,e[50]=g,e[51]=J):J=e[51];let ne;e[52]===Symbol.for("react.memo_cache_sentinel")?(ne={value:"chat",icon:y.jsx(Cn,{})},e[52]=ne):ne=e[52];let te;e[53]===Symbol.for("react.memo_cache_sentinel")?(te=[ne,{value:"graph",icon:y.jsx(da,{})}],e[53]=te):te=e[53];let se;e[54]!==v||e[55]!==g?(se=y.jsx(ua,{value:g,onValueChange:v,size:"sm",options:te}),e[54]=v,e[55]=g,e[56]=se):se=e[56];let le;e[57]!==q||e[58]!==J||e[59]!==se?(le=y.jsxs(ue.Header.Right,{children:[q,J,se]}),e[57]=q,e[58]=J,e[59]=se,e[60]=le):le=e[60];let ce;e[61]!==le||e[62]!==W?(ce=y.jsxs(ue.Header,{children:[W,le]}),e[61]=le,e[62]=W,e[63]=ce):ce=e[63];let de;e[64]!==V||e[65]!==$.clearError||e[66]!==$.clearFinishReason||e[67]!==$.error||e[68]!==$.finishReason||e[69]!==$.isEmpty||e[70]!==$.messages||e[71]!==$.status||e[72]!==$.stop||e[73]!==R||e[74]!==M||e[75]!==L||e[76]!==B||e[77]!==s||e[78]!==U||e[79]!==P||e[80]!==j||e[81]!==m||e[82]!==u||e[83]!==a||e[84]!==I||e[85]!==K||e[86]!==g?(de=g==="graph"?y.jsx("div",{className:"flex-1 overflow-hidden relative",children:y.jsx(dn,{fallback:y.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground h-full flex items-center justify-center",children:"Failed to load mesh visualization"}),children:y.jsx(H.Suspense,{fallback:y.jsx(cg,{}),children:y.jsx(sg,{})})})}):$.isEmpty?y.jsx("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:y.jsxs("div",{className:"flex flex-col items-center gap-6 w-full max-w-[550px]",children:[y.jsxs("div",{className:"text-center",children:[y.jsxs("p",{className:"text-lg font-medium text-foreground",children:[O," ",K,","]}),y.jsx("p",{className:"text-base text-muted-foreground",children:"What are we building today?"})]}),y.jsx(to,{gateway:P??void 0,onGatewayChange:M,disabled:U,children:y.jsxs(ta,{value:s,onChange:a,placeholder:"Ask anything or @ for context",maxTextHeight:"65px",onSubmit:async()=>{s.trim()&&await B(s.trim())},children:[I&&y.jsx(Jn,{selectedGatewayId:j,onGatewayChange:M,placeholder:"Agent",disabled:U}),y.jsx(eo,{selectedModel:m??void 0,onModelChange:L,placeholder:"Model",variant:"borderless"})]})}),y.jsx(en.Container,{className:"w-full",children:j&&y.jsx(dn,{fallback:null,children:y.jsx(H.Suspense,{fallback:y.jsx(en.Fallback,{}),children:y.jsx(en,{gatewayId:j,onSelect:ie=>{B(ie.description??ie.name)}})})},j)})]})}):y.jsxs(y.Fragment,{children:[y.jsx(ue.Main,{children:y.jsx(ue.Messages,{messages:$.messages,status:$.status,minHeightOffset:280})}),y.jsx(ue.Footer,{children:y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(ue.ErrorBanner,{error:$.error,onFixInChat:()=>{$.error&&B(`I encountered this error: ${$.error.message}. Can you help me fix it?`)},onDismiss:$.clearError}),y.jsx(ue.FinishReasonWarning,{finishReason:$.finishReason,onContinue:()=>{B("Please continue.")},onDismiss:$.clearFinishReason}),y.jsx(ue.BranchPreview,{branchContext:V,clearBranchContext:R,onGoToOriginalMessage:()=>{V&&(u(V.originalThreadId),R(),a(""))},setInputValue:a}),y.jsx(to,{gateway:P??void 0,onGatewayChange:M,disabled:U,children:y.jsxs(ue.Input,{value:s,onChange:a,onSubmit:async()=>{s.trim()&&await B(s.trim())},onStop:$.stop,disabled:!m,isStreaming:U,placeholder:m?"Ask anything or @ for context":"Select a model to start chatting",children:[I&&y.jsx(Jn,{selectedGatewayId:j,onGatewayChange:M,placeholder:"Agent",disabled:U}),y.jsx(eo,{selectedModel:m??void 0,onModelChange:L,placeholder:"Model",variant:"borderless"}),y.jsx(ea,{messages:$.messages})]})})]})})]}),e[64]=V,e[65]=$.clearError,e[66]=$.clearFinishReason,e[67]=$.error,e[68]=$.finishReason,e[69]=$.isEmpty,e[70]=$.messages,e[71]=$.status,e[72]=$.stop,e[73]=R,e[74]=M,e[75]=L,e[76]=B,e[77]=s,e[78]=U,e[79]=P,e[80]=j,e[81]=m,e[82]=u,e[83]=a,e[84]=I,e[85]=K,e[86]=g,e[87]=de):de=e[87];let ve;return e[88]!==ce||e[89]!==de?(ve=y.jsx(qh,{children:y.jsxs(ue,{children:[ce,de]})}),e[88]=ce,e[89]=de,e[90]=ve):ve=e[90],ve}function gg(e){const t=pe.c(14),{error:n,onRetry:o}=e,r=n?.message?.includes("401")||n?.message?.toLowerCase().includes("unauthorized");let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsxs(ue.Header,{children:[y.jsx(ue.Header.Left,{children:y.jsx("span",{className:"text-sm font-medium text-foreground",children:"Chat"})}),y.jsx(ue.Header.Right,{})]}),t[0]=i):i=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=y.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:y.jsx(Cn,{className:"h-6 w-6 text-destructive"})}),t[1]=s):s=t[1];const a=r?"Unable to load models":"Something went wrong";let l;t[2]!==a?(l=y.jsx("h3",{className:"text-lg font-medium",children:a}),t[2]=a,t[3]=l):l=t[3];const c=r?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":n?.message||"An unexpected error occurred";let u;t[4]!==c?(u=y.jsx("p",{className:"text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=u):u=t[5];let f;t[6]!==l||t[7]!==u?(f=y.jsxs("div",{className:"space-y-2",children:[l,u]}),t[6]=l,t[7]=u,t[8]=f):f=t[8];let d;t[9]!==o?(d=y.jsx(rr,{variant:"outline",onClick:o,children:"Try again"}),t[9]=o,t[10]=d):d=t[10];let h;return t[11]!==f||t[12]!==d?(h=y.jsxs(ue,{children:[i,y.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:y.jsxs("div",{className:"max-w-sm space-y-4",children:[s,f,d]})})]}),t[11]=f,t[12]=d,t[13]=h):h=t[13],h}function pg(){const e=pe.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=y.jsx(dn,{fallback:mg,children:y.jsx(H.Suspense,{fallback:y.jsx(na,{}),children:y.jsx(hg,{})})}),e[0]=t):t=e[0],t}function mg(e){const{error:t,resetError:n}=e;return y.jsx(gg,{error:t,onRetry:n})}function up(){const e=pe.c(3),t=Gi();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx(pg,{}),e[0]=n):n=e[0];let o;return e[1]!==t.location.pathname?(o=y.jsx(Ki,{children:n},t.location.pathname),e[1]=t.location.pathname,e[2]=o):o=e[2],o}export{up as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as p,c as u,j as r,i as L,f as O,a5 as A,a6 as h,t as N,p as R}from"./index-C5FDJtAp.js";import{C as D}from"./collection-header-CeBQhXWy.js";import{C as I}from"./collection-page-pMUw63Yr.js";import{u as M,a as F}from"./use-organization-settings-D46q7SyU.js";import{u as H}from"./project-context-provider-DH0iqA5D.js";import{c as f,B as j}from"./button-ClkQLR3o.js";import{S as T}from"./switch-ZAqg3LbP.js";import{i as W}from"./ArrowLeft-D0vIuW0V.js";import"./collection-display-button-CdHXoeVD.js";import"./dropdown-menu-C4Ypstre.js";import"./Grid01-DwtrqYPx.js";import"./ArrowUp-MjJJcV-O.js";import"./Check-LvJ1lSFr.js";import"./List-D2PJPXod.js";import"./tooltip-DXYcokUT.js";import"./view-mode-toggle-C5hz9T3M.js";import"./useMutation-DEocBykZ.js";import"./connection-BcYehfdK.js";const S=({size:n=24,color:e="currentColor",...s})=>p.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},p.createElement("path",{d:"M7 22 17 2"}));S.displayName="SlashDivider";function q(n){const e=u.c(4);let s;e[0]!==n?({...s}=n,e[0]=n,e[1]=s):s=e[1];let t;return e[2]!==s?(t=r.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...s}),e[2]=s,e[3]=t):t=e[3],t}function G(n){const e=u.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let i;e[3]!==s?(i=f("flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2",s),e[3]=s,e[4]=i):i=e[4];let a;return e[5]!==t||e[6]!==i?(a=r.jsx("ol",{"data-slot":"breadcrumb-list",className:i,...t}),e[5]=t,e[6]=i,e[7]=a):a=e[7],a}function C(n){const e=u.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let i;e[3]!==s?(i=f("inline-flex items-center gap-1.5",s),e[3]=s,e[4]=i):i=e[4];let a;return e[5]!==t||e[6]!==i?(a=r.jsx("li",{"data-slot":"breadcrumb-item",className:i,...t}),e[5]=t,e[6]=i,e[7]=a):a=e[7],a}function J(n){const e=u.c(10);let s,t,i;e[0]!==n?({asChild:s,className:t,...i}=n,e[0]=n,e[1]=s,e[2]=t,e[3]=i):(s=e[1],t=e[2],i=e[3]);const a=s?L:"a";let o;e[4]!==t?(o=f("hover:text-foreground transition-colors",t),e[4]=t,e[5]=o):o=e[5];let d;return e[6]!==a||e[7]!==i||e[8]!==o?(d=r.jsx(a,{"data-slot":"breadcrumb-link",className:o,...i}),e[6]=a,e[7]=i,e[8]=o,e[9]=d):d=e[9],d}function K(n){const e=u.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let i;e[3]!==s?(i=f("text-foreground font-normal",s),e[3]=s,e[4]=i):i=e[4];let a;return e[5]!==t||e[6]!==i?(a=r.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:i,...t}),e[5]=t,e[6]=i,e[7]=a):a=e[7],a}function Q(n){const e=u.c(12);let s,t,i;e[0]!==n?({children:s,className:t,...i}=n,e[0]=n,e[1]=s,e[2]=t,e[3]=i):(s=e[1],t=e[2],i=e[3]);let a;e[4]!==t?(a=f("[&>svg]:size-3.5 text-muted-foreground -rotate-12 opacity-50 list-none",t),e[4]=t,e[5]=a):a=e[5];let o;e[6]!==s?(o=s??r.jsx(S,{}),e[6]=s,e[7]=o):o=e[7];let d;return e[8]!==i||e[9]!==a||e[10]!==o?(d=r.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:a,...i,children:o}),e[8]=i,e[9]=a,e[10]=o,e[11]=d):d=e[11],d}function ue(){const{org:n}=H(),e=O(),s=M(n.id),{update:t}=F(n.id),[i,a]=p.useState({}),[o,d]=p.useState(!1),x=s?.enabled_plugins??[],k=l=>{const c=i[l];return c!==void 0?c:x.includes(l)},w=()=>{const l=new Set(x);for(const[c,m]of Object.entries(i))m?l.add(c):l.delete(c);return Array.from(l)},b=Object.keys(i).length>0,y=(l,c)=>{const m=x.includes(l);a(c===m?g=>{const{[l]:v,...$}=g;return $}:g=>({...g,[l]:c}))},P=async()=>{d(!0);try{await t.mutateAsync({enabled_plugins:w()}),a({}),N.success("Plugin settings saved")}catch{N.error("Failed to save plugin settings")}finally{d(!1)}},E=()=>{a({})},z=l=>R.find(c=>c.pluginId===l),B=l=>h.find(m=>m.id===l)?.description??null;return r.jsxs(I,{children:[r.jsx(D,{title:r.jsx(q,{children:r.jsxs(G,{children:[r.jsx(C,{children:r.jsx(J,{asChild:!0,children:r.jsx(A,{to:"/$org/settings",params:{org:n.slug},children:"Settings"})})}),r.jsx(Q,{}),r.jsx(C,{children:r.jsx(K,{children:"Plugins"})})]})}),leftElement:r.jsx(j,{variant:"ghost",size:"icon",className:"size-8 text-muted-foreground",onClick:()=>e({to:"/$org/settings",params:{org:n.slug}}),children:r.jsx(W,{className:"size-4"})})}),r.jsx("div",{className:"flex-1 overflow-auto",children:r.jsx("div",{className:"flex h-full",children:r.jsx("div",{className:"flex-1 overflow-auto",children:r.jsx("div",{className:"p-5 max-w-2xl",children:r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for your organization."})}),r.jsx("div",{className:"divide-y divide-border border-y border-border",children:h.map(l=>{const c=z(l.id),m=B(l.id),g=k(l.id);return r.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c?.icon&&r.jsx("div",{className:"flex-shrink-0 text-muted-foreground [&>svg]:size-4",children:c.icon}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-sm font-medium text-foreground",children:c?.label??l.id}),m&&r.jsx("p",{className:"text-xs text-muted-foreground",children:m})]})]}),r.jsx(T,{checked:g,onCheckedChange:v=>y(l.id,v),disabled:o})]},l.id)})}),h.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),r.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[r.jsx(j,{onClick:P,disabled:!b||o,className:"min-w-24",children:o?"Saving...":"Save Changes"}),b&&r.jsx(j,{variant:"outline",onClick:E,disabled:o,children:"Cancel"})]})]})})})})})]})}export{ue as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,aw as _e,ah as rt,an as Ne,j as d,az as st,ai as lt,aF as be,aG as at,ag as k,ax as it,aj as j,al as P,am as $,ay as ct,ac as Ee,aS as dt,m as ut,aV as pt,aY as ft,aW as mt,aX as ht,aZ as vt,aA as gt,aB as xt,aC as St,c as ee}from"./index-C5FDJtAp.js";import{V as wt}from"./tooltip-DXYcokUT.js";import{i as Ct}from"./Check-LvJ1lSFr.js";import{t as Re}from"./ChevronDown-QF_Tgl2v.js";import{c as oe}from"./button-ClkQLR3o.js";function Pe(n,[e,t]){return Math.min(t,Math.max(e,n))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=lt(J,[bt,_e]),pe=_e(),[Tt,G]=ne(J),[Nt,Pt]=ne(J),je=n=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=n,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=rt(u),[_,O]=Ne({prop:o,defaultProp:r??!1,onChange:i,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(st,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Nt,{scope:n.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:o=!1,...r}=n,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(it,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...r,ref:a,onClick:P(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:P(r.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(r.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,children:i,placeholder:s="",...l}=n,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var _t="SelectIcon",ke=c.forwardRef((n,e)=>{const{__scopeSelect:t,children:o,...r}=n;return d.jsx(j.span,{"aria-hidden":!0,...r,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=n=>d.jsx(ct,{asChild:!0,...n});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((n,e)=>{const t=G(Q,n.__scopeSelect),[o,r]=c.useState();if($(()=>{r(new DocumentFragment)},[]),!t.open){const i=o;return i?Ee.createPortal(d.jsx(Ve,{scope:n.__scopeSelect,children:d.jsx(de.Slot,{scope:n.__scopeSelect,children:d.jsx("div",{children:n.children})})}),i):null}return d.jsx(He,{...n,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=ht("SelectContent.RemoveScroll"),He=c.forwardRef((n,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=n,m=G(Q,t),[x,F]=c.useState(null),[M,re]=c.useState(null),_=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=c.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===y&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(mt,{as:jt,allowPinchZoom:!0,children:d.jsx(vt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=y.indexOf(I);y=y.slice(N+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:o,...r}=n,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,_=>h(_)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const _=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...r,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((n,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=A,...i}=n,s=pe(t);return d.jsx(xt,{...s,...i,ref:e,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Fe=c.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:o,...r}=n,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:P(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=be();return d.jsx(Dt,{scope:t,id:r,children:d.jsx(j.div,{role:"group","aria-labelledby":r,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=kt(We,t);return d.jsx(j.div,{id:r.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((n,e)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:i,...s}=n,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,r)),p=be(),v=c.useRef("touch"),C=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:r,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:S,onFocus:P(s.onFocus,()=>w(!0)),onBlur:P(s.onBlur,()=>w(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:P(s.onPointerMove,m=>{v.current=m.pointerType,r?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,...i}=n,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Pt(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((n,e)=>{const t=Y(Ce,n.__scopeSelect),o=Te(Ce,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=c.forwardRef((n,e)=>{const t=Y(ye,n.__scopeSelect),o=Te(ye,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=c.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=n,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:P(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(r.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(St,{...r,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:n,value:e,...t},o)=>{const r=c.useRef(null),i=k(o,r),s=dt(e);return c.useEffect(()=>{const l=r.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ut;function et(n){return n===""||n===void 0}function tt(n){const e=ut(n),t=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,i]}function ot(n,e,t){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Wt(n,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==t?a:void 0}function Wt(n,e){return n.map((t,o)=>n[(e+o)%n.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;const nt=({size:n=24,color:e="currentColor",...t})=>c.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},c.createElement("path",{d:"m18 15-6-6-6 6"}));nt.displayName="ChevronUp";function uo(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(n){const e=ee.c(13);let t,o,r,i;e[0]!==n?({className:o,size:i,children:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-7 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...r,children:[t,a]}),e[8]=t,e[9]=r,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(n){const e=ee.c(25);let t,o,r,i,s;e[0]!==n?({className:o,children:t,position:i,hideScrollButtons:s,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i,e[5]=s):(t=e[1],o=e[2],r=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==r||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...r,children:[g,S,p]})}),e[18]=l,e[19]=r,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(n){const e=ee.c(16);let t,o,r,i;e[0]!==n?({className:o,children:t,hideCheck:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(Ct,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==r||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...r,children:[a,u]}),e[11]=r,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(nt,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}function ro(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,Pe as e};
|