@lunora/studio 1.0.0-alpha.394 → 1.0.0-alpha.395
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/README.md +2 -0
- package/dist/index.mjs +1 -1
- package/dist/mount.mjs +1 -1
- package/dist/packem_chunks/ai-knowledge.mjs +1 -1
- package/dist/packem_shared/StudioApp-CmlMUUAq.mjs +1 -0
- package/dist/standalone/{chunk-AWMHWVF7.js → chunk-2ASCHUYZ.js} +1 -1
- package/dist/standalone/{chunk-BTHVLHPT.js → chunk-2GY7PZLR.js} +1 -1
- package/dist/standalone/{chunk-DUICFFES.js → chunk-2Q2YW6DP.js} +1 -1
- package/dist/standalone/{chunk-YQI2YAD7.js → chunk-2SQ4R6JF.js} +1 -1
- package/dist/standalone/{chunk-Y4KOJPOW.js → chunk-2V76BRXG.js} +1 -1
- package/dist/standalone/{chunk-U4ZQVQZA.js → chunk-37QBGHAB.js} +1 -1
- package/dist/standalone/{chunk-YREHZBTG.js → chunk-37YN7GKB.js} +1 -1
- package/dist/standalone/{chunk-4Z2GLDF7.js → chunk-3FRO43CC.js} +1 -1
- package/dist/standalone/chunk-3NPH3ZH2.js +1 -0
- package/dist/standalone/{chunk-DRSX6KR3.js → chunk-3SFU5VY4.js} +1 -1
- package/dist/standalone/{chunk-YC3TUO5H.js → chunk-3WPPFTDC.js} +1 -1
- package/dist/standalone/{chunk-BUYKTV27.js → chunk-43LNUM4U.js} +1 -1
- package/dist/standalone/{chunk-HCLUIJMW.js → chunk-4A6J4C6A.js} +1 -1
- package/dist/standalone/chunk-4DZXYINC.js +1 -0
- package/dist/standalone/{chunk-26RNXTU3.js → chunk-4EJG4J2A.js} +1 -1
- package/dist/standalone/{chunk-BCT3KY76.js → chunk-4FTKFUPJ.js} +1 -1
- package/dist/standalone/{chunk-SQO3WGXH.js → chunk-4L2BABMS.js} +1 -1
- package/dist/standalone/{chunk-A33FOU2H.js → chunk-5BI76KCT.js} +1 -1
- package/dist/standalone/{chunk-BMGMBZAW.js → chunk-5IFJNGRV.js} +1 -1
- package/dist/standalone/{chunk-PT4GNZU7.js → chunk-5JCH67JD.js} +1 -1
- package/dist/standalone/{chunk-JCJCUWVN.js → chunk-5KNYRYVI.js} +1 -1
- package/dist/standalone/{chunk-5J2UX2CO.js → chunk-5PWQ7HBE.js} +1 -1
- package/dist/standalone/{chunk-JXW6H6LE.js → chunk-6CVUGL2K.js} +1 -1
- package/dist/standalone/{chunk-IC2PEYF7.js → chunk-6E2GHT3X.js} +1 -1
- package/dist/standalone/chunk-6MAIN66N.js +1 -0
- package/dist/standalone/{chunk-3GBBYV7C.js → chunk-6OE7TT2Y.js} +1 -1
- package/dist/standalone/{chunk-T6YZEXZO.js → chunk-6PQX7SHZ.js} +1 -1
- package/dist/standalone/{chunk-PVQDT47U.js → chunk-6QP547WA.js} +1 -1
- package/dist/standalone/chunk-7EUM7G2I.js +33 -0
- package/dist/standalone/{chunk-EEDAK4NS.js → chunk-7TGL5VXY.js} +1 -1
- package/dist/standalone/{chunk-TNQHMR76.js → chunk-7UN2ZZZV.js} +1 -1
- package/dist/standalone/{chunk-7URG6FZD.js → chunk-AFOBKJOK.js} +1 -1
- package/dist/standalone/{chunk-BFV46XUH.js → chunk-AGM656HF.js} +1 -1
- package/dist/standalone/{chunk-EBGXOUAO.js → chunk-AHX6CSR3.js} +1 -1
- package/dist/standalone/{chunk-2Q4WVEPB.js → chunk-AK6ZI3YN.js} +1 -1
- package/dist/standalone/{chunk-VLQU4G6O.js → chunk-AL5S7LVU.js} +1 -1
- package/dist/standalone/{chunk-M6WDFEUZ.js → chunk-B65U64C3.js} +1 -1
- package/dist/standalone/{chunk-PWHUPKZB.js → chunk-B7W7O2RS.js} +1 -1
- package/dist/standalone/chunk-BD76RVBZ.js +7 -0
- package/dist/standalone/{chunk-ZARTCW6W.js → chunk-BGU4O7PL.js} +1 -1
- package/dist/standalone/{chunk-VUWHTKLJ.js → chunk-BNDXMSLI.js} +1 -1
- package/dist/standalone/{chunk-ZG6VEBVA.js → chunk-BYUH4YAY.js} +1 -1
- package/dist/standalone/{chunk-N3MKRANL.js → chunk-CKGUHRV2.js} +1 -1
- package/dist/standalone/{chunk-ADOZBBJC.js → chunk-DL5ZVSGL.js} +1 -1
- package/dist/standalone/{chunk-TAZRDWQE.js → chunk-EE6QEAGV.js} +1 -1
- package/dist/standalone/{chunk-5BTQ4VV2.js → chunk-EGO7EG33.js} +1 -1
- package/dist/standalone/{chunk-AFUJCRWR.js → chunk-EHQ2LCCB.js} +1 -1
- package/dist/standalone/{chunk-HXWW3XML.js → chunk-FGAXBLHE.js} +1 -1
- package/dist/standalone/{chunk-K3HWPNON.js → chunk-FHR4JFT7.js} +1 -1
- package/dist/standalone/{chunk-EH53XOVI.js → chunk-G237Z4YL.js} +1 -1
- package/dist/standalone/{chunk-WVAWKCNQ.js → chunk-H4NGBPG2.js} +1 -1
- package/dist/standalone/{chunk-RRIRWVQY.js → chunk-I6TDZTVT.js} +1 -1
- package/dist/standalone/{chunk-QJ3M3IQW.js → chunk-IB4M4AI2.js} +1 -1
- package/dist/standalone/{chunk-S3HFNWDK.js → chunk-IGQXAWBB.js} +1 -1
- package/dist/standalone/{chunk-5XQM44J7.js → chunk-IGSYGAHI.js} +1 -1
- package/dist/standalone/{chunk-J2SIGUHW.js → chunk-IJAV3RXF.js} +1 -1
- package/dist/standalone/{chunk-NFIFRB3W.js → chunk-IT3JTYC4.js} +1 -1
- package/dist/standalone/{chunk-D4CP2AUO.js → chunk-J2IFOOCG.js} +1 -1
- package/dist/standalone/{chunk-YQEIOEEC.js → chunk-JARVMFE6.js} +1 -1
- package/dist/standalone/{chunk-WARWYT4K.js → chunk-JCHZNPJU.js} +1 -1
- package/dist/standalone/{chunk-2ZNMZPPZ.js → chunk-JGSHDQGZ.js} +1 -1
- package/dist/standalone/{chunk-EYFAYJYD.js → chunk-KHNHN37V.js} +1 -1
- package/dist/standalone/{chunk-ECXQQPVU.js → chunk-LTWCT32V.js} +1 -1
- package/dist/standalone/{chunk-HPQLTLIE.js → chunk-LVWOITSU.js} +1 -1
- package/dist/standalone/{chunk-TIFTYP3Z.js → chunk-M2NWC7G3.js} +1 -1
- package/dist/standalone/{chunk-MEYZIZGX.js → chunk-M2SFKF5Z.js} +1 -1
- package/dist/standalone/{chunk-S3WL3QZ2.js → chunk-MCJCCS7G.js} +1 -1
- package/dist/standalone/chunk-MYIUZ3KE.js +1 -0
- package/dist/standalone/{chunk-TDF4VVIF.js → chunk-N6F3WFL4.js} +1 -1
- package/dist/standalone/{chunk-FSY7UKMG.js → chunk-NBJ6DCHA.js} +1 -1
- package/dist/standalone/{chunk-QRXJTY2S.js → chunk-NJMFSHMW.js} +1 -1
- package/dist/standalone/{chunk-4OWWWAMB.js → chunk-OGRACGHY.js} +1 -1
- package/dist/standalone/{chunk-ZSXJJYWN.js → chunk-OSYCXIGN.js} +1 -1
- package/dist/standalone/{chunk-FRKRT73U.js → chunk-P5SHS466.js} +1 -1
- package/dist/standalone/{chunk-RIRXDYLA.js → chunk-PIFKJ3ES.js} +1 -1
- package/dist/standalone/chunk-QE2BYD4G.js +1 -0
- package/dist/standalone/{chunk-C4PC3TVC.js → chunk-QJH6HTCT.js} +1 -1
- package/dist/standalone/{chunk-OEPNNICC.js → chunk-RELSLYVS.js} +1 -1
- package/dist/standalone/{chunk-CBFVQCWS.js → chunk-REZHNEUN.js} +1 -1
- package/dist/standalone/{chunk-3BDGZAZD.js → chunk-RG5MG5I4.js} +1 -1
- package/dist/standalone/{chunk-5FHGTA7V.js → chunk-SFGYW6JZ.js} +1 -1
- package/dist/standalone/{chunk-UB6S6VYI.js → chunk-STKYARMP.js} +1 -1
- package/dist/standalone/{chunk-A7L3PZEL.js → chunk-THCO2YN5.js} +1 -1
- package/dist/standalone/{chunk-KEHWNM7Q.js → chunk-TPY5BJYD.js} +1 -1
- package/dist/standalone/{chunk-HLN47VMG.js → chunk-TWOO3G2Q.js} +1 -1
- package/dist/standalone/{chunk-LUHBGCMO.js → chunk-U7U4ADXH.js} +1 -1
- package/dist/standalone/{chunk-MLX6ME3Q.js → chunk-UWJXX5AV.js} +1 -1
- package/dist/standalone/{chunk-UHFZV34O.js → chunk-V335NVH7.js} +1 -1
- package/dist/standalone/{chunk-HE2XT2P7.js → chunk-V4X27TLH.js} +1 -1
- package/dist/standalone/{chunk-E32WBVTB.js → chunk-VAZ2FZKT.js} +1 -1
- package/dist/standalone/{chunk-WY23EROJ.js → chunk-VKBLXJIZ.js} +1 -1
- package/dist/standalone/{chunk-XWLURY4U.js → chunk-VUC5V5XF.js} +1 -1
- package/dist/standalone/{chunk-7XZENNML.js → chunk-WC2DKA2R.js} +1 -1
- package/dist/standalone/{chunk-4WFEKKAZ.js → chunk-X7ZYE4GP.js} +1 -1
- package/dist/standalone/{chunk-KJHVB5KM.js → chunk-XACKMLPO.js} +1 -1
- package/dist/standalone/{chunk-EOTHFTZG.js → chunk-YCZQNUZV.js} +1 -1
- package/dist/standalone/chunk-YIZDDGWA.js +1 -0
- package/dist/standalone/{chunk-VEG327ST.js → chunk-YNO5YLZT.js} +5 -5
- package/dist/standalone/chunk-YQJIG7QG.js +167 -0
- package/dist/standalone/{chunk-HPCOC223.js → chunk-YRC2DXSL.js} +1 -1
- package/dist/standalone/{chunk-VND72OIC.js → chunk-YUENB45T.js} +1 -1
- package/dist/standalone/{chunk-F4NZZ3LK.js → chunk-YYRXX5Z4.js} +1 -1
- package/dist/standalone/chunk-Z2ERBKWN.js +1 -0
- package/dist/standalone/{chunk-VUMS4VIV.js → chunk-ZBAR562M.js} +1 -1
- package/dist/standalone/{chunk-V5ZKAZR6.js → chunk-ZKEXJDGJ.js} +1 -1
- package/dist/standalone/{chunk-BADHCM45.js → chunk-ZO6KBU54.js} +1 -1
- package/dist/standalone/{chunk-5YEMXXQZ.js → chunk-ZQGRGSI7.js} +1 -1
- package/dist/standalone/studio.js +5 -5
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/dist/packem_shared/StudioApp-DKBDIF7N.mjs +0 -1
- package/dist/standalone/chunk-C57KLL4U.js +0 -1
- package/dist/standalone/chunk-G4H5DPO6.js +0 -33
- package/dist/standalone/chunk-GATWEWRW.js +0 -1
- package/dist/standalone/chunk-HQJXQWJM.js +0 -1
- package/dist/standalone/chunk-JSVT5VBU.js +0 -1
- package/dist/standalone/chunk-KQ6YQP3Z.js +0 -1
- package/dist/standalone/chunk-OZUPOUHR.js +0 -1
- package/dist/standalone/chunk-PLCYDHU3.js +0 -7
- package/dist/standalone/chunk-UG6ZNYWH.js +0 -167
- package/dist/standalone/chunk-ZUFBUWT4.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Pi,b as ki,c as Ha,d as Ba,e as Qo,g as Fa,h as Va,i as ln}from"./chunk-Y2YLTUMD.js";import{a as Xa,b as Ya,c as Wa,f as Jo}from"./chunk-JXW6H6LE.js";import{e as $a,k as La}from"./chunk-2NUCBQFU.js";import{a as qu}from"./chunk-4AG356VE.js";import{B as za,b as Go,j as Ra,s as Mi}from"./chunk-G4H5DPO6.js";import{a as jo,b as Ta}from"./chunk-ADABTCDI.js";import{a as r,b as Ku,d as At}from"./chunk-5PEAXTYQ.js";var xc=Ku((Px,vc)=>{"use no memo";"use strict";var $h=Object.create,Fr=Object.defineProperty,Lh=Object.getOwnPropertyDescriptor,Hh=Object.getOwnPropertyNames,Bh=Object.getPrototypeOf,Fh=Object.prototype.hasOwnProperty,Vh=r((t,e)=>{for(var n in e)Fr(t,n,{get:e[n],enumerable:!0})},"__export"),Sc=r((t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Hh(e))!Fh.call(t,i)&&i!==n&&Fr(t,i,{get:r(()=>e[i],"get"),enumerable:!(o=Lh(e,i))||o.enumerable});return t},"__copyProps"),Xh=r((t,e,n)=>(n=t!=null?$h(Bh(t)):{},Sc(e||!t||!t.__esModule?Fr(n,"default",{value:t,enumerable:!0}):n,t)),"__toESM"),Yh=r(t=>Sc(Fr({},"__esModule",{value:!0}),t),"__toCommonJS"),wc={};Vh(wc,{$dispatcherGuard:r(()=>Kh,"$dispatcherGuard"),$makeReadOnly:r(()=>Gh,"$makeReadOnly"),$reset:r(()=>qh,"$reset"),$structuralCheck:r(()=>tp,"$structuralCheck"),c:r(()=>Uh,"c"),clearRenderCounterRegistry:r(()=>jh,"clearRenderCounterRegistry"),renderCounterRegistry:r(()=>Vo,"renderCounterRegistry"),useRenderCounter:r(()=>ep,"useRenderCounter")});vc.exports=Yh(wc);var En=Xh(jo()),{useRef:Wh,useEffect:Zh,isValidElement:bn}=En,gc,ua=(gc=En.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)!=null?gc:En.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,da=Symbol.for("react.memo_cache_sentinel"),mc,Uh=typeof((mc=En.__COMPILER_RUNTIME)==null?void 0:mc.c)=="function"?En.__COMPILER_RUNTIME.c:r(function(e){return En.useMemo(()=>{let n=new Array(e);for(let o=0;o<e;o++)n[o]=da;return n[da]=!0,n},[])},"c2"),Br={};["readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","getCacheSignal","getCacheForType","useCacheRefresh"].forEach(t=>{Br[t]=()=>{throw new Error(`[React] Unexpected React hook call (${t}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var Fo=null;Br.useMemoCache=t=>{if(Fo==null)throw new Error("React Compiler internal invariant violation: unexpected null dispatcher");return Fo.useMemoCache(t)};function Hr(t){return ua.ReactCurrentDispatcher.current=t,ua.ReactCurrentDispatcher.current}r(Hr,"setCurrent");var Cn=[];function Kh(t){let e=ua.ReactCurrentDispatcher.current;if(t===0){if(Cn.push(e),Cn.length===1&&(Fo=e),e===Br)throw new Error("[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.");Hr(Br)}else if(t===1){let n=Cn.pop();if(n==null)throw new Error("React Compiler internal error: unexpected null in guard stack");Cn.length===0&&(Fo=null),Hr(n)}else if(t===2)Cn.push(e),Hr(Fo);else if(t===3){let n=Cn.pop();if(n==null)throw new Error("React Compiler internal error: unexpected null in guard stack");Hr(n)}else throw new Error("React Compiler internal error: unreachable block"+t)}r(Kh,"$dispatcherGuard");function qh(t){for(let e=0;e<t.length;e++)t[e]=da}r(qh,"$reset");function Gh(){throw new Error("TODO: implement $makeReadOnly in react-compiler-runtime")}r(Gh,"$makeReadOnly");var Vo=new Map;function jh(){for(let t of Vo.values())t.forEach(e=>{e.count=0})}r(jh,"clearRenderCounterRegistry");function Qh(t,e){let n=Vo.get(t);n==null&&(n=new Set,Vo.set(t,n)),n.add(e)}r(Qh,"registerRenderCounter");function Jh(t,e){let n=Vo.get(t);n?.delete(e)}r(Jh,"removeRenderCounter");function ep(t){let e=Wh(null);e.current!=null&&(e.current.count+=1),Zh(()=>{if(e.current==null){let n={count:0};Qh(t,n),e.current=n}return()=>{e.current!==null&&Jh(t,e.current)}})}r(ep,"useRenderCounter");var yc=new Set;function tp(t,e,n,o,i,s){function a(u,d,h,f){let w=`${o}:${s} [${i}] ${n}${h} changed from ${u} to ${d} at depth ${f}`;yc.has(w)||(yc.add(w),console.error(w))}r(a,"error");let l=2;function c(u,d,h,f){if(!(f>l)){if(u===d)return;if(typeof u!=typeof d)a(`type ${typeof u}`,`type ${typeof d}`,h,f);else if(typeof u=="object"){let w=Array.isArray(u),S=Array.isArray(d);if(u===null&&d!==null)a("null",`type ${typeof d}`,h,f);else if(d===null)a(`type ${typeof u}`,"null",h,f);else if(u instanceof Map)if(!(d instanceof Map))a("Map instance","other value",h,f);else if(u.size!==d.size)a(`Map instance with size ${u.size}`,`Map instance with size ${d.size}`,h,f);else for(let[g,y]of u)d.has(g)?c(y,d.get(g),`${h}.get(${g})`,f+1):a(`Map instance with key ${g}`,`Map instance without key ${g}`,h,f);else if(d instanceof Map)a("other value","Map instance",h,f);else if(u instanceof Set)if(!(d instanceof Set))a("Set instance","other value",h,f);else if(u.size!==d.size)a(`Set instance with size ${u.size}`,`Set instance with size ${d.size}`,h,f);else for(let g of d)u.has(g)||a(`Set instance without element ${g}`,`Set instance with element ${g}`,h,f);else if(d instanceof Set)a("other value","Set instance",h,f);else if(w||S)if(w!==S)a(`type ${w?"array":"object"}`,`type ${S?"array":"object"}`,h,f);else if(u.length!==d.length)a(`array with length ${u.length}`,`array with length ${d.length}`,h,f);else for(let g=0;g<u.length;g++)c(u[g],d[g],`${h}[${g}]`,f+1);else if(bn(u)||bn(d))bn(u)!==bn(d)?a(`type ${bn(u)?"React element":"object"}`,`type ${bn(d)?"React element":"object"}`,h,f):u.type!==d.type?a(`React element of type ${u.type}`,`React element of type ${d.type}`,h,f):c(u.props,d.props,`[props of ${h}]`,f+1);else{for(let g in d)g in u||a(`object without key ${g}`,`object with key ${g}`,h,f);for(let g in u)g in d?c(u[g],d[g],`${h}.${g}`,f+1):a(`object with key ${g}`,`object without key ${g}`,h,f)}}else{if(typeof u=="function")return;isNaN(u)||isNaN(d)?isNaN(u)!==isNaN(d)&&a(`${isNaN(u)?"NaN":"non-NaN value"}`,`${isNaN(d)?"NaN":"non-NaN value"}`,h,f):u!==d&&a(u,d,h,f)}}}r(c,"recur"),c(t,e,"",0)}r(tp,"$structuralCheck")});var Gu={value:r(()=>{},"value")};function Ua(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new er(n)}r(Ua,"dispatch");function er(t){this._=t}r(er,"Dispatch");function ju(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}r(ju,"parseTypenames");er.prototype=Ua.prototype={constructor:er,on:r(function(t,e){var n=this._,o=ju(t+"",n),i,s=-1,a=o.length;if(arguments.length<2){for(;++s<a;)if((i=(t=o[s]).type)&&(i=Qu(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(i=(t=o[s]).type)n[i]=Za(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Za(n[i],t.name,null);return this},"on"),copy:r(function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new er(t)},"copy"),call:r(function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,s;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],o=0,i=s.length;o<i;++o)s[o].value.apply(e,n)},"call"),apply:r(function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],i=0,s=o.length;i<s;++i)o[i].value.apply(e,n)},"apply")};function Qu(t,e){for(var n=0,o=t.length,i;n<o;++n)if((i=t[n]).name===e)return i.value}r(Qu,"get");function Za(t,e,n){for(var o=0,i=t.length;o<i;++o)if(t[o].name===e){t[o]=Gu,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}r(Za,"set");var Tt=Ua;var tr="http://www.w3.org/1999/xhtml",Ii={svg:"http://www.w3.org/2000/svg",xhtml:tr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function at(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Ii.hasOwnProperty(e)?{space:Ii[e],local:t}:t}r(at,"default");function Ju(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===tr&&e.documentElement.namespaceURI===tr?e.createElement(t):e.createElementNS(n,t)}}r(Ju,"creatorInherit");function ed(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}r(ed,"creatorFixed");function uo(t){var e=at(t);return(e.local?ed:Ju)(e)}r(uo,"default");function td(){}r(td,"none");function xt(t){return t==null?td:function(){return this.querySelector(t)}}r(xt,"default");function Oi(t){typeof t!="function"&&(t=xt(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=o[i]=new Array(a),c,u,d=0;d<a;++d)(c=s[d])&&(u=t.call(c,c.__data__,d,s))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new Le(o,this._parents)}r(Oi,"default");function Di(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}r(Di,"array");function nd(){return[]}r(nd,"empty");function cn(t){return t==null?nd:function(){return this.querySelectorAll(t)}}r(cn,"default");function od(t){return function(){return Di(t.apply(this,arguments))}}r(od,"arrayAll");function Ai(t){typeof t=="function"?t=od(t):t=cn(t);for(var e=this._groups,n=e.length,o=[],i=[],s=0;s<n;++s)for(var a=e[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&(o.push(t.call(c,c.__data__,u,a)),i.push(c));return new Le(o,i)}r(Ai,"default");function un(t){return function(){return this.matches(t)}}r(un,"default");function nr(t){return function(e){return e.matches(t)}}r(nr,"childMatcher");var rd=Array.prototype.find;function id(t){return function(){return rd.call(this.children,t)}}r(id,"childFind");function sd(){return this.firstElementChild}r(sd,"childFirst");function Ti(t){return this.select(t==null?sd:id(typeof t=="function"?t:nr(t)))}r(Ti,"default");var ad=Array.prototype.filter;function ld(){return Array.from(this.children)}r(ld,"children");function cd(t){return function(){return ad.call(this.children,t)}}r(cd,"childrenFilter");function Ri(t){return this.selectAll(t==null?ld:cd(typeof t=="function"?t:nr(t)))}r(Ri,"default");function zi(t){typeof t!="function"&&(t=un(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=o[i]=[],c,u=0;u<a;++u)(c=s[u])&&t.call(c,c.__data__,u,s)&&l.push(c);return new Le(o,this._parents)}r(zi,"default");function fo(t){return new Array(t.length)}r(fo,"default");function $i(){return new Le(this._enter||this._groups.map(fo),this._parents)}r($i,"default");function ho(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}r(ho,"EnterNode");ho.prototype={constructor:ho,appendChild:r(function(t){return this._parent.insertBefore(t,this._next)},"appendChild"),insertBefore:r(function(t,e){return this._parent.insertBefore(t,e)},"insertBefore"),querySelector:r(function(t){return this._parent.querySelector(t)},"querySelector"),querySelectorAll:r(function(t){return this._parent.querySelectorAll(t)},"querySelectorAll")};function Li(t){return function(){return t}}r(Li,"default");function ud(t,e,n,o,i,s){for(var a=0,l,c=e.length,u=s.length;a<u;++a)(l=e[a])?(l.__data__=s[a],o[a]=l):n[a]=new ho(t,s[a]);for(;a<c;++a)(l=e[a])&&(i[a]=l)}r(ud,"bindIndex");function dd(t,e,n,o,i,s,a){var l,c,u=new Map,d=e.length,h=s.length,f=new Array(d),w;for(l=0;l<d;++l)(c=e[l])&&(f[l]=w=a.call(c,c.__data__,l,e)+"",u.has(w)?i[l]=c:u.set(w,c));for(l=0;l<h;++l)w=a.call(t,s[l],l,s)+"",(c=u.get(w))?(o[l]=c,c.__data__=s[l],u.delete(w)):n[l]=new ho(t,s[l]);for(l=0;l<d;++l)(c=e[l])&&u.get(f[l])===c&&(i[l]=c)}r(dd,"bindKey");function fd(t){return t.__data__}r(fd,"datum");function Hi(t,e){if(!arguments.length)return Array.from(this,fd);var n=e?dd:ud,o=this._parents,i=this._groups;typeof t!="function"&&(t=Li(t));for(var s=i.length,a=new Array(s),l=new Array(s),c=new Array(s),u=0;u<s;++u){var d=o[u],h=i[u],f=h.length,w=hd(t.call(d,d&&d.__data__,u,o)),S=w.length,g=l[u]=new Array(S),y=a[u]=new Array(S),m=c[u]=new Array(f);n(d,h,g,y,m,w,e);for(var E=0,C=0,p,x;E<S;++E)if(p=g[E]){for(E>=C&&(C=E+1);!(x=y[C])&&++C<S;);p._next=x||null}}return a=new Le(a,o),a._enter=l,a._exit=c,a}r(Hi,"default");function hd(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}r(hd,"arraylike");function Bi(){return new Le(this._exit||this._groups.map(fo),this._parents)}r(Bi,"default");function Fi(t,e,n){var o=this.enter(),i=this,s=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?s.remove():n(s),o&&i?o.merge(i).order():i}r(Fi,"default");function Vi(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,i=n.length,s=o.length,a=Math.min(i,s),l=new Array(i),c=0;c<a;++c)for(var u=n[c],d=o[c],h=u.length,f=l[c]=new Array(h),w,S=0;S<h;++S)(w=u[S]||d[S])&&(f[S]=w);for(;c<i;++c)l[c]=n[c];return new Le(l,this._parents)}r(Vi,"default");function Xi(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],i=o.length-1,s=o[i],a;--i>=0;)(a=o[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}r(Xi,"default");function Yi(t){t||(t=pd);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}r(e,"compareNode");for(var n=this._groups,o=n.length,i=new Array(o),s=0;s<o;++s){for(var a=n[s],l=a.length,c=i[s]=new Array(l),u,d=0;d<l;++d)(u=a[d])&&(c[d]=u);c.sort(e)}return new Le(i,this._parents).order()}r(Yi,"default");function pd(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}r(pd,"ascending");function Wi(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}r(Wi,"default");function Zi(){return Array.from(this)}r(Zi,"default");function Ui(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,s=o.length;i<s;++i){var a=o[i];if(a)return a}return null}r(Ui,"default");function Ki(){let t=0;for(let e of this)++t;return t}r(Ki,"default");function qi(){return!this.node()}r(qi,"default");function Gi(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&t.call(l,l.__data__,s,i);return this}r(Gi,"default");function gd(t){return function(){this.removeAttribute(t)}}r(gd,"attrRemove");function md(t){return function(){this.removeAttributeNS(t.space,t.local)}}r(md,"attrRemoveNS");function yd(t,e){return function(){this.setAttribute(t,e)}}r(yd,"attrConstant");function Sd(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}r(Sd,"attrConstantNS");function wd(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}r(wd,"attrFunction");function vd(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}r(vd,"attrFunctionNS");function ji(t,e){var n=at(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?md:gd:typeof e=="function"?n.local?vd:wd:n.local?Sd:yd)(n,e))}r(ji,"default");function po(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}r(po,"default");function xd(t){return function(){this.style.removeProperty(t)}}r(xd,"styleRemove");function bd(t,e,n){return function(){this.style.setProperty(t,e,n)}}r(bd,"styleConstant");function Cd(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}r(Cd,"styleFunction");function Qi(t,e,n){return arguments.length>1?this.each((e==null?xd:typeof e=="function"?Cd:bd)(t,e,n??"")):bt(this.node(),t)}r(Qi,"default");function bt(t,e){return t.style.getPropertyValue(e)||po(t).getComputedStyle(t,null).getPropertyValue(e)}r(bt,"styleValue");function Ed(t){return function(){delete this[t]}}r(Ed,"propertyRemove");function _d(t,e){return function(){this[t]=e}}r(_d,"propertyConstant");function Nd(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}r(Nd,"propertyFunction");function Ji(t,e){return arguments.length>1?this.each((e==null?Ed:typeof e=="function"?Nd:_d)(t,e)):this.node()[t]}r(Ji,"default");function Ka(t){return t.trim().split(/^|\s+/)}r(Ka,"classArray");function es(t){return t.classList||new qa(t)}r(es,"classList");function qa(t){this._node=t,this._names=Ka(t.getAttribute("class")||"")}r(qa,"ClassList");qa.prototype={add:r(function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:r(function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:r(function(t){return this._names.indexOf(t)>=0},"contains")};function Ga(t,e){for(var n=es(t),o=-1,i=e.length;++o<i;)n.add(e[o])}r(Ga,"classedAdd");function ja(t,e){for(var n=es(t),o=-1,i=e.length;++o<i;)n.remove(e[o])}r(ja,"classedRemove");function Md(t){return function(){Ga(this,t)}}r(Md,"classedTrue");function Pd(t){return function(){ja(this,t)}}r(Pd,"classedFalse");function kd(t,e){return function(){(e.apply(this,arguments)?Ga:ja)(this,t)}}r(kd,"classedFunction");function ts(t,e){var n=Ka(t+"");if(arguments.length<2){for(var o=es(this.node()),i=-1,s=n.length;++i<s;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?kd:e?Md:Pd)(n,e))}r(ts,"default");function Id(){this.textContent=""}r(Id,"textRemove");function Od(t){return function(){this.textContent=t}}r(Od,"textConstant");function Dd(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}r(Dd,"textFunction");function ns(t){return arguments.length?this.each(t==null?Id:(typeof t=="function"?Dd:Od)(t)):this.node().textContent}r(ns,"default");function Ad(){this.innerHTML=""}r(Ad,"htmlRemove");function Td(t){return function(){this.innerHTML=t}}r(Td,"htmlConstant");function Rd(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}r(Rd,"htmlFunction");function os(t){return arguments.length?this.each(t==null?Ad:(typeof t=="function"?Rd:Td)(t)):this.node().innerHTML}r(os,"default");function zd(){this.nextSibling&&this.parentNode.appendChild(this)}r(zd,"raise");function rs(){return this.each(zd)}r(rs,"default");function $d(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}r($d,"lower");function is(){return this.each($d)}r(is,"default");function ss(t){var e=typeof t=="function"?t:uo(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}r(ss,"default");function Ld(){return null}r(Ld,"constantNull");function as(t,e){var n=typeof t=="function"?t:uo(t),o=e==null?Ld:typeof e=="function"?e:xt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}r(as,"default");function Hd(){var t=this.parentNode;t&&t.removeChild(this)}r(Hd,"remove");function ls(){return this.each(Hd)}r(ls,"default");function Bd(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}r(Bd,"selection_cloneShallow");function Fd(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}r(Fd,"selection_cloneDeep");function cs(t){return this.select(t?Fd:Bd)}r(cs,"default");function us(t){return arguments.length?this.property("__data__",t):this.node().__data__}r(us,"default");function Vd(t){return function(e){t.call(this,e,this.__data__)}}r(Vd,"contextListener");function Xd(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}r(Xd,"parseTypenames");function Yd(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,i=e.length,s;n<i;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++o]=s;++o?e.length=o:delete this.__on}}}r(Yd,"onRemove");function Wd(t,e,n){return function(){var o=this.__on,i,s=Vd(e);if(o){for(var a=0,l=o.length;a<l;++a)if((i=o[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=e;return}}this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},o?o.push(i):this.__on=[i]}}r(Wd,"onAdd");function ds(t,e,n){var o=Xd(t+""),i,s=o.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(i=0,d=l[c];i<s;++i)if((a=o[i]).type===d.type&&a.name===d.name)return d.value}return}for(l=e?Wd:Yd,i=0;i<s;++i)this.each(l(o[i],e,n));return this}r(ds,"default");function Qa(t,e,n){var o=po(t),i=o.CustomEvent;typeof i=="function"?i=new i(e,n):(i=o.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}r(Qa,"dispatchEvent");function Zd(t,e){return function(){return Qa(this,t,e)}}r(Zd,"dispatchConstant");function Ud(t,e){return function(){return Qa(this,t,e.apply(this,arguments))}}r(Ud,"dispatchFunction");function fs(t,e){return this.each((typeof e=="function"?Ud:Zd)(t,e))}r(fs,"default");function*hs(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,s=o.length,a;i<s;++i)(a=o[i])&&(yield a)}r(hs,"default");var ps=[null];function Le(t,e){this._groups=t,this._parents=e}r(Le,"Selection");function Ja(){return new Le([[document.documentElement]],ps)}r(Ja,"selection");function Kd(){return this}r(Kd,"selection_selection");Le.prototype=Ja.prototype={constructor:Le,select:Oi,selectAll:Ai,selectChild:Ti,selectChildren:Ri,filter:zi,data:Hi,enter:$i,exit:Bi,join:Fi,merge:Vi,selection:Kd,order:Xi,sort:Yi,call:Wi,nodes:Zi,node:Ui,size:Ki,empty:qi,each:Gi,attr:ji,style:Qi,property:Ji,classed:ts,text:ns,html:os,raise:rs,lower:is,append:ss,insert:as,remove:ls,clone:cs,datum:us,on:ds,dispatch:fs,[Symbol.iterator]:hs};var dt=Ja;function Xe(t){return typeof t=="string"?new Le([[document.querySelector(t)]],[document.documentElement]):new Le([[t]],ps)}r(Xe,"default");function gs(t){let e;for(;e=t.sourceEvent;)t=e;return t}r(gs,"default");function Ue(t,e){if(t=gs(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}r(Ue,"default");var el={passive:!1},Rt={capture:!0,passive:!1};function or(t){t.stopImmediatePropagation()}r(or,"nopropagation");function ft(t){t.preventDefault(),t.stopImmediatePropagation()}r(ft,"default");function dn(t){var e=t.document.documentElement,n=Xe(t).on("dragstart.drag",ft,Rt);"onselectstart"in e?n.on("selectstart.drag",ft,Rt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}r(dn,"default");function go(t,e){var n=t.document.documentElement,o=Xe(t).on("dragstart.drag",null);e&&(o.on("click.drag",ft,Rt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}r(go,"yesdrag");var mo=r(t=>()=>t,"default");function yo(t,{sourceEvent:e,subject:n,target:o,identifier:i,active:s,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}r(yo,"DragEvent");yo.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function qd(t){return!t.ctrlKey&&!t.button}r(qd,"defaultFilter");function Gd(){return this.parentNode}r(Gd,"defaultContainer");function jd(t,e){return e??{x:t.x,y:t.y}}r(jd,"defaultSubject");function Qd(){return navigator.maxTouchPoints||"ontouchstart"in this}r(Qd,"defaultTouchable");function So(){var t=qd,e=Gd,n=jd,o=Qd,i={},s=Tt("start","drag","end"),a=0,l,c,u,d,h=0;function f(p){p.on("mousedown.drag",w).filter(o).on("touchstart.drag",y).on("touchmove.drag",m,el).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}r(f,"drag");function w(p,x){if(!(d||!t.call(this,p,x))){var N=C(this,e.call(this,p,x),p,x,"mouse");N&&(Xe(p.view).on("mousemove.drag",S,Rt).on("mouseup.drag",g,Rt),dn(p.view),or(p),u=!1,l=p.clientX,c=p.clientY,N("start",p))}}r(w,"mousedowned");function S(p){if(ft(p),!u){var x=p.clientX-l,N=p.clientY-c;u=x*x+N*N>h}i.mouse("drag",p)}r(S,"mousemoved");function g(p){Xe(p.view).on("mousemove.drag mouseup.drag",null),go(p.view,u),ft(p),i.mouse("end",p)}r(g,"mouseupped");function y(p,x){if(t.call(this,p,x)){var N=p.changedTouches,_=e.call(this,p,x),P=N.length,b,R;for(b=0;b<P;++b)(R=C(this,_,p,x,N[b].identifier,N[b]))&&(or(p),R("start",p,N[b]))}}r(y,"touchstarted");function m(p){var x=p.changedTouches,N=x.length,_,P;for(_=0;_<N;++_)(P=i[x[_].identifier])&&(ft(p),P("drag",p,x[_]))}r(m,"touchmoved");function E(p){var x=p.changedTouches,N=x.length,_,P;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),_=0;_<N;++_)(P=i[x[_].identifier])&&(or(p),P("end",p,x[_]))}r(E,"touchended");function C(p,x,N,_,P,b){var R=s.copy(),D=Ue(b||N,x),O,I,v;if((v=n.call(p,new yo("beforestart",{sourceEvent:N,target:f,identifier:P,active:a,x:D[0],y:D[1],dx:0,dy:0,dispatch:R}),_))!=null)return O=v.x-D[0]||0,I=v.y-D[1]||0,r(function k(M,T,A){var L=D,X;switch(M){case"start":i[P]=k,X=a++;break;case"end":delete i[P],--a;case"drag":D=Ue(A||T,x),X=a;break}R.call(M,p,new yo(M,{sourceEvent:T,subject:v,target:f,identifier:P,active:X,x:D[0]+O,y:D[1]+I,dx:D[0]-L[0],dy:D[1]-L[1],dispatch:R}),_)},"gesture")}return r(C,"beforestart"),f.filter=function(p){return arguments.length?(t=typeof p=="function"?p:mo(!!p),f):t},f.container=function(p){return arguments.length?(e=typeof p=="function"?p:mo(p),f):e},f.subject=function(p){return arguments.length?(n=typeof p=="function"?p:mo(p),f):n},f.touchable=function(p){return arguments.length?(o=typeof p=="function"?p:mo(!!p),f):o},f.on=function(){var p=s.on.apply(s,arguments);return p===s?f:p},f.clickDistance=function(p){return arguments.length?(h=(p=+p)*p,f):Math.sqrt(h)},f}r(So,"default");var fn=0,vo=0,wo=0,nl=1e3,rr,xo,ir=0,zt=0,sr=0,bo=typeof performance=="object"&&performance.now?performance:Date,ol=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Eo(){return zt||(ol(Jd),zt=bo.now()+sr)}r(Eo,"now");function Jd(){zt=0}r(Jd,"clearNow");function Co(){this._call=this._time=this._next=null}r(Co,"Timer");Co.prototype=ar.prototype={constructor:Co,restart:r(function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Eo():+n)+(e==null?0:+e),!this._next&&xo!==this&&(xo?xo._next=this:rr=this,xo=this),this._call=t,this._time=n,ms()},"restart"),stop:r(function(){this._call&&(this._call=null,this._time=1/0,ms())},"stop")};function ar(t,e,n){var o=new Co;return o.restart(t,e,n),o}r(ar,"timer");function rl(){Eo(),++fn;for(var t=rr,e;t;)(e=zt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--fn}r(rl,"timerFlush");function tl(){zt=(ir=bo.now())+sr,fn=vo=0;try{rl()}finally{fn=0,tf(),zt=0}}r(tl,"wake");function ef(){var t=bo.now(),e=t-ir;e>nl&&(sr-=e,ir=t)}r(ef,"poke");function tf(){for(var t,e=rr,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:rr=n);xo=t,ms(o)}r(tf,"nap");function ms(t){if(!fn){vo&&(vo=clearTimeout(vo));var e=t-zt;e>24?(t<1/0&&(vo=setTimeout(tl,t-bo.now()-sr)),wo&&(wo=clearInterval(wo))):(wo||(ir=bo.now(),wo=setInterval(ef,nl)),fn=1,ol(tl))}}r(ms,"sleep");function _o(t,e,n){var o=new Co;return e=e==null?0:+e,o.restart(i=>{o.stop(),t(i+e)},e,n),o}r(_o,"default");var nf=Tt("start","end","cancel","interrupt"),of=[],al=0,il=1,cr=2,lr=3,sl=4,ur=5,No=6;function ht(t,e,n,o,i,s){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;rf(t,n,{name:e,index:o,group:i,on:nf,tween:of,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:al})}r(ht,"default");function Mo(t,e){var n=Ye(t,e);if(n.state>al)throw new Error("too late; already scheduled");return n}r(Mo,"init");function Ze(t,e){var n=Ye(t,e);if(n.state>lr)throw new Error("too late; already running");return n}r(Ze,"set");function Ye(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}r(Ye,"get");function rf(t,e,n){var o=t.__transition,i;o[e]=n,n.timer=ar(s,0,n.time);function s(u){n.state=il,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}r(s,"schedule");function a(u){var d,h,f,w;if(n.state!==il)return c();for(d in o)if(w=o[d],w.name===n.name){if(w.state===lr)return _o(a);w.state===sl?(w.state=No,w.timer.stop(),w.on.call("interrupt",t,t.__data__,w.index,w.group),delete o[d]):+d<e&&(w.state=No,w.timer.stop(),w.on.call("cancel",t,t.__data__,w.index,w.group),delete o[d])}if(_o(function(){n.state===lr&&(n.state=sl,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=cr,n.on.call("start",t,t.__data__,n.index,n.group),n.state===cr){for(n.state=lr,i=new Array(f=n.tween.length),d=0,h=-1;d<f;++d)(w=n.tween[d].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=w);i.length=h+1}}r(a,"start");function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=ur,1),h=-1,f=i.length;++h<f;)i[h].call(t,d);n.state===ur&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}r(l,"tick");function c(){n.state=No,n.timer.stop(),delete o[e];for(var u in o)return;delete t.__transition}r(c,"stop")}r(rf,"create");function Ct(t,e){var n=t.__transition,o,i,s=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((o=n[a]).name!==e){s=!1;continue}i=o.state>cr&&o.state<ur,o.state=No,o.timer.stop(),o.on.call(i?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[a]}s&&delete t.__transition}}r(Ct,"default");function ys(t){return this.each(function(){Ct(this,t)})}r(ys,"default");function sf(t,e){var n,o;return function(){var i=Ze(this,t),s=i.tween;if(s!==n){o=n=s;for(var a=0,l=o.length;a<l;++a)if(o[a].name===e){o=o.slice(),o.splice(a,1);break}}i.tween=o}}r(sf,"tweenRemove");function af(t,e,n){var o,i;if(typeof n!="function")throw new Error;return function(){var s=Ze(this,t),a=s.tween;if(a!==o){i=(o=a).slice();for(var l={name:e,value:n},c=0,u=i.length;c<u;++c)if(i[c].name===e){i[c]=l;break}c===u&&i.push(l)}s.tween=i}}r(af,"tweenFunction");function Ss(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=Ye(this.node(),n).tween,i=0,s=o.length,a;i<s;++i)if((a=o[i]).name===t)return a.value;return null}return this.each((e==null?sf:af)(n,t,e))}r(Ss,"default");function hn(t,e,n){var o=t._id;return t.each(function(){var i=Ze(this,o);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Ye(i,o).value[e]}}r(hn,"tweenValue");function Po(t,e){var n;return(typeof e=="number"?Ha:e instanceof Pi?ki:(n=Pi(e))?(e=n,ki):Ba)(t,e)}r(Po,"default");function lf(t){return function(){this.removeAttribute(t)}}r(lf,"attrRemove");function cf(t){return function(){this.removeAttributeNS(t.space,t.local)}}r(cf,"attrRemoveNS");function uf(t,e,n){var o,i=n+"",s;return function(){var a=this.getAttribute(t);return a===i?null:a===o?s:s=e(o=a,n)}}r(uf,"attrConstant");function df(t,e,n){var o,i=n+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?s:s=e(o=a,n)}}r(df,"attrConstantNS");function ff(t,e,n){var o,i,s;return function(){var a,l=n(this),c;return l==null?void this.removeAttribute(t):(a=this.getAttribute(t),c=l+"",a===c?null:a===o&&c===i?s:(i=c,s=e(o=a,l)))}}r(ff,"attrFunction");function hf(t,e,n){var o,i,s;return function(){var a,l=n(this),c;return l==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),c=l+"",a===c?null:a===o&&c===i?s:(i=c,s=e(o=a,l)))}}r(hf,"attrFunctionNS");function ws(t,e){var n=at(t),o=n==="transform"?Va:Po;return this.attrTween(t,typeof e=="function"?(n.local?hf:ff)(n,o,hn(this,"attr."+t,e)):e==null?(n.local?cf:lf)(n):(n.local?df:uf)(n,o,e))}r(ws,"default");function pf(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}r(pf,"attrInterpolate");function gf(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}r(gf,"attrInterpolateNS");function mf(t,e){var n,o;function i(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&gf(t,s)),n}return r(i,"tween"),i._value=e,i}r(mf,"attrTweenNS");function yf(t,e){var n,o;function i(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&pf(t,s)),n}return r(i,"tween"),i._value=e,i}r(yf,"attrTween");function vs(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=at(t);return this.tween(n,(o.local?mf:yf)(o,e))}r(vs,"default");function Sf(t,e){return function(){Mo(this,t).delay=+e.apply(this,arguments)}}r(Sf,"delayFunction");function wf(t,e){return e=+e,function(){Mo(this,t).delay=e}}r(wf,"delayConstant");function xs(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Sf:wf)(e,t)):Ye(this.node(),e).delay}r(xs,"default");function vf(t,e){return function(){Ze(this,t).duration=+e.apply(this,arguments)}}r(vf,"durationFunction");function xf(t,e){return e=+e,function(){Ze(this,t).duration=e}}r(xf,"durationConstant");function bs(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?vf:xf)(e,t)):Ye(this.node(),e).duration}r(bs,"default");function bf(t,e){if(typeof e!="function")throw new Error;return function(){Ze(this,t).ease=e}}r(bf,"easeConstant");function Cs(t){var e=this._id;return arguments.length?this.each(bf(e,t)):Ye(this.node(),e).ease}r(Cs,"default");function Cf(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Ze(this,t).ease=n}}r(Cf,"easeVarying");function Es(t){if(typeof t!="function")throw new Error;return this.each(Cf(this._id,t))}r(Es,"default");function _s(t){typeof t!="function"&&(t=un(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=o[i]=[],c,u=0;u<a;++u)(c=s[u])&&t.call(c,c.__data__,u,s)&&l.push(c);return new qe(o,this._parents,this._name,this._id)}r(_s,"default");function Ns(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,i=n.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var c=e[l],u=n[l],d=c.length,h=a[l]=new Array(d),f,w=0;w<d;++w)(f=c[w]||u[w])&&(h[w]=f);for(;l<o;++l)a[l]=e[l];return new qe(a,this._parents,this._name,this._id)}r(Ns,"default");function Ef(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}r(Ef,"start");function _f(t,e,n){var o,i,s=Ef(e)?Mo:Ze;return function(){var a=s(this,t),l=a.on;l!==o&&(i=(o=l).copy()).on(e,n),a.on=i}}r(_f,"onFunction");function Ms(t,e){var n=this._id;return arguments.length<2?Ye(this.node(),n).on.on(t):this.each(_f(n,t,e))}r(Ms,"default");function Nf(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}r(Nf,"removeFunction");function Ps(){return this.on("end.remove",Nf(this._id))}r(Ps,"default");function ks(t){var e=this._name,n=this._id;typeof t!="function"&&(t=xt(t));for(var o=this._groups,i=o.length,s=new Array(i),a=0;a<i;++a)for(var l=o[a],c=l.length,u=s[a]=new Array(c),d,h,f=0;f<c;++f)(d=l[f])&&(h=t.call(d,d.__data__,f,l))&&("__data__"in d&&(h.__data__=d.__data__),u[f]=h,ht(u[f],e,n,f,u,Ye(d,n)));return new qe(s,this._parents,e,n)}r(ks,"default");function Is(t){var e=this._name,n=this._id;typeof t!="function"&&(t=cn(t));for(var o=this._groups,i=o.length,s=[],a=[],l=0;l<i;++l)for(var c=o[l],u=c.length,d,h=0;h<u;++h)if(d=c[h]){for(var f=t.call(d,d.__data__,h,c),w,S=Ye(d,n),g=0,y=f.length;g<y;++g)(w=f[g])&&ht(w,e,n,g,f,S);s.push(f),a.push(d)}return new qe(s,a,e,n)}r(Is,"default");var Mf=dt.prototype.constructor;function Os(){return new Mf(this._groups,this._parents)}r(Os,"default");function Pf(t,e){var n,o,i;return function(){var s=bt(this,t),a=(this.style.removeProperty(t),bt(this,t));return s===a?null:s===n&&a===o?i:i=e(n=s,o=a)}}r(Pf,"styleNull");function ll(t){return function(){this.style.removeProperty(t)}}r(ll,"styleRemove");function kf(t,e,n){var o,i=n+"",s;return function(){var a=bt(this,t);return a===i?null:a===o?s:s=e(o=a,n)}}r(kf,"styleConstant");function If(t,e,n){var o,i,s;return function(){var a=bt(this,t),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(t),bt(this,t))),a===c?null:a===o&&c===i?s:(i=c,s=e(o=a,l))}}r(If,"styleFunction");function Of(t,e){var n,o,i,s="style."+e,a="end."+s,l;return function(){var c=Ze(this,t),u=c.on,d=c.value[s]==null?l||(l=ll(e)):void 0;(u!==n||i!==d)&&(o=(n=u).copy()).on(a,i=d),c.on=o}}r(Of,"styleMaybeRemove");function Ds(t,e,n){var o=(t+="")=="transform"?Fa:Po;return e==null?this.styleTween(t,Pf(t,o)).on("end.style."+t,ll(t)):typeof e=="function"?this.styleTween(t,If(t,o,hn(this,"style."+t,e))).each(Of(this._id,t)):this.styleTween(t,kf(t,o,e),n).on("end.style."+t,null)}r(Ds,"default");function Df(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}r(Df,"styleInterpolate");function Af(t,e,n){var o,i;function s(){var a=e.apply(this,arguments);return a!==i&&(o=(i=a)&&Df(t,a,n)),o}return r(s,"tween"),s._value=e,s}r(Af,"styleTween");function As(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,Af(t,e,n??""))}r(As,"default");function Tf(t){return function(){this.textContent=t}}r(Tf,"textConstant");function Rf(t){return function(){var e=t(this);this.textContent=e??""}}r(Rf,"textFunction");function Ts(t){return this.tween("text",typeof t=="function"?Rf(hn(this,"text",t)):Tf(t==null?"":t+""))}r(Ts,"default");function zf(t){return function(e){this.textContent=t.call(this,e)}}r(zf,"textInterpolate");function $f(t){var e,n;function o(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&zf(i)),e}return r(o,"tween"),o._value=t,o}r($f,"textTween");function Rs(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,$f(t))}r(Rs,"default");function zs(){for(var t=this._name,e=this._id,n=dr(),o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,c,u=0;u<l;++u)if(c=a[u]){var d=Ye(c,e);ht(c,t,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new qe(o,this._parents,t,n)}r(zs,"default");function $s(){var t,e,n=this,o=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},c={value:r(function(){--i===0&&s()},"value")};n.each(function(){var u=Ze(this,o),d=u.on;d!==t&&(e=(t=d).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(c)),u.on=e}),i===0&&s()})}r($s,"default");var Lf=0;function qe(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}r(qe,"Transition");function cl(t){return dt().transition(t)}r(cl,"transition");function dr(){return++Lf}r(dr,"newId");var pt=dt.prototype;qe.prototype=cl.prototype={constructor:qe,select:ks,selectAll:Is,selectChild:pt.selectChild,selectChildren:pt.selectChildren,filter:_s,merge:Ns,selection:Os,transition:zs,call:pt.call,nodes:pt.nodes,node:pt.node,size:pt.size,empty:pt.empty,each:pt.each,on:Ms,attr:ws,attrTween:vs,style:Ds,styleTween:As,text:Ts,textTween:Rs,remove:Ps,tween:Ss,delay:xs,duration:bs,ease:Cs,easeVarying:Es,end:$s,[Symbol.iterator]:pt[Symbol.iterator]};function fr(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}r(fr,"cubicInOut");var Hf={time:null,delay:0,duration:250,ease:fr};function Bf(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}r(Bf,"inherit");function Ls(t){var e,n;t instanceof qe?(e=t._id,t=t._name):(e=dr(),(n=Hf).time=Eo(),t=t==null?null:t+"");for(var o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&ht(c,t,e,u,a,n||Bf(c,e));return new qe(o,this._parents,t,e)}r(Ls,"default");dt.prototype.interrupt=ys;dt.prototype.transition=Ls;var ko=r(t=>()=>t,"default");function Hs(t,{sourceEvent:e,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}r(Hs,"ZoomEvent");function nt(t,e,n){this.k=t,this.x=e,this.y=n}r(nt,"Transform");nt.prototype={constructor:nt,scale:r(function(t){return t===1?this:new nt(this.k*t,this.x,this.y)},"scale"),translate:r(function(t,e){return t===0&e===0?this:new nt(this.k,this.x+this.k*t,this.y+this.k*e)},"translate"),apply:r(function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},"apply"),applyX:r(function(t){return t*this.k+this.x},"applyX"),applyY:r(function(t){return t*this.k+this.y},"applyY"),invert:r(function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},"invert"),invertX:r(function(t){return(t-this.x)/this.k},"invertX"),invertY:r(function(t){return(t-this.y)/this.k},"invertY"),rescaleX:r(function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},"rescaleX"),rescaleY:r(function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},"rescaleY"),toString:r(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};var $t=new nt(1,0,0);Io.prototype=nt.prototype;function Io(t){for(;!t.__zoom;)if(!(t=t.parentNode))return $t;return t.__zoom}r(Io,"transform");function hr(t){t.stopImmediatePropagation()}r(hr,"nopropagation");function Lt(t){t.preventDefault(),t.stopImmediatePropagation()}r(Lt,"default");function Ff(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}r(Ff,"defaultFilter");function Vf(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}r(Vf,"defaultExtent");function ul(){return this.__zoom||$t}r(ul,"defaultTransform");function Xf(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}r(Xf,"defaultWheelDelta");function Yf(){return navigator.maxTouchPoints||"ontouchstart"in this}r(Yf,"defaultTouchable");function Wf(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}r(Wf,"defaultConstrain");function Oo(){var t=Ff,e=Vf,n=Wf,o=Xf,i=Yf,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=ln,u=Tt("start","zoom","end"),d,h,f,w=500,S=150,g=0,y=10;function m(v){v.property("__zoom",ul).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",b).on("dblclick.zoom",R).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",I).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}r(m,"zoom"),m.transform=function(v,k,M,T){var A=v.selection?v.selection():v;A.property("__zoom",ul),v!==A?x(v,k,M,T):A.interrupt().each(function(){N(this,arguments).event(T).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},m.scaleBy=function(v,k,M,T){m.scaleTo(v,function(){var A=this.__zoom.k,L=typeof k=="function"?k.apply(this,arguments):k;return A*L},M,T)},m.scaleTo=function(v,k,M,T){m.transform(v,function(){var A=e.apply(this,arguments),L=this.__zoom,X=M==null?p(A):typeof M=="function"?M.apply(this,arguments):M,H=L.invert(X),K=typeof k=="function"?k.apply(this,arguments):k;return n(C(E(L,K),X,H),A,a)},M,T)},m.translateBy=function(v,k,M,T){m.transform(v,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof M=="function"?M.apply(this,arguments):M),e.apply(this,arguments),a)},null,T)},m.translateTo=function(v,k,M,T,A){m.transform(v,function(){var L=e.apply(this,arguments),X=this.__zoom,H=T==null?p(L):typeof T=="function"?T.apply(this,arguments):T;return n($t.translate(H[0],H[1]).scale(X.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof M=="function"?-M.apply(this,arguments):-M),L,a)},T,A)};function E(v,k){return k=Math.max(s[0],Math.min(s[1],k)),k===v.k?v:new nt(k,v.x,v.y)}r(E,"scale");function C(v,k,M){var T=k[0]-M[0]*v.k,A=k[1]-M[1]*v.k;return T===v.x&&A===v.y?v:new nt(v.k,T,A)}r(C,"translate");function p(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}r(p,"centroid");function x(v,k,M,T){v.on("start.zoom",function(){N(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(T).end()}).tween("zoom",function(){var A=this,L=arguments,X=N(A,L).event(T),H=e.apply(A,L),K=M==null?p(H):typeof M=="function"?M.apply(A,L):M,$=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),z=A.__zoom,F=typeof k=="function"?k.apply(A,L):k,V=c(z.invert(K).concat($/z.k),F.invert(K).concat($/F.k));return function(Z){if(Z===1)Z=F;else{var Y=V(Z),W=$/Y[2];Z=new nt(W,K[0]-Y[0]*W,K[1]-Y[1]*W)}X.zoom(null,Z)}})}r(x,"schedule");function N(v,k,M){return!M&&v.__zooming||new _(v,k)}r(N,"gesture");function _(v,k){this.that=v,this.args=k,this.active=0,this.sourceEvent=null,this.extent=e.apply(v,k),this.taps=0}r(_,"Gesture"),_.prototype={event:r(function(v){return v&&(this.sourceEvent=v),this},"event"),start:r(function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},"start"),zoom:r(function(v,k){return this.mouse&&v!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},"zoom"),end:r(function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},"end"),emit:r(function(v){var k=Xe(this.that).datum();u.call(v,this.that,new Hs(v,{sourceEvent:this.sourceEvent,target:m,type:v,transform:this.that.__zoom,dispatch:u}),k)},"emit")};function P(v,...k){if(!t.apply(this,arguments))return;var M=N(this,k).event(v),T=this.__zoom,A=Math.max(s[0],Math.min(s[1],T.k*Math.pow(2,o.apply(this,arguments)))),L=Ue(v);if(M.wheel)(M.mouse[0][0]!==L[0]||M.mouse[0][1]!==L[1])&&(M.mouse[1]=T.invert(M.mouse[0]=L)),clearTimeout(M.wheel);else{if(T.k===A)return;M.mouse=[L,T.invert(L)],Ct(this),M.start()}Lt(v),M.wheel=setTimeout(X,S),M.zoom("mouse",n(C(E(T,A),M.mouse[0],M.mouse[1]),M.extent,a));function X(){M.wheel=null,M.end()}r(X,"wheelidled")}r(P,"wheeled");function b(v,...k){if(f||!t.apply(this,arguments))return;var M=v.currentTarget,T=N(this,k,!0).event(v),A=Xe(v.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",$,!0),L=Ue(v,M),X=v.clientX,H=v.clientY;dn(v.view),hr(v),T.mouse=[L,this.__zoom.invert(L)],Ct(this),T.start();function K(z){if(Lt(z),!T.moved){var F=z.clientX-X,V=z.clientY-H;T.moved=F*F+V*V>g}T.event(z).zoom("mouse",n(C(T.that.__zoom,T.mouse[0]=Ue(z,M),T.mouse[1]),T.extent,a))}r(K,"mousemoved");function $(z){A.on("mousemove.zoom mouseup.zoom",null),go(z.view,T.moved),Lt(z),T.event(z).end()}r($,"mouseupped")}r(b,"mousedowned");function R(v,...k){if(t.apply(this,arguments)){var M=this.__zoom,T=Ue(v.changedTouches?v.changedTouches[0]:v,this),A=M.invert(T),L=M.k*(v.shiftKey?.5:2),X=n(C(E(M,L),T,A),e.apply(this,k),a);Lt(v),l>0?Xe(this).transition().duration(l).call(x,X,T,v):Xe(this).call(m.transform,X,T,v)}}r(R,"dblclicked");function D(v,...k){if(t.apply(this,arguments)){var M=v.touches,T=M.length,A=N(this,k,v.changedTouches.length===T).event(v),L,X,H,K;for(hr(v),X=0;X<T;++X)H=M[X],K=Ue(H,this),K=[K,this.__zoom.invert(K),H.identifier],A.touch0?!A.touch1&&A.touch0[2]!==K[2]&&(A.touch1=K,A.taps=0):(A.touch0=K,L=!0,A.taps=1+!!d);d&&(d=clearTimeout(d)),L&&(A.taps<2&&(h=K[0],d=setTimeout(function(){d=null},w)),Ct(this),A.start())}}r(D,"touchstarted");function O(v,...k){if(this.__zooming){var M=N(this,k).event(v),T=v.changedTouches,A=T.length,L,X,H,K;for(Lt(v),L=0;L<A;++L)X=T[L],H=Ue(X,this),M.touch0&&M.touch0[2]===X.identifier?M.touch0[0]=H:M.touch1&&M.touch1[2]===X.identifier&&(M.touch1[0]=H);if(X=M.that.__zoom,M.touch1){var $=M.touch0[0],z=M.touch0[1],F=M.touch1[0],V=M.touch1[1],Z=(Z=F[0]-$[0])*Z+(Z=F[1]-$[1])*Z,Y=(Y=V[0]-z[0])*Y+(Y=V[1]-z[1])*Y;X=E(X,Math.sqrt(Z/Y)),H=[($[0]+F[0])/2,($[1]+F[1])/2],K=[(z[0]+V[0])/2,(z[1]+V[1])/2]}else if(M.touch0)H=M.touch0[0],K=M.touch0[1];else return;M.zoom("touch",n(C(X,H,K),M.extent,a))}}r(O,"touchmoved");function I(v,...k){if(this.__zooming){var M=N(this,k).event(v),T=v.changedTouches,A=T.length,L,X;for(hr(v),f&&clearTimeout(f),f=setTimeout(function(){f=null},w),L=0;L<A;++L)X=T[L],M.touch0&&M.touch0[2]===X.identifier?delete M.touch0:M.touch1&&M.touch1[2]===X.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(X=Ue(X,this),Math.hypot(h[0]-X[0],h[1]-X[1])<y)){var H=Xe(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return r(I,"touchended"),m.wheelDelta=function(v){return arguments.length?(o=typeof v=="function"?v:ko(+v),m):o},m.filter=function(v){return arguments.length?(t=typeof v=="function"?v:ko(!!v),m):t},m.touchable=function(v){return arguments.length?(i=typeof v=="function"?v:ko(!!v),m):i},m.extent=function(v){return arguments.length?(e=typeof v=="function"?v:ko([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),m):e},m.scaleExtent=function(v){return arguments.length?(s[0]=+v[0],s[1]=+v[1],m):[s[0],s[1]]},m.translateExtent=function(v){return arguments.length?(a[0][0]=+v[0][0],a[1][0]=+v[1][0],a[0][1]=+v[0][1],a[1][1]=+v[1][1],m):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},m.constrain=function(v){return arguments.length?(n=v,m):n},m.duration=function(v){return arguments.length?(l=+v,m):l},m.interpolate=function(v){return arguments.length?(c=v,m):c},m.on=function(){var v=u.on.apply(u,arguments);return v===u?m:v},m.clickDistance=function(v){return arguments.length?(g=(v=+v)*v,m):Math.sqrt(g)},m.tapDistance=function(v){return arguments.length?(y=+v,m):y},m}r(Oo,"default");var Qe={error001:r((t="react")=>`Seems like you have not used ${t==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${t}flow.dev/error#001`,"error001"),error002:r(()=>"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.","error002"),error003:r(t=>`Node type "${t}" not found. Using fallback type "default".`,"error003"),error004:r(()=>"The parent container needs a width and a height to render the graph.","error004"),error005:r(()=>"Only child nodes can use a parent extent.","error005"),error006:r(()=>"Can't create edge. An edge needs a source and a target.","error006"),error007:r(t=>`The old edge with id=${t} does not exist.`,"error007"),error009:r(t=>`Marker type "${t}" doesn't exist.`,"error009"),error008:r((t,{id:e,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:o}", edge id: ${e}.`,"error008"),error010:r(()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","error010"),error011:r(t=>`Edge type "${t}" not found. Using fallback type "default".`,"error011"),error012:r(t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,"error012"),error013:r((t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,"error013"),error014:r(()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.","error014"),error015:r(()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.","error015"),error016:r(t=>`Edge with id "${t}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`,"error016")},Ft=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Zs="5%",Us=["Enter"," ","Escape"],Ks={"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":r(({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"node.a11yDescription.ariaLiveMessage"),"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"},Sr=(function(t){return t.Strict="strict",t.Loose="loose",t})({}),wr=(function(t){return t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal",t})({}),zo=(function(t){return t.Partial="partial",t.Full="full",t})({}),$o={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Pt=(function(t){return t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier",t})({}),vr=(function(t){return t.Arrow="arrow",t.ArrowClosed="arrowclosed",t})({}),Be=(function(t){return t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom",t})({}),dl={left:"right",right:"left",top:"bottom",bottom:"top"},qs=r(t=>!!t&&typeof t=="object"&&"id"in t&&"source"in t&&"target"in t,"isEdgeBase"),Ml=r(t=>!!t&&typeof t=="object"&&"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),"isNodeBase"),Gs=r(t=>!!t&&typeof t=="object"&&"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),"isInternalNodeBase");var xr=r((t,e=[0,0])=>{let{width:n,height:o}=tt(t),i=t.origin??e,s=n*i[0],a=o*i[1];return{x:t.position.x-s,y:t.position.y-a}},"getNodePositionWithOrigin"),Lo=r((t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};let n=!1,o=t.reduce((i,s)=>{let a=typeof s=="string",l=!e.nodeLookup&&!a?s:void 0;return e.nodeLookup&&(l=a?e.nodeLookup.get(s):Gs(s)?s:e.nodeLookup.get(s.id)),l?(n=!0,Er(i,mr(l,e.nodeOrigin))):i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?_r(o):{x:0,y:0,width:0,height:0}},"getNodesBounds"),yn=r((t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return t.forEach(i=>{(e.filter===void 0||e.filter(i))&&(n=Er(n,mr(i)),o=!0)}),o?_r(n):{x:0,y:0,width:0,height:0}},"getInternalNodesBounds"),br=r((t,e,[n,o,i]=[0,0,1],s=!1,a=!1)=>{let l=(e.x-n)/i,c=(e.y-o)/i,u=e.width/i,d=e.height/i,h=[];for(let f of t.values()){let{measured:w,selectable:S=!0,hidden:g=!1}=f;if(a&&!S||g)continue;let y=w.width??f.width??f.initialWidth??0,m=w.height??f.height??f.initialHeight??0,{x:E,y:C}=f.internals.positionAbsolute,p=Il(l,c,u,d,E,C,y,m),x=y*m,N=s&&p>0;(!f.internals.handleBounds||N||p>=x||f.dragging)&&h.push(f)}return h},"getNodesInside");function Zf(t,e){let n=new Map,o=e?.nodes?new Set(e.nodes.map(i=>i.id)):null;return t.forEach(i=>{let s;if(e?.includeHiddenNodes){let{width:a,height:l}=tt(i);s=a>0&&l>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!o||o.has(i.id))&&n.set(i.id,i)}),n}r(Zf,"getFitViewNodes");async function Pl({nodes:t,width:e,height:n,panZoom:o,minZoom:i,maxZoom:s},a){if(t.size===0)return!0;let l=Zf(t,a);if(l.size===0)return!0;let c=yn(l),u=Vt(c,e,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??"5%");return o.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate})}r(Pl,"fitViewport");function js({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:i,onError:s}){let a=n.get(t),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??o,h=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!l)s?.("005",Qe.error005());else{let{width:w,height:S}=tt(l);w&&S&&(h=[[c,u],[c+w,u+S]])}else l&&To(a.extent)&&(h=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);let f=To(h)?Ao(e,h,a.measured):e;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",Qe.error015()),{position:{x:f.x-c+(a.measured.width??0)*d[0],y:f.y-u+(a.measured.height??0)*d[1]},positionAbsolute:f}}r(js,"calculateNodePosition");async function kl({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:o,onBeforeDelete:i}){let s=new Set(t.map(S=>S.id)),a=new Map,l=new Map;for(let S of n)if(S.deletable!==!1&&(s.has(S.id)&&a.set(S.id,S),S.parentId)){let g=l.get(S.parentId)??[];g.push(S),l.set(S.parentId,g)}let c=[...a.keys()];for(let S=0;S<c.length;S++)for(let g of l.get(c[S])??[])a.has(g.id)||(a.set(g.id,g),c.push(g.id));let u=new Set(e.map(S=>S.id)),d=new Map;for(let S of o)S.deletable!==!1&&(a.has(S.source)||a.has(S.target))&&d.set(S.id,S);for(let S of o)S.deletable!==!1&&u.has(S.id)&&!d.has(S.id)&&d.set(S.id,S);let h=n.filter(S=>a.has(S.id)),f=Array.from(d.values());if(!i)return{edges:f,nodes:h};let w=await i({nodes:h,edges:f});return typeof w=="boolean"?w?{edges:f,nodes:h}:{edges:[],nodes:[]}:w}r(kl,"getElementsToRemove");var mn=r((t,e=0,n=1)=>Math.min(Math.max(t,e),n),"clamp"),Ao=r((t={x:0,y:0},e,n)=>({x:mn(t.x,e[0][0],e[1][0]-(n?.width??0)),y:mn(t.y,e[0][1],e[1][1]-(n?.height??0))}),"clampPosition");function Uf(t,e,n){let{width:o,height:i}=tt(n),{x:s,y:a}=n.internals.positionAbsolute;return Ao(t,[[s,a],[s+o,a+i]],e)}r(Uf,"clampPositionToParent");var fl=r((t,e,n)=>t<e?mn(Math.abs(t-e),1,e)/e:t>n?-mn(Math.abs(t-n),1,e)/e:0,"calcAutoPanVelocity"),Cr=r((t,e,n=15,o=40)=>[fl(t.x,o,e.width-o)*n,fl(t.y,o,e.height-o)*n],"calcAutoPan"),Er=r((t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),"getBoundsOfBoxes"),Ws=r(({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),"rectToBox"),_r=r(({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),"boxToRect"),Sn=r((t,e=[0,0])=>{let{x:n,y:o}=Gs(t)?t.internals.positionAbsolute:xr(t,e);return{x:n,y:o,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},"nodeToRect"),mr=r((t,e=[0,0])=>{let{x:n,y:o}=Gs(t)?t.internals.positionAbsolute:xr(t,e);return{x:n,y:o,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:o+(t.measured?.height??t.height??t.initialHeight??0)}},"nodeToBox"),Qs=r((t,e)=>_r(Er(Ws(t),Ws(e))),"getBoundsOfRects"),Il=r((t,e,n,o,i,s,a,l)=>{let c=Math.max(0,Math.min(t+n,i+a)-Math.max(t,i)),u=Math.max(0,Math.min(e+o,s+l)-Math.max(e,s));return Math.ceil(c*u)},"getRectsOverlappingArea"),Ho=r((t,e)=>Il(t.x,t.y,t.width,t.height,e.x,e.y,e.width,e.height),"getOverlappingArea"),Js=r(t=>{if(typeof t!="object"||t===null)return!1;let e=t;return ot(e.width)&&ot(e.height)&&ot(e.x)&&ot(e.y)},"isRectObject"),ot=r(t=>typeof t=="number"&&!isNaN(t)&&isFinite(t),"isNumeric"),ea=r((t,e)=>(n,o)=>{},"createDevWarn"),wn=r((t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),"snapPosition"),Ht=r(({x:t,y:e},[n,o,i],s=!1,a=[1,1])=>{let l={x:(t-n)/i,y:(e-o)/i};return s?wn(l,a):l},"pointToRendererPoint"),Bt=r(({x:t,y:e},[n,o,i])=>({x:t*i+n,y:e*i+o}),"rendererPointToPoint");function pn(t,e){if(typeof t=="number")return Math.floor(t);if(typeof t=="string"&&t.endsWith("px")){let n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){let n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}r(pn,"parsePadding");function Kf(t,e,n){if(typeof t=="string"||typeof t=="number"){let o=pn(t,n),i=pn(t,e);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof t=="object"){let o=pn(t.top??t.y??0,n),i=pn(t.bottom??t.y??0,n),s=pn(t.left??t.x??0,e),a=pn(t.right??t.x??0,e);return{top:o,right:a,bottom:i,left:s,x:s+a,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}r(Kf,"parsePaddings");function qf(t,e,n,o,i,s){let{x:a,y:l}=Bt(t,[e,n,o]),{x:c,y:u}=Bt({x:t.x+t.width,y:t.y+t.height},[e,n,o]),d=i-c,h=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(h)}}r(qf,"calculateAppliedPaddings");var Vt=r((t,e,n,o=0,i=1/0,s=0)=>{let a=Kf(s,e,n),l=(e-a.x)/t.width,c=(n-a.y)/t.height,u=mn(Math.min(l,c),o,i),d=t.x+t.width/2,h=t.y+t.height/2,f=e/2-d*u,w=n/2-h*u,S=qf(t,f,w,u,e,n),g={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:f-g.left+g.right,y:w-g.top+g.bottom,zoom:u}},"getViewportForBounds"),vn=r(()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,"isMacOs");function To(t){return t!=null&&t!=="parent"}r(To,"isCoordinateExtent");function tt(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}r(tt,"getNodeDimensions");function ta(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}r(ta,"nodeHasDimensions");function na(t,e={width:0,height:0},n,o,i){let s={...t},a=o.get(n);if(a){let l=a.origin||i;s.x+=a.internals.positionAbsolute.x-(e.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(e.height??0)*l[1]}return s}r(na,"evaluateAbsolutePosition");function oa(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}r(oa,"areSetsEqual");function Ol(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}r(Ol,"withResolvers");function Dl(t){return{...Ks,...t||{}}}r(Dl,"mergeAriaLabelConfig");function Al(t,e,n){return e?n?`${t}-${e}-${n}`:`${t}-${e}`:t}r(Al,"getConnectionLookupKey");function Tl(t,{nodeId:e,type:n,handleId:o}){return Array.from(t.get(Al(e,n,o))?.values()??[])}r(Tl,"getConnectionsFromLookup");function ra(t){return t===null?null:t?"valid":"invalid"}r(ra,"getConnectionStatus");function hl(t){return t instanceof MouseEvent||Nr(t)}r(hl,"isPointerEvent");function pl(t){return t instanceof WheelEvent}r(pl,"isWheelEvent");function Nr(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent}r(Nr,"isTouchEvent");function gn(t){return t instanceof MouseEvent}r(gn,"isMouseEvent");function gl(t){if(Nr(t)){let e=t.touches[0]??t.changedTouches[0];return[e?.clientX??0,e?.clientY??0]}return[t.clientX,t.clientY]}r(gl,"getTouchPoint");function Do(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o,containerBounds:i}){let{x:s,y:a}=et(t),l=Ht({x:s-(i?.left??0),y:a-(i?.top??0)},o),{x:c,y:u}=n?wn(l,e):l;return{xSnapped:c,ySnapped:u,...l}}r(Do,"getPointerPosition");var Mr=r(t=>({width:t.offsetWidth,height:t.offsetHeight}),"getDimensions"),ia=r(t=>t?.getRootNode?.()||window?.document,"getHostForElement"),Gf=["INPUT","SELECT","TEXTAREA"];function sa(t){let e=t.composedPath?.()?.[0]||t.target;return e?.nodeType!==1?!1:Gf.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}r(sa,"isInputDOMNode");var et=r((t,e)=>{let n=gn(t),o=n?t.clientX:t.touches?.[0].clientX,i=n?t.clientY:t.touches?.[0].clientY;return{x:o-(e?.left??0),y:i-(e?.top??0)}},"getEventPosition"),ml=r((t,e,n,o,i)=>{let s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(a=>{let l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...Mr(a)}})},"getHandleBounds");function Pr({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:l}){let c=t*.125+i*.375+a*.375+n*.125,u=e*.125+s*.375+l*.375+o*.125;return[c,u,Math.abs(c-t),Math.abs(u-e)]}r(Pr,"getBezierEdgeCenter");function pr(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}r(pr,"calculateControlOffset");function yl({pos:t,x1:e,y1:n,x2:o,y2:i,c:s}){switch(t){case"left":return[e-pr(e-o,s),n];case"right":return[e+pr(o-e,s),n];case"top":return[e,n-pr(n-i,s)];case"bottom":return[e,n+pr(i-n,s)]}}r(yl,"getControlWithCurvature");function kr({sourceX:t,sourceY:e,sourcePosition:n="bottom",targetX:o,targetY:i,targetPosition:s="top",curvature:a=.25}){let[l,c]=yl({pos:n,x1:t,y1:e,x2:o,y2:i,c:a}),[u,d]=yl({pos:s,x1:o,y1:i,x2:t,y2:e,c:a}),[h,f,w,S]=Pr({sourceX:t,sourceY:e,targetX:o,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${t},${e} C${l},${c} ${u},${d} ${o},${i}`,h,f,w,S]}r(kr,"getBezierPath");function aa({sourceX:t,sourceY:e,targetX:n,targetY:o}){let i=Math.abs(n-t)/2,s=n<t?n+i:n-i,a=Math.abs(o-e)/2;return[s,o<e?o+a:o-a,i,a]}r(aa,"getEdgeCenter");function Rl({sourceNode:t,targetNode:e,selected:n=!1,zIndex:o=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){return s==="manual"?o:(i&&n?o+1e3:o)+Math.max(t.parentId||i&&t.selected?t.internals.z:0,e.parentId||i&&e.selected?e.internals.z:0)}r(Rl,"getElevatedEdgeZIndex");function zl({sourceNode:t,targetNode:e,width:n,height:o,transform:i}){let s=Er(mr(t),mr(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:o/i[2]};return Ho(a,_r(s))>0}r(zl,"isEdgeVisible");var jf=r(({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`,"getEdgeId"),Qf=r((t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),"connectionExists"),$l=r((t,e,n={})=>{if(!t.source||!t.target)return n.onError?.("006",Qe.error006()),e;let o=n.getEdgeId||jf,i;return qs(t)?i={...t}:i={...t,id:o(t)},Qf(i,e)?e:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,e.concat(i))},"addEdge");function Ir({sourceX:t,sourceY:e,targetX:n,targetY:o}){let[i,s,a,l]=aa({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,i,s,a,l]}r(Ir,"getStraightPath");var Sl={left:{x:-1,y:0},right:{x:1,y:0},top:{x:0,y:-1},bottom:{x:0,y:1}},Jf=r(({source:t,sourcePosition:e="bottom",target:n})=>e==="left"||e==="right"?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},"getDirection"),wl=r((t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),"distance"),eh=r((t,e,n)=>t.x===e.x&&e.x===n.x&&(e.y-t.y)*(n.y-e.y)>=0||t.y===e.y&&e.y===n.y&&(e.x-t.x)*(n.x-e.x)>=0,"isBetween");function th({source:t,sourcePosition:e="bottom",target:n,targetPosition:o="top",center:i,offset:s,stepPosition:a}){let l=Sl[e],c=Sl[o],u={x:t.x+l.x*s,y:t.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},h=Jf({source:u,sourcePosition:e,target:d}),f=h.x!==0?"x":"y",w=h[f],S,g,y,m={x:0,y:0},E={x:0,y:0},[,,C,p]=aa({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(l[f]*c[f]===-1){f==="x"?(g=i.x??u.x+(d.x-u.x)*a,y=i.y??(u.y+d.y)/2):(g=i.x??(u.x+d.x)/2,y=i.y??u.y+(d.y-u.y)*a);let P=[{x:g,y:u.y},{x:g,y:d.y}],b=[{x:u.x,y},{x:d.x,y}];l[f]===w?S=f==="x"?P:b:S=f==="x"?b:P}else{let P=[{x:u.x,y:d.y}],b=[{x:d.x,y:u.y}];if(f==="x"?S=l.x===w?b:P:S=l.y===w?P:b,e===o){let O=Math.abs(t[f]-n[f]);if(O<=s){let I=Math.min(s-1,s-O);l[f]===w?m[f]=(u[f]>t[f]?-1:1)*I:E[f]=(d[f]>n[f]?-1:1)*I}}if(e!==o){let O=f==="x"?"y":"x",I=l[f]===c[O],v=u[O]>d[O],k=u[O]<d[O];(l[f]===1&&(!I&&v||I&&k)||l[f]!==1&&(!I&&k||I&&v))&&(S=f==="x"?P:b)}let R={x:u.x+m.x,y:u.y+m.y},D={x:d.x+E.x,y:d.y+E.y};Math.max(Math.abs(R.x-S[0].x),Math.abs(D.x-S[0].x))>=Math.max(Math.abs(R.y-S[0].y),Math.abs(D.y-S[0].y))?(g=(R.x+D.x)/2,y=S[0].y):(g=S[0].x,y=(R.y+D.y)/2)}let x={x:u.x+m.x,y:u.y+m.y},N={x:d.x+E.x,y:d.y+E.y},_=[];for(let P of[t,x,...S,N,n]){let[b,R]=_.slice(-2);R&&eh(b,R,P)&&_.pop(),_.push(P)}return[_,g,y,C,p]}r(th,"getPoints");function nh(t,e,n,o){let i=Math.min(wl(t,e)/2,wl(e,n)/2,o),{x:s,y:a}=e;if(t.x===s&&s===n.x||t.y===a&&a===n.y)return`L${s} ${a}`;if(t.y===a){let c=t.x<n.x?-1:1,u=t.y<n.y?1:-1;return`L ${s+i*c},${a}Q ${s},${a} ${s},${a+i*u}`}let l=t.x<n.x?1:-1;return`L ${s},${a+i*(t.y<n.y?-1:1)}Q ${s},${a} ${s+i*l},${a}`}r(nh,"getBend");function Bo({sourceX:t,sourceY:e,sourcePosition:n="bottom",targetX:o,targetY:i,targetPosition:s="top",borderRadius:a=5,centerX:l,centerY:c,offset:u=20,stepPosition:d=.5}){let[h,f,w,S,g]=th({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:i},targetPosition:s,center:{x:l,y:c},offset:u,stepPosition:d}),y=`M${h[0].x} ${h[0].y}`;for(let m=1;m<h.length-1;m++)y+=nh(h[m-1],h[m],h[m+1],a);return y+=`L${h[h.length-1].x} ${h[h.length-1].y}`,[y,f,w,S,g]}r(Bo,"getSmoothStepPath");function vl(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}r(vl,"isNodeInitialized");function Ll(t){let{sourceNode:e,targetNode:n}=t;if(!vl(e)||!vl(n))return null;let o=e.internals.handleBounds,i=n.internals.handleBounds,s=xl(o?.source??[],t.sourceHandle),a=xl(t.connectionMode==="strict"?i?.target??[]:(i?.target??[]).concat(i?.source??[]),t.targetHandle);if(!s||!a)return t.onError?.("008",Qe.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;let l=s?.position||"bottom",c=a?.position||"top",u=Mt(e,s,l),d=Mt(n,a,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}r(Ll,"getEdgePosition");function Mt(t,e,n="left",o=!1){let i=(e?.x??0)+t.internals.positionAbsolute.x,s=(e?.y??0)+t.internals.positionAbsolute.y,{width:a,height:l}=e??tt(t);if(o)return{x:i+a/2,y:s+l/2};switch(e?.position??n){case"top":return{x:i+a/2,y:s};case"right":return{x:i+a,y:s+l/2};case"bottom":return{x:i+a/2,y:s+l};case"left":return{x:i,y:s+l/2}}}r(Mt,"getHandlePosition");function xl(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}r(xl,"getHandle$1");function Or(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`:""}r(Or,"getMarkerId");function Hl(t,{id:e,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:i}){let s=new Set;return t.reduce((a,l)=>([l.markerStart||o,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){let u=Or(c,e);s.has(u)||(a.push({id:u,color:c.color||n,...c}),s.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}r(Hl,"createMarkerIds");var Bl=1e3,oh=10,rh={nodeOrigin:[0,0],nodeExtent:Ft,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Fl={...rh,checkEquality:!0};function Vl(t,e){let n={...t};for(let o in e)e[o]!==void 0&&(n[o]=e[o]);return n}r(Vl,"mergeObjects");function Xl(t,e,n=Ft){let o=xr(t,e),i=To(t.extent)?t.extent:n;return Ao(o,i,tt(t))}r(Xl,"getPositionAbsolute");function ih(t,e){if(!t.handles)return t.measured?e?.internals.handleBounds:void 0;let n=[],o=[];for(let i of t.handles){let s={id:i.id,width:i.width??1,height:i.height??1,nodeId:t.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&o.push(s)}return{source:n,target:o}}r(ih,"parseHandles");function la(t){return t==="manual"}r(la,"isManualZIndexMode");function Dr(t,e,n,o={}){let i=Vl(Fl,o),s={i:0},a=new Map(e),l=!!o.defaults?.parentId||t.some(y=>!!y.parentId),c=i?.elevateNodesOnSelect&&!la(i.zIndexMode)?Bl:0,u=new Set,d=new Map,h=t.length>0,f=!1,w=new Set;function S(y){if(w.has(y.id)){let m=e.get(y.id);m&&Object.assign(m,y)}else w.add(y.id),e.set(y.id,y)}r(S,"updateNode"),e.clear(),n.clear();let g={nodeLookup:e,parentLookup:n,options:o,rootParentIndex:s,processedNodes:u,deferredChildNodes:d,updateNode:S};for(let y of t){let m=a.get(y.id);i.checkEquality&&y===m?.internals.userNode?e.set(y.id,m):(m={...i.defaults,...y,measured:{width:y.measured?.width,height:y.measured?.height},internals:{positionAbsolute:Xl(y,i.nodeOrigin,i.nodeExtent),handleBounds:ih(y,m),z:Zl(y,c,i.zIndexMode),userNode:y,isParent:!1}},S(m)),(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(h=!1),l&&Yl(m,g),f||(f=y.selected??!1)}for(let y of a.keys()){let m=e.get(y);m?m.internals.isParent&&!n.has(y)&&S({...m,internals:{...m.internals,isParent:!1}}):w.add(y)}return{nodesInitialized:h,hasSelectedNodes:f,updatedNodes:w}}r(Dr,"adoptUserNodes");function Yl(t,e){let{nodeLookup:n,parentLookup:o,options:i,rootParentIndex:s,processedNodes:a,deferredChildNodes:l,updateNode:c}=e;if(t.parentId&&!a.has(t.parentId)){let d=l.get(t.parentId)??[];d.push(t),l.set(t.parentId,d);return}t.parentId&&Wl(t,n,o,i,s,c),a.add(t.id);let u=l.get(t.id);u&&(l.delete(t.id),u.forEach(d=>Yl(d,e)))}r(Yl,"resolveSubflowsForNode");function sh(t,e,n,o){if(!t.parentId)return;let i=e.get(t.parentId);i?i.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]])),n.internals.isParent||o({...n,internals:{...n.internals,isParent:!0}})}r(sh,"updateParentLookup");function Wl(t,e,n,o,i,s=a=>{e.set(a.id,a)}){let a=Vl(Fl,o),{zIndexMode:l}=a,c=t.parentId,u=e.get(c);if(!u){console.warn(`Parent node ${c} not found.`);return}i&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*oh),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex),sh(ah(t,u,{nodeLookup:e,options:a,updateNode:s}),n,u,s)}r(Wl,"updateChildNode");function ah(t,e,n){let{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:s,zIndexMode:a}=n.options,{x:l,y:c,z:u}=lh(t,e,i,s,o&&!la(a)?Bl:0,a),{positionAbsolute:d}=t.internals,h=l!==d.x||c!==d.y;if(h||u!==t.internals.z){let f={...t,internals:{...t.internals,positionAbsolute:h?{x:l,y:c}:d,z:u}};return n.updateNode(f),f}return t}r(ah,"updateChildXYZ");function Zl(t,e,n){let o=ot(t.zIndex)?t.zIndex:0;return la(n)?o:o+(t.selected?e:0)}r(Zl,"calculateZ");function lh(t,e,n,o,i,s){let{x:a,y:l}=e.internals.positionAbsolute,c=tt(t),u=xr(t,n),d=To(t.extent)?Ao(u,t.extent,c):u,h=Ao({x:a+d.x,y:l+d.y},o,c);t.extent==="parent"&&(h=Uf(h,c,e));let f=Zl(t,i,s),w=e.internals.z??0;return{x:h.x,y:h.y,z:w>=f?w+1:f}}r(lh,"calculateChildXYZ");function Ar(t,e,n,o=[0,0]){let i=[],s=new Map;for(let a of t){let l=e.get(a.parentId);if(!l)continue;let c=s.get(a.parentId)?.expandedRect??Sn(l),u=Qs(c,a.rect);s.set(a.parentId,{expandedRect:u,parent:l})}return s.size>0&&s.forEach(({expandedRect:a,parent:l},c)=>{let u=l.internals.positionAbsolute,d=tt(l),h=l.origin??o,f=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,w=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,S=Math.max(d.width,Math.round(a.width)),g=Math.max(d.height,Math.round(a.height)),y=(S-d.width)*h[0],m=(g-d.height)*h[1];(f>0||w>0||y||m)&&(i.push(yr(c,{x:l.position.x-f+y,y:l.position.y-w+m})),n.get(c)?.forEach(E=>{t.some(C=>C.id===E.id)||i.push(yr(E.id,{x:E.position.x+f,y:E.position.y+w}))})),(d.width<a.width||d.height<a.height||f||w)&&i.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:S+(f?h[0]*f-y:0),height:g+(w?h[1]*w-m:0)}})}),i}r(Ar,"handleExpandParent");function Ul(t,e,n,o,i,s,a){let l=new Set,c=r(y=>{e.set(y.id,y),l.add(y.id)},"updateNode"),u=o?.querySelector(".xyflow__viewport"),d=!1;if(!u)return{changes:[],updatedInternals:d,updatedNodes:l};let h=[],f=window.getComputedStyle(u),{m22:w}=new window.DOMMatrixReadOnly(f.transform),S=[],g=[];for(let y of t.values()){let m=e.get(y.id);if(!m)continue;if(m.hidden){c({...m,internals:{...m.internals,handleBounds:void 0}}),d=!0;continue}let E=Mr(y.nodeElement),C=m.measured.width!==E.width||m.measured.height!==E.height;if(E.width&&E.height&&(C||!m.internals.handleBounds||y.force)){let p=y.nodeElement.getBoundingClientRect(),x={...m,measured:E};c({...x,internals:{...m.internals,positionAbsolute:m.parentId?m.internals.positionAbsolute:Xl(x,i,s),handleBounds:{source:ml("source",y.nodeElement,p,w,m.id),target:ml("target",y.nodeElement,p,w,m.id)}}}),d=!0,C&&(h.push(Th(m.id,E)),m.expandParent&&m.parentId&&g.push(m.id))}}if(d){let y={nodeOrigin:i,nodeExtent:s,zIndexMode:a};for(let m of n.values())for(let E of m.keys()){let C=e.get(E);C&&Wl(C,e,n,y,void 0,p=>c(p))}}for(let y of g){let m=e.get(y);S.push({id:y,parentId:m.parentId,rect:Sn(m,i)})}if(S.length>0){let y=Ar(S,e,n,i);h.push(...y)}return{changes:h,updatedInternals:d,updatedNodes:l}}r(Ul,"updateNodeInternals");async function Kl({delta:t,panZoom:e,transform:n,translateExtent:o,width:i,height:s}){if(!e||!t.x&&!t.y)return!1;let a=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[i,s]],o);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}r(Kl,"panBy");function bl(t,e,n,o,i,s,a){let l=i,c=o.get(l);(!c||!a.has(l))&&(c=new Map(c),a.add(l),o.set(l,c)),c.set(n,e),l=`${i}-${t}`;let u=o.get(l);if((!u||!a.has(l))&&(u=new Map(u),a.add(l),o.set(l,u)),u.set(n,e),s){l=`${i}-${t}-${s}`;let d=o.get(l);(!d||!a.has(l))&&(d=new Map(d),a.add(l),o.set(l,d)),d.set(n,e)}}r(bl,"addConnectionToLookup");function Cl(t,e,n,o,i,s){let a=[o,`${o}-${t}`];i&&a.push(`${o}-${t}-${i}`);for(let l of a){let c=n.get(l);c&&(s.has(l)||(c=new Map(c),n.set(l,c),s.add(l)),c.delete(e),c.size===0&&n.delete(l))}}r(Cl,"removeConnectionFromLookup");function Bs(t,e,n,o){let{source:i,target:s,sourceHandle:a=null,targetHandle:l=null}=e,c={edgeId:e.id,source:i,target:s,sourceHandle:a,targetHandle:l},u=`${i}-${a}--${s}-${l}`,d=`${s}-${l}--${i}-${a}`;n==="add"?(bl("source",c,d,t,i,a,o),bl("target",c,u,t,s,l,o)):(Cl("source",d,t,i,a,o),Cl("target",u,t,s,l,o))}r(Bs,"syncEdgeConnections");function ca(t,e,n){let o=new Map(e),i=new Set,s=new Set,a=[];e.clear();for(let l of n){let c=o.get(l.id);if(c===l){e.set(l.id,l);continue}(!c||c.source!==l.source||c.target!==l.target||c.sourceHandle!=l.sourceHandle||c.targetHandle!=l.targetHandle)&&(c&&Bs(t,c,"remove",s),a.push(l)),e.set(l.id,l),i.add(l.id)}for(let l of o.values())e.has(l.id)||(Bs(t,l,"remove",s),i.add(l.id));for(let l of a)Bs(t,l,"add",s);return{updatedEdges:i}}r(ca,"updateConnectionLookup");function ql(t,e,n,o,i){let s=e.get(t);if(!s){console.warn(`changeParent: Node "${t}" does not exists`);return}if(n===t)return;let a=s.internals.positionAbsolute,l=s.origin??o,c=tt(s),u={x:l[0]*c.width,y:l[1]*c.height};if(n===null){i({nodeId:t,parentId:n,x:a.x+u.x,y:a.y+u.y});return}let d=e.get(n);if(!d){console.warn(`changeParent: Parent node "${n}" does not exists`);return}let h=d.internals.positionAbsolute;i({nodeId:t,parentId:n,x:a.x+u.x-h.x,y:a.y+u.y-h.y})}r(ql,"changeParentNode");function Gl(t,e){if(!t.parentId)return!1;let n=e.get(t.parentId);return n?n.selected?!0:Gl(n,e):!1}r(Gl,"isParentSelected");function El(t,e,n){let o=t;do{if(o?.matches?.(e))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}r(El,"hasSelector");function ch(t,e,n,o,i){let s=new Map;for(let[a,l]of t)if((i?l.id===o:l.selected||l.id===o)&&(i||!l.parentId||!Gl(l,t))&&(l.draggable||e&&typeof l.draggable>"u")){let c=t.get(a);c&&s.set(a,{id:a,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}r(ch,"getDragItems");function Fs({nodeId:t,dragItems:e,nodeLookup:n,dragging:o=!0}){let i=[];for(let[a,l]of e){let c=n.get(a)?.internals.userNode;c&&i.push({...c,position:l.position,dragging:o})}if(!t)return[i[0],i];let s=n.get(t)?.internals.userNode;return[s?{...s,position:e.get(t)?.position||s.position,dragging:o}:i[0],i]}r(Fs,"getEventHandlerParams");function uh({dragItems:t,snapGrid:e,x:n,y:o}){let i=t.values().next().value;if(!i)return null;let s={x:n-i.distance.x,y:o-i.distance.y},a=wn(s,e);return{x:a.x-s.x,y:a.y-s.y}}r(uh,"calculateSnapOffset");function jl({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:o,onDragStop:i}){let s={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d={x:0,y:0},h=null,f=!1,w=null,S=!1,g=!1,y=null,m,E,C,p,x;function N(I){let v=I.view??window,k=r(M=>{M.preventDefault(),M.stopImmediatePropagation()},"suppressClick");v.addEventListener("click",k,{capture:!0}),setTimeout(()=>v.removeEventListener("click",k,{capture:!0}),0)}r(N,"preventNextClick");function _({x:I,y:v}){let{nodeLookup:k,nodeExtent:M,snapGrid:T,snapToGrid:A,nodeOrigin:L,onNodeDrag:X,onSelectionDrag:H,onError:K,updateNodePositions:$}=e();s={x:I,y:v};let z=!1,F=l.size>1,V=F&&M?Ws(yn(l)):null,Z=F&&A?uh({dragItems:l,snapGrid:T,x:I,y:v}):null;for(let[Y,W]of l){if(!k.has(Y))continue;let q={x:I-W.distance.x,y:v-W.distance.y};A&&(q=Z?{x:Math.round(q.x+Z.x),y:Math.round(q.y+Z.y)}:wn(q,T));let G=null;if(F&&M&&!W.extent&&V){let{positionAbsolute:J}=W.internals,ee=J.x-V.x+M[0][0],oe=J.x+W.measured.width-V.x2+M[1][0],ie=J.y-V.y+M[0][1],re=J.y+W.measured.height-V.y2+M[1][1];G=[[ee,ie],[oe,re]]}let{position:j,positionAbsolute:ne}=js({nodeId:Y,nextPosition:q,nodeLookup:k,nodeExtent:G||M,nodeOrigin:L,onError:K});z=z||W.position.x!==j.x||W.position.y!==j.y,W.position=j,W.internals.positionAbsolute=ne}if(g=g||z,!!z&&($(l,!0),y&&(o||X||!p&&H))){let[Y,W]=Fs({nodeId:p,dragItems:l,nodeLookup:k});o?.(y,l,Y,W),X?.(y,Y,W),p||H?.(y,W)}}r(_,"updateNodes");async function P(){if(!h)return;let{transform:I,panBy:v,autoPanSpeed:k,autoPanOnNodeDrag:M}=e();if(!M){c=!1,cancelAnimationFrame(a);return}let[T,A]=Cr(u,h,k);(T!==0||A!==0)&&(s.x=(s.x??0)-T/I[2],s.y=(s.y??0)-A/I[2],await v({x:T,y:A})&&_(s)),a=requestAnimationFrame(()=>{P()})}r(P,"autoPan");function b(I){let{nodeLookup:v,multiSelectionActive:k,nodesDraggable:M,transform:T,snapGrid:A,snapToGrid:L,selectNodesOnDrag:X,onNodeDragStart:H,onSelectionDragStart:K,unselectNodesAndEdges:$}=e();f=!0;let z=!!p&&!k&&!v.get(p)?.selected;(!X||!C)&&!k&&p&&(v.get(p)?.selected||$()),C&&X&&p&&t?.(p);let F=Do(I.sourceEvent,{transform:T,snapGrid:A,snapToGrid:L,containerBounds:h});if(s=F,l=ch(v,M,F,p,z),l.size>0&&(n||H||!p&&K)){let[V,Z]=Fs({nodeId:p,dragItems:l,nodeLookup:v});n?.(I.sourceEvent,l,V,Z),H?.(I.sourceEvent,V,Z),p||K?.(I.sourceEvent,Z)}}r(b,"startDrag");let R=So().clickDistance(1/0).on("start",I=>{let{domNode:v,nodeDragThreshold:k,transform:M,snapGrid:T,snapToGrid:A}=e();h=v?.getBoundingClientRect()||null,f=!1,c=!1,S=!1,g=!1,y=I.sourceEvent,k===0&&b(I),s=Do(I.sourceEvent,{transform:M,snapGrid:T,snapToGrid:A,containerBounds:h}),u=et(I.sourceEvent,h),d=u}).on("drag",I=>{let{autoPanOnNodeDrag:v,transform:k,snapGrid:M,snapToGrid:T,nodeDragThreshold:A,nodeLookup:L}=e();y=I.sourceEvent;let X=Do(y,{transform:k,snapGrid:M,snapToGrid:T,containerBounds:h});if((Nr(y)&&y.type==="touchmove"&&y.touches.length>1||p&&!L.has(p))&&(S=!0),!S){if(!c&&v&&f&&(c=!0,P()),!f){let H=et(I.sourceEvent,h),K=H.x-d.x,$=H.y-d.y;Math.hypot(K,$)>A&&b(I)}(s.x!==X.xSnapped||s.y!==X.ySnapped)&&l&&f&&(u=et(y,h),_(X))}}).on("end",I=>{if((!x?.contains(I.sourceEvent.target)||g)&&N(I.sourceEvent),!f||S){S&&l.size>0&&e().updateNodePositions(l,!1);return}if(cancelAnimationFrame(a),l.size>0){let{nodeLookup:v,updateNodePositions:k,onNodeDragStop:M,onSelectionDragStop:T}=e();if(g&&(k(l,!1),g=!1),i||M||!p&&T){let[A,L]=Fs({nodeId:p,dragItems:l,nodeLookup:v,dragging:!1});i?.(I.sourceEvent,l,A,L),M?.(I.sourceEvent,A,L),p||T?.(I.sourceEvent,L)}}}).filter(I=>{let v=I.target,k=x;return k?!I.button&&(!m||!El(v,`.${m}`,k))&&(!E||El(v,E,k)):!1});function D(I){m=I.noDragClassName,E=I.handleSelector,C=I.isSelectable,p=I.nodeId,I.domNode!==x&&(x=I.domNode,w?.on(".drag",null),w=Xe(x),w.call(R))}r(D,"update");function O(){w?.on(".drag",null),w=null,x=void 0}return r(O,"destroy"),{update:D,destroy:O}}r(jl,"XYDrag");function dh(t,e,n){let o=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(let s of e.values())Ho(i,Sn(s))>0&&o.push(s);return o}r(dh,"getNodesWithinDistance");var fh=250;function hh(t,e,n,o){let i=[],s=1/0,a=dh(t,n,e+fh);for(let l of a){let c=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(let u of c){if(o.nodeId===u.nodeId&&o.type===u.type&&o.id===u.id)continue;let{x:d,y:h}=Mt(l,u,u.position,!0),f=Math.sqrt(Math.pow(d-t.x,2)+Math.pow(h-t.y,2));f>e||(f<s?(i=[{...u,x:d,y:h}],s=f):f===s&&i.push({...u,x:d,y:h}))}}if(!i.length)return null;if(i.length>1){let l=o.type==="source"?"target":"source";return i.find(c=>c.type===l)??i[0]}return i[0]}r(hh,"getClosestHandle");function Ql(t,e,n,o,i,s=!1){let a=o.get(t);if(!a)return null;let l=i==="strict"?a.internals.handleBounds?.[e]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],c=(n?l?.find(u=>u.id===n):l?.[0])??null;return c&&s?{...c,...Mt(a,c,c.position,!0)}:c}r(Ql,"getHandle");function Jl(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}r(Jl,"getHandleType");function ph(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}r(ph,"isConnectionValid");var ec=r(()=>!0,"alwaysValid");function gh(t,{connectionMode:e,connectionRadius:n,handleId:o,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:h,panBy:f,cancelConnection:w,onConnectStart:S,onConnect:g,onConnectEnd:y,isValidConnection:m=ec,onReconnectEnd:E,updateConnection:C,getTransform:p,getFromHandle:x,autoPanSpeed:N,dragThreshold:_=1,handleDomNode:P}){let b=ia(t.target),R=0,D,{x:O,y:I}=et(t),v=Jl(s,P),k=l?.getBoundingClientRect(),M=!1;if(!k||!v)return;let T=Ql(i,v,o,c,e);if(!T)return;let A=et(t,k),L=!1,X=null,H=!1,K=null;function $(){if(!d||!k)return;let[q,G]=Cr(A,k,N);f({x:q,y:G}),R=requestAnimationFrame($)}r($,"autoPan");let z={...T,nodeId:i,type:v,position:T.position},F=c.get(i),V={inProgress:!0,isValid:null,from:Mt(F,z,"left",!0),fromHandle:z,fromPosition:z.position,fromNode:F,to:A,toHandle:null,toPosition:dl[z.position],toNode:null,pointer:A};function Z(){M=!0,C(V),S?.(t,{nodeId:i,handleId:o,handleType:v})}r(Z,"startConnection"),_===0&&Z();function Y(q){if(!M){let{x:oe,y:ie}=et(q),re=oe-O,se=ie-I;if(!(re*re+se*se>_*_))return;Z()}if(!x()||!z){W(q);return}let G=p();A=et(q,k),D=hh(Ht(A,G,!1,[1,1]),n,c,z),L||($(),L=!0);let j=tc(q,{handle:D,connectionMode:e,fromNodeId:i,fromHandleId:o,fromType:a?"target":"source",isValidConnection:m,doc:b,lib:u,flowId:h,nodeLookup:c});K=j.handleDomNode,X=j.connection,H=ph(!!D,j.isValid);let ne=c.get(i),J=ne?Mt(ne,z,"left",!0):V.from,ee={...V,from:J,isValid:H,to:j.toHandle&&H?Bt({x:j.toHandle.x,y:j.toHandle.y},G):A,toHandle:j.toHandle,toPosition:H&&j.toHandle?j.toHandle.position:dl[z.position],toNode:j.toHandle?c.get(j.toHandle.nodeId):null,pointer:A};C(ee),V=ee}r(Y,"onPointerMove");function W(q){if(!("touches"in q&&q.touches.length>0)){if(M){(D||K)&&X&&H&&g?.(X);let{inProgress:G,...j}=V,ne={...j,to:Ht(V.to,p()),toPosition:V.toHandle?V.toPosition:null};y?.(q,ne),s&&E?.(q,ne)}w(),cancelAnimationFrame(R),L=!1,H=!1,X=null,K=null,b.removeEventListener("mousemove",Y),b.removeEventListener("mouseup",W),b.removeEventListener("touchmove",Y),b.removeEventListener("touchend",W)}}r(W,"onPointerUp"),b.addEventListener("mousemove",Y),b.addEventListener("mouseup",W),b.addEventListener("touchmove",Y),b.addEventListener("touchend",W)}r(gh,"onPointerDown");function tc(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=ec,nodeLookup:d}){let h=s==="target",f=e?a.querySelector(`.${l}-flow__handle[data-id="${c}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:w,y:S}=et(t),g=a.elementFromPoint(w,S),y=g?.classList.contains(`${l}-flow__handle`)?g:f,m={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let E=Jl(void 0,y),C=y.getAttribute("data-nodeid"),p=y.getAttribute("data-handleid"),x=y.classList.contains("connectable"),N=y.classList.contains("connectableend");if(!C||!E)return m;let _={source:h?C:o,sourceHandle:h?p:i,target:h?o:C,targetHandle:h?i:p};m.connection=_,m.isValid=x&&N&&(n==="strict"?h&&E==="source"||!h&&E==="target":C!==o||p!==i)&&u(_),m.toHandle=Ql(C,E,p,d,n,!0)}return m}r(tc,"isValidHandle");var Tr={onPointerDown:gh,isValid:tc};function nc({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){let i=Xe(t);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:h=!0,zoomable:f=!0,inversePan:w=!1}){let S=r(C=>{let p=C.sourceEvent;if(!pl(p)||!e)return;let x=n(),N=p.ctrlKey&&vn()?10:1,_=-p.deltaY*(p.deltaMode===1?.05:p.deltaMode?1:.002)*d,P=x[2]*Math.pow(2,_*N);e.scaleTo(P)},"zoomHandler"),g=[0,0],y=r(C=>{let p=C.sourceEvent;hl(p)&&(p.type==="mousedown"||p.type==="touchstart")&&(g=gl(p))},"panStartHandler"),m=r(C=>{let p=n(),x=C.sourceEvent;if(!hl(x)||pl(x)||!e)return;let N=gl(x),_=[N[0]-g[0],N[1]-g[1]];g=N;let P=o()*Math.max(p[2],Math.log(p[2]))*(w?-1:1),b={x:p[0]-_[0]*P,y:p[1]-_[1]*P},R=[[0,0],[c,u]];e.setViewportConstrained({x:b.x,y:b.y,zoom:p[2]},R,l)},"panHandler"),E=Oo().on("start",y).on("zoom",h?m:null).on("zoom.wheel",f?S:null);i.call(E,{})}r(s,"update");function a(){i.on("zoom",null)}return r(a,"destroy"),{update:s,destroy:a,pointer:Ue}}r(nc,"XYMinimap");var Rr=r(t=>({x:t.x,y:t.y,zoom:t.k}),"transformToViewport"),Vs=r(({x:t,y:e,zoom:n})=>$t.translate(t,e).scale(n),"viewportToTransform"),Nt=r((t,e)=>{if(!e)return!1;let n=t.target;return n instanceof Element&&!!n.closest(`.${e}`)},"isWrappedWithClass"),oc=r(t=>t===!0||Array.isArray(t)&&t.includes(0),"isLeftClickPan"),mh=r((t,e)=>e===2&&Array.isArray(t)&&t.includes(2),"isRightClickPan"),yh=r(t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,"defaultEase"),Xs=r((t,e=0,n=yh,o=()=>{})=>{let i=typeof e=="number"&&e>0;return i||o(!0),i?t.transition().duration(e).ease(n).on("end",()=>o(!0)).on("interrupt cancel",()=>o(!1)):t},"getD3Transition"),rc=r(t=>{let e=t.ctrlKey&&vn()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},"wheelDelta");function Sh({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:o,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Nt(d,e))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let h=n.property("__zoom").k||1;if(d.ctrlKey&&a){let y=Ue(d),m=rc(d),E=h*Math.pow(2,m);o.scaleTo(n,E,y,d);return}let f=d.deltaMode===1?20:1,w=i==="vertical"?0:d.deltaX*f,S=i==="horizontal"?0:d.deltaY*f;!vn()&&d.shiftKey&&i!=="vertical"&&(w=d.deltaY*f,S=0),o.translateBy(n,-(w/h)*s,-(S/h)*s,{internal:!0});let g=Rr(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?c?.(d,g):(t.isPanScrolling=!0,l?.(d,g)),t.panScrollTimeout=setTimeout(()=>{u?.(d,g),t.isPanScrolling=!1},150)}}r(Sh,"createPanOnScrollHandler");function wh({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,i){let s=o.type==="wheel",a=!e&&s&&!o.ctrlKey,l=Nt(o,t);if(o.ctrlKey&&s&&l&&o.preventDefault(),a||l)return null;o.preventDefault(),n.call(this,o,i)}}r(wh,"createZoomOnScrollHandler");function ic(t,e,n){let o=t.pointerDrag;!o||o.moveStarted||(o.moveStarted=!0,n?.(e,t.prevViewport))}r(ic,"startMove");function sc(t,e,n,o){let i=t.pointerDrag;i&&(ic(t,e,o),i.dragging=!0,i.isTouch||n(!0))}r(sc,"startPointerDrag");function vh(t){return t?.type==="mousemove"||t?.type==="touchmove"}r(vh,"isPointerMove");function xh(t,e){return"touches"in t?Array.from(t.touches).find(n=>n.identifier===e)??null:t}r(xh,"getPointerPosition$1");function bh({zoomPanValues:t,paneDragThreshold:e,onDraggingChange:n,onPanZoomStart:o}){return i=>{let s=i.sourceEvent;if(!s||s.internal)return;let a=Rr(i.transform);t.mouseButton="button"in s?s.button:0,t.isZoomingOrPanning=!0,t.prevViewport=a,t.pointerDrag=null;let l=s.type==="touchstart";if(s.type==="mousedown"||l){let c=l?s.touches[0]:null,{clientX:u,clientY:d}=c??s;t.pointerDrag={isTouch:l,touchId:c?.identifier??null,startX:u,startY:d,startTransform:i.transform,thresholdCrossed:!1,lastMove:null,moveStarted:!1,dragging:!1},e===0&&sc(t,s,n,o);return}o?.(s,a)}}r(bh,"createPanZoomStartHandler");function Ch({zoomPanValues:t,d3Selection:e,paneDragThreshold:n,onDraggingChange:o,onTransformChange:i,onPanZoomStart:s,onPanZoom:a}){return l=>{let c=l.sourceEvent,u=t.pointerDrag;if(u){let d=vh(c)&&c!==u.lastMove;if(d&&(u.lastMove=c),d&&!u.thresholdCrossed){let h=xh(c,u.touchId),f="touches"in c&&c.touches.length>1;if(!h||f)u.thresholdCrossed=!0;else{let w=h.clientX-u.startX,S=h.clientY-u.startY;u.thresholdCrossed=w*w+S*S>n*n}}if(!u.dragging)if(!d)u.startTransform=l.transform,c?.internal||ic(t,c,s);else if(u.thresholdCrossed)sc(t,c,o,s);else{e.property("__zoom",u.startTransform);return}}c?.sync||i([l.transform.x,l.transform.y,l.transform.k]),a&&!c?.internal&&(!u||u.moveStarted)&&a?.(l.sourceEvent,Rr(l.transform))}}r(Ch,"createPanZoomHandler");function Eh({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(a.sourceEvent?.internal)return;t.isZoomingOrPanning=!1;let l=t.pointerDrag;if(t.pointerDrag=null,s&&mh(e,t.mouseButton??0)&&!l?.thresholdCrossed&&a.sourceEvent&&s(a.sourceEvent),!(l&&!l.moveStarted)&&(o(!1),i)){let c=Rr(a.transform);t.prevViewport=c,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{i?.(a.sourceEvent,c)},n?150:0)}}}r(Eh,"createPanZoomEndHandler");function _h({panActivationKeyPressed:t,zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:o,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:c,noPanClassName:u,lib:d,connectionInProgress:h}){return f=>{let w=e||n,S=o&&f.ctrlKey,g=f.type==="wheel";if((i===!0||Array.isArray(i)&&i.includes(1))&&gn(f)&&f.button===1&&f.type==="mousedown"&&(Nt(f,`${d}-flow__node`)||Nt(f,`${d}-flow__edge`)||Nt(f,`${d}-flow__selection`)||Nt(f,`${d}-flow__nodesselection`)))return!0;if(!i&&!w&&!s&&!a&&!o||l||h&&!g||Nt(f,c)&&g||Nt(f,u)&&(!g||s&&g&&!e)||!o&&f.ctrlKey&&g)return!1;if(!o&&Nr(f)&&f.type==="touchstart"&&f.touches.length>1)return f.preventDefault(),!1;if(!w&&!s&&!S&&g||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&gn(f)&&f.type==="mousedown"&&!i.includes(f.button))return!1;let y=gn(f)?f.button:0,m=Array.isArray(i)&&i.includes(y)||y<=1;return(!f.ctrlKey||g||t)&&m}}r(_h,"createFilter");function ac({domNode:t,minZoom:e,maxZoom:n,translateExtent:o,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){let u={isZoomingOrPanning:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1,pointerDrag:null},d=t.getBoundingClientRect(),h=[[0,0],[d.width,d.height]],f=typeof ResizeObserver<"u"?new ResizeObserver(O=>{let I=O[0];I?.contentRect&&(h=[[0,0],[I.contentRect.width,I.contentRect.height]])}):null;f?.observe(t);let w=Oo().extent(()=>h).scaleExtent([e,n]).translateExtent(o),S=Xe(t).call(w);p({x:i.x,y:i.y,zoom:mn(i.zoom,e,n)},[[0,0],[d.width,d.height]],o);let g=S.on("wheel.zoom"),y=S.on("dblclick.zoom");w.wheelDelta(rc);async function m(O,I){return S?new Promise(v=>{w?.interpolate(I?.interpolate==="linear"?Qo:ln).transform(Xs(S,I?.duration,I?.ease,v),O)}):!1}r(m,"setTransform");function E({noWheelClassName:O,noPanClassName:I,onPaneContextMenu:v,userSelectionActive:k,panOnScroll:M,panOnDrag:T,panOnScrollMode:A,panOnScrollSpeed:L,preventScrolling:X,zoomOnPinch:H,zoomOnScroll:K,zoomOnDoubleClick:$,panActivationKeyPressed:z=!1,zoomActivationKeyPressed:F,lib:V,onTransformChange:Z,connectionInProgress:Y,paneDragThreshold:W}){k&&!u.isZoomingOrPanning&&w.on("zoom",null);let q=M&&!F&&!k,G=ot(W)&&W>0?W:0;w.clickDistance(G);let j=q?Sh({zoomPanValues:u,noWheelClassName:O,d3Selection:S,d3Zoom:w,panOnScrollMode:A,panOnScrollSpeed:L,zoomOnPinch:H,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):wh({noWheelClassName:O,preventScrolling:X,d3ZoomHandler:g});S.on("wheel.zoom",j,{passive:!1});let ne=bh({zoomPanValues:u,paneDragThreshold:G,onDraggingChange:c,onPanZoomStart:a});w.on("start",ne);let J=Ch({zoomPanValues:u,d3Selection:S,paneDragThreshold:G,onPanZoomStart:a,onPanZoom:s,onDraggingChange:c,onTransformChange:Z});w.on("zoom",J);let ee=Eh({zoomPanValues:u,panOnDrag:T,panOnScroll:M,onPaneContextMenu:v,onPanZoomEnd:l,onDraggingChange:c});w.on("end",ee);let oe=_h({panActivationKeyPressed:z,zoomActivationKeyPressed:F,panOnDrag:T,zoomOnScroll:K,panOnScroll:M,zoomOnDoubleClick:$,zoomOnPinch:H,userSelectionActive:k,noPanClassName:I,noWheelClassName:O,lib:V,connectionInProgress:Y});w.filter(oe),$?S.on("dblclick.zoom",y):S.on("dblclick.zoom",null)}r(E,"update");function C(){w.on("zoom",null),f?.disconnect()}r(C,"destroy");async function p(O,I,v){let k=Vs(O),M=w?.constrain()(k,I,v);return M&&await m(M),M}r(p,"setViewportConstrained");async function x(O,I){return m(Vs(O),I)}r(x,"setViewport");function N(O){if(S){let I=Vs(O),v=S.property("__zoom");(v.k!==O.zoom||v.x!==O.x||v.y!==O.y)&&w?.transform(S,I,null,{sync:!0})}}r(N,"syncViewport");function _(){let O=S?Io(S.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}r(_,"getViewport");async function P(O,I){return S?new Promise(v=>{w?.interpolate(I?.interpolate==="linear"?Qo:ln).scaleTo(Xs(S,I?.duration,I?.ease,v),O)}):!1}r(P,"scaleTo");async function b(O,I){return S?new Promise(v=>{w?.interpolate(I?.interpolate==="linear"?Qo:ln).scaleBy(Xs(S,I?.duration,I?.ease,v),O)}):!1}r(b,"scaleBy");function R(O){w?.scaleExtent(O)}r(R,"setScaleExtent");function D(O){w?.translateExtent(O)}return r(D,"setTranslateExtent"),{update:E,destroy:C,setViewport:x,setViewportConstrained:p,getViewport:_,scaleTo:P,scaleBy:b,setScaleExtent:R,setTranslateExtent:D,syncViewport:N}}r(ac,"XYPanZoom");var xn=(function(t){return t.Line="line",t.Handle="handle",t})({});function Nh({width:t,prevWidth:e,height:n,prevHeight:o,affectsX:i,affectsY:s}){let a=t-e,l=n-o,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&i&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}r(Nh,"getResizeDirection");function _l(t){return{isHorizontal:t.includes("right")||t.includes("left"),isVertical:t.includes("bottom")||t.includes("top"),affectsX:t.includes("left"),affectsY:t.includes("top")}}r(_l,"getControlDirection");function Et(t,e){return Math.max(0,e-t)}r(Et,"getLowerExtentClamp");function _t(t,e){return Math.max(0,t-e)}r(_t,"getUpperExtentClamp");function gr(t,e,n){return Math.max(0,e-t,t-n)}r(gr,"getSizeClamp");function Nl(t,e){return t?!e:e}r(Nl,"xor");function Mh(t,e,n,o,i,s,a,l){let{affectsX:c,affectsY:u}=e,{isHorizontal:d,isVertical:h}=e,f=d&&h,{xSnapped:w,ySnapped:S}=n,{minWidth:g,maxWidth:y,minHeight:m,maxHeight:E}=o,{x:C,y:p,width:x,height:N,aspectRatio:_}=t,P=Math.floor(d?w-t.pointerX:0),b=Math.floor(h?S-t.pointerY:0),R=x+(c?-P:P),D=N+(u?-b:b),O=-s[0]*x,I=-s[1]*N,v=gr(R,g,y),k=gr(D,m,E);if(a){let A=0,L=0;c&&P<0?A=Et(C+P+O,a[0][0]):!c&&P>0&&(A=_t(C+R+O,a[1][0])),u&&b<0?L=Et(p+b+I,a[0][1]):!u&&b>0&&(L=_t(p+D+I,a[1][1])),v=Math.max(v,A),k=Math.max(k,L)}if(l){let A=0,L=0;c&&P>0?A=_t(C+P,l[0][0]):!c&&P<0&&(A=Et(C+R,l[1][0])),u&&b>0?L=_t(p+b,l[0][1]):!u&&b<0&&(L=Et(p+D,l[1][1])),v=Math.max(v,A),k=Math.max(k,L)}if(i){if(d){let A=gr(R/_,m,E)*_;if(v=Math.max(v,A),a){let L=!c&&!u||c&&!u&&f?_t(p+I+R/_,a[1][1])*_:Et(p+I+(c?P:-P)/_,a[0][1])*_;v=Math.max(v,L)}if(l){let L=!c&&!u||c&&!u&&f?Et(p+R/_,l[1][1])*_:_t(p+(c?P:-P)/_,l[0][1])*_;v=Math.max(v,L)}}if(h){let A=gr(D*_,g,y)/_;if(k=Math.max(k,A),a){let L=!c&&!u||u&&!c&&f?_t(C+D*_+O,a[1][0])/_:Et(C+(u?b:-b)*_+O,a[0][0])/_;k=Math.max(k,L)}if(l){let L=!c&&!u||u&&!c&&f?Et(C+D*_,l[1][0])/_:_t(C+(u?b:-b)*_,l[0][0])/_;k=Math.max(k,L)}}}b=b+(b<0?k:-k),P=P+(P<0?v:-v),i&&(f?R>D*_?b=(Nl(c,u)?-P:P)/_:P=(Nl(c,u)?-b:b)*_:d?(b=P/_,u=c):(P=b*_,c=u));let M=c?C+P:C,T=u?p+b:p;return{width:x+(c?-P:P),height:N+(u?-b:b),x:s[0]*P*(c?-1:1)+M,y:s[1]*b*(u?-1:1)+T}}r(Mh,"getDimensionsAfterResize");var lc={width:0,height:0,x:0,y:0},Ph={...lc,pointerX:0,pointerY:0,aspectRatio:1};function kh(t,e,n){let o=n.x+t.internals.positionAbsolute.x-e.internals.positionAbsolute.x,i=n.y+t.internals.positionAbsolute.y-e.internals.positionAbsolute.y,s=t.measured.width??0,a=t.measured.height??0;return[[o,i],[o+s,i+a]]}r(kh,"nodeToChildExtent");function cc({domNode:t,nodeId:e,getStoreItems:n,onChange:o,onEnd:i}){let s=Xe(t),a={controlDirection:_l("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:h,resizeDirection:f,onResizeStart:w,onResize:S,onResizeEnd:g,shouldResize:y}){let m={...lc},E={...Ph};a={boundaries:d,resizeDirection:f,keepAspectRatio:h,controlDirection:_l(u)};let C,p=null,x=[],N,_,P,b=So().on("start",R=>{let{nodeLookup:D,transform:O,snapGrid:I,snapToGrid:v,nodeOrigin:k,paneDomNode:M}=n();if(C=D.get(e),!C)return;p=M?.getBoundingClientRect()??null;let{xSnapped:T,ySnapped:A}=Do(R.sourceEvent,{transform:O,snapGrid:I,snapToGrid:v,containerBounds:p}),L=C.measured.width??0,X=C.measured.height??0,H=C.origin??k,K=C.parentId?D.get(C.parentId)?.internals.positionAbsolute:void 0;m={width:L,height:X,x:C.internals.positionAbsolute.x-(K?.x??0)+H[0]*L,y:C.internals.positionAbsolute.y-(K?.y??0)+H[1]*X},E={...m,pointerX:T,pointerY:A,aspectRatio:m.width/m.height},N=void 0,_=To(C.extent)?C.extent:void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(N=D.get(C.parentId)),N&&C.extent==="parent"&&(_=[[0,0],[N.measured.width,N.measured.height]]),x=[],P=void 0;for(let[$,z]of D)if(z.parentId===e&&(x.push({id:$,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){let F=kh(z,C,m);P?P=[[Math.min(F[0][0],P[0][0]),Math.min(F[0][1],P[0][1])],[Math.max(F[1][0],P[1][0]),Math.max(F[1][1],P[1][1])]]:P=F}w?.(R,{...m})}).on("drag",R=>{let{transform:D,snapGrid:O,snapToGrid:I,nodeOrigin:v}=n(),k=Do(R.sourceEvent,{transform:D,snapGrid:O,snapToGrid:I,containerBounds:p}),M=[];if(!C)return;let{x:T,y:A,width:L,height:X}=m,H={},K=C.origin??v,{width:$,height:z,x:F,y:V}=Mh(E,a.controlDirection,k,a.boundaries,a.keepAspectRatio,K,_,P),Z=$!==L,Y=z!==X,W=F!==T&&Z,q=V!==A&&Y;if(!W&&!q&&!Z&&!Y)return;let G={prevValues:{...m},startX:E.x,startY:E.y,childNodes:x.map(J=>({...J,position:{...J.position}}))};if((W||q||K[0]===1||K[1]===1)&&(H.x=W?F:m.x,H.y=q?V:m.y,m.x=H.x,m.y=H.y,x.length>0)){let J=F-T,ee=V-A;for(let oe of x)oe.position={x:oe.position.x-J+K[0]*($-L),y:oe.position.y-ee+K[1]*(z-X)},M.push(oe)}if((Z||Y)&&(H.width=Z&&(!a.resizeDirection||a.resizeDirection==="horizontal")?$:m.width,H.height=Y&&(!a.resizeDirection||a.resizeDirection==="vertical")?z:m.height,m.width=H.width,m.height=H.height),N&&C.expandParent){let J=K[0]*(H.width??0);H.x&&H.x<J&&(m.x=J,E.x=E.x-(H.x-J));let ee=K[1]*(H.height??0);H.y&&H.y<ee&&(m.y=ee,E.y=E.y-(H.y-ee))}let j=Nh({width:m.width,prevWidth:L,height:m.height,prevHeight:X,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),ne={...m,direction:j};if(y?.(R,ne)===!1){m=G.prevValues,E.x=G.startX,E.y=G.startY,x.forEach((J,ee)=>{J.position=G.childNodes[ee].position});return}S?.(R,ne),o(H,M)}).on("end",R=>{g?.(R,{...m}),i?.({...m})});s.call(b)}r(l,"update");function c(){s.on(".drag",null)}return r(c,"destroy"),{update:l,destroy:c}}r(cc,"XYResizer");function Ih(t,e){return uc(t,e,Dh)}r(Ih,"applyNodeChanges");function Oh(t,e){return uc(t,e,Ah)}r(Oh,"applyEdgeChanges");function uc(t,e,n){let o=[],i=e.getNewElements(),s=new Set(i.map(l=>l.id)),a;for(let l of[t,i]){a=!a;e:for(let c of l){if(!a&&!s.has(c.id))continue;let u=e.getForElement(c.id);if(!u.length){o.push(c),s.delete(c.id);continue}let d={...c};for(let h of u)switch(h.type){case"remove":s.delete(c.id);continue e;case"replace":d={...h.item};continue;default:n(d,h)}o.push(d),s.delete(c.id)}}return o}r(uc,"applyChanges");function Dh(t,e){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===!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;case"update":Object.assign(t,e.item);break;case"data":t.data=e.replace?e.data:{...t.data,...e.data};break;default:return}}r(Dh,"applyNodeChange");function Ah(t,e){switch(e.type){case"select":t.selected=e.selected;break;case"update":Object.assign(t,e.item);break;case"data":t.data=e.replace?e.data:{...t.data,...e.data};break;default:return}}r(Ah,"applyEdgeChange");function kt(t,e){return{id:t,type:"select",selected:e}}r(kt,"selectionChange");function yr(t,e){return{id:t,type:"position",position:e}}r(yr,"positionChange");function Th(t,e){return{id:t,type:"dimensions",dimensions:e}}r(Th,"dimensionChange");function zr(t){return{id:t,type:"remove"}}r(zr,"removeChange");function dc(t){return{id:t.id,item:t,type:"add"}}r(dc,"addChange");function fc(t){return{id:t.id,item:t,type:"replace"}}r(fc,"replaceChange");function Ro(t){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(t)}r(Ro,"_typeof");function Rh(t,e){if(Ro(t)!="object"||!t)return t;var n;if(typeof Symbol<"u"&&(n=t[Symbol.toPrimitive])!==void 0){var o=n.call(t,e||"default");if(Ro(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}r(Rh,"toPrimitive");function zh(t){var e=Rh(t,"string");return Ro(e)=="symbol"?e:e+""}r(zh,"toPropertyKey");function Ys(t,e,n){return(e=zh(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}r(Ys,"_defineProperty");var hc;hc=Symbol.iterator;var pc=class{static{r(this,"Changeset")}constructor(t){this.applyChanges=t,Ys(this,"changeTypes",{}),Ys(this,"changeMap",new Map),Ys(this,"addChanges",new Map)}add(t){let e=Array.isArray(t)?t:[t];for(let n of e){if(this.changeTypes[n.type]=!0,n.type==="add"){this.addChanges.set(n.id,n);continue}let o=this.changeMap.get(n.id);o?o.push(n):this.changeMap.set(n.id,[n])}}remove(t){if(t.type==="add"){this.addChanges.get(t.id)===t&&this.addChanges.delete(t.id);return}let e=this.changeMap.get(t.id);if(!e)return;let n=e.indexOf(t);if(!(n<0)){if(e.length===1){this.changeMap.delete(t.id);return}e.splice(n,1)}}getForElement(t){return this.changeMap.get(t)||[]}removeForElement(t){this.changeMap.delete(t),this.addChanges.delete(t)}clear(){this.changeTypes={},this.changeMap.clear(),this.addChanges.clear()}isEmpty(){return this.changeMap.size===0&&this.addChanges.size===0}*[hc](){yield*this.addChanges.values();for(let t of this.changeMap.values())yield*t}getNewElements(){let t=[];for(let e of this.addChanges.values())t.push(e.item);return t}toArray(){let t=[];for(let e of this.addChanges.values())t.push(e);for(let e of this.changeMap.values())for(let n of e)t.push(n);return t}getByType(t){if(this.changeTypes[t]){if(t==="add")return Array.from(this.addChanges.values());let e=[];for(let n of this.changeMap.values())for(let o of n)o.type===t&&e.push(o);return e}return[]}applyTo(t){return this.applyChanges(t,this)}},$r=class extends pc{static{r(this,"NodeChangeset")}constructor(t){super(Ih),t&&this.add(t)}getForNode(t){return this.getForElement(t)}removeForNode(t){this.removeForElement(t)}getNewNodes(){return this.getNewElements()}},Lr=class extends pc{static{r(this,"EdgeChangeset")}constructor(t){super(Oh),t&&this.add(t)}getForEdge(t){return this.getForElement(t)}removeForEdge(t){this.removeForElement(t)}getNewEdges(){return this.getNewElements()}};function Xt(t,e=new Set){let n=[];for(let[,o]of t){let i=e.has(o.id);!(o.selected===void 0&&!i)&&o.selected!==i&&n.push(kt(o.id,i))}return n}r(Xt,"getSelectionChanges");var te=At(xc(),1);function He(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,o;n<t.length;n++)(o=He(t[n]))!==""&&(e+=(e&&" ")+o);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}r(He,"cc");var U=At(jo(),1);var bc=r(t=>{let e,n=new Set,o=r((u,d)=>{let h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){let f=e;e=d??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(w=>w(e,f))}},"setState"),i=r(()=>e,"getState"),l={setState:o,getState:i,getInitialState:r(()=>c,"getInitialState"),subscribe:r(u=>(n.add(u),()=>n.delete(u)),"subscribe")},c=e=t(o,i,l);return l},"createStoreImpl"),Yt=r((t=>t?bc(t):bc),"createStore");var Vr=At(jo(),1);var np=r(t=>t,"identity");function Wt(t,e=np){let n=Vr.default.useSyncExternalStore(t.subscribe,Vr.default.useCallback(()=>e(t.getState()),[t,e]),()=>e(t.getInitialState()));return Vr.default.useDebugValue(n),n}r(Wt,"useStore");var B=At(Ta(),1);var Cc=r(t=>Symbol.iterator in t,"isIterable"),Ec=r(t=>"entries"in t,"hasIterableEntries"),_c=r((t,e)=>{let n=t instanceof Map?t:new Map(t.entries()),o=e instanceof Map?e:new Map(e.entries());if(n.size!==o.size)return!1;for(let[i,s]of n)if(!o.has(i)||!Object.is(s,o.get(i)))return!1;return!0},"compareEntries"),op=r((t,e)=>{let n=t[Symbol.iterator](),o=e[Symbol.iterator](),i=n.next(),s=o.next();for(;!i.done&&!s.done;){if(!Object.is(i.value,s.value))return!1;i=n.next(),s=o.next()}return!!i.done&&!!s.done},"compareIterables");function fa(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Cc(t)&&Cc(e)?Ec(t)&&Ec(e)?_c(t,e):op(t,e):_c({entries:r(()=>Object.entries(t),"entries")},{entries:r(()=>Object.entries(e),"entries")})}r(fa,"shallow");var rp=At(qu(),1);var Sa=(0,U.createContext)(null),ip=Sa.Provider;function sp(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(let[o,i]of t)if(!e.has(o)||!Object.is(i,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(let o of t)if(!e.has(o))return!1;return!0}let n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!Object.is(t[o],e[o]))return!1;return!0}r(sp,"bt");function It(t){let e=(0,te.c)(2),n=(0,U.useRef)(void 0),o;return e[0]===t?o=e[1]:(o=r(i=>{let s=t(i);return sp(n.current,s)?n.current:n.current=s},"i"),e[0]=t,e[1]=o),o}r(It,"xt");var Nn=r(t=>t,"St"),ap=Qe.error001("react");function ue(t){let e=t===void 0?Nn:t,{optionsStore:n}=ye();return Wt(n,e)}r(ue,"Q");function ye(){let t=(0,U.useContext)(Sa);if(t===null)throw Error(ap);return t}r(ye,"$");function rt(t){let e=t===void 0?Nn:t;return Wt(ye().viewportStore,e)}r(rt,"wt");function wa(t){let e=t===void 0?Nn:t;return Wt(ye().connectionStore,e)}r(wa,"Tt");function Ot(t){let e=t===void 0?Nn:t;return Wt(ye().nodesStore,e)}r(Ot,"Et");function va(t){let e=t===void 0?Nn:t;return Wt(ye().edgesStore,e)}r(va,"Dt");function lp(t){let e=t===void 0?Nn:t;return Wt(ye().selectionStore,e)}r(lp,"Ot");function ma(t,e){let n=(0,te.c)(3),o=(0,U.useRef)(),i;return n[0]!==e||n[1]!==t?(i=r(s=>{let a=t(s);return o.current!==void 0&&e(o.current,a)?o.current:(o.current=a,a)},"a"),n[0]=e,n[1]=t,n[2]=i):i=n[2],i}r(ma,"kt");var Nc={display:"none"},cp={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Jc="react-flow__node-desc",eu="react-flow__edge-desc";function up(t){let e=(0,te.c)(3),{rfId:n}=t,o=ue(dp),i=`react-flow__aria-live-${n}`,s;return e[0]!==o||e[1]!==i?(s=(0,B.jsx)("div",{id:i,"aria-live":"assertive","aria-atomic":"true",style:cp,children:o}),e[0]=o,e[1]=i,e[2]=s):s=e[2],s}r(up,"Pt");function dp(t){return t.ariaLiveMessage}r(dp,"Ft");function fp(t){let e=(0,te.c)(13),{rfId:n,disableKeyboardA11y:o}=t,i=ue(hp),s=`${Jc}-${n}`,a=o?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"],l;e[0]!==s||e[1]!==a?(l=(0,B.jsx)("div",{id:s,style:Nc,children:a}),e[0]=s,e[1]=a,e[2]=l):l=e[2];let c=`${eu}-${n}`,u=i["edge.a11yDescription.default"],d;e[3]!==c||e[4]!==u?(d=(0,B.jsx)("div",{id:c,style:Nc,children:u}),e[3]=c,e[4]=u,e[5]=d):d=e[5];let h;e[6]!==o||e[7]!==n?(h=!o&&(0,B.jsx)(up,{rfId:n}),e[6]=o,e[7]=n,e[8]=h):h=e[8];let f;return e[9]!==l||e[10]!==d||e[11]!==h?(f=(0,B.jsxs)(B.Fragment,{children:[l,d,h]}),e[9]=l,e[10]=d,e[11]=h,e[12]=f):f=e[12],f}r(fp,"It");function hp(t){return t.ariaLabelConfig}r(hp,"Lt");var Mn=(0,U.forwardRef)((t,e)=>{let n=(0,te.c)(15),o,i,s,a,l;n[0]===t?(o=n[1],i=n[2],s=n[3],a=n[4],l=n[5]):({position:l,children:o,className:i,style:a,...s}=t,n[0]=t,n[1]=o,n[2]=i,n[3]=s,n[4]=a,n[5]=l);let c=l===void 0?"top-left":l,u;if(n[6]!==i||n[7]!==c){let h=`${c}`.split("-");u=He(["react-flow__panel",i,...h]),n[6]=i,n[7]=c,n[8]=u}else u=n[8];let d;return n[9]!==o||n[10]!==e||n[11]!==s||n[12]!==a||n[13]!==u?(d=(0,B.jsx)("div",{className:u,style:a,ref:e,...s,children:o}),n[9]=o,n[10]=e,n[11]=s,n[12]=a,n[13]=u,n[14]=d):d=n[14],d});Mn.displayName="Panel";var Mc="https://reactflow.dev?utm_source=attribution";function pp(t){let e=(0,te.c)(4),{proOptions:n,position:o}=t,i=o===void 0?"bottom-right":o,s;if(e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0],(0,U.useEffect)(gp,s),n?.hideAttribution)return null;let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,B.jsx)("a",{href:Mc,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"}),e[1]=a):a=e[1];let l;return e[2]===i?l=e[3]:(l=(0,B.jsx)(Mn,{position:i,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Mc}`,children:a}),e[2]=i,e[3]=l),l}r(pp,"Bt");function gp(){}r(gp,"Vt");var Pc=r(t=>{let e=[];for(let[,n]of t.nodeLookup)n.selected&&e.push(n.internals.userNode);return e},"Ht"),kc=r(t=>{let e=[];for(let[,n]of t.edgeLookup)n.selected&&e.push(n);return e},"Ut"),Ic=r(t=>t.id,"Wt");function Oc(t,e){return fa(t.map(Ic),e.map(Ic))}r(Oc,"Gt");function mp(t){let e=(0,te.c)(12),{onSelectionChange:n}=t,{optionsStore:o,nodesStore:i,edgesStore:s}=ye(),a=Ot(ma(Pc,Oc)),l=va(ma(kc,Oc)),c;e[0]!==s||e[1]!==i||e[2]!==n||e[3]!==o?(c=r(()=>{let d={nodes:Pc(i.getState()),edges:kc(s.getState())};n?.(d),o.getState().onSelectionChangeHandlers.forEach(h=>h(d))},"l"),e[0]=s,e[1]=i,e[2]=n,e[3]=o,e[4]=c):c=e[4];let u;return e[5]!==s||e[6]!==i||e[7]!==n||e[8]!==o||e[9]!==l||e[10]!==a?(u=[a,l,n,o,i,s],e[5]=s,e[6]=i,e[7]=n,e[8]=o,e[9]=l,e[10]=a,e[11]=u):u=e[11],(0,U.useEffect)(c,u),null}r(mp,"Kt");var yp=r(t=>t.onSelectionChangeHandlers.length>0,"qt");function Sp(t){let e=(0,te.c)(2),{onSelectionChange:n}=t,o=ue(yp);if(n||o){let i;return e[0]===n?i=e[1]:(i=(0,B.jsx)(mp,{onSelectionChange:n}),e[0]=n,e[1]=i),i}return null}r(Sp,"Jt");var tu=[0,0],wp={x:0,y:0,zoom:1},Dc=[..."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".split("."),"rfId"],Ac={translateExtent:Ft,nodeOrigin:tu,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function vp(t){let{optionsStore:e}=ye(),n=(0,U.useRef)(Ac);return(0,U.useEffect)(()=>{let{setDefaultNodesAndEdges:o,reset:i}=e.getState();return o(t.defaultNodes,t.defaultEdges),()=>{n.current=Ac,i()}},[]),(0,U.useEffect)(()=>{let{setNodes:o,setEdges:i,setMinZoom:s,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:c}=e.getState();for(let u of Dc){let d=t[u];d!==n.current[u]&&t[u]!==void 0&&(u==="nodes"?o(d):u==="edges"?i(d):u==="minZoom"?s(d):u==="maxZoom"?a(d):u==="translateExtent"?l(d):u==="nodeExtent"?c(d):u==="ariaLabelConfig"?e.setState({ariaLabelConfig:Dl(d)}):u==="fitView"?e.setState({fitViewQueued:d}):u==="fitViewOptions"?e.setState({fitViewOptions:d}):e.setState({[u]:d}))}n.current=t},Dc.map(o=>t[o])),null}r(vp,"$t");var Tc=typeof document<"u"?document:null;function Xo(t,e){let n=(0,te.c)(12),o=t===void 0?null:t,i;n[0]===e?i=n[1]:(i=e===void 0?{target:Tc,actInsideInputWithModifier:!0}:e,n[0]=e,n[1]=i);let s=i,[a,l]=(0,U.useState)(!1),c=(0,U.useRef)(!1),u;n[2]===Symbol.for("react.memo_cache_sentinel")?(u=new Set([]),n[2]=u):u=n[2];let d=(0,U.useRef)(u),h;n[3]===o?h=n[4]:(h=xp(o),n[3]=o,n[4]=h);let[f,w]=h,S;n[5]!==o||n[6]!==f||n[7]!==w||n[8]!==s?(S=r(()=>{let y=s?.target??Tc,m=s?.actInsideInputWithModifier??!0;if(o!==null){let E=r(x=>{if(c.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!c.current||c.current&&!m)&&sa(x))return!1;let N=zc(x.code,w);if(d.current.add(x[N]),Rc(f,d.current,!1)){let _=x.composedPath?.()?.[0]||x.target,P=_?.nodeName==="BUTTON"||_?.nodeName==="A";s.preventDefault!==!1&&(c.current||!P)&&x.preventDefault(),l(!0)}},"n"),C=r(x=>{let N=zc(x.code,w);Rc(f,d.current,!0)?(l(!1),d.current.clear()):d.current.delete(x[N]),x.key==="Meta"&&d.current.clear(),c.current=!1},"r"),p=r(()=>{d.current.clear(),l(!1)},"i");return y?.addEventListener("keydown",E),y?.addEventListener("keyup",C),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{y?.removeEventListener("keydown",E),y?.removeEventListener("keyup",C),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},"h"),n[5]=o,n[6]=f,n[7]=w,n[8]=s,n[9]=S):S=n[9];let g;return n[10]===o?g=n[11]:(g=[o,l],n[10]=o,n[11]=g),(0,U.useEffect)(S,g),a}r(Xo,"tn");function xp(t){if(t!==null){let e=(Array.isArray(t)?t:[t]).filter(n=>typeof n=="string").map(n=>n.replace(/\+/g,`
|
|
1
|
+
import{a as Pi,b as ki,c as Ha,d as Ba,e as Qo,g as Fa,h as Va,i as ln}from"./chunk-Y2YLTUMD.js";import{a as Xa,b as Ya,c as Wa,f as Jo}from"./chunk-6CVUGL2K.js";import{e as $a,k as La}from"./chunk-2NUCBQFU.js";import{a as qu}from"./chunk-4AG356VE.js";import{B as za,b as Go,j as Ra,s as Mi}from"./chunk-7EUM7G2I.js";import{a as jo,b as Ta}from"./chunk-ADABTCDI.js";import{a as r,b as Ku,d as At}from"./chunk-5PEAXTYQ.js";var xc=Ku((Px,vc)=>{"use no memo";"use strict";var $h=Object.create,Fr=Object.defineProperty,Lh=Object.getOwnPropertyDescriptor,Hh=Object.getOwnPropertyNames,Bh=Object.getPrototypeOf,Fh=Object.prototype.hasOwnProperty,Vh=r((t,e)=>{for(var n in e)Fr(t,n,{get:e[n],enumerable:!0})},"__export"),Sc=r((t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Hh(e))!Fh.call(t,i)&&i!==n&&Fr(t,i,{get:r(()=>e[i],"get"),enumerable:!(o=Lh(e,i))||o.enumerable});return t},"__copyProps"),Xh=r((t,e,n)=>(n=t!=null?$h(Bh(t)):{},Sc(e||!t||!t.__esModule?Fr(n,"default",{value:t,enumerable:!0}):n,t)),"__toESM"),Yh=r(t=>Sc(Fr({},"__esModule",{value:!0}),t),"__toCommonJS"),wc={};Vh(wc,{$dispatcherGuard:r(()=>Kh,"$dispatcherGuard"),$makeReadOnly:r(()=>Gh,"$makeReadOnly"),$reset:r(()=>qh,"$reset"),$structuralCheck:r(()=>tp,"$structuralCheck"),c:r(()=>Uh,"c"),clearRenderCounterRegistry:r(()=>jh,"clearRenderCounterRegistry"),renderCounterRegistry:r(()=>Vo,"renderCounterRegistry"),useRenderCounter:r(()=>ep,"useRenderCounter")});vc.exports=Yh(wc);var En=Xh(jo()),{useRef:Wh,useEffect:Zh,isValidElement:bn}=En,gc,ua=(gc=En.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)!=null?gc:En.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,da=Symbol.for("react.memo_cache_sentinel"),mc,Uh=typeof((mc=En.__COMPILER_RUNTIME)==null?void 0:mc.c)=="function"?En.__COMPILER_RUNTIME.c:r(function(e){return En.useMemo(()=>{let n=new Array(e);for(let o=0;o<e;o++)n[o]=da;return n[da]=!0,n},[])},"c2"),Br={};["readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","getCacheSignal","getCacheForType","useCacheRefresh"].forEach(t=>{Br[t]=()=>{throw new Error(`[React] Unexpected React hook call (${t}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var Fo=null;Br.useMemoCache=t=>{if(Fo==null)throw new Error("React Compiler internal invariant violation: unexpected null dispatcher");return Fo.useMemoCache(t)};function Hr(t){return ua.ReactCurrentDispatcher.current=t,ua.ReactCurrentDispatcher.current}r(Hr,"setCurrent");var Cn=[];function Kh(t){let e=ua.ReactCurrentDispatcher.current;if(t===0){if(Cn.push(e),Cn.length===1&&(Fo=e),e===Br)throw new Error("[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.");Hr(Br)}else if(t===1){let n=Cn.pop();if(n==null)throw new Error("React Compiler internal error: unexpected null in guard stack");Cn.length===0&&(Fo=null),Hr(n)}else if(t===2)Cn.push(e),Hr(Fo);else if(t===3){let n=Cn.pop();if(n==null)throw new Error("React Compiler internal error: unexpected null in guard stack");Hr(n)}else throw new Error("React Compiler internal error: unreachable block"+t)}r(Kh,"$dispatcherGuard");function qh(t){for(let e=0;e<t.length;e++)t[e]=da}r(qh,"$reset");function Gh(){throw new Error("TODO: implement $makeReadOnly in react-compiler-runtime")}r(Gh,"$makeReadOnly");var Vo=new Map;function jh(){for(let t of Vo.values())t.forEach(e=>{e.count=0})}r(jh,"clearRenderCounterRegistry");function Qh(t,e){let n=Vo.get(t);n==null&&(n=new Set,Vo.set(t,n)),n.add(e)}r(Qh,"registerRenderCounter");function Jh(t,e){let n=Vo.get(t);n?.delete(e)}r(Jh,"removeRenderCounter");function ep(t){let e=Wh(null);e.current!=null&&(e.current.count+=1),Zh(()=>{if(e.current==null){let n={count:0};Qh(t,n),e.current=n}return()=>{e.current!==null&&Jh(t,e.current)}})}r(ep,"useRenderCounter");var yc=new Set;function tp(t,e,n,o,i,s){function a(u,d,h,f){let w=`${o}:${s} [${i}] ${n}${h} changed from ${u} to ${d} at depth ${f}`;yc.has(w)||(yc.add(w),console.error(w))}r(a,"error");let l=2;function c(u,d,h,f){if(!(f>l)){if(u===d)return;if(typeof u!=typeof d)a(`type ${typeof u}`,`type ${typeof d}`,h,f);else if(typeof u=="object"){let w=Array.isArray(u),S=Array.isArray(d);if(u===null&&d!==null)a("null",`type ${typeof d}`,h,f);else if(d===null)a(`type ${typeof u}`,"null",h,f);else if(u instanceof Map)if(!(d instanceof Map))a("Map instance","other value",h,f);else if(u.size!==d.size)a(`Map instance with size ${u.size}`,`Map instance with size ${d.size}`,h,f);else for(let[g,y]of u)d.has(g)?c(y,d.get(g),`${h}.get(${g})`,f+1):a(`Map instance with key ${g}`,`Map instance without key ${g}`,h,f);else if(d instanceof Map)a("other value","Map instance",h,f);else if(u instanceof Set)if(!(d instanceof Set))a("Set instance","other value",h,f);else if(u.size!==d.size)a(`Set instance with size ${u.size}`,`Set instance with size ${d.size}`,h,f);else for(let g of d)u.has(g)||a(`Set instance without element ${g}`,`Set instance with element ${g}`,h,f);else if(d instanceof Set)a("other value","Set instance",h,f);else if(w||S)if(w!==S)a(`type ${w?"array":"object"}`,`type ${S?"array":"object"}`,h,f);else if(u.length!==d.length)a(`array with length ${u.length}`,`array with length ${d.length}`,h,f);else for(let g=0;g<u.length;g++)c(u[g],d[g],`${h}[${g}]`,f+1);else if(bn(u)||bn(d))bn(u)!==bn(d)?a(`type ${bn(u)?"React element":"object"}`,`type ${bn(d)?"React element":"object"}`,h,f):u.type!==d.type?a(`React element of type ${u.type}`,`React element of type ${d.type}`,h,f):c(u.props,d.props,`[props of ${h}]`,f+1);else{for(let g in d)g in u||a(`object without key ${g}`,`object with key ${g}`,h,f);for(let g in u)g in d?c(u[g],d[g],`${h}.${g}`,f+1):a(`object with key ${g}`,`object without key ${g}`,h,f)}}else{if(typeof u=="function")return;isNaN(u)||isNaN(d)?isNaN(u)!==isNaN(d)&&a(`${isNaN(u)?"NaN":"non-NaN value"}`,`${isNaN(d)?"NaN":"non-NaN value"}`,h,f):u!==d&&a(u,d,h,f)}}}r(c,"recur"),c(t,e,"",0)}r(tp,"$structuralCheck")});var Gu={value:r(()=>{},"value")};function Ua(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new er(n)}r(Ua,"dispatch");function er(t){this._=t}r(er,"Dispatch");function ju(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}r(ju,"parseTypenames");er.prototype=Ua.prototype={constructor:er,on:r(function(t,e){var n=this._,o=ju(t+"",n),i,s=-1,a=o.length;if(arguments.length<2){for(;++s<a;)if((i=(t=o[s]).type)&&(i=Qu(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(i=(t=o[s]).type)n[i]=Za(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Za(n[i],t.name,null);return this},"on"),copy:r(function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new er(t)},"copy"),call:r(function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,s;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],o=0,i=s.length;o<i;++o)s[o].value.apply(e,n)},"call"),apply:r(function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],i=0,s=o.length;i<s;++i)o[i].value.apply(e,n)},"apply")};function Qu(t,e){for(var n=0,o=t.length,i;n<o;++n)if((i=t[n]).name===e)return i.value}r(Qu,"get");function Za(t,e,n){for(var o=0,i=t.length;o<i;++o)if(t[o].name===e){t[o]=Gu,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}r(Za,"set");var Tt=Ua;var tr="http://www.w3.org/1999/xhtml",Ii={svg:"http://www.w3.org/2000/svg",xhtml:tr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function at(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Ii.hasOwnProperty(e)?{space:Ii[e],local:t}:t}r(at,"default");function Ju(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===tr&&e.documentElement.namespaceURI===tr?e.createElement(t):e.createElementNS(n,t)}}r(Ju,"creatorInherit");function ed(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}r(ed,"creatorFixed");function uo(t){var e=at(t);return(e.local?ed:Ju)(e)}r(uo,"default");function td(){}r(td,"none");function xt(t){return t==null?td:function(){return this.querySelector(t)}}r(xt,"default");function Oi(t){typeof t!="function"&&(t=xt(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=o[i]=new Array(a),c,u,d=0;d<a;++d)(c=s[d])&&(u=t.call(c,c.__data__,d,s))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new Le(o,this._parents)}r(Oi,"default");function Di(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}r(Di,"array");function nd(){return[]}r(nd,"empty");function cn(t){return t==null?nd:function(){return this.querySelectorAll(t)}}r(cn,"default");function od(t){return function(){return Di(t.apply(this,arguments))}}r(od,"arrayAll");function Ai(t){typeof t=="function"?t=od(t):t=cn(t);for(var e=this._groups,n=e.length,o=[],i=[],s=0;s<n;++s)for(var a=e[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&(o.push(t.call(c,c.__data__,u,a)),i.push(c));return new Le(o,i)}r(Ai,"default");function un(t){return function(){return this.matches(t)}}r(un,"default");function nr(t){return function(e){return e.matches(t)}}r(nr,"childMatcher");var rd=Array.prototype.find;function id(t){return function(){return rd.call(this.children,t)}}r(id,"childFind");function sd(){return this.firstElementChild}r(sd,"childFirst");function Ti(t){return this.select(t==null?sd:id(typeof t=="function"?t:nr(t)))}r(Ti,"default");var ad=Array.prototype.filter;function ld(){return Array.from(this.children)}r(ld,"children");function cd(t){return function(){return ad.call(this.children,t)}}r(cd,"childrenFilter");function Ri(t){return this.selectAll(t==null?ld:cd(typeof t=="function"?t:nr(t)))}r(Ri,"default");function zi(t){typeof t!="function"&&(t=un(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=o[i]=[],c,u=0;u<a;++u)(c=s[u])&&t.call(c,c.__data__,u,s)&&l.push(c);return new Le(o,this._parents)}r(zi,"default");function fo(t){return new Array(t.length)}r(fo,"default");function $i(){return new Le(this._enter||this._groups.map(fo),this._parents)}r($i,"default");function ho(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}r(ho,"EnterNode");ho.prototype={constructor:ho,appendChild:r(function(t){return this._parent.insertBefore(t,this._next)},"appendChild"),insertBefore:r(function(t,e){return this._parent.insertBefore(t,e)},"insertBefore"),querySelector:r(function(t){return this._parent.querySelector(t)},"querySelector"),querySelectorAll:r(function(t){return this._parent.querySelectorAll(t)},"querySelectorAll")};function Li(t){return function(){return t}}r(Li,"default");function ud(t,e,n,o,i,s){for(var a=0,l,c=e.length,u=s.length;a<u;++a)(l=e[a])?(l.__data__=s[a],o[a]=l):n[a]=new ho(t,s[a]);for(;a<c;++a)(l=e[a])&&(i[a]=l)}r(ud,"bindIndex");function dd(t,e,n,o,i,s,a){var l,c,u=new Map,d=e.length,h=s.length,f=new Array(d),w;for(l=0;l<d;++l)(c=e[l])&&(f[l]=w=a.call(c,c.__data__,l,e)+"",u.has(w)?i[l]=c:u.set(w,c));for(l=0;l<h;++l)w=a.call(t,s[l],l,s)+"",(c=u.get(w))?(o[l]=c,c.__data__=s[l],u.delete(w)):n[l]=new ho(t,s[l]);for(l=0;l<d;++l)(c=e[l])&&u.get(f[l])===c&&(i[l]=c)}r(dd,"bindKey");function fd(t){return t.__data__}r(fd,"datum");function Hi(t,e){if(!arguments.length)return Array.from(this,fd);var n=e?dd:ud,o=this._parents,i=this._groups;typeof t!="function"&&(t=Li(t));for(var s=i.length,a=new Array(s),l=new Array(s),c=new Array(s),u=0;u<s;++u){var d=o[u],h=i[u],f=h.length,w=hd(t.call(d,d&&d.__data__,u,o)),S=w.length,g=l[u]=new Array(S),y=a[u]=new Array(S),m=c[u]=new Array(f);n(d,h,g,y,m,w,e);for(var E=0,C=0,p,x;E<S;++E)if(p=g[E]){for(E>=C&&(C=E+1);!(x=y[C])&&++C<S;);p._next=x||null}}return a=new Le(a,o),a._enter=l,a._exit=c,a}r(Hi,"default");function hd(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}r(hd,"arraylike");function Bi(){return new Le(this._exit||this._groups.map(fo),this._parents)}r(Bi,"default");function Fi(t,e,n){var o=this.enter(),i=this,s=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?s.remove():n(s),o&&i?o.merge(i).order():i}r(Fi,"default");function Vi(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,i=n.length,s=o.length,a=Math.min(i,s),l=new Array(i),c=0;c<a;++c)for(var u=n[c],d=o[c],h=u.length,f=l[c]=new Array(h),w,S=0;S<h;++S)(w=u[S]||d[S])&&(f[S]=w);for(;c<i;++c)l[c]=n[c];return new Le(l,this._parents)}r(Vi,"default");function Xi(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],i=o.length-1,s=o[i],a;--i>=0;)(a=o[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}r(Xi,"default");function Yi(t){t||(t=pd);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}r(e,"compareNode");for(var n=this._groups,o=n.length,i=new Array(o),s=0;s<o;++s){for(var a=n[s],l=a.length,c=i[s]=new Array(l),u,d=0;d<l;++d)(u=a[d])&&(c[d]=u);c.sort(e)}return new Le(i,this._parents).order()}r(Yi,"default");function pd(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}r(pd,"ascending");function Wi(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}r(Wi,"default");function Zi(){return Array.from(this)}r(Zi,"default");function Ui(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,s=o.length;i<s;++i){var a=o[i];if(a)return a}return null}r(Ui,"default");function Ki(){let t=0;for(let e of this)++t;return t}r(Ki,"default");function qi(){return!this.node()}r(qi,"default");function Gi(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&t.call(l,l.__data__,s,i);return this}r(Gi,"default");function gd(t){return function(){this.removeAttribute(t)}}r(gd,"attrRemove");function md(t){return function(){this.removeAttributeNS(t.space,t.local)}}r(md,"attrRemoveNS");function yd(t,e){return function(){this.setAttribute(t,e)}}r(yd,"attrConstant");function Sd(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}r(Sd,"attrConstantNS");function wd(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}r(wd,"attrFunction");function vd(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}r(vd,"attrFunctionNS");function ji(t,e){var n=at(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?md:gd:typeof e=="function"?n.local?vd:wd:n.local?Sd:yd)(n,e))}r(ji,"default");function po(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}r(po,"default");function xd(t){return function(){this.style.removeProperty(t)}}r(xd,"styleRemove");function bd(t,e,n){return function(){this.style.setProperty(t,e,n)}}r(bd,"styleConstant");function Cd(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}r(Cd,"styleFunction");function Qi(t,e,n){return arguments.length>1?this.each((e==null?xd:typeof e=="function"?Cd:bd)(t,e,n??"")):bt(this.node(),t)}r(Qi,"default");function bt(t,e){return t.style.getPropertyValue(e)||po(t).getComputedStyle(t,null).getPropertyValue(e)}r(bt,"styleValue");function Ed(t){return function(){delete this[t]}}r(Ed,"propertyRemove");function _d(t,e){return function(){this[t]=e}}r(_d,"propertyConstant");function Nd(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}r(Nd,"propertyFunction");function Ji(t,e){return arguments.length>1?this.each((e==null?Ed:typeof e=="function"?Nd:_d)(t,e)):this.node()[t]}r(Ji,"default");function Ka(t){return t.trim().split(/^|\s+/)}r(Ka,"classArray");function es(t){return t.classList||new qa(t)}r(es,"classList");function qa(t){this._node=t,this._names=Ka(t.getAttribute("class")||"")}r(qa,"ClassList");qa.prototype={add:r(function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:r(function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:r(function(t){return this._names.indexOf(t)>=0},"contains")};function Ga(t,e){for(var n=es(t),o=-1,i=e.length;++o<i;)n.add(e[o])}r(Ga,"classedAdd");function ja(t,e){for(var n=es(t),o=-1,i=e.length;++o<i;)n.remove(e[o])}r(ja,"classedRemove");function Md(t){return function(){Ga(this,t)}}r(Md,"classedTrue");function Pd(t){return function(){ja(this,t)}}r(Pd,"classedFalse");function kd(t,e){return function(){(e.apply(this,arguments)?Ga:ja)(this,t)}}r(kd,"classedFunction");function ts(t,e){var n=Ka(t+"");if(arguments.length<2){for(var o=es(this.node()),i=-1,s=n.length;++i<s;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?kd:e?Md:Pd)(n,e))}r(ts,"default");function Id(){this.textContent=""}r(Id,"textRemove");function Od(t){return function(){this.textContent=t}}r(Od,"textConstant");function Dd(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}r(Dd,"textFunction");function ns(t){return arguments.length?this.each(t==null?Id:(typeof t=="function"?Dd:Od)(t)):this.node().textContent}r(ns,"default");function Ad(){this.innerHTML=""}r(Ad,"htmlRemove");function Td(t){return function(){this.innerHTML=t}}r(Td,"htmlConstant");function Rd(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}r(Rd,"htmlFunction");function os(t){return arguments.length?this.each(t==null?Ad:(typeof t=="function"?Rd:Td)(t)):this.node().innerHTML}r(os,"default");function zd(){this.nextSibling&&this.parentNode.appendChild(this)}r(zd,"raise");function rs(){return this.each(zd)}r(rs,"default");function $d(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}r($d,"lower");function is(){return this.each($d)}r(is,"default");function ss(t){var e=typeof t=="function"?t:uo(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}r(ss,"default");function Ld(){return null}r(Ld,"constantNull");function as(t,e){var n=typeof t=="function"?t:uo(t),o=e==null?Ld:typeof e=="function"?e:xt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}r(as,"default");function Hd(){var t=this.parentNode;t&&t.removeChild(this)}r(Hd,"remove");function ls(){return this.each(Hd)}r(ls,"default");function Bd(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}r(Bd,"selection_cloneShallow");function Fd(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}r(Fd,"selection_cloneDeep");function cs(t){return this.select(t?Fd:Bd)}r(cs,"default");function us(t){return arguments.length?this.property("__data__",t):this.node().__data__}r(us,"default");function Vd(t){return function(e){t.call(this,e,this.__data__)}}r(Vd,"contextListener");function Xd(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}r(Xd,"parseTypenames");function Yd(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,i=e.length,s;n<i;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++o]=s;++o?e.length=o:delete this.__on}}}r(Yd,"onRemove");function Wd(t,e,n){return function(){var o=this.__on,i,s=Vd(e);if(o){for(var a=0,l=o.length;a<l;++a)if((i=o[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=e;return}}this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},o?o.push(i):this.__on=[i]}}r(Wd,"onAdd");function ds(t,e,n){var o=Xd(t+""),i,s=o.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(i=0,d=l[c];i<s;++i)if((a=o[i]).type===d.type&&a.name===d.name)return d.value}return}for(l=e?Wd:Yd,i=0;i<s;++i)this.each(l(o[i],e,n));return this}r(ds,"default");function Qa(t,e,n){var o=po(t),i=o.CustomEvent;typeof i=="function"?i=new i(e,n):(i=o.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}r(Qa,"dispatchEvent");function Zd(t,e){return function(){return Qa(this,t,e)}}r(Zd,"dispatchConstant");function Ud(t,e){return function(){return Qa(this,t,e.apply(this,arguments))}}r(Ud,"dispatchFunction");function fs(t,e){return this.each((typeof e=="function"?Ud:Zd)(t,e))}r(fs,"default");function*hs(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,s=o.length,a;i<s;++i)(a=o[i])&&(yield a)}r(hs,"default");var ps=[null];function Le(t,e){this._groups=t,this._parents=e}r(Le,"Selection");function Ja(){return new Le([[document.documentElement]],ps)}r(Ja,"selection");function Kd(){return this}r(Kd,"selection_selection");Le.prototype=Ja.prototype={constructor:Le,select:Oi,selectAll:Ai,selectChild:Ti,selectChildren:Ri,filter:zi,data:Hi,enter:$i,exit:Bi,join:Fi,merge:Vi,selection:Kd,order:Xi,sort:Yi,call:Wi,nodes:Zi,node:Ui,size:Ki,empty:qi,each:Gi,attr:ji,style:Qi,property:Ji,classed:ts,text:ns,html:os,raise:rs,lower:is,append:ss,insert:as,remove:ls,clone:cs,datum:us,on:ds,dispatch:fs,[Symbol.iterator]:hs};var dt=Ja;function Xe(t){return typeof t=="string"?new Le([[document.querySelector(t)]],[document.documentElement]):new Le([[t]],ps)}r(Xe,"default");function gs(t){let e;for(;e=t.sourceEvent;)t=e;return t}r(gs,"default");function Ue(t,e){if(t=gs(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}r(Ue,"default");var el={passive:!1},Rt={capture:!0,passive:!1};function or(t){t.stopImmediatePropagation()}r(or,"nopropagation");function ft(t){t.preventDefault(),t.stopImmediatePropagation()}r(ft,"default");function dn(t){var e=t.document.documentElement,n=Xe(t).on("dragstart.drag",ft,Rt);"onselectstart"in e?n.on("selectstart.drag",ft,Rt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}r(dn,"default");function go(t,e){var n=t.document.documentElement,o=Xe(t).on("dragstart.drag",null);e&&(o.on("click.drag",ft,Rt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}r(go,"yesdrag");var mo=r(t=>()=>t,"default");function yo(t,{sourceEvent:e,subject:n,target:o,identifier:i,active:s,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}r(yo,"DragEvent");yo.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function qd(t){return!t.ctrlKey&&!t.button}r(qd,"defaultFilter");function Gd(){return this.parentNode}r(Gd,"defaultContainer");function jd(t,e){return e??{x:t.x,y:t.y}}r(jd,"defaultSubject");function Qd(){return navigator.maxTouchPoints||"ontouchstart"in this}r(Qd,"defaultTouchable");function So(){var t=qd,e=Gd,n=jd,o=Qd,i={},s=Tt("start","drag","end"),a=0,l,c,u,d,h=0;function f(p){p.on("mousedown.drag",w).filter(o).on("touchstart.drag",y).on("touchmove.drag",m,el).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}r(f,"drag");function w(p,x){if(!(d||!t.call(this,p,x))){var N=C(this,e.call(this,p,x),p,x,"mouse");N&&(Xe(p.view).on("mousemove.drag",S,Rt).on("mouseup.drag",g,Rt),dn(p.view),or(p),u=!1,l=p.clientX,c=p.clientY,N("start",p))}}r(w,"mousedowned");function S(p){if(ft(p),!u){var x=p.clientX-l,N=p.clientY-c;u=x*x+N*N>h}i.mouse("drag",p)}r(S,"mousemoved");function g(p){Xe(p.view).on("mousemove.drag mouseup.drag",null),go(p.view,u),ft(p),i.mouse("end",p)}r(g,"mouseupped");function y(p,x){if(t.call(this,p,x)){var N=p.changedTouches,_=e.call(this,p,x),P=N.length,b,R;for(b=0;b<P;++b)(R=C(this,_,p,x,N[b].identifier,N[b]))&&(or(p),R("start",p,N[b]))}}r(y,"touchstarted");function m(p){var x=p.changedTouches,N=x.length,_,P;for(_=0;_<N;++_)(P=i[x[_].identifier])&&(ft(p),P("drag",p,x[_]))}r(m,"touchmoved");function E(p){var x=p.changedTouches,N=x.length,_,P;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),_=0;_<N;++_)(P=i[x[_].identifier])&&(or(p),P("end",p,x[_]))}r(E,"touchended");function C(p,x,N,_,P,b){var R=s.copy(),D=Ue(b||N,x),O,I,v;if((v=n.call(p,new yo("beforestart",{sourceEvent:N,target:f,identifier:P,active:a,x:D[0],y:D[1],dx:0,dy:0,dispatch:R}),_))!=null)return O=v.x-D[0]||0,I=v.y-D[1]||0,r(function k(M,T,A){var L=D,X;switch(M){case"start":i[P]=k,X=a++;break;case"end":delete i[P],--a;case"drag":D=Ue(A||T,x),X=a;break}R.call(M,p,new yo(M,{sourceEvent:T,subject:v,target:f,identifier:P,active:X,x:D[0]+O,y:D[1]+I,dx:D[0]-L[0],dy:D[1]-L[1],dispatch:R}),_)},"gesture")}return r(C,"beforestart"),f.filter=function(p){return arguments.length?(t=typeof p=="function"?p:mo(!!p),f):t},f.container=function(p){return arguments.length?(e=typeof p=="function"?p:mo(p),f):e},f.subject=function(p){return arguments.length?(n=typeof p=="function"?p:mo(p),f):n},f.touchable=function(p){return arguments.length?(o=typeof p=="function"?p:mo(!!p),f):o},f.on=function(){var p=s.on.apply(s,arguments);return p===s?f:p},f.clickDistance=function(p){return arguments.length?(h=(p=+p)*p,f):Math.sqrt(h)},f}r(So,"default");var fn=0,vo=0,wo=0,nl=1e3,rr,xo,ir=0,zt=0,sr=0,bo=typeof performance=="object"&&performance.now?performance:Date,ol=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Eo(){return zt||(ol(Jd),zt=bo.now()+sr)}r(Eo,"now");function Jd(){zt=0}r(Jd,"clearNow");function Co(){this._call=this._time=this._next=null}r(Co,"Timer");Co.prototype=ar.prototype={constructor:Co,restart:r(function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Eo():+n)+(e==null?0:+e),!this._next&&xo!==this&&(xo?xo._next=this:rr=this,xo=this),this._call=t,this._time=n,ms()},"restart"),stop:r(function(){this._call&&(this._call=null,this._time=1/0,ms())},"stop")};function ar(t,e,n){var o=new Co;return o.restart(t,e,n),o}r(ar,"timer");function rl(){Eo(),++fn;for(var t=rr,e;t;)(e=zt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--fn}r(rl,"timerFlush");function tl(){zt=(ir=bo.now())+sr,fn=vo=0;try{rl()}finally{fn=0,tf(),zt=0}}r(tl,"wake");function ef(){var t=bo.now(),e=t-ir;e>nl&&(sr-=e,ir=t)}r(ef,"poke");function tf(){for(var t,e=rr,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:rr=n);xo=t,ms(o)}r(tf,"nap");function ms(t){if(!fn){vo&&(vo=clearTimeout(vo));var e=t-zt;e>24?(t<1/0&&(vo=setTimeout(tl,t-bo.now()-sr)),wo&&(wo=clearInterval(wo))):(wo||(ir=bo.now(),wo=setInterval(ef,nl)),fn=1,ol(tl))}}r(ms,"sleep");function _o(t,e,n){var o=new Co;return e=e==null?0:+e,o.restart(i=>{o.stop(),t(i+e)},e,n),o}r(_o,"default");var nf=Tt("start","end","cancel","interrupt"),of=[],al=0,il=1,cr=2,lr=3,sl=4,ur=5,No=6;function ht(t,e,n,o,i,s){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;rf(t,n,{name:e,index:o,group:i,on:nf,tween:of,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:al})}r(ht,"default");function Mo(t,e){var n=Ye(t,e);if(n.state>al)throw new Error("too late; already scheduled");return n}r(Mo,"init");function Ze(t,e){var n=Ye(t,e);if(n.state>lr)throw new Error("too late; already running");return n}r(Ze,"set");function Ye(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}r(Ye,"get");function rf(t,e,n){var o=t.__transition,i;o[e]=n,n.timer=ar(s,0,n.time);function s(u){n.state=il,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}r(s,"schedule");function a(u){var d,h,f,w;if(n.state!==il)return c();for(d in o)if(w=o[d],w.name===n.name){if(w.state===lr)return _o(a);w.state===sl?(w.state=No,w.timer.stop(),w.on.call("interrupt",t,t.__data__,w.index,w.group),delete o[d]):+d<e&&(w.state=No,w.timer.stop(),w.on.call("cancel",t,t.__data__,w.index,w.group),delete o[d])}if(_o(function(){n.state===lr&&(n.state=sl,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=cr,n.on.call("start",t,t.__data__,n.index,n.group),n.state===cr){for(n.state=lr,i=new Array(f=n.tween.length),d=0,h=-1;d<f;++d)(w=n.tween[d].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=w);i.length=h+1}}r(a,"start");function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=ur,1),h=-1,f=i.length;++h<f;)i[h].call(t,d);n.state===ur&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}r(l,"tick");function c(){n.state=No,n.timer.stop(),delete o[e];for(var u in o)return;delete t.__transition}r(c,"stop")}r(rf,"create");function Ct(t,e){var n=t.__transition,o,i,s=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((o=n[a]).name!==e){s=!1;continue}i=o.state>cr&&o.state<ur,o.state=No,o.timer.stop(),o.on.call(i?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[a]}s&&delete t.__transition}}r(Ct,"default");function ys(t){return this.each(function(){Ct(this,t)})}r(ys,"default");function sf(t,e){var n,o;return function(){var i=Ze(this,t),s=i.tween;if(s!==n){o=n=s;for(var a=0,l=o.length;a<l;++a)if(o[a].name===e){o=o.slice(),o.splice(a,1);break}}i.tween=o}}r(sf,"tweenRemove");function af(t,e,n){var o,i;if(typeof n!="function")throw new Error;return function(){var s=Ze(this,t),a=s.tween;if(a!==o){i=(o=a).slice();for(var l={name:e,value:n},c=0,u=i.length;c<u;++c)if(i[c].name===e){i[c]=l;break}c===u&&i.push(l)}s.tween=i}}r(af,"tweenFunction");function Ss(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=Ye(this.node(),n).tween,i=0,s=o.length,a;i<s;++i)if((a=o[i]).name===t)return a.value;return null}return this.each((e==null?sf:af)(n,t,e))}r(Ss,"default");function hn(t,e,n){var o=t._id;return t.each(function(){var i=Ze(this,o);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Ye(i,o).value[e]}}r(hn,"tweenValue");function Po(t,e){var n;return(typeof e=="number"?Ha:e instanceof Pi?ki:(n=Pi(e))?(e=n,ki):Ba)(t,e)}r(Po,"default");function lf(t){return function(){this.removeAttribute(t)}}r(lf,"attrRemove");function cf(t){return function(){this.removeAttributeNS(t.space,t.local)}}r(cf,"attrRemoveNS");function uf(t,e,n){var o,i=n+"",s;return function(){var a=this.getAttribute(t);return a===i?null:a===o?s:s=e(o=a,n)}}r(uf,"attrConstant");function df(t,e,n){var o,i=n+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===o?s:s=e(o=a,n)}}r(df,"attrConstantNS");function ff(t,e,n){var o,i,s;return function(){var a,l=n(this),c;return l==null?void this.removeAttribute(t):(a=this.getAttribute(t),c=l+"",a===c?null:a===o&&c===i?s:(i=c,s=e(o=a,l)))}}r(ff,"attrFunction");function hf(t,e,n){var o,i,s;return function(){var a,l=n(this),c;return l==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),c=l+"",a===c?null:a===o&&c===i?s:(i=c,s=e(o=a,l)))}}r(hf,"attrFunctionNS");function ws(t,e){var n=at(t),o=n==="transform"?Va:Po;return this.attrTween(t,typeof e=="function"?(n.local?hf:ff)(n,o,hn(this,"attr."+t,e)):e==null?(n.local?cf:lf)(n):(n.local?df:uf)(n,o,e))}r(ws,"default");function pf(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}r(pf,"attrInterpolate");function gf(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}r(gf,"attrInterpolateNS");function mf(t,e){var n,o;function i(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&gf(t,s)),n}return r(i,"tween"),i._value=e,i}r(mf,"attrTweenNS");function yf(t,e){var n,o;function i(){var s=e.apply(this,arguments);return s!==o&&(n=(o=s)&&pf(t,s)),n}return r(i,"tween"),i._value=e,i}r(yf,"attrTween");function vs(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=at(t);return this.tween(n,(o.local?mf:yf)(o,e))}r(vs,"default");function Sf(t,e){return function(){Mo(this,t).delay=+e.apply(this,arguments)}}r(Sf,"delayFunction");function wf(t,e){return e=+e,function(){Mo(this,t).delay=e}}r(wf,"delayConstant");function xs(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Sf:wf)(e,t)):Ye(this.node(),e).delay}r(xs,"default");function vf(t,e){return function(){Ze(this,t).duration=+e.apply(this,arguments)}}r(vf,"durationFunction");function xf(t,e){return e=+e,function(){Ze(this,t).duration=e}}r(xf,"durationConstant");function bs(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?vf:xf)(e,t)):Ye(this.node(),e).duration}r(bs,"default");function bf(t,e){if(typeof e!="function")throw new Error;return function(){Ze(this,t).ease=e}}r(bf,"easeConstant");function Cs(t){var e=this._id;return arguments.length?this.each(bf(e,t)):Ye(this.node(),e).ease}r(Cs,"default");function Cf(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Ze(this,t).ease=n}}r(Cf,"easeVarying");function Es(t){if(typeof t!="function")throw new Error;return this.each(Cf(this._id,t))}r(Es,"default");function _s(t){typeof t!="function"&&(t=un(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var s=e[i],a=s.length,l=o[i]=[],c,u=0;u<a;++u)(c=s[u])&&t.call(c,c.__data__,u,s)&&l.push(c);return new qe(o,this._parents,this._name,this._id)}r(_s,"default");function Ns(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,i=n.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var c=e[l],u=n[l],d=c.length,h=a[l]=new Array(d),f,w=0;w<d;++w)(f=c[w]||u[w])&&(h[w]=f);for(;l<o;++l)a[l]=e[l];return new qe(a,this._parents,this._name,this._id)}r(Ns,"default");function Ef(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}r(Ef,"start");function _f(t,e,n){var o,i,s=Ef(e)?Mo:Ze;return function(){var a=s(this,t),l=a.on;l!==o&&(i=(o=l).copy()).on(e,n),a.on=i}}r(_f,"onFunction");function Ms(t,e){var n=this._id;return arguments.length<2?Ye(this.node(),n).on.on(t):this.each(_f(n,t,e))}r(Ms,"default");function Nf(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}r(Nf,"removeFunction");function Ps(){return this.on("end.remove",Nf(this._id))}r(Ps,"default");function ks(t){var e=this._name,n=this._id;typeof t!="function"&&(t=xt(t));for(var o=this._groups,i=o.length,s=new Array(i),a=0;a<i;++a)for(var l=o[a],c=l.length,u=s[a]=new Array(c),d,h,f=0;f<c;++f)(d=l[f])&&(h=t.call(d,d.__data__,f,l))&&("__data__"in d&&(h.__data__=d.__data__),u[f]=h,ht(u[f],e,n,f,u,Ye(d,n)));return new qe(s,this._parents,e,n)}r(ks,"default");function Is(t){var e=this._name,n=this._id;typeof t!="function"&&(t=cn(t));for(var o=this._groups,i=o.length,s=[],a=[],l=0;l<i;++l)for(var c=o[l],u=c.length,d,h=0;h<u;++h)if(d=c[h]){for(var f=t.call(d,d.__data__,h,c),w,S=Ye(d,n),g=0,y=f.length;g<y;++g)(w=f[g])&&ht(w,e,n,g,f,S);s.push(f),a.push(d)}return new qe(s,a,e,n)}r(Is,"default");var Mf=dt.prototype.constructor;function Os(){return new Mf(this._groups,this._parents)}r(Os,"default");function Pf(t,e){var n,o,i;return function(){var s=bt(this,t),a=(this.style.removeProperty(t),bt(this,t));return s===a?null:s===n&&a===o?i:i=e(n=s,o=a)}}r(Pf,"styleNull");function ll(t){return function(){this.style.removeProperty(t)}}r(ll,"styleRemove");function kf(t,e,n){var o,i=n+"",s;return function(){var a=bt(this,t);return a===i?null:a===o?s:s=e(o=a,n)}}r(kf,"styleConstant");function If(t,e,n){var o,i,s;return function(){var a=bt(this,t),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(t),bt(this,t))),a===c?null:a===o&&c===i?s:(i=c,s=e(o=a,l))}}r(If,"styleFunction");function Of(t,e){var n,o,i,s="style."+e,a="end."+s,l;return function(){var c=Ze(this,t),u=c.on,d=c.value[s]==null?l||(l=ll(e)):void 0;(u!==n||i!==d)&&(o=(n=u).copy()).on(a,i=d),c.on=o}}r(Of,"styleMaybeRemove");function Ds(t,e,n){var o=(t+="")=="transform"?Fa:Po;return e==null?this.styleTween(t,Pf(t,o)).on("end.style."+t,ll(t)):typeof e=="function"?this.styleTween(t,If(t,o,hn(this,"style."+t,e))).each(Of(this._id,t)):this.styleTween(t,kf(t,o,e),n).on("end.style."+t,null)}r(Ds,"default");function Df(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}r(Df,"styleInterpolate");function Af(t,e,n){var o,i;function s(){var a=e.apply(this,arguments);return a!==i&&(o=(i=a)&&Df(t,a,n)),o}return r(s,"tween"),s._value=e,s}r(Af,"styleTween");function As(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,Af(t,e,n??""))}r(As,"default");function Tf(t){return function(){this.textContent=t}}r(Tf,"textConstant");function Rf(t){return function(){var e=t(this);this.textContent=e??""}}r(Rf,"textFunction");function Ts(t){return this.tween("text",typeof t=="function"?Rf(hn(this,"text",t)):Tf(t==null?"":t+""))}r(Ts,"default");function zf(t){return function(e){this.textContent=t.call(this,e)}}r(zf,"textInterpolate");function $f(t){var e,n;function o(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&zf(i)),e}return r(o,"tween"),o._value=t,o}r($f,"textTween");function Rs(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,$f(t))}r(Rs,"default");function zs(){for(var t=this._name,e=this._id,n=dr(),o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,c,u=0;u<l;++u)if(c=a[u]){var d=Ye(c,e);ht(c,t,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new qe(o,this._parents,t,n)}r(zs,"default");function $s(){var t,e,n=this,o=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},c={value:r(function(){--i===0&&s()},"value")};n.each(function(){var u=Ze(this,o),d=u.on;d!==t&&(e=(t=d).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(c)),u.on=e}),i===0&&s()})}r($s,"default");var Lf=0;function qe(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}r(qe,"Transition");function cl(t){return dt().transition(t)}r(cl,"transition");function dr(){return++Lf}r(dr,"newId");var pt=dt.prototype;qe.prototype=cl.prototype={constructor:qe,select:ks,selectAll:Is,selectChild:pt.selectChild,selectChildren:pt.selectChildren,filter:_s,merge:Ns,selection:Os,transition:zs,call:pt.call,nodes:pt.nodes,node:pt.node,size:pt.size,empty:pt.empty,each:pt.each,on:Ms,attr:ws,attrTween:vs,style:Ds,styleTween:As,text:Ts,textTween:Rs,remove:Ps,tween:Ss,delay:xs,duration:bs,ease:Cs,easeVarying:Es,end:$s,[Symbol.iterator]:pt[Symbol.iterator]};function fr(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}r(fr,"cubicInOut");var Hf={time:null,delay:0,duration:250,ease:fr};function Bf(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}r(Bf,"inherit");function Ls(t){var e,n;t instanceof qe?(e=t._id,t=t._name):(e=dr(),(n=Hf).time=Eo(),t=t==null?null:t+"");for(var o=this._groups,i=o.length,s=0;s<i;++s)for(var a=o[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&ht(c,t,e,u,a,n||Bf(c,e));return new qe(o,this._parents,t,e)}r(Ls,"default");dt.prototype.interrupt=ys;dt.prototype.transition=Ls;var ko=r(t=>()=>t,"default");function Hs(t,{sourceEvent:e,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}r(Hs,"ZoomEvent");function nt(t,e,n){this.k=t,this.x=e,this.y=n}r(nt,"Transform");nt.prototype={constructor:nt,scale:r(function(t){return t===1?this:new nt(this.k*t,this.x,this.y)},"scale"),translate:r(function(t,e){return t===0&e===0?this:new nt(this.k,this.x+this.k*t,this.y+this.k*e)},"translate"),apply:r(function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},"apply"),applyX:r(function(t){return t*this.k+this.x},"applyX"),applyY:r(function(t){return t*this.k+this.y},"applyY"),invert:r(function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},"invert"),invertX:r(function(t){return(t-this.x)/this.k},"invertX"),invertY:r(function(t){return(t-this.y)/this.k},"invertY"),rescaleX:r(function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},"rescaleX"),rescaleY:r(function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},"rescaleY"),toString:r(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};var $t=new nt(1,0,0);Io.prototype=nt.prototype;function Io(t){for(;!t.__zoom;)if(!(t=t.parentNode))return $t;return t.__zoom}r(Io,"transform");function hr(t){t.stopImmediatePropagation()}r(hr,"nopropagation");function Lt(t){t.preventDefault(),t.stopImmediatePropagation()}r(Lt,"default");function Ff(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}r(Ff,"defaultFilter");function Vf(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}r(Vf,"defaultExtent");function ul(){return this.__zoom||$t}r(ul,"defaultTransform");function Xf(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}r(Xf,"defaultWheelDelta");function Yf(){return navigator.maxTouchPoints||"ontouchstart"in this}r(Yf,"defaultTouchable");function Wf(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}r(Wf,"defaultConstrain");function Oo(){var t=Ff,e=Vf,n=Wf,o=Xf,i=Yf,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=ln,u=Tt("start","zoom","end"),d,h,f,w=500,S=150,g=0,y=10;function m(v){v.property("__zoom",ul).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",b).on("dblclick.zoom",R).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",I).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}r(m,"zoom"),m.transform=function(v,k,M,T){var A=v.selection?v.selection():v;A.property("__zoom",ul),v!==A?x(v,k,M,T):A.interrupt().each(function(){N(this,arguments).event(T).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},m.scaleBy=function(v,k,M,T){m.scaleTo(v,function(){var A=this.__zoom.k,L=typeof k=="function"?k.apply(this,arguments):k;return A*L},M,T)},m.scaleTo=function(v,k,M,T){m.transform(v,function(){var A=e.apply(this,arguments),L=this.__zoom,X=M==null?p(A):typeof M=="function"?M.apply(this,arguments):M,H=L.invert(X),K=typeof k=="function"?k.apply(this,arguments):k;return n(C(E(L,K),X,H),A,a)},M,T)},m.translateBy=function(v,k,M,T){m.transform(v,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof M=="function"?M.apply(this,arguments):M),e.apply(this,arguments),a)},null,T)},m.translateTo=function(v,k,M,T,A){m.transform(v,function(){var L=e.apply(this,arguments),X=this.__zoom,H=T==null?p(L):typeof T=="function"?T.apply(this,arguments):T;return n($t.translate(H[0],H[1]).scale(X.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof M=="function"?-M.apply(this,arguments):-M),L,a)},T,A)};function E(v,k){return k=Math.max(s[0],Math.min(s[1],k)),k===v.k?v:new nt(k,v.x,v.y)}r(E,"scale");function C(v,k,M){var T=k[0]-M[0]*v.k,A=k[1]-M[1]*v.k;return T===v.x&&A===v.y?v:new nt(v.k,T,A)}r(C,"translate");function p(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}r(p,"centroid");function x(v,k,M,T){v.on("start.zoom",function(){N(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(T).end()}).tween("zoom",function(){var A=this,L=arguments,X=N(A,L).event(T),H=e.apply(A,L),K=M==null?p(H):typeof M=="function"?M.apply(A,L):M,$=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),z=A.__zoom,F=typeof k=="function"?k.apply(A,L):k,V=c(z.invert(K).concat($/z.k),F.invert(K).concat($/F.k));return function(Z){if(Z===1)Z=F;else{var Y=V(Z),W=$/Y[2];Z=new nt(W,K[0]-Y[0]*W,K[1]-Y[1]*W)}X.zoom(null,Z)}})}r(x,"schedule");function N(v,k,M){return!M&&v.__zooming||new _(v,k)}r(N,"gesture");function _(v,k){this.that=v,this.args=k,this.active=0,this.sourceEvent=null,this.extent=e.apply(v,k),this.taps=0}r(_,"Gesture"),_.prototype={event:r(function(v){return v&&(this.sourceEvent=v),this},"event"),start:r(function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},"start"),zoom:r(function(v,k){return this.mouse&&v!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},"zoom"),end:r(function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},"end"),emit:r(function(v){var k=Xe(this.that).datum();u.call(v,this.that,new Hs(v,{sourceEvent:this.sourceEvent,target:m,type:v,transform:this.that.__zoom,dispatch:u}),k)},"emit")};function P(v,...k){if(!t.apply(this,arguments))return;var M=N(this,k).event(v),T=this.__zoom,A=Math.max(s[0],Math.min(s[1],T.k*Math.pow(2,o.apply(this,arguments)))),L=Ue(v);if(M.wheel)(M.mouse[0][0]!==L[0]||M.mouse[0][1]!==L[1])&&(M.mouse[1]=T.invert(M.mouse[0]=L)),clearTimeout(M.wheel);else{if(T.k===A)return;M.mouse=[L,T.invert(L)],Ct(this),M.start()}Lt(v),M.wheel=setTimeout(X,S),M.zoom("mouse",n(C(E(T,A),M.mouse[0],M.mouse[1]),M.extent,a));function X(){M.wheel=null,M.end()}r(X,"wheelidled")}r(P,"wheeled");function b(v,...k){if(f||!t.apply(this,arguments))return;var M=v.currentTarget,T=N(this,k,!0).event(v),A=Xe(v.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",$,!0),L=Ue(v,M),X=v.clientX,H=v.clientY;dn(v.view),hr(v),T.mouse=[L,this.__zoom.invert(L)],Ct(this),T.start();function K(z){if(Lt(z),!T.moved){var F=z.clientX-X,V=z.clientY-H;T.moved=F*F+V*V>g}T.event(z).zoom("mouse",n(C(T.that.__zoom,T.mouse[0]=Ue(z,M),T.mouse[1]),T.extent,a))}r(K,"mousemoved");function $(z){A.on("mousemove.zoom mouseup.zoom",null),go(z.view,T.moved),Lt(z),T.event(z).end()}r($,"mouseupped")}r(b,"mousedowned");function R(v,...k){if(t.apply(this,arguments)){var M=this.__zoom,T=Ue(v.changedTouches?v.changedTouches[0]:v,this),A=M.invert(T),L=M.k*(v.shiftKey?.5:2),X=n(C(E(M,L),T,A),e.apply(this,k),a);Lt(v),l>0?Xe(this).transition().duration(l).call(x,X,T,v):Xe(this).call(m.transform,X,T,v)}}r(R,"dblclicked");function D(v,...k){if(t.apply(this,arguments)){var M=v.touches,T=M.length,A=N(this,k,v.changedTouches.length===T).event(v),L,X,H,K;for(hr(v),X=0;X<T;++X)H=M[X],K=Ue(H,this),K=[K,this.__zoom.invert(K),H.identifier],A.touch0?!A.touch1&&A.touch0[2]!==K[2]&&(A.touch1=K,A.taps=0):(A.touch0=K,L=!0,A.taps=1+!!d);d&&(d=clearTimeout(d)),L&&(A.taps<2&&(h=K[0],d=setTimeout(function(){d=null},w)),Ct(this),A.start())}}r(D,"touchstarted");function O(v,...k){if(this.__zooming){var M=N(this,k).event(v),T=v.changedTouches,A=T.length,L,X,H,K;for(Lt(v),L=0;L<A;++L)X=T[L],H=Ue(X,this),M.touch0&&M.touch0[2]===X.identifier?M.touch0[0]=H:M.touch1&&M.touch1[2]===X.identifier&&(M.touch1[0]=H);if(X=M.that.__zoom,M.touch1){var $=M.touch0[0],z=M.touch0[1],F=M.touch1[0],V=M.touch1[1],Z=(Z=F[0]-$[0])*Z+(Z=F[1]-$[1])*Z,Y=(Y=V[0]-z[0])*Y+(Y=V[1]-z[1])*Y;X=E(X,Math.sqrt(Z/Y)),H=[($[0]+F[0])/2,($[1]+F[1])/2],K=[(z[0]+V[0])/2,(z[1]+V[1])/2]}else if(M.touch0)H=M.touch0[0],K=M.touch0[1];else return;M.zoom("touch",n(C(X,H,K),M.extent,a))}}r(O,"touchmoved");function I(v,...k){if(this.__zooming){var M=N(this,k).event(v),T=v.changedTouches,A=T.length,L,X;for(hr(v),f&&clearTimeout(f),f=setTimeout(function(){f=null},w),L=0;L<A;++L)X=T[L],M.touch0&&M.touch0[2]===X.identifier?delete M.touch0:M.touch1&&M.touch1[2]===X.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(X=Ue(X,this),Math.hypot(h[0]-X[0],h[1]-X[1])<y)){var H=Xe(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return r(I,"touchended"),m.wheelDelta=function(v){return arguments.length?(o=typeof v=="function"?v:ko(+v),m):o},m.filter=function(v){return arguments.length?(t=typeof v=="function"?v:ko(!!v),m):t},m.touchable=function(v){return arguments.length?(i=typeof v=="function"?v:ko(!!v),m):i},m.extent=function(v){return arguments.length?(e=typeof v=="function"?v:ko([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),m):e},m.scaleExtent=function(v){return arguments.length?(s[0]=+v[0],s[1]=+v[1],m):[s[0],s[1]]},m.translateExtent=function(v){return arguments.length?(a[0][0]=+v[0][0],a[1][0]=+v[1][0],a[0][1]=+v[0][1],a[1][1]=+v[1][1],m):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},m.constrain=function(v){return arguments.length?(n=v,m):n},m.duration=function(v){return arguments.length?(l=+v,m):l},m.interpolate=function(v){return arguments.length?(c=v,m):c},m.on=function(){var v=u.on.apply(u,arguments);return v===u?m:v},m.clickDistance=function(v){return arguments.length?(g=(v=+v)*v,m):Math.sqrt(g)},m.tapDistance=function(v){return arguments.length?(y=+v,m):y},m}r(Oo,"default");var Qe={error001:r((t="react")=>`Seems like you have not used ${t==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${t}flow.dev/error#001`,"error001"),error002:r(()=>"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.","error002"),error003:r(t=>`Node type "${t}" not found. Using fallback type "default".`,"error003"),error004:r(()=>"The parent container needs a width and a height to render the graph.","error004"),error005:r(()=>"Only child nodes can use a parent extent.","error005"),error006:r(()=>"Can't create edge. An edge needs a source and a target.","error006"),error007:r(t=>`The old edge with id=${t} does not exist.`,"error007"),error009:r(t=>`Marker type "${t}" doesn't exist.`,"error009"),error008:r((t,{id:e,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:o}", edge id: ${e}.`,"error008"),error010:r(()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","error010"),error011:r(t=>`Edge type "${t}" not found. Using fallback type "default".`,"error011"),error012:r(t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,"error012"),error013:r((t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,"error013"),error014:r(()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.","error014"),error015:r(()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.","error015"),error016:r(t=>`Edge with id "${t}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`,"error016")},Ft=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Zs="5%",Us=["Enter"," ","Escape"],Ks={"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":r(({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"node.a11yDescription.ariaLiveMessage"),"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"},Sr=(function(t){return t.Strict="strict",t.Loose="loose",t})({}),wr=(function(t){return t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal",t})({}),zo=(function(t){return t.Partial="partial",t.Full="full",t})({}),$o={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Pt=(function(t){return t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier",t})({}),vr=(function(t){return t.Arrow="arrow",t.ArrowClosed="arrowclosed",t})({}),Be=(function(t){return t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom",t})({}),dl={left:"right",right:"left",top:"bottom",bottom:"top"},qs=r(t=>!!t&&typeof t=="object"&&"id"in t&&"source"in t&&"target"in t,"isEdgeBase"),Ml=r(t=>!!t&&typeof t=="object"&&"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),"isNodeBase"),Gs=r(t=>!!t&&typeof t=="object"&&"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),"isInternalNodeBase");var xr=r((t,e=[0,0])=>{let{width:n,height:o}=tt(t),i=t.origin??e,s=n*i[0],a=o*i[1];return{x:t.position.x-s,y:t.position.y-a}},"getNodePositionWithOrigin"),Lo=r((t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};let n=!1,o=t.reduce((i,s)=>{let a=typeof s=="string",l=!e.nodeLookup&&!a?s:void 0;return e.nodeLookup&&(l=a?e.nodeLookup.get(s):Gs(s)?s:e.nodeLookup.get(s.id)),l?(n=!0,Er(i,mr(l,e.nodeOrigin))):i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?_r(o):{x:0,y:0,width:0,height:0}},"getNodesBounds"),yn=r((t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return t.forEach(i=>{(e.filter===void 0||e.filter(i))&&(n=Er(n,mr(i)),o=!0)}),o?_r(n):{x:0,y:0,width:0,height:0}},"getInternalNodesBounds"),br=r((t,e,[n,o,i]=[0,0,1],s=!1,a=!1)=>{let l=(e.x-n)/i,c=(e.y-o)/i,u=e.width/i,d=e.height/i,h=[];for(let f of t.values()){let{measured:w,selectable:S=!0,hidden:g=!1}=f;if(a&&!S||g)continue;let y=w.width??f.width??f.initialWidth??0,m=w.height??f.height??f.initialHeight??0,{x:E,y:C}=f.internals.positionAbsolute,p=Il(l,c,u,d,E,C,y,m),x=y*m,N=s&&p>0;(!f.internals.handleBounds||N||p>=x||f.dragging)&&h.push(f)}return h},"getNodesInside");function Zf(t,e){let n=new Map,o=e?.nodes?new Set(e.nodes.map(i=>i.id)):null;return t.forEach(i=>{let s;if(e?.includeHiddenNodes){let{width:a,height:l}=tt(i);s=a>0&&l>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!o||o.has(i.id))&&n.set(i.id,i)}),n}r(Zf,"getFitViewNodes");async function Pl({nodes:t,width:e,height:n,panZoom:o,minZoom:i,maxZoom:s},a){if(t.size===0)return!0;let l=Zf(t,a);if(l.size===0)return!0;let c=yn(l),u=Vt(c,e,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??"5%");return o.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate})}r(Pl,"fitViewport");function js({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:i,onError:s}){let a=n.get(t),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??o,h=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!l)s?.("005",Qe.error005());else{let{width:w,height:S}=tt(l);w&&S&&(h=[[c,u],[c+w,u+S]])}else l&&To(a.extent)&&(h=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);let f=To(h)?Ao(e,h,a.measured):e;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",Qe.error015()),{position:{x:f.x-c+(a.measured.width??0)*d[0],y:f.y-u+(a.measured.height??0)*d[1]},positionAbsolute:f}}r(js,"calculateNodePosition");async function kl({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:o,onBeforeDelete:i}){let s=new Set(t.map(S=>S.id)),a=new Map,l=new Map;for(let S of n)if(S.deletable!==!1&&(s.has(S.id)&&a.set(S.id,S),S.parentId)){let g=l.get(S.parentId)??[];g.push(S),l.set(S.parentId,g)}let c=[...a.keys()];for(let S=0;S<c.length;S++)for(let g of l.get(c[S])??[])a.has(g.id)||(a.set(g.id,g),c.push(g.id));let u=new Set(e.map(S=>S.id)),d=new Map;for(let S of o)S.deletable!==!1&&(a.has(S.source)||a.has(S.target))&&d.set(S.id,S);for(let S of o)S.deletable!==!1&&u.has(S.id)&&!d.has(S.id)&&d.set(S.id,S);let h=n.filter(S=>a.has(S.id)),f=Array.from(d.values());if(!i)return{edges:f,nodes:h};let w=await i({nodes:h,edges:f});return typeof w=="boolean"?w?{edges:f,nodes:h}:{edges:[],nodes:[]}:w}r(kl,"getElementsToRemove");var mn=r((t,e=0,n=1)=>Math.min(Math.max(t,e),n),"clamp"),Ao=r((t={x:0,y:0},e,n)=>({x:mn(t.x,e[0][0],e[1][0]-(n?.width??0)),y:mn(t.y,e[0][1],e[1][1]-(n?.height??0))}),"clampPosition");function Uf(t,e,n){let{width:o,height:i}=tt(n),{x:s,y:a}=n.internals.positionAbsolute;return Ao(t,[[s,a],[s+o,a+i]],e)}r(Uf,"clampPositionToParent");var fl=r((t,e,n)=>t<e?mn(Math.abs(t-e),1,e)/e:t>n?-mn(Math.abs(t-n),1,e)/e:0,"calcAutoPanVelocity"),Cr=r((t,e,n=15,o=40)=>[fl(t.x,o,e.width-o)*n,fl(t.y,o,e.height-o)*n],"calcAutoPan"),Er=r((t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),"getBoundsOfBoxes"),Ws=r(({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),"rectToBox"),_r=r(({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),"boxToRect"),Sn=r((t,e=[0,0])=>{let{x:n,y:o}=Gs(t)?t.internals.positionAbsolute:xr(t,e);return{x:n,y:o,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},"nodeToRect"),mr=r((t,e=[0,0])=>{let{x:n,y:o}=Gs(t)?t.internals.positionAbsolute:xr(t,e);return{x:n,y:o,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:o+(t.measured?.height??t.height??t.initialHeight??0)}},"nodeToBox"),Qs=r((t,e)=>_r(Er(Ws(t),Ws(e))),"getBoundsOfRects"),Il=r((t,e,n,o,i,s,a,l)=>{let c=Math.max(0,Math.min(t+n,i+a)-Math.max(t,i)),u=Math.max(0,Math.min(e+o,s+l)-Math.max(e,s));return Math.ceil(c*u)},"getRectsOverlappingArea"),Ho=r((t,e)=>Il(t.x,t.y,t.width,t.height,e.x,e.y,e.width,e.height),"getOverlappingArea"),Js=r(t=>{if(typeof t!="object"||t===null)return!1;let e=t;return ot(e.width)&&ot(e.height)&&ot(e.x)&&ot(e.y)},"isRectObject"),ot=r(t=>typeof t=="number"&&!isNaN(t)&&isFinite(t),"isNumeric"),ea=r((t,e)=>(n,o)=>{},"createDevWarn"),wn=r((t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),"snapPosition"),Ht=r(({x:t,y:e},[n,o,i],s=!1,a=[1,1])=>{let l={x:(t-n)/i,y:(e-o)/i};return s?wn(l,a):l},"pointToRendererPoint"),Bt=r(({x:t,y:e},[n,o,i])=>({x:t*i+n,y:e*i+o}),"rendererPointToPoint");function pn(t,e){if(typeof t=="number")return Math.floor(t);if(typeof t=="string"&&t.endsWith("px")){let n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){let n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}r(pn,"parsePadding");function Kf(t,e,n){if(typeof t=="string"||typeof t=="number"){let o=pn(t,n),i=pn(t,e);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof t=="object"){let o=pn(t.top??t.y??0,n),i=pn(t.bottom??t.y??0,n),s=pn(t.left??t.x??0,e),a=pn(t.right??t.x??0,e);return{top:o,right:a,bottom:i,left:s,x:s+a,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}r(Kf,"parsePaddings");function qf(t,e,n,o,i,s){let{x:a,y:l}=Bt(t,[e,n,o]),{x:c,y:u}=Bt({x:t.x+t.width,y:t.y+t.height},[e,n,o]),d=i-c,h=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(h)}}r(qf,"calculateAppliedPaddings");var Vt=r((t,e,n,o=0,i=1/0,s=0)=>{let a=Kf(s,e,n),l=(e-a.x)/t.width,c=(n-a.y)/t.height,u=mn(Math.min(l,c),o,i),d=t.x+t.width/2,h=t.y+t.height/2,f=e/2-d*u,w=n/2-h*u,S=qf(t,f,w,u,e,n),g={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:f-g.left+g.right,y:w-g.top+g.bottom,zoom:u}},"getViewportForBounds"),vn=r(()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,"isMacOs");function To(t){return t!=null&&t!=="parent"}r(To,"isCoordinateExtent");function tt(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}r(tt,"getNodeDimensions");function ta(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}r(ta,"nodeHasDimensions");function na(t,e={width:0,height:0},n,o,i){let s={...t},a=o.get(n);if(a){let l=a.origin||i;s.x+=a.internals.positionAbsolute.x-(e.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(e.height??0)*l[1]}return s}r(na,"evaluateAbsolutePosition");function oa(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}r(oa,"areSetsEqual");function Ol(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}r(Ol,"withResolvers");function Dl(t){return{...Ks,...t||{}}}r(Dl,"mergeAriaLabelConfig");function Al(t,e,n){return e?n?`${t}-${e}-${n}`:`${t}-${e}`:t}r(Al,"getConnectionLookupKey");function Tl(t,{nodeId:e,type:n,handleId:o}){return Array.from(t.get(Al(e,n,o))?.values()??[])}r(Tl,"getConnectionsFromLookup");function ra(t){return t===null?null:t?"valid":"invalid"}r(ra,"getConnectionStatus");function hl(t){return t instanceof MouseEvent||Nr(t)}r(hl,"isPointerEvent");function pl(t){return t instanceof WheelEvent}r(pl,"isWheelEvent");function Nr(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent}r(Nr,"isTouchEvent");function gn(t){return t instanceof MouseEvent}r(gn,"isMouseEvent");function gl(t){if(Nr(t)){let e=t.touches[0]??t.changedTouches[0];return[e?.clientX??0,e?.clientY??0]}return[t.clientX,t.clientY]}r(gl,"getTouchPoint");function Do(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o,containerBounds:i}){let{x:s,y:a}=et(t),l=Ht({x:s-(i?.left??0),y:a-(i?.top??0)},o),{x:c,y:u}=n?wn(l,e):l;return{xSnapped:c,ySnapped:u,...l}}r(Do,"getPointerPosition");var Mr=r(t=>({width:t.offsetWidth,height:t.offsetHeight}),"getDimensions"),ia=r(t=>t?.getRootNode?.()||window?.document,"getHostForElement"),Gf=["INPUT","SELECT","TEXTAREA"];function sa(t){let e=t.composedPath?.()?.[0]||t.target;return e?.nodeType!==1?!1:Gf.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}r(sa,"isInputDOMNode");var et=r((t,e)=>{let n=gn(t),o=n?t.clientX:t.touches?.[0].clientX,i=n?t.clientY:t.touches?.[0].clientY;return{x:o-(e?.left??0),y:i-(e?.top??0)}},"getEventPosition"),ml=r((t,e,n,o,i)=>{let s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(a=>{let l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/o,y:(l.top-n.top)/o,...Mr(a)}})},"getHandleBounds");function Pr({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:l}){let c=t*.125+i*.375+a*.375+n*.125,u=e*.125+s*.375+l*.375+o*.125;return[c,u,Math.abs(c-t),Math.abs(u-e)]}r(Pr,"getBezierEdgeCenter");function pr(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}r(pr,"calculateControlOffset");function yl({pos:t,x1:e,y1:n,x2:o,y2:i,c:s}){switch(t){case"left":return[e-pr(e-o,s),n];case"right":return[e+pr(o-e,s),n];case"top":return[e,n-pr(n-i,s)];case"bottom":return[e,n+pr(i-n,s)]}}r(yl,"getControlWithCurvature");function kr({sourceX:t,sourceY:e,sourcePosition:n="bottom",targetX:o,targetY:i,targetPosition:s="top",curvature:a=.25}){let[l,c]=yl({pos:n,x1:t,y1:e,x2:o,y2:i,c:a}),[u,d]=yl({pos:s,x1:o,y1:i,x2:t,y2:e,c:a}),[h,f,w,S]=Pr({sourceX:t,sourceY:e,targetX:o,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${t},${e} C${l},${c} ${u},${d} ${o},${i}`,h,f,w,S]}r(kr,"getBezierPath");function aa({sourceX:t,sourceY:e,targetX:n,targetY:o}){let i=Math.abs(n-t)/2,s=n<t?n+i:n-i,a=Math.abs(o-e)/2;return[s,o<e?o+a:o-a,i,a]}r(aa,"getEdgeCenter");function Rl({sourceNode:t,targetNode:e,selected:n=!1,zIndex:o=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){return s==="manual"?o:(i&&n?o+1e3:o)+Math.max(t.parentId||i&&t.selected?t.internals.z:0,e.parentId||i&&e.selected?e.internals.z:0)}r(Rl,"getElevatedEdgeZIndex");function zl({sourceNode:t,targetNode:e,width:n,height:o,transform:i}){let s=Er(mr(t),mr(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:o/i[2]};return Ho(a,_r(s))>0}r(zl,"isEdgeVisible");var jf=r(({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`,"getEdgeId"),Qf=r((t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),"connectionExists"),$l=r((t,e,n={})=>{if(!t.source||!t.target)return n.onError?.("006",Qe.error006()),e;let o=n.getEdgeId||jf,i;return qs(t)?i={...t}:i={...t,id:o(t)},Qf(i,e)?e:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,e.concat(i))},"addEdge");function Ir({sourceX:t,sourceY:e,targetX:n,targetY:o}){let[i,s,a,l]=aa({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,i,s,a,l]}r(Ir,"getStraightPath");var Sl={left:{x:-1,y:0},right:{x:1,y:0},top:{x:0,y:-1},bottom:{x:0,y:1}},Jf=r(({source:t,sourcePosition:e="bottom",target:n})=>e==="left"||e==="right"?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},"getDirection"),wl=r((t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),"distance"),eh=r((t,e,n)=>t.x===e.x&&e.x===n.x&&(e.y-t.y)*(n.y-e.y)>=0||t.y===e.y&&e.y===n.y&&(e.x-t.x)*(n.x-e.x)>=0,"isBetween");function th({source:t,sourcePosition:e="bottom",target:n,targetPosition:o="top",center:i,offset:s,stepPosition:a}){let l=Sl[e],c=Sl[o],u={x:t.x+l.x*s,y:t.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},h=Jf({source:u,sourcePosition:e,target:d}),f=h.x!==0?"x":"y",w=h[f],S,g,y,m={x:0,y:0},E={x:0,y:0},[,,C,p]=aa({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(l[f]*c[f]===-1){f==="x"?(g=i.x??u.x+(d.x-u.x)*a,y=i.y??(u.y+d.y)/2):(g=i.x??(u.x+d.x)/2,y=i.y??u.y+(d.y-u.y)*a);let P=[{x:g,y:u.y},{x:g,y:d.y}],b=[{x:u.x,y},{x:d.x,y}];l[f]===w?S=f==="x"?P:b:S=f==="x"?b:P}else{let P=[{x:u.x,y:d.y}],b=[{x:d.x,y:u.y}];if(f==="x"?S=l.x===w?b:P:S=l.y===w?P:b,e===o){let O=Math.abs(t[f]-n[f]);if(O<=s){let I=Math.min(s-1,s-O);l[f]===w?m[f]=(u[f]>t[f]?-1:1)*I:E[f]=(d[f]>n[f]?-1:1)*I}}if(e!==o){let O=f==="x"?"y":"x",I=l[f]===c[O],v=u[O]>d[O],k=u[O]<d[O];(l[f]===1&&(!I&&v||I&&k)||l[f]!==1&&(!I&&k||I&&v))&&(S=f==="x"?P:b)}let R={x:u.x+m.x,y:u.y+m.y},D={x:d.x+E.x,y:d.y+E.y};Math.max(Math.abs(R.x-S[0].x),Math.abs(D.x-S[0].x))>=Math.max(Math.abs(R.y-S[0].y),Math.abs(D.y-S[0].y))?(g=(R.x+D.x)/2,y=S[0].y):(g=S[0].x,y=(R.y+D.y)/2)}let x={x:u.x+m.x,y:u.y+m.y},N={x:d.x+E.x,y:d.y+E.y},_=[];for(let P of[t,x,...S,N,n]){let[b,R]=_.slice(-2);R&&eh(b,R,P)&&_.pop(),_.push(P)}return[_,g,y,C,p]}r(th,"getPoints");function nh(t,e,n,o){let i=Math.min(wl(t,e)/2,wl(e,n)/2,o),{x:s,y:a}=e;if(t.x===s&&s===n.x||t.y===a&&a===n.y)return`L${s} ${a}`;if(t.y===a){let c=t.x<n.x?-1:1,u=t.y<n.y?1:-1;return`L ${s+i*c},${a}Q ${s},${a} ${s},${a+i*u}`}let l=t.x<n.x?1:-1;return`L ${s},${a+i*(t.y<n.y?-1:1)}Q ${s},${a} ${s+i*l},${a}`}r(nh,"getBend");function Bo({sourceX:t,sourceY:e,sourcePosition:n="bottom",targetX:o,targetY:i,targetPosition:s="top",borderRadius:a=5,centerX:l,centerY:c,offset:u=20,stepPosition:d=.5}){let[h,f,w,S,g]=th({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:i},targetPosition:s,center:{x:l,y:c},offset:u,stepPosition:d}),y=`M${h[0].x} ${h[0].y}`;for(let m=1;m<h.length-1;m++)y+=nh(h[m-1],h[m],h[m+1],a);return y+=`L${h[h.length-1].x} ${h[h.length-1].y}`,[y,f,w,S,g]}r(Bo,"getSmoothStepPath");function vl(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}r(vl,"isNodeInitialized");function Ll(t){let{sourceNode:e,targetNode:n}=t;if(!vl(e)||!vl(n))return null;let o=e.internals.handleBounds,i=n.internals.handleBounds,s=xl(o?.source??[],t.sourceHandle),a=xl(t.connectionMode==="strict"?i?.target??[]:(i?.target??[]).concat(i?.source??[]),t.targetHandle);if(!s||!a)return t.onError?.("008",Qe.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;let l=s?.position||"bottom",c=a?.position||"top",u=Mt(e,s,l),d=Mt(n,a,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}r(Ll,"getEdgePosition");function Mt(t,e,n="left",o=!1){let i=(e?.x??0)+t.internals.positionAbsolute.x,s=(e?.y??0)+t.internals.positionAbsolute.y,{width:a,height:l}=e??tt(t);if(o)return{x:i+a/2,y:s+l/2};switch(e?.position??n){case"top":return{x:i+a/2,y:s};case"right":return{x:i+a,y:s+l/2};case"bottom":return{x:i+a/2,y:s+l};case"left":return{x:i,y:s+l/2}}}r(Mt,"getHandlePosition");function xl(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}r(xl,"getHandle$1");function Or(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`:""}r(Or,"getMarkerId");function Hl(t,{id:e,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:i}){let s=new Set;return t.reduce((a,l)=>([l.markerStart||o,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){let u=Or(c,e);s.has(u)||(a.push({id:u,color:c.color||n,...c}),s.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}r(Hl,"createMarkerIds");var Bl=1e3,oh=10,rh={nodeOrigin:[0,0],nodeExtent:Ft,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Fl={...rh,checkEquality:!0};function Vl(t,e){let n={...t};for(let o in e)e[o]!==void 0&&(n[o]=e[o]);return n}r(Vl,"mergeObjects");function Xl(t,e,n=Ft){let o=xr(t,e),i=To(t.extent)?t.extent:n;return Ao(o,i,tt(t))}r(Xl,"getPositionAbsolute");function ih(t,e){if(!t.handles)return t.measured?e?.internals.handleBounds:void 0;let n=[],o=[];for(let i of t.handles){let s={id:i.id,width:i.width??1,height:i.height??1,nodeId:t.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&o.push(s)}return{source:n,target:o}}r(ih,"parseHandles");function la(t){return t==="manual"}r(la,"isManualZIndexMode");function Dr(t,e,n,o={}){let i=Vl(Fl,o),s={i:0},a=new Map(e),l=!!o.defaults?.parentId||t.some(y=>!!y.parentId),c=i?.elevateNodesOnSelect&&!la(i.zIndexMode)?Bl:0,u=new Set,d=new Map,h=t.length>0,f=!1,w=new Set;function S(y){if(w.has(y.id)){let m=e.get(y.id);m&&Object.assign(m,y)}else w.add(y.id),e.set(y.id,y)}r(S,"updateNode"),e.clear(),n.clear();let g={nodeLookup:e,parentLookup:n,options:o,rootParentIndex:s,processedNodes:u,deferredChildNodes:d,updateNode:S};for(let y of t){let m=a.get(y.id);i.checkEquality&&y===m?.internals.userNode?e.set(y.id,m):(m={...i.defaults,...y,measured:{width:y.measured?.width,height:y.measured?.height},internals:{positionAbsolute:Xl(y,i.nodeOrigin,i.nodeExtent),handleBounds:ih(y,m),z:Zl(y,c,i.zIndexMode),userNode:y,isParent:!1}},S(m)),(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(h=!1),l&&Yl(m,g),f||(f=y.selected??!1)}for(let y of a.keys()){let m=e.get(y);m?m.internals.isParent&&!n.has(y)&&S({...m,internals:{...m.internals,isParent:!1}}):w.add(y)}return{nodesInitialized:h,hasSelectedNodes:f,updatedNodes:w}}r(Dr,"adoptUserNodes");function Yl(t,e){let{nodeLookup:n,parentLookup:o,options:i,rootParentIndex:s,processedNodes:a,deferredChildNodes:l,updateNode:c}=e;if(t.parentId&&!a.has(t.parentId)){let d=l.get(t.parentId)??[];d.push(t),l.set(t.parentId,d);return}t.parentId&&Wl(t,n,o,i,s,c),a.add(t.id);let u=l.get(t.id);u&&(l.delete(t.id),u.forEach(d=>Yl(d,e)))}r(Yl,"resolveSubflowsForNode");function sh(t,e,n,o){if(!t.parentId)return;let i=e.get(t.parentId);i?i.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]])),n.internals.isParent||o({...n,internals:{...n.internals,isParent:!0}})}r(sh,"updateParentLookup");function Wl(t,e,n,o,i,s=a=>{e.set(a.id,a)}){let a=Vl(Fl,o),{zIndexMode:l}=a,c=t.parentId,u=e.get(c);if(!u){console.warn(`Parent node ${c} not found.`);return}i&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*oh),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex),sh(ah(t,u,{nodeLookup:e,options:a,updateNode:s}),n,u,s)}r(Wl,"updateChildNode");function ah(t,e,n){let{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:s,zIndexMode:a}=n.options,{x:l,y:c,z:u}=lh(t,e,i,s,o&&!la(a)?Bl:0,a),{positionAbsolute:d}=t.internals,h=l!==d.x||c!==d.y;if(h||u!==t.internals.z){let f={...t,internals:{...t.internals,positionAbsolute:h?{x:l,y:c}:d,z:u}};return n.updateNode(f),f}return t}r(ah,"updateChildXYZ");function Zl(t,e,n){let o=ot(t.zIndex)?t.zIndex:0;return la(n)?o:o+(t.selected?e:0)}r(Zl,"calculateZ");function lh(t,e,n,o,i,s){let{x:a,y:l}=e.internals.positionAbsolute,c=tt(t),u=xr(t,n),d=To(t.extent)?Ao(u,t.extent,c):u,h=Ao({x:a+d.x,y:l+d.y},o,c);t.extent==="parent"&&(h=Uf(h,c,e));let f=Zl(t,i,s),w=e.internals.z??0;return{x:h.x,y:h.y,z:w>=f?w+1:f}}r(lh,"calculateChildXYZ");function Ar(t,e,n,o=[0,0]){let i=[],s=new Map;for(let a of t){let l=e.get(a.parentId);if(!l)continue;let c=s.get(a.parentId)?.expandedRect??Sn(l),u=Qs(c,a.rect);s.set(a.parentId,{expandedRect:u,parent:l})}return s.size>0&&s.forEach(({expandedRect:a,parent:l},c)=>{let u=l.internals.positionAbsolute,d=tt(l),h=l.origin??o,f=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,w=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,S=Math.max(d.width,Math.round(a.width)),g=Math.max(d.height,Math.round(a.height)),y=(S-d.width)*h[0],m=(g-d.height)*h[1];(f>0||w>0||y||m)&&(i.push(yr(c,{x:l.position.x-f+y,y:l.position.y-w+m})),n.get(c)?.forEach(E=>{t.some(C=>C.id===E.id)||i.push(yr(E.id,{x:E.position.x+f,y:E.position.y+w}))})),(d.width<a.width||d.height<a.height||f||w)&&i.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:S+(f?h[0]*f-y:0),height:g+(w?h[1]*w-m:0)}})}),i}r(Ar,"handleExpandParent");function Ul(t,e,n,o,i,s,a){let l=new Set,c=r(y=>{e.set(y.id,y),l.add(y.id)},"updateNode"),u=o?.querySelector(".xyflow__viewport"),d=!1;if(!u)return{changes:[],updatedInternals:d,updatedNodes:l};let h=[],f=window.getComputedStyle(u),{m22:w}=new window.DOMMatrixReadOnly(f.transform),S=[],g=[];for(let y of t.values()){let m=e.get(y.id);if(!m)continue;if(m.hidden){c({...m,internals:{...m.internals,handleBounds:void 0}}),d=!0;continue}let E=Mr(y.nodeElement),C=m.measured.width!==E.width||m.measured.height!==E.height;if(E.width&&E.height&&(C||!m.internals.handleBounds||y.force)){let p=y.nodeElement.getBoundingClientRect(),x={...m,measured:E};c({...x,internals:{...m.internals,positionAbsolute:m.parentId?m.internals.positionAbsolute:Xl(x,i,s),handleBounds:{source:ml("source",y.nodeElement,p,w,m.id),target:ml("target",y.nodeElement,p,w,m.id)}}}),d=!0,C&&(h.push(Th(m.id,E)),m.expandParent&&m.parentId&&g.push(m.id))}}if(d){let y={nodeOrigin:i,nodeExtent:s,zIndexMode:a};for(let m of n.values())for(let E of m.keys()){let C=e.get(E);C&&Wl(C,e,n,y,void 0,p=>c(p))}}for(let y of g){let m=e.get(y);S.push({id:y,parentId:m.parentId,rect:Sn(m,i)})}if(S.length>0){let y=Ar(S,e,n,i);h.push(...y)}return{changes:h,updatedInternals:d,updatedNodes:l}}r(Ul,"updateNodeInternals");async function Kl({delta:t,panZoom:e,transform:n,translateExtent:o,width:i,height:s}){if(!e||!t.x&&!t.y)return!1;let a=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[i,s]],o);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}r(Kl,"panBy");function bl(t,e,n,o,i,s,a){let l=i,c=o.get(l);(!c||!a.has(l))&&(c=new Map(c),a.add(l),o.set(l,c)),c.set(n,e),l=`${i}-${t}`;let u=o.get(l);if((!u||!a.has(l))&&(u=new Map(u),a.add(l),o.set(l,u)),u.set(n,e),s){l=`${i}-${t}-${s}`;let d=o.get(l);(!d||!a.has(l))&&(d=new Map(d),a.add(l),o.set(l,d)),d.set(n,e)}}r(bl,"addConnectionToLookup");function Cl(t,e,n,o,i,s){let a=[o,`${o}-${t}`];i&&a.push(`${o}-${t}-${i}`);for(let l of a){let c=n.get(l);c&&(s.has(l)||(c=new Map(c),n.set(l,c),s.add(l)),c.delete(e),c.size===0&&n.delete(l))}}r(Cl,"removeConnectionFromLookup");function Bs(t,e,n,o){let{source:i,target:s,sourceHandle:a=null,targetHandle:l=null}=e,c={edgeId:e.id,source:i,target:s,sourceHandle:a,targetHandle:l},u=`${i}-${a}--${s}-${l}`,d=`${s}-${l}--${i}-${a}`;n==="add"?(bl("source",c,d,t,i,a,o),bl("target",c,u,t,s,l,o)):(Cl("source",d,t,i,a,o),Cl("target",u,t,s,l,o))}r(Bs,"syncEdgeConnections");function ca(t,e,n){let o=new Map(e),i=new Set,s=new Set,a=[];e.clear();for(let l of n){let c=o.get(l.id);if(c===l){e.set(l.id,l);continue}(!c||c.source!==l.source||c.target!==l.target||c.sourceHandle!=l.sourceHandle||c.targetHandle!=l.targetHandle)&&(c&&Bs(t,c,"remove",s),a.push(l)),e.set(l.id,l),i.add(l.id)}for(let l of o.values())e.has(l.id)||(Bs(t,l,"remove",s),i.add(l.id));for(let l of a)Bs(t,l,"add",s);return{updatedEdges:i}}r(ca,"updateConnectionLookup");function ql(t,e,n,o,i){let s=e.get(t);if(!s){console.warn(`changeParent: Node "${t}" does not exists`);return}if(n===t)return;let a=s.internals.positionAbsolute,l=s.origin??o,c=tt(s),u={x:l[0]*c.width,y:l[1]*c.height};if(n===null){i({nodeId:t,parentId:n,x:a.x+u.x,y:a.y+u.y});return}let d=e.get(n);if(!d){console.warn(`changeParent: Parent node "${n}" does not exists`);return}let h=d.internals.positionAbsolute;i({nodeId:t,parentId:n,x:a.x+u.x-h.x,y:a.y+u.y-h.y})}r(ql,"changeParentNode");function Gl(t,e){if(!t.parentId)return!1;let n=e.get(t.parentId);return n?n.selected?!0:Gl(n,e):!1}r(Gl,"isParentSelected");function El(t,e,n){let o=t;do{if(o?.matches?.(e))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}r(El,"hasSelector");function ch(t,e,n,o,i){let s=new Map;for(let[a,l]of t)if((i?l.id===o:l.selected||l.id===o)&&(i||!l.parentId||!Gl(l,t))&&(l.draggable||e&&typeof l.draggable>"u")){let c=t.get(a);c&&s.set(a,{id:a,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}r(ch,"getDragItems");function Fs({nodeId:t,dragItems:e,nodeLookup:n,dragging:o=!0}){let i=[];for(let[a,l]of e){let c=n.get(a)?.internals.userNode;c&&i.push({...c,position:l.position,dragging:o})}if(!t)return[i[0],i];let s=n.get(t)?.internals.userNode;return[s?{...s,position:e.get(t)?.position||s.position,dragging:o}:i[0],i]}r(Fs,"getEventHandlerParams");function uh({dragItems:t,snapGrid:e,x:n,y:o}){let i=t.values().next().value;if(!i)return null;let s={x:n-i.distance.x,y:o-i.distance.y},a=wn(s,e);return{x:a.x-s.x,y:a.y-s.y}}r(uh,"calculateSnapOffset");function jl({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:o,onDragStop:i}){let s={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d={x:0,y:0},h=null,f=!1,w=null,S=!1,g=!1,y=null,m,E,C,p,x;function N(I){let v=I.view??window,k=r(M=>{M.preventDefault(),M.stopImmediatePropagation()},"suppressClick");v.addEventListener("click",k,{capture:!0}),setTimeout(()=>v.removeEventListener("click",k,{capture:!0}),0)}r(N,"preventNextClick");function _({x:I,y:v}){let{nodeLookup:k,nodeExtent:M,snapGrid:T,snapToGrid:A,nodeOrigin:L,onNodeDrag:X,onSelectionDrag:H,onError:K,updateNodePositions:$}=e();s={x:I,y:v};let z=!1,F=l.size>1,V=F&&M?Ws(yn(l)):null,Z=F&&A?uh({dragItems:l,snapGrid:T,x:I,y:v}):null;for(let[Y,W]of l){if(!k.has(Y))continue;let q={x:I-W.distance.x,y:v-W.distance.y};A&&(q=Z?{x:Math.round(q.x+Z.x),y:Math.round(q.y+Z.y)}:wn(q,T));let G=null;if(F&&M&&!W.extent&&V){let{positionAbsolute:J}=W.internals,ee=J.x-V.x+M[0][0],oe=J.x+W.measured.width-V.x2+M[1][0],ie=J.y-V.y+M[0][1],re=J.y+W.measured.height-V.y2+M[1][1];G=[[ee,ie],[oe,re]]}let{position:j,positionAbsolute:ne}=js({nodeId:Y,nextPosition:q,nodeLookup:k,nodeExtent:G||M,nodeOrigin:L,onError:K});z=z||W.position.x!==j.x||W.position.y!==j.y,W.position=j,W.internals.positionAbsolute=ne}if(g=g||z,!!z&&($(l,!0),y&&(o||X||!p&&H))){let[Y,W]=Fs({nodeId:p,dragItems:l,nodeLookup:k});o?.(y,l,Y,W),X?.(y,Y,W),p||H?.(y,W)}}r(_,"updateNodes");async function P(){if(!h)return;let{transform:I,panBy:v,autoPanSpeed:k,autoPanOnNodeDrag:M}=e();if(!M){c=!1,cancelAnimationFrame(a);return}let[T,A]=Cr(u,h,k);(T!==0||A!==0)&&(s.x=(s.x??0)-T/I[2],s.y=(s.y??0)-A/I[2],await v({x:T,y:A})&&_(s)),a=requestAnimationFrame(()=>{P()})}r(P,"autoPan");function b(I){let{nodeLookup:v,multiSelectionActive:k,nodesDraggable:M,transform:T,snapGrid:A,snapToGrid:L,selectNodesOnDrag:X,onNodeDragStart:H,onSelectionDragStart:K,unselectNodesAndEdges:$}=e();f=!0;let z=!!p&&!k&&!v.get(p)?.selected;(!X||!C)&&!k&&p&&(v.get(p)?.selected||$()),C&&X&&p&&t?.(p);let F=Do(I.sourceEvent,{transform:T,snapGrid:A,snapToGrid:L,containerBounds:h});if(s=F,l=ch(v,M,F,p,z),l.size>0&&(n||H||!p&&K)){let[V,Z]=Fs({nodeId:p,dragItems:l,nodeLookup:v});n?.(I.sourceEvent,l,V,Z),H?.(I.sourceEvent,V,Z),p||K?.(I.sourceEvent,Z)}}r(b,"startDrag");let R=So().clickDistance(1/0).on("start",I=>{let{domNode:v,nodeDragThreshold:k,transform:M,snapGrid:T,snapToGrid:A}=e();h=v?.getBoundingClientRect()||null,f=!1,c=!1,S=!1,g=!1,y=I.sourceEvent,k===0&&b(I),s=Do(I.sourceEvent,{transform:M,snapGrid:T,snapToGrid:A,containerBounds:h}),u=et(I.sourceEvent,h),d=u}).on("drag",I=>{let{autoPanOnNodeDrag:v,transform:k,snapGrid:M,snapToGrid:T,nodeDragThreshold:A,nodeLookup:L}=e();y=I.sourceEvent;let X=Do(y,{transform:k,snapGrid:M,snapToGrid:T,containerBounds:h});if((Nr(y)&&y.type==="touchmove"&&y.touches.length>1||p&&!L.has(p))&&(S=!0),!S){if(!c&&v&&f&&(c=!0,P()),!f){let H=et(I.sourceEvent,h),K=H.x-d.x,$=H.y-d.y;Math.hypot(K,$)>A&&b(I)}(s.x!==X.xSnapped||s.y!==X.ySnapped)&&l&&f&&(u=et(y,h),_(X))}}).on("end",I=>{if((!x?.contains(I.sourceEvent.target)||g)&&N(I.sourceEvent),!f||S){S&&l.size>0&&e().updateNodePositions(l,!1);return}if(cancelAnimationFrame(a),l.size>0){let{nodeLookup:v,updateNodePositions:k,onNodeDragStop:M,onSelectionDragStop:T}=e();if(g&&(k(l,!1),g=!1),i||M||!p&&T){let[A,L]=Fs({nodeId:p,dragItems:l,nodeLookup:v,dragging:!1});i?.(I.sourceEvent,l,A,L),M?.(I.sourceEvent,A,L),p||T?.(I.sourceEvent,L)}}}).filter(I=>{let v=I.target,k=x;return k?!I.button&&(!m||!El(v,`.${m}`,k))&&(!E||El(v,E,k)):!1});function D(I){m=I.noDragClassName,E=I.handleSelector,C=I.isSelectable,p=I.nodeId,I.domNode!==x&&(x=I.domNode,w?.on(".drag",null),w=Xe(x),w.call(R))}r(D,"update");function O(){w?.on(".drag",null),w=null,x=void 0}return r(O,"destroy"),{update:D,destroy:O}}r(jl,"XYDrag");function dh(t,e,n){let o=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(let s of e.values())Ho(i,Sn(s))>0&&o.push(s);return o}r(dh,"getNodesWithinDistance");var fh=250;function hh(t,e,n,o){let i=[],s=1/0,a=dh(t,n,e+fh);for(let l of a){let c=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(let u of c){if(o.nodeId===u.nodeId&&o.type===u.type&&o.id===u.id)continue;let{x:d,y:h}=Mt(l,u,u.position,!0),f=Math.sqrt(Math.pow(d-t.x,2)+Math.pow(h-t.y,2));f>e||(f<s?(i=[{...u,x:d,y:h}],s=f):f===s&&i.push({...u,x:d,y:h}))}}if(!i.length)return null;if(i.length>1){let l=o.type==="source"?"target":"source";return i.find(c=>c.type===l)??i[0]}return i[0]}r(hh,"getClosestHandle");function Ql(t,e,n,o,i,s=!1){let a=o.get(t);if(!a)return null;let l=i==="strict"?a.internals.handleBounds?.[e]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],c=(n?l?.find(u=>u.id===n):l?.[0])??null;return c&&s?{...c,...Mt(a,c,c.position,!0)}:c}r(Ql,"getHandle");function Jl(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}r(Jl,"getHandleType");function ph(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}r(ph,"isConnectionValid");var ec=r(()=>!0,"alwaysValid");function gh(t,{connectionMode:e,connectionRadius:n,handleId:o,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:h,panBy:f,cancelConnection:w,onConnectStart:S,onConnect:g,onConnectEnd:y,isValidConnection:m=ec,onReconnectEnd:E,updateConnection:C,getTransform:p,getFromHandle:x,autoPanSpeed:N,dragThreshold:_=1,handleDomNode:P}){let b=ia(t.target),R=0,D,{x:O,y:I}=et(t),v=Jl(s,P),k=l?.getBoundingClientRect(),M=!1;if(!k||!v)return;let T=Ql(i,v,o,c,e);if(!T)return;let A=et(t,k),L=!1,X=null,H=!1,K=null;function $(){if(!d||!k)return;let[q,G]=Cr(A,k,N);f({x:q,y:G}),R=requestAnimationFrame($)}r($,"autoPan");let z={...T,nodeId:i,type:v,position:T.position},F=c.get(i),V={inProgress:!0,isValid:null,from:Mt(F,z,"left",!0),fromHandle:z,fromPosition:z.position,fromNode:F,to:A,toHandle:null,toPosition:dl[z.position],toNode:null,pointer:A};function Z(){M=!0,C(V),S?.(t,{nodeId:i,handleId:o,handleType:v})}r(Z,"startConnection"),_===0&&Z();function Y(q){if(!M){let{x:oe,y:ie}=et(q),re=oe-O,se=ie-I;if(!(re*re+se*se>_*_))return;Z()}if(!x()||!z){W(q);return}let G=p();A=et(q,k),D=hh(Ht(A,G,!1,[1,1]),n,c,z),L||($(),L=!0);let j=tc(q,{handle:D,connectionMode:e,fromNodeId:i,fromHandleId:o,fromType:a?"target":"source",isValidConnection:m,doc:b,lib:u,flowId:h,nodeLookup:c});K=j.handleDomNode,X=j.connection,H=ph(!!D,j.isValid);let ne=c.get(i),J=ne?Mt(ne,z,"left",!0):V.from,ee={...V,from:J,isValid:H,to:j.toHandle&&H?Bt({x:j.toHandle.x,y:j.toHandle.y},G):A,toHandle:j.toHandle,toPosition:H&&j.toHandle?j.toHandle.position:dl[z.position],toNode:j.toHandle?c.get(j.toHandle.nodeId):null,pointer:A};C(ee),V=ee}r(Y,"onPointerMove");function W(q){if(!("touches"in q&&q.touches.length>0)){if(M){(D||K)&&X&&H&&g?.(X);let{inProgress:G,...j}=V,ne={...j,to:Ht(V.to,p()),toPosition:V.toHandle?V.toPosition:null};y?.(q,ne),s&&E?.(q,ne)}w(),cancelAnimationFrame(R),L=!1,H=!1,X=null,K=null,b.removeEventListener("mousemove",Y),b.removeEventListener("mouseup",W),b.removeEventListener("touchmove",Y),b.removeEventListener("touchend",W)}}r(W,"onPointerUp"),b.addEventListener("mousemove",Y),b.addEventListener("mouseup",W),b.addEventListener("touchmove",Y),b.addEventListener("touchend",W)}r(gh,"onPointerDown");function tc(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=ec,nodeLookup:d}){let h=s==="target",f=e?a.querySelector(`.${l}-flow__handle[data-id="${c}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:w,y:S}=et(t),g=a.elementFromPoint(w,S),y=g?.classList.contains(`${l}-flow__handle`)?g:f,m={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let E=Jl(void 0,y),C=y.getAttribute("data-nodeid"),p=y.getAttribute("data-handleid"),x=y.classList.contains("connectable"),N=y.classList.contains("connectableend");if(!C||!E)return m;let _={source:h?C:o,sourceHandle:h?p:i,target:h?o:C,targetHandle:h?i:p};m.connection=_,m.isValid=x&&N&&(n==="strict"?h&&E==="source"||!h&&E==="target":C!==o||p!==i)&&u(_),m.toHandle=Ql(C,E,p,d,n,!0)}return m}r(tc,"isValidHandle");var Tr={onPointerDown:gh,isValid:tc};function nc({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){let i=Xe(t);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:h=!0,zoomable:f=!0,inversePan:w=!1}){let S=r(C=>{let p=C.sourceEvent;if(!pl(p)||!e)return;let x=n(),N=p.ctrlKey&&vn()?10:1,_=-p.deltaY*(p.deltaMode===1?.05:p.deltaMode?1:.002)*d,P=x[2]*Math.pow(2,_*N);e.scaleTo(P)},"zoomHandler"),g=[0,0],y=r(C=>{let p=C.sourceEvent;hl(p)&&(p.type==="mousedown"||p.type==="touchstart")&&(g=gl(p))},"panStartHandler"),m=r(C=>{let p=n(),x=C.sourceEvent;if(!hl(x)||pl(x)||!e)return;let N=gl(x),_=[N[0]-g[0],N[1]-g[1]];g=N;let P=o()*Math.max(p[2],Math.log(p[2]))*(w?-1:1),b={x:p[0]-_[0]*P,y:p[1]-_[1]*P},R=[[0,0],[c,u]];e.setViewportConstrained({x:b.x,y:b.y,zoom:p[2]},R,l)},"panHandler"),E=Oo().on("start",y).on("zoom",h?m:null).on("zoom.wheel",f?S:null);i.call(E,{})}r(s,"update");function a(){i.on("zoom",null)}return r(a,"destroy"),{update:s,destroy:a,pointer:Ue}}r(nc,"XYMinimap");var Rr=r(t=>({x:t.x,y:t.y,zoom:t.k}),"transformToViewport"),Vs=r(({x:t,y:e,zoom:n})=>$t.translate(t,e).scale(n),"viewportToTransform"),Nt=r((t,e)=>{if(!e)return!1;let n=t.target;return n instanceof Element&&!!n.closest(`.${e}`)},"isWrappedWithClass"),oc=r(t=>t===!0||Array.isArray(t)&&t.includes(0),"isLeftClickPan"),mh=r((t,e)=>e===2&&Array.isArray(t)&&t.includes(2),"isRightClickPan"),yh=r(t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,"defaultEase"),Xs=r((t,e=0,n=yh,o=()=>{})=>{let i=typeof e=="number"&&e>0;return i||o(!0),i?t.transition().duration(e).ease(n).on("end",()=>o(!0)).on("interrupt cancel",()=>o(!1)):t},"getD3Transition"),rc=r(t=>{let e=t.ctrlKey&&vn()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},"wheelDelta");function Sh({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:o,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Nt(d,e))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let h=n.property("__zoom").k||1;if(d.ctrlKey&&a){let y=Ue(d),m=rc(d),E=h*Math.pow(2,m);o.scaleTo(n,E,y,d);return}let f=d.deltaMode===1?20:1,w=i==="vertical"?0:d.deltaX*f,S=i==="horizontal"?0:d.deltaY*f;!vn()&&d.shiftKey&&i!=="vertical"&&(w=d.deltaY*f,S=0),o.translateBy(n,-(w/h)*s,-(S/h)*s,{internal:!0});let g=Rr(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?c?.(d,g):(t.isPanScrolling=!0,l?.(d,g)),t.panScrollTimeout=setTimeout(()=>{u?.(d,g),t.isPanScrolling=!1},150)}}r(Sh,"createPanOnScrollHandler");function wh({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,i){let s=o.type==="wheel",a=!e&&s&&!o.ctrlKey,l=Nt(o,t);if(o.ctrlKey&&s&&l&&o.preventDefault(),a||l)return null;o.preventDefault(),n.call(this,o,i)}}r(wh,"createZoomOnScrollHandler");function ic(t,e,n){let o=t.pointerDrag;!o||o.moveStarted||(o.moveStarted=!0,n?.(e,t.prevViewport))}r(ic,"startMove");function sc(t,e,n,o){let i=t.pointerDrag;i&&(ic(t,e,o),i.dragging=!0,i.isTouch||n(!0))}r(sc,"startPointerDrag");function vh(t){return t?.type==="mousemove"||t?.type==="touchmove"}r(vh,"isPointerMove");function xh(t,e){return"touches"in t?Array.from(t.touches).find(n=>n.identifier===e)??null:t}r(xh,"getPointerPosition$1");function bh({zoomPanValues:t,paneDragThreshold:e,onDraggingChange:n,onPanZoomStart:o}){return i=>{let s=i.sourceEvent;if(!s||s.internal)return;let a=Rr(i.transform);t.mouseButton="button"in s?s.button:0,t.isZoomingOrPanning=!0,t.prevViewport=a,t.pointerDrag=null;let l=s.type==="touchstart";if(s.type==="mousedown"||l){let c=l?s.touches[0]:null,{clientX:u,clientY:d}=c??s;t.pointerDrag={isTouch:l,touchId:c?.identifier??null,startX:u,startY:d,startTransform:i.transform,thresholdCrossed:!1,lastMove:null,moveStarted:!1,dragging:!1},e===0&&sc(t,s,n,o);return}o?.(s,a)}}r(bh,"createPanZoomStartHandler");function Ch({zoomPanValues:t,d3Selection:e,paneDragThreshold:n,onDraggingChange:o,onTransformChange:i,onPanZoomStart:s,onPanZoom:a}){return l=>{let c=l.sourceEvent,u=t.pointerDrag;if(u){let d=vh(c)&&c!==u.lastMove;if(d&&(u.lastMove=c),d&&!u.thresholdCrossed){let h=xh(c,u.touchId),f="touches"in c&&c.touches.length>1;if(!h||f)u.thresholdCrossed=!0;else{let w=h.clientX-u.startX,S=h.clientY-u.startY;u.thresholdCrossed=w*w+S*S>n*n}}if(!u.dragging)if(!d)u.startTransform=l.transform,c?.internal||ic(t,c,s);else if(u.thresholdCrossed)sc(t,c,o,s);else{e.property("__zoom",u.startTransform);return}}c?.sync||i([l.transform.x,l.transform.y,l.transform.k]),a&&!c?.internal&&(!u||u.moveStarted)&&a?.(l.sourceEvent,Rr(l.transform))}}r(Ch,"createPanZoomHandler");function Eh({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(a.sourceEvent?.internal)return;t.isZoomingOrPanning=!1;let l=t.pointerDrag;if(t.pointerDrag=null,s&&mh(e,t.mouseButton??0)&&!l?.thresholdCrossed&&a.sourceEvent&&s(a.sourceEvent),!(l&&!l.moveStarted)&&(o(!1),i)){let c=Rr(a.transform);t.prevViewport=c,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{i?.(a.sourceEvent,c)},n?150:0)}}}r(Eh,"createPanZoomEndHandler");function _h({panActivationKeyPressed:t,zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:o,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:c,noPanClassName:u,lib:d,connectionInProgress:h}){return f=>{let w=e||n,S=o&&f.ctrlKey,g=f.type==="wheel";if((i===!0||Array.isArray(i)&&i.includes(1))&&gn(f)&&f.button===1&&f.type==="mousedown"&&(Nt(f,`${d}-flow__node`)||Nt(f,`${d}-flow__edge`)||Nt(f,`${d}-flow__selection`)||Nt(f,`${d}-flow__nodesselection`)))return!0;if(!i&&!w&&!s&&!a&&!o||l||h&&!g||Nt(f,c)&&g||Nt(f,u)&&(!g||s&&g&&!e)||!o&&f.ctrlKey&&g)return!1;if(!o&&Nr(f)&&f.type==="touchstart"&&f.touches.length>1)return f.preventDefault(),!1;if(!w&&!s&&!S&&g||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&gn(f)&&f.type==="mousedown"&&!i.includes(f.button))return!1;let y=gn(f)?f.button:0,m=Array.isArray(i)&&i.includes(y)||y<=1;return(!f.ctrlKey||g||t)&&m}}r(_h,"createFilter");function ac({domNode:t,minZoom:e,maxZoom:n,translateExtent:o,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){let u={isZoomingOrPanning:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1,pointerDrag:null},d=t.getBoundingClientRect(),h=[[0,0],[d.width,d.height]],f=typeof ResizeObserver<"u"?new ResizeObserver(O=>{let I=O[0];I?.contentRect&&(h=[[0,0],[I.contentRect.width,I.contentRect.height]])}):null;f?.observe(t);let w=Oo().extent(()=>h).scaleExtent([e,n]).translateExtent(o),S=Xe(t).call(w);p({x:i.x,y:i.y,zoom:mn(i.zoom,e,n)},[[0,0],[d.width,d.height]],o);let g=S.on("wheel.zoom"),y=S.on("dblclick.zoom");w.wheelDelta(rc);async function m(O,I){return S?new Promise(v=>{w?.interpolate(I?.interpolate==="linear"?Qo:ln).transform(Xs(S,I?.duration,I?.ease,v),O)}):!1}r(m,"setTransform");function E({noWheelClassName:O,noPanClassName:I,onPaneContextMenu:v,userSelectionActive:k,panOnScroll:M,panOnDrag:T,panOnScrollMode:A,panOnScrollSpeed:L,preventScrolling:X,zoomOnPinch:H,zoomOnScroll:K,zoomOnDoubleClick:$,panActivationKeyPressed:z=!1,zoomActivationKeyPressed:F,lib:V,onTransformChange:Z,connectionInProgress:Y,paneDragThreshold:W}){k&&!u.isZoomingOrPanning&&w.on("zoom",null);let q=M&&!F&&!k,G=ot(W)&&W>0?W:0;w.clickDistance(G);let j=q?Sh({zoomPanValues:u,noWheelClassName:O,d3Selection:S,d3Zoom:w,panOnScrollMode:A,panOnScrollSpeed:L,zoomOnPinch:H,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):wh({noWheelClassName:O,preventScrolling:X,d3ZoomHandler:g});S.on("wheel.zoom",j,{passive:!1});let ne=bh({zoomPanValues:u,paneDragThreshold:G,onDraggingChange:c,onPanZoomStart:a});w.on("start",ne);let J=Ch({zoomPanValues:u,d3Selection:S,paneDragThreshold:G,onPanZoomStart:a,onPanZoom:s,onDraggingChange:c,onTransformChange:Z});w.on("zoom",J);let ee=Eh({zoomPanValues:u,panOnDrag:T,panOnScroll:M,onPaneContextMenu:v,onPanZoomEnd:l,onDraggingChange:c});w.on("end",ee);let oe=_h({panActivationKeyPressed:z,zoomActivationKeyPressed:F,panOnDrag:T,zoomOnScroll:K,panOnScroll:M,zoomOnDoubleClick:$,zoomOnPinch:H,userSelectionActive:k,noPanClassName:I,noWheelClassName:O,lib:V,connectionInProgress:Y});w.filter(oe),$?S.on("dblclick.zoom",y):S.on("dblclick.zoom",null)}r(E,"update");function C(){w.on("zoom",null),f?.disconnect()}r(C,"destroy");async function p(O,I,v){let k=Vs(O),M=w?.constrain()(k,I,v);return M&&await m(M),M}r(p,"setViewportConstrained");async function x(O,I){return m(Vs(O),I)}r(x,"setViewport");function N(O){if(S){let I=Vs(O),v=S.property("__zoom");(v.k!==O.zoom||v.x!==O.x||v.y!==O.y)&&w?.transform(S,I,null,{sync:!0})}}r(N,"syncViewport");function _(){let O=S?Io(S.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}r(_,"getViewport");async function P(O,I){return S?new Promise(v=>{w?.interpolate(I?.interpolate==="linear"?Qo:ln).scaleTo(Xs(S,I?.duration,I?.ease,v),O)}):!1}r(P,"scaleTo");async function b(O,I){return S?new Promise(v=>{w?.interpolate(I?.interpolate==="linear"?Qo:ln).scaleBy(Xs(S,I?.duration,I?.ease,v),O)}):!1}r(b,"scaleBy");function R(O){w?.scaleExtent(O)}r(R,"setScaleExtent");function D(O){w?.translateExtent(O)}return r(D,"setTranslateExtent"),{update:E,destroy:C,setViewport:x,setViewportConstrained:p,getViewport:_,scaleTo:P,scaleBy:b,setScaleExtent:R,setTranslateExtent:D,syncViewport:N}}r(ac,"XYPanZoom");var xn=(function(t){return t.Line="line",t.Handle="handle",t})({});function Nh({width:t,prevWidth:e,height:n,prevHeight:o,affectsX:i,affectsY:s}){let a=t-e,l=n-o,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&i&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}r(Nh,"getResizeDirection");function _l(t){return{isHorizontal:t.includes("right")||t.includes("left"),isVertical:t.includes("bottom")||t.includes("top"),affectsX:t.includes("left"),affectsY:t.includes("top")}}r(_l,"getControlDirection");function Et(t,e){return Math.max(0,e-t)}r(Et,"getLowerExtentClamp");function _t(t,e){return Math.max(0,t-e)}r(_t,"getUpperExtentClamp");function gr(t,e,n){return Math.max(0,e-t,t-n)}r(gr,"getSizeClamp");function Nl(t,e){return t?!e:e}r(Nl,"xor");function Mh(t,e,n,o,i,s,a,l){let{affectsX:c,affectsY:u}=e,{isHorizontal:d,isVertical:h}=e,f=d&&h,{xSnapped:w,ySnapped:S}=n,{minWidth:g,maxWidth:y,minHeight:m,maxHeight:E}=o,{x:C,y:p,width:x,height:N,aspectRatio:_}=t,P=Math.floor(d?w-t.pointerX:0),b=Math.floor(h?S-t.pointerY:0),R=x+(c?-P:P),D=N+(u?-b:b),O=-s[0]*x,I=-s[1]*N,v=gr(R,g,y),k=gr(D,m,E);if(a){let A=0,L=0;c&&P<0?A=Et(C+P+O,a[0][0]):!c&&P>0&&(A=_t(C+R+O,a[1][0])),u&&b<0?L=Et(p+b+I,a[0][1]):!u&&b>0&&(L=_t(p+D+I,a[1][1])),v=Math.max(v,A),k=Math.max(k,L)}if(l){let A=0,L=0;c&&P>0?A=_t(C+P,l[0][0]):!c&&P<0&&(A=Et(C+R,l[1][0])),u&&b>0?L=_t(p+b,l[0][1]):!u&&b<0&&(L=Et(p+D,l[1][1])),v=Math.max(v,A),k=Math.max(k,L)}if(i){if(d){let A=gr(R/_,m,E)*_;if(v=Math.max(v,A),a){let L=!c&&!u||c&&!u&&f?_t(p+I+R/_,a[1][1])*_:Et(p+I+(c?P:-P)/_,a[0][1])*_;v=Math.max(v,L)}if(l){let L=!c&&!u||c&&!u&&f?Et(p+R/_,l[1][1])*_:_t(p+(c?P:-P)/_,l[0][1])*_;v=Math.max(v,L)}}if(h){let A=gr(D*_,g,y)/_;if(k=Math.max(k,A),a){let L=!c&&!u||u&&!c&&f?_t(C+D*_+O,a[1][0])/_:Et(C+(u?b:-b)*_+O,a[0][0])/_;k=Math.max(k,L)}if(l){let L=!c&&!u||u&&!c&&f?Et(C+D*_,l[1][0])/_:_t(C+(u?b:-b)*_,l[0][0])/_;k=Math.max(k,L)}}}b=b+(b<0?k:-k),P=P+(P<0?v:-v),i&&(f?R>D*_?b=(Nl(c,u)?-P:P)/_:P=(Nl(c,u)?-b:b)*_:d?(b=P/_,u=c):(P=b*_,c=u));let M=c?C+P:C,T=u?p+b:p;return{width:x+(c?-P:P),height:N+(u?-b:b),x:s[0]*P*(c?-1:1)+M,y:s[1]*b*(u?-1:1)+T}}r(Mh,"getDimensionsAfterResize");var lc={width:0,height:0,x:0,y:0},Ph={...lc,pointerX:0,pointerY:0,aspectRatio:1};function kh(t,e,n){let o=n.x+t.internals.positionAbsolute.x-e.internals.positionAbsolute.x,i=n.y+t.internals.positionAbsolute.y-e.internals.positionAbsolute.y,s=t.measured.width??0,a=t.measured.height??0;return[[o,i],[o+s,i+a]]}r(kh,"nodeToChildExtent");function cc({domNode:t,nodeId:e,getStoreItems:n,onChange:o,onEnd:i}){let s=Xe(t),a={controlDirection:_l("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:h,resizeDirection:f,onResizeStart:w,onResize:S,onResizeEnd:g,shouldResize:y}){let m={...lc},E={...Ph};a={boundaries:d,resizeDirection:f,keepAspectRatio:h,controlDirection:_l(u)};let C,p=null,x=[],N,_,P,b=So().on("start",R=>{let{nodeLookup:D,transform:O,snapGrid:I,snapToGrid:v,nodeOrigin:k,paneDomNode:M}=n();if(C=D.get(e),!C)return;p=M?.getBoundingClientRect()??null;let{xSnapped:T,ySnapped:A}=Do(R.sourceEvent,{transform:O,snapGrid:I,snapToGrid:v,containerBounds:p}),L=C.measured.width??0,X=C.measured.height??0,H=C.origin??k,K=C.parentId?D.get(C.parentId)?.internals.positionAbsolute:void 0;m={width:L,height:X,x:C.internals.positionAbsolute.x-(K?.x??0)+H[0]*L,y:C.internals.positionAbsolute.y-(K?.y??0)+H[1]*X},E={...m,pointerX:T,pointerY:A,aspectRatio:m.width/m.height},N=void 0,_=To(C.extent)?C.extent:void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(N=D.get(C.parentId)),N&&C.extent==="parent"&&(_=[[0,0],[N.measured.width,N.measured.height]]),x=[],P=void 0;for(let[$,z]of D)if(z.parentId===e&&(x.push({id:$,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){let F=kh(z,C,m);P?P=[[Math.min(F[0][0],P[0][0]),Math.min(F[0][1],P[0][1])],[Math.max(F[1][0],P[1][0]),Math.max(F[1][1],P[1][1])]]:P=F}w?.(R,{...m})}).on("drag",R=>{let{transform:D,snapGrid:O,snapToGrid:I,nodeOrigin:v}=n(),k=Do(R.sourceEvent,{transform:D,snapGrid:O,snapToGrid:I,containerBounds:p}),M=[];if(!C)return;let{x:T,y:A,width:L,height:X}=m,H={},K=C.origin??v,{width:$,height:z,x:F,y:V}=Mh(E,a.controlDirection,k,a.boundaries,a.keepAspectRatio,K,_,P),Z=$!==L,Y=z!==X,W=F!==T&&Z,q=V!==A&&Y;if(!W&&!q&&!Z&&!Y)return;let G={prevValues:{...m},startX:E.x,startY:E.y,childNodes:x.map(J=>({...J,position:{...J.position}}))};if((W||q||K[0]===1||K[1]===1)&&(H.x=W?F:m.x,H.y=q?V:m.y,m.x=H.x,m.y=H.y,x.length>0)){let J=F-T,ee=V-A;for(let oe of x)oe.position={x:oe.position.x-J+K[0]*($-L),y:oe.position.y-ee+K[1]*(z-X)},M.push(oe)}if((Z||Y)&&(H.width=Z&&(!a.resizeDirection||a.resizeDirection==="horizontal")?$:m.width,H.height=Y&&(!a.resizeDirection||a.resizeDirection==="vertical")?z:m.height,m.width=H.width,m.height=H.height),N&&C.expandParent){let J=K[0]*(H.width??0);H.x&&H.x<J&&(m.x=J,E.x=E.x-(H.x-J));let ee=K[1]*(H.height??0);H.y&&H.y<ee&&(m.y=ee,E.y=E.y-(H.y-ee))}let j=Nh({width:m.width,prevWidth:L,height:m.height,prevHeight:X,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),ne={...m,direction:j};if(y?.(R,ne)===!1){m=G.prevValues,E.x=G.startX,E.y=G.startY,x.forEach((J,ee)=>{J.position=G.childNodes[ee].position});return}S?.(R,ne),o(H,M)}).on("end",R=>{g?.(R,{...m}),i?.({...m})});s.call(b)}r(l,"update");function c(){s.on(".drag",null)}return r(c,"destroy"),{update:l,destroy:c}}r(cc,"XYResizer");function Ih(t,e){return uc(t,e,Dh)}r(Ih,"applyNodeChanges");function Oh(t,e){return uc(t,e,Ah)}r(Oh,"applyEdgeChanges");function uc(t,e,n){let o=[],i=e.getNewElements(),s=new Set(i.map(l=>l.id)),a;for(let l of[t,i]){a=!a;e:for(let c of l){if(!a&&!s.has(c.id))continue;let u=e.getForElement(c.id);if(!u.length){o.push(c),s.delete(c.id);continue}let d={...c};for(let h of u)switch(h.type){case"remove":s.delete(c.id);continue e;case"replace":d={...h.item};continue;default:n(d,h)}o.push(d),s.delete(c.id)}}return o}r(uc,"applyChanges");function Dh(t,e){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===!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;case"update":Object.assign(t,e.item);break;case"data":t.data=e.replace?e.data:{...t.data,...e.data};break;default:return}}r(Dh,"applyNodeChange");function Ah(t,e){switch(e.type){case"select":t.selected=e.selected;break;case"update":Object.assign(t,e.item);break;case"data":t.data=e.replace?e.data:{...t.data,...e.data};break;default:return}}r(Ah,"applyEdgeChange");function kt(t,e){return{id:t,type:"select",selected:e}}r(kt,"selectionChange");function yr(t,e){return{id:t,type:"position",position:e}}r(yr,"positionChange");function Th(t,e){return{id:t,type:"dimensions",dimensions:e}}r(Th,"dimensionChange");function zr(t){return{id:t,type:"remove"}}r(zr,"removeChange");function dc(t){return{id:t.id,item:t,type:"add"}}r(dc,"addChange");function fc(t){return{id:t.id,item:t,type:"replace"}}r(fc,"replaceChange");function Ro(t){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(t)}r(Ro,"_typeof");function Rh(t,e){if(Ro(t)!="object"||!t)return t;var n;if(typeof Symbol<"u"&&(n=t[Symbol.toPrimitive])!==void 0){var o=n.call(t,e||"default");if(Ro(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}r(Rh,"toPrimitive");function zh(t){var e=Rh(t,"string");return Ro(e)=="symbol"?e:e+""}r(zh,"toPropertyKey");function Ys(t,e,n){return(e=zh(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}r(Ys,"_defineProperty");var hc;hc=Symbol.iterator;var pc=class{static{r(this,"Changeset")}constructor(t){this.applyChanges=t,Ys(this,"changeTypes",{}),Ys(this,"changeMap",new Map),Ys(this,"addChanges",new Map)}add(t){let e=Array.isArray(t)?t:[t];for(let n of e){if(this.changeTypes[n.type]=!0,n.type==="add"){this.addChanges.set(n.id,n);continue}let o=this.changeMap.get(n.id);o?o.push(n):this.changeMap.set(n.id,[n])}}remove(t){if(t.type==="add"){this.addChanges.get(t.id)===t&&this.addChanges.delete(t.id);return}let e=this.changeMap.get(t.id);if(!e)return;let n=e.indexOf(t);if(!(n<0)){if(e.length===1){this.changeMap.delete(t.id);return}e.splice(n,1)}}getForElement(t){return this.changeMap.get(t)||[]}removeForElement(t){this.changeMap.delete(t),this.addChanges.delete(t)}clear(){this.changeTypes={},this.changeMap.clear(),this.addChanges.clear()}isEmpty(){return this.changeMap.size===0&&this.addChanges.size===0}*[hc](){yield*this.addChanges.values();for(let t of this.changeMap.values())yield*t}getNewElements(){let t=[];for(let e of this.addChanges.values())t.push(e.item);return t}toArray(){let t=[];for(let e of this.addChanges.values())t.push(e);for(let e of this.changeMap.values())for(let n of e)t.push(n);return t}getByType(t){if(this.changeTypes[t]){if(t==="add")return Array.from(this.addChanges.values());let e=[];for(let n of this.changeMap.values())for(let o of n)o.type===t&&e.push(o);return e}return[]}applyTo(t){return this.applyChanges(t,this)}},$r=class extends pc{static{r(this,"NodeChangeset")}constructor(t){super(Ih),t&&this.add(t)}getForNode(t){return this.getForElement(t)}removeForNode(t){this.removeForElement(t)}getNewNodes(){return this.getNewElements()}},Lr=class extends pc{static{r(this,"EdgeChangeset")}constructor(t){super(Oh),t&&this.add(t)}getForEdge(t){return this.getForElement(t)}removeForEdge(t){this.removeForElement(t)}getNewEdges(){return this.getNewElements()}};function Xt(t,e=new Set){let n=[];for(let[,o]of t){let i=e.has(o.id);!(o.selected===void 0&&!i)&&o.selected!==i&&n.push(kt(o.id,i))}return n}r(Xt,"getSelectionChanges");var te=At(xc(),1);function He(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,o;n<t.length;n++)(o=He(t[n]))!==""&&(e+=(e&&" ")+o);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}r(He,"cc");var U=At(jo(),1);var bc=r(t=>{let e,n=new Set,o=r((u,d)=>{let h=typeof u=="function"?u(e):u;if(!Object.is(h,e)){let f=e;e=d??(typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(w=>w(e,f))}},"setState"),i=r(()=>e,"getState"),l={setState:o,getState:i,getInitialState:r(()=>c,"getInitialState"),subscribe:r(u=>(n.add(u),()=>n.delete(u)),"subscribe")},c=e=t(o,i,l);return l},"createStoreImpl"),Yt=r((t=>t?bc(t):bc),"createStore");var Vr=At(jo(),1);var np=r(t=>t,"identity");function Wt(t,e=np){let n=Vr.default.useSyncExternalStore(t.subscribe,Vr.default.useCallback(()=>e(t.getState()),[t,e]),()=>e(t.getInitialState()));return Vr.default.useDebugValue(n),n}r(Wt,"useStore");var B=At(Ta(),1);var Cc=r(t=>Symbol.iterator in t,"isIterable"),Ec=r(t=>"entries"in t,"hasIterableEntries"),_c=r((t,e)=>{let n=t instanceof Map?t:new Map(t.entries()),o=e instanceof Map?e:new Map(e.entries());if(n.size!==o.size)return!1;for(let[i,s]of n)if(!o.has(i)||!Object.is(s,o.get(i)))return!1;return!0},"compareEntries"),op=r((t,e)=>{let n=t[Symbol.iterator](),o=e[Symbol.iterator](),i=n.next(),s=o.next();for(;!i.done&&!s.done;){if(!Object.is(i.value,s.value))return!1;i=n.next(),s=o.next()}return!!i.done&&!!s.done},"compareIterables");function fa(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Cc(t)&&Cc(e)?Ec(t)&&Ec(e)?_c(t,e):op(t,e):_c({entries:r(()=>Object.entries(t),"entries")},{entries:r(()=>Object.entries(e),"entries")})}r(fa,"shallow");var rp=At(qu(),1);var Sa=(0,U.createContext)(null),ip=Sa.Provider;function sp(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(let[o,i]of t)if(!e.has(o)||!Object.is(i,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(let o of t)if(!e.has(o))return!1;return!0}let n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!Object.is(t[o],e[o]))return!1;return!0}r(sp,"bt");function It(t){let e=(0,te.c)(2),n=(0,U.useRef)(void 0),o;return e[0]===t?o=e[1]:(o=r(i=>{let s=t(i);return sp(n.current,s)?n.current:n.current=s},"i"),e[0]=t,e[1]=o),o}r(It,"xt");var Nn=r(t=>t,"St"),ap=Qe.error001("react");function ue(t){let e=t===void 0?Nn:t,{optionsStore:n}=ye();return Wt(n,e)}r(ue,"Q");function ye(){let t=(0,U.useContext)(Sa);if(t===null)throw Error(ap);return t}r(ye,"$");function rt(t){let e=t===void 0?Nn:t;return Wt(ye().viewportStore,e)}r(rt,"wt");function wa(t){let e=t===void 0?Nn:t;return Wt(ye().connectionStore,e)}r(wa,"Tt");function Ot(t){let e=t===void 0?Nn:t;return Wt(ye().nodesStore,e)}r(Ot,"Et");function va(t){let e=t===void 0?Nn:t;return Wt(ye().edgesStore,e)}r(va,"Dt");function lp(t){let e=t===void 0?Nn:t;return Wt(ye().selectionStore,e)}r(lp,"Ot");function ma(t,e){let n=(0,te.c)(3),o=(0,U.useRef)(),i;return n[0]!==e||n[1]!==t?(i=r(s=>{let a=t(s);return o.current!==void 0&&e(o.current,a)?o.current:(o.current=a,a)},"a"),n[0]=e,n[1]=t,n[2]=i):i=n[2],i}r(ma,"kt");var Nc={display:"none"},cp={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Jc="react-flow__node-desc",eu="react-flow__edge-desc";function up(t){let e=(0,te.c)(3),{rfId:n}=t,o=ue(dp),i=`react-flow__aria-live-${n}`,s;return e[0]!==o||e[1]!==i?(s=(0,B.jsx)("div",{id:i,"aria-live":"assertive","aria-atomic":"true",style:cp,children:o}),e[0]=o,e[1]=i,e[2]=s):s=e[2],s}r(up,"Pt");function dp(t){return t.ariaLiveMessage}r(dp,"Ft");function fp(t){let e=(0,te.c)(13),{rfId:n,disableKeyboardA11y:o}=t,i=ue(hp),s=`${Jc}-${n}`,a=o?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"],l;e[0]!==s||e[1]!==a?(l=(0,B.jsx)("div",{id:s,style:Nc,children:a}),e[0]=s,e[1]=a,e[2]=l):l=e[2];let c=`${eu}-${n}`,u=i["edge.a11yDescription.default"],d;e[3]!==c||e[4]!==u?(d=(0,B.jsx)("div",{id:c,style:Nc,children:u}),e[3]=c,e[4]=u,e[5]=d):d=e[5];let h;e[6]!==o||e[7]!==n?(h=!o&&(0,B.jsx)(up,{rfId:n}),e[6]=o,e[7]=n,e[8]=h):h=e[8];let f;return e[9]!==l||e[10]!==d||e[11]!==h?(f=(0,B.jsxs)(B.Fragment,{children:[l,d,h]}),e[9]=l,e[10]=d,e[11]=h,e[12]=f):f=e[12],f}r(fp,"It");function hp(t){return t.ariaLabelConfig}r(hp,"Lt");var Mn=(0,U.forwardRef)((t,e)=>{let n=(0,te.c)(15),o,i,s,a,l;n[0]===t?(o=n[1],i=n[2],s=n[3],a=n[4],l=n[5]):({position:l,children:o,className:i,style:a,...s}=t,n[0]=t,n[1]=o,n[2]=i,n[3]=s,n[4]=a,n[5]=l);let c=l===void 0?"top-left":l,u;if(n[6]!==i||n[7]!==c){let h=`${c}`.split("-");u=He(["react-flow__panel",i,...h]),n[6]=i,n[7]=c,n[8]=u}else u=n[8];let d;return n[9]!==o||n[10]!==e||n[11]!==s||n[12]!==a||n[13]!==u?(d=(0,B.jsx)("div",{className:u,style:a,ref:e,...s,children:o}),n[9]=o,n[10]=e,n[11]=s,n[12]=a,n[13]=u,n[14]=d):d=n[14],d});Mn.displayName="Panel";var Mc="https://reactflow.dev?utm_source=attribution";function pp(t){let e=(0,te.c)(4),{proOptions:n,position:o}=t,i=o===void 0?"bottom-right":o,s;if(e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0],(0,U.useEffect)(gp,s),n?.hideAttribution)return null;let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,B.jsx)("a",{href:Mc,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"}),e[1]=a):a=e[1];let l;return e[2]===i?l=e[3]:(l=(0,B.jsx)(Mn,{position:i,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Mc}`,children:a}),e[2]=i,e[3]=l),l}r(pp,"Bt");function gp(){}r(gp,"Vt");var Pc=r(t=>{let e=[];for(let[,n]of t.nodeLookup)n.selected&&e.push(n.internals.userNode);return e},"Ht"),kc=r(t=>{let e=[];for(let[,n]of t.edgeLookup)n.selected&&e.push(n);return e},"Ut"),Ic=r(t=>t.id,"Wt");function Oc(t,e){return fa(t.map(Ic),e.map(Ic))}r(Oc,"Gt");function mp(t){let e=(0,te.c)(12),{onSelectionChange:n}=t,{optionsStore:o,nodesStore:i,edgesStore:s}=ye(),a=Ot(ma(Pc,Oc)),l=va(ma(kc,Oc)),c;e[0]!==s||e[1]!==i||e[2]!==n||e[3]!==o?(c=r(()=>{let d={nodes:Pc(i.getState()),edges:kc(s.getState())};n?.(d),o.getState().onSelectionChangeHandlers.forEach(h=>h(d))},"l"),e[0]=s,e[1]=i,e[2]=n,e[3]=o,e[4]=c):c=e[4];let u;return e[5]!==s||e[6]!==i||e[7]!==n||e[8]!==o||e[9]!==l||e[10]!==a?(u=[a,l,n,o,i,s],e[5]=s,e[6]=i,e[7]=n,e[8]=o,e[9]=l,e[10]=a,e[11]=u):u=e[11],(0,U.useEffect)(c,u),null}r(mp,"Kt");var yp=r(t=>t.onSelectionChangeHandlers.length>0,"qt");function Sp(t){let e=(0,te.c)(2),{onSelectionChange:n}=t,o=ue(yp);if(n||o){let i;return e[0]===n?i=e[1]:(i=(0,B.jsx)(mp,{onSelectionChange:n}),e[0]=n,e[1]=i),i}return null}r(Sp,"Jt");var tu=[0,0],wp={x:0,y:0,zoom:1},Dc=[..."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".split("."),"rfId"],Ac={translateExtent:Ft,nodeOrigin:tu,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function vp(t){let{optionsStore:e}=ye(),n=(0,U.useRef)(Ac);return(0,U.useEffect)(()=>{let{setDefaultNodesAndEdges:o,reset:i}=e.getState();return o(t.defaultNodes,t.defaultEdges),()=>{n.current=Ac,i()}},[]),(0,U.useEffect)(()=>{let{setNodes:o,setEdges:i,setMinZoom:s,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:c}=e.getState();for(let u of Dc){let d=t[u];d!==n.current[u]&&t[u]!==void 0&&(u==="nodes"?o(d):u==="edges"?i(d):u==="minZoom"?s(d):u==="maxZoom"?a(d):u==="translateExtent"?l(d):u==="nodeExtent"?c(d):u==="ariaLabelConfig"?e.setState({ariaLabelConfig:Dl(d)}):u==="fitView"?e.setState({fitViewQueued:d}):u==="fitViewOptions"?e.setState({fitViewOptions:d}):e.setState({[u]:d}))}n.current=t},Dc.map(o=>t[o])),null}r(vp,"$t");var Tc=typeof document<"u"?document:null;function Xo(t,e){let n=(0,te.c)(12),o=t===void 0?null:t,i;n[0]===e?i=n[1]:(i=e===void 0?{target:Tc,actInsideInputWithModifier:!0}:e,n[0]=e,n[1]=i);let s=i,[a,l]=(0,U.useState)(!1),c=(0,U.useRef)(!1),u;n[2]===Symbol.for("react.memo_cache_sentinel")?(u=new Set([]),n[2]=u):u=n[2];let d=(0,U.useRef)(u),h;n[3]===o?h=n[4]:(h=xp(o),n[3]=o,n[4]=h);let[f,w]=h,S;n[5]!==o||n[6]!==f||n[7]!==w||n[8]!==s?(S=r(()=>{let y=s?.target??Tc,m=s?.actInsideInputWithModifier??!0;if(o!==null){let E=r(x=>{if(c.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!c.current||c.current&&!m)&&sa(x))return!1;let N=zc(x.code,w);if(d.current.add(x[N]),Rc(f,d.current,!1)){let _=x.composedPath?.()?.[0]||x.target,P=_?.nodeName==="BUTTON"||_?.nodeName==="A";s.preventDefault!==!1&&(c.current||!P)&&x.preventDefault(),l(!0)}},"n"),C=r(x=>{let N=zc(x.code,w);Rc(f,d.current,!0)?(l(!1),d.current.clear()):d.current.delete(x[N]),x.key==="Meta"&&d.current.clear(),c.current=!1},"r"),p=r(()=>{d.current.clear(),l(!1)},"i");return y?.addEventListener("keydown",E),y?.addEventListener("keyup",C),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{y?.removeEventListener("keydown",E),y?.removeEventListener("keyup",C),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},"h"),n[5]=o,n[6]=f,n[7]=w,n[8]=s,n[9]=S):S=n[9];let g;return n[10]===o?g=n[11]:(g=[o,l],n[10]=o,n[11]=g),(0,U.useEffect)(S,g),a}r(Xo,"tn");function xp(t){if(t!==null){let e=(Array.isArray(t)?t:[t]).filter(n=>typeof n=="string").map(n=>n.replace(/\+/g,`
|
|
2
2
|
`).replace(`
|
|
3
3
|
|
|
4
4
|
`,`
|