From 67ef9d8c6e9bda35626662b0f33577303fa45388 Mon Sep 17 00:00:00 2001 From: Stephan Lo Date: Fri, 19 Dec 2025 15:13:04 +0100 Subject: [PATCH] docs(architecture): switched text diagram to likec4 --- .../en/docs/edp/deployment/basics/_index.md | 32 +-- .../edp-likec4/models/components/tools.c4 | 15 ++ .../views/edp/platform-orchestration-flow.c4 | 23 +++ static/js/likec4-webcomponent.js | 184 +++++++++--------- 4 files changed, 133 insertions(+), 121 deletions(-) create mode 100644 resources/edp-likec4/views/edp/platform-orchestration-flow.c4 diff --git a/content/en/docs/edp/deployment/basics/_index.md b/content/en/docs/edp/deployment/basics/_index.md index 7ac0dd0..075022d 100644 --- a/content/en/docs/edp/deployment/basics/_index.md +++ b/content/en/docs/edp/deployment/basics/_index.md @@ -265,37 +265,7 @@ argocd app sync component --watch ### Platform Orchestration Flow -```text -┌─────────────────┐ -│ idpbuilder │ Bootstrap Tool -│ (Initial Run) │ -└────────┬────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────┐ -│ Kubernetes Cluster │ -│ │ -│ ┌──────────────┐ ┌──────────────┐ │ -│ │ ArgoCD │────────▶│ Forgejo │ │ -│ │ (GitOps) │ │ (Git Repo) │ │ -│ └──────┬───────┘ └──────────────┘ │ -│ │ │ -│ │ Monitors & Syncs │ -│ │ │ -│ ▼ │ -│ ┌──────────────────────────────────────┐ │ -│ │ Platform Stacks │ │ -│ │ │ │ -│ │ ┌──────────┐ ┌──────────┐ │ │ -│ │ │Forgejo │ │Keycloak │ │ │ -│ │ └──────────┘ └──────────┘ │ │ -│ │ ┌──────────┐ ┌──────────┐ │ │ -│ │ │Observ- │ │Ingress │ │ │ -│ │ │ability │ │ │ │ │ -│ │ └──────────┘ └──────────┘ │ │ -│ └──────────────────────────────────────┘ │ -└─────────────────────────────────────────────────────┘ -``` +{{< likec4-view view="platform_orchestration_flow" title="Platform Orchestration Flow" >}} ### Platform Bootstrap Sequence diff --git a/resources/edp-likec4/models/components/tools.c4 b/resources/edp-likec4/models/components/tools.c4 index 8484713..5215d96 100644 --- a/resources/edp-likec4/models/components/tools.c4 +++ b/resources/edp-likec4/models/components/tools.c4 @@ -10,4 +10,19 @@ model { platformdeveloper -> edfbuilder "runs" } + component idpbuilder "idpbuilder" { + description 'Bootstrap tool for initial platform provisioning' + technology 'Golang' + icon tech:go + style { + shape rectangle + } + + -> edp.argoCD 'installs' + -> edp.forgejo 'installs' + -> edp.ingressNginx 'installs' + + platformdeveloper -> idpbuilder 'runs' + } + } \ No newline at end of file diff --git a/resources/edp-likec4/views/edp/platform-orchestration-flow.c4 b/resources/edp-likec4/views/edp/platform-orchestration-flow.c4 new file mode 100644 index 0000000..5c3ad27 --- /dev/null +++ b/resources/edp-likec4/views/edp/platform-orchestration-flow.c4 @@ -0,0 +1,23 @@ +views { + + view platform_orchestration_flow of edp { + title 'Platform Orchestration Flow' + + // Keep it minimal: only the elements from the documentation diagram + include idpbuilder + include edp + + include edp.argoCD + include edp.forgejo + include edp.ingressNginx + + // Represent "Platform Stacks" via representative platform components + include edp.keycloak + include edp.monitoring + + // Hide internal-only plumbing unless explicitly included + exclude element.tag = #internal + + autoLayout TopBottom + } +} diff --git a/static/js/likec4-webcomponent.js b/static/js/likec4-webcomponent.js index 5a15ffb..434ab25 100644 --- a/static/js/likec4-webcomponent.js +++ b/static/js/likec4-webcomponent.js @@ -7,7 +7,7 @@ var LikeC4Views=(function(Y6){"use strict";/* prettier-ignore-start */ ******************************************************************************/ -function Lge(e,r){for(var n=0;no[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function LN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X6={exports:{}},Xg={};var FN;function Fge(){if(FN)return Xg;FN=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(o,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var s in a)s!=="key"&&(i[s]=a[s])}else i=a;return a=i.ref,{$$typeof:e,type:o,key:l,ref:a!==void 0?a:null,props:i}}return Xg.Fragment=r,Xg.jsx=n,Xg.jsxs=n,Xg}var VN;function Vge(){return VN||(VN=1,X6.exports=Fge()),X6.exports}var y=Vge(),Z6={exports:{}},$t={};var qN;function qge(){if(qN)return $t;qN=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),f=Symbol.iterator;function g(Y){return Y===null||typeof Y!="object"?null:(Y=f&&Y[f]||Y["@@iterator"],typeof Y=="function"?Y:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function k(Y,Z,O){this.props=Y,this.context=Z,this.refs=x,this.updater=O||v}k.prototype.isReactComponent={},k.prototype.setState=function(Y,Z){if(typeof Y!="object"&&typeof Y!="function"&&Y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Y,Z,"setState")},k.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function C(){}C.prototype=k.prototype;function _(Y,Z,O){this.props=Y,this.context=Z,this.refs=x,this.updater=O||v}var $=_.prototype=new C;$.constructor=_,w($,k.prototype),$.isPureReactComponent=!0;var R=Array.isArray;function T(){}var A={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function j(Y,Z,O){var W=O.ref;return{$$typeof:e,type:Y,key:Z,ref:W!==void 0?W:null,props:O}}function I(Y,Z){return j(Y.type,Z,Y.props)}function P(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function L(Y){var Z={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(O){return Z[O]})}var H=/\/+/g;function M(Y,Z){return typeof Y=="object"&&Y!==null&&Y.key!=null?L(""+Y.key):Z.toString(36)}function V(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(T,T):(Y.status="pending",Y.then(function(Z){Y.status==="pending"&&(Y.status="fulfilled",Y.value=Z)},function(Z){Y.status==="pending"&&(Y.status="rejected",Y.reason=Z)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function B(Y,Z,O,W,K){var Q=typeof Y;(Q==="undefined"||Q==="boolean")&&(Y=null);var ae=!1;if(Y===null)ae=!0;else switch(Q){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(Y.$$typeof){case e:case r:ae=!0;break;case u:return ae=Y._init,B(ae(Y._payload),Z,O,W,K)}}if(ae)return K=K(Y),ae=W===""?"."+M(Y,0):W,R(K)?(O="",ae!=null&&(O=ae.replace(H,"$&/")+"/"),B(K,Z,O,"",function(ue){return ue})):K!=null&&(P(K)&&(K=I(K,O+(K.key==null||Y&&Y.key===K.key?"":(""+K.key).replace(H,"$&/")+"/")+ae)),Z.push(K)),1;ae=0;var te=W===""?".":W+":";if(R(Y))for(var re=0;re"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),Q6.exports=Hge(),Q6.exports}var Vi=GN();const YN=LN(Vi);function ir(e,r,n){const o=typeof r=="symbol"?r:Symbol.for(r);return e.hasOwnProperty(o)||Object.defineProperty(e,o,{enumerable:!1,writable:!1,value:n()}),e[o]}function J6(e){if(e===null||typeof e!="object")return!1;const r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function e_(e,r,n=".",o){if(!J6(r))return e_(e,{},n);const a=Object.assign({},r);for(const i in e){if(i==="__proto__"||i==="constructor")continue;const l=e[i];l!=null&&(Array.isArray(l)&&Array.isArray(a[i])?a[i]=[...l,...a[i]]:J6(l)&&J6(a[i])?a[i]=e_(l,a[i],(n?`${n}.`:"")+i.toString()):a[i]=l)}return a}function Uge(e){return(...r)=>r.reduce((n,o)=>e_(n,o,""),{})}const XN=Uge();function Wge(e,r,n){let o=a=>e(a,...r);return n===void 0?o:Object.assign(o,{lazy:n,lazyArgs:r})}function io(e,r,n){let o=e.length-r.length;if(o===0)return e(...r);if(o===1)return Wge(e,r,n);throw Error("Wrong number of arguments")}function Ll(...e){return io(Gge,e)}const Gge=(e,r)=>e.length>=r;function mt(e,r){if(typeof e>"u"||e==null){const n=typeof r=="function"?r():r;throw new Error(n??`Expected defined value, but received ${e}`)}return e}function He(e,r){if(!e)throw new Error(r??"Invariant failed")}function Qo(e){throw new Error(`NonExhaustive value: ${e}`)}function Yge(...e){return io(Xge,e)}function Xge(e,r){let n={};for(let[o,a]of e.entries())n[a]=r(a,o,e);return n}function yb(...e){return io(Zg,e)}function Zg(e,r){if(e===r||Object.is(e,r))return!0;if(typeof e!="object"||typeof r!="object"||e===null||r===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(r))return!1;if(Array.isArray(e))return Zge(e,r);if(e instanceof Map)return Kge(e,r);if(e instanceof Set)return Qge(e,r);if(e instanceof Date)return e.getTime()===r.getTime();if(e instanceof RegExp)return e.toString()===r.toString();if(Object.keys(e).length!==Object.keys(r).length)return!1;for(let[n,o]of Object.entries(e))if(!(n in r)||!Zg(o,r[n]))return!1;return!0}function Zge(e,r){if(e.length!==r.length)return!1;for(let[n,o]of e.entries())if(!Zg(o,r[n]))return!1;return!0}function Kge(e,r){if(e.size!==r.size)return!1;for(let[n,o]of e.entries())if(!r.has(n)||!Zg(o,r.get(n)))return!1;return!0}function Qge(e,r){if(e.size!==r.size)return!1;let n=[...r];for(let o of e){let a=!1;for(let[i,l]of n.entries())if(Zg(o,l)){a=!0,n.splice(i,1);break}if(!a)return!1}return!0}const{min:Jge,max:e1e}=Math,Au=(e,r=0,n=1)=>Jge(e1e(r,e),n),t_=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let r=0;r<=3;r++)r<3?((e[r]<0||e[r]>255)&&(e._clipped=!0),e[r]=Au(e[r],0,255)):r===3&&(e[r]=Au(e[r],0,1));return e},ZN={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])ZN[`[object ${e}]`]=e.toLowerCase();function Ft(e){return ZN[Object.prototype.toString.call(e)]||"object"}const jt=(e,r=null)=>e.length>=3?Array.prototype.slice.call(e):Ft(e[0])=="object"&&r?r.split("").filter(n=>e[0][n]!==void 0).map(n=>e[0][n]):e[0].slice(0),Rh=e=>{if(e.length<2)return null;const r=e.length-1;return Ft(e[r])=="string"?e[r].toLowerCase():null},{PI:vb,min:KN,max:QN}=Math,Za=e=>Math.round(e*100)/100,r_=e=>Math.round(e*100)/100,As=vb*2,n_=vb/3,t1e=vb/180,r1e=180/vb;function JN(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}const Rt={format:{},autodetect:[]};let Ne=class{constructor(...r){const n=this;if(Ft(r[0])==="object"&&r[0].constructor&&r[0].constructor===this.constructor)return r[0];let o=Rh(r),a=!1;if(!o){a=!0,Rt.sorted||(Rt.autodetect=Rt.autodetect.sort((i,l)=>l.p-i.p),Rt.sorted=!0);for(let i of Rt.autodetect)if(o=i.test(...r),o)break}if(Rt.format[o]){const i=Rt.format[o].apply(null,a?r:r.slice(0,-1));n._rgb=t_(i)}else throw new Error("unknown format: "+r);n._rgb.length===3&&n._rgb.push(1)}toString(){return Ft(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const n1e="3.2.0",zt=(...e)=>new Ne(...e);zt.version=n1e;const zh={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o1e=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,a1e=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,eP=e=>{if(e.match(o1e)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const r=parseInt(e,16),n=r>>16,o=r>>8&255,a=r&255;return[n,o,a,1]}if(e.match(a1e)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const r=parseInt(e,16),n=r>>24&255,o=r>>16&255,a=r>>8&255,i=Math.round((r&255)/255*100)/100;return[n,o,a,i]}throw new Error(`unknown hex color: ${e}`)},{round:bb}=Math,tP=(...e)=>{let[r,n,o,a]=jt(e,"rgba"),i=Rh(e)||"auto";a===void 0&&(a=1),i==="auto"&&(i=a<1?"rgba":"rgb"),r=bb(r),n=bb(n),o=bb(o);let s="000000"+(r<<16|n<<8|o).toString(16);s=s.substr(s.length-6);let c="0"+bb(a*255).toString(16);switch(c=c.substr(c.length-2),i.toLowerCase()){case"rgba":return`#${s}${c}`;case"argb":return`#${c}${s}`;default:return`#${s}`}};Ne.prototype.name=function(){const e=tP(this._rgb,"rgb");for(let r of Object.keys(zh))if(zh[r]===e)return r.toLowerCase();return e},Rt.format.named=e=>{if(e=e.toLowerCase(),zh[e])return eP(zh[e]);throw new Error("unknown color name: "+e)},Rt.autodetect.push({p:5,test:(e,...r)=>{if(!r.length&&Ft(e)==="string"&&zh[e.toLowerCase()])return"named"}}),Ne.prototype.alpha=function(e,r=!1){return e!==void 0&&Ft(e)==="number"?r?(this._rgb[3]=e,this):new Ne([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},Ne.prototype.clipped=function(){return this._rgb._clipped||!1};const Fl={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},i1e=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Ds(e){const r=i1e.get(String(e).toLowerCase());if(!r)throw new Error("unknown Lab illuminant "+e);Fl.labWhitePoint=e,Fl.Xn=r[0],Fl.Zn=r[1]}function Kg(){return Fl.labWhitePoint}const o_=(...e)=>{e=jt(e,"lab");const[r,n,o]=e,[a,i,l]=l1e(r,n,o),[s,c,d]=rP(a,i,l);return[s,c,d,e.length>3?e[3]:1]},l1e=(e,r,n)=>{const{kE:o,kK:a,kKE:i,Xn:l,Yn:s,Zn:c}=Fl,d=(e+16)/116,u=.002*r+d,p=d-.005*n,f=u*u*u,g=p*p*p,v=f>o?f:(116*u-16)/a,w=e>i?Math.pow((e+16)/116,3):e/a,x=g>o?g:(116*p-16)/a,k=v*l,C=w*s,_=x*c;return[k,C,_]},a_=e=>{const r=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055)*r},rP=(e,r,n)=>{const{MtxAdaptMa:o,MtxAdaptMaI:a,MtxXYZ2RGB:i,RefWhiteRGB:l,Xn:s,Yn:c,Zn:d}=Fl,u=s*o.m00+c*o.m10+d*o.m20,p=s*o.m01+c*o.m11+d*o.m21,f=s*o.m02+c*o.m12+d*o.m22,g=l.X*o.m00+l.Y*o.m10+l.Z*o.m20,v=l.X*o.m01+l.Y*o.m11+l.Z*o.m21,w=l.X*o.m02+l.Y*o.m12+l.Z*o.m22,x=(e*o.m00+r*o.m10+n*o.m20)*(g/u),k=(e*o.m01+r*o.m11+n*o.m21)*(v/p),C=(e*o.m02+r*o.m12+n*o.m22)*(w/f),_=x*a.m00+k*a.m10+C*a.m20,$=x*a.m01+k*a.m11+C*a.m21,R=x*a.m02+k*a.m12+C*a.m22,T=a_(_*i.m00+$*i.m10+R*i.m20),A=a_(_*i.m01+$*i.m11+R*i.m21),z=a_(_*i.m02+$*i.m12+R*i.m22);return[T*255,A*255,z*255]},i_=(...e)=>{const[r,n,o,...a]=jt(e,"rgb"),[i,l,s]=nP(r,n,o),[c,d,u]=s1e(i,l,s);return[c,d,u,...a.length>0&&a[0]<1?[a[0]]:[]]};function s1e(e,r,n){const{Xn:o,Yn:a,Zn:i,kE:l,kK:s}=Fl,c=e/o,d=r/a,u=n/i,p=c>l?Math.pow(c,1/3):(s*c+16)/116,f=d>l?Math.pow(d,1/3):(s*d+16)/116,g=u>l?Math.pow(u,1/3):(s*u+16)/116;return[116*f-16,500*(p-f),200*(f-g)]}function l_(e){const r=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4))*r}const nP=(e,r,n)=>{e=l_(e/255),r=l_(r/255),n=l_(n/255);const{MtxRGB2XYZ:o,MtxAdaptMa:a,MtxAdaptMaI:i,Xn:l,Yn:s,Zn:c,As:d,Bs:u,Cs:p}=Fl;let f=e*o.m00+r*o.m10+n*o.m20,g=e*o.m01+r*o.m11+n*o.m21,v=e*o.m02+r*o.m12+n*o.m22;const w=l*a.m00+s*a.m10+c*a.m20,x=l*a.m01+s*a.m11+c*a.m21,k=l*a.m02+s*a.m12+c*a.m22;let C=f*a.m00+g*a.m10+v*a.m20,_=f*a.m01+g*a.m11+v*a.m21,$=f*a.m02+g*a.m12+v*a.m22;return C*=w/d,_*=x/u,$*=k/p,f=C*i.m00+_*i.m10+$*i.m20,g=C*i.m01+_*i.m11+$*i.m21,v=C*i.m02+_*i.m12+$*i.m22,[f,g,v]};Ne.prototype.lab=function(){return i_(this._rgb)},Object.assign(zt,{lab:(...e)=>new Ne(...e,"lab"),getLabWhitePoint:Kg,setLabWhitePoint:Ds}),Rt.format.lab=o_,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"lab"),Ft(e)==="array"&&e.length===3)return"lab"}}),Ne.prototype.darken=function(e=1){const r=this,n=r.lab();return n[0]-=Fl.Kn*e,new Ne(n,"lab").alpha(r.alpha(),!0)},Ne.prototype.brighten=function(e=1){return this.darken(-e)},Ne.prototype.darker=Ne.prototype.darken,Ne.prototype.brighter=Ne.prototype.brighten,Ne.prototype.get=function(e){const[r,n]=e.split("."),o=this[r]();if(n){const a=r.indexOf(n)-(r.substr(0,2)==="ok"?2:0);if(a>-1)return o[a];throw new Error(`unknown channel ${n} in mode ${r}`)}else return o};const{pow:c1e}=Math,d1e=1e-7,u1e=20;Ne.prototype.luminance=function(e,r="rgb"){if(e!==void 0&&Ft(e)==="number"){if(e===0)return new Ne([0,0,0,this._rgb[3]],"rgb");if(e===1)return new Ne([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),o=u1e;const a=(l,s)=>{const c=l.interpolate(s,.5,r),d=c.luminance();return Math.abs(e-d)e?a(l,c):a(c,s)},i=(n>e?a(new Ne([0,0,0]),this):a(this,new Ne([255,255,255]))).rgb();return new Ne([...i,this._rgb[3]])}return p1e(...this._rgb.slice(0,3))};const p1e=(e,r,n)=>(e=s_(e),r=s_(r),n=s_(n),.2126*e+.7152*r+.0722*n),s_=e=>(e/=255,e<=.03928?e/12.92:c1e((e+.055)/1.055,2.4)),bo={},Th=(e,r,n=.5,...o)=>{let a=o[0]||"lrgb";if(!bo[a]&&!o.length&&(a=Object.keys(bo)[0]),!bo[a])throw new Error(`interpolation mode ${a} is not defined`);return Ft(e)!=="object"&&(e=new Ne(e)),Ft(r)!=="object"&&(r=new Ne(r)),bo[a](e,r,n).alpha(e.alpha()+n*(r.alpha()-e.alpha()))};Ne.prototype.mix=Ne.prototype.interpolate=function(e,r=.5,...n){return Th(this,e,r,...n)},Ne.prototype.premultiply=function(e=!1){const r=this._rgb,n=r[3];return e?(this._rgb=[r[0]*n,r[1]*n,r[2]*n,n],this):new Ne([r[0]*n,r[1]*n,r[2]*n,n],"rgb")};const{sin:h1e,cos:f1e}=Math,oP=(...e)=>{let[r,n,o]=jt(e,"lch");return isNaN(o)&&(o=0),o=o*t1e,[r,f1e(o)*n,h1e(o)*n]},c_=(...e)=>{e=jt(e,"lch");const[r,n,o]=e,[a,i,l]=oP(r,n,o),[s,c,d]=o_(a,i,l);return[s,c,d,e.length>3?e[3]:1]},m1e=(...e)=>{const r=JN(jt(e,"hcl"));return c_(...r)},{sqrt:g1e,atan2:y1e,round:v1e}=Math,aP=(...e)=>{const[r,n,o]=jt(e,"lab"),a=g1e(n*n+o*o);let i=(y1e(o,n)*r1e+360)%360;return v1e(a*1e4)===0&&(i=Number.NaN),[r,a,i]},d_=(...e)=>{const[r,n,o,...a]=jt(e,"rgb"),[i,l,s]=i_(r,n,o),[c,d,u]=aP(i,l,s);return[c,d,u,...a.length>0&&a[0]<1?[a[0]]:[]]};Ne.prototype.lch=function(){return d_(this._rgb)},Ne.prototype.hcl=function(){return JN(d_(this._rgb))},Object.assign(zt,{lch:(...e)=>new Ne(...e,"lch"),hcl:(...e)=>new Ne(...e,"hcl")}),Rt.format.lch=c_,Rt.format.hcl=m1e,["lch","hcl"].forEach(e=>Rt.autodetect.push({p:2,test:(...r)=>{if(r=jt(r,e),Ft(r)==="array"&&r.length===3)return e}})),Ne.prototype.saturate=function(e=1){const r=this,n=r.lch();return n[1]+=Fl.Kn*e,n[1]<0&&(n[1]=0),new Ne(n,"lch").alpha(r.alpha(),!0)},Ne.prototype.desaturate=function(e=1){return this.saturate(-e)},Ne.prototype.set=function(e,r,n=!1){const[o,a]=e.split("."),i=this[o]();if(a){const l=o.indexOf(a)-(o.substr(0,2)==="ok"?2:0);if(l>-1){if(Ft(r)=="string")switch(r.charAt(0)){case"+":i[l]+=+r;break;case"-":i[l]+=+r;break;case"*":i[l]*=+r.substr(1);break;case"/":i[l]/=+r.substr(1);break;default:i[l]=+r}else if(Ft(r)==="number")i[l]=r;else throw new Error("unsupported value for Color.set");const s=new Ne(i,o);return n?(this._rgb=s._rgb,this):s}throw new Error(`unknown channel ${a} in mode ${o}`)}else return i},Ne.prototype.tint=function(e=.5,...r){return Th(this,"white",e,...r)},Ne.prototype.shade=function(e=.5,...r){return Th(this,"black",e,...r)};const b1e=(e,r,n)=>{const o=e._rgb,a=r._rgb;return new Ne(o[0]+n*(a[0]-o[0]),o[1]+n*(a[1]-o[1]),o[2]+n*(a[2]-o[2]),"rgb")};bo.rgb=b1e;const{sqrt:u_,pow:jh}=Math,x1e=(e,r,n)=>{const[o,a,i]=e._rgb,[l,s,c]=r._rgb;return new Ne(u_(jh(o,2)*(1-n)+jh(l,2)*n),u_(jh(a,2)*(1-n)+jh(s,2)*n),u_(jh(i,2)*(1-n)+jh(c,2)*n),"rgb")};bo.lrgb=x1e;const w1e=(e,r,n)=>{const o=e.lab(),a=r.lab();return new Ne(o[0]+n*(a[0]-o[0]),o[1]+n*(a[1]-o[1]),o[2]+n*(a[2]-o[2]),"lab")};bo.lab=w1e;const Ah=(e,r,n,o)=>{let a,i;o==="hsl"?(a=e.hsl(),i=r.hsl()):o==="hsv"?(a=e.hsv(),i=r.hsv()):o==="hcg"?(a=e.hcg(),i=r.hcg()):o==="hsi"?(a=e.hsi(),i=r.hsi()):o==="lch"||o==="hcl"?(o="hcl",a=e.hcl(),i=r.hcl()):o==="oklch"&&(a=e.oklch().reverse(),i=r.oklch().reverse());let l,s,c,d,u,p;(o.substr(0,1)==="h"||o==="oklch")&&([l,c,u]=a,[s,d,p]=i);let f,g,v,w;return!isNaN(l)&&!isNaN(s)?(s>l&&s-l>180?w=s-(l+360):s180?w=s+360-l:w=s-l,g=l+n*w):isNaN(l)?isNaN(s)?g=Number.NaN:(g=s,(u==1||u==0)&&o!="hsv"&&(f=d)):(g=l,(p==1||p==0)&&o!="hsv"&&(f=c)),f===void 0&&(f=c+n*(d-c)),v=u+n*(p-u),o==="oklch"?new Ne([v,f,g],o):new Ne([g,f,v],o)},iP=(e,r,n)=>Ah(e,r,n,"lch");bo.lch=iP,bo.hcl=iP;const k1e=e=>{if(Ft(e)=="number"&&e>=0&&e<=16777215){const r=e>>16,n=e>>8&255,o=e&255;return[r,n,o,1]}throw new Error("unknown num color: "+e)},_1e=(...e)=>{const[r,n,o]=jt(e,"rgb");return(r<<16)+(n<<8)+o};Ne.prototype.num=function(){return _1e(this._rgb)},Object.assign(zt,{num:(...e)=>new Ne(...e,"num")}),Rt.format.num=k1e,Rt.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&Ft(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return"num"}});const S1e=(e,r,n)=>{const o=e.num(),a=r.num();return new Ne(o+n*(a-o),"num")};bo.num=S1e;const{floor:E1e}=Math,C1e=(...e)=>{e=jt(e,"hcg");let[r,n,o]=e,a,i,l;o=o*255;const s=n*255;if(n===0)a=i=l=o;else{r===360&&(r=0),r>360&&(r-=360),r<0&&(r+=360),r/=60;const c=E1e(r),d=r-c,u=o*(1-n),p=u+s*(1-d),f=u+s*d,g=u+s;switch(c){case 0:[a,i,l]=[g,f,u];break;case 1:[a,i,l]=[p,g,u];break;case 2:[a,i,l]=[u,g,f];break;case 3:[a,i,l]=[u,p,g];break;case 4:[a,i,l]=[f,u,g];break;case 5:[a,i,l]=[g,u,p];break}}return[a,i,l,e.length>3?e[3]:1]},$1e=(...e)=>{const[r,n,o]=jt(e,"rgb"),a=KN(r,n,o),i=QN(r,n,o),l=i-a,s=l*100/255,c=a/(255-l)*100;let d;return l===0?d=Number.NaN:(r===i&&(d=(n-o)/l),n===i&&(d=2+(o-r)/l),o===i&&(d=4+(r-n)/l),d*=60,d<0&&(d+=360)),[d,s,c]};Ne.prototype.hcg=function(){return $1e(this._rgb)};const R1e=(...e)=>new Ne(...e,"hcg");zt.hcg=R1e,Rt.format.hcg=C1e,Rt.autodetect.push({p:1,test:(...e)=>{if(e=jt(e,"hcg"),Ft(e)==="array"&&e.length===3)return"hcg"}});const z1e=(e,r,n)=>Ah(e,r,n,"hcg");bo.hcg=z1e;const{cos:Dh}=Math,T1e=(...e)=>{e=jt(e,"hsi");let[r,n,o]=e,a,i,l;return isNaN(r)&&(r=0),isNaN(n)&&(n=0),r>360&&(r-=360),r<0&&(r+=360),r/=360,r<1/3?(l=(1-n)/3,a=(1+n*Dh(As*r)/Dh(n_-As*r))/3,i=1-(l+a)):r<2/3?(r-=1/3,a=(1-n)/3,i=(1+n*Dh(As*r)/Dh(n_-As*r))/3,l=1-(a+i)):(r-=2/3,i=(1-n)/3,l=(1+n*Dh(As*r)/Dh(n_-As*r))/3,a=1-(i+l)),a=Au(o*a*3),i=Au(o*i*3),l=Au(o*l*3),[a*255,i*255,l*255,e.length>3?e[3]:1]},{min:j1e,sqrt:A1e,acos:D1e}=Math,M1e=(...e)=>{let[r,n,o]=jt(e,"rgb");r/=255,n/=255,o/=255;let a;const i=j1e(r,n,o),l=(r+n+o)/3,s=l>0?1-i/l:0;return s===0?a=NaN:(a=(r-n+(r-o))/2,a/=A1e((r-n)*(r-n)+(r-o)*(n-o)),a=D1e(a),o>n&&(a=As-a),a/=As),[a*360,s,l]};Ne.prototype.hsi=function(){return M1e(this._rgb)};const N1e=(...e)=>new Ne(...e,"hsi");zt.hsi=N1e,Rt.format.hsi=T1e,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"hsi"),Ft(e)==="array"&&e.length===3)return"hsi"}});const P1e=(e,r,n)=>Ah(e,r,n,"hsi");bo.hsi=P1e;const p_=(...e)=>{e=jt(e,"hsl");const[r,n,o]=e;let a,i,l;if(n===0)a=i=l=o*255;else{const s=[0,0,0],c=[0,0,0],d=o<.5?o*(1+n):o+n-o*n,u=2*o-d,p=r/360;s[0]=p+1/3,s[1]=p,s[2]=p-1/3;for(let f=0;f<3;f++)s[f]<0&&(s[f]+=1),s[f]>1&&(s[f]-=1),6*s[f]<1?c[f]=u+(d-u)*6*s[f]:2*s[f]<1?c[f]=d:3*s[f]<2?c[f]=u+(d-u)*(2/3-s[f])*6:c[f]=u;[a,i,l]=[c[0]*255,c[1]*255,c[2]*255]}return e.length>3?[a,i,l,e[3]]:[a,i,l,1]},lP=(...e)=>{e=jt(e,"rgba");let[r,n,o]=e;r/=255,n/=255,o/=255;const a=KN(r,n,o),i=QN(r,n,o),l=(i+a)/2;let s,c;return i===a?(s=0,c=Number.NaN):s=l<.5?(i-a)/(i+a):(i-a)/(2-i-a),r==i?c=(n-o)/(i-a):n==i?c=2+(o-r)/(i-a):o==i&&(c=4+(r-n)/(i-a)),c*=60,c<0&&(c+=360),e.length>3&&e[3]!==void 0?[c,s,l,e[3]]:[c,s,l]};Ne.prototype.hsl=function(){return lP(this._rgb)};const B1e=(...e)=>new Ne(...e,"hsl");zt.hsl=B1e,Rt.format.hsl=p_,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"hsl"),Ft(e)==="array"&&e.length===3)return"hsl"}});const I1e=(e,r,n)=>Ah(e,r,n,"hsl");bo.hsl=I1e;const{floor:O1e}=Math,L1e=(...e)=>{e=jt(e,"hsv");let[r,n,o]=e,a,i,l;if(o*=255,n===0)a=i=l=o;else{r===360&&(r=0),r>360&&(r-=360),r<0&&(r+=360),r/=60;const s=O1e(r),c=r-s,d=o*(1-n),u=o*(1-n*c),p=o*(1-n*(1-c));switch(s){case 0:[a,i,l]=[o,p,d];break;case 1:[a,i,l]=[u,o,d];break;case 2:[a,i,l]=[d,o,p];break;case 3:[a,i,l]=[d,u,o];break;case 4:[a,i,l]=[p,d,o];break;case 5:[a,i,l]=[o,d,u];break}}return[a,i,l,e.length>3?e[3]:1]},{min:F1e,max:V1e}=Math,q1e=(...e)=>{e=jt(e,"rgb");let[r,n,o]=e;const a=F1e(r,n,o),i=V1e(r,n,o),l=i-a;let s,c,d;return d=i/255,i===0?(s=Number.NaN,c=0):(c=l/i,r===i&&(s=(n-o)/l),n===i&&(s=2+(o-r)/l),o===i&&(s=4+(r-n)/l),s*=60,s<0&&(s+=360)),[s,c,d]};Ne.prototype.hsv=function(){return q1e(this._rgb)};const H1e=(...e)=>new Ne(...e,"hsv");zt.hsv=H1e,Rt.format.hsv=L1e,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"hsv"),Ft(e)==="array"&&e.length===3)return"hsv"}});const U1e=(e,r,n)=>Ah(e,r,n,"hsv");bo.hsv=U1e;function xb(e,r){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(r[0])||(r=r.map(l=>[l]));let o=r[0].length,a=r[0].map((l,s)=>r.map(c=>c[s])),i=e.map(l=>a.map(s=>Array.isArray(l)?l.reduce((c,d,u)=>c+d*(s[u]||0),0):s.reduce((c,d)=>c+d*l,0)));return n===1&&(i=i[0]),o===1?i.map(l=>l[0]):i}const h_=(...e)=>{e=jt(e,"lab");const[r,n,o,...a]=e,[i,l,s]=W1e([r,n,o]),[c,d,u]=rP(i,l,s);return[c,d,u,...a.length>0&&a[0]<1?[a[0]]:[]]};function W1e(e){var r=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],o=xb(n,e);return xb(r,o.map(a=>a**3))}const f_=(...e)=>{const[r,n,o,...a]=jt(e,"rgb"),i=nP(r,n,o);return[...G1e(i),...a.length>0&&a[0]<1?[a[0]]:[]]};function G1e(e){const r=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],o=xb(r,e);return xb(n,o.map(a=>Math.cbrt(a)))}Ne.prototype.oklab=function(){return f_(this._rgb)},Object.assign(zt,{oklab:(...e)=>new Ne(...e,"oklab")}),Rt.format.oklab=h_,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"oklab"),Ft(e)==="array"&&e.length===3)return"oklab"}});const Y1e=(e,r,n)=>{const o=e.oklab(),a=r.oklab();return new Ne(o[0]+n*(a[0]-o[0]),o[1]+n*(a[1]-o[1]),o[2]+n*(a[2]-o[2]),"oklab")};bo.oklab=Y1e;const X1e=(e,r,n)=>Ah(e,r,n,"oklch");bo.oklch=X1e;const{pow:m_,sqrt:g_,PI:y_,cos:sP,sin:cP,atan2:Z1e}=Math,K1e=(e,r="lrgb",n=null)=>{const o=e.length;n||(n=Array.from(new Array(o)).map(()=>1));const a=o/n.reduce(function(p,f){return p+f});if(n.forEach((p,f)=>{n[f]*=a}),e=e.map(p=>new Ne(p)),r==="lrgb")return Q1e(e,n);const i=e.shift(),l=i.get(r),s=[];let c=0,d=0;for(let p=0;p{const g=p.get(r);u+=p.alpha()*n[f+1];for(let v=0;v=360;)f-=360;l[p]=f}else l[p]=l[p]/s[p];return u/=o,new Ne(l,r).alpha(u>.99999?1:u,!0)},Q1e=(e,r)=>{const n=e.length,o=[0,0,0,0];for(let a=0;a.9999999&&(o[3]=1),new Ne(t_(o))},{pow:J1e}=Math;function wb(e){let r="rgb",n=zt("#ccc"),o=0,a=[0,1],i=[0,1],l=[],s=[0,0],c=!1,d=[],u=!1,p=0,f=1,g=!1,v={},w=!0,x=1;const k=function(z){if(z=z||["#fff","#000"],z&&Ft(z)==="string"&&zt.brewer&&zt.brewer[z.toLowerCase()]&&(z=zt.brewer[z.toLowerCase()]),Ft(z)==="array"){z.length===1&&(z=[z[0],z[0]]),z=z.slice(0);for(let j=0;j=c[I];)I++;return I-1}return 0};let _=z=>z,$=z=>z;const R=function(z,j){let I,P;if(j==null&&(j=!1),isNaN(z)||z===null)return n;j?P=z:c&&c.length>2?P=C(z)/(c.length-2):f!==p?P=(z-p)/(f-p):P=1,P=$(P),j||(P=_(P)),x!==1&&(P=J1e(P,x)),P=s[0]+P*(1-s[0]-s[1]),P=Au(P,0,1);const L=Math.floor(P*1e4);if(w&&v[L])I=v[L];else{if(Ft(d)==="array")for(let H=0;H=M&&H===l.length-1){I=d[H];break}if(P>M&&Pv={};k(e);const A=function(z){const j=zt(R(z));return u&&j[u]?j[u]():j};return A.classes=function(z){if(z!=null){if(Ft(z)==="array")c=z,a=[z[0],z[z.length-1]];else{const j=zt.analyze(a);z===0?c=[j.min,j.max]:c=zt.limits(j,"e",z)}return A}return c},A.domain=function(z){if(!arguments.length)return i;i=z.slice(0),p=z[0],f=z[z.length-1],l=[];const j=d.length;if(z.length===j&&p!==f)for(let I of Array.from(z))l.push((I-p)/(f-p));else{for(let I=0;I2){const I=z.map((L,H)=>H/(z.length-1)),P=z.map(L=>(L-p)/(f-p));P.every((L,H)=>I[H]===L)||($=L=>{if(L<=0||L>=1)return L;let H=0;for(;L>=P[H+1];)H++;const M=(L-P[H])/(P[H+1]-P[H]);return I[H]+M*(I[H+1]-I[H])})}}return a=[p,f],A},A.mode=function(z){return arguments.length?(r=z,T(),A):r},A.range=function(z,j){return k(z),A},A.out=function(z){return u=z,A},A.spread=function(z){return arguments.length?(o=z,A):o},A.correctLightness=function(z){return z==null&&(z=!0),g=z,T(),g?_=function(j){const I=R(0,!0).lab()[0],P=R(1,!0).lab()[0],L=I>P;let H=R(j,!0).lab()[0];const M=I+(P-I)*j;let V=H-M,B=0,F=1,q=20;for(;Math.abs(V)>.01&&q-- >0;)(function(){return L&&(V*=-1),V<0?(B=j,j+=(F-j)*.5):(F=j,j+=(B-j)*.5),H=R(j,!0).lab()[0],V=H-M})();return j}:_=j=>j,A},A.padding=function(z){return z!=null?(Ft(z)==="number"&&(z=[z,z]),s=z,A):s},A.colors=function(z,j){arguments.length<2&&(j="hex");let I=[];if(arguments.length===0)I=d.slice(0);else if(z===1)I=[A(.5)];else if(z>1){const P=a[0],L=a[1]-P;I=eye(0,z).map(H=>A(P+H/(z-1)*L))}else{e=[];let P=[];if(c&&c.length>2)for(let L=1,H=c.length,M=1<=H;M?LH;M?L++:L--)P.push((c[L-1]+c[L])*.5);else P=a;I=P.map(L=>A(L))}return zt[j]&&(I=I.map(P=>P[j]())),I},A.cache=function(z){return z!=null?(w=z,A):w},A.gamma=function(z){return z!=null?(x=z,A):x},A.nodata=function(z){return z!=null?(n=zt(z),A):n},A}function eye(e,r,n){let o=[],a=ei;a?l++:l--)o.push(l);return o}const tye=function(e){let r=[1,1];for(let n=1;nnew Ne(i)),e.length===2)[n,o]=e.map(i=>i.lab()),r=function(i){const l=[0,1,2].map(s=>n[s]+i*(o[s]-n[s]));return new Ne(l,"lab")};else if(e.length===3)[n,o,a]=e.map(i=>i.lab()),r=function(i){const l=[0,1,2].map(s=>(1-i)*(1-i)*n[s]+2*(1-i)*i*o[s]+i*i*a[s]);return new Ne(l,"lab")};else if(e.length===4){let i;[n,o,a,i]=e.map(l=>l.lab()),r=function(l){const s=[0,1,2].map(c=>(1-l)*(1-l)*(1-l)*n[c]+3*(1-l)*(1-l)*l*o[c]+3*(1-l)*l*l*a[c]+l*l*l*i[c]);return new Ne(s,"lab")}}else if(e.length>=5){let i,l,s;i=e.map(c=>c.lab()),s=e.length-1,l=tye(s),r=function(c){const d=1-c,u=[0,1,2].map(p=>i.reduce((f,g,v)=>f+l[v]*d**(s-v)*c**v*g[p],0));return new Ne(u,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return r},nye=e=>{const r=rye(e);return r.scale=()=>wb(r),r},{round:dP}=Math;Ne.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(dP)},Ne.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((r,n)=>n<3?e===!1?r:dP(r):r)},Object.assign(zt,{rgb:(...e)=>new Ne(...e,"rgb")}),Rt.format.rgb=(...e)=>{const r=jt(e,"rgba");return r[3]===void 0&&(r[3]=1),r},Rt.autodetect.push({p:3,test:(...e)=>{if(e=jt(e,"rgba"),Ft(e)==="array"&&(e.length===3||e.length===4&&Ft(e[3])=="number"&&e[3]>=0&&e[3]<=1))return"rgb"}});const qi=(e,r,n)=>{if(!qi[n])throw new Error("unknown blend mode "+n);return qi[n](e,r)},Zc=e=>(r,n)=>{const o=zt(n).rgb(),a=zt(r).rgb();return zt.rgb(e(o,a))},Kc=e=>(r,n)=>{const o=[];return o[0]=e(r[0],n[0]),o[1]=e(r[1],n[1]),o[2]=e(r[2],n[2]),o},oye=e=>e,aye=(e,r)=>e*r/255,iye=(e,r)=>e>r?r:e,lye=(e,r)=>e>r?e:r,sye=(e,r)=>255*(1-(1-e/255)*(1-r/255)),cye=(e,r)=>r<128?2*e*r/255:255*(1-2*(1-e/255)*(1-r/255)),dye=(e,r)=>255*(1-(1-r/255)/(e/255)),uye=(e,r)=>e===255?255:(e=255*(r/255)/(1-e/255),e>255?255:e);qi.normal=Zc(Kc(oye)),qi.multiply=Zc(Kc(aye)),qi.screen=Zc(Kc(sye)),qi.overlay=Zc(Kc(cye)),qi.darken=Zc(Kc(iye)),qi.lighten=Zc(Kc(lye)),qi.dodge=Zc(Kc(uye)),qi.burn=Zc(Kc(dye));const{pow:pye,sin:hye,cos:fye}=Math;function mye(e=300,r=-1.5,n=1,o=1,a=[0,1]){let i=0,l;Ft(a)==="array"?l=a[1]-a[0]:(l=0,a=[a,a]);const s=function(c){const d=As*((e+120)/360+r*c),u=pye(a[0]+l*c,o),f=(i!==0?n[0]+c*i:n)*u*(1-u)/2,g=fye(d),v=hye(d),w=u+f*(-.14861*g+1.78277*v),x=u+f*(-.29227*g-.90649*v),k=u+f*(1.97294*g);return zt(t_([w*255,x*255,k*255,1]))};return s.start=function(c){return c==null?e:(e=c,s)},s.rotations=function(c){return c==null?r:(r=c,s)},s.gamma=function(c){return c==null?o:(o=c,s)},s.hue=function(c){return c==null?n:(n=c,Ft(n)==="array"?(i=n[1]-n[0],i===0&&(n=n[1])):i=0,s)},s.lightness=function(c){return c==null?a:(Ft(c)==="array"?(a=c,l=c[1]-c[0]):(a=[c,c],l=0),s)},s.scale=()=>zt.scale(s),s.hue(n),s}const gye="0123456789abcdef",{floor:yye,random:vye}=Math,bye=(e=vye)=>{let r="#";for(let n=0;n<6;n++)r+=gye.charAt(yye(e()*16));return new Ne(r,"hex")},{log:uP,pow:xye,floor:wye,abs:kye}=Math;function pP(e,r=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Ft(e)==="object"&&(e=Object.values(e)),e.forEach(o=>{r&&Ft(o)==="object"&&(o=o[r]),o!=null&&!isNaN(o)&&(n.values.push(o),n.sum+=o,on.max&&(n.max=o),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(o,a)=>hP(n,o,a),n}function hP(e,r="equal",n=7){Ft(e)=="array"&&(e=pP(e));const{min:o,max:a}=e,i=e.values.sort((s,c)=>s-c);if(n===1)return[o,a];const l=[];if(r.substr(0,1)==="c"&&(l.push(o),l.push(a)),r.substr(0,1)==="e"){l.push(o);for(let s=1;s 0");const s=Math.LOG10E*uP(o),c=Math.LOG10E*uP(a);l.push(o);for(let d=1;d200&&(p=!1)}const v={};for(let x=0;xx-k),l.push(w[0]);for(let x=1;x{e=new Ne(e),r=new Ne(r);const n=e.luminance(),o=r.luminance();return n>o?(n+.05)/(o+.05):(o+.05)/(n+.05)};const fP=.027,Sye=5e-4,Eye=.1,mP=1.14,kb=.022,gP=1.414,Cye=(e,r)=>{e=new Ne(e),r=new Ne(r),e.alpha()<1&&(e=Th(r,e,e.alpha(),"rgb"));const n=yP(...e.rgb()),o=yP(...r.rgb()),a=n>=kb?n:n+Math.pow(kb-n,gP),i=o>=kb?o:o+Math.pow(kb-o,gP),l=Math.pow(i,.56)-Math.pow(a,.57),s=Math.pow(i,.65)-Math.pow(a,.62),c=Math.abs(i-a)0?c-fP:c+fP)*100};function yP(e,r,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(r/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:Ms,pow:yn,min:$ye,max:Rye,atan2:vP,abs:bP,cos:_b,sin:xP,exp:zye,PI:wP}=Math;function Tye(e,r,n=1,o=1,a=1){var i=function(O){return 360*O/(2*wP)},l=function(O){return 2*wP*O/360};e=new Ne(e),r=new Ne(r);const[s,c,d]=Array.from(e.lab()),[u,p,f]=Array.from(r.lab()),g=(s+u)/2,v=Ms(yn(c,2)+yn(d,2)),w=Ms(yn(p,2)+yn(f,2)),x=(v+w)/2,k=.5*(1-Ms(yn(x,7)/(yn(x,7)+yn(25,7)))),C=c*(1+k),_=p*(1+k),$=Ms(yn(C,2)+yn(d,2)),R=Ms(yn(_,2)+yn(f,2)),T=($+R)/2,A=i(vP(d,C)),z=i(vP(f,_)),j=A>=0?A:A+360,I=z>=0?z:z+360,P=bP(j-I)>180?(j+I+360)/2:(j+I)/2,L=1-.17*_b(l(P-30))+.24*_b(l(2*P))+.32*_b(l(3*P+6))-.2*_b(l(4*P-63));let H=I-j;H=bP(H)<=180?H:I<=j?H+360:H-360,H=2*Ms($*R)*xP(l(H)/2);const M=u-s,V=R-$,B=1+.015*yn(g-50,2)/Ms(20+yn(g-50,2)),F=1+.045*T,q=1+.015*T*L,G=30*zye(-yn((P-275)/25,2)),Y=-(2*Ms(yn(T,7)/(yn(T,7)+yn(25,7))))*xP(2*l(G)),Z=Ms(yn(M/(n*B),2)+yn(V/(o*F),2)+yn(H/(a*q),2)+Y*(V/(o*F))*(H/(a*q)));return Rye(0,$ye(100,Z))}function jye(e,r,n="lab"){e=new Ne(e),r=new Ne(r);const o=e.get(n),a=r.get(n);let i=0;for(let l in o){const s=(o[l]||0)-(a[l]||0);i+=s*s}return Math.sqrt(i)}const Aye=(...e)=>{try{return new Ne(...e),!0}catch{return!1}},Dye={cool(){return wb([zt.hsl(180,1,.9),zt.hsl(250,.7,.4)])},hot(){return wb(["#000","#f00","#ff0","#fff"]).mode("rgb")}},v_={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},kP=Object.keys(v_),_P=new Map(kP.map(e=>[e.toLowerCase(),e])),Mye=typeof Proxy=="function"?new Proxy(v_,{get(e,r){const n=r.toLowerCase();if(_P.has(n))return e[_P.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(kP)}}):v_,Nye=(...e)=>{e=jt(e,"cmyk");const[r,n,o,a]=e,i=e.length>4?e[4]:1;return a===1?[0,0,0,i]:[r>=1?0:255*(1-r)*(1-a),n>=1?0:255*(1-n)*(1-a),o>=1?0:255*(1-o)*(1-a),i]},{max:SP}=Math,Pye=(...e)=>{let[r,n,o]=jt(e,"rgb");r=r/255,n=n/255,o=o/255;const a=1-SP(r,SP(n,o)),i=a<1?1/(1-a):0,l=(1-r-a)*i,s=(1-n-a)*i,c=(1-o-a)*i;return[l,s,c,a]};Ne.prototype.cmyk=function(){return Pye(this._rgb)},Object.assign(zt,{cmyk:(...e)=>new Ne(...e,"cmyk")}),Rt.format.cmyk=Nye,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"cmyk"),Ft(e)==="array"&&e.length===4)return"cmyk"}});const Bye=(...e)=>{const r=jt(e,"hsla");let n=Rh(e)||"lsa";return r[0]=Za(r[0]||0)+"deg",r[1]=Za(r[1]*100)+"%",r[2]=Za(r[2]*100)+"%",n==="hsla"||r.length>3&&r[3]<1?(r[3]="/ "+(r.length>3?r[3]:1),n="hsla"):r.length=3,`${n.substr(0,3)}(${r.join(" ")})`},Iye=(...e)=>{const r=jt(e,"lab");let n=Rh(e)||"lab";return r[0]=Za(r[0])+"%",r[1]=Za(r[1]),r[2]=Za(r[2]),n==="laba"||r.length>3&&r[3]<1?r[3]="/ "+(r.length>3?r[3]:1):r.length=3,`lab(${r.join(" ")})`},Oye=(...e)=>{const r=jt(e,"lch");let n=Rh(e)||"lab";return r[0]=Za(r[0])+"%",r[1]=Za(r[1]),r[2]=isNaN(r[2])?"none":Za(r[2])+"deg",n==="lcha"||r.length>3&&r[3]<1?r[3]="/ "+(r.length>3?r[3]:1):r.length=3,`lch(${r.join(" ")})`},Lye=(...e)=>{const r=jt(e,"lab");return r[0]=Za(r[0]*100)+"%",r[1]=r_(r[1]),r[2]=r_(r[2]),r.length>3&&r[3]<1?r[3]="/ "+(r.length>3?r[3]:1):r.length=3,`oklab(${r.join(" ")})`},EP=(...e)=>{const[r,n,o,...a]=jt(e,"rgb"),[i,l,s]=f_(r,n,o),[c,d,u]=aP(i,l,s);return[c,d,u,...a.length>0&&a[0]<1?[a[0]]:[]]},Fye=(...e)=>{const r=jt(e,"lch");return r[0]=Za(r[0]*100)+"%",r[1]=r_(r[1]),r[2]=isNaN(r[2])?"none":Za(r[2])+"deg",r.length>3&&r[3]<1?r[3]="/ "+(r.length>3?r[3]:1):r.length=3,`oklch(${r.join(" ")})`},{round:b_}=Math,Vye=(...e)=>{const r=jt(e,"rgba");let n=Rh(e)||"rgb";if(n.substr(0,3)==="hsl")return Bye(lP(r),n);if(n.substr(0,3)==="lab"){const o=Kg();Ds("d50");const a=Iye(i_(r),n);return Ds(o),a}if(n.substr(0,3)==="lch"){const o=Kg();Ds("d50");const a=Oye(d_(r),n);return Ds(o),a}return n.substr(0,5)==="oklab"?Lye(f_(r)):n.substr(0,5)==="oklch"?Fye(EP(r)):(r[0]=b_(r[0]),r[1]=b_(r[1]),r[2]=b_(r[2]),(n==="rgba"||r.length>3&&r[3]<1)&&(r[3]="/ "+(r.length>3?r[3]:1),n="rgba"),`${n.substr(0,3)}(${r.slice(0,n==="rgb"?3:4).join(" ")})`)},CP=(...e)=>{e=jt(e,"lch");const[r,n,o,...a]=e,[i,l,s]=oP(r,n,o),[c,d,u]=h_(i,l,s);return[c,d,u,...a.length>0&&a[0]<1?[a[0]]:[]]},Ns=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,Hi=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Sb=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,Ka=/\s*/.source,Mh=/\s+/.source,x_=/\s*,\s*/.source,Eb=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Nh=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,$P=new RegExp("^rgba?\\("+Ka+[Ns,Ns,Ns].join(Mh)+Nh+"\\)$"),RP=new RegExp("^rgb\\("+Ka+[Ns,Ns,Ns].join(x_)+Ka+"\\)$"),zP=new RegExp("^rgba\\("+Ka+[Ns,Ns,Ns,Hi].join(x_)+Ka+"\\)$"),TP=new RegExp("^hsla?\\("+Ka+[Eb,Sb,Sb].join(Mh)+Nh+"\\)$"),jP=new RegExp("^hsl?\\("+Ka+[Eb,Sb,Sb].join(x_)+Ka+"\\)$"),AP=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,DP=new RegExp("^lab\\("+Ka+[Hi,Hi,Hi].join(Mh)+Nh+"\\)$"),MP=new RegExp("^lch\\("+Ka+[Hi,Hi,Eb].join(Mh)+Nh+"\\)$"),NP=new RegExp("^oklab\\("+Ka+[Hi,Hi,Hi].join(Mh)+Nh+"\\)$"),PP=new RegExp("^oklch\\("+Ka+[Hi,Hi,Eb].join(Mh)+Nh+"\\)$"),{round:BP}=Math,Ph=e=>e.map((r,n)=>n<=2?Au(BP(r),0,255):r),vn=(e,r=0,n=100,o=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,o?e=r+(e+1)*.5*(n-r):e=r+e*(n-r)),+e),Po=(e,r)=>e==="none"?r:e,w_=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let r;if(Rt.format.named)try{return Rt.format.named(e)}catch{}if((r=e.match($P))||(r=e.match(RP))){let n=r.slice(1,4);for(let a=0;a<3;a++)n[a]=+vn(Po(n[a],0),0,255);n=Ph(n);const o=r[4]!==void 0?+vn(r[4],0,1):1;return n[3]=o,n}if(r=e.match(zP)){const n=r.slice(1,5);for(let o=0;o<4;o++)n[o]=+vn(n[o],0,255);return n}if((r=e.match(TP))||(r=e.match(jP))){const n=r.slice(1,4);n[0]=+Po(n[0].replace("deg",""),0),n[1]=+vn(Po(n[1],0),0,100)*.01,n[2]=+vn(Po(n[2],0),0,100)*.01;const o=Ph(p_(n)),a=r[4]!==void 0?+vn(r[4],0,1):1;return o[3]=a,o}if(r=e.match(AP)){const n=r.slice(1,4);n[1]*=.01,n[2]*=.01;const o=p_(n);for(let a=0;a<3;a++)o[a]=BP(o[a]);return o[3]=+r[4],o}if(r=e.match(DP)){const n=r.slice(1,4);n[0]=vn(Po(n[0],0),0,100),n[1]=vn(Po(n[1],0),-125,125,!0),n[2]=vn(Po(n[2],0),-125,125,!0);const o=Kg();Ds("d50");const a=Ph(o_(n));Ds(o);const i=r[4]!==void 0?+vn(r[4],0,1):1;return a[3]=i,a}if(r=e.match(MP)){const n=r.slice(1,4);n[0]=vn(n[0],0,100),n[1]=vn(Po(n[1],0),0,150,!1),n[2]=+Po(n[2].replace("deg",""),0);const o=Kg();Ds("d50");const a=Ph(c_(n));Ds(o);const i=r[4]!==void 0?+vn(r[4],0,1):1;return a[3]=i,a}if(r=e.match(NP)){const n=r.slice(1,4);n[0]=vn(Po(n[0],0),0,1),n[1]=vn(Po(n[1],0),-.4,.4,!0),n[2]=vn(Po(n[2],0),-.4,.4,!0);const o=Ph(h_(n)),a=r[4]!==void 0?+vn(r[4],0,1):1;return o[3]=a,o}if(r=e.match(PP)){const n=r.slice(1,4);n[0]=vn(Po(n[0],0),0,1),n[1]=vn(Po(n[1],0),0,.4,!1),n[2]=+Po(n[2].replace("deg",""),0);const o=Ph(CP(n)),a=r[4]!==void 0?+vn(r[4],0,1):1;return o[3]=a,o}};w_.test=e=>$P.test(e)||TP.test(e)||DP.test(e)||MP.test(e)||NP.test(e)||PP.test(e)||RP.test(e)||zP.test(e)||jP.test(e)||AP.test(e)||e==="transparent",Ne.prototype.css=function(e){return Vye(this._rgb,e)};const qye=(...e)=>new Ne(...e,"css");zt.css=qye,Rt.format.css=w_,Rt.autodetect.push({p:5,test:(e,...r)=>{if(!r.length&&Ft(e)==="string"&&w_.test(e))return"css"}}),Rt.format.gl=(...e)=>{const r=jt(e,"rgba");return r[0]*=255,r[1]*=255,r[2]*=255,r};const Hye=(...e)=>new Ne(...e,"gl");zt.gl=Hye,Ne.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},Ne.prototype.hex=function(e){return tP(this._rgb,e)};const Uye=(...e)=>new Ne(...e,"hex");zt.hex=Uye,Rt.format.hex=eP,Rt.autodetect.push({p:4,test:(e,...r)=>{if(!r.length&&Ft(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:Cb}=Math,IP=e=>{const r=e/100;let n,o,a;return r<66?(n=255,o=r<6?0:-155.25485562709179-.44596950469579133*(o=r-2)+104.49216199393888*Cb(o),a=r<20?0:-254.76935184120902+.8274096064007395*(a=r-10)+115.67994401066147*Cb(a)):(n=351.97690566805693+.114206453784165*(n=r-55)-40.25366309332127*Cb(n),o=325.4494125711974+.07943456536662342*(o=r-50)-28.0852963507957*Cb(o),a=255),[n,o,a,1]},{round:Wye}=Math,Gye=(...e)=>{const r=jt(e,"rgb"),n=r[0],o=r[2];let a=1e3,i=4e4;const l=.4;let s;for(;i-a>l;){s=(i+a)*.5;const c=IP(s);c[2]/c[0]>=o/n?i=s:a=s}return Wye(s)};Ne.prototype.temp=Ne.prototype.kelvin=Ne.prototype.temperature=function(){return Gye(this._rgb)};const k_=(...e)=>new Ne(...e,"temp");Object.assign(zt,{temp:k_,kelvin:k_,temperature:k_}),Rt.format.temp=Rt.format.kelvin=Rt.format.temperature=IP,Ne.prototype.oklch=function(){return EP(this._rgb)},Object.assign(zt,{oklch:(...e)=>new Ne(...e,"oklch")}),Rt.format.oklch=CP,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"oklch"),Ft(e)==="array"&&e.length===3)return"oklch"}}),Object.assign(zt,{analyze:pP,average:K1e,bezier:nye,blend:qi,brewer:Mye,Color:Ne,colors:zh,contrast:_ye,contrastAPCA:Cye,cubehelix:mye,deltaE:Tye,distance:jye,input:Rt,interpolate:Th,limits:hP,mix:Th,random:bye,scale:wb,scales:Dye,valid:Aye});const __=[.96,.907,.805,.697,.605,.547,.518,.445,.395,.34],OP=[.32,.16,.08,.04,0,0,.04,.08,.16,.32];function Yye(e){const r=e.get("hsl.l");return __.reduce((n,o)=>Math.abs(o-r)i===n),a=__.map(i=>r.set("hsl.l",i)).map(i=>zt(i)).map((i,l)=>{const s=OP[l]-OP[o];return s>=0?i.saturate(s):i.desaturate(s*-1)});return a[o]=zt(e),{baseColorIndex:o,colors:a}}function Zye(e){return Xye(e).colors.map(r=>r.hex())}const LP={fill:"#3b82f6",stroke:"#2563eb",hiContrast:"#eff6ff",loContrast:"#bfdbfe"},FP={fill:"#0284c7",stroke:"#0369a1",hiContrast:"#f0f9ff",loContrast:"#B6ECF7"},VP={fill:"#64748b",stroke:"#475569",hiContrast:"#f8fafc",loContrast:"#cbd5e1"},Kye={primary:LP,blue:LP,secondary:FP,sky:FP,muted:VP,slate:VP,gray:{fill:"#737373",stroke:"#525252",hiContrast:"#fafafa",loContrast:"#d4d4d4"},red:{fill:"#AC4D39",stroke:"#853A2D",hiContrast:"#FBD3CB",loContrast:"#f5b2a3"},green:{fill:"#428a4f",stroke:"#2d5d39",hiContrast:"#f8fafc",loContrast:"#c2f0c2"},amber:{fill:"#A35829",stroke:"#7E451D",hiContrast:"#FFE0C2",loContrast:"#f9b27c"},indigo:{fill:"#6366f1",stroke:"#4f46e5",hiContrast:"#eef2ff",loContrast:"#c7d2fe"}},Qye={line:"#8D8D8D",labelBg:"#18191B",label:"#C9C9C9"},qP={line:"#64748b",labelBg:"#0f172a",label:"#cbd5e1"},HP={line:"#3b82f6",labelBg:"#172554",label:"#60a5fa"},UP={line:"#0ea5e9",labelBg:"#082f49",label:"#38bdf8"},Jye={amber:{line:"#b45309",labelBg:"#78350f",label:"#FFE0C2"},blue:HP,gray:Qye,green:{line:"#15803d",labelBg:"#052e16",label:"#22c55e"},indigo:{line:"#6366f1",labelBg:"#1e1b4b",label:"#818cf8"},muted:qP,primary:HP,red:{line:"#AC4D39",labelBg:"#b91c1c",label:"#f5b2a3"},secondary:UP,sky:UP,slate:qP},WP=60,GP=2,YP=1;function e0e(e){He(zt.valid(e),`Invalid color: ${e}`);const r=Zye(e),n=r[6],o=t0e(n);return{elements:{fill:n,stroke:r[7],hiContrast:o[0],loContrast:o[1]},relationships:{line:r[4],label:r[3],labelBg:r[9]}}}function t0e(e){const r=zt(e);let n=r.brighten(GP),o=r.darken(GP),a,i,l,s;do a=n,i=o,n=n.brighten(YP),o=o.darken(YP),l=zt.contrastAPCA(r,n),s=zt.contrastAPCA(r,o);while(Math.abs(l)Math.abs(s)?[n.brighten(.4).hex(),n.hex()]:[o.darken(.4).hex(),o.hex()]}const r0e={color:"primary",size:"md",opacity:15,shape:"rectangle",group:{opacity:15,border:"dashed"},relationship:{color:"gray",line:"dashed",arrow:"normal"}},n0e=["rectangle","person","browser","mobile","cylinder","storage","queue"],o0e={colors:Yge(["amber","blue","gray","slate","green","indigo","muted","primary","red","secondary","sky"],e=>({elements:Kye[e],relationships:Jye[e]})),sizes:{xs:{width:180,height:100},sm:{width:240,height:135},md:{width:320,height:180},lg:{width:420,height:234},xl:{width:520,height:290}},spacing:{xs:8,sm:10,md:16,lg:24,xl:32},textSizes:{xs:13.33,sm:16,md:19.2,lg:23.04,xl:27.65}};function $b({size:e,padding:r,textSize:n,...o},a=S_.defaults.size){return e??=a,n??=e,r??=e,{...o,size:e,padding:r,textSize:n}}const S_={theme:o0e,defaults:r0e};let XP=class ON{constructor(r){this.config=r,this.theme=r.theme,this.defaults=r.defaults}theme;defaults;static DEFAULT=new ON(S_);static from(...r){return Ll(r,1)?new ON(XN(...r,S_)):this.DEFAULT}get elementColors(){return this.theme.colors[this.defaults.color].elements}get relationshipColors(){return this.theme.colors[this.defaults.relationship.color].relationships}get groupColors(){const r=this.defaults.group?.color;return r?ir(this,"defaultGroup",()=>({...this.elementColors,...this.theme.colors[r].elements})):this.elementColors}isDefaultColor(r){return r===this.defaults.color}colors(r){if(r??=this.defaults.color,this.isThemeColor(r))return this.theme.colors[r];throw new Error(`Unknown color: ${r}`)}fontSize(r){return r??=this.defaults.text??this.defaults.size,this.theme.textSizes[r]}padding(r){return r??=this.defaults.padding??this.defaults.size,this.theme.spacing[r]}isThemeColor(r){return r in this.theme.colors}nodeSizes(r){const n=$b(r,this.defaults.size);return{sizes:n,values:{sizes:this.theme.sizes[n.size],padding:this.padding(n.padding),textSize:this.fontSize(n.textSize)}}}computeFrom(r){return this.isThemeColor(r)?this.theme.colors[r]:ir(this,`compute-${r}`,()=>{if(!zt.valid(r))throw new Error(`Invalid color value: "${r}"`);return e0e(r)})}equals(r){return r===this?!0:yb(this.config,r.config)}};function Qg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qc(e){return typeof e=="string"}const E_={done:!1,hasNext:!1};function Ps(e,...r){let n=e,o=r.map(i=>"lazy"in i?a0e(i):void 0),a=0;for(;a65;)++o;return+u.slice(p-1,o)}return f=c&&c.indexOf(u.charAt(p)),f>-1?f+76:(f=u.charCodeAt(p)||0,f<45||f>127?f:f<46?65:f<48?f-1:f<58?f+18:f<65?f-11:f<91?f+11:f<97?f-37:f<123?f+5:f-63)}if((r+="")!=(n+="")){for(;i;)if(a=d(r,l++),i=d(n,s++),a<76&&i<76&&a>66&&i>66&&(a=d(r,l,l),i=d(n,s,l=o),s=o),a!=i)return a{if(n===o)return 0;if(!n)return-1;if(!o)return 1;const a=n.split(e),i=o.split(e),l=Math.min(a.length,i.length);for(let c=0;c0?e.slice(0,r):null}function Jg(e){const r=e.lastIndexOf(".");return r>0?e.slice(r+1):e}const e1=e=>$_(e)?e:e.id;function Yn(e,r){const n=e1(e);return r?e1(r).startsWith(n+"."):o=>{const a=e1(o);return n.startsWith(a+".")}}function eB(e,r){if(!r)return a=>eB(e,a);const n=e1(e),o=e1(r);return n===o||o.startsWith(n+".")||n.startsWith(o+".")}function tB(e,r){return n=>Yn(e,n)}function Tb(e){return($_(e)?e:e.id).split(".").length}function t1(e,r){const n=e.split(".");if(n.length<2)return null;const o=r.split(".");if(o.length<2)return null;let a=[];for(let i=0;ia===0?(n.push(o),n):(n.unshift(`${n[0]}.${o}`),n),[])}function c0e(e,r){let n=r;for(const o of e)Yn(o,n)&&(n=o);return n!==r?n:null}function Jc(e){const r=[],n=[...e];let o;for(;o=n.shift();){let a;for(;a=c0e(n,o);)r.push(n.splice(n.indexOf(a),1)[0]);r.push(o)}return r}function rB(e,r){if(!e||$_(e)){const o=e??"asc";return a=>rB(a,o)}const n=r==="desc"?-1:1;return e.map(o=>({item:o,fqn:o.id.split(".")})).sort((o,a)=>{if(o.fqn.length!==a.fqn.length)return(o.fqn.length-a.fqn.length)*n;for(let i=0;io)}var jb={},nB;function d0e(){return nB||(nB=1,jb.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",jb.SYMBOL_SUPPORT=typeof Symbol<"u"),jb}var R_,oB;function Ab(){if(oB)return R_;oB=1;var e=d0e(),r=e.ARRAY_BUFFER_SUPPORT,n=e.SYMBOL_SUPPORT;return R_=function(a,i){var l,s,c,d,u;if(!a)throw new Error("obliterator/forEach: invalid iterable.");if(typeof i!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(a)||r&&ArrayBuffer.isView(a)||typeof a=="string"||a.toString()==="[object Arguments]"){for(c=0,d=a.length;c=n?{done:!0}:{done:!1,value:r[o++]}})},e.empty=function(){var r=new e(function(){return{done:!0}});return r},e.fromSequence=function(r){var n=0,o=r.length;return new e(function(){return n>=o?{done:!0}:{done:!1,value:r[n++]}})},e.is=function(r){return r instanceof e?!0:typeof r=="object"&&r!==null&&typeof r.next=="function"},z_=e,z_}const lB=-1,Db=0,r1=1,Mb=2,T_=3,j_=4,A_=5,D_=6,sB=7,cB=8,dB=typeof self=="object"?self:globalThis,u0e=(e,r)=>{const n=(a,i)=>(e.set(i,a),a),o=a=>{if(e.has(a))return e.get(a);const[i,l]=r[a];switch(i){case Db:case lB:return n(l,a);case r1:{const s=n([],a);for(const c of l)s.push(o(c));return s}case Mb:{const s=n({},a);for(const[c,d]of l)s[o(c)]=o(d);return s}case T_:return n(new Date(l),a);case j_:{const{source:s,flags:c}=l;return n(new RegExp(s,c),a)}case A_:{const s=n(new Map,a);for(const[c,d]of l)s.set(o(c),o(d));return s}case D_:{const s=n(new Set,a);for(const c of l)s.add(o(c));return s}case sB:{const{name:s,message:c}=l;return n(new dB[s](c),a)}case cB:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(new dB[i](l),a)};return o},uB=e=>u0e(new Map,e)(0),Bh="",{toString:p0e}={},{keys:h0e}=Object,n1=e=>{const r=typeof e;if(r!=="object"||!e)return[Db,r];const n=p0e.call(e).slice(8,-1);switch(n){case"Array":return[r1,Bh];case"Object":return[Mb,Bh];case"Date":return[T_,Bh];case"RegExp":return[j_,Bh];case"Map":return[A_,Bh];case"Set":return[D_,Bh];case"DataView":return[r1,n]}return n.includes("Array")?[r1,n]:n.includes("Error")?[sB,n]:[Mb,n]},Nb=([e,r])=>e===Db&&(r==="function"||r==="symbol"),f0e=(e,r,n,o)=>{const a=(l,s)=>{const c=o.push(l)-1;return n.set(s,c),c},i=l=>{if(n.has(l))return n.get(l);let[s,c]=n1(l);switch(s){case Db:{let u=l;switch(c){case"bigint":s=cB,u=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);u=null;break;case"undefined":return a([lB],l)}return a([s,u],l)}case r1:{if(c){let f=l;return c==="DataView"?f=new Uint8Array(l.buffer):c==="ArrayBuffer"&&(f=new Uint8Array(l)),a([c,[...f]],l)}const u=[],p=a([s,u],l);for(const f of l)u.push(i(f));return p}case Mb:{if(c)switch(c){case"BigInt":return a([c,l.toString()],l);case"Boolean":case"Number":case"String":return a([c,l.valueOf()],l)}if(r&&"toJSON"in l)return i(l.toJSON());const u=[],p=a([s,u],l);for(const f of h0e(l))(e||!Nb(n1(l[f])))&&u.push([i(f),i(l[f])]);return p}case T_:return a([s,l.toISOString()],l);case j_:{const{source:u,flags:p}=l;return a([s,{source:u,flags:p}],l)}case A_:{const u=[],p=a([s,u],l);for(const[f,g]of l)(e||!(Nb(n1(f))||Nb(n1(g))))&&u.push([i(f),i(g)]);return p}case D_:{const u=[],p=a([s,u],l);for(const f of l)(e||!Nb(n1(f)))&&u.push(i(f));return p}}const{message:d}=l;return a([s,{name:c,message:d}],l)};return i},pB=(e,{json:r,lossy:n}={})=>{const o=[];return f0e(!(r||n),!!r,new Map,o)(e),o},o1=typeof structuredClone=="function"?(e,r)=>r&&("json"in r||"lossy"in r)?uB(pB(e,r)):structuredClone(e):(e,r)=>uB(pB(e,r)),hB=mB("end"),fB=mB("start");function mB(e){return r;function r(n){const o=n&&n.position&&n.position[e]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function gB(e){const r=fB(e),n=hB(e);if(r&&n)return{start:r,end:n}}const Mu=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],M_={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Mu,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Mu],h2:[["className","sr-only"]],img:[...Mu,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Mu,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Mu],table:[...Mu],ul:[...Mu,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},ed={}.hasOwnProperty;function m0e(e,r){let n={type:"root",children:[]};const o={schema:r?{...M_,...r}:M_,stack:[]},a=yB(o,e);return a&&(Array.isArray(a)?a.length===1?n=a[0]:n.children=a:n=a),n}function yB(e,r){if(r&&typeof r=="object"){const n=r;switch(typeof n.type=="string"?n.type:""){case"comment":return g0e(e,n);case"doctype":return y0e(e,n);case"element":return v0e(e,n);case"root":return b0e(e,n);case"text":return x0e(e,n)}}}function g0e(e,r){if(e.schema.allowComments){const n=typeof r.value=="string"?r.value:"",o=n.indexOf("-->"),i={type:"comment",value:o<0?n:n.slice(0,o)};return a1(i,r),i}}function y0e(e,r){if(e.schema.allowDoctypes){const n={type:"doctype"};return a1(n,r),n}}function v0e(e,r){const n=typeof r.tagName=="string"?r.tagName:"";e.stack.push(n);const o=vB(e,r.children),a=w0e(e,r.properties);e.stack.pop();let i=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(i=!0,e.schema.ancestors&&ed.call(e.schema.ancestors,n))){const s=e.schema.ancestors[n];let c=-1;for(i=!1;++c1){let a=!1,i=0;for(;++i-1&&i>c||l>-1&&i>l||s>-1&&i>s)return!0;let d=-1;for(;++d4&&r.slice(0,4).toLowerCase()==="data")return n}function S0e(e){return function(r){return m0e(r,e)}}const E0e=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class i1{constructor(r,n,o){this.normal=n,this.property=r,o&&(this.space=o)}}i1.prototype.normal={},i1.prototype.property={},i1.prototype.space=void 0;function kB(e,r){const n={},o={};for(const a of e)Object.assign(n,a.property),Object.assign(o,a.normal);return new i1(n,o,r)}function N_(e){return e.toLowerCase()}class Jo{constructor(r,n){this.attribute=n,this.property=r}}Jo.prototype.attribute="",Jo.prototype.booleanish=!1,Jo.prototype.boolean=!1,Jo.prototype.commaOrSpaceSeparated=!1,Jo.prototype.commaSeparated=!1,Jo.prototype.defined=!1,Jo.prototype.mustUseProperty=!1,Jo.prototype.number=!1,Jo.prototype.overloadedBoolean=!1,Jo.prototype.property="",Jo.prototype.spaceSeparated=!1,Jo.prototype.space=void 0;let C0e=0;const At=Nu(),bn=Nu(),_B=Nu(),Ie=Nu(),Cr=Nu(),Ih=Nu(),ba=Nu();function Nu(){return 2**++C0e}const P_={__proto__:null,boolean:At,booleanish:bn,commaOrSpaceSeparated:ba,commaSeparated:Ih,number:Ie,overloadedBoolean:_B,spaceSeparated:Cr},B_=Object.keys(P_);class I_ extends Jo{constructor(r,n,o,a){let i=-1;if(super(r,n),SB(this,"space",a),typeof o=="number")for(;++i4&&n.slice(0,4)==="data"&&T0e.test(r)){if(r.charAt(4)==="-"){const i=r.slice(5).replace(jB,D0e);o="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=r.slice(4);if(!jB.test(i)){let l=i.replace(z0e,A0e);l.charAt(0)!=="-"&&(l="-"+l),r="data"+l}}a=I_}return new a(o,r)}function A0e(e){return"-"+e.toLowerCase()}function D0e(e){return e.charAt(1).toUpperCase()}const M0e=kB([EB,$0e,RB,zB,TB],"html"),AB=kB([EB,R0e,RB,zB,TB],"svg"),DB={}.hasOwnProperty;function N0e(e,r){const n=r||{};function o(a,...i){let l=o.invalid;const s=o.handlers;if(a&&DB.call(a,e)){const c=String(a[e]);l=DB.call(s,c)?s[c]:o.unknown}if(l)return l.call(this,a,...i)}return o.handlers=n.handlers||{},o.invalid=n.invalid,o.unknown=n.unknown,o}const P0e=/["&'<>`]/g,B0e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,I0e=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,O0e=/[|\\{}()[\]^$+*?.]/g,MB=new WeakMap;function L0e(e,r){if(e=e.replace(r.subset?F0e(r.subset):P0e,o),r.subset||r.escapeOnly)return e;return e.replace(B0e,n).replace(I0e,o);function n(a,i,l){return r.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,l.charCodeAt(i+2),r)}function o(a,i,l){return r.format(a.charCodeAt(0),l.charCodeAt(i+1),r)}}function F0e(e){let r=MB.get(e);return r||(r=V0e(e),MB.set(e,r)),r}function V0e(e){const r=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Y0e=["cent","copy","divide","gt","lt","not","para","times"],NB={}.hasOwnProperty,L_={};let Pb;for(Pb in O_)NB.call(O_,Pb)&&(L_[O_[Pb]]=Pb);const X0e=/[^\dA-Za-z]/;function Z0e(e,r,n,o){const a=String.fromCharCode(e);if(NB.call(L_,a)){const i=L_[a],l="&"+i;return n&&G0e.includes(i)&&!Y0e.includes(i)&&(!o||r&&r!==61&&X0e.test(String.fromCharCode(r)))?l:l+";"}return""}function K0e(e,r,n){let o=H0e(e,r,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=Z0e(e,r,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){const i=W0e(e,r,n.omitOptionalSemicolons);i.length|^->||--!>|"],eve=["<",">"];function tve(e,r,n,o){return o.settings.bogusComments?"":"";function a(i){return Lh(i,Object.assign({},o.settings.characterReferences,{subset:eve}))}}function rve(e,r,n,o){return""}function Bb(e,r){const n=String(e);if(typeof r!="string")throw new TypeError("Expected character");let o=0,a=n.indexOf(r);for(;a!==-1;)o++,a=n.indexOf(r,a+r.length);return o}function nve(e,r){const n=r||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function ove(e){return e.join(" ").trim()}const ave=/[ \t\n\f\r]/g;function F_(e){return typeof e=="object"?e.type==="text"?PB(e.value):!1:PB(e)}function PB(e){return e.replace(ave,"")===""}const On=IB(1),BB=IB(-1),ive=[];function IB(e){return r;function r(n,o,a){const i=n?n.children:ive;let l=(o||0)+e,s=i[l];if(!a)for(;s&&F_(s);)l+=e,s=i[l];return s}}const lve={}.hasOwnProperty;function OB(e){return r;function r(n,o,a){return lve.call(e,n.tagName)&&e[n.tagName](n,o,a)}}const V_=OB({body:cve,caption:q_,colgroup:q_,dd:hve,dt:pve,head:q_,html:sve,li:uve,optgroup:fve,option:mve,p:dve,rp:LB,rt:LB,tbody:yve,td:FB,tfoot:vve,th:FB,thead:gve,tr:bve});function q_(e,r,n){const o=On(n,r,!0);return!o||o.type!=="comment"&&!(o.type==="text"&&F_(o.value.charAt(0)))}function sve(e,r,n){const o=On(n,r);return!o||o.type!=="comment"}function cve(e,r,n){const o=On(n,r);return!o||o.type!=="comment"}function dve(e,r,n){const o=On(n,r);return o?o.type==="element"&&(o.tagName==="address"||o.tagName==="article"||o.tagName==="aside"||o.tagName==="blockquote"||o.tagName==="details"||o.tagName==="div"||o.tagName==="dl"||o.tagName==="fieldset"||o.tagName==="figcaption"||o.tagName==="figure"||o.tagName==="footer"||o.tagName==="form"||o.tagName==="h1"||o.tagName==="h2"||o.tagName==="h3"||o.tagName==="h4"||o.tagName==="h5"||o.tagName==="h6"||o.tagName==="header"||o.tagName==="hgroup"||o.tagName==="hr"||o.tagName==="main"||o.tagName==="menu"||o.tagName==="nav"||o.tagName==="ol"||o.tagName==="p"||o.tagName==="pre"||o.tagName==="section"||o.tagName==="table"||o.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function uve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&o.tagName==="li"}function pve(e,r,n){const o=On(n,r);return!!(o&&o.type==="element"&&(o.tagName==="dt"||o.tagName==="dd"))}function hve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&(o.tagName==="dt"||o.tagName==="dd")}function LB(e,r,n){const o=On(n,r);return!o||o.type==="element"&&(o.tagName==="rp"||o.tagName==="rt")}function fve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&o.tagName==="optgroup"}function mve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&(o.tagName==="option"||o.tagName==="optgroup")}function gve(e,r,n){const o=On(n,r);return!!(o&&o.type==="element"&&(o.tagName==="tbody"||o.tagName==="tfoot"))}function yve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&(o.tagName==="tbody"||o.tagName==="tfoot")}function vve(e,r,n){return!On(n,r)}function bve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&o.tagName==="tr"}function FB(e,r,n){const o=On(n,r);return!o||o.type==="element"&&(o.tagName==="td"||o.tagName==="th")}const xve=OB({body:_ve,colgroup:Sve,head:kve,html:wve,tbody:Eve});function wve(e){const r=On(e,-1);return!r||r.type!=="comment"}function kve(e){const r=new Set;for(const o of e.children)if(o.type==="element"&&(o.tagName==="base"||o.tagName==="title")){if(r.has(o.tagName))return!1;r.add(o.tagName)}const n=e.children[0];return!n||n.type==="element"}function _ve(e){const r=On(e,-1,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&F_(r.value.charAt(0)))&&!(r.type==="element"&&(r.tagName==="meta"||r.tagName==="link"||r.tagName==="script"||r.tagName==="style"||r.tagName==="template"))}function Sve(e,r,n){const o=BB(n,r),a=On(e,-1,!0);return n&&o&&o.type==="element"&&o.tagName==="colgroup"&&V_(o,n.children.indexOf(o),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function Eve(e,r,n){const o=BB(n,r),a=On(e,-1);return n&&o&&o.type==="element"&&(o.tagName==="thead"||o.tagName==="tbody")&&V_(o,n.children.indexOf(o),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}const Ib={name:[[` +function Lge(e,r){for(var n=0;no[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function LN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var X6={exports:{}},Xg={};var FN;function Fge(){if(FN)return Xg;FN=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(o,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var s in i)s!=="key"&&(a[s]=i[s])}else a=i;return i=a.ref,{$$typeof:e,type:o,key:l,ref:i!==void 0?i:null,props:a}}return Xg.Fragment=r,Xg.jsx=n,Xg.jsxs=n,Xg}var VN;function Vge(){return VN||(VN=1,X6.exports=Fge()),X6.exports}var y=Vge(),K6={exports:{}},$t={};var qN;function qge(){if(qN)return $t;qN=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),f=Symbol.iterator;function g(Y){return Y===null||typeof Y!="object"?null:(Y=f&&Y[f]||Y["@@iterator"],typeof Y=="function"?Y:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function k(Y,K,O){this.props=Y,this.context=K,this.refs=x,this.updater=O||v}k.prototype.isReactComponent={},k.prototype.setState=function(Y,K){if(typeof Y!="object"&&typeof Y!="function"&&Y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Y,K,"setState")},k.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function C(){}C.prototype=k.prototype;function _(Y,K,O){this.props=Y,this.context=K,this.refs=x,this.updater=O||v}var $=_.prototype=new C;$.constructor=_,w($,k.prototype),$.isPureReactComponent=!0;var R=Array.isArray;function T(){}var A={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function j(Y,K,O){var W=O.ref;return{$$typeof:e,type:Y,key:K,ref:W!==void 0?W:null,props:O}}function I(Y,K){return j(Y.type,K,Y.props)}function P(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function L(Y){var K={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(O){return K[O]})}var H=/\/+/g;function M(Y,K){return typeof Y=="object"&&Y!==null&&Y.key!=null?L(""+Y.key):K.toString(36)}function V(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(T,T):(Y.status="pending",Y.then(function(K){Y.status==="pending"&&(Y.status="fulfilled",Y.value=K)},function(K){Y.status==="pending"&&(Y.status="rejected",Y.reason=K)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function B(Y,K,O,W,Z){var Q=typeof Y;(Q==="undefined"||Q==="boolean")&&(Y=null);var ie=!1;if(Y===null)ie=!0;else switch(Q){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(Y.$$typeof){case e:case r:ie=!0;break;case u:return ie=Y._init,B(ie(Y._payload),K,O,W,Z)}}if(ie)return Z=Z(Y),ie=W===""?"."+M(Y,0):W,R(Z)?(O="",ie!=null&&(O=ie.replace(H,"$&/")+"/"),B(Z,K,O,"",function(ue){return ue})):Z!=null&&(P(Z)&&(Z=I(Z,O+(Z.key==null||Y&&Y.key===Z.key?"":(""+Z.key).replace(H,"$&/")+"/")+ie)),K.push(Z)),1;ie=0;var te=W===""?".":W+":";if(R(Y))for(var re=0;re"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),Q6.exports=Hge(),Q6.exports}var Va=GN();const YN=LN(Va);function ar(e,r,n){const o=typeof r=="symbol"?r:Symbol.for(r);return e.hasOwnProperty(o)||Object.defineProperty(e,o,{enumerable:!1,writable:!1,value:n()}),e[o]}function J6(e){if(e===null||typeof e!="object")return!1;const r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function e_(e,r,n=".",o){if(!J6(r))return e_(e,{},n);const i=Object.assign({},r);for(const a in e){if(a==="__proto__"||a==="constructor")continue;const l=e[a];l!=null&&(Array.isArray(l)&&Array.isArray(i[a])?i[a]=[...l,...i[a]]:J6(l)&&J6(i[a])?i[a]=e_(l,i[a],(n?`${n}.`:"")+a.toString()):i[a]=l)}return i}function Uge(e){return(...r)=>r.reduce((n,o)=>e_(n,o,""),{})}const XN=Uge();function Wge(e,r,n){let o=i=>e(i,...r);return n===void 0?o:Object.assign(o,{lazy:n,lazyArgs:r})}function ao(e,r,n){let o=e.length-r.length;if(o===0)return e(...r);if(o===1)return Wge(e,r,n);throw Error("Wrong number of arguments")}function Ll(...e){return ao(Gge,e)}const Gge=(e,r)=>e.length>=r;function mt(e,r){if(typeof e>"u"||e==null){const n=typeof r=="function"?r():r;throw new Error(n??`Expected defined value, but received ${e}`)}return e}function He(e,r){if(!e)throw new Error(r??"Invariant failed")}function Qo(e){throw new Error(`NonExhaustive value: ${e}`)}function Yge(...e){return ao(Xge,e)}function Xge(e,r){let n={};for(let[o,i]of e.entries())n[i]=r(i,o,e);return n}function yb(...e){return ao(Kg,e)}function Kg(e,r){if(e===r||Object.is(e,r))return!0;if(typeof e!="object"||typeof r!="object"||e===null||r===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(r))return!1;if(Array.isArray(e))return Kge(e,r);if(e instanceof Map)return Zge(e,r);if(e instanceof Set)return Qge(e,r);if(e instanceof Date)return e.getTime()===r.getTime();if(e instanceof RegExp)return e.toString()===r.toString();if(Object.keys(e).length!==Object.keys(r).length)return!1;for(let[n,o]of Object.entries(e))if(!(n in r)||!Kg(o,r[n]))return!1;return!0}function Kge(e,r){if(e.length!==r.length)return!1;for(let[n,o]of e.entries())if(!Kg(o,r[n]))return!1;return!0}function Zge(e,r){if(e.size!==r.size)return!1;for(let[n,o]of e.entries())if(!r.has(n)||!Kg(o,r.get(n)))return!1;return!0}function Qge(e,r){if(e.size!==r.size)return!1;let n=[...r];for(let o of e){let i=!1;for(let[a,l]of n.entries())if(Kg(o,l)){i=!0,n.splice(a,1);break}if(!i)return!1}return!0}const{min:Jge,max:e1e}=Math,Au=(e,r=0,n=1)=>Jge(e1e(r,e),n),t_=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let r=0;r<=3;r++)r<3?((e[r]<0||e[r]>255)&&(e._clipped=!0),e[r]=Au(e[r],0,255)):r===3&&(e[r]=Au(e[r],0,1));return e},KN={};for(let e of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])KN[`[object ${e}]`]=e.toLowerCase();function Ft(e){return KN[Object.prototype.toString.call(e)]||"object"}const jt=(e,r=null)=>e.length>=3?Array.prototype.slice.call(e):Ft(e[0])=="object"&&r?r.split("").filter(n=>e[0][n]!==void 0).map(n=>e[0][n]):e[0].slice(0),Rh=e=>{if(e.length<2)return null;const r=e.length-1;return Ft(e[r])=="string"?e[r].toLowerCase():null},{PI:vb,min:ZN,max:QN}=Math,Ki=e=>Math.round(e*100)/100,r_=e=>Math.round(e*100)/100,As=vb*2,n_=vb/3,t1e=vb/180,r1e=180/vb;function JN(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}const Rt={format:{},autodetect:[]};let Ne=class{constructor(...r){const n=this;if(Ft(r[0])==="object"&&r[0].constructor&&r[0].constructor===this.constructor)return r[0];let o=Rh(r),i=!1;if(!o){i=!0,Rt.sorted||(Rt.autodetect=Rt.autodetect.sort((a,l)=>l.p-a.p),Rt.sorted=!0);for(let a of Rt.autodetect)if(o=a.test(...r),o)break}if(Rt.format[o]){const a=Rt.format[o].apply(null,i?r:r.slice(0,-1));n._rgb=t_(a)}else throw new Error("unknown format: "+r);n._rgb.length===3&&n._rgb.push(1)}toString(){return Ft(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}};const n1e="3.2.0",zt=(...e)=>new Ne(...e);zt.version=n1e;const zh={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o1e=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,i1e=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,eP=e=>{if(e.match(o1e)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const r=parseInt(e,16),n=r>>16,o=r>>8&255,i=r&255;return[n,o,i,1]}if(e.match(i1e)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);const r=parseInt(e,16),n=r>>24&255,o=r>>16&255,i=r>>8&255,a=Math.round((r&255)/255*100)/100;return[n,o,i,a]}throw new Error(`unknown hex color: ${e}`)},{round:bb}=Math,tP=(...e)=>{let[r,n,o,i]=jt(e,"rgba"),a=Rh(e)||"auto";i===void 0&&(i=1),a==="auto"&&(a=i<1?"rgba":"rgb"),r=bb(r),n=bb(n),o=bb(o);let s="000000"+(r<<16|n<<8|o).toString(16);s=s.substr(s.length-6);let c="0"+bb(i*255).toString(16);switch(c=c.substr(c.length-2),a.toLowerCase()){case"rgba":return`#${s}${c}`;case"argb":return`#${c}${s}`;default:return`#${s}`}};Ne.prototype.name=function(){const e=tP(this._rgb,"rgb");for(let r of Object.keys(zh))if(zh[r]===e)return r.toLowerCase();return e},Rt.format.named=e=>{if(e=e.toLowerCase(),zh[e])return eP(zh[e]);throw new Error("unknown color name: "+e)},Rt.autodetect.push({p:5,test:(e,...r)=>{if(!r.length&&Ft(e)==="string"&&zh[e.toLowerCase()])return"named"}}),Ne.prototype.alpha=function(e,r=!1){return e!==void 0&&Ft(e)==="number"?r?(this._rgb[3]=e,this):new Ne([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},Ne.prototype.clipped=function(){return this._rgb._clipped||!1};const Fl={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},a1e=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Ds(e){const r=a1e.get(String(e).toLowerCase());if(!r)throw new Error("unknown Lab illuminant "+e);Fl.labWhitePoint=e,Fl.Xn=r[0],Fl.Zn=r[1]}function Zg(){return Fl.labWhitePoint}const o_=(...e)=>{e=jt(e,"lab");const[r,n,o]=e,[i,a,l]=l1e(r,n,o),[s,c,d]=rP(i,a,l);return[s,c,d,e.length>3?e[3]:1]},l1e=(e,r,n)=>{const{kE:o,kK:i,kKE:a,Xn:l,Yn:s,Zn:c}=Fl,d=(e+16)/116,u=.002*r+d,p=d-.005*n,f=u*u*u,g=p*p*p,v=f>o?f:(116*u-16)/i,w=e>a?Math.pow((e+16)/116,3):e/i,x=g>o?g:(116*p-16)/i,k=v*l,C=w*s,_=x*c;return[k,C,_]},i_=e=>{const r=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*Math.pow(e,1/2.4)-.055)*r},rP=(e,r,n)=>{const{MtxAdaptMa:o,MtxAdaptMaI:i,MtxXYZ2RGB:a,RefWhiteRGB:l,Xn:s,Yn:c,Zn:d}=Fl,u=s*o.m00+c*o.m10+d*o.m20,p=s*o.m01+c*o.m11+d*o.m21,f=s*o.m02+c*o.m12+d*o.m22,g=l.X*o.m00+l.Y*o.m10+l.Z*o.m20,v=l.X*o.m01+l.Y*o.m11+l.Z*o.m21,w=l.X*o.m02+l.Y*o.m12+l.Z*o.m22,x=(e*o.m00+r*o.m10+n*o.m20)*(g/u),k=(e*o.m01+r*o.m11+n*o.m21)*(v/p),C=(e*o.m02+r*o.m12+n*o.m22)*(w/f),_=x*i.m00+k*i.m10+C*i.m20,$=x*i.m01+k*i.m11+C*i.m21,R=x*i.m02+k*i.m12+C*i.m22,T=i_(_*a.m00+$*a.m10+R*a.m20),A=i_(_*a.m01+$*a.m11+R*a.m21),z=i_(_*a.m02+$*a.m12+R*a.m22);return[T*255,A*255,z*255]},a_=(...e)=>{const[r,n,o,...i]=jt(e,"rgb"),[a,l,s]=nP(r,n,o),[c,d,u]=s1e(a,l,s);return[c,d,u,...i.length>0&&i[0]<1?[i[0]]:[]]};function s1e(e,r,n){const{Xn:o,Yn:i,Zn:a,kE:l,kK:s}=Fl,c=e/o,d=r/i,u=n/a,p=c>l?Math.pow(c,1/3):(s*c+16)/116,f=d>l?Math.pow(d,1/3):(s*d+16)/116,g=u>l?Math.pow(u,1/3):(s*u+16)/116;return[116*f-16,500*(p-f),200*(f-g)]}function l_(e){const r=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4))*r}const nP=(e,r,n)=>{e=l_(e/255),r=l_(r/255),n=l_(n/255);const{MtxRGB2XYZ:o,MtxAdaptMa:i,MtxAdaptMaI:a,Xn:l,Yn:s,Zn:c,As:d,Bs:u,Cs:p}=Fl;let f=e*o.m00+r*o.m10+n*o.m20,g=e*o.m01+r*o.m11+n*o.m21,v=e*o.m02+r*o.m12+n*o.m22;const w=l*i.m00+s*i.m10+c*i.m20,x=l*i.m01+s*i.m11+c*i.m21,k=l*i.m02+s*i.m12+c*i.m22;let C=f*i.m00+g*i.m10+v*i.m20,_=f*i.m01+g*i.m11+v*i.m21,$=f*i.m02+g*i.m12+v*i.m22;return C*=w/d,_*=x/u,$*=k/p,f=C*a.m00+_*a.m10+$*a.m20,g=C*a.m01+_*a.m11+$*a.m21,v=C*a.m02+_*a.m12+$*a.m22,[f,g,v]};Ne.prototype.lab=function(){return a_(this._rgb)},Object.assign(zt,{lab:(...e)=>new Ne(...e,"lab"),getLabWhitePoint:Zg,setLabWhitePoint:Ds}),Rt.format.lab=o_,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"lab"),Ft(e)==="array"&&e.length===3)return"lab"}}),Ne.prototype.darken=function(e=1){const r=this,n=r.lab();return n[0]-=Fl.Kn*e,new Ne(n,"lab").alpha(r.alpha(),!0)},Ne.prototype.brighten=function(e=1){return this.darken(-e)},Ne.prototype.darker=Ne.prototype.darken,Ne.prototype.brighter=Ne.prototype.brighten,Ne.prototype.get=function(e){const[r,n]=e.split("."),o=this[r]();if(n){const i=r.indexOf(n)-(r.substr(0,2)==="ok"?2:0);if(i>-1)return o[i];throw new Error(`unknown channel ${n} in mode ${r}`)}else return o};const{pow:c1e}=Math,d1e=1e-7,u1e=20;Ne.prototype.luminance=function(e,r="rgb"){if(e!==void 0&&Ft(e)==="number"){if(e===0)return new Ne([0,0,0,this._rgb[3]],"rgb");if(e===1)return new Ne([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),o=u1e;const i=(l,s)=>{const c=l.interpolate(s,.5,r),d=c.luminance();return Math.abs(e-d)e?i(l,c):i(c,s)},a=(n>e?i(new Ne([0,0,0]),this):i(this,new Ne([255,255,255]))).rgb();return new Ne([...a,this._rgb[3]])}return p1e(...this._rgb.slice(0,3))};const p1e=(e,r,n)=>(e=s_(e),r=s_(r),n=s_(n),.2126*e+.7152*r+.0722*n),s_=e=>(e/=255,e<=.03928?e/12.92:c1e((e+.055)/1.055,2.4)),bo={},Th=(e,r,n=.5,...o)=>{let i=o[0]||"lrgb";if(!bo[i]&&!o.length&&(i=Object.keys(bo)[0]),!bo[i])throw new Error(`interpolation mode ${i} is not defined`);return Ft(e)!=="object"&&(e=new Ne(e)),Ft(r)!=="object"&&(r=new Ne(r)),bo[i](e,r,n).alpha(e.alpha()+n*(r.alpha()-e.alpha()))};Ne.prototype.mix=Ne.prototype.interpolate=function(e,r=.5,...n){return Th(this,e,r,...n)},Ne.prototype.premultiply=function(e=!1){const r=this._rgb,n=r[3];return e?(this._rgb=[r[0]*n,r[1]*n,r[2]*n,n],this):new Ne([r[0]*n,r[1]*n,r[2]*n,n],"rgb")};const{sin:h1e,cos:f1e}=Math,oP=(...e)=>{let[r,n,o]=jt(e,"lch");return isNaN(o)&&(o=0),o=o*t1e,[r,f1e(o)*n,h1e(o)*n]},c_=(...e)=>{e=jt(e,"lch");const[r,n,o]=e,[i,a,l]=oP(r,n,o),[s,c,d]=o_(i,a,l);return[s,c,d,e.length>3?e[3]:1]},m1e=(...e)=>{const r=JN(jt(e,"hcl"));return c_(...r)},{sqrt:g1e,atan2:y1e,round:v1e}=Math,iP=(...e)=>{const[r,n,o]=jt(e,"lab"),i=g1e(n*n+o*o);let a=(y1e(o,n)*r1e+360)%360;return v1e(i*1e4)===0&&(a=Number.NaN),[r,i,a]},d_=(...e)=>{const[r,n,o,...i]=jt(e,"rgb"),[a,l,s]=a_(r,n,o),[c,d,u]=iP(a,l,s);return[c,d,u,...i.length>0&&i[0]<1?[i[0]]:[]]};Ne.prototype.lch=function(){return d_(this._rgb)},Ne.prototype.hcl=function(){return JN(d_(this._rgb))},Object.assign(zt,{lch:(...e)=>new Ne(...e,"lch"),hcl:(...e)=>new Ne(...e,"hcl")}),Rt.format.lch=c_,Rt.format.hcl=m1e,["lch","hcl"].forEach(e=>Rt.autodetect.push({p:2,test:(...r)=>{if(r=jt(r,e),Ft(r)==="array"&&r.length===3)return e}})),Ne.prototype.saturate=function(e=1){const r=this,n=r.lch();return n[1]+=Fl.Kn*e,n[1]<0&&(n[1]=0),new Ne(n,"lch").alpha(r.alpha(),!0)},Ne.prototype.desaturate=function(e=1){return this.saturate(-e)},Ne.prototype.set=function(e,r,n=!1){const[o,i]=e.split("."),a=this[o]();if(i){const l=o.indexOf(i)-(o.substr(0,2)==="ok"?2:0);if(l>-1){if(Ft(r)=="string")switch(r.charAt(0)){case"+":a[l]+=+r;break;case"-":a[l]+=+r;break;case"*":a[l]*=+r.substr(1);break;case"/":a[l]/=+r.substr(1);break;default:a[l]=+r}else if(Ft(r)==="number")a[l]=r;else throw new Error("unsupported value for Color.set");const s=new Ne(a,o);return n?(this._rgb=s._rgb,this):s}throw new Error(`unknown channel ${i} in mode ${o}`)}else return a},Ne.prototype.tint=function(e=.5,...r){return Th(this,"white",e,...r)},Ne.prototype.shade=function(e=.5,...r){return Th(this,"black",e,...r)};const b1e=(e,r,n)=>{const o=e._rgb,i=r._rgb;return new Ne(o[0]+n*(i[0]-o[0]),o[1]+n*(i[1]-o[1]),o[2]+n*(i[2]-o[2]),"rgb")};bo.rgb=b1e;const{sqrt:u_,pow:jh}=Math,x1e=(e,r,n)=>{const[o,i,a]=e._rgb,[l,s,c]=r._rgb;return new Ne(u_(jh(o,2)*(1-n)+jh(l,2)*n),u_(jh(i,2)*(1-n)+jh(s,2)*n),u_(jh(a,2)*(1-n)+jh(c,2)*n),"rgb")};bo.lrgb=x1e;const w1e=(e,r,n)=>{const o=e.lab(),i=r.lab();return new Ne(o[0]+n*(i[0]-o[0]),o[1]+n*(i[1]-o[1]),o[2]+n*(i[2]-o[2]),"lab")};bo.lab=w1e;const Ah=(e,r,n,o)=>{let i,a;o==="hsl"?(i=e.hsl(),a=r.hsl()):o==="hsv"?(i=e.hsv(),a=r.hsv()):o==="hcg"?(i=e.hcg(),a=r.hcg()):o==="hsi"?(i=e.hsi(),a=r.hsi()):o==="lch"||o==="hcl"?(o="hcl",i=e.hcl(),a=r.hcl()):o==="oklch"&&(i=e.oklch().reverse(),a=r.oklch().reverse());let l,s,c,d,u,p;(o.substr(0,1)==="h"||o==="oklch")&&([l,c,u]=i,[s,d,p]=a);let f,g,v,w;return!isNaN(l)&&!isNaN(s)?(s>l&&s-l>180?w=s-(l+360):s180?w=s+360-l:w=s-l,g=l+n*w):isNaN(l)?isNaN(s)?g=Number.NaN:(g=s,(u==1||u==0)&&o!="hsv"&&(f=d)):(g=l,(p==1||p==0)&&o!="hsv"&&(f=c)),f===void 0&&(f=c+n*(d-c)),v=u+n*(p-u),o==="oklch"?new Ne([v,f,g],o):new Ne([g,f,v],o)},aP=(e,r,n)=>Ah(e,r,n,"lch");bo.lch=aP,bo.hcl=aP;const k1e=e=>{if(Ft(e)=="number"&&e>=0&&e<=16777215){const r=e>>16,n=e>>8&255,o=e&255;return[r,n,o,1]}throw new Error("unknown num color: "+e)},_1e=(...e)=>{const[r,n,o]=jt(e,"rgb");return(r<<16)+(n<<8)+o};Ne.prototype.num=function(){return _1e(this._rgb)},Object.assign(zt,{num:(...e)=>new Ne(...e,"num")}),Rt.format.num=k1e,Rt.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&Ft(e[0])==="number"&&e[0]>=0&&e[0]<=16777215)return"num"}});const S1e=(e,r,n)=>{const o=e.num(),i=r.num();return new Ne(o+n*(i-o),"num")};bo.num=S1e;const{floor:E1e}=Math,C1e=(...e)=>{e=jt(e,"hcg");let[r,n,o]=e,i,a,l;o=o*255;const s=n*255;if(n===0)i=a=l=o;else{r===360&&(r=0),r>360&&(r-=360),r<0&&(r+=360),r/=60;const c=E1e(r),d=r-c,u=o*(1-n),p=u+s*(1-d),f=u+s*d,g=u+s;switch(c){case 0:[i,a,l]=[g,f,u];break;case 1:[i,a,l]=[p,g,u];break;case 2:[i,a,l]=[u,g,f];break;case 3:[i,a,l]=[u,p,g];break;case 4:[i,a,l]=[f,u,g];break;case 5:[i,a,l]=[g,u,p];break}}return[i,a,l,e.length>3?e[3]:1]},$1e=(...e)=>{const[r,n,o]=jt(e,"rgb"),i=ZN(r,n,o),a=QN(r,n,o),l=a-i,s=l*100/255,c=i/(255-l)*100;let d;return l===0?d=Number.NaN:(r===a&&(d=(n-o)/l),n===a&&(d=2+(o-r)/l),o===a&&(d=4+(r-n)/l),d*=60,d<0&&(d+=360)),[d,s,c]};Ne.prototype.hcg=function(){return $1e(this._rgb)};const R1e=(...e)=>new Ne(...e,"hcg");zt.hcg=R1e,Rt.format.hcg=C1e,Rt.autodetect.push({p:1,test:(...e)=>{if(e=jt(e,"hcg"),Ft(e)==="array"&&e.length===3)return"hcg"}});const z1e=(e,r,n)=>Ah(e,r,n,"hcg");bo.hcg=z1e;const{cos:Dh}=Math,T1e=(...e)=>{e=jt(e,"hsi");let[r,n,o]=e,i,a,l;return isNaN(r)&&(r=0),isNaN(n)&&(n=0),r>360&&(r-=360),r<0&&(r+=360),r/=360,r<1/3?(l=(1-n)/3,i=(1+n*Dh(As*r)/Dh(n_-As*r))/3,a=1-(l+i)):r<2/3?(r-=1/3,i=(1-n)/3,a=(1+n*Dh(As*r)/Dh(n_-As*r))/3,l=1-(i+a)):(r-=2/3,a=(1-n)/3,l=(1+n*Dh(As*r)/Dh(n_-As*r))/3,i=1-(a+l)),i=Au(o*i*3),a=Au(o*a*3),l=Au(o*l*3),[i*255,a*255,l*255,e.length>3?e[3]:1]},{min:j1e,sqrt:A1e,acos:D1e}=Math,M1e=(...e)=>{let[r,n,o]=jt(e,"rgb");r/=255,n/=255,o/=255;let i;const a=j1e(r,n,o),l=(r+n+o)/3,s=l>0?1-a/l:0;return s===0?i=NaN:(i=(r-n+(r-o))/2,i/=A1e((r-n)*(r-n)+(r-o)*(n-o)),i=D1e(i),o>n&&(i=As-i),i/=As),[i*360,s,l]};Ne.prototype.hsi=function(){return M1e(this._rgb)};const N1e=(...e)=>new Ne(...e,"hsi");zt.hsi=N1e,Rt.format.hsi=T1e,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"hsi"),Ft(e)==="array"&&e.length===3)return"hsi"}});const P1e=(e,r,n)=>Ah(e,r,n,"hsi");bo.hsi=P1e;const p_=(...e)=>{e=jt(e,"hsl");const[r,n,o]=e;let i,a,l;if(n===0)i=a=l=o*255;else{const s=[0,0,0],c=[0,0,0],d=o<.5?o*(1+n):o+n-o*n,u=2*o-d,p=r/360;s[0]=p+1/3,s[1]=p,s[2]=p-1/3;for(let f=0;f<3;f++)s[f]<0&&(s[f]+=1),s[f]>1&&(s[f]-=1),6*s[f]<1?c[f]=u+(d-u)*6*s[f]:2*s[f]<1?c[f]=d:3*s[f]<2?c[f]=u+(d-u)*(2/3-s[f])*6:c[f]=u;[i,a,l]=[c[0]*255,c[1]*255,c[2]*255]}return e.length>3?[i,a,l,e[3]]:[i,a,l,1]},lP=(...e)=>{e=jt(e,"rgba");let[r,n,o]=e;r/=255,n/=255,o/=255;const i=ZN(r,n,o),a=QN(r,n,o),l=(a+i)/2;let s,c;return a===i?(s=0,c=Number.NaN):s=l<.5?(a-i)/(a+i):(a-i)/(2-a-i),r==a?c=(n-o)/(a-i):n==a?c=2+(o-r)/(a-i):o==a&&(c=4+(r-n)/(a-i)),c*=60,c<0&&(c+=360),e.length>3&&e[3]!==void 0?[c,s,l,e[3]]:[c,s,l]};Ne.prototype.hsl=function(){return lP(this._rgb)};const B1e=(...e)=>new Ne(...e,"hsl");zt.hsl=B1e,Rt.format.hsl=p_,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"hsl"),Ft(e)==="array"&&e.length===3)return"hsl"}});const I1e=(e,r,n)=>Ah(e,r,n,"hsl");bo.hsl=I1e;const{floor:O1e}=Math,L1e=(...e)=>{e=jt(e,"hsv");let[r,n,o]=e,i,a,l;if(o*=255,n===0)i=a=l=o;else{r===360&&(r=0),r>360&&(r-=360),r<0&&(r+=360),r/=60;const s=O1e(r),c=r-s,d=o*(1-n),u=o*(1-n*c),p=o*(1-n*(1-c));switch(s){case 0:[i,a,l]=[o,p,d];break;case 1:[i,a,l]=[u,o,d];break;case 2:[i,a,l]=[d,o,p];break;case 3:[i,a,l]=[d,u,o];break;case 4:[i,a,l]=[p,d,o];break;case 5:[i,a,l]=[o,d,u];break}}return[i,a,l,e.length>3?e[3]:1]},{min:F1e,max:V1e}=Math,q1e=(...e)=>{e=jt(e,"rgb");let[r,n,o]=e;const i=F1e(r,n,o),a=V1e(r,n,o),l=a-i;let s,c,d;return d=a/255,a===0?(s=Number.NaN,c=0):(c=l/a,r===a&&(s=(n-o)/l),n===a&&(s=2+(o-r)/l),o===a&&(s=4+(r-n)/l),s*=60,s<0&&(s+=360)),[s,c,d]};Ne.prototype.hsv=function(){return q1e(this._rgb)};const H1e=(...e)=>new Ne(...e,"hsv");zt.hsv=H1e,Rt.format.hsv=L1e,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"hsv"),Ft(e)==="array"&&e.length===3)return"hsv"}});const U1e=(e,r,n)=>Ah(e,r,n,"hsv");bo.hsv=U1e;function xb(e,r){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(r[0])||(r=r.map(l=>[l]));let o=r[0].length,i=r[0].map((l,s)=>r.map(c=>c[s])),a=e.map(l=>i.map(s=>Array.isArray(l)?l.reduce((c,d,u)=>c+d*(s[u]||0),0):s.reduce((c,d)=>c+d*l,0)));return n===1&&(a=a[0]),o===1?a.map(l=>l[0]):a}const h_=(...e)=>{e=jt(e,"lab");const[r,n,o,...i]=e,[a,l,s]=W1e([r,n,o]),[c,d,u]=rP(a,l,s);return[c,d,u,...i.length>0&&i[0]<1?[i[0]]:[]]};function W1e(e){var r=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],o=xb(n,e);return xb(r,o.map(i=>i**3))}const f_=(...e)=>{const[r,n,o,...i]=jt(e,"rgb"),a=nP(r,n,o);return[...G1e(a),...i.length>0&&i[0]<1?[i[0]]:[]]};function G1e(e){const r=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],o=xb(r,e);return xb(n,o.map(i=>Math.cbrt(i)))}Ne.prototype.oklab=function(){return f_(this._rgb)},Object.assign(zt,{oklab:(...e)=>new Ne(...e,"oklab")}),Rt.format.oklab=h_,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"oklab"),Ft(e)==="array"&&e.length===3)return"oklab"}});const Y1e=(e,r,n)=>{const o=e.oklab(),i=r.oklab();return new Ne(o[0]+n*(i[0]-o[0]),o[1]+n*(i[1]-o[1]),o[2]+n*(i[2]-o[2]),"oklab")};bo.oklab=Y1e;const X1e=(e,r,n)=>Ah(e,r,n,"oklch");bo.oklch=X1e;const{pow:m_,sqrt:g_,PI:y_,cos:sP,sin:cP,atan2:K1e}=Math,Z1e=(e,r="lrgb",n=null)=>{const o=e.length;n||(n=Array.from(new Array(o)).map(()=>1));const i=o/n.reduce(function(p,f){return p+f});if(n.forEach((p,f)=>{n[f]*=i}),e=e.map(p=>new Ne(p)),r==="lrgb")return Q1e(e,n);const a=e.shift(),l=a.get(r),s=[];let c=0,d=0;for(let p=0;p{const g=p.get(r);u+=p.alpha()*n[f+1];for(let v=0;v=360;)f-=360;l[p]=f}else l[p]=l[p]/s[p];return u/=o,new Ne(l,r).alpha(u>.99999?1:u,!0)},Q1e=(e,r)=>{const n=e.length,o=[0,0,0,0];for(let i=0;i.9999999&&(o[3]=1),new Ne(t_(o))},{pow:J1e}=Math;function wb(e){let r="rgb",n=zt("#ccc"),o=0,i=[0,1],a=[0,1],l=[],s=[0,0],c=!1,d=[],u=!1,p=0,f=1,g=!1,v={},w=!0,x=1;const k=function(z){if(z=z||["#fff","#000"],z&&Ft(z)==="string"&&zt.brewer&&zt.brewer[z.toLowerCase()]&&(z=zt.brewer[z.toLowerCase()]),Ft(z)==="array"){z.length===1&&(z=[z[0],z[0]]),z=z.slice(0);for(let j=0;j=c[I];)I++;return I-1}return 0};let _=z=>z,$=z=>z;const R=function(z,j){let I,P;if(j==null&&(j=!1),isNaN(z)||z===null)return n;j?P=z:c&&c.length>2?P=C(z)/(c.length-2):f!==p?P=(z-p)/(f-p):P=1,P=$(P),j||(P=_(P)),x!==1&&(P=J1e(P,x)),P=s[0]+P*(1-s[0]-s[1]),P=Au(P,0,1);const L=Math.floor(P*1e4);if(w&&v[L])I=v[L];else{if(Ft(d)==="array")for(let H=0;H=M&&H===l.length-1){I=d[H];break}if(P>M&&Pv={};k(e);const A=function(z){const j=zt(R(z));return u&&j[u]?j[u]():j};return A.classes=function(z){if(z!=null){if(Ft(z)==="array")c=z,i=[z[0],z[z.length-1]];else{const j=zt.analyze(i);z===0?c=[j.min,j.max]:c=zt.limits(j,"e",z)}return A}return c},A.domain=function(z){if(!arguments.length)return a;a=z.slice(0),p=z[0],f=z[z.length-1],l=[];const j=d.length;if(z.length===j&&p!==f)for(let I of Array.from(z))l.push((I-p)/(f-p));else{for(let I=0;I2){const I=z.map((L,H)=>H/(z.length-1)),P=z.map(L=>(L-p)/(f-p));P.every((L,H)=>I[H]===L)||($=L=>{if(L<=0||L>=1)return L;let H=0;for(;L>=P[H+1];)H++;const M=(L-P[H])/(P[H+1]-P[H]);return I[H]+M*(I[H+1]-I[H])})}}return i=[p,f],A},A.mode=function(z){return arguments.length?(r=z,T(),A):r},A.range=function(z,j){return k(z),A},A.out=function(z){return u=z,A},A.spread=function(z){return arguments.length?(o=z,A):o},A.correctLightness=function(z){return z==null&&(z=!0),g=z,T(),g?_=function(j){const I=R(0,!0).lab()[0],P=R(1,!0).lab()[0],L=I>P;let H=R(j,!0).lab()[0];const M=I+(P-I)*j;let V=H-M,B=0,F=1,q=20;for(;Math.abs(V)>.01&&q-- >0;)(function(){return L&&(V*=-1),V<0?(B=j,j+=(F-j)*.5):(F=j,j+=(B-j)*.5),H=R(j,!0).lab()[0],V=H-M})();return j}:_=j=>j,A},A.padding=function(z){return z!=null?(Ft(z)==="number"&&(z=[z,z]),s=z,A):s},A.colors=function(z,j){arguments.length<2&&(j="hex");let I=[];if(arguments.length===0)I=d.slice(0);else if(z===1)I=[A(.5)];else if(z>1){const P=i[0],L=i[1]-P;I=eye(0,z).map(H=>A(P+H/(z-1)*L))}else{e=[];let P=[];if(c&&c.length>2)for(let L=1,H=c.length,M=1<=H;M?LH;M?L++:L--)P.push((c[L-1]+c[L])*.5);else P=i;I=P.map(L=>A(L))}return zt[j]&&(I=I.map(P=>P[j]())),I},A.cache=function(z){return z!=null?(w=z,A):w},A.gamma=function(z){return z!=null?(x=z,A):x},A.nodata=function(z){return z!=null?(n=zt(z),A):n},A}function eye(e,r,n){let o=[],i=ea;i?l++:l--)o.push(l);return o}const tye=function(e){let r=[1,1];for(let n=1;nnew Ne(a)),e.length===2)[n,o]=e.map(a=>a.lab()),r=function(a){const l=[0,1,2].map(s=>n[s]+a*(o[s]-n[s]));return new Ne(l,"lab")};else if(e.length===3)[n,o,i]=e.map(a=>a.lab()),r=function(a){const l=[0,1,2].map(s=>(1-a)*(1-a)*n[s]+2*(1-a)*a*o[s]+a*a*i[s]);return new Ne(l,"lab")};else if(e.length===4){let a;[n,o,i,a]=e.map(l=>l.lab()),r=function(l){const s=[0,1,2].map(c=>(1-l)*(1-l)*(1-l)*n[c]+3*(1-l)*(1-l)*l*o[c]+3*(1-l)*l*l*i[c]+l*l*l*a[c]);return new Ne(s,"lab")}}else if(e.length>=5){let a,l,s;a=e.map(c=>c.lab()),s=e.length-1,l=tye(s),r=function(c){const d=1-c,u=[0,1,2].map(p=>a.reduce((f,g,v)=>f+l[v]*d**(s-v)*c**v*g[p],0));return new Ne(u,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return r},nye=e=>{const r=rye(e);return r.scale=()=>wb(r),r},{round:dP}=Math;Ne.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(dP)},Ne.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((r,n)=>n<3?e===!1?r:dP(r):r)},Object.assign(zt,{rgb:(...e)=>new Ne(...e,"rgb")}),Rt.format.rgb=(...e)=>{const r=jt(e,"rgba");return r[3]===void 0&&(r[3]=1),r},Rt.autodetect.push({p:3,test:(...e)=>{if(e=jt(e,"rgba"),Ft(e)==="array"&&(e.length===3||e.length===4&&Ft(e[3])=="number"&&e[3]>=0&&e[3]<=1))return"rgb"}});const qa=(e,r,n)=>{if(!qa[n])throw new Error("unknown blend mode "+n);return qa[n](e,r)},Kc=e=>(r,n)=>{const o=zt(n).rgb(),i=zt(r).rgb();return zt.rgb(e(o,i))},Zc=e=>(r,n)=>{const o=[];return o[0]=e(r[0],n[0]),o[1]=e(r[1],n[1]),o[2]=e(r[2],n[2]),o},oye=e=>e,iye=(e,r)=>e*r/255,aye=(e,r)=>e>r?r:e,lye=(e,r)=>e>r?e:r,sye=(e,r)=>255*(1-(1-e/255)*(1-r/255)),cye=(e,r)=>r<128?2*e*r/255:255*(1-2*(1-e/255)*(1-r/255)),dye=(e,r)=>255*(1-(1-r/255)/(e/255)),uye=(e,r)=>e===255?255:(e=255*(r/255)/(1-e/255),e>255?255:e);qa.normal=Kc(Zc(oye)),qa.multiply=Kc(Zc(iye)),qa.screen=Kc(Zc(sye)),qa.overlay=Kc(Zc(cye)),qa.darken=Kc(Zc(aye)),qa.lighten=Kc(Zc(lye)),qa.dodge=Kc(Zc(uye)),qa.burn=Kc(Zc(dye));const{pow:pye,sin:hye,cos:fye}=Math;function mye(e=300,r=-1.5,n=1,o=1,i=[0,1]){let a=0,l;Ft(i)==="array"?l=i[1]-i[0]:(l=0,i=[i,i]);const s=function(c){const d=As*((e+120)/360+r*c),u=pye(i[0]+l*c,o),f=(a!==0?n[0]+c*a:n)*u*(1-u)/2,g=fye(d),v=hye(d),w=u+f*(-.14861*g+1.78277*v),x=u+f*(-.29227*g-.90649*v),k=u+f*(1.97294*g);return zt(t_([w*255,x*255,k*255,1]))};return s.start=function(c){return c==null?e:(e=c,s)},s.rotations=function(c){return c==null?r:(r=c,s)},s.gamma=function(c){return c==null?o:(o=c,s)},s.hue=function(c){return c==null?n:(n=c,Ft(n)==="array"?(a=n[1]-n[0],a===0&&(n=n[1])):a=0,s)},s.lightness=function(c){return c==null?i:(Ft(c)==="array"?(i=c,l=c[1]-c[0]):(i=[c,c],l=0),s)},s.scale=()=>zt.scale(s),s.hue(n),s}const gye="0123456789abcdef",{floor:yye,random:vye}=Math,bye=(e=vye)=>{let r="#";for(let n=0;n<6;n++)r+=gye.charAt(yye(e()*16));return new Ne(r,"hex")},{log:uP,pow:xye,floor:wye,abs:kye}=Math;function pP(e,r=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Ft(e)==="object"&&(e=Object.values(e)),e.forEach(o=>{r&&Ft(o)==="object"&&(o=o[r]),o!=null&&!isNaN(o)&&(n.values.push(o),n.sum+=o,on.max&&(n.max=o),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(o,i)=>hP(n,o,i),n}function hP(e,r="equal",n=7){Ft(e)=="array"&&(e=pP(e));const{min:o,max:i}=e,a=e.values.sort((s,c)=>s-c);if(n===1)return[o,i];const l=[];if(r.substr(0,1)==="c"&&(l.push(o),l.push(i)),r.substr(0,1)==="e"){l.push(o);for(let s=1;s 0");const s=Math.LOG10E*uP(o),c=Math.LOG10E*uP(i);l.push(o);for(let d=1;d200&&(p=!1)}const v={};for(let x=0;xx-k),l.push(w[0]);for(let x=1;x{e=new Ne(e),r=new Ne(r);const n=e.luminance(),o=r.luminance();return n>o?(n+.05)/(o+.05):(o+.05)/(n+.05)};const fP=.027,Sye=5e-4,Eye=.1,mP=1.14,kb=.022,gP=1.414,Cye=(e,r)=>{e=new Ne(e),r=new Ne(r),e.alpha()<1&&(e=Th(r,e,e.alpha(),"rgb"));const n=yP(...e.rgb()),o=yP(...r.rgb()),i=n>=kb?n:n+Math.pow(kb-n,gP),a=o>=kb?o:o+Math.pow(kb-o,gP),l=Math.pow(a,.56)-Math.pow(i,.57),s=Math.pow(a,.65)-Math.pow(i,.62),c=Math.abs(a-i)0?c-fP:c+fP)*100};function yP(e,r,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(r/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:Ms,pow:yn,min:$ye,max:Rye,atan2:vP,abs:bP,cos:_b,sin:xP,exp:zye,PI:wP}=Math;function Tye(e,r,n=1,o=1,i=1){var a=function(O){return 360*O/(2*wP)},l=function(O){return 2*wP*O/360};e=new Ne(e),r=new Ne(r);const[s,c,d]=Array.from(e.lab()),[u,p,f]=Array.from(r.lab()),g=(s+u)/2,v=Ms(yn(c,2)+yn(d,2)),w=Ms(yn(p,2)+yn(f,2)),x=(v+w)/2,k=.5*(1-Ms(yn(x,7)/(yn(x,7)+yn(25,7)))),C=c*(1+k),_=p*(1+k),$=Ms(yn(C,2)+yn(d,2)),R=Ms(yn(_,2)+yn(f,2)),T=($+R)/2,A=a(vP(d,C)),z=a(vP(f,_)),j=A>=0?A:A+360,I=z>=0?z:z+360,P=bP(j-I)>180?(j+I+360)/2:(j+I)/2,L=1-.17*_b(l(P-30))+.24*_b(l(2*P))+.32*_b(l(3*P+6))-.2*_b(l(4*P-63));let H=I-j;H=bP(H)<=180?H:I<=j?H+360:H-360,H=2*Ms($*R)*xP(l(H)/2);const M=u-s,V=R-$,B=1+.015*yn(g-50,2)/Ms(20+yn(g-50,2)),F=1+.045*T,q=1+.015*T*L,G=30*zye(-yn((P-275)/25,2)),Y=-(2*Ms(yn(T,7)/(yn(T,7)+yn(25,7))))*xP(2*l(G)),K=Ms(yn(M/(n*B),2)+yn(V/(o*F),2)+yn(H/(i*q),2)+Y*(V/(o*F))*(H/(i*q)));return Rye(0,$ye(100,K))}function jye(e,r,n="lab"){e=new Ne(e),r=new Ne(r);const o=e.get(n),i=r.get(n);let a=0;for(let l in o){const s=(o[l]||0)-(i[l]||0);a+=s*s}return Math.sqrt(a)}const Aye=(...e)=>{try{return new Ne(...e),!0}catch{return!1}},Dye={cool(){return wb([zt.hsl(180,1,.9),zt.hsl(250,.7,.4)])},hot(){return wb(["#000","#f00","#ff0","#fff"]).mode("rgb")}},v_={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},kP=Object.keys(v_),_P=new Map(kP.map(e=>[e.toLowerCase(),e])),Mye=typeof Proxy=="function"?new Proxy(v_,{get(e,r){const n=r.toLowerCase();if(_P.has(n))return e[_P.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(kP)}}):v_,Nye=(...e)=>{e=jt(e,"cmyk");const[r,n,o,i]=e,a=e.length>4?e[4]:1;return i===1?[0,0,0,a]:[r>=1?0:255*(1-r)*(1-i),n>=1?0:255*(1-n)*(1-i),o>=1?0:255*(1-o)*(1-i),a]},{max:SP}=Math,Pye=(...e)=>{let[r,n,o]=jt(e,"rgb");r=r/255,n=n/255,o=o/255;const i=1-SP(r,SP(n,o)),a=i<1?1/(1-i):0,l=(1-r-i)*a,s=(1-n-i)*a,c=(1-o-i)*a;return[l,s,c,i]};Ne.prototype.cmyk=function(){return Pye(this._rgb)},Object.assign(zt,{cmyk:(...e)=>new Ne(...e,"cmyk")}),Rt.format.cmyk=Nye,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"cmyk"),Ft(e)==="array"&&e.length===4)return"cmyk"}});const Bye=(...e)=>{const r=jt(e,"hsla");let n=Rh(e)||"lsa";return r[0]=Ki(r[0]||0)+"deg",r[1]=Ki(r[1]*100)+"%",r[2]=Ki(r[2]*100)+"%",n==="hsla"||r.length>3&&r[3]<1?(r[3]="/ "+(r.length>3?r[3]:1),n="hsla"):r.length=3,`${n.substr(0,3)}(${r.join(" ")})`},Iye=(...e)=>{const r=jt(e,"lab");let n=Rh(e)||"lab";return r[0]=Ki(r[0])+"%",r[1]=Ki(r[1]),r[2]=Ki(r[2]),n==="laba"||r.length>3&&r[3]<1?r[3]="/ "+(r.length>3?r[3]:1):r.length=3,`lab(${r.join(" ")})`},Oye=(...e)=>{const r=jt(e,"lch");let n=Rh(e)||"lab";return r[0]=Ki(r[0])+"%",r[1]=Ki(r[1]),r[2]=isNaN(r[2])?"none":Ki(r[2])+"deg",n==="lcha"||r.length>3&&r[3]<1?r[3]="/ "+(r.length>3?r[3]:1):r.length=3,`lch(${r.join(" ")})`},Lye=(...e)=>{const r=jt(e,"lab");return r[0]=Ki(r[0]*100)+"%",r[1]=r_(r[1]),r[2]=r_(r[2]),r.length>3&&r[3]<1?r[3]="/ "+(r.length>3?r[3]:1):r.length=3,`oklab(${r.join(" ")})`},EP=(...e)=>{const[r,n,o,...i]=jt(e,"rgb"),[a,l,s]=f_(r,n,o),[c,d,u]=iP(a,l,s);return[c,d,u,...i.length>0&&i[0]<1?[i[0]]:[]]},Fye=(...e)=>{const r=jt(e,"lch");return r[0]=Ki(r[0]*100)+"%",r[1]=r_(r[1]),r[2]=isNaN(r[2])?"none":Ki(r[2])+"deg",r.length>3&&r[3]<1?r[3]="/ "+(r.length>3?r[3]:1):r.length=3,`oklch(${r.join(" ")})`},{round:b_}=Math,Vye=(...e)=>{const r=jt(e,"rgba");let n=Rh(e)||"rgb";if(n.substr(0,3)==="hsl")return Bye(lP(r),n);if(n.substr(0,3)==="lab"){const o=Zg();Ds("d50");const i=Iye(a_(r),n);return Ds(o),i}if(n.substr(0,3)==="lch"){const o=Zg();Ds("d50");const i=Oye(d_(r),n);return Ds(o),i}return n.substr(0,5)==="oklab"?Lye(f_(r)):n.substr(0,5)==="oklch"?Fye(EP(r)):(r[0]=b_(r[0]),r[1]=b_(r[1]),r[2]=b_(r[2]),(n==="rgba"||r.length>3&&r[3]<1)&&(r[3]="/ "+(r.length>3?r[3]:1),n="rgba"),`${n.substr(0,3)}(${r.slice(0,n==="rgb"?3:4).join(" ")})`)},CP=(...e)=>{e=jt(e,"lch");const[r,n,o,...i]=e,[a,l,s]=oP(r,n,o),[c,d,u]=h_(a,l,s);return[c,d,u,...i.length>0&&i[0]<1?[i[0]]:[]]},Ns=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,Ha=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Sb=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,Zi=/\s*/.source,Mh=/\s+/.source,x_=/\s*,\s*/.source,Eb=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Nh=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,$P=new RegExp("^rgba?\\("+Zi+[Ns,Ns,Ns].join(Mh)+Nh+"\\)$"),RP=new RegExp("^rgb\\("+Zi+[Ns,Ns,Ns].join(x_)+Zi+"\\)$"),zP=new RegExp("^rgba\\("+Zi+[Ns,Ns,Ns,Ha].join(x_)+Zi+"\\)$"),TP=new RegExp("^hsla?\\("+Zi+[Eb,Sb,Sb].join(Mh)+Nh+"\\)$"),jP=new RegExp("^hsl?\\("+Zi+[Eb,Sb,Sb].join(x_)+Zi+"\\)$"),AP=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,DP=new RegExp("^lab\\("+Zi+[Ha,Ha,Ha].join(Mh)+Nh+"\\)$"),MP=new RegExp("^lch\\("+Zi+[Ha,Ha,Eb].join(Mh)+Nh+"\\)$"),NP=new RegExp("^oklab\\("+Zi+[Ha,Ha,Ha].join(Mh)+Nh+"\\)$"),PP=new RegExp("^oklch\\("+Zi+[Ha,Ha,Eb].join(Mh)+Nh+"\\)$"),{round:BP}=Math,Ph=e=>e.map((r,n)=>n<=2?Au(BP(r),0,255):r),vn=(e,r=0,n=100,o=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,o?e=r+(e+1)*.5*(n-r):e=r+e*(n-r)),+e),Po=(e,r)=>e==="none"?r:e,w_=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let r;if(Rt.format.named)try{return Rt.format.named(e)}catch{}if((r=e.match($P))||(r=e.match(RP))){let n=r.slice(1,4);for(let i=0;i<3;i++)n[i]=+vn(Po(n[i],0),0,255);n=Ph(n);const o=r[4]!==void 0?+vn(r[4],0,1):1;return n[3]=o,n}if(r=e.match(zP)){const n=r.slice(1,5);for(let o=0;o<4;o++)n[o]=+vn(n[o],0,255);return n}if((r=e.match(TP))||(r=e.match(jP))){const n=r.slice(1,4);n[0]=+Po(n[0].replace("deg",""),0),n[1]=+vn(Po(n[1],0),0,100)*.01,n[2]=+vn(Po(n[2],0),0,100)*.01;const o=Ph(p_(n)),i=r[4]!==void 0?+vn(r[4],0,1):1;return o[3]=i,o}if(r=e.match(AP)){const n=r.slice(1,4);n[1]*=.01,n[2]*=.01;const o=p_(n);for(let i=0;i<3;i++)o[i]=BP(o[i]);return o[3]=+r[4],o}if(r=e.match(DP)){const n=r.slice(1,4);n[0]=vn(Po(n[0],0),0,100),n[1]=vn(Po(n[1],0),-125,125,!0),n[2]=vn(Po(n[2],0),-125,125,!0);const o=Zg();Ds("d50");const i=Ph(o_(n));Ds(o);const a=r[4]!==void 0?+vn(r[4],0,1):1;return i[3]=a,i}if(r=e.match(MP)){const n=r.slice(1,4);n[0]=vn(n[0],0,100),n[1]=vn(Po(n[1],0),0,150,!1),n[2]=+Po(n[2].replace("deg",""),0);const o=Zg();Ds("d50");const i=Ph(c_(n));Ds(o);const a=r[4]!==void 0?+vn(r[4],0,1):1;return i[3]=a,i}if(r=e.match(NP)){const n=r.slice(1,4);n[0]=vn(Po(n[0],0),0,1),n[1]=vn(Po(n[1],0),-.4,.4,!0),n[2]=vn(Po(n[2],0),-.4,.4,!0);const o=Ph(h_(n)),i=r[4]!==void 0?+vn(r[4],0,1):1;return o[3]=i,o}if(r=e.match(PP)){const n=r.slice(1,4);n[0]=vn(Po(n[0],0),0,1),n[1]=vn(Po(n[1],0),0,.4,!1),n[2]=+Po(n[2].replace("deg",""),0);const o=Ph(CP(n)),i=r[4]!==void 0?+vn(r[4],0,1):1;return o[3]=i,o}};w_.test=e=>$P.test(e)||TP.test(e)||DP.test(e)||MP.test(e)||NP.test(e)||PP.test(e)||RP.test(e)||zP.test(e)||jP.test(e)||AP.test(e)||e==="transparent",Ne.prototype.css=function(e){return Vye(this._rgb,e)};const qye=(...e)=>new Ne(...e,"css");zt.css=qye,Rt.format.css=w_,Rt.autodetect.push({p:5,test:(e,...r)=>{if(!r.length&&Ft(e)==="string"&&w_.test(e))return"css"}}),Rt.format.gl=(...e)=>{const r=jt(e,"rgba");return r[0]*=255,r[1]*=255,r[2]*=255,r};const Hye=(...e)=>new Ne(...e,"gl");zt.gl=Hye,Ne.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},Ne.prototype.hex=function(e){return tP(this._rgb,e)};const Uye=(...e)=>new Ne(...e,"hex");zt.hex=Uye,Rt.format.hex=eP,Rt.autodetect.push({p:4,test:(e,...r)=>{if(!r.length&&Ft(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:Cb}=Math,IP=e=>{const r=e/100;let n,o,i;return r<66?(n=255,o=r<6?0:-155.25485562709179-.44596950469579133*(o=r-2)+104.49216199393888*Cb(o),i=r<20?0:-254.76935184120902+.8274096064007395*(i=r-10)+115.67994401066147*Cb(i)):(n=351.97690566805693+.114206453784165*(n=r-55)-40.25366309332127*Cb(n),o=325.4494125711974+.07943456536662342*(o=r-50)-28.0852963507957*Cb(o),i=255),[n,o,i,1]},{round:Wye}=Math,Gye=(...e)=>{const r=jt(e,"rgb"),n=r[0],o=r[2];let i=1e3,a=4e4;const l=.4;let s;for(;a-i>l;){s=(a+i)*.5;const c=IP(s);c[2]/c[0]>=o/n?a=s:i=s}return Wye(s)};Ne.prototype.temp=Ne.prototype.kelvin=Ne.prototype.temperature=function(){return Gye(this._rgb)};const k_=(...e)=>new Ne(...e,"temp");Object.assign(zt,{temp:k_,kelvin:k_,temperature:k_}),Rt.format.temp=Rt.format.kelvin=Rt.format.temperature=IP,Ne.prototype.oklch=function(){return EP(this._rgb)},Object.assign(zt,{oklch:(...e)=>new Ne(...e,"oklch")}),Rt.format.oklch=CP,Rt.autodetect.push({p:2,test:(...e)=>{if(e=jt(e,"oklch"),Ft(e)==="array"&&e.length===3)return"oklch"}}),Object.assign(zt,{analyze:pP,average:Z1e,bezier:nye,blend:qa,brewer:Mye,Color:Ne,colors:zh,contrast:_ye,contrastAPCA:Cye,cubehelix:mye,deltaE:Tye,distance:jye,input:Rt,interpolate:Th,limits:hP,mix:Th,random:bye,scale:wb,scales:Dye,valid:Aye});const __=[.96,.907,.805,.697,.605,.547,.518,.445,.395,.34],OP=[.32,.16,.08,.04,0,0,.04,.08,.16,.32];function Yye(e){const r=e.get("hsl.l");return __.reduce((n,o)=>Math.abs(o-r)a===n),i=__.map(a=>r.set("hsl.l",a)).map(a=>zt(a)).map((a,l)=>{const s=OP[l]-OP[o];return s>=0?a.saturate(s):a.desaturate(s*-1)});return i[o]=zt(e),{baseColorIndex:o,colors:i}}function Kye(e){return Xye(e).colors.map(r=>r.hex())}const LP={fill:"#3b82f6",stroke:"#2563eb",hiContrast:"#eff6ff",loContrast:"#bfdbfe"},FP={fill:"#0284c7",stroke:"#0369a1",hiContrast:"#f0f9ff",loContrast:"#B6ECF7"},VP={fill:"#64748b",stroke:"#475569",hiContrast:"#f8fafc",loContrast:"#cbd5e1"},Zye={primary:LP,blue:LP,secondary:FP,sky:FP,muted:VP,slate:VP,gray:{fill:"#737373",stroke:"#525252",hiContrast:"#fafafa",loContrast:"#d4d4d4"},red:{fill:"#AC4D39",stroke:"#853A2D",hiContrast:"#FBD3CB",loContrast:"#f5b2a3"},green:{fill:"#428a4f",stroke:"#2d5d39",hiContrast:"#f8fafc",loContrast:"#c2f0c2"},amber:{fill:"#A35829",stroke:"#7E451D",hiContrast:"#FFE0C2",loContrast:"#f9b27c"},indigo:{fill:"#6366f1",stroke:"#4f46e5",hiContrast:"#eef2ff",loContrast:"#c7d2fe"}},Qye={line:"#8D8D8D",labelBg:"#18191B",label:"#C9C9C9"},qP={line:"#64748b",labelBg:"#0f172a",label:"#cbd5e1"},HP={line:"#3b82f6",labelBg:"#172554",label:"#60a5fa"},UP={line:"#0ea5e9",labelBg:"#082f49",label:"#38bdf8"},Jye={amber:{line:"#b45309",labelBg:"#78350f",label:"#FFE0C2"},blue:HP,gray:Qye,green:{line:"#15803d",labelBg:"#052e16",label:"#22c55e"},indigo:{line:"#6366f1",labelBg:"#1e1b4b",label:"#818cf8"},muted:qP,primary:HP,red:{line:"#AC4D39",labelBg:"#b91c1c",label:"#f5b2a3"},secondary:UP,sky:UP,slate:qP},WP=60,GP=2,YP=1;function e0e(e){He(zt.valid(e),`Invalid color: ${e}`);const r=Kye(e),n=r[6],o=t0e(n);return{elements:{fill:n,stroke:r[7],hiContrast:o[0],loContrast:o[1]},relationships:{line:r[4],label:r[3],labelBg:r[9]}}}function t0e(e){const r=zt(e);let n=r.brighten(GP),o=r.darken(GP),i,a,l,s;do i=n,a=o,n=n.brighten(YP),o=o.darken(YP),l=zt.contrastAPCA(r,n),s=zt.contrastAPCA(r,o);while(Math.abs(l)Math.abs(s)?[n.brighten(.4).hex(),n.hex()]:[o.darken(.4).hex(),o.hex()]}const r0e={color:"primary",size:"md",opacity:15,shape:"rectangle",group:{opacity:15,border:"dashed"},relationship:{color:"gray",line:"dashed",arrow:"normal"}},n0e=["rectangle","person","browser","mobile","cylinder","storage","queue"],o0e={colors:Yge(["amber","blue","gray","slate","green","indigo","muted","primary","red","secondary","sky"],e=>({elements:Zye[e],relationships:Jye[e]})),sizes:{xs:{width:180,height:100},sm:{width:240,height:135},md:{width:320,height:180},lg:{width:420,height:234},xl:{width:520,height:290}},spacing:{xs:8,sm:10,md:16,lg:24,xl:32},textSizes:{xs:13.33,sm:16,md:19.2,lg:23.04,xl:27.65}};function $b({size:e,padding:r,textSize:n,...o},i=S_.defaults.size){return e??=i,n??=e,r??=e,{...o,size:e,padding:r,textSize:n}}const S_={theme:o0e,defaults:r0e};let XP=class ON{constructor(r){this.config=r,this.theme=r.theme,this.defaults=r.defaults}theme;defaults;static DEFAULT=new ON(S_);static from(...r){return Ll(r,1)?new ON(XN(...r,S_)):this.DEFAULT}get elementColors(){return this.theme.colors[this.defaults.color].elements}get relationshipColors(){return this.theme.colors[this.defaults.relationship.color].relationships}get groupColors(){const r=this.defaults.group?.color;return r?ar(this,"defaultGroup",()=>({...this.elementColors,...this.theme.colors[r].elements})):this.elementColors}isDefaultColor(r){return r===this.defaults.color}colors(r){if(r??=this.defaults.color,this.isThemeColor(r))return this.theme.colors[r];throw new Error(`Unknown color: ${r}`)}fontSize(r){return r??=this.defaults.text??this.defaults.size,this.theme.textSizes[r]}padding(r){return r??=this.defaults.padding??this.defaults.size,this.theme.spacing[r]}isThemeColor(r){return r in this.theme.colors}nodeSizes(r){const n=$b(r,this.defaults.size);return{sizes:n,values:{sizes:this.theme.sizes[n.size],padding:this.padding(n.padding),textSize:this.fontSize(n.textSize)}}}computeFrom(r){return this.isThemeColor(r)?this.theme.colors[r]:ar(this,`compute-${r}`,()=>{if(!zt.valid(r))throw new Error(`Invalid color value: "${r}"`);return e0e(r)})}equals(r){return r===this?!0:yb(this.config,r.config)}};function Qg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qc(e){return typeof e=="string"}const E_={done:!1,hasNext:!1};function Ps(e,...r){let n=e,o=r.map(a=>"lazy"in a?i0e(a):void 0),i=0;for(;i65;)++o;return+u.slice(p-1,o)}return f=c&&c.indexOf(u.charAt(p)),f>-1?f+76:(f=u.charCodeAt(p)||0,f<45||f>127?f:f<46?65:f<48?f-1:f<58?f+18:f<65?f-11:f<91?f+11:f<97?f-37:f<123?f+5:f-63)}if((r+="")!=(n+="")){for(;a;)if(i=d(r,l++),a=d(n,s++),i<76&&a<76&&i>66&&a>66&&(i=d(r,l,l),a=d(n,s,l=o),s=o),i!=a)return i{if(n===o)return 0;if(!n)return-1;if(!o)return 1;const i=n.split(e),a=o.split(e),l=Math.min(i.length,a.length);for(let c=0;c0?e.slice(0,r):null}function Jg(e){const r=e.lastIndexOf(".");return r>0?e.slice(r+1):e}const e1=e=>$_(e)?e:e.id;function Yn(e,r){const n=e1(e);return r?e1(r).startsWith(n+"."):o=>{const i=e1(o);return n.startsWith(i+".")}}function eB(e,r){if(!r)return i=>eB(e,i);const n=e1(e),o=e1(r);return n===o||o.startsWith(n+".")||n.startsWith(o+".")}function tB(e,r){return n=>Yn(e,n)}function Tb(e){return($_(e)?e:e.id).split(".").length}function t1(e,r){const n=e.split(".");if(n.length<2)return null;const o=r.split(".");if(o.length<2)return null;let i=[];for(let a=0;ai===0?(n.push(o),n):(n.unshift(`${n[0]}.${o}`),n),[])}function c0e(e,r){let n=r;for(const o of e)Yn(o,n)&&(n=o);return n!==r?n:null}function Jc(e){const r=[],n=[...e];let o;for(;o=n.shift();){let i;for(;i=c0e(n,o);)r.push(n.splice(n.indexOf(i),1)[0]);r.push(o)}return r}function rB(e,r){if(!e||$_(e)){const o=e??"asc";return i=>rB(i,o)}const n=r==="desc"?-1:1;return e.map(o=>({item:o,fqn:o.id.split(".")})).sort((o,i)=>{if(o.fqn.length!==i.fqn.length)return(o.fqn.length-i.fqn.length)*n;for(let a=0;ao)}var jb={},nB;function d0e(){return nB||(nB=1,jb.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",jb.SYMBOL_SUPPORT=typeof Symbol<"u"),jb}var R_,oB;function Ab(){if(oB)return R_;oB=1;var e=d0e(),r=e.ARRAY_BUFFER_SUPPORT,n=e.SYMBOL_SUPPORT;return R_=function(i,a){var l,s,c,d,u;if(!i)throw new Error("obliterator/forEach: invalid iterable.");if(typeof a!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(i)||r&&ArrayBuffer.isView(i)||typeof i=="string"||i.toString()==="[object Arguments]"){for(c=0,d=i.length;c=n?{done:!0}:{done:!1,value:r[o++]}})},e.empty=function(){var r=new e(function(){return{done:!0}});return r},e.fromSequence=function(r){var n=0,o=r.length;return new e(function(){return n>=o?{done:!0}:{done:!1,value:r[n++]}})},e.is=function(r){return r instanceof e?!0:typeof r=="object"&&r!==null&&typeof r.next=="function"},z_=e,z_}const lB=-1,Db=0,r1=1,Mb=2,T_=3,j_=4,A_=5,D_=6,sB=7,cB=8,dB=typeof self=="object"?self:globalThis,u0e=(e,r)=>{const n=(i,a)=>(e.set(a,i),i),o=i=>{if(e.has(i))return e.get(i);const[a,l]=r[i];switch(a){case Db:case lB:return n(l,i);case r1:{const s=n([],i);for(const c of l)s.push(o(c));return s}case Mb:{const s=n({},i);for(const[c,d]of l)s[o(c)]=o(d);return s}case T_:return n(new Date(l),i);case j_:{const{source:s,flags:c}=l;return n(new RegExp(s,c),i)}case A_:{const s=n(new Map,i);for(const[c,d]of l)s.set(o(c),o(d));return s}case D_:{const s=n(new Set,i);for(const c of l)s.add(o(c));return s}case sB:{const{name:s,message:c}=l;return n(new dB[s](c),i)}case cB:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(new dB[a](l),i)};return o},uB=e=>u0e(new Map,e)(0),Bh="",{toString:p0e}={},{keys:h0e}=Object,n1=e=>{const r=typeof e;if(r!=="object"||!e)return[Db,r];const n=p0e.call(e).slice(8,-1);switch(n){case"Array":return[r1,Bh];case"Object":return[Mb,Bh];case"Date":return[T_,Bh];case"RegExp":return[j_,Bh];case"Map":return[A_,Bh];case"Set":return[D_,Bh];case"DataView":return[r1,n]}return n.includes("Array")?[r1,n]:n.includes("Error")?[sB,n]:[Mb,n]},Nb=([e,r])=>e===Db&&(r==="function"||r==="symbol"),f0e=(e,r,n,o)=>{const i=(l,s)=>{const c=o.push(l)-1;return n.set(s,c),c},a=l=>{if(n.has(l))return n.get(l);let[s,c]=n1(l);switch(s){case Db:{let u=l;switch(c){case"bigint":s=cB,u=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);u=null;break;case"undefined":return i([lB],l)}return i([s,u],l)}case r1:{if(c){let f=l;return c==="DataView"?f=new Uint8Array(l.buffer):c==="ArrayBuffer"&&(f=new Uint8Array(l)),i([c,[...f]],l)}const u=[],p=i([s,u],l);for(const f of l)u.push(a(f));return p}case Mb:{if(c)switch(c){case"BigInt":return i([c,l.toString()],l);case"Boolean":case"Number":case"String":return i([c,l.valueOf()],l)}if(r&&"toJSON"in l)return a(l.toJSON());const u=[],p=i([s,u],l);for(const f of h0e(l))(e||!Nb(n1(l[f])))&&u.push([a(f),a(l[f])]);return p}case T_:return i([s,l.toISOString()],l);case j_:{const{source:u,flags:p}=l;return i([s,{source:u,flags:p}],l)}case A_:{const u=[],p=i([s,u],l);for(const[f,g]of l)(e||!(Nb(n1(f))||Nb(n1(g))))&&u.push([a(f),a(g)]);return p}case D_:{const u=[],p=i([s,u],l);for(const f of l)(e||!Nb(n1(f)))&&u.push(a(f));return p}}const{message:d}=l;return i([s,{name:c,message:d}],l)};return a},pB=(e,{json:r,lossy:n}={})=>{const o=[];return f0e(!(r||n),!!r,new Map,o)(e),o},o1=typeof structuredClone=="function"?(e,r)=>r&&("json"in r||"lossy"in r)?uB(pB(e,r)):structuredClone(e):(e,r)=>uB(pB(e,r)),hB=mB("end"),fB=mB("start");function mB(e){return r;function r(n){const o=n&&n.position&&n.position[e]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function gB(e){const r=fB(e),n=hB(e);if(r&&n)return{start:r,end:n}}const Mu=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],M_={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Mu,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Mu],h2:[["className","sr-only"]],img:[...Mu,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Mu,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Mu],table:[...Mu],ul:[...Mu,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},ed={}.hasOwnProperty;function m0e(e,r){let n={type:"root",children:[]};const o={schema:r?{...M_,...r}:M_,stack:[]},i=yB(o,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function yB(e,r){if(r&&typeof r=="object"){const n=r;switch(typeof n.type=="string"?n.type:""){case"comment":return g0e(e,n);case"doctype":return y0e(e,n);case"element":return v0e(e,n);case"root":return b0e(e,n);case"text":return x0e(e,n)}}}function g0e(e,r){if(e.schema.allowComments){const n=typeof r.value=="string"?r.value:"",o=n.indexOf("-->"),a={type:"comment",value:o<0?n:n.slice(0,o)};return i1(a,r),a}}function y0e(e,r){if(e.schema.allowDoctypes){const n={type:"doctype"};return i1(n,r),n}}function v0e(e,r){const n=typeof r.tagName=="string"?r.tagName:"";e.stack.push(n);const o=vB(e,r.children),i=w0e(e,r.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&ed.call(e.schema.ancestors,n))){const s=e.schema.ancestors[n];let c=-1;for(a=!1;++c1){let i=!1,a=0;for(;++a-1&&a>c||l>-1&&a>l||s>-1&&a>s)return!0;let d=-1;for(;++d4&&r.slice(0,4).toLowerCase()==="data")return n}function S0e(e){return function(r){return m0e(r,e)}}const E0e=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class a1{constructor(r,n,o){this.normal=n,this.property=r,o&&(this.space=o)}}a1.prototype.normal={},a1.prototype.property={},a1.prototype.space=void 0;function kB(e,r){const n={},o={};for(const i of e)Object.assign(n,i.property),Object.assign(o,i.normal);return new a1(n,o,r)}function N_(e){return e.toLowerCase()}class Jo{constructor(r,n){this.attribute=n,this.property=r}}Jo.prototype.attribute="",Jo.prototype.booleanish=!1,Jo.prototype.boolean=!1,Jo.prototype.commaOrSpaceSeparated=!1,Jo.prototype.commaSeparated=!1,Jo.prototype.defined=!1,Jo.prototype.mustUseProperty=!1,Jo.prototype.number=!1,Jo.prototype.overloadedBoolean=!1,Jo.prototype.property="",Jo.prototype.spaceSeparated=!1,Jo.prototype.space=void 0;let C0e=0;const At=Nu(),bn=Nu(),_B=Nu(),Ie=Nu(),Cr=Nu(),Ih=Nu(),bi=Nu();function Nu(){return 2**++C0e}const P_={__proto__:null,boolean:At,booleanish:bn,commaOrSpaceSeparated:bi,commaSeparated:Ih,number:Ie,overloadedBoolean:_B,spaceSeparated:Cr},B_=Object.keys(P_);class I_ extends Jo{constructor(r,n,o,i){let a=-1;if(super(r,n),SB(this,"space",i),typeof o=="number")for(;++a4&&n.slice(0,4)==="data"&&T0e.test(r)){if(r.charAt(4)==="-"){const a=r.slice(5).replace(jB,D0e);o="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=r.slice(4);if(!jB.test(a)){let l=a.replace(z0e,A0e);l.charAt(0)!=="-"&&(l="-"+l),r="data"+l}}i=I_}return new i(o,r)}function A0e(e){return"-"+e.toLowerCase()}function D0e(e){return e.charAt(1).toUpperCase()}const M0e=kB([EB,$0e,RB,zB,TB],"html"),AB=kB([EB,R0e,RB,zB,TB],"svg"),DB={}.hasOwnProperty;function N0e(e,r){const n=r||{};function o(i,...a){let l=o.invalid;const s=o.handlers;if(i&&DB.call(i,e)){const c=String(i[e]);l=DB.call(s,c)?s[c]:o.unknown}if(l)return l.call(this,i,...a)}return o.handlers=n.handlers||{},o.invalid=n.invalid,o.unknown=n.unknown,o}const P0e=/["&'<>`]/g,B0e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,I0e=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,O0e=/[|\\{}()[\]^$+*?.]/g,MB=new WeakMap;function L0e(e,r){if(e=e.replace(r.subset?F0e(r.subset):P0e,o),r.subset||r.escapeOnly)return e;return e.replace(B0e,n).replace(I0e,o);function n(i,a,l){return r.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,l.charCodeAt(a+2),r)}function o(i,a,l){return r.format(i.charCodeAt(0),l.charCodeAt(a+1),r)}}function F0e(e){let r=MB.get(e);return r||(r=V0e(e),MB.set(e,r)),r}function V0e(e){const r=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Y0e=["cent","copy","divide","gt","lt","not","para","times"],NB={}.hasOwnProperty,L_={};let Pb;for(Pb in O_)NB.call(O_,Pb)&&(L_[O_[Pb]]=Pb);const X0e=/[^\dA-Za-z]/;function K0e(e,r,n,o){const i=String.fromCharCode(e);if(NB.call(L_,i)){const a=L_[i],l="&"+a;return n&&G0e.includes(a)&&!Y0e.includes(a)&&(!o||r&&r!==61&&X0e.test(String.fromCharCode(r)))?l:l+";"}return""}function Z0e(e,r,n){let o=H0e(e,r,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=K0e(e,r,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const a=W0e(e,r,n.omitOptionalSemicolons);a.length|^->||--!>|"],eve=["<",">"];function tve(e,r,n,o){return o.settings.bogusComments?"":"";function i(a){return Lh(a,Object.assign({},o.settings.characterReferences,{subset:eve}))}}function rve(e,r,n,o){return""}function Bb(e,r){const n=String(e);if(typeof r!="string")throw new TypeError("Expected character");let o=0,i=n.indexOf(r);for(;i!==-1;)o++,i=n.indexOf(r,i+r.length);return o}function nve(e,r){const n=r||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function ove(e){return e.join(" ").trim()}const ive=/[ \t\n\f\r]/g;function F_(e){return typeof e=="object"?e.type==="text"?PB(e.value):!1:PB(e)}function PB(e){return e.replace(ive,"")===""}const On=IB(1),BB=IB(-1),ave=[];function IB(e){return r;function r(n,o,i){const a=n?n.children:ave;let l=(o||0)+e,s=a[l];if(!i)for(;s&&F_(s);)l+=e,s=a[l];return s}}const lve={}.hasOwnProperty;function OB(e){return r;function r(n,o,i){return lve.call(e,n.tagName)&&e[n.tagName](n,o,i)}}const V_=OB({body:cve,caption:q_,colgroup:q_,dd:hve,dt:pve,head:q_,html:sve,li:uve,optgroup:fve,option:mve,p:dve,rp:LB,rt:LB,tbody:yve,td:FB,tfoot:vve,th:FB,thead:gve,tr:bve});function q_(e,r,n){const o=On(n,r,!0);return!o||o.type!=="comment"&&!(o.type==="text"&&F_(o.value.charAt(0)))}function sve(e,r,n){const o=On(n,r);return!o||o.type!=="comment"}function cve(e,r,n){const o=On(n,r);return!o||o.type!=="comment"}function dve(e,r,n){const o=On(n,r);return o?o.type==="element"&&(o.tagName==="address"||o.tagName==="article"||o.tagName==="aside"||o.tagName==="blockquote"||o.tagName==="details"||o.tagName==="div"||o.tagName==="dl"||o.tagName==="fieldset"||o.tagName==="figcaption"||o.tagName==="figure"||o.tagName==="footer"||o.tagName==="form"||o.tagName==="h1"||o.tagName==="h2"||o.tagName==="h3"||o.tagName==="h4"||o.tagName==="h5"||o.tagName==="h6"||o.tagName==="header"||o.tagName==="hgroup"||o.tagName==="hr"||o.tagName==="main"||o.tagName==="menu"||o.tagName==="nav"||o.tagName==="ol"||o.tagName==="p"||o.tagName==="pre"||o.tagName==="section"||o.tagName==="table"||o.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function uve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&o.tagName==="li"}function pve(e,r,n){const o=On(n,r);return!!(o&&o.type==="element"&&(o.tagName==="dt"||o.tagName==="dd"))}function hve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&(o.tagName==="dt"||o.tagName==="dd")}function LB(e,r,n){const o=On(n,r);return!o||o.type==="element"&&(o.tagName==="rp"||o.tagName==="rt")}function fve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&o.tagName==="optgroup"}function mve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&(o.tagName==="option"||o.tagName==="optgroup")}function gve(e,r,n){const o=On(n,r);return!!(o&&o.type==="element"&&(o.tagName==="tbody"||o.tagName==="tfoot"))}function yve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&(o.tagName==="tbody"||o.tagName==="tfoot")}function vve(e,r,n){return!On(n,r)}function bve(e,r,n){const o=On(n,r);return!o||o.type==="element"&&o.tagName==="tr"}function FB(e,r,n){const o=On(n,r);return!o||o.type==="element"&&(o.tagName==="td"||o.tagName==="th")}const xve=OB({body:_ve,colgroup:Sve,head:kve,html:wve,tbody:Eve});function wve(e){const r=On(e,-1);return!r||r.type!=="comment"}function kve(e){const r=new Set;for(const o of e.children)if(o.type==="element"&&(o.tagName==="base"||o.tagName==="title")){if(r.has(o.tagName))return!1;r.add(o.tagName)}const n=e.children[0];return!n||n.type==="element"}function _ve(e){const r=On(e,-1,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&F_(r.value.charAt(0)))&&!(r.type==="element"&&(r.tagName==="meta"||r.tagName==="link"||r.tagName==="script"||r.tagName==="style"||r.tagName==="template"))}function Sve(e,r,n){const o=BB(n,r),i=On(e,-1,!0);return n&&o&&o.type==="element"&&o.tagName==="colgroup"&&V_(o,n.children.indexOf(o),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Eve(e,r,n){const o=BB(n,r),i=On(e,-1);return n&&o&&o.type==="element"&&(o.tagName==="thead"||o.tagName==="tbody")&&V_(o,n.children.indexOf(o),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Ib={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 @@ -15,45 +15,45 @@ function Lge(e,r){for(var n=0;n`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Cve(e,r,n,o){const a=o.schema,i=a.space==="svg"?!1:o.settings.omitOptionalTags;let l=a.space==="svg"?o.settings.closeEmptyElements:o.settings.voids.includes(e.tagName.toLowerCase());const s=[];let c;a.space==="html"&&e.tagName==="svg"&&(o.schema=AB);const d=$ve(o,e.properties),u=o.all(a.space==="html"&&e.tagName==="template"?e.content:e);return o.schema=a,u&&(l=!1),(d||!i||!xve(e,r,n))&&(s.push("<",e.tagName,d?" "+d:""),l&&(a.space==="svg"||o.settings.closeSelfClosing)&&(c=d.charAt(d.length-1),(!o.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(u),!l&&(!i||!V_(e,r,n))&&s.push(""),s.join("")}function $ve(e,r){const n=[];let o=-1,a;if(r){for(a in r)if(r[a]!==null&&r[a]!==void 0){const i=Rve(e,a,r[a]);i&&n.push(i)}}for(;++oBb(n,e.alternative)&&(l=e.alternative),s=l+Lh(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?Ib.single:Ib.double)[a][i],attribute:!0}))+l),c+(s&&"="+s))}const zve=["<","&"];function VB(e,r,n,o){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Lh(e.value,Object.assign({},o.settings.characterReferences,{subset:zve}))}function Tve(e,r,n,o){return o.settings.allowDangerousHtml?e.value:VB(e,r,n,o)}function jve(e,r,n,o){return o.all(e)}const Ave=N0e("type",{invalid:Dve,unknown:Mve,handlers:{comment:tve,doctype:rve,element:Cve,raw:Tve,root:jve,text:VB}});function Dve(e){throw new Error("Expected node, not `"+e+"`")}function Mve(e){const r=e;throw new Error("Cannot compile unknown node `"+r.type+"`")}const Nve={},Pve={},Bve=[];function Ive(e,r){const n=r||Nve,o=n.quote||'"',a=o==='"'?"'":'"';if(o!=='"'&&o!=="'")throw new Error("Invalid quote `"+o+"`, expected `'` or `\"`");return{one:Ove,all:Lve,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||E0e,characterReferences:n.characterReferences||Pve,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?AB:M0e,quote:o,alternative:a}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Ove(e,r,n){return Ave(e,r,n,this)}function Lve(e){const r=[],n=e&&e.children||Bve;let o=-1;for(;++o-1&&e.test(String.fromCharCode(n))}}function Uve(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Fb=(function(e){if(e==null)return Xve;if(typeof e=="function")return Vb(e);if(typeof e=="object")return Array.isArray(e)?Wve(e):Gve(e);if(typeof e=="string")return Yve(e);throw new Error("Expected function, string, or object as test")});function Wve(e){const r=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let g=qB,v,w,x;if((!r||i(c,d,u[u.length-1]||void 0))&&(g=Jve(n(c,u)),g[0]===U_))return g;if("children"in c&&c.children){const k=c;if(k.children&&g[0]!==Qve)for(w=(o?k.children.length:-1)+l,x=u.concat(k);w>-1&&w0?{type:"text",value:T}:void 0),T===!1?f.lastIndex=$+1:(v!==$&&C.push({type:"text",value:d.value.slice(v,$)}),Array.isArray(T)?C.push(...T):T&&C.push(T),v=$+_[0].length,k=!0),!f.global)break;_=f.exec(d.value)}return k?(v?\]}]+$/.exec(e);if(!r)return[e,void 0];e=e.slice(0,r.index);let n=r[0],o=n.indexOf(")");const a=Bb(e,"(");let i=Bb(e,")");for(;o!==-1&&a>i;)e+=n.slice(0,o+1),n=n.slice(o+1),o=n.indexOf(")"),i++;return[e,n]}function UB(e,r){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Pu(n)||Lb(n))&&(!r||n!==47)}function Ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}WB.peek=Sbe;function gbe(){this.buffer()}function ybe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vbe(){this.buffer()}function bbe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xbe(e){const r=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ui(this.sliceSerialize(e)).toLowerCase(),n.label=r}function wbe(e){this.exit(e)}function kbe(e){const r=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ui(this.sliceSerialize(e)).toLowerCase(),n.label=r}function _be(e){this.exit(e)}function Sbe(){return"["}function WB(e,r,n,o){const a=n.createTracker(o);let i=a.move("[^");const l=n.enter("footnoteReference"),s=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),l(),i+=a.move("]"),i}function Ebe(){return{enter:{gfmFootnoteCallString:gbe,gfmFootnoteCall:ybe,gfmFootnoteDefinitionLabelString:vbe,gfmFootnoteDefinition:bbe},exit:{gfmFootnoteCallString:xbe,gfmFootnoteCall:wbe,gfmFootnoteDefinitionLabelString:kbe,gfmFootnoteDefinition:_be}}}function Cbe(e){let r=!1;return e&&e.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:n,footnoteReference:WB},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(o,a,i,l){const s=i.createTracker(l);let c=s.move("[^");const d=i.enter("footnoteDefinition"),u=i.enter("label");return c+=s.move(i.safe(i.associationId(o),{before:c,after:"]"})),u(),c+=s.move("]:"),o.children&&o.children.length>0&&(s.shift(4),c+=s.move((r?` -`:" ")+i.indentLines(i.containerFlow(o,s.current()),r?GB:$be))),d(),c}}function $be(e,r,n){return r===0?e:GB(e,r,n)}function GB(e,r,n){return(n?"":" ")+e}const Rbe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];YB.peek=Dbe;function zbe(){return{canContainEols:["delete"],enter:{strikethrough:jbe},exit:{strikethrough:Abe}}}function Tbe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Rbe}],handlers:{delete:YB}}}function jbe(e){this.enter({type:"delete",children:[]},e)}function Abe(e){this.exit(e)}function YB(e,r,n,o){const a=n.createTracker(o),i=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),i(),l}function Dbe(){return"~"}function Mbe(e){return e.length}function Nbe(e,r){const n=r||{},o=(n.align||[]).concat(),a=n.stringLength||Mbe,i=[],l=[],s=[],c=[];let d=0,u=-1;for(;++ud&&(d=e[u].length);++kc[k])&&(c[k]=_)}w.push(C)}l[u]=w,s[u]=x}let p=-1;if(typeof o=="object"&&"length"in o)for(;++pc[p]&&(c[p]=C),g[p]=C),f[p]=_}l.splice(1,0,f),s.splice(1,0,g),u=-1;const v=[];for(;++u "),i.shift(2);const l=n.indentLines(n.containerFlow(e,i.current()),Ibe);return a(),l}function Ibe(e,r,n){return">"+(n?"":" ")+e}function Obe(e,r){return ZB(e,r.inConstruct,!0)&&!ZB(e,r.notInConstruct,!1)}function ZB(e,r,n){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return n;let o=-1;for(;++ol&&(l=i):i=1,a=o+r.length,o=n.indexOf(r,a);return l}function Fbe(e,r){return!!(r.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Vbe(e){const r=e.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function qbe(e,r,n,o){const a=Vbe(n),i=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(Fbe(e,n)){const p=n.enter("codeIndented"),f=n.indentLines(i,Hbe);return p(),f}const s=n.createTracker(o),c=a.repeat(Math.max(Lbe(i,a)+1,3)),d=n.enter("codeFenced");let u=s.move(c);if(e.lang){const p=n.enter(`codeFencedLang${l}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:` +\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Cve(e,r,n,o){const i=o.schema,a=i.space==="svg"?!1:o.settings.omitOptionalTags;let l=i.space==="svg"?o.settings.closeEmptyElements:o.settings.voids.includes(e.tagName.toLowerCase());const s=[];let c;i.space==="html"&&e.tagName==="svg"&&(o.schema=AB);const d=$ve(o,e.properties),u=o.all(i.space==="html"&&e.tagName==="template"?e.content:e);return o.schema=i,u&&(l=!1),(d||!a||!xve(e,r,n))&&(s.push("<",e.tagName,d?" "+d:""),l&&(i.space==="svg"||o.settings.closeSelfClosing)&&(c=d.charAt(d.length-1),(!o.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(u),!l&&(!a||!V_(e,r,n))&&s.push(""),s.join("")}function $ve(e,r){const n=[];let o=-1,i;if(r){for(i in r)if(r[i]!==null&&r[i]!==void 0){const a=Rve(e,i,r[i]);a&&n.push(a)}}for(;++oBb(n,e.alternative)&&(l=e.alternative),s=l+Lh(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?Ib.single:Ib.double)[i][a],attribute:!0}))+l),c+(s&&"="+s))}const zve=["<","&"];function VB(e,r,n,o){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Lh(e.value,Object.assign({},o.settings.characterReferences,{subset:zve}))}function Tve(e,r,n,o){return o.settings.allowDangerousHtml?e.value:VB(e,r,n,o)}function jve(e,r,n,o){return o.all(e)}const Ave=N0e("type",{invalid:Dve,unknown:Mve,handlers:{comment:tve,doctype:rve,element:Cve,raw:Tve,root:jve,text:VB}});function Dve(e){throw new Error("Expected node, not `"+e+"`")}function Mve(e){const r=e;throw new Error("Cannot compile unknown node `"+r.type+"`")}const Nve={},Pve={},Bve=[];function Ive(e,r){const n=r||Nve,o=n.quote||'"',i=o==='"'?"'":'"';if(o!=='"'&&o!=="'")throw new Error("Invalid quote `"+o+"`, expected `'` or `\"`");return{one:Ove,all:Lve,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||E0e,characterReferences:n.characterReferences||Pve,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?AB:M0e,quote:o,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Ove(e,r,n){return Ave(e,r,n,this)}function Lve(e){const r=[],n=e&&e.children||Bve;let o=-1;for(;++o-1&&e.test(String.fromCharCode(n))}}function Uve(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Fb=(function(e){if(e==null)return Xve;if(typeof e=="function")return Vb(e);if(typeof e=="object")return Array.isArray(e)?Wve(e):Gve(e);if(typeof e=="string")return Yve(e);throw new Error("Expected function, string, or object as test")});function Wve(e){const r=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let g=qB,v,w,x;if((!r||a(c,d,u[u.length-1]||void 0))&&(g=Jve(n(c,u)),g[0]===U_))return g;if("children"in c&&c.children){const k=c;if(k.children&&g[0]!==Qve)for(w=(o?k.children.length:-1)+l,x=u.concat(k);w>-1&&w0?{type:"text",value:T}:void 0),T===!1?f.lastIndex=$+1:(v!==$&&C.push({type:"text",value:d.value.slice(v,$)}),Array.isArray(T)?C.push(...T):T&&C.push(T),v=$+_[0].length,k=!0),!f.global)break;_=f.exec(d.value)}return k?(v?\]}]+$/.exec(e);if(!r)return[e,void 0];e=e.slice(0,r.index);let n=r[0],o=n.indexOf(")");const i=Bb(e,"(");let a=Bb(e,")");for(;o!==-1&&i>a;)e+=n.slice(0,o+1),n=n.slice(o+1),o=n.indexOf(")"),a++;return[e,n]}function UB(e,r){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Pu(n)||Lb(n))&&(!r||n!==47)}function Ua(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}WB.peek=Sbe;function gbe(){this.buffer()}function ybe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vbe(){this.buffer()}function bbe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xbe(e){const r=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ua(this.sliceSerialize(e)).toLowerCase(),n.label=r}function wbe(e){this.exit(e)}function kbe(e){const r=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ua(this.sliceSerialize(e)).toLowerCase(),n.label=r}function _be(e){this.exit(e)}function Sbe(){return"["}function WB(e,r,n,o){const i=n.createTracker(o);let a=i.move("[^");const l=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),s(),l(),a+=i.move("]"),a}function Ebe(){return{enter:{gfmFootnoteCallString:gbe,gfmFootnoteCall:ybe,gfmFootnoteDefinitionLabelString:vbe,gfmFootnoteDefinition:bbe},exit:{gfmFootnoteCallString:xbe,gfmFootnoteCall:wbe,gfmFootnoteDefinitionLabelString:kbe,gfmFootnoteDefinition:_be}}}function Cbe(e){let r=!1;return e&&e.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:n,footnoteReference:WB},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(o,i,a,l){const s=a.createTracker(l);let c=s.move("[^");const d=a.enter("footnoteDefinition"),u=a.enter("label");return c+=s.move(a.safe(a.associationId(o),{before:c,after:"]"})),u(),c+=s.move("]:"),o.children&&o.children.length>0&&(s.shift(4),c+=s.move((r?` +`:" ")+a.indentLines(a.containerFlow(o,s.current()),r?GB:$be))),d(),c}}function $be(e,r,n){return r===0?e:GB(e,r,n)}function GB(e,r,n){return(n?"":" ")+e}const Rbe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];YB.peek=Dbe;function zbe(){return{canContainEols:["delete"],enter:{strikethrough:jbe},exit:{strikethrough:Abe}}}function Tbe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Rbe}],handlers:{delete:YB}}}function jbe(e){this.enter({type:"delete",children:[]},e)}function Abe(e){this.exit(e)}function YB(e,r,n,o){const i=n.createTracker(o),a=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),a(),l}function Dbe(){return"~"}function Mbe(e){return e.length}function Nbe(e,r){const n=r||{},o=(n.align||[]).concat(),i=n.stringLength||Mbe,a=[],l=[],s=[],c=[];let d=0,u=-1;for(;++ud&&(d=e[u].length);++kc[k])&&(c[k]=_)}w.push(C)}l[u]=w,s[u]=x}let p=-1;if(typeof o=="object"&&"length"in o)for(;++pc[p]&&(c[p]=C),g[p]=C),f[p]=_}l.splice(1,0,f),s.splice(1,0,g),u=-1;const v=[];for(;++u "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),Ibe);return i(),l}function Ibe(e,r,n){return">"+(n?"":" ")+e}function Obe(e,r){return KB(e,r.inConstruct,!0)&&!KB(e,r.notInConstruct,!1)}function KB(e,r,n){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return n;let o=-1;for(;++ol&&(l=a):a=1,i=o+r.length,o=n.indexOf(r,i);return l}function Fbe(e,r){return!!(r.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Vbe(e){const r=e.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function qbe(e,r,n,o){const i=Vbe(n),a=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(Fbe(e,n)){const p=n.enter("codeIndented"),f=n.indentLines(a,Hbe);return p(),f}const s=n.createTracker(o),c=i.repeat(Math.max(Lbe(a,i)+1,3)),d=n.enter("codeFenced");let u=s.move(c);if(e.lang){const p=n.enter(`codeFencedLang${l}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:` `,encode:["`"],...s.current()})),p()}return u+=s.move(` -`),i&&(u+=s.move(i+` -`)),u+=s.move(c),d(),u}function Hbe(e,r,n){return(n?"":" ")+e}function X_(e){const r=e.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function Ube(e,r,n,o){const a=X_(n),i=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let s=n.enter("label");const c=n.createTracker(o);let d=c.move("[");return d+=c.move(n.safe(n.associationId(e),{before:d,after:"]",...c.current()})),d+=c.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(s=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":` -`,...c.current()}))),s(),e.title&&(s=n.enter(`title${i}`),d+=c.move(" "+a),d+=c.move(n.safe(e.title,{before:d,after:a,...c.current()})),d+=c.move(a),s()),l(),d}function Wbe(e){const r=e.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function l1(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Fh(e){if(e===null||Sr(e)||Pu(e))return 1;if(Lb(e))return 2}function qb(e,r,n){const o=Fh(e),a=Fh(r);return o===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}QB.peek=Gbe;function QB(e,r,n,o){const a=Wbe(n),i=n.enter("emphasis"),l=n.createTracker(o),s=l.move(a);let c=l.move(n.containerPhrasing(e,{after:a,before:s,...l.current()}));const d=c.charCodeAt(0),u=qb(o.before.charCodeAt(o.before.length-1),d,a);u.inside&&(c=l1(d)+c.slice(1));const p=c.charCodeAt(c.length-1),f=qb(o.after.charCodeAt(0),p,a);f.inside&&(c=c.slice(0,-1)+l1(p));const g=l.move(a);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+g}function Gbe(e,r,n){return n.options.emphasis||"*"}function Z_(e,r,n,o){let a,i,l;typeof r=="function"&&typeof n!="function"?(i=void 0,l=r,a=n):(i=r,l=n,a=o),HB(e,i,s,a);function s(c,d){const u=d[d.length-1],p=u?u.children.indexOf(c):void 0;return l(c,p,u)}}const Ybe={};function Hb(e,r){const n=r||Ybe,o=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return JB(e,o,a)}function JB(e,r,n){if(Xbe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(r&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eI(e.children,r,n)}return Array.isArray(e)?eI(e,r,n):""}function eI(e,r,n){const o=[];let a=-1;for(;++a",...c.current()})),d+=c.move(">")):(s=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":` +`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),s()),l(),d}function Wbe(e){const r=e.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function l1(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Fh(e){if(e===null||Sr(e)||Pu(e))return 1;if(Lb(e))return 2}function qb(e,r,n){const o=Fh(e),i=Fh(r);return o===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}QB.peek=Gbe;function QB(e,r,n,o){const i=Wbe(n),a=n.enter("emphasis"),l=n.createTracker(o),s=l.move(i);let c=l.move(n.containerPhrasing(e,{after:i,before:s,...l.current()}));const d=c.charCodeAt(0),u=qb(o.before.charCodeAt(o.before.length-1),d,i);u.inside&&(c=l1(d)+c.slice(1));const p=c.charCodeAt(c.length-1),f=qb(o.after.charCodeAt(0),p,i);f.inside&&(c=c.slice(0,-1)+l1(p));const g=l.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+g}function Gbe(e,r,n){return n.options.emphasis||"*"}function K_(e,r,n,o){let i,a,l;typeof r=="function"&&typeof n!="function"?(a=void 0,l=r,i=n):(a=r,l=n,i=o),HB(e,a,s,i);function s(c,d){const u=d[d.length-1],p=u?u.children.indexOf(c):void 0;return l(c,p,u)}}const Ybe={};function Hb(e,r){const n=r||Ybe,o=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return JB(e,o,i)}function JB(e,r,n){if(Xbe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(r&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eI(e.children,r,n)}return Array.isArray(e)?eI(e,r,n):""}function eI(e,r,n){const o=[];let i=-1;for(;++i",...c.current()})),d+=c.move(">")):(s=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),s(),e.title&&(s=n.enter(`title${i}`),d+=c.move(" "+a),d+=c.move(n.safe(e.title,{before:d,after:a,...c.current()})),d+=c.move(a),s()),d+=c.move(")"),l(),d}function Jbe(){return"!"}nI.peek=exe;function nI(e,r,n,o){const a=e.referenceType,i=n.enter("imageReference");let l=n.enter("label");const s=n.createTracker(o);let c=s.move("![");const d=n.safe(e.alt,{before:c,after:"]",...s.current()});c+=s.move(d+"]["),l();const u=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:c,after:"]",...s.current()});return l(),n.stack=u,i(),a==="full"||!d||d!==p?c+=s.move(p+"]"):a==="shortcut"?c=c.slice(0,-1):c+=s.move("]"),c}function exe(){return"!"}oI.peek=txe;function oI(e,r,n){let o=e.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(o);)a+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++i\u007F]/.test(e.url))}iI.peek=rxe;function iI(e,r,n,o){const a=X_(n),i=a==='"'?"Quote":"Apostrophe",l=n.createTracker(o);let s,c;if(aI(e,n)){const u=n.stack;n.stack=[],s=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),s(),n.stack=u,p}s=n.enter("link"),c=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(c=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),c(),e.title&&(c=n.enter(`title${i}`),d+=l.move(" "+a),d+=l.move(n.safe(e.title,{before:d,after:a,...l.current()})),d+=l.move(a),c()),d+=l.move(")"),s(),d}function rxe(e,r,n){return aI(e,n)?"<":"["}lI.peek=nxe;function lI(e,r,n,o){const a=e.referenceType,i=n.enter("linkReference");let l=n.enter("label");const s=n.createTracker(o);let c=s.move("[");const d=n.containerPhrasing(e,{before:c,after:"]",...s.current()});c+=s.move(d+"]["),l();const u=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:c,after:"]",...s.current()});return l(),n.stack=u,i(),a==="full"||!d||d!==p?c+=s.move(p+"]"):a==="shortcut"?c=c.slice(0,-1):c+=s.move("]"),c}function nxe(){return"["}function K_(e){const r=e.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function oxe(e){const r=K_(e),n=e.options.bulletOther;if(!n)return r==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+n+"`) to be different");return n}function axe(e){const r=e.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function sI(e){const r=e.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function ixe(e,r,n,o){const a=n.enter("list"),i=n.bulletCurrent;let l=e.ordered?axe(n):K_(n);const s=e.ordered?l==="."?")":".":oxe(n);let c=r&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),sI(n)===l&&u){let p=-1;for(;++p-1?r.start:1)+(n.options.incrementListMarker===!1?0:r.children.indexOf(e))+i);let l=i.length+1;(a==="tab"||a==="mixed"&&(r&&r.type==="list"&&r.spread||e.spread))&&(l=Math.ceil(l/4)*4);const s=n.createTracker(o);s.move(i+" ".repeat(l-i.length)),s.shift(l);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,s.current()),u);return c(),d;function u(p,f,g){return f?(g?"":" ".repeat(l))+p:(g?i:i+" ".repeat(l-i.length))+p}}function cxe(e,r,n,o){const a=n.enter("paragraph"),i=n.enter("phrasing"),l=n.containerPhrasing(e,o);return i(),a(),l}const dxe=Fb(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function uxe(e,r,n,o){return(e.children.some(function(l){return dxe(l)})?n.containerPhrasing:n.containerFlow).call(n,e,o)}function pxe(e){const r=e.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}cI.peek=hxe;function cI(e,r,n,o){const a=pxe(n),i=n.enter("strong"),l=n.createTracker(o),s=l.move(a+a);let c=l.move(n.containerPhrasing(e,{after:a,before:s,...l.current()}));const d=c.charCodeAt(0),u=qb(o.before.charCodeAt(o.before.length-1),d,a);u.inside&&(c=l1(d)+c.slice(1));const p=c.charCodeAt(c.length-1),f=qb(o.after.charCodeAt(0),p,a);f.inside&&(c=c.slice(0,-1)+l1(p));const g=l.move(a+a);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+g}function hxe(e,r,n){return n.options.strong||"*"}function fxe(e,r,n,o){return n.safe(e.value,o)}function mxe(e){const r=e.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function gxe(e,r,n){const o=(sI(n)+(n.options.ruleSpaces?" ":"")).repeat(mxe(n));return n.options.ruleSpaces?o.slice(0,-1):o}const dI={blockquote:Bbe,break:KB,code:qbe,definition:Ube,emphasis:QB,hardBreak:KB,heading:Kbe,html:tI,image:rI,imageReference:nI,inlineCode:oI,link:iI,linkReference:lI,list:ixe,listItem:sxe,paragraph:cxe,root:uxe,strong:cI,text:fxe,thematicBreak:gxe},uI={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` -`,Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},yxe={}.hasOwnProperty;function Q_(e){return yxe.call(uI,e)?uI[e]:!1}function pI(e,r){const n=Number.parseInt(e,r);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const vxe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bxe(e){return e.replace(vxe,xxe)}function xxe(e,r,n){if(r)return r;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return pI(n.slice(i?2:1),i?16:10)}return Q_(n)||e}function wxe(){return{enter:{table:kxe,tableData:hI,tableHeader:hI,tableRow:Sxe},exit:{codeText:Exe,table:_xe,tableData:J_,tableHeader:J_,tableRow:J_}}}function kxe(e){const r=e._align;this.enter({type:"table",align:r.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function _xe(e){this.exit(e),this.data.inTable=void 0}function Sxe(e){this.enter({type:"tableRow",children:[]},e)}function J_(e){this.exit(e)}function hI(e){this.enter({type:"tableCell",children:[]},e)}function Exe(e){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,Cxe));const n=this.stack[this.stack.length-1];n.type,n.value=r,this.exit(e)}function Cxe(e,r){return r==="|"?r:e}function $xe(e){const r=e||{},n=r.tableCellPadding,o=r.tablePipeAlign,a=r.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(` +`))+1))}const l="#".repeat(i),s=n.enter("headingAtx"),c=n.enter("phrasing");a.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:` +`,...a.current()});return/^[\t ]/.test(d)&&(d=l1(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),c(),s(),d}tI.peek=Qbe;function tI(e){return e.value||""}function Qbe(){return"<"}rI.peek=Jbe;function rI(e,r,n,o){const i=X_(n),a=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let s=n.enter("label");const c=n.createTracker(o);let d=c.move("![");return d+=c.move(n.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(s=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),s()),d+=c.move(")"),l(),d}function Jbe(){return"!"}nI.peek=exe;function nI(e,r,n,o){const i=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const s=n.createTracker(o);let c=s.move("![");const d=n.safe(e.alt,{before:c,after:"]",...s.current()});c+=s.move(d+"]["),l();const u=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:c,after:"]",...s.current()});return l(),n.stack=u,a(),i==="full"||!d||d!==p?c+=s.move(p+"]"):i==="shortcut"?c=c.slice(0,-1):c+=s.move("]"),c}function exe(){return"!"}oI.peek=txe;function oI(e,r,n){let o=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(o);)i+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++a\u007F]/.test(e.url))}aI.peek=rxe;function aI(e,r,n,o){const i=X_(n),a=i==='"'?"Quote":"Apostrophe",l=n.createTracker(o);let s,c;if(iI(e,n)){const u=n.stack;n.stack=[],s=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),s(),n.stack=u,p}s=n.enter("link"),c=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(c=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),c(),e.title&&(c=n.enter(`title${a}`),d+=l.move(" "+i),d+=l.move(n.safe(e.title,{before:d,after:i,...l.current()})),d+=l.move(i),c()),d+=l.move(")"),s(),d}function rxe(e,r,n){return iI(e,n)?"<":"["}lI.peek=nxe;function lI(e,r,n,o){const i=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const s=n.createTracker(o);let c=s.move("[");const d=n.containerPhrasing(e,{before:c,after:"]",...s.current()});c+=s.move(d+"]["),l();const u=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:c,after:"]",...s.current()});return l(),n.stack=u,a(),i==="full"||!d||d!==p?c+=s.move(p+"]"):i==="shortcut"?c=c.slice(0,-1):c+=s.move("]"),c}function nxe(){return"["}function Z_(e){const r=e.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function oxe(e){const r=Z_(e),n=e.options.bulletOther;if(!n)return r==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+n+"`) to be different");return n}function ixe(e){const r=e.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function sI(e){const r=e.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function axe(e,r,n,o){const i=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?ixe(n):Z_(n);const s=e.ordered?l==="."?")":".":oxe(n);let c=r&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),sI(n)===l&&u){let p=-1;for(;++p-1?r.start:1)+(n.options.incrementListMarker===!1?0:r.children.indexOf(e))+a);let l=a.length+1;(i==="tab"||i==="mixed"&&(r&&r.type==="list"&&r.spread||e.spread))&&(l=Math.ceil(l/4)*4);const s=n.createTracker(o);s.move(a+" ".repeat(l-a.length)),s.shift(l);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,s.current()),u);return c(),d;function u(p,f,g){return f?(g?"":" ".repeat(l))+p:(g?a:a+" ".repeat(l-a.length))+p}}function cxe(e,r,n,o){const i=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,o);return a(),i(),l}const dxe=Fb(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function uxe(e,r,n,o){return(e.children.some(function(l){return dxe(l)})?n.containerPhrasing:n.containerFlow).call(n,e,o)}function pxe(e){const r=e.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}cI.peek=hxe;function cI(e,r,n,o){const i=pxe(n),a=n.enter("strong"),l=n.createTracker(o),s=l.move(i+i);let c=l.move(n.containerPhrasing(e,{after:i,before:s,...l.current()}));const d=c.charCodeAt(0),u=qb(o.before.charCodeAt(o.before.length-1),d,i);u.inside&&(c=l1(d)+c.slice(1));const p=c.charCodeAt(c.length-1),f=qb(o.after.charCodeAt(0),p,i);f.inside&&(c=c.slice(0,-1)+l1(p));const g=l.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+g}function hxe(e,r,n){return n.options.strong||"*"}function fxe(e,r,n,o){return n.safe(e.value,o)}function mxe(e){const r=e.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function gxe(e,r,n){const o=(sI(n)+(n.options.ruleSpaces?" ":"")).repeat(mxe(n));return n.options.ruleSpaces?o.slice(0,-1):o}const dI={blockquote:Bbe,break:ZB,code:qbe,definition:Ube,emphasis:QB,hardBreak:ZB,heading:Zbe,html:tI,image:rI,imageReference:nI,inlineCode:oI,link:aI,linkReference:lI,list:axe,listItem:sxe,paragraph:cxe,root:uxe,strong:cI,text:fxe,thematicBreak:gxe},uI={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"⁡",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` +`,Nfr:"𝔑",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"⁡",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"⁣",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"­",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"‍",zwnj:"‌"},yxe={}.hasOwnProperty;function Q_(e){return yxe.call(uI,e)?uI[e]:!1}function pI(e,r){const n=Number.parseInt(e,r);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const vxe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bxe(e){return e.replace(vxe,xxe)}function xxe(e,r,n){if(r)return r;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return pI(n.slice(a?2:1),a?16:10)}return Q_(n)||e}function wxe(){return{enter:{table:kxe,tableData:hI,tableHeader:hI,tableRow:Sxe},exit:{codeText:Exe,table:_xe,tableData:J_,tableHeader:J_,tableRow:J_}}}function kxe(e){const r=e._align;this.enter({type:"table",align:r.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function _xe(e){this.exit(e),this.data.inTable=void 0}function Sxe(e){this.enter({type:"tableRow",children:[]},e)}function J_(e){this.exit(e)}function hI(e){this.enter({type:"tableCell",children:[]},e)}function Exe(e){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,Cxe));const n=this.stack[this.stack.length-1];n.type,n.value=r,this.exit(e)}function Cxe(e,r){return r==="|"?r:e}function $xe(e){const r=e||{},n=r.tableCellPadding,o=r.tablePipeAlign,i=r.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:l,tableCell:c,tableRow:s}};function l(g,v,w,x){return d(u(g,w,x),g.align)}function s(g,v,w,x){const k=p(g,w,x),C=d([k]);return C.slice(0,C.indexOf(` -`))}function c(g,v,w,x){const k=w.enter("tableCell"),C=w.enter("phrasing"),_=w.containerPhrasing(g,{...x,before:i,after:i});return C(),k(),_}function d(g,v){return Nbe(g,{align:v,alignDelimiters:o,padding:n,stringLength:a})}function u(g,v,w){const x=g.children;let k=-1;const C=[],_=v.enter("table");for(;++ka?0:a+r:r=r>a?a:r,n=n>0?n:0,o.length<1e4)l=Array.from(o),l.unshift(r,n),e.splice(...l);else for(n&&e.splice(r,n);i0?(xa(e,e.length,0,r),e):r}const mI={}.hasOwnProperty;function gI(e){const r={};let n=-1;for(;++n0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Vh(e){const r=[];let n=-1,o=0,a=0;for(;++n55295&&i<57344){const s=e.charCodeAt(n+1);i<56320&&s>56319&&s<57344?(l=String.fromCharCode(i,s),a=1):l="�"}else l=String.fromCharCode(i);l&&(r.push(e.slice(o,n),encodeURIComponent(l)),o=n+a+1,l=""),a&&(n+=a,a=0)}return r.join("")+e.slice(o)}function Ub(e,r,n){const o=[];let a=-1;for(;++a1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[o][1].end},f={...e[n][1].start};EI(p,-c),EI(f,c),l={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...e[o][1].end}},s={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},i={type:c>1?"strongText":"emphasisText",start:{...e[o][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[o][1].end={...l.start},e[n][1].start={...s.end},d=[],e[o][1].end.offset-e[o][1].start.offset&&(d=Qa(d,[["enter",e[o][1],r],["exit",e[o][1],r]])),d=Qa(d,[["enter",a,r],["enter",l,r],["exit",l,r],["enter",i,r]]),d=Qa(d,Ub(r.parser.constructs.insideSpan.null,e.slice(o+1,n),r)),d=Qa(d,[["exit",i,r],["enter",s,r],["exit",s,r],["exit",a,r]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,d=Qa(d,[["enter",e[n][1],r],["exit",e[n][1],r]])):u=0,xa(e,o-1,n-o+3,d),n=o+d.length-u-2;break}}for(n=-1;++n0&&Vt(T)?Kt(e,C,"linePrefix",i+1)(T):C(T)}function C(T){return T===null||gt(T)?e.check(zI,w,$)(T):(e.enter("codeFlowValue"),_(T))}function _(T){return T===null||gt(T)?(e.exit("codeFlowValue"),C(T)):(e.consume(T),_)}function $(T){return e.exit("codeFenced"),r(T)}function R(T,A,z){let j=0;return I;function I(V){return T.enter("lineEnding"),T.consume(V),T.exit("lineEnding"),P}function P(V){return T.enter("codeFencedFence"),Vt(V)?Kt(T,L,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):L(V)}function L(V){return V===s?(T.enter("codeFencedFenceSequence"),H(V)):z(V)}function H(V){return V===s?(j++,T.consume(V),H):j>=l?(T.exit("codeFencedFenceSequence"),Vt(V)?Kt(T,M,"whitespace")(V):M(V)):z(V)}function M(V){return V===null||gt(V)?(T.exit("codeFencedFence"),A(V)):z(V)}}}function owe(e,r,n){const o=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return o.parser.lazy[o.now().line]?n(l):r(l)}}const n8={name:"codeIndented",tokenize:iwe},awe={partial:!0,tokenize:lwe};function iwe(e,r,n){const o=this;return a;function a(d){return e.enter("codeIndented"),Kt(e,i,"linePrefix",5)(d)}function i(d){const u=o.events[o.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?c(d):gt(d)?e.attempt(awe,l,c)(d):(e.enter("codeFlowValue"),s(d))}function s(d){return d===null||gt(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),s)}function c(d){return e.exit("codeIndented"),r(d)}}function lwe(e,r,n){const o=this;return a;function a(l){return o.parser.lazy[o.now().line]?n(l):gt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):Kt(e,i,"linePrefix",5)(l)}function i(l){const s=o.events[o.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?r(l):gt(l)?a(l):n(l)}}const swe={name:"codeText",previous:dwe,resolve:cwe,tokenize:uwe};function cwe(e){let r=e.length-4,n=3,o,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[r][1].type==="lineEnding"||e[r][1].type==="space")){for(o=n;++o=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return rthis.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(r,n,o){const a=n||0;this.setCursor(Math.trunc(r));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return o&&c1(this.left,o),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),c1(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),c1(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r=4?r(l):e.interrupt(o.parser.constructs.flow,n,r)(l)}}function AI(e,r,n,o,a,i,l,s,c){const d=c||Number.POSITIVE_INFINITY;let u=0;return p;function p(k){return k===60?(e.enter(o),e.enter(a),e.enter(i),e.consume(k),e.exit(i),f):k===null||k===32||k===41||Ob(k)?n(k):(e.enter(o),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),w(k))}function f(k){return k===62?(e.enter(i),e.consume(k),e.exit(i),e.exit(a),e.exit(o),r):(e.enter(s),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===62?(e.exit("chunkString"),e.exit(s),f(k)):k===null||k===60||gt(k)?n(k):(e.consume(k),k===92?v:g)}function v(k){return k===60||k===62||k===92?(e.consume(k),g):g(k)}function w(k){return!u&&(k===null||k===41||Sr(k))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(o),r(k)):u999||g===null||g===91||g===93&&!c||g===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(i),e.enter(a),e.consume(g),e.exit(a),e.exit(o),r):gt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===null||g===91||g===93||gt(g)||s++>999?(e.exit("chunkString"),u(g)):(e.consume(g),c||(c=!Vt(g)),g===92?f:p)}function f(g){return g===91||g===92||g===93?(e.consume(g),s++,p):p(g)}}function MI(e,r,n,o,a,i){let l;return s;function s(f){return f===34||f===39||f===40?(e.enter(o),e.enter(a),e.consume(f),e.exit(a),l=f===40?41:f,c):n(f)}function c(f){return f===l?(e.enter(a),e.consume(f),e.exit(a),e.exit(o),r):(e.enter(i),d(f))}function d(f){return f===l?(e.exit(i),c(l)):f===null?n(f):gt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Kt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===l||f===null||gt(f)?(e.exit("chunkString"),d(f)):(e.consume(f),f===92?p:u)}function p(f){return f===l||f===92?(e.consume(f),u):u(f)}}function d1(e,r){let n;return o;function o(a){return gt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,o):Vt(a)?Kt(e,o,n?"linePrefix":"lineSuffix")(a):r(a)}}const bwe={name:"definition",tokenize:wwe},xwe={partial:!0,tokenize:kwe};function wwe(e,r,n){const o=this;let a;return i;function i(g){return e.enter("definition"),l(g)}function l(g){return DI.call(o,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function s(g){return a=Ui(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),c):n(g)}function c(g){return Sr(g)?d1(e,d)(g):d(g)}function d(g){return AI(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function u(g){return e.attempt(xwe,p,p)(g)}function p(g){return Vt(g)?Kt(e,f,"whitespace")(g):f(g)}function f(g){return g===null||gt(g)?(e.exit("definition"),o.parser.defined.push(a),r(g)):n(g)}}function kwe(e,r,n){return o;function o(s){return Sr(s)?d1(e,a)(s):n(s)}function a(s){return MI(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return Vt(s)?Kt(e,l,"whitespace")(s):l(s)}function l(s){return s===null||gt(s)?r(s):n(s)}}const _we={name:"hardBreakEscape",tokenize:Swe};function Swe(e,r,n){return o;function o(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return gt(i)?(e.exit("hardBreakEscape"),r(i)):n(i)}}const Ewe={name:"headingAtx",resolve:Cwe,tokenize:$we};function Cwe(e,r){let n=e.length-2,o=3,a,i;return e[o][1].type==="whitespace"&&(o+=2),n-2>o&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(o===n-1||n-4>o&&e[n-2][1].type==="whitespace")&&(n-=o+1===n?2:4),n>o&&(a={type:"atxHeadingText",start:e[o][1].start,end:e[n][1].end},i={type:"chunkText",start:e[o][1].start,end:e[n][1].end,contentType:"text"},xa(e,o,n-o+1,[["enter",a,r],["enter",i,r],["exit",i,r],["exit",a,r]])),e}function $we(e,r,n){let o=0;return a;function a(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),l(u)}function l(u){return u===35&&o++<6?(e.consume(u),l):u===null||Sr(u)?(e.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),c(u)):u===null||gt(u)?(e.exit("atxHeading"),r(u)):Vt(u)?Kt(e,s,"whitespace")(u):(e.enter("atxHeadingText"),d(u))}function c(u){return u===35?(e.consume(u),c):(e.exit("atxHeadingSequence"),s(u))}function d(u){return u===null||u===35||Sr(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),d)}}const Rwe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],NI=["pre","script","style","textarea"],zwe={concrete:!0,name:"htmlFlow",resolveTo:Awe,tokenize:Dwe},Twe={partial:!0,tokenize:Nwe},jwe={partial:!0,tokenize:Mwe};function Awe(e){let r=e.length;for(;r--&&!(e[r][0]==="enter"&&e[r][1].type==="htmlFlow"););return r>1&&e[r-2][1].type==="linePrefix"&&(e[r][1].start=e[r-2][1].start,e[r+1][1].start=e[r-2][1].start,e.splice(r-2,2)),e}function Dwe(e,r,n){const o=this;let a,i,l,s,c;return d;function d(O){return u(O)}function u(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),p}function p(O){return O===33?(e.consume(O),f):O===47?(e.consume(O),i=!0,w):O===63?(e.consume(O),a=3,o.interrupt?r:U):Bo(O)?(e.consume(O),l=String.fromCharCode(O),x):n(O)}function f(O){return O===45?(e.consume(O),a=2,g):O===91?(e.consume(O),a=5,s=0,v):Bo(O)?(e.consume(O),a=4,o.interrupt?r:U):n(O)}function g(O){return O===45?(e.consume(O),o.interrupt?r:U):n(O)}function v(O){const W="CDATA[";return O===W.charCodeAt(s++)?(e.consume(O),s===W.length?o.interrupt?r:L:v):n(O)}function w(O){return Bo(O)?(e.consume(O),l=String.fromCharCode(O),x):n(O)}function x(O){if(O===null||O===47||O===62||Sr(O)){const W=O===47,K=l.toLowerCase();return!W&&!i&&NI.includes(K)?(a=1,o.interrupt?r(O):L(O)):Rwe.includes(l.toLowerCase())?(a=6,W?(e.consume(O),k):o.interrupt?r(O):L(O)):(a=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(O):i?C(O):_(O))}return O===45||xo(O)?(e.consume(O),l+=String.fromCharCode(O),x):n(O)}function k(O){return O===62?(e.consume(O),o.interrupt?r:L):n(O)}function C(O){return Vt(O)?(e.consume(O),C):I(O)}function _(O){return O===47?(e.consume(O),I):O===58||O===95||Bo(O)?(e.consume(O),$):Vt(O)?(e.consume(O),_):I(O)}function $(O){return O===45||O===46||O===58||O===95||xo(O)?(e.consume(O),$):R(O)}function R(O){return O===61?(e.consume(O),T):Vt(O)?(e.consume(O),R):_(O)}function T(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),c=O,A):Vt(O)?(e.consume(O),T):z(O)}function A(O){return O===c?(e.consume(O),c=null,j):O===null||gt(O)?n(O):(e.consume(O),A)}function z(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Sr(O)?R(O):(e.consume(O),z)}function j(O){return O===47||O===62||Vt(O)?_(O):n(O)}function I(O){return O===62?(e.consume(O),P):n(O)}function P(O){return O===null||gt(O)?L(O):Vt(O)?(e.consume(O),P):n(O)}function L(O){return O===45&&a===2?(e.consume(O),B):O===60&&a===1?(e.consume(O),F):O===62&&a===4?(e.consume(O),Y):O===63&&a===3?(e.consume(O),U):O===93&&a===5?(e.consume(O),G):gt(O)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(Twe,Z,H)(O)):O===null||gt(O)?(e.exit("htmlFlowData"),H(O)):(e.consume(O),L)}function H(O){return e.check(jwe,M,Z)(O)}function M(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),V}function V(O){return O===null||gt(O)?H(O):(e.enter("htmlFlowData"),L(O))}function B(O){return O===45?(e.consume(O),U):L(O)}function F(O){return O===47?(e.consume(O),l="",q):L(O)}function q(O){if(O===62){const W=l.toLowerCase();return NI.includes(W)?(e.consume(O),Y):L(O)}return Bo(O)&&l.length<8?(e.consume(O),l+=String.fromCharCode(O),q):L(O)}function G(O){return O===93?(e.consume(O),U):L(O)}function U(O){return O===62?(e.consume(O),Y):O===45&&a===2?(e.consume(O),U):L(O)}function Y(O){return O===null||gt(O)?(e.exit("htmlFlowData"),Z(O)):(e.consume(O),Y)}function Z(O){return e.exit("htmlFlow"),r(O)}}function Mwe(e,r,n){const o=this;return a;function a(l){return gt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):n(l)}function i(l){return o.parser.lazy[o.now().line]?n(l):r(l)}}function Nwe(e,r,n){return o;function o(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(s1,r,n)}}const Pwe={name:"htmlText",tokenize:Bwe};function Bwe(e,r,n){const o=this;let a,i,l;return s;function s(U){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(U),c}function c(U){return U===33?(e.consume(U),d):U===47?(e.consume(U),R):U===63?(e.consume(U),_):Bo(U)?(e.consume(U),z):n(U)}function d(U){return U===45?(e.consume(U),u):U===91?(e.consume(U),i=0,v):Bo(U)?(e.consume(U),C):n(U)}function u(U){return U===45?(e.consume(U),g):n(U)}function p(U){return U===null?n(U):U===45?(e.consume(U),f):gt(U)?(l=p,F(U)):(e.consume(U),p)}function f(U){return U===45?(e.consume(U),g):p(U)}function g(U){return U===62?B(U):U===45?f(U):p(U)}function v(U){const Y="CDATA[";return U===Y.charCodeAt(i++)?(e.consume(U),i===Y.length?w:v):n(U)}function w(U){return U===null?n(U):U===93?(e.consume(U),x):gt(U)?(l=w,F(U)):(e.consume(U),w)}function x(U){return U===93?(e.consume(U),k):w(U)}function k(U){return U===62?B(U):U===93?(e.consume(U),k):w(U)}function C(U){return U===null||U===62?B(U):gt(U)?(l=C,F(U)):(e.consume(U),C)}function _(U){return U===null?n(U):U===63?(e.consume(U),$):gt(U)?(l=_,F(U)):(e.consume(U),_)}function $(U){return U===62?B(U):_(U)}function R(U){return Bo(U)?(e.consume(U),T):n(U)}function T(U){return U===45||xo(U)?(e.consume(U),T):A(U)}function A(U){return gt(U)?(l=A,F(U)):Vt(U)?(e.consume(U),A):B(U)}function z(U){return U===45||xo(U)?(e.consume(U),z):U===47||U===62||Sr(U)?j(U):n(U)}function j(U){return U===47?(e.consume(U),B):U===58||U===95||Bo(U)?(e.consume(U),I):gt(U)?(l=j,F(U)):Vt(U)?(e.consume(U),j):B(U)}function I(U){return U===45||U===46||U===58||U===95||xo(U)?(e.consume(U),I):P(U)}function P(U){return U===61?(e.consume(U),L):gt(U)?(l=P,F(U)):Vt(U)?(e.consume(U),P):j(U)}function L(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),a=U,H):gt(U)?(l=L,F(U)):Vt(U)?(e.consume(U),L):(e.consume(U),M)}function H(U){return U===a?(e.consume(U),a=void 0,V):U===null?n(U):gt(U)?(l=H,F(U)):(e.consume(U),H)}function M(U){return U===null||U===34||U===39||U===60||U===61||U===96?n(U):U===47||U===62||Sr(U)?j(U):(e.consume(U),M)}function V(U){return U===47||U===62||Sr(U)?j(U):n(U)}function B(U){return U===62?(e.consume(U),e.exit("htmlTextData"),e.exit("htmlText"),r):n(U)}function F(U){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),q}function q(U){return Vt(U)?Kt(e,G,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):G(U)}function G(U){return e.enter("htmlTextData"),l(U)}}const o8={name:"labelEnd",resolveAll:Fwe,resolveTo:Vwe,tokenize:qwe},Iwe={tokenize:Hwe},Owe={tokenize:Uwe},Lwe={tokenize:Wwe};function Fwe(e){let r=-1;const n=[];for(;++r=3&&(d===null||gt(d))?(e.exit("thematicBreak"),r(d)):n(d)}function c(d){return d===a?(e.consume(d),o++,c):(e.exit("thematicBreakSequence"),Vt(d)?Kt(e,s,"whitespace")(d):s(d))}}const ea={continuation:{tokenize:r3e},exit:o3e,name:"list",tokenize:t3e},Jwe={partial:!0,tokenize:a3e},e3e={partial:!0,tokenize:n3e};function t3e(e,r,n){const o=this,a=o.events[o.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return s;function s(g){const v=o.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!o.containerState.marker||g===o.containerState.marker:H_(g)){if(o.containerState.type||(o.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Wb,n,d)(g):d(g);if(!o.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(g)}return n(g)}function c(g){return H_(g)&&++l<10?(e.consume(g),c):(!o.interrupt||l<2)&&(o.containerState.marker?g===o.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||g,e.check(s1,o.interrupt?n:u,e.attempt(Jwe,f,p))}function u(g){return o.containerState.initialBlankLine=!0,i++,f(g)}function p(g){return Vt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),f):n(g)}function f(g){return o.containerState.size=i+o.sliceSerialize(e.exit("listItemPrefix"),!0).length,r(g)}}function r3e(e,r,n){const o=this;return o.containerState._closeFlow=void 0,e.check(s1,a,i);function a(s){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Kt(e,r,"listItemIndent",o.containerState.size+1)(s)}function i(s){return o.containerState.furtherBlankLines||!Vt(s)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,l(s)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,e.attempt(e3e,r,l)(s))}function l(s){return o.containerState._closeFlow=!0,o.interrupt=void 0,Kt(e,e.attempt(ea,r,n),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function n3e(e,r,n){const o=this;return Kt(e,a,"listItemIndent",o.containerState.size+1);function a(i){const l=o.events[o.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===o.containerState.size?r(i):n(i)}}function o3e(e){e.exit(this.containerState.type)}function a3e(e,r,n){const o=this;return Kt(e,a,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const l=o.events[o.events.length-1];return!Vt(i)&&l&&l[1].type==="listItemPrefixWhitespace"?r(i):n(i)}}const PI={name:"setextUnderline",resolveTo:i3e,tokenize:l3e};function i3e(e,r){let n=e.length,o,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){o=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const l={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",l,r]),e.splice(i+1,0,["exit",e[o][1],r]),e[o][1].end={...e[i][1].end}):e[o][1]=l,e.push(["exit",l,r]),e}function l3e(e,r,n){const o=this;let a;return i;function i(d){let u=o.events.length,p;for(;u--;)if(o.events[u][1].type!=="lineEnding"&&o.events[u][1].type!=="linePrefix"&&o.events[u][1].type!=="content"){p=o.events[u][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||p)?(e.enter("setextHeadingLine"),a=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),s(d)}function s(d){return d===a?(e.consume(d),s):(e.exit("setextHeadingLineSequence"),Vt(d)?Kt(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||gt(d)?(e.exit("setextHeadingLine"),r(d)):n(d)}}const s3e={tokenize:g3e,partial:!0};function c3e(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:h3e,continuation:{tokenize:f3e},exit:m3e}},text:{91:{name:"gfmFootnoteCall",tokenize:p3e},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:d3e,resolveTo:u3e}}}}function d3e(e,r,n){const o=this;let a=o.events.length;const i=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let l;for(;a--;){const c=o.events[a][1];if(c.type==="labelImage"){l=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return s;function s(c){if(!l||!l._balanced)return n(c);const d=Ui(o.sliceSerialize({start:l.end,end:o.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),r(c))}}function u3e(e,r){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",o,r],e[n+3],e[n+4],["enter",a,r],["exit",a,r],["enter",i,r],["enter",l,r],["exit",l,r],["exit",i,r],e[e.length-2],e[e.length-1],["exit",o,r]];return e.splice(n,e.length-n+1,...s),e}function p3e(e,r,n){const o=this,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let i=0,l;return s;function s(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),c}function c(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(i>999||p===93&&!l||p===null||p===91||Sr(p))return n(p);if(p===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return a.includes(Ui(o.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),r):n(p)}return Sr(p)||(l=!0),i++,e.consume(p),p===92?u:d}function u(p){return p===91||p===92||p===93?(e.consume(p),i++,d):d(p)}}function h3e(e,r,n){const o=this,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let i,l=0,s;return c;function c(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(v)}function u(v){if(l>999||v===93&&!s||v===null||v===91||Sr(v))return n(v);if(v===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return i=Ui(o.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Sr(v)||(s=!0),l++,e.consume(v),v===92?p:u}function p(v){return v===91||v===92||v===93?(e.consume(v),l++,u):u(v)}function f(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),a.includes(i)||a.push(i),Kt(e,g,"gfmFootnoteDefinitionWhitespace")):n(v)}function g(v){return r(v)}}function f3e(e,r,n){return e.check(s1,r,e.attempt(s3e,r,n))}function m3e(e){e.exit("gfmFootnoteDefinition")}function g3e(e,r,n){const o=this;return Kt(e,a,"gfmFootnoteDefinitionIndent",5);function a(i){const l=o.events[o.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?r(i):n(i)}}function y3e(e){let n=(e||{}).singleTilde;const o={name:"strikethrough",tokenize:i,resolveAll:a};return n==null&&(n=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function a(l,s){let c=-1;for(;++c1?c(v):(l.consume(v),p++,g);if(p<2&&!n)return c(v);const x=l.exit("strikethroughSequenceTemporary"),k=Fh(v);return x._open=!k||k===2&&!!w,x._close=!w||w===2&&!!k,s(v)}}}class v3e{constructor(){this.map=[]}add(r,n,o){b3e(this,r,n,o)}consume(r){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const o=[];for(;n>0;)n-=1,o.push(r.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),r.length=this.map[n][0];o.push(r.slice()),r.length=0;let a=o.pop();for(;a;){for(const i of a)r.push(i);a=o.pop()}this.map.length=0}}function b3e(e,r,n,o){let a=0;if(!(n===0&&o.length===0)){for(;a-1;){const M=o.events[P][1].type;if(M==="lineEnding"||M==="linePrefix")P--;else break}const L=P>-1?o.events[P][1].type:null,H=L==="tableHead"||L==="tableRow"?T:c;return H===T&&o.parser.lazy[o.now().line]?n(I):H(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),d(I)}function d(I){return I===124||(l=!0,i+=1),u(I)}function u(I){return I===null?n(I):gt(I)?i>1?(i=0,o.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),g):n(I):Vt(I)?Kt(e,u,"whitespace")(I):(i+=1,l&&(l=!1,a+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),l=!0,u):(e.enter("data"),p(I)))}function p(I){return I===null||I===124||Sr(I)?(e.exit("data"),u(I)):(e.consume(I),I===92?f:p)}function f(I){return I===92||I===124?(e.consume(I),p):p(I)}function g(I){return o.interrupt=!1,o.parser.lazy[o.now().line]?n(I):(e.enter("tableDelimiterRow"),l=!1,Vt(I)?Kt(e,v,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):v(I))}function v(I){return I===45||I===58?x(I):I===124?(l=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),w):R(I)}function w(I){return Vt(I)?Kt(e,x,"whitespace")(I):x(I)}function x(I){return I===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),k):I===45?(i+=1,k(I)):I===null||gt(I)?$(I):R(I)}function k(I){return I===45?(e.enter("tableDelimiterFiller"),C(I)):R(I)}function C(I){return I===45?(e.consume(I),C):I===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(I))}function _(I){return Vt(I)?Kt(e,$,"whitespace")(I):$(I)}function $(I){return I===124?v(I):I===null||gt(I)?!l||a!==i?R(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),r(I)):R(I)}function R(I){return n(I)}function T(I){return e.enter("tableRow"),A(I)}function A(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),A):I===null||gt(I)?(e.exit("tableRow"),r(I)):Vt(I)?Kt(e,A,"whitespace")(I):(e.enter("data"),z(I))}function z(I){return I===null||I===124||Sr(I)?(e.exit("data"),A(I)):(e.consume(I),I===92?j:z)}function j(I){return I===92||I===124?(e.consume(I),z):z(I)}}function _3e(e,r){let n=-1,o=!0,a=0,i=[0,0,0,0],l=[0,0,0,0],s=!1,c=0,d,u,p;const f=new v3e;for(;++nn[2]+1){const v=n[2]+1,w=n[3]-n[2]-1;e.add(v,w,[])}}e.add(n[3]+1,0,[["exit",p,r]])}return a!==void 0&&(i.end=Object.assign({},qh(r.events,a)),e.add(a,0,[["exit",i,r]]),i=void 0),i}function BI(e,r,n,o,a){const i=[],l=qh(r.events,n);a&&(a.end=Object.assign({},l),i.push(["exit",a,r])),o.end=Object.assign({},l),i.push(["exit",o,r]),e.add(n+1,0,i)}function qh(e,r){const n=e[r],o=n[0]==="enter"?"start":"end";return n[1][o]}const S3e={name:"tasklistCheck",tokenize:C3e};function E3e(){return{text:{91:S3e}}}function C3e(e,r,n){const o=this;return a;function a(c){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return Sr(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),l):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),l):n(c)}function l(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(c)}function s(c){return gt(c)?r(c):Vt(c)?e.check({tokenize:$3e},r,n)(c):n(c)}}function $3e(e,r,n){return Kt(e,o,"whitespace");function o(a){return a===null?n(a):r(a)}}function R3e(e){return gI([Ixe(),c3e(),y3e(e),w3e(),E3e()])}const z3e={};function T3e(e){const r=this,n=e||z3e,o=r.data(),a=o.micromarkExtensions||(o.micromarkExtensions=[]),i=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),l=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);a.push(R3e(n)),i.push(Axe()),l.push(Dxe(n))}const j3e=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,A3e=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,D3e=({legacyTitle:e=!1,tagName:r="div"}={})=>n=>{Z_(n,"blockquote",(o,a,i)=>{let l="",s="",c=!0,d=o.children.map(u=>{if(c&&u.type==="paragraph"){const p=u.children[0],f=p.type==="text"?p.value:"",g=e?A3e:j3e,v=f.match(g);if(v&&(c=!1,l=v[1].toLocaleLowerCase(),s=e&&v[2]||l.toLocaleUpperCase(),f.includes(` +`))}function c(g,v,w,x){const k=w.enter("tableCell"),C=w.enter("phrasing"),_=w.containerPhrasing(g,{...x,before:a,after:a});return C(),k(),_}function d(g,v){return Nbe(g,{align:v,alignDelimiters:o,padding:n,stringLength:i})}function u(g,v,w){const x=g.children;let k=-1;const C=[],_=v.enter("table");for(;++ki?0:i+r:r=r>i?i:r,n=n>0?n:0,o.length<1e4)l=Array.from(o),l.unshift(r,n),e.splice(...l);else for(n&&e.splice(r,n);a0?(xi(e,e.length,0,r),e):r}const mI={}.hasOwnProperty;function gI(e){const r={};let n=-1;for(;++n0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Vh(e){const r=[];let n=-1,o=0,i=0;for(;++n55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(l=String.fromCharCode(a,s),i=1):l="�"}else l=String.fromCharCode(a);l&&(r.push(e.slice(o,n),encodeURIComponent(l)),o=n+i+1,l=""),i&&(n+=i,i=0)}return r.join("")+e.slice(o)}function Ub(e,r,n){const o=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[o][1].end},f={...e[n][1].start};EI(p,-c),EI(f,c),l={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...e[o][1].end}},s={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},a={type:c>1?"strongText":"emphasisText",start:{...e[o][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[o][1].end={...l.start},e[n][1].start={...s.end},d=[],e[o][1].end.offset-e[o][1].start.offset&&(d=Qi(d,[["enter",e[o][1],r],["exit",e[o][1],r]])),d=Qi(d,[["enter",i,r],["enter",l,r],["exit",l,r],["enter",a,r]]),d=Qi(d,Ub(r.parser.constructs.insideSpan.null,e.slice(o+1,n),r)),d=Qi(d,[["exit",a,r],["enter",s,r],["exit",s,r],["exit",i,r]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,d=Qi(d,[["enter",e[n][1],r],["exit",e[n][1],r]])):u=0,xi(e,o-1,n-o+3,d),n=o+d.length-u-2;break}}for(n=-1;++n0&&Vt(T)?Zt(e,C,"linePrefix",a+1)(T):C(T)}function C(T){return T===null||gt(T)?e.check(zI,w,$)(T):(e.enter("codeFlowValue"),_(T))}function _(T){return T===null||gt(T)?(e.exit("codeFlowValue"),C(T)):(e.consume(T),_)}function $(T){return e.exit("codeFenced"),r(T)}function R(T,A,z){let j=0;return I;function I(V){return T.enter("lineEnding"),T.consume(V),T.exit("lineEnding"),P}function P(V){return T.enter("codeFencedFence"),Vt(V)?Zt(T,L,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):L(V)}function L(V){return V===s?(T.enter("codeFencedFenceSequence"),H(V)):z(V)}function H(V){return V===s?(j++,T.consume(V),H):j>=l?(T.exit("codeFencedFenceSequence"),Vt(V)?Zt(T,M,"whitespace")(V):M(V)):z(V)}function M(V){return V===null||gt(V)?(T.exit("codeFencedFence"),A(V)):z(V)}}}function owe(e,r,n){const o=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return o.parser.lazy[o.now().line]?n(l):r(l)}}const n8={name:"codeIndented",tokenize:awe},iwe={partial:!0,tokenize:lwe};function awe(e,r,n){const o=this;return i;function i(d){return e.enter("codeIndented"),Zt(e,a,"linePrefix",5)(d)}function a(d){const u=o.events[o.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?c(d):gt(d)?e.attempt(iwe,l,c)(d):(e.enter("codeFlowValue"),s(d))}function s(d){return d===null||gt(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),s)}function c(d){return e.exit("codeIndented"),r(d)}}function lwe(e,r,n){const o=this;return i;function i(l){return o.parser.lazy[o.now().line]?n(l):gt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Zt(e,a,"linePrefix",5)(l)}function a(l){const s=o.events[o.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?r(l):gt(l)?i(l):n(l)}}const swe={name:"codeText",previous:dwe,resolve:cwe,tokenize:uwe};function cwe(e){let r=e.length-4,n=3,o,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[r][1].type==="lineEnding"||e[r][1].type==="space")){for(o=n;++o=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return rthis.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(r,n,o){const i=n||0;this.setCursor(Math.trunc(r));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return o&&c1(this.left,o),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),c1(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),c1(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r=4?r(l):e.interrupt(o.parser.constructs.flow,n,r)(l)}}function AI(e,r,n,o,i,a,l,s,c){const d=c||Number.POSITIVE_INFINITY;let u=0;return p;function p(k){return k===60?(e.enter(o),e.enter(i),e.enter(a),e.consume(k),e.exit(a),f):k===null||k===32||k===41||Ob(k)?n(k):(e.enter(o),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),w(k))}function f(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(i),e.exit(o),r):(e.enter(s),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===62?(e.exit("chunkString"),e.exit(s),f(k)):k===null||k===60||gt(k)?n(k):(e.consume(k),k===92?v:g)}function v(k){return k===60||k===62||k===92?(e.consume(k),g):g(k)}function w(k){return!u&&(k===null||k===41||Sr(k))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(o),r(k)):u999||g===null||g===91||g===93&&!c||g===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(a),e.enter(i),e.consume(g),e.exit(i),e.exit(o),r):gt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===null||g===91||g===93||gt(g)||s++>999?(e.exit("chunkString"),u(g)):(e.consume(g),c||(c=!Vt(g)),g===92?f:p)}function f(g){return g===91||g===92||g===93?(e.consume(g),s++,p):p(g)}}function MI(e,r,n,o,i,a){let l;return s;function s(f){return f===34||f===39||f===40?(e.enter(o),e.enter(i),e.consume(f),e.exit(i),l=f===40?41:f,c):n(f)}function c(f){return f===l?(e.enter(i),e.consume(f),e.exit(i),e.exit(o),r):(e.enter(a),d(f))}function d(f){return f===l?(e.exit(a),c(l)):f===null?n(f):gt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Zt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===l||f===null||gt(f)?(e.exit("chunkString"),d(f)):(e.consume(f),f===92?p:u)}function p(f){return f===l||f===92?(e.consume(f),u):u(f)}}function d1(e,r){let n;return o;function o(i){return gt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,o):Vt(i)?Zt(e,o,n?"linePrefix":"lineSuffix")(i):r(i)}}const bwe={name:"definition",tokenize:wwe},xwe={partial:!0,tokenize:kwe};function wwe(e,r,n){const o=this;let i;return a;function a(g){return e.enter("definition"),l(g)}function l(g){return DI.call(o,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function s(g){return i=Ua(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),c):n(g)}function c(g){return Sr(g)?d1(e,d)(g):d(g)}function d(g){return AI(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function u(g){return e.attempt(xwe,p,p)(g)}function p(g){return Vt(g)?Zt(e,f,"whitespace")(g):f(g)}function f(g){return g===null||gt(g)?(e.exit("definition"),o.parser.defined.push(i),r(g)):n(g)}}function kwe(e,r,n){return o;function o(s){return Sr(s)?d1(e,i)(s):n(s)}function i(s){return MI(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Vt(s)?Zt(e,l,"whitespace")(s):l(s)}function l(s){return s===null||gt(s)?r(s):n(s)}}const _we={name:"hardBreakEscape",tokenize:Swe};function Swe(e,r,n){return o;function o(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return gt(a)?(e.exit("hardBreakEscape"),r(a)):n(a)}}const Ewe={name:"headingAtx",resolve:Cwe,tokenize:$we};function Cwe(e,r){let n=e.length-2,o=3,i,a;return e[o][1].type==="whitespace"&&(o+=2),n-2>o&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(o===n-1||n-4>o&&e[n-2][1].type==="whitespace")&&(n-=o+1===n?2:4),n>o&&(i={type:"atxHeadingText",start:e[o][1].start,end:e[n][1].end},a={type:"chunkText",start:e[o][1].start,end:e[n][1].end,contentType:"text"},xi(e,o,n-o+1,[["enter",i,r],["enter",a,r],["exit",a,r],["exit",i,r]])),e}function $we(e,r,n){let o=0;return i;function i(u){return e.enter("atxHeading"),a(u)}function a(u){return e.enter("atxHeadingSequence"),l(u)}function l(u){return u===35&&o++<6?(e.consume(u),l):u===null||Sr(u)?(e.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),c(u)):u===null||gt(u)?(e.exit("atxHeading"),r(u)):Vt(u)?Zt(e,s,"whitespace")(u):(e.enter("atxHeadingText"),d(u))}function c(u){return u===35?(e.consume(u),c):(e.exit("atxHeadingSequence"),s(u))}function d(u){return u===null||u===35||Sr(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),d)}}const Rwe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],NI=["pre","script","style","textarea"],zwe={concrete:!0,name:"htmlFlow",resolveTo:Awe,tokenize:Dwe},Twe={partial:!0,tokenize:Nwe},jwe={partial:!0,tokenize:Mwe};function Awe(e){let r=e.length;for(;r--&&!(e[r][0]==="enter"&&e[r][1].type==="htmlFlow"););return r>1&&e[r-2][1].type==="linePrefix"&&(e[r][1].start=e[r-2][1].start,e[r+1][1].start=e[r-2][1].start,e.splice(r-2,2)),e}function Dwe(e,r,n){const o=this;let i,a,l,s,c;return d;function d(O){return u(O)}function u(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),p}function p(O){return O===33?(e.consume(O),f):O===47?(e.consume(O),a=!0,w):O===63?(e.consume(O),i=3,o.interrupt?r:U):Bo(O)?(e.consume(O),l=String.fromCharCode(O),x):n(O)}function f(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,s=0,v):Bo(O)?(e.consume(O),i=4,o.interrupt?r:U):n(O)}function g(O){return O===45?(e.consume(O),o.interrupt?r:U):n(O)}function v(O){const W="CDATA[";return O===W.charCodeAt(s++)?(e.consume(O),s===W.length?o.interrupt?r:L:v):n(O)}function w(O){return Bo(O)?(e.consume(O),l=String.fromCharCode(O),x):n(O)}function x(O){if(O===null||O===47||O===62||Sr(O)){const W=O===47,Z=l.toLowerCase();return!W&&!a&&NI.includes(Z)?(i=1,o.interrupt?r(O):L(O)):Rwe.includes(l.toLowerCase())?(i=6,W?(e.consume(O),k):o.interrupt?r(O):L(O)):(i=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(O):a?C(O):_(O))}return O===45||xo(O)?(e.consume(O),l+=String.fromCharCode(O),x):n(O)}function k(O){return O===62?(e.consume(O),o.interrupt?r:L):n(O)}function C(O){return Vt(O)?(e.consume(O),C):I(O)}function _(O){return O===47?(e.consume(O),I):O===58||O===95||Bo(O)?(e.consume(O),$):Vt(O)?(e.consume(O),_):I(O)}function $(O){return O===45||O===46||O===58||O===95||xo(O)?(e.consume(O),$):R(O)}function R(O){return O===61?(e.consume(O),T):Vt(O)?(e.consume(O),R):_(O)}function T(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),c=O,A):Vt(O)?(e.consume(O),T):z(O)}function A(O){return O===c?(e.consume(O),c=null,j):O===null||gt(O)?n(O):(e.consume(O),A)}function z(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Sr(O)?R(O):(e.consume(O),z)}function j(O){return O===47||O===62||Vt(O)?_(O):n(O)}function I(O){return O===62?(e.consume(O),P):n(O)}function P(O){return O===null||gt(O)?L(O):Vt(O)?(e.consume(O),P):n(O)}function L(O){return O===45&&i===2?(e.consume(O),B):O===60&&i===1?(e.consume(O),F):O===62&&i===4?(e.consume(O),Y):O===63&&i===3?(e.consume(O),U):O===93&&i===5?(e.consume(O),G):gt(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Twe,K,H)(O)):O===null||gt(O)?(e.exit("htmlFlowData"),H(O)):(e.consume(O),L)}function H(O){return e.check(jwe,M,K)(O)}function M(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),V}function V(O){return O===null||gt(O)?H(O):(e.enter("htmlFlowData"),L(O))}function B(O){return O===45?(e.consume(O),U):L(O)}function F(O){return O===47?(e.consume(O),l="",q):L(O)}function q(O){if(O===62){const W=l.toLowerCase();return NI.includes(W)?(e.consume(O),Y):L(O)}return Bo(O)&&l.length<8?(e.consume(O),l+=String.fromCharCode(O),q):L(O)}function G(O){return O===93?(e.consume(O),U):L(O)}function U(O){return O===62?(e.consume(O),Y):O===45&&i===2?(e.consume(O),U):L(O)}function Y(O){return O===null||gt(O)?(e.exit("htmlFlowData"),K(O)):(e.consume(O),Y)}function K(O){return e.exit("htmlFlow"),r(O)}}function Mwe(e,r,n){const o=this;return i;function i(l){return gt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return o.parser.lazy[o.now().line]?n(l):r(l)}}function Nwe(e,r,n){return o;function o(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(s1,r,n)}}const Pwe={name:"htmlText",tokenize:Bwe};function Bwe(e,r,n){const o=this;let i,a,l;return s;function s(U){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(U),c}function c(U){return U===33?(e.consume(U),d):U===47?(e.consume(U),R):U===63?(e.consume(U),_):Bo(U)?(e.consume(U),z):n(U)}function d(U){return U===45?(e.consume(U),u):U===91?(e.consume(U),a=0,v):Bo(U)?(e.consume(U),C):n(U)}function u(U){return U===45?(e.consume(U),g):n(U)}function p(U){return U===null?n(U):U===45?(e.consume(U),f):gt(U)?(l=p,F(U)):(e.consume(U),p)}function f(U){return U===45?(e.consume(U),g):p(U)}function g(U){return U===62?B(U):U===45?f(U):p(U)}function v(U){const Y="CDATA[";return U===Y.charCodeAt(a++)?(e.consume(U),a===Y.length?w:v):n(U)}function w(U){return U===null?n(U):U===93?(e.consume(U),x):gt(U)?(l=w,F(U)):(e.consume(U),w)}function x(U){return U===93?(e.consume(U),k):w(U)}function k(U){return U===62?B(U):U===93?(e.consume(U),k):w(U)}function C(U){return U===null||U===62?B(U):gt(U)?(l=C,F(U)):(e.consume(U),C)}function _(U){return U===null?n(U):U===63?(e.consume(U),$):gt(U)?(l=_,F(U)):(e.consume(U),_)}function $(U){return U===62?B(U):_(U)}function R(U){return Bo(U)?(e.consume(U),T):n(U)}function T(U){return U===45||xo(U)?(e.consume(U),T):A(U)}function A(U){return gt(U)?(l=A,F(U)):Vt(U)?(e.consume(U),A):B(U)}function z(U){return U===45||xo(U)?(e.consume(U),z):U===47||U===62||Sr(U)?j(U):n(U)}function j(U){return U===47?(e.consume(U),B):U===58||U===95||Bo(U)?(e.consume(U),I):gt(U)?(l=j,F(U)):Vt(U)?(e.consume(U),j):B(U)}function I(U){return U===45||U===46||U===58||U===95||xo(U)?(e.consume(U),I):P(U)}function P(U){return U===61?(e.consume(U),L):gt(U)?(l=P,F(U)):Vt(U)?(e.consume(U),P):j(U)}function L(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),i=U,H):gt(U)?(l=L,F(U)):Vt(U)?(e.consume(U),L):(e.consume(U),M)}function H(U){return U===i?(e.consume(U),i=void 0,V):U===null?n(U):gt(U)?(l=H,F(U)):(e.consume(U),H)}function M(U){return U===null||U===34||U===39||U===60||U===61||U===96?n(U):U===47||U===62||Sr(U)?j(U):(e.consume(U),M)}function V(U){return U===47||U===62||Sr(U)?j(U):n(U)}function B(U){return U===62?(e.consume(U),e.exit("htmlTextData"),e.exit("htmlText"),r):n(U)}function F(U){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),q}function q(U){return Vt(U)?Zt(e,G,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):G(U)}function G(U){return e.enter("htmlTextData"),l(U)}}const o8={name:"labelEnd",resolveAll:Fwe,resolveTo:Vwe,tokenize:qwe},Iwe={tokenize:Hwe},Owe={tokenize:Uwe},Lwe={tokenize:Wwe};function Fwe(e){let r=-1;const n=[];for(;++r=3&&(d===null||gt(d))?(e.exit("thematicBreak"),r(d)):n(d)}function c(d){return d===i?(e.consume(d),o++,c):(e.exit("thematicBreakSequence"),Vt(d)?Zt(e,s,"whitespace")(d):s(d))}}const ei={continuation:{tokenize:r3e},exit:o3e,name:"list",tokenize:t3e},Jwe={partial:!0,tokenize:i3e},e3e={partial:!0,tokenize:n3e};function t3e(e,r,n){const o=this,i=o.events[o.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(g){const v=o.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!o.containerState.marker||g===o.containerState.marker:H_(g)){if(o.containerState.type||(o.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Wb,n,d)(g):d(g);if(!o.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(g)}return n(g)}function c(g){return H_(g)&&++l<10?(e.consume(g),c):(!o.interrupt||l<2)&&(o.containerState.marker?g===o.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||g,e.check(s1,o.interrupt?n:u,e.attempt(Jwe,f,p))}function u(g){return o.containerState.initialBlankLine=!0,a++,f(g)}function p(g){return Vt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),f):n(g)}function f(g){return o.containerState.size=a+o.sliceSerialize(e.exit("listItemPrefix"),!0).length,r(g)}}function r3e(e,r,n){const o=this;return o.containerState._closeFlow=void 0,e.check(s1,i,a);function i(s){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Zt(e,r,"listItemIndent",o.containerState.size+1)(s)}function a(s){return o.containerState.furtherBlankLines||!Vt(s)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,l(s)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,e.attempt(e3e,r,l)(s))}function l(s){return o.containerState._closeFlow=!0,o.interrupt=void 0,Zt(e,e.attempt(ei,r,n),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function n3e(e,r,n){const o=this;return Zt(e,i,"listItemIndent",o.containerState.size+1);function i(a){const l=o.events[o.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===o.containerState.size?r(a):n(a)}}function o3e(e){e.exit(this.containerState.type)}function i3e(e,r,n){const o=this;return Zt(e,i,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=o.events[o.events.length-1];return!Vt(a)&&l&&l[1].type==="listItemPrefixWhitespace"?r(a):n(a)}}const PI={name:"setextUnderline",resolveTo:a3e,tokenize:l3e};function a3e(e,r){let n=e.length,o,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){o=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",l,r]),e.splice(a+1,0,["exit",e[o][1],r]),e[o][1].end={...e[a][1].end}):e[o][1]=l,e.push(["exit",l,r]),e}function l3e(e,r,n){const o=this;let i;return a;function a(d){let u=o.events.length,p;for(;u--;)if(o.events[u][1].type!=="lineEnding"&&o.events[u][1].type!=="linePrefix"&&o.events[u][1].type!=="content"){p=o.events[u][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||p)?(e.enter("setextHeadingLine"),i=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),s(d)}function s(d){return d===i?(e.consume(d),s):(e.exit("setextHeadingLineSequence"),Vt(d)?Zt(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||gt(d)?(e.exit("setextHeadingLine"),r(d)):n(d)}}const s3e={tokenize:g3e,partial:!0};function c3e(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:h3e,continuation:{tokenize:f3e},exit:m3e}},text:{91:{name:"gfmFootnoteCall",tokenize:p3e},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:d3e,resolveTo:u3e}}}}function d3e(e,r,n){const o=this;let i=o.events.length;const a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let l;for(;i--;){const c=o.events[i][1];if(c.type==="labelImage"){l=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return s;function s(c){if(!l||!l._balanced)return n(c);const d=Ua(o.sliceSerialize({start:l.end,end:o.now()}));return d.codePointAt(0)!==94||!a.includes(d.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),r(c))}}function u3e(e,r){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],["enter",o,r],e[n+3],e[n+4],["enter",i,r],["exit",i,r],["enter",a,r],["enter",l,r],["exit",l,r],["exit",a,r],e[e.length-2],e[e.length-1],["exit",o,r]];return e.splice(n,e.length-n+1,...s),e}function p3e(e,r,n){const o=this,i=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let a=0,l;return s;function s(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),c}function c(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(a>999||p===93&&!l||p===null||p===91||Sr(p))return n(p);if(p===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(Ua(o.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),r):n(p)}return Sr(p)||(l=!0),a++,e.consume(p),p===92?u:d}function u(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function h3e(e,r,n){const o=this,i=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let a,l=0,s;return c;function c(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(v)}function u(v){if(l>999||v===93&&!s||v===null||v===91||Sr(v))return n(v);if(v===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=Ua(o.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Sr(v)||(s=!0),l++,e.consume(v),v===92?p:u}function p(v){return v===91||v===92||v===93?(e.consume(v),l++,u):u(v)}function f(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),i.includes(a)||i.push(a),Zt(e,g,"gfmFootnoteDefinitionWhitespace")):n(v)}function g(v){return r(v)}}function f3e(e,r,n){return e.check(s1,r,e.attempt(s3e,r,n))}function m3e(e){e.exit("gfmFootnoteDefinition")}function g3e(e,r,n){const o=this;return Zt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const l=o.events[o.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?r(a):n(a)}}function y3e(e){let n=(e||{}).singleTilde;const o={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function i(l,s){let c=-1;for(;++c1?c(v):(l.consume(v),p++,g);if(p<2&&!n)return c(v);const x=l.exit("strikethroughSequenceTemporary"),k=Fh(v);return x._open=!k||k===2&&!!w,x._close=!w||w===2&&!!k,s(v)}}}class v3e{constructor(){this.map=[]}add(r,n,o){b3e(this,r,n,o)}consume(r){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const o=[];for(;n>0;)n-=1,o.push(r.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),r.length=this.map[n][0];o.push(r.slice()),r.length=0;let i=o.pop();for(;i;){for(const a of i)r.push(a);i=o.pop()}this.map.length=0}}function b3e(e,r,n,o){let i=0;if(!(n===0&&o.length===0)){for(;i-1;){const M=o.events[P][1].type;if(M==="lineEnding"||M==="linePrefix")P--;else break}const L=P>-1?o.events[P][1].type:null,H=L==="tableHead"||L==="tableRow"?T:c;return H===T&&o.parser.lazy[o.now().line]?n(I):H(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),d(I)}function d(I){return I===124||(l=!0,a+=1),u(I)}function u(I){return I===null?n(I):gt(I)?a>1?(a=0,o.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),g):n(I):Vt(I)?Zt(e,u,"whitespace")(I):(a+=1,l&&(l=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),l=!0,u):(e.enter("data"),p(I)))}function p(I){return I===null||I===124||Sr(I)?(e.exit("data"),u(I)):(e.consume(I),I===92?f:p)}function f(I){return I===92||I===124?(e.consume(I),p):p(I)}function g(I){return o.interrupt=!1,o.parser.lazy[o.now().line]?n(I):(e.enter("tableDelimiterRow"),l=!1,Vt(I)?Zt(e,v,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):v(I))}function v(I){return I===45||I===58?x(I):I===124?(l=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),w):R(I)}function w(I){return Vt(I)?Zt(e,x,"whitespace")(I):x(I)}function x(I){return I===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),k):I===45?(a+=1,k(I)):I===null||gt(I)?$(I):R(I)}function k(I){return I===45?(e.enter("tableDelimiterFiller"),C(I)):R(I)}function C(I){return I===45?(e.consume(I),C):I===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(I))}function _(I){return Vt(I)?Zt(e,$,"whitespace")(I):$(I)}function $(I){return I===124?v(I):I===null||gt(I)?!l||i!==a?R(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),r(I)):R(I)}function R(I){return n(I)}function T(I){return e.enter("tableRow"),A(I)}function A(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),A):I===null||gt(I)?(e.exit("tableRow"),r(I)):Vt(I)?Zt(e,A,"whitespace")(I):(e.enter("data"),z(I))}function z(I){return I===null||I===124||Sr(I)?(e.exit("data"),A(I)):(e.consume(I),I===92?j:z)}function j(I){return I===92||I===124?(e.consume(I),z):z(I)}}function _3e(e,r){let n=-1,o=!0,i=0,a=[0,0,0,0],l=[0,0,0,0],s=!1,c=0,d,u,p;const f=new v3e;for(;++nn[2]+1){const v=n[2]+1,w=n[3]-n[2]-1;e.add(v,w,[])}}e.add(n[3]+1,0,[["exit",p,r]])}return i!==void 0&&(a.end=Object.assign({},qh(r.events,i)),e.add(i,0,[["exit",a,r]]),a=void 0),a}function BI(e,r,n,o,i){const a=[],l=qh(r.events,n);i&&(i.end=Object.assign({},l),a.push(["exit",i,r])),o.end=Object.assign({},l),a.push(["exit",o,r]),e.add(n+1,0,a)}function qh(e,r){const n=e[r],o=n[0]==="enter"?"start":"end";return n[1][o]}const S3e={name:"tasklistCheck",tokenize:C3e};function E3e(){return{text:{91:S3e}}}function C3e(e,r,n){const o=this;return i;function i(c){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return Sr(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),l):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),l):n(c)}function l(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(c)}function s(c){return gt(c)?r(c):Vt(c)?e.check({tokenize:$3e},r,n)(c):n(c)}}function $3e(e,r,n){return Zt(e,o,"whitespace");function o(i){return i===null?n(i):r(i)}}function R3e(e){return gI([Ixe(),c3e(),y3e(e),w3e(),E3e()])}const z3e={};function T3e(e){const r=this,n=e||z3e,o=r.data(),i=o.micromarkExtensions||(o.micromarkExtensions=[]),a=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),l=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);i.push(R3e(n)),a.push(Axe()),l.push(Dxe(n))}const j3e=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,A3e=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,D3e=({legacyTitle:e=!1,tagName:r="div"}={})=>n=>{K_(n,"blockquote",(o,i,a)=>{let l="",s="",c=!0,d=o.children.map(u=>{if(c&&u.type==="paragraph"){const p=u.children[0],f=p.type==="text"?p.value:"",g=e?A3e:j3e,v=f.match(g);if(v&&(c=!1,l=v[1].toLocaleLowerCase(),s=e&&v[2]||l.toLocaleUpperCase(),f.includes(` `)&&(u.children[0]={type:"text",value:f.replace(g,"").replace(/^\n+/,"")}),!f.includes(` -`))){const w=[];u.children.forEach((x,k)=>{k!=0&&(k==1&&x.type==="break"||w.push(x))}),u.children=[...w]}}return u});l&&(o.data={hName:r,hProperties:{className:["markdown-alert",`markdown-alert-${l}`],dir:"auto"}},d.unshift({type:"paragraph",children:[M3e(l),{type:"text",value:s.replace(/^\//,"")}],data:{hProperties:{className:"markdown-alert-title",dir:"auto"}}})),o.children=[...d]})};function M3e(e){let r=N3e[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{className:["octicon"],viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:r}},children:[]}]}}const N3e={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"},P3e={tokenize:B3e};function B3e(e){const r=e.attempt(this.parser.constructs.contentInitial,o,a);let n;return r;function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Kt(e,r,"linePrefix")}function a(s){return e.enter("paragraph"),i(s)}function i(s){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,l(s)}function l(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return gt(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),l)}}const I3e={tokenize:O3e},II={tokenize:L3e};function O3e(e){const r=this,n=[];let o=0,a,i,l;return s;function s(_){if(ol))return;const A=r.events.length;let z=A,j,I;for(;z--;)if(r.events[z][0]==="exit"&&r.events[z][1].type==="chunkFlow"){if(j){I=r.events[z][1].end;break}j=!0}for(k(o),T=A;T_;){const R=n[$];r.containerState=R[1],R[0].exit.call(r,e)}n.length=_}function C(){a.write([null]),i=void 0,a=void 0,r.containerState._closeFlow=void 0}}function L3e(e,r,n){return Kt(e,e.attempt(this.parser.constructs.document,r,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const F3e={tokenize:V3e};function V3e(e){const r=this,n=e.attempt(s1,o,e.attempt(this.parser.constructs.flowInitial,a,Kt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(fwe,a)),"linePrefix")));return n;function o(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),r.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r.currentConstruct=void 0,n}}const q3e={resolveAll:LI()},H3e=OI("string"),U3e=OI("text");function OI(e){return{resolveAll:LI(e==="text"?W3e:void 0),tokenize:r};function r(n){const o=this,a=this.parser.constructs[e],i=n.attempt(a,l,s);return l;function l(u){return d(u)?i(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),c}function c(u){return d(u)?(n.exit("data"),i(u)):(n.consume(u),c)}function d(u){if(u===null)return!0;const p=a[u];let f=-1;if(p)for(;++f-1){const s=l[0];typeof s=="string"?l[0]=s.slice(o):l.shift()}i>0&&l.push(e[a].slice(0,i))}return l}function Z3e(e,r){let n=-1;const o=[];let a;for(;++n{k!=0&&(k==1&&x.type==="break"||w.push(x))}),u.children=[...w]}}return u});l&&(o.data={hName:r,hProperties:{className:["markdown-alert",`markdown-alert-${l}`],dir:"auto"}},d.unshift({type:"paragraph",children:[M3e(l),{type:"text",value:s.replace(/^\//,"")}],data:{hProperties:{className:"markdown-alert-title",dir:"auto"}}})),o.children=[...d]})};function M3e(e){let r=N3e[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{className:["octicon"],viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:r}},children:[]}]}}const N3e={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"},P3e={tokenize:B3e};function B3e(e){const r=e.attempt(this.parser.constructs.contentInitial,o,i);let n;return r;function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Zt(e,r,"linePrefix")}function i(s){return e.enter("paragraph"),a(s)}function a(s){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,l(s)}function l(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return gt(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),l)}}const I3e={tokenize:O3e},II={tokenize:L3e};function O3e(e){const r=this,n=[];let o=0,i,a,l;return s;function s(_){if(ol))return;const A=r.events.length;let z=A,j,I;for(;z--;)if(r.events[z][0]==="exit"&&r.events[z][1].type==="chunkFlow"){if(j){I=r.events[z][1].end;break}j=!0}for(k(o),T=A;T_;){const R=n[$];r.containerState=R[1],R[0].exit.call(r,e)}n.length=_}function C(){i.write([null]),a=void 0,i=void 0,r.containerState._closeFlow=void 0}}function L3e(e,r,n){return Zt(e,e.attempt(this.parser.constructs.document,r,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const F3e={tokenize:V3e};function V3e(e){const r=this,n=e.attempt(s1,o,e.attempt(this.parser.constructs.flowInitial,i,Zt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(fwe,i)),"linePrefix")));return n;function o(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),r.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r.currentConstruct=void 0,n}}const q3e={resolveAll:LI()},H3e=OI("string"),U3e=OI("text");function OI(e){return{resolveAll:LI(e==="text"?W3e:void 0),tokenize:r};function r(n){const o=this,i=this.parser.constructs[e],a=n.attempt(i,l,s);return l;function l(u){return d(u)?a(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),c}function c(u){return d(u)?(n.exit("data"),a(u)):(n.consume(u),c)}function d(u){if(u===null)return!0;const p=i[u];let f=-1;if(p)for(;++f-1){const s=l[0];typeof s=="string"?l[0]=s.slice(o):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function K3e(e,r){let n=-1;const o=[];let i;for(;++n0){const Tr=Ye.tokenStack[Ye.tokenStack.length-1];(Tr[1]||GI).call(Ye,void 0,Tr[0])}for(ke.position={start:rd(be.length>0?be[0][1].start:{line:1,column:1,offset:0}),end:rd(be.length>0?be[be.length-2][1].end:{line:1,column:1,offset:0})},xt=-1;++xt1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(r,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(r,d),e.applyData(r,d)}function c2e(e,r){const n={type:"element",tagName:"h"+r.depth,properties:{},children:e.all(r)};return e.patch(r,n),e.applyData(r,n)}function d2e(e,r){if(e.options.allowDangerousHtml){const n={type:"raw",value:r.value};return e.patch(r,n),e.applyData(r,n)}}function YI(e,r){const n=r.referenceType;let o="]";if(n==="collapsed"?o+="[]":n==="full"&&(o+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+o}];const a=e.all(r),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=o:a.push({type:"text",value:o}),a}function u2e(e,r){const n=String(r.identifier).toUpperCase(),o=e.definitionById.get(n);if(!o)return YI(e,r);const a={src:Vh(o.url||""),alt:r.alt};o.title!==null&&o.title!==void 0&&(a.title=o.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(r,i),e.applyData(r,i)}function p2e(e,r){const n={src:Vh(r.url)};r.alt!==null&&r.alt!==void 0&&(n.alt=r.alt),r.title!==null&&r.title!==void 0&&(n.title=r.title);const o={type:"element",tagName:"img",properties:n,children:[]};return e.patch(r,o),e.applyData(r,o)}function h2e(e,r){const n={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};e.patch(r,n);const o={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(r,o),e.applyData(r,o)}function f2e(e,r){const n=String(r.identifier).toUpperCase(),o=e.definitionById.get(n);if(!o)return YI(e,r);const a={href:Vh(o.url||"")};o.title!==null&&o.title!==void 0&&(a.title=o.title);const i={type:"element",tagName:"a",properties:a,children:e.all(r)};return e.patch(r,i),e.applyData(r,i)}function m2e(e,r){const n={href:Vh(r.url)};r.title!==null&&r.title!==void 0&&(n.title=r.title);const o={type:"element",tagName:"a",properties:n,children:e.all(r)};return e.patch(r,o),e.applyData(r,o)}function g2e(e,r,n){const o=e.all(r),a=n?y2e(n):XI(r),i={},l=[];if(typeof r.checked=="boolean"){const u=o[0];let p;u&&u.type==="element"&&u.tagName==="p"?p=u:(p={type:"element",tagName:"p",properties:{},children:[]},o.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s1}function v2e(e,r){const n={},o=e.all(r);let a=-1;for(typeof r.start=="number"&&r.start!==1&&(n.start=r.start);++a0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=fB(r.children[1]),c=hB(r.children[r.children.length-1]);s&&c&&(l.position={start:s,end:c}),a.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(r,i),e.applyData(r,i)}function _2e(e,r,n){const o=n?n.children:void 0,i=(o?o.indexOf(r):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:r.children.length;let c=-1;const d=[];for(;++c0,!0),o[0]),a=o.index+o[0].length,o=n.exec(r);return i.push(QI(r.slice(a),a>0,!1)),i.join("")}function QI(e,r,n){let o=0,a=e.length;if(r){let i=e.codePointAt(o);for(;i===ZI||i===KI;)o++,i=e.codePointAt(o)}if(n){let i=e.codePointAt(a-1);for(;i===ZI||i===KI;)a--,i=e.codePointAt(a-1)}return a>o?e.slice(o,a):""}function C2e(e,r){const n={type:"text",value:E2e(String(r.value))};return e.patch(r,n),e.applyData(r,n)}function $2e(e,r){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(r,n),e.applyData(r,n)}const R2e={blockquote:n2e,break:o2e,code:a2e,delete:i2e,emphasis:l2e,footnoteReference:s2e,heading:c2e,html:d2e,imageReference:u2e,image:p2e,inlineCode:h2e,linkReference:f2e,link:m2e,listItem:g2e,list:v2e,paragraph:b2e,root:x2e,strong:w2e,table:k2e,tableCell:S2e,tableRow:_2e,text:C2e,thematicBreak:$2e,toml:Yb,yaml:Yb,definition:Yb,footnoteDefinition:Yb};function Yb(){}function z2e(e,r){const n=[{type:"text",value:"↩"}];return r>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),n}function T2e(e,r){return"Back to reference "+(e+1)+(r>1?"-"+r:"")}function j2e(e){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||z2e,o=e.options.footnoteBackLabel||T2e,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let c=-1;for(;++c0&&v.push({type:"text",value:" "});let C=typeof n=="string"?n:n(c,g);typeof C=="string"&&(C={type:"text",value:C}),v.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+f+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(c,g),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const C=x.children[x.children.length-1];C&&C.type==="text"?C.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...v)}else u.push(...v);const k={type:"element",tagName:"li",properties:{id:r+"fn-"+f},children:e.wrap(u,!0)};e.patch(d,k),s.push(k)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...o1(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:` +`;break}case-2:{l=r?" ":" ";break}case-1:{if(!r&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,o.push(l)}return o.join("")}function Z3e(e){const o={constructs:gI([G3e,...(e||{}).extensions||[]]),content:i(P3e),defined:[],document:i(I3e),flow:i(F3e),lazy:{},string:i(H3e),text:i(U3e)};return o;function i(a){return l;function l(s){return Y3e(o,a,s)}}}function Q3e(e){for(;!jI(e););return e}const FI=/[\0\t\n\r]/g;function J3e(){let e=1,r="",n=!0,o;return i;function i(a,l,s){const c=[];let d,u,p,f,g;for(a=r+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),p=0,r="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p0){const Tr=Ye.tokenStack[Ye.tokenStack.length-1];(Tr[1]||GI).call(Ye,void 0,Tr[0])}for(ke.position={start:rd(be.length>0?be[0][1].start:{line:1,column:1,offset:0}),end:rd(be.length>0?be[be.length-2][1].end:{line:1,column:1,offset:0})},xt=-1;++xt1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(r,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(r,d),e.applyData(r,d)}function c2e(e,r){const n={type:"element",tagName:"h"+r.depth,properties:{},children:e.all(r)};return e.patch(r,n),e.applyData(r,n)}function d2e(e,r){if(e.options.allowDangerousHtml){const n={type:"raw",value:r.value};return e.patch(r,n),e.applyData(r,n)}}function YI(e,r){const n=r.referenceType;let o="]";if(n==="collapsed"?o+="[]":n==="full"&&(o+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+o}];const i=e.all(r),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=o:i.push({type:"text",value:o}),i}function u2e(e,r){const n=String(r.identifier).toUpperCase(),o=e.definitionById.get(n);if(!o)return YI(e,r);const i={src:Vh(o.url||""),alt:r.alt};o.title!==null&&o.title!==void 0&&(i.title=o.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(r,a),e.applyData(r,a)}function p2e(e,r){const n={src:Vh(r.url)};r.alt!==null&&r.alt!==void 0&&(n.alt=r.alt),r.title!==null&&r.title!==void 0&&(n.title=r.title);const o={type:"element",tagName:"img",properties:n,children:[]};return e.patch(r,o),e.applyData(r,o)}function h2e(e,r){const n={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};e.patch(r,n);const o={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(r,o),e.applyData(r,o)}function f2e(e,r){const n=String(r.identifier).toUpperCase(),o=e.definitionById.get(n);if(!o)return YI(e,r);const i={href:Vh(o.url||"")};o.title!==null&&o.title!==void 0&&(i.title=o.title);const a={type:"element",tagName:"a",properties:i,children:e.all(r)};return e.patch(r,a),e.applyData(r,a)}function m2e(e,r){const n={href:Vh(r.url)};r.title!==null&&r.title!==void 0&&(n.title=r.title);const o={type:"element",tagName:"a",properties:n,children:e.all(r)};return e.patch(r,o),e.applyData(r,o)}function g2e(e,r,n){const o=e.all(r),i=n?y2e(n):XI(r),a={},l=[];if(typeof r.checked=="boolean"){const u=o[0];let p;u&&u.type==="element"&&u.tagName==="p"?p=u:(p={type:"element",tagName:"p",properties:{},children:[]},o.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s1}function v2e(e,r){const n={},o=e.all(r);let i=-1;for(typeof r.start=="number"&&r.start!==1&&(n.start=r.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=fB(r.children[1]),c=hB(r.children[r.children.length-1]);s&&c&&(l.position={start:s,end:c}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(r,a),e.applyData(r,a)}function _2e(e,r,n){const o=n?n.children:void 0,a=(o?o.indexOf(r):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:r.children.length;let c=-1;const d=[];for(;++c0,!0),o[0]),i=o.index+o[0].length,o=n.exec(r);return a.push(QI(r.slice(i),i>0,!1)),a.join("")}function QI(e,r,n){let o=0,i=e.length;if(r){let a=e.codePointAt(o);for(;a===KI||a===ZI;)o++,a=e.codePointAt(o)}if(n){let a=e.codePointAt(i-1);for(;a===KI||a===ZI;)i--,a=e.codePointAt(i-1)}return i>o?e.slice(o,i):""}function C2e(e,r){const n={type:"text",value:E2e(String(r.value))};return e.patch(r,n),e.applyData(r,n)}function $2e(e,r){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(r,n),e.applyData(r,n)}const R2e={blockquote:n2e,break:o2e,code:i2e,delete:a2e,emphasis:l2e,footnoteReference:s2e,heading:c2e,html:d2e,imageReference:u2e,image:p2e,inlineCode:h2e,linkReference:f2e,link:m2e,listItem:g2e,list:v2e,paragraph:b2e,root:x2e,strong:w2e,table:k2e,tableCell:S2e,tableRow:_2e,text:C2e,thematicBreak:$2e,toml:Yb,yaml:Yb,definition:Yb,footnoteDefinition:Yb};function Yb(){}function z2e(e,r){const n=[{type:"text",value:"↩"}];return r>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),n}function T2e(e,r){return"Back to reference "+(e+1)+(r>1?"-"+r:"")}function j2e(e){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||z2e,o=e.options.footnoteBackLabel||T2e,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let c=-1;for(;++c0&&v.push({type:"text",value:" "});let C=typeof n=="string"?n:n(c,g);typeof C=="string"&&(C={type:"text",value:C}),v.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+f+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(c,g),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const C=x.children[x.children.length-1];C&&C.type==="text"?C.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...v)}else u.push(...v);const k={type:"element",tagName:"li",properties:{id:r+"fn-"+f},children:e.wrap(u,!0)};e.patch(d,k),s.push(k)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...o1(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` -`}]}}const l8={}.hasOwnProperty,A2e={};function D2e(e,r){const n=r||A2e,o=new Map,a=new Map,i=new Map,l={...R2e,...n.handlers},s={all:d,applyData:N2e,definitionById:o,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:l,one:c,options:n,patch:M2e,wrap:B2e};return Z_(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const p=u.type==="definition"?o:a,f=String(u.identifier).toUpperCase();p.has(f)||p.set(f,u)}}),s;function c(u,p){const f=u.type,g=s.handlers[f];if(l8.call(s.handlers,f)&&g)return g(s,u,p);if(s.options.passThrough&&s.options.passThrough.includes(f)){if("children"in u){const{children:w,...x}=u,k=o1(x);return k.children=s.all(u),k}return o1(u)}return(s.options.unknownHandler||P2e)(s,u,p)}function d(u){const p=[];if("children"in u){const f=u.children;let g=-1;for(;++g0&&n.push({type:"text",value:` -`}),n}function JI(e){let r=0,n=e.charCodeAt(r);for(;n===9||n===32;)r++,n=e.charCodeAt(r);return e.slice(r)}function eO(e,r){const n=D2e(e,r),o=n.one(e,void 0),a=j2e(n),i=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return a&&i.children.push({type:"text",value:` -`},a),i}function I2e(e,r){return e&&"run"in e?async function(n,o){const a=eO(n,{file:o,...r});await e.run(a,o)}:function(n,o){return eO(n,{file:o,...e||r})}}function tO(e){if(e)throw e}var s8,rO;function O2e(){if(rO)return s8;rO=1;var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):r.call(d)==="[object Array]"},i=function(d){if(!d||r.call(d)!=="[object Object]")return!1;var u=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!u&&!p)return!1;var f;for(f in d);return typeof f>"u"||e.call(d,f)},l=function(d,u){n&&u.name==="__proto__"?n(d,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):d[u.name]=u.newValue},s=function(d,u){if(u==="__proto__")if(e.call(d,u)){if(o)return o(d,u).value}else return;return d[u]};return s8=function c(){var d,u,p,f,g,v,w=arguments[0],x=1,k=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},x=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});xl.length;let c;s&&l.push(a);try{c=e.apply(this,l)}catch(d){const u=d;if(s&&n)throw u;return a(u)}s||(c&&c.then&&typeof c.then=="function"?c.then(i,a):c instanceof Error?a(c):i(c))}function a(l,...s){n||(n=!0,r(l,...s))}function i(l){a(null,l)}}class ta extends Error{constructor(r,n,o){super(),typeof n=="string"&&(o=n,n=void 0);let a="",i={},l=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof r=="string"?a=r:!i.cause&&r&&(l=!0,a=r.message,i.cause=r),!i.ruleId&&!i.source&&typeof o=="string"){const c=o.indexOf(":");c===-1?i.ruleId=o:(i.source=o.slice(0,c),i.ruleId=o.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=s?s.line:void 0,this.name=u1(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}ta.prototype.file="",ta.prototype.name="",ta.prototype.reason="",ta.prototype.message="",ta.prototype.stack="",ta.prototype.column=void 0,ta.prototype.line=void 0,ta.prototype.ancestors=void 0,ta.prototype.cause=void 0,ta.prototype.fatal=void 0,ta.prototype.place=void 0,ta.prototype.ruleId=void 0,ta.prototype.source=void 0;const ql={basename:q2e,dirname:H2e,extname:U2e,join:W2e,sep:"/"};function q2e(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');p1(e);let n=0,o=-1,a=e.length,i;if(r===void 0||r.length===0||r.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else o<0&&(i=!0,o=a+1);return o<0?"":e.slice(n,o)}if(r===e)return"";let l=-1,s=r.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else l<0&&(i=!0,l=a+1),s>-1&&(e.codePointAt(a)===r.codePointAt(s--)?s<0&&(o=a):(s=-1,o=l));return n===o?o=l:o<0&&(o=e.length),e.slice(n,o)}function H2e(e){if(p1(e),e.length===0)return".";let r=-1,n=e.length,o;for(;--n;)if(e.codePointAt(n)===47){if(o){r=n;break}}else o||(o=!0);return r<0?e.codePointAt(0)===47?"/":".":r===1&&e.codePointAt(0)===47?"//":e.slice(0,r)}function U2e(e){p1(e);let r=e.length,n=-1,o=0,a=-1,i=0,l;for(;r--;){const s=e.codePointAt(r);if(s===47){if(l){o=r+1;break}continue}n<0&&(l=!0,n=r+1),s===46?a<0?a=r:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===o+1?"":e.slice(a,n)}function W2e(...e){let r=-1,n;for(;++r0&&e.codePointAt(e.length-1)===47&&(n+="/"),r?"/"+n:n}function Y2e(e,r){let n="",o=0,a=-1,i=0,l=-1,s,c;for(;++l<=e.length;){if(l2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",o=0):(n=n.slice(0,c),o=n.length-1-n.lastIndexOf("/")),a=l,i=0;continue}}else if(n.length>0){n="",o=0,a=l,i=0;continue}}r&&(n=n.length>0?n+"/..":"..",o=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),o=l-a-1;a=l,i=0}else s===46&&i>-1?i++:i=-1}return n}function p1(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const X2e={cwd:Z2e};function Z2e(){return"/"}function u8(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function K2e(e){if(typeof e=="string")e=new URL(e);else if(!u8(e)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(e.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return Q2e(e)}function Q2e(e){if(e.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const r=e.pathname;let n=-1;for(;++n0){let[g,...v]=u;const w=o[f][1];d8(w)&&d8(g)&&(g=c8(!0,w,g)),o[f]=[d,g,...v]}}}}const n4e=new m8().freeze();function g8(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function y8(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function v8(e,r){if(r)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function oO(e){if(!d8(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function aO(e,r,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+r+"` instead")}function Xb(e){return o4e(e)?e:new J2e(e)}function o4e(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function a4e(e){return typeof e=="string"||i4e(e)}function i4e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function l4e(){return n4e().use(r2e).use(T3e).use(D3e).use(I2e,{allowDangerousHtml:!0}).use(S0e,XN({attributes:{"*":["className"],svg:["width","height","viewBox","fill","ariaHidden"],path:["d","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin"]},tagNames:["svg","g","path","div"]},M_)).use(Fve,{allowDangerousHtml:!0})}function s4e(e){return(""+l4e().processSync(e)).trim()}function c4e(e){return Hb(UI(e),{includeHtml:!1,includeImageAlt:!1})}var b8,iO;function d4e(){if(iO)return b8;iO=1;var e=iB(),r=Ab();function n(){this.clear()}return n.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},n.prototype.enqueue=function(o){return this.items.push(o),++this.size},n.prototype.dequeue=function(){if(this.size){var o=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,o}},n.prototype.peek=function(){if(this.size)return this.items[this.offset]},n.prototype.forEach=function(o,a){a=arguments.length>1?a:this;for(var i=this.offset,l=0,s=this.items.length;i=o.length)return{done:!0};var i=o[a];return a++,{value:i,done:!1}})},n.prototype.entries=function(){var o=this.items,a=this.offset,i=0;return new e(function(){if(a>=o.length)return{done:!0};var l=o[a];return a++,{value:[i++,l],done:!1}})},typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=n.prototype.values),n.prototype.toString=function(){return this.toArray().join(",")},n.prototype.toJSON=function(){return this.toArray()},n.prototype.inspect=function(){var o=this.toArray();return Object.defineProperty(o,"constructor",{value:n,enumerable:!1}),o},typeof Symbol<"u"&&(n.prototype[Symbol.for("nodejs.util.inspect.custom")]=n.prototype.inspect),n.from=function(o){var a=new n;return r(o,function(i){a.enqueue(i)}),a},n.of=function(){return n.from(arguments)},b8=n,b8}var u4e=d4e();const x8=Qg(u4e);var w8,lO;function p4e(){if(lO)return w8;lO=1;function e(r){if(typeof r!="function")throw new Error("mnemonist/DefaultMap.constructor: expecting a function.");this.items=new Map,this.factory=r,this.size=0}return e.prototype.clear=function(){this.items.clear(),this.size=0},e.prototype.get=function(r){var n=this.items.get(r);return typeof n>"u"&&(n=this.factory(r,this.size),this.items.set(r,n),this.size++),n},e.prototype.peek=function(r){return this.items.get(r)},e.prototype.set=function(r,n){return this.items.set(r,n),this.size=this.items.size,this},e.prototype.has=function(r){return this.items.has(r)},e.prototype.delete=function(r){var n=this.items.delete(r);return this.size=this.items.size,n},e.prototype.forEach=function(r,n){n=arguments.length>1?n:this,this.items.forEach(r,n)},e.prototype.entries=function(){return this.items.entries()},e.prototype.keys=function(){return this.items.keys()},e.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(e.prototype[Symbol.iterator]=e.prototype.entries),e.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(e.prototype[Symbol.for("nodejs.util.inspect.custom")]=e.prototype.inspect),e.autoIncrement=function(){var r=0;return function(){return r++}},w8=e,w8}var h4e=p4e();const Ln=Qg(h4e);function Ja(e){return!!e}function sO(e){return r=>!e(r)}function f4e(...e){return io(m4e,e)}const m4e=(e,r)=>r.every(n=>n(e));function g4e(...e){return io(y4e,e)}const y4e=(e,r)=>r.some(n=>n(e));function Xn(e){return e==null}function cO(e,r){return e[Iu]===r}const Iu="_stage",h1="_type",k8="_layout";function v4e(e){return Ja(e.kind)&&!Ja(e.element)}function b4e(e){return"tag"in e}function x4e(e){return"kind"in e}function w4e(e){return"participant"in e}function k4e(e){return"not"in e}function _4e(e){return"and"in e}function S4e(e){return"or"in e}function Ou(e){switch(!0){case w4e(e):{const r=e.participant,n=Ou(e.operator);return E4e(r,n)}case b4e(e):{if(Qc(e.tag)||"eq"in e.tag){const n=Qc(e.tag)?e.tag:e.tag.eq;return o=>Array.isArray(o.tags)&&o.tags.includes(n)}const r=e.tag.neq;return n=>!Array.isArray(n.tags)||!n.tags.includes(r)}case x4e(e):{if(Qc(e.kind)||"eq"in e.kind){const n=Qc(e.kind)?e.kind:e.kind.eq;return o=>o.kind===n}const r=e.kind.neq;return n=>Xn(n.kind)||n.kind!==r}case k4e(e):{const r=Ou(e.not);return sO(r)}case _4e(e):{const r=e.and.map(Ou);return f4e(r)}case S4e(e):{const r=e.or.map(Ou);return g4e(r)}default:Qo(e)}}function E4e(e,r){return n=>{if(!n.source||!n.target)return!1;switch(e){case"source":return r(n.source);case"target":return r(n.target)}}}function C4e(e){return e._type==="dynamic"}function f1(...e){return io(Object.entries,e)}function Lu(e,...r){return typeof e=="string"||typeof e=="number"||typeof e=="symbol"?n=>dO(n,e,...r):dO(e,...r)}function dO(e,...r){let n=e;for(let o of r){if(n==null)return;n=n[o]}return n}function Zb(...e){return io($4e,e,R4e)}const $4e=(e,r)=>e.map(r),R4e=e=>(r,n,o)=>({done:!1,hasNext:!0,next:e(r,n,o)});function z4e(e,r){let n=r.length-e.length;if(n===1){let[o,...a]=r;return Ps(o,{lazy:e,lazyArgs:a})}if(n===0){let o={lazy:e,lazyArgs:r};return Object.assign(a=>Ps(a,o),o)}throw Error("Wrong number of arguments")}function Kb(...e){return z4e(T4e,e)}function T4e(){let e=new Set;return r=>e.has(r)?E_:(e.add(r),{done:!1,hasNext:!0,next:r})}var _8={},uO;function j4e(){return uO||(uO=1,(function(e){e.intersection=function(){if(arguments.length<2)throw new Error("mnemonist/Set.intersection: needs at least two arguments.");var r=new Set,n=1/0,o=null,a,i,l=arguments.length;for(i=0;in.size)return!1;for(;a=o.next(),!a.done;)if(!n.has(a.value))return!1;return!0},e.isSuperset=function(r,n){return e.isSubset(n,r)},e.add=function(r,n){for(var o=n.values(),a;a=o.next(),!a.done;)r.add(a.value)},e.subtract=function(r,n){for(var o=n.values(),a;a=o.next(),!a.done;)r.delete(a.value)},e.intersect=function(r,n){for(var o=r.values(),a;a=o.next(),!a.done;)n.has(a.value)||r.delete(a.value)},e.disjunct=function(r,n){for(var o=r.values(),a,i=[];a=o.next(),!a.done;)n.has(a.value)&&i.push(a.value);for(o=n.values();a=o.next(),!a.done;)r.has(a.value)||r.add(a.value);for(var l=0,s=i.length;ln.size&&(o=r,r=n,n=o),r.size===0)return 0;if(r===n)return r.size;for(var a=r.values(),i,l=0;i=a.next(),!i.done;)n.has(i.value)&&l++;return l},e.unionSize=function(r,n){var o=e.intersectionSize(r,n);return r.size+n.size-o},e.jaccard=function(r,n){var o=e.intersectionSize(r,n);if(o===0)return 0;var a=r.size+n.size-o;return o/a},e.overlap=function(r,n){var o=e.intersectionSize(r,n);return o===0?0:o/Math.min(r.size,n.size)}})(_8)),_8}var pO=j4e();function S8(...e){let r=new Set;for(const n of e)for(const o of n)r.add(o);return r}function Hh(e,...r){let n=new Set;if(e.size===0)return n;let o=Ll(r,2)?pO.intersection(...r):r[0];if(o.size===0)return n;for(const a of e)o.has(a)&&n.add(a);return n}function E8(e,r){if(e.size===0)return new Set;if(r.size===0)return new Set(e);let n=new Set;for(const o of e)r.has(o)||n.add(o);return n}function A4e(e,r){return e.size===r.size&&[...e].every(n=>r.has(n))}function D4e(e,r){return pO.symmetricDifference(e,r)}function m1(e){return e?hO(e):hO}function hO(e){const r=e[Symbol.iterator](),{value:n}=r.next();return n}const Qb=e=>typeof e=="function";function Is(e,r){const n=r??e;He(Qb(n));function*o(a){for(const i of a)n(i)&&(yield i)}return r?o(e):o}const fO={asc:(e,r)=>e>r,desc:(e,r)=>ee(i,a)}function C8(e,r,...n){let o=typeof e=="function"?e:e[0],a=typeof e=="function"?"asc":e[1],{[a]:i}=fO,l=r===void 0?void 0:C8(r,...n);return(s,c)=>{let d=o(s),u=o(c);return i(d,u)?1:i(u,d)?-1:l?.(s,c)??0}}function N4e(e){if(mO(e))return!0;if(typeof e!="object"||!Array.isArray(e))return!1;let[r,n,...o]=e;return mO(r)&&typeof n=="string"&&n in fO&&o.length===0}const mO=e=>typeof e=="function"&&e.length===1;function P4e(...e){return io(B4e,e,I4e)}const B4e=(e,r)=>e.filter(r),I4e=e=>(r,n,o)=>e(r,n,o)?{done:!1,hasNext:!0,next:r}:E_;function gO(...e){return io(O4e,e,L4e)}const O4e=(e,r)=>e.flatMap(r),L4e=e=>(r,n,o)=>{let a=e(r,n,o);return Array.isArray(a)?{done:!1,hasNext:!0,hasMany:!0,next:a}:{done:!1,hasNext:!0,next:a}};function $8(...e){return io(F4e,e)}const F4e=(e,r)=>{let n=Object.create(null);for(let o=0;oPs(r,...e)}function vO(...e){return M4e(U4e,e)}const U4e=(e,r)=>[...e].sort(r);var bO=Symbol.for("immer-nothing"),xO=Symbol.for("immer-draftable"),Io=Symbol.for("immer-state");function Wi(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wa=Object,Uh=wa.getPrototypeOf,Jb="constructor",ex="prototype",T8="configurable",tx="enumerable",rx="writable",g1="value",nd=e=>!!e&&!!e[Io];function Os(e){return e?kO(e)||ox(e)||!!e[xO]||!!e[Jb]?.[xO]||ax(e)||ix(e):!1}var W4e=wa[ex][Jb].toString(),wO=new WeakMap;function kO(e){if(!e||!A8(e))return!1;const r=Uh(e);if(r===null||r===wa[ex])return!0;const n=wa.hasOwnProperty.call(r,Jb)&&r[Jb];if(n===Object)return!0;if(!Wh(n))return!1;let o=wO.get(n);return o===void 0&&(o=Function.toString.call(n),wO.set(n,o)),o===W4e}function y1(e,r,n=!0){v1(e)===0?(n?Reflect.ownKeys(e):wa.keys(e)).forEach(a=>{r(a,e[a],e)}):e.forEach((o,a)=>r(a,o,e))}function v1(e){const r=e[Io];return r?r.type_:ox(e)?1:ax(e)?2:ix(e)?3:0}var _O=(e,r,n=v1(e))=>n===2?e.has(r):wa[ex].hasOwnProperty.call(e,r),j8=(e,r,n=v1(e))=>n===2?e.get(r):e[r],nx=(e,r,n,o=v1(e))=>{o===2?e.set(r,n):o===3?e.add(n):e[r]=n};function G4e(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}var ox=Array.isArray,ax=e=>e instanceof Map,ix=e=>e instanceof Set,A8=e=>typeof e=="object",Wh=e=>typeof e=="function",D8=e=>typeof e=="boolean",Ls=e=>e.copy_||e.base_,M8=e=>e.modified_?e.copy_:e.base_;function N8(e,r){if(ax(e))return new Map(e);if(ix(e))return new Set(e);if(ox(e))return Array[ex].slice.call(e);const n=kO(e);if(r===!0||r==="class_only"&&!n){const o=wa.getOwnPropertyDescriptors(e);delete o[Io];let a=Reflect.ownKeys(o);for(let i=0;i1&&wa.defineProperties(e,{set:lx,add:lx,clear:lx,delete:lx}),wa.freeze(e),r&&y1(e,(n,o)=>{P8(o,!0)},!1)),e}function Y4e(){Wi(2)}var lx={[g1]:Y4e};function sx(e){return e===null||!A8(e)?!0:wa.isFrozen(e)}var cx="MapSet",B8="Patches",SO={};function Gh(e){const r=SO[e];return r||Wi(0,e),r}var X4e=e=>!!SO[e],b1,EO=()=>b1,Z4e=(e,r)=>({drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:X4e(cx)?Gh(cx):void 0});function CO(e,r){r&&(e.patchPlugin_=Gh(B8),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function I8(e){O8(e),e.drafts_.forEach(K4e),e.drafts_=null}function O8(e){e===b1&&(b1=e.parent_)}var $O=e=>b1=Z4e(b1,e);function K4e(e){const r=e[Io];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function RO(e,r){r.unfinalizedDrafts_=r.drafts_.length;const n=r.drafts_[0];if(e!==void 0&&e!==n){n[Io].modified_&&(I8(r),Wi(4)),Os(e)&&(e=zO(r,e));const{patchPlugin_:a}=r;a&&a.generateReplacementPatches_(n[Io].base_,e,r)}else e=zO(r,n);return Q4e(r,e,!0),I8(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==bO?e:void 0}function zO(e,r){if(sx(r))return r;const n=r[Io];if(!n)return L8(r,e.handledSet_,e);if(!dx(n,e))return r;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);AO(n,e)}return n.copy_}function Q4e(e,r,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&P8(r,n)}function TO(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var dx=(e,r)=>e.scope_===r,J4e=[];function jO(e,r,n,o){const a=Ls(e),i=e.type_;if(o!==void 0&&j8(a,o,i)===r){nx(a,o,n,i);return}if(!e.draftLocations_){const s=e.draftLocations_=new Map;y1(a,(c,d)=>{if(nd(d)){const u=s.get(d)||[];u.push(c),s.set(d,u)}})}const l=e.draftLocations_.get(r)??J4e;for(const s of l)nx(a,s,n,i)}function eke(e,r,n){e.callbacks_.push(function(a){const i=r;if(!i||!dx(i,a))return;a.mapSetPlugin_?.fixSetContents(i);const l=M8(i);jO(e,i.draft_??i,l,n),AO(i,a)})}function AO(e,r){if(e.modified_&&!e.finalized_&&(e.type_===3||(e.assigned_?.size??0)>0)){const{patchPlugin_:o}=r;if(o){const a=o.getPath(e);a&&o.generatePatches_(e,a,r)}TO(e)}}function tke(e,r,n){const{scope_:o}=e;if(nd(n)){const a=n[Io];dx(a,o)&&a.callbacks_.push(function(){ux(e);const l=M8(a);jO(e,n,l,r)})}else Os(n)&&e.callbacks_.push(function(){const i=Ls(e);j8(i,r,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(r)??!1)===!0&&e.copy_&&L8(j8(e.copy_,r,e.type_),o.handledSet_,o)})}function L8(e,r,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||nd(e)||r.has(e)||!Os(e)||sx(e)||(r.add(e),y1(e,(o,a)=>{if(nd(a)){const i=a[Io];if(dx(i,n)){const l=M8(i);nx(e,o,l,e.type_),TO(i)}}else Os(a)&&L8(a,r,n)})),e}function rke(e,r){const n=ox(e),o={type_:n?1:0,scope_:r?r.scope_:EO(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=o,i=F8;n&&(a=[o],i=x1);const{revoke:l,proxy:s}=Proxy.revocable(a,i);return o.draft_=s,o.revoke_=l,[s,o]}var F8={get(e,r){if(r===Io)return e;const n=Ls(e);if(!_O(n,r,e.type_))return nke(e,n,r);const o=n[r];if(e.finalized_||!Os(o))return o;if(o===V8(e.base_,r)){ux(e);const a=e.type_===1?+r:r,i=H8(e.scope_,o,e,a);return e.copy_[a]=i}return o},has(e,r){return r in Ls(e)},ownKeys(e){return Reflect.ownKeys(Ls(e))},set(e,r,n){const o=DO(Ls(e),r);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const a=V8(Ls(e),r),i=a?.[Io];if(i&&i.base_===n)return e.copy_[r]=n,e.assigned_.set(r,!1),!0;if(G4e(n,a)&&(n!==void 0||_O(e.base_,r,e.type_)))return!0;ux(e),q8(e)}return e.copy_[r]===n&&(n!==void 0||r in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[r])||(e.copy_[r]=n,e.assigned_.set(r,!0),tke(e,r,n)),!0},deleteProperty(e,r){return ux(e),V8(e.base_,r)!==void 0||r in e.base_?(e.assigned_.set(r,!1),q8(e)):e.assigned_.delete(r),e.copy_&&delete e.copy_[r],!0},getOwnPropertyDescriptor(e,r){const n=Ls(e),o=Reflect.getOwnPropertyDescriptor(n,r);return o&&{[rx]:!0,[T8]:e.type_!==1||r!=="length",[tx]:o[tx],[g1]:n[r]}},defineProperty(){Wi(11)},getPrototypeOf(e){return Uh(e.base_)},setPrototypeOf(){Wi(12)}},x1={};y1(F8,(e,r)=>{x1[e]=function(){const n=arguments;return n[0]=n[0][0],r.apply(this,n)}}),x1.deleteProperty=function(e,r){return x1.set.call(this,e,r,void 0)},x1.set=function(e,r,n){return F8.set.call(this,e[0],r,n,e[0])};function V8(e,r){const n=e[Io];return(n?Ls(n):e)[r]}function nke(e,r,n){const o=DO(r,n);return o?g1 in o?o[g1]:o.get?.call(e.draft_):void 0}function DO(e,r){if(!(r in e))return;let n=Uh(e);for(;n;){const o=Object.getOwnPropertyDescriptor(n,r);if(o)return o;n=Uh(n)}}function q8(e){e.modified_||(e.modified_=!0,e.parent_&&q8(e.parent_))}function ux(e){e.copy_||(e.assigned_=new Map,e.copy_=N8(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var oke=class{constructor(r){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,o,a)=>{if(Wh(n)&&!Wh(o)){const l=o;o=n;const s=this;return function(d=l,...u){return s.produce(d,p=>o.call(this,p,...u))}}Wh(o)||Wi(6),a!==void 0&&!Wh(a)&&Wi(7);let i;if(Os(n)){const l=$O(this),s=H8(l,n,void 0);let c=!0;try{i=o(s),c=!1}finally{c?I8(l):O8(l)}return CO(l,a),RO(i,l)}else if(!n||!A8(n)){if(i=o(n),i===void 0&&(i=n),i===bO&&(i=void 0),this.autoFreeze_&&P8(i,!0),a){const l=[],s=[];Gh(B8).generateReplacementPatches_(n,i,{patches_:l,inversePatches_:s}),a(l,s)}return i}else Wi(1,n)},this.produceWithPatches=(n,o)=>{if(Wh(n))return(s,...c)=>this.produceWithPatches(s,d=>n(d,...c));let a,i;return[this.produce(n,o,(s,c)=>{a=s,i=c}),a,i]},D8(r?.autoFreeze)&&this.setAutoFreeze(r.autoFreeze),D8(r?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(r.useStrictShallowCopy),D8(r?.useStrictIteration)&&this.setUseStrictIteration(r.useStrictIteration)}createDraft(r){Os(r)||Wi(8),nd(r)&&(r=ake(r));const n=$O(this),o=H8(n,r,void 0);return o[Io].isManual_=!0,O8(n),o}finishDraft(r,n){const o=r&&r[Io];(!o||!o.isManual_)&&Wi(9);const{scope_:a}=o;return CO(a,n),RO(void 0,a)}setAutoFreeze(r){this.autoFreeze_=r}setUseStrictShallowCopy(r){this.useStrictShallowCopy_=r}setUseStrictIteration(r){this.useStrictIteration_=r}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(r,n){let o;for(o=n.length-1;o>=0;o--){const i=n[o];if(i.path.length===0&&i.op==="replace"){r=i.value;break}}o>-1&&(n=n.slice(o+1));const a=Gh(B8).applyPatches_;return nd(r)?a(r,n):this.produce(r,i=>a(i,n))}};function H8(e,r,n,o){const[a,i]=ax(r)?Gh(cx).proxyMap_(r,n):ix(r)?Gh(cx).proxySet_(r,n):rke(r,n);return(n?.scope_??EO()).drafts_.push(a),i.callbacks_=n?.callbacks_??[],i.key_=o,n&&o!==void 0?eke(n,i,o):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);const{patchPlugin_:d}=c;i.modified_&&d&&d.generatePatches_(i,[],c)}),a}function ake(e){return nd(e)||Wi(10,e),MO(e)}function MO(e){if(!Os(e)||sx(e))return e;const r=e[Io];let n,o=!0;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=N8(e,r.scope_.immer_.useStrictShallowCopy_),o=r.scope_.immer_.shouldUseStrictIteration()}else n=N8(e,!0);return y1(n,(a,i)=>{nx(n,a,MO(i))},o),r&&(r.finalized_=!1),n}var ike=new oke,Yh=ike.produce,NO=e=>e;function lke(e){return Ps(e,P4e(r=>!!r.notation),$8(Lu("notation")),R8(z8($8(Lu("shape")),R8(z8($8(Lu("color")),R8(z8(Zb(Lu("kind")),Kb())),f1(),Zb(([r,n])=>({kinds:n,color:r})))),f1(),gO(([r,n])=>n.map(({color:o,kinds:a})=>({shape:r,color:o,kinds:a}))))),f1(),gO(([r,n])=>n.map(({shape:o,color:a,kinds:i})=>({title:r,shape:o,color:a,kinds:i}))),vO(Lu("shape"),Lu("title"),[r=>r.kinds.length,"desc"]))}const wo=(e,r)=>e===r||Xn(e)&&Xn(r)?!1:!yb(e,r),px=5;function ske(e,r){e.color=r.color,e.kind=r.kind,e.navigateTo=r.navigateTo??null,e.links=r.links?[...r.links]:null,e.tags=[...r.tags],Xn(r.style.border)?delete e.style.border:e.style.border=r.style.border,V4e(r.style.opacity)?e.style.opacity=r.style.opacity:delete e.style.opacity,Xn(r.style.multiple)?delete e.style.multiple:e.style.multiple=r.style.multiple}function cke(e,r,n){if(wo(r.icon??"none",e.icon??"none")){const o=Ja(e.icon)&&e.icon!=="none";switch(!0){case(o&&Ja(r.icon)&&r.icon!=="none"):return e.icon=r.icon,!0;case(o&&(Xn(r.icon)||r.icon==="none")):return e.icon="none",!0;case(!o&&Ja(r.icon)&&r.icon!=="none"):return n?(e.icon=r.icon,!0):!1}}return!0}function U8(e,r){return e?"md"in r?(e.md=r.md,delete e.txt,e):("txt"in r&&(e.txt=r.txt,delete e.md),e):r}function dke(e,r,n){let o=!0;return wo(e.title,r.title)&&(n?e.title=r.title:o=!1),wo(e.description,r.description)&&(Xn(r.description)?delete e.description:n?e.description=U8(e.description,r.description):o=!1),wo(e.technology,r.technology)&&(Xn(r.technology)?delete e.technology:n?e.technology=r.technology:o=!1),o}function uke(e,r,n){return e.title=r.title,Xn(r.description)?delete e.description:e.description=U8(e.description,r.description),Xn(r.technology)?delete e.technology:e.technology=r.technology,!0}function PO(e,r){He(e.id===r.id,"applyManualLayout: view ids do not match"),He(e._stage==="layouted","applyManualLayout: expected layouted view"),He(r._stage==="layouted","applyManualLayout: expected layouted snapshot"),He(e._layout!=="manual","applyManualLayout: expected auto-layouted view");const n=new Set;e._type!==r._type&&n.add("type-changed");const o=new Map(e.nodes.map(u=>[u.id,u])),a=new Map(e.edges.map(u=>[u.id,u])),i=pke(r.nodes,o,n),l=hke(r.edges,a,n),s=lke(i),c=Object.assign({...r},{title:e.title??r.title,description:e.description??r.description,tags:e.tags?[...e.tags]:null,links:e.links?[...e.links]:null,[k8]:"manual",...s&&s.length>0?{notation:{nodes:s}}:{},nodes:i,edges:l});C4e(e)&&c._type==="dynamic"&&(c.variant=e.variant);const d=[...n];return Ll(d,1)?c.drifts=d:"drifts"in c&&delete c.drifts,c}function pke(e,r,n){const o=e.map(a=>{const i=r.get(a.id);return i&&r.delete(i.id),Yh(a,l=>{if(!i){l.drifts=["removed"],n.add("nodes-removed");return}ske(l,i);const s=new Set,c=a.children.length>0,d=i.children.length>0;(wo(l.modelRef,i.modelRef)||wo(l.deploymentRef,i.deploymentRef))&&s.add("modelRef-changed"),d&&!c&&s.add("became-compound"),!d&&c&&s.add("became-leaf"),wo(l.parent,i.parent)&&s.add("parent-changed");const u=l.width+px>=i.width&&l.height+px>=i.height;wo(l.shape,i.shape)&&(u?l.shape=i.shape:s.add("shape-changed")),cke(l,i,u&&d===c)||s.add("label-changed"),(c?uke:dke)(l,i,u)||s.add("label-changed"),wo(a.notation,i.notation)&&(l.notation=i.notation??null),c&&d&&D4e(new Set(a.children),new Set(i.children)).size>0&&s.add("children-changed");const f=[...s];Ll(f,1)?(n.add("nodes-drift"),l.drifts=f):delete l.drifts})});return r.size>0&&n.add("nodes-added"),o}function hke(e,r,n){const o=e.map(a=>{let i=r.get(a.id)??Ps(r.values(),Is(l=>l.source===a.source&&l.target===a.target),m1());return i&&r.delete(i.id),Yh(a,l=>{if(!i){l.drifts=["removed"],n.add("edges-removed");return}const s=new Set,c=a.id===i.id;switch(!0){case(c&&a.source==i.source&&a.target==i.target):{wo(l.dir??"forward",i.dir??"forward")&&s.add("direction-changed");break}case(c&&a.source==i.target&&a.target==i.source):{a.source!==a.target&&s.add("direction-changed");break}case c:{a.source!=i.source&&s.add("source-changed"),a.target!=i.target&&s.add("target-changed");break}default:{He(a.id!=i.id,"Unexpected case in edge drift detection, ids should not match"),He(a.source==i.source,"Unexpected case in edge drift detection, sources should match"),He(a.target==i.target,"Unexpected case in edge drift detection, targets should match"),wo(l.dir??"forward",i.dir??"forward")&&s.add("direction-changed");break}}l.color=i.color,l.line=i.line,l.navigateTo=i.navigateTo??null,l.tags=i.tags?[...i.tags]:null,wo(a.notes,i.notes)&&(Xn(a.notes)!==Xn(i.notes)&&s.add("notes-changed"),l.notes=i.notes??a.notes),i.astPath?l.astPath=i.astPath:delete l.astPath;const d=yO(a,["label","description","technology","labelBBox"]),u=yO(i,["label","description","technology","labelBBox"]);if(wo(d,u))switch(!0){case(i.labelBBox&&!a.labelBBox):{s.add("label-added");break}case(a.labelBBox&&!i.labelBBox):{s.add("label-removed");break}case(!!a.labelBBox&&!!i.labelBBox):{i.labelBBox.width*i.labelBBox.height>(a.labelBBox.width+px)*(a.labelBBox.height+px)&&(l.labelBBox.width=Math.round(i.labelBBox.width),l.labelBBox.height=Math.round(i.labelBBox.height)),wo(a.label,i.label)&&(Xn(i.label)!==Xn(a.label)&&s.add("label-changed"),l.label=i.label??a.label),wo(a.description,i.description)&&(Xn(i.description)!==Xn(a.description)&&s.add("label-changed"),i.description&&(l.description=U8(a.description,i.description))),wo(a.technology,i.technology)&&(Xn(i.technology)!==Xn(a.technology)&&s.add("label-changed"),l.technology=i.technology??a.technology??null);break}default:He(!a.labelBBox,"Unexpected case in edge labelBBox drift detection"),He(!i.labelBBox,"Unexpected case in next labelBBox drift detection");break}const p=[...s];Ll(p,1)?(n.add("edges-drift"),l.drifts=p):delete l.drifts})});return r.size>0&&n.add("edges-added"),o}function fke(e,r){const{drifts:n,...o}=PO(e,r);if(n){const a=new Set;n.includes("type-changed")&&a.add("type-changed");const i=new Map(o.nodes.map(u=>[u.id,u])),l=new Map(o.edges.map(u=>[u.id,u])),s=e.nodes.map(u=>{const p=i.get(u.id);return p&&i.delete(p.id),Yh(u,f=>{if(!p){a.add("nodes-added"),f.drifts=["added"];return}p.drifts?(a.add("nodes-drift"),f.drifts=[...p.drifts]):delete f.drifts})});i.size>0&&a.add("nodes-removed");const c=e.edges.map(u=>{const p=l.get(u.id)??Ps(l.values(),Is(f=>f.source===u.source&&f.target===u.target),m1());return p&&l.delete(p.id),Yh(u,f=>{if(!p){a.add("edges-added"),f.drifts=["added"];return}p.drifts?(a.add("edges-drift"),f.drifts=[...p.drifts]):delete f.drifts})});l.size>0&&a.add("edges-removed");const d=[...a];return Yh(e,u=>{Ll(d,1)?u.drifts=d:delete u.drifts,u.nodes=NO(s),u.edges=NO(c),u[k8]="auto"})}return Yh(e,a=>{delete a.drifts,a[k8]="auto"})}function Fs(e){return e.summary??e.description}function Xh(e){return e.description??e.summary}const w1="@group";function mke(e){return e.kind===w1}function BO(e,r){return He(typeof e=="string"&&e!=""),"@"+e+"."+r}function gke(e){return e.startsWith("@")}function yke(e){if(!e.startsWith("@"))return[null,e];const r=e.indexOf(".");if(r<2)throw new Error("Invalid global FQN");const n=e.slice(1,r),o=e.slice(r+1);return[n,o]}function k1(e){return e.startsWith("step-")}function IO(e){if(!k1(e))throw new Error(`Invalid step edge id: ${e}`);return parseFloat(e.slice(5))}function vke(...e){return io(bke,e)}function bke(e,r){let n={...e};for(let[o,a]of Object.entries(n))r(a,o,e)&&delete n[o];return n}var W8={},OO;function G8(){return OO||(OO=1,(function(e){var r=Math.pow(2,8)-1,n=Math.pow(2,16)-1,o=Math.pow(2,32)-1,a=Math.pow(2,7)-1,i=Math.pow(2,15)-1,l=Math.pow(2,31)-1;e.getPointerArray=function(c){var d=c-1;if(d<=r)return Uint8Array;if(d<=n)return Uint16Array;if(d<=o)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},e.getSignedPointerArray=function(c){var d=c-1;return d<=a?Int8Array:d<=i?Int16Array:d<=l?Int32Array:Float64Array},e.getNumberType=function(c){return c===(c|0)?Math.sign(c)===-1?c<=127&&c>=-128?Int8Array:c<=32767&&c>=-32768?Int16Array:Int32Array:c<=255?Uint8Array:c<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(c,d){var u=null,p=0,f,g,v,w,x;for(w=0,x=c.length;wp&&(p=f,u=g);return u},e.isTypedArray=function(c){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(c)},e.concat=function(){var c=0,d,u,p;for(d=0,p=arguments.length;d"u"))return this.splayOnTop(l),this.V[l]},a.prototype.peek=function(i){var l=this.items[i];if(!(typeof l>"u"))return this.V[l]},a.prototype.forEach=function(i,l){l=arguments.length>1?l:this;for(var s=0,c=this.size,d=this.head,u=this.K,p=this.V,f=this.forward;s=l)return{done:!0};var u=c[s];return i++,i=l)return{done:!0};var u=c[s];return i++,i=l)return{done:!0};var p=c[s],f=d[s];return i++,i"u"))return this.splayOnTop(l),this.V[l]},a.prototype.peek=function(i){var l=this.items.get(i);if(!(typeof l>"u"))return this.V[l]},a.prototype.splayOnTop=e.prototype.splayOnTop,a.prototype.forEach=e.prototype.forEach,a.prototype.keys=e.prototype.keys,a.prototype.values=e.prototype.values,a.prototype.entries=e.prototype.entries,typeof Symbol<"u"&&(a.prototype[Symbol.iterator]=a.prototype.entries),a.prototype.inspect=e.prototype.inspect,a.from=function(i,l,s,c){if(arguments.length<2){if(c=o.guessLength(i),typeof c!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(c=l,l=null,s=null);var d=new a(l,s,c);return r(i,function(u,p){d.set(p,u)}),d},X8=a,X8}var kke=wke();const HO=Qg(kke);function _1(e){return vke(e,r=>r===void 0)}const _ke=Symbol.for("text"),Ske=Symbol.for("html"),Vs="",UO=new HO(500),WO=new HO(500);class ur{static getOrCreateFromText(r){if(r.trim()===Vs)return ur.EMPTY;let n=WO.get(r);return n||(n=new ur({txt:r}),WO.set(r,n),n)}static getOrCreateFromMarkdown(r){if(r.trim()===Vs)return ur.EMPTY;let n=UO.get(r);return n||(n=new ur({md:r}),UO.set(r,n),n)}static memoize(r,n,o){return ir(r,n,()=>ur.from(o))}static from(r){return r==null||r===ur.EMPTY?ur.EMPTY:r instanceof ur?r:typeof r=="string"?this.getOrCreateFromText(r):"isEmpty"in r&&r.isEmpty?ur.EMPTY:"md"in r?this.getOrCreateFromMarkdown(r.md):this.getOrCreateFromText(r.txt)}static EMPTY=new class extends ur{isEmpty=!0;nonEmpty=!1;isMarkdown=!1;$source=null;constructor(){super({txt:Vs})}get text(){return null}get md(){return null}get html(){return null}};$source;isEmpty;nonEmpty;isMarkdown;constructor(r){this.isMarkdown=!1,typeof r=="string"?(this.$source={txt:r},this.isEmpty=r.trim()===Vs):(this.$source=r,this.isEmpty=!0,"md"in r?(this.isEmpty=r.md===Vs,this.isMarkdown=!0):this.isEmpty=r.txt===Vs),this.nonEmpty=!this.isEmpty}get text(){if(this.isEmpty||this.$source===null)return Vs;const r=this.$source;return"txt"in r?r.txt:ir(this,_ke,()=>c4e(r.md))}get md(){if(this.isEmpty||this.$source===null)return Vs;const r=this.$source;if("md"in r)return r.md;if("txt"in r)return r.txt;Qo(r)}get html(){if(this.isEmpty||this.$source===null)return Vs;const r=this.$source;return"txt"in r?r.txt:ir(this,Ske,()=>s4e(r.md))}equals(r){return this===r?!0:r instanceof ur?this.isEmpty&&r.isEmpty?!0:this.isEmpty!==r.isEmpty||this.isMarkdown!==r.isMarkdown?!1:this.isMarkdown?this.$source?.md===r.$source?.md:this.$source?.txt===r.$source?.txt:!1}}var S1;(e=>{function r(c){return"model"in c&&!("project"in c)}e.isElementRef=r;function n(c){return"project"in c&&"model"in c}e.isImportRef=n;function o(c){if(Qc(c))throw new Error(`Expected FqnRef, got: "${c}"`);if(n(c))return BO(c.project,c.model);if(r(c))return c.model;throw new Error("Expected FqnRef.ModelRef or FqnRef.ImportRef")}e.flatten=o;function a(c){return r(c)||n(c)}e.isModelRef=a;function i(c){return"deployment"in c&&"element"in c}e.isInsideInstanceRef=i;function l(c){return"deployment"in c&&!("element"in c)}e.isDeploymentElementRef=l;function s(c){return l(c)||i(c)}e.isDeploymentRef=s})(S1||(S1={}));var ko;(e=>{function r({x:u,y:p,width:f,height:g}){return{x:u+f/2,y:p+g/2}}e.center=r;function n({x:u,y:p,width:f,height:g}){return[{x:u,y:p},{x:u+f,y:p},{x:u+f,y:p+g},{x:u,y:p+g}]}e.toPoints=n;function o(u){const{x1:p,y1:f,x2:g,y2:v}=Z8.fromPoints(u);return{x:p,y:f,width:g-p,height:v-f}}e.fromPoints=o;function a(...u){if(He(Ll(u,1),"No boxes provided"),u.length===1)return u[0];let p=u[0].x,f=u[0].y,g=u[0].x+u[0].width,v=u[0].y+u[0].height;for(let w=1;w=p.x+p.width&&u.y+u.height>=p.y+p.height}e.includes=d})(ko||(ko={}));var Z8;(e=>{function r({x1:l,y1:s,x2:c,y2:d}){return{x:(l+c)/2,y:(s+d)/2}}e.center=r;function n(l){He(l.length>0,"At least one point is required");let s=1/0,c=1/0,d=-1/0,u=-1/0;for(const[p,f]of l)s=Math.min(s,p),c=Math.min(c,f),d=Math.max(d,p),u=Math.max(u,f);return{x1:s,y1:c,x2:d,y2:u}}e.fromPoints=n;function o(...l){He(l.length>0,"No boxes provided");let s=1/0,c=1/0,d=-1/0,u=-1/0;for(const p of l)s=Math.min(s,p.x1),c=Math.min(c,p.y1),d=Math.max(d,p.x2),u=Math.max(u,p.y2);return{x1:s,y1:c,x2:d,y2:u}}e.merge=o;function a(l){return{x:l.x1,y:l.y1,width:l.x2-l.x1,height:l.y2-l.y1}}e.toBBox=a;function i(l,s){return l===s?!0:l.x1<=s.x1&&l.y1<=s.y1&&l.x2>=s.x2&&l.y2>=s.y2}e.includes=i})(Z8||(Z8={}));class ka{constructor(r,n){this.x=r,this.y=n}static create(...r){return r.length===2?new ka(r[0],r[1]):new ka(r[0].x,r[0].y)}static add(r,n){return{x:r.x+n.x,y:r.y+n.y}}static subtract(r,n){return{x:r.x-n.x,y:r.y-n.y}}static multiply(r,n){return{x:r.x*n,y:r.y*n}}static divide(r,n){return{x:r.x/n,y:r.y/n}}static dot(r,n){return r.x*n.x+r.y*n.y}add(r){return new ka(this.x+r.x,this.y+r.y)}subtract(r){return new ka(this.x-r.x,this.y-r.y)}multiply(r){return new ka(this.x*r,this.y*r)}divide(r){return new ka(this.x/r,this.y/r)}dot(r){return this.x*r.x+this.y*r.y}cross(r){return this.x*r.y-this.y*r.x}length(){return this.x===0&&this.y===0?0:Math.sqrt(this.x**2+this.y**2)}normalize(){const r=this.length();return r===0?new ka(0,0):new ka(this.x/r,this.y/r)}round(){return new ka(Math.round(this.x),Math.round(this.y))}toObject(){return{x:this.x,y:this.y}}}function Qr(...e){return e.length===1&&e[0]instanceof ka?e[0]:e.length===2?new ka(e[0],e[1]):new ka(e[0].x,e[0].y)}function K8(e){return k1(e)&&e.includes(".")?e.slice(0,e.indexOf(".")+1):null}function GO(e){const r=typeof e=="string"?e:e.color;return r.startsWith("#")||r.startsWith("rgb")}function Q8(...e){return io(Eke,e)}function Eke(e,r){let n=[...e];return n.sort(r),n}const Cke=["tomato","grass","blue","ruby","orange","indigo","pink","teal","purple","amber","crimson","red","lime","yellow","violet"];function $ke(e,r,n){let o=e.get(r);return o||(o=n(r),e.set(r,o)),o}function Rke(e){let r=5381;const n=e.length;He(n>0,"stringHash: empty string");for(let o=0;o>>0).toString(36)}function E1(e,r){const n=r??e;He(Qb(n));function o(a){for(const i of a)if(n(i))return i}return r?o(e):o}function zke(e,r){const n=e;He(Qb(n));function*o(a){for(const i of a)yield n(i)}return o}function C1(e){return e?Array.from(e):r=>Array.from(r)}function Tke(e){return e?new Set(e):r=>new Set(r)}function YO(e,r){const n=r??e;He(Qb(n));function o(a){for(const i of a)if(n(i))return!0;return!1}return r?o(e):o}function jke(e,r){const n=e;He(n>=0,"Count must be a non-negative number");function*o(a){let i=0;for(const l of a){if(i>=n)break;yield l,i++}}return a=>o(a)}function Ake(e,r){let n=Math.ceil(e),o=Math.floor(r);if(o{setTimeout(()=>{n(Dke)},r??100)})}function hx(e){const r=Jc([...e]),n=new Set(r),o=new Map(r.map(l=>[l._literalId,l])),a=new Ln(()=>null),i=r.reduce((l,s,c,d)=>(l.set(s,d.slice(c+1).filter(tB(s)).map(u=>(n.delete(u),u)).reduce((u,p)=>(u.some(Yn(p))||(u.push(p),a.set(p,s)),u),[])),l),new Ln(()=>[]));return{sorted:r,byId:l=>mt(o.get(l),`Element not found by id: ${l}`),root:n,parent:l=>a.get(l),children:l=>i.get(l),flatten:()=>new Set([...n,...r.reduce((l,s)=>{const c=i.get(s);return c.length===0?(l.push(s),l):(c.length>1&&l.push(...c),l)},[])])}}const J8=(e,r)=>e.size>2&&r.size!==e.size?new Set(Jc([...hx(e).flatten(),...r])):e.size>1?new Set(Jc([...e])):e;function ZO(e,r,n){const o=c=>r.has(c);let a=new Set([e]);const i={incomers:new Set,subjects:new Set([e]),outgoers:new Set};let l=new Set(n.incoming.flatMap(c=>{if(i.subjects.add(c.target),i.incomers.add(c.source),a.add(c.target),c.target!==e){let p=c.target.parent;for(;p&&p!==e;)a.add(p),p=p.parent}let d=c.source;const u=[];for(;u.push(d),!(o(d)||!d.parent);)d=d.parent;return u})),s=new Set(n.outgoing.flatMap(c=>{if(i.subjects.add(c.source),i.outgoers.add(c.target),a.add(c.source),c.source!==e){let p=c.source.parent;for(;p&&p!==e;)a.add(p),p=p.parent}let d=c.target;const u=[];for(;u.push(d),!(o(d)||!d.parent);)d=d.parent;return u}));return{incomers:J8(l,i.incomers),incoming:new Set(n.incoming),subjects:J8(a,i.subjects),outgoing:new Set(n.outgoing),outgoers:J8(s,i.outgoers)}}function KO(e,r,n,o="global"){const a=n?r.findView(n):null;if(o==="view")return He(a,'Scope view id is required when scope is "view"'),Mke(e,a,r);const i=r.element(e),l=Tke(i.ascendingSiblings());return ZO(i,l,{incoming:[...i.incoming()],outgoing:[...i.outgoing()]})}function Mke(e,r,n){const o=n.element(e);let a={incoming:C1(Is(o.incoming(),s=>r.includesRelation(s.id))),outgoing:C1(Is(o.outgoing(),s=>r.includesRelation(s.id)))};const i=tB(o),l=new Set([...o.ascendingSiblings(),...Ps(r.elements(),zke(s=>s.element),Is(s=>s!==o&&i(s)))]);return ZO(o,l,a)}var QO;(e=>{e.isInside=r=>n=>Yn(r,n.source.id)&&Yn(r,n.target.id),e.isDirectedBetween=(r,n)=>o=>(o.source.id===r||Yn(r,o.source.id))&&(o.target.id===n||Yn(n,o.target.id)),e.isAnyBetween=(r,n)=>{const o=(0,e.isDirectedBetween)(r,n),a=(0,e.isDirectedBetween)(n,r);return i=>o(i)||a(i)},e.isIncoming=r=>n=>(n.target.id===r||Yn(r,n.target.id))&&!Yn(r,n.source.id),e.isOutgoing=r=>n=>(n.source.id===r||Yn(r,n.source.id))&&!Yn(r,n.target.id),e.isAnyInOut=r=>{const n=(0,e.isIncoming)(r),o=(0,e.isOutgoing)(r);return a=>n(a)||o(a)}})(QO||(QO={}));const Nke=Symbol.for("nodejs.util.inspect.custom");function $1(e){return e===""||e===void 0?!0:Array.isArray(e)?e.length===0:Object.keys(e).length===0}function e7(...e){return io(Pke,e)}function Pke(e,r){if(e===r||Object.is(e,r))return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;if(e instanceof Map&&r instanceof Map)return Bke(e,r);if(e instanceof Set&&r instanceof Set)return Ike(e,r);let n=Object.keys(e);if(n.length!==Object.keys(r).length)return!1;for(let o of n){if(!Object.hasOwn(r,o))return!1;let{[o]:a}=e,{[o]:i}=r;if(a!==i||!Object.is(a,i))return!1}return!0}function Bke(e,r){if(e.size!==r.size)return!1;for(let[n,o]of e){let a=r.get(n);if(o!==a||!Object.is(o,a))return!1}return!0}function Ike(e,r){if(e.size!==r.size)return!1;for(let n of e)if(!r.has(n))return!1;return!0}class JO{Aux;get style(){return ir(this,"style",()=>_1({shape:this.$model.$styles.defaults.shape,color:this.$model.$styles.defaults.color,border:this.$model.$styles.defaults.border,opacity:this.$model.$styles.defaults.opacity,size:this.$model.$styles.defaults.size,padding:this.$model.$styles.defaults.padding,textSize:this.$model.$styles.defaults.text,...this.$node.style}))}get name(){return Jg(this.id)}get shape(){return this.style.shape}get color(){return this.style.color}get icon(){return this.style.icon??null}get summary(){return ur.memoize(this,"summary",Fs(this.$node))}get description(){return ur.memoize(this,"description",Xh(this.$node))}get technology(){return this.$node.technology??null}get links(){return this.$node.links??[]}ancestors(){return this.$model.ancestors(this)}commonAncestor(r){const n=t1(this.id,r.id);return n?this.$model.node(n):null}siblings(){return this.$model.siblings(this)}isSibling(r){return this.parent===r.parent}*ascendingSiblings(){yield*this.siblings();for(const r of this.ancestors())yield*r.siblings()}*descendingSiblings(){for(const r of[...this.ancestors()].reverse())yield*r.siblings();yield*this.siblings()}incoming(r="all"){return this.$model.incoming(this,r)}outgoing(r="all"){return this.$model.outgoing(this,r)}*incomers(r="all"){const n=new Set;for(const o of this.incoming(r))n.has(o.source.id)||(n.add(o.source.id),yield o.source)}*outgoers(r="all"){const n=new Set;for(const o of this.outgoing(r))n.has(o.target.id)||(n.add(o.target.id),yield o.target)}*views(){for(const r of this.$model.views())r._type==="deployment"&&r.includesDeployment(this.id)&&(yield r)}isDeploymentNode(){return!1}isInstance(){return!1}get allOutgoing(){return ir(this,Symbol.for("allOutgoing"),()=>od.from(new Set(this.outgoingModelRelationships()),new Set(this.outgoing())))}get allIncoming(){return ir(this,Symbol.for("allIncoming"),()=>od.from(new Set(this.incomingModelRelationships()),new Set(this.incoming())))}hasMetadata(){return!!this.$node.metadata&&!$1(this.$node.metadata)}getMetadata(r){return r?this.$node.metadata?.[r]:this.$node.metadata??{}}isTagged(r){return this.tags.includes(r)}}class eL extends JO{constructor(r,n){super(),this.$model=r,this.$node=n,this.id=n.id,this._literalId=n.id,this.title=n.title,this.hierarchyLevel=Tb(n.id)}id;_literalId;title;hierarchyLevel;get parent(){return this.$model.parent(this)}get kind(){return this.$node.kind}get tags(){return ir(this,Symbol.for("tags"),()=>Kb([...this.$node.tags??[],...this.$model.$model.specification.deployments[this.kind]?.tags??[]]))}children(){return this.$model.children(this)}descendants(r="desc"){return this.$model.descendants(this,r)}isDeploymentNode(){return!0}*instances(){for(const r of this.descendants("desc"))r.isInstance()&&(yield r)}onlyOneInstance(){const r=this.children();if(r.size!==1)return null;const n=m1(r);return n?n.isInstance()?n:n.onlyOneInstance():null}_relationshipsFromInstances=null;relationshipsFromInstances(){if(this._relationshipsFromInstances)return this._relationshipsFromInstances;const{outgoing:r,incoming:n}=this._relationshipsFromInstances={outgoing:new Set,incoming:new Set};for(const o of this.instances()){for(const a of o.element.outgoing())r.add(a);for(const a of o.element.incoming())n.add(a)}return this._relationshipsFromInstances}outgoingModelRelationships(){return this.relationshipsFromInstances().outgoing.values()}incomingModelRelationships(){return this.relationshipsFromInstances().incoming.values()}internalModelRelationships(){const{outgoing:r,incoming:n}=this.relationshipsFromInstances();return Hh(n,r)}}class tL extends JO{constructor(r,n,o){super(),this.$model=r,this.$instance=n,this.element=o,this.id=n.id,this._literalId=n.id,this.title=n.title??o.title,this.hierarchyLevel=Tb(n.id)}id;_literalId;title;hierarchyLevel;get $node(){return this.$instance}get parent(){return mt(this.$model.parent(this),`Parent of ${this.id} not found`)}get style(){return ir(this,"style",()=>_1({shape:this.$model.$styles.defaults.shape,color:this.$model.$styles.defaults.color,border:this.$model.$styles.defaults.border,opacity:this.$model.$styles.defaults.opacity,size:this.$model.$styles.defaults.size,padding:this.$model.$styles.defaults.padding,textSize:this.$model.$styles.defaults.text,...this.element.$element.style,...this.$instance.style}))}get tags(){return ir(this,Symbol.for("tags"),()=>Kb([...this.$instance.tags??[],...this.element.tags]))}get kind(){return this.element.kind}get summary(){return ur.memoize(this,"summary",Fs(this.$instance)??Fs(this.element.$element))}get description(){return ur.memoize(this,"description",Xh(this.$instance)??Xh(this.element.$element))}get technology(){return this.$instance.technology??this.element.technology??null}get links(){return this.$instance.links??this.element.links}isInstance(){return!0}outgoingModelRelationships(){return this.element.outgoing()}incomingModelRelationships(){return this.element.incoming()}*views(){for(const r of this.$model.views())if(r._type==="deployment"){if(r.includesDeployment(this.id)){yield r;continue}r.includesDeployment(this.parent.id)&&this.parent.onlyOneInstance()&&(yield r)}}}class Oke{constructor(r,n){this.instance=r,this.element=n}get id(){return this.instance.id}get _literalId(){return this.instance.id}get style(){return ir(this,"style ",()=>({shape:this.element.shape,color:this.element.color,...this.element.$element.style}))}get shape(){return this.element.shape}get color(){return this.element.color}get title(){return this.element.title}get summary(){return this.element.summary}get description(){return this.element.description}get technology(){return this.element.technology}isDeploymentNode(){return!1}isInstance(){return!1}}class Lke{constructor(r,n){this.$model=r,this.$relationship=n,this.source=r.deploymentRef(n.source),this.target=r.deploymentRef(n.target);const o=t1(this.source.id,this.target.id);this.boundary=o?this.$model.node(o):null}boundary;source;target;get id(){return this.$relationship.id}get expression(){return`${this.source.id} -> ${this.target.id}`}get title(){return Ja(this.$relationship.title)?this.$relationship.title:null}get technology(){return this.$relationship.technology??null}get hasSummary(){return!!this.$relationship.summary&&!!this.$relationship.description&&!e7(this.$relationship.summary,this.$relationship.description)}get summary(){return ur.memoize(this,"summary",Fs(this.$relationship))}get description(){return ur.memoize(this,"description",Xh(this.$relationship))}get tags(){return this.$relationship.tags??[]}get kind(){return this.$relationship.kind??null}get navigateTo(){return this.$relationship.navigateTo?this.$model.$model.view(this.$relationship.navigateTo):null}get links(){return this.$relationship.links??[]}get color(){return this.$relationship.color??this.$model.$styles.defaults.relationship.color}get line(){return this.$relationship.line??this.$model.$styles.defaults.relationship.line}get head(){return this.$relationship.head??this.$model.$styles.defaults.relationship.arrow}get tail(){return this.$relationship.tail}*views(){for(const r of this.$model.views())r.includesRelation(this.id)&&(yield r)}isDeploymentRelation(){return!0}isModelRelation(){return!1}hasMetadata(){return!!this.$relationship.metadata&&!$1(this.$relationship.metadata)}getMetadata(r){return r?this.$relationship.metadata?.[r]:this.$relationship.metadata??{}}isTagged(r){return this.tags.includes(r)}}class od{constructor(r=new Set,n=new Set){this.model=r,this.deployment=n}static empty(){return new od}static from(r,n){return new od(new Set(r),new Set(n))}get isEmpty(){return this.model.size===0&&this.deployment.size===0}get nonEmpty(){return this.model.size>0||this.deployment.size>0}get size(){return this.model.size+this.deployment.size}intersect(r){return od.from(Hh(this.model,r.model),Hh(this.deployment,r.deployment))}difference(r){return od.from(E8(this.model,r.model),E8(this.deployment,r.deployment))}union(r){return od.from(S8(this.model,r.model),S8(this.deployment,r.deployment))}}function rL(e,r){return n=>e.source===n.source&&e.target===n.target}function t7(e,r,n="directed"){if(e===r)return[];if(eB(e,r))return[];const o=Hh(e.allOutgoing,r.allIncoming),a=o.size>0?new ei(e,r,o):null;if(n==="directed")return a?[a]:[];const i=Hh(e.allIncoming,r.allOutgoing),l=i.size>0?new ei(r,e,i):null;return a&&l?[a,l]:a?[a]:l?[l]:[]}function nL(e,r,n="both"){if(e.allIncoming.size===0&&e.allOutgoing.size===0)return[];const o=[],a=[];for(const i of r)if(e!==i)for(const l of t7(e,i,n))l.source===e?o.push(l):a.push(l);return[...o,...a]}function Fke(e){return[...e].reduce((r,n,o,a)=>(o===a.length-1||r.push(...nL(n,a.slice(o+1),"both")),r),[])}const Vke={__proto__:null,findConnection:t7,findConnectionsBetween:nL,findConnectionsWithin:Fke};class ei{constructor(r,n,o=new Set){this.source=r,this.target=n,this.relations=o,this.id=Rke(`model:${r.id}:${n.id}`)}id;_boundary;get boundary(){return this._boundary??=this.source.commonAncestor(this.target)}get expression(){return`${this.source.id} -> ${this.target.id}`}get isDirect(){return this.nonEmpty()&&!this.isImplicit}get isImplicit(){return this.nonEmpty()&&YO(this.relations,sO(rL(this)))}get directRelations(){return new Set(Is(this.relations,rL(this)))}nonEmpty(){return this.relations.size>0}mergeWith(r){return He(this.source.id===r.source.id,"Cannot merge connections with different sources"),He(this.target.id===r.target.id,"Cannot merge connections with different targets"),new ei(this.source,this.target,S8(this.relations,r.relations))}difference(r){return new ei(this.source,this.target,E8(this.relations,r.relations))}intersect(r){return He(r instanceof ei,"Cannot intersect connection with different type"),new ei(this.source,this.target,Hh(this.relations,r.relations))}equals(r){He(r instanceof ei,"Cannot merge connection with different type");const n=r;return this.id===n.id&&this.source.id===n.source.id&&this.target.id===n.target.id&&A4e(this.relations,n.relations)}update(r){return new ei(this.source,this.target,r)}[Nke](r,n,o){const a=this.toString();return Object.defineProperty(a,"constructor",{value:ei,enumerable:!1}),a}toString(){return[this.expression,this.relations.size?" relations:":" relations: [ ]",...[...this.relations].map(r=>" "+r.expression)].join(` -`)}reversed(r=!1){if(!r)return new ei(this.target,this.source);const[n]=t7(this.target,this.source,"directed");return n??new ei(this.target,this.source,new Set)}}function qke(e){if(e==null||e==="")return!0;if(typeof e!="object")return!1;if("length"in e&&typeof e.length=="number")return e.length===0;if("size"in e&&typeof e.size=="number")return e.size===0;for(let r in e)return!1;return Object.getOwnPropertySymbols(e).length===0}function Hke(...e){return io(Uke,e)}const Uke=e=>e.at(-1);function oL(e,r,n){return typeof r=="number"||r===void 0?o=>o.split(e,r):e.split(r,n)}function fx(...e){return io(Object.values,e)}class mx{constructor(r,n){this.$model=r,this.$element=n,this.id=this.$element.id,this._literalId=this.$element.id;const[o,a]=yke(this.id);o?(this.imported={from:o,fqn:a},this.hierarchyLevel=Tb(a)):(this.imported=null,this.hierarchyLevel=Tb(this.id))}Aux;id;_literalId;hierarchyLevel;imported;get name(){return Jg(this.id)}get parent(){return this.$model.parent(this)}get kind(){return this.$element.kind}get shape(){return this.style.shape}get color(){return this.style.color}get icon(){return this.style.icon??null}get tags(){return ir(this,Symbol.for("tags"),()=>Kb([...this.$element.tags??[],...this.$model.specification.elements[this.$element.kind]?.tags??[]]))}get title(){return this.$element.title}get hasSummary(){return!!this.$element.summary&&!!this.$element.description&&!e7(this.$element.summary,this.$element.description)}get summary(){return ur.memoize(this,"summary",Fs(this.$element))}get description(){return ur.memoize(this,"description",Xh(this.$element))}get technology(){return this.$element.technology??null}get links(){return this.$element.links??[]}get defaultView(){return ir(this,Symbol.for("defaultView"),()=>m1(this.scopedViews())??null)}get isRoot(){return this.parent===null}get style(){return ir(this,"style",()=>_1({shape:this.$model.$styles.defaults.shape,color:this.$model.$styles.defaults.color,border:this.$model.$styles.defaults.border,opacity:this.$model.$styles.defaults.opacity,size:this.$model.$styles.defaults.size,padding:this.$model.$styles.defaults.padding,textSize:this.$model.$styles.defaults.text,...this.$element.style}))}isAncestorOf(r){return Yn(this,r)}isDescendantOf(r){return Yn(r,this)}ancestors(){return this.$model.ancestors(this)}commonAncestor(r){const n=t1(this.id,r.id);return n?this.$model.element(n):null}children(){return this.$model.children(this)}descendants(r){return r?rB([...this.$model.descendants(this)],r)[Symbol.iterator]():this.$model.descendants(this)}siblings(){return this.$model.siblings(this)}*ascendingSiblings(){yield*this.siblings();for(const r of this.ancestors())yield*r.siblings()}*descendingSiblings(){for(const r of[...this.ancestors()].reverse())yield*r.siblings();yield*this.siblings()}incoming(r="all"){return this.$model.incoming(this,r)}*incomers(r="all"){const n=new Set;for(const o of this.incoming(r))n.has(o.source.id)||(n.add(o.source.id),yield o.source)}outgoing(r="all"){return this.$model.outgoing(this,r)}*outgoers(r="all"){const n=new Set;for(const o of this.outgoing(r))n.has(o.target.id)||(n.add(o.target.id),yield o.target)}get allOutgoing(){return ir(this,Symbol.for("allOutgoing"),()=>new Set(this.outgoing()))}get allIncoming(){return ir(this,Symbol.for("allIncoming"),()=>new Set(this.incoming()))}views(){return ir(this,Symbol.for("views"),()=>{const r=new Set;for(const n of this.$model.views())n.includesElement(this.id)&&r.add(n);return r})}scopedViews(){return ir(this,Symbol.for("scopedViews"),()=>{const r=new Set;for(const n of this.$model.views())n.isScopedElementView()&&n.viewOf.id===this.id&&r.add(n);return r})}isDeployed(){return Ja(m1(this.deployments()))}deployments(){return this.$model.deployment.instancesOf(this)}hasMetadata(){return!!this.$element.metadata&&!$1(this.$element.metadata)}getMetadata(r){return r?this.$element.metadata?.[r]:this.$element.metadata??{}}isTagged(r){return this.tags.includes(r)}}const yr=e=>typeof e=="string"?e:e.id,_a="/",r7=e=>{if(He(!e.includes(` -`),"View title cannot contain newlines"),e.includes(_a)){const r=e.split(_a).map(n=>n.trim()).filter(n=>n.length>0);return Ll(r,1)?r:[""]}return[e.trim()]},gx=e=>r7(e).join(_a),Wke=e=>{const r=r7(e);return Ll(r,2)?r.slice(0,-1).join(_a):null},n7=e=>e.includes(_a)?r7(e).pop()??e:e.trim();class Gke{constructor(r){this.$model=r;const n=this.$deployments=r.$data.deployments,o=fx(n.elements);for(const a of Jc(o)){const i=this.addElement(a);for(const l of i.tags)this.#c.get(l).add(i);i.isInstance()&&this.#r.get(i.element.id).add(i)}for(const a of fx(n.relations)){const i=this.addRelation(a);for(const l of i.tags)this.#c.get(l).add(i)}}#e=new Map;#i=new Map;#t=new Ln(()=>new Set);#r=new Ln(()=>new Set);#l=new Set;#n=new Map;#s=new Ln(()=>new Set);#a=new Ln(()=>new Set);#o=new Ln(()=>new Set);#c=new Ln(()=>new Set);#d=new Map;$deployments;get $styles(){return this.$model.$styles}element(r){if(r instanceof eL||r instanceof tL)return r;const n=yr(r);return mt(this.#e.get(n),`Element ${n} not found`)}findElement(r){return this.#e.get(r)??null}node(r){const n=this.element(r);return He(n.isDeploymentNode(),`Element ${n.id} is not a deployment node`),n}findNode(r){const n=this.findElement(r);return n?(He(n.isDeploymentNode(),`Element ${n?.id} is not a deployment node`),n):null}instance(r){const n=this.element(r);return He(n.isInstance(),`Element ${n.id} is not a deployed instance`),n}findInstance(r){const n=this.findElement(r);return n?(He(n.isInstance(),`Element ${n?.id} is not a deployed instance`),n):null}roots(){return this.#l.values()}elements(){return this.#e.values()}*nodes(){for(const r of this.#e.values())r.isDeploymentNode()&&(yield r)}*nodesOfKind(r){for(const n of this.#e.values())n.isDeploymentNode()&&n.kind===r&&(yield n)}*instances(){for(const r of this.#e.values())r.isInstance()&&(yield r)}*instancesOf(r){const n=yr(r),o=this.#r.get(n);o&&(yield*o)}deploymentRef(r){if(S1.isInsideInstanceRef(r)){const{deployment:n,element:o}=r;return $ke(this.#d,`${n}@${o}`,()=>new Oke(this.instance(n),this.$model.element(o)))}return this.element(r.deployment)}relationships(){return this.#n.values()}relationship(r){const n=yr(r);return mt(this.#n.get(n),`DeploymentRelationModel ${n} not found`)}findRelationship(r){return this.#n.get(r)??null}*views(){for(const r of this.$model.views())r.isDeploymentView()&&(yield r)}parent(r){const n=yr(r);return this.#i.get(n)||null}children(r){const n=yr(r);return this.#t.get(n)}*siblings(r){const n=yr(r),o=this.parent(r)?.children()??this.roots();for(const a of o)a.id!==n&&(yield a)}*ancestors(r){let n=yr(r),o;for(;o=this.#i.get(n);)yield o,n=o.id}*descendants(r,n="desc"){for(const o of this.children(r))n==="asc"?(yield o,yield*this.descendants(o.id)):(yield*this.descendants(o.id),yield o)}*incoming(r,n="all"){const o=yr(r);for(const a of this.#s.get(o))switch(!0){case n==="all":case(n==="direct"&&a.target.id===o):case(n==="to-descendants"&&a.target.id!==o):yield a;break}}*outgoing(r,n="all"){const o=yr(r);for(const a of this.#a.get(o))switch(!0){case n==="all":case(n==="direct"&&a.source.id===o):case(n==="from-descendants"&&a.source.id!==o):yield a;break}}addElement(r){if(this.#e.has(r.id))throw new Error(`Element ${r.id} already exists`);const n=v4e(r)?new eL(this,Object.freeze(r)):new tL(this,Object.freeze(r),this.$model.element(r.element));this.#e.set(n.id,n);const o=zb(n.id);return o?(He(this.#e.has(o),`Parent ${o} of ${n.id} not found`),this.#i.set(n.id,this.node(o)),this.#t.get(o).add(n)):(He(n.isDeploymentNode(),`Root element ${n.id} is not a deployment node`),this.#l.add(n)),n}addRelation(r){if(this.#n.has(r.id))throw new Error(`Relation ${r.id} already exists`);const n=new Lke(this,Object.freeze(r));this.#n.set(n.id,n),this.#s.get(n.target.id).add(n),this.#a.get(n.source.id).add(n);const o=n.boundary?.id??null;if(o)for(const a of[o,...Du(o)])this.#o.get(a).add(n);for(const a of Du(n.source.id)){if(a===o)break;this.#a.get(a).add(n)}for(const a of Du(n.target.id)){if(a===o)break;this.#s.get(a).add(n)}return n}}class aL{constructor(r,n){this.model=r,this.$relationship=n,this.source=r.element(S1.flatten(n.source)),this.target=r.element(S1.flatten(n.target));const o=t1(this.source.id,this.target.id);this.boundary=o?this.model.element(o):null}source;target;boundary;get id(){return this.$relationship.id}get expression(){return`${this.source.id} -> ${this.target.id}`}get title(){return Ja(this.$relationship.title)?this.$relationship.title:null}get technology(){return Ja(this.$relationship.technology)?this.$relationship.technology:null}get hasSummary(){return!!this.$relationship.summary&&!!this.$relationship.description&&!e7(this.$relationship.summary,this.$relationship.description)}get summary(){return ur.memoize(this,"summary",Fs(this.$relationship))}get description(){return ur.memoize(this,"description",Xh(this.$relationship))}get navigateTo(){return this.$relationship.navigateTo?this.model.view(this.$relationship.navigateTo):null}get tags(){return this.$relationship.tags??[]}get kind(){return this.$relationship.kind??null}get links(){return this.$relationship.links??[]}get color(){return this.$relationship.color??this.model.$styles.defaults.relationship.color}get line(){return this.$relationship.line??this.model.$styles.defaults.relationship.line}get head(){return this.$relationship.head??this.model.$styles.defaults.relationship.arrow}get tail(){return this.$relationship.tail}*views(){for(const r of this.model.views())r.includesRelation(this.id)&&(yield r)}isDeploymentRelation(){return!1}isModelRelation(){return!0}hasMetadata(){return!!this.$relationship.metadata&&!$1(this.$relationship.metadata)}getMetadata(r){return r?this.$relationship.metadata?.[r]:this.$relationship.metadata??{}}isTagged(r){return this.tags.includes(r)}}class Yke{constructor(r,n,o,a){this.source=o,this.target=a,this.$viewModel=r,this.$view=r.$view,this.$edge=n}Aux;$viewModel;$view;$edge;get id(){return this.$edge.id}get parent(){return this.$edge.parent?this.$viewModel.node(this.$edge.parent):null}get label(){return this.$edge.label??null}get description(){return ur.memoize(this,"description",this.$edge.description)}get technology(){return this.$edge.technology??null}hasParent(){return this.$edge.parent!==null}get tags(){return this.$edge.tags??[]}get stepNumber(){return this.isStep()?IO(this.id):null}get navigateTo(){return this.$edge.navigateTo?this.$viewModel.$model.view(this.$edge.navigateTo):null}get color(){return this.$edge.color}get line(){return this.$edge.line??this.$viewModel.$styles.defaults.relationship.line}get head(){return this.$edge.head??this.$viewModel.$styles.defaults.relationship.arrow}get tail(){return this.$edge.tail}isStep(){return k1(this.id)}*relationships(r){for(const n of this.$edge.relations)if(r){const o=this.$viewModel.$model.findRelationship(n,r);o&&(yield o)}else yield this.$viewModel.$model.relationship(n)}includesRelation(r){const n=typeof r=="string"?r:r.id;return this.$edge.relations.includes(n)}isTagged(r){return this.tags.includes(r)}}class Xke{Aux;$viewModel;$view;$node;constructor(r,n){this.$viewModel=r,this.$view=r.$view,this.$node=n}get id(){return this.$node.id}get title(){return this.$node.title}get kind(){return this.$node.kind}get description(){return ur.memoize(this,"description",this.$node.description)}get technology(){return this.$node.technology??null}get parent(){return this.$node.parent?this.$viewModel.node(this.$node.parent):null}get element(){const r=this.$node.modelRef;return r?this.$viewModel.$model.element(r):null}get deployment(){const r=this.$node.deploymentRef;return r?this.$viewModel.$model.deployment.element(r):null}get shape(){return this.$node.shape}get color(){return this.$node.color}get icon(){return this.$node.icon??null}get tags(){return this.$node.tags}get links(){return this.$node.links??[]}get navigateTo(){return this.$node.navigateTo?this.$viewModel.$model.view(this.$node.navigateTo):null}get style(){return this.$node.style}get x(){return"x"in this.$node?this.$node.x:void 0}get y(){return"y"in this.$node?this.$node.y:void 0}get width(){return"width"in this.$node?this.$node.width:void 0}get height(){return"height"in this.$node?this.$node.height:void 0}children(){return ir(this,"children",()=>new Set(this.$node.children.map(r=>this.$viewModel.node(r))))}*ancestors(){let r=this.parent;for(;r;)yield r,r=r.parent}*siblings(){const r=this.parent?.children()??this.$viewModel.roots();for(const n of r)n.id!==this.id&&(yield n)}*incoming(r="all"){for(const n of this.$node.inEdges){const o=this.$viewModel.edge(n);switch(!0){case r==="all":case(r==="direct"&&o.target.id===this.id):case(r==="to-descendants"&&o.target.id!==this.id):yield o;break}}}*incomers(r="all"){const n=new Set;for(const o of this.incoming(r))n.has(o.source.id)||(n.add(o.source.id),yield o.source)}*outgoing(r="all"){for(const n of this.$node.outEdges){const o=this.$viewModel.edge(n);switch(!0){case r==="all":case(r==="direct"&&o.source.id===this.id):case(r==="from-descendants"&&o.source.id!==this.id):yield o;break}}}*outgoers(r="all"){const n=new Set;for(const o of this.outgoing(r))n.has(o.target.id)||(n.add(o.target.id),yield o.target)}isLayouted(){return"width"in this.$node&&"height"in this.$node}hasChildren(){return this.$node.children.length>0}hasParent(){return this.$node.parent!==null}hasElement(){return Ja(this.$node.modelRef)}hasDeployment(){return Ja(this.$node.deploymentRef)}hasDeployedInstance(){return this.hasElement()&&this.hasDeployment()}isGroup(){return mke(this.$node)}isTagged(r){return this.tags.includes(r)}}class o7{Aux;#e;#i=new Set;#t=new Map;#r=new Map;#l=new Set;#n=new Set;#s=new Set;#a=new Ln(r=>new Set);#o;id;$model;title;folder;viewPath;constructor(r,n,o,a){this.$model=r,this.#e=o,this.id=o.id,this.folder=n,this.#o=a;for(const i of this.#e.nodes){const l=new Xke(this,Object.freeze(i));this.#t.set(i.id,l),i.parent||this.#i.add(l),i.deploymentRef&&this.#n.add(i.deploymentRef),i.modelRef&&this.#l.add(i.modelRef);for(const s of l.tags)this.#a.get(s).add(l)}for(const i of this.#e.edges){const l=new Yke(this,Object.freeze(i),this.node(i.source),this.node(i.target));for(const s of l.tags)this.#a.get(s).add(l);for(const s of i.relations)this.#s.add(s);this.#r.set(i.id,l)}this.title=o.title?n7(o.title):null,this.viewPath=o.title?gx(o.title):o.id}get $styles(){return this.$model.$styles}get _type(){return this.#e[h1]}get stage(){return this.#e[Iu]}get bounds(){if("bounds"in this.#e)return this.#e.bounds;if(this.#o)return this.#o.bounds;throw new Error("View is not layouted")}get titleOrId(){return this.title??this.viewOf?.title??this.id}get titleOrUntitled(){return this.title??"Untitled"}get breadcrumbs(){return ir(this,"breadcrumbs",()=>this.folder.isRoot?[this]:[...this.folder.breadcrumbs,this])}get description(){return ur.memoize(this,"description",this.#e.description)}get tags(){return this.#e.tags??[]}get links(){return this.#e.links??[]}get viewOf(){if(this.isElementView()){const r=this.#e.viewOf;return r?this.$model.element(r):null}return null}get mode(){return this.isDynamicView()?this.#e.variant??"diagram":null}get includedTags(){return[...this.#a.keys()]}get $view(){if(!this.isLayouted()||"drifts"in this.#e)return this.#e;const r=this.#o;return r?ir(this,"withDriftReasons",()=>fke(this.#e,r)):this.#e}get $layouted(){if(!this.isLayouted())throw new Error("View is not layouted");return this.$manual??this.#e}get hasManualLayout(){return this.#o!==void 0}get hasLayoutDrifts(){if(!this.isLayouted())return!1;const r=this.$manual;return!!r?.drifts&&r.drifts.length>0}get $manual(){if(!this.isLayouted())return null;const r=this.#o;return r?ir(this,"snapshotWithManualLayout",()=>PO(this.#e,r)):null}roots(){return this.#i.values()}*compounds(){for(const r of this.#t.values())r.hasChildren()&&(yield r)}node(r){const n=yr(r);return mt(this.#t.get(n),`Node ${n} not found in view ${this.#e.id}`)}findNode(r){return this.#t.get(yr(r))??null}findNodeWithElement(r){const n=yr(r);return this.#l.has(n)?E1(this.#t.values(),o=>o.hasElement()&&o.element.id===n)??null:null}nodes(){return this.#t.values()}edge(r){const n=yr(r);return mt(this.#r.get(n),`Edge ${n} not found in view ${this.#e.id}`)}findEdge(r){return this.#r.get(yr(r))??null}edges(){return this.#r.values()}*edgesWithRelation(r){for(const n of this.#r.values())n.includesRelation(r)&&(yield n)}*elements(){for(const r of this.#t.values())r.hasElement()&&(yield r)}isTagged(r){return this.tags.includes(r)}includesElement(r){return this.#l.has(yr(r))}includesDeployment(r){return this.#n.has(yr(r))}includesRelation(r){return this.#s.has(yr(r))}isComputed(){return this.#e[Iu]==="computed"}isLayouted(){return this.#e[Iu]==="layouted"}isDiagram(){return this.#e[Iu]==="layouted"}isElementView(){return this.#e[h1]==="element"}isScopedElementView(){return this.#e[h1]==="element"&&Ja(this.#e.viewOf)}isDeploymentView(){return this.#e[h1]==="deployment"}isDynamicView(){return this.#e[h1]==="dynamic"}}class yx{$model;path;title;isRoot;parentPath;defaultViewId;constructor(r,n,o){this.$model=r,this.path=n.join("/"),this.isRoot=this.path==="",this.title=Hke(n),this.isRoot?this.parentPath=void 0:this.parentPath=n.slice(0,-1).join("/"),this.defaultViewId=o}get defaultView(){return this.defaultViewId?this.$model.view(this.defaultViewId):null}get breadcrumbs(){return He(!this.isRoot,"Root view folder has no breadcrumbs"),ir(this,"breadcrumbs",()=>{const r=this.parent;return r?r.isRoot?[r,this]:[...r.breadcrumbs,this]:[this]})}get parent(){return He(!this.isRoot,"Root view folder has no parent"),qke(this.parentPath)?null:this.$model.viewFolder(this.parentPath)}get children(){return this.$model.viewFolderItems(this.path)}get folders(){return ir(this,"folders",()=>{const r=[];for(const n of this.children)n instanceof yx&&r.push(n);return r})}get views(){return ir(this,"views",()=>{const r=[];for(const n of this.children)n instanceof o7&&r.push(n);return r})}}class Fu{Aux;_elements=new Map;_parents=new Map;_children=new Ln(()=>new Set);_rootElements=new Set;_relations=new Map;_incoming=new Ln(()=>new Set);_outgoing=new Ln(()=>new Set);_internal=new Ln(()=>new Set);_views=new Map;_rootViewFolder;_viewFolders=new Map;_viewFolderItems=new Ln(()=>new Set);_allTags=new Ln(()=>new Set);static fromParsed(r){return new Fu(r)}static create(r){return new Fu(r)}static fromDump(r){const{_stage:n="layouted",projectId:o="unknown",project:a,globals:i,imports:l,deployments:s,views:c,relations:d,elements:u,specification:p}=r;return new Fu({[Iu]:n,projectId:o,project:a,globals:{predicates:i?.predicates??{},dynamicPredicates:i?.dynamicPredicates??{},styles:i?.styles??{}},imports:l??{},deployments:{elements:s?.elements??{},relations:s?.relations??{}},views:c??{},relations:d??{},elements:u??{},specification:p})}deployment;$data;constructor(r){this.$data=r;for(const[,n]of f1(r.elements)){const o=this.addElement(n);for(const a of o.tags)this._allTags.get(a).add(o)}for(const[n,o]of f1(r.imports??{}))for(const a of Jc(o)){const i=this.addImportedElement(n,a);for(const l of i.tags)this._allTags.get(l).add(i)}for(const n of fx(r.relations)){const o=this.addRelation(n);for(const a of o.tags)this._allTags.get(a).add(o)}if(this.deployment=new Gke(this),cO(r,"computed")||cO(r,"layouted")){const n=JP(_a),o=Ps(fx(r.views),Zb(i=>({view:i,path:gx(i.title??i.id),folderPath:i.title&&Wke(i.title)||""})),Q8((i,l)=>n(i.folderPath,l.folderPath))),a=i=>{let l=this._viewFolders.get(i);if(!l){const s=oL(i,_a);He(Ll(s,1),`View group path "${i}" must have at least one element`);let c;i===""?c=o.find(d=>d.view.id==="index"):c=o.find(d=>d.path===i),l=new yx(this,s,c?.view.id),this._viewFolders.set(i,l)}return l};this._rootViewFolder=a("");for(const{folderPath:i}of o)this._viewFolders.has(i)||oL(i,_a).reduce((l,s)=>{const c=l.join(_a),d=$1(c)?s:c+_a+s,u=a(d);return this._viewFolderItems.get(c).add(u),l.push(s),l},[]);for(const{view:i,folderPath:l}of o){const s=new o7(this,a(l),i,r.manualLayouts?.[i.id]);this._viewFolderItems.get(l).add(s),this._views.set(i.id,s);for(const c of s.tags)this._allTags.get(c).add(s)}}else this._rootViewFolder=new yx(this,[""],void 0),this._viewFolders.set(this._rootViewFolder.path,this._rootViewFolder)}get asParsed(){return this}get asComputed(){return this}get asLayouted(){return this}get $styles(){return ir(this,"styles",()=>XP.from(this.$data.project.styles,this.$data.specification.customColors?{theme:{colors:this.$data.specification.customColors}}:void 0))}isParsed(){return this.stage==="parsed"}isLayouted(){return this.stage==="layouted"}isComputed(){return this.stage==="computed"}get $model(){return this.$data}get stage(){return this.$data[Iu]}get projectId(){return this.$data.projectId??"default"}get project(){return this.$data.project??ir(this,Symbol.for("project"),()=>({id:this.projectId}))}get specification(){return this.$data.specification}get globals(){return ir(this,Symbol.for("globals"),()=>({predicates:{...this.$data.globals?.predicates},dynamicPredicates:{...this.$data.globals?.dynamicPredicates},styles:{...this.$data.globals?.styles}}))}element(r){if(r instanceof mx)return r;const n=yr(r);return mt(this._elements.get(n),`Element ${n} not found`)}findElement(r){return this._elements.get(yr(r))??null}roots(){return this._rootElements.values()}elements(){return this._elements.values()}relationships(){return this._relations.values()}relationship(r,n){if(n==="deployment")return this.deployment.relationship(r);const o=yr(r);let a=this._relations.get(o)??null;return a||n==="model"?mt(a,`Model relation ${o} not found`):mt(this.deployment.findRelationship(o),`No model/deployment relation ${o} not found`)}findRelationship(r,n){if(n==="deployment")return this.deployment.findRelationship(r);let o=this._relations.get(yr(r))??null;return o||n==="model"?o:this.deployment.findRelationship(r)}views(){return this._views.values()}view(r){const n=yr(r);return mt(this._views.get(n),`View ${n} not found`)}findView(r){return this._views.get(r)??null}findManualLayout(r){return"manualLayouts"in this.$data?this.$data.manualLayouts?.[r]??null:null}viewFolder(r){return mt(this._viewFolders.get(r),`View folder ${r} not found`)}get rootViewFolder(){return this._rootViewFolder}get hasViewFolders(){return this._viewFolders.size>1}viewFolderItems(r){return He(this._viewFolders.has(r),`View folder ${r} not found`),this._viewFolderItems.get(r)}parent(r){const n=yr(r);return this._parents.get(n)||null}children(r){const n=yr(r);return this._children.get(n)}*siblings(r){const n=yr(r),o=this._parents.get(n),a=o?this._children.get(o.id).values():this.roots();for(const i of a)i.id!==n&&(yield i)}*ancestors(r){let n=yr(r),o;for(;o=this._parents.get(n);)yield o,n=o.id}*descendants(r){for(const n of this.children(r))yield n,yield*this.descendants(n.id)}*incoming(r,n="all"){const o=yr(r);for(const a of this._incoming.get(o))switch(!0){case n==="all":case(n==="direct"&&a.target.id===o):case(n==="to-descendants"&&a.target.id!==o):yield a;break}}*outgoing(r,n="all"){const o=yr(r);for(const a of this._outgoing.get(o))switch(!0){case n==="all":case(n==="direct"&&a.source.id===o):case(n==="from-descendants"&&a.source.id!==o):yield a;break}}get tags(){return ir(this,"tags",()=>Q8([...this._allTags.keys()],Rb))}get tagsSortedByUsage(){return ir(this,"tagsSortedByUsage",()=>Ps([...this._allTags.entries()],Zb(([r,n])=>({tag:r,count:n.size,tagged:n})),Q8((r,n)=>Rb(r.tag,n.tag)),vO([Lu("count"),"desc"])))}findByTag(r,n){return Is(this._allTags.get(r),o=>n==="elements"?o instanceof mx:n==="views"?o instanceof o7:n==="relationships"?o instanceof aL:!0)}*elementsOfKind(r){for(const n of this._elements.values())n.kind===r&&(yield n)}*elementsWhere(r){const n=Ou(r);for(const o of this._elements.values())n(o)&&(yield o)}*relationshipsWhere(r){const n=Ou(r);for(const o of this._relations.values())n(o)&&(yield o)}addElement(r){if(this._elements.has(r.id))throw new Error(`Element ${r.id} already exists`);const n=new mx(this,Object.freeze(r));this._elements.set(n.id,n);const o=zb(n.id);return o?(He(this._elements.has(o),`Parent ${o} of ${n.id} not found`),this._parents.set(n.id,this.element(o)),this._children.get(o).add(n)):this._rootElements.add(n),n}addImportedElement(r,n){He(!gke(n.id),"Imported element already has global FQN");const o=BO(r,n.id);if(this._elements.has(o))throw new Error(`Element ${o} already exists`);const a=new mx(this,Object.freeze({...n,id:o}));this._elements.set(a.id,a);let i=zb(a.id);for(;i;){if(i.includes(".")&&this._elements.has(i))return this._parents.set(a.id,this.element(i)),this._children.get(i).add(a),a;i=zb(i)}return this._rootElements.add(a),a}addRelation(r){if(this._relations.has(r.id))throw new Error(`Relation ${r.id} already exists`);const n=new aL(this,Object.freeze(r)),{source:o,target:a}=n;this._relations.set(n.id,n),this._incoming.get(a.id).add(n),this._outgoing.get(o.id).add(n);const i=t1(o.id,a.id);if(i)for(const l of[i,...Du(i)])this._internal.get(l).add(n);for(const l of Du(o.id)){if(l===i)break;this._outgoing.get(l).add(n)}for(const l of Du(a.id)){if(l===i)break;this._incoming.get(l).add(n)}return n}}(e=>{e.EMPTY=e.create({_stage:"computed",projectId:"default",project:{id:"default"},specification:{elements:{},relationships:{},deployments:{},tags:{}},globals:{predicates:{},dynamicPredicates:{},styles:{}},deployments:{elements:{},relations:{}},elements:{},relations:{},views:{},imports:{}})})(Fu||(Fu={}));function vx(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}var Zke=e=>typeof e=="object"&&e!==null;function Vu(e){return Object.fromEntries(Object.entries(e??{}).filter(([r,n])=>n!==void 0))}var Kke=e=>e==="base";function Qke(e){return e.slice().filter(r=>!Kke(r))}function iL(e){return String.fromCharCode(e+(e>25?39:97))}function Jke(e){let r="",n;for(n=Math.abs(e);n>52;n=n/52|0)r=iL(n%52)+r;return iL(n%52)+r}function e5e(e,r){let n=r.length;for(;n;)e=e*33^r.charCodeAt(--n);return e}function t5e(e){return Jke(e5e(5381,e)>>>0)}var lL=/\s*!(important)?/i;function r5e(e){return typeof e=="string"?lL.test(e):!1}function n5e(e){return typeof e=="string"?e.replace(lL,"").trim():e}function a7(e){return typeof e=="string"?e.replaceAll(" ","_"):e}var Zn=e=>{const r=new Map;return(...n)=>{const o=JSON.stringify(n);if(r.has(o))return r.get(o);const a=e(...n);return r.set(o,a),a}},o5e=new Set(["__proto__","constructor","prototype"]);function i7(...e){return e.reduce((r,n)=>(n&&Object.keys(n).forEach(o=>{if(o5e.has(o))return;const a=r[o],i=n[o];vx(a)&&vx(i)?r[o]=i7(a,i):r[o]=i}),r),{})}var a5e=e=>e!=null;function l7(e,r,n={}){const{stop:o,getKey:a}=n;function i(l,s=[]){if(Zke(l)){const c={};for(const[d,u]of Object.entries(l)){const p=a?.(d,u)??d,f=[...s,p];if(o?.(l,f))return r(l,s);const g=i(u,f);a5e(g)&&(c[p]=g)}return c}return r(l,s)}return i(e)}function i5e(e,r){return Array.isArray(e)?e.map(n=>r(n)):vx(e)?l7(e,n=>r(n)):r(e)}function l5e(e,r){return e.reduce((n,o,a)=>{const i=r[a];return o!=null&&(n[i]=o),n},{})}function sL(e,r,n=!0){const{utility:o,conditions:a}=r,{hasShorthand:i,resolveShorthand:l}=o;return l7(e,s=>Array.isArray(s)?l5e(s,a.breakpoints.keys):s,{stop:s=>Array.isArray(s),getKey:n?s=>i?l(s):s:void 0})}var s5e={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},c5e=e=>typeof e=="string"?e.replaceAll(/[\n\s]+/g," "):e;function cL(e){const{utility:r,hash:n,conditions:o=s5e}=e,a=l=>[r.prefix,l].filter(Boolean).join("-"),i=(l,s)=>{let c;if(n){const d=[...o.finalize(l),s];c=a(r.toHash(d,t5e))}else c=[...o.finalize(l),a(s)].join(":");return c};return Zn(({base:l,...s}={})=>{const c=Object.assign(s,l),d=sL(c,e),u=new Set;return l7(d,(p,f)=>{if(p==null)return;const g=r5e(p),[v,...w]=o.shift(f),x=Qke(w),k=r.transform(v,n5e(c5e(p)));let C=i(x,k.className);g&&(C=`${C}!`),u.add(C)}),Array.from(u).join(" ")})}function d5e(...e){return e.flat().filter(r=>vx(r)&&Object.keys(Vu(r)).length>0)}function u5e(e){function r(a){const i=d5e(...a);return i.length===1?i:i.map(l=>sL(l,e))}function n(...a){return i7(...r(a))}function o(...a){return Object.assign({},...r(a))}return{mergeCss:Zn(n),assignCss:o}}var p5e=/([A-Z])/g,h5e=/^ms-/,f5e=Zn(e=>e.startsWith("--")?e:e.replace(p5e,"-$1").replace(h5e,"-ms-").toLowerCase()),m5e=["min","max","clamp","calc"],g5e=new RegExp(`^(${m5e.join("|")})\\(.*\\)`),y5e=e=>typeof e=="string"&&g5e.test(e),v5e="cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%",b5e=`(?:${v5e.split(",").join("|")})`,x5e=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${b5e}$`),w5e=e=>typeof e=="string"&&x5e.test(e),k5e=e=>typeof e=="string"&&/^var\(--.+\)$/.test(e),R1={map:i5e,isCssFunction:y5e,isCssVar:k5e,isCssUnit:w5e},z1=(e,r)=>{if(!e?.defaultValues)return r;const n=typeof e.defaultValues=="function"?e.defaultValues(r):e.defaultValues;return Object.assign({},n,Vu(r))},_5e=(e={})=>{const r=o=>({className:[e.className,o].filter(Boolean).join("__"),base:e.base?.[o]??{},variants:{},defaultVariants:e.defaultVariants??{},compoundVariants:e.compoundVariants?s7(e.compoundVariants,o):[]}),n=(e.slots??[]).map(o=>[o,r(o)]);for(const[o,a]of Object.entries(e.variants??{}))for(const[i,l]of Object.entries(a))n.forEach(([s,c])=>{c.variants[o]??={},c.variants[o][i]=l[s]??{}});return Object.fromEntries(n)},s7=(e,r)=>e.filter(n=>n.css[r]).map(n=>({...n,css:n.css[r]}));function Fn(e,...r){const n=Object.getOwnPropertyDescriptors(e),o=Object.keys(n),a=l=>{const s={};for(let c=0;ca(Array.isArray(l)?l:o.filter(l));return r.map(i).concat(a(o))}var c7=(...e)=>{const r=e.reduce((n,o)=>(o&&o.forEach(a=>n.add(a)),n),new Set([]));return Array.from(r)},dL=["htmlSize","htmlTranslate","htmlWidth","htmlHeight"];function S5e(e){return dL.includes(e)?e.replace("html","").toLowerCase():e}function d7(e){return Object.fromEntries(Object.entries(e).map(([r,n])=>[S5e(r),n]))}d7.keys=dL;const E5e="_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_shapeSizeXs,_shapeSizeSm,_shapeSizeMd,_shapeSizeLg,_shapeSizeXl,_shapeRectangle,_shapePerson,_shapeBrowser,_shapeMobile,_shapeCylinder,_shapeStorage,_shapeQueue,_notDisabled,_reduceGraphics,_reduceGraphicsOnPan,_noReduceGraphics,_whenPanning,_smallZoom,_compoundTransparent,_edgeActive,_whenHovered,_whenSelectable,_whenSelected,_whenDimmed,_whenFocused,_p3,_srgb,_rec2020,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,xsToSm,xsToMd,xsToLg,xsToXl,smToMd,smToLg,smToXl,mdToLg,mdToXl,lgToXl,@/xs,@/sm,@/md,@/lg,@likec4-root/xs,@likec4-root/sm,@likec4-root/md,@likec4-root/lg,@likec4-dialog/xs,@likec4-dialog/sm,@likec4-dialog/md,@likec4-dialog/lg,base",uL=new Set(E5e.split(",")),C5e=/^@|&|&$/;function pL(e){return uL.has(e)||C5e.test(e)}const $5e=/^_/,R5e=/&|@/;function hL(e){return e.map(r=>uL.has(r)?r.replace($5e,""):R5e.test(r)?`[${a7(r.trim())}]`:r)}function fL(e){return e.sort((r,n)=>{const o=pL(r),a=pL(n);return o&&!a?1:!o&&a?-1:0})}const z5e="aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,focusRing:focus-ring,focusVisibleRing:focus-v-ring,focusRingColor:focus-ring-c,focusRingOffset:focus-ring-o,focusRingWidth:focus-ring-w,focusRingStyle:focus-ring-s,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,WebkitTextFillColor:wktf-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,backgroundLinear:bg-linear/bgLinear,backgroundRadial:bg-radial/bgRadial,backgroundConic:bg-conic/bgConic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:transition,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor,textStyle:textStyle,layerStyle:layerStyle,animationStyle:animationStyle",mL=new Map,gL=new Map;z5e.split(",").forEach(e=>{const[r,n]=e.split(":"),[o,...a]=n.split("/");mL.set(r,o),a.length&&a.forEach(i=>{gL.set(i==="1"?o:i,r)})});const yL=e=>gL.get(e)||e,vL={conditions:{shift:fL,finalize:hL,breakpoints:{keys:["base","xs","sm","md","lg","xl"]}},utility:{transform:(e,r)=>{const n=yL(e);return{className:`${mL.get(n)||f5e(n)}_${a7(r)}`}},hasShorthand:!0,toHash:(e,r)=>r(e.join(":")),resolveShorthand:yL}},T5e=cL(vL),fe=(...e)=>T5e(qu(...e));fe.raw=(...e)=>qu(...e);const{mergeCss:qu}=u5e(vL);function Ge(){let e="",r=0,n;for(;r({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function T1(e){const{base:r,variants:n,defaultVariants:o,compoundVariants:a}=bL(e),i=f=>({...o,...Vu(f)});function l(f={}){const g=i(f);let v={...r};for(const[x,k]of Object.entries(g))n[x]?.[k]&&(v=qu(v,n[x][k]));const w=u7(a,g);return qu(v,w)}function s(f){const g=bL(f.config),v=c7(f.variantKeys,Object.keys(n));return T1({base:qu(r,g.base),variants:Object.fromEntries(v.map(w=>[w,qu(n[w],g.variants[w])])),defaultVariants:i7(o,g.defaultVariants),compoundVariants:[...a,...g.compoundVariants]})}function c(f){return fe(l(f))}const d=Object.keys(n);function u(f){return Fn(f,d)}const p=Object.fromEntries(Object.entries(n).map(([f,g])=>[f,Object.keys(g)]));return Object.assign(Zn(c),{__cva__:!0,variantMap:p,variantKeys:d,raw:l,config:e,merge:s,splitVariantProps:u,getVariantProps:i})}function u7(e,r){let n={};return e.forEach(o=>{Object.entries(o).every(([a,i])=>a==="css"?!0:(Array.isArray(i)?i:[i]).some(l=>r[a]===l))&&(n=qu(n,o.css))}),n}function j5e(e,r,n,o){if(r.length>0&&typeof n?.[o]=="object")throw new Error(`[recipe:${e}:${o}] Conditions are not supported when using compound variants.`)}function A5e(e){const r=Object.entries(_5e(e)).map(([p,f])=>[p,T1(f)]),n=e.defaultVariants??{},o=r.reduce((p,[f,g])=>(e.className&&(p[f]=g.config.className),p),{});function a(p){const f=r.map(([g,v])=>[g,Ge(v(p),o[g])]);return Object.fromEntries(f)}function i(p){const f=r.map(([g,v])=>[g,v.raw(p)]);return Object.fromEntries(f)}const l=e.variants??{},s=Object.keys(l);function c(p){return Fn(p,s)}const d=p=>({...n,...Vu(p)}),u=Object.fromEntries(Object.entries(l).map(([p,f])=>[p,Object.keys(f)]));return Object.assign(Zn(a),{__cva__:!1,raw:i,config:e,variantMap:u,variantKeys:s,classNameMap:o,splitVariantProps:c,getVariantProps:d})}var D5e={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const wt=(e,r,n,o)=>{const a=S.forwardRef(({color:i="currentColor",size:l=24,stroke:s=2,title:c,className:d,children:u,...p},f)=>S.createElement("svg",{ref:f,...D5e[e],width:l,height:l,className:["tabler-icon",`tabler-icon-${r}`,d].join(" "),...e==="filled"?{fill:i}:{strokeWidth:s,stroke:i},...p},[c&&S.createElement("title",{key:"svg-title"},c),...o.map(([g,v])=>S.createElement(g,v)),...Array.isArray(u)?u:[u]]));return a.displayName=`${n}`,a},M5e=[["path",{d:"M12 6m-7 0a7 3 0 1 0 14 0a7 3 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M5 6v12c0 1.657 3.134 3 7 3s7 -1.343 7 -3v-12",key:"svg-1"}]],xL=wt("outline","cylinder","Cylinder",M5e),N5e=[["path",{d:"M21 14.008v-5.018a1.98 1.98 0 0 0 -1 -1.717l-4 -2.008a2.016 2.016 0 0 0 -2 0l-10 5.008c-.619 .355 -1 1.01 -1 1.718v5.018c0 .709 .381 1.363 1 1.717l4 2.008a2.016 2.016 0 0 0 2 0l10 -5.008c.619 -.355 1 -1.01 1 -1.718z",key:"svg-0"}],["path",{d:"M9 21v-7.5",key:"svg-1"}],["path",{d:"M9 13.5l11.5 -5.5",key:"svg-2"}],["path",{d:"M3.5 11l5.5 2.5",key:"svg-3"}]],P5e=wt("outline","rectangular-prism","RectangularPrism",N5e),B5e=[["path",{d:"M3 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M17 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-2"}],["path",{d:"M5 11v-3a3 3 0 0 1 3 -3h8a3 3 0 0 1 3 3v3",key:"svg-3"}],["path",{d:"M16.5 8.5l2.5 2.5l2.5 -2.5",key:"svg-4"}]],I5e=wt("outline","reorder","Reorder",B5e),O5e=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]],L5e=wt("outline","user","User",O5e),F5e=[["path",{d:"M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14z",key:"svg-0"}],["path",{d:"M11 4h2",key:"svg-1"}],["path",{d:"M12 17v.01",key:"svg-2"}]],V5e=wt("outline","device-mobile","DeviceMobile",F5e),q5e=[["path",{d:"M4 8h16",key:"svg-0"}],["path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M8 4v4",key:"svg-2"}]],H5e=wt("outline","browser","Browser",q5e),p7=S.createContext(null);function U5e({value:e,children:r}){return S.useContext(p7)?y.jsx(y.Fragment,{children:r}):y.jsx(p7.Provider,{value:e,children:r})}function bx({element:e,className:r,style:n}){const o=S.useContext(p7);if(!e||!e.icon||e.icon==="none")return null;let a;return e.icon.startsWith("http://")||e.icon.startsWith("https://")?a=y.jsx("img",{src:e.icon,alt:e.title}):o&&(a=y.jsx(o,{node:e})),a?y.jsx("div",{className:Ge(r,"likec4-element-icon"),"data-likec4-icon":e.icon,style:n,children:a}):null}const W5e={browser:H5e,cylinder:xL,mobile:V5e,person:L5e,queue:I5e,rectangle:P5e,storage:xL};function G5e({element:e,className:r}){const n=y.jsx(bx,{element:e,className:r});if(n)return n;const o=W5e[e.shape];return y.jsx("div",{className:Ge(r,"likec4-shape-icon"),children:y.jsx(o,{})})}function Kh(e){const r=S.useRef(e);return r.current=e,S.useMemo(()=>Object.freeze({get current(){return r.current}}),[])}function wL(e){const r=Kh(e);S.useEffect(()=>()=>{r.current()},[])}function h7(e,r,n,o=0){const a=S.useRef(void 0),i=S.useRef(void 0),l=S.useRef(e),s=S.useRef(void 0),c=()=>{a.current&&(clearTimeout(a.current),a.current=void 0),i.current&&(clearTimeout(i.current),i.current=void 0)};return wL(c),S.useEffect(()=>{l.current=e},r),S.useMemo(()=>{const d=()=>{if(c(),!s.current)return;const p=s.current;s.current=void 0,l.current.apply(p.this,p.args)},u=function(...p){a.current&&clearTimeout(a.current),s.current={args:p,this:this},a.current=setTimeout(d,n),o>0&&!i.current&&(i.current=setTimeout(d,o))};return Object.defineProperties(u,{length:{value:e.length},name:{value:`${e.name||"anonymous"}__debounced__${n}`}}),u},[n,o,...r])}const Y5e=()=>{},xx=typeof globalThis<"u"&&typeof navigator<"u"&&typeof document<"u";function X5e(e){const r=Kh(e),n=S.useRef(0),o=S.useCallback(()=>{xx&&n.current&&(cancelAnimationFrame(n.current),n.current=0)},[]);return wL(o),[S.useMemo(()=>{const a=(...i)=>{xx&&(o(),n.current=requestAnimationFrame(()=>{r.current(...i),n.current=0}))};return Object.defineProperties(a,{length:{value:e.length},name:{value:`${e.name||"anonymous"}__raf`}}),a},[]),o]}const Z5e=(e,r)=>{if(e===r)return!0;if(e.length!==r.length)return!1;for(const[n,o]of e.entries())if(o!==r[n])return!1;return!0};function K5e(e,r,n=Z5e,o=S.useEffect,...a){const i=S.useRef(void 0);(i.current===void 0||xx&&!n(i.current,r))&&(i.current=r),o(e,i.current,...a)}function kL(){const e=S.useRef(!0);return S.useEffect(()=>{e.current=!1},[]),e.current}const f7=xx?S.useLayoutEffect:S.useEffect;function Q5e(e){S.useEffect(()=>{e()},[])}function _L(e,r){const[n,o]=X5e(e);S.useEffect(()=>(n(),o),r)}const J5e=e=>(e+1)%Number.MAX_SAFE_INTEGER;function e6e(){const[,e]=S.useState(0);return S.useCallback(()=>{e(J5e)},[])}function t6e(e,r){const n=kL();S.useEffect(n?Y5e:e,r)}const r6e=e=>{e&&clearTimeout(e)};function wx(e,r){const n=Kh(e),o=Kh(r),a=S.useRef(null),i=S.useCallback(()=>{r6e(a.current)},[]),l=S.useCallback(()=>{o.current!==void 0&&(i(),a.current=setTimeout(()=>{n.current()},o.current))},[]);return S.useEffect(()=>(l(),i),[r]),[i,l]}const SL=(e,r,n)=>{const o=S.useRef(void 0);return(o.current===void 0||!n(o.current,r))&&(o.current=r),S.useMemo(e,o.current)};function dn(e){if(typeof e=="string"||typeof e=="number")return""+e;let r="";if(Array.isArray(e))for(let n=0,o;n{}};function kx(){for(var e=0,r=arguments.length,n={},o;e=0&&(o=n.slice(a+1),n=n.slice(0,a)),n&&!r.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}_x.prototype=kx.prototype={constructor:_x,on:function(e,r){var n=this._,o=o6e(e+"",n),a,i=-1,l=o.length;if(arguments.length<2){for(;++i0)for(var n=new Array(a),o=0,a,i;o=0&&(r=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),CL.hasOwnProperty(r)?{space:CL[r],local:e}:e}function i6e(e){return function(){var r=this.ownerDocument,n=this.namespaceURI;return n===m7&&r.documentElement.namespaceURI===m7?r.createElement(e):r.createElementNS(n,e)}}function l6e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function $L(e){var r=Sx(e);return(r.local?l6e:i6e)(r)}function s6e(){}function g7(e){return e==null?s6e:function(){return this.querySelector(e)}}function c6e(e){typeof e!="function"&&(e=g7(e));for(var r=this._groups,n=r.length,o=new Array(n),a=0;a=_&&(_=C+1);!(R=x[_])&&++_=0;)(l=o[a])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function M6e(e){e||(e=N6e);function r(p,f){return p&&f?e(p.__data__,f.__data__):!p-!f}for(var n=this._groups,o=n.length,a=new Array(o),i=0;ir?1:e>=r?0:NaN}function P6e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function B6e(){return Array.from(this)}function I6e(){for(var e=this._groups,r=0,n=e.length;r1?this.each((r==null?X6e:typeof r=="function"?K6e:Z6e)(e,r,n??"")):Qh(this.node(),e)}function Qh(e,r){return e.style.getPropertyValue(r)||AL(e).getComputedStyle(e,null).getPropertyValue(r)}function J6e(e){return function(){delete this[e]}}function e_e(e,r){return function(){this[e]=r}}function t_e(e,r){return function(){var n=r.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function r_e(e,r){return arguments.length>1?this.each((r==null?J6e:typeof r=="function"?t_e:e_e)(e,r)):this.node()[e]}function DL(e){return e.trim().split(/^|\s+/)}function y7(e){return e.classList||new ML(e)}function ML(e){this._node=e,this._names=DL(e.getAttribute("class")||"")}ML.prototype={add:function(e){var r=this._names.indexOf(e);r<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var r=this._names.indexOf(e);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function NL(e,r){for(var n=y7(e),o=-1,a=r.length;++o=0&&(n=r.slice(o+1),r=r.slice(0,o)),{type:r,name:n}})}function T_e(e){return function(){var r=this.__on;if(r){for(var n=0,o=-1,a=r.length,i;n()=>e;function b7(e,{sourceEvent:r,subject:n,target:o,identifier:a,active:i,x:l,y:s,dx:c,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}b7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function L_e(e){return!e.ctrlKey&&!e.button}function F_e(){return this.parentNode}function V_e(e,r){return r??{x:e.x,y:e.y}}function q_e(){return navigator.maxTouchPoints||"ontouchstart"in this}function FL(){var e=L_e,r=F_e,n=V_e,o=q_e,a={},i=kx("start","drag","end"),l=0,s,c,d,u,p=0;function f($){$.on("mousedown.drag",g).filter(o).on("touchstart.drag",x).on("touchmove.drag",k,O_e).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g($,R){if(!(u||!e.call(this,$,R))){var T=_(this,r.call(this,$,R),$,R,"mouse");T&&(Ea($.view).on("mousemove.drag",v,A1).on("mouseup.drag",w,A1),OL($.view),v7($),d=!1,s=$.clientX,c=$.clientY,T("start",$))}}function v($){if(Jh($),!d){var R=$.clientX-s,T=$.clientY-c;d=R*R+T*T>p}a.mouse("drag",$)}function w($){Ea($.view).on("mousemove.drag mouseup.drag",null),LL($.view,d),Jh($),a.mouse("end",$)}function x($,R){if(e.call(this,$,R)){var T=$.changedTouches,A=r.call(this,$,R),z=T.length,j,I;for(j=0;j>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):n===8?Rx(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):n===4?Rx(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=U_e.exec(e))?new ra(r[1],r[2],r[3],1):(r=W_e.exec(e))?new ra(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=G_e.exec(e))?Rx(r[1],r[2],r[3],r[4]):(r=Y_e.exec(e))?Rx(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=X_e.exec(e))?XL(r[1],r[2]/100,r[3]/100,1):(r=Z_e.exec(e))?XL(r[1],r[2]/100,r[3]/100,r[4]):qL.hasOwnProperty(e)?WL(qL[e]):e==="transparent"?new ra(NaN,NaN,NaN,0):null}function WL(e){return new ra(e>>16&255,e>>8&255,e&255,1)}function Rx(e,r,n,o){return o<=0&&(e=r=n=NaN),new ra(e,r,n,o)}function J_e(e){return e instanceof D1||(e=Hu(e)),e?(e=e.rgb(),new ra(e.r,e.g,e.b,e.opacity)):new ra}function w7(e,r,n,o){return arguments.length===1?J_e(e):new ra(e,r,n,o??1)}function ra(e,r,n,o){this.r=+e,this.g=+r,this.b=+n,this.opacity=+o}x7(ra,w7,VL(D1,{brighter(e){return e=e==null?$x:Math.pow($x,e),new ra(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?M1:Math.pow(M1,e),new ra(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ra(Uu(this.r),Uu(this.g),Uu(this.b),zx(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:GL,formatHex:GL,formatHex8:e8e,formatRgb:YL,toString:YL}));function GL(){return`#${Wu(this.r)}${Wu(this.g)}${Wu(this.b)}`}function e8e(){return`#${Wu(this.r)}${Wu(this.g)}${Wu(this.b)}${Wu((isNaN(this.opacity)?1:this.opacity)*255)}`}function YL(){const e=zx(this.opacity);return`${e===1?"rgb(":"rgba("}${Uu(this.r)}, ${Uu(this.g)}, ${Uu(this.b)}${e===1?")":`, ${e})`}`}function zx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wu(e){return e=Uu(e),(e<16?"0":"")+e.toString(16)}function XL(e,r,n,o){return o<=0?e=r=n=NaN:n<=0||n>=1?e=r=NaN:r<=0&&(e=NaN),new Yi(e,r,n,o)}function ZL(e){if(e instanceof Yi)return new Yi(e.h,e.s,e.l,e.opacity);if(e instanceof D1||(e=Hu(e)),!e)return new Yi;if(e instanceof Yi)return e;e=e.rgb();var r=e.r/255,n=e.g/255,o=e.b/255,a=Math.min(r,n,o),i=Math.max(r,n,o),l=NaN,s=i-a,c=(i+a)/2;return s?(r===i?l=(n-o)/s+(n0&&c<1?0:l,new Yi(l,s,c,e.opacity)}function t8e(e,r,n,o){return arguments.length===1?ZL(e):new Yi(e,r,n,o??1)}function Yi(e,r,n,o){this.h=+e,this.s=+r,this.l=+n,this.opacity=+o}x7(Yi,t8e,VL(D1,{brighter(e){return e=e==null?$x:Math.pow($x,e),new Yi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?M1:Math.pow(M1,e),new Yi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*r,a=2*n-o;return new ra(k7(e>=240?e-240:e+120,a,o),k7(e,a,o),k7(e<120?e+240:e-120,a,o),this.opacity)},clamp(){return new Yi(KL(this.h),Tx(this.s),Tx(this.l),zx(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=zx(this.opacity);return`${e===1?"hsl(":"hsla("}${KL(this.h)}, ${Tx(this.s)*100}%, ${Tx(this.l)*100}%${e===1?")":`, ${e})`}`}}));function KL(e){return e=(e||0)%360,e<0?e+360:e}function Tx(e){return Math.max(0,Math.min(1,e||0))}function k7(e,r,n){return(e<60?r+(n-r)*e/60:e<180?n:e<240?r+(n-r)*(240-e)/60:r)*255}const _7=e=>()=>e;function r8e(e,r){return function(n){return e+n*r}}function n8e(e,r,n){return e=Math.pow(e,n),r=Math.pow(r,n)-e,n=1/n,function(o){return Math.pow(e+o*r,n)}}function o8e(e){return(e=+e)==1?QL:function(r,n){return n-r?n8e(r,n,e):_7(isNaN(r)?n:r)}}function QL(e,r){var n=r-e;return n?r8e(e,n):_7(isNaN(e)?r:e)}const jx=(function e(r){var n=o8e(r);function o(a,i){var l=n((a=w7(a)).r,(i=w7(i)).r),s=n(a.g,i.g),c=n(a.b,i.b),d=QL(a.opacity,i.opacity);return function(u){return a.r=l(u),a.g=s(u),a.b=c(u),a.opacity=d(u),a+""}}return o.gamma=e,o})(1);function a8e(e,r){r||(r=[]);var n=e?Math.min(r.length,e.length):0,o=r.slice(),a;return function(i){for(a=0;an&&(i=r.slice(n,i),s[l]?s[l]+=i:s[++l]=i),(o=o[0])===(a=a[0])?s[l]?s[l]+=a:s[++l]=a:(s[++l]=null,c.push({i:l,x:Ul(o,a)})),n=E7.lastIndex;return n180?u+=360:u-d>180&&(d+=360),f.push({i:p.push(a(p)+"rotate(",null,o)-2,x:Ul(d,u)})):u&&p.push(a(p)+"rotate("+u+o)}function s(d,u,p,f){d!==u?f.push({i:p.push(a(p)+"skewX(",null,o)-2,x:Ul(d,u)}):u&&p.push(a(p)+"skewX("+u+o)}function c(d,u,p,f,g,v){if(d!==p||u!==f){var w=g.push(a(g)+"scale(",null,",",null,")");v.push({i:w-4,x:Ul(d,p)},{i:w-2,x:Ul(u,f)})}else(p!==1||f!==1)&&g.push(a(g)+"scale("+p+","+f+")")}return function(d,u){var p=[],f=[];return d=e(d),u=e(u),i(d.translateX,d.translateY,u.translateX,u.translateY,p,f),l(d.rotate,u.rotate,p,f),s(d.skewX,u.skewX,p,f),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,p,f),d=u=null,function(g){for(var v=-1,w=f.length,x;++v=0&&e._call.call(void 0,r),e=e._next;--tf}function sF(){Gu=(Nx=L1.now())+Px,tf=B1=0;try{x8e()}finally{tf=0,k8e(),Gu=0}}function w8e(){var e=L1.now(),r=e-Nx;r>aF&&(Px-=r,Nx=e)}function k8e(){for(var e,r=Mx,n,o=1/0;r;)r._call?(o>r._time&&(o=r._time),e=r,r=r._next):(n=r._next,r._next=null,r=e?e._next=n:Mx=n);O1=e,$7(o)}function $7(e){if(!tf){B1&&(B1=clearTimeout(B1));var r=e-Gu;r>24?(e<1/0&&(B1=setTimeout(sF,e-L1.now()-Px)),I1&&(I1=clearInterval(I1))):(I1||(Nx=L1.now(),I1=setInterval(w8e,aF)),tf=1,iF(sF))}}function cF(e,r,n){var o=new Bx;return r=r==null?0:+r,o.restart(a=>{o.stop(),e(a+r)},r,n),o}var _8e=kx("start","end","cancel","interrupt"),S8e=[],dF=0,uF=1,R7=2,Ix=3,pF=4,z7=5,Ox=6;function Lx(e,r,n,o,a,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;E8e(e,n,{name:r,index:o,group:a,on:_8e,tween:S8e,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:dF})}function T7(e,r){var n=Xi(e,r);if(n.state>dF)throw new Error("too late; already scheduled");return n}function Wl(e,r){var n=Xi(e,r);if(n.state>Ix)throw new Error("too late; already running");return n}function Xi(e,r){var n=e.__transition;if(!n||!(n=n[r]))throw new Error("transition not found");return n}function E8e(e,r,n){var o=e.__transition,a;o[r]=n,n.timer=lF(i,0,n.time);function i(d){n.state=uF,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var u,p,f,g;if(n.state!==uF)return c();for(u in o)if(g=o[u],g.name===n.name){if(g.state===Ix)return cF(l);g.state===pF?(g.state=Ox,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[u]):+uR7&&o.state=0&&(r=r.slice(0,n)),!r||r==="start"})}function t7e(e,r,n){var o,a,i=e7e(r)?T7:Wl;return function(){var l=i(this,e),s=l.on;s!==o&&(a=(o=s).copy()).on(r,n),l.on=a}}function r7e(e,r){var n=this._id;return arguments.length<2?Xi(this.node(),n).on.on(e):this.each(t7e(n,e,r))}function n7e(e){return function(){var r=this.parentNode;for(var n in this.__transition)if(+n!==e)return;r&&r.removeChild(this)}}function o7e(){return this.on("end.remove",n7e(this._id))}function a7e(e){var r=this._name,n=this._id;typeof e!="function"&&(e=g7(e));for(var o=this._groups,a=o.length,i=new Array(a),l=0;l()=>e;function T7e(e,{sourceEvent:r,target:n,transform:o,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:a}})}function Us(e,r,n){this.k=e,this.x=r,this.y=n}Us.prototype={constructor:Us,scale:function(e){return e===1?this:new Us(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new Us(this.k,this.x+this.k*e,this.y+this.k*r)},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 qx=new Us(1,0,0);gF.prototype=Us.prototype;function gF(e){for(;!e.__zoom;)if(!(e=e.parentNode))return qx;return e.__zoom}function A7(e){e.stopImmediatePropagation()}function F1(e){e.preventDefault(),e.stopImmediatePropagation()}function j7e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function A7e(){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 yF(){return this.__zoom||qx}function D7e(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function M7e(){return navigator.maxTouchPoints||"ontouchstart"in this}function N7e(e,r,n){var o=e.invertX(r[0][0])-n[0][0],a=e.invertX(r[1][0])-n[1][0],i=e.invertY(r[0][1])-n[0][1],l=e.invertY(r[1][1])-n[1][1];return e.translate(a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function vF(){var e=j7e,r=A7e,n=N7e,o=D7e,a=M7e,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Dx,d=kx("start","zoom","end"),u,p,f,g=500,v=150,w=0,x=10;function k(M){M.property("__zoom",yF).on("wheel.zoom",z,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",I).filter(a).on("touchstart.zoom",P).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(M,V,B,F){var q=M.selection?M.selection():M;q.property("__zoom",yF),M!==q?R(M,V,B,F):q.interrupt().each(function(){T(this,arguments).event(F).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},k.scaleBy=function(M,V,B,F){k.scaleTo(M,function(){var q=this.__zoom.k,G=typeof V=="function"?V.apply(this,arguments):V;return q*G},B,F)},k.scaleTo=function(M,V,B,F){k.transform(M,function(){var q=r.apply(this,arguments),G=this.__zoom,U=B==null?$(q):typeof B=="function"?B.apply(this,arguments):B,Y=G.invert(U),Z=typeof V=="function"?V.apply(this,arguments):V;return n(_(C(G,Z),U,Y),q,l)},B,F)},k.translateBy=function(M,V,B,F){k.transform(M,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof B=="function"?B.apply(this,arguments):B),r.apply(this,arguments),l)},null,F)},k.translateTo=function(M,V,B,F,q){k.transform(M,function(){var G=r.apply(this,arguments),U=this.__zoom,Y=F==null?$(G):typeof F=="function"?F.apply(this,arguments):F;return n(qx.translate(Y[0],Y[1]).scale(U.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof B=="function"?-B.apply(this,arguments):-B),G,l)},F,q)};function C(M,V){return V=Math.max(i[0],Math.min(i[1],V)),V===M.k?M:new Us(V,M.x,M.y)}function _(M,V,B){var F=V[0]-B[0]*M.k,q=V[1]-B[1]*M.k;return F===M.x&&q===M.y?M:new Us(M.k,F,q)}function $(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function R(M,V,B,F){M.on("start.zoom",function(){T(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(F).end()}).tween("zoom",function(){var q=this,G=arguments,U=T(q,G).event(F),Y=r.apply(q,G),Z=B==null?$(Y):typeof B=="function"?B.apply(q,G):B,O=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),W=q.__zoom,K=typeof V=="function"?V.apply(q,G):V,Q=c(W.invert(Z).concat(O/W.k),K.invert(Z).concat(O/K.k));return function(ae){if(ae===1)ae=K;else{var te=Q(ae),re=O/te[2];ae=new Us(re,Z[0]-te[0]*re,Z[1]-te[1]*re)}U.zoom(null,ae)}})}function T(M,V,B){return!B&&M.__zooming||new A(M,V)}function A(M,V){this.that=M,this.args=V,this.active=0,this.sourceEvent=null,this.extent=r.apply(M,V),this.taps=0}A.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,V){return this.mouse&&M!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var V=Ea(this.that).datum();d.call(M,this.that,new T7e(M,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),V)}};function z(M,...V){if(!e.apply(this,arguments))return;var B=T(this,V).event(M),F=this.__zoom,q=Math.max(i[0],Math.min(i[1],F.k*Math.pow(2,o.apply(this,arguments)))),G=Gi(M);if(B.wheel)(B.mouse[0][0]!==G[0]||B.mouse[0][1]!==G[1])&&(B.mouse[1]=F.invert(B.mouse[0]=G)),clearTimeout(B.wheel);else{if(F.k===q)return;B.mouse=[G,F.invert(G)],Fx(this),B.start()}F1(M),B.wheel=setTimeout(U,v),B.zoom("mouse",n(_(C(F,q),B.mouse[0],B.mouse[1]),B.extent,l));function U(){B.wheel=null,B.end()}}function j(M,...V){if(f||!e.apply(this,arguments))return;var B=M.currentTarget,F=T(this,V,!0).event(M),q=Ea(M.view).on("mousemove.zoom",Z,!0).on("mouseup.zoom",O,!0),G=Gi(M,B),U=M.clientX,Y=M.clientY;OL(M.view),A7(M),F.mouse=[G,this.__zoom.invert(G)],Fx(this),F.start();function Z(W){if(F1(W),!F.moved){var K=W.clientX-U,Q=W.clientY-Y;F.moved=K*K+Q*Q>w}F.event(W).zoom("mouse",n(_(F.that.__zoom,F.mouse[0]=Gi(W,B),F.mouse[1]),F.extent,l))}function O(W){q.on("mousemove.zoom mouseup.zoom",null),LL(W.view,F.moved),F1(W),F.event(W).end()}}function I(M,...V){if(e.apply(this,arguments)){var B=this.__zoom,F=Gi(M.changedTouches?M.changedTouches[0]:M,this),q=B.invert(F),G=B.k*(M.shiftKey?.5:2),U=n(_(C(B,G),F,q),r.apply(this,V),l);F1(M),s>0?Ea(this).transition().duration(s).call(R,U,F,M):Ea(this).call(k.transform,U,F,M)}}function P(M,...V){if(e.apply(this,arguments)){var B=M.touches,F=B.length,q=T(this,V,M.changedTouches.length===F).event(M),G,U,Y,Z;for(A7(M),U=0;U"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:r,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},V1=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],bF=["Enter"," ","Escape"],xF={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:r,y:n})=>`Moved selected node ${e}. New position, x: ${r}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var rf;(function(e){e.Strict="strict",e.Loose="loose"})(rf||(rf={}));var Yu;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Yu||(Yu={}));var q1;(function(e){e.Partial="partial",e.Full="full"})(q1||(q1={}));const wF={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ad;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ad||(ad={}));var Hx;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Hx||(Hx={}));var Ue;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ue||(Ue={}));const kF={[Ue.Left]:Ue.Right,[Ue.Right]:Ue.Left,[Ue.Top]:Ue.Bottom,[Ue.Bottom]:Ue.Top};function _F(e){return e===null?null:e?"valid":"invalid"}const SF=e=>"id"in e&&"source"in e&&"target"in e,P7e=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),D7=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),H1=(e,r=[0,0])=>{const{width:n,height:o}=_o(e),a=e.origin??r,i=n*a[0],l=o*a[1];return{x:e.position.x-i,y:e.position.y-l}},EF=(e,r={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,a)=>{const i=typeof a=="string";let l=!r.nodeLookup&&!i?a:void 0;r.nodeLookup&&(l=i?r.nodeLookup.get(a):D7(a)?a:r.nodeLookup.get(a.id));const s=l?Gx(l,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ux(o,s)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Wx(n)},nf=(e,r={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(a=>{(r.filter===void 0||r.filter(a))&&(n=Ux(n,Gx(a)),o=!0)}),o?Wx(n):{x:0,y:0,width:0,height:0}},M7=(e,r,[n,o,a]=[0,0,1],i=!1,l=!1)=>{const s={...G1(r,[n,o,a]),width:r.width/a,height:r.height/a},c=[];for(const d of e.values()){const{measured:u,selectable:p=!0,hidden:f=!1}=d;if(l&&!p||f)continue;const g=u.width??d.width??d.initialWidth??null,v=u.height??d.height??d.initialHeight??null,w=U1(s,Zu(d)),x=(g??0)*(v??0),k=i&&w>0;(!d.internals.handleBounds||k||w>=x||d.dragging)&&c.push(d)}return c},B7e=(e,r)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),r.filter(o=>n.has(o.source)||n.has(o.target))};function I7e(e,r){const n=new Map,o=r?.nodes?new Set(r.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&(r?.includeHiddenNodes||!a.hidden)&&(!o||o.has(a.id))&&n.set(a.id,a)}),n}async function O7e({nodes:e,width:r,height:n,panZoom:o,minZoom:a,maxZoom:i},l){if(e.size===0)return Promise.resolve(!0);const s=I7e(e,l),c=nf(s),d=Ws(c,r,n,l?.minZoom??a,l?.maxZoom??i,l?.padding??.1);return await o.setViewport(d,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function CF({nodeId:e,nextPosition:r,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:a,onError:i}){const l=n.get(e),s=l.parentId?n.get(l.parentId):void 0,{x:c,y:d}=s?s.internals.positionAbsolute:{x:0,y:0},u=l.origin??o;let p=l.extent||a;if(l.extent==="parent"&&!l.expandParent)if(!s)i?.("005",Gl.error005());else{const g=s.measured.width,v=s.measured.height;g&&v&&(p=[[c,d],[c+g,d+v]])}else s&&sf(l.extent)&&(p=[[l.extent[0][0]+c,l.extent[0][1]+d],[l.extent[1][0]+c,l.extent[1][1]+d]]);const f=sf(p)?Xu(r,p,l.measured):r;return(l.measured.width===void 0||l.measured.height===void 0)&&i?.("015",Gl.error015()),{position:{x:f.x-c+(l.measured.width??0)*u[0],y:f.y-d+(l.measured.height??0)*u[1]},positionAbsolute:f}}async function L7e({nodesToRemove:e=[],edgesToRemove:r=[],nodes:n,edges:o,onBeforeDelete:a}){const i=new Set(e.map(p=>p.id)),l=[];for(const p of n){if(p.deletable===!1)continue;const f=i.has(p.id),g=!f&&p.parentId&&l.find(v=>v.id===p.parentId);(f||g)&&l.push(p)}const s=new Set(r.map(p=>p.id)),c=o.filter(p=>p.deletable!==!1),d=B7e(l,c);for(const p of c)s.has(p.id)&&!d.find(f=>f.id===p.id)&&d.push(p);if(!a)return{edges:d,nodes:l};const u=await a({nodes:l,edges:d});return typeof u=="boolean"?u?{edges:d,nodes:l}:{edges:[],nodes:[]}:u}const of=(e,r=0,n=1)=>Math.min(Math.max(e,r),n),Xu=(e={x:0,y:0},r,n)=>({x:of(e.x,r[0][0],r[1][0]-(n?.width??0)),y:of(e.y,r[0][1],r[1][1]-(n?.height??0))});function $F(e,r,n){const{width:o,height:a}=_o(n),{x:i,y:l}=n.internals.positionAbsolute;return Xu(e,[[i,l],[i+o,l+a]],r)}const RF=(e,r,n)=>en?-of(Math.abs(e-n),1,r)/r:0,zF=(e,r,n=15,o=40)=>{const a=RF(e.x,o,r.width-o)*n,i=RF(e.y,o,r.height-o)*n;return[a,i]},Ux=(e,r)=>({x:Math.min(e.x,r.x),y:Math.min(e.y,r.y),x2:Math.max(e.x2,r.x2),y2:Math.max(e.y2,r.y2)}),N7=({x:e,y:r,width:n,height:o})=>({x:e,y:r,x2:e+n,y2:r+o}),Wx=({x:e,y:r,x2:n,y2:o})=>({x:e,y:r,width:n-e,height:o-r}),Zu=(e,r=[0,0])=>{const{x:n,y:o}=D7(e)?e.internals.positionAbsolute:H1(e,r);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Gx=(e,r=[0,0])=>{const{x:n,y:o}=D7(e)?e.internals.positionAbsolute:H1(e,r);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},TF=(e,r)=>Wx(Ux(N7(e),N7(r))),U1=(e,r)=>{const n=Math.max(0,Math.min(e.x+e.width,r.x+r.width)-Math.max(e.x,r.x)),o=Math.max(0,Math.min(e.y+e.height,r.y+r.height)-Math.max(e.y,r.y));return Math.ceil(n*o)},jF=e=>Zi(e.width)&&Zi(e.height)&&Zi(e.x)&&Zi(e.y),Zi=e=>!isNaN(e)&&isFinite(e),F7e=(e,r)=>{},W1=(e,r=[1,1])=>({x:r[0]*Math.round(e.x/r[0]),y:r[1]*Math.round(e.y/r[1])}),G1=({x:e,y:r},[n,o,a],i=!1,l=[1,1])=>{const s={x:(e-n)/a,y:(r-o)/a};return i?W1(s,l):s},Yx=({x:e,y:r},[n,o,a])=>({x:e*a+n,y:r*a+o});function af(e,r){if(typeof e=="number")return Math.floor((r-r/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(r*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function V7e(e,r,n){if(typeof e=="string"||typeof e=="number"){const o=af(e,n),a=af(e,r);return{top:o,right:a,bottom:o,left:a,x:a*2,y:o*2}}if(typeof e=="object"){const o=af(e.top??e.y??0,n),a=af(e.bottom??e.y??0,n),i=af(e.left??e.x??0,r),l=af(e.right??e.x??0,r);return{top:o,right:l,bottom:a,left:i,x:i+l,y:o+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function q7e(e,r,n,o,a,i){const{x:l,y:s}=Yx(e,[r,n,o]),{x:c,y:d}=Yx({x:e.x+e.width,y:e.y+e.height},[r,n,o]),u=a-c,p=i-d;return{left:Math.floor(l),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(p)}}const Ws=(e,r,n,o,a,i)=>{const l=V7e(i,r,n),s=(r-l.x)/e.width,c=(n-l.y)/e.height,d=Math.min(s,c),u=of(d,o,a),p=e.x+e.width/2,f=e.y+e.height/2,g=r/2-p*u,v=n/2-f*u,w=q7e(e,g,v,u,r,n),x={left:Math.min(w.left-l.left,0),top:Math.min(w.top-l.top,0),right:Math.min(w.right-l.right,0),bottom:Math.min(w.bottom-l.bottom,0)};return{x:g-x.left+x.right,y:v-x.top+x.bottom,zoom:u}},lf=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function sf(e){return e!=null&&e!=="parent"}function _o(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function AF(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function DF(e,r={width:0,height:0},n,o,a){const i={...e},l=o.get(n);if(l){const s=l.origin||a;i.x+=l.internals.positionAbsolute.x-(r.width??0)*s[0],i.y+=l.internals.positionAbsolute.y-(r.height??0)*s[1]}return i}function MF(e,r){if(e.size!==r.size)return!1;for(const n of e)if(!r.has(n))return!1;return!0}function H7e(){let e,r;return{promise:new Promise((n,o)=>{e=n,r=o}),resolve:e,reject:r}}function U7e(e){return{...xF,...e||{}}}function Y1(e,{snapGrid:r=[0,0],snapToGrid:n=!1,transform:o,containerBounds:a}){const{x:i,y:l}=Ki(e),s=G1({x:i-(a?.left??0),y:l-(a?.top??0)},o),{x:c,y:d}=n?W1(s,r):s;return{xSnapped:c,ySnapped:d,...s}}const P7=e=>({width:e.offsetWidth,height:e.offsetHeight}),NF=e=>e?.getRootNode?.()||window?.document,W7e=["INPUT","SELECT","TEXTAREA"];function PF(e){const r=e.composedPath?.()?.[0]||e.target;return r?.nodeType!==1?!1:W7e.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const BF=e=>"clientX"in e,Ki=(e,r)=>{const n=BF(e),o=n?e.clientX:e.touches?.[0].clientX,a=n?e.clientY:e.touches?.[0].clientY;return{x:o-(r?.left??0),y:a-(r?.top??0)}},IF=(e,r,n,o,a)=>{const i=r.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const s=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:a,position:l.getAttribute("data-handlepos"),x:(s.left-n.left)/o,y:(s.top-n.top)/o,...P7(l)}})};function OF({sourceX:e,sourceY:r,targetX:n,targetY:o,sourceControlX:a,sourceControlY:i,targetControlX:l,targetControlY:s}){const c=e*.125+a*.375+l*.375+n*.125,d=r*.125+i*.375+s*.375+o*.125,u=Math.abs(c-e),p=Math.abs(d-r);return[c,d,u,p]}function Xx(e,r){return e>=0?.5*e:r*25*Math.sqrt(-e)}function LF({pos:e,x1:r,y1:n,x2:o,y2:a,c:i}){switch(e){case Ue.Left:return[r-Xx(r-o,i),n];case Ue.Right:return[r+Xx(o-r,i),n];case Ue.Top:return[r,n-Xx(n-a,i)];case Ue.Bottom:return[r,n+Xx(a-n,i)]}}function Zx({sourceX:e,sourceY:r,sourcePosition:n=Ue.Bottom,targetX:o,targetY:a,targetPosition:i=Ue.Top,curvature:l=.25}){const[s,c]=LF({pos:n,x1:e,y1:r,x2:o,y2:a,c:l}),[d,u]=LF({pos:i,x1:o,y1:a,x2:e,y2:r,c:l}),[p,f,g,v]=OF({sourceX:e,sourceY:r,targetX:o,targetY:a,sourceControlX:s,sourceControlY:c,targetControlX:d,targetControlY:u});return[`M${e},${r} C${s},${c} ${d},${u} ${o},${a}`,p,f,g,v]}function FF({sourceX:e,sourceY:r,targetX:n,targetY:o}){const a=Math.abs(n-e)/2,i=n0}const X7e=({source:e,sourceHandle:r,target:n,targetHandle:o})=>`xy-edge__${e}${r||""}-${n}${o||""}`,Z7e=(e,r)=>r.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),K7e=(e,r,n={})=>{if(!e.source||!e.target)return r;const o=n.getEdgeId||X7e;let a;return SF(e)?a={...e}:a={...e,id:o(e)},Z7e(a,r)?r:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,r.concat(a))};function VF({sourceX:e,sourceY:r,targetX:n,targetY:o}){const[a,i,l,s]=FF({sourceX:e,sourceY:r,targetX:n,targetY:o});return[`M ${e},${r}L ${n},${o}`,a,i,l,s]}const qF={[Ue.Left]:{x:-1,y:0},[Ue.Right]:{x:1,y:0},[Ue.Top]:{x:0,y:-1},[Ue.Bottom]:{x:0,y:1}},Q7e=({source:e,sourcePosition:r=Ue.Bottom,target:n})=>r===Ue.Left||r===Ue.Right?e.xMath.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2));function J7e({source:e,sourcePosition:r=Ue.Bottom,target:n,targetPosition:o=Ue.Top,center:a,offset:i,stepPosition:l}){const s=qF[r],c=qF[o],d={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+c.x*i,y:n.y+c.y*i},p=Q7e({source:d,sourcePosition:r,target:u}),f=p.x!==0?"x":"y",g=p[f];let v=[],w,x;const k={x:0,y:0},C={x:0,y:0},[,,_,$]=FF({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f==="x"?(w=a.x??d.x+(u.x-d.x)*l,x=a.y??(d.y+u.y)/2):(w=a.x??(d.x+u.x)/2,x=a.y??d.y+(u.y-d.y)*l);const R=[{x:w,y:d.y},{x:w,y:u.y}],T=[{x:d.x,y:x},{x:u.x,y:x}];s[f]===g?v=f==="x"?R:T:v=f==="x"?T:R}else{const R=[{x:d.x,y:u.y}],T=[{x:u.x,y:d.y}];if(f==="x"?v=s.x===g?T:R:v=s.y===g?R:T,r===o){const P=Math.abs(e[f]-n[f]);if(P<=i){const L=Math.min(i-1,i-P);s[f]===g?k[f]=(d[f]>e[f]?-1:1)*L:C[f]=(u[f]>n[f]?-1:1)*L}}if(r!==o){const P=f==="x"?"y":"x",L=s[f]===c[P],H=d[P]>u[P],M=d[P]=I?(w=(A.x+z.x)/2,x=v[0].y):(w=v[0].x,x=(A.y+z.y)/2)}return[[e,{x:d.x+k.x,y:d.y+k.y},...v,{x:u.x+C.x,y:u.y+C.y},n],w,x,_,$]}function e9e(e,r,n,o){const a=Math.min(HF(e,r)/2,HF(r,n)/2,o),{x:i,y:l}=r;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const d=e.x{let _="";return C>0&&Cn.id===r):e[0])||null}function B7(e,r){return e?typeof e=="string"?e:`${r?`${r}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`:""}function t9e(e,{id:r,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:a}){const i=new Set;return e.reduce((l,s)=>([s.markerStart||o,s.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const d=B7(c,r);i.has(d)||(l.push({id:d,color:c.color||n,...c}),i.add(d))}}),l),[]).sort((l,s)=>l.id.localeCompare(s.id))}function r9e(e,r,n,o,a){let i=.5;a==="start"?i=0:a==="end"&&(i=1);let l=[(e.x+e.width*i)*r.zoom+r.x,e.y*r.zoom+r.y-o],s=[-100*i,-100];switch(n){case Ue.Right:l=[(e.x+e.width)*r.zoom+r.x+o,(e.y+e.height*i)*r.zoom+r.y],s=[0,-100*i];break;case Ue.Bottom:l[1]=(e.y+e.height)*r.zoom+r.y+o,s[1]=0;break;case Ue.Left:l=[e.x*r.zoom+r.x-o,(e.y+e.height*i)*r.zoom+r.y],s=[-100,-100*i];break}return`translate(${l[0]}px, ${l[1]}px) translate(${s[0]}%, ${s[1]}%)`}const XF=1e3,n9e=10,I7={nodeOrigin:[0,0],nodeExtent:V1,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},o9e={...I7,checkEquality:!0};function O7(e,r){const n={...e};for(const o in r)r[o]!==void 0&&(n[o]=r[o]);return n}function a9e(e,r,n){const o=O7(I7,n);for(const a of e.values())if(a.parentId)V7(a,e,r,o);else{const i=H1(a,o.nodeOrigin),l=sf(a.extent)?a.extent:o.nodeExtent,s=Xu(i,l,_o(a));a.internals.positionAbsolute=s}}function i9e(e,r){if(!e.handles)return e.measured?r?.internals.handleBounds:void 0;const n=[],o=[];for(const a of e.handles){const i={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(i):a.type==="target"&&o.push(i)}return{source:n,target:o}}function L7(e){return e==="manual"}function F7(e,r,n,o={}){const a=O7(o9e,o),i={i:0},l=new Map(r),s=a?.elevateNodesOnSelect&&!L7(a.zIndexMode)?XF:0;let c=e.length>0;r.clear(),n.clear();for(const d of e){let u=l.get(d.id);if(a.checkEquality&&d===u?.internals.userNode)r.set(d.id,u);else{const p=H1(d,a.nodeOrigin),f=sf(d.extent)?d.extent:a.nodeExtent,g=Xu(p,f,_o(d));u={...a.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:g,handleBounds:i9e(d,u),z:ZF(d,s,a.zIndexMode),userNode:d}},r.set(d.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(c=!1),d.parentId&&V7(u,r,n,o,i)}return c}function l9e(e,r){if(!e.parentId)return;const n=r.get(e.parentId);n?n.set(e.id,e):r.set(e.parentId,new Map([[e.id,e]]))}function V7(e,r,n,o,a){const{elevateNodesOnSelect:i,nodeOrigin:l,nodeExtent:s,zIndexMode:c}=O7(I7,o),d=e.parentId,u=r.get(d);if(!u){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}l9e(e,n),a&&!u.parentId&&u.internals.rootParentIndex===void 0&&c==="auto"&&(u.internals.rootParentIndex=++a.i,u.internals.z=u.internals.z+a.i*n9e),a&&u.internals.rootParentIndex!==void 0&&(a.i=u.internals.rootParentIndex);const p=i&&!L7(c)?XF:0,{x:f,y:g,z:v}=s9e(e,u,l,s,p,c),{positionAbsolute:w}=e.internals,x=f!==w.x||g!==w.y;(x||v!==e.internals.z)&&r.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:g}:w,z:v}})}function ZF(e,r,n){const o=Zi(e.zIndex)?e.zIndex:0;return L7(n)?o:o+(e.selected?r:0)}function s9e(e,r,n,o,a,i){const{x:l,y:s}=r.internals.positionAbsolute,c=_o(e),d=H1(e,n),u=sf(e.extent)?Xu(d,e.extent,c):d;let p=Xu({x:l+u.x,y:s+u.y},o,c);e.extent==="parent"&&(p=$F(p,c,r));const f=ZF(e,a,i),g=r.internals.z??0;return{x:p.x,y:p.y,z:g>=f?g+1:f}}function q7(e,r,n,o=[0,0]){const a=[],i=new Map;for(const l of e){const s=r.get(l.parentId);if(!s)continue;const c=i.get(l.parentId)?.expandedRect??Zu(s),d=TF(c,l.rect);i.set(l.parentId,{expandedRect:d,parent:s})}return i.size>0&&i.forEach(({expandedRect:l,parent:s},c)=>{const d=s.internals.positionAbsolute,u=_o(s),p=s.origin??o,f=l.x0||g>0||x||k)&&(a.push({id:c,type:"position",position:{x:s.position.x-f+x,y:s.position.y-g+k}}),n.get(c)?.forEach(C=>{e.some(_=>_.id===C.id)||a.push({id:C.id,type:"position",position:{x:C.position.x+f,y:C.position.y+g}})})),(u.width0){const g=q7(f,r,n,a);d.push(...g)}return{changes:d,updatedInternals:c}}async function d9e({delta:e,panZoom:r,transform:n,translateExtent:o,width:a,height:i}){if(!r||!e.x&&!e.y)return Promise.resolve(!1);const l=await r.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,i]],o),s=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(s)}function KF(e,r,n,o,a,i){let l=a;const s=o.get(l)||new Map;o.set(l,s.set(n,r)),l=`${a}-${e}`;const c=o.get(l)||new Map;if(o.set(l,c.set(n,r)),i){l=`${a}-${e}-${i}`;const d=o.get(l)||new Map;o.set(l,d.set(n,r))}}function QF(e,r,n){e.clear(),r.clear();for(const o of n){const{source:a,target:i,sourceHandle:l=null,targetHandle:s=null}=o,c={edgeId:o.id,source:a,target:i,sourceHandle:l,targetHandle:s},d=`${a}-${l}--${i}-${s}`,u=`${i}-${s}--${a}-${l}`;KF("source",c,u,e,a,l),KF("target",c,d,e,i,s),r.set(o.id,o)}}function JF(e,r){if(!e.parentId)return!1;const n=r.get(e.parentId);return n?n.selected?!0:JF(n,r):!1}function eV(e,r,n){let o=e;do{if(o?.matches?.(r))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function u9e(e,r,n,o){const a=new Map;for(const[i,l]of e)if((l.selected||l.id===o)&&(!l.parentId||!JF(l,e))&&(l.draggable||r&&typeof l.draggable>"u")){const s=e.get(i);s&&a.set(i,{id:i,position:s.position||{x:0,y:0},distance:{x:n.x-s.internals.positionAbsolute.x,y:n.y-s.internals.positionAbsolute.y},extent:s.extent,parentId:s.parentId,origin:s.origin,expandParent:s.expandParent,internals:{positionAbsolute:s.internals.positionAbsolute||{x:0,y:0}},measured:{width:s.measured.width??0,height:s.measured.height??0}})}return a}function H7({nodeId:e,dragItems:r,nodeLookup:n,dragging:o=!0}){const a=[];for(const[l,s]of r){const c=n.get(l)?.internals.userNode;c&&a.push({...c,position:s.position,dragging:o})}if(!e)return[a[0],a];const i=n.get(e)?.internals.userNode;return[i?{...i,position:r.get(e)?.position||i.position,dragging:o}:a[0],a]}function p9e({dragItems:e,snapGrid:r,x:n,y:o}){const a=e.values().next().value;if(!a)return null;const i={x:n-a.distance.x,y:o-a.distance.y},l=W1(i,r);return{x:l.x-i.x,y:l.y-i.y}}function h9e({onNodeMouseDown:e,getStoreItems:r,onDragStart:n,onDrag:o,onDragStop:a}){let i={x:null,y:null},l=0,s=new Map,c=!1,d={x:0,y:0},u=null,p=!1,f=null,g=!1,v=!1,w=null;function x({noDragClassName:C,handleSelector:_,domNode:$,isSelectable:R,nodeId:T,nodeClickDistance:A=0}){f=Ea($);function z({x:L,y:H}){const{nodeLookup:M,nodeExtent:V,snapGrid:B,snapToGrid:F,nodeOrigin:q,onNodeDrag:G,onSelectionDrag:U,onError:Y,updateNodePositions:Z}=r();i={x:L,y:H};let O=!1;const W=s.size>1,K=W&&V?N7(nf(s)):null,Q=W&&F?p9e({dragItems:s,snapGrid:B,x:L,y:H}):null;for(const[ae,te]of s){if(!M.has(ae))continue;let re={x:L-te.distance.x,y:H-te.distance.y};F&&(re=Q?{x:Math.round(re.x+Q.x),y:Math.round(re.y+Q.y)}:W1(re,B));let ue=null;if(W&&V&&!te.extent&&K){const{positionAbsolute:pe}=te.internals,xe=pe.x-K.x+V[0][0],je=pe.x+te.measured.width-K.x2+V[1][0],Be=pe.y-K.y+V[0][1],Je=pe.y+te.measured.height-K.y2+V[1][1];ue=[[xe,Be],[je,Je]]}const{position:_e,positionAbsolute:ce}=CF({nodeId:ae,nextPosition:re,nodeLookup:M,nodeExtent:ue||V,nodeOrigin:q,onError:Y});O=O||te.position.x!==_e.x||te.position.y!==_e.y,te.position=_e,te.internals.positionAbsolute=ce}if(v=v||O,!!O&&(Z(s,!0),w&&(o||G||!T&&U))){const[ae,te]=H7({nodeId:T,dragItems:s,nodeLookup:M});o?.(w,s,ae,te),G?.(w,ae,te),T||U?.(w,te)}}async function j(){if(!u)return;const{transform:L,panBy:H,autoPanSpeed:M,autoPanOnNodeDrag:V}=r();if(!V){c=!1,cancelAnimationFrame(l);return}const[B,F]=zF(d,u,M);(B!==0||F!==0)&&(i.x=(i.x??0)-B/L[2],i.y=(i.y??0)-F/L[2],await H({x:B,y:F})&&z(i)),l=requestAnimationFrame(j)}function I(L){const{nodeLookup:H,multiSelectionActive:M,nodesDraggable:V,transform:B,snapGrid:F,snapToGrid:q,selectNodesOnDrag:G,onNodeDragStart:U,onSelectionDragStart:Y,unselectNodesAndEdges:Z}=r();p=!0,(!G||!R)&&!M&&T&&(H.get(T)?.selected||Z()),R&&G&&T&&e?.(T);const O=Y1(L.sourceEvent,{transform:B,snapGrid:F,snapToGrid:q,containerBounds:u});if(i=O,s=u9e(H,V,O,T),s.size>0&&(n||U||!T&&Y)){const[W,K]=H7({nodeId:T,dragItems:s,nodeLookup:H});n?.(L.sourceEvent,s,W,K),U?.(L.sourceEvent,W,K),T||Y?.(L.sourceEvent,K)}}const P=FL().clickDistance(A).on("start",L=>{const{domNode:H,nodeDragThreshold:M,transform:V,snapGrid:B,snapToGrid:F}=r();u=H?.getBoundingClientRect()||null,g=!1,v=!1,w=L.sourceEvent,M===0&&I(L),i=Y1(L.sourceEvent,{transform:V,snapGrid:B,snapToGrid:F,containerBounds:u}),d=Ki(L.sourceEvent,u)}).on("drag",L=>{const{autoPanOnNodeDrag:H,transform:M,snapGrid:V,snapToGrid:B,nodeDragThreshold:F,nodeLookup:q}=r(),G=Y1(L.sourceEvent,{transform:M,snapGrid:V,snapToGrid:B,containerBounds:u});if(w=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||T&&!q.has(T))&&(g=!0),!g){if(!c&&H&&p&&(c=!0,j()),!p){const U=Ki(L.sourceEvent,u),Y=U.x-d.x,Z=U.y-d.y;Math.sqrt(Y*Y+Z*Z)>F&&I(L)}(i.x!==G.xSnapped||i.y!==G.ySnapped)&&s&&p&&(d=Ki(L.sourceEvent,u),z(G))}}).on("end",L=>{if(!(!p||g)&&(c=!1,p=!1,cancelAnimationFrame(l),s.size>0)){const{nodeLookup:H,updateNodePositions:M,onNodeDragStop:V,onSelectionDragStop:B}=r();if(v&&(M(s,!1),v=!1),a||V||!T&&B){const[F,q]=H7({nodeId:T,dragItems:s,nodeLookup:H,dragging:!1});a?.(L.sourceEvent,s,F,q),V?.(L.sourceEvent,F,q),T||B?.(L.sourceEvent,q)}}}).filter(L=>{const H=L.target;return!L.button&&(!C||!eV(H,`.${C}`,$))&&(!_||eV(H,_,$))});f.call(P)}function k(){f?.on(".drag",null)}return{update:x,destroy:k}}function f9e(e,r,n){const o=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of r.values())U1(a,Zu(i))>0&&o.push(i);return o}const m9e=250;function g9e(e,r,n,o){let a=[],i=1/0;const l=f9e(e,n,r+m9e);for(const s of l){const c=[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]];for(const d of c){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:u,y:p}=Ku(s,d,d.position,!0),f=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(p-e.y,2));f>r||(f1){const s=o.type==="source"?"target":"source";return a.find(c=>c.type===s)??a[0]}return a[0]}function tV(e,r,n,o,a,i=!1){const l=o.get(e);if(!l)return null;const s=a==="strict"?l.internals.handleBounds?.[r]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],c=(n?s?.find(d=>d.id===n):s?.[0])??null;return c&&i?{...c,...Ku(l,c,c.position,!0)}:c}function rV(e,r){return e||(r?.classList.contains("target")?"target":r?.classList.contains("source")?"source":null)}function y9e(e,r){let n=null;return r?n=!0:e&&!r&&(n=!1),n}const nV=()=>!0;function v9e(e,{connectionMode:r,connectionRadius:n,handleId:o,nodeId:a,edgeUpdaterType:i,isTarget:l,domNode:s,nodeLookup:c,lib:d,autoPanOnConnect:u,flowId:p,panBy:f,cancelConnection:g,onConnectStart:v,onConnect:w,onConnectEnd:x,isValidConnection:k=nV,onReconnectEnd:C,updateConnection:_,getTransform:$,getFromHandle:R,autoPanSpeed:T,dragThreshold:A=1,handleDomNode:z}){const j=NF(e.target);let I=0,P;const{x:L,y:H}=Ki(e),M=rV(i,z),V=s?.getBoundingClientRect();let B=!1;if(!V||!M)return;const F=tV(a,M,o,c,r);if(!F)return;let q=Ki(e,V),G=!1,U=null,Y=!1,Z=null;function O(){if(!u||!V)return;const[ue,_e]=zF(q,V,T);f({x:ue,y:_e}),I=requestAnimationFrame(O)}const W={...F,nodeId:a,type:M,position:F.position},K=c.get(a);let Q={inProgress:!0,isValid:null,from:Ku(K,W,Ue.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:K,to:q,toHandle:null,toPosition:kF[W.position],toNode:null,pointer:q};function ae(){B=!0,_(Q),v?.(e,{nodeId:a,handleId:o,handleType:M})}A===0&&ae();function te(ue){if(!B){const{x:Be,y:Je}=Ki(ue),st=Be-L,Le=Je-H;if(!(st*st+Le*Le>A*A))return;ae()}if(!R()||!W){re(ue);return}const _e=$();q=Ki(ue,V),P=g9e(G1(q,_e,!1,[1,1]),n,c,W),G||(O(),G=!0);const ce=oV(ue,{handle:P,connectionMode:r,fromNodeId:a,fromHandleId:o,fromType:l?"target":"source",isValidConnection:k,doc:j,lib:d,flowId:p,nodeLookup:c});Z=ce.handleDomNode,U=ce.connection,Y=y9e(!!P,ce.isValid);const pe=c.get(a),xe=pe?Ku(pe,W,Ue.Left,!0):Q.from,je={...Q,from:xe,isValid:Y,to:ce.toHandle&&Y?Yx({x:ce.toHandle.x,y:ce.toHandle.y},_e):q,toHandle:ce.toHandle,toPosition:Y&&ce.toHandle?ce.toHandle.position:kF[W.position],toNode:ce.toHandle?c.get(ce.toHandle.nodeId):null,pointer:q};_(je),Q=je}function re(ue){if(!("touches"in ue&&ue.touches.length>0)){if(B){(P||Z)&&U&&Y&&w?.(U);const{inProgress:_e,...ce}=Q,pe={...ce,toPosition:Q.toHandle?Q.toPosition:null};x?.(ue,pe),i&&C?.(ue,pe)}g(),cancelAnimationFrame(I),G=!1,Y=!1,U=null,Z=null,j.removeEventListener("mousemove",te),j.removeEventListener("mouseup",re),j.removeEventListener("touchmove",te),j.removeEventListener("touchend",re)}}j.addEventListener("mousemove",te),j.addEventListener("mouseup",re),j.addEventListener("touchmove",te),j.addEventListener("touchend",re)}function oV(e,{handle:r,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:i,doc:l,lib:s,flowId:c,isValidConnection:d=nV,nodeLookup:u}){const p=i==="target",f=r?l.querySelector(`.${s}-flow__handle[data-id="${c}-${r?.nodeId}-${r?.id}-${r?.type}"]`):null,{x:g,y:v}=Ki(e),w=l.elementFromPoint(g,v),x=w?.classList.contains(`${s}-flow__handle`)?w:f,k={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const C=rV(void 0,x),_=x.getAttribute("data-nodeid"),$=x.getAttribute("data-handleid"),R=x.classList.contains("connectable"),T=x.classList.contains("connectableend");if(!_||!C)return k;const A={source:p?_:o,sourceHandle:p?$:a,target:p?o:_,targetHandle:p?a:$};k.connection=A;const z=R&&T&&(n===rf.Strict?p&&C==="source"||!p&&C==="target":_!==o||$!==a);k.isValid=z&&d(A),k.toHandle=tV(_,C,$,u,n,!0)}return k}const U7={onPointerDown:v9e,isValid:oV};function b9e({domNode:e,panZoom:r,getTransform:n,getViewScale:o}){const a=Ea(e);function i({translateExtent:s,width:c,height:d,zoomStep:u=1,pannable:p=!0,zoomable:f=!0,inversePan:g=!1}){const v=_=>{if(_.sourceEvent.type!=="wheel"||!r)return;const $=n(),R=_.sourceEvent.ctrlKey&&lf()?10:1,T=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*u,A=$[2]*Math.pow(2,T*R);r.scaleTo(A)};let w=[0,0];const x=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(w=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},k=_=>{const $=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!r)return;const R=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],T=[R[0]-w[0],R[1]-w[1]];w=R;const A=o()*Math.max($[2],Math.log($[2]))*(g?-1:1),z={x:$[0]-T[0]*A,y:$[1]-T[1]*A},j=[[0,0],[c,d]];r.setViewportConstrained({x:z.x,y:z.y,zoom:$[2]},j,s)},C=vF().on("start",x).on("zoom",p?k:null).on("zoom.wheel",f?v:null);a.call(C,{})}function l(){a.on("zoom",null)}return{update:i,destroy:l,pointer:Gi}}const Qx=e=>({x:e.x,y:e.y,zoom:e.k}),W7=({x:e,y:r,zoom:n})=>qx.translate(e,r).scale(n),cf=(e,r)=>e.target.closest(`.${r}`),aV=(e,r)=>r===2&&Array.isArray(e)&&e.includes(2),x9e=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,G7=(e,r=0,n=x9e,o=()=>{})=>{const a=typeof r=="number"&&r>0;return a||o(),a?e.transition().duration(r).ease(n).on("end",o):e},iV=e=>{const r=e.ctrlKey&&lf()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*r};function w9e({zoomPanValues:e,noWheelClassName:r,d3Selection:n,d3Zoom:o,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:d}){return u=>{if(cf(u,r))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(u.ctrlKey&&l){const x=Gi(u),k=iV(u),C=p*Math.pow(2,k);o.scaleTo(n,C,x,u);return}const f=u.deltaMode===1?20:1;let g=a===Yu.Vertical?0:u.deltaX*f,v=a===Yu.Horizontal?0:u.deltaY*f;!lf()&&u.shiftKey&&a!==Yu.Vertical&&(g=u.deltaY*f,v=0),o.translateBy(n,-(g/p)*i,-(v/p)*i,{internal:!0});const w=Qx(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c?.(u,w),e.panScrollTimeout=setTimeout(()=>{d?.(u,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,w))}}function k9e({noWheelClassName:e,preventScrolling:r,d3ZoomHandler:n}){return function(o,a){const i=o.type==="wheel",l=!r&&i&&!o.ctrlKey,s=cf(o,e);if(o.ctrlKey&&i&&s&&o.preventDefault(),l||s)return null;o.preventDefault(),n.call(this,o,a)}}function _9e({zoomPanValues:e,onDraggingChange:r,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const a=Qx(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=a,o.sourceEvent?.type==="mousedown"&&r(!0),n&&n?.(o.sourceEvent,a)}}function S9e({zoomPanValues:e,panOnDrag:r,onPaneContextMenu:n,onTransformChange:o,onPanZoom:a}){return i=>{e.usedRightMouseButton=!!(n&&aV(r,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),a&&!i.sourceEvent?.internal&&a?.(i.sourceEvent,Qx(i.transform))}}function E9e({zoomPanValues:e,panOnDrag:r,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:a,onPaneContextMenu:i}){return l=>{if(!l.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&aV(r,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,o(!1),a)){const s=Qx(l.transform);e.prevViewport=s,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a?.(l.sourceEvent,s)},n?150:0)}}}function C9e({zoomActivationKeyPressed:e,zoomOnScroll:r,zoomOnPinch:n,panOnDrag:o,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:s,noPanClassName:c,lib:d,connectionInProgress:u}){return p=>{const f=e||r,g=n&&p.ctrlKey,v=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(cf(p,`${d}-flow__node`)||cf(p,`${d}-flow__edge`)))return!0;if(!o&&!f&&!a&&!i&&!n||l||u&&!v||cf(p,s)&&v||cf(p,c)&&(!v||a&&v&&!e)||!n&&p.ctrlKey&&v)return!1;if(!n&&p.type==="touchstart"&&p.touches?.length>1)return p.preventDefault(),!1;if(!f&&!a&&!g&&v||!o&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(o)&&!o.includes(p.button)&&p.type==="mousedown")return!1;const w=Array.isArray(o)&&o.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||v)&&w}}function $9e({domNode:e,minZoom:r,maxZoom:n,translateExtent:o,viewport:a,onPanZoom:i,onPanZoomStart:l,onPanZoomEnd:s,onDraggingChange:c}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),p=vF().scaleExtent([r,n]).translateExtent(o),f=Ea(e).call(p);C({x:a.x,y:a.y,zoom:of(a.zoom,r,n)},[[0,0],[u.width,u.height]],o);const g=f.on("wheel.zoom"),v=f.on("dblclick.zoom");p.wheelDelta(iV);function w(P,L){return f?new Promise(H=>{p?.interpolate(L?.interpolate==="linear"?P1:Dx).transform(G7(f,L?.duration,L?.ease,()=>H(!0)),P)}):Promise.resolve(!1)}function x({noWheelClassName:P,noPanClassName:L,onPaneContextMenu:H,userSelectionActive:M,panOnScroll:V,panOnDrag:B,panOnScrollMode:F,panOnScrollSpeed:q,preventScrolling:G,zoomOnPinch:U,zoomOnScroll:Y,zoomOnDoubleClick:Z,zoomActivationKeyPressed:O,lib:W,onTransformChange:K,connectionInProgress:Q,paneClickDistance:ae,selectionOnDrag:te}){M&&!d.isZoomingOrPanning&&k();const re=V&&!O&&!M;p.clickDistance(te?1/0:!Zi(ae)||ae<0?0:ae);const ue=re?w9e({zoomPanValues:d,noWheelClassName:P,d3Selection:f,d3Zoom:p,panOnScrollMode:F,panOnScrollSpeed:q,zoomOnPinch:U,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:s}):k9e({noWheelClassName:P,preventScrolling:G,d3ZoomHandler:g});if(f.on("wheel.zoom",ue,{passive:!1}),!M){const ce=_9e({zoomPanValues:d,onDraggingChange:c,onPanZoomStart:l});p.on("start",ce);const pe=S9e({zoomPanValues:d,panOnDrag:B,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:K});p.on("zoom",pe);const xe=E9e({zoomPanValues:d,panOnDrag:B,panOnScroll:V,onPaneContextMenu:H,onPanZoomEnd:s,onDraggingChange:c});p.on("end",xe)}const _e=C9e({zoomActivationKeyPressed:O,panOnDrag:B,zoomOnScroll:Y,panOnScroll:V,zoomOnDoubleClick:Z,zoomOnPinch:U,userSelectionActive:M,noPanClassName:L,noWheelClassName:P,lib:W,connectionInProgress:Q});p.filter(_e),Z?f.on("dblclick.zoom",v):f.on("dblclick.zoom",null)}function k(){p.on("zoom",null)}async function C(P,L,H){const M=W7(P),V=p?.constrain()(M,L,H);return V&&await w(V),new Promise(B=>B(V))}async function _(P,L){const H=W7(P);return await w(H,L),new Promise(M=>M(H))}function $(P){if(f){const L=W7(P),H=f.property("__zoom");(H.k!==P.zoom||H.x!==P.x||H.y!==P.y)&&p?.transform(f,L,null,{sync:!0})}}function R(){const P=f?gF(f.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function T(P,L){return f?new Promise(H=>{p?.interpolate(L?.interpolate==="linear"?P1:Dx).scaleTo(G7(f,L?.duration,L?.ease,()=>H(!0)),P)}):Promise.resolve(!1)}function A(P,L){return f?new Promise(H=>{p?.interpolate(L?.interpolate==="linear"?P1:Dx).scaleBy(G7(f,L?.duration,L?.ease,()=>H(!0)),P)}):Promise.resolve(!1)}function z(P){p?.scaleExtent(P)}function j(P){p?.translateExtent(P)}function I(P){const L=!Zi(P)||P<0?0:P;p?.clickDistance(L)}return{update:x,destroy:k,setViewport:_,setViewportConstrained:C,getViewport:R,scaleTo:T,scaleBy:A,setScaleExtent:z,setTranslateExtent:j,syncViewport:$,setClickDistance:I}}var df;(function(e){e.Line="line",e.Handle="handle"})(df||(df={}));function R9e({width:e,prevWidth:r,height:n,prevHeight:o,affectsX:a,affectsY:i}){const l=e-r,s=n-o,c=[l>0?1:l<0?-1:0,s>0?1:s<0?-1:0];return l&&a&&(c[0]=c[0]*-1),s&&i&&(c[1]=c[1]*-1),c}function lV(e){const r=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),a=e.includes("top");return{isHorizontal:r,isVertical:n,affectsX:o,affectsY:a}}function id(e,r){return Math.max(0,r-e)}function ld(e,r){return Math.max(0,e-r)}function Jx(e,r,n){return Math.max(0,r-e,e-n)}function sV(e,r){return e?!r:r}function z9e(e,r,n,o,a,i,l,s){let{affectsX:c,affectsY:d}=r;const{isHorizontal:u,isVertical:p}=r,f=u&&p,{xSnapped:g,ySnapped:v}=n,{minWidth:w,maxWidth:x,minHeight:k,maxHeight:C}=o,{x:_,y:$,width:R,height:T,aspectRatio:A}=e;let z=Math.floor(u?g-e.pointerX:0),j=Math.floor(p?v-e.pointerY:0);const I=R+(c?-z:z),P=T+(d?-j:j),L=-i[0]*R,H=-i[1]*T;let M=Jx(I,w,x),V=Jx(P,k,C);if(l){let q=0,G=0;c&&z<0?q=id(_+z+L,l[0][0]):!c&&z>0&&(q=ld(_+I+L,l[1][0])),d&&j<0?G=id($+j+H,l[0][1]):!d&&j>0&&(G=ld($+P+H,l[1][1])),M=Math.max(M,q),V=Math.max(V,G)}if(s){let q=0,G=0;c&&z>0?q=ld(_+z,s[0][0]):!c&&z<0&&(q=id(_+I,s[1][0])),d&&j>0?G=ld($+j,s[0][1]):!d&&j<0&&(G=id($+P,s[1][1])),M=Math.max(M,q),V=Math.max(V,G)}if(a){if(u){const q=Jx(I/A,k,C)*A;if(M=Math.max(M,q),l){let G=0;!c&&!d||c&&!d&&f?G=ld($+H+I/A,l[1][1])*A:G=id($+H+(c?z:-z)/A,l[0][1])*A,M=Math.max(M,G)}if(s){let G=0;!c&&!d||c&&!d&&f?G=id($+I/A,s[1][1])*A:G=ld($+(c?z:-z)/A,s[0][1])*A,M=Math.max(M,G)}}if(p){const q=Jx(P*A,w,x)/A;if(V=Math.max(V,q),l){let G=0;!c&&!d||d&&!c&&f?G=ld(_+P*A+L,l[1][0])/A:G=id(_+(d?j:-j)*A+L,l[0][0])/A,V=Math.max(V,G)}if(s){let G=0;!c&&!d||d&&!c&&f?G=id(_+P*A,s[1][0])/A:G=ld(_+(d?j:-j)*A,s[0][0])/A,V=Math.max(V,G)}}}j=j+(j<0?V:-V),z=z+(z<0?M:-M),a&&(f?I>P*A?j=(sV(c,d)?-z:z)/A:z=(sV(c,d)?-j:j)*A:u?(j=z/A,d=c):(z=j*A,c=d));const B=c?_+z:_,F=d?$+j:$;return{width:R+(c?-z:z),height:T+(d?-j:j),x:i[0]*z*(c?-1:1)+B,y:i[1]*j*(d?-1:1)+F}}const cV={width:0,height:0,x:0,y:0},T9e={...cV,pointerX:0,pointerY:0,aspectRatio:1};function j9e(e){return[[0,0],[e.measured.width,e.measured.height]]}function A9e(e,r,n){const o=r.position.x+e.position.x,a=r.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,s=n[0]*i,c=n[1]*l;return[[o-s,a-c],[o+i-s,a+l-c]]}function D9e({domNode:e,nodeId:r,getStoreItems:n,onChange:o,onEnd:a}){const i=Ea(e);let l={controlDirection:lV("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:d,boundaries:u,keepAspectRatio:p,resizeDirection:f,onResizeStart:g,onResize:v,onResizeEnd:w,shouldResize:x}){let k={...cV},C={...T9e};l={boundaries:u,resizeDirection:f,keepAspectRatio:p,controlDirection:lV(d)};let _,$=null,R=[],T,A,z,j=!1;const I=FL().on("start",P=>{const{nodeLookup:L,transform:H,snapGrid:M,snapToGrid:V,nodeOrigin:B,paneDomNode:F}=n();if(_=L.get(r),!_)return;$=F?.getBoundingClientRect()??null;const{xSnapped:q,ySnapped:G}=Y1(P.sourceEvent,{transform:H,snapGrid:M,snapToGrid:V,containerBounds:$});k={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},C={...k,pointerX:q,pointerY:G,aspectRatio:k.width/k.height},T=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(T=L.get(_.parentId),A=T&&_.extent==="parent"?j9e(T):void 0),R=[],z=void 0;for(const[U,Y]of L)if(Y.parentId===r&&(R.push({id:U,position:{...Y.position},extent:Y.extent}),Y.extent==="parent"||Y.expandParent)){const Z=A9e(Y,_,Y.origin??B);z?z=[[Math.min(Z[0][0],z[0][0]),Math.min(Z[0][1],z[0][1])],[Math.max(Z[1][0],z[1][0]),Math.max(Z[1][1],z[1][1])]]:z=Z}g?.(P,{...k})}).on("drag",P=>{const{transform:L,snapGrid:H,snapToGrid:M,nodeOrigin:V}=n(),B=Y1(P.sourceEvent,{transform:L,snapGrid:H,snapToGrid:M,containerBounds:$}),F=[];if(!_)return;const{x:q,y:G,width:U,height:Y}=k,Z={},O=_.origin??V,{width:W,height:K,x:Q,y:ae}=z9e(C,l.controlDirection,B,l.boundaries,l.keepAspectRatio,O,A,z),te=W!==U,re=K!==Y,ue=Q!==q&&te,_e=ae!==G&&re;if(!ue&&!_e&&!te&&!re)return;if((ue||_e||O[0]===1||O[1]===1)&&(Z.x=ue?Q:k.x,Z.y=_e?ae:k.y,k.x=Z.x,k.y=Z.y,R.length>0)){const xe=Q-q,je=ae-G;for(const Be of R)Be.position={x:Be.position.x-xe+O[0]*(W-U),y:Be.position.y-je+O[1]*(K-Y)},F.push(Be)}if((te||re)&&(Z.width=te&&(!l.resizeDirection||l.resizeDirection==="horizontal")?W:k.width,Z.height=re&&(!l.resizeDirection||l.resizeDirection==="vertical")?K:k.height,k.width=Z.width,k.height=Z.height),T&&_.expandParent){const xe=O[0]*(Z.width??0);Z.x&&Z.x{j&&(w?.(P,{...k}),a?.({...k}),j=!1)});i.call(I)}function c(){i.on(".drag",null)}return{update:s,destroy:c}}function Y7(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dV={exports:{}},X7={},uV={exports:{}},Z7={},pV;function M9e(){if(pV)return Z7;pV=1;var e=Kr;function r(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}var n=typeof Object.is=="function"?Object.is:r,o=e.useState,a=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function s(p,f){var g=f(),v=o({inst:{value:g,getSnapshot:f}}),w=v[0].inst,x=v[1];return i(function(){w.value=g,w.getSnapshot=f,c(w)&&x({inst:w})},[p,g,f]),a(function(){return c(w)&&x({inst:w}),p(function(){c(w)&&x({inst:w})})},[p]),l(g),g}function c(p){var f=p.getSnapshot;p=p.value;try{var g=f();return!n(p,g)}catch{return!0}}function d(p,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:s;return Z7.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Z7}var hV;function fV(){return hV||(hV=1,uV.exports=M9e()),uV.exports}var mV;function N9e(){if(mV)return X7;mV=1;var e=Kr,r=fV();function n(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}var o=typeof Object.is=="function"?Object.is:n,a=r.useSyncExternalStore,i=e.useRef,l=e.useEffect,s=e.useMemo,c=e.useDebugValue;return X7.useSyncExternalStoreWithSelector=function(d,u,p,f,g){var v=i(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=s(function(){function k(T){if(!C){if(C=!0,_=T,T=f(T),g!==void 0&&w.hasValue){var A=w.value;if(g(A,T))return $=A}return $=T}if(A=$,o(_,T))return A;var z=f(T);return g!==void 0&&g(A,z)?(_=T,A):(_=T,$=z)}var C=!1,_,$,R=p===void 0?null:p;return[function(){return k(u())},R===null?void 0:function(){return k(R())}]},[u,p,f,g]);var x=a(d,v[0],v[1]);return l(function(){w.hasValue=!0,w.value=x},[x]),c(x),x},X7}var gV;function P9e(){return gV||(gV=1,dV.exports=N9e()),dV.exports}var yV=P9e();const B9e=Y7(yV),I9e={},vV=e=>{let r;const n=new Set,o=(s,c)=>{const d=typeof s=="function"?s(r):s;if(!Object.is(d,r)){const u=r;r=c??(typeof d!="object"||d===null)?d:Object.assign({},r,d),n.forEach(p=>p(r,u))}},a=()=>r,i={setState:o,getState:a,getInitialState:()=>l,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>{(I9e?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=r=e(o,a,i);return i},O9e=e=>e?vV(e):vV,{useDebugValue:L9e}=Kr,{useSyncExternalStoreWithSelector:F9e}=B9e,V9e=e=>e;function bV(e,r=V9e,n){const o=F9e(e.subscribe,e.getState,e.getServerState||e.getInitialState,r,n);return L9e(o),o}const xV=(e,r)=>{const n=O9e(e),o=(a,i=r)=>bV(n,a,i);return Object.assign(o,n),o},q9e=(e,r)=>e?xV(e,r):xV;function jr(e,r){if(Object.is(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(const[o,a]of e)if(!Object.is(a,r.get(o)))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(const o of e)if(!r.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(r).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(r,o)||!Object.is(e[o],r[o]))return!1;return!0}const ew=S.createContext(null),H9e=ew.Provider,wV=Gl.error001();function Dt(e,r){const n=S.useContext(ew);if(n===null)throw new Error(wV);return bV(n,e,r)}function vr(){const e=S.useContext(ew);if(e===null)throw new Error(wV);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const kV={display:"none"},U9e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},_V="react-flow__node-desc",SV="react-flow__edge-desc",W9e="react-flow__aria-live",G9e=e=>e.ariaLiveMessage,Y9e=e=>e.ariaLabelConfig;function X9e({rfId:e}){const r=Dt(G9e);return y.jsx("div",{id:`${W9e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:U9e,children:r})}function Z9e({rfId:e,disableKeyboardA11y:r}){const n=Dt(Y9e);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${_V}-${e}`,style:kV,children:r?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${SV}-${e}`,style:kV,children:n["edge.a11yDescription.default"]}),!r&&y.jsx(X9e,{rfId:e})]})}const sd=S.forwardRef(({position:e="top-left",children:r,className:n,style:o,...a},i)=>{const l=`${e}`.split("-");return y.jsx("div",{className:dn(["react-flow__panel",n,...l]),style:o,ref:i,...a,children:r})});sd.displayName="Panel";function K9e({proOptions:e,position:r="bottom-right"}){return e?.hideAttribution?null:y.jsx(sd,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Q9e=e=>{const r=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&r.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:r,selectedEdges:n}},tw=e=>e.id;function J9e(e,r){return jr(e.selectedNodes.map(tw),r.selectedNodes.map(tw))&&jr(e.selectedEdges.map(tw),r.selectedEdges.map(tw))}function eSe({onSelectionChange:e}){const r=vr(),{selectedNodes:n,selectedEdges:o}=Dt(Q9e,J9e);return S.useEffect(()=>{const a={nodes:n,edges:o};e?.(a),r.getState().onSelectionChangeHandlers.forEach(i=>i(a))},[n,o,e]),null}const tSe=e=>!!e.onSelectionChangeHandlers;function rSe({onSelectionChange:e}){const r=Dt(tSe);return e||r?y.jsx(eSe,{onSelectionChange:e}):null}const EV=[0,0],nSe={x:0,y:0,zoom:1},oSe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],CV=[...oSe,"rfId"],aSe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),$V={translateExtent:V1,nodeOrigin:EV,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function iSe(e){const{setNodes:r,setEdges:n,setMinZoom:o,setMaxZoom:a,setTranslateExtent:i,setNodeExtent:l,reset:s,setDefaultNodesAndEdges:c}=Dt(aSe,jr),d=vr();S.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=$V,s()}),[]);const u=S.useRef($V);return S.useEffect(()=>{for(const p of CV){const f=e[p],g=u.current[p];f!==g&&(typeof e[p]>"u"||(p==="nodes"?r(f):p==="edges"?n(f):p==="minZoom"?o(f):p==="maxZoom"?a(f):p==="translateExtent"?i(f):p==="nodeExtent"?l(f):p==="ariaLabelConfig"?d.setState({ariaLabelConfig:U7e(f)}):p==="fitView"?d.setState({fitViewQueued:f}):p==="fitViewOptions"?d.setState({fitViewOptions:f}):d.setState({[p]:f})))}u.current=e},CV.map(p=>e[p])),null}function RV(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function lSe(e){const[r,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const o=RV(),a=()=>n(o?.matches?"dark":"light");return a(),o?.addEventListener("change",a),()=>{o?.removeEventListener("change",a)}},[e]),r!==null?r:RV()?.matches?"dark":"light"}const zV=typeof document<"u"?document:null;function X1(e=null,r={target:zV,actInsideInputWithModifier:!0}){const[n,o]=S.useState(!1),a=S.useRef(!1),i=S.useRef(new Set([])),[l,s]=S.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(u=>typeof u=="string").map(u=>u.replace("+",` +`}),n}function JI(e){let r=0,n=e.charCodeAt(r);for(;n===9||n===32;)r++,n=e.charCodeAt(r);return e.slice(r)}function eO(e,r){const n=D2e(e,r),o=n.one(e,void 0),i=j2e(n),a=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` +`},i),a}function I2e(e,r){return e&&"run"in e?async function(n,o){const i=eO(n,{file:o,...r});await e.run(i,o)}:function(n,o){return eO(n,{file:o,...e||r})}}function tO(e){if(e)throw e}var s8,rO;function O2e(){if(rO)return s8;rO=1;var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):r.call(d)==="[object Array]"},a=function(d){if(!d||r.call(d)!=="[object Object]")return!1;var u=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!u&&!p)return!1;var f;for(f in d);return typeof f>"u"||e.call(d,f)},l=function(d,u){n&&u.name==="__proto__"?n(d,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):d[u.name]=u.newValue},s=function(d,u){if(u==="__proto__")if(e.call(d,u)){if(o)return o(d,u).value}else return;return d[u]};return s8=function c(){var d,u,p,f,g,v,w=arguments[0],x=1,k=arguments.length,C=!1;for(typeof w=="boolean"&&(C=w,w=arguments[1]||{},x=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});xl.length;let c;s&&l.push(i);try{c=e.apply(this,l)}catch(d){const u=d;if(s&&n)throw u;return i(u)}s||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(l,...s){n||(n=!0,r(l,...s))}function a(l){i(null,l)}}class ti extends Error{constructor(r,n,o){super(),typeof n=="string"&&(o=n,n=void 0);let i="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof r=="string"?i=r:!a.cause&&r&&(l=!0,i=r.message,a.cause=r),!a.ruleId&&!a.source&&typeof o=="string"){const c=o.indexOf(":");c===-1?a.ruleId=o:(a.source=o.slice(0,c),a.ruleId=o.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=u1(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}ti.prototype.file="",ti.prototype.name="",ti.prototype.reason="",ti.prototype.message="",ti.prototype.stack="",ti.prototype.column=void 0,ti.prototype.line=void 0,ti.prototype.ancestors=void 0,ti.prototype.cause=void 0,ti.prototype.fatal=void 0,ti.prototype.place=void 0,ti.prototype.ruleId=void 0,ti.prototype.source=void 0;const ql={basename:q2e,dirname:H2e,extname:U2e,join:W2e,sep:"/"};function q2e(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');p1(e);let n=0,o=-1,i=e.length,a;if(r===void 0||r.length===0||r.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1);return o<0?"":e.slice(n,o)}if(r===e)return"";let l=-1,s=r.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),s>-1&&(e.codePointAt(i)===r.codePointAt(s--)?s<0&&(o=i):(s=-1,o=l));return n===o?o=l:o<0&&(o=e.length),e.slice(n,o)}function H2e(e){if(p1(e),e.length===0)return".";let r=-1,n=e.length,o;for(;--n;)if(e.codePointAt(n)===47){if(o){r=n;break}}else o||(o=!0);return r<0?e.codePointAt(0)===47?"/":".":r===1&&e.codePointAt(0)===47?"//":e.slice(0,r)}function U2e(e){p1(e);let r=e.length,n=-1,o=0,i=-1,a=0,l;for(;r--;){const s=e.codePointAt(r);if(s===47){if(l){o=r+1;break}continue}n<0&&(l=!0,n=r+1),s===46?i<0?i=r:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===o+1?"":e.slice(i,n)}function W2e(...e){let r=-1,n;for(;++r0&&e.codePointAt(e.length-1)===47&&(n+="/"),r?"/"+n:n}function Y2e(e,r){let n="",o=0,i=-1,a=0,l=-1,s,c;for(;++l<=e.length;){if(l2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",o=0):(n=n.slice(0,c),o=n.length-1-n.lastIndexOf("/")),i=l,a=0;continue}}else if(n.length>0){n="",o=0,i=l,a=0;continue}}r&&(n=n.length>0?n+"/..":"..",o=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),o=l-i-1;i=l,a=0}else s===46&&a>-1?a++:a=-1}return n}function p1(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const X2e={cwd:K2e};function K2e(){return"/"}function u8(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Z2e(e){if(typeof e=="string")e=new URL(e);else if(!u8(e)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(e.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return Q2e(e)}function Q2e(e){if(e.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const r=e.pathname;let n=-1;for(;++n0){let[g,...v]=u;const w=o[f][1];d8(w)&&d8(g)&&(g=c8(!0,w,g)),o[f]=[d,g,...v]}}}}const n4e=new m8().freeze();function g8(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function y8(e,r){if(typeof r!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function v8(e,r){if(r)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function oO(e){if(!d8(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iO(e,r,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+r+"` instead")}function Xb(e){return o4e(e)?e:new J2e(e)}function o4e(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function i4e(e){return typeof e=="string"||a4e(e)}function a4e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function l4e(){return n4e().use(r2e).use(T3e).use(D3e).use(I2e,{allowDangerousHtml:!0}).use(S0e,XN({attributes:{"*":["className"],svg:["width","height","viewBox","fill","ariaHidden"],path:["d","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin"]},tagNames:["svg","g","path","div"]},M_)).use(Fve,{allowDangerousHtml:!0})}function s4e(e){return(""+l4e().processSync(e)).trim()}function c4e(e){return Hb(UI(e),{includeHtml:!1,includeImageAlt:!1})}var b8,aO;function d4e(){if(aO)return b8;aO=1;var e=aB(),r=Ab();function n(){this.clear()}return n.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},n.prototype.enqueue=function(o){return this.items.push(o),++this.size},n.prototype.dequeue=function(){if(this.size){var o=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,o}},n.prototype.peek=function(){if(this.size)return this.items[this.offset]},n.prototype.forEach=function(o,i){i=arguments.length>1?i:this;for(var a=this.offset,l=0,s=this.items.length;a=o.length)return{done:!0};var a=o[i];return i++,{value:a,done:!1}})},n.prototype.entries=function(){var o=this.items,i=this.offset,a=0;return new e(function(){if(i>=o.length)return{done:!0};var l=o[i];return i++,{value:[a++,l],done:!1}})},typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=n.prototype.values),n.prototype.toString=function(){return this.toArray().join(",")},n.prototype.toJSON=function(){return this.toArray()},n.prototype.inspect=function(){var o=this.toArray();return Object.defineProperty(o,"constructor",{value:n,enumerable:!1}),o},typeof Symbol<"u"&&(n.prototype[Symbol.for("nodejs.util.inspect.custom")]=n.prototype.inspect),n.from=function(o){var i=new n;return r(o,function(a){i.enqueue(a)}),i},n.of=function(){return n.from(arguments)},b8=n,b8}var u4e=d4e();const x8=Qg(u4e);var w8,lO;function p4e(){if(lO)return w8;lO=1;function e(r){if(typeof r!="function")throw new Error("mnemonist/DefaultMap.constructor: expecting a function.");this.items=new Map,this.factory=r,this.size=0}return e.prototype.clear=function(){this.items.clear(),this.size=0},e.prototype.get=function(r){var n=this.items.get(r);return typeof n>"u"&&(n=this.factory(r,this.size),this.items.set(r,n),this.size++),n},e.prototype.peek=function(r){return this.items.get(r)},e.prototype.set=function(r,n){return this.items.set(r,n),this.size=this.items.size,this},e.prototype.has=function(r){return this.items.has(r)},e.prototype.delete=function(r){var n=this.items.delete(r);return this.size=this.items.size,n},e.prototype.forEach=function(r,n){n=arguments.length>1?n:this,this.items.forEach(r,n)},e.prototype.entries=function(){return this.items.entries()},e.prototype.keys=function(){return this.items.keys()},e.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(e.prototype[Symbol.iterator]=e.prototype.entries),e.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(e.prototype[Symbol.for("nodejs.util.inspect.custom")]=e.prototype.inspect),e.autoIncrement=function(){var r=0;return function(){return r++}},w8=e,w8}var h4e=p4e();const Ln=Qg(h4e);function Ji(e){return!!e}function sO(e){return r=>!e(r)}function f4e(...e){return ao(m4e,e)}const m4e=(e,r)=>r.every(n=>n(e));function g4e(...e){return ao(y4e,e)}const y4e=(e,r)=>r.some(n=>n(e));function Xn(e){return e==null}function cO(e,r){return e[Iu]===r}const Iu="_stage",h1="_type",k8="_layout";function v4e(e){return Ji(e.kind)&&!Ji(e.element)}function b4e(e){return"tag"in e}function x4e(e){return"kind"in e}function w4e(e){return"participant"in e}function k4e(e){return"not"in e}function _4e(e){return"and"in e}function S4e(e){return"or"in e}function Ou(e){switch(!0){case w4e(e):{const r=e.participant,n=Ou(e.operator);return E4e(r,n)}case b4e(e):{if(Qc(e.tag)||"eq"in e.tag){const n=Qc(e.tag)?e.tag:e.tag.eq;return o=>Array.isArray(o.tags)&&o.tags.includes(n)}const r=e.tag.neq;return n=>!Array.isArray(n.tags)||!n.tags.includes(r)}case x4e(e):{if(Qc(e.kind)||"eq"in e.kind){const n=Qc(e.kind)?e.kind:e.kind.eq;return o=>o.kind===n}const r=e.kind.neq;return n=>Xn(n.kind)||n.kind!==r}case k4e(e):{const r=Ou(e.not);return sO(r)}case _4e(e):{const r=e.and.map(Ou);return f4e(r)}case S4e(e):{const r=e.or.map(Ou);return g4e(r)}default:Qo(e)}}function E4e(e,r){return n=>{if(!n.source||!n.target)return!1;switch(e){case"source":return r(n.source);case"target":return r(n.target)}}}function C4e(e){return e._type==="dynamic"}function f1(...e){return ao(Object.entries,e)}function Lu(e,...r){return typeof e=="string"||typeof e=="number"||typeof e=="symbol"?n=>dO(n,e,...r):dO(e,...r)}function dO(e,...r){let n=e;for(let o of r){if(n==null)return;n=n[o]}return n}function Kb(...e){return ao($4e,e,R4e)}const $4e=(e,r)=>e.map(r),R4e=e=>(r,n,o)=>({done:!1,hasNext:!0,next:e(r,n,o)});function z4e(e,r){let n=r.length-e.length;if(n===1){let[o,...i]=r;return Ps(o,{lazy:e,lazyArgs:i})}if(n===0){let o={lazy:e,lazyArgs:r};return Object.assign(i=>Ps(i,o),o)}throw Error("Wrong number of arguments")}function Zb(...e){return z4e(T4e,e)}function T4e(){let e=new Set;return r=>e.has(r)?E_:(e.add(r),{done:!1,hasNext:!0,next:r})}var _8={},uO;function j4e(){return uO||(uO=1,(function(e){e.intersection=function(){if(arguments.length<2)throw new Error("mnemonist/Set.intersection: needs at least two arguments.");var r=new Set,n=1/0,o=null,i,a,l=arguments.length;for(a=0;an.size)return!1;for(;i=o.next(),!i.done;)if(!n.has(i.value))return!1;return!0},e.isSuperset=function(r,n){return e.isSubset(n,r)},e.add=function(r,n){for(var o=n.values(),i;i=o.next(),!i.done;)r.add(i.value)},e.subtract=function(r,n){for(var o=n.values(),i;i=o.next(),!i.done;)r.delete(i.value)},e.intersect=function(r,n){for(var o=r.values(),i;i=o.next(),!i.done;)n.has(i.value)||r.delete(i.value)},e.disjunct=function(r,n){for(var o=r.values(),i,a=[];i=o.next(),!i.done;)n.has(i.value)&&a.push(i.value);for(o=n.values();i=o.next(),!i.done;)r.has(i.value)||r.add(i.value);for(var l=0,s=a.length;ln.size&&(o=r,r=n,n=o),r.size===0)return 0;if(r===n)return r.size;for(var i=r.values(),a,l=0;a=i.next(),!a.done;)n.has(a.value)&&l++;return l},e.unionSize=function(r,n){var o=e.intersectionSize(r,n);return r.size+n.size-o},e.jaccard=function(r,n){var o=e.intersectionSize(r,n);if(o===0)return 0;var i=r.size+n.size-o;return o/i},e.overlap=function(r,n){var o=e.intersectionSize(r,n);return o===0?0:o/Math.min(r.size,n.size)}})(_8)),_8}var pO=j4e();function S8(...e){let r=new Set;for(const n of e)for(const o of n)r.add(o);return r}function Hh(e,...r){let n=new Set;if(e.size===0)return n;let o=Ll(r,2)?pO.intersection(...r):r[0];if(o.size===0)return n;for(const i of e)o.has(i)&&n.add(i);return n}function E8(e,r){if(e.size===0)return new Set;if(r.size===0)return new Set(e);let n=new Set;for(const o of e)r.has(o)||n.add(o);return n}function A4e(e,r){return e.size===r.size&&[...e].every(n=>r.has(n))}function D4e(e,r){return pO.symmetricDifference(e,r)}function m1(e){return e?hO(e):hO}function hO(e){const r=e[Symbol.iterator](),{value:n}=r.next();return n}const Qb=e=>typeof e=="function";function Is(e,r){const n=r??e;He(Qb(n));function*o(i){for(const a of i)n(a)&&(yield a)}return r?o(e):o}const fO={asc:(e,r)=>e>r,desc:(e,r)=>ee(a,i)}function C8(e,r,...n){let o=typeof e=="function"?e:e[0],i=typeof e=="function"?"asc":e[1],{[i]:a}=fO,l=r===void 0?void 0:C8(r,...n);return(s,c)=>{let d=o(s),u=o(c);return a(d,u)?1:a(u,d)?-1:l?.(s,c)??0}}function N4e(e){if(mO(e))return!0;if(typeof e!="object"||!Array.isArray(e))return!1;let[r,n,...o]=e;return mO(r)&&typeof n=="string"&&n in fO&&o.length===0}const mO=e=>typeof e=="function"&&e.length===1;function P4e(...e){return ao(B4e,e,I4e)}const B4e=(e,r)=>e.filter(r),I4e=e=>(r,n,o)=>e(r,n,o)?{done:!1,hasNext:!0,next:r}:E_;function gO(...e){return ao(O4e,e,L4e)}const O4e=(e,r)=>e.flatMap(r),L4e=e=>(r,n,o)=>{let i=e(r,n,o);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function $8(...e){return ao(F4e,e)}const F4e=(e,r)=>{let n=Object.create(null);for(let o=0;oPs(r,...e)}function vO(...e){return M4e(U4e,e)}const U4e=(e,r)=>[...e].sort(r);var bO=Symbol.for("immer-nothing"),xO=Symbol.for("immer-draftable"),Io=Symbol.for("immer-state");function Wa(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wi=Object,Uh=wi.getPrototypeOf,Jb="constructor",ex="prototype",T8="configurable",tx="enumerable",rx="writable",g1="value",nd=e=>!!e&&!!e[Io];function Os(e){return e?kO(e)||ox(e)||!!e[xO]||!!e[Jb]?.[xO]||ix(e)||ax(e):!1}var W4e=wi[ex][Jb].toString(),wO=new WeakMap;function kO(e){if(!e||!A8(e))return!1;const r=Uh(e);if(r===null||r===wi[ex])return!0;const n=wi.hasOwnProperty.call(r,Jb)&&r[Jb];if(n===Object)return!0;if(!Wh(n))return!1;let o=wO.get(n);return o===void 0&&(o=Function.toString.call(n),wO.set(n,o)),o===W4e}function y1(e,r,n=!0){v1(e)===0?(n?Reflect.ownKeys(e):wi.keys(e)).forEach(i=>{r(i,e[i],e)}):e.forEach((o,i)=>r(i,o,e))}function v1(e){const r=e[Io];return r?r.type_:ox(e)?1:ix(e)?2:ax(e)?3:0}var _O=(e,r,n=v1(e))=>n===2?e.has(r):wi[ex].hasOwnProperty.call(e,r),j8=(e,r,n=v1(e))=>n===2?e.get(r):e[r],nx=(e,r,n,o=v1(e))=>{o===2?e.set(r,n):o===3?e.add(n):e[r]=n};function G4e(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}var ox=Array.isArray,ix=e=>e instanceof Map,ax=e=>e instanceof Set,A8=e=>typeof e=="object",Wh=e=>typeof e=="function",D8=e=>typeof e=="boolean",Ls=e=>e.copy_||e.base_,M8=e=>e.modified_?e.copy_:e.base_;function N8(e,r){if(ix(e))return new Map(e);if(ax(e))return new Set(e);if(ox(e))return Array[ex].slice.call(e);const n=kO(e);if(r===!0||r==="class_only"&&!n){const o=wi.getOwnPropertyDescriptors(e);delete o[Io];let i=Reflect.ownKeys(o);for(let a=0;a1&&wi.defineProperties(e,{set:lx,add:lx,clear:lx,delete:lx}),wi.freeze(e),r&&y1(e,(n,o)=>{P8(o,!0)},!1)),e}function Y4e(){Wa(2)}var lx={[g1]:Y4e};function sx(e){return e===null||!A8(e)?!0:wi.isFrozen(e)}var cx="MapSet",B8="Patches",SO={};function Gh(e){const r=SO[e];return r||Wa(0,e),r}var X4e=e=>!!SO[e],b1,EO=()=>b1,K4e=(e,r)=>({drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:X4e(cx)?Gh(cx):void 0});function CO(e,r){r&&(e.patchPlugin_=Gh(B8),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function I8(e){O8(e),e.drafts_.forEach(Z4e),e.drafts_=null}function O8(e){e===b1&&(b1=e.parent_)}var $O=e=>b1=K4e(b1,e);function Z4e(e){const r=e[Io];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function RO(e,r){r.unfinalizedDrafts_=r.drafts_.length;const n=r.drafts_[0];if(e!==void 0&&e!==n){n[Io].modified_&&(I8(r),Wa(4)),Os(e)&&(e=zO(r,e));const{patchPlugin_:i}=r;i&&i.generateReplacementPatches_(n[Io].base_,e,r)}else e=zO(r,n);return Q4e(r,e,!0),I8(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==bO?e:void 0}function zO(e,r){if(sx(r))return r;const n=r[Io];if(!n)return L8(r,e.handledSet_,e);if(!dx(n,e))return r;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);AO(n,e)}return n.copy_}function Q4e(e,r,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&P8(r,n)}function TO(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var dx=(e,r)=>e.scope_===r,J4e=[];function jO(e,r,n,o){const i=Ls(e),a=e.type_;if(o!==void 0&&j8(i,o,a)===r){nx(i,o,n,a);return}if(!e.draftLocations_){const s=e.draftLocations_=new Map;y1(i,(c,d)=>{if(nd(d)){const u=s.get(d)||[];u.push(c),s.set(d,u)}})}const l=e.draftLocations_.get(r)??J4e;for(const s of l)nx(i,s,n,a)}function eke(e,r,n){e.callbacks_.push(function(i){const a=r;if(!a||!dx(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=M8(a);jO(e,a.draft_??a,l,n),AO(a,i)})}function AO(e,r){if(e.modified_&&!e.finalized_&&(e.type_===3||(e.assigned_?.size??0)>0)){const{patchPlugin_:o}=r;if(o){const i=o.getPath(e);i&&o.generatePatches_(e,i,r)}TO(e)}}function tke(e,r,n){const{scope_:o}=e;if(nd(n)){const i=n[Io];dx(i,o)&&i.callbacks_.push(function(){ux(e);const l=M8(i);jO(e,n,l,r)})}else Os(n)&&e.callbacks_.push(function(){const a=Ls(e);j8(a,r,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(r)??!1)===!0&&e.copy_&&L8(j8(e.copy_,r,e.type_),o.handledSet_,o)})}function L8(e,r,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||nd(e)||r.has(e)||!Os(e)||sx(e)||(r.add(e),y1(e,(o,i)=>{if(nd(i)){const a=i[Io];if(dx(a,n)){const l=M8(a);nx(e,o,l,e.type_),TO(a)}}else Os(i)&&L8(i,r,n)})),e}function rke(e,r){const n=ox(e),o={type_:n?1:0,scope_:r?r.scope_:EO(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=o,a=F8;n&&(i=[o],a=x1);const{revoke:l,proxy:s}=Proxy.revocable(i,a);return o.draft_=s,o.revoke_=l,[s,o]}var F8={get(e,r){if(r===Io)return e;const n=Ls(e);if(!_O(n,r,e.type_))return nke(e,n,r);const o=n[r];if(e.finalized_||!Os(o))return o;if(o===V8(e.base_,r)){ux(e);const i=e.type_===1?+r:r,a=H8(e.scope_,o,e,i);return e.copy_[i]=a}return o},has(e,r){return r in Ls(e)},ownKeys(e){return Reflect.ownKeys(Ls(e))},set(e,r,n){const o=DO(Ls(e),r);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const i=V8(Ls(e),r),a=i?.[Io];if(a&&a.base_===n)return e.copy_[r]=n,e.assigned_.set(r,!1),!0;if(G4e(n,i)&&(n!==void 0||_O(e.base_,r,e.type_)))return!0;ux(e),q8(e)}return e.copy_[r]===n&&(n!==void 0||r in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[r])||(e.copy_[r]=n,e.assigned_.set(r,!0),tke(e,r,n)),!0},deleteProperty(e,r){return ux(e),V8(e.base_,r)!==void 0||r in e.base_?(e.assigned_.set(r,!1),q8(e)):e.assigned_.delete(r),e.copy_&&delete e.copy_[r],!0},getOwnPropertyDescriptor(e,r){const n=Ls(e),o=Reflect.getOwnPropertyDescriptor(n,r);return o&&{[rx]:!0,[T8]:e.type_!==1||r!=="length",[tx]:o[tx],[g1]:n[r]}},defineProperty(){Wa(11)},getPrototypeOf(e){return Uh(e.base_)},setPrototypeOf(){Wa(12)}},x1={};y1(F8,(e,r)=>{x1[e]=function(){const n=arguments;return n[0]=n[0][0],r.apply(this,n)}}),x1.deleteProperty=function(e,r){return x1.set.call(this,e,r,void 0)},x1.set=function(e,r,n){return F8.set.call(this,e[0],r,n,e[0])};function V8(e,r){const n=e[Io];return(n?Ls(n):e)[r]}function nke(e,r,n){const o=DO(r,n);return o?g1 in o?o[g1]:o.get?.call(e.draft_):void 0}function DO(e,r){if(!(r in e))return;let n=Uh(e);for(;n;){const o=Object.getOwnPropertyDescriptor(n,r);if(o)return o;n=Uh(n)}}function q8(e){e.modified_||(e.modified_=!0,e.parent_&&q8(e.parent_))}function ux(e){e.copy_||(e.assigned_=new Map,e.copy_=N8(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var oke=class{constructor(r){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,o,i)=>{if(Wh(n)&&!Wh(o)){const l=o;o=n;const s=this;return function(d=l,...u){return s.produce(d,p=>o.call(this,p,...u))}}Wh(o)||Wa(6),i!==void 0&&!Wh(i)&&Wa(7);let a;if(Os(n)){const l=$O(this),s=H8(l,n,void 0);let c=!0;try{a=o(s),c=!1}finally{c?I8(l):O8(l)}return CO(l,i),RO(a,l)}else if(!n||!A8(n)){if(a=o(n),a===void 0&&(a=n),a===bO&&(a=void 0),this.autoFreeze_&&P8(a,!0),i){const l=[],s=[];Gh(B8).generateReplacementPatches_(n,a,{patches_:l,inversePatches_:s}),i(l,s)}return a}else Wa(1,n)},this.produceWithPatches=(n,o)=>{if(Wh(n))return(s,...c)=>this.produceWithPatches(s,d=>n(d,...c));let i,a;return[this.produce(n,o,(s,c)=>{i=s,a=c}),i,a]},D8(r?.autoFreeze)&&this.setAutoFreeze(r.autoFreeze),D8(r?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(r.useStrictShallowCopy),D8(r?.useStrictIteration)&&this.setUseStrictIteration(r.useStrictIteration)}createDraft(r){Os(r)||Wa(8),nd(r)&&(r=ike(r));const n=$O(this),o=H8(n,r,void 0);return o[Io].isManual_=!0,O8(n),o}finishDraft(r,n){const o=r&&r[Io];(!o||!o.isManual_)&&Wa(9);const{scope_:i}=o;return CO(i,n),RO(void 0,i)}setAutoFreeze(r){this.autoFreeze_=r}setUseStrictShallowCopy(r){this.useStrictShallowCopy_=r}setUseStrictIteration(r){this.useStrictIteration_=r}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(r,n){let o;for(o=n.length-1;o>=0;o--){const a=n[o];if(a.path.length===0&&a.op==="replace"){r=a.value;break}}o>-1&&(n=n.slice(o+1));const i=Gh(B8).applyPatches_;return nd(r)?i(r,n):this.produce(r,a=>i(a,n))}};function H8(e,r,n,o){const[i,a]=ix(r)?Gh(cx).proxyMap_(r,n):ax(r)?Gh(cx).proxySet_(r,n):rke(r,n);return(n?.scope_??EO()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=o,n&&o!==void 0?eke(n,a,o):a.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:d}=c;a.modified_&&d&&d.generatePatches_(a,[],c)}),i}function ike(e){return nd(e)||Wa(10,e),MO(e)}function MO(e){if(!Os(e)||sx(e))return e;const r=e[Io];let n,o=!0;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=N8(e,r.scope_.immer_.useStrictShallowCopy_),o=r.scope_.immer_.shouldUseStrictIteration()}else n=N8(e,!0);return y1(n,(i,a)=>{nx(n,i,MO(a))},o),r&&(r.finalized_=!1),n}var ake=new oke,Yh=ake.produce,NO=e=>e;function lke(e){return Ps(e,P4e(r=>!!r.notation),$8(Lu("notation")),R8(z8($8(Lu("shape")),R8(z8($8(Lu("color")),R8(z8(Kb(Lu("kind")),Zb())),f1(),Kb(([r,n])=>({kinds:n,color:r})))),f1(),gO(([r,n])=>n.map(({color:o,kinds:i})=>({shape:r,color:o,kinds:i}))))),f1(),gO(([r,n])=>n.map(({shape:o,color:i,kinds:a})=>({title:r,shape:o,color:i,kinds:a}))),vO(Lu("shape"),Lu("title"),[r=>r.kinds.length,"desc"]))}const wo=(e,r)=>e===r||Xn(e)&&Xn(r)?!1:!yb(e,r),px=5;function ske(e,r){e.color=r.color,e.kind=r.kind,e.navigateTo=r.navigateTo??null,e.links=r.links?[...r.links]:null,e.tags=[...r.tags],Xn(r.style.border)?delete e.style.border:e.style.border=r.style.border,V4e(r.style.opacity)?e.style.opacity=r.style.opacity:delete e.style.opacity,Xn(r.style.multiple)?delete e.style.multiple:e.style.multiple=r.style.multiple}function cke(e,r,n){if(wo(r.icon??"none",e.icon??"none")){const o=Ji(e.icon)&&e.icon!=="none";switch(!0){case(o&&Ji(r.icon)&&r.icon!=="none"):return e.icon=r.icon,!0;case(o&&(Xn(r.icon)||r.icon==="none")):return e.icon="none",!0;case(!o&&Ji(r.icon)&&r.icon!=="none"):return n?(e.icon=r.icon,!0):!1}}return!0}function U8(e,r){return e?"md"in r?(e.md=r.md,delete e.txt,e):("txt"in r&&(e.txt=r.txt,delete e.md),e):r}function dke(e,r,n){let o=!0;return wo(e.title,r.title)&&(n?e.title=r.title:o=!1),wo(e.description,r.description)&&(Xn(r.description)?delete e.description:n?e.description=U8(e.description,r.description):o=!1),wo(e.technology,r.technology)&&(Xn(r.technology)?delete e.technology:n?e.technology=r.technology:o=!1),o}function uke(e,r,n){return e.title=r.title,Xn(r.description)?delete e.description:e.description=U8(e.description,r.description),Xn(r.technology)?delete e.technology:e.technology=r.technology,!0}function PO(e,r){He(e.id===r.id,"applyManualLayout: view ids do not match"),He(e._stage==="layouted","applyManualLayout: expected layouted view"),He(r._stage==="layouted","applyManualLayout: expected layouted snapshot"),He(e._layout!=="manual","applyManualLayout: expected auto-layouted view");const n=new Set;e._type!==r._type&&n.add("type-changed");const o=new Map(e.nodes.map(u=>[u.id,u])),i=new Map(e.edges.map(u=>[u.id,u])),a=pke(r.nodes,o,n),l=hke(r.edges,i,n),s=lke(a),c=Object.assign({...r},{title:e.title??r.title,description:e.description??r.description,tags:e.tags?[...e.tags]:null,links:e.links?[...e.links]:null,[k8]:"manual",...s&&s.length>0?{notation:{nodes:s}}:{},nodes:a,edges:l});C4e(e)&&c._type==="dynamic"&&(c.variant=e.variant);const d=[...n];return Ll(d,1)?c.drifts=d:"drifts"in c&&delete c.drifts,c}function pke(e,r,n){const o=e.map(i=>{const a=r.get(i.id);return a&&r.delete(a.id),Yh(i,l=>{if(!a){l.drifts=["removed"],n.add("nodes-removed");return}ske(l,a);const s=new Set,c=i.children.length>0,d=a.children.length>0;(wo(l.modelRef,a.modelRef)||wo(l.deploymentRef,a.deploymentRef))&&s.add("modelRef-changed"),d&&!c&&s.add("became-compound"),!d&&c&&s.add("became-leaf"),wo(l.parent,a.parent)&&s.add("parent-changed");const u=l.width+px>=a.width&&l.height+px>=a.height;wo(l.shape,a.shape)&&(u?l.shape=a.shape:s.add("shape-changed")),cke(l,a,u&&d===c)||s.add("label-changed"),(c?uke:dke)(l,a,u)||s.add("label-changed"),wo(i.notation,a.notation)&&(l.notation=a.notation??null),c&&d&&D4e(new Set(i.children),new Set(a.children)).size>0&&s.add("children-changed");const f=[...s];Ll(f,1)?(n.add("nodes-drift"),l.drifts=f):delete l.drifts})});return r.size>0&&n.add("nodes-added"),o}function hke(e,r,n){const o=e.map(i=>{let a=r.get(i.id)??Ps(r.values(),Is(l=>l.source===i.source&&l.target===i.target),m1());return a&&r.delete(a.id),Yh(i,l=>{if(!a){l.drifts=["removed"],n.add("edges-removed");return}const s=new Set,c=i.id===a.id;switch(!0){case(c&&i.source==a.source&&i.target==a.target):{wo(l.dir??"forward",a.dir??"forward")&&s.add("direction-changed");break}case(c&&i.source==a.target&&i.target==a.source):{i.source!==i.target&&s.add("direction-changed");break}case c:{i.source!=a.source&&s.add("source-changed"),i.target!=a.target&&s.add("target-changed");break}default:{He(i.id!=a.id,"Unexpected case in edge drift detection, ids should not match"),He(i.source==a.source,"Unexpected case in edge drift detection, sources should match"),He(i.target==a.target,"Unexpected case in edge drift detection, targets should match"),wo(l.dir??"forward",a.dir??"forward")&&s.add("direction-changed");break}}l.color=a.color,l.line=a.line,l.navigateTo=a.navigateTo??null,l.tags=a.tags?[...a.tags]:null,wo(i.notes,a.notes)&&(Xn(i.notes)!==Xn(a.notes)&&s.add("notes-changed"),l.notes=a.notes??i.notes),a.astPath?l.astPath=a.astPath:delete l.astPath;const d=yO(i,["label","description","technology","labelBBox"]),u=yO(a,["label","description","technology","labelBBox"]);if(wo(d,u))switch(!0){case(a.labelBBox&&!i.labelBBox):{s.add("label-added");break}case(i.labelBBox&&!a.labelBBox):{s.add("label-removed");break}case(!!i.labelBBox&&!!a.labelBBox):{a.labelBBox.width*a.labelBBox.height>(i.labelBBox.width+px)*(i.labelBBox.height+px)&&(l.labelBBox.width=Math.round(a.labelBBox.width),l.labelBBox.height=Math.round(a.labelBBox.height)),wo(i.label,a.label)&&(Xn(a.label)!==Xn(i.label)&&s.add("label-changed"),l.label=a.label??i.label),wo(i.description,a.description)&&(Xn(a.description)!==Xn(i.description)&&s.add("label-changed"),a.description&&(l.description=U8(i.description,a.description))),wo(i.technology,a.technology)&&(Xn(a.technology)!==Xn(i.technology)&&s.add("label-changed"),l.technology=a.technology??i.technology??null);break}default:He(!i.labelBBox,"Unexpected case in edge labelBBox drift detection"),He(!a.labelBBox,"Unexpected case in next labelBBox drift detection");break}const p=[...s];Ll(p,1)?(n.add("edges-drift"),l.drifts=p):delete l.drifts})});return r.size>0&&n.add("edges-added"),o}function fke(e,r){const{drifts:n,...o}=PO(e,r);if(n){const i=new Set;n.includes("type-changed")&&i.add("type-changed");const a=new Map(o.nodes.map(u=>[u.id,u])),l=new Map(o.edges.map(u=>[u.id,u])),s=e.nodes.map(u=>{const p=a.get(u.id);return p&&a.delete(p.id),Yh(u,f=>{if(!p){i.add("nodes-added"),f.drifts=["added"];return}p.drifts?(i.add("nodes-drift"),f.drifts=[...p.drifts]):delete f.drifts})});a.size>0&&i.add("nodes-removed");const c=e.edges.map(u=>{const p=l.get(u.id)??Ps(l.values(),Is(f=>f.source===u.source&&f.target===u.target),m1());return p&&l.delete(p.id),Yh(u,f=>{if(!p){i.add("edges-added"),f.drifts=["added"];return}p.drifts?(i.add("edges-drift"),f.drifts=[...p.drifts]):delete f.drifts})});l.size>0&&i.add("edges-removed");const d=[...i];return Yh(e,u=>{Ll(d,1)?u.drifts=d:delete u.drifts,u.nodes=NO(s),u.edges=NO(c),u[k8]="auto"})}return Yh(e,i=>{delete i.drifts,i[k8]="auto"})}function Fs(e){return e.summary??e.description}function Xh(e){return e.description??e.summary}const w1="@group";function mke(e){return e.kind===w1}function BO(e,r){return He(typeof e=="string"&&e!=""),"@"+e+"."+r}function gke(e){return e.startsWith("@")}function yke(e){if(!e.startsWith("@"))return[null,e];const r=e.indexOf(".");if(r<2)throw new Error("Invalid global FQN");const n=e.slice(1,r),o=e.slice(r+1);return[n,o]}function k1(e){return e.startsWith("step-")}function IO(e){if(!k1(e))throw new Error(`Invalid step edge id: ${e}`);return parseFloat(e.slice(5))}function vke(...e){return ao(bke,e)}function bke(e,r){let n={...e};for(let[o,i]of Object.entries(n))r(i,o,e)&&delete n[o];return n}var W8={},OO;function G8(){return OO||(OO=1,(function(e){var r=Math.pow(2,8)-1,n=Math.pow(2,16)-1,o=Math.pow(2,32)-1,i=Math.pow(2,7)-1,a=Math.pow(2,15)-1,l=Math.pow(2,31)-1;e.getPointerArray=function(c){var d=c-1;if(d<=r)return Uint8Array;if(d<=n)return Uint16Array;if(d<=o)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},e.getSignedPointerArray=function(c){var d=c-1;return d<=i?Int8Array:d<=a?Int16Array:d<=l?Int32Array:Float64Array},e.getNumberType=function(c){return c===(c|0)?Math.sign(c)===-1?c<=127&&c>=-128?Int8Array:c<=32767&&c>=-32768?Int16Array:Int32Array:c<=255?Uint8Array:c<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(c,d){var u=null,p=0,f,g,v,w,x;for(w=0,x=c.length;wp&&(p=f,u=g);return u},e.isTypedArray=function(c){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(c)},e.concat=function(){var c=0,d,u,p;for(d=0,p=arguments.length;d"u"))return this.splayOnTop(l),this.V[l]},i.prototype.peek=function(a){var l=this.items[a];if(!(typeof l>"u"))return this.V[l]},i.prototype.forEach=function(a,l){l=arguments.length>1?l:this;for(var s=0,c=this.size,d=this.head,u=this.K,p=this.V,f=this.forward;s=l)return{done:!0};var u=c[s];return a++,a=l)return{done:!0};var u=c[s];return a++,a=l)return{done:!0};var p=c[s],f=d[s];return a++,a"u"))return this.splayOnTop(l),this.V[l]},i.prototype.peek=function(a){var l=this.items.get(a);if(!(typeof l>"u"))return this.V[l]},i.prototype.splayOnTop=e.prototype.splayOnTop,i.prototype.forEach=e.prototype.forEach,i.prototype.keys=e.prototype.keys,i.prototype.values=e.prototype.values,i.prototype.entries=e.prototype.entries,typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=i.prototype.entries),i.prototype.inspect=e.prototype.inspect,i.from=function(a,l,s,c){if(arguments.length<2){if(c=o.guessLength(a),typeof c!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(c=l,l=null,s=null);var d=new i(l,s,c);return r(a,function(u,p){d.set(p,u)}),d},X8=i,X8}var kke=wke();const HO=Qg(kke);function _1(e){return vke(e,r=>r===void 0)}const _ke=Symbol.for("text"),Ske=Symbol.for("html"),Vs="",UO=new HO(500),WO=new HO(500);class ur{static getOrCreateFromText(r){if(r.trim()===Vs)return ur.EMPTY;let n=WO.get(r);return n||(n=new ur({txt:r}),WO.set(r,n),n)}static getOrCreateFromMarkdown(r){if(r.trim()===Vs)return ur.EMPTY;let n=UO.get(r);return n||(n=new ur({md:r}),UO.set(r,n),n)}static memoize(r,n,o){return ar(r,n,()=>ur.from(o))}static from(r){return r==null||r===ur.EMPTY?ur.EMPTY:r instanceof ur?r:typeof r=="string"?this.getOrCreateFromText(r):"isEmpty"in r&&r.isEmpty?ur.EMPTY:"md"in r?this.getOrCreateFromMarkdown(r.md):this.getOrCreateFromText(r.txt)}static EMPTY=new class extends ur{isEmpty=!0;nonEmpty=!1;isMarkdown=!1;$source=null;constructor(){super({txt:Vs})}get text(){return null}get md(){return null}get html(){return null}};$source;isEmpty;nonEmpty;isMarkdown;constructor(r){this.isMarkdown=!1,typeof r=="string"?(this.$source={txt:r},this.isEmpty=r.trim()===Vs):(this.$source=r,this.isEmpty=!0,"md"in r?(this.isEmpty=r.md===Vs,this.isMarkdown=!0):this.isEmpty=r.txt===Vs),this.nonEmpty=!this.isEmpty}get text(){if(this.isEmpty||this.$source===null)return Vs;const r=this.$source;return"txt"in r?r.txt:ar(this,_ke,()=>c4e(r.md))}get md(){if(this.isEmpty||this.$source===null)return Vs;const r=this.$source;if("md"in r)return r.md;if("txt"in r)return r.txt;Qo(r)}get html(){if(this.isEmpty||this.$source===null)return Vs;const r=this.$source;return"txt"in r?r.txt:ar(this,Ske,()=>s4e(r.md))}equals(r){return this===r?!0:r instanceof ur?this.isEmpty&&r.isEmpty?!0:this.isEmpty!==r.isEmpty||this.isMarkdown!==r.isMarkdown?!1:this.isMarkdown?this.$source?.md===r.$source?.md:this.$source?.txt===r.$source?.txt:!1}}var S1;(e=>{function r(c){return"model"in c&&!("project"in c)}e.isElementRef=r;function n(c){return"project"in c&&"model"in c}e.isImportRef=n;function o(c){if(Qc(c))throw new Error(`Expected FqnRef, got: "${c}"`);if(n(c))return BO(c.project,c.model);if(r(c))return c.model;throw new Error("Expected FqnRef.ModelRef or FqnRef.ImportRef")}e.flatten=o;function i(c){return r(c)||n(c)}e.isModelRef=i;function a(c){return"deployment"in c&&"element"in c}e.isInsideInstanceRef=a;function l(c){return"deployment"in c&&!("element"in c)}e.isDeploymentElementRef=l;function s(c){return l(c)||a(c)}e.isDeploymentRef=s})(S1||(S1={}));var ko;(e=>{function r({x:u,y:p,width:f,height:g}){return{x:u+f/2,y:p+g/2}}e.center=r;function n({x:u,y:p,width:f,height:g}){return[{x:u,y:p},{x:u+f,y:p},{x:u+f,y:p+g},{x:u,y:p+g}]}e.toPoints=n;function o(u){const{x1:p,y1:f,x2:g,y2:v}=K8.fromPoints(u);return{x:p,y:f,width:g-p,height:v-f}}e.fromPoints=o;function i(...u){if(He(Ll(u,1),"No boxes provided"),u.length===1)return u[0];let p=u[0].x,f=u[0].y,g=u[0].x+u[0].width,v=u[0].y+u[0].height;for(let w=1;w=p.x+p.width&&u.y+u.height>=p.y+p.height}e.includes=d})(ko||(ko={}));var K8;(e=>{function r({x1:l,y1:s,x2:c,y2:d}){return{x:(l+c)/2,y:(s+d)/2}}e.center=r;function n(l){He(l.length>0,"At least one point is required");let s=1/0,c=1/0,d=-1/0,u=-1/0;for(const[p,f]of l)s=Math.min(s,p),c=Math.min(c,f),d=Math.max(d,p),u=Math.max(u,f);return{x1:s,y1:c,x2:d,y2:u}}e.fromPoints=n;function o(...l){He(l.length>0,"No boxes provided");let s=1/0,c=1/0,d=-1/0,u=-1/0;for(const p of l)s=Math.min(s,p.x1),c=Math.min(c,p.y1),d=Math.max(d,p.x2),u=Math.max(u,p.y2);return{x1:s,y1:c,x2:d,y2:u}}e.merge=o;function i(l){return{x:l.x1,y:l.y1,width:l.x2-l.x1,height:l.y2-l.y1}}e.toBBox=i;function a(l,s){return l===s?!0:l.x1<=s.x1&&l.y1<=s.y1&&l.x2>=s.x2&&l.y2>=s.y2}e.includes=a})(K8||(K8={}));class ki{constructor(r,n){this.x=r,this.y=n}static create(...r){return r.length===2?new ki(r[0],r[1]):new ki(r[0].x,r[0].y)}static add(r,n){return{x:r.x+n.x,y:r.y+n.y}}static subtract(r,n){return{x:r.x-n.x,y:r.y-n.y}}static multiply(r,n){return{x:r.x*n,y:r.y*n}}static divide(r,n){return{x:r.x/n,y:r.y/n}}static dot(r,n){return r.x*n.x+r.y*n.y}add(r){return new ki(this.x+r.x,this.y+r.y)}subtract(r){return new ki(this.x-r.x,this.y-r.y)}multiply(r){return new ki(this.x*r,this.y*r)}divide(r){return new ki(this.x/r,this.y/r)}dot(r){return this.x*r.x+this.y*r.y}cross(r){return this.x*r.y-this.y*r.x}length(){return this.x===0&&this.y===0?0:Math.sqrt(this.x**2+this.y**2)}normalize(){const r=this.length();return r===0?new ki(0,0):new ki(this.x/r,this.y/r)}round(){return new ki(Math.round(this.x),Math.round(this.y))}toObject(){return{x:this.x,y:this.y}}}function Qr(...e){return e.length===1&&e[0]instanceof ki?e[0]:e.length===2?new ki(e[0],e[1]):new ki(e[0].x,e[0].y)}function Z8(e){return k1(e)&&e.includes(".")?e.slice(0,e.indexOf(".")+1):null}function GO(e){const r=typeof e=="string"?e:e.color;return r.startsWith("#")||r.startsWith("rgb")}function Q8(...e){return ao(Eke,e)}function Eke(e,r){let n=[...e];return n.sort(r),n}const Cke=["tomato","grass","blue","ruby","orange","indigo","pink","teal","purple","amber","crimson","red","lime","yellow","violet"];function $ke(e,r,n){let o=e.get(r);return o||(o=n(r),e.set(r,o)),o}function Rke(e){let r=5381;const n=e.length;He(n>0,"stringHash: empty string");for(let o=0;o>>0).toString(36)}function E1(e,r){const n=r??e;He(Qb(n));function o(i){for(const a of i)if(n(a))return a}return r?o(e):o}function zke(e,r){const n=e;He(Qb(n));function*o(i){for(const a of i)yield n(a)}return o}function C1(e){return e?Array.from(e):r=>Array.from(r)}function Tke(e){return e?new Set(e):r=>new Set(r)}function YO(e,r){const n=r??e;He(Qb(n));function o(i){for(const a of i)if(n(a))return!0;return!1}return r?o(e):o}function jke(e,r){const n=e;He(n>=0,"Count must be a non-negative number");function*o(i){let a=0;for(const l of i){if(a>=n)break;yield l,a++}}return i=>o(i)}function Ake(e,r){let n=Math.ceil(e),o=Math.floor(r);if(o{setTimeout(()=>{n(Dke)},r??100)})}function hx(e){const r=Jc([...e]),n=new Set(r),o=new Map(r.map(l=>[l._literalId,l])),i=new Ln(()=>null),a=r.reduce((l,s,c,d)=>(l.set(s,d.slice(c+1).filter(tB(s)).map(u=>(n.delete(u),u)).reduce((u,p)=>(u.some(Yn(p))||(u.push(p),i.set(p,s)),u),[])),l),new Ln(()=>[]));return{sorted:r,byId:l=>mt(o.get(l),`Element not found by id: ${l}`),root:n,parent:l=>i.get(l),children:l=>a.get(l),flatten:()=>new Set([...n,...r.reduce((l,s)=>{const c=a.get(s);return c.length===0?(l.push(s),l):(c.length>1&&l.push(...c),l)},[])])}}const J8=(e,r)=>e.size>2&&r.size!==e.size?new Set(Jc([...hx(e).flatten(),...r])):e.size>1?new Set(Jc([...e])):e;function KO(e,r,n){const o=c=>r.has(c);let i=new Set([e]);const a={incomers:new Set,subjects:new Set([e]),outgoers:new Set};let l=new Set(n.incoming.flatMap(c=>{if(a.subjects.add(c.target),a.incomers.add(c.source),i.add(c.target),c.target!==e){let p=c.target.parent;for(;p&&p!==e;)i.add(p),p=p.parent}let d=c.source;const u=[];for(;u.push(d),!(o(d)||!d.parent);)d=d.parent;return u})),s=new Set(n.outgoing.flatMap(c=>{if(a.subjects.add(c.source),a.outgoers.add(c.target),i.add(c.source),c.source!==e){let p=c.source.parent;for(;p&&p!==e;)i.add(p),p=p.parent}let d=c.target;const u=[];for(;u.push(d),!(o(d)||!d.parent);)d=d.parent;return u}));return{incomers:J8(l,a.incomers),incoming:new Set(n.incoming),subjects:J8(i,a.subjects),outgoing:new Set(n.outgoing),outgoers:J8(s,a.outgoers)}}function ZO(e,r,n,o="global"){const i=n?r.findView(n):null;if(o==="view")return He(i,'Scope view id is required when scope is "view"'),Mke(e,i,r);const a=r.element(e),l=Tke(a.ascendingSiblings());return KO(a,l,{incoming:[...a.incoming()],outgoing:[...a.outgoing()]})}function Mke(e,r,n){const o=n.element(e);let i={incoming:C1(Is(o.incoming(),s=>r.includesRelation(s.id))),outgoing:C1(Is(o.outgoing(),s=>r.includesRelation(s.id)))};const a=tB(o),l=new Set([...o.ascendingSiblings(),...Ps(r.elements(),zke(s=>s.element),Is(s=>s!==o&&a(s)))]);return KO(o,l,i)}var QO;(e=>{e.isInside=r=>n=>Yn(r,n.source.id)&&Yn(r,n.target.id),e.isDirectedBetween=(r,n)=>o=>(o.source.id===r||Yn(r,o.source.id))&&(o.target.id===n||Yn(n,o.target.id)),e.isAnyBetween=(r,n)=>{const o=(0,e.isDirectedBetween)(r,n),i=(0,e.isDirectedBetween)(n,r);return a=>o(a)||i(a)},e.isIncoming=r=>n=>(n.target.id===r||Yn(r,n.target.id))&&!Yn(r,n.source.id),e.isOutgoing=r=>n=>(n.source.id===r||Yn(r,n.source.id))&&!Yn(r,n.target.id),e.isAnyInOut=r=>{const n=(0,e.isIncoming)(r),o=(0,e.isOutgoing)(r);return i=>n(i)||o(i)}})(QO||(QO={}));const Nke=Symbol.for("nodejs.util.inspect.custom");function $1(e){return e===""||e===void 0?!0:Array.isArray(e)?e.length===0:Object.keys(e).length===0}function e7(...e){return ao(Pke,e)}function Pke(e,r){if(e===r||Object.is(e,r))return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;if(e instanceof Map&&r instanceof Map)return Bke(e,r);if(e instanceof Set&&r instanceof Set)return Ike(e,r);let n=Object.keys(e);if(n.length!==Object.keys(r).length)return!1;for(let o of n){if(!Object.hasOwn(r,o))return!1;let{[o]:i}=e,{[o]:a}=r;if(i!==a||!Object.is(i,a))return!1}return!0}function Bke(e,r){if(e.size!==r.size)return!1;for(let[n,o]of e){let i=r.get(n);if(o!==i||!Object.is(o,i))return!1}return!0}function Ike(e,r){if(e.size!==r.size)return!1;for(let n of e)if(!r.has(n))return!1;return!0}class JO{Aux;get style(){return ar(this,"style",()=>_1({shape:this.$model.$styles.defaults.shape,color:this.$model.$styles.defaults.color,border:this.$model.$styles.defaults.border,opacity:this.$model.$styles.defaults.opacity,size:this.$model.$styles.defaults.size,padding:this.$model.$styles.defaults.padding,textSize:this.$model.$styles.defaults.text,...this.$node.style}))}get name(){return Jg(this.id)}get shape(){return this.style.shape}get color(){return this.style.color}get icon(){return this.style.icon??null}get summary(){return ur.memoize(this,"summary",Fs(this.$node))}get description(){return ur.memoize(this,"description",Xh(this.$node))}get technology(){return this.$node.technology??null}get links(){return this.$node.links??[]}ancestors(){return this.$model.ancestors(this)}commonAncestor(r){const n=t1(this.id,r.id);return n?this.$model.node(n):null}siblings(){return this.$model.siblings(this)}isSibling(r){return this.parent===r.parent}*ascendingSiblings(){yield*this.siblings();for(const r of this.ancestors())yield*r.siblings()}*descendingSiblings(){for(const r of[...this.ancestors()].reverse())yield*r.siblings();yield*this.siblings()}incoming(r="all"){return this.$model.incoming(this,r)}outgoing(r="all"){return this.$model.outgoing(this,r)}*incomers(r="all"){const n=new Set;for(const o of this.incoming(r))n.has(o.source.id)||(n.add(o.source.id),yield o.source)}*outgoers(r="all"){const n=new Set;for(const o of this.outgoing(r))n.has(o.target.id)||(n.add(o.target.id),yield o.target)}*views(){for(const r of this.$model.views())r._type==="deployment"&&r.includesDeployment(this.id)&&(yield r)}isDeploymentNode(){return!1}isInstance(){return!1}get allOutgoing(){return ar(this,Symbol.for("allOutgoing"),()=>od.from(new Set(this.outgoingModelRelationships()),new Set(this.outgoing())))}get allIncoming(){return ar(this,Symbol.for("allIncoming"),()=>od.from(new Set(this.incomingModelRelationships()),new Set(this.incoming())))}hasMetadata(){return!!this.$node.metadata&&!$1(this.$node.metadata)}getMetadata(r){return r?this.$node.metadata?.[r]:this.$node.metadata??{}}isTagged(r){return this.tags.includes(r)}}class eL extends JO{constructor(r,n){super(),this.$model=r,this.$node=n,this.id=n.id,this._literalId=n.id,this.title=n.title,this.hierarchyLevel=Tb(n.id)}id;_literalId;title;hierarchyLevel;get parent(){return this.$model.parent(this)}get kind(){return this.$node.kind}get tags(){return ar(this,Symbol.for("tags"),()=>Zb([...this.$node.tags??[],...this.$model.$model.specification.deployments[this.kind]?.tags??[]]))}children(){return this.$model.children(this)}descendants(r="desc"){return this.$model.descendants(this,r)}isDeploymentNode(){return!0}*instances(){for(const r of this.descendants("desc"))r.isInstance()&&(yield r)}onlyOneInstance(){const r=this.children();if(r.size!==1)return null;const n=m1(r);return n?n.isInstance()?n:n.onlyOneInstance():null}_relationshipsFromInstances=null;relationshipsFromInstances(){if(this._relationshipsFromInstances)return this._relationshipsFromInstances;const{outgoing:r,incoming:n}=this._relationshipsFromInstances={outgoing:new Set,incoming:new Set};for(const o of this.instances()){for(const i of o.element.outgoing())r.add(i);for(const i of o.element.incoming())n.add(i)}return this._relationshipsFromInstances}outgoingModelRelationships(){return this.relationshipsFromInstances().outgoing.values()}incomingModelRelationships(){return this.relationshipsFromInstances().incoming.values()}internalModelRelationships(){const{outgoing:r,incoming:n}=this.relationshipsFromInstances();return Hh(n,r)}}class tL extends JO{constructor(r,n,o){super(),this.$model=r,this.$instance=n,this.element=o,this.id=n.id,this._literalId=n.id,this.title=n.title??o.title,this.hierarchyLevel=Tb(n.id)}id;_literalId;title;hierarchyLevel;get $node(){return this.$instance}get parent(){return mt(this.$model.parent(this),`Parent of ${this.id} not found`)}get style(){return ar(this,"style",()=>_1({shape:this.$model.$styles.defaults.shape,color:this.$model.$styles.defaults.color,border:this.$model.$styles.defaults.border,opacity:this.$model.$styles.defaults.opacity,size:this.$model.$styles.defaults.size,padding:this.$model.$styles.defaults.padding,textSize:this.$model.$styles.defaults.text,...this.element.$element.style,...this.$instance.style}))}get tags(){return ar(this,Symbol.for("tags"),()=>Zb([...this.$instance.tags??[],...this.element.tags]))}get kind(){return this.element.kind}get summary(){return ur.memoize(this,"summary",Fs(this.$instance)??Fs(this.element.$element))}get description(){return ur.memoize(this,"description",Xh(this.$instance)??Xh(this.element.$element))}get technology(){return this.$instance.technology??this.element.technology??null}get links(){return this.$instance.links??this.element.links}isInstance(){return!0}outgoingModelRelationships(){return this.element.outgoing()}incomingModelRelationships(){return this.element.incoming()}*views(){for(const r of this.$model.views())if(r._type==="deployment"){if(r.includesDeployment(this.id)){yield r;continue}r.includesDeployment(this.parent.id)&&this.parent.onlyOneInstance()&&(yield r)}}}class Oke{constructor(r,n){this.instance=r,this.element=n}get id(){return this.instance.id}get _literalId(){return this.instance.id}get style(){return ar(this,"style ",()=>({shape:this.element.shape,color:this.element.color,...this.element.$element.style}))}get shape(){return this.element.shape}get color(){return this.element.color}get title(){return this.element.title}get summary(){return this.element.summary}get description(){return this.element.description}get technology(){return this.element.technology}isDeploymentNode(){return!1}isInstance(){return!1}}class Lke{constructor(r,n){this.$model=r,this.$relationship=n,this.source=r.deploymentRef(n.source),this.target=r.deploymentRef(n.target);const o=t1(this.source.id,this.target.id);this.boundary=o?this.$model.node(o):null}boundary;source;target;get id(){return this.$relationship.id}get expression(){return`${this.source.id} -> ${this.target.id}`}get title(){return Ji(this.$relationship.title)?this.$relationship.title:null}get technology(){return this.$relationship.technology??null}get hasSummary(){return!!this.$relationship.summary&&!!this.$relationship.description&&!e7(this.$relationship.summary,this.$relationship.description)}get summary(){return ur.memoize(this,"summary",Fs(this.$relationship))}get description(){return ur.memoize(this,"description",Xh(this.$relationship))}get tags(){return this.$relationship.tags??[]}get kind(){return this.$relationship.kind??null}get navigateTo(){return this.$relationship.navigateTo?this.$model.$model.view(this.$relationship.navigateTo):null}get links(){return this.$relationship.links??[]}get color(){return this.$relationship.color??this.$model.$styles.defaults.relationship.color}get line(){return this.$relationship.line??this.$model.$styles.defaults.relationship.line}get head(){return this.$relationship.head??this.$model.$styles.defaults.relationship.arrow}get tail(){return this.$relationship.tail}*views(){for(const r of this.$model.views())r.includesRelation(this.id)&&(yield r)}isDeploymentRelation(){return!0}isModelRelation(){return!1}hasMetadata(){return!!this.$relationship.metadata&&!$1(this.$relationship.metadata)}getMetadata(r){return r?this.$relationship.metadata?.[r]:this.$relationship.metadata??{}}isTagged(r){return this.tags.includes(r)}}class od{constructor(r=new Set,n=new Set){this.model=r,this.deployment=n}static empty(){return new od}static from(r,n){return new od(new Set(r),new Set(n))}get isEmpty(){return this.model.size===0&&this.deployment.size===0}get nonEmpty(){return this.model.size>0||this.deployment.size>0}get size(){return this.model.size+this.deployment.size}intersect(r){return od.from(Hh(this.model,r.model),Hh(this.deployment,r.deployment))}difference(r){return od.from(E8(this.model,r.model),E8(this.deployment,r.deployment))}union(r){return od.from(S8(this.model,r.model),S8(this.deployment,r.deployment))}}function rL(e,r){return n=>e.source===n.source&&e.target===n.target}function t7(e,r,n="directed"){if(e===r)return[];if(eB(e,r))return[];const o=Hh(e.allOutgoing,r.allIncoming),i=o.size>0?new ea(e,r,o):null;if(n==="directed")return i?[i]:[];const a=Hh(e.allIncoming,r.allOutgoing),l=a.size>0?new ea(r,e,a):null;return i&&l?[i,l]:i?[i]:l?[l]:[]}function nL(e,r,n="both"){if(e.allIncoming.size===0&&e.allOutgoing.size===0)return[];const o=[],i=[];for(const a of r)if(e!==a)for(const l of t7(e,a,n))l.source===e?o.push(l):i.push(l);return[...o,...i]}function Fke(e){return[...e].reduce((r,n,o,i)=>(o===i.length-1||r.push(...nL(n,i.slice(o+1),"both")),r),[])}const Vke={__proto__:null,findConnection:t7,findConnectionsBetween:nL,findConnectionsWithin:Fke};class ea{constructor(r,n,o=new Set){this.source=r,this.target=n,this.relations=o,this.id=Rke(`model:${r.id}:${n.id}`)}id;_boundary;get boundary(){return this._boundary??=this.source.commonAncestor(this.target)}get expression(){return`${this.source.id} -> ${this.target.id}`}get isDirect(){return this.nonEmpty()&&!this.isImplicit}get isImplicit(){return this.nonEmpty()&&YO(this.relations,sO(rL(this)))}get directRelations(){return new Set(Is(this.relations,rL(this)))}nonEmpty(){return this.relations.size>0}mergeWith(r){return He(this.source.id===r.source.id,"Cannot merge connections with different sources"),He(this.target.id===r.target.id,"Cannot merge connections with different targets"),new ea(this.source,this.target,S8(this.relations,r.relations))}difference(r){return new ea(this.source,this.target,E8(this.relations,r.relations))}intersect(r){return He(r instanceof ea,"Cannot intersect connection with different type"),new ea(this.source,this.target,Hh(this.relations,r.relations))}equals(r){He(r instanceof ea,"Cannot merge connection with different type");const n=r;return this.id===n.id&&this.source.id===n.source.id&&this.target.id===n.target.id&&A4e(this.relations,n.relations)}update(r){return new ea(this.source,this.target,r)}[Nke](r,n,o){const i=this.toString();return Object.defineProperty(i,"constructor",{value:ea,enumerable:!1}),i}toString(){return[this.expression,this.relations.size?" relations:":" relations: [ ]",...[...this.relations].map(r=>" "+r.expression)].join(` +`)}reversed(r=!1){if(!r)return new ea(this.target,this.source);const[n]=t7(this.target,this.source,"directed");return n??new ea(this.target,this.source,new Set)}}function qke(e){if(e==null||e==="")return!0;if(typeof e!="object")return!1;if("length"in e&&typeof e.length=="number")return e.length===0;if("size"in e&&typeof e.size=="number")return e.size===0;for(let r in e)return!1;return Object.getOwnPropertySymbols(e).length===0}function Hke(...e){return ao(Uke,e)}const Uke=e=>e.at(-1);function oL(e,r,n){return typeof r=="number"||r===void 0?o=>o.split(e,r):e.split(r,n)}function fx(...e){return ao(Object.values,e)}class mx{constructor(r,n){this.$model=r,this.$element=n,this.id=this.$element.id,this._literalId=this.$element.id;const[o,i]=yke(this.id);o?(this.imported={from:o,fqn:i},this.hierarchyLevel=Tb(i)):(this.imported=null,this.hierarchyLevel=Tb(this.id))}Aux;id;_literalId;hierarchyLevel;imported;get name(){return Jg(this.id)}get parent(){return this.$model.parent(this)}get kind(){return this.$element.kind}get shape(){return this.style.shape}get color(){return this.style.color}get icon(){return this.style.icon??null}get tags(){return ar(this,Symbol.for("tags"),()=>Zb([...this.$element.tags??[],...this.$model.specification.elements[this.$element.kind]?.tags??[]]))}get title(){return this.$element.title}get hasSummary(){return!!this.$element.summary&&!!this.$element.description&&!e7(this.$element.summary,this.$element.description)}get summary(){return ur.memoize(this,"summary",Fs(this.$element))}get description(){return ur.memoize(this,"description",Xh(this.$element))}get technology(){return this.$element.technology??null}get links(){return this.$element.links??[]}get defaultView(){return ar(this,Symbol.for("defaultView"),()=>m1(this.scopedViews())??null)}get isRoot(){return this.parent===null}get style(){return ar(this,"style",()=>_1({shape:this.$model.$styles.defaults.shape,color:this.$model.$styles.defaults.color,border:this.$model.$styles.defaults.border,opacity:this.$model.$styles.defaults.opacity,size:this.$model.$styles.defaults.size,padding:this.$model.$styles.defaults.padding,textSize:this.$model.$styles.defaults.text,...this.$element.style}))}isAncestorOf(r){return Yn(this,r)}isDescendantOf(r){return Yn(r,this)}ancestors(){return this.$model.ancestors(this)}commonAncestor(r){const n=t1(this.id,r.id);return n?this.$model.element(n):null}children(){return this.$model.children(this)}descendants(r){return r?rB([...this.$model.descendants(this)],r)[Symbol.iterator]():this.$model.descendants(this)}siblings(){return this.$model.siblings(this)}*ascendingSiblings(){yield*this.siblings();for(const r of this.ancestors())yield*r.siblings()}*descendingSiblings(){for(const r of[...this.ancestors()].reverse())yield*r.siblings();yield*this.siblings()}incoming(r="all"){return this.$model.incoming(this,r)}*incomers(r="all"){const n=new Set;for(const o of this.incoming(r))n.has(o.source.id)||(n.add(o.source.id),yield o.source)}outgoing(r="all"){return this.$model.outgoing(this,r)}*outgoers(r="all"){const n=new Set;for(const o of this.outgoing(r))n.has(o.target.id)||(n.add(o.target.id),yield o.target)}get allOutgoing(){return ar(this,Symbol.for("allOutgoing"),()=>new Set(this.outgoing()))}get allIncoming(){return ar(this,Symbol.for("allIncoming"),()=>new Set(this.incoming()))}views(){return ar(this,Symbol.for("views"),()=>{const r=new Set;for(const n of this.$model.views())n.includesElement(this.id)&&r.add(n);return r})}scopedViews(){return ar(this,Symbol.for("scopedViews"),()=>{const r=new Set;for(const n of this.$model.views())n.isScopedElementView()&&n.viewOf.id===this.id&&r.add(n);return r})}isDeployed(){return Ji(m1(this.deployments()))}deployments(){return this.$model.deployment.instancesOf(this)}hasMetadata(){return!!this.$element.metadata&&!$1(this.$element.metadata)}getMetadata(r){return r?this.$element.metadata?.[r]:this.$element.metadata??{}}isTagged(r){return this.tags.includes(r)}}const yr=e=>typeof e=="string"?e:e.id,_i="/",r7=e=>{if(He(!e.includes(` +`),"View title cannot contain newlines"),e.includes(_i)){const r=e.split(_i).map(n=>n.trim()).filter(n=>n.length>0);return Ll(r,1)?r:[""]}return[e.trim()]},gx=e=>r7(e).join(_i),Wke=e=>{const r=r7(e);return Ll(r,2)?r.slice(0,-1).join(_i):null},n7=e=>e.includes(_i)?r7(e).pop()??e:e.trim();class Gke{constructor(r){this.$model=r;const n=this.$deployments=r.$data.deployments,o=fx(n.elements);for(const i of Jc(o)){const a=this.addElement(i);for(const l of a.tags)this.#c.get(l).add(a);a.isInstance()&&this.#r.get(a.element.id).add(a)}for(const i of fx(n.relations)){const a=this.addRelation(i);for(const l of a.tags)this.#c.get(l).add(a)}}#e=new Map;#a=new Map;#t=new Ln(()=>new Set);#r=new Ln(()=>new Set);#l=new Set;#n=new Map;#s=new Ln(()=>new Set);#i=new Ln(()=>new Set);#o=new Ln(()=>new Set);#c=new Ln(()=>new Set);#d=new Map;$deployments;get $styles(){return this.$model.$styles}element(r){if(r instanceof eL||r instanceof tL)return r;const n=yr(r);return mt(this.#e.get(n),`Element ${n} not found`)}findElement(r){return this.#e.get(r)??null}node(r){const n=this.element(r);return He(n.isDeploymentNode(),`Element ${n.id} is not a deployment node`),n}findNode(r){const n=this.findElement(r);return n?(He(n.isDeploymentNode(),`Element ${n?.id} is not a deployment node`),n):null}instance(r){const n=this.element(r);return He(n.isInstance(),`Element ${n.id} is not a deployed instance`),n}findInstance(r){const n=this.findElement(r);return n?(He(n.isInstance(),`Element ${n?.id} is not a deployed instance`),n):null}roots(){return this.#l.values()}elements(){return this.#e.values()}*nodes(){for(const r of this.#e.values())r.isDeploymentNode()&&(yield r)}*nodesOfKind(r){for(const n of this.#e.values())n.isDeploymentNode()&&n.kind===r&&(yield n)}*instances(){for(const r of this.#e.values())r.isInstance()&&(yield r)}*instancesOf(r){const n=yr(r),o=this.#r.get(n);o&&(yield*o)}deploymentRef(r){if(S1.isInsideInstanceRef(r)){const{deployment:n,element:o}=r;return $ke(this.#d,`${n}@${o}`,()=>new Oke(this.instance(n),this.$model.element(o)))}return this.element(r.deployment)}relationships(){return this.#n.values()}relationship(r){const n=yr(r);return mt(this.#n.get(n),`DeploymentRelationModel ${n} not found`)}findRelationship(r){return this.#n.get(r)??null}*views(){for(const r of this.$model.views())r.isDeploymentView()&&(yield r)}parent(r){const n=yr(r);return this.#a.get(n)||null}children(r){const n=yr(r);return this.#t.get(n)}*siblings(r){const n=yr(r),o=this.parent(r)?.children()??this.roots();for(const i of o)i.id!==n&&(yield i)}*ancestors(r){let n=yr(r),o;for(;o=this.#a.get(n);)yield o,n=o.id}*descendants(r,n="desc"){for(const o of this.children(r))n==="asc"?(yield o,yield*this.descendants(o.id)):(yield*this.descendants(o.id),yield o)}*incoming(r,n="all"){const o=yr(r);for(const i of this.#s.get(o))switch(!0){case n==="all":case(n==="direct"&&i.target.id===o):case(n==="to-descendants"&&i.target.id!==o):yield i;break}}*outgoing(r,n="all"){const o=yr(r);for(const i of this.#i.get(o))switch(!0){case n==="all":case(n==="direct"&&i.source.id===o):case(n==="from-descendants"&&i.source.id!==o):yield i;break}}addElement(r){if(this.#e.has(r.id))throw new Error(`Element ${r.id} already exists`);const n=v4e(r)?new eL(this,Object.freeze(r)):new tL(this,Object.freeze(r),this.$model.element(r.element));this.#e.set(n.id,n);const o=zb(n.id);return o?(He(this.#e.has(o),`Parent ${o} of ${n.id} not found`),this.#a.set(n.id,this.node(o)),this.#t.get(o).add(n)):(He(n.isDeploymentNode(),`Root element ${n.id} is not a deployment node`),this.#l.add(n)),n}addRelation(r){if(this.#n.has(r.id))throw new Error(`Relation ${r.id} already exists`);const n=new Lke(this,Object.freeze(r));this.#n.set(n.id,n),this.#s.get(n.target.id).add(n),this.#i.get(n.source.id).add(n);const o=n.boundary?.id??null;if(o)for(const i of[o,...Du(o)])this.#o.get(i).add(n);for(const i of Du(n.source.id)){if(i===o)break;this.#i.get(i).add(n)}for(const i of Du(n.target.id)){if(i===o)break;this.#s.get(i).add(n)}return n}}class iL{constructor(r,n){this.model=r,this.$relationship=n,this.source=r.element(S1.flatten(n.source)),this.target=r.element(S1.flatten(n.target));const o=t1(this.source.id,this.target.id);this.boundary=o?this.model.element(o):null}source;target;boundary;get id(){return this.$relationship.id}get expression(){return`${this.source.id} -> ${this.target.id}`}get title(){return Ji(this.$relationship.title)?this.$relationship.title:null}get technology(){return Ji(this.$relationship.technology)?this.$relationship.technology:null}get hasSummary(){return!!this.$relationship.summary&&!!this.$relationship.description&&!e7(this.$relationship.summary,this.$relationship.description)}get summary(){return ur.memoize(this,"summary",Fs(this.$relationship))}get description(){return ur.memoize(this,"description",Xh(this.$relationship))}get navigateTo(){return this.$relationship.navigateTo?this.model.view(this.$relationship.navigateTo):null}get tags(){return this.$relationship.tags??[]}get kind(){return this.$relationship.kind??null}get links(){return this.$relationship.links??[]}get color(){return this.$relationship.color??this.model.$styles.defaults.relationship.color}get line(){return this.$relationship.line??this.model.$styles.defaults.relationship.line}get head(){return this.$relationship.head??this.model.$styles.defaults.relationship.arrow}get tail(){return this.$relationship.tail}*views(){for(const r of this.model.views())r.includesRelation(this.id)&&(yield r)}isDeploymentRelation(){return!1}isModelRelation(){return!0}hasMetadata(){return!!this.$relationship.metadata&&!$1(this.$relationship.metadata)}getMetadata(r){return r?this.$relationship.metadata?.[r]:this.$relationship.metadata??{}}isTagged(r){return this.tags.includes(r)}}class Yke{constructor(r,n,o,i){this.source=o,this.target=i,this.$viewModel=r,this.$view=r.$view,this.$edge=n}Aux;$viewModel;$view;$edge;get id(){return this.$edge.id}get parent(){return this.$edge.parent?this.$viewModel.node(this.$edge.parent):null}get label(){return this.$edge.label??null}get description(){return ur.memoize(this,"description",this.$edge.description)}get technology(){return this.$edge.technology??null}hasParent(){return this.$edge.parent!==null}get tags(){return this.$edge.tags??[]}get stepNumber(){return this.isStep()?IO(this.id):null}get navigateTo(){return this.$edge.navigateTo?this.$viewModel.$model.view(this.$edge.navigateTo):null}get color(){return this.$edge.color}get line(){return this.$edge.line??this.$viewModel.$styles.defaults.relationship.line}get head(){return this.$edge.head??this.$viewModel.$styles.defaults.relationship.arrow}get tail(){return this.$edge.tail}isStep(){return k1(this.id)}*relationships(r){for(const n of this.$edge.relations)if(r){const o=this.$viewModel.$model.findRelationship(n,r);o&&(yield o)}else yield this.$viewModel.$model.relationship(n)}includesRelation(r){const n=typeof r=="string"?r:r.id;return this.$edge.relations.includes(n)}isTagged(r){return this.tags.includes(r)}}class Xke{Aux;$viewModel;$view;$node;constructor(r,n){this.$viewModel=r,this.$view=r.$view,this.$node=n}get id(){return this.$node.id}get title(){return this.$node.title}get kind(){return this.$node.kind}get description(){return ur.memoize(this,"description",this.$node.description)}get technology(){return this.$node.technology??null}get parent(){return this.$node.parent?this.$viewModel.node(this.$node.parent):null}get element(){const r=this.$node.modelRef;return r?this.$viewModel.$model.element(r):null}get deployment(){const r=this.$node.deploymentRef;return r?this.$viewModel.$model.deployment.element(r):null}get shape(){return this.$node.shape}get color(){return this.$node.color}get icon(){return this.$node.icon??null}get tags(){return this.$node.tags}get links(){return this.$node.links??[]}get navigateTo(){return this.$node.navigateTo?this.$viewModel.$model.view(this.$node.navigateTo):null}get style(){return this.$node.style}get x(){return"x"in this.$node?this.$node.x:void 0}get y(){return"y"in this.$node?this.$node.y:void 0}get width(){return"width"in this.$node?this.$node.width:void 0}get height(){return"height"in this.$node?this.$node.height:void 0}children(){return ar(this,"children",()=>new Set(this.$node.children.map(r=>this.$viewModel.node(r))))}*ancestors(){let r=this.parent;for(;r;)yield r,r=r.parent}*siblings(){const r=this.parent?.children()??this.$viewModel.roots();for(const n of r)n.id!==this.id&&(yield n)}*incoming(r="all"){for(const n of this.$node.inEdges){const o=this.$viewModel.edge(n);switch(!0){case r==="all":case(r==="direct"&&o.target.id===this.id):case(r==="to-descendants"&&o.target.id!==this.id):yield o;break}}}*incomers(r="all"){const n=new Set;for(const o of this.incoming(r))n.has(o.source.id)||(n.add(o.source.id),yield o.source)}*outgoing(r="all"){for(const n of this.$node.outEdges){const o=this.$viewModel.edge(n);switch(!0){case r==="all":case(r==="direct"&&o.source.id===this.id):case(r==="from-descendants"&&o.source.id!==this.id):yield o;break}}}*outgoers(r="all"){const n=new Set;for(const o of this.outgoing(r))n.has(o.target.id)||(n.add(o.target.id),yield o.target)}isLayouted(){return"width"in this.$node&&"height"in this.$node}hasChildren(){return this.$node.children.length>0}hasParent(){return this.$node.parent!==null}hasElement(){return Ji(this.$node.modelRef)}hasDeployment(){return Ji(this.$node.deploymentRef)}hasDeployedInstance(){return this.hasElement()&&this.hasDeployment()}isGroup(){return mke(this.$node)}isTagged(r){return this.tags.includes(r)}}class o7{Aux;#e;#a=new Set;#t=new Map;#r=new Map;#l=new Set;#n=new Set;#s=new Set;#i=new Ln(r=>new Set);#o;id;$model;title;folder;viewPath;constructor(r,n,o,i){this.$model=r,this.#e=o,this.id=o.id,this.folder=n,this.#o=i;for(const a of this.#e.nodes){const l=new Xke(this,Object.freeze(a));this.#t.set(a.id,l),a.parent||this.#a.add(l),a.deploymentRef&&this.#n.add(a.deploymentRef),a.modelRef&&this.#l.add(a.modelRef);for(const s of l.tags)this.#i.get(s).add(l)}for(const a of this.#e.edges){const l=new Yke(this,Object.freeze(a),this.node(a.source),this.node(a.target));for(const s of l.tags)this.#i.get(s).add(l);for(const s of a.relations)this.#s.add(s);this.#r.set(a.id,l)}this.title=o.title?n7(o.title):null,this.viewPath=o.title?gx(o.title):o.id}get $styles(){return this.$model.$styles}get _type(){return this.#e[h1]}get stage(){return this.#e[Iu]}get bounds(){if("bounds"in this.#e)return this.#e.bounds;if(this.#o)return this.#o.bounds;throw new Error("View is not layouted")}get titleOrId(){return this.title??this.viewOf?.title??this.id}get titleOrUntitled(){return this.title??"Untitled"}get breadcrumbs(){return ar(this,"breadcrumbs",()=>this.folder.isRoot?[this]:[...this.folder.breadcrumbs,this])}get description(){return ur.memoize(this,"description",this.#e.description)}get tags(){return this.#e.tags??[]}get links(){return this.#e.links??[]}get viewOf(){if(this.isElementView()){const r=this.#e.viewOf;return r?this.$model.element(r):null}return null}get mode(){return this.isDynamicView()?this.#e.variant??"diagram":null}get includedTags(){return[...this.#i.keys()]}get $view(){if(!this.isLayouted()||"drifts"in this.#e)return this.#e;const r=this.#o;return r?ar(this,"withDriftReasons",()=>fke(this.#e,r)):this.#e}get $layouted(){if(!this.isLayouted())throw new Error("View is not layouted");return this.$manual??this.#e}get hasManualLayout(){return this.#o!==void 0}get hasLayoutDrifts(){if(!this.isLayouted())return!1;const r=this.$manual;return!!r?.drifts&&r.drifts.length>0}get $manual(){if(!this.isLayouted())return null;const r=this.#o;return r?ar(this,"snapshotWithManualLayout",()=>PO(this.#e,r)):null}roots(){return this.#a.values()}*compounds(){for(const r of this.#t.values())r.hasChildren()&&(yield r)}node(r){const n=yr(r);return mt(this.#t.get(n),`Node ${n} not found in view ${this.#e.id}`)}findNode(r){return this.#t.get(yr(r))??null}findNodeWithElement(r){const n=yr(r);return this.#l.has(n)?E1(this.#t.values(),o=>o.hasElement()&&o.element.id===n)??null:null}nodes(){return this.#t.values()}edge(r){const n=yr(r);return mt(this.#r.get(n),`Edge ${n} not found in view ${this.#e.id}`)}findEdge(r){return this.#r.get(yr(r))??null}edges(){return this.#r.values()}*edgesWithRelation(r){for(const n of this.#r.values())n.includesRelation(r)&&(yield n)}*elements(){for(const r of this.#t.values())r.hasElement()&&(yield r)}isTagged(r){return this.tags.includes(r)}includesElement(r){return this.#l.has(yr(r))}includesDeployment(r){return this.#n.has(yr(r))}includesRelation(r){return this.#s.has(yr(r))}isComputed(){return this.#e[Iu]==="computed"}isLayouted(){return this.#e[Iu]==="layouted"}isDiagram(){return this.#e[Iu]==="layouted"}isElementView(){return this.#e[h1]==="element"}isScopedElementView(){return this.#e[h1]==="element"&&Ji(this.#e.viewOf)}isDeploymentView(){return this.#e[h1]==="deployment"}isDynamicView(){return this.#e[h1]==="dynamic"}}class yx{$model;path;title;isRoot;parentPath;defaultViewId;constructor(r,n,o){this.$model=r,this.path=n.join("/"),this.isRoot=this.path==="",this.title=Hke(n),this.isRoot?this.parentPath=void 0:this.parentPath=n.slice(0,-1).join("/"),this.defaultViewId=o}get defaultView(){return this.defaultViewId?this.$model.view(this.defaultViewId):null}get breadcrumbs(){return He(!this.isRoot,"Root view folder has no breadcrumbs"),ar(this,"breadcrumbs",()=>{const r=this.parent;return r?r.isRoot?[r,this]:[...r.breadcrumbs,this]:[this]})}get parent(){return He(!this.isRoot,"Root view folder has no parent"),qke(this.parentPath)?null:this.$model.viewFolder(this.parentPath)}get children(){return this.$model.viewFolderItems(this.path)}get folders(){return ar(this,"folders",()=>{const r=[];for(const n of this.children)n instanceof yx&&r.push(n);return r})}get views(){return ar(this,"views",()=>{const r=[];for(const n of this.children)n instanceof o7&&r.push(n);return r})}}class Fu{Aux;_elements=new Map;_parents=new Map;_children=new Ln(()=>new Set);_rootElements=new Set;_relations=new Map;_incoming=new Ln(()=>new Set);_outgoing=new Ln(()=>new Set);_internal=new Ln(()=>new Set);_views=new Map;_rootViewFolder;_viewFolders=new Map;_viewFolderItems=new Ln(()=>new Set);_allTags=new Ln(()=>new Set);static fromParsed(r){return new Fu(r)}static create(r){return new Fu(r)}static fromDump(r){const{_stage:n="layouted",projectId:o="unknown",project:i,globals:a,imports:l,deployments:s,views:c,relations:d,elements:u,specification:p}=r;return new Fu({[Iu]:n,projectId:o,project:i,globals:{predicates:a?.predicates??{},dynamicPredicates:a?.dynamicPredicates??{},styles:a?.styles??{}},imports:l??{},deployments:{elements:s?.elements??{},relations:s?.relations??{}},views:c??{},relations:d??{},elements:u??{},specification:p})}deployment;$data;constructor(r){this.$data=r;for(const[,n]of f1(r.elements)){const o=this.addElement(n);for(const i of o.tags)this._allTags.get(i).add(o)}for(const[n,o]of f1(r.imports??{}))for(const i of Jc(o)){const a=this.addImportedElement(n,i);for(const l of a.tags)this._allTags.get(l).add(a)}for(const n of fx(r.relations)){const o=this.addRelation(n);for(const i of o.tags)this._allTags.get(i).add(o)}if(this.deployment=new Gke(this),cO(r,"computed")||cO(r,"layouted")){const n=JP(_i),o=Ps(fx(r.views),Kb(a=>({view:a,path:gx(a.title??a.id),folderPath:a.title&&Wke(a.title)||""})),Q8((a,l)=>n(a.folderPath,l.folderPath))),i=a=>{let l=this._viewFolders.get(a);if(!l){const s=oL(a,_i);He(Ll(s,1),`View group path "${a}" must have at least one element`);let c;a===""?c=o.find(d=>d.view.id==="index"):c=o.find(d=>d.path===a),l=new yx(this,s,c?.view.id),this._viewFolders.set(a,l)}return l};this._rootViewFolder=i("");for(const{folderPath:a}of o)this._viewFolders.has(a)||oL(a,_i).reduce((l,s)=>{const c=l.join(_i),d=$1(c)?s:c+_i+s,u=i(d);return this._viewFolderItems.get(c).add(u),l.push(s),l},[]);for(const{view:a,folderPath:l}of o){const s=new o7(this,i(l),a,r.manualLayouts?.[a.id]);this._viewFolderItems.get(l).add(s),this._views.set(a.id,s);for(const c of s.tags)this._allTags.get(c).add(s)}}else this._rootViewFolder=new yx(this,[""],void 0),this._viewFolders.set(this._rootViewFolder.path,this._rootViewFolder)}get asParsed(){return this}get asComputed(){return this}get asLayouted(){return this}get $styles(){return ar(this,"styles",()=>XP.from(this.$data.project.styles,this.$data.specification.customColors?{theme:{colors:this.$data.specification.customColors}}:void 0))}isParsed(){return this.stage==="parsed"}isLayouted(){return this.stage==="layouted"}isComputed(){return this.stage==="computed"}get $model(){return this.$data}get stage(){return this.$data[Iu]}get projectId(){return this.$data.projectId??"default"}get project(){return this.$data.project??ar(this,Symbol.for("project"),()=>({id:this.projectId}))}get specification(){return this.$data.specification}get globals(){return ar(this,Symbol.for("globals"),()=>({predicates:{...this.$data.globals?.predicates},dynamicPredicates:{...this.$data.globals?.dynamicPredicates},styles:{...this.$data.globals?.styles}}))}element(r){if(r instanceof mx)return r;const n=yr(r);return mt(this._elements.get(n),`Element ${n} not found`)}findElement(r){return this._elements.get(yr(r))??null}roots(){return this._rootElements.values()}elements(){return this._elements.values()}relationships(){return this._relations.values()}relationship(r,n){if(n==="deployment")return this.deployment.relationship(r);const o=yr(r);let i=this._relations.get(o)??null;return i||n==="model"?mt(i,`Model relation ${o} not found`):mt(this.deployment.findRelationship(o),`No model/deployment relation ${o} not found`)}findRelationship(r,n){if(n==="deployment")return this.deployment.findRelationship(r);let o=this._relations.get(yr(r))??null;return o||n==="model"?o:this.deployment.findRelationship(r)}views(){return this._views.values()}view(r){const n=yr(r);return mt(this._views.get(n),`View ${n} not found`)}findView(r){return this._views.get(r)??null}findManualLayout(r){return"manualLayouts"in this.$data?this.$data.manualLayouts?.[r]??null:null}viewFolder(r){return mt(this._viewFolders.get(r),`View folder ${r} not found`)}get rootViewFolder(){return this._rootViewFolder}get hasViewFolders(){return this._viewFolders.size>1}viewFolderItems(r){return He(this._viewFolders.has(r),`View folder ${r} not found`),this._viewFolderItems.get(r)}parent(r){const n=yr(r);return this._parents.get(n)||null}children(r){const n=yr(r);return this._children.get(n)}*siblings(r){const n=yr(r),o=this._parents.get(n),i=o?this._children.get(o.id).values():this.roots();for(const a of i)a.id!==n&&(yield a)}*ancestors(r){let n=yr(r),o;for(;o=this._parents.get(n);)yield o,n=o.id}*descendants(r){for(const n of this.children(r))yield n,yield*this.descendants(n.id)}*incoming(r,n="all"){const o=yr(r);for(const i of this._incoming.get(o))switch(!0){case n==="all":case(n==="direct"&&i.target.id===o):case(n==="to-descendants"&&i.target.id!==o):yield i;break}}*outgoing(r,n="all"){const o=yr(r);for(const i of this._outgoing.get(o))switch(!0){case n==="all":case(n==="direct"&&i.source.id===o):case(n==="from-descendants"&&i.source.id!==o):yield i;break}}get tags(){return ar(this,"tags",()=>Q8([...this._allTags.keys()],Rb))}get tagsSortedByUsage(){return ar(this,"tagsSortedByUsage",()=>Ps([...this._allTags.entries()],Kb(([r,n])=>({tag:r,count:n.size,tagged:n})),Q8((r,n)=>Rb(r.tag,n.tag)),vO([Lu("count"),"desc"])))}findByTag(r,n){return Is(this._allTags.get(r),o=>n==="elements"?o instanceof mx:n==="views"?o instanceof o7:n==="relationships"?o instanceof iL:!0)}*elementsOfKind(r){for(const n of this._elements.values())n.kind===r&&(yield n)}*elementsWhere(r){const n=Ou(r);for(const o of this._elements.values())n(o)&&(yield o)}*relationshipsWhere(r){const n=Ou(r);for(const o of this._relations.values())n(o)&&(yield o)}addElement(r){if(this._elements.has(r.id))throw new Error(`Element ${r.id} already exists`);const n=new mx(this,Object.freeze(r));this._elements.set(n.id,n);const o=zb(n.id);return o?(He(this._elements.has(o),`Parent ${o} of ${n.id} not found`),this._parents.set(n.id,this.element(o)),this._children.get(o).add(n)):this._rootElements.add(n),n}addImportedElement(r,n){He(!gke(n.id),"Imported element already has global FQN");const o=BO(r,n.id);if(this._elements.has(o))throw new Error(`Element ${o} already exists`);const i=new mx(this,Object.freeze({...n,id:o}));this._elements.set(i.id,i);let a=zb(i.id);for(;a;){if(a.includes(".")&&this._elements.has(a))return this._parents.set(i.id,this.element(a)),this._children.get(a).add(i),i;a=zb(a)}return this._rootElements.add(i),i}addRelation(r){if(this._relations.has(r.id))throw new Error(`Relation ${r.id} already exists`);const n=new iL(this,Object.freeze(r)),{source:o,target:i}=n;this._relations.set(n.id,n),this._incoming.get(i.id).add(n),this._outgoing.get(o.id).add(n);const a=t1(o.id,i.id);if(a)for(const l of[a,...Du(a)])this._internal.get(l).add(n);for(const l of Du(o.id)){if(l===a)break;this._outgoing.get(l).add(n)}for(const l of Du(i.id)){if(l===a)break;this._incoming.get(l).add(n)}return n}}(e=>{e.EMPTY=e.create({_stage:"computed",projectId:"default",project:{id:"default"},specification:{elements:{},relationships:{},deployments:{},tags:{}},globals:{predicates:{},dynamicPredicates:{},styles:{}},deployments:{elements:{},relations:{}},elements:{},relations:{},views:{},imports:{}})})(Fu||(Fu={}));function vx(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}var Kke=e=>typeof e=="object"&&e!==null;function Vu(e){return Object.fromEntries(Object.entries(e??{}).filter(([r,n])=>n!==void 0))}var Zke=e=>e==="base";function Qke(e){return e.slice().filter(r=>!Zke(r))}function aL(e){return String.fromCharCode(e+(e>25?39:97))}function Jke(e){let r="",n;for(n=Math.abs(e);n>52;n=n/52|0)r=aL(n%52)+r;return aL(n%52)+r}function e5e(e,r){let n=r.length;for(;n;)e=e*33^r.charCodeAt(--n);return e}function t5e(e){return Jke(e5e(5381,e)>>>0)}var lL=/\s*!(important)?/i;function r5e(e){return typeof e=="string"?lL.test(e):!1}function n5e(e){return typeof e=="string"?e.replace(lL,"").trim():e}function i7(e){return typeof e=="string"?e.replaceAll(" ","_"):e}var Kn=e=>{const r=new Map;return(...n)=>{const o=JSON.stringify(n);if(r.has(o))return r.get(o);const i=e(...n);return r.set(o,i),i}},o5e=new Set(["__proto__","constructor","prototype"]);function a7(...e){return e.reduce((r,n)=>(n&&Object.keys(n).forEach(o=>{if(o5e.has(o))return;const i=r[o],a=n[o];vx(i)&&vx(a)?r[o]=a7(i,a):r[o]=a}),r),{})}var i5e=e=>e!=null;function l7(e,r,n={}){const{stop:o,getKey:i}=n;function a(l,s=[]){if(Kke(l)){const c={};for(const[d,u]of Object.entries(l)){const p=i?.(d,u)??d,f=[...s,p];if(o?.(l,f))return r(l,s);const g=a(u,f);i5e(g)&&(c[p]=g)}return c}return r(l,s)}return a(e)}function a5e(e,r){return Array.isArray(e)?e.map(n=>r(n)):vx(e)?l7(e,n=>r(n)):r(e)}function l5e(e,r){return e.reduce((n,o,i)=>{const a=r[i];return o!=null&&(n[a]=o),n},{})}function sL(e,r,n=!0){const{utility:o,conditions:i}=r,{hasShorthand:a,resolveShorthand:l}=o;return l7(e,s=>Array.isArray(s)?l5e(s,i.breakpoints.keys):s,{stop:s=>Array.isArray(s),getKey:n?s=>a?l(s):s:void 0})}var s5e={shift:e=>e,finalize:e=>e,breakpoints:{keys:[]}},c5e=e=>typeof e=="string"?e.replaceAll(/[\n\s]+/g," "):e;function cL(e){const{utility:r,hash:n,conditions:o=s5e}=e,i=l=>[r.prefix,l].filter(Boolean).join("-"),a=(l,s)=>{let c;if(n){const d=[...o.finalize(l),s];c=i(r.toHash(d,t5e))}else c=[...o.finalize(l),i(s)].join(":");return c};return Kn(({base:l,...s}={})=>{const c=Object.assign(s,l),d=sL(c,e),u=new Set;return l7(d,(p,f)=>{if(p==null)return;const g=r5e(p),[v,...w]=o.shift(f),x=Qke(w),k=r.transform(v,n5e(c5e(p)));let C=a(x,k.className);g&&(C=`${C}!`),u.add(C)}),Array.from(u).join(" ")})}function d5e(...e){return e.flat().filter(r=>vx(r)&&Object.keys(Vu(r)).length>0)}function u5e(e){function r(i){const a=d5e(...i);return a.length===1?a:a.map(l=>sL(l,e))}function n(...i){return a7(...r(i))}function o(...i){return Object.assign({},...r(i))}return{mergeCss:Kn(n),assignCss:o}}var p5e=/([A-Z])/g,h5e=/^ms-/,f5e=Kn(e=>e.startsWith("--")?e:e.replace(p5e,"-$1").replace(h5e,"-ms-").toLowerCase()),m5e=["min","max","clamp","calc"],g5e=new RegExp(`^(${m5e.join("|")})\\(.*\\)`),y5e=e=>typeof e=="string"&&g5e.test(e),v5e="cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%",b5e=`(?:${v5e.split(",").join("|")})`,x5e=new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${b5e}$`),w5e=e=>typeof e=="string"&&x5e.test(e),k5e=e=>typeof e=="string"&&/^var\(--.+\)$/.test(e),R1={map:a5e,isCssFunction:y5e,isCssVar:k5e,isCssUnit:w5e},z1=(e,r)=>{if(!e?.defaultValues)return r;const n=typeof e.defaultValues=="function"?e.defaultValues(r):e.defaultValues;return Object.assign({},n,Vu(r))},_5e=(e={})=>{const r=o=>({className:[e.className,o].filter(Boolean).join("__"),base:e.base?.[o]??{},variants:{},defaultVariants:e.defaultVariants??{},compoundVariants:e.compoundVariants?s7(e.compoundVariants,o):[]}),n=(e.slots??[]).map(o=>[o,r(o)]);for(const[o,i]of Object.entries(e.variants??{}))for(const[a,l]of Object.entries(i))n.forEach(([s,c])=>{c.variants[o]??={},c.variants[o][a]=l[s]??{}});return Object.fromEntries(n)},s7=(e,r)=>e.filter(n=>n.css[r]).map(n=>({...n,css:n.css[r]}));function Fn(e,...r){const n=Object.getOwnPropertyDescriptors(e),o=Object.keys(n),i=l=>{const s={};for(let c=0;ci(Array.isArray(l)?l:o.filter(l));return r.map(a).concat(i(o))}var c7=(...e)=>{const r=e.reduce((n,o)=>(o&&o.forEach(i=>n.add(i)),n),new Set([]));return Array.from(r)},dL=["htmlSize","htmlTranslate","htmlWidth","htmlHeight"];function S5e(e){return dL.includes(e)?e.replace("html","").toLowerCase():e}function d7(e){return Object.fromEntries(Object.entries(e).map(([r,n])=>[S5e(r),n]))}d7.keys=dL;const E5e="_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,_shapeSizeXs,_shapeSizeSm,_shapeSizeMd,_shapeSizeLg,_shapeSizeXl,_shapeRectangle,_shapePerson,_shapeBrowser,_shapeMobile,_shapeCylinder,_shapeStorage,_shapeQueue,_notDisabled,_reduceGraphics,_reduceGraphicsOnPan,_noReduceGraphics,_whenPanning,_smallZoom,_compoundTransparent,_edgeActive,_whenHovered,_whenSelectable,_whenSelected,_whenDimmed,_whenFocused,_p3,_srgb,_rec2020,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,xsToSm,xsToMd,xsToLg,xsToXl,smToMd,smToLg,smToXl,mdToLg,mdToXl,lgToXl,@/xs,@/sm,@/md,@/lg,@likec4-root/xs,@likec4-root/sm,@likec4-root/md,@likec4-root/lg,@likec4-dialog/xs,@likec4-dialog/sm,@likec4-dialog/md,@likec4-dialog/lg,base",uL=new Set(E5e.split(",")),C5e=/^@|&|&$/;function pL(e){return uL.has(e)||C5e.test(e)}const $5e=/^_/,R5e=/&|@/;function hL(e){return e.map(r=>uL.has(r)?r.replace($5e,""):R5e.test(r)?`[${i7(r.trim())}]`:r)}function fL(e){return e.sort((r,n)=>{const o=pL(r),i=pL(n);return o&&!i?1:!o&&i?-1:0})}const z5e="aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,focusRing:focus-ring,focusVisibleRing:focus-v-ring,focusRingColor:focus-ring-c,focusRingOffset:focus-ring-o,focusRingWidth:focus-ring-w,focusRingStyle:focus-ring-s,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,WebkitTextFillColor:wktf-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,backgroundLinear:bg-linear/bgLinear,backgroundRadial:bg-radial/bgRadial,backgroundConic:bg-conic/bgConic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:transition,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor,textStyle:textStyle,layerStyle:layerStyle,animationStyle:animationStyle",mL=new Map,gL=new Map;z5e.split(",").forEach(e=>{const[r,n]=e.split(":"),[o,...i]=n.split("/");mL.set(r,o),i.length&&i.forEach(a=>{gL.set(a==="1"?o:a,r)})});const yL=e=>gL.get(e)||e,vL={conditions:{shift:fL,finalize:hL,breakpoints:{keys:["base","xs","sm","md","lg","xl"]}},utility:{transform:(e,r)=>{const n=yL(e);return{className:`${mL.get(n)||f5e(n)}_${i7(r)}`}},hasShorthand:!0,toHash:(e,r)=>r(e.join(":")),resolveShorthand:yL}},T5e=cL(vL),fe=(...e)=>T5e(qu(...e));fe.raw=(...e)=>qu(...e);const{mergeCss:qu}=u5e(vL);function Ge(){let e="",r=0,n;for(;r({base:{},variants:{},defaultVariants:{},compoundVariants:[],...e});function T1(e){const{base:r,variants:n,defaultVariants:o,compoundVariants:i}=bL(e),a=f=>({...o,...Vu(f)});function l(f={}){const g=a(f);let v={...r};for(const[x,k]of Object.entries(g))n[x]?.[k]&&(v=qu(v,n[x][k]));const w=u7(i,g);return qu(v,w)}function s(f){const g=bL(f.config),v=c7(f.variantKeys,Object.keys(n));return T1({base:qu(r,g.base),variants:Object.fromEntries(v.map(w=>[w,qu(n[w],g.variants[w])])),defaultVariants:a7(o,g.defaultVariants),compoundVariants:[...i,...g.compoundVariants]})}function c(f){return fe(l(f))}const d=Object.keys(n);function u(f){return Fn(f,d)}const p=Object.fromEntries(Object.entries(n).map(([f,g])=>[f,Object.keys(g)]));return Object.assign(Kn(c),{__cva__:!0,variantMap:p,variantKeys:d,raw:l,config:e,merge:s,splitVariantProps:u,getVariantProps:a})}function u7(e,r){let n={};return e.forEach(o=>{Object.entries(o).every(([i,a])=>i==="css"?!0:(Array.isArray(a)?a:[a]).some(l=>r[i]===l))&&(n=qu(n,o.css))}),n}function j5e(e,r,n,o){if(r.length>0&&typeof n?.[o]=="object")throw new Error(`[recipe:${e}:${o}] Conditions are not supported when using compound variants.`)}function A5e(e){const r=Object.entries(_5e(e)).map(([p,f])=>[p,T1(f)]),n=e.defaultVariants??{},o=r.reduce((p,[f,g])=>(e.className&&(p[f]=g.config.className),p),{});function i(p){const f=r.map(([g,v])=>[g,Ge(v(p),o[g])]);return Object.fromEntries(f)}function a(p){const f=r.map(([g,v])=>[g,v.raw(p)]);return Object.fromEntries(f)}const l=e.variants??{},s=Object.keys(l);function c(p){return Fn(p,s)}const d=p=>({...n,...Vu(p)}),u=Object.fromEntries(Object.entries(l).map(([p,f])=>[p,Object.keys(f)]));return Object.assign(Kn(i),{__cva__:!1,raw:a,config:e,variantMap:u,variantKeys:s,classNameMap:o,splitVariantProps:c,getVariantProps:d})}var D5e={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const wt=(e,r,n,o)=>{const i=S.forwardRef(({color:a="currentColor",size:l=24,stroke:s=2,title:c,className:d,children:u,...p},f)=>S.createElement("svg",{ref:f,...D5e[e],width:l,height:l,className:["tabler-icon",`tabler-icon-${r}`,d].join(" "),...e==="filled"?{fill:a}:{strokeWidth:s,stroke:a},...p},[c&&S.createElement("title",{key:"svg-title"},c),...o.map(([g,v])=>S.createElement(g,v)),...Array.isArray(u)?u:[u]]));return i.displayName=`${n}`,i},M5e=[["path",{d:"M12 6m-7 0a7 3 0 1 0 14 0a7 3 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M5 6v12c0 1.657 3.134 3 7 3s7 -1.343 7 -3v-12",key:"svg-1"}]],xL=wt("outline","cylinder","Cylinder",M5e),N5e=[["path",{d:"M21 14.008v-5.018a1.98 1.98 0 0 0 -1 -1.717l-4 -2.008a2.016 2.016 0 0 0 -2 0l-10 5.008c-.619 .355 -1 1.01 -1 1.718v5.018c0 .709 .381 1.363 1 1.717l4 2.008a2.016 2.016 0 0 0 2 0l10 -5.008c.619 -.355 1 -1.01 1 -1.718z",key:"svg-0"}],["path",{d:"M9 21v-7.5",key:"svg-1"}],["path",{d:"M9 13.5l11.5 -5.5",key:"svg-2"}],["path",{d:"M3.5 11l5.5 2.5",key:"svg-3"}]],P5e=wt("outline","rectangular-prism","RectangularPrism",N5e),B5e=[["path",{d:"M3 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-1"}],["path",{d:"M17 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z",key:"svg-2"}],["path",{d:"M5 11v-3a3 3 0 0 1 3 -3h8a3 3 0 0 1 3 3v3",key:"svg-3"}],["path",{d:"M16.5 8.5l2.5 2.5l2.5 -2.5",key:"svg-4"}]],I5e=wt("outline","reorder","Reorder",B5e),O5e=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]],L5e=wt("outline","user","User",O5e),F5e=[["path",{d:"M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14z",key:"svg-0"}],["path",{d:"M11 4h2",key:"svg-1"}],["path",{d:"M12 17v.01",key:"svg-2"}]],V5e=wt("outline","device-mobile","DeviceMobile",F5e),q5e=[["path",{d:"M4 8h16",key:"svg-0"}],["path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M8 4v4",key:"svg-2"}]],H5e=wt("outline","browser","Browser",q5e),p7=S.createContext(null);function U5e({value:e,children:r}){return S.useContext(p7)?y.jsx(y.Fragment,{children:r}):y.jsx(p7.Provider,{value:e,children:r})}function bx({element:e,className:r,style:n}){const o=S.useContext(p7);if(!e||!e.icon||e.icon==="none")return null;let i;return e.icon.startsWith("http://")||e.icon.startsWith("https://")?i=y.jsx("img",{src:e.icon,alt:e.title}):o&&(i=y.jsx(o,{node:e})),i?y.jsx("div",{className:Ge(r,"likec4-element-icon"),"data-likec4-icon":e.icon,style:n,children:i}):null}const W5e={browser:H5e,cylinder:xL,mobile:V5e,person:L5e,queue:I5e,rectangle:P5e,storage:xL};function G5e({element:e,className:r}){const n=y.jsx(bx,{element:e,className:r});if(n)return n;const o=W5e[e.shape];return y.jsx("div",{className:Ge(r,"likec4-shape-icon"),children:y.jsx(o,{})})}function Zh(e){const r=S.useRef(e);return r.current=e,S.useMemo(()=>Object.freeze({get current(){return r.current}}),[])}function wL(e){const r=Zh(e);S.useEffect(()=>()=>{r.current()},[])}function h7(e,r,n,o=0){const i=S.useRef(void 0),a=S.useRef(void 0),l=S.useRef(e),s=S.useRef(void 0),c=()=>{i.current&&(clearTimeout(i.current),i.current=void 0),a.current&&(clearTimeout(a.current),a.current=void 0)};return wL(c),S.useEffect(()=>{l.current=e},r),S.useMemo(()=>{const d=()=>{if(c(),!s.current)return;const p=s.current;s.current=void 0,l.current.apply(p.this,p.args)},u=function(...p){i.current&&clearTimeout(i.current),s.current={args:p,this:this},i.current=setTimeout(d,n),o>0&&!a.current&&(a.current=setTimeout(d,o))};return Object.defineProperties(u,{length:{value:e.length},name:{value:`${e.name||"anonymous"}__debounced__${n}`}}),u},[n,o,...r])}const Y5e=()=>{},xx=typeof globalThis<"u"&&typeof navigator<"u"&&typeof document<"u";function X5e(e){const r=Zh(e),n=S.useRef(0),o=S.useCallback(()=>{xx&&n.current&&(cancelAnimationFrame(n.current),n.current=0)},[]);return wL(o),[S.useMemo(()=>{const i=(...a)=>{xx&&(o(),n.current=requestAnimationFrame(()=>{r.current(...a),n.current=0}))};return Object.defineProperties(i,{length:{value:e.length},name:{value:`${e.name||"anonymous"}__raf`}}),i},[]),o]}const K5e=(e,r)=>{if(e===r)return!0;if(e.length!==r.length)return!1;for(const[n,o]of e.entries())if(o!==r[n])return!1;return!0};function Z5e(e,r,n=K5e,o=S.useEffect,...i){const a=S.useRef(void 0);(a.current===void 0||xx&&!n(a.current,r))&&(a.current=r),o(e,a.current,...i)}function kL(){const e=S.useRef(!0);return S.useEffect(()=>{e.current=!1},[]),e.current}const f7=xx?S.useLayoutEffect:S.useEffect;function Q5e(e){S.useEffect(()=>{e()},[])}function _L(e,r){const[n,o]=X5e(e);S.useEffect(()=>(n(),o),r)}const J5e=e=>(e+1)%Number.MAX_SAFE_INTEGER;function e6e(){const[,e]=S.useState(0);return S.useCallback(()=>{e(J5e)},[])}function t6e(e,r){const n=kL();S.useEffect(n?Y5e:e,r)}const r6e=e=>{e&&clearTimeout(e)};function wx(e,r){const n=Zh(e),o=Zh(r),i=S.useRef(null),a=S.useCallback(()=>{r6e(i.current)},[]),l=S.useCallback(()=>{o.current!==void 0&&(a(),i.current=setTimeout(()=>{n.current()},o.current))},[]);return S.useEffect(()=>(l(),a),[r]),[a,l]}const SL=(e,r,n)=>{const o=S.useRef(void 0);return(o.current===void 0||!n(o.current,r))&&(o.current=r),S.useMemo(e,o.current)};function dn(e){if(typeof e=="string"||typeof e=="number")return""+e;let r="";if(Array.isArray(e))for(let n=0,o;n{}};function kx(){for(var e=0,r=arguments.length,n={},o;e=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!r.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}_x.prototype=kx.prototype={constructor:_x,on:function(e,r){var n=this._,o=o6e(e+"",n),i,a=-1,l=o.length;if(arguments.length<2){for(;++a0)for(var n=new Array(i),o=0,i,a;o=0&&(r=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),CL.hasOwnProperty(r)?{space:CL[r],local:e}:e}function a6e(e){return function(){var r=this.ownerDocument,n=this.namespaceURI;return n===m7&&r.documentElement.namespaceURI===m7?r.createElement(e):r.createElementNS(n,e)}}function l6e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function $L(e){var r=Sx(e);return(r.local?l6e:a6e)(r)}function s6e(){}function g7(e){return e==null?s6e:function(){return this.querySelector(e)}}function c6e(e){typeof e!="function"&&(e=g7(e));for(var r=this._groups,n=r.length,o=new Array(n),i=0;i=_&&(_=C+1);!(R=x[_])&&++_=0;)(l=o[i])&&(a&&l.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(l,a),a=l);return this}function M6e(e){e||(e=N6e);function r(p,f){return p&&f?e(p.__data__,f.__data__):!p-!f}for(var n=this._groups,o=n.length,i=new Array(o),a=0;ar?1:e>=r?0:NaN}function P6e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function B6e(){return Array.from(this)}function I6e(){for(var e=this._groups,r=0,n=e.length;r1?this.each((r==null?X6e:typeof r=="function"?Z6e:K6e)(e,r,n??"")):Qh(this.node(),e)}function Qh(e,r){return e.style.getPropertyValue(r)||AL(e).getComputedStyle(e,null).getPropertyValue(r)}function J6e(e){return function(){delete this[e]}}function e_e(e,r){return function(){this[e]=r}}function t_e(e,r){return function(){var n=r.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function r_e(e,r){return arguments.length>1?this.each((r==null?J6e:typeof r=="function"?t_e:e_e)(e,r)):this.node()[e]}function DL(e){return e.trim().split(/^|\s+/)}function y7(e){return e.classList||new ML(e)}function ML(e){this._node=e,this._names=DL(e.getAttribute("class")||"")}ML.prototype={add:function(e){var r=this._names.indexOf(e);r<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var r=this._names.indexOf(e);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function NL(e,r){for(var n=y7(e),o=-1,i=r.length;++o=0&&(n=r.slice(o+1),r=r.slice(0,o)),{type:r,name:n}})}function T_e(e){return function(){var r=this.__on;if(r){for(var n=0,o=-1,i=r.length,a;n()=>e;function b7(e,{sourceEvent:r,subject:n,target:o,identifier:i,active:a,x:l,y:s,dx:c,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,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:a,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}b7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function L_e(e){return!e.ctrlKey&&!e.button}function F_e(){return this.parentNode}function V_e(e,r){return r??{x:e.x,y:e.y}}function q_e(){return navigator.maxTouchPoints||"ontouchstart"in this}function FL(){var e=L_e,r=F_e,n=V_e,o=q_e,i={},a=kx("start","drag","end"),l=0,s,c,d,u,p=0;function f($){$.on("mousedown.drag",g).filter(o).on("touchstart.drag",x).on("touchmove.drag",k,O_e).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g($,R){if(!(u||!e.call(this,$,R))){var T=_(this,r.call(this,$,R),$,R,"mouse");T&&(Ei($.view).on("mousemove.drag",v,A1).on("mouseup.drag",w,A1),OL($.view),v7($),d=!1,s=$.clientX,c=$.clientY,T("start",$))}}function v($){if(Jh($),!d){var R=$.clientX-s,T=$.clientY-c;d=R*R+T*T>p}i.mouse("drag",$)}function w($){Ei($.view).on("mousemove.drag mouseup.drag",null),LL($.view,d),Jh($),i.mouse("end",$)}function x($,R){if(e.call(this,$,R)){var T=$.changedTouches,A=r.call(this,$,R),z=T.length,j,I;for(j=0;j>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):n===8?Rx(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):n===4?Rx(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=U_e.exec(e))?new ri(r[1],r[2],r[3],1):(r=W_e.exec(e))?new ri(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=G_e.exec(e))?Rx(r[1],r[2],r[3],r[4]):(r=Y_e.exec(e))?Rx(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=X_e.exec(e))?XL(r[1],r[2]/100,r[3]/100,1):(r=K_e.exec(e))?XL(r[1],r[2]/100,r[3]/100,r[4]):qL.hasOwnProperty(e)?WL(qL[e]):e==="transparent"?new ri(NaN,NaN,NaN,0):null}function WL(e){return new ri(e>>16&255,e>>8&255,e&255,1)}function Rx(e,r,n,o){return o<=0&&(e=r=n=NaN),new ri(e,r,n,o)}function J_e(e){return e instanceof D1||(e=Hu(e)),e?(e=e.rgb(),new ri(e.r,e.g,e.b,e.opacity)):new ri}function w7(e,r,n,o){return arguments.length===1?J_e(e):new ri(e,r,n,o??1)}function ri(e,r,n,o){this.r=+e,this.g=+r,this.b=+n,this.opacity=+o}x7(ri,w7,VL(D1,{brighter(e){return e=e==null?$x:Math.pow($x,e),new ri(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?M1:Math.pow(M1,e),new ri(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ri(Uu(this.r),Uu(this.g),Uu(this.b),zx(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:GL,formatHex:GL,formatHex8:e8e,formatRgb:YL,toString:YL}));function GL(){return`#${Wu(this.r)}${Wu(this.g)}${Wu(this.b)}`}function e8e(){return`#${Wu(this.r)}${Wu(this.g)}${Wu(this.b)}${Wu((isNaN(this.opacity)?1:this.opacity)*255)}`}function YL(){const e=zx(this.opacity);return`${e===1?"rgb(":"rgba("}${Uu(this.r)}, ${Uu(this.g)}, ${Uu(this.b)}${e===1?")":`, ${e})`}`}function zx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wu(e){return e=Uu(e),(e<16?"0":"")+e.toString(16)}function XL(e,r,n,o){return o<=0?e=r=n=NaN:n<=0||n>=1?e=r=NaN:r<=0&&(e=NaN),new Ya(e,r,n,o)}function KL(e){if(e instanceof Ya)return new Ya(e.h,e.s,e.l,e.opacity);if(e instanceof D1||(e=Hu(e)),!e)return new Ya;if(e instanceof Ya)return e;e=e.rgb();var r=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(r,n,o),a=Math.max(r,n,o),l=NaN,s=a-i,c=(a+i)/2;return s?(r===a?l=(n-o)/s+(n0&&c<1?0:l,new Ya(l,s,c,e.opacity)}function t8e(e,r,n,o){return arguments.length===1?KL(e):new Ya(e,r,n,o??1)}function Ya(e,r,n,o){this.h=+e,this.s=+r,this.l=+n,this.opacity=+o}x7(Ya,t8e,VL(D1,{brighter(e){return e=e==null?$x:Math.pow($x,e),new Ya(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?M1:Math.pow(M1,e),new Ya(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*r,i=2*n-o;return new ri(k7(e>=240?e-240:e+120,i,o),k7(e,i,o),k7(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Ya(ZL(this.h),Tx(this.s),Tx(this.l),zx(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=zx(this.opacity);return`${e===1?"hsl(":"hsla("}${ZL(this.h)}, ${Tx(this.s)*100}%, ${Tx(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ZL(e){return e=(e||0)%360,e<0?e+360:e}function Tx(e){return Math.max(0,Math.min(1,e||0))}function k7(e,r,n){return(e<60?r+(n-r)*e/60:e<180?n:e<240?r+(n-r)*(240-e)/60:r)*255}const _7=e=>()=>e;function r8e(e,r){return function(n){return e+n*r}}function n8e(e,r,n){return e=Math.pow(e,n),r=Math.pow(r,n)-e,n=1/n,function(o){return Math.pow(e+o*r,n)}}function o8e(e){return(e=+e)==1?QL:function(r,n){return n-r?n8e(r,n,e):_7(isNaN(r)?n:r)}}function QL(e,r){var n=r-e;return n?r8e(e,n):_7(isNaN(e)?r:e)}const jx=(function e(r){var n=o8e(r);function o(i,a){var l=n((i=w7(i)).r,(a=w7(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),d=QL(i.opacity,a.opacity);return function(u){return i.r=l(u),i.g=s(u),i.b=c(u),i.opacity=d(u),i+""}}return o.gamma=e,o})(1);function i8e(e,r){r||(r=[]);var n=e?Math.min(r.length,e.length):0,o=r.slice(),i;return function(a){for(i=0;in&&(a=r.slice(n,a),s[l]?s[l]+=a:s[++l]=a),(o=o[0])===(i=i[0])?s[l]?s[l]+=i:s[++l]=i:(s[++l]=null,c.push({i:l,x:Ul(o,i)})),n=E7.lastIndex;return n180?u+=360:u-d>180&&(d+=360),f.push({i:p.push(i(p)+"rotate(",null,o)-2,x:Ul(d,u)})):u&&p.push(i(p)+"rotate("+u+o)}function s(d,u,p,f){d!==u?f.push({i:p.push(i(p)+"skewX(",null,o)-2,x:Ul(d,u)}):u&&p.push(i(p)+"skewX("+u+o)}function c(d,u,p,f,g,v){if(d!==p||u!==f){var w=g.push(i(g)+"scale(",null,",",null,")");v.push({i:w-4,x:Ul(d,p)},{i:w-2,x:Ul(u,f)})}else(p!==1||f!==1)&&g.push(i(g)+"scale("+p+","+f+")")}return function(d,u){var p=[],f=[];return d=e(d),u=e(u),a(d.translateX,d.translateY,u.translateX,u.translateY,p,f),l(d.rotate,u.rotate,p,f),s(d.skewX,u.skewX,p,f),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,p,f),d=u=null,function(g){for(var v=-1,w=f.length,x;++v=0&&e._call.call(void 0,r),e=e._next;--tf}function sF(){Gu=(Nx=L1.now())+Px,tf=B1=0;try{x8e()}finally{tf=0,k8e(),Gu=0}}function w8e(){var e=L1.now(),r=e-Nx;r>iF&&(Px-=r,Nx=e)}function k8e(){for(var e,r=Mx,n,o=1/0;r;)r._call?(o>r._time&&(o=r._time),e=r,r=r._next):(n=r._next,r._next=null,r=e?e._next=n:Mx=n);O1=e,$7(o)}function $7(e){if(!tf){B1&&(B1=clearTimeout(B1));var r=e-Gu;r>24?(e<1/0&&(B1=setTimeout(sF,e-L1.now()-Px)),I1&&(I1=clearInterval(I1))):(I1||(Nx=L1.now(),I1=setInterval(w8e,iF)),tf=1,aF(sF))}}function cF(e,r,n){var o=new Bx;return r=r==null?0:+r,o.restart(i=>{o.stop(),e(i+r)},r,n),o}var _8e=kx("start","end","cancel","interrupt"),S8e=[],dF=0,uF=1,R7=2,Ix=3,pF=4,z7=5,Ox=6;function Lx(e,r,n,o,i,a){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;E8e(e,n,{name:r,index:o,group:i,on:_8e,tween:S8e,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:dF})}function T7(e,r){var n=Xa(e,r);if(n.state>dF)throw new Error("too late; already scheduled");return n}function Wl(e,r){var n=Xa(e,r);if(n.state>Ix)throw new Error("too late; already running");return n}function Xa(e,r){var n=e.__transition;if(!n||!(n=n[r]))throw new Error("transition not found");return n}function E8e(e,r,n){var o=e.__transition,i;o[r]=n,n.timer=lF(a,0,n.time);function a(d){n.state=uF,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var u,p,f,g;if(n.state!==uF)return c();for(u in o)if(g=o[u],g.name===n.name){if(g.state===Ix)return cF(l);g.state===pF?(g.state=Ox,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[u]):+uR7&&o.state=0&&(r=r.slice(0,n)),!r||r==="start"})}function t7e(e,r,n){var o,i,a=e7e(r)?T7:Wl;return function(){var l=a(this,e),s=l.on;s!==o&&(i=(o=s).copy()).on(r,n),l.on=i}}function r7e(e,r){var n=this._id;return arguments.length<2?Xa(this.node(),n).on.on(e):this.each(t7e(n,e,r))}function n7e(e){return function(){var r=this.parentNode;for(var n in this.__transition)if(+n!==e)return;r&&r.removeChild(this)}}function o7e(){return this.on("end.remove",n7e(this._id))}function i7e(e){var r=this._name,n=this._id;typeof e!="function"&&(e=g7(e));for(var o=this._groups,i=o.length,a=new Array(i),l=0;l()=>e;function T7e(e,{sourceEvent:r,target:n,transform:o,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function Us(e,r,n){this.k=e,this.x=r,this.y=n}Us.prototype={constructor:Us,scale:function(e){return e===1?this:new Us(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new Us(this.k,this.x+this.k*e,this.y+this.k*r)},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 qx=new Us(1,0,0);gF.prototype=Us.prototype;function gF(e){for(;!e.__zoom;)if(!(e=e.parentNode))return qx;return e.__zoom}function A7(e){e.stopImmediatePropagation()}function F1(e){e.preventDefault(),e.stopImmediatePropagation()}function j7e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function A7e(){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 yF(){return this.__zoom||qx}function D7e(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function M7e(){return navigator.maxTouchPoints||"ontouchstart"in this}function N7e(e,r,n){var o=e.invertX(r[0][0])-n[0][0],i=e.invertX(r[1][0])-n[1][0],a=e.invertY(r[0][1])-n[0][1],l=e.invertY(r[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),l>a?(a+l)/2:Math.min(0,a)||Math.max(0,l))}function vF(){var e=j7e,r=A7e,n=N7e,o=D7e,i=M7e,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Dx,d=kx("start","zoom","end"),u,p,f,g=500,v=150,w=0,x=10;function k(M){M.property("__zoom",yF).on("wheel.zoom",z,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",P).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(M,V,B,F){var q=M.selection?M.selection():M;q.property("__zoom",yF),M!==q?R(M,V,B,F):q.interrupt().each(function(){T(this,arguments).event(F).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},k.scaleBy=function(M,V,B,F){k.scaleTo(M,function(){var q=this.__zoom.k,G=typeof V=="function"?V.apply(this,arguments):V;return q*G},B,F)},k.scaleTo=function(M,V,B,F){k.transform(M,function(){var q=r.apply(this,arguments),G=this.__zoom,U=B==null?$(q):typeof B=="function"?B.apply(this,arguments):B,Y=G.invert(U),K=typeof V=="function"?V.apply(this,arguments):V;return n(_(C(G,K),U,Y),q,l)},B,F)},k.translateBy=function(M,V,B,F){k.transform(M,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof B=="function"?B.apply(this,arguments):B),r.apply(this,arguments),l)},null,F)},k.translateTo=function(M,V,B,F,q){k.transform(M,function(){var G=r.apply(this,arguments),U=this.__zoom,Y=F==null?$(G):typeof F=="function"?F.apply(this,arguments):F;return n(qx.translate(Y[0],Y[1]).scale(U.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof B=="function"?-B.apply(this,arguments):-B),G,l)},F,q)};function C(M,V){return V=Math.max(a[0],Math.min(a[1],V)),V===M.k?M:new Us(V,M.x,M.y)}function _(M,V,B){var F=V[0]-B[0]*M.k,q=V[1]-B[1]*M.k;return F===M.x&&q===M.y?M:new Us(M.k,F,q)}function $(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function R(M,V,B,F){M.on("start.zoom",function(){T(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(F).end()}).tween("zoom",function(){var q=this,G=arguments,U=T(q,G).event(F),Y=r.apply(q,G),K=B==null?$(Y):typeof B=="function"?B.apply(q,G):B,O=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),W=q.__zoom,Z=typeof V=="function"?V.apply(q,G):V,Q=c(W.invert(K).concat(O/W.k),Z.invert(K).concat(O/Z.k));return function(ie){if(ie===1)ie=Z;else{var te=Q(ie),re=O/te[2];ie=new Us(re,K[0]-te[0]*re,K[1]-te[1]*re)}U.zoom(null,ie)}})}function T(M,V,B){return!B&&M.__zooming||new A(M,V)}function A(M,V){this.that=M,this.args=V,this.active=0,this.sourceEvent=null,this.extent=r.apply(M,V),this.taps=0}A.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,V){return this.mouse&&M!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var V=Ei(this.that).datum();d.call(M,this.that,new T7e(M,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),V)}};function z(M,...V){if(!e.apply(this,arguments))return;var B=T(this,V).event(M),F=this.__zoom,q=Math.max(a[0],Math.min(a[1],F.k*Math.pow(2,o.apply(this,arguments)))),G=Ga(M);if(B.wheel)(B.mouse[0][0]!==G[0]||B.mouse[0][1]!==G[1])&&(B.mouse[1]=F.invert(B.mouse[0]=G)),clearTimeout(B.wheel);else{if(F.k===q)return;B.mouse=[G,F.invert(G)],Fx(this),B.start()}F1(M),B.wheel=setTimeout(U,v),B.zoom("mouse",n(_(C(F,q),B.mouse[0],B.mouse[1]),B.extent,l));function U(){B.wheel=null,B.end()}}function j(M,...V){if(f||!e.apply(this,arguments))return;var B=M.currentTarget,F=T(this,V,!0).event(M),q=Ei(M.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",O,!0),G=Ga(M,B),U=M.clientX,Y=M.clientY;OL(M.view),A7(M),F.mouse=[G,this.__zoom.invert(G)],Fx(this),F.start();function K(W){if(F1(W),!F.moved){var Z=W.clientX-U,Q=W.clientY-Y;F.moved=Z*Z+Q*Q>w}F.event(W).zoom("mouse",n(_(F.that.__zoom,F.mouse[0]=Ga(W,B),F.mouse[1]),F.extent,l))}function O(W){q.on("mousemove.zoom mouseup.zoom",null),LL(W.view,F.moved),F1(W),F.event(W).end()}}function I(M,...V){if(e.apply(this,arguments)){var B=this.__zoom,F=Ga(M.changedTouches?M.changedTouches[0]:M,this),q=B.invert(F),G=B.k*(M.shiftKey?.5:2),U=n(_(C(B,G),F,q),r.apply(this,V),l);F1(M),s>0?Ei(this).transition().duration(s).call(R,U,F,M):Ei(this).call(k.transform,U,F,M)}}function P(M,...V){if(e.apply(this,arguments)){var B=M.touches,F=B.length,q=T(this,V,M.changedTouches.length===F).event(M),G,U,Y,K;for(A7(M),U=0;U"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:r,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},V1=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],bF=["Enter"," ","Escape"],xF={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:r,y:n})=>`Moved selected node ${e}. New position, x: ${r}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var rf;(function(e){e.Strict="strict",e.Loose="loose"})(rf||(rf={}));var Yu;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Yu||(Yu={}));var q1;(function(e){e.Partial="partial",e.Full="full"})(q1||(q1={}));const wF={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var id;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(id||(id={}));var Hx;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Hx||(Hx={}));var Ue;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ue||(Ue={}));const kF={[Ue.Left]:Ue.Right,[Ue.Right]:Ue.Left,[Ue.Top]:Ue.Bottom,[Ue.Bottom]:Ue.Top};function _F(e){return e===null?null:e?"valid":"invalid"}const SF=e=>"id"in e&&"source"in e&&"target"in e,P7e=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),D7=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),H1=(e,r=[0,0])=>{const{width:n,height:o}=_o(e),i=e.origin??r,a=n*i[0],l=o*i[1];return{x:e.position.x-a,y:e.position.y-l}},EF=(e,r={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,i)=>{const a=typeof i=="string";let l=!r.nodeLookup&&!a?i:void 0;r.nodeLookup&&(l=a?r.nodeLookup.get(i):D7(i)?i:r.nodeLookup.get(i.id));const s=l?Gx(l,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ux(o,s)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Wx(n)},nf=(e,r={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(i=>{(r.filter===void 0||r.filter(i))&&(n=Ux(n,Gx(i)),o=!0)}),o?Wx(n):{x:0,y:0,width:0,height:0}},M7=(e,r,[n,o,i]=[0,0,1],a=!1,l=!1)=>{const s={...G1(r,[n,o,i]),width:r.width/i,height:r.height/i},c=[];for(const d of e.values()){const{measured:u,selectable:p=!0,hidden:f=!1}=d;if(l&&!p||f)continue;const g=u.width??d.width??d.initialWidth??null,v=u.height??d.height??d.initialHeight??null,w=U1(s,Ku(d)),x=(g??0)*(v??0),k=a&&w>0;(!d.internals.handleBounds||k||w>=x||d.dragging)&&c.push(d)}return c},B7e=(e,r)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),r.filter(o=>n.has(o.source)||n.has(o.target))};function I7e(e,r){const n=new Map,o=r?.nodes?new Set(r.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&(r?.includeHiddenNodes||!i.hidden)&&(!o||o.has(i.id))&&n.set(i.id,i)}),n}async function O7e({nodes:e,width:r,height:n,panZoom:o,minZoom:i,maxZoom:a},l){if(e.size===0)return Promise.resolve(!0);const s=I7e(e,l),c=nf(s),d=Ws(c,r,n,l?.minZoom??i,l?.maxZoom??a,l?.padding??.1);return await o.setViewport(d,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function CF({nodeId:e,nextPosition:r,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:i,onError:a}){const l=n.get(e),s=l.parentId?n.get(l.parentId):void 0,{x:c,y:d}=s?s.internals.positionAbsolute:{x:0,y:0},u=l.origin??o;let p=l.extent||i;if(l.extent==="parent"&&!l.expandParent)if(!s)a?.("005",Gl.error005());else{const g=s.measured.width,v=s.measured.height;g&&v&&(p=[[c,d],[c+g,d+v]])}else s&&sf(l.extent)&&(p=[[l.extent[0][0]+c,l.extent[0][1]+d],[l.extent[1][0]+c,l.extent[1][1]+d]]);const f=sf(p)?Xu(r,p,l.measured):r;return(l.measured.width===void 0||l.measured.height===void 0)&&a?.("015",Gl.error015()),{position:{x:f.x-c+(l.measured.width??0)*u[0],y:f.y-d+(l.measured.height??0)*u[1]},positionAbsolute:f}}async function L7e({nodesToRemove:e=[],edgesToRemove:r=[],nodes:n,edges:o,onBeforeDelete:i}){const a=new Set(e.map(p=>p.id)),l=[];for(const p of n){if(p.deletable===!1)continue;const f=a.has(p.id),g=!f&&p.parentId&&l.find(v=>v.id===p.parentId);(f||g)&&l.push(p)}const s=new Set(r.map(p=>p.id)),c=o.filter(p=>p.deletable!==!1),d=B7e(l,c);for(const p of c)s.has(p.id)&&!d.find(f=>f.id===p.id)&&d.push(p);if(!i)return{edges:d,nodes:l};const u=await i({nodes:l,edges:d});return typeof u=="boolean"?u?{edges:d,nodes:l}:{edges:[],nodes:[]}:u}const of=(e,r=0,n=1)=>Math.min(Math.max(e,r),n),Xu=(e={x:0,y:0},r,n)=>({x:of(e.x,r[0][0],r[1][0]-(n?.width??0)),y:of(e.y,r[0][1],r[1][1]-(n?.height??0))});function $F(e,r,n){const{width:o,height:i}=_o(n),{x:a,y:l}=n.internals.positionAbsolute;return Xu(e,[[a,l],[a+o,l+i]],r)}const RF=(e,r,n)=>en?-of(Math.abs(e-n),1,r)/r:0,zF=(e,r,n=15,o=40)=>{const i=RF(e.x,o,r.width-o)*n,a=RF(e.y,o,r.height-o)*n;return[i,a]},Ux=(e,r)=>({x:Math.min(e.x,r.x),y:Math.min(e.y,r.y),x2:Math.max(e.x2,r.x2),y2:Math.max(e.y2,r.y2)}),N7=({x:e,y:r,width:n,height:o})=>({x:e,y:r,x2:e+n,y2:r+o}),Wx=({x:e,y:r,x2:n,y2:o})=>({x:e,y:r,width:n-e,height:o-r}),Ku=(e,r=[0,0])=>{const{x:n,y:o}=D7(e)?e.internals.positionAbsolute:H1(e,r);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Gx=(e,r=[0,0])=>{const{x:n,y:o}=D7(e)?e.internals.positionAbsolute:H1(e,r);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},TF=(e,r)=>Wx(Ux(N7(e),N7(r))),U1=(e,r)=>{const n=Math.max(0,Math.min(e.x+e.width,r.x+r.width)-Math.max(e.x,r.x)),o=Math.max(0,Math.min(e.y+e.height,r.y+r.height)-Math.max(e.y,r.y));return Math.ceil(n*o)},jF=e=>Ka(e.width)&&Ka(e.height)&&Ka(e.x)&&Ka(e.y),Ka=e=>!isNaN(e)&&isFinite(e),F7e=(e,r)=>{},W1=(e,r=[1,1])=>({x:r[0]*Math.round(e.x/r[0]),y:r[1]*Math.round(e.y/r[1])}),G1=({x:e,y:r},[n,o,i],a=!1,l=[1,1])=>{const s={x:(e-n)/i,y:(r-o)/i};return a?W1(s,l):s},Yx=({x:e,y:r},[n,o,i])=>({x:e*i+n,y:r*i+o});function af(e,r){if(typeof e=="number")return Math.floor((r-r/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(r*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function V7e(e,r,n){if(typeof e=="string"||typeof e=="number"){const o=af(e,n),i=af(e,r);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof e=="object"){const o=af(e.top??e.y??0,n),i=af(e.bottom??e.y??0,n),a=af(e.left??e.x??0,r),l=af(e.right??e.x??0,r);return{top:o,right:l,bottom:i,left:a,x:a+l,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function q7e(e,r,n,o,i,a){const{x:l,y:s}=Yx(e,[r,n,o]),{x:c,y:d}=Yx({x:e.x+e.width,y:e.y+e.height},[r,n,o]),u=i-c,p=a-d;return{left:Math.floor(l),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(p)}}const Ws=(e,r,n,o,i,a)=>{const l=V7e(a,r,n),s=(r-l.x)/e.width,c=(n-l.y)/e.height,d=Math.min(s,c),u=of(d,o,i),p=e.x+e.width/2,f=e.y+e.height/2,g=r/2-p*u,v=n/2-f*u,w=q7e(e,g,v,u,r,n),x={left:Math.min(w.left-l.left,0),top:Math.min(w.top-l.top,0),right:Math.min(w.right-l.right,0),bottom:Math.min(w.bottom-l.bottom,0)};return{x:g-x.left+x.right,y:v-x.top+x.bottom,zoom:u}},lf=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function sf(e){return e!=null&&e!=="parent"}function _o(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function AF(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function DF(e,r={width:0,height:0},n,o,i){const a={...e},l=o.get(n);if(l){const s=l.origin||i;a.x+=l.internals.positionAbsolute.x-(r.width??0)*s[0],a.y+=l.internals.positionAbsolute.y-(r.height??0)*s[1]}return a}function MF(e,r){if(e.size!==r.size)return!1;for(const n of e)if(!r.has(n))return!1;return!0}function H7e(){let e,r;return{promise:new Promise((n,o)=>{e=n,r=o}),resolve:e,reject:r}}function U7e(e){return{...xF,...e||{}}}function Y1(e,{snapGrid:r=[0,0],snapToGrid:n=!1,transform:o,containerBounds:i}){const{x:a,y:l}=Za(e),s=G1({x:a-(i?.left??0),y:l-(i?.top??0)},o),{x:c,y:d}=n?W1(s,r):s;return{xSnapped:c,ySnapped:d,...s}}const P7=e=>({width:e.offsetWidth,height:e.offsetHeight}),NF=e=>e?.getRootNode?.()||window?.document,W7e=["INPUT","SELECT","TEXTAREA"];function PF(e){const r=e.composedPath?.()?.[0]||e.target;return r?.nodeType!==1?!1:W7e.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const BF=e=>"clientX"in e,Za=(e,r)=>{const n=BF(e),o=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:o-(r?.left??0),y:i-(r?.top??0)}},IF=(e,r,n,o,i)=>{const a=r.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(l=>{const s=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:i,position:l.getAttribute("data-handlepos"),x:(s.left-n.left)/o,y:(s.top-n.top)/o,...P7(l)}})};function OF({sourceX:e,sourceY:r,targetX:n,targetY:o,sourceControlX:i,sourceControlY:a,targetControlX:l,targetControlY:s}){const c=e*.125+i*.375+l*.375+n*.125,d=r*.125+a*.375+s*.375+o*.125,u=Math.abs(c-e),p=Math.abs(d-r);return[c,d,u,p]}function Xx(e,r){return e>=0?.5*e:r*25*Math.sqrt(-e)}function LF({pos:e,x1:r,y1:n,x2:o,y2:i,c:a}){switch(e){case Ue.Left:return[r-Xx(r-o,a),n];case Ue.Right:return[r+Xx(o-r,a),n];case Ue.Top:return[r,n-Xx(n-i,a)];case Ue.Bottom:return[r,n+Xx(i-n,a)]}}function Kx({sourceX:e,sourceY:r,sourcePosition:n=Ue.Bottom,targetX:o,targetY:i,targetPosition:a=Ue.Top,curvature:l=.25}){const[s,c]=LF({pos:n,x1:e,y1:r,x2:o,y2:i,c:l}),[d,u]=LF({pos:a,x1:o,y1:i,x2:e,y2:r,c:l}),[p,f,g,v]=OF({sourceX:e,sourceY:r,targetX:o,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:d,targetControlY:u});return[`M${e},${r} C${s},${c} ${d},${u} ${o},${i}`,p,f,g,v]}function FF({sourceX:e,sourceY:r,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,a=n0}const X7e=({source:e,sourceHandle:r,target:n,targetHandle:o})=>`xy-edge__${e}${r||""}-${n}${o||""}`,K7e=(e,r)=>r.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Z7e=(e,r,n={})=>{if(!e.source||!e.target)return r;const o=n.getEdgeId||X7e;let i;return SF(e)?i={...e}:i={...e,id:o(e)},K7e(i,r)?r:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,r.concat(i))};function VF({sourceX:e,sourceY:r,targetX:n,targetY:o}){const[i,a,l,s]=FF({sourceX:e,sourceY:r,targetX:n,targetY:o});return[`M ${e},${r}L ${n},${o}`,i,a,l,s]}const qF={[Ue.Left]:{x:-1,y:0},[Ue.Right]:{x:1,y:0},[Ue.Top]:{x:0,y:-1},[Ue.Bottom]:{x:0,y:1}},Q7e=({source:e,sourcePosition:r=Ue.Bottom,target:n})=>r===Ue.Left||r===Ue.Right?e.xMath.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2));function J7e({source:e,sourcePosition:r=Ue.Bottom,target:n,targetPosition:o=Ue.Top,center:i,offset:a,stepPosition:l}){const s=qF[r],c=qF[o],d={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},p=Q7e({source:d,sourcePosition:r,target:u}),f=p.x!==0?"x":"y",g=p[f];let v=[],w,x;const k={x:0,y:0},C={x:0,y:0},[,,_,$]=FF({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f==="x"?(w=i.x??d.x+(u.x-d.x)*l,x=i.y??(d.y+u.y)/2):(w=i.x??(d.x+u.x)/2,x=i.y??d.y+(u.y-d.y)*l);const R=[{x:w,y:d.y},{x:w,y:u.y}],T=[{x:d.x,y:x},{x:u.x,y:x}];s[f]===g?v=f==="x"?R:T:v=f==="x"?T:R}else{const R=[{x:d.x,y:u.y}],T=[{x:u.x,y:d.y}];if(f==="x"?v=s.x===g?T:R:v=s.y===g?R:T,r===o){const P=Math.abs(e[f]-n[f]);if(P<=a){const L=Math.min(a-1,a-P);s[f]===g?k[f]=(d[f]>e[f]?-1:1)*L:C[f]=(u[f]>n[f]?-1:1)*L}}if(r!==o){const P=f==="x"?"y":"x",L=s[f]===c[P],H=d[P]>u[P],M=d[P]=I?(w=(A.x+z.x)/2,x=v[0].y):(w=v[0].x,x=(A.y+z.y)/2)}return[[e,{x:d.x+k.x,y:d.y+k.y},...v,{x:u.x+C.x,y:u.y+C.y},n],w,x,_,$]}function e9e(e,r,n,o){const i=Math.min(HF(e,r)/2,HF(r,n)/2,o),{x:a,y:l}=r;if(e.x===a&&a===n.x||e.y===l&&l===n.y)return`L${a} ${l}`;if(e.y===l){const d=e.x{let _="";return C>0&&Cn.id===r):e[0])||null}function B7(e,r){return e?typeof e=="string"?e:`${r?`${r}__`:""}${Object.keys(e).sort().map(n=>`${n}=${e[n]}`).join("&")}`:""}function t9e(e,{id:r,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:i}){const a=new Set;return e.reduce((l,s)=>([s.markerStart||o,s.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const d=B7(c,r);a.has(d)||(l.push({id:d,color:c.color||n,...c}),a.add(d))}}),l),[]).sort((l,s)=>l.id.localeCompare(s.id))}function r9e(e,r,n,o,i){let a=.5;i==="start"?a=0:i==="end"&&(a=1);let l=[(e.x+e.width*a)*r.zoom+r.x,e.y*r.zoom+r.y-o],s=[-100*a,-100];switch(n){case Ue.Right:l=[(e.x+e.width)*r.zoom+r.x+o,(e.y+e.height*a)*r.zoom+r.y],s=[0,-100*a];break;case Ue.Bottom:l[1]=(e.y+e.height)*r.zoom+r.y+o,s[1]=0;break;case Ue.Left:l=[e.x*r.zoom+r.x-o,(e.y+e.height*a)*r.zoom+r.y],s=[-100,-100*a];break}return`translate(${l[0]}px, ${l[1]}px) translate(${s[0]}%, ${s[1]}%)`}const XF=1e3,n9e=10,I7={nodeOrigin:[0,0],nodeExtent:V1,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},o9e={...I7,checkEquality:!0};function O7(e,r){const n={...e};for(const o in r)r[o]!==void 0&&(n[o]=r[o]);return n}function i9e(e,r,n){const o=O7(I7,n);for(const i of e.values())if(i.parentId)V7(i,e,r,o);else{const a=H1(i,o.nodeOrigin),l=sf(i.extent)?i.extent:o.nodeExtent,s=Xu(a,l,_o(i));i.internals.positionAbsolute=s}}function a9e(e,r){if(!e.handles)return e.measured?r?.internals.handleBounds:void 0;const n=[],o=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(a):i.type==="target"&&o.push(a)}return{source:n,target:o}}function L7(e){return e==="manual"}function F7(e,r,n,o={}){const i=O7(o9e,o),a={i:0},l=new Map(r),s=i?.elevateNodesOnSelect&&!L7(i.zIndexMode)?XF:0;let c=e.length>0;r.clear(),n.clear();for(const d of e){let u=l.get(d.id);if(i.checkEquality&&d===u?.internals.userNode)r.set(d.id,u);else{const p=H1(d,i.nodeOrigin),f=sf(d.extent)?d.extent:i.nodeExtent,g=Xu(p,f,_o(d));u={...i.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:g,handleBounds:a9e(d,u),z:KF(d,s,i.zIndexMode),userNode:d}},r.set(d.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(c=!1),d.parentId&&V7(u,r,n,o,a)}return c}function l9e(e,r){if(!e.parentId)return;const n=r.get(e.parentId);n?n.set(e.id,e):r.set(e.parentId,new Map([[e.id,e]]))}function V7(e,r,n,o,i){const{elevateNodesOnSelect:a,nodeOrigin:l,nodeExtent:s,zIndexMode:c}=O7(I7,o),d=e.parentId,u=r.get(d);if(!u){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}l9e(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c==="auto"&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*n9e),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);const p=a&&!L7(c)?XF:0,{x:f,y:g,z:v}=s9e(e,u,l,s,p,c),{positionAbsolute:w}=e.internals,x=f!==w.x||g!==w.y;(x||v!==e.internals.z)&&r.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:g}:w,z:v}})}function KF(e,r,n){const o=Ka(e.zIndex)?e.zIndex:0;return L7(n)?o:o+(e.selected?r:0)}function s9e(e,r,n,o,i,a){const{x:l,y:s}=r.internals.positionAbsolute,c=_o(e),d=H1(e,n),u=sf(e.extent)?Xu(d,e.extent,c):d;let p=Xu({x:l+u.x,y:s+u.y},o,c);e.extent==="parent"&&(p=$F(p,c,r));const f=KF(e,i,a),g=r.internals.z??0;return{x:p.x,y:p.y,z:g>=f?g+1:f}}function q7(e,r,n,o=[0,0]){const i=[],a=new Map;for(const l of e){const s=r.get(l.parentId);if(!s)continue;const c=a.get(l.parentId)?.expandedRect??Ku(s),d=TF(c,l.rect);a.set(l.parentId,{expandedRect:d,parent:s})}return a.size>0&&a.forEach(({expandedRect:l,parent:s},c)=>{const d=s.internals.positionAbsolute,u=_o(s),p=s.origin??o,f=l.x0||g>0||x||k)&&(i.push({id:c,type:"position",position:{x:s.position.x-f+x,y:s.position.y-g+k}}),n.get(c)?.forEach(C=>{e.some(_=>_.id===C.id)||i.push({id:C.id,type:"position",position:{x:C.position.x+f,y:C.position.y+g}})})),(u.width0){const g=q7(f,r,n,i);d.push(...g)}return{changes:d,updatedInternals:c}}async function d9e({delta:e,panZoom:r,transform:n,translateExtent:o,width:i,height:a}){if(!r||!e.x&&!e.y)return Promise.resolve(!1);const l=await r.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],o),s=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(s)}function ZF(e,r,n,o,i,a){let l=i;const s=o.get(l)||new Map;o.set(l,s.set(n,r)),l=`${i}-${e}`;const c=o.get(l)||new Map;if(o.set(l,c.set(n,r)),a){l=`${i}-${e}-${a}`;const d=o.get(l)||new Map;o.set(l,d.set(n,r))}}function QF(e,r,n){e.clear(),r.clear();for(const o of n){const{source:i,target:a,sourceHandle:l=null,targetHandle:s=null}=o,c={edgeId:o.id,source:i,target:a,sourceHandle:l,targetHandle:s},d=`${i}-${l}--${a}-${s}`,u=`${a}-${s}--${i}-${l}`;ZF("source",c,u,e,i,l),ZF("target",c,d,e,a,s),r.set(o.id,o)}}function JF(e,r){if(!e.parentId)return!1;const n=r.get(e.parentId);return n?n.selected?!0:JF(n,r):!1}function eV(e,r,n){let o=e;do{if(o?.matches?.(r))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function u9e(e,r,n,o){const i=new Map;for(const[a,l]of e)if((l.selected||l.id===o)&&(!l.parentId||!JF(l,e))&&(l.draggable||r&&typeof l.draggable>"u")){const s=e.get(a);s&&i.set(a,{id:a,position:s.position||{x:0,y:0},distance:{x:n.x-s.internals.positionAbsolute.x,y:n.y-s.internals.positionAbsolute.y},extent:s.extent,parentId:s.parentId,origin:s.origin,expandParent:s.expandParent,internals:{positionAbsolute:s.internals.positionAbsolute||{x:0,y:0}},measured:{width:s.measured.width??0,height:s.measured.height??0}})}return i}function H7({nodeId:e,dragItems:r,nodeLookup:n,dragging:o=!0}){const i=[];for(const[l,s]of r){const c=n.get(l)?.internals.userNode;c&&i.push({...c,position:s.position,dragging:o})}if(!e)return[i[0],i];const a=n.get(e)?.internals.userNode;return[a?{...a,position:r.get(e)?.position||a.position,dragging:o}:i[0],i]}function p9e({dragItems:e,snapGrid:r,x:n,y:o}){const i=e.values().next().value;if(!i)return null;const a={x:n-i.distance.x,y:o-i.distance.y},l=W1(a,r);return{x:l.x-a.x,y:l.y-a.y}}function h9e({onNodeMouseDown:e,getStoreItems:r,onDragStart:n,onDrag:o,onDragStop:i}){let a={x:null,y:null},l=0,s=new Map,c=!1,d={x:0,y:0},u=null,p=!1,f=null,g=!1,v=!1,w=null;function x({noDragClassName:C,handleSelector:_,domNode:$,isSelectable:R,nodeId:T,nodeClickDistance:A=0}){f=Ei($);function z({x:L,y:H}){const{nodeLookup:M,nodeExtent:V,snapGrid:B,snapToGrid:F,nodeOrigin:q,onNodeDrag:G,onSelectionDrag:U,onError:Y,updateNodePositions:K}=r();a={x:L,y:H};let O=!1;const W=s.size>1,Z=W&&V?N7(nf(s)):null,Q=W&&F?p9e({dragItems:s,snapGrid:B,x:L,y:H}):null;for(const[ie,te]of s){if(!M.has(ie))continue;let re={x:L-te.distance.x,y:H-te.distance.y};F&&(re=Q?{x:Math.round(re.x+Q.x),y:Math.round(re.y+Q.y)}:W1(re,B));let ue=null;if(W&&V&&!te.extent&&Z){const{positionAbsolute:pe}=te.internals,xe=pe.x-Z.x+V[0][0],je=pe.x+te.measured.width-Z.x2+V[1][0],Be=pe.y-Z.y+V[0][1],Je=pe.y+te.measured.height-Z.y2+V[1][1];ue=[[xe,Be],[je,Je]]}const{position:_e,positionAbsolute:ce}=CF({nodeId:ie,nextPosition:re,nodeLookup:M,nodeExtent:ue||V,nodeOrigin:q,onError:Y});O=O||te.position.x!==_e.x||te.position.y!==_e.y,te.position=_e,te.internals.positionAbsolute=ce}if(v=v||O,!!O&&(K(s,!0),w&&(o||G||!T&&U))){const[ie,te]=H7({nodeId:T,dragItems:s,nodeLookup:M});o?.(w,s,ie,te),G?.(w,ie,te),T||U?.(w,te)}}async function j(){if(!u)return;const{transform:L,panBy:H,autoPanSpeed:M,autoPanOnNodeDrag:V}=r();if(!V){c=!1,cancelAnimationFrame(l);return}const[B,F]=zF(d,u,M);(B!==0||F!==0)&&(a.x=(a.x??0)-B/L[2],a.y=(a.y??0)-F/L[2],await H({x:B,y:F})&&z(a)),l=requestAnimationFrame(j)}function I(L){const{nodeLookup:H,multiSelectionActive:M,nodesDraggable:V,transform:B,snapGrid:F,snapToGrid:q,selectNodesOnDrag:G,onNodeDragStart:U,onSelectionDragStart:Y,unselectNodesAndEdges:K}=r();p=!0,(!G||!R)&&!M&&T&&(H.get(T)?.selected||K()),R&&G&&T&&e?.(T);const O=Y1(L.sourceEvent,{transform:B,snapGrid:F,snapToGrid:q,containerBounds:u});if(a=O,s=u9e(H,V,O,T),s.size>0&&(n||U||!T&&Y)){const[W,Z]=H7({nodeId:T,dragItems:s,nodeLookup:H});n?.(L.sourceEvent,s,W,Z),U?.(L.sourceEvent,W,Z),T||Y?.(L.sourceEvent,Z)}}const P=FL().clickDistance(A).on("start",L=>{const{domNode:H,nodeDragThreshold:M,transform:V,snapGrid:B,snapToGrid:F}=r();u=H?.getBoundingClientRect()||null,g=!1,v=!1,w=L.sourceEvent,M===0&&I(L),a=Y1(L.sourceEvent,{transform:V,snapGrid:B,snapToGrid:F,containerBounds:u}),d=Za(L.sourceEvent,u)}).on("drag",L=>{const{autoPanOnNodeDrag:H,transform:M,snapGrid:V,snapToGrid:B,nodeDragThreshold:F,nodeLookup:q}=r(),G=Y1(L.sourceEvent,{transform:M,snapGrid:V,snapToGrid:B,containerBounds:u});if(w=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||T&&!q.has(T))&&(g=!0),!g){if(!c&&H&&p&&(c=!0,j()),!p){const U=Za(L.sourceEvent,u),Y=U.x-d.x,K=U.y-d.y;Math.sqrt(Y*Y+K*K)>F&&I(L)}(a.x!==G.xSnapped||a.y!==G.ySnapped)&&s&&p&&(d=Za(L.sourceEvent,u),z(G))}}).on("end",L=>{if(!(!p||g)&&(c=!1,p=!1,cancelAnimationFrame(l),s.size>0)){const{nodeLookup:H,updateNodePositions:M,onNodeDragStop:V,onSelectionDragStop:B}=r();if(v&&(M(s,!1),v=!1),i||V||!T&&B){const[F,q]=H7({nodeId:T,dragItems:s,nodeLookup:H,dragging:!1});i?.(L.sourceEvent,s,F,q),V?.(L.sourceEvent,F,q),T||B?.(L.sourceEvent,q)}}}).filter(L=>{const H=L.target;return!L.button&&(!C||!eV(H,`.${C}`,$))&&(!_||eV(H,_,$))});f.call(P)}function k(){f?.on(".drag",null)}return{update:x,destroy:k}}function f9e(e,r,n){const o=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of r.values())U1(i,Ku(a))>0&&o.push(a);return o}const m9e=250;function g9e(e,r,n,o){let i=[],a=1/0;const l=f9e(e,n,r+m9e);for(const s of l){const c=[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]];for(const d of c){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:u,y:p}=Zu(s,d,d.position,!0),f=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(p-e.y,2));f>r||(f1){const s=o.type==="source"?"target":"source";return i.find(c=>c.type===s)??i[0]}return i[0]}function tV(e,r,n,o,i,a=!1){const l=o.get(e);if(!l)return null;const s=i==="strict"?l.internals.handleBounds?.[r]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],c=(n?s?.find(d=>d.id===n):s?.[0])??null;return c&&a?{...c,...Zu(l,c,c.position,!0)}:c}function rV(e,r){return e||(r?.classList.contains("target")?"target":r?.classList.contains("source")?"source":null)}function y9e(e,r){let n=null;return r?n=!0:e&&!r&&(n=!1),n}const nV=()=>!0;function v9e(e,{connectionMode:r,connectionRadius:n,handleId:o,nodeId:i,edgeUpdaterType:a,isTarget:l,domNode:s,nodeLookup:c,lib:d,autoPanOnConnect:u,flowId:p,panBy:f,cancelConnection:g,onConnectStart:v,onConnect:w,onConnectEnd:x,isValidConnection:k=nV,onReconnectEnd:C,updateConnection:_,getTransform:$,getFromHandle:R,autoPanSpeed:T,dragThreshold:A=1,handleDomNode:z}){const j=NF(e.target);let I=0,P;const{x:L,y:H}=Za(e),M=rV(a,z),V=s?.getBoundingClientRect();let B=!1;if(!V||!M)return;const F=tV(i,M,o,c,r);if(!F)return;let q=Za(e,V),G=!1,U=null,Y=!1,K=null;function O(){if(!u||!V)return;const[ue,_e]=zF(q,V,T);f({x:ue,y:_e}),I=requestAnimationFrame(O)}const W={...F,nodeId:i,type:M,position:F.position},Z=c.get(i);let Q={inProgress:!0,isValid:null,from:Zu(Z,W,Ue.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:Z,to:q,toHandle:null,toPosition:kF[W.position],toNode:null,pointer:q};function ie(){B=!0,_(Q),v?.(e,{nodeId:i,handleId:o,handleType:M})}A===0&&ie();function te(ue){if(!B){const{x:Be,y:Je}=Za(ue),st=Be-L,Le=Je-H;if(!(st*st+Le*Le>A*A))return;ie()}if(!R()||!W){re(ue);return}const _e=$();q=Za(ue,V),P=g9e(G1(q,_e,!1,[1,1]),n,c,W),G||(O(),G=!0);const ce=oV(ue,{handle:P,connectionMode:r,fromNodeId:i,fromHandleId:o,fromType:l?"target":"source",isValidConnection:k,doc:j,lib:d,flowId:p,nodeLookup:c});K=ce.handleDomNode,U=ce.connection,Y=y9e(!!P,ce.isValid);const pe=c.get(i),xe=pe?Zu(pe,W,Ue.Left,!0):Q.from,je={...Q,from:xe,isValid:Y,to:ce.toHandle&&Y?Yx({x:ce.toHandle.x,y:ce.toHandle.y},_e):q,toHandle:ce.toHandle,toPosition:Y&&ce.toHandle?ce.toHandle.position:kF[W.position],toNode:ce.toHandle?c.get(ce.toHandle.nodeId):null,pointer:q};_(je),Q=je}function re(ue){if(!("touches"in ue&&ue.touches.length>0)){if(B){(P||K)&&U&&Y&&w?.(U);const{inProgress:_e,...ce}=Q,pe={...ce,toPosition:Q.toHandle?Q.toPosition:null};x?.(ue,pe),a&&C?.(ue,pe)}g(),cancelAnimationFrame(I),G=!1,Y=!1,U=null,K=null,j.removeEventListener("mousemove",te),j.removeEventListener("mouseup",re),j.removeEventListener("touchmove",te),j.removeEventListener("touchend",re)}}j.addEventListener("mousemove",te),j.addEventListener("mouseup",re),j.addEventListener("touchmove",te),j.addEventListener("touchend",re)}function oV(e,{handle:r,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:a,doc:l,lib:s,flowId:c,isValidConnection:d=nV,nodeLookup:u}){const p=a==="target",f=r?l.querySelector(`.${s}-flow__handle[data-id="${c}-${r?.nodeId}-${r?.id}-${r?.type}"]`):null,{x:g,y:v}=Za(e),w=l.elementFromPoint(g,v),x=w?.classList.contains(`${s}-flow__handle`)?w:f,k={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const C=rV(void 0,x),_=x.getAttribute("data-nodeid"),$=x.getAttribute("data-handleid"),R=x.classList.contains("connectable"),T=x.classList.contains("connectableend");if(!_||!C)return k;const A={source:p?_:o,sourceHandle:p?$:i,target:p?o:_,targetHandle:p?i:$};k.connection=A;const z=R&&T&&(n===rf.Strict?p&&C==="source"||!p&&C==="target":_!==o||$!==i);k.isValid=z&&d(A),k.toHandle=tV(_,C,$,u,n,!0)}return k}const U7={onPointerDown:v9e,isValid:oV};function b9e({domNode:e,panZoom:r,getTransform:n,getViewScale:o}){const i=Ei(e);function a({translateExtent:s,width:c,height:d,zoomStep:u=1,pannable:p=!0,zoomable:f=!0,inversePan:g=!1}){const v=_=>{if(_.sourceEvent.type!=="wheel"||!r)return;const $=n(),R=_.sourceEvent.ctrlKey&&lf()?10:1,T=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*u,A=$[2]*Math.pow(2,T*R);r.scaleTo(A)};let w=[0,0];const x=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(w=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},k=_=>{const $=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!r)return;const R=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],T=[R[0]-w[0],R[1]-w[1]];w=R;const A=o()*Math.max($[2],Math.log($[2]))*(g?-1:1),z={x:$[0]-T[0]*A,y:$[1]-T[1]*A},j=[[0,0],[c,d]];r.setViewportConstrained({x:z.x,y:z.y,zoom:$[2]},j,s)},C=vF().on("start",x).on("zoom",p?k:null).on("zoom.wheel",f?v:null);i.call(C,{})}function l(){i.on("zoom",null)}return{update:a,destroy:l,pointer:Ga}}const Qx=e=>({x:e.x,y:e.y,zoom:e.k}),W7=({x:e,y:r,zoom:n})=>qx.translate(e,r).scale(n),cf=(e,r)=>e.target.closest(`.${r}`),iV=(e,r)=>r===2&&Array.isArray(e)&&e.includes(2),x9e=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,G7=(e,r=0,n=x9e,o=()=>{})=>{const i=typeof r=="number"&&r>0;return i||o(),i?e.transition().duration(r).ease(n).on("end",o):e},aV=e=>{const r=e.ctrlKey&&lf()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*r};function w9e({zoomPanValues:e,noWheelClassName:r,d3Selection:n,d3Zoom:o,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:l,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:d}){return u=>{if(cf(u,r))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(u.ctrlKey&&l){const x=Ga(u),k=aV(u),C=p*Math.pow(2,k);o.scaleTo(n,C,x,u);return}const f=u.deltaMode===1?20:1;let g=i===Yu.Vertical?0:u.deltaX*f,v=i===Yu.Horizontal?0:u.deltaY*f;!lf()&&u.shiftKey&&i!==Yu.Vertical&&(g=u.deltaY*f,v=0),o.translateBy(n,-(g/p)*a,-(v/p)*a,{internal:!0});const w=Qx(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c?.(u,w),e.panScrollTimeout=setTimeout(()=>{d?.(u,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,w))}}function k9e({noWheelClassName:e,preventScrolling:r,d3ZoomHandler:n}){return function(o,i){const a=o.type==="wheel",l=!r&&a&&!o.ctrlKey,s=cf(o,e);if(o.ctrlKey&&a&&s&&o.preventDefault(),l||s)return null;o.preventDefault(),n.call(this,o,i)}}function _9e({zoomPanValues:e,onDraggingChange:r,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const i=Qx(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,o.sourceEvent?.type==="mousedown"&&r(!0),n&&n?.(o.sourceEvent,i)}}function S9e({zoomPanValues:e,panOnDrag:r,onPaneContextMenu:n,onTransformChange:o,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&iV(r,e.mouseButton??0)),a.sourceEvent?.sync||o([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,Qx(a.transform))}}function E9e({zoomPanValues:e,panOnDrag:r,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:i,onPaneContextMenu:a}){return l=>{if(!l.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&iV(r,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&a(l.sourceEvent),e.usedRightMouseButton=!1,o(!1),i)){const s=Qx(l.transform);e.prevViewport=s,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(l.sourceEvent,s)},n?150:0)}}}function C9e({zoomActivationKeyPressed:e,zoomOnScroll:r,zoomOnPinch:n,panOnDrag:o,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:s,noPanClassName:c,lib:d,connectionInProgress:u}){return p=>{const f=e||r,g=n&&p.ctrlKey,v=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(cf(p,`${d}-flow__node`)||cf(p,`${d}-flow__edge`)))return!0;if(!o&&!f&&!i&&!a&&!n||l||u&&!v||cf(p,s)&&v||cf(p,c)&&(!v||i&&v&&!e)||!n&&p.ctrlKey&&v)return!1;if(!n&&p.type==="touchstart"&&p.touches?.length>1)return p.preventDefault(),!1;if(!f&&!i&&!g&&v||!o&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(o)&&!o.includes(p.button)&&p.type==="mousedown")return!1;const w=Array.isArray(o)&&o.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||v)&&w}}function $9e({domNode:e,minZoom:r,maxZoom:n,translateExtent:o,viewport:i,onPanZoom:a,onPanZoomStart:l,onPanZoomEnd:s,onDraggingChange:c}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),p=vF().scaleExtent([r,n]).translateExtent(o),f=Ei(e).call(p);C({x:i.x,y:i.y,zoom:of(i.zoom,r,n)},[[0,0],[u.width,u.height]],o);const g=f.on("wheel.zoom"),v=f.on("dblclick.zoom");p.wheelDelta(aV);function w(P,L){return f?new Promise(H=>{p?.interpolate(L?.interpolate==="linear"?P1:Dx).transform(G7(f,L?.duration,L?.ease,()=>H(!0)),P)}):Promise.resolve(!1)}function x({noWheelClassName:P,noPanClassName:L,onPaneContextMenu:H,userSelectionActive:M,panOnScroll:V,panOnDrag:B,panOnScrollMode:F,panOnScrollSpeed:q,preventScrolling:G,zoomOnPinch:U,zoomOnScroll:Y,zoomOnDoubleClick:K,zoomActivationKeyPressed:O,lib:W,onTransformChange:Z,connectionInProgress:Q,paneClickDistance:ie,selectionOnDrag:te}){M&&!d.isZoomingOrPanning&&k();const re=V&&!O&&!M;p.clickDistance(te?1/0:!Ka(ie)||ie<0?0:ie);const ue=re?w9e({zoomPanValues:d,noWheelClassName:P,d3Selection:f,d3Zoom:p,panOnScrollMode:F,panOnScrollSpeed:q,zoomOnPinch:U,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:s}):k9e({noWheelClassName:P,preventScrolling:G,d3ZoomHandler:g});if(f.on("wheel.zoom",ue,{passive:!1}),!M){const ce=_9e({zoomPanValues:d,onDraggingChange:c,onPanZoomStart:l});p.on("start",ce);const pe=S9e({zoomPanValues:d,panOnDrag:B,onPaneContextMenu:!!H,onPanZoom:a,onTransformChange:Z});p.on("zoom",pe);const xe=E9e({zoomPanValues:d,panOnDrag:B,panOnScroll:V,onPaneContextMenu:H,onPanZoomEnd:s,onDraggingChange:c});p.on("end",xe)}const _e=C9e({zoomActivationKeyPressed:O,panOnDrag:B,zoomOnScroll:Y,panOnScroll:V,zoomOnDoubleClick:K,zoomOnPinch:U,userSelectionActive:M,noPanClassName:L,noWheelClassName:P,lib:W,connectionInProgress:Q});p.filter(_e),K?f.on("dblclick.zoom",v):f.on("dblclick.zoom",null)}function k(){p.on("zoom",null)}async function C(P,L,H){const M=W7(P),V=p?.constrain()(M,L,H);return V&&await w(V),new Promise(B=>B(V))}async function _(P,L){const H=W7(P);return await w(H,L),new Promise(M=>M(H))}function $(P){if(f){const L=W7(P),H=f.property("__zoom");(H.k!==P.zoom||H.x!==P.x||H.y!==P.y)&&p?.transform(f,L,null,{sync:!0})}}function R(){const P=f?gF(f.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function T(P,L){return f?new Promise(H=>{p?.interpolate(L?.interpolate==="linear"?P1:Dx).scaleTo(G7(f,L?.duration,L?.ease,()=>H(!0)),P)}):Promise.resolve(!1)}function A(P,L){return f?new Promise(H=>{p?.interpolate(L?.interpolate==="linear"?P1:Dx).scaleBy(G7(f,L?.duration,L?.ease,()=>H(!0)),P)}):Promise.resolve(!1)}function z(P){p?.scaleExtent(P)}function j(P){p?.translateExtent(P)}function I(P){const L=!Ka(P)||P<0?0:P;p?.clickDistance(L)}return{update:x,destroy:k,setViewport:_,setViewportConstrained:C,getViewport:R,scaleTo:T,scaleBy:A,setScaleExtent:z,setTranslateExtent:j,syncViewport:$,setClickDistance:I}}var df;(function(e){e.Line="line",e.Handle="handle"})(df||(df={}));function R9e({width:e,prevWidth:r,height:n,prevHeight:o,affectsX:i,affectsY:a}){const l=e-r,s=n-o,c=[l>0?1:l<0?-1:0,s>0?1:s<0?-1:0];return l&&i&&(c[0]=c[0]*-1),s&&a&&(c[1]=c[1]*-1),c}function lV(e){const r=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),i=e.includes("top");return{isHorizontal:r,isVertical:n,affectsX:o,affectsY:i}}function ad(e,r){return Math.max(0,r-e)}function ld(e,r){return Math.max(0,e-r)}function Jx(e,r,n){return Math.max(0,r-e,e-n)}function sV(e,r){return e?!r:r}function z9e(e,r,n,o,i,a,l,s){let{affectsX:c,affectsY:d}=r;const{isHorizontal:u,isVertical:p}=r,f=u&&p,{xSnapped:g,ySnapped:v}=n,{minWidth:w,maxWidth:x,minHeight:k,maxHeight:C}=o,{x:_,y:$,width:R,height:T,aspectRatio:A}=e;let z=Math.floor(u?g-e.pointerX:0),j=Math.floor(p?v-e.pointerY:0);const I=R+(c?-z:z),P=T+(d?-j:j),L=-a[0]*R,H=-a[1]*T;let M=Jx(I,w,x),V=Jx(P,k,C);if(l){let q=0,G=0;c&&z<0?q=ad(_+z+L,l[0][0]):!c&&z>0&&(q=ld(_+I+L,l[1][0])),d&&j<0?G=ad($+j+H,l[0][1]):!d&&j>0&&(G=ld($+P+H,l[1][1])),M=Math.max(M,q),V=Math.max(V,G)}if(s){let q=0,G=0;c&&z>0?q=ld(_+z,s[0][0]):!c&&z<0&&(q=ad(_+I,s[1][0])),d&&j>0?G=ld($+j,s[0][1]):!d&&j<0&&(G=ad($+P,s[1][1])),M=Math.max(M,q),V=Math.max(V,G)}if(i){if(u){const q=Jx(I/A,k,C)*A;if(M=Math.max(M,q),l){let G=0;!c&&!d||c&&!d&&f?G=ld($+H+I/A,l[1][1])*A:G=ad($+H+(c?z:-z)/A,l[0][1])*A,M=Math.max(M,G)}if(s){let G=0;!c&&!d||c&&!d&&f?G=ad($+I/A,s[1][1])*A:G=ld($+(c?z:-z)/A,s[0][1])*A,M=Math.max(M,G)}}if(p){const q=Jx(P*A,w,x)/A;if(V=Math.max(V,q),l){let G=0;!c&&!d||d&&!c&&f?G=ld(_+P*A+L,l[1][0])/A:G=ad(_+(d?j:-j)*A+L,l[0][0])/A,V=Math.max(V,G)}if(s){let G=0;!c&&!d||d&&!c&&f?G=ad(_+P*A,s[1][0])/A:G=ld(_+(d?j:-j)*A,s[0][0])/A,V=Math.max(V,G)}}}j=j+(j<0?V:-V),z=z+(z<0?M:-M),i&&(f?I>P*A?j=(sV(c,d)?-z:z)/A:z=(sV(c,d)?-j:j)*A:u?(j=z/A,d=c):(z=j*A,c=d));const B=c?_+z:_,F=d?$+j:$;return{width:R+(c?-z:z),height:T+(d?-j:j),x:a[0]*z*(c?-1:1)+B,y:a[1]*j*(d?-1:1)+F}}const cV={width:0,height:0,x:0,y:0},T9e={...cV,pointerX:0,pointerY:0,aspectRatio:1};function j9e(e){return[[0,0],[e.measured.width,e.measured.height]]}function A9e(e,r,n){const o=r.position.x+e.position.x,i=r.position.y+e.position.y,a=e.measured.width??0,l=e.measured.height??0,s=n[0]*a,c=n[1]*l;return[[o-s,i-c],[o+a-s,i+l-c]]}function D9e({domNode:e,nodeId:r,getStoreItems:n,onChange:o,onEnd:i}){const a=Ei(e);let l={controlDirection:lV("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:d,boundaries:u,keepAspectRatio:p,resizeDirection:f,onResizeStart:g,onResize:v,onResizeEnd:w,shouldResize:x}){let k={...cV},C={...T9e};l={boundaries:u,resizeDirection:f,keepAspectRatio:p,controlDirection:lV(d)};let _,$=null,R=[],T,A,z,j=!1;const I=FL().on("start",P=>{const{nodeLookup:L,transform:H,snapGrid:M,snapToGrid:V,nodeOrigin:B,paneDomNode:F}=n();if(_=L.get(r),!_)return;$=F?.getBoundingClientRect()??null;const{xSnapped:q,ySnapped:G}=Y1(P.sourceEvent,{transform:H,snapGrid:M,snapToGrid:V,containerBounds:$});k={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},C={...k,pointerX:q,pointerY:G,aspectRatio:k.width/k.height},T=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(T=L.get(_.parentId),A=T&&_.extent==="parent"?j9e(T):void 0),R=[],z=void 0;for(const[U,Y]of L)if(Y.parentId===r&&(R.push({id:U,position:{...Y.position},extent:Y.extent}),Y.extent==="parent"||Y.expandParent)){const K=A9e(Y,_,Y.origin??B);z?z=[[Math.min(K[0][0],z[0][0]),Math.min(K[0][1],z[0][1])],[Math.max(K[1][0],z[1][0]),Math.max(K[1][1],z[1][1])]]:z=K}g?.(P,{...k})}).on("drag",P=>{const{transform:L,snapGrid:H,snapToGrid:M,nodeOrigin:V}=n(),B=Y1(P.sourceEvent,{transform:L,snapGrid:H,snapToGrid:M,containerBounds:$}),F=[];if(!_)return;const{x:q,y:G,width:U,height:Y}=k,K={},O=_.origin??V,{width:W,height:Z,x:Q,y:ie}=z9e(C,l.controlDirection,B,l.boundaries,l.keepAspectRatio,O,A,z),te=W!==U,re=Z!==Y,ue=Q!==q&&te,_e=ie!==G&&re;if(!ue&&!_e&&!te&&!re)return;if((ue||_e||O[0]===1||O[1]===1)&&(K.x=ue?Q:k.x,K.y=_e?ie:k.y,k.x=K.x,k.y=K.y,R.length>0)){const xe=Q-q,je=ie-G;for(const Be of R)Be.position={x:Be.position.x-xe+O[0]*(W-U),y:Be.position.y-je+O[1]*(Z-Y)},F.push(Be)}if((te||re)&&(K.width=te&&(!l.resizeDirection||l.resizeDirection==="horizontal")?W:k.width,K.height=re&&(!l.resizeDirection||l.resizeDirection==="vertical")?Z:k.height,k.width=K.width,k.height=K.height),T&&_.expandParent){const xe=O[0]*(K.width??0);K.x&&K.x{j&&(w?.(P,{...k}),i?.({...k}),j=!1)});a.call(I)}function c(){a.on(".drag",null)}return{update:s,destroy:c}}function Y7(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dV={exports:{}},X7={},uV={exports:{}},K7={},pV;function M9e(){if(pV)return K7;pV=1;var e=Zr;function r(p,f){return p===f&&(p!==0||1/p===1/f)||p!==p&&f!==f}var n=typeof Object.is=="function"?Object.is:r,o=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function s(p,f){var g=f(),v=o({inst:{value:g,getSnapshot:f}}),w=v[0].inst,x=v[1];return a(function(){w.value=g,w.getSnapshot=f,c(w)&&x({inst:w})},[p,g,f]),i(function(){return c(w)&&x({inst:w}),p(function(){c(w)&&x({inst:w})})},[p]),l(g),g}function c(p){var f=p.getSnapshot;p=p.value;try{var g=f();return!n(p,g)}catch{return!0}}function d(p,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:s;return K7.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,K7}var hV;function fV(){return hV||(hV=1,uV.exports=M9e()),uV.exports}var mV;function N9e(){if(mV)return X7;mV=1;var e=Zr,r=fV();function n(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}var o=typeof Object.is=="function"?Object.is:n,i=r.useSyncExternalStore,a=e.useRef,l=e.useEffect,s=e.useMemo,c=e.useDebugValue;return X7.useSyncExternalStoreWithSelector=function(d,u,p,f,g){var v=a(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=s(function(){function k(T){if(!C){if(C=!0,_=T,T=f(T),g!==void 0&&w.hasValue){var A=w.value;if(g(A,T))return $=A}return $=T}if(A=$,o(_,T))return A;var z=f(T);return g!==void 0&&g(A,z)?(_=T,A):(_=T,$=z)}var C=!1,_,$,R=p===void 0?null:p;return[function(){return k(u())},R===null?void 0:function(){return k(R())}]},[u,p,f,g]);var x=i(d,v[0],v[1]);return l(function(){w.hasValue=!0,w.value=x},[x]),c(x),x},X7}var gV;function P9e(){return gV||(gV=1,dV.exports=N9e()),dV.exports}var yV=P9e();const B9e=Y7(yV),I9e={},vV=e=>{let r;const n=new Set,o=(s,c)=>{const d=typeof s=="function"?s(r):s;if(!Object.is(d,r)){const u=r;r=c??(typeof d!="object"||d===null)?d:Object.assign({},r,d),n.forEach(p=>p(r,u))}},i=()=>r,a={setState:o,getState:i,getInitialState:()=>l,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>{(I9e?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=r=e(o,i,a);return a},O9e=e=>e?vV(e):vV,{useDebugValue:L9e}=Zr,{useSyncExternalStoreWithSelector:F9e}=B9e,V9e=e=>e;function bV(e,r=V9e,n){const o=F9e(e.subscribe,e.getState,e.getServerState||e.getInitialState,r,n);return L9e(o),o}const xV=(e,r)=>{const n=O9e(e),o=(i,a=r)=>bV(n,i,a);return Object.assign(o,n),o},q9e=(e,r)=>e?xV(e,r):xV;function jr(e,r){if(Object.is(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(const[o,i]of e)if(!Object.is(i,r.get(o)))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(const o of e)if(!r.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(r).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(r,o)||!Object.is(e[o],r[o]))return!1;return!0}const ew=S.createContext(null),H9e=ew.Provider,wV=Gl.error001();function Dt(e,r){const n=S.useContext(ew);if(n===null)throw new Error(wV);return bV(n,e,r)}function vr(){const e=S.useContext(ew);if(e===null)throw new Error(wV);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const kV={display:"none"},U9e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},_V="react-flow__node-desc",SV="react-flow__edge-desc",W9e="react-flow__aria-live",G9e=e=>e.ariaLiveMessage,Y9e=e=>e.ariaLabelConfig;function X9e({rfId:e}){const r=Dt(G9e);return y.jsx("div",{id:`${W9e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:U9e,children:r})}function K9e({rfId:e,disableKeyboardA11y:r}){const n=Dt(Y9e);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${_V}-${e}`,style:kV,children:r?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${SV}-${e}`,style:kV,children:n["edge.a11yDescription.default"]}),!r&&y.jsx(X9e,{rfId:e})]})}const sd=S.forwardRef(({position:e="top-left",children:r,className:n,style:o,...i},a)=>{const l=`${e}`.split("-");return y.jsx("div",{className:dn(["react-flow__panel",n,...l]),style:o,ref:a,...i,children:r})});sd.displayName="Panel";function Z9e({proOptions:e,position:r="bottom-right"}){return e?.hideAttribution?null:y.jsx(sd,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Q9e=e=>{const r=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&r.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:r,selectedEdges:n}},tw=e=>e.id;function J9e(e,r){return jr(e.selectedNodes.map(tw),r.selectedNodes.map(tw))&&jr(e.selectedEdges.map(tw),r.selectedEdges.map(tw))}function eSe({onSelectionChange:e}){const r=vr(),{selectedNodes:n,selectedEdges:o}=Dt(Q9e,J9e);return S.useEffect(()=>{const i={nodes:n,edges:o};e?.(i),r.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,o,e]),null}const tSe=e=>!!e.onSelectionChangeHandlers;function rSe({onSelectionChange:e}){const r=Dt(tSe);return e||r?y.jsx(eSe,{onSelectionChange:e}):null}const EV=[0,0],nSe={x:0,y:0,zoom:1},oSe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],CV=[...oSe,"rfId"],iSe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),$V={translateExtent:V1,nodeOrigin:EV,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function aSe(e){const{setNodes:r,setEdges:n,setMinZoom:o,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:l,reset:s,setDefaultNodesAndEdges:c}=Dt(iSe,jr),d=vr();S.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=$V,s()}),[]);const u=S.useRef($V);return S.useEffect(()=>{for(const p of CV){const f=e[p],g=u.current[p];f!==g&&(typeof e[p]>"u"||(p==="nodes"?r(f):p==="edges"?n(f):p==="minZoom"?o(f):p==="maxZoom"?i(f):p==="translateExtent"?a(f):p==="nodeExtent"?l(f):p==="ariaLabelConfig"?d.setState({ariaLabelConfig:U7e(f)}):p==="fitView"?d.setState({fitViewQueued:f}):p==="fitViewOptions"?d.setState({fitViewOptions:f}):d.setState({[p]:f})))}u.current=e},CV.map(p=>e[p])),null}function RV(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function lSe(e){const[r,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const o=RV(),i=()=>n(o?.matches?"dark":"light");return i(),o?.addEventListener("change",i),()=>{o?.removeEventListener("change",i)}},[e]),r!==null?r:RV()?.matches?"dark":"light"}const zV=typeof document<"u"?document:null;function X1(e=null,r={target:zV,actInsideInputWithModifier:!0}){const[n,o]=S.useState(!1),i=S.useRef(!1),a=S.useRef(new Set([])),[l,s]=S.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(u=>typeof u=="string").map(u=>u.replace("+",` `).replace(` `,` +`).split(` -`)),d=c.reduce((u,p)=>u.concat(...p),[]);return[c,d]}return[[],[]]},[e]);return S.useEffect(()=>{const c=r?.target??zV,d=r?.actInsideInputWithModifier??!0;if(e!==null){const u=g=>{if(a.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!a.current||a.current&&!d)&&PF(g))return!1;const v=jV(g.code,s);if(i.current.add(g[v]),TV(l,i.current,!1)){const w=g.composedPath?.()?.[0]||g.target,x=w?.nodeName==="BUTTON"||w?.nodeName==="A";r.preventDefault!==!1&&(a.current||!x)&&g.preventDefault(),o(!0)}},p=g=>{const v=jV(g.code,s);TV(l,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(g[v]),g.key==="Meta"&&i.current.clear(),a.current=!1},f=()=>{i.current.clear(),o(!1)};return c?.addEventListener("keydown",u),c?.addEventListener("keyup",p),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c?.removeEventListener("keydown",u),c?.removeEventListener("keyup",p),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,o]),n}function TV(e,r,n){return e.filter(o=>n||o.length===r.size).some(o=>o.every(a=>r.has(a)))}function jV(e,r){return r.includes(e)?"code":"key"}const sSe=()=>{const e=vr();return S.useMemo(()=>({zoomIn:r=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomTo:(r,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(r,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(r,n)=>{const{transform:[o,a,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:r.x??o,y:r.y??a,zoom:r.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,n,o]=e.getState().transform;return{x:r,y:n,zoom:o}},setCenter:async(r,n,o)=>e.getState().setCenter(r,n,o),fitBounds:async(r,n)=>{const{width:o,height:a,minZoom:i,maxZoom:l,panZoom:s}=e.getState(),c=Ws(r,o,a,i,l,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,n={})=>{const{transform:o,snapGrid:a,snapToGrid:i,domNode:l}=e.getState();if(!l)return r;const{x:s,y:c}=l.getBoundingClientRect(),d={x:r.x-s,y:r.y-c},u=n.snapGrid??a,p=n.snapToGrid??i;return G1(d,o,p,u)},flowToScreenPosition:r=>{const{transform:n,domNode:o}=e.getState();if(!o)return r;const{x:a,y:i}=o.getBoundingClientRect(),l=Yx(r,n);return{x:l.x+a,y:l.y+i}}}),[])};function AV(e,r){const n=[],o=new Map,a=[];for(const i of e)if(i.type==="add"){a.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const l=o.get(i.id);l?l.push(i):o.set(i.id,[i])}for(const i of r){const l=o.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const s={...i};for(const c of l)cSe(c,s);n.push(s)}return a.length&&a.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function cSe(e,r){switch(e.type){case"select":{r.selected=e.selected;break}case"position":{typeof e.position<"u"&&(r.position=e.position),typeof e.dragging<"u"&&(r.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(r.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(r.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(r.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(r.resizing=e.resizing);break}}}function rw(e,r){return AV(e,r)}function nw(e,r){return AV(e,r)}function Qu(e,r){return{id:e,type:"select",selected:r}}function uf(e,r=new Set,n=!1){const o=[];for(const[a,i]of e){const l=r.has(a);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),o.push(Qu(i.id,l)))}return o}function DV({items:e=[],lookup:r}){const n=[],o=new Map(e.map(a=>[a.id,a]));for(const[a,i]of e.entries()){const l=r.get(i.id),s=l?.internals?.userNode??l;s!==void 0&&s!==i&&n.push({id:i.id,item:i,type:"replace"}),s===void 0&&n.push({item:i,type:"add",index:a})}for(const[a]of r)o.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function MV(e){return{id:e.id,type:"remove"}}const NV=e=>P7e(e),dSe=e=>SF(e);function PV(e){return S.forwardRef(e)}const uSe=typeof window<"u"?S.useLayoutEffect:S.useEffect;function BV(e){const[r,n]=S.useState(BigInt(0)),[o]=S.useState(()=>pSe(()=>n(a=>a+BigInt(1))));return uSe(()=>{const a=o.get();a.length&&(e(a),o.reset())},[r]),o}function pSe(e){let r=[];return{get:()=>r,reset:()=>{r=[]},push:n=>{r.push(n),e()}}}const IV=S.createContext(null);function hSe({children:e}){const r=vr(),n=S.useCallback(s=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:u,onNodesChange:p,nodeLookup:f,fitViewQueued:g,onNodesChangeMiddlewareMap:v}=r.getState();let w=c;for(const k of s)w=typeof k=="function"?k(w):k;let x=DV({items:w,lookup:f});for(const k of v.values())x=k(x);u&&d(w),x.length>0?p?.(x):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:k,nodes:C,setNodes:_}=r.getState();k&&_(C)})},[]),o=BV(n),a=S.useCallback(s=>{const{edges:c=[],setEdges:d,hasDefaultEdges:u,onEdgesChange:p,edgeLookup:f}=r.getState();let g=c;for(const v of s)g=typeof v=="function"?v(g):v;u?d(g):p&&p(DV({items:g,lookup:f}))},[]),i=BV(a),l=S.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return y.jsx(IV.Provider,{value:l,children:e})}function fSe(){const e=S.useContext(IV);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const mSe=e=>!!e.panZoom;function pf(){const e=sSe(),r=vr(),n=fSe(),o=Dt(mSe),a=S.useMemo(()=>{const i=p=>r.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},s=p=>{n.edgeQueue.push(p)},c=p=>{const{nodeLookup:f,nodeOrigin:g}=r.getState(),v=NV(p)?p:f.get(p.id),w=v.parentId?DF(v.position,v.measured,v.parentId,f,g):v.position,x={...v,position:w,width:v.measured?.width??v.width,height:v.measured?.height??v.height};return Zu(x)},d=(p,f,g={replace:!1})=>{l(v=>v.map(w=>{if(w.id===p){const x=typeof f=="function"?f(w):f;return g.replace&&NV(x)?x:{...w,...x}}return w}))},u=(p,f,g={replace:!1})=>{s(v=>v.map(w=>{if(w.id===p){const x=typeof f=="function"?f(w):f;return g.replace&&dSe(x)?x:{...w,...x}}return w}))};return{getNodes:()=>r.getState().nodes.map(p=>({...p})),getNode:p=>i(p)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:p=[]}=r.getState();return p.map(f=>({...f}))},getEdge:p=>r.getState().edgeLookup.get(p),setNodes:l,setEdges:s,addNodes:p=>{const f=Array.isArray(p)?p:[p];n.nodeQueue.push(g=>[...g,...f])},addEdges:p=>{const f=Array.isArray(p)?p:[p];n.edgeQueue.push(g=>[...g,...f])},toObject:()=>{const{nodes:p=[],edges:f=[],transform:g}=r.getState(),[v,w,x]=g;return{nodes:p.map(k=>({...k})),edges:f.map(k=>({...k})),viewport:{x:v,y:w,zoom:x}}},deleteElements:async({nodes:p=[],edges:f=[]})=>{const{nodes:g,edges:v,onNodesDelete:w,onEdgesDelete:x,triggerNodeChanges:k,triggerEdgeChanges:C,onDelete:_,onBeforeDelete:$}=r.getState(),{nodes:R,edges:T}=await L7e({nodesToRemove:p,edgesToRemove:f,nodes:g,edges:v,onBeforeDelete:$}),A=T.length>0,z=R.length>0;if(A){const j=T.map(MV);x?.(T),C(j)}if(z){const j=R.map(MV);w?.(R),k(j)}return(z||A)&&_?.({nodes:R,edges:T}),{deletedNodes:R,deletedEdges:T}},getIntersectingNodes:(p,f=!0,g)=>{const v=jF(p),w=v?p:c(p),x=g!==void 0;return w?(g||r.getState().nodes).filter(k=>{const C=r.getState().nodeLookup.get(k.id);if(C&&!v&&(k.id===p.id||!C.internals.positionAbsolute))return!1;const _=Zu(x?k:C),$=U1(_,w);return f&&$>0||$>=_.width*_.height||$>=w.width*w.height}):[]},isNodeIntersecting:(p,f,g=!0)=>{const v=jF(p)?p:c(p);if(!v)return!1;const w=U1(v,f);return g&&w>0||w>=f.width*f.height||w>=v.width*v.height},updateNode:d,updateNodeData:(p,f,g={replace:!1})=>{d(p,v=>{const w=typeof f=="function"?f(v):f;return g.replace?{...v,data:w}:{...v,data:{...v.data,...w}}},g)},updateEdge:u,updateEdgeData:(p,f,g={replace:!1})=>{u(p,v=>{const w=typeof f=="function"?f(v):f;return g.replace?{...v,data:w}:{...v,data:{...v.data,...w}}},g)},getNodesBounds:p=>{const{nodeLookup:f,nodeOrigin:g}=r.getState();return EF(p,{nodeLookup:f,nodeOrigin:g})},getHandleConnections:({type:p,id:f,nodeId:g})=>Array.from(r.getState().connectionLookup.get(`${g}-${p}${f?`-${f}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:f,nodeId:g})=>Array.from(r.getState().connectionLookup.get(`${g}${p?f?`-${p}-${f}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const f=r.getState().fitViewResolver??H7e();return r.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:f}),n.nodeQueue.push(g=>[...g]),f.promise}}},[]);return S.useMemo(()=>({...a,...e,viewportInitialized:o}),[o])}const OV=e=>e.selected,gSe=typeof window<"u"?window:void 0;function ySe({deleteKeyCode:e,multiSelectionKeyCode:r}){const n=vr(),{deleteElements:o}=pf(),a=X1(e,{actInsideInputWithModifier:!1}),i=X1(r,{target:gSe});S.useEffect(()=>{if(a){const{edges:l,nodes:s}=n.getState();o({nodes:s.filter(OV),edges:l.filter(OV)}),n.setState({nodesSelectionActive:!1})}},[a]),S.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function vSe(e){const r=vr();S.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const o=P7(e.current);(o.height===0||o.width===0)&&r.getState().onError?.("004",Gl.error004()),r.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const ow={position:"absolute",width:"100%",height:"100%",top:0,left:0},bSe=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function xSe({onPaneContextMenu:e,zoomOnScroll:r=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:a=.5,panOnScrollMode:i=Yu.Free,zoomOnDoubleClick:l=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:d,minZoom:u,maxZoom:p,zoomActivationKeyCode:f,preventScrolling:g=!0,children:v,noWheelClassName:w,noPanClassName:x,onViewportChange:k,isControlledViewport:C,paneClickDistance:_,selectionOnDrag:$}){const R=vr(),T=S.useRef(null),{userSelectionActive:A,lib:z,connectionInProgress:j}=Dt(bSe,jr),I=X1(f),P=S.useRef();vSe(T);const L=S.useCallback(H=>{k?.({x:H[0],y:H[1],zoom:H[2]}),C||R.setState({transform:H})},[k,C]);return S.useEffect(()=>{if(T.current){P.current=$9e({domNode:T.current,minZoom:u,maxZoom:p,translateExtent:d,viewport:c,onDraggingChange:B=>R.setState({paneDragging:B}),onPanZoomStart:(B,F)=>{const{onViewportChangeStart:q,onMoveStart:G}=R.getState();G?.(B,F),q?.(F)},onPanZoom:(B,F)=>{const{onViewportChange:q,onMove:G}=R.getState();G?.(B,F),q?.(F)},onPanZoomEnd:(B,F)=>{const{onViewportChangeEnd:q,onMoveEnd:G}=R.getState();G?.(B,F),q?.(F)}});const{x:H,y:M,zoom:V}=P.current.getViewport();return R.setState({panZoom:P.current,transform:[H,M,V],domNode:T.current.closest(".react-flow")}),()=>{P.current?.destroy()}}},[]),S.useEffect(()=>{P.current?.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:a,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:s,zoomActivationKeyPressed:I,preventScrolling:g,noPanClassName:x,userSelectionActive:A,noWheelClassName:w,lib:z,onTransformChange:L,connectionInProgress:j,selectionOnDrag:$,paneClickDistance:_})},[e,r,n,o,a,i,l,s,I,g,x,A,w,z,L,j,$,_]),y.jsx("div",{className:"react-flow__renderer",ref:T,style:ow,children:v})}const wSe=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function kSe(){const{userSelectionActive:e,userSelectionRect:r}=Dt(wSe,jr);return e&&r?y.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const K7=(e,r)=>n=>{n.target===r.current&&e?.(n)},_Se=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function SSe({isSelecting:e,selectionKeyPressed:r,selectionMode:n=q1.Full,panOnDrag:o,paneClickDistance:a,selectionOnDrag:i,onSelectionStart:l,onSelectionEnd:s,onPaneClick:c,onPaneContextMenu:d,onPaneScroll:u,onPaneMouseEnter:p,onPaneMouseMove:f,onPaneMouseLeave:g,children:v}){const w=vr(),{userSelectionActive:x,elementsSelectable:k,dragging:C,connectionInProgress:_}=Dt(_Se,jr),$=k&&(e||x),R=S.useRef(null),T=S.useRef(),A=S.useRef(new Set),z=S.useRef(new Set),j=S.useRef(!1),I=q=>{if(j.current||_){j.current=!1;return}c?.(q),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},P=q=>{if(Array.isArray(o)&&o?.includes(2)){q.preventDefault();return}d?.(q)},L=u?q=>u(q):void 0,H=q=>{j.current&&(q.stopPropagation(),j.current=!1)},M=q=>{const{domNode:G}=w.getState();if(T.current=G?.getBoundingClientRect(),!T.current)return;const U=q.target===R.current;if(!U&&q.target.closest(".nokey")||!e||!(i&&U||r)||q.button!==0||!q.isPrimary)return;q.target?.setPointerCapture?.(q.pointerId),j.current=!1;const{x:Y,y:Z}=Ki(q.nativeEvent,T.current);w.setState({userSelectionRect:{width:0,height:0,startX:Y,startY:Z,x:Y,y:Z}}),U||(q.stopPropagation(),q.preventDefault())},V=q=>{const{userSelectionRect:G,transform:U,nodeLookup:Y,edgeLookup:Z,connectionLookup:O,triggerNodeChanges:W,triggerEdgeChanges:K,defaultEdgeOptions:Q,resetSelectedElements:ae}=w.getState();if(!T.current||!G)return;const{x:te,y:re}=Ki(q.nativeEvent,T.current),{startX:ue,startY:_e}=G;if(!j.current){const Be=r?0:a;if(Math.hypot(te-ue,re-_e)<=Be)return;ae(),l?.(q)}j.current=!0;const ce={startX:ue,startY:_e,x:teBe.id)),z.current=new Set;const je=Q?.selectable??!0;for(const Be of A.current){const Je=O.get(Be);if(Je)for(const{edgeId:st}of Je.values()){const Le=Z.get(st);Le&&(Le.selectable??je)&&z.current.add(st)}}if(!MF(pe,A.current)){const Be=uf(Y,A.current,!0);W(Be)}if(!MF(xe,z.current)){const Be=uf(Z,z.current);K(Be)}w.setState({userSelectionRect:ce,userSelectionActive:!0,nodesSelectionActive:!1})},B=q=>{q.button===0&&(q.target?.releasePointerCapture?.(q.pointerId),!x&&q.target===R.current&&w.getState().userSelectionRect&&I?.(q),w.setState({userSelectionActive:!1,userSelectionRect:null}),j.current&&(s?.(q),w.setState({nodesSelectionActive:A.current.size>0})))},F=o===!0||Array.isArray(o)&&o.includes(0);return y.jsxs("div",{className:dn(["react-flow__pane",{draggable:F,dragging:C,selection:e}]),onClick:$?void 0:K7(I,R),onContextMenu:K7(P,R),onWheel:K7(L,R),onPointerEnter:$?void 0:p,onPointerMove:$?V:f,onPointerUp:$?B:void 0,onPointerDownCapture:$?M:void 0,onClickCapture:$?H:void 0,onPointerLeave:g,ref:R,style:ow,children:[v,y.jsx(kSe,{})]})}function Q7({id:e,store:r,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:s,onError:c}=r.getState(),d=s.get(e);if(!d){c?.("012",Gl.error012(e));return}r.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):a([e])}function LV({nodeRef:e,disabled:r=!1,noDragClassName:n,handleSelector:o,nodeId:a,isSelectable:i,nodeClickDistance:l}){const s=vr(),[c,d]=S.useState(!1),u=S.useRef();return S.useEffect(()=>{u.current=h9e({getStoreItems:()=>s.getState(),onNodeMouseDown:p=>{Q7({id:p,store:s,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),S.useEffect(()=>{if(r)u.current?.destroy();else if(e.current)return u.current?.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:a,nodeClickDistance:l}),()=>{u.current?.destroy()}},[n,o,r,i,e,a]),c}const ESe=e=>r=>r.selected&&(r.draggable||e&&typeof r.draggable>"u");function FV(){const e=vr();return S.useCallback(r=>{const{nodeExtent:n,snapToGrid:o,snapGrid:a,nodesDraggable:i,onError:l,updateNodePositions:s,nodeLookup:c,nodeOrigin:d}=e.getState(),u=new Map,p=ESe(i),f=o?a[0]:5,g=o?a[1]:5,v=r.direction.x*f*r.factor,w=r.direction.y*g*r.factor;for(const[,x]of c){if(!p(x))continue;let k={x:x.internals.positionAbsolute.x+v,y:x.internals.positionAbsolute.y+w};o&&(k=W1(k,a));const{position:C,positionAbsolute:_}=CF({nodeId:x.id,nextPosition:k,nodeLookup:c,nodeExtent:n,nodeOrigin:d,onError:l});x.position=C,x.internals.positionAbsolute=_,u.set(x.id,x)}s(u)},[])}const J7=S.createContext(null),CSe=J7.Provider;J7.Consumer;const e9=()=>S.useContext(J7),$Se=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),RSe=(e,r,n)=>o=>{const{connectionClickStartHandle:a,connectionMode:i,connection:l}=o,{fromHandle:s,toHandle:c,isValid:d}=l,u=c?.nodeId===e&&c?.id===r&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===r&&s?.type===n,connectingTo:u,clickConnecting:a?.nodeId===e&&a?.id===r&&a?.type===n,isPossibleEndHandle:i===rf.Strict?s?.type!==n:e!==s?.nodeId||r!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!a,valid:u&&d}};function zSe({type:e="source",position:r=Ue.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:l,onConnect:s,children:c,className:d,onMouseDown:u,onTouchStart:p,...f},g){const v=l||null,w=e==="target",x=vr(),k=e9(),{connectOnClick:C,noPanClassName:_,rfId:$}=Dt($Se,jr),{connectingFrom:R,connectingTo:T,clickConnecting:A,isPossibleEndHandle:z,connectionInProcess:j,clickConnectionInProcess:I,valid:P}=Dt(RSe(k,v,e),jr);k||x.getState().onError?.("010",Gl.error010());const L=V=>{const{defaultEdgeOptions:B,onConnect:F,hasDefaultEdges:q}=x.getState(),G={...B,...V};if(q){const{edges:U,setEdges:Y}=x.getState();Y(K7e(G,U))}F?.(G),s?.(G)},H=V=>{if(!k)return;const B=BF(V.nativeEvent);if(a&&(B&&V.button===0||!B)){const F=x.getState();U7.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:w,handleId:v,nodeId:k,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:F.onConnectEnd,updateConnection:F.updateConnection,onConnect:L,isValidConnection:n||F.isValidConnection,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}B?u?.(V):p?.(V)},M=V=>{const{onClickConnectStart:B,onClickConnectEnd:F,connectionClickStartHandle:q,connectionMode:G,isValidConnection:U,lib:Y,rfId:Z,nodeLookup:O,connection:W}=x.getState();if(!k||!q&&!a)return;if(!q){B?.(V.nativeEvent,{nodeId:k,handleId:v,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:k,type:e,id:v}});return}const K=NF(V.target),Q=n||U,{connection:ae,isValid:te}=U7.isValid(V.nativeEvent,{handle:{nodeId:k,id:v,type:e},connectionMode:G,fromNodeId:q.nodeId,fromHandleId:q.id||null,fromType:q.type,isValidConnection:Q,flowId:Z,doc:K,lib:Y,nodeLookup:O});te&&ae&&L(ae);const re=structuredClone(W);delete re.inProgress,re.toPosition=re.toHandle?re.toHandle.position:null,F?.(V,re),x.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":v,"data-nodeid":k,"data-handlepos":r,"data-id":`${$}-${k}-${v}-${e}`,className:dn(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",_,d,{source:!w,target:w,connectable:o,connectablestart:a,connectableend:i,clickconnecting:A,connectingfrom:R,connectingto:T,valid:P,connectionindicator:o&&(!j||z)&&(j||I?i:a)}]),onMouseDown:H,onTouchStart:H,onClick:C?M:void 0,ref:g,...f,children:c})}const Oo=S.memo(PV(zSe));function TSe({data:e,isConnectable:r,sourcePosition:n=Ue.Bottom}){return y.jsxs(y.Fragment,{children:[e?.label,y.jsx(Oo,{type:"source",position:n,isConnectable:r})]})}function jSe({data:e,isConnectable:r,targetPosition:n=Ue.Top,sourcePosition:o=Ue.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(Oo,{type:"target",position:n,isConnectable:r}),e?.label,y.jsx(Oo,{type:"source",position:o,isConnectable:r})]})}function ASe(){return null}function DSe({data:e,isConnectable:r,targetPosition:n=Ue.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(Oo,{type:"target",position:n,isConnectable:r}),e?.label]})}const aw={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},VV={input:TSe,default:jSe,output:DSe,group:ASe};function MSe(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const NSe=e=>{const{width:r,height:n,x:o,y:a}=nf(e.nodeLookup,{filter:i=>!!i.selected});return{width:Zi(r)?r:null,height:Zi(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${a}px)`}};function PSe({onSelectionContextMenu:e,noPanClassName:r,disableKeyboardA11y:n}){const o=vr(),{width:a,height:i,transformString:l,userSelectionActive:s}=Dt(NSe,jr),c=FV(),d=S.useRef(null);if(S.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),LV({nodeRef:d}),s||!a||!i)return null;const u=e?f=>{const g=o.getState().nodes.filter(v=>v.selected);e(f,g)}:void 0,p=f=>{Object.prototype.hasOwnProperty.call(aw,f.key)&&(f.preventDefault(),c({direction:aw[f.key],factor:f.shiftKey?4:1}))};return y.jsx("div",{className:dn(["react-flow__nodesselection","react-flow__container",r]),style:{transform:l},children:y.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:a,height:i}})})}const qV=typeof window<"u"?window:void 0,BSe=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function HV({children:e,onPaneClick:r,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:u,selectionMode:p,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:v,panActivationKeyCode:w,zoomActivationKeyCode:x,elementsSelectable:k,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:$,panOnScrollSpeed:R,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:z,defaultViewport:j,translateExtent:I,minZoom:P,maxZoom:L,preventScrolling:H,onSelectionContextMenu:M,noWheelClassName:V,noPanClassName:B,disableKeyboardA11y:F,onViewportChange:q,isControlledViewport:G}){const{nodesSelectionActive:U,userSelectionActive:Y}=Dt(BSe,jr),Z=X1(d,{target:qV}),O=X1(w,{target:qV}),W=O||z,K=O||$,Q=u&&W!==!0,ae=Z||Y||Q;return ySe({deleteKeyCode:c,multiSelectionKeyCode:v}),y.jsx(xSe,{onPaneContextMenu:i,elementsSelectable:k,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:K,panOnScrollSpeed:R,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:!Z&&W,defaultViewport:j,translateExtent:I,minZoom:P,maxZoom:L,zoomActivationKeyCode:x,preventScrolling:H,noWheelClassName:V,noPanClassName:B,onViewportChange:q,isControlledViewport:G,paneClickDistance:s,selectionOnDrag:Q,children:y.jsxs(SSe,{onSelectionStart:f,onSelectionEnd:g,onPaneClick:r,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:W,isSelecting:!!ae,selectionMode:p,selectionKeyPressed:Z,paneClickDistance:s,selectionOnDrag:Q,children:[e,U&&y.jsx(PSe,{onSelectionContextMenu:M,noPanClassName:B,disableKeyboardA11y:F})]})})}HV.displayName="FlowRenderer";const ISe=S.memo(HV),OSe=e=>r=>e?M7(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(n=>n.id):Array.from(r.nodeLookup.keys());function LSe(e){return Dt(S.useCallback(OSe(e),[e]),jr)}const FSe=e=>e.updateNodeInternals;function VSe(){const e=Dt(FSe),[r]=S.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(a=>{const i=a.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:a.target,force:!0})}),e(o)}));return S.useEffect(()=>()=>{r?.disconnect()},[r]),r}function qSe({node:e,nodeType:r,hasDimensions:n,resizeObserver:o}){const a=vr(),i=S.useRef(null),l=S.useRef(null),s=S.useRef(e.sourcePosition),c=S.useRef(e.targetPosition),d=S.useRef(r),u=n&&!!e.internals.handleBounds;return S.useEffect(()=>{i.current&&!e.hidden&&(!u||l.current!==i.current)&&(l.current&&o?.unobserve(l.current),o?.observe(i.current),l.current=i.current)},[u,e.hidden]),S.useEffect(()=>()=>{l.current&&(o?.unobserve(l.current),l.current=null)},[]),S.useEffect(()=>{if(i.current){const p=d.current!==r,f=s.current!==e.sourcePosition,g=c.current!==e.targetPosition;(p||f||g)&&(d.current=r,s.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,r,e.sourcePosition,e.targetPosition]),i}function HSe({id:e,onClick:r,onMouseEnter:n,onMouseMove:o,onMouseLeave:a,onContextMenu:i,onDoubleClick:l,nodesDraggable:s,elementsSelectable:c,nodesConnectable:d,nodesFocusable:u,resizeObserver:p,noDragClassName:f,noPanClassName:g,disableKeyboardA11y:v,rfId:w,nodeTypes:x,nodeClickDistance:k,onError:C}){const{node:_,internals:$,isParent:R}=Dt(te=>{const re=te.nodeLookup.get(e),ue=te.parentLookup.has(e);return{node:re,internals:re.internals,isParent:ue}},jr);let T=_.type||"default",A=x?.[T]||VV[T];A===void 0&&(C?.("003",Gl.error003(T)),T="default",A=x?.default||VV.default);const z=!!(_.draggable||s&&typeof _.draggable>"u"),j=!!(_.selectable||c&&typeof _.selectable>"u"),I=!!(_.connectable||d&&typeof _.connectable>"u"),P=!!(_.focusable||u&&typeof _.focusable>"u"),L=vr(),H=AF(_),M=qSe({node:_,nodeType:T,hasDimensions:H,resizeObserver:p}),V=LV({nodeRef:M,disabled:_.hidden||!z,noDragClassName:f,handleSelector:_.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:k}),B=FV();if(_.hidden)return null;const F=_o(_),q=MSe(_),G=j||z||r||n||o||a,U=n?te=>n(te,{...$.userNode}):void 0,Y=o?te=>o(te,{...$.userNode}):void 0,Z=a?te=>a(te,{...$.userNode}):void 0,O=i?te=>i(te,{...$.userNode}):void 0,W=l?te=>l(te,{...$.userNode}):void 0,K=te=>{const{selectNodesOnDrag:re,nodeDragThreshold:ue}=L.getState();j&&(!re||!z||ue>0)&&Q7({id:e,store:L,nodeRef:M}),r&&r(te,{...$.userNode})},Q=te=>{if(!(PF(te.nativeEvent)||v)){if(bF.includes(te.key)&&j){const re=te.key==="Escape";Q7({id:e,store:L,unselect:re,nodeRef:M})}else if(z&&_.selected&&Object.prototype.hasOwnProperty.call(aw,te.key)){te.preventDefault();const{ariaLabelConfig:re}=L.getState();L.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~$.positionAbsolute.x,y:~~$.positionAbsolute.y})}),B({direction:aw[te.key],factor:te.shiftKey?4:1})}}},ae=()=>{if(v||!M.current?.matches(":focus-visible"))return;const{transform:te,width:re,height:ue,autoPanOnNodeFocus:_e,setCenter:ce}=L.getState();_e&&(M7(new Map([[e,_]]),{x:0,y:0,width:re,height:ue},te,!0).length>0||ce(_.position.x+F.width/2,_.position.y+F.height/2,{zoom:te[2]}))};return y.jsx("div",{className:dn(["react-flow__node",`react-flow__node-${T}`,{[g]:z},_.className,{selected:_.selected,selectable:j,parent:R,draggable:z,dragging:V}]),ref:M,style:{zIndex:$.z,transform:`translate(${$.positionAbsolute.x}px,${$.positionAbsolute.y}px)`,pointerEvents:G?"all":"none",visibility:H?"visible":"hidden",..._.style,...q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:U,onMouseMove:Y,onMouseLeave:Z,onContextMenu:O,onClick:K,onDoubleClick:W,onKeyDown:P?Q:void 0,tabIndex:P?0:void 0,onFocus:P?ae:void 0,role:_.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":v?void 0:`${_V}-${w}`,"aria-label":_.ariaLabel,..._.domAttributes,children:y.jsx(CSe,{value:e,children:y.jsx(A,{id:e,data:_.data,type:T,positionAbsoluteX:$.positionAbsolute.x,positionAbsoluteY:$.positionAbsolute.y,selected:_.selected??!1,selectable:j,draggable:z,deletable:_.deletable??!0,isConnectable:I,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:V,dragHandle:_.dragHandle,zIndex:$.z,parentId:_.parentId,...F})})})}var USe=S.memo(HSe);const WSe=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function UV(e){const{nodesDraggable:r,nodesConnectable:n,nodesFocusable:o,elementsSelectable:a,onError:i}=Dt(WSe,jr),l=LSe(e.onlyRenderVisibleElements),s=VSe();return y.jsx("div",{className:"react-flow__nodes",style:ow,children:l.map(c=>y.jsx(USe,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:r,nodesConnectable:n,nodesFocusable:o,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}UV.displayName="NodeRenderer";const GSe=S.memo(UV);function YSe(e){return Dt(S.useCallback(r=>{if(!e)return r.edges.map(o=>o.id);const n=[];if(r.width&&r.height)for(const o of r.edges){const a=r.nodeLookup.get(o.source),i=r.nodeLookup.get(o.target);a&&i&&Y7e({sourceNode:a,targetNode:i,width:r.width,height:r.height,transform:r.transform})&&n.push(o.id)}return n},[e]),jr)}const XSe=({color:e="none",strokeWidth:r=1})=>{const n={strokeWidth:r,...e&&{stroke:e}};return y.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ZSe=({color:e="none",strokeWidth:r=1})=>{const n={strokeWidth:r,...e&&{stroke:e,fill:e}};return y.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},WV={[Hx.Arrow]:XSe,[Hx.ArrowClosed]:ZSe};function KSe(e){const r=vr();return S.useMemo(()=>Object.prototype.hasOwnProperty.call(WV,e)?WV[e]:(r.getState().onError?.("009",Gl.error009(e)),null),[e])}const QSe=({id:e,type:r,color:n,width:o=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:s="auto-start-reverse"})=>{const c=KSe(r);return c?y.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:s,refX:"0",refY:"0",children:y.jsx(c,{color:n,strokeWidth:l})}):null},GV=({defaultColor:e,rfId:r})=>{const n=Dt(i=>i.edges),o=Dt(i=>i.defaultEdgeOptions),a=S.useMemo(()=>t9e(n,{id:r,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,r,e]);return a.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:a.map(i=>y.jsx(QSe,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};GV.displayName="MarkerDefinitions";var JSe=S.memo(GV);function YV({x:e,y:r,label:n,labelStyle:o,labelShowBg:a=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:s=2,children:c,className:d,...u}){const[p,f]=S.useState({x:1,y:0,width:0,height:0}),g=dn(["react-flow__edge-textwrapper",d]),v=S.useRef(null);return S.useEffect(()=>{if(v.current){const w=v.current.getBBox();f({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?y.jsxs("g",{transform:`translate(${e-p.width/2} ${r-p.height/2})`,className:g,visibility:p.width?"visible":"hidden",...u,children:[a&&y.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:s,ry:s}),y.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:v,style:o,children:n}),c]}):null}YV.displayName="EdgeText";const eEe=S.memo(YV);function iw({path:e,labelX:r,labelY:n,label:o,labelStyle:a,labelShowBg:i,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:d=20,...u}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...u,d:e,fill:"none",className:dn(["react-flow__edge-path",u.className])}),d?y.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,o&&Zi(r)&&Zi(n)?y.jsx(eEe,{x:r,y:n,label:o,labelStyle:a,labelShowBg:i,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function XV({pos:e,x1:r,y1:n,x2:o,y2:a}){return e===Ue.Left||e===Ue.Right?[.5*(r+o),n]:[r,.5*(n+a)]}function ZV({sourceX:e,sourceY:r,sourcePosition:n=Ue.Bottom,targetX:o,targetY:a,targetPosition:i=Ue.Top}){const[l,s]=XV({pos:n,x1:e,y1:r,x2:o,y2:a}),[c,d]=XV({pos:i,x1:o,y1:a,x2:e,y2:r}),[u,p,f,g]=OF({sourceX:e,sourceY:r,targetX:o,targetY:a,sourceControlX:l,sourceControlY:s,targetControlX:c,targetControlY:d});return[`M${e},${r} C${l},${s} ${c},${d} ${o},${a}`,u,p,f,g]}function KV(e){return S.memo(({id:r,sourceX:n,sourceY:o,targetX:a,targetY:i,sourcePosition:l,targetPosition:s,label:c,labelStyle:d,labelShowBg:u,labelBgStyle:p,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:x,interactionWidth:k})=>{const[C,_,$]=ZV({sourceX:n,sourceY:o,sourcePosition:l,targetX:a,targetY:i,targetPosition:s}),R=e.isInternal?void 0:r;return y.jsx(iw,{id:R,path:C,labelX:_,labelY:$,label:c,labelStyle:d,labelShowBg:u,labelBgStyle:p,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:x,interactionWidth:k})})}const tEe=KV({isInternal:!1}),QV=KV({isInternal:!0});tEe.displayName="SimpleBezierEdge",QV.displayName="SimpleBezierEdgeInternal";function JV(e){return S.memo(({id:r,sourceX:n,sourceY:o,targetX:a,targetY:i,label:l,labelStyle:s,labelShowBg:c,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:f,sourcePosition:g=Ue.Bottom,targetPosition:v=Ue.Top,markerEnd:w,markerStart:x,pathOptions:k,interactionWidth:C})=>{const[_,$,R]=Kx({sourceX:n,sourceY:o,sourcePosition:g,targetX:a,targetY:i,targetPosition:v,borderRadius:k?.borderRadius,offset:k?.offset,stepPosition:k?.stepPosition}),T=e.isInternal?void 0:r;return y.jsx(iw,{id:T,path:_,labelX:$,labelY:R,label:l,labelStyle:s,labelShowBg:c,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:f,markerEnd:w,markerStart:x,interactionWidth:C})})}const eq=JV({isInternal:!1}),tq=JV({isInternal:!0});eq.displayName="SmoothStepEdge",tq.displayName="SmoothStepEdgeInternal";function rq(e){return S.memo(({id:r,...n})=>{const o=e.isInternal?void 0:r;return y.jsx(eq,{...n,id:o,pathOptions:S.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const rEe=rq({isInternal:!1}),nq=rq({isInternal:!0});rEe.displayName="StepEdge",nq.displayName="StepEdgeInternal";function oq(e){return S.memo(({id:r,sourceX:n,sourceY:o,targetX:a,targetY:i,label:l,labelStyle:s,labelShowBg:c,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:f,markerEnd:g,markerStart:v,interactionWidth:w})=>{const[x,k,C]=VF({sourceX:n,sourceY:o,targetX:a,targetY:i}),_=e.isInternal?void 0:r;return y.jsx(iw,{id:_,path:x,labelX:k,labelY:C,label:l,labelStyle:s,labelShowBg:c,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:f,markerEnd:g,markerStart:v,interactionWidth:w})})}const nEe=oq({isInternal:!1}),aq=oq({isInternal:!0});nEe.displayName="StraightEdge",aq.displayName="StraightEdgeInternal";function iq(e){return S.memo(({id:r,sourceX:n,sourceY:o,targetX:a,targetY:i,sourcePosition:l=Ue.Bottom,targetPosition:s=Ue.Top,label:c,labelStyle:d,labelShowBg:u,labelBgStyle:p,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:x,pathOptions:k,interactionWidth:C})=>{const[_,$,R]=Zx({sourceX:n,sourceY:o,sourcePosition:l,targetX:a,targetY:i,targetPosition:s,curvature:k?.curvature}),T=e.isInternal?void 0:r;return y.jsx(iw,{id:T,path:_,labelX:$,labelY:R,label:c,labelStyle:d,labelShowBg:u,labelBgStyle:p,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:x,interactionWidth:C})})}const oEe=iq({isInternal:!1}),lq=iq({isInternal:!0});oEe.displayName="BezierEdge",lq.displayName="BezierEdgeInternal";const sq={default:lq,straight:aq,step:nq,smoothstep:tq,simplebezier:QV},cq={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},aEe=(e,r,n)=>n===Ue.Left?e-r:n===Ue.Right?e+r:e,iEe=(e,r,n)=>n===Ue.Top?e-r:n===Ue.Bottom?e+r:e,dq="react-flow__edgeupdater";function uq({position:e,centerX:r,centerY:n,radius:o=10,onMouseDown:a,onMouseEnter:i,onMouseOut:l,type:s}){return y.jsx("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:l,className:dn([dq,`${dq}-${s}`]),cx:aEe(r,o,e),cy:iEe(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function lEe({isReconnectable:e,reconnectRadius:r,edge:n,sourceX:o,sourceY:a,targetX:i,targetY:l,sourcePosition:s,targetPosition:c,onReconnect:d,onReconnectStart:u,onReconnectEnd:p,setReconnecting:f,setUpdateHover:g}){const v=vr(),w=($,R)=>{if($.button!==0)return;const{autoPanOnConnect:T,domNode:A,isValidConnection:z,connectionMode:j,connectionRadius:I,lib:P,onConnectStart:L,onConnectEnd:H,cancelConnection:M,nodeLookup:V,rfId:B,panBy:F,updateConnection:q}=v.getState(),G=R.type==="target",U=(O,W)=>{f(!1),p?.(O,n,R.type,W)},Y=O=>d?.(n,O),Z=(O,W)=>{f(!0),u?.($,n,R.type),L?.(O,W)};U7.onPointerDown($.nativeEvent,{autoPanOnConnect:T,connectionMode:j,connectionRadius:I,domNode:A,handleId:R.id,nodeId:R.nodeId,nodeLookup:V,isTarget:G,edgeUpdaterType:R.type,lib:P,flowId:B,cancelConnection:M,panBy:F,isValidConnection:z,onConnect:Y,onConnectStart:Z,onConnectEnd:H,onReconnectEnd:U,updateConnection:q,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,dragThreshold:v.getState().connectionDragThreshold,handleDomNode:$.currentTarget})},x=$=>w($,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=$=>w($,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>g(!0),_=()=>g(!1);return y.jsxs(y.Fragment,{children:[(e===!0||e==="source")&&y.jsx(uq,{position:s,centerX:o,centerY:a,radius:r,onMouseDown:x,onMouseEnter:C,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&y.jsx(uq,{position:c,centerX:i,centerY:l,radius:r,onMouseDown:k,onMouseEnter:C,onMouseOut:_,type:"target"})]})}function sEe({id:e,edgesFocusable:r,edgesReconnectable:n,elementsSelectable:o,onClick:a,onDoubleClick:i,onContextMenu:l,onMouseEnter:s,onMouseMove:c,onMouseLeave:d,reconnectRadius:u,onReconnect:p,onReconnectStart:f,onReconnectEnd:g,rfId:v,edgeTypes:w,noPanClassName:x,onError:k,disableKeyboardA11y:C}){let _=Dt(ce=>ce.edgeLookup.get(e));const $=Dt(ce=>ce.defaultEdgeOptions);_=$?{...$,..._}:_;let R=_.type||"default",T=w?.[R]||sq[R];T===void 0&&(k?.("011",Gl.error011(R)),R="default",T=w?.default||sq.default);const A=!!(_.focusable||r&&typeof _.focusable>"u"),z=typeof p<"u"&&(_.reconnectable||n&&typeof _.reconnectable>"u"),j=!!(_.selectable||o&&typeof _.selectable>"u"),I=S.useRef(null),[P,L]=S.useState(!1),[H,M]=S.useState(!1),V=vr(),{zIndex:B,sourceX:F,sourceY:q,targetX:G,targetY:U,sourcePosition:Y,targetPosition:Z}=Dt(S.useCallback(ce=>{const pe=ce.nodeLookup.get(_.source),xe=ce.nodeLookup.get(_.target);if(!pe||!xe)return{zIndex:_.zIndex,...cq};const je=WF({id:e,sourceNode:pe,targetNode:xe,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ce.connectionMode,onError:k});return{zIndex:G7e({selected:_.selected,zIndex:_.zIndex,sourceNode:pe,targetNode:xe,elevateOnSelect:ce.elevateEdgesOnSelect,zIndexMode:ce.zIndexMode}),...je||cq}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),jr),O=S.useMemo(()=>_.markerStart?`url('#${B7(_.markerStart,v)}')`:void 0,[_.markerStart,v]),W=S.useMemo(()=>_.markerEnd?`url('#${B7(_.markerEnd,v)}')`:void 0,[_.markerEnd,v]);if(_.hidden||F===null||q===null||G===null||U===null)return null;const K=ce=>{const{addSelectedEdges:pe,unselectNodesAndEdges:xe,multiSelectionActive:je}=V.getState();j&&(V.setState({nodesSelectionActive:!1}),_.selected&&je?(xe({nodes:[],edges:[_]}),I.current?.blur()):pe([e])),a&&a(ce,_)},Q=i?ce=>{i(ce,{..._})}:void 0,ae=l?ce=>{l(ce,{..._})}:void 0,te=s?ce=>{s(ce,{..._})}:void 0,re=c?ce=>{c(ce,{..._})}:void 0,ue=d?ce=>{d(ce,{..._})}:void 0,_e=ce=>{if(!C&&bF.includes(ce.key)&&j){const{unselectNodesAndEdges:pe,addSelectedEdges:xe}=V.getState();ce.key==="Escape"?(I.current?.blur(),pe({edges:[_]})):xe([e])}};return y.jsx("svg",{style:{zIndex:B},children:y.jsxs("g",{className:dn(["react-flow__edge",`react-flow__edge-${R}`,_.className,x,{selected:_.selected,animated:_.animated,inactive:!j&&!a,updating:P,selectable:j}]),onClick:K,onDoubleClick:Q,onContextMenu:ae,onMouseEnter:te,onMouseMove:re,onMouseLeave:ue,onKeyDown:A?_e:void 0,tabIndex:A?0:void 0,role:_.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":A?`${SV}-${v}`:void 0,ref:I,..._.domAttributes,children:[!H&&y.jsx(T,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:j,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:F,sourceY:q,targetX:G,targetY:U,sourcePosition:Y,targetPosition:Z,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:O,markerEnd:W,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),z&&y.jsx(lEe,{edge:_,isReconnectable:z,reconnectRadius:u,onReconnect:p,onReconnectStart:f,onReconnectEnd:g,sourceX:F,sourceY:q,targetX:G,targetY:U,sourcePosition:Y,targetPosition:Z,setUpdateHover:L,setReconnecting:M})]})})}var cEe=S.memo(sEe);const dEe=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function pq({defaultMarkerColor:e,onlyRenderVisibleElements:r,rfId:n,edgeTypes:o,noPanClassName:a,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:u,reconnectRadius:p,onEdgeDoubleClick:f,onReconnectStart:g,onReconnectEnd:v,disableKeyboardA11y:w}){const{edgesFocusable:x,edgesReconnectable:k,elementsSelectable:C,onError:_}=Dt(dEe,jr),$=YSe(r);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(JSe,{defaultColor:e,rfId:n}),$.map(R=>y.jsx(cEe,{id:R,edgesFocusable:x,edgesReconnectable:k,elementsSelectable:C,noPanClassName:a,onReconnect:i,onContextMenu:l,onMouseEnter:s,onMouseMove:c,onMouseLeave:d,onClick:u,reconnectRadius:p,onDoubleClick:f,onReconnectStart:g,onReconnectEnd:v,rfId:n,onError:_,edgeTypes:o,disableKeyboardA11y:w},R))]})}pq.displayName="EdgeRenderer";const uEe=S.memo(pq),pEe=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function hEe({children:e}){const r=Dt(pEe);return y.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:e})}function fEe(e){const r=pf(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&r.viewportInitialized&&e&&(setTimeout(()=>e(r),1),n.current=!0)},[e,r.viewportInitialized])}const mEe=e=>e.panZoom?.syncViewport;function gEe(e){const r=Dt(mEe),n=vr();return S.useEffect(()=>{e&&(r?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,r]),null}function yEe(e){return e.connection.inProgress?{...e.connection,to:G1(e.connection.to,e.transform)}:{...e.connection}}function vEe(e){return yEe}function bEe(e){const r=vEe();return Dt(r,jr)}const xEe=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function wEe({containerStyle:e,style:r,type:n,component:o}){const{nodesConnectable:a,width:i,height:l,isValid:s,inProgress:c}=Dt(xEe,jr);return i&&a&&c?y.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:dn(["react-flow__connection",_F(s)]),children:y.jsx(hq,{style:r,type:n,CustomComponent:o,isValid:s})})}):null}const hq=({style:e,type:r=ad.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:a,from:i,fromNode:l,fromHandle:s,fromPosition:c,to:d,toNode:u,toHandle:p,toPosition:f,pointer:g}=bEe();if(!a)return;if(n)return y.jsx(n,{connectionLineType:r,connectionLineStyle:e,fromNode:l,fromHandle:s,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:f,connectionStatus:_F(o),toNode:u,toHandle:p,pointer:g});let v="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:f};switch(r){case ad.Bezier:[v]=Zx(w);break;case ad.SimpleBezier:[v]=ZV(w);break;case ad.Step:[v]=Kx({...w,borderRadius:0});break;case ad.SmoothStep:[v]=Kx(w);break;default:[v]=VF(w)}return y.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:e})};hq.displayName="ConnectionLine";const kEe={};function fq(e=kEe){S.useRef(e),vr(),S.useEffect(()=>{},[e])}function _Ee(){vr(),S.useRef(!1),S.useEffect(()=>{},[])}function mq({nodeTypes:e,edgeTypes:r,onInit:n,onNodeClick:o,onEdgeClick:a,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:u,onSelectionContextMenu:p,onSelectionStart:f,onSelectionEnd:g,connectionLineType:v,connectionLineStyle:w,connectionLineComponent:x,connectionLineContainerStyle:k,selectionKeyCode:C,selectionOnDrag:_,selectionMode:$,multiSelectionKeyCode:R,panActivationKeyCode:T,zoomActivationKeyCode:A,deleteKeyCode:z,onlyRenderVisibleElements:j,elementsSelectable:I,defaultViewport:P,translateExtent:L,minZoom:H,maxZoom:M,preventScrolling:V,defaultMarkerColor:B,zoomOnScroll:F,zoomOnPinch:q,panOnScroll:G,panOnScrollSpeed:U,panOnScrollMode:Y,zoomOnDoubleClick:Z,panOnDrag:O,onPaneClick:W,onPaneMouseEnter:K,onPaneMouseMove:Q,onPaneMouseLeave:ae,onPaneScroll:te,onPaneContextMenu:re,paneClickDistance:ue,nodeClickDistance:_e,onEdgeContextMenu:ce,onEdgeMouseEnter:pe,onEdgeMouseMove:xe,onEdgeMouseLeave:je,reconnectRadius:Be,onReconnect:Je,onReconnectStart:st,onReconnectEnd:Le,noDragClassName:St,noWheelClassName:Ve,noPanClassName:qe,disableKeyboardA11y:Xe,nodeExtent:It,rfId:Et,viewport:be,onViewportChange:ke}){return fq(e),fq(r),_Ee(),fEe(n),gEe(be),y.jsx(ISe,{onPaneClick:W,onPaneMouseEnter:K,onPaneMouseMove:Q,onPaneMouseLeave:ae,onPaneContextMenu:re,onPaneScroll:te,paneClickDistance:ue,deleteKeyCode:z,selectionKeyCode:C,selectionOnDrag:_,selectionMode:$,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:R,panActivationKeyCode:T,zoomActivationKeyCode:A,elementsSelectable:I,zoomOnScroll:F,zoomOnPinch:q,zoomOnDoubleClick:Z,panOnScroll:G,panOnScrollSpeed:U,panOnScrollMode:Y,panOnDrag:O,defaultViewport:P,translateExtent:L,minZoom:H,maxZoom:M,onSelectionContextMenu:p,preventScrolling:V,noDragClassName:St,noWheelClassName:Ve,noPanClassName:qe,disableKeyboardA11y:Xe,onViewportChange:ke,isControlledViewport:!!be,children:y.jsxs(hEe,{children:[y.jsx(uEe,{edgeTypes:r,onEdgeClick:a,onEdgeDoubleClick:l,onReconnect:Je,onReconnectStart:st,onReconnectEnd:Le,onlyRenderVisibleElements:j,onEdgeContextMenu:ce,onEdgeMouseEnter:pe,onEdgeMouseMove:xe,onEdgeMouseLeave:je,reconnectRadius:Be,defaultMarkerColor:B,noPanClassName:qe,disableKeyboardA11y:Xe,rfId:Et}),y.jsx(wEe,{style:w,type:v,component:x,containerStyle:k}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(GSe,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:u,nodeClickDistance:_e,onlyRenderVisibleElements:j,noPanClassName:qe,noDragClassName:St,disableKeyboardA11y:Xe,nodeExtent:It,rfId:Et}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}mq.displayName="GraphView";const SEe=S.memo(mq),gq=({nodes:e,edges:r,defaultNodes:n,defaultEdges:o,width:a,height:i,fitView:l,fitViewOptions:s,minZoom:c=.5,maxZoom:d=2,nodeOrigin:u,nodeExtent:p,zIndexMode:f="basic"}={})=>{const g=new Map,v=new Map,w=new Map,x=new Map,k=o??r??[],C=n??e??[],_=u??[0,0],$=p??V1;QF(w,x,k);const R=F7(C,g,v,{nodeOrigin:_,nodeExtent:$,zIndexMode:f});let T=[0,0,1];if(l&&a&&i){const A=nf(g,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:z,y:j,zoom:I}=Ws(A,a,i,c,d,s?.padding??.1);T=[z,j,I]}return{rfId:"1",width:a??0,height:i??0,transform:T,nodes:C,nodesInitialized:R,nodeLookup:g,parentLookup:v,edges:k,edgeLookup:x,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:V1,nodeExtent:$,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:rf.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:s,fitViewResolver:null,connection:{...wF},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:F7e,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:xF,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},EEe=({nodes:e,edges:r,defaultNodes:n,defaultEdges:o,width:a,height:i,fitView:l,fitViewOptions:s,minZoom:c,maxZoom:d,nodeOrigin:u,nodeExtent:p,zIndexMode:f})=>q9e((g,v)=>{async function w(){const{nodeLookup:x,panZoom:k,fitViewOptions:C,fitViewResolver:_,width:$,height:R,minZoom:T,maxZoom:A}=v();k&&(await O7e({nodes:x,width:$,height:R,panZoom:k,minZoom:T,maxZoom:A},C),_?.resolve(!0),g({fitViewResolver:null}))}return{...gq({nodes:e,edges:r,width:a,height:i,fitView:l,fitViewOptions:s,minZoom:c,maxZoom:d,nodeOrigin:u,nodeExtent:p,defaultNodes:n,defaultEdges:o,zIndexMode:f}),setNodes:x=>{const{nodeLookup:k,parentLookup:C,nodeOrigin:_,elevateNodesOnSelect:$,fitViewQueued:R,zIndexMode:T}=v(),A=F7(x,k,C,{nodeOrigin:_,nodeExtent:p,elevateNodesOnSelect:$,checkEquality:!0,zIndexMode:T});R&&A?(w(),g({nodes:x,nodesInitialized:A,fitViewQueued:!1,fitViewOptions:void 0})):g({nodes:x,nodesInitialized:A})},setEdges:x=>{const{connectionLookup:k,edgeLookup:C}=v();QF(k,C,x),g({edges:x})},setDefaultNodesAndEdges:(x,k)=>{if(x){const{setNodes:C}=v();C(x),g({hasDefaultNodes:!0})}if(k){const{setEdges:C}=v();C(k),g({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:k,nodeLookup:C,parentLookup:_,domNode:$,nodeOrigin:R,nodeExtent:T,debug:A,fitViewQueued:z,zIndexMode:j}=v(),{changes:I,updatedInternals:P}=c9e(x,C,_,$,R,T,j);P&&(a9e(C,_,{nodeOrigin:R,nodeExtent:T,zIndexMode:j}),z?(w(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),I?.length>0&&(A&&console.log("React Flow: trigger node changes",I),k?.(I)))},updateNodePositions:(x,k=!1)=>{const C=[];let _=[];const{nodeLookup:$,triggerNodeChanges:R,connection:T,updateConnection:A,onNodesChangeMiddlewareMap:z}=v();for(const[j,I]of x){const P=$.get(j),L=!!(P?.expandParent&&P?.parentId&&I?.position),H={id:j,type:"position",position:L?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:k};if(P&&T.inProgress&&T.fromNode.id===P.id){const M=Ku(P,T.fromHandle,Ue.Left,!0);A({...T,from:M})}L&&P.parentId&&C.push({id:j,parentId:P.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),_.push(H)}if(C.length>0){const{parentLookup:j,nodeOrigin:I}=v(),P=q7(C,$,j,I);_.push(...P)}for(const j of z.values())_=j(_);R(_)},triggerNodeChanges:x=>{const{onNodesChange:k,setNodes:C,nodes:_,hasDefaultNodes:$,debug:R}=v();if(x?.length){if($){const T=rw(x,_);C(T)}R&&console.log("React Flow: trigger node changes",x),k?.(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:k,setEdges:C,edges:_,hasDefaultEdges:$,debug:R}=v();if(x?.length){if($){const T=nw(x,_);C(T)}R&&console.log("React Flow: trigger edge changes",x),k?.(x)}},addSelectedNodes:x=>{const{multiSelectionActive:k,edgeLookup:C,nodeLookup:_,triggerNodeChanges:$,triggerEdgeChanges:R}=v();if(k){const T=x.map(A=>Qu(A,!0));$(T);return}$(uf(_,new Set([...x]),!0)),R(uf(C))},addSelectedEdges:x=>{const{multiSelectionActive:k,edgeLookup:C,nodeLookup:_,triggerNodeChanges:$,triggerEdgeChanges:R}=v();if(k){const T=x.map(A=>Qu(A,!0));R(T);return}R(uf(C,new Set([...x]))),$(uf(_,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:k}={})=>{const{edges:C,nodes:_,nodeLookup:$,triggerNodeChanges:R,triggerEdgeChanges:T}=v(),A=x||_,z=k||C,j=A.map(P=>{const L=$.get(P.id);return L&&(L.selected=!1),Qu(P.id,!1)}),I=z.map(P=>Qu(P.id,!1));R(j),T(I)},setMinZoom:x=>{const{panZoom:k,maxZoom:C}=v();k?.setScaleExtent([x,C]),g({minZoom:x})},setMaxZoom:x=>{const{panZoom:k,minZoom:C}=v();k?.setScaleExtent([C,x]),g({maxZoom:x})},setTranslateExtent:x=>{v().panZoom?.setTranslateExtent(x),g({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:k,triggerNodeChanges:C,triggerEdgeChanges:_,elementsSelectable:$}=v();if(!$)return;const R=k.reduce((A,z)=>z.selected?[...A,Qu(z.id,!1)]:A,[]),T=x.reduce((A,z)=>z.selected?[...A,Qu(z.id,!1)]:A,[]);C(R),_(T)},setNodeExtent:x=>{const{nodes:k,nodeLookup:C,parentLookup:_,nodeOrigin:$,elevateNodesOnSelect:R,nodeExtent:T,zIndexMode:A}=v();x[0][0]===T[0][0]&&x[0][1]===T[0][1]&&x[1][0]===T[1][0]&&x[1][1]===T[1][1]||(F7(k,C,_,{nodeOrigin:$,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:A}),g({nodeExtent:x}))},panBy:x=>{const{transform:k,width:C,height:_,panZoom:$,translateExtent:R}=v();return d9e({delta:x,panZoom:$,transform:k,translateExtent:R,width:C,height:_})},setCenter:async(x,k,C)=>{const{width:_,height:$,maxZoom:R,panZoom:T}=v();if(!T)return Promise.resolve(!1);const A=typeof C?.zoom<"u"?C.zoom:R;return await T.setViewport({x:_/2-x*A,y:$/2-k*A,zoom:A},{duration:C?.duration,ease:C?.ease,interpolate:C?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{g({connection:{...wF}})},updateConnection:x=>{g({connection:x})},reset:()=>g({...gq()})}},Object.is);function lw({initialNodes:e,initialEdges:r,defaultNodes:n,defaultEdges:o,initialWidth:a,initialHeight:i,initialMinZoom:l,initialMaxZoom:s,initialFitViewOptions:c,fitView:d,nodeOrigin:u,nodeExtent:p,zIndexMode:f,children:g}){const[v]=S.useState(()=>EEe({nodes:e,edges:r,defaultNodes:n,defaultEdges:o,width:a,height:i,fitView:d,minZoom:l,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:p,zIndexMode:f}));return y.jsx(H9e,{value:v,children:y.jsx(hSe,{children:g})})}function CEe({children:e,nodes:r,edges:n,defaultNodes:o,defaultEdges:a,width:i,height:l,fitView:s,fitViewOptions:c,minZoom:d,maxZoom:u,nodeOrigin:p,nodeExtent:f,zIndexMode:g}){return S.useContext(ew)?y.jsx(y.Fragment,{children:e}):y.jsx(lw,{initialNodes:r,initialEdges:n,defaultNodes:o,defaultEdges:a,initialWidth:i,initialHeight:l,fitView:s,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:u,nodeOrigin:p,nodeExtent:f,zIndexMode:g,children:e})}const $Ee={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function REe({nodes:e,edges:r,defaultNodes:n,defaultEdges:o,className:a,nodeTypes:i,edgeTypes:l,onNodeClick:s,onEdgeClick:c,onInit:d,onMove:u,onMoveStart:p,onMoveEnd:f,onConnect:g,onConnectStart:v,onConnectEnd:w,onClickConnectStart:x,onClickConnectEnd:k,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:$,onNodeContextMenu:R,onNodeDoubleClick:T,onNodeDragStart:A,onNodeDrag:z,onNodeDragStop:j,onNodesDelete:I,onEdgesDelete:P,onDelete:L,onSelectionChange:H,onSelectionDragStart:M,onSelectionDrag:V,onSelectionDragStop:B,onSelectionContextMenu:F,onSelectionStart:q,onSelectionEnd:G,onBeforeDelete:U,connectionMode:Y,connectionLineType:Z=ad.Bezier,connectionLineStyle:O,connectionLineComponent:W,connectionLineContainerStyle:K,deleteKeyCode:Q="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:te=!1,selectionMode:re=q1.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:_e=lf()?"Meta":"Control",zoomActivationKeyCode:ce=lf()?"Meta":"Control",snapToGrid:pe,snapGrid:xe,onlyRenderVisibleElements:je=!1,selectNodesOnDrag:Be,nodesDraggable:Je,autoPanOnNodeFocus:st,nodesConnectable:Le,nodesFocusable:St,nodeOrigin:Ve=EV,edgesFocusable:qe,edgesReconnectable:Xe,elementsSelectable:It=!0,defaultViewport:Et=nSe,minZoom:be=.5,maxZoom:ke=2,translateExtent:Ye=V1,preventScrolling:yt=!0,nodeExtent:xt,defaultMarkerColor:Tr="#b1b1b7",zoomOnScroll:er=!0,zoomOnPinch:qt=!0,panOnScroll:Ht=!1,panOnScrollSpeed:Zr=.5,panOnScrollMode:Gt=Yu.Free,zoomOnDoubleClick:ln=!0,panOnDrag:Wn=!0,onPaneClick:fn,onPaneMouseEnter:oo,onPaneMouseMove:Yo,onPaneMouseLeave:jo,onPaneScroll:ua,onPaneContextMenu:Dl,paneClickDistance:Ao=1,nodeClickDistance:xs=0,children:ws,onReconnect:zc,onReconnectStart:Ml,onReconnectEnd:lh,onEdgeContextMenu:ks,onEdgeDoubleClick:tu,onEdgeMouseEnter:Xo,onEdgeMouseMove:Tc,onEdgeMouseLeave:_s,reconnectRadius:ru=10,onNodesChange:Ss,onEdgesChange:Zo,noDragClassName:Nr="nodrag",noWheelClassName:Mn="nowheel",noPanClassName:Do="nopan",fitView:Nl,fitViewOptions:jc,connectOnClick:sh,attributionPosition:La,proOptions:Ri,defaultEdgeOptions:Pl,elevateNodesOnSelect:zi=!0,elevateEdgesOnSelect:Ti=!1,disableKeyboardA11y:pa=!1,autoPanOnConnect:ho,autoPanOnNodeDrag:Wr,autoPanSpeed:Ac,connectionRadius:Dc,isValidConnection:Fa,onError:ji,style:nu,id:Es,nodeDragThreshold:ou,connectionDragThreshold:ch,viewport:Cs,onViewportChange:$s,width:Mo,height:Gr,colorMode:au="light",debug:dh,onScroll:Ai,ariaLabelConfig:iu,zIndexMode:Di="basic",...lu},J){const ee=Es||"1",oe=lSe(au),ie=S.useCallback(le=>{le.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ai?.(le)},[Ai]);return y.jsx("div",{"data-testid":"rf__wrapper",...lu,onScroll:ie,style:{...nu,...$Ee},ref:J,className:dn(["react-flow",a,oe]),id:Es,role:"application",children:y.jsxs(CEe,{nodes:e,edges:r,width:Mo,height:Gr,fitView:Nl,fitViewOptions:jc,minZoom:be,maxZoom:ke,nodeOrigin:Ve,nodeExtent:xt,zIndexMode:Di,children:[y.jsx(SEe,{onInit:d,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:$,onNodeContextMenu:R,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:l,connectionLineType:Z,connectionLineStyle:O,connectionLineComponent:W,connectionLineContainerStyle:K,selectionKeyCode:ae,selectionOnDrag:te,selectionMode:re,deleteKeyCode:Q,multiSelectionKeyCode:_e,panActivationKeyCode:ue,zoomActivationKeyCode:ce,onlyRenderVisibleElements:je,defaultViewport:Et,translateExtent:Ye,minZoom:be,maxZoom:ke,preventScrolling:yt,zoomOnScroll:er,zoomOnPinch:qt,zoomOnDoubleClick:ln,panOnScroll:Ht,panOnScrollSpeed:Zr,panOnScrollMode:Gt,panOnDrag:Wn,onPaneClick:fn,onPaneMouseEnter:oo,onPaneMouseMove:Yo,onPaneMouseLeave:jo,onPaneScroll:ua,onPaneContextMenu:Dl,paneClickDistance:Ao,nodeClickDistance:xs,onSelectionContextMenu:F,onSelectionStart:q,onSelectionEnd:G,onReconnect:zc,onReconnectStart:Ml,onReconnectEnd:lh,onEdgeContextMenu:ks,onEdgeDoubleClick:tu,onEdgeMouseEnter:Xo,onEdgeMouseMove:Tc,onEdgeMouseLeave:_s,reconnectRadius:ru,defaultMarkerColor:Tr,noDragClassName:Nr,noWheelClassName:Mn,noPanClassName:Do,rfId:ee,disableKeyboardA11y:pa,nodeExtent:xt,viewport:Cs,onViewportChange:$s}),y.jsx(iSe,{nodes:e,edges:r,defaultNodes:n,defaultEdges:o,onConnect:g,onConnectStart:v,onConnectEnd:w,onClickConnectStart:x,onClickConnectEnd:k,nodesDraggable:Je,autoPanOnNodeFocus:st,nodesConnectable:Le,nodesFocusable:St,edgesFocusable:qe,edgesReconnectable:Xe,elementsSelectable:It,elevateNodesOnSelect:zi,elevateEdgesOnSelect:Ti,minZoom:be,maxZoom:ke,nodeExtent:xt,onNodesChange:Ss,onEdgesChange:Zo,snapToGrid:pe,snapGrid:xe,connectionMode:Y,translateExtent:Ye,connectOnClick:sh,defaultEdgeOptions:Pl,fitView:Nl,fitViewOptions:jc,onNodesDelete:I,onEdgesDelete:P,onDelete:L,onNodeDragStart:A,onNodeDrag:z,onNodeDragStop:j,onSelectionDrag:V,onSelectionDragStart:M,onSelectionDragStop:B,onMove:u,onMoveStart:p,onMoveEnd:f,noPanClassName:Do,nodeOrigin:Ve,rfId:ee,autoPanOnConnect:ho,autoPanOnNodeDrag:Wr,autoPanSpeed:Ac,onError:ji,connectionRadius:Dc,isValidConnection:Fa,selectNodesOnDrag:Be,nodeDragThreshold:ou,connectionDragThreshold:ch,onBeforeDelete:U,debug:dh,ariaLabelConfig:iu,zIndexMode:Di}),y.jsx(rSe,{onSelectionChange:H}),ws,y.jsx(K9e,{proOptions:Ri,position:La}),y.jsx(Z9e,{rfId:ee,disableKeyboardA11y:pa})]})})}var zEe=PV(REe);const TEe=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function yq({children:e}){const r=Dt(TEe);return r?Vi.createPortal(e,r):null}function jEe({dimensions:e,lineWidth:r,variant:n,className:o}){return y.jsx("path",{strokeWidth:r,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:dn(["react-flow__background-pattern",n,o])})}function AEe({radius:e,className:r}){return y.jsx("circle",{cx:e,cy:e,r:e,className:dn(["react-flow__background-pattern","dots",r])})}var Qi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qi||(Qi={}));const DEe={[Qi.Dots]:1,[Qi.Lines]:1,[Qi.Cross]:6},MEe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function vq({id:e,variant:r=Qi.Dots,gap:n=20,size:o,lineWidth:a=1,offset:i=0,color:l,bgColor:s,style:c,className:d,patternClassName:u}){const p=S.useRef(null),{transform:f,patternId:g}=Dt(MEe,jr),v=o||DEe[r],w=r===Qi.Dots,x=r===Qi.Cross,k=Array.isArray(n)?n:[n,n],C=[k[0]*f[2]||1,k[1]*f[2]||1],_=v*f[2],$=Array.isArray(i)?i:[i,i],R=x?[_,_]:C,T=[$[0]*f[2]||1+R[0]/2,$[1]*f[2]||1+R[1]/2],A=`${g}${e||""}`;return y.jsxs("svg",{className:dn(["react-flow__background",d]),style:{...c,...ow,"--xy-background-color-props":s,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[y.jsx("pattern",{id:A,x:f[0]%C[0],y:f[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:w?y.jsx(AEe,{radius:_/2,className:u}):y.jsx(jEe,{dimensions:R,lineWidth:a,variant:r,className:u})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}vq.displayName="Background";const bq=S.memo(vq);function NEe(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function PEe(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function BEe(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function IEe(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function OEe(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function sw({children:e,className:r,...n}){return y.jsx("button",{type:"button",className:dn(["react-flow__controls-button",r]),...n,children:e})}const LEe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function xq({style:e,showZoom:r=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:a,onZoomIn:i,onZoomOut:l,onFitView:s,onInteractiveChange:c,className:d,children:u,position:p="bottom-left",orientation:f="vertical","aria-label":g}){const v=vr(),{isInteractive:w,minZoomReached:x,maxZoomReached:k,ariaLabelConfig:C}=Dt(LEe,jr),{zoomIn:_,zoomOut:$,fitView:R}=pf(),T=()=>{_(),i?.()},A=()=>{$(),l?.()},z=()=>{R(a),s?.()},j=()=>{v.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c?.(!w)};return y.jsxs(sd,{className:dn(["react-flow__controls",f==="horizontal"?"horizontal":"vertical",d]),position:p,style:e,"data-testid":"rf__controls","aria-label":g??C["controls.ariaLabel"],children:[r&&y.jsxs(y.Fragment,{children:[y.jsx(sw,{onClick:T,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:k,children:y.jsx(NEe,{})}),y.jsx(sw,{onClick:A,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:x,children:y.jsx(PEe,{})})]}),n&&y.jsx(sw,{className:"react-flow__controls-fitview",onClick:z,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:y.jsx(BEe,{})}),o&&y.jsx(sw,{className:"react-flow__controls-interactive",onClick:j,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:w?y.jsx(OEe,{}):y.jsx(IEe,{})}),u]})}xq.displayName="Controls",S.memo(xq);function FEe({id:e,x:r,y:n,width:o,height:a,style:i,color:l,strokeColor:s,strokeWidth:c,className:d,borderRadius:u,shapeRendering:p,selected:f,onClick:g}){const{background:v,backgroundColor:w}=i||{},x=l||v||w;return y.jsx("rect",{className:dn(["react-flow__minimap-node",{selected:f},d]),x:r,y:n,rx:u,ry:u,width:o,height:a,style:{fill:x,stroke:s,strokeWidth:c},shapeRendering:p,onClick:g?k=>g(k,e):void 0})}const VEe=S.memo(FEe),qEe=e=>e.nodes.map(r=>r.id),t9=e=>e instanceof Function?e:()=>e;function HEe({nodeStrokeColor:e,nodeColor:r,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:a,nodeComponent:i=VEe,onClick:l}){const s=Dt(qEe,jr),c=t9(r),d=t9(e),u=t9(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:s.map(f=>y.jsx(WEe,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:u,nodeBorderRadius:o,nodeStrokeWidth:a,NodeComponent:i,onClick:l,shapeRendering:p},f))})}function UEe({id:e,nodeColorFunc:r,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:a,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:s,onClick:c}){const{node:d,x:u,y:p,width:f,height:g}=Dt(v=>{const{internals:w}=v.nodeLookup.get(e),x=w.userNode,{x:k,y:C}=w.positionAbsolute,{width:_,height:$}=_o(x);return{node:x,x:k,y:C,width:_,height:$}},jr);return!d||d.hidden||!AF(d)?null:y.jsx(s,{x:u,y:p,width:f,height:g,style:d.style,selected:!!d.selected,className:o(d),color:r(d),borderRadius:a,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:c,id:d.id})}const WEe=S.memo(UEe);var GEe=S.memo(HEe);const YEe=200,XEe=150,ZEe=e=>!e.hidden,KEe=e=>{const r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:e.nodeLookup.size>0?TF(nf(e.nodeLookup,{filter:ZEe}),r):r,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},QEe="react-flow__minimap-desc";function wq({style:e,className:r,nodeStrokeColor:n,nodeColor:o,nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:s,bgColor:c,maskColor:d,maskStrokeColor:u,maskStrokeWidth:p,position:f="bottom-right",onClick:g,onNodeClick:v,pannable:w=!1,zoomable:x=!1,ariaLabel:k,inversePan:C,zoomStep:_=1,offsetScale:$=5}){const R=vr(),T=S.useRef(null),{boundingRect:A,viewBB:z,rfId:j,panZoom:I,translateExtent:P,flowWidth:L,flowHeight:H,ariaLabelConfig:M}=Dt(KEe,jr),V=e?.width??YEe,B=e?.height??XEe,F=A.width/V,q=A.height/B,G=Math.max(F,q),U=G*V,Y=G*B,Z=$*G,O=A.x-(U-A.width)/2-Z,W=A.y-(Y-A.height)/2-Z,K=U+Z*2,Q=Y+Z*2,ae=`${QEe}-${j}`,te=S.useRef(0),re=S.useRef();te.current=G,S.useEffect(()=>{if(T.current&&I)return re.current=b9e({domNode:T.current,panZoom:I,getTransform:()=>R.getState().transform,getViewScale:()=>te.current}),()=>{re.current?.destroy()}},[I]),S.useEffect(()=>{re.current?.update({translateExtent:P,width:L,height:H,inversePan:C,pannable:w,zoomStep:_,zoomable:x})},[w,x,C,_,P,L,H]);const ue=g?pe=>{const[xe,je]=re.current?.pointer(pe)||[0,0];g(pe,{x:xe,y:je})}:void 0,_e=v?S.useCallback((pe,xe)=>{const je=R.getState().nodeLookup.get(xe).internals.userNode;v(pe,je)},[]):void 0,ce=k??M["minimap.ariaLabel"];return y.jsx(sd,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*G:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:dn(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:V,height:B,viewBox:`${O} ${W} ${K} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:T,onClick:ue,children:[ce&&y.jsx("title",{id:ae,children:ce}),y.jsx(GEe,{onClick:_e,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:a,nodeStrokeWidth:l,nodeComponent:s}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${O-Z},${W-Z}h${K+Z*2}v${Q+Z*2}h${-K-Z*2}z - M${z.x},${z.y}h${z.width}v${z.height}h${-z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}wq.displayName="MiniMap",S.memo(wq);const JEe=e=>r=>e?`${Math.max(1/r.transform[2],1)}`:void 0,eCe={[df.Line]:"right",[df.Handle]:"bottom-right"};function tCe({nodeId:e,position:r,variant:n=df.Handle,className:o,style:a=void 0,children:i,color:l,minWidth:s=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:f,autoScale:g=!0,shouldResize:v,onResizeStart:w,onResize:x,onResizeEnd:k}){const C=e9(),_=typeof e=="string"?e:C,$=vr(),R=S.useRef(null),T=n===df.Handle,A=Dt(S.useCallback(JEe(T&&g),[T,g]),jr),z=S.useRef(null),j=r??eCe[n];S.useEffect(()=>{if(!(!R.current||!_))return z.current||(z.current=D9e({domNode:R.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:P,transform:L,snapGrid:H,snapToGrid:M,nodeOrigin:V,domNode:B}=$.getState();return{nodeLookup:P,transform:L,snapGrid:H,snapToGrid:M,nodeOrigin:V,paneDomNode:B}},onChange:(P,L)=>{const{triggerNodeChanges:H,nodeLookup:M,parentLookup:V,nodeOrigin:B}=$.getState(),F=[],q={x:P.x,y:P.y},G=M.get(_);if(G&&G.expandParent&&G.parentId){const U=G.origin??B,Y=P.width??G.measured.width??0,Z=P.height??G.measured.height??0,O={id:G.id,parentId:G.parentId,rect:{width:Y,height:Z,...DF({x:P.x??G.position.x,y:P.y??G.position.y},{width:Y,height:Z},G.parentId,M,U)}},W=q7([O],M,V,B);F.push(...W),q.x=P.x?Math.max(U[0]*Y,P.x):void 0,q.y=P.y?Math.max(U[1]*Z,P.y):void 0}if(q.x!==void 0&&q.y!==void 0){const U={id:_,type:"position",position:{...q}};F.push(U)}if(P.width!==void 0&&P.height!==void 0){const U={id:_,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:P.width,height:P.height}};F.push(U)}for(const U of L){const Y={...U,type:"position"};F.push(Y)}H(F)},onEnd:({width:P,height:L})=>{const H={id:_,type:"dimensions",resizing:!1,dimensions:{width:P,height:L}};$.getState().triggerNodeChanges([H])}})),z.current.update({controlPosition:j,boundaries:{minWidth:s,minHeight:c,maxWidth:d,maxHeight:u},keepAspectRatio:p,resizeDirection:f,onResizeStart:w,onResize:x,onResizeEnd:k,shouldResize:v}),()=>{z.current?.destroy()}},[j,s,c,d,u,p,w,x,k,v]);const I=j.split("-");return y.jsx("div",{className:dn(["react-flow__resize-control","nodrag",...I,n,o]),ref:R,style:{...a,scale:A,...l&&{[T?"backgroundColor":"borderColor"]:l}},children:i})}S.memo(tCe);const rCe=e=>e.domNode?.querySelector(".react-flow__renderer");function nCe({children:e}){const r=Dt(rCe);return r?Vi.createPortal(e,r):null}const oCe=(e,r)=>e?.internals.positionAbsolute.x!==r?.internals.positionAbsolute.x||e?.internals.positionAbsolute.y!==r?.internals.positionAbsolute.y||e?.measured.width!==r?.measured.width||e?.measured.height!==r?.measured.height||e?.selected!==r?.selected||e?.internals.z!==r?.internals.z,aCe=(e,r)=>{if(e.size!==r.size)return!1;for(const[n,o]of e)if(oCe(o,r.get(n)))return!1;return!0},iCe=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2],selectedNodesCount:e.nodes.filter(r=>r.selected).length});function r9({nodeId:e,children:r,className:n,style:o,isVisible:a,position:i=Ue.Top,offset:l=10,align:s="center",...c}){const d=e9(),u=S.useCallback($=>(Array.isArray(e)?e:[e||d||""]).reduce((R,T)=>{const A=$.nodeLookup.get(T);return A&&R.set(A.id,A),R},new Map),[e,d]),p=Dt(u,aCe),{x:f,y:g,zoom:v,selectedNodesCount:w}=Dt(iCe,jr);if(!(typeof a=="boolean"?a:p.size===1&&p.values().next().value?.selected&&w===1)||!p.size)return null;const x=nf(p),k=Array.from(p.values()),C=Math.max(...k.map($=>$.internals.z+1)),_={position:"absolute",transform:r9e(x,{x:f,y:g,zoom:v},i,l,s),zIndex:C,...o};return y.jsx(nCe,{children:y.jsx("div",{style:_,className:dn(["react-flow__node-toolbar",n]),...c,"data-id":k.reduce(($,R)=>`${$}${R.id} `,"").trim(),children:r})})}const{getOwnPropertyNames:lCe,getOwnPropertySymbols:sCe}=Object,{hasOwnProperty:cCe}=Object.prototype;function n9(e,r){return function(n,o,a){return e(n,o,a)&&r(n,o,a)}}function cw(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);const{cache:a}=o,i=a.get(r),l=a.get(n);if(i&&l)return i===n&&l===r;a.set(r,n),a.set(n,r);const s=e(r,n,o);return a.delete(r),a.delete(n),s}}function dCe(e){return e?.[Symbol.toStringTag]}function kq(e){return lCe(e).concat(sCe(e))}const uCe=Object.hasOwn||((e,r)=>cCe.call(e,r));function Ju(e,r){return e===r||!e&&!r&&e!==e&&r!==r}const pCe="__v",hCe="__o",fCe="_owner",{getOwnPropertyDescriptor:_q,keys:Sq}=Object;function mCe(e,r){return e.byteLength===r.byteLength&&dw(new Uint8Array(e),new Uint8Array(r))}function gCe(e,r,n){let o=e.length;if(r.length!==o)return!1;for(;o-- >0;)if(!n.equals(e[o],r[o],o,o,e,r,n))return!1;return!0}function yCe(e,r){return e.byteLength===r.byteLength&&dw(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}function vCe(e,r){return Ju(e.getTime(),r.getTime())}function bCe(e,r){return e.name===r.name&&e.message===r.message&&e.cause===r.cause&&e.stack===r.stack}function xCe(e,r){return e===r}function Eq(e,r,n){const o=e.size;if(o!==r.size)return!1;if(!o)return!0;const a=new Array(o),i=e.entries();let l,s,c=0;for(;(l=i.next())&&!l.done;){const d=r.entries();let u=!1,p=0;for(;(s=d.next())&&!s.done;){if(a[p]){p++;continue}const f=l.value,g=s.value;if(n.equals(f[0],g[0],c,p,e,r,n)&&n.equals(f[1],g[1],f[0],g[0],e,r,n)){u=a[p]=!0;break}p++}if(!u)return!1;c++}return!0}const wCe=Ju;function kCe(e,r,n){const o=Sq(e);let a=o.length;if(Sq(r).length!==a)return!1;for(;a-- >0;)if(!$q(e,r,n,o[a]))return!1;return!0}function Z1(e,r,n){const o=kq(e);let a=o.length;if(kq(r).length!==a)return!1;let i,l,s;for(;a-- >0;)if(i=o[a],!$q(e,r,n,i)||(l=_q(e,i),s=_q(r,i),(l||s)&&(!l||!s||l.configurable!==s.configurable||l.enumerable!==s.enumerable||l.writable!==s.writable)))return!1;return!0}function _Ce(e,r){return Ju(e.valueOf(),r.valueOf())}function SCe(e,r){return e.source===r.source&&e.flags===r.flags}function Cq(e,r,n){const o=e.size;if(o!==r.size)return!1;if(!o)return!0;const a=new Array(o),i=e.values();let l,s;for(;(l=i.next())&&!l.done;){const c=r.values();let d=!1,u=0;for(;(s=c.next())&&!s.done;){if(!a[u]&&n.equals(l.value,s.value,l.value,s.value,e,r,n)){d=a[u]=!0;break}u++}if(!d)return!1}return!0}function dw(e,r){let n=e.byteLength;if(r.byteLength!==n||e.byteOffset!==r.byteOffset)return!1;for(;n-- >0;)if(e[n]!==r[n])return!1;return!0}function ECe(e,r){return e.hostname===r.hostname&&e.pathname===r.pathname&&e.protocol===r.protocol&&e.port===r.port&&e.hash===r.hash&&e.username===r.username&&e.password===r.password}function $q(e,r,n,o){return(o===fCe||o===hCe||o===pCe)&&(e.$$typeof||r.$$typeof)?!0:uCe(r,o)&&n.equals(e[o],r[o],o,o,e,r,n)}const CCe="[object ArrayBuffer]",$Ce="[object Arguments]",RCe="[object Boolean]",zCe="[object DataView]",TCe="[object Date]",jCe="[object Error]",ACe="[object Map]",DCe="[object Number]",MCe="[object Object]",NCe="[object RegExp]",PCe="[object Set]",BCe="[object String]",ICe={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},OCe="[object URL]",LCe=Object.prototype.toString;function FCe({areArrayBuffersEqual:e,areArraysEqual:r,areDataViewsEqual:n,areDatesEqual:o,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:l,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:d,areRegExpsEqual:u,areSetsEqual:p,areTypedArraysEqual:f,areUrlsEqual:g,unknownTagComparators:v}){return function(w,x,k){if(w===x)return!0;if(w==null||x==null)return!1;const C=typeof w;if(C!==typeof x)return!1;if(C!=="object")return C==="number"?s(w,x,k):C==="function"?i(w,x,k):!1;const _=w.constructor;if(_!==x.constructor)return!1;if(_===Object)return c(w,x,k);if(Array.isArray(w))return r(w,x,k);if(_===Date)return o(w,x,k);if(_===RegExp)return u(w,x,k);if(_===Map)return l(w,x,k);if(_===Set)return p(w,x,k);const $=LCe.call(w);if($===TCe)return o(w,x,k);if($===NCe)return u(w,x,k);if($===ACe)return l(w,x,k);if($===PCe)return p(w,x,k);if($===MCe)return typeof w.then!="function"&&typeof x.then!="function"&&c(w,x,k);if($===OCe)return g(w,x,k);if($===jCe)return a(w,x,k);if($===$Ce)return c(w,x,k);if(ICe[$])return f(w,x,k);if($===CCe)return e(w,x,k);if($===zCe)return n(w,x,k);if($===RCe||$===DCe||$===BCe)return d(w,x,k);if(v){let R=v[$];if(!R){const T=dCe(w);T&&(R=v[T])}if(R)return R(w,x,k)}return!1}}function VCe({circular:e,createCustomConfig:r,strict:n}){let o={areArrayBuffersEqual:mCe,areArraysEqual:n?Z1:gCe,areDataViewsEqual:yCe,areDatesEqual:vCe,areErrorsEqual:bCe,areFunctionsEqual:xCe,areMapsEqual:n?n9(Eq,Z1):Eq,areNumbersEqual:wCe,areObjectsEqual:n?Z1:kCe,arePrimitiveWrappersEqual:_Ce,areRegExpsEqual:SCe,areSetsEqual:n?n9(Cq,Z1):Cq,areTypedArraysEqual:n?n9(dw,Z1):dw,areUrlsEqual:ECe,unknownTagComparators:void 0};if(r&&(o=Object.assign({},o,r(o))),e){const a=cw(o.areArraysEqual),i=cw(o.areMapsEqual),l=cw(o.areObjectsEqual),s=cw(o.areSetsEqual);o=Object.assign({},o,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:l,areSetsEqual:s})}return o}function qCe(e){return function(r,n,o,a,i,l,s){return e(r,n,s)}}function HCe({circular:e,comparator:r,createState:n,equals:o,strict:a}){if(n)return function(l,s){const{cache:c=e?new WeakMap:void 0,meta:d}=n();return r(l,s,{cache:c,equals:o,meta:d,strict:a})};if(e)return function(l,s){return r(l,s,{cache:new WeakMap,equals:o,meta:void 0,strict:a})};const i={cache:void 0,equals:o,meta:void 0,strict:a};return function(l,s){return r(l,s,i)}}const tt=cd();cd({strict:!0}),cd({circular:!0}),cd({circular:!0,strict:!0});const Ir=cd({createInternalComparator:()=>Ju});cd({strict:!0,createInternalComparator:()=>Ju}),cd({circular:!0,createInternalComparator:()=>Ju}),cd({circular:!0,createInternalComparator:()=>Ju,strict:!0});function cd(e={}){const{circular:r=!1,createInternalComparator:n,createState:o,strict:a=!1}=e,i=VCe(e),l=FCe(i),s=n?n(l):qCe(l);return HCe({circular:r,comparator:l,createState:o,equals:s,strict:a})}function UCe(e,r,n){let o=a=>e(a,...r);return n===void 0?o:Object.assign(o,{lazy:n,lazyArgs:r})}function nr(e,r,n){let o=e.length-r.length;if(o===0)return e(...r);if(o===1)return UCe(e,r,n);throw Error("Wrong number of arguments")}const WCe=e=>(r,n)=>{if(n===0)return e(r);if(!Number.isInteger(n))throw TypeError(`precision must be an integer: ${n.toString()}`);if(n>15||n<-15)throw RangeError("precision must be between -15 and 15");if(Number.isNaN(r)||!Number.isFinite(r))return e(r);let o=Rq(r,n),a=e(o);return Rq(a,-n)};function Rq(e,r){let[n,o]=e.toString().split("e"),a=(o===void 0?0:Number.parseInt(o,10))+r,i=`${n}e${a.toString()}`;return Number.parseFloat(i)}function GCe(...e){return nr(WCe(Math.ceil),e)}function ti(...e){return nr(YCe,e)}const YCe=(e,{min:r,max:n})=>r!==void 0&&en?n:e;function XCe(...e){return nr(ZCe,e)}const ZCe=(e,r)=>[...e,...r],K1={done:!1,hasNext:!1},KCe=e=>({hasNext:!0,next:e,done:!1});function Jr(e,...r){let n=e,o=r.map(i=>"lazy"in i?QCe(i):void 0),a=0;for(;aJr(a,o),o)}throw Error("Wrong number of arguments")}function e$e(...e){return Tq(t$e,e)}function t$e(e){if(e.length===0)return KCe;let r=new Map;for(let n of e)r.set(n,(r.get(n)??0)+1);return n=>{let o=r.get(n);return o===void 0||o===0?{done:!1,hasNext:!0,next:n}:(r.set(n,o-1),K1)}}function xn(...e){return nr(r$e,e)}const r$e=(e,r)=>e.length>=r,jq={asc:(e,r)=>e>r,desc:(e,r)=>ee(i,a)}function o9(e,r,...n){let o=typeof e=="function"?e:e[0],a=typeof e=="function"?"asc":e[1],{[a]:i}=jq,l=r===void 0?void 0:o9(r,...n);return(s,c)=>{let d=o(s),u=o(c);return i(d,u)?1:i(u,d)?-1:l?.(s,c)??0}}function o$e(e){if(Aq(e))return!0;if(typeof e!="object"||!Array.isArray(e))return!1;let[r,n,...o]=e;return Aq(r)&&typeof n=="string"&&n in jq&&o.length===0}const Aq=e=>typeof e=="function"&&e.length===1;function uw(...e){return nr(Object.entries,e)}function ep(...e){return nr(a$e,e,i$e)}const a$e=(e,r)=>e.filter(r),i$e=e=>(r,n,o)=>e(r,n,o)?{done:!1,hasNext:!0,next:r}:K1,Dq=e=>Object.assign(e,{single:!0});function Q1(...e){return nr(l$e,e,Dq(s$e))}const l$e=(e,r)=>e.find(r),s$e=e=>(r,n,o)=>e(r,n,o)?{done:!0,hasNext:!0,next:r}:K1;function hf(...e){return nr(c$e,e,Dq(d$e))}const c$e=([e])=>e,d$e=()=>u$e,u$e=e=>({hasNext:!0,next:e,done:!0});function Mq(...e){return nr(p$e,e,h$e)}const p$e=(e,r)=>e.flatMap(r),h$e=e=>(r,n,o)=>{let a=e(r,n,o);return Array.isArray(a)?{done:!1,hasNext:!0,hasMany:!0,next:a}:{done:!1,hasNext:!0,next:a}};function f$e(...e){return nr(m$e,e)}function m$e(e,r){for(let[n,o]of Object.entries(e))r(o,n,e);return e}function g$e(...e){return nr(y$e,e)}const y$e=(e,r)=>{let n=Object.create(null);for(let o=0;otypeof e=="function";function _$e(e){return e!==null}function Bq(e){return e!=null}function S$e(e){return r=>!e(r)}function ty(e){return e==null}function Iq(e){return typeof e=="number"&&!Number.isNaN(e)}function i9(e){if(typeof e!="object"||!e)return!1;let r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function Oq(...e){return nr(E$e,e)}function E$e(e,r){if(e===r||Object.is(e,r))return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;if(e instanceof Map&&r instanceof Map)return C$e(e,r);if(e instanceof Set&&r instanceof Set)return $$e(e,r);let n=Object.keys(e);if(n.length!==Object.keys(r).length)return!1;for(let o of n){if(!Object.hasOwn(r,o))return!1;let{[o]:a}=e,{[o]:i}=r;if(a!==i||!Object.is(a,i))return!1}return!0}function C$e(e,r){if(e.size!==r.size)return!1;for(let[n,o]of e){let a=r.get(n);if(o!==a||!Object.is(o,a))return!1}return!0}function $$e(e,r){if(e.size!==r.size)return!1;for(let n of e)if(!r.has(n))return!1;return!0}function pw(e){return typeof e=="string"}function Kn(e){return!!e}function Lq(...e){return nr(R$e,e)}const R$e=(e,r)=>e.join(r);function l9(...e){return nr(Object.keys,e)}function dd(...e){return nr(z$e,e)}const z$e=e=>e.at(-1);function un(...e){return nr(T$e,e,j$e)}const T$e=(e,r)=>e.map(r),j$e=e=>(r,n,o)=>({done:!1,hasNext:!0,next:e(r,n,o)});function hw(...e){return nr(A$e,e)}function A$e(e,r){let n={};for(let[o,a]of e.entries()){let[i,l]=r(a,o,e);n[i]=l}return n}function D$e(...e){return nr(M$e,e)}function M$e(e,r){let n={};for(let[o,a]of Object.entries(e))n[o]=r(a,o,e);return n}function Fq(...e){return nr(Vq,e)}function Vq(e,r){let n={...e,...r};for(let o in r){if(!(o in e))continue;let{[o]:a}=e;if(!i9(a))continue;let{[o]:i}=r;i9(i)&&(n[o]=Vq(a,i))}return n}function ud(...e){return nr(N$e,e)}function N$e(e,r){if(!xn(r,1))return{...e};if(!xn(r,2)){let{[r[0]]:o,...a}=e;return a}let n={...e};for(let o of r)delete n[o];return n}function P$e(...e){return nr(B$e,e)}function B$e(e,r){let n={...e};for(let[o,a]of Object.entries(n))r(a,o,e)&&delete n[o];return n}function fw(...e){return nr(I$e,e)}const I$e=e=>e.length===1?e[0]:void 0;function qq(...e){return nr(O$e,e)}const O$e=(e,r)=>{let n=[[],[]];for(let[o,a]of e.entries())r(a,o,e)?n[0].push(a):n[1].push(a);return n};function Hq(...e){return nr(L$e,e)}function L$e(e,r){let n={};for(let o of r)o in e&&(n[o]=e[o]);return n}function ry(...e){return nr(F$e,e)}function F$e(e,r){let n={};for(let[o,a]of Object.entries(e))r(a,o,e)&&(n[o]=a);return n}function rp(e,...r){return typeof e=="string"||typeof e=="number"||typeof e=="symbol"?n=>Uq(n,e,...r):Uq(e,...r)}function Uq(e,...r){let n=e;for(let o of r){if(n==null)return;n=n[o]}return n}function V$e(...e){return nr(q$e,e)}function q$e(e,r){let n=[];for(let o=e;oe.reduce(r,n);function U$e(...e){return nr(W$e,e)}function W$e(e){return[...e].reverse()}function G$e(...e){return nr(Y$e,e)}function Y$e(e,r){let n=[...e];return n.sort(r),n}function gw(...e){return n$e(X$e,e)}const X$e=(e,r)=>[...e].sort(r);function Wq(...e){return nr(Z$e,e)}function Z$e(e,r){return r(e),e}function yw(...e){return Tq(K$e,e)}function K$e(){let e=new Set;return r=>e.has(r)?K1:(e.add(r),{done:!1,hasNext:!0,next:r})}let Ji=[],pd=0;const vw=4,Q$e=e=>{let r=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(o){return n.lc=r.push(o),()=>{for(let i=pd+vw;i"u")return mRe;var r=gRe(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,o-n+r[2]-r[0])}},vRe=Kq(),ff="data-scroll-locked",bRe=function(e,r,n,o){var a=e.left,i=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` +`)),d=c.reduce((u,p)=>u.concat(...p),[]);return[c,d]}return[[],[]]},[e]);return S.useEffect(()=>{const c=r?.target??zV,d=r?.actInsideInputWithModifier??!0;if(e!==null){const u=g=>{if(i.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!i.current||i.current&&!d)&&PF(g))return!1;const v=jV(g.code,s);if(a.current.add(g[v]),TV(l,a.current,!1)){const w=g.composedPath?.()?.[0]||g.target,x=w?.nodeName==="BUTTON"||w?.nodeName==="A";r.preventDefault!==!1&&(i.current||!x)&&g.preventDefault(),o(!0)}},p=g=>{const v=jV(g.code,s);TV(l,a.current,!0)?(o(!1),a.current.clear()):a.current.delete(g[v]),g.key==="Meta"&&a.current.clear(),i.current=!1},f=()=>{a.current.clear(),o(!1)};return c?.addEventListener("keydown",u),c?.addEventListener("keyup",p),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{c?.removeEventListener("keydown",u),c?.removeEventListener("keyup",p),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,o]),n}function TV(e,r,n){return e.filter(o=>n||o.length===r.size).some(o=>o.every(i=>r.has(i)))}function jV(e,r){return r.includes(e)?"code":"key"}const sSe=()=>{const e=vr();return S.useMemo(()=>({zoomIn:r=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomTo:(r,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(r,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(r,n)=>{const{transform:[o,i,a],panZoom:l}=e.getState();return l?(await l.setViewport({x:r.x??o,y:r.y??i,zoom:r.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,n,o]=e.getState().transform;return{x:r,y:n,zoom:o}},setCenter:async(r,n,o)=>e.getState().setCenter(r,n,o),fitBounds:async(r,n)=>{const{width:o,height:i,minZoom:a,maxZoom:l,panZoom:s}=e.getState(),c=Ws(r,o,i,a,l,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,n={})=>{const{transform:o,snapGrid:i,snapToGrid:a,domNode:l}=e.getState();if(!l)return r;const{x:s,y:c}=l.getBoundingClientRect(),d={x:r.x-s,y:r.y-c},u=n.snapGrid??i,p=n.snapToGrid??a;return G1(d,o,p,u)},flowToScreenPosition:r=>{const{transform:n,domNode:o}=e.getState();if(!o)return r;const{x:i,y:a}=o.getBoundingClientRect(),l=Yx(r,n);return{x:l.x+i,y:l.y+a}}}),[])};function AV(e,r){const n=[],o=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")o.set(a.id,[a]);else{const l=o.get(a.id);l?l.push(a):o.set(a.id,[a])}for(const a of r){const l=o.get(a.id);if(!l){n.push(a);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const s={...a};for(const c of l)cSe(c,s);n.push(s)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function cSe(e,r){switch(e.type){case"select":{r.selected=e.selected;break}case"position":{typeof e.position<"u"&&(r.position=e.position),typeof e.dragging<"u"&&(r.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(r.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(r.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(r.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(r.resizing=e.resizing);break}}}function rw(e,r){return AV(e,r)}function nw(e,r){return AV(e,r)}function Qu(e,r){return{id:e,type:"select",selected:r}}function uf(e,r=new Set,n=!1){const o=[];for(const[i,a]of e){const l=r.has(i);!(a.selected===void 0&&!l)&&a.selected!==l&&(n&&(a.selected=l),o.push(Qu(a.id,l)))}return o}function DV({items:e=[],lookup:r}){const n=[],o=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const l=r.get(a.id),s=l?.internals?.userNode??l;s!==void 0&&s!==a&&n.push({id:a.id,item:a,type:"replace"}),s===void 0&&n.push({item:a,type:"add",index:i})}for(const[i]of r)o.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function MV(e){return{id:e.id,type:"remove"}}const NV=e=>P7e(e),dSe=e=>SF(e);function PV(e){return S.forwardRef(e)}const uSe=typeof window<"u"?S.useLayoutEffect:S.useEffect;function BV(e){const[r,n]=S.useState(BigInt(0)),[o]=S.useState(()=>pSe(()=>n(i=>i+BigInt(1))));return uSe(()=>{const i=o.get();i.length&&(e(i),o.reset())},[r]),o}function pSe(e){let r=[];return{get:()=>r,reset:()=>{r=[]},push:n=>{r.push(n),e()}}}const IV=S.createContext(null);function hSe({children:e}){const r=vr(),n=S.useCallback(s=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:u,onNodesChange:p,nodeLookup:f,fitViewQueued:g,onNodesChangeMiddlewareMap:v}=r.getState();let w=c;for(const k of s)w=typeof k=="function"?k(w):k;let x=DV({items:w,lookup:f});for(const k of v.values())x=k(x);u&&d(w),x.length>0?p?.(x):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:k,nodes:C,setNodes:_}=r.getState();k&&_(C)})},[]),o=BV(n),i=S.useCallback(s=>{const{edges:c=[],setEdges:d,hasDefaultEdges:u,onEdgesChange:p,edgeLookup:f}=r.getState();let g=c;for(const v of s)g=typeof v=="function"?v(g):v;u?d(g):p&&p(DV({items:g,lookup:f}))},[]),a=BV(i),l=S.useMemo(()=>({nodeQueue:o,edgeQueue:a}),[]);return y.jsx(IV.Provider,{value:l,children:e})}function fSe(){const e=S.useContext(IV);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const mSe=e=>!!e.panZoom;function pf(){const e=sSe(),r=vr(),n=fSe(),o=Dt(mSe),i=S.useMemo(()=>{const a=p=>r.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},s=p=>{n.edgeQueue.push(p)},c=p=>{const{nodeLookup:f,nodeOrigin:g}=r.getState(),v=NV(p)?p:f.get(p.id),w=v.parentId?DF(v.position,v.measured,v.parentId,f,g):v.position,x={...v,position:w,width:v.measured?.width??v.width,height:v.measured?.height??v.height};return Ku(x)},d=(p,f,g={replace:!1})=>{l(v=>v.map(w=>{if(w.id===p){const x=typeof f=="function"?f(w):f;return g.replace&&NV(x)?x:{...w,...x}}return w}))},u=(p,f,g={replace:!1})=>{s(v=>v.map(w=>{if(w.id===p){const x=typeof f=="function"?f(w):f;return g.replace&&dSe(x)?x:{...w,...x}}return w}))};return{getNodes:()=>r.getState().nodes.map(p=>({...p})),getNode:p=>a(p)?.internals.userNode,getInternalNode:a,getEdges:()=>{const{edges:p=[]}=r.getState();return p.map(f=>({...f}))},getEdge:p=>r.getState().edgeLookup.get(p),setNodes:l,setEdges:s,addNodes:p=>{const f=Array.isArray(p)?p:[p];n.nodeQueue.push(g=>[...g,...f])},addEdges:p=>{const f=Array.isArray(p)?p:[p];n.edgeQueue.push(g=>[...g,...f])},toObject:()=>{const{nodes:p=[],edges:f=[],transform:g}=r.getState(),[v,w,x]=g;return{nodes:p.map(k=>({...k})),edges:f.map(k=>({...k})),viewport:{x:v,y:w,zoom:x}}},deleteElements:async({nodes:p=[],edges:f=[]})=>{const{nodes:g,edges:v,onNodesDelete:w,onEdgesDelete:x,triggerNodeChanges:k,triggerEdgeChanges:C,onDelete:_,onBeforeDelete:$}=r.getState(),{nodes:R,edges:T}=await L7e({nodesToRemove:p,edgesToRemove:f,nodes:g,edges:v,onBeforeDelete:$}),A=T.length>0,z=R.length>0;if(A){const j=T.map(MV);x?.(T),C(j)}if(z){const j=R.map(MV);w?.(R),k(j)}return(z||A)&&_?.({nodes:R,edges:T}),{deletedNodes:R,deletedEdges:T}},getIntersectingNodes:(p,f=!0,g)=>{const v=jF(p),w=v?p:c(p),x=g!==void 0;return w?(g||r.getState().nodes).filter(k=>{const C=r.getState().nodeLookup.get(k.id);if(C&&!v&&(k.id===p.id||!C.internals.positionAbsolute))return!1;const _=Ku(x?k:C),$=U1(_,w);return f&&$>0||$>=_.width*_.height||$>=w.width*w.height}):[]},isNodeIntersecting:(p,f,g=!0)=>{const v=jF(p)?p:c(p);if(!v)return!1;const w=U1(v,f);return g&&w>0||w>=f.width*f.height||w>=v.width*v.height},updateNode:d,updateNodeData:(p,f,g={replace:!1})=>{d(p,v=>{const w=typeof f=="function"?f(v):f;return g.replace?{...v,data:w}:{...v,data:{...v.data,...w}}},g)},updateEdge:u,updateEdgeData:(p,f,g={replace:!1})=>{u(p,v=>{const w=typeof f=="function"?f(v):f;return g.replace?{...v,data:w}:{...v,data:{...v.data,...w}}},g)},getNodesBounds:p=>{const{nodeLookup:f,nodeOrigin:g}=r.getState();return EF(p,{nodeLookup:f,nodeOrigin:g})},getHandleConnections:({type:p,id:f,nodeId:g})=>Array.from(r.getState().connectionLookup.get(`${g}-${p}${f?`-${f}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:f,nodeId:g})=>Array.from(r.getState().connectionLookup.get(`${g}${p?f?`-${p}-${f}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const f=r.getState().fitViewResolver??H7e();return r.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:f}),n.nodeQueue.push(g=>[...g]),f.promise}}},[]);return S.useMemo(()=>({...i,...e,viewportInitialized:o}),[o])}const OV=e=>e.selected,gSe=typeof window<"u"?window:void 0;function ySe({deleteKeyCode:e,multiSelectionKeyCode:r}){const n=vr(),{deleteElements:o}=pf(),i=X1(e,{actInsideInputWithModifier:!1}),a=X1(r,{target:gSe});S.useEffect(()=>{if(i){const{edges:l,nodes:s}=n.getState();o({nodes:s.filter(OV),edges:l.filter(OV)}),n.setState({nodesSelectionActive:!1})}},[i]),S.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function vSe(e){const r=vr();S.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const o=P7(e.current);(o.height===0||o.width===0)&&r.getState().onError?.("004",Gl.error004()),r.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const ow={position:"absolute",width:"100%",height:"100%",top:0,left:0},bSe=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function xSe({onPaneContextMenu:e,zoomOnScroll:r=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Yu.Free,zoomOnDoubleClick:l=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:d,minZoom:u,maxZoom:p,zoomActivationKeyCode:f,preventScrolling:g=!0,children:v,noWheelClassName:w,noPanClassName:x,onViewportChange:k,isControlledViewport:C,paneClickDistance:_,selectionOnDrag:$}){const R=vr(),T=S.useRef(null),{userSelectionActive:A,lib:z,connectionInProgress:j}=Dt(bSe,jr),I=X1(f),P=S.useRef();vSe(T);const L=S.useCallback(H=>{k?.({x:H[0],y:H[1],zoom:H[2]}),C||R.setState({transform:H})},[k,C]);return S.useEffect(()=>{if(T.current){P.current=$9e({domNode:T.current,minZoom:u,maxZoom:p,translateExtent:d,viewport:c,onDraggingChange:B=>R.setState({paneDragging:B}),onPanZoomStart:(B,F)=>{const{onViewportChangeStart:q,onMoveStart:G}=R.getState();G?.(B,F),q?.(F)},onPanZoom:(B,F)=>{const{onViewportChange:q,onMove:G}=R.getState();G?.(B,F),q?.(F)},onPanZoomEnd:(B,F)=>{const{onViewportChangeEnd:q,onMoveEnd:G}=R.getState();G?.(B,F),q?.(F)}});const{x:H,y:M,zoom:V}=P.current.getViewport();return R.setState({panZoom:P.current,transform:[H,M,V],domNode:T.current.closest(".react-flow")}),()=>{P.current?.destroy()}}},[]),S.useEffect(()=>{P.current?.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:s,zoomActivationKeyPressed:I,preventScrolling:g,noPanClassName:x,userSelectionActive:A,noWheelClassName:w,lib:z,onTransformChange:L,connectionInProgress:j,selectionOnDrag:$,paneClickDistance:_})},[e,r,n,o,i,a,l,s,I,g,x,A,w,z,L,j,$,_]),y.jsx("div",{className:"react-flow__renderer",ref:T,style:ow,children:v})}const wSe=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function kSe(){const{userSelectionActive:e,userSelectionRect:r}=Dt(wSe,jr);return e&&r?y.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const Z7=(e,r)=>n=>{n.target===r.current&&e?.(n)},_Se=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function SSe({isSelecting:e,selectionKeyPressed:r,selectionMode:n=q1.Full,panOnDrag:o,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:s,onPaneClick:c,onPaneContextMenu:d,onPaneScroll:u,onPaneMouseEnter:p,onPaneMouseMove:f,onPaneMouseLeave:g,children:v}){const w=vr(),{userSelectionActive:x,elementsSelectable:k,dragging:C,connectionInProgress:_}=Dt(_Se,jr),$=k&&(e||x),R=S.useRef(null),T=S.useRef(),A=S.useRef(new Set),z=S.useRef(new Set),j=S.useRef(!1),I=q=>{if(j.current||_){j.current=!1;return}c?.(q),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},P=q=>{if(Array.isArray(o)&&o?.includes(2)){q.preventDefault();return}d?.(q)},L=u?q=>u(q):void 0,H=q=>{j.current&&(q.stopPropagation(),j.current=!1)},M=q=>{const{domNode:G}=w.getState();if(T.current=G?.getBoundingClientRect(),!T.current)return;const U=q.target===R.current;if(!U&&q.target.closest(".nokey")||!e||!(a&&U||r)||q.button!==0||!q.isPrimary)return;q.target?.setPointerCapture?.(q.pointerId),j.current=!1;const{x:Y,y:K}=Za(q.nativeEvent,T.current);w.setState({userSelectionRect:{width:0,height:0,startX:Y,startY:K,x:Y,y:K}}),U||(q.stopPropagation(),q.preventDefault())},V=q=>{const{userSelectionRect:G,transform:U,nodeLookup:Y,edgeLookup:K,connectionLookup:O,triggerNodeChanges:W,triggerEdgeChanges:Z,defaultEdgeOptions:Q,resetSelectedElements:ie}=w.getState();if(!T.current||!G)return;const{x:te,y:re}=Za(q.nativeEvent,T.current),{startX:ue,startY:_e}=G;if(!j.current){const Be=r?0:i;if(Math.hypot(te-ue,re-_e)<=Be)return;ie(),l?.(q)}j.current=!0;const ce={startX:ue,startY:_e,x:teBe.id)),z.current=new Set;const je=Q?.selectable??!0;for(const Be of A.current){const Je=O.get(Be);if(Je)for(const{edgeId:st}of Je.values()){const Le=K.get(st);Le&&(Le.selectable??je)&&z.current.add(st)}}if(!MF(pe,A.current)){const Be=uf(Y,A.current,!0);W(Be)}if(!MF(xe,z.current)){const Be=uf(K,z.current);Z(Be)}w.setState({userSelectionRect:ce,userSelectionActive:!0,nodesSelectionActive:!1})},B=q=>{q.button===0&&(q.target?.releasePointerCapture?.(q.pointerId),!x&&q.target===R.current&&w.getState().userSelectionRect&&I?.(q),w.setState({userSelectionActive:!1,userSelectionRect:null}),j.current&&(s?.(q),w.setState({nodesSelectionActive:A.current.size>0})))},F=o===!0||Array.isArray(o)&&o.includes(0);return y.jsxs("div",{className:dn(["react-flow__pane",{draggable:F,dragging:C,selection:e}]),onClick:$?void 0:Z7(I,R),onContextMenu:Z7(P,R),onWheel:Z7(L,R),onPointerEnter:$?void 0:p,onPointerMove:$?V:f,onPointerUp:$?B:void 0,onPointerDownCapture:$?M:void 0,onClickCapture:$?H:void 0,onPointerLeave:g,ref:R,style:ow,children:[v,y.jsx(kSe,{})]})}function Q7({id:e,store:r,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:l,nodeLookup:s,onError:c}=r.getState(),d=s.get(e);if(!d){c?.("012",Gl.error012(e));return}r.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(a({nodes:[d],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):i([e])}function LV({nodeRef:e,disabled:r=!1,noDragClassName:n,handleSelector:o,nodeId:i,isSelectable:a,nodeClickDistance:l}){const s=vr(),[c,d]=S.useState(!1),u=S.useRef();return S.useEffect(()=>{u.current=h9e({getStoreItems:()=>s.getState(),onNodeMouseDown:p=>{Q7({id:p,store:s,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),S.useEffect(()=>{if(r)u.current?.destroy();else if(e.current)return u.current?.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:l}),()=>{u.current?.destroy()}},[n,o,r,a,e,i]),c}const ESe=e=>r=>r.selected&&(r.draggable||e&&typeof r.draggable>"u");function FV(){const e=vr();return S.useCallback(r=>{const{nodeExtent:n,snapToGrid:o,snapGrid:i,nodesDraggable:a,onError:l,updateNodePositions:s,nodeLookup:c,nodeOrigin:d}=e.getState(),u=new Map,p=ESe(a),f=o?i[0]:5,g=o?i[1]:5,v=r.direction.x*f*r.factor,w=r.direction.y*g*r.factor;for(const[,x]of c){if(!p(x))continue;let k={x:x.internals.positionAbsolute.x+v,y:x.internals.positionAbsolute.y+w};o&&(k=W1(k,i));const{position:C,positionAbsolute:_}=CF({nodeId:x.id,nextPosition:k,nodeLookup:c,nodeExtent:n,nodeOrigin:d,onError:l});x.position=C,x.internals.positionAbsolute=_,u.set(x.id,x)}s(u)},[])}const J7=S.createContext(null),CSe=J7.Provider;J7.Consumer;const e9=()=>S.useContext(J7),$Se=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),RSe=(e,r,n)=>o=>{const{connectionClickStartHandle:i,connectionMode:a,connection:l}=o,{fromHandle:s,toHandle:c,isValid:d}=l,u=c?.nodeId===e&&c?.id===r&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===r&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===r&&i?.type===n,isPossibleEndHandle:a===rf.Strict?s?.type!==n:e!==s?.nodeId||r!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&d}};function zSe({type:e="source",position:r=Ue.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:l,onConnect:s,children:c,className:d,onMouseDown:u,onTouchStart:p,...f},g){const v=l||null,w=e==="target",x=vr(),k=e9(),{connectOnClick:C,noPanClassName:_,rfId:$}=Dt($Se,jr),{connectingFrom:R,connectingTo:T,clickConnecting:A,isPossibleEndHandle:z,connectionInProcess:j,clickConnectionInProcess:I,valid:P}=Dt(RSe(k,v,e),jr);k||x.getState().onError?.("010",Gl.error010());const L=V=>{const{defaultEdgeOptions:B,onConnect:F,hasDefaultEdges:q}=x.getState(),G={...B,...V};if(q){const{edges:U,setEdges:Y}=x.getState();Y(Z7e(G,U))}F?.(G),s?.(G)},H=V=>{if(!k)return;const B=BF(V.nativeEvent);if(i&&(B&&V.button===0||!B)){const F=x.getState();U7.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:F.autoPanOnConnect,connectionMode:F.connectionMode,connectionRadius:F.connectionRadius,domNode:F.domNode,nodeLookup:F.nodeLookup,lib:F.lib,isTarget:w,handleId:v,nodeId:k,flowId:F.rfId,panBy:F.panBy,cancelConnection:F.cancelConnection,onConnectStart:F.onConnectStart,onConnectEnd:F.onConnectEnd,updateConnection:F.updateConnection,onConnect:L,isValidConnection:n||F.isValidConnection,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:F.autoPanSpeed,dragThreshold:F.connectionDragThreshold})}B?u?.(V):p?.(V)},M=V=>{const{onClickConnectStart:B,onClickConnectEnd:F,connectionClickStartHandle:q,connectionMode:G,isValidConnection:U,lib:Y,rfId:K,nodeLookup:O,connection:W}=x.getState();if(!k||!q&&!i)return;if(!q){B?.(V.nativeEvent,{nodeId:k,handleId:v,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:k,type:e,id:v}});return}const Z=NF(V.target),Q=n||U,{connection:ie,isValid:te}=U7.isValid(V.nativeEvent,{handle:{nodeId:k,id:v,type:e},connectionMode:G,fromNodeId:q.nodeId,fromHandleId:q.id||null,fromType:q.type,isValidConnection:Q,flowId:K,doc:Z,lib:Y,nodeLookup:O});te&&ie&&L(ie);const re=structuredClone(W);delete re.inProgress,re.toPosition=re.toHandle?re.toHandle.position:null,F?.(V,re),x.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":v,"data-nodeid":k,"data-handlepos":r,"data-id":`${$}-${k}-${v}-${e}`,className:dn(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",_,d,{source:!w,target:w,connectable:o,connectablestart:i,connectableend:a,clickconnecting:A,connectingfrom:R,connectingto:T,valid:P,connectionindicator:o&&(!j||z)&&(j||I?a:i)}]),onMouseDown:H,onTouchStart:H,onClick:C?M:void 0,ref:g,...f,children:c})}const Oo=S.memo(PV(zSe));function TSe({data:e,isConnectable:r,sourcePosition:n=Ue.Bottom}){return y.jsxs(y.Fragment,{children:[e?.label,y.jsx(Oo,{type:"source",position:n,isConnectable:r})]})}function jSe({data:e,isConnectable:r,targetPosition:n=Ue.Top,sourcePosition:o=Ue.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(Oo,{type:"target",position:n,isConnectable:r}),e?.label,y.jsx(Oo,{type:"source",position:o,isConnectable:r})]})}function ASe(){return null}function DSe({data:e,isConnectable:r,targetPosition:n=Ue.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(Oo,{type:"target",position:n,isConnectable:r}),e?.label]})}const iw={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},VV={input:TSe,default:jSe,output:DSe,group:ASe};function MSe(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const NSe=e=>{const{width:r,height:n,x:o,y:i}=nf(e.nodeLookup,{filter:a=>!!a.selected});return{width:Ka(r)?r:null,height:Ka(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${i}px)`}};function PSe({onSelectionContextMenu:e,noPanClassName:r,disableKeyboardA11y:n}){const o=vr(),{width:i,height:a,transformString:l,userSelectionActive:s}=Dt(NSe,jr),c=FV(),d=S.useRef(null);if(S.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),LV({nodeRef:d}),s||!i||!a)return null;const u=e?f=>{const g=o.getState().nodes.filter(v=>v.selected);e(f,g)}:void 0,p=f=>{Object.prototype.hasOwnProperty.call(iw,f.key)&&(f.preventDefault(),c({direction:iw[f.key],factor:f.shiftKey?4:1}))};return y.jsx("div",{className:dn(["react-flow__nodesselection","react-flow__container",r]),style:{transform:l},children:y.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:i,height:a}})})}const qV=typeof window<"u"?window:void 0,BSe=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function HV({children:e,onPaneClick:r,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:l,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:u,selectionMode:p,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:v,panActivationKeyCode:w,zoomActivationKeyCode:x,elementsSelectable:k,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:$,panOnScrollSpeed:R,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:z,defaultViewport:j,translateExtent:I,minZoom:P,maxZoom:L,preventScrolling:H,onSelectionContextMenu:M,noWheelClassName:V,noPanClassName:B,disableKeyboardA11y:F,onViewportChange:q,isControlledViewport:G}){const{nodesSelectionActive:U,userSelectionActive:Y}=Dt(BSe,jr),K=X1(d,{target:qV}),O=X1(w,{target:qV}),W=O||z,Z=O||$,Q=u&&W!==!0,ie=K||Y||Q;return ySe({deleteKeyCode:c,multiSelectionKeyCode:v}),y.jsx(xSe,{onPaneContextMenu:a,elementsSelectable:k,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:Z,panOnScrollSpeed:R,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:!K&&W,defaultViewport:j,translateExtent:I,minZoom:P,maxZoom:L,zoomActivationKeyCode:x,preventScrolling:H,noWheelClassName:V,noPanClassName:B,onViewportChange:q,isControlledViewport:G,paneClickDistance:s,selectionOnDrag:Q,children:y.jsxs(SSe,{onSelectionStart:f,onSelectionEnd:g,onPaneClick:r,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:l,panOnDrag:W,isSelecting:!!ie,selectionMode:p,selectionKeyPressed:K,paneClickDistance:s,selectionOnDrag:Q,children:[e,U&&y.jsx(PSe,{onSelectionContextMenu:M,noPanClassName:B,disableKeyboardA11y:F})]})})}HV.displayName="FlowRenderer";const ISe=S.memo(HV),OSe=e=>r=>e?M7(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(n=>n.id):Array.from(r.nodeLookup.keys());function LSe(e){return Dt(S.useCallback(OSe(e),[e]),jr)}const FSe=e=>e.updateNodeInternals;function VSe(){const e=Dt(FSe),[r]=S.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");o.set(a,{id:a,nodeElement:i.target,force:!0})}),e(o)}));return S.useEffect(()=>()=>{r?.disconnect()},[r]),r}function qSe({node:e,nodeType:r,hasDimensions:n,resizeObserver:o}){const i=vr(),a=S.useRef(null),l=S.useRef(null),s=S.useRef(e.sourcePosition),c=S.useRef(e.targetPosition),d=S.useRef(r),u=n&&!!e.internals.handleBounds;return S.useEffect(()=>{a.current&&!e.hidden&&(!u||l.current!==a.current)&&(l.current&&o?.unobserve(l.current),o?.observe(a.current),l.current=a.current)},[u,e.hidden]),S.useEffect(()=>()=>{l.current&&(o?.unobserve(l.current),l.current=null)},[]),S.useEffect(()=>{if(a.current){const p=d.current!==r,f=s.current!==e.sourcePosition,g=c.current!==e.targetPosition;(p||f||g)&&(d.current=r,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,r,e.sourcePosition,e.targetPosition]),a}function HSe({id:e,onClick:r,onMouseEnter:n,onMouseMove:o,onMouseLeave:i,onContextMenu:a,onDoubleClick:l,nodesDraggable:s,elementsSelectable:c,nodesConnectable:d,nodesFocusable:u,resizeObserver:p,noDragClassName:f,noPanClassName:g,disableKeyboardA11y:v,rfId:w,nodeTypes:x,nodeClickDistance:k,onError:C}){const{node:_,internals:$,isParent:R}=Dt(te=>{const re=te.nodeLookup.get(e),ue=te.parentLookup.has(e);return{node:re,internals:re.internals,isParent:ue}},jr);let T=_.type||"default",A=x?.[T]||VV[T];A===void 0&&(C?.("003",Gl.error003(T)),T="default",A=x?.default||VV.default);const z=!!(_.draggable||s&&typeof _.draggable>"u"),j=!!(_.selectable||c&&typeof _.selectable>"u"),I=!!(_.connectable||d&&typeof _.connectable>"u"),P=!!(_.focusable||u&&typeof _.focusable>"u"),L=vr(),H=AF(_),M=qSe({node:_,nodeType:T,hasDimensions:H,resizeObserver:p}),V=LV({nodeRef:M,disabled:_.hidden||!z,noDragClassName:f,handleSelector:_.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:k}),B=FV();if(_.hidden)return null;const F=_o(_),q=MSe(_),G=j||z||r||n||o||i,U=n?te=>n(te,{...$.userNode}):void 0,Y=o?te=>o(te,{...$.userNode}):void 0,K=i?te=>i(te,{...$.userNode}):void 0,O=a?te=>a(te,{...$.userNode}):void 0,W=l?te=>l(te,{...$.userNode}):void 0,Z=te=>{const{selectNodesOnDrag:re,nodeDragThreshold:ue}=L.getState();j&&(!re||!z||ue>0)&&Q7({id:e,store:L,nodeRef:M}),r&&r(te,{...$.userNode})},Q=te=>{if(!(PF(te.nativeEvent)||v)){if(bF.includes(te.key)&&j){const re=te.key==="Escape";Q7({id:e,store:L,unselect:re,nodeRef:M})}else if(z&&_.selected&&Object.prototype.hasOwnProperty.call(iw,te.key)){te.preventDefault();const{ariaLabelConfig:re}=L.getState();L.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~$.positionAbsolute.x,y:~~$.positionAbsolute.y})}),B({direction:iw[te.key],factor:te.shiftKey?4:1})}}},ie=()=>{if(v||!M.current?.matches(":focus-visible"))return;const{transform:te,width:re,height:ue,autoPanOnNodeFocus:_e,setCenter:ce}=L.getState();_e&&(M7(new Map([[e,_]]),{x:0,y:0,width:re,height:ue},te,!0).length>0||ce(_.position.x+F.width/2,_.position.y+F.height/2,{zoom:te[2]}))};return y.jsx("div",{className:dn(["react-flow__node",`react-flow__node-${T}`,{[g]:z},_.className,{selected:_.selected,selectable:j,parent:R,draggable:z,dragging:V}]),ref:M,style:{zIndex:$.z,transform:`translate(${$.positionAbsolute.x}px,${$.positionAbsolute.y}px)`,pointerEvents:G?"all":"none",visibility:H?"visible":"hidden",..._.style,...q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:U,onMouseMove:Y,onMouseLeave:K,onContextMenu:O,onClick:Z,onDoubleClick:W,onKeyDown:P?Q:void 0,tabIndex:P?0:void 0,onFocus:P?ie:void 0,role:_.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":v?void 0:`${_V}-${w}`,"aria-label":_.ariaLabel,..._.domAttributes,children:y.jsx(CSe,{value:e,children:y.jsx(A,{id:e,data:_.data,type:T,positionAbsoluteX:$.positionAbsolute.x,positionAbsoluteY:$.positionAbsolute.y,selected:_.selected??!1,selectable:j,draggable:z,deletable:_.deletable??!0,isConnectable:I,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:V,dragHandle:_.dragHandle,zIndex:$.z,parentId:_.parentId,...F})})})}var USe=S.memo(HSe);const WSe=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function UV(e){const{nodesDraggable:r,nodesConnectable:n,nodesFocusable:o,elementsSelectable:i,onError:a}=Dt(WSe,jr),l=LSe(e.onlyRenderVisibleElements),s=VSe();return y.jsx("div",{className:"react-flow__nodes",style:ow,children:l.map(c=>y.jsx(USe,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:r,nodesConnectable:n,nodesFocusable:o,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},c))})}UV.displayName="NodeRenderer";const GSe=S.memo(UV);function YSe(e){return Dt(S.useCallback(r=>{if(!e)return r.edges.map(o=>o.id);const n=[];if(r.width&&r.height)for(const o of r.edges){const i=r.nodeLookup.get(o.source),a=r.nodeLookup.get(o.target);i&&a&&Y7e({sourceNode:i,targetNode:a,width:r.width,height:r.height,transform:r.transform})&&n.push(o.id)}return n},[e]),jr)}const XSe=({color:e="none",strokeWidth:r=1})=>{const n={strokeWidth:r,...e&&{stroke:e}};return y.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},KSe=({color:e="none",strokeWidth:r=1})=>{const n={strokeWidth:r,...e&&{stroke:e,fill:e}};return y.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},WV={[Hx.Arrow]:XSe,[Hx.ArrowClosed]:KSe};function ZSe(e){const r=vr();return S.useMemo(()=>Object.prototype.hasOwnProperty.call(WV,e)?WV[e]:(r.getState().onError?.("009",Gl.error009(e)),null),[e])}const QSe=({id:e,type:r,color:n,width:o=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:l,orient:s="auto-start-reverse"})=>{const c=ZSe(r);return c?y.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:s,refX:"0",refY:"0",children:y.jsx(c,{color:n,strokeWidth:l})}):null},GV=({defaultColor:e,rfId:r})=>{const n=Dt(a=>a.edges),o=Dt(a=>a.defaultEdgeOptions),i=S.useMemo(()=>t9e(n,{id:r,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,r,e]);return i.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:i.map(a=>y.jsx(QSe,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};GV.displayName="MarkerDefinitions";var JSe=S.memo(GV);function YV({x:e,y:r,label:n,labelStyle:o,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:l=[2,4],labelBgBorderRadius:s=2,children:c,className:d,...u}){const[p,f]=S.useState({x:1,y:0,width:0,height:0}),g=dn(["react-flow__edge-textwrapper",d]),v=S.useRef(null);return S.useEffect(()=>{if(v.current){const w=v.current.getBBox();f({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?y.jsxs("g",{transform:`translate(${e-p.width/2} ${r-p.height/2})`,className:g,visibility:p.width?"visible":"hidden",...u,children:[i&&y.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:a,rx:s,ry:s}),y.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:v,style:o,children:n}),c]}):null}YV.displayName="EdgeText";const eEe=S.memo(YV);function aw({path:e,labelX:r,labelY:n,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:d=20,...u}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...u,d:e,fill:"none",className:dn(["react-flow__edge-path",u.className])}),d?y.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,o&&Ka(r)&&Ka(n)?y.jsx(eEe,{x:r,y:n,label:o,labelStyle:i,labelShowBg:a,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function XV({pos:e,x1:r,y1:n,x2:o,y2:i}){return e===Ue.Left||e===Ue.Right?[.5*(r+o),n]:[r,.5*(n+i)]}function KV({sourceX:e,sourceY:r,sourcePosition:n=Ue.Bottom,targetX:o,targetY:i,targetPosition:a=Ue.Top}){const[l,s]=XV({pos:n,x1:e,y1:r,x2:o,y2:i}),[c,d]=XV({pos:a,x1:o,y1:i,x2:e,y2:r}),[u,p,f,g]=OF({sourceX:e,sourceY:r,targetX:o,targetY:i,sourceControlX:l,sourceControlY:s,targetControlX:c,targetControlY:d});return[`M${e},${r} C${l},${s} ${c},${d} ${o},${i}`,u,p,f,g]}function ZV(e){return S.memo(({id:r,sourceX:n,sourceY:o,targetX:i,targetY:a,sourcePosition:l,targetPosition:s,label:c,labelStyle:d,labelShowBg:u,labelBgStyle:p,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:x,interactionWidth:k})=>{const[C,_,$]=KV({sourceX:n,sourceY:o,sourcePosition:l,targetX:i,targetY:a,targetPosition:s}),R=e.isInternal?void 0:r;return y.jsx(aw,{id:R,path:C,labelX:_,labelY:$,label:c,labelStyle:d,labelShowBg:u,labelBgStyle:p,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:x,interactionWidth:k})})}const tEe=ZV({isInternal:!1}),QV=ZV({isInternal:!0});tEe.displayName="SimpleBezierEdge",QV.displayName="SimpleBezierEdgeInternal";function JV(e){return S.memo(({id:r,sourceX:n,sourceY:o,targetX:i,targetY:a,label:l,labelStyle:s,labelShowBg:c,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:f,sourcePosition:g=Ue.Bottom,targetPosition:v=Ue.Top,markerEnd:w,markerStart:x,pathOptions:k,interactionWidth:C})=>{const[_,$,R]=Zx({sourceX:n,sourceY:o,sourcePosition:g,targetX:i,targetY:a,targetPosition:v,borderRadius:k?.borderRadius,offset:k?.offset,stepPosition:k?.stepPosition}),T=e.isInternal?void 0:r;return y.jsx(aw,{id:T,path:_,labelX:$,labelY:R,label:l,labelStyle:s,labelShowBg:c,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:f,markerEnd:w,markerStart:x,interactionWidth:C})})}const eq=JV({isInternal:!1}),tq=JV({isInternal:!0});eq.displayName="SmoothStepEdge",tq.displayName="SmoothStepEdgeInternal";function rq(e){return S.memo(({id:r,...n})=>{const o=e.isInternal?void 0:r;return y.jsx(eq,{...n,id:o,pathOptions:S.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const rEe=rq({isInternal:!1}),nq=rq({isInternal:!0});rEe.displayName="StepEdge",nq.displayName="StepEdgeInternal";function oq(e){return S.memo(({id:r,sourceX:n,sourceY:o,targetX:i,targetY:a,label:l,labelStyle:s,labelShowBg:c,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:f,markerEnd:g,markerStart:v,interactionWidth:w})=>{const[x,k,C]=VF({sourceX:n,sourceY:o,targetX:i,targetY:a}),_=e.isInternal?void 0:r;return y.jsx(aw,{id:_,path:x,labelX:k,labelY:C,label:l,labelStyle:s,labelShowBg:c,labelBgStyle:d,labelBgPadding:u,labelBgBorderRadius:p,style:f,markerEnd:g,markerStart:v,interactionWidth:w})})}const nEe=oq({isInternal:!1}),iq=oq({isInternal:!0});nEe.displayName="StraightEdge",iq.displayName="StraightEdgeInternal";function aq(e){return S.memo(({id:r,sourceX:n,sourceY:o,targetX:i,targetY:a,sourcePosition:l=Ue.Bottom,targetPosition:s=Ue.Top,label:c,labelStyle:d,labelShowBg:u,labelBgStyle:p,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:x,pathOptions:k,interactionWidth:C})=>{const[_,$,R]=Kx({sourceX:n,sourceY:o,sourcePosition:l,targetX:i,targetY:a,targetPosition:s,curvature:k?.curvature}),T=e.isInternal?void 0:r;return y.jsx(aw,{id:T,path:_,labelX:$,labelY:R,label:c,labelStyle:d,labelShowBg:u,labelBgStyle:p,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:x,interactionWidth:C})})}const oEe=aq({isInternal:!1}),lq=aq({isInternal:!0});oEe.displayName="BezierEdge",lq.displayName="BezierEdgeInternal";const sq={default:lq,straight:iq,step:nq,smoothstep:tq,simplebezier:QV},cq={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},iEe=(e,r,n)=>n===Ue.Left?e-r:n===Ue.Right?e+r:e,aEe=(e,r,n)=>n===Ue.Top?e-r:n===Ue.Bottom?e+r:e,dq="react-flow__edgeupdater";function uq({position:e,centerX:r,centerY:n,radius:o=10,onMouseDown:i,onMouseEnter:a,onMouseOut:l,type:s}){return y.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:l,className:dn([dq,`${dq}-${s}`]),cx:iEe(r,o,e),cy:aEe(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function lEe({isReconnectable:e,reconnectRadius:r,edge:n,sourceX:o,sourceY:i,targetX:a,targetY:l,sourcePosition:s,targetPosition:c,onReconnect:d,onReconnectStart:u,onReconnectEnd:p,setReconnecting:f,setUpdateHover:g}){const v=vr(),w=($,R)=>{if($.button!==0)return;const{autoPanOnConnect:T,domNode:A,isValidConnection:z,connectionMode:j,connectionRadius:I,lib:P,onConnectStart:L,onConnectEnd:H,cancelConnection:M,nodeLookup:V,rfId:B,panBy:F,updateConnection:q}=v.getState(),G=R.type==="target",U=(O,W)=>{f(!1),p?.(O,n,R.type,W)},Y=O=>d?.(n,O),K=(O,W)=>{f(!0),u?.($,n,R.type),L?.(O,W)};U7.onPointerDown($.nativeEvent,{autoPanOnConnect:T,connectionMode:j,connectionRadius:I,domNode:A,handleId:R.id,nodeId:R.nodeId,nodeLookup:V,isTarget:G,edgeUpdaterType:R.type,lib:P,flowId:B,cancelConnection:M,panBy:F,isValidConnection:z,onConnect:Y,onConnectStart:K,onConnectEnd:H,onReconnectEnd:U,updateConnection:q,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,dragThreshold:v.getState().connectionDragThreshold,handleDomNode:$.currentTarget})},x=$=>w($,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=$=>w($,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>g(!0),_=()=>g(!1);return y.jsxs(y.Fragment,{children:[(e===!0||e==="source")&&y.jsx(uq,{position:s,centerX:o,centerY:i,radius:r,onMouseDown:x,onMouseEnter:C,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&y.jsx(uq,{position:c,centerX:a,centerY:l,radius:r,onMouseDown:k,onMouseEnter:C,onMouseOut:_,type:"target"})]})}function sEe({id:e,edgesFocusable:r,edgesReconnectable:n,elementsSelectable:o,onClick:i,onDoubleClick:a,onContextMenu:l,onMouseEnter:s,onMouseMove:c,onMouseLeave:d,reconnectRadius:u,onReconnect:p,onReconnectStart:f,onReconnectEnd:g,rfId:v,edgeTypes:w,noPanClassName:x,onError:k,disableKeyboardA11y:C}){let _=Dt(ce=>ce.edgeLookup.get(e));const $=Dt(ce=>ce.defaultEdgeOptions);_=$?{...$,..._}:_;let R=_.type||"default",T=w?.[R]||sq[R];T===void 0&&(k?.("011",Gl.error011(R)),R="default",T=w?.default||sq.default);const A=!!(_.focusable||r&&typeof _.focusable>"u"),z=typeof p<"u"&&(_.reconnectable||n&&typeof _.reconnectable>"u"),j=!!(_.selectable||o&&typeof _.selectable>"u"),I=S.useRef(null),[P,L]=S.useState(!1),[H,M]=S.useState(!1),V=vr(),{zIndex:B,sourceX:F,sourceY:q,targetX:G,targetY:U,sourcePosition:Y,targetPosition:K}=Dt(S.useCallback(ce=>{const pe=ce.nodeLookup.get(_.source),xe=ce.nodeLookup.get(_.target);if(!pe||!xe)return{zIndex:_.zIndex,...cq};const je=WF({id:e,sourceNode:pe,targetNode:xe,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ce.connectionMode,onError:k});return{zIndex:G7e({selected:_.selected,zIndex:_.zIndex,sourceNode:pe,targetNode:xe,elevateOnSelect:ce.elevateEdgesOnSelect,zIndexMode:ce.zIndexMode}),...je||cq}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),jr),O=S.useMemo(()=>_.markerStart?`url('#${B7(_.markerStart,v)}')`:void 0,[_.markerStart,v]),W=S.useMemo(()=>_.markerEnd?`url('#${B7(_.markerEnd,v)}')`:void 0,[_.markerEnd,v]);if(_.hidden||F===null||q===null||G===null||U===null)return null;const Z=ce=>{const{addSelectedEdges:pe,unselectNodesAndEdges:xe,multiSelectionActive:je}=V.getState();j&&(V.setState({nodesSelectionActive:!1}),_.selected&&je?(xe({nodes:[],edges:[_]}),I.current?.blur()):pe([e])),i&&i(ce,_)},Q=a?ce=>{a(ce,{..._})}:void 0,ie=l?ce=>{l(ce,{..._})}:void 0,te=s?ce=>{s(ce,{..._})}:void 0,re=c?ce=>{c(ce,{..._})}:void 0,ue=d?ce=>{d(ce,{..._})}:void 0,_e=ce=>{if(!C&&bF.includes(ce.key)&&j){const{unselectNodesAndEdges:pe,addSelectedEdges:xe}=V.getState();ce.key==="Escape"?(I.current?.blur(),pe({edges:[_]})):xe([e])}};return y.jsx("svg",{style:{zIndex:B},children:y.jsxs("g",{className:dn(["react-flow__edge",`react-flow__edge-${R}`,_.className,x,{selected:_.selected,animated:_.animated,inactive:!j&&!i,updating:P,selectable:j}]),onClick:Z,onDoubleClick:Q,onContextMenu:ie,onMouseEnter:te,onMouseMove:re,onMouseLeave:ue,onKeyDown:A?_e:void 0,tabIndex:A?0:void 0,role:_.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":A?`${SV}-${v}`:void 0,ref:I,..._.domAttributes,children:[!H&&y.jsx(T,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:j,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:F,sourceY:q,targetX:G,targetY:U,sourcePosition:Y,targetPosition:K,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:O,markerEnd:W,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),z&&y.jsx(lEe,{edge:_,isReconnectable:z,reconnectRadius:u,onReconnect:p,onReconnectStart:f,onReconnectEnd:g,sourceX:F,sourceY:q,targetX:G,targetY:U,sourcePosition:Y,targetPosition:K,setUpdateHover:L,setReconnecting:M})]})})}var cEe=S.memo(sEe);const dEe=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function pq({defaultMarkerColor:e,onlyRenderVisibleElements:r,rfId:n,edgeTypes:o,noPanClassName:i,onReconnect:a,onEdgeContextMenu:l,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:u,reconnectRadius:p,onEdgeDoubleClick:f,onReconnectStart:g,onReconnectEnd:v,disableKeyboardA11y:w}){const{edgesFocusable:x,edgesReconnectable:k,elementsSelectable:C,onError:_}=Dt(dEe,jr),$=YSe(r);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(JSe,{defaultColor:e,rfId:n}),$.map(R=>y.jsx(cEe,{id:R,edgesFocusable:x,edgesReconnectable:k,elementsSelectable:C,noPanClassName:i,onReconnect:a,onContextMenu:l,onMouseEnter:s,onMouseMove:c,onMouseLeave:d,onClick:u,reconnectRadius:p,onDoubleClick:f,onReconnectStart:g,onReconnectEnd:v,rfId:n,onError:_,edgeTypes:o,disableKeyboardA11y:w},R))]})}pq.displayName="EdgeRenderer";const uEe=S.memo(pq),pEe=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function hEe({children:e}){const r=Dt(pEe);return y.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:e})}function fEe(e){const r=pf(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&r.viewportInitialized&&e&&(setTimeout(()=>e(r),1),n.current=!0)},[e,r.viewportInitialized])}const mEe=e=>e.panZoom?.syncViewport;function gEe(e){const r=Dt(mEe),n=vr();return S.useEffect(()=>{e&&(r?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,r]),null}function yEe(e){return e.connection.inProgress?{...e.connection,to:G1(e.connection.to,e.transform)}:{...e.connection}}function vEe(e){return yEe}function bEe(e){const r=vEe();return Dt(r,jr)}const xEe=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function wEe({containerStyle:e,style:r,type:n,component:o}){const{nodesConnectable:i,width:a,height:l,isValid:s,inProgress:c}=Dt(xEe,jr);return a&&i&&c?y.jsx("svg",{style:e,width:a,height:l,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:dn(["react-flow__connection",_F(s)]),children:y.jsx(hq,{style:r,type:n,CustomComponent:o,isValid:s})})}):null}const hq=({style:e,type:r=id.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:i,from:a,fromNode:l,fromHandle:s,fromPosition:c,to:d,toNode:u,toHandle:p,toPosition:f,pointer:g}=bEe();if(!i)return;if(n)return y.jsx(n,{connectionLineType:r,connectionLineStyle:e,fromNode:l,fromHandle:s,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:f,connectionStatus:_F(o),toNode:u,toHandle:p,pointer:g});let v="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:f};switch(r){case id.Bezier:[v]=Kx(w);break;case id.SimpleBezier:[v]=KV(w);break;case id.Step:[v]=Zx({...w,borderRadius:0});break;case id.SmoothStep:[v]=Zx(w);break;default:[v]=VF(w)}return y.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:e})};hq.displayName="ConnectionLine";const kEe={};function fq(e=kEe){S.useRef(e),vr(),S.useEffect(()=>{},[e])}function _Ee(){vr(),S.useRef(!1),S.useEffect(()=>{},[])}function mq({nodeTypes:e,edgeTypes:r,onInit:n,onNodeClick:o,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:l,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:u,onSelectionContextMenu:p,onSelectionStart:f,onSelectionEnd:g,connectionLineType:v,connectionLineStyle:w,connectionLineComponent:x,connectionLineContainerStyle:k,selectionKeyCode:C,selectionOnDrag:_,selectionMode:$,multiSelectionKeyCode:R,panActivationKeyCode:T,zoomActivationKeyCode:A,deleteKeyCode:z,onlyRenderVisibleElements:j,elementsSelectable:I,defaultViewport:P,translateExtent:L,minZoom:H,maxZoom:M,preventScrolling:V,defaultMarkerColor:B,zoomOnScroll:F,zoomOnPinch:q,panOnScroll:G,panOnScrollSpeed:U,panOnScrollMode:Y,zoomOnDoubleClick:K,panOnDrag:O,onPaneClick:W,onPaneMouseEnter:Z,onPaneMouseMove:Q,onPaneMouseLeave:ie,onPaneScroll:te,onPaneContextMenu:re,paneClickDistance:ue,nodeClickDistance:_e,onEdgeContextMenu:ce,onEdgeMouseEnter:pe,onEdgeMouseMove:xe,onEdgeMouseLeave:je,reconnectRadius:Be,onReconnect:Je,onReconnectStart:st,onReconnectEnd:Le,noDragClassName:St,noWheelClassName:Ve,noPanClassName:qe,disableKeyboardA11y:Xe,nodeExtent:It,rfId:Et,viewport:be,onViewportChange:ke}){return fq(e),fq(r),_Ee(),fEe(n),gEe(be),y.jsx(ISe,{onPaneClick:W,onPaneMouseEnter:Z,onPaneMouseMove:Q,onPaneMouseLeave:ie,onPaneContextMenu:re,onPaneScroll:te,paneClickDistance:ue,deleteKeyCode:z,selectionKeyCode:C,selectionOnDrag:_,selectionMode:$,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:R,panActivationKeyCode:T,zoomActivationKeyCode:A,elementsSelectable:I,zoomOnScroll:F,zoomOnPinch:q,zoomOnDoubleClick:K,panOnScroll:G,panOnScrollSpeed:U,panOnScrollMode:Y,panOnDrag:O,defaultViewport:P,translateExtent:L,minZoom:H,maxZoom:M,onSelectionContextMenu:p,preventScrolling:V,noDragClassName:St,noWheelClassName:Ve,noPanClassName:qe,disableKeyboardA11y:Xe,onViewportChange:ke,isControlledViewport:!!be,children:y.jsxs(hEe,{children:[y.jsx(uEe,{edgeTypes:r,onEdgeClick:i,onEdgeDoubleClick:l,onReconnect:Je,onReconnectStart:st,onReconnectEnd:Le,onlyRenderVisibleElements:j,onEdgeContextMenu:ce,onEdgeMouseEnter:pe,onEdgeMouseMove:xe,onEdgeMouseLeave:je,reconnectRadius:Be,defaultMarkerColor:B,noPanClassName:qe,disableKeyboardA11y:Xe,rfId:Et}),y.jsx(wEe,{style:w,type:v,component:x,containerStyle:k}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(GSe,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:u,nodeClickDistance:_e,onlyRenderVisibleElements:j,noPanClassName:qe,noDragClassName:St,disableKeyboardA11y:Xe,nodeExtent:It,rfId:Et}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}mq.displayName="GraphView";const SEe=S.memo(mq),gq=({nodes:e,edges:r,defaultNodes:n,defaultEdges:o,width:i,height:a,fitView:l,fitViewOptions:s,minZoom:c=.5,maxZoom:d=2,nodeOrigin:u,nodeExtent:p,zIndexMode:f="basic"}={})=>{const g=new Map,v=new Map,w=new Map,x=new Map,k=o??r??[],C=n??e??[],_=u??[0,0],$=p??V1;QF(w,x,k);const R=F7(C,g,v,{nodeOrigin:_,nodeExtent:$,zIndexMode:f});let T=[0,0,1];if(l&&i&&a){const A=nf(g,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:z,y:j,zoom:I}=Ws(A,i,a,c,d,s?.padding??.1);T=[z,j,I]}return{rfId:"1",width:i??0,height:a??0,transform:T,nodes:C,nodesInitialized:R,nodeLookup:g,parentLookup:v,edges:k,edgeLookup:x,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:V1,nodeExtent:$,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:rf.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:s,fitViewResolver:null,connection:{...wF},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:F7e,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:xF,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},EEe=({nodes:e,edges:r,defaultNodes:n,defaultEdges:o,width:i,height:a,fitView:l,fitViewOptions:s,minZoom:c,maxZoom:d,nodeOrigin:u,nodeExtent:p,zIndexMode:f})=>q9e((g,v)=>{async function w(){const{nodeLookup:x,panZoom:k,fitViewOptions:C,fitViewResolver:_,width:$,height:R,minZoom:T,maxZoom:A}=v();k&&(await O7e({nodes:x,width:$,height:R,panZoom:k,minZoom:T,maxZoom:A},C),_?.resolve(!0),g({fitViewResolver:null}))}return{...gq({nodes:e,edges:r,width:i,height:a,fitView:l,fitViewOptions:s,minZoom:c,maxZoom:d,nodeOrigin:u,nodeExtent:p,defaultNodes:n,defaultEdges:o,zIndexMode:f}),setNodes:x=>{const{nodeLookup:k,parentLookup:C,nodeOrigin:_,elevateNodesOnSelect:$,fitViewQueued:R,zIndexMode:T}=v(),A=F7(x,k,C,{nodeOrigin:_,nodeExtent:p,elevateNodesOnSelect:$,checkEquality:!0,zIndexMode:T});R&&A?(w(),g({nodes:x,nodesInitialized:A,fitViewQueued:!1,fitViewOptions:void 0})):g({nodes:x,nodesInitialized:A})},setEdges:x=>{const{connectionLookup:k,edgeLookup:C}=v();QF(k,C,x),g({edges:x})},setDefaultNodesAndEdges:(x,k)=>{if(x){const{setNodes:C}=v();C(x),g({hasDefaultNodes:!0})}if(k){const{setEdges:C}=v();C(k),g({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:k,nodeLookup:C,parentLookup:_,domNode:$,nodeOrigin:R,nodeExtent:T,debug:A,fitViewQueued:z,zIndexMode:j}=v(),{changes:I,updatedInternals:P}=c9e(x,C,_,$,R,T,j);P&&(i9e(C,_,{nodeOrigin:R,nodeExtent:T,zIndexMode:j}),z?(w(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),I?.length>0&&(A&&console.log("React Flow: trigger node changes",I),k?.(I)))},updateNodePositions:(x,k=!1)=>{const C=[];let _=[];const{nodeLookup:$,triggerNodeChanges:R,connection:T,updateConnection:A,onNodesChangeMiddlewareMap:z}=v();for(const[j,I]of x){const P=$.get(j),L=!!(P?.expandParent&&P?.parentId&&I?.position),H={id:j,type:"position",position:L?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:k};if(P&&T.inProgress&&T.fromNode.id===P.id){const M=Zu(P,T.fromHandle,Ue.Left,!0);A({...T,from:M})}L&&P.parentId&&C.push({id:j,parentId:P.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),_.push(H)}if(C.length>0){const{parentLookup:j,nodeOrigin:I}=v(),P=q7(C,$,j,I);_.push(...P)}for(const j of z.values())_=j(_);R(_)},triggerNodeChanges:x=>{const{onNodesChange:k,setNodes:C,nodes:_,hasDefaultNodes:$,debug:R}=v();if(x?.length){if($){const T=rw(x,_);C(T)}R&&console.log("React Flow: trigger node changes",x),k?.(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:k,setEdges:C,edges:_,hasDefaultEdges:$,debug:R}=v();if(x?.length){if($){const T=nw(x,_);C(T)}R&&console.log("React Flow: trigger edge changes",x),k?.(x)}},addSelectedNodes:x=>{const{multiSelectionActive:k,edgeLookup:C,nodeLookup:_,triggerNodeChanges:$,triggerEdgeChanges:R}=v();if(k){const T=x.map(A=>Qu(A,!0));$(T);return}$(uf(_,new Set([...x]),!0)),R(uf(C))},addSelectedEdges:x=>{const{multiSelectionActive:k,edgeLookup:C,nodeLookup:_,triggerNodeChanges:$,triggerEdgeChanges:R}=v();if(k){const T=x.map(A=>Qu(A,!0));R(T);return}R(uf(C,new Set([...x]))),$(uf(_,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:k}={})=>{const{edges:C,nodes:_,nodeLookup:$,triggerNodeChanges:R,triggerEdgeChanges:T}=v(),A=x||_,z=k||C,j=A.map(P=>{const L=$.get(P.id);return L&&(L.selected=!1),Qu(P.id,!1)}),I=z.map(P=>Qu(P.id,!1));R(j),T(I)},setMinZoom:x=>{const{panZoom:k,maxZoom:C}=v();k?.setScaleExtent([x,C]),g({minZoom:x})},setMaxZoom:x=>{const{panZoom:k,minZoom:C}=v();k?.setScaleExtent([C,x]),g({maxZoom:x})},setTranslateExtent:x=>{v().panZoom?.setTranslateExtent(x),g({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:k,triggerNodeChanges:C,triggerEdgeChanges:_,elementsSelectable:$}=v();if(!$)return;const R=k.reduce((A,z)=>z.selected?[...A,Qu(z.id,!1)]:A,[]),T=x.reduce((A,z)=>z.selected?[...A,Qu(z.id,!1)]:A,[]);C(R),_(T)},setNodeExtent:x=>{const{nodes:k,nodeLookup:C,parentLookup:_,nodeOrigin:$,elevateNodesOnSelect:R,nodeExtent:T,zIndexMode:A}=v();x[0][0]===T[0][0]&&x[0][1]===T[0][1]&&x[1][0]===T[1][0]&&x[1][1]===T[1][1]||(F7(k,C,_,{nodeOrigin:$,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:A}),g({nodeExtent:x}))},panBy:x=>{const{transform:k,width:C,height:_,panZoom:$,translateExtent:R}=v();return d9e({delta:x,panZoom:$,transform:k,translateExtent:R,width:C,height:_})},setCenter:async(x,k,C)=>{const{width:_,height:$,maxZoom:R,panZoom:T}=v();if(!T)return Promise.resolve(!1);const A=typeof C?.zoom<"u"?C.zoom:R;return await T.setViewport({x:_/2-x*A,y:$/2-k*A,zoom:A},{duration:C?.duration,ease:C?.ease,interpolate:C?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{g({connection:{...wF}})},updateConnection:x=>{g({connection:x})},reset:()=>g({...gq()})}},Object.is);function lw({initialNodes:e,initialEdges:r,defaultNodes:n,defaultEdges:o,initialWidth:i,initialHeight:a,initialMinZoom:l,initialMaxZoom:s,initialFitViewOptions:c,fitView:d,nodeOrigin:u,nodeExtent:p,zIndexMode:f,children:g}){const[v]=S.useState(()=>EEe({nodes:e,edges:r,defaultNodes:n,defaultEdges:o,width:i,height:a,fitView:d,minZoom:l,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:p,zIndexMode:f}));return y.jsx(H9e,{value:v,children:y.jsx(hSe,{children:g})})}function CEe({children:e,nodes:r,edges:n,defaultNodes:o,defaultEdges:i,width:a,height:l,fitView:s,fitViewOptions:c,minZoom:d,maxZoom:u,nodeOrigin:p,nodeExtent:f,zIndexMode:g}){return S.useContext(ew)?y.jsx(y.Fragment,{children:e}):y.jsx(lw,{initialNodes:r,initialEdges:n,defaultNodes:o,defaultEdges:i,initialWidth:a,initialHeight:l,fitView:s,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:u,nodeOrigin:p,nodeExtent:f,zIndexMode:g,children:e})}const $Ee={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function REe({nodes:e,edges:r,defaultNodes:n,defaultEdges:o,className:i,nodeTypes:a,edgeTypes:l,onNodeClick:s,onEdgeClick:c,onInit:d,onMove:u,onMoveStart:p,onMoveEnd:f,onConnect:g,onConnectStart:v,onConnectEnd:w,onClickConnectStart:x,onClickConnectEnd:k,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:$,onNodeContextMenu:R,onNodeDoubleClick:T,onNodeDragStart:A,onNodeDrag:z,onNodeDragStop:j,onNodesDelete:I,onEdgesDelete:P,onDelete:L,onSelectionChange:H,onSelectionDragStart:M,onSelectionDrag:V,onSelectionDragStop:B,onSelectionContextMenu:F,onSelectionStart:q,onSelectionEnd:G,onBeforeDelete:U,connectionMode:Y,connectionLineType:K=id.Bezier,connectionLineStyle:O,connectionLineComponent:W,connectionLineContainerStyle:Z,deleteKeyCode:Q="Backspace",selectionKeyCode:ie="Shift",selectionOnDrag:te=!1,selectionMode:re=q1.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:_e=lf()?"Meta":"Control",zoomActivationKeyCode:ce=lf()?"Meta":"Control",snapToGrid:pe,snapGrid:xe,onlyRenderVisibleElements:je=!1,selectNodesOnDrag:Be,nodesDraggable:Je,autoPanOnNodeFocus:st,nodesConnectable:Le,nodesFocusable:St,nodeOrigin:Ve=EV,edgesFocusable:qe,edgesReconnectable:Xe,elementsSelectable:It=!0,defaultViewport:Et=nSe,minZoom:be=.5,maxZoom:ke=2,translateExtent:Ye=V1,preventScrolling:yt=!0,nodeExtent:xt,defaultMarkerColor:Tr="#b1b1b7",zoomOnScroll:er=!0,zoomOnPinch:qt=!0,panOnScroll:Ht=!1,panOnScrollSpeed:Kr=.5,panOnScrollMode:Gt=Yu.Free,zoomOnDoubleClick:ln=!0,panOnDrag:Wn=!0,onPaneClick:fn,onPaneMouseEnter:oo,onPaneMouseMove:Yo,onPaneMouseLeave:jo,onPaneScroll:ui,onPaneContextMenu:Dl,paneClickDistance:Ao=1,nodeClickDistance:xs=0,children:ws,onReconnect:zc,onReconnectStart:Ml,onReconnectEnd:lh,onEdgeContextMenu:ks,onEdgeDoubleClick:tu,onEdgeMouseEnter:Xo,onEdgeMouseMove:Tc,onEdgeMouseLeave:_s,reconnectRadius:ru=10,onNodesChange:Ss,onEdgesChange:Ko,noDragClassName:Nr="nodrag",noWheelClassName:Mn="nowheel",noPanClassName:Do="nopan",fitView:Nl,fitViewOptions:jc,connectOnClick:sh,attributionPosition:Li,proOptions:Ra,defaultEdgeOptions:Pl,elevateNodesOnSelect:za=!0,elevateEdgesOnSelect:Ta=!1,disableKeyboardA11y:pi=!1,autoPanOnConnect:ho,autoPanOnNodeDrag:Wr,autoPanSpeed:Ac,connectionRadius:Dc,isValidConnection:Fi,onError:ja,style:nu,id:Es,nodeDragThreshold:ou,connectionDragThreshold:ch,viewport:Cs,onViewportChange:$s,width:Mo,height:Gr,colorMode:iu="light",debug:dh,onScroll:Aa,ariaLabelConfig:au,zIndexMode:Da="basic",...lu},J){const ee=Es||"1",oe=lSe(iu),ae=S.useCallback(le=>{le.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Aa?.(le)},[Aa]);return y.jsx("div",{"data-testid":"rf__wrapper",...lu,onScroll:ae,style:{...nu,...$Ee},ref:J,className:dn(["react-flow",i,oe]),id:Es,role:"application",children:y.jsxs(CEe,{nodes:e,edges:r,width:Mo,height:Gr,fitView:Nl,fitViewOptions:jc,minZoom:be,maxZoom:ke,nodeOrigin:Ve,nodeExtent:xt,zIndexMode:Da,children:[y.jsx(SEe,{onInit:d,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:$,onNodeContextMenu:R,onNodeDoubleClick:T,nodeTypes:a,edgeTypes:l,connectionLineType:K,connectionLineStyle:O,connectionLineComponent:W,connectionLineContainerStyle:Z,selectionKeyCode:ie,selectionOnDrag:te,selectionMode:re,deleteKeyCode:Q,multiSelectionKeyCode:_e,panActivationKeyCode:ue,zoomActivationKeyCode:ce,onlyRenderVisibleElements:je,defaultViewport:Et,translateExtent:Ye,minZoom:be,maxZoom:ke,preventScrolling:yt,zoomOnScroll:er,zoomOnPinch:qt,zoomOnDoubleClick:ln,panOnScroll:Ht,panOnScrollSpeed:Kr,panOnScrollMode:Gt,panOnDrag:Wn,onPaneClick:fn,onPaneMouseEnter:oo,onPaneMouseMove:Yo,onPaneMouseLeave:jo,onPaneScroll:ui,onPaneContextMenu:Dl,paneClickDistance:Ao,nodeClickDistance:xs,onSelectionContextMenu:F,onSelectionStart:q,onSelectionEnd:G,onReconnect:zc,onReconnectStart:Ml,onReconnectEnd:lh,onEdgeContextMenu:ks,onEdgeDoubleClick:tu,onEdgeMouseEnter:Xo,onEdgeMouseMove:Tc,onEdgeMouseLeave:_s,reconnectRadius:ru,defaultMarkerColor:Tr,noDragClassName:Nr,noWheelClassName:Mn,noPanClassName:Do,rfId:ee,disableKeyboardA11y:pi,nodeExtent:xt,viewport:Cs,onViewportChange:$s}),y.jsx(aSe,{nodes:e,edges:r,defaultNodes:n,defaultEdges:o,onConnect:g,onConnectStart:v,onConnectEnd:w,onClickConnectStart:x,onClickConnectEnd:k,nodesDraggable:Je,autoPanOnNodeFocus:st,nodesConnectable:Le,nodesFocusable:St,edgesFocusable:qe,edgesReconnectable:Xe,elementsSelectable:It,elevateNodesOnSelect:za,elevateEdgesOnSelect:Ta,minZoom:be,maxZoom:ke,nodeExtent:xt,onNodesChange:Ss,onEdgesChange:Ko,snapToGrid:pe,snapGrid:xe,connectionMode:Y,translateExtent:Ye,connectOnClick:sh,defaultEdgeOptions:Pl,fitView:Nl,fitViewOptions:jc,onNodesDelete:I,onEdgesDelete:P,onDelete:L,onNodeDragStart:A,onNodeDrag:z,onNodeDragStop:j,onSelectionDrag:V,onSelectionDragStart:M,onSelectionDragStop:B,onMove:u,onMoveStart:p,onMoveEnd:f,noPanClassName:Do,nodeOrigin:Ve,rfId:ee,autoPanOnConnect:ho,autoPanOnNodeDrag:Wr,autoPanSpeed:Ac,onError:ja,connectionRadius:Dc,isValidConnection:Fi,selectNodesOnDrag:Be,nodeDragThreshold:ou,connectionDragThreshold:ch,onBeforeDelete:U,debug:dh,ariaLabelConfig:au,zIndexMode:Da}),y.jsx(rSe,{onSelectionChange:H}),ws,y.jsx(Z9e,{proOptions:Ra,position:Li}),y.jsx(K9e,{rfId:ee,disableKeyboardA11y:pi})]})})}var zEe=PV(REe);const TEe=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function yq({children:e}){const r=Dt(TEe);return r?Va.createPortal(e,r):null}function jEe({dimensions:e,lineWidth:r,variant:n,className:o}){return y.jsx("path",{strokeWidth:r,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:dn(["react-flow__background-pattern",n,o])})}function AEe({radius:e,className:r}){return y.jsx("circle",{cx:e,cy:e,r:e,className:dn(["react-flow__background-pattern","dots",r])})}var Qa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qa||(Qa={}));const DEe={[Qa.Dots]:1,[Qa.Lines]:1,[Qa.Cross]:6},MEe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function vq({id:e,variant:r=Qa.Dots,gap:n=20,size:o,lineWidth:i=1,offset:a=0,color:l,bgColor:s,style:c,className:d,patternClassName:u}){const p=S.useRef(null),{transform:f,patternId:g}=Dt(MEe,jr),v=o||DEe[r],w=r===Qa.Dots,x=r===Qa.Cross,k=Array.isArray(n)?n:[n,n],C=[k[0]*f[2]||1,k[1]*f[2]||1],_=v*f[2],$=Array.isArray(a)?a:[a,a],R=x?[_,_]:C,T=[$[0]*f[2]||1+R[0]/2,$[1]*f[2]||1+R[1]/2],A=`${g}${e||""}`;return y.jsxs("svg",{className:dn(["react-flow__background",d]),style:{...c,...ow,"--xy-background-color-props":s,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[y.jsx("pattern",{id:A,x:f[0]%C[0],y:f[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:w?y.jsx(AEe,{radius:_/2,className:u}):y.jsx(jEe,{dimensions:R,lineWidth:i,variant:r,className:u})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}vq.displayName="Background";const bq=S.memo(vq);function NEe(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function PEe(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function BEe(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function IEe(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function OEe(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function sw({children:e,className:r,...n}){return y.jsx("button",{type:"button",className:dn(["react-flow__controls-button",r]),...n,children:e})}const LEe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function xq({style:e,showZoom:r=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:l,onFitView:s,onInteractiveChange:c,className:d,children:u,position:p="bottom-left",orientation:f="vertical","aria-label":g}){const v=vr(),{isInteractive:w,minZoomReached:x,maxZoomReached:k,ariaLabelConfig:C}=Dt(LEe,jr),{zoomIn:_,zoomOut:$,fitView:R}=pf(),T=()=>{_(),a?.()},A=()=>{$(),l?.()},z=()=>{R(i),s?.()},j=()=>{v.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c?.(!w)};return y.jsxs(sd,{className:dn(["react-flow__controls",f==="horizontal"?"horizontal":"vertical",d]),position:p,style:e,"data-testid":"rf__controls","aria-label":g??C["controls.ariaLabel"],children:[r&&y.jsxs(y.Fragment,{children:[y.jsx(sw,{onClick:T,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:k,children:y.jsx(NEe,{})}),y.jsx(sw,{onClick:A,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:x,children:y.jsx(PEe,{})})]}),n&&y.jsx(sw,{className:"react-flow__controls-fitview",onClick:z,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:y.jsx(BEe,{})}),o&&y.jsx(sw,{className:"react-flow__controls-interactive",onClick:j,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:w?y.jsx(OEe,{}):y.jsx(IEe,{})}),u]})}xq.displayName="Controls",S.memo(xq);function FEe({id:e,x:r,y:n,width:o,height:i,style:a,color:l,strokeColor:s,strokeWidth:c,className:d,borderRadius:u,shapeRendering:p,selected:f,onClick:g}){const{background:v,backgroundColor:w}=a||{},x=l||v||w;return y.jsx("rect",{className:dn(["react-flow__minimap-node",{selected:f},d]),x:r,y:n,rx:u,ry:u,width:o,height:i,style:{fill:x,stroke:s,strokeWidth:c},shapeRendering:p,onClick:g?k=>g(k,e):void 0})}const VEe=S.memo(FEe),qEe=e=>e.nodes.map(r=>r.id),t9=e=>e instanceof Function?e:()=>e;function HEe({nodeStrokeColor:e,nodeColor:r,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:a=VEe,onClick:l}){const s=Dt(qEe,jr),c=t9(r),d=t9(e),u=t9(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:s.map(f=>y.jsx(WEe,{id:f,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:u,nodeBorderRadius:o,nodeStrokeWidth:i,NodeComponent:a,onClick:l,shapeRendering:p},f))})}function UEe({id:e,nodeColorFunc:r,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:l,NodeComponent:s,onClick:c}){const{node:d,x:u,y:p,width:f,height:g}=Dt(v=>{const{internals:w}=v.nodeLookup.get(e),x=w.userNode,{x:k,y:C}=w.positionAbsolute,{width:_,height:$}=_o(x);return{node:x,x:k,y:C,width:_,height:$}},jr);return!d||d.hidden||!AF(d)?null:y.jsx(s,{x:u,y:p,width:f,height:g,style:d.style,selected:!!d.selected,className:o(d),color:r(d),borderRadius:i,strokeColor:n(d),strokeWidth:a,shapeRendering:l,onClick:c,id:d.id})}const WEe=S.memo(UEe);var GEe=S.memo(HEe);const YEe=200,XEe=150,KEe=e=>!e.hidden,ZEe=e=>{const r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:e.nodeLookup.size>0?TF(nf(e.nodeLookup,{filter:KEe}),r):r,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},QEe="react-flow__minimap-desc";function wq({style:e,className:r,nodeStrokeColor:n,nodeColor:o,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:l,nodeComponent:s,bgColor:c,maskColor:d,maskStrokeColor:u,maskStrokeWidth:p,position:f="bottom-right",onClick:g,onNodeClick:v,pannable:w=!1,zoomable:x=!1,ariaLabel:k,inversePan:C,zoomStep:_=1,offsetScale:$=5}){const R=vr(),T=S.useRef(null),{boundingRect:A,viewBB:z,rfId:j,panZoom:I,translateExtent:P,flowWidth:L,flowHeight:H,ariaLabelConfig:M}=Dt(ZEe,jr),V=e?.width??YEe,B=e?.height??XEe,F=A.width/V,q=A.height/B,G=Math.max(F,q),U=G*V,Y=G*B,K=$*G,O=A.x-(U-A.width)/2-K,W=A.y-(Y-A.height)/2-K,Z=U+K*2,Q=Y+K*2,ie=`${QEe}-${j}`,te=S.useRef(0),re=S.useRef();te.current=G,S.useEffect(()=>{if(T.current&&I)return re.current=b9e({domNode:T.current,panZoom:I,getTransform:()=>R.getState().transform,getViewScale:()=>te.current}),()=>{re.current?.destroy()}},[I]),S.useEffect(()=>{re.current?.update({translateExtent:P,width:L,height:H,inversePan:C,pannable:w,zoomStep:_,zoomable:x})},[w,x,C,_,P,L,H]);const ue=g?pe=>{const[xe,je]=re.current?.pointer(pe)||[0,0];g(pe,{x:xe,y:je})}:void 0,_e=v?S.useCallback((pe,xe)=>{const je=R.getState().nodeLookup.get(xe).internals.userNode;v(pe,je)},[]):void 0,ce=k??M["minimap.ariaLabel"];return y.jsx(sd,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*G:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:dn(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:V,height:B,viewBox:`${O} ${W} ${Z} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ie,ref:T,onClick:ue,children:[ce&&y.jsx("title",{id:ie,children:ce}),y.jsx(GEe,{onClick:_e,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:l,nodeComponent:s}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${O-K},${W-K}h${Z+K*2}v${Q+K*2}h${-Z-K*2}z + M${z.x},${z.y}h${z.width}v${z.height}h${-z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}wq.displayName="MiniMap",S.memo(wq);const JEe=e=>r=>e?`${Math.max(1/r.transform[2],1)}`:void 0,eCe={[df.Line]:"right",[df.Handle]:"bottom-right"};function tCe({nodeId:e,position:r,variant:n=df.Handle,className:o,style:i=void 0,children:a,color:l,minWidth:s=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:f,autoScale:g=!0,shouldResize:v,onResizeStart:w,onResize:x,onResizeEnd:k}){const C=e9(),_=typeof e=="string"?e:C,$=vr(),R=S.useRef(null),T=n===df.Handle,A=Dt(S.useCallback(JEe(T&&g),[T,g]),jr),z=S.useRef(null),j=r??eCe[n];S.useEffect(()=>{if(!(!R.current||!_))return z.current||(z.current=D9e({domNode:R.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:P,transform:L,snapGrid:H,snapToGrid:M,nodeOrigin:V,domNode:B}=$.getState();return{nodeLookup:P,transform:L,snapGrid:H,snapToGrid:M,nodeOrigin:V,paneDomNode:B}},onChange:(P,L)=>{const{triggerNodeChanges:H,nodeLookup:M,parentLookup:V,nodeOrigin:B}=$.getState(),F=[],q={x:P.x,y:P.y},G=M.get(_);if(G&&G.expandParent&&G.parentId){const U=G.origin??B,Y=P.width??G.measured.width??0,K=P.height??G.measured.height??0,O={id:G.id,parentId:G.parentId,rect:{width:Y,height:K,...DF({x:P.x??G.position.x,y:P.y??G.position.y},{width:Y,height:K},G.parentId,M,U)}},W=q7([O],M,V,B);F.push(...W),q.x=P.x?Math.max(U[0]*Y,P.x):void 0,q.y=P.y?Math.max(U[1]*K,P.y):void 0}if(q.x!==void 0&&q.y!==void 0){const U={id:_,type:"position",position:{...q}};F.push(U)}if(P.width!==void 0&&P.height!==void 0){const U={id:_,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:P.width,height:P.height}};F.push(U)}for(const U of L){const Y={...U,type:"position"};F.push(Y)}H(F)},onEnd:({width:P,height:L})=>{const H={id:_,type:"dimensions",resizing:!1,dimensions:{width:P,height:L}};$.getState().triggerNodeChanges([H])}})),z.current.update({controlPosition:j,boundaries:{minWidth:s,minHeight:c,maxWidth:d,maxHeight:u},keepAspectRatio:p,resizeDirection:f,onResizeStart:w,onResize:x,onResizeEnd:k,shouldResize:v}),()=>{z.current?.destroy()}},[j,s,c,d,u,p,w,x,k,v]);const I=j.split("-");return y.jsx("div",{className:dn(["react-flow__resize-control","nodrag",...I,n,o]),ref:R,style:{...i,scale:A,...l&&{[T?"backgroundColor":"borderColor"]:l}},children:a})}S.memo(tCe);const rCe=e=>e.domNode?.querySelector(".react-flow__renderer");function nCe({children:e}){const r=Dt(rCe);return r?Va.createPortal(e,r):null}const oCe=(e,r)=>e?.internals.positionAbsolute.x!==r?.internals.positionAbsolute.x||e?.internals.positionAbsolute.y!==r?.internals.positionAbsolute.y||e?.measured.width!==r?.measured.width||e?.measured.height!==r?.measured.height||e?.selected!==r?.selected||e?.internals.z!==r?.internals.z,iCe=(e,r)=>{if(e.size!==r.size)return!1;for(const[n,o]of e)if(oCe(o,r.get(n)))return!1;return!0},aCe=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2],selectedNodesCount:e.nodes.filter(r=>r.selected).length});function r9({nodeId:e,children:r,className:n,style:o,isVisible:i,position:a=Ue.Top,offset:l=10,align:s="center",...c}){const d=e9(),u=S.useCallback($=>(Array.isArray(e)?e:[e||d||""]).reduce((R,T)=>{const A=$.nodeLookup.get(T);return A&&R.set(A.id,A),R},new Map),[e,d]),p=Dt(u,iCe),{x:f,y:g,zoom:v,selectedNodesCount:w}=Dt(aCe,jr);if(!(typeof i=="boolean"?i:p.size===1&&p.values().next().value?.selected&&w===1)||!p.size)return null;const x=nf(p),k=Array.from(p.values()),C=Math.max(...k.map($=>$.internals.z+1)),_={position:"absolute",transform:r9e(x,{x:f,y:g,zoom:v},a,l,s),zIndex:C,...o};return y.jsx(nCe,{children:y.jsx("div",{style:_,className:dn(["react-flow__node-toolbar",n]),...c,"data-id":k.reduce(($,R)=>`${$}${R.id} `,"").trim(),children:r})})}const{getOwnPropertyNames:lCe,getOwnPropertySymbols:sCe}=Object,{hasOwnProperty:cCe}=Object.prototype;function n9(e,r){return function(n,o,i){return e(n,o,i)&&r(n,o,i)}}function cw(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);const{cache:i}=o,a=i.get(r),l=i.get(n);if(a&&l)return a===n&&l===r;i.set(r,n),i.set(n,r);const s=e(r,n,o);return i.delete(r),i.delete(n),s}}function dCe(e){return e?.[Symbol.toStringTag]}function kq(e){return lCe(e).concat(sCe(e))}const uCe=Object.hasOwn||((e,r)=>cCe.call(e,r));function Ju(e,r){return e===r||!e&&!r&&e!==e&&r!==r}const pCe="__v",hCe="__o",fCe="_owner",{getOwnPropertyDescriptor:_q,keys:Sq}=Object;function mCe(e,r){return e.byteLength===r.byteLength&&dw(new Uint8Array(e),new Uint8Array(r))}function gCe(e,r,n){let o=e.length;if(r.length!==o)return!1;for(;o-- >0;)if(!n.equals(e[o],r[o],o,o,e,r,n))return!1;return!0}function yCe(e,r){return e.byteLength===r.byteLength&&dw(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(r.buffer,r.byteOffset,r.byteLength))}function vCe(e,r){return Ju(e.getTime(),r.getTime())}function bCe(e,r){return e.name===r.name&&e.message===r.message&&e.cause===r.cause&&e.stack===r.stack}function xCe(e,r){return e===r}function Eq(e,r,n){const o=e.size;if(o!==r.size)return!1;if(!o)return!0;const i=new Array(o),a=e.entries();let l,s,c=0;for(;(l=a.next())&&!l.done;){const d=r.entries();let u=!1,p=0;for(;(s=d.next())&&!s.done;){if(i[p]){p++;continue}const f=l.value,g=s.value;if(n.equals(f[0],g[0],c,p,e,r,n)&&n.equals(f[1],g[1],f[0],g[0],e,r,n)){u=i[p]=!0;break}p++}if(!u)return!1;c++}return!0}const wCe=Ju;function kCe(e,r,n){const o=Sq(e);let i=o.length;if(Sq(r).length!==i)return!1;for(;i-- >0;)if(!$q(e,r,n,o[i]))return!1;return!0}function K1(e,r,n){const o=kq(e);let i=o.length;if(kq(r).length!==i)return!1;let a,l,s;for(;i-- >0;)if(a=o[i],!$q(e,r,n,a)||(l=_q(e,a),s=_q(r,a),(l||s)&&(!l||!s||l.configurable!==s.configurable||l.enumerable!==s.enumerable||l.writable!==s.writable)))return!1;return!0}function _Ce(e,r){return Ju(e.valueOf(),r.valueOf())}function SCe(e,r){return e.source===r.source&&e.flags===r.flags}function Cq(e,r,n){const o=e.size;if(o!==r.size)return!1;if(!o)return!0;const i=new Array(o),a=e.values();let l,s;for(;(l=a.next())&&!l.done;){const c=r.values();let d=!1,u=0;for(;(s=c.next())&&!s.done;){if(!i[u]&&n.equals(l.value,s.value,l.value,s.value,e,r,n)){d=i[u]=!0;break}u++}if(!d)return!1}return!0}function dw(e,r){let n=e.byteLength;if(r.byteLength!==n||e.byteOffset!==r.byteOffset)return!1;for(;n-- >0;)if(e[n]!==r[n])return!1;return!0}function ECe(e,r){return e.hostname===r.hostname&&e.pathname===r.pathname&&e.protocol===r.protocol&&e.port===r.port&&e.hash===r.hash&&e.username===r.username&&e.password===r.password}function $q(e,r,n,o){return(o===fCe||o===hCe||o===pCe)&&(e.$$typeof||r.$$typeof)?!0:uCe(r,o)&&n.equals(e[o],r[o],o,o,e,r,n)}const CCe="[object ArrayBuffer]",$Ce="[object Arguments]",RCe="[object Boolean]",zCe="[object DataView]",TCe="[object Date]",jCe="[object Error]",ACe="[object Map]",DCe="[object Number]",MCe="[object Object]",NCe="[object RegExp]",PCe="[object Set]",BCe="[object String]",ICe={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},OCe="[object URL]",LCe=Object.prototype.toString;function FCe({areArrayBuffersEqual:e,areArraysEqual:r,areDataViewsEqual:n,areDatesEqual:o,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:l,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:d,areRegExpsEqual:u,areSetsEqual:p,areTypedArraysEqual:f,areUrlsEqual:g,unknownTagComparators:v}){return function(w,x,k){if(w===x)return!0;if(w==null||x==null)return!1;const C=typeof w;if(C!==typeof x)return!1;if(C!=="object")return C==="number"?s(w,x,k):C==="function"?a(w,x,k):!1;const _=w.constructor;if(_!==x.constructor)return!1;if(_===Object)return c(w,x,k);if(Array.isArray(w))return r(w,x,k);if(_===Date)return o(w,x,k);if(_===RegExp)return u(w,x,k);if(_===Map)return l(w,x,k);if(_===Set)return p(w,x,k);const $=LCe.call(w);if($===TCe)return o(w,x,k);if($===NCe)return u(w,x,k);if($===ACe)return l(w,x,k);if($===PCe)return p(w,x,k);if($===MCe)return typeof w.then!="function"&&typeof x.then!="function"&&c(w,x,k);if($===OCe)return g(w,x,k);if($===jCe)return i(w,x,k);if($===$Ce)return c(w,x,k);if(ICe[$])return f(w,x,k);if($===CCe)return e(w,x,k);if($===zCe)return n(w,x,k);if($===RCe||$===DCe||$===BCe)return d(w,x,k);if(v){let R=v[$];if(!R){const T=dCe(w);T&&(R=v[T])}if(R)return R(w,x,k)}return!1}}function VCe({circular:e,createCustomConfig:r,strict:n}){let o={areArrayBuffersEqual:mCe,areArraysEqual:n?K1:gCe,areDataViewsEqual:yCe,areDatesEqual:vCe,areErrorsEqual:bCe,areFunctionsEqual:xCe,areMapsEqual:n?n9(Eq,K1):Eq,areNumbersEqual:wCe,areObjectsEqual:n?K1:kCe,arePrimitiveWrappersEqual:_Ce,areRegExpsEqual:SCe,areSetsEqual:n?n9(Cq,K1):Cq,areTypedArraysEqual:n?n9(dw,K1):dw,areUrlsEqual:ECe,unknownTagComparators:void 0};if(r&&(o=Object.assign({},o,r(o))),e){const i=cw(o.areArraysEqual),a=cw(o.areMapsEqual),l=cw(o.areObjectsEqual),s=cw(o.areSetsEqual);o=Object.assign({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:l,areSetsEqual:s})}return o}function qCe(e){return function(r,n,o,i,a,l,s){return e(r,n,s)}}function HCe({circular:e,comparator:r,createState:n,equals:o,strict:i}){if(n)return function(l,s){const{cache:c=e?new WeakMap:void 0,meta:d}=n();return r(l,s,{cache:c,equals:o,meta:d,strict:i})};if(e)return function(l,s){return r(l,s,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};const a={cache:void 0,equals:o,meta:void 0,strict:i};return function(l,s){return r(l,s,a)}}const tt=cd();cd({strict:!0}),cd({circular:!0}),cd({circular:!0,strict:!0});const Ir=cd({createInternalComparator:()=>Ju});cd({strict:!0,createInternalComparator:()=>Ju}),cd({circular:!0,createInternalComparator:()=>Ju}),cd({circular:!0,createInternalComparator:()=>Ju,strict:!0});function cd(e={}){const{circular:r=!1,createInternalComparator:n,createState:o,strict:i=!1}=e,a=VCe(e),l=FCe(a),s=n?n(l):qCe(l);return HCe({circular:r,comparator:l,createState:o,equals:s,strict:i})}function UCe(e,r,n){let o=i=>e(i,...r);return n===void 0?o:Object.assign(o,{lazy:n,lazyArgs:r})}function nr(e,r,n){let o=e.length-r.length;if(o===0)return e(...r);if(o===1)return UCe(e,r,n);throw Error("Wrong number of arguments")}const WCe=e=>(r,n)=>{if(n===0)return e(r);if(!Number.isInteger(n))throw TypeError(`precision must be an integer: ${n.toString()}`);if(n>15||n<-15)throw RangeError("precision must be between -15 and 15");if(Number.isNaN(r)||!Number.isFinite(r))return e(r);let o=Rq(r,n),i=e(o);return Rq(i,-n)};function Rq(e,r){let[n,o]=e.toString().split("e"),i=(o===void 0?0:Number.parseInt(o,10))+r,a=`${n}e${i.toString()}`;return Number.parseFloat(a)}function GCe(...e){return nr(WCe(Math.ceil),e)}function ta(...e){return nr(YCe,e)}const YCe=(e,{min:r,max:n})=>r!==void 0&&en?n:e;function XCe(...e){return nr(KCe,e)}const KCe=(e,r)=>[...e,...r],Z1={done:!1,hasNext:!1},ZCe=e=>({hasNext:!0,next:e,done:!1});function Jr(e,...r){let n=e,o=r.map(a=>"lazy"in a?QCe(a):void 0),i=0;for(;iJr(i,o),o)}throw Error("Wrong number of arguments")}function e$e(...e){return Tq(t$e,e)}function t$e(e){if(e.length===0)return ZCe;let r=new Map;for(let n of e)r.set(n,(r.get(n)??0)+1);return n=>{let o=r.get(n);return o===void 0||o===0?{done:!1,hasNext:!0,next:n}:(r.set(n,o-1),Z1)}}function xn(...e){return nr(r$e,e)}const r$e=(e,r)=>e.length>=r,jq={asc:(e,r)=>e>r,desc:(e,r)=>ee(a,i)}function o9(e,r,...n){let o=typeof e=="function"?e:e[0],i=typeof e=="function"?"asc":e[1],{[i]:a}=jq,l=r===void 0?void 0:o9(r,...n);return(s,c)=>{let d=o(s),u=o(c);return a(d,u)?1:a(u,d)?-1:l?.(s,c)??0}}function o$e(e){if(Aq(e))return!0;if(typeof e!="object"||!Array.isArray(e))return!1;let[r,n,...o]=e;return Aq(r)&&typeof n=="string"&&n in jq&&o.length===0}const Aq=e=>typeof e=="function"&&e.length===1;function uw(...e){return nr(Object.entries,e)}function ep(...e){return nr(i$e,e,a$e)}const i$e=(e,r)=>e.filter(r),a$e=e=>(r,n,o)=>e(r,n,o)?{done:!1,hasNext:!0,next:r}:Z1,Dq=e=>Object.assign(e,{single:!0});function Q1(...e){return nr(l$e,e,Dq(s$e))}const l$e=(e,r)=>e.find(r),s$e=e=>(r,n,o)=>e(r,n,o)?{done:!0,hasNext:!0,next:r}:Z1;function hf(...e){return nr(c$e,e,Dq(d$e))}const c$e=([e])=>e,d$e=()=>u$e,u$e=e=>({hasNext:!0,next:e,done:!0});function Mq(...e){return nr(p$e,e,h$e)}const p$e=(e,r)=>e.flatMap(r),h$e=e=>(r,n,o)=>{let i=e(r,n,o);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function f$e(...e){return nr(m$e,e)}function m$e(e,r){for(let[n,o]of Object.entries(e))r(o,n,e);return e}function g$e(...e){return nr(y$e,e)}const y$e=(e,r)=>{let n=Object.create(null);for(let o=0;otypeof e=="function";function _$e(e){return e!==null}function Bq(e){return e!=null}function S$e(e){return r=>!e(r)}function ty(e){return e==null}function Iq(e){return typeof e=="number"&&!Number.isNaN(e)}function a9(e){if(typeof e!="object"||!e)return!1;let r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function Oq(...e){return nr(E$e,e)}function E$e(e,r){if(e===r||Object.is(e,r))return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;if(e instanceof Map&&r instanceof Map)return C$e(e,r);if(e instanceof Set&&r instanceof Set)return $$e(e,r);let n=Object.keys(e);if(n.length!==Object.keys(r).length)return!1;for(let o of n){if(!Object.hasOwn(r,o))return!1;let{[o]:i}=e,{[o]:a}=r;if(i!==a||!Object.is(i,a))return!1}return!0}function C$e(e,r){if(e.size!==r.size)return!1;for(let[n,o]of e){let i=r.get(n);if(o!==i||!Object.is(o,i))return!1}return!0}function $$e(e,r){if(e.size!==r.size)return!1;for(let n of e)if(!r.has(n))return!1;return!0}function pw(e){return typeof e=="string"}function Zn(e){return!!e}function Lq(...e){return nr(R$e,e)}const R$e=(e,r)=>e.join(r);function l9(...e){return nr(Object.keys,e)}function dd(...e){return nr(z$e,e)}const z$e=e=>e.at(-1);function un(...e){return nr(T$e,e,j$e)}const T$e=(e,r)=>e.map(r),j$e=e=>(r,n,o)=>({done:!1,hasNext:!0,next:e(r,n,o)});function hw(...e){return nr(A$e,e)}function A$e(e,r){let n={};for(let[o,i]of e.entries()){let[a,l]=r(i,o,e);n[a]=l}return n}function D$e(...e){return nr(M$e,e)}function M$e(e,r){let n={};for(let[o,i]of Object.entries(e))n[o]=r(i,o,e);return n}function Fq(...e){return nr(Vq,e)}function Vq(e,r){let n={...e,...r};for(let o in r){if(!(o in e))continue;let{[o]:i}=e;if(!a9(i))continue;let{[o]:a}=r;a9(a)&&(n[o]=Vq(i,a))}return n}function ud(...e){return nr(N$e,e)}function N$e(e,r){if(!xn(r,1))return{...e};if(!xn(r,2)){let{[r[0]]:o,...i}=e;return i}let n={...e};for(let o of r)delete n[o];return n}function P$e(...e){return nr(B$e,e)}function B$e(e,r){let n={...e};for(let[o,i]of Object.entries(n))r(i,o,e)&&delete n[o];return n}function fw(...e){return nr(I$e,e)}const I$e=e=>e.length===1?e[0]:void 0;function qq(...e){return nr(O$e,e)}const O$e=(e,r)=>{let n=[[],[]];for(let[o,i]of e.entries())r(i,o,e)?n[0].push(i):n[1].push(i);return n};function Hq(...e){return nr(L$e,e)}function L$e(e,r){let n={};for(let o of r)o in e&&(n[o]=e[o]);return n}function ry(...e){return nr(F$e,e)}function F$e(e,r){let n={};for(let[o,i]of Object.entries(e))r(i,o,e)&&(n[o]=i);return n}function rp(e,...r){return typeof e=="string"||typeof e=="number"||typeof e=="symbol"?n=>Uq(n,e,...r):Uq(e,...r)}function Uq(e,...r){let n=e;for(let o of r){if(n==null)return;n=n[o]}return n}function V$e(...e){return nr(q$e,e)}function q$e(e,r){let n=[];for(let o=e;oe.reduce(r,n);function U$e(...e){return nr(W$e,e)}function W$e(e){return[...e].reverse()}function G$e(...e){return nr(Y$e,e)}function Y$e(e,r){let n=[...e];return n.sort(r),n}function gw(...e){return n$e(X$e,e)}const X$e=(e,r)=>[...e].sort(r);function Wq(...e){return nr(K$e,e)}function K$e(e,r){return r(e),e}function yw(...e){return Tq(Z$e,e)}function Z$e(){let e=new Set;return r=>e.has(r)?Z1:(e.add(r),{done:!1,hasNext:!0,next:r})}let Ja=[],pd=0;const vw=4,Q$e=e=>{let r=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(o){return n.lc=r.push(o),()=>{for(let a=pd+vw;a"u")return mRe;var r=gRe(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,o-n+r[2]-r[0])}},vRe=Zq(),ff="data-scroll-locked",bRe=function(e,r,n,o){var i=e.left,a=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(eRe,` { overflow: hidden `).concat(o,`; padding-right: `).concat(s,"px ").concat(o,`; @@ -62,8 +62,8 @@ function Lge(e,r){for(var n=0;n