index-22b6f957.js 210 KB

123456789101112131415161718192021222324252627
  1. import{b as hs,d as ue,F as ps,p as Ue,bB as vs,o as Ye,J as ms,c as Z,bC as gs,bD as Ee,bd as Xo,u as ys,f as se,bE as _s,bF as ws,v as xs,m as bs,k as Ss,n as N,bG as Es,bH as Cs,aJ as Io,P as Ft,bI as Ns,bJ as Wo,bK as ks,aP as Se,bL as Ps,K as $s,a_ as Fi,bM as Yi,j as Gi,Z as q,a1 as ae,aV as Qe,T as f,ay as Tt,bx as Ui,h as _e,e as sn,bN as Is,L as Dt,a0 as X,C as Je,I as Lt,bO as Ms,r as Ts,a7 as H,a6 as K,a9 as Me,a2 as Fe,a3 as On,av as tt,be as zn,bP as Ds,$ as ge,bQ as Xi,bR as yn,bS as Mo,ao as Os,bT as zs,bU as ye,au as Wi,bV as xe,bW as Oe,bX as As,bY as Rs,aY as Bs,a5 as Ne,bZ as Ls,aC as De,bj as Be,b_ as Vt,bi as Ki,b9 as Le,aB as an,Y as An,Q as Ot,b5 as it,ap as Zi,b$ as co,b7 as Vs,c0 as Hs,c1 as Fs,aG as mt,a8 as Ge,aH as Ys,b3 as Ve,c2 as Gs,bb as Xe,bl as Us,bk as Xs,at as Ws,c3 as Nt,c4 as Ks,bn as Sn,c5 as To,c6 as Pt,bs as fo,c7 as qi,c8 as zt,c9 as Ut,bg as bt,N as ji,br as Ko,ca as Zs,bq as Qi,bf as qs,a$ as js,bm as Qs,S as Js,b0 as ea}from"./index-8a67e3df.js";import{c as Xt,d as ze}from"./dayjs-919e6097.js";import{_ as Ji}from"./index.vue_vue_type_script_setup_true_lang-d980f666.js";import{g as ta,a as na}from"./logrotate-d8e38f16.js";import{S as oa}from"./state-f52d1a34.js";import{s as ia}from"./schema-fab9bc0f.js";import{s as ra}from"./tree-title-9e6e74b4.js";import{g as sa}from"./utils-cec4b140.js";import{M as aa,Y as la}from"./index-e8afe808.js";import{u as Rn}from"./system-7d6c6ba1.js";import{g as ua,a as ca}from"./schema-2e778db4.js";import{d as da,u as fa}from"./pullOnStart-de2f464a.js";import"./index-8852fa89.js";import{F as Ae}from"./Form-dde1bdea.js";import{V as ha}from"./jb4-5138f1a1.js";import{u as pa}from"./useAddPushForm-c65f95c9.js";import{d as va,g as er,a as En}from"./mp4-0d5b1f75.js";import{D as ma}from"./DownloadOutlined-3b5dda91.js";import{V as ga}from"./VideoPlayer-ced8f94f.js";import{_ as ya}from"./index-66456a53.js";import{a as _a}from"./useHeaderSetting-943f0a5a.js";import"./stream-type-63b6e1e6.js";import"./FormItem-52c83ce9.js";import"./toInteger-9a80771f.js";import"./canvas-2aaf4e1d.js";import"./index-6a257713.js";var wa=["placement","overlayClassName"],xa=function(){return Ue(Ue({},Ns()),{},{prefixCls:String,content:Ft.any,title:Ft.any,okType:{type:String,default:"primary"},disabled:{type:Boolean,default:!1},okText:Ft.any,cancelText:Ft.any,icon:Ft.any,okButtonProps:{type:Object,default:void 0},cancelButtonProps:{type:Object,default:void 0},showCancel:{type:Boolean,default:!0},onConfirm:Function,onCancel:Function})},ba=ue({compatConfig:{MODE:3},name:"APopconfirm",props:ps(xa(),Ue(Ue({},vs()),{},{trigger:"click",transitionName:"zoom-big",placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0,okType:"primary",disabled:!1})),slots:["title","content","okText","icon","cancelText","cancelButton","okButton"],emits:["update:visible","visibleChange"],setup:function(t,n){var o=n.slots,i=n.emit,r=n.expose;Ye(function(){ms(t.defaultVisible===void 0,"Popconfirm","'defaultVisible' is deprecated, please use 'v-model:visible'")});var s=Z();r({getPopupDomNode:function(){var P,J;return(P=s.value)===null||P===void 0||(J=P.getPopupDomNode)===null||J===void 0?void 0:J.call(P)}});var a=gs(!1,{value:Ee(t,"visible"),defaultValue:t.defaultVisible}),u=Xo(a,2),l=u[0],c=u[1],v=function(P,J){t.visible===void 0&&c(P),i("update:visible",P),i("visibleChange",P,J)},p=function(P){v(!1,P)},m=function(P){var J;return(J=t.onConfirm)===null||J===void 0?void 0:J.call(t,P)},x=function(P){var J;v(!1,P),(J=t.onCancel)===null||J===void 0||J.call(t,P)},g=function(P){P.keyCode===$s.ESC&&l&&v(!1,P)},_=function(P){var J=t.disabled;J||v(P)},w=ys("popconfirm",t),d=w.prefixCls,h=w.getPrefixCls,y=se(function(){return h()}),O=se(function(){return h("popover")}),R=se(function(){return h("btn")}),B=_s("Popconfirm",ws.Popconfirm),U=Xo(B,1),W=U[0],Y=function(){var P,J,E,A,T=t.okButtonProps,D=t.cancelButtonProps,V=t.title,F=V===void 0?(P=o.title)===null||P===void 0?void 0:P.call(o):V,j=t.cancelText,M=j===void 0?(J=o.cancel)===null||J===void 0?void 0:J.call(o):j,z=t.okText,I=z===void 0?(E=o.okText)===null||E===void 0?void 0:E.call(o):z,$=t.okType,oe=t.icon,ve=oe===void 0?(A=o.icon)===null||A===void 0?void 0:A.call(o):oe,he=t.showCancel,me=he===void 0?!0:he,le=o.cancelButton,de=o.okButton,te=Ue({onClick:x,size:"small"},D),re=Ue(Ue({onClick:m},Wo($)),{},{size:"small"},T);return N("div",{class:"".concat(O.value,"-inner-content")},[N("div",{class:"".concat(O.value,"-message")},[ve||N(ks,null,null),N("div",{class:"".concat(O.value,"-message-title")},[F])]),N("div",{class:"".concat(O.value,"-buttons")},[me?le?le(te):N(Se,te,{default:function(){return[M||W.value.cancelText]}}):null,de?de(re):N(Ps,{buttonProps:Ue(Ue({size:"small"},Wo($)),T),actionFn:m,close:p,prefixCls:R.value,quitOnNullishReturnValue:!0,emitEvent:!0},{default:function(){return[I||W.value.okText]}})])])};return function(){var G,P=t.placement,J=t.overlayClassName,E=xs(t,wa),A=bs(E,["title","content","cancelText","okText","onUpdate:visible","onConfirm","onCancel"]),T=Ss(d.value,J);return N(Io,Ue(Ue({},A),{},{prefixCls:O.value,placement:P,onVisibleChange:_,visible:l.value,overlayClassName:T,transitionName:Cs(y.value,"zoom-big",t.transitionName),ref:s}),{default:function(){return[Es(((G=o.default)===null||G===void 0?void 0:G.call(o))||[],{onKeydown:function(F){g(F)}},!1)]},title:Y})}}});const Sa=hs(ba);var Ea={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"};const Ca=Ea;function Zo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),o.forEach(function(i){Na(e,i,n[i])})}return e}function Na(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Do=function(t,n){var o=Zo({},t,n.attrs);return N(Fi,Zo({},o,{icon:Ca}),null)};Do.displayName="QuestionCircleOutlined";Do.inheritAttrs=!1;const ut=Do;var ka={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"unordered-list",theme:"outlined"};const Pa=ka;function qo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),o.forEach(function(i){$a(e,i,n[i])})}return e}function $a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oo=function(t,n){var o=qo({},t,n.attrs);return N(Fi,qo({},o,{icon:Pa}),null)};Oo.displayName="UnorderedListOutlined";Oo.inheritAttrs=!1;const Ia=Oo;function Bn(e){return Xi()?(yn(e),!0):!1}function rt(e){return typeof e=="function"?e():f(e)}const Ma=typeof window<"u"&&typeof document<"u",Ta=e=>typeof e<"u",Da=Object.prototype.toString,Oa=e=>Da.call(e)==="[object Object]",za=()=>{};function Aa(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const tr=e=>e();function Ra(e=tr){const t=Z(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:As(t),pause:n,resume:o,eventFilter:i}}function jo(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function Ba(e,t,n={}){const{eventFilter:o=tr,...i}=n;return _e(e,Aa(o,t),i)}function kt(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:s,resume:a,isActive:u}=Ra(o);return{stop:Ba(e,t,{...i,eventFilter:r}),pause:s,resume:a,isActive:u}}function La(e,t={}){if(!Mo(e))return Os(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=zs(()=>({get(){return e.value[o]},set(i){var r;if((r=rt(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=i,e.value=a}else{const a={...e.value,[o]:i};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=i}}));return n}function ho(e,t=!1){function n(v,{flush:p="sync",deep:m=!1,timeout:x,throwOnTimeout:g}={}){let _=null;const d=[new Promise(h=>{_=_e(e,y=>{v(y)!==t&&(_?.(),h(y))},{flush:p,deep:m,immediate:!0})})];return x!=null&&d.push(jo(x,g).then(()=>rt(e)).finally(()=>_?.())),Promise.race(d)}function o(v,p){if(!Mo(v))return n(y=>y===v,p);const{flush:m="sync",deep:x=!1,timeout:g,throwOnTimeout:_}=p??{};let w=null;const h=[new Promise(y=>{w=_e([e,v],([O,R])=>{t!==(O===R)&&(w?.(),y(O))},{flush:m,deep:x,immediate:!0})})];return g!=null&&h.push(jo(g,_).then(()=>rt(e)).finally(()=>(w?.(),rt(e)))),Promise.race(h)}function i(v){return n(p=>!!p,v)}function r(v){return o(null,v)}function s(v){return o(void 0,v)}function a(v){return n(Number.isNaN,v)}function u(v,p){return n(m=>{const x=Array.from(m);return x.includes(v)||x.includes(rt(v))},p)}function l(v){return c(1,v)}function c(v=1,p){let m=-1;return n(()=>(m+=1,m>=v),p)}return Array.isArray(rt(e))?{toMatch:n,toContains:u,changed:l,changedTimes:c,get not(){return ho(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:a,toBeUndefined:s,changed:l,changedTimes:c,get not(){return ho(e,!t)}}}function po(e){return ho(e)}function Va(e){var t;const n=rt(e);return(t=n?.$el)!=null?t:n}const nr=Ma?window:void 0;function or(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=nr):[t,n,o,i]=e,!t)return za;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],s=()=>{r.forEach(c=>c()),r.length=0},a=(c,v,p,m)=>(c.addEventListener(v,p,m),()=>c.removeEventListener(v,p,m)),u=_e(()=>[Va(t),rt(i)],([c,v])=>{if(s(),!c)return;const p=Oa(v)?{...v}:v;r.push(...n.flatMap(m=>o.map(x=>a(c,m,x,p))))},{immediate:!0,flush:"post"}),l=()=>{u(),s()};return Bn(l),l}function Ha(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Qo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=nr,eventName:r="keydown",passive:s=!1,dedupe:a=!1}=o,u=Ha(t);return or(i,r,c=>{c.repeat&&rt(a)||u(c)&&n(c)},s)}function Fa(e){return JSON.parse(JSON.stringify(e))}function Qn(e,t,n,o={}){var i,r,s;const{clone:a=!1,passive:u=!1,eventName:l,deep:c=!1,defaultValue:v,shouldEmit:p}=o,m=sn(),x=n||m?.emit||((i=m?.$emit)==null?void 0:i.bind(m))||((s=(r=m?.proxy)==null?void 0:r.$emit)==null?void 0:s.bind(m?.proxy));let g=l;t||(t="modelValue"),g=g||`update:${t.toString()}`;const _=h=>a?typeof a=="function"?a(h):Fa(h):h,w=()=>Ta(e[t])?_(e[t]):v,d=h=>{p?p(h)&&x(g,h):x(g,h)};if(u){const h=w(),y=Z(h);let O=!1;return _e(()=>e[t],R=>{O||(O=!0,y.value=_(R),Je(()=>O=!1))}),_e(y,R=>{!O&&(R!==e[t]||c)&&d(R)},{deep:c}),y}else return se({get(){return w()},set(h){d(h)}})}var Ya={value:()=>{}};function Ln(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new _n(n)}function _n(e){this._=e}function Ga(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}_n.prototype=Ln.prototype={constructor:_n,on:function(e,t){var n=this._,o=Ga(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=Ua(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=Jo(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Jo(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new _n(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function Ua(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Jo(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=Ya,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var vo="http://www.w3.org/1999/xhtml";const ei={svg:"http://www.w3.org/2000/svg",xhtml:vo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Vn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ei.hasOwnProperty(t)?{space:ei[t],local:e}:e}function Xa(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===vo&&t.documentElement.namespaceURI===vo?t.createElement(e):t.createElementNS(n,e)}}function Wa(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ir(e){var t=Vn(e);return(t.local?Wa:Xa)(t)}function Ka(){}function zo(e){return e==null?Ka:function(){return this.querySelector(e)}}function Za(e){typeof e!="function"&&(e=zo(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=new Array(s),u,l,c=0;c<s;++c)(u=r[c])&&(l=e.call(u,u.__data__,c,r))&&("__data__"in u&&(l.__data__=u.__data__),a[c]=l);return new He(o,this._parents)}function qa(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ja(){return[]}function rr(e){return e==null?ja:function(){return this.querySelectorAll(e)}}function Qa(e){return function(){return qa(e.apply(this,arguments))}}function Ja(e){typeof e=="function"?e=Qa(e):e=rr(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],a=s.length,u,l=0;l<a;++l)(u=s[l])&&(o.push(e.call(u,u.__data__,l,s)),i.push(u));return new He(o,i)}function sr(e){return function(){return this.matches(e)}}function ar(e){return function(t){return t.matches(e)}}var el=Array.prototype.find;function tl(e){return function(){return el.call(this.children,e)}}function nl(){return this.firstElementChild}function ol(e){return this.select(e==null?nl:tl(typeof e=="function"?e:ar(e)))}var il=Array.prototype.filter;function rl(){return Array.from(this.children)}function sl(e){return function(){return il.call(this.children,e)}}function al(e){return this.selectAll(e==null?rl:sl(typeof e=="function"?e:ar(e)))}function ll(e){typeof e!="function"&&(e=sr(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],u,l=0;l<s;++l)(u=r[l])&&e.call(u,u.__data__,l,r)&&a.push(u);return new He(o,this._parents)}function lr(e){return new Array(e.length)}function ul(){return new He(this._enter||this._groups.map(lr),this._parents)}function Cn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Cn.prototype={constructor:Cn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function cl(e){return function(){return e}}function dl(e,t,n,o,i,r){for(var s=0,a,u=t.length,l=r.length;s<l;++s)(a=t[s])?(a.__data__=r[s],o[s]=a):n[s]=new Cn(e,r[s]);for(;s<u;++s)(a=t[s])&&(i[s]=a)}function fl(e,t,n,o,i,r,s){var a,u,l=new Map,c=t.length,v=r.length,p=new Array(c),m;for(a=0;a<c;++a)(u=t[a])&&(p[a]=m=s.call(u,u.__data__,a,t)+"",l.has(m)?i[a]=u:l.set(m,u));for(a=0;a<v;++a)m=s.call(e,r[a],a,r)+"",(u=l.get(m))?(o[a]=u,u.__data__=r[a],l.delete(m)):n[a]=new Cn(e,r[a]);for(a=0;a<c;++a)(u=t[a])&&l.get(p[a])===u&&(i[a]=u)}function hl(e){return e.__data__}function pl(e,t){if(!arguments.length)return Array.from(this,hl);var n=t?fl:dl,o=this._parents,i=this._groups;typeof e!="function"&&(e=cl(e));for(var r=i.length,s=new Array(r),a=new Array(r),u=new Array(r),l=0;l<r;++l){var c=o[l],v=i[l],p=v.length,m=vl(e.call(c,c&&c.__data__,l,o)),x=m.length,g=a[l]=new Array(x),_=s[l]=new Array(x),w=u[l]=new Array(p);n(c,v,g,_,w,m,t);for(var d=0,h=0,y,O;d<x;++d)if(y=g[d]){for(d>=h&&(h=d+1);!(O=_[h])&&++h<x;);y._next=O||null}}return s=new He(s,o),s._enter=a,s._exit=u,s}function vl(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ml(){return new He(this._exit||this._groups.map(lr),this._parents)}function gl(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function yl(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),a=new Array(i),u=0;u<s;++u)for(var l=n[u],c=o[u],v=l.length,p=a[u]=new Array(v),m,x=0;x<v;++x)(m=l[x]||c[x])&&(p[x]=m);for(;u<i;++u)a[u]=n[u];return new He(a,this._parents)}function _l(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function wl(e){e||(e=xl);function t(v,p){return v&&p?e(v.__data__,p.__data__):!v-!p}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var s=n[r],a=s.length,u=i[r]=new Array(a),l,c=0;c<a;++c)(l=s[c])&&(u[c]=l);u.sort(t)}return new He(i,this._parents).order()}function xl(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function bl(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Sl(){return Array.from(this)}function El(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null}function Cl(){let e=0;for(const t of this)++e;return e}function Nl(){return!this.node()}function kl(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,a;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function Pl(e){return function(){this.removeAttribute(e)}}function $l(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Il(e,t){return function(){this.setAttribute(e,t)}}function Ml(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Tl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Dl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ol(e,t){var n=Vn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?$l:Pl:typeof t=="function"?n.local?Dl:Tl:n.local?Ml:Il)(n,t))}function ur(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function zl(e){return function(){this.style.removeProperty(e)}}function Al(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Rl(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Bl(e,t,n){return arguments.length>1?this.each((t==null?zl:typeof t=="function"?Rl:Al)(e,t,n??"")):At(this.node(),e)}function At(e,t){return e.style.getPropertyValue(t)||ur(e).getComputedStyle(e,null).getPropertyValue(t)}function Ll(e){return function(){delete this[e]}}function Vl(e,t){return function(){this[e]=t}}function Hl(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Fl(e,t){return arguments.length>1?this.each((t==null?Ll:typeof t=="function"?Hl:Vl)(e,t)):this.node()[e]}function cr(e){return e.trim().split(/^|\s+/)}function Ao(e){return e.classList||new dr(e)}function dr(e){this._node=e,this._names=cr(e.getAttribute("class")||"")}dr.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function fr(e,t){for(var n=Ao(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function hr(e,t){for(var n=Ao(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function Yl(e){return function(){fr(this,e)}}function Gl(e){return function(){hr(this,e)}}function Ul(e,t){return function(){(t.apply(this,arguments)?fr:hr)(this,e)}}function Xl(e,t){var n=cr(e+"");if(arguments.length<2){for(var o=Ao(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Ul:t?Yl:Gl)(n,t))}function Wl(){this.textContent=""}function Kl(e){return function(){this.textContent=e}}function Zl(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ql(e){return arguments.length?this.each(e==null?Wl:(typeof e=="function"?Zl:Kl)(e)):this.node().textContent}function jl(){this.innerHTML=""}function Ql(e){return function(){this.innerHTML=e}}function Jl(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function eu(e){return arguments.length?this.each(e==null?jl:(typeof e=="function"?Jl:Ql)(e)):this.node().innerHTML}function tu(){this.nextSibling&&this.parentNode.appendChild(this)}function nu(){return this.each(tu)}function ou(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function iu(){return this.each(ou)}function ru(e){var t=typeof e=="function"?e:ir(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function su(){return null}function au(e,t){var n=typeof e=="function"?e:ir(e),o=t==null?su:typeof t=="function"?t:zo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function lu(){var e=this.parentNode;e&&e.removeChild(this)}function uu(){return this.each(lu)}function cu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function du(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fu(e){return this.select(e?du:cu)}function hu(e){return arguments.length?this.property("__data__",e):this.node().__data__}function pu(e){return function(t){e.call(this,t,this.__data__)}}function vu(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function mu(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function gu(e,t,n){return function(){var o=this.__on,i,r=pu(t);if(o){for(var s=0,a=o.length;s<a;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function yu(e,t,n){var o=vu(e+""),i,r=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var u=0,l=a.length,c;u<l;++u)for(i=0,c=a[u];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?gu:mu,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function pr(e,t,n){var o=ur(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function _u(e,t){return function(){return pr(this,e,t)}}function wu(e,t){return function(){return pr(this,e,t.apply(this,arguments))}}function xu(e,t){return this.each((typeof t=="function"?wu:_u)(e,t))}function*bu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var vr=[null];function He(e,t){this._groups=e,this._parents=t}function ln(){return new He([[document.documentElement]],vr)}function Su(){return this}He.prototype=ln.prototype={constructor:He,select:Za,selectAll:Ja,selectChild:ol,selectChildren:al,filter:ll,data:pl,enter:ul,exit:ml,join:gl,merge:yl,selection:Su,order:_l,sort:wl,call:bl,nodes:Sl,node:El,size:Cl,empty:Nl,each:kl,attr:Ol,style:Bl,property:Fl,classed:Xl,text:ql,html:eu,raise:nu,lower:iu,append:ru,insert:au,remove:uu,clone:fu,datum:hu,on:yu,dispatch:xu,[Symbol.iterator]:bu};function We(e){return typeof e=="string"?new He([[document.querySelector(e)]],[document.documentElement]):new He([[e]],vr)}function Eu(e){let t;for(;t=e.sourceEvent;)e=t;return e}function je(e,t){if(e=Eu(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Cu={passive:!1},Qt={capture:!0,passive:!1};function Jn(e){e.stopImmediatePropagation()}function $t(e){e.preventDefault(),e.stopImmediatePropagation()}function mr(e){var t=e.document.documentElement,n=We(e).on("dragstart.drag",$t,Qt);"onselectstart"in t?n.on("selectstart.drag",$t,Qt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function gr(e,t){var n=e.document.documentElement,o=We(e).on("dragstart.drag",null);t&&(o.on("click.drag",$t,Qt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const cn=e=>()=>e;function mo(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:s,y:a,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}mo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Nu(e){return!e.ctrlKey&&!e.button}function ku(){return this.parentNode}function Pu(e,t){return t??{x:e.x,y:e.y}}function $u(){return navigator.maxTouchPoints||"ontouchstart"in this}function Iu(){var e=Nu,t=ku,n=Pu,o=$u,i={},r=Ln("start","drag","end"),s=0,a,u,l,c,v=0;function p(y){y.on("mousedown.drag",m).filter(o).on("touchstart.drag",_).on("touchmove.drag",w,Cu).on("touchend.drag touchcancel.drag",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(y,O){if(!(c||!e.call(this,y,O))){var R=h(this,t.call(this,y,O),y,O,"mouse");R&&(We(y.view).on("mousemove.drag",x,Qt).on("mouseup.drag",g,Qt),mr(y.view),Jn(y),l=!1,a=y.clientX,u=y.clientY,R("start",y))}}function x(y){if($t(y),!l){var O=y.clientX-a,R=y.clientY-u;l=O*O+R*R>v}i.mouse("drag",y)}function g(y){We(y.view).on("mousemove.drag mouseup.drag",null),gr(y.view,l),$t(y),i.mouse("end",y)}function _(y,O){if(e.call(this,y,O)){var R=y.changedTouches,B=t.call(this,y,O),U=R.length,W,Y;for(W=0;W<U;++W)(Y=h(this,B,y,O,R[W].identifier,R[W]))&&(Jn(y),Y("start",y,R[W]))}}function w(y){var O=y.changedTouches,R=O.length,B,U;for(B=0;B<R;++B)(U=i[O[B].identifier])&&($t(y),U("drag",y,O[B]))}function d(y){var O=y.changedTouches,R=O.length,B,U;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),B=0;B<R;++B)(U=i[O[B].identifier])&&(Jn(y),U("end",y,O[B]))}function h(y,O,R,B,U,W){var Y=r.copy(),G=je(W||R,O),P,J,E;if((E=n.call(y,new mo("beforestart",{sourceEvent:R,target:p,identifier:U,active:s,x:G[0],y:G[1],dx:0,dy:0,dispatch:Y}),B))!=null)return P=E.x-G[0]||0,J=E.y-G[1]||0,function A(T,D,V){var F=G,j;switch(T){case"start":i[U]=A,j=s++;break;case"end":delete i[U],--s;case"drag":G=je(V||D,O),j=s;break}Y.call(T,y,new mo(T,{sourceEvent:D,subject:E,target:p,identifier:U,active:j,x:G[0]+P,y:G[1]+J,dx:G[0]-F[0],dy:G[1]-F[1],dispatch:Y}),B)}}return p.filter=function(y){return arguments.length?(e=typeof y=="function"?y:cn(!!y),p):e},p.container=function(y){return arguments.length?(t=typeof y=="function"?y:cn(y),p):t},p.subject=function(y){return arguments.length?(n=typeof y=="function"?y:cn(y),p):n},p.touchable=function(y){return arguments.length?(o=typeof y=="function"?y:cn(!!y),p):o},p.on=function(){var y=r.on.apply(r,arguments);return y===r?p:y},p.clickDistance=function(y){return arguments.length?(v=(y=+y)*y,p):Math.sqrt(v)},p}function Ro(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function yr(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function un(){}var Jt=.7,Nn=1/Jt,It="\\s*([+-]?\\d+)\\s*",en="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",et="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Mu=/^#([0-9a-f]{3,8})$/,Tu=new RegExp(`^rgb\\(${It},${It},${It}\\)$`),Du=new RegExp(`^rgb\\(${et},${et},${et}\\)$`),Ou=new RegExp(`^rgba\\(${It},${It},${It},${en}\\)$`),zu=new RegExp(`^rgba\\(${et},${et},${et},${en}\\)$`),Au=new RegExp(`^hsl\\(${en},${et},${et}\\)$`),Ru=new RegExp(`^hsla\\(${en},${et},${et},${en}\\)$`),ti={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ro(un,tn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ni,formatHex:ni,formatHex8:Bu,formatHsl:Lu,formatRgb:oi,toString:oi});function ni(){return this.rgb().formatHex()}function Bu(){return this.rgb().formatHex8()}function Lu(){return _r(this).formatHsl()}function oi(){return this.rgb().formatRgb()}function tn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Mu.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ii(t):n===3?new Re(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?dn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?dn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Tu.exec(e))?new Re(t[1],t[2],t[3],1):(t=Du.exec(e))?new Re(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ou.exec(e))?dn(t[1],t[2],t[3],t[4]):(t=zu.exec(e))?dn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Au.exec(e))?ai(t[1],t[2]/100,t[3]/100,1):(t=Ru.exec(e))?ai(t[1],t[2]/100,t[3]/100,t[4]):ti.hasOwnProperty(e)?ii(ti[e]):e==="transparent"?new Re(NaN,NaN,NaN,0):null}function ii(e){return new Re(e>>16&255,e>>8&255,e&255,1)}function dn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Re(e,t,n,o)}function Vu(e){return e instanceof un||(e=tn(e)),e?(e=e.rgb(),new Re(e.r,e.g,e.b,e.opacity)):new Re}function go(e,t,n,o){return arguments.length===1?Vu(e):new Re(e,t,n,o??1)}function Re(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Ro(Re,go,yr(un,{brighter(e){return e=e==null?Nn:Math.pow(Nn,e),new Re(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jt:Math.pow(Jt,e),new Re(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Re(wt(this.r),wt(this.g),wt(this.b),kn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ri,formatHex:ri,formatHex8:Hu,formatRgb:si,toString:si}));function ri(){return`#${_t(this.r)}${_t(this.g)}${_t(this.b)}`}function Hu(){return`#${_t(this.r)}${_t(this.g)}${_t(this.b)}${_t((isNaN(this.opacity)?1:this.opacity)*255)}`}function si(){const e=kn(this.opacity);return`${e===1?"rgb(":"rgba("}${wt(this.r)}, ${wt(this.g)}, ${wt(this.b)}${e===1?")":`, ${e})`}`}function kn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function wt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _t(e){return e=wt(e),(e<16?"0":"")+e.toString(16)}function ai(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ke(e,t,n,o)}function _r(e){if(e instanceof Ke)return new Ke(e.h,e.s,e.l,e.opacity);if(e instanceof un||(e=tn(e)),!e)return new Ke;if(e instanceof Ke)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,a=r-i,u=(r+i)/2;return a?(t===r?s=(n-o)/a+(n<o)*6:n===r?s=(o-t)/a+2:s=(t-n)/a+4,a/=u<.5?r+i:2-r-i,s*=60):a=u>0&&u<1?0:s,new Ke(s,a,u,e.opacity)}function Fu(e,t,n,o){return arguments.length===1?_r(e):new Ke(e,t,n,o??1)}function Ke(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Ro(Ke,Fu,yr(un,{brighter(e){return e=e==null?Nn:Math.pow(Nn,e),new Ke(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jt:Math.pow(Jt,e),new Ke(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new Re(eo(e>=240?e-240:e+120,i,o),eo(e,i,o),eo(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Ke(li(this.h),fn(this.s),fn(this.l),kn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=kn(this.opacity);return`${e===1?"hsl(":"hsla("}${li(this.h)}, ${fn(this.s)*100}%, ${fn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function li(e){return e=(e||0)%360,e<0?e+360:e}function fn(e){return Math.max(0,Math.min(1,e||0))}function eo(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const wr=e=>()=>e;function Yu(e,t){return function(n){return e+n*t}}function Gu(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function Uu(e){return(e=+e)==1?xr:function(t,n){return n-t?Gu(t,n,e):wr(isNaN(t)?n:t)}}function xr(e,t){var n=t-e;return n?Yu(e,n):wr(isNaN(e)?t:e)}const ui=function e(t){var n=Uu(t);function o(i,r){var s=n((i=go(i)).r,(r=go(r)).r),a=n(i.g,r.g),u=n(i.b,r.b),l=xr(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=u(c),i.opacity=l(c),i+""}}return o.gamma=e,o}(1);function ht(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var yo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,to=new RegExp(yo.source,"g");function Xu(e){return function(){return e}}function Wu(e){return function(t){return e(t)+""}}function Ku(e,t){var n=yo.lastIndex=to.lastIndex=0,o,i,r,s=-1,a=[],u=[];for(e=e+"",t=t+"";(o=yo.exec(e))&&(i=to.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),a[s]?a[s]+=r:a[++s]=r),(o=o[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,u.push({i:s,x:ht(o,i)})),n=to.lastIndex;return n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?u[0]?Wu(u[0].x):Xu(t):(t=u.length,function(l){for(var c=0,v;c<t;++c)a[(v=u[c]).i]=v.x(l);return a.join("")})}var ci=180/Math.PI,_o={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function br(e,t,n,o,i,r){var s,a,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*o)&&(n-=e*u,o-=t*u),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,u/=a),e*o<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*ci,skewX:Math.atan(u)*ci,scaleX:s,scaleY:a}}var hn;function Zu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?_o:br(t.a,t.b,t.c,t.d,t.e,t.f)}function qu(e){return e==null||(hn||(hn=document.createElementNS("http://www.w3.org/2000/svg","g")),hn.setAttribute("transform",e),!(e=hn.transform.baseVal.consolidate()))?_o:(e=e.matrix,br(e.a,e.b,e.c,e.d,e.e,e.f))}function Sr(e,t,n,o){function i(l){return l.length?l.pop()+" ":""}function r(l,c,v,p,m,x){if(l!==v||c!==p){var g=m.push("translate(",null,t,null,n);x.push({i:g-4,x:ht(l,v)},{i:g-2,x:ht(c,p)})}else(v||p)&&m.push("translate("+v+t+p+n)}function s(l,c,v,p){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),p.push({i:v.push(i(v)+"rotate(",null,o)-2,x:ht(l,c)})):c&&v.push(i(v)+"rotate("+c+o)}function a(l,c,v,p){l!==c?p.push({i:v.push(i(v)+"skewX(",null,o)-2,x:ht(l,c)}):c&&v.push(i(v)+"skewX("+c+o)}function u(l,c,v,p,m,x){if(l!==v||c!==p){var g=m.push(i(m)+"scale(",null,",",null,")");x.push({i:g-4,x:ht(l,v)},{i:g-2,x:ht(c,p)})}else(v!==1||p!==1)&&m.push(i(m)+"scale("+v+","+p+")")}return function(l,c){var v=[],p=[];return l=e(l),c=e(c),r(l.translateX,l.translateY,c.translateX,c.translateY,v,p),s(l.rotate,c.rotate,v,p),a(l.skewX,c.skewX,v,p),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,v,p),l=c=null,function(m){for(var x=-1,g=p.length,_;++x<g;)v[(_=p[x]).i]=_.x(m);return v.join("")}}}var ju=Sr(Zu,"px, ","px)","deg)"),Qu=Sr(qu,", ",")",")"),Ju=1e-12;function di(e){return((e=Math.exp(e))+1/e)/2}function ec(e){return((e=Math.exp(e))-1/e)/2}function tc(e){return((e=Math.exp(2*e))-1)/(e+1)}const nc=function e(t,n,o){function i(r,s){var a=r[0],u=r[1],l=r[2],c=s[0],v=s[1],p=s[2],m=c-a,x=v-u,g=m*m+x*x,_,w;if(g<Ju)w=Math.log(p/l)/t,_=function(B){return[a+B*m,u+B*x,l*Math.exp(t*B*w)]};else{var d=Math.sqrt(g),h=(p*p-l*l+o*g)/(2*l*n*d),y=(p*p-l*l-o*g)/(2*p*n*d),O=Math.log(Math.sqrt(h*h+1)-h),R=Math.log(Math.sqrt(y*y+1)-y);w=(R-O)/t,_=function(B){var U=B*w,W=di(O),Y=l/(n*d)*(W*tc(t*U+O)-ec(O));return[a+Y*m,u+Y*x,l*W/di(t*U+O)]}}return _.duration=w*1e3*t/Math.SQRT2,_}return i.rho=function(r){var s=Math.max(.001,+r),a=s*s,u=a*a;return e(s,a,u)},i}(Math.SQRT2,2,4);var Rt=0,Wt=0,Yt=0,Er=1e3,Pn,Kt,$n=0,St=0,Hn=0,nn=typeof performance=="object"&&performance.now?performance:Date,Cr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Bo(){return St||(Cr(oc),St=nn.now()+Hn)}function oc(){St=0}function In(){this._call=this._time=this._next=null}In.prototype=Nr.prototype={constructor:In,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Bo():+n)+(t==null?0:+t),!this._next&&Kt!==this&&(Kt?Kt._next=this:Pn=this,Kt=this),this._call=e,this._time=n,wo()},stop:function(){this._call&&(this._call=null,this._time=1/0,wo())}};function Nr(e,t,n){var o=new In;return o.restart(e,t,n),o}function ic(){Bo(),++Rt;for(var e=Pn,t;e;)(t=St-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Rt}function fi(){St=($n=nn.now())+Hn,Rt=Wt=0;try{ic()}finally{Rt=0,sc(),St=0}}function rc(){var e=nn.now(),t=e-$n;t>Er&&(Hn-=t,$n=e)}function sc(){for(var e,t=Pn,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Pn=n);Kt=e,wo(o)}function wo(e){if(!Rt){Wt&&(Wt=clearTimeout(Wt));var t=e-St;t>24?(e<1/0&&(Wt=setTimeout(fi,e-nn.now()-Hn)),Yt&&(Yt=clearInterval(Yt))):(Yt||($n=nn.now(),Yt=setInterval(rc,Er)),Rt=1,Cr(fi))}}function hi(e,t,n){var o=new In;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var ac=Ln("start","end","cancel","interrupt"),lc=[],kr=0,pi=1,xo=2,wn=3,vi=4,bo=5,xn=6;function Fn(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;uc(e,n,{name:t,index:o,group:i,on:ac,tween:lc,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:kr})}function Lo(e,t){var n=Ze(e,t);if(n.state>kr)throw new Error("too late; already scheduled");return n}function nt(e,t){var n=Ze(e,t);if(n.state>wn)throw new Error("too late; already running");return n}function Ze(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function uc(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Nr(r,0,n.time);function r(l){n.state=pi,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var c,v,p,m;if(n.state!==pi)return u();for(c in o)if(m=o[c],m.name===n.name){if(m.state===wn)return hi(s);m.state===vi?(m.state=xn,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete o[c]):+c<t&&(m.state=xn,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete o[c])}if(hi(function(){n.state===wn&&(n.state=vi,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=xo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===xo){for(n.state=wn,i=new Array(p=n.tween.length),c=0,v=-1;c<p;++c)(m=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++v]=m);i.length=v+1}}function a(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=bo,1),v=-1,p=i.length;++v<p;)i[v].call(e,c);n.state===bo&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=xn,n.timer.stop(),delete o[t];for(var l in o)return;delete e.__transition}}function bn(e,t){var n=e.__transition,o,i,r=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>xo&&o.state<bo,o.state=xn,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function cc(e){return this.each(function(){bn(this,e)})}function dc(e,t){var n,o;return function(){var i=nt(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function fc(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=nt(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:t,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===t){i[u]=a;break}u===l&&i.push(a)}r.tween=i}}function hc(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ze(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?dc:fc)(n,e,t))}function Vo(e,t,n){var o=e._id;return e.each(function(){var i=nt(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ze(i,o).value[t]}}function Pr(e,t){var n;return(typeof t=="number"?ht:t instanceof tn?ui:(n=tn(t))?(t=n,ui):Ku)(e,t)}function pc(e){return function(){this.removeAttribute(e)}}function vc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mc(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function gc(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function yc(e,t,n){var o,i,r;return function(){var s,a=n(this),u;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=a+"",s===u?null:s===o&&u===i?r:(i=u,r=t(o=s,a)))}}function _c(e,t,n){var o,i,r;return function(){var s,a=n(this),u;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=a+"",s===u?null:s===o&&u===i?r:(i=u,r=t(o=s,a)))}}function wc(e,t){var n=Vn(e),o=n==="transform"?Qu:Pr;return this.attrTween(e,typeof t=="function"?(n.local?_c:yc)(n,o,Vo(this,"attr."+e,t)):t==null?(n.local?vc:pc)(n):(n.local?gc:mc)(n,o,t))}function xc(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function bc(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Sc(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&bc(e,r)),n}return i._value=t,i}function Ec(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&xc(e,r)),n}return i._value=t,i}function Cc(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=Vn(e);return this.tween(n,(o.local?Sc:Ec)(o,t))}function Nc(e,t){return function(){Lo(this,e).delay=+t.apply(this,arguments)}}function kc(e,t){return t=+t,function(){Lo(this,e).delay=t}}function Pc(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Nc:kc)(t,e)):Ze(this.node(),t).delay}function $c(e,t){return function(){nt(this,e).duration=+t.apply(this,arguments)}}function Ic(e,t){return t=+t,function(){nt(this,e).duration=t}}function Mc(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?$c:Ic)(t,e)):Ze(this.node(),t).duration}function Tc(e,t){if(typeof t!="function")throw new Error;return function(){nt(this,e).ease=t}}function Dc(e){var t=this._id;return arguments.length?this.each(Tc(t,e)):Ze(this.node(),t).ease}function Oc(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nt(this,e).ease=n}}function zc(e){if(typeof e!="function")throw new Error;return this.each(Oc(this._id,e))}function Ac(e){typeof e!="function"&&(e=sr(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],u,l=0;l<s;++l)(u=r[l])&&e.call(u,u.__data__,l,r)&&a.push(u);return new ct(o,this._parents,this._name,this._id)}function Rc(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),s=new Array(o),a=0;a<r;++a)for(var u=t[a],l=n[a],c=u.length,v=s[a]=new Array(c),p,m=0;m<c;++m)(p=u[m]||l[m])&&(v[m]=p);for(;a<o;++a)s[a]=t[a];return new ct(s,this._parents,this._name,this._id)}function Bc(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Lc(e,t,n){var o,i,r=Bc(t)?Lo:nt;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function Vc(e,t){var n=this._id;return arguments.length<2?Ze(this.node(),n).on.on(e):this.each(Lc(n,e,t))}function Hc(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Fc(){return this.on("end.remove",Hc(this._id))}function Yc(e){var t=this._name,n=this._id;typeof e!="function"&&(e=zo(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var a=o[s],u=a.length,l=r[s]=new Array(u),c,v,p=0;p<u;++p)(c=a[p])&&(v=e.call(c,c.__data__,p,a))&&("__data__"in c&&(v.__data__=c.__data__),l[p]=v,Fn(l[p],t,n,p,l,Ze(c,n)));return new ct(r,this._parents,t,n)}function Gc(e){var t=this._name,n=this._id;typeof e!="function"&&(e=rr(e));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var u=o[a],l=u.length,c,v=0;v<l;++v)if(c=u[v]){for(var p=e.call(c,c.__data__,v,u),m,x=Ze(c,n),g=0,_=p.length;g<_;++g)(m=p[g])&&Fn(m,t,n,g,p,x);r.push(p),s.push(c)}return new ct(r,s,t,n)}var Uc=ln.prototype.constructor;function Xc(){return new Uc(this._groups,this._parents)}function Wc(e,t){var n,o,i;return function(){var r=At(this,e),s=(this.style.removeProperty(e),At(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function $r(e){return function(){this.style.removeProperty(e)}}function Kc(e,t,n){var o,i=n+"",r;return function(){var s=At(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function Zc(e,t,n){var o,i,r;return function(){var s=At(this,e),a=n(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(e),At(this,e))),s===u?null:s===o&&u===i?r:(i=u,r=t(o=s,a))}}function qc(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var u=nt(this,e),l=u.on,c=u.value[r]==null?a||(a=$r(t)):void 0;(l!==n||i!==c)&&(o=(n=l).copy()).on(s,i=c),u.on=o}}function jc(e,t,n){var o=(e+="")=="transform"?ju:Pr;return t==null?this.styleTween(e,Wc(e,o)).on("end.style."+e,$r(e)):typeof t=="function"?this.styleTween(e,Zc(e,o,Vo(this,"style."+e,t))).each(qc(this._id,e)):this.styleTween(e,Kc(e,o,t),n).on("end.style."+e,null)}function Qc(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Jc(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&Qc(e,s,n)),o}return r._value=t,r}function ed(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Jc(e,t,n??""))}function td(e){return function(){this.textContent=e}}function nd(e){return function(){var t=e(this);this.textContent=t??""}}function od(e){return this.tween("text",typeof e=="function"?nd(Vo(this,"text",e)):td(e==null?"":e+""))}function id(e){return function(t){this.textContent=e.call(this,t)}}function rd(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&id(i)),t}return o._value=e,o}function sd(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,rd(e))}function ad(){for(var e=this._name,t=this._id,n=Ir(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,u,l=0;l<a;++l)if(u=s[l]){var c=Ze(u,t);Fn(u,e,n,l,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ct(o,this._parents,e,n)}function ld(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var a={value:s},u={value:function(){--i===0&&r()}};n.each(function(){var l=nt(this,o),c=l.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(u)),l.on=t}),i===0&&r()})}var ud=0;function ct(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Ir(){return++ud}var ot=ln.prototype;ct.prototype={constructor:ct,select:Yc,selectAll:Gc,selectChild:ot.selectChild,selectChildren:ot.selectChildren,filter:Ac,merge:Rc,selection:Xc,transition:ad,call:ot.call,nodes:ot.nodes,node:ot.node,size:ot.size,empty:ot.empty,each:ot.each,on:Vc,attr:wc,attrTween:Cc,style:jc,styleTween:ed,text:od,textTween:sd,remove:Fc,tween:hc,delay:Pc,duration:Mc,ease:Dc,easeVarying:zc,end:ld,[Symbol.iterator]:ot[Symbol.iterator]};function cd(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var dd={time:null,delay:0,duration:250,ease:cd};function fd(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function hd(e){var t,n;e instanceof ct?(t=e._id,e=e._name):(t=Ir(),(n=dd).time=Bo(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,u,l=0;l<a;++l)(u=s[l])&&Fn(u,e,t,l,s,n||fd(u,t));return new ct(o,this._parents,e,t)}ln.prototype.interrupt=cc;ln.prototype.transition=hd;const pn=e=>()=>e;function pd(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function st(e,t,n){this.k=e,this.x=t,this.y=n}st.prototype={constructor:st,scale:function(e){return e===1?this:new st(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new st(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Bt=new st(1,0,0);st.prototype;function no(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function vd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function md(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function mi(){return this.__zoom||Bt}function gd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function yd(){return navigator.maxTouchPoints||"ontouchstart"in this}function _d(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function wd(){var e=vd,t=md,n=_d,o=gd,i=yd,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,u=nc,l=Ln("start","zoom","end"),c,v,p,m=500,x=150,g=0,_=10;function w(E){E.property("__zoom",mi).on("wheel.zoom",U,{passive:!1}).on("mousedown.zoom",W).on("dblclick.zoom",Y).filter(i).on("touchstart.zoom",G).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(E,A,T,D){var V=E.selection?E.selection():E;V.property("__zoom",mi),E!==V?O(E,A,T,D):V.interrupt().each(function(){R(this,arguments).event(D).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},w.scaleBy=function(E,A,T,D){w.scaleTo(E,function(){var V=this.__zoom.k,F=typeof A=="function"?A.apply(this,arguments):A;return V*F},T,D)},w.scaleTo=function(E,A,T,D){w.transform(E,function(){var V=t.apply(this,arguments),F=this.__zoom,j=T==null?y(V):typeof T=="function"?T.apply(this,arguments):T,M=F.invert(j),z=typeof A=="function"?A.apply(this,arguments):A;return n(h(d(F,z),j,M),V,s)},T,D)},w.translateBy=function(E,A,T,D){w.transform(E,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),s)},null,D)},w.translateTo=function(E,A,T,D,V){w.transform(E,function(){var F=t.apply(this,arguments),j=this.__zoom,M=D==null?y(F):typeof D=="function"?D.apply(this,arguments):D;return n(Bt.translate(M[0],M[1]).scale(j.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof T=="function"?-T.apply(this,arguments):-T),F,s)},D,V)};function d(E,A){return A=Math.max(r[0],Math.min(r[1],A)),A===E.k?E:new st(A,E.x,E.y)}function h(E,A,T){var D=A[0]-T[0]*E.k,V=A[1]-T[1]*E.k;return D===E.x&&V===E.y?E:new st(E.k,D,V)}function y(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function O(E,A,T,D){E.on("start.zoom",function(){R(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(D).end()}).tween("zoom",function(){var V=this,F=arguments,j=R(V,F).event(D),M=t.apply(V,F),z=T==null?y(M):typeof T=="function"?T.apply(V,F):T,I=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),$=V.__zoom,oe=typeof A=="function"?A.apply(V,F):A,ve=u($.invert(z).concat(I/$.k),oe.invert(z).concat(I/oe.k));return function(he){if(he===1)he=oe;else{var me=ve(he),le=I/me[2];he=new st(le,z[0]-me[0]*le,z[1]-me[1]*le)}j.zoom(null,he)}})}function R(E,A,T){return!T&&E.__zooming||new B(E,A)}function B(E,A){this.that=E,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,A),this.taps=0}B.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,A){return this.mouse&&E!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var A=We(this.that).datum();l.call(E,this.that,new pd(E,{sourceEvent:this.sourceEvent,target:w,type:E,transform:this.that.__zoom,dispatch:l}),A)}};function U(E,...A){if(!e.apply(this,arguments))return;var T=R(this,A).event(E),D=this.__zoom,V=Math.max(r[0],Math.min(r[1],D.k*Math.pow(2,o.apply(this,arguments)))),F=je(E);if(T.wheel)(T.mouse[0][0]!==F[0]||T.mouse[0][1]!==F[1])&&(T.mouse[1]=D.invert(T.mouse[0]=F)),clearTimeout(T.wheel);else{if(D.k===V)return;T.mouse=[F,D.invert(F)],bn(this),T.start()}Gt(E),T.wheel=setTimeout(j,x),T.zoom("mouse",n(h(d(D,V),T.mouse[0],T.mouse[1]),T.extent,s));function j(){T.wheel=null,T.end()}}function W(E,...A){if(p||!e.apply(this,arguments))return;var T=E.currentTarget,D=R(this,A,!0).event(E),V=We(E.view).on("mousemove.zoom",z,!0).on("mouseup.zoom",I,!0),F=je(E,T),j=E.clientX,M=E.clientY;mr(E.view),no(E),D.mouse=[F,this.__zoom.invert(F)],bn(this),D.start();function z($){if(Gt($),!D.moved){var oe=$.clientX-j,ve=$.clientY-M;D.moved=oe*oe+ve*ve>g}D.event($).zoom("mouse",n(h(D.that.__zoom,D.mouse[0]=je($,T),D.mouse[1]),D.extent,s))}function I($){V.on("mousemove.zoom mouseup.zoom",null),gr($.view,D.moved),Gt($),D.event($).end()}}function Y(E,...A){if(e.apply(this,arguments)){var T=this.__zoom,D=je(E.changedTouches?E.changedTouches[0]:E,this),V=T.invert(D),F=T.k*(E.shiftKey?.5:2),j=n(h(d(T,F),D,V),t.apply(this,A),s);Gt(E),a>0?We(this).transition().duration(a).call(O,j,D,E):We(this).call(w.transform,j,D,E)}}function G(E,...A){if(e.apply(this,arguments)){var T=E.touches,D=T.length,V=R(this,A,E.changedTouches.length===D).event(E),F,j,M,z;for(no(E),j=0;j<D;++j)M=T[j],z=je(M,this),z=[z,this.__zoom.invert(z),M.identifier],V.touch0?!V.touch1&&V.touch0[2]!==z[2]&&(V.touch1=z,V.taps=0):(V.touch0=z,F=!0,V.taps=1+!!c);c&&(c=clearTimeout(c)),F&&(V.taps<2&&(v=z[0],c=setTimeout(function(){c=null},m)),bn(this),V.start())}}function P(E,...A){if(this.__zooming){var T=R(this,A).event(E),D=E.changedTouches,V=D.length,F,j,M,z;for(Gt(E),F=0;F<V;++F)j=D[F],M=je(j,this),T.touch0&&T.touch0[2]===j.identifier?T.touch0[0]=M:T.touch1&&T.touch1[2]===j.identifier&&(T.touch1[0]=M);if(j=T.that.__zoom,T.touch1){var I=T.touch0[0],$=T.touch0[1],oe=T.touch1[0],ve=T.touch1[1],he=(he=oe[0]-I[0])*he+(he=oe[1]-I[1])*he,me=(me=ve[0]-$[0])*me+(me=ve[1]-$[1])*me;j=d(j,Math.sqrt(he/me)),M=[(I[0]+oe[0])/2,(I[1]+oe[1])/2],z=[($[0]+ve[0])/2,($[1]+ve[1])/2]}else if(T.touch0)M=T.touch0[0],z=T.touch0[1];else return;T.zoom("touch",n(h(j,M,z),T.extent,s))}}function J(E,...A){if(this.__zooming){var T=R(this,A).event(E),D=E.changedTouches,V=D.length,F,j;for(no(E),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),F=0;F<V;++F)j=D[F],T.touch0&&T.touch0[2]===j.identifier?delete T.touch0:T.touch1&&T.touch1[2]===j.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(j=je(j,this),Math.hypot(v[0]-j[0],v[1]-j[1])<_)){var M=We(this).on("dblclick.zoom");M&&M.apply(this,arguments)}}}return w.wheelDelta=function(E){return arguments.length?(o=typeof E=="function"?E:pn(+E),w):o},w.filter=function(E){return arguments.length?(e=typeof E=="function"?E:pn(!!E),w):e},w.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:pn(!!E),w):i},w.extent=function(E){return arguments.length?(t=typeof E=="function"?E:pn([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),w):t},w.scaleExtent=function(E){return arguments.length?(r[0]=+E[0],r[1]=+E[1],w):[r[0],r[1]]},w.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(E){return arguments.length?(n=E,w):n},w.duration=function(E){return arguments.length?(a=+E,w):a},w.interpolate=function(E){return arguments.length?(u=E,w):u},w.on=function(){var E=l.on.apply(l,arguments);return E===l?w:E},w.clickDistance=function(E){return arguments.length?(g=(E=+E)*E,w):Math.sqrt(g)},w.tapDistance=function(E){return arguments.length?(_=+E,w):_},w}var Q=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(Q||{}),Ho=(e=>(e.Partial="partial",e.Full="full",e))(Ho||{}),gt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(gt||{}),Et=(e=>(e.Strict="strict",e.Loose="loose",e))(Et||{}),So=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(So||{}),qt=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(qt||{});function Eo(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof o?.hasAttribute=="function"?o.hasAttribute("contenteditable"):!1,r=typeof o?.closest=="function"?o.closest(".nokey"):null;return["INPUT","SELECT","TEXTAREA"].includes(o?.nodeName)||i||!!r}function xd(e){return e.ctrlKey||e.metaKey||e.shiftKey}function gi(e,t,n,o){const i=t.replace("+",`
  2. `).replace(`
  3. `,`
  4. +`).split(`
  5. `).map(s=>s.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const r=i.every((s,a)=>n.has(s)&&Array.from(n.values())[a]===i[a]);return o&&n.delete(e.toLowerCase()),r}function bd(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Sd(n.code,e);return Array.isArray(e)?e.some(i=>gi(n[o],i,t,n.type==="keyup")):gi(n[o],e,t,n.type==="keyup")}}function Sd(e,t){return t.includes(e)?"code":"key"}function jt(e,t){const n=Ee(()=>ye(t?.actInsideInputWithModifier)??!1),o=Ee(()=>ye(t?.target)??window),i=Z(ye(e)===!0);let r=!1;const s=new Set;let a=l(ye(e));_e(()=>ye(e),(c,v)=>{typeof v=="boolean"&&typeof c!="boolean"&&u(),a=l(c)},{immediate:!0}),Ye(()=>{or(window,["blur","contextmenu"],u)}),Qo((...c)=>a(...c),c=>{r=xd(c),!((!r||r&&!n.value)&&Eo(c))&&(c.preventDefault(),i.value=!0)},{eventName:"keydown",target:o}),Qo((...c)=>a(...c),c=>{if(i.value){if((!r||r&&!n.value)&&Eo(c))return;r=!1,i.value=!1}},{eventName:"keyup",target:o});function u(){r=!1,s.clear(),i.value=ye(e)===!0}function l(c){return c===null?(u(),()=>!1):typeof c=="boolean"?(u(),i.value=c,()=>!1):Array.isArray(c)||typeof c=="string"?bd(c,s):c}return i}const Mr="vue-flow__node-desc",Tr="vue-flow__edge-desc",Ed="vue-flow__aria-live",Dr=["Enter"," ","Escape"],Mt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Co(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function No(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function Yn(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Ct(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Or(e,t){return{x:Ct(e.x,t[0][0],t[1][0]),y:Ct(e.y,t[0][1],t[1][1])}}function yi(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function vt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function xt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!vt(e)}function Zt(e){return xt(e)&&"computedPosition"in e}function vn(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Cd(e){return vn(e.width)&&vn(e.height)&&vn(e.x)&&vn(e.y)}function Nd(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:Oe({width:0,height:0}),computedPosition:Oe({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Pe(e.data)?e.data:{},events:Oe(Pe(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function zr(e,t,n){var o,i;const r={id:e.id.toString(),type:e.type??t?.type??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:Pe(e.data)?e.data:{},events:Oe(Pe(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function Ar(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,s=o==="source"?"target":"source";for(const a of n)a[s]===i&&r.add(a[o]);return t.filter(a=>r.has(a.id))}function kd(...e){if(e.length===3){const[r,s,a]=e;return Ar(r,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>vt(r)&&r.source===o).map(r=>n.find(s=>xt(s)&&s.id===r.target))}function Pd(...e){if(e.length===3){const[r,s,a]=e;return Ar(r,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>vt(r)&&r.target===o).map(r=>n.find(s=>xt(s)&&s.id===r.source))}function Rr({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function $d(e,t){return t.some(n=>vt(n)&&n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle))}function Br({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function on({x:e,y:t},{x:n,y:o,zoom:i},r=!1,s=[1,1]){const a={x:(e-n)/i,y:(t-o)/i};return r?Gn(a,s):a}function Id(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function Lr({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function Md({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function Vr(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=Id(t,Lr({...o.computedPosition,...o.dimensions}))}return Md(t)}function Hr(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){const r={...on(t,n),width:t.width/n.zoom,height:t.height/n.zoom},s=[];for(const a of e){const{dimensions:u,selectable:l=!0,hidden:c=!1}=a,v=u.width??a.width??null,p=u.height??a.height??null;if(i&&!l||c)continue;const m=No(r,Co(a)),x=v===null||p===null,g=o&&m>0,_=(v??0)*(p??0);(x||g||m>=_||a.dragging)&&s.push(a)}return s}function Fr(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function _i(e,t,n,o,i,r=.1,s={x:0,y:0}){const a=t/(e.width*(1+r)),u=n/(e.height*(1+r)),l=Math.min(a,u),c=Ct(l,o,i),v=e.x+e.width/2,p=e.y+e.height/2,m=t/2-v*c+(s.x??0),x=n/2-p*c+(s.y??0);return{x:m,y:x,zoom:c}}function Td(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function Yr(e,t){if(!e.parentNode)return!1;const n=t(e.parentNode);return n?n.selected?!0:Yr(n,t):!1}function rn(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function wi(e,t,n){return e<t?Ct(Math.abs(e-t),1,t)/t:e>n?-Ct(Math.abs(e-n),1,t)/t:0}function Gr(e,t,n=15,o=40){const i=wi(e.x,o,t.width-o)*n,r=wi(e.y,o,t.height-o)*n;return[i,r]}function oo(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let i={};if(typeof t.style=="function"?i={...t.style(t)}:t.style&&(i={...t.style}),i.width=i.width??`${t.dimensions.width}px`,i.height=i.height??`${t.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(e.position.x<0){const r=Math.abs(e.position.x);if(t.position.x=t.position.x-r,typeof i.width=="string"){const s=Number(i.width.replace("px",""));i.width=`${s+r}px`}else i.width+=r;e.position.x=0}if(e.position.y<0){const r=Math.abs(e.position.y);if(t.position.y=t.position.y-r,typeof i.height=="string"){const s=Number(i.height.replace("px",""));i.height=`${s+r}px`}else i.height+=r;e.position.y=0}t.dimensions.width=Number(i.width.toString().replace("px","")),t.dimensions.height=Number(i.height.toString().replace("px","")),typeof t.style=="function"?t.style=r=>{const s=t.style;return{...s(r),...i}}:t.style={...t.style,...i}}}}function xi(e,t){var n,o;const i=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of i)if(s.type==="add")t.findIndex(u=>u.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const a=t.findIndex(u=>u.id===s.id);a!==-1&&t.splice(a,1)}const r=t.map(s=>s.id);for(const s of t)for(const a of e)if(a.id===s.id)switch(a.type){case"select":s.selected=a.selected;break;case"position":if(Zt(s)&&(typeof a.position<"u"&&(s.position=a.position),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const u=t[r.indexOf(s.parentNode)];u&&Zt(u)&&oo(s,u)}break;case"dimensions":if(Zt(s)&&(typeof a.dimensions<"u"&&(s.dimensions=a.dimensions),typeof a.updateStyle<"u"&&a.updateStyle&&(s.style={...s.style||{},width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(o=a.dimensions)==null?void 0:o.height}px`}),typeof a.resizing<"u"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const u=t[r.indexOf(s.parentNode)];u&&Zt(u)&&(!!u.dimensions.width&&!!u.dimensions.height?oo(s,u):Je(()=>{oo(s,u)}))}break}return t}function ft(e,t){return{id:e,type:"select",selected:t}}function bi(e){return{item:e,type:"add"}}function Si(e){return{id:e,type:"remove"}}function Ei(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function pt(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const s=t.has(i);!(r.selected===void 0&&!s)&&r.selected!==s&&(n&&(r.selected=s),o.push(ft(r.id,s)))}return o}function ee(e){const t=new Set;let n=!1;const o=()=>t.size>0;e&&(n=!0,t.add(e));const i=a=>{t.delete(a)};return{on:a=>{e&&n&&t.delete(e),t.add(a);const u=()=>{i(a),e&&n&&t.add(e)};return Bn(u),{off:u}},off:i,trigger:a=>Promise.all(Array.from(t).map(u=>u(a))),hasListeners:o,fns:t}}function Ci(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function Dd(e,t,n,o,i){var r,s;const a=[];for(const u of e)(u.selected||u.id===i)&&(!u.parentNode||!Yr(u,o))&&(u.draggable||t&&typeof u.draggable>"u")&&a.push(Oe({id:u.id,position:u.position||{x:0,y:0},distance:{x:n.x-((r=u.computedPosition)==null?void 0:r.x)||0,y:n.y-((s=u.computedPosition)==null?void 0:s.y)||0},from:u.computedPosition,extent:u.extent,parentNode:u.parentNode,dimensions:u.dimensions,expandParent:u.expandParent}));return a}function io({id:e,dragItems:t,findNode:n}){const o=[];for(const i of t){const r=n(i.id);r&&o.push(r)}return[e?o.find(i=>i.id===e):o[0],o]}function Ur(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function Od(e,t,n){const[o,i,r,s]=typeof e!="string"?Ur(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function zd(e,t,n,o){let i=e.extent||n;if((i==="parent"||!Array.isArray(i)&&i?.range==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const r=Od(i,e,o);r&&(i=r)}else t(new Te(Ie.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=o?.computedPosition.x||0,s=o?.computedPosition.y||0;i=[[i[0][0]+r,i[0][1]+s],[i[1][0]+r,i[1][1]+s]]}else if(i!=="parent"&&i?.range&&Array.isArray(i.range)){const[r,s,a,u]=Ur(i.padding),l=o?.computedPosition.x||0,c=o?.computedPosition.y||0;i=[[i.range[0][0]+l+u,i.range[0][1]+c+r],[i.range[1][0]+l-s,i.range[1][1]+c-a]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function Ad({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function Fo(e,t,n,o,i){const r=Ad(e.dimensions,zd(e,n,o,i)),s=Or(t,r);return{position:{x:s.x-(i?.computedPosition.x||0),y:s.y-(i?.computedPosition.y||0)},computedPosition:s}}function Mn(e,t,n=Q.Left){const o=(t?.x??0)+e.computedPosition.x,i=(t?.y??0)+e.computedPosition.y,{width:r,height:s}=t??Ld(e);switch(t?.position??n){case Q.Top:return{x:o+r/2,y:i};case Q.Right:return{x:o+r,y:i+s/2};case Q.Bottom:return{x:o+r/2,y:i+s};case Q.Left:return{x:o,y:i+s/2}}}function Ni(e=[],t){return e.length&&(t?e.find(n=>n.id===t):e[0])||null}function Rd({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:s,height:a,viewport:u}){const l={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+o,t.y+r)};l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const c=Lr({x:(0-u.x)/u.zoom,y:(0-u.y)/u.zoom,width:s/u.zoom,height:a/u.zoom}),v=Math.max(0,Math.min(c.x2,l.x2)-Math.max(c.x,l.x)),p=Math.max(0,Math.min(c.y2,l.y2)-Math.max(c.y,l.y));return Math.ceil(v*p)>0}function Bd(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),s=t(e.target);return!r||!s?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,s.computedPosition.z||0)),i)}var Ie=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Ie||{});const ki={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
  6. Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
  7. Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
  8. Node: ${e}
  9. Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
  10. Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
  11. Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
  12. Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
  13. Edge: ${e}
  14. Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
  15. Edge: ${e}
  16. Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
  17. Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
  18. Edge: ${e}
  19. Source: ${t}
  20. Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
  21. Edge: ${e}
  22. Source: ${t}
  23. Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
  24. Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
  25. Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Te extends Error{constructor(t,...n){var o;super((o=ki[t])==null?void 0:o.call(ki,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Yo(e){return"clientX"in e}function Xr(e){return"sourceEvent"in e}function lt(e,t){var n,o;const i=Yo(e),r=i?e.clientX:(n=e.touches)==null?void 0:n[0].clientX,s=i?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-(t?.left??0),y:s-(t?.top??0)}}const Tn=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ld(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function Gn(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}function Wr(){return{handleDomNode:null,isValid:!1,connection:{source:"",target:"",sourceHandle:null,targetHandle:null},endHandle:null}}function ro(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Pi(e,t,n,o){const i=[];for(const r of t[n]||[])if(`${e.id}-${r.id}-${n}`!==o){const{x:s,y:a}=Mn(e,r);i.push({id:r.id||null,type:n,nodeId:e.id,x:s,y:a})}return i}function Vd(e,t,n,o,i,r){const{x:s,y:a}=lt(e),l=t.elementsFromPoint(s,a).find(x=>x.classList.contains("vue-flow__handle"));if(l){const x=l.getAttribute("data-nodeid");if(x){const g=Go(void 0,l),_=l.getAttribute("data-handleid"),w=r({nodeId:x,id:_,type:g});if(w){const d=i.find(h=>h.nodeId===x&&h.type===g&&h.id===_);return{handle:{id:_,type:g,nodeId:x,x:d?.x||n.x,y:d?.y||n.y},validHandleResult:w}}}}let c=[],v=Number.POSITIVE_INFINITY;for(const x of i){const g=Math.sqrt((x.x-n.x)**2+(x.y-n.y)**2);if(g<=o){const _=r(x);g<=v&&(g<v?c=[{handle:x,validHandleResult:_}]:g===v&&c.push({handle:x,validHandleResult:_}),v=g)}}if(!c.length)return{handle:null,validHandleResult:Wr()};if(c.length===1)return c[0];const p=c.some(({validHandleResult:x})=>x.isValid),m=c.some(({handle:x})=>x.type==="target");return c.find(({handle:x,validHandleResult:g})=>m?x.type==="target":p?g.isValid:!0)||c[0]}function $i(e,t,n,o,i,r,s,a,u,l,c){const v=r==="target",p=a.querySelector(`.vue-flow__handle[data-id="${t?.nodeId}-${t?.id}-${t?.type}"]`),{x:m,y:x}=lt(e),g=a.elementFromPoint(m,x),_=g?.classList.contains("vue-flow__handle")?g:p,w=Wr();if(_){w.handleDomNode=_;const d=Go(void 0,_),h=_.getAttribute("data-nodeid"),y=_.getAttribute("data-handleid"),O=_.classList.contains("connectable"),R=_.classList.contains("connectableend"),B={source:v?h:o,sourceHandle:v?y:i,target:v?o:h,targetHandle:v?i:y};w.connection=B,O&&R&&(n===Et.Strict?v&&d==="source"||!v&&d==="target":h!==o||y!==i)&&(w.isValid=s(B,{edges:u,nodes:l,sourceNode:c(B.source),targetNode:c(B.target)}),w.endHandle={nodeId:h,handleId:y,type:d,position:w.isValid?_.getAttribute("data-handlepos"):null})}return w}function Hd({nodes:e,nodeId:t,handleId:n,handleType:o}){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{handleBounds:a}=s;let u=[],l=[];a&&(u=Pi(s,a,"source",`${t}-${n}-${o}`),l=Pi(s,a,"target",`${t}-${n}-${o}`)),i.push(...u,...l)}return i}function Go(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Fd(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}const Yd=["production","prod"];function Un(e,...t){Kr()&&console.warn(`[Vue Flow]: ${e}`,...t)}function Kr(){return!Yd.includes("production")}function Ii(e,t,n,o){const i=t.querySelectorAll(`.vue-flow__handle${e}`);return Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Yn(s)}})}function ko(e,t,n,o,i,r=!1,s){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),Je(()=>{s.blur()})):n([e])}function Pe(e){return typeof f(e)<"u"}function Gd(e,t,n,o){if(!e||!e.source||!e.target)return n(new Te(Ie.EDGE_INVALID,e?.id??"[ID UNKNOWN]")),!1;let i;return vt(e)?i=e:i={...e,id:Rr(e)},i=zr(i,void 0,o),$d(i,t)?!1:i}function Ud(e,t,n,o,i,r){if(!t.source||!t.target)return r(new Te(Ie.EDGE_INVALID,e.id)),!1;const s=o(e.id);if(!s)return r(new Te(Ie.EDGE_NOT_FOUND,e.id)),!1;const{id:a,...u}=e,l={...u,id:i?Rr(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.splice(n.indexOf(s),1,l),l}function Mi(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const s=e[r];if(!xt(s)){n(new Te(Ie.NODE_INVALID,s?.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const a=Nd(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),i[r]=a}for(const r of i){const s=t(r.parentNode)||i.find(a=>a.id===r.parentNode);r.parentNode&&!s&&n(new Te(Ie.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),s&&(s.isParent=!0))}return i}function Ti(e,t){e.clear();for(const n of t){const{id:o,source:i,target:r,sourceHandle:s=null,targetHandle:a=null}=n,u=`${i}-source-${s}`,l=`${r}-target-${a}`,c=e.get(u)||new Map,v=e.get(l)||new Map,p=Oe({edgeId:o,source:i,target:r,sourceHandle:s,targetHandle:a});e.set(u,c.set(`${r}-${a}`,p)),e.set(l,v.set(`${i}-${s}`,p))}}function Di(e,t,n,o,i,r,s,a){const u=[];for(const l of e){const c=vt(l)?l:Gd(l,a,i,r);if(!c)continue;const v=n(c.source),p=n(c.target);if(!v||!p){i(new Te(Ie.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!v){i(new Te(Ie.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!p){i(new Te(Ie.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:v,targetNode:p})){i(new Te(Ie.EDGE_INVALID,c.id));continue}const m=o(c.id);u.push({...zr(c,m,r),sourceNode:v,targetNode:p})}return u}const Oi=Symbol("vueFlow"),Zr=Symbol("nodeId"),qr=Symbol("nodeRef"),Xd=Symbol("edgeId"),Wd=Symbol("edgeRef"),Xn=Symbol("slots");function jr(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodes:r,nodeExtent:s,nodeDragThreshold:a,viewport:u,autoPanOnNodeDrag:l,autoPanSpeed:c,nodesDraggable:v,panBy:p,findNode:m,multiSelectionActive:x,nodesSelectionActive:g,selectNodesOnDrag:_,removeSelectedElements:w,addSelectedNodes:d,updateNodePositions:h,emits:y}=ke(),{onStart:O,onDrag:R,onStop:B,onClick:U,el:W,disabled:Y,id:G,selectable:P,dragHandle:J}=e,E=Z(!1);let A=[],T,D=null,V={x:void 0,y:void 0},F={x:0,y:0},j=null,M=!1,z=0,I=!1;const $=qd(),oe=({x:te,y:re})=>{V={x:te,y:re};let fe=!1;if(A=A.map(C=>{const b={x:te-C.distance.x,y:re-C.distance.y},{computedPosition:S}=Fo(C,n.value?Gn(b,o.value):b,y.error,s.value,C.parentNode?m(C.parentNode):void 0);return fe=fe||C.position.x!==S.x||C.position.y!==S.y,C.position=S,C}),!!fe&&(h(A,!0,!0),E.value=!0,j)){const[C,b]=io({id:G,dragItems:A,findNode:m});R({event:j,node:C,nodes:b})}},ve=()=>{if(!D)return;const[te,re]=Gr(F,D,c.value);if(te!==0||re!==0){const fe={x:(V.x??0)-te/u.value.zoom,y:(V.y??0)-re/u.value.zoom};p({x:te,y:re})&&oe(fe)}z=requestAnimationFrame(ve)},he=(te,re)=>{M=!0;const fe=m(G);!_.value&&!x.value&&fe&&(fe.selected||w()),fe&&ye(P)&&_.value&&ko(fe,x.value,d,w,g,!1,re);const C=$(te.sourceEvent);if(V=C,A=Dd(r.value,v.value,C,m,G),A.length){const[b,S]=io({id:G,dragItems:A,findNode:m});O({event:te.sourceEvent,node:b,nodes:S})}},me=(te,re)=>{var fe;te.sourceEvent.type==="touchmove"&&te.sourceEvent.touches.length>1||(a.value===0&&he(te,re),V=$(te.sourceEvent),D=((fe=t.value)==null?void 0:fe.getBoundingClientRect())||null,F=lt(te.sourceEvent,D))},le=(te,re)=>{const fe=$(te.sourceEvent);if(!I&&M&&l.value&&(I=!0,ve()),!M){const C=fe.xSnapped-(V.x??0),b=fe.ySnapped-(V.y??0);Math.sqrt(C*C+b*b)>a.value&&he(te,re)}(V.x!==fe.xSnapped||V.y!==fe.ySnapped)&&A.length&&M&&(j=te.sourceEvent,F=lt(te.sourceEvent,D),oe(fe))},de=te=>{if(!Xr(te)&&!M&&!E.value&&!x.value){const re=te,fe=$(re),C=fe.xSnapped-(V.x??0),b=fe.ySnapped-(V.y??0),S=Math.sqrt(C*C+b*b);S!==0&&S<=a.value&&U?.(re);return}if(E.value=!1,I=!1,M=!1,V={x:void 0,y:void 0},cancelAnimationFrame(z),A.length){h(A,!1,!1);const[re,fe]=io({id:G,dragItems:A,findNode:m});B({event:te.sourceEvent,node:re,nodes:fe})}};return _e([()=>ye(Y),W],([te,re],fe,C)=>{if(re){const b=We(re);te||(T=Iu().on("start",S=>me(S,re)).on("drag",S=>le(S,re)).on("end",S=>de(S)).filter(S=>{const k=S.target,L=ye(J);return!S.button&&(!i.value||!Ci(k,`.${i.value}`,re)&&(!L||Ci(k,L,re)))}),b.call(T)),C(()=>{b.on(".drag",null),T&&(T.on("start",null),T.on("drag",null),T.on("end",null))})}}),E}function Kd(){return{doubleClick:ee(),click:ee(),mouseEnter:ee(),mouseMove:ee(),mouseLeave:ee(),contextMenu:ee(),updateStart:ee(),update:ee(),updateEnd:ee()}}function Zd(e,t){const n=Kd();return n.doubleClick.on(o=>{var i,r;t.edgeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.edgeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.edgeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.edgeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.edgeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.edgeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;t.edgeUpdateStart(o),(r=(i=e.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;t.edgeUpdate(o),(r=(i=e.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;t.edgeUpdateEnd(o),(r=(i=e.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function qd(){const{viewport:e,snapGrid:t,snapToGrid:n}=ke();return o=>{const i=Xr(o)?o.sourceEvent:o,{x:r,y:s}=lt(i),a=on({x:r,y:s},e.value),{x:u,y:l}=n.value?Gn(a,t.value):a;return{xSnapped:u,ySnapped:l,...a}}}function mn(){return!0}function Qr({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:s}){const{vueFlowRef:a,connectionMode:u,connectionRadius:l,connectOnClick:c,connectionClickStartHandle:v,nodesConnectable:p,autoPanOnConnect:m,autoPanSpeed:x,findNode:g,panBy:_,startConnection:w,updateConnection:d,endConnection:h,emits:y,viewport:O,edges:R,nodes:B,isValidConnection:U}=ke();let W=null,Y=!1,G=null,P=null;function J(A){var T;const D=ye(n)==="target",V=Yo(A),F=yi(A.target);if(V&&A.button===0||!V){let j=function(S){re=lt(S,de);const{handle:k,validHandleResult:L}=Vd(S,F,on(re,O.value,!1,[1,1]),l.value,C,ne=>$i(S,ne,u.value,ye(t),ye(e),D?"target":"source",I,F,R.value,B.value,g));if($=k,fe||(b(),fe=!0),W=L.connection,Y=L.isValid,G=L.handleDomNode,!(Y&&$&&P?.endHandle&&L.endHandle&&P.endHandle.type===L.endHandle.type&&P.endHandle.nodeId===L.endHandle.nodeId&&P.endHandle.handleId===L.endHandle.handleId)){if(d($&&Y?Br({x:$.x,y:$.y},O.value):re,L.endHandle,Fd(!!$,Y)),P=L,!$&&!Y&&!G)return ro(te);W&&W.source!==W.target&&G&&(ro(te),te=G,G.classList.add("connecting","vue-flow__handle-connecting"),G.classList.toggle("valid",Y),G.classList.toggle("vue-flow__handle-valid",Y))}},M=function(S){($||G)&&W&&Y&&(r?r(S,W):y.connect(W)),y.connectEnd(S),i&&s?.(S),ro(te),cancelAnimationFrame(oe),h(S),fe=!1,Y=!1,W=null,G=null,F.removeEventListener("mousemove",j),F.removeEventListener("mouseup",M),F.removeEventListener("touchmove",j),F.removeEventListener("touchend",M)};const z=g(ye(t));let I=ye(o)||U.value||mn;!I&&z&&(I=(D?z.isValidSourcePos:z.isValidTargetPos)||mn);let $,oe=0;const{x:ve,y:he}=lt(A),me=F?.elementFromPoint(ve,he),le=Go(ye(i),me),de=(T=a.value)==null?void 0:T.getBoundingClientRect();if(!de||!le)return;let te,re=lt(A,de),fe=!1;const C=Hd({nodes:B.value,nodeId:ye(t),handleId:ye(e),handleType:le}),b=()=>{if(!m.value)return;const[S,k]=Gr(re,de,x.value);_({x:S,y:k}),oe=requestAnimationFrame(b)};w({nodeId:ye(t),handleId:ye(e),type:le,position:me?.getAttribute("data-handlepos")||Q.Top},{x:ve-de.left,y:he-de.top}),y.connectStart({event:A,nodeId:ye(t),handleId:ye(e),handleType:le}),F.addEventListener("mousemove",j),F.addEventListener("mouseup",M),F.addEventListener("touchmove",j),F.addEventListener("touchend",M)}}function E(A){if(!c.value)return;const T=ye(n)==="target";if(!v.value)y.clickConnectStart({event:A,nodeId:ye(t),handleId:ye(e)}),w({nodeId:ye(t),type:ye(n),handleId:ye(e)},void 0,!0);else{let D=ye(o)||U.value||mn;const V=g(ye(t));if(!D&&V&&(D=(T?V.isValidSourcePos:V.isValidTargetPos)||mn),V&&(typeof V.connectable>"u"?p.value:V.connectable)===!1)return;const F=yi(A.target),{connection:j,isValid:M}=$i(A,{nodeId:ye(t),id:ye(e),type:ye(n)},u.value,v.value.nodeId,v.value.handleId||null,v.value.type,D,F,R.value,B.value,g),z=j.source===j.target;M&&!z&&y.connect(j),y.clickConnectEnd(A),h(A,!0)}}return{handlePointerDown:J,handleClick:E}}function jd(){return Lt(Zr,"")}function Jr(e){const t=e??jd()??"",n=Lt(qr,Z(null)),{findNode:o,edges:i,emits:r}=ke(),s=o(t);return s||r.error(new Te(Ie.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:se(()=>o(s.parentNode)),connectedEdges:se(()=>Fr([s],i.value))}}function Qd(){return{doubleClick:ee(),click:ee(),mouseEnter:ee(),mouseMove:ee(),mouseLeave:ee(),contextMenu:ee(),dragStart:ee(),drag:ee(),dragStop:ee()}}function Jd(e,t){const n=Qd();return n.doubleClick.on(o=>{var i,r;t.nodeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.nodeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.nodeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.nodeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.nodeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.nodeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;t.nodeDragStart(o),(r=(i=e.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;t.nodeDrag(o),(r=(i=e.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;t.nodeDragStop(o),(r=(i=e.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function es(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:s,emits:a}=ke();return(u,l=!1)=>{const c=r.value?i.value[0]:5,v=r.value?i.value[1]:5,p=l?4:1,m=u.x*c*p,x=u.y*v*p,g=[];for(const _ of e.value)if(_.draggable||s&&typeof _.draggable>"u"){const w={x:_.computedPosition.x+m,y:_.computedPosition.y+x},{computedPosition:d}=Fo(_,w,a.error,t.value,_.parentNode?o(_.parentNode):void 0);g.push({id:_.id,position:d,from:_.position,distance:{x:u.x,y:u.y},dimensions:_.dimensions})}n(g,!0,!1)}}const so=.1;function dt(){return Un("Viewport not initialized yet."),Promise.resolve(!1)}const ef={zoomIn:dt,zoomOut:dt,zoomTo:dt,fitView:dt,setCenter:dt,fitBounds:dt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:dt,setTransform:dt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function tf(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleBy(ao(e.d3Selection,i,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,s){return new Promise(a=>{const{x:u,y:l}=Or({x:-o,y:-i},e.translateExtent),c=Bt.translate(-u,-l).scale(r);e.d3Selection&&e.d3Zoom?e.d3Zoom.transform(ao(e.d3Selection,s,()=>{a(!0)}),c):a(!1)})}return se(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i?.duration),zoomOut:i=>t(1/1.2,i?.duration),zoomTo:(i,r)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleTo(ao(e.d3Selection,r?.duration,()=>{s(!0)}),i):s(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r?.duration),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r?.duration),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(i={padding:so,includeHiddenNodes:!1,duration:0})=>{var r,s;const a=[];for(const p of e.nodes)p.dimensions.width&&p.dimensions.height&&(i?.includeHiddenNodes||!p.hidden)&&(!((r=i.nodes)!=null&&r.length)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(p.id))&&a.push(p);if(!a.length)return Promise.resolve(!1);const u=Vr(a),{x:l,y:c,zoom:v}=_i(u,e.dimensions.width,e.dimensions.height,i.minZoom??e.minZoom,i.maxZoom??e.maxZoom,i.padding??so,i.offset);return n(l,c,v,i?.duration)},setCenter:(i,r,s)=>{const a=typeof s?.zoom<"u"?s.zoom:e.maxZoom,u=e.dimensions.width/2-i*a,l=e.dimensions.height/2-r*a;return n(u,l,a,s?.duration)},fitBounds:(i,r={padding:so})=>{const{x:s,y:a,zoom:u}=_i(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding);return n(s,a,u,r?.duration)},project:i=>on(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x-r,y:i.y-s};return on(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x+r,y:i.y+s};return Br(a,e.viewport)}return{x:0,y:0}}}:ef)}function ao(e,t=0,n){return e.transition().duration(t).on("end",n)}function nf(e,t,n){const o=Ui(!0);return o.run(()=>{const i=()=>{o.run(()=>{let g,_,w=!!(n.nodes.value.length||n.edges.value.length);g=kt([e.modelValue,()=>{var d,h;return(h=(d=e.modelValue)==null?void 0:d.value)==null?void 0:h.length}],([d])=>{d&&Array.isArray(d)&&(_?.pause(),n.setElements(d),!_&&!w&&d.length?w=!0:_?.resume())}),_=kt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([d,h])=>{var y;(y=e.modelValue)!=null&&y.value&&Array.isArray(e.modelValue.value)&&(g?.pause(),e.modelValue.value=[...d,...h],Je(()=>{g?.resume()}))},{immediate:w}),yn(()=>{g?.stop(),_?.stop()})})},r=()=>{o.run(()=>{let g,_,w=!!n.nodes.value.length;g=kt([e.nodes,()=>{var d,h;return(h=(d=e.nodes)==null?void 0:d.value)==null?void 0:h.length}],([d])=>{d&&Array.isArray(d)&&(_?.pause(),n.setNodes(d),!_&&!w&&d.length?w=!0:_?.resume())}),_=kt([n.nodes,()=>n.nodes.value.length],([d])=>{var h;(h=e.nodes)!=null&&h.value&&Array.isArray(e.nodes.value)&&(g?.pause(),e.nodes.value=[...d],Je(()=>{g?.resume()}))},{immediate:w}),yn(()=>{g?.stop(),_?.stop()})})},s=()=>{o.run(()=>{let g,_,w=!!n.edges.value.length;g=kt([e.edges,()=>{var d,h;return(h=(d=e.edges)==null?void 0:d.value)==null?void 0:h.length}],([d])=>{d&&Array.isArray(d)&&(_?.pause(),n.setEdges(d),!_&&!w&&d.length?w=!0:_?.resume())}),_=kt([n.edges,()=>n.edges.value.length],([d])=>{var h;(h=e.edges)!=null&&h.value&&Array.isArray(e.edges.value)&&(g?.pause(),e.edges.value=[...d],Je(()=>{g?.resume()}))},{immediate:w}),yn(()=>{g?.stop(),_?.stop()})})},a=()=>{o.run(()=>{_e(()=>t.maxZoom,()=>{t.maxZoom&&Pe(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},u=()=>{o.run(()=>{_e(()=>t.minZoom,()=>{t.minZoom&&Pe(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},l=()=>{o.run(()=>{_e(()=>t.translateExtent,()=>{t.translateExtent&&Pe(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{_e(()=>t.nodeExtent,()=>{t.nodeExtent&&Pe(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},v=()=>{o.run(()=>{_e(()=>t.applyDefault,()=>{Pe(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},p=()=>{o.run(()=>{const g=async _=>{let w=_;typeof t.autoConnect=="function"&&(w=await t.autoConnect(_)),w!==!1&&n.addEdges([w])};_e(()=>t.autoConnect,()=>{Pe(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),_e(n.autoConnect,(_,w,d)=>{_?n.onConnect(g):n.hooks.value.connect.off(g),d(()=>{n.hooks.value.connect.off(g)})},{immediate:!0})})},m=()=>{const g=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const _ of Object.keys(t)){const w=_;if(!g.includes(w)){const d=Ee(()=>t[w]),h=n[w];Mo(h)&&o.run(()=>{_e(d,y=>{Pe(y)&&(h.value=y)},{immediate:!0})})}}};(()=>{i(),r(),s(),u(),a(),l(),c(),v(),p(),m()})()}),()=>o.stop()}function of(){return{edgesChange:ee(),nodesChange:ee(),nodeDoubleClick:ee(),nodeClick:ee(),nodeMouseEnter:ee(),nodeMouseMove:ee(),nodeMouseLeave:ee(),nodeContextMenu:ee(),nodeDragStart:ee(),nodeDrag:ee(),nodeDragStop:ee(),nodesInitialized:ee(),miniMapNodeClick:ee(),miniMapNodeDoubleClick:ee(),miniMapNodeMouseEnter:ee(),miniMapNodeMouseMove:ee(),miniMapNodeMouseLeave:ee(),connect:ee(),connectStart:ee(),connectEnd:ee(),clickConnectStart:ee(),clickConnectEnd:ee(),paneReady:ee(),init:ee(),move:ee(),moveStart:ee(),moveEnd:ee(),selectionDragStart:ee(),selectionDrag:ee(),selectionDragStop:ee(),selectionContextMenu:ee(),selectionStart:ee(),selectionEnd:ee(),viewportChangeStart:ee(),viewportChange:ee(),viewportChangeEnd:ee(),paneScroll:ee(),paneClick:ee(),paneContextMenu:ee(),paneMouseEnter:ee(),paneMouseMove:ee(),paneMouseLeave:ee(),edgeContextMenu:ee(),edgeMouseEnter:ee(),edgeMouseMove:ee(),edgeMouseLeave:ee(),edgeDoubleClick:ee(),edgeClick:ee(),edgeUpdateStart:ee(),edgeUpdate:ee(),edgeUpdateEnd:ee(),updateNodeInternals:ee(),error:ee(e=>Un(e.message))}}function rf(e,t){Ms(()=>{for(const[n,o]of Object.entries(t.value)){const i=r=>{e(n,r)};o.fns.add(i),Bn(()=>{o.off(i)})}})}function ts(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Ho.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:qt.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:gt.Bezier,style:{}},connectionMode:Et.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:Tn()?"Meta":"Control",zoomActivationKeyCode:Tn()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:of(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const sf=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function af(e,t,n){const o=tf(e),i=C=>{const b=C??[];e.hooks.updateNodeInternals.trigger(b)},r=C=>Pd(C,e.nodes,e.edges),s=C=>kd(C,e.nodes,e.edges),a=C=>Fr(C,e.edges),u=({id:C,type:b,nodeId:S})=>{var k;return Array.from(((k=e.connectionLookup.get(`${S}-${b}-${C??null}`))==null?void 0:k.values())??[])},l=C=>{if(C)return t.value.get(C)},c=C=>{if(C)return n.value.get(C)},v=(C,b,S)=>{var k,L;const ne=[];for(const ie of C){const ce={id:ie.id,type:"position",dragging:S,from:ie.from};if(b&&(ce.position=ie.position,ie.parentNode)){const pe=l(ie.parentNode);ce.position={x:ce.position.x-(((k=pe?.computedPosition)==null?void 0:k.x)??0),y:ce.position.y-(((L=pe?.computedPosition)==null?void 0:L.y)??0)}}ne.push(ce)}ne?.length&&e.hooks.nodesChange.trigger(ne)},p=C=>{if(!e.vueFlowRef)return;const b=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!b)return;const S=window.getComputedStyle(b),{m22:k}=new window.DOMMatrixReadOnly(S.transform),L=[];for(let ne=0;ne<C.length;++ne){const ie=C[ne],ce=l(ie.id);if(ce){const pe=Yn(ie.nodeElement);if(!!(pe.width&&pe.height&&(ce.dimensions.width!==pe.width||ce.dimensions.height!==pe.height||ie.forceUpdate))){const be=ie.nodeElement.getBoundingClientRect();ce.dimensions=pe,ce.handleBounds.source=Ii(".source",ie.nodeElement,be,k),ce.handleBounds.target=Ii(".target",ie.nodeElement,be,k),L.push({id:ce.id,type:"dimensions",dimensions:pe})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),L.length&&e.hooks.nodesChange.trigger(L)},m=(C,b)=>{const S=new Set,k=new Set;for(const ie of C)xt(ie)?S.add(ie.id):vt(ie)&&k.add(ie.id);const L=pt(t.value,S,!0),ne=pt(n.value,k);if(e.multiSelectionActive){for(const ie of S)L.push(ft(ie,b));for(const ie of k)ne.push(ft(ie,b))}L.length&&e.hooks.nodesChange.trigger(L),ne.length&&e.hooks.edgesChange.trigger(ne)},x=C=>{if(e.multiSelectionActive){const b=C.map(S=>ft(S.id,!0));e.hooks.nodesChange.trigger(b);return}e.hooks.nodesChange.trigger(pt(t.value,new Set(C.map(b=>b.id)),!0)),e.hooks.edgesChange.trigger(pt(n.value))},g=C=>{if(e.multiSelectionActive){const b=C.map(S=>ft(S.id,!0));e.hooks.edgesChange.trigger(b);return}e.hooks.edgesChange.trigger(pt(n.value,new Set(C.map(b=>b.id)))),e.hooks.nodesChange.trigger(pt(t.value,new Set,!0))},_=C=>{m(C,!0)},w=C=>{const S=(C||e.nodes).map(k=>(k.selected=!1,ft(k.id,!1)));e.hooks.nodesChange.trigger(S)},d=C=>{const S=(C||e.edges).map(k=>(k.selected=!1,ft(k.id,!1)));e.hooks.edgesChange.trigger(S)},h=C=>{if(!C||!C.length)return m([],!1);const b=C.reduce((S,k)=>{const L=ft(k.id,!1);return xt(k)?S.nodes.push(L):S.edges.push(L),S},{nodes:[],edges:[]});b.nodes.length&&e.hooks.nodesChange.trigger(b.nodes),b.edges.length&&e.hooks.edgesChange.trigger(b.edges)},y=C=>{var b;(b=e.d3Zoom)==null||b.scaleExtent([C,e.maxZoom]),e.minZoom=C},O=C=>{var b;(b=e.d3Zoom)==null||b.scaleExtent([e.minZoom,C]),e.maxZoom=C},R=C=>{var b;(b=e.d3Zoom)==null||b.translateExtent(C),e.translateExtent=C},B=C=>{e.nodeExtent=C,i()},U=C=>{var b;(b=e.d3Zoom)==null||b.clickDistance(C)},W=C=>{e.nodesDraggable=C,e.nodesConnectable=C,e.elementsSelectable=C},Y=C=>{const b=C instanceof Function?C(e.nodes):C;!e.initialized&&!b.length||(e.nodes=Mi(b,l,e.hooks.error.trigger))},G=C=>{const b=C instanceof Function?C(e.edges):C;if(!e.initialized&&!b.length)return;const S=Di(b,e.isValidConnection,l,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Ti(e.connectionLookup,S),e.edges=S},P=C=>{const b=C instanceof Function?C([...e.nodes,...e.edges]):C;!e.initialized&&!b.length||(Y(b.filter(xt)),G(b.filter(vt)))},J=C=>{let b=C instanceof Function?C(e.nodes):C;b=Array.isArray(b)?b:[b];const S=Mi(b,l,e.hooks.error.trigger),k=[];for(const L of S)k.push(bi(L));k.length&&e.hooks.nodesChange.trigger(k)},E=C=>{let b=C instanceof Function?C(e.edges):C;b=Array.isArray(b)?b:[b];const S=Di(b,e.isValidConnection,l,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),k=[];for(const L of S)k.push(bi(L));k.length&&e.hooks.edgesChange.trigger(k)},A=(C,b=!0,S=!1)=>{const k=C instanceof Function?C(e.nodes):C,L=Array.isArray(k)?k:[k],ne=[],ie=[];function ce(we){const be=a(we);for(const Ce of be)(!Pe(Ce.deletable)||Ce.deletable)&&ie.push(Ei(Ce.id,Ce.source,Ce.target,Ce.sourceHandle,Ce.targetHandle))}function pe(we){const be=[];for(const Ce of e.nodes)Ce.parentNode===we&&be.push(Ce);if(be.length){for(const Ce of be)ne.push(Si(Ce.id));b&&ce(be);for(const Ce of be)pe(Ce.id)}}for(const we of L){const be=typeof we=="string"?l(we):we;be&&(Pe(be.deletable)&&!be.deletable||(ne.push(Si(be.id)),b&&ce([be]),S&&pe(be.id)))}ie.length&&e.hooks.edgesChange.trigger(ie),ne.length&&e.hooks.nodesChange.trigger(ne)},T=C=>{const b=C instanceof Function?C(e.edges):C,S=Array.isArray(b)?b:[b],k=[];for(const L of S){const ne=typeof L=="string"?c(L):L;ne&&(Pe(ne.deletable)&&!ne.deletable||k.push(Ei(typeof L=="string"?L:L.id,ne.source,ne.target,ne.sourceHandle,ne.targetHandle)))}e.hooks.edgesChange.trigger(k)},D=(C,b,S=!0)=>Ud(C,b,e.edges,c,S,e.hooks.error.trigger),V=(C,b,S={replace:!1})=>{const k=c(C);if(!k)return;const L=typeof b=="function"?b(k):b;k.data=S.replace?L:{...k.data,...L}},F=C=>xi(C,e.nodes),j=C=>{const b=xi(C,e.edges);return Ti(e.connectionLookup,b),b},M=(C,b,S={replace:!1})=>{const k=l(C);if(!k)return;const L=typeof b=="function"?b(k):b;S.replace?e.nodes.splice(e.nodes.indexOf(k),1,L):Object.assign(k,L)},z=(C,b,S={replace:!1})=>{const k=l(C);if(!k)return;const L=typeof b=="function"?b(k):b;k.data=S.replace?L:{...k.data,...L}},I=(C,b,S=!1)=>{S?e.connectionClickStartHandle=C:e.connectionStartHandle=C,e.connectionEndHandle=null,e.connectionStatus=null,b&&(e.connectionPosition=b)},$=(C,b=null,S=null)=>{e.connectionStartHandle&&(e.connectionPosition=C,e.connectionEndHandle=b,e.connectionStatus=S)},oe=(C,b)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,b?e.connectionClickStartHandle=null:e.connectionStartHandle=null},ve=C=>{const b=Cd(C),S=b?null:Zt(C)?C:l(C.id);return!b&&!S?[null,null,b]:[b?C:Co(S),S,b]},he=(C,b=!0,S=e.nodes)=>{const[k,L,ne]=ve(C);if(!k)return[];const ie=[];for(const ce of S||e.nodes){if(!ne&&(ce.id===L.id||!ce.computedPosition))continue;const pe=Co(ce),we=No(pe,k);(b&&we>0||we>=Number(k.width)*Number(k.height))&&ie.push(ce)}return ie},me=(C,b,S=!0)=>{const[k]=ve(C);if(!k)return!1;const L=No(k,b);return S&&L>0||L>=Number(k.width)*Number(k.height)},le=C=>{const{viewport:b,dimensions:S,d3Zoom:k,d3Selection:L,translateExtent:ne}=e;if(!k||!L||!C.x&&!C.y)return!1;const ie=Bt.translate(b.x+C.x,b.y+C.y).scale(b.zoom),ce=[[0,0],[S.width,S.height]],pe=k.constrain()(ie,ce,ne),we=e.viewport.x!==pe.x||e.viewport.y!==pe.y||e.viewport.zoom!==pe.k;return k.transform(L,pe),we},de=C=>{const b=C instanceof Function?C(e):C,S=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Pe(b.defaultEdgeOptions)&&(e.defaultEdgeOptions=b.defaultEdgeOptions);const k=b.modelValue||b.nodes||b.edges?[]:void 0;k&&(b.modelValue&&k.push(...b.modelValue),b.nodes&&k.push(...b.nodes),b.edges&&k.push(...b.edges),P(k));const L=()=>{Pe(b.maxZoom)&&O(b.maxZoom),Pe(b.minZoom)&&y(b.minZoom),Pe(b.translateExtent)&&R(b.translateExtent)};for(const ne of Object.keys(b)){const ie=ne,ce=b[ie];![...sf,...S].includes(ie)&&Pe(ce)&&(e[ie]=ce)}po(()=>e.d3Zoom).not.toBeNull().then(L),e.initialized||(e.initialized=!0)};return{updateNodePositions:v,updateNodeDimensions:p,setElements:P,setNodes:Y,setEdges:G,addNodes:J,addEdges:E,removeNodes:A,removeEdges:T,findNode:l,findEdge:c,updateEdge:D,updateEdgeData:V,updateNode:M,updateNodeData:z,applyEdgeChanges:j,applyNodeChanges:F,addSelectedElements:_,addSelectedNodes:x,addSelectedEdges:g,setMinZoom:y,setMaxZoom:O,setTranslateExtent:R,setNodeExtent:B,setPaneClickDistance:U,removeSelectedElements:h,removeSelectedNodes:w,removeSelectedEdges:d,startConnection:I,updateConnection:$,endConnection:oe,setInteractive:W,setState:de,getIntersectingNodes:he,getIncomers:r,getOutgoers:s,getConnectedEdges:a,getHandleConnections:u,isNodeIntersecting:me,panBy:le,fitView:C=>o.value.fitView(C),zoomIn:C=>o.value.zoomIn(C),zoomOut:C=>o.value.zoomOut(C),zoomTo:(C,b)=>o.value.zoomTo(C,b),setViewport:(C,b)=>o.value.setViewport(C,b),setTransform:(C,b)=>o.value.setTransform(C,b),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(C,b,S)=>o.value.setCenter(C,b,S),fitBounds:(C,b)=>o.value.fitBounds(C,b),project:C=>o.value.project(C),screenToFlowCoordinate:C=>o.value.screenToFlowCoordinate(C),flowToScreenCoordinate:C=>o.value.flowToScreenCoordinate(C),toObject:()=>{const C=[],b=[];for(const S of e.nodes){const{computedPosition:k,handleBounds:L,selected:ne,dimensions:ie,isParent:ce,resizing:pe,dragging:we,events:be,...Ce}=S;C.push(Ce)}for(const S of e.edges){const{selected:k,sourceNode:L,targetNode:ne,events:ie,...ce}=S;b.push(ce)}return JSON.parse(JSON.stringify({nodes:C,edges:b,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:C=>new Promise(b=>{const{nodes:S,edges:k,position:L,zoom:ne,viewport:ie}=C;if(S&&Y(S),k&&G(k),ie?.x&&ie?.y||L){const ce=ie?.x||L[0],pe=ie?.y||L[1],we=ie?.zoom||ne||e.viewport.zoom;return po(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:ce,y:pe,zoom:we}).then(()=>{b(!0)})})}else b(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const C=ts();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const b=Bt.translate(C.defaultViewport.x??0,C.defaultViewport.y??0).scale(Ct(C.defaultViewport.zoom??1,C.minZoom,C.maxZoom)),S=e.viewportRef.getBoundingClientRect(),k=[[0,0],[S.width,S.height]],L=e.d3Zoom.constrain()(b,k,C.translateExtent);e.d3Zoom.transform(e.d3Selection,L)}de(C)},$destroy:()=>{}}}const lf=["data-id","data-handleid","data-nodeid","data-handlepos"],uf={name:"Handle",compatConfig:{MODE:3}},$e=ue({...uf,props:{id:{default:null},type:{},position:{default:()=>Q.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=Yi(e,["position","connectable","connectableStart","connectableEnd","id"]),o=Ee(()=>n.type??"source"),i=Ee(()=>n.isValidConnection??null),{connectionStartHandle:r,connectionClickStartHandle:s,connectionEndHandle:a,vueFlowRef:u,nodesConnectable:l,noDragClassName:c,noPanClassName:v}=ke(),{id:p,node:m,nodeEl:x,connectedEdges:g}=Jr(),_=Z(),w=Ee(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),d=Ee(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),h=Ee(()=>{var Y,G,P,J,E,A;return((Y=r.value)==null?void 0:Y.nodeId)===p&&((G=r.value)==null?void 0:G.handleId)===e.id&&((P=r.value)==null?void 0:P.type)===o.value||((J=a.value)==null?void 0:J.nodeId)===p&&((E=a.value)==null?void 0:E.handleId)===e.id&&((A=a.value)==null?void 0:A.type)===o.value}),y=Ee(()=>{var Y,G,P;return((Y=s.value)==null?void 0:Y.nodeId)===p&&((G=s.value)==null?void 0:G.handleId)===e.id&&((P=s.value)==null?void 0:P.type)===o.value}),{handlePointerDown:O,handleClick:R}=Qr({nodeId:p,handleId:e.id,isValidConnection:i,type:o}),B=se(()=>typeof e.connectable=="string"&&e.connectable==="single"?!g.value.some(Y=>{const G=Y[`${o.value}Handle`];return Y[o.value]!==p?!1:G?G===e.id:!0}):typeof e.connectable=="number"?g.value.filter(Y=>{const G=Y[`${o.value}Handle`];return Y[o.value]!==p?!1:G?G===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(m,g.value):Pe(e.connectable)?e.connectable:l.value);Ye(()=>{var Y;if(!m.dimensions.width||!m.dimensions.height)return;const G=(Y=m.handleBounds[o.value])==null?void 0:Y.find(V=>V.id===e.id);if(!u.value||G)return;const P=u.value.querySelector(".vue-flow__transformationpane");if(!x.value||!_.value||!P||!e.id)return;const J=x.value.getBoundingClientRect(),E=_.value.getBoundingClientRect(),A=window.getComputedStyle(P),{m22:T}=new window.DOMMatrixReadOnly(A.transform),D={id:e.id,position:e.position,x:(E.left-J.left)/T,y:(E.top-J.top)/T,...Yn(_.value)};m.handleBounds[o.value]=[...m.handleBounds[o.value]??[],D]}),Gi(()=>{const Y=m.handleBounds[o.value];Y&&(m.handleBounds[o.value]=Y.filter(G=>G.id!==e.id))});function U(Y){const G=Yo(Y);B.value&&w.value&&(G&&Y.button===0||!G)&&O(Y)}function W(Y){!p||!s.value&&!w.value||B.value&&R(Y)}return t({handleClick:R,handlePointerDown:O,onClick:W,onPointerDown:U}),(Y,G)=>(q(),ae("div",{ref_key:"handle",ref:_,"data-id":`${f(p)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":f(p),"data-handlepos":Y.position,class:Tt(["vue-flow__handle",[`vue-flow__handle-${Y.position}`,`vue-flow__handle-${e.id}`,f(c),f(v),o.value,{connectable:B.value,connecting:y.value,connectablestart:w.value,connectableend:d.value,connectionindicator:B.value&&(w.value&&!h.value||d.value&&h.value)}]]),onMousedown:U,onTouchstartPassive:U,onClick:W},[Qe(Y.$slots,"default",{id:Y.id})],42,lf))}}),Wn=function({sourcePosition:e=Q.Bottom,targetPosition:t=Q.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:s}){const a=s.label||n;return[xe($e,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof a!="string"&&a?xe(a):xe(Fe,[a]),xe($e,{type:"source",position:e,connectable:o,isValidConnection:r})]};Wn.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Wn.inheritAttrs=!1;Wn.compatConfig={MODE:3};const cf=Wn,Kn=function({targetPosition:e=Q.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label||t;return[xe($e,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?xe(r):xe(Fe,[r])]};Kn.props=["targetPosition","label","isValidTargetPos","connectable","data"];Kn.inheritAttrs=!1;Kn.compatConfig={MODE:3};const df=Kn,Zn=function({sourcePosition:e=Q.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label||t;return[typeof r!="string"&&r?xe(r):xe(Fe,[r]),xe($e,{type:"source",position:e,connectable:n,isValidConnection:o})]};Zn.props=["sourcePosition","label","isValidSourcePos","connectable","data"];Zn.inheritAttrs=!1;Zn.compatConfig={MODE:3};const ff=Zn,hf=["transform"],pf=["width","height","x","y","rx","ry"],vf=["y"],mf={name:"EdgeText",compatConfig:{MODE:3}},gf=ue({...mf,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=Z({x:0,y:0,width:0,height:0}),n=Z(null),o=se(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);Ye(i),_e([()=>e.x,()=>e.y,n,()=>e.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,s)=>(q(),ae("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(q(),ae("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:tt(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,pf)):Me("",!0),H("text",Ls(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[Qe(r.$slots,"default",{},()=>[typeof r.label!="string"?(q(),ge(Bs(r.label),{key:0})):(q(),ae(Fe,{key:1},[Ne(K(r.label),1)],64))])],16,vf)],8,hf))}}),yf=["id","d","marker-end","marker-start"],_f=["d","stroke-width"],wf={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},qn=ue({...wf,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},style:{},labelStyle:{},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=Yi(e,["interactionWidth","labelShowBg"]),o=Z(null),i=Z(null),r=Z(null),s=Rs();return t({pathEl:o,interactionEl:i,labelEl:r}),(a,u)=>(q(),ae(Fe,null,[H("path",{id:a.id,ref_key:"pathEl",ref:o,d:a.path,style:tt(n.style),class:Tt(["vue-flow__edge-path",f(s).class]),"marker-end":a.markerEnd,"marker-start":a.markerStart},null,14,yf),a.interactionWidth?(q(),ae("path",{key:0,ref_key:"interactionEl",ref:i,fill:"none",d:a.path,"stroke-width":a.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,_f)):Me("",!0),a.label&&a.labelX&&a.labelY?(q(),ge(gf,{key:1,ref_key:"labelEl",ref:r,x:a.labelX,y:a.labelY,label:a.label,"label-show-bg":a.labelShowBg,"label-bg-style":a.labelBgStyle,"label-bg-padding":a.labelBgPadding,"label-bg-border-radius":a.labelBgBorderRadius,"label-style":a.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Me("",!0)],64))}});function ns({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n<e?n+i:n-i,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[r,a,i,s]}function os({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:s,targetControlY:a}){const u=e*.125+i*.375+s*.375+n*.125,l=t*.125+r*.375+a*.375+o*.125,c=Math.abs(u-e),v=Math.abs(l-t);return[u,l,c,v]}function gn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function zi({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let s,a;switch(e){case Q.Left:s=t-gn(t-o,r),a=n;break;case Q.Right:s=t+gn(o-t,r),a=n;break;case Q.Top:s=t,a=n-gn(n-i,r);break;case Q.Bottom:s=t,a=n+gn(i-n,r);break}return[s,a]}function is(e){const{sourceX:t,sourceY:n,sourcePosition:o=Q.Bottom,targetX:i,targetY:r,targetPosition:s=Q.Top,curvature:a=.25}=e,[u,l]=zi({pos:o,x1:t,y1:n,x2:i,y2:r,c:a}),[c,v]=zi({pos:s,x1:i,y1:r,x2:t,y2:n,c:a}),[p,m,x,g]=os({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:u,sourceControlY:l,targetControlX:c,targetControlY:v});return[`M${t},${n} C${u},${l} ${c},${v} ${i},${r}`,p,m,x,g]}function Ai({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,s;switch(e){case Q.Left:case Q.Right:r=.5*(t+o),s=n;break;case Q.Top:case Q.Bottom:r=t,s=.5*(n+i);break}return[r,s]}function rs(e){const{sourceX:t,sourceY:n,sourcePosition:o=Q.Bottom,targetX:i,targetY:r,targetPosition:s=Q.Top}=e,[a,u]=Ai({pos:o,x1:t,y1:n,x2:i,y2:r}),[l,c]=Ai({pos:s,x1:i,y1:r,x2:t,y2:n}),[v,p,m,x]=os({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:a,sourceControlY:u,targetControlX:l,targetControlY:c});return[`M${t},${n} C${a},${u} ${l},${c} ${i},${r}`,v,p,m,x]}const Ri={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}};function xf({source:e,sourcePosition:t=Q.Bottom,target:n}){return t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function Bi(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function bf({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:o=Q.Top,center:i,offset:r}){const s=Ri[t],a=Ri[o],u={x:e.x+s.x*r,y:e.y+s.y*r},l={x:n.x+a.x*r,y:n.y+a.y*r},c=xf({source:u,sourcePosition:t,target:l}),v=c.x!==0?"x":"y",p=c[v];let m,x,g;const _={x:0,y:0},w={x:0,y:0},[d,h,y,O]=ns({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[v]*a[v]===-1){x=i.x??d,g=i.y??h;const B=[{x,y:u.y},{x,y:l.y}],U=[{x:u.x,y:g},{x:l.x,y:g}];s[v]===p?m=v==="x"?B:U:m=v==="x"?U:B}else{const B=[{x:u.x,y:l.y}],U=[{x:l.x,y:u.y}];if(v==="x"?m=s.x===p?U:B:m=s.y===p?B:U,t===o){const J=Math.abs(e[v]-n[v]);if(J<=r){const E=Math.min(r-1,r-J);s[v]===p?_[v]=(u[v]>e[v]?-1:1)*E:w[v]=(l[v]>n[v]?-1:1)*E}}if(t!==o){const J=v==="x"?"y":"x",E=s[v]===a[J],A=u[J]>l[J],T=u[J]<l[J];(s[v]===1&&(!E&&A||E&&T)||s[v]!==1&&(!E&&T||E&&A))&&(m=v==="x"?B:U)}const W={x:u.x+_.x,y:u.y+_.y},Y={x:l.x+w.x,y:l.y+w.y},G=Math.max(Math.abs(W.x-m[0].x),Math.abs(Y.x-m[0].x)),P=Math.max(Math.abs(W.y-m[0].y),Math.abs(Y.y-m[0].y));G>=P?(x=(W.x+Y.x)/2,g=m[0].y):(x=m[0].x,g=(W.y+Y.y)/2)}return[[e,{x:u.x+_.x,y:u.y+_.y},...m,{x:l.x+w.x,y:l.y+w.y},n],x,g,y,O]}function Sf(e,t,n,o){const i=Math.min(Bi(e,t)/2,Bi(t,n)/2,o),{x:r,y:s}=t;if(e.x===r&&r===n.x||e.y===s&&s===n.y)return`L${r} ${s}`;if(e.y===s){const l=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*l},${s}Q ${r},${s} ${r},${s+i*c}`}const a=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${r},${s+i*u}Q ${r},${s} ${r+i*a},${s}`}function Po(e){const{sourceX:t,sourceY:n,sourcePosition:o=Q.Bottom,targetX:i,targetY:r,targetPosition:s=Q.Top,borderRadius:a=5,centerX:u,centerY:l,offset:c=20}=e,[v,p,m,x,g]=bf({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:s,center:{x:u,y:l},offset:c});return[v.reduce((w,d,h)=>{let y;return h>0&&h<v.length-1?y=Sf(v[h-1],d,v[h+1],a):y=`${h===0?"M":"L"}${d.x} ${d.y}`,w+=y,w},""),p,m,x,g]}function Ef(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,s,a,u]=ns({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,s,a,u]}const Cf=ue({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Ef(e);return xe(qn,{path:n,labelX:o,labelY:i,...t,...e})}}}),Nf=Cf,kf=ue({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=Po({...e,sourcePosition:e.sourcePosition??Q.Bottom,targetPosition:e.targetPosition??Q.Top});return xe(qn,{path:n,labelX:o,labelY:i,...t,...e})}}}),ss=kf,Pf=ue({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>xe(ss,{...e,...t,borderRadius:0})}}),$f=Pf,If=ue({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=is({...e,sourcePosition:e.sourcePosition??Q.Bottom,targetPosition:e.targetPosition??Q.Top});return xe(qn,{path:n,labelX:o,labelY:i,...t,...e})}}}),Mf=If,Tf=ue({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=rs({...e,sourcePosition:e.sourcePosition??Q.Bottom,targetPosition:e.targetPosition??Q.Top});return xe(qn,{path:n,labelX:o,labelY:i,...t,...e})}}}),Df=Tf,Of={input:ff,default:cf,output:df},zf={default:Mf,straight:Nf,step:$f,smoothstep:ss,simplebezier:Df};function Af(e,t,n){const o=se(()=>g=>t.value.get(g)),i=se(()=>g=>n.value.get(g)),r=se(()=>{const g={...zf,...e.edgeTypes},_=Object.keys(g);for(const w of e.edges)w.type&&!_.includes(w.type)&&(g[w.type]=w.type);return g}),s=se(()=>{const g={...Of,...e.nodeTypes},_=Object.keys(g);for(const w of e.nodes)w.type&&!_.includes(w.type)&&(g[w.type]=w.type);return g}),a=se(()=>e.onlyRenderVisibleElements?Hr(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),u=se(()=>{if(e.onlyRenderVisibleElements){const g=[];for(const _ of e.edges){const w=t.value.get(_.source),d=t.value.get(_.target);Rd({sourcePos:w.computedPosition||{x:0,y:0},targetPos:d.computedPosition||{x:0,y:0},sourceWidth:w.dimensions.width,sourceHeight:w.dimensions.height,targetWidth:d.dimensions.width,targetHeight:d.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&g.push(_)}return g}return e.edges}),l=se(()=>[...a.value,...u.value]),c=se(()=>{const g=[];for(const _ of e.nodes)_.selected&&g.push(_);return g}),v=se(()=>{const g=[];for(const _ of e.edges)_.selected&&g.push(_);return g}),p=se(()=>[...c.value,...v.value]),m=se(()=>{const g=[];for(const _ of e.nodes)_.dimensions.width&&_.dimensions.height&&_.handleBounds!==void 0&&g.push(_);return g}),x=se(()=>a.value.length>0&&m.value.length===a.value.length);return{getNode:o,getEdge:i,getElements:l,getEdgeTypes:r,getNodeTypes:s,getEdges:u,getNodes:a,getSelectedElements:p,getSelectedNodes:c,getSelectedEdges:v,getNodesInitialized:m,areNodesInitialized:x}}class yt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=sn())==null?void 0:t.appContext.app,o=n?.config.globalProperties.$vueFlowStorage??yt.instance;return yt.instance=o??new yt,n&&(n.config.globalProperties.$vueFlowStorage=yt.instance),yt.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=ts(),i=Ts(o),r={};for(const[p,m]of Object.entries(i.hooks)){const x=`on${p.charAt(0).toUpperCase()+p.slice(1)}`;r[x]=m.on}const s={};for(const[p,m]of Object.entries(i.hooks))s[p]=m.trigger;const a=se(()=>{const p=new Map;for(const m of i.nodes)p.set(m.id,m);return p}),u=se(()=>{const p=new Map;for(const m of i.edges)p.set(m.id,m);return p}),l=Af(i,a,u),c=af(i,a,u);c.setState({...i,...n});const v={...r,...l,...c,...La(i),nodeLookup:a,edgeLookup:u,emits:s,id:t,vueFlowVersion:"1.41.5",$destroy:()=>{this.remove(t)}};return this.set(t,v),v}getId(){return`vue-flow-${this.currentId++}`}}function ke(e){const t=yt.getInstance(),n=Xi(),o=typeof e=="object",i=o?e:{id:e},r=i.id,s=r??n?.vueFlowId;let a;if(n){const u=Lt(Oi,null);typeof u<"u"&&u!==null&&(!s||u.id===s)&&(a=u)}if(a||s&&(a=t.get(s)),!a||s&&a.id!==s){const u=r??t.getId(),l=t.create(u,i);a=l,(n??Ui(!0)).run(()=>{_e(l.applyDefault,(v,p,m)=>{const x=_=>{l.applyNodeChanges(_)},g=_=>{l.applyEdgeChanges(_)};v?(l.onNodesChange(x),l.onEdgesChange(g)):(l.hooks.value.nodesChange.off(x),l.hooks.value.edgesChange.off(g)),m(()=>{l.hooks.value.nodesChange.off(x),l.hooks.value.edgesChange.off(g)})},{immediate:!0}),Bn(()=>{if(a){const v=t.get(a.id);v?v.$destroy():Un(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(i);if(n&&(Dt(Oi,a),n.vueFlowId=a.id),o){const u=sn();u?.type.name!=="VueFlow"&&a.emits.error(new Te(Ie.USEVUEFLOW_OPTIONS))}return a}function Rf(e){const{emits:t,dimensions:n}=ke();let o;Ye(()=>{const i=e.value,r=()=>{if(!i)return;const s=Yn(i);(s.width===0||s.height===0)&&t.error(new Te(Ie.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:s.width||500,height:s.height||500}};r(),window.addEventListener("resize",r),i&&(o=new ResizeObserver(()=>r()),o.observe(i)),zn(()=>{window.removeEventListener("resize",r),o&&i&&o.unobserve(i)})})}const Bf={name:"UserSelection",compatConfig:{MODE:3}},Lf=ue({...Bf,props:{userSelectionRect:{}},setup(e){return(t,n)=>(q(),ae("div",{class:"vue-flow__selection vue-flow__container",style:tt({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),Vf=["tabIndex"],Hf={name:"NodesSelection",compatConfig:{MODE:3}},Ff=ue({...Hf,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:s}=ke(),a=es(),u=Z(null),l=jr({el:u,onStart(x){t.selectionDragStart(x)},onDrag(x){t.selectionDrag(x)},onStop(x){t.selectionDragStop(x)}});Ye(()=>{var x;r.value||(x=u.value)==null||x.focus({preventScroll:!0})});const c=se(()=>Vr(o.value)),v=se(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function p(x){t.selectionContextMenu({event:x,nodes:o.value})}function m(x){r||Mt[x.key]&&a({x:Mt[x.key].x,y:Mt[x.key].y},x.shiftKey)}return(x,g)=>!f(s)&&c.value.width&&c.value.height?(q(),ae("div",{key:0,class:Tt(["vue-flow__nodesselection vue-flow__container",f(i)]),style:tt({transform:`translate(${f(n).x}px,${f(n).y}px) scale(${f(n).zoom})`})},[H("div",{ref_key:"el",ref:u,class:Tt([{dragging:f(l)},"vue-flow__nodesselection-rect"]),style:tt(v.value),tabIndex:f(r)?void 0:-1,onContextmenu:p,onKeydown:m},null,46,Vf)],6)):Me("",!0)}});function Yf(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Gf={name:"Pane",compatConfig:{MODE:3}},Uf=ue({...Gf,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:s,panOnDrag:a,userSelectionRect:u,elementsSelectable:l,nodesSelectionActive:c,getSelectedEdges:v,getSelectedNodes:p,removeNodes:m,removeEdges:x,selectionMode:g,deleteKeyCode:_,multiSelectionKeyCode:w,multiSelectionActive:d,edgeLookup:h,nodeLookup:y}=ke(),O=Z(null),R=Z(0),B=Z(0),U=Z(),W=Z(new Map),Y=Ee(()=>l.value&&(e.isSelecting||r.value));let G=!1,P=!1;const J=jt(_,{actInsideInputWithModifier:!1}),E=jt(w);_e(J,I=>{I&&(m(p.value),x(v.value),c.value=!1)}),_e(E,I=>{d.value=I});function A(I,$){return oe=>{oe.target===$&&I?.(oe)}}function T(){r.value=!1,u.value=null,R.value=0,B.value=0}function D(I){if(G){G=!1;return}i.paneClick(I),s(),c.value=!1}function V(I){var $;if(Array.isArray(a.value)&&(($=a.value)!=null&&$.includes(2))){I.preventDefault();return}i.paneContextMenu(I)}function F(I){i.paneScroll(I)}function j(I){var $,oe,ve,he,me;if(U.value=($=t.value)==null?void 0:$.getBoundingClientRect(),!l.value||!e.isSelecting||I.button!==0||I.target!==O.value||!U.value)return;(ve=(oe=I.target)==null?void 0:oe.setPointerCapture)==null||ve.call(oe,I.pointerId);const{x:le,y:de}=Yf(I,U.value);P=!0,G=!1,W.value=new Map;for(const[te,re]of h.value)W.value.set(re.source,((he=W.value.get(re.source))==null?void 0:he.add(te))||new Set([te])),W.value.set(re.target,((me=W.value.get(re.target))==null?void 0:me.add(te))||new Set([te]));s(),u.value={width:0,height:0,startX:le,startY:de,x:le,y:de},i.selectionStart(I)}function M(I){if(!U.value||!u.value)return;G=!0;const{x:$,y:oe}=lt(I,U.value),{startX:ve=0,startY:he=0}=u.value,me={startX:ve,startY:he,x:$<ve?$:ve,y:oe<he?oe:he,width:Math.abs($-ve),height:Math.abs(oe-he)},le=Hr(n.value,me,o.value,g.value===Ho.Partial,!0),de=new Set,te=new Set;for(const re of le){te.add(re.id);const fe=W.value.get(re.id);if(fe)for(const C of fe)de.add(C)}if(R.value!==te.size){R.value=te.size;const re=pt(y.value,te,!0);i.nodesChange(re)}if(B.value!==de.size){B.value=de.size;const re=pt(h.value,de);i.edgesChange(re)}u.value=me,r.value=!0,c.value=!1}function z(I){var $;I.button!==0||!P||(($=I.target)==null||$.releasePointerCapture(I.pointerId),!r.value&&u.value&&I.target===O.value&&D(I),R.value>0&&(c.value=!0),T(),i.selectionEnd(I),e.selectionKeyPressed&&(G=!1),P=!1)}return(I,$)=>(q(),ae("div",{ref_key:"container",ref:O,class:Tt(["vue-flow__pane vue-flow__container",{selection:I.isSelecting}]),onClick:$[0]||($[0]=oe=>Y.value?void 0:A(D,O.value)(oe)),onContextmenu:$[1]||($[1]=oe=>A(V,O.value)(oe)),onWheelPassive:$[2]||($[2]=oe=>A(F,O.value)(oe)),onPointerenter:$[3]||($[3]=oe=>Y.value?void 0:f(i).paneMouseEnter(oe)),onPointerdown:$[4]||($[4]=oe=>Y.value?j(oe):f(i).paneMouseMove(oe)),onPointermove:$[5]||($[5]=oe=>Y.value?M(oe):f(i).paneMouseMove(oe)),onPointerup:$[6]||($[6]=oe=>Y.value?z(oe):void 0),onPointerleave:$[7]||($[7]=oe=>f(i).paneMouseLeave(oe))},[Qe(I.$slots,"default"),f(r)&&f(u)?(q(),ge(Lf,{key:0,"user-selection-rect":f(u)},null,8,["user-selection-rect"])):Me("",!0),f(c)&&f(p).length?(q(),ge(Ff,{key:1})):Me("",!0)],34))}}),Xf={name:"Transform",compatConfig:{MODE:3}},Wf=ue({...Xf,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=ke(),i=se(()=>n.value?!o.value:!1),r=se(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(q(),ae("div",{class:"vue-flow__transformationpane vue-flow__container",style:tt({transform:r.value,opacity:i.value?0:void 0})},[Qe(s.$slots,"default")],4))}}),Kf={name:"Viewport",compatConfig:{MODE:3}},Zf=ue({...Kf,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:u,panOnScrollMode:l,panOnScrollSpeed:c,panOnDrag:v,zoomOnDoubleClick:p,zoomOnPinch:m,zoomOnScroll:x,preventScrolling:g,noWheelClassName:_,noPanClassName:w,emits:d,connectionStartHandle:h,userSelectionActive:y,paneDragging:O,d3Zoom:R,d3Selection:B,d3ZoomHandler:U,viewport:W,viewportRef:Y,paneClickDistance:G}=ke();Rf(Y);const P=Z(!1),J=Z(!1);let E=null,A=!1,T=0,D={x:0,y:0,zoom:0};const V=jt(a),F=jt(s),j=jt(r),M=Ee(()=>(!F.value||F.value&&s.value===!0)&&(V.value||v.value)),z=Ee(()=>V.value||u.value),I=Ee(()=>F.value||s.value===!0&&M.value!==!0);Ye(()=>{if(!Y.value){Un("Viewport element is missing");return}const le=Y.value,de=le.getBoundingClientRect(),te=wd().clickDistance(G.value).scaleExtent([t.value,n.value]).translateExtent(i.value),re=We(le).call(te),fe=re.on("wheel.zoom"),C=Bt.translate(o.value.x??0,o.value.y??0).scale(Ct(o.value.zoom??1,t.value,n.value)),b=[[0,0],[de.width,de.height]],S=te.constrain()(C,b,i.value);te.transform(re,S),te.wheelDelta(oe),R.value=te,B.value=re,U.value=fe,W.value={x:S.x,y:S.y,zoom:S.k},te.on("start",k=>{var L;if(!k.sourceEvent)return null;T=k.sourceEvent.button,P.value=!0;const ne=he(k.transform);((L=k.sourceEvent)==null?void 0:L.type)==="mousedown"&&(O.value=!0),D=ne,d.viewportChangeStart(ne),d.moveStart({event:k,flowTransform:ne})}),te.on("end",k=>{if(!k.sourceEvent)return null;if(P.value=!1,O.value=!1,$(M.value,T??0)&&!A&&d.paneContextMenu(k.sourceEvent),A=!1,ve(D,k.transform)){const L=he(k.transform);D=L,d.viewportChangeEnd(L),d.moveEnd({event:k,flowTransform:L})}}),te.filter(k=>{var L,ne,ie;const ce=j.value||x.value,pe=m.value&&k.ctrlKey,we=k.button;if((M.value===!0||Array.isArray(M.value)&&M.value.includes(1))&&we===1&&k.type==="mousedown"&&((L=k.target)!=null&&L.closest(".vue-flow__node")||(ne=k.target)!=null&&ne.closest(".vue-flow__edge")))return!0;if(!M.value&&!ce&&!z.value&&!p.value&&!m.value||y.value||!p.value&&k.type==="dblclick"||me(k,_.value)&&k.type==="wheel"||me(k,w.value)&&(k.type!=="wheel"||z.value&&k.type==="wheel"&&!j.value)||!m.value&&k.ctrlKey&&k.type==="wheel"||!ce&&!z.value&&!pe&&k.type==="wheel")return!1;if(!m&&k.type==="touchstart"&&((ie=k.touches)==null?void 0:ie.length)>1)return k.preventDefault(),!1;if(!M.value&&(k.type==="mousedown"||k.type==="touchstart")||s.value===!0&&Array.isArray(v.value)&&v.value.includes(0)&&we===0||Array.isArray(M.value)&&!M.value.includes(we)&&(k.type==="mousedown"||k.type==="touchstart"))return!1;const be=Array.isArray(M.value)&&M.value.includes(we)||s.value===!0&&Array.isArray(M.value)&&!M.value.includes(0)||!we||we<=1;return(!k.ctrlKey||k.type==="wheel")&&be}),_e([y,M],()=>{y.value&&!P.value?te.on("zoom",null):y.value||te.on("zoom",k=>{W.value={x:k.transform.x,y:k.transform.y,zoom:k.transform.k};const L=he(k.transform);A=$(M.value,T??0),d.viewportChange(L),d.move({event:k,flowTransform:L})})},{immediate:!0}),_e([y,z,l,j,m,g,_],()=>{z.value&&!j.value&&!y.value?re.on("wheel.zoom",k=>{if(me(k,_.value))return!1;const L=j.value||x.value,ne=m.value&&k.ctrlKey;if(!(!g.value||z.value||L||ne))return!1;k.preventDefault(),k.stopImmediatePropagation();const ce=re.property("__zoom").k||1,pe=Tn();if(k.ctrlKey&&m.value&&pe){const Ht=je(k),ds=oe(k),fs=ce*2**ds;te.scaleTo(re,fs,Ht,k);return}const we=k.deltaMode===1?20:1;let be=l.value===qt.Vertical?0:k.deltaX*we,Ce=l.value===qt.Horizontal?0:k.deltaY*we;!pe&&k.shiftKey&&l.value!==qt.Vertical&&!be&&Ce&&(be=Ce,Ce=0),te.translateBy(re,-(be/ce)*c.value,-(Ce/ce)*c.value);const qe=he(re.property("__zoom"));E&&clearTimeout(E),J.value?(d.move({event:k,flowTransform:qe}),d.viewportChange(qe),E=setTimeout(()=>{d.moveEnd({event:k,flowTransform:qe}),d.viewportChangeEnd(qe),J.value=!1},150)):(J.value=!0,d.moveStart({event:k,flowTransform:qe}),d.viewportChangeStart(qe))},{passive:!1}):typeof fe<"u"&&re.on("wheel.zoom",function(k,L){const ne=!g.value&&k.type==="wheel"&&!k.ctrlKey,ie=j.value||x.value,ce=m.value&&k.ctrlKey;if(!ie&&!u.value&&!ce&&k.type==="wheel"||ne||me(k,_.value))return null;k.preventDefault(),fe.call(this,k,L)},{passive:!1})},{immediate:!0})});function $(le,de){return de===2&&Array.isArray(le)&&le.includes(2)}function oe(le){const de=le.ctrlKey&&Tn()?10:1;return-le.deltaY*(le.deltaMode===1?.05:le.deltaMode?1:.002)*de}function ve(le,de){return le.x!==de.x&&!Number.isNaN(de.x)||le.y!==de.y&&!Number.isNaN(de.y)||le.zoom!==de.k&&!Number.isNaN(de.k)}function he(le){return{x:le.x,y:le.y,zoom:le.k}}function me(le,de){return le.target.closest(`.${de}`)}return(le,de)=>(q(),ae("div",{ref_key:"viewportRef",ref:Y,class:"vue-flow__viewport vue-flow__container"},[N(Uf,{"is-selecting":I.value,"selection-key-pressed":f(F),class:Tt({connecting:!!f(h),dragging:f(O),draggable:f(v)===!0||Array.isArray(f(v))&&f(v).includes(0)})},{default:X(()=>[N(Wf,null,{default:X(()=>[Qe(le.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),qf=["id"],jf=["id"],Qf=["id"],Jf={name:"A11yDescriptions",compatConfig:{MODE:3}},eh=ue({...Jf,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=ke();return(i,r)=>(q(),ae(Fe,null,[H("div",{id:`${f(Mr)}-${f(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+K(f(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,qf),H("div",{id:`${f(Tr)}-${f(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,jf),f(n)?Me("",!0):(q(),ae("div",{key:0,id:`${f(Ed)}-${f(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},K(f(o)),9,Qf))],64))}});function th(){const e=ke();_e(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function nh(e,t,n){return n===Q.Left?e-t:n===Q.Right?e+t:e}function oh(e,t,n){return n===Q.Top?e-t:n===Q.Bottom?e+t:e}const Uo=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=Q.Top,type:i}){return xe("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:nh(t,e,o),cy:oh(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Uo.props=["radius","centerX","centerY","position","type"];Uo.compatConfig={MODE:3};const Li=Uo,ih=ue({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:u,removeSelectedEdges:l,findEdge:c,findNode:v,isValidConnection:p,multiSelectionActive:m,disableKeyboardA11y:x,elementsSelectable:g,edgesUpdatable:_,edgesFocusable:w,hooks:d}=ke(),h=se(()=>c(e.id)),{emit:y,on:O}=Zd(h.value,r),R=Lt(Xn),B=sn(),U=Z(!1),W=Z(!1),Y=Z(""),G=Z(null),P=Z("source"),J=Z(null),E=Ee(()=>typeof h.value.selectable>"u"?g.value:h.value.selectable),A=Ee(()=>typeof h.value.updatable>"u"?_.value:h.value.updatable),T=Ee(()=>typeof h.value.focusable>"u"?w.value:h.value.focusable);Dt(Xd,e.id),Dt(Wd,J);const D=se(()=>h.value.class instanceof Function?h.value.class(h.value):h.value.class),V=se(()=>h.value.style instanceof Function?h.value.style(h.value):h.value.style),F=se(()=>{const b=h.value.type||"default",S=R?.[`edge-${b}`];if(S)return S;let k=h.value.template??u.value[b];if(typeof k=="string"&&B){const L=Object.keys(B.appContext.components);L&&L.includes(b)&&(k=Wi(b,!1))}return k&&typeof k!="string"?k:(r.error(new Te(Ie.EDGE_TYPE_MISSING,k)),!1)}),{handlePointerDown:j}=Qr({nodeId:Y,handleId:G,type:P,isValidConnection:p,edgeUpdaterType:P,onEdgeUpdate:I,onEdgeUpdateEnd:$});return()=>{const b=v(h.value.source),S=v(h.value.target),k="pathOptions"in h.value?h.value.pathOptions:{};if(!b&&!S)return r.error(new Te(Ie.EDGE_SOURCE_TARGET_MISSING,h.value.id,h.value.source,h.value.target)),null;if(!b)return r.error(new Te(Ie.EDGE_SOURCE_MISSING,h.value.id,h.value.source)),null;if(!S)return r.error(new Te(Ie.EDGE_TARGET_MISSING,h.value.id,h.value.target)),null;if(!h.value||h.value.hidden||b.hidden||S.hidden)return null;let L;o.value===Et.Strict?L=b.handleBounds.source:L=[...b.handleBounds.source||[],...b.handleBounds.target||[]];const ne=Ni(L,h.value.sourceHandle);let ie;o.value===Et.Strict?ie=S.handleBounds.target:ie=[...S.handleBounds.target||[],...S.handleBounds.source||[]];const ce=Ni(ie,h.value.targetHandle),pe=ne?.position||Q.Bottom,we=ce?.position||Q.Top,{x:be,y:Ce}=Mn(b,ne,pe),{x:qe,y:Ht}=Mn(S,ce,we);return h.value.sourceX=be,h.value.sourceY=Ce,h.value.targetX=qe,h.value.targetY=Ht,xe("g",{ref:J,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${F.value===!1?"default":h.value.type||"default"}`,a.value,D.value,{updating:U.value,selected:h.value.selected,animated:h.value.animated,inactive:!E.value&&!d.value.edgeClick.hasListeners()}],onClick:ve,onContextmenu:he,onDblclick:me,onMouseenter:le,onMousemove:de,onMouseleave:te,onKeyDown:T.value?C:void 0,tabIndex:T.value?0:void 0,"aria-label":h.value.ariaLabel===null?void 0:h.value.ariaLabel||`Edge from ${h.value.source} to ${h.value.target}`,"aria-describedby":T.value?`${Tr}-${t}`:void 0,role:T.value?"button":"img"},[W.value?null:xe(F.value===!1?u.value.default:F.value,{id:e.id,sourceNode:b,targetNode:S,source:h.value.source,target:h.value.target,type:h.value.type,updatable:A.value,selected:h.value.selected,animated:h.value.animated,label:h.value.label,labelStyle:h.value.labelStyle,labelShowBg:h.value.labelShowBg,labelBgStyle:h.value.labelBgStyle,labelBgPadding:h.value.labelBgPadding,labelBgBorderRadius:h.value.labelBgBorderRadius,data:h.value.data,events:{...h.value.events,...O},style:V.value,markerStart:`url('#${rn(h.value.markerStart,t)}')`,markerEnd:`url('#${rn(h.value.markerEnd,t)}')`,sourcePosition:pe,targetPosition:we,sourceX:be,sourceY:Ce,targetX:qe,targetY:Ht,sourceHandleId:h.value.sourceHandle,targetHandleId:h.value.targetHandle,interactionWidth:h.value.interactionWidth,...k}),[A.value==="source"||A.value===!0?[xe("g",{onMousedown:re,onMouseenter:M,onMouseout:z},xe(Li,{position:pe,centerX:be,centerY:Ce,radius:i.value,type:"source","data-type":"source"}))]:null,A.value==="target"||A.value===!0?[xe("g",{onMousedown:fe,onMouseenter:M,onMouseout:z},xe(Li,{position:we,centerX:qe,centerY:Ht,radius:i.value,type:"target","data-type":"target"}))]:null]])};function M(){U.value=!0}function z(){U.value=!1}function I(b,S){y.update({event:b,edge:h.value,connection:S})}function $(b){y.updateEnd({event:b,edge:h.value}),W.value=!1}function oe(b,S){b.button===0&&(W.value=!0,Y.value=S?h.value.target:h.value.source,G.value=(S?h.value.targetHandle:h.value.sourceHandle)??"",P.value=S?"target":"source",y.updateStart({event:b,edge:h.value}),j(b))}function ve(b){var S;const k={event:b,edge:h.value};E.value&&(s.value=!1,h.value.selected&&m.value?(l([h.value]),(S=J.value)==null||S.blur()):n([h.value])),y.click(k)}function he(b){y.contextMenu({event:b,edge:h.value})}function me(b){y.doubleClick({event:b,edge:h.value})}function le(b){y.mouseEnter({event:b,edge:h.value})}function de(b){y.mouseMove({event:b,edge:h.value})}function te(b){y.mouseLeave({event:b,edge:h.value})}function re(b){oe(b,!0)}function fe(b){oe(b,!1)}function C(b){var S;!x.value&&Dr.includes(b.key)&&E.value&&(b.key==="Escape"?((S=J.value)==null||S.blur(),l([c(e.id)])):n([c(e.id)]))}}}),rh=ih,sh={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top},ah=ue({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:u,connectionStatus:l,viewport:c,findNode:v}=ke(),p=(e=Lt(Xn))==null?void 0:e["connection-line"],m=se(()=>{var d;return v((d=o.value)==null?void 0:d.nodeId)}),x=se(()=>{var d;return v((d=i.value)==null?void 0:d.nodeId)??null}),g=se(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),_=se(()=>u.value.markerStart?`url(#${rn(u.value.markerStart,t)})`:""),w=se(()=>u.value.markerEnd?`url(#${rn(u.value.markerEnd,t)})`:"");return()=>{var d,h,y,O;if(!m.value||!o.value)return null;const R=o.value.handleId,B=o.value.type,U=m.value.handleBounds;let W=U?.[B]||[];if(n.value===Et.Loose){const F=U?.[B==="source"?"target":"source"]||[];W=[...W,...F]}if(!W)return null;const Y=(R?W.find(F=>F.id===R):W[0])??null,G=Y?.position||Q.Top,{x:P,y:J}=Mn(m.value,Y,G);let E=null;x.value&&((d=i.value)!=null&&d.handleId)&&(n.value===Et.Strict?E=((h=x.value.handleBounds[B==="source"?"target":"source"])==null?void 0:h.find(F=>{var j;return F.id===((j=i.value)==null?void 0:j.handleId)}))||null:E=((y=[...x.value.handleBounds.source||[],...x.value.handleBounds.target||[]])==null?void 0:y.find(F=>{var j;return F.id===((j=i.value)==null?void 0:j.handleId)}))||null);const A=((O=i.value)==null?void 0:O.position)??(G?sh[G]:null);if(!G||!A)return null;const T=s.value??u.value.type??gt.Bezier;let D="";const V={sourceX:P,sourceY:J,sourcePosition:G,targetX:g.value.x,targetY:g.value.y,targetPosition:A};return T===gt.Bezier?[D]=is(V):T===gt.Step?[D]=Po({...V,borderRadius:0}):T===gt.SmoothStep?[D]=Po(V):T===gt.SimpleBezier?[D]=rs(V):D=`M${P},${J} ${g.value.x},${g.value.y}`,xe("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},xe("g",{class:"vue-flow__connection"},p?xe(p,{sourceX:P,sourceY:J,sourcePosition:G,targetX:g.value.x,targetY:g.value.y,targetPosition:A,sourceNode:m.value,sourceHandle:Y,targetNode:x.value,targetHandle:E,markerEnd:w.value,markerStart:_.value,connectionStatus:l.value}):xe("path",{d:D,class:[u.value.class,l,"vue-flow__connection-path"],style:{...a.value,...u.value.style},"marker-end":w.value,"marker-start":_.value})))}}}),lh=ah,uh=["id","markerWidth","markerHeight","markerUnits","orient"],ch={name:"MarkerType",compatConfig:{MODE:3}},dh=ue({...ch,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(q(),ae("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===f(So).ArrowClosed?(q(),ae("polyline",{key:0,style:tt({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Me("",!0),t.type===f(So).Arrow?(q(),ae("polyline",{key:1,style:tt({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Me("",!0)],8,uh))}}),fh={class:"vue-flow__marker vue-flow__container"},hh={name:"MarkerDefinitions",compatConfig:{MODE:3}},ph=ue({...hh,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=ke(),r=se(()=>{const s=new Set,a=[],u=l=>{if(l){const c=rn(l,t);s.has(c)||(typeof l=="object"?a.push({...l,id:c,color:l.color||i.value}):a.push({id:c,color:i.value,type:l}),s.add(c))}};for(const l of[o.value.markerEnd,o.value.markerStart])u(l);for(const l of n.value)for(const c of[l.markerStart,l.markerEnd])u(c);return a.sort((l,c)=>l.id.localeCompare(c.id))});return(s,a)=>(q(),ae("svg",fh,[H("defs",null,[(q(!0),ae(Fe,null,On(r.value,u=>(q(),ge(dh,{id:u.id,key:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,"stroke-width":u.strokeWidth,orient:u.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),vh={name:"Edges",compatConfig:{MODE:3}},mh=ue({...vh,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=ke();return(i,r)=>(q(),ae(Fe,null,[N(ph),(q(!0),ae(Fe,null,On(f(n),s=>(q(),ae("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:tt({zIndex:f(Bd)(s,f(t),f(o))})},[N(f(rh),{id:s.id},null,8,["id"])],4))),128)),N(f(lh))],64))}}),gh=ue({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:s,removeSelectedNodes:a,addSelectedNodes:u,updateNodeDimensions:l,onUpdateNodeInternals:c,getNodeTypes:v,nodeExtent:p,elevateNodesOnSelect:m,disableKeyboardA11y:x,ariaLiveMessage:g,snapToGrid:_,snapGrid:w,nodeDragThreshold:d,nodesDraggable:h,elementsSelectable:y,nodesConnectable:O,nodesFocusable:R,hooks:B}=ke(),U=Z(null);Dt(qr,U),Dt(Zr,e.id);const W=Lt(Xn),Y=sn(),G=es(),{node:P,parentNode:J}=Jr(e.id),{emit:E,on:A}=Jd(P,s),T=Ee(()=>typeof P.draggable>"u"?h.value:P.draggable),D=Ee(()=>typeof P.selectable>"u"?y.value:P.selectable),V=Ee(()=>typeof P.connectable>"u"?O.value:P.connectable),F=Ee(()=>typeof P.focusable>"u"?R.value:P.focusable),j=Ee(()=>D.value||T.value||B.value.nodeClick.hasListeners()||B.value.nodeDoubleClick.hasListeners()||B.value.nodeMouseEnter.hasListeners()||B.value.nodeMouseMove.hasListeners()||B.value.nodeMouseLeave.hasListeners()),M=Ee(()=>!!P.dimensions.width&&!!P.dimensions.height),z=se(()=>{const S=P.type||"default",k=W?.[`node-${S}`];if(k)return k;let L=P.template||v.value[S];if(typeof L=="string"&&Y){const ne=Object.keys(Y.appContext.components);ne&&ne.includes(S)&&(L=Wi(S,!1))}return L&&typeof L!="string"?L:(s.error(new Te(Ie.NODE_TYPE_MISSING,L)),!1)}),I=jr({id:e.id,el:U,disabled:()=>!T.value,selectable:D,dragHandle:()=>P.dragHandle,onStart(S){E.dragStart(S)},onDrag(S){E.drag(S)},onStop(S){E.dragStop(S)},onClick(S){C(S)}}),$=se(()=>P.class instanceof Function?P.class(P):P.class),oe=se(()=>{const S=(P.style instanceof Function?P.style(P):P.style)||{},k=P.width instanceof Function?P.width(P):P.width,L=P.height instanceof Function?P.height(P):P.height;return!S.width&&k&&(S.width=typeof k=="string"?k:`${k}px`),!S.height&&L&&(S.height=typeof L=="string"?L:`${L}px`),S}),ve=Ee(()=>Number(P.zIndex??oe.value.zIndex??0));return c(S=>{(S.includes(e.id)||!S.length)&&me()}),Ye(()=>{_e(()=>P.hidden,(S=!1,k,L)=>{!S&&U.value&&(e.resizeObserver.observe(U.value),L(()=>{U.value&&e.resizeObserver.unobserve(U.value)}))},{immediate:!0,flush:"post"})}),_e([()=>P.type,()=>P.sourcePosition,()=>P.targetPosition],()=>{Je(()=>{l([{id:e.id,nodeElement:U.value,forceUpdate:!0}])})}),_e([()=>P.position.x,()=>P.position.y,()=>{var S;return(S=J.value)==null?void 0:S.computedPosition.x},()=>{var S;return(S=J.value)==null?void 0:S.computedPosition.y},()=>{var S;return(S=J.value)==null?void 0:S.computedPosition.z},ve,()=>P.selected,()=>P.dimensions.height,()=>P.dimensions.width,()=>{var S;return(S=J.value)==null?void 0:S.dimensions.height},()=>{var S;return(S=J.value)==null?void 0:S.dimensions.width}],([S,k,L,ne,ie,ce])=>{const pe={x:S,y:k,z:ce+(m.value&&P.selected?1e3:0)};typeof L<"u"&&typeof ne<"u"?P.computedPosition=Td({x:L,y:ne,z:ie},pe):P.computedPosition=pe},{flush:"post",immediate:!0}),_e([()=>P.extent,p],([S,k],[L,ne])=>{(S!==L||k!==ne)&&he()}),P.extent==="parent"||typeof P.extent=="object"&&"range"in P.extent&&P.extent.range==="parent"?po(()=>M).toBe(!0).then(he):he(),()=>P.hidden?null:xe("div",{ref:U,"data-id":P.id,class:["vue-flow__node",`vue-flow__node-${z.value===!1?"default":P.type||"default"}`,{[n.value]:T.value,dragging:I?.value,draggable:T.value,selected:P.selected,selectable:D.value,parent:P.isParent},$.value],style:{visibility:M.value?"visible":"hidden",zIndex:P.computedPosition.z??ve.value,transform:`translate(${P.computedPosition.x}px,${P.computedPosition.y}px)`,pointerEvents:j.value?"all":"none",...oe.value},tabIndex:F.value?0:void 0,role:F.value?"button":void 0,"aria-describedby":x.value?void 0:`${Mr}-${t}`,"aria-label":P.ariaLabel,onMouseenter:le,onMousemove:de,onMouseleave:te,onContextmenu:re,onClick:C,onDblclick:fe,onKeydown:b},[xe(z.value===!1?v.value.default:z.value,{id:P.id,type:P.type,data:P.data,events:{...P.events,...A},selected:P.selected,resizing:P.resizing,dragging:I.value,connectable:V.value,position:P.computedPosition,dimensions:P.dimensions,isValidTargetPos:P.isValidTargetPos,isValidSourcePos:P.isValidSourcePos,parent:P.parentNode,parentNodeId:P.parentNode,zIndex:P.computedPosition.z??ve.value,targetPosition:P.targetPosition,sourcePosition:P.sourcePosition,label:P.label,dragHandle:P.dragHandle,onUpdateNodeInternals:me})]);function he(){const S=P.computedPosition,{computedPosition:k,position:L}=Fo(P,_.value?Gn(S,w.value):S,s.error,p.value,J.value);(P.computedPosition.x!==k.x||P.computedPosition.y!==k.y)&&(P.computedPosition={...P.computedPosition,...k}),(P.position.x!==L.x||P.position.y!==L.y)&&(P.position=L)}function me(){U.value&&l([{id:e.id,nodeElement:U.value,forceUpdate:!0}])}function le(S){I?.value||E.mouseEnter({event:S,node:P})}function de(S){I?.value||E.mouseMove({event:S,node:P})}function te(S){I?.value||E.mouseLeave({event:S,node:P})}function re(S){return E.contextMenu({event:S,node:P})}function fe(S){return E.doubleClick({event:S,node:P})}function C(S){D.value&&(!o.value||!T.value||d.value>0)&&ko(P,r.value,u,a,i,!1,U.value),E.click({event:S,node:P})}function b(S){if(!(Eo(S)||x.value))if(Dr.includes(S.key)&&D.value){const k=S.key==="Escape";ko(P,r.value,u,a,i,k,U.value)}else T.value&&P.selected&&Mt[S.key]&&(g.value=`Moved selected node ${S.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~P.position.x}, y: ${~~P.position.y}`,G({x:Mt[S.key].x,y:Mt[S.key].y},S.shiftKey))}}}),yh=gh;function _h(e={includeHiddenNodes:!1}){const{nodes:t}=ke();return se(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const wh={class:"vue-flow__nodes vue-flow__container"},xh={name:"Nodes",compatConfig:{MODE:3}},bh=ue({...xh,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=ke(),i=_h(),r=Z();return _e(i,s=>{s&&Je(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),Ye(()=>{r.value=new ResizeObserver(s=>{const a=s.map(u=>({id:u.target.getAttribute("data-id"),nodeElement:u.target,forceUpdate:!0}));Je(()=>n(a))})}),zn(()=>{var s;return(s=r.value)==null?void 0:s.disconnect()}),(s,a)=>(q(),ae("div",wh,[r.value?(q(!0),ae(Fe,{key:0},On(f(t),(u,l,c,v)=>{const p=[u.id];if(v&&v.key===u.id&&Ds(v,p))return v;const m=(q(),ge(f(yh),{id:u.id,key:u.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return m.memo=p,m},a,0),128)):Me("",!0)]))}});function Sh(){const{emits:e}=ke();Ye(()=>{if(Kr()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Te(Ie.MISSING_STYLES))}})}const Eh=H("div",{class:"vue-flow__edge-labels"},null,-1),Ch={name:"VueFlow",compatConfig:{MODE:3}},Nh=ue({...Ch,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,i=Is(),r=Qn(o,"modelValue",n),s=Qn(o,"nodes",n),a=Qn(o,"edges",n),u=ke(o),l=nf({modelValue:r,nodes:s,edges:a},o,u);return rf(n,u.hooks),th(),Sh(),Dt(Xn,i),Gi(()=>{l()}),t(u),(c,v)=>(q(),ae("div",{ref:f(u).vueFlowRef,class:"vue-flow"},[N(Zf,null,{default:X(()=>[N(mh),Eh,N(bh),Qe(c.$slots,"zoom-pane")]),_:3}),Qe(c.$slots,"default"),N(eh)],512))}});var at=(e=>(e.Lines="lines",e.Dots="dots",e))(at||{});const as=function({dimensions:e,size:t,color:n}){return xe("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},ls=function({radius:e,color:t}){return xe("circle",{cx:e,cy:e,r:e,fill:t})};at.Lines+"",at.Dots+"";const kh={[at.Dots]:"#81818a",[at.Lines]:"#eee"},Ph=["id","x","y","width","height","patternTransform"],$h={key:2,height:"100",width:"100"},Ih=["fill"],Mh=["x","y","fill"],Th={name:"Background",compatConfig:{MODE:3}},Dh=ue({...Th,props:{id:{},variant:{default:()=>at.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=ke(),o=se(()=>{const s=n.value.zoom,[a,u]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],l=[a*s||1,u*s||1],c=e.size*s,[v,p]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],m=[v*s||1+l[0]/2,p*s||1+l[1]/2];return{scaledGap:l,offset:m,size:c}}),i=Ee(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),r=Ee(()=>e.color||e.patternColor||kh[e.variant||at.Dots]);return(s,a)=>(q(),ae("svg",{class:"vue-flow__background vue-flow__container",style:tt({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[Qe(s.$slots,"pattern-container",{id:i.value},()=>[H("pattern",{id:i.value,x:f(n).x%o.value.scaledGap[0],y:f(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[Qe(s.$slots,"pattern",{},()=>[s.variant===f(at).Lines?(q(),ge(f(as),{key:0,size:s.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===f(at).Dots?(q(),ge(f(ls),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):Me("",!0),s.bgColor?(q(),ae("svg",$h,[H("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,Ih)])):Me("",!0)])],8,Ph)]),H("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,Mh),Qe(s.$slots,"default",{id:i.value})],4))}});function Oh({streamList:e}){const{t}=De(),n=[{title:t("routes.home.所属插件"),dataIndex:"pluginName"},{title:t("routes.home.流路径"),dataIndex:"path"},{title:t("routes.home.状态"),dataIndex:"state",customRender:({record:o})=>oa({state:o.state})},{title:t("routes.home.订阅数"),dataIndex:"subscribers",width:"70px"}];return e.length?N(Be,{dataSource:e,columns:n,size:"small",pagination:!1,bordered:!0,scroll:{y:200}},null):N(Vt,null,null)}function zh(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!an(e)}const Ah=/^(tcp|udp|quic|http)/;function Rh({pluginList:e}){const{t}=De(),n=[{title:t("routes.home.名称"),dataIndex:"name",width:"120px"},{title:t("routes.home.端口"),dataIndex:"port",width:"120px",customRender:({record:o})=>{const i=[];if(o.description)for(const r in o.description)Ah.test(r)&&i.push(N(Ki,{color:"blue"},{default:()=>[r,Ne(": "),o.description[r]]}));return i}},{title:t("routes.home.操作"),dataIndex:"action",width:"60px",align:"center",customRender:({record:o})=>{let i;return N(Se,{type:"link",onClick:()=>{Le.confirm({title:t("routes.home.确定重启",{name:o.name}),content:t("routes.home.开发中")})}},zh(i=t("routes.home.重启"))?i:{default:()=>[i]})}}];return e.length?N(Be,{dataSource:e,columns:n,size:"small",pagination:!1,bordered:!0,scroll:{y:200}},null):N(Vt,null,null)}function Bh({aliasList:e}){const{t}=De(),n=[{title:t("routes.home.别名流"),dataIndex:"streamPath"},{title:t("routes.home.别名名称"),dataIndex:"alias"},{title:t("routes.home.自动删除"),dataIndex:"autoRemove"},{title:t("routes.home.状态"),dataIndex:"status",customRender:({record:o})=>ia[o.status]}];return e.length?N(Be,{dataSource:e,columns:n,size:"small",pagination:!1,bordered:!0,scroll:{y:200}},null):N(Vt,null,null)}function us(e){return e.children&&e.children.length>0?e.children=e.children.map(us):delete e.children,e}function Lh(e){const t=[];function n(o){o.forEach(i=>{i.children&&i.children.length>0&&(t.push(String(i.id)),n(i.children))})}return n(e),t}function Vh({taskList:e}){const{t}=De(),n=[{title:t("routes.home.任务所有者"),dataIndex:"owner"},{title:t("routes.home.状态"),dataIndex:"state",width:100,customRender:({record:r})=>ra[r.state]},{title:t("routes.home.任务启动时间"),dataIndex:"startTime",width:100,customRender:({record:r})=>N(Ji,{value:r.startTime},null)}],o=Z([]);An(()=>{const r=Lh(e);o.value=r});const i=(r,s)=>{const a=String(s.id);if(r)o.value.includes(a)||o.value.push(a);else{const u=o.value.indexOf(a);u>-1&&o.value.splice(u,1)}};return e.length?N(Be,{dataSource:e,columns:n,size:"small",pagination:!1,bordered:!0,expandedRowKeys:o.value,onExpand:i,childrenColumnName:"children",indentSize:20,rowKey:r=>String(r.id),scroll:{y:200}},null):N(Vt,null,null)}function Hh(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!an(e)}function Fh({logList:e}){const{t}=De();function n(i){ta(i).then(r=>{Le.info({title:t("routes.home.查看日志"),width:"1024px",okText:t("routes.home.关闭"),content:N("pre",{class:"w-100% h-600px overflow-auto"},[r])})})}const o=[{title:t("routes.home.文件名"),dataIndex:"name"},{title:t("routes.home.文件大小"),dataIndex:"size",width:100,customRender:({record:i})=>sa(i.size)},{title:t("routes.home.操作"),dataIndex:"action",width:70,customRender:({record:i})=>{let r;return N(Se,{type:"link",onClick:()=>n(i.name)},Hh(r=t("routes.home.查看"))?r:{default:()=>[r]})}}];return e.length?N(Be,{columns:o,dataSource:e,size:"small",pagination:!1,bordered:!0,scroll:{y:200}},null):N(Vt,null,null)}function Yh({transformList:e}){const{t}=De(),n=[{title:t("routes.home.转换插件"),dataIndex:"pluginName"},{title:t("routes.home.别名流"),dataIndex:"streamPath"},{title:t("routes.home.转换目标"),dataIndex:"target"},{title:t("routes.home.转换配置"),dataIndex:"config"}];return e.length?N(Be,{dataSource:e,columns:n,size:"small",pagination:!1,bordered:!0,scroll:{y:200}},null):N(Vt,null,null)}const Gh={style:{position:"relative"}},Uh={class:"version-tag"},Xh={class:"flex-center"},Wh={class:"overview-content"},Kh={class:"info-grid"},Zh={class:"info-card"},qh={class:"info-header"},jh={class:"info-title"},Qh={class:"info-body"},Jh={class:"info-item"},ep={class:"label"},tp={class:"info-item"},np={class:"label"},op={class:"value-tag processing"},ip={class:"info-item"},rp={class:"label"},sp={class:"value-tag processing"},ap={class:"detail-row"},lp={class:"detail-item"},up={class:"detail-label"},cp={class:"value-tag default"},dp={class:"detail-item"},fp={class:"detail-label"},hp={class:"value-tag default"},pp={class:"info-card"},vp={class:"info-header"},mp={class:"info-title"},gp={class:"info-body"},yp={class:"resource-section"},_p={class:"resource-title"},wp={class:"resource-details"},xp={class:"resource-item"},bp={class:"resource-label"},Sp={class:"value-tag default"},Ep={class:"resource-item"},Cp={class:"resource-label"},Np={class:"value-tag success"},kp={class:"resource-section"},Pp={class:"resource-title"},$p={class:"resource-details"},Ip={class:"resource-item"},Mp={class:"resource-label"},Tp={class:"value-tag default"},Dp={class:"resource-item"},Op={class:"resource-label"},zp={class:"value-tag success"},Ap={class:"info-card"},Rp={class:"info-header"},Bp={class:"info-title"},Lp={class:"info-body"},Vp={class:"resource-section"},Hp={class:"resource-title"},Fp={class:"network-stats-compact"},Yp={class:"network-item-compact"},Gp={class:"network-label-compact"},Up={class:"value-tag error"},Xp={class:"network-item-compact"},Wp={class:"network-label-compact"},Kp={class:"value-tag success"},Zp={class:"flex-center gap-2px"},qp={class:"flex-center gap-2px"},jp={class:"flex-center gap-2px"},Qp={class:"flex-center gap-2px"},Jp={class:"flex-center gap-2px"},ev={class:"flex-center gap-2px"},tv={key:1},nv=ue({name:"Instance"}),ov=ue({...nv,props:{data:{}},setup(e){const{t}=De(),n=Rn(),{summary:o,online:i,sysInfo:r}=Ot(n),s=Z([]),a=Z([]),u=Z([]),l=Z([]),c=Z([]),v=n.pluginActive("LogRotate");function p(){co().then(D=>{s.value=D})}function m(){Vs().then(D=>{a.value=D})}function x(){Hs().then(D=>{c.value=D})}function g(){Fs().then(D=>{u.value=[D].map(us)})}function _(){na().then(D=>{l.value=D})}const w={3:{...it(p),active(){i.value?(p(),this.resume()):this.pause()}},4:{...it(x),active(){i.value?(x(),this.resume()):this.pause()}},5:{...it(m),active(){i.value?(m(),this.resume()):this.pause()}},6:{...it(g),active(){i.value?(g(),this.resume()):this.pause()}},7:{...it(_),active(){v.value&&i.value?(_(),this.resume()):this.pause()}}},d=Zi(),h=e,y=Z(),O=Z(),R=Z(0),B=Z(0),U=Z("1");_e(U,(D,V)=>{w[V]?.pause(),w[D]?.active()}),_e(i,D=>{if(D)w[U.value]?.active();else for(const V in w)w[V]?.pause()}),An(()=>{(!v.value||!i.value)&&w[7]?.pause()});function W(){Le.confirm({title:t("routes.home.热重启"),content:t("routes.home.确定要热重启吗"),okText:t("routes.home.确定"),cancelText:t("routes.home.取消"),onOk:()=>Gs()})}const Y=n.registerSummaryCallback(D=>{y.value?.handleUpdate(D?.memory?.usage||0),O.value?.handleUpdate(D?.cpuUsage||0),R.value=D?.netWork?.reduce((V,F)=>V+Number(F.sentSpeed||0),0)||0,B.value=D?.netWork?.reduce((V,F)=>V+Number(F.receiveSpeed||0),0)||0});zn(()=>{Y();for(const D in w)w[D]?.pause()});function G(){v.value?h.data.onShowLogTrail():Xe.error(t("routes.home.需要启用Logrotate插件"))}async function P(){try{let V=await Us();Le.confirm({title:t("routes.home.编辑配置文件"),width:800,style:{top:"20px"},content:()=>N("div",{style:"height: 600px"},[N(aa,{value:V,onChange:F=>V=F,language:"yaml",options:{minimap:{enabled:!1},lineNumbers:"on",automaticLayout:!0}},null)]),onOk:async()=>{try{la.parse(V),await Xs(V),Xe.success(t("routes.home.保存成功"))}catch(F){return Promise.reject(t("routes.home.配置文件格式错误")+":"+F.message)}}})}catch(D){Xe.error(t("routes.home.获取配置文件失败")+":"+D.message)}}function J(){h.data.onShowDebugChart()}function E(D){return D>=1024?`${(D/1024).toFixed(1)}GB`:`${D}MB`}function A(D){return D>=1024?`${(D/1024).toFixed(1)}TB`:`${D}GB`}function T(D){return D>=1024*1024*1024?`${(D/(1024*1024*1024)).toFixed(1)}GB/s`:D>=1024*1024?`${(D/(1024*1024)).toFixed(1)}MB/s`:D>=1024?`${(D/1024).toFixed(1)}KB/s`:`${D}B/s`}return(D,V)=>(q(),ae("div",Gh,[N(f($e),{type:"target",position:f(Q).Top,id:"upstream"},null,8,["position"]),N(f($e),{type:"source",position:f(Q).Bottom,id:"downstream"},null,8,["position"]),N(f($e),{type:"target",position:f(Q).Left,id:"target-pull",style:{top:"20%",bottom:"auto"}},null,8,["position"]),N(f($e),{type:"target",position:f(Q).Left,id:"target-push",style:{top:"50%",bottom:"auto"}},null,8,["position"]),N(f($e),{type:"target",position:f(Q).Left,id:"target-read",style:{top:"80%",bottom:"auto"}},null,8,["position"]),N(f($e),{type:"source",position:f(Q).Right,id:"source-push",style:{top:"20%",bottom:"auto"}},null,8,["position"]),N(f($e),{type:"source",position:f(Q).Right,id:"source-play",style:{top:"50%",bottom:"auto"}},null,8,["position"]),N(f($e),{type:"source",position:f(Q).Right,id:"source-read",style:{top:"80%",bottom:"auto"}},null,8,["position"]),f(n).online?(q(),ge(f(Ve),{key:0,size:"small",class:"w-500px drop-shadow-xl","body-style":{paddingBottom:0,paddingTop:0}},{title:X(()=>[V[2]||(V[2]=H("span",null,"SagooMedia ",-1)),H("span",Uh,K(f(r).version),1),H("span",null,K(f(r).localIP),1)]),extra:X(()=>[N(f(Se),{type:"link",onClick:V[0]||(V[0]=F=>f(d)("Overview"))},{default:X(()=>[Ne(K(f(t)("routes.home.查看详情")),1)]),_:1})]),actions:X(()=>[N(f(Se),{type:"link",onClick:J,size:"small"},{default:X(()=>[Ne(K(f(t)("routes.home.性能观测")),1)]),_:1}),N(f(Se),{type:"link",onClick:P,size:"small"},{default:X(()=>[Ne(K(f(t)("routes.home.配置")),1)]),_:1}),N(f(Se),{type:"link",onClick:G,size:"small"},{default:X(()=>[Ne(K(f(t)("routes.home.日志跟踪")),1)]),_:1}),N(f(Se),{type:"link",onClick:W,size:"small"},{default:X(()=>[Ne(K(f(t)("routes.home.热重启")),1)]),_:1})]),default:X(()=>[N(f(Ys),{activeKey:U.value,"onUpdate:activeKey":V[1]||(V[1]=F=>U.value=F),size:"small",animated:"","tab-bar-gutter":10,"tab-bar-style":{marginBottom:"2px"}},{default:X(()=>[N(f(mt),{key:"1"},{tab:X(()=>[H("div",Xh,[N(f(Ge),{icon:"dashicons:dashboard",width:"20",height:"20"}),H("span",null,K(f(t)("routes.home.概览")),1)])]),default:X(()=>[H("div",Wh,[H("div",Kh,[H("div",Zh,[H("div",qh,[N(f(Ge),{icon:"material-symbols:schedule",class:"info-icon"}),H("span",jh,K(f(t)("routes.home.系统信息")),1)]),H("div",Qh,[H("div",Jh,[H("span",ep,K(f(t)("routes.home.启动时间"))+":",1),N(f(Ji),{value:f(r).startTime,class:"text-primary font-medium"},null,8,["value"])]),H("div",tp,[H("span",np,K(f(t)("routes.home.Go版本"))+":",1),H("span",op,K(f(r).goVersion),1)]),H("div",ip,[H("span",rp,K(f(t)("routes.home.系统"))+":",1),H("span",sp,K(f(r).os),1)]),H("div",ap,[H("span",lp,[H("span",up,K(f(t)("routes.home.CPU"))+":",1),H("span",cp,K(f(r).cpus)+K(f(t)("routes.home.核")),1)]),H("span",dp,[H("span",fp,K(f(t)("routes.home.架构"))+":",1),H("span",hp,K(f(r).arch),1)])])])]),H("div",pp,[H("div",vp,[N(f(Ge),{icon:"material-symbols:storage",class:"info-icon"}),H("span",mp,K(f(t)("routes.home.存储内存")),1)]),H("div",gp,[H("div",yp,[H("div",_p,K(f(t)("routes.home.磁盘"))+" "+K(f(o).hardDisk?.usage.toFixed(1)||0)+"% ",1),H("div",wp,[H("span",xp,[H("span",bp,K(f(t)("routes.home.总计"))+":",1),H("span",Sp,K(A(f(o).hardDisk?.total||0)),1)]),H("span",Ep,[H("span",Cp,K(f(t)("routes.home.可用"))+":",1),H("span",Np,K(A(f(o).hardDisk?.free||0)),1)])])]),H("div",kp,[H("div",Pp,K(f(t)("routes.home.内存"))+" "+K(f(o).memory?.usage.toFixed(1)||0)+"% ",1),H("div",$p,[H("span",Ip,[H("span",Mp,K(f(t)("routes.home.总计"))+":",1),H("span",Tp,K(E(f(o).memory?.total||0)),1)]),H("span",Dp,[H("span",Op,K(f(t)("routes.home.可用"))+":",1),H("span",zp,K(E(f(o).memory?.free||0)),1)])])])])]),H("div",Ap,[H("div",Rp,[N(f(Ge),{icon:"material-symbols:network-wifi",class:"info-icon"}),H("span",Bp,K(f(t)("routes.home.网络性能")),1)]),H("div",Lp,[H("div",Vp,[H("div",Hp," CPU "+K(f(o).cpuUsage?.toFixed(1)||0)+"% ",1),H("div",Fp,[H("div",Yp,[H("span",Gp,K(f(t)("routes.home.上传"))+":",1),H("span",Up,K(T(R.value)),1)]),H("div",Xp,[H("span",Wp,K(f(t)("routes.home.下载"))+":",1),H("span",Kp,K(T(B.value)),1)])])])])])])])]),_:1}),N(f(mt),{key:"2"},{tab:X(()=>[H("div",Zp,[N(f(Ge),{icon:"mingcute:plugin-line",width:"24",height:"24"}),H("span",null,K(f(t)("routes.home.插件")),1)])]),default:X(()=>[N(f(Rh),{pluginList:f(r).plugins},null,8,["pluginList"])]),_:1}),N(f(mt),{key:"3"},{tab:X(()=>[H("div",qp,[N(f(Ge),{icon:"ri:live-line",width:"24",height:"24"}),H("span",null,K(f(t)("routes.home.流")),1)])]),default:X(()=>[N(f(Oh),{streamList:s.value},null,8,["streamList"])]),_:1}),N(f(mt),{key:"4"},{tab:X(()=>[H("div",jp,[N(f(Ge),{icon:"carbon:transform-binary",width:"24",height:"24"}),H("span",null,K(f(t)("routes.home.转换")),1)])]),default:X(()=>[N(f(Yh),{transformList:c.value},null,8,["transformList"])]),_:1}),N(f(mt),{key:"5"},{tab:X(()=>[H("div",Qp,[N(f(Ge),{icon:"oui:token-alias",width:"24",height:"24"}),H("span",null,K(f(t)("routes.home.别名")),1)])]),default:X(()=>[N(f(Bh),{aliasList:a.value},null,8,["aliasList"])]),_:1}),N(f(mt),{key:"6"},{tab:X(()=>[H("div",Jp,[N(f(Ge),{icon:"iconoir:task-list",width:"24",height:"24"}),H("span",null,K(f(t)("routes.home.任务")),1)])]),default:X(()=>[N(f(Vh),{taskList:u.value},null,8,["taskList"])]),_:1}),N(f(mt),{key:"7"},{tab:X(()=>[H("div",ev,[N(f(Ge),{icon:"ix:log",width:"24",height:"24"}),H("span",null,K(f(t)("routes.home.日志")),1)])]),default:X(()=>[f(v)?(q(),ge(f(Fh),{key:0,logList:l.value},null,8,["logList"])):(q(),ae("div",tv,K(f(t)("routes.home.需要启用Logrotate插件")),1))]),_:1})]),_:1},8,["activeKey"])]),_:1})):(q(),ge(f(Ve),{key:1},{default:X(()=>[N(f(Ge),{icon:"mingcute:plugin-line",width:"24",height:"24"}),H("span",null,K(f(t)("routes.home.Monibuca离线")),1)]),_:1}))]))}});const iv=Ws(ov,[["__scopeId","data-v-d5223979"]]),rv={key:1,class:"text-12px"},sv=ue({name:"Device"}),av=ue({...sv,setup(e){const{t}=De(),{pause:n,resume:o}=it(s),i=Z([]),r=Z([{title:t("routes.home.名称"),dataIndex:"name"},{title:t("routes.home.状态"),dataIndex:"status",customRender:({record:a})=>da(a.status)}]);function s(){return ua().then(a=>{i.value=a}).catch(a=>{console.error(`stream-proxy-getList-error: ${a}`)})}return s(),(a,u)=>(q(),ge(f(Ve),{size:"small",class:"w-250px drop-shadow-xl"},{title:X(()=>[H("span",null,K(f(t)("routes.home.远端服务器或设备")),1),i.value.length?(q(),ge(f(Nt),{key:0,title:f(t)("routes.home.帮助"),content:f(t)("routes.home.设备节点用于配置拉流代理")},{default:X(()=>[N(f(Se),{type:"link",size:"small"},{default:X(()=>[N(f(ut),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):Me("",!0)]),extra:X(()=>[N(f(Se),{type:"link",onClick:u[0]||(u[0]=l=>f(fa)({updateList:s,pause:f(n),resume:f(o)}))},{default:X(()=>[Ne(K(f(t)("routes.home.添加")),1)]),_:1})]),default:X(()=>[N(f($e),{type:"source",position:f(Q).Right},null,8,["position"]),i.value.length?(q(),ge(f(Be),{key:0,"data-source":i.value,columns:r.value,size:"small",pagination:!1,bordered:""},null,8,["data-source","columns"])):(q(),ae("span",rv,K(f(t)("routes.home.拉流代理功能说明")),1))]),_:1}))}});var $o={},lv={get exports(){return $o},set exports(e){$o=e}};function uv(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Dn={},cv={get exports(){return Dn},set exports(e){Dn=e}},Vi;function dv(){return Vi||(Vi=1,function(e,t){(function(n,o){e.exports=o()})(Xt,function(){var n=n||function(o,i){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof Xt<"u"&&Xt.crypto&&(r=Xt.crypto),!r&&typeof uv=="function")try{r=Ks}catch{}var s=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function d(){}return function(h){var y;return d.prototype=h,y=new d,d.prototype=null,y}}(),u={},l=u.lib={},c=l.Base=function(){return{extend:function(d){var h=a(this);return d&&h.mixIn(d),(!h.hasOwnProperty("init")||this.init===h.init)&&(h.init=function(){h.$super.init.apply(this,arguments)}),h.init.prototype=h,h.$super=this,h},create:function(){var d=this.extend();return d.init.apply(d,arguments),d},init:function(){},mixIn:function(d){for(var h in d)d.hasOwnProperty(h)&&(this[h]=d[h]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),v=l.WordArray=c.extend({init:function(d,h){d=this.words=d||[],h!=i?this.sigBytes=h:this.sigBytes=d.length*4},toString:function(d){return(d||m).stringify(this)},concat:function(d){var h=this.words,y=d.words,O=this.sigBytes,R=d.sigBytes;if(this.clamp(),O%4)for(var B=0;B<R;B++){var U=y[B>>>2]>>>24-B%4*8&255;h[O+B>>>2]|=U<<24-(O+B)%4*8}else for(var W=0;W<R;W+=4)h[O+W>>>2]=y[W>>>2];return this.sigBytes+=R,this},clamp:function(){var d=this.words,h=this.sigBytes;d[h>>>2]&=4294967295<<32-h%4*8,d.length=o.ceil(h/4)},clone:function(){var d=c.clone.call(this);return d.words=this.words.slice(0),d},random:function(d){for(var h=[],y=0;y<d;y+=4)h.push(s());return new v.init(h,d)}}),p=u.enc={},m=p.Hex={stringify:function(d){for(var h=d.words,y=d.sigBytes,O=[],R=0;R<y;R++){var B=h[R>>>2]>>>24-R%4*8&255;O.push((B>>>4).toString(16)),O.push((B&15).toString(16))}return O.join("")},parse:function(d){for(var h=d.length,y=[],O=0;O<h;O+=2)y[O>>>3]|=parseInt(d.substr(O,2),16)<<24-O%8*4;return new v.init(y,h/2)}},x=p.Latin1={stringify:function(d){for(var h=d.words,y=d.sigBytes,O=[],R=0;R<y;R++){var B=h[R>>>2]>>>24-R%4*8&255;O.push(String.fromCharCode(B))}return O.join("")},parse:function(d){for(var h=d.length,y=[],O=0;O<h;O++)y[O>>>2]|=(d.charCodeAt(O)&255)<<24-O%4*8;return new v.init(y,h)}},g=p.Utf8={stringify:function(d){try{return decodeURIComponent(escape(x.stringify(d)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(d){return x.parse(unescape(encodeURIComponent(d)))}},_=l.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new v.init,this._nDataBytes=0},_append:function(d){typeof d=="string"&&(d=g.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},_process:function(d){var h,y=this._data,O=y.words,R=y.sigBytes,B=this.blockSize,U=B*4,W=R/U;d?W=o.ceil(W):W=o.max((W|0)-this._minBufferSize,0);var Y=W*B,G=o.min(Y*4,R);if(Y){for(var P=0;P<Y;P+=B)this._doProcessBlock(O,P);h=O.splice(0,Y),y.sigBytes-=G}return new v.init(h,G)},clone:function(){var d=c.clone.call(this);return d._data=this._data.clone(),d},_minBufferSize:0});l.Hasher=_.extend({cfg:c.extend(),init:function(d){this.cfg=this.cfg.extend(d),this.reset()},reset:function(){_.reset.call(this),this._doReset()},update:function(d){return this._append(d),this._process(),this},finalize:function(d){d&&this._append(d);var h=this._doFinalize();return h},blockSize:16,_createHelper:function(d){return function(h,y){return new d.init(y).finalize(h)}},_createHmacHelper:function(d){return function(h,y){return new w.HMAC.init(d,y).finalize(h)}}});var w=u.algo={};return u}(Math);return n})}(cv)),Dn}(function(e,t){(function(n,o){e.exports=o(dv())})(Xt,function(n){return function(o){var i=n,r=i.lib,s=r.WordArray,a=r.Hasher,u=i.algo,l=[];(function(){for(var g=0;g<64;g++)l[g]=o.abs(o.sin(g+1))*4294967296|0})();var c=u.MD5=a.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(g,_){for(var w=0;w<16;w++){var d=_+w,h=g[d];g[d]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360}var y=this._hash.words,O=g[_+0],R=g[_+1],B=g[_+2],U=g[_+3],W=g[_+4],Y=g[_+5],G=g[_+6],P=g[_+7],J=g[_+8],E=g[_+9],A=g[_+10],T=g[_+11],D=g[_+12],V=g[_+13],F=g[_+14],j=g[_+15],M=y[0],z=y[1],I=y[2],$=y[3];M=v(M,z,I,$,O,7,l[0]),$=v($,M,z,I,R,12,l[1]),I=v(I,$,M,z,B,17,l[2]),z=v(z,I,$,M,U,22,l[3]),M=v(M,z,I,$,W,7,l[4]),$=v($,M,z,I,Y,12,l[5]),I=v(I,$,M,z,G,17,l[6]),z=v(z,I,$,M,P,22,l[7]),M=v(M,z,I,$,J,7,l[8]),$=v($,M,z,I,E,12,l[9]),I=v(I,$,M,z,A,17,l[10]),z=v(z,I,$,M,T,22,l[11]),M=v(M,z,I,$,D,7,l[12]),$=v($,M,z,I,V,12,l[13]),I=v(I,$,M,z,F,17,l[14]),z=v(z,I,$,M,j,22,l[15]),M=p(M,z,I,$,R,5,l[16]),$=p($,M,z,I,G,9,l[17]),I=p(I,$,M,z,T,14,l[18]),z=p(z,I,$,M,O,20,l[19]),M=p(M,z,I,$,Y,5,l[20]),$=p($,M,z,I,A,9,l[21]),I=p(I,$,M,z,j,14,l[22]),z=p(z,I,$,M,W,20,l[23]),M=p(M,z,I,$,E,5,l[24]),$=p($,M,z,I,F,9,l[25]),I=p(I,$,M,z,U,14,l[26]),z=p(z,I,$,M,J,20,l[27]),M=p(M,z,I,$,V,5,l[28]),$=p($,M,z,I,B,9,l[29]),I=p(I,$,M,z,P,14,l[30]),z=p(z,I,$,M,D,20,l[31]),M=m(M,z,I,$,Y,4,l[32]),$=m($,M,z,I,J,11,l[33]),I=m(I,$,M,z,T,16,l[34]),z=m(z,I,$,M,F,23,l[35]),M=m(M,z,I,$,R,4,l[36]),$=m($,M,z,I,W,11,l[37]),I=m(I,$,M,z,P,16,l[38]),z=m(z,I,$,M,A,23,l[39]),M=m(M,z,I,$,V,4,l[40]),$=m($,M,z,I,O,11,l[41]),I=m(I,$,M,z,U,16,l[42]),z=m(z,I,$,M,G,23,l[43]),M=m(M,z,I,$,E,4,l[44]),$=m($,M,z,I,D,11,l[45]),I=m(I,$,M,z,j,16,l[46]),z=m(z,I,$,M,B,23,l[47]),M=x(M,z,I,$,O,6,l[48]),$=x($,M,z,I,P,10,l[49]),I=x(I,$,M,z,F,15,l[50]),z=x(z,I,$,M,Y,21,l[51]),M=x(M,z,I,$,D,6,l[52]),$=x($,M,z,I,U,10,l[53]),I=x(I,$,M,z,A,15,l[54]),z=x(z,I,$,M,R,21,l[55]),M=x(M,z,I,$,J,6,l[56]),$=x($,M,z,I,j,10,l[57]),I=x(I,$,M,z,G,15,l[58]),z=x(z,I,$,M,V,21,l[59]),M=x(M,z,I,$,W,6,l[60]),$=x($,M,z,I,T,10,l[61]),I=x(I,$,M,z,B,15,l[62]),z=x(z,I,$,M,E,21,l[63]),y[0]=y[0]+M|0,y[1]=y[1]+z|0,y[2]=y[2]+I|0,y[3]=y[3]+$|0},_doFinalize:function(){var g=this._data,_=g.words,w=this._nDataBytes*8,d=g.sigBytes*8;_[d>>>5]|=128<<24-d%32;var h=o.floor(w/4294967296),y=w;_[(d+64>>>9<<4)+15]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,_[(d+64>>>9<<4)+14]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,g.sigBytes=(_.length+1)*4,this._process();for(var O=this._hash,R=O.words,B=0;B<4;B++){var U=R[B];R[B]=(U<<8|U>>>24)&16711935|(U<<24|U>>>8)&4278255360}return O},clone:function(){var g=a.clone.call(this);return g._hash=this._hash.clone(),g}});function v(g,_,w,d,h,y,O){var R=g+(_&w|~_&d)+h+O;return(R<<y|R>>>32-y)+_}function p(g,_,w,d,h,y,O){var R=g+(_&d|w&~d)+h+O;return(R<<y|R>>>32-y)+_}function m(g,_,w,d,h,y,O){var R=g+(_^w^d)+h+O;return(R<<y|R>>>32-y)+_}function x(g,_,w,d,h,y,O){var R=g+(w^(_|~d))+h+O;return(R<<y|R>>>32-y)+_}i.MD5=a._createHelper(c),i.HmacMD5=a._createHmacHelper(c)}(Math),n.MD5})})(lv);const cs=$o,fv=["srcObject"],hv={key:1,class:"text-12px"},pv={class:"flex items-center justify-between pl-10px pr-10px"};function lo(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!an(e)}const vv=ue({name:"Pusher"}),mv=ue({...vv,props:{data:{}},setup(e){const{t}=De(),n=Z(!1),o=Z(!1),i=Rn(),r=Z(""),s=Z("live/test"),a=e,{plugins:u,sysInfo:l}=Ot(i),c=i.pluginActive("WebRTC");async function v(){try{return(await navigator.mediaDevices.enumerateDevices()).filter(d=>d.kind==="videoinput").map(d=>({label:d.label||`Camera ${d.deviceId.slice(0,10)}...`,value:d.deviceId,key:d.deviceId}))}catch(w){return console.error(t("routes.home.获取摄像头列表失败"),w),Xe.error(t("routes.home.获取摄像头列表失败")),[]}}let p;const m=Z(null);async function x(w){o.value=!0;const d=m.value=w,h=new RTCPeerConnection;p=()=>{h.close(),d?.getTracks().forEach(B=>{B.stop()}),m.value=null},h.oniceconnectionstatechange=()=>{Ut.info({message:"oniceconnectionstatechange",description:JSON.stringify(h.iceConnectionState)})},h.onicecandidate=B=>{Ut.info({message:"onicecandidate",description:JSON.stringify(B.candidate)})},d.getTracks().forEach(B=>{h.addTrack(B,d)});const y=await h.createOffer();await h.setLocalDescription(y),Ut.info({message:"createOffer",description:()=>N("div",{class:"h-200px overflow-auto"},[y.sdp])});const O=await fetch(`${bt("webrtc","/push")}/${s.value}`,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",redirect:"follow",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/sdp"},body:y.sdp}),R=await O.text();if(O.status>=300)throw`${O.status} ${O.statusText}: ${R}`;Ut.success({message:"推流成功",description:R||""}),await h.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:R}))}An(()=>{n.value?c.value?_():(Xe.error(t("routes.home.请先启用WebRTC插件")),n.value=!1):p?.(),a.data.onPush(n.value)});async function g(){const w=Z({useLocalIP:"localhost",secretKey:"",expireTime:ze().add(1,"hour")});Le.info({title:t("routes.home.推流地址"),width:800,content:()=>{let d,h,y;const O=B=>{if(!w.value.secretKey||!w.value.expireTime)return"";const U=Math.floor(w.value.expireTime.unix()).toString(16),W=cs(w.value.secretKey+s.value+U).toString();return(B.includes("?")?"&":"?")+`secret=${W}&expire=${U}`},R=[];for(const B of u.value){const U=B.pushAddr;if(U)for(const W of U){const Y=W.replace("{hostName}",w.value.useLocalIP).replace("{streamPath}",s.value);R.push({protocol:W.startsWith("http")?B.name.toLocaleLowerCase():W.split(":")[0],path:Y+O(Y)})}}return R.length?[N(fo,{value:w.value.useLocalIP,onChange:B=>w.value.useLocalIP=B.target.value},{default:()=>[N(Pt,{value:"localhost"},lo(d=t("routes.home.使用localhost"))?d:{default:()=>[d]}),N(Pt,{value:l.value.publicIP},lo(h=t("routes.home.使用公网IP"))?h:{default:()=>[h]}),N(Pt,{value:l.value.localIP},lo(y=t("routes.home.使用内网IP"))?y:{default:()=>[y]})]}),N(Ae,{layout:"inline"},{default:()=>[N(Ae.Item,null,{default:()=>[N("span",null,[t("routes.home.秘钥"),N(Io,{title:t("routes.home.需要匹配配置文件中publish下的key配置")},{default:()=>[N(ut,{style:"margin-left: 4px"},null)]})]),N(Sn,{type:"text",placeholder:t("routes.home.请输入秘钥"),class:"w-250px",style:"margin-bottom: 10px",value:w.value.secretKey,onChange:B=>w.value.secretKey=B.target.value},null)]}),N(Ae.Item,{label:t("routes.home.过期时间")},{default:()=>[N(qi,{placeholder:t("routes.home.选择过期时间"),showTime:!0,class:"w-250px",style:"margin-bottom: 10px",value:w.value.expireTime,onChange:B=>w.value.expireTime=B},null)]})]}),N(Be,{dataSource:R,columns:[{title:t("routes.home.协议"),dataIndex:"protocol"},{title:t("routes.home.推流地址"),dataIndex:"path"}],pagination:!1,size:"small"},null)]:N("span",null,[t("routes.home.请先启用一些插件")])}})}function _(){navigator.mediaDevices.getUserMedia({video:!0}).then(async w=>{w.getTracks().forEach(h=>{h.stop()});const d=await v();r.value||(r.value=d[0]?.value||""),r.value&&(w=await navigator.mediaDevices.getUserMedia({video:{deviceId:r.value}})),Le.confirm({title:t("routes.home.选择摄像头"),content:()=>N("div",null,[N(zt,{value:r.value,onChange:async h=>{w.getTracks().forEach(y=>{y.stop()}),w=await navigator.mediaDevices.getUserMedia({video:{deviceId:h}}),r.value=h},options:d,class:"w-250px"},null),N("video",{autoplay:!0,muted:!0,srcObject:w,width:"240",height:"180"},null)]),onCancel:()=>{w.getTracks().forEach(h=>{h.stop()})},onOk:()=>x(w).then(()=>{a.data.onPush(n.value),o.value=!1}).catch(h=>{Le.error({title:t("routes.home.推流失败"),content:h}),n.value=!1,o.value=!1})})})}return(w,d)=>(q(),ge(f(Ve),{size:"small",class:"w-250px drop-shadow-xl"},{title:X(()=>[H("span",null,K(f(t)("routes.home.推流器")),1),m.value?(q(),ge(f(Nt),{key:0,title:f(t)("routes.home.帮助"),content:f(t)("routes.home.推流器帮助")},{default:X(()=>[N(f(Se),{type:"link",size:"small"},{default:X(()=>[N(f(ut),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):Me("",!0)]),extra:X(()=>[N(f(Se),{type:"link",onClick:g},{default:X(()=>[Ne(K(f(t)("routes.home.推流地址")),1)]),_:1})]),actions:X(()=>[H("div",pv,[H("div",null,K(f(t)("routes.home.流标识")),1),N(f(Sn),{type:"text",class:"w-120px",value:s.value,"onUpdate:value":d[0]||(d[0]=h=>s.value=h),size:"small"},null,8,["value"]),N(f(To),{checked:n.value,"onUpdate:checked":d[1]||(d[1]=h=>n.value=h),loading:o.value,size:"small"},null,8,["checked","loading"])])]),default:X(()=>[N(f($e),{type:"source",position:f(Q).Right},null,8,["position"]),m.value?(q(),ae("video",{key:0,id:"video",width:"224",height:"168",style:{"border-radius":"6px","object-fit":"cover"},autoplay:"",muted:"",srcObject:m.value},null,8,fv)):(q(),ae("span",hv,[Ne(K(f(t)("routes.home.推流器说明"))+" ",1),d[2]||(d[2]=H("br",null,null,-1)),Ne(" "+K(f(t)("routes.home.推流器说明2")),1)]))]),_:1}))}}),gv=["src"],yv=ue({__name:"debug-chart",props:{data:{}},setup(e){const{t}=De(),n=bt("debug","/charts"),o=e,i=()=>{o.data.onClose()};return(r,s)=>(q(),ge(f(Ve),{size:"small",title:f(t)("routes.home.性能观测标题"),class:"w-800px h-600px drop-shadow-xl relative","body-style":{top:"40px",bottom:0,position:"absolute",left:0,right:0,padding:0}},{extra:X(()=>[N(f(Se),{type:"link",onClick:i},{default:X(()=>[N(f(ji),{class:"ml-1 text-gray-400"})]),_:1})]),default:X(()=>[H("iframe",{src:f(n),class:"w-full h-full",style:{border:"none"}},null,8,gv)]),_:1},8,["title"]))}}),_v={class:"flex items-center"},wv={class:"mr-2 ml-2 w-50px"},xv={class:"flex items-center justify-end pr-5"},bv={class:"mr-2 ml-2 w-100px"},Sv=ue({__name:"log-trail",props:{data:{}},setup(e){const{t}=De(),n=Z(null),o=Z(!0),i=Z(""),r=Z(null);Ye(()=>{n.value=new EventSource(bt("logrotate")+"/trail"),n.value.onmessage=l=>{a.value.push(l.data),o.value&&Je(()=>{r.value?.scrollTo({top:r.value?.scrollHeight,behavior:"smooth"})})}}),zn(()=>{n.value?.close()});const s=e,a=Z([]),u=()=>{s.data.onClose()};return(l,c)=>(q(),ge(f(Ve),{size:"small",title:f(t)("routes.home.日志标题"),class:"w-700px drop-shadow-2xl"},{extra:X(()=>[N(f(Se),{type:"link",onClick:u},{default:X(()=>[N(f(ji),{class:"ml-1 text-gray-400"})]),_:1})]),actions:X(()=>[H("div",_v,[H("div",wv,K(f(t)("routes.home.过滤")),1),N(f(Sn),{value:i.value,"onUpdate:value":c[0]||(c[0]=v=>i.value=v),size:"small"},null,8,["value"])]),H("div",xv,[H("div",bv,K(f(t)("routes.home.自动滚动")),1),N(f(To),{checked:o.value,"onUpdate:checked":c[1]||(c[1]=v=>o.value=v),size:"small"},null,8,["checked"])])]),default:X(()=>[H("div",{class:"h-400px w-full overflow-auto",ref_key:"logContainer",ref:r},[(q(!0),ae(Fe,null,On(i.value?a.value.filter(v=>v.includes(i.value)):a.value,(v,p)=>(q(),ae("div",{key:p},K(v),1))),128))],512)]),_:1},8,["title"]))}}),Ev={class:"flex flex-col gap-2"},Cv={key:0,class:"flex items-center gap-2 mb-2"},Nv={key:2,class:"text-12px"},kv={class:"flex items-center justify-between pl-10px pr-10px"};function uo(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!an(e)}const Pv=ue({name:"Pusher"}),$v=ue({...Pv,props:{data:{}},setup(e){const{t}=De(),n=Z("ws-flv"),o=Z("live/test"),i=Z(""),r=Z(!1),s=Z(!1),a=Z([]),u=e;co().then(p=>{a.value=[{title:"live/test",value:"live/test"}].concat(p.filter(m=>m.path!=="live/test").map(m=>({title:m.path,value:m.path})))});function l(p){s.value=!1,typeof p=="string"&&(Ut.error({message:t("routes.home.播放结束"),description:p}),r.value=!1)}function c(p){co().then(m=>{a.value=[{title:p,value:p}].concat(m.map(x=>({title:x.path,value:x.path})))})}An(()=>{u.data.onPlay(r.value),r.value?(s.value=!0,i.value=o.value):i.value=""});async function v(){const p=Z({useLocalIP:"localhost",secretKey:"",expireTime:ze().add(1,"hour")});Le.info({title:t("routes.home.播放地址"),width:800,content:()=>{let m,x,g;const _=d=>{if(!p.value.secretKey||!p.value.expireTime)return"";const h=Math.floor(p.value.expireTime.unix()).toString(16),y=cs(p.value.secretKey+o.value+h).toString();return(d.includes("?")?"&":"?")+`secret=${y}&expire=${h}`},w=[];for(const d of u.data.plugins){const h=d.playAddr;if(h)for(const y of h){const O=y.replace("{hostName}",p.value.useLocalIP).replace("{streamPath}",o.value);w.push({protocol:y.startsWith("http")?d.name.toLocaleLowerCase():y.split(":")[0],path:O+_(O)})}}return w.length?[N(fo,{value:p.value.useLocalIP,onChange:d=>p.value.useLocalIP=d.target.value},{default:()=>[N(Pt,{value:"localhost"},uo(m=t("routes.home.使用localhost"))?m:{default:()=>[m]}),N(Pt,{value:u.data.sysInfo.publicIP},uo(x=t("routes.home.使用公网IP"))?x:{default:()=>[x]}),N(Pt,{value:u.data.sysInfo.localIP},uo(g=t("routes.home.使用内网IP"))?g:{default:()=>[g]})]}),N(Ae,{layout:"inline"},{default:()=>[N(Ae.Item,null,{default:()=>[N("span",null,[t("routes.home.秘钥"),N(Io,{title:t("routes.home.需要匹配配置文件中subscribe下的key配置")},{default:()=>[N(ut,{style:"margin-left: 4px"},null)]})]),N(Sn,{type:"text",placeholder:t("routes.home.请输入秘钥"),class:"w-250px",style:"margin-bottom: 10px",value:p.value.secretKey,onChange:d=>p.value.secretKey=d.target.value},null)]}),N(Ae.Item,{label:t("routes.home.过期时间")},{default:()=>[N(qi,{placeholder:t("routes.home.选择过期时间"),showTime:!0,class:"w-250px",style:"margin-bottom: 10px",value:p.value.expireTime,onChange:d=>p.value.expireTime=d},null)]})]}),N(Be,{dataSource:w,columns:[{title:t("routes.home.协议"),dataIndex:"protocol"},{title:t("routes.home.播放地址"),dataIndex:"path"}],pagination:!1,size:"small"},null)]:N("span",null,[t("routes.home.请先启用一些插件")])}})}return(p,m)=>(q(),ge(f(Ve),{size:"small",class:"w-250px drop-shadow-xl"},{title:X(()=>[H("span",null,K(f(t)("routes.home.播放器")),1),r.value?(q(),ge(f(Nt),{key:0,title:f(t)("routes.home.帮助"),content:f(t)("routes.home.播放器帮助")},{default:X(()=>[N(f(Se),{type:"link",size:"small"},{default:X(()=>[N(f(ut),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):Me("",!0)]),extra:X(()=>[N(f(Se),{type:"link",onClick:v},{default:X(()=>[Ne(K(f(t)("routes.home.播放地址")),1)]),_:1})]),actions:X(()=>[H("div",kv,[H("div",null,K(f(t)("routes.home.流标识")),1),N(f(zt),{class:"w-120px",showSearch:"",value:o.value,"onUpdate:value":m[1]||(m[1]=x=>o.value=x),options:a.value,onSearch:c,size:"small"},null,8,["value","options"]),N(f(To),{checked:r.value,"onUpdate:checked":m[2]||(m[2]=x=>r.value=x),loading:s.value,size:"small"},null,8,["checked","loading"])])]),default:X(()=>[N(f($e),{type:"source",position:f(Q).Left},null,8,["position"]),H("div",Ev,[r.value?(q(),ae("div",Cv,[N(f(fo),{value:n.value,"onUpdate:value":m[0]||(m[0]=x=>n.value=x),size:"small"},{default:X(()=>[N(f(Ko),{value:"ws-flv"},{default:X(()=>m[3]||(m[3]=[Ne("WS-FLV")])),_:1}),N(f(Ko),{value:"webrtc"},{default:X(()=>m[4]||(m[4]=[Ne("WebRTC")])),_:1})]),_:1},8,["value"])])):Me("",!0),r.value?(q(),ge(ha,{key:1,streamPath:i.value,format:n.value,onPlay:l,class:"flex-1 m-r-10px w-224px h-168px"},null,8,["streamPath","format"])):(q(),ae("span",Nv,[Ne(K(f(t)("routes.home.播放器说明"))+" ",1),m[5]||(m[5]=H("br",null,null,-1)),Ne(" "+K(f(t)("routes.home.播放器说明2")),1)]))])]),_:1}))}}),Iv={key:1,class:"text-12px"},Mv=ue({name:"Remote"}),Tv=ue({...Mv,setup(e){const{t}=De(),{pause:n,resume:o}=it(s),i=Z([]),r=Z([{title:t("routes.home.名称"),dataIndex:"name"},{title:t("routes.home.状态"),dataIndex:"status",customRender:({record:a})=>a.status?t("routes.home.在线"):t("routes.home.离线")}]);function s(){return ca().then(a=>{i.value=a}).catch(a=>{console.error(`stream-proxy-getList-error: ${a}`)})}return s(),(a,u)=>(q(),ge(f(Ve),{size:"small",class:"w-250px drop-shadow-xl"},{title:X(()=>[H("span",null,K(f(t)("routes.home.远端服务器或CDN")),1),i.value.length?(q(),ge(f(Nt),{key:0,title:f(t)("routes.home.帮助"),content:f(t)("routes.home.可以将流转推到远端服务器")},{default:X(()=>[N(f(Se),{type:"link",size:"small"},{default:X(()=>[N(f(ut),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):Me("",!0)]),extra:X(()=>[N(f(Se),{type:"link",onClick:u[0]||(u[0]=l=>f(pa)({updateList:s,pause:f(n),resume:f(o)}))},{default:X(()=>[Ne(K(f(t)("routes.home.添加")),1)]),_:1})]),default:X(()=>[N(f($e),{type:"target",position:f(Q).Left},null,8,["position"]),i.value.length?(q(),ge(f(Be),{key:0,"data-source":i.value,columns:r.value,size:"small",pagination:!1,bordered:""},null,8,["data-source","columns"])):(q(),ae("span",Iv,K(f(t)("routes.home.转推功能说明")),1))]),_:1}))}}),Dv={key:1},Ov={key:1,class:"text-12px"},zv=ue({name:"ReadRecord"}),Av=ue({...zv,props:{data:{}},setup(e){const{t}=De(),n=e,o=Z([]),i=se(()=>n.data.plugins.some(g=>g.name==="MP4"||g.name==="FLV"));function r(g){const _=new Date(g.startTime),d=new Date(g.endTime).getTime()-_.getTime(),h=d/(36e5*24)>>0,y=(d/36e5>>0)%24,O=(d/6e4>>0)%60,R=(d/1e3>>0)%60;return`${h?`${h}d`:""}${y?`${y}h`:""}${O}'${R}"`}const s=Z([{title:t("routes.home.录像路径"),dataIndex:"filePath",customRender:({text:g,record:_})=>N("div",{class:"flex items-center justify-between"},[N("span",{class:"flex-1"},[g]),N("div",{class:"flex gap-2"},[N(ma,{class:"cursor-pointer text-blue-500 hover:text-blue-600",onClick:()=>{x(`${bt(_.type.toLowerCase(),"/download")}/${_.streamPath}?id=${_.id}`,`${_.streamPath}-${_.id}.${_.type.toLowerCase()}`)}},null),N(Zs,{class:"cursor-pointer text-red-500 hover:text-red-600",onClick:()=>{Le.confirm({title:t("routes.home.确认删除"),content:t("routes.home.确定要删除这条录像记录吗"),onOk:()=>va({type:_.type.toLowerCase(),id:_.id}).then(()=>{const w=o.value.find(d=>d.streamPath===_.streamPath);w&&loadDetailRecords(w,pagination.value)})})}},null)])])},{title:t("routes.home.录像开始时间"),dataIndex:"startTime",customRender:({text:g})=>ze(g).format("YYYY-MM-DD HH:mm:ss")},{title:t("routes.home.录像结束时间"),dataIndex:"endTime",customRender:({text:g})=>ze(g).format("YYYY-MM-DD HH:mm:ss")},{title:t("routes.home.录像时长"),customRender:({record:g})=>r(g)}]),a=Z([{title:t("routes.home.录像流路径"),dataIndex:"streamPath",customRender:({text:g,record:_})=>{const w=Z([]),d=Z({current:1,pageSize:10,total:0,onChange:(y,O)=>{d.value.current=y,d.value.pageSize=O,h(_,d.value)},showTotal:y=>t("routes.home.共条",{total:y})});function h(y,O){return er({streamPath:y.streamPath,type:y.type.toLowerCase(),pageNum:O.current,pageSize:O.pageSize}).then(R=>{w.value=Array.isArray(R)?R:R.list||[],d.value.total=Array.isArray(R)?R.length:R.total||0})}return N("div",{class:"cursor-pointer",onClick:()=>{h(_,d.value),Le.info({title:t("routes.home.录像文件列表",{streamPath:_.streamPath}),content:()=>N(Be,{dataSource:w.value,columns:s.value,pagination:d.value,size:"small",bordered:!0},null),width:1e3})}},[g,N(Ia,{style:{marginLeft:"8px",cursor:"pointer"}},null)])}},{title:t("routes.home.录像时长"),customRender:({record:g})=>r(g)},{title:t("routes.home.录像类型"),dataIndex:"type"}]),{pause:u,resume:l}=it(p),c=Z([]),v=[0,0];function p(){return Promise.all([En("mp4").catch(g=>(console.error(`mp4-record-catalog-error: ${g}`),[])),En("flv").catch(g=>(console.error(`flv-record-catalog-error: ${g}`),[]))]).then(([g,_])=>{const w=[...g.map(d=>({...d,type:"MP4"})),..._.map(d=>({...d,type:"FLV"}))];o.value=w,c.value=[...new Set(w.map(d=>d.streamPath))],w.length>0&&(v[0]=Math.min(...w.map(d=>new Date(d.startTime).getTime())),v[1]=Math.max(...w.map(d=>new Date(d.endTime).getTime())))})}const m=()=>{const g=Z(c.value[0]),_=Z("MP4"),w=Z([ze(v[0]),ze(v[1])]);Le.confirm({title:t("routes.home.录像下载标题"),width:500,content:()=>N("div",null,[N(Ae,{layout:"vertical"},{default:()=>[N(Ae.Item,{label:t("routes.home.录像流路径"),required:!0},{default:()=>[N(zt,{value:g.value,onChange:d=>g.value=d,options:c.value.map(d=>({label:d,value:d}))},null)]}),N(Ae.Item,{label:t("routes.home.录像类型"),required:!0},{default:()=>[N(zt,{value:_.value,onChange:d=>_.value=d,options:[{label:"MP4",value:"MP4"},{label:"FLV",value:"FLV"}]},null)]}),N(Ae.Item,{label:t("routes.home.录像时间范围"),required:!0},{default:()=>[N(Qi,{disabledDate:d=>{const h=o.value.find(y=>y.streamPath===g.value&&y.type===_.value);return d&&(d<ze(h?.startTime)||d>ze(h?.endTime))},value:w.value,onChange:d=>w.value=d,showTime:!0,format:"YYYY-MM-DD HH:mm:ss"},null)]})]})]),onOk:()=>{if(!g.value||!w.value[0]||!w.value[1])return Promise.reject(t("routes.home.请填写完整信息"));const d=`${ze(w.value[0]).valueOf()}-${ze(w.value[1]).valueOf()}`;return x(`${bt(_.value.toLowerCase(),"/download")}/${g.value}?range=${d}`,`${g.value}-${w.value[0].format("YYYYMMDDHHmmss")}-${w.value[1].format("YYYYMMDDHHmmss")}.${_.value.toLowerCase()}`),Promise.resolve()}})};function x(g,_){const w=document.createElement("a");w.href=g,w.target="_blank",w.download=_,document.body.appendChild(w),w.click(),document.body.removeChild(w)}return _e(i,g=>{g?(p(),l()):(u(),o.value=[],c.value=[],v[0]=0,v[1]=0)},{immediate:!0}),(g,_)=>(q(),ge(f(Ve),{size:"small",class:"w-250px drop-shadow-xl"},{title:X(()=>[H("span",null,K(f(t)("routes.home.录像读取")),1),o.value.length?(q(),ge(f(Nt),{key:0,title:f(t)("routes.home.帮助"),content:f(t)("routes.home.录像读取帮助")},{default:X(()=>[N(f(Se),{type:"link",size:"small"},{default:X(()=>[N(f(ut),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):Me("",!0)]),extra:X(()=>[i.value?(q(),ge(f(Se),{key:0,type:"link",onClick:m},{default:X(()=>[Ne(K(f(t)("routes.home.录像下载")),1)]),_:1})):(q(),ae("span",Dv,K(f(t)("routes.home.请先启用MP4或FLV插件")),1))]),default:X(()=>[N(f($e),{type:"source",position:f(Q).Right},null,8,["position"]),o.value.length?(q(),ge(f(Be),{key:0,"data-source":o.value,columns:a.value,size:"small",pagination:!1,bordered:""},null,8,["data-source","columns"])):(q(),ae("span",Ov,K(f(t)("routes.home.录像读取功能说明")),1))]),_:1}))}}),Rv={key:1},Bv={key:1,class:"text-12px"},Lv=ue({name:"PlayRecord"}),Vv=ue({...Lv,props:{data:{}},setup(e){const{t}=De(),n=Z(null),o=Z([]),i=Z(),r=Z([]),s=Z("mp4"),a=e,u=se(()=>a.data.plugins.some(c=>c.name==="MP4"||c.name==="FLV")),l=async()=>{if(r.value.length){r.value=[];return}const[c,v]=await Promise.all([En("mp4").catch(()=>[]),En("flv").catch(()=>[])]),p=[...c.map(x=>({...x,type:"mp4"})),...v.map(x=>({...x,type:"flv"}))];if(p.length===0){Le.warning({title:t("routes.home.提示"),content:t("routes.home.没有可用的录像记录")});return}o.value=[...new Set(p.map(x=>x.streamPath))].map(x=>({label:x,value:x})),i.value=o.value[0].value,s.value=p.find(x=>x.streamPath===i.value)?.type||"mp4";let m=Z([ze(p[0].startTime),ze(p[0].endTime)]);Le.confirm({title:t("routes.home.播放录像"),width:500,content:()=>N("div",null,[N(Ae,{layout:"vertical"},{default:()=>[N(Ae.Item,{label:t("routes.home.录像流路径"),required:!0},{default:()=>[N(zt,{value:i.value,onChange:x=>{i.value=x,s.value=p.find(g=>g.streamPath===x)?.type||"mp4"},placeholder:t("routes.home.请选择流路径"),options:o.value},null)]}),N(Ae.Item,{label:t("routes.home.录像类型"),required:!0},{default:()=>[N(zt,{value:s.value,onChange:x=>s.value=x,options:[{label:"MP4",value:"mp4"},{label:"FLV",value:"flv"}]},null)]}),N(Ae.Item,{label:t("routes.home.播放时间范围"),required:!0},{default:()=>[N(Qi,{value:m.value,disabledDate:x=>{const g=p.find(_=>_.streamPath===i.value&&_.type===s.value);return x&&(x<ze(g?.startTime)||x>ze(g?.endTime))},onChange:x=>m.value=x,showTime:!0,format:"YYYY-MM-DD HH:mm:ss"},null)]})]})]),onOk:async()=>{if(!m.value?.[0]||!m.value?.[1])return Promise.reject(t("routes.home.请选择时间范围"));r.value=await er({streamPath:i.value,type:s.value,range:`${m.value[0].unix()}-${m.value[1].unix()}`})}})};return(c,v)=>(q(),ge(f(Ve),{size:"small",class:"w-250px drop-shadow-xl"},{title:X(()=>[H("span",null,K(f(t)("routes.home.录像播放")),1),n.value?(q(),ge(f(Nt),{key:0,title:f(t)("routes.home.帮助"),content:f(t)("routes.home.录像播放帮助")},{default:X(()=>[N(f(Se),{type:"link",size:"small"},{default:X(()=>[N(f(ut),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])):Me("",!0)]),extra:X(()=>[u.value?(q(),ge(f(Se),{key:0,type:"link",onClick:l},{default:X(()=>[Ne(K(r.value.length?f(t)("routes.home.停止"):f(t)("routes.home.播放")),1)]),_:1})):(q(),ae("span",Rv,K(f(t)("routes.home.请先启用MP4或FLV插件")),1))]),default:X(()=>[N(f($e),{type:"target",position:f(Q).Left},null,8,["position"]),r.value.length?(q(),ge(ga,{key:0,src:`${f(bt)("hls","/vod")}/fmp4.m3u8?start=${new Date(r.value[0].startTime).getTime()}&streamPath=${i.value}`},null,8,["src"])):(q(),ae("span",Bv,K(f(t)("routes.home.录像播放功能说明")),1))]),_:1}))}}),Hv={key:0,class:"p-8px"},Fv={key:1,class:"text-12px"},Yv=ue({name:"Upstream"}),Gv=ue({...Yv,setup(e){const{t}=De(),n=Rn(),{nodeHistory:o}=Ot(n),i=[{title:"M7S ID",dataIndex:"m7sId",key:"m7sId"},{title:"IP",dataIndex:"ip",key:"ip"}];return(r,s)=>(q(),ge(f(Ve),{size:"small",class:"w-500px drop-shadow-xl"},{title:X(()=>[H("span",null,K(f(t)("routes.home.上级节点")),1)]),extra:X(()=>[N(f(Se),{disabled:!f(o).length,type:"link",size:"small",onClick:f(n).removeLastNode},{default:X(()=>[Ne(K(f(t)("routes.home.返回上一级")),1)]),_:1},8,["disabled","onClick"])]),default:X(()=>[N(f($e),{type:"source",position:f(Q).Bottom},null,8,["position"]),f(o).length?(q(),ae("div",Hv,[N(f(Be),{columns:i,"data-source":f(o),size:"small",pagination:!1},null,8,["data-source"])])):(q(),ae("span",Fv,K(f(t)("routes.home.点击右上角按钮可以返回上级节点")),1))]),_:1}))}}),jn=qs({requestOptions:{apiUrl:()=>bt("cascadeserver")}});function Uv(){return jn.get({url:"/list"})}function Xv(e){return jn.post({url:"/create",data:e})}function Wv(e){return jn.post({url:`/delete/${e.id}`})}function Kv(e){return jn.post({url:"/update",data:e})}const Zv={key:0},qv={key:0,class:"p-8px"},jv={key:1,class:"text-12px"},Qv={key:1,class:"p-16px text-center text-gray-500"};function Hi(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!an(e)}const Jv=ue({name:"Downstream"}),em=ue({...Jv,props:{data:{default:()=>({active:!1})}},setup(e){const{t}=De(),n=e,o=Z([]);Z(!1),Z();const i=()=>({type:"object",properties:{name:{type:"string",title:t("routes.home.节点名称"),required:!0,"x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:t("routes.home.请输入节点名称")},"x-validator":[{required:!0,message:t("routes.home.请输入节点名称")},{max:50,message:t("routes.home.节点名称不能超过50个字符")}]},secret:{type:"string",title:t("routes.home.密钥"),"x-decorator":"FormItem","x-component":"Password","x-component-props":{placeholder:t("routes.home.请输入密钥")},"x-validator":[{message:t("routes.home.请输入密钥")}]}}}),r=async p=>{try{await Wv(p),Xe.success(t("routes.home.删除成功")),l()}catch(m){Xe.error(t("routes.home.删除失败")+":"+m.message)}},s=Zi(),a=[{title:t("routes.home.名称"),dataIndex:"name",key:"name",customRender:({record:p})=>p.online?N(Se,{type:"link",size:"small",onClick:()=>{s({name:"Home"})}},{default:()=>[p.name]}):p.name},{title:"IP",dataIndex:"ip",key:"ip"},{title:t("routes.home.状态"),key:"status",width:100,customRender:({record:p})=>p.online?t("routes.home.已连接"):t("routes.home.未连接")},{title:t("routes.home.操作"),key:"action",width:100,customRender:({record:p})=>{let m,x;return N(ya,null,{default:()=>[N(Se,{type:"link",size:"small",onClick:()=>u(p)},Hi(m=t("routes.home.修改"))?m:{default:()=>[m]}),N(Sa,{title:t("routes.home.确定要删除该节点吗"),onConfirm:()=>r(p)},{default:()=>[N(Se,{type:"link",size:"small",danger:!0},Hi(x=t("routes.home.删除"))?x:{default:()=>[x]})]})]})}}],u=p=>{const m=!!p,x=p||{id:Date.now(),name:"",ip:"",secret:"",online:!1},{FormilyForm:g,form:_,submit:w}=js({schema:i(),formProps:{initialValues:x}});Qs({content:()=>N(g,null,null),modalConfig:{title:t(m?"routes.home.修改下级节点":"routes.home.添加下级节点"),maskClosable:!1,width:500,onOk:async()=>{try{const d=await w();if(d){const h={...x,...d};return h.online?Promise.reject(t("routes.home.请先断开当前连接")):(m?(await Kv(h),Xe.success(t("routes.home.修改成功"))):(await Xv(h),Xe.success(t("routes.home.添加成功"))),l(),Promise.resolve(!0))}return Promise.reject(!1)}catch(d){return d===!1?Promise.reject(!1):(Xe.error(t(m?"routes.home.修改":"routes.home.添加")+"失败:"+d.message),Promise.reject(d))}},onClose:()=>{_.reset()}}})};async function l(){if(n.data.active)try{o.value=await Uv()}catch(p){Xe.error(t("routes.home.获取下级节点列表失败")+":"+p.message)}}const{pause:c,resume:v}=it(l);return c(),_e(()=>n.data.active,p=>{p?(l(),v()):(o.value=[],c())}),Ye(()=>{n.data.active&&(l(),v())}),(p,m)=>(q(),ge(f(Ve),{size:"small",class:"w-500px drop-shadow-xl"},{title:X(()=>[H("span",null,K(f(t)("routes.home.下级节点")),1),N(f(Nt),{title:f(t)("routes.home.帮助"),content:f(t)("routes.home.下级节点功能说明")},{default:X(()=>[N(f(Se),{type:"link",size:"small"},{default:X(()=>[N(f(ut),{class:"ml-1 text-gray-400"})]),_:1})]),_:1},8,["title","content"])]),extra:X(()=>[N(f(Se),{type:"link",size:"small",onClick:m[0]||(m[0]=x=>u()),disabled:!n.data.active},{default:X(()=>[Ne(K(f(t)("routes.home.添加节点")),1)]),_:1},8,["disabled"])]),default:X(()=>[N(f($e),{type:"target",position:f(Q).Top},null,8,["position"]),n.data.active?(q(),ae("div",Zv,[o.value.length?(q(),ae("div",qv,[N(f(Be),{columns:a,"data-source":o.value,size:"small",pagination:!1},null,8,["data-source"])])):(q(),ae("span",jv,K(f(t)("routes.home.下级节点功能说明")),1))])):(q(),ae("div",Qv,K(f(t)("routes.home.服务器需要启用CascadeServer插件")),1))]),_:1}))}}),tm={class:"text-text"},nm=ue({__name:"flow",setup(e){const{t}=De(),n={instance:Oe(iv),pullProxy:Oe(av),pusher:Oe(mv),debugChart:Oe(yv),logTrail:Oe(Sv),preview:Oe($v),pushProxy:Oe(Tv),readRecord:Oe(Av),playRecord:Oe(Vv),upstream:Oe(Gv),downstream:Oe(em)},o=Z(!1),i=Z(!1),r=Z(!1),s=Z(!1),a=Rn(),{online:u}=Ot(a),l=se(()=>({id:"center",type:"instance",data:{onShowDebugChart:()=>{r.value=!0},onShowLogTrail:()=>{s.value=!0}},position:{x:400,y:300}})),c=se(()=>u.value?[...r.value?[{id:"debugChart",position:{x:100,y:100},data:{onClose:()=>{r.value=!1}},type:"debugChart",zIndex:1e3}]:[],...s.value?[{id:"logTrail",position:{x:100,y:300},type:"logTrail",data:{onClose:()=>{s.value=!1}},zIndex:1001}]:[],{id:"pullProxy",position:{x:50,y:100},targetPosition:Q.Right,data:{plugins:a.plugins},type:"pullProxy"},{id:"pushProxy",position:{x:1e3,y:100},data:{plugins:a.plugins},sourcePosition:Q.Left,type:"pushProxy"},{id:"pusher",position:{x:50,y:350},data:{plugins:a.plugins,onPush:p=>{o.value=p}},targetPosition:Q.Right,type:"pusher"},{id:"player",position:{x:1e3,y:350},data:{plugins:a.plugins,sysInfo:a.sysInfo,onPlay:p=>{i.value=p}},sourcePosition:Q.Left,type:"preview"},{id:"upstream",type:"upstream",position:{x:400,y:100},data:{plugins:a.plugins}},{id:"downstream",type:"downstream",position:{x:400,y:700},data:{plugins:a.plugins,active:a.plugins.some(p=>p.name==="CascadeServer")||!1}},l.value,{id:"readRecord",type:"readRecord",data:{plugins:a.plugins},position:{x:50,y:700},targetPosition:Q.Right},{id:"playRecord",type:"playRecord",data:{plugins:a.plugins},position:{x:1e3,y:700},sourcePosition:Q.Left}]:[l.value]),v=se(()=>u.value?[{id:"e1->center",source:"pullProxy",target:"center",targetHandle:"target-pull",animated:!0},{id:"epusher->center",source:"pusher",target:"center",targetHandle:"target-push",animated:!0,style:o.value?{stroke:"#000",border:"2px",filter:"drop-shadow(0 0 2px cyan)"}:void 0},{id:"center->pushProxy",source:"center",target:"pushProxy",sourceHandle:"source-push",animated:!0},{id:"center->player",source:"center",target:"player",sourceHandle:"source-play",animated:!0,style:i.value?{stroke:"#000",border:"2px",filter:"drop-shadow(0 0 2px cyan)"}:void 0},{id:"e2->center",source:"upstream",target:"center",targetHandle:"upstream"},{id:"e3->center",source:"center",target:"downstream",sourceHandle:"downstream"},{id:"readRecord->center",source:"readRecord",target:"center",targetHandle:"target-read",animated:!0},{id:"center->playRecord",source:"center",target:"playRecord",sourceHandle:"source-read",animated:!0}]:[]);return(p,m)=>(q(),ae(Fe,null,[H("h2",tm,[Ne(K(f(t)("routes.home.Monibuca超级面板"))+" ",1),N(f(Ki),{color:"green",class:"text-10px v-text-bottom"},{default:X(()=>m[0]||(m[0]=[Ne("For m7s Pro V5")])),_:1})]),N(f(Nh),{style:{position:"unset"},nodes:c.value,"node-types":n,edges:v.value,"zoom-on-scroll":!1,"pan-on-drag":!0,"zoom-on-double-click":!1,"nodes-connectable":!1,"select-nodes-on-drag":!1,"connect-on-click":!1,"elements-selectable":!1},{default:X(()=>[N(f(Dh))]),_:1},8,["nodes","edges"])],64))}});const om={class:"h-100vh w-100vw p-10px",style:{background:"var(--layout-background)"}},im={class:"h-full w-full flex min-w-1200px"},rm=ue({name:"Instance"}),Tm=ue({...rm,setup(e){const{t}=De();_a(),Ot(Js());const n=ea();return Ot(n),se(()=>[{title:"Monibuca",description:t("routes.home.开源Go语言流媒体服务器框架"),url:"https://monibuca.com",svg:"logo",size:40},{title:"Jessibuca",description:t("routes.home.纯H5音视频流播放器"),url:"https://jessibuca.com",svg:"jb",size:40},{title:"Rebebuca",description:t("routes.home.Rust桌面端FFMPEG管理器"),url:"https://rebebuca.com",svg:"rb",size:34}]),(o,i)=>(q(),ae("div",om,[H("div",im,[Me("",!0),N(f(Ve),{class:"flex-1 rounded-r-lg",bodyStyle:{height:"100%"}},{default:X(()=>[N(nm)]),_:1})])]))}});export{Tm as default};
  26. //# sourceMappingURL=index-22b6f957.js.map